From d8f87d0065cec9b22a12559689ee19ca1b5006aa Mon Sep 17 00:00:00 2001 From: VRiveland Date: Tue, 21 Jan 2025 13:53:19 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20equinor/?= =?UTF-8?q?esv-intersection@55c9ad1fddb63e805729ba0838d8173c10f9c1b2=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...32ec5d4.js => GeomodelLayerV2-4f8f3306.js} | 2 +- ...ayer-416fefe9.js => GridLayer-66718e35.js} | 2 +- ...ae0d41fa.js => MainController-1e1a9474.js} | 2 +- ...0b66f.js => WellborePathLayer-11ff1510.js} | 2 +- ...s-733cecb2.js => axis.stories-a4be38eb.js} | 2 +- ...=> basic-intersection.stories-d9b48339.js} | 2 +- ...f.js => callout-layer.stories-9cb185f5.js} | 2 +- ...ments-84f906e9.js => elements-217018fd.js} | 124 +- ....js => geomodel-layer.stories-d4ee5bea.js} | 2 +- ...3241.js => grid-layer.stories-35e853d6.js} | 2 +- ...4c1c1.js => highlight.stories-ea01c9f0.js} | 2 +- storybook/master/assets/iframe-1c262315.js | 1 + storybook/master/assets/iframe-2e3441a7.js | 1 - .../master/assets/index.stories-0b05fd63.js | 1 - ...-56f68182.js => index.stories-2f6ae410.js} | 2 +- .../master/assets/index.stories-63507133.js | 1 + .../master/assets/index.stories-c8372e2e.js | 1 + .../master/assets/index.stories-d76bb6d8.js | 1 - ...3b.js => intersection.stories-fb6bd89f.js} | 2 +- .../{picks-4685a18c.js => picks-2410da4c.js} | 2 +- ...js => schematic-layer.stories-5b12023d.js} | 2 +- ...0d3420.js => seismic-colormap-ec670136.js} | 2 +- ...ef4002e.js => seismic.stories-e3ed59c5.js} | 2 +- ...=> wellborepath-layer.stories-52ba7562.js} | 2 +- ...s-5e6c73d2.js => zoom.stories-f007092c.js} | 2 +- storybook/master/iframe.html | 4 +- storybook/master/index.json | 2 +- storybook/master/interfaces.d.ts | 2 +- .../UniformTextureStretchRopeGeometry.d.ts | 3 +- .../master/layers/GeomodelLabelsLayer.d.ts | 2 +- storybook/master/project.json | 2 +- .../common-manager-bundle.js | 2 +- .../manager-bundle.js | 6 +- .../sb-addons/storysource-1/manager-bundle.js | 2 +- .../master/sb-manager/globals-module-info.js | 28 +- .../master/sb-manager/globals-runtime.js | 72709 +++++++--------- storybook/master/sb-manager/runtime.js | 20047 +++-- storybook/master/sb-preview/runtime.js | 9398 +- storybook/master/utils/vectorUtils.d.ts | 2 +- 39 files changed, 43891 insertions(+), 58484 deletions(-) rename storybook/master/assets/{GeomodelLayerV2-032ec5d4.js => GeomodelLayerV2-4f8f3306.js} (99%) rename storybook/master/assets/{GridLayer-416fefe9.js => GridLayer-66718e35.js} (99%) rename storybook/master/assets/{MainController-ae0d41fa.js => MainController-1e1a9474.js} (99%) rename storybook/master/assets/{WellborePathLayer-4cd0b66f.js => WellborePathLayer-11ff1510.js} (99%) rename storybook/master/assets/{axis.stories-733cecb2.js => axis.stories-a4be38eb.js} (94%) rename storybook/master/assets/{basic-intersection.stories-781b633f.js => basic-intersection.stories-d9b48339.js} (84%) rename storybook/master/assets/{callout-layer.stories-0df518bf.js => callout-layer.stories-9cb185f5.js} (93%) rename storybook/master/assets/{elements-84f906e9.js => elements-217018fd.js} (75%) rename storybook/master/assets/{geomodel-layer.stories-2e09c9c8.js => geomodel-layer.stories-d4ee5bea.js} (98%) rename storybook/master/assets/{grid-layer.stories-de373241.js => grid-layer.stories-35e853d6.js} (92%) rename storybook/master/assets/{highlight.stories-7be4c1c1.js => highlight.stories-ea01c9f0.js} (96%) create mode 100644 storybook/master/assets/iframe-1c262315.js delete mode 100644 storybook/master/assets/iframe-2e3441a7.js delete mode 100644 storybook/master/assets/index.stories-0b05fd63.js rename storybook/master/assets/{index.stories-56f68182.js => index.stories-2f6ae410.js} (56%) create mode 100644 storybook/master/assets/index.stories-63507133.js create mode 100644 storybook/master/assets/index.stories-c8372e2e.js delete mode 100644 storybook/master/assets/index.stories-d76bb6d8.js rename storybook/master/assets/{intersection.stories-18a12c3b.js => intersection.stories-fb6bd89f.js} (96%) rename storybook/master/assets/{picks-4685a18c.js => picks-2410da4c.js} (99%) rename storybook/master/assets/{schematic-layer.stories-6624709d.js => schematic-layer.stories-5b12023d.js} (98%) rename storybook/master/assets/{seismic-colormap-ee0d3420.js => seismic-colormap-ec670136.js} (98%) rename storybook/master/assets/{seismic.stories-0ef4002e.js => seismic.stories-e3ed59c5.js} (96%) rename storybook/master/assets/{wellborepath-layer.stories-a8a64590.js => wellborepath-layer.stories-52ba7562.js} (92%) rename storybook/master/assets/{zoom.stories-5e6c73d2.js => zoom.stories-f007092c.js} (98%) diff --git a/storybook/master/assets/GeomodelLayerV2-032ec5d4.js b/storybook/master/assets/GeomodelLayerV2-4f8f3306.js similarity index 99% rename from storybook/master/assets/GeomodelLayerV2-032ec5d4.js rename to storybook/master/assets/GeomodelLayerV2-4f8f3306.js index 791f60f8..3bf96e41 100644 --- a/storybook/master/assets/GeomodelLayerV2-032ec5d4.js +++ b/storybook/master/assets/GeomodelLayerV2-4f8f3306.js @@ -1 +1 @@ -import{C as K,j as L,k as $,h as Q,l as tt,G as k}from"./elements-84f906e9.js";import{f as P}from"./findsample-cc6ecc23.js";const et=18,st=8,nt=13,it="black",ot="Arial",at=70;class ct extends K{constructor(t,e){super(t,e),this.defaultMargins=et,this.defaultMinFontSize=st,this.defaultMaxFontSize=nt,this.defaultTextColor=it,this.defaultFont=ot,this.isLabelsOnLeftSide=!0,this.maxFontSizeInWorldCoordinates=at,this.isXFlipped=!1,this.areasWithAvgTopDepth=[],this.drawAreaLabel=(n,s,a,l)=>{const{data:r}=n,{ctx:o,maxFontSizeInWorldCoordinates:u,isXFlipped:i}=this,{xScale:d,yScale:h,xRatio:g,yRatio:f,zFactor:p}=this.rescaleEvent;if(o==null)return;let c=this.checkDrawLabelsOnLeftSide();const v=(this.options.margins||this.defaultMargins)*(i?-1:1)/g,D=this.options.minFontSize||this.defaultMinFontSize;let m=(this.options.maxFontSize||this.defaultMaxFontSize)/f;m>u&&(m=u,m*fb||i&&Ex)&&(c=!0)}let A;const y=.07;c?A=i?Math.min(x,I):Math.max(x,I):A=i?Math.max(b,S):Math.min(b,S);const W=h.invert(h.range()[0]),R=h.invert(h.range()[1]),w=5,X=3,Y=y*(F/X)*(c?1:-1)*(i?-1:1),G=F/w*(c?1:-1)*(i?-1:1),U=r.map(E=>[E[0],E[1]]),O=this.calcPos(U,A,X,Y,W,R);if(!O)return;const N=r.map(E=>[E[0],E[2]]);let z=this.calcPos(N,A,X,Y,W,R,(s==null?void 0:s.data.map(E=>[E[0],E[1]]))??[],a,l);z||(z=new L(O.x,R));const _=z.y-O.y;if(_[E[0],E[1]]))??[],a,l),V=Math.atan(Math.tan(j)*p),q=A,H=(O.y+z.y)/2,J=i?-V:V;o&&(o.textAlign=c?"left":"right",o.translate(d(q),h(H)),o.rotate(J),o.fillStyle=this.options.textColor||this.defaultTextColor,o.font=`${m*f}px ${this.options.font||this.defaultFont}`,o.textBaseline="middle",o.fillText(n.label??"",0,0),o.restore())},this.drawLineLabel=n=>{const{ctx:s,isXFlipped:a}=this,{xScale:l,yScale:r,xRatio:o,yRatio:u,zFactor:i}=this.rescaleEvent;if(s==null)return;const d=this.checkDrawLabelsOnLeftSide(),h=this.getMarginsInWorldCoordinates(),f=(this.options.maxFontSize||this.defaultMaxFontSize)/u;s.save(),s.font=`${f*u}px ${this.options.font||this.defaultFont}`;const c=s.measureText(n.label).width/o,C=l.invert(l.range()[0])+h,v=l.invert(l.range()[1])-h,[D,T]=this.getSurfacesAreaEdges();let m;const I=5;d?m=a?Math.max(T,v):Math.min(T,v):m=a?Math.min(D,C):Math.max(D,C);const S=c/I*(d?-1:1),{data:x}=n,b=this.calcPos(x,m,I,S),M=this.calcLineDir(x,m,I,S,i,d?L.left:L.right);if(!b||!M)return;const F=m,A=b.y-$-f/2,y=L.angleRight(M)-(d?Math.PI:0);s&&(s.textAlign=d?"right":"left",s.translate(l(F),r(A)),s.rotate(y),s.fillStyle=this.colorToCSSColor(n.color),s.textBaseline="middle",s.fillText(n.label,0,0),s.restore())},this.render=this.render.bind(this),this.getMarginsInWorldCoordinates=this.getMarginsInWorldCoordinates.bind(this),this.getSurfacesAreaEdges=this.getSurfacesAreaEdges.bind(this),this.updateXFlipped=this.updateXFlipped.bind(this),this.generateSurfacesWithAvgDepth=this.generateSurfacesWithAvgDepth.bind(this)}get options(){return this._options}setData(t){super.setData(t),this.areasWithAvgTopDepth=[]}generateSurfacesWithAvgDepth(){var e;const t=((e=this.data)==null?void 0:e.areas)??[];this.areasWithAvgTopDepth=t.reduce((n,s)=>{if(!s.label)return n;const a=s.data.reduce((r,o)=>(o[1]!=null&&(r.sum+=o[1],r.count++),r),{sum:0,count:0});if(a.count===0)return n;const l=a.sum/a.count;return n.push({...s,avgTopDepth:l}),n},[])}onMount(t){super.onMount(t)}onUpdate(t){super.onUpdate(t),this.render()}onRescale(t){this.rescaleEvent=t,this.updateXFlipped(),this.resetTransform(),this.render()}render(){this.rescaleEvent&&requestAnimationFrame(()=>{this.clearCanvas(),this.data&&(this.areasWithAvgTopDepth.length<=0&&this.generateSurfacesWithAvgDepth(),this.drawAreaLabels(),this.drawLineLabels())})}drawAreaLabels(){this.areasWithAvgTopDepth.forEach((t,e,n)=>{const s=n.reduce((a,l,r)=>(r>e&&(a==null||l.avgTopDepthe.label).forEach(e=>this.drawLineLabel(e))}colorToCSSColor(t){if(typeof t=="string")return t;let e=t.toString(16);return e="000000".substr(0,6-e.length)+e,`#${e}`}calcPos(t,e,n,s,a,l,r,o=null,u){const i=L.zero.mutable;let d=0;for(let h=0;h[i[0],i[1]]))??[],t,e,n)}}return r}calcLineDir(t,e,n,s,a,l=L.left,r,o){const u=l.mutable,i=P(t,e,r,o);if(i===null)return u;const d=new L(e,i*a),h=L.zero.mutable;for(let g=1;g<=n;g++){const f=e+g*s,p=P(t,e,r,o);p!==null&&(h.set(f,p*a),h.sub(d),u.add(h))}return u}calcAreaDir(t,e,n,s,a,l=L.left,r,o,u=0,i=Math.PI/4,d=4,h,g=null,f){const p=[],c=L.zero.mutable;let C;for(let S=0;S<=s;S++){const x=n+S*a,b=P(t,x,r,o),M=P(e,x,r,o)||o,F=this.getAlternativeYValueIfAvailable(x,r,o,h,g,f),A=F?Math.min(M,F):M;if(S===0){if(b===null)return L.angleRight(l);const y=(b+A)/2;C=new L(n,y)}else b!==null?(c.set(x,(b+A)/2),c.sub(C),p.push(L.angleRight(c))):p.push(L.angleRight(l))}const v=p[0],D=p.map(S=>S-v);let T=0;return D.reduce((S,x)=>{const b=(Math.abs(x)-u)/i,M=Math.pow(1-Q(b,0,1),d);return T+=M,S+x*M},0)/T+v}updateXFlipped(){const{xBounds:t}=this.rescaleEvent;this.isXFlipped=t[0]>t[1]}getMarginsInWorldCoordinates(){const{xRatio:t}=this.rescaleEvent;return(this.options.margins||this.defaultMargins)*(this.isXFlipped?-1:1)/t}getSurfacesAreaEdges(){var o,u;const t=((o=this.data)==null?void 0:o.areas.reduce((i,d)=>{var f,p;const{data:h}=d,g=h.find(c=>c[1]!=null);g&&i.push(g[0]);for(let c=h.length-1;c>=0;c--)if(((f=h[c])==null?void 0:f[1])!=null){i.push((p=h[c])==null?void 0:p[0]);break}return i},[]))??[];t.push(...((u=this.data)==null?void 0:u.lines.reduce((i,d)=>{var f,p;const{data:h}=d,g=h.find(c=>c[1]!=null);g&&i.push(g[0]);for(let c=h.length-1;c>=0;c--)if(((f=h[c])==null?void 0:f[1])!=null){i.push((p=h[c])==null?void 0:p[0]);break}return i},[]))??[]);const e=Math.min(...t),n=Math.max(...t),s=this.getMarginsInWorldCoordinates(),{isXFlipped:a}=this,l=a?n+s:e+s,r=a?e-s:n-s;return[l,r]}checkDrawLabelsOnLeftSide(){var A,y,W,R,w;const{referenceSystem:t,isXFlipped:e}=this;if(!t)return!0;const{xScale:n,yScale:s,xRatio:a}=this.rescaleEvent,l=200,[r,o]=n.domain(),[u,i]=s.domain();let d=t.interpolators.curtain.getIntersects(u,1,0);d.length===0&&(d=[t.interpolators.curtain.getPointAt(0)]);let h=t.interpolators.curtain.getIntersects(i,1,0);h.length===0&&(h=[t.interpolators.curtain.getPointAt(1)]);const g=Math.max((A=d[0])==null?void 0:A[0],(y=h[0])==null?void 0:y[0]),f=Math.min((W=d[0])==null?void 0:W[0],(R=h[0])==null?void 0:R[0]),p={left:e?g:f,right:e?f:g},c=this.getMarginsInWorldCoordinates(),C=r+c,v=o-c,[D,T]=this.getSurfacesAreaEdges(),m=e?Math.min(C,D):Math.max(C,D),I=e?Math.max(v,T):Math.min(v,T),S=Math.max(e?m-p.left:p.left-m,0),x=Math.max(e?p.right-I:I-p.right,0),b=S*a,M=x*a;return S>x||b>l||b{var s,a,l,r,o,u;const e=[];let n;for(let i=0;i=0&&((r=t[g])!=null&&r[1]);g--)n.push((o=t[g])==null?void 0:o[0],((u=t[g])==null?void 0:u[2])||rt);e.push(n),n=void 0}}return e},this.generateAreaPolygon=t=>{const e=new k;e.lineStyle(1,t.color,1),e.beginFill(t.color),this.createPolygons(t.data).forEach(s=>e.drawPolygon(s)),e.endFill(),this.addChild(e)},this.generateSurfaceLine=t=>{const e=new k,{data:n}=t,s=.5;e.lineStyle($,t.color,1,s,!0);let a=!1;for(let l=0;lthis.generateAreaPolygon(e)),t.lines.forEach(e=>this.generateSurfaceLine(e)),this.isPreRendered=!0)}}export{dt as G,ct as a}; +import{C as K,j as L,k as $,h as Q,l as tt,G as k}from"./elements-217018fd.js";import{f as P}from"./findsample-cc6ecc23.js";const et=18,st=8,nt=13,it="black",ot="Arial",at=70;class ct extends K{constructor(t,e){super(t,e),this.defaultMargins=et,this.defaultMinFontSize=st,this.defaultMaxFontSize=nt,this.defaultTextColor=it,this.defaultFont=ot,this.isLabelsOnLeftSide=!0,this.maxFontSizeInWorldCoordinates=at,this.isXFlipped=!1,this.areasWithAvgTopDepth=[],this.drawAreaLabel=(n,s,a,l)=>{const{data:r}=n,{ctx:o,maxFontSizeInWorldCoordinates:u,isXFlipped:i}=this,{xScale:d,yScale:h,xRatio:g,yRatio:f,zFactor:p}=this.rescaleEvent;if(o==null)return;let c=this.checkDrawLabelsOnLeftSide();const v=(this.options.margins||this.defaultMargins)*(i?-1:1)/g,D=this.options.minFontSize||this.defaultMinFontSize;let m=(this.options.maxFontSize||this.defaultMaxFontSize)/f;m>u&&(m=u,m*fb||i&&Ex)&&(c=!0)}let A;const y=.07;c?A=i?Math.min(x,I):Math.max(x,I):A=i?Math.max(b,S):Math.min(b,S);const W=h.invert(h.range()[0]),R=h.invert(h.range()[1]),w=5,X=3,Y=y*(F/X)*(c?1:-1)*(i?-1:1),G=F/w*(c?1:-1)*(i?-1:1),U=r.map(E=>[E[0],E[1]]),O=this.calcPos(U,A,X,Y,W,R);if(!O)return;const N=r.map(E=>[E[0],E[2]]);let z=this.calcPos(N,A,X,Y,W,R,(s==null?void 0:s.data.map(E=>[E[0],E[1]]))??[],a,l);z||(z=new L(O.x,R));const _=z.y-O.y;if(_[E[0],E[1]]))??[],a,l),V=Math.atan(Math.tan(j)*p),q=A,H=(O.y+z.y)/2,J=i?-V:V;o&&(o.textAlign=c?"left":"right",o.translate(d(q),h(H)),o.rotate(J),o.fillStyle=this.options.textColor||this.defaultTextColor,o.font=`${m*f}px ${this.options.font||this.defaultFont}`,o.textBaseline="middle",o.fillText(n.label??"",0,0),o.restore())},this.drawLineLabel=n=>{const{ctx:s,isXFlipped:a}=this,{xScale:l,yScale:r,xRatio:o,yRatio:u,zFactor:i}=this.rescaleEvent;if(s==null)return;const d=this.checkDrawLabelsOnLeftSide(),h=this.getMarginsInWorldCoordinates(),f=(this.options.maxFontSize||this.defaultMaxFontSize)/u;s.save(),s.font=`${f*u}px ${this.options.font||this.defaultFont}`;const c=s.measureText(n.label).width/o,C=l.invert(l.range()[0])+h,v=l.invert(l.range()[1])-h,[D,T]=this.getSurfacesAreaEdges();let m;const I=5;d?m=a?Math.max(T,v):Math.min(T,v):m=a?Math.min(D,C):Math.max(D,C);const S=c/I*(d?-1:1),{data:x}=n,b=this.calcPos(x,m,I,S),M=this.calcLineDir(x,m,I,S,i,d?L.left:L.right);if(!b||!M)return;const F=m,A=b.y-$-f/2,y=L.angleRight(M)-(d?Math.PI:0);s&&(s.textAlign=d?"right":"left",s.translate(l(F),r(A)),s.rotate(y),s.fillStyle=this.colorToCSSColor(n.color),s.textBaseline="middle",s.fillText(n.label,0,0),s.restore())},this.render=this.render.bind(this),this.getMarginsInWorldCoordinates=this.getMarginsInWorldCoordinates.bind(this),this.getSurfacesAreaEdges=this.getSurfacesAreaEdges.bind(this),this.updateXFlipped=this.updateXFlipped.bind(this),this.generateSurfacesWithAvgDepth=this.generateSurfacesWithAvgDepth.bind(this)}get options(){return this._options}setData(t){super.setData(t),this.areasWithAvgTopDepth=[]}generateSurfacesWithAvgDepth(){var e;const t=((e=this.data)==null?void 0:e.areas)??[];this.areasWithAvgTopDepth=t.reduce((n,s)=>{if(!s.label)return n;const a=s.data.reduce((r,o)=>(o[1]!=null&&(r.sum+=o[1],r.count++),r),{sum:0,count:0});if(a.count===0)return n;const l=a.sum/a.count;return n.push({...s,avgTopDepth:l}),n},[])}onMount(t){super.onMount(t)}onUpdate(t){super.onUpdate(t),this.render()}onRescale(t){this.rescaleEvent=t,this.updateXFlipped(),this.resetTransform(),this.render()}render(){this.rescaleEvent&&requestAnimationFrame(()=>{this.clearCanvas(),this.data&&(this.areasWithAvgTopDepth.length<=0&&this.generateSurfacesWithAvgDepth(),this.drawAreaLabels(),this.drawLineLabels())})}drawAreaLabels(){this.areasWithAvgTopDepth.forEach((t,e,n)=>{const s=n.reduce((a,l,r)=>(r>e&&(a==null||l.avgTopDepthe.label).forEach(e=>this.drawLineLabel(e))}colorToCSSColor(t){if(typeof t=="string")return t;let e=t.toString(16);return e="000000".substr(0,6-e.length)+e,`#${e}`}calcPos(t,e,n,s,a,l,r,o=null,u){const i=L.zero.mutable;let d=0;for(let h=0;h[i[0],i[1]]))??[],t,e,n)}}return r}calcLineDir(t,e,n,s,a,l=L.left,r,o){const u=l.mutable,i=P(t,e,r,o);if(i===null)return u;const d=new L(e,i*a),h=L.zero.mutable;for(let g=1;g<=n;g++){const f=e+g*s,p=P(t,e,r,o);p!==null&&(h.set(f,p*a),h.sub(d),u.add(h))}return u}calcAreaDir(t,e,n,s,a,l=L.left,r,o,u=0,i=Math.PI/4,d=4,h,g=null,f){const p=[],c=L.zero.mutable;let C;for(let S=0;S<=s;S++){const x=n+S*a,b=P(t,x,r,o),M=P(e,x,r,o)||o,F=this.getAlternativeYValueIfAvailable(x,r,o,h,g,f),A=F?Math.min(M,F):M;if(S===0){if(b===null)return L.angleRight(l);const y=(b+A)/2;C=new L(n,y)}else b!==null?(c.set(x,(b+A)/2),c.sub(C),p.push(L.angleRight(c))):p.push(L.angleRight(l))}const v=p[0],D=p.map(S=>S-v);let T=0;return D.reduce((S,x)=>{const b=(Math.abs(x)-u)/i,M=Math.pow(1-Q(b,0,1),d);return T+=M,S+x*M},0)/T+v}updateXFlipped(){const{xBounds:t}=this.rescaleEvent;this.isXFlipped=t[0]>t[1]}getMarginsInWorldCoordinates(){const{xRatio:t}=this.rescaleEvent;return(this.options.margins||this.defaultMargins)*(this.isXFlipped?-1:1)/t}getSurfacesAreaEdges(){var o,u;const t=((o=this.data)==null?void 0:o.areas.reduce((i,d)=>{var f,p;const{data:h}=d,g=h.find(c=>c[1]!=null);g&&i.push(g[0]);for(let c=h.length-1;c>=0;c--)if(((f=h[c])==null?void 0:f[1])!=null){i.push((p=h[c])==null?void 0:p[0]);break}return i},[]))??[];t.push(...((u=this.data)==null?void 0:u.lines.reduce((i,d)=>{var f,p;const{data:h}=d,g=h.find(c=>c[1]!=null);g&&i.push(g[0]);for(let c=h.length-1;c>=0;c--)if(((f=h[c])==null?void 0:f[1])!=null){i.push((p=h[c])==null?void 0:p[0]);break}return i},[]))??[]);const e=Math.min(...t),n=Math.max(...t),s=this.getMarginsInWorldCoordinates(),{isXFlipped:a}=this,l=a?n+s:e+s,r=a?e-s:n-s;return[l,r]}checkDrawLabelsOnLeftSide(){var A,y,W,R,w;const{referenceSystem:t,isXFlipped:e}=this;if(!t)return!0;const{xScale:n,yScale:s,xRatio:a}=this.rescaleEvent,l=200,[r,o]=n.domain(),[u,i]=s.domain();let d=t.interpolators.curtain.getIntersects(u,1,0);d.length===0&&(d=[t.interpolators.curtain.getPointAt(0)]);let h=t.interpolators.curtain.getIntersects(i,1,0);h.length===0&&(h=[t.interpolators.curtain.getPointAt(1)]);const g=Math.max((A=d[0])==null?void 0:A[0],(y=h[0])==null?void 0:y[0]),f=Math.min((W=d[0])==null?void 0:W[0],(R=h[0])==null?void 0:R[0]),p={left:e?g:f,right:e?f:g},c=this.getMarginsInWorldCoordinates(),C=r+c,v=o-c,[D,T]=this.getSurfacesAreaEdges(),m=e?Math.min(C,D):Math.max(C,D),I=e?Math.max(v,T):Math.min(v,T),S=Math.max(e?m-p.left:p.left-m,0),x=Math.max(e?p.right-I:I-p.right,0),b=S*a,M=x*a;return S>x||b>l||b{var s,a,l,r,o,u;const e=[];let n;for(let i=0;i=0&&((r=t[g])!=null&&r[1]);g--)n.push((o=t[g])==null?void 0:o[0],((u=t[g])==null?void 0:u[2])||rt);e.push(n),n=void 0}}return e},this.generateAreaPolygon=t=>{const e=new k;e.lineStyle(1,t.color,1),e.beginFill(t.color),this.createPolygons(t.data).forEach(s=>e.drawPolygon(s)),e.endFill(),this.addChild(e)},this.generateSurfaceLine=t=>{const e=new k,{data:n}=t,s=.5;e.lineStyle($,t.color,1,s,!0);let a=!1;for(let l=0;lthis.generateAreaPolygon(e)),t.lines.forEach(e=>this.generateSurfaceLine(e)),this.isPreRendered=!0)}}export{dt as G,ct as a}; diff --git a/storybook/master/assets/GridLayer-416fefe9.js b/storybook/master/assets/GridLayer-66718e35.js similarity index 99% rename from storybook/master/assets/GridLayer-416fefe9.js rename to storybook/master/assets/GridLayer-66718e35.js index d3e726fe..911fb9c6 100644 --- a/storybook/master/assets/GridLayer-416fefe9.js +++ b/storybook/master/assets/GridLayer-66718e35.js @@ -1 +1 @@ -import{p as R,C as I}from"./elements-84f906e9.js";function V(n){return n}var A=1,S=2,D=3,G=4,C=1e-6;function P(n){return"translate("+n+",0)"}function j(n){return"translate(0,"+n+")"}function E(n){return t=>+n(t)}function B(n,t){return t=Math.max(0,n.bandwidth()-t*2)/2,n.round()&&(t=Math.round(t)),e=>+n(e)+t}function N(){return!this.__axis}function $(n,t){var e=[],i=null,h=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=n===A||n===G?-1:1,u=n===G||n===S?"x":"y",m=n===A||n===D?P:j;function c(r){var Y=i??(t.ticks?t.ticks.apply(t,e):t.domain()),M=h??(t.tickFormat?t.tickFormat.apply(t,e):V),_=Math.max(a,0)+o,y=t.range(),x=+y[0]+l,O=+y[y.length-1]+l,w=(t.bandwidth?B:E)(t.copy(),l),b=r.selection?r.selection():r,p=b.selectAll(".domain").data([null]),d=b.selectAll(".tick").data(Y,t).order(),T=d.exit(),L=d.enter().append("g").attr("class","tick"),k=d.select("line"),X=d.select("text");p=p.merge(p.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),d=d.merge(L),k=k.merge(L.append("line").attr("stroke","currentColor").attr(u+"2",f*a)),X=X.merge(L.append("text").attr("fill","currentColor").attr(u,f*_).attr("dy",n===A?"0em":n===D?"0.71em":"0.32em")),r!==b&&(p=p.transition(r),d=d.transition(r),k=k.transition(r),X=X.transition(r),T=T.transition(r).attr("opacity",C).attr("transform",function(g){return isFinite(g=w(g))?m(g+l):this.getAttribute("transform")}),L.attr("opacity",C).attr("transform",function(g){var v=this.parentNode.__axis;return m((v&&isFinite(v=v(g))?v:w(g))+l)})),T.remove(),p.attr("d",n===G||n===S?s?"M"+f*s+","+x+"H"+l+"V"+O+"H"+f*s:"M"+l+","+x+"V"+O:s?"M"+x+","+f*s+"V"+l+"H"+O+"V"+f*s:"M"+x+","+l+"H"+O),d.attr("opacity",1).attr("transform",function(g){return m(w(g)+l)}),k.attr(u+"2",f*a),X.attr(u,f*_).text(M),b.filter(N).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",n===S?"start":n===G?"end":"middle"),b.each(function(){this.__axis=w})}return c.scale=function(r){return arguments.length?(t=r,c):t},c.ticks=function(){return e=Array.from(arguments),c},c.tickArguments=function(r){return arguments.length?(e=r==null?[]:Array.from(r),c):e.slice()},c.tickValues=function(r){return arguments.length?(i=r==null?null:Array.from(r),c):i&&i.slice()},c.tickFormat=function(r){return arguments.length?(h=r,c):h},c.tickSize=function(r){return arguments.length?(a=s=+r,c):a},c.tickSizeInner=function(r){return arguments.length?(a=+r,c):a},c.tickSizeOuter=function(r){return arguments.length?(s=+r,c):s},c.tickPadding=function(r){return arguments.length?(o=+r,c):o},c.offset=function(r){return arguments.length?(l=+r,c):l},c}function U(n){return $(S,n)}function J(n){return $(D,n)}class Q{constructor(t,e=!0,i,h,a,s){this._showLabels=!0,this._offsetX=0,this._offsetY=0,this._flipX=!1,this._flipY=!1,this.visible=!0,this.createOrGet=o=>{const{mainGroup:l}=this;let f=l.select(`g.${o}`);return f.empty()&&(f=l.append("g").attr("class",o)),f},this.mainGroup=t,this._showLabels=e,this._labelXDesc=i,this._labelYDesc=h,this._unitOfMeasure=a,s&&s.offsetX&&(this._offsetX=s.offsetX),s&&s.offsetX&&(this._offsetY=s.offsetY),s&&s.visible&&(this.visible=s.visible),this.mainGroup.style("pointer-events","none"),this._scaleX=R().domain([0,1]).range([0,1]),this._scaleY=R().domain([0,1]).range([0,1])}renderLabelx(){const{_labelXDesc:t,_unitOfMeasure:e,_showLabels:i,_scaleX:h}=this,[,a]=h.range(),s=this.renderGx();let o=s.select("text.axis-labelx");return i?o.empty()&&(o=s.append("text").attr("class","axis-labelx").attr("fill","rgba(0,0,0,0.3)").style("text-anchor","middle").style("font-weight","800").style("font-size","10px").text(`${t} (${e})`)):o.remove(),o.attr("transform",`translate(${a/2},-4)`),o}renderLabely(){const{_labelYDesc:t,_unitOfMeasure:e,_showLabels:i,_scaleY:h}=this,[,a]=h.range(),s=this.renderGy();let o=s.select("text.axis-labely");return i?(o.empty()&&(o=s.append("text").attr("class","axis-labely").attr("fill","rgba(0,0,0,0.3)").style("text-anchor","middle").style("font-weight","800").style("font-size","10px").text(`${t} (${e})`)),o.attr("transform",`translate(-10,${a/2})rotate(90)`)):o.remove(),o}renderGy(){const{_scaleX:t,_scaleY:e}=this,i=U(e),[,h]=t.range(),a=this.createOrGet("y-axis");return a.call(i),a.attr("transform",`translate(${h},0)`),a}renderGx(){const{_scaleX:t,_scaleY:e}=this,i=J(t),[,h]=e.range(),a=this.createOrGet("x-axis");return a.attr("transform",`translate(0 ${h})`),a.call(i),a}render(){this.renderLabelx(),this.renderLabely()}onResize(t){this.mainGroup.attr("height",`${t.height}px`).attr("width",`${t.width}px`)}onRescale(t){const{_scaleX:e,_scaleY:i,offsetX:h,offsetY:a}=this,{xScale:s,yScale:o}=t,l=s.domain(),f=o.domain(),u=s.range(),m=o.range();e.domain([l[0]-h,l[1]-h]).range(u),i.domain([f[0]-a,f[1]-a]).range(m),this.flipX(this._flipX),this.flipY(this._flipY),this.visible&&this.render()}show(){return this.visible=!0,this.mainGroup.attr("visibility","visible"),this.render(),this}hide(){return this.visible=!1,this.mainGroup.attr("visibility","hidden"),this}flipX(t){this._flipX=t;const e=this._scaleX.domain(),i=t?-1:1;return this._scaleX.domain([i*e[0],i*e[1]]),this}flipY(t){this._flipY=t;const e=this._scaleY.domain(),i=t?-1:1;return this._scaleY.domain([i*e[0],i*e[1]]),this}showLabels(){return this._showLabels=!0,this.render(),this}hideLabels(){return this._showLabels=!1,this.render(),this}setLabelX(t){return this._labelXDesc=t,this}setLabelY(t){return this._labelYDesc=t,this}setUnitOfMeasure(t){return this._unitOfMeasure=t,this}setLabels(t,e,i){return this._labelXDesc=t,this._labelYDesc=e,this._unitOfMeasure=i,this}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t}get scaleX(){return this._scaleX.copy()}get scaleY(){return this._scaleY.copy()}}const z="lightgray",W="gray",F=.25,H=.75,q={minorColor:z,majorColor:W,minorWidth:F,majorWidth:H};class Z extends I{constructor(t,e){super(t,e),this._offsetX=0,this._offsetY=0,this.options={...this.options,...e||q},this.render=this.render.bind(this)}onUpdate(t){super.onUpdate(t),this.render(t)}onRescale(t){super.onRescale(t),this.render(t)}render(t){const{ctx:e}=this,{minorWidth:i,minorColor:h,majorWidth:a,majorColor:s}=this.options;if(!e||(this.clearCanvas(),!(t.xScale||t.yScale)))return;const o=t.xScale.copy(),l=t.yScale.copy(),f=o.domain(),u=l.domain(),m=this.offsetX,c=this.offsetY;o.domain([f[0]-m,f[1]-m]),l.domain([u[0]-c,u[1]-c]);const[r,Y]=o.range(),[M,_]=l.range();e.lineWidth=i||F,e.strokeStyle=h||z;const y=this.mapMinorTicks(o.ticks()),x=this.mapMinorTicks(l.ticks());this.renderTicksX(o,y,M,_),this.renderTicksY(l,x,r,Y),e.lineWidth=a||H,e.strokeStyle=s||W,this.renderTicksX(o,o.ticks(),M,_),this.renderTicksY(l,l.ticks(),r,Y),e.restore()}renderTicksX(t,e,i,h){e.forEach(a=>{const s=t(a);this.ctx!=null&&(this.ctx.beginPath(),this.ctx.moveTo(s,i),this.ctx.lineTo(s,h),this.ctx.stroke())})}renderTicksY(t,e,i,h){e.forEach(a=>{const s=t(a);this.ctx!=null&&(this.ctx.beginPath(),this.ctx.moveTo(i,s),this.ctx.lineTo(h,s),this.ctx.stroke())})}mapMinorTicks(t){let e=[];return t.length>=2&&(e=t.map(i=>i+(t[1]-t[0])/2),e.pop()),e}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t}}export{Q as A,Z as G}; +import{p as R,C as I}from"./elements-217018fd.js";function V(n){return n}var A=1,S=2,D=3,G=4,C=1e-6;function P(n){return"translate("+n+",0)"}function j(n){return"translate(0,"+n+")"}function E(n){return t=>+n(t)}function B(n,t){return t=Math.max(0,n.bandwidth()-t*2)/2,n.round()&&(t=Math.round(t)),e=>+n(e)+t}function N(){return!this.__axis}function $(n,t){var e=[],i=null,h=null,a=6,s=6,o=3,l=typeof window<"u"&&window.devicePixelRatio>1?0:.5,f=n===A||n===G?-1:1,u=n===G||n===S?"x":"y",m=n===A||n===D?P:j;function c(r){var Y=i??(t.ticks?t.ticks.apply(t,e):t.domain()),M=h??(t.tickFormat?t.tickFormat.apply(t,e):V),_=Math.max(a,0)+o,y=t.range(),x=+y[0]+l,O=+y[y.length-1]+l,w=(t.bandwidth?B:E)(t.copy(),l),b=r.selection?r.selection():r,p=b.selectAll(".domain").data([null]),d=b.selectAll(".tick").data(Y,t).order(),T=d.exit(),L=d.enter().append("g").attr("class","tick"),k=d.select("line"),X=d.select("text");p=p.merge(p.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),d=d.merge(L),k=k.merge(L.append("line").attr("stroke","currentColor").attr(u+"2",f*a)),X=X.merge(L.append("text").attr("fill","currentColor").attr(u,f*_).attr("dy",n===A?"0em":n===D?"0.71em":"0.32em")),r!==b&&(p=p.transition(r),d=d.transition(r),k=k.transition(r),X=X.transition(r),T=T.transition(r).attr("opacity",C).attr("transform",function(g){return isFinite(g=w(g))?m(g+l):this.getAttribute("transform")}),L.attr("opacity",C).attr("transform",function(g){var v=this.parentNode.__axis;return m((v&&isFinite(v=v(g))?v:w(g))+l)})),T.remove(),p.attr("d",n===G||n===S?s?"M"+f*s+","+x+"H"+l+"V"+O+"H"+f*s:"M"+l+","+x+"V"+O:s?"M"+x+","+f*s+"V"+l+"H"+O+"V"+f*s:"M"+x+","+l+"H"+O),d.attr("opacity",1).attr("transform",function(g){return m(w(g)+l)}),k.attr(u+"2",f*a),X.attr(u,f*_).text(M),b.filter(N).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",n===S?"start":n===G?"end":"middle"),b.each(function(){this.__axis=w})}return c.scale=function(r){return arguments.length?(t=r,c):t},c.ticks=function(){return e=Array.from(arguments),c},c.tickArguments=function(r){return arguments.length?(e=r==null?[]:Array.from(r),c):e.slice()},c.tickValues=function(r){return arguments.length?(i=r==null?null:Array.from(r),c):i&&i.slice()},c.tickFormat=function(r){return arguments.length?(h=r,c):h},c.tickSize=function(r){return arguments.length?(a=s=+r,c):a},c.tickSizeInner=function(r){return arguments.length?(a=+r,c):a},c.tickSizeOuter=function(r){return arguments.length?(s=+r,c):s},c.tickPadding=function(r){return arguments.length?(o=+r,c):o},c.offset=function(r){return arguments.length?(l=+r,c):l},c}function U(n){return $(S,n)}function J(n){return $(D,n)}class Q{constructor(t,e=!0,i,h,a,s){this._showLabels=!0,this._offsetX=0,this._offsetY=0,this._flipX=!1,this._flipY=!1,this.visible=!0,this.createOrGet=o=>{const{mainGroup:l}=this;let f=l.select(`g.${o}`);return f.empty()&&(f=l.append("g").attr("class",o)),f},this.mainGroup=t,this._showLabels=e,this._labelXDesc=i,this._labelYDesc=h,this._unitOfMeasure=a,s&&s.offsetX&&(this._offsetX=s.offsetX),s&&s.offsetX&&(this._offsetY=s.offsetY),s&&s.visible&&(this.visible=s.visible),this.mainGroup.style("pointer-events","none"),this._scaleX=R().domain([0,1]).range([0,1]),this._scaleY=R().domain([0,1]).range([0,1])}renderLabelx(){const{_labelXDesc:t,_unitOfMeasure:e,_showLabels:i,_scaleX:h}=this,[,a]=h.range(),s=this.renderGx();let o=s.select("text.axis-labelx");return i?o.empty()&&(o=s.append("text").attr("class","axis-labelx").attr("fill","rgba(0,0,0,0.3)").style("text-anchor","middle").style("font-weight","800").style("font-size","10px").text(`${t} (${e})`)):o.remove(),o.attr("transform",`translate(${a/2},-4)`),o}renderLabely(){const{_labelYDesc:t,_unitOfMeasure:e,_showLabels:i,_scaleY:h}=this,[,a]=h.range(),s=this.renderGy();let o=s.select("text.axis-labely");return i?(o.empty()&&(o=s.append("text").attr("class","axis-labely").attr("fill","rgba(0,0,0,0.3)").style("text-anchor","middle").style("font-weight","800").style("font-size","10px").text(`${t} (${e})`)),o.attr("transform",`translate(-10,${a/2})rotate(90)`)):o.remove(),o}renderGy(){const{_scaleX:t,_scaleY:e}=this,i=U(e),[,h]=t.range(),a=this.createOrGet("y-axis");return a.call(i),a.attr("transform",`translate(${h},0)`),a}renderGx(){const{_scaleX:t,_scaleY:e}=this,i=J(t),[,h]=e.range(),a=this.createOrGet("x-axis");return a.attr("transform",`translate(0 ${h})`),a.call(i),a}render(){this.renderLabelx(),this.renderLabely()}onResize(t){this.mainGroup.attr("height",`${t.height}px`).attr("width",`${t.width}px`)}onRescale(t){const{_scaleX:e,_scaleY:i,offsetX:h,offsetY:a}=this,{xScale:s,yScale:o}=t,l=s.domain(),f=o.domain(),u=s.range(),m=o.range();e.domain([l[0]-h,l[1]-h]).range(u),i.domain([f[0]-a,f[1]-a]).range(m),this.flipX(this._flipX),this.flipY(this._flipY),this.visible&&this.render()}show(){return this.visible=!0,this.mainGroup.attr("visibility","visible"),this.render(),this}hide(){return this.visible=!1,this.mainGroup.attr("visibility","hidden"),this}flipX(t){this._flipX=t;const e=this._scaleX.domain(),i=t?-1:1;return this._scaleX.domain([i*e[0],i*e[1]]),this}flipY(t){this._flipY=t;const e=this._scaleY.domain(),i=t?-1:1;return this._scaleY.domain([i*e[0],i*e[1]]),this}showLabels(){return this._showLabels=!0,this.render(),this}hideLabels(){return this._showLabels=!1,this.render(),this}setLabelX(t){return this._labelXDesc=t,this}setLabelY(t){return this._labelYDesc=t,this}setUnitOfMeasure(t){return this._unitOfMeasure=t,this}setLabels(t,e,i){return this._labelXDesc=t,this._labelYDesc=e,this._unitOfMeasure=i,this}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t}get scaleX(){return this._scaleX.copy()}get scaleY(){return this._scaleY.copy()}}const z="lightgray",W="gray",F=.25,H=.75,q={minorColor:z,majorColor:W,minorWidth:F,majorWidth:H};class Z extends I{constructor(t,e){super(t,e),this._offsetX=0,this._offsetY=0,this.options={...this.options,...e||q},this.render=this.render.bind(this)}onUpdate(t){super.onUpdate(t),this.render(t)}onRescale(t){super.onRescale(t),this.render(t)}render(t){const{ctx:e}=this,{minorWidth:i,minorColor:h,majorWidth:a,majorColor:s}=this.options;if(!e||(this.clearCanvas(),!(t.xScale||t.yScale)))return;const o=t.xScale.copy(),l=t.yScale.copy(),f=o.domain(),u=l.domain(),m=this.offsetX,c=this.offsetY;o.domain([f[0]-m,f[1]-m]),l.domain([u[0]-c,u[1]-c]);const[r,Y]=o.range(),[M,_]=l.range();e.lineWidth=i||F,e.strokeStyle=h||z;const y=this.mapMinorTicks(o.ticks()),x=this.mapMinorTicks(l.ticks());this.renderTicksX(o,y,M,_),this.renderTicksY(l,x,r,Y),e.lineWidth=a||H,e.strokeStyle=s||W,this.renderTicksX(o,o.ticks(),M,_),this.renderTicksY(l,l.ticks(),r,Y),e.restore()}renderTicksX(t,e,i,h){e.forEach(a=>{const s=t(a);this.ctx!=null&&(this.ctx.beginPath(),this.ctx.moveTo(s,i),this.ctx.lineTo(s,h),this.ctx.stroke())})}renderTicksY(t,e,i,h){e.forEach(a=>{const s=t(a);this.ctx!=null&&(this.ctx.beginPath(),this.ctx.moveTo(i,s),this.ctx.lineTo(h,s),this.ctx.stroke())})}mapMinorTicks(t){let e=[];return t.length>=2&&(e=t.map(i=>i+(t[1]-t[0])/2),e.pop()),e}get offsetX(){return this._offsetX}set offsetX(t){this._offsetX=t}get offsetY(){return this._offsetY}set offsetY(t){this._offsetY=t}}export{Q as A,Z as G}; diff --git a/storybook/master/assets/MainController-ae0d41fa.js b/storybook/master/assets/MainController-1e1a9474.js similarity index 99% rename from storybook/master/assets/MainController-ae0d41fa.js rename to storybook/master/assets/MainController-1e1a9474.js index e5cecd88..e9d831b9 100644 --- a/storybook/master/assets/MainController-ae0d41fa.js +++ b/storybook/master/assets/MainController-1e1a9474.js @@ -1 +1 @@ -import{h as j,j as u,n as k,r as Z,t as D,s as w,Z as O,H as F,V as C,u as N}from"./elements-84f906e9.js";import{A as B,G as T}from"./GridLayer-416fefe9.js";class b{static newton(t,e=.01,r=1e3,s=.5,i=0,n=1){let a=s;for(let h=0;h{const f=(L+P)/2,y=t(f),p=u.distance(v,y),m=u.distance(y,g),z=p+m;if(d>=i&&Math.abs(z-_)=n)return z;const S=x/2,I=d+1;return o(L,f,v,y,p,S,I)+o(f,P,y,g,m,S,I)},a=t(e),h=t(r),c=u.distance(a,h);return o(e,r,a,h,c,s)}static trapezoid(t,e=0,r=1,s=1e3){let i=0,n=t(e);const o=(r-e)/(s-1);for(let a=1;ar&&i=e)return i;n!=null&&e=this.length?1:b.findRoot(i=>t-this.getQuickArcLength(0,i),e,r,t/this.length)}findApproxTForArcLength(t,e){return t/(e||this.length)}findTQuickForArcLength(t){this.arcLengthLookup.length===0&&this.generateArcLengthLookup();const e=G.search(this.arcLengthLookup,t),r=this.arcLengthLookup[e],s=this.arcLengthLookup[e+1];return(e+(t-r)/(s-r))/this.arcLengthLookup.length}generateArcLengthLookup(t=1e3){let e=this.getPointAt(0),r=0;for(let s=0;sthis.getPointAt(s),t,e,r)}getQuickArcLength(t=0,e=1){let r=0,s=this.length;if(this.arcLengthLookup.length===0&&this.generateArcLengthLookup(),t!==0){const n=Math.floor(t*this.arcLengthLookup.length),o=this.arcLengthLookup[n],a=this.arcLengthLookup[n+1];r=o+t*this.arcLengthLookup.length%this.arcLengthLookup.length*(a-o)}if(e!==1){const n=Math.floor(e*this.arcLengthLookup.length),o=this.arcLengthLookup[n],a=this.arcLengthLookup[n+1];s=o+t*this.arcLengthLookup.length%this.arcLengthLookup.length*(a-o)}return s-r}getPointAtArcLength(t,e){const r=this.findTForArcLength(t,e);return this.getPointAt(r)}getPointAt(t){const e=j(t,0,1);return super.getPointAt(e)}}const H=.75,V=5e3,R=.001,Q=1e3,Y=1e3,U=5e-4,q=.1,$={approxT:!0};class M{constructor(t,e){if(this.path=[],this.projectedPath=[],this._offset=0,t.length<1)throw new Error("Missing coordinates");if(t[0]&&t[0].length!==3)throw new Error("Coordinates should be in 3d");this.setPath(t,e),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.getPosition=this.getPosition.bind(this),this.getProjectedLength=this.getProjectedLength.bind(this),this.getTrajectory=this.getTrajectory.bind(this)}setPath(t,e={}){this.options={...$,...e};const{arcDivisions:r,tension:s,calculateDisplacementFromBottom:i}=this.options;this.path=t,this.projectedPath=M.toDisplacement(t);const[n]=this.projectedPath[this.projectedPath.length-1];this.displacement=n,this.interpolators={curve:e.curveInterpolator||new E(t),trajectory:e.trajectoryInterpolator||new E(t.map(h=>[h[0],h[1]]),{tension:s||H,arcDivisions:r||V}),curtain:e.curtainInterpolator||new E(this.projectedPath,{tension:s||H,arcDivisions:r||V})};const o=this.getTrajectoryVector(),a=o.map(h=>h*-1);i?(this.endVector=a,this.startVector=o):(this.endVector=o,this.startVector=a),this._curtainPathCache=void 0}project(t){const{curtain:e}=this.interpolators,{calculateDisplacementFromBottom:r}=this.options,s=j(r?this.length-(t-this._offset):t-this._offset,0,this.length);return e.getPointAtArcLength(s,this.options)}curtainTangent(t){const{curtain:e}=this.interpolators,r=t-this._offset,s=e.findTForArcLength(r,this.options);return s&&e.getTangentAt(s)}getCurtainPath(t,e,r=!1){if(!this._curtainPathCache){const s=[];let i=Math.PI*2;for(let n=this._offset;n<=this.length+this._offset;n+=q){const o=this.project(n),a=Math.atan2(o[1],o[0]);Math.abs(a-i)>U&&(s.push({point:o,md:n}),i=a)}this._curtainPathCache=s}if(r){const s={point:this.project(t),md:t},i=this._curtainPathCache.filter(o=>o.md>t&&o.mds.md>=t&&s.md<=e)}unproject(t){const{normalizedLength:e,calculateDisplacementFromBottom:r}=this.options,s=r?this.displacement-t:t,i=e||this.length;if(s<0)return s;if(s>this.displacement)return i+(s-this.displacement);const n=this.interpolators.curtain.getIntersectsAsPositions(s,0,1);if(n&&n.length)return n[0]*i+this._offset}getProjectedLength(t){const{curtain:e}=this.interpolators,s=this.project(t)[0]/e.maxX;return Number.isFinite(s)?j(s,0,1):0}getPosition(t){const{trajectory:e}=this.interpolators,r=this.getProjectedLength(t);return e.getPointAt(r)}getTrajectory(t,e=0,r=1){const s=e<0?-e:0,i=r>1?r-1:0,n=this.interpolators.trajectory.getPointAt(0),o=this.interpolators.trajectory.getPointAt(1);let a,h,c=0;const l=Math.max(0,e),L=Math.min(1,r),P=this.interpolators.trajectory.getPointAt(l),v=this.interpolators.trajectory.getPointAt(L);s?(a=[n[0]+this.startVector[0]*s*this.displacement,n[1]+this.startVector[1]*s*this.displacement],c=-u.distance(a,n)):e>0&&(c=u.distance(P,n)),i&&(h=[o[0]+this.endVector[0]*i*this.displacement,o[1]+this.endVector[1]*i*this.displacement]);const g=[],_=r-e,x=Math.floor(s/_*t),d=Math.ceil((L-l)/_*t),f=t-d-x;if(a){g.push(a);for(let p=1;p0;d--){const f=d*l,y=h.add(c.scale(f));a.push(y.toArray())}const L=this.interpolators.trajectory.getPoints(n,null,0,1);a.push(...L);const P=new u(this.interpolators.trajectory.getPointAt(1)),v=new u(this.endVector),g=r/(o-1);for(let d=1;d{const o=n[0]-r[0],a=n[1]-r[1];return s+=Math.sqrt(o**2+a**2),r=n,[e>0?e-s:s,n[2]||0]})}static getDirectionVector(t,e,r){const s=t.getPointAt(r),i=t.getPointAt(e);return Z([s[0]-i[0],s[1]-i[1]])}get length(){var t;return((t=this.interpolators.curve)==null?void 0:t.length)??0}get offset(){return this._offset}set offset(t){this._curtainPathCache=void 0,this._offset=t}}class W{constructor(t,e,r){if(this.layers=[],this.createAxis=s=>{const{container:i}=this;this._svgContainer=w(i).append("div").attr("class","axis").style("position","absolute").style("z-index","10").style("pointer-events","none");const n=this._svgContainer.append("svg").attr("height",`${i.offsetHeight}px`).attr("width",`${i.offsetWidth}px`),o=!0;return new B(n,o,s.xLabel,s.yLabel,s.unitOfMeasure)},this.container=t,this.layerContainer=document.createElement("div"),this.layerContainer.className="layer-container",this.container.appendChild(this.layerContainer),this.adjustToSize(+(this.container.getAttribute("width")??0),+(this.container.getAttribute("height")??0)),this._zoomPanHandler=new O(t,s=>this.rescale(s)),e){const{xMin:s,xMax:i,yMin:n,yMax:o,xBounds:a,yBounds:h}=e;s!==void 0&&i!==void 0&&n!==void 0&&o!==void 0&&this._zoomPanHandler.setBounds([s,i],[n,o]),a&&h&&this._zoomPanHandler.setBounds(a,h)}else this._zoomPanHandler.setBounds([0,1],[0,1]);r&&(this._axis=this.createAxis(r)),this.rescale=this.rescale.bind(this)}addLayers(t){return t.forEach(e=>this.addLayer(e)),this}getLayers(){return this.layers}clearAllData(t=!0){return this.layers.forEach(e=>e.clearData(t)),this}addLayer(t,e){return this.layers.push(t),this.initLayer(t,e),this}removeLayer(t){const e=this.layers.find(r=>r.id===t);return e&&(e.onUnmount(),this.layers=this.layers.filter(r=>r.id!==t)),this}removeAllLayers(){const{layers:t}=this;return t.forEach(e=>{this.removeLayer(e.id)}),this}getLayer(t){return this.layers.find(e=>e.id===t||e.getInternalLayerIds().includes(t))}initLayer(t,e){const r={elm:this.layerContainer};t.onMount(r);const s=this.zoomPanHandler.currentStateAsEvent();if(t.onUpdate({...s,...e}),t.onRescale(s),this._svgContainer){const i=this.layers.length>0?this.layers.reduce((n,o)=>n.order>o.order?n:o).order:1;this._svgContainer.style("z-index",`${i+1}`)}return this}showLayer(t){const e=this.getLayer(t);return e?(e.setVisibility(!0,t),e.onRescale(this.zoomPanHandler.currentStateAsEvent()),this):this}hideLayer(t){const e=this.getLayer(t);return e?(e.setVisibility(!1,t),e.onRescale(this.zoomPanHandler.currentStateAsEvent()),this):this}adjustToSize(t,e){const r=Math.max(this._axis?t-F:t,0),s=Math.max(this._axis?e-C:e,0);if(this._axis){const i={width:t,height:e};this._axis.onResize(i)}if(this.layers){const i={width:r,height:s};this.layers.forEach(n=>n.onResize(i))}this._zoomPanHandler&&this._zoomPanHandler.adjustToSize(r,s,!0)}setReferenceSystem(t){this.layers.forEach(e=>e.referenceSystem=t)}showAxis(){var t;return(t=this._axis)==null||t.show(),this}hideAxis(){var t;return(t=this._axis)==null||t.hide(),this}showAxisLabels(){var t;return(t=this._axis)==null||t.showLabels(),this}hideAxisLabels(){var t;return(t=this._axis)==null||t.hideLabels(),this}setAxisOffset(t,e){return this._axis&&(this._axis.offsetX=t,this._axis.offsetY=e,this.layers.filter(s=>s instanceof T).forEach(s=>{s.offsetX=t,s.offsetY=e})),this}setXAxisOffset(t){return this._axis&&(this._axis.offsetX=t,this.layers.filter(r=>r instanceof T).forEach(r=>{r.offsetX=t})),this}setYAxisOffset(t){return this._axis&&(this._axis.offsetY=t,this.layers.filter(r=>r instanceof T).forEach(r=>{r.offsetY=t})),this}setZoomLevelBoundary(t){return this._zoomPanHandler.setZoomLevelBoundary(t),this}setMaxZoomLevel(t){return this._zoomPanHandler.setMaxZoomLevel(t),this}setMinZoomLevel(t){return this._zoomPanHandler.setMinZoomLevel(t),this}destroy(){return this.removeAllLayers(),this.layerContainer.remove(),this._axis=void 0,this._svgContainer=void 0,this}get zoomPanHandler(){return this._zoomPanHandler}get axis(){return this._axis}rescale(t){this._axis&&this._axis.onRescale(t),this.layers&&this.layers.forEach(e=>e.isVisible===!0?e.onRescale(t):{})}}class J{constructor(t,e){this.elements={},this.listeners={},this.enabled=!0;const r=w(e);this.elm=r.append("div").attr("id","overlay").style("z-index","11").style("position","absolute"),this.source=this.elm.node()??void 0;const{elm:s}=this;s.on("resize",i=>{const{width:n,height:o}=i.detail;s.style("width",`${n}px`).style("height",`${o}px`),this.enabled&&Object.keys(this.listeners).forEach(a=>{const h=this.elements[a]??void 0,c=this.listeners[a];c&&c.onResize&&requestAnimationFrame(()=>{var l;return(l=c.onResize)==null?void 0:l.call(c,{target:h,source:this.source,caller:t,width:n,height:o})})})}),s.on("mousemove",i=>{if(!this.enabled)return;const[n,o]=N(i,this.elm.node());Object.keys(this.listeners).forEach(a=>{const h=this.elements[a]??void 0,c=this.listeners[a];c&&c.onMouseMove&&requestAnimationFrame(()=>{var l;return(l=c.onMouseMove)==null?void 0:l.call(c,{x:n,y:o,target:h,source:this.source,caller:t})})})}),s.on("mouseout",()=>{this.enabled&&Object.keys(this.listeners).forEach(i=>{const n=this.elements[i]||void 0,o=this.listeners[i];o&&o.onMouseExit&&requestAnimationFrame(()=>{var a;return(a=o.onMouseExit)==null?void 0:a.call(o,{target:n,source:this.source,caller:t})})})})}create(t,e){const r=this.elm.append("div").style("position","relative").style("pointer-events","none").node();if(r!=null)return this.elements[t]=r,e&&(this.listeners[t]=e),r}register(t,e){this.listeners[t]=e}remove(t){const e=this.elements[t];e&&(w(e).remove(),delete this.elements[t]),delete this.listeners[t]}setZIndex(t){this.elm.style("z-index",t)}destroy(){var t;(t=this.source)==null||t.remove()}}const K=(A,t)=>new J(A,t);class st{constructor(t){const{container:e,axisOptions:r,scaleOptions:s,referenceSystem:i,layers:n,path:o}=t;this._referenceSystem=i||o&&new M(o),this._overlay=K(this,e),this.layerManager=new W(this._overlay.elm.node(),s,r),n&&(this.layerManager.addLayers(n),this.setOverlayZIndex(n))}setReferenceSystem(t){return this._referenceSystem=t,this.layerManager.setReferenceSystem(t),this}updatePath(t,e){return this.setReferenceSystem(new M(t,e)),this}clearAllData(t=!0){return this.layerManager.clearAllData(t),this}addLayer(t,e){return this.layerManager.addLayer(t,e),this.setOverlayZIndex(this.layerManager.getLayers()),this}removeLayer(t){return this.layerManager.removeLayer(t),this}removeAllLayers(){return this.layerManager.removeAllLayers(),this}getLayer(t){return this.layerManager.getLayer(t)}showLayer(t){return this.layerManager.showLayer(t),this}hideLayer(t){return this.layerManager.hideLayer(t),this}adjustToSize(t,e){this.layerManager.adjustToSize(t,e);const r={width:Math.max(t-F,0),height:Math.max(e-C,0)};return this.overlay.elm.dispatch("resize",{detail:r,bubbles:!0,cancelable:!0}),this}setViewport(t,e,r,s){return this.zoomPanHandler.setViewport(t,e,r,s),this}setBounds(t,e){return this.zoomPanHandler.setBounds(t,e),this}showAxis(){return this.layerManager.showAxis(),this}hideAxis(){return this.layerManager.hideAxis(),this}showAxisLabels(){return this.layerManager.showAxisLabels(),this}hideAxisLabels(){return this.layerManager.hideAxisLabels(),this}setAxisOffset(t,e){return this.layerManager.setAxisOffset(t,e),this}setXAxisOffset(t){return this.layerManager.setXAxisOffset(t),this}setYAxisOffset(t){return this.layerManager.setYAxisOffset(t),this}setZoomLevelBoundary(t){return this.zoomPanHandler.setZoomLevelBoundary(t),this}setMaxZoomLevel(t){return this.zoomPanHandler.setMaxZoomLevel(t),this}setMinZoomLevel(t){return this.zoomPanHandler.setMinZoomLevel(t),this}destroy(){return this.layerManager.destroy(),this._overlay.destroy(),this._referenceSystem=void 0,this}getHighestZIndex(t){return t.length>0?t.reduce((r,s)=>r.order>s.order?r:s).order:1}setOverlayZIndex(t){const e=this.getHighestZIndex(t);this.overlay.setZIndex(e+2)}get overlay(){return this._overlay}get referenceSystem(){return this._referenceSystem}get zoomPanHandler(){return this.layerManager.zoomPanHandler}get axis(){return this.layerManager.axis}get currentStateAsEvent(){return this.zoomPanHandler.currentStateAsEvent()}}export{st as C,M as I}; +import{h as j,j as u,n as k,r as Z,t as D,s as w,Z as O,H as F,V as C,u as N}from"./elements-217018fd.js";import{A as B,G as T}from"./GridLayer-66718e35.js";class b{static newton(t,e=.01,r=1e3,s=.5,i=0,n=1){let a=s;for(let h=0;h{const f=(L+P)/2,y=t(f),p=u.distance(v,y),m=u.distance(y,g),z=p+m;if(d>=i&&Math.abs(z-_)=n)return z;const S=x/2,I=d+1;return o(L,f,v,y,p,S,I)+o(f,P,y,g,m,S,I)},a=t(e),h=t(r),c=u.distance(a,h);return o(e,r,a,h,c,s)}static trapezoid(t,e=0,r=1,s=1e3){let i=0,n=t(e);const o=(r-e)/(s-1);for(let a=1;ar&&i=e)return i;n!=null&&e=this.length?1:b.findRoot(i=>t-this.getQuickArcLength(0,i),e,r,t/this.length)}findApproxTForArcLength(t,e){return t/(e||this.length)}findTQuickForArcLength(t){this.arcLengthLookup.length===0&&this.generateArcLengthLookup();const e=G.search(this.arcLengthLookup,t),r=this.arcLengthLookup[e],s=this.arcLengthLookup[e+1];return(e+(t-r)/(s-r))/this.arcLengthLookup.length}generateArcLengthLookup(t=1e3){let e=this.getPointAt(0),r=0;for(let s=0;sthis.getPointAt(s),t,e,r)}getQuickArcLength(t=0,e=1){let r=0,s=this.length;if(this.arcLengthLookup.length===0&&this.generateArcLengthLookup(),t!==0){const n=Math.floor(t*this.arcLengthLookup.length),o=this.arcLengthLookup[n],a=this.arcLengthLookup[n+1];r=o+t*this.arcLengthLookup.length%this.arcLengthLookup.length*(a-o)}if(e!==1){const n=Math.floor(e*this.arcLengthLookup.length),o=this.arcLengthLookup[n],a=this.arcLengthLookup[n+1];s=o+t*this.arcLengthLookup.length%this.arcLengthLookup.length*(a-o)}return s-r}getPointAtArcLength(t,e){const r=this.findTForArcLength(t,e);return this.getPointAt(r)}getPointAt(t){const e=j(t,0,1);return super.getPointAt(e)}}const H=.75,V=5e3,R=.001,Q=1e3,Y=1e3,U=5e-4,q=.1,$={approxT:!0};class M{constructor(t,e){if(this.path=[],this.projectedPath=[],this._offset=0,t.length<1)throw new Error("Missing coordinates");if(t[0]&&t[0].length!==3)throw new Error("Coordinates should be in 3d");this.setPath(t,e),this.project=this.project.bind(this),this.unproject=this.unproject.bind(this),this.getPosition=this.getPosition.bind(this),this.getProjectedLength=this.getProjectedLength.bind(this),this.getTrajectory=this.getTrajectory.bind(this)}setPath(t,e={}){this.options={...$,...e};const{arcDivisions:r,tension:s,calculateDisplacementFromBottom:i}=this.options;this.path=t,this.projectedPath=M.toDisplacement(t);const[n]=this.projectedPath[this.projectedPath.length-1];this.displacement=n,this.interpolators={curve:e.curveInterpolator||new E(t),trajectory:e.trajectoryInterpolator||new E(t.map(h=>[h[0],h[1]]),{tension:s||H,arcDivisions:r||V}),curtain:e.curtainInterpolator||new E(this.projectedPath,{tension:s||H,arcDivisions:r||V})};const o=this.getTrajectoryVector(),a=o.map(h=>h*-1);i?(this.endVector=a,this.startVector=o):(this.endVector=o,this.startVector=a),this._curtainPathCache=void 0}project(t){const{curtain:e}=this.interpolators,{calculateDisplacementFromBottom:r}=this.options,s=j(r?this.length-(t-this._offset):t-this._offset,0,this.length);return e.getPointAtArcLength(s,this.options)}curtainTangent(t){const{curtain:e}=this.interpolators,r=t-this._offset,s=e.findTForArcLength(r,this.options);return s&&e.getTangentAt(s)}getCurtainPath(t,e,r=!1){if(!this._curtainPathCache){const s=[];let i=Math.PI*2;for(let n=this._offset;n<=this.length+this._offset;n+=q){const o=this.project(n),a=Math.atan2(o[1],o[0]);Math.abs(a-i)>U&&(s.push({point:o,md:n}),i=a)}this._curtainPathCache=s}if(r){const s={point:this.project(t),md:t},i=this._curtainPathCache.filter(o=>o.md>t&&o.mds.md>=t&&s.md<=e)}unproject(t){const{normalizedLength:e,calculateDisplacementFromBottom:r}=this.options,s=r?this.displacement-t:t,i=e||this.length;if(s<0)return s;if(s>this.displacement)return i+(s-this.displacement);const n=this.interpolators.curtain.getIntersectsAsPositions(s,0,1);if(n&&n.length)return n[0]*i+this._offset}getProjectedLength(t){const{curtain:e}=this.interpolators,s=this.project(t)[0]/e.maxX;return Number.isFinite(s)?j(s,0,1):0}getPosition(t){const{trajectory:e}=this.interpolators,r=this.getProjectedLength(t);return e.getPointAt(r)}getTrajectory(t,e=0,r=1){const s=e<0?-e:0,i=r>1?r-1:0,n=this.interpolators.trajectory.getPointAt(0),o=this.interpolators.trajectory.getPointAt(1);let a,h,c=0;const l=Math.max(0,e),L=Math.min(1,r),P=this.interpolators.trajectory.getPointAt(l),v=this.interpolators.trajectory.getPointAt(L);s?(a=[n[0]+this.startVector[0]*s*this.displacement,n[1]+this.startVector[1]*s*this.displacement],c=-u.distance(a,n)):e>0&&(c=u.distance(P,n)),i&&(h=[o[0]+this.endVector[0]*i*this.displacement,o[1]+this.endVector[1]*i*this.displacement]);const g=[],_=r-e,x=Math.floor(s/_*t),d=Math.ceil((L-l)/_*t),f=t-d-x;if(a){g.push(a);for(let p=1;p0;d--){const f=d*l,y=h.add(c.scale(f));a.push(y.toArray())}const L=this.interpolators.trajectory.getPoints(n,null,0,1);a.push(...L);const P=new u(this.interpolators.trajectory.getPointAt(1)),v=new u(this.endVector),g=r/(o-1);for(let d=1;d{const o=n[0]-r[0],a=n[1]-r[1];return s+=Math.sqrt(o**2+a**2),r=n,[e>0?e-s:s,n[2]||0]})}static getDirectionVector(t,e,r){const s=t.getPointAt(r),i=t.getPointAt(e);return Z([s[0]-i[0],s[1]-i[1]])}get length(){var t;return((t=this.interpolators.curve)==null?void 0:t.length)??0}get offset(){return this._offset}set offset(t){this._curtainPathCache=void 0,this._offset=t}}class W{constructor(t,e,r){if(this.layers=[],this.createAxis=s=>{const{container:i}=this;this._svgContainer=w(i).append("div").attr("class","axis").style("position","absolute").style("z-index","10").style("pointer-events","none");const n=this._svgContainer.append("svg").attr("height",`${i.offsetHeight}px`).attr("width",`${i.offsetWidth}px`),o=!0;return new B(n,o,s.xLabel,s.yLabel,s.unitOfMeasure)},this.container=t,this.layerContainer=document.createElement("div"),this.layerContainer.className="layer-container",this.container.appendChild(this.layerContainer),this.adjustToSize(+(this.container.getAttribute("width")??0),+(this.container.getAttribute("height")??0)),this._zoomPanHandler=new O(t,s=>this.rescale(s)),e){const{xMin:s,xMax:i,yMin:n,yMax:o,xBounds:a,yBounds:h}=e;s!==void 0&&i!==void 0&&n!==void 0&&o!==void 0&&this._zoomPanHandler.setBounds([s,i],[n,o]),a&&h&&this._zoomPanHandler.setBounds(a,h)}else this._zoomPanHandler.setBounds([0,1],[0,1]);r&&(this._axis=this.createAxis(r)),this.rescale=this.rescale.bind(this)}addLayers(t){return t.forEach(e=>this.addLayer(e)),this}getLayers(){return this.layers}clearAllData(t=!0){return this.layers.forEach(e=>e.clearData(t)),this}addLayer(t,e){return this.layers.push(t),this.initLayer(t,e),this}removeLayer(t){const e=this.layers.find(r=>r.id===t);return e&&(e.onUnmount(),this.layers=this.layers.filter(r=>r.id!==t)),this}removeAllLayers(){const{layers:t}=this;return t.forEach(e=>{this.removeLayer(e.id)}),this}getLayer(t){return this.layers.find(e=>e.id===t||e.getInternalLayerIds().includes(t))}initLayer(t,e){const r={elm:this.layerContainer};t.onMount(r);const s=this.zoomPanHandler.currentStateAsEvent();if(t.onUpdate({...s,...e}),t.onRescale(s),this._svgContainer){const i=this.layers.length>0?this.layers.reduce((n,o)=>n.order>o.order?n:o).order:1;this._svgContainer.style("z-index",`${i+1}`)}return this}showLayer(t){const e=this.getLayer(t);return e?(e.setVisibility(!0,t),e.onRescale(this.zoomPanHandler.currentStateAsEvent()),this):this}hideLayer(t){const e=this.getLayer(t);return e?(e.setVisibility(!1,t),e.onRescale(this.zoomPanHandler.currentStateAsEvent()),this):this}adjustToSize(t,e){const r=Math.max(this._axis?t-F:t,0),s=Math.max(this._axis?e-C:e,0);if(this._axis){const i={width:t,height:e};this._axis.onResize(i)}if(this.layers){const i={width:r,height:s};this.layers.forEach(n=>n.onResize(i))}this._zoomPanHandler&&this._zoomPanHandler.adjustToSize(r,s,!0)}setReferenceSystem(t){this.layers.forEach(e=>e.referenceSystem=t)}showAxis(){var t;return(t=this._axis)==null||t.show(),this}hideAxis(){var t;return(t=this._axis)==null||t.hide(),this}showAxisLabels(){var t;return(t=this._axis)==null||t.showLabels(),this}hideAxisLabels(){var t;return(t=this._axis)==null||t.hideLabels(),this}setAxisOffset(t,e){return this._axis&&(this._axis.offsetX=t,this._axis.offsetY=e,this.layers.filter(s=>s instanceof T).forEach(s=>{s.offsetX=t,s.offsetY=e})),this}setXAxisOffset(t){return this._axis&&(this._axis.offsetX=t,this.layers.filter(r=>r instanceof T).forEach(r=>{r.offsetX=t})),this}setYAxisOffset(t){return this._axis&&(this._axis.offsetY=t,this.layers.filter(r=>r instanceof T).forEach(r=>{r.offsetY=t})),this}setZoomLevelBoundary(t){return this._zoomPanHandler.setZoomLevelBoundary(t),this}setMaxZoomLevel(t){return this._zoomPanHandler.setMaxZoomLevel(t),this}setMinZoomLevel(t){return this._zoomPanHandler.setMinZoomLevel(t),this}destroy(){return this.removeAllLayers(),this.layerContainer.remove(),this._axis=void 0,this._svgContainer=void 0,this}get zoomPanHandler(){return this._zoomPanHandler}get axis(){return this._axis}rescale(t){this._axis&&this._axis.onRescale(t),this.layers&&this.layers.forEach(e=>e.isVisible===!0?e.onRescale(t):{})}}class J{constructor(t,e){this.elements={},this.listeners={},this.enabled=!0;const r=w(e);this.elm=r.append("div").attr("id","overlay").style("z-index","11").style("position","absolute"),this.source=this.elm.node()??void 0;const{elm:s}=this;s.on("resize",i=>{const{width:n,height:o}=i.detail;s.style("width",`${n}px`).style("height",`${o}px`),this.enabled&&Object.keys(this.listeners).forEach(a=>{const h=this.elements[a]??void 0,c=this.listeners[a];c&&c.onResize&&requestAnimationFrame(()=>{var l;return(l=c.onResize)==null?void 0:l.call(c,{target:h,source:this.source,caller:t,width:n,height:o})})})}),s.on("mousemove",i=>{if(!this.enabled)return;const[n,o]=N(i,this.elm.node());Object.keys(this.listeners).forEach(a=>{const h=this.elements[a]??void 0,c=this.listeners[a];c&&c.onMouseMove&&requestAnimationFrame(()=>{var l;return(l=c.onMouseMove)==null?void 0:l.call(c,{x:n,y:o,target:h,source:this.source,caller:t})})})}),s.on("mouseout",()=>{this.enabled&&Object.keys(this.listeners).forEach(i=>{const n=this.elements[i]||void 0,o=this.listeners[i];o&&o.onMouseExit&&requestAnimationFrame(()=>{var a;return(a=o.onMouseExit)==null?void 0:a.call(o,{target:n,source:this.source,caller:t})})})})}create(t,e){const r=this.elm.append("div").style("position","relative").style("pointer-events","none").node();if(r!=null)return this.elements[t]=r,e&&(this.listeners[t]=e),r}register(t,e){this.listeners[t]=e}remove(t){const e=this.elements[t];e&&(w(e).remove(),delete this.elements[t]),delete this.listeners[t]}setZIndex(t){this.elm.style("z-index",t)}destroy(){var t;(t=this.source)==null||t.remove()}}const K=(A,t)=>new J(A,t);class st{constructor(t){const{container:e,axisOptions:r,scaleOptions:s,referenceSystem:i,layers:n,path:o}=t;this._referenceSystem=i||o&&new M(o),this._overlay=K(this,e),this.layerManager=new W(this._overlay.elm.node(),s,r),n&&(this.layerManager.addLayers(n),this.setOverlayZIndex(n))}setReferenceSystem(t){return this._referenceSystem=t,this.layerManager.setReferenceSystem(t),this}updatePath(t,e){return this.setReferenceSystem(new M(t,e)),this}clearAllData(t=!0){return this.layerManager.clearAllData(t),this}addLayer(t,e){return this.layerManager.addLayer(t,e),this.setOverlayZIndex(this.layerManager.getLayers()),this}removeLayer(t){return this.layerManager.removeLayer(t),this}removeAllLayers(){return this.layerManager.removeAllLayers(),this}getLayer(t){return this.layerManager.getLayer(t)}showLayer(t){return this.layerManager.showLayer(t),this}hideLayer(t){return this.layerManager.hideLayer(t),this}adjustToSize(t,e){this.layerManager.adjustToSize(t,e);const r={width:Math.max(t-F,0),height:Math.max(e-C,0)};return this.overlay.elm.dispatch("resize",{detail:r,bubbles:!0,cancelable:!0}),this}setViewport(t,e,r,s){return this.zoomPanHandler.setViewport(t,e,r,s),this}setBounds(t,e){return this.zoomPanHandler.setBounds(t,e),this}showAxis(){return this.layerManager.showAxis(),this}hideAxis(){return this.layerManager.hideAxis(),this}showAxisLabels(){return this.layerManager.showAxisLabels(),this}hideAxisLabels(){return this.layerManager.hideAxisLabels(),this}setAxisOffset(t,e){return this.layerManager.setAxisOffset(t,e),this}setXAxisOffset(t){return this.layerManager.setXAxisOffset(t),this}setYAxisOffset(t){return this.layerManager.setYAxisOffset(t),this}setZoomLevelBoundary(t){return this.zoomPanHandler.setZoomLevelBoundary(t),this}setMaxZoomLevel(t){return this.zoomPanHandler.setMaxZoomLevel(t),this}setMinZoomLevel(t){return this.zoomPanHandler.setMinZoomLevel(t),this}destroy(){return this.layerManager.destroy(),this._overlay.destroy(),this._referenceSystem=void 0,this}getHighestZIndex(t){return t.length>0?t.reduce((r,s)=>r.order>s.order?r:s).order:1}setOverlayZIndex(t){const e=this.getHighestZIndex(t);this.overlay.setZIndex(e+2)}get overlay(){return this._overlay}get referenceSystem(){return this._referenceSystem}get zoomPanHandler(){return this.layerManager.zoomPanHandler}get axis(){return this.layerManager.axis}get currentStateAsEvent(){return this.zoomPanHandler.currentStateAsEvent()}}export{st as C,M as I}; diff --git a/storybook/master/assets/WellborePathLayer-4cd0b66f.js b/storybook/master/assets/WellborePathLayer-11ff1510.js similarity index 99% rename from storybook/master/assets/WellborePathLayer-4cd0b66f.js rename to storybook/master/assets/WellborePathLayer-11ff1510.js index 247c8c0a..b02018e9 100644 --- a/storybook/master/assets/WellborePathLayer-4cd0b66f.js +++ b/storybook/master/assets/WellborePathLayer-11ff1510.js @@ -1 +1 @@ -import{L as X,D as G,m as Z,s as Q}from"./elements-84f906e9.js";class J extends X{onMount(i){super.onMount(i);const{elm:n}=i,e=i.width||parseInt(n.getAttribute("width")??"",10)||G,_=i.height||parseInt(n.getAttribute("height")??"",10)||Z;this.elm||(this.elm=Q(n).append("svg"),this.elm.attr("id",`${this.id}`),this.elm.attr("class","svg-layer")),this.elm.attr("height",_).attr("width",e);const s=this.interactive?"auto":"none";this.elm.style("position","absolute").style("pointer-events",s).style("opacity",this.opacity).style("z-index",this.order)}onUnmount(){var i;super.onUnmount(),(i=this.elm)==null||i.remove(),this.elm=void 0}onResize(i){this.elm&&(super.onResize(i),this.elm.attr("height",i.height).attr("width",i.width))}setVisibility(i){super.setVisibility(i),this.elm&&this.elm.attr("visibility",i?"visible":"hidden")}onOpacityChanged(i){this.elm&&this.elm.style("opacity",i)}onOrderChanged(i){this.elm&&this.elm.style("z-index",i)}onInteractivityChanged(i){if(this.elm){const n=i?"auto":"none";this.elm.style("pointer-events",n)}}}function x(t){return function(){return t}}const A=1e-12,k=Math.PI,w=2*k,p=1e-6,K=w-p;function I(t){this._+=t[0];for(let i=1,n=t.length;i=0))throw new Error(`invalid digits: ${t}`);if(i>15)return I;const n=10**i;return function(e){this._+=e[0];for(let _=1,s=e.length;_p)if(!(Math.abs(u*h-a*l)>p)||!s)this._append`L${this._x1=i},${this._y1=n}`;else{let f=e-o,v=_-r,E=h*h+a*a,F=f*f+v*v,N=Math.sqrt(E),M=Math.sqrt(c),S=s*Math.tan((k-Math.acos((E+c-F)/(2*N*M)))/2),m=S/M,C=S/N;Math.abs(m-1)>p&&this._append`L${i+m*l},${n+m*u}`,this._append`A${s},${s},0,0,${+(u*f>l*v)},${this._x1=i+C*h},${this._y1=n+C*a}`}}arc(i,n,e,_,s,o){if(i=+i,n=+n,e=+e,o=!!o,e<0)throw new Error(`negative radius: ${e}`);let r=e*Math.cos(_),h=e*Math.sin(_),a=i+r,l=n+h,u=1^o,c=o?_-s:s-_;this._x1===null?this._append`M${a},${l}`:(Math.abs(this._x1-a)>p||Math.abs(this._y1-l)>p)&&this._append`L${a},${l}`,e&&(c<0&&(c=c%w+w),c>K?this._append`A${e},${e},0,1,${u},${i-r},${n-h}A${e},${e},0,1,${u},${this._x1=a},${this._y1=l}`:c>p&&this._append`A${e},${e},0,${+(c>=k)},${u},${this._x1=i+e*Math.cos(s)},${this._y1=n+e*Math.sin(s)}`)}rect(i,n,e,_){this._append`M${this._x0=this._x1=+i},${this._y0=this._y1=+n}h${e=+e}v${+_}h${-e}Z`}toString(){return this._}}function nt(t){let i=3;return t.digits=function(n){if(!arguments.length)return i;if(n==null)i=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);i=e}return t},()=>new it(i)}function et(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function D(t){this._context=t}D.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:this._context.lineTo(t,i);break}}};function V(t){return new D(t)}function st(t){return t[0]}function _t(t){return t[1]}function ht(t,i){var n=x(!0),e=null,_=V,s=null,o=nt(r);t=typeof t=="function"?t:t===void 0?st:x(t),i=typeof i=="function"?i:i===void 0?_t:x(i);function r(h){var a,l=(h=et(h)).length,u,c=!1,f;for(e==null&&(s=_(f=o())),a=0;a<=l;++a)!(a0)for(var e=t[0],_=i[0],s=t[n]-e,o=i[n]-_,r=-1,h;++r<=n;)h=r/n,this._basis.point(this._beta*t[r]+(1-this._beta)*(e+h*s),this._beta*i[r]+(1-this._beta)*(_+h*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,i){this._x.push(+t),this._y.push(+i)}};const at=function t(i){function n(e){return i===1?new y(e):new O(e,i)}return n.beta=function(e){return t(+e)},n}(.85);function P(t,i,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-i),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function g(t,i){this._context=t,this._k=(1-i)/6}g.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:P(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2,this._x1=t,this._y1=i;break;case 2:this._point=3;default:P(this,t,i);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};const lt=function t(i){function n(e){return new g(e,i)}return n.tension=function(e){return t(+e)},n}(0);function ct(t,i,n){var e=t._x1,_=t._y1,s=t._x2,o=t._y2;if(t._l01_a>A){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,h=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/h,_=(_*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/h}if(t._l23_a>A){var a=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*a+t._x1*t._l23_2a-i*t._l12_2a)/l,o=(o*a+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(e,_,s,o,t._x2,t._y2)}function Y(t,i){this._context=t,this._alpha=i}Y.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3;default:ct(this,t,i);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};const ut=function t(i){function n(e){return i?new Y(e,i):new g(e,0)}return n.alpha=function(e){return t(+e)},n}(.5);function R(t){return t<0?-1:1}function B(t,i,n){var e=t._x1-t._x0,_=i-t._x1,s=(t._y1-t._y0)/(e||_<0&&-0),o=(n-t._y1)/(_||e<0&&-0),r=(s*_+o*e)/(e+_);return(R(s)+R(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(r))||0}function z(t,i){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-i)/2:i}function T(t,i,n){var e=t._x0,_=t._y0,s=t._x1,o=t._y1,r=(s-e)/3;t._context.bezierCurveTo(e+r,_+r*i,s-r,o-r*n,s,o)}function d(t){this._context=t}d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:T(this,this._t0,z(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){var n=NaN;if(t=+t,i=+i,!(t===this._x1&&i===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3,T(this,z(this,n=B(this,t,i)),n);break;default:T(this,this._t0,n=B(this,t,i));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=n}}};function j(t){this._context=new q(t)}(j.prototype=Object.create(d.prototype)).point=function(t,i){d.prototype.point.call(this,i,t)};function q(t){this._context=t}q.prototype={moveTo:function(t,i){this._context.moveTo(i,t)},closePath:function(){this._context.closePath()},lineTo:function(t,i){this._context.lineTo(i,t)},bezierCurveTo:function(t,i,n,e,_,s){this._context.bezierCurveTo(i,t,e,n,s,_)}};function ft(t){return new d(t)}function pt(t){return new j(t)}function H(t){this._context=t}H.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,i=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],i[0]):this._context.moveTo(t[0],i[0]),n===2)this._context.lineTo(t[1],i[1]);else for(var e=U(t),_=U(i),s=0,o=1;o=0;--i)_[i]=(o[i]-_[i+1])/s[i];for(s[n-1]=(t[n]+_[n-1])/2,i=0;i=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,i),this._context.lineTo(t,i);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,i)}break}}this._x=t,this._y=i}};function dt(t){return new b(t,.5)}function yt(t){return new b(t,0)}function bt(t){return new b(t,1)}const vt=.7,mt=.9,Tt=1;class wt extends J{constructor(i,n){super(i,n),this.options={...this.options,...n},this.render=this.render.bind(this)}onUpdate(i){super.onUpdate(i),this.render()}onRescale(i){super.onRescale(i),this.elm&&(this.rescaleEvent=i,this.render())}render(){const{strokeWidth:i,stroke:n}=this.options;if(!this.elm)return;this.elm.select("g").remove();const e=this.data||this.referenceSystem&&this.referenceSystem.projectedPath;!e||!this.rescaleEvent||this.elm.append("g").attr("class","well-path").append("path").attr("d",this.renderWellborePath(e)).attr("stroke-width",i||"2px").attr("stroke",n||"red").attr("fill","none")}renderWellborePath(i){if(this.rescaleEvent!=null){const{xScale:n,yScale:e}=this.rescaleEvent,_=i.map(h=>[n(h[0]),e(h[1])]);let s;const{curveType:o,tension:r}=this.options;switch(o){default:case"curveCatmullRom":s=ut.alpha(r||vt);break;case"curveLinear":s=V;break;case"curveBasis":s=ot;break;case"curveBasisClosed":s=rt;break;case"curveBundle":s=at.beta(r||Tt);break;case"curveCardinal":s=lt.tension(r||mt);break;case"curveMonotoneX":s=ft;break;case"curveMonotoneY":s=pt;break;case"curveNatural":s=xt;break;case"curveStep":s=dt;break;case"curveStepAfter":s=bt;break;case"curveStepBefore":s=yt;break}return ht().curve(s)(_)??""}return""}}export{wt as W}; +import{L as X,D as G,m as Z,s as Q}from"./elements-217018fd.js";class J extends X{onMount(i){super.onMount(i);const{elm:n}=i,e=i.width||parseInt(n.getAttribute("width")??"",10)||G,_=i.height||parseInt(n.getAttribute("height")??"",10)||Z;this.elm||(this.elm=Q(n).append("svg"),this.elm.attr("id",`${this.id}`),this.elm.attr("class","svg-layer")),this.elm.attr("height",_).attr("width",e);const s=this.interactive?"auto":"none";this.elm.style("position","absolute").style("pointer-events",s).style("opacity",this.opacity).style("z-index",this.order)}onUnmount(){var i;super.onUnmount(),(i=this.elm)==null||i.remove(),this.elm=void 0}onResize(i){this.elm&&(super.onResize(i),this.elm.attr("height",i.height).attr("width",i.width))}setVisibility(i){super.setVisibility(i),this.elm&&this.elm.attr("visibility",i?"visible":"hidden")}onOpacityChanged(i){this.elm&&this.elm.style("opacity",i)}onOrderChanged(i){this.elm&&this.elm.style("z-index",i)}onInteractivityChanged(i){if(this.elm){const n=i?"auto":"none";this.elm.style("pointer-events",n)}}}function x(t){return function(){return t}}const A=1e-12,k=Math.PI,w=2*k,p=1e-6,K=w-p;function I(t){this._+=t[0];for(let i=1,n=t.length;i=0))throw new Error(`invalid digits: ${t}`);if(i>15)return I;const n=10**i;return function(e){this._+=e[0];for(let _=1,s=e.length;_p)if(!(Math.abs(u*h-a*l)>p)||!s)this._append`L${this._x1=i},${this._y1=n}`;else{let f=e-o,v=_-r,E=h*h+a*a,F=f*f+v*v,N=Math.sqrt(E),M=Math.sqrt(c),S=s*Math.tan((k-Math.acos((E+c-F)/(2*N*M)))/2),m=S/M,C=S/N;Math.abs(m-1)>p&&this._append`L${i+m*l},${n+m*u}`,this._append`A${s},${s},0,0,${+(u*f>l*v)},${this._x1=i+C*h},${this._y1=n+C*a}`}}arc(i,n,e,_,s,o){if(i=+i,n=+n,e=+e,o=!!o,e<0)throw new Error(`negative radius: ${e}`);let r=e*Math.cos(_),h=e*Math.sin(_),a=i+r,l=n+h,u=1^o,c=o?_-s:s-_;this._x1===null?this._append`M${a},${l}`:(Math.abs(this._x1-a)>p||Math.abs(this._y1-l)>p)&&this._append`L${a},${l}`,e&&(c<0&&(c=c%w+w),c>K?this._append`A${e},${e},0,1,${u},${i-r},${n-h}A${e},${e},0,1,${u},${this._x1=a},${this._y1=l}`:c>p&&this._append`A${e},${e},0,${+(c>=k)},${u},${this._x1=i+e*Math.cos(s)},${this._y1=n+e*Math.sin(s)}`)}rect(i,n,e,_){this._append`M${this._x0=this._x1=+i},${this._y0=this._y1=+n}h${e=+e}v${+_}h${-e}Z`}toString(){return this._}}function nt(t){let i=3;return t.digits=function(n){if(!arguments.length)return i;if(n==null)i=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);i=e}return t},()=>new it(i)}function et(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function D(t){this._context=t}D.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:this._context.lineTo(t,i);break}}};function V(t){return new D(t)}function st(t){return t[0]}function _t(t){return t[1]}function ht(t,i){var n=x(!0),e=null,_=V,s=null,o=nt(r);t=typeof t=="function"?t:t===void 0?st:x(t),i=typeof i=="function"?i:i===void 0?_t:x(i);function r(h){var a,l=(h=et(h)).length,u,c=!1,f;for(e==null&&(s=_(f=o())),a=0;a<=l;++a)!(a0)for(var e=t[0],_=i[0],s=t[n]-e,o=i[n]-_,r=-1,h;++r<=n;)h=r/n,this._basis.point(this._beta*t[r]+(1-this._beta)*(e+h*s),this._beta*i[r]+(1-this._beta)*(_+h*o));this._x=this._y=null,this._basis.lineEnd()},point:function(t,i){this._x.push(+t),this._y.push(+i)}};const at=function t(i){function n(e){return i===1?new y(e):new O(e,i)}return n.beta=function(e){return t(+e)},n}(.85);function P(t,i,n){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-i),t._y2+t._k*(t._y1-n),t._x2,t._y2)}function g(t,i){this._context=t,this._k=(1-i)/6}g.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:P(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2,this._x1=t,this._y1=i;break;case 2:this._point=3;default:P(this,t,i);break}this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};const lt=function t(i){function n(e){return new g(e,i)}return n.tension=function(e){return t(+e)},n}(0);function ct(t,i,n){var e=t._x1,_=t._y1,s=t._x2,o=t._y2;if(t._l01_a>A){var r=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,h=3*t._l01_a*(t._l01_a+t._l12_a);e=(e*r-t._x0*t._l12_2a+t._x2*t._l01_2a)/h,_=(_*r-t._y0*t._l12_2a+t._y2*t._l01_2a)/h}if(t._l23_a>A){var a=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);s=(s*a+t._x1*t._l23_2a-i*t._l12_2a)/l,o=(o*a+t._y1*t._l23_2a-n*t._l12_2a)/l}t._context.bezierCurveTo(e,_,s,o,t._x2,t._y2)}function Y(t,i){this._context=t,this._alpha=i}Y.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){if(t=+t,i=+i,this._point){var n=this._x2-t,e=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+e*e,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3;default:ct(this,t,i);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=t,this._y0=this._y1,this._y1=this._y2,this._y2=i}};const ut=function t(i){function n(e){return i?new Y(e,i):new g(e,0)}return n.alpha=function(e){return t(+e)},n}(.5);function R(t){return t<0?-1:1}function B(t,i,n){var e=t._x1-t._x0,_=i-t._x1,s=(t._y1-t._y0)/(e||_<0&&-0),o=(n-t._y1)/(_||e<0&&-0),r=(s*_+o*e)/(e+_);return(R(s)+R(o))*Math.min(Math.abs(s),Math.abs(o),.5*Math.abs(r))||0}function z(t,i){var n=t._x1-t._x0;return n?(3*(t._y1-t._y0)/n-i)/2:i}function T(t,i,n){var e=t._x0,_=t._y0,s=t._x1,o=t._y1,r=(s-e)/3;t._context.bezierCurveTo(e+r,_+r*i,s-r,o-r*n,s,o)}function d(t){this._context=t}d.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:T(this,this._t0,z(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,i){var n=NaN;if(t=+t,i=+i,!(t===this._x1&&i===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;break;case 2:this._point=3,T(this,z(this,n=B(this,t,i)),n);break;default:T(this,this._t0,n=B(this,t,i));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=i,this._t0=n}}};function j(t){this._context=new q(t)}(j.prototype=Object.create(d.prototype)).point=function(t,i){d.prototype.point.call(this,i,t)};function q(t){this._context=t}q.prototype={moveTo:function(t,i){this._context.moveTo(i,t)},closePath:function(){this._context.closePath()},lineTo:function(t,i){this._context.lineTo(i,t)},bezierCurveTo:function(t,i,n,e,_,s){this._context.bezierCurveTo(i,t,e,n,s,_)}};function ft(t){return new d(t)}function pt(t){return new j(t)}function H(t){this._context=t}H.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,i=this._y,n=t.length;if(n)if(this._line?this._context.lineTo(t[0],i[0]):this._context.moveTo(t[0],i[0]),n===2)this._context.lineTo(t[1],i[1]);else for(var e=U(t),_=U(i),s=0,o=1;o=0;--i)_[i]=(o[i]-_[i+1])/s[i];for(s[n-1]=(t[n]+_[n-1])/2,i=0;i=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,i){switch(t=+t,i=+i,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,i):this._context.moveTo(t,i);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,i),this._context.lineTo(t,i);else{var n=this._x*(1-this._t)+t*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,i)}break}}this._x=t,this._y=i}};function dt(t){return new b(t,.5)}function yt(t){return new b(t,0)}function bt(t){return new b(t,1)}const vt=.7,mt=.9,Tt=1;class wt extends J{constructor(i,n){super(i,n),this.options={...this.options,...n},this.render=this.render.bind(this)}onUpdate(i){super.onUpdate(i),this.render()}onRescale(i){super.onRescale(i),this.elm&&(this.rescaleEvent=i,this.render())}render(){const{strokeWidth:i,stroke:n}=this.options;if(!this.elm)return;this.elm.select("g").remove();const e=this.data||this.referenceSystem&&this.referenceSystem.projectedPath;!e||!this.rescaleEvent||this.elm.append("g").attr("class","well-path").append("path").attr("d",this.renderWellborePath(e)).attr("stroke-width",i||"2px").attr("stroke",n||"red").attr("fill","none")}renderWellborePath(i){if(this.rescaleEvent!=null){const{xScale:n,yScale:e}=this.rescaleEvent,_=i.map(h=>[n(h[0]),e(h[1])]);let s;const{curveType:o,tension:r}=this.options;switch(o){default:case"curveCatmullRom":s=ut.alpha(r||vt);break;case"curveLinear":s=V;break;case"curveBasis":s=ot;break;case"curveBasisClosed":s=rt;break;case"curveBundle":s=at.beta(r||Tt);break;case"curveCardinal":s=lt.tension(r||mt);break;case"curveMonotoneX":s=ft;break;case"curveMonotoneY":s=pt;break;case"curveNatural":s=xt;break;case"curveStep":s=dt;break;case"curveStepAfter":s=bt;break;case"curveStepBefore":s=yt;break}return ht().curve(s)(_)??""}return""}}export{wt as W}; diff --git a/storybook/master/assets/axis.stories-733cecb2.js b/storybook/master/assets/axis.stories-a4be38eb.js similarity index 94% rename from storybook/master/assets/axis.stories-733cecb2.js rename to storybook/master/assets/axis.stories-a4be38eb.js index 0ff6701a..eb619b8a 100644 --- a/storybook/master/assets/axis.stories-733cecb2.js +++ b/storybook/master/assets/axis.stories-a4be38eb.js @@ -1,4 +1,4 @@ -import{A as I}from"./GridLayer-416fefe9.js";import{c as m,d as L,s as v,Z as H,H as S,V as O,f as g,e as f}from"./elements-84f906e9.js";import{C as R}from"./MainController-ae0d41fa.js";const n=500,a=300,o=()=>{const e=m(n),t=L(n,a),i=v(t).append("svg").attr("height",`${a}px`).attr("width",`${n}px`).style("background-color","#eee"),r=!0,w="x",y="y",C="m",b=new I(i,r,w,y,C),c=new H(t,A=>{b.onRescale(A)});return c.setBounds([0,1e3],[0,1e3]),c.adjustToSize(n-S,a-O),e.appendChild(g("Low level interface for creating and displaying an axis, there is also a zoom and pan handler connected")),e.appendChild(t),e.appendChild(f()),e},s=()=>{const e=m(n),t=L(n,a),i={xLabel:"x",yLabel:"y",unitOfMeasure:"m"},r=new R({container:t,axisOptions:i});return r.setBounds([0,1e3],[0,1e3]),r.adjustToSize(n,a),e.appendChild(g("High level interface for creating and displaying an axis, there is also a zoom and pan handler connected")),e.appendChild(t),e.appendChild(f()),e},M={title:"ESV Intersection/Features/Axis",component:o};var l,d,p;o.parameters={...o.parameters,docs:{...(l=o.parameters)==null?void 0:l.docs,source:{originalSource:`() => { +import{A as I}from"./GridLayer-66718e35.js";import{c as m,d as L,s as v,Z as H,H as S,V as O,f as g,e as f}from"./elements-217018fd.js";import{C as R}from"./MainController-1e1a9474.js";const n=500,a=300,o=()=>{const e=m(n),t=L(n,a),i=v(t).append("svg").attr("height",`${a}px`).attr("width",`${n}px`).style("background-color","#eee"),r=!0,w="x",y="y",C="m",b=new I(i,r,w,y,C),c=new H(t,A=>{b.onRescale(A)});return c.setBounds([0,1e3],[0,1e3]),c.adjustToSize(n-S,a-O),e.appendChild(g("Low level interface for creating and displaying an axis, there is also a zoom and pan handler connected")),e.appendChild(t),e.appendChild(f()),e},s=()=>{const e=m(n),t=L(n,a),i={xLabel:"x",yLabel:"y",unitOfMeasure:"m"},r=new R({container:t,axisOptions:i});return r.setBounds([0,1e3],[0,1e3]),r.adjustToSize(n,a),e.appendChild(g("High level interface for creating and displaying an axis, there is also a zoom and pan handler connected")),e.appendChild(t),e.appendChild(f()),e},M={title:"ESV Intersection/Features/Axis",component:o};var l,d,p;o.parameters={...o.parameters,docs:{...(l=o.parameters)==null?void 0:l.docs,source:{originalSource:`() => { const root = createRootContainer(width); const container = createLayerContainer(width, height); const mainGroup = select(container).append('svg').attr('height', \`\${height}px\`).attr('width', \`\${width}px\`).style('background-color', '#eee') as unknown as Selection; diff --git a/storybook/master/assets/basic-intersection.stories-781b633f.js b/storybook/master/assets/basic-intersection.stories-d9b48339.js similarity index 84% rename from storybook/master/assets/basic-intersection.stories-781b633f.js rename to storybook/master/assets/basic-intersection.stories-d9b48339.js index 24878c23..601ca71e 100644 --- a/storybook/master/assets/basic-intersection.stories-781b633f.js +++ b/storybook/master/assets/basic-intersection.stories-d9b48339.js @@ -1,4 +1,4 @@ -import{c as l,d,f as p}from"./elements-84f906e9.js";import{G as h}from"./GridLayer-416fefe9.js";import{C as m}from"./MainController-ae0d41fa.js";const r=700,a=600,e=()=>{const t=l(r),n=d(r,a),o=new m({container:n});return o.addLayer(new h("grid")),o.adjustToSize(r,a),t.appendChild(p("A basic example of setting up the controller along with a layer. The only required input is an HTML container.")),t.appendChild(n),t},w={title:"ESV Intersection/Other examples",component:e};var i,s,c;e.parameters={...e.parameters,docs:{...(i=e.parameters)==null?void 0:i.docs,source:{originalSource:`() => { +import{c as l,d,f as p}from"./elements-217018fd.js";import{G as h}from"./GridLayer-66718e35.js";import{C as m}from"./MainController-1e1a9474.js";const r=700,a=600,e=()=>{const t=l(r),n=d(r,a),o=new m({container:n});return o.addLayer(new h("grid")),o.adjustToSize(r,a),t.appendChild(p("A basic example of setting up the controller along with a layer. The only required input is an HTML container.")),t.appendChild(n),t},w={title:"ESV Intersection/Other examples",component:e};var i,s,c;e.parameters={...e.parameters,docs:{...(i=e.parameters)==null?void 0:i.docs,source:{originalSource:`() => { const root = createRootContainer(width); // this is merely a html element with some basic styling const container = createLayerContainer(width, height); diff --git a/storybook/master/assets/callout-layer.stories-0df518bf.js b/storybook/master/assets/callout-layer.stories-9cb185f5.js similarity index 93% rename from storybook/master/assets/callout-layer.stories-0df518bf.js rename to storybook/master/assets/callout-layer.stories-9cb185f5.js index 2d0fa407..a0582b7f 100644 --- a/storybook/master/assets/callout-layer.stories-0df518bf.js +++ b/storybook/master/assets/callout-layer.stories-9cb185f5.js @@ -1,4 +1,4 @@ -import{I as L,C as M}from"./MainController-ae0d41fa.js";import{c as S,d as D,Z,f as P,e as R}from"./elements-84f906e9.js";import{t as H,g as W,C as x}from"./picks-4685a18c.js";import{W as T}from"./WellborePathLayer-4cd0b66f.js";import{k as b,i as B,d as z}from"./data-e45bb153.js";import"./GridLayer-416fefe9.js";const I=[0,500],F=[0,500],U=500,V=500,i=500,j=500,s=()=>{const n=S(i),a=D(i,j);return Promise.all([b(),B(),z()]).then(d=>{const[p,m,h]=d,g=H(m,h),o=new L(p.map(e=>[e.easting,e.northing,e.tvd])),u=W(g),l=new T("path",{referenceSystem:o,stroke:"red",strokeWidth:"1"}),r=new x("callout",{order:1,referenceSystem:o});r.onMount({elm:a}),l.onMount({elm:a}),r.onUpdate({data:u});const t=new Z(a,e=>{r.onRescale(e),l.onRescale(e)});t.setBounds(I,F),t.adjustToSize(U,V),t.setViewport(1500,1500,3e3)}),n.appendChild(P("Low level interface for creating and displaying a callout layer. We have also added a wellbore path to show the picks along its path. This layer is made using canvas.")),n.appendChild(a),n.appendChild(R()),n},c=()=>{const n=S(i),a=D(i,j);return Promise.all([b(),B(),z()]).then(d=>{const[p,m,h]=d,g=H(m,h),o=new L(p.map(e=>[e.easting,e.northing,e.tvd])),u=W(g),l=new T("path",{referenceSystem:o,stroke:"red",strokeWidth:"1"}),r=new x("callout",{order:1,data:u,referenceSystem:o}),t=new M({container:a,referenceSystem:o});t.addLayer(l),t.addLayer(r),t.setBounds(I,F),t.adjustToSize(U,V),t.setViewport(1500,1500,3e3)}),n.appendChild(P("High level interface for creating and displaying a callout layer. We have also added a wellbore path to show the picks along its path. This layer is made using canvas.")),n.appendChild(a),n.appendChild(R()),n},J={title:"ESV Intersection/Features/Callout",component:s};var y,w,f;s.parameters={...s.parameters,docs:{...(y=s.parameters)==null?void 0:y.docs,source:{originalSource:`() => { +import{I as L,C as M}from"./MainController-1e1a9474.js";import{c as S,d as D,Z,f as P,e as R}from"./elements-217018fd.js";import{t as H,g as W,C as x}from"./picks-2410da4c.js";import{W as T}from"./WellborePathLayer-11ff1510.js";import{k as b,i as B,d as z}from"./data-e45bb153.js";import"./GridLayer-66718e35.js";const I=[0,500],F=[0,500],U=500,V=500,i=500,j=500,s=()=>{const n=S(i),a=D(i,j);return Promise.all([b(),B(),z()]).then(d=>{const[p,m,h]=d,g=H(m,h),o=new L(p.map(e=>[e.easting,e.northing,e.tvd])),u=W(g),l=new T("path",{referenceSystem:o,stroke:"red",strokeWidth:"1"}),r=new x("callout",{order:1,referenceSystem:o});r.onMount({elm:a}),l.onMount({elm:a}),r.onUpdate({data:u});const t=new Z(a,e=>{r.onRescale(e),l.onRescale(e)});t.setBounds(I,F),t.adjustToSize(U,V),t.setViewport(1500,1500,3e3)}),n.appendChild(P("Low level interface for creating and displaying a callout layer. We have also added a wellbore path to show the picks along its path. This layer is made using canvas.")),n.appendChild(a),n.appendChild(R()),n},c=()=>{const n=S(i),a=D(i,j);return Promise.all([b(),B(),z()]).then(d=>{const[p,m,h]=d,g=H(m,h),o=new L(p.map(e=>[e.easting,e.northing,e.tvd])),u=W(g),l=new T("path",{referenceSystem:o,stroke:"red",strokeWidth:"1"}),r=new x("callout",{order:1,data:u,referenceSystem:o}),t=new M({container:a,referenceSystem:o});t.addLayer(l),t.addLayer(r),t.setBounds(I,F),t.adjustToSize(U,V),t.setViewport(1500,1500,3e3)}),n.appendChild(P("High level interface for creating and displaying a callout layer. We have also added a wellbore path to show the picks along its path. This layer is made using canvas.")),n.appendChild(a),n.appendChild(R()),n},J={title:"ESV Intersection/Features/Callout",component:s};var y,w,f;s.parameters={...s.parameters,docs:{...(y=s.parameters)==null?void 0:y.docs,source:{originalSource:`() => { const root = createRootContainer(width); const container = createLayerContainer(width, height); Promise.all([getPositionLog(), getPicks(), getStratColumns()]).then(values => { diff --git a/storybook/master/assets/elements-84f906e9.js b/storybook/master/assets/elements-217018fd.js similarity index 75% rename from storybook/master/assets/elements-84f906e9.js rename to storybook/master/assets/elements-217018fd.js index 55430403..3965e1de 100644 --- a/storybook/master/assets/elements-84f906e9.js +++ b/storybook/master/assets/elements-217018fd.js @@ -1,4 +1,4 @@ -function Sn(r,t){return r==null||t==null?NaN:rt?1:r>=t?0:NaN}function Sf(r,t){return r==null||t==null?NaN:tr?1:t>=r?0:NaN}function zc(r){let t,e,i;r.length!==2?(t=Sn,e=(a,h)=>Sn(r(a),h),i=(a,h)=>r(a)-h):(t=r===Sn||r===Sf?r:Cf,e=r,i=r);function n(a,h,l=0,c=a.length){if(l>>1;e(a[u],h)<0?l=u+1:c=u}while(l>>1;e(a[u],h)<=0?l=u+1:c=u}while(ll&&i(a[u-1],h)>-i(a[u],h)?u-1:u}return{left:n,center:o,right:s}}function Cf(){return 0}function If(r){return r===null?NaN:+r}const Pf=zc(Sn),Rf=Pf.right;zc(If).center;const Mf=Rf;class Ch extends Map{constructor(t,e=Bf){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),t!=null)for(const[i,n]of t)this.set(i,n)}get(t){return super.get(Ih(this,t))}has(t){return super.has(Ih(this,t))}set(t,e){return super.set(Ff(this,t),e)}delete(t){return super.delete(Df(this,t))}}function Ih({_intern:r,_key:t},e){const i=t(e);return r.has(i)?r.get(i):e}function Ff({_intern:r,_key:t},e){const i=t(e);return r.has(i)?r.get(i):(r.set(i,e),e)}function Df({_intern:r,_key:t},e){const i=t(e);return r.has(i)&&(e=r.get(e),r.delete(i)),e}function Bf(r){return r!==null&&typeof r=="object"?r.valueOf():r}const Lf=Math.sqrt(50),Of=Math.sqrt(10),Nf=Math.sqrt(2);function $n(r,t,e){const i=(t-r)/Math.max(0,e),n=Math.floor(Math.log10(i)),s=i/Math.pow(10,n),o=s>=Lf?10:s>=Of?5:s>=Nf?2:1;let a,h,l;return n<0?(l=Math.pow(10,-n)/o,a=Math.round(r*l),h=Math.round(t*l),a/lt&&--h,l=-l):(l=Math.pow(10,n)*o,a=Math.round(r/l),h=Math.round(t/l),a*lt&&--h),h0))return[];if(r===t)return[r];const i=t=n))return[];const a=s-n+1,h=new Array(a);if(i)if(o<0)for(let l=0;l=i)&&(e=i);else{let i=-1;for(let n of r)(n=t(n,++i,r))!=null&&(e=n)&&(e=n)}return e}function Ns(r,t){let e=0;if(t===void 0)for(let i of r)(i=+i)&&(e+=i);else{let i=-1;for(let n of r)(n=+t(n,++i,r))&&(e+=n)}return e}function Vc(r,t){switch(arguments.length){case 0:break;case 1:this.range(r);break;default:this.range(t).domain(r);break}return this}const Ph=Symbol("implicit");function Xc(){var r=new Ch,t=[],e=[],i=Ph;function n(s){let o=r.get(s);if(o===void 0){if(i!==Ph)return i;r.set(s,o=t.push(s)-1)}return e[o%e.length]}return n.domain=function(s){if(!arguments.length)return t.slice();t=[],r=new Ch;for(const o of s)r.has(o)||r.set(o,t.push(o)-1);return n},n.range=function(s){return arguments.length?(e=Array.from(s),n):e.slice()},n.unknown=function(s){return arguments.length?(i=s,n):i},n.copy=function(){return Xc(t,e).unknown(i)},Vc.apply(n,arguments),n}function Wa(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function Wc(r,t){var e=Object.create(r.prototype);for(var i in t)e[i]=t[i];return e}function Ui(){}var Mi=.7,zn=1/Mi,kr="\\s*([+-]?\\d+)\\s*",Fi="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",le="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Gf=/^#([0-9a-f]{3,8})$/,Hf=new RegExp(`^rgb\\(${kr},${kr},${kr}\\)$`),$f=new RegExp(`^rgb\\(${le},${le},${le}\\)$`),zf=new RegExp(`^rgba\\(${kr},${kr},${kr},${Fi}\\)$`),Vf=new RegExp(`^rgba\\(${le},${le},${le},${Fi}\\)$`),Xf=new RegExp(`^hsl\\(${Fi},${le},${le}\\)$`),Wf=new RegExp(`^hsla\\(${Fi},${le},${le},${Fi}\\)$`),Rh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Wa(Ui,Ue,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:Mh,formatHex:Mh,formatHex8:jf,formatHsl:Yf,formatRgb:Fh,toString:Fh});function Mh(){return this.rgb().formatHex()}function jf(){return this.rgb().formatHex8()}function Yf(){return jc(this).formatHsl()}function Fh(){return this.rgb().formatRgb()}function Ue(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=Gf.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?Dh(t):e===3?new St(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?Yi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?Yi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=Hf.exec(r))?new St(t[1],t[2],t[3],1):(t=$f.exec(r))?new St(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=zf.exec(r))?Yi(t[1],t[2],t[3],t[4]):(t=Vf.exec(r))?Yi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Xf.exec(r))?Oh(t[1],t[2]/100,t[3]/100,1):(t=Wf.exec(r))?Oh(t[1],t[2]/100,t[3]/100,t[4]):Rh.hasOwnProperty(r)?Dh(Rh[r]):r==="transparent"?new St(NaN,NaN,NaN,0):null}function Dh(r){return new St(r>>16&255,r>>8&255,r&255,1)}function Yi(r,t,e,i){return i<=0&&(r=t=e=NaN),new St(r,t,e,i)}function qf(r){return r instanceof Ui||(r=Ue(r)),r?(r=r.rgb(),new St(r.r,r.g,r.b,r.opacity)):new St}function Bo(r,t,e,i){return arguments.length===1?qf(r):new St(r,t,e,i??1)}function St(r,t,e,i){this.r=+r,this.g=+t,this.b=+e,this.opacity=+i}Wa(St,Bo,Wc(Ui,{brighter(r){return r=r==null?zn:Math.pow(zn,r),new St(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Mi:Math.pow(Mi,r),new St(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new St(lr(this.r),lr(this.g),lr(this.b),Vn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Bh,formatHex:Bh,formatHex8:Kf,formatRgb:Lh,toString:Lh}));function Bh(){return`#${hr(this.r)}${hr(this.g)}${hr(this.b)}`}function Kf(){return`#${hr(this.r)}${hr(this.g)}${hr(this.b)}${hr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Lh(){const r=Vn(this.opacity);return`${r===1?"rgb(":"rgba("}${lr(this.r)}, ${lr(this.g)}, ${lr(this.b)}${r===1?")":`, ${r})`}`}function Vn(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function lr(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function hr(r){return r=lr(r),(r<16?"0":"")+r.toString(16)}function Oh(r,t,e,i){return i<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new Vt(r,t,e,i)}function jc(r){if(r instanceof Vt)return new Vt(r.h,r.s,r.l,r.opacity);if(r instanceof Ui||(r=Ue(r)),!r)return new Vt;if(r instanceof Vt)return r;r=r.rgb();var t=r.r/255,e=r.g/255,i=r.b/255,n=Math.min(t,e,i),s=Math.max(t,e,i),o=NaN,a=s-n,h=(s+n)/2;return a?(t===s?o=(e-i)/a+(e0&&h<1?0:o,new Vt(o,a,h,r.opacity)}function Zf(r,t,e,i){return arguments.length===1?jc(r):new Vt(r,t,e,i??1)}function Vt(r,t,e,i){this.h=+r,this.s=+t,this.l=+e,this.opacity=+i}Wa(Vt,Zf,Wc(Ui,{brighter(r){return r=r==null?zn:Math.pow(zn,r),new Vt(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Mi:Math.pow(Mi,r),new Vt(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*t,n=2*e-i;return new St(ks(r>=240?r-240:r+120,n,i),ks(r,n,i),ks(r<120?r+240:r-120,n,i),this.opacity)},clamp(){return new Vt(Nh(this.h),qi(this.s),qi(this.l),Vn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=Vn(this.opacity);return`${r===1?"hsl(":"hsla("}${Nh(this.h)}, ${qi(this.s)*100}%, ${qi(this.l)*100}%${r===1?")":`, ${r})`}`}}));function Nh(r){return r=(r||0)%360,r<0?r+360:r}function qi(r){return Math.max(0,Math.min(1,r||0))}function ks(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}const ja=r=>()=>r;function Qf(r,t){return function(e){return r+e*t}}function Jf(r,t,e){return r=Math.pow(r,e),t=Math.pow(t,e)-r,e=1/e,function(i){return Math.pow(r+i*t,e)}}function tp(r){return(r=+r)==1?Yc:function(t,e){return e-t?Jf(t,e,r):ja(isNaN(t)?e:t)}}function Yc(r,t){var e=t-r;return e?Qf(r,e):ja(isNaN(r)?t:r)}const Di=function r(t){var e=tp(t);function i(n,s){var o=e((n=Bo(n)).r,(s=Bo(s)).r),a=e(n.g,s.g),h=e(n.b,s.b),l=Yc(n.opacity,s.opacity);return function(c){return n.r=o(c),n.g=a(c),n.b=h(c),n.opacity=l(c),n+""}}return i.gamma=r,i}(1);function ep(r,t){t||(t=[]);var e=r?Math.min(t.length,r.length):0,i=t.slice(),n;return function(s){for(n=0;ne&&(s=t.slice(e,s),a[o]?a[o]+=s:a[++o]=s),(i=i[0])===(n=n[0])?a[o]?a[o]+=n:a[++o]=n:(a[++o]=null,h.push({i:o,x:zt(i,n)})),e=Us.lastIndex;return e180?c+=360:c-l>180&&(l+=360),d.push({i:u.push(n(u)+"rotate(",null,i)-2,x:zt(l,c)})):c&&u.push(n(u)+"rotate("+c+i)}function a(l,c,u,d){l!==c?d.push({i:u.push(n(u)+"skewX(",null,i)-2,x:zt(l,c)}):c&&u.push(n(u)+"skewX("+c+i)}function h(l,c,u,d,f,p){if(l!==u||c!==d){var m=f.push(n(f)+"scale(",null,",",null,")");p.push({i:m-4,x:zt(l,u)},{i:m-2,x:zt(c,d)})}else(u!==1||d!==1)&&f.push(n(f)+"scale("+u+","+d+")")}return function(l,c){var u=[],d=[];return l=r(l),c=r(c),s(l.translateX,l.translateY,c.translateX,c.translateY,u,d),o(l.rotate,c.rotate,u,d),a(l.skewX,c.skewX,u,d),h(l.scaleX,l.scaleY,c.scaleX,c.scaleY,u,d),l=c=null,function(f){for(var p=-1,m=d.length,g;++pt&&(e=r,r=t,t=e),function(i){return Math.max(r,Math.min(t,i))}}function bp(r,t,e){var i=r[0],n=r[1],s=t[0],o=t[1];return n2?wp:bp,h=l=null,u}function u(d){return d==null||isNaN(d=+d)?s:(h||(h=a(r.map(i),t,e)))(i(o(d)))}return u.invert=function(d){return o(n((l||(l=a(t,r.map(i),zt)))(d)))},u.domain=function(d){return arguments.length?(r=Array.from(d,_p),c()):r.slice()},u.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},u.rangeRound=function(d){return t=Array.from(d),e=hp,c()},u.clamp=function(d){return arguments.length?(o=d?!0:Fr,c()):o!==Fr},u.interpolate=function(d){return arguments.length?(e=d,c()):e},u.unknown=function(d){return arguments.length?(s=d,u):s},function(d,f){return i=d,n=f,c()}}function Ep(){return Ap()(Fr,Fr)}function Sp(r){return Math.abs(r=Math.round(r))>=1e21?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function Xn(r,t){if((e=(r=t?r.toExponential(t-1):r.toExponential()).indexOf("e"))<0)return null;var e,i=r.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+r.slice(e+1)]}function Xr(r){return r=Xn(Math.abs(r)),r?r[1]:NaN}function Cp(r,t){return function(e,i){for(var n=e.length,s=[],o=0,a=r[0],h=0;n>0&&a>0&&(h+a+1>i&&(a=Math.max(1,i-h)),s.push(e.substring(n-=a,n+a)),!((h+=a+1)>i));)a=r[o=(o+1)%r.length];return s.reverse().join(t)}}function Ip(r){return function(t){return t.replace(/[0-9]/g,function(e){return r[+e]})}}var Pp=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Wn(r){if(!(t=Pp.exec(r)))throw new Error("invalid format: "+r);var t;return new qa({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Wn.prototype=qa.prototype;function qa(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}qa.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Rp(r){t:for(var t=r.length,e=1,i=-1,n;e0&&(i=0);break}return i>0?r.slice(0,i)+r.slice(n+1):r}var Qc;function Mp(r,t){var e=Xn(r,t);if(!e)return r+"";var i=e[0],n=e[1],s=n-(Qc=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+Xn(r,Math.max(0,t+s-1))[0]}function Hh(r,t){var e=Xn(r,t);if(!e)return r+"";var i=e[0],n=e[1];return n<0?"0."+new Array(-n).join("0")+i:i.length>n+1?i.slice(0,n+1)+"."+i.slice(n+1):i+new Array(n-i.length+2).join("0")}const $h={"%":(r,t)=>(r*100).toFixed(t),b:r=>Math.round(r).toString(2),c:r=>r+"",d:Sp,e:(r,t)=>r.toExponential(t),f:(r,t)=>r.toFixed(t),g:(r,t)=>r.toPrecision(t),o:r=>Math.round(r).toString(8),p:(r,t)=>Hh(r*100,t),r:Hh,s:Mp,X:r=>Math.round(r).toString(16).toUpperCase(),x:r=>Math.round(r).toString(16)};function zh(r){return r}var Vh=Array.prototype.map,Xh=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Fp(r){var t=r.grouping===void 0||r.thousands===void 0?zh:Cp(Vh.call(r.grouping,Number),r.thousands+""),e=r.currency===void 0?"":r.currency[0]+"",i=r.currency===void 0?"":r.currency[1]+"",n=r.decimal===void 0?".":r.decimal+"",s=r.numerals===void 0?zh:Ip(Vh.call(r.numerals,String)),o=r.percent===void 0?"%":r.percent+"",a=r.minus===void 0?"−":r.minus+"",h=r.nan===void 0?"NaN":r.nan+"";function l(u){u=Wn(u);var d=u.fill,f=u.align,p=u.sign,m=u.symbol,g=u.zero,y=u.width,_=u.comma,v=u.precision,x=u.trim,w=u.type;w==="n"?(_=!0,w="g"):$h[w]||(v===void 0&&(v=12),x=!0,w="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var C=m==="$"?e:m==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",A=m==="$"?i:/[%p]/.test(w)?o:"",S=$h[w],F=/[defgprs%]/.test(w);v=v===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function N(O){var L=C,T=A,b,I,E;if(w==="c")T=S(O)+T,O="";else{O=+O;var R=O<0||1/O<0;if(O=isNaN(O)?h:S(Math.abs(O),v),x&&(O=Rp(O)),R&&+O==0&&p!=="+"&&(R=!1),L=(R?p==="("?p:a:p==="-"||p==="("?"":p)+L,T=(w==="s"?Xh[8+Qc/3]:"")+T+(R&&p==="("?")":""),F){for(b=-1,I=O.length;++bE||E>57){T=(E===46?n+O.slice(b+1):O.slice(b))+T,O=O.slice(0,b);break}}}_&&!g&&(O=t(O,1/0));var D=L.length+O.length+T.length,G=D>1)+L+O+T+G.slice(D);break;default:O=G+L+O+T;break}return s(O)}return N.toString=function(){return u+""},N}function c(u,d){var f=l((u=Wn(u),u.type="f",u)),p=Math.max(-8,Math.min(8,Math.floor(Xr(d)/3)))*3,m=Math.pow(10,-p),g=Xh[8+p/3];return function(y){return f(m*y)+g}}return{format:l,formatPrefix:c}}var Zi,Jc,tu;Dp({thousands:",",grouping:[3],currency:["$",""]});function Dp(r){return Zi=Fp(r),Jc=Zi.format,tu=Zi.formatPrefix,Zi}function Bp(r){return Math.max(0,-Xr(Math.abs(r)))}function Lp(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xr(t)/3)))*3-Xr(Math.abs(r)))}function Op(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,Xr(t)-Xr(r))+1}function Np(r,t,e,i){var n=Uf(r,t,e),s;switch(i=Wn(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(r),Math.abs(t));return i.precision==null&&!isNaN(s=Lp(n,o))&&(i.precision=s),tu(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=Op(n,Math.max(Math.abs(r),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=Bp(n))&&(i.precision=s-(i.type==="%")*2);break}}return Jc(i)}function kp(r){var t=r.domain;return r.ticks=function(e){var i=t();return kf(i[0],i[i.length-1],e??10)},r.tickFormat=function(e,i){var n=t();return Np(n[0],n[n.length-1],e??10,i)},r.nice=function(e){e==null&&(e=10);var i=t(),n=0,s=i.length-1,o=i[n],a=i[s],h,l,c=10;for(a0;){if(l=Fo(o,a,e),l===h)return i[n]=o,i[s]=a,t(i);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;h=l}return r},r}function jn(){var r=Ep();return r.copy=function(){return Tp(r,jn())},Vc.apply(r,arguments),kp(r)}var Up=Math.PI/180;function Gp(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),re?e:r}function eA(r){return r*Up}function rA(r){var t=new Array(r),e=1/(r-1);t[0]=0;for(var i=1;it)return!1;return!0}var Gs=180/Math.PI,jp=Math.PI/180;function Hs(r,t,e){var i=Math.cos(t),n=Math.sin(t),s=r[0];return e[0]=i*s-n*r[1],e[1]=n*s+i*r[1],e}function Yh(r){return Math.atan2(r[1],r[0])}function ai(r,t){var e=Math.atan2(t[1],t[0])-Math.atan2(r[1],r[0]);return e>Math.PI?e-=2*Math.PI:e<=-Math.PI&&(e+=2*Math.PI),e}var eu=function(){function r(t){for(var e=[],i=1;it?Qe(this,t/e,this.isMutating?this:r.zero):this.isMutating?this:this.clone()},r.prototype.rotate=function(t){return Hs(this,t,this.isMutating?this:r.zero)},r.prototype.rotateDeg=function(t){return Hs(this,t*jp,this.isMutating?this:r.zero)},r.prototype.rotate90=function(){return t=this,e=this.isMutating?this:r.zero,i=t[0],e[0]=-t[1],e[1]=i,e;var t,e,i},r.prototype.rotate180=function(){return t=this,(e=this.isMutating?this:r.zero)[0]=-t[0],e[1]=-t[1],e;var t,e},r.prototype.rotate270=function(){return t=this,e=this.isMutating?this:r.zero,i=t[0],e[0]=t[1],e[1]=-i,e;var t,e,i},r.prototype.normalize=function(){return Wh(this)},r.prototype.normalized=function(){return Wh(this,r.zero)},r.distance=function(t,e){return zp(t,e)},r.dot=function(t,e){return Vp(t,e)},r.cross=function(t,e){return function(i,n){return i[0]*n[1]-i[1]*n[0]}(t,e)},r.angleRight=function(t){return Yh(t)},r.angleRightDeg=function(t){return Yh(t)*Gs},r.angle=function(t,e){return Math.abs(ai(t,e))},r.angleDeg=function(t,e){return Math.abs(ai(t,e))*Gs},r.signedAngle=function(t,e){return ai(t,e)},r.signedAngleDeg=function(t,e){return ai(t,e)*Gs},r.lerp=function(t,e,i){var n=new r(t);return Xp(n,e,i)},r.lerpRot=function(t,e,i){return function(n,s,o,a){return a===void 0&&(a=n),Hs(n,o*ai(n,s),a)}(t,e,i,r.zero)},r.prototype.clone=function(){return new r(this[0],this[1])},r.equals=function(t,e,i){return i===void 0&&(i=0),!(Math.abs(t[0]-e[0])>i)&&!(Math.abs(t[1]-e[1])>i)},r.prototype.equals=function(t,e){return e===void 0&&(e=0),r.equals(this,t,e)},r.isZeroVector=function(t,e){return e===void 0&&(e=0),jh(t,e)},r.prototype.isZeroVector=function(t){return t===void 0&&(t=0),jh(this,t)},r.prototype.toArray=function(){return[this[0],this[1]]},r.prototype.modify=function(t){return Wp(this,t)},r.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){switch(e++){case 0:return{value:t[0],done:!1};case 1:return{value:t[1],done:!1};default:return{value:-1,done:!0}}}}},Object.defineProperty(r,"zero",{get:function(){return new r(0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"one",{get:function(){return new r(1,1)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"positiveInfinity",{get:function(){return new r(1/0,1/0)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"negativeInfinity",{get:function(){return new r(-1/0,-1/0)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"up",{get:function(){return new r(0,1)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"right",{get:function(){return new r(1,0)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"down",{get:function(){return new r(0,-1)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"left",{get:function(){return new r(-1,0)},enumerable:!0,configurable:!0}),r}();/*! ***************************************************************************** +function Cn(r,t){return r==null||t==null?NaN:rt?1:r>=t?0:NaN}function Jf(r,t){return r==null||t==null?NaN:tr?1:t>=r?0:NaN}function uu(r){let t,e,i;r.length!==2?(t=Cn,e=(a,h)=>Cn(r(a),h),i=(a,h)=>r(a)-h):(t=r===Cn||r===Jf?r:tp,e=r,i=r);function n(a,h,l=0,c=a.length){if(l>>1;e(a[u],h)<0?l=u+1:c=u}while(l>>1;e(a[u],h)<=0?l=u+1:c=u}while(ll&&i(a[u-1],h)>-i(a[u],h)?u-1:u}return{left:n,center:o,right:s}}function tp(){return 0}function ep(r){return r===null?NaN:+r}const rp=uu(Cn),ip=rp.right;uu(ep).center;const np=ip;class $h extends Map{constructor(t,e=ap){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:e}}),t!=null)for(const[i,n]of t)this.set(i,n)}get(t){return super.get(zh(this,t))}has(t){return super.has(zh(this,t))}set(t,e){return super.set(sp(this,t),e)}delete(t){return super.delete(op(this,t))}}function zh({_intern:r,_key:t},e){const i=t(e);return r.has(i)?r.get(i):e}function sp({_intern:r,_key:t},e){const i=t(e);return r.has(i)?r.get(i):(r.set(i,e),e)}function op({_intern:r,_key:t},e){const i=t(e);return r.has(i)&&(e=r.get(e),r.delete(i)),e}function ap(r){return r!==null&&typeof r=="object"?r.valueOf():r}const hp=Math.sqrt(50),lp=Math.sqrt(10),cp=Math.sqrt(2);function Vn(r,t,e){const i=(t-r)/Math.max(0,e),n=Math.floor(Math.log10(i)),s=i/Math.pow(10,n),o=s>=hp?10:s>=lp?5:s>=cp?2:1;let a,h,l;return n<0?(l=Math.pow(10,-n)/o,a=Math.round(r*l),h=Math.round(t*l),a/lt&&--h,l=-l):(l=Math.pow(10,n)*o,a=Math.round(r/l),h=Math.round(t/l),a*lt&&--h),h0))return[];if(r===t)return[r];const i=t=n))return[];const a=s-n+1,h=new Array(a);if(i)if(o<0)for(let l=0;l=i)&&(e=i);else{let i=-1;for(let n of r)(n=t(n,++i,r))!=null&&(e=n)&&(e=n)}return e}function Hs(r,t){let e=0;if(t===void 0)for(let i of r)(i=+i)&&(e+=i);else{let i=-1;for(let n of r)(n=+t(n,++i,r))&&(e+=n)}return e}function du(r,t){switch(arguments.length){case 0:break;case 1:this.range(r);break;default:this.range(t).domain(r);break}return this}const Vh=Symbol("implicit");function fu(){var r=new $h,t=[],e=[],i=Vh;function n(s){let o=r.get(s);if(o===void 0){if(i!==Vh)return i;r.set(s,o=t.push(s)-1)}return e[o%e.length]}return n.domain=function(s){if(!arguments.length)return t.slice();t=[],r=new $h;for(const o of s)r.has(o)||r.set(o,t.push(o)-1);return n},n.range=function(s){return arguments.length?(e=Array.from(s),n):e.slice()},n.unknown=function(s){return arguments.length?(i=s,n):i},n.copy=function(){return fu(t,e).unknown(i)},du.apply(n,arguments),n}function oh(r,t,e){r.prototype=t.prototype=e,e.constructor=r}function pu(r,t){var e=Object.create(r.prototype);for(var i in t)e[i]=t[i];return e}function ki(){}var Pi=.7,Xn=1/Pi,Nr="\\s*([+-]?\\d+)\\s*",Ri="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",le="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",fp=/^#([0-9a-f]{3,8})$/,pp=new RegExp(`^rgb\\(${Nr},${Nr},${Nr}\\)$`),mp=new RegExp(`^rgb\\(${le},${le},${le}\\)$`),gp=new RegExp(`^rgba\\(${Nr},${Nr},${Nr},${Ri}\\)$`),yp=new RegExp(`^rgba\\(${le},${le},${le},${Ri}\\)$`),vp=new RegExp(`^hsl\\(${Ri},${le},${le}\\)$`),_p=new RegExp(`^hsla\\(${Ri},${le},${le},${Ri}\\)$`),Xh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};oh(ki,Ue,{copy(r){return Object.assign(new this.constructor,this,r)},displayable(){return this.rgb().displayable()},hex:Wh,formatHex:Wh,formatHex8:xp,formatHsl:bp,formatRgb:jh,toString:jh});function Wh(){return this.rgb().formatHex()}function xp(){return this.rgb().formatHex8()}function bp(){return mu(this).formatHsl()}function jh(){return this.rgb().formatRgb()}function Ue(r){var t,e;return r=(r+"").trim().toLowerCase(),(t=fp.exec(r))?(e=t[1].length,t=parseInt(t[1],16),e===6?Yh(t):e===3?new St(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):e===8?qi(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):e===4?qi(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=pp.exec(r))?new St(t[1],t[2],t[3],1):(t=mp.exec(r))?new St(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=gp.exec(r))?qi(t[1],t[2],t[3],t[4]):(t=yp.exec(r))?qi(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=vp.exec(r))?Zh(t[1],t[2]/100,t[3]/100,1):(t=_p.exec(r))?Zh(t[1],t[2]/100,t[3]/100,t[4]):Xh.hasOwnProperty(r)?Yh(Xh[r]):r==="transparent"?new St(NaN,NaN,NaN,0):null}function Yh(r){return new St(r>>16&255,r>>8&255,r&255,1)}function qi(r,t,e,i){return i<=0&&(r=t=e=NaN),new St(r,t,e,i)}function wp(r){return r instanceof ki||(r=Ue(r)),r?(r=r.rgb(),new St(r.r,r.g,r.b,r.opacity)):new St}function Yo(r,t,e,i){return arguments.length===1?wp(r):new St(r,t,e,i??1)}function St(r,t,e,i){this.r=+r,this.g=+t,this.b=+e,this.opacity=+i}oh(St,Yo,pu(ki,{brighter(r){return r=r==null?Xn:Math.pow(Xn,r),new St(this.r*r,this.g*r,this.b*r,this.opacity)},darker(r){return r=r==null?Pi:Math.pow(Pi,r),new St(this.r*r,this.g*r,this.b*r,this.opacity)},rgb(){return this},clamp(){return new St(lr(this.r),lr(this.g),lr(this.b),Wn(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qh,formatHex:qh,formatHex8:Tp,formatRgb:Kh,toString:Kh}));function qh(){return`#${hr(this.r)}${hr(this.g)}${hr(this.b)}`}function Tp(){return`#${hr(this.r)}${hr(this.g)}${hr(this.b)}${hr((isNaN(this.opacity)?1:this.opacity)*255)}`}function Kh(){const r=Wn(this.opacity);return`${r===1?"rgb(":"rgba("}${lr(this.r)}, ${lr(this.g)}, ${lr(this.b)}${r===1?")":`, ${r})`}`}function Wn(r){return isNaN(r)?1:Math.max(0,Math.min(1,r))}function lr(r){return Math.max(0,Math.min(255,Math.round(r)||0))}function hr(r){return r=lr(r),(r<16?"0":"")+r.toString(16)}function Zh(r,t,e,i){return i<=0?r=t=e=NaN:e<=0||e>=1?r=t=NaN:t<=0&&(r=NaN),new Vt(r,t,e,i)}function mu(r){if(r instanceof Vt)return new Vt(r.h,r.s,r.l,r.opacity);if(r instanceof ki||(r=Ue(r)),!r)return new Vt;if(r instanceof Vt)return r;r=r.rgb();var t=r.r/255,e=r.g/255,i=r.b/255,n=Math.min(t,e,i),s=Math.max(t,e,i),o=NaN,a=s-n,h=(s+n)/2;return a?(t===s?o=(e-i)/a+(e0&&h<1?0:o,new Vt(o,a,h,r.opacity)}function Ap(r,t,e,i){return arguments.length===1?mu(r):new Vt(r,t,e,i??1)}function Vt(r,t,e,i){this.h=+r,this.s=+t,this.l=+e,this.opacity=+i}oh(Vt,Ap,pu(ki,{brighter(r){return r=r==null?Xn:Math.pow(Xn,r),new Vt(this.h,this.s,this.l*r,this.opacity)},darker(r){return r=r==null?Pi:Math.pow(Pi,r),new Vt(this.h,this.s,this.l*r,this.opacity)},rgb(){var r=this.h%360+(this.h<0)*360,t=isNaN(r)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*t,n=2*e-i;return new St($s(r>=240?r-240:r+120,n,i),$s(r,n,i),$s(r<120?r+240:r-120,n,i),this.opacity)},clamp(){return new Vt(Qh(this.h),Ki(this.s),Ki(this.l),Wn(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const r=Wn(this.opacity);return`${r===1?"hsl(":"hsla("}${Qh(this.h)}, ${Ki(this.s)*100}%, ${Ki(this.l)*100}%${r===1?")":`, ${r})`}`}}));function Qh(r){return r=(r||0)%360,r<0?r+360:r}function Ki(r){return Math.max(0,Math.min(1,r||0))}function $s(r,t,e){return(r<60?t+(e-t)*r/60:r<180?e:r<240?t+(e-t)*(240-r)/60:t)*255}const ah=r=>()=>r;function Ep(r,t){return function(e){return r+e*t}}function Sp(r,t,e){return r=Math.pow(r,e),t=Math.pow(t,e)-r,e=1/e,function(i){return Math.pow(r+i*t,e)}}function Cp(r){return(r=+r)==1?gu:function(t,e){return e-t?Sp(t,e,r):ah(isNaN(t)?e:t)}}function gu(r,t){var e=t-r;return e?Ep(r,e):ah(isNaN(r)?t:r)}const Mi=function r(t){var e=Cp(t);function i(n,s){var o=e((n=Yo(n)).r,(s=Yo(s)).r),a=e(n.g,s.g),h=e(n.b,s.b),l=gu(n.opacity,s.opacity);return function(c){return n.r=o(c),n.g=a(c),n.b=h(c),n.opacity=l(c),n+""}}return i.gamma=r,i}(1);function Ip(r,t){t||(t=[]);var e=r?Math.min(t.length,r.length):0,i=t.slice(),n;return function(s){for(n=0;ne&&(s=t.slice(e,s),a[o]?a[o]+=s:a[++o]=s),(i=i[0])===(n=n[0])?a[o]?a[o]+=n:a[++o]=n:(a[++o]=null,h.push({i:o,x:zt(i,n)})),e=zs.lastIndex;return e180?c+=360:c-l>180&&(l+=360),d.push({i:u.push(n(u)+"rotate(",null,i)-2,x:zt(l,c)})):c&&u.push(n(u)+"rotate("+c+i)}function a(l,c,u,d){l!==c?d.push({i:u.push(n(u)+"skewX(",null,i)-2,x:zt(l,c)}):c&&u.push(n(u)+"skewX("+c+i)}function h(l,c,u,d,f,p){if(l!==u||c!==d){var m=f.push(n(f)+"scale(",null,",",null,")");p.push({i:m-4,x:zt(l,u)},{i:m-2,x:zt(c,d)})}else(u!==1||d!==1)&&f.push(n(f)+"scale("+u+","+d+")")}return function(l,c){var u=[],d=[];return l=r(l),c=r(c),s(l.translateX,l.translateY,c.translateX,c.translateY,u,d),o(l.rotate,c.rotate,u,d),a(l.skewX,c.skewX,u,d),h(l.scaleX,l.scaleY,c.scaleX,c.scaleY,u,d),l=c=null,function(f){for(var p=-1,m=d.length,g;++pt&&(e=r,r=t,t=e),function(i){return Math.max(r,Math.min(t,i))}}function Yp(r,t,e){var i=r[0],n=r[1],s=t[0],o=t[1];return n2?qp:Yp,h=l=null,u}function u(d){return d==null||isNaN(d=+d)?s:(h||(h=a(r.map(i),t,e)))(i(o(d)))}return u.invert=function(d){return o(n((l||(l=a(t,r.map(i),zt)))(d)))},u.domain=function(d){return arguments.length?(r=Array.from(d,Wp),c()):r.slice()},u.range=function(d){return arguments.length?(t=Array.from(d),c()):t.slice()},u.rangeRound=function(d){return t=Array.from(d),e=Lp,c()},u.clamp=function(d){return arguments.length?(o=d?!0:Mr,c()):o!==Mr},u.interpolate=function(d){return arguments.length?(e=d,c()):e},u.unknown=function(d){return arguments.length?(s=d,u):s},function(d,f){return i=d,n=f,c()}}function Qp(){return Zp()(Mr,Mr)}function Jp(r){return Math.abs(r=Math.round(r))>=1e21?r.toLocaleString("en").replace(/,/g,""):r.toString(10)}function jn(r,t){if((e=(r=t?r.toExponential(t-1):r.toExponential()).indexOf("e"))<0)return null;var e,i=r.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+r.slice(e+1)]}function Vr(r){return r=jn(Math.abs(r)),r?r[1]:NaN}function t0(r,t){return function(e,i){for(var n=e.length,s=[],o=0,a=r[0],h=0;n>0&&a>0&&(h+a+1>i&&(a=Math.max(1,i-h)),s.push(e.substring(n-=a,n+a)),!((h+=a+1)>i));)a=r[o=(o+1)%r.length];return s.reverse().join(t)}}function e0(r){return function(t){return t.replace(/[0-9]/g,function(e){return r[+e]})}}var r0=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Yn(r){if(!(t=r0.exec(r)))throw new Error("invalid format: "+r);var t;return new lh({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Yn.prototype=lh.prototype;function lh(r){this.fill=r.fill===void 0?" ":r.fill+"",this.align=r.align===void 0?">":r.align+"",this.sign=r.sign===void 0?"-":r.sign+"",this.symbol=r.symbol===void 0?"":r.symbol+"",this.zero=!!r.zero,this.width=r.width===void 0?void 0:+r.width,this.comma=!!r.comma,this.precision=r.precision===void 0?void 0:+r.precision,this.trim=!!r.trim,this.type=r.type===void 0?"":r.type+""}lh.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function i0(r){t:for(var t=r.length,e=1,i=-1,n;e0&&(i=0);break}return i>0?r.slice(0,i)+r.slice(n+1):r}var xu;function n0(r,t){var e=jn(r,t);if(!e)return r+"";var i=e[0],n=e[1],s=n-(xu=Math.max(-8,Math.min(8,Math.floor(n/3)))*3)+1,o=i.length;return s===o?i:s>o?i+new Array(s-o+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+jn(r,Math.max(0,t+s-1))[0]}function rl(r,t){var e=jn(r,t);if(!e)return r+"";var i=e[0],n=e[1];return n<0?"0."+new Array(-n).join("0")+i:i.length>n+1?i.slice(0,n+1)+"."+i.slice(n+1):i+new Array(n-i.length+2).join("0")}const il={"%":(r,t)=>(r*100).toFixed(t),b:r=>Math.round(r).toString(2),c:r=>r+"",d:Jp,e:(r,t)=>r.toExponential(t),f:(r,t)=>r.toFixed(t),g:(r,t)=>r.toPrecision(t),o:r=>Math.round(r).toString(8),p:(r,t)=>rl(r*100,t),r:rl,s:n0,X:r=>Math.round(r).toString(16).toUpperCase(),x:r=>Math.round(r).toString(16)};function nl(r){return r}var sl=Array.prototype.map,ol=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function s0(r){var t=r.grouping===void 0||r.thousands===void 0?nl:t0(sl.call(r.grouping,Number),r.thousands+""),e=r.currency===void 0?"":r.currency[0]+"",i=r.currency===void 0?"":r.currency[1]+"",n=r.decimal===void 0?".":r.decimal+"",s=r.numerals===void 0?nl:e0(sl.call(r.numerals,String)),o=r.percent===void 0?"%":r.percent+"",a=r.minus===void 0?"−":r.minus+"",h=r.nan===void 0?"NaN":r.nan+"";function l(u){u=Yn(u);var d=u.fill,f=u.align,p=u.sign,m=u.symbol,g=u.zero,y=u.width,_=u.comma,v=u.precision,x=u.trim,w=u.type;w==="n"?(_=!0,w="g"):il[w]||(v===void 0&&(v=12),x=!0,w="g"),(g||d==="0"&&f==="=")&&(g=!0,d="0",f="=");var C=m==="$"?e:m==="#"&&/[boxX]/.test(w)?"0"+w.toLowerCase():"",A=m==="$"?i:/[%p]/.test(w)?o:"",S=il[w],F=/[defgprs%]/.test(w);v=v===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,v)):Math.max(0,Math.min(20,v));function N(O){var L=C,T=A,b,I,E;if(w==="c")T=S(O)+T,O="";else{O=+O;var R=O<0||1/O<0;if(O=isNaN(O)?h:S(Math.abs(O),v),x&&(O=i0(O)),R&&+O==0&&p!=="+"&&(R=!1),L=(R?p==="("?p:a:p==="-"||p==="("?"":p)+L,T=(w==="s"?ol[8+xu/3]:"")+T+(R&&p==="("?")":""),F){for(b=-1,I=O.length;++bE||E>57){T=(E===46?n+O.slice(b+1):O.slice(b))+T,O=O.slice(0,b);break}}}_&&!g&&(O=t(O,1/0));var D=L.length+O.length+T.length,G=D>1)+L+O+T+G.slice(D);break;default:O=G+L+O+T;break}return s(O)}return N.toString=function(){return u+""},N}function c(u,d){var f=l((u=Yn(u),u.type="f",u)),p=Math.max(-8,Math.min(8,Math.floor(Vr(d)/3)))*3,m=Math.pow(10,-p),g=ol[8+p/3];return function(y){return f(m*y)+g}}return{format:l,formatPrefix:c}}var Qi,bu,wu;o0({thousands:",",grouping:[3],currency:["$",""]});function o0(r){return Qi=s0(r),bu=Qi.format,wu=Qi.formatPrefix,Qi}function a0(r){return Math.max(0,-Vr(Math.abs(r)))}function h0(r,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Vr(t)/3)))*3-Vr(Math.abs(r)))}function l0(r,t){return r=Math.abs(r),t=Math.abs(t)-r,Math.max(0,Vr(t)-Vr(r))+1}function c0(r,t,e,i){var n=dp(r,t,e),s;switch(i=Yn(i??",f"),i.type){case"s":{var o=Math.max(Math.abs(r),Math.abs(t));return i.precision==null&&!isNaN(s=h0(n,o))&&(i.precision=s),wu(i,o)}case"":case"e":case"g":case"p":case"r":{i.precision==null&&!isNaN(s=l0(n,Math.max(Math.abs(r),Math.abs(t))))&&(i.precision=s-(i.type==="e"));break}case"f":case"%":{i.precision==null&&!isNaN(s=a0(n))&&(i.precision=s-(i.type==="%")*2);break}}return bu(i)}function u0(r){var t=r.domain;return r.ticks=function(e){var i=t();return up(i[0],i[i.length-1],e??10)},r.tickFormat=function(e,i){var n=t();return c0(n[0],n[n.length-1],e??10,i)},r.nice=function(e){e==null&&(e=10);var i=t(),n=0,s=i.length-1,o=i[n],a=i[s],h,l,c=10;for(a0;){if(l=Wo(o,a,e),l===h)return i[n]=o,i[s]=a,t(i);if(l>0)o=Math.floor(o/l)*l,a=Math.ceil(a/l)*l;else if(l<0)o=Math.ceil(o*l)/l,a=Math.floor(a*l)/l;else break;h=l}return r},r}function qn(){var r=Qp();return r.copy=function(){return Kp(r,qn())},du.apply(r,arguments),u0(r)}var d0=Math.PI/180;function f0(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),re?e:r}function qA(r){return r*d0}function KA(r){var t=new Array(r),e=1/(r-1);t[0]=0;for(var i=1;it)return!1;return!0}var Vs=180/Math.PI,x0=Math.PI/180;function Xs(r,t,e){var i=Math.cos(t),n=Math.sin(t),s=r[0];return e[0]=i*s-n*r[1],e[1]=n*s+i*r[1],e}function ll(r){return Math.atan2(r[1],r[0])}function si(r,t){var e=Math.atan2(t[1],t[0])-Math.atan2(r[1],r[0]);return e>Math.PI?e-=2*Math.PI:e<=-Math.PI&&(e+=2*Math.PI),e}var Tu=function(){function r(t){for(var e=[],i=1;it?Qe(this,t/e,this.isMutating?this:r.zero):this.isMutating?this:this.clone()},r.prototype.rotate=function(t){return Xs(this,t,this.isMutating?this:r.zero)},r.prototype.rotateDeg=function(t){return Xs(this,t*x0,this.isMutating?this:r.zero)},r.prototype.rotate90=function(){return t=this,e=this.isMutating?this:r.zero,i=t[0],e[0]=-t[1],e[1]=i,e;var t,e,i},r.prototype.rotate180=function(){return t=this,(e=this.isMutating?this:r.zero)[0]=-t[0],e[1]=-t[1],e;var t,e},r.prototype.rotate270=function(){return t=this,e=this.isMutating?this:r.zero,i=t[0],e[0]=t[1],e[1]=-i,e;var t,e,i},r.prototype.normalize=function(){return al(this)},r.prototype.normalized=function(){return al(this,r.zero)},r.distance=function(t,e){return g0(t,e)},r.dot=function(t,e){return y0(t,e)},r.cross=function(t,e){return function(i,n){return i[0]*n[1]-i[1]*n[0]}(t,e)},r.angleRight=function(t){return ll(t)},r.angleRightDeg=function(t){return ll(t)*Vs},r.angle=function(t,e){return Math.abs(si(t,e))},r.angleDeg=function(t,e){return Math.abs(si(t,e))*Vs},r.signedAngle=function(t,e){return si(t,e)},r.signedAngleDeg=function(t,e){return si(t,e)*Vs},r.lerp=function(t,e,i){var n=new r(t);return v0(n,e,i)},r.lerpRot=function(t,e,i){return function(n,s,o,a){return a===void 0&&(a=n),Xs(n,o*si(n,s),a)}(t,e,i,r.zero)},r.prototype.clone=function(){return new r(this[0],this[1])},r.equals=function(t,e,i){return i===void 0&&(i=0),!(Math.abs(t[0]-e[0])>i)&&!(Math.abs(t[1]-e[1])>i)},r.prototype.equals=function(t,e){return e===void 0&&(e=0),r.equals(this,t,e)},r.isZeroVector=function(t,e){return e===void 0&&(e=0),hl(t,e)},r.prototype.isZeroVector=function(t){return t===void 0&&(t=0),hl(this,t)},r.prototype.toArray=function(){return[this[0],this[1]]},r.prototype.modify=function(t){return _0(this,t)},r.prototype[Symbol.iterator]=function(){var t=this,e=0;return{next:function(){switch(e++){case 0:return{value:t[0],done:!1};case 1:return{value:t[1],done:!1};default:return{value:-1,done:!0}}}}},Object.defineProperty(r,"zero",{get:function(){return new r(0,0)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"one",{get:function(){return new r(1,1)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"positiveInfinity",{get:function(){return new r(1/0,1/0)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"negativeInfinity",{get:function(){return new r(-1/0,-1/0)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"up",{get:function(){return new r(0,1)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"right",{get:function(){return new r(1,0)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"down",{get:function(){return new r(0,-1)},enumerable:!0,configurable:!0}),Object.defineProperty(r,"left",{get:function(){return new r(-1,0)},enumerable:!0,configurable:!0}),r}();/*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the @@ -11,24 +11,24 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. -***************************************************************************** */var ko=function(r,t){return ko=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},ko(r,t)};function Ka(r,t){function e(){this.constructor=r}ko(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Uo=function(){return Uo=Object.assign||function(r){for(var t,e=1,i=arguments.length;e0?t[r-1]:qh(n,s),o=re?e:r}function Ho(r,t){var e=t[0];if(r>=t[t.length-1])return t.length-1;if(r<=e)return 0;for(var i=0,n=t.length-1;i<=n;){var s=Math.floor((i+n)/2),o=t[s];if(or))return s;n=s-1}}return Math.max(0,n)}var Wt=Math.pow(2,-42);function Kh(r){var t=Math.pow(Math.abs(r),.3333333333333333);return r<0?-t:t}function ru(r,t,e){if(Math.abs(r)0?[(-t+Math.sqrt(i))/(2*r),(-t-Math.sqrt(i))/(2*r)]:[]}function Qp(r,t,e,i){if(Math.abs(r)0)n=[(h=Kh(-o/2-Math.sqrt(a)))-s/(3*h)];else{var h=2*Math.sqrt(-s/3),l=Math.acos(3*o/s/h)/3,c=2*Math.PI/3;n=[h*Math.cos(l),h*Math.cos(l-c),h*Math.cos(l-2*c)]}}for(var u=0;u3)){e=e||new Array(3);var i=r[0],n=r[1],s=r[2]||0,o=t[0],a=t[1],h=t[2]||0;return e[0]=n*h-s*a,e[1]=s*o-i*h,e[2]=i*a-n*o,e}}function iu(r,t){for(var e=0,i=0;i2)throw Error("Only supported for 2d vectors");var e=t?Yn(r,t):r,i=-e[1];return e[1]=e[0],e[0]=i,e}function e0(r,t,e,i,n){if(n===void 0&&(n=0),n===0)return[0,1,2,3];var s=function(h,l){return Math.pow(iu(h,l),.5*n)},o=s(t,r),a=s(e,t)+o;return[0,o,a,s(i,e)+a]}function r0(r,t,e,i,n){for(var s=Number.isFinite(n.tension)?n.tension:.5,o=Number.isFinite(n.alpha)?n.alpha:null,a=o>0?e0(r,t,e,i,o):null,h=new Array(r.length),l=0;l-Wt&&o<=1+Wt}).map(function(o){return Lt(o,0,1)})}function $o(r,t,e,i){i===void 0&&(i=null),i=i||new Array(e.length);for(var n=0;nZh)throw Error("Order for Gaussian Quadrature must be in the range of ".concat(5," and ").concat(Zh,"."));return su[o-5]}(e),s._nSamples=i,s}return Ka(t,r),t.prototype._invalidateCache=function(){r.prototype._invalidateCache.call(this),this._cache.arcLengths=null,this._cache.samples=null},Object.defineProperty(t.prototype,"arcLengths",{get:function(){return this._cache.arcLengths||(this._cache.arcLengths=this.computeArcLengths()),this._cache.arcLengths},enumerable:!1,configurable:!0}),t.prototype.getSamples=function(e){if(this.points){if(this._cache.samples||(this._cache.samples=new Map),!this._cache.samples.has(e)){for(var i=this._nSamples,n=[],s=[],o=this.getCoefficients(e),a=0;a.95&&(c=Lt(c,-1,1)),s.push(c)}var u=i-1,d=[],f=[],p=n[0],m=s[0],g=1/u;for(a=0;a=o[o.length-1])return 1;if(i<=0)return 0;var c=Math.max(0,Ho(i,o)),u=c*n;if(o[c]===i)return u;var d=a[c],f=l[c],p=h[c],m=i-o[c];return((f*m+p)*m+d)*m+u},t.prototype.lengthAt=function(e){return e*this.arcLengths[this.arcLengths.length-1]},t.prototype.getT=function(e){var i=this.arcLengths,n=i.length,s=e*i[n-1],o=Ho(s,i),a=o/(n-1);if(i[o]===s)return a;var h=s-i[o];return(o+this.inverse(o,h))/(n-1)},t.prototype.getU=function(e){if(e===0)return 0;if(e===1)return 1;var i=this.arcLengths,n=i.length-1,s=i[n],o=e*n,a=Math.floor(o),h=i[a];if(o===a)return h/s;var l=o-a;return(h+this.computeArcLength(a,0,l))/s},t}(nu),o0=function(){function r(t,e){e===void 0&&(e={});var i=this;this._cache=new Map;var n=(e=Uo({tension:.5,alpha:0,closed:!1},e)).arcDivisions?new n0(e.arcDivisions,function(){return i._invalidateCache()}):new s0(e.numericalApproximationOrder,e.numericalInverseSamples,function(){return i._invalidateCache()});n.alpha=e.alpha,n.tension=e.tension,n.closed=e.closed,n.points=t,this._lmargin=e.lmargin||1-n.tension,this._curveMapper=n}return r.prototype.getTimeFromPosition=function(t,e){return e===void 0&&(e=!1),this._curveMapper.getT(e?Lt(t,0,1):t)},r.prototype.getPositionFromTime=function(t,e){return e===void 0&&(e=!1),this._curveMapper.getU(e?Lt(t,0,1):t)},r.prototype.getPositionFromLength=function(t,e){e===void 0&&(e=!1);var i=e?Lt(t,0,this.length):t;return this._curveMapper.getU(i/this.length)},r.prototype.getLengthAt=function(t,e){return t===void 0&&(t=1),e===void 0&&(e=!1),this._curveMapper.lengthAt(e?Lt(t,0,1):t)},r.prototype.getTimeAtKnot=function(t){if(t<0||t>this.points.length-1)throw Error("Invalid index!");return t===0?0:this.closed||t!==this.points.length-1?t/(this.closed?this.points.length:this.points.length-1):1},r.prototype.getPositionAtKnot=function(t){return this.getPositionFromTime(this.getTimeAtKnot(t))},r.prototype.getPointAtTime=function(t,e){return(t=Lt(t,0,1))===0?Yn(this.points[0],e):t===1?Yn(this.closed?this.points[0]:this.points[this.points.length-1],e):this._curveMapper.evaluateForT(Br,t,e)},r.prototype.getPointAt=function(t,e){return this.getPointAtTime(this.getTimeFromPosition(t),e)},r.prototype.getTangentAt=function(t,e){var i=Lt(this.getTimeFromPosition(t),0,1);return this.getTangentAtTime(i,e)},r.prototype.getTangentAtTime=function(t,e){return Je(this._curveMapper.evaluateForT(Lr,t,e))},r.prototype.getNormalAt=function(t,e){var i=Lt(this.getTimeFromPosition(t),0,1);return this.getNormalAtTime(i,e)},r.prototype.getNormalAtTime=function(t,e){var i=Je(this._curveMapper.evaluateForT(Lr,t));if(!(i.length<2||i.length>3)){var n=e||new Array(i.length);if(i.length===2)return n[0]=-i[1],n[1]=i[0],n;var s=Je(this._curveMapper.evaluateForT($s,t));return Je(Qi(Qi(i,s),i),n)}},r.prototype.getCurvatureAt=function(t){var e=Lt(this.getTimeFromPosition(t),0,1);return this.getCurvatureAtTime(e)},r.prototype.getCurvatureAtTime=function(t){var e=this._curveMapper.evaluateForT(Lr,t),i=this._curveMapper.evaluateForT($s,t),n=Je(e,[]),s=0,o=void 0;if(e.length===2){if((u=Math.pow(e[0]*e[0]+e[1]*e[1],1.5))!==0){var a=(e[0]*i[1]-e[1]*i[0])/u;o=a<0?[n[1],-n[0]]:[-n[1],n[0]],s=Math.abs(a)}}else if(e.length===3){var h=Dr(e),l=Qi(e,i);o=Je(Qi(l,e)),h!==0&&(s=Dr(l)/Math.pow(h,3))}else{h=Dr(e);var c=Dr(i),u=Math.pow(h,3),d=Jp(e,i);u!==0&&(s=Math.sqrt(Math.pow(h,2)*Math.pow(c,2)-Math.pow(d,2))/u)}return{curvature:s,radius:s!==0?1/s:0,tangent:n,direction:o}},r.prototype.getDerivativeAt=function(t,e){var i=Lt(this.getTimeFromPosition(t),0,1);return this._curveMapper.evaluateForT(Lr,i,e)},r.prototype.getSecondDerivativeAt=function(t,e){var i=Lt(this.getTimeFromPosition(t),0,1);return this._curveMapper.evaluateForT($s,i,e)},r.prototype.getBoundingBox=function(t,e){if(t===void 0&&(t=0),e===void 0&&(e=1),t===0&&e===1&&this._cache.has("bbox"))return this._cache.get("bbox");for(var i=[],n=[],s=this.getTimeFromPosition(t),o=this.getTimeFromPosition(e),a=this.getPointAtTime(s),h=this.getPointAtTime(o),l=this.closed?this.points.length:this.points.length-1,c=Math.floor(l*s),u=Math.ceil(l*o),d=0;dn[v]&&(n[v]=_[v]);if(p.tension<1){var x=l*s-(y-1),w=l*o-(y-1),C=function(F){return F>-Wt&&F<=1+Wt&&(y-1!==c||F>x)&&(y!==u||Fn[F]&&(n[F]=L)})};for(v=0;v1||n=0&&d<=1){i.getPointAtTime(d,s);var f=qn(t,s);if(fe;)c(l-u)||c(l+u)||(u/=2);return{u:a=this._curveMapper.getU(l),distance:o,point:s}},r.prototype.getIntersects=function(t,e,i,n){var s=this;e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=this._lmargin);var o=this.getIntersectsAsTime(t,e,i,n).map(function(a){return s.getPointAtTime(a)});return Math.abs(i)===1?o.length===1?o[0]:null:o},r.prototype.getIntersectsAsPositions=function(t,e,i,n){var s=this;return e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=this._lmargin),this.getIntersectsAsTime(t,e,i,n).map(function(o){return s.getPositionFromTime(o)})},r.prototype.getIntersectsAsTime=function(t,e,i,n){e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=this._lmargin);for(var s=e,o=new Set,a=this.closed?this.points.length:this.points.length-1,h=0;h=p){var g=i0(t,f[s]);i<0?g.sort(function(v,x){return x-v}):i>=0&&g.sort(function(v,x){return v-x});for(var y=0;y1||i1)throw Error("Invalid position (u) for sample in forEach!");var f=s.getTimeFromPosition(u),p=t({u,t:f,i:d,prev:c});c={u,t:f,i:d,value:p}})},r.prototype.map=function(t,e,i,n){var s=this;i===void 0&&(i=0),n===void 0&&(n=1);var o=[];if(Number.isFinite(e)){if(e<=1)throw Error("Invalid arguments passed to map(). You must specify at least 2 samples.");for(var a=e,h=0;h1)throw Error("Invalid position (u) for sample in map()!");var f=s.getTimeFromPosition(u),p=t({u,t:f,i:d,prev:c});return c={u,t:f,i:d,value:p},p})},r.prototype.reduce=function(t,e,i,n,s){var o=this;n===void 0&&(n=0),s===void 0&&(s=1);var a=[];if(Number.isFinite(i)){if(i<=1)throw Error("Invalid arguments passed to map(). You must specify at least 2 samples.");for(var h=i,l=0;l1)throw Error("Invalid position (u) for sample in map()!");var p=o.getTimeFromPosition(d);return t({acc:u,u:d,t:p,i:f})},e)},r.prototype._invalidateCache=function(){return this._cache=new Map,this},r.prototype.reset=function(){this._curveMapper.reset()},Object.defineProperty(r.prototype,"points",{get:function(){return this._curveMapper.points},set:function(t){this._curveMapper.points=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tension",{get:function(){return this._curveMapper.tension},set:function(t){this._curveMapper.tension=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"alpha",{get:function(){return this._curveMapper.alpha},set:function(t){this._curveMapper.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"closed",{get:function(){return this._curveMapper.closed},set:function(t){this._curveMapper.closed=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){return this._curveMapper.lengthAt(1)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minX",{get:function(){return this.getBoundingBox().min[0]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxX",{get:function(){return this.getBoundingBox().max[0]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minY",{get:function(){return this.getBoundingBox().min[1]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxY",{get:function(){return this.getBoundingBox().max[1]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minZ",{get:function(){return this.getBoundingBox().min[2]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxZ",{get:function(){return this.getBoundingBox().max[2]},enumerable:!1,configurable:!0}),r}();(function(r){function t(e,i,n,s,o){return i===void 0&&(i=.5),n===void 0&&(n=300),s===void 0&&(s=!1),o===void 0&&(o=0),r.call(this,e.map(function(a){return[a[0],a[1]]}),{tension:i,alpha:o,arcDivisions:n,closed:s})||this}return Ka(t,r),t.prototype.x=function(e,i,n){i===void 0&&(i=0),n===void 0&&(n=this._lmargin);var s=this.getIntersects(e,1,i,n);return Math.abs(i)===1?s[0]:s.map(function(o){return o[0]})},t.prototype.y=function(e,i,n){i===void 0&&(i=0),n===void 0&&(n=this._lmargin);var s=this.getIntersects(e,0,i,n);return Math.abs(i)===1?s[1]:s.map(function(o){return o[1]})},t.prototype.getNormalAt=function(e,i){return Je(t0(this.getTangentAt(e,i)))},t.prototype.getAngleAt=function(e){var i=this.getTangentAt(e);return Math.atan2(i[1],i[0])},t.prototype.getBoundingBox=function(e,i){e===void 0&&(e=0),i===void 0&&(i=1);var n=r.prototype.getBoundingBox.call(this,e,i);return{x1:n.min[0],x2:n.max[0],y1:n.min[1],y2:n.max[1],min:n.min,max:n.max}},t})(o0);var zo="http://www.w3.org/1999/xhtml";const Qh={svg:"http://www.w3.org/2000/svg",xhtml:zo,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function xs(r){var t=r+="",e=t.indexOf(":");return e>=0&&(t=r.slice(0,e))!=="xmlns"&&(r=r.slice(e+1)),Qh.hasOwnProperty(t)?{space:Qh[t],local:r}:r}function a0(r){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===zo&&t.documentElement.namespaceURI===zo?t.createElement(r):t.createElementNS(e,r)}}function h0(r){return function(){return this.ownerDocument.createElementNS(r.space,r.local)}}function ou(r){var t=xs(r);return(t.local?h0:a0)(t)}function l0(){}function Za(r){return r==null?l0:function(){return this.querySelector(r)}}function c0(r){typeof r!="function"&&(r=Za(r));for(var t=this._groups,e=t.length,i=new Array(e),n=0;n=v&&(v=_+1);!(w=g[v])&&++v=0;)(o=i[n])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function L0(r){r||(r=O0);function t(u,d){return u&&d?r(u.__data__,d.__data__):!u-!d}for(var e=this._groups,i=e.length,n=new Array(i),s=0;st?1:r>=t?0:NaN}function N0(){var r=arguments[0];return arguments[0]=this,r.apply(null,arguments),this}function k0(){return Array.from(this)}function U0(){for(var r=this._groups,t=0,e=r.length;t1?this.each((t==null?K0:typeof t=="function"?Q0:Z0)(r,t,e??"")):Wr(this.node(),r)}function Wr(r,t){return r.style.getPropertyValue(t)||uu(r).getComputedStyle(r,null).getPropertyValue(t)}function tm(r){return function(){delete this[r]}}function em(r,t){return function(){this[r]=t}}function rm(r,t){return function(){var e=t.apply(this,arguments);e==null?delete this[r]:this[r]=e}}function im(r,t){return arguments.length>1?this.each((t==null?tm:typeof t=="function"?rm:em)(r,t)):this.node()[r]}function du(r){return r.trim().split(/^|\s+/)}function Qa(r){return r.classList||new fu(r)}function fu(r){this._node=r,this._names=du(r.getAttribute("class")||"")}fu.prototype={add:function(r){var t=this._names.indexOf(r);t<0&&(this._names.push(r),this._node.setAttribute("class",this._names.join(" ")))},remove:function(r){var t=this._names.indexOf(r);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(r){return this._names.indexOf(r)>=0}};function pu(r,t){for(var e=Qa(r),i=-1,n=t.length;++i=0&&(e=t.slice(i+1),t=t.slice(0,i)),{type:t,name:e}})}function Mm(r){return function(){var t=this.__on;if(t){for(var e=0,i=-1,n=t.length,s;e{}};function Ja(){for(var r=0,t=arguments.length,e={},i;r=0&&(i=e.slice(n+1),e=e.slice(0,n)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:i}})}Cn.prototype=Ja.prototype={constructor:Cn,on:function(r,t){var e=this._,i=Hm(r+"",e),n,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var e=new Array(n),i=0,n,s;i=0&&r._call.call(void 0,t),r=r._next;--jr}function tl(){pr=(Qn=Bi.now())+bs,jr=gi=0;try{Wm()}finally{jr=0,Ym(),pr=0}}function jm(){var r=Bi.now(),t=r-Qn;t>vu&&(bs-=t,Qn=r)}function Ym(){for(var r,t=Zn,e,i=1/0;t;)t._call?(i>t._time&&(i=t._time),r=t,t=t._next):(e=t._next,t._next=null,t=r?r._next=e:Zn=e);yi=r,Wo(i)}function Wo(r){if(!jr){gi&&(gi=clearTimeout(gi));var t=r-pr;t>24?(r<1/0&&(gi=setTimeout(tl,r-Bi.now()-bs)),hi&&(hi=clearInterval(hi))):(hi||(Qn=Bi.now(),hi=setInterval(jm,vu)),jr=1,_u(tl))}}function el(r,t,e){var i=new Jn;return t=t==null?0:+t,i.restart(n=>{i.stop(),r(n+t)},t,e),i}var qm=Ja("start","end","cancel","interrupt"),Km=[],bu=0,rl=1,jo=2,In=3,il=4,Yo=5,Pn=6;function ws(r,t,e,i,n,s){var o=r.__transition;if(!o)r.__transition={};else if(e in o)return;Zm(r,e,{name:t,index:i,group:n,on:qm,tween:Km,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:bu})}function eh(r,t){var e=qt(r,t);if(e.state>bu)throw new Error("too late; already scheduled");return e}function pe(r,t){var e=qt(r,t);if(e.state>In)throw new Error("too late; already running");return e}function qt(r,t){var e=r.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}function Zm(r,t,e){var i=r.__transition,n;i[t]=e,e.timer=xu(s,0,e.time);function s(l){e.state=rl,e.timer.restart(o,e.delay,e.time),e.delay<=l&&o(l-e.delay)}function o(l){var c,u,d,f;if(e.state!==rl)return h();for(c in i)if(f=i[c],f.name===e.name){if(f.state===In)return el(o);f.state===il?(f.state=Pn,f.timer.stop(),f.on.call("interrupt",r,r.__data__,f.index,f.group),delete i[c]):+cjo&&i.state=0&&(t=t.slice(0,e)),!t||t==="start"})}function Cg(r,t,e){var i,n,s=Sg(t)?eh:pe;return function(){var o=s(this,r),a=o.on;a!==i&&(n=(i=a).copy()).on(t,e),o.on=n}}function Ig(r,t){var e=this._id;return arguments.length<2?qt(this.node(),e).on.on(r):this.each(Cg(e,r,t))}function Pg(r){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==r)return;t&&t.removeChild(this)}}function Rg(){return this.on("end.remove",Pg(this._id))}function Mg(r){var t=this._name,e=this._id;typeof r!="function"&&(r=Za(r));for(var i=this._groups,n=i.length,s=new Array(n),o=0;o()=>r;function r1(r,{sourceEvent:t,target:e,transform:i,dispatch:n}){Object.defineProperties(this,{type:{value:r,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:n}})}function be(r,t,e){this.k=r,this.x=t,this.y=e}be.prototype={constructor:be,scale:function(r){return r===1?this:new be(this.k*r,this.x,this.y)},translate:function(r,t){return r===0&t===0?this:new be(this.k,this.x+this.k*r,this.y+this.k*t)},apply:function(r){return[r[0]*this.k+this.x,r[1]*this.k+this.y]},applyX:function(r){return r*this.k+this.x},applyY:function(r){return r*this.k+this.y},invert:function(r){return[(r[0]-this.x)/this.k,(r[1]-this.y)/this.k]},invertX:function(r){return(r-this.x)/this.k},invertY:function(r){return(r-this.y)/this.k},rescaleX:function(r){return r.copy().domain(r.range().map(this.invertX,this).map(r.invert,r))},rescaleY:function(r){return r.copy().domain(r.range().map(this.invertY,this).map(r.invert,r))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ih=new be(1,0,0);be.prototype;function zs(r){r.stopImmediatePropagation()}function li(r){r.preventDefault(),r.stopImmediatePropagation()}function i1(r){return(!r.ctrlKey||r.type==="wheel")&&!r.button}function n1(){var r=this;return r instanceof SVGElement?(r=r.ownerSVGElement||r,r.hasAttribute("viewBox")?(r=r.viewBox.baseVal,[[r.x,r.y],[r.x+r.width,r.y+r.height]]):[[0,0],[r.width.baseVal.value,r.height.baseVal.value]]):[[0,0],[r.clientWidth,r.clientHeight]]}function nl(){return this.__zoom||ih}function s1(r){return-r.deltaY*(r.deltaMode===1?.05:r.deltaMode?1:.002)*(r.ctrlKey?10:1)}function o1(){return navigator.maxTouchPoints||"ontouchstart"in this}function a1(r,t,e){var i=r.invertX(t[0][0])-e[0][0],n=r.invertX(t[1][0])-e[1][0],s=r.invertY(t[0][1])-e[0][1],o=r.invertY(t[1][1])-e[1][1];return r.translate(n>i?(i+n)/2:Math.min(0,i)||Math.max(0,n),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function h1(){var r=i1,t=n1,e=a1,i=s1,n=o1,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,h=gp,l=Ja("start","zoom","end"),c,u,d,f=500,p=150,m=0,g=10;function y(b){b.property("__zoom",nl).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",F).on("dblclick.zoom",N).filter(n).on("touchstart.zoom",O).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(b,I,E,R){var D=b.selection?b.selection():b;D.property("__zoom",nl),b!==D?w(b,I,E,R):D.interrupt().each(function(){C(this,arguments).event(R).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(b,I,E,R){y.scaleTo(b,function(){var D=this.__zoom.k,G=typeof I=="function"?I.apply(this,arguments):I;return D*G},E,R)},y.scaleTo=function(b,I,E,R){y.transform(b,function(){var D=t.apply(this,arguments),G=this.__zoom,P=E==null?x(D):typeof E=="function"?E.apply(this,arguments):E,M=G.invert(P),W=typeof I=="function"?I.apply(this,arguments):I;return e(v(_(G,W),P,M),D,o)},E,R)},y.translateBy=function(b,I,E,R){y.transform(b,function(){return e(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),o)},null,R)},y.translateTo=function(b,I,E,R,D){y.transform(b,function(){var G=t.apply(this,arguments),P=this.__zoom,M=R==null?x(G):typeof R=="function"?R.apply(this,arguments):R;return e(ih.translate(M[0],M[1]).scale(P.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof E=="function"?-E.apply(this,arguments):-E),G,o)},R,D)};function _(b,I){return I=Math.max(s[0],Math.min(s[1],I)),I===b.k?b:new be(I,b.x,b.y)}function v(b,I,E){var R=I[0]-E[0]*b.k,D=I[1]-E[1]*b.k;return R===b.x&&D===b.y?b:new be(b.k,R,D)}function x(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function w(b,I,E,R){b.on("start.zoom",function(){C(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(R).end()}).tween("zoom",function(){var D=this,G=arguments,P=C(D,G).event(R),M=t.apply(D,G),W=E==null?x(M):typeof E=="function"?E.apply(D,G):E,Q=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),q=D.__zoom,et=typeof I=="function"?I.apply(D,G):I,rt=h(q.invert(W).concat(Q/q.k),et.invert(W).concat(Q/et.k));return function(it){if(it===1)it=et;else{var nt=rt(it),xt=Q/nt[2];it=new be(xt,W[0]-nt[0]*xt,W[1]-nt[1]*xt)}P.zoom(null,it)}})}function C(b,I,E){return!E&&b.__zooming||new A(b,I)}function A(b,I){this.that=b,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,I),this.taps=0}A.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,I){return this.mouse&&b!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var I=Be(this.that).datum();l.call(b,this.that,new r1(b,{sourceEvent:this.sourceEvent,target:y,type:b,transform:this.that.__zoom,dispatch:l}),I)}};function S(b,...I){if(!r.apply(this,arguments))return;var E=C(this,I).event(b),R=this.__zoom,D=Math.max(s[0],Math.min(s[1],R.k*Math.pow(2,i.apply(this,arguments)))),G=qe(b);if(E.wheel)(E.mouse[0][0]!==G[0]||E.mouse[0][1]!==G[1])&&(E.mouse[1]=R.invert(E.mouse[0]=G)),clearTimeout(E.wheel);else{if(R.k===D)return;E.mouse=[G,R.invert(G)],Rn(this),E.start()}li(b),E.wheel=setTimeout(P,p),E.zoom("mouse",e(v(_(R,D),E.mouse[0],E.mouse[1]),E.extent,o));function P(){E.wheel=null,E.end()}}function F(b,...I){if(d||!r.apply(this,arguments))return;var E=b.currentTarget,R=C(this,I,!0).event(b),D=Be(b.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",Q,!0),G=qe(b,E),P=b.clientX,M=b.clientY;zm(b.view),zs(b),R.mouse=[G,this.__zoom.invert(G)],Rn(this),R.start();function W(q){if(li(q),!R.moved){var et=q.clientX-P,rt=q.clientY-M;R.moved=et*et+rt*rt>m}R.event(q).zoom("mouse",e(v(R.that.__zoom,R.mouse[0]=qe(q,E),R.mouse[1]),R.extent,o))}function Q(q){D.on("mousemove.zoom mouseup.zoom",null),Vm(q.view,R.moved),li(q),R.event(q).end()}}function N(b,...I){if(r.apply(this,arguments)){var E=this.__zoom,R=qe(b.changedTouches?b.changedTouches[0]:b,this),D=E.invert(R),G=E.k*(b.shiftKey?.5:2),P=e(v(_(E,G),R,D),t.apply(this,I),o);li(b),a>0?Be(this).transition().duration(a).call(w,P,R,b):Be(this).call(y.transform,P,R,b)}}function O(b,...I){if(r.apply(this,arguments)){var E=b.touches,R=E.length,D=C(this,I,b.changedTouches.length===R).event(b),G,P,M,W;for(zs(b),P=0;P0?s.transform(o.transition().duration(n),p):s.transform(o,p)}setBounds(t,e){this.xBounds=t,this.yBounds=e,this.recalculateZoomTransform()}setTranslateBounds(t,e){this.translateBoundsX=t,this.translateBoundsY=e,this.updateTranslateExtent()}adjustToSize(t,e,i=!1){const{width:n,height:s,scaleX:o,scaleY:a,recalculateZoomTransform:h}=this;let l=0,c=0;if(typeof t=="number"&&typeof e=="number")c=e,l=t;else{const f=this.container.node();if(f){const{width:p,height:m}=f.getBoundingClientRect();l=p,c=m}}const u=Math.max(1,l),d=Math.max(1,c);!i&&n===u&&s===d||(o.range([0,u]),a.range([0,d]),h(),this.onRescale(this.currentStateAsEvent()))}calculateTransform(t,e,i){const{scaleX:n,xSpan:s,xBounds:o,yBounds:a,zFactor:h,viewportRatio:l,isXInverted:c,isYInverted:u}=this,[d,f]=n.range(),p=Math.abs(e-t),m=s/p,g=p/(f-d),y=i-(u?-p:p)/h/l/2,_=(o[0]-t)/(c?-g:g),v=(a[0]-y)/((u?-g:g)/h);return ih.translate(_,v).scale(m)}recalculateZoomTransform(){const{scaleX:t,scaleY:e,container:i,calculateTransform:n,updateTranslateExtent:s}=this,[o,a]=t.domain(),[h,l]=e.domain(),c=h+(l-h)/2,u=n(o,a,c);s(),this.zoom.transform(i,u)}setZoomLevelBoundary(t){return this.zoom.scaleExtent(t),this}setMaxZoomLevel(t){const e=this.zoom.scaleExtent();return this.zoom.scaleExtent([e[0],t]),this}setMinZoomLevel(t){const e=this.zoom.scaleExtent();return this.zoom.scaleExtent([t,e[1]]),this}}const u1={order:1,layerOpacity:1,interactive:!1};class Eu{constructor(t,e){this._interactive=!1,this._id=t||`layer-${Math.floor(Math.random()*1e3)}`;const i=e||u1;this._order=i.order||1,this._options={...i},this.loading=!1,this._element=void 0,this._opacity=i.layerOpacity||1,this._visible=!0,this._interactive=i.interactive||!1,e&&e.data&&this.setData(e.data),this._referenceSystem=e==null?void 0:e.referenceSystem,this.onMount=this.onMount.bind(this),this.onUnmount=this.onUnmount.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onRescale=this.onRescale.bind(this),this.onResize=this.onResize.bind(this),this.onOrderChanged=this.onOrderChanged.bind(this),this.onOpacityChanged=this.onOpacityChanged.bind(this),this.setVisibility=this.setVisibility.bind(this)}get id(){return this._id}get element(){return this._element}get options(){return this._options}set options(t){this._options=t}set isLoading(t){this.loading=t}get isLoading(){return this.loading}set opacity(t){this._opacity=t,this.onOpacityChanged(t)}get opacity(){return this._opacity}set order(t){this._order=t,this.onOrderChanged(t)}get order(){return this._order}set interactive(t){this._interactive=t,this.onInteractivityChanged(t)}get interactive(){return this._interactive}get referenceSystem(){return this._referenceSystem}set referenceSystem(t){this._referenceSystem=t}get data(){return this.getData()}set data(t){this.setData(t)}get isVisible(){return this._visible}getData(){return this._data}setData(t){this._data=t,this.element&&t!=null&&this.onUpdate({data:t})}clearData(t=!0){this._data=void 0,t&&(this.referenceSystem=void 0),this.onUpdate({})}setVisibility(t,e){this._visible=t}onMount(t){this._element=t.elm,this._options.onMount&&this._options.onMount(t,this)}onUnmount(t){this._options.onUnmount&&t!=null&&this._options.onUnmount(t,this)}onResize(t){this._options.onResize&&this._options.onResize(t,this)}onUpdate(t){t.data&&(this._data=t.data),this._options.onUpdate&&this._options.onUpdate(t,this)}onRescale(t){this.optionsRescale(t)}optionsRescale(t){this._options.onRescale&&this._options.onRescale(t,this)}getInternalLayerIds(){return[]}}const Su=200,Cu=300,nA=40,sA=30,d1=100,f1=.6,p1=.3,m1=8,g1=16,Ge=64,oA=1;class aA extends Eu{onOpacityChanged(t){this.canvas&&this.updateStyle()}onOrderChanged(t){this.canvas&&this.updateStyle()}onInteractivityChanged(t){this.canvas&&this.updateStyle()}setVisibility(t){super.setVisibility(t),this.canvas&&this.updateStyle(t)}updateStyle(t){var s;const i=t||this.isVisible?"visible":"hidden",n=this.interactive?"auto":"none";(s=this.canvas)==null||s.setAttribute("style",`position:absolute;pointer-events:${n};z-index:${this.order};opacity:${this.opacity};visibility:${i}`)}onMount(t){super.onMount(t);const{elm:e}=t,i=t.width||parseInt((e==null?void 0:e.getAttribute("width"))??"",10)||Su,n=t.height||parseInt((e==null?void 0:e.getAttribute("height"))??"",10)||Cu;this.elm=e;let s;this.canvas||(s=document.createElement("canvas"),this.canvas=s,t.elm.appendChild(s)),this.canvas.setAttribute("id",`${this.id}`),this.canvas.setAttribute("width",`${i}px`),this.canvas.setAttribute("height",`${n}px`),this.canvas.setAttribute("class","canvas-layer"),this.updateStyle(),this.ctx=this.canvas.getContext("2d")??void 0}onUnmount(){var t;super.onUnmount(),(t=this.canvas)==null||t.remove(),this.canvas=void 0}onResize(t){const{ctx:e}=this,{width:i,height:n}=t;e==null||e.canvas.setAttribute("width",`${i}px`),e==null||e.canvas.setAttribute("height",`${n}px`)}onUpdate(t){super.onUpdate(t)}resetTransform(){var t;(t=this.ctx)==null||t.resetTransform()}setTransform(t){var n,s;this.resetTransform();const e=t.xBounds[0]>t.xBounds[1],i=t.yBounds[0]>t.yBounds[1];(n=this.ctx)==null||n.translate(t.xScale(0),t.yScale(0)),(s=this.ctx)==null||s.scale(t.xRatio*(e?-1:1),t.yRatio*(i?-1:1))}clearCanvas(){const{ctx:t,canvas:e}=this;t==null||t.save(),t==null||t.resetTransform(),t==null||t.clearRect(0,0,(e==null?void 0:e.width)??0,(e==null?void 0:e.height)??0),t==null||t.restore()}}var vr=(r=>(r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2",r))(vr||{}),nh=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS",r))(nh||{}),qo=(r=>(r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL",r))(qo||{}),j=(r=>(r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR",r))(j||{}),ae=(r=>(r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN",r))(ae||{}),B=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(B||{}),Ur=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(Ur||{}),X=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(X||{}),H=(r=>(r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT",r))(H||{}),he=(r=>(r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR",r))(he||{}),Ft=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(Ft||{}),de=(r=>(r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL",r))(de||{}),Ct=(r=>(r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",r))(Ct||{}),se=(r=>(r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT",r))(se||{}),sh=(r=>(r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL",r))(sh||{}),Nt=(r=>(r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp",r))(Nt||{}),yt=(r=>(r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR",r))(yt||{}),pt=(r=>(r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH",r))(pt||{}),ce=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(ce||{});const y1={createCanvas:(r,t)=>{const e=document.createElement("canvas");return e.width=r,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")},$={ADAPTER:y1,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Vs=/iPhone/i,sl=/iPod/i,ol=/iPad/i,al=/\biOS-universal(?:.+)Mac\b/i,Xs=/\bAndroid(?:.+)Mobile\b/i,hl=/Android/i,xr=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,tn=/Silk/i,ye=/Windows Phone/i,ll=/\bWindows(?:.+)ARM\b/i,cl=/BlackBerry/i,ul=/BB10/i,dl=/Opera Mini/i,fl=/\b(CriOS|Chrome)(?:.+)Mobile/i,pl=/Mobile(?:.+)Firefox\b/i,ml=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function v1(r){return function(t){return t.test(r)}}function gl(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.userAgent,i=e.split("[FBAN");typeof i[1]<"u"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]<"u"&&(e=i[0]);var n=v1(e),s={apple:{phone:n(Vs)&&!n(ye),ipod:n(sl),tablet:!n(Vs)&&(n(ol)||ml(t))&&!n(ye),universal:n(al),device:(n(Vs)||n(sl)||n(ol)||n(al)||ml(t))&&!n(ye)},amazon:{phone:n(xr),tablet:!n(xr)&&n(tn),device:n(xr)||n(tn)},android:{phone:!n(ye)&&n(xr)||!n(ye)&&n(Xs),tablet:!n(ye)&&!n(xr)&&!n(Xs)&&(n(tn)||n(hl)),device:!n(ye)&&(n(xr)||n(tn)||n(Xs)||n(hl))||n(/\bokhttp\b/i)},windows:{phone:n(ye),tablet:n(ll),device:n(ye)||n(ll)},other:{blackberry:n(cl),blackberry10:n(ul),opera:n(dl),firefox:n(pl),chrome:n(fl),device:n(cl)||n(ul)||n(dl)||n(pl)||n(fl)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const _1=gl.default??gl,we=_1(globalThis.navigator);$.RETINA_PREFIX=/@([0-9\.]+)x/;$.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Ei=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Iu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function x1(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),e}var Pu={exports:{}};(function(r){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function n(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function s(h,l,c,u,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new n(c,u||h,d),p=e?e+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],f]:h._events[p].push(f):(h._events[p]=f,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=e?e+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d80*e){a=l=r[0],h=c=r[1];for(var p=e;pl&&(l=u),d>c&&(c=d);f=Math.max(l-a,c-h),f=f!==0?32767/f:0}return Li(s,o,e,a,h,f,0),o}function Ru(r,t,e,i,n){var s,o;if(n===Qo(r,t,e,i)>0)for(s=t;s=t;s-=i)o=yl(s,r[s],r[s+1],o);return o&&As(o,o.next)&&(Ni(o),o=o.next),o}function mr(r,t){if(!r)return r;t||(t=r);var e=r,i;do if(i=!1,!e.steiner&&(As(e,e.next)||lt(e.prev,e,e.next)===0)){if(Ni(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Li(r,t,e,i,n,s,o){if(r){!o&&s&&M1(r,i,n,s);for(var a=r,h,l;r.prev!==r.next;){if(h=r.prev,l=r.next,s?T1(r,i,n,s):w1(r)){t.push(h.i/e|0),t.push(r.i/e|0),t.push(l.i/e|0),Ni(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=A1(mr(r),t,e),Li(r,t,e,i,n,s,2)):o===2&&E1(r,t,e,i,n,s):Li(mr(r),t,e,i,n,s,1);break}}}}function w1(r){var t=r.prev,e=r,i=r.next;if(lt(t,e,i)>=0)return!1;for(var n=t.x,s=e.x,o=i.x,a=t.y,h=e.y,l=i.y,c=ns?n>o?n:o:s>o?s:o,f=a>h?a>l?a:l:h>l?h:l,p=i.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=u&&p.y<=f&&Or(n,a,s,h,o,l,p.x,p.y)&<(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function T1(r,t,e,i){var n=r.prev,s=r,o=r.next;if(lt(n,s,o)>=0)return!1;for(var a=n.x,h=s.x,l=o.x,c=n.y,u=s.y,d=o.y,f=ah?a>l?a:l:h>l?h:l,g=c>u?c>d?c:d:u>d?u:d,y=Ko(f,p,t,e,i),_=Ko(m,g,t,e,i),v=r.prevZ,x=r.nextZ;v&&v.z>=y&&x&&x.z<=_;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==n&&v!==o&&Or(a,c,h,u,l,d,v.x,v.y)&<(v.prev,v,v.next)>=0||(v=v.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==n&&x!==o&&Or(a,c,h,u,l,d,x.x,x.y)&<(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;v&&v.z>=y;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==n&&v!==o&&Or(a,c,h,u,l,d,v.x,v.y)&<(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=_;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==n&&x!==o&&Or(a,c,h,u,l,d,x.x,x.y)&<(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function A1(r,t,e){var i=r;do{var n=i.prev,s=i.next.next;!As(n,s)&&Mu(n,i,i.next,s)&&Oi(n,s)&&Oi(s,n)&&(t.push(n.i/e|0),t.push(i.i/e|0),t.push(s.i/e|0),Ni(i),Ni(i.next),i=r=s),i=i.next}while(i!==r);return mr(i)}function E1(r,t,e,i,n,s){var o=r;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&B1(o,a)){var h=Fu(o,a);o=mr(o,o.next),h=mr(h,h.next),Li(o,t,e,i,n,s,0),Li(h,t,e,i,n,s,0);return}a=a.next}o=o.next}while(o!==r)}function S1(r,t,e,i){var n=[],s,o,a,h,l;for(s=0,o=t.length;s=e.next.y&&e.next.y!==e.y){var a=e.x+(n-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=i&&a>s&&(s=a,o=e.x=e.x&&e.x>=l&&i!==e.x&&Or(no.x||e.x===o.x&&R1(o,e)))&&(o=e,u=d)),e=e.next;while(e!==h);return o}function R1(r,t){return lt(r.prev,r,t.prev)<0&<(t.next,r,r.next)<0}function M1(r,t,e,i){var n=r;do n.z===0&&(n.z=Ko(n.x,n.y,t,e,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,F1(n)}function F1(r){var t,e,i,n,s,o,a,h,l=1;do{for(e=r,r=null,s=null,o=0;e;){for(o++,i=e,a=0,t=0;t0||h>0&&i;)a!==0&&(h===0||!i||e.z<=i.z)?(n=e,e=e.nextZ,a--):(n=i,i=i.nextZ,h--),s?s.nextZ=n:r=n,n.prevZ=s,s=n;e=i}s.nextZ=null,l*=2}while(o>1);return r}function Ko(r,t,e,i,n){return r=(r-e)*n|0,t=(t-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function D1(r){var t=r,e=r;do(t.x=(r-o)*(s-a)&&(r-o)*(i-a)>=(e-o)*(t-a)&&(e-o)*(s-a)>=(n-o)*(i-a)}function B1(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!L1(r,t)&&(Oi(r,t)&&Oi(t,r)&&O1(r,t)&&(lt(r.prev,r,t.prev)||lt(r,t.prev,t))||As(r,t)&<(r.prev,r,r.next)>0&<(t.prev,t,t.next)>0)}function lt(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function As(r,t){return r.x===t.x&&r.y===t.y}function Mu(r,t,e,i){var n=rn(lt(r,t,e)),s=rn(lt(r,t,i)),o=rn(lt(e,i,r)),a=rn(lt(e,i,t));return!!(n!==s&&o!==a||n===0&&en(r,e,t)||s===0&&en(r,i,t)||o===0&&en(e,r,i)||a===0&&en(e,t,i))}function en(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function rn(r){return r>0?1:r<0?-1:0}function L1(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Mu(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Oi(r,t){return lt(r.prev,r,r.next)<0?lt(r,t,r.next)>=0&<(r,r.prev,t)>=0:lt(r,t,r.prev)<0||lt(r,r.next,t)<0}function O1(r,t){var e=r,i=!1,n=(r.x+t.x)/2,s=(r.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&n<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==r);return i}function Fu(r,t){var e=new Zo(r.i,r.x,r.y),i=new Zo(t.i,t.x,t.y),n=r.next,s=t.prev;return r.next=t,t.prev=r,e.next=n,n.prev=e,i.next=e,e.prev=i,s.next=i,i.prev=s,i}function yl(r,t,e,i){var n=new Zo(r,t,e);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Ni(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Zo(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Ts.deviation=function(r,t,e,i){var n=t&&t.length,s=n?t[0]*e:r.length,o=Math.abs(Qo(r,0,s,e));if(n)for(var a=0,h=t.length;a0&&(i+=r[n-1].length,e.holes.push(i))}return e};var N1=oh.exports;const k1=Iu(N1);var ts={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */ts.exports;(function(r,t){(function(e){var i=t&&!t.nodeType&&t,n=r&&!r.nodeType&&r,s=typeof Ei=="object"&&Ei;(s.global===s||s.window===s||s.self===s)&&(e=s);var o,a=2147483647,h=36,l=1,c=26,u=38,d=700,f=72,p=128,m="-",g=/^xn--/,y=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=h-l,w=Math.floor,C=String.fromCharCode,A;function S(P){throw new RangeError(v[P])}function F(P,M){for(var W=P.length,Q=[];W--;)Q[W]=M(P[W]);return Q}function N(P,M){var W=P.split("@"),Q="";W.length>1&&(Q=W[0]+"@",P=W[1]),P=P.replace(_,".");var q=P.split("."),et=F(q,M).join(".");return Q+et}function O(P){for(var M=[],W=0,Q=P.length,q,et;W=55296&&q<=56319&&W65535&&(M-=65536,W+=C(M>>>10&1023|55296),M=56320|M&1023),W+=C(M),W}).join("")}function T(P){return P-48<10?P-22:P-65<26?P-65:P-97<26?P-97:h}function b(P,M){return P+22+75*(P<26)-((M!=0)<<5)}function I(P,M,W){var Q=0;for(P=W?w(P/d):P>>1,P+=w(P/M);P>x*c>>1;Q+=h)P=w(P/x);return w(Q+(x+1)*P/(P+u))}function E(P){var M=[],W=P.length,Q,q=0,et=p,rt=f,it,nt,xt,bt,ht,ft,mt,Zt,Qt;for(it=P.lastIndexOf(m),it<0&&(it=0),nt=0;nt=128&&S("not-basic"),M.push(P.charCodeAt(nt));for(xt=it>0?it+1:0;xt=W&&S("invalid-input"),mt=T(P.charCodeAt(xt++)),(mt>=h||mt>w((a-q)/ht))&&S("overflow"),q+=mt*ht,Zt=ft<=rt?l:ft>=rt+c?c:ft-rt,!(mtw(a/Qt)&&S("overflow"),ht*=Qt;Q=M.length+1,rt=I(q-bt,Q,bt==0),w(q/Q)>a-et&&S("overflow"),et+=w(q/Q),q%=Q,M.splice(q++,0,et)}return L(M)}function R(P){var M,W,Q,q,et,rt,it,nt,xt,bt,ht,ft=[],mt,Zt,Qt,ni;for(P=O(P),mt=P.length,M=p,W=0,et=f,rt=0;rt=M&&htw((a-W)/Zt)&&S("overflow"),W+=(it-M)*Zt,M=it,rt=0;rta&&S("overflow"),ht==M){for(nt=W,xt=h;bt=xt<=et?l:xt>=et+c?c:xt-et,!(nt"u"||!vt?tt:vt(Uint8Array),ur={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?tt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?tt:ArrayBuffer,"%ArrayIteratorPrototype%":br&&vt?vt([][Symbol.iterator]()):tt,"%AsyncFromSyncIteratorPrototype%":tt,"%AsyncFunction%":Er,"%AsyncGenerator%":Er,"%AsyncGeneratorFunction%":Er,"%AsyncIteratorPrototype%":Er,"%Atomics%":typeof Atomics>"u"?tt:Atomics,"%BigInt%":typeof BigInt>"u"?tt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?tt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?tt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?tt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":hy,"%eval%":eval,"%EvalError%":ly,"%Float32Array%":typeof Float32Array>"u"?tt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?tt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?tt:FinalizationRegistry,"%Function%":Bu,"%GeneratorFunction%":Er,"%Int8Array%":typeof Int8Array>"u"?tt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?tt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?tt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":br&&vt?vt(vt([][Symbol.iterator]())):tt,"%JSON%":typeof JSON=="object"?JSON:tt,"%Map%":typeof Map>"u"?tt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!br||!vt?tt:vt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?tt:Promise,"%Proxy%":typeof Proxy>"u"?tt:Proxy,"%RangeError%":cy,"%ReferenceError%":uy,"%Reflect%":typeof Reflect>"u"?tt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?tt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!br||!vt?tt:vt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?tt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":br&&vt?vt(""[Symbol.iterator]()):tt,"%Symbol%":br?Symbol:tt,"%SyntaxError%":Yr,"%ThrowTypeError%":fy,"%TypedArray%":my,"%TypeError%":Gr,"%Uint8Array%":typeof Uint8Array>"u"?tt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?tt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?tt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?tt:Uint32Array,"%URIError%":dy,"%WeakMap%":typeof WeakMap>"u"?tt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?tt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?tt:WeakSet};if(vt)try{null.error}catch(r){var gy=vt(vt(r));ur["%Error.prototype%"]=gy}var yy=function r(t){var e;if(t==="%AsyncFunction%")e=Ws("async function () {}");else if(t==="%GeneratorFunction%")e=Ws("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Ws("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=r("%AsyncGenerator%");n&&vt&&(e=vt(n.prototype))}return ur[t]=e,e},bl={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},zi=ah,es=ay,vy=zi.call(Function.call,Array.prototype.concat),_y=zi.call(Function.apply,Array.prototype.splice),wl=zi.call(Function.call,String.prototype.replace),rs=zi.call(Function.call,String.prototype.slice),xy=zi.call(Function.call,RegExp.prototype.exec),by=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,wy=/\\(\\)?/g,Ty=function(t){var e=rs(t,0,1),i=rs(t,-1);if(e==="%"&&i!=="%")throw new Yr("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Yr("invalid intrinsic syntax, expected opening `%`");var n=[];return wl(t,by,function(s,o,a,h){n[n.length]=a?wl(h,wy,"$1"):o||s}),n},Ay=function(t,e){var i=t,n;if(es(bl,i)&&(n=bl[i],i="%"+n[0]+"%"),es(ur,i)){var s=ur[i];if(s===Er&&(s=yy(i)),typeof s>"u"&&!e)throw new Gr("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new Yr("intrinsic "+t+" does not exist!")},ti=function(t,e){if(typeof t!="string"||t.length===0)throw new Gr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Gr('"allowMissing" argument must be a boolean');if(xy(/^%?[^%]*%?$/,t)===null)throw new Yr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=Ty(t),n=i.length>0?i[0]:"",s=Ay("%"+n+"%",e),o=s.name,a=s.value,h=!1,l=s.alias;l&&(n=l[0],_y(i,vy([0,1],l)));for(var c=1,u=!0;c=i.length){var m=cr(a,d);u=!!m,u&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[d]}else u=es(a,d),a=a[d];u&&!h&&(ur[o]=a)}}return a},Lu={exports:{}},Ys,Tl;function hh(){if(Tl)return Ys;Tl=1;var r=ti,t=r("%Object.defineProperty%",!0)||!1;if(t)try{t({},"a",{value:1})}catch{t=!1}return Ys=t,Ys}var Ey=ti,Mn=Ey("%Object.getOwnPropertyDescriptor%",!0);if(Mn)try{Mn([],"length")}catch{Mn=null}var Ou=Mn,Al=hh(),Sy=Du,wr=$i,El=Ou,Cy=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new wr("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new wr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new wr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new wr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new wr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new wr("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,h=!!El&&El(t,e);if(Al)Al(t,e,{configurable:o===null&&h?h.configurable:!o,enumerable:n===null&&h?h.enumerable:!n,value:i,writable:s===null&&h?h.writable:!s});else if(a||!n&&!s&&!o)t[e]=i;else throw new Sy("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Jo=hh(),Nu=function(){return!!Jo};Nu.hasArrayLengthDefineBug=function(){if(!Jo)return null;try{return Jo([],"length",{value:1}).length!==1}catch{return!0}};var Iy=Nu,Py=ti,Sl=Cy,Ry=Iy(),Cl=Ou,Il=$i,My=Py("%Math.floor%"),Fy=function(t,e){if(typeof t!="function")throw new Il("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||My(e)!==e)throw new Il("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&Cl){var o=Cl(t,"length");o&&!o.configurable&&(n=!1),o&&!o.writable&&(s=!1)}return(n||s||!i)&&(Ry?Sl(t,"length",e,!0,!0):Sl(t,"length",e)),t};(function(r){var t=ah,e=ti,i=Fy,n=$i,s=e("%Function.prototype.apply%"),o=e("%Function.prototype.call%"),a=e("%Reflect.apply%",!0)||t.call(o,s),h=hh(),l=e("%Math.max%");r.exports=function(d){if(typeof d!="function")throw new n("a function is required");var f=a(t,o,arguments);return i(f,1+l(0,d.length-(arguments.length-1)),!0)};var c=function(){return a(t,s,arguments)};h?h(r.exports,"apply",{value:c}):r.exports.apply=c})(Lu);var Dy=Lu.exports,ku=ti,Uu=Dy,By=Uu(ku("String.prototype.indexOf")),Ly=function(t,e){var i=ku(t,!!e);return typeof i=="function"&&By(t,".prototype.")>-1?Uu(i):i};const Oy={},Ny=Object.freeze(Object.defineProperty({__proto__:null,default:Oy},Symbol.toStringTag,{value:"Module"})),ky=x1(Ny);var lh=typeof Map=="function"&&Map.prototype,qs=Object.getOwnPropertyDescriptor&&lh?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,is=lh&&qs&&typeof qs.get=="function"?qs.get:null,Pl=lh&&Map.prototype.forEach,ch=typeof Set=="function"&&Set.prototype,Ks=Object.getOwnPropertyDescriptor&&ch?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,ns=ch&&Ks&&typeof Ks.get=="function"?Ks.get:null,Rl=ch&&Set.prototype.forEach,Uy=typeof WeakMap=="function"&&WeakMap.prototype,Si=Uy?WeakMap.prototype.has:null,Gy=typeof WeakSet=="function"&&WeakSet.prototype,Ci=Gy?WeakSet.prototype.has:null,Hy=typeof WeakRef=="function"&&WeakRef.prototype,Ml=Hy?WeakRef.prototype.deref:null,$y=Boolean.prototype.valueOf,zy=Object.prototype.toString,Vy=Function.prototype.toString,Xy=String.prototype.match,uh=String.prototype.slice,Oe=String.prototype.replace,Wy=String.prototype.toUpperCase,Fl=String.prototype.toLowerCase,Gu=RegExp.prototype.test,Dl=Array.prototype.concat,oe=Array.prototype.join,jy=Array.prototype.slice,Bl=Math.floor,ta=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Zs=Object.getOwnPropertySymbols,ea=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,qr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Tt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===qr||"symbol")?Symbol.toStringTag:null,Hu=Object.prototype.propertyIsEnumerable,Ll=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function Ol(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||Gu.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-Bl(-r):Bl(r);if(i!==r){var n=String(i),s=uh.call(t,n.length+1);return Oe.call(n,e,"$&_")+"."+Oe.call(Oe.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Oe.call(t,e,"$&_")}var ra=ky,Nl=ra.custom,kl=zu(Nl)?Nl:null,Yy=function r(t,e,i,n){var s=e||{};if(Fe(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Fe(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Fe(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Fe(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Fe(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Xu(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var h=String(t);return a?Ol(t,h):h}if(typeof t=="bigint"){var l=String(t)+"n";return a?Ol(t,l):l}var c=typeof s.depth>"u"?5:s.depth;if(typeof i>"u"&&(i=0),i>=c&&c>0&&typeof t=="object")return ia(t)?"[Array]":"[Object]";var u=dv(s,i);if(typeof n>"u")n=[];else if(Vu(n,t)>=0)return"[Circular]";function d(T,b,I){if(b&&(n=jy.call(n),n.push(b)),I){var E={depth:s.depth};return Fe(s,"quoteStyle")&&(E.quoteStyle=s.quoteStyle),r(T,E,i+1,n)}return r(T,s,i+1,n)}if(typeof t=="function"&&!Ul(t)){var f=iv(t),p=nn(t,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+oe.call(p,", ")+" }":"")}if(zu(t)){var m=qr?Oe.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):ea.call(t);return typeof t=="object"&&!qr?ci(m):m}if(lv(t)){for(var g="<"+Fl.call(String(t.nodeName)),y=t.attributes||[],_=0;_",g}if(ia(t)){if(t.length===0)return"[]";var v=nn(t,d);return u&&!uv(v)?"["+na(v,u)+"]":"[ "+oe.call(v,", ")+" ]"}if(Zy(t)){var x=nn(t,d);return!("cause"in Error.prototype)&&"cause"in t&&!Hu.call(t,"cause")?"{ ["+String(t)+"] "+oe.call(Dl.call("[cause]: "+d(t.cause),x),", ")+" }":x.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+oe.call(x,", ")+" }"}if(typeof t=="object"&&o){if(kl&&typeof t[kl]=="function"&&ra)return ra(t,{depth:c-i});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(nv(t)){var w=[];return Pl&&Pl.call(t,function(T,b){w.push(d(b,t,!0)+" => "+d(T,t))}),Gl("Map",is.call(t),w,u)}if(av(t)){var C=[];return Rl&&Rl.call(t,function(T){C.push(d(T,t))}),Gl("Set",ns.call(t),C,u)}if(sv(t))return Qs("WeakMap");if(hv(t))return Qs("WeakSet");if(ov(t))return Qs("WeakRef");if(Jy(t))return ci(d(Number(t)));if(ev(t))return ci(d(ta.call(t)));if(tv(t))return ci($y.call(t));if(Qy(t))return ci(d(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Ei<"u"&&t===Ei)return"{ [object globalThis] }";if(!Ky(t)&&!Ul(t)){var A=nn(t,d),S=Ll?Ll(t)===Object.prototype:t instanceof Object||t.constructor===Object,F=t instanceof Object?"":"null prototype",N=!S&&Tt&&Object(t)===t&&Tt in t?uh.call(We(t),8,-1):F?"Object":"",O=S||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",L=O+(N||F?"["+oe.call(Dl.call([],N||[],F||[]),": ")+"] ":"");return A.length===0?L+"{}":u?L+"{"+na(A,u)+"}":L+"{ "+oe.call(A,", ")+" }"}return String(t)};function $u(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}function qy(r){return Oe.call(String(r),/"/g,""")}function ia(r){return We(r)==="[object Array]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function Ky(r){return We(r)==="[object Date]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function Ul(r){return We(r)==="[object RegExp]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function Zy(r){return We(r)==="[object Error]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function Qy(r){return We(r)==="[object String]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function Jy(r){return We(r)==="[object Number]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function tv(r){return We(r)==="[object Boolean]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function zu(r){if(qr)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!ea)return!1;try{return ea.call(r),!0}catch{}return!1}function ev(r){if(!r||typeof r!="object"||!ta)return!1;try{return ta.call(r),!0}catch{}return!1}var rv=Object.prototype.hasOwnProperty||function(r){return r in this};function Fe(r,t){return rv.call(r,t)}function We(r){return zy.call(r)}function iv(r){if(r.name)return r.name;var t=Xy.call(Vy.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function Vu(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;et.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return Xu(uh.call(r,0,t.maxStringLength),t)+i}var n=Oe.call(Oe.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,cv);return $u(n,"single",t)}function cv(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+Wy.call(t.toString(16))}function ci(r){return"Object("+r+")"}function Qs(r){return r+" { ? }"}function Gl(r,t,e,i){var n=i?na(e,i):oe.call(e,", ");return r+" ("+t+") {"+n+"}"}function uv(r){for(var t=0;t=0)return!1;return!0}function dv(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=oe.call(Array(r.indent+1)," ");else return null;return{base:e,prev:oe.call(Array(t+1),e)}}function na(r,t){if(r.length===0)return"";var e=` +***************************************************************************** */var Qo=function(r,t){return Qo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var n in i)i.hasOwnProperty(n)&&(e[n]=i[n])},Qo(r,t)};function ch(r,t){function e(){this.constructor=r}Qo(r,t),r.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var Jo=function(){return Jo=Object.assign||function(r){for(var t,e=1,i=arguments.length;e0?t[r-1]:cl(n,s),o=re?e:r}function ea(r,t){var e=t[0];if(r>=t[t.length-1])return t.length-1;if(r<=e)return 0;for(var i=0,n=t.length-1;i<=n;){var s=Math.floor((i+n)/2),o=t[s];if(or))return s;n=s-1}}return Math.max(0,n)}var Wt=Math.pow(2,-42);function ul(r){var t=Math.pow(Math.abs(r),.3333333333333333);return r<0?-t:t}function Au(r,t,e){if(Math.abs(r)0?[(-t+Math.sqrt(i))/(2*r),(-t-Math.sqrt(i))/(2*r)]:[]}function E0(r,t,e,i){if(Math.abs(r)0)n=[(h=ul(-o/2-Math.sqrt(a)))-s/(3*h)];else{var h=2*Math.sqrt(-s/3),l=Math.acos(3*o/s/h)/3,c=2*Math.PI/3;n=[h*Math.cos(l),h*Math.cos(l-c),h*Math.cos(l-2*c)]}}for(var u=0;u3)){e=e||new Array(3);var i=r[0],n=r[1],s=r[2]||0,o=t[0],a=t[1],h=t[2]||0;return e[0]=n*h-s*a,e[1]=s*o-i*h,e[2]=i*a-n*o,e}}function Eu(r,t){for(var e=0,i=0;i2)throw Error("Only supported for 2d vectors");var e=t?Kn(r,t):r,i=-e[1];return e[1]=e[0],e[0]=i,e}function I0(r,t,e,i,n){if(n===void 0&&(n=0),n===0)return[0,1,2,3];var s=function(h,l){return Math.pow(Eu(h,l),.5*n)},o=s(t,r),a=s(e,t)+o;return[0,o,a,s(i,e)+a]}function P0(r,t,e,i,n){for(var s=Number.isFinite(n.tension)?n.tension:.5,o=Number.isFinite(n.alpha)?n.alpha:null,a=o>0?I0(r,t,e,i,o):null,h=new Array(r.length),l=0;l-Wt&&o<=1+Wt}).map(function(o){return Lt(o,0,1)})}function ra(r,t,e,i){i===void 0&&(i=null),i=i||new Array(e.length);for(var n=0;ndl)throw Error("Order for Gaussian Quadrature must be in the range of ".concat(5," and ").concat(dl,"."));return Cu[o-5]}(e),s._nSamples=i,s}return ch(t,r),t.prototype._invalidateCache=function(){r.prototype._invalidateCache.call(this),this._cache.arcLengths=null,this._cache.samples=null},Object.defineProperty(t.prototype,"arcLengths",{get:function(){return this._cache.arcLengths||(this._cache.arcLengths=this.computeArcLengths()),this._cache.arcLengths},enumerable:!1,configurable:!0}),t.prototype.getSamples=function(e){if(this.points){if(this._cache.samples||(this._cache.samples=new Map),!this._cache.samples.has(e)){for(var i=this._nSamples,n=[],s=[],o=this.getCoefficients(e),a=0;a.95&&(c=Lt(c,-1,1)),s.push(c)}var u=i-1,d=[],f=[],p=n[0],m=s[0],g=1/u;for(a=0;a=o[o.length-1])return 1;if(i<=0)return 0;var c=Math.max(0,ea(i,o)),u=c*n;if(o[c]===i)return u;var d=a[c],f=l[c],p=h[c],m=i-o[c];return((f*m+p)*m+d)*m+u},t.prototype.lengthAt=function(e){return e*this.arcLengths[this.arcLengths.length-1]},t.prototype.getT=function(e){var i=this.arcLengths,n=i.length,s=e*i[n-1],o=ea(s,i),a=o/(n-1);if(i[o]===s)return a;var h=s-i[o];return(o+this.inverse(o,h))/(n-1)},t.prototype.getU=function(e){if(e===0)return 0;if(e===1)return 1;var i=this.arcLengths,n=i.length-1,s=i[n],o=e*n,a=Math.floor(o),h=i[a];if(o===a)return h/s;var l=o-a;return(h+this.computeArcLength(a,0,l))/s},t}(Su),D0=function(){function r(t,e){e===void 0&&(e={});var i=this;this._cache=new Map;var n=(e=Jo({tension:.5,alpha:0,closed:!1},e)).arcDivisions?new M0(e.arcDivisions,function(){return i._invalidateCache()}):new F0(e.numericalApproximationOrder,e.numericalInverseSamples,function(){return i._invalidateCache()});n.alpha=e.alpha,n.tension=e.tension,n.closed=e.closed,n.points=t,this._lmargin=e.lmargin||1-n.tension,this._curveMapper=n}return r.prototype.getTimeFromPosition=function(t,e){return e===void 0&&(e=!1),this._curveMapper.getT(e?Lt(t,0,1):t)},r.prototype.getPositionFromTime=function(t,e){return e===void 0&&(e=!1),this._curveMapper.getU(e?Lt(t,0,1):t)},r.prototype.getPositionFromLength=function(t,e){e===void 0&&(e=!1);var i=e?Lt(t,0,this.length):t;return this._curveMapper.getU(i/this.length)},r.prototype.getLengthAt=function(t,e){return t===void 0&&(t=1),e===void 0&&(e=!1),this._curveMapper.lengthAt(e?Lt(t,0,1):t)},r.prototype.getTimeAtKnot=function(t){if(t<0||t>this.points.length-1)throw Error("Invalid index!");return t===0?0:this.closed||t!==this.points.length-1?t/(this.closed?this.points.length:this.points.length-1):1},r.prototype.getPositionAtKnot=function(t){return this.getPositionFromTime(this.getTimeAtKnot(t))},r.prototype.getPointAtTime=function(t,e){return(t=Lt(t,0,1))===0?Kn(this.points[0],e):t===1?Kn(this.closed?this.points[0]:this.points[this.points.length-1],e):this._curveMapper.evaluateForT(Dr,t,e)},r.prototype.getPointAt=function(t,e){return this.getPointAtTime(this.getTimeFromPosition(t),e)},r.prototype.getTangentAt=function(t,e){var i=Lt(this.getTimeFromPosition(t),0,1);return this.getTangentAtTime(i,e)},r.prototype.getTangentAtTime=function(t,e){return Je(this._curveMapper.evaluateForT(Br,t,e))},r.prototype.getNormalAt=function(t,e){var i=Lt(this.getTimeFromPosition(t),0,1);return this.getNormalAtTime(i,e)},r.prototype.getNormalAtTime=function(t,e){var i=Je(this._curveMapper.evaluateForT(Br,t));if(!(i.length<2||i.length>3)){var n=e||new Array(i.length);if(i.length===2)return n[0]=-i[1],n[1]=i[0],n;var s=Je(this._curveMapper.evaluateForT(Ws,t));return Je(Ji(Ji(i,s),i),n)}},r.prototype.getCurvatureAt=function(t){var e=Lt(this.getTimeFromPosition(t),0,1);return this.getCurvatureAtTime(e)},r.prototype.getCurvatureAtTime=function(t){var e=this._curveMapper.evaluateForT(Br,t),i=this._curveMapper.evaluateForT(Ws,t),n=Je(e,[]),s=0,o=void 0;if(e.length===2){if((u=Math.pow(e[0]*e[0]+e[1]*e[1],1.5))!==0){var a=(e[0]*i[1]-e[1]*i[0])/u;o=a<0?[n[1],-n[0]]:[-n[1],n[0]],s=Math.abs(a)}}else if(e.length===3){var h=Fr(e),l=Ji(e,i);o=Je(Ji(l,e)),h!==0&&(s=Fr(l)/Math.pow(h,3))}else{h=Fr(e);var c=Fr(i),u=Math.pow(h,3),d=S0(e,i);u!==0&&(s=Math.sqrt(Math.pow(h,2)*Math.pow(c,2)-Math.pow(d,2))/u)}return{curvature:s,radius:s!==0?1/s:0,tangent:n,direction:o}},r.prototype.getDerivativeAt=function(t,e){var i=Lt(this.getTimeFromPosition(t),0,1);return this._curveMapper.evaluateForT(Br,i,e)},r.prototype.getSecondDerivativeAt=function(t,e){var i=Lt(this.getTimeFromPosition(t),0,1);return this._curveMapper.evaluateForT(Ws,i,e)},r.prototype.getBoundingBox=function(t,e){if(t===void 0&&(t=0),e===void 0&&(e=1),t===0&&e===1&&this._cache.has("bbox"))return this._cache.get("bbox");for(var i=[],n=[],s=this.getTimeFromPosition(t),o=this.getTimeFromPosition(e),a=this.getPointAtTime(s),h=this.getPointAtTime(o),l=this.closed?this.points.length:this.points.length-1,c=Math.floor(l*s),u=Math.ceil(l*o),d=0;dn[v]&&(n[v]=_[v]);if(p.tension<1){var x=l*s-(y-1),w=l*o-(y-1),C=function(F){return F>-Wt&&F<=1+Wt&&(y-1!==c||F>x)&&(y!==u||Fn[F]&&(n[F]=L)})};for(v=0;v1||n=0&&d<=1){i.getPointAtTime(d,s);var f=Zn(t,s);if(fe;)c(l-u)||c(l+u)||(u/=2);return{u:a=this._curveMapper.getU(l),distance:o,point:s}},r.prototype.getIntersects=function(t,e,i,n){var s=this;e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=this._lmargin);var o=this.getIntersectsAsTime(t,e,i,n).map(function(a){return s.getPointAtTime(a)});return Math.abs(i)===1?o.length===1?o[0]:null:o},r.prototype.getIntersectsAsPositions=function(t,e,i,n){var s=this;return e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=this._lmargin),this.getIntersectsAsTime(t,e,i,n).map(function(o){return s.getPositionFromTime(o)})},r.prototype.getIntersectsAsTime=function(t,e,i,n){e===void 0&&(e=0),i===void 0&&(i=0),n===void 0&&(n=this._lmargin);for(var s=e,o=new Set,a=this.closed?this.points.length:this.points.length-1,h=0;h=p){var g=R0(t,f[s]);i<0?g.sort(function(v,x){return x-v}):i>=0&&g.sort(function(v,x){return v-x});for(var y=0;y1||i1)throw Error("Invalid position (u) for sample in forEach!");var f=s.getTimeFromPosition(u),p=t({u,t:f,i:d,prev:c});c={u,t:f,i:d,value:p}})},r.prototype.map=function(t,e,i,n){var s=this;i===void 0&&(i=0),n===void 0&&(n=1);var o=[];if(Number.isFinite(e)){if(e<=1)throw Error("Invalid arguments passed to map(). You must specify at least 2 samples.");for(var a=e,h=0;h1)throw Error("Invalid position (u) for sample in map()!");var f=s.getTimeFromPosition(u),p=t({u,t:f,i:d,prev:c});return c={u,t:f,i:d,value:p},p})},r.prototype.reduce=function(t,e,i,n,s){var o=this;n===void 0&&(n=0),s===void 0&&(s=1);var a=[];if(Number.isFinite(i)){if(i<=1)throw Error("Invalid arguments passed to map(). You must specify at least 2 samples.");for(var h=i,l=0;l1)throw Error("Invalid position (u) for sample in map()!");var p=o.getTimeFromPosition(d);return t({acc:u,u:d,t:p,i:f})},e)},r.prototype._invalidateCache=function(){return this._cache=new Map,this},r.prototype.reset=function(){this._curveMapper.reset()},Object.defineProperty(r.prototype,"points",{get:function(){return this._curveMapper.points},set:function(t){this._curveMapper.points=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"tension",{get:function(){return this._curveMapper.tension},set:function(t){this._curveMapper.tension=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"alpha",{get:function(){return this._curveMapper.alpha},set:function(t){this._curveMapper.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"closed",{get:function(){return this._curveMapper.closed},set:function(t){this._curveMapper.closed=t},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"length",{get:function(){return this._curveMapper.lengthAt(1)},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minX",{get:function(){return this.getBoundingBox().min[0]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxX",{get:function(){return this.getBoundingBox().max[0]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minY",{get:function(){return this.getBoundingBox().min[1]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxY",{get:function(){return this.getBoundingBox().max[1]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"minZ",{get:function(){return this.getBoundingBox().min[2]},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"maxZ",{get:function(){return this.getBoundingBox().max[2]},enumerable:!1,configurable:!0}),r}();(function(r){function t(e,i,n,s,o){return i===void 0&&(i=.5),n===void 0&&(n=300),s===void 0&&(s=!1),o===void 0&&(o=0),r.call(this,e.map(function(a){return[a[0],a[1]]}),{tension:i,alpha:o,arcDivisions:n,closed:s})||this}return ch(t,r),t.prototype.x=function(e,i,n){i===void 0&&(i=0),n===void 0&&(n=this._lmargin);var s=this.getIntersects(e,1,i,n);return Math.abs(i)===1?s[0]:s.map(function(o){return o[0]})},t.prototype.y=function(e,i,n){i===void 0&&(i=0),n===void 0&&(n=this._lmargin);var s=this.getIntersects(e,0,i,n);return Math.abs(i)===1?s[1]:s.map(function(o){return o[1]})},t.prototype.getNormalAt=function(e,i){return Je(C0(this.getTangentAt(e,i)))},t.prototype.getAngleAt=function(e){var i=this.getTangentAt(e);return Math.atan2(i[1],i[0])},t.prototype.getBoundingBox=function(e,i){e===void 0&&(e=0),i===void 0&&(i=1);var n=r.prototype.getBoundingBox.call(this,e,i);return{x1:n.min[0],x2:n.max[0],y1:n.min[1],y2:n.max[1],min:n.min,max:n.max}},t})(D0);var ia="http://www.w3.org/1999/xhtml";const fl={svg:"http://www.w3.org/2000/svg",xhtml:ia,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function ws(r){var t=r+="",e=t.indexOf(":");return e>=0&&(t=r.slice(0,e))!=="xmlns"&&(r=r.slice(e+1)),fl.hasOwnProperty(t)?{space:fl[t],local:r}:r}function B0(r){return function(){var t=this.ownerDocument,e=this.namespaceURI;return e===ia&&t.documentElement.namespaceURI===ia?t.createElement(r):t.createElementNS(e,r)}}function L0(r){return function(){return this.ownerDocument.createElementNS(r.space,r.local)}}function Iu(r){var t=ws(r);return(t.local?L0:B0)(t)}function O0(){}function uh(r){return r==null?O0:function(){return this.querySelector(r)}}function N0(r){typeof r!="function"&&(r=uh(r));for(var t=this._groups,e=t.length,i=new Array(e),n=0;n=v&&(v=_+1);!(w=g[v])&&++v=0;)(o=i[n])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function hm(r){r||(r=lm);function t(u,d){return u&&d?r(u.__data__,d.__data__):!u-!d}for(var e=this._groups,i=e.length,n=new Array(i),s=0;st?1:r>=t?0:NaN}function cm(){var r=arguments[0];return arguments[0]=this,r.apply(null,arguments),this}function um(){return Array.from(this)}function dm(){for(var r=this._groups,t=0,e=r.length;t1?this.each((t==null?Tm:typeof t=="function"?Em:Am)(r,t,e??"")):Xr(this.node(),r)}function Xr(r,t){return r.style.getPropertyValue(t)||Du(r).getComputedStyle(r,null).getPropertyValue(t)}function Cm(r){return function(){delete this[r]}}function Im(r,t){return function(){this[r]=t}}function Pm(r,t){return function(){var e=t.apply(this,arguments);e==null?delete this[r]:this[r]=e}}function Rm(r,t){return arguments.length>1?this.each((t==null?Cm:typeof t=="function"?Pm:Im)(r,t)):this.node()[r]}function Bu(r){return r.trim().split(/^|\s+/)}function dh(r){return r.classList||new Lu(r)}function Lu(r){this._node=r,this._names=Bu(r.getAttribute("class")||"")}Lu.prototype={add:function(r){var t=this._names.indexOf(r);t<0&&(this._names.push(r),this._node.setAttribute("class",this._names.join(" ")))},remove:function(r){var t=this._names.indexOf(r);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(r){return this._names.indexOf(r)>=0}};function Ou(r,t){for(var e=dh(r),i=-1,n=t.length;++i=0&&(e=t.slice(i+1),t=t.slice(0,i)),{type:t,name:e}})}function ng(r){return function(){var t=this.__on;if(t){for(var e=0,i=-1,n=t.length,s;e{}};function fh(){for(var r=0,t=arguments.length,e={},i;r=0&&(i=e.slice(n+1),e=e.slice(0,n)),e&&!t.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:i}})}In.prototype=fh.prototype={constructor:In,on:function(r,t){var e=this._,i=pg(r+"",e),n,s=-1,o=i.length;if(arguments.length<2){for(;++s0)for(var e=new Array(n),i=0,n,s;i=0&&r._call.call(void 0,t),r=r._next;--Wr}function ml(){fr=(ts=Fi.now())+Ts,Wr=pi=0;try{_g()}finally{Wr=0,bg(),fr=0}}function xg(){var r=Fi.now(),t=r-ts;t>Gu&&(Ts-=t,ts=r)}function bg(){for(var r,t=Jn,e,i=1/0;t;)t._call?(i>t._time&&(i=t._time),r=t,t=t._next):(e=t._next,t._next=null,t=r?r._next=e:Jn=e);mi=r,oa(i)}function oa(r){if(!Wr){pi&&(pi=clearTimeout(pi));var t=r-fr;t>24?(r<1/0&&(pi=setTimeout(ml,r-Fi.now()-Ts)),oi&&(oi=clearInterval(oi))):(oi||(ts=Fi.now(),oi=setInterval(xg,Gu)),Wr=1,Hu(ml))}}function gl(r,t,e){var i=new es;return t=t==null?0:+t,i.restart(n=>{i.stop(),r(n+t)},t,e),i}var wg=fh("start","end","cancel","interrupt"),Tg=[],zu=0,yl=1,aa=2,Pn=3,vl=4,ha=5,Rn=6;function As(r,t,e,i,n,s){var o=r.__transition;if(!o)r.__transition={};else if(e in o)return;Ag(r,e,{name:t,index:i,group:n,on:wg,tween:Tg,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:zu})}function mh(r,t){var e=qt(r,t);if(e.state>zu)throw new Error("too late; already scheduled");return e}function pe(r,t){var e=qt(r,t);if(e.state>Pn)throw new Error("too late; already running");return e}function qt(r,t){var e=r.__transition;if(!e||!(e=e[t]))throw new Error("transition not found");return e}function Ag(r,t,e){var i=r.__transition,n;i[t]=e,e.timer=$u(s,0,e.time);function s(l){e.state=yl,e.timer.restart(o,e.delay,e.time),e.delay<=l&&o(l-e.delay)}function o(l){var c,u,d,f;if(e.state!==yl)return h();for(c in i)if(f=i[c],f.name===e.name){if(f.state===Pn)return gl(o);f.state===vl?(f.state=Rn,f.timer.stop(),f.on.call("interrupt",r,r.__data__,f.index,f.group),delete i[c]):+caa&&i.state=0&&(t=t.slice(0,e)),!t||t==="start"})}function t1(r,t,e){var i,n,s=Jg(t)?mh:pe;return function(){var o=s(this,r),a=o.on;a!==i&&(n=(i=a).copy()).on(t,e),o.on=n}}function e1(r,t){var e=this._id;return arguments.length<2?qt(this.node(),e).on.on(r):this.each(t1(e,r,t))}function r1(r){return function(){var t=this.parentNode;for(var e in this.__transition)if(+e!==r)return;t&&t.removeChild(this)}}function i1(){return this.on("end.remove",r1(this._id))}function n1(r){var t=this._name,e=this._id;typeof r!="function"&&(r=uh(r));for(var i=this._groups,n=i.length,s=new Array(n),o=0;o()=>r;function P1(r,{sourceEvent:t,target:e,transform:i,dispatch:n}){Object.defineProperties(this,{type:{value:r,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:e,enumerable:!0,configurable:!0},transform:{value:i,enumerable:!0,configurable:!0},_:{value:n}})}function be(r,t,e){this.k=r,this.x=t,this.y=e}be.prototype={constructor:be,scale:function(r){return r===1?this:new be(this.k*r,this.x,this.y)},translate:function(r,t){return r===0&t===0?this:new be(this.k,this.x+this.k*r,this.y+this.k*t)},apply:function(r){return[r[0]*this.k+this.x,r[1]*this.k+this.y]},applyX:function(r){return r*this.k+this.x},applyY:function(r){return r*this.k+this.y},invert:function(r){return[(r[0]-this.x)/this.k,(r[1]-this.y)/this.k]},invertX:function(r){return(r-this.x)/this.k},invertY:function(r){return(r-this.y)/this.k},rescaleX:function(r){return r.copy().domain(r.range().map(this.invertX,this).map(r.invert,r))},rescaleY:function(r){return r.copy().domain(r.range().map(this.invertY,this).map(r.invert,r))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var yh=new be(1,0,0);be.prototype;function js(r){r.stopImmediatePropagation()}function ai(r){r.preventDefault(),r.stopImmediatePropagation()}function R1(r){return(!r.ctrlKey||r.type==="wheel")&&!r.button}function M1(){var r=this;return r instanceof SVGElement?(r=r.ownerSVGElement||r,r.hasAttribute("viewBox")?(r=r.viewBox.baseVal,[[r.x,r.y],[r.x+r.width,r.y+r.height]]):[[0,0],[r.width.baseVal.value,r.height.baseVal.value]]):[[0,0],[r.clientWidth,r.clientHeight]]}function _l(){return this.__zoom||yh}function F1(r){return-r.deltaY*(r.deltaMode===1?.05:r.deltaMode?1:.002)*(r.ctrlKey?10:1)}function D1(){return navigator.maxTouchPoints||"ontouchstart"in this}function B1(r,t,e){var i=r.invertX(t[0][0])-e[0][0],n=r.invertX(t[1][0])-e[1][0],s=r.invertY(t[0][1])-e[0][1],o=r.invertY(t[1][1])-e[1][1];return r.translate(n>i?(i+n)/2:Math.min(0,i)||Math.max(0,n),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function L1(){var r=R1,t=M1,e=B1,i=F1,n=D1,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,h=zp,l=fh("start","zoom","end"),c,u,d,f=500,p=150,m=0,g=10;function y(b){b.property("__zoom",_l).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",F).on("dblclick.zoom",N).filter(n).on("touchstart.zoom",O).on("touchmove.zoom",L).on("touchend.zoom touchcancel.zoom",T).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}y.transform=function(b,I,E,R){var D=b.selection?b.selection():b;D.property("__zoom",_l),b!==D?w(b,I,E,R):D.interrupt().each(function(){C(this,arguments).event(R).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},y.scaleBy=function(b,I,E,R){y.scaleTo(b,function(){var D=this.__zoom.k,G=typeof I=="function"?I.apply(this,arguments):I;return D*G},E,R)},y.scaleTo=function(b,I,E,R){y.transform(b,function(){var D=t.apply(this,arguments),G=this.__zoom,P=E==null?x(D):typeof E=="function"?E.apply(this,arguments):E,M=G.invert(P),W=typeof I=="function"?I.apply(this,arguments):I;return e(v(_(G,W),P,M),D,o)},E,R)},y.translateBy=function(b,I,E,R){y.transform(b,function(){return e(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof E=="function"?E.apply(this,arguments):E),t.apply(this,arguments),o)},null,R)},y.translateTo=function(b,I,E,R,D){y.transform(b,function(){var G=t.apply(this,arguments),P=this.__zoom,M=R==null?x(G):typeof R=="function"?R.apply(this,arguments):R;return e(yh.translate(M[0],M[1]).scale(P.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof E=="function"?-E.apply(this,arguments):-E),G,o)},R,D)};function _(b,I){return I=Math.max(s[0],Math.min(s[1],I)),I===b.k?b:new be(I,b.x,b.y)}function v(b,I,E){var R=I[0]-E[0]*b.k,D=I[1]-E[1]*b.k;return R===b.x&&D===b.y?b:new be(b.k,R,D)}function x(b){return[(+b[0][0]+ +b[1][0])/2,(+b[0][1]+ +b[1][1])/2]}function w(b,I,E,R){b.on("start.zoom",function(){C(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(R).end()}).tween("zoom",function(){var D=this,G=arguments,P=C(D,G).event(R),M=t.apply(D,G),W=E==null?x(M):typeof E=="function"?E.apply(D,G):E,Q=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),q=D.__zoom,et=typeof I=="function"?I.apply(D,G):I,rt=h(q.invert(W).concat(Q/q.k),et.invert(W).concat(Q/et.k));return function(it){if(it===1)it=et;else{var nt=rt(it),xt=Q/nt[2];it=new be(xt,W[0]-nt[0]*xt,W[1]-nt[1]*xt)}P.zoom(null,it)}})}function C(b,I,E){return!E&&b.__zooming||new A(b,I)}function A(b,I){this.that=b,this.args=I,this.active=0,this.sourceEvent=null,this.extent=t.apply(b,I),this.taps=0}A.prototype={event:function(b){return b&&(this.sourceEvent=b),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(b,I){return this.mouse&&b!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&b!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&b!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(b){var I=Be(this.that).datum();l.call(b,this.that,new P1(b,{sourceEvent:this.sourceEvent,target:y,type:b,transform:this.that.__zoom,dispatch:l}),I)}};function S(b,...I){if(!r.apply(this,arguments))return;var E=C(this,I).event(b),R=this.__zoom,D=Math.max(s[0],Math.min(s[1],R.k*Math.pow(2,i.apply(this,arguments)))),G=qe(b);if(E.wheel)(E.mouse[0][0]!==G[0]||E.mouse[0][1]!==G[1])&&(E.mouse[1]=R.invert(E.mouse[0]=G)),clearTimeout(E.wheel);else{if(R.k===D)return;E.mouse=[G,R.invert(G)],Mn(this),E.start()}ai(b),E.wheel=setTimeout(P,p),E.zoom("mouse",e(v(_(R,D),E.mouse[0],E.mouse[1]),E.extent,o));function P(){E.wheel=null,E.end()}}function F(b,...I){if(d||!r.apply(this,arguments))return;var E=b.currentTarget,R=C(this,I,!0).event(b),D=Be(b.view).on("mousemove.zoom",W,!0).on("mouseup.zoom",Q,!0),G=qe(b,E),P=b.clientX,M=b.clientY;gg(b.view),js(b),R.mouse=[G,this.__zoom.invert(G)],Mn(this),R.start();function W(q){if(ai(q),!R.moved){var et=q.clientX-P,rt=q.clientY-M;R.moved=et*et+rt*rt>m}R.event(q).zoom("mouse",e(v(R.that.__zoom,R.mouse[0]=qe(q,E),R.mouse[1]),R.extent,o))}function Q(q){D.on("mousemove.zoom mouseup.zoom",null),yg(q.view,R.moved),ai(q),R.event(q).end()}}function N(b,...I){if(r.apply(this,arguments)){var E=this.__zoom,R=qe(b.changedTouches?b.changedTouches[0]:b,this),D=E.invert(R),G=E.k*(b.shiftKey?.5:2),P=e(v(_(E,G),R,D),t.apply(this,I),o);ai(b),a>0?Be(this).transition().duration(a).call(w,P,R,b):Be(this).call(y.transform,P,R,b)}}function O(b,...I){if(r.apply(this,arguments)){var E=b.touches,R=E.length,D=C(this,I,b.changedTouches.length===R).event(b),G,P,M,W;for(js(b),P=0;P0?s.transform(o.transition().duration(n),p):s.transform(o,p)}setBounds(t,e){this.xBounds=t,this.yBounds=e,this.recalculateZoomTransform()}setTranslateBounds(t,e){this.translateBoundsX=t,this.translateBoundsY=e,this.updateTranslateExtent()}adjustToSize(t,e,i=!1){const{width:n,height:s,scaleX:o,scaleY:a,recalculateZoomTransform:h}=this;let l=0,c=0;if(typeof t=="number"&&typeof e=="number")c=e,l=t;else{const f=this.container.node();if(f){const{width:p,height:m}=f.getBoundingClientRect();l=p,c=m}}const u=Math.max(1,l),d=Math.max(1,c);!i&&n===u&&s===d||(o.range([0,u]),a.range([0,d]),h(),this.onRescale(this.currentStateAsEvent()))}calculateTransform(t,e,i){const{scaleX:n,xSpan:s,xBounds:o,yBounds:a,zFactor:h,viewportRatio:l,isXInverted:c,isYInverted:u}=this,[d,f]=n.range(),p=Math.abs(e-t),m=s/p,g=p/(f-d),y=i-(u?-p:p)/h/l/2,_=(o[0]-t)/(c?-g:g),v=(a[0]-y)/((u?-g:g)/h);return yh.translate(_,v).scale(m)}recalculateZoomTransform(){const{scaleX:t,scaleY:e,container:i,calculateTransform:n,updateTranslateExtent:s}=this,[o,a]=t.domain(),[h,l]=e.domain(),c=h+(l-h)/2,u=n(o,a,c);s(),this.zoom.transform(i,u)}setZoomLevelBoundary(t){return this.zoom.scaleExtent(t),this}setMaxZoomLevel(t){const e=this.zoom.scaleExtent();return this.zoom.scaleExtent([e[0],t]),this}setMinZoomLevel(t){const e=this.zoom.scaleExtent();return this.zoom.scaleExtent([t,e[1]]),this}}const k1={order:1,layerOpacity:1,interactive:!1};class ju{constructor(t,e){this._interactive=!1,this._id=t||`layer-${Math.floor(Math.random()*1e3)}`;const i=e||k1;this._order=i.order||1,this._options={...i},this.loading=!1,this._element=void 0,this._opacity=i.layerOpacity||1,this._visible=!0,this._interactive=i.interactive||!1,e&&e.data&&this.setData(e.data),this._referenceSystem=e==null?void 0:e.referenceSystem,this.onMount=this.onMount.bind(this),this.onUnmount=this.onUnmount.bind(this),this.onUpdate=this.onUpdate.bind(this),this.onRescale=this.onRescale.bind(this),this.onResize=this.onResize.bind(this),this.onOrderChanged=this.onOrderChanged.bind(this),this.onOpacityChanged=this.onOpacityChanged.bind(this),this.setVisibility=this.setVisibility.bind(this)}get id(){return this._id}get element(){return this._element}get options(){return this._options}set options(t){this._options=t}set isLoading(t){this.loading=t}get isLoading(){return this.loading}set opacity(t){this._opacity=t,this.onOpacityChanged(t)}get opacity(){return this._opacity}set order(t){this._order=t,this.onOrderChanged(t)}get order(){return this._order}set interactive(t){this._interactive=t,this.onInteractivityChanged(t)}get interactive(){return this._interactive}get referenceSystem(){return this._referenceSystem}set referenceSystem(t){this._referenceSystem=t}get data(){return this.getData()}set data(t){this.setData(t)}get isVisible(){return this._visible}getData(){return this._data}setData(t){this._data=t,this.element&&t!=null&&this.onUpdate({data:t})}clearData(t=!0){this._data=void 0,t&&(this.referenceSystem=void 0),this.onUpdate({})}setVisibility(t,e){this._visible=t}onMount(t){this._element=t.elm,this._options.onMount&&this._options.onMount(t,this)}onUnmount(t){this._options.onUnmount&&t!=null&&this._options.onUnmount(t,this)}onResize(t){this._options.onResize&&this._options.onResize(t,this)}onUpdate(t){t.data&&(this._data=t.data),this._options.onUpdate&&this._options.onUpdate(t,this)}onRescale(t){this.optionsRescale(t)}optionsRescale(t){this._options.onRescale&&this._options.onRescale(t,this)}getInternalLayerIds(){return[]}}const Yu=200,qu=300,QA=40,JA=30,U1=100,G1=.6,H1=.3,$1=8,z1=16,Ge=64,tE=1;class eE extends ju{onOpacityChanged(t){this.canvas&&this.updateStyle()}onOrderChanged(t){this.canvas&&this.updateStyle()}onInteractivityChanged(t){this.canvas&&this.updateStyle()}setVisibility(t){super.setVisibility(t),this.canvas&&this.updateStyle(t)}updateStyle(t){var s;const i=t||this.isVisible?"visible":"hidden",n=this.interactive?"auto":"none";(s=this.canvas)==null||s.setAttribute("style",`position:absolute;pointer-events:${n};z-index:${this.order};opacity:${this.opacity};visibility:${i}`)}onMount(t){super.onMount(t);const{elm:e}=t,i=t.width||parseInt((e==null?void 0:e.getAttribute("width"))??"",10)||Yu,n=t.height||parseInt((e==null?void 0:e.getAttribute("height"))??"",10)||qu;this.elm=e;let s;this.canvas||(s=document.createElement("canvas"),this.canvas=s,t.elm.appendChild(s)),this.canvas.setAttribute("id",`${this.id}`),this.canvas.setAttribute("width",`${i}px`),this.canvas.setAttribute("height",`${n}px`),this.canvas.setAttribute("class","canvas-layer"),this.updateStyle(),this.ctx=this.canvas.getContext("2d")??void 0}onUnmount(){var t;super.onUnmount(),(t=this.canvas)==null||t.remove(),this.canvas=void 0}onResize(t){const{ctx:e}=this,{width:i,height:n}=t;e==null||e.canvas.setAttribute("width",`${i}px`),e==null||e.canvas.setAttribute("height",`${n}px`)}onUpdate(t){super.onUpdate(t)}resetTransform(){var t;(t=this.ctx)==null||t.resetTransform()}setTransform(t){var n,s;this.resetTransform();const e=t.xBounds[0]>t.xBounds[1],i=t.yBounds[0]>t.yBounds[1];(n=this.ctx)==null||n.translate(t.xScale(0),t.yScale(0)),(s=this.ctx)==null||s.scale(t.xRatio*(e?-1:1),t.yRatio*(i?-1:1))}clearCanvas(){const{ctx:t,canvas:e}=this;t==null||t.save(),t==null||t.resetTransform(),t==null||t.clearRect(0,0,(e==null?void 0:e.width)??0,(e==null?void 0:e.height)??0),t==null||t.restore()}}var yr=(r=>(r[r.WEBGL_LEGACY=0]="WEBGL_LEGACY",r[r.WEBGL=1]="WEBGL",r[r.WEBGL2=2]="WEBGL2",r))(yr||{}),vh=(r=>(r[r.UNKNOWN=0]="UNKNOWN",r[r.WEBGL=1]="WEBGL",r[r.CANVAS=2]="CANVAS",r))(vh||{}),la=(r=>(r[r.COLOR=16384]="COLOR",r[r.DEPTH=256]="DEPTH",r[r.STENCIL=1024]="STENCIL",r))(la||{}),j=(r=>(r[r.NORMAL=0]="NORMAL",r[r.ADD=1]="ADD",r[r.MULTIPLY=2]="MULTIPLY",r[r.SCREEN=3]="SCREEN",r[r.OVERLAY=4]="OVERLAY",r[r.DARKEN=5]="DARKEN",r[r.LIGHTEN=6]="LIGHTEN",r[r.COLOR_DODGE=7]="COLOR_DODGE",r[r.COLOR_BURN=8]="COLOR_BURN",r[r.HARD_LIGHT=9]="HARD_LIGHT",r[r.SOFT_LIGHT=10]="SOFT_LIGHT",r[r.DIFFERENCE=11]="DIFFERENCE",r[r.EXCLUSION=12]="EXCLUSION",r[r.HUE=13]="HUE",r[r.SATURATION=14]="SATURATION",r[r.COLOR=15]="COLOR",r[r.LUMINOSITY=16]="LUMINOSITY",r[r.NORMAL_NPM=17]="NORMAL_NPM",r[r.ADD_NPM=18]="ADD_NPM",r[r.SCREEN_NPM=19]="SCREEN_NPM",r[r.NONE=20]="NONE",r[r.SRC_OVER=0]="SRC_OVER",r[r.SRC_IN=21]="SRC_IN",r[r.SRC_OUT=22]="SRC_OUT",r[r.SRC_ATOP=23]="SRC_ATOP",r[r.DST_OVER=24]="DST_OVER",r[r.DST_IN=25]="DST_IN",r[r.DST_OUT=26]="DST_OUT",r[r.DST_ATOP=27]="DST_ATOP",r[r.ERASE=26]="ERASE",r[r.SUBTRACT=28]="SUBTRACT",r[r.XOR=29]="XOR",r))(j||{}),ae=(r=>(r[r.POINTS=0]="POINTS",r[r.LINES=1]="LINES",r[r.LINE_LOOP=2]="LINE_LOOP",r[r.LINE_STRIP=3]="LINE_STRIP",r[r.TRIANGLES=4]="TRIANGLES",r[r.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",r[r.TRIANGLE_FAN=6]="TRIANGLE_FAN",r))(ae||{}),B=(r=>(r[r.RGBA=6408]="RGBA",r[r.RGB=6407]="RGB",r[r.RG=33319]="RG",r[r.RED=6403]="RED",r[r.RGBA_INTEGER=36249]="RGBA_INTEGER",r[r.RGB_INTEGER=36248]="RGB_INTEGER",r[r.RG_INTEGER=33320]="RG_INTEGER",r[r.RED_INTEGER=36244]="RED_INTEGER",r[r.ALPHA=6406]="ALPHA",r[r.LUMINANCE=6409]="LUMINANCE",r[r.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",r[r.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",r[r.DEPTH_STENCIL=34041]="DEPTH_STENCIL",r))(B||{}),kr=(r=>(r[r.TEXTURE_2D=3553]="TEXTURE_2D",r[r.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",r[r.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",r[r.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",r[r.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",r[r.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",r[r.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",r[r.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",r))(kr||{}),X=(r=>(r[r.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",r[r.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",r[r.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",r[r.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",r[r.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",r[r.UNSIGNED_INT=5125]="UNSIGNED_INT",r[r.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",r[r.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",r[r.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",r[r.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",r[r.BYTE=5120]="BYTE",r[r.SHORT=5122]="SHORT",r[r.INT=5124]="INT",r[r.FLOAT=5126]="FLOAT",r[r.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",r[r.HALF_FLOAT=36193]="HALF_FLOAT",r))(X||{}),H=(r=>(r[r.FLOAT=0]="FLOAT",r[r.INT=1]="INT",r[r.UINT=2]="UINT",r))(H||{}),he=(r=>(r[r.NEAREST=0]="NEAREST",r[r.LINEAR=1]="LINEAR",r))(he||{}),Ft=(r=>(r[r.CLAMP=33071]="CLAMP",r[r.REPEAT=10497]="REPEAT",r[r.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",r))(Ft||{}),de=(r=>(r[r.OFF=0]="OFF",r[r.POW2=1]="POW2",r[r.ON=2]="ON",r[r.ON_MANUAL=3]="ON_MANUAL",r))(de||{}),Ct=(r=>(r[r.NPM=0]="NPM",r[r.UNPACK=1]="UNPACK",r[r.PMA=2]="PMA",r[r.NO_PREMULTIPLIED_ALPHA=0]="NO_PREMULTIPLIED_ALPHA",r[r.PREMULTIPLY_ON_UPLOAD=1]="PREMULTIPLY_ON_UPLOAD",r[r.PREMULTIPLIED_ALPHA=2]="PREMULTIPLIED_ALPHA",r))(Ct||{}),se=(r=>(r[r.NO=0]="NO",r[r.YES=1]="YES",r[r.AUTO=2]="AUTO",r[r.BLEND=0]="BLEND",r[r.CLEAR=1]="CLEAR",r[r.BLIT=2]="BLIT",r))(se||{}),_h=(r=>(r[r.AUTO=0]="AUTO",r[r.MANUAL=1]="MANUAL",r))(_h||{}),Nt=(r=>(r.LOW="lowp",r.MEDIUM="mediump",r.HIGH="highp",r))(Nt||{}),yt=(r=>(r[r.NONE=0]="NONE",r[r.SCISSOR=1]="SCISSOR",r[r.STENCIL=2]="STENCIL",r[r.SPRITE=3]="SPRITE",r[r.COLOR=4]="COLOR",r))(yt||{}),pt=(r=>(r[r.NONE=0]="NONE",r[r.LOW=2]="LOW",r[r.MEDIUM=4]="MEDIUM",r[r.HIGH=8]="HIGH",r))(pt||{}),ce=(r=>(r[r.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",r[r.ARRAY_BUFFER=34962]="ARRAY_BUFFER",r[r.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",r))(ce||{});const V1={createCanvas:(r,t)=>{const e=document.createElement("canvas");return e.width=r,e.height=t,e},getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(r,t)=>fetch(r,t),parseXML:r=>new DOMParser().parseFromString(r,"text/xml")},$={ADAPTER:V1,RESOLUTION:1,CREATE_IMAGE_BITMAP:!1,ROUND_PIXELS:!1};var Ys=/iPhone/i,xl=/iPod/i,bl=/iPad/i,wl=/\biOS-universal(?:.+)Mac\b/i,qs=/\bAndroid(?:.+)Mobile\b/i,Tl=/Android/i,_r=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,en=/Silk/i,ye=/Windows Phone/i,Al=/\bWindows(?:.+)ARM\b/i,El=/BlackBerry/i,Sl=/BB10/i,Cl=/Opera Mini/i,Il=/\b(CriOS|Chrome)(?:.+)Mobile/i,Pl=/Mobile(?:.+)Firefox\b/i,Rl=function(r){return typeof r<"u"&&r.platform==="MacIntel"&&typeof r.maxTouchPoints=="number"&&r.maxTouchPoints>1&&typeof MSStream>"u"};function X1(r){return function(t){return t.test(r)}}function Ml(r){var t={userAgent:"",platform:"",maxTouchPoints:0};!r&&typeof navigator<"u"?t={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof r=="string"?t.userAgent=r:r&&r.userAgent&&(t={userAgent:r.userAgent,platform:r.platform,maxTouchPoints:r.maxTouchPoints||0});var e=t.userAgent,i=e.split("[FBAN");typeof i[1]<"u"&&(e=i[0]),i=e.split("Twitter"),typeof i[1]<"u"&&(e=i[0]);var n=X1(e),s={apple:{phone:n(Ys)&&!n(ye),ipod:n(xl),tablet:!n(Ys)&&(n(bl)||Rl(t))&&!n(ye),universal:n(wl),device:(n(Ys)||n(xl)||n(bl)||n(wl)||Rl(t))&&!n(ye)},amazon:{phone:n(_r),tablet:!n(_r)&&n(en),device:n(_r)||n(en)},android:{phone:!n(ye)&&n(_r)||!n(ye)&&n(qs),tablet:!n(ye)&&!n(_r)&&!n(qs)&&(n(en)||n(Tl)),device:!n(ye)&&(n(_r)||n(en)||n(qs)||n(Tl))||n(/\bokhttp\b/i)},windows:{phone:n(ye),tablet:n(Al),device:n(ye)||n(Al)},other:{blackberry:n(El),blackberry10:n(Sl),opera:n(Cl),firefox:n(Pl),chrome:n(Il),device:n(El)||n(Sl)||n(Cl)||n(Pl)||n(Il)},any:!1,phone:!1,tablet:!1};return s.any=s.apple.device||s.android.device||s.windows.device||s.other.device,s.phone=s.apple.phone||s.android.phone||s.windows.phone,s.tablet=s.apple.tablet||s.android.tablet||s.windows.tablet,s}const W1=Ml.default??Ml,we=W1(globalThis.navigator);$.RETINA_PREFIX=/@([0-9\.]+)x/;$.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT=!1;var Ti=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ku(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function j1(r){if(r.__esModule)return r;var t=r.default;if(typeof t=="function"){var e=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(e,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),e}var Zu={exports:{}};(function(r){var t=Object.prototype.hasOwnProperty,e="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(e=!1));function n(h,l,c){this.fn=h,this.context=l,this.once=c||!1}function s(h,l,c,u,d){if(typeof c!="function")throw new TypeError("The listener must be a function");var f=new n(c,u||h,d),p=e?e+l:l;return h._events[p]?h._events[p].fn?h._events[p]=[h._events[p],f]:h._events[p].push(f):(h._events[p]=f,h._eventsCount++),h}function o(h,l){--h._eventsCount===0?h._events=new i:delete h._events[l]}function a(){this._events=new i,this._eventsCount=0}a.prototype.eventNames=function(){var l=[],c,u;if(this._eventsCount===0)return l;for(u in c=this._events)t.call(c,u)&&l.push(e?u.slice(1):u);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(c)):l},a.prototype.listeners=function(l){var c=e?e+l:l,u=this._events[c];if(!u)return[];if(u.fn)return[u.fn];for(var d=0,f=u.length,p=new Array(f);d80*e){a=l=r[0],h=c=r[1];for(var p=e;pl&&(l=u),d>c&&(c=d);f=Math.max(l-a,c-h),f=f!==0?32767/f:0}return Di(s,o,e,a,h,f,0),o}function Qu(r,t,e,i,n){var s,o;if(n===da(r,t,e,i)>0)for(s=t;s=t;s-=i)o=Fl(s,r[s],r[s+1],o);return o&&Ss(o,o.next)&&(Li(o),o=o.next),o}function pr(r,t){if(!r)return r;t||(t=r);var e=r,i;do if(i=!1,!e.steiner&&(Ss(e,e.next)||lt(e.prev,e,e.next)===0)){if(Li(e),e=t=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==t);return t}function Di(r,t,e,i,n,s,o){if(r){!o&&s&&ny(r,i,n,s);for(var a=r,h,l;r.prev!==r.next;){if(h=r.prev,l=r.next,s?K1(r,i,n,s):q1(r)){t.push(h.i/e|0),t.push(r.i/e|0),t.push(l.i/e|0),Li(r),r=l.next,a=l.next;continue}if(r=l,r===a){o?o===1?(r=Z1(pr(r),t,e),Di(r,t,e,i,n,s,2)):o===2&&Q1(r,t,e,i,n,s):Di(pr(r),t,e,i,n,s,1);break}}}}function q1(r){var t=r.prev,e=r,i=r.next;if(lt(t,e,i)>=0)return!1;for(var n=t.x,s=e.x,o=i.x,a=t.y,h=e.y,l=i.y,c=ns?n>o?n:o:s>o?s:o,f=a>h?a>l?a:l:h>l?h:l,p=i.next;p!==t;){if(p.x>=c&&p.x<=d&&p.y>=u&&p.y<=f&&Lr(n,a,s,h,o,l,p.x,p.y)&<(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function K1(r,t,e,i){var n=r.prev,s=r,o=r.next;if(lt(n,s,o)>=0)return!1;for(var a=n.x,h=s.x,l=o.x,c=n.y,u=s.y,d=o.y,f=ah?a>l?a:l:h>l?h:l,g=c>u?c>d?c:d:u>d?u:d,y=ca(f,p,t,e,i),_=ca(m,g,t,e,i),v=r.prevZ,x=r.nextZ;v&&v.z>=y&&x&&x.z<=_;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==n&&v!==o&&Lr(a,c,h,u,l,d,v.x,v.y)&<(v.prev,v,v.next)>=0||(v=v.prevZ,x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==n&&x!==o&&Lr(a,c,h,u,l,d,x.x,x.y)&<(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;v&&v.z>=y;){if(v.x>=f&&v.x<=m&&v.y>=p&&v.y<=g&&v!==n&&v!==o&&Lr(a,c,h,u,l,d,v.x,v.y)&<(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;x&&x.z<=_;){if(x.x>=f&&x.x<=m&&x.y>=p&&x.y<=g&&x!==n&&x!==o&&Lr(a,c,h,u,l,d,x.x,x.y)&<(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function Z1(r,t,e){var i=r;do{var n=i.prev,s=i.next.next;!Ss(n,s)&&Ju(n,i,i.next,s)&&Bi(n,s)&&Bi(s,n)&&(t.push(n.i/e|0),t.push(i.i/e|0),t.push(s.i/e|0),Li(i),Li(i.next),i=r=s),i=i.next}while(i!==r);return pr(i)}function Q1(r,t,e,i,n,s){var o=r;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&ay(o,a)){var h=td(o,a);o=pr(o,o.next),h=pr(h,h.next),Di(o,t,e,i,n,s,0),Di(h,t,e,i,n,s,0);return}a=a.next}o=o.next}while(o!==r)}function J1(r,t,e,i){var n=[],s,o,a,h,l;for(s=0,o=t.length;s=e.next.y&&e.next.y!==e.y){var a=e.x+(n-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(a<=i&&a>s&&(s=a,o=e.x=e.x&&e.x>=l&&i!==e.x&&Lr(no.x||e.x===o.x&&iy(o,e)))&&(o=e,u=d)),e=e.next;while(e!==h);return o}function iy(r,t){return lt(r.prev,r,t.prev)<0&<(t.next,r,r.next)<0}function ny(r,t,e,i){var n=r;do n.z===0&&(n.z=ca(n.x,n.y,t,e,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next;while(n!==r);n.prevZ.nextZ=null,n.prevZ=null,sy(n)}function sy(r){var t,e,i,n,s,o,a,h,l=1;do{for(e=r,r=null,s=null,o=0;e;){for(o++,i=e,a=0,t=0;t0||h>0&&i;)a!==0&&(h===0||!i||e.z<=i.z)?(n=e,e=e.nextZ,a--):(n=i,i=i.nextZ,h--),s?s.nextZ=n:r=n,n.prevZ=s,s=n;e=i}s.nextZ=null,l*=2}while(o>1);return r}function ca(r,t,e,i,n){return r=(r-e)*n|0,t=(t-i)*n|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,r|t<<1}function oy(r){var t=r,e=r;do(t.x=(r-o)*(s-a)&&(r-o)*(i-a)>=(e-o)*(t-a)&&(e-o)*(s-a)>=(n-o)*(i-a)}function ay(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!hy(r,t)&&(Bi(r,t)&&Bi(t,r)&&ly(r,t)&&(lt(r.prev,r,t.prev)||lt(r,t.prev,t))||Ss(r,t)&<(r.prev,r,r.next)>0&<(t.prev,t,t.next)>0)}function lt(r,t,e){return(t.y-r.y)*(e.x-t.x)-(t.x-r.x)*(e.y-t.y)}function Ss(r,t){return r.x===t.x&&r.y===t.y}function Ju(r,t,e,i){var n=nn(lt(r,t,e)),s=nn(lt(r,t,i)),o=nn(lt(e,i,r)),a=nn(lt(e,i,t));return!!(n!==s&&o!==a||n===0&&rn(r,e,t)||s===0&&rn(r,i,t)||o===0&&rn(e,r,i)||a===0&&rn(e,t,i))}function rn(r,t,e){return t.x<=Math.max(r.x,e.x)&&t.x>=Math.min(r.x,e.x)&&t.y<=Math.max(r.y,e.y)&&t.y>=Math.min(r.y,e.y)}function nn(r){return r>0?1:r<0?-1:0}function hy(r,t){var e=r;do{if(e.i!==r.i&&e.next.i!==r.i&&e.i!==t.i&&e.next.i!==t.i&&Ju(e,e.next,r,t))return!0;e=e.next}while(e!==r);return!1}function Bi(r,t){return lt(r.prev,r,r.next)<0?lt(r,t,r.next)>=0&<(r,r.prev,t)>=0:lt(r,t,r.prev)<0||lt(r,r.next,t)<0}function ly(r,t){var e=r,i=!1,n=(r.x+t.x)/2,s=(r.y+t.y)/2;do e.y>s!=e.next.y>s&&e.next.y!==e.y&&n<(e.next.x-e.x)*(s-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==r);return i}function td(r,t){var e=new ua(r.i,r.x,r.y),i=new ua(t.i,t.x,t.y),n=r.next,s=t.prev;return r.next=t,t.prev=r,e.next=n,n.prev=e,i.next=e,e.prev=i,s.next=i,i.prev=s,i}function Fl(r,t,e,i){var n=new ua(r,t,e);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function Li(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function ua(r,t,e){this.i=r,this.x=t,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}Es.deviation=function(r,t,e,i){var n=t&&t.length,s=n?t[0]*e:r.length,o=Math.abs(da(r,0,s,e));if(n)for(var a=0,h=t.length;a0&&(i+=r[n-1].length,e.holes.push(i))}return e};var cy=xh.exports;const uy=Ku(cy);var rs={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */rs.exports;(function(r,t){(function(e){var i=t&&!t.nodeType&&t,n=r&&!r.nodeType&&r,s=typeof Ti=="object"&&Ti;(s.global===s||s.window===s||s.self===s)&&(e=s);var o,a=2147483647,h=36,l=1,c=26,u=38,d=700,f=72,p=128,m="-",g=/^xn--/,y=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=h-l,w=Math.floor,C=String.fromCharCode,A;function S(P){throw new RangeError(v[P])}function F(P,M){for(var W=P.length,Q=[];W--;)Q[W]=M(P[W]);return Q}function N(P,M){var W=P.split("@"),Q="";W.length>1&&(Q=W[0]+"@",P=W[1]),P=P.replace(_,".");var q=P.split("."),et=F(q,M).join(".");return Q+et}function O(P){for(var M=[],W=0,Q=P.length,q,et;W=55296&&q<=56319&&W65535&&(M-=65536,W+=C(M>>>10&1023|55296),M=56320|M&1023),W+=C(M),W}).join("")}function T(P){return P-48<10?P-22:P-65<26?P-65:P-97<26?P-97:h}function b(P,M){return P+22+75*(P<26)-((M!=0)<<5)}function I(P,M,W){var Q=0;for(P=W?w(P/d):P>>1,P+=w(P/M);P>x*c>>1;Q+=h)P=w(P/x);return w(Q+(x+1)*P/(P+u))}function E(P){var M=[],W=P.length,Q,q=0,et=p,rt=f,it,nt,xt,bt,ht,ft,mt,Zt,Qt;for(it=P.lastIndexOf(m),it<0&&(it=0),nt=0;nt=128&&S("not-basic"),M.push(P.charCodeAt(nt));for(xt=it>0?it+1:0;xt=W&&S("invalid-input"),mt=T(P.charCodeAt(xt++)),(mt>=h||mt>w((a-q)/ht))&&S("overflow"),q+=mt*ht,Zt=ft<=rt?l:ft>=rt+c?c:ft-rt,!(mtw(a/Qt)&&S("overflow"),ht*=Qt;Q=M.length+1,rt=I(q-bt,Q,bt==0),w(q/Q)>a-et&&S("overflow"),et+=w(q/Q),q%=Q,M.splice(q++,0,et)}return L(M)}function R(P){var M,W,Q,q,et,rt,it,nt,xt,bt,ht,ft=[],mt,Zt,Qt,ri;for(P=O(P),mt=P.length,M=p,W=0,et=f,rt=0;rt=M&&htw((a-W)/Zt)&&S("overflow"),W+=(it-M)*Zt,M=it,rt=0;rta&&S("overflow"),ht==M){for(nt=W,xt=h;bt=xt<=et?l:xt>=et+c?c:xt-et,!(nt"u"||!vt?tt:vt(Uint8Array),cr={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?tt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?tt:ArrayBuffer,"%ArrayIteratorPrototype%":xr&&vt?vt([][Symbol.iterator]()):tt,"%AsyncFromSyncIteratorPrototype%":tt,"%AsyncFunction%":Ar,"%AsyncGenerator%":Ar,"%AsyncGeneratorFunction%":Ar,"%AsyncIteratorPrototype%":Ar,"%Atomics%":typeof Atomics>"u"?tt:Atomics,"%BigInt%":typeof BigInt>"u"?tt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?tt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?tt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?tt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Vy,"%eval%":eval,"%EvalError%":Xy,"%Float32Array%":typeof Float32Array>"u"?tt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?tt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?tt:FinalizationRegistry,"%Function%":ad,"%GeneratorFunction%":Ar,"%Int8Array%":typeof Int8Array>"u"?tt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?tt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?tt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":xr&&vt?vt(vt([][Symbol.iterator]())):tt,"%JSON%":typeof JSON=="object"?JSON:tt,"%Map%":typeof Map>"u"?tt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!xr||!vt?tt:vt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":zy,"%Object.getOwnPropertyDescriptor%":Oi,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?tt:Promise,"%Proxy%":typeof Proxy>"u"?tt:Proxy,"%RangeError%":Wy,"%ReferenceError%":jy,"%Reflect%":typeof Reflect>"u"?tt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?tt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!xr||!vt?tt:vt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?tt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":xr&&vt?vt(""[Symbol.iterator]()):tt,"%Symbol%":xr?Symbol:tt,"%SyntaxError%":jr,"%ThrowTypeError%":iv,"%TypedArray%":ov,"%TypeError%":Ur,"%Uint8Array%":typeof Uint8Array>"u"?tt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?tt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?tt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?tt:Uint32Array,"%URIError%":Yy,"%WeakMap%":typeof WeakMap>"u"?tt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?tt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?tt:WeakSet,"%Function.prototype.call%":zi,"%Function.prototype.apply%":hd,"%Object.defineProperty%":rv,"%Object.getPrototypeOf%":nv,"%Math.abs%":qy,"%Math.floor%":Ky,"%Math.max%":Zy,"%Math.min%":Qy,"%Math.pow%":Jy,"%Math.round%":tv,"%Math.sign%":ev,"%Reflect.getPrototypeOf%":sv};if(vt)try{null.error}catch(r){var av=vt(vt(r));cr["%Error.prototype%"]=av}var hv=function r(t){var e;if(t==="%AsyncFunction%")e=ao("async function () {}");else if(t==="%GeneratorFunction%")e=ao("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=ao("async function* () {}");else if(t==="%AsyncGenerator%"){var i=r("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(t==="%AsyncIteratorPrototype%"){var n=r("%AsyncGenerator%");n&&vt&&(e=vt(n.prototype))}return cr[t]=e,e},Vl={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Vi=$i(),is=$y(),lv=Vi.call(zi,Array.prototype.concat),cv=Vi.call(hd,Array.prototype.splice),Xl=Vi.call(zi,String.prototype.replace),ns=Vi.call(zi,String.prototype.slice),uv=Vi.call(zi,RegExp.prototype.exec),dv=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fv=/\\(\\)?/g,pv=function(t){var e=ns(t,0,1),i=ns(t,-1);if(e==="%"&&i!=="%")throw new jr("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new jr("invalid intrinsic syntax, expected opening `%`");var n=[];return Xl(t,dv,function(s,o,a,h){n[n.length]=a?Xl(h,fv,"$1"):o||s}),n},mv=function(t,e){var i=t,n;if(is(Vl,i)&&(n=Vl[i],i="%"+n[0]+"%"),is(cr,i)){var s=cr[i];if(s===Ar&&(s=hv(i)),typeof s>"u"&&!e)throw new Ur("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:s}}throw new jr("intrinsic "+t+" does not exist!")},Th=function(t,e){if(typeof t!="string"||t.length===0)throw new Ur("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ur('"allowMissing" argument must be a boolean');if(uv(/^%?[^%]*%?$/,t)===null)throw new jr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=pv(t),n=i.length>0?i[0]:"",s=mv("%"+n+"%",e),o=s.name,a=s.value,h=!1,l=s.alias;l&&(n=l[0],cv(i,lv([0,1],l)));for(var c=1,u=!0;c=i.length){var m=Oi(a,d);u=!!m,u&&"get"in m&&!("originalValue"in m.get)?a=m.get:a=a[d]}else u=is(a,d),a=a[d];u&&!h&&(cr[o]=a)}}return a},ld={exports:{}},Wl=Is,gv=rd,br=Hi,jl=Cs,yv=function(t,e,i){if(!t||typeof t!="object"&&typeof t!="function")throw new br("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new br("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new br("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new br("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new br("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new br("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,h=!!jl&&jl(t,e);if(Wl)Wl(t,e,{configurable:o===null&&h?h.configurable:!o,enumerable:n===null&&h?h.enumerable:!n,value:i,writable:s===null&&h?h.writable:!s});else if(a||!n&&!s&&!o)t[e]=i;else throw new gv("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},fa=Is,cd=function(){return!!fa};cd.hasArrayLengthDefineBug=function(){if(!fa)return null;try{return fa([],"length",{value:1}).length!==1}catch{return!0}};var vv=cd,_v=Th,Yl=yv,xv=vv(),ql=Cs,Kl=Hi,bv=_v("%Math.floor%"),wv=function(t,e){if(typeof t!="function")throw new Kl("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||bv(e)!==e)throw new Kl("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,s=!0;if("length"in t&&ql){var o=ql(t,"length");o&&!o.configurable&&(n=!1),o&&!o.writable&&(s=!1)}return(n||s||!i)&&(xv?Yl(t,"length",e,!0,!0):Yl(t,"length",e)),t},Tv=$i(),Av=wh(),Ev=sd,Sv=function(){return Ev(Tv,Av,arguments)};(function(r){var t=wv,e=Is,i=od,n=Sv;r.exports=function(o){var a=i(arguments),h=o.length-(arguments.length-1);return t(a,1+(h>0?h:0),!0)},e?e(r.exports,"apply",{value:n}):r.exports.apply=n})(ld);var Cv=ld.exports,ud=Th,dd=Cv,Iv=dd(ud("String.prototype.indexOf")),Pv=function(t,e){var i=ud(t,!!e);return typeof i=="function"&&Iv(t,".prototype.")>-1?dd(i):i};const Rv={},Mv=Object.freeze(Object.defineProperty({__proto__:null,default:Rv},Symbol.toStringTag,{value:"Module"})),Fv=j1(Mv);var Ah=typeof Map=="function"&&Map.prototype,lo=Object.getOwnPropertyDescriptor&&Ah?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ss=Ah&&lo&&typeof lo.get=="function"?lo.get:null,Zl=Ah&&Map.prototype.forEach,Eh=typeof Set=="function"&&Set.prototype,co=Object.getOwnPropertyDescriptor&&Eh?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,os=Eh&&co&&typeof co.get=="function"?co.get:null,Ql=Eh&&Set.prototype.forEach,Dv=typeof WeakMap=="function"&&WeakMap.prototype,Ai=Dv?WeakMap.prototype.has:null,Bv=typeof WeakSet=="function"&&WeakSet.prototype,Ei=Bv?WeakSet.prototype.has:null,Lv=typeof WeakRef=="function"&&WeakRef.prototype,Jl=Lv?WeakRef.prototype.deref:null,Ov=Boolean.prototype.valueOf,Nv=Object.prototype.toString,kv=Function.prototype.toString,Uv=String.prototype.match,Sh=String.prototype.slice,Oe=String.prototype.replace,Gv=String.prototype.toUpperCase,tc=String.prototype.toLowerCase,fd=RegExp.prototype.test,ec=Array.prototype.concat,oe=Array.prototype.join,Hv=Array.prototype.slice,rc=Math.floor,pa=typeof BigInt=="function"?BigInt.prototype.valueOf:null,uo=Object.getOwnPropertySymbols,ma=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Yr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Tt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Yr||"symbol")?Symbol.toStringTag:null,pd=Object.prototype.propertyIsEnumerable,ic=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(r){return r.__proto__}:null);function nc(r,t){if(r===1/0||r===-1/0||r!==r||r&&r>-1e3&&r<1e3||fd.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof r=="number"){var i=r<0?-rc(-r):rc(r);if(i!==r){var n=String(i),s=Sh.call(t,n.length+1);return Oe.call(n,e,"$&_")+"."+Oe.call(Oe.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Oe.call(t,e,"$&_")}var ga=Fv,sc=ga.custom,oc=gd(sc)?sc:null,$v=function r(t,e,i,n){var s=e||{};if(Fe(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Fe(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=Fe(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Fe(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Fe(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return vd(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var h=String(t);return a?nc(t,h):h}if(typeof t=="bigint"){var l=String(t)+"n";return a?nc(t,l):l}var c=typeof s.depth>"u"?5:s.depth;if(typeof i>"u"&&(i=0),i>=c&&c>0&&typeof t=="object")return ya(t)?"[Array]":"[Object]";var u=o_(s,i);if(typeof n>"u")n=[];else if(yd(n,t)>=0)return"[Circular]";function d(T,b,I){if(b&&(n=Hv.call(n),n.push(b)),I){var E={depth:s.depth};return Fe(s,"quoteStyle")&&(E.quoteStyle=s.quoteStyle),r(T,E,i+1,n)}return r(T,s,i+1,n)}if(typeof t=="function"&&!ac(t)){var f=Zv(t),p=sn(t,d);return"[Function"+(f?": "+f:" (anonymous)")+"]"+(p.length>0?" { "+oe.call(p,", ")+" }":"")}if(gd(t)){var m=Yr?Oe.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):ma.call(t);return typeof t=="object"&&!Yr?hi(m):m}if(i_(t)){for(var g="<"+tc.call(String(t.nodeName)),y=t.attributes||[],_=0;_",g}if(ya(t)){if(t.length===0)return"[]";var v=sn(t,d);return u&&!s_(v)?"["+va(v,u)+"]":"[ "+oe.call(v,", ")+" ]"}if(Xv(t)){var x=sn(t,d);return!("cause"in Error.prototype)&&"cause"in t&&!pd.call(t,"cause")?"{ ["+String(t)+"] "+oe.call(ec.call("[cause]: "+d(t.cause),x),", ")+" }":x.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+oe.call(x,", ")+" }"}if(typeof t=="object"&&o){if(oc&&typeof t[oc]=="function"&&ga)return ga(t,{depth:c-i});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Qv(t)){var w=[];return Zl&&Zl.call(t,function(T,b){w.push(d(b,t,!0)+" => "+d(T,t))}),hc("Map",ss.call(t),w,u)}if(e_(t)){var C=[];return Ql&&Ql.call(t,function(T){C.push(d(T,t))}),hc("Set",os.call(t),C,u)}if(Jv(t))return fo("WeakMap");if(r_(t))return fo("WeakSet");if(t_(t))return fo("WeakRef");if(jv(t))return hi(d(Number(t)));if(qv(t))return hi(d(pa.call(t)));if(Yv(t))return hi(Ov.call(t));if(Wv(t))return hi(d(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Ti<"u"&&t===Ti)return"{ [object globalThis] }";if(!Vv(t)&&!ac(t)){var A=sn(t,d),S=ic?ic(t)===Object.prototype:t instanceof Object||t.constructor===Object,F=t instanceof Object?"":"null prototype",N=!S&&Tt&&Object(t)===t&&Tt in t?Sh.call(We(t),8,-1):F?"Object":"",O=S||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",L=O+(N||F?"["+oe.call(ec.call([],N||[],F||[]),": ")+"] ":"");return A.length===0?L+"{}":u?L+"{"+va(A,u)+"}":L+"{ "+oe.call(A,", ")+" }"}return String(t)};function md(r,t,e){var i=(e.quoteStyle||t)==="double"?'"':"'";return i+r+i}function zv(r){return Oe.call(String(r),/"/g,""")}function ya(r){return We(r)==="[object Array]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function Vv(r){return We(r)==="[object Date]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function ac(r){return We(r)==="[object RegExp]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function Xv(r){return We(r)==="[object Error]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function Wv(r){return We(r)==="[object String]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function jv(r){return We(r)==="[object Number]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function Yv(r){return We(r)==="[object Boolean]"&&(!Tt||!(typeof r=="object"&&Tt in r))}function gd(r){if(Yr)return r&&typeof r=="object"&&r instanceof Symbol;if(typeof r=="symbol")return!0;if(!r||typeof r!="object"||!ma)return!1;try{return ma.call(r),!0}catch{}return!1}function qv(r){if(!r||typeof r!="object"||!pa)return!1;try{return pa.call(r),!0}catch{}return!1}var Kv=Object.prototype.hasOwnProperty||function(r){return r in this};function Fe(r,t){return Kv.call(r,t)}function We(r){return Nv.call(r)}function Zv(r){if(r.name)return r.name;var t=Uv.call(kv.call(r),/^function\s*([\w$]+)/);return t?t[1]:null}function yd(r,t){if(r.indexOf)return r.indexOf(t);for(var e=0,i=r.length;et.maxStringLength){var e=r.length-t.maxStringLength,i="... "+e+" more character"+(e>1?"s":"");return vd(Sh.call(r,0,t.maxStringLength),t)+i}var n=Oe.call(Oe.call(r,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,n_);return md(n,"single",t)}function n_(r){var t=r.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+Gv.call(t.toString(16))}function hi(r){return"Object("+r+")"}function fo(r){return r+" { ? }"}function hc(r,t,e,i){var n=i?va(e,i):oe.call(e,", ");return r+" ("+t+") {"+n+"}"}function s_(r){for(var t=0;t=0)return!1;return!0}function o_(r,t){var e;if(r.indent===" ")e=" ";else if(typeof r.indent=="number"&&r.indent>0)e=oe.call(Array(r.indent+1)," ");else return null;return{base:e,prev:oe.call(Array(t+1),e)}}function va(r,t){if(r.length===0)return"";var e=` `+t.prev+t.base;return e+oe.call(r,","+e)+` -`+t.prev}function nn(r,t){var e=ia(r),i=[];if(e){i.length=r.length;for(var n=0;n1;){var e=t.pop(),i=e.obj[e.prop];if(or(i)){for(var n=[],s=0;s=eo?o.slice(h,h+eo):o,c=[],u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||s===Cv.RFC1738&&(d===40||d===41)){c[c.length]=l.charAt(u);continue}if(d<128){c[c.length]=Jt[d];continue}if(d<2048){c[c.length]=Jt[192|d>>6]+Jt[128|d&63];continue}if(d<55296||d>=57344){c[c.length]=Jt[224|d>>12]+Jt[128|d>>6&63]+Jt[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|l.charCodeAt(u)&1023),c[c.length]=Jt[240|d>>18]+Jt[128|d>>12&63]+Jt[128|d>>6&63]+Jt[128|d&63]}a+=c.join("")}return a},Dv=function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],n=0;n"u"&&(w=0)}if(typeof c=="function"?v=c(e,v):v instanceof Date?v=f(v):i==="comma"&&ne(v)&&(v=Fn.maybeMap(v,function(P){return P instanceof Date?f(P):P})),v===null){if(o)return l&&!g?l(e,gt.encoder,y,"key",p):e;v=""}if(Hv(v)||Fn.isBuffer(v)){if(l){var S=g?e:l(e,gt.encoder,y,"key",p);return[m(S)+"="+m(l(v,gt.encoder,y,"value",p))]}return[m(e)+"="+m(String(v))]}var F=[];if(typeof v>"u")return F;var N;if(i==="comma"&&ne(v))g&&l&&(v=Fn.maybeMap(v,l)),N=[{value:v.length>0?v.join(",")||null:void 0}];else if(ne(c))N=c;else{var O=Object.keys(v);N=u?O.sort(u):O}var L=h?e.replace(/\./g,"%2E"):e,T=n&&ne(v)&&v.length===1?L+"[]":L;if(s&&ne(v)&&v.length===0)return T+"[]";for(var b=0;b"u"?t.encodeDotInKeys===!0?!0:gt.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:gt.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:gt.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:gt.charsetSentinel,commaRoundTrip:t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?gt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:gt.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:gt.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:gt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:gt.encodeValuesOnly,filter:s,format:i,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:gt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:gt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:gt.strictNullHandling}},Vv=function(r,t){var e=r,i=zv(t),n,s;typeof i.filter=="function"?(s=i.filter,e=s("",e)):ne(i.filter)&&(s=i.filter,n=s);var o=[];if(typeof e!="object"||e===null)return"";var a=Ku[i.arrayFormat],h=a==="comma"&&i.commaRoundTrip;n||(n=Object.keys(e)),i.sort&&n.sort(i.sort);for(var l=qu(),c=0;c0?f+d:""},Kr=Yu,sa=Object.prototype.hasOwnProperty,Xv=Array.isArray,ut={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:Kr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},Wv=function(r){return r.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},Qu=function(r,t){return r&&typeof r=="string"&&t.comma&&r.indexOf(",")>-1?r.split(","):r},jv="utf8=%26%2310003%3B",Yv="utf8=%E2%9C%93",qv=function(t,e){var i={__proto__:null},n=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=e.parameterLimit===1/0?void 0:e.parameterLimit,o=n.split(e.delimiter,s),a=-1,h,l=e.charset;if(e.charsetSentinel)for(h=0;h-1&&(p=Xv(p)?[p]:p);var m=sa.call(i,f);m&&e.duplicates==="combine"?i[f]=Kr.combine(i[f],p):(!m||e.duplicates==="last")&&(i[f]=p)}return i},Kv=function(r,t,e,i){for(var n=i?t:Qu(t,e),s=r.length-1;s>=0;--s){var o,a=r[s];if(a==="[]"&&e.parseArrays)o=e.allowEmptyArrays&&(n===""||e.strictNullHandling&&n===null)?[]:[].concat(n);else{o=e.plainObjects?Object.create(null):{};var h=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=e.decodeDotInKeys?h.replace(/%2E/g,"."):h,c=parseInt(l,10);!e.parseArrays&&l===""?o={0:n}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&e.parseArrays&&c<=e.arrayLimit?(o=[],o[c]=n):l!=="__proto__"&&(o[l]=n)}n=o}return n},Zv=function(t,e,i,n){if(t){var s=i.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,h=i.depth>0&&o.exec(s),l=h?s.slice(0,h.index):s,c=[];if(l){if(!i.plainObjects&&sa.call(Object.prototype,l)&&!i.allowPrototypes)return;c.push(l)}for(var u=0;i.depth>0&&(h=a.exec(s))!==null&&u"u"?ut.charset:t.charset,i=typeof t.duplicates>"u"?ut.duplicates:t.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:ut.allowDots:!!t.allowDots;return{allowDots:n,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:ut.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:ut.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:ut.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:ut.arrayLimit,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:ut.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:ut.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:ut.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:ut.decoder,delimiter:typeof t.delimiter=="string"||Kr.isRegExp(t.delimiter)?t.delimiter:ut.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:ut.depth,duplicates:i,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:ut.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:ut.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:ut.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:ut.strictDepth,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:ut.strictNullHandling}},Jv=function(r,t){var e=Qv(t);if(r===""||r===null||typeof r>"u")return e.plainObjects?Object.create(null):{};for(var i=typeof r=="string"?qv(r,e):r,n=e.plainObjects?Object.create(null):{},s=Object.keys(i),o=0;o",'"',"`"," ","\r",` -`," "],l_=["{","}","|","\\","^","`"].concat(h_),oa=["'"].concat(l_),$l=["%","/","?",";","#"].concat(oa),zl=["/","?","#"],c_=255,Vl=/^[+a-z0-9A-Z_-]{0,63}$/,u_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d_={javascript:!0,"javascript:":!0},aa={javascript:!0,"javascript:":!0},Hr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ha=i_;function f_(r,t,e){if(r&&typeof r=="object"&&r instanceof Ee)return r;var i=new Ee;return i.parse(r,t,e),i}Ee.prototype.parse=function(r,t,e){if(typeof r!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof r);var i=r.indexOf("?"),n=i!==-1&&i127?w+="x":w+=x[C];if(!w.match(Vl)){var S=_.slice(0,f),F=_.slice(f+1),N=x.match(u_);N&&(S.push(N[1]),F.unshift(N[2])),F.length&&(a="/"+F.join(".")+a),this.hostname=S.join(".");break}}}this.hostname.length>c_?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=n_.toASCII(this.hostname));var O=this.port?":"+this.port:"",L=this.hostname||"";this.host=L+O,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!d_[c])for(var f=0,v=oa.length;f0?e.host.split("@"):!1;w&&(e.auth=w.shift(),e.hostname=w.shift(),e.host=e.hostname)}return e.search=r.search,e.query=r.query,(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e}if(!_.length)return e.pathname=null,e.search?e.path="/"+e.search:e.path=null,e.href=e.format(),e;for(var C=_.slice(-1)[0],A=(e.host||r.host||_.length>1)&&(C==="."||C==="..")||C==="",S=0,F=_.length;F>=0;F--)C=_[F],C==="."?_.splice(F,1):C===".."?(_.splice(F,1),S++):S&&(_.splice(F,1),S--);if(!g&&!y)for(;S--;S)_.unshift("..");g&&_[0]!==""&&(!_[0]||_[0].charAt(0)!=="/")&&_.unshift(""),A&&_.join("/").substr(-1)!=="/"&&_.push("");var N=_[0]===""||_[0]&&_[0].charAt(0)==="/";if(x){e.hostname=N?"":_.length?_.shift():"",e.host=e.hostname;var w=e.host&&e.host.indexOf("@")>0?e.host.split("@"):!1;w&&(e.auth=w.shift(),e.hostname=w.shift(),e.host=e.hostname)}return g=g||e.host&&_.length,g&&!N&&_.unshift(""),_.length>0?e.pathname=_.join("/"):(e.pathname=null,e.path=null),(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=r.auth||e.auth,e.slashes=e.slashes||r.slashes,e.href=e.format(),e};Ee.prototype.parseHost=function(){var r=this.host,t=o_.exec(r);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),r=r.substr(0,r.length-t.length)),r&&(this.hostname=r)};const Xl={};function J(r,t,e=3){if(Xl[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} +`+t.prev}function sn(r,t){var e=ya(r),i=[];if(e){i.length=r.length;for(var n=0;n1;){var e=t.pop(),i=e.obj[e.prop];if(or(i)){for(var n=[],s=0;s=go?o.slice(h,h+go):o,c=[],u=0;u=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||s===b_.RFC1738&&(d===40||d===41)){c[c.length]=l.charAt(u);continue}if(d<128){c[c.length]=Jt[d];continue}if(d<2048){c[c.length]=Jt[192|d>>6]+Jt[128|d&63];continue}if(d<55296||d>=57344){c[c.length]=Jt[224|d>>12]+Jt[128|d>>6&63]+Jt[128|d&63];continue}u+=1,d=65536+((d&1023)<<10|l.charCodeAt(u)&1023),c[c.length]=Jt[240|d>>18]+Jt[128|d>>12&63]+Jt[128|d>>6&63]+Jt[128|d&63]}a+=c.join("")}return a},C_=function(t){for(var e=[{obj:{o:t},prop:"o"}],i=[],n=0;n"u"&&(w=0)}if(typeof c=="function"?v=c(e,v):v instanceof Date?v=f(v):i==="comma"&&ne(v)&&(v=Bn.maybeMap(v,function(P){return P instanceof Date?f(P):P})),v===null){if(o)return l&&!g?l(e,gt.encoder,y,"key",p):e;v=""}if(L_(v)||Bn.isBuffer(v)){if(l){var S=g?e:l(e,gt.encoder,y,"key",p);return[m(S)+"="+m(l(v,gt.encoder,y,"value",p))]}return[m(e)+"="+m(String(v))]}var F=[];if(typeof v>"u")return F;var N;if(i==="comma"&&ne(v))g&&l&&(v=Bn.maybeMap(v,l)),N=[{value:v.length>0?v.join(",")||null:void 0}];else if(ne(c))N=c;else{var O=Object.keys(v);N=u?O.sort(u):O}var L=h?e.replace(/\./g,"%2E"):e,T=n&&ne(v)&&v.length===1?L+"[]":L;if(s&&ne(v)&&v.length===0)return T+"[]";for(var b=0;b"u"?t.encodeDotInKeys===!0?!0:gt.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:gt.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:gt.allowEmptyArrays,arrayFormat:o,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:gt.charsetSentinel,commaRoundTrip:t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?gt.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:gt.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:gt.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:gt.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:gt.encodeValuesOnly,filter:s,format:i,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:gt.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:gt.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:gt.strictNullHandling}},k_=function(r,t){var e=r,i=N_(t),n,s;typeof i.filter=="function"?(s=i.filter,e=s("",e)):ne(i.filter)&&(s=i.filter,n=s);var o=[];if(typeof e!="object"||e===null)return"";var a=Td[i.arrayFormat],h=a==="comma"&&i.commaRoundTrip;n||(n=Object.keys(e)),i.sort&&n.sort(i.sort);for(var l=wd(),c=0;c0?f+d:""},qr=bd,_a=Object.prototype.hasOwnProperty,U_=Array.isArray,ut={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:qr.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},G_=function(r){return r.replace(/&#(\d+);/g,function(t,e){return String.fromCharCode(parseInt(e,10))})},Ed=function(r,t){return r&&typeof r=="string"&&t.comma&&r.indexOf(",")>-1?r.split(","):r},H_="utf8=%26%2310003%3B",$_="utf8=%E2%9C%93",z_=function(t,e){var i={__proto__:null},n=e.ignoreQueryPrefix?t.replace(/^\?/,""):t;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var s=e.parameterLimit===1/0?void 0:e.parameterLimit,o=n.split(e.delimiter,s),a=-1,h,l=e.charset;if(e.charsetSentinel)for(h=0;h-1&&(p=U_(p)?[p]:p);var m=_a.call(i,f);m&&e.duplicates==="combine"?i[f]=qr.combine(i[f],p):(!m||e.duplicates==="last")&&(i[f]=p)}return i},V_=function(r,t,e,i){for(var n=i?t:Ed(t,e),s=r.length-1;s>=0;--s){var o,a=r[s];if(a==="[]"&&e.parseArrays)o=e.allowEmptyArrays&&(n===""||e.strictNullHandling&&n===null)?[]:[].concat(n);else{o=e.plainObjects?Object.create(null):{};var h=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=e.decodeDotInKeys?h.replace(/%2E/g,"."):h,c=parseInt(l,10);!e.parseArrays&&l===""?o={0:n}:!isNaN(c)&&a!==l&&String(c)===l&&c>=0&&e.parseArrays&&c<=e.arrayLimit?(o=[],o[c]=n):l!=="__proto__"&&(o[l]=n)}n=o}return n},X_=function(t,e,i,n){if(t){var s=i.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,h=i.depth>0&&o.exec(s),l=h?s.slice(0,h.index):s,c=[];if(l){if(!i.plainObjects&&_a.call(Object.prototype,l)&&!i.allowPrototypes)return;c.push(l)}for(var u=0;i.depth>0&&(h=a.exec(s))!==null&&u"u"?ut.charset:t.charset,i=typeof t.duplicates>"u"?ut.duplicates:t.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:ut.allowDots:!!t.allowDots;return{allowDots:n,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:ut.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:ut.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:ut.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:ut.arrayLimit,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:ut.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:ut.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:ut.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:ut.decoder,delimiter:typeof t.delimiter=="string"||qr.isRegExp(t.delimiter)?t.delimiter:ut.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:ut.depth,duplicates:i,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:ut.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:ut.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:ut.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:ut.strictDepth,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:ut.strictNullHandling}},j_=function(r,t){var e=W_(t);if(r===""||r===null||typeof r>"u")return e.plainObjects?Object.create(null):{};for(var i=typeof r=="string"?z_(r,e):r,n=e.plainObjects?Object.create(null):{},s=Object.keys(i),o=0;o",'"',"`"," ","\r",` +`," "],ix=["{","}","|","\\","^","`"].concat(rx),xa=["'"].concat(ix),cc=["%","/","?",";","#"].concat(xa),uc=["/","?","#"],nx=255,dc=/^[+a-z0-9A-Z_-]{0,63}$/,sx=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,ox={javascript:!0,"javascript:":!0},ba={javascript:!0,"javascript:":!0},Gr={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},wa=Z_;function ax(r,t,e){if(r&&typeof r=="object"&&r instanceof Ee)return r;var i=new Ee;return i.parse(r,t,e),i}Ee.prototype.parse=function(r,t,e){if(typeof r!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof r);var i=r.indexOf("?"),n=i!==-1&&i127?w+="x":w+=x[C];if(!w.match(dc)){var S=_.slice(0,f),F=_.slice(f+1),N=x.match(sx);N&&(S.push(N[1]),F.unshift(N[2])),F.length&&(a="/"+F.join(".")+a),this.hostname=S.join(".");break}}}this.hostname.length>nx?this.hostname="":this.hostname=this.hostname.toLowerCase(),y||(this.hostname=Q_.toASCII(this.hostname));var O=this.port?":"+this.port:"",L=this.hostname||"";this.host=L+O,this.href+=this.host,y&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!ox[c])for(var f=0,v=xa.length;f0?e.host.split("@"):!1;w&&(e.auth=w.shift(),e.hostname=w.shift(),e.host=e.hostname)}return e.search=r.search,e.query=r.query,(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.href=e.format(),e}if(!_.length)return e.pathname=null,e.search?e.path="/"+e.search:e.path=null,e.href=e.format(),e;for(var C=_.slice(-1)[0],A=(e.host||r.host||_.length>1)&&(C==="."||C==="..")||C==="",S=0,F=_.length;F>=0;F--)C=_[F],C==="."?_.splice(F,1):C===".."?(_.splice(F,1),S++):S&&(_.splice(F,1),S--);if(!g&&!y)for(;S--;S)_.unshift("..");g&&_[0]!==""&&(!_[0]||_[0].charAt(0)!=="/")&&_.unshift(""),A&&_.join("/").substr(-1)!=="/"&&_.push("");var N=_[0]===""||_[0]&&_[0].charAt(0)==="/";if(x){e.hostname=N?"":_.length?_.shift():"",e.host=e.hostname;var w=e.host&&e.host.indexOf("@")>0?e.host.split("@"):!1;w&&(e.auth=w.shift(),e.hostname=w.shift(),e.host=e.hostname)}return g=g||e.host&&_.length,g&&!N&&_.unshift(""),_.length>0?e.pathname=_.join("/"):(e.pathname=null,e.path=null),(e.pathname!==null||e.search!==null)&&(e.path=(e.pathname?e.pathname:"")+(e.search?e.search:"")),e.auth=r.auth||e.auth,e.slashes=e.slashes||r.slashes,e.href=e.format(),e};Ee.prototype.parseHost=function(){var r=this.host,t=tx.exec(r);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),r=r.substr(0,r.length-t.length)),r&&(this.hostname=r)};const fc={};function J(r,t,e=3){if(fc[t])return;let i=new Error().stack;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",`${t} Deprecated since v${r}`):(i=i.split(` `).splice(e).join(` `),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${t} Deprecated since v${r}`),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${t} -Deprecated since v${r}`),console.warn(i))),Xl[t]=!0}function Ut(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function ui(r){return r.split("?")[0].split("#")[0]}function p_(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function m_(r,t,e){return r.replace(new RegExp(p_(t),"g"),e)}function g_(r,t){let e="",i=0,n=-1,s=0,o=-1;for(let a=0;a<=r.length;++a){if(a2){const h=e.lastIndexOf("/");if(h!==e.length-1){h===-1?(e="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),n=a,s=0;continue}}else if(e.length===2||e.length===1){e="",i=0,n=a,s=0;continue}}t&&(e.length>0?e+="/..":e="..",i=2)}else e.length>0?e+=`/${r.slice(n+1,a)}`:e=r.slice(n+1,a),i=a-n-1;n=a,s=0}else o===46&&s!==-1?++s:s=-1}return e}const Et={toPosix(r){return m_(r,"\\","/")},isUrl(r){return/^https?:/.test(this.toPosix(r))},isDataUrl(r){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},isBlobUrl(r){return r.startsWith("blob:")},hasProtocol(r){return/^[^/:]+:/.test(this.toPosix(r))},getProtocol(r){Ut(r),r=this.toPosix(r);const t=/^file:\/\/\//.exec(r);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(r);return e?e[0]:""},toAbsolute(r,t,e){if(Ut(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;const i=ui(this.toPosix(t??$.ADAPTER.getBaseUrl())),n=ui(this.toPosix(e??this.rootname(i)));return r=this.toPosix(r),r.startsWith("/")?Et.join(n,r.slice(1)):this.isAbsolute(r)?r:this.join(i,r)},normalize(r){if(Ut(r),r.length===0)return".";if(this.isDataUrl(r)||this.isBlobUrl(r))return r;r=this.toPosix(r);let t="";const e=r.startsWith("/");this.hasProtocol(r)&&(t=this.rootname(r),r=r.slice(t.length));const i=r.endsWith("/");return r=g_(r,!1),r.length>0&&i&&(r+="/"),e?`/${r}`:t+r},isAbsolute(r){return Ut(r),r=this.toPosix(r),this.hasProtocol(r)?!0:r.startsWith("/")},join(...r){if(r.length===0)return".";let t;for(let e=0;e0)if(t===void 0)t=i;else{const n=r[e-1]??"";this.extname(n)?t+=`/../${i}`:t+=`/${i}`}}return t===void 0?".":this.normalize(t)},dirname(r){if(Ut(r),r.length===0)return".";r=this.toPosix(r);let t=r.charCodeAt(0);const e=t===47;let i=-1,n=!0;const s=this.getProtocol(r),o=r;r=r.slice(s.length);for(let a=r.length-1;a>=1;--a)if(t=r.charCodeAt(a),t===47){if(!n){i=a;break}}else n=!1;return i===-1?e?"/":this.isUrl(o)?s+r:s:e&&i===1?"//":s+r.slice(0,i)},rootname(r){Ut(r),r=this.toPosix(r);let t="";if(r.startsWith("/")?t="/":t=this.getProtocol(r),this.isUrl(r)){const e=r.indexOf("/",t.length);e!==-1?t=r.slice(0,e):t=r,t.endsWith("/")||(t+="/")}return t},basename(r,t){Ut(r),t&&Ut(t),r=ui(this.toPosix(r));let e=0,i=-1,n=!0,s;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";let o=t.length-1,a=-1;for(s=r.length-1;s>=0;--s){const h=r.charCodeAt(s);if(h===47){if(!n){e=s+1;break}}else a===-1&&(n=!1,a=s+1),o>=0&&(h===t.charCodeAt(o)?--o===-1&&(i=s):(o=-1,i=a))}return e===i?i=a:i===-1&&(i=r.length),r.slice(e,i)}for(s=r.length-1;s>=0;--s)if(r.charCodeAt(s)===47){if(!n){e=s+1;break}}else i===-1&&(n=!1,i=s+1);return i===-1?"":r.slice(e,i)},extname(r){Ut(r),r=ui(this.toPosix(r));let t=-1,e=0,i=-1,n=!0,s=0;for(let o=r.length-1;o>=0;--o){const a=r.charCodeAt(o);if(a===47){if(!n){e=o+1;break}continue}i===-1&&(n=!1,i=o+1),a===46?t===-1?t=o:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||i===-1||s===0||s===1&&t===i-1&&t===e+1?"":r.slice(t,i)},parse(r){Ut(r);const t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;r=ui(this.toPosix(r));let e=r.charCodeAt(0);const i=this.isAbsolute(r);let n;t.root=this.rootname(r),i||this.hasProtocol(r)?n=1:n=0;let s=-1,o=0,a=-1,h=!0,l=r.length-1,c=0;for(;l>=n;--l){if(e=r.charCodeAt(l),e===47){if(!h){o=l+1;break}continue}a===-1&&(h=!1,a=l+1),e===46?s===-1?s=l:c!==1&&(c=1):s!==-1&&(c=-1)}return s===-1||a===-1||c===0||c===1&&s===a-1&&s===o+1?a!==-1&&(o===0&&i?t.base=t.name=r.slice(1,a):t.base=t.name=r.slice(o,a)):(o===0&&i?(t.name=r.slice(1,s),t.base=r.slice(1,a)):(t.name=r.slice(o,s),t.base=r.slice(o,a)),t.ext=r.slice(s,a)),t.dir=this.dirname(r),t},sep:"/",delimiter:":"};let io;async function y_(){return io??(io=(async()=>{var s;const r=document.createElement("canvas").getContext("webgl");if(!r)return Ct.UNPACK;const t=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!t)return Ct.UNPACK;const e=r.createTexture();r.bindTexture(r.TEXTURE_2D,e);const i=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,i),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t);const n=new Uint8Array(4);return r.readPixels(0,0,1,1,r.RGBA,r.UNSIGNED_BYTE,n),r.deleteFramebuffer(i),r.deleteTexture(e),(s=r.getExtension("WEBGL_lose_context"))==null||s.loseContext(),n[0]<=n[3]?Ct.PMA:Ct.UNPACK})()),io}let no;function v_(){return typeof no>"u"&&(no=function(){var t;const r={stencil:!0,failIfMajorPerformanceCaveat:$.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!$.ADAPTER.getWebGLRenderingContext())return!1;const e=$.ADAPTER.createCanvas();let i=e.getContext("webgl",r)||e.getContext("experimental-webgl",r);const n=!!((t=i==null?void 0:i.getContextAttributes())!=null&&t.stencil);if(i){const s=i.getExtension("WEBGL_lose_context");s&&s.loseContext()}return i=null,n}catch{return!1}}()),no}var __={grad:.9,turn:360,rad:360/(2*Math.PI)},ve=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},_t=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*r)/e+0},kt=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),r>e?e:r>t?r:t},Ju=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},Wl=function(r){return{r:kt(r.r,0,255),g:kt(r.g,0,255),b:kt(r.b,0,255),a:kt(r.a)}},so=function(r){return{r:_t(r.r),g:_t(r.g),b:_t(r.b),a:_t(r.a,3)}},x_=/^#([0-9a-f]{3,8})$/i,an=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},td=function(r){var t=r.r,e=r.g,i=r.b,n=r.a,s=Math.max(t,e,i),o=s-Math.min(t,e,i),a=o?s===t?(e-i)/o:s===e?2+(i-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:n}},ed=function(r){var t=r.h,e=r.s,i=r.v,n=r.a;t=t/360*6,e/=100,i/=100;var s=Math.floor(t),o=i*(1-e),a=i*(1-(t-s)*e),h=i*(1-(1-t+s)*e),l=s%6;return{r:255*[i,a,o,o,h,i][l],g:255*[h,i,i,a,o,o][l],b:255*[o,o,h,i,i,a][l],a:n}},jl=function(r){return{h:Ju(r.h),s:kt(r.s,0,100),l:kt(r.l,0,100),a:kt(r.a)}},Yl=function(r){return{h:_t(r.h),s:_t(r.s),l:_t(r.l),a:_t(r.a,3)}},ql=function(r){return ed((e=(t=r).s,{h:t.h,s:(e*=((i=t.l)<50?i:100-i)/100)>0?2*e/(i+e)*100:0,v:i+e,a:t.a}));var t,e,i},Pi=function(r){return{h:(t=td(r)).h,s:(n=(200-(e=t.s))*(i=t.v)/100)>0&&n<200?e*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:t.a};var t,e,i,n},b_=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,w_=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,T_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,A_=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,la={string:[[function(r){var t=x_.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?_t(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?_t(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=T_.exec(r)||A_.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:Wl({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(r){var t=b_.exec(r)||w_.exec(r);if(!t)return null;var e,i,n=jl({h:(e=t[1],i=t[2],i===void 0&&(i="deg"),Number(e)*(__[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return ql(n)},"hsl"]],object:[[function(r){var t=r.r,e=r.g,i=r.b,n=r.a,s=n===void 0?1:n;return ve(t)&&ve(e)&&ve(i)?Wl({r:Number(t),g:Number(e),b:Number(i),a:Number(s)}):null},"rgb"],[function(r){var t=r.h,e=r.s,i=r.l,n=r.a,s=n===void 0?1:n;if(!ve(t)||!ve(e)||!ve(i))return null;var o=jl({h:Number(t),s:Number(e),l:Number(i),a:Number(s)});return ql(o)},"hsl"],[function(r){var t=r.h,e=r.s,i=r.v,n=r.a,s=n===void 0?1:n;if(!ve(t)||!ve(e)||!ve(i))return null;var o=function(a){return{h:Ju(a.h),s:kt(a.s,0,100),v:kt(a.v,0,100),a:kt(a.a)}}({h:Number(t),s:Number(e),v:Number(i),a:Number(s)});return ed(o)},"hsv"]]},Kl=function(r,t){for(var e=0;e=.5},r.prototype.toHex=function(){return t=so(this.rgba),e=t.r,i=t.g,n=t.b,o=(s=t.a)<1?an(_t(255*s)):"","#"+an(e)+an(i)+an(n)+o;var t,e,i,n,s,o},r.prototype.toRgb=function(){return so(this.rgba)},r.prototype.toRgbString=function(){return t=so(this.rgba),e=t.r,i=t.g,n=t.b,(s=t.a)<1?"rgba("+e+", "+i+", "+n+", "+s+")":"rgb("+e+", "+i+", "+n+")";var t,e,i,n,s},r.prototype.toHsl=function(){return Yl(Pi(this.rgba))},r.prototype.toHslString=function(){return t=Yl(Pi(this.rgba)),e=t.h,i=t.s,n=t.l,(s=t.a)<1?"hsla("+e+", "+i+"%, "+n+"%, "+s+")":"hsl("+e+", "+i+"%, "+n+"%)";var t,e,i,n,s},r.prototype.toHsv=function(){return t=td(this.rgba),{h:_t(t.h),s:_t(t.s),v:_t(t.v),a:_t(t.a,3)};var t},r.prototype.invert=function(){return te({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},r.prototype.saturate=function(t){return t===void 0&&(t=.1),te(oo(this.rgba,t))},r.prototype.desaturate=function(t){return t===void 0&&(t=.1),te(oo(this.rgba,-t))},r.prototype.grayscale=function(){return te(oo(this.rgba,-1))},r.prototype.lighten=function(t){return t===void 0&&(t=.1),te(Zl(this.rgba,t))},r.prototype.darken=function(t){return t===void 0&&(t=.1),te(Zl(this.rgba,-t))},r.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},r.prototype.alpha=function(t){return typeof t=="number"?te({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):_t(this.rgba.a,3);var e},r.prototype.hue=function(t){var e=Pi(this.rgba);return typeof t=="number"?te({h:t,s:e.s,l:e.l,a:e.a}):_t(e.h)},r.prototype.isEqual=function(t){return this.toHex()===te(t).toHex()},r}(),te=function(r){return r instanceof ca?r:new ca(r)},Ql=[],S_=function(r){r.forEach(function(t){Ql.indexOf(t)<0&&(t(ca,la),Ql.push(t))})};function C_(r,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var n in e)i[e[n]]=n;var s={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,h,l=i[this.toHex()];if(l)return l;if(o!=null&&o.closest){var c=this.toRgb(),u=1/0,d="black";if(!s.length)for(var f in e)s[f]=new r(e[f]).toRgb();for(var p in e){var m=(a=c,h=s[p],Math.pow(a.r-h.r,2)+Math.pow(a.g-h.g,2)+Math.pow(a.b-h.b,2));mn===e[s]);if(t!==null&&e!==null){const n=Object.keys(t),s=Object.keys(e);return n.length!==s.length?!1:n.every(o=>t[o]===e[o])}return t===e}toRgba(){const[t,e,i,n]=this._components;return{r:t,g:e,b:i,a:n}}toRgb(){const[t,e,i]=this._components;return{r:t,g:e,b:i}}toRgbaString(){const[t,e,i]=this.toUint8RgbArray();return`rgba(${t},${e},${i},${this.alpha})`}toUint8RgbArray(t){const[e,i,n]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(i*255),t[2]=Math.round(n*255),t}toRgbArray(t){t=t??[];const[e,i,n]=this._components;return t[0]=e,t[1]=i,t[2]=n,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,i,n,s]=Dn.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=i,this._components[2]*=n,this._components[3]*=s,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let i=this._int>>16&255,n=this._int>>8&255,s=this._int&255;return e&&(i=i*t+.5|0,n=n*t+.5|0,s=s*t+.5|0),(t*255<<24)+(i<<16)+(n<<8)+s}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,i,n]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(i*t)/t,this._components[2]=Math.round(n*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,i,n,s]=this._components;return t[0]=e,t[1]=i,t[2]=n,t[3]=s,t}normalize(t){let e,i,n,s;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const o=t;e=(o>>16&255)/255,i=(o>>8&255)/255,n=(o&255)/255,s=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,i,n,s=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,i,n,s=255]=t,e/=255,i/=255,n/=255,s/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=Dn.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=te(t);o.isValid()&&({r:e,g:i,b:n,a:s}=o.rgba,e/=255,i/=255,n/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=i,this._components[2]=n,this._components[3]=s,this.refreshInt();else throw new Error(`Unable to convert color ${t}`)}refreshInt(){this._clamp(this._components);const[t,e,i]=this._components;this._int=(t*255<<16)+(e*255<<8)+(i*255|0)}_clamp(t,e=0,i=1){return typeof t=="number"?Math.min(Math.max(t,e),i):(t.forEach((n,s)=>{t[s]=Math.min(Math.max(n,e),i)}),t)}};Sr.shared=new Sr,Sr.temp=new Sr,Sr.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let at=Sr;function I_(r){return J("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),at.shared.setValue(r).toHex()}function P_(r){return J("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),at.shared.setValue(r).toNumber()}function R_(){const r=[],t=[];for(let i=0;i<32;i++)r[i]=i,t[i]=i;r[j.NORMAL_NPM]=j.NORMAL,r[j.ADD_NPM]=j.ADD,r[j.SCREEN_NPM]=j.SCREEN,t[j.NORMAL]=j.NORMAL_NPM,t[j.ADD]=j.ADD_NPM,t[j.SCREEN]=j.SCREEN_NPM;const e=[];return e.push(t),e.push(r),e}const rd=R_();function id(r,t){return rd[t?1:0][r]}function M_(r,t=null){const e=r*6;if(t=t||new Uint16Array(e),t.length!==e)throw new Error(`Out buffer length is incorrect, got ${t.length} and expected ${e}`);for(let i=0,n=0;i>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function Jl(r){return!(r&r-1)&&!!r}function tc(r){let t=(r>65535?1:0)<<4;r>>>=t;let e=(r>255?1:0)<<3;return r>>>=e,t|=e,e=(r>15?1:0)<<2,r>>>=e,t|=e,e=(r>3?1:0)<<1,r>>>=e,t|=e,t|r>>1}function $r(r,t,e){const i=r.length;let n;if(t>=i||e===0)return;e=t+e>i?i-t:e;const s=i-e;for(n=t;n(r.Renderer="renderer",r.Application="application",r.RendererSystem="renderer-webgl-system",r.RendererPlugin="renderer-webgl-plugin",r.CanvasRendererSystem="renderer-canvas-system",r.CanvasRendererPlugin="renderer-canvas-plugin",r.Asset="asset",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser",r))(U||{});const da=r=>{if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");r={...typeof r.extension!="object"?{type:r.extension}:r.extension,ref:r}}if(typeof r=="object")r={...r};else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},sc=(r,t)=>da(r).priority??t,z={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(da).forEach(t=>{t.type.forEach(e=>{var i,n;return(n=(i=this._removeHandlers)[e])==null?void 0:n.call(i,t)})}),this},add(...r){return r.map(da).forEach(t=>{t.type.forEach(e=>{const i=this._addHandlers,n=this._queue;i[e]?i[e](t):(n[e]=n[e]||[],n[e].push(t))})}),this},handle(r,t,e){const i=this._addHandlers,n=this._removeHandlers;if(i[r]||n[r])throw new Error(`Extension type ${r} already has a handler`);i[r]=t,n[r]=e;const s=this._queue;return s[r]&&(s[r].forEach(o=>t(o)),delete s[r]),this},handleByMap(r,t){return this.handle(r,e=>{t[e.name]=e.ref},e=>{delete t[e.name]})},handleByList(r,t,e=-1){return this.handle(r,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((n,s)=>sc(s,e)-sc(n,e)))},i=>{const n=t.indexOf(i.ref);n!==-1&&t.splice(n,1)})}};class fa{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const N_=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` -`);function k_(r){let t="";for(let e=0;e0&&(t+=` -else `),e=0;--i){const n=pa[i];if(n.test&&n.test(r,e))return new n(r,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class jt{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,i,n,s,o,a,h){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:c}=this;this._aliasCount++;for(let u=0,d=c.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(jt.prototype,{dispatch:{value:jt.prototype.emit},run:{value:jt.prototype.emit}});class ki{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new jt("setRealSize"),this.onUpdate=new jt("update"),this.onError=new jt("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,i){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,e){return!1}}class Es extends ki{constructor(t,e){const{width:i,height:n}=e||{};if(!i||!n)throw new Error("BufferResource width or height invalid");super(i,n),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,i){const n=t.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,this.unpackAlignment),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===Ct.UNPACK);const s=e.realWidth,o=e.realHeight;return i.width===s&&i.height===o?n.texSubImage2D(e.target,0,0,0,s,o,e.format,i.type,this.data):(i.width=s,i.height=o,n.texImage2D(e.target,0,i.internalFormat,s,o,0,e.format,i.type,this.data)),!0}dispose(){this.data=null}static test(t){return t===null||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}const G_={scaleMode:he.NEAREST,alphaMode:Ct.NPM},ma=class Cr extends Hi{constructor(t=null,e=null){super(),e=Object.assign({},Cr.defaultOptions,e);const{alphaMode:i,mipmap:n,anisotropicLevel:s,scaleMode:o,width:a,height:h,wrapMode:l,format:c,type:u,target:d,resolution:f,resourceOptions:p}=e;t&&!(t instanceof ki)&&(t=sd(t,p),t.internal=!0),this.resolution=f||$.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((h||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=s,this._wrapMode=l,this._scaleMode=o,this.format=c,this.type=u,this.target=d,this.alphaMode=i,this.uid=gr(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&h>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let i;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this}setSize(t,e,i){return i=i||this.resolution,this.setRealSize(t*i,e*i,i)}setRealSize(t,e,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=Jl(this.realWidth)&&Jl(this.realHeight)}setResolution(t){const e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT(),this)}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Ie[this.cacheId],delete ee[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),Cr.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,i=$.STRICT_TEXTURE_CACHE){const n=typeof t=="string";let s=null;if(n)s=t;else{if(!t._pixiId){const a=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${a}_${gr()}`}s=t._pixiId}let o=Ie[s];if(n&&i&&!o)throw new Error(`The cacheId "${s}" does not exist in BaseTextureCache.`);return o||(o=new Cr(t,e),o.cacheId=s,Cr.addToCache(o,s)),o}static fromBuffer(t,e,i,n){t=t||new Float32Array(e*i*4);const s=new Es(t,{width:e,height:i,...n==null?void 0:n.resourceOptions});let o,a;return t instanceof Float32Array?(o=B.RGBA,a=X.FLOAT):t instanceof Int32Array?(o=B.RGBA_INTEGER,a=X.INT):t instanceof Uint32Array?(o=B.RGBA_INTEGER,a=X.UNSIGNED_INT):t instanceof Int16Array?(o=B.RGBA_INTEGER,a=X.SHORT):t instanceof Uint16Array?(o=B.RGBA_INTEGER,a=X.UNSIGNED_SHORT):t instanceof Int8Array?(o=B.RGBA,a=X.BYTE):(o=B.RGBA,a=X.UNSIGNED_BYTE),s.internal=!0,new Cr(s,Object.assign({},G_,{type:a,format:o},n))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Ie[e]&&Ie[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),Ie[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Ie[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Ie[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e1){for(let u=0;u(r[r.POLY=0]="POLY",r[r.RECT=1]="RECT",r[r.CIRC=2]="CIRC",r[r.ELIP=3]="ELIP",r[r.RREC=4]="RREC",r))(wt||{});class Z{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new Z(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}}Z.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const hn=[new Z,new Z,new Z,new Z];class Y{constructor(t=0,e=0,i=0,n=0){this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(n),this.type=wt.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new Y(0,0,0,0)}clone(){return new Y(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&et.right?t.right:this.right)<=S)return!1;const F=this.yt.bottom?t.bottom:this.bottom)>F}const i=this.left,n=this.right,s=this.top,o=this.bottom;if(n<=i||o<=s)return!1;const a=hn[0].set(t.left,t.top),h=hn[1].set(t.left,t.bottom),l=hn[2].set(t.right,t.top),c=hn[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(h,h),e.apply(l,l),e.apply(c,c),Math.max(a.x,h.x,l.x,c.x)<=i||Math.min(a.x,h.x,l.x,c.x)>=n||Math.max(a.y,h.y,l.y,c.y)<=s||Math.min(a.y,h.y,l.y,c.y)>=o))return!1;const d=u*(h.y-a.y),f=u*(a.x-h.x),p=d*i+f*s,m=d*n+f*s,g=d*i+f*o,y=d*n+f*o;if(Math.max(p,m,g,y)<=d*a.x+f*a.y||Math.min(p,m,g,y)>=d*c.x+f*c.y)return!1;const _=u*(a.y-l.y),v=u*(l.x-a.x),x=_*i+v*s,w=_*n+v*s,C=_*i+v*o,A=_*n+v*o;return!(Math.max(x,w,C,A)<=_*a.x+v*a.y||Math.min(x,w,C,A)>=_*c.x+v*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=n,this.height=Math.max(s-n,0),this}ceil(t=1,e=.001){const i=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=n-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=n,this.height=s-n,this}}Y.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Ss{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.radius=i,this.type=wt.CIRC}clone(){return new Ss(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const i=this.radius*this.radius;let n=this.x-t,s=this.y-e;return n*=n,s*=s,n+s<=i}getBounds(){return new Y(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}Ss.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class Cs{constructor(t=0,e=0,i=0,n=0){this.x=t,this.y=e,this.width=i,this.height=n,this.type=wt.ELIP}clone(){return new Cs(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let i=(t-this.x)/this.width,n=(e-this.y)/this.height;return i*=i,n*=n,i+n<=1}getBounds(){return new Y(this.x-this.width,this.y-this.height,this.width,this.height)}}Cs.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class dr{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const i=[];for(let n=0,s=e.length;ne!=c>e&&t<(l-a)*((e-h)/(c-h))+a&&(i=!i)}return i}}dr.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((r,t)=>`${r}, ${t}`,"")}]`};class Is{constructor(t=0,e=0,i=0,n=0,s=20){this.x=t,this.y=e,this.width=i,this.height=n,this.radius=s,this.type=wt.RREC}clone(){return new Is(this.x,this.y,this.width,this.height,this.radius)}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let n=t-(this.x+i),s=e-(this.y+i);const o=i*i;if(n*n+s*s<=o||(n=t-(this.x+this.width-i),n*n+s*s<=o)||(s=e-(this.y+this.height-i),n*n+s*s<=o)||(n=t-(this.x+i),n*n+s*s<=o))return!0}return!1}}Is.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class ot{constructor(t=1,e=0,i=0,n=1,s=0,o=0){this.array=null,this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,i,n,s,o){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=o,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(t,e){e=e||new Z;const i=t.x,n=t.y;return e.x=this.a*i+this.c*n+this.tx,e.y=this.b*i+this.d*n+this.ty,e}applyInverse(t,e){e=e||new Z;const i=1/(this.a*this.d+this.c*-this.b),n=t.x,s=t.y;return e.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a,s=this.c,o=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=s*e-this.d*i,this.d=s*i+this.d*e,this.tx=o*e-this.ty*i,this.ty=o*i+this.ty*e,this}append(t){const e=this.a,i=this.b,n=this.c,s=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*s,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*s,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*s+this.ty,this}setTransform(t,e,i,n,s,o,a,h,l){return this.a=Math.cos(a+l)*s,this.b=Math.sin(a+l)*s,this.c=-Math.sin(a-h)*o,this.d=Math.cos(a-h)*o,this.tx=t-(i*this.a+n*this.c),this.ty=e-(i*this.b+n*this.d),this}prepend(t){const e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const i=this.a,n=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,i=this.b,n=this.c,s=this.d,o=t.pivot,a=-Math.atan2(-n,s),h=Math.atan2(i,e),l=Math.abs(a+h);return l<1e-5||Math.abs(as-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(n*n+s*s),t.position.x=this.tx+(o.x*e+o.y*n),t.position.y=this.ty+(o.x*i+o.y*s),t}invert(){const t=this.a,e=this.b,i=this.c,n=this.d,s=this.tx,o=t*n-e*i;return this.a=n/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-n*s)/o,this.ty=-(t*this.ty-e*s)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new ot;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}static get IDENTITY(){return new ot}static get TEMP_MATRIX(){return new ot}}ot.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const tr=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],er=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],rr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ir=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],ya=[],ad=[],ln=Math.sign;function Y_(){for(let r=0;r<16;r++){const t=[];ya.push(t);for(let e=0;e<16;e++){const i=ln(tr[r]*tr[e]+rr[r]*er[e]),n=ln(er[r]*tr[e]+ir[r]*er[e]),s=ln(tr[r]*rr[e]+rr[r]*ir[e]),o=ln(er[r]*rr[e]+ir[r]*ir[e]);for(let a=0;a<16;a++)if(tr[a]===i&&er[a]===n&&rr[a]===s&&ir[a]===o){t.push(a);break}}}for(let r=0;r<16;r++){const t=new ot;t.set(tr[r],er[r],rr[r],ir[r],0,0),ad.push(t)}}Y_();const st={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:r=>tr[r],uY:r=>er[r],vX:r=>rr[r],vY:r=>ir[r],inv:r=>r&8?r&15:-r&7,add:(r,t)=>ya[r][t],sub:(r,t)=>ya[r][st.inv(t)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,t)=>Math.abs(r)*2<=Math.abs(t)?t>=0?st.S:st.N:Math.abs(t)*2<=Math.abs(r)?r>0?st.E:st.W:t>0?r>0?st.SE:st.SW:r>0?st.NE:st.NW,matrixAppendRotationInv:(r,t,e=0,i=0)=>{const n=ad[st.inv(t)];n.tx=e,n.ty=i,r.append(n)}};class Te{constructor(t,e,i=0,n=0){this._x=i,this._y=n,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new Te(t,e,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}Te.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const va=class{constructor(){this.worldTransform=new ot,this.localTransform=new ot,this.position=new Te(this.onChange,this,0,0),this.scale=new Te(this.onChange,this,1,1),this.pivot=new Te(this.onChange,this,0,0),this.skew=new Te(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const r=this.localTransform;this._localID!==this._currentLocalID&&(r.a=this._cx*this.scale.x,r.b=this._sx*this.scale.x,r.c=this._cy*this.scale.y,r.d=this._sy*this.scale.y,r.tx=this.position.x-(this.pivot.x*r.a+this.pivot.y*r.c),r.ty=this.position.y-(this.pivot.x*r.b+this.pivot.y*r.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(r){const t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==r._worldID){const e=r.worldTransform,i=this.worldTransform;i.a=t.a*e.a+t.b*e.c,i.b=t.a*e.b+t.b*e.d,i.c=t.c*e.a+t.d*e.c,i.d=t.c*e.b+t.d*e.d,i.tx=t.tx*e.a+t.ty*e.c+e.tx,i.ty=t.tx*e.b+t.ty*e.d+e.ty,this._parentID=r._worldID,this._worldID++}}setFromMatrix(r){r.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(r){this._rotation!==r&&(this._rotation=r,this.updateSkew())}};va.IDENTITY=new va;let ph=va;ph.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var q_=`varying vec2 vTextureCoord; +Deprecated since v${r}`),console.warn(i))),fc[t]=!0}function Ut(r){if(typeof r!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(r)}`)}function li(r){return r.split("?")[0].split("#")[0]}function hx(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function lx(r,t,e){return r.replace(new RegExp(hx(t),"g"),e)}function cx(r,t){let e="",i=0,n=-1,s=0,o=-1;for(let a=0;a<=r.length;++a){if(a2){const h=e.lastIndexOf("/");if(h!==e.length-1){h===-1?(e="",i=0):(e=e.slice(0,h),i=e.length-1-e.lastIndexOf("/")),n=a,s=0;continue}}else if(e.length===2||e.length===1){e="",i=0,n=a,s=0;continue}}t&&(e.length>0?e+="/..":e="..",i=2)}else e.length>0?e+=`/${r.slice(n+1,a)}`:e=r.slice(n+1,a),i=a-n-1;n=a,s=0}else o===46&&s!==-1?++s:s=-1}return e}const Et={toPosix(r){return lx(r,"\\","/")},isUrl(r){return/^https?:/.test(this.toPosix(r))},isDataUrl(r){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(r)},isBlobUrl(r){return r.startsWith("blob:")},hasProtocol(r){return/^[^/:]+:/.test(this.toPosix(r))},getProtocol(r){Ut(r),r=this.toPosix(r);const t=/^file:\/\/\//.exec(r);if(t)return t[0];const e=/^[^/:]+:\/{0,2}/.exec(r);return e?e[0]:""},toAbsolute(r,t,e){if(Ut(r),this.isDataUrl(r)||this.isBlobUrl(r))return r;const i=li(this.toPosix(t??$.ADAPTER.getBaseUrl())),n=li(this.toPosix(e??this.rootname(i)));return r=this.toPosix(r),r.startsWith("/")?Et.join(n,r.slice(1)):this.isAbsolute(r)?r:this.join(i,r)},normalize(r){if(Ut(r),r.length===0)return".";if(this.isDataUrl(r)||this.isBlobUrl(r))return r;r=this.toPosix(r);let t="";const e=r.startsWith("/");this.hasProtocol(r)&&(t=this.rootname(r),r=r.slice(t.length));const i=r.endsWith("/");return r=cx(r,!1),r.length>0&&i&&(r+="/"),e?`/${r}`:t+r},isAbsolute(r){return Ut(r),r=this.toPosix(r),this.hasProtocol(r)?!0:r.startsWith("/")},join(...r){if(r.length===0)return".";let t;for(let e=0;e0)if(t===void 0)t=i;else{const n=r[e-1]??"";this.extname(n)?t+=`/../${i}`:t+=`/${i}`}}return t===void 0?".":this.normalize(t)},dirname(r){if(Ut(r),r.length===0)return".";r=this.toPosix(r);let t=r.charCodeAt(0);const e=t===47;let i=-1,n=!0;const s=this.getProtocol(r),o=r;r=r.slice(s.length);for(let a=r.length-1;a>=1;--a)if(t=r.charCodeAt(a),t===47){if(!n){i=a;break}}else n=!1;return i===-1?e?"/":this.isUrl(o)?s+r:s:e&&i===1?"//":s+r.slice(0,i)},rootname(r){Ut(r),r=this.toPosix(r);let t="";if(r.startsWith("/")?t="/":t=this.getProtocol(r),this.isUrl(r)){const e=r.indexOf("/",t.length);e!==-1?t=r.slice(0,e):t=r,t.endsWith("/")||(t+="/")}return t},basename(r,t){Ut(r),t&&Ut(t),r=li(this.toPosix(r));let e=0,i=-1,n=!0,s;if(t!==void 0&&t.length>0&&t.length<=r.length){if(t.length===r.length&&t===r)return"";let o=t.length-1,a=-1;for(s=r.length-1;s>=0;--s){const h=r.charCodeAt(s);if(h===47){if(!n){e=s+1;break}}else a===-1&&(n=!1,a=s+1),o>=0&&(h===t.charCodeAt(o)?--o===-1&&(i=s):(o=-1,i=a))}return e===i?i=a:i===-1&&(i=r.length),r.slice(e,i)}for(s=r.length-1;s>=0;--s)if(r.charCodeAt(s)===47){if(!n){e=s+1;break}}else i===-1&&(n=!1,i=s+1);return i===-1?"":r.slice(e,i)},extname(r){Ut(r),r=li(this.toPosix(r));let t=-1,e=0,i=-1,n=!0,s=0;for(let o=r.length-1;o>=0;--o){const a=r.charCodeAt(o);if(a===47){if(!n){e=o+1;break}continue}i===-1&&(n=!1,i=o+1),a===46?t===-1?t=o:s!==1&&(s=1):t!==-1&&(s=-1)}return t===-1||i===-1||s===0||s===1&&t===i-1&&t===e+1?"":r.slice(t,i)},parse(r){Ut(r);const t={root:"",dir:"",base:"",ext:"",name:""};if(r.length===0)return t;r=li(this.toPosix(r));let e=r.charCodeAt(0);const i=this.isAbsolute(r);let n;t.root=this.rootname(r),i||this.hasProtocol(r)?n=1:n=0;let s=-1,o=0,a=-1,h=!0,l=r.length-1,c=0;for(;l>=n;--l){if(e=r.charCodeAt(l),e===47){if(!h){o=l+1;break}continue}a===-1&&(h=!1,a=l+1),e===46?s===-1?s=l:c!==1&&(c=1):s!==-1&&(c=-1)}return s===-1||a===-1||c===0||c===1&&s===a-1&&s===o+1?a!==-1&&(o===0&&i?t.base=t.name=r.slice(1,a):t.base=t.name=r.slice(o,a)):(o===0&&i?(t.name=r.slice(1,s),t.base=r.slice(1,a)):(t.name=r.slice(o,s),t.base=r.slice(o,a)),t.ext=r.slice(s,a)),t.dir=this.dirname(r),t},sep:"/",delimiter:":"};let vo;async function ux(){return vo??(vo=(async()=>{var s;const r=document.createElement("canvas").getContext("webgl");if(!r)return Ct.UNPACK;const t=await new Promise(o=>{const a=document.createElement("video");a.onloadeddata=()=>o(a),a.onerror=()=>o(null),a.autoplay=!1,a.crossOrigin="anonymous",a.preload="auto",a.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",a.load()});if(!t)return Ct.UNPACK;const e=r.createTexture();r.bindTexture(r.TEXTURE_2D,e);const i=r.createFramebuffer();r.bindFramebuffer(r.FRAMEBUFFER,i),r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0,r.TEXTURE_2D,e,0),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE),r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,t);const n=new Uint8Array(4);return r.readPixels(0,0,1,1,r.RGBA,r.UNSIGNED_BYTE,n),r.deleteFramebuffer(i),r.deleteTexture(e),(s=r.getExtension("WEBGL_lose_context"))==null||s.loseContext(),n[0]<=n[3]?Ct.PMA:Ct.UNPACK})()),vo}let _o;function dx(){return typeof _o>"u"&&(_o=function(){var t;const r={stencil:!0,failIfMajorPerformanceCaveat:$.FAIL_IF_MAJOR_PERFORMANCE_CAVEAT};try{if(!$.ADAPTER.getWebGLRenderingContext())return!1;const e=$.ADAPTER.createCanvas();let i=e.getContext("webgl",r)||e.getContext("experimental-webgl",r);const n=!!((t=i==null?void 0:i.getContextAttributes())!=null&&t.stencil);if(i){const s=i.getExtension("WEBGL_lose_context");s&&s.loseContext()}return i=null,n}catch{return!1}}()),_o}var fx={grad:.9,turn:360,rad:360/(2*Math.PI)},ve=function(r){return typeof r=="string"?r.length>0:typeof r=="number"},_t=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=Math.pow(10,t)),Math.round(e*r)/e+0},kt=function(r,t,e){return t===void 0&&(t=0),e===void 0&&(e=1),r>e?e:r>t?r:t},Sd=function(r){return(r=isFinite(r)?r%360:0)>0?r:r+360},pc=function(r){return{r:kt(r.r,0,255),g:kt(r.g,0,255),b:kt(r.b,0,255),a:kt(r.a)}},xo=function(r){return{r:_t(r.r),g:_t(r.g),b:_t(r.b),a:_t(r.a,3)}},px=/^#([0-9a-f]{3,8})$/i,hn=function(r){var t=r.toString(16);return t.length<2?"0"+t:t},Cd=function(r){var t=r.r,e=r.g,i=r.b,n=r.a,s=Math.max(t,e,i),o=s-Math.min(t,e,i),a=o?s===t?(e-i)/o:s===e?2+(i-t)/o:4+(t-e)/o:0;return{h:60*(a<0?a+6:a),s:s?o/s*100:0,v:s/255*100,a:n}},Id=function(r){var t=r.h,e=r.s,i=r.v,n=r.a;t=t/360*6,e/=100,i/=100;var s=Math.floor(t),o=i*(1-e),a=i*(1-(t-s)*e),h=i*(1-(1-t+s)*e),l=s%6;return{r:255*[i,a,o,o,h,i][l],g:255*[h,i,i,a,o,o][l],b:255*[o,o,h,i,i,a][l],a:n}},mc=function(r){return{h:Sd(r.h),s:kt(r.s,0,100),l:kt(r.l,0,100),a:kt(r.a)}},gc=function(r){return{h:_t(r.h),s:_t(r.s),l:_t(r.l),a:_t(r.a,3)}},yc=function(r){return Id((e=(t=r).s,{h:t.h,s:(e*=((i=t.l)<50?i:100-i)/100)>0?2*e/(i+e)*100:0,v:i+e,a:t.a}));var t,e,i},Ci=function(r){return{h:(t=Cd(r)).h,s:(n=(200-(e=t.s))*(i=t.v)/100)>0&&n<200?e*i/100/(n<=100?n:200-n)*100:0,l:n/2,a:t.a};var t,e,i,n},mx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gx=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,yx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vx=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ta={string:[[function(r){var t=px.exec(r);return t?(r=t[1]).length<=4?{r:parseInt(r[0]+r[0],16),g:parseInt(r[1]+r[1],16),b:parseInt(r[2]+r[2],16),a:r.length===4?_t(parseInt(r[3]+r[3],16)/255,2):1}:r.length===6||r.length===8?{r:parseInt(r.substr(0,2),16),g:parseInt(r.substr(2,2),16),b:parseInt(r.substr(4,2),16),a:r.length===8?_t(parseInt(r.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(r){var t=yx.exec(r)||vx.exec(r);return t?t[2]!==t[4]||t[4]!==t[6]?null:pc({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(r){var t=mx.exec(r)||gx.exec(r);if(!t)return null;var e,i,n=mc({h:(e=t[1],i=t[2],i===void 0&&(i="deg"),Number(e)*(fx[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return yc(n)},"hsl"]],object:[[function(r){var t=r.r,e=r.g,i=r.b,n=r.a,s=n===void 0?1:n;return ve(t)&&ve(e)&&ve(i)?pc({r:Number(t),g:Number(e),b:Number(i),a:Number(s)}):null},"rgb"],[function(r){var t=r.h,e=r.s,i=r.l,n=r.a,s=n===void 0?1:n;if(!ve(t)||!ve(e)||!ve(i))return null;var o=mc({h:Number(t),s:Number(e),l:Number(i),a:Number(s)});return yc(o)},"hsl"],[function(r){var t=r.h,e=r.s,i=r.v,n=r.a,s=n===void 0?1:n;if(!ve(t)||!ve(e)||!ve(i))return null;var o=function(a){return{h:Sd(a.h),s:kt(a.s,0,100),v:kt(a.v,0,100),a:kt(a.a)}}({h:Number(t),s:Number(e),v:Number(i),a:Number(s)});return Id(o)},"hsv"]]},vc=function(r,t){for(var e=0;e=.5},r.prototype.toHex=function(){return t=xo(this.rgba),e=t.r,i=t.g,n=t.b,o=(s=t.a)<1?hn(_t(255*s)):"","#"+hn(e)+hn(i)+hn(n)+o;var t,e,i,n,s,o},r.prototype.toRgb=function(){return xo(this.rgba)},r.prototype.toRgbString=function(){return t=xo(this.rgba),e=t.r,i=t.g,n=t.b,(s=t.a)<1?"rgba("+e+", "+i+", "+n+", "+s+")":"rgb("+e+", "+i+", "+n+")";var t,e,i,n,s},r.prototype.toHsl=function(){return gc(Ci(this.rgba))},r.prototype.toHslString=function(){return t=gc(Ci(this.rgba)),e=t.h,i=t.s,n=t.l,(s=t.a)<1?"hsla("+e+", "+i+"%, "+n+"%, "+s+")":"hsl("+e+", "+i+"%, "+n+"%)";var t,e,i,n,s},r.prototype.toHsv=function(){return t=Cd(this.rgba),{h:_t(t.h),s:_t(t.s),v:_t(t.v),a:_t(t.a,3)};var t},r.prototype.invert=function(){return te({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},r.prototype.saturate=function(t){return t===void 0&&(t=.1),te(bo(this.rgba,t))},r.prototype.desaturate=function(t){return t===void 0&&(t=.1),te(bo(this.rgba,-t))},r.prototype.grayscale=function(){return te(bo(this.rgba,-1))},r.prototype.lighten=function(t){return t===void 0&&(t=.1),te(_c(this.rgba,t))},r.prototype.darken=function(t){return t===void 0&&(t=.1),te(_c(this.rgba,-t))},r.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},r.prototype.alpha=function(t){return typeof t=="number"?te({r:(e=this.rgba).r,g:e.g,b:e.b,a:t}):_t(this.rgba.a,3);var e},r.prototype.hue=function(t){var e=Ci(this.rgba);return typeof t=="number"?te({h:t,s:e.s,l:e.l,a:e.a}):_t(e.h)},r.prototype.isEqual=function(t){return this.toHex()===te(t).toHex()},r}(),te=function(r){return r instanceof Aa?r:new Aa(r)},xc=[],xx=function(r){r.forEach(function(t){xc.indexOf(t)<0&&(t(Aa,Ta),xc.push(t))})};function bx(r,t){var e={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var n in e)i[e[n]]=n;var s={};r.prototype.toName=function(o){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,h,l=i[this.toHex()];if(l)return l;if(o!=null&&o.closest){var c=this.toRgb(),u=1/0,d="black";if(!s.length)for(var f in e)s[f]=new r(e[f]).toRgb();for(var p in e){var m=(a=c,h=s[p],Math.pow(a.r-h.r,2)+Math.pow(a.g-h.g,2)+Math.pow(a.b-h.b,2));mn===e[s]);if(t!==null&&e!==null){const n=Object.keys(t),s=Object.keys(e);return n.length!==s.length?!1:n.every(o=>t[o]===e[o])}return t===e}toRgba(){const[t,e,i,n]=this._components;return{r:t,g:e,b:i,a:n}}toRgb(){const[t,e,i]=this._components;return{r:t,g:e,b:i}}toRgbaString(){const[t,e,i]=this.toUint8RgbArray();return`rgba(${t},${e},${i},${this.alpha})`}toUint8RgbArray(t){const[e,i,n]=this._components;return t=t??[],t[0]=Math.round(e*255),t[1]=Math.round(i*255),t[2]=Math.round(n*255),t}toRgbArray(t){t=t??[];const[e,i,n]=this._components;return t[0]=e,t[1]=i,t[2]=n,t}toNumber(){return this._int}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[e,i,n,s]=Ln.temp.setValue(t)._components;return this._components[0]*=e,this._components[1]*=i,this._components[2]*=n,this._components[3]*=s,this.refreshInt(),this._value=null,this}premultiply(t,e=!0){return e&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this.refreshInt(),this._value=null,this}toPremultiplied(t,e=!0){if(t===1)return(255<<24)+this._int;if(t===0)return e?0:this._int;let i=this._int>>16&255,n=this._int>>8&255,s=this._int&255;return e&&(i=i*t+.5|0,n=n*t+.5|0,s=s*t+.5|0),(t*255<<24)+(i<<16)+(n<<8)+s}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(t){return this._components[3]=this._clamp(t),this}round(t){const[e,i,n]=this._components;return this._components[0]=Math.round(e*t)/t,this._components[1]=Math.round(i*t)/t,this._components[2]=Math.round(n*t)/t,this.refreshInt(),this._value=null,this}toArray(t){t=t??[];const[e,i,n,s]=this._components;return t[0]=e,t[1]=i,t[2]=n,t[3]=s,t}normalize(t){let e,i,n,s;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const o=t;e=(o>>16&255)/255,i=(o>>8&255)/255,n=(o&255)/255,s=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[e,i,n,s=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[e,i,n,s=255]=t,e/=255,i/=255,n/=255,s/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const a=Ln.HEX_PATTERN.exec(t);a&&(t=`#${a[2]}`)}const o=te(t);o.isValid()&&({r:e,g:i,b:n,a:s}=o.rgba,e/=255,i/=255,n/=255)}if(e!==void 0)this._components[0]=e,this._components[1]=i,this._components[2]=n,this._components[3]=s,this.refreshInt();else throw new Error(`Unable to convert color ${t}`)}refreshInt(){this._clamp(this._components);const[t,e,i]=this._components;this._int=(t*255<<16)+(e*255<<8)+(i*255|0)}_clamp(t,e=0,i=1){return typeof t=="number"?Math.min(Math.max(t,e),i):(t.forEach((n,s)=>{t[s]=Math.min(Math.max(n,e),i)}),t)}};Er.shared=new Er,Er.temp=new Er,Er.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let at=Er;function wx(r){return J("7.2.0","utils.hex2string is deprecated, use Color#toHex instead"),at.shared.setValue(r).toHex()}function Tx(r){return J("7.2.0","utils.rgb2hex is deprecated, use Color#toNumber instead"),at.shared.setValue(r).toNumber()}function Ax(){const r=[],t=[];for(let i=0;i<32;i++)r[i]=i,t[i]=i;r[j.NORMAL_NPM]=j.NORMAL,r[j.ADD_NPM]=j.ADD,r[j.SCREEN_NPM]=j.SCREEN,t[j.NORMAL]=j.NORMAL_NPM,t[j.ADD]=j.ADD_NPM,t[j.SCREEN]=j.SCREEN_NPM;const e=[];return e.push(t),e.push(r),e}const Pd=Ax();function Rd(r,t){return Pd[t?1:0][r]}function Ex(r,t=null){const e=r*6;if(t=t||new Uint16Array(e),t.length!==e)throw new Error(`Out buffer length is incorrect, got ${t.length} and expected ${e}`);for(let i=0,n=0;i>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r+1}function bc(r){return!(r&r-1)&&!!r}function wc(r){let t=(r>65535?1:0)<<4;r>>>=t;let e=(r>255?1:0)<<3;return r>>>=e,t|=e,e=(r>15?1:0)<<2,r>>>=e,t|=e,e=(r>3?1:0)<<1,r>>>=e,t|=e,t|r>>1}function Hr(r,t,e){const i=r.length;let n;if(t>=i||e===0)return;e=t+e>i?i-t:e;const s=i-e;for(n=t;n(r.Renderer="renderer",r.Application="application",r.RendererSystem="renderer-webgl-system",r.RendererPlugin="renderer-webgl-plugin",r.CanvasRendererSystem="renderer-canvas-system",r.CanvasRendererPlugin="renderer-canvas-plugin",r.Asset="asset",r.LoadParser="load-parser",r.ResolveParser="resolve-parser",r.CacheParser="cache-parser",r.DetectionParser="detection-parser",r))(U||{});const Sa=r=>{if(typeof r=="function"||typeof r=="object"&&r.extension){if(!r.extension)throw new Error("Extension class must have an extension object");r={...typeof r.extension!="object"?{type:r.extension}:r.extension,ref:r}}if(typeof r=="object")r={...r};else throw new Error("Invalid extension type");return typeof r.type=="string"&&(r.type=[r.type]),r},Cc=(r,t)=>Sa(r).priority??t,z={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...r){return r.map(Sa).forEach(t=>{t.type.forEach(e=>{var i,n;return(n=(i=this._removeHandlers)[e])==null?void 0:n.call(i,t)})}),this},add(...r){return r.map(Sa).forEach(t=>{t.type.forEach(e=>{const i=this._addHandlers,n=this._queue;i[e]?i[e](t):(n[e]=n[e]||[],n[e].push(t))})}),this},handle(r,t,e){const i=this._addHandlers,n=this._removeHandlers;if(i[r]||n[r])throw new Error(`Extension type ${r} already has a handler`);i[r]=t,n[r]=e;const s=this._queue;return s[r]&&(s[r].forEach(o=>t(o)),delete s[r]),this},handleByMap(r,t){return this.handle(r,e=>{t[e.name]=e.ref},e=>{delete t[e.name]})},handleByList(r,t,e=-1){return this.handle(r,i=>{t.includes(i.ref)||(t.push(i.ref),t.sort((n,s)=>Cc(s,e)-Cc(n,e)))},i=>{const n=t.indexOf(i.ref);n!==-1&&t.splice(n,1)})}};class Ca{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData)}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get uint16View(){return this._uint16View||(this._uint16View=new Uint16Array(this.rawBinaryData)),this._uint16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}view(t){return this[`${t}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}const Mx=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(` +`);function Fx(r){let t="";for(let e=0;e0&&(t+=` +else `),e=0;--i){const n=Ia[i];if(n.test&&n.test(r,e))return new n(r,t)}throw new Error("Unrecognized source type to auto-detect Resource")}class jt{constructor(t){this.items=[],this._name=t,this._aliasCount=0}emit(t,e,i,n,s,o,a,h){if(arguments.length>8)throw new Error("max arguments reached");const{name:l,items:c}=this;this._aliasCount++;for(let u=0,d=c.length;u0&&this.items.length>1&&(this._aliasCount=0,this.items=this.items.slice(0))}add(t){return t[this._name]&&(this.ensureNonAliasedItems(),this.remove(t),this.items.push(t)),this}remove(t){const e=this.items.indexOf(t);return e!==-1&&(this.ensureNonAliasedItems(),this.items.splice(e,1)),this}contains(t){return this.items.includes(t)}removeAll(){return this.ensureNonAliasedItems(),this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}Object.defineProperties(jt.prototype,{dispatch:{value:jt.prototype.emit},run:{value:jt.prototype.emit}});class Ni{constructor(t=0,e=0){this._width=t,this._height=e,this.destroyed=!1,this.internal=!1,this.onResize=new jt("setRealSize"),this.onUpdate=new jt("update"),this.onError=new jt("onError")}bind(t){this.onResize.add(t),this.onUpdate.add(t),this.onError.add(t),(this._width||this._height)&&this.onResize.emit(this._width,this._height)}unbind(t){this.onResize.remove(t),this.onUpdate.remove(t),this.onError.remove(t)}resize(t,e){(t!==this._width||e!==this._height)&&(this._width=t,this._height=e,this.onResize.emit(t,e))}get valid(){return!!this._width&&!!this._height}update(){this.destroyed||this.onUpdate.emit()}load(){return Promise.resolve(this)}get width(){return this._width}get height(){return this._height}style(t,e,i){return!1}dispose(){}destroy(){this.destroyed||(this.destroyed=!0,this.dispose(),this.onError.removeAll(),this.onError=null,this.onResize.removeAll(),this.onResize=null,this.onUpdate.removeAll(),this.onUpdate=null)}static test(t,e){return!1}}class Ps extends Ni{constructor(t,e){const{width:i,height:n}=e||{};if(!i||!n)throw new Error("BufferResource width or height invalid");super(i,n),this.data=t,this.unpackAlignment=e.unpackAlignment??4}upload(t,e,i){const n=t.gl;n.pixelStorei(n.UNPACK_ALIGNMENT,this.unpackAlignment),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.alphaMode===Ct.UNPACK);const s=e.realWidth,o=e.realHeight;return i.width===s&&i.height===o?n.texSubImage2D(e.target,0,0,0,s,o,e.format,i.type,this.data):(i.width=s,i.height=o,n.texImage2D(e.target,0,i.internalFormat,s,o,0,e.format,i.type,this.data)),!0}dispose(){this.data=null}static test(t){return t===null||t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}const Bx={scaleMode:he.NEAREST,alphaMode:Ct.NPM},Pa=class Sr extends Gi{constructor(t=null,e=null){super(),e=Object.assign({},Sr.defaultOptions,e);const{alphaMode:i,mipmap:n,anisotropicLevel:s,scaleMode:o,width:a,height:h,wrapMode:l,format:c,type:u,target:d,resolution:f,resourceOptions:p}=e;t&&!(t instanceof Ni)&&(t=Fd(t,p),t.internal=!0),this.resolution=f||$.RESOLUTION,this.width=Math.round((a||0)*this.resolution)/this.resolution,this.height=Math.round((h||0)*this.resolution)/this.resolution,this._mipmap=n,this.anisotropicLevel=s,this._wrapMode=l,this._scaleMode=o,this.format=c,this.type=u,this.target=d,this.alphaMode=i,this.uid=mr(),this.touched=0,this.isPowerOfTwo=!1,this._refreshPOT(),this._glTextures={},this.dirtyId=0,this.dirtyStyleId=0,this.cacheId=null,this.valid=a>0&&h>0,this.textureCacheIds=[],this.destroyed=!1,this.resource=null,this._batchEnabled=0,this._batchLocation=0,this.parentTextureArray=null,this.setResource(t)}get realWidth(){return Math.round(this.width*this.resolution)}get realHeight(){return Math.round(this.height*this.resolution)}get mipmap(){return this._mipmap}set mipmap(t){this._mipmap!==t&&(this._mipmap=t,this.dirtyStyleId++)}get scaleMode(){return this._scaleMode}set scaleMode(t){this._scaleMode!==t&&(this._scaleMode=t,this.dirtyStyleId++)}get wrapMode(){return this._wrapMode}set wrapMode(t){this._wrapMode!==t&&(this._wrapMode=t,this.dirtyStyleId++)}setStyle(t,e){let i;return t!==void 0&&t!==this.scaleMode&&(this.scaleMode=t,i=!0),e!==void 0&&e!==this.mipmap&&(this.mipmap=e,i=!0),i&&this.dirtyStyleId++,this}setSize(t,e,i){return i=i||this.resolution,this.setRealSize(t*i,e*i,i)}setRealSize(t,e,i){return this.resolution=i||this.resolution,this.width=Math.round(t)/this.resolution,this.height=Math.round(e)/this.resolution,this._refreshPOT(),this.update(),this}_refreshPOT(){this.isPowerOfTwo=bc(this.realWidth)&&bc(this.realHeight)}setResolution(t){const e=this.resolution;return e===t?this:(this.resolution=t,this.valid&&(this.width=Math.round(this.width*e)/t,this.height=Math.round(this.height*e)/t,this.emit("update",this)),this._refreshPOT(),this)}setResource(t){if(this.resource===t)return this;if(this.resource)throw new Error("Resource can be set only once");return t.bind(this),this.resource=t,this}update(){this.valid?(this.dirtyId++,this.dirtyStyleId++,this.emit("update",this)):this.width>0&&this.height>0&&(this.valid=!0,this.emit("loaded",this),this.emit("update",this))}onError(t){this.emit("error",this,t)}destroy(){this.resource&&(this.resource.unbind(this),this.resource.internal&&this.resource.destroy(),this.resource=null),this.cacheId&&(delete Ie[this.cacheId],delete ee[this.cacheId],this.cacheId=null),this.valid=!1,this.dispose(),Sr.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}dispose(){this.emit("dispose",this)}castToBaseTexture(){return this}static from(t,e,i=$.STRICT_TEXTURE_CACHE){const n=typeof t=="string";let s=null;if(n)s=t;else{if(!t._pixiId){const a=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${a}_${mr()}`}s=t._pixiId}let o=Ie[s];if(n&&i&&!o)throw new Error(`The cacheId "${s}" does not exist in BaseTextureCache.`);return o||(o=new Sr(t,e),o.cacheId=s,Sr.addToCache(o,s)),o}static fromBuffer(t,e,i,n){t=t||new Float32Array(e*i*4);const s=new Ps(t,{width:e,height:i,...n==null?void 0:n.resourceOptions});let o,a;return t instanceof Float32Array?(o=B.RGBA,a=X.FLOAT):t instanceof Int32Array?(o=B.RGBA_INTEGER,a=X.INT):t instanceof Uint32Array?(o=B.RGBA_INTEGER,a=X.UNSIGNED_INT):t instanceof Int16Array?(o=B.RGBA_INTEGER,a=X.SHORT):t instanceof Uint16Array?(o=B.RGBA_INTEGER,a=X.UNSIGNED_SHORT):t instanceof Int8Array?(o=B.RGBA,a=X.BYTE):(o=B.RGBA,a=X.UNSIGNED_BYTE),s.internal=!0,new Sr(s,Object.assign({},Bx,{type:a,format:o},n))}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),Ie[e]&&Ie[e]!==t&&console.warn(`BaseTexture added to the cache with an id [${e}] that already had an entry`),Ie[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=Ie[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete Ie[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;e1){for(let u=0;u(r[r.POLY=0]="POLY",r[r.RECT=1]="RECT",r[r.CIRC=2]="CIRC",r[r.ELIP=3]="ELIP",r[r.RREC=4]="RREC",r))(wt||{});class Z{constructor(t=0,e=0){this.x=0,this.y=0,this.x=t,this.y=e}clone(){return new Z(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,e=t){return this.x=t,this.y=e,this}}Z.prototype.toString=function(){return`[@pixi/math:Point x=${this.x} y=${this.y}]`};const ln=[new Z,new Z,new Z,new Z];class Y{constructor(t=0,e=0,i=0,n=0){this.x=Number(t),this.y=Number(e),this.width=Number(i),this.height=Number(n),this.type=wt.RECT}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}static get EMPTY(){return new Y(0,0,0,0)}clone(){return new Y(this.x,this.y,this.width,this.height)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}contains(t,e){return this.width<=0||this.height<=0?!1:t>=this.x&&t=this.y&&et.right?t.right:this.right)<=S)return!1;const F=this.yt.bottom?t.bottom:this.bottom)>F}const i=this.left,n=this.right,s=this.top,o=this.bottom;if(n<=i||o<=s)return!1;const a=ln[0].set(t.left,t.top),h=ln[1].set(t.left,t.bottom),l=ln[2].set(t.right,t.top),c=ln[3].set(t.right,t.bottom);if(l.x<=a.x||h.y<=a.y)return!1;const u=Math.sign(e.a*e.d-e.b*e.c);if(u===0||(e.apply(a,a),e.apply(h,h),e.apply(l,l),e.apply(c,c),Math.max(a.x,h.x,l.x,c.x)<=i||Math.min(a.x,h.x,l.x,c.x)>=n||Math.max(a.y,h.y,l.y,c.y)<=s||Math.min(a.y,h.y,l.y,c.y)>=o))return!1;const d=u*(h.y-a.y),f=u*(a.x-h.x),p=d*i+f*s,m=d*n+f*s,g=d*i+f*o,y=d*n+f*o;if(Math.max(p,m,g,y)<=d*a.x+f*a.y||Math.min(p,m,g,y)>=d*c.x+f*c.y)return!1;const _=u*(a.y-l.y),v=u*(l.x-a.x),x=_*i+v*s,w=_*n+v*s,C=_*i+v*o,A=_*n+v*o;return!(Math.max(x,w,C,A)<=_*a.x+v*a.y||Math.min(x,w,C,A)>=_*c.x+v*c.y)}pad(t=0,e=t){return this.x-=t,this.y-=e,this.width+=t*2,this.height+=e*2,this}fit(t){const e=Math.max(this.x,t.x),i=Math.min(this.x+this.width,t.x+t.width),n=Math.max(this.y,t.y),s=Math.min(this.y+this.height,t.y+t.height);return this.x=e,this.width=Math.max(i-e,0),this.y=n,this.height=Math.max(s-n,0),this}ceil(t=1,e=.001){const i=Math.ceil((this.x+this.width-e)*t)/t,n=Math.ceil((this.y+this.height-e)*t)/t;return this.x=Math.floor((this.x+e)*t)/t,this.y=Math.floor((this.y+e)*t)/t,this.width=i-this.x,this.height=n-this.y,this}enlarge(t){const e=Math.min(this.x,t.x),i=Math.max(this.x+this.width,t.x+t.width),n=Math.min(this.y,t.y),s=Math.max(this.y+this.height,t.y+t.height);return this.x=e,this.width=i-e,this.y=n,this.height=s-n,this}}Y.prototype.toString=function(){return`[@pixi/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class Rs{constructor(t=0,e=0,i=0){this.x=t,this.y=e,this.radius=i,this.type=wt.CIRC}clone(){return new Rs(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;const i=this.radius*this.radius;let n=this.x-t,s=this.y-e;return n*=n,s*=s,n+s<=i}getBounds(){return new Y(this.x-this.radius,this.y-this.radius,this.radius*2,this.radius*2)}}Rs.prototype.toString=function(){return`[@pixi/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`};class Ms{constructor(t=0,e=0,i=0,n=0){this.x=t,this.y=e,this.width=i,this.height=n,this.type=wt.ELIP}clone(){return new Ms(this.x,this.y,this.width,this.height)}contains(t,e){if(this.width<=0||this.height<=0)return!1;let i=(t-this.x)/this.width,n=(e-this.y)/this.height;return i*=i,n*=n,i+n<=1}getBounds(){return new Y(this.x-this.width,this.y-this.height,this.width,this.height)}}Ms.prototype.toString=function(){return`[@pixi/math:Ellipse x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`};class ur{constructor(...t){let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){const i=[];for(let n=0,s=e.length;ne!=c>e&&t<(l-a)*((e-h)/(c-h))+a&&(i=!i)}return i}}ur.prototype.toString=function(){return`[@pixi/math:PolygoncloseStroke=${this.closeStroke}points=${this.points.reduce((r,t)=>`${r}, ${t}`,"")}]`};class Fs{constructor(t=0,e=0,i=0,n=0,s=20){this.x=t,this.y=e,this.width=i,this.height=n,this.radius=s,this.type=wt.RREC}clone(){return new Fs(this.x,this.y,this.width,this.height,this.radius)}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+i&&e<=this.y+this.height-i||t>=this.x+i&&t<=this.x+this.width-i)return!0;let n=t-(this.x+i),s=e-(this.y+i);const o=i*i;if(n*n+s*s<=o||(n=t-(this.x+this.width-i),n*n+s*s<=o)||(s=e-(this.y+this.height-i),n*n+s*s<=o)||(n=t-(this.x+i),n*n+s*s<=o))return!0}return!1}}Fs.prototype.toString=function(){return`[@pixi/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`};class ot{constructor(t=1,e=0,i=0,n=1,s=0,o=0){this.array=null,this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=o}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,e,i,n,s,o){return this.a=t,this.b=e,this.c=i,this.d=n,this.tx=s,this.ty=o,this}toArray(t,e){this.array||(this.array=new Float32Array(9));const i=e||this.array;return t?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(t,e){e=e||new Z;const i=t.x,n=t.y;return e.x=this.a*i+this.c*n+this.tx,e.y=this.b*i+this.d*n+this.ty,e}applyInverse(t,e){e=e||new Z;const i=1/(this.a*this.d+this.c*-this.b),n=t.x,s=t.y;return e.x=this.d*i*n+-this.c*i*s+(this.ty*this.c-this.tx*this.d)*i,e.y=this.a*i*s+-this.b*i*n+(-this.ty*this.a+this.tx*this.b)*i,e}translate(t,e){return this.tx+=t,this.ty+=e,this}scale(t,e){return this.a*=t,this.d*=e,this.c*=t,this.b*=e,this.tx*=t,this.ty*=e,this}rotate(t){const e=Math.cos(t),i=Math.sin(t),n=this.a,s=this.c,o=this.tx;return this.a=n*e-this.b*i,this.b=n*i+this.b*e,this.c=s*e-this.d*i,this.d=s*i+this.d*e,this.tx=o*e-this.ty*i,this.ty=o*i+this.ty*e,this}append(t){const e=this.a,i=this.b,n=this.c,s=this.d;return this.a=t.a*e+t.b*n,this.b=t.a*i+t.b*s,this.c=t.c*e+t.d*n,this.d=t.c*i+t.d*s,this.tx=t.tx*e+t.ty*n+this.tx,this.ty=t.tx*i+t.ty*s+this.ty,this}setTransform(t,e,i,n,s,o,a,h,l){return this.a=Math.cos(a+l)*s,this.b=Math.sin(a+l)*s,this.c=-Math.sin(a-h)*o,this.d=Math.cos(a-h)*o,this.tx=t-(i*this.a+n*this.c),this.ty=e-(i*this.b+n*this.d),this}prepend(t){const e=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const i=this.a,n=this.c;this.a=i*t.a+this.b*t.c,this.b=i*t.b+this.b*t.d,this.c=n*t.a+this.d*t.c,this.d=n*t.b+this.d*t.d}return this.tx=e*t.a+this.ty*t.c+t.tx,this.ty=e*t.b+this.ty*t.d+t.ty,this}decompose(t){const e=this.a,i=this.b,n=this.c,s=this.d,o=t.pivot,a=-Math.atan2(-n,s),h=Math.atan2(i,e),l=Math.abs(a+h);return l<1e-5||Math.abs(ls-l)<1e-5?(t.rotation=h,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=a,t.skew.y=h),t.scale.x=Math.sqrt(e*e+i*i),t.scale.y=Math.sqrt(n*n+s*s),t.position.x=this.tx+(o.x*e+o.y*n),t.position.y=this.ty+(o.x*i+o.y*s),t}invert(){const t=this.a,e=this.b,i=this.c,n=this.d,s=this.tx,o=t*n-e*i;return this.a=n/o,this.b=-e/o,this.c=-i/o,this.d=t/o,this.tx=(i*this.ty-n*s)/o,this.ty=-(t*this.ty-e*s)/o,this}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const t=new ot;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}static get IDENTITY(){return new ot}static get TEMP_MATRIX(){return new ot}}ot.prototype.toString=function(){return`[@pixi/math:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`};const tr=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],er=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],rr=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],ir=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Ma=[],Bd=[],cn=Math.sign;function $x(){for(let r=0;r<16;r++){const t=[];Ma.push(t);for(let e=0;e<16;e++){const i=cn(tr[r]*tr[e]+rr[r]*er[e]),n=cn(er[r]*tr[e]+ir[r]*er[e]),s=cn(tr[r]*rr[e]+rr[r]*ir[e]),o=cn(er[r]*rr[e]+ir[r]*ir[e]);for(let a=0;a<16;a++)if(tr[a]===i&&er[a]===n&&rr[a]===s&&ir[a]===o){t.push(a);break}}}for(let r=0;r<16;r++){const t=new ot;t.set(tr[r],er[r],rr[r],ir[r],0,0),Bd.push(t)}}$x();const st={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:r=>tr[r],uY:r=>er[r],vX:r=>rr[r],vY:r=>ir[r],inv:r=>r&8?r&15:-r&7,add:(r,t)=>Ma[r][t],sub:(r,t)=>Ma[r][st.inv(t)],rotate180:r=>r^4,isVertical:r=>(r&3)===2,byDirection:(r,t)=>Math.abs(r)*2<=Math.abs(t)?t>=0?st.S:st.N:Math.abs(t)*2<=Math.abs(r)?r>0?st.E:st.W:t>0?r>0?st.SE:st.SW:r>0?st.NE:st.NW,matrixAppendRotationInv:(r,t,e=0,i=0)=>{const n=Bd[st.inv(t)];n.tx=e,n.ty=i,r.append(n)}};class Te{constructor(t,e,i=0,n=0){this._x=i,this._y=n,this.cb=t,this.scope=e}clone(t=this.cb,e=this.scope){return new Te(t,e,this._x,this._y)}set(t=0,e=t){return(this._x!==t||this._y!==e)&&(this._x=t,this._y=e,this.cb.call(this.scope)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this.cb.call(this.scope)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.y===this._y}get x(){return this._x}set x(t){this._x!==t&&(this._x=t,this.cb.call(this.scope))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this.cb.call(this.scope))}}Te.prototype.toString=function(){return`[@pixi/math:ObservablePoint x=${this.x} y=${this.y} scope=${this.scope}]`};const Fa=class{constructor(){this.worldTransform=new ot,this.localTransform=new ot,this.position=new Te(this.onChange,this,0,0),this.scale=new Te(this.onChange,this,1,1),this.pivot=new Te(this.onChange,this,0,0),this.skew=new Te(this.updateSkew,this,0,0),this._rotation=0,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._localID=0,this._currentLocalID=0,this._worldID=0,this._parentID=0}onChange(){this._localID++}updateSkew(){this._cx=Math.cos(this._rotation+this.skew.y),this._sx=Math.sin(this._rotation+this.skew.y),this._cy=-Math.sin(this._rotation-this.skew.x),this._sy=Math.cos(this._rotation-this.skew.x),this._localID++}updateLocalTransform(){const r=this.localTransform;this._localID!==this._currentLocalID&&(r.a=this._cx*this.scale.x,r.b=this._sx*this.scale.x,r.c=this._cy*this.scale.y,r.d=this._sy*this.scale.y,r.tx=this.position.x-(this.pivot.x*r.a+this.pivot.y*r.c),r.ty=this.position.y-(this.pivot.x*r.b+this.pivot.y*r.d),this._currentLocalID=this._localID,this._parentID=-1)}updateTransform(r){const t=this.localTransform;if(this._localID!==this._currentLocalID&&(t.a=this._cx*this.scale.x,t.b=this._sx*this.scale.x,t.c=this._cy*this.scale.y,t.d=this._sy*this.scale.y,t.tx=this.position.x-(this.pivot.x*t.a+this.pivot.y*t.c),t.ty=this.position.y-(this.pivot.x*t.b+this.pivot.y*t.d),this._currentLocalID=this._localID,this._parentID=-1),this._parentID!==r._worldID){const e=r.worldTransform,i=this.worldTransform;i.a=t.a*e.a+t.b*e.c,i.b=t.a*e.b+t.b*e.d,i.c=t.c*e.a+t.d*e.c,i.d=t.c*e.b+t.d*e.d,i.tx=t.tx*e.a+t.ty*e.c+e.tx,i.ty=t.tx*e.b+t.ty*e.d+e.ty,this._parentID=r._worldID,this._worldID++}}setFromMatrix(r){r.decompose(this),this._localID++}get rotation(){return this._rotation}set rotation(r){this._rotation!==r&&(this._rotation=r,this.updateSkew())}};Fa.IDENTITY=new Fa;let Ph=Fa;Ph.prototype.toString=function(){return`[@pixi/math:Transform position=(${this.position.x}, ${this.position.y}) rotation=${this.rotation} scale=(${this.scale.x}, ${this.scale.y}) skew=(${this.skew.x}, ${this.skew.y}) ]`};var zx=`varying vec2 vTextureCoord; uniform sampler2D uSampler; void main(void){ gl_FragColor *= texture2D(uSampler, vTextureCoord); -}`,K_=`attribute vec2 aVertexPosition; +}`,Vx=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -39,7 +39,7 @@ void main(void){ gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; } -`;function ac(r,t,e){const i=r.createShader(t);return r.shaderSource(i,e),r.compileShader(i),i}function mo(r){const t=new Array(r);for(let e=0;er.type==="float"&&r.size===1&&!r.isArray,code:r=>` +`;function Pc(r,t,e){const i=r.createShader(t);return r.shaderSource(i,e),r.compileShader(i),i}function Po(r){const t=new Array(r);for(let e=0;er.type==="float"&&r.size===1&&!r.isArray,code:r=>` if(uv["${r}"] !== ud["${r}"].value) { ud["${r}"].value = uv["${r}"] @@ -159,7 +159,7 @@ void main(void){ cv[3] = v[3]; gl.uniform4f(ud["${r}"].location, v[0], v[1], v[2], v[3]) - }`}],Z_={float:` + }`}],Xx={float:` if (cv !== v) { cu.value = v; @@ -295,7 +295,7 @@ void main(void){ cu.value = v; gl.uniform1i(location, v); - }`},Q_={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function J_(r,t){var i;const e=[` + }`},Wx={float:"gl.uniform1fv(location, v)",vec2:"gl.uniform2fv(location, v)",vec3:"gl.uniform3fv(location, v)",vec4:"gl.uniform4fv(location, v)",mat4:"gl.uniformMatrix4fv(location, false, v)",mat3:"gl.uniformMatrix3fv(location, false, v)",mat2:"gl.uniformMatrix2fv(location, false, v)",int:"gl.uniform1iv(location, v)",ivec2:"gl.uniform2iv(location, v)",ivec3:"gl.uniform3iv(location, v)",ivec4:"gl.uniform4iv(location, v)",uint:"gl.uniform1uiv(location, v)",uvec2:"gl.uniform2uiv(location, v)",uvec3:"gl.uniform3uiv(location, v)",uvec4:"gl.uniform4uiv(location, v)",bool:"gl.uniform1iv(location, v)",bvec2:"gl.uniform2iv(location, v)",bvec3:"gl.uniform3iv(location, v)",bvec4:"gl.uniform4iv(location, v)",sampler2D:"gl.uniform1iv(location, v)",samplerCube:"gl.uniform1iv(location, v)",sampler2DArray:"gl.uniform1iv(location, v)"};function jx(r,t){var i;const e=[` var v = null; var cv = null; var cu = null; @@ -305,18 +305,18 @@ void main(void){ renderer.shader.syncUniformBufferGroup(uv.${n}, '${n}'); `):e.push(` renderer.shader.syncUniformGroup(uv.${n}, syncData); - `));continue}const o=r.uniforms[n];let a=!1;for(let h=0;h=vr.WEBGL2&&(t=r.getContext("webgl2",{})),t||(t=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),Tr=t}return Tr}let cn;function ex(){if(!cn){cn=Nt.MEDIUM;const r=tx();r&&r.getShaderPrecisionFormat&&(cn=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?Nt.HIGH:Nt.MEDIUM)}return cn}function hc(r,t){const e=r.getShaderSource(t).split(` +`))}const Od={};let wr=Od;function Yx(){if(wr===Od||wr!=null&&wr.isContextLost()){const r=$.ADAPTER.createCanvas();let t;$.PREFER_ENV>=yr.WEBGL2&&(t=r.getContext("webgl2",{})),t||(t=r.getContext("webgl",{})||r.getContext("experimental-webgl",{}),t?t.getExtension("WEBGL_draw_buffers"):t=null),wr=t}return wr}let un;function qx(){if(!un){un=Nt.MEDIUM;const r=Yx();r&&r.getShaderPrecisionFormat&&(un=r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision?Nt.HIGH:Nt.MEDIUM)}return un}function Rc(r,t){const e=r.getShaderSource(t).split(` `).map((l,c)=>`${c}: ${l}`),i=r.getShaderInfoLog(t),n=i.split(` `),s={},o=n.map(l=>parseFloat(l.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(l=>l&&!s[l]?(s[l]=!0,!0):!1),a=[""];o.forEach(l=>{e[l-1]=`%c${e[l-1]}%c`,a.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const h=e.join(` -`);a[0]=h,console.error(i),console.groupCollapsed("click to view full shader code"),console.warn(...a),console.groupEnd()}function rx(r,t,e,i){r.getProgramParameter(t,r.LINK_STATUS)||(r.getShaderParameter(e,r.COMPILE_STATUS)||hc(r,e),r.getShaderParameter(i,r.COMPILE_STATUS)||hc(r,i),console.error("PixiJS Error: Could not initialize shader."),r.getProgramInfoLog(t)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",r.getProgramInfoLog(t)))}const ix={float:1,vec2:2,vec3:3,vec4:4,int:1,ivec2:2,ivec3:3,ivec4:4,uint:1,uvec2:2,uvec3:3,uvec4:4,bool:1,bvec2:2,bvec3:3,bvec4:4,mat2:4,mat3:9,mat4:16,sampler2D:1};function cd(r){return ix[r]}let un=null;const lc={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"};function ud(r,t){if(!un){const e=Object.keys(lc);un={};for(let i=0;i0&&(e+=` else `),ithis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}buildTexturesAndDrawCalls(){const{_bufferedTextures:t,maxTextures:e}=this,i=Ht._textureArrayPool,n=this.renderer.batch,s=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++K._globalBatch,h=0,l=i[0],c=0;n.copyBoundTextures(s,e);for(let u=0;u=e&&(n.boundArray(l,s,a,e),this.buildDrawCalls(l,c,u),c=u,l=i[++h],++a),d._batchEnabled=a,d.touched=o,l.elements[l.count++]=d)}l.count>0&&(n.boundArray(l,s,a,e),this.buildDrawCalls(l,c,this._bufferSize),++h,++a);for(let u=0;u0);for(let m=0;mthis.size&&this.flush(),this._vertexCount+=t.vertexData.length/2,this._indexCount+=t.indices.length,this._bufferedTextures[this._bufferSize]=t._texture.baseTexture,this._bufferedElements[this._bufferSize++]=t)}buildTexturesAndDrawCalls(){const{_bufferedTextures:t,maxTextures:e}=this,i=Ht._textureArrayPool,n=this.renderer.batch,s=this._tempBoundTextures,o=this.renderer.textureGC.count;let a=++K._globalBatch,h=0,l=i[0],c=0;n.copyBoundTextures(s,e);for(let u=0;u=e&&(n.boundArray(l,s,a,e),this.buildDrawCalls(l,c,u),c=u,l=i[++h],++a),d._batchEnabled=a,d.touched=o,l.elements[l.count++]=d)}l.count>0&&(n.boundArray(l,s,a,e),this.buildDrawCalls(l,c,this._bufferSize),++h,++a);for(let u=0;u0);for(let m=0;m=0;--n)t[n]=i[n]||null,t[n]&&(t[n]._batchLocation=n)}boundArray(t,e,i,n){const{elements:s,ids:o,count:a}=t;let h=0;for(let l=0;l=0&&u=vr.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,t.removeEventListener!==void 0&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}ls.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},ls.extension={type:U.RendererSystem,name:"context"};z.add(ls);class wa{constructor(t,e){if(this.width=Math.round(t),this.height=Math.round(e),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new jt("disposeFramebuffer"),this.multisample=pt.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new K(null,{scaleMode:he.NEAREST,resolution:1,mipmap:de.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new K(null,{scaleMode:he.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:de.OFF,format:B.DEPTH_COMPONENT,type:X.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,e){if(t=Math.round(t),e=Math.round(e),!t||!e)throw new Error("Framebuffer width and height must not be zero");if(!(t===this.width&&e===this.height)){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(let i=0;i{const n=this.source;this.url=n.src;const s=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.update(),this._load=null,this.createBitmap?e(this.process()):e(this))};n.complete&&n.src?s():(n.onload=s,n.onerror=o=>{i(o),this.onError.emit(o)})}),this._load)}process(){const t=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,i=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:i?"cors":"no-cors"}).then(n=>n.blob()).then(n=>e(n,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Ct.UNPACK?"premultiply":"none"})).then(n=>this.destroyed?Promise.reject():(this.bitmap=n,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,e,i){if(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,i,this.bitmap),!this.preserveBitmap){let n=!0;const s=e._glTextures;for(const o in s){const a=s[o];if(a!==i&&a.dirtyId!==e.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&(typeof t=="string"||t instanceof HTMLImageElement)}}class mh{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,e,i){const n=e.width,s=e.height;if(i){const o=t.width/2/n,a=t.height/2/s,h=t.x/n+o,l=t.y/s+a;i=st.add(i,st.NW),this.x0=h+o*st.uX(i),this.y0=l+a*st.uY(i),i=st.add(i,2),this.x1=h+o*st.uX(i),this.y1=l+a*st.uY(i),i=st.add(i,2),this.x2=h+o*st.uX(i),this.y2=l+a*st.uY(i),i=st.add(i,2),this.x3=h+o*st.uX(i),this.y3=l+a*st.uY(i)}else this.x0=t.x/n,this.y0=t.y/s,this.x1=(t.x+t.width)/n,this.y1=t.y/s,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/s,this.x3=t.x/n,this.y3=(t.y+t.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}mh.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const dc=new mh;function fn(r){r.destroy=function(){},r.on=function(){},r.once=function(){},r.emit=function(){}}class k extends Hi{constructor(t,e,i,n,s,o,a){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new Y(0,0,1,1)),t instanceof k&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=n,this.valid=!1,this.destroyed=!1,this._uvs=dc,this.uvMatrix=null,this.orig=i||e,this._rotate=Number(s||0),s===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new Z(o.x,o.y):new Z(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:e}=this.baseTexture;e!=null&&e.url&&ee[e.url]&&k.removeFromCache(e.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,k.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var n;const t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),i=new k(this.baseTexture,!this.noFrame&&t,e,(n=this.trim)==null?void 0:n.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=t),i}updateUvs(){this._uvs===dc&&(this._uvs=new mh),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},i=$.STRICT_TEXTURE_CACHE){const n=typeof t=="string";let s=null;if(n)s=t;else if(t instanceof K){if(!t.cacheId){const a=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t.cacheId=`${a}-${gr()}`,K.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){const a=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${a}_${gr()}`}s=t._pixiId}let o=ee[s];if(n&&i&&!o)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!o&&!(t instanceof K)?(e.resolution||(e.resolution=Ce(t)),o=new k(new K(t,e)),o.baseTexture.cacheId=s,K.addToCache(o.baseTexture,s),k.addToCache(o,s)):!o&&t instanceof K&&(o=new k(t),k.addToCache(o,s)),o}static fromURL(t,e){const i=Object.assign({autoLoad:!1},e==null?void 0:e.resourceOptions),n=k.from(t,Object.assign({resourceOptions:i},e),!1),s=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):s.load().then(()=>Promise.resolve(n))}static fromBuffer(t,e,i,n){return new k(K.fromBuffer(t,e,i,n))}static fromLoader(t,e,i,n){const s=new K(t,Object.assign({scaleMode:K.defaultOptions.scaleMode,resolution:Ce(e)},n)),{resource:o}=s;o instanceof pd&&(o.url=e);const a=new k(s);return i||(i=e),K.addToCache(a.baseTexture,i),k.addToCache(a,i),i!==e&&(K.addToCache(a.baseTexture,e),k.addToCache(a,e)),a.baseTexture.valid?Promise.resolve(a):new Promise(h=>{a.baseTexture.once("loaded",()=>h(a))})}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),ee[e]&&ee[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),ee[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=ee[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete ee[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;ethis.baseTexture.width,a=i+s>this.baseTexture.height;if(o||a){const h=o&&a?"and":"or",l=`X: ${e} + ${n} = ${e+n} > ${this.baseTexture.width}`,c=`Y: ${i} + ${s} = ${i+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${h} ${c}`)}this.valid=n&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return k._EMPTY||(k._EMPTY=new k(new K),fn(k._EMPTY),fn(k._EMPTY.baseTexture)),k._EMPTY}static get WHITE(){if(!k._WHITE){const t=$.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),k._WHITE=new k(K.from(t)),fn(k._WHITE),fn(k._WHITE.baseTexture)}return k._WHITE}}class _r extends k{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,i=!0){const n=this.baseTexture.resolution,s=Math.round(t*n)/n,o=Math.round(e*n)/n;this.valid=s>0&&o>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=o,i&&this.baseTexture.resize(s,o),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new _r(new fd(t))}}class md{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,i=pt.NONE){const n=new fd(Object.assign({width:t,height:e,resolution:1,multisample:i},this.textureOptions));return new _r(n)}getOptimalTexture(t,e,i=1,n=pt.NONE){let s;t=Math.max(Math.ceil(t*i-1e-6),1),e=Math.max(Math.ceil(e*i-1e-6),1),!this.enableFullScreen||t!==this._pixelsWidth||e!==this._pixelsHeight?(t=ss(t),e=ss(e),s=((t&65535)<<16|e&65535)>>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);let o=this.texturePool[s].pop();return o||(o=this.createTexture(t,e,n)),o.filterPoolKey=s,o.setResolution(i),o}getFilterTexture(t,e,i){const n=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||pt.NONE);return n.filterFrame=t.filterFrame,n}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=t!==!1,t)for(const e in this.texturePool){const i=this.texturePool[e];if(i)for(let n=0;n0&&t.height>0;for(const e in this.texturePool){if(!(Number(e)<0))continue;const i=this.texturePool[e];if(i)for(let n=0;n1&&(c=this.getOptimalFilterTexture(l.width,l.height,e.resolution),c.filterFrame=l.filterFrame),i[u].apply(this,l,c,se.CLEAR,e);const d=l;l=c,c=d}i[u].apply(this,l,h.renderTexture,se.BLEND,e),u>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=se.CLEAR){const{renderTexture:i,state:n}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t==null?void 0:t.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,i.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=n.stateId&1||this.forceClear;(e===se.CLEAR||e===se.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,i,n){const s=this.renderer;s.state.set(t.state),this.bindAndClear(i,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(ae.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(ae.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:i,destinationFrame:n}=this.activeState,{orig:s}=e._texture,o=t.set(n.width,0,0,n.height,i.x,i.y),a=e.worldTransform.copyTo(ot.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/s.width,1/s.height),o.translate(e.anchor.x,e.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,i=1,n=pt.NONE){return this.texturePool.getOptimalTexture(t,e,i,n)}getFilterTexture(t,e,i){if(typeof t=="number"){const s=t;t=e,e=s}t=t||this.activeState.renderTexture;const n=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||pt.NONE);return n.filterFrame=t.filterFrame,n}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const i=pn[0],n=pn[1],s=pn[2],o=pn[3];i.set(e.left,e.top),n.set(e.left,e.bottom),s.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(i,i),t.apply(n,n),t.apply(s,s),t.apply(o,o);const a=Math.min(i.x,n.x,s.x,o.x),h=Math.min(i.y,n.y,s.y,o.y),l=Math.max(i.x,n.x,s.x,o.x),c=Math.max(i.y,n.y,s.y,o.y);e.x=a,e.y=h,e.width=l-a,e.height=c-h}roundFrame(t,e,i,n,s){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(s){const{a:o,b:a,c:h,d:l}=s;if((Math.abs(a)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(l)>1e-4))return}s=s?go.copyFrom(s):go.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}}}yd.extension={type:U.RendererSystem,name:"filter"};z.add(yd);class gx{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=pt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const yx=new Y;class vd{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new wa(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Y,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;$.PREFER_ENV===vr.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=n=>e.drawBuffersWEBGL(n):(this.hasMRT=!1,t.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,i=0){const{gl:n}=this;if(t){const s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=i),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let o=0;o>i,a=e.height>>i,h=o/e.width;this.setViewport(e.x*h,e.y*h,o,a)}else{const o=t.width>>i,a=t.height>>i;this.setViewport(0,0,o,a)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,e,i,n){const s=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==t||s.y!==e)&&(s.x=t,s.y=e,s.width=i,s.height=n,this.gl.viewport(t,e,i,n))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,e,i,n,s=qo.COLOR|qo.DEPTH){const{gl:o}=this;o.clearColor(t,e,i,n),o.clear(s)}initFramebuffer(t){const{gl:e}=this,i=new gx(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i}resizeFramebuffer(t){const{gl:e}=this,i=t.glFramebuffers[this.CONTEXT_UID];if(i.stencil){e.bindRenderbuffer(e.RENDERBUFFER,i.stencil);let o;this.renderer.context.webGLVersion===1?o=e.DEPTH_STENCIL:t.depth&&t.stencil?o=e.DEPTH24_STENCIL8:t.depth?o=e.DEPTH_COMPONENT24:o=e.STENCIL_INDEX8,i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,o,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,o,t.width,t.height)}const n=t.colorTextures;let s=n.length;e.drawBuffers||(s=Math.min(s,1));for(let o=0;o1&&this.canMultisampleFramebuffer(t)?n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer():n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));const a=[];for(let h=0;h1&&i.drawBuffers(a),t.depthTexture&&this.writeDepthTexture){const h=t.depthTexture;this.renderer.texture.bind(h,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,e)}if((t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)){n.stencil=n.stencil||i.createRenderbuffer();let h,l;this.renderer.context.webGLVersion===1?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH_STENCIL):t.depth&&t.stencil?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH24_STENCIL8):t.depth?(h=i.DEPTH_ATTACHMENT,l=i.DEPTH_COMPONENT24):(h=i.STENCIL_ATTACHMENT,l=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,l,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,l,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,h,i.RENDERBUFFER,n.stencil)}else n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)}canMultisampleFramebuffer(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let i=pt.NONE;if(t<=1||e===null)return i;for(let n=0;n=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),e||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;ii.createVertexArrayOES(),t.bindVertexArray=n=>i.bindVertexArrayOES(n),t.deleteVertexArray=n=>i.deleteVertexArrayOES(n)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(e.webGLVersion!==2){const i=t.getExtension("ANGLE_instanced_arrays");i?(t.vertexAttribDivisor=(n,s)=>i.vertexAttribDivisorANGLE(n,s),t.drawElementsInstanced=(n,s,o,a,h)=>i.drawElementsInstancedANGLE(n,s,o,a,h),t.drawArraysInstanced=(n,s,o,a)=>i.drawArraysInstancedANGLE(n,s,o,a)):this.hasInstance=!1}this.canUseUInt32ElementIndex=e.webGLVersion===2||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:i}=this;let n=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;n||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=n={},s=!0);const o=n[e.program.id]||this.initGeometryVao(t,e,s);this._activeGeometry=t,this._activeVao!==o&&(this._activeVao=o,this.hasVao?i.bindVertexArray(o):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let i=0;i"u"?.5:e,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,e){e===void 0&&(e=t);const i=this.mapCoord;for(let n=0;n=0;--n)t[n]=i[n]||null,t[n]&&(t[n]._batchLocation=n)}boundArray(t,e,i,n){const{elements:s,ids:o,count:a}=t;let h=0;for(let l=0;l=0&&u=yr.WEBGL2&&(i=t.getContext("webgl2",e)),i)this.webGLVersion=2;else if(this.webGLVersion=1,i=t.getContext("webgl",e)||t.getContext("experimental-webgl",e),!i)throw new Error("This browser does not support WebGL. Try using the canvas renderer");return this.gl=i,this.getExtensions(),this.gl}getExtensions(){const{gl:t}=this,e={loseContext:t.getExtension("WEBGL_lose_context"),anisotropicFiltering:t.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),s3tc:t.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:t.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:t.getExtension("WEBGL_compressed_texture_etc"),etc1:t.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:t.getExtension("WEBGL_compressed_texture_atc"),astc:t.getExtension("WEBGL_compressed_texture_astc")};this.webGLVersion===1?Object.assign(this.extensions,e,{drawBuffers:t.getExtension("WEBGL_draw_buffers"),depthTexture:t.getExtension("WEBGL_depth_texture"),vertexArrayObject:t.getExtension("OES_vertex_array_object")||t.getExtension("MOZ_OES_vertex_array_object")||t.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:t.getExtension("OES_element_index_uint"),floatTexture:t.getExtension("OES_texture_float"),floatTextureLinear:t.getExtension("OES_texture_float_linear"),textureHalfFloat:t.getExtension("OES_texture_half_float"),textureHalfFloatLinear:t.getExtension("OES_texture_half_float_linear")}):this.webGLVersion===2&&Object.assign(this.extensions,e,{colorBufferFloat:t.getExtension("EXT_color_buffer_float")})}handleContextLost(t){t.preventDefault(),setTimeout(()=>{this.gl.isContextLost()&&this.extensions.loseContext&&this.extensions.loseContext.restoreContext()},0)}handleContextRestored(){this.renderer.runners.contextChange.emit(this.gl)}destroy(){const t=this.renderer.view;this.renderer=null,t.removeEventListener!==void 0&&(t.removeEventListener("webglcontextlost",this.handleContextLost),t.removeEventListener("webglcontextrestored",this.handleContextRestored)),this.gl.useProgram(null),this.extensions.loseContext&&this.extensions.loseContext.loseContext()}postrender(){this.renderer.objectRenderer.renderingToScreen&&this.gl.flush()}validateContext(t){const e=t.getContextAttributes(),i="WebGL2RenderingContext"in globalThis&&t instanceof globalThis.WebGL2RenderingContext;i&&(this.webGLVersion=2),e&&!e.stencil&&console.warn("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const n=i||!!t.getExtension("OES_element_index_uint");this.supports.uint32Indices=n,n||console.warn("Provided WebGL context does not support 32 index buffer, complex graphics may not render correctly")}}us.defaultOptions={context:null,antialias:!1,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:"default"},us.extension={type:U.RendererSystem,name:"context"};z.add(us);class Oa{constructor(t,e){if(this.width=Math.round(t),this.height=Math.round(e),!this.width||!this.height)throw new Error("Framebuffer width or height is zero");this.stencil=!1,this.depth=!1,this.dirtyId=0,this.dirtyFormat=0,this.dirtySize=0,this.depthTexture=null,this.colorTextures=[],this.glFramebuffers={},this.disposeRunner=new jt("disposeFramebuffer"),this.multisample=pt.NONE}get colorTexture(){return this.colorTextures[0]}addColorTexture(t=0,e){return this.colorTextures[t]=e||new K(null,{scaleMode:he.NEAREST,resolution:1,mipmap:de.OFF,width:this.width,height:this.height}),this.dirtyId++,this.dirtyFormat++,this}addDepthTexture(t){return this.depthTexture=t||new K(null,{scaleMode:he.NEAREST,resolution:1,width:this.width,height:this.height,mipmap:de.OFF,format:B.DEPTH_COMPONENT,type:X.UNSIGNED_SHORT}),this.dirtyId++,this.dirtyFormat++,this}enableDepth(){return this.depth=!0,this.dirtyId++,this.dirtyFormat++,this}enableStencil(){return this.stencil=!0,this.dirtyId++,this.dirtyFormat++,this}resize(t,e){if(t=Math.round(t),e=Math.round(e),!t||!e)throw new Error("Framebuffer width and height must not be zero");if(!(t===this.width&&e===this.height)){this.width=t,this.height=e,this.dirtyId++,this.dirtySize++;for(let i=0;i{const n=this.source;this.url=n.src;const s=()=>{this.destroyed||(n.onload=null,n.onerror=null,this.update(),this._load=null,this.createBitmap?e(this.process()):e(this))};n.complete&&n.src?s():(n.onload=s,n.onerror=o=>{i(o),this.onError.emit(o)})}),this._load)}process(){const t=this.source;if(this._process!==null)return this._process;if(this.bitmap!==null||!globalThis.createImageBitmap)return Promise.resolve(this);const e=globalThis.createImageBitmap,i=!t.crossOrigin||t.crossOrigin==="anonymous";return this._process=fetch(t.src,{mode:i?"cors":"no-cors"}).then(n=>n.blob()).then(n=>e(n,0,0,t.width,t.height,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Ct.UNPACK?"premultiply":"none"})).then(n=>this.destroyed?Promise.reject():(this.bitmap=n,this.update(),this._process=null,Promise.resolve(this))),this._process}upload(t,e,i){if(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),!this.createBitmap)return super.upload(t,e,i);if(!this.bitmap&&(this.process(),!this.bitmap))return!1;if(super.upload(t,e,i,this.bitmap),!this.preserveBitmap){let n=!0;const s=e._glTextures;for(const o in s){const a=s[o];if(a!==i&&a.dirtyId!==e.dirtyId){n=!1;break}}n&&(this.bitmap.close&&this.bitmap.close(),this.bitmap=null)}return!0}dispose(){this.source.onload=null,this.source.onerror=null,super.dispose(),this.bitmap&&(this.bitmap.close(),this.bitmap=null),this._process=null,this._load=null}static test(t){return typeof HTMLImageElement<"u"&&(typeof t=="string"||t instanceof HTMLImageElement)}}class Rh{constructor(){this.x0=0,this.y0=0,this.x1=1,this.y1=0,this.x2=1,this.y2=1,this.x3=0,this.y3=1,this.uvsFloat32=new Float32Array(8)}set(t,e,i){const n=e.width,s=e.height;if(i){const o=t.width/2/n,a=t.height/2/s,h=t.x/n+o,l=t.y/s+a;i=st.add(i,st.NW),this.x0=h+o*st.uX(i),this.y0=l+a*st.uY(i),i=st.add(i,2),this.x1=h+o*st.uX(i),this.y1=l+a*st.uY(i),i=st.add(i,2),this.x2=h+o*st.uX(i),this.y2=l+a*st.uY(i),i=st.add(i,2),this.x3=h+o*st.uX(i),this.y3=l+a*st.uY(i)}else this.x0=t.x/n,this.y0=t.y/s,this.x1=(t.x+t.width)/n,this.y1=t.y/s,this.x2=(t.x+t.width)/n,this.y2=(t.y+t.height)/s,this.x3=t.x/n,this.y3=(t.y+t.height)/s;this.uvsFloat32[0]=this.x0,this.uvsFloat32[1]=this.y0,this.uvsFloat32[2]=this.x1,this.uvsFloat32[3]=this.y1,this.uvsFloat32[4]=this.x2,this.uvsFloat32[5]=this.y2,this.uvsFloat32[6]=this.x3,this.uvsFloat32[7]=this.y3}}Rh.prototype.toString=function(){return`[@pixi/core:TextureUvs x0=${this.x0} y0=${this.y0} x1=${this.x1} y1=${this.y1} x2=${this.x2} y2=${this.y2} x3=${this.x3} y3=${this.y3}]`};const Bc=new Rh;function pn(r){r.destroy=function(){},r.on=function(){},r.once=function(){},r.emit=function(){}}class k extends Gi{constructor(t,e,i,n,s,o,a){if(super(),this.noFrame=!1,e||(this.noFrame=!0,e=new Y(0,0,1,1)),t instanceof k&&(t=t.baseTexture),this.baseTexture=t,this._frame=e,this.trim=n,this.valid=!1,this.destroyed=!1,this._uvs=Bc,this.uvMatrix=null,this.orig=i||e,this._rotate=Number(s||0),s===!0)this._rotate=2;else if(this._rotate%2!==0)throw new Error("attempt to use diamond-shaped UVs. If you are sure, set rotation manually");this.defaultAnchor=o?new Z(o.x,o.y):new Z(0,0),this.defaultBorders=a,this._updateID=0,this.textureCacheIds=[],t.valid?this.noFrame?t.valid&&this.onBaseTextureUpdated(t):this.frame=e:t.once("loaded",this.onBaseTextureUpdated,this),this.noFrame&&t.on("update",this.onBaseTextureUpdated,this)}update(){this.baseTexture.resource&&this.baseTexture.resource.update()}onBaseTextureUpdated(t){if(this.noFrame){if(!this.baseTexture.valid)return;this._frame.width=t.width,this._frame.height=t.height,this.valid=!0,this.updateUvs()}else this.frame=this._frame;this.emit("update",this)}destroy(t){if(this.baseTexture){if(t){const{resource:e}=this.baseTexture;e!=null&&e.url&&ee[e.url]&&k.removeFromCache(e.url),this.baseTexture.destroy()}this.baseTexture.off("loaded",this.onBaseTextureUpdated,this),this.baseTexture.off("update",this.onBaseTextureUpdated,this),this.baseTexture=null}this._frame=null,this._uvs=null,this.trim=null,this.orig=null,this.valid=!1,k.removeFromCache(this),this.textureCacheIds=null,this.destroyed=!0,this.emit("destroyed",this),this.removeAllListeners()}clone(){var n;const t=this._frame.clone(),e=this._frame===this.orig?t:this.orig.clone(),i=new k(this.baseTexture,!this.noFrame&&t,e,(n=this.trim)==null?void 0:n.clone(),this.rotate,this.defaultAnchor,this.defaultBorders);return this.noFrame&&(i._frame=t),i}updateUvs(){this._uvs===Bc&&(this._uvs=new Rh),this._uvs.set(this._frame,this.baseTexture,this.rotate),this._updateID++}static from(t,e={},i=$.STRICT_TEXTURE_CACHE){const n=typeof t=="string";let s=null;if(n)s=t;else if(t instanceof K){if(!t.cacheId){const a=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t.cacheId=`${a}-${mr()}`,K.addToCache(t,t.cacheId)}s=t.cacheId}else{if(!t._pixiId){const a=(e==null?void 0:e.pixiIdPrefix)||"pixiid";t._pixiId=`${a}_${mr()}`}s=t._pixiId}let o=ee[s];if(n&&i&&!o)throw new Error(`The cacheId "${s}" does not exist in TextureCache.`);return!o&&!(t instanceof K)?(e.resolution||(e.resolution=Ce(t)),o=new k(new K(t,e)),o.baseTexture.cacheId=s,K.addToCache(o.baseTexture,s),k.addToCache(o,s)):!o&&t instanceof K&&(o=new k(t),k.addToCache(o,s)),o}static fromURL(t,e){const i=Object.assign({autoLoad:!1},e==null?void 0:e.resourceOptions),n=k.from(t,Object.assign({resourceOptions:i},e),!1),s=n.baseTexture.resource;return n.baseTexture.valid?Promise.resolve(n):s.load().then(()=>Promise.resolve(n))}static fromBuffer(t,e,i,n){return new k(K.fromBuffer(t,e,i,n))}static fromLoader(t,e,i,n){const s=new K(t,Object.assign({scaleMode:K.defaultOptions.scaleMode,resolution:Ce(e)},n)),{resource:o}=s;o instanceof Hd&&(o.url=e);const a=new k(s);return i||(i=e),K.addToCache(a.baseTexture,i),k.addToCache(a,i),i!==e&&(K.addToCache(a.baseTexture,e),k.addToCache(a,e)),a.baseTexture.valid?Promise.resolve(a):new Promise(h=>{a.baseTexture.once("loaded",()=>h(a))})}static addToCache(t,e){e&&(t.textureCacheIds.includes(e)||t.textureCacheIds.push(e),ee[e]&&ee[e]!==t&&console.warn(`Texture added to the cache with an id [${e}] that already had an entry`),ee[e]=t)}static removeFromCache(t){if(typeof t=="string"){const e=ee[t];if(e){const i=e.textureCacheIds.indexOf(t);return i>-1&&e.textureCacheIds.splice(i,1),delete ee[t],e}}else if(t!=null&&t.textureCacheIds){for(let e=0;ethis.baseTexture.width,a=i+s>this.baseTexture.height;if(o||a){const h=o&&a?"and":"or",l=`X: ${e} + ${n} = ${e+n} > ${this.baseTexture.width}`,c=`Y: ${i} + ${s} = ${i+s} > ${this.baseTexture.height}`;throw new Error(`Texture Error: frame does not fit inside the base Texture dimensions: ${l} ${h} ${c}`)}this.valid=n&&s&&this.baseTexture.valid,!this.trim&&!this.rotate&&(this.orig=t),this.valid&&this.updateUvs()}get rotate(){return this._rotate}set rotate(t){this._rotate=t,this.valid&&this.updateUvs()}get width(){return this.orig.width}get height(){return this.orig.height}castToBaseTexture(){return this.baseTexture}static get EMPTY(){return k._EMPTY||(k._EMPTY=new k(new K),pn(k._EMPTY),pn(k._EMPTY.baseTexture)),k._EMPTY}static get WHITE(){if(!k._WHITE){const t=$.ADAPTER.createCanvas(16,16),e=t.getContext("2d");t.width=16,t.height=16,e.fillStyle="white",e.fillRect(0,0,16,16),k._WHITE=new k(K.from(t)),pn(k._WHITE),pn(k._WHITE.baseTexture)}return k._WHITE}}class vr extends k{constructor(t,e){super(t,e),this.valid=!0,this.filterFrame=null,this.filterPoolKey=null,this.updateUvs()}get framebuffer(){return this.baseTexture.framebuffer}get multisample(){return this.framebuffer.multisample}set multisample(t){this.framebuffer.multisample=t}resize(t,e,i=!0){const n=this.baseTexture.resolution,s=Math.round(t*n)/n,o=Math.round(e*n)/n;this.valid=s>0&&o>0,this._frame.width=this.orig.width=s,this._frame.height=this.orig.height=o,i&&this.baseTexture.resize(s,o),this.updateUvs()}setResolution(t){const{baseTexture:e}=this;e.resolution!==t&&(e.setResolution(t),this.resize(e.width,e.height,!1))}static create(t){return new vr(new Gd(t))}}class $d{constructor(t){this.texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this._pixelsWidth=0,this._pixelsHeight=0}createTexture(t,e,i=pt.NONE){const n=new Gd(Object.assign({width:t,height:e,resolution:1,multisample:i},this.textureOptions));return new vr(n)}getOptimalTexture(t,e,i=1,n=pt.NONE){let s;t=Math.max(Math.ceil(t*i-1e-6),1),e=Math.max(Math.ceil(e*i-1e-6),1),!this.enableFullScreen||t!==this._pixelsWidth||e!==this._pixelsHeight?(t=as(t),e=as(e),s=((t&65535)<<16|e&65535)>>>0,n>1&&(s+=n*4294967296)):s=n>1?-n:-1,this.texturePool[s]||(this.texturePool[s]=[]);let o=this.texturePool[s].pop();return o||(o=this.createTexture(t,e,n)),o.filterPoolKey=s,o.setResolution(i),o}getFilterTexture(t,e,i){const n=this.getOptimalTexture(t.width,t.height,e||t.resolution,i||pt.NONE);return n.filterFrame=t.filterFrame,n}returnTexture(t){const e=t.filterPoolKey;t.filterFrame=null,this.texturePool[e].push(t)}returnFilterTexture(t){this.returnTexture(t)}clear(t){if(t=t!==!1,t)for(const e in this.texturePool){const i=this.texturePool[e];if(i)for(let n=0;n0&&t.height>0;for(const e in this.texturePool){if(!(Number(e)<0))continue;const i=this.texturePool[e];if(i)for(let n=0;n1&&(c=this.getOptimalFilterTexture(l.width,l.height,e.resolution),c.filterFrame=l.filterFrame),i[u].apply(this,l,c,se.CLEAR,e);const d=l;l=c,c=d}i[u].apply(this,l,h.renderTexture,se.BLEND,e),u>1&&e.multisample>1&&this.returnFilterTexture(e.renderTexture),this.returnFilterTexture(l),this.returnFilterTexture(c)}e.clear(),this.statePool.push(e)}bindAndClear(t,e=se.CLEAR){const{renderTexture:i,state:n}=this.renderer;if(t===this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?this.renderer.projection.transform=this.activeState.transform:this.renderer.projection.transform=null,t==null?void 0:t.filterFrame){const o=this.tempRect;o.x=0,o.y=0,o.width=t.filterFrame.width,o.height=t.filterFrame.height,i.bind(t,t.filterFrame,o)}else t!==this.defaultFilterStack[this.defaultFilterStack.length-1].renderTexture?i.bind(t):this.renderer.renderTexture.bind(t,this.activeState.bindingSourceFrame,this.activeState.bindingDestinationFrame);const s=n.stateId&1||this.forceClear;(e===se.CLEAR||e===se.BLIT&&s)&&this.renderer.framebuffer.clear(0,0,0,0)}applyFilter(t,e,i,n){const s=this.renderer;s.state.set(t.state),this.bindAndClear(i,n),t.uniforms.uSampler=e,t.uniforms.filterGlobals=this.globalUniforms,s.shader.bind(t),t.legacy=!!t.program.attributeData.aTextureCoord,t.legacy?(this.quadUv.map(e._frame,e.filterFrame),s.geometry.bind(this.quadUv),s.geometry.draw(ae.TRIANGLES)):(s.geometry.bind(this.quad),s.geometry.draw(ae.TRIANGLE_STRIP))}calculateSpriteMatrix(t,e){const{sourceFrame:i,destinationFrame:n}=this.activeState,{orig:s}=e._texture,o=t.set(n.width,0,0,n.height,i.x,i.y),a=e.worldTransform.copyTo(ot.TEMP_MATRIX);return a.invert(),o.prepend(a),o.scale(1/s.width,1/s.height),o.translate(e.anchor.x,e.anchor.y),o}destroy(){this.renderer=null,this.texturePool.clear(!1)}getOptimalFilterTexture(t,e,i=1,n=pt.NONE){return this.texturePool.getOptimalTexture(t,e,i,n)}getFilterTexture(t,e,i){if(typeof t=="number"){const s=t;t=e,e=s}t=t||this.activeState.renderTexture;const n=this.texturePool.getOptimalTexture(t.width,t.height,e||t.resolution,i||pt.NONE);return n.filterFrame=t.filterFrame,n}returnFilterTexture(t){this.texturePool.returnTexture(t)}emptyPool(){this.texturePool.clear(!0)}resize(){this.texturePool.setScreenSize(this.renderer.view)}transformAABB(t,e){const i=mn[0],n=mn[1],s=mn[2],o=mn[3];i.set(e.left,e.top),n.set(e.left,e.bottom),s.set(e.right,e.top),o.set(e.right,e.bottom),t.apply(i,i),t.apply(n,n),t.apply(s,s),t.apply(o,o);const a=Math.min(i.x,n.x,s.x,o.x),h=Math.min(i.y,n.y,s.y,o.y),l=Math.max(i.x,n.x,s.x,o.x),c=Math.max(i.y,n.y,s.y,o.y);e.x=a,e.y=h,e.width=l-a,e.height=c-h}roundFrame(t,e,i,n,s){if(!(t.width<=0||t.height<=0||i.width<=0||i.height<=0)){if(s){const{a:o,b:a,c:h,d:l}=s;if((Math.abs(a)>1e-4||Math.abs(h)>1e-4)&&(Math.abs(o)>1e-4||Math.abs(l)>1e-4))return}s=s?Ro.copyFrom(s):Ro.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.transformAABB(s,t),t.ceil(e),this.transformAABB(s.invert(),t)}}}Vd.extension={type:U.RendererSystem,name:"filter"};z.add(Vd);class cb{constructor(t){this.framebuffer=t,this.stencil=null,this.dirtyId=-1,this.dirtyFormat=-1,this.dirtySize=-1,this.multisample=pt.NONE,this.msaaBuffer=null,this.blitFramebuffer=null,this.mipLevel=0}}const ub=new Y;class Xd{constructor(t){this.renderer=t,this.managedFramebuffers=[],this.unknownFramebuffer=new Oa(10,10),this.msaaSamples=null}contextChange(){this.disposeAll(!0);const t=this.gl=this.renderer.gl;if(this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.current=this.unknownFramebuffer,this.viewport=new Y,this.hasMRT=!0,this.writeDepthTexture=!0,this.renderer.context.webGLVersion===1){let e=this.renderer.context.extensions.drawBuffers,i=this.renderer.context.extensions.depthTexture;$.PREFER_ENV===yr.WEBGL_LEGACY&&(e=null,i=null),e?t.drawBuffers=n=>e.drawBuffersWEBGL(n):(this.hasMRT=!1,t.drawBuffers=()=>{}),i||(this.writeDepthTexture=!1)}else this.msaaSamples=t.getInternalformatParameter(t.RENDERBUFFER,t.RGBA8,t.SAMPLES)}bind(t,e,i=0){const{gl:n}=this;if(t){const s=t.glFramebuffers[this.CONTEXT_UID]||this.initFramebuffer(t);this.current!==t&&(this.current=t,n.bindFramebuffer(n.FRAMEBUFFER,s.framebuffer)),s.mipLevel!==i&&(t.dirtyId++,t.dirtyFormat++,s.mipLevel=i),s.dirtyId!==t.dirtyId&&(s.dirtyId=t.dirtyId,s.dirtyFormat!==t.dirtyFormat?(s.dirtyFormat=t.dirtyFormat,s.dirtySize=t.dirtySize,this.updateFramebuffer(t,i)):s.dirtySize!==t.dirtySize&&(s.dirtySize=t.dirtySize,this.resizeFramebuffer(t)));for(let o=0;o>i,a=e.height>>i,h=o/e.width;this.setViewport(e.x*h,e.y*h,o,a)}else{const o=t.width>>i,a=t.height>>i;this.setViewport(0,0,o,a)}}else this.current&&(this.current=null,n.bindFramebuffer(n.FRAMEBUFFER,null)),e?this.setViewport(e.x,e.y,e.width,e.height):this.setViewport(0,0,this.renderer.width,this.renderer.height)}setViewport(t,e,i,n){const s=this.viewport;t=Math.round(t),e=Math.round(e),i=Math.round(i),n=Math.round(n),(s.width!==i||s.height!==n||s.x!==t||s.y!==e)&&(s.x=t,s.y=e,s.width=i,s.height=n,this.gl.viewport(t,e,i,n))}get size(){return this.current?{x:0,y:0,width:this.current.width,height:this.current.height}:{x:0,y:0,width:this.renderer.width,height:this.renderer.height}}clear(t,e,i,n,s=la.COLOR|la.DEPTH){const{gl:o}=this;o.clearColor(t,e,i,n),o.clear(s)}initFramebuffer(t){const{gl:e}=this,i=new cb(e.createFramebuffer());return i.multisample=this.detectSamples(t.multisample),t.glFramebuffers[this.CONTEXT_UID]=i,this.managedFramebuffers.push(t),t.disposeRunner.add(this),i}resizeFramebuffer(t){const{gl:e}=this,i=t.glFramebuffers[this.CONTEXT_UID];if(i.stencil){e.bindRenderbuffer(e.RENDERBUFFER,i.stencil);let o;this.renderer.context.webGLVersion===1?o=e.DEPTH_STENCIL:t.depth&&t.stencil?o=e.DEPTH24_STENCIL8:t.depth?o=e.DEPTH_COMPONENT24:o=e.STENCIL_INDEX8,i.msaaBuffer?e.renderbufferStorageMultisample(e.RENDERBUFFER,i.multisample,o,t.width,t.height):e.renderbufferStorage(e.RENDERBUFFER,o,t.width,t.height)}const n=t.colorTextures;let s=n.length;e.drawBuffers||(s=Math.min(s,1));for(let o=0;o1&&this.canMultisampleFramebuffer(t)?n.msaaBuffer=n.msaaBuffer||i.createRenderbuffer():n.msaaBuffer&&(i.deleteRenderbuffer(n.msaaBuffer),n.msaaBuffer=null,n.blitFramebuffer&&(n.blitFramebuffer.dispose(),n.blitFramebuffer=null));const a=[];for(let h=0;h1&&i.drawBuffers(a),t.depthTexture&&this.writeDepthTexture){const h=t.depthTexture;this.renderer.texture.bind(h,0),i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,h._glTextures[this.CONTEXT_UID].texture,e)}if((t.stencil||t.depth)&&!(t.depthTexture&&this.writeDepthTexture)){n.stencil=n.stencil||i.createRenderbuffer();let h,l;this.renderer.context.webGLVersion===1?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH_STENCIL):t.depth&&t.stencil?(h=i.DEPTH_STENCIL_ATTACHMENT,l=i.DEPTH24_STENCIL8):t.depth?(h=i.DEPTH_ATTACHMENT,l=i.DEPTH_COMPONENT24):(h=i.STENCIL_ATTACHMENT,l=i.STENCIL_INDEX8),i.bindRenderbuffer(i.RENDERBUFFER,n.stencil),n.msaaBuffer?i.renderbufferStorageMultisample(i.RENDERBUFFER,n.multisample,l,t.width,t.height):i.renderbufferStorage(i.RENDERBUFFER,l,t.width,t.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,h,i.RENDERBUFFER,n.stencil)}else n.stencil&&(i.deleteRenderbuffer(n.stencil),n.stencil=null)}canMultisampleFramebuffer(t){return this.renderer.context.webGLVersion!==1&&t.colorTextures.length<=1&&!t.depthTexture}detectSamples(t){const{msaaSamples:e}=this;let i=pt.NONE;if(t<=1||e===null)return i;for(let n=0;n=0&&this.managedFramebuffers.splice(s,1),t.disposeRunner.remove(this),e||(n.deleteFramebuffer(i.framebuffer),i.msaaBuffer&&n.deleteRenderbuffer(i.msaaBuffer),i.stencil&&n.deleteRenderbuffer(i.stencil)),i.blitFramebuffer&&this.disposeFramebuffer(i.blitFramebuffer,e)}disposeAll(t){const e=this.managedFramebuffers;this.managedFramebuffers=[];for(let i=0;ii.createVertexArrayOES(),t.bindVertexArray=n=>i.bindVertexArrayOES(n),t.deleteVertexArray=n=>i.deleteVertexArrayOES(n)):(this.hasVao=!1,t.createVertexArray=()=>null,t.bindVertexArray=()=>null,t.deleteVertexArray=()=>null)}if(e.webGLVersion!==2){const i=t.getExtension("ANGLE_instanced_arrays");i?(t.vertexAttribDivisor=(n,s)=>i.vertexAttribDivisorANGLE(n,s),t.drawElementsInstanced=(n,s,o,a,h)=>i.drawElementsInstancedANGLE(n,s,o,a,h),t.drawArraysInstanced=(n,s,o,a)=>i.drawArraysInstancedANGLE(n,s,o,a)):this.hasInstance=!1}this.canUseUInt32ElementIndex=e.webGLVersion===2||!!e.extensions.uint32ElementIndex}bind(t,e){e=e||this.renderer.shader.shader;const{gl:i}=this;let n=t.glVertexArrayObjects[this.CONTEXT_UID],s=!1;n||(this.managedGeometries[t.id]=t,t.disposeRunner.add(this),t.glVertexArrayObjects[this.CONTEXT_UID]=n={},s=!0);const o=n[e.program.id]||this.initGeometryVao(t,e,s);this._activeGeometry=t,this._activeVao!==o&&(this._activeVao=o,this.hasVao?i.bindVertexArray(o):this.activateVao(t,e.program)),this.updateBuffers()}reset(){this.unbind()}updateBuffers(){const t=this._activeGeometry,e=this.renderer.buffer;for(let i=0;i"u"?.5:e,this.isSimple=!1}get texture(){return this._texture}set texture(t){this._texture=t,this._textureID=-1}multiplyUvs(t,e){e===void 0&&(e=t);const i=this.mapCoord;for(let n=0;n0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}bd.extension={type:U.RendererSystem,name:"mask"};z.add(bd);class wd{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,i=this.getStackLength();this.maskStack=t;const n=this.getStackLength();n!==i&&(n===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const pc=new ot,mc=[],Td=class Bn extends wd{constructor(t){super(t),this.glConst=$.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:i}=t,{renderer:n}=this,s=n.renderTexture,o=i.getBounds(!0,mc.pop()??new Y);this.roundFrameToPixels(o,s.current?s.current.resolution:n.resolution,s.sourceFrame,s.destinationFrame,n.projection.transform),e&&o.fit(e),t._scissorRectLocal=o}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:i,c:n,d:s}=t;return(Math.abs(i)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(s)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||Bn.isMatrixRotated(e.worldTransform)||Bn.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const i=t._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(t,e,i,n,s){Bn.isMatrixRotated(s)||(s=s?pc.copyFrom(s):pc.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.renderer.filter.transformAABB(s,t),t.fit(n),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&mc.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;this.renderer.renderTexture.current?e=t.y:e=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};Td.extension={type:U.RendererSystem,name:"scissor"};let wx=Td;z.add(wx);class Ad extends wd{constructor(t){super(t),this.glConst=$.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:i}=this.renderer,n=t._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;const s=t._colorMask;s!==0&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,n,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,s!==0&&(t._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}pop(t){const e=this.renderer.gl;if(this.getStackLength()===0)e.disable(e.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=i?i._colorMask:15;n!==0&&(i._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,n!==0&&(i._colorMask=n,e.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}Ad.extension={type:U.RendererSystem,name:"stencil"};z.add(Ad);class Ed{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return J("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return J("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return J("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events}}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}Ed.extension={type:[U.RendererSystem,U.CanvasRendererSystem],name:"_plugin"};z.add(Ed);class Sd{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new ot,this.transform=null}update(t,e,i,n){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(t,e,i,n){const s=this.projectionMatrix,o=n?-1:1;s.identity(),s.a=1/e.width*2,s.d=o*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-o-e.y*s.d}setTransform(t){}destroy(){this.renderer=null}}Sd.extension={type:U.RendererSystem,name:"projection"};z.add(Sd);const Tx=new ph,gc=new Y;class Cd{constructor(t){this.renderer=t,this._tempMatrix=new ot}generateTexture(t,e){const{region:i,...n}=e||{},s=(i==null?void 0:i.copyTo(gc))||t.getLocalBounds(gc,!0),o=n.resolution||this.renderer.resolution;s.width=Math.max(s.width,1/o),s.height=Math.max(s.height,1/o),n.width=s.width,n.height=s.height,n.resolution=o,n.multisample??(n.multisample=this.renderer.multisample);const a=_r.create(n);this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const h=t.transform;return t.transform=Tx,this.renderer.render(t,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=h,a}destroy(){}}Cd.extension={type:[U.RendererSystem,U.CanvasRendererSystem],name:"textureGenerator"};z.add(Cd);const Ke=new Y,fi=new Y;class Id{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Y,this.destinationFrame=new Y,this.viewportFrame=new Y}contextChange(){var e;const t=(e=this.renderer)==null?void 0:e.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,e,i){const n=this.renderer;this.current=t;let s,o,a;t?(s=t.baseTexture,a=s.resolution,e||(Ke.width=t.frame.width,Ke.height=t.frame.height,e=Ke),i||(fi.x=t.frame.x,fi.y=t.frame.y,fi.width=e.width,fi.height=e.height,i=fi),o=s.framebuffer):(a=n.resolution,e||(Ke.width=n._view.screen.width,Ke.height=n._view.screen.height,e=Ke),i||(i=Ke,i.width=e.width,i.height=e.height));const h=this.viewportFrame;h.x=i.x*a,h.y=i.y*a,h.width=i.width*a,h.height=i.height*a,t||(h.y=n.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(o,h),this.renderer.projection.update(i,e,a,!o),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)}clear(t,e){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=at.shared.setValue(t||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&n.premultiply(n.alpha);const s=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=s.width!==o.width||s.height!==o.height;if(a){let{x:h,y:l,width:c,height:u}=this.viewportFrame;h=Math.round(h),l=Math.round(l),c=Math.round(c),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,l,c,u)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,e),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}Id.extension={type:U.RendererSystem,name:"renderTexture"};z.add(Id);class Ax{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function Ex(r,t){const e={},i=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES);for(let n=0;nl>c?1:-1);for(let l=0;l0?this.maskStack[this.maskStack.length-1]._colorMask:15;i!==e&&this.renderer.gl.colorMask((i&1)!==0,(i&2)!==0,(i&4)!==0,(i&8)!==0)}destroy(){this.renderer=null}}Yd.extension={type:U.RendererSystem,name:"mask"};z.add(Yd);class qd{constructor(t){this.renderer=t,this.maskStack=[],this.glConst=0}getStackLength(){return this.maskStack.length}setMaskStack(t){const{gl:e}=this.renderer,i=this.getStackLength();this.maskStack=t;const n=this.getStackLength();n!==i&&(n===0?e.disable(this.glConst):(e.enable(this.glConst),this._useCurrent()))}_useCurrent(){}destroy(){this.renderer=null,this.maskStack=null}}const Oc=new ot,Nc=[],Kd=class On extends qd{constructor(t){super(t),this.glConst=$.ADAPTER.getWebGLRenderingContext().SCISSOR_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._scissorCounter:0}calcScissorRect(t){if(t._scissorRectLocal)return;const e=t._scissorRect,{maskObject:i}=t,{renderer:n}=this,s=n.renderTexture,o=i.getBounds(!0,Nc.pop()??new Y);this.roundFrameToPixels(o,s.current?s.current.resolution:n.resolution,s.sourceFrame,s.destinationFrame,n.projection.transform),e&&o.fit(e),t._scissorRectLocal=o}static isMatrixRotated(t){if(!t)return!1;const{a:e,b:i,c:n,d:s}=t;return(Math.abs(i)>1e-4||Math.abs(n)>1e-4)&&(Math.abs(e)>1e-4||Math.abs(s)>1e-4)}testScissor(t){const{maskObject:e}=t;if(!e.isFastRect||!e.isFastRect()||On.isMatrixRotated(e.worldTransform)||On.isMatrixRotated(this.renderer.projection.transform))return!1;this.calcScissorRect(t);const i=t._scissorRectLocal;return i.width>0&&i.height>0}roundFrameToPixels(t,e,i,n,s){On.isMatrixRotated(s)||(s=s?Oc.copyFrom(s):Oc.identity(),s.translate(-i.x,-i.y).scale(n.width/i.width,n.height/i.height).translate(n.x,n.y),this.renderer.filter.transformAABB(s,t),t.fit(n),t.x=Math.round(t.x*e),t.y=Math.round(t.y*e),t.width=Math.round(t.width*e),t.height=Math.round(t.height*e))}push(t){t._scissorRectLocal||this.calcScissorRect(t);const{gl:e}=this.renderer;t._scissorRect||e.enable(e.SCISSOR_TEST),t._scissorCounter++,t._scissorRect=t._scissorRectLocal,this._useCurrent()}pop(t){const{gl:e}=this.renderer;t&&Nc.push(t._scissorRectLocal),this.getStackLength()>0?this._useCurrent():e.disable(e.SCISSOR_TEST)}_useCurrent(){const t=this.maskStack[this.maskStack.length-1]._scissorRect;let e;this.renderer.renderTexture.current?e=t.y:e=this.renderer.height-t.height-t.y,this.renderer.gl.scissor(t.x,e,t.width,t.height)}};Kd.extension={type:U.RendererSystem,name:"scissor"};let gb=Kd;z.add(gb);class Zd extends qd{constructor(t){super(t),this.glConst=$.ADAPTER.getWebGLRenderingContext().STENCIL_TEST}getStackLength(){const t=this.maskStack[this.maskStack.length-1];return t?t._stencilCounter:0}push(t){const e=t.maskObject,{gl:i}=this.renderer,n=t._stencilCounter;n===0&&(this.renderer.framebuffer.forceStencil(),i.clearStencil(0),i.clear(i.STENCIL_BUFFER_BIT),i.enable(i.STENCIL_TEST)),t._stencilCounter++;const s=t._colorMask;s!==0&&(t._colorMask=0,i.colorMask(!1,!1,!1,!1)),i.stencilFunc(i.EQUAL,n,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.INCR),e.renderable=!0,e.render(this.renderer),this.renderer.batch.flush(),e.renderable=!1,s!==0&&(t._colorMask=s,i.colorMask((s&1)!==0,(s&2)!==0,(s&4)!==0,(s&8)!==0)),this._useCurrent()}pop(t){const e=this.renderer.gl;if(this.getStackLength()===0)e.disable(e.STENCIL_TEST);else{const i=this.maskStack.length!==0?this.maskStack[this.maskStack.length-1]:null,n=i?i._colorMask:15;n!==0&&(i._colorMask=0,e.colorMask(!1,!1,!1,!1)),e.stencilOp(e.KEEP,e.KEEP,e.DECR),t.renderable=!0,t.render(this.renderer),this.renderer.batch.flush(),t.renderable=!1,n!==0&&(i._colorMask=n,e.colorMask((n&1)!==0,(n&2)!==0,(n&4)!==0,(n&8)!==0)),this._useCurrent()}}_useCurrent(){const t=this.renderer.gl;t.stencilFunc(t.EQUAL,this.getStackLength(),4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP)}}Zd.extension={type:U.RendererSystem,name:"stencil"};z.add(Zd);class Qd{constructor(t){this.renderer=t,this.plugins={},Object.defineProperties(this.plugins,{extract:{enumerable:!1,get(){return J("7.0.0","renderer.plugins.extract has moved to renderer.extract"),t.extract}},prepare:{enumerable:!1,get(){return J("7.0.0","renderer.plugins.prepare has moved to renderer.prepare"),t.prepare}},interaction:{enumerable:!1,get(){return J("7.0.0","renderer.plugins.interaction has been deprecated, use renderer.events"),t.events}}})}init(){const t=this.rendererPlugins;for(const e in t)this.plugins[e]=new t[e](this.renderer)}destroy(){for(const t in this.plugins)this.plugins[t].destroy(),this.plugins[t]=null}}Qd.extension={type:[U.RendererSystem,U.CanvasRendererSystem],name:"_plugin"};z.add(Qd);class Jd{constructor(t){this.renderer=t,this.destinationFrame=null,this.sourceFrame=null,this.defaultFrame=null,this.projectionMatrix=new ot,this.transform=null}update(t,e,i,n){this.destinationFrame=t||this.destinationFrame||this.defaultFrame,this.sourceFrame=e||this.sourceFrame||t,this.calculateProjection(this.destinationFrame,this.sourceFrame,i,n),this.transform&&this.projectionMatrix.append(this.transform);const s=this.renderer;s.globalUniforms.uniforms.projectionMatrix=this.projectionMatrix,s.globalUniforms.update(),s.shader.shader&&s.shader.syncUniformGroup(s.shader.shader.uniforms.globals)}calculateProjection(t,e,i,n){const s=this.projectionMatrix,o=n?-1:1;s.identity(),s.a=1/e.width*2,s.d=o*(1/e.height*2),s.tx=-1-e.x*s.a,s.ty=-o-e.y*s.d}setTransform(t){}destroy(){this.renderer=null}}Jd.extension={type:U.RendererSystem,name:"projection"};z.add(Jd);const yb=new Ph,kc=new Y;class tf{constructor(t){this.renderer=t,this._tempMatrix=new ot}generateTexture(t,e){const{region:i,...n}=e||{},s=(i==null?void 0:i.copyTo(kc))||t.getLocalBounds(kc,!0),o=n.resolution||this.renderer.resolution;s.width=Math.max(s.width,1/o),s.height=Math.max(s.height,1/o),n.width=s.width,n.height=s.height,n.resolution=o,n.multisample??(n.multisample=this.renderer.multisample);const a=vr.create(n);this._tempMatrix.tx=-s.x,this._tempMatrix.ty=-s.y;const h=t.transform;return t.transform=yb,this.renderer.render(t,{renderTexture:a,transform:this._tempMatrix,skipUpdateTransform:!!t.parent,blit:!0}),t.transform=h,a}destroy(){}}tf.extension={type:[U.RendererSystem,U.CanvasRendererSystem],name:"textureGenerator"};z.add(tf);const Ke=new Y,ui=new Y;class ef{constructor(t){this.renderer=t,this.defaultMaskStack=[],this.current=null,this.sourceFrame=new Y,this.destinationFrame=new Y,this.viewportFrame=new Y}contextChange(){var e;const t=(e=this.renderer)==null?void 0:e.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}bind(t=null,e,i){const n=this.renderer;this.current=t;let s,o,a;t?(s=t.baseTexture,a=s.resolution,e||(Ke.width=t.frame.width,Ke.height=t.frame.height,e=Ke),i||(ui.x=t.frame.x,ui.y=t.frame.y,ui.width=e.width,ui.height=e.height,i=ui),o=s.framebuffer):(a=n.resolution,e||(Ke.width=n._view.screen.width,Ke.height=n._view.screen.height,e=Ke),i||(i=Ke,i.width=e.width,i.height=e.height));const h=this.viewportFrame;h.x=i.x*a,h.y=i.y*a,h.width=i.width*a,h.height=i.height*a,t||(h.y=n.view.height-(h.y+h.height)),h.ceil(),this.renderer.framebuffer.bind(o,h),this.renderer.projection.update(i,e,a,!o),t?this.renderer.mask.setMaskStack(s.maskStack):this.renderer.mask.setMaskStack(this.defaultMaskStack),this.sourceFrame.copyFrom(e),this.destinationFrame.copyFrom(i)}clear(t,e){const i=this.current?this.current.baseTexture.clear:this.renderer.background.backgroundColor,n=at.shared.setValue(t||i);(this.current&&this.current.baseTexture.alphaMode>0||!this.current&&this._rendererPremultipliedAlpha)&&n.premultiply(n.alpha);const s=this.destinationFrame,o=this.current?this.current.baseTexture:this.renderer._view.screen,a=s.width!==o.width||s.height!==o.height;if(a){let{x:h,y:l,width:c,height:u}=this.viewportFrame;h=Math.round(h),l=Math.round(l),c=Math.round(c),u=Math.round(u),this.renderer.gl.enable(this.renderer.gl.SCISSOR_TEST),this.renderer.gl.scissor(h,l,c,u)}this.renderer.framebuffer.clear(n.red,n.green,n.blue,n.alpha,e),a&&this.renderer.scissor.pop()}resize(){this.bind(null)}reset(){this.bind(null)}destroy(){this.renderer=null}}ef.extension={type:U.RendererSystem,name:"renderTexture"};z.add(ef);class vb{constructor(t,e){this.program=t,this.uniformData=e,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBufferBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBufferBindings=null,this.program=null}}function _b(r,t){const e={},i=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES);for(let n=0;nl>c?1:-1);for(let l=0;l({data:s,offset:0,dataLen:0,dirty:0}));let e=0,i=0,n=0;for(let s=0;s1&&(e=Math.max(e,16)*o.data.size),o.dataLen=e,i%e!==0&&i<16){const a=i%e%16;i+=a,n+=a}i+e>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=e,i=e):(o.offset=n,i+=e,n+=e)}return n=Math.ceil(n/16)*16,{uboElements:t,size:n}}function Mx(r,t){const e=[];for(const i in r)t[i]&&e.push(t[i]);return e.sort((i,n)=>i.index-n.index),e}function Fx(r,t){if(!r.autoManage)return{size:0,syncFunc:Ix};const e=Mx(r.uniforms,t),{uboElements:i,size:n}=Rx(e),s=[` + `},rf={float:4,vec2:8,vec3:12,vec4:16,int:4,ivec2:8,ivec3:12,ivec4:16,uint:4,uvec2:8,uvec3:12,uvec4:16,bool:4,bvec2:8,bvec3:12,bvec4:16,mat2:16*2,mat3:16*3,mat4:16*4};function Ab(r){const t=r.map(s=>({data:s,offset:0,dataLen:0,dirty:0}));let e=0,i=0,n=0;for(let s=0;s1&&(e=Math.max(e,16)*o.data.size),o.dataLen=e,i%e!==0&&i<16){const a=i%e%16;i+=a,n+=a}i+e>16?(n=Math.ceil(n/16)*16,o.offset=n,n+=e,i=e):(o.offset=n,i+=e,n+=e)}return n=Math.ceil(n/16)*16,{uboElements:t,size:n}}function Eb(r,t){const e=[];for(const i in r)t[i]&&e.push(t[i]);return e.sort((i,n)=>i.index-n.index),e}function Sb(r,t){if(!r.autoManage)return{size:0,syncFunc:wb};const e=Eb(r.uniforms,t),{uboElements:i,size:n}=Ab(e),s=[` var v = null; var v2 = null; var cv = null; @@ -475,7 +475,7 @@ void main(void) var gl = renderer.gl var index = 0; var data = buffer.data; - `];for(let o=0;o1){const u=cd(a.data.type),d=Math.max(Pd[a.data.type]/16,1),f=u/d,p=(4-f%4)%4;s.push(` + `];for(let o=0;o1){const u=Nd(a.data.type),d=Math.max(rf[a.data.type]/16,1),f=u/d,p=(4-f%4)%4;s.push(` cv = ud.${l}.value; v = uv.${l}; offset = ${a.offset/4}; @@ -491,7 +491,7 @@ void main(void) offset += ${p}; } - `)}else{const u=Px[a.data.type];s.push(` + `)}else{const u=Tb[a.data.type];s.push(` cv = ud.${l}.value; v = uv.${l}; offset = ${a.offset/4}; @@ -499,7 +499,7 @@ void main(void) `)}}return s.push(` renderer.buffer.update(buffer); `),{size:n,syncFunc:new Function("ud","uv","renderer","syncData","buffer",s.join(` -`))}}let Dx=0;const mn={textureCount:0,uboCount:0};class Rd{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Dx++}systemCheck(){if(!nx())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const i=t.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),e||(mn.textureCount=0,mn.uboCount=0,this.syncUniformGroup(t.uniformGroup,mn)),n}setUniforms(t){const e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)}syncUniformGroup(t,e){const i=this.getGlProgram();(!t.static||t.dirtyId!==i.uniformDirtyGroups[t.id])&&(i.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))}syncUniforms(t,e,i){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,i)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=J_(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const i=this.getGlProgram();if(!t.static||t.dirtyId!==0||!i.uniformGroups[t.id]){t.dirtyId=0;const n=i.uniformGroups[t.id]||this.createSyncBufferGroup(t,i,e);t.buffer.update(),n(i.uniformData,t.uniforms,this.renderer,mn,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,i.uniformBufferBindings[e])}createSyncBufferGroup(t,e,i){const{gl:n}=this.renderer;this.renderer.buffer.bind(t.buffer);const s=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(e.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(t,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=Fx(t,this.shader.program.uniformData)),t.autoManage){const h=new Float32Array(a.size/4);t.buffer.update(h)}return e.uniformGroups[t.id]=a.syncFunc,e.uniformGroups[t.id]}getSignature(t,e,i){const n=t.uniforms,s=[`${i}-`];for(const o in n)s.push(o),e[o]&&s.push(e[o].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const e=this.gl,i=t.program,n=Cx(e,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}Rd.extension={type:U.RendererSystem,name:"shader"};z.add(Rd);class cs{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.3.1 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}cs.defaultOptions={hello:!1},cs.extension={type:[U.RendererSystem,U.CanvasRendererSystem],name:"startup"};z.add(cs);function Bx(r,t=[]){return t[j.NORMAL]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.ADD]=[r.ONE,r.ONE],t[j.MULTIPLY]=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SCREEN]=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.OVERLAY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.DARKEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.LIGHTEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.COLOR_DODGE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.COLOR_BURN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.HARD_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SOFT_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.DIFFERENCE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.EXCLUSION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.HUE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SATURATION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.COLOR]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.LUMINOSITY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.NONE]=[0,0],t[j.NORMAL_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.ADD_NPM]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t[j.SCREEN_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SRC_IN]=[r.DST_ALPHA,r.ZERO],t[j.SRC_OUT]=[r.ONE_MINUS_DST_ALPHA,r.ZERO],t[j.SRC_ATOP]=[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],t[j.DST_OVER]=[r.ONE_MINUS_DST_ALPHA,r.ONE],t[j.DST_IN]=[r.ZERO,r.SRC_ALPHA],t[j.DST_OUT]=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t[j.DST_ATOP]=[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],t[j.XOR]=[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],t[j.SUBTRACT]=[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD],t}const Lx=0,Ox=1,Nx=2,kx=3,Ux=4,Gx=5,Md=class Ta{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=j.NONE,this._blendEq=!1,this.map=[],this.map[Lx]=this.setBlend,this.map[Ox]=this.setOffset,this.map[Nx]=this.setCullFace,this.map[kx]=this.setDepthTest,this.map[Ux]=this.setFrontFace,this.map[Gx]=this.setDepthMask,this.checks=[],this.defaultState=new me,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=Bx(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,i=0;for(;e;)e&1&&this.map[i].call(this,!!(t.data&1<>1,i++;this.stateId=t.data}for(let e=0;et.systems[n]),i=[...e,...Object.keys(t.systems).filter(n=>!e.includes(n))];for(const n of i)this.addSystem(t.systems[n],n)}addRunners(...t){t.forEach(e=>{this.runners[e]=new jt(e)})}addSystem(t,e){const i=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=i,this._systemsHash[e]=i;for(const n in this.runners)this.runners[n].add(i);return this}emitWithCustomOptions(t,e){const i=Object.keys(this._systemsHash);t.items.forEach(n=>{const s=i.find(o=>this._systemsHash[o]===n);n[t.name](e[s])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const xi=class Ln{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=Ln.defaultMaxIdle,this.checkCountMax=Ln.defaultCheckCountMax,this.mode=Ln.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==sh.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let i=!1;for(let n=0;nthis.maxIdle&&(t.destroyTexture(s,!0),e[n]=null,i=!0)}if(i){let n=0;for(let s=0;s=0;n--)this.unload(t.children[n])}destroy(){this.renderer=null}};xi.defaultMode=sh.AUTO,xi.defaultMaxIdle=60*60,xi.defaultCheckCountMax=60*10,xi.extension={type:U.RendererSystem,name:"textureGC"};let sr=xi;z.add(sr);class vo{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=X.UNSIGNED_BYTE,this.internalFormat=B.RGBA,this.samplerType=0}}function zx(r){let t;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?t={[r.RGB]:H.FLOAT,[r.RGBA]:H.FLOAT,[r.ALPHA]:H.FLOAT,[r.LUMINANCE]:H.FLOAT,[r.LUMINANCE_ALPHA]:H.FLOAT,[r.R8]:H.FLOAT,[r.R8_SNORM]:H.FLOAT,[r.RG8]:H.FLOAT,[r.RG8_SNORM]:H.FLOAT,[r.RGB8]:H.FLOAT,[r.RGB8_SNORM]:H.FLOAT,[r.RGB565]:H.FLOAT,[r.RGBA4]:H.FLOAT,[r.RGB5_A1]:H.FLOAT,[r.RGBA8]:H.FLOAT,[r.RGBA8_SNORM]:H.FLOAT,[r.RGB10_A2]:H.FLOAT,[r.RGB10_A2UI]:H.FLOAT,[r.SRGB8]:H.FLOAT,[r.SRGB8_ALPHA8]:H.FLOAT,[r.R16F]:H.FLOAT,[r.RG16F]:H.FLOAT,[r.RGB16F]:H.FLOAT,[r.RGBA16F]:H.FLOAT,[r.R32F]:H.FLOAT,[r.RG32F]:H.FLOAT,[r.RGB32F]:H.FLOAT,[r.RGBA32F]:H.FLOAT,[r.R11F_G11F_B10F]:H.FLOAT,[r.RGB9_E5]:H.FLOAT,[r.R8I]:H.INT,[r.R8UI]:H.UINT,[r.R16I]:H.INT,[r.R16UI]:H.UINT,[r.R32I]:H.INT,[r.R32UI]:H.UINT,[r.RG8I]:H.INT,[r.RG8UI]:H.UINT,[r.RG16I]:H.INT,[r.RG16UI]:H.UINT,[r.RG32I]:H.INT,[r.RG32UI]:H.UINT,[r.RGB8I]:H.INT,[r.RGB8UI]:H.UINT,[r.RGB16I]:H.INT,[r.RGB16UI]:H.UINT,[r.RGB32I]:H.INT,[r.RGB32UI]:H.UINT,[r.RGBA8I]:H.INT,[r.RGBA8UI]:H.UINT,[r.RGBA16I]:H.INT,[r.RGBA16UI]:H.UINT,[r.RGBA32I]:H.INT,[r.RGBA32UI]:H.UINT,[r.DEPTH_COMPONENT16]:H.FLOAT,[r.DEPTH_COMPONENT24]:H.FLOAT,[r.DEPTH_COMPONENT32F]:H.FLOAT,[r.DEPTH_STENCIL]:H.FLOAT,[r.DEPTH24_STENCIL8]:H.FLOAT,[r.DEPTH32F_STENCIL8]:H.FLOAT}:t={[r.RGB]:H.FLOAT,[r.RGBA]:H.FLOAT,[r.ALPHA]:H.FLOAT,[r.LUMINANCE]:H.FLOAT,[r.LUMINANCE_ALPHA]:H.FLOAT,[r.DEPTH_STENCIL]:H.FLOAT},t}function Vx(r){let t;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?t={[X.UNSIGNED_BYTE]:{[B.RGBA]:r.RGBA8,[B.RGB]:r.RGB8,[B.RG]:r.RG8,[B.RED]:r.R8,[B.RGBA_INTEGER]:r.RGBA8UI,[B.RGB_INTEGER]:r.RGB8UI,[B.RG_INTEGER]:r.RG8UI,[B.RED_INTEGER]:r.R8UI,[B.ALPHA]:r.ALPHA,[B.LUMINANCE]:r.LUMINANCE,[B.LUMINANCE_ALPHA]:r.LUMINANCE_ALPHA},[X.BYTE]:{[B.RGBA]:r.RGBA8_SNORM,[B.RGB]:r.RGB8_SNORM,[B.RG]:r.RG8_SNORM,[B.RED]:r.R8_SNORM,[B.RGBA_INTEGER]:r.RGBA8I,[B.RGB_INTEGER]:r.RGB8I,[B.RG_INTEGER]:r.RG8I,[B.RED_INTEGER]:r.R8I},[X.UNSIGNED_SHORT]:{[B.RGBA_INTEGER]:r.RGBA16UI,[B.RGB_INTEGER]:r.RGB16UI,[B.RG_INTEGER]:r.RG16UI,[B.RED_INTEGER]:r.R16UI,[B.DEPTH_COMPONENT]:r.DEPTH_COMPONENT16},[X.SHORT]:{[B.RGBA_INTEGER]:r.RGBA16I,[B.RGB_INTEGER]:r.RGB16I,[B.RG_INTEGER]:r.RG16I,[B.RED_INTEGER]:r.R16I},[X.UNSIGNED_INT]:{[B.RGBA_INTEGER]:r.RGBA32UI,[B.RGB_INTEGER]:r.RGB32UI,[B.RG_INTEGER]:r.RG32UI,[B.RED_INTEGER]:r.R32UI,[B.DEPTH_COMPONENT]:r.DEPTH_COMPONENT24},[X.INT]:{[B.RGBA_INTEGER]:r.RGBA32I,[B.RGB_INTEGER]:r.RGB32I,[B.RG_INTEGER]:r.RG32I,[B.RED_INTEGER]:r.R32I},[X.FLOAT]:{[B.RGBA]:r.RGBA32F,[B.RGB]:r.RGB32F,[B.RG]:r.RG32F,[B.RED]:r.R32F,[B.DEPTH_COMPONENT]:r.DEPTH_COMPONENT32F},[X.HALF_FLOAT]:{[B.RGBA]:r.RGBA16F,[B.RGB]:r.RGB16F,[B.RG]:r.RG16F,[B.RED]:r.R16F},[X.UNSIGNED_SHORT_5_6_5]:{[B.RGB]:r.RGB565},[X.UNSIGNED_SHORT_4_4_4_4]:{[B.RGBA]:r.RGBA4},[X.UNSIGNED_SHORT_5_5_5_1]:{[B.RGBA]:r.RGB5_A1},[X.UNSIGNED_INT_2_10_10_10_REV]:{[B.RGBA]:r.RGB10_A2,[B.RGBA_INTEGER]:r.RGB10_A2UI},[X.UNSIGNED_INT_10F_11F_11F_REV]:{[B.RGB]:r.R11F_G11F_B10F},[X.UNSIGNED_INT_5_9_9_9_REV]:{[B.RGB]:r.RGB9_E5},[X.UNSIGNED_INT_24_8]:{[B.DEPTH_STENCIL]:r.DEPTH24_STENCIL8},[X.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[B.DEPTH_STENCIL]:r.DEPTH32F_STENCIL8}}:t={[X.UNSIGNED_BYTE]:{[B.RGBA]:r.RGBA,[B.RGB]:r.RGB,[B.ALPHA]:r.ALPHA,[B.LUMINANCE]:r.LUMINANCE,[B.LUMINANCE_ALPHA]:r.LUMINANCE_ALPHA},[X.UNSIGNED_SHORT_5_6_5]:{[B.RGB]:r.RGB},[X.UNSIGNED_SHORT_4_4_4_4]:{[B.RGBA]:r.RGBA},[X.UNSIGNED_SHORT_5_5_5_1]:{[B.RGBA]:r.RGBA}},t}class Fd{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new K,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=Vx(t),this.samplerTypes=zx(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let n=0;n=0;--s){const o=e[s];o&&o._glTextures[n].samplerType!==H.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(t){const e=new vo(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){var i;e.internalFormat=((i=this.internalFormats[t.type])==null?void 0:i[t.format])??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??H.FLOAT,this.webGLVersion===2&&t.type===X.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){var n;const e=t._glTextures[this.CONTEXT_UID];if(!e)return;const i=this.renderer;if(this.initTextureType(t,e),(n=t.resource)==null?void 0:n.upload(i,t,e))e.samplerType!==H.FLOAT&&(this.hasIntegerTextures=!0);else{const s=t.realWidth,o=t.realHeight,a=i.gl;(e.width!==s||e.height!==o||e.dirtyId<0)&&(e.width=s,e.height=o,a.texImage2D(t.target,0,e.internalFormat,s,o,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:i}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){const n=this.managedTextures.indexOf(t);n!==-1&&$r(this.managedTextures,n,1)}}updateTextureStyle(t){var i;const e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===de.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=Ft.CLAMP:e.wrapMode=t.wrapMode,(i=t.resource)!=null&&i.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const i=this.gl;if(e.mipmap&&t.mipmap!==de.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===he.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===he.LINEAR){const s=Math.min(t.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===he.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===he.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}Fd.extension={type:U.RendererSystem,name:"texture"};z.add(Fd);class Dd{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:i}=this,n=t._glTransformFeedbacks[i]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,n)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:i,renderer:n}=this;e&&n.shader.bind(e),i.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:i,CONTEXT_UID:n}=this,s=e.createTransformFeedback();t._glTransformFeedbacks[n]=s,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,s);for(let o=0;o(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(yr||{});class _o{constructor(t,e=null,i=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=n}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const Bd=class It{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new _o(null,null,1/0),this.deltaMS=1/It.targetFPMS,this.elapsedMS=1/It.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,i=yr.NORMAL){return this._addListener(new _o(t,e,i))}addOnce(t,e,i=yr.NORMAL){return this._addListener(new _o(t,e,i,!0))}_addListener(t){let e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this}remove(t,e){let i=this._head.next;for(;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const s=t-this._lastFrame|0;if(s{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Mt.shared:new Mt,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}Ld.extension=U.Application;z.add(Ld);const Od=[];z.handleByList(U.Renderer,Od);function Nd(r){for(const t of Od)if(t.test(r))return new t(r);throw new Error("Unable to auto-detect a suitable renderer.")}var Xx=`attribute vec2 aVertexPosition; +`))}}let Cb=0;const gn={textureCount:0,uboCount:0};class nf{constructor(t){this.destroyed=!1,this.renderer=t,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=Cb++}systemCheck(){if(!Qx())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(t){this.gl=t,this.reset()}bind(t,e){t.disposeRunner.add(this),t.uniforms.globals=this.renderer.globalUniforms;const i=t.program,n=i.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(t);return this.shader=t,this.program!==i&&(this.program=i,this.gl.useProgram(n.program)),e||(gn.textureCount=0,gn.uboCount=0,this.syncUniformGroup(t.uniformGroup,gn)),n}setUniforms(t){const e=this.shader.program,i=e.glPrograms[this.renderer.CONTEXT_UID];e.syncUniforms(i.uniformData,t,this.renderer)}syncUniformGroup(t,e){const i=this.getGlProgram();(!t.static||t.dirtyId!==i.uniformDirtyGroups[t.id])&&(i.uniformDirtyGroups[t.id]=t.dirtyId,this.syncUniforms(t,i,e))}syncUniforms(t,e,i){(t.syncUniforms[this.shader.program.id]||this.createSyncGroups(t))(e.uniformData,t.uniforms,this.renderer,i)}createSyncGroups(t){const e=this.getSignature(t,this.shader.program.uniformData,"u");return this.cache[e]||(this.cache[e]=jx(t,this.shader.program.uniformData)),t.syncUniforms[this.shader.program.id]=this.cache[e],t.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(t,e){const i=this.getGlProgram();if(!t.static||t.dirtyId!==0||!i.uniformGroups[t.id]){t.dirtyId=0;const n=i.uniformGroups[t.id]||this.createSyncBufferGroup(t,i,e);t.buffer.update(),n(i.uniformData,t.uniforms,this.renderer,gn,t.buffer)}this.renderer.buffer.bindBufferBase(t.buffer,i.uniformBufferBindings[e])}createSyncBufferGroup(t,e,i){const{gl:n}=this.renderer;this.renderer.buffer.bind(t.buffer);const s=this.gl.getUniformBlockIndex(e.program,i);e.uniformBufferBindings[i]=this.shader.uniformBindCount,n.uniformBlockBinding(e.program,s,this.shader.uniformBindCount),this.shader.uniformBindCount++;const o=this.getSignature(t,this.shader.program.uniformData,"ubo");let a=this._uboCache[o];if(a||(a=this._uboCache[o]=Sb(t,this.shader.program.uniformData)),t.autoManage){const h=new Float32Array(a.size/4);t.buffer.update(h)}return e.uniformGroups[t.id]=a.syncFunc,e.uniformGroups[t.id]}getSignature(t,e,i){const n=t.uniforms,s=[`${i}-`];for(const o in n)s.push(o),e[o]&&s.push(e[o].type);return s.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(t){const e=this.gl,i=t.program,n=bb(e,i);return i.glPrograms[this.renderer.CONTEXT_UID]=n,n}reset(){this.program=null,this.shader=null}disposeShader(t){this.shader===t&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}nf.extension={type:U.RendererSystem,name:"shader"};z.add(nf);class ds{constructor(t){this.renderer=t}run(t){const{renderer:e}=this;e.runners.init.emit(e.options),t.hello&&console.log(`PixiJS 7.3.1 - ${e.rendererLogId} - https://pixijs.com`),e.resize(e.screen.width,e.screen.height)}destroy(){}}ds.defaultOptions={hello:!1},ds.extension={type:[U.RendererSystem,U.CanvasRendererSystem],name:"startup"};z.add(ds);function Ib(r,t=[]){return t[j.NORMAL]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.ADD]=[r.ONE,r.ONE],t[j.MULTIPLY]=[r.DST_COLOR,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SCREEN]=[r.ONE,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.OVERLAY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.DARKEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.LIGHTEN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.COLOR_DODGE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.COLOR_BURN]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.HARD_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SOFT_LIGHT]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.DIFFERENCE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.EXCLUSION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.HUE]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SATURATION]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.COLOR]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.LUMINOSITY]=[r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.NONE]=[0,0],t[j.NORMAL_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_ALPHA,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.ADD_NPM]=[r.SRC_ALPHA,r.ONE,r.ONE,r.ONE],t[j.SCREEN_NPM]=[r.SRC_ALPHA,r.ONE_MINUS_SRC_COLOR,r.ONE,r.ONE_MINUS_SRC_ALPHA],t[j.SRC_IN]=[r.DST_ALPHA,r.ZERO],t[j.SRC_OUT]=[r.ONE_MINUS_DST_ALPHA,r.ZERO],t[j.SRC_ATOP]=[r.DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],t[j.DST_OVER]=[r.ONE_MINUS_DST_ALPHA,r.ONE],t[j.DST_IN]=[r.ZERO,r.SRC_ALPHA],t[j.DST_OUT]=[r.ZERO,r.ONE_MINUS_SRC_ALPHA],t[j.DST_ATOP]=[r.ONE_MINUS_DST_ALPHA,r.SRC_ALPHA],t[j.XOR]=[r.ONE_MINUS_DST_ALPHA,r.ONE_MINUS_SRC_ALPHA],t[j.SUBTRACT]=[r.ONE,r.ONE,r.ONE,r.ONE,r.FUNC_REVERSE_SUBTRACT,r.FUNC_ADD],t}const Pb=0,Rb=1,Mb=2,Fb=3,Db=4,Bb=5,sf=class Na{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=j.NONE,this._blendEq=!1,this.map=[],this.map[Pb]=this.setBlend,this.map[Rb]=this.setOffset,this.map[Mb]=this.setCullFace,this.map[Fb]=this.setDepthTest,this.map[Db]=this.setFrontFace,this.map[Bb]=this.setDepthMask,this.checks=[],this.defaultState=new me,this.defaultState.blend=!0}contextChange(t){this.gl=t,this.blendModes=Ib(t),this.set(this.defaultState),this.reset()}set(t){if(t=t||this.defaultState,this.stateId!==t.data){let e=this.stateId^t.data,i=0;for(;e;)e&1&&this.map[i].call(this,!!(t.data&1<>1,i++;this.stateId=t.data}for(let e=0;et.systems[n]),i=[...e,...Object.keys(t.systems).filter(n=>!e.includes(n))];for(const n of i)this.addSystem(t.systems[n],n)}addRunners(...t){t.forEach(e=>{this.runners[e]=new jt(e)})}addSystem(t,e){const i=new t(this);if(this[e])throw new Error(`Whoops! The name "${e}" is already in use`);this[e]=i,this._systemsHash[e]=i;for(const n in this.runners)this.runners[n].add(i);return this}emitWithCustomOptions(t,e){const i=Object.keys(this._systemsHash);t.items.forEach(n=>{const s=i.find(o=>this._systemsHash[o]===n);n[t.name](e[s])})}destroy(){Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash={}}}const vi=class Nn{constructor(t){this.renderer=t,this.count=0,this.checkCount=0,this.maxIdle=Nn.defaultMaxIdle,this.checkCountMax=Nn.defaultCheckCountMax,this.mode=Nn.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==_h.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const t=this.renderer.texture,e=t.managedTextures;let i=!1;for(let n=0;nthis.maxIdle&&(t.destroyTexture(s,!0),e[n]=null,i=!0)}if(i){let n=0;for(let s=0;s=0;n--)this.unload(t.children[n])}destroy(){this.renderer=null}};vi.defaultMode=_h.AUTO,vi.defaultMaxIdle=60*60,vi.defaultCheckCountMax=60*10,vi.extension={type:U.RendererSystem,name:"textureGC"};let sr=vi;z.add(sr);class Fo{constructor(t){this.texture=t,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=X.UNSIGNED_BYTE,this.internalFormat=B.RGBA,this.samplerType=0}}function Nb(r){let t;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?t={[r.RGB]:H.FLOAT,[r.RGBA]:H.FLOAT,[r.ALPHA]:H.FLOAT,[r.LUMINANCE]:H.FLOAT,[r.LUMINANCE_ALPHA]:H.FLOAT,[r.R8]:H.FLOAT,[r.R8_SNORM]:H.FLOAT,[r.RG8]:H.FLOAT,[r.RG8_SNORM]:H.FLOAT,[r.RGB8]:H.FLOAT,[r.RGB8_SNORM]:H.FLOAT,[r.RGB565]:H.FLOAT,[r.RGBA4]:H.FLOAT,[r.RGB5_A1]:H.FLOAT,[r.RGBA8]:H.FLOAT,[r.RGBA8_SNORM]:H.FLOAT,[r.RGB10_A2]:H.FLOAT,[r.RGB10_A2UI]:H.FLOAT,[r.SRGB8]:H.FLOAT,[r.SRGB8_ALPHA8]:H.FLOAT,[r.R16F]:H.FLOAT,[r.RG16F]:H.FLOAT,[r.RGB16F]:H.FLOAT,[r.RGBA16F]:H.FLOAT,[r.R32F]:H.FLOAT,[r.RG32F]:H.FLOAT,[r.RGB32F]:H.FLOAT,[r.RGBA32F]:H.FLOAT,[r.R11F_G11F_B10F]:H.FLOAT,[r.RGB9_E5]:H.FLOAT,[r.R8I]:H.INT,[r.R8UI]:H.UINT,[r.R16I]:H.INT,[r.R16UI]:H.UINT,[r.R32I]:H.INT,[r.R32UI]:H.UINT,[r.RG8I]:H.INT,[r.RG8UI]:H.UINT,[r.RG16I]:H.INT,[r.RG16UI]:H.UINT,[r.RG32I]:H.INT,[r.RG32UI]:H.UINT,[r.RGB8I]:H.INT,[r.RGB8UI]:H.UINT,[r.RGB16I]:H.INT,[r.RGB16UI]:H.UINT,[r.RGB32I]:H.INT,[r.RGB32UI]:H.UINT,[r.RGBA8I]:H.INT,[r.RGBA8UI]:H.UINT,[r.RGBA16I]:H.INT,[r.RGBA16UI]:H.UINT,[r.RGBA32I]:H.INT,[r.RGBA32UI]:H.UINT,[r.DEPTH_COMPONENT16]:H.FLOAT,[r.DEPTH_COMPONENT24]:H.FLOAT,[r.DEPTH_COMPONENT32F]:H.FLOAT,[r.DEPTH_STENCIL]:H.FLOAT,[r.DEPTH24_STENCIL8]:H.FLOAT,[r.DEPTH32F_STENCIL8]:H.FLOAT}:t={[r.RGB]:H.FLOAT,[r.RGBA]:H.FLOAT,[r.ALPHA]:H.FLOAT,[r.LUMINANCE]:H.FLOAT,[r.LUMINANCE_ALPHA]:H.FLOAT,[r.DEPTH_STENCIL]:H.FLOAT},t}function kb(r){let t;return"WebGL2RenderingContext"in globalThis&&r instanceof globalThis.WebGL2RenderingContext?t={[X.UNSIGNED_BYTE]:{[B.RGBA]:r.RGBA8,[B.RGB]:r.RGB8,[B.RG]:r.RG8,[B.RED]:r.R8,[B.RGBA_INTEGER]:r.RGBA8UI,[B.RGB_INTEGER]:r.RGB8UI,[B.RG_INTEGER]:r.RG8UI,[B.RED_INTEGER]:r.R8UI,[B.ALPHA]:r.ALPHA,[B.LUMINANCE]:r.LUMINANCE,[B.LUMINANCE_ALPHA]:r.LUMINANCE_ALPHA},[X.BYTE]:{[B.RGBA]:r.RGBA8_SNORM,[B.RGB]:r.RGB8_SNORM,[B.RG]:r.RG8_SNORM,[B.RED]:r.R8_SNORM,[B.RGBA_INTEGER]:r.RGBA8I,[B.RGB_INTEGER]:r.RGB8I,[B.RG_INTEGER]:r.RG8I,[B.RED_INTEGER]:r.R8I},[X.UNSIGNED_SHORT]:{[B.RGBA_INTEGER]:r.RGBA16UI,[B.RGB_INTEGER]:r.RGB16UI,[B.RG_INTEGER]:r.RG16UI,[B.RED_INTEGER]:r.R16UI,[B.DEPTH_COMPONENT]:r.DEPTH_COMPONENT16},[X.SHORT]:{[B.RGBA_INTEGER]:r.RGBA16I,[B.RGB_INTEGER]:r.RGB16I,[B.RG_INTEGER]:r.RG16I,[B.RED_INTEGER]:r.R16I},[X.UNSIGNED_INT]:{[B.RGBA_INTEGER]:r.RGBA32UI,[B.RGB_INTEGER]:r.RGB32UI,[B.RG_INTEGER]:r.RG32UI,[B.RED_INTEGER]:r.R32UI,[B.DEPTH_COMPONENT]:r.DEPTH_COMPONENT24},[X.INT]:{[B.RGBA_INTEGER]:r.RGBA32I,[B.RGB_INTEGER]:r.RGB32I,[B.RG_INTEGER]:r.RG32I,[B.RED_INTEGER]:r.R32I},[X.FLOAT]:{[B.RGBA]:r.RGBA32F,[B.RGB]:r.RGB32F,[B.RG]:r.RG32F,[B.RED]:r.R32F,[B.DEPTH_COMPONENT]:r.DEPTH_COMPONENT32F},[X.HALF_FLOAT]:{[B.RGBA]:r.RGBA16F,[B.RGB]:r.RGB16F,[B.RG]:r.RG16F,[B.RED]:r.R16F},[X.UNSIGNED_SHORT_5_6_5]:{[B.RGB]:r.RGB565},[X.UNSIGNED_SHORT_4_4_4_4]:{[B.RGBA]:r.RGBA4},[X.UNSIGNED_SHORT_5_5_5_1]:{[B.RGBA]:r.RGB5_A1},[X.UNSIGNED_INT_2_10_10_10_REV]:{[B.RGBA]:r.RGB10_A2,[B.RGBA_INTEGER]:r.RGB10_A2UI},[X.UNSIGNED_INT_10F_11F_11F_REV]:{[B.RGB]:r.R11F_G11F_B10F},[X.UNSIGNED_INT_5_9_9_9_REV]:{[B.RGB]:r.RGB9_E5},[X.UNSIGNED_INT_24_8]:{[B.DEPTH_STENCIL]:r.DEPTH24_STENCIL8},[X.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[B.DEPTH_STENCIL]:r.DEPTH32F_STENCIL8}}:t={[X.UNSIGNED_BYTE]:{[B.RGBA]:r.RGBA,[B.RGB]:r.RGB,[B.ALPHA]:r.ALPHA,[B.LUMINANCE]:r.LUMINANCE,[B.LUMINANCE_ALPHA]:r.LUMINANCE_ALPHA},[X.UNSIGNED_SHORT_5_6_5]:{[B.RGB]:r.RGB},[X.UNSIGNED_SHORT_4_4_4_4]:{[B.RGBA]:r.RGBA},[X.UNSIGNED_SHORT_5_5_5_1]:{[B.RGBA]:r.RGBA}},t}class of{constructor(t){this.renderer=t,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new K,this.hasIntegerTextures=!1}contextChange(){const t=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=kb(t),this.samplerTypes=Nb(t);const e=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=e;for(let n=0;n=0;--s){const o=e[s];o&&o._glTextures[n].samplerType!==H.FLOAT&&this.renderer.texture.unbind(o)}}initTexture(t){const e=new Fo(this.gl.createTexture());return e.dirtyId=-1,t._glTextures[this.CONTEXT_UID]=e,this.managedTextures.push(t),t.on("dispose",this.destroyTexture,this),e}initTextureType(t,e){var i;e.internalFormat=((i=this.internalFormats[t.type])==null?void 0:i[t.format])??t.format,e.samplerType=this.samplerTypes[e.internalFormat]??H.FLOAT,this.webGLVersion===2&&t.type===X.HALF_FLOAT?e.type=this.gl.HALF_FLOAT:e.type=t.type}updateTexture(t){var n;const e=t._glTextures[this.CONTEXT_UID];if(!e)return;const i=this.renderer;if(this.initTextureType(t,e),(n=t.resource)==null?void 0:n.upload(i,t,e))e.samplerType!==H.FLOAT&&(this.hasIntegerTextures=!0);else{const s=t.realWidth,o=t.realHeight,a=i.gl;(e.width!==s||e.height!==o||e.dirtyId<0)&&(e.width=s,e.height=o,a.texImage2D(t.target,0,e.internalFormat,s,o,0,t.format,e.type,null))}t.dirtyStyleId!==e.dirtyStyleId&&this.updateTextureStyle(t),e.dirtyId=t.dirtyId}destroyTexture(t,e){const{gl:i}=this;if(t=t.castToBaseTexture(),t._glTextures[this.CONTEXT_UID]&&(this.unbind(t),i.deleteTexture(t._glTextures[this.CONTEXT_UID].texture),t.off("dispose",this.destroyTexture,this),delete t._glTextures[this.CONTEXT_UID],!e)){const n=this.managedTextures.indexOf(t);n!==-1&&Hr(this.managedTextures,n,1)}}updateTextureStyle(t){var i;const e=t._glTextures[this.CONTEXT_UID];e&&((t.mipmap===de.POW2||this.webGLVersion!==2)&&!t.isPowerOfTwo?e.mipmap=!1:e.mipmap=t.mipmap>=1,this.webGLVersion!==2&&!t.isPowerOfTwo?e.wrapMode=Ft.CLAMP:e.wrapMode=t.wrapMode,(i=t.resource)!=null&&i.style(this.renderer,t,e)||this.setStyle(t,e),e.dirtyStyleId=t.dirtyStyleId)}setStyle(t,e){const i=this.gl;if(e.mipmap&&t.mipmap!==de.ON_MANUAL&&i.generateMipmap(t.target),i.texParameteri(t.target,i.TEXTURE_WRAP_S,e.wrapMode),i.texParameteri(t.target,i.TEXTURE_WRAP_T,e.wrapMode),e.mipmap){i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===he.LINEAR?i.LINEAR_MIPMAP_LINEAR:i.NEAREST_MIPMAP_NEAREST);const n=this.renderer.context.extensions.anisotropicFiltering;if(n&&t.anisotropicLevel>0&&t.scaleMode===he.LINEAR){const s=Math.min(t.anisotropicLevel,i.getParameter(n.MAX_TEXTURE_MAX_ANISOTROPY_EXT));i.texParameterf(t.target,n.TEXTURE_MAX_ANISOTROPY_EXT,s)}}else i.texParameteri(t.target,i.TEXTURE_MIN_FILTER,t.scaleMode===he.LINEAR?i.LINEAR:i.NEAREST);i.texParameteri(t.target,i.TEXTURE_MAG_FILTER,t.scaleMode===he.LINEAR?i.LINEAR:i.NEAREST)}destroy(){this.renderer=null}}of.extension={type:U.RendererSystem,name:"texture"};z.add(of);class af{constructor(t){this.renderer=t}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:i}=this,n=t._glTransformFeedbacks[i]||this.createGLTransformFeedback(t);e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,n)}unbind(){const{gl:t}=this;t.bindTransformFeedback(t.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(t,e){const{gl:i,renderer:n}=this;e&&n.shader.bind(e),i.beginTransformFeedback(t)}endTransformFeedback(){const{gl:t}=this;t.endTransformFeedback()}createGLTransformFeedback(t){const{gl:e,renderer:i,CONTEXT_UID:n}=this,s=e.createTransformFeedback();t._glTransformFeedbacks[n]=s,e.bindTransformFeedback(e.TRANSFORM_FEEDBACK,s);for(let o=0;o(r[r.INTERACTION=50]="INTERACTION",r[r.HIGH=25]="HIGH",r[r.NORMAL=0]="NORMAL",r[r.LOW=-25]="LOW",r[r.UTILITY=-50]="UTILITY",r))(gr||{});class Do{constructor(t,e=null,i=0,n=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=t,this.context=e,this.priority=i,this.once=n}match(t,e=null){return this.fn===t&&this.context===e}emit(t){this.fn&&(this.context?this.fn.call(this.context,t):this.fn(t));const e=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),e}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const e=this.next;return this.next=t?null:e,this.previous=null,e}}const hf=class It{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new Do(null,null,1/0),this.deltaMS=1/It.targetFPMS,this.elapsedMS=1/It.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(t,e,i=gr.NORMAL){return this._addListener(new Do(t,e,i))}addOnce(t,e,i=gr.NORMAL){return this._addListener(new Do(t,e,i,!0))}_addListener(t){let e=this._head.next,i=this._head;if(!e)t.connect(i);else{for(;e;){if(t.priority>e.priority){t.connect(i);break}i=e,e=e.next}t.previous||t.connect(i)}return this._startIfPossible(),this}remove(t,e){let i=this._head.next;for(;i;)i.match(t,e)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,e=this._head;for(;e=e.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let e;if(t>this.lastTime){if(e=this.elapsedMS=t-this.lastTime,e>this._maxElapsedMS&&(e=this._maxElapsedMS),e*=this.speed,this._minElapsedMS){const s=t-this._lastFrame|0;if(s{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Mt.shared:new Mt,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}lf.extension=U.Application;z.add(lf);const cf=[];z.handleByList(U.Renderer,cf);function uf(r){for(const t of cf)if(t.test(r))return new t(r);throw new Error("Unable to auto-detect a suitable renderer.")}var Ub=`attribute vec2 aVertexPosition; attribute vec2 aTextureCoord; uniform mat3 projectionMatrix; @@ -510,7 +510,7 @@ void main(void) { gl_Position = vec4((projectionMatrix * vec3(aVertexPosition, 1.0)).xy, 0.0, 1.0); vTextureCoord = aTextureCoord; -}`,Wx=`attribute vec2 aVertexPosition; +}`,Gb=`attribute vec2 aVertexPosition; uniform mat3 projectionMatrix; @@ -536,7 +536,7 @@ void main(void) gl_Position = filterVertexPosition(); vTextureCoord = filterTextureCoord(); } -`;const jx=Xx,kd=Wx;class Ud{constructor(t){this.renderer=t}contextChange(t){let e;if(this.renderer.context.webGLVersion===1){const i=t.getParameter(t.FRAMEBUFFER_BINDING);t.bindFramebuffer(t.FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.FRAMEBUFFER,i)}else{const i=t.getParameter(t.DRAW_FRAMEBUFFER_BINDING);t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),e=t.getParameter(t.SAMPLES),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,i)}e>=pt.HIGH?this.multisample=pt.HIGH:e>=pt.MEDIUM?this.multisample=pt.MEDIUM:e>=pt.LOW?this.multisample=pt.LOW:this.multisample=pt.NONE}destroy(){}}Ud.extension={type:U.RendererSystem,name:"_multisample"};z.add(Ud);class Yx{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class Gd{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:i}=this,n=t._glBuffers[i]||this.createGLBuffer(t);e.bindBuffer(t.type,n.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:i,CONTEXT_UID:n}=this;if(this.boundBufferBases[e]!==t){const s=t._glBuffers[n]||this.createGLBuffer(t);this.boundBufferBases[e]=t,i.bindBufferBase(i.UNIFORM_BUFFER,e,s.buffer)}}bindBufferRange(t,e,i){const{gl:n,CONTEXT_UID:s}=this;i=i||0;const o=t._glBuffers[s]||this.createGLBuffer(t);n.bindBufferRange(n.UNIFORM_BUFFER,e||0,o.buffer,i*256,256)}update(t){const{gl:e,CONTEXT_UID:i}=this,n=t._glBuffers[i]||this.createGLBuffer(t);if(t._updateID!==n.updateID)if(n.updateID=t._updateID,e.bindBuffer(t.type,n.buffer),n.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{const s=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,s)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const i=t._glBuffers[this.CONTEXT_UID],n=this.gl;t.disposeRunner.remove(this),i&&(e||n.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let i=0;ie.resource).filter(e=>e).map(e=>e.load());return this._load=Promise.all(t).then(()=>{const{realWidth:e,realHeight:i}=this.items[0];return this.resize(e,i),this.update(),Promise.resolve(this)}),this._load}}class qx extends $d{constructor(t,e){const{width:i,height:n}=e||{};let s,o;Array.isArray(t)?(s=t,o=t.length):o=t,super(o,{width:i,height:n}),s&&this.initFromArray(s,e)}addBaseTextureAt(t,e){if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(t){super.bind(t),t.target=Ur.TEXTURE_2D_ARRAY}upload(t,e,i){const{length:n,itemDirtyIds:s,items:o}=this,{gl:a}=t;i.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,e.format,i.type,null);for(let h=0;h0)if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=Ur.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}upload(t,e,i){const n=this.itemDirtyIds;for(let s=0;s{if(this.url===null){t(this);return}try{const i=await $.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await i.blob();if(this.destroyed)return;const s=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Ct.UNPACK?"premultiply":"none"});if(this.destroyed){s.close();return}this.source=s,this.update(),t(this)}catch(i){if(this.destroyed)return;e(i),this.onError.emit(i)}}),this._load)}upload(t,e,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),super.upload(t,e,i)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof t=="string"||t instanceof ImageBitmap)}static get EMPTY(){return Nr._EMPTY=Nr._EMPTY??$.ADAPTER.createCanvas(0,0),Nr._EMPTY}}const Ea=class Nn extends $e{constructor(t,e){e=e||{},super($.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,e.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(t=>{if(this._resolve=()=>{this.update(),t(this)},Nn.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const t=new Image;$e.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,i=t.height;if(!e||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=e*this.scale,s=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/i*e,s=this._overrideHeight||this._overrideWidth/e*i),n=Math.round(n),s=Math.round(s);const o=this.source;o.width=n,o.height=s,o._pixiId=`canvas_${gr()}`,o.getContext("2d").drawImage(t,0,0,e,i,0,0,n,s),this._resolve(),this._resolve=null}}static getSize(t){const e=Nn.SVG_SIZE.exec(t),i={};return e&&(i[e[1]]=Math.round(parseFloat(e[3])),i[e[5]]=Math.round(parseFloat(e[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,e){return e==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&Nn.SVG_XML.test(t)}};Ea.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Sa=Ea;const Ca=class Ia extends $e{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const i=document.createElement("video");e.autoLoad!==!1&&i.setAttribute("preload","auto"),e.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),e.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),e.loop===!0&&i.setAttribute("loop",""),e.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof t=="string"&&(t=[t]);const n=t[0].src||t[0];$e.crossOrigin(i,n,e.crossorigin);for(let s=0;s{this.valid?e(this):(this._resolve=e,this._reject=i,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!e&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._configureAutoUpdate();const t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Mt.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Mt.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Mt.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||Ia.TYPES.includes(e)}};Ca.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Ca.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Vd=Ca;pa.push(Nr,pd,Kx,Vd,Sa,Es,Zx,qx);class ds{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?Y.EMPTY:(t=t||new Y(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,e){const{a:i,b:n,c:s,d:o,tx:a,ty:h}=t,l=i*e.x+s*e.y+a,c=n*e.x+o*e.y+h;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}addQuad(t){let e=this.minX,i=this.minY,n=this.maxX,s=this.maxY,o=t[0],a=t[1];e=on?o:n,s=a>s?a:s,o=t[2],a=t[3],e=on?o:n,s=a>s?a:s,o=t[4],a=t[5],e=on?o:n,s=a>s?a:s,o=t[6],a=t[7],e=on?o:n,s=a>s?a:s,this.minX=e,this.minY=i,this.maxX=n,this.maxY=s}addFrame(t,e,i,n,s){this.addFrameMatrix(t.worldTransform,e,i,n,s)}addFrameMatrix(t,e,i,n,s){const o=t.a,a=t.b,h=t.c,l=t.d,c=t.tx,u=t.ty;let d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,g=o*e+h*i+c,y=a*e+l*i+u;d=gp?g:p,m=y>m?y:m,g=o*n+h*i+c,y=a*n+l*i+u,d=gp?g:p,m=y>m?y:m,g=o*e+h*s+c,y=a*e+l*s+u,d=gp?g:p,m=y>m?y:m,g=o*n+h*s+c,y=a*n+l*s+u,d=gp?g:p,m=y>m?y:m,this.minX=d,this.minY=f,this.maxX=p,this.maxY=m}addVertexData(t,e,i){let n=this.minX,s=this.minY,o=this.maxX,a=this.maxY;for(let h=e;ho?l:o,a=c>a?c:a}this.minX=n,this.minY=s,this.maxX=o,this.maxY=a}addVertices(t,e,i,n){this.addVerticesMatrix(t.worldTransform,e,i,n)}addVerticesMatrix(t,e,i,n,s=0,o=s){const a=t.a,h=t.b,l=t.c,c=t.d,u=t.tx,d=t.ty;let f=this.minX,p=this.minY,m=this.maxX,g=this.maxY;for(let y=i;yn?t.maxX:n,this.maxY=t.maxY>s?t.maxY:s}addBoundsMask(t,e){const i=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,s=t.maxXl?s:l,this.maxY=o>c?o:c}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const i=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,s=t.maxXl?s:l,this.maxY=o>c?o:c}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,i,n,s,o){t-=s,e-=o,i+=s,n+=o,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n}}class ct extends Hi{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new ph,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new ds,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let i=0;i1)for(let e=0;ethis.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const i=this.getChildIndex(t),n=this.getChildIndex(e);this.children[i]=e,this.children[n]=t,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(t);$r(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e0&&s<=n){o=this.children.splice(i,s);for(let a=0;a1&&this.children.sort(tb),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t0&&e.height>0))return;let i,n;this.cullArea?(i=this.cullArea,n=this.worldTransform):this._render!==Pa.prototype._render&&(i=this.getBounds(!0));const s=t.projection.transform;if(s&&(n?(n=Jx.copyFrom(n),n.prepend(s)):n=s),i&&e.intersects(i,n))this._render(t);else if(this.cullArea)return;for(let o=0,a=this.children.length;o=n&&pi.x=s&&pi.y=pt.HIGH?this.multisample=pt.HIGH:e>=pt.MEDIUM?this.multisample=pt.MEDIUM:e>=pt.LOW?this.multisample=pt.LOW:this.multisample=pt.NONE}destroy(){}}ff.extension={type:U.RendererSystem,name:"_multisample"};z.add(ff);class $b{constructor(t){this.buffer=t||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class pf{constructor(t){this.renderer=t,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(t){const{gl:e,CONTEXT_UID:i}=this,n=t._glBuffers[i]||this.createGLBuffer(t);e.bindBuffer(t.type,n.buffer)}unbind(t){const{gl:e}=this;e.bindBuffer(t,null)}bindBufferBase(t,e){const{gl:i,CONTEXT_UID:n}=this;if(this.boundBufferBases[e]!==t){const s=t._glBuffers[n]||this.createGLBuffer(t);this.boundBufferBases[e]=t,i.bindBufferBase(i.UNIFORM_BUFFER,e,s.buffer)}}bindBufferRange(t,e,i){const{gl:n,CONTEXT_UID:s}=this;i=i||0;const o=t._glBuffers[s]||this.createGLBuffer(t);n.bindBufferRange(n.UNIFORM_BUFFER,e||0,o.buffer,i*256,256)}update(t){const{gl:e,CONTEXT_UID:i}=this,n=t._glBuffers[i]||this.createGLBuffer(t);if(t._updateID!==n.updateID)if(n.updateID=t._updateID,e.bindBuffer(t.type,n.buffer),n.byteLength>=t.data.byteLength)e.bufferSubData(t.type,0,t.data);else{const s=t.static?e.STATIC_DRAW:e.DYNAMIC_DRAW;n.byteLength=t.data.byteLength,e.bufferData(t.type,t.data,s)}}dispose(t,e){if(!this.managedBuffers[t.id])return;delete this.managedBuffers[t.id];const i=t._glBuffers[this.CONTEXT_UID],n=this.gl;t.disposeRunner.remove(this),i&&(e||n.deleteBuffer(i.buffer),delete t._glBuffers[this.CONTEXT_UID])}disposeAll(t){const e=Object.keys(this.managedBuffers);for(let i=0;ie.resource).filter(e=>e).map(e=>e.load());return this._load=Promise.all(t).then(()=>{const{realWidth:e,realHeight:i}=this.items[0];return this.resize(e,i),this.update(),Promise.resolve(this)}),this._load}}class zb extends gf{constructor(t,e){const{width:i,height:n}=e||{};let s,o;Array.isArray(t)?(s=t,o=t.length):o=t,super(o,{width:i,height:n}),s&&this.initFromArray(s,e)}addBaseTextureAt(t,e){if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(t){super.bind(t),t.target=kr.TEXTURE_2D_ARRAY}upload(t,e,i){const{length:n,itemDirtyIds:s,items:o}=this,{gl:a}=t;i.dirtyId<0&&a.texImage3D(a.TEXTURE_2D_ARRAY,0,i.internalFormat,this._width,this._height,n,0,e.format,i.type,null);for(let h=0;h0)if(t.resource)this.addResourceAt(t.resource,e);else throw new Error("CubeResource does not support copying of renderTexture.");else t.target=kr.TEXTURE_CUBE_MAP_POSITIVE_X+e,t.parentTextureArray=this.baseTexture,this.items[e]=t;return t.valid&&!this.valid&&this.resize(t.realWidth,t.realHeight),this.items[e]=t,this}upload(t,e,i){const n=this.itemDirtyIds;for(let s=0;s<_i.SIDES;s++){const o=this.items[s];(n[s]{if(this.url===null){t(this);return}try{const i=await $.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const n=await i.blob();if(this.destroyed)return;const s=await createImageBitmap(n,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===Ct.UNPACK?"premultiply":"none"});if(this.destroyed){s.close();return}this.source=s,this.update(),t(this)}catch(i){if(this.destroyed)return;e(i),this.onError.emit(i)}}),this._load)}upload(t,e,i){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(e.alphaMode=this.alphaMode),super.upload(t,e,i)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(t){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof t=="string"||t instanceof ImageBitmap)}static get EMPTY(){return Or._EMPTY=Or._EMPTY??$.ADAPTER.createCanvas(0,0),Or._EMPTY}}const Ua=class Un extends $e{constructor(t,e){e=e||{},super($.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=t,this.scale=e.scale||1,this._overrideWidth=e.width,this._overrideHeight=e.height,this._resolve=null,this._crossorigin=e.crossorigin,this._load=null,e.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(t=>{if(this._resolve=()=>{this.update(),t(this)},Un.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const t=new Image;$e.crossOrigin(t,this.svg,this._crossorigin),t.src=this.svg,t.onerror=e=>{this._resolve&&(t.onerror=null,this.onError.emit(e))},t.onload=()=>{if(!this._resolve)return;const e=t.width,i=t.height;if(!e||!i)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let n=e*this.scale,s=i*this.scale;(this._overrideWidth||this._overrideHeight)&&(n=this._overrideWidth||this._overrideHeight/i*e,s=this._overrideHeight||this._overrideWidth/e*i),n=Math.round(n),s=Math.round(s);const o=this.source;o.width=n,o.height=s,o._pixiId=`canvas_${mr()}`,o.getContext("2d").drawImage(t,0,0,e,i,0,0,n,s),this._resolve(),this._resolve=null}}static getSize(t){const e=Un.SVG_SIZE.exec(t),i={};return e&&(i[e[1]]=Math.round(parseFloat(e[3])),i[e[5]]=Math.round(parseFloat(e[7]))),i}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(t,e){return e==="svg"||typeof t=="string"&&t.startsWith("data:image/svg+xml")||typeof t=="string"&&Un.SVG_XML.test(t)}};Ua.SVG_XML=/^(<\?xml[^?]+\?>)?\s*()]*-->)?\s*\]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let Ga=Ua;const Ha=class $a extends $e{constructor(t,e){if(e=e||{},!(t instanceof HTMLVideoElement)){const i=document.createElement("video");e.autoLoad!==!1&&i.setAttribute("preload","auto"),e.playsinline!==!1&&(i.setAttribute("webkit-playsinline",""),i.setAttribute("playsinline","")),e.muted===!0&&(i.setAttribute("muted",""),i.muted=!0),e.loop===!0&&i.setAttribute("loop",""),e.autoPlay!==!1&&i.setAttribute("autoplay",""),typeof t=="string"&&(t=[t]);const n=t[0].src||t[0];$e.crossOrigin(i,n,e.crossorigin);for(let s=0;s{this.valid?e(this):(this._resolve=e,this._reject=i,t.load())}),this._load}_onError(t){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.source;return!t.paused&&!t.ended&&this._isSourceReady()}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const t=this.source;t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay);const e=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!e&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&t.play()}dispose(){this._configureAutoUpdate();const t=this.source;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlay),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Mt.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Mt.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Mt.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t,e){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement||$a.TYPES.includes(e)}};Ha.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],Ha.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let vf=Ha;Ia.push(Or,Hd,Vb,vf,Ga,Ps,Xb,zb);class ps{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(t){return this.minX>this.maxX||this.minY>this.maxY?Y.EMPTY:(t=t||new Y(0,0,1,1),t.x=this.minX,t.y=this.minY,t.width=this.maxX-this.minX,t.height=this.maxY-this.minY,t)}addPoint(t){this.minX=Math.min(this.minX,t.x),this.maxX=Math.max(this.maxX,t.x),this.minY=Math.min(this.minY,t.y),this.maxY=Math.max(this.maxY,t.y)}addPointMatrix(t,e){const{a:i,b:n,c:s,d:o,tx:a,ty:h}=t,l=i*e.x+s*e.y+a,c=n*e.x+o*e.y+h;this.minX=Math.min(this.minX,l),this.maxX=Math.max(this.maxX,l),this.minY=Math.min(this.minY,c),this.maxY=Math.max(this.maxY,c)}addQuad(t){let e=this.minX,i=this.minY,n=this.maxX,s=this.maxY,o=t[0],a=t[1];e=on?o:n,s=a>s?a:s,o=t[2],a=t[3],e=on?o:n,s=a>s?a:s,o=t[4],a=t[5],e=on?o:n,s=a>s?a:s,o=t[6],a=t[7],e=on?o:n,s=a>s?a:s,this.minX=e,this.minY=i,this.maxX=n,this.maxY=s}addFrame(t,e,i,n,s){this.addFrameMatrix(t.worldTransform,e,i,n,s)}addFrameMatrix(t,e,i,n,s){const o=t.a,a=t.b,h=t.c,l=t.d,c=t.tx,u=t.ty;let d=this.minX,f=this.minY,p=this.maxX,m=this.maxY,g=o*e+h*i+c,y=a*e+l*i+u;d=gp?g:p,m=y>m?y:m,g=o*n+h*i+c,y=a*n+l*i+u,d=gp?g:p,m=y>m?y:m,g=o*e+h*s+c,y=a*e+l*s+u,d=gp?g:p,m=y>m?y:m,g=o*n+h*s+c,y=a*n+l*s+u,d=gp?g:p,m=y>m?y:m,this.minX=d,this.minY=f,this.maxX=p,this.maxY=m}addVertexData(t,e,i){let n=this.minX,s=this.minY,o=this.maxX,a=this.maxY;for(let h=e;ho?l:o,a=c>a?c:a}this.minX=n,this.minY=s,this.maxX=o,this.maxY=a}addVertices(t,e,i,n){this.addVerticesMatrix(t.worldTransform,e,i,n)}addVerticesMatrix(t,e,i,n,s=0,o=s){const a=t.a,h=t.b,l=t.c,c=t.d,u=t.tx,d=t.ty;let f=this.minX,p=this.minY,m=this.maxX,g=this.maxY;for(let y=i;yn?t.maxX:n,this.maxY=t.maxY>s?t.maxY:s}addBoundsMask(t,e){const i=t.minX>e.minX?t.minX:e.minX,n=t.minY>e.minY?t.minY:e.minY,s=t.maxXl?s:l,this.maxY=o>c?o:c}}addBoundsMatrix(t,e){this.addFrameMatrix(e,t.minX,t.minY,t.maxX,t.maxY)}addBoundsArea(t,e){const i=t.minX>e.x?t.minX:e.x,n=t.minY>e.y?t.minY:e.y,s=t.maxXl?s:l,this.maxY=o>c?o:c}}pad(t=0,e=t){this.isEmpty()||(this.minX-=t,this.maxX+=t,this.minY-=e,this.maxY+=e)}addFramePad(t,e,i,n,s,o){t-=s,e-=o,i+=s,n+=o,this.minX=this.minXi?this.maxX:i,this.minY=this.minYn?this.maxY:n}}class ct extends Gi{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Ph,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new ps,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(t){const e=Object.keys(t);for(let i=0;i1)for(let e=0;ethis.children.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${this.children.length}`);return t.parent&&t.parent.removeChild(t),t.parent=this,this.sortDirty=!0,t.transform._parentID=-1,this.children.splice(e,0,t),this._boundsID++,this.onChildrenChange(e),t.emit("added",this),this.emit("childAdded",t,this,e),t}swapChildren(t,e){if(t===e)return;const i=this.getChildIndex(t),n=this.getChildIndex(e);this.children[i]=e,this.children[n]=t,this.onChildrenChange(i=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);const i=this.getChildIndex(t);Hr(this.children,i,1),this.children.splice(e,0,t),this.onChildrenChange(e)}getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]}removeChild(...t){if(t.length>1)for(let e=0;e0&&s<=n){o=this.children.splice(i,s);for(let a=0;a1&&this.children.sort(Yb),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let t=0,e=this.children.length;t0&&e.height>0))return;let i,n;this.cullArea?(i=this.cullArea,n=this.worldTransform):this._render!==za.prototype._render&&(i=this.getBounds(!0));const s=t.projection.transform;if(s&&(n?(n=jb.copyFrom(n),n.prepend(s)):n=s),i&&e.intersects(i,n))this._render(t);else if(this.cullArea)return;for(let o=0,a=this.children.length;o=n&&di.x=s&&di.y=e&&(o=r-a-1),h=h.replace("%value%",t[o].toString()),n+=h,n+=` -`}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}const hb=` +`;class Qb extends At{constructor(t=1){super(Hb,Zb,{uAlpha:1}),this.alpha=t}get alpha(){return this.uniforms.uAlpha}set alpha(t){this.uniforms.uAlpha=t}}const Jb={5:[.153388,.221461,.250301],7:[.071303,.131514,.189879,.214607],9:[.028532,.067234,.124009,.179044,.20236],11:[.0093,.028002,.065984,.121703,.175713,.198596],13:[.002406,.009255,.027867,.065666,.121117,.174868,.197641],15:[489e-6,.002403,.009246,.02784,.065602,.120999,.174697,.197448]},tw=["varying vec2 vBlurTexCoords[%size%];","uniform sampler2D uSampler;","void main(void)","{"," gl_FragColor = vec4(0.0);"," %blur%","}"].join(` +`);function ew(r){const t=Jb[r],e=t.length;let i=tw,n="";const s="gl_FragColor += texture2D(uSampler, vBlurTexCoords[%index%]) * %value%;";let o;for(let a=0;a=e&&(o=r-a-1),h=h.replace("%value%",t[o].toString()),n+=h,n+=` +`}return i=i.replace("%blur%",n),i=i.replace("%size%",r.toString()),i}const rw=` attribute vec2 aVertexPosition; uniform mat3 projectionMatrix; @@ -577,8 +577,8 @@ void main(void) vec2 textureCoord = filterTextureCoord(); %blur% - }`;function lb(r,t){const e=Math.ceil(r/2);let i=hb,n="",s;t?s="vBlurTexCoords[%index%] = textureCoord + vec2(%sampleIndex% * strength, 0.0);":s="vBlurTexCoords[%index%] = textureCoord + vec2(0.0, %sampleIndex% * strength);";for(let o=0;o{Object.defineProperty(yc,r,{get(){return J("7.1.0",`filters.${r} has moved to ${r}`),t}})});class xb{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(Mt.system.add(this.tickerUpdate,this,yr.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Mt.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&t.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTimei.priority-n.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let i=0,n=e.length;i=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,i=this._allInteractiveElements){if(i.length===0)return;t.eventPhase=t.BUBBLING_PHASE;const n=Array.isArray(e)?e:[e];for(let s=i.length-1;s>=0;s--)n.forEach(o=>{t.currentTarget=i[s],this.notifyTarget(t,o)})}propagationPath(t){const e=[t];for(let i=0;i=0;u--){const d=c[u],f=this.hitTestMoveRecursive(d,this._isInteractive(e)?e:d.eventMode,i,n,s,o||s(t,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const p=t.isInteractive();(f.length>0||p)&&(p&&this._allInteractiveElements.push(t),f.push(t)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}const h=this._isInteractive(e),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),o||this._hitElements.length>0?null:a?this._hitElements:h&&!s(t,i)&&n(t,i)?l?[t]:[]:null}hitTestRecursive(t,e,i,n,s){if(this._interactivePrune(t)||s(t,i))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(Le.pauseUpdate=!1),t.interactiveChildren&&t.children){const h=t.children;for(let l=h.length-1;l>=0;l--){const c=h[l],u=this.hitTestRecursive(c,this._isInteractive(e)?e:c.eventMode,i,n,s);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=t.isInteractive();return(u.length>0||d)&&u.push(t),u}}}const o=this._isInteractive(e),a=t.isInteractive();return o&&n(t,i)?a?[t]:[]:null}_isInteractive(t){return t==="static"||t==="dynamic"}_interactivePrune(t){return!!(!t||t.isMask||!t.visible||!t.renderable||t.eventMode==="none"||t.eventMode==="passive"&&!t.interactiveChildren||t.isMask)}hitPruneFn(t,e){var i;if(t.hitArea&&(t.worldTransform.applyInverse(e,xo),!t.hitArea.contains(xo.x,xo.y)))return!0;if(t._mask){const n=t._mask.isMaskData?t._mask.maskObject:t._mask;if(n&&!((i=n.containsPoint)!=null&&i.call(n,e)))return!0}return!1}hitTestFn(t,e){return t.eventMode==="passive"?!1:t.hitArea?!0:t.containsPoint?t.containsPoint(e):!1}notifyTarget(t,e){var s,o;e=e??t.type;const i=`on${e}`;(o=(s=t.currentTarget)[i])==null||o.call(s,t);const n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),e.pointerType==="touch")this.dispatchEvent(e,"touchstart");else if(e.pointerType==="mouse"||e.pointerType==="pen"){const n=e.button===2;this.dispatchEvent(e,n?"rightdown":"mousedown")}const i=this.trackingData(t.pointerId);i.pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){var h,l;if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.trackingData(t.pointerId),s=this.findMountedTarget(n.overTargets);if(((h=n.overTargets)==null?void 0:h.length)>0&&s!==e.target){const c=t.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(t,c,s);if(this.dispatchEvent(u,"pointerout"),i&&this.dispatchEvent(u,"mouseout"),!e.composedPath().includes(s)){const d=this.createPointerEvent(t,"pointerleave",s);for(d.eventPhase=d.AT_TARGET;d.target&&!e.composedPath().includes(d.target);)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseleave"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(u)}if(s!==e.target){const c=t.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(e,c);this.dispatchEvent(u,"pointerover"),i&&this.dispatchEvent(u,"mouseover");let d=s==null?void 0:s.parent;for(;d&&d!==this.rootTarget.parent&&d!==e.target;)d=d.parent;if(!d||d===this.rootTarget.parent){const f=this.clonePointerEvent(e,"pointerenter");for(f.eventPhase=f.AT_TARGET;f.target&&f.target!==s&&f.target!==this.rootTarget.parent;)f.currentTarget=f.target,this.notifyTarget(f),i&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(u)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(e,"pointermove"),a&&o.push("globalpointermove"),e.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(l=e.target)==null?void 0:l.cursor),o.length>0&&this.all(e,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){var o;if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),i=this.createPointerEvent(t),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;e.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(t){if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId);if(e.overTargets){const i=t.pointerType==="mouse"||t.pointerType==="pen",n=this.findMountedTarget(e.overTargets),s=this.createPointerEvent(t,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const o=this.createPointerEvent(t,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;e.overTargets=null,this.freeEvent(s),this.freeEvent(o)}this.cursor=null}mapPointerUp(t){if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=performance.now(),i=this.createPointerEvent(t);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(t.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[t.button]);let o=s;if(s&&!i.composedPath().includes(s)){let a=s;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const h=i.button===2;this.notifyTarget(i,h?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[t.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,n.clicksByButton[t.button]||(n.clicksByButton[t.button]={clickCount:0,target:a.target,timeStamp:e});const h=n.clicksByButton[t.button];if(h.target===a.target&&e-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=a.target,h.timeStamp=e,a.detail=h.clickCount,a.pointerType==="mouse"){const l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(t){if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),i=this.findMountedTarget(e.pressTargetsByButton[t.button]),n=this.createPointerEvent(t);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(n)}mapWheel(t){if(!(t instanceof Vr)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),e[i]=n,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){const{view:e,resolution:i}=this.renderer;this.setTargetElement(e),this.resolution=i,Da._defaultEventMode=t.eventMode??"auto",Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(t){t=t||"default";let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this.currentCursor===t)return;this.currentCursor=t;const i=this.cursorStyles[t];if(i)switch(typeof i){case"string":e&&(this.domElement.style.cursor=i);break;case"function":i(t);break;case"object":e&&Object.assign(this.domElement.style,i);break}else e&&typeof t=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this.rootPointerEvent}onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let i=0,n=e.length;i0&&(e=t.composedPath()[0]);const i=e!==this.domElement?"outside":"",n=this.normalizeToPointerData(t);for(let s=0,o=n.length;s"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=t.type,e.push(s)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){const i=t;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=Ab),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;return this.transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Eb[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};Fa.extension={name:"events",type:[U.RendererSystem,U.CanvasRendererSystem]},Fa.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let Ba=Fa;z.add(Ba);function vc(r){return r==="dynamic"||r==="static"}const Sb={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??vc(Ba.defaultEventMode)},set interactive(r){J("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=r,this.eventMode=r?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Ba.defaultEventMode},set eventMode(r){this._internalInteractive=vc(r),this._internalEventMode=r},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(r,t,e){const i=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,n=typeof t=="function"?void 0:t;r=i?`${r}capture`:r,t=typeof t=="function"?t:t.handleEvent,this.on(r,t,n)},removeEventListener(r,t,e){const i=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,n=typeof t=="function"?void 0:t;r=i?`${r}capture`:r,t=typeof t=="function"?t:t.handleEvent,this.off(r,t,n)},dispatchEvent(r){if(!(r instanceof Vi))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return r.defaultPrevented=!1,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}};ct.mixin(Sb);const Cb={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};ct.mixin(Cb);const Ib=9,gn=100,Pb=0,Rb=0,_c=2,xc=1,Mb=-1e3,Fb=-1e3,Db=2;class jd{constructor(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(we.tablet||we.phone)&&this.createTouchHook();const e=document.createElement("div");e.style.width=`${gn}px`,e.style.height=`${gn}px`,e.style.position="absolute",e.style.top=`${Pb}px`,e.style.left=`${Rb}px`,e.style.zIndex=_c.toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const t=document.createElement("button");t.style.width=`${xc}px`,t.style.height=`${xc}px`,t.style.position="absolute",t.style.top=`${Mb}px`,t.style.left=`${Fb}px`,t.style.zIndex=Db.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(t=this.renderer.view.parentNode)==null||t.appendChild(this.div))}deactivate(){var t;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(t=this.div.parentNode)==null||t.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const e=t.children;if(e)for(let i=0;i title : ${t.title}
tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:i}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>i&&(t.height=i-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width=`${gn}px`,e.style.height=`${gn}px`,e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=_c.toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&t.accessibleTitle!==null?e.title=t.accessibleTitle:(!t.accessibleHint||t.accessibleHint===null)&&(e.title=`displayObject ${t.tabIndex}`),t.accessibleHint&&t.accessibleHint!==null&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex}_dispatchEvent(t,e){const{displayObject:i}=t.target,n=this.renderer.events.rootBoundary,s=Object.assign(new Vi(n),{target:i});n.rootTarget=this.renderer.lastObjectRendered,e.forEach(o=>n.dispatchEvent(s,o))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){t.keyCode===Ib&&this.activate()}_onMouseMove(t){t.movementX===0&&t.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}jd.extension={name:"accessibility",type:[U.RendererPlugin,U.CanvasRendererPlugin]};z.add(jd);const Yd=class La{constructor(t){this.stage=new Bt,t=Object.assign({forceCanvas:!1},t),this.renderer=Nd(t),La._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render(this.stage)}get view(){var t;return(t=this.renderer)==null?void 0:t.view}get screen(){var t;return(t=this.renderer)==null?void 0:t.screen}destroy(t,e){const i=La._plugins.slice(0);i.reverse(),i.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};Yd._plugins=[];let Bb=Yd;z.handleByList(U.Application,Bb._plugins);class qd{static init(t){Object.defineProperty(this,"resizeTo",{set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let e,i;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:s}=this._resizeTo;e=n,i=s}this.renderer.resize(e,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}qd.extension=U.Application;z.add(qd);const bc={loader:U.LoadParser,resolver:U.ResolveParser,cache:U.CacheParser,detection:U.DetectionParser};z.handle(U.Asset,r=>{const t=r.ref;Object.entries(bc).filter(([e])=>!!t[e]).forEach(([e,i])=>z.add(Object.assign(t[e],{extension:t[e].extension??i})))},r=>{const t=r.ref;Object.keys(bc).filter(e=>!!t[e]).forEach(e=>z.remove(t[e]))});class Lb{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach(e=>{this._assetList.push(e)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i(Array.isArray(r)||(r=[r]),t?r.map(i=>typeof i=="string"||e?t(i):i):r),Oa=(r,t)=>{const e=t.split("?")[1];return e&&(r+=`?${e}`),r};function Kd(r,t,e,i,n){const s=t[e];for(let o=0;o{const o=s.substring(1,s.length-1).split(",");n.push(o)}),Kd(r,n,0,e,i)}else i.push(r);return i}const ps=r=>!Array.isArray(r);class Nb{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const i=Xt(t);let n;for(let a=0;a{n[a]=e}));const s=Object.keys(n),o={cacheKeys:s,keys:i};if(i.forEach(a=>{this._cacheMap.set(a,o)}),s.forEach(a=>{this._cache.has(a)&&this._cache.get(a)!==e&&console.warn("[Cache] already has key:",a),this._cache.set(a,n[a])}),e instanceof k){const a=e;i.forEach(h=>{a.baseTexture!==k.EMPTY.baseTexture&&K.addToCache(a.baseTexture,h),k.addToCache(a,h)})}}remove(t){if(!this._cacheMap.has(t)){console.warn(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(i=>{this._cache.delete(i)}),e.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const ar=new Nb;class kb{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,i)=>(this._parsersValidated=!1,t[e]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const i={promise:null,parser:null};return i.promise=(async()=>{var o,a;let n=null,s=null;if(e.loadParser&&(s=this._parserHash[e.loadParser],s||console.warn(`[Assets] specified load parser "${e.loadParser}" not found while loading ${t}`)),!s){for(let h=0;h({alias:[l],src:l})),a=o.length,h=o.map(async l=>{const c=Et.toAbsolute(l.src);if(!n[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),n[l.src]=await this.promiseCache[c].promise,e&&e(++i/a)}catch(u){throw delete this.promiseCache[c],delete n[l.src],new Error(`[Loader.load] Failed to load ${c}. -${u}`)}});return await Promise.all(h),s?n[o[0].src]:n}async unload(t){const e=Xt(t,i=>({alias:[i],src:i})).map(async i=>{var o,a;const n=Et.toAbsolute(i.src),s=this.promiseCache[n];if(s){const h=await s.promise;delete this.promiseCache[n],(a=(o=s.parser)==null?void 0:o.unload)==null||a.call(o,h,i,this)}});await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name).reduce((t,e)=>(t[e.name]&&console.warn(`[Assets] loadParser name conflict "${e.name}"`),{...t,[e.name]:e}),{})}}var Kt=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(Kt||{});const Ub=".json",Gb="application/json",Hb={extension:{type:U.LoadParser,priority:Kt.Low},name:"loadJson",test(r){return ii(r,Gb)||je(r,Ub)},async load(r){return await(await $.ADAPTER.fetch(r)).json()}};z.add(Hb);const $b=".txt",zb="text/plain",Vb={name:"loadTxt",extension:{type:U.LoadParser,priority:Kt.Low},test(r){return ii(r,zb)||je(r,$b)},async load(r){return await(await $.ADAPTER.fetch(r)).text()}};z.add(Vb);const Xb=["normal","bold","100","200","300","400","500","600","700","800","900"],Wb=[".ttf",".otf",".woff",".woff2"],jb=["font/ttf","font/otf","font/woff","font/woff2"],Yb=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function qb(r){const t=Et.extname(r),e=Et.basename(r,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map(s=>s.charAt(0).toUpperCase()+s.slice(1));let i=e.length>0;for(const s of e)if(!s.match(Yb)){i=!1;break}let n=e.join(" ");return i||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const Kb={extension:{type:U.LoadParser,priority:Kt.Low},name:"loadWebFont",test(r){return ii(r,jb)||je(r,Wb)},async load(r,t){var i,n,s;const e=$.ADAPTER.getFontFaceSet();if(e){const o=[],a=((i=t.data)==null?void 0:i.family)??qb(r),h=((s=(n=t.data)==null?void 0:n.weights)==null?void 0:s.filter(c=>Xb.includes(c)))??["normal"],l=t.data??{};for(let c=0;c$.ADAPTER.getFontFaceSet().delete(t))}};z.add(Kb);let wc=0,bo;const Zb="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=",Qb={id:"checkImageBitmap",code:` +`;class fw extends At{constructor(t=.5,e=Math.random()){super(df,dw,{uNoise:0,uSeed:0}),this.noise=t,this.seed=e}get noise(){return this.uniforms.uNoise}set noise(t){this.uniforms.uNoise=t}get seed(){return this.uniforms.uSeed}set seed(t){this.uniforms.uSeed=t}}const Uc={AlphaFilter:Qb,BlurFilter:nw,BlurFilterPass:Va,ColorMatrixFilter:Xa,DisplacementFilter:hw,FXAAFilter:uw,NoiseFilter:fw};Object.entries(Uc).forEach(([r,t])=>{Object.defineProperty(Uc,r,{get(){return J("7.1.0",`filters.${r} has moved to ${r}`),t}})});class pw{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(t){this.removeTickerListener(),this.events=t,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(t){this._pauseUpdate=t}addTickerListener(){this.tickerAdded||!this.domElement||(Mt.system.add(this.tickerUpdate,this,gr.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Mt.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const t=this.events.rootPointerEvent;this.events.supportsTouchEvents&&t.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:t.clientX,clientY:t.clientY}))}tickerUpdate(t){this._deltaTime+=t,!(this._deltaTimei.priority-n.priority)}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){if(!this.rootTarget)return;const e=this.mappingTable[t.type];if(e)for(let i=0,n=e.length;i=0;n--)if(t.currentTarget=i[n],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}all(t,e,i=this._allInteractiveElements){if(i.length===0)return;t.eventPhase=t.BUBBLING_PHASE;const n=Array.isArray(e)?e:[e];for(let s=i.length-1;s>=0;s--)n.forEach(o=>{t.currentTarget=i[s],this.notifyTarget(t,o)})}propagationPath(t){const e=[t];for(let i=0;i=0;u--){const d=c[u],f=this.hitTestMoveRecursive(d,this._isInteractive(e)?e:d.eventMode,i,n,s,o||s(t,i));if(f){if(f.length>0&&!f[f.length-1].parent)continue;const p=t.isInteractive();(f.length>0||p)&&(p&&this._allInteractiveElements.push(t),f.push(t)),this._hitElements.length===0&&(this._hitElements=f),a=!0}}}const h=this._isInteractive(e),l=t.isInteractive();return l&&l&&this._allInteractiveElements.push(t),o||this._hitElements.length>0?null:a?this._hitElements:h&&!s(t,i)&&n(t,i)?l?[t]:[]:null}hitTestRecursive(t,e,i,n,s){if(this._interactivePrune(t)||s(t,i))return null;if((t.eventMode==="dynamic"||e==="dynamic")&&(Le.pauseUpdate=!1),t.interactiveChildren&&t.children){const h=t.children;for(let l=h.length-1;l>=0;l--){const c=h[l],u=this.hitTestRecursive(c,this._isInteractive(e)?e:c.eventMode,i,n,s);if(u){if(u.length>0&&!u[u.length-1].parent)continue;const d=t.isInteractive();return(u.length>0||d)&&u.push(t),u}}}const o=this._isInteractive(e),a=t.isInteractive();return o&&n(t,i)?a?[t]:[]:null}_isInteractive(t){return t==="static"||t==="dynamic"}_interactivePrune(t){return!!(!t||t.isMask||!t.visible||!t.renderable||t.eventMode==="none"||t.eventMode==="passive"&&!t.interactiveChildren||t.isMask)}hitPruneFn(t,e){var i;if(t.hitArea&&(t.worldTransform.applyInverse(e,Bo),!t.hitArea.contains(Bo.x,Bo.y)))return!0;if(t._mask){const n=t._mask.isMaskData?t._mask.maskObject:t._mask;if(n&&!((i=n.containsPoint)!=null&&i.call(n,e)))return!0}return!1}hitTestFn(t,e){return t.eventMode==="passive"?!1:t.hitArea?!0:t.containsPoint?t.containsPoint(e):!1}notifyTarget(t,e){var s,o;e=e??t.type;const i=`on${e}`;(o=(s=t.currentTarget)[i])==null||o.call(s,t);const n=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,n),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}mapPointerDown(t){if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.createPointerEvent(t);if(this.dispatchEvent(e,"pointerdown"),e.pointerType==="touch")this.dispatchEvent(e,"touchstart");else if(e.pointerType==="mouse"||e.pointerType==="pen"){const n=e.button===2;this.dispatchEvent(e,n?"rightdown":"mousedown")}const i=this.trackingData(t.pointerId);i.pressTargetsByButton[t.button]=e.composedPath(),this.freeEvent(e)}mapPointerMove(t){var h,l;if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const e=this.createPointerEvent(t);this._isPointerMoveEvent=!1;const i=e.pointerType==="mouse"||e.pointerType==="pen",n=this.trackingData(t.pointerId),s=this.findMountedTarget(n.overTargets);if(((h=n.overTargets)==null?void 0:h.length)>0&&s!==e.target){const c=t.type==="mousemove"?"mouseout":"pointerout",u=this.createPointerEvent(t,c,s);if(this.dispatchEvent(u,"pointerout"),i&&this.dispatchEvent(u,"mouseout"),!e.composedPath().includes(s)){const d=this.createPointerEvent(t,"pointerleave",s);for(d.eventPhase=d.AT_TARGET;d.target&&!e.composedPath().includes(d.target);)d.currentTarget=d.target,this.notifyTarget(d),i&&this.notifyTarget(d,"mouseleave"),d.target=d.target.parent;this.freeEvent(d)}this.freeEvent(u)}if(s!==e.target){const c=t.type==="mousemove"?"mouseover":"pointerover",u=this.clonePointerEvent(e,c);this.dispatchEvent(u,"pointerover"),i&&this.dispatchEvent(u,"mouseover");let d=s==null?void 0:s.parent;for(;d&&d!==this.rootTarget.parent&&d!==e.target;)d=d.parent;if(!d||d===this.rootTarget.parent){const f=this.clonePointerEvent(e,"pointerenter");for(f.eventPhase=f.AT_TARGET;f.target&&f.target!==s&&f.target!==this.rootTarget.parent;)f.currentTarget=f.target,this.notifyTarget(f),i&&this.notifyTarget(f,"mouseenter"),f.target=f.target.parent;this.freeEvent(f)}this.freeEvent(u)}const o=[],a=this.enableGlobalMoveEvents??!0;this.moveOnAll?o.push("pointermove"):this.dispatchEvent(e,"pointermove"),a&&o.push("globalpointermove"),e.pointerType==="touch"&&(this.moveOnAll?o.splice(1,0,"touchmove"):this.dispatchEvent(e,"touchmove"),a&&o.push("globaltouchmove")),i&&(this.moveOnAll?o.splice(1,0,"mousemove"):this.dispatchEvent(e,"mousemove"),a&&o.push("globalmousemove"),this.cursor=(l=e.target)==null?void 0:l.cursor),o.length>0&&this.all(e,o),this._allInteractiveElements.length=0,this._hitElements.length=0,n.overTargets=e.composedPath(),this.freeEvent(e)}mapPointerOver(t){var o;if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),i=this.createPointerEvent(t),n=i.pointerType==="mouse"||i.pointerType==="pen";this.dispatchEvent(i,"pointerover"),n&&this.dispatchEvent(i,"mouseover"),i.pointerType==="mouse"&&(this.cursor=(o=i.target)==null?void 0:o.cursor);const s=this.clonePointerEvent(i,"pointerenter");for(s.eventPhase=s.AT_TARGET;s.target&&s.target!==this.rootTarget.parent;)s.currentTarget=s.target,this.notifyTarget(s),n&&this.notifyTarget(s,"mouseenter"),s.target=s.target.parent;e.overTargets=i.composedPath(),this.freeEvent(i),this.freeEvent(s)}mapPointerOut(t){if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId);if(e.overTargets){const i=t.pointerType==="mouse"||t.pointerType==="pen",n=this.findMountedTarget(e.overTargets),s=this.createPointerEvent(t,"pointerout",n);this.dispatchEvent(s),i&&this.dispatchEvent(s,"mouseout");const o=this.createPointerEvent(t,"pointerleave",n);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),i&&this.notifyTarget(o,"mouseleave"),o.target=o.target.parent;e.overTargets=null,this.freeEvent(s),this.freeEvent(o)}this.cursor=null}mapPointerUp(t){if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=performance.now(),i=this.createPointerEvent(t);if(this.dispatchEvent(i,"pointerup"),i.pointerType==="touch")this.dispatchEvent(i,"touchend");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const a=i.button===2;this.dispatchEvent(i,a?"rightup":"mouseup")}const n=this.trackingData(t.pointerId),s=this.findMountedTarget(n.pressTargetsByButton[t.button]);let o=s;if(s&&!i.composedPath().includes(s)){let a=s;for(;a&&!i.composedPath().includes(a);){if(i.currentTarget=a,this.notifyTarget(i,"pointerupoutside"),i.pointerType==="touch")this.notifyTarget(i,"touchendoutside");else if(i.pointerType==="mouse"||i.pointerType==="pen"){const h=i.button===2;this.notifyTarget(i,h?"rightupoutside":"mouseupoutside")}a=a.parent}delete n.pressTargetsByButton[t.button],o=a}if(o){const a=this.clonePointerEvent(i,"click");a.target=o,a.path=null,n.clicksByButton[t.button]||(n.clicksByButton[t.button]={clickCount:0,target:a.target,timeStamp:e});const h=n.clicksByButton[t.button];if(h.target===a.target&&e-h.timeStamp<200?++h.clickCount:h.clickCount=1,h.target=a.target,h.timeStamp=e,a.detail=h.clickCount,a.pointerType==="mouse"){const l=a.button===2;this.dispatchEvent(a,l?"rightclick":"click")}else a.pointerType==="touch"&&this.dispatchEvent(a,"tap");this.dispatchEvent(a,"pointertap"),this.freeEvent(a)}this.freeEvent(i)}mapPointerUpOutside(t){if(!(t instanceof $t)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const e=this.trackingData(t.pointerId),i=this.findMountedTarget(e.pressTargetsByButton[t.button]),n=this.createPointerEvent(t);if(i){let s=i;for(;s;)n.currentTarget=s,this.notifyTarget(n,"pointerupoutside"),n.pointerType==="touch"?this.notifyTarget(n,"touchendoutside"):(n.pointerType==="mouse"||n.pointerType==="pen")&&this.notifyTarget(n,n.button===2?"rightupoutside":"mouseupoutside"),s=s.parent;delete e.pressTargetsByButton[t.button]}this.freeEvent(n)}mapWheel(t){if(!(t instanceof zr)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const e=this.createWheelEvent(t);this.dispatchEvent(e),this.freeEvent(e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i(i==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=n),e[i]=n,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(t){const{view:e,resolution:i}=this.renderer;this.setTargetElement(e),this.resolution=i,ja._defaultEventMode=t.eventMode??"auto",Object.assign(this.features,t.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(t){this.resolution=t}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(t){t=t||"default";let e=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(e=!1),this.currentCursor===t)return;this.currentCursor=t;const i=this.cursorStyles[t];if(i)switch(typeof i){case"string":e&&(this.domElement.style.cursor=i);break;case"function":i(t);break;case"object":e&&Object.assign(this.domElement.style,i);break}else e&&typeof t=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,t)&&(this.domElement.style.cursor=t)}get pointer(){return this.rootPointerEvent}onPointerDown(t){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let i=0,n=e.length;i0&&(e=t.composedPath()[0]);const i=e!==this.domElement?"outside":"",n=this.normalizeToPointerData(t);for(let s=0,o=n.length;s"u"&&(s.button=0),typeof s.buttons>"u"&&(s.buttons=1),typeof s.isPrimary>"u"&&(s.isPrimary=t.touches.length===1&&t.type==="touchstart"),typeof s.width>"u"&&(s.width=s.radiusX||1),typeof s.height>"u"&&(s.height=s.radiusY||1),typeof s.tiltX>"u"&&(s.tiltX=0),typeof s.tiltY>"u"&&(s.tiltY=0),typeof s.pointerType>"u"&&(s.pointerType="touch"),typeof s.pointerId>"u"&&(s.pointerId=s.identifier||0),typeof s.pressure>"u"&&(s.pressure=s.force||.5),typeof s.twist>"u"&&(s.twist=0),typeof s.tangentialPressure>"u"&&(s.tangentialPressure=0),typeof s.layerX>"u"&&(s.layerX=s.offsetX=s.clientX),typeof s.layerY>"u"&&(s.layerY=s.offsetY=s.clientY),s.isNormalized=!0,s.type=t.type,e.push(s)}else if(!globalThis.MouseEvent||t instanceof MouseEvent&&(!this.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))){const i=t;typeof i.isPrimary>"u"&&(i.isPrimary=!0),typeof i.width>"u"&&(i.width=1),typeof i.height>"u"&&(i.height=1),typeof i.tiltX>"u"&&(i.tiltX=0),typeof i.tiltY>"u"&&(i.tiltY=0),typeof i.pointerType>"u"&&(i.pointerType="mouse"),typeof i.pointerId>"u"&&(i.pointerId=vw),typeof i.pressure>"u"&&(i.pressure=.5),typeof i.twist>"u"&&(i.twist=0),typeof i.tangentialPressure>"u"&&(i.tangentialPressure=0),i.isNormalized=!0,e.push(i)}else e.push(t);return e}normalizeWheelEvent(t){const e=this.rootWheelEvent;return this.transferMouseData(e,t),e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ,e.deltaMode=t.deltaMode,this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.nativeEvent=t,e.type=t.type,e}bootstrapEvent(t,e){return t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e),this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.isTrusted=e.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=_w[t.type]||t.type),t}transferMouseData(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.relatedTarget=null,t.shiftKey=e.shiftKey}};Wa.extension={name:"events",type:[U.RendererSystem,U.CanvasRendererSystem]},Wa.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let Ya=Wa;z.add(Ya);function Gc(r){return r==="dynamic"||r==="static"}const xw={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??Gc(Ya.defaultEventMode)},set interactive(r){J("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=r,this.eventMode=r?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??Ya.defaultEventMode},set eventMode(r){this._internalInteractive=Gc(r),this._internalEventMode=r},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(r,t,e){const i=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,n=typeof t=="function"?void 0:t;r=i?`${r}capture`:r,t=typeof t=="function"?t:t.handleEvent,this.on(r,t,n)},removeEventListener(r,t,e){const i=typeof e=="boolean"&&e||typeof e=="object"&&e.capture,n=typeof t=="function"?void 0:t;r=i?`${r}capture`:r,t=typeof t=="function"?t:t.handleEvent,this.off(r,t,n)},dispatchEvent(r){if(!(r instanceof Xi))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return r.defaultPrevented=!1,r.path=null,r.target=this,r.manager.dispatchEvent(r),!r.defaultPrevented}};ct.mixin(xw);const bw={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};ct.mixin(bw);const ww=9,yn=100,Tw=0,Aw=0,Hc=2,$c=1,Ew=-1e3,Sw=-1e3,Cw=2;class bf{constructor(t){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(we.tablet||we.phone)&&this.createTouchHook();const e=document.createElement("div");e.style.width=`${yn}px`,e.style.height=`${yn}px`,e.style.position="absolute",e.style.top=`${Tw}px`,e.style.left=`${Aw}px`,e.style.zIndex=Hc.toString(),this.div=e,this.renderer=t,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const t=document.createElement("button");t.style.width=`${$c}px`,t.style.height=`${$c}px`,t.style.position="absolute",t.style.top=`${Ew}px`,t.style.left=`${Sw}px`,t.style.zIndex=Cw.toString(),t.style.backgroundColor="#FF0000",t.title="select to enable accessibility for this content",t.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(t),this._hookDiv=t}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var t;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(t=this.renderer.view.parentNode)==null||t.appendChild(this.div))}deactivate(){var t;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(t=this.div.parentNode)==null||t.removeChild(this.div))}updateAccessibleObjects(t){if(!t.visible||!t.accessibleChildren)return;t.accessible&&t.isInteractive()&&(t._accessibleActive||this.addChild(t),t.renderId=this.renderId);const e=t.children;if(e)for(let i=0;i title : ${t.title}
tabIndex: ${t.tabIndex}`}capHitArea(t){t.x<0&&(t.width+=t.x,t.x=0),t.y<0&&(t.height+=t.y,t.y=0);const{width:e,height:i}=this.renderer;t.x+t.width>e&&(t.width=e-t.x),t.y+t.height>i&&(t.height=i-t.y)}addChild(t){let e=this.pool.pop();e||(e=document.createElement("button"),e.style.width=`${yn}px`,e.style.height=`${yn}px`,e.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",e.style.position="absolute",e.style.zIndex=Hc.toString(),e.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?e.setAttribute("aria-live","off"):e.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?e.setAttribute("aria-relevant","additions"):e.setAttribute("aria-relevant","text"),e.addEventListener("click",this._onClick.bind(this)),e.addEventListener("focus",this._onFocus.bind(this)),e.addEventListener("focusout",this._onFocusOut.bind(this))),e.style.pointerEvents=t.accessiblePointerEvents,e.type=t.accessibleType,t.accessibleTitle&&t.accessibleTitle!==null?e.title=t.accessibleTitle:(!t.accessibleHint||t.accessibleHint===null)&&(e.title=`displayObject ${t.tabIndex}`),t.accessibleHint&&t.accessibleHint!==null&&e.setAttribute("aria-label",t.accessibleHint),this.debug&&this.updateDebugHTML(e),t._accessibleActive=!0,t._accessibleDiv=e,e.displayObject=t,this.children.push(t),this.div.appendChild(t._accessibleDiv),t._accessibleDiv.tabIndex=t.tabIndex}_dispatchEvent(t,e){const{displayObject:i}=t.target,n=this.renderer.events.rootBoundary,s=Object.assign(new Xi(n),{target:i});n.rootTarget=this.renderer.lastObjectRendered,e.forEach(o=>n.dispatchEvent(s,o))}_onClick(t){this._dispatchEvent(t,["click","pointertap","tap"])}_onFocus(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","assertive"),this._dispatchEvent(t,["mouseover"])}_onFocusOut(t){t.target.getAttribute("aria-live")||t.target.setAttribute("aria-live","polite"),this._dispatchEvent(t,["mouseout"])}_onKeyDown(t){t.keyCode===ww&&this.activate()}_onMouseMove(t){t.movementX===0&&t.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}bf.extension={name:"accessibility",type:[U.RendererPlugin,U.CanvasRendererPlugin]};z.add(bf);const wf=class qa{constructor(t){this.stage=new Bt,t=Object.assign({forceCanvas:!1},t),this.renderer=uf(t),qa._plugins.forEach(e=>{e.init.call(this,t)})}render(){this.renderer.render(this.stage)}get view(){var t;return(t=this.renderer)==null?void 0:t.view}get screen(){var t;return(t=this.renderer)==null?void 0:t.screen}destroy(t,e){const i=qa._plugins.slice(0);i.reverse(),i.forEach(n=>{n.destroy.call(this)}),this.stage.destroy(e),this.stage=null,this.renderer.destroy(t),this.renderer=null}};wf._plugins=[];let Iw=wf;z.handleByList(U.Application,Iw._plugins);class Tf{static init(t){Object.defineProperty(this,"resizeTo",{set(e){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=e,e&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let e,i;if(this._resizeTo===globalThis.window)e=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:n,clientHeight:s}=this._resizeTo;e=n,i=s}this.renderer.resize(e,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}Tf.extension=U.Application;z.add(Tf);const zc={loader:U.LoadParser,resolver:U.ResolveParser,cache:U.CacheParser,detection:U.DetectionParser};z.handle(U.Asset,r=>{const t=r.ref;Object.entries(zc).filter(([e])=>!!t[e]).forEach(([e,i])=>z.add(Object.assign(t[e],{extension:t[e].extension??i})))},r=>{const t=r.ref;Object.keys(zc).filter(e=>!!t[e]).forEach(e=>z.remove(t[e]))});class Pw{constructor(t,e=!1){this._loader=t,this._assetList=[],this._isLoading=!1,this._maxConcurrent=1,this.verbose=e}add(t){t.forEach(e=>{this._assetList.push(e)}),this.verbose&&console.log("[BackgroundLoader] assets: ",this._assetList),this._isActive&&!this._isLoading&&this._next()}async _next(){if(this._assetList.length&&this._isActive){this._isLoading=!0;const t=[],e=Math.min(this._assetList.length,this._maxConcurrent);for(let i=0;i(Array.isArray(r)||(r=[r]),t?r.map(i=>typeof i=="string"||e?t(i):i):r),Ka=(r,t)=>{const e=t.split("?")[1];return e&&(r+=`?${e}`),r};function Af(r,t,e,i,n){const s=t[e];for(let o=0;o{const o=s.substring(1,s.length-1).split(",");n.push(o)}),Af(r,n,0,e,i)}else i.push(r);return i}const gs=r=>!Array.isArray(r);class Mw{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const e=this._cache.get(t);return e||console.warn(`[Assets] Asset id ${t} was not found in the Cache`),e}set(t,e){const i=Xt(t);let n;for(let a=0;a{n[a]=e}));const s=Object.keys(n),o={cacheKeys:s,keys:i};if(i.forEach(a=>{this._cacheMap.set(a,o)}),s.forEach(a=>{this._cache.has(a)&&this._cache.get(a)!==e&&console.warn("[Cache] already has key:",a),this._cache.set(a,n[a])}),e instanceof k){const a=e;i.forEach(h=>{a.baseTexture!==k.EMPTY.baseTexture&&K.addToCache(a.baseTexture,h),k.addToCache(a,h)})}}remove(t){if(!this._cacheMap.has(t)){console.warn(`[Assets] Asset id ${t} was not found in the Cache`);return}const e=this._cacheMap.get(t);e.cacheKeys.forEach(i=>{this._cache.delete(i)}),e.keys.forEach(i=>{this._cacheMap.delete(i)})}get parsers(){return this._parsers}}const ar=new Mw;class Fw{constructor(){this._parsers=[],this._parsersValidated=!1,this.parsers=new Proxy(this._parsers,{set:(t,e,i)=>(this._parsersValidated=!1,t[e]=i,!0)}),this.promiseCache={}}reset(){this._parsersValidated=!1,this.promiseCache={}}_getLoadPromiseAndParser(t,e){const i={promise:null,parser:null};return i.promise=(async()=>{var o,a;let n=null,s=null;if(e.loadParser&&(s=this._parserHash[e.loadParser],s||console.warn(`[Assets] specified load parser "${e.loadParser}" not found while loading ${t}`)),!s){for(let h=0;h({alias:[l],src:l})),a=o.length,h=o.map(async l=>{const c=Et.toAbsolute(l.src);if(!n[l.src])try{this.promiseCache[c]||(this.promiseCache[c]=this._getLoadPromiseAndParser(c,l)),n[l.src]=await this.promiseCache[c].promise,e&&e(++i/a)}catch(u){throw delete this.promiseCache[c],delete n[l.src],new Error(`[Loader.load] Failed to load ${c}. +${u}`)}});return await Promise.all(h),s?n[o[0].src]:n}async unload(t){const e=Xt(t,i=>({alias:[i],src:i})).map(async i=>{var o,a;const n=Et.toAbsolute(i.src),s=this.promiseCache[n];if(s){const h=await s.promise;delete this.promiseCache[n],(a=(o=s.parser)==null?void 0:o.unload)==null||a.call(o,h,i,this)}});await Promise.all(e)}_validateParsers(){this._parsersValidated=!0,this._parserHash=this._parsers.filter(t=>t.name).reduce((t,e)=>(t[e.name]&&console.warn(`[Assets] loadParser name conflict "${e.name}"`),{...t,[e.name]:e}),{})}}var Kt=(r=>(r[r.Low=0]="Low",r[r.Normal=1]="Normal",r[r.High=2]="High",r))(Kt||{});const Dw=".json",Bw="application/json",Lw={extension:{type:U.LoadParser,priority:Kt.Low},name:"loadJson",test(r){return ei(r,Bw)||je(r,Dw)},async load(r){return await(await $.ADAPTER.fetch(r)).json()}};z.add(Lw);const Ow=".txt",Nw="text/plain",kw={name:"loadTxt",extension:{type:U.LoadParser,priority:Kt.Low},test(r){return ei(r,Nw)||je(r,Ow)},async load(r){return await(await $.ADAPTER.fetch(r)).text()}};z.add(kw);const Uw=["normal","bold","100","200","300","400","500","600","700","800","900"],Gw=[".ttf",".otf",".woff",".woff2"],Hw=["font/ttf","font/otf","font/woff","font/woff2"],$w=/^(--|-?[A-Z_])[0-9A-Z_-]*$/i;function zw(r){const t=Et.extname(r),e=Et.basename(r,t).replace(/(-|_)/g," ").toLowerCase().split(" ").map(s=>s.charAt(0).toUpperCase()+s.slice(1));let i=e.length>0;for(const s of e)if(!s.match($w)){i=!1;break}let n=e.join(" ");return i||(n=`"${n.replace(/[\\"]/g,"\\$&")}"`),n}const Vw={extension:{type:U.LoadParser,priority:Kt.Low},name:"loadWebFont",test(r){return ei(r,Hw)||je(r,Gw)},async load(r,t){var i,n,s;const e=$.ADAPTER.getFontFaceSet();if(e){const o=[],a=((i=t.data)==null?void 0:i.family)??zw(r),h=((s=(n=t.data)==null?void 0:n.weights)==null?void 0:s.filter(c=>Uw.includes(c)))??["normal"],l=t.data??{};for(let c=0;c$.ADAPTER.getFontFaceSet().delete(t))}};z.add(Vw);let Vc=0,Lo;const Xw="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+ip1sAAAAASUVORK5CYII=",Ww={id:"checkImageBitmap",code:` async function checkImageBitmap() { try { if (typeof createImageBitmap !== 'function') return false; - const response = await fetch('${Zb}'); + const response = await fetch('${Xw}'); const imageBlob = await response.blob(); const imageBitmap = await createImageBitmap(imageBlob); @@ -896,7 +896,7 @@ ${u}`)}});return await Promise.all(h),s?n[o[0].src]:n}async unload(t){const e=Xt } } checkImageBitmap().then((result) => { self.postMessage(result); }); - `},Jb={id:"loadImageBitmap",code:` + `},jw={id:"loadImageBitmap",code:` async function loadImageBitmap(url) { const response = await fetch(url); @@ -932,8 +932,8 @@ ${u}`)}});return await Promise.all(h),s?n[o[0].src]:n}async unload(t){const e=Xt id: event.data.id, }); } - };`};let wo;class tw{constructor(){this._initialized=!1,this._createdWorkers=0,this.workerPool=[],this.queue=[],this.resolveHash={}}isImageBitmapSupported(){return this._isImageBitmapSupported!==void 0?this._isImageBitmapSupported:(this._isImageBitmapSupported=new Promise(t=>{const e=URL.createObjectURL(new Blob([Qb.code],{type:"application/javascript"})),i=new Worker(e);i.addEventListener("message",n=>{i.terminate(),URL.revokeObjectURL(e),t(n.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){bo===void 0&&(bo=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers{this.complete(e.data),this.returnWorker(e.target),this.next()})),t}returnWorker(t){this.workerPool.push(t)}complete(t){t.error!==void 0?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const i=new Promise((n,s)=>{this.queue.push({id:t,arguments:e,resolve:n,reject:s})});return this.next(),i}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),i=e.id;this.resolveHash[wc]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:wc++,id:i})}}const Tc=new tw;function Xi(r,t,e){r.resource.internal=!0;const i=new k(r),n=()=>{delete t.promiseCache[e],ar.has(e)&&ar.remove(e)};return i.baseTexture.once("destroyed",()=>{e in t.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),n())}),i.once("destroyed",()=>{r.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),n())}),i}const ew=[".jpeg",".jpg",".png",".webp",".avif"],rw=["image/jpeg","image/png","image/webp","image/avif"];async function iw(r){const t=await $.ADAPTER.fetch(r);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${t.status} ${t.statusText}`);const e=await t.blob();return await createImageBitmap(e)}const Ms={name:"loadTextures",extension:{type:U.LoadParser,priority:Kt.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(r){return ii(r,rw)||je(r,ew)},async load(r,t,e){var a;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;i?this.config.preferWorkers&&await Tc.isImageBitmapSupported()?n=await Tc.loadImageBitmap(r):n=await iw(r):n=await new Promise((h,l)=>{const c=new Image;c.crossOrigin=this.config.crossOrigin,c.src=r,c.complete?h(c):(c.onload=()=>h(c),c.onerror=u=>l(u))});const s={...t.data};s.resolution??(s.resolution=Ce(r)),i&&((a=s.resourceOptions)==null?void 0:a.ownsImageBitmap)===void 0&&(s.resourceOptions={...s.resourceOptions},s.resourceOptions.ownsImageBitmap=!0);const o=new K(n,s);return o.resource.src=r,Xi(o,e,r)},unload(r){r.destroy(!0)}};z.add(Ms);const nw=".svg",sw="image/svg+xml",ow={extension:{type:U.LoadParser,priority:Kt.High},name:"loadSVG",test(r){return ii(r,sw)||je(r,nw)},async testParse(r){return Sa.test(r)},async parse(r,t,e){var s;const i=new Sa(r,(s=t==null?void 0:t.data)==null?void 0:s.resourceOptions);await i.load();const n=new K(i,{resolution:Ce(r),...t==null?void 0:t.data});return n.resource.src=t.src,Xi(n,e,t.src)},async load(r,t){return(await $.ADAPTER.fetch(r)).text()},unload:Ms.unload};z.add(ow);const aw=[".mp4",".m4v",".webm",".ogv"],hw=["video/mp4","video/webm","video/ogg"],lw={name:"loadVideo",extension:{type:U.LoadParser,priority:Kt.High},config:{defaultAutoPlay:!0},test(r){return ii(r,hw)||je(r,aw)},async load(r,t,e){var o;let i;const n=await(await $.ADAPTER.fetch(r)).blob(),s=URL.createObjectURL(n);try{const a={autoPlay:this.config.defaultAutoPlay,...(o=t==null?void 0:t.data)==null?void 0:o.resourceOptions},h=new Vd(s,a);await h.load();const l=new K(h,{alphaMode:await y_(),resolution:Ce(r),...t==null?void 0:t.data});l.resource.src=r,i=Xi(l,e,r),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(s)})}catch(a){throw URL.revokeObjectURL(s),a}return i},unload(r){r.destroy(!0)}};z.add(lw);class cw{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`).join("&")}}getAlias(t){const{alias:e,name:i,src:n,srcs:s}=t;return Xt(e||i||n||s,o=>typeof o=="string"?o:Array.isArray(o)?o.map(a=>(a==null?void 0:a.src)??(a==null?void 0:a.srcs)??a):o!=null&&o.src||o!=null&&o.srcs?o.src??o.srcs:o,!0)}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const i=[];Array.isArray(e)?e.forEach(n=>{const s=n.src??n.srcs,o=n.alias??n.name;let a;if(typeof o=="string"){const h=this._createBundleAssetId(t,o);i.push(h),a=[o,h]}else{const h=o.map(l=>this._createBundleAssetId(t,l));i.push(...h),a=[...o,...h]}this.add({...n,alias:a,src:s})}):Object.keys(e).forEach(n=>{const s=[n,this._createBundleAssetId(t,n)];if(typeof e[n]=="string")this.add({alias:s,src:e[n]});else if(Array.isArray(e[n]))this.add({alias:s,src:e[n]});else{const o=e[n],a=o.src??o.srcs;this.add({...o,alias:s,src:Array.isArray(a)?a:[a]})}i.push(...s)}),this._bundles[t]=i}add(t,e,i,n,s){const o=[];typeof t=="string"||Array.isArray(t)&&typeof t[0]=="string"?(J("7.2.0",`Assets.add now uses an object instead of individual parameters. -Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:t,src:e,data:i,format:n,loadParser:s})):Array.isArray(t)?o.push(...t):o.push(t);let a;a=h=>{this.hasKey(h)&&console.warn(`[Resolver] already has key: ${h} overwriting`)},Xt(o).forEach(h=>{const{src:l,srcs:c}=h;let{data:u,format:d,loadParser:f}=h;const p=Xt(l||c).map(y=>typeof y=="string"?Ob(y):Array.isArray(y)?y:[y]),m=this.getAlias(h);Array.isArray(m)?m.forEach(a):a(m);const g=[];p.forEach(y=>{y.forEach(_=>{let v={};if(typeof _!="object"){v.src=_;for(let x=0;x{this._assetMap[y]=g})})}resolveBundle(t){const e=ps(t);t=Xt(t);const i={};return t.forEach(n=>{const s=this._bundles[n];if(s){const o=this.resolve(s),a={};for(const h in o){const l=o[h];a[this._extractAssetIdFromBundle(n,h)]=l}i[n]=a}}),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const i={};for(const n in e)i[n]=e[n].src;return i}return e.src}resolve(t){const e=ps(t);t=Xt(t);const i={};return t.forEach(n=>{if(!this._resolverHash[n])if(this._assetMap[n]){let s=this._assetMap[n];const o=s[0],a=this._getPreferredOrder(s);a==null||a.priority.forEach(h=>{a.params[h].forEach(l=>{const c=s.filter(u=>u[h]?u[h]===l:!1);c.length&&(s=c)})}),this._resolverHash[n]=s[0]??o}else this._resolverHash[n]=this.buildResolvedAsset({alias:[n],src:n},{});i[n]=this._resolverHash[n]}),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;es.params.format.includes(i.format));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}buildResolvedAsset(t,e){const{aliases:i,data:n,loadParser:s,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=Et.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...n||{},...t.data},t.loadParser=s??t.loadParser,t.format=o??t.src.split(".").pop(),t.srcs=t.src,t.name=t.alias,t}}class uw{constructor(){this._detections=[],this._initialized=!1,this.resolver=new cw,this.loader=new kb,this.cache=ar,this._backgroundLoader=new Lb(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){var s,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Asset.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let a=t.manifest;typeof a=="string"&&(a=await this.load(a)),this.resolver.addManifest(a)}const e=((s=t.texturePreference)==null?void 0:s.resolution)??1,i=typeof e=="number"?[e]:e,n=await this._detectFormats({preferredFormats:(o=t.texturePreference)==null?void 0:o.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:n,resolution:i}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,i,n,s){this.resolver.add(t,e,i,n,s)}async load(t,e){this._initialized||await this.init();const i=ps(t),n=Xt(t).map(a=>{if(typeof a!="string"){const h=this.resolver.getAlias(a);return h.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(h)?h[0]:h}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),s=this.resolver.resolve(n),o=await this._mapLoadToResolve(s,e);return i?o[n[0]]:o}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let i=!1;typeof t=="string"&&(i=!0,t=[t]);const n=this.resolver.resolveBundle(t),s={},o=Object.keys(n);let a=0,h=0;const l=()=>{e==null||e(++a/h)},c=o.map(u=>{const d=n[u];return h+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{s[u]=f})});return await Promise.all(c),i?s[t[0]]:s}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return ar.get(t);const e={};for(let i=0;i{const l=s[a.src],c=[a.src];a.alias&&c.push(...a.alias),o[n[h]]=l,ar.set(c,l)}),o}async unload(t){this._initialized||await this.init();const e=Xt(t).map(n=>typeof n!="string"?n.src:n),i=this.resolver.resolve(e);await this._unloadFromResolved(i)}async unloadBundle(t){this._initialized||await this.init(),t=Xt(t);const e=this.resolver.resolveBundle(t),i=Object.keys(e).map(n=>this._unloadFromResolved(e[n]));await Promise.all(i)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(i=>{ar.remove(i.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const i of t.detections)t.skipDetections||await i.test()?e=await i.add(e):t.skipDetections||(e=await i.remove(e));return e=e.filter((i,n)=>e.indexOf(i)===n),e}get detections(){return this._detections}get preferWorkers(){return Ms.config.preferWorkers}set preferWorkers(t){J("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(i=>i in t).forEach(i=>{e.config[i]=t[i]})})}}const yn=new uw;z.handleByList(U.LoadParser,yn.loader.parsers).handleByList(U.ResolveParser,yn.resolver.parsers).handleByList(U.CacheParser,yn.cache.parsers).handleByList(U.DetectionParser,yn.detections);const dw={extension:U.CacheParser,test:r=>Array.isArray(r)&&r.every(t=>t instanceof k),getCacheableAssets:(r,t)=>{const e={};return r.forEach(i=>{t.forEach((n,s)=>{e[i+(s===0?"":s+1)]=n})}),e}};z.add(dw);const fw={extension:{type:U.DetectionParser,priority:1},test:async()=>{const r="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=";return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=r})},add:async r=>[...r,"avif"],remove:async r=>r.filter(t=>t!=="avif")};z.add(fw);const pw={extension:{type:U.DetectionParser,priority:0},test:async()=>{const r="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=";return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=r})},add:async r=>[...r,"webp"],remove:async r=>r.filter(t=>t!=="webp")};z.add(pw);const Ac=["png","jpg","jpeg"],mw={extension:{type:U.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async r=>[...r,...Ac],remove:async r=>r.filter(t=>!Ac.includes(t))};z.add(mw);const gw="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function gh(r){return gw?!1:document.createElement("video").canPlayType(r)!==""}const yw={extension:{type:U.DetectionParser,priority:0},test:async()=>gh("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(t=>t!=="webm")};z.add(yw);const vw={extension:{type:U.DetectionParser,priority:0},test:async()=>gh("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(t=>t!=="mp4"&&t!=="m4v")};z.add(vw);const _w={extension:{type:U.DetectionParser,priority:0},test:async()=>gh("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(t=>t!=="ogv")};z.add(_w);const xw={extension:U.ResolveParser,test:Ms.test,parse:r=>{var t;return{resolution:parseFloat(((t=$.RETINA_PREFIX.exec(r))==null?void 0:t[1])??"1"),format:r.split(".").pop(),src:r}}};z.add(xw);var Pt=(r=>(r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",r[r.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",r[r.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",r))(Pt||{});const ms={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35986:1,34798:1,37808:1};let _e,Pr;function Ec(){Pr={s3tc:_e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:_e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:_e.getExtension("WEBGL_compressed_texture_etc"),etc1:_e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:_e.getExtension("WEBGL_compressed_texture_pvrtc")||_e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:_e.getExtension("WEBGL_compressed_texture_atc"),astc:_e.getExtension("WEBGL_compressed_texture_astc")}}const bw={extension:{type:U.DetectionParser,priority:2},test:async()=>{const r=$.ADAPTER.createCanvas().getContext("webgl");return r?(_e=r,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async r=>{Pr||Ec();const t=[];for(const e in Pr)Pr[e]&&t.push(e);return[...t,...r]},remove:async r=>(Pr||Ec(),r.filter(t=>!(t in Pr)))};z.add(bw);class ww extends Es{constructor(t,e={width:1,height:1,autoLoad:!0}){let i,n;typeof t=="string"?(i=t,n=new Uint8Array):(i=null,n=t),super(n,e),this.origin=i,this.buffer=n?new fa(n):null,this._load=null,this.loaded=!1,this.origin!==null&&e.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(t=>t.blob()).then(t=>t.arrayBuffer()).then(t=>(this.data=new Uint32Array(t),this.buffer=new fa(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)),this._load)}}class fr extends ww{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=fr._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||fr._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,i){const n=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;n.pixelStorei(n.UNPACK_ALIGNMENT,4);for(let s=0,o=this.levels;s=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")}static _createLevelBuffers(t,e,i,n,s,o,a){const h=new Array(i);let l=t.byteOffset,c=o,u=a,d=c+n-1&~(n-1),f=u+s-1&~(s-1),p=d*f*ms[e];for(let m=0;m1?c:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(t.buffer,l,p)},l+=p,c=c>>1||1,u=u>>1||1,d=c+n-1&~(n-1),f=u+s-1&~(s-1),p=d*f*ms[e];return h}}const To=4,vn=124,Tw=32,Sc=20,Aw=542327876,_n={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},Ew={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},xn={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},Sw=1,Cw=2,Iw=4,Pw=64,Rw=512,Mw=131072,Fw=827611204,Dw=861165636,Bw=894720068,Lw=808540228,Ow=4,Nw={[Fw]:Pt.COMPRESSED_RGBA_S3TC_DXT1_EXT,[Dw]:Pt.COMPRESSED_RGBA_S3TC_DXT3_EXT,[Bw]:Pt.COMPRESSED_RGBA_S3TC_DXT5_EXT},kw={70:Pt.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Pt.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Pt.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Pt.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Pt.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Pt.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Pt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Pt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Pt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT};function Uw(r){const t=new Uint32Array(r);if(t[0]!==Aw)throw new Error("Invalid DDS file magic word");const e=new Uint32Array(r,0,vn/Uint32Array.BYTES_PER_ELEMENT),i=e[_n.HEIGHT],n=e[_n.WIDTH],s=e[_n.MIPMAP_COUNT],o=new Uint32Array(r,_n.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,Tw/Uint32Array.BYTES_PER_ELEMENT),a=o[Sw];if(a&Iw){const h=o[Ew.FOURCC];if(h!==Lw){const _=Nw[h],v=To+vn,x=new Uint8Array(r,v);return[new fr(x,{format:_,width:n,height:i,levels:s})]}const l=To+vn,c=new Uint32Array(t.buffer,l,Sc/Uint32Array.BYTES_PER_ELEMENT),u=c[xn.DXGI_FORMAT],d=c[xn.RESOURCE_DIMENSION],f=c[xn.MISC_FLAG],p=c[xn.ARRAY_SIZE],m=kw[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===Ow)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,y=To+vn+Sc;if(p===1)g.push(new Uint8Array(r,y));else{const _=ms[m];let v=0,x=n,w=i;for(let A=0;A>>1,w=w>>>1}let C=y;for(let A=0;Anew fr(_,{format:m,width:n,height:i,levels:s}))}throw a&Pw?new Error("DDSParser does not support uncompressed texture data."):a&Rw?new Error("DDSParser does not supported YUV uncompressed texture data."):a&Mw?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&Cw?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const Cc=[171,75,84,88,32,49,49,187,13,10,26,10],Gw=67305985,Gt={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},Na=64,Ic={[X.UNSIGNED_BYTE]:1,[X.UNSIGNED_SHORT]:2,[X.INT]:4,[X.UNSIGNED_INT]:4,[X.FLOAT]:4,[X.HALF_FLOAT]:8},Hw={[B.RGBA]:4,[B.RGB]:3,[B.RG]:2,[B.RED]:1,[B.LUMINANCE]:1,[B.LUMINANCE_ALPHA]:2,[B.ALPHA]:1},$w={[X.UNSIGNED_SHORT_4_4_4_4]:2,[X.UNSIGNED_SHORT_5_5_5_1]:2,[X.UNSIGNED_SHORT_5_6_5]:2};function zw(r,t,e=!1){const i=new DataView(t);if(!Vw(r,i))return null;const n=i.getUint32(Gt.ENDIANNESS,!0)===Gw,s=i.getUint32(Gt.GL_TYPE,n),o=i.getUint32(Gt.GL_FORMAT,n),a=i.getUint32(Gt.GL_INTERNAL_FORMAT,n),h=i.getUint32(Gt.PIXEL_WIDTH,n),l=i.getUint32(Gt.PIXEL_HEIGHT,n)||1,c=i.getUint32(Gt.PIXEL_DEPTH,n)||1,u=i.getUint32(Gt.NUMBER_OF_ARRAY_ELEMENTS,n)||1,d=i.getUint32(Gt.NUMBER_OF_FACES,n),f=i.getUint32(Gt.NUMBER_OF_MIPMAP_LEVELS,n),p=i.getUint32(Gt.BYTES_OF_KEY_VALUE_DATA,n);if(l===0||c!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const m=4,g=4,y=h+3&-4,_=l+3&-4,v=new Array(u);let x=h*l;s===0&&(x=y*_);let w;if(s!==0?Ic[s]?w=Ic[s]*Hw[o]:w=$w[s]:w=ms[a],w===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const C=e?Ww(i,p,n):null;let A=x*w,S=h,F=l,N=y,O=_,L=Na+p;for(let T=0;T1||s!==0?S:N,levelHeight:f>1||s!==0?F:O,levelBuffer:new Uint8Array(t,I,A)},I+=A}L+=b+4,L=L%4!==0?L+4-L%4:L,S=S>>1||1,F=F>>1||1,N=S+m-1&~(m-1),O=F+g-1&~(g-1),A=N*O*w}return s!==0?{uncompressed:v.map(T=>{let b=T[0].levelBuffer,I=!1;return s===X.FLOAT?b=new Float32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4):s===X.UNSIGNED_INT?(I=!0,b=new Uint32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4)):s===X.INT&&(I=!0,b=new Int32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4)),{resource:new Es(b,{width:T[0].levelWidth,height:T[0].levelHeight}),type:s,format:I?Xw(o):o}}),kvData:C}:{compressed:v.map(T=>new fr(null,{format:a,width:h,height:l,levels:f,levelBuffers:T})),kvData:C}}function Vw(r,t){for(let e=0;et-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h{const o=new K(s,{mipmap:de.OFF,alphaMode:Ct.NO_PREMULTIPLIED_ALPHA,resolution:Ce(r),...t.data});return Xi(o,e,r)});return n.length===1?n[0]:n},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};z.add(jw);const Yw={extension:{type:U.LoadParser,priority:Kt.High},name:"loadKTX",test(r){return je(r,".ktx")},async load(r,t,e){const i=await(await $.ADAPTER.fetch(r)).arrayBuffer(),{compressed:n,uncompressed:s,kvData:o}=zw(r,i),a=n??s,h={mipmap:de.OFF,alphaMode:Ct.NO_PREMULTIPLIED_ALPHA,resolution:Ce(r),...t.data},l=a.map(c=>{a===s&&Object.assign(h,{type:c.type,format:c.format});const u=c.resource??c,d=new K(u,h);return d.ktxKeyValueData=o,Xi(d,e,r)});return l.length===1?l[0]:l},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};z.add(Yw);const qw={extension:U.ResolveParser,test:r=>{const t=r.split("?")[0].split(".").pop();return["basis","ktx","dds"].includes(t)},parse:r=>{var t,e;if(r.split("?")[0].split(".").pop()==="ktx"){const i=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(i.some(n=>r.endsWith(n)))return{resolution:parseFloat(((t=$.RETINA_PREFIX.exec(r))==null?void 0:t[1])??"1"),format:i.find(n=>r.endsWith(n)),src:r}}return{resolution:parseFloat(((e=$.RETINA_PREFIX.exec(r))==null?void 0:e[1])??"1"),format:r.split(".").pop(),src:r}}};z.add(qw);const bn=new Y,Kw=4,Zd=class wi{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){var e;const t=(e=this.renderer)==null?void 0:e.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}async image(t,e,i,n){const s=new Image;return s.src=await this.base64(t,e,i,n),s}async base64(t,e,i,n){const s=this.canvas(t,n);if(s.toBlob!==void 0)return new Promise((o,a)=>{s.toBlob(h=>{if(!h){a(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>o(l.result),l.onerror=a,l.readAsDataURL(h)},e,i)});if(s.toDataURL!==void 0)return s.toDataURL(e,i);if(s.convertToBlob!==void 0){const o=await s.convertToBlob({type:e,quality:i});return new Promise((a,h)=>{const l=new FileReader;l.onload=()=>a(l.result),l.onerror=h,l.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t,e){const{pixels:i,width:n,height:s,flipY:o,premultipliedAlpha:a}=this._rawPixels(t,e);o&&wi._flipY(i,n,s),a&&wi._unpremultiplyAlpha(i);const h=new D_(n,s,1),l=new ImageData(new Uint8ClampedArray(i.buffer),n,s);return h.context.putImageData(l,0,0),h.canvas}pixels(t,e){const{pixels:i,width:n,height:s,flipY:o,premultipliedAlpha:a}=this._rawPixels(t,e);return o&&wi._flipY(i,n,s),a&&wi._unpremultiplyAlpha(i),i}_rawPixels(t,e){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let n,s=!1,o=!1,a,h=!1;t&&(t instanceof _r?a=t:(a=i.generateTexture(t,{region:e,resolution:i.resolution,multisample:i.multisample}),h=!0,e&&(bn.width=e.width,bn.height=e.height,e=bn)));const l=i.gl;if(a){if(n=a.baseTexture.resolution,e=e??a.frame,s=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===B.RGBA,!h){i.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else n=i.resolution,e||(e=bn,e.width=i.width/n,e.height=i.height/n),s=!0,o=this._rendererPremultipliedAlpha,i.renderTexture.bind();const c=Math.max(Math.round(e.width*n),1),u=Math.max(Math.round(e.height*n),1),d=new Uint8Array(Kw*c*u);return l.readPixels(Math.round(e.x*n),Math.round(e.y*n),c,u,l.RGBA,l.UNSIGNED_BYTE,d),h&&(a==null||a.destroy(!0)),{pixels:d,width:c,height:u,flipY:s,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(t,e,i){const n=e<<2,s=i>>1,o=new Uint8Array(n);for(let a=0;a=0&&a>=0&&n>=0&&s>=0)){t.length=0;return}const h=Math.ceil(2.3*Math.sqrt(o+a)),l=h*8+(n?4:0)+(s?4:0);if(t.length=l,l===0)return;if(h===0){t.length=8,t[0]=t[6]=e+n,t[1]=t[3]=i+s,t[2]=t[4]=e-n,t[5]=t[7]=i-s;return}let c=0,u=h*4+(n?2:0)+2,d=u,f=l;{const p=n+o,m=s,g=e+p,y=e-p,_=i+m;if(t[c++]=g,t[c++]=_,t[--u]=_,t[--u]=y,s){const v=i-m;t[d++]=y,t[d++]=v,t[--f]=v,t[--f]=g}}for(let p=1;p0||t&&i<=0){const n=e/2;for(let s=n+n%2;s=6){Pc(e,!1);const o=[];for(let l=0;l=0&&s>=0&&o.push(e,i,e+n,i,e+n,i+s,e,i+s)},triangulate(r,t){const e=r.points,i=t.points;if(e.length===0)return;const n=i.length/2;i.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),t.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},Jw={build(r){gs.build(r)},triangulate(r,t){gs.triangulate(r,t)}};var Ot=(r=>(r.MITER="miter",r.BEVEL="bevel",r.ROUND="round",r))(Ot||{}),ke=(r=>(r.BUTT="butt",r.ROUND="round",r.SQUARE="square",r))(ke||{});const Zr={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(r,t=20){if(!this.adaptive||!r||isNaN(r))return t;let e=Math.ceil(r/this.maxLength);return ethis.maxSegments&&(e=this.maxSegments),e}};class Rc{static curveTo(t,e,i,n,s,o){const a=o[o.length-2],h=o[o.length-1]-e,l=a-t,c=n-e,u=i-t,d=Math.abs(h*u-l*c);if(d<1e-8||s===0)return(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e),null;const f=h*h+l*l,p=c*c+u*u,m=h*c+l*u,g=s*Math.sqrt(f)/d,y=s*Math.sqrt(p)/d,_=g*m/f,v=y*m/p,x=g*u+y*l,w=g*c+y*h,C=l*(y+_),A=h*(y+_),S=u*(g+v),F=c*(g+v),N=Math.atan2(A-w,C-x),O=Math.atan2(F-w,S-x);return{cx:x+t,cy:w+e,radius:s,startAngle:N,endAngle:O,anticlockwise:l*c>u*h}}static arc(t,e,i,n,s,o,a,h,l){const c=a-o,u=Zr._segmentsCount(Math.abs(c)*s,Math.ceil(Math.abs(c)/as)*40),d=c/(u*2),f=d*2,p=Math.cos(d),m=Math.sin(d),g=u-1,y=g%1/g;for(let _=0;_<=g;++_){const v=_+y*_,x=d+o+f*v,w=Math.cos(x),C=-Math.sin(x);l.push((p*w+m*C)*s+i,(p*-C+m*w)*s+n)}}}class t2{constructor(){this.reset()}begin(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class yh{static curveLength(t,e,i,n,s,o,a,h){let l=0,c=0,u=0,d=0,f=0,p=0,m=0,g=0,y=0,_=0,v=0,x=t,w=e;for(let C=1;C<=10;++C)c=C/10,u=c*c,d=u*c,f=1-c,p=f*f,m=p*f,g=m*t+3*p*c*i+3*f*u*s+d*a,y=m*e+3*p*c*n+3*f*u*o+d*h,_=x-g,v=w-y,x=g,w=y,l+=Math.sqrt(_*_+v*v);return l}static curveTo(t,e,i,n,s,o,a){const h=a[a.length-2],l=a[a.length-1];a.length-=2;const c=Zr._segmentsCount(yh.curveLength(h,l,t,e,i,n,s,o));let u=0,d=0,f=0,p=0,m=0;a.push(h,l);for(let g=1,y=0;g<=c;++g)y=g/c,u=1-y,d=u*u,f=d*u,p=y*y,m=p*y,a.push(f*h+3*d*y*t+3*u*p*i+m*s,f*l+3*d*y*e+3*u*p*n+m*o)}}function Mc(r,t,e,i,n,s,o,a){const h=r-e*n,l=t-i*n,c=r+e*s,u=t+i*s;let d,f;o?(d=i,f=-e):(d=-i,f=e);const p=h+d,m=l+f,g=c+d,y=u+f;return a.push(p,m,g,y),2}function Ze(r,t,e,i,n,s,o,a){const h=e-r,l=i-t;let c=Math.atan2(h,l),u=Math.atan2(n-r,s-t);a&&cu&&(u+=Math.PI*2);let d=c;const f=u-c,p=Math.abs(f),m=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,y=f/g;if(d+=y,a){o.push(r,t,e,i);for(let _=1,v=d;_=0&&(s.join===Ot.ROUND?d+=Ze(v,x,v-A*T,x-S*T,v-F*T,x-N*T,c,!1)+4:d+=2,c.push(v-F*b,x-N*b,v+F*T,x+N*T));continue}const et=(-A+y)*(-S+x)-(-A+v)*(-S+_),rt=(-F+w)*(-N+x)-(-F+v)*(-N+C),it=(D*rt-P*et)/Q,nt=(M*et-G*rt)/Q,xt=(it-v)*(it-v)+(nt-x)*(nt-x),bt=v+(it-v)*T,ht=x+(nt-x)*T,ft=v-(it-v)*b,mt=x-(nt-x)*b,Zt=Math.min(D*D+G*G,P*P+M*M),Qt=q?T:b,ni=Zt+Qt*Qt*m,Ef=xt<=ni;let ji=s.join;if(ji===Ot.MITER&&xt/m>g&&(ji=Ot.BEVEL),Ef)switch(ji){case Ot.MITER:{c.push(bt,ht,ft,mt);break}case Ot.BEVEL:{q?c.push(bt,ht,v+A*b,x+S*b,bt,ht,v+F*b,x+N*b):c.push(v-A*T,x-S*T,ft,mt,v-F*T,x-N*T,ft,mt),d+=2;break}case Ot.ROUND:{q?(c.push(bt,ht,v+A*b,x+S*b),d+=Ze(v,x,v+A*b,x+S*b,v+F*b,x+N*b,c,!0)+4,c.push(bt,ht,v+F*b,x+N*b)):(c.push(v-A*T,x-S*T,ft,mt),d+=Ze(v,x,v-A*T,x-S*T,v-F*T,x-N*T,c,!1)+4,c.push(v-F*T,x-N*T,ft,mt));break}}else{switch(c.push(v-A*T,x-S*T,v+A*b,x+S*b),ji){case Ot.MITER:{q?c.push(ft,mt,ft,mt):c.push(bt,ht,bt,ht),d+=2;break}case Ot.ROUND:{q?d+=Ze(v,x,v+A*b,x+S*b,v+F*b,x+N*b,c,!0)+2:d+=Ze(v,x,v-A*T,x-S*T,v-F*T,x-N*T,c,!1)+2;break}}c.push(v-F*T,x-N*T,v+F*b,x+N*b),d+=2}}y=i[(u-2)*2],_=i[(u-2)*2+1],v=i[(u-1)*2],x=i[(u-1)*2+1],A=-(_-x),S=y-v,O=Math.sqrt(A*A+S*S),A/=O,S/=O,A*=p,S*=p,c.push(v-A*T,x-S*T,v+A*b,x+S*b),h||(s.cap===ke.ROUND?d+=Ze(v-A*(T-b)*.5,x-S*(T-b)*.5,v-A*T,x-S*T,v+A*b,x+S*b,c,!1)+2:s.cap===ke.SQUARE&&(d+=Mc(v,x,A,S,T,b,!1,c)));const I=t.indices,E=Zr.epsilon*Zr.epsilon;for(let R=f;R0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,i=null,n=null){const s=new ys(t,e,i,n);return this.graphicsData.push(s),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const i=new ys(t,null,null,e),n=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=n.lineStyle,n.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let t=0;t0&&(i=this.batches[this.batches.length-1],n=i.style);for(let h=this.shapeIndex;h65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t65535*2)return!1;const t=this.batches;for(let e=0;e0&&(n=wn.pop(),n||(n=new ga,n.texArray=new xa),this.drawCalls.push(n)),n.start=c,n.size=0,n.texArray.count=0,n.type=l),m.touched=1,m._batchEnabled=t,m._batchLocation=s,m.wrapMode=Ft.REPEAT,n.texArray.elements[n.texArray.count++]=m,s++)),n.size+=d.size,c+=d.size,a=m._batchLocation,this.addColors(e,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,a,d.attribSize,d.attribStart)}K._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,i=this.colors,n=this.textureIds,s=new ArrayBuffer(t.length*3*4),o=new Float32Array(s),a=new Uint32Array(s);let h=0;for(let l=0;l0&&t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:i},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new dr,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new dr,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,n=i[i.length-2],s=i[i.length-1];return(n!==t||s!==e)&&i.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this._initCurve();const s=this.currentPath.points;return s.length===0&&this.moveTo(0,0),vh.curveTo(t,e,i,n,s),this}bezierCurveTo(t,e,i,n,s,o){return this._initCurve(),yh.curveTo(t,e,i,n,s,o,this.currentPath.points),this}arcTo(t,e,i,n,s){this._initCurve(t,e);const o=this.currentPath.points,a=Rc.curveTo(t,e,i,n,s,o);if(a){const{cx:h,cy:l,radius:c,startAngle:u,endAngle:d,anticlockwise:f}=a;this.arc(h,l,c,u,d,f)}return this}arc(t,e,i,n,s,o=!1){if(n===s)return this;if(!o&&s<=n?s+=as:o&&n<=s&&(n+=as),s-n===0)return this;const a=t+Math.cos(n)*i,h=e+Math.sin(n)*i,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const u=Math.abs(c[c.length-2]-a),d=Math.abs(c[c.length-1]-h);u0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,i,n){return this.drawShape(new Y(t,e,i,n))}drawRoundedRect(t,e,i,n,s){return this.drawShape(new Is(t,e,i,n,s))}drawCircle(t,e,i){return this.drawShape(new Ss(t,e,i))}drawEllipse(t,e,i,n){return this.drawShape(new Cs(t,e,i,n))}drawPolygon(...t){let e,i=!0;const n=t[0];n.points?(i=n.closeStroke,e=n.points):Array.isArray(t[0])?e=t[0]:e=t;const s=new dr(e);return s.closeStroke=i,this.drawShape(s),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===wt.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(let n=0;n{const e=URL.createObjectURL(new Blob([Ww.code],{type:"application/javascript"})),i=new Worker(e);i.addEventListener("message",n=>{i.terminate(),URL.revokeObjectURL(e),t(n.data)})}),this._isImageBitmapSupported)}loadImageBitmap(t){return this._run("loadImageBitmap",[t])}async _initWorkers(){this._initialized||(this._initialized=!0)}getWorker(){Lo===void 0&&(Lo=navigator.hardwareConcurrency||4);let t=this.workerPool.pop();return!t&&this._createdWorkers{this.complete(e.data),this.returnWorker(e.target),this.next()})),t}returnWorker(t){this.workerPool.push(t)}complete(t){t.error!==void 0?this.resolveHash[t.uuid].reject(t.error):this.resolveHash[t.uuid].resolve(t.data),this.resolveHash[t.uuid]=null}async _run(t,e){await this._initWorkers();const i=new Promise((n,s)=>{this.queue.push({id:t,arguments:e,resolve:n,reject:s})});return this.next(),i}next(){if(!this.queue.length)return;const t=this.getWorker();if(!t)return;const e=this.queue.pop(),i=e.id;this.resolveHash[Vc]={resolve:e.resolve,reject:e.reject},t.postMessage({data:e.arguments,uuid:Vc++,id:i})}}const Xc=new Yw;function Wi(r,t,e){r.resource.internal=!0;const i=new k(r),n=()=>{delete t.promiseCache[e],ar.has(e)&&ar.remove(e)};return i.baseTexture.once("destroyed",()=>{e in t.promiseCache&&(console.warn("[Assets] A BaseTexture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the BaseTexture."),n())}),i.once("destroyed",()=>{r.destroyed||(console.warn("[Assets] A Texture managed by Assets was destroyed instead of unloaded! Use Assets.unload() instead of destroying the Texture."),n())}),i}const qw=[".jpeg",".jpg",".png",".webp",".avif"],Kw=["image/jpeg","image/png","image/webp","image/avif"];async function Zw(r){const t=await $.ADAPTER.fetch(r);if(!t.ok)throw new Error(`[loadImageBitmap] Failed to fetch ${r}: ${t.status} ${t.statusText}`);const e=await t.blob();return await createImageBitmap(e)}const Ls={name:"loadTextures",extension:{type:U.LoadParser,priority:Kt.High},config:{preferWorkers:!0,preferCreateImageBitmap:!0,crossOrigin:"anonymous"},test(r){return ei(r,Kw)||je(r,qw)},async load(r,t,e){var a;const i=globalThis.createImageBitmap&&this.config.preferCreateImageBitmap;let n;i?this.config.preferWorkers&&await Xc.isImageBitmapSupported()?n=await Xc.loadImageBitmap(r):n=await Zw(r):n=await new Promise((h,l)=>{const c=new Image;c.crossOrigin=this.config.crossOrigin,c.src=r,c.complete?h(c):(c.onload=()=>h(c),c.onerror=u=>l(u))});const s={...t.data};s.resolution??(s.resolution=Ce(r)),i&&((a=s.resourceOptions)==null?void 0:a.ownsImageBitmap)===void 0&&(s.resourceOptions={...s.resourceOptions},s.resourceOptions.ownsImageBitmap=!0);const o=new K(n,s);return o.resource.src=r,Wi(o,e,r)},unload(r){r.destroy(!0)}};z.add(Ls);const Qw=".svg",Jw="image/svg+xml",t2={extension:{type:U.LoadParser,priority:Kt.High},name:"loadSVG",test(r){return ei(r,Jw)||je(r,Qw)},async testParse(r){return Ga.test(r)},async parse(r,t,e){var s;const i=new Ga(r,(s=t==null?void 0:t.data)==null?void 0:s.resourceOptions);await i.load();const n=new K(i,{resolution:Ce(r),...t==null?void 0:t.data});return n.resource.src=t.src,Wi(n,e,t.src)},async load(r,t){return(await $.ADAPTER.fetch(r)).text()},unload:Ls.unload};z.add(t2);const e2=[".mp4",".m4v",".webm",".ogv"],r2=["video/mp4","video/webm","video/ogg"],i2={name:"loadVideo",extension:{type:U.LoadParser,priority:Kt.High},config:{defaultAutoPlay:!0},test(r){return ei(r,r2)||je(r,e2)},async load(r,t,e){var o;let i;const n=await(await $.ADAPTER.fetch(r)).blob(),s=URL.createObjectURL(n);try{const a={autoPlay:this.config.defaultAutoPlay,...(o=t==null?void 0:t.data)==null?void 0:o.resourceOptions},h=new vf(s,a);await h.load();const l=new K(h,{alphaMode:await ux(),resolution:Ce(r),...t==null?void 0:t.data});l.resource.src=r,i=Wi(l,e,r),i.baseTexture.once("destroyed",()=>{URL.revokeObjectURL(s)})}catch(a){throw URL.revokeObjectURL(s),a}return i},unload(r){r.destroy(!0)}};z.add(i2);class n2{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,e)=>`${t}${this._bundleIdConnector}${e}`,extractAssetIdFromBundle:(t,e)=>e.replace(`${t}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(e=>{this._preferredOrder.push(e),e.priority||(e.priority=Object.keys(e.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(t){if(typeof t=="string")this._defaultSearchParams=t;else{const e=t;this._defaultSearchParams=Object.keys(e).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(e[i])}`).join("&")}}getAlias(t){const{alias:e,name:i,src:n,srcs:s}=t;return Xt(e||i||n||s,o=>typeof o=="string"?o:Array.isArray(o)?o.map(a=>(a==null?void 0:a.src)??(a==null?void 0:a.srcs)??a):o!=null&&o.src||o!=null&&o.srcs?o.src??o.srcs:o,!0)}addManifest(t){this._manifest&&console.warn("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(e=>{this.addBundle(e.name,e.assets)})}addBundle(t,e){const i=[];Array.isArray(e)?e.forEach(n=>{const s=n.src??n.srcs,o=n.alias??n.name;let a;if(typeof o=="string"){const h=this._createBundleAssetId(t,o);i.push(h),a=[o,h]}else{const h=o.map(l=>this._createBundleAssetId(t,l));i.push(...h),a=[...o,...h]}this.add({...n,alias:a,src:s})}):Object.keys(e).forEach(n=>{const s=[n,this._createBundleAssetId(t,n)];if(typeof e[n]=="string")this.add({alias:s,src:e[n]});else if(Array.isArray(e[n]))this.add({alias:s,src:e[n]});else{const o=e[n],a=o.src??o.srcs;this.add({...o,alias:s,src:Array.isArray(a)?a:[a]})}i.push(...s)}),this._bundles[t]=i}add(t,e,i,n,s){const o=[];typeof t=="string"||Array.isArray(t)&&typeof t[0]=="string"?(J("7.2.0",`Assets.add now uses an object instead of individual parameters. +Please use Assets.add({ alias, src, data, format, loadParser }) instead.`),o.push({alias:t,src:e,data:i,format:n,loadParser:s})):Array.isArray(t)?o.push(...t):o.push(t);let a;a=h=>{this.hasKey(h)&&console.warn(`[Resolver] already has key: ${h} overwriting`)},Xt(o).forEach(h=>{const{src:l,srcs:c}=h;let{data:u,format:d,loadParser:f}=h;const p=Xt(l||c).map(y=>typeof y=="string"?Rw(y):Array.isArray(y)?y:[y]),m=this.getAlias(h);Array.isArray(m)?m.forEach(a):a(m);const g=[];p.forEach(y=>{y.forEach(_=>{let v={};if(typeof _!="object"){v.src=_;for(let x=0;x{this._assetMap[y]=g})})}resolveBundle(t){const e=gs(t);t=Xt(t);const i={};return t.forEach(n=>{const s=this._bundles[n];if(s){const o=this.resolve(s),a={};for(const h in o){const l=o[h];a[this._extractAssetIdFromBundle(n,h)]=l}i[n]=a}}),e?i[t[0]]:i}resolveUrl(t){const e=this.resolve(t);if(typeof t!="string"){const i={};for(const n in e)i[n]=e[n].src;return i}return e.src}resolve(t){const e=gs(t);t=Xt(t);const i={};return t.forEach(n=>{if(!this._resolverHash[n])if(this._assetMap[n]){let s=this._assetMap[n];const o=s[0],a=this._getPreferredOrder(s);a==null||a.priority.forEach(h=>{a.params[h].forEach(l=>{const c=s.filter(u=>u[h]?u[h]===l:!1);c.length&&(s=c)})}),this._resolverHash[n]=s[0]??o}else this._resolverHash[n]=this.buildResolvedAsset({alias:[n],src:n},{});i[n]=this._resolverHash[n]}),e?i[t[0]]:i}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let e=0;es.params.format.includes(i.format));if(n)return n}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const e=/\?/.test(t)?"&":"?";return`${t}${e}${this._defaultSearchParams}`}buildResolvedAsset(t,e){const{aliases:i,data:n,loadParser:s,format:o}=e;return(this._basePath||this._rootPath)&&(t.src=Et.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=i??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...n||{},...t.data},t.loadParser=s??t.loadParser,t.format=o??t.src.split(".").pop(),t.srcs=t.src,t.name=t.alias,t}}class s2{constructor(){this._detections=[],this._initialized=!1,this.resolver=new n2,this.loader=new Fw,this.cache=ar,this._backgroundLoader=new Pw(this.loader),this._backgroundLoader.active=!0,this.reset()}async init(t={}){var s,o;if(this._initialized){console.warn("[Assets]AssetManager already initialized, did you load before calling this Asset.init()?");return}if(this._initialized=!0,t.defaultSearchParams&&this.resolver.setDefaultSearchParams(t.defaultSearchParams),t.basePath&&(this.resolver.basePath=t.basePath),t.bundleIdentifier&&this.resolver.setBundleIdentifier(t.bundleIdentifier),t.manifest){let a=t.manifest;typeof a=="string"&&(a=await this.load(a)),this.resolver.addManifest(a)}const e=((s=t.texturePreference)==null?void 0:s.resolution)??1,i=typeof e=="number"?[e]:e,n=await this._detectFormats({preferredFormats:(o=t.texturePreference)==null?void 0:o.format,skipDetections:t.skipDetections,detections:this._detections});this.resolver.prefer({params:{format:n,resolution:i}}),t.preferences&&this.setPreferences(t.preferences)}add(t,e,i,n,s){this.resolver.add(t,e,i,n,s)}async load(t,e){this._initialized||await this.init();const i=gs(t),n=Xt(t).map(a=>{if(typeof a!="string"){const h=this.resolver.getAlias(a);return h.some(l=>!this.resolver.hasKey(l))&&this.add(a),Array.isArray(h)?h[0]:h}return this.resolver.hasKey(a)||this.add({alias:a,src:a}),a}),s=this.resolver.resolve(n),o=await this._mapLoadToResolve(s,e);return i?o[n[0]]:o}addBundle(t,e){this.resolver.addBundle(t,e)}async loadBundle(t,e){this._initialized||await this.init();let i=!1;typeof t=="string"&&(i=!0,t=[t]);const n=this.resolver.resolveBundle(t),s={},o=Object.keys(n);let a=0,h=0;const l=()=>{e==null||e(++a/h)},c=o.map(u=>{const d=n[u];return h+=Object.keys(d).length,this._mapLoadToResolve(d,l).then(f=>{s[u]=f})});return await Promise.all(c),i?s[t[0]]:s}async backgroundLoad(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolve(t);this._backgroundLoader.add(Object.values(e))}async backgroundLoadBundle(t){this._initialized||await this.init(),typeof t=="string"&&(t=[t]);const e=this.resolver.resolveBundle(t);Object.values(e).forEach(i=>{this._backgroundLoader.add(Object.values(i))})}reset(){this.resolver.reset(),this.loader.reset(),this.cache.reset(),this._initialized=!1}get(t){if(typeof t=="string")return ar.get(t);const e={};for(let i=0;i{const l=s[a.src],c=[a.src];a.alias&&c.push(...a.alias),o[n[h]]=l,ar.set(c,l)}),o}async unload(t){this._initialized||await this.init();const e=Xt(t).map(n=>typeof n!="string"?n.src:n),i=this.resolver.resolve(e);await this._unloadFromResolved(i)}async unloadBundle(t){this._initialized||await this.init(),t=Xt(t);const e=this.resolver.resolveBundle(t),i=Object.keys(e).map(n=>this._unloadFromResolved(e[n]));await Promise.all(i)}async _unloadFromResolved(t){const e=Object.values(t);e.forEach(i=>{ar.remove(i.src)}),await this.loader.unload(e)}async _detectFormats(t){let e=[];t.preferredFormats&&(e=Array.isArray(t.preferredFormats)?t.preferredFormats:[t.preferredFormats]);for(const i of t.detections)t.skipDetections||await i.test()?e=await i.add(e):t.skipDetections||(e=await i.remove(e));return e=e.filter((i,n)=>e.indexOf(i)===n),e}get detections(){return this._detections}get preferWorkers(){return Ls.config.preferWorkers}set preferWorkers(t){J("7.2.0","Assets.prefersWorkers is deprecated, use Assets.setPreferences({ preferWorkers: true }) instead."),this.setPreferences({preferWorkers:t})}setPreferences(t){this.loader.parsers.forEach(e=>{e.config&&Object.keys(e.config).filter(i=>i in t).forEach(i=>{e.config[i]=t[i]})})}}const vn=new s2;z.handleByList(U.LoadParser,vn.loader.parsers).handleByList(U.ResolveParser,vn.resolver.parsers).handleByList(U.CacheParser,vn.cache.parsers).handleByList(U.DetectionParser,vn.detections);const o2={extension:U.CacheParser,test:r=>Array.isArray(r)&&r.every(t=>t instanceof k),getCacheableAssets:(r,t)=>{const e={};return r.forEach(i=>{t.forEach((n,s)=>{e[i+(s===0?"":s+1)]=n})}),e}};z.add(o2);const a2={extension:{type:U.DetectionParser,priority:1},test:async()=>{const r="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=";return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=r})},add:async r=>[...r,"avif"],remove:async r=>r.filter(t=>t!=="avif")};z.add(a2);const h2={extension:{type:U.DetectionParser,priority:0},test:async()=>{const r="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAAAAAAfQ//73v/+BiOh/AAA=";return new Promise(t=>{const e=new Image;e.onload=()=>{t(!0)},e.onerror=()=>{t(!1)},e.src=r})},add:async r=>[...r,"webp"],remove:async r=>r.filter(t=>t!=="webp")};z.add(h2);const Wc=["png","jpg","jpeg"],l2={extension:{type:U.DetectionParser,priority:-1},test:()=>Promise.resolve(!0),add:async r=>[...r,...Wc],remove:async r=>r.filter(t=>!Wc.includes(t))};z.add(l2);const c2="WorkerGlobalScope"in globalThis&&globalThis instanceof globalThis.WorkerGlobalScope;function Mh(r){return c2?!1:document.createElement("video").canPlayType(r)!==""}const u2={extension:{type:U.DetectionParser,priority:0},test:async()=>Mh("video/webm"),add:async r=>[...r,"webm"],remove:async r=>r.filter(t=>t!=="webm")};z.add(u2);const d2={extension:{type:U.DetectionParser,priority:0},test:async()=>Mh("video/mp4"),add:async r=>[...r,"mp4","m4v"],remove:async r=>r.filter(t=>t!=="mp4"&&t!=="m4v")};z.add(d2);const f2={extension:{type:U.DetectionParser,priority:0},test:async()=>Mh("video/ogg"),add:async r=>[...r,"ogv"],remove:async r=>r.filter(t=>t!=="ogv")};z.add(f2);const p2={extension:U.ResolveParser,test:Ls.test,parse:r=>{var t;return{resolution:parseFloat(((t=$.RETINA_PREFIX.exec(r))==null?void 0:t[1])??"1"),format:r.split(".").pop(),src:r}}};z.add(p2);var Pt=(r=>(r[r.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",r[r.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",r[r.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",r[r.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",r[r.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",r[r.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",r[r.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",r[r.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",r[r.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",r[r.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",r[r.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",r[r.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",r[r.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",r[r.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",r[r.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",r[r.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",r[r.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",r[r.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35986]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",r[r.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",r))(Pt||{});const ys={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35986:1,34798:1,37808:1};let _e,Ir;function jc(){Ir={s3tc:_e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:_e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:_e.getExtension("WEBGL_compressed_texture_etc"),etc1:_e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:_e.getExtension("WEBGL_compressed_texture_pvrtc")||_e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:_e.getExtension("WEBGL_compressed_texture_atc"),astc:_e.getExtension("WEBGL_compressed_texture_astc")}}const m2={extension:{type:U.DetectionParser,priority:2},test:async()=>{const r=$.ADAPTER.createCanvas().getContext("webgl");return r?(_e=r,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async r=>{Ir||jc();const t=[];for(const e in Ir)Ir[e]&&t.push(e);return[...t,...r]},remove:async r=>(Ir||jc(),r.filter(t=>!(t in Ir)))};z.add(m2);class g2 extends Ps{constructor(t,e={width:1,height:1,autoLoad:!0}){let i,n;typeof t=="string"?(i=t,n=new Uint8Array):(i=null,n=t),super(n,e),this.origin=i,this.buffer=n?new Ca(n):null,this._load=null,this.loaded=!1,this.origin!==null&&e.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(t){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(t=>t.blob()).then(t=>t.arrayBuffer()).then(t=>(this.data=new Uint32Array(t),this.buffer=new Ca(t),this.loaded=!0,this.onBlobLoaded(t),this.update(),this)),this._load)}}class dr extends g2{constructor(t,e){super(t,e),this.format=e.format,this.levels=e.levels||1,this._width=e.width,this._height=e.height,this._extension=dr._formatToExtension(this.format),(e.levelBuffers||this.buffer)&&(this._levelBuffers=e.levelBuffers||dr._createLevelBuffers(t instanceof Uint8Array?t:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(t,e,i){const n=t.gl;if(!t.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;n.pixelStorei(n.UNPACK_ALIGNMENT,4);for(let s=0,o=this.levels;s=33776&&t<=33779)return"s3tc";if(t>=37488&&t<=37497)return"etc";if(t>=35840&&t<=35843)return"pvrtc";if(t>=36196)return"etc1";if(t>=35986&&t<=34798)return"atc";throw new Error("Invalid (compressed) texture format given!")}static _createLevelBuffers(t,e,i,n,s,o,a){const h=new Array(i);let l=t.byteOffset,c=o,u=a,d=c+n-1&~(n-1),f=u+s-1&~(s-1),p=d*f*ys[e];for(let m=0;m1?c:d,levelHeight:i>1?u:f,levelBuffer:new Uint8Array(t.buffer,l,p)},l+=p,c=c>>1||1,u=u>>1||1,d=c+n-1&~(n-1),f=u+s-1&~(s-1),p=d*f*ys[e];return h}}const No=4,_n=124,y2=32,Yc=20,v2=542327876,xn={SIZE:1,FLAGS:2,HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},_2={SIZE:0,FLAGS:1,FOURCC:2,RGB_BITCOUNT:3,R_BIT_MASK:4,G_BIT_MASK:5,B_BIT_MASK:6,A_BIT_MASK:7},bn={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3,MISC_FLAGS2:4},x2=1,b2=2,w2=4,T2=64,A2=512,E2=131072,S2=827611204,C2=861165636,I2=894720068,P2=808540228,R2=4,M2={[S2]:Pt.COMPRESSED_RGBA_S3TC_DXT1_EXT,[C2]:Pt.COMPRESSED_RGBA_S3TC_DXT3_EXT,[I2]:Pt.COMPRESSED_RGBA_S3TC_DXT5_EXT},F2={70:Pt.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:Pt.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:Pt.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:Pt.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:Pt.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:Pt.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:Pt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:Pt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:Pt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT};function D2(r){const t=new Uint32Array(r);if(t[0]!==v2)throw new Error("Invalid DDS file magic word");const e=new Uint32Array(r,0,_n/Uint32Array.BYTES_PER_ELEMENT),i=e[xn.HEIGHT],n=e[xn.WIDTH],s=e[xn.MIPMAP_COUNT],o=new Uint32Array(r,xn.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,y2/Uint32Array.BYTES_PER_ELEMENT),a=o[x2];if(a&w2){const h=o[_2.FOURCC];if(h!==P2){const _=M2[h],v=No+_n,x=new Uint8Array(r,v);return[new dr(x,{format:_,width:n,height:i,levels:s})]}const l=No+_n,c=new Uint32Array(t.buffer,l,Yc/Uint32Array.BYTES_PER_ELEMENT),u=c[bn.DXGI_FORMAT],d=c[bn.RESOURCE_DIMENSION],f=c[bn.MISC_FLAG],p=c[bn.ARRAY_SIZE],m=F2[u];if(m===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);if(f===R2)throw new Error("DDSParser does not support cubemap textures");if(d===6)throw new Error("DDSParser does not supported 3D texture data");const g=new Array,y=No+_n+Yc;if(p===1)g.push(new Uint8Array(r,y));else{const _=ys[m];let v=0,x=n,w=i;for(let A=0;A>>1,w=w>>>1}let C=y;for(let A=0;Anew dr(_,{format:m,width:n,height:i,levels:s}))}throw a&T2?new Error("DDSParser does not support uncompressed texture data."):a&A2?new Error("DDSParser does not supported YUV uncompressed texture data."):a&E2?new Error("DDSParser does not support single-channel (lumninance) texture data!"):a&b2?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const qc=[171,75,84,88,32,49,49,187,13,10,26,10],B2=67305985,Gt={FILE_IDENTIFIER:0,ENDIANNESS:12,GL_TYPE:16,GL_TYPE_SIZE:20,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,GL_BASE_INTERNAL_FORMAT:32,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},Za=64,Kc={[X.UNSIGNED_BYTE]:1,[X.UNSIGNED_SHORT]:2,[X.INT]:4,[X.UNSIGNED_INT]:4,[X.FLOAT]:4,[X.HALF_FLOAT]:8},L2={[B.RGBA]:4,[B.RGB]:3,[B.RG]:2,[B.RED]:1,[B.LUMINANCE]:1,[B.LUMINANCE_ALPHA]:2,[B.ALPHA]:1},O2={[X.UNSIGNED_SHORT_4_4_4_4]:2,[X.UNSIGNED_SHORT_5_5_5_1]:2,[X.UNSIGNED_SHORT_5_6_5]:2};function N2(r,t,e=!1){const i=new DataView(t);if(!k2(r,i))return null;const n=i.getUint32(Gt.ENDIANNESS,!0)===B2,s=i.getUint32(Gt.GL_TYPE,n),o=i.getUint32(Gt.GL_FORMAT,n),a=i.getUint32(Gt.GL_INTERNAL_FORMAT,n),h=i.getUint32(Gt.PIXEL_WIDTH,n),l=i.getUint32(Gt.PIXEL_HEIGHT,n)||1,c=i.getUint32(Gt.PIXEL_DEPTH,n)||1,u=i.getUint32(Gt.NUMBER_OF_ARRAY_ELEMENTS,n)||1,d=i.getUint32(Gt.NUMBER_OF_FACES,n),f=i.getUint32(Gt.NUMBER_OF_MIPMAP_LEVELS,n),p=i.getUint32(Gt.BYTES_OF_KEY_VALUE_DATA,n);if(l===0||c!==1)throw new Error("Only 2D textures are supported");if(d!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(u!==1)throw new Error("WebGL does not support array textures");const m=4,g=4,y=h+3&-4,_=l+3&-4,v=new Array(u);let x=h*l;s===0&&(x=y*_);let w;if(s!==0?Kc[s]?w=Kc[s]*L2[o]:w=O2[s]:w=ys[a],w===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const C=e?G2(i,p,n):null;let A=x*w,S=h,F=l,N=y,O=_,L=Za+p;for(let T=0;T1||s!==0?S:N,levelHeight:f>1||s!==0?F:O,levelBuffer:new Uint8Array(t,I,A)},I+=A}L+=b+4,L=L%4!==0?L+4-L%4:L,S=S>>1||1,F=F>>1||1,N=S+m-1&~(m-1),O=F+g-1&~(g-1),A=N*O*w}return s!==0?{uncompressed:v.map(T=>{let b=T[0].levelBuffer,I=!1;return s===X.FLOAT?b=new Float32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4):s===X.UNSIGNED_INT?(I=!0,b=new Uint32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4)):s===X.INT&&(I=!0,b=new Int32Array(T[0].levelBuffer.buffer,T[0].levelBuffer.byteOffset,T[0].levelBuffer.byteLength/4)),{resource:new Ps(b,{width:T[0].levelWidth,height:T[0].levelHeight}),type:s,format:I?U2(o):o}}),kvData:C}:{compressed:v.map(T=>new dr(null,{format:a,width:h,height:l,levels:f,levelBuffers:T})),kvData:C}}function k2(r,t){for(let e=0;et-n){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let h=0;for(;h{const o=new K(s,{mipmap:de.OFF,alphaMode:Ct.NO_PREMULTIPLIED_ALPHA,resolution:Ce(r),...t.data});return Wi(o,e,r)});return n.length===1?n[0]:n},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};z.add(H2);const $2={extension:{type:U.LoadParser,priority:Kt.High},name:"loadKTX",test(r){return je(r,".ktx")},async load(r,t,e){const i=await(await $.ADAPTER.fetch(r)).arrayBuffer(),{compressed:n,uncompressed:s,kvData:o}=N2(r,i),a=n??s,h={mipmap:de.OFF,alphaMode:Ct.NO_PREMULTIPLIED_ALPHA,resolution:Ce(r),...t.data},l=a.map(c=>{a===s&&Object.assign(h,{type:c.type,format:c.format});const u=c.resource??c,d=new K(u,h);return d.ktxKeyValueData=o,Wi(d,e,r)});return l.length===1?l[0]:l},unload(r){Array.isArray(r)?r.forEach(t=>t.destroy(!0)):r.destroy(!0)}};z.add($2);const z2={extension:U.ResolveParser,test:r=>{const t=r.split("?")[0].split(".").pop();return["basis","ktx","dds"].includes(t)},parse:r=>{var t,e;if(r.split("?")[0].split(".").pop()==="ktx"){const i=[".s3tc.ktx",".s3tc_sRGB.ktx",".etc.ktx",".etc1.ktx",".pvrt.ktx",".atc.ktx",".astc.ktx"];if(i.some(n=>r.endsWith(n)))return{resolution:parseFloat(((t=$.RETINA_PREFIX.exec(r))==null?void 0:t[1])??"1"),format:i.find(n=>r.endsWith(n)),src:r}}return{resolution:parseFloat(((e=$.RETINA_PREFIX.exec(r))==null?void 0:e[1])??"1"),format:r.split(".").pop(),src:r}}};z.add(z2);const wn=new Y,V2=4,Ef=class xi{constructor(t){this.renderer=t,this._rendererPremultipliedAlpha=!1}contextChange(){var e;const t=(e=this.renderer)==null?void 0:e.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(t&&t.alpha&&t.premultipliedAlpha)}async image(t,e,i,n){const s=new Image;return s.src=await this.base64(t,e,i,n),s}async base64(t,e,i,n){const s=this.canvas(t,n);if(s.toBlob!==void 0)return new Promise((o,a)=>{s.toBlob(h=>{if(!h){a(new Error("ICanvas.toBlob failed!"));return}const l=new FileReader;l.onload=()=>o(l.result),l.onerror=a,l.readAsDataURL(h)},e,i)});if(s.toDataURL!==void 0)return s.toDataURL(e,i);if(s.convertToBlob!==void 0){const o=await s.convertToBlob({type:e,quality:i});return new Promise((a,h)=>{const l=new FileReader;l.onload=()=>a(l.result),l.onerror=h,l.readAsDataURL(o)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(t,e){const{pixels:i,width:n,height:s,flipY:o,premultipliedAlpha:a}=this._rawPixels(t,e);o&&xi._flipY(i,n,s),a&&xi._unpremultiplyAlpha(i);const h=new Cx(n,s,1),l=new ImageData(new Uint8ClampedArray(i.buffer),n,s);return h.context.putImageData(l,0,0),h.canvas}pixels(t,e){const{pixels:i,width:n,height:s,flipY:o,premultipliedAlpha:a}=this._rawPixels(t,e);return o&&xi._flipY(i,n,s),a&&xi._unpremultiplyAlpha(i),i}_rawPixels(t,e){const i=this.renderer;if(!i)throw new Error("The Extract has already been destroyed");let n,s=!1,o=!1,a,h=!1;t&&(t instanceof vr?a=t:(a=i.generateTexture(t,{region:e,resolution:i.resolution,multisample:i.multisample}),h=!0,e&&(wn.width=e.width,wn.height=e.height,e=wn)));const l=i.gl;if(a){if(n=a.baseTexture.resolution,e=e??a.frame,s=!1,o=a.baseTexture.alphaMode>0&&a.baseTexture.format===B.RGBA,!h){i.renderTexture.bind(a);const f=a.framebuffer.glFramebuffers[i.CONTEXT_UID];f.blitFramebuffer&&i.framebuffer.bind(f.blitFramebuffer)}}else n=i.resolution,e||(e=wn,e.width=i.width/n,e.height=i.height/n),s=!0,o=this._rendererPremultipliedAlpha,i.renderTexture.bind();const c=Math.max(Math.round(e.width*n),1),u=Math.max(Math.round(e.height*n),1),d=new Uint8Array(V2*c*u);return l.readPixels(Math.round(e.x*n),Math.round(e.y*n),c,u,l.RGBA,l.UNSIGNED_BYTE,d),h&&(a==null||a.destroy(!0)),{pixels:d,width:c,height:u,flipY:s,premultipliedAlpha:o}}destroy(){this.renderer=null}static _flipY(t,e,i){const n=e<<2,s=i>>1,o=new Uint8Array(n);for(let a=0;a=0&&a>=0&&n>=0&&s>=0)){t.length=0;return}const h=Math.ceil(2.3*Math.sqrt(o+a)),l=h*8+(n?4:0)+(s?4:0);if(t.length=l,l===0)return;if(h===0){t.length=8,t[0]=t[6]=e+n,t[1]=t[3]=i+s,t[2]=t[4]=e-n,t[5]=t[7]=i-s;return}let c=0,u=h*4+(n?2:0)+2,d=u,f=l;{const p=n+o,m=s,g=e+p,y=e-p,_=i+m;if(t[c++]=g,t[c++]=_,t[--u]=_,t[--u]=y,s){const v=i-m;t[d++]=y,t[d++]=v,t[--f]=v,t[--f]=g}}for(let p=1;p0||t&&i<=0){const n=e/2;for(let s=n+n%2;s=6){Zc(e,!1);const o=[];for(let l=0;l=0&&s>=0&&o.push(e,i,e+n,i,e+n,i+s,e,i+s)},triangulate(r,t){const e=r.points,i=t.points;if(e.length===0)return;const n=i.length/2;i.push(e[0],e[1],e[2],e[3],e[6],e[7],e[4],e[5]),t.indices.push(n,n+1,n+2,n+1,n+2,n+3)}},j2={build(r){vs.build(r)},triangulate(r,t){vs.triangulate(r,t)}};var Ot=(r=>(r.MITER="miter",r.BEVEL="bevel",r.ROUND="round",r))(Ot||{}),ke=(r=>(r.BUTT="butt",r.ROUND="round",r.SQUARE="square",r))(ke||{});const Kr={adaptive:!0,maxLength:10,minSegments:8,maxSegments:2048,epsilon:1e-4,_segmentsCount(r,t=20){if(!this.adaptive||!r||isNaN(r))return t;let e=Math.ceil(r/this.maxLength);return ethis.maxSegments&&(e=this.maxSegments),e}};class Qc{static curveTo(t,e,i,n,s,o){const a=o[o.length-2],h=o[o.length-1]-e,l=a-t,c=n-e,u=i-t,d=Math.abs(h*u-l*c);if(d<1e-8||s===0)return(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e),null;const f=h*h+l*l,p=c*c+u*u,m=h*c+l*u,g=s*Math.sqrt(f)/d,y=s*Math.sqrt(p)/d,_=g*m/f,v=y*m/p,x=g*u+y*l,w=g*c+y*h,C=l*(y+_),A=h*(y+_),S=u*(g+v),F=c*(g+v),N=Math.atan2(A-w,C-x),O=Math.atan2(F-w,S-x);return{cx:x+t,cy:w+e,radius:s,startAngle:N,endAngle:O,anticlockwise:l*c>u*h}}static arc(t,e,i,n,s,o,a,h,l){const c=a-o,u=Kr._segmentsCount(Math.abs(c)*s,Math.ceil(Math.abs(c)/ls)*40),d=c/(u*2),f=d*2,p=Math.cos(d),m=Math.sin(d),g=u-1,y=g%1/g;for(let _=0;_<=g;++_){const v=_+y*_,x=d+o+f*v,w=Math.cos(x),C=-Math.sin(x);l.push((p*w+m*C)*s+i,(p*-C+m*w)*s+n)}}}class Y2{constructor(){this.reset()}begin(t,e,i){this.reset(),this.style=t,this.start=e,this.attribStart=i}end(t,e){this.attribSize=e-this.attribStart,this.size=t-this.start}reset(){this.style=null,this.size=0,this.start=0,this.attribStart=0,this.attribSize=0}}class Fh{static curveLength(t,e,i,n,s,o,a,h){let l=0,c=0,u=0,d=0,f=0,p=0,m=0,g=0,y=0,_=0,v=0,x=t,w=e;for(let C=1;C<=10;++C)c=C/10,u=c*c,d=u*c,f=1-c,p=f*f,m=p*f,g=m*t+3*p*c*i+3*f*u*s+d*a,y=m*e+3*p*c*n+3*f*u*o+d*h,_=x-g,v=w-y,x=g,w=y,l+=Math.sqrt(_*_+v*v);return l}static curveTo(t,e,i,n,s,o,a){const h=a[a.length-2],l=a[a.length-1];a.length-=2;const c=Kr._segmentsCount(Fh.curveLength(h,l,t,e,i,n,s,o));let u=0,d=0,f=0,p=0,m=0;a.push(h,l);for(let g=1,y=0;g<=c;++g)y=g/c,u=1-y,d=u*u,f=d*u,p=y*y,m=p*y,a.push(f*h+3*d*y*t+3*u*p*i+m*s,f*l+3*d*y*e+3*u*p*n+m*o)}}function Jc(r,t,e,i,n,s,o,a){const h=r-e*n,l=t-i*n,c=r+e*s,u=t+i*s;let d,f;o?(d=i,f=-e):(d=-i,f=e);const p=h+d,m=l+f,g=c+d,y=u+f;return a.push(p,m,g,y),2}function Ze(r,t,e,i,n,s,o,a){const h=e-r,l=i-t;let c=Math.atan2(h,l),u=Math.atan2(n-r,s-t);a&&cu&&(u+=Math.PI*2);let d=c;const f=u-c,p=Math.abs(f),m=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,y=f/g;if(d+=y,a){o.push(r,t,e,i);for(let _=1,v=d;_=0&&(s.join===Ot.ROUND?d+=Ze(v,x,v-A*T,x-S*T,v-F*T,x-N*T,c,!1)+4:d+=2,c.push(v-F*b,x-N*b,v+F*T,x+N*T));continue}const et=(-A+y)*(-S+x)-(-A+v)*(-S+_),rt=(-F+w)*(-N+x)-(-F+v)*(-N+C),it=(D*rt-P*et)/Q,nt=(M*et-G*rt)/Q,xt=(it-v)*(it-v)+(nt-x)*(nt-x),bt=v+(it-v)*T,ht=x+(nt-x)*T,ft=v-(it-v)*b,mt=x-(nt-x)*b,Zt=Math.min(D*D+G*G,P*P+M*M),Qt=q?T:b,ri=Zt+Qt*Qt*m,Qf=xt<=ri;let Yi=s.join;if(Yi===Ot.MITER&&xt/m>g&&(Yi=Ot.BEVEL),Qf)switch(Yi){case Ot.MITER:{c.push(bt,ht,ft,mt);break}case Ot.BEVEL:{q?c.push(bt,ht,v+A*b,x+S*b,bt,ht,v+F*b,x+N*b):c.push(v-A*T,x-S*T,ft,mt,v-F*T,x-N*T,ft,mt),d+=2;break}case Ot.ROUND:{q?(c.push(bt,ht,v+A*b,x+S*b),d+=Ze(v,x,v+A*b,x+S*b,v+F*b,x+N*b,c,!0)+4,c.push(bt,ht,v+F*b,x+N*b)):(c.push(v-A*T,x-S*T,ft,mt),d+=Ze(v,x,v-A*T,x-S*T,v-F*T,x-N*T,c,!1)+4,c.push(v-F*T,x-N*T,ft,mt));break}}else{switch(c.push(v-A*T,x-S*T,v+A*b,x+S*b),Yi){case Ot.MITER:{q?c.push(ft,mt,ft,mt):c.push(bt,ht,bt,ht),d+=2;break}case Ot.ROUND:{q?d+=Ze(v,x,v+A*b,x+S*b,v+F*b,x+N*b,c,!0)+2:d+=Ze(v,x,v-A*T,x-S*T,v-F*T,x-N*T,c,!1)+2;break}}c.push(v-F*T,x-N*T,v+F*b,x+N*b),d+=2}}y=i[(u-2)*2],_=i[(u-2)*2+1],v=i[(u-1)*2],x=i[(u-1)*2+1],A=-(_-x),S=y-v,O=Math.sqrt(A*A+S*S),A/=O,S/=O,A*=p,S*=p,c.push(v-A*T,x-S*T,v+A*b,x+S*b),h||(s.cap===ke.ROUND?d+=Ze(v-A*(T-b)*.5,x-S*(T-b)*.5,v-A*T,x-S*T,v+A*b,x+S*b,c,!1)+2:s.cap===ke.SQUARE&&(d+=Jc(v,x,A,S,T,b,!1,c)));const I=t.indices,E=Kr.epsilon*Kr.epsilon;for(let R=f;R0&&(this.invalidate(),this.clearDirty++,this.graphicsData.length=0),this}drawShape(t,e=null,i=null,n=null){const s=new _s(t,e,i,n);return this.graphicsData.push(s),this.dirty++,this}drawHole(t,e=null){if(!this.graphicsData.length)return null;const i=new _s(t,null,null,e),n=this.graphicsData[this.graphicsData.length-1];return i.lineStyle=n.lineStyle,n.holes.push(i),this.dirty++,this}destroy(){super.destroy();for(let t=0;t0&&(i=this.batches[this.batches.length-1],n=i.style);for(let h=this.shapeIndex;h65535;this.indicesUint16&&this.indices.length===this.indicesUint16.length&&a===this.indicesUint16.BYTES_PER_ELEMENT>2?this.indicesUint16.set(this.indices):this.indicesUint16=a?new Uint32Array(this.indices):new Uint16Array(this.indices),this.batchable=this.isBatchable(),this.batchable?this.packBatches():this.buildDrawCalls()}_compareStyles(t,e){return!(!t||!e||t.texture.baseTexture!==e.texture.baseTexture||t.color+t.alpha!==e.color+e.alpha||!!t.native!=!!e.native)}validateBatching(){if(this.dirty===this.cacheDirty||!this.graphicsData.length)return!1;for(let t=0,e=this.graphicsData.length;t65535*2)return!1;const t=this.batches;for(let e=0;e0&&(n=Tn.pop(),n||(n=new Ra,n.texArray=new Ba),this.drawCalls.push(n)),n.start=c,n.size=0,n.texArray.count=0,n.type=l),m.touched=1,m._batchEnabled=t,m._batchLocation=s,m.wrapMode=Ft.REPEAT,n.texArray.elements[n.texArray.count++]=m,s++)),n.size+=d.size,c+=d.size,a=m._batchLocation,this.addColors(e,p.color,p.alpha,d.attribSize,d.attribStart),this.addTextureIds(i,a,d.attribSize,d.attribStart)}K._globalBatch=t,this.packAttributes()}packAttributes(){const t=this.points,e=this.uvs,i=this.colors,n=this.textureIds,s=new ArrayBuffer(t.length*3*4),o=new Float32Array(s),a=new Uint32Array(s);let h=0;for(let l=0;l0&&t.alpha>0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._lineStyle,{visible:i},t)):this._lineStyle.reset(),this}startPoly(){if(this.currentPath){const t=this.currentPath.points,e=this.currentPath.points.length;e>2&&(this.drawShape(this.currentPath),this.currentPath=new ur,this.currentPath.closeStroke=!1,this.currentPath.points.push(t[e-2],t[e-1]))}else this.currentPath=new ur,this.currentPath.closeStroke=!1}finishPoly(){this.currentPath&&(this.currentPath.points.length>2?(this.drawShape(this.currentPath),this.currentPath=null):this.currentPath.points.length=0)}moveTo(t,e){return this.startPoly(),this.currentPath.points[0]=t,this.currentPath.points[1]=e,this}lineTo(t,e){this.currentPath||this.moveTo(0,0);const i=this.currentPath.points,n=i[i.length-2],s=i[i.length-1];return(n!==t||s!==e)&&i.push(t,e),this}_initCurve(t=0,e=0){this.currentPath?this.currentPath.points.length===0&&(this.currentPath.points=[t,e]):this.moveTo(t,e)}quadraticCurveTo(t,e,i,n){this._initCurve();const s=this.currentPath.points;return s.length===0&&this.moveTo(0,0),Dh.curveTo(t,e,i,n,s),this}bezierCurveTo(t,e,i,n,s,o){return this._initCurve(),Fh.curveTo(t,e,i,n,s,o,this.currentPath.points),this}arcTo(t,e,i,n,s){this._initCurve(t,e);const o=this.currentPath.points,a=Qc.curveTo(t,e,i,n,s,o);if(a){const{cx:h,cy:l,radius:c,startAngle:u,endAngle:d,anticlockwise:f}=a;this.arc(h,l,c,u,d,f)}return this}arc(t,e,i,n,s,o=!1){if(n===s)return this;if(!o&&s<=n?s+=ls:o&&n<=s&&(n+=ls),s-n===0)return this;const a=t+Math.cos(n)*i,h=e+Math.sin(n)*i,l=this._geometry.closePointEps;let c=this.currentPath?this.currentPath.points:null;if(c){const u=Math.abs(c[c.length-2]-a),d=Math.abs(c[c.length-1]-h);u0;return i?(t.matrix&&(t.matrix=t.matrix.clone(),t.matrix.invert()),Object.assign(this._fillStyle,{visible:i},t)):this._fillStyle.reset(),this}endFill(){return this.finishPoly(),this._fillStyle.reset(),this}drawRect(t,e,i,n){return this.drawShape(new Y(t,e,i,n))}drawRoundedRect(t,e,i,n,s){return this.drawShape(new Fs(t,e,i,n,s))}drawCircle(t,e,i){return this.drawShape(new Rs(t,e,i))}drawEllipse(t,e,i,n){return this.drawShape(new Ms(t,e,i,n))}drawPolygon(...t){let e,i=!0;const n=t[0];n.points?(i=n.closeStroke,e=n.points):Array.isArray(t[0])?e=t[0]:e=t;const s=new ur(e);return s.closeStroke=i,this.drawShape(s),this}drawShape(t){return this._holeMode?this._geometry.drawHole(t,this._matrix):this._geometry.drawShape(t,this._fillStyle.clone(),this._lineStyle.clone(),this._matrix),this}clear(){return this._geometry.clear(),this._lineStyle.reset(),this._fillStyle.reset(),this._boundsID++,this._matrix=null,this._holeMode=!1,this.currentPath=null,this}isFastRect(){const t=this._geometry.graphicsData;return t.length===1&&t[0].shape.type===wt.RECT&&!t[0].matrix&&!t[0].holes.length&&!(t[0].lineStyle.visible&&t[0].lineStyle.width)}_render(t){this.finishPoly();const e=this._geometry;e.updateBatches(),e.batchable?(this.batchDirty!==e.batchDirty&&this._populateBatches(),this._renderBatched(t)):(t.batch.flush(),this._renderDirect(t))}_populateBatches(){const t=this._geometry,e=this.blendMode,i=t.batches.length;this.batchTint=-1,this._transformID=-1,this.batchDirty=t.batchDirty,this.batches.length=i,this.vertexData=new Float32Array(t.points);for(let n=0;n0){const p=h.x-t[d].x,m=h.y-t[d].y,g=Math.sqrt(p*p+m*m);h=t[d],a+=g/l}else a=d/(c-1);s[f]=a,s[f+1]=0,s[f+2]=a,s[f+3]=1}let u=0;for(let d=0;d0?this.textureScale*this._width/2:this._width/2;for(let l=0;l0?this.build():this.updateVertices()}}class Lc extends Qr{constructor(t,e,i=0){const n=new a2(t.height,e,i),s=new Jr(t);i>0&&(t.baseTexture.wrapMode=Ft.REPEAT),super(n,s),this.autoUpdate=!0}_render(t){const e=this.geometry;(this.autoUpdate||e._width!==this.shader.texture.height)&&(e._width=this.shader.texture.height,e.update()),super._render(t)}}class Oc{constructor(t,e,i){this.geometry=new He,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(let n=0;n0){const p=h.x-t[d].x,m=h.y-t[d].y,g=Math.sqrt(p*p+m*m);h=t[d],a+=g/l}else a=d/(c-1);s[f]=a,s[f+1]=0,s[f+2]=a,s[f+3]=1}let u=0;for(let d=0;d0?this.textureScale*this._width/2:this._width/2;for(let l=0;l0?this.build():this.updateVertices()}}class iu extends Zr{constructor(t,e,i=0){const n=new eT(t.height,e,i),s=new Qr(t);i>0&&(t.baseTexture.wrapMode=Ft.REPEAT),super(n,s),this.autoUpdate=!0}_render(t){const e=this.geometry;(this.autoUpdate||e._width!==this.shader.texture.height)&&(e._width=this.shader.texture.height,e.update()),super._render(t)}}class nu{constructor(t,e,i){this.geometry=new He,this.indexBuffer=null,this.size=i,this.dynamicProperties=[],this.staticProperties=[];for(let n=0;ni&&!t.autoResize&&(o=i);let a=t._buffers;a||(a=t._buffers=this.generateBuffers(t));const h=e[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=id(t.blendMode,l),s.state.set(this.state);const c=s.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=at.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,p=0;fn&&(m=n),p>=a.length&&a.push(this._generateOneMoreBuffer(t));const g=a[p];g.uploadDynamic(e,f,m);const y=t._bufferUpdateIDs[p]||0;d=d||g._updateID0);n[o]=l,n[o+s]=l,n[o+s*2]=l,n[o+s*3]=l,o+=s*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}nf.extension={name:"particle",type:U.RendererPlugin};z.add(nf);var Ds=(r=>(r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",r))(Ds||{});const Tn={willReadFrequently:!0},re=class V{static get experimentalLetterSpacingSupported(){let t=V._experimentalLetterSpacingSupported;if(t!==void 0){const e=$.ADAPTER.getCanvasRenderingContext2D().prototype;t=V._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,i,n,s,o,a,h,l){this.text=t,this.style=e,this.width=i,this.height=n,this.lines=s,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=h,this.fontProperties=l}static measureText(t,e,i,n=V._canvas){i=i??e.wordWrap;const s=e.toFontString(),o=V.measureFont(s);o.fontSize===0&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);const a=n.getContext("2d",Tn);a.font=s;const h=(i?V.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let c=0;for(let p=0;p0&&(n?s-=e:s+=(V.graphemeSegmenter(t).length-1)*e),s}static wordWrap(t,e,i=V._canvas){const n=i.getContext("2d",Tn);let s=0,o="",a="";const h=Object.create(null),{letterSpacing:l,whiteSpace:c}=e,u=V.collapseSpaces(c),d=V.collapseNewlines(c);let f=!u;const p=e.wordWrapWidth+l,m=V.tokenize(t);for(let g=0;gp)if(o!==""&&(a+=V.addLine(o),o="",s=0),V.canBreakWords(y,e.breakWords)){const v=V.wordWrapSplit(y);for(let x=0;xp&&(a+=V.addLine(o),f=!1,o="",s=0),o+=w,s+=S}}else{o.length>0&&(a+=V.addLine(o),o="",s=0);const v=g===m.length-1;a+=V.addLine(y,!v),f=!1,o="",s=0}else _+s>p&&(f=!1,a+=V.addLine(o),o="",s=0),(o.length>0||!V.isBreakingSpace(y)||f)&&(o+=y,s+=_)}return a+=V.addLine(o,!1),a}static addLine(t,e=!0){return t=V.trimRight(t),t=e?`${t} -`:t,t}static getFromCache(t,e,i,n){let s=i[t];return typeof s!="number"&&(s=V._measureText(t,e,n)+e,i[t]=s),s}static collapseSpaces(t){return t==="normal"||t==="pre-line"}static collapseNewlines(t){return t==="normal"}static trimRight(t){if(typeof t!="string")return"";for(let e=t.length-1;e>=0;e--){const i=t[e];if(!V.isBreakingSpace(i))break;t=t.slice(0,-1)}return t}static isNewline(t){return typeof t!="string"?!1:V._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,e){return typeof t!="string"?!1:V._breakingSpaces.includes(t.charCodeAt(0))}static tokenize(t){const e=[];let i="";if(typeof t!="string")return e;for(let n=0;na;--d){for(let m=0;m{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const r=new Intl.Segmenter;return t=>[...r.segment(t)].map(e=>e.segment)}return r=>[...r]})(),re.experimentalLetterSpacing=!1,re._fonts={},re._newlines=[10,13],re._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let De=re;const c2=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],sf=class Ti{constructor(t){this.styleID=0,this.reset(),Io(this,t,t)}clone(){const t={};return Io(t,this,Ti.defaultStyle),new Ti(t)}reset(){Io(this,Ti.defaultStyle,Ti.defaultStyle)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){const e=Co(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){const e=Co(t);this._fill!==e&&(this._fill=e,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){u2(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.styleID++)}get stroke(){return this._stroke}set stroke(t){const e=Co(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}toFontString(){const t=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(let i=e.length-1;i>=0;i--){let n=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!c2.includes(n)&&(n=`"${n}"`),e[i]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};sf.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Ds.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let ze=sf;function Co(r){const t=at.shared,e=i=>{const n=t.setValue(i);return n.alpha===1?n.toHex():n.toRgbaString()};return Array.isArray(r)?r.map(e):e(r)}function u2(r,t){if(!Array.isArray(r)||!Array.isArray(t)||r.length!==t.length)return!1;for(let e=0;e0&&p>m&&(g=(m+p)/2);const y=m+d,_=i.lineHeight*(f+1);let v=y;f+10}}function p2(r,t){var i;let e=!1;if((i=r==null?void 0:r._textures)!=null&&i.length){for(let n=0;n{this.queue&&this.prepareItems()},this.registerFindHook(_2),this.registerFindHook(x2),this.registerFindHook(p2),this.registerFindHook(m2),this.registerFindHook(g2),this.registerUploadHook(y2),this.registerUploadHook(v2)}upload(t){return new Promise(e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,Mt.system.addOnce(this.tick,this,yr.UTILITY))):e()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const t=this.queue[0];let e=!1;if(t&&!t._destroyed){for(let i=0,n=this.uploadHooks.length;i=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&Mt.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};hf.uploadsPerFrame=4;let Ga=hf;Object.defineProperties($,{UPLOADS_PER_FRAME:{get(){return Ga.uploadsPerFrame},set(r){J("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),Ga.uploadsPerFrame=r}}});function cf(r,t){return t instanceof K?(t._glTextures[r.CONTEXT_UID]||r.texture.bind(t),!0):!1}function b2(r,t){if(!(t instanceof Ri))return!1;const{geometry:e}=t;t.finishPoly(),e.updateBatches();const{batches:i}=e;for(let n=0;ni&&!t.autoResize&&(o=i);let a=t._buffers;a||(a=t._buffers=this.generateBuffers(t));const h=e[0]._texture.baseTexture,l=h.alphaMode>0;this.state.blendMode=Rd(t.blendMode,l),s.state.set(this.state);const c=s.gl,u=t.worldTransform.copyTo(this.tempMatrix);u.prepend(s.globalUniforms.uniforms.projectionMatrix),this.shader.uniforms.translationMatrix=u.toArray(!0),this.shader.uniforms.uColor=at.shared.setValue(t.tintRgb).premultiply(t.worldAlpha,l).toArray(this.shader.uniforms.uColor),this.shader.uniforms.uSampler=h,this.renderer.shader.bind(this.shader);let d=!1;for(let f=0,p=0;fn&&(m=n),p>=a.length&&a.push(this._generateOneMoreBuffer(t));const g=a[p];g.uploadDynamic(e,f,m);const y=t._bufferUpdateIDs[p]||0;d=d||g._updateID0);n[o]=l,n[o+s]=l,n[o+s*2]=l,n[o+s*3]=l,o+=s*4}}destroy(){super.destroy(),this.shader&&(this.shader.destroy(),this.shader=null),this.tempMatrix=null}}Mf.extension={name:"particle",type:U.RendererPlugin};z.add(Mf);var Ns=(r=>(r[r.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",r[r.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",r))(Ns||{});const An={willReadFrequently:!0},re=class V{static get experimentalLetterSpacingSupported(){let t=V._experimentalLetterSpacingSupported;if(t!==void 0){const e=$.ADAPTER.getCanvasRenderingContext2D().prototype;t=V._experimentalLetterSpacingSupported="letterSpacing"in e||"textLetterSpacing"in e}return t}constructor(t,e,i,n,s,o,a,h,l){this.text=t,this.style=e,this.width=i,this.height=n,this.lines=s,this.lineWidths=o,this.lineHeight=a,this.maxLineWidth=h,this.fontProperties=l}static measureText(t,e,i,n=V._canvas){i=i??e.wordWrap;const s=e.toFontString(),o=V.measureFont(s);o.fontSize===0&&(o.fontSize=e.fontSize,o.ascent=e.fontSize);const a=n.getContext("2d",An);a.font=s;const h=(i?V.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),l=new Array(h.length);let c=0;for(let p=0;p0&&(n?s-=e:s+=(V.graphemeSegmenter(t).length-1)*e),s}static wordWrap(t,e,i=V._canvas){const n=i.getContext("2d",An);let s=0,o="",a="";const h=Object.create(null),{letterSpacing:l,whiteSpace:c}=e,u=V.collapseSpaces(c),d=V.collapseNewlines(c);let f=!u;const p=e.wordWrapWidth+l,m=V.tokenize(t);for(let g=0;gp)if(o!==""&&(a+=V.addLine(o),o="",s=0),V.canBreakWords(y,e.breakWords)){const v=V.wordWrapSplit(y);for(let x=0;xp&&(a+=V.addLine(o),f=!1,o="",s=0),o+=w,s+=S}}else{o.length>0&&(a+=V.addLine(o),o="",s=0);const v=g===m.length-1;a+=V.addLine(y,!v),f=!1,o="",s=0}else _+s>p&&(f=!1,a+=V.addLine(o),o="",s=0),(o.length>0||!V.isBreakingSpace(y)||f)&&(o+=y,s+=_)}return a+=V.addLine(o,!1),a}static addLine(t,e=!0){return t=V.trimRight(t),t=e?`${t} +`:t,t}static getFromCache(t,e,i,n){let s=i[t];return typeof s!="number"&&(s=V._measureText(t,e,n)+e,i[t]=s),s}static collapseSpaces(t){return t==="normal"||t==="pre-line"}static collapseNewlines(t){return t==="normal"}static trimRight(t){if(typeof t!="string")return"";for(let e=t.length-1;e>=0;e--){const i=t[e];if(!V.isBreakingSpace(i))break;t=t.slice(0,-1)}return t}static isNewline(t){return typeof t!="string"?!1:V._newlines.includes(t.charCodeAt(0))}static isBreakingSpace(t,e){return typeof t!="string"?!1:V._breakingSpaces.includes(t.charCodeAt(0))}static tokenize(t){const e=[];let i="";if(typeof t!="string")return e;for(let n=0;na;--d){for(let m=0;m{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const r=new Intl.Segmenter;return t=>[...r.segment(t)].map(e=>e.segment)}return r=>[...r]})(),re.experimentalLetterSpacing=!1,re._fonts={},re._newlines=[10,13],re._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let De=re;const nT=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ff=class bi{constructor(t){this.styleID=0,this.reset(),$o(this,t,t)}clone(){const t={};return $o(t,this,bi.defaultStyle),new bi(t)}reset(){$o(this,bi.defaultStyle,bi.defaultStyle)}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(this._dropShadow=t,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(t){this._dropShadowAlpha!==t&&(this._dropShadowAlpha=t,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(t){this._dropShadowAngle!==t&&(this._dropShadowAngle=t,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(t){this._dropShadowBlur!==t&&(this._dropShadowBlur=t,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(t){const e=Ho(t);this._dropShadowColor!==e&&(this._dropShadowColor=e,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(t){this._dropShadowDistance!==t&&(this._dropShadowDistance=t,this.styleID++)}get fill(){return this._fill}set fill(t){const e=Ho(t);this._fill!==e&&(this._fill=e,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(t){this._fillGradientType!==t&&(this._fillGradientType=t,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(t){sT(this._fillGradientStops,t)||(this._fillGradientStops=t,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(t){this.fontFamily!==t&&(this._fontFamily=t,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(this._fontSize=t,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.styleID++)}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(t){this._lineJoin!==t&&(this._lineJoin=t,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(t){this._miterLimit!==t&&(this._miterLimit=t,this.styleID++)}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.styleID++)}get stroke(){return this._stroke}set stroke(t){const e=Ho(t);this._stroke!==e&&(this._stroke=e,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(t){this._strokeThickness!==t&&(this._strokeThickness=t,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.styleID++)}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.styleID++)}toFontString(){const t=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let e=this.fontFamily;Array.isArray(this.fontFamily)||(e=this.fontFamily.split(","));for(let i=e.length-1;i>=0;i--){let n=e[i].trim();!/([\"\'])[^\'\"]+\1/.test(n)&&!nT.includes(n)&&(n=`"${n}"`),e[i]=n}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${t} ${e.join(",")}`}};Ff.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:Ns.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let ze=Ff;function Ho(r){const t=at.shared,e=i=>{const n=t.setValue(i);return n.alpha===1?n.toHex():n.toRgbaString()};return Array.isArray(r)?r.map(e):e(r)}function sT(r,t){if(!Array.isArray(r)||!Array.isArray(t)||r.length!==t.length)return!1;for(let e=0;e0&&p>m&&(g=(m+p)/2);const y=m+d,_=i.lineHeight*(f+1);let v=y;f+10}}function hT(r,t){var i;let e=!1;if((i=r==null?void 0:r._textures)!=null&&i.length){for(let n=0;n{this.queue&&this.prepareItems()},this.registerFindHook(fT),this.registerFindHook(pT),this.registerFindHook(hT),this.registerFindHook(lT),this.registerFindHook(cT),this.registerUploadHook(uT),this.registerUploadHook(dT)}upload(t){return new Promise(e=>{t&&this.add(t),this.queue.length?(this.completes.push(e),this.ticking||(this.ticking=!0,Mt.system.addOnce(this.tick,this,gr.UTILITY))):e()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const t=this.queue[0];let e=!1;if(t&&!t._destroyed){for(let i=0,n=this.uploadHooks.length;i=0;e--)this.add(t.children[e]);return this}destroy(){this.ticking&&Mt.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};Lf.uploadsPerFrame=4;let th=Lf;Object.defineProperties($,{UPLOADS_PER_FRAME:{get(){return th.uploadsPerFrame},set(r){J("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),th.uploadsPerFrame=r}}});function Nf(r,t){return t instanceof K?(t._glTextures[r.CONTEXT_UID]||r.texture.bind(t),!0):!1}function mT(r,t){if(!(t instanceof Ii))return!1;const{geometry:e}=t;t.finishPoly(),e.updateBatches();const{batches:i}=e;for(let n=0;n1?ue.from(A2,T2,e):ue.from(Nc,E2,e)}render(t){const e=this.renderer,i=this.quad;let n=i.vertices;n[0]=n[6]=t._width*-t.anchor.x,n[1]=n[3]=t._height*-t.anchor.y,n[2]=n[4]=t._width*(1-t.anchor.x),n[5]=n[7]=t._height*(1-t.anchor.y);const s=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;n=i.uvs,n[0]=n[6]=-s,n[1]=n[3]=-o,n[2]=n[4]=1-s,n[5]=n[7]=1-o,i.invalidate();const a=t._texture,h=a.baseTexture,l=h.alphaMode>0,c=t.tileTransform.localTransform,u=t.uvMatrix;let d=h.isPowerOfTwo&&a.frame.width===h.width&&a.frame.height===h.height;d&&(h._glTextures[e.CONTEXT_UID]?d=h.wrapMode!==Ft.CLAMP:h.wrapMode===Ft.CLAMP&&(h.wrapMode=Ft.REPEAT));const f=d?this.simpleShader:this.shader,p=a.width,m=a.height,g=t._width,y=t._height;An.set(c.a*p/g,c.b*p/y,c.c*m/g,c.d*m/y,c.tx/g,c.ty/y),An.invert(),d?An.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=An.toArray(!0),f.uniforms.uColor=at.shared.setValue(t.tint).premultiply(t.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,e.shader.bind(f),e.geometry.bind(i),this.state.blendMode=id(t.blendMode,l),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}df.extension={name:"tilingSprite",type:U.RendererPlugin};z.add(df);const ff=class Ai{constructor(t,e,i=null){this.linkedSheets=[],this._texture=t instanceof k?t:null,this.baseTexture=t instanceof K?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;const n=this.baseTexture.resource;this.resolution=this._updateResolution(i||(n?n.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(t=null){const{scale:e}=this.data.meta;let i=Ce(t,null);return i===null&&(i=parseFloat(e??"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=Ai.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const i=Ai.BATCH_SIZE;for(;e-t{this._batchIndex*Ai.BATCH_SIZE{i[n]=t}),Object.keys(t.textures).forEach(n=>{i[n]=t.textures[n]}),!e){const n=Et.dirname(r[0]);t.linkedSheets.forEach((s,o)=>{const a=pf([`${n}/${t.data.meta.related_multi_packs[o]}`],s,!0);Object.assign(i,a)})}return i}const I2={extension:U.Asset,cache:{test:r=>r instanceof kc,getCacheableAssets:(r,t)=>pf(r,t,!1)},resolver:{test:r=>{const t=r.split("?")[0].split("."),e=t.pop(),i=t.pop();return e==="json"&&C2.includes(i)},parse:r=>{var e;const t=r.split(".");return{resolution:parseFloat(((e=$.RETINA_PREFIX.exec(r))==null?void 0:e[1])??"1"),format:t[t.length-2],src:r}}},loader:{name:"spritesheetLoader",extension:{type:U.LoadParser,priority:Kt.Normal},async testParse(r,t){return Et.extname(t.src).toLowerCase()===".json"&&!!r.frames},async parse(r,t,e){var h,l;let i=Et.dirname(t.src);i&&i.lastIndexOf("/")!==i.length-1&&(i+="/");let n=i+r.meta.image;n=Oa(n,t.src);const s=(await e.load([n]))[n],o=new kc(s.baseTexture,r,t.src);await o.parse();const a=(h=r==null?void 0:r.meta)==null?void 0:h.related_multi_packs;if(Array.isArray(a)){const c=[];for(const d of a){if(typeof d!="string")continue;let f=i+d;(l=t.data)!=null&&l.ignoreMultiPack||(f=Oa(f,t.src),c.push(e.load({src:f,data:{ignoreMultiPack:!0}})))}const u=await Promise.all(c);o.linkedSheets=u,u.forEach(d=>{d.linkedSheets=[o].concat(o.linkedSheets.filter(f=>f!==d))})}return o},unload(r){r.destroy(!0)}}};z.add(I2);class vs{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Un{static test(t){return typeof t=="string"&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const s in e){const o=e[s].match(/^[a-z]+/gm)[0],a=e[s].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(const l in a){const c=a[l].split("="),u=c[0],d=c[1].replace(/"/gm,""),f=parseFloat(d),p=isNaN(f)?d:f;h[u]=p}i[o].push(h)}const n=new vs;return i.info.forEach(s=>n.info.push({face:s.face,size:parseInt(s.size,10)})),i.common.forEach(s=>n.common.push({lineHeight:parseInt(s.lineHeight,10)})),i.page.forEach(s=>n.page.push({id:parseInt(s.id,10),file:s.file})),i.char.forEach(s=>n.char.push({id:parseInt(s.id,10),page:parseInt(s.page,10),x:parseInt(s.x,10),y:parseInt(s.y,10),width:parseInt(s.width,10),height:parseInt(s.height,10),xoffset:parseInt(s.xoffset,10),yoffset:parseInt(s.yoffset,10),xadvance:parseInt(s.xadvance,10)})),i.kerning.forEach(s=>n.kerning.push({first:parseInt(s.first,10),second:parseInt(s.second,10),amount:parseInt(s.amount,10)})),i.distanceField.forEach(s=>n.distanceField.push({distanceRange:parseInt(s.distanceRange,10),fieldType:s.fieldType})),n}}class Ha{static test(t){const e=t;return typeof t!="string"&&"getElementsByTagName"in t&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(t){const e=new vs,i=t.getElementsByTagName("info"),n=t.getElementsByTagName("common"),s=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),a=t.getElementsByTagName("kerning"),h=t.getElementsByTagName("distanceField");for(let l=0;l")?Ha.test($.ADAPTER.parseXML(t)):!1}static parse(t){return Ha.parse($.ADAPTER.parseXML(t))}}const Po=[Un,Ha,$a];function P2(r){for(let t=0;t=h-N*o){if(m===0)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${A}')`);--C,g=null,y=null,_=null,m=0,p=0,v=0;continue}if(v=Math.max(N+S.fontProperties.descent,v),O*o+p>=d){if(p===0)throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${A}')`);--C,m+=v*o,m=Math.ceil(m),p=0,v=0;continue}M2(g,y,S,p,m,o,u);const L=Gn(S.text);f.char.push({id:L,page:x.length-1,x:p/o,y:m/o,width:O,height:N,xoffset:0,yoffset:0,xadvance:F-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),p+=(O+2*s)*o,p=Math.ceil(p)}if(!(i!=null&&i.skipKerning))for(let C=0,A=c.length;C1?ue.from(vT,yT,e):ue.from(su,_T,e)}render(t){const e=this.renderer,i=this.quad;let n=i.vertices;n[0]=n[6]=t._width*-t.anchor.x,n[1]=n[3]=t._height*-t.anchor.y,n[2]=n[4]=t._width*(1-t.anchor.x),n[5]=n[7]=t._height*(1-t.anchor.y);const s=t.uvRespectAnchor?t.anchor.x:0,o=t.uvRespectAnchor?t.anchor.y:0;n=i.uvs,n[0]=n[6]=-s,n[1]=n[3]=-o,n[2]=n[4]=1-s,n[5]=n[7]=1-o,i.invalidate();const a=t._texture,h=a.baseTexture,l=h.alphaMode>0,c=t.tileTransform.localTransform,u=t.uvMatrix;let d=h.isPowerOfTwo&&a.frame.width===h.width&&a.frame.height===h.height;d&&(h._glTextures[e.CONTEXT_UID]?d=h.wrapMode!==Ft.CLAMP:h.wrapMode===Ft.CLAMP&&(h.wrapMode=Ft.REPEAT));const f=d?this.simpleShader:this.shader,p=a.width,m=a.height,g=t._width,y=t._height;En.set(c.a*p/g,c.b*p/y,c.c*m/g,c.d*m/y,c.tx/g,c.ty/y),En.invert(),d?En.prepend(u.mapCoord):(f.uniforms.uMapCoord=u.mapCoord.toArray(!0),f.uniforms.uClampFrame=u.uClampFrame,f.uniforms.uClampOffset=u.uClampOffset),f.uniforms.uTransform=En.toArray(!0),f.uniforms.uColor=at.shared.setValue(t.tint).premultiply(t.worldAlpha,l).toArray(f.uniforms.uColor),f.uniforms.translationMatrix=t.transform.worldTransform.toArray(!0),f.uniforms.uSampler=a,e.shader.bind(f),e.geometry.bind(i),this.state.blendMode=Rd(t.blendMode,l),e.state.set(this.state),e.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}Uf.extension={name:"tilingSprite",type:U.RendererPlugin};z.add(Uf);const Gf=class wi{constructor(t,e,i=null){this.linkedSheets=[],this._texture=t instanceof k?t:null,this.baseTexture=t instanceof K?t:this._texture.baseTexture,this.textures={},this.animations={},this.data=e;const n=this.baseTexture.resource;this.resolution=this._updateResolution(i||(n?n.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(t=null){const{scale:e}=this.data.meta;let i=Ce(t,null);return i===null&&(i=parseFloat(e??"1")),i!==1&&this.baseTexture.setResolution(i),i}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=wi.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(t){let e=t;const i=wi.BATCH_SIZE;for(;e-t{this._batchIndex*wi.BATCH_SIZE{i[n]=t}),Object.keys(t.textures).forEach(n=>{i[n]=t.textures[n]}),!e){const n=Et.dirname(r[0]);t.linkedSheets.forEach((s,o)=>{const a=Hf([`${n}/${t.data.meta.related_multi_packs[o]}`],s,!0);Object.assign(i,a)})}return i}const wT={extension:U.Asset,cache:{test:r=>r instanceof ou,getCacheableAssets:(r,t)=>Hf(r,t,!1)},resolver:{test:r=>{const t=r.split("?")[0].split("."),e=t.pop(),i=t.pop();return e==="json"&&bT.includes(i)},parse:r=>{var e;const t=r.split(".");return{resolution:parseFloat(((e=$.RETINA_PREFIX.exec(r))==null?void 0:e[1])??"1"),format:t[t.length-2],src:r}}},loader:{name:"spritesheetLoader",extension:{type:U.LoadParser,priority:Kt.Normal},async testParse(r,t){return Et.extname(t.src).toLowerCase()===".json"&&!!r.frames},async parse(r,t,e){var h,l;let i=Et.dirname(t.src);i&&i.lastIndexOf("/")!==i.length-1&&(i+="/");let n=i+r.meta.image;n=Ka(n,t.src);const s=(await e.load([n]))[n],o=new ou(s.baseTexture,r,t.src);await o.parse();const a=(h=r==null?void 0:r.meta)==null?void 0:h.related_multi_packs;if(Array.isArray(a)){const c=[];for(const d of a){if(typeof d!="string")continue;let f=i+d;(l=t.data)!=null&&l.ignoreMultiPack||(f=Ka(f,t.src),c.push(e.load({src:f,data:{ignoreMultiPack:!0}})))}const u=await Promise.all(c);o.linkedSheets=u,u.forEach(d=>{d.linkedSheets=[o].concat(o.linkedSheets.filter(f=>f!==d))})}return o},unload(r){r.destroy(!0)}}};z.add(wT);class xs{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class Hn{static test(t){return typeof t=="string"&&t.startsWith("info face=")}static parse(t){const e=t.match(/^[a-z]+\s+.+$/gm),i={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const s in e){const o=e[s].match(/^[a-z]+/gm)[0],a=e[s].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),h={};for(const l in a){const c=a[l].split("="),u=c[0],d=c[1].replace(/"/gm,""),f=parseFloat(d),p=isNaN(f)?d:f;h[u]=p}i[o].push(h)}const n=new xs;return i.info.forEach(s=>n.info.push({face:s.face,size:parseInt(s.size,10)})),i.common.forEach(s=>n.common.push({lineHeight:parseInt(s.lineHeight,10)})),i.page.forEach(s=>n.page.push({id:parseInt(s.id,10),file:s.file})),i.char.forEach(s=>n.char.push({id:parseInt(s.id,10),page:parseInt(s.page,10),x:parseInt(s.x,10),y:parseInt(s.y,10),width:parseInt(s.width,10),height:parseInt(s.height,10),xoffset:parseInt(s.xoffset,10),yoffset:parseInt(s.yoffset,10),xadvance:parseInt(s.xadvance,10)})),i.kerning.forEach(s=>n.kerning.push({first:parseInt(s.first,10),second:parseInt(s.second,10),amount:parseInt(s.amount,10)})),i.distanceField.forEach(s=>n.distanceField.push({distanceRange:parseInt(s.distanceRange,10),fieldType:s.fieldType})),n}}class eh{static test(t){const e=t;return typeof t!="string"&&"getElementsByTagName"in t&&e.getElementsByTagName("page").length&&e.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(t){const e=new xs,i=t.getElementsByTagName("info"),n=t.getElementsByTagName("common"),s=t.getElementsByTagName("page"),o=t.getElementsByTagName("char"),a=t.getElementsByTagName("kerning"),h=t.getElementsByTagName("distanceField");for(let l=0;l")?eh.test($.ADAPTER.parseXML(t)):!1}static parse(t){return eh.parse($.ADAPTER.parseXML(t))}}const zo=[Hn,eh,rh];function TT(r){for(let t=0;t=h-N*o){if(m===0)throw new Error(`[BitmapFont] textureHeight ${h}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${A}')`);--C,g=null,y=null,_=null,m=0,p=0,v=0;continue}if(v=Math.max(N+S.fontProperties.descent,v),O*o+p>=d){if(p===0)throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${A}')`);--C,m+=v*o,m=Math.ceil(m),p=0,v=0;continue}ET(g,y,S,p,m,o,u);const L=$n(S.text);f.char.push({id:L,page:x.length-1,x:p/o,y:m/o,width:O,height:N,xoffset:0,yoffset:0,xadvance:F-(u.dropShadow?u.dropShadowDistance:0)-(u.stroke?u.strokeThickness:0)}),p+=(O+2*s)*o,p=Math.ceil(p)}if(!(i!=null&&i.skipKerning))for(let C=0,A=c.length;C{this.dirty=!0},this,0,0),this._roundPixels=$.ROUND_PIXELS,this.dirty=!0,this._resolution=$.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var O;const t=Re.available[this._fontName],e=this.fontSize,i=e/t.size,n=new Z,s=[],o=[],a=[],h=this._text.replace(/(?:\r\n|\r)/g,` -`)||" ",l=mf(h),c=this._maxWidth*t.size/e,u=t.distanceFieldType==="none"?Uc:Gc;let d=null,f=0,p=0,m=0,g=-1,y=0,_=0,v=0,x=0;for(let L=0;L0&&n.x>c&&(++_,$r(s,1+g-_,1+L-g),L=g,g=-1,o.push(y),a.push(s.length>0?s[s.length-1].prevSpaces:0),p=Math.max(p,y),m++,n.x=0,n.y+=t.lineHeight,d=null,x=0)}const w=l[l.length-1];w!=="\r"&&w!==` -`&&(/(?:\s)/.test(w)&&(f=y),o.push(f),p=Math.max(p,f),a.push(-1));const C=[];for(let L=0;L<=m;L++){let T=0;this._align==="right"?T=p-o[L]:this._align==="center"?T=(p-o[L])/2:this._align==="justify"&&(T=a[L]<0?0:(p-o[L])/a[L]),C.push(T)}const A=s.length,S={},F=[],N=this._activePagesMeshData;u.push(...N);for(let L=0;L6*b)||T.vertices.lengthe[n.mesh.texture.baseTexture.uid]).forEach(n=>{n.mesh.texture=k.EMPTY});for(const n in e)e[n].destroy(),delete e[n];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}};L2.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const O2=[".xml",".fnt"],N2={extension:{type:U.LoadParser,priority:Kt.Normal},name:"loadBitmapFont",test(r){return O2.includes(Et.extname(r).toLowerCase())},async testParse(r){return Un.test(r)||$a.test(r)},async parse(r,t,e){const i=Un.test(r)?Un.parse(r):$a.parse(r),{src:n}=t,{page:s}=i,o=[];for(let l=0;la[l]);return Re.install(i,h,!0)},async load(r,t){return(await $.ADAPTER.fetch(r)).text()},unload(r){r.destroy()}};z.add(N2);const za=class Rr extends ze{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(t){return new Rr(Object.keys(Rr.defaultOptions).reduce((e,i)=>({...e,[i]:t[i]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(t=>{URL.revokeObjectURL(t.src),t.refs--,t.refs===0&&(t.fontFace&&document.fonts.delete(t.fontFace),delete Rr.availableFonts[t.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(t,e={}){const{availableFonts:i}=Rr;if(i[t]){const n=i[t];return this._fonts.push(n),n.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return $.ADAPTER.fetch(t).then(n=>n.blob()).then(async n=>new Promise((s,o)=>{const a=URL.createObjectURL(n),h=new FileReader;h.onload=()=>s([a,h.result]),h.onerror=o,h.readAsDataURL(n)})).then(async([n,s])=>{const o=Object.assign({family:Et.basename(t,Et.extname(t)),weight:"normal",style:"normal",display:"auto",src:n,dataSrc:s,refs:1,originalUrl:t,fontFace:null},e);i[t]=o,this._fonts.push(o),this.styleID++;const a=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...t){const e=t.filter(i=>!this._overrides.includes(i));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter(i=>this._overrides.includes(i));e.length>0&&(this._overrides=this._overrides.filter(i=>!e.includes(i)),this.styleID++)}toCSS(t){return[`transform: scale(${t})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((t,e)=>`${t} +`;const au=[],hu=[],lu=[],PT=class zf extends Bt{constructor(t,e={}){super();const{align:i,tint:n,maxWidth:s,letterSpacing:o,fontName:a,fontSize:h}=Object.assign({},zf.styleDefaults,e);if(!Re.available[a])throw new Error(`Missing BitmapFont "${a}"`);this._activePagesMeshData=[],this._textWidth=0,this._textHeight=0,this._align=i,this._tintColor=new at(n),this._font=void 0,this._fontName=a,this._fontSize=h,this.text=t,this._maxWidth=s,this._maxLineHeight=0,this._letterSpacing=o,this._anchor=new Te(()=>{this.dirty=!0},this,0,0),this._roundPixels=$.ROUND_PIXELS,this.dirty=!0,this._resolution=$.RESOLUTION,this._autoResolution=!0,this._textureCache={}}updateText(){var O;const t=Re.available[this._fontName],e=this.fontSize,i=e/t.size,n=new Z,s=[],o=[],a=[],h=this._text.replace(/(?:\r\n|\r)/g,` +`)||" ",l=$f(h),c=this._maxWidth*t.size/e,u=t.distanceFieldType==="none"?au:hu;let d=null,f=0,p=0,m=0,g=-1,y=0,_=0,v=0,x=0;for(let L=0;L0&&n.x>c&&(++_,Hr(s,1+g-_,1+L-g),L=g,g=-1,o.push(y),a.push(s.length>0?s[s.length-1].prevSpaces:0),p=Math.max(p,y),m++,n.x=0,n.y+=t.lineHeight,d=null,x=0)}const w=l[l.length-1];w!=="\r"&&w!==` +`&&(/(?:\s)/.test(w)&&(f=y),o.push(f),p=Math.max(p,f),a.push(-1));const C=[];for(let L=0;L<=m;L++){let T=0;this._align==="right"?T=p-o[L]:this._align==="center"?T=(p-o[L])/2:this._align==="justify"&&(T=a[L]<0?0:(p-o[L])/a[L]),C.push(T)}const A=s.length,S={},F=[],N=this._activePagesMeshData;u.push(...N);for(let L=0;L6*b)||T.vertices.lengthe[n.mesh.texture.baseTexture.uid]).forEach(n=>{n.mesh.texture=k.EMPTY});for(const n in e)e[n].destroy(),delete e[n];this._font=null,this._tintColor=null,this._textureCache=null,super.destroy(t)}};PT.styleDefaults={align:"left",tint:16777215,maxWidth:0,letterSpacing:0};const RT=[".xml",".fnt"],MT={extension:{type:U.LoadParser,priority:Kt.Normal},name:"loadBitmapFont",test(r){return RT.includes(Et.extname(r).toLowerCase())},async testParse(r){return Hn.test(r)||rh.test(r)},async parse(r,t,e){const i=Hn.test(r)?Hn.parse(r):rh.parse(r),{src:n}=t,{page:s}=i,o=[];for(let l=0;la[l]);return Re.install(i,h,!0)},async load(r,t){return(await $.ADAPTER.fetch(r)).text()},unload(r){r.destroy()}};z.add(MT);const ih=class Pr extends ze{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(t){return new Pr(Object.keys(Pr.defaultOptions).reduce((e,i)=>({...e,[i]:t[i]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(t=>{URL.revokeObjectURL(t.src),t.refs--,t.refs===0&&(t.fontFace&&document.fonts.delete(t.fontFace),delete Pr.availableFonts[t.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(t,e={}){const{availableFonts:i}=Pr;if(i[t]){const n=i[t];return this._fonts.push(n),n.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return $.ADAPTER.fetch(t).then(n=>n.blob()).then(async n=>new Promise((s,o)=>{const a=URL.createObjectURL(n),h=new FileReader;h.onload=()=>s([a,h.result]),h.onerror=o,h.readAsDataURL(n)})).then(async([n,s])=>{const o=Object.assign({family:Et.basename(t,Et.extname(t)),weight:"normal",style:"normal",display:"auto",src:n,dataSrc:s,refs:1,originalUrl:t,fontFace:null},e);i[t]=o,this._fonts.push(o),this.styleID++;const a=new FontFace(o.family,`url(${o.src})`,{weight:o.weight,style:o.style,display:o.display});o.fontFace=a,await a.load(),document.fonts.add(a),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...t){const e=t.filter(i=>!this._overrides.includes(i));e.length>0&&(this._overrides.push(...e),this.styleID++)}removeOverride(...t){const e=t.filter(i=>this._overrides.includes(i));e.length>0&&(this._overrides=this._overrides.filter(i=>!e.includes(i)),this.styleID++)}toCSS(t){return[`transform: scale(${t})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((t,e)=>`${t} @font-face { font-family: "${e.family}"; src: url('${e.dataSrc}'); font-weight: ${e.weight}; font-style: ${e.style}; font-display: ${e.display}; - }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=P_(t)),typeof t=="number"?I_(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(e*255|0).toString(16).padStart(2,"0"));const s=`${i}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${s} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${s} ${t}`}reset(){Object.assign(this,Rr.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise(e=>setTimeout(e,100)):Promise.resolve()}get isSafari(){const{userAgent:t}=$.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};za.availableFonts={},za.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Ro=za;const En=class Mr extends ri{constructor(t="",e={}){super(k.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,n=k.from(i,{scaleMode:$.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new Y,n.trim=new Y,this.texture=n;const s="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg"),h=document.createElementNS(s,"foreignObject"),l=document.createElementNS(o,"div"),c=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=Mr.defaultMaxWidth,this.maxHeight=Mr.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=Mr.defaultAutoResolution,this._resolution=Mr.defaultResolution??$.RESOLUTION,this.text=t,this.style=e}measureText(t){var c,u;const{text:e,style:i,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:i.toCSS(n)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const s=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=s;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+i.padding*2,height:l+i.padding*2}}async updateText(t=!0){const{style:e,_image:i,_loadImage:n}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:s,height:o}=this.measureText();i.width=n.width=Math.ceil(Math.max(1,s)),i.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(h=>{n.onload=async()=>{if(a/gi,"

").replace(/
/gi,"
").replace(/ /gi," ")}};En.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},En.defaultMaxWidth=2024,En.defaultMaxHeight=2024,En.defaultAutoResolution=!0;class hA{constructor(t){const e={width:Su,height:Cu,antialias:!0,backgroundAlpha:0,clearBeforeRender:!0,preserveDrawingBuffer:!0,...t};this.renderer=Nd(e),this.stage=new Bt}destroy(){var i,n,s,o,a;(i=this.stage)==null||i.destroy({children:!0,texture:!0,baseTexture:!0}),this.stage=void 0;const t=(n=this.renderer)==null?void 0:n.type,e=this.renderer instanceof Rs?(s=this.renderer)==null?void 0:s.gl:void 0;t===nh.WEBGL&&e&&((o=e==null?void 0:e.getExtension("WEBGL_lose_context"))==null||o.loseContext()),(a=this.renderer)==null||a.destroy(!0),this.renderer=void 0}get view(){var t;return(t=this.renderer)==null?void 0:t.view}render(){var t;this.stage!=null&&((t=this.renderer)==null||t.render(this.stage))}}class k2 extends Eu{constructor(t,e,i){var n;super(e,i),this.ctx=t,this.container=new Bt,(n=this.ctx.stage)==null||n.addChild(this.container)}render(){this.ctx.render()}addChild(t){this.container.addChild(t)}clearLayer(){this.container.removeChildren().forEach(e=>{e.destroy()})}onMount(t){var e,i;super.onMount(t),this.pixiViewContainer=((e=this.element)==null?void 0:e.querySelector("#webgl-layer"))??void 0,this.pixiViewContainer||(this.pixiViewContainer=document.createElement("div"),this.pixiViewContainer.setAttribute("id",`${this.id}`),this.pixiViewContainer.setAttribute("class","webgl-layer"),this.ctx.view!=null&&this.pixiViewContainer.appendChild(this.ctx.view),(i=this.element)==null||i.appendChild(this.pixiViewContainer),this.updateStyle())}onUnmount(t){var e,i;super.onUnmount(t),this.clearLayer(),(e=this.ctx.stage)==null||e.removeChild(this.container),this.container.destroy(),(i=this.pixiViewContainer)==null||i.remove(),this.pixiViewContainer=void 0}onResize(t){var e;super.onResize(t),(e=this.ctx.renderer)==null||e.resize(t.width,t.height)}onRescale(t){super.onRescale(t);const e=t.xBounds[0]>t.xBounds[1],i=t.yBounds[0]>t.yBounds[1];this.setContainerPosition(t.xScale(0),t.yScale(0)),this.setContainerScale(t.xRatio*(e?-1:1),t.yRatio*(i?-1:1))}setContainerPosition(t,e){this.container.position.set(t,e)}setContainerScale(t,e){this.container.scale.set(t,e)}updateStyle(t){var s;const e=t||this.isVisible,i=this.interactive?"auto":"none";this.container.visible=e;const n=[["position","absolute"],["pointer-events",`${i}`],["z-index",`${this.order}`],["opacity",`${this.opacity}`]].map(o=>o.join(":")).join(";");(s=this.pixiViewContainer)==null||s.setAttribute("style",n)}setVisibility(t,e){super.setVisibility(t,e),this.pixiViewContainer&&this.updateStyle(t)}onOpacityChanged(t){this.pixiViewContainer&&this.updateStyle()}onOrderChanged(t){this.pixiViewContainer&&this.updateStyle()}onInteractivityChanged(t){this.pixiViewContainer&&this.updateStyle()}renderType(){var t;return(t=this.ctx.renderer)==null?void 0:t.type}}function xh(r){throw new Error(`Unexpected object: ${JSON.stringify(r)}`)}const U2=r=>r.kind==="pAndASymbol",G2=r=>r.kind==="cementSqueeze",H2=r=>r.kind==="cementPlug",$2=(r,t,e)=>i=>{switch(i.kind){case"screen":return r(i);case"tubing":return t(i);case"completionSymbol":return e(i);default:return xh(i)}},Ye=(r,t)=>{switch(t){case"Perforation":return r.Perforation(t);case"Open hole gravel pack":return r.OpenHoleGravelPack(t);case"Open hole frac pack":return r.OpenHoleFracPack(t);case"Cased hole fracturation":return r.CasedHoleFracturation(t);case"Cased hole frac pack":return r.CasedHoleFracPack(t);case"Cased hole gravel pack":return r.CasedHoleGravelPack(t);default:return xh(t)}},z2=r=>Ye({Perforation:()=>!1,OpenHoleGravelPack:()=>!0,OpenHoleFracPack:()=>!0,CasedHoleFracturation:()=>!1,CasedHoleGravelPack:()=>!0,CasedHoleFracPack:()=>!0},r.subKind);function V2(r){return Ye({Perforation:()=>!1,OpenHoleGravelPack:()=>!1,OpenHoleFracPack:()=>!0,CasedHoleFracturation:()=>!0,CasedHoleGravelPack:()=>!1,CasedHoleFracPack:()=>!0},r.subKind)}function X2(r){return Ye({Perforation:()=>!0,OpenHoleGravelPack:()=>!1,OpenHoleFracPack:()=>!1,CasedHoleFracturation:()=>!1,CasedHoleGravelPack:()=>!1,CasedHoleFracPack:()=>!1},r.subKind)}function W2(r){return Ye({Perforation:()=>!1,OpenHoleGravelPack:()=>!1,OpenHoleFracPack:()=>!1,CasedHoleFracturation:()=>!1,CasedHoleGravelPack:()=>!0,CasedHoleFracPack:()=>!1},r.subKind)}function j2(r){return Ye({Perforation:()=>!1,OpenHoleGravelPack:()=>!1,OpenHoleFracPack:()=>!1,CasedHoleFracturation:()=>!1,CasedHoleGravelPack:()=>!1,CasedHoleFracPack:()=>!0},r.subKind)}const Y2=r=>r.subKind==="Cased hole fracturation",q2=(r,t)=>r.startt.start,K2=r=>({holeLayerId:`${r}-hole`,casingLayerId:`${r}-casing`,completionLayerId:`${r}-completion`,cementLayerId:`${r}-cement`,pAndALayerId:`${r}-pAndA`,perforationLayerId:`${r}-perforation`}),Z2={firstColor:"#8c541d",secondColor:"#eee3d8",lineColor:"#8b4513"},Q2={solidColor:"#dcdcdc",lineColor:"#575757",shoeSize:{width:m1,length:g1},windowOptions:{dashColor:"#dc0000",dashLength:5,spaceLength:3}},J2={stroke:"rgba(0, 0, 0, 0.25)",yellow:"#FFFC00",grey:"gray",red:"#FF5050",outline:"black",transparent:"rgba(255, 255, 255, 0)",spikeWidth:50,spikeLength:50,packingOpacity:.7,fracLineCurve:10,fracLineLength:25,scalingFactor:25},tT={firstColor:"#c7b9ab",secondColor:"#5b5b5b",scalingFactor:4},eT={firstColor:"#8b6713",secondColor:"#000000",scalingFactor:4},rT={scalingFactor:4,lineColor:"#63666a"},iT={scalingFactor:1,innerColor:"#eeeeff",outerColor:"#777788"},nT={firstColor:"#c7b9ab",secondColor:"#000000",scalingFactor:4},sT=16,oT=6;function xe(r){const t=Ue(r);if(t!=null){const e=t==null?void 0:t.formatHex();return parseInt(e.replace("#","0x"))}else throw Error(`Could not format string ${r} to hex code.`)}function lA(r){return typeof r=="string"?r:`#${r.toString(sT).padStart(oT,"0")}`}const aT=2147483648,hT=4294967295;function cA(r,t,e){const i=e.filter(f=>f.data.values),n=pT(i),s=new Map,o=dT(n,t,s);fT(o);const a=lT(n,r),h=_T(r,o,t),l=uT(s,h),u=[...cT(l,r),...Object.values(h).flat().filter(f=>!f.exclude)];return{lines:a,areas:u}}function lT(r,t){return r.filter(i=>i.visualization==="line").map(i=>({id:i.name,label:i.name,width:2,color:xe(i.color||"black"),data:t.map((n,s)=>[n[0],i.values[s]])}))}function cT(r,t){return r.map((i,n)=>{const s=n+1[o[0],i.top[a],...s?[s.top[a]]:[]])}})}function uT(r,t){return Array.from(r.values()).sort((i,n)=>i.age-n.age).filter(i=>{const n=t[i.name],s=n&&n.length>0;return s||console.warn(`Intersection surface group '${i.name}' has no valid entries and will be discarded.`),s}).map((i,n)=>{const o=t[i.name][0];return{id:i.name,label:i.name,color:gT(n),top:o.data.map(a=>a[1])}})}function dT(r,t,e){const i=t&&t.find(o=>o.stratUnitLevel===1),n=i?i.identifier:"SEABED";return r.filter(o=>o.visualization==="interval"||o.visualization==="none").map(o=>{const a=[],h=yf(t,o.name,a);h||console.warn(`No match for ${o.name} in strat column`);const l=a[0]||h,c=l&&l.identifier||n;return l&&!e.has(c)&&e.set(c,{age:l.topAge,name:l.identifier}),{...o,unit:h,group:c}})}function fT(r){r.sort((t,e)=>{if(!t.unit&&!e.unit)return 0;if(!t.unit)return-1;if(!e.unit)return 1;const i=t.isBase?t.unit.baseAge:t.unit.topAge,n=e.isBase?e.unit.baseAge:e.unit.topAge;return i!==n?i-n:t.isBase&&!e.isBase?1:!t.isBase&&e.isBase?-1:t.unit.stratUnitLevel-e.unit.stratUnitLevel})}function yf(r,t,e=[]){const i=r.find(n=>n.identifier.toLowerCase()===t.toLowerCase());if(i){let n=i;do e.unshift(n),n=r.find(s=>s.identifier===n.stratUnitParent);while(n);return i}return null}function pT(r){return r.map(t=>{const e=t.visualSettings.displayName,i=e.replace(/\s(Base|Top)/gi,""),n=e.toLowerCase().endsWith("base");return{name:i,isBase:n,values:t.data.values,color:t.visualSettings.colors.crossSection,visualization:t.visualSettings.crossSection.toLowerCase()}})}function mT(r){return r.colorR===null||r.colorG===null||r.colorB===null?aT:r.colorR<<16|r.colorG<<8|r.colorB}const gT=Xc().domain([0,100]).range(yp(Di("#e6f1cf","#85906d"),10));function yT(r,t,e,i){const n=t+1;if(!e||n>=e.length)return;const s=e.findIndex(o=>o.isBase&&o.name===r.name);if(s!==-1)return s;for(let o=n;ot.name===n.identifier)}function _T(r,t,e){return t.reduce((n,s,o)=>{var a;if(!s.isBase){n[s.group]||(n[s.group]=[]);const h=yT(s,o,t,e);(a=n[s.group])==null||a.push({id:s.name,label:s.name,color:s.unit&&mT(s.unit)||hT,exclude:s.visualization==="none"||!s.unit,data:r.map((l,c)=>{const u=s.values[c]!=null?xT(h,t,c):void 0;return[l[0],s.values[c],u]})})}return n},{})}function xT(r,t,e){var i,n;if(!(!t||!r||r>=t.length)){for(let s=r;si+n),this.useTexture=e.useTexture,this.options=e,this.setLineStyle()}setLineStyle(){const t=this.options;if(this.useTexture){const e=Me.getTexture(t,this.dashSize);this.graphics.lineTextureStyle({width:t.width*t.scale,color:t.color,alpha:t.alpha,texture:e,alignment:t.alignment})}else this.graphics.lineStyle({width:t.width*t.scale,color:t.color,alpha:t.alpha,cap:t.cap,join:t.join,alignment:t.alignment});this.scale=t.scale}static distance(t,e,i,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(n-e,2))}moveTo(t,e){return this.lineLength=0,this.cursor.set(t,e),this.start=new Z(t,e),this.graphics.moveTo(this.cursor.x,this.cursor.y),this}lineTo(t,e,i){typeof this.lineLength===void 0&&this.moveTo(0,0);const n=Me.distance(this.cursor.x,this.cursor.y,t,e),s=Math.atan2(e-this.cursor.y,t-this.cursor.x),o=i&&t===this.start.x&&e===this.start.y;if(this.useTexture)if(this.graphics.moveTo(this.cursor.x,this.cursor.y),this.adjustLineStyle(s),o&&this.dash.length%2===0){const a=Math.min(this.dash[this.dash.length-1],n);this.graphics.lineTo(t-Math.cos(s)*a,e-Math.sin(s)*a),this.graphics.closePath()}else this.graphics.lineTo(t,e);else{const a=Math.cos(s),h=Math.sin(s);let l=this.cursor.x,c=this.cursor.y;const u=this.lineLength%(this.dashSize*this.scale);let d=0,f=0,p=0;for(let g=0;g0;){const g=this.dash[d]*this.scale-f,y=m>g?g:m;if(o&&Me.distance(l+a*y,c+h*y,this.start.x,this.start.y)<=y){if(d%2===0){const v=Me.distance(l,c,this.start.x,this.start.y)-this.dash[this.dash.length-1]*this.scale;l+=a*v,c+=h*v,this.graphics.lineTo(l,c)}break}l+=a*y,c+=h*y,d%2?this.graphics.moveTo(l,c):this.graphics.lineTo(l,c),m-=y,d++,d=d===this.dash.length?0:d,f=0}}return this.lineLength+=n,this.cursor.set(t,e),this}closePath(){this.lineTo(this.start.x,this.start.y,!0)}drawCircle(t,e,i,n=80,s){const o=Math.PI*2/n;let a=0,h;s?(h=new Z(t+Math.cos(a)*i,e+Math.sin(a)*i),s.apply(h,h),this.moveTo(h[0],h[1])):(h=new Z(t+Math.cos(a)*i,e+Math.sin(a)*i),this.moveTo(h.x,h.y)),a+=o;for(let l=1;lnew eu(r.x,r.y),TT=r=>new Z(r[0],r[1]),_f=r=>{if(r.length<2)return[new eu(0)];let t;return r.map((e,i,n)=>{const s=n[i],o=n[i+1];if(i{const i=Va(r);return TT(i.add(t.scale(e)))},Xa=(r,t,e)=>{if(r.length!==t.length)throw new Error("Number of vectors does not match number of points");return r.map((i,n)=>{const s=t[n];if(s!=null)return xf(i,s,e);throw new Error(`Trying to read index ${n} of point ${i}, but no such vector was found!`)})},$c=(r,t,e,i)=>r<=i&&e<=t,AT=(r,t,e,i)=>rArray.from(new Set(r)),Bs=(r,t,e,i)=>{const n=i.filter(o=>$c(r,t,o.start,o.end)),s=e.filter(o=>$c(r,t,o.start,o.end));return{overlappingHoles:n,overlappingOuterStrings:s}},Ls=([r,t],e)=>{const s=e.flatMap(a=>[a.start-1e-4,a.start,a.end,a.end+1e-4]).filter(a=>a>=r&&a<=t);return s.push(r),s.push(t),ET(s).sort((a,h)=>a-h)},Rt=r=>r.kind==="casing"?r.innerDiameter:r.diameter,bf=(r,t,e,i)=>{const s=r.find(l=>l.start<=i&&l.end>=i),o=s?s.diameter:0,a=t.filter(l=>Rt(l)>o).sort((l,c)=>Rt(l)-Rt(c)).find(l=>l.start<=i&&l.end>=i),h=e.find(l=>l.start<=i&&l.end>=i&&l.diameter>o);return a?Rt(a):h?h.diameter:100},ST=(r,t,e,i)=>{const s=r.sort((a,h)=>h.diameter-a.diameter).find(a=>a.start<=e&&a.end>=e),o=t.find(a=>a.start<=e&&a.end>=e);return s&&i!=="Open hole frac pack"&&i!=="Open hole gravel pack"?Rt(s):o?o.diameter:100},CT=(r,t,e,i)=>{const s=r.sort((l,c)=>Rt(l)-Rt(c)).find(l=>l.start<=i&&l.end>=i);if(s)return Rt(s);const o=r.length?Math.min(...r.map(l=>Rt(l))):0,a=t.sort((l,c)=>Rt(l)-Rt(c)).find(l=>l.start<=i&&l.end>=i&&o<=Rt(l));if(a)return Rt(a);const h=e.find(l=>l.start<=i&&l.end>=i&&l.diameter);return h?h.diameter:100},IT=(r,t,e,i,n,s)=>{const{attachedStrings:o,nonAttachedStrings:a}=bh(r.referenceIds,t,e);if(o.length===0)throw new Error(`Invalid cement data, can't find referenced casing/completion string for cement with id '${r.id}'`);o.sort((m,g)=>m.end-g.end);const h=o[o.length-1].end,{overlappingOuterStrings:l,overlappingHoles:c}=Bs(r.toc,h,a,i),u=[...l,...c].map(m=>({start:m.start,end:m.end}));return Ls([r.toc,h],u).flatMap((m,g,y)=>{if(g===y.length-1)return[];const _=y[g+1],v=bf(o,l,c,m);return[{top:m,bottom:_,diameter:v*n}]}).map(m=>({diameter:m.diameter,points:s(m.top,m.bottom)}))},bh=(r,t,e)=>[...t,...e].reduce((i,n)=>r.includes(n.id)?{...i,attachedStrings:[...i.attachedStrings,n]}:{...i,nonAttachedStrings:[...i.nonAttachedStrings,n]},{attachedStrings:[],nonAttachedStrings:[]}),PT=(r,t,e,i,n,s)=>{const{attachedStrings:o,nonAttachedStrings:a}=bh(r.referenceIds,t,e);if(o.length===0)throw new Error(`Invalid cement squeeze data, can't find referenced casing/completion for squeeze with id '${r.id}'`);const{overlappingOuterStrings:h,overlappingHoles:l}=Bs(r.start,r.end,a,i),c=[...h,...l].map(p=>({start:p.start,end:p.end}));return Ls([r.start,r.end],c).flatMap((p,m,g)=>{if(m===g.length-1)return[];const y=g[m+1],_=bf(o,h,l,p);return[{top:p,bottom:y,diameter:_*n}]}).map(p=>({diameter:p.diameter,points:s(p.top,p.bottom)}))},RT=(r,t,e,i,n,s)=>{const{attachedStrings:o,nonAttachedStrings:a}=bh(r.referenceIds,t,e),{overlappingHoles:h,overlappingOuterStrings:l}=Bs(r.start,r.end,a,i),c=[...o,...h,...l].map(p=>({start:p.start,end:p.end}));return Ls([r.start,r.end],c).flatMap((p,m,g)=>{if(m===g.length-1)return[];const y=g[m+1],_=CT(o,l,h,p);return[{top:p,bottom:y,diameter:_*n}]}).map(p=>({diameter:p.diameter,points:s(p.top,p.bottom)}))},MT=(r,t,e,i,n)=>{const o=t.createLinearGradient(0,0,0,r.height);return o.addColorStop(0,e),o.addColorStop(.5-n,i),o.addColorStop(.5+n,i),o.addColorStop(1,e),o},FT=({firstColor:r,secondColor:t},e,i)=>{const n=document.createElement("canvas");n.width=e,n.height=i;const s=n.getContext("2d");if(s==null)throw Error("Could not get canvas context!");return s.fillStyle=MT(n,s,r,t,0),s.fillRect(0,0,n.width,n.height),k.from(n)},DT=({scalingFactor:r})=>{const t=document.createElement("canvas"),e=Ge*r;t.width=e,t.height=e;const i=t.getContext("2d");if(i==null)throw Error("Could not get canvas context!");i.fillStyle="white",i.fillRect(0,0,t.width,t.height);const n=e/10;i.strokeStyle="#AAAAAA",i.lineWidth=n,i.beginPath();const s=e/3;for(let o=-t.width;o{const i=Ge*e,n=document.createElement("canvas");n.width=i,n.height=i;const s=n.getContext("2d");if(s==null)throw Error("Could not get canvas context!");const o=s.createLinearGradient(0,0,0,i),a=.3,h=.7;return o.addColorStop(0,t),o.addColorStop(a,r),o.addColorStop(h,r),o.addColorStop(1,t),s.fillStyle=o,s.fillRect(0,0,n.width,n.height),k.from(n)},LT=({firstColor:r,secondColor:t,scalingFactor:e})=>{const i=document.createElement("canvas"),n=Ge*e,s=e;i.width=n,i.height=n;const o=i.getContext("2d");if(o==null)throw Error("Could not get canvas context!");o.fillStyle=r,o.fillRect(0,0,i.width,i.height),o.lineWidth=s,o.fillStyle=t,o.beginPath();const a=n/12;for(let h=-i.width;h{const i=document.createElement("canvas"),n=Ge*e;i.width=n,i.height=n;const s=i.getContext("2d");if(s==null)throw Error("Could not get canvas context!");s.fillStyle=r,s.fillRect(0,0,i.width,i.height),s.lineWidth=e,s.strokeStyle=t,s.beginPath(),s.setLineDash([20,10]);const o=n/12;for(let a=-i.width;a{const i=document.createElement("canvas"),n=Ge*e,s=e;i.width=n,i.height=n;const o=i.getContext("2d");if(o==null)throw Error("Could not get canvas context!");o.lineWidth=s,o.fillStyle=r,o.strokeStyle=t,o.fillRect(0,0,i.width,i.height),o.beginPath(),o.setLineDash([20,10]);const a=n/12;for(let h=-i.width;h{const e=_f(t),i=Xa(t,e,r);return{leftPath:Xa(t,e,-r),rightPath:i}},Mo=(r,t)=>({kind:"casing",start:r,end:t}),kT=(r,t)=>({kind:"casing-window",start:r,end:t}),UT=r=>{const t=(r.windows||[]).filter(e=>AT(r.start,r.end,e.start,e.end)).reduce(({intervals:e,lastBottom:i},n,s,o)=>{const a=ig!=null);return{intervals:[...e,...m],lastBottom:d}},{intervals:[],lastBottom:r.start});return t.intervals.length?t.intervals:[Mo(r.start,r.end)]},GT=(r,t,e)=>{const i=t.diameter*r,n=i/2,o=t.innerDiameter*r/2,a=n-o,h=UT(t).map(l=>{const c=e(l.start,l.end),{leftPath:u,rightPath:d}=Hn(n,c);return{kind:l.kind,leftPath:u,rightPath:d,pathPoints:c}});return{kind:"casing",id:t.id,referenceDiameter:i,referenceRadius:n,sections:h,casingWallWidth:a,hasShoe:t.hasShoe,bottom:t.end}},HT=(r,t,e,i,n)=>{const{overlappingOuterStrings:s,overlappingHoles:o}=Bs(r.start,r.end,t,e),a=[...s,...o].map(u=>({start:u.start,end:u.end}));return Ls([r.start,r.end],a).flatMap((u,d,f)=>{if(d===f.length-1)return[];const p=f[d+1],m=ST(s,o,u,r.subKind);return[{top:u,bottom:p,diameter:m*i}]}).map(u=>{const d=n(u.top,u.bottom);return{diameter:u.diameter,points:d}})},Os=(r,t,e)=>{const{packingOpacity:i,yellow:n}=e;t.fillStyle=n,t.strokeStyle=n;const s=[0,0],o=[r.width,r.height];t.save(),t.globalAlpha=i,t.fillRect(...s,...o),t.restore()},wh=(r,t,e,i,n)=>{const{fracLineCurve:s}=i,o=10,a=r.width/o,h=e/3*i.scalingFactor,l=h/4,c=h/2,u=0,d=n==="diameter"?0:c;t.globalAlpha=i.packingOpacity;const f=()=>{for(let p=-1;p{const s=r.width/4;t.strokeStyle=i.outline;const o=e/3*i.scalingFactor;t.lineWidth=1;const a=o/2;for(let h=0;h<=4;h++){const l=[h*s,r.height/2-o/2],c=[l[0]-s/2,l[1]-a],u=[l[0]-s,l[1]];t.beginPath(),t.moveTo(...l),t.lineTo(...c),t.lineTo(...u),t.fill(),t.lineWidth=1,t.stroke()}for(let h=0;h<=4;h++){const l=[h*s,r.height/2+o/2],c=[l[0]-s/2,l[1]+a],u=[l[0]-s,l[1]];t.beginPath(),t.moveTo(...l),t.lineTo(...c),t.lineTo(...u),t.fill(),t.lineWidth=1,t.stroke()}t.closePath()},fe=(r="Error!",t)=>{console.error(`${r}`);const e=(t==null?void 0:t.canvas)||document.createElement("canvas"),i=Ge;e.width=i/2,e.height=i;const n=(t==null?void 0:t.canvasCtx)||e.getContext("2d"),s=[0,0],o=[e.width,e.height];if(n==null)throw Error("Could not get canvas context!");return n.fillStyle="#ff00ff",n.fillRect(...s,...o),new k(k.from(e,{wrapMode:Ft.CLAMP}).baseTexture,void 0,new Y(0,0,e.width,e.height),void 0,st.MIRROR_HORIZONTAL)},Ve=(r,t)=>{const e=document.createElement("canvas"),n=r.diameter*t.scalingFactor;e.width=n/2,e.height=n;const s=e.getContext("2d");if(s==null)throw Error("Could not get canvas context!");return{canvas:e,ctx:s}},Xe=r=>new k(k.from(r,{wrapMode:Ft.CLAMP}).baseTexture,void 0,new Y(0,0,r.width,r.height),void 0,st.MIRROR_HORIZONTAL),zT=(r,t)=>e=>t.some(i=>e(i)&&q2(r,i)),Th={packing:()=>fe(),fracLines:()=>fe(),spikes:(r,t,e,i)=>{const{canvas:n,ctx:s}=Ve(t,i),o=zT(r,e),a=o(W2),h=o(Y2),l=o(j2),u=a||h||l?i.yellow:i.red;return s.globalAlpha=i.packingOpacity,r.isOpen?(s.fillStyle=u,s.strokeStyle=u):(s.fillStyle=i.grey,s.strokeStyle=i.grey),$T(n,s,t.diameter,i),l&&wh(n,s,t.diameter,i,"spike"),Xe(n)}},wf={packing:()=>fe(),fracLines:(r,t)=>{const{canvas:e,ctx:i}=Ve(r,t);return wh(e,i,r.diameter,t,"diameter"),Xe(e)},spikes:()=>fe()},_s={packing:(r,t)=>{const{canvas:e,ctx:i}=Ve(r,t);return Os(e,i,t),Xe(e)},fracLines:(r,t)=>{const{canvas:e}=Ve(r,t);return Xe(e)},spikes:()=>fe()},Ah={packing:(r,t)=>{const{canvas:e,ctx:i}=Ve(r,t);return Os(e,i,t),Xe(e)},fracLines:()=>fe(),spikes:()=>fe()},Eh={packing:(r,t)=>{const{canvas:e,ctx:i}=Ve(r,t);return Os(e,i,t),Xe(e)},fracLines:()=>fe(),spikes:()=>fe()},Sh={packing:(r,t,e)=>{const{canvas:i,ctx:n}=Ve(t,e);return Os(i,n,e),Xe(i)},fracLines:(r,t)=>{const{canvas:e,ctx:i}=Ve(r,t);return wh(e,i,r.diameter,t,"diameter"),Xe(e)},spikes:()=>fe()},VT=(r,t,e)=>Ye({Perforation:()=>Th.packing(),CasedHoleFracturation:()=>_s.packing(t,e),CasedHoleFracPack:()=>_s.packing(t,e),OpenHoleGravelPack:()=>Eh.packing(t,e),OpenHoleFracPack:()=>Sh.packing(r,t,e),CasedHoleGravelPack:()=>Ah.packing(t,e)},r.subKind),XT=(r,t,e)=>Ye({Perforation:()=>Th.fracLines(),OpenHoleGravelPack:()=>Eh.fracLines(),OpenHoleFracPack:()=>Sh.fracLines(t,e),CasedHoleFracturation:()=>wf.fracLines(t,e),CasedHoleGravelPack:()=>Ah.fracLines(),CasedHoleFracPack:()=>_s.fracLines(t,e)},r.subKind),WT=(r,t,e,i)=>Ye({Perforation:()=>Th.spikes(r,e,t,i),OpenHoleGravelPack:()=>Eh.spikes(),OpenHoleFracPack:()=>Sh.spikes(),CasedHoleFracturation:()=>wf.spikes(),CasedHoleGravelPack:()=>Ah.spikes(),CasedHoleFracPack:()=>_s.spikes()},r.subKind);class jT extends Wi{constructor(t){const e=Ns(t,i=>i.points.length);super(new Float32Array(e*4),new Float32Array(e*4),new Uint16Array((e-1)*6)),this.segments=t,this.build()}get width(){return Do(this.segments,t=>t.diameter)}build(){var p,m,g,y,_,v,x,w;const t=this.segments;if(!t)return;const e=this.getBuffer("aVertexPosition"),i=this.getBuffer("aTextureCoord"),n=this.getIndex(),s=Ns(t,C=>C.points.length);if(s<1)return;e.data.length/4!==s&&(e.data=new Float32Array(s*4),i.data=new Float32Array(s*4),n.data=new Uint16Array((s-1)*6));const o=i.data,a=n.data;o[0]=0,o[1]=0,o[2]=0,o[3]=1;const h=t.length,l=Do(t,C=>C.diameter);let c=0,u=0,d=0,f=0;for(let C=0;Cf.points.length)<1)return;const i=t.length;let n=0;for(let f=0;fi=>{switch(i.kind){case"casing":return r(i);case"cement":return t(i);case"cementSqueeze":return e(i);default:return xh(i)}},tA=r=>({exaggerationFactor:2,internalLayerOptions:K2(r),holeOptions:Z2,casingOptions:Q2,cementOptions:tT,cementSqueezeOptions:eT,screenOptions:rT,tubingOptions:iT,cementPlugOptions:nT,perforationOptions:J2}),Tf=class Af extends k2{constructor(t,e,i){super(t,e,i),this.internalLayerVisibility={holeLayerId:!0,casingLayerId:!0,completionLayerId:!0,cementLayerId:!0,pAndALayerId:!0,perforationLayerId:!0},this.cementTextureCache=null,this.cementSqueezeTextureCache=null,this.cementPlugTextureCache=null,this.holeTextureCache=null,this.screenTextureCache=null,this.tubingTextureCache=null,this.textureSymbolCacheArray=null,this.scalingFactors={height:600,zFactor:1,yScale:jn()},this.getZFactorScaledPathForPoints=(n,s)=>{var h;const o=l=>l*this.scalingFactors.zFactor;return(((h=this.referenceSystem)==null?void 0:h.getCurtainPath(n,s,!0))??[]).map(l=>new Z(l.point[0],o(l.point[1])))},this.drawBigPolygon=(n,s=0)=>{const o=new Ri;o.beginFill(s),o.drawPolygon(n),o.endFill(),this.addChild(o)},this.perforationRopeAndTextureReferences=[],this.prepareSymbolRenderObject=n=>{const{exaggerationFactor:s=1}=this.options,o=n.diameter*s;return{pathPoints:this.getZFactorScaledPathForPoints(n.start,n.end),referenceDiameter:o,symbolKey:n.symbolKey}},this.drawSymbolComponent=({pathPoints:n,referenceDiameter:s,symbolKey:o})=>{const a=this.getSymbolTexture(o,s);this.drawSVGRope(n,a)},this.drawHoleSize=(n,s)=>{if(s==null)return;const o=this.getZFactorScaledPathForPoints(s.start,s.end);if(o.length===0)return;const{exaggerationFactor:a=1,holeOptions:h}=this.options,l=s.diameter*a,{rightPath:c,leftPath:u}=Hn(l/2,o),d=this.getHoleTexture(h,l,n);this.drawHoleRope(o,d,n),this.drawOutline(u,c,xe(h.lineColor),f1*a,"TopAndBottom",0)},this.drawCasing=n=>{const{casingOptions:s}=this.options,o=xe(s.solidColor),a=xe(s.lineColor);n.sections.forEach((h,l,c)=>{const u=Af.getOutlineClosureType(l,c.length-1),d=this.createCasingTexture(n.referenceDiameter);this.drawRope(h.pathPoints,d,o),h.kind==="casing-window"?this.drawCasingWindowOutline(h.leftPath,h.rightPath,s,n.casingWallWidth):this.drawOutline(h.leftPath,h.rightPath,a,n.casingWallWidth,u)})},this.generateShoe=(n,s,o,a)=>{const h=n-o,l=n,c=this.getZFactorScaledPathForPoints(h,l),u=_f(c),d=Xa(c,u,s*(a<0?-1:1)),f=c[c.length-1],p=u[u.length-1],m=xf(f,p,a+s*(a<0?-1:1));return[...d,m]},this.createCementSqueezeShape=(n,s,o,a)=>{const{exaggerationFactor:h=1}=this.options;return PT(n,s,o,a,h,this.getZFactorScaledPathForPoints)},this.createPerforationShape=(n,s,o)=>{const{exaggerationFactor:a=1}=this.options;return HT(n,s,o,a,this.getZFactorScaledPathForPoints)},this.options={...this.options,...tA(this.id),...i}}onUnmount(t){super.onUnmount(t),this.cementTextureCache=null,this.cementSqueezeTextureCache=null,this.holeTextureCache=null,this.screenTextureCache=null,this.tubingTextureCache=null,this.textureSymbolCacheArray=null}onUpdate(t){super.onUpdate(t),this.clearLayer(),this.preRender(),this.render()}onRescale(t){const e=this.scalingFactors.zFactor!==t.zFactor;this.scalingFactors={height:t.height,zFactor:t.zFactor,yScale:t.yScale},super.optionsRescale(t);const i=this.yRatio(),n=t.xBounds[0]>t.xBounds[1],s=t.yBounds[0]>t.yBounds[1];this.setContainerPosition(t.xScale(0),t.yScale(0)),this.setContainerScale(t.xRatio*(n?-1:1),i*(s?-1:1)),e&&(this.clearLayer(),this.preRender()),this.render()}setVisibility(t,e){if(e===this.id){super.setVisibility(t,e);return}const{internalLayerOptions:i}=this.options,s=(i?Object.entries(i):[]).find(([a,h])=>h===e),o=s==null?void 0:s[0];o&&(this.internalLayerVisibility[o]=t,this.clearLayer(),this.preRender(),this.render())}getInternalLayerIds(){const{internalLayerOptions:t}=this.options;return t?Object.values(t):[]}yRatio(){const t=this.scalingFactors.yScale.domain(),i=(t[1]-t[0])*this.scalingFactors.zFactor,n=[t[0],t[0]+i];return Math.abs(this.scalingFactors.height/(n[1]-n[0]))}drawRope(t,e,i){if(t.length===0)return;const n=new Lc(e,t,1);n.tint=i||n.tint,this.addChild(n)}drawOutline(t,e,i,n=1,s="None",o=1){const a=t.map(u=>u.clone()).reverse(),h=e[0],l=a[0],c=new Ri;c.lineStyle(n,i,void 0,o),c.moveTo(h.x,h.y),e.forEach(u=>c.lineTo(u.x,u.y)),(s==="None"||s==="Top")&&c.moveTo(l.x,l.y),a.forEach(u=>c.lineTo(u.x,u.y)),(s==="TopAndBottom"||s==="Top")&&c.lineTo(h.x,h.y),this.addChild(c)}drawCasingWindowOutline(t,e,{lineColor:i,windowOptions:n},s=1){var m,g;const o=!!((g=(m=this.referenceSystem)==null?void 0:m.options)!=null&&g.calculateDisplacementFromBottom),[a,h]=o?[t,e]:[e,t],[l,c]=o?[1,0]:[0,1],u=new Ri;u.lineStyle(s,xe(i),void 0,c);const d=a[0];u.moveTo(d.x,d.y),a.forEach(y=>u.lineTo(y.x,y.y));const f=new wT(u,{dash:[n.dashLength,n.spaceLength],color:xe(n.dashColor),width:s,alignment:l}),p=h[0];f.moveTo(p.x,p.y),h.forEach(y=>{f.lineTo(y.x,y.y)}),this.addChild(u)}preRender(){if(!this.data||!this.referenceSystem)return;const{exaggerationFactor:t=1}=this.options,{holeSizes:e,casings:i,cements:n,completion:s,symbols:o,pAndA:a,perforations:h}=this.data;this.updateSymbolCache(o),e.sort((m,g)=>g.diameter-m.diameter);const l=e.length>0?(Do(e,m=>m.diameter)??0)*t:d1*t;this.internalLayerVisibility.holeLayerId&&e.forEach(m=>this.drawHoleSize(l,m)),i.sort((m,g)=>g.diameter-m.diameter);const c=i.map(m=>this.createCasingRenderObject(m)),u=n.map(m=>({kind:"cement",segments:IT(m,i,s,e,t,this.getZFactorScaledPathForPoints),casingIds:(m.referenceIds||[]).filter(g=>g)})),[d,f]=a.reduce(([m,g],y)=>G2(y)?[[y,...m],g]:[m,[y,...g]],[[],[]]),p=d.map(m=>({kind:"cementSqueeze",segments:this.createCementSqueezeShape(m,i,s,e),casingIds:m.referenceIds}));if(this.sortCementAndCasingRenderObjects(c,u,p).forEach(JT(m=>{this.internalLayerVisibility.casingLayerId&&(this.drawCasing(m),m.hasShoe&&this.drawShoe(m.bottom,m.referenceRadius))},m=>{if(this.internalLayerVisibility.cementLayerId){const g=this.getCementTexture();g&&this.drawComplexRope(m.segments,g)}},m=>{if(this.internalLayerVisibility.pAndALayerId){const g=this.getCementSqueezeTexture();g&&this.drawComplexRope(m.segments,g)}})),this.perforationRopeAndTextureReferences.forEach(({rope:m,texture:g})=>{m.destroy({children:!0,texture:!0,baseTexture:!0}),g.destroy(!0)}),this.perforationRopeAndTextureReferences=[],this.internalLayerVisibility.perforationLayerId){const{perforationOptions:m}=this.options,g=h.filter(z2),y=h.filter(V2),_=h.filter(X2);g.forEach(v=>{const w=this.createPerforationShape(v,i,e).reduce((C,A)=>(C[A.diameter]||(C[A.diameter]=[]),C[A.diameter]=[...C[A.diameter]??[],A],C),{});Object.values(w).forEach(C=>{const A=VT(v,C[0],m),S=this.drawComplexRope(C,A);S&&this.perforationRopeAndTextureReferences.push({rope:S,texture:A})})}),_.forEach(v=>{const C=this.createPerforationShape(v,i,e).map(A=>({...A,diameter:A.diameter*3})).reduce((A,S)=>(A[S.diameter]||(A[S.diameter]=[]),A[S.diameter]=[...A[S.diameter]??[],S],A),{});Object.values(C).forEach(A=>{A.forEach(S=>{const F=WT(v,h,S,m),N=this.drawComplexRope([S],F);N&&this.perforationRopeAndTextureReferences.push({rope:N,texture:F})})})}),y.forEach(v=>{const C=this.createPerforationShape(v,i,e).map(A=>({...A,diameter:A.diameter*3})).reduce((A,S)=>(A[S.diameter]||(A[S.diameter]=[]),A[S.diameter]=[...A[S.diameter]??[],S],A),{});Object.values(C).forEach(A=>{A.forEach(S=>{const F=XT(v,S,m),N=this.drawComplexRope([S],F);N&&this.perforationRopeAndTextureReferences.push({rope:N,texture:F})})})})}this.internalLayerVisibility.completionLayerId&&s.forEach($2(m=>this.drawScreen(m),m=>this.drawTubing(m),m=>{const g=this.prepareSymbolRenderObject(m);this.drawSymbolComponent(g)})),this.internalLayerVisibility.pAndALayerId&&f.forEach(m=>{if(U2(m)){const g=this.prepareSymbolRenderObject(m);this.drawSymbolComponent(g)}H2(m)&&this.drawCementPlug(m,i,s,e)})}updateSymbolCache(t){if(this.textureSymbolCacheArray||(this.textureSymbolCacheArray={}),!t)return;const e=Object.keys(this.textureSymbolCacheArray);Object.entries(t).forEach(([i,n])=>{!e.includes(i)&&this.textureSymbolCacheArray&&(this.textureSymbolCacheArray[i]=k.from(n))})}drawCementPlug(t,e,i,n){const{exaggerationFactor:s=1,cementPlugOptions:o}=this.options,a=RT(t,e,i,n,s,this.getZFactorScaledPathForPoints);o&&this.drawComplexRope(a,this.getCementPlugTexture(o));const{rightPath:h,leftPath:l}=a.reduce((c,u)=>{const{leftPath:d,rightPath:f}=Hn(u.diameter/2,u.points);return{rightPath:[...c.rightPath,...f],leftPath:[...c.leftPath,...d]}},{rightPath:[],leftPath:[]});this.drawOutline(l,h,xe("black"),.25,"TopAndBottom")}createCasingRenderObject(t){const{exaggerationFactor:e=1}=this.options;return GT(e,t,this.getZFactorScaledPathForPoints)}getCementPlugTexture(t){return this.cementPlugTextureCache||(this.cementPlugTextureCache=OT(t)),this.cementPlugTextureCache}drawSVGRope(t,e){if(t.length===0)return;const i=new QT(e,t);this.addChild(i)}getSymbolTexture(t,e){var n,s;const i=(s=(n=this.textureSymbolCacheArray)==null?void 0:n[t])==null?void 0:s.baseTexture;return i?new k(i,void 0,new Y(0,0,0,e),void 0,st.MAIN_DIAGONAL):void 0}drawHoleRope(t,e,i){if(t.length===0)return;const n=new Lc(e,t,i/Ge);this.addChild(n)}getHoleTexture(t,e,i){const n=Ge,s=n,o=n,a=e/i*n;this.holeTextureCache||(this.holeTextureCache=FT(t,o,s));const h=this.holeTextureCache.baseTexture,l=(s-a)/2,c=new Y(0,l,o,a);return new k(h,c)}sortCementAndCasingRenderObjects(t,e,i){let n=0;const{result:s}=t.reduce((o,a)=>{const h=o.remainingCement.find(c=>c.casingIds.includes(a.id)),l=o.remainingCementSqueezes.filter(c=>c.casingIds.includes(a.id));return h&&(h.zIndex=n++),l.forEach(c=>c.zIndex=n++),a.zIndex=n++,{result:[...o.result,h,a,...l],remainingCement:o.remainingCement.filter(c=>c!==h),remainingCementSqueezes:o.remainingCementSqueezes.filter(c=>!l.includes(c))}},{result:[],remainingCement:e,remainingCementSqueezes:i});return s.filter(o=>o!=null).sort((o,a)=>o.zIndex-a.zIndex)}drawComplexRope(t,e){if(t.length===0)return;const i=new YT(e,t);return this.addChild(i),i}createCasingTexture(t){return new k(k.WHITE.baseTexture,void 0,new Y(0,0,16,t))}drawShoe(t,e){const{exaggerationFactor:i=1,casingOptions:n}=this.options,s=n.shoeSize.width*i,o=n.shoeSize.length*i,a=this.generateShoe(t,e,o,s),h=this.generateShoe(t,e,o,-s);this.drawBigPolygon(h),this.drawBigPolygon(a)}getCementTexture(){if(!this.cementTextureCache){const{cementOptions:t}=this.options;t&&(this.cementTextureCache=LT(t))}return this.cementTextureCache}getCementSqueezeTexture(){if(!this.cementSqueezeTextureCache){const{cementSqueezeOptions:t}=this.options;t&&(this.cementSqueezeTextureCache=NT(t))}return this.cementSqueezeTextureCache}drawScreen({start:t,end:e,diameter:i}){const{exaggerationFactor:n=1,screenOptions:s}=this.options,o=n*i,a=this.getZFactorScaledPathForPoints(t,e),{leftPath:h,rightPath:l}=Hn(o/2,a),c=this.getScreenTexture();c&&(this.drawCompletionRope(a,c,o),this.drawOutline(h,l,xe(s.lineColor),p1*n,"TopAndBottom"))}drawTubing({diameter:t,start:e,end:i}){const{exaggerationFactor:n=1,tubingOptions:s}=this.options,o=n*t,a=this.getZFactorScaledPathForPoints(e,i),h=this.getTubingTexture(s);this.drawCompletionRope(a,h,o)}getTubingTexture(t){return this.tubingTextureCache||(this.tubingTextureCache=BT(t)),this.tubingTextureCache}getScreenTexture(){if(!this.screenTextureCache){const{screenOptions:t}=this.options;t&&(this.screenTextureCache=DT(t))}return this.screenTextureCache}drawCompletionRope(t,e,i){if(t.length===0)return;const n=new KT(e,t,i);this.addChild(n)}};Tf.getOutlineClosureType=(r,t)=>r===0?r===t?"TopAndBottom":"Top":r===t?"Bottom":"None";let uA=Tf;const dA=r=>{const t=document.createElement("div");return t.setAttribute("style",`display: flex;flex:1;flex-direction:column; width: ${r}px;height:100%; background-color: white; padding: 12px;`),t},fA=(r,t)=>{const e=document.createElement("div");return e.className="story-layer-container",e.setAttribute("style",`height: ${t}px; width: ${r}px;background-color: #eee;`),e.setAttribute("height",`${t}`),e.setAttribute("width",`${r}`),e},pA=r=>{const t=document.createElement("div");return t.className="button-container",t.setAttribute("style",`width: ${r}px;background-color: white;`),t},mA=()=>{const r=document.createElement("p"),t=[];let e;function i(){window.requestAnimationFrame(()=>{const n=performance.now();for(;t.length>0&&t[0]<=n-1e3;)t.shift();t.push(n),e=t.length,r.innerHTML=`FPS: ${e}`,i()})}return i(),r},gA=r=>{const t=document.createElement("p");return t.innerHTML=r,t};export{aA as C,Su as D,Ri as G,nA as H,Eu as L,hA as P,uA as S,sA as V,iA as Z,xh as a,pA as b,dA as c,fA as d,mA as e,gA as f,cA as g,Gp as h,lA as i,eu as j,oA as k,k2 as l,Cu as m,o0 as n,rA as o,jn as p,Ue as q,Je as r,Be as s,eA as t,qe as u}; + }`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(t){this._stylesheet!==t&&(this._stylesheet=t,this.styleID++)}normalizeColor(t){return Array.isArray(t)&&(t=Tx(t)),typeof t=="number"?wx(t):t}dropShadowToCSS(){let t=this.normalizeColor(this.dropShadowColor);const e=this.dropShadowAlpha,i=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),n=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);t.startsWith("#")&&e<1&&(t+=(e*255|0).toString(16).padStart(2,"0"));const s=`${i}px ${n}px`;return this.dropShadowBlur>0?`text-shadow: ${s} ${this.dropShadowBlur}px ${t}`:`text-shadow: ${s} ${t}`}reset(){Object.assign(this,Pr.defaultOptions)}onBeforeDraw(){const{fontsDirty:t}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&t?new Promise(e=>setTimeout(e,100)):Promise.resolve()}get isSafari(){const{userAgent:t}=$.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(t)}set fillGradientStops(t){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(t){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(t){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(t){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(t){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(t){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(t){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};ih.availableFonts={},ih.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let Vo=ih;const Sn=class Rr extends ti{constructor(t="",e={}){super(k.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const i=new Image,n=k.from(i,{scaleMode:$.SCALE_MODE,resourceOptions:{autoLoad:!1}});n.orig=new Y,n.trim=new Y,this.texture=n;const s="http://www.w3.org/2000/svg",o="http://www.w3.org/1999/xhtml",a=document.createElementNS(s,"svg"),h=document.createElementNS(s,"foreignObject"),l=document.createElementNS(o,"div"),c=document.createElementNS(o,"style");h.setAttribute("width","10000"),h.setAttribute("height","10000"),h.style.overflow="hidden",a.appendChild(h),this.maxWidth=Rr.defaultMaxWidth,this.maxHeight=Rr.defaultMaxHeight,this._domElement=l,this._styleElement=c,this._svgRoot=a,this._foreignObject=h,this._foreignObject.appendChild(c),this._foreignObject.appendChild(l),this._image=i,this._loadImage=new Image,this._autoResolution=Rr.defaultAutoResolution,this._resolution=Rr.defaultResolution??$.RESOLUTION,this.text=t,this.style=e}measureText(t){var c,u;const{text:e,style:i,resolution:n}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},t);Object.assign(this._domElement,{innerHTML:e,style:i.toCSS(n)}),this._styleElement.textContent=i.toGlobalCSS(),document.body.appendChild(this._svgRoot);const s=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:o,height:a}=s;(o>this.maxWidth||a>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const h=Math.min(this.maxWidth,Math.ceil(o)),l=Math.min(this.maxHeight,Math.ceil(a));return this._svgRoot.setAttribute("width",h.toString()),this._svgRoot.setAttribute("height",l.toString()),e!==this._text&&(this._domElement.innerHTML=this._text),i!==this._style&&(Object.assign(this._domElement,{style:(c=this._style)==null?void 0:c.toCSS(n)}),this._styleElement.textContent=(u=this._style)==null?void 0:u.toGlobalCSS()),{width:h+i.padding*2,height:l+i.padding*2}}async updateText(t=!0){const{style:e,_image:i,_loadImage:n}=this;if(this.localStyleID!==e.styleID&&(this.dirty=!0,this.localStyleID=e.styleID),!this.dirty&&t)return;const{width:s,height:o}=this.measureText();i.width=n.width=Math.ceil(Math.max(1,s)),i.height=n.height=Math.ceil(Math.max(1,o)),this._updateID++;const a=this._updateID;await new Promise(h=>{n.onload=async()=>{if(a/gi,"
").replace(/
/gi,"
").replace(/ /gi," ")}};Sn.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},Sn.defaultMaxWidth=2024,Sn.defaultMaxHeight=2024,Sn.defaultAutoResolution=!0;class rE{constructor(t){const e={width:Yu,height:qu,antialias:!0,backgroundAlpha:0,clearBeforeRender:!0,preserveDrawingBuffer:!0,...t};this.renderer=uf(e),this.stage=new Bt}destroy(){var i,n,s,o,a;(i=this.stage)==null||i.destroy({children:!0,texture:!0,baseTexture:!0}),this.stage=void 0;const t=(n=this.renderer)==null?void 0:n.type,e=this.renderer instanceof Bs?(s=this.renderer)==null?void 0:s.gl:void 0;t===vh.WEBGL&&e&&((o=e==null?void 0:e.getExtension("WEBGL_lose_context"))==null||o.loseContext()),(a=this.renderer)==null||a.destroy(!0),this.renderer=void 0}get view(){var t;return(t=this.renderer)==null?void 0:t.view}render(){var t;this.stage!=null&&((t=this.renderer)==null||t.render(this.stage))}}class FT extends ju{constructor(t,e,i){var n;super(e,i),this.ctx=t,this.container=new Bt,(n=this.ctx.stage)==null||n.addChild(this.container)}render(){this.ctx.render()}addChild(t){this.container.addChild(t)}clearLayer(){this.container.removeChildren().forEach(e=>{e.destroy()})}onMount(t){var e,i;super.onMount(t),this.pixiViewContainer=((e=this.element)==null?void 0:e.querySelector("#webgl-layer"))??void 0,this.pixiViewContainer||(this.pixiViewContainer=document.createElement("div"),this.pixiViewContainer.setAttribute("id",`${this.id}`),this.pixiViewContainer.setAttribute("class","webgl-layer"),this.ctx.view!=null&&this.pixiViewContainer.appendChild(this.ctx.view),(i=this.element)==null||i.appendChild(this.pixiViewContainer),this.updateStyle())}onUnmount(t){var e,i;super.onUnmount(t),this.clearLayer(),(e=this.ctx.stage)==null||e.removeChild(this.container),this.container.destroy(),(i=this.pixiViewContainer)==null||i.remove(),this.pixiViewContainer=void 0}onResize(t){var e;super.onResize(t),(e=this.ctx.renderer)==null||e.resize(t.width,t.height)}onRescale(t){super.onRescale(t);const e=t.xBounds[0]>t.xBounds[1],i=t.yBounds[0]>t.yBounds[1];this.setContainerPosition(t.xScale(0),t.yScale(0)),this.setContainerScale(t.xRatio*(e?-1:1),t.yRatio*(i?-1:1))}setContainerPosition(t,e){this.container.position.set(t,e)}setContainerScale(t,e){this.container.scale.set(t,e)}updateStyle(t){var s;const e=t||this.isVisible,i=this.interactive?"auto":"none";this.container.visible=e;const n=[["position","absolute"],["pointer-events",`${i}`],["z-index",`${this.order}`],["opacity",`${this.opacity}`]].map(o=>o.join(":")).join(";");(s=this.pixiViewContainer)==null||s.setAttribute("style",n)}setVisibility(t,e){super.setVisibility(t,e),this.pixiViewContainer&&this.updateStyle(t)}onOpacityChanged(t){this.pixiViewContainer&&this.updateStyle()}onOrderChanged(t){this.pixiViewContainer&&this.updateStyle()}onInteractivityChanged(t){this.pixiViewContainer&&this.updateStyle()}renderType(){var t;return(t=this.ctx.renderer)==null?void 0:t.type}}function Lh(r){throw new Error(`Unexpected object: ${JSON.stringify(r)}`)}const DT=r=>r.kind==="pAndASymbol",BT=r=>r.kind==="cementSqueeze",LT=r=>r.kind==="cementPlug",OT=(r,t,e)=>i=>{switch(i.kind){case"screen":return r(i);case"tubing":return t(i);case"completionSymbol":return e(i);default:return Lh(i)}},Ye=(r,t)=>{switch(t){case"Perforation":return r.Perforation(t);case"Open hole gravel pack":return r.OpenHoleGravelPack(t);case"Open hole frac pack":return r.OpenHoleFracPack(t);case"Cased hole fracturation":return r.CasedHoleFracturation(t);case"Cased hole frac pack":return r.CasedHoleFracPack(t);case"Cased hole gravel pack":return r.CasedHoleGravelPack(t);default:return Lh(t)}},NT=r=>Ye({Perforation:()=>!1,OpenHoleGravelPack:()=>!0,OpenHoleFracPack:()=>!0,CasedHoleFracturation:()=>!1,CasedHoleGravelPack:()=>!0,CasedHoleFracPack:()=>!0},r.subKind);function kT(r){return Ye({Perforation:()=>!1,OpenHoleGravelPack:()=>!1,OpenHoleFracPack:()=>!0,CasedHoleFracturation:()=>!0,CasedHoleGravelPack:()=>!1,CasedHoleFracPack:()=>!0},r.subKind)}function UT(r){return Ye({Perforation:()=>!0,OpenHoleGravelPack:()=>!1,OpenHoleFracPack:()=>!1,CasedHoleFracturation:()=>!1,CasedHoleGravelPack:()=>!1,CasedHoleFracPack:()=>!1},r.subKind)}function GT(r){return Ye({Perforation:()=>!1,OpenHoleGravelPack:()=>!1,OpenHoleFracPack:()=>!1,CasedHoleFracturation:()=>!1,CasedHoleGravelPack:()=>!0,CasedHoleFracPack:()=>!1},r.subKind)}function HT(r){return Ye({Perforation:()=>!1,OpenHoleGravelPack:()=>!1,OpenHoleFracPack:()=>!1,CasedHoleFracturation:()=>!1,CasedHoleGravelPack:()=>!1,CasedHoleFracPack:()=>!0},r.subKind)}const $T=r=>r.subKind==="Cased hole fracturation",zT=(r,t)=>r.startt.start,VT=r=>({holeLayerId:`${r}-hole`,casingLayerId:`${r}-casing`,completionLayerId:`${r}-completion`,cementLayerId:`${r}-cement`,pAndALayerId:`${r}-pAndA`,perforationLayerId:`${r}-perforation`}),XT={firstColor:"#8c541d",secondColor:"#eee3d8",lineColor:"#8b4513"},WT={solidColor:"#dcdcdc",lineColor:"#575757",shoeSize:{width:$1,length:z1},windowOptions:{dashColor:"#dc0000",dashLength:5,spaceLength:3}},jT={stroke:"rgba(0, 0, 0, 0.25)",yellow:"#FFFC00",grey:"gray",red:"#FF5050",outline:"black",transparent:"rgba(255, 255, 255, 0)",spikeWidth:50,spikeLength:50,packingOpacity:.7,fracLineCurve:10,fracLineLength:25,scalingFactor:25},YT={firstColor:"#c7b9ab",secondColor:"#5b5b5b",scalingFactor:4},qT={firstColor:"#8b6713",secondColor:"#000000",scalingFactor:4},KT={scalingFactor:4,lineColor:"#63666a"},ZT={scalingFactor:1,innerColor:"#eeeeff",outerColor:"#777788"},QT={firstColor:"#c7b9ab",secondColor:"#000000",scalingFactor:4},JT=16,tA=6;function xe(r){const t=Ue(r);if(t!=null){const e=t==null?void 0:t.formatHex();return parseInt(e.replace("#","0x"))}else throw Error(`Could not format string ${r} to hex code.`)}function iE(r){return typeof r=="string"?r:`#${r.toString(JT).padStart(tA,"0")}`}const eA=2147483648,rA=4294967295;function nE(r,t,e){const i=e.filter(f=>f.data.values),n=hA(i),s=new Map,o=oA(n,t,s);aA(o);const a=iA(n,r),h=fA(r,o,t),l=sA(s,h),u=[...nA(l,r),...Object.values(h).flat().filter(f=>!f.exclude)];return{lines:a,areas:u}}function iA(r,t){return r.filter(i=>i.visualization==="line").map(i=>({id:i.name,label:i.name,width:2,color:xe(i.color||"black"),data:t.map((n,s)=>[n[0],i.values[s]])}))}function nA(r,t){return r.map((i,n)=>{const s=n+1[o[0],i.top[a],...s?[s.top[a]]:[]])}})}function sA(r,t){return Array.from(r.values()).sort((i,n)=>i.age-n.age).filter(i=>{const n=t[i.name],s=n&&n.length>0;return s||console.warn(`Intersection surface group '${i.name}' has no valid entries and will be discarded.`),s}).map((i,n)=>{const o=t[i.name][0];return{id:i.name,label:i.name,color:cA(n),top:o.data.map(a=>a[1])}})}function oA(r,t,e){const i=t&&t.find(o=>o.stratUnitLevel===1),n=i?i.identifier:"SEABED";return r.filter(o=>o.visualization==="interval"||o.visualization==="none").map(o=>{const a=[],h=Vf(t,o.name,a);h||console.warn(`No match for ${o.name} in strat column`);const l=a[0]||h,c=l&&l.identifier||n;return l&&!e.has(c)&&e.set(c,{age:l.topAge,name:l.identifier}),{...o,unit:h,group:c}})}function aA(r){r.sort((t,e)=>{if(!t.unit&&!e.unit)return 0;if(!t.unit)return-1;if(!e.unit)return 1;const i=t.isBase?t.unit.baseAge:t.unit.topAge,n=e.isBase?e.unit.baseAge:e.unit.topAge;return i!==n?i-n:t.isBase&&!e.isBase?1:!t.isBase&&e.isBase?-1:t.unit.stratUnitLevel-e.unit.stratUnitLevel})}function Vf(r,t,e=[]){const i=r.find(n=>n.identifier.toLowerCase()===t.toLowerCase());if(i){let n=i;do e.unshift(n),n=r.find(s=>s.identifier===n.stratUnitParent);while(n);return i}return null}function hA(r){return r.map(t=>{const e=t.visualSettings.displayName,i=e.replace(/\s(Base|Top)/gi,""),n=e.toLowerCase().endsWith("base");return{name:i,isBase:n,values:t.data.values,color:t.visualSettings.colors.crossSection,visualization:t.visualSettings.crossSection.toLowerCase()}})}function lA(r){return r.colorR===null||r.colorG===null||r.colorB===null?eA:r.colorR<<16|r.colorG<<8|r.colorB}const cA=fu().domain([0,100]).range(Vp(Mi("#e6f1cf","#85906d"),10));function uA(r,t,e,i){const n=t+1;if(!e||n>=e.length)return;const s=e.findIndex(o=>o.isBase&&o.name===r.name);if(s!==-1)return s;for(let o=n;ot.name===n.identifier)}function fA(r,t,e){return t.reduce((n,s,o)=>{var a;if(!s.isBase){n[s.group]||(n[s.group]=[]);const h=uA(s,o,t,e);(a=n[s.group])==null||a.push({id:s.name,label:s.name,color:s.unit&&lA(s.unit)||rA,exclude:s.visualization==="none"||!s.unit,data:r.map((l,c)=>{const u=s.values[c]!=null?pA(h,t,c):void 0;return[l[0],s.values[c],u]})})}return n},{})}function pA(r,t,e){var i,n;if(!(!t||!r||r>=t.length)){for(let s=r;si+n),this.useTexture=e.useTexture,this.options=e,this.setLineStyle()}setLineStyle(){const t=this.options;if(this.useTexture){const e=Me.getTexture(t,this.dashSize);this.graphics.lineTextureStyle({width:t.width*t.scale,color:t.color,alpha:t.alpha,texture:e,alignment:t.alignment})}else this.graphics.lineStyle({width:t.width*t.scale,color:t.color,alpha:t.alpha,cap:t.cap,join:t.join,alignment:t.alignment});this.scale=t.scale}static distance(t,e,i,n){return Math.sqrt(Math.pow(i-t,2)+Math.pow(n-e,2))}moveTo(t,e){return this.lineLength=0,this.cursor.set(t,e),this.start=new Z(t,e),this.graphics.moveTo(this.cursor.x,this.cursor.y),this}lineTo(t,e,i){typeof this.lineLength===void 0&&this.moveTo(0,0);const n=Me.distance(this.cursor.x,this.cursor.y,t,e),s=Math.atan2(e-this.cursor.y,t-this.cursor.x),o=i&&t===this.start.x&&e===this.start.y;if(this.useTexture)if(this.graphics.moveTo(this.cursor.x,this.cursor.y),this.adjustLineStyle(s),o&&this.dash.length%2===0){const a=Math.min(this.dash[this.dash.length-1],n);this.graphics.lineTo(t-Math.cos(s)*a,e-Math.sin(s)*a),this.graphics.closePath()}else this.graphics.lineTo(t,e);else{const a=Math.cos(s),h=Math.sin(s);let l=this.cursor.x,c=this.cursor.y;const u=this.lineLength%(this.dashSize*this.scale);let d=0,f=0,p=0;for(let g=0;g0;){const g=this.dash[d]*this.scale-f,y=m>g?g:m;if(o&&Me.distance(l+a*y,c+h*y,this.start.x,this.start.y)<=y){if(d%2===0){const v=Me.distance(l,c,this.start.x,this.start.y)-this.dash[this.dash.length-1]*this.scale;l+=a*v,c+=h*v,this.graphics.lineTo(l,c)}break}l+=a*y,c+=h*y,d%2?this.graphics.moveTo(l,c):this.graphics.lineTo(l,c),m-=y,d++,d=d===this.dash.length?0:d,f=0}}return this.lineLength+=n,this.cursor.set(t,e),this}closePath(){this.lineTo(this.start.x,this.start.y,!0)}drawCircle(t,e,i,n=80,s){const o=Math.PI*2/n;let a=0,h;s?(h=new Z(t+Math.cos(a)*i,e+Math.sin(a)*i),s.apply(h,h),this.moveTo(h[0],h[1])):(h=new Z(t+Math.cos(a)*i,e+Math.sin(a)*i),this.moveTo(h.x,h.y)),a+=o;for(let l=1;lnew Tu(r.x,r.y),yA=r=>new Z(r[0],r[1]),Wf=r=>{if(r.length<2)return[new Tu(0)];let t;return r.map((e,i,n)=>{const s=n[i],o=n[i+1];if(i{const i=nh(r);return yA(i.add(t.scale(e)))},sh=(r,t,e)=>{if(r.length!==t.length)throw new Error("Number of vectors does not match number of points");return r.map((i,n)=>{const s=t[n];if(s!=null)return jf(i,s,e);throw new Error(`Trying to read index ${n} of point ${i}, but no such vector was found!`)})},cu=(r,t,e,i)=>r<=i&&e<=t,vA=(r,t,e,i)=>rArray.from(new Set(r)),ks=(r,t,e,i)=>{const n=i.filter(o=>cu(r,t,o.start,o.end)),s=e.filter(o=>cu(r,t,o.start,o.end));return{overlappingHoles:n,overlappingOuterStrings:s}},Us=([r,t],e)=>{const s=e.flatMap(a=>[a.start-1e-4,a.start,a.end,a.end+1e-4]).filter(a=>a>=r&&a<=t);return s.push(r),s.push(t),_A(s).sort((a,h)=>a-h)},Rt=r=>r.kind==="casing"?r.innerDiameter:r.diameter,Yf=(r,t,e,i)=>{const s=r.find(l=>l.start<=i&&l.end>=i),o=s?s.diameter:0,a=t.filter(l=>Rt(l)>o).sort((l,c)=>Rt(l)-Rt(c)).find(l=>l.start<=i&&l.end>=i),h=e.find(l=>l.start<=i&&l.end>=i&&l.diameter>o);return a?Rt(a):h?h.diameter:100},xA=(r,t,e,i)=>{const s=r.sort((a,h)=>h.diameter-a.diameter).find(a=>a.start<=e&&a.end>=e),o=t.find(a=>a.start<=e&&a.end>=e);return s&&i!=="Open hole frac pack"&&i!=="Open hole gravel pack"?Rt(s):o?o.diameter:100},bA=(r,t,e,i)=>{const s=r.sort((l,c)=>Rt(l)-Rt(c)).find(l=>l.start<=i&&l.end>=i);if(s)return Rt(s);const o=r.length?Math.min(...r.map(l=>Rt(l))):0,a=t.sort((l,c)=>Rt(l)-Rt(c)).find(l=>l.start<=i&&l.end>=i&&o<=Rt(l));if(a)return Rt(a);const h=e.find(l=>l.start<=i&&l.end>=i&&l.diameter);return h?h.diameter:100},wA=(r,t,e,i,n,s)=>{const{attachedStrings:o,nonAttachedStrings:a}=Oh(r.referenceIds,t,e);if(o.length===0)throw new Error(`Invalid cement data, can't find referenced casing/completion string for cement with id '${r.id}'`);o.sort((m,g)=>m.end-g.end);const h=o[o.length-1].end,{overlappingOuterStrings:l,overlappingHoles:c}=ks(r.toc,h,a,i),u=[...l,...c].map(m=>({start:m.start,end:m.end}));return Us([r.toc,h],u).flatMap((m,g,y)=>{if(g===y.length-1)return[];const _=y[g+1],v=Yf(o,l,c,m);return[{top:m,bottom:_,diameter:v*n}]}).map(m=>({diameter:m.diameter,points:s(m.top,m.bottom)}))},Oh=(r,t,e)=>[...t,...e].reduce((i,n)=>r.includes(n.id)?{...i,attachedStrings:[...i.attachedStrings,n]}:{...i,nonAttachedStrings:[...i.nonAttachedStrings,n]},{attachedStrings:[],nonAttachedStrings:[]}),TA=(r,t,e,i,n,s)=>{const{attachedStrings:o,nonAttachedStrings:a}=Oh(r.referenceIds,t,e);if(o.length===0)throw new Error(`Invalid cement squeeze data, can't find referenced casing/completion for squeeze with id '${r.id}'`);const{overlappingOuterStrings:h,overlappingHoles:l}=ks(r.start,r.end,a,i),c=[...h,...l].map(p=>({start:p.start,end:p.end}));return Us([r.start,r.end],c).flatMap((p,m,g)=>{if(m===g.length-1)return[];const y=g[m+1],_=Yf(o,h,l,p);return[{top:p,bottom:y,diameter:_*n}]}).map(p=>({diameter:p.diameter,points:s(p.top,p.bottom)}))},AA=(r,t,e,i,n,s)=>{const{attachedStrings:o,nonAttachedStrings:a}=Oh(r.referenceIds,t,e),{overlappingHoles:h,overlappingOuterStrings:l}=ks(r.start,r.end,a,i),c=[...o,...h,...l].map(p=>({start:p.start,end:p.end}));return Us([r.start,r.end],c).flatMap((p,m,g)=>{if(m===g.length-1)return[];const y=g[m+1],_=bA(o,l,h,p);return[{top:p,bottom:y,diameter:_*n}]}).map(p=>({diameter:p.diameter,points:s(p.top,p.bottom)}))},EA=(r,t,e,i,n)=>{const o=t.createLinearGradient(0,0,0,r.height);return o.addColorStop(0,e),o.addColorStop(.5-n,i),o.addColorStop(.5+n,i),o.addColorStop(1,e),o},SA=({firstColor:r,secondColor:t},e,i)=>{const n=document.createElement("canvas");n.width=e,n.height=i;const s=n.getContext("2d");if(s==null)throw Error("Could not get canvas context!");return s.fillStyle=EA(n,s,r,t,0),s.fillRect(0,0,n.width,n.height),k.from(n)},CA=({scalingFactor:r})=>{const t=document.createElement("canvas"),e=Ge*r;t.width=e,t.height=e;const i=t.getContext("2d");if(i==null)throw Error("Could not get canvas context!");i.fillStyle="white",i.fillRect(0,0,t.width,t.height);const n=e/10;i.strokeStyle="#AAAAAA",i.lineWidth=n,i.beginPath();const s=e/3;for(let o=-t.width;o{const i=Ge*e,n=document.createElement("canvas");n.width=i,n.height=i;const s=n.getContext("2d");if(s==null)throw Error("Could not get canvas context!");const o=s.createLinearGradient(0,0,0,i),a=.3,h=.7;return o.addColorStop(0,t),o.addColorStop(a,r),o.addColorStop(h,r),o.addColorStop(1,t),s.fillStyle=o,s.fillRect(0,0,n.width,n.height),k.from(n)},PA=({firstColor:r,secondColor:t,scalingFactor:e})=>{const i=document.createElement("canvas"),n=Ge*e,s=e;i.width=n,i.height=n;const o=i.getContext("2d");if(o==null)throw Error("Could not get canvas context!");o.fillStyle=r,o.fillRect(0,0,i.width,i.height),o.lineWidth=s,o.fillStyle=t,o.beginPath();const a=n/12;for(let h=-i.width;h{const i=document.createElement("canvas"),n=Ge*e;i.width=n,i.height=n;const s=i.getContext("2d");if(s==null)throw Error("Could not get canvas context!");s.fillStyle=r,s.fillRect(0,0,i.width,i.height),s.lineWidth=e,s.strokeStyle=t,s.beginPath(),s.setLineDash([20,10]);const o=n/12;for(let a=-i.width;a{const i=document.createElement("canvas"),n=Ge*e,s=e;i.width=n,i.height=n;const o=i.getContext("2d");if(o==null)throw Error("Could not get canvas context!");o.lineWidth=s,o.fillStyle=r,o.strokeStyle=t,o.fillRect(0,0,i.width,i.height),o.beginPath(),o.setLineDash([20,10]);const a=n/12;for(let h=-i.width;h{const e=Wf(t),i=sh(t,e,r);return{leftPath:sh(t,e,-r),rightPath:i}},Xo=(r,t)=>({kind:"casing",start:r,end:t}),FA=(r,t)=>({kind:"casing-window",start:r,end:t}),DA=r=>{const t=(r.windows||[]).filter(e=>vA(r.start,r.end,e.start,e.end)).reduce(({intervals:e,lastBottom:i},n,s,o)=>{const a=ig!=null);return{intervals:[...e,...m],lastBottom:d}},{intervals:[],lastBottom:r.start});return t.intervals.length?t.intervals:[Xo(r.start,r.end)]},BA=(r,t,e)=>{const i=t.diameter*r,n=i/2,o=t.innerDiameter*r/2,a=n-o,h=DA(t).map(l=>{const c=e(l.start,l.end),{leftPath:u,rightPath:d}=zn(n,c);return{kind:l.kind,leftPath:u,rightPath:d,pathPoints:c}});return{kind:"casing",id:t.id,referenceDiameter:i,referenceRadius:n,sections:h,casingWallWidth:a,hasShoe:t.hasShoe,bottom:t.end}},LA=(r,t,e,i,n)=>{const{overlappingOuterStrings:s,overlappingHoles:o}=ks(r.start,r.end,t,e),a=[...s,...o].map(u=>({start:u.start,end:u.end}));return Us([r.start,r.end],a).flatMap((u,d,f)=>{if(d===f.length-1)return[];const p=f[d+1],m=xA(s,o,u,r.subKind);return[{top:u,bottom:p,diameter:m*i}]}).map(u=>{const d=n(u.top,u.bottom);return{diameter:u.diameter,points:d}})},Gs=(r,t,e)=>{const{packingOpacity:i,yellow:n}=e;t.fillStyle=n,t.strokeStyle=n;const s=[0,0],o=[r.width,r.height];t.save(),t.globalAlpha=i,t.fillRect(...s,...o),t.restore()},Nh=(r,t,e,i,n)=>{const{fracLineCurve:s}=i,o=10,a=r.width/o,h=e/3*i.scalingFactor,l=h/4,c=h/2,u=0,d=n==="diameter"?0:c;t.globalAlpha=i.packingOpacity;const f=()=>{for(let p=-1;p{const s=r.width/4;t.strokeStyle=i.outline;const o=e/3*i.scalingFactor;t.lineWidth=1;const a=o/2;for(let h=0;h<=4;h++){const l=[h*s,r.height/2-o/2],c=[l[0]-s/2,l[1]-a],u=[l[0]-s,l[1]];t.beginPath(),t.moveTo(...l),t.lineTo(...c),t.lineTo(...u),t.fill(),t.lineWidth=1,t.stroke()}for(let h=0;h<=4;h++){const l=[h*s,r.height/2+o/2],c=[l[0]-s/2,l[1]+a],u=[l[0]-s,l[1]];t.beginPath(),t.moveTo(...l),t.lineTo(...c),t.lineTo(...u),t.fill(),t.lineWidth=1,t.stroke()}t.closePath()},fe=(r="Error!",t)=>{console.error(`${r}`);const e=(t==null?void 0:t.canvas)||document.createElement("canvas"),i=Ge;e.width=i/2,e.height=i;const n=(t==null?void 0:t.canvasCtx)||e.getContext("2d"),s=[0,0],o=[e.width,e.height];if(n==null)throw Error("Could not get canvas context!");return n.fillStyle="#ff00ff",n.fillRect(...s,...o),new k(k.from(e,{wrapMode:Ft.CLAMP}).baseTexture,void 0,new Y(0,0,e.width,e.height),void 0,st.MIRROR_HORIZONTAL)},Ve=(r,t)=>{const e=document.createElement("canvas"),n=r.diameter*t.scalingFactor;e.width=n/2,e.height=n;const s=e.getContext("2d");if(s==null)throw Error("Could not get canvas context!");return{canvas:e,ctx:s}},Xe=r=>new k(k.from(r,{wrapMode:Ft.CLAMP}).baseTexture,void 0,new Y(0,0,r.width,r.height),void 0,st.MIRROR_HORIZONTAL),NA=(r,t)=>e=>t.some(i=>e(i)&&zT(r,i)),kh={packing:()=>fe(),fracLines:()=>fe(),spikes:(r,t,e,i)=>{const{canvas:n,ctx:s}=Ve(t,i),o=NA(r,e),a=o(GT),h=o($T),l=o(HT),u=a||h||l?i.yellow:i.red;return s.globalAlpha=i.packingOpacity,r.isOpen?(s.fillStyle=u,s.strokeStyle=u):(s.fillStyle=i.grey,s.strokeStyle=i.grey),OA(n,s,t.diameter,i),l&&Nh(n,s,t.diameter,i,"spike"),Xe(n)}},qf={packing:()=>fe(),fracLines:(r,t)=>{const{canvas:e,ctx:i}=Ve(r,t);return Nh(e,i,r.diameter,t,"diameter"),Xe(e)},spikes:()=>fe()},bs={packing:(r,t)=>{const{canvas:e,ctx:i}=Ve(r,t);return Gs(e,i,t),Xe(e)},fracLines:(r,t)=>{const{canvas:e}=Ve(r,t);return Xe(e)},spikes:()=>fe()},Uh={packing:(r,t)=>{const{canvas:e,ctx:i}=Ve(r,t);return Gs(e,i,t),Xe(e)},fracLines:()=>fe(),spikes:()=>fe()},Gh={packing:(r,t)=>{const{canvas:e,ctx:i}=Ve(r,t);return Gs(e,i,t),Xe(e)},fracLines:()=>fe(),spikes:()=>fe()},Hh={packing:(r,t,e)=>{const{canvas:i,ctx:n}=Ve(t,e);return Gs(i,n,e),Xe(i)},fracLines:(r,t)=>{const{canvas:e,ctx:i}=Ve(r,t);return Nh(e,i,r.diameter,t,"diameter"),Xe(e)},spikes:()=>fe()},kA=(r,t,e)=>Ye({Perforation:()=>kh.packing(),CasedHoleFracturation:()=>bs.packing(t,e),CasedHoleFracPack:()=>bs.packing(t,e),OpenHoleGravelPack:()=>Gh.packing(t,e),OpenHoleFracPack:()=>Hh.packing(r,t,e),CasedHoleGravelPack:()=>Uh.packing(t,e)},r.subKind),UA=(r,t,e)=>Ye({Perforation:()=>kh.fracLines(),OpenHoleGravelPack:()=>Gh.fracLines(),OpenHoleFracPack:()=>Hh.fracLines(t,e),CasedHoleFracturation:()=>qf.fracLines(t,e),CasedHoleGravelPack:()=>Uh.fracLines(),CasedHoleFracPack:()=>bs.fracLines(t,e)},r.subKind),GA=(r,t,e,i)=>Ye({Perforation:()=>kh.spikes(r,e,t,i),OpenHoleGravelPack:()=>Gh.spikes(),OpenHoleFracPack:()=>Hh.spikes(),CasedHoleFracturation:()=>qf.spikes(),CasedHoleGravelPack:()=>Uh.spikes(),CasedHoleFracPack:()=>bs.spikes()},r.subKind);class HA extends ji{constructor(t){const e=Hs(t,i=>i.points.length);super(new Float32Array(e*4),new Float32Array(e*4),new Uint16Array((e-1)*6)),this.segments=t,this.build()}get width(){return jo(this.segments,t=>t.diameter)}build(){var p,m,g,y,_,v,x,w;const t=this.segments;if(!t)return;const e=this.getBuffer("aVertexPosition"),i=this.getBuffer("aTextureCoord"),n=this.getIndex(),s=Hs(t,C=>C.points.length);if(s<1)return;e.data.length/4!==s&&(e.data=new Float32Array(s*4),i.data=new Float32Array(s*4),n.data=new Uint16Array((s-1)*6));const o=i.data,a=n.data;o[0]=0,o[1]=0,o[2]=0,o[3]=1;const h=t.length,l=jo(t,C=>C.diameter);let c=0,u=0,d=0,f=0;for(let C=0;Cf.points.length)<1)return;const i=t.length;let n=0;for(let f=0;fi=>{switch(i.kind){case"casing":return r(i);case"cement":return t(i);case"cementSqueeze":return e(i);default:return Lh(i)}},YA=r=>({exaggerationFactor:2,internalLayerOptions:VT(r),holeOptions:XT,casingOptions:WT,cementOptions:YT,cementSqueezeOptions:qT,screenOptions:KT,tubingOptions:ZT,cementPlugOptions:QT,perforationOptions:jT}),Kf=class Zf extends FT{constructor(t,e,i){super(t,e,i),this.internalLayerVisibility={holeLayerId:!0,casingLayerId:!0,completionLayerId:!0,cementLayerId:!0,pAndALayerId:!0,perforationLayerId:!0},this.cementTextureCache=null,this.cementSqueezeTextureCache=null,this.cementPlugTextureCache=null,this.holeTextureCache=null,this.screenTextureCache=null,this.tubingTextureCache=null,this.textureSymbolCacheArray=null,this.scalingFactors={height:600,zFactor:1,yScale:qn()},this.getZFactorScaledPathForPoints=(n,s)=>{var h;const o=l=>l*this.scalingFactors.zFactor;return(((h=this.referenceSystem)==null?void 0:h.getCurtainPath(n,s,!0))??[]).map(l=>new Z(l.point[0],o(l.point[1])))},this.drawBigPolygon=(n,s=0)=>{const o=new Ii;o.beginFill(s),o.drawPolygon(n),o.endFill(),this.addChild(o)},this.perforationRopeAndTextureReferences=[],this.prepareSymbolRenderObject=n=>{const{exaggerationFactor:s=1}=this.options,o=n.diameter*s;return{pathPoints:this.getZFactorScaledPathForPoints(n.start,n.end),referenceDiameter:o,symbolKey:n.symbolKey}},this.drawSymbolComponent=({pathPoints:n,referenceDiameter:s,symbolKey:o})=>{const a=this.getSymbolTexture(o,s);this.drawSVGRope(n,a)},this.drawHoleSize=(n,s)=>{if(s==null)return;const o=this.getZFactorScaledPathForPoints(s.start,s.end);if(o.length===0)return;const{exaggerationFactor:a=1,holeOptions:h}=this.options,l=s.diameter*a,{rightPath:c,leftPath:u}=zn(l/2,o),d=this.getHoleTexture(h,l,n);this.drawHoleRope(o,d,n),this.drawOutline(u,c,xe(h.lineColor),G1*a,"TopAndBottom",0)},this.drawCasing=n=>{const{casingOptions:s}=this.options,o=xe(s.solidColor),a=xe(s.lineColor);n.sections.forEach((h,l,c)=>{const u=Zf.getOutlineClosureType(l,c.length-1),d=this.createCasingTexture(n.referenceDiameter);this.drawRope(h.pathPoints,d,o),h.kind==="casing-window"?this.drawCasingWindowOutline(h.leftPath,h.rightPath,s,n.casingWallWidth):this.drawOutline(h.leftPath,h.rightPath,a,n.casingWallWidth,u)})},this.generateShoe=(n,s,o,a)=>{const h=n-o,l=n,c=this.getZFactorScaledPathForPoints(h,l),u=Wf(c),d=sh(c,u,s*(a<0?-1:1)),f=c[c.length-1],p=u[u.length-1],m=jf(f,p,a+s*(a<0?-1:1));return[...d,m]},this.createCementSqueezeShape=(n,s,o,a)=>{const{exaggerationFactor:h=1}=this.options;return TA(n,s,o,a,h,this.getZFactorScaledPathForPoints)},this.createPerforationShape=(n,s,o)=>{const{exaggerationFactor:a=1}=this.options;return LA(n,s,o,a,this.getZFactorScaledPathForPoints)},this.options={...this.options,...YA(this.id),...i}}onUnmount(t){super.onUnmount(t),this.cementTextureCache=null,this.cementSqueezeTextureCache=null,this.holeTextureCache=null,this.screenTextureCache=null,this.tubingTextureCache=null,this.textureSymbolCacheArray=null}onUpdate(t){super.onUpdate(t),this.clearLayer(),this.preRender(),this.render()}onRescale(t){const e=this.scalingFactors.zFactor!==t.zFactor;this.scalingFactors={height:t.height,zFactor:t.zFactor,yScale:t.yScale},super.optionsRescale(t);const i=this.yRatio(),n=t.xBounds[0]>t.xBounds[1],s=t.yBounds[0]>t.yBounds[1];this.setContainerPosition(t.xScale(0),t.yScale(0)),this.setContainerScale(t.xRatio*(n?-1:1),i*(s?-1:1)),e&&(this.clearLayer(),this.preRender()),this.render()}setVisibility(t,e){if(e===this.id){super.setVisibility(t,e);return}const{internalLayerOptions:i}=this.options,s=(i?Object.entries(i):[]).find(([a,h])=>h===e),o=s==null?void 0:s[0];o&&(this.internalLayerVisibility[o]=t,this.clearLayer(),this.preRender(),this.render())}getInternalLayerIds(){const{internalLayerOptions:t}=this.options;return t?Object.values(t):[]}yRatio(){const t=this.scalingFactors.yScale.domain(),i=(t[1]-t[0])*this.scalingFactors.zFactor,n=[t[0],t[0]+i];return Math.abs(this.scalingFactors.height/(n[1]-n[0]))}drawRope(t,e,i){if(t.length===0)return;const n=new iu(e,t,1);n.tint=i||n.tint,this.addChild(n)}drawOutline(t,e,i,n=1,s="None",o=1){const a=t.map(u=>u.clone()).reverse(),h=e[0],l=a[0],c=new Ii;c.lineStyle(n,i,void 0,o),c.moveTo(h.x,h.y),e.forEach(u=>c.lineTo(u.x,u.y)),(s==="None"||s==="Top")&&c.moveTo(l.x,l.y),a.forEach(u=>c.lineTo(u.x,u.y)),(s==="TopAndBottom"||s==="Top")&&c.lineTo(h.x,h.y),this.addChild(c)}drawCasingWindowOutline(t,e,{lineColor:i,windowOptions:n},s=1){var m,g;const o=!!((g=(m=this.referenceSystem)==null?void 0:m.options)!=null&&g.calculateDisplacementFromBottom),[a,h]=o?[t,e]:[e,t],[l,c]=o?[1,0]:[0,1],u=new Ii;u.lineStyle(s,xe(i),void 0,c);const d=a[0];u.moveTo(d.x,d.y),a.forEach(y=>u.lineTo(y.x,y.y));const f=new gA(u,{dash:[n.dashLength,n.spaceLength],color:xe(n.dashColor),width:s,alignment:l}),p=h[0];f.moveTo(p.x,p.y),h.forEach(y=>{f.lineTo(y.x,y.y)}),this.addChild(u)}preRender(){if(!this.data||!this.referenceSystem)return;const{exaggerationFactor:t=1}=this.options,{holeSizes:e,casings:i,cements:n,completion:s,symbols:o,pAndA:a,perforations:h}=this.data;this.updateSymbolCache(o),e.sort((m,g)=>g.diameter-m.diameter);const l=e.length>0?(jo(e,m=>m.diameter)??0)*t:U1*t;this.internalLayerVisibility.holeLayerId&&e.forEach(m=>this.drawHoleSize(l,m)),i.sort((m,g)=>g.diameter-m.diameter);const c=i.map(m=>this.createCasingRenderObject(m)),u=n.map(m=>({kind:"cement",segments:wA(m,i,s,e,t,this.getZFactorScaledPathForPoints),casingIds:(m.referenceIds||[]).filter(g=>g)})),[d,f]=a.reduce(([m,g],y)=>BT(y)?[[y,...m],g]:[m,[y,...g]],[[],[]]),p=d.map(m=>({kind:"cementSqueeze",segments:this.createCementSqueezeShape(m,i,s,e),casingIds:m.referenceIds}));if(this.sortCementAndCasingRenderObjects(c,u,p).forEach(jA(m=>{this.internalLayerVisibility.casingLayerId&&(this.drawCasing(m),m.hasShoe&&this.drawShoe(m.bottom,m.referenceRadius))},m=>{if(this.internalLayerVisibility.cementLayerId){const g=this.getCementTexture();g&&this.drawComplexRope(m.segments,g)}},m=>{if(this.internalLayerVisibility.pAndALayerId){const g=this.getCementSqueezeTexture();g&&this.drawComplexRope(m.segments,g)}})),this.perforationRopeAndTextureReferences.forEach(({rope:m,texture:g})=>{m.destroy({children:!0,texture:!0,baseTexture:!0}),g.destroy(!0)}),this.perforationRopeAndTextureReferences=[],this.internalLayerVisibility.perforationLayerId){const{perforationOptions:m}=this.options,g=h.filter(NT),y=h.filter(kT),_=h.filter(UT);g.forEach(v=>{const w=this.createPerforationShape(v,i,e).reduce((C,A)=>(C[A.diameter]||(C[A.diameter]=[]),C[A.diameter]=[...C[A.diameter]??[],A],C),{});Object.values(w).forEach(C=>{const A=kA(v,C[0],m),S=this.drawComplexRope(C,A);S&&this.perforationRopeAndTextureReferences.push({rope:S,texture:A})})}),_.forEach(v=>{const C=this.createPerforationShape(v,i,e).map(A=>({...A,diameter:A.diameter*3})).reduce((A,S)=>(A[S.diameter]||(A[S.diameter]=[]),A[S.diameter]=[...A[S.diameter]??[],S],A),{});Object.values(C).forEach(A=>{A.forEach(S=>{const F=GA(v,h,S,m),N=this.drawComplexRope([S],F);N&&this.perforationRopeAndTextureReferences.push({rope:N,texture:F})})})}),y.forEach(v=>{const C=this.createPerforationShape(v,i,e).map(A=>({...A,diameter:A.diameter*3})).reduce((A,S)=>(A[S.diameter]||(A[S.diameter]=[]),A[S.diameter]=[...A[S.diameter]??[],S],A),{});Object.values(C).forEach(A=>{A.forEach(S=>{const F=UA(v,S,m),N=this.drawComplexRope([S],F);N&&this.perforationRopeAndTextureReferences.push({rope:N,texture:F})})})})}this.internalLayerVisibility.completionLayerId&&s.forEach(OT(m=>this.drawScreen(m),m=>this.drawTubing(m),m=>{const g=this.prepareSymbolRenderObject(m);this.drawSymbolComponent(g)})),this.internalLayerVisibility.pAndALayerId&&f.forEach(m=>{if(DT(m)){const g=this.prepareSymbolRenderObject(m);this.drawSymbolComponent(g)}LT(m)&&this.drawCementPlug(m,i,s,e)})}updateSymbolCache(t){if(this.textureSymbolCacheArray||(this.textureSymbolCacheArray={}),!t)return;const e=Object.keys(this.textureSymbolCacheArray);Object.entries(t).forEach(([i,n])=>{!e.includes(i)&&this.textureSymbolCacheArray&&(this.textureSymbolCacheArray[i]=k.from(n))})}drawCementPlug(t,e,i,n){const{exaggerationFactor:s=1,cementPlugOptions:o}=this.options,a=AA(t,e,i,n,s,this.getZFactorScaledPathForPoints);o&&this.drawComplexRope(a,this.getCementPlugTexture(o));const{rightPath:h,leftPath:l}=a.reduce((c,u)=>{const{leftPath:d,rightPath:f}=zn(u.diameter/2,u.points);return{rightPath:[...c.rightPath,...f],leftPath:[...c.leftPath,...d]}},{rightPath:[],leftPath:[]});this.drawOutline(l,h,xe("black"),.25,"TopAndBottom")}createCasingRenderObject(t){const{exaggerationFactor:e=1}=this.options;return BA(e,t,this.getZFactorScaledPathForPoints)}getCementPlugTexture(t){return this.cementPlugTextureCache||(this.cementPlugTextureCache=RA(t)),this.cementPlugTextureCache}drawSVGRope(t,e){if(t.length===0)return;const i=new WA(e,t);this.addChild(i)}getSymbolTexture(t,e){var n,s;const i=(s=(n=this.textureSymbolCacheArray)==null?void 0:n[t])==null?void 0:s.baseTexture;return i?new k(i,void 0,new Y(0,0,0,e),void 0,st.MAIN_DIAGONAL):void 0}drawHoleRope(t,e,i){if(t.length===0)return;const n=new iu(e,t,i/Ge);this.addChild(n)}getHoleTexture(t,e,i){const n=Ge,s=n,o=n,a=e/i*n;this.holeTextureCache||(this.holeTextureCache=SA(t,o,s));const h=this.holeTextureCache.baseTexture,l=(s-a)/2,c=new Y(0,l,o,a);return new k(h,c)}sortCementAndCasingRenderObjects(t,e,i){let n=0;const{result:s}=t.reduce((o,a)=>{const h=o.remainingCement.find(c=>c.casingIds.includes(a.id)),l=o.remainingCementSqueezes.filter(c=>c.casingIds.includes(a.id));return h&&(h.zIndex=n++),l.forEach(c=>c.zIndex=n++),a.zIndex=n++,{result:[...o.result,h,a,...l],remainingCement:o.remainingCement.filter(c=>c!==h),remainingCementSqueezes:o.remainingCementSqueezes.filter(c=>!l.includes(c))}},{result:[],remainingCement:e,remainingCementSqueezes:i});return s.filter(o=>o!=null).sort((o,a)=>o.zIndex-a.zIndex)}drawComplexRope(t,e){if(t.length===0)return;const i=new $A(e,t);return this.addChild(i),i}createCasingTexture(t){return new k(k.WHITE.baseTexture,void 0,new Y(0,0,16,t))}drawShoe(t,e){const{exaggerationFactor:i=1,casingOptions:n}=this.options,s=n.shoeSize.width*i,o=n.shoeSize.length*i,a=this.generateShoe(t,e,o,s),h=this.generateShoe(t,e,o,-s);this.drawBigPolygon(h),this.drawBigPolygon(a)}getCementTexture(){if(!this.cementTextureCache){const{cementOptions:t}=this.options;t&&(this.cementTextureCache=PA(t))}return this.cementTextureCache}getCementSqueezeTexture(){if(!this.cementSqueezeTextureCache){const{cementSqueezeOptions:t}=this.options;t&&(this.cementSqueezeTextureCache=MA(t))}return this.cementSqueezeTextureCache}drawScreen({start:t,end:e,diameter:i}){const{exaggerationFactor:n=1,screenOptions:s}=this.options,o=n*i,a=this.getZFactorScaledPathForPoints(t,e),{leftPath:h,rightPath:l}=zn(o/2,a),c=this.getScreenTexture();c&&(this.drawCompletionRope(a,c,o),this.drawOutline(h,l,xe(s.lineColor),H1*n,"TopAndBottom"))}drawTubing({diameter:t,start:e,end:i}){const{exaggerationFactor:n=1,tubingOptions:s}=this.options,o=n*t,a=this.getZFactorScaledPathForPoints(e,i),h=this.getTubingTexture(s);this.drawCompletionRope(a,h,o)}getTubingTexture(t){return this.tubingTextureCache||(this.tubingTextureCache=IA(t)),this.tubingTextureCache}getScreenTexture(){if(!this.screenTextureCache){const{screenOptions:t}=this.options;t&&(this.screenTextureCache=CA(t))}return this.screenTextureCache}drawCompletionRope(t,e,i){if(t.length===0)return;const n=new VA(e,t,i);this.addChild(n)}};Kf.getOutlineClosureType=(r,t)=>r===0?r===t?"TopAndBottom":"Top":r===t?"Bottom":"None";let sE=Kf;const oE=r=>{const t=document.createElement("div");return t.setAttribute("style",`display: flex;flex:1;flex-direction:column; width: ${r}px;height:100%; background-color: white; padding: 12px;`),t},aE=(r,t)=>{const e=document.createElement("div");return e.className="story-layer-container",e.setAttribute("style",`height: ${t}px; width: ${r}px;background-color: #eee;`),e.setAttribute("height",`${t}`),e.setAttribute("width",`${r}`),e},hE=r=>{const t=document.createElement("div");return t.className="button-container",t.setAttribute("style",`width: ${r}px;background-color: white;`),t},lE=()=>{const r=document.createElement("p"),t=[];let e;function i(){window.requestAnimationFrame(()=>{const n=performance.now();for(;t.length>0&&t[0]<=n-1e3;)t.shift();t.push(n),e=t.length,r.innerHTML=`FPS: ${e}`,i()})}return i(),r},cE=r=>{const t=document.createElement("p");return t.innerHTML=r,t};export{eE as C,Yu as D,Ii as G,QA as H,ju as L,rE as P,sE as S,JA as V,ZA as Z,Lh as a,hE as b,oE as c,aE as d,lE as e,cE as f,nE as g,f0 as h,iE as i,Tu as j,tE as k,FT as l,qu as m,D0 as n,KA as o,qn as p,Ue as q,Je as r,Be as s,qA as t,qe as u}; diff --git a/storybook/master/assets/geomodel-layer.stories-2e09c9c8.js b/storybook/master/assets/geomodel-layer.stories-d4ee5bea.js similarity index 98% rename from storybook/master/assets/geomodel-layer.stories-2e09c9c8.js rename to storybook/master/assets/geomodel-layer.stories-d4ee5bea.js index e44b5aa8..c4f9462f 100644 --- a/storybook/master/assets/geomodel-layer.stories-2e09c9c8.js +++ b/storybook/master/assets/geomodel-layer.stories-d4ee5bea.js @@ -1,4 +1,4 @@ -import{I as C,C as k}from"./MainController-ae0d41fa.js";import{C as re,i as le,c as M,d as H,e as j,P as A,g as z,Z as ae,f as D}from"./elements-84f906e9.js";import{G as U,a as se}from"./GeomodelLayerV2-032ec5d4.js";import{g as G,c as R,d as I,k as W}from"./data-e45bb153.js";import"./GridLayer-416fefe9.js";import"./findsample-cc6ecc23.js";const ce=1e4;class ie extends re{constructor(t,m){super(t,m),this.surfaceAreasPaths=[],this.surfaceLinesPaths=[],this.maxDepth=ce,this.drawPolygonPath=(n,a)=>{const{ctx:e}=this;e!=null&&(e.fillStyle=n,e.fill(a))},this.drawLinePath=(n,a)=>{const{ctx:e}=this;e!=null&&(e.strokeStyle=n,e.stroke(a))},this.createPolygons=n=>{var o,s,i,p,g,u;const a=[];let e=[];for(let d=0;d0){for(let f=l?d:d-1;f>=0&&((p=n[f])!=null&&p[1]);f--)e.push((g=n[f])==null?void 0:g[0],((u=n[f])==null?void 0:u[2])||this.maxDepth);a.push(e),e=[]}}return a},this.generatePolygonPath=n=>{const a=new Path2D;a.moveTo(n[0],n[1]);for(let e=2;e{var i,p,g,u,d;const a=[],{data:e}=n;let o=!1,s;for(let l=0;l{this.clearCanvas(),this.surfaceAreasPaths.forEach(t=>this.drawPolygonPath(t.color,t.path)),this.surfaceLinesPaths.forEach(t=>this.drawLinePath(t.color,t.path))})}colorToCSSColor(t){return le(t)}generateSurfaceAreasPaths(){var t;this.surfaceAreasPaths=((t=this.data)==null?void 0:t.areas.reduce((m,n)=>{const e=this.createPolygons(n.data).map(o=>({color:this.colorToCSSColor(n.color),path:this.generatePolygonPath(o)}));return m.push(...e),m},[]))??[]}generateSurfaceLinesPaths(){var t;this.surfaceLinesPaths=((t=this.data)==null?void 0:t.lines.reduce((m,n)=>{const e=this.generateLinePaths(n).map(o=>({color:this.colorToCSSColor(n.color),path:o}));return m.push(...e),m},[]))??[]}}const c=700,y=600,v=()=>{const r=M(c),t=H(c,y),m=j(),n={order:1},a=new A({width:c,height:y}),e=new U(a,"webgl",n);e.onMount({elm:t,height:y,width:c}),Promise.all([G(),R(),I(),W()]).then(s=>{var L,h,b;const[i,p,g]=s,u=new C(i),l=1e3/(u.displacement||1),w=((b=(h=(L=p[0])==null?void 0:L.data)==null?void 0:h.values)==null?void 0:b.length)||1,f=u.getTrajectory(w,0,1+l),P=C.toDisplacement(f.points,f.offset),S=z(P,g,p);e.onUpdate({data:S})});const o=new ae(t,s=>{e.onRescale(s)});return o.setBounds([0,1e3],[0,1e3]),o.adjustToSize(c,y),o.zFactor=1,o.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),o.enableTranslateExtent=!1,o.setViewport(1e3,1e3,5e3),r.appendChild(D("Low level interface for creating and displaying geo model (aka surfaces). This layer is made using webGL.")),r.appendChild(t),r.appendChild(m),r},E=()=>{const r=M(c),t=H(c,y),m=j(),n={order:1},a=new A({width:c,height:y}),e=new U(a,"geomodels",n);e.onMount({elm:t,height:y,width:c});const o={order:1},s=new se("labels",o);s.onMount({elm:t});const i=new ae(r,p=>{e.onRescale(p),s.onRescale({...p})});return Promise.all([G(),R(),I()]).then(p=>{var b,T,x;const[g,u,d]=p,l=new C(g),f=1e3/(l.displacement||1),P=((x=(T=(b=u[0])==null?void 0:b.data)==null?void 0:T.values)==null?void 0:x.length)||1,S=l.getTrajectory(P,0,1+f),L=C.toDisplacement(S.points,S.offset),h=z(L,d,u);e.referenceSystem=l,s.referenceSystem=l,e.setData(h),s.setData(h)}),i.setBounds([0,1e3],[0,1e3]),i.adjustToSize(c,y),i.zFactor=1,i.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),i.enableTranslateExtent=!1,i.setViewport(1e3,1e3,5e3),r.appendChild(D("Low level interface for creating and displaying geo model (aka surfaces) with labels. The geo model layer is made using webGL and the labels using canvas.")),r.appendChild(t),r.appendChild(m),r},B=()=>{const r=M(c),t=H(c,y),m=j(),n={order:1},a=new A({width:c,height:y}),e=new U(a,"webgl",n);Promise.all([G(),R(),I(),W()]).then(s=>{var L,h,b;const[i,p,g]=s,u=new C(i),l=1e3/(u.displacement||1),w=((b=(h=(L=p[0])==null?void 0:L.data)==null?void 0:h.values)==null?void 0:b.length)||1,f=u.getTrajectory(w,0,1+l),P=C.toDisplacement(f.points,f.offset),S=z(P,g,p);e.setData(S)});const o=new k({container:t,layers:[e]});return o.setBounds([0,1e3],[0,1e3]),o.adjustToSize(c,y),o.zoomPanHandler.zFactor=1,o.zoomPanHandler.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),o.zoomPanHandler.enableTranslateExtent=!1,o.setViewport(1e3,1e3,5e3),r.appendChild(D("High level interface for creating and displaying geo model (aka surfaces). This layer is made using webGL.")),r.appendChild(t),r.appendChild(m),r},F=()=>{const r=M(c),t=H(c,y),m=j(),n={order:1},a=new A({width:c,height:y}),e=new U(a,"geomodels",n);e.onMount({elm:t,height:y,width:c});const o={order:1},s=new se("labels",o);return s.onMount({elm:t}),Promise.all([G(),R(),I()]).then(i=>{var b,T,x;const[p,g,u]=i,d=new C(p),w=1e3/(d.displacement||1),f=((x=(T=(b=g[0])==null?void 0:b.data)==null?void 0:T.values)==null?void 0:x.length)||1,P=d.getTrajectory(f,0,1+w),S=C.toDisplacement(P.points,P.offset),L=z(S,u,g),h=new k({container:t,layers:[e,s]});h.setReferenceSystem(d),e.setData(L),s.setData(L),h.setBounds([0,1e3],[0,1e3]),h.adjustToSize(c,y),h.zoomPanHandler.zFactor=1,h.zoomPanHandler.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),h.zoomPanHandler.enableTranslateExtent=!1,h.setViewport(1e3,1e3,5e3)}),r.appendChild(D("High level interface for creating and displaying geo model (aka surfaces) with labels. The geo model layer is made using webGL and the labels using canvas.")),r.appendChild(t),r.appendChild(m),r},V=()=>{const r=M(c),t=H(c,y),m=j(),n={order:1},a=new ie("canvas",n);Promise.all([G(),R(),I(),W()]).then(o=>{var S,L,h;const[s,i,p]=o,g=new C(s),d=1e3/(g.displacement||1),l=((h=(L=(S=i[0])==null?void 0:S.data)==null?void 0:L.values)==null?void 0:h.length)||1,w=g.getTrajectory(l,0,1+d),f=C.toDisplacement(w.points,w.offset),P=z(f,p,i);a.setData(P)});const e=new k({container:t,layers:[a]});return e.setBounds([0,1e3],[0,1e3]),e.adjustToSize(c,y),e.zoomPanHandler.zFactor=1,e.zoomPanHandler.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),e.zoomPanHandler.enableTranslateExtent=!1,e.setViewport(1e3,1e3,5e3),r.appendChild(D("High level interface for creating and displaying geo model (aka surfaces). This layer is made using plain HTML canvas. GeomodelLayer is preferred for rendering geo models if your browser supports WebGL.")),r.appendChild(t),r.appendChild(m),r},fe={title:"ESV Intersection/Features/Geo Model",component:v};var O,_,Z;v.parameters={...v.parameters,docs:{...(O=v.parameters)==null?void 0:O.docs,source:{originalSource:`() => { +import{I as C,C as k}from"./MainController-1e1a9474.js";import{C as re,i as le,c as M,d as H,e as j,P as A,g as z,Z as ae,f as D}from"./elements-217018fd.js";import{G as U,a as se}from"./GeomodelLayerV2-4f8f3306.js";import{g as G,c as R,d as I,k as W}from"./data-e45bb153.js";import"./GridLayer-66718e35.js";import"./findsample-cc6ecc23.js";const ce=1e4;class ie extends re{constructor(t,m){super(t,m),this.surfaceAreasPaths=[],this.surfaceLinesPaths=[],this.maxDepth=ce,this.drawPolygonPath=(n,a)=>{const{ctx:e}=this;e!=null&&(e.fillStyle=n,e.fill(a))},this.drawLinePath=(n,a)=>{const{ctx:e}=this;e!=null&&(e.strokeStyle=n,e.stroke(a))},this.createPolygons=n=>{var o,s,i,p,g,u;const a=[];let e=[];for(let d=0;d0){for(let f=l?d:d-1;f>=0&&((p=n[f])!=null&&p[1]);f--)e.push((g=n[f])==null?void 0:g[0],((u=n[f])==null?void 0:u[2])||this.maxDepth);a.push(e),e=[]}}return a},this.generatePolygonPath=n=>{const a=new Path2D;a.moveTo(n[0],n[1]);for(let e=2;e{var i,p,g,u,d;const a=[],{data:e}=n;let o=!1,s;for(let l=0;l{this.clearCanvas(),this.surfaceAreasPaths.forEach(t=>this.drawPolygonPath(t.color,t.path)),this.surfaceLinesPaths.forEach(t=>this.drawLinePath(t.color,t.path))})}colorToCSSColor(t){return le(t)}generateSurfaceAreasPaths(){var t;this.surfaceAreasPaths=((t=this.data)==null?void 0:t.areas.reduce((m,n)=>{const e=this.createPolygons(n.data).map(o=>({color:this.colorToCSSColor(n.color),path:this.generatePolygonPath(o)}));return m.push(...e),m},[]))??[]}generateSurfaceLinesPaths(){var t;this.surfaceLinesPaths=((t=this.data)==null?void 0:t.lines.reduce((m,n)=>{const e=this.generateLinePaths(n).map(o=>({color:this.colorToCSSColor(n.color),path:o}));return m.push(...e),m},[]))??[]}}const c=700,y=600,v=()=>{const r=M(c),t=H(c,y),m=j(),n={order:1},a=new A({width:c,height:y}),e=new U(a,"webgl",n);e.onMount({elm:t,height:y,width:c}),Promise.all([G(),R(),I(),W()]).then(s=>{var L,h,b;const[i,p,g]=s,u=new C(i),l=1e3/(u.displacement||1),w=((b=(h=(L=p[0])==null?void 0:L.data)==null?void 0:h.values)==null?void 0:b.length)||1,f=u.getTrajectory(w,0,1+l),P=C.toDisplacement(f.points,f.offset),S=z(P,g,p);e.onUpdate({data:S})});const o=new ae(t,s=>{e.onRescale(s)});return o.setBounds([0,1e3],[0,1e3]),o.adjustToSize(c,y),o.zFactor=1,o.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),o.enableTranslateExtent=!1,o.setViewport(1e3,1e3,5e3),r.appendChild(D("Low level interface for creating and displaying geo model (aka surfaces). This layer is made using webGL.")),r.appendChild(t),r.appendChild(m),r},E=()=>{const r=M(c),t=H(c,y),m=j(),n={order:1},a=new A({width:c,height:y}),e=new U(a,"geomodels",n);e.onMount({elm:t,height:y,width:c});const o={order:1},s=new se("labels",o);s.onMount({elm:t});const i=new ae(r,p=>{e.onRescale(p),s.onRescale({...p})});return Promise.all([G(),R(),I()]).then(p=>{var b,T,x;const[g,u,d]=p,l=new C(g),f=1e3/(l.displacement||1),P=((x=(T=(b=u[0])==null?void 0:b.data)==null?void 0:T.values)==null?void 0:x.length)||1,S=l.getTrajectory(P,0,1+f),L=C.toDisplacement(S.points,S.offset),h=z(L,d,u);e.referenceSystem=l,s.referenceSystem=l,e.setData(h),s.setData(h)}),i.setBounds([0,1e3],[0,1e3]),i.adjustToSize(c,y),i.zFactor=1,i.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),i.enableTranslateExtent=!1,i.setViewport(1e3,1e3,5e3),r.appendChild(D("Low level interface for creating and displaying geo model (aka surfaces) with labels. The geo model layer is made using webGL and the labels using canvas.")),r.appendChild(t),r.appendChild(m),r},B=()=>{const r=M(c),t=H(c,y),m=j(),n={order:1},a=new A({width:c,height:y}),e=new U(a,"webgl",n);Promise.all([G(),R(),I(),W()]).then(s=>{var L,h,b;const[i,p,g]=s,u=new C(i),l=1e3/(u.displacement||1),w=((b=(h=(L=p[0])==null?void 0:L.data)==null?void 0:h.values)==null?void 0:b.length)||1,f=u.getTrajectory(w,0,1+l),P=C.toDisplacement(f.points,f.offset),S=z(P,g,p);e.setData(S)});const o=new k({container:t,layers:[e]});return o.setBounds([0,1e3],[0,1e3]),o.adjustToSize(c,y),o.zoomPanHandler.zFactor=1,o.zoomPanHandler.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),o.zoomPanHandler.enableTranslateExtent=!1,o.setViewport(1e3,1e3,5e3),r.appendChild(D("High level interface for creating and displaying geo model (aka surfaces). This layer is made using webGL.")),r.appendChild(t),r.appendChild(m),r},F=()=>{const r=M(c),t=H(c,y),m=j(),n={order:1},a=new A({width:c,height:y}),e=new U(a,"geomodels",n);e.onMount({elm:t,height:y,width:c});const o={order:1},s=new se("labels",o);return s.onMount({elm:t}),Promise.all([G(),R(),I()]).then(i=>{var b,T,x;const[p,g,u]=i,d=new C(p),w=1e3/(d.displacement||1),f=((x=(T=(b=g[0])==null?void 0:b.data)==null?void 0:T.values)==null?void 0:x.length)||1,P=d.getTrajectory(f,0,1+w),S=C.toDisplacement(P.points,P.offset),L=z(S,u,g),h=new k({container:t,layers:[e,s]});h.setReferenceSystem(d),e.setData(L),s.setData(L),h.setBounds([0,1e3],[0,1e3]),h.adjustToSize(c,y),h.zoomPanHandler.zFactor=1,h.zoomPanHandler.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),h.zoomPanHandler.enableTranslateExtent=!1,h.setViewport(1e3,1e3,5e3)}),r.appendChild(D("High level interface for creating and displaying geo model (aka surfaces) with labels. The geo model layer is made using webGL and the labels using canvas.")),r.appendChild(t),r.appendChild(m),r},V=()=>{const r=M(c),t=H(c,y),m=j(),n={order:1},a=new ie("canvas",n);Promise.all([G(),R(),I(),W()]).then(o=>{var S,L,h;const[s,i,p]=o,g=new C(s),d=1e3/(g.displacement||1),l=((h=(L=(S=i[0])==null?void 0:S.data)==null?void 0:L.values)==null?void 0:h.length)||1,w=g.getTrajectory(l,0,1+d),f=C.toDisplacement(w.points,w.offset),P=z(f,p,i);a.setData(P)});const e=new k({container:t,layers:[a]});return e.setBounds([0,1e3],[0,1e3]),e.adjustToSize(c,y),e.zoomPanHandler.zFactor=1,e.zoomPanHandler.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),e.zoomPanHandler.enableTranslateExtent=!1,e.setViewport(1e3,1e3,5e3),r.appendChild(D("High level interface for creating and displaying geo model (aka surfaces). This layer is made using plain HTML canvas. GeomodelLayer is preferred for rendering geo models if your browser supports WebGL.")),r.appendChild(t),r.appendChild(m),r},fe={title:"ESV Intersection/Features/Geo Model",component:v};var O,_,Z;v.parameters={...v.parameters,docs:{...(O=v.parameters)==null?void 0:O.docs,source:{originalSource:`() => { const root = createRootContainer(width); const container = createLayerContainer(width, height); const fpsLabel = createFPSLabel(); diff --git a/storybook/master/assets/grid-layer.stories-de373241.js b/storybook/master/assets/grid-layer.stories-35e853d6.js similarity index 92% rename from storybook/master/assets/grid-layer.stories-de373241.js rename to storybook/master/assets/grid-layer.stories-35e853d6.js index 2c43d2a2..8e0828f6 100644 --- a/storybook/master/assets/grid-layer.stories-de373241.js +++ b/storybook/master/assets/grid-layer.stories-35e853d6.js @@ -1,4 +1,4 @@ -import{c as p,d as g,Z as w,f as C}from"./elements-84f906e9.js";import{G as y}from"./GridLayer-416fefe9.js";import{C as v}from"./MainController-ae0d41fa.js";const r=700,a=600,o=()=>{const e=p(r),n=g(r,a),t=new y("grid",{order:1,majorColor:"black",minorColor:"black",majorWidth:.5,minorWidth:.5});return t.onMount({elm:n,width:r,height:a}),new w(n,L=>{t.onRescale(L)}).adjustToSize(r,a),e.appendChild(C("Low level interface to create and display grid. This layer is made using canvas.")),e.appendChild(n),e},i=()=>{const e=p(r),n=g(r,a),t=new y("grid",{order:1,majorColor:"black",minorColor:"black",majorWidth:.5,minorWidth:.5});return new v({container:n,layers:[t]}).adjustToSize(r,a),e.appendChild(C("High level interface to create and display grid. This layer is made using canvas.")),e.appendChild(n),e},T={title:"ESV Intersection/Features/Grid",component:o};var d,c,s;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:`() => { +import{c as p,d as g,Z as w,f as C}from"./elements-217018fd.js";import{G as y}from"./GridLayer-66718e35.js";import{C as v}from"./MainController-1e1a9474.js";const r=700,a=600,o=()=>{const e=p(r),n=g(r,a),t=new y("grid",{order:1,majorColor:"black",minorColor:"black",majorWidth:.5,minorWidth:.5});return t.onMount({elm:n,width:r,height:a}),new w(n,L=>{t.onRescale(L)}).adjustToSize(r,a),e.appendChild(C("Low level interface to create and display grid. This layer is made using canvas.")),e.appendChild(n),e},i=()=>{const e=p(r),n=g(r,a),t=new y("grid",{order:1,majorColor:"black",minorColor:"black",majorWidth:.5,minorWidth:.5});return new v({container:n,layers:[t]}).adjustToSize(r,a),e.appendChild(C("High level interface to create and display grid. This layer is made using canvas.")),e.appendChild(n),e},T={title:"ESV Intersection/Features/Grid",component:o};var d,c,s;o.parameters={...o.parameters,docs:{...(d=o.parameters)==null?void 0:d.docs,source:{originalSource:`() => { const root = createRootContainer(width); const container = createLayerContainer(width, height); const gridLayer = new GridLayer('grid', { diff --git a/storybook/master/assets/highlight.stories-7be4c1c1.js b/storybook/master/assets/highlight.stories-ea01c9f0.js similarity index 96% rename from storybook/master/assets/highlight.stories-7be4c1c1.js rename to storybook/master/assets/highlight.stories-ea01c9f0.js index 1e1591e2..58d064cd 100644 --- a/storybook/master/assets/highlight.stories-7be4c1c1.js +++ b/storybook/master/assets/highlight.stories-ea01c9f0.js @@ -1,4 +1,4 @@ -import{L as M,D as A,m as P,s as $,c as v,d as f,Z as F,e as C}from"./elements-84f906e9.js";import{W as H}from"./WellborePathLayer-4cd0b66f.js";import{I as E,C as U}from"./MainController-ae0d41fa.js";import{g as T}from"./data-e45bb153.js";import"./GridLayer-416fefe9.js";class k extends M{onMount(e){super.onMount(e);const{elm:t}=e,o=e.width||parseInt((t==null?void 0:t.getAttribute("width"))??"",10)||A,i=e.height||parseInt((t==null?void 0:t.getAttribute("height"))??"",10)||P;this.elm||(this.elm=$(t).append("div"),this.elm.attr("id",`${this.id}`),this.elm.attr("class","html-layer"));const r=this.interactive?"auto":"none";this.elm.style("position","absolute").style("height",`${i}px`).style("width",`${o}px`).style("opacity",this.opacity).style("overflow","hidden").style("pointer-events",r).style("z-index",this.order)}onUnmount(){var e;super.onUnmount(),(e=this.elm)==null||e.remove(),this.elm=void 0}onResize(e){this.elm&&(super.onResize(e),this.elm.style("height",`${e.height}px`).style("width",`${e.width}px`))}setVisibility(e){super.setVisibility(e),this.elm&&this.elm.attr("visibility",e?"visible":"hidden")}onOpacityChanged(e){this.elm&&this.elm.style("opacity",e)}onOrderChanged(e){this.elm&&this.elm.style("z-index",e)}onInteractivityChanged(e){if(this.elm){const t=e?"auto":"none";this.elm.style("pointer-events",t)}}}const z=5,O=5,y=2,D=(O+y)/2,V=(z+y)/2,a=700,c=600,m=[0,1e3],g=[0,1e3],N={xMin:m[0],xMax:m[1],yMin:g[0],yMax:g[1]},_={xLabel:"Displacement",yLabel:"TVD MSL",unitOfMeasure:"m"},h=()=>{const n=v(a),e=f(a,c);return T().then(t=>{const o=new E(t),i=new H("wellborepath",{order:3,strokeWidth:"2px",stroke:"red",referenceSystem:o});i.onMount({elm:e}),i.onUpdate({});const r=new R("pointhighlighter",{order:105,referenceSystem:o,layerOpacity:.5});r.onMount({elm:e,width:a,height:c});const s=new F(e,l=>{i.onRescale({...l}),r.onRescale({...l})});s.setBounds([0,1e3],[0,1e3]),s.adjustToSize(a,c),s.zFactor=1,s.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),s.enableTranslateExtent=!1,s.setViewport(1e3,1e3,5e3),r.onRescale(s.currentStateAsEvent());const p=I(l=>W(l,{rescaleEvent:s.currentStateAsEvent(),layer:r}),{width:a,min:0,max:o.length});n.appendChild(e),n.appendChild(p),n.appendChild(C())}),n},d=()=>{const n=v(a),e=f(a,c);return T().then(t=>{const o=new E(t),i=new H("wellborepath",{order:3,strokeWidth:"2px",stroke:"red",referenceSystem:o}),r=new U({referenceSystem:o,axisOptions:_,scaleOptions:N,container:e}),s=new R("pointhighlighter",{order:105,referenceSystem:o,layerOpacity:.5});r.addLayer(i).addLayer(s),r.setBounds([0,1e3],[0,1e3]),r.adjustToSize(a,c),r.setViewport(1e3,1e3,5e3);const p=I(l=>W(l,{rescaleEvent:r.currentStateAsEvent,layer:s}),{width:a,min:-1e3,max:r.referenceSystem.length+1e3});n.appendChild(e),n.appendChild(p),n.appendChild(C())}),n};class R extends k{constructor(){super(...arguments),this.elements=[],this.elementCurveLength=0}onMount(e){super.onMount(e),this.addHighlightElement("wellborepath")}onRescale(e){super.onRescale(e);const t=this.elements[0];if(this.referenceSystem){const o=this.referenceSystem.project(this.elementCurveLength),i=e.xScale(o[0]),r=e.yScale(o[1]);t.style("left",`${i-D}px`),t.style("top",`${r-V}px`)}}addHighlightElement(e){const t=this.elm.append("div").attr("id",`${e}-highlight`);return t.style("visibility","visible"),t.style("height",`${z}px`),t.style("width",`${O}px`),t.style("display","inline-block"),t.style("padding",`${y}px`),t.style("border-radius","4px"),t.style("position","absolute"),t.style("background-color","red"),this.elements=[t],this}getElement(e){return this.elm.select(e)}onUpdateCurveLength(e){this.elementCurveLength=e}}const W=(n,e)=>{e.layer.onUpdateCurveLength(Number(n.target.value)),e.layer.onRescale(e.rescaleEvent)},I=(n,e)=>{const t=document.createElement("input");let o=0;return t.type="range",t.value=o.toString(),t.min=`${e.min||0}`,t.max=`${e.max||10}`,t.setAttribute("style",`width:${e.width}px`),t.oninput=n,t},X={title:"ESV Intersection/Features/Highlight",component:h};var u,w,L;h.parameters={...h.parameters,docs:{...(u=h.parameters)==null?void 0:u.docs,source:{originalSource:`() => { +import{L as M,D as A,m as P,s as $,c as v,d as f,Z as F,e as C}from"./elements-217018fd.js";import{W as H}from"./WellborePathLayer-11ff1510.js";import{I as E,C as U}from"./MainController-1e1a9474.js";import{g as T}from"./data-e45bb153.js";import"./GridLayer-66718e35.js";class k extends M{onMount(e){super.onMount(e);const{elm:t}=e,o=e.width||parseInt((t==null?void 0:t.getAttribute("width"))??"",10)||A,i=e.height||parseInt((t==null?void 0:t.getAttribute("height"))??"",10)||P;this.elm||(this.elm=$(t).append("div"),this.elm.attr("id",`${this.id}`),this.elm.attr("class","html-layer"));const r=this.interactive?"auto":"none";this.elm.style("position","absolute").style("height",`${i}px`).style("width",`${o}px`).style("opacity",this.opacity).style("overflow","hidden").style("pointer-events",r).style("z-index",this.order)}onUnmount(){var e;super.onUnmount(),(e=this.elm)==null||e.remove(),this.elm=void 0}onResize(e){this.elm&&(super.onResize(e),this.elm.style("height",`${e.height}px`).style("width",`${e.width}px`))}setVisibility(e){super.setVisibility(e),this.elm&&this.elm.attr("visibility",e?"visible":"hidden")}onOpacityChanged(e){this.elm&&this.elm.style("opacity",e)}onOrderChanged(e){this.elm&&this.elm.style("z-index",e)}onInteractivityChanged(e){if(this.elm){const t=e?"auto":"none";this.elm.style("pointer-events",t)}}}const z=5,O=5,y=2,D=(O+y)/2,V=(z+y)/2,a=700,c=600,m=[0,1e3],g=[0,1e3],N={xMin:m[0],xMax:m[1],yMin:g[0],yMax:g[1]},_={xLabel:"Displacement",yLabel:"TVD MSL",unitOfMeasure:"m"},h=()=>{const n=v(a),e=f(a,c);return T().then(t=>{const o=new E(t),i=new H("wellborepath",{order:3,strokeWidth:"2px",stroke:"red",referenceSystem:o});i.onMount({elm:e}),i.onUpdate({});const r=new R("pointhighlighter",{order:105,referenceSystem:o,layerOpacity:.5});r.onMount({elm:e,width:a,height:c});const s=new F(e,l=>{i.onRescale({...l}),r.onRescale({...l})});s.setBounds([0,1e3],[0,1e3]),s.adjustToSize(a,c),s.zFactor=1,s.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),s.enableTranslateExtent=!1,s.setViewport(1e3,1e3,5e3),r.onRescale(s.currentStateAsEvent());const p=I(l=>W(l,{rescaleEvent:s.currentStateAsEvent(),layer:r}),{width:a,min:0,max:o.length});n.appendChild(e),n.appendChild(p),n.appendChild(C())}),n},d=()=>{const n=v(a),e=f(a,c);return T().then(t=>{const o=new E(t),i=new H("wellborepath",{order:3,strokeWidth:"2px",stroke:"red",referenceSystem:o}),r=new U({referenceSystem:o,axisOptions:_,scaleOptions:N,container:e}),s=new R("pointhighlighter",{order:105,referenceSystem:o,layerOpacity:.5});r.addLayer(i).addLayer(s),r.setBounds([0,1e3],[0,1e3]),r.adjustToSize(a,c),r.setViewport(1e3,1e3,5e3);const p=I(l=>W(l,{rescaleEvent:r.currentStateAsEvent,layer:s}),{width:a,min:-1e3,max:r.referenceSystem.length+1e3});n.appendChild(e),n.appendChild(p),n.appendChild(C())}),n};class R extends k{constructor(){super(...arguments),this.elements=[],this.elementCurveLength=0}onMount(e){super.onMount(e),this.addHighlightElement("wellborepath")}onRescale(e){super.onRescale(e);const t=this.elements[0];if(this.referenceSystem){const o=this.referenceSystem.project(this.elementCurveLength),i=e.xScale(o[0]),r=e.yScale(o[1]);t.style("left",`${i-D}px`),t.style("top",`${r-V}px`)}}addHighlightElement(e){const t=this.elm.append("div").attr("id",`${e}-highlight`);return t.style("visibility","visible"),t.style("height",`${z}px`),t.style("width",`${O}px`),t.style("display","inline-block"),t.style("padding",`${y}px`),t.style("border-radius","4px"),t.style("position","absolute"),t.style("background-color","red"),this.elements=[t],this}getElement(e){return this.elm.select(e)}onUpdateCurveLength(e){this.elementCurveLength=e}}const W=(n,e)=>{e.layer.onUpdateCurveLength(Number(n.target.value)),e.layer.onRescale(e.rescaleEvent)},I=(n,e)=>{const t=document.createElement("input");let o=0;return t.type="range",t.value=o.toString(),t.min=`${e.min||0}`,t.max=`${e.max||10}`,t.setAttribute("style",`width:${e.width}px`),t.oninput=n,t},X={title:"ESV Intersection/Features/Highlight",component:h};var u,w,L;h.parameters={...h.parameters,docs:{...(u=h.parameters)==null?void 0:u.docs,source:{originalSource:`() => { const root = createRootContainer(width); const container = createLayerContainer(width, height); getWellborePath().then(data => { diff --git a/storybook/master/assets/iframe-1c262315.js b/storybook/master/assets/iframe-1c262315.js new file mode 100644 index 00000000..39612e6a --- /dev/null +++ b/storybook/master/assets/iframe-1c262315.js @@ -0,0 +1 @@ +import"../sb-preview/runtime.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))c(t);new MutationObserver(t=>{for(const e of t)if(e.type==="childList")for(const o of e.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&c(o)}).observe(document,{childList:!0,subtree:!0});function _(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?e.credentials="include":t.crossOrigin==="anonymous"?e.credentials="omit":e.credentials="same-origin",e}function c(t){if(t.ep)return;t.ep=!0;const e=_(t);fetch(t.href,e)}})();const E="modulepreload",O=function(i,s){return new URL(i,s).href},m={},r=function(s,_,c){if(!_||_.length===0)return s();const t=document.getElementsByTagName("link");return Promise.all(_.map(e=>{if(e=O(e,c),e in m)return;m[e]=!0;const o=e.endsWith(".css"),d=o?'[rel="stylesheet"]':"";if(!!c)for(let a=t.length-1;a>=0;a--){const l=t[a];if(l.href===e&&(!o||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${d}`))return;const n=document.createElement("link");if(n.rel=o?"stylesheet":E,o||(n.as="script",n.crossOrigin=""),n.href=e,document.head.appendChild(n),o)return new Promise((a,l)=>{n.addEventListener("load",a),n.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${e}`)))})})).then(()=>s()).catch(e=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=e,window.dispatchEvent(o),!o.defaultPrevented)throw e})},{createBrowserChannel:p}=__STORYBOOK_MODULE_CHANNELS__,{addons:f}=__STORYBOOK_MODULE_PREVIEW_API__,u=p({page:"preview"});f.setChannel(u);window.__STORYBOOK_ADDONS_CHANNEL__=u;window.CONFIG_TYPE==="DEVELOPMENT"&&(window.__STORYBOOK_SERVER_CHANNEL__=u);const y={"./.storybook/src/complete-example/index.stories.ts":async()=>r(()=>import("./index.stories-63507133.js"),["./index.stories-63507133.js","./intersection.stories-fb6bd89f.js","./MainController-1e1a9474.js","./elements-217018fd.js","./GridLayer-66718e35.js","./picks-2410da4c.js","./GeomodelLayerV2-4f8f3306.js","./findsample-cc6ecc23.js","./seismic-colormap-ec670136.js","./WellborePathLayer-11ff1510.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/complete-example/intersection.stories.ts":async()=>r(()=>import("./intersection.stories-fb6bd89f.js"),["./intersection.stories-fb6bd89f.js","./MainController-1e1a9474.js","./elements-217018fd.js","./GridLayer-66718e35.js","./picks-2410da4c.js","./GeomodelLayerV2-4f8f3306.js","./findsample-cc6ecc23.js","./seismic-colormap-ec670136.js","./WellborePathLayer-11ff1510.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/axis.stories.ts":async()=>r(()=>import("./axis.stories-a4be38eb.js"),["./axis.stories-a4be38eb.js","./GridLayer-66718e35.js","./elements-217018fd.js","./MainController-1e1a9474.js"],import.meta.url),"./.storybook/src/features/callout-layer.stories.ts":async()=>r(()=>import("./callout-layer.stories-9cb185f5.js"),["./callout-layer.stories-9cb185f5.js","./MainController-1e1a9474.js","./elements-217018fd.js","./GridLayer-66718e35.js","./picks-2410da4c.js","./WellborePathLayer-11ff1510.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/geomodel-layer.stories.ts":async()=>r(()=>import("./geomodel-layer.stories-d4ee5bea.js"),["./geomodel-layer.stories-d4ee5bea.js","./MainController-1e1a9474.js","./elements-217018fd.js","./GridLayer-66718e35.js","./GeomodelLayerV2-4f8f3306.js","./findsample-cc6ecc23.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/grid-layer.stories.ts":async()=>r(()=>import("./grid-layer.stories-35e853d6.js"),["./grid-layer.stories-35e853d6.js","./elements-217018fd.js","./GridLayer-66718e35.js","./MainController-1e1a9474.js"],import.meta.url),"./.storybook/src/features/highlight.stories.ts":async()=>r(()=>import("./highlight.stories-ea01c9f0.js"),["./highlight.stories-ea01c9f0.js","./elements-217018fd.js","./WellborePathLayer-11ff1510.js","./MainController-1e1a9474.js","./GridLayer-66718e35.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/index.stories.ts":async()=>r(()=>import("./index.stories-2f6ae410.js"),["./index.stories-2f6ae410.js","./axis.stories-a4be38eb.js","./GridLayer-66718e35.js","./elements-217018fd.js","./MainController-1e1a9474.js","./zoom.stories-f007092c.js","./callout-layer.stories-9cb185f5.js","./picks-2410da4c.js","./WellborePathLayer-11ff1510.js","./data-e45bb153.js","./grid-layer.stories-35e853d6.js","./seismic.stories-e3ed59c5.js","./seismic-colormap-ec670136.js","./findsample-cc6ecc23.js","./highlight.stories-ea01c9f0.js","./wellborepath-layer.stories-52ba7562.js","./geomodel-layer.stories-d4ee5bea.js","./GeomodelLayerV2-4f8f3306.js","./schematic-layer.stories-5b12023d.js"],import.meta.url),"./.storybook/src/features/schematic-layer.stories.ts":async()=>r(()=>import("./schematic-layer.stories-5b12023d.js"),["./schematic-layer.stories-5b12023d.js","./MainController-1e1a9474.js","./elements-217018fd.js","./GridLayer-66718e35.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/seismic.stories.ts":async()=>r(()=>import("./seismic.stories-e3ed59c5.js"),["./seismic.stories-e3ed59c5.js","./elements-217018fd.js","./seismic-colormap-ec670136.js","./findsample-cc6ecc23.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/wellborepath-layer.stories.ts":async()=>r(()=>import("./wellborepath-layer.stories-52ba7562.js"),["./wellborepath-layer.stories-52ba7562.js","./MainController-1e1a9474.js","./elements-217018fd.js","./GridLayer-66718e35.js","./WellborePathLayer-11ff1510.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/zoom.stories.ts":async()=>r(()=>import("./zoom.stories-f007092c.js"),["./zoom.stories-f007092c.js","./GridLayer-66718e35.js","./elements-217018fd.js"],import.meta.url),"./.storybook/src/other-examples/basic-intersection.stories.ts":async()=>r(()=>import("./basic-intersection.stories-d9b48339.js"),["./basic-intersection.stories-d9b48339.js","./elements-217018fd.js","./GridLayer-66718e35.js","./MainController-1e1a9474.js"],import.meta.url),"./.storybook/src/other-examples/index.stories.ts":async()=>r(()=>import("./index.stories-c8372e2e.js"),["./index.stories-c8372e2e.js","./basic-intersection.stories-d9b48339.js","./elements-217018fd.js","./GridLayer-66718e35.js","./MainController-1e1a9474.js"],import.meta.url)};async function R(i){return y[i]()}const{composeConfigs:P,PreviewWeb:h,ClientApi:v}=__STORYBOOK_MODULE_PREVIEW_API__,T=async(i=[])=>{const s=await Promise.all([i[0]??r(()=>import("./entry-preview-3b25e9d3.js"),[],import.meta.url)]);return P(s)};window.__STORYBOOK_PREVIEW__=window.__STORYBOOK_PREVIEW__||new h(R,T);window.__STORYBOOK_STORY_STORE__=window.__STORYBOOK_STORY_STORE__||window.__STORYBOOK_PREVIEW__.storyStore; diff --git a/storybook/master/assets/iframe-2e3441a7.js b/storybook/master/assets/iframe-2e3441a7.js deleted file mode 100644 index 1e57fb8d..00000000 --- a/storybook/master/assets/iframe-2e3441a7.js +++ /dev/null @@ -1 +0,0 @@ -import"../sb-preview/runtime.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const t of document.querySelectorAll('link[rel="modulepreload"]'))c(t);new MutationObserver(t=>{for(const e of t)if(e.type==="childList")for(const o of e.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&c(o)}).observe(document,{childList:!0,subtree:!0});function _(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),t.crossOrigin==="use-credentials"?e.credentials="include":t.crossOrigin==="anonymous"?e.credentials="omit":e.credentials="same-origin",e}function c(t){if(t.ep)return;t.ep=!0;const e=_(t);fetch(t.href,e)}})();const E="modulepreload",O=function(i,s){return new URL(i,s).href},m={},r=function(s,_,c){if(!_||_.length===0)return s();const t=document.getElementsByTagName("link");return Promise.all(_.map(e=>{if(e=O(e,c),e in m)return;m[e]=!0;const o=e.endsWith(".css"),d=o?'[rel="stylesheet"]':"";if(!!c)for(let a=t.length-1;a>=0;a--){const l=t[a];if(l.href===e&&(!o||l.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${e}"]${d}`))return;const n=document.createElement("link");if(n.rel=o?"stylesheet":E,o||(n.as="script",n.crossOrigin=""),n.href=e,document.head.appendChild(n),o)return new Promise((a,l)=>{n.addEventListener("load",a),n.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${e}`)))})})).then(()=>s()).catch(e=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=e,window.dispatchEvent(o),!o.defaultPrevented)throw e})},{createBrowserChannel:p}=__STORYBOOK_MODULE_CHANNELS__,{addons:f}=__STORYBOOK_MODULE_PREVIEW_API__,u=p({page:"preview"});f.setChannel(u);window.__STORYBOOK_ADDONS_CHANNEL__=u;window.CONFIG_TYPE==="DEVELOPMENT"&&(window.__STORYBOOK_SERVER_CHANNEL__=u);const y={"./.storybook/src/complete-example/index.stories.ts":async()=>r(()=>import("./index.stories-d76bb6d8.js"),["./index.stories-d76bb6d8.js","./intersection.stories-18a12c3b.js","./MainController-ae0d41fa.js","./elements-84f906e9.js","./GridLayer-416fefe9.js","./picks-4685a18c.js","./GeomodelLayerV2-032ec5d4.js","./findsample-cc6ecc23.js","./seismic-colormap-ee0d3420.js","./WellborePathLayer-4cd0b66f.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/complete-example/intersection.stories.ts":async()=>r(()=>import("./intersection.stories-18a12c3b.js"),["./intersection.stories-18a12c3b.js","./MainController-ae0d41fa.js","./elements-84f906e9.js","./GridLayer-416fefe9.js","./picks-4685a18c.js","./GeomodelLayerV2-032ec5d4.js","./findsample-cc6ecc23.js","./seismic-colormap-ee0d3420.js","./WellborePathLayer-4cd0b66f.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/axis.stories.ts":async()=>r(()=>import("./axis.stories-733cecb2.js"),["./axis.stories-733cecb2.js","./GridLayer-416fefe9.js","./elements-84f906e9.js","./MainController-ae0d41fa.js"],import.meta.url),"./.storybook/src/features/callout-layer.stories.ts":async()=>r(()=>import("./callout-layer.stories-0df518bf.js"),["./callout-layer.stories-0df518bf.js","./MainController-ae0d41fa.js","./elements-84f906e9.js","./GridLayer-416fefe9.js","./picks-4685a18c.js","./WellborePathLayer-4cd0b66f.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/geomodel-layer.stories.ts":async()=>r(()=>import("./geomodel-layer.stories-2e09c9c8.js"),["./geomodel-layer.stories-2e09c9c8.js","./MainController-ae0d41fa.js","./elements-84f906e9.js","./GridLayer-416fefe9.js","./GeomodelLayerV2-032ec5d4.js","./findsample-cc6ecc23.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/grid-layer.stories.ts":async()=>r(()=>import("./grid-layer.stories-de373241.js"),["./grid-layer.stories-de373241.js","./elements-84f906e9.js","./GridLayer-416fefe9.js","./MainController-ae0d41fa.js"],import.meta.url),"./.storybook/src/features/highlight.stories.ts":async()=>r(()=>import("./highlight.stories-7be4c1c1.js"),["./highlight.stories-7be4c1c1.js","./elements-84f906e9.js","./WellborePathLayer-4cd0b66f.js","./MainController-ae0d41fa.js","./GridLayer-416fefe9.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/index.stories.ts":async()=>r(()=>import("./index.stories-56f68182.js"),["./index.stories-56f68182.js","./axis.stories-733cecb2.js","./GridLayer-416fefe9.js","./elements-84f906e9.js","./MainController-ae0d41fa.js","./zoom.stories-5e6c73d2.js","./callout-layer.stories-0df518bf.js","./picks-4685a18c.js","./WellborePathLayer-4cd0b66f.js","./data-e45bb153.js","./grid-layer.stories-de373241.js","./seismic.stories-0ef4002e.js","./seismic-colormap-ee0d3420.js","./findsample-cc6ecc23.js","./highlight.stories-7be4c1c1.js","./wellborepath-layer.stories-a8a64590.js","./geomodel-layer.stories-2e09c9c8.js","./GeomodelLayerV2-032ec5d4.js","./schematic-layer.stories-6624709d.js"],import.meta.url),"./.storybook/src/features/schematic-layer.stories.ts":async()=>r(()=>import("./schematic-layer.stories-6624709d.js"),["./schematic-layer.stories-6624709d.js","./MainController-ae0d41fa.js","./elements-84f906e9.js","./GridLayer-416fefe9.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/seismic.stories.ts":async()=>r(()=>import("./seismic.stories-0ef4002e.js"),["./seismic.stories-0ef4002e.js","./elements-84f906e9.js","./seismic-colormap-ee0d3420.js","./findsample-cc6ecc23.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/wellborepath-layer.stories.ts":async()=>r(()=>import("./wellborepath-layer.stories-a8a64590.js"),["./wellborepath-layer.stories-a8a64590.js","./MainController-ae0d41fa.js","./elements-84f906e9.js","./GridLayer-416fefe9.js","./WellborePathLayer-4cd0b66f.js","./data-e45bb153.js"],import.meta.url),"./.storybook/src/features/zoom.stories.ts":async()=>r(()=>import("./zoom.stories-5e6c73d2.js"),["./zoom.stories-5e6c73d2.js","./GridLayer-416fefe9.js","./elements-84f906e9.js"],import.meta.url),"./.storybook/src/other-examples/basic-intersection.stories.ts":async()=>r(()=>import("./basic-intersection.stories-781b633f.js"),["./basic-intersection.stories-781b633f.js","./elements-84f906e9.js","./GridLayer-416fefe9.js","./MainController-ae0d41fa.js"],import.meta.url),"./.storybook/src/other-examples/index.stories.ts":async()=>r(()=>import("./index.stories-0b05fd63.js"),["./index.stories-0b05fd63.js","./basic-intersection.stories-781b633f.js","./elements-84f906e9.js","./GridLayer-416fefe9.js","./MainController-ae0d41fa.js"],import.meta.url)};async function R(i){return y[i]()}const{composeConfigs:P,PreviewWeb:h,ClientApi:v}=__STORYBOOK_MODULE_PREVIEW_API__,T=async(i=[])=>{const s=await Promise.all([i.at(0)??r(()=>import("./entry-preview-3b25e9d3.js"),[],import.meta.url)]);return P(s)};window.__STORYBOOK_PREVIEW__=window.__STORYBOOK_PREVIEW__||new h(R,T);window.__STORYBOOK_STORY_STORE__=window.__STORYBOOK_STORY_STORE__||window.__STORYBOOK_PREVIEW__.storyStore; diff --git a/storybook/master/assets/index.stories-0b05fd63.js b/storybook/master/assets/index.stories-0b05fd63.js deleted file mode 100644 index c7a94db2..00000000 --- a/storybook/master/assets/index.stories-0b05fd63.js +++ /dev/null @@ -1 +0,0 @@ -import{BasicSetup as m}from"./basic-intersection.stories-781b633f.js";import"./elements-84f906e9.js";import"./GridLayer-416fefe9.js";import"./MainController-ae0d41fa.js";const o={title:"Other examples"},p=[];export{m as BasicSetup,p as __namedExportsOrder,o as default}; diff --git a/storybook/master/assets/index.stories-56f68182.js b/storybook/master/assets/index.stories-2f6ae410.js similarity index 56% rename from storybook/master/assets/index.stories-56f68182.js rename to storybook/master/assets/index.stories-2f6ae410.js index 24f707bc..fdc44943 100644 --- a/storybook/master/assets/index.stories-56f68182.js +++ b/storybook/master/assets/index.stories-2f6ae410.js @@ -1 +1 @@ -import{AxisUsingHighLevelInterface as p,AxisUsingLowLevelInterface as h}from"./axis.stories-733cecb2.js";import{ZoomWithGridAndAxis as v,ZoomWithGridLayer as x,ZoomWithTestLayer as I}from"./zoom.stories-5e6c73d2.js";import{CalloutUsingHighLevelInterface as d,CalloutUsingLowLevelInterface as H}from"./callout-layer.stories-0df518bf.js";import{GridUsingHighLevelInterface as G,GridUsingLowLevelInterface as w}from"./grid-layer.stories-de373241.js";import{SeismicUsingLowLevelInterface as M}from"./seismic.stories-0ef4002e.js";import{HighlightWellborepath as A,HighlightWellborepathWithController as C}from"./highlight.stories-7be4c1c1.js";import{WellborepathUsingHighLevelInterface as Z,WellborepathUsingLowLevelInterface as _}from"./wellborepath-layer.stories-a8a64590.js";import{GeoModelCanvasUsingHighLevelInterface as E,GeoModelUsingHighLevelInterface as F,GeoModelUsingLowLevelInterface as O,GeoModelWithLabelsUsingHighLevelInterface as T,GeoModelWithLabelsUsingLowLevelInterface as j}from"./geomodel-layer.stories-2e09c9c8.js";import{SchematicLayerUsingHighLevelInterface as q}from"./schematic-layer.stories-6624709d.js";import"./GridLayer-416fefe9.js";import"./elements-84f906e9.js";import"./MainController-ae0d41fa.js";import"./picks-4685a18c.js";import"./WellborePathLayer-4cd0b66f.js";import"./data-e45bb153.js";import"./seismic-colormap-ee0d3420.js";import"./findsample-cc6ecc23.js";import"./GeomodelLayerV2-032ec5d4.js";const g={title:"Features"},L=[];export{p as AxisUsingHighLevelInterface,h as AxisUsingLowLevelInterface,d as CalloutUsingHighLevelInterface,H as CalloutUsingLowLevelInterface,E as GeoModelCanvasUsingHighLevelInterface,F as GeoModelUsingHighLevelInterface,O as GeoModelUsingLowLevelInterface,T as GeoModelWithLabelsUsingHighLevelInterface,j as GeoModelWithLabelsUsingLowLevelInterface,G as GridUsingHighLevelInterface,w as GridUsingLowLevelInterface,A as HighlightWellborepath,C as HighlightWellborepathWithController,q as SchematicLayerUsingHighLevelInterface,M as SeismicUsingLowLevelInterface,Z as WellborepathUsingHighLevelInterface,_ as WellborepathUsingLowLevelInterface,v as ZoomWithGridAndAxis,x as ZoomWithGridLayer,I as ZoomWithTestLayer,L as __namedExportsOrder,g as default}; +import{AxisUsingHighLevelInterface as p,AxisUsingLowLevelInterface as h}from"./axis.stories-a4be38eb.js";import{ZoomWithGridAndAxis as v,ZoomWithGridLayer as x,ZoomWithTestLayer as I}from"./zoom.stories-f007092c.js";import{CalloutUsingHighLevelInterface as d,CalloutUsingLowLevelInterface as H}from"./callout-layer.stories-9cb185f5.js";import{GridUsingHighLevelInterface as G,GridUsingLowLevelInterface as w}from"./grid-layer.stories-35e853d6.js";import{SeismicUsingLowLevelInterface as M}from"./seismic.stories-e3ed59c5.js";import{HighlightWellborepath as A,HighlightWellborepathWithController as C}from"./highlight.stories-ea01c9f0.js";import{WellborepathUsingHighLevelInterface as Z,WellborepathUsingLowLevelInterface as _}from"./wellborepath-layer.stories-52ba7562.js";import{GeoModelCanvasUsingHighLevelInterface as E,GeoModelUsingHighLevelInterface as F,GeoModelUsingLowLevelInterface as O,GeoModelWithLabelsUsingHighLevelInterface as T,GeoModelWithLabelsUsingLowLevelInterface as j}from"./geomodel-layer.stories-d4ee5bea.js";import{SchematicLayerUsingHighLevelInterface as q}from"./schematic-layer.stories-5b12023d.js";import"./GridLayer-66718e35.js";import"./elements-217018fd.js";import"./MainController-1e1a9474.js";import"./picks-2410da4c.js";import"./WellborePathLayer-11ff1510.js";import"./data-e45bb153.js";import"./seismic-colormap-ec670136.js";import"./findsample-cc6ecc23.js";import"./GeomodelLayerV2-4f8f3306.js";const g={title:"Features"},L=[];export{p as AxisUsingHighLevelInterface,h as AxisUsingLowLevelInterface,d as CalloutUsingHighLevelInterface,H as CalloutUsingLowLevelInterface,E as GeoModelCanvasUsingHighLevelInterface,F as GeoModelUsingHighLevelInterface,O as GeoModelUsingLowLevelInterface,T as GeoModelWithLabelsUsingHighLevelInterface,j as GeoModelWithLabelsUsingLowLevelInterface,G as GridUsingHighLevelInterface,w as GridUsingLowLevelInterface,A as HighlightWellborepath,C as HighlightWellborepathWithController,q as SchematicLayerUsingHighLevelInterface,M as SeismicUsingLowLevelInterface,Z as WellborepathUsingHighLevelInterface,_ as WellborepathUsingLowLevelInterface,v as ZoomWithGridAndAxis,x as ZoomWithGridLayer,I as ZoomWithTestLayer,L as __namedExportsOrder,g as default}; diff --git a/storybook/master/assets/index.stories-63507133.js b/storybook/master/assets/index.stories-63507133.js new file mode 100644 index 00000000..99ee5c4d --- /dev/null +++ b/storybook/master/assets/index.stories-63507133.js @@ -0,0 +1 @@ +import{intersection as d,intersectionFlipX as _}from"./intersection.stories-fb6bd89f.js";import"./MainController-1e1a9474.js";import"./elements-217018fd.js";import"./GridLayer-66718e35.js";import"./picks-2410da4c.js";import"./GeomodelLayerV2-4f8f3306.js";import"./findsample-cc6ecc23.js";import"./seismic-colormap-ec670136.js";import"./WellborePathLayer-11ff1510.js";import"./data-e45bb153.js";const l={title:"Complete example"},x=[];export{x as __namedExportsOrder,l as default,d as intersection,_ as intersectionFlipX}; diff --git a/storybook/master/assets/index.stories-c8372e2e.js b/storybook/master/assets/index.stories-c8372e2e.js new file mode 100644 index 00000000..96df9309 --- /dev/null +++ b/storybook/master/assets/index.stories-c8372e2e.js @@ -0,0 +1 @@ +import{BasicSetup as m}from"./basic-intersection.stories-d9b48339.js";import"./elements-217018fd.js";import"./GridLayer-66718e35.js";import"./MainController-1e1a9474.js";const o={title:"Other examples"},p=[];export{m as BasicSetup,p as __namedExportsOrder,o as default}; diff --git a/storybook/master/assets/index.stories-d76bb6d8.js b/storybook/master/assets/index.stories-d76bb6d8.js deleted file mode 100644 index 4e3f7e88..00000000 --- a/storybook/master/assets/index.stories-d76bb6d8.js +++ /dev/null @@ -1 +0,0 @@ -import{intersection as d,intersectionFlipX as _}from"./intersection.stories-18a12c3b.js";import"./MainController-ae0d41fa.js";import"./elements-84f906e9.js";import"./GridLayer-416fefe9.js";import"./picks-4685a18c.js";import"./GeomodelLayerV2-032ec5d4.js";import"./findsample-cc6ecc23.js";import"./seismic-colormap-ee0d3420.js";import"./WellborePathLayer-4cd0b66f.js";import"./data-e45bb153.js";const l={title:"Complete example"},x=[];export{x as __namedExportsOrder,l as default,d as intersection,_ as intersectionFlipX}; diff --git a/storybook/master/assets/intersection.stories-18a12c3b.js b/storybook/master/assets/intersection.stories-fb6bd89f.js similarity index 96% rename from storybook/master/assets/intersection.stories-18a12c3b.js rename to storybook/master/assets/intersection.stories-fb6bd89f.js index f61466a6..b232cb73 100644 --- a/storybook/master/assets/intersection.stories-18a12c3b.js +++ b/storybook/master/assets/intersection.stories-fb6bd89f.js @@ -1,4 +1,4 @@ -import{I as E,C as Ve}from"./MainController-ae0d41fa.js";import{C as Te,a as Ze,c as Re,b as x,d as Fe,g as Ee,P as H,S as He,e as Oe,f as g}from"./elements-84f906e9.js";import{c as Ue,t as Ye,g as Qe,C as Xe}from"./picks-4685a18c.js";import{G as Je,a as Ke}from"./GeomodelLayerV2-032ec5d4.js";import{G as $e}from"./GridLayer-416fefe9.js";import{g as qe,S as _e,a as et,b as tt,s as st}from"./seismic-colormap-ee0d3420.js";import{W as ot}from"./WellborePathLayer-4cd0b66f.js";import{g as nt,a as it,b as at,c as lt,d as rt,e as ct,f as dt,h as pt,i as mt,j as ht}from"./data-e45bb153.js";import"./findsample-cc6ecc23.js";const O=(a,e)=>{switch(e.lineType){case"wavy":return a.wavy(e);case"dashed":return a.dashed(e);case"solid":return a.solid(e);default:return Ze(e.lineType)}};class yt extends Te{constructor(){super(...arguments),this.yScale=null,this.xScale=null}onMount(e){super.onMount(e)}onUpdate(e){super.onUpdate(e),this.clearCanvas(),this.render()}onRescale(e){super.onRescale(e),this.yScale=e.yScale,this.xScale=e.xScale,this.resetTransform(),this.render()}drawDashed(e){var o;const{ctx:t}=this,{canvas:s}=this;if(t!=null&&s!=null){const n=(o=this.yScale)==null?void 0:o.call(this,e.depth);t.save(),t.strokeStyle=e.color,this.setCtxLineStyle(t,e),this.setCtxLineWidth(t,e),t.beginPath(),t.moveTo(0,n),t.lineTo(s.width,n),t.stroke(),t.restore(),e.text&&this.drawText(t,e,t.canvas.width,n)}}drawSolid(e){const{ctx:t}=this,{canvas:s}=this,o=this.yScale(e.depth);t!=null&&s!=null&&(t.save(),t.strokeStyle=e.color,this.setCtxLineStyle(t,e),this.setCtxLineWidth(t,e),t.beginPath(),t.moveTo(0,o),t.lineTo(s.width,o),t.stroke(),t.restore(),e.text&&this.drawText(t,e,t.canvas.width,o))}drawWavy(e){const{ctx:n,canvas:l}=this;if(this.xScale!=null&&this.yScale!=null&&l!=null&&n!=null){const r=Ue(4,2.5,500,this.yScale),d=r*2,p=this.yScale(e.depth)-r,C=Math.ceil(l.width/d)+1,M=this.xScale(0)%d;n.save(),n.strokeStyle=e.color,this.setCtxLineStyle(n,e),this.setCtxLineWidth(n,e);for(let I=-1;I{e.setLineDash([])},dashed:()=>{e.setLineDash([8,10])},wavy:()=>{e.setLineDash([])}},t)}setCtxLineWidth(e,t){e.lineWidth=t.lineWidth||1}render(){!this.ctx||!this.yScale||!this.xScale||requestAnimationFrame(()=>{var e;this.clearCanvas(),(e=this.data)==null||e.forEach(t=>{O({solid:s=>this.drawSolid(s),dashed:s=>this.drawDashed(s),wavy:s=>this.drawWavy(s)},t)})})}}const u=()=>$({xBounds:[0,1e3],yBounds:[0,1e3]}),S=()=>$({xBounds:[1e3,0],yBounds:[0,1e3]}),$=a=>{const e={xLabel:"Displacement",yLabel:"TVD MSL",unitOfMeasure:"m"},t=700,s=600,o=Re(t),n=x(t),l=x(t),r=x(t),d=x(t),p=Fe(t,s),C=[nt(),it(),at(),lt(),rt(),ct(),dt(),pt(),mt(),ht()];return Promise.all(C).then(M=>{var Z,R,F;const[I,q,k,A,D,_,ee,te,se,oe]=M,m=new E(I);m.offset=I[0][2];const ne=1e3/(m.displacement||1),ie=((F=(R=(Z=A[0])==null?void 0:Z.data)==null?void 0:R.values)==null?void 0:F.length)||1,P=m.getTrajectory(ie,0,1+ne),w=E.toDisplacement(P.points,P.offset),W=Ee(w,D,A),ae=qe(k,w),le=Ye(se,D),re=Qe(le),ce=new H({width:t,height:s}),de=new H({width:t,height:s}),f=new $e("grid",{majorColor:"black",minorColor:"gray",majorWidth:.5,minorWidth:.5,order:1,referenceSystem:m}),z=new Je(ce,"geomodel",{order:2,layerOpacity:.6,data:W}),B=new ot("wellborepath",{order:3,strokeWidth:"2px",stroke:"red",referenceSystem:m}),N=new Ke("geomodellabels",{order:3,data:W}),j=new _e("seismic",{order:1}),pe={completionSymbol1:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMCAwSDkwVjEwMEgxMFYwWiIgZmlsbD0iI0Q5RDlEOSIvPgo8cGF0aCBkPSJNMCAyNUgxMFY3NUgwVjI1WiIgZmlsbD0iI0I1QjJCMiIvPgo8cGF0aCBkPSJNNDUgMjVINTVWNzVINDVWMjVaIiBmaWxsPSIjQjVCMkIyIi8+CjxwYXRoIGQ9Ik05MCAyNUgxMDBWNzVIOTBWMjVaIiBmaWxsPSIjQjVCMkIyIi8+Cjwvc3ZnPgo=",completionSymbol2:"tubing1.svg",completionSymbol3:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMCAwSDkwVjEwMEgxMFYwWiIgZmlsbD0iI0Q5RDlEOSIvPgo8cGF0aCBkPSJNMCAyNUgxMFY3NUgwVjI1WiIgZmlsbD0iI0I1QjJCMiIvPgo8cGF0aCBkPSJNNDUgMjVINTVWNzVINDVWMjVaIiBmaWxsPSIjQjVCMkIyIi8+CjxwYXRoIGQ9Ik0yNSA2NUgzMFY4MEgyNVY2NVoiIGZpbGw9IiMzMTMxMzEiLz4KPHBhdGggZD0iTTI1IDQySDMwVjU3SDI1VjQyWiIgZmlsbD0iIzMxMzEzMSIvPgo8cGF0aCBkPSJNMjUgMjFIMzBWMzZIMjVWMjFaIiBmaWxsPSIjMzEzMTMxIi8+CjxwYXRoIGQ9Ik03MCA2NEg3NVY3OUg3MFY2NFoiIGZpbGw9IiMzMTMxMzEiLz4KPHBhdGggZD0iTTcwIDQxSDc1VjU2SDcwVjQxWiIgZmlsbD0iIzMxMzEzMSIvPgo8cGF0aCBkPSJNNzAgMjBINzVWMzVINzBWMjBaIiBmaWxsPSIjMzEzMTMxIi8+CjxwYXRoIGQ9Ik05MCAyNUgxMDBWNzVIOTBWMjVaIiBmaWxsPSIjQjVCMkIyIi8+Cjwvc3ZnPgo="},me=[{kind:"completionSymbol",id:"completion-svg-1",start:5250,end:5252,diameter:8.5,symbolKey:"completionSymbol1"},{kind:"completionSymbol",id:"completion-svg-2",start:5252,end:5274,diameter:8.5,symbolKey:"completionSymbol2"},{kind:"completionSymbol",id:"completion-svg-3",start:5274,end:5276,diameter:8.5,symbolKey:"completionSymbol3"}],he={mechanicalPlug:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxSDk5Vjk5SDFWMVoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl81MF81KSIvPgo8cGF0aCBkPSJNMSAxSDk5Vjk5SDFWMVoiIGZpbGw9InVybCgjcGFpbnQxX2xpbmVhcl81MF81KSIgZmlsbC1vcGFjaXR5PSIwLjIiLz4KPHBhdGggZD0iTTEgMUg5OVY5OUgxVjFaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiLz4KPGxpbmUgeDE9IjEuNzEwNzIiIHkxPSIxLjI5NjUzIiB4Mj0iOTguNzEwNyIgeTI9Ijk5LjI5NjUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIvPgo8bGluZSB4MT0iOTguNzA3MSIgeTE9IjAuNzA3MTA3IiB4Mj0iMC43MDcxIiB5Mj0iOTguNzA3MSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfNTBfNSIgeDE9IjAiIHkxPSI1MCIgeDI9IjUwIiB5Mj0iNTAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0NDMjYyNiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjQ3MUEiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDFfbGluZWFyXzUwXzUiIHgxPSI1MCIgeTE9IjUwIiB4Mj0iMTAwIiB5Mj0iNTAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGNDcxQSIvPgo8c3RvcCBvZmZzZXQ9IjAuOTk5OSIgc3RvcC1jb2xvcj0iI0NDMjYyNiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjQ3MUEiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K"},ye=[{kind:"pAndASymbol",id:"mechanical-plug-1",start:5100,end:5110,diameter:8.5,symbolKey:"mechanicalPlug"},{kind:"cementPlug",id:"cement-plug-2",start:5e3,end:5110,referenceIds:["casing-07"]}],Ie=[{kind:"perforation",subKind:"Perforation",id:"PerforationDemo1",start:4e3,end:4500,isOpen:!0},{kind:"perforation",subKind:"Cased hole frac pack",id:"PerforationDemo2",start:3500,end:4500,isOpen:!0}],ge={holeSizes:ee,cements:te,casings:_,completion:[...q,...me],pAndA:[...ye,...oe],perforations:Ie,symbols:{...pe,...he}},y={holeLayerId:"hole-id",casingLayerId:"casing-id",completionLayerId:"completion-id",cementLayerId:"cement-id",pAndALayerId:"pAndA-id",perforationLayerId:"perforation-id"},be={order:5,referenceSystem:m,internalLayerOptions:y,data:ge},G=new He(de,"schematic-webgl-layer",be),ue=[{text:"RKB",lineType:"dashed",color:"black",depth:0},{text:"MSL",lineType:"wavy",color:"blue",depth:30},{text:"Seabed",lineType:"solid",color:"slategray",depth:91.1,lineWidth:2}],V=new yt("sea-and-rkb-layer",{data:ue}),T=new Xe("callout",{order:100,data:re,referenceSystem:m}),xe=[f,z,B,N,j,G,V,T],Se={scaleOptions:a,axisOptions:e,container:p,referenceSystem:m},i=new Ve({layers:xe,...Se});It(i);const Ce=et(ae);tt(k,w,st).then(c=>{j.setData({image:c,options:Ce})}),i.adjustToSize(t,s),i.setViewport(1e3,1500,5e3),i.zoomPanHandler.zFactor=1;const Me=Oe(),we=h(i,f,"Grid"),je=h(i,B,"Wellbore"),Le=h(i,z,"Geo model"),ve=h(i,G,"Schematic"),ke=h(i,V,"SeaAndRKB"),Ae=h(i,N,"Geo model labels"),De=h(i,j,"Seismic"),Pe=h(i,T,"Picks"),We=[["Holes",y.holeLayerId],["Casings",y.casingLayerId],["Cement",y.cementLayerId],["Completion",y.completionLayerId],["Plug & Abandonment",y.pAndALayerId],["Perforations",y.perforationLayerId]].map(([c,v])=>gt(i,v,c));let L=!0;const fe=b("Axis labels",c=>{L?(i.hideAxisLabels(),c.style.backgroundColor="red",c.style.color="white",L=!1):(i.showAxisLabels(),L=!0,c.style.backgroundColor="lightblue",c.style.color="")},"background: lightblue;"),ze=b("800x600",()=>{p.setAttribute("style","height: 600px; width: 800px;background-color: #eee;"),o.style.width="800px",l.style.width="800px",n.style.width="800px",i.adjustToSize(800,600)}),Be=b("600x400",()=>{p.setAttribute("style","height: 400px; width: 600px;background-color: #eee;"),o.style.width="600px",l.style.width="600px",n.style.width="600px",i.adjustToSize(600,400)}),Ne=b("Default",()=>{p.setAttribute("style",`height: ${s}px; width: ${t}px;background-color: #eee;`),o.style.width=`${t}px`,l.style.width=`${t}px`,n.style.width=`${t}px`,i.adjustToSize(t,s)}),Ge=b("Clear everything",()=>{i.clearAllData()});n.appendChild(we),n.appendChild(je),n.appendChild(Le),n.appendChild(Ae),n.appendChild(De),n.appendChild(ve),n.appendChild(ke),n.appendChild(Pe),n.appendChild(fe),l.appendChild(ze),l.appendChild(Be),l.appendChild(Ne),d.appendChild(Ge),We.forEach(c=>r.appendChild(c)),o.appendChild(g("A complete example of multiple layers comprised of SVG, Canvas, HTML and pixi.js (WebGL). We use a controller to update and display each layer in a container (just a plain div element) on top of each other.")),o.appendChild(p),o.appendChild(g("Toggle")),o.appendChild(n),o.appendChild(g("Schematic toggle")),o.appendChild(r),o.appendChild(g("Adjust size")),o.appendChild(l),o.appendChild(g("Miscellaneous")),o.appendChild(d),o.appendChild(Me)}),o};function It(a){const e=a.overlay.create("md",{onMouseMove:t=>{const{target:s,caller:o,x:n}=t,l=o.currentStateAsEvent.xScale.invert(n),{referenceSystem:r}=o,d=r.unproject(l);s.textContent=Number.isFinite(d)?`MD: ${d.toFixed(1)}`:"-",d<0||r.length{t.target.style.visibility="hidden"}});e.style.visibility="hidden",e.style.display="inline-block",e.style.padding="2px",e.style.borderRadius="4px",e.style.textAlign="right",e.style.position="absolute",e.style.backgroundColor="rgba(0,0,0,0.5)",e.style.color="white",e.style.right="5px",e.style.bottom="5px",e.style.zIndex="100"}const h=(a,e,t)=>{const s=document.createElement("button");s.innerHTML=`${t}`,s.setAttribute("style","width: 170px;height:32px;margin-top:12px;background: lightblue;");let o=!1;return s.onclick=()=>{o?(a.showLayer(e.id),s.style.backgroundColor="lightblue",s.style.color=""):(a.hideLayer(e.id),s.style.backgroundColor="red",s.style.color="white"),o=!o},s},gt=(a,e,t)=>{const s=document.createElement("button");s.innerHTML=`${t}`,s.setAttribute("style","width: 170px;height:32px;margin-top:12px;background: lightblue;");let o=!1;return s.onclick=()=>{o?(a.showLayer(e),s.style.backgroundColor="lightblue",s.style.color=""):(a.hideLayer(e),s.style.backgroundColor="red",s.style.color="white"),o=!o},s};function b(a,e,t=""){const s=document.createElement("button");return s.innerHTML=a,s.setAttribute("style",`${t}width: 170px;height:32px;margin-top:12px;`),s.onclick=()=>e(s),s}const kt={title:"ESV Intersection/Complete example",component:u};var U,Y,Q;u.parameters={...u.parameters,docs:{...(U=u.parameters)==null?void 0:U.docs,source:{originalSource:`() => { +import{I as E,C as Ve}from"./MainController-1e1a9474.js";import{C as Te,a as Ze,c as Re,b as x,d as Fe,g as Ee,P as H,S as He,e as Oe,f as g}from"./elements-217018fd.js";import{c as Ue,t as Ye,g as Qe,C as Xe}from"./picks-2410da4c.js";import{G as Je,a as Ke}from"./GeomodelLayerV2-4f8f3306.js";import{G as $e}from"./GridLayer-66718e35.js";import{g as qe,S as _e,a as et,b as tt,s as st}from"./seismic-colormap-ec670136.js";import{W as ot}from"./WellborePathLayer-11ff1510.js";import{g as nt,a as it,b as at,c as lt,d as rt,e as ct,f as dt,h as pt,i as mt,j as ht}from"./data-e45bb153.js";import"./findsample-cc6ecc23.js";const O=(a,e)=>{switch(e.lineType){case"wavy":return a.wavy(e);case"dashed":return a.dashed(e);case"solid":return a.solid(e);default:return Ze(e.lineType)}};class yt extends Te{constructor(){super(...arguments),this.yScale=null,this.xScale=null}onMount(e){super.onMount(e)}onUpdate(e){super.onUpdate(e),this.clearCanvas(),this.render()}onRescale(e){super.onRescale(e),this.yScale=e.yScale,this.xScale=e.xScale,this.resetTransform(),this.render()}drawDashed(e){var o;const{ctx:t}=this,{canvas:s}=this;if(t!=null&&s!=null){const n=(o=this.yScale)==null?void 0:o.call(this,e.depth);t.save(),t.strokeStyle=e.color,this.setCtxLineStyle(t,e),this.setCtxLineWidth(t,e),t.beginPath(),t.moveTo(0,n),t.lineTo(s.width,n),t.stroke(),t.restore(),e.text&&this.drawText(t,e,t.canvas.width,n)}}drawSolid(e){const{ctx:t}=this,{canvas:s}=this,o=this.yScale(e.depth);t!=null&&s!=null&&(t.save(),t.strokeStyle=e.color,this.setCtxLineStyle(t,e),this.setCtxLineWidth(t,e),t.beginPath(),t.moveTo(0,o),t.lineTo(s.width,o),t.stroke(),t.restore(),e.text&&this.drawText(t,e,t.canvas.width,o))}drawWavy(e){const{ctx:n,canvas:l}=this;if(this.xScale!=null&&this.yScale!=null&&l!=null&&n!=null){const r=Ue(4,2.5,500,this.yScale),d=r*2,p=this.yScale(e.depth)-r,C=Math.ceil(l.width/d)+1,M=this.xScale(0)%d;n.save(),n.strokeStyle=e.color,this.setCtxLineStyle(n,e),this.setCtxLineWidth(n,e);for(let I=-1;I{e.setLineDash([])},dashed:()=>{e.setLineDash([8,10])},wavy:()=>{e.setLineDash([])}},t)}setCtxLineWidth(e,t){e.lineWidth=t.lineWidth||1}render(){!this.ctx||!this.yScale||!this.xScale||requestAnimationFrame(()=>{var e;this.clearCanvas(),(e=this.data)==null||e.forEach(t=>{O({solid:s=>this.drawSolid(s),dashed:s=>this.drawDashed(s),wavy:s=>this.drawWavy(s)},t)})})}}const u=()=>$({xBounds:[0,1e3],yBounds:[0,1e3]}),S=()=>$({xBounds:[1e3,0],yBounds:[0,1e3]}),$=a=>{const e={xLabel:"Displacement",yLabel:"TVD MSL",unitOfMeasure:"m"},t=700,s=600,o=Re(t),n=x(t),l=x(t),r=x(t),d=x(t),p=Fe(t,s),C=[nt(),it(),at(),lt(),rt(),ct(),dt(),pt(),mt(),ht()];return Promise.all(C).then(M=>{var Z,R,F;const[I,q,k,A,D,_,ee,te,se,oe]=M,m=new E(I);m.offset=I[0][2];const ne=1e3/(m.displacement||1),ie=((F=(R=(Z=A[0])==null?void 0:Z.data)==null?void 0:R.values)==null?void 0:F.length)||1,P=m.getTrajectory(ie,0,1+ne),w=E.toDisplacement(P.points,P.offset),W=Ee(w,D,A),ae=qe(k,w),le=Ye(se,D),re=Qe(le),ce=new H({width:t,height:s}),de=new H({width:t,height:s}),f=new $e("grid",{majorColor:"black",minorColor:"gray",majorWidth:.5,minorWidth:.5,order:1,referenceSystem:m}),z=new Je(ce,"geomodel",{order:2,layerOpacity:.6,data:W}),B=new ot("wellborepath",{order:3,strokeWidth:"2px",stroke:"red",referenceSystem:m}),N=new Ke("geomodellabels",{order:3,data:W}),j=new _e("seismic",{order:1}),pe={completionSymbol1:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMCAwSDkwVjEwMEgxMFYwWiIgZmlsbD0iI0Q5RDlEOSIvPgo8cGF0aCBkPSJNMCAyNUgxMFY3NUgwVjI1WiIgZmlsbD0iI0I1QjJCMiIvPgo8cGF0aCBkPSJNNDUgMjVINTVWNzVINDVWMjVaIiBmaWxsPSIjQjVCMkIyIi8+CjxwYXRoIGQ9Ik05MCAyNUgxMDBWNzVIOTBWMjVaIiBmaWxsPSIjQjVCMkIyIi8+Cjwvc3ZnPgo=",completionSymbol2:"tubing1.svg",completionSymbol3:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMCAwSDkwVjEwMEgxMFYwWiIgZmlsbD0iI0Q5RDlEOSIvPgo8cGF0aCBkPSJNMCAyNUgxMFY3NUgwVjI1WiIgZmlsbD0iI0I1QjJCMiIvPgo8cGF0aCBkPSJNNDUgMjVINTVWNzVINDVWMjVaIiBmaWxsPSIjQjVCMkIyIi8+CjxwYXRoIGQ9Ik0yNSA2NUgzMFY4MEgyNVY2NVoiIGZpbGw9IiMzMTMxMzEiLz4KPHBhdGggZD0iTTI1IDQySDMwVjU3SDI1VjQyWiIgZmlsbD0iIzMxMzEzMSIvPgo8cGF0aCBkPSJNMjUgMjFIMzBWMzZIMjVWMjFaIiBmaWxsPSIjMzEzMTMxIi8+CjxwYXRoIGQ9Ik03MCA2NEg3NVY3OUg3MFY2NFoiIGZpbGw9IiMzMTMxMzEiLz4KPHBhdGggZD0iTTcwIDQxSDc1VjU2SDcwVjQxWiIgZmlsbD0iIzMxMzEzMSIvPgo8cGF0aCBkPSJNNzAgMjBINzVWMzVINzBWMjBaIiBmaWxsPSIjMzEzMTMxIi8+CjxwYXRoIGQ9Ik05MCAyNUgxMDBWNzVIOTBWMjVaIiBmaWxsPSIjQjVCMkIyIi8+Cjwvc3ZnPgo="},me=[{kind:"completionSymbol",id:"completion-svg-1",start:5250,end:5252,diameter:8.5,symbolKey:"completionSymbol1"},{kind:"completionSymbol",id:"completion-svg-2",start:5252,end:5274,diameter:8.5,symbolKey:"completionSymbol2"},{kind:"completionSymbol",id:"completion-svg-3",start:5274,end:5276,diameter:8.5,symbolKey:"completionSymbol3"}],he={mechanicalPlug:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxSDk5Vjk5SDFWMVoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl81MF81KSIvPgo8cGF0aCBkPSJNMSAxSDk5Vjk5SDFWMVoiIGZpbGw9InVybCgjcGFpbnQxX2xpbmVhcl81MF81KSIgZmlsbC1vcGFjaXR5PSIwLjIiLz4KPHBhdGggZD0iTTEgMUg5OVY5OUgxVjFaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiLz4KPGxpbmUgeDE9IjEuNzEwNzIiIHkxPSIxLjI5NjUzIiB4Mj0iOTguNzEwNyIgeTI9Ijk5LjI5NjUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIvPgo8bGluZSB4MT0iOTguNzA3MSIgeTE9IjAuNzA3MTA3IiB4Mj0iMC43MDcxIiB5Mj0iOTguNzA3MSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfNTBfNSIgeDE9IjAiIHkxPSI1MCIgeDI9IjUwIiB5Mj0iNTAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0NDMjYyNiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjQ3MUEiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDFfbGluZWFyXzUwXzUiIHgxPSI1MCIgeTE9IjUwIiB4Mj0iMTAwIiB5Mj0iNTAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGNDcxQSIvPgo8c3RvcCBvZmZzZXQ9IjAuOTk5OSIgc3RvcC1jb2xvcj0iI0NDMjYyNiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjQ3MUEiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K"},ye=[{kind:"pAndASymbol",id:"mechanical-plug-1",start:5100,end:5110,diameter:8.5,symbolKey:"mechanicalPlug"},{kind:"cementPlug",id:"cement-plug-2",start:5e3,end:5110,referenceIds:["casing-07"]}],Ie=[{kind:"perforation",subKind:"Perforation",id:"PerforationDemo1",start:4e3,end:4500,isOpen:!0},{kind:"perforation",subKind:"Cased hole frac pack",id:"PerforationDemo2",start:3500,end:4500,isOpen:!0}],ge={holeSizes:ee,cements:te,casings:_,completion:[...q,...me],pAndA:[...ye,...oe],perforations:Ie,symbols:{...pe,...he}},y={holeLayerId:"hole-id",casingLayerId:"casing-id",completionLayerId:"completion-id",cementLayerId:"cement-id",pAndALayerId:"pAndA-id",perforationLayerId:"perforation-id"},be={order:5,referenceSystem:m,internalLayerOptions:y,data:ge},G=new He(de,"schematic-webgl-layer",be),ue=[{text:"RKB",lineType:"dashed",color:"black",depth:0},{text:"MSL",lineType:"wavy",color:"blue",depth:30},{text:"Seabed",lineType:"solid",color:"slategray",depth:91.1,lineWidth:2}],V=new yt("sea-and-rkb-layer",{data:ue}),T=new Xe("callout",{order:100,data:re,referenceSystem:m}),xe=[f,z,B,N,j,G,V,T],Se={scaleOptions:a,axisOptions:e,container:p,referenceSystem:m},i=new Ve({layers:xe,...Se});It(i);const Ce=et(ae);tt(k,w,st).then(c=>{j.setData({image:c,options:Ce})}),i.adjustToSize(t,s),i.setViewport(1e3,1500,5e3),i.zoomPanHandler.zFactor=1;const Me=Oe(),we=h(i,f,"Grid"),je=h(i,B,"Wellbore"),Le=h(i,z,"Geo model"),ve=h(i,G,"Schematic"),ke=h(i,V,"SeaAndRKB"),Ae=h(i,N,"Geo model labels"),De=h(i,j,"Seismic"),Pe=h(i,T,"Picks"),We=[["Holes",y.holeLayerId],["Casings",y.casingLayerId],["Cement",y.cementLayerId],["Completion",y.completionLayerId],["Plug & Abandonment",y.pAndALayerId],["Perforations",y.perforationLayerId]].map(([c,v])=>gt(i,v,c));let L=!0;const fe=b("Axis labels",c=>{L?(i.hideAxisLabels(),c.style.backgroundColor="red",c.style.color="white",L=!1):(i.showAxisLabels(),L=!0,c.style.backgroundColor="lightblue",c.style.color="")},"background: lightblue;"),ze=b("800x600",()=>{p.setAttribute("style","height: 600px; width: 800px;background-color: #eee;"),o.style.width="800px",l.style.width="800px",n.style.width="800px",i.adjustToSize(800,600)}),Be=b("600x400",()=>{p.setAttribute("style","height: 400px; width: 600px;background-color: #eee;"),o.style.width="600px",l.style.width="600px",n.style.width="600px",i.adjustToSize(600,400)}),Ne=b("Default",()=>{p.setAttribute("style",`height: ${s}px; width: ${t}px;background-color: #eee;`),o.style.width=`${t}px`,l.style.width=`${t}px`,n.style.width=`${t}px`,i.adjustToSize(t,s)}),Ge=b("Clear everything",()=>{i.clearAllData()});n.appendChild(we),n.appendChild(je),n.appendChild(Le),n.appendChild(Ae),n.appendChild(De),n.appendChild(ve),n.appendChild(ke),n.appendChild(Pe),n.appendChild(fe),l.appendChild(ze),l.appendChild(Be),l.appendChild(Ne),d.appendChild(Ge),We.forEach(c=>r.appendChild(c)),o.appendChild(g("A complete example of multiple layers comprised of SVG, Canvas, HTML and pixi.js (WebGL). We use a controller to update and display each layer in a container (just a plain div element) on top of each other.")),o.appendChild(p),o.appendChild(g("Toggle")),o.appendChild(n),o.appendChild(g("Schematic toggle")),o.appendChild(r),o.appendChild(g("Adjust size")),o.appendChild(l),o.appendChild(g("Miscellaneous")),o.appendChild(d),o.appendChild(Me)}),o};function It(a){const e=a.overlay.create("md",{onMouseMove:t=>{const{target:s,caller:o,x:n}=t,l=o.currentStateAsEvent.xScale.invert(n),{referenceSystem:r}=o,d=r.unproject(l);s.textContent=Number.isFinite(d)?`MD: ${d.toFixed(1)}`:"-",d<0||r.length{t.target.style.visibility="hidden"}});e.style.visibility="hidden",e.style.display="inline-block",e.style.padding="2px",e.style.borderRadius="4px",e.style.textAlign="right",e.style.position="absolute",e.style.backgroundColor="rgba(0,0,0,0.5)",e.style.color="white",e.style.right="5px",e.style.bottom="5px",e.style.zIndex="100"}const h=(a,e,t)=>{const s=document.createElement("button");s.innerHTML=`${t}`,s.setAttribute("style","width: 170px;height:32px;margin-top:12px;background: lightblue;");let o=!1;return s.onclick=()=>{o?(a.showLayer(e.id),s.style.backgroundColor="lightblue",s.style.color=""):(a.hideLayer(e.id),s.style.backgroundColor="red",s.style.color="white"),o=!o},s},gt=(a,e,t)=>{const s=document.createElement("button");s.innerHTML=`${t}`,s.setAttribute("style","width: 170px;height:32px;margin-top:12px;background: lightblue;");let o=!1;return s.onclick=()=>{o?(a.showLayer(e),s.style.backgroundColor="lightblue",s.style.color=""):(a.hideLayer(e),s.style.backgroundColor="red",s.style.color="white"),o=!o},s};function b(a,e,t=""){const s=document.createElement("button");return s.innerHTML=a,s.setAttribute("style",`${t}width: 170px;height:32px;margin-top:12px;`),s.onclick=()=>e(s),s}const kt={title:"ESV Intersection/Complete example",component:u};var U,Y,Q;u.parameters={...u.parameters,docs:{...(U=u.parameters)==null?void 0:U.docs,source:{originalSource:`() => { const xBounds: [number, number] = [0, 1000]; const yBounds: [number, number] = [0, 1000]; const scaleOptions = { diff --git a/storybook/master/assets/picks-4685a18c.js b/storybook/master/assets/picks-2410da4c.js similarity index 99% rename from storybook/master/assets/picks-4685a18c.js rename to storybook/master/assets/picks-2410da4c.js index 5b42c84a..4208d6f6 100644 --- a/storybook/master/assets/picks-4685a18c.js +++ b/storybook/master/assets/picks-2410da4c.js @@ -1 +1 @@ -import{h as F,C as v}from"./elements-84f906e9.js";const p=4,E=2;function A(o){const[e]=o.domain();return Math.abs(o(e+1))}function T(o,e,t,r){return F(A(r)*o,e,t)}function P(o,e,t=p,r=E){const i=o.x+o.width+t,n=e.x+e.width+t,s=o.y+o.height+r,l=e.y+e.height+r;return!(e.x-t>i||e.y-r>s||n+ti||e.y-r>s||n+t{this.renderText(r,n,s-l,l,c,"arial","bold"),this.renderText(i,n,s,l,c)},this.renderLine=(r,i,n,s,l,c,a=!0)=>{const{ctx:f}=this,d=a?r:r+n,h=a?r+n:r,u=i+2;f!=null&&(f.strokeStyle=c,f.lineWidth=1,f.beginPath(),f.moveTo(s,l),f.lineTo(d,u),f.lineTo(h,u),f.stroke())},this.minFontSize=(t==null?void 0:t.minFontSize)||B,this.maxFontSize=(t==null?void 0:t.maxFontSize)||C,this.fontSizeFactor=(t==null?void 0:t.fontSizeFactor)||S,this.offsetMin=(t==null?void 0:t.offsetMin)||U,this.offsetMax=(t==null?void 0:t.offsetMax)||w,this.offsetFactor=(t==null?void 0:t.offsetFactor)||R,this.fontColor=t==null?void 0:t.fontColor,t!=null&&t.backgroundColor?(this.backgroundActive=!0,this.backgroundColor=t.backgroundColor):(this.backgroundActive=!1,this.backgroundColor=_),this.backgroundPadding=(t==null?void 0:t.backgroundPadding)||D,this.backgroundBorderRadius=O(t==null?void 0:t.backgroundBorderRadius,$)}setGroupFilter(e){this.groupFilter=e,this.callouts=[],this.render()}onUpdate(e){super.onUpdate(e),this.callouts=[],this.render()}onRescale(e){super.onRescale(e);const t=this.rescaleEvent&&this.rescaleEvent.xRatio===e.xRatio;this.rescaleEvent=e,this.render(t)}render(e=!1){requestAnimationFrame(()=>{if(this.clearCanvas(),!this.data||!this.rescaleEvent||!this.referenceSystem)return;const{xScale:t,yScale:r,xBounds:i}=this.rescaleEvent,n=T(this.fontSizeFactor,this.minFontSize,this.maxFontSize,t);if(!e||this.callouts.length<=0){const{data:s,ctx:l,groupFilter:c}=this,{calculateDisplacementFromBottom:a}=this.referenceSystem.options,f=a?i[0]i[1],d=0;l!=null&&(l.font=`bold ${n}px arial`);const h=s.filter(m=>c.length<=0||c.includes(m.group)),u=T(this.offsetFactor,this.offsetMin,this.offsetMax,t);this.callouts=this.positionCallouts(h,f,t,r,d,n,u)}this.callouts.forEach(s=>{const{pos:l,title:c,color:a}=s,f=t(l.x),d=r(l.y),h={x:f,y:d,width:s.boundingBox.width,height:n,offsetX:s.dx,offsetY:s.dy};this.renderCallout(c,s.label,h,a,s.alignment)})})}renderBackground(e,t,r,i,n){const{ctx:s}=this;if(s==null)return;const l=this.backgroundPadding,c=this.backgroundBorderRadius,a=this.measureTextWidth(e,n,"arial","bold"),f=this.measureTextWidth(t,n),d=Math.max(a,f)+l*2,h=(n+l)*2,u=r-l,m=i-2*n-l;if(s.fillStyle=this.backgroundColor,c>0){const x=u+d,b=m+h;s.beginPath(),s.moveTo(u+c,m),s.lineTo(x-c,m),s.quadraticCurveTo(x,m,x,m+c),s.lineTo(x,b-c),s.quadraticCurveTo(x,b,x-c,b),s.lineTo(u+c,b),s.quadraticCurveTo(u,b,u,b-c),s.lineTo(u,m+c),s.quadraticCurveTo(u,m,u+c,m),s.fill()}else s.fillRect(u,m,d,h)}renderText(e,t,r,i,n,s="arial",l="normal"){const{ctx:c}=this;c!=null&&(c.font=`${l} ${i}px ${s}`,c.fillStyle=this.fontColor||n,c.fillText(e,t,r))}measureTextWidth(e,t,r="arial",i="normal"){const{ctx:n}=this;return n==null?0:(n.font=`${i} ${t}px ${r}`,n.measureText(e).width)}renderPoint(e,t,r,i=3){const{ctx:n}=this;n!=null&&(n.fillStyle=r,n.beginPath(),n.moveTo(e,t),n.arc(e,t,i,0,Math.PI*2),n.fill())}renderCallout(e,t,r,i,n){const s=this.getPosition(r,n),{x:l,y:c}=s,{height:a,width:f,x:d,y:h}=r,u=n===g.topright||n===g.bottomright;this.backgroundActive&&this.renderBackground(e,t,l,c,a),this.renderAnnotation(e,t,l,c,a,i),this.renderPoint(d,h,i),this.renderLine(l,c,f,d,h,i,u)}getPosition(e,t){const{x:r,y:i,offsetX:n=0,offsetY:s=0,width:l}=e;switch(t){case g.topleft:return{x:r-l-n,y:i-s};case g.topright:return{x:r+n,y:i-s};case g.bottomleft:return{x:r-l-n,y:i+s};case g.bottomright:return{x:r+n,y:i+s};default:return{x:r,y:i}}}positionCallouts(e,t,r,i,n,s,l=20){if(e.length===0)return[];const c=t?g.topleft:g.topright,a=e.map(h=>{var m;const u=h.pos?h.pos:(m=this.referenceSystem)==null?void 0:m.project(h.md);return{title:h.title,label:h.label,color:h.color,pos:{x:u==null?void 0:u[0],y:u==null?void 0:u[1]},group:h.group,alignment:c,boundingBox:this.getAnnotationBoundingBox(h.title,h.label,u,r,i,s),dx:l,dy:l}}),f=[a[a.length-1]],d=[];return this.chooseTopOrBottomPosition(a,d,f),this.adjustTopPositions(f),this.adjustBottomPositions(d),a}getAnnotationBoundingBox(e,t,r,i,n,s){const{ctx:l}=this,c=i(r[0]),a=n(r[1]),f=(l==null?void 0:l.measureText(t).width)??0,d=(l==null?void 0:l.measureText(e).width)??0,h=Math.max(f,d);return{x:c,y:a,width:h,height:s*2+4}}chooseTopOrBottomPosition(e,t,r){for(let i=e.length-2;i>=0;--i){const n=e[i],s=r[0];P(n.boundingBox,s.boundingBox)?(n.alignment=n.alignment===g.topleft?g.bottomright:g.bottomleft,t.push(n),i>0&&r.unshift(e[--i])):r.unshift(n)}}adjustTopPositions(e){for(let t=e.length-2;t>=0;--t){const r=e[t];for(let i=e.length-1;i>t;--i){const n=e[i],s=k(r.boundingBox,n.boundingBox);s&&(r.dy+=s.dy,r.boundingBox.y-=s.dy)}}}adjustBottomPositions(e){for(let t=e.length-2;t>=0;--t){const r=e[t];for(let i=e.length-1;i>t;--i){const n=e[i],s=k(n.boundingBox,r.boundingBox);s&&(r.dy+=s.dy,r.boundingBox.y+=s.dy)}}}}const y=(o,e)=>({title:o.pickIdentifier||o.identifier,group:e,label:`${o.md} ${o.mdUnit} ${o.depthReferencePoint}`,color:e==="strat-picks"?"#227":"rgba(0,0,0,0.8)",md:o.md});function M(o){return o?o.map(e=>y(e,"ref-picks")):[]}function L(o){return o?o.filter(e=>e.entryPick.md===e.from).map(e=>y(e.entryPick,"strat-picks")):[]}function N(o){return o?o.filter(e=>o.findIndex(t=>Math.abs(t.entryPick.md-e.exitPick.md)<.5)===-1).map(e=>y(e.exitPick,"strat-picks")).filter((e,t,r)=>t===r.findIndex(i=>i.title===e.title&&i.md===e.md)):[]}const Z=o=>[...M(o.nonUnitPicks),...L(o.unitPicks),...N(o.unitPicks)].sort((e,t)=>e.md-t.md),I=o=>({unitName:o.identifier,topSurface:o.top,baseSurface:o.base,ageBase:o.baseAge,ageTop:o.topAge,color:{r:o.colorR===null?255:o.colorR,g:o.colorG===null?255:o.colorG,b:o.colorB===null?255:o.colorB},level:o.stratUnitLevel,lithType:o.lithologyType,parent:o.stratUnitParent});function G(o,e,t){if(t.length===0)return[[o,e]];const r=[];let i=o,n=0;for(;ii&&r.push([i,Math.min(s.from,e)]),i=Math.min(e,Math.max(o,s.to)),n+=1}return io.map(I);function j(o,e){const t=W(e),r=[],i=[];return o.forEach(n=>{const s=t.filter(l=>{var c;return((c=n.pickIdentifier)==null?void 0:c.search(new RegExp(`(${l.topSurface}|${l.baseSurface})`,"i")))!==-1});s.length>0?s.forEach(l=>i.push({md:n.md,tvd:n.tvd,identifier:n.pickIdentifier,confidence:n.confidence,mdUnit:n.mdUnit,depthReferencePoint:n.depthReferencePoint,...l})):r.push({identifier:n.pickIdentifier,...n})}),{joined:i,nonUnitPicks:r}}function X(o){const e=[];let t=null;const r=o.filter(i=>i.level).sort((i,n)=>i.unitName.localeCompare(n.unitName)||i.md-n.md||i.ageTop-n.ageTop);for(;r.length>0;){t=r.shift();const i=t.identifier;let n;const s=i===t.topSurface,l=i===t.baseSurface;if(s)n=t.baseSurface;else if(l)n=t.topSurface;else{console.warn(`Unable to match ${i} with top or base surface, ignored`);continue}let c,a;const f=r.find(d=>d.identifier===n);if(f)c=s?t:f,a=s?f:t,c.md>a.md&&([c,a]=[a,c]),r.splice(r.indexOf(f),1);else if(console.warn(`Unable to find ${n} pick for ${i}`),s)if(c=t,a=o.filter(d=>d.level).sort((d,h)=>d.md-h.md).find(d=>d.md>c.md),a)console.warn(`Using ${a.identifier} as base for ${i}`);else{console.warn(`Unable to find a base pick for ${i} pick at ${c.md}, ignored`);continue}else if(l)if(a=t,c=o.filter(d=>d.level).sort((d,h)=>h.md-d.md).find(d=>d.mdc.mdEntryc.mdEntry-a.mdEntry||c.level-a.level).reverse(),s=[];for(;n.length>0;){const c=n.pop(),a=[];for(;n.length>0&&((l=n[n.length-1])==null?void 0:l.level)>c.level;)a.push(n.pop());a.reverse(),a.push(c);const f=[];a.forEach(d=>{const h=G(d.mdEntry,d.mdExit,f);f.push(...h.map(u=>({from:u[0],to:u[1],itm:d})))}),f.sort((d,h)=>d.from-h.from),s.push(...f.map(d=>({from:d.from,to:d.to,...d.itm})))}return{unitPicks:s,nonUnitPicks:r}}export{Y as C,T as c,Z as g,K as t}; +import{h as F,C as v}from"./elements-217018fd.js";const p=4,E=2;function A(o){const[e]=o.domain();return Math.abs(o(e+1))}function T(o,e,t,r){return F(A(r)*o,e,t)}function P(o,e,t=p,r=E){const i=o.x+o.width+t,n=e.x+e.width+t,s=o.y+o.height+r,l=e.y+e.height+r;return!(e.x-t>i||e.y-r>s||n+ti||e.y-r>s||n+t{this.renderText(r,n,s-l,l,c,"arial","bold"),this.renderText(i,n,s,l,c)},this.renderLine=(r,i,n,s,l,c,a=!0)=>{const{ctx:f}=this,d=a?r:r+n,h=a?r+n:r,u=i+2;f!=null&&(f.strokeStyle=c,f.lineWidth=1,f.beginPath(),f.moveTo(s,l),f.lineTo(d,u),f.lineTo(h,u),f.stroke())},this.minFontSize=(t==null?void 0:t.minFontSize)||B,this.maxFontSize=(t==null?void 0:t.maxFontSize)||C,this.fontSizeFactor=(t==null?void 0:t.fontSizeFactor)||S,this.offsetMin=(t==null?void 0:t.offsetMin)||U,this.offsetMax=(t==null?void 0:t.offsetMax)||w,this.offsetFactor=(t==null?void 0:t.offsetFactor)||R,this.fontColor=t==null?void 0:t.fontColor,t!=null&&t.backgroundColor?(this.backgroundActive=!0,this.backgroundColor=t.backgroundColor):(this.backgroundActive=!1,this.backgroundColor=_),this.backgroundPadding=(t==null?void 0:t.backgroundPadding)||D,this.backgroundBorderRadius=O(t==null?void 0:t.backgroundBorderRadius,$)}setGroupFilter(e){this.groupFilter=e,this.callouts=[],this.render()}onUpdate(e){super.onUpdate(e),this.callouts=[],this.render()}onRescale(e){super.onRescale(e);const t=this.rescaleEvent&&this.rescaleEvent.xRatio===e.xRatio;this.rescaleEvent=e,this.render(t)}render(e=!1){requestAnimationFrame(()=>{if(this.clearCanvas(),!this.data||!this.rescaleEvent||!this.referenceSystem)return;const{xScale:t,yScale:r,xBounds:i}=this.rescaleEvent,n=T(this.fontSizeFactor,this.minFontSize,this.maxFontSize,t);if(!e||this.callouts.length<=0){const{data:s,ctx:l,groupFilter:c}=this,{calculateDisplacementFromBottom:a}=this.referenceSystem.options,f=a?i[0]i[1],d=0;l!=null&&(l.font=`bold ${n}px arial`);const h=s.filter(m=>c.length<=0||c.includes(m.group)),u=T(this.offsetFactor,this.offsetMin,this.offsetMax,t);this.callouts=this.positionCallouts(h,f,t,r,d,n,u)}this.callouts.forEach(s=>{const{pos:l,title:c,color:a}=s,f=t(l.x),d=r(l.y),h={x:f,y:d,width:s.boundingBox.width,height:n,offsetX:s.dx,offsetY:s.dy};this.renderCallout(c,s.label,h,a,s.alignment)})})}renderBackground(e,t,r,i,n){const{ctx:s}=this;if(s==null)return;const l=this.backgroundPadding,c=this.backgroundBorderRadius,a=this.measureTextWidth(e,n,"arial","bold"),f=this.measureTextWidth(t,n),d=Math.max(a,f)+l*2,h=(n+l)*2,u=r-l,m=i-2*n-l;if(s.fillStyle=this.backgroundColor,c>0){const x=u+d,b=m+h;s.beginPath(),s.moveTo(u+c,m),s.lineTo(x-c,m),s.quadraticCurveTo(x,m,x,m+c),s.lineTo(x,b-c),s.quadraticCurveTo(x,b,x-c,b),s.lineTo(u+c,b),s.quadraticCurveTo(u,b,u,b-c),s.lineTo(u,m+c),s.quadraticCurveTo(u,m,u+c,m),s.fill()}else s.fillRect(u,m,d,h)}renderText(e,t,r,i,n,s="arial",l="normal"){const{ctx:c}=this;c!=null&&(c.font=`${l} ${i}px ${s}`,c.fillStyle=this.fontColor||n,c.fillText(e,t,r))}measureTextWidth(e,t,r="arial",i="normal"){const{ctx:n}=this;return n==null?0:(n.font=`${i} ${t}px ${r}`,n.measureText(e).width)}renderPoint(e,t,r,i=3){const{ctx:n}=this;n!=null&&(n.fillStyle=r,n.beginPath(),n.moveTo(e,t),n.arc(e,t,i,0,Math.PI*2),n.fill())}renderCallout(e,t,r,i,n){const s=this.getPosition(r,n),{x:l,y:c}=s,{height:a,width:f,x:d,y:h}=r,u=n===g.topright||n===g.bottomright;this.backgroundActive&&this.renderBackground(e,t,l,c,a),this.renderAnnotation(e,t,l,c,a,i),this.renderPoint(d,h,i),this.renderLine(l,c,f,d,h,i,u)}getPosition(e,t){const{x:r,y:i,offsetX:n=0,offsetY:s=0,width:l}=e;switch(t){case g.topleft:return{x:r-l-n,y:i-s};case g.topright:return{x:r+n,y:i-s};case g.bottomleft:return{x:r-l-n,y:i+s};case g.bottomright:return{x:r+n,y:i+s};default:return{x:r,y:i}}}positionCallouts(e,t,r,i,n,s,l=20){if(e.length===0)return[];const c=t?g.topleft:g.topright,a=e.map(h=>{var m;const u=h.pos?h.pos:(m=this.referenceSystem)==null?void 0:m.project(h.md);return{title:h.title,label:h.label,color:h.color,pos:{x:u==null?void 0:u[0],y:u==null?void 0:u[1]},group:h.group,alignment:c,boundingBox:this.getAnnotationBoundingBox(h.title,h.label,u,r,i,s),dx:l,dy:l}}),f=[a[a.length-1]],d=[];return this.chooseTopOrBottomPosition(a,d,f),this.adjustTopPositions(f),this.adjustBottomPositions(d),a}getAnnotationBoundingBox(e,t,r,i,n,s){const{ctx:l}=this,c=i(r[0]),a=n(r[1]),f=(l==null?void 0:l.measureText(t).width)??0,d=(l==null?void 0:l.measureText(e).width)??0,h=Math.max(f,d);return{x:c,y:a,width:h,height:s*2+4}}chooseTopOrBottomPosition(e,t,r){for(let i=e.length-2;i>=0;--i){const n=e[i],s=r[0];P(n.boundingBox,s.boundingBox)?(n.alignment=n.alignment===g.topleft?g.bottomright:g.bottomleft,t.push(n),i>0&&r.unshift(e[--i])):r.unshift(n)}}adjustTopPositions(e){for(let t=e.length-2;t>=0;--t){const r=e[t];for(let i=e.length-1;i>t;--i){const n=e[i],s=k(r.boundingBox,n.boundingBox);s&&(r.dy+=s.dy,r.boundingBox.y-=s.dy)}}}adjustBottomPositions(e){for(let t=e.length-2;t>=0;--t){const r=e[t];for(let i=e.length-1;i>t;--i){const n=e[i],s=k(n.boundingBox,r.boundingBox);s&&(r.dy+=s.dy,r.boundingBox.y+=s.dy)}}}}const y=(o,e)=>({title:o.pickIdentifier||o.identifier,group:e,label:`${o.md} ${o.mdUnit} ${o.depthReferencePoint}`,color:e==="strat-picks"?"#227":"rgba(0,0,0,0.8)",md:o.md});function M(o){return o?o.map(e=>y(e,"ref-picks")):[]}function L(o){return o?o.filter(e=>e.entryPick.md===e.from).map(e=>y(e.entryPick,"strat-picks")):[]}function N(o){return o?o.filter(e=>o.findIndex(t=>Math.abs(t.entryPick.md-e.exitPick.md)<.5)===-1).map(e=>y(e.exitPick,"strat-picks")).filter((e,t,r)=>t===r.findIndex(i=>i.title===e.title&&i.md===e.md)):[]}const Z=o=>[...M(o.nonUnitPicks),...L(o.unitPicks),...N(o.unitPicks)].sort((e,t)=>e.md-t.md),I=o=>({unitName:o.identifier,topSurface:o.top,baseSurface:o.base,ageBase:o.baseAge,ageTop:o.topAge,color:{r:o.colorR===null?255:o.colorR,g:o.colorG===null?255:o.colorG,b:o.colorB===null?255:o.colorB},level:o.stratUnitLevel,lithType:o.lithologyType,parent:o.stratUnitParent});function G(o,e,t){if(t.length===0)return[[o,e]];const r=[];let i=o,n=0;for(;ii&&r.push([i,Math.min(s.from,e)]),i=Math.min(e,Math.max(o,s.to)),n+=1}return io.map(I);function j(o,e){const t=W(e),r=[],i=[];return o.forEach(n=>{const s=t.filter(l=>{var c;return((c=n.pickIdentifier)==null?void 0:c.search(new RegExp(`(${l.topSurface}|${l.baseSurface})`,"i")))!==-1});s.length>0?s.forEach(l=>i.push({md:n.md,tvd:n.tvd,identifier:n.pickIdentifier,confidence:n.confidence,mdUnit:n.mdUnit,depthReferencePoint:n.depthReferencePoint,...l})):r.push({identifier:n.pickIdentifier,...n})}),{joined:i,nonUnitPicks:r}}function X(o){const e=[];let t=null;const r=o.filter(i=>i.level).sort((i,n)=>i.unitName.localeCompare(n.unitName)||i.md-n.md||i.ageTop-n.ageTop);for(;r.length>0;){t=r.shift();const i=t.identifier;let n;const s=i===t.topSurface,l=i===t.baseSurface;if(s)n=t.baseSurface;else if(l)n=t.topSurface;else{console.warn(`Unable to match ${i} with top or base surface, ignored`);continue}let c,a;const f=r.find(d=>d.identifier===n);if(f)c=s?t:f,a=s?f:t,c.md>a.md&&([c,a]=[a,c]),r.splice(r.indexOf(f),1);else if(console.warn(`Unable to find ${n} pick for ${i}`),s)if(c=t,a=o.filter(d=>d.level).sort((d,h)=>d.md-h.md).find(d=>d.md>c.md),a)console.warn(`Using ${a.identifier} as base for ${i}`);else{console.warn(`Unable to find a base pick for ${i} pick at ${c.md}, ignored`);continue}else if(l)if(a=t,c=o.filter(d=>d.level).sort((d,h)=>h.md-d.md).find(d=>d.mdc.mdEntryc.mdEntry-a.mdEntry||c.level-a.level).reverse(),s=[];for(;n.length>0;){const c=n.pop(),a=[];for(;n.length>0&&((l=n[n.length-1])==null?void 0:l.level)>c.level;)a.push(n.pop());a.reverse(),a.push(c);const f=[];a.forEach(d=>{const h=G(d.mdEntry,d.mdExit,f);f.push(...h.map(u=>({from:u[0],to:u[1],itm:d})))}),f.sort((d,h)=>d.from-h.from),s.push(...f.map(d=>({from:d.from,to:d.to,...d.itm})))}return{unitPicks:s,nonUnitPicks:r}}export{Y as C,T as c,Z as g,K as t}; diff --git a/storybook/master/assets/schematic-layer.stories-6624709d.js b/storybook/master/assets/schematic-layer.stories-5b12023d.js similarity index 98% rename from storybook/master/assets/schematic-layer.stories-6624709d.js rename to storybook/master/assets/schematic-layer.stories-5b12023d.js index 9005bdbb..8f9759e7 100644 --- a/storybook/master/assets/schematic-layer.stories-6624709d.js +++ b/storybook/master/assets/schematic-layer.stories-5b12023d.js @@ -1,4 +1,4 @@ -import{I as A,C as G}from"./MainController-ae0d41fa.js";import{c as W,d as h,b as L,P as B,S as v,f as g,e as k}from"./elements-84f906e9.js";import{g as u,f as T,e as H,h as F,a as R,j as E}from"./data-e45bb153.js";import"./GridLayer-416fefe9.js";const I=700,r=600,c=()=>{const n=W(I),l=h(I,r),o=L(I);return Promise.all([u(),T(),H(),F(),R(),E()]).then(([e,t,p,b,S,C])=>{const s=new A(e);s.offset=e[0][2];const P=new B({width:I,height:r}),N={completionSymbol1:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMCAwSDkwVjEwMEgxMFYwWiIgZmlsbD0iI0Q5RDlEOSIvPgo8cGF0aCBkPSJNMCAyNUgxMFY3NUgwVjI1WiIgZmlsbD0iI0I1QjJCMiIvPgo8cGF0aCBkPSJNNDUgMjVINTVWNzVINDVWMjVaIiBmaWxsPSIjQjVCMkIyIi8+CjxwYXRoIGQ9Ik05MCAyNUgxMDBWNzVIOTBWMjVaIiBmaWxsPSIjQjVCMkIyIi8+Cjwvc3ZnPgo=",completionSymbol2:"tubing1.svg",completionSymbol3:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMCAwSDkwVjEwMEgxMFYwWiIgZmlsbD0iI0Q5RDlEOSIvPgo8cGF0aCBkPSJNMCAyNUgxMFY3NUgwVjI1WiIgZmlsbD0iI0I1QjJCMiIvPgo8cGF0aCBkPSJNNDUgMjVINTVWNzVINDVWMjVaIiBmaWxsPSIjQjVCMkIyIi8+CjxwYXRoIGQ9Ik0yNSA2NUgzMFY4MEgyNVY2NVoiIGZpbGw9IiMzMTMxMzEiLz4KPHBhdGggZD0iTTI1IDQySDMwVjU3SDI1VjQyWiIgZmlsbD0iIzMxMzEzMSIvPgo8cGF0aCBkPSJNMjUgMjFIMzBWMzZIMjVWMjFaIiBmaWxsPSIjMzEzMTMxIi8+CjxwYXRoIGQ9Ik03MCA2NEg3NVY3OUg3MFY2NFoiIGZpbGw9IiMzMTMxMzEiLz4KPHBhdGggZD0iTTcwIDQxSDc1VjU2SDcwVjQxWiIgZmlsbD0iIzMxMzEzMSIvPgo8cGF0aCBkPSJNNzAgMjBINzVWMzVINzBWMjBaIiBmaWxsPSIjMzEzMTMxIi8+CjxwYXRoIGQ9Ik05MCAyNUgxMDBWNzVIOTBWMjVaIiBmaWxsPSIjQjVCMkIyIi8+Cjwvc3ZnPgo="},w=[{kind:"completionSymbol",id:"completion-svg-1",start:5250,end:5252,diameter:8.5,symbolKey:"completionSymbol1"},{kind:"completionSymbol",id:"completion-svg-2",start:5252,end:5274,diameter:8.5,symbolKey:"completionSymbol2"},{kind:"completionSymbol",id:"completion-svg-3",start:5274,end:5276,diameter:8.5,symbolKey:"completionSymbol3"}],z={mechanicalPlug:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxSDk5Vjk5SDFWMVoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl81MF81KSIvPgo8cGF0aCBkPSJNMSAxSDk5Vjk5SDFWMVoiIGZpbGw9InVybCgjcGFpbnQxX2xpbmVhcl81MF81KSIgZmlsbC1vcGFjaXR5PSIwLjIiLz4KPHBhdGggZD0iTTEgMUg5OVY5OUgxVjFaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiLz4KPGxpbmUgeDE9IjEuNzEwNzIiIHkxPSIxLjI5NjUzIiB4Mj0iOTguNzEwNyIgeTI9Ijk5LjI5NjUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIvPgo8bGluZSB4MT0iOTguNzA3MSIgeTE9IjAuNzA3MTA3IiB4Mj0iMC43MDcxIiB5Mj0iOTguNzA3MSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfNTBfNSIgeDE9IjAiIHkxPSI1MCIgeDI9IjUwIiB5Mj0iNTAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0NDMjYyNiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjQ3MUEiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDFfbGluZWFyXzUwXzUiIHgxPSI1MCIgeTE9IjUwIiB4Mj0iMTAwIiB5Mj0iNTAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGNDcxQSIvPgo8c3RvcCBvZmZzZXQ9IjAuOTk5OSIgc3RvcC1jb2xvcj0iI0NDMjYyNiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjQ3MUEiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K"},x=[{kind:"pAndASymbol",id:"mechanical-plug-1",start:5100,end:5110,diameter:8.5,symbolKey:"mechanicalPlug"},{kind:"cementPlug",id:"cement-plug-2",start:5e3,end:5110,referenceIds:["casing-07"]}],V=[{kind:"perforation",subKind:"Perforation",id:"PerforationDemo1",start:4e3,end:4500,isOpen:!0},{kind:"perforation",subKind:"Open hole frac pack",id:"PerforationDemo2",start:3500,end:4500,isOpen:!0}],m={holeSizes:t,cements:b,casings:p,completion:[...S,...w],pAndA:[...x,...C],symbols:{...N,...z},perforations:V},i={holeLayerId:"hole-id",casingLayerId:"casing-id",completionLayerId:"completion-id",cementLayerId:"cement-id",pAndALayerId:"pAndA-id",perforationLayerId:"perforation-id"},D={order:1,referenceSystem:s,internalLayerOptions:i,data:m},d=new v(P,"schematic-webgl-layer",D),a=new G({container:l,layers:[d]});d.setData(m),a.setBounds([0,1e3],[0,1e3]),a.adjustToSize(I,r),a.zoomPanHandler.zFactor=1,a.zoomPanHandler.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),a.zoomPanHandler.enableTranslateExtent=!1,a.setViewport(1e3,1e3,5e3);const Z=[["Holes",i.holeLayerId],["Casings",i.casingLayerId],["Cement",i.cementLayerId],["Completion",i.completionLayerId],["Plug & Abandonment",i.pAndALayerId],["Perforations",i.perforationLayerId]];o.append(...Z.map(U(a)))}),n.appendChild(g("High level interface for creating and displaying a wellbore schematic. This layer is made using webGL.")),n.appendChild(l),n.appendChild(k()),n.appendChild(g("Schematic layer toggles")),n.appendChild(o),n},U=n=>([l,o])=>{const e=document.createElement("button");e.innerHTML=`${l}`,e.setAttribute("style","width: 170px;height:32px;margin-top:12px;background: lightblue;");let t=!1;return e.onclick=()=>{t?(n.showLayer(o),e.style.backgroundColor="lightblue",e.style.color=""):(n.hideLayer(o),e.style.backgroundColor="red",e.style.color="white"),t=!t},e},X={title:"ESV Intersection/Features/Schematic",component:c};var M,y,j;c.parameters={...c.parameters,docs:{...(M=c.parameters)==null?void 0:M.docs,source:{originalSource:`() => { +import{I as A,C as G}from"./MainController-1e1a9474.js";import{c as W,d as h,b as L,P as B,S as v,f as g,e as k}from"./elements-217018fd.js";import{g as u,f as T,e as H,h as F,a as R,j as E}from"./data-e45bb153.js";import"./GridLayer-66718e35.js";const I=700,r=600,c=()=>{const n=W(I),l=h(I,r),o=L(I);return Promise.all([u(),T(),H(),F(),R(),E()]).then(([e,t,p,b,S,C])=>{const s=new A(e);s.offset=e[0][2];const P=new B({width:I,height:r}),N={completionSymbol1:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMCAwSDkwVjEwMEgxMFYwWiIgZmlsbD0iI0Q5RDlEOSIvPgo8cGF0aCBkPSJNMCAyNUgxMFY3NUgwVjI1WiIgZmlsbD0iI0I1QjJCMiIvPgo8cGF0aCBkPSJNNDUgMjVINTVWNzVINDVWMjVaIiBmaWxsPSIjQjVCMkIyIi8+CjxwYXRoIGQ9Ik05MCAyNUgxMDBWNzVIOTBWMjVaIiBmaWxsPSIjQjVCMkIyIi8+Cjwvc3ZnPgo=",completionSymbol2:"tubing1.svg",completionSymbol3:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjEwMCIgdmlld0JveD0iMCAwIDEwMCAxMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik0xMCAwSDkwVjEwMEgxMFYwWiIgZmlsbD0iI0Q5RDlEOSIvPgo8cGF0aCBkPSJNMCAyNUgxMFY3NUgwVjI1WiIgZmlsbD0iI0I1QjJCMiIvPgo8cGF0aCBkPSJNNDUgMjVINTVWNzVINDVWMjVaIiBmaWxsPSIjQjVCMkIyIi8+CjxwYXRoIGQ9Ik0yNSA2NUgzMFY4MEgyNVY2NVoiIGZpbGw9IiMzMTMxMzEiLz4KPHBhdGggZD0iTTI1IDQySDMwVjU3SDI1VjQyWiIgZmlsbD0iIzMxMzEzMSIvPgo8cGF0aCBkPSJNMjUgMjFIMzBWMzZIMjVWMjFaIiBmaWxsPSIjMzEzMTMxIi8+CjxwYXRoIGQ9Ik03MCA2NEg3NVY3OUg3MFY2NFoiIGZpbGw9IiMzMTMxMzEiLz4KPHBhdGggZD0iTTcwIDQxSDc1VjU2SDcwVjQxWiIgZmlsbD0iIzMxMzEzMSIvPgo8cGF0aCBkPSJNNzAgMjBINzVWMzVINzBWMjBaIiBmaWxsPSIjMzEzMTMxIi8+CjxwYXRoIGQ9Ik05MCAyNUgxMDBWNzVIOTBWMjVaIiBmaWxsPSIjQjVCMkIyIi8+Cjwvc3ZnPgo="},w=[{kind:"completionSymbol",id:"completion-svg-1",start:5250,end:5252,diameter:8.5,symbolKey:"completionSymbol1"},{kind:"completionSymbol",id:"completion-svg-2",start:5252,end:5274,diameter:8.5,symbolKey:"completionSymbol2"},{kind:"completionSymbol",id:"completion-svg-3",start:5274,end:5276,diameter:8.5,symbolKey:"completionSymbol3"}],z={mechanicalPlug:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxzdmcgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMSAxSDk5Vjk5SDFWMVoiIGZpbGw9InVybCgjcGFpbnQwX2xpbmVhcl81MF81KSIvPgo8cGF0aCBkPSJNMSAxSDk5Vjk5SDFWMVoiIGZpbGw9InVybCgjcGFpbnQxX2xpbmVhcl81MF81KSIgZmlsbC1vcGFjaXR5PSIwLjIiLz4KPHBhdGggZD0iTTEgMUg5OVY5OUgxVjFaIiBzdHJva2U9ImJsYWNrIiBzdHJva2Utd2lkdGg9IjIiLz4KPGxpbmUgeDE9IjEuNzEwNzIiIHkxPSIxLjI5NjUzIiB4Mj0iOTguNzEwNyIgeTI9Ijk5LjI5NjUiIHN0cm9rZT0iYmxhY2siIHN0cm9rZS13aWR0aD0iMiIvPgo8bGluZSB4MT0iOTguNzA3MSIgeTE9IjAuNzA3MTA3IiB4Mj0iMC43MDcxIiB5Mj0iOTguNzA3MSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIi8+CjxkZWZzPgo8bGluZWFyR3JhZGllbnQgaWQ9InBhaW50MF9saW5lYXJfNTBfNSIgeDE9IjAiIHkxPSI1MCIgeDI9IjUwIiB5Mj0iNTAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0NDMjYyNiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjQ3MUEiLz4KPC9saW5lYXJHcmFkaWVudD4KPGxpbmVhckdyYWRpZW50IGlkPSJwYWludDFfbGluZWFyXzUwXzUiIHgxPSI1MCIgeTE9IjUwIiB4Mj0iMTAwIiB5Mj0iNTAiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KPHN0b3Agc3RvcC1jb2xvcj0iI0ZGNDcxQSIvPgo8c3RvcCBvZmZzZXQ9IjAuOTk5OSIgc3RvcC1jb2xvcj0iI0NDMjYyNiIvPgo8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNGRjQ3MUEiLz4KPC9saW5lYXJHcmFkaWVudD4KPC9kZWZzPgo8L3N2Zz4K"},x=[{kind:"pAndASymbol",id:"mechanical-plug-1",start:5100,end:5110,diameter:8.5,symbolKey:"mechanicalPlug"},{kind:"cementPlug",id:"cement-plug-2",start:5e3,end:5110,referenceIds:["casing-07"]}],V=[{kind:"perforation",subKind:"Perforation",id:"PerforationDemo1",start:4e3,end:4500,isOpen:!0},{kind:"perforation",subKind:"Open hole frac pack",id:"PerforationDemo2",start:3500,end:4500,isOpen:!0}],m={holeSizes:t,cements:b,casings:p,completion:[...S,...w],pAndA:[...x,...C],symbols:{...N,...z},perforations:V},i={holeLayerId:"hole-id",casingLayerId:"casing-id",completionLayerId:"completion-id",cementLayerId:"cement-id",pAndALayerId:"pAndA-id",perforationLayerId:"perforation-id"},D={order:1,referenceSystem:s,internalLayerOptions:i,data:m},d=new v(P,"schematic-webgl-layer",D),a=new G({container:l,layers:[d]});d.setData(m),a.setBounds([0,1e3],[0,1e3]),a.adjustToSize(I,r),a.zoomPanHandler.zFactor=1,a.zoomPanHandler.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),a.zoomPanHandler.enableTranslateExtent=!1,a.setViewport(1e3,1e3,5e3);const Z=[["Holes",i.holeLayerId],["Casings",i.casingLayerId],["Cement",i.cementLayerId],["Completion",i.completionLayerId],["Plug & Abandonment",i.pAndALayerId],["Perforations",i.perforationLayerId]];o.append(...Z.map(U(a)))}),n.appendChild(g("High level interface for creating and displaying a wellbore schematic. This layer is made using webGL.")),n.appendChild(l),n.appendChild(k()),n.appendChild(g("Schematic layer toggles")),n.appendChild(o),n},U=n=>([l,o])=>{const e=document.createElement("button");e.innerHTML=`${l}`,e.setAttribute("style","width: 170px;height:32px;margin-top:12px;background: lightblue;");let t=!1;return e.onclick=()=>{t?(n.showLayer(o),e.style.backgroundColor="lightblue",e.style.color=""):(n.hideLayer(o),e.style.backgroundColor="red",e.style.color="white"),t=!t},e},X={title:"ESV Intersection/Features/Schematic",component:c};var M,y,j;c.parameters={...c.parameters,docs:{...(M=c.parameters)==null?void 0:M.docs,source:{originalSource:`() => { const root = createRootContainer(width); const container = createLayerContainer(width, height); const btnContainer = createButtonContainer(width); diff --git a/storybook/master/assets/seismic-colormap-ee0d3420.js b/storybook/master/assets/seismic-colormap-ec670136.js similarity index 98% rename from storybook/master/assets/seismic-colormap-ee0d3420.js rename to storybook/master/assets/seismic-colormap-ec670136.js index 6a7eb496..8a1f65af 100644 --- a/storybook/master/assets/seismic-colormap-ee0d3420.js +++ b/storybook/master/assets/seismic-colormap-ec670136.js @@ -1 +1 @@ -import{p as J,q as K,h as N,C as P}from"./elements-84f906e9.js";import{a as Q}from"./findsample-cc6ecc23.js";function W(e,a){const c=e.map((h,n)=>n*a/e.length),f=J().domain(c).range(e);return Array.from(new Array(a).keys()).map(h=>{var m;const n=(m=K(f(h)))==null?void 0:m.rgb();return n!=null?[n.r,n.g,n.b]:[0,0,0]})}const e0=e=>e?{x:e.minX,y:e.minTvdMsl,width:e.maxX-e.minX,height:e.maxTvdMsl-e.minTvdMsl}:{x:0,y:0,width:0,height:0};function a0(e,a){if(!(e&&e.datapoints))return null;const c=a.reduce((s,t)=>Math.min(s,t[0]),0),f=a.reduce((s,t)=>Math.max(s,t[0]),0),l=e.yAxisValues&&e.yAxisValues[0],h=e.yAxisValues&&e.yAxisValues[e.yAxisValues.length-1],n=e.datapoints||[],m=-n.reduce((s,t)=>Math.min(...t,s),0),o=n.reduce((s,t)=>Math.max(...t,s),0),x=Math.max(Math.abs(m),Math.abs(o)),b=-x,u=x;return{minX:c,maxX:f,minTvdMsl:l,maxTvdMsl:h,domain:{min:b,max:u,difference:u-b}}}async function f0(e,a,c,f={isLeftToRight:!0}){var I,V,L,X,D,U,k,O;if(!(e&&e.datapoints&&e.datapoints.length>0))return;const{datapoints:l}=e,h=(f==null?void 0:f.seismicMin)||(f==null?void 0:f.seismicRange)||l.reduce((r,i)=>Math.min(...i,r),0),n=(f==null?void 0:f.seismicMax)||(f==null?void 0:f.seismicRange)||l.reduce((r,i)=>Math.max(...i,r),0),m=Math.max(Math.abs(h),Math.abs(n)),o=-m,x=m,b={min:o,max:x,difference:x-o},u=((I=a[0])==null?void 0:I[0])-((V=a[a.length-1])==null?void 0:V[0]),d=Math.abs(Math.floor(u/5)),s=e.yAxisValues.length,t=1e3,F=W(c,t),C=new Uint8ClampedArray(d*s*4);let T=0;const _=(t-1)/b.difference;let w=f!=null&&f.isLeftToRight?(L=a[0])==null?void 0:L[0]:(X=a[a.length-1])==null?void 0:X[0];const z=u/d*(f!=null&&f.isLeftToRight?-1:1);let y,A,R,M,g;const E=[0,0,0];let S;for(let r=0;rn*a/e.length),f=J().domain(c).range(e);return Array.from(new Array(a).keys()).map(h=>{var m;const n=(m=K(f(h)))==null?void 0:m.rgb();return n!=null?[n.r,n.g,n.b]:[0,0,0]})}const e0=e=>e?{x:e.minX,y:e.minTvdMsl,width:e.maxX-e.minX,height:e.maxTvdMsl-e.minTvdMsl}:{x:0,y:0,width:0,height:0};function a0(e,a){if(!(e&&e.datapoints))return null;const c=a.reduce((s,t)=>Math.min(s,t[0]),0),f=a.reduce((s,t)=>Math.max(s,t[0]),0),l=e.yAxisValues&&e.yAxisValues[0],h=e.yAxisValues&&e.yAxisValues[e.yAxisValues.length-1],n=e.datapoints||[],m=-n.reduce((s,t)=>Math.min(...t,s),0),o=n.reduce((s,t)=>Math.max(...t,s),0),x=Math.max(Math.abs(m),Math.abs(o)),b=-x,u=x;return{minX:c,maxX:f,minTvdMsl:l,maxTvdMsl:h,domain:{min:b,max:u,difference:u-b}}}async function f0(e,a,c,f={isLeftToRight:!0}){var I,V,L,X,D,U,k,O;if(!(e&&e.datapoints&&e.datapoints.length>0))return;const{datapoints:l}=e,h=(f==null?void 0:f.seismicMin)||(f==null?void 0:f.seismicRange)||l.reduce((r,i)=>Math.min(...i,r),0),n=(f==null?void 0:f.seismicMax)||(f==null?void 0:f.seismicRange)||l.reduce((r,i)=>Math.max(...i,r),0),m=Math.max(Math.abs(h),Math.abs(n)),o=-m,x=m,b={min:o,max:x,difference:x-o},u=((I=a[0])==null?void 0:I[0])-((V=a[a.length-1])==null?void 0:V[0]),d=Math.abs(Math.floor(u/5)),s=e.yAxisValues.length,t=1e3,F=W(c,t),C=new Uint8ClampedArray(d*s*4);let T=0;const _=(t-1)/b.difference;let w=f!=null&&f.isLeftToRight?(L=a[0])==null?void 0:L[0]:(X=a[a.length-1])==null?void 0:X[0];const z=u/d*(f!=null&&f.isLeftToRight?-1:1);let y,A,R,M,g;const E=[0,0,0];let S;for(let r=0;r[h.easting,h.northing,h.tvd,h.md]):[],s=new D(a,{tension:.75,arcDivisions:5e3}),o=s.length,n=Math.round(o*G);let e;n>0?e=N(s.getPoints(n),5e-4,10):e=[[a[0][0],a[0][1]]];const r=e[0],l=e[e.length-1],u=j.distance(r,l);let i;if(u0&&(p=M(Math.ceil(c*P)).map(h=>i.set(v).scale(c*(1-h)).subFrom(r).toArray()),p.pop(),d.push(...p)),d.push(...e);const w=M(Math.ceil(I*P)).map(h=>i.set(v).scale(I*h).add(l).toArray()).splice(1);return d.push(...w),Q(d,void 0,g)}function K(t,m){const a=j.zero.mutable;let s=0;const o=j.zero.mutable;for(let n=0;nm)break}return s===0?new j([0,0]):a.scale(1/s)}function N(t,m=.001,a=10){if(t.length<=4)return t;const[s,o]=t[0],n=t.map(i=>[i[0]-s,i[1]-o]);let[e,r]=n[0];const l=[t[0]];for(let i=1;i+1m||C>=a)&&(l.push([c+s,g+o]),[e,r]=[c,g])}}const u=n[n.length-1];return l.push([u[0]+s,u[1]+o]),l}function Q(t,m,a=0){let s=m||t[0],o=0;return t.map(e=>{const r=e[0]-s[0],l=e[1]-s[1];return o+=Math.sqrt(r**2+l**2),s=e,[a>0?a-o:o,e[2]??0]})}const f=700,y=600,S=()=>{const t=O(f),m=H(f,y);return Promise.all([Z(),_()]).then(a=>{const[s,o]=a,n=new E("seismic",{order:2,layerOpacity:1}),e={elm:m,width:f,height:y};n.onMount({...e});const r=J(s,45),l=V(o,r);q(o,r,B).then(i=>{n.data={image:i,options:F(l)}});const u=new R(m,i=>{n.onRescale(i)});u.setBounds([0,f],[0,y]),u.adjustToSize(f,y),u.setViewport(f/2,y/2,f/2)}),t.appendChild(m),t.appendChild(T()),t},A={title:"ESV Intersection/Features/Seismic",component:S};var b,x,z;S.parameters={...S.parameters,docs:{...(b=S.parameters)==null?void 0:b.docs,source:{originalSource:`() => { +import{n as D,j,o as M,c as O,d as H,Z as R,e as T}from"./elements-217018fd.js";import{S as E,g as V,b as q,a as F,s as B}from"./seismic-colormap-ec670136.js";import{k as Z,b as _}from"./data-e45bb153.js";import"./findsample-cc6ecc23.js";const P=.1,I=1e3,k=150,U=30,G=10;function J(t,m){if(!t||t.length===0)return[];const a=t?t.map(h=>[h.easting,h.northing,h.tvd,h.md]):[],s=new D(a,{tension:.75,arcDivisions:5e3}),o=s.length,n=Math.round(o*G);let e;n>0?e=N(s.getPoints(n),5e-4,10):e=[[a[0][0],a[0][1]]];const r=e[0],l=e[e.length-1],u=j.distance(r,l);let i;if(u0&&(p=M(Math.ceil(c*P)).map(h=>i.set(v).scale(c*(1-h)).subFrom(r).toArray()),p.pop(),d.push(...p)),d.push(...e);const w=M(Math.ceil(I*P)).map(h=>i.set(v).scale(I*h).add(l).toArray()).splice(1);return d.push(...w),Q(d,void 0,g)}function K(t,m){const a=j.zero.mutable;let s=0;const o=j.zero.mutable;for(let n=0;nm)break}return s===0?new j([0,0]):a.scale(1/s)}function N(t,m=.001,a=10){if(t.length<=4)return t;const[s,o]=t[0],n=t.map(i=>[i[0]-s,i[1]-o]);let[e,r]=n[0];const l=[t[0]];for(let i=1;i+1m||C>=a)&&(l.push([c+s,g+o]),[e,r]=[c,g])}}const u=n[n.length-1];return l.push([u[0]+s,u[1]+o]),l}function Q(t,m,a=0){let s=m||t[0],o=0;return t.map(e=>{const r=e[0]-s[0],l=e[1]-s[1];return o+=Math.sqrt(r**2+l**2),s=e,[a>0?a-o:o,e[2]??0]})}const f=700,y=600,S=()=>{const t=O(f),m=H(f,y);return Promise.all([Z(),_()]).then(a=>{const[s,o]=a,n=new E("seismic",{order:2,layerOpacity:1}),e={elm:m,width:f,height:y};n.onMount({...e});const r=J(s,45),l=V(o,r);q(o,r,B).then(i=>{n.data={image:i,options:F(l)}});const u=new R(m,i=>{n.onRescale(i)});u.setBounds([0,f],[0,y]),u.adjustToSize(f,y),u.setViewport(f/2,y/2,f/2)}),t.appendChild(m),t.appendChild(T()),t},A={title:"ESV Intersection/Features/Seismic",component:S};var b,x,z;S.parameters={...S.parameters,docs:{...(b=S.parameters)==null?void 0:b.docs,source:{originalSource:`() => { const root = createRootContainer(width); const container = createLayerContainer(width, height); Promise.all([getPositionLog(), getSeismic()]).then(values => { diff --git a/storybook/master/assets/wellborepath-layer.stories-a8a64590.js b/storybook/master/assets/wellborepath-layer.stories-52ba7562.js similarity index 92% rename from storybook/master/assets/wellborepath-layer.stories-a8a64590.js rename to storybook/master/assets/wellborepath-layer.stories-52ba7562.js index d5b95c4c..3f17c956 100644 --- a/storybook/master/assets/wellborepath-layer.stories-a8a64590.js +++ b/storybook/master/assets/wellborepath-layer.stories-52ba7562.js @@ -1,4 +1,4 @@ -import{I as y,C as k}from"./MainController-ae0d41fa.js";import{c as f,d as u,e as S,Z as z}from"./elements-84f906e9.js";import{W as g}from"./WellborePathLayer-4cd0b66f.js";import{g as W}from"./data-e45bb153.js";import"./GridLayer-416fefe9.js";const t=700,a=600,r=()=>{const e=f(t),o=u(t,a),c=S();return W().then(i=>{const p={order:1,strokeWidth:"2px",stroke:"black",referenceSystem:new y(i)},s=new g("wellborepath",p);s.onMount({elm:o,width:t,height:a});const n=new z(o,P=>{s.onRescale(P)});n.setBounds([0,1e3],[0,1e3]),n.adjustToSize(t,a),n.setViewport(1e3,1e3,5e3),e.appendChild(o),e.appendChild(c)}),e},l=()=>{const e=f(t),o=u(t,a),c=S();return W().then(i=>{const p={order:1,strokeWidth:"2px",stroke:"black",referenceSystem:new y(i)},s=new g("wellborepath",p),n=new k({container:o,layers:[s]});n.setBounds([0,1e3],[0,1e3]),n.adjustToSize(t,a),n.setViewport(1e3,1e3,5e3),e.appendChild(o),e.appendChild(c)}),e},V={title:"ESV Intersection/Features/Wellborepath",component:r};var h,d,m;r.parameters={...r.parameters,docs:{...(h=r.parameters)==null?void 0:h.docs,source:{originalSource:`() => { +import{I as y,C as k}from"./MainController-1e1a9474.js";import{c as f,d as u,e as S,Z as z}from"./elements-217018fd.js";import{W as g}from"./WellborePathLayer-11ff1510.js";import{g as W}from"./data-e45bb153.js";import"./GridLayer-66718e35.js";const t=700,a=600,r=()=>{const e=f(t),o=u(t,a),c=S();return W().then(i=>{const p={order:1,strokeWidth:"2px",stroke:"black",referenceSystem:new y(i)},s=new g("wellborepath",p);s.onMount({elm:o,width:t,height:a});const n=new z(o,P=>{s.onRescale(P)});n.setBounds([0,1e3],[0,1e3]),n.adjustToSize(t,a),n.setViewport(1e3,1e3,5e3),e.appendChild(o),e.appendChild(c)}),e},l=()=>{const e=f(t),o=u(t,a),c=S();return W().then(i=>{const p={order:1,strokeWidth:"2px",stroke:"black",referenceSystem:new y(i)},s=new g("wellborepath",p),n=new k({container:o,layers:[s]});n.setBounds([0,1e3],[0,1e3]),n.adjustToSize(t,a),n.setViewport(1e3,1e3,5e3),e.appendChild(o),e.appendChild(c)}),e},V={title:"ESV Intersection/Features/Wellborepath",component:r};var h,d,m;r.parameters={...r.parameters,docs:{...(h=r.parameters)==null?void 0:h.docs,source:{originalSource:`() => { const root = createRootContainer(width); const container = createLayerContainer(width, height); const fpsLabel = createFPSLabel(); diff --git a/storybook/master/assets/zoom.stories-5e6c73d2.js b/storybook/master/assets/zoom.stories-f007092c.js similarity index 98% rename from storybook/master/assets/zoom.stories-5e6c73d2.js rename to storybook/master/assets/zoom.stories-f007092c.js index 138e47d9..a9531aa2 100644 --- a/storybook/master/assets/zoom.stories-5e6c73d2.js +++ b/storybook/master/assets/zoom.stories-f007092c.js @@ -1,4 +1,4 @@ -import{G as M,A as W}from"./GridLayer-416fefe9.js";import{Z as y,e as z,c as E,d as P,s as R,C as F}from"./elements-84f906e9.js";const r=600,a=400;function i(n,e){const t=document.createElement("button");return t.innerHTML=n,t.setAttribute("style","width: 100px;height:32px;margin-top:12px;"),t.onclick=e,t}class v extends F{constructor(e,t){super(e,t),this.render=this.render.bind(this)}onRescale(e){super.onRescale(e),this.render(e)}onUpdate(e){super.onUpdate(e),this.render(null)}render(e){const{ctx:t}=this;if(!t||!e)return;const[o,m]=e.xBounds,[d,c]=e.yBounds,l=e.xScale(o),h=e.yScale(d),s=e.xScale(m)-l,u=e.yScale(c)-h,C=l+s/2,k=h+u/2,x=Math.abs(l-e.xScale(e.xBounds[0]+100)),A=x*e.zFactor;t.save(),t.clearRect(0,0,t.canvas.clientWidth,t.canvas.clientHeight),t.strokeStyle="green",t.fillStyle="#00002f",t.lineWidth=e.transform.k,t.beginPath(),t.rect(l,h,s,u),t.fill(),t.stroke(),t.strokeStyle="grey",t.fillStyle="dimgray",t.lineWidth=3,t.beginPath(),t.ellipse(C,k,x,A,0,0,2*Math.PI),t.fill(),t.stroke(),t.fillStyle="#bbb",t.lineWidth=1,t.beginPath(),t.ellipse(C,k,x/1.5,A/1.5,0,0,2*Math.PI),t.fill(),t.stroke(),t.strokeStyle="black",t.fillStyle="lightgray",t.lineWidth=e.transform.k,t.beginPath(),t.rect(10*e.transform.k+e.transform.x,10*e.transform.k+e.transform.y,300*e.transform.k,200*e.transform.k),t.fill(),t.stroke(),t.beginPath();for(let b=0;b<4;b++)t.moveTo(20*e.transform.k+e.transform.x,(b+1)*40*e.transform.k+e.transform.y),t.lineTo(300*e.transform.k+e.transform.x,(b+1)*40*e.transform.k+e.transform.y);t.stroke(),t.translate(e.transform.x,e.transform.y),t.scale(e.xRatio,e.yRatio),t.strokeStyle="black",t.lineWidth=1,t.beginPath(),t.moveTo(-50,0),t.lineTo(50,0),t.moveTo(0,-50),t.lineTo(0,50),t.stroke(),t.beginPath(),t.moveTo(950,1e3),t.lineTo(1050,1e3),t.moveTo(1e3,950),t.lineTo(1e3,1050),t.stroke(),t.fillStyle="gray",t.beginPath(),t.rect(470,700,60,220),t.fill(),t.stroke(),t.restore()}}const p=()=>{const n=document.createElement("div"),e=document.createElement("div");e.className="test-container",e.setAttribute("style",`height: ${a}px; width: ${r}px;background-color: #eee;position: relative;`),e.setAttribute("height",`${a}`),e.setAttribute("width",`${r}`),n.appendChild(e);const t=new v("test",{order:1});t.onMount({elm:e,width:r,height:a});const o=new y(n,d=>{t.onRescale(d)});o.setBounds([0,1e3],[0,1e3]),o.adjustToSize(r,a),o.zFactor=1,o.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),o.enableTranslateExtent=!1,o.setViewport(500,500,3e3);const m=document.createElement("div");return m.className="Buttons-container",n.appendChild(i("500x500",()=>{e.setAttribute("style","height: 500px; width: 500px;background-color: #eee;"),e.setAttribute("height","500"),e.setAttribute("width","500"),o.adjustToSize(500,500)})),n.appendChild(i("600x400",()=>{e.setAttribute("style","height: 400px; width: 600px;background-color: #eee;"),e.setAttribute("height","400"),e.setAttribute("width","600"),o.adjustToSize(600,400)})),n.appendChild(i("800x600",()=>{e.setAttribute("style","height: 600px; width: 800px;background-color: #eee;"),e.setAttribute("height","600"),e.setAttribute("width","800"),o.adjustToSize(800,600)})),n.appendChild(i("1:1",()=>{o.zFactor=1})),n.appendChild(i("2:1",()=>{o.zFactor=2})),n.appendChild(i("1:2",()=>{o.zFactor=.5})),n.appendChild(i("center",()=>{o.setViewport(500,500,void 0,500)})),n.appendChild(i("reset",()=>{o.zFactor=1,o.setViewport(500,500,3e3)})),n.appendChild(z()),n},w=()=>{const n=document.createElement("div");n.className="Test-container",n.setAttribute("style",`height: ${a}px; width: ${r}px;background-color: #eee;`),n.setAttribute("height",`${a}`),n.setAttribute("width",`${r}`);const e=new M("grid",{majorColor:"black",minorColor:"black",majorWidth:.5,minorWidth:.5,order:1});e.onMount({elm:n,width:r,height:a});const t=new y(n,o=>{e.onRescale(o)});return t.setBounds([0,1e3],[0,1e3]),t.adjustToSize(r,a),n.appendChild(z()),n},g=()=>{const n=E(r),e=P(r,a),t=document.createElement("div"),o=40,m=30,d=R(e).append("svg").attr("height",`${a}px`).attr("width",`${r}px`).style("position","absolute"),c=!0,l=new W(d,c,"Displacement","TVD MSL","m"),h=new M("grid",{majorColor:"black",minorColor:"black",majorWidth:.5,minorWidth:.5,order:1});h.onMount({elm:e,width:r,height:a});const s=new y(e,u=>{l.onRescale(u),h.onRescale(u)});return s.setMinZoomLevel(.1),s.setMaxZoomLevel(10),s.setBounds([0,1e3],[0,1e3]),s.adjustToSize(r-o,a-m),t.appendChild(i("min zoom 1",()=>{s.setMinZoomLevel(1)})),t.appendChild(i("max zoom 100",()=>{s.setMaxZoomLevel(100)})),t.appendChild(i("reset",()=>{s.setZoomLevelBoundary([.1,256])})),n.appendChild(e),n.appendChild(t),n.appendChild(z()),n},N={title:"ESV Intersection/Features/Zoom",component:p};var L,$,f;p.parameters={...p.parameters,docs:{...(L=p.parameters)==null?void 0:L.docs,source:{originalSource:`() => { +import{G as M,A as W}from"./GridLayer-66718e35.js";import{Z as y,e as z,c as E,d as P,s as R,C as F}from"./elements-217018fd.js";const r=600,a=400;function i(n,e){const t=document.createElement("button");return t.innerHTML=n,t.setAttribute("style","width: 100px;height:32px;margin-top:12px;"),t.onclick=e,t}class v extends F{constructor(e,t){super(e,t),this.render=this.render.bind(this)}onRescale(e){super.onRescale(e),this.render(e)}onUpdate(e){super.onUpdate(e),this.render(null)}render(e){const{ctx:t}=this;if(!t||!e)return;const[o,m]=e.xBounds,[d,c]=e.yBounds,l=e.xScale(o),h=e.yScale(d),s=e.xScale(m)-l,u=e.yScale(c)-h,C=l+s/2,k=h+u/2,x=Math.abs(l-e.xScale(e.xBounds[0]+100)),A=x*e.zFactor;t.save(),t.clearRect(0,0,t.canvas.clientWidth,t.canvas.clientHeight),t.strokeStyle="green",t.fillStyle="#00002f",t.lineWidth=e.transform.k,t.beginPath(),t.rect(l,h,s,u),t.fill(),t.stroke(),t.strokeStyle="grey",t.fillStyle="dimgray",t.lineWidth=3,t.beginPath(),t.ellipse(C,k,x,A,0,0,2*Math.PI),t.fill(),t.stroke(),t.fillStyle="#bbb",t.lineWidth=1,t.beginPath(),t.ellipse(C,k,x/1.5,A/1.5,0,0,2*Math.PI),t.fill(),t.stroke(),t.strokeStyle="black",t.fillStyle="lightgray",t.lineWidth=e.transform.k,t.beginPath(),t.rect(10*e.transform.k+e.transform.x,10*e.transform.k+e.transform.y,300*e.transform.k,200*e.transform.k),t.fill(),t.stroke(),t.beginPath();for(let b=0;b<4;b++)t.moveTo(20*e.transform.k+e.transform.x,(b+1)*40*e.transform.k+e.transform.y),t.lineTo(300*e.transform.k+e.transform.x,(b+1)*40*e.transform.k+e.transform.y);t.stroke(),t.translate(e.transform.x,e.transform.y),t.scale(e.xRatio,e.yRatio),t.strokeStyle="black",t.lineWidth=1,t.beginPath(),t.moveTo(-50,0),t.lineTo(50,0),t.moveTo(0,-50),t.lineTo(0,50),t.stroke(),t.beginPath(),t.moveTo(950,1e3),t.lineTo(1050,1e3),t.moveTo(1e3,950),t.lineTo(1e3,1050),t.stroke(),t.fillStyle="gray",t.beginPath(),t.rect(470,700,60,220),t.fill(),t.stroke(),t.restore()}}const p=()=>{const n=document.createElement("div"),e=document.createElement("div");e.className="test-container",e.setAttribute("style",`height: ${a}px; width: ${r}px;background-color: #eee;position: relative;`),e.setAttribute("height",`${a}`),e.setAttribute("width",`${r}`),n.appendChild(e);const t=new v("test",{order:1});t.onMount({elm:e,width:r,height:a});const o=new y(n,d=>{t.onRescale(d)});o.setBounds([0,1e3],[0,1e3]),o.adjustToSize(r,a),o.zFactor=1,o.setTranslateBounds([-5e3,6e3],[-5e3,6e3]),o.enableTranslateExtent=!1,o.setViewport(500,500,3e3);const m=document.createElement("div");return m.className="Buttons-container",n.appendChild(i("500x500",()=>{e.setAttribute("style","height: 500px; width: 500px;background-color: #eee;"),e.setAttribute("height","500"),e.setAttribute("width","500"),o.adjustToSize(500,500)})),n.appendChild(i("600x400",()=>{e.setAttribute("style","height: 400px; width: 600px;background-color: #eee;"),e.setAttribute("height","400"),e.setAttribute("width","600"),o.adjustToSize(600,400)})),n.appendChild(i("800x600",()=>{e.setAttribute("style","height: 600px; width: 800px;background-color: #eee;"),e.setAttribute("height","600"),e.setAttribute("width","800"),o.adjustToSize(800,600)})),n.appendChild(i("1:1",()=>{o.zFactor=1})),n.appendChild(i("2:1",()=>{o.zFactor=2})),n.appendChild(i("1:2",()=>{o.zFactor=.5})),n.appendChild(i("center",()=>{o.setViewport(500,500,void 0,500)})),n.appendChild(i("reset",()=>{o.zFactor=1,o.setViewport(500,500,3e3)})),n.appendChild(z()),n},w=()=>{const n=document.createElement("div");n.className="Test-container",n.setAttribute("style",`height: ${a}px; width: ${r}px;background-color: #eee;`),n.setAttribute("height",`${a}`),n.setAttribute("width",`${r}`);const e=new M("grid",{majorColor:"black",minorColor:"black",majorWidth:.5,minorWidth:.5,order:1});e.onMount({elm:n,width:r,height:a});const t=new y(n,o=>{e.onRescale(o)});return t.setBounds([0,1e3],[0,1e3]),t.adjustToSize(r,a),n.appendChild(z()),n},g=()=>{const n=E(r),e=P(r,a),t=document.createElement("div"),o=40,m=30,d=R(e).append("svg").attr("height",`${a}px`).attr("width",`${r}px`).style("position","absolute"),c=!0,l=new W(d,c,"Displacement","TVD MSL","m"),h=new M("grid",{majorColor:"black",minorColor:"black",majorWidth:.5,minorWidth:.5,order:1});h.onMount({elm:e,width:r,height:a});const s=new y(e,u=>{l.onRescale(u),h.onRescale(u)});return s.setMinZoomLevel(.1),s.setMaxZoomLevel(10),s.setBounds([0,1e3],[0,1e3]),s.adjustToSize(r-o,a-m),t.appendChild(i("min zoom 1",()=>{s.setMinZoomLevel(1)})),t.appendChild(i("max zoom 100",()=>{s.setMaxZoomLevel(100)})),t.appendChild(i("reset",()=>{s.setZoomLevelBoundary([.1,256])})),n.appendChild(e),n.appendChild(t),n.appendChild(z()),n},N={title:"ESV Intersection/Features/Zoom",component:p};var L,$,f;p.parameters={...p.parameters,docs:{...(L=p.parameters)==null?void 0:L.docs,source:{originalSource:`() => { const root = document.createElement('div'); const container = document.createElement('div'); container.className = 'test-container'; diff --git a/storybook/master/iframe.html b/storybook/master/iframe.html index 63052e8e..c935c50e 100644 --- a/storybook/master/iframe.html +++ b/storybook/master/iframe.html @@ -509,7 +509,7 @@ } - + @@ -608,7 +608,7 @@

Missing Context/Providers: You can use decorators to supply specific contexts or providers, which are sometimes necessary for components to render correctly. For detailed instructions on using decorators, please visit the - Decorators documentation. diff --git a/storybook/master/index.json b/storybook/master/index.json index 35c7d1d9..ea663bc8 100644 --- a/storybook/master/index.json +++ b/storybook/master/index.json @@ -1 +1 @@ -{"v":5,"entries":{"esv-intersection-complete-example--intersection":{"type":"story","id":"esv-intersection-complete-example--intersection","name":"Intersection","title":"ESV Intersection/Complete example","importPath":"./.storybook/src/complete-example/intersection.stories.ts","tags":["dev","test"]},"esv-intersection-complete-example--intersection-flip-x":{"type":"story","id":"esv-intersection-complete-example--intersection-flip-x","name":"Intersection Flip X","title":"ESV Intersection/Complete example","importPath":"./.storybook/src/complete-example/intersection.stories.ts","tags":["dev","test"]},"esv-intersection-features-axis--axis-using-low-level-interface":{"type":"story","id":"esv-intersection-features-axis--axis-using-low-level-interface","name":"Axis Using Low Level Interface","title":"ESV Intersection/Features/Axis","importPath":"./.storybook/src/features/axis.stories.ts","tags":["dev","test"]},"esv-intersection-features-axis--axis-using-high-level-interface":{"type":"story","id":"esv-intersection-features-axis--axis-using-high-level-interface","name":"Axis Using High Level Interface","title":"ESV Intersection/Features/Axis","importPath":"./.storybook/src/features/axis.stories.ts","tags":["dev","test"]},"esv-intersection-features-callout--callout-using-low-level-interface":{"type":"story","id":"esv-intersection-features-callout--callout-using-low-level-interface","name":"Callout Using Low Level Interface","title":"ESV Intersection/Features/Callout","importPath":"./.storybook/src/features/callout-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-callout--callout-using-high-level-interface":{"type":"story","id":"esv-intersection-features-callout--callout-using-high-level-interface","name":"Callout Using High Level Interface","title":"ESV Intersection/Features/Callout","importPath":"./.storybook/src/features/callout-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-geo-model--geo-model-using-low-level-interface":{"type":"story","id":"esv-intersection-features-geo-model--geo-model-using-low-level-interface","name":"Geo Model Using Low Level Interface","title":"ESV Intersection/Features/Geo Model","importPath":"./.storybook/src/features/geomodel-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-geo-model--geo-model-with-labels-using-low-level-interface":{"type":"story","id":"esv-intersection-features-geo-model--geo-model-with-labels-using-low-level-interface","name":"Geo Model With Labels Using Low Level Interface","title":"ESV Intersection/Features/Geo Model","importPath":"./.storybook/src/features/geomodel-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-geo-model--geo-model-using-high-level-interface":{"type":"story","id":"esv-intersection-features-geo-model--geo-model-using-high-level-interface","name":"Geo Model Using High Level Interface","title":"ESV Intersection/Features/Geo Model","importPath":"./.storybook/src/features/geomodel-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-geo-model--geo-model-with-labels-using-high-level-interface":{"type":"story","id":"esv-intersection-features-geo-model--geo-model-with-labels-using-high-level-interface","name":"Geo Model With Labels Using High Level Interface","title":"ESV Intersection/Features/Geo Model","importPath":"./.storybook/src/features/geomodel-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-geo-model--geo-model-canvas-using-high-level-interface":{"type":"story","id":"esv-intersection-features-geo-model--geo-model-canvas-using-high-level-interface","name":"Geo Model Canvas Using High Level Interface","title":"ESV Intersection/Features/Geo Model","importPath":"./.storybook/src/features/geomodel-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-grid--grid-using-low-level-interface":{"type":"story","id":"esv-intersection-features-grid--grid-using-low-level-interface","name":"Grid Using Low Level Interface","title":"ESV Intersection/Features/Grid","importPath":"./.storybook/src/features/grid-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-grid--grid-using-high-level-interface":{"type":"story","id":"esv-intersection-features-grid--grid-using-high-level-interface","name":"Grid Using High Level Interface","title":"ESV Intersection/Features/Grid","importPath":"./.storybook/src/features/grid-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-highlight--highlight-wellborepath":{"type":"story","id":"esv-intersection-features-highlight--highlight-wellborepath","name":"Highlight Wellborepath","title":"ESV Intersection/Features/Highlight","importPath":"./.storybook/src/features/highlight.stories.ts","tags":["dev","test"]},"esv-intersection-features-highlight--highlight-wellborepath-with-controller":{"type":"story","id":"esv-intersection-features-highlight--highlight-wellborepath-with-controller","name":"Highlight Wellborepath With Controller","title":"ESV Intersection/Features/Highlight","importPath":"./.storybook/src/features/highlight.stories.ts","tags":["dev","test"]},"esv-intersection-features-schematic--schematic-layer-using-high-level-interface":{"type":"story","id":"esv-intersection-features-schematic--schematic-layer-using-high-level-interface","name":"Schematic Layer Using High Level Interface","title":"ESV Intersection/Features/Schematic","importPath":"./.storybook/src/features/schematic-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-seismic--seismic-using-low-level-interface":{"type":"story","id":"esv-intersection-features-seismic--seismic-using-low-level-interface","name":"Seismic Using Low Level Interface","title":"ESV Intersection/Features/Seismic","importPath":"./.storybook/src/features/seismic.stories.ts","tags":["dev","test"]},"esv-intersection-features-wellborepath--wellborepath-using-low-level-interface":{"type":"story","id":"esv-intersection-features-wellborepath--wellborepath-using-low-level-interface","name":"Wellborepath Using Low Level Interface","title":"ESV Intersection/Features/Wellborepath","importPath":"./.storybook/src/features/wellborepath-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-wellborepath--wellborepath-using-high-level-interface":{"type":"story","id":"esv-intersection-features-wellborepath--wellborepath-using-high-level-interface","name":"Wellborepath Using High Level Interface","title":"ESV Intersection/Features/Wellborepath","importPath":"./.storybook/src/features/wellborepath-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-zoom--zoom-with-test-layer":{"type":"story","id":"esv-intersection-features-zoom--zoom-with-test-layer","name":"Zoom With Test Layer","title":"ESV Intersection/Features/Zoom","importPath":"./.storybook/src/features/zoom.stories.ts","tags":["dev","test"]},"esv-intersection-features-zoom--zoom-with-grid-layer":{"type":"story","id":"esv-intersection-features-zoom--zoom-with-grid-layer","name":"Zoom With Grid Layer","title":"ESV Intersection/Features/Zoom","importPath":"./.storybook/src/features/zoom.stories.ts","tags":["dev","test"]},"esv-intersection-features-zoom--zoom-with-grid-and-axis":{"type":"story","id":"esv-intersection-features-zoom--zoom-with-grid-and-axis","name":"Zoom With Grid And Axis","title":"ESV Intersection/Features/Zoom","importPath":"./.storybook/src/features/zoom.stories.ts","tags":["dev","test"]},"esv-intersection-other-examples--basic-setup":{"type":"story","id":"esv-intersection-other-examples--basic-setup","name":"Basic Setup","title":"ESV Intersection/Other examples","importPath":"./.storybook/src/other-examples/basic-intersection.stories.ts","tags":["dev","test"]}}} +{"v":5,"entries":{"esv-intersection-complete-example--intersection":{"type":"story","id":"esv-intersection-complete-example--intersection","name":"Intersection","title":"ESV Intersection/Complete example","importPath":"./.storybook/src/complete-example/intersection.stories.ts","tags":["dev","test"]},"esv-intersection-complete-example--intersection-flip-x":{"type":"story","id":"esv-intersection-complete-example--intersection-flip-x","name":"Intersection Flip X","title":"ESV Intersection/Complete example","importPath":"./.storybook/src/complete-example/intersection.stories.ts","tags":["dev","test"]},"esv-intersection-features-axis--axis-using-low-level-interface":{"type":"story","id":"esv-intersection-features-axis--axis-using-low-level-interface","name":"Axis Using Low Level Interface","title":"ESV Intersection/Features/Axis","importPath":"./.storybook/src/features/axis.stories.ts","tags":["dev","test"]},"esv-intersection-features-axis--axis-using-high-level-interface":{"type":"story","id":"esv-intersection-features-axis--axis-using-high-level-interface","name":"Axis Using High Level Interface","title":"ESV Intersection/Features/Axis","importPath":"./.storybook/src/features/axis.stories.ts","tags":["dev","test"]},"esv-intersection-features-callout--callout-using-low-level-interface":{"type":"story","id":"esv-intersection-features-callout--callout-using-low-level-interface","name":"Callout Using Low Level Interface","title":"ESV Intersection/Features/Callout","importPath":"./.storybook/src/features/callout-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-callout--callout-using-high-level-interface":{"type":"story","id":"esv-intersection-features-callout--callout-using-high-level-interface","name":"Callout Using High Level Interface","title":"ESV Intersection/Features/Callout","importPath":"./.storybook/src/features/callout-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-geo-model--geo-model-using-low-level-interface":{"type":"story","id":"esv-intersection-features-geo-model--geo-model-using-low-level-interface","name":"Geo Model Using Low Level Interface","title":"ESV Intersection/Features/Geo Model","importPath":"./.storybook/src/features/geomodel-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-geo-model--geo-model-with-labels-using-low-level-interface":{"type":"story","id":"esv-intersection-features-geo-model--geo-model-with-labels-using-low-level-interface","name":"Geo Model With Labels Using Low Level Interface","title":"ESV Intersection/Features/Geo Model","importPath":"./.storybook/src/features/geomodel-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-geo-model--geo-model-using-high-level-interface":{"type":"story","id":"esv-intersection-features-geo-model--geo-model-using-high-level-interface","name":"Geo Model Using High Level Interface","title":"ESV Intersection/Features/Geo Model","importPath":"./.storybook/src/features/geomodel-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-geo-model--geo-model-with-labels-using-high-level-interface":{"type":"story","id":"esv-intersection-features-geo-model--geo-model-with-labels-using-high-level-interface","name":"Geo Model With Labels Using High Level Interface","title":"ESV Intersection/Features/Geo Model","importPath":"./.storybook/src/features/geomodel-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-geo-model--geo-model-canvas-using-high-level-interface":{"type":"story","id":"esv-intersection-features-geo-model--geo-model-canvas-using-high-level-interface","name":"Geo Model Canvas Using High Level Interface","title":"ESV Intersection/Features/Geo Model","importPath":"./.storybook/src/features/geomodel-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-grid--grid-using-low-level-interface":{"type":"story","id":"esv-intersection-features-grid--grid-using-low-level-interface","name":"Grid Using Low Level Interface","title":"ESV Intersection/Features/Grid","importPath":"./.storybook/src/features/grid-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-grid--grid-using-high-level-interface":{"type":"story","id":"esv-intersection-features-grid--grid-using-high-level-interface","name":"Grid Using High Level Interface","title":"ESV Intersection/Features/Grid","importPath":"./.storybook/src/features/grid-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-highlight--highlight-wellborepath":{"type":"story","id":"esv-intersection-features-highlight--highlight-wellborepath","name":"Highlight Wellborepath","title":"ESV Intersection/Features/Highlight","importPath":"./.storybook/src/features/highlight.stories.ts","tags":["dev","test"]},"esv-intersection-features-highlight--highlight-wellborepath-with-controller":{"type":"story","id":"esv-intersection-features-highlight--highlight-wellborepath-with-controller","name":"Highlight Wellborepath With Controller","title":"ESV Intersection/Features/Highlight","importPath":"./.storybook/src/features/highlight.stories.ts","tags":["dev","test"]},"esv-intersection-features-schematic--schematic-layer-using-high-level-interface":{"type":"story","id":"esv-intersection-features-schematic--schematic-layer-using-high-level-interface","name":"Schematic Layer Using High Level Interface","title":"ESV Intersection/Features/Schematic","importPath":"./.storybook/src/features/schematic-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-seismic--seismic-using-low-level-interface":{"type":"story","id":"esv-intersection-features-seismic--seismic-using-low-level-interface","name":"Seismic Using Low Level Interface","title":"ESV Intersection/Features/Seismic","importPath":"./.storybook/src/features/seismic.stories.ts","tags":["dev","test"]},"esv-intersection-features-wellborepath--wellborepath-using-low-level-interface":{"type":"story","id":"esv-intersection-features-wellborepath--wellborepath-using-low-level-interface","name":"Wellborepath Using Low Level Interface","title":"ESV Intersection/Features/Wellborepath","importPath":"./.storybook/src/features/wellborepath-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-wellborepath--wellborepath-using-high-level-interface":{"type":"story","id":"esv-intersection-features-wellborepath--wellborepath-using-high-level-interface","name":"Wellborepath Using High Level Interface","title":"ESV Intersection/Features/Wellborepath","importPath":"./.storybook/src/features/wellborepath-layer.stories.ts","tags":["dev","test"]},"esv-intersection-features-zoom--zoom-with-test-layer":{"type":"story","id":"esv-intersection-features-zoom--zoom-with-test-layer","name":"Zoom With Test Layer","title":"ESV Intersection/Features/Zoom","importPath":"./.storybook/src/features/zoom.stories.ts","tags":["dev","test"]},"esv-intersection-features-zoom--zoom-with-grid-layer":{"type":"story","id":"esv-intersection-features-zoom--zoom-with-grid-layer","name":"Zoom With Grid Layer","title":"ESV Intersection/Features/Zoom","importPath":"./.storybook/src/features/zoom.stories.ts","tags":["dev","test"]},"esv-intersection-features-zoom--zoom-with-grid-and-axis":{"type":"story","id":"esv-intersection-features-zoom--zoom-with-grid-and-axis","name":"Zoom With Grid And Axis","title":"ESV Intersection/Features/Zoom","importPath":"./.storybook/src/features/zoom.stories.ts","tags":["dev","test"]},"esv-intersection-other-examples--basic-setup":{"type":"story","id":"esv-intersection-other-examples--basic-setup","name":"Basic Setup","title":"ESV Intersection/Other examples","importPath":"./.storybook/src/other-examples/basic-intersection.stories.ts","tags":["dev","test"]}}} \ No newline at end of file diff --git a/storybook/master/interfaces.d.ts b/storybook/master/interfaces.d.ts index 8cf1543c..2f4016c4 100644 --- a/storybook/master/interfaces.d.ts +++ b/storybook/master/interfaces.d.ts @@ -1,6 +1,6 @@ import { ZoomTransform } from 'd3-zoom'; import { Graphics } from 'pixi.js'; -import Vector2 from '@equinor/videx-vector2'; +import { default as Vector2 } from '@equinor/videx-vector2'; import { ScaleLinear } from 'd3-scale'; import { ExtendedCurveInterpolator } from './control/ExtendedCurveInterpolator'; import { CurveInterpolator } from 'curve-interpolator'; diff --git a/storybook/master/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.d.ts b/storybook/master/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.d.ts index 8a4521ba..6ba52eda 100644 --- a/storybook/master/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.d.ts +++ b/storybook/master/layers/CustomDisplayObjects/UniformTextureStretchRopeGeometry.d.ts @@ -1,5 +1,4 @@ -import { MeshGeometry } from 'pixi.js'; -import type { IPoint } from 'pixi.js'; +import { MeshGeometry, IPoint } from 'pixi.js'; /** * UniformTextureStretchRopeGeometry allows you to draw a geometry across several points and then manipulate these points. */ diff --git a/storybook/master/layers/GeomodelLabelsLayer.d.ts b/storybook/master/layers/GeomodelLabelsLayer.d.ts index 18fff3fe..bb6b87cd 100644 --- a/storybook/master/layers/GeomodelLabelsLayer.d.ts +++ b/storybook/master/layers/GeomodelLabelsLayer.d.ts @@ -1,4 +1,4 @@ -import Vector2 from '@equinor/videx-vector2'; +import { default as Vector2 } from '@equinor/videx-vector2'; import { CanvasLayer } from './base/CanvasLayer'; import { OnUpdateEvent, OnRescaleEvent, OnMountEvent } from '../interfaces'; import { SurfaceArea, SurfaceLine, SurfaceData } from '../datautils'; diff --git a/storybook/master/project.json b/storybook/master/project.json index 3116c128..30c904c8 100644 --- a/storybook/master/project.json +++ b/storybook/master/project.json @@ -1 +1 @@ -{"generatedAt":1732098446131,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":true,"hasStorybookEslint":true,"refCount":0,"testPackages":{"vitest":"0.34.6","vitest-canvas-mock":null},"packageManager":{"type":"npm","version":"10.8.2"},"framework":{"name":"@storybook/html-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/html","portableStoriesFileCount":0,"language":"typescript","storybookPackages":{"@storybook/html-vite":{"version":"8.3.5"},"eslint-plugin-storybook":{"version":"0.9.0"},"storybook":{"version":"8.3.5"}},"addons":{"@storybook/addon-storysource":{"version":"8.3.5"},"storybook-dark-mode":{"version":"4.0.2"}}} +{"generatedAt":1737467581514,"hasCustomBabel":false,"hasCustomWebpack":false,"hasStaticDirs":true,"hasStorybookEslint":true,"refCount":0,"testPackages":{"vitest":"0.34.6","vitest-canvas-mock":null},"packageManager":{"type":"npm","version":"10.8.2"},"framework":{"name":"@storybook/html-vite","options":{}},"builder":"@storybook/builder-vite","renderer":"@storybook/html","portableStoriesFileCount":0,"language":"typescript","storybookPackages":{"@storybook/html-vite":{"version":"8.4.7"},"eslint-plugin-storybook":{"version":"0.9.0"},"storybook":{"version":"8.4.7"}},"addons":{"@storybook/addon-storysource":{"version":"8.4.7"},"storybook-dark-mode":{"version":"4.0.2"}}} \ No newline at end of file diff --git a/storybook/master/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js b/storybook/master/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js index 92f5dd46..de4e48be 100644 --- a/storybook/master/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js +++ b/storybook/master/sb-addons/storybook-core-core-server-presets-0/common-manager-bundle.js @@ -1,3 +1,3 @@ try{ -(()=>{var T=__STORYBOOK_API__,{ActiveTabs:_,Consumer:g,ManagerContext:O,Provider:f,RequestResponseError:A,addons:n,combineParameters:v,controlOrMetaKey:P,controlOrMetaSymbol:k,eventMatchesShortcut:x,eventToShortcut:M,experimental_requestResponse:R,isMacLike:w,isShortcutTaken:C,keyToSymbol:G,merge:I,mockChannel:K,optionOrAltSymbol:q,shortcutMatchesShortcut:B,shortcutToHumanString:F,types:Y,useAddonState:j,useArgTypes:E,useArgs:H,useChannel:L,useGlobalTypes:N,useGlobals:z,useParameter:D,useSharedState:J,useStoryPrepared:Q,useStorybookApi:U,useStorybookState:V}=__STORYBOOK_API__;var S=(()=>{let e;return typeof window<"u"?e=window:typeof globalThis<"u"?e=globalThis:typeof window<"u"?e=window:typeof self<"u"?e=self:e={},e})(),u="static-filter";n.register(u,e=>{let i=Object.entries(S.TAGS_OPTIONS??{}).reduce((t,r)=>{let[o,c]=r;return c.excludeFromSidebar&&(t[o]=!0),t},{});e.experimental_setFilter(u,t=>{let r=t.tags??[];return(r.includes("dev")||t.type==="docs")&&r.filter(o=>i[o]).length===0})});})(); +(()=>{var T=__STORYBOOK_API__,{ActiveTabs:_,Consumer:O,ManagerContext:f,Provider:A,RequestResponseError:v,addons:n,combineParameters:P,controlOrMetaKey:k,controlOrMetaSymbol:x,eventMatchesShortcut:M,eventToShortcut:R,experimental_requestResponse:w,isMacLike:C,isShortcutTaken:G,keyToSymbol:I,merge:K,mockChannel:q,optionOrAltSymbol:B,shortcutMatchesShortcut:F,shortcutToHumanString:Y,types:j,useAddonState:E,useArgTypes:H,useArgs:L,useChannel:N,useGlobalTypes:z,useGlobals:D,useParameter:J,useSharedState:Q,useStoryPrepared:U,useStorybookApi:V,useStorybookState:W}=__STORYBOOK_API__;var c=(()=>{let e;return typeof window<"u"?e=window:typeof globalThis<"u"?e=globalThis:typeof window<"u"?e=window:typeof self<"u"?e=self:e={},e})(),S="tag-filters",d="static-filter";n.register(S,e=>{let u=Object.entries(c.TAGS_OPTIONS??{}).reduce((t,r)=>{let[o,i]=r;return i.excludeFromSidebar&&(t[o]=!0),t},{});e.experimental_setFilter(d,t=>{let r=t.tags??[];return(r.includes("dev")||t.type==="docs")&&r.filter(o=>u[o]).length===0})});})(); }catch(e){ console.error("[Storybook] One of your manager-entries failed: " + import.meta.url, e); } diff --git a/storybook/master/sb-addons/storybook-dark-mode-esm-preset-2/manager-bundle.js b/storybook/master/sb-addons/storybook-dark-mode-esm-preset-2/manager-bundle.js index 635aa282..cd1d5575 100644 --- a/storybook/master/sb-addons/storybook-dark-mode-esm-preset-2/manager-bundle.js +++ b/storybook/master/sb-addons/storybook-dark-mode-esm-preset-2/manager-bundle.js @@ -1,5 +1,5 @@ try{ -(()=>{var Te=Object.create;var Q=Object.defineProperty;var ye=Object.getOwnPropertyDescriptor;var Re=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty;var U=(o,e)=>()=>(o&&(e=o(o=0)),e);var ge=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var ve=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Re(e))!Ae.call(o,n)&&n!==r&&Q(o,n,{get:()=>e[n],enumerable:!(t=ye(e,n))||t.enumerable});return o};var Ce=(o,e,r)=>(r=o!=null?Te(he(o)):{},ve(e||!o||!o.__esModule?Q(r,"default",{value:o,enumerable:!0}):r,o));var c=U(()=>{});var a=U(()=>{});var i=U(()=>{});var ce=ge((ju,ne)=>{"use strict";c();a();i();ne.exports=function o(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var t,n,l;if(Array.isArray(e)){if(t=e.length,t!=r.length)return!1;for(n=t;n--!==0;)if(!o(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(l=Object.keys(e),t=l.length,t!==Object.keys(r).length)return!1;for(n=t;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,l[n]))return!1;for(n=t;n--!==0;){var u=l[n];if(!o(e[u],r[u]))return!1}return!0}return e!==e&&r!==r}});c();a();i();c();a();i();c();a();i();var ze=__STORYBOOK_API__,{ActiveTabs:eo,Consumer:oo,ManagerContext:ro,Provider:to,RequestResponseError:no,addons:k,combineParameters:co,controlOrMetaKey:ao,controlOrMetaSymbol:io,eventMatchesShortcut:lo,eventToShortcut:uo,experimental_requestResponse:so,isMacLike:Io,isShortcutTaken:fo,keyToSymbol:So,merge:po,mockChannel:mo,optionOrAltSymbol:Eo,shortcutMatchesShortcut:_o,shortcutToHumanString:Oo,types:To,useAddonState:yo,useArgTypes:Ro,useArgs:ho,useChannel:Ao,useGlobalTypes:go,useGlobals:vo,useParameter:X,useSharedState:Co,useStoryPrepared:bo,useStorybookApi:Po,useStorybookState:Do}=__STORYBOOK_API__;c();a();i();var Bo=__STORYBOOK_TYPES__,{Addon_TypesEnum:Z}=__STORYBOOK_TYPES__;c();a();i();var Yo=__STORYBOOK_THEMING__,{CacheProvider:Go,ClassNames:Wo,Global:jo,ThemeProvider:Fo,background:Ko,color:Vo,convert:qo,create:Qo,createCache:Xo,createGlobal:Zo,createReset:$o,css:Jo,darken:zo,ensure:er,ignoreSsrWarning:or,isPropValid:rr,jsx:tr,keyframes:nr,lighten:cr,styled:ar,themes:v,typography:ir,useTheme:lr,withTheme:ur}=__STORYBOOK_THEMING__;c();a();i();var pr=__REACT__,{Children:dr,Component:mr,Fragment:Er,Profiler:_r,PureComponent:Or,StrictMode:Tr,Suspense:yr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Rr,cloneElement:hr,createContext:Ar,createElement:A,createFactory:gr,createRef:vr,forwardRef:Cr,isValidElement:br,lazy:Pr,memo:Dr,startTransition:Nr,unstable_act:wr,useCallback:L,useContext:kr,useDebugValue:Lr,useDeferredValue:Br,useEffect:C,useId:Mr,useImperativeHandle:Hr,useInsertionEffect:Ur,useLayoutEffect:xr,useMemo:$,useReducer:Yr,useRef:Gr,useState:J,useSyncExternalStore:Wr,useTransition:jr,version:Fr}=__REACT__;c();a();i();c();a();i();var ee=(()=>{let o;return typeof window<"u"?o=window:typeof globalThis<"u"?o=globalThis:typeof window<"u"?o=window:typeof self<"u"?o=self:o={},o})();c();a();i();var Jr=__STORYBOOK_COMPONENTS__,{A:zr,ActionBar:et,AddonPanel:ot,Badge:rt,Bar:tt,Blockquote:nt,Button:ct,ClipboardCode:at,Code:it,DL:lt,Div:ut,DocumentWrapper:st,EmptyTabContent:It,ErrorFormatter:ft,FlexBar:St,Form:pt,H1:dt,H2:mt,H3:Et,H4:_t,H5:Ot,H6:Tt,HR:yt,IconButton:oe,IconButtonSkeleton:Rt,Icons:ht,Img:At,LI:gt,Link:vt,ListItem:Ct,Loader:bt,Modal:Pt,OL:Dt,P:Nt,Placeholder:wt,Pre:kt,ResetWrapper:Lt,ScrollArea:Bt,Separator:Mt,Spaced:Ht,Span:Ut,StorybookIcon:xt,StorybookLogo:Yt,Symbols:Gt,SyntaxHighlighter:Wt,TT:jt,TabBar:Ft,TabButton:Kt,TabWrapper:Vt,Table:qt,Tabs:Qt,TabsState:Xt,TooltipLinkList:Zt,TooltipMessage:$t,TooltipNote:Jt,UL:zt,WithTooltip:en,WithTooltipPure:on,Zoom:rn,codeCommon:tn,components:nn,createCopyToClipboardFunction:cn,getStoryHref:an,icons:ln,interleaveSeparators:un,nameSpaceClassNames:sn,resetComponents:In,withReset:fn}=__STORYBOOK_COMPONENTS__;c();a();i();var En=__STORYBOOK_ICONS__,{AccessibilityAltIcon:_n,AccessibilityIcon:On,AddIcon:Tn,AdminIcon:yn,AlertAltIcon:Rn,AlertIcon:hn,AlignLeftIcon:An,AlignRightIcon:gn,AppleIcon:vn,ArrowBottomLeftIcon:Cn,ArrowBottomRightIcon:bn,ArrowDownIcon:Pn,ArrowLeftIcon:Dn,ArrowRightIcon:Nn,ArrowSolidDownIcon:wn,ArrowSolidLeftIcon:kn,ArrowSolidRightIcon:Ln,ArrowSolidUpIcon:Bn,ArrowTopLeftIcon:Mn,ArrowTopRightIcon:Hn,ArrowUpIcon:Un,AzureDevOpsIcon:xn,BackIcon:Yn,BasketIcon:Gn,BatchAcceptIcon:Wn,BatchDenyIcon:jn,BeakerIcon:Fn,BellIcon:Kn,BitbucketIcon:Vn,BoldIcon:qn,BookIcon:Qn,BookmarkHollowIcon:Xn,BookmarkIcon:Zn,BottomBarIcon:$n,BottomBarToggleIcon:Jn,BoxIcon:zn,BranchIcon:ec,BrowserIcon:oc,ButtonIcon:rc,CPUIcon:tc,CalendarIcon:nc,CameraIcon:cc,CategoryIcon:ac,CertificateIcon:ic,ChangedIcon:lc,ChatIcon:uc,CheckIcon:sc,ChevronDownIcon:Ic,ChevronLeftIcon:fc,ChevronRightIcon:Sc,ChevronSmallDownIcon:pc,ChevronSmallLeftIcon:dc,ChevronSmallRightIcon:mc,ChevronSmallUpIcon:Ec,ChevronUpIcon:_c,ChromaticIcon:Oc,ChromeIcon:Tc,CircleHollowIcon:yc,CircleIcon:Rc,ClearIcon:hc,CloseAltIcon:Ac,CloseIcon:gc,CloudHollowIcon:vc,CloudIcon:Cc,CogIcon:bc,CollapseIcon:Pc,CommandIcon:Dc,CommentAddIcon:Nc,CommentIcon:wc,CommentsIcon:kc,CommitIcon:Lc,CompassIcon:Bc,ComponentDrivenIcon:Mc,ComponentIcon:Hc,ContrastIcon:Uc,ControlsIcon:xc,CopyIcon:Yc,CreditIcon:Gc,CrossIcon:Wc,DashboardIcon:jc,DatabaseIcon:Fc,DeleteIcon:Kc,DiamondIcon:Vc,DirectionIcon:qc,DiscordIcon:Qc,DocChartIcon:Xc,DocListIcon:Zc,DocumentIcon:$c,DownloadIcon:Jc,DragIcon:zc,EditIcon:ea,EllipsisIcon:oa,EmailIcon:ra,ExpandAltIcon:ta,ExpandIcon:na,EyeCloseIcon:ca,EyeIcon:aa,FaceHappyIcon:ia,FaceNeutralIcon:la,FaceSadIcon:ua,FacebookIcon:sa,FailedIcon:Ia,FastForwardIcon:fa,FigmaIcon:Sa,FilterIcon:pa,FlagIcon:da,FolderIcon:ma,FormIcon:Ea,GDriveIcon:_a,GithubIcon:Oa,GitlabIcon:Ta,GlobeIcon:ya,GoogleIcon:Ra,GraphBarIcon:ha,GraphLineIcon:Aa,GraphqlIcon:ga,GridAltIcon:va,GridIcon:Ca,GrowIcon:ba,HeartHollowIcon:Pa,HeartIcon:Da,HomeIcon:Na,HourglassIcon:wa,InfoIcon:ka,ItalicIcon:La,JumpToIcon:Ba,KeyIcon:Ma,LightningIcon:Ha,LightningOffIcon:Ua,LinkBrokenIcon:xa,LinkIcon:Ya,LinkedinIcon:Ga,LinuxIcon:Wa,ListOrderedIcon:ja,ListUnorderedIcon:Fa,LocationIcon:Ka,LockIcon:Va,MarkdownIcon:qa,MarkupIcon:Qa,MediumIcon:Xa,MemoryIcon:Za,MenuIcon:$a,MergeIcon:Ja,MirrorIcon:za,MobileIcon:ei,MoonIcon:re,NutIcon:oi,OutboxIcon:ri,OutlineIcon:ti,PaintBrushIcon:ni,PaperClipIcon:ci,ParagraphIcon:ai,PassedIcon:ii,PhoneIcon:li,PhotoDragIcon:ui,PhotoIcon:si,PinAltIcon:Ii,PinIcon:fi,PlayBackIcon:Si,PlayIcon:pi,PlayNextIcon:di,PlusIcon:mi,PointerDefaultIcon:Ei,PointerHandIcon:_i,PowerIcon:Oi,PrintIcon:Ti,ProceedIcon:yi,ProfileIcon:Ri,PullRequestIcon:hi,QuestionIcon:Ai,RSSIcon:gi,RedirectIcon:vi,ReduxIcon:Ci,RefreshIcon:bi,ReplyIcon:Pi,RepoIcon:Di,RequestChangeIcon:Ni,RewindIcon:wi,RulerIcon:ki,SearchIcon:Li,ShareAltIcon:Bi,ShareIcon:Mi,ShieldIcon:Hi,SideBySideIcon:Ui,SidebarAltIcon:xi,SidebarAltToggleIcon:Yi,SidebarIcon:Gi,SidebarToggleIcon:Wi,SpeakerIcon:ji,StackedIcon:Fi,StarHollowIcon:Ki,StarIcon:Vi,StatusFailIcon:qi,StatusPassIcon:Qi,StatusWarnIcon:Xi,StickerIcon:Zi,StopAltIcon:$i,StopIcon:Ji,StorybookIcon:zi,StructureIcon:el,SubtractIcon:ol,SunIcon:te,SupportIcon:rl,SwitchAltIcon:tl,SyncIcon:nl,TabletIcon:cl,ThumbsUpIcon:al,TimeIcon:il,TimerIcon:ll,TransferIcon:ul,TrashIcon:sl,TwitterIcon:Il,TypeIcon:fl,UbuntuIcon:Sl,UndoIcon:pl,UnfoldIcon:dl,UnlockIcon:ml,UnpinIcon:El,UploadIcon:_l,UserAddIcon:Ol,UserAltIcon:Tl,UserIcon:yl,UsersIcon:Rl,VSCodeIcon:hl,VerifiedIcon:Al,VideoIcon:gl,WandIcon:vl,WatchIcon:Cl,WindowsIcon:bl,WrenchIcon:Pl,XIcon:Dl,YoutubeIcon:Nl,ZoomIcon:wl,ZoomOutIcon:kl,ZoomResetIcon:Ll,iconList:Bl}=__STORYBOOK_ICONS__;c();a();i();var Yl=__STORYBOOK_CORE_EVENTS__,{ARGTYPES_INFO_REQUEST:Gl,ARGTYPES_INFO_RESPONSE:Wl,CHANNEL_CREATED:jl,CHANNEL_WS_DISCONNECT:Fl,CONFIG_ERROR:Kl,CREATE_NEW_STORYFILE_REQUEST:Vl,CREATE_NEW_STORYFILE_RESPONSE:ql,CURRENT_STORY_WAS_SET:Ql,DOCS_PREPARED:Xl,DOCS_RENDERED:x,FILE_COMPONENT_SEARCH_REQUEST:Zl,FILE_COMPONENT_SEARCH_RESPONSE:$l,FORCE_REMOUNT:Jl,FORCE_RE_RENDER:zl,GLOBALS_UPDATED:eu,NAVIGATE_URL:ou,PLAY_FUNCTION_THREW_EXCEPTION:ru,PRELOAD_ENTRIES:tu,PREVIEW_BUILDER_PROGRESS:nu,PREVIEW_KEYDOWN:cu,REGISTER_SUBSCRIPTION:au,REQUEST_WHATS_NEW_DATA:iu,RESET_STORY_ARGS:lu,RESULT_WHATS_NEW_DATA:uu,SAVE_STORY_REQUEST:su,SAVE_STORY_RESPONSE:Iu,SELECT_STORY:fu,SET_CONFIG:Su,SET_CURRENT_STORY:pu,SET_FILTER:du,SET_GLOBALS:mu,SET_INDEX:Eu,SET_STORIES:Y,SET_WHATS_NEW_CACHE:_u,SHARED_STATE_CHANGED:Ou,SHARED_STATE_SET:Tu,STORIES_COLLAPSE_ALL:yu,STORIES_EXPAND_ALL:Ru,STORY_ARGS_UPDATED:hu,STORY_CHANGED:G,STORY_ERRORED:Au,STORY_INDEX_INVALIDATED:gu,STORY_MISSING:vu,STORY_PREPARED:Cu,STORY_RENDERED:bu,STORY_RENDER_PHASE_CHANGED:Pu,STORY_SPECIFIED:Du,STORY_THREW_EXCEPTION:Nu,STORY_UNCHANGED:wu,TELEMETRY_ERROR:ku,TOGGLE_WHATS_NEW_NOTIFICATIONS:Lu,UNHANDLED_ERRORS_WHILE_PLAYING:Bu,UPDATE_GLOBALS:Mu,UPDATE_QUERY_PARAMS:Hu,UPDATE_STORY_ARGS:Uu}=__STORYBOOK_CORE_EVENTS__;var K=Ce(ce());c();a();i();var ae="DARK_MODE",W="UPDATE_DARK_MODE";function P(o){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(o)}var be=["current","stylePreview"],j;function Pe(o,e){if(o==null)return{};var r=De(o,e),t,n;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(o);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(o,t)&&(r[t]=o[t])}return r}function De(o,e){if(o==null)return{};var r={},t=Object.keys(o),n,l;for(l=0;l=0)&&(r[n]=o[n]);return r}function Ne(o,e){return Le(o)||ke(o,e)||le(o,e)||we()}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ke(o,e){var r=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(r!=null){var t,n,l,u,d=[],E=!0,T=!1;try{if(l=(r=r.call(o)).next,e===0){if(Object(r)!==r)return;E=!1}else for(;!(E=(t=l.call(r)).done)&&(d.push(t.value),d.length!==e);E=!0);}catch(s){T=!0,n=s}finally{try{if(!E&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(T)throw n}}return d}}function Le(o){if(Array.isArray(o))return o}function ie(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);e&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),r.push.apply(r,t)}return r}function _(o){for(var e=1;eo.length)&&(e=o.length);for(var r=0,t=new Array(e);r0&&arguments[0]!==void 0?arguments[0]:{},r=H.localStorage.getItem(Ie);if(typeof r=="string"){var t=JSON.parse(r);return e&&(e.dark&&!(0,K.default)(t.dark,e.dark)&&(t.dark=e.dark,b(t)),e.light&&!(0,K.default)(t.light,e.light)&&(t.light=e.light,b(t))),t}return _(_({},V),e)};Se(O());function We(o){var e=o.api,r=J(g.matches),t=Ne(r,2),n=t[0],l=t[1],u=X("darkMode",{}),d=u.current,E=u.stylePreview,T=Pe(u,be),s=e.getChannel(),h=$(function(){return O(T).userHasExplicitlySetTheTheme},[T]),N=L(function(I){var m=O();e.setOptions({theme:m[I]}),l(I==="dark"),e.getChannel().emit(ae,I==="dark"),Se(m),E&&Ge(m)},[e,E]),R=L(function(I){var m=O(),w=I||(m.current==="dark"?"light":"dark");b(_(_({},m),{},{current:w})),N(w)},[N]);function q(I){h||d||R(I.matches?"dark":"light")}var y=L(function(){var I=O(),m=I.current,w=m===void 0?"light":m;N(w)},[N]),Oe=function(){R();var m=O();b(_(_({},m),{},{userHasExplicitlySetTheTheme:!0}))};return C(function(){var I=O();b(_(_(_({},I),u),{},{current:I.current||u.current})),y()},[u,y]),C(function(){return s.on(G,y),s.on(Y,y),s.on(x,y),g.addListener(q),function(){s.removeListener(G,y),s.removeListener(Y,y),s.removeListener(x,y),g.removeListener(q)}}),C(function(){return s.on(W,R),function(){s.removeListener(W,R)}}),C(function(){h||(d?R(d):g.matches&&R("dark"))},[d,R,h]),A(oe,{key:"dark-mode",title:n?"Change theme to light mode":"Change theme to dark mode",onClick:Oe},n?A(te,{"aria-hidden":"true"}):A(re,{"aria-hidden":"true"}))}var pe=We;function D(o){"@babel/helpers - typeof";return D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(o)}function de(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);e&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),r.push.apply(r,t)}return r}function me(o){for(var e=1;e{var Oe=Object.create;var q=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var he=Object.getPrototypeOf,Ae=Object.prototype.hasOwnProperty;var H=(o,e)=>()=>(o&&(e=o(o=0)),e);var ge=(o,e)=>()=>(e||o((e={exports:{}}).exports,e),e.exports);var Ce=(o,e,r,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ye(e))!Ae.call(o,n)&&n!==r&&q(o,n,{get:()=>e[n],enumerable:!(t=Re(e,n))||t.enumerable});return o};var ve=(o,e,r)=>(r=o!=null?Oe(he(o)):{},Ce(e||!o||!o.__esModule?q(r,"default",{value:o,enumerable:!0}):r,o));var c=H(()=>{});var a=H(()=>{});var i=H(()=>{});var ce=ge((es,ne)=>{"use strict";c();a();i();ne.exports=function o(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var t,n,l;if(Array.isArray(e)){if(t=e.length,t!=r.length)return!1;for(n=t;n--!==0;)if(!o(e[n],r[n]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(l=Object.keys(e),t=l.length,t!==Object.keys(r).length)return!1;for(n=t;n--!==0;)if(!Object.prototype.hasOwnProperty.call(r,l[n]))return!1;for(n=t;n--!==0;){var u=l[n];if(!o(e[u],r[u]))return!1}return!0}return e!==e&&r!==r}});c();a();i();c();a();i();c();a();i();var ze=__STORYBOOK_API__,{ActiveTabs:eo,Consumer:oo,ManagerContext:ro,Provider:to,RequestResponseError:no,addons:L,combineParameters:co,controlOrMetaKey:ao,controlOrMetaSymbol:io,eventMatchesShortcut:lo,eventToShortcut:uo,experimental_requestResponse:so,isMacLike:Io,isShortcutTaken:fo,keyToSymbol:So,merge:Eo,mockChannel:_o,optionOrAltSymbol:po,shortcutMatchesShortcut:mo,shortcutToHumanString:To,types:Oo,useAddonState:Ro,useArgTypes:yo,useArgs:ho,useChannel:Ao,useGlobalTypes:go,useGlobals:Co,useParameter:X,useSharedState:vo,useStoryPrepared:bo,useStorybookApi:Po,useStorybookState:Do}=__STORYBOOK_API__;c();a();i();var Mo=__STORYBOOK_TYPES__,{Addon_TypesEnum:Z}=__STORYBOOK_TYPES__;c();a();i();var xo=__STORYBOOK_THEMING__,{CacheProvider:Yo,ClassNames:Wo,Global:jo,ThemeProvider:Fo,background:Ko,color:Vo,convert:Qo,create:qo,createCache:Xo,createGlobal:Zo,createReset:$o,css:Jo,darken:zo,ensure:er,ignoreSsrWarning:or,isPropValid:rr,jsx:tr,keyframes:nr,lighten:cr,styled:ar,themes:C,typography:ir,useTheme:lr,withTheme:ur}=__STORYBOOK_THEMING__;c();a();i();var Er=__REACT__,{Children:_r,Component:pr,Fragment:dr,Profiler:mr,PureComponent:Tr,StrictMode:Or,Suspense:Rr,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:yr,cloneElement:hr,createContext:Ar,createElement:A,createFactory:gr,createRef:Cr,forwardRef:vr,isValidElement:br,lazy:Pr,memo:Dr,startTransition:Nr,unstable_act:wr,useCallback:k,useContext:Lr,useDebugValue:kr,useDeferredValue:Mr,useEffect:v,useId:Ur,useImperativeHandle:Br,useInsertionEffect:Hr,useLayoutEffect:Gr,useMemo:$,useReducer:xr,useRef:Yr,useState:J,useSyncExternalStore:Wr,useTransition:jr,version:Fr}=__REACT__;c();a();i();c();a();i();var ee=(()=>{let o;return typeof window<"u"?o=window:typeof globalThis<"u"?o=globalThis:typeof window<"u"?o=window:typeof self<"u"?o=self:o={},o})();c();a();i();var Jr=__STORYBOOK_COMPONENTS__,{A:zr,ActionBar:et,AddonPanel:ot,Badge:rt,Bar:tt,Blockquote:nt,Button:ct,ClipboardCode:at,Code:it,DL:lt,Div:ut,DocumentWrapper:st,EmptyTabContent:It,ErrorFormatter:ft,FlexBar:St,Form:Et,H1:_t,H2:pt,H3:dt,H4:mt,H5:Tt,H6:Ot,HR:Rt,IconButton:oe,IconButtonSkeleton:yt,Icons:ht,Img:At,LI:gt,Link:Ct,ListItem:vt,Loader:bt,Modal:Pt,OL:Dt,P:Nt,Placeholder:wt,Pre:Lt,ResetWrapper:kt,ScrollArea:Mt,Separator:Ut,Spaced:Bt,Span:Ht,StorybookIcon:Gt,StorybookLogo:xt,Symbols:Yt,SyntaxHighlighter:Wt,TT:jt,TabBar:Ft,TabButton:Kt,TabWrapper:Vt,Table:Qt,Tabs:qt,TabsState:Xt,TooltipLinkList:Zt,TooltipMessage:$t,TooltipNote:Jt,UL:zt,WithTooltip:en,WithTooltipPure:on,Zoom:rn,codeCommon:tn,components:nn,createCopyToClipboardFunction:cn,getStoryHref:an,icons:ln,interleaveSeparators:un,nameSpaceClassNames:sn,resetComponents:In,withReset:fn}=__STORYBOOK_COMPONENTS__;c();a();i();var dn=__STORYBOOK_ICONS__,{AccessibilityAltIcon:mn,AccessibilityIcon:Tn,AddIcon:On,AdminIcon:Rn,AlertAltIcon:yn,AlertIcon:hn,AlignLeftIcon:An,AlignRightIcon:gn,AppleIcon:Cn,ArrowBottomLeftIcon:vn,ArrowBottomRightIcon:bn,ArrowDownIcon:Pn,ArrowLeftIcon:Dn,ArrowRightIcon:Nn,ArrowSolidDownIcon:wn,ArrowSolidLeftIcon:Ln,ArrowSolidRightIcon:kn,ArrowSolidUpIcon:Mn,ArrowTopLeftIcon:Un,ArrowTopRightIcon:Bn,ArrowUpIcon:Hn,AzureDevOpsIcon:Gn,BackIcon:xn,BasketIcon:Yn,BatchAcceptIcon:Wn,BatchDenyIcon:jn,BeakerIcon:Fn,BellIcon:Kn,BitbucketIcon:Vn,BoldIcon:Qn,BookIcon:qn,BookmarkHollowIcon:Xn,BookmarkIcon:Zn,BottomBarIcon:$n,BottomBarToggleIcon:Jn,BoxIcon:zn,BranchIcon:ec,BrowserIcon:oc,ButtonIcon:rc,CPUIcon:tc,CalendarIcon:nc,CameraIcon:cc,CategoryIcon:ac,CertificateIcon:ic,ChangedIcon:lc,ChatIcon:uc,CheckIcon:sc,ChevronDownIcon:Ic,ChevronLeftIcon:fc,ChevronRightIcon:Sc,ChevronSmallDownIcon:Ec,ChevronSmallLeftIcon:_c,ChevronSmallRightIcon:pc,ChevronSmallUpIcon:dc,ChevronUpIcon:mc,ChromaticIcon:Tc,ChromeIcon:Oc,CircleHollowIcon:Rc,CircleIcon:yc,ClearIcon:hc,CloseAltIcon:Ac,CloseIcon:gc,CloudHollowIcon:Cc,CloudIcon:vc,CogIcon:bc,CollapseIcon:Pc,CommandIcon:Dc,CommentAddIcon:Nc,CommentIcon:wc,CommentsIcon:Lc,CommitIcon:kc,CompassIcon:Mc,ComponentDrivenIcon:Uc,ComponentIcon:Bc,ContrastIcon:Hc,ControlsIcon:Gc,CopyIcon:xc,CreditIcon:Yc,CrossIcon:Wc,DashboardIcon:jc,DatabaseIcon:Fc,DeleteIcon:Kc,DiamondIcon:Vc,DirectionIcon:Qc,DiscordIcon:qc,DocChartIcon:Xc,DocListIcon:Zc,DocumentIcon:$c,DownloadIcon:Jc,DragIcon:zc,EditIcon:ea,EllipsisIcon:oa,EmailIcon:ra,ExpandAltIcon:ta,ExpandIcon:na,EyeCloseIcon:ca,EyeIcon:aa,FaceHappyIcon:ia,FaceNeutralIcon:la,FaceSadIcon:ua,FacebookIcon:sa,FailedIcon:Ia,FastForwardIcon:fa,FigmaIcon:Sa,FilterIcon:Ea,FlagIcon:_a,FolderIcon:pa,FormIcon:da,GDriveIcon:ma,GithubIcon:Ta,GitlabIcon:Oa,GlobeIcon:Ra,GoogleIcon:ya,GraphBarIcon:ha,GraphLineIcon:Aa,GraphqlIcon:ga,GridAltIcon:Ca,GridIcon:va,GrowIcon:ba,HeartHollowIcon:Pa,HeartIcon:Da,HomeIcon:Na,HourglassIcon:wa,InfoIcon:La,ItalicIcon:ka,JumpToIcon:Ma,KeyIcon:Ua,LightningIcon:Ba,LightningOffIcon:Ha,LinkBrokenIcon:Ga,LinkIcon:xa,LinkedinIcon:Ya,LinuxIcon:Wa,ListOrderedIcon:ja,ListUnorderedIcon:Fa,LocationIcon:Ka,LockIcon:Va,MarkdownIcon:Qa,MarkupIcon:qa,MediumIcon:Xa,MemoryIcon:Za,MenuIcon:$a,MergeIcon:Ja,MirrorIcon:za,MobileIcon:ei,MoonIcon:re,NutIcon:oi,OutboxIcon:ri,OutlineIcon:ti,PaintBrushIcon:ni,PaperClipIcon:ci,ParagraphIcon:ai,PassedIcon:ii,PhoneIcon:li,PhotoDragIcon:ui,PhotoIcon:si,PinAltIcon:Ii,PinIcon:fi,PlayAllHollowIcon:Si,PlayBackIcon:Ei,PlayHollowIcon:_i,PlayIcon:pi,PlayNextIcon:di,PlusIcon:mi,PointerDefaultIcon:Ti,PointerHandIcon:Oi,PowerIcon:Ri,PrintIcon:yi,ProceedIcon:hi,ProfileIcon:Ai,PullRequestIcon:gi,QuestionIcon:Ci,RSSIcon:vi,RedirectIcon:bi,ReduxIcon:Pi,RefreshIcon:Di,ReplyIcon:Ni,RepoIcon:wi,RequestChangeIcon:Li,RewindIcon:ki,RulerIcon:Mi,SaveIcon:Ui,SearchIcon:Bi,ShareAltIcon:Hi,ShareIcon:Gi,ShieldIcon:xi,SideBySideIcon:Yi,SidebarAltIcon:Wi,SidebarAltToggleIcon:ji,SidebarIcon:Fi,SidebarToggleIcon:Ki,SpeakerIcon:Vi,StackedIcon:Qi,StarHollowIcon:qi,StarIcon:Xi,StatusFailIcon:Zi,StatusPassIcon:$i,StatusWarnIcon:Ji,StickerIcon:zi,StopAltHollowIcon:el,StopAltIcon:ol,StopIcon:rl,StorybookIcon:tl,StructureIcon:nl,SubtractIcon:cl,SunIcon:te,SupportIcon:al,SwitchAltIcon:il,SyncIcon:ll,TabletIcon:ul,ThumbsUpIcon:sl,TimeIcon:Il,TimerIcon:fl,TransferIcon:Sl,TrashIcon:El,TwitterIcon:_l,TypeIcon:pl,UbuntuIcon:dl,UndoIcon:ml,UnfoldIcon:Tl,UnlockIcon:Ol,UnpinIcon:Rl,UploadIcon:yl,UserAddIcon:hl,UserAltIcon:Al,UserIcon:gl,UsersIcon:Cl,VSCodeIcon:vl,VerifiedIcon:bl,VideoIcon:Pl,WandIcon:Dl,WatchIcon:Nl,WindowsIcon:wl,WrenchIcon:Ll,XIcon:kl,YoutubeIcon:Ml,ZoomIcon:Ul,ZoomOutIcon:Bl,ZoomResetIcon:Hl,iconList:Gl}=__STORYBOOK_ICONS__;c();a();i();var Fl=__STORYBOOK_CORE_EVENTS__,{ARGTYPES_INFO_REQUEST:Kl,ARGTYPES_INFO_RESPONSE:Vl,CHANNEL_CREATED:Ql,CHANNEL_WS_DISCONNECT:ql,CONFIG_ERROR:Xl,CREATE_NEW_STORYFILE_REQUEST:Zl,CREATE_NEW_STORYFILE_RESPONSE:$l,CURRENT_STORY_WAS_SET:Jl,DOCS_PREPARED:zl,DOCS_RENDERED:G,FILE_COMPONENT_SEARCH_REQUEST:eu,FILE_COMPONENT_SEARCH_RESPONSE:ou,FORCE_REMOUNT:ru,FORCE_RE_RENDER:tu,GLOBALS_UPDATED:nu,NAVIGATE_URL:cu,PLAY_FUNCTION_THREW_EXCEPTION:au,PRELOAD_ENTRIES:iu,PREVIEW_BUILDER_PROGRESS:lu,PREVIEW_KEYDOWN:uu,REGISTER_SUBSCRIPTION:su,REQUEST_WHATS_NEW_DATA:Iu,RESET_STORY_ARGS:fu,RESULT_WHATS_NEW_DATA:Su,SAVE_STORY_REQUEST:Eu,SAVE_STORY_RESPONSE:_u,SELECT_STORY:pu,SET_CONFIG:du,SET_CURRENT_STORY:mu,SET_FILTER:Tu,SET_GLOBALS:Ou,SET_INDEX:Ru,SET_STORIES:x,SET_WHATS_NEW_CACHE:yu,SHARED_STATE_CHANGED:hu,SHARED_STATE_SET:Au,STORIES_COLLAPSE_ALL:gu,STORIES_EXPAND_ALL:Cu,STORY_ARGS_UPDATED:vu,STORY_CHANGED:Y,STORY_ERRORED:bu,STORY_INDEX_INVALIDATED:Pu,STORY_MISSING:Du,STORY_PREPARED:Nu,STORY_RENDERED:wu,STORY_RENDER_PHASE_CHANGED:Lu,STORY_SPECIFIED:ku,STORY_THREW_EXCEPTION:Mu,STORY_UNCHANGED:Uu,TELEMETRY_ERROR:Bu,TESTING_MODULE_CANCEL_TEST_RUN_REQUEST:Hu,TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE:Gu,TESTING_MODULE_CRASH_REPORT:xu,TESTING_MODULE_PROGRESS_REPORT:Yu,TESTING_MODULE_RUN_ALL_REQUEST:Wu,TESTING_MODULE_RUN_REQUEST:ju,TESTING_MODULE_WATCH_MODE_REQUEST:Fu,TOGGLE_WHATS_NEW_NOTIFICATIONS:Ku,UNHANDLED_ERRORS_WHILE_PLAYING:Vu,UPDATE_GLOBALS:Qu,UPDATE_QUERY_PARAMS:qu,UPDATE_STORY_ARGS:Xu}=__STORYBOOK_CORE_EVENTS__;var K=ve(ce());c();a();i();var ae="DARK_MODE",W="UPDATE_DARK_MODE";function P(o){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(o)}var be=["current","stylePreview"],j;function Pe(o,e){if(o==null)return{};var r=De(o,e),t,n;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(o);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(o,t)&&(r[t]=o[t])}return r}function De(o,e){if(o==null)return{};var r={},t=Object.keys(o),n,l;for(l=0;l=0)&&(r[n]=o[n]);return r}function Ne(o,e){return ke(o)||Le(o,e)||le(o,e)||we()}function we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Le(o,e){var r=o==null?null:typeof Symbol<"u"&&o[Symbol.iterator]||o["@@iterator"];if(r!=null){var t,n,l,u,_=[],d=!0,O=!1;try{if(l=(r=r.call(o)).next,e===0){if(Object(r)!==r)return;d=!1}else for(;!(d=(t=l.call(r)).done)&&(_.push(t.value),_.length!==e);d=!0);}catch(s){O=!0,n=s}finally{try{if(!d&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(O)throw n}}return _}}function ke(o){if(Array.isArray(o))return o}function ie(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);e&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),r.push.apply(r,t)}return r}function m(o){for(var e=1;eo.length)&&(e=o.length);for(var r=0,t=new Array(e);r0&&arguments[0]!==void 0?arguments[0]:{},r=B.localStorage.getItem(Ie);if(typeof r=="string"){var t=JSON.parse(r);return e&&(e.dark&&!(0,K.default)(t.dark,e.dark)&&(t.dark=e.dark,b(t)),e.light&&!(0,K.default)(t.light,e.light)&&(t.light=e.light,b(t))),t}return m(m({},V),e)};Se(T());function We(o){var e=o.api,r=J(g.matches),t=Ne(r,2),n=t[0],l=t[1],u=X("darkMode",{}),_=u.current,d=u.stylePreview,O=Pe(u,be),s=e.getChannel(),h=$(function(){return T(O).userHasExplicitlySetTheTheme},[O]),N=k(function(I){var p=T();e.setOptions({theme:p[I]}),l(I==="dark"),e.getChannel().emit(ae,I==="dark"),Se(p),d&&Ye(p)},[e,d]),y=k(function(I){var p=T(),w=I||(p.current==="dark"?"light":"dark");b(m(m({},p),{},{current:w})),N(w)},[N]);function Q(I){h||_||y(I.matches?"dark":"light")}var R=k(function(){var I=T(),p=I.current,w=p===void 0?"light":p;N(w)},[N]),Te=function(){y();var p=T();b(m(m({},p),{},{userHasExplicitlySetTheTheme:!0}))};return v(function(){var I=T();b(m(m(m({},I),u),{},{current:I.current||u.current})),R()},[u,R]),v(function(){return s.on(Y,R),s.on(x,R),s.on(G,R),g.addListener(Q),function(){s.removeListener(Y,R),s.removeListener(x,R),s.removeListener(G,R),g.removeListener(Q)}}),v(function(){return s.on(W,y),function(){s.removeListener(W,y)}}),v(function(){h||(_?y(_):g.matches&&y("dark"))},[_,y,h]),A(oe,{key:"dark-mode",title:n?"Change theme to light mode":"Change theme to dark mode",onClick:Te},n?A(te,{"aria-hidden":"true"}):A(re,{"aria-hidden":"true"}))}var Ee=We;function D(o){"@babel/helpers - typeof";return D=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D(o)}function _e(o,e){var r=Object.keys(o);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(o);e&&(t=t.filter(function(n){return Object.getOwnPropertyDescriptor(o,n).enumerable})),r.push.apply(r,t)}return r}function pe(o){for(var e=1;e{var g=__REACT__,{Children:ht,Component:_t,Fragment:Ot,Profiler:vt,PureComponent:Pt,StrictMode:Tt,Suspense:Et,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Lt,cloneElement:kt,createContext:Rt,createElement:Ct,createFactory:Nt,createRef:wt,forwardRef:xt,isValidElement:jt,lazy:It,memo:Bt,startTransition:At,unstable_act:Dt,useCallback:Mt,useContext:Ht,useDebugValue:Kt,useDeferredValue:Yt,useEffect:Ft,useId:Wt,useImperativeHandle:$t,useInsertionEffect:qt,useLayoutEffect:Gt,useMemo:Ut,useReducer:Vt,useRef:rt,useState:zt,useSyncExternalStore:Qt,useTransition:Jt,version:Zt}=__REACT__;var ec=__STORYBOOK_API__,{ActiveTabs:nc,Consumer:ac,ManagerContext:sc,Provider:ic,RequestResponseError:uc,addons:w,combineParameters:lc,controlOrMetaKey:pc,controlOrMetaSymbol:dc,eventMatchesShortcut:mc,eventToShortcut:yc,experimental_requestResponse:fc,isMacLike:gc,isShortcutTaken:Sc,keyToSymbol:bc,merge:hc,mockChannel:_c,optionOrAltSymbol:Oc,shortcutMatchesShortcut:vc,shortcutToHumanString:Pc,types:D,useAddonState:Tc,useArgTypes:Ec,useArgs:Lc,useChannel:kc,useGlobalTypes:Rc,useGlobals:Cc,useParameter:x,useSharedState:Nc,useStoryPrepared:wc,useStorybookApi:xc,useStorybookState:jc}=__STORYBOOK_API__;var Mc=__STORYBOOK_COMPONENTS__,{A:Hc,ActionBar:Kc,AddonPanel:Yc,Badge:Fc,Bar:Wc,Blockquote:$c,Button:qc,ClipboardCode:Gc,Code:Uc,DL:Vc,Div:rc,DocumentWrapper:zc,EmptyTabContent:Qc,ErrorFormatter:Jc,FlexBar:Zc,Form:Xc,H1:to,H2:co,H3:oo,H4:eo,H5:no,H6:ao,HR:so,IconButton:io,IconButtonSkeleton:uo,Icons:lo,Img:po,LI:mo,Link:yo,ListItem:fo,Loader:go,Modal:So,OL:bo,P:ho,Placeholder:_o,Pre:Oo,ResetWrapper:vo,ScrollArea:Po,Separator:To,Spaced:Eo,Span:Lo,StorybookIcon:ko,StorybookLogo:Ro,Symbols:Co,SyntaxHighlighter:M,TT:No,TabBar:wo,TabButton:xo,TabWrapper:jo,Table:Io,Tabs:Bo,TabsState:Ao,TooltipLinkList:Do,TooltipMessage:Mo,TooltipNote:Ho,UL:Ko,WithTooltip:Yo,WithTooltipPure:Fo,Zoom:Wo,codeCommon:$o,components:qo,createCopyToClipboardFunction:Go,getStoryHref:Uo,icons:Vo,interleaveSeparators:ro,nameSpaceClassNames:zo,resetComponents:Qo,withReset:Jo}=__STORYBOOK_COMPONENTS__;var oe=__STORYBOOK_ROUTER__,{BaseLocationProvider:ee,DEEPLY_EQUAL:ne,Link:H,Location:ae,LocationProvider:se,Match:ie,Route:ue,buildArgsParam:le,deepDiff:pe,getMatch:de,parsePath:me,queryFromLocation:ye,queryFromString:fe,stringifyQuery:ge,useNavigate:Se}=__STORYBOOK_ROUTER__;var ve=__STORYBOOK_THEMING__,{CacheProvider:Pe,ClassNames:Te,Global:Ee,ThemeProvider:Le,background:ke,color:Re,convert:Ce,create:Ne,createCache:we,createGlobal:xe,createReset:je,css:Ie,darken:Be,ensure:Ae,ignoreSsrWarning:De,isPropValid:Me,jsx:He,keyframes:Ke,lighten:Ye,styled:k,themes:Fe,typography:We,useTheme:$e,withTheme:qe}=__STORYBOOK_THEMING__;var r=!0,j="Invariant failed";function K(t,c){if(!t){if(r)throw new Error(j);var o=typeof c=="function"?c():c,e=o?"".concat(j,": ").concat(o):j;throw new Error(e)}}function P(t){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},P(t)}function z(t,c){if(P(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var e=o.call(t,c||"default");if(P(e)!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(t)}function Q(t){var c=z(t,"string");return P(c)=="symbol"?c:c+""}function J(t,c,o){return(c=Q(c))in t?Object.defineProperty(t,c,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[c]=o,t}function B(){return B=Object.assign?Object.assign.bind():function(t){for(var c=1;c=4)return[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]}var I={};function X(t){if(t.length===0||t.length===1)return t;var c=t.join(".");return I[c]||(I[c]=Z(t)),I[c]}function tt(t){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,e=t.filter(function(m){return m!=="token"}),n=X(e);return n.reduce(function(m,v){return O(O({},m),o[v])},c)}function F(t){return t.join(" ")}function ct(t,c){var o=0;return function(e){return o+=1,e.map(function(n,m){return W({node:n,stylesheet:t,useInlineStyles:c,key:"code-segment-".concat(o,"-").concat(m)})})}}function W(t){var c=t.node,o=t.stylesheet,e=t.style,n=e===void 0?{}:e,m=t.useInlineStyles,v=t.key,u=c.properties,T=c.type,_=c.tagName,R=c.value;if(T==="text")return R;if(_){var C=ct(o,m),a;if(!m)a=O(O({},u),{},{className:F(u.className)});else{var s=Object.keys(o).reduce(function(d,y){return y.split(".").forEach(function(f){d.includes(f)||d.push(f)}),d},[]),l=u.className&&u.className.includes("token")?["token"]:[],i=u.className&&l.concat(u.className.filter(function(d){return!s.includes(d)}));a=O(O({},u),{},{className:F(i)||void 0,style:tt(u.className,Object.assign({},u.style,n),o)})}var p=C(c.children);return g.createElement(_,B({key:v},a),p)}}var ot=k(H)(({theme:t})=>({display:"block",textDecoration:"none",borderRadius:t.appBorderRadius,color:"inherit","&:hover":{background:t.background.hoverable}})),et=k.div(({theme:t})=>({background:t.background.hoverable,borderRadius:t.appBorderRadius})),nt=k(M)(({theme:t})=>({fontSize:t.typography.size.s2-1})),at=(t,c)=>t.startLoc.line===c.startLoc.line&&t.startLoc.col===c.startLoc.col&&t.endLoc.line===c.endLoc.line&&t.endLoc.col===c.endLoc.col,st=({api:t})=>{let c=t.getCurrentStoryData(),o=g.useRef(null),{source:e,locationsMap:n}=x("storySource",{}),{source:{originalSource:m}={}}=x("docs",{}),v=e||m||"loading source...",u=n?Object.keys(n).find(a=>{let s=a.split("--");return c.id.endsWith(s[s.length-1])}):void 0,T=n&&u?n[u]:void 0;g.useEffect(()=>{o.current&&o.current.scrollIntoView()},[o.current]);let _=({rows:a,stylesheet:s,useInlineStyles:l})=>a.map((i,p)=>W({node:i,stylesheet:s,useInlineStyles:l,key:`code-segment${p}`})),R=({rows:a,stylesheet:s,useInlineStyles:l,location:i,id:p,refId:d})=>{let y=i.startLoc.line-1,f=i.endLoc.line,N=a.slice(y,f),E=_({rows:N,stylesheet:s,useInlineStyles:l}),L=`${y}-${f}`;return T&&at(i,T)?g.createElement(et,{key:L,ref:o},E):g.createElement(ot,{to:d?`/story/${d}_${p}`:`/story/${p}`,key:L},E)},C=({rows:a,stylesheet:s,useInlineStyles:l})=>{let i=[],p=0;K(n,"locationsMap should be defined while creating parts"),Object.keys(n).forEach(y=>{let f=n[y],N=f.startLoc.line-1,E=f.endLoc.line,{title:L,refId:q}=c,A=y.split("--"),G=t.storyId(L,A[A.length-1]),U=_({rows:a.slice(p,N),stylesheet:s,useInlineStyles:l}),V=R({rows:a,stylesheet:s,useInlineStyles:l,location:f,id:G,refId:q});i.push(...U),i.push(V),p=E});let d=_({rows:a.slice(p),stylesheet:s,useInlineStyles:l});return i.push(...d),i};return c?g.createElement(nt,{language:"jsx",showLineNumbers:!0,renderer:({rows:a,stylesheet:s,useInlineStyles:l})=>{let i=a.map(({properties:d,...y})=>({...y,properties:{className:[]}}));if(!n||!Object.keys(n).length)return _({rows:i,stylesheet:s,useInlineStyles:l});let p=C({rows:i,stylesheet:s,useInlineStyles:l});return g.createElement("span",null,p)},format:!1,copyable:!1,padded:!0,wrapLongLines:!0,lineProps:{style:{whiteSpace:"pre"}}},v):null},$="storybook/source-loader",it=`${$}/panel`;w.register($,t=>{w.add(it,{type:D.PANEL,title:"Code",render:({active:c})=>c?g.createElement(st,{api:t}):null,paramKey:"storysource"})});})(); +(()=>{var g=__REACT__,{Children:ht,Component:_t,Fragment:Ot,Profiler:vt,PureComponent:Pt,StrictMode:Tt,Suspense:Et,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Lt,cloneElement:kt,createContext:Rt,createElement:Ct,createFactory:Nt,createRef:wt,forwardRef:xt,isValidElement:jt,lazy:It,memo:Bt,startTransition:At,unstable_act:Dt,useCallback:Mt,useContext:Ht,useDebugValue:Kt,useDeferredValue:Yt,useEffect:Ft,useId:Wt,useImperativeHandle:$t,useInsertionEffect:Gt,useLayoutEffect:Ut,useMemo:Vt,useReducer:qt,useRef:zt,useState:rt,useSyncExternalStore:Qt,useTransition:Jt,version:Zt}=__REACT__;var ec=__STORYBOOK_API__,{ActiveTabs:nc,Consumer:ac,ManagerContext:sc,Provider:ic,RequestResponseError:uc,addons:w,combineParameters:lc,controlOrMetaKey:pc,controlOrMetaSymbol:dc,eventMatchesShortcut:mc,eventToShortcut:yc,experimental_requestResponse:fc,isMacLike:gc,isShortcutTaken:bc,keyToSymbol:Sc,merge:hc,mockChannel:_c,optionOrAltSymbol:Oc,shortcutMatchesShortcut:vc,shortcutToHumanString:Pc,types:D,useAddonState:Tc,useArgTypes:Ec,useArgs:Lc,useChannel:kc,useGlobalTypes:Rc,useGlobals:Cc,useParameter:x,useSharedState:Nc,useStoryPrepared:wc,useStorybookApi:xc,useStorybookState:jc}=__STORYBOOK_API__;var Mc=__STORYBOOK_COMPONENTS__,{A:Hc,ActionBar:Kc,AddonPanel:Yc,Badge:Fc,Bar:Wc,Blockquote:$c,Button:Gc,ClipboardCode:Uc,Code:Vc,DL:qc,Div:zc,DocumentWrapper:rc,EmptyTabContent:Qc,ErrorFormatter:Jc,FlexBar:Zc,Form:Xc,H1:to,H2:co,H3:oo,H4:eo,H5:no,H6:ao,HR:so,IconButton:io,IconButtonSkeleton:uo,Icons:lo,Img:po,LI:mo,Link:yo,ListItem:fo,Loader:go,Modal:bo,OL:So,P:ho,Placeholder:_o,Pre:Oo,ResetWrapper:vo,ScrollArea:Po,Separator:To,Spaced:Eo,Span:Lo,StorybookIcon:ko,StorybookLogo:Ro,Symbols:Co,SyntaxHighlighter:M,TT:No,TabBar:wo,TabButton:xo,TabWrapper:jo,Table:Io,Tabs:Bo,TabsState:Ao,TooltipLinkList:Do,TooltipMessage:Mo,TooltipNote:Ho,UL:Ko,WithTooltip:Yo,WithTooltipPure:Fo,Zoom:Wo,codeCommon:$o,components:Go,createCopyToClipboardFunction:Uo,getStoryHref:Vo,icons:qo,interleaveSeparators:zo,nameSpaceClassNames:ro,resetComponents:Qo,withReset:Jo}=__STORYBOOK_COMPONENTS__;var oe=__STORYBOOK_ROUTER__,{BaseLocationProvider:ee,DEEPLY_EQUAL:ne,Link:H,Location:ae,LocationProvider:se,Match:ie,Route:ue,buildArgsParam:le,deepDiff:pe,getMatch:de,parsePath:me,queryFromLocation:ye,stringifyQuery:fe,useNavigate:ge}=__STORYBOOK_ROUTER__;var Oe=__STORYBOOK_THEMING__,{CacheProvider:ve,ClassNames:Pe,Global:Te,ThemeProvider:Ee,background:Le,color:ke,convert:Re,create:Ce,createCache:Ne,createGlobal:we,createReset:xe,css:je,darken:Ie,ensure:Be,ignoreSsrWarning:Ae,isPropValid:De,jsx:Me,keyframes:He,lighten:Ke,styled:k,themes:Ye,typography:Fe,useTheme:We,withTheme:$e}=__STORYBOOK_THEMING__;var z=!0,j="Invariant failed";function K(t,c){if(!t){if(z)throw new Error(j);var o=typeof c=="function"?c():c,e=o?"".concat(j,": ").concat(o):j;throw new Error(e)}}function P(t){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c},P(t)}function r(t,c){if(P(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var e=o.call(t,c||"default");if(P(e)!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return(c==="string"?String:Number)(t)}function Q(t){var c=r(t,"string");return P(c)=="symbol"?c:c+""}function J(t,c,o){return(c=Q(c))in t?Object.defineProperty(t,c,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[c]=o,t}function B(){return B=Object.assign?Object.assign.bind():function(t){for(var c=1;c=4)return[t[0],t[1],t[2],t[3],"".concat(t[0],".").concat(t[1]),"".concat(t[0],".").concat(t[2]),"".concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[0]),"".concat(t[1],".").concat(t[2]),"".concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[1]),"".concat(t[2],".").concat(t[3]),"".concat(t[3],".").concat(t[0]),"".concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[0]),"".concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[0],".").concat(t[1],".").concat(t[2],".").concat(t[3]),"".concat(t[0],".").concat(t[1],".").concat(t[3],".").concat(t[2]),"".concat(t[0],".").concat(t[2],".").concat(t[1],".").concat(t[3]),"".concat(t[0],".").concat(t[2],".").concat(t[3],".").concat(t[1]),"".concat(t[0],".").concat(t[3],".").concat(t[1],".").concat(t[2]),"".concat(t[0],".").concat(t[3],".").concat(t[2],".").concat(t[1]),"".concat(t[1],".").concat(t[0],".").concat(t[2],".").concat(t[3]),"".concat(t[1],".").concat(t[0],".").concat(t[3],".").concat(t[2]),"".concat(t[1],".").concat(t[2],".").concat(t[0],".").concat(t[3]),"".concat(t[1],".").concat(t[2],".").concat(t[3],".").concat(t[0]),"".concat(t[1],".").concat(t[3],".").concat(t[0],".").concat(t[2]),"".concat(t[1],".").concat(t[3],".").concat(t[2],".").concat(t[0]),"".concat(t[2],".").concat(t[0],".").concat(t[1],".").concat(t[3]),"".concat(t[2],".").concat(t[0],".").concat(t[3],".").concat(t[1]),"".concat(t[2],".").concat(t[1],".").concat(t[0],".").concat(t[3]),"".concat(t[2],".").concat(t[1],".").concat(t[3],".").concat(t[0]),"".concat(t[2],".").concat(t[3],".").concat(t[0],".").concat(t[1]),"".concat(t[2],".").concat(t[3],".").concat(t[1],".").concat(t[0]),"".concat(t[3],".").concat(t[0],".").concat(t[1],".").concat(t[2]),"".concat(t[3],".").concat(t[0],".").concat(t[2],".").concat(t[1]),"".concat(t[3],".").concat(t[1],".").concat(t[0],".").concat(t[2]),"".concat(t[3],".").concat(t[1],".").concat(t[2],".").concat(t[0]),"".concat(t[3],".").concat(t[2],".").concat(t[0],".").concat(t[1]),"".concat(t[3],".").concat(t[2],".").concat(t[1],".").concat(t[0])]}var I={};function X(t){if(t.length===0||t.length===1)return t;var c=t.join(".");return I[c]||(I[c]=Z(t)),I[c]}function tt(t){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0,e=t.filter(function(m){return m!=="token"}),n=X(e);return n.reduce(function(m,v){return O(O({},m),o[v])},c)}function F(t){return t.join(" ")}function ct(t,c){var o=0;return function(e){return o+=1,e.map(function(n,m){return W({node:n,stylesheet:t,useInlineStyles:c,key:"code-segment-".concat(o,"-").concat(m)})})}}function W(t){var c=t.node,o=t.stylesheet,e=t.style,n=e===void 0?{}:e,m=t.useInlineStyles,v=t.key,u=c.properties,T=c.type,_=c.tagName,R=c.value;if(T==="text")return R;if(_){var C=ct(o,m),a;if(!m)a=O(O({},u),{},{className:F(u.className)});else{var s=Object.keys(o).reduce(function(d,y){return y.split(".").forEach(function(f){d.includes(f)||d.push(f)}),d},[]),l=u.className&&u.className.includes("token")?["token"]:[],i=u.className&&l.concat(u.className.filter(function(d){return!s.includes(d)}));a=O(O({},u),{},{className:F(i)||void 0,style:tt(u.className,Object.assign({},u.style,n),o)})}var p=C(c.children);return g.createElement(_,B({key:v},a),p)}}var ot=k(H)(({theme:t})=>({display:"block",textDecoration:"none",borderRadius:t.appBorderRadius,color:"inherit","&:hover":{background:t.background.hoverable}})),et=k.div(({theme:t})=>({background:t.background.hoverable,borderRadius:t.appBorderRadius})),nt=k(M)(({theme:t})=>({fontSize:t.typography.size.s2-1})),at=(t,c)=>t.startLoc.line===c.startLoc.line&&t.startLoc.col===c.startLoc.col&&t.endLoc.line===c.endLoc.line&&t.endLoc.col===c.endLoc.col,st=({api:t})=>{let c=t.getCurrentStoryData(),o=g.useRef(null),{source:e,locationsMap:n}=x("storySource",{}),{source:{originalSource:m}={}}=x("docs",{}),v=e||m||"loading source...",u=n?Object.keys(n).find(a=>{let s=a.split("--");return c.id.endsWith(s[s.length-1])}):void 0,T=n&&u?n[u]:void 0;g.useEffect(()=>{o.current&&o.current.scrollIntoView()},[o.current]);let _=({rows:a,stylesheet:s,useInlineStyles:l})=>a.map((i,p)=>W({node:i,stylesheet:s,useInlineStyles:l,key:`code-segment${p}`})),R=({rows:a,stylesheet:s,useInlineStyles:l,location:i,id:p,refId:d})=>{let y=i.startLoc.line-1,f=i.endLoc.line,N=a.slice(y,f),E=_({rows:N,stylesheet:s,useInlineStyles:l}),L=`${y}-${f}`;return T&&at(i,T)?g.createElement(et,{key:L,ref:o},E):g.createElement(ot,{to:d?`/story/${d}_${p}`:`/story/${p}`,key:L},E)},C=({rows:a,stylesheet:s,useInlineStyles:l})=>{let i=[],p=0;K(n,"locationsMap should be defined while creating parts"),Object.keys(n).forEach(y=>{let f=n[y],N=f.startLoc.line-1,E=f.endLoc.line,{title:L,refId:G}=c,A=y.split("--"),U=t.storyId(L,A[A.length-1]),V=_({rows:a.slice(p,N),stylesheet:s,useInlineStyles:l}),q=R({rows:a,stylesheet:s,useInlineStyles:l,location:f,id:U,refId:G});i.push(...V),i.push(q),p=E});let d=_({rows:a.slice(p),stylesheet:s,useInlineStyles:l});return i.push(...d),i};return c?g.createElement(nt,{language:"jsx",showLineNumbers:!0,renderer:({rows:a,stylesheet:s,useInlineStyles:l})=>{let i=a.map(({properties:d,...y})=>({...y,properties:{className:[]}}));if(!n||!Object.keys(n).length)return _({rows:i,stylesheet:s,useInlineStyles:l});let p=C({rows:i,stylesheet:s,useInlineStyles:l});return g.createElement("span",null,p)},format:!1,copyable:!1,padded:!0,wrapLongLines:!0,lineProps:{style:{whiteSpace:"pre"}}},v):null},$="storybook/source-loader",it=`${$}/panel`;w.register($,t=>{w.add(it,{type:D.PANEL,title:"Code",render:({active:c})=>c?g.createElement(st,{api:t}):null,paramKey:"storysource"})});})(); }catch(e){ console.error("[Storybook] One of your manager-entries failed: " + import.meta.url, e); } diff --git a/storybook/master/sb-manager/globals-module-info.js b/storybook/master/sb-manager/globals-module-info.js index ca770d89..41ca415f 100644 --- a/storybook/master/sb-manager/globals-module-info.js +++ b/storybook/master/sb-manager/globals-module-info.js @@ -218,7 +218,9 @@ var t = { "PhotoIcon", "PinAltIcon", "PinIcon", + "PlayAllHollowIcon", "PlayBackIcon", + "PlayHollowIcon", "PlayIcon", "PlayNextIcon", "PlusIcon", @@ -239,6 +241,7 @@ var t = { "RequestChangeIcon", "RewindIcon", "RulerIcon", + "SaveIcon", "SearchIcon", "ShareAltIcon", "ShareIcon", @@ -256,6 +259,7 @@ var t = { "StatusPassIcon", "StatusWarnIcon", "StickerIcon", + "StopAltHollowIcon", "StopAltIcon", "StopIcon", "StorybookIcon", @@ -622,7 +626,6 @@ var t = { "getMatch", "parsePath", "queryFromLocation", - "queryFromString", "stringifyQuery", "useNavigate" ], @@ -639,7 +642,6 @@ var t = { "getMatch", "parsePath", "queryFromLocation", - "queryFromString", "stringifyQuery", "useNavigate" ], @@ -656,7 +658,6 @@ var t = { "getMatch", "parsePath", "queryFromLocation", - "queryFromString", "stringifyQuery", "useNavigate" ], @@ -810,6 +811,13 @@ var t = { "STORY_THREW_EXCEPTION", "STORY_UNCHANGED", "TELEMETRY_ERROR", + "TESTING_MODULE_CANCEL_TEST_RUN_REQUEST", + "TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE", + "TESTING_MODULE_CRASH_REPORT", + "TESTING_MODULE_PROGRESS_REPORT", + "TESTING_MODULE_RUN_ALL_REQUEST", + "TESTING_MODULE_RUN_REQUEST", + "TESTING_MODULE_WATCH_MODE_REQUEST", "TOGGLE_WHATS_NEW_NOTIFICATIONS", "UNHANDLED_ERRORS_WHILE_PLAYING", "UPDATE_GLOBALS", @@ -867,6 +875,13 @@ var t = { "STORY_THREW_EXCEPTION", "STORY_UNCHANGED", "TELEMETRY_ERROR", + "TESTING_MODULE_CANCEL_TEST_RUN_REQUEST", + "TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE", + "TESTING_MODULE_CRASH_REPORT", + "TESTING_MODULE_PROGRESS_REPORT", + "TESTING_MODULE_RUN_ALL_REQUEST", + "TESTING_MODULE_RUN_REQUEST", + "TESTING_MODULE_WATCH_MODE_REQUEST", "TOGGLE_WHATS_NEW_NOTIFICATIONS", "UNHANDLED_ERRORS_WHILE_PLAYING", "UPDATE_GLOBALS", @@ -924,6 +939,13 @@ var t = { "STORY_THREW_EXCEPTION", "STORY_UNCHANGED", "TELEMETRY_ERROR", + "TESTING_MODULE_CANCEL_TEST_RUN_REQUEST", + "TESTING_MODULE_CANCEL_TEST_RUN_RESPONSE", + "TESTING_MODULE_CRASH_REPORT", + "TESTING_MODULE_PROGRESS_REPORT", + "TESTING_MODULE_RUN_ALL_REQUEST", + "TESTING_MODULE_RUN_REQUEST", + "TESTING_MODULE_WATCH_MODE_REQUEST", "TOGGLE_WHATS_NEW_NOTIFICATIONS", "UNHANDLED_ERRORS_WHILE_PLAYING", "UPDATE_GLOBALS", diff --git a/storybook/master/sb-manager/globals-runtime.js b/storybook/master/sb-manager/globals-runtime.js index b57cc104..b5b886c2 100644 --- a/storybook/master/sb-manager/globals-runtime.js +++ b/storybook/master/sb-manager/globals-runtime.js @@ -1,37874 +1,23857 @@ -var Hfe = Object.create; -var R5 = Object.defineProperty; -var $fe = Object.getOwnPropertyDescriptor; -var zfe = Object.getOwnPropertyNames; -var jfe = Object.getPrototypeOf, Ufe = Object.prototype.hasOwnProperty; -var a = (e, t) => R5(e, "name", { value: t, configurable: !0 }), Wm = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < +var LM = Object.create; +var cd = Object.defineProperty; +var NM = Object.getOwnPropertyDescriptor; +var MM = Object.getOwnPropertyNames; +var BM = Object.getPrototypeOf, $M = Object.prototype.hasOwnProperty; +var a = (e, t) => cd(e, "name", { value: t, configurable: !0 }), uc = /* @__PURE__ */ ((e) => typeof require < "u" ? require : typeof Proxy < "u" ? new Proxy(e, { get: (t, r) => (typeof require < "u" ? require : t)[r] }) : e)(function(e) { if (typeof require < "u") return require.apply(this, arguments); throw Error('Dynamic require of "' + e + '" is not supported'); }); -var Y = (e, t) => () => (e && (t = e(e = 0)), t); -var k = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), $t = (e, t) => { +var T = (e, t) => () => (e && (t = e(e = 0)), t); +var F = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), he = (e, t) => { for (var r in t) - R5(e, r, { get: t[r], enumerable: !0 }); -}, qfe = (e, t, r, o) => { + cd(e, r, { get: t[r], enumerable: !0 }); +}, zM = (e, t, r, n) => { if (t && typeof t == "object" || typeof t == "function") - for (let s of zfe(t)) - !Ufe.call(e, s) && s !== r && R5(e, s, { get: () => t[s], enumerable: !(o = $fe(t, s)) || o.enumerable }); + for (let o of MM(t)) + !$M.call(e, o) && o !== r && cd(e, o, { get: () => t[o], enumerable: !(n = NM(t, o)) || n.enumerable }); return e; }; -var Z = (e, t, r) => (r = e != null ? Hfe(jfe(e)) : {}, qfe( +var I = (e, t, r) => (r = e != null ? LM(BM(e)) : {}, zM( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. - t || !e || !e.__esModule ? R5(r, "default", { value: e, enumerable: !0 }) : r, + t || !e || !e.__esModule ? cd(r, "default", { value: e, enumerable: !0 }) : r, e )); // ../node_modules/@storybook/global/dist/index.mjs -var Ae, Or = Y(() => { - Ae = (() => { +var H, We = T(() => { + H = (() => { let e; return typeof window < "u" ? e = window : typeof globalThis < "u" ? e = globalThis : typeof global < "u" ? e = global : typeof self < "u" ? e = self : e = {}, e; })(); }); -// ../node_modules/react/cjs/react.development.js -var II = k((Et, A5) => { +// ../node_modules/react/cjs/react.production.min.js +var Ub = F((se) => { "use strict"; - (function() { - "use strict"; - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__. - registerInternalModuleStart(new Error()); - var e = "18.2.0", t = Symbol.for("react.element"), r = Symbol.for("react.portal"), o = Symbol.for("react.fragment"), s = Symbol.for("rea\ -ct.strict_mode"), l = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), p = Symbol.for("react.context"), h = Symbol.for("react\ -.forward_ref"), v = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), w = Symbol.for("react\ -.lazy"), x = Symbol.for("react.offscreen"), R = Symbol.iterator, C = "@@iterator"; - function D(_) { - if (_ === null || typeof _ != "object") - return null; - var $ = R && _[R] || _[C]; - return typeof $ == "function" ? $ : null; + var mc = Symbol.for("react.element"), mB = Symbol.for("react.portal"), gB = Symbol.for("react.fragment"), vB = Symbol.for("react.strict_mo\ +de"), yB = Symbol.for("react.profiler"), wB = Symbol.for("react.provider"), bB = Symbol.for("react.context"), SB = Symbol.for("react.forward\ +_ref"), EB = Symbol.for("react.suspense"), xB = Symbol.for("react.memo"), CB = Symbol.for("react.lazy"), Ob = Symbol.iterator; + function DB(e) { + return e === null || typeof e != "object" ? null : (e = Ob && e[Ob] || e["@@iterator"], typeof e == "function" ? e : null); + } + a(DB, "A"); + var Mb = { isMounted: /* @__PURE__ */ a(function() { + return !1; + }, "isMounted"), enqueueForceUpdate: /* @__PURE__ */ a(function() { + }, "enqueueForceUpdate"), enqueueReplaceState: /* @__PURE__ */ a(function() { + }, "enqueueReplaceState"), enqueueSetState: /* @__PURE__ */ a(function() { + }, "enqueueSetState") }, Bb = Object.assign, $b = {}; + function ms(e, t, r) { + this.props = e, this.context = t, this.refs = $b, this.updater = r || Mb; + } + a(ms, "E"); + ms.prototype.isReactComponent = {}; + ms.prototype.setState = function(e, t) { + if (typeof e != "object" && typeof e != "function" && e != null) throw Error("setState(...): takes an object of state variables to updat\ +e or a function which returns an object of state variables."); + this.updater.enqueueSetState(this, e, t, "setState"); + }; + ms.prototype.forceUpdate = function(e) { + this.updater.enqueueForceUpdate(this, e, "forceUpdate"); + }; + function zb() { + } + a(zb, "F"); + zb.prototype = ms.prototype; + function c2(e, t, r) { + this.props = e, this.context = t, this.refs = $b, this.updater = r || Mb; + } + a(c2, "G"); + var p2 = c2.prototype = new zb(); + p2.constructor = c2; + Bb(p2, ms.prototype); + p2.isPureReactComponent = !0; + var Lb = Array.isArray, Hb = Object.prototype.hasOwnProperty, f2 = { current: null }, jb = { key: !0, ref: !0, __self: !0, __source: !0 }; + function Vb(e, t, r) { + var n, o = {}, i = null, s = null; + if (t != null) for (n in t.ref !== void 0 && (s = t.ref), t.key !== void 0 && (i = "" + t.key), t) Hb.call(t, n) && !jb.hasOwnProperty(n) && + (o[n] = t[n]); + var l = arguments.length - 2; + if (l === 1) o.children = r; + else if (1 < l) { + for (var u = Array(l), c = 0; c < l; c++) u[c] = arguments[c + 2]; + o.children = u; + } + if (e && e.defaultProps) for (n in l = e.defaultProps, l) o[n] === void 0 && (o[n] = l[n]); + return { $$typeof: mc, type: e, key: i, ref: s, props: o, _owner: f2.current }; + } + a(Vb, "M"); + function RB(e, t) { + return { $$typeof: mc, type: e.type, key: t, ref: e.ref, props: e.props, _owner: e._owner }; + } + a(RB, "N"); + function d2(e) { + return typeof e == "object" && e !== null && e.$$typeof === mc; + } + a(d2, "O"); + function AB(e) { + var t = { "=": "=0", ":": "=2" }; + return "$" + e.replace(/[=:]/g, function(r) { + return t[r]; + }); + } + a(AB, "escape"); + var Nb = /\/+/g; + function u2(e, t) { + return typeof e == "object" && e !== null && e.key != null ? AB("" + e.key) : t.toString(36); + } + a(u2, "Q"); + function dd(e, t, r, n, o) { + var i = typeof e; + (i === "undefined" || i === "boolean") && (e = null); + var s = !1; + if (e === null) s = !0; + else switch (i) { + case "string": + case "number": + s = !0; + break; + case "object": + switch (e.$$typeof) { + case mc: + case mB: + s = !0; + } + } + if (s) return s = e, o = o(s), e = n === "" ? "." + u2(s, 0) : n, Lb(o) ? (r = "", e != null && (r = e.replace(Nb, "$&/") + "/"), dd(o, t, + r, "", function(c) { + return c; + })) : o != null && (d2(o) && (o = RB(o, r + (!o.key || s && s.key === o.key ? "" : ("" + o.key).replace(Nb, "$&/") + "/") + e)), t.push( + o)), 1; + if (s = 0, n = n === "" ? "." : n + ":", Lb(e)) for (var l = 0; l < e.length; l++) { + i = e[l]; + var u = n + u2(i, l); + s += dd(i, t, r, u, o); + } + else if (u = DB(e), typeof u == "function") for (e = u.call(e), l = 0; !(i = e.next()).done; ) i = i.value, u = n + u2(i, l++), s += dd( + i, t, r, u, o); + else if (i === "object") throw t = String(e), Error("Objects are not valid as a React child (found: " + (t === "[object Object]" ? "obje\ +ct with keys {" + Object.keys(e).join(", ") + "}" : t) + "). If you meant to render a collection of children, use an array instead."); + return s; + } + a(dd, "R"); + function fd(e, t, r) { + if (e == null) return e; + var n = [], o = 0; + return dd(e, n, "", "", function(i) { + return t.call(r, i, o++); + }), n; + } + a(fd, "S"); + function _B(e) { + if (e._status === -1) { + var t = e._result; + t = t(), t.then(function(r) { + (e._status === 0 || e._status === -1) && (e._status = 1, e._result = r); + }, function(r) { + (e._status === 0 || e._status === -1) && (e._status = 2, e._result = r); + }), e._status === -1 && (e._status = 0, e._result = t); + } + if (e._status === 1) return e._result.default; + throw e._result; + } + a(_B, "T"); + var Bt = { current: null }, hd = { transition: null }, TB = { ReactCurrentDispatcher: Bt, ReactCurrentBatchConfig: hd, ReactCurrentOwner: f2 }; + se.Children = { map: fd, forEach: /* @__PURE__ */ a(function(e, t, r) { + fd(e, function() { + t.apply(this, arguments); + }, r); + }, "forEach"), count: /* @__PURE__ */ a(function(e) { + var t = 0; + return fd(e, function() { + t++; + }), t; + }, "count"), toArray: /* @__PURE__ */ a(function(e) { + return fd(e, function(t) { + return t; + }) || []; + }, "toArray"), only: /* @__PURE__ */ a(function(e) { + if (!d2(e)) throw Error("React.Children.only expected to receive a single React element child."); + return e; + }, "only") }; + se.Component = ms; + se.Fragment = gB; + se.Profiler = yB; + se.PureComponent = c2; + se.StrictMode = vB; + se.Suspense = EB; + se.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = TB; + se.cloneElement = function(e, t, r) { + if (e == null) throw Error("React.cloneElement(...): The argument must be a React element, but you passed " + e + "."); + var n = Bb({}, e.props), o = e.key, i = e.ref, s = e._owner; + if (t != null) { + if (t.ref !== void 0 && (i = t.ref, s = f2.current), t.key !== void 0 && (o = "" + t.key), e.type && e.type.defaultProps) var l = e.type. + defaultProps; + for (u in t) Hb.call(t, u) && !jb.hasOwnProperty(u) && (n[u] = t[u] === void 0 && l !== void 0 ? l[u] : t[u]); + } + var u = arguments.length - 2; + if (u === 1) n.children = r; + else if (1 < u) { + l = Array(u); + for (var c = 0; c < u; c++) l[c] = arguments[c + 2]; + n.children = l; + } + return { $$typeof: mc, type: e.type, key: o, ref: i, props: n, _owner: s }; + }; + se.createContext = function(e) { + return e = { $$typeof: bB, _currentValue: e, _currentValue2: e, _threadCount: 0, Provider: null, Consumer: null, _defaultValue: null, _globalName: null }, + e.Provider = { $$typeof: wB, _context: e }, e.Consumer = e; + }; + se.createElement = Vb; + se.createFactory = function(e) { + var t = Vb.bind(null, e); + return t.type = e, t; + }; + se.createRef = function() { + return { current: null }; + }; + se.forwardRef = function(e) { + return { $$typeof: SB, render: e }; + }; + se.isValidElement = d2; + se.lazy = function(e) { + return { $$typeof: CB, _payload: { _status: -1, _result: e }, _init: _B }; + }; + se.memo = function(e, t) { + return { $$typeof: xB, type: e, compare: t === void 0 ? null : t }; + }; + se.startTransition = function(e) { + var t = hd.transition; + hd.transition = {}; + try { + e(); + } finally { + hd.transition = t; } - a(D, "getIteratorFn"); - var F = { - /** - * @internal - * @type {ReactComponent} - */ - current: null - }, O = { - transition: null - }, I = { - current: null, - // Used to reproduce behavior of `batchedUpdates` in legacy mode. - isBatchingLegacy: !1, - didScheduleLegacyUpdate: !1 - }, P = { - /** - * @internal - * @type {ReactComponent} - */ - current: null - }, N = {}, H = null; - function B(_) { - H = _; - } - a(B, "setExtraStackFrame"), N.setExtraStackFrame = function(_) { - H = _; - }, N.getCurrentStack = null, N.getStackAddendum = function() { - var _ = ""; - H && (_ += H); - var $ = N.getCurrentStack; - return $ && (_ += $() || ""), _; - }; - var q = !1, V = !1, ne = !1, ce = !1, de = !1, te = { - ReactCurrentDispatcher: F, - ReactCurrentBatchConfig: O, - ReactCurrentOwner: P - }; - te.ReactDebugCurrentFrame = N, te.ReactCurrentActQueue = I; - function he(_) { - { - for (var $ = arguments.length, J = new Array($ > 1 ? $ - 1 : 0), ae = 1; ae < $; ae++) - J[ae - 1] = arguments[ae]; - le("warn", _, J); - } + }; + se.unstable_act = function() { + throw Error("act(...) is not supported in production builds of React."); + }; + se.useCallback = function(e, t) { + return Bt.current.useCallback(e, t); + }; + se.useContext = function(e) { + return Bt.current.useContext(e); + }; + se.useDebugValue = function() { + }; + se.useDeferredValue = function(e) { + return Bt.current.useDeferredValue(e); + }; + se.useEffect = function(e, t) { + return Bt.current.useEffect(e, t); + }; + se.useId = function() { + return Bt.current.useId(); + }; + se.useImperativeHandle = function(e, t, r) { + return Bt.current.useImperativeHandle(e, t, r); + }; + se.useInsertionEffect = function(e, t) { + return Bt.current.useInsertionEffect(e, t); + }; + se.useLayoutEffect = function(e, t) { + return Bt.current.useLayoutEffect(e, t); + }; + se.useMemo = function(e, t) { + return Bt.current.useMemo(e, t); + }; + se.useReducer = function(e, t, r) { + return Bt.current.useReducer(e, t, r); + }; + se.useRef = function(e) { + return Bt.current.useRef(e); + }; + se.useState = function(e) { + return Bt.current.useState(e); + }; + se.useSyncExternalStore = function(e, t, r) { + return Bt.current.useSyncExternalStore(e, t, r); + }; + se.useTransition = function() { + return Bt.current.useTransition(); + }; + se.version = "18.2.0"; +}); + +// ../node_modules/react/index.js +var O = F(($0e, Wb) => { + "use strict"; + Wb.exports = Ub(); +}); + +// ../node_modules/scheduler/cjs/scheduler.production.min.js +var tS = F((Ee) => { + "use strict"; + function v2(e, t) { + var r = e.length; + e.push(t); + e: for (; 0 < r; ) { + var n = r - 1 >>> 1, o = e[n]; + if (0 < md(o, t)) e[n] = t, e[r] = o, r = n; + else break e; } - a(he, "warn"); - function X(_) { - { - for (var $ = arguments.length, J = new Array($ > 1 ? $ - 1 : 0), ae = 1; ae < $; ae++) - J[ae - 1] = arguments[ae]; - le("error", _, J); + } + a(v2, "f"); + function an(e) { + return e.length === 0 ? null : e[0]; + } + a(an, "h"); + function vd(e) { + if (e.length === 0) return null; + var t = e[0], r = e.pop(); + if (r !== t) { + e[0] = r; + e: for (var n = 0, o = e.length, i = o >>> 1; n < i; ) { + var s = 2 * (n + 1) - 1, l = e[s], u = s + 1, c = e[u]; + if (0 > md(l, r)) u < o && 0 > md(c, l) ? (e[n] = c, e[u] = r, n = u) : (e[n] = l, e[s] = r, n = s); + else if (u < o && 0 > md(c, r)) e[n] = c, e[u] = r, n = u; + else break e; } } - a(X, "error"); - function le(_, $, J) { - { - var ae = te.ReactDebugCurrentFrame, me = ae.getStackAddendum(); - me !== "" && ($ += "%s", J = J.concat([me])); - var qe = J.map(function(Ie) { - return String(Ie); - }); - qe.unshift("Warning: " + $), Function.prototype.apply.call(console[_], console, qe); - } + return t; + } + a(vd, "k"); + function md(e, t) { + var r = e.sortIndex - t.sortIndex; + return r !== 0 ? r : e.id - t.id; + } + a(md, "g"); + typeof performance == "object" && typeof performance.now == "function" ? (qb = performance, Ee.unstable_now = function() { + return qb.now(); + }) : (h2 = Date, Gb = h2.now(), Ee.unstable_now = function() { + return h2.now() - Gb; + }); + var qb, h2, Gb, On = [], Ko = [], kB = 1, Fr = null, _t = 3, yd = !1, ei = !1, vc = !1, Xb = typeof setTimeout == "function" ? setTimeout : + null, Qb = typeof clearTimeout == "function" ? clearTimeout : null, Yb = typeof setImmediate < "u" ? setImmediate : null; + typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 && navigator.scheduling.isInputPending. + bind(navigator.scheduling); + function y2(e) { + for (var t = an(Ko); t !== null; ) { + if (t.callback === null) vd(Ko); + else if (t.startTime <= e) vd(Ko), t.sortIndex = t.expirationTime, v2(On, t); + else break; + t = an(Ko); + } + } + a(y2, "G"); + function w2(e) { + if (vc = !1, y2(e), !ei) if (an(On) !== null) ei = !0, S2(b2); + else { + var t = an(Ko); + t !== null && E2(w2, t.startTime - e); } - a(le, "printWarning"); - var xe = {}; - function Me(_, $) { - { - var J = _.constructor, ae = J && (J.displayName || J.name) || "ReactClass", me = ae + "." + $; - if (xe[me]) - return; - X("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, \ -assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.", $, ae), xe[me] = !0; + } + a(w2, "H"); + function b2(e, t) { + ei = !1, vc && (vc = !1, Qb(yc), yc = -1), yd = !0; + var r = _t; + try { + for (y2(t), Fr = an(On); Fr !== null && (!(Fr.expirationTime > t) || e && !eS()); ) { + var n = Fr.callback; + if (typeof n == "function") { + Fr.callback = null, _t = Fr.priorityLevel; + var o = n(Fr.expirationTime <= t); + t = Ee.unstable_now(), typeof o == "function" ? Fr.callback = o : Fr === an(On) && vd(On), y2(t); + } else vd(On); + Fr = an(On); + } + if (Fr !== null) var i = !0; + else { + var s = an(Ko); + s !== null && E2(w2, s.startTime - t), i = !1; } + return i; + } finally { + Fr = null, _t = r, yd = !1; } - a(Me, "warnNoop"); - var Re = { - /** - * Checks whether or not this composite component is mounted. - * @param {ReactClass} publicInstance The instance we want to test. - * @return {boolean} True if mounted, false otherwise. - * @protected - * @final - */ - isMounted: /* @__PURE__ */ a(function(_) { - return !1; - }, "isMounted"), - /** - * Forces an update. This should only be invoked when it is known with - * certainty that we are **not** in a DOM transaction. - * - * You may want to call this when you know that some deeper aspect of the - * component's state has changed but `setState` was not called. - * - * This will not invoke `shouldComponentUpdate`, but it will invoke - * `componentWillUpdate` and `componentDidUpdate`. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {?function} callback Called after component is updated. - * @param {?string} callerName name of the calling function in the public API. - * @internal - */ - enqueueForceUpdate: /* @__PURE__ */ a(function(_, $, J) { - Me(_, "forceUpdate"); - }, "enqueueForceUpdate"), - /** - * Replaces all of the state. Always use this or `setState` to mutate state. - * You should treat `this.state` as immutable. - * - * There is no guarantee that `this.state` will be immediately updated, so - * accessing `this.state` after calling this method may return the old value. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} completeState Next state. - * @param {?function} callback Called after component is updated. - * @param {?string} callerName name of the calling function in the public API. - * @internal - */ - enqueueReplaceState: /* @__PURE__ */ a(function(_, $, J, ae) { - Me(_, "replaceState"); - }, "enqueueReplaceState"), - /** - * Sets a subset of the state. This only exists because _pendingState is - * internal. This provides a merging strategy that is not available to deep - * properties which is confusing. TODO: Expose pendingState or don't use it - * during the merge. - * - * @param {ReactClass} publicInstance The instance that should rerender. - * @param {object} partialState Next partial state to be merged with state. - * @param {?function} callback Called after component is updated. - * @param {?string} Name of the calling function in the public API. - * @internal - */ - enqueueSetState: /* @__PURE__ */ a(function(_, $, J, ae) { - Me(_, "setState"); - }, "enqueueSetState") - }, Ne = Object.assign, Pe = {}; - Object.freeze(Pe); - function Ke(_, $, J) { - this.props = _, this.context = $, this.refs = Pe, this.updater = J || Re; - } - a(Ke, "Component"), Ke.prototype.isReactComponent = {}, Ke.prototype.setState = function(_, $) { - if (typeof _ != "object" && typeof _ != "function" && _ != null) - throw new Error("setState(...): takes an object of state variables to update or a function which returns an object of state variable\ -s."); - this.updater.enqueueSetState(this, _, $, "setState"); - }, Ke.prototype.forceUpdate = function(_) { - this.updater.enqueueForceUpdate(this, _, "forceUpdate"); - }; - { - var mt = { - isMounted: ["isMounted", "Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memor\ -y leaks."], - replaceState: ["replaceState", "Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."] - }, ft = /* @__PURE__ */ a(function(_, $) { - Object.defineProperty(Ke.prototype, _, { - get: /* @__PURE__ */ a(function() { - he("%s(...) is deprecated in plain JavaScript React classes. %s", $[0], $[1]); - }, "get") - }); - }, "defineDeprecationWarning"); - for (var yt in mt) - mt.hasOwnProperty(yt) && ft(yt, mt[yt]); - } - function bt() { - } - a(bt, "ComponentDummy"), bt.prototype = Ke.prototype; - function Tt(_, $, J) { - this.props = _, this.context = $, this.refs = Pe, this.updater = J || Re; - } - a(Tt, "PureComponent"); - var kt = Tt.prototype = new bt(); - kt.constructor = Tt, Ne(kt, Ke.prototype), kt.isPureReactComponent = !0; - function vr() { - var _ = { - current: null - }; - return Object.seal(_), _; + } + a(b2, "J"); + var wd = !1, gd = null, yc = -1, Jb = 5, Zb = -1; + function eS() { + return !(Ee.unstable_now() - Zb < Jb); + } + a(eS, "M"); + function m2() { + if (gd !== null) { + var e = Ee.unstable_now(); + Zb = e; + var t = !0; + try { + t = gd(!0, e); + } finally { + t ? gc() : (wd = !1, gd = null); + } + } else wd = !1; + } + a(m2, "R"); + var gc; + typeof Yb == "function" ? gc = /* @__PURE__ */ a(function() { + Yb(m2); + }, "S") : typeof MessageChannel < "u" ? (g2 = new MessageChannel(), Kb = g2.port2, g2.port1.onmessage = m2, gc = /* @__PURE__ */ a(function() { + Kb.postMessage(null); + }, "S")) : gc = /* @__PURE__ */ a(function() { + Xb(m2, 0); + }, "S"); + var g2, Kb; + function S2(e) { + gd = e, wd || (wd = !0, gc()); + } + a(S2, "I"); + function E2(e, t) { + yc = Xb(function() { + e(Ee.unstable_now()); + }, t); + } + a(E2, "K"); + Ee.unstable_IdlePriority = 5; + Ee.unstable_ImmediatePriority = 1; + Ee.unstable_LowPriority = 4; + Ee.unstable_NormalPriority = 3; + Ee.unstable_Profiling = null; + Ee.unstable_UserBlockingPriority = 2; + Ee.unstable_cancelCallback = function(e) { + e.callback = null; + }; + Ee.unstable_continueExecution = function() { + ei || yd || (ei = !0, S2(b2)); + }; + Ee.unstable_forceFrameRate = function(e) { + 0 > e || 125 < e ? console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not \ +supported") : Jb = 0 < e ? Math.floor(1e3 / e) : 5; + }; + Ee.unstable_getCurrentPriorityLevel = function() { + return _t; + }; + Ee.unstable_getFirstCallbackNode = function() { + return an(On); + }; + Ee.unstable_next = function(e) { + switch (_t) { + case 1: + case 2: + case 3: + var t = 3; + break; + default: + t = _t; } - a(vr, "createRef"); - var kr = Array.isArray; - function Er(_) { - return kr(_); + var r = _t; + _t = t; + try { + return e(); + } finally { + _t = r; } - a(Er, "isArray"); - function Te(_) { - { - var $ = typeof Symbol == "function" && Symbol.toStringTag, J = $ && _[Symbol.toStringTag] || _.constructor.name || "Object"; - return J; - } + }; + Ee.unstable_pauseExecution = function() { + }; + Ee.unstable_requestPaint = function() { + }; + Ee.unstable_runWithPriority = function(e, t) { + switch (e) { + case 1: + case 2: + case 3: + case 4: + case 5: + break; + default: + e = 3; + } + var r = _t; + _t = e; + try { + return t(); + } finally { + _t = r; + } + }; + Ee.unstable_scheduleCallback = function(e, t, r) { + var n = Ee.unstable_now(); + switch (typeof r == "object" && r !== null ? (r = r.delay, r = typeof r == "number" && 0 < r ? n + r : n) : r = n, e) { + case 1: + var o = -1; + break; + case 2: + o = 250; + break; + case 5: + o = 1073741823; + break; + case 4: + o = 1e4; + break; + default: + o = 5e3; } - a(Te, "typeName"); - function cr(_) { + return o = r + o, e = { id: kB++, callback: t, priorityLevel: e, startTime: r, expirationTime: o, sortIndex: -1 }, r > n ? (e.sortIndex = + r, v2(Ko, e), an(On) === null && e === an(Ko) && (vc ? (Qb(yc), yc = -1) : vc = !0, E2(w2, r - n))) : (e.sortIndex = o, v2(On, e), ei || + yd || (ei = !0, S2(b2))), e; + }; + Ee.unstable_shouldYield = eS; + Ee.unstable_wrapCallback = function(e) { + var t = _t; + return function() { + var r = _t; + _t = t; try { - return fr(_), !1; - } catch { - return !0; + return e.apply(this, arguments); + } finally { + _t = r; } + }; + }; +}); + +// ../node_modules/scheduler/index.js +var nS = F((j0e, rS) => { + "use strict"; + rS.exports = tS(); +}); + +// ../node_modules/react-dom/cjs/react-dom.production.min.js +var ux = F((Er) => { + "use strict"; + var cE = O(), br = nS(); + function M(e) { + for (var t = "https://reactjs.org/docs/error-decoder.html?invariant=" + e, r = 1; r < arguments.length; r++) t += "&args[]=" + encodeURIComponent( + arguments[r]); + return "Minified React error #" + e + "; visit " + t + " for the full message or use the non-minified dev environment for full errors an\ +d additional helpful warnings."; + } + a(M, "p"); + var pE = /* @__PURE__ */ new Set(), zc = {}; + function di(e, t) { + Ns(e, t), Ns(e + "Capture", t); + } + a(di, "fa"); + function Ns(e, t) { + for (zc[e] = t, e = 0; e < t.length; e++) pE.add(t[e]); + } + a(Ns, "ha"); + var go = !(typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u"), W2 = Object.prototype.hasOwnProperty, + IB = /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/, + oS = {}, aS = {}; + function PB(e) { + return W2.call(aS, e) ? !0 : W2.call(oS, e) ? !1 : IB.test(e) ? aS[e] = !0 : (oS[e] = !0, !1); + } + a(PB, "oa"); + function FB(e, t, r, n) { + if (r !== null && r.type === 0) return !1; + switch (typeof t) { + case "function": + case "symbol": + return !0; + case "boolean": + return n ? !1 : r !== null ? !r.acceptsBooleans : (e = e.toLowerCase().slice(0, 5), e !== "data-" && e !== "aria-"); + default: + return !1; } - a(cr, "willCoercionThrow"); - function fr(_) { - return "" + _; - } - a(fr, "testStringCoercion"); - function Zt(_) { - if (cr(_)) - return X("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Te(_)), fr( - _); + } + a(FB, "pa"); + function OB(e, t, r, n) { + if (t === null || typeof t > "u" || FB(e, t, r, n)) return !0; + if (n) return !1; + if (r !== null) switch (r.type) { + case 3: + return !t; + case 4: + return t === !1; + case 5: + return isNaN(t); + case 6: + return isNaN(t) || 1 > t; } - a(Zt, "checkKeyStringCoercion"); - function Mr(_, $, J) { - var ae = _.displayName; - if (ae) - return ae; - var me = $.displayName || $.name || ""; - return me !== "" ? J + "(" + me + ")" : J; + return !1; + } + a(OB, "qa"); + function Ht(e, t, r, n, o, i, s) { + this.acceptsBooleans = t === 2 || t === 3 || t === 4, this.attributeName = n, this.attributeNamespace = o, this.mustUseProperty = r, this. + propertyName = e, this.type = t, this.sanitizeURL = i, this.removeEmptyString = s; + } + a(Ht, "v"); + var St = {}; + "children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split( + " ").forEach(function(e) { + St[e] = new Ht(e, 0, !1, e, null, !1, !1); + }); + [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(e) { + var t = e[0]; + St[t] = new Ht(t, 1, !1, e[1], null, !1, !1); + }); + ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(e) { + St[e] = new Ht(e, 2, !1, e.toLowerCase(), null, !1, !1); + }); + ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(e) { + St[e] = new Ht(e, 2, !1, e, null, !1, !1); + }); + "allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hid\ +den loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e) { + St[e] = new Ht(e, 3, !1, e.toLowerCase(), null, !1, !1); + }); + ["checked", "multiple", "muted", "selected"].forEach(function(e) { + St[e] = new Ht(e, 3, !0, e, null, !1, !1); + }); + ["capture", "download"].forEach(function(e) { + St[e] = new Ht(e, 4, !1, e, null, !1, !1); + }); + ["cols", "rows", "size", "span"].forEach(function(e) { + St[e] = new Ht(e, 6, !1, e, null, !1, !1); + }); + ["rowSpan", "start"].forEach(function(e) { + St[e] = new Ht(e, 5, !1, e.toLowerCase(), null, !1, !1); + }); + var M5 = /[\-:]([a-z])/g; + function B5(e) { + return e[1].toUpperCase(); + } + a(B5, "sa"); + "accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filter\ +s color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size f\ +ont-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-ad\ +v-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness pai\ +nt-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness str\ +oke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration tex\ +t-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematic\ +al vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e) { + var t = e.replace( + M5, + B5 + ); + St[t] = new Ht(t, 1, !1, e, null, !1, !1); + }); + "xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e) { + var t = e.replace(M5, B5); + St[t] = new Ht(t, 1, !1, e, "http://www.w3.org/1999/xlink", !1, !1); + }); + ["xml:base", "xml:lang", "xml:space"].forEach(function(e) { + var t = e.replace(M5, B5); + St[t] = new Ht(t, 1, !1, e, "http://www.w3.org/XML/1998/namespace", !1, !1); + }); + ["tabIndex", "crossOrigin"].forEach(function(e) { + St[e] = new Ht(e, 1, !1, e.toLowerCase(), null, !1, !1); + }); + St.xlinkHref = new Ht("xlinkHref", 1, !1, "xlink:href", "http://www.w3.org/1999/xlink", !0, !1); + ["src", "href", "action", "formAction"].forEach(function(e) { + St[e] = new Ht(e, 1, !1, e.toLowerCase(), null, !0, !0); + }); + function $5(e, t, r, n) { + var o = St.hasOwnProperty(t) ? St[t] : null; + (o !== null ? o.type !== 0 : n || !(2 < t.length) || t[0] !== "o" && t[0] !== "O" || t[1] !== "n" && t[1] !== "N") && (OB(t, r, o, n) && + (r = null), n || o === null ? PB(t) && (r === null ? e.removeAttribute(t) : e.setAttribute(t, "" + r)) : o.mustUseProperty ? e[o.propertyName] = + r === null ? o.type === 3 ? !1 : "" : r : (t = o.attributeName, n = o.attributeNamespace, r === null ? e.removeAttribute(t) : (o = o.type, + r = o === 3 || o === 4 && r === !0 ? "" : "" + r, n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r)))); + } + a($5, "ta"); + var bo = cE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, bd = Symbol.for("react.element"), ys = Symbol.for("react.portal"), ws = Symbol. + for("react.fragment"), z5 = Symbol.for("react.strict_mode"), q2 = Symbol.for("react.profiler"), fE = Symbol.for("react.provider"), dE = Symbol. + for("react.context"), H5 = Symbol.for("react.forward_ref"), G2 = Symbol.for("react.suspense"), Y2 = Symbol.for("react.suspense_list"), j5 = Symbol. + for("react.memo"), Qo = Symbol.for("react.lazy"); + Symbol.for("react.scope"); + Symbol.for("react.debug_trace_mode"); + var hE = Symbol.for("react.offscreen"); + Symbol.for("react.legacy_hidden"); + Symbol.for("react.cache"); + Symbol.for("react.tracing_marker"); + var iS = Symbol.iterator; + function wc(e) { + return e === null || typeof e != "object" ? null : (e = iS && e[iS] || e["@@iterator"], typeof e == "function" ? e : null); + } + a(wc, "Ka"); + var Ne = Object.assign, x2; + function Ac(e) { + if (x2 === void 0) try { + throw Error(); + } catch (r) { + var t = r.stack.trim().match(/\n( *(at )?)/); + x2 = t && t[1] || ""; + } + return ` +` + x2 + e; + } + a(Ac, "Ma"); + var C2 = !1; + function D2(e, t) { + if (!e || C2) return ""; + C2 = !0; + var r = Error.prepareStackTrace; + Error.prepareStackTrace = void 0; + try { + if (t) if (t = /* @__PURE__ */ a(function() { + throw Error(); + }, "b"), Object.defineProperty(t.prototype, "props", { set: /* @__PURE__ */ a(function() { + throw Error(); + }, "set") }), typeof Reflect == "object" && Reflect.construct) { + try { + Reflect.construct(t, []); + } catch (c) { + var n = c; + } + Reflect.construct(e, [], t); + } else { + try { + t.call(); + } catch (c) { + n = c; + } + e.call(t.prototype); + } + else { + try { + throw Error(); + } catch (c) { + n = c; + } + e(); + } + } catch (c) { + if (c && n && typeof c.stack == "string") { + for (var o = c.stack.split(` +`), i = n.stack.split(` +`), s = o.length - 1, l = i.length - 1; 1 <= s && 0 <= l && o[s] !== i[l]; ) l--; + for (; 1 <= s && 0 <= l; s--, l--) if (o[s] !== i[l]) { + if (s !== 1 || l !== 1) + do + if (s--, l--, 0 > l || o[s] !== i[l]) { + var u = ` +` + o[s].replace(" at new ", " at "); + return e.displayName && u.includes("") && (u = u.replace("", e.displayName)), u; + } + while (1 <= s && 0 <= l); + break; + } + } + } finally { + C2 = !1, Error.prepareStackTrace = r; } - a(Mr, "getWrappedName"); - function Nr(_) { - return _.displayName || "Context"; + return (e = e ? e.displayName || e.name : "") ? Ac(e) : ""; + } + a(D2, "Oa"); + function LB(e) { + switch (e.tag) { + case 5: + return Ac(e.type); + case 16: + return Ac("Lazy"); + case 13: + return Ac("Suspense"); + case 19: + return Ac("SuspenseList"); + case 0: + case 2: + case 15: + return e = D2(e.type, !1), e; + case 11: + return e = D2(e.type.render, !1), e; + case 1: + return e = D2(e.type, !0), e; + default: + return ""; } - a(Nr, "getContextName"); - function xr(_) { - if (_ == null) - return null; - if (typeof _.tag == "number" && X("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please \ -file an issue."), typeof _ == "function") - return _.displayName || _.name || null; - if (typeof _ == "string") - return _; - switch (_) { - case o: - return "Fragment"; - case r: - return "Portal"; - case l: - return "Profiler"; - case s: - return "StrictMode"; - case v: - return "Suspense"; - case g: - return "SuspenseList"; - } - if (typeof _ == "object") - switch (_.$$typeof) { - case p: - var $ = _; - return Nr($) + ".Consumer"; - case c: - var J = _; - return Nr(J._context) + ".Provider"; - case h: - return Mr(_, _.render, "ForwardRef"); - case b: - var ae = _.displayName || null; - return ae !== null ? ae : xr(_.type) || "Memo"; - case w: { - var me = _, qe = me._payload, Ie = me._init; - try { - return xr(Ie(qe)); - } catch { - return null; - } - } + } + a(LB, "Pa"); + function K2(e) { + if (e == null) return null; + if (typeof e == "function") return e.displayName || e.name || null; + if (typeof e == "string") return e; + switch (e) { + case ws: + return "Fragment"; + case ys: + return "Portal"; + case q2: + return "Profiler"; + case z5: + return "StrictMode"; + case G2: + return "Suspense"; + case Y2: + return "SuspenseList"; + } + if (typeof e == "object") switch (e.$$typeof) { + case dE: + return (e.displayName || "Context") + ".Consumer"; + case fE: + return (e._context.displayName || "Context") + ".Provider"; + case H5: + var t = e.render; + return e = e.displayName, e || (e = t.displayName || t.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e; + case j5: + return t = e.displayName || null, t !== null ? t : K2(e.type) || "Memo"; + case Qo: + t = e._payload, e = e._init; + try { + return K2(e(t)); + } catch { } - return null; } - a(xr, "getComponentNameFromType"); - var Se = Object.prototype.hasOwnProperty, zn = { - key: !0, - ref: !0, - __self: !0, - __source: !0 - }, Wa, aa, Gr; - Gr = {}; - function jn(_) { - if (Se.call(_, "ref")) { - var $ = Object.getOwnPropertyDescriptor(_, "ref").get; - if ($ && $.isReactWarning) - return !1; - } - return _.ref !== void 0; + return null; + } + a(K2, "Qa"); + function NB(e) { + var t = e.type; + switch (e.tag) { + case 24: + return "Cache"; + case 9: + return (t.displayName || "Context") + ".Consumer"; + case 10: + return (t._context.displayName || "Context") + ".Provider"; + case 18: + return "DehydratedFragment"; + case 11: + return e = t.render, e = e.displayName || e.name || "", t.displayName || (e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"); + case 7: + return "Fragment"; + case 5: + return t; + case 4: + return "Portal"; + case 3: + return "Root"; + case 6: + return "Text"; + case 16: + return K2(t); + case 8: + return t === z5 ? "StrictMode" : "Mode"; + case 22: + return "Offscreen"; + case 12: + return "Profiler"; + case 21: + return "Scope"; + case 13: + return "Suspense"; + case 19: + return "SuspenseList"; + case 25: + return "TracingMarker"; + case 1: + case 0: + case 17: + case 2: + case 14: + case 15: + if (typeof t == "function") return t.displayName || t.name || null; + if (typeof t == "string") return t; } - a(jn, "hasValidRef"); - function pn(_) { - if (Se.call(_, "key")) { - var $ = Object.getOwnPropertyDescriptor(_, "key").get; - if ($ && $.isReactWarning) - return !1; - } - return _.key !== void 0; + return null; + } + a(NB, "Ra"); + function pa(e) { + switch (typeof e) { + case "boolean": + case "number": + case "string": + case "undefined": + return e; + case "object": + return e; + default: + return ""; } - a(pn, "hasValidKey"); - function oa(_, $) { - var J = /* @__PURE__ */ a(function() { - Wa || (Wa = !0, X("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the\ - same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", $)); - }, "warnAboutAccessingKey"); - J.isReactWarning = !0, Object.defineProperty(_, "key", { - get: J, - configurable: !0 - }); + } + a(pa, "Sa"); + function mE(e) { + var t = e.type; + return (e = e.nodeName) && e.toLowerCase() === "input" && (t === "checkbox" || t === "radio"); + } + a(mE, "Ta"); + function MB(e) { + var t = mE(e) ? "checked" : "value", r = Object.getOwnPropertyDescriptor(e.constructor.prototype, t), n = "" + e[t]; + if (!e.hasOwnProperty(t) && typeof r < "u" && typeof r.get == "function" && typeof r.set == "function") { + var o = r.get, i = r.set; + return Object.defineProperty(e, t, { configurable: !0, get: /* @__PURE__ */ a(function() { + return o.call(this); + }, "get"), set: /* @__PURE__ */ a(function(s) { + n = "" + s, i.call(this, s); + }, "set") }), Object.defineProperty(e, t, { enumerable: r.enumerable }), { getValue: /* @__PURE__ */ a(function() { + return n; + }, "getValue"), setValue: /* @__PURE__ */ a(function(s) { + n = "" + s; + }, "setValue"), stopTracking: /* @__PURE__ */ a(function() { + e._valueTracker = null, delete e[t]; + }, "stopTracking") }; + } + } + a(MB, "Ua"); + function Sd(e) { + e._valueTracker || (e._valueTracker = MB(e)); + } + a(Sd, "Va"); + function gE(e) { + if (!e) return !1; + var t = e._valueTracker; + if (!t) return !0; + var r = t.getValue(), n = ""; + return e && (n = mE(e) ? e.checked ? "true" : "false" : e.value), e = n, e !== r ? (t.setValue(e), !0) : !1; + } + a(gE, "Wa"); + function Kd(e) { + if (e = e || (typeof document < "u" ? document : void 0), typeof e > "u") return null; + try { + return e.activeElement || e.body; + } catch { + return e.body; } - a(oa, "defineKeyPropWarningGetter"); - function gr(_, $) { - var J = /* @__PURE__ */ a(function() { - aa || (aa = !0, X("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the\ - same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", $)); - }, "warnAboutAccessingRef"); - J.isReactWarning = !0, Object.defineProperty(_, "ref", { - get: J, - configurable: !0 - }); + } + a(Kd, "Xa"); + function X2(e, t) { + var r = t.checked; + return Ne({}, t, { defaultChecked: void 0, defaultValue: void 0, value: void 0, checked: r ?? e._wrapperState.initialChecked }); + } + a(X2, "Ya"); + function sS(e, t) { + var r = t.defaultValue == null ? "" : t.defaultValue, n = t.checked != null ? t.checked : t.defaultChecked; + r = pa(t.value != null ? t.value : r), e._wrapperState = { initialChecked: n, initialValue: r, controlled: t.type === "checkbox" || t.type === + "radio" ? t.checked != null : t.value != null }; + } + a(sS, "Za"); + function vE(e, t) { + t = t.checked, t != null && $5(e, "checked", t, !1); + } + a(vE, "ab"); + function Q2(e, t) { + vE(e, t); + var r = pa(t.value), n = t.type; + if (r != null) n === "number" ? (r === 0 && e.value === "" || e.value != r) && (e.value = "" + r) : e.value !== "" + r && (e.value = "" + + r); + else if (n === "submit" || n === "reset") { + e.removeAttribute("value"); + return; } - a(gr, "defineRefPropWarningGetter"); - function ia(_) { - if (typeof _.ref == "string" && P.current && _.__self && P.current.stateNode !== _.__self) { - var $ = xr(P.current.type); - Gr[$] || (X('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This ca\ -se cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Le\ -arn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', $, _.ref), Gr[$] = !0); - } - } - a(ia, "warnIfStringRefCannotBeAutoConverted"); - var zo = /* @__PURE__ */ a(function(_, $, J, ae, me, qe, Ie) { - var et = { - // This tag allows us to uniquely identify this as a React Element - $$typeof: t, - // Built-in properties that belong on the element - type: _, - key: $, - ref: J, - props: Ie, - // Record the component responsible for creating this element. - _owner: qe - }; - return et._store = {}, Object.defineProperty(et._store, "validated", { - configurable: !1, - enumerable: !1, - writable: !0, - value: !1 - }), Object.defineProperty(et, "_self", { - configurable: !1, - enumerable: !1, - writable: !1, - value: ae - }), Object.defineProperty(et, "_source", { - configurable: !1, - enumerable: !1, - writable: !1, - value: me - }), Object.freeze && (Object.freeze(et.props), Object.freeze(et)), et; - }, "ReactElement"); - function ds(_, $, J) { - var ae, me = {}, qe = null, Ie = null, et = null, St = null; - if ($ != null) { - jn($) && (Ie = $.ref, ia($)), pn($) && (Zt($.key), qe = "" + $.key), et = $.__self === void 0 ? null : $.__self, St = $.__source === - void 0 ? null : $.__source; - for (ae in $) - Se.call($, ae) && !zn.hasOwnProperty(ae) && (me[ae] = $[ae]); - } - var Lt = arguments.length - 2; - if (Lt === 1) - me.children = J; - else if (Lt > 1) { - for (var Kt = Array(Lt), Xt = 0; Xt < Lt; Xt++) - Kt[Xt] = arguments[Xt + 2]; - Object.freeze && Object.freeze(Kt), me.children = Kt; - } - if (_ && _.defaultProps) { - var tr = _.defaultProps; - for (ae in tr) - me[ae] === void 0 && (me[ae] = tr[ae]); - } - if (qe || Ie) { - var yr = typeof _ == "function" ? _.displayName || _.name || "Unknown" : _; - qe && oa(me, yr), Ie && gr(me, yr); - } - return zo(_, qe, Ie, et, St, P.current, me); - } - a(ds, "createElement"); - function ye(_, $) { - var J = zo(_.type, $, _.ref, _._self, _._source, _._owner, _.props); - return J; - } - a(ye, "cloneAndReplaceKey"); - function Be(_, $, J) { - if (_ == null) - throw new Error("React.cloneElement(...): The argument must be a React element, but you passed " + _ + "."); - var ae, me = Ne({}, _.props), qe = _.key, Ie = _.ref, et = _._self, St = _._source, Lt = _._owner; - if ($ != null) { - jn($) && (Ie = $.ref, Lt = P.current), pn($) && (Zt($.key), qe = "" + $.key); - var Kt; - _.type && _.type.defaultProps && (Kt = _.type.defaultProps); - for (ae in $) - Se.call($, ae) && !zn.hasOwnProperty(ae) && ($[ae] === void 0 && Kt !== void 0 ? me[ae] = Kt[ae] : me[ae] = $[ae]); - } - var Xt = arguments.length - 2; - if (Xt === 1) - me.children = J; - else if (Xt > 1) { - for (var tr = Array(Xt), yr = 0; yr < Xt; yr++) - tr[yr] = arguments[yr + 2]; - me.children = tr; - } - return zo(_.type, qe, Ie, et, St, Lt, me); - } - a(Be, "cloneElement"); - function tt(_) { - return typeof _ == "object" && _ !== null && _.$$typeof === t; - } - a(tt, "isValidElement"); - var Ot = ".", Wt = ":"; - function hn(_) { - var $ = /[=:]/g, J = { - "=": "=0", - ":": "=2" - }, ae = _.replace($, function(me) { - return J[me]; - }); - return "$" + ae; - } - a(hn, "escape"); - var Cr = !1, Ta = /\/+/g; - function Gt(_) { - return _.replace(Ta, "$&/"); - } - a(Gt, "escapeUserProvidedKey"); - function sa(_, $) { - return typeof _ == "object" && _ !== null && _.key != null ? (Zt(_.key), hn("" + _.key)) : $.toString(36); - } - a(sa, "getElementKey"); - function Yt(_, $, J, ae, me) { - var qe = typeof _; - (qe === "undefined" || qe === "boolean") && (_ = null); - var Ie = !1; - if (_ === null) - Ie = !0; - else - switch (qe) { - case "string": - case "number": - Ie = !0; - break; - case "object": - switch (_.$$typeof) { - case t: - case r: - Ie = !0; - } + t.hasOwnProperty("value") ? J2(e, t.type, r) : t.hasOwnProperty("defaultValue") && J2(e, t.type, pa(t.defaultValue)), t.checked == null && + t.defaultChecked != null && (e.defaultChecked = !!t.defaultChecked); + } + a(Q2, "bb"); + function lS(e, t, r) { + if (t.hasOwnProperty("value") || t.hasOwnProperty("defaultValue")) { + var n = t.type; + if (!(n !== "submit" && n !== "reset" || t.value !== void 0 && t.value !== null)) return; + t = "" + e._wrapperState.initialValue, r || t === e.value || (e.value = t), e.defaultValue = t; + } + r = e.name, r !== "" && (e.name = ""), e.defaultChecked = !!e._wrapperState.initialChecked, r !== "" && (e.name = r); + } + a(lS, "db"); + function J2(e, t, r) { + (t !== "number" || Kd(e.ownerDocument) !== e) && (r == null ? e.defaultValue = "" + e._wrapperState.initialValue : e.defaultValue !== "" + + r && (e.defaultValue = "" + r)); + } + a(J2, "cb"); + var _c = Array.isArray; + function ks(e, t, r, n) { + if (e = e.options, t) { + t = {}; + for (var o = 0; o < r.length; o++) t["$" + r[o]] = !0; + for (r = 0; r < e.length; r++) o = t.hasOwnProperty("$" + e[r].value), e[r].selected !== o && (e[r].selected = o), o && n && (e[r].defaultSelected = + !0); + } else { + for (r = "" + pa(r), t = null, o = 0; o < e.length; o++) { + if (e[o].value === r) { + e[o].selected = !0, n && (e[o].defaultSelected = !0); + return; } - if (Ie) { - var et = _, St = me(et), Lt = ae === "" ? Ot + sa(et, 0) : ae; - if (Er(St)) { - var Kt = ""; - Lt != null && (Kt = Gt(Lt) + "/"), Yt(St, $, Kt, "", function(yh) { - return yh; - }); - } else St != null && (tt(St) && (St.key && (!et || et.key !== St.key) && Zt(St.key), St = ye( - St, - // Keep both the (mapped) and old keys if they differ, just as - // traverseAllChildren used to do for objects as children - J + // $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key - (St.key && (!et || et.key !== St.key) ? ( - // $FlowFixMe Flow incorrectly thinks existing element's key can be a number - // eslint-disable-next-line react-internal/safe-string-coercion - Gt("" + St.key) + "/" - ) : "") + Lt - )), $.push(St)); - return 1; + t !== null || e[o].disabled || (t = e[o]); } - var Xt, tr, yr = 0, Kr = ae === "" ? Ot : ae + Wt; - if (Er(_)) - for (var Df = 0; Df < _.length; Df++) - Xt = _[Df], tr = Kr + sa(Xt, Df), yr += Yt(Xt, $, J, tr, me); - else { - var Xr = D(_); - if (typeof Xr == "function") { - var Af = _; - Xr === Af.entries && (Cr || he("Using Maps as children is not supported. Use an array of keyed ReactElements instead."), Cr = !0); - for (var Rg = Xr.call(Af), gh, KS = 0; !(gh = Rg.next()).done; ) - Xt = gh.value, tr = Kr + sa(Xt, KS++), yr += Yt(Xt, $, J, tr, me); - } else if (qe === "object") { - var vs = String(_); - throw new Error("Objects are not valid as a React child (found: " + (vs === "[object Object]" ? "object with keys {" + Object.keys( - _).join(", ") + "}" : vs) + "). If you meant to render a collection of children, use an array instead."); + t !== null && (t.selected = !0); + } + } + a(ks, "fb"); + function Z2(e, t) { + if (t.dangerouslySetInnerHTML != null) throw Error(M(91)); + return Ne({}, t, { value: void 0, defaultValue: void 0, children: "" + e._wrapperState.initialValue }); + } + a(Z2, "gb"); + function uS(e, t) { + var r = t.value; + if (r == null) { + if (r = t.children, t = t.defaultValue, r != null) { + if (t != null) throw Error(M(92)); + if (_c(r)) { + if (1 < r.length) throw Error(M(93)); + r = r[0]; } + t = r; } - return yr; - } - a(Yt, "mapIntoArray"); - function er(_, $, J) { - if (_ == null) - return _; - var ae = [], me = 0; - return Yt(_, ae, "", "", function(qe) { - return $.call(J, qe, me++); - }), ae; - } - a(er, "mapChildren"); - function Fu(_) { - var $ = 0; - return er(_, function() { - $++; - }), $; - } - a(Fu, "countChildren"); - function ul(_, $, J) { - er(_, function() { - $.apply(this, arguments); - }, J); - } - a(ul, "forEachChildren"); - function Iu(_) { - return er(_, function($) { - return $; - }) || []; - } - a(Iu, "toArray"); - function hf(_) { - if (!tt(_)) - throw new Error("React.Children.only expected to receive a single React element child."); - return _; - } - a(hf, "onlyChild"); - function ah(_) { - var $ = { - $$typeof: p, - // As a workaround to support multiple concurrent renderers, we categorize - // some renderers as primary and others as secondary. We only expect - // there to be two concurrent renderers at most: React Native (primary) and - // Fabric (secondary); React DOM (primary) and React ART (secondary). - // Secondary renderers store their context values on separate fields. - _currentValue: _, - _currentValue2: _, - // Used to track how many concurrent renderers this context currently - // supports within in a single renderer. Such as parallel server rendering. - _threadCount: 0, - // These are circular - Provider: null, - Consumer: null, - // Add these to use same hidden class in VM as ServerContext - _defaultValue: null, - _globalName: null - }; - $.Provider = { - $$typeof: c, - _context: $ - }; - var J = !1, ae = !1, me = !1; - { - var qe = { - $$typeof: p, - _context: $ - }; - Object.defineProperties(qe, { - Provider: { - get: /* @__PURE__ */ a(function() { - return ae || (ae = !0, X("Rendering is not supported and will be removed in a future major release\ -. Did you mean to render instead?")), $.Provider; - }, "get"), - set: /* @__PURE__ */ a(function(Ie) { - $.Provider = Ie; - }, "set") - }, - _currentValue: { - get: /* @__PURE__ */ a(function() { - return $._currentValue; - }, "get"), - set: /* @__PURE__ */ a(function(Ie) { - $._currentValue = Ie; - }, "set") - }, - _currentValue2: { - get: /* @__PURE__ */ a(function() { - return $._currentValue2; - }, "get"), - set: /* @__PURE__ */ a(function(Ie) { - $._currentValue2 = Ie; - }, "set") - }, - _threadCount: { - get: /* @__PURE__ */ a(function() { - return $._threadCount; - }, "get"), - set: /* @__PURE__ */ a(function(Ie) { - $._threadCount = Ie; - }, "set") - }, - Consumer: { - get: /* @__PURE__ */ a(function() { - return J || (J = !0, X("Rendering is not supported and will be removed in a future major release. \ -Did you mean to render instead?")), $.Consumer; - }, "get") - }, - displayName: { - get: /* @__PURE__ */ a(function() { - return $.displayName; - }, "get"), - set: /* @__PURE__ */ a(function(Ie) { - me || (he("Setting `displayName` on Context.Consumer has no effect. You should set it directly on the context with Context.dis\ -playName = '%s'.", Ie), me = !0); - }, "set") - } - }), $.Consumer = qe; - } - return $._currentRenderer = null, $._currentRenderer2 = null, $; - } - a(ah, "createContext"); - var jo = -1, ps = 0, mf = 1, vf = 2; - function cl(_) { - if (_._status === jo) { - var $ = _._result, J = $(); - if (J.then(function(qe) { - if (_._status === ps || _._status === jo) { - var Ie = _; - Ie._status = mf, Ie._result = qe; - } - }, function(qe) { - if (_._status === ps || _._status === jo) { - var Ie = _; - Ie._status = vf, Ie._result = qe; - } - }), _._status === jo) { - var ae = _; - ae._status = ps, ae._result = J; - } - } - if (_._status === mf) { - var me = _._result; - return me === void 0 && X(`lazy: Expected the result of a dynamic import() call. Instead received: %s - -Your code should look like: - const MyComponent = lazy(() => import('./MyComponent')) - -Did you accidentally put curly braces around the import?`, me), "default" in me || X(`lazy: Expected the result of a dynamic import() call. \ -Instead received: %s - -Your code should look like: - const MyComponent = lazy(() => import('./MyComponent'))`, me), me.default; - } else - throw _._result; - } - a(cl, "lazyInitializer"); - function Di(_) { - var $ = { - // We use these fields to store the result. - _status: jo, - _result: _ - }, J = { - $$typeof: w, - _payload: $, - _init: cl - }; - { - var ae, me; - Object.defineProperties(J, { - defaultProps: { - configurable: !0, - get: /* @__PURE__ */ a(function() { - return ae; - }, "get"), - set: /* @__PURE__ */ a(function(qe) { - X("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the com\ -ponent is defined, or create a wrapping component around it."), ae = qe, Object.defineProperty(J, "defaultProps", { - enumerable: !0 - }); - }, "set") - }, - propTypes: { - configurable: !0, - get: /* @__PURE__ */ a(function() { - return me; - }, "get"), - set: /* @__PURE__ */ a(function(qe) { - X("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the compon\ -ent is defined, or create a wrapping component around it."), me = qe, Object.defineProperty(J, "propTypes", { - enumerable: !0 - }); - }, "set") - } - }); - } - return J; - } - a(Di, "lazy"); - function Uo(_) { - _ != null && _.$$typeof === b ? X("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(.\ -..)), use memo(forwardRef(...)).") : typeof _ != "function" ? X("forwardRef requires a render function but was given %s.", _ === null ? "nul\ -l" : typeof _) : _.length !== 0 && _.length !== 2 && X("forwardRef render functions accept exactly two parameters: props and ref. %s", _.length === - 1 ? "Did you forget to use the ref parameter?" : "Any additional parameter will be undefined."), _ != null && (_.defaultProps != null || - _.propTypes != null) && X("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React com\ -ponent?"); - var $ = { - $$typeof: h, - render: _ - }; - { - var J; - Object.defineProperty($, "displayName", { - enumerable: !1, - configurable: !0, - get: /* @__PURE__ */ a(function() { - return J; - }, "get"), - set: /* @__PURE__ */ a(function(ae) { - J = ae, !_.name && !_.displayName && (_.displayName = ae); - }, "set") - }); - } - return $; - } - a(Uo, "forwardRef"); - var qo; - qo = Symbol.for("react.module.reference"); - function fl(_) { - return !!(typeof _ == "string" || typeof _ == "function" || _ === o || _ === l || de || _ === s || _ === v || _ === g || ce || _ === x || - q || V || ne || typeof _ == "object" && _ !== null && (_.$$typeof === w || _.$$typeof === b || _.$$typeof === c || _.$$typeof === p || - _.$$typeof === h || // This needs to include all possible module reference object - // types supported by any Flight configuration anywhere since - // we don't know which Flight build this will end up being used - // with. - _.$$typeof === qo || _.getModuleId !== void 0)); - } - a(fl, "isValidElementType"); - function z(_, $) { - fl(_) || X("memo: The first argument must be a component. Instead received: %s", _ === null ? "null" : typeof _); - var J = { - $$typeof: b, - type: _, - compare: $ === void 0 ? null : $ - }; - { - var ae; - Object.defineProperty(J, "displayName", { - enumerable: !1, - configurable: !0, - get: /* @__PURE__ */ a(function() { - return ae; - }, "get"), - set: /* @__PURE__ */ a(function(me) { - ae = me, !_.name && !_.displayName && (_.displayName = me); - }, "set") - }); - } - return J; - } - a(z, "memo"); - function se() { - var _ = F.current; - return _ === null && X(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for \ -one of the following reasons: -1. You might have mismatching versions of React and the renderer (such as React DOM) -2. You might be breaking the Rules of Hooks -3. You might have more than one copy of React in the same app -See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.`), _; - } - a(se, "resolveDispatcher"); - function ge(_) { - var $ = se(); - if (_._context !== void 0) { - var J = _._context; - J.Consumer === _ ? X("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major r\ -elease. Did you mean to call useContext(Context) instead?") : J.Provider === _ && X("Calling useContext(Context.Provider) is not supported. \ -Did you mean to call useContext(Context) instead?"); - } - return $.useContext(_); - } - a(ge, "useContext"); - function je(_) { - var $ = se(); - return $.useState(_); - } - a(je, "useState"); - function dt(_, $, J) { - var ae = se(); - return ae.useReducer(_, $, J); - } - a(dt, "useReducer"); - function Ct(_) { - var $ = se(); - return $.useRef(_); - } - a(Ct, "useRef"); - function ot(_, $) { - var J = se(); - return J.useEffect(_, $); - } - a(ot, "useEffect"); - function Ue(_, $) { - var J = se(); - return J.useInsertionEffect(_, $); - } - a(Ue, "useInsertionEffect"); - function Yr(_, $) { - var J = se(); - return J.useLayoutEffect(_, $); - } - a(Yr, "useLayoutEffect"); - function nr(_, $) { - var J = se(); - return J.useCallback(_, $); - } - a(nr, "useCallback"); - function ar(_, $) { - var J = se(); - return J.useMemo(_, $); - } - a(ar, "useMemo"); - function Un(_, $, J) { - var ae = se(); - return ae.useImperativeHandle(_, $, J); - } - a(Un, "useImperativeHandle"); - function Ai(_, $) { - { - var J = se(); - return J.useDebugValue(_, $); + t == null && (t = ""), r = t; + } + e._wrapperState = { initialValue: pa(r) }; + } + a(uS, "hb"); + function yE(e, t) { + var r = pa(t.value), n = pa(t.defaultValue); + r != null && (r = "" + r, r !== e.value && (e.value = r), t.defaultValue == null && e.defaultValue !== r && (e.defaultValue = r)), n != null && + (e.defaultValue = "" + n); + } + a(yE, "ib"); + function cS(e) { + var t = e.textContent; + t === e._wrapperState.initialValue && t !== "" && t !== null && (e.value = t); + } + a(cS, "jb"); + function wE(e) { + switch (e) { + case "svg": + return "http://www.w3.org/2000/svg"; + case "math": + return "http://www.w3.org/1998/Math/MathML"; + default: + return "http://www.w3.org/1999/xhtml"; + } + } + a(wE, "kb"); + function e5(e, t) { + return e == null || e === "http://www.w3.org/1999/xhtml" ? wE(t) : e === "http://www.w3.org/2000/svg" && t === "foreignObject" ? "http:/\ +/www.w3.org/1999/xhtml" : e; + } + a(e5, "lb"); + var Ed, bE = function(e) { + return typeof MSApp < "u" && MSApp.execUnsafeLocalFunction ? function(t, r, n, o) { + MSApp.execUnsafeLocalFunction(function() { + return e(t, r, n, o); + }); + } : e; + }(function(e, t) { + if (e.namespaceURI !== "http://www.w3.org/2000/svg" || "innerHTML" in e) e.innerHTML = t; + else { + for (Ed = Ed || document.createElement("div"), Ed.innerHTML = "" + t.valueOf().toString() + "", t = Ed.firstChild; e.firstChild; ) + e.removeChild(e.firstChild); + for (; t.firstChild; ) e.appendChild(t.firstChild); + } + }); + function Hc(e, t) { + if (t) { + var r = e.firstChild; + if (r && r === e.lastChild && r.nodeType === 3) { + r.nodeValue = t; + return; } } - a(Ai, "useDebugValue"); - function gf() { - var _ = se(); - return _.useTransition(); + e.textContent = t; + } + a(Hc, "ob"); + var Ic = { + animationIterationCount: !0, + aspectRatio: !0, + borderImageOutset: !0, + borderImageSlice: !0, + borderImageWidth: !0, + boxFlex: !0, + boxFlexGroup: !0, + boxOrdinalGroup: !0, + columnCount: !0, + columns: !0, + flex: !0, + flexGrow: !0, + flexPositive: !0, + flexShrink: !0, + flexNegative: !0, + flexOrder: !0, + gridArea: !0, + gridRow: !0, + gridRowEnd: !0, + gridRowSpan: !0, + gridRowStart: !0, + gridColumn: !0, + gridColumnEnd: !0, + gridColumnSpan: !0, + gridColumnStart: !0, + fontWeight: !0, + lineClamp: !0, + lineHeight: !0, + opacity: !0, + order: !0, + orphans: !0, + tabSize: !0, + widows: !0, + zIndex: !0, + zoom: !0, + fillOpacity: !0, + floodOpacity: !0, + stopOpacity: !0, + strokeDasharray: !0, + strokeDashoffset: !0, + strokeMiterlimit: !0, + strokeOpacity: !0, + strokeWidth: !0 + }, BB = ["Webkit", "ms", "Moz", "O"]; + Object.keys(Ic).forEach(function(e) { + BB.forEach(function(t) { + t = t + e.charAt(0).toUpperCase() + e.substring(1), Ic[t] = Ic[e]; + }); + }); + function SE(e, t, r) { + return t == null || typeof t == "boolean" || t === "" ? "" : r || typeof t != "number" || t === 0 || Ic.hasOwnProperty(e) && Ic[e] ? ("" + + t).trim() : t + "px"; + } + a(SE, "rb"); + function EE(e, t) { + e = e.style; + for (var r in t) if (t.hasOwnProperty(r)) { + var n = r.indexOf("--") === 0, o = SE(r, t[r], n); + r === "float" && (r = "cssFloat"), n ? e.setProperty(r, o) : e[r] = o; + } + } + a(EE, "sb"); + var $B = Ne({ menuitem: !0 }, { area: !0, base: !0, br: !0, col: !0, embed: !0, hr: !0, img: !0, input: !0, keygen: !0, link: !0, meta: !0, + param: !0, source: !0, track: !0, wbr: !0 }); + function t5(e, t) { + if (t) { + if ($B[e] && (t.children != null || t.dangerouslySetInnerHTML != null)) throw Error(M(137, e)); + if (t.dangerouslySetInnerHTML != null) { + if (t.children != null) throw Error(M(60)); + if (typeof t.dangerouslySetInnerHTML != "object" || !("__html" in t.dangerouslySetInnerHTML)) throw Error(M(61)); + } + if (t.style != null && typeof t.style != "object") throw Error(M(62)); + } + } + a(t5, "ub"); + function r5(e, t) { + if (e.indexOf("-") === -1) return typeof t.is == "string"; + switch (e) { + case "annotation-xml": + case "color-profile": + case "font-face": + case "font-face-src": + case "font-face-uri": + case "font-face-format": + case "font-face-name": + case "missing-glyph": + return !1; + default: + return !0; + } + } + a(r5, "vb"); + var n5 = null; + function V5(e) { + return e = e.target || e.srcElement || window, e.correspondingUseElement && (e = e.correspondingUseElement), e.nodeType === 3 ? e.parentNode : + e; + } + a(V5, "xb"); + var o5 = null, Is = null, Ps = null; + function pS(e) { + if (e = ap(e)) { + if (typeof o5 != "function") throw Error(M(280)); + var t = e.stateNode; + t && (t = x0(t), o5(e.stateNode, e.type, t)); } - a(gf, "useTransition"); - function _a(_) { - var $ = se(); - return $.useDeferredValue(_); + } + a(pS, "Bb"); + function xE(e) { + Is ? Ps ? Ps.push(e) : Ps = [e] : Is = e; + } + a(xE, "Eb"); + function CE() { + if (Is) { + var e = Is, t = Ps; + if (Ps = Is = null, pS(e), t) for (e = 0; e < t.length; e++) pS(t[e]); } - a(_a, "useDeferredValue"); - function jS() { - var _ = se(); - return _.useId(); + } + a(CE, "Fb"); + function DE(e, t) { + return e(t); + } + a(DE, "Gb"); + function RE() { + } + a(RE, "Hb"); + var R2 = !1; + function AE(e, t, r) { + if (R2) return e(t, r); + R2 = !0; + try { + return DE(e, t, r); + } finally { + R2 = !1, (Is !== null || Ps !== null) && (RE(), CE()); + } + } + a(AE, "Jb"); + function jc(e, t) { + var r = e.stateNode; + if (r === null) return null; + var n = x0(r); + if (n === null) return null; + r = n[t]; + e: switch (t) { + case "onClick": + case "onClickCapture": + case "onDoubleClick": + case "onDoubleClickCapture": + case "onMouseDown": + case "onMouseDownCapture": + case "onMouseMove": + case "onMouseMoveCapture": + case "onMouseUp": + case "onMouseUpCapture": + case "onMouseEnter": + (n = !n.disabled) || (e = e.type, n = !(e === "button" || e === "input" || e === "select" || e === "textarea")), e = !n; + break e; + default: + e = !1; } - a(jS, "useId"); - function hs(_, $, J) { - var ae = se(); - return ae.useSyncExternalStore(_, $, J); + if (e) return null; + if (r && typeof r != "function") throw Error(M(231, t, typeof r)); + return r; + } + a(jc, "Kb"); + var a5 = !1; + if (go) try { + gs = {}, Object.defineProperty(gs, "passive", { get: /* @__PURE__ */ a(function() { + a5 = !0; + }, "get") }), window.addEventListener("test", gs, gs), window.removeEventListener("test", gs, gs); + } catch { + a5 = !1; + } + var gs; + function zB(e, t, r, n, o, i, s, l, u) { + var c = Array.prototype.slice.call(arguments, 3); + try { + t.apply(r, c); + } catch (p) { + this.onError(p); + } + } + a(zB, "Nb"); + var Pc = !1, Xd = null, Qd = !1, i5 = null, HB = { onError: /* @__PURE__ */ a(function(e) { + Pc = !0, Xd = e; + }, "onError") }; + function jB(e, t, r, n, o, i, s, l, u) { + Pc = !1, Xd = null, zB.apply(HB, arguments); + } + a(jB, "Tb"); + function VB(e, t, r, n, o, i, s, l, u) { + if (jB.apply(this, arguments), Pc) { + if (Pc) { + var c = Xd; + Pc = !1, Xd = null; + } else throw Error(M(198)); + Qd || (Qd = !0, i5 = c); + } + } + a(VB, "Ub"); + function hi(e) { + var t = e, r = e; + if (e.alternate) for (; t.return; ) t = t.return; + else { + e = t; + do + t = e, t.flags & 4098 && (r = t.return), e = t.return; + while (e); } - a(hs, "useSyncExternalStore"); - var it = 0, dl, oh, ih, sh, lh, uh, ch; - function fh() { + return t.tag === 3 ? r : null; + } + a(hi, "Vb"); + function _E(e) { + if (e.tag === 13) { + var t = e.memoizedState; + if (t === null && (e = e.alternate, e !== null && (t = e.memoizedState)), t !== null) return t.dehydrated; } - a(fh, "disabledLog"), fh.__reactDisabledLog = !0; - function vg() { - { - if (it === 0) { - dl = console.log, oh = console.info, ih = console.warn, sh = console.error, lh = console.group, uh = console.groupCollapsed, ch = console. - groupEnd; - var _ = { - configurable: !0, - enumerable: !0, - value: fh, - writable: !0 - }; - Object.defineProperties(console, { - info: _, - log: _, - warn: _, - error: _, - group: _, - groupCollapsed: _, - groupEnd: _ - }); + return null; + } + a(_E, "Wb"); + function fS(e) { + if (hi(e) !== e) throw Error(M(188)); + } + a(fS, "Xb"); + function UB(e) { + var t = e.alternate; + if (!t) { + if (t = hi(e), t === null) throw Error(M(188)); + return t !== e ? null : e; + } + for (var r = e, n = t; ; ) { + var o = r.return; + if (o === null) break; + var i = o.alternate; + if (i === null) { + if (n = o.return, n !== null) { + r = n; + continue; } - it++; + break; } - } - a(vg, "disableLogs"); - function US() { - { - if (it--, it === 0) { - var _ = { - configurable: !0, - enumerable: !0, - writable: !0 - }; - Object.defineProperties(console, { - log: Ne({}, _, { - value: dl - }), - info: Ne({}, _, { - value: oh - }), - warn: Ne({}, _, { - value: ih - }), - error: Ne({}, _, { - value: sh - }), - group: Ne({}, _, { - value: lh - }), - groupCollapsed: Ne({}, _, { - value: uh - }), - groupEnd: Ne({}, _, { - value: ch - }) - }); + if (o.child === i.child) { + for (i = o.child; i; ) { + if (i === r) return fS(o), e; + if (i === n) return fS(o), t; + i = i.sibling; } - it < 0 && X("disabledDepth fell below zero. This is a bug in React. Please file an issue."); - } - } - a(US, "reenableLogs"); - var dh = te.ReactCurrentDispatcher, Lu; - function pl(_, $, J) { - { - if (Lu === void 0) - try { - throw Error(); - } catch (me) { - var ae = me.stack.trim().match(/\n( *(at )?)/); - Lu = ae && ae[1] || ""; - } - return ` -` + Lu + _; + throw Error(M(188)); } - } - a(pl, "describeBuiltInComponentFrame"); - var fo = !1, hl; - { - var yf = typeof WeakMap == "function" ? WeakMap : Map; - hl = new yf(); - } - function gg(_, $) { - if (!_ || fo) - return ""; - { - var J = hl.get(_); - if (J !== void 0) - return J; - } - var ae; - fo = !0; - var me = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var qe; - qe = dh.current, dh.current = null, vg(); - try { - if ($) { - var Ie = /* @__PURE__ */ a(function() { - throw Error(); - }, "Fake"); - if (Object.defineProperty(Ie.prototype, "props", { - set: /* @__PURE__ */ a(function() { - throw Error(); - }, "set") - }), typeof Reflect == "object" && Reflect.construct) { - try { - Reflect.construct(Ie, []); - } catch (Kr) { - ae = Kr; - } - Reflect.construct(_, [], Ie); - } else { - try { - Ie.call(); - } catch (Kr) { - ae = Kr; - } - _.call(Ie.prototype); + if (r.return !== n.return) r = o, n = i; + else { + for (var s = !1, l = o.child; l; ) { + if (l === r) { + s = !0, r = o, n = i; + break; } - } else { - try { - throw Error(); - } catch (Kr) { - ae = Kr; + if (l === n) { + s = !0, n = o, r = i; + break; } - _(); + l = l.sibling; } - } catch (Kr) { - if (Kr && ae && typeof Kr.stack == "string") { - for (var et = Kr.stack.split(` -`), St = ae.stack.split(` -`), Lt = et.length - 1, Kt = St.length - 1; Lt >= 1 && Kt >= 0 && et[Lt] !== St[Kt]; ) - Kt--; - for (; Lt >= 1 && Kt >= 0; Lt--, Kt--) - if (et[Lt] !== St[Kt]) { - if (Lt !== 1 || Kt !== 1) - do - if (Lt--, Kt--, Kt < 0 || et[Lt] !== St[Kt]) { - var Xt = ` -` + et[Lt].replace(" at new ", " at "); - return _.displayName && Xt.includes("") && (Xt = Xt.replace("", _.displayName)), typeof _ == "func\ -tion" && hl.set(_, Xt), Xt; - } - while (Lt >= 1 && Kt >= 0); + if (!s) { + for (l = i.child; l; ) { + if (l === r) { + s = !0, r = i, n = o; + break; + } + if (l === n) { + s = !0, n = i, r = o; break; } + l = l.sibling; + } + if (!s) throw Error(M(189)); } - } finally { - fo = !1, dh.current = qe, US(), Error.prepareStackTrace = me; } - var tr = _ ? _.displayName || _.name : "", yr = tr ? pl(tr) : ""; - return typeof _ == "function" && hl.set(_, yr), yr; + if (r.alternate !== n) throw Error(M(190)); } - a(gg, "describeNativeComponentFrame"); - function ph(_, $, J) { - return gg(_, !1); + if (r.tag !== 3) throw Error(M(188)); + return r.stateNode.current === r ? e : t; + } + a(UB, "Yb"); + function TE(e) { + return e = UB(e), e !== null ? kE(e) : null; + } + a(TE, "Zb"); + function kE(e) { + if (e.tag === 5 || e.tag === 6) return e; + for (e = e.child; e !== null; ) { + var t = kE(e); + if (t !== null) return t; + e = e.sibling; } - a(ph, "describeFunctionComponentFrame"); - function qS(_) { - var $ = _.prototype; - return !!($ && $.isReactComponent); + return null; + } + a(kE, "$b"); + var IE = br.unstable_scheduleCallback, dS = br.unstable_cancelCallback, WB = br.unstable_shouldYield, qB = br.unstable_requestPaint, qe = br. + unstable_now, GB = br.unstable_getCurrentPriorityLevel, U5 = br.unstable_ImmediatePriority, PE = br.unstable_UserBlockingPriority, Jd = br. + unstable_NormalPriority, YB = br.unstable_LowPriority, FE = br.unstable_IdlePriority, w0 = null, Bn = null; + function KB(e) { + if (Bn && typeof Bn.onCommitFiberRoot == "function") try { + Bn.onCommitFiberRoot(w0, e, void 0, (e.current.flags & 128) === 128); + } catch { } - a(qS, "shouldConstruct"); - function ml(_, $, J) { - if (_ == null) - return ""; - if (typeof _ == "function") - return gg(_, qS(_)); - if (typeof _ == "string") - return pl(_); - switch (_) { - case v: - return pl("Suspense"); - case g: - return pl("SuspenseList"); - } - if (typeof _ == "object") - switch (_.$$typeof) { - case h: - return ph(_.render); - case b: - return ml(_.type, $, J); - case w: { - var ae = _, me = ae._payload, qe = ae._init; - try { - return ml(qe(me), $, J); - } catch { - } - } - } - return ""; + } + a(KB, "mc"); + var pn = Math.clz32 ? Math.clz32 : JB, XB = Math.log, QB = Math.LN2; + function JB(e) { + return e >>>= 0, e === 0 ? 32 : 31 - (XB(e) / QB | 0) | 0; + } + a(JB, "nc"); + var xd = 64, Cd = 4194304; + function Tc(e) { + switch (e & -e) { + case 1: + return 1; + case 2: + return 2; + case 4: + return 4; + case 8: + return 8; + case 16: + return 16; + case 32: + return 32; + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return e & 4194240; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return e & 130023424; + case 134217728: + return 134217728; + case 268435456: + return 268435456; + case 536870912: + return 536870912; + case 1073741824: + return 1073741824; + default: + return e; } - a(ml, "describeUnknownElementTypeFrameInDEV"); - var yg = {}, bf = te.ReactDebugCurrentFrame; - function Sf(_) { - if (_) { - var $ = _._owner, J = ml(_.type, _._source, $ ? $.type : null); - bf.setExtraStackFrame(J); - } else - bf.setExtraStackFrame(null); + } + a(Tc, "tc"); + function Zd(e, t) { + var r = e.pendingLanes; + if (r === 0) return 0; + var n = 0, o = e.suspendedLanes, i = e.pingedLanes, s = r & 268435455; + if (s !== 0) { + var l = s & ~o; + l !== 0 ? n = Tc(l) : (i &= s, i !== 0 && (n = Tc(i))); + } else s = r & ~o, s !== 0 ? n = Tc(s) : i !== 0 && (n = Tc(i)); + if (n === 0) return 0; + if (t !== 0 && t !== n && !(t & o) && (o = n & -n, i = t & -t, o >= i || o === 16 && (i & 4194240) !== 0)) return t; + if (n & 4 && (n |= r & 16), t = e.entangledLanes, t !== 0) for (e = e.entanglements, t &= n; 0 < t; ) r = 31 - pn(t), o = 1 << r, n |= e[r], + t &= ~o; + return n; + } + a(Zd, "uc"); + function ZB(e, t) { + switch (e) { + case 1: + case 2: + case 4: + return t + 250; + case 8: + case 16: + case 32: + case 64: + case 128: + case 256: + case 512: + case 1024: + case 2048: + case 4096: + case 8192: + case 16384: + case 32768: + case 65536: + case 131072: + case 262144: + case 524288: + case 1048576: + case 2097152: + return t + 5e3; + case 4194304: + case 8388608: + case 16777216: + case 33554432: + case 67108864: + return -1; + case 134217728: + case 268435456: + case 536870912: + case 1073741824: + return -1; + default: + return -1; } - a(Sf, "setCurrentlyValidatingElement"); - function bg(_, $, J, ae, me) { - { - var qe = Function.call.bind(Se); - for (var Ie in _) - if (qe(_, Ie)) { - var et = void 0; - try { - if (typeof _[Ie] != "function") { - var St = Error((ae || "React class") + ": " + J + " type `" + Ie + "` is invalid; it must be a function, usually from the `p\ -rop-types` package, but received `" + typeof _[Ie] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTyp\ -es.func`."); - throw St.name = "Invariant Violation", St; - } - et = _[Ie]($, Ie, ae, J, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); - } catch (Lt) { - et = Lt; - } - et && !(et instanceof Error) && (Sf(me), X("%s: type specification of %s `%s` is invalid; the type checker function must return \ -`null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectO\ -f, oneOf, oneOfType, and shape all require an argument).", ae || "React class", J, Ie, typeof et), Sf(null)), et instanceof Error && !(et.message in - yg) && (yg[et.message] = !0, Sf(me), X("Failed %s type: %s", J, et.message), Sf(null)); + } + a(ZB, "vc"); + function e$(e, t) { + for (var r = e.suspendedLanes, n = e.pingedLanes, o = e.expirationTimes, i = e.pendingLanes; 0 < i; ) { + var s = 31 - pn(i), l = 1 << s, u = o[s]; + u === -1 ? (!(l & r) || l & n) && (o[s] = ZB(l, t)) : u <= t && (e.expiredLanes |= l), i &= ~l; + } + } + a(e$, "wc"); + function s5(e) { + return e = e.pendingLanes & -1073741825, e !== 0 ? e : e & 1073741824 ? 1073741824 : 0; + } + a(s5, "xc"); + function OE() { + var e = xd; + return xd <<= 1, !(xd & 4194240) && (xd = 64), e; + } + a(OE, "yc"); + function A2(e) { + for (var t = [], r = 0; 31 > r; r++) t.push(e); + return t; + } + a(A2, "zc"); + function np(e, t, r) { + e.pendingLanes |= t, t !== 536870912 && (e.suspendedLanes = 0, e.pingedLanes = 0), e = e.eventTimes, t = 31 - pn(t), e[t] = r; + } + a(np, "Ac"); + function t$(e, t) { + var r = e.pendingLanes & ~t; + e.pendingLanes = t, e.suspendedLanes = 0, e.pingedLanes = 0, e.expiredLanes &= t, e.mutableReadLanes &= t, e.entangledLanes &= t, t = e. + entanglements; + var n = e.eventTimes; + for (e = e.expirationTimes; 0 < r; ) { + var o = 31 - pn(r), i = 1 << o; + t[o] = 0, n[o] = -1, e[o] = -1, r &= ~i; + } + } + a(t$, "Bc"); + function W5(e, t) { + var r = e.entangledLanes |= t; + for (e = e.entanglements; r; ) { + var n = 31 - pn(r), o = 1 << n; + o & t | e[n] & t && (e[n] |= t), r &= ~o; + } + } + a(W5, "Cc"); + var me = 0; + function LE(e) { + return e &= -e, 1 < e ? 4 < e ? e & 268435455 ? 16 : 536870912 : 4 : 1; + } + a(LE, "Dc"); + var NE, q5, ME, BE, $E, l5 = !1, Dd = [], na = null, oa = null, aa = null, Vc = /* @__PURE__ */ new Map(), Uc = /* @__PURE__ */ new Map(), + Zo = [], r$ = "mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart d\ +rop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" "); + function hS(e, t) { + switch (e) { + case "focusin": + case "focusout": + na = null; + break; + case "dragenter": + case "dragleave": + oa = null; + break; + case "mouseover": + case "mouseout": + aa = null; + break; + case "pointerover": + case "pointerout": + Vc.delete(t.pointerId); + break; + case "gotpointercapture": + case "lostpointercapture": + Uc.delete(t.pointerId); + } + } + a(hS, "Sc"); + function bc(e, t, r, n, o, i) { + return e === null || e.nativeEvent !== i ? (e = { blockedOn: t, domEventName: r, eventSystemFlags: n, nativeEvent: i, targetContainers: [ + o] }, t !== null && (t = ap(t), t !== null && q5(t)), e) : (e.eventSystemFlags |= n, t = e.targetContainers, o !== null && t.indexOf(o) === + -1 && t.push(o), e); + } + a(bc, "Tc"); + function n$(e, t, r, n, o) { + switch (t) { + case "focusin": + return na = bc(na, e, t, r, n, o), !0; + case "dragenter": + return oa = bc(oa, e, t, r, n, o), !0; + case "mouseover": + return aa = bc(aa, e, t, r, n, o), !0; + case "pointerover": + var i = o.pointerId; + return Vc.set(i, bc(Vc.get(i) || null, e, t, r, n, o)), !0; + case "gotpointercapture": + return i = o.pointerId, Uc.set(i, bc(Uc.get(i) || null, e, t, r, n, o)), !0; + } + return !1; + } + a(n$, "Uc"); + function zE(e) { + var t = ni(e.target); + if (t !== null) { + var r = hi(t); + if (r !== null) { + if (t = r.tag, t === 13) { + if (t = _E(r), t !== null) { + e.blockedOn = t, $E(e.priority, function() { + ME(r); + }); + return; } + } else if (t === 3 && r.stateNode.current.memoizedState.isDehydrated) { + e.blockedOn = r.tag === 3 ? r.stateNode.containerInfo : null; + return; + } } } - a(bg, "checkPropTypes"); - function vl(_) { - if (_) { - var $ = _._owner, J = ml(_.type, _._source, $ ? $.type : null); - B(J); - } else - B(null); + e.blockedOn = null; + } + a(zE, "Vc"); + function $d(e) { + if (e.blockedOn !== null) return !1; + for (var t = e.targetContainers; 0 < t.length; ) { + var r = u5(e.domEventName, e.eventSystemFlags, t[0], e.nativeEvent); + if (r === null) { + r = e.nativeEvent; + var n = new r.constructor(r.type, r); + n5 = n, r.target.dispatchEvent(n), n5 = null; + } else return t = ap(r), t !== null && q5(t), e.blockedOn = r, !1; + t.shift(); } - a(vl, "setCurrentlyValidatingElement$1"); - var wf; - wf = !1; - function Ht() { - if (P.current) { - var _ = xr(P.current.type); - if (_) - return ` - -Check the render method of \`` + _ + "`."; - } - return ""; + return !0; + } + a($d, "Xc"); + function mS(e, t, r) { + $d(e) && r.delete(t); + } + a(mS, "Zc"); + function o$() { + l5 = !1, na !== null && $d(na) && (na = null), oa !== null && $d(oa) && (oa = null), aa !== null && $d(aa) && (aa = null), Vc.forEach(mS), + Uc.forEach(mS); + } + a(o$, "$c"); + function Sc(e, t) { + e.blockedOn === t && (e.blockedOn = null, l5 || (l5 = !0, br.unstable_scheduleCallback(br.unstable_NormalPriority, o$))); + } + a(Sc, "ad"); + function Wc(e) { + function t(o) { + return Sc(o, e); } - a(Ht, "getDeclarationErrorAddendum"); - function VS(_) { - if (_ !== void 0) { - var $ = _.fileName.replace(/^.*[\\\/]/, ""), J = _.lineNumber; - return ` - -Check your code at ` + $ + ":" + J + "."; + if (a(t, "b"), 0 < Dd.length) { + Sc(Dd[0], e); + for (var r = 1; r < Dd.length; r++) { + var n = Dd[r]; + n.blockedOn === e && (n.blockedOn = null); } - return ""; } - a(VS, "getSourceInfoErrorAddendum"); - function Sg(_) { - return _ != null ? VS(_.__source) : ""; - } - a(Sg, "getSourceInfoErrorAddendumForProps"); - var rt = {}; - function wg(_) { - var $ = Ht(); - if (!$) { - var J = typeof _ == "string" ? _ : _.displayName || _.name; - J && ($ = ` - -Check the top-level render call using <` + J + ">."); - } - return $; - } - a(wg, "getCurrentComponentErrorInfo"); - function qn(_, $) { - if (!(!_._store || _._store.validated || _.key != null)) { - _._store.validated = !0; - var J = wg($); - if (!rt[J]) { - rt[J] = !0; - var ae = ""; - _ && _._owner && _._owner !== P.current && (ae = " It was passed a child from " + xr(_._owner.type) + "."), vl(_), X('Each child i\ -n a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', J, ae), vl(null); - } - } + for (na !== null && Sc(na, e), oa !== null && Sc(oa, e), aa !== null && Sc(aa, e), Vc.forEach(t), Uc.forEach(t), r = 0; r < Zo.length; r++) + n = Zo[r], n.blockedOn === e && (n.blockedOn = null); + for (; 0 < Zo.length && (r = Zo[0], r.blockedOn === null); ) zE(r), r.blockedOn === null && Zo.shift(); + } + a(Wc, "bd"); + var Fs = bo.ReactCurrentBatchConfig, e0 = !0; + function a$(e, t, r, n) { + var o = me, i = Fs.transition; + Fs.transition = null; + try { + me = 1, G5(e, t, r, n); + } finally { + me = o, Fs.transition = i; } - a(qn, "validateExplicitKey"); - function gl(_, $) { - if (typeof _ == "object") { - if (Er(_)) - for (var J = 0; J < _.length; J++) { - var ae = _[J]; - tt(ae) && qn(ae, $); - } - else if (tt(_)) - _._store && (_._store.validated = !0); - else if (_) { - var me = D(_); - if (typeof me == "function" && me !== _.entries) - for (var qe = me.call(_), Ie; !(Ie = qe.next()).done; ) - tt(Ie.value) && qn(Ie.value, $); + } + a(a$, "ed"); + function i$(e, t, r, n) { + var o = me, i = Fs.transition; + Fs.transition = null; + try { + me = 4, G5(e, t, r, n); + } finally { + me = o, Fs.transition = i; + } + } + a(i$, "gd"); + function G5(e, t, r, n) { + if (e0) { + var o = u5(e, t, r, n); + if (o === null) O2(e, t, n, t0, r), hS(e, n); + else if (n$(o, e, t, r, n)) n.stopPropagation(); + else if (hS(e, n), t & 4 && -1 < r$.indexOf(e)) { + for (; o !== null; ) { + var i = ap(o); + if (i !== null && NE(i), i = u5(e, t, r, n), i === null && O2(e, t, n, t0, r), i === o) break; + o = i; + } + o !== null && n.stopPropagation(); + } else O2(e, t, n, null, r); + } + } + a(G5, "fd"); + var t0 = null; + function u5(e, t, r, n) { + if (t0 = null, e = V5(n), e = ni(e), e !== null) if (t = hi(e), t === null) e = null; + else if (r = t.tag, r === 13) { + if (e = _E(t), e !== null) return e; + e = null; + } else if (r === 3) { + if (t.stateNode.current.memoizedState.isDehydrated) return t.tag === 3 ? t.stateNode.containerInfo : null; + e = null; + } else t !== e && (e = null); + return t0 = e, null; + } + a(u5, "Yc"); + function HE(e) { + switch (e) { + case "cancel": + case "click": + case "close": + case "contextmenu": + case "copy": + case "cut": + case "auxclick": + case "dblclick": + case "dragend": + case "dragstart": + case "drop": + case "focusin": + case "focusout": + case "input": + case "invalid": + case "keydown": + case "keypress": + case "keyup": + case "mousedown": + case "mouseup": + case "paste": + case "pause": + case "play": + case "pointercancel": + case "pointerdown": + case "pointerup": + case "ratechange": + case "reset": + case "resize": + case "seeked": + case "submit": + case "touchcancel": + case "touchend": + case "touchstart": + case "volumechange": + case "change": + case "selectionchange": + case "textInput": + case "compositionstart": + case "compositionend": + case "compositionupdate": + case "beforeblur": + case "afterblur": + case "beforeinput": + case "blur": + case "fullscreenchange": + case "focus": + case "hashchange": + case "popstate": + case "select": + case "selectstart": + return 1; + case "drag": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "mousemove": + case "mouseout": + case "mouseover": + case "pointermove": + case "pointerout": + case "pointerover": + case "scroll": + case "toggle": + case "touchmove": + case "wheel": + case "mouseenter": + case "mouseleave": + case "pointerenter": + case "pointerleave": + return 4; + case "message": + switch (GB()) { + case U5: + return 1; + case PE: + return 4; + case Jd: + case YB: + return 16; + case FE: + return 536870912; + default: + return 16; } - } + default: + return 16; + } + } + a(HE, "jd"); + var ta = null, Y5 = null, zd = null; + function jE() { + if (zd) return zd; + var e, t = Y5, r = t.length, n, o = "value" in ta ? ta.value : ta.textContent, i = o.length; + for (e = 0; e < r && t[e] === o[e]; e++) ; + var s = r - e; + for (n = 1; n <= s && t[r - n] === o[i - n]; n++) ; + return zd = o.slice(e, 1 < n ? 1 - n : void 0); + } + a(jE, "nd"); + function Hd(e) { + var t = e.keyCode; + return "charCode" in e ? (e = e.charCode, e === 0 && t === 13 && (e = 13)) : e = t, e === 10 && (e = 13), 32 <= e || e === 13 ? e : 0; + } + a(Hd, "od"); + function Rd() { + return !0; + } + a(Rd, "pd"); + function gS() { + return !1; + } + a(gS, "qd"); + function Sr(e) { + function t(r, n, o, i, s) { + this._reactName = r, this._targetInst = o, this.type = n, this.nativeEvent = i, this.target = s, this.currentTarget = null; + for (var l in e) e.hasOwnProperty(l) && (r = e[l], this[l] = r ? r(i) : i[l]); + return this.isDefaultPrevented = (i.defaultPrevented != null ? i.defaultPrevented : i.returnValue === !1) ? Rd : gS, this.isPropagationStopped = + gS, this; + } + return a(t, "b"), Ne(t.prototype, { preventDefault: /* @__PURE__ */ a(function() { + this.defaultPrevented = !0; + var r = this.nativeEvent; + r && (r.preventDefault ? r.preventDefault() : typeof r.returnValue != "unknown" && (r.returnValue = !1), this.isDefaultPrevented = Rd); + }, "preventDefault"), stopPropagation: /* @__PURE__ */ a(function() { + var r = this.nativeEvent; + r && (r.stopPropagation ? r.stopPropagation() : typeof r.cancelBubble != "unknown" && (r.cancelBubble = !0), this.isPropagationStopped = + Rd); + }, "stopPropagation"), persist: /* @__PURE__ */ a(function() { + }, "persist"), isPersistent: Rd }), t; + } + a(Sr, "rd"); + var Vs = { eventPhase: 0, bubbles: 0, cancelable: 0, timeStamp: /* @__PURE__ */ a(function(e) { + return e.timeStamp || Date.now(); + }, "timeStamp"), defaultPrevented: 0, isTrusted: 0 }, K5 = Sr(Vs), op = Ne({}, Vs, { view: 0, detail: 0 }), s$ = Sr(op), _2, T2, Ec, b0 = Ne( + {}, op, { screenX: 0, screenY: 0, clientX: 0, clientY: 0, pageX: 0, pageY: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, getModifierState: X5, + button: 0, buttons: 0, relatedTarget: /* @__PURE__ */ a(function(e) { + return e.relatedTarget === void 0 ? e.fromElement === e.srcElement ? e.toElement : e.fromElement : e.relatedTarget; + }, "relatedTarget"), movementX: /* @__PURE__ */ a(function(e) { + return "movementX" in e ? e.movementX : (e !== Ec && (Ec && e.type === "mousemove" ? (_2 = e.screenX - Ec.screenX, T2 = e.screenY - Ec.screenY) : + T2 = _2 = 0, Ec = e), _2); + }, "movementX"), movementY: /* @__PURE__ */ a(function(e) { + return "movementY" in e ? e.movementY : T2; + }, "movementY") }), vS = Sr(b0), l$ = Ne({}, b0, { dataTransfer: 0 }), u$ = Sr(l$), c$ = Ne({}, op, { relatedTarget: 0 }), k2 = Sr(c$), p$ = Ne( + {}, Vs, { animationName: 0, elapsedTime: 0, pseudoElement: 0 }), f$ = Sr(p$), d$ = Ne({}, Vs, { clipboardData: /* @__PURE__ */ a(function(e) { + return "clipboardData" in e ? e.clipboardData : window.clipboardData; + }, "clipboardData") }), h$ = Sr(d$), m$ = Ne({}, Vs, { data: 0 }), yS = Sr(m$), g$ = { + Esc: "Escape", + Spacebar: " ", + Left: "ArrowLeft", + Up: "ArrowUp", + Right: "ArrowRight", + Down: "ArrowDown", + Del: "Delete", + Win: "OS", + Menu: "ContextMenu", + Apps: "ContextMenu", + Scroll: "ScrollLock", + MozPrintableKey: "Unidentified" + }, v$ = { + 8: "Backspace", + 9: "Tab", + 12: "Clear", + 13: "Enter", + 16: "Shift", + 17: "Control", + 18: "Alt", + 19: "Pause", + 20: "CapsLock", + 27: "Escape", + 32: " ", + 33: "PageUp", + 34: "PageDown", + 35: "End", + 36: "Home", + 37: "ArrowLeft", + 38: "ArrowUp", + 39: "ArrowRight", + 40: "ArrowDown", + 45: "Insert", + 46: "Delete", + 112: "F1", + 113: "F2", + 114: "F3", + 115: "F4", + 116: "F5", + 117: "F6", + 118: "F7", + 119: "F8", + 120: "F9", + 121: "F10", + 122: "F11", + 123: "F12", + 144: "NumLock", + 145: "ScrollLock", + 224: "Meta" + }, y$ = { Alt: "altKey", Control: "ctrlKey", Meta: "metaKey", Shift: "shiftKey" }; + function w$(e) { + var t = this.nativeEvent; + return t.getModifierState ? t.getModifierState(e) : (e = y$[e]) ? !!t[e] : !1; + } + a(w$, "Pd"); + function X5() { + return w$; + } + a(X5, "zd"); + var b$ = Ne({}, op, { key: /* @__PURE__ */ a(function(e) { + if (e.key) { + var t = g$[e.key] || e.key; + if (t !== "Unidentified") return t; + } + return e.type === "keypress" ? (e = Hd(e), e === 13 ? "Enter" : String.fromCharCode(e)) : e.type === "keydown" || e.type === "keyup" ? v$[e. + keyCode] || "Unidentified" : ""; + }, "key"), code: 0, location: 0, ctrlKey: 0, shiftKey: 0, altKey: 0, metaKey: 0, repeat: 0, locale: 0, getModifierState: X5, charCode: /* @__PURE__ */ a( + function(e) { + return e.type === "keypress" ? Hd(e) : 0; + }, "charCode"), keyCode: /* @__PURE__ */ a(function(e) { + return e.type === "keydown" || e.type === "keyup" ? e.keyCode : 0; + }, "keyCode"), which: /* @__PURE__ */ a(function(e) { + return e.type === "keypress" ? Hd(e) : e.type === "keydown" || e.type === "keyup" ? e.keyCode : 0; + }, "which") }), S$ = Sr(b$), E$ = Ne({}, b0, { pointerId: 0, width: 0, height: 0, pressure: 0, tangentialPressure: 0, tiltX: 0, tiltY: 0, twist: 0, + pointerType: 0, isPrimary: 0 }), wS = Sr(E$), x$ = Ne({}, op, { touches: 0, targetTouches: 0, changedTouches: 0, altKey: 0, metaKey: 0, ctrlKey: 0, + shiftKey: 0, getModifierState: X5 }), C$ = Sr(x$), D$ = Ne({}, Vs, { propertyName: 0, elapsedTime: 0, pseudoElement: 0 }), R$ = Sr(D$), A$ = Ne( + {}, b0, { + deltaX: /* @__PURE__ */ a(function(e) { + return "deltaX" in e ? e.deltaX : "wheelDeltaX" in e ? -e.wheelDeltaX : 0; + }, "deltaX"), + deltaY: /* @__PURE__ */ a(function(e) { + return "deltaY" in e ? e.deltaY : "wheelDeltaY" in e ? -e.wheelDeltaY : "wheelDelta" in e ? -e.wheelDelta : 0; + }, "deltaY"), + deltaZ: 0, + deltaMode: 0 + }), _$ = Sr(A$), T$ = [9, 13, 27, 32], Q5 = go && "CompositionEvent" in window, Fc = null; + go && "documentMode" in document && (Fc = document.documentMode); + var k$ = go && "TextEvent" in window && !Fc, VE = go && (!Q5 || Fc && 8 < Fc && 11 >= Fc), bS = " ", SS = !1; + function UE(e, t) { + switch (e) { + case "keyup": + return T$.indexOf(t.keyCode) !== -1; + case "keydown": + return t.keyCode !== 229; + case "keypress": + case "mousedown": + case "focusout": + return !0; + default: + return !1; } - a(gl, "validateChildKeys"); - function yl(_) { - { - var $ = _.type; - if ($ == null || typeof $ == "string") - return; - var J; - if (typeof $ == "function") - J = $.propTypes; - else if (typeof $ == "object" && ($.$$typeof === h || // Note: Memo only checks outer props here. - // Inner props are checked in the reconciler. - $.$$typeof === b)) - J = $.propTypes; - else - return; - if (J) { - var ae = xr($); - bg(J, _.props, "prop", ae, _); - } else if ($.PropTypes !== void 0 && !wf) { - wf = !0; - var me = xr($); - X("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", me || "Unknown"); - } - typeof $.getDefaultProps == "function" && !$.getDefaultProps.isReactClassApproved && X("getDefaultProps is only used on classic Reac\ -t.createClass definitions. Use a static property named `defaultProps` instead."); - } + } + a(UE, "ge"); + function WE(e) { + return e = e.detail, typeof e == "object" && "data" in e ? e.data : null; + } + a(WE, "he"); + var bs = !1; + function I$(e, t) { + switch (e) { + case "compositionend": + return WE(t); + case "keypress": + return t.which !== 32 ? null : (SS = !0, bS); + case "textInput": + return e = t.data, e === bS && SS ? null : e; + default: + return null; } - a(yl, "validatePropTypes"); - function WS(_) { - { - for (var $ = Object.keys(_.props), J = 0; J < $.length; J++) { - var ae = $[J]; - if (ae !== "children" && ae !== "key") { - vl(_), X("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", ae), vl(null); - break; - } - } - _.ref !== null && (vl(_), X("Invalid attribute `ref` supplied to `React.Fragment`."), vl(null)); - } - } - a(WS, "validateFragmentProps"); - function mn(_, $, J) { - var ae = fl(_); - if (!ae) { - var me = ""; - (_ === void 0 || typeof _ == "object" && _ !== null && Object.keys(_).length === 0) && (me += " You likely forgot to export your com\ -ponent from the file it's defined in, or you might have mixed up default and named imports."); - var qe = Sg($); - qe ? me += qe : me += Ht(); - var Ie; - _ === null ? Ie = "null" : Er(_) ? Ie = "array" : _ !== void 0 && _.$$typeof === t ? (Ie = "<" + (xr(_.type) || "Unknown") + " />", me = - " Did you accidentally export a JSX literal instead of a component?") : Ie = typeof _, X("React.createElement: type is invalid -- ex\ -pected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", Ie, me); - } - var et = ds.apply(this, arguments); - if (et == null) - return et; - if (ae) - for (var St = 2; St < arguments.length; St++) - gl(arguments[St], _); - return _ === o ? WS(et) : yl(et), et; - } - a(mn, "createElementWithValidation"); - var dr = !1; - function GS(_) { - var $ = mn.bind(null, _); - return $.type = _, dr || (dr = !0, he("React.createFactory() is deprecated and will be removed in a future major release. Consider usi\ -ng JSX or use React.createElement() directly instead.")), Object.defineProperty($, "type", { - enumerable: !1, - get: /* @__PURE__ */ a(function() { - return he("Factory.type is deprecated. Access the class directly before passing it to createFactory."), Object.defineProperty(this, - "type", { - value: _ - }), _; - }, "get") - }), $; - } - a(GS, "createFactoryWithValidation"); - function po(_, $, J) { - for (var ae = Be.apply(this, arguments), me = 2; me < arguments.length; me++) - gl(arguments[me], ae.type); - return yl(ae), ae; - } - a(po, "cloneElementWithValidation"); - function Oa(_, $) { - var J = O.transition; - O.transition = {}; - var ae = O.transition; - O.transition._updatedFibers = /* @__PURE__ */ new Set(); - try { - _(); - } finally { - if (O.transition = J, J === null && ae._updatedFibers) { - var me = ae._updatedFibers.size; - me > 10 && he("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to u\ -se React provided hooks. Otherwise concurrent mode guarantees are off the table."), ae._updatedFibers.clear(); + } + a(I$, "je"); + function P$(e, t) { + if (bs) return e === "compositionend" || !Q5 && UE(e, t) ? (e = jE(), zd = Y5 = ta = null, bs = !1, e) : null; + switch (e) { + case "paste": + return null; + case "keypress": + if (!(t.ctrlKey || t.altKey || t.metaKey) || t.ctrlKey && t.altKey) { + if (t.char && 1 < t.char.length) return t.char; + if (t.which) return String.fromCharCode(t.which); } - } + return null; + case "compositionend": + return VE && t.locale !== "ko" ? null : t.data; + default: + return null; } - a(Oa, "startTransition"); - var Vo = !1, Ef = null; - function hh(_) { - if (Ef === null) - try { - var $ = ("require" + Math.random()).slice(0, 7), J = A5 && A5[$]; - Ef = J.call(A5, "timers").setImmediate; - } catch { - Ef = /* @__PURE__ */ a(function(me) { - Vo === !1 && (Vo = !0, typeof MessageChannel > "u" && X("This browser does not have a MessageChannel implementation, so enqueuin\ -g tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this war\ -ning.")); - var qe = new MessageChannel(); - qe.port1.onmessage = me, qe.port2.postMessage(void 0); - }, "enqueueTaskImpl"); - } - return Ef(_); + } + a(P$, "ke"); + var F$ = { color: !0, date: !0, datetime: !0, "datetime-local": !0, email: !0, month: !0, number: !0, password: !0, range: !0, search: !0, + tel: !0, text: !0, time: !0, url: !0, week: !0 }; + function ES(e) { + var t = e && e.nodeName && e.nodeName.toLowerCase(); + return t === "input" ? !!F$[e.type] : t === "textarea"; + } + a(ES, "me"); + function qE(e, t, r, n) { + xE(n), t = r0(t, "onChange"), 0 < t.length && (r = new K5("onChange", "change", null, r, n), e.push({ event: r, listeners: t })); + } + a(qE, "ne"); + var Oc = null, qc = null; + function O$(e) { + n7(e, 0); + } + a(O$, "re"); + function S0(e) { + var t = xs(e); + if (gE(t)) return e; + } + a(S0, "te"); + function L$(e, t) { + if (e === "change") return t; + } + a(L$, "ve"); + var GE = !1; + go && (go ? (_d = "oninput" in document, _d || (I2 = document.createElement("div"), I2.setAttribute("oninput", "return;"), _d = typeof I2. + oninput == "function"), Ad = _d) : Ad = !1, GE = Ad && (!document.documentMode || 9 < document.documentMode)); + var Ad, _d, I2; + function xS() { + Oc && (Oc.detachEvent("onpropertychange", YE), qc = Oc = null); + } + a(xS, "Ae"); + function YE(e) { + if (e.propertyName === "value" && S0(qc)) { + var t = []; + qE(t, qc, e, V5(e)), AE(O$, t); + } + } + a(YE, "Be"); + function N$(e, t, r) { + e === "focusin" ? (xS(), Oc = t, qc = r, Oc.attachEvent("onpropertychange", YE)) : e === "focusout" && xS(); + } + a(N$, "Ce"); + function M$(e) { + if (e === "selectionchange" || e === "keyup" || e === "keydown") return S0(qc); + } + a(M$, "De"); + function B$(e, t) { + if (e === "click") return S0(t); + } + a(B$, "Ee"); + function $$(e, t) { + if (e === "input" || e === "change") return S0(t); + } + a($$, "Fe"); + function z$(e, t) { + return e === t && (e !== 0 || 1 / e === 1 / t) || e !== e && t !== t; + } + a(z$, "Ge"); + var dn = typeof Object.is == "function" ? Object.is : z$; + function Gc(e, t) { + if (dn(e, t)) return !0; + if (typeof e != "object" || e === null || typeof t != "object" || t === null) return !1; + var r = Object.keys(e), n = Object.keys(t); + if (r.length !== n.length) return !1; + for (n = 0; n < r.length; n++) { + var o = r[n]; + if (!W2.call(t, o) || !dn(e[o], t[o])) return !1; } - a(hh, "enqueueTask"); - var ms = 0, mh = !1; - function YS(_) { - { - var $ = ms; - ms++, I.current === null && (I.current = []); - var J = I.isBatchingLegacy, ae; - try { - if (I.isBatchingLegacy = !0, ae = _(), !J && I.didScheduleLegacyUpdate) { - var me = I.current; - me !== null && (I.didScheduleLegacyUpdate = !1, Cf(me)); - } - } catch (tr) { - throw xf($), tr; - } finally { - I.isBatchingLegacy = J; - } - if (ae !== null && typeof ae == "object" && typeof ae.then == "function") { - var qe = ae, Ie = !1, et = { - then: /* @__PURE__ */ a(function(tr, yr) { - Ie = !0, qe.then(function(Kr) { - xf($), ms === 0 ? vh(Kr, tr, yr) : tr(Kr); - }, function(Kr) { - xf($), yr(Kr); - }); - }, "then") - }; - return !mh && typeof Promise < "u" && Promise.resolve().then(function() { - }).then(function() { - Ie || (mh = !0, X("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving \ -multiple act calls and mixing their scopes. You should - await act(async () => ...);")); - }), et; - } else { - var St = ae; - if (xf($), ms === 0) { - var Lt = I.current; - Lt !== null && (Cf(Lt), I.current = null); - var Kt = { - then: /* @__PURE__ */ a(function(tr, yr) { - I.current === null ? (I.current = [], vh(St, tr, yr)) : tr(St); - }, "then") - }; - return Kt; - } else { - var Xt = { - then: /* @__PURE__ */ a(function(tr, yr) { - tr(St); - }, "then") - }; - return Xt; + return !0; + } + a(Gc, "Ie"); + function CS(e) { + for (; e && e.firstChild; ) e = e.firstChild; + return e; + } + a(CS, "Je"); + function DS(e, t) { + var r = CS(e); + e = 0; + for (var n; r; ) { + if (r.nodeType === 3) { + if (n = e + r.textContent.length, e <= t && n >= t) return { node: r, offset: t - e }; + e = n; + } + e: { + for (; r; ) { + if (r.nextSibling) { + r = r.nextSibling; + break e; } + r = r.parentNode; } + r = void 0; } + r = CS(r); } - a(YS, "act"); - function xf(_) { - _ !== ms - 1 && X("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before makin\ -g a new one. "), ms = _; - } - a(xf, "popActScope"); - function vh(_, $, J) { - { - var ae = I.current; - if (ae !== null) - try { - Cf(ae), hh(function() { - ae.length === 0 ? (I.current = null, $(_)) : vh(_, $, J); - }); - } catch (me) { - J(me); - } - else - $(_); + } + a(DS, "Ke"); + function KE(e, t) { + return e && t ? e === t ? !0 : e && e.nodeType === 3 ? !1 : t && t.nodeType === 3 ? KE(e, t.parentNode) : "contains" in e ? e.contains(t) : + e.compareDocumentPosition ? !!(e.compareDocumentPosition(t) & 16) : !1 : !1; + } + a(KE, "Le"); + function XE() { + for (var e = window, t = Kd(); t instanceof e.HTMLIFrameElement; ) { + try { + var r = typeof t.contentWindow.location.href == "string"; + } catch { + r = !1; } + if (r) e = t.contentWindow; + else break; + t = Kd(e.document); } - a(vh, "recursivelyFlushAsyncActWork"); - var bl = !1; - function Cf(_) { - if (!bl) { - bl = !0; - var $ = 0; - try { - for (; $ < _.length; $++) { - var J = _[$]; - do - J = J(!0); - while (J !== null); - } - _.length = 0; - } catch (ae) { - throw _ = _.slice($ + 1), ae; - } finally { - bl = !1; + return t; + } + a(XE, "Me"); + function J5(e) { + var t = e && e.nodeName && e.nodeName.toLowerCase(); + return t && (t === "input" && (e.type === "text" || e.type === "search" || e.type === "tel" || e.type === "url" || e.type === "password") || + t === "textarea" || e.contentEditable === "true"); + } + a(J5, "Ne"); + function H$(e) { + var t = XE(), r = e.focusedElem, n = e.selectionRange; + if (t !== r && r && r.ownerDocument && KE(r.ownerDocument.documentElement, r)) { + if (n !== null && J5(r)) { + if (t = n.start, e = n.end, e === void 0 && (e = t), "selectionStart" in r) r.selectionStart = t, r.selectionEnd = Math.min(e, r.value. + length); + else if (e = (t = r.ownerDocument || document) && t.defaultView || window, e.getSelection) { + e = e.getSelection(); + var o = r.textContent.length, i = Math.min(n.start, o); + n = n.end === void 0 ? i : Math.min(n.end, o), !e.extend && i > n && (o = n, n = i, i = o), o = DS(r, i); + var s = DS( + r, + n + ); + o && s && (e.rangeCount !== 1 || e.anchorNode !== o.node || e.anchorOffset !== o.offset || e.focusNode !== s.node || e.focusOffset !== + s.offset) && (t = t.createRange(), t.setStart(o.node, o.offset), e.removeAllRanges(), i > n ? (e.addRange(t), e.extend(s.node, s.offset)) : + (t.setEnd(s.node, s.offset), e.addRange(t))); } } + for (t = [], e = r; e = e.parentNode; ) e.nodeType === 1 && t.push({ element: e, left: e.scrollLeft, top: e.scrollTop }); + for (typeof r.focus == "function" && r.focus(), r = 0; r < t.length; r++) e = t[r], e.element.scrollLeft = e.left, e.element.scrollTop = + e.top; } - a(Cf, "flushActQueue"); - var Rf = mn, Eg = po, xg = GS, Cg = { - map: er, - forEach: ul, - count: Fu, - toArray: Iu, - only: hf - }; - Et.Children = Cg, Et.Component = Ke, Et.Fragment = o, Et.Profiler = l, Et.PureComponent = Tt, Et.StrictMode = s, Et.Suspense = v, Et.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = - te, Et.cloneElement = Eg, Et.createContext = ah, Et.createElement = Rf, Et.createFactory = xg, Et.createRef = vr, Et.forwardRef = Uo, Et. - isValidElement = tt, Et.lazy = Di, Et.memo = z, Et.startTransition = Oa, Et.unstable_act = YS, Et.useCallback = nr, Et.useContext = ge, Et. - useDebugValue = Ai, Et.useDeferredValue = _a, Et.useEffect = ot, Et.useId = jS, Et.useImperativeHandle = Un, Et.useInsertionEffect = Ue, - Et.useLayoutEffect = Yr, Et.useMemo = ar, Et.useReducer = dt, Et.useRef = Ct, Et.useState = je, Et.useSyncExternalStore = hs, Et.useTransition = - gf, Et.version = e, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "\ -function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); - })(); -}); - -// ../node_modules/react/index.js -var fe = k((Nze, LI) => { - "use strict"; - LI.exports = II(); -}); - -// ../node_modules/scheduler/cjs/scheduler.development.js -var PI = k((Jt) => { - "use strict"; - (function() { - "use strict"; - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__. - registerInternalModuleStart(new Error()); - var e = !1, t = !1, r = 5; - function o(ye, Be) { - var tt = ye.length; - ye.push(Be), c(ye, Be, tt); - } - a(o, "push"); - function s(ye) { - return ye.length === 0 ? null : ye[0]; - } - a(s, "peek"); - function l(ye) { - if (ye.length === 0) - return null; - var Be = ye[0], tt = ye.pop(); - return tt !== Be && (ye[0] = tt, p(ye, tt, 0)), Be; - } - a(l, "pop"); - function c(ye, Be, tt) { - for (var Ot = tt; Ot > 0; ) { - var Wt = Ot - 1 >>> 1, hn = ye[Wt]; - if (h(hn, Be) > 0) - ye[Wt] = Be, ye[Ot] = hn, Ot = Wt; - else - return; - } - } - a(c, "siftUp"); - function p(ye, Be, tt) { - for (var Ot = tt, Wt = ye.length, hn = Wt >>> 1; Ot < hn; ) { - var Cr = (Ot + 1) * 2 - 1, Ta = ye[Cr], Gt = Cr + 1, sa = ye[Gt]; - if (h(Ta, Be) < 0) - Gt < Wt && h(sa, Ta) < 0 ? (ye[Ot] = sa, ye[Gt] = Be, Ot = Gt) : (ye[Ot] = Ta, ye[Cr] = Be, Ot = Cr); - else if (Gt < Wt && h(sa, Be) < 0) - ye[Ot] = sa, ye[Gt] = Be, Ot = Gt; - else - return; - } - } - a(p, "siftDown"); - function h(ye, Be) { - var tt = ye.sortIndex - Be.sortIndex; - return tt !== 0 ? tt : ye.id - Be.id; - } - a(h, "compare"); - var v = 1, g = 2, b = 3, w = 4, x = 5; - function R(ye, Be) { - } - a(R, "markTaskErrored"); - var C = typeof performance == "object" && typeof performance.now == "function"; - if (C) { - var D = performance; - Jt.unstable_now = function() { - return D.now(); - }; - } else { - var F = Date, O = F.now(); - Jt.unstable_now = function() { - return F.now() - O; - }; - } - var I = 1073741823, P = -1, N = 250, H = 5e3, B = 1e4, q = I, V = [], ne = [], ce = 1, de = null, te = b, he = !1, X = !1, le = !1, xe = typeof setTimeout == - "function" ? setTimeout : null, Me = typeof clearTimeout == "function" ? clearTimeout : null, Re = typeof setImmediate < "u" ? setImmediate : - null, Ne = typeof navigator < "u" && navigator.scheduling !== void 0 && navigator.scheduling.isInputPending !== void 0 ? navigator.scheduling. - isInputPending.bind(navigator.scheduling) : null; - function Pe(ye) { - for (var Be = s(ne); Be !== null; ) { - if (Be.callback === null) - l(ne); - else if (Be.startTime <= ye) - l(ne), Be.sortIndex = Be.expirationTime, o(V, Be); - else - return; - Be = s(ne); - } + } + a(H$, "Oe"); + var j$ = go && "documentMode" in document && 11 >= document.documentMode, Ss = null, c5 = null, Lc = null, p5 = !1; + function RS(e, t, r) { + var n = r.window === r ? r.document : r.nodeType === 9 ? r : r.ownerDocument; + p5 || Ss == null || Ss !== Kd(n) || (n = Ss, "selectionStart" in n && J5(n) ? n = { start: n.selectionStart, end: n.selectionEnd } : (n = + (n.ownerDocument && n.ownerDocument.defaultView || window).getSelection(), n = { anchorNode: n.anchorNode, anchorOffset: n.anchorOffset, + focusNode: n.focusNode, focusOffset: n.focusOffset }), Lc && Gc(Lc, n) || (Lc = n, n = r0(c5, "onSelect"), 0 < n.length && (t = new K5("\ +onSelect", "select", null, t, r), e.push({ event: t, listeners: n }), t.target = Ss))); + } + a(RS, "Ue"); + function Td(e, t) { + var r = {}; + return r[e.toLowerCase()] = t.toLowerCase(), r["Webkit" + e] = "webkit" + t, r["Moz" + e] = "moz" + t, r; + } + a(Td, "Ve"); + var Es = { animationend: Td("Animation", "AnimationEnd"), animationiteration: Td("Animation", "AnimationIteration"), animationstart: Td("A\ +nimation", "AnimationStart"), transitionend: Td("Transition", "TransitionEnd") }, P2 = {}, QE = {}; + go && (QE = document.createElement("div").style, "AnimationEvent" in window || (delete Es.animationend.animation, delete Es.animationiteration. + animation, delete Es.animationstart.animation), "TransitionEvent" in window || delete Es.transitionend.transition); + function E0(e) { + if (P2[e]) return P2[e]; + if (!Es[e]) return e; + var t = Es[e], r; + for (r in t) if (t.hasOwnProperty(r) && r in QE) return P2[e] = t[r]; + return e; + } + a(E0, "Ze"); + var JE = E0("animationend"), ZE = E0("animationiteration"), e7 = E0("animationstart"), t7 = E0("transitionend"), r7 = /* @__PURE__ */ new Map(), + AS = "abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dra\ +gStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetada\ +ta loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMov\ +e pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd to\ +uchStart volumeChange scroll toggle touchMove waiting wheel".split(" "); + function da(e, t) { + r7.set(e, t), di(t, [e]); + } + a(da, "ff"); + for (kd = 0; kd < AS.length; kd++) + Id = AS[kd], _S = Id.toLowerCase(), TS = Id[0].toUpperCase() + Id.slice(1), da(_S, "on" + TS); + var Id, _S, TS, kd; + da(JE, "onAnimationEnd"); + da(ZE, "onAnimationIteration"); + da(e7, "onAnimationStart"); + da("dblclick", "onDoubleClick"); + da("focusin", "onFocus"); + da("focusout", "onBlur"); + da(t7, "onTransitionEnd"); + Ns("onMouseEnter", ["mouseout", "mouseover"]); + Ns("onMouseLeave", ["mouseout", "mouseover"]); + Ns("onPointerEnter", ["pointerout", "pointerover"]); + Ns("onPointerLeave", ["pointerout", "pointerover"]); + di("onChange", "change click focusin focusout input keydown keyup selectionchange".split(" ")); + di("onSelect", "focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")); + di("onBeforeInput", ["compositionend", "keypress", "textInput", "paste"]); + di("onCompositionEnd", "compositionend focusout keydown keypress keyup mousedown".split(" ")); + di("onCompositionStart", "compositionstart focusout keydown keypress keyup mousedown".split(" ")); + di("onCompositionUpdate", "compositionupdate focusout keydown keypress keyup mousedown".split(" ")); + var kc = "abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing\ + progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "), V$ = new Set("cancel close invalid l\ +oad scroll toggle".split(" ").concat(kc)); + function kS(e, t, r) { + var n = e.type || "unknown-event"; + e.currentTarget = r, VB(n, t, void 0, e), e.currentTarget = null; + } + a(kS, "nf"); + function n7(e, t) { + t = (t & 4) !== 0; + for (var r = 0; r < e.length; r++) { + var n = e[r], o = n.event; + n = n.listeners; + e: { + var i = void 0; + if (t) for (var s = n.length - 1; 0 <= s; s--) { + var l = n[s], u = l.instance, c = l.currentTarget; + if (l = l.listener, u !== i && o.isPropagationStopped()) break e; + kS(o, l, c), i = u; + } + else for (s = 0; s < n.length; s++) { + if (l = n[s], u = l.instance, c = l.currentTarget, l = l.listener, u !== i && o.isPropagationStopped()) break e; + kS(o, l, c), i = u; + } + } + } + if (Qd) throw e = i5, Qd = !1, i5 = null, e; + } + a(n7, "se"); + function Ce(e, t) { + var r = t[g5]; + r === void 0 && (r = t[g5] = /* @__PURE__ */ new Set()); + var n = e + "__bubble"; + r.has(n) || (o7(t, e, 2, !1), r.add(n)); + } + a(Ce, "D"); + function F2(e, t, r) { + var n = 0; + t && (n |= 4), o7(r, e, n, t); + } + a(F2, "qf"); + var Pd = "_reactListening" + Math.random().toString(36).slice(2); + function Yc(e) { + if (!e[Pd]) { + e[Pd] = !0, pE.forEach(function(r) { + r !== "selectionchange" && (V$.has(r) || F2(r, !1, e), F2(r, !0, e)); + }); + var t = e.nodeType === 9 ? e : e.ownerDocument; + t === null || t[Pd] || (t[Pd] = !0, F2("selectionchange", !1, t)); } - a(Pe, "advanceTimers"); - function Ke(ye) { - if (le = !1, Pe(ye), !X) - if (s(V) !== null) - X = !0, oa(mt); - else { - var Be = s(ne); - Be !== null && gr(Ke, Be.startTime - ye); + } + a(Yc, "sf"); + function o7(e, t, r, n) { + switch (HE(t)) { + case 1: + var o = a$; + break; + case 4: + o = i$; + break; + default: + o = G5; + } + r = o.bind(null, t, r, e), o = void 0, !a5 || t !== "touchstart" && t !== "touchmove" && t !== "wheel" || (o = !0), n ? o !== void 0 ? e. + addEventListener(t, r, { capture: !0, passive: o }) : e.addEventListener(t, r, !0) : o !== void 0 ? e.addEventListener(t, r, { passive: o }) : + e.addEventListener(t, r, !1); + } + a(o7, "pf"); + function O2(e, t, r, n, o) { + var i = n; + if (!(t & 1) && !(t & 2) && n !== null) e: for (; ; ) { + if (n === null) return; + var s = n.tag; + if (s === 3 || s === 4) { + var l = n.stateNode.containerInfo; + if (l === o || l.nodeType === 8 && l.parentNode === o) break; + if (s === 4) for (s = n.return; s !== null; ) { + var u = s.tag; + if ((u === 3 || u === 4) && (u = s.stateNode.containerInfo, u === o || u.nodeType === 8 && u.parentNode === o)) return; + s = s.return; + } + for (; l !== null; ) { + if (s = ni(l), s === null) return; + if (u = s.tag, u === 5 || u === 6) { + n = i = s; + continue e; + } + l = l.parentNode; } + } + n = n.return; } - a(Ke, "handleTimeout"); - function mt(ye, Be) { - X = !1, le && (le = !1, ia()), he = !0; - var tt = te; - try { - if (t) - try { - return ft(ye, Be); - } catch (Wt) { - if (de !== null) { - var Ot = Jt.unstable_now(); - de.isQueued = !1; + AE(function() { + var c = i, p = V5(r), h = []; + e: { + var m = r7.get(e); + if (m !== void 0) { + var g = K5, S = e; + switch (e) { + case "keypress": + if (Hd(r) === 0) break e; + case "keydown": + case "keyup": + g = S$; + break; + case "focusin": + S = "focus", g = k2; + break; + case "focusout": + S = "blur", g = k2; + break; + case "beforeblur": + case "afterblur": + g = k2; + break; + case "click": + if (r.button === 2) break e; + case "auxclick": + case "dblclick": + case "mousedown": + case "mousemove": + case "mouseup": + case "mouseout": + case "mouseover": + case "contextmenu": + g = vS; + break; + case "drag": + case "dragend": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "dragstart": + case "drop": + g = u$; + break; + case "touchcancel": + case "touchend": + case "touchmove": + case "touchstart": + g = C$; + break; + case JE: + case ZE: + case e7: + g = f$; + break; + case t7: + g = R$; + break; + case "scroll": + g = s$; + break; + case "wheel": + g = _$; + break; + case "copy": + case "cut": + case "paste": + g = h$; + break; + case "gotpointercapture": + case "lostpointercapture": + case "pointercancel": + case "pointerdown": + case "pointermove": + case "pointerout": + case "pointerover": + case "pointerup": + g = wS; + } + var v = (t & 4) !== 0, b = !v && e === "scroll", w = v ? m !== null ? m + "Capture" : null : m; + v = []; + for (var y = c, E; y !== null; ) { + E = y; + var x = E.stateNode; + if (E.tag === 5 && x !== null && (E = x, w !== null && (x = jc(y, w), x != null && v.push(Kc(y, x, E)))), b) break; + y = y.return; + } + 0 < v.length && (m = new g(m, S, null, r, p), h.push({ event: m, listeners: v })); + } + } + if (!(t & 7)) { + e: { + if (m = e === "mouseover" || e === "pointerover", g = e === "mouseout" || e === "pointerout", m && r !== n5 && (S = r.relatedTarget || + r.fromElement) && (ni(S) || S[vo])) break e; + if ((g || m) && (m = p.window === p ? p : (m = p.ownerDocument) ? m.defaultView || m.parentWindow : window, g ? (S = r.relatedTarget || + r.toElement, g = c, S = S ? ni(S) : null, S !== null && (b = hi(S), S !== b || S.tag !== 5 && S.tag !== 6) && (S = null)) : (g = null, + S = c), g !== S)) { + if (v = vS, x = "onMouseLeave", w = "onMouseEnter", y = "mouse", (e === "pointerout" || e === "pointerover") && (v = wS, x = "on\ +PointerLeave", w = "onPointerEnter", y = "pointer"), b = g == null ? m : xs(g), E = S == null ? m : xs(S), m = new v(x, y + "leave", g, r, p), + m.target = b, m.relatedTarget = E, x = null, ni(p) === c && (v = new v(w, y + "enter", S, r, p), v.target = E, v.relatedTarget = + b, x = v), b = x, g && S) t: { + for (v = g, w = S, y = 0, E = v; E; E = vs(E)) y++; + for (E = 0, x = w; x; x = vs(x)) E++; + for (; 0 < y - E; ) v = vs(v), y--; + for (; 0 < E - y; ) w = vs(w), E--; + for (; y--; ) { + if (v === w || w !== null && v === w.alternate) break t; + v = vs(v), w = vs(w); + } + v = null; } - throw Wt; + else v = null; + g !== null && IS(h, m, g, v, !1), S !== null && b !== null && IS(h, b, S, v, !0); } - else - return ft(ye, Be); - } finally { - de = null, te = tt, he = !1; - } - } - a(mt, "flushWork"); - function ft(ye, Be) { - var tt = Be; - for (Pe(tt), de = s(V); de !== null && !e && !(de.expirationTime > tt && (!ye || Se())); ) { - var Ot = de.callback; - if (typeof Ot == "function") { - de.callback = null, te = de.priorityLevel; - var Wt = de.expirationTime <= tt, hn = Ot(Wt); - tt = Jt.unstable_now(), typeof hn == "function" ? de.callback = hn : de === s(V) && l(V), Pe(tt); - } else - l(V); - de = s(V); - } - if (de !== null) - return !0; - var Cr = s(ne); - return Cr !== null && gr(Ke, Cr.startTime - tt), !1; - } - a(ft, "workLoop"); - function yt(ye, Be) { - switch (ye) { - case v: - case g: - case b: - case w: - case x: - break; - default: - ye = b; - } - var tt = te; - te = ye; - try { - return Be(); - } finally { - te = tt; - } - } - a(yt, "unstable_runWithPriority"); - function bt(ye) { - var Be; - switch (te) { - case v: - case g: - case b: - Be = b; - break; - default: - Be = te; - break; - } - var tt = te; - te = Be; - try { - return ye(); - } finally { - te = tt; - } - } - a(bt, "unstable_next"); - function Tt(ye) { - var Be = te; - return function() { - var tt = te; - te = Be; - try { - return ye.apply(this, arguments); - } finally { - te = tt; } - }; - } - a(Tt, "unstable_wrapCallback"); - function kt(ye, Be, tt) { - var Ot = Jt.unstable_now(), Wt; - if (typeof tt == "object" && tt !== null) { - var hn = tt.delay; - typeof hn == "number" && hn > 0 ? Wt = Ot + hn : Wt = Ot; - } else - Wt = Ot; - var Cr; - switch (ye) { - case v: - Cr = P; - break; - case g: - Cr = N; - break; - case x: - Cr = q; - break; - case w: - Cr = B; - break; - case b: - default: - Cr = H; - break; - } - var Ta = Wt + Cr, Gt = { - id: ce++, - callback: Be, - priorityLevel: ye, - startTime: Wt, - expirationTime: Ta, - sortIndex: -1 - }; - return Wt > Ot ? (Gt.sortIndex = Wt, o(ne, Gt), s(V) === null && Gt === s(ne) && (le ? ia() : le = !0, gr(Ke, Wt - Ot))) : (Gt.sortIndex = - Ta, o(V, Gt), !X && !he && (X = !0, oa(mt))), Gt; - } - a(kt, "unstable_scheduleCallback"); - function vr() { - } - a(vr, "unstable_pauseExecution"); - function kr() { - !X && !he && (X = !0, oa(mt)); - } - a(kr, "unstable_continueExecution"); - function Er() { - return s(V); - } - a(Er, "unstable_getFirstCallbackNode"); - function Te(ye) { - ye.callback = null; - } - a(Te, "unstable_cancelCallback"); - function cr() { - return te; - } - a(cr, "unstable_getCurrentPriorityLevel"); - var fr = !1, Zt = null, Mr = -1, Nr = r, xr = -1; - function Se() { - var ye = Jt.unstable_now() - xr; - return !(ye < Nr); - } - a(Se, "shouldYieldToHost"); - function zn() { - } - a(zn, "requestPaint"); - function Wa(ye) { - if (ye < 0 || ye > 125) { - console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"); - return; + e: { + if (m = c ? xs(c) : window, g = m.nodeName && m.nodeName.toLowerCase(), g === "select" || g === "input" && m.type === "file") var C = L$; + else if (ES(m)) if (GE) C = $$; + else { + C = M$; + var D = N$; + } + else (g = m.nodeName) && g.toLowerCase() === "input" && (m.type === "checkbox" || m.type === "radio") && (C = B$); + if (C && (C = C(e, c))) { + qE(h, C, r, p); + break e; + } + D && D(e, m, c), e === "focusout" && (D = m._wrapperState) && D.controlled && m.type === "number" && J2(m, "number", m.value); + } + switch (D = c ? xs(c) : window, e) { + case "focusin": + (ES(D) || D.contentEditable === "true") && (Ss = D, c5 = c, Lc = null); + break; + case "focusout": + Lc = c5 = Ss = null; + break; + case "mousedown": + p5 = !0; + break; + case "contextmenu": + case "mouseup": + case "dragend": + p5 = !1, RS(h, r, p); + break; + case "selectionchange": + if (j$) break; + case "keydown": + case "keyup": + RS(h, r, p); + } + var R; + if (Q5) e: { + switch (e) { + case "compositionstart": + var A = "onCompositionStart"; + break e; + case "compositionend": + A = "onCompositionEnd"; + break e; + case "compositionupdate": + A = "onCompositionUpdate"; + break e; + } + A = void 0; + } + else bs ? UE(e, r) && (A = "onCompositionEnd") : e === "keydown" && r.keyCode === 229 && (A = "onCompositionStart"); + A && (VE && r.locale !== "ko" && (bs || A !== "onCompositionStart" ? A === "onCompositionEnd" && bs && (R = jE()) : (ta = p, Y5 = "v\ +alue" in ta ? ta.value : ta.textContent, bs = !0)), D = r0(c, A), 0 < D.length && (A = new yS(A, e, null, r, p), h.push({ event: A, listeners: D }), + R ? A.data = R : (R = WE(r), R !== null && (A.data = R)))), (R = k$ ? I$(e, r) : P$(e, r)) && (c = r0(c, "onBeforeInput"), 0 < c.length && + (p = new yS("onBeforeInput", "beforeinput", null, r, p), h.push({ event: p, listeners: c }), p.data = R)); } - ye > 0 ? Nr = Math.floor(1e3 / ye) : Nr = r; + n7(h, t); + }); + } + a(O2, "hd"); + function Kc(e, t, r) { + return { instance: e, listener: t, currentTarget: r }; + } + a(Kc, "tf"); + function r0(e, t) { + for (var r = t + "Capture", n = []; e !== null; ) { + var o = e, i = o.stateNode; + o.tag === 5 && i !== null && (o = i, i = jc(e, r), i != null && n.unshift(Kc(e, i, o)), i = jc(e, t), i != null && n.push(Kc(e, i, o))), + e = e.return; } - a(Wa, "forceFrameRate"); - var aa = /* @__PURE__ */ a(function() { - if (Zt !== null) { - var ye = Jt.unstable_now(); - xr = ye; - var Be = !0, tt = !0; - try { - tt = Zt(Be, ye); - } finally { - tt ? Gr() : (fr = !1, Zt = null); + return n; + } + a(r0, "oe"); + function vs(e) { + if (e === null) return null; + do + e = e.return; + while (e && e.tag !== 5); + return e || null; + } + a(vs, "vf"); + function IS(e, t, r, n, o) { + for (var i = t._reactName, s = []; r !== null && r !== n; ) { + var l = r, u = l.alternate, c = l.stateNode; + if (u !== null && u === n) break; + l.tag === 5 && c !== null && (l = c, o ? (u = jc(r, i), u != null && s.unshift(Kc(r, u, l))) : o || (u = jc(r, i), u != null && s.push( + Kc(r, u, l)))), r = r.return; + } + s.length !== 0 && e.push({ event: t, listeners: s }); + } + a(IS, "wf"); + var U$ = /\r\n?/g, W$ = /\u0000|\uFFFD/g; + function PS(e) { + return (typeof e == "string" ? e : "" + e).replace(U$, ` +`).replace(W$, ""); + } + a(PS, "zf"); + function Fd(e, t, r) { + if (t = PS(t), PS(e) !== t && r) throw Error(M(425)); + } + a(Fd, "Af"); + function n0() { + } + a(n0, "Bf"); + var f5 = null, d5 = null; + function h5(e, t) { + return e === "textarea" || e === "noscript" || typeof t.children == "string" || typeof t.children == "number" || typeof t.dangerouslySetInnerHTML == + "object" && t.dangerouslySetInnerHTML !== null && t.dangerouslySetInnerHTML.__html != null; + } + a(h5, "Ef"); + var m5 = typeof setTimeout == "function" ? setTimeout : void 0, q$ = typeof clearTimeout == "function" ? clearTimeout : void 0, FS = typeof Promise == + "function" ? Promise : void 0, G$ = typeof queueMicrotask == "function" ? queueMicrotask : typeof FS < "u" ? function(e) { + return FS.resolve(null).then(e).catch(Y$); + } : m5; + function Y$(e) { + setTimeout(function() { + throw e; + }); + } + a(Y$, "If"); + function L2(e, t) { + var r = t, n = 0; + do { + var o = r.nextSibling; + if (e.removeChild(r), o && o.nodeType === 8) if (r = o.data, r === "/$") { + if (n === 0) { + e.removeChild(o), Wc(t); + return; } - } else - fr = !1; - }, "performWorkUntilDeadline"), Gr; - if (typeof Re == "function") - Gr = /* @__PURE__ */ a(function() { - Re(aa); - }, "schedulePerformWorkUntilDeadline"); - else if (typeof MessageChannel < "u") { - var jn = new MessageChannel(), pn = jn.port2; - jn.port1.onmessage = aa, Gr = /* @__PURE__ */ a(function() { - pn.postMessage(null); - }, "schedulePerformWorkUntilDeadline"); - } else - Gr = /* @__PURE__ */ a(function() { - xe(aa, 0); - }, "schedulePerformWorkUntilDeadline"); - function oa(ye) { - Zt = ye, fr || (fr = !0, Gr()); - } - a(oa, "requestHostCallback"); - function gr(ye, Be) { - Mr = xe(function() { - ye(Jt.unstable_now()); - }, Be); - } - a(gr, "requestHostTimeout"); - function ia() { - Me(Mr), Mr = -1; - } - a(ia, "cancelHostTimeout"); - var zo = zn, ds = null; - Jt.unstable_IdlePriority = x, Jt.unstable_ImmediatePriority = v, Jt.unstable_LowPriority = w, Jt.unstable_NormalPriority = b, Jt.unstable_Profiling = - ds, Jt.unstable_UserBlockingPriority = g, Jt.unstable_cancelCallback = Te, Jt.unstable_continueExecution = kr, Jt.unstable_forceFrameRate = - Wa, Jt.unstable_getCurrentPriorityLevel = cr, Jt.unstable_getFirstCallbackNode = Er, Jt.unstable_next = bt, Jt.unstable_pauseExecution = - vr, Jt.unstable_requestPaint = zo, Jt.unstable_runWithPriority = yt, Jt.unstable_scheduleCallback = kt, Jt.unstable_shouldYield = Se, Jt. - unstable_wrapCallback = Tt, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == - "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); - })(); -}); - -// ../node_modules/scheduler/index.js -var MI = k(($ze, kI) => { - "use strict"; - kI.exports = PI(); -}); - -// ../node_modules/react-dom/cjs/react-dom.development.js -var NI = k((to) => { - "use strict"; - (function() { - "use strict"; - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__. - registerInternalModuleStart(new Error()); - var e = fe(), t = MI(), r = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, o = !1; - function s(n) { - o = n; - } - a(s, "setSuppressWarning"); - function l(n) { - if (!o) { - for (var i = arguments.length, u = new Array(i > 1 ? i - 1 : 0), d = 1; d < i; d++) - u[d - 1] = arguments[d]; - p("warn", n, u); - } - } - a(l, "warn"); - function c(n) { - if (!o) { - for (var i = arguments.length, u = new Array(i > 1 ? i - 1 : 0), d = 1; d < i; d++) - u[d - 1] = arguments[d]; - p("error", n, u); - } - } - a(c, "error"); - function p(n, i, u) { - { - var d = r.ReactDebugCurrentFrame, m = d.getStackAddendum(); - m !== "" && (i += "%s", u = u.concat([m])); - var y = u.map(function(E) { - return String(E); - }); - y.unshift("Warning: " + i), Function.prototype.apply.call(console[n], console, y); + n--; + } else r !== "$" && r !== "$?" && r !== "$!" || n++; + r = o; + } while (r); + Wc(t); + } + a(L2, "Kf"); + function ia(e) { + for (; e != null; e = e.nextSibling) { + var t = e.nodeType; + if (t === 1 || t === 3) break; + if (t === 8) { + if (t = e.data, t === "$" || t === "$!" || t === "$?") break; + if (t === "/$") return null; } } - a(p, "printWarning"); - var h = 0, v = 1, g = 2, b = 3, w = 4, x = 5, R = 6, C = 7, D = 8, F = 9, O = 10, I = 11, P = 12, N = 13, H = 14, B = 15, q = 16, V = 17, - ne = 18, ce = 19, de = 21, te = 22, he = 23, X = 24, le = 25, xe = !0, Me = !1, Re = !1, Ne = !1, Pe = !1, Ke = !0, mt = !1, ft = !1, yt = !0, - bt = !0, Tt = !0, kt = /* @__PURE__ */ new Set(), vr = {}, kr = {}; - function Er(n, i) { - Te(n, i), Te(n + "Capture", i); - } - a(Er, "registerTwoPhaseEvent"); - function Te(n, i) { - vr[n] && c("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.", n), vr[n] = i; - { - var u = n.toLowerCase(); - kr[u] = n, n === "onDoubleClick" && (kr.ondblclick = n); + return e; + } + a(ia, "Lf"); + function OS(e) { + e = e.previousSibling; + for (var t = 0; e; ) { + if (e.nodeType === 8) { + var r = e.data; + if (r === "$" || r === "$!" || r === "$?") { + if (t === 0) return e; + t--; + } else r === "/$" && t++; } - for (var d = 0; d < i.length; d++) - kt.add(i[d]); + e = e.previousSibling; } - a(Te, "registerDirectEvent"); - var cr = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", fr = Object.prototype.hasOwnProperty; - function Zt(n) { - { - var i = typeof Symbol == "function" && Symbol.toStringTag, u = i && n[Symbol.toStringTag] || n.constructor.name || "Object"; - return u; + return null; + } + a(OS, "Mf"); + var Us = Math.random().toString(36).slice(2), Mn = "__reactFiber$" + Us, Xc = "__reactProps$" + Us, vo = "__reactContainer$" + Us, g5 = "_\ +_reactEvents$" + Us, K$ = "__reactListeners$" + Us, X$ = "__reactHandles$" + Us; + function ni(e) { + var t = e[Mn]; + if (t) return t; + for (var r = e.parentNode; r; ) { + if (t = r[vo] || r[Mn]) { + if (r = t.alternate, t.child !== null || r !== null && r.child !== null) for (e = OS(e); e !== null; ) { + if (r = e[Mn]) return r; + e = OS(e); + } + return t; } + e = r, r = e.parentNode; } - a(Zt, "typeName"); - function Mr(n) { + return null; + } + a(ni, "Wc"); + function ap(e) { + return e = e[Mn] || e[vo], !e || e.tag !== 5 && e.tag !== 6 && e.tag !== 13 && e.tag !== 3 ? null : e; + } + a(ap, "Cb"); + function xs(e) { + if (e.tag === 5 || e.tag === 6) return e.stateNode; + throw Error(M(33)); + } + a(xs, "ue"); + function x0(e) { + return e[Xc] || null; + } + a(x0, "Db"); + var v5 = [], Cs = -1; + function ha(e) { + return { current: e }; + } + a(ha, "Uf"); + function De(e) { + 0 > Cs || (e.current = v5[Cs], v5[Cs] = null, Cs--); + } + a(De, "E"); + function xe(e, t) { + Cs++, v5[Cs] = e.current, e.current = t; + } + a(xe, "G"); + var fa = {}, Pt = ha(fa), or = ha(!1), li = fa; + function Ms(e, t) { + var r = e.type.contextTypes; + if (!r) return fa; + var n = e.stateNode; + if (n && n.__reactInternalMemoizedUnmaskedChildContext === t) return n.__reactInternalMemoizedMaskedChildContext; + var o = {}, i; + for (i in r) o[i] = t[i]; + return n && (e = e.stateNode, e.__reactInternalMemoizedUnmaskedChildContext = t, e.__reactInternalMemoizedMaskedChildContext = o), o; + } + a(Ms, "Yf"); + function ar(e) { + return e = e.childContextTypes, e != null; + } + a(ar, "Zf"); + function o0() { + De(or), De(Pt); + } + a(o0, "$f"); + function LS(e, t, r) { + if (Pt.current !== fa) throw Error(M(168)); + xe(Pt, t), xe(or, r); + } + a(LS, "ag"); + function a7(e, t, r) { + var n = e.stateNode; + if (t = t.childContextTypes, typeof n.getChildContext != "function") return r; + n = n.getChildContext(); + for (var o in n) if (!(o in t)) throw Error(M(108, NB(e) || "Unknown", o)); + return Ne({}, r, n); + } + a(a7, "bg"); + function a0(e) { + return e = (e = e.stateNode) && e.__reactInternalMemoizedMergedChildContext || fa, li = Pt.current, xe(Pt, e), xe(or, or.current), !0; + } + a(a0, "cg"); + function NS(e, t, r) { + var n = e.stateNode; + if (!n) throw Error(M(169)); + r ? (e = a7(e, t, li), n.__reactInternalMemoizedMergedChildContext = e, De(or), De(Pt), xe(Pt, e)) : De(or), xe(or, r); + } + a(NS, "dg"); + var po = null, C0 = !1, N2 = !1; + function i7(e) { + po === null ? po = [e] : po.push(e); + } + a(i7, "hg"); + function Q$(e) { + C0 = !0, i7(e); + } + a(Q$, "ig"); + function ma() { + if (!N2 && po !== null) { + N2 = !0; + var e = 0, t = me; try { - return Nr(n), !1; - } catch { - return !0; - } - } - a(Mr, "willCoercionThrow"); - function Nr(n) { - return "" + n; - } - a(Nr, "testStringCoercion"); - function xr(n, i) { - if (Mr(n)) - return c("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before before using it here.", - i, Zt(n)), Nr(n); - } - a(xr, "checkAttributeStringCoercion"); - function Se(n) { - if (Mr(n)) - return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Zt(n)), Nr( - n); - } - a(Se, "checkKeyStringCoercion"); - function zn(n, i) { - if (Mr(n)) - return c("The provided `%s` prop is an unsupported type %s. This value must be coerced to a string before before using it here.", i, - Zt(n)), Nr(n); - } - a(zn, "checkPropStringCoercion"); - function Wa(n, i) { - if (Mr(n)) - return c("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before before using it he\ -re.", i, Zt(n)), Nr(n); - } - a(Wa, "checkCSSPropertyStringCoercion"); - function aa(n) { - if (Mr(n)) - return c("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before before using i\ -t here.", Zt(n)), Nr(n); - } - a(aa, "checkHtmlStringCoercion"); - function Gr(n) { - if (Mr(n)) - return c("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coer\ -ced to a string before before using it here.", Zt(n)), Nr(n); - } - a(Gr, "checkFormFieldValueStringCoercion"); - var jn = 0, pn = 1, oa = 2, gr = 3, ia = 4, zo = 5, ds = 6, ye = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1\ -FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", Be = ye + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\\ -u2040", tt = new RegExp("^[" + ye + "][" + Be + "]*$"), Ot = {}, Wt = {}; - function hn(n) { - return fr.call(Wt, n) ? !0 : fr.call(Ot, n) ? !1 : tt.test(n) ? (Wt[n] = !0, !0) : (Ot[n] = !0, c("Invalid attribute name: `%s`", n), !1); - } - a(hn, "isAttributeNameSafe"); - function Cr(n, i, u) { - return i !== null ? i.type === jn : u ? !1 : n.length > 2 && (n[0] === "o" || n[0] === "O") && (n[1] === "n" || n[1] === "N"); - } - a(Cr, "shouldIgnoreAttribute"); - function Ta(n, i, u, d) { - if (u !== null && u.type === jn) - return !1; - switch (typeof i) { - case "function": - case "symbol": - return !0; - case "boolean": { - if (d) - return !1; - if (u !== null) - return !u.acceptsBooleans; - var m = n.toLowerCase().slice(0, 5); - return m !== "data-" && m !== "aria-"; + var r = po; + for (me = 1; e < r.length; e++) { + var n = r[e]; + do + n = n(!0); + while (n !== null); } - default: - return !1; + po = null, C0 = !1; + } catch (o) { + throw po !== null && (po = po.slice(e + 1)), IE(U5, ma), o; + } finally { + me = t, N2 = !1; } } - a(Ta, "shouldRemoveAttributeWithWarning"); - function Gt(n, i, u, d) { - if (i === null || typeof i > "u" || Ta(n, i, u, d)) - return !0; - if (d) + return null; + } + a(ma, "jg"); + var Ds = [], Rs = 0, i0 = null, s0 = 0, Or = [], Lr = 0, ui = null, fo = 1, ho = ""; + function ti(e, t) { + Ds[Rs++] = s0, Ds[Rs++] = i0, i0 = e, s0 = t; + } + a(ti, "tg"); + function s7(e, t, r) { + Or[Lr++] = fo, Or[Lr++] = ho, Or[Lr++] = ui, ui = e; + var n = fo; + e = ho; + var o = 32 - pn(n) - 1; + n &= ~(1 << o), r += 1; + var i = 32 - pn(t) + o; + if (30 < i) { + var s = o - o % 5; + i = (n & (1 << s) - 1).toString(32), n >>= s, o -= s, fo = 1 << 32 - pn(t) + o | r << o | n, ho = i + e; + } else fo = 1 << i | r << o | n, ho = e; + } + a(s7, "ug"); + function Z5(e) { + e.return !== null && (ti(e, 1), s7(e, 1, 0)); + } + a(Z5, "vg"); + function ev(e) { + for (; e === i0; ) i0 = Ds[--Rs], Ds[Rs] = null, s0 = Ds[--Rs], Ds[Rs] = null; + for (; e === ui; ) ui = Or[--Lr], Or[Lr] = null, ho = Or[--Lr], Or[Lr] = null, fo = Or[--Lr], Or[Lr] = null; + } + a(ev, "wg"); + var wr = null, yr = null, Te = !1, cn = null; + function l7(e, t) { + var r = Nr(5, null, null, 0); + r.elementType = "DELETED", r.stateNode = t, r.return = e, t = e.deletions, t === null ? (e.deletions = [r], e.flags |= 16) : t.push(r); + } + a(l7, "Ag"); + function MS(e, t) { + switch (e.tag) { + case 5: + var r = e.type; + return t = t.nodeType !== 1 || r.toLowerCase() !== t.nodeName.toLowerCase() ? null : t, t !== null ? (e.stateNode = t, wr = e, yr = ia( + t.firstChild), !0) : !1; + case 6: + return t = e.pendingProps === "" || t.nodeType !== 3 ? null : t, t !== null ? (e.stateNode = t, wr = e, yr = null, !0) : !1; + case 13: + return t = t.nodeType !== 8 ? null : t, t !== null ? (r = ui !== null ? { id: fo, overflow: ho } : null, e.memoizedState = { dehydrated: t, + treeContext: r, retryLane: 1073741824 }, r = Nr(18, null, null, 0), r.stateNode = t, r.return = e, e.child = r, wr = e, yr = null, !0) : + !1; + default: return !1; - if (u !== null) - switch (u.type) { - case gr: - return !i; - case ia: - return i === !1; - case zo: - return isNaN(i); - case ds: - return isNaN(i) || i < 1; - } - return !1; } - a(Gt, "shouldRemoveAttribute"); - function sa(n) { - return er.hasOwnProperty(n) ? er[n] : null; - } - a(sa, "getPropertyInfo"); - function Yt(n, i, u, d, m, y, E) { - this.acceptsBooleans = i === oa || i === gr || i === ia, this.attributeName = d, this.attributeNamespace = m, this.mustUseProperty = u, - this.propertyName = n, this.type = i, this.sanitizeURL = y, this.removeEmptyString = E; - } - a(Yt, "PropertyInfoRecord"); - var er = {}, Fu = [ - "children", - "dangerouslySetInnerHTML", - // TODO: This prevents the assignment of defaultValue to regular - // elements (not just inputs). Now that ReactDOMInput assigns to the - // defaultValue property -- do we need this? - "defaultValue", - "defaultChecked", - "innerHTML", - "suppressContentEditableWarning", - "suppressHydrationWarning", - "style" - ]; - Fu.forEach(function(n) { - er[n] = new Yt( - n, - jn, - !1, - // mustUseProperty - n, - // attributeName - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }), [["acceptCharset", "accept-charset"], ["className", "class"], ["htmlFor", "for"], ["httpEquiv", "http-equiv"]].forEach(function(n) { - var i = n[0], u = n[1]; - er[i] = new Yt( - i, - pn, - !1, - // mustUseProperty - u, - // attributeName - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }), ["contentEditable", "draggable", "spellCheck", "value"].forEach(function(n) { - er[n] = new Yt( - n, - oa, - !1, - // mustUseProperty - n.toLowerCase(), - // attributeName - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }), ["autoReverse", "externalResourcesRequired", "focusable", "preserveAlpha"].forEach(function(n) { - er[n] = new Yt( - n, - oa, - !1, - // mustUseProperty - n, - // attributeName - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }), [ - "allowFullScreen", - "async", - // Note: there is a special case that prevents it from being written to the DOM - // on the client side because the browsers are inconsistent. Instead we call focus(). - "autoFocus", - "autoPlay", - "controls", - "default", - "defer", - "disabled", - "disablePictureInPicture", - "disableRemotePlayback", - "formNoValidate", - "hidden", - "loop", - "noModule", - "noValidate", - "open", - "playsInline", - "readOnly", - "required", - "reversed", - "scoped", - "seamless", - // Microdata - "itemScope" - ].forEach(function(n) { - er[n] = new Yt( - n, - gr, - !1, - // mustUseProperty - n.toLowerCase(), - // attributeName - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }), [ - "checked", - // Note: `option.selected` is not updated if `select.multiple` is - // disabled with `removeAttribute`. We have special logic for handling this. - "multiple", - "muted", - "selected" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(n) { - er[n] = new Yt( - n, - gr, - !0, - // mustUseProperty - n, - // attributeName - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }), [ - "capture", - "download" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(n) { - er[n] = new Yt( - n, - ia, - !1, - // mustUseProperty - n, - // attributeName - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }), [ - "cols", - "rows", - "size", - "span" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(n) { - er[n] = new Yt( - n, - ds, - !1, - // mustUseProperty - n, - // attributeName - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }), ["rowSpan", "start"].forEach(function(n) { - er[n] = new Yt( - n, - zo, - !1, - // mustUseProperty - n.toLowerCase(), - // attributeName - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }); - var ul = /[\-\:]([a-z])/g, Iu = /* @__PURE__ */ a(function(n) { - return n[1].toUpperCase(); - }, "capitalize"); - [ - "accent-height", - "alignment-baseline", - "arabic-form", - "baseline-shift", - "cap-height", - "clip-path", - "clip-rule", - "color-interpolation", - "color-interpolation-filters", - "color-profile", - "color-rendering", - "dominant-baseline", - "enable-background", - "fill-opacity", - "fill-rule", - "flood-color", - "flood-opacity", - "font-family", - "font-size", - "font-size-adjust", - "font-stretch", - "font-style", - "font-variant", - "font-weight", - "glyph-name", - "glyph-orientation-horizontal", - "glyph-orientation-vertical", - "horiz-adv-x", - "horiz-origin-x", - "image-rendering", - "letter-spacing", - "lighting-color", - "marker-end", - "marker-mid", - "marker-start", - "overline-position", - "overline-thickness", - "paint-order", - "panose-1", - "pointer-events", - "rendering-intent", - "shape-rendering", - "stop-color", - "stop-opacity", - "strikethrough-position", - "strikethrough-thickness", - "stroke-dasharray", - "stroke-dashoffset", - "stroke-linecap", - "stroke-linejoin", - "stroke-miterlimit", - "stroke-opacity", - "stroke-width", - "text-anchor", - "text-decoration", - "text-rendering", - "underline-position", - "underline-thickness", - "unicode-bidi", - "unicode-range", - "units-per-em", - "v-alphabetic", - "v-hanging", - "v-ideographic", - "v-mathematical", - "vector-effect", - "vert-adv-y", - "vert-origin-x", - "vert-origin-y", - "word-spacing", - "writing-mode", - "xmlns:xlink", - "x-height" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(n) { - var i = n.replace(ul, Iu); - er[i] = new Yt( - i, - pn, - !1, - // mustUseProperty - n, - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }), [ - "xlink:actuate", - "xlink:arcrole", - "xlink:role", - "xlink:show", - "xlink:title", - "xlink:type" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(n) { - var i = n.replace(ul, Iu); - er[i] = new Yt( - i, - pn, - !1, - // mustUseProperty - n, - "http://www.w3.org/1999/xlink", - !1, - // sanitizeURL - !1 - ); - }), [ - "xml:base", - "xml:lang", - "xml:space" - // NOTE: if you add a camelCased prop to this list, - // you'll need to set attributeName to name.toLowerCase() - // instead in the assignment below. - ].forEach(function(n) { - var i = n.replace(ul, Iu); - er[i] = new Yt( - i, - pn, - !1, - // mustUseProperty - n, - "http://www.w3.org/XML/1998/namespace", - !1, - // sanitizeURL - !1 - ); - }), ["tabIndex", "crossOrigin"].forEach(function(n) { - er[n] = new Yt( - n, - pn, - !1, - // mustUseProperty - n.toLowerCase(), - // attributeName - null, - // attributeNamespace - !1, - // sanitizeURL - !1 - ); - }); - var hf = "xlinkHref"; - er[hf] = new Yt( - "xlinkHref", - pn, - !1, - // mustUseProperty - "xlink:href", - "http://www.w3.org/1999/xlink", - !0, - // sanitizeURL - !1 - ), ["src", "href", "action", "formAction"].forEach(function(n) { - er[n] = new Yt( - n, - pn, - !1, - // mustUseProperty - n.toLowerCase(), - // attributeName - null, - // attributeNamespace - !0, - // sanitizeURL - !0 - ); - }); - var ah = /^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*\:/i, jo = !1; - function ps(n) { - !jo && ah.test(n) && (jo = !0, c("A future version of React will block javascript: URLs as a security precaution. Use event handlers i\ -nstead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed %s.", JSON.stringify(n))); - } - a(ps, "sanitizeURL"); - function mf(n, i, u, d) { - if (d.mustUseProperty) { - var m = d.propertyName; - return n[m]; - } else { - xr(u, i), d.sanitizeURL && ps("" + u); - var y = d.attributeName, E = null; - if (d.type === ia) { - if (n.hasAttribute(y)) { - var A = n.getAttribute(y); - return A === "" ? !0 : Gt(i, u, d, !1) ? A : A === "" + u ? u : A; - } - } else if (n.hasAttribute(y)) { - if (Gt(i, u, d, !1)) - return n.getAttribute(y); - if (d.type === gr) - return u; - E = n.getAttribute(y); + } + a(MS, "Cg"); + function y5(e) { + return (e.mode & 1) !== 0 && (e.flags & 128) === 0; + } + a(y5, "Dg"); + function w5(e) { + if (Te) { + var t = yr; + if (t) { + var r = t; + if (!MS(e, t)) { + if (y5(e)) throw Error(M(418)); + t = ia(r.nextSibling); + var n = wr; + t && MS(e, t) ? l7(n, r) : (e.flags = e.flags & -4097 | 2, Te = !1, wr = e); } - return Gt(i, u, d, !1) ? E === null ? u : E : E === "" + u ? u : E; + } else { + if (y5(e)) throw Error(M(418)); + e.flags = e.flags & -4097 | 2, Te = !1, wr = e; } } - a(mf, "getValueForProperty"); - function vf(n, i, u, d) { - { - if (!hn(i)) - return; - if (!n.hasAttribute(i)) - return u === void 0 ? void 0 : null; - var m = n.getAttribute(i); - return xr(u, i), m === "" + u ? u : m; - } - } - a(vf, "getValueForAttribute"); - function cl(n, i, u, d) { - var m = sa(i); - if (!Cr(i, m, d)) { - if (Gt(i, u, m, d) && (u = null), d || m === null) { - if (hn(i)) { - var y = i; - u === null ? n.removeAttribute(y) : (xr(u, i), n.setAttribute(y, "" + u)); + } + a(w5, "Eg"); + function BS(e) { + for (e = e.return; e !== null && e.tag !== 5 && e.tag !== 3 && e.tag !== 13; ) e = e.return; + wr = e; + } + a(BS, "Fg"); + function Od(e) { + if (e !== wr) return !1; + if (!Te) return BS(e), Te = !0, !1; + var t; + if ((t = e.tag !== 3) && !(t = e.tag !== 5) && (t = e.type, t = t !== "head" && t !== "body" && !h5(e.type, e.memoizedProps)), t && (t = + yr)) { + if (y5(e)) throw u7(), Error(M(418)); + for (; t; ) l7(e, t), t = ia(t.nextSibling); + } + if (BS(e), e.tag === 13) { + if (e = e.memoizedState, e = e !== null ? e.dehydrated : null, !e) throw Error(M(317)); + e: { + for (e = e.nextSibling, t = 0; e; ) { + if (e.nodeType === 8) { + var r = e.data; + if (r === "/$") { + if (t === 0) { + yr = ia(e.nextSibling); + break e; + } + t--; + } else r !== "$" && r !== "$!" && r !== "$?" || t++; } - return; - } - var E = m.mustUseProperty; - if (E) { - var A = m.propertyName; - if (u === null) { - var T = m.type; - n[A] = T === gr ? !1 : ""; - } else - n[A] = u; - return; - } - var L = m.attributeName, M = m.attributeNamespace; - if (u === null) - n.removeAttribute(L); - else { - var U = m.type, j; - U === gr || U === ia && u === !0 ? j = "" : (xr(u, L), j = "" + u, m.sanitizeURL && ps(j.toString())), M ? n.setAttributeNS(M, L, j) : - n.setAttribute(L, j); + e = e.nextSibling; } + yr = null; } + } else yr = wr ? ia(e.stateNode.nextSibling) : null; + return !0; + } + a(Od, "Gg"); + function u7() { + for (var e = yr; e; ) e = ia(e.nextSibling); + } + a(u7, "Hg"); + function Bs() { + yr = wr = null, Te = !1; + } + a(Bs, "Ig"); + function tv(e) { + cn === null ? cn = [e] : cn.push(e); + } + a(tv, "Jg"); + var J$ = bo.ReactCurrentBatchConfig; + function ln(e, t) { + if (e && e.defaultProps) { + t = Ne({}, t), e = e.defaultProps; + for (var r in e) t[r] === void 0 && (t[r] = e[r]); + return t; } - a(cl, "setValueForProperty"); - var Di = Symbol.for("react.element"), Uo = Symbol.for("react.portal"), qo = Symbol.for("react.fragment"), fl = Symbol.for("react.strict_\ -mode"), z = Symbol.for("react.profiler"), se = Symbol.for("react.provider"), ge = Symbol.for("react.context"), je = Symbol.for("react.forwar\ -d_ref"), dt = Symbol.for("react.suspense"), Ct = Symbol.for("react.suspense_list"), ot = Symbol.for("react.memo"), Ue = Symbol.for("react.la\ -zy"), Yr = Symbol.for("react.scope"), nr = Symbol.for("react.debug_trace_mode"), ar = Symbol.for("react.offscreen"), Un = Symbol.for("react.\ -legacy_hidden"), Ai = Symbol.for("react.cache"), gf = Symbol.for("react.tracing_marker"), _a = Symbol.iterator, jS = "@@iterator"; - function hs(n) { - if (n === null || typeof n != "object") - return null; - var i = _a && n[_a] || n[jS]; - return typeof i == "function" ? i : null; - } - a(hs, "getIteratorFn"); - var it = Object.assign, dl = 0, oh, ih, sh, lh, uh, ch, fh; - function vg() { + return t; + } + a(ln, "Lg"); + var l0 = ha(null), u0 = null, As = null, rv = null; + function nv() { + rv = As = u0 = null; + } + a(nv, "Qg"); + function ov(e) { + var t = l0.current; + De(l0), e._currentValue = t; + } + a(ov, "Rg"); + function b5(e, t, r) { + for (; e !== null; ) { + var n = e.alternate; + if ((e.childLanes & t) !== t ? (e.childLanes |= t, n !== null && (n.childLanes |= t)) : n !== null && (n.childLanes & t) !== t && (n.childLanes |= + t), e === r) break; + e = e.return; + } + } + a(b5, "Sg"); + function Os(e, t) { + u0 = e, rv = As = null, e = e.dependencies, e !== null && e.firstContext !== null && (e.lanes & t && (nr = !0), e.firstContext = null); + } + a(Os, "Tg"); + function Br(e) { + var t = e._currentValue; + if (rv !== e) if (e = { context: e, memoizedValue: t, next: null }, As === null) { + if (u0 === null) throw Error(M(308)); + As = e, u0.dependencies = { lanes: 0, firstContext: e }; + } else As = As.next = e; + return t; + } + a(Br, "Vg"); + var oi = null; + function av(e) { + oi === null ? oi = [e] : oi.push(e); + } + a(av, "Xg"); + function c7(e, t, r, n) { + var o = t.interleaved; + return o === null ? (r.next = r, av(t)) : (r.next = o.next, o.next = r), t.interleaved = r, yo(e, n); + } + a(c7, "Yg"); + function yo(e, t) { + e.lanes |= t; + var r = e.alternate; + for (r !== null && (r.lanes |= t), r = e, e = e.return; e !== null; ) e.childLanes |= t, r = e.alternate, r !== null && (r.childLanes |= + t), r = e, e = e.return; + return r.tag === 3 ? r.stateNode : null; + } + a(yo, "Zg"); + var Jo = !1; + function iv(e) { + e.updateQueue = { baseState: e.memoizedState, firstBaseUpdate: null, lastBaseUpdate: null, shared: { pending: null, interleaved: null, lanes: 0 }, + effects: null }; + } + a(iv, "ah"); + function p7(e, t) { + e = e.updateQueue, t.updateQueue === e && (t.updateQueue = { baseState: e.baseState, firstBaseUpdate: e.firstBaseUpdate, lastBaseUpdate: e. + lastBaseUpdate, shared: e.shared, effects: e.effects }); + } + a(p7, "bh"); + function mo(e, t) { + return { eventTime: e, lane: t, tag: 0, payload: null, callback: null, next: null }; + } + a(mo, "ch"); + function sa(e, t, r) { + var n = e.updateQueue; + if (n === null) return null; + if (n = n.shared, ce & 2) { + var o = n.pending; + return o === null ? t.next = t : (t.next = o.next, o.next = t), n.pending = t, yo(e, r); + } + return o = n.interleaved, o === null ? (t.next = t, av(n)) : (t.next = o.next, o.next = t), n.interleaved = t, yo(e, r); + } + a(sa, "dh"); + function jd(e, t, r) { + if (t = t.updateQueue, t !== null && (t = t.shared, (r & 4194240) !== 0)) { + var n = t.lanes; + n &= e.pendingLanes, r |= n, t.lanes = r, W5(e, r); + } + } + a(jd, "eh"); + function $S(e, t) { + var r = e.updateQueue, n = e.alternate; + if (n !== null && (n = n.updateQueue, r === n)) { + var o = null, i = null; + if (r = r.firstBaseUpdate, r !== null) { + do { + var s = { eventTime: r.eventTime, lane: r.lane, tag: r.tag, payload: r.payload, callback: r.callback, next: null }; + i === null ? o = i = s : i = i.next = s, r = r.next; + } while (r !== null); + i === null ? o = i = t : i = i.next = t; + } else o = i = t; + r = { baseState: n.baseState, firstBaseUpdate: o, lastBaseUpdate: i, shared: n.shared, effects: n.effects }, e.updateQueue = r; + return; } - a(vg, "disabledLog"), vg.__reactDisabledLog = !0; - function US() { - { - if (dl === 0) { - oh = console.log, ih = console.info, sh = console.warn, lh = console.error, uh = console.group, ch = console.groupCollapsed, fh = console. - groupEnd; - var n = { - configurable: !0, - enumerable: !0, - value: vg, - writable: !0 - }; - Object.defineProperties(console, { - info: n, - log: n, - warn: n, - error: n, - group: n, - groupCollapsed: n, - groupEnd: n + e = r.lastBaseUpdate, e === null ? r.firstBaseUpdate = t : e.next = t, r.lastBaseUpdate = t; + } + a($S, "fh"); + function c0(e, t, r, n) { + var o = e.updateQueue; + Jo = !1; + var i = o.firstBaseUpdate, s = o.lastBaseUpdate, l = o.shared.pending; + if (l !== null) { + o.shared.pending = null; + var u = l, c = u.next; + u.next = null, s === null ? i = c : s.next = c, s = u; + var p = e.alternate; + p !== null && (p = p.updateQueue, l = p.lastBaseUpdate, l !== s && (l === null ? p.firstBaseUpdate = c : l.next = c, p.lastBaseUpdate = + u)); + } + if (i !== null) { + var h = o.baseState; + s = 0, p = c = u = null, l = i; + do { + var m = l.lane, g = l.eventTime; + if ((n & m) === m) { + p !== null && (p = p.next = { + eventTime: g, + lane: 0, + tag: l.tag, + payload: l.payload, + callback: l.callback, + next: null }); + e: { + var S = e, v = l; + switch (m = t, g = r, v.tag) { + case 1: + if (S = v.payload, typeof S == "function") { + h = S.call(g, h, m); + break e; + } + h = S; + break e; + case 3: + S.flags = S.flags & -65537 | 128; + case 0: + if (S = v.payload, m = typeof S == "function" ? S.call(g, h, m) : S, m == null) break e; + h = Ne({}, h, m); + break e; + case 2: + Jo = !0; + } + } + l.callback !== null && l.lane !== 0 && (e.flags |= 64, m = o.effects, m === null ? o.effects = [l] : m.push(l)); + } else g = { eventTime: g, lane: m, tag: l.tag, payload: l.payload, callback: l.callback, next: null }, p === null ? (c = p = g, u = + h) : p = p.next = g, s |= m; + if (l = l.next, l === null) { + if (l = o.shared.pending, l === null) break; + m = l, l = m.next, m.next = null, o.lastBaseUpdate = m, o.shared.pending = null; } - dl++; + } while (!0); + if (p === null && (u = h), o.baseState = u, o.firstBaseUpdate = c, o.lastBaseUpdate = p, t = o.shared.interleaved, t !== null) { + o = t; + do + s |= o.lane, o = o.next; + while (o !== t); + } else i === null && (o.shared.lanes = 0); + pi |= s, e.lanes = s, e.memoizedState = h; + } + } + a(c0, "gh"); + function zS(e, t, r) { + if (e = t.effects, t.effects = null, e !== null) for (t = 0; t < e.length; t++) { + var n = e[t], o = n.callback; + if (o !== null) { + if (n.callback = null, n = r, typeof o != "function") throw Error(M(191, o)); + o.call(n); + } + } + } + a(zS, "ih"); + var f7 = new cE.Component().refs; + function S5(e, t, r, n) { + t = e.memoizedState, r = r(n, t), r = r == null ? t : Ne({}, t, r), e.memoizedState = r, e.lanes === 0 && (e.updateQueue.baseState = r); + } + a(S5, "kh"); + var D0 = { isMounted: /* @__PURE__ */ a(function(e) { + return (e = e._reactInternals) ? hi(e) === e : !1; + }, "isMounted"), enqueueSetState: /* @__PURE__ */ a(function(e, t, r) { + e = e._reactInternals; + var n = zt(), o = ua(e), i = mo(n, o); + i.payload = t, r != null && (i.callback = r), t = sa(e, i, o), t !== null && (fn(t, e, o, n), jd(t, e, o)); + }, "enqueueSetState"), enqueueReplaceState: /* @__PURE__ */ a(function(e, t, r) { + e = e._reactInternals; + var n = zt(), o = ua(e), i = mo(n, o); + i.tag = 1, i.payload = t, r != null && (i.callback = r), t = sa(e, i, o), t !== null && (fn(t, e, o, n), jd(t, e, o)); + }, "enqueueReplaceState"), enqueueForceUpdate: /* @__PURE__ */ a(function(e, t) { + e = e._reactInternals; + var r = zt(), n = ua(e), o = mo(r, n); + o.tag = 2, t != null && (o.callback = t), t = sa(e, o, n), t !== null && (fn(t, e, n, r), jd(t, e, n)); + }, "enqueueForceUpdate") }; + function HS(e, t, r, n, o, i, s) { + return e = e.stateNode, typeof e.shouldComponentUpdate == "function" ? e.shouldComponentUpdate(n, i, s) : t.prototype && t.prototype.isPureReactComponent ? + !Gc(r, n) || !Gc(o, i) : !0; + } + a(HS, "oh"); + function d7(e, t, r) { + var n = !1, o = fa, i = t.contextType; + return typeof i == "object" && i !== null ? i = Br(i) : (o = ar(t) ? li : Pt.current, n = t.contextTypes, i = (n = n != null) ? Ms(e, o) : + fa), t = new t(r, i), e.memoizedState = t.state !== null && t.state !== void 0 ? t.state : null, t.updater = D0, e.stateNode = t, t._reactInternals = + e, n && (e = e.stateNode, e.__reactInternalMemoizedUnmaskedChildContext = o, e.__reactInternalMemoizedMaskedChildContext = i), t; + } + a(d7, "ph"); + function jS(e, t, r, n) { + e = t.state, typeof t.componentWillReceiveProps == "function" && t.componentWillReceiveProps(r, n), typeof t.UNSAFE_componentWillReceiveProps == + "function" && t.UNSAFE_componentWillReceiveProps(r, n), t.state !== e && D0.enqueueReplaceState(t, t.state, null); + } + a(jS, "qh"); + function E5(e, t, r, n) { + var o = e.stateNode; + o.props = r, o.state = e.memoizedState, o.refs = f7, iv(e); + var i = t.contextType; + typeof i == "object" && i !== null ? o.context = Br(i) : (i = ar(t) ? li : Pt.current, o.context = Ms(e, i)), o.state = e.memoizedState, + i = t.getDerivedStateFromProps, typeof i == "function" && (S5(e, t, i, r), o.state = e.memoizedState), typeof t.getDerivedStateFromProps == + "function" || typeof o.getSnapshotBeforeUpdate == "function" || typeof o.UNSAFE_componentWillMount != "function" && typeof o.componentWillMount != + "function" || (t = o.state, typeof o.componentWillMount == "function" && o.componentWillMount(), typeof o.UNSAFE_componentWillMount == "\ +function" && o.UNSAFE_componentWillMount(), t !== o.state && D0.enqueueReplaceState(o, o.state, null), c0(e, r, o, n), o.state = e.memoizedState), + typeof o.componentDidMount == "function" && (e.flags |= 4194308); + } + a(E5, "rh"); + function xc(e, t, r) { + if (e = r.ref, e !== null && typeof e != "function" && typeof e != "object") { + if (r._owner) { + if (r = r._owner, r) { + if (r.tag !== 1) throw Error(M(309)); + var n = r.stateNode; + } + if (!n) throw Error(M(147, e)); + var o = n, i = "" + e; + return t !== null && t.ref !== null && typeof t.ref == "function" && t.ref._stringRef === i ? t.ref : (t = /* @__PURE__ */ a(function(s) { + var l = o.refs; + l === f7 && (l = o.refs = {}), s === null ? delete l[i] : l[i] = s; + }, "b"), t._stringRef = i, t); + } + if (typeof e != "string") throw Error(M(284)); + if (!r._owner) throw Error(M(290, e)); + } + return e; + } + a(xc, "sh"); + function Ld(e, t) { + throw e = Object.prototype.toString.call(t), Error(M(31, e === "[object Object]" ? "object with keys {" + Object.keys(t).join(", ") + "}" : + e)); + } + a(Ld, "th"); + function VS(e) { + var t = e._init; + return t(e._payload); + } + a(VS, "uh"); + function h7(e) { + function t(w, y) { + if (e) { + var E = w.deletions; + E === null ? (w.deletions = [y], w.flags |= 16) : E.push(y); } } - a(US, "disableLogs"); - function dh() { - { - if (dl--, dl === 0) { - var n = { - configurable: !0, - enumerable: !0, - writable: !0 - }; - Object.defineProperties(console, { - log: it({}, n, { - value: oh - }), - info: it({}, n, { - value: ih - }), - warn: it({}, n, { - value: sh - }), - error: it({}, n, { - value: lh - }), - group: it({}, n, { - value: uh - }), - groupCollapsed: it({}, n, { - value: ch - }), - groupEnd: it({}, n, { - value: fh - }) - }); - } - dl < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue."); + a(t, "b"); + function r(w, y) { + if (!e) return null; + for (; y !== null; ) t(w, y), y = y.sibling; + return null; + } + a(r, "c"); + function n(w, y) { + for (w = /* @__PURE__ */ new Map(); y !== null; ) y.key !== null ? w.set(y.key, y) : w.set(y.index, y), y = y.sibling; + return w; + } + a(n, "d"); + function o(w, y) { + return w = ca(w, y), w.index = 0, w.sibling = null, w; + } + a(o, "e"); + function i(w, y, E) { + return w.index = E, e ? (E = w.alternate, E !== null ? (E = E.index, E < y ? (w.flags |= 2, y) : E) : (w.flags |= 2, y)) : (w.flags |= + 1048576, y); + } + a(i, "f"); + function s(w) { + return e && w.alternate === null && (w.flags |= 2), w; + } + a(s, "g"); + function l(w, y, E, x) { + return y === null || y.tag !== 6 ? (y = V2(E, w.mode, x), y.return = w, y) : (y = o(y, E), y.return = w, y); + } + a(l, "h"); + function u(w, y, E, x) { + var C = E.type; + return C === ws ? p(w, y, E.props.children, x, E.key) : y !== null && (y.elementType === C || typeof C == "object" && C !== null && C. + $$typeof === Qo && VS(C) === y.type) ? (x = o(y, E.props), x.ref = xc(w, y, E), x.return = w, x) : (x = Yd(E.type, E.key, E.props, null, + w.mode, x), x.ref = xc(w, y, E), x.return = w, x); + } + a(u, "k"); + function c(w, y, E, x) { + return y === null || y.tag !== 4 || y.stateNode.containerInfo !== E.containerInfo || y.stateNode.implementation !== E.implementation ? + (y = U2(E, w.mode, x), y.return = w, y) : (y = o(y, E.children || []), y.return = w, y); + } + a(c, "l"); + function p(w, y, E, x, C) { + return y === null || y.tag !== 7 ? (y = si(E, w.mode, x, C), y.return = w, y) : (y = o(y, E), y.return = w, y); + } + a(p, "m"); + function h(w, y, E) { + if (typeof y == "string" && y !== "" || typeof y == "number") return y = V2("" + y, w.mode, E), y.return = w, y; + if (typeof y == "object" && y !== null) { + switch (y.$$typeof) { + case bd: + return E = Yd(y.type, y.key, y.props, null, w.mode, E), E.ref = xc(w, null, y), E.return = w, E; + case ys: + return y = U2(y, w.mode, E), y.return = w, y; + case Qo: + var x = y._init; + return h(w, x(y._payload), E); + } + if (_c(y) || wc(y)) return y = si(y, w.mode, E, null), y.return = w, y; + Ld(w, y); } + return null; } - a(dh, "reenableLogs"); - var Lu = r.ReactCurrentDispatcher, pl; - function fo(n, i, u) { - { - if (pl === void 0) - try { - throw Error(); - } catch (m) { - var d = m.stack.trim().match(/\n( *(at )?)/); - pl = d && d[1] || ""; - } - return ` -` + pl + n; + a(h, "q"); + function m(w, y, E, x) { + var C = y !== null ? y.key : null; + if (typeof E == "string" && E !== "" || typeof E == "number") return C !== null ? null : l(w, y, "" + E, x); + if (typeof E == "object" && E !== null) { + switch (E.$$typeof) { + case bd: + return E.key === C ? u(w, y, E, x) : null; + case ys: + return E.key === C ? c(w, y, E, x) : null; + case Qo: + return C = E._init, m( + w, + y, + C(E._payload), + x + ); + } + if (_c(E) || wc(E)) return C !== null ? null : p(w, y, E, x, null); + Ld(w, E); } + return null; } - a(fo, "describeBuiltInComponentFrame"); - var hl = !1, yf; - { - var gg = typeof WeakMap == "function" ? WeakMap : Map; - yf = new gg(); - } - function ph(n, i) { - if (!n || hl) - return ""; - { - var u = yf.get(n); - if (u !== void 0) - return u; + a(m, "r"); + function g(w, y, E, x, C) { + if (typeof x == "string" && x !== "" || typeof x == "number") return w = w.get(E) || null, l(y, w, "" + x, C); + if (typeof x == "object" && x !== null) { + switch (x.$$typeof) { + case bd: + return w = w.get(x.key === null ? E : x.key) || null, u(y, w, x, C); + case ys: + return w = w.get(x.key === null ? E : x.key) || null, c(y, w, x, C); + case Qo: + var D = x._init; + return g(w, y, E, D(x._payload), C); + } + if (_c(x) || wc(x)) return w = w.get(E) || null, p(y, w, x, C, null); + Ld(y, x); } - var d; - hl = !0; - var m = Error.prepareStackTrace; - Error.prepareStackTrace = void 0; - var y; - y = Lu.current, Lu.current = null, US(); - try { - if (i) { - var E = /* @__PURE__ */ a(function() { - throw Error(); - }, "Fake"); - if (Object.defineProperty(E.prototype, "props", { - set: /* @__PURE__ */ a(function() { - throw Error(); - }, "set") - }), typeof Reflect == "object" && Reflect.construct) { - try { - Reflect.construct(E, []); - } catch (Q) { - d = Q; - } - Reflect.construct(n, [], E); - } else { - try { - E.call(); - } catch (Q) { - d = Q; - } - n.call(E.prototype); - } - } else { - try { - throw Error(); - } catch (Q) { - d = Q; - } - n(); + return null; + } + a(g, "y"); + function S(w, y, E, x) { + for (var C = null, D = null, R = y, A = y = 0, _ = null; R !== null && A < E.length; A++) { + R.index > A ? (_ = R, R = null) : _ = R.sibling; + var P = m(w, R, E[A], x); + if (P === null) { + R === null && (R = _); + break; } - } catch (Q) { - if (Q && d && typeof Q.stack == "string") { - for (var A = Q.stack.split(` -`), T = d.stack.split(` -`), L = A.length - 1, M = T.length - 1; L >= 1 && M >= 0 && A[L] !== T[M]; ) - M--; - for (; L >= 1 && M >= 0; L--, M--) - if (A[L] !== T[M]) { - if (L !== 1 || M !== 1) - do - if (L--, M--, M < 0 || A[L] !== T[M]) { - var U = ` -` + A[L].replace(" at new ", " at "); - return n.displayName && U.includes("") && (U = U.replace("", n.displayName)), typeof n == "functio\ -n" && yf.set(n, U), U; - } - while (L >= 1 && M >= 0); - break; - } + e && R && P.alternate === null && t(w, R), y = i(P, y, A), D === null ? C = P : D.sibling = P, D = P, R = _; + } + if (A === E.length) return r(w, R), Te && ti(w, A), C; + if (R === null) { + for (; A < E.length; A++) R = h(w, E[A], x), R !== null && (y = i(R, y, A), D === null ? C = R : D.sibling = R, D = R); + return Te && ti(w, A), C; + } + for (R = n(w, R); A < E.length; A++) _ = g(R, w, A, E[A], x), _ !== null && (e && _.alternate !== null && R.delete(_.key === null ? A : + _.key), y = i(_, y, A), D === null ? C = _ : D.sibling = _, D = _); + return e && R.forEach(function(B) { + return t(w, B); + }), Te && ti(w, A), C; + } + a(S, "n"); + function v(w, y, E, x) { + var C = wc(E); + if (typeof C != "function") throw Error(M(150)); + if (E = C.call(E), E == null) throw Error(M(151)); + for (var D = C = null, R = y, A = y = 0, _ = null, P = E.next(); R !== null && !P.done; A++, P = E.next()) { + R.index > A ? (_ = R, R = null) : _ = R.sibling; + var B = m(w, R, P.value, x); + if (B === null) { + R === null && (R = _); + break; } - } finally { - hl = !1, Lu.current = y, dh(), Error.prepareStackTrace = m; - } - var j = n ? n.displayName || n.name : "", ee = j ? fo(j) : ""; - return typeof n == "function" && yf.set(n, ee), ee; - } - a(ph, "describeNativeComponentFrame"); - function qS(n, i, u) { - return ph(n, !0); - } - a(qS, "describeClassComponentFrame"); - function ml(n, i, u) { - return ph(n, !1); - } - a(ml, "describeFunctionComponentFrame"); - function yg(n) { - var i = n.prototype; - return !!(i && i.isReactComponent); - } - a(yg, "shouldConstruct"); - function bf(n, i, u) { - if (n == null) - return ""; - if (typeof n == "function") - return ph(n, yg(n)); - if (typeof n == "string") - return fo(n); - switch (n) { - case dt: - return fo("Suspense"); - case Ct: - return fo("SuspenseList"); - } - if (typeof n == "object") - switch (n.$$typeof) { - case je: - return ml(n.render); - case ot: - return bf(n.type, i, u); - case Ue: { - var d = n, m = d._payload, y = d._init; - try { - return bf(y(m), i, u); - } catch { + e && R && B.alternate === null && t(w, R), y = i(B, y, A), D === null ? C = B : D.sibling = B, D = B, R = _; + } + if (P.done) return r( + w, + R + ), Te && ti(w, A), C; + if (R === null) { + for (; !P.done; A++, P = E.next()) P = h(w, P.value, x), P !== null && (y = i(P, y, A), D === null ? C = P : D.sibling = P, D = P); + return Te && ti(w, A), C; + } + for (R = n(w, R); !P.done; A++, P = E.next()) P = g(R, w, A, P.value, x), P !== null && (e && P.alternate !== null && R.delete(P.key === + null ? A : P.key), y = i(P, y, A), D === null ? C = P : D.sibling = P, D = P); + return e && R.forEach(function(z) { + return t(w, z); + }), Te && ti(w, A), C; + } + a(v, "t"); + function b(w, y, E, x) { + if (typeof E == "object" && E !== null && E.type === ws && E.key === null && (E = E.props.children), typeof E == "object" && E !== null) { + switch (E.$$typeof) { + case bd: + e: { + for (var C = E.key, D = y; D !== null; ) { + if (D.key === C) { + if (C = E.type, C === ws) { + if (D.tag === 7) { + r(w, D.sibling), y = o(D, E.props.children), y.return = w, w = y; + break e; + } + } else if (D.elementType === C || typeof C == "object" && C !== null && C.$$typeof === Qo && VS(C) === D.type) { + r(w, D.sibling), y = o(D, E.props), y.ref = xc(w, D, E), y.return = w, w = y; + break e; + } + r(w, D); + break; + } else t(w, D); + D = D.sibling; + } + E.type === ws ? (y = si(E.props.children, w.mode, x, E.key), y.return = w, w = y) : (x = Yd(E.type, E.key, E.props, null, w.mode, + x), x.ref = xc(w, y, E), x.return = w, w = x); } - } - } - return ""; - } - a(bf, "describeUnknownElementTypeFrameInDEV"); - function Sf(n) { - var i = n._debugOwner ? n._debugOwner.type : null, u = n._debugSource; - switch (n.tag) { - case x: - return fo(n.type); - case q: - return fo("Lazy"); - case N: - return fo("Suspense"); - case ce: - return fo("SuspenseList"); - case h: - case g: - case B: - return ml(n.type); - case I: - return ml(n.type.render); - case v: - return qS(n.type); - default: - return ""; - } - } - a(Sf, "describeFiber"); - function bg(n) { - try { - var i = "", u = n; - do - i += Sf(u), u = u.return; - while (u); - return i; - } catch (d) { - return ` -Error generating stack: ` + d.message + ` -` + d.stack; - } - } - a(bg, "getStackByFiberInDevAndProd"); - function vl(n, i, u) { - var d = n.displayName; - if (d) - return d; - var m = i.displayName || i.name || ""; - return m !== "" ? u + "(" + m + ")" : u; - } - a(vl, "getWrappedName"); - function wf(n) { - return n.displayName || "Context"; - } - a(wf, "getContextName"); - function Ht(n) { - if (n == null) - return null; - if (typeof n.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please \ -file an issue."), typeof n == "function") - return n.displayName || n.name || null; - if (typeof n == "string") - return n; - switch (n) { - case qo: - return "Fragment"; - case Uo: - return "Portal"; - case z: - return "Profiler"; - case fl: - return "StrictMode"; - case dt: - return "Suspense"; - case Ct: - return "SuspenseList"; - } - if (typeof n == "object") - switch (n.$$typeof) { - case ge: - var i = n; - return wf(i) + ".Consumer"; - case se: - var u = n; - return wf(u._context) + ".Provider"; - case je: - return vl(n, n.render, "ForwardRef"); - case ot: - var d = n.displayName || null; - return d !== null ? d : Ht(n.type) || "Memo"; - case Ue: { - var m = n, y = m._payload, E = m._init; - try { - return Ht(E(y)); - } catch { - return null; + return s(w); + case ys: + e: { + for (D = E.key; y !== null; ) { + if (y.key === D) if (y.tag === 4 && y.stateNode.containerInfo === E.containerInfo && y.stateNode.implementation === E.implementation) { + r(w, y.sibling), y = o(y, E.children || []), y.return = w, w = y; + break e; + } else { + r(w, y); + break; + } + else t(w, y); + y = y.sibling; + } + y = U2(E, w.mode, x), y.return = w, w = y; } - } + return s(w); + case Qo: + return D = E._init, b(w, y, D(E._payload), x); } - return null; - } - a(Ht, "getComponentNameFromType"); - function VS(n, i, u) { - var d = i.displayName || i.name || ""; - return n.displayName || (d !== "" ? u + "(" + d + ")" : u); - } - a(VS, "getWrappedName$1"); - function Sg(n) { - return n.displayName || "Context"; - } - a(Sg, "getContextName$1"); - function rt(n) { - var i = n.tag, u = n.type; - switch (i) { - case X: - return "Cache"; - case F: - var d = u; - return Sg(d) + ".Consumer"; - case O: - var m = u; - return Sg(m._context) + ".Provider"; - case ne: - return "DehydratedFragment"; - case I: - return VS(u, u.render, "ForwardRef"); - case C: - return "Fragment"; - case x: - return u; - case w: - return "Portal"; - case b: - return "Root"; - case R: - return "Text"; - case q: - return Ht(u); - case D: - return u === fl ? "StrictMode" : "Mode"; - case te: - return "Offscreen"; - case P: - return "Profiler"; - case de: - return "Scope"; - case N: - return "Suspense"; - case ce: - return "SuspenseList"; - case le: - return "TracingMarker"; - case v: - case h: - case V: - case g: - case H: - case B: - if (typeof u == "function") - return u.displayName || u.name || null; - if (typeof u == "string") - return u; - break; - } - return null; - } - a(rt, "getComponentNameFromFiber"); - var wg = r.ReactDebugCurrentFrame, qn = null, gl = !1; - function yl() { - { - if (qn === null) - return null; - var n = qn._debugOwner; - if (n !== null && typeof n < "u") - return rt(n); + if (_c(E)) return S(w, y, E, x); + if (wc(E)) return v(w, y, E, x); + Ld(w, E); } - return null; + return typeof E == "string" && E !== "" || typeof E == "number" ? (E = "" + E, y !== null && y.tag === 6 ? (r(w, y.sibling), y = o(y, E), + y.return = w, w = y) : (r(w, y), y = V2(E, w.mode, x), y.return = w, w = y), s(w)) : r(w, y); } - a(yl, "getCurrentFiberOwnerNameInDevOrNull"); - function WS() { - return qn === null ? "" : bg(qn); - } - a(WS, "getCurrentFiberStackInDev"); - function mn() { - wg.getCurrentStack = null, qn = null, gl = !1; - } - a(mn, "resetCurrentFiber"); - function dr(n) { - wg.getCurrentStack = n === null ? null : WS, qn = n, gl = !1; - } - a(dr, "setCurrentFiber"); - function GS() { - return qn; - } - a(GS, "getCurrentFiber"); - function po(n) { - gl = n; - } - a(po, "setIsRendering"); - function Oa(n) { - return "" + n; - } - a(Oa, "toString"); - function Vo(n) { - switch (typeof n) { - case "boolean": - case "number": - case "string": - case "undefined": - return n; - case "object": - return Gr(n), n; - default: - return ""; + return a(b, "J"), b; + } + a(h7, "vh"); + var $s = h7(!0), m7 = h7(!1), ip = {}, $n = ha(ip), Qc = ha(ip), Jc = ha(ip); + function ai(e) { + if (e === ip) throw Error(M(174)); + return e; + } + a(ai, "Hh"); + function sv(e, t) { + switch (xe(Jc, t), xe(Qc, e), xe($n, ip), e = t.nodeType, e) { + case 9: + case 11: + t = (t = t.documentElement) ? t.namespaceURI : e5(null, ""); + break; + default: + e = e === 8 ? t.parentNode : t, t = e.namespaceURI || null, e = e.tagName, t = e5(t, e); + } + De($n), xe($n, t); + } + a(sv, "Ih"); + function zs() { + De($n), De(Qc), De(Jc); + } + a(zs, "Jh"); + function g7(e) { + ai(Jc.current); + var t = ai($n.current), r = e5(t, e.type); + t !== r && (xe(Qc, e), xe($n, r)); + } + a(g7, "Kh"); + function lv(e) { + Qc.current === e && (De($n), De(Qc)); + } + a(lv, "Lh"); + var Oe = ha(0); + function p0(e) { + for (var t = e; t !== null; ) { + if (t.tag === 13) { + var r = t.memoizedState; + if (r !== null && (r = r.dehydrated, r === null || r.data === "$?" || r.data === "$!")) return t; + } else if (t.tag === 19 && t.memoizedProps.revealOrder !== void 0) { + if (t.flags & 128) return t; + } else if (t.child !== null) { + t.child.return = t, t = t.child; + continue; } - } - a(Vo, "getToStringValue"); - var Ef = { - button: !0, - checkbox: !0, - image: !0, - hidden: !0, - radio: !0, - reset: !0, - submit: !0 - }; - function hh(n, i) { - Ef[i.type] || i.onChange || i.onInput || i.readOnly || i.disabled || i.value == null || c("You provided a `value` prop to a form field\ - without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either\ - `onChange` or `readOnly`."), i.onChange || i.readOnly || i.disabled || i.checked == null || c("You provided a `checked` prop to a form fiel\ -d without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set eit\ -her `onChange` or `readOnly`."); - } - a(hh, "checkControlledValueProps"); - function ms(n) { - var i = n.type, u = n.nodeName; - return u && u.toLowerCase() === "input" && (i === "checkbox" || i === "radio"); - } - a(ms, "isCheckable"); - function mh(n) { - return n._valueTracker; - } - a(mh, "getTracker"); - function YS(n) { - n._valueTracker = null; - } - a(YS, "detachTracker"); - function xf(n) { - var i = ""; - return n && (ms(n) ? i = n.checked ? "true" : "false" : i = n.value), i; - } - a(xf, "getValueFromNode"); - function vh(n) { - var i = ms(n) ? "checked" : "value", u = Object.getOwnPropertyDescriptor(n.constructor.prototype, i); - Gr(n[i]); - var d = "" + n[i]; - if (!(n.hasOwnProperty(i) || typeof u > "u" || typeof u.get != "function" || typeof u.set != "function")) { - var m = u.get, y = u.set; - Object.defineProperty(n, i, { - configurable: !0, - get: /* @__PURE__ */ a(function() { - return m.call(this); - }, "get"), - set: /* @__PURE__ */ a(function(A) { - Gr(A), d = "" + A, y.call(this, A); - }, "set") - }), Object.defineProperty(n, i, { - enumerable: u.enumerable - }); - var E = { - getValue: /* @__PURE__ */ a(function() { - return d; - }, "getValue"), - setValue: /* @__PURE__ */ a(function(A) { - Gr(A), d = "" + A; - }, "setValue"), - stopTracking: /* @__PURE__ */ a(function() { - YS(n), delete n[i]; - }, "stopTracking") - }; - return E; + if (t === e) break; + for (; t.sibling === null; ) { + if (t.return === null || t.return === e) return null; + t = t.return; } + t.sibling.return = t.return, t = t.sibling; } - a(vh, "trackValueOnNode"); - function bl(n) { - mh(n) || (n._valueTracker = vh(n)); - } - a(bl, "track"); - function Cf(n) { - if (!n) - return !1; - var i = mh(n); - if (!i) - return !0; - var u = i.getValue(), d = xf(n); - return d !== u ? (i.setValue(d), !0) : !1; - } - a(Cf, "updateValueIfChanged"); - function Rf(n) { - if (n = n || (typeof document < "u" ? document : void 0), typeof n > "u") - return null; - try { - return n.activeElement || n.body; - } catch { - return n.body; - } - } - a(Rf, "getActiveElement"); - var Eg = !1, xg = !1, Cg = !1, _ = !1; - function $(n) { - var i = n.type === "checkbox" || n.type === "radio"; - return i ? n.checked != null : n.value != null; - } - a($, "isControlled"); - function J(n, i) { - var u = n, d = i.checked, m = it({}, i, { - defaultChecked: void 0, - defaultValue: void 0, - value: void 0, - checked: d ?? u._wrapperState.initialChecked - }); - return m; - } - a(J, "getHostProps"); - function ae(n, i) { - hh("input", i), i.checked !== void 0 && i.defaultChecked !== void 0 && !xg && (c("%s contains an input of type %s with both checked an\ -d defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked pro\ -p, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://reactjs.\ -org/link/controlled-components", yl() || "A component", i.type), xg = !0), i.value !== void 0 && i.defaultValue !== void 0 && !Eg && (c("%s \ -contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify eithe\ -r the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of\ - these props. More info: https://reactjs.org/link/controlled-components", yl() || "A component", i.type), Eg = !0); - var u = n, d = i.defaultValue == null ? "" : i.defaultValue; - u._wrapperState = { - initialChecked: i.checked != null ? i.checked : i.defaultChecked, - initialValue: Vo(i.value != null ? i.value : d), - controlled: $(i) - }; - } - a(ae, "initWrapperState"); - function me(n, i) { - var u = n, d = i.checked; - d != null && cl(u, "checked", d, !1); - } - a(me, "updateChecked"); - function qe(n, i) { - var u = n; - { - var d = $(i); - !u._wrapperState.controlled && d && !_ && (c("A component is changing an uncontrolled input to be controlled. This is likely caused \ -by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input el\ -ement for the lifetime of the component. More info: https://reactjs.org/link/controlled-components"), _ = !0), u._wrapperState.controlled && - !d && !Cg && (c("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a d\ -efined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the compon\ -ent. More info: https://reactjs.org/link/controlled-components"), Cg = !0); - } - me(n, i); - var m = Vo(i.value), y = i.type; - if (m != null) - y === "number" ? (m === 0 && u.value === "" || // We explicitly want to coerce to number here if possible. - // eslint-disable-next-line - u.value != m) && (u.value = Oa(m)) : u.value !== Oa(m) && (u.value = Oa(m)); - else if (y === "submit" || y === "reset") { - u.removeAttribute("value"); - return; - } - i.hasOwnProperty("value") ? Lt(u, i.type, m) : i.hasOwnProperty("defaultValue") && Lt(u, i.type, Vo(i.defaultValue)), i.checked == null && - i.defaultChecked != null && (u.defaultChecked = !!i.defaultChecked); + return null; + } + a(p0, "Mh"); + var M2 = []; + function uv() { + for (var e = 0; e < M2.length; e++) M2[e]._workInProgressVersionPrimary = null; + M2.length = 0; + } + a(uv, "Oh"); + var Vd = bo.ReactCurrentDispatcher, B2 = bo.ReactCurrentBatchConfig, ci = 0, Le = null, ot = null, pt = null, f0 = !1, Nc = !1, Zc = 0, Z$ = 0; + function Tt() { + throw Error(M(321)); + } + a(Tt, "Q"); + function cv(e, t) { + if (t === null) return !1; + for (var r = 0; r < t.length && r < e.length; r++) if (!dn(e[r], t[r])) return !1; + return !0; + } + a(cv, "Wh"); + function pv(e, t, r, n, o, i) { + if (ci = i, Le = t, t.memoizedState = null, t.updateQueue = null, t.lanes = 0, Vd.current = e === null || e.memoizedState === null ? nz : + oz, e = r(n, o), Nc) { + i = 0; + do { + if (Nc = !1, Zc = 0, 25 <= i) throw Error(M(301)); + i += 1, pt = ot = null, t.updateQueue = null, Vd.current = az, e = r(n, o); + } while (Nc); } - a(qe, "updateWrapper"); - function Ie(n, i, u) { - var d = n; - if (i.hasOwnProperty("value") || i.hasOwnProperty("defaultValue")) { - var m = i.type, y = m === "submit" || m === "reset"; - if (y && (i.value === void 0 || i.value === null)) - return; - var E = Oa(d._wrapperState.initialValue); - u || E !== d.value && (d.value = E), d.defaultValue = E; - } - var A = d.name; - A !== "" && (d.name = ""), d.defaultChecked = !d.defaultChecked, d.defaultChecked = !!d._wrapperState.initialChecked, A !== "" && (d.name = - A); - } - a(Ie, "postMountWrapper"); - function et(n, i) { - var u = n; - qe(u, i), St(u, i); - } - a(et, "restoreControlledState"); - function St(n, i) { - var u = i.name; - if (i.type === "radio" && u != null) { - for (var d = n; d.parentNode; ) - d = d.parentNode; - xr(u, "name"); - for (var m = d.querySelectorAll("input[name=" + JSON.stringify("" + u) + '][type="radio"]'), y = 0; y < m.length; y++) { - var E = m[y]; - if (!(E === n || E.form !== n.form)) { - var A = fy(E); - if (!A) - throw new Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported."); - Cf(E), qe(E, A); - } + if (Vd.current = d0, t = ot !== null && ot.next !== null, ci = 0, pt = ot = Le = null, f0 = !1, t) throw Error(M(300)); + return e; + } + a(pv, "Xh"); + function fv() { + var e = Zc !== 0; + return Zc = 0, e; + } + a(fv, "bi"); + function Nn() { + var e = { memoizedState: null, baseState: null, baseQueue: null, queue: null, next: null }; + return pt === null ? Le.memoizedState = pt = e : pt = pt.next = e, pt; + } + a(Nn, "ci"); + function $r() { + if (ot === null) { + var e = Le.alternate; + e = e !== null ? e.memoizedState : null; + } else e = ot.next; + var t = pt === null ? Le.memoizedState : pt.next; + if (t !== null) pt = t, ot = e; + else { + if (e === null) throw Error(M(310)); + ot = e, e = { memoizedState: ot.memoizedState, baseState: ot.baseState, baseQueue: ot.baseQueue, queue: ot.queue, next: null }, pt === + null ? Le.memoizedState = pt = e : pt = pt.next = e; + } + return pt; + } + a($r, "di"); + function ep(e, t) { + return typeof t == "function" ? t(e) : t; + } + a(ep, "ei"); + function $2(e) { + var t = $r(), r = t.queue; + if (r === null) throw Error(M(311)); + r.lastRenderedReducer = e; + var n = ot, o = n.baseQueue, i = r.pending; + if (i !== null) { + if (o !== null) { + var s = o.next; + o.next = i.next, i.next = s; + } + n.baseQueue = o = i, r.pending = null; + } + if (o !== null) { + i = o.next, n = n.baseState; + var l = s = null, u = null, c = i; + do { + var p = c.lane; + if ((ci & p) === p) u !== null && (u = u.next = { lane: 0, action: c.action, hasEagerState: c.hasEagerState, eagerState: c.eagerState, + next: null }), n = c.hasEagerState ? c.eagerState : e(n, c.action); + else { + var h = { + lane: p, + action: c.action, + hasEagerState: c.hasEagerState, + eagerState: c.eagerState, + next: null + }; + u === null ? (l = u = h, s = n) : u = u.next = h, Le.lanes |= p, pi |= p; } - } + c = c.next; + } while (c !== null && c !== i); + u === null ? s = n : u.next = l, dn(n, t.memoizedState) || (nr = !0), t.memoizedState = n, t.baseState = s, t.baseQueue = u, r.lastRenderedState = + n; } - a(St, "updateNamedCousins"); - function Lt(n, i, u) { - // Focused number inputs synchronize on blur. See ChangeEventPlugin.js - (i !== "number" || Rf(n.ownerDocument) !== n) && (u == null ? n.defaultValue = Oa(n._wrapperState.initialValue) : n.defaultValue !== Oa( - u) && (n.defaultValue = Oa(u))); - } - a(Lt, "setDefaultValue"); - var Kt = !1, Xt = !1, tr = !1; - function yr(n, i) { - i.value == null && (typeof i.children == "object" && i.children !== null ? e.Children.forEach(i.children, function(u) { - u != null && (typeof u == "string" || typeof u == "number" || Xt || (Xt = !0, c("Cannot infer the option value of complex children. \ -Pass a `value` prop or use a plain string as children to