fastadmin 0.2.2__py3-none-any.whl → 0.2.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- fastadmin/api/frameworks/django/app/views.py +9 -17
- fastadmin/api/frameworks/fastapi/views.py +9 -5
- fastadmin/api/frameworks/flask/app.py +0 -1
- fastadmin/api/frameworks/flask/views.py +9 -3
- fastadmin/api/helpers.py +9 -0
- fastadmin/models/helpers.py +4 -8
- fastadmin/static/index.min.js +2 -2
- fastadmin/templates/index.html +3 -3
- {fastadmin-0.2.2.dist-info → fastadmin-0.2.4.dist-info}/METADATA +3 -6
- {fastadmin-0.2.2.dist-info → fastadmin-0.2.4.dist-info}/RECORD +12 -12
- {fastadmin-0.2.2.dist-info → fastadmin-0.2.4.dist-info}/LICENSE +0 -0
- {fastadmin-0.2.2.dist-info → fastadmin-0.2.4.dist-info}/WHEEL +0 -0
fastadmin/static/index.min.js
CHANGED
@@ -647,7 +647,7 @@ html body {
|
|
647
647
|
border-left: 0;
|
648
648
|
border-right: 0;
|
649
649
|
}
|
650
|
-
`,Zqe=1,Qqe=3,Jqe=function(e){Nt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.imageRef=b.createRef(),n.videoRef=b.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document!="undefined"?document:null,n.currentWindow=typeof window!="undefined"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver=="undefined"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=qqe(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=i.crop,a=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}else if(n.props.initialCroppedAreaPixels){var s=Kqe(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=s.crop,a=s.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}},n.computeSizes=function(){var r,i,o,a,s,l,c=n.imageRef.current||n.videoRef.current;if(c&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var u=n.containerRect.width/n.containerRect.height,f=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,d=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=n.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,h=c.offsetWidth<f||c.offsetHeight<d,p=f/d,v=void 0;if(h)switch(n.state.mediaObjectFit){default:case"contain":v=u>p?{width:n.containerRect.height*p,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/p};break;case"horizontal-cover":v={width:n.containerRect.width,height:n.containerRect.width/p};break;case"vertical-cover":v={width:n.containerRect.height*p,height:n.containerRect.height};break}else v={width:c.offsetWidth,height:c.offsetHeight};n.mediaSize=ke(ke({},v),{naturalWidth:f,naturalHeight:d}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var g=n.props.cropSize?n.props.cropSize:zqe(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((s=n.state.cropSize)===null||s===void 0?void 0:s.height)!==g.height||((l=n.state.cropSize)===null||l===void 0?void 0:l.width)!==g.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(g),n.setState({cropSize:g},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(g),g}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var i=t.getMousePoint(r),o=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var a=n.gestureRotationStart+r.rotation;n.props.onRotationChange(a)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,o,a=r.x,s=r.y;n.dragStartPosition={x:a,y:s},n.dragStartCrop=ke({},n.props.crop),(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i)},n.onDrag=function(r){var i=r.x,o=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||o===void 0)){var a=i-n.dragStartPosition.x,s=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+a,y:n.dragStartCrop.y+s},c=n.props.restrictPosition?uO(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(c)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=t.getMousePoint(r),o=Bqe(r).pixelY,a=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(a,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var s,l;return(l=(s=n.props).onInteractionStart)===null||l===void 0?void 0:l.call(s)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var s,l;return(l=(s=n.props).onInteractionEnd)===null||l===void 0?void 0:l.call(s)})},250)}},n.getPointOnContainer=function(r,i){var o=r.x,a=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-i.x),y:n.containerRect.height/2-(a-i.y)}},n.getPointOnMedia=function(r){var i=r.x,o=r.y,a=n.props,s=a.crop,l=a.zoom;return{x:(i+s.x)/l,y:(o+s.y)/l}},n.setNewZoom=function(r,i,o){var a=o===void 0?{}:o,s=a.shouldUpdatePosition,l=s===void 0?!0:s;if(!(!n.state.cropSize||!n.props.onZoomChange)){var c=fO(r,n.props.minZoom,n.props.maxZoom);if(l){var u=n.getPointOnContainer(i,n.containerPosition),f=n.getPointOnMedia(u),d={x:f.x*c-u.x,y:f.y*c-u.y},h=n.props.restrictPosition?uO(d,n.mediaSize,n.state.cropSize,c,n.props.rotation):d;n.props.onCropChange(h)}n.props.onZoomChange(c)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?uO(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return Wqe(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?uO(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver=="undefined"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=Xqe,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver=="undefined"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,i,o,a,s,l,c,u,f;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((o=n.cropSize)===null||o===void 0?void 0:o.width)!==((a=this.props.cropSize)===null||a===void 0?void 0:a.width)?this.computeSizes():(((s=n.crop)===null||s===void 0?void 0:s.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((c=n.crop)===null||c===void 0?void 0:c.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((f=this.videoRef.current)===null||f===void 0||f.load());var d=this.getObjectFit();d!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:d},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},t.prototype.getObjectFit=function(){var n,r,i,o;if(this.props.objectFit==="cover"){var a=this.imageRef.current||this.videoRef.current;if(a&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,l=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,c=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,u=l/c;return u<s?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),i=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=CQ(r,i),this.lastPinchRotation=OQ(r,i),this.onDragStart(EQ(r,i))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]),a=EQ(i,o);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=CQ(i,o),l=r.props.zoom*(s/r.lastPinchDistance);r.setNewZoom(l,a,{shouldUpdatePosition:!1}),r.lastPinchDistance=s;var c=OQ(i,o),u=r.props.rotation+(c-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(u),r.lastPinchRotation=c})}},t.prototype.render=function(){var n=this,r,i=this.props,o=i.image,a=i.video,s=i.mediaProps,l=i.transform,c=i.crop,u=c.x,f=c.y,d=i.rotation,h=i.zoom,p=i.cropShape,v=i.showGrid,g=i.style,m=g.containerStyle,y=g.cropAreaStyle,x=g.mediaStyle,S=i.classes,w=S.containerClassName,C=S.cropAreaClassName,O=S.mediaClassName,E=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return b.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function($){return n.containerRef=$},"data-testid":"container",style:m,className:dO("reactEasyCrop_Container",w)},o?b.createElement("img",ke({alt:"",className:dO("reactEasyCrop_Image",E==="contain"&&"reactEasyCrop_Contain",E==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",E==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",O)},s,{src:o,ref:this.imageRef,style:ke(ke({},x),{transform:l||"translate(".concat(u,"px, ").concat(f,"px) rotate(").concat(d,"deg) scale(").concat(h,")")}),onLoad:this.onMediaLoad})):a&&b.createElement("video",ke({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:dO("reactEasyCrop_Video",E==="contain"&&"reactEasyCrop_Contain",E==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",E==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",O)},s,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:ke(ke({},x),{transform:l||"translate(".concat(u,"px, ").concat(f,"px) rotate(").concat(d,"deg) scale(").concat(h,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function(_){return b.createElement("source",ke({key:_.src},_))})),this.state.cropSize&&b.createElement("div",{style:ke(ke({},y),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:dO("reactEasyCrop_CropArea",p==="round"&&"reactEasyCrop_CropAreaRound",v&&"reactEasyCrop_CropAreaGrid",C)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:Qqe,minZoom:Zqe,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t}(b.Component);const Hl="img-crop",ZR=1,m1=.1,hO=0,_Q=-180,$Q=180,QR=1,PQ=.5,MQ=2,y1=.01,eGe=b.forwardRef((e,t)=>{const{cropperRef:n,zoomSlider:r,rotationSlider:i,aspectSlider:o,showReset:a,resetBtnText:s,modalImage:l,aspect:c,minZoom:u,maxZoom:f,cropShape:d,showGrid:h,cropperProps:p}=e,[v,g]=b.useState(ZR),[m,y]=b.useState(hO),[x,S]=b.useState(c),w=v!==ZR||m!==hO||x!==c,C=()=>{g(ZR),y(hO),S(c)},[O,E]=b.useState({x:0,y:0}),_=b.useRef({width:0,height:0,x:0,y:0}),$=b.useCallback((M,R)=>{_.current=R},[]);b.useImperativeHandle(t,()=>({rotation:m,cropPixelsRef:_,onReset:C}));const P="[display:flex] [align-items:center] [width:60%] [margin-inline:auto]",T="[display:flex] [align-items:center] [justify-content:center] [height:32px] [width:32px] [background:transparent] [border:0] [font-family:inherit] [font-size:18px] [cursor:pointer] disabled:[opacity:20%] disabled:[cursor:default]",I="[flex:1]";return ce.jsxs(ce.Fragment,{children:[ce.jsx(Jqe,Object.assign({},p,{ref:n,image:l,crop:O,zoom:v,rotation:m,aspect:x,minZoom:u,maxZoom:f,zoomWithScroll:r,cropShape:d,showGrid:h,onCropChange:E,onZoomChange:g,onRotationChange:y,onCropComplete:$,classes:{containerClassName:`${Hl}-container ![position:relative] [width:100%] [height:40vh] [&~section:first-of-type]:[margin-top:16px] [&~section:last-of-type]:[margin-bottom:16px]`,mediaClassName:`${Hl}-media`}})),r&&ce.jsxs("section",{className:`${Hl}-control ${Hl}-control-zoom ${P}`,children:[ce.jsx("button",{className:T,onClick:()=>g(+(v-m1).toFixed(1)),disabled:v-m1<u,children:"-"}),ce.jsx(X5,{className:I,min:u,max:f,step:m1,value:v,onChange:g}),ce.jsx("button",{className:T,onClick:()=>g(+(v+m1).toFixed(1)),disabled:v+m1>f,children:"+"})]}),i&&ce.jsxs("section",{className:`${Hl}-control ${Hl}-control-rotation ${P}`,children:[ce.jsx("button",{className:`${T} [font-size:16px]`,onClick:()=>y(m-QR),disabled:m===_Q,children:"↺"}),ce.jsx(X5,{className:I,min:_Q,max:$Q,step:QR,value:m,onChange:y}),ce.jsx("button",{className:`${T} [font-size:16px]`,onClick:()=>y(m+QR),disabled:m===$Q,children:"↻"})]}),o&&ce.jsxs("section",{className:`${Hl}-control ${Hl}-control-aspect ${P}`,children:[ce.jsx("button",{className:T,onClick:()=>S(+(x-y1).toFixed(2)),disabled:x-y1<PQ,children:"↕️"}),ce.jsx(X5,{className:I,min:PQ,max:MQ,step:y1,value:x,onChange:S}),ce.jsx("button",{className:T,onClick:()=>S(+(x+y1).toFixed(2)),disabled:x+y1>MQ,children:"↔️"})]}),a&&(r||i||o)&&ce.jsx(yn,{className:"[bottom:20px] [position:absolute]",style:w?{}:{opacity:.3,pointerEvents:"none"},onClick:C,children:s})]})});var tGe=b.memo(eGe);function nGe(e,t){t===void 0&&(t={});var n=t.insertAt;if(typeof document!="undefined"){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var rGe=".visible{visibility:visible}.grid{display:grid}.\\[align-items\\:center\\]{align-items:center}.\\[background\\:transparent\\]{background:transparent}.\\[border\\:0\\]{border:0}.\\[bottom\\:20px\\]{bottom:20px}.\\[cursor\\:pointer\\]{cursor:pointer}.\\[display\\:flex\\]{display:flex}.\\[flex\\:1\\]{flex:1}.\\[font-family\\:inherit\\]{font-family:inherit}.\\[font-size\\:16px\\]{font-size:16px}.\\[font-size\\:18px\\]{font-size:18px}.\\[height\\:32px\\]{height:32px}.\\[height\\:40vh\\]{height:40vh}.\\[justify-content\\:center\\]{justify-content:center}.\\[margin-inline\\:auto\\]{margin-inline:auto}.\\[position\\:absolute\\]{position:absolute}.\\!\\[position\\:relative\\]{position:relative!important}.\\[width\\:100\\%\\]{width:100%}.\\[width\\:32px\\]{width:32px}.\\[width\\:60\\%\\]{width:60%}.disabled\\:\\[cursor\\:default\\]:disabled{cursor:default}.disabled\\:\\[opacity\\:20\\%\\]:disabled{opacity:20%}.\\[\\&\\~section\\:first-of-type\\]\\:\\[margin-top\\:16px\\]~section:first-of-type{margin-top:16px}.\\[\\&\\~section\\:last-of-type\\]\\:\\[margin-bottom\\:16px\\]~section:last-of-type{margin-bottom:16px}";nGe(rGe,{insertAt:"top"});const iGe=Tqe(QB,"4.23.0")===-1?"visible":"open",lg=(e,t,n)=>t in e?(console.error(`\`${t}\` is deprecated, please use \`${n}\` instead`),e[t]):e[n],oGe=b.forwardRef((e,t)=>{const{quality:n=.4,fillColor:r="white",zoomSlider:i=!0,rotationSlider:o=!1,aspectSlider:a=!1,showReset:s=!1,resetText:l,aspect:c=1,minZoom:u=1,maxZoom:f=3,cropShape:d="rect",showGrid:h=!1,cropperProps:p,modalClassName:v,modalTitle:g,modalWidth:m,modalOk:y,modalCancel:x,onModalOk:S,onModalCancel:w,modalProps:C,beforeCrop:O,children:E}=e,_=lg(e,"zoom","zoomSlider")||!0,$=lg(e,"rotate","rotationSlider")||!1,P=lg(e,"shape","cropShape")||"rect",T=lg(e,"grid","showGrid")||!1;"onUploadFail"in e&&console.error("`onUploadFail` is removed, because the only way it is called, is when the file is rejected by beforeUpload"),lg(e,"modalMaskTransitionName","modalProps.maskTransitionName"),lg(e,"modalTransitionName","modalProps.transitionName");const I=b.useRef({});I.current.onModalOk=S,I.current.onModalCancel=w,I.current.beforeCrop=O;const M=b.useRef(null),R=b.useCallback(G=>{var q;const K=document.createElement("canvas"),X=K.getContext("2d"),Z=(((q=G==null?void 0:G.getRootNode)===null||q===void 0?void 0:q.call(G))||document).querySelector(`.${Hl}-media`),{width:Y,height:ne,x:ee,y:Q}=M.current.cropPixelsRef.current;if($&&M.current.rotation!==hO){const{naturalWidth:re,naturalHeight:ae}=Z,de=M.current.rotation*(Math.PI/180),ve=Math.abs(Math.sin(de)),le=Math.abs(Math.cos(de)),ue=re*le+ae*ve,be=ae*le+re*ve;K.width=ue,K.height=be,X.fillStyle=r,X.fillRect(0,0,ue,be);const ye=ue/2,Oe=be/2;X.translate(ye,Oe),X.rotate(de),X.translate(-ye,-Oe);const Me=(ue-re)/2,Ne=(be-ae)/2;X.drawImage(Z,0,0,re,ae,Me,Ne,re,ae);const me=X.getImageData(0,0,ue,be);K.width=Y,K.height=ne,X.putImageData(me,-ee,-Q)}else K.width=Y,K.height=ne,X.fillStyle=r,X.fillRect(0,0,Y,ne),X.drawImage(Z,ee,Q,Y,ne,0,0,Y,ne);return K},[r,$]),[N,k]=b.useState(""),A=b.useRef(),j=b.useRef(),D=b.useCallback(G=>zl(void 0,[G],void 0,function*({beforeUpload:q,file:K,resolve:X,reject:te}){const Z=K;if(typeof q!="function"){X(Z);return}try{const Y=yield q(K,[K]);X(Y===!1?!1:Y!==!0&&Y||Z)}catch(Y){te(Y)}}),[]),L=b.useCallback(G=>(q,K)=>new Promise((X,te)=>zl(void 0,void 0,void 0,function*(){let Z=q;if(typeof I.current.beforeCrop=="function")try{const ne=yield I.current.beforeCrop(q,K);if(ne===!1)return D({beforeUpload:G,file:q,resolve:X,reject:te});ne!==!0&&(Z=ne||q)}catch(ne){return D({beforeUpload:G,file:q,resolve:X,reject:te})}const Y=new FileReader;Y.addEventListener("load",()=>{typeof Y.result=="string"&&k(Y.result)}),Y.readAsDataURL(Z),A.current=()=>{var ne,ee;k(""),M.current.onReset();let Q=!1;(ee=(ne=I.current).onModalCancel)===null||ee===void 0||ee.call(ne,re=>{X(re),Q=!0}),Q||X(OC.LIST_IGNORE)},j.current=ne=>zl(void 0,void 0,void 0,function*(){k(""),M.current.onReset();const ee=R(ne.target),{type:Q,name:re,uid:ae}=Z;ee.toBlob(de=>zl(void 0,void 0,void 0,function*(){const ve=new File([de],re,{type:Q});Object.assign(ve,{uid:ae}),D({beforeUpload:G,file:ve,resolve:le=>{var ue,be;X(le),(be=(ue=I.current).onModalOk)===null||be===void 0||be.call(ue,le)},reject:le=>{var ue,be;te(le),(be=(ue=I.current).onModalOk)===null||be===void 0||be.call(ue,le)}})}),Q,n)})})),[R,n,D]),F=b.useCallback(G=>{const q=Array.isArray(G)?G[0]:G,K=q.props,{beforeUpload:X,accept:te}=K,Z=Ir(K,["beforeUpload","accept"]);return Object.assign(Object.assign({},q),{props:Object.assign(Object.assign({},Z),{accept:te||"image/*",beforeUpload:L(X)})})},[L]),B=b.useMemo(()=>{const G={};return m!==void 0&&(G.width=m),y!==void 0&&(G.okText=y),x!==void 0&&(G.cancelText=x),G},[x,y,m]),H=`${Hl}-modal${v?` ${v}`:""}`,W=(typeof window=="undefined"?"":window.navigator.language)==="zh-CN",V=g||(W?"编辑图片":"Edit image"),U=l||(W?"重置":"Reset");return ce.jsxs(ce.Fragment,{children:[F(E),N&&ce.jsx(oo,Object.assign({},C,B,{[iGe]:!0,title:V,onCancel:A.current,onOk:j.current,wrapClassName:H,maskClosable:!1,destroyOnClose:!0,children:ce.jsx(tGe,{ref:M,cropperRef:t,zoomSlider:_,rotationSlider:$,aspectSlider:a,showReset:s,resetBtnText:U,modalImage:N,aspect:c,minZoom:u,maxZoom:f,cropShape:P,showGrid:T,cropperProps:p})}))]})});var aGe=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=i=>n(i)}),sGe=e=>Ci(this,null,function*(){const n=yield(yield fetch(e)).blob();return new Promise((r,i)=>{const o=new FileReader;o.readAsDataURL(n),o.onloadend=()=>{const a=o.result;r(a)},o.onerror=a=>i(a)})}),lGe=e=>Ci(this,null,function*(){return e.split(",")[0].match(/:(.*?);/)[1]}),cGe={fromFile:aGe,fromURL:sGe,mimeType:lGe};const TQ=Rt(cGe),uGe=o=>{var a=o,{parentId:e,value:t,onChange:n,multiple:r}=a,i=Vs(a,["parentId","value","onChange","multiple"]);const{t:s}=ao("UploadInput"),[l,c]=b.useState(),u=v=>Ci(this,null,function*(){const g=r?v.fileList:v.fileList.slice(-1),m=[];for(const y of g)if(y.originFileObj){const x=yield TQ.fromFile(y.originFileObj);m.push(x)}else m.push(y.url);r?n&&n(m):n&&n(m[0])}),f=b.useMemo(()=>t?(Qv(t)?t:[t]).map((g,m)=>({uid:m,status:"done",url:g})):void 0,[t]),d=v=>Ci(this,null,function*(){c(v.url?v.url:yield TQ.fromFile(v.originFileObj))}),h=()=>c(void 0),p=()=>!1;return ce.jsxs(ce.Fragment,{children:[ce.jsx(oGe,{rotationSlider:!0,children:ce.jsx(OC,un(Le({listType:"picture-card",withCredentials:!0,beforeUpload:p,onChange:u,defaultFileList:f,multiple:r,onPreview:d},i),{children:ce.jsxs(Di,{children:[ce.jsx(CDe,{}),s("Upload")]})}))}),ce.jsx(oo,{footer:null,title:s("Preview Image"),open:!!l,onCancel:h,children:ce.jsx(Jw,{preview:!1,src:l})})]})},JR=(e,t,n)=>{switch(e){case sr.Input:return[br,{}];case sr.InputNumber:return[P5,{style:{width:"100%"}}];case sr.EmailInput:return[br,{}];case sr.PhoneInput:return[WFe,{}];case sr.SlugInput:return[VFe,{}];case sr.UrlInput:return[br,{}];case sr.PasswordInput:return[FFe,{parentId:n}];case sr.TextArea:return[br.TextArea,{}];case sr.RichTextArea:return[Eqe,{}];case sr.JsonTextArea:return[DFe,{}];case sr.Select:return[Mi,{style:{width:"100%"}}];case sr.AsyncSelect:return[AFe,{style:{width:"100%"}}];case sr.AsyncTransfer:return[LFe,{}];case sr.Switch:return[sK,{}];case sr.Checkbox:return[xs,{}];case sr.CheckboxGroup:return[xs.Group,{}];case sr.RadioGroup:return[af.Group,{}];case sr.DatePicker:return[Bc,{style:{width:"100%"}}];case sr.TimePicker:return[Zy,{style:{width:"100%"}}];case sr.DateTimePicker:return[Bc,{style:{width:"100%"},showTime:!0}];case sr.RangePicker:return[Bc.RangePicker,{style:{width:"100%"},placeholder:[t("Start"),t("End")]}];case sr.Upload:return[uGe,{parentId:n}];default:return[br,{}]}},fGe=({widgetType:e,widgetProps:t,value:n,onFilter:r,onReset:i})=>{const{t:o}=ao("List"),[a,s]=b.useState(),[l,c]=JR(e,o);b.useEffect(()=>{s(n)},[n]);const u=()=>{r(a)},f=d=>{l===br||l===br.TextArea||l===af.Group?s(d.target.value):s(d)};return ce.jsxs(oi,{style:{width:400},children:[ce.jsx(jn,{xs:24,style:{padding:10},children:ce.jsx(l,Le(Le({value:a,size:"middle",onChange:f,placeholder:o("Filter By")},c||{}),t||{}))}),ce.jsx(jn,{xs:24,style:{padding:10},children:ce.jsxs(Di,{align:"end",children:[ce.jsx(yn,{onClick:i,size:"small",children:o("Reset")}),ce.jsx(yn,{type:"primary",onClick:u,icon:l===br?ce.jsx(xv,{}):ce.jsx(fX,{}),size:"small",children:o("Filter")})]})})]})},IQ=(e,t,n,r,i,o,a)=>{const{t:s}=ao("List"),l=(e||{fields:[]}).fields;return b.useMemo(()=>{const c=l.filter(u=>!!u.list_configuration).sort((u,f)=>{var d,h;return(((d=u.list_configuration)==null?void 0:d.index)||0)-(((h=f.list_configuration)==null?void 0:h.index)||0)}).map(u=>{var f,d,h,p;return{title:WC(u.name),dataIndex:u.name,key:u.name,sorter:(f=u.list_configuration)==null?void 0:f.sorter,width:(d=u.list_configuration)==null?void 0:d.width,ellipsis:!0,filterIcon:(h=u.list_configuration)!=null&&h.filter_widget_type?n(u.name)?ce.jsx(xo,{title:s("Click to reset this filter"),children:ce.jsx(LK,{style:{color:"red"}})}):ce.jsx(xo,{title:s("Click to filter"),children:ce.jsx(fX,{})}):void 0,filterDropdown:(p=u.list_configuration)!=null&&p.filter_widget_type?({confirm:v,clearFilters:g})=>{var x,S;const m=()=>{i(u.name),g(),v()},y=w=>{r(u.name,w),v()};return ce.jsx(fGe,{widgetType:(x=u.list_configuration)==null?void 0:x.filter_widget_type,widgetProps:(S=u.list_configuration)==null?void 0:S.filter_widget_props,value:n(u.name),onFilter:y,onReset:m})}:void 0,render:(v,g)=>{var y,x,S;if(v===void 0)return(y=u.list_configuration)==null?void 0:y.empty_value_display;const m=vFe(v,(x=u.list_configuration)==null?void 0:x.empty_value_display,t);if((S=u==null?void 0:u.list_configuration)!=null&&S.is_link){const w=()=>a(g);return ce.jsx(yn,{style:{padding:0},type:"link",onClick:w,children:m})}return qC(m)&&(m.startsWith("http")||m.startsWith("/"))?ce.jsx("a",{href:m,target:"_blank",rel:"noreferrer",children:m}):m}}});return c.push({title:s("Actions"),key:"actions",width:100,fixed:"right",render:u=>{const f=()=>o(u),d=()=>a(u);return ce.jsxs(Di,{children:[((e==null?void 0:e.permissions)||[]).includes(Ya.Delete)&&ce.jsx(U5,{title:s("Are you sure?"),onConfirm:f,children:ce.jsx(yn,{size:"small",danger:!0,children:ce.jsx(vC,{})})}),((e==null?void 0:e.permissions)||[]).includes(Ya.Change)&&ce.jsx(yn,{size:"small",onClick:d,children:ce.jsx($I,{})})]})}}),c},[s,t,l,n,e==null?void 0:e.permissions,r,a,o,i])},b1=1,eN=10,RQ=e=>{const[t,n]=b.useState(),[r,i]=b.useState([]),[o,a]=b.useState({}),[s,l]=b.useState(),[c,u]=b.useState(b1),[f,d]=b.useState(eN),[h,p]=b.useState();return b.useEffect(()=>{e!=null&&e.list_per_page&&d(e==null?void 0:e.list_per_page)},[e==null?void 0:e.list_per_page]),b.useEffect(()=>{e!=null&&e.name&&(u(b1),p(void 0))},[e==null?void 0:e.name]),{defaultPage:b1,defaultPageSize:eN,page:c,setPage:u,pageSize:f,setPageSize:d,search:s,setSearch:l,filters:o,setFilters:a,sortBy:h,setSortBy:p,action:t,setAction:n,selectedRowKeys:r,setSelectedRowKeys:i,onTableChange:(m,y,x)=>{m.pageSize!==f?u(b1):u(m.current),d(m.pageSize),x.field&&p(x.order==="ascend"?x.field:`-${x.field}`)},resetTable:m=>{n(void 0),i([]),u(b1),d(eN),p(void 0),m||(a({}),l(void 0))}}},dGe=({modelConfiguration:e,parentId:t})=>{const{t:n}=ao("Inline"),{configuration:r}=b.useContext(pl),[i,o]=b.useState(!1),[a,s]=b.useState(!1),[l,c]=b.useState(),[u]=Jn.useForm(),[f]=Jn.useForm(),{defaultPage:d,defaultPageSize:h,page:p,setPage:v,pageSize:g,setPageSize:m,search:y,setSearch:x,filters:S,setFilters:w,sortBy:C,action:O,setAction:E,selectedRowKeys:_,setSelectedRowKeys:$,resetTable:P,onTableChange:T}=RQ(e),I=e.name,M=b.useCallback(()=>{o(!0)},[]),R=b.useCallback(()=>{P(),o(!1)},[P]),N=b.useCallback(()=>{u.resetFields(),s(!0),c(void 0),u.setFieldValue(e.fk_name,t)},[u,t,e.fk_name]),k=b.useCallback(()=>{s(!1),c(void 0)},[]),A=b.useCallback(le=>{f.resetFields(),c(le==null?void 0:le.id),s(!1)},[f]),j=b.useCallback(()=>{c(void 0),s(!1)},[]),D=Zv.stringify(Le({search:y,sort_by:C,offset:(p-1)*g,limit:g,[e.fk_name]:t},$R(S))),{data:L,isLoading:F,refetch:B}=vc({queryKey:[`/list/${I}`,D],queryFn:()=>Uc(`/list/${I}?${D}`),enabled:i,refetchOnWindowFocus:!1}),{data:H,isLoading:z}=vc({queryKey:[`/retrieve/${I}/${l}`],queryFn:()=>Uc(`/retrieve/${I}/${l}`),enabled:!!l,refetchOnWindowFocus:!1}),{mutate:W,isPending:V,isError:U}=Ko({mutationFn:le=>qc(`/add/${I}`,le),onSuccess:()=>{Ti.success(n("Succesfully added")),B(),k()},onError:le=>{Fl(le,u)}}),{mutate:G,isPending:q,isError:K}=Ko({mutationFn:le=>bR(`/change/${I}/${l}`,le),onSuccess:()=>{Ti.success(n("Succesfully changed")),B(),j()},onError:le=>{Fl(le,f)}}),{mutate:X}=Ko({mutationFn:le=>xR(`/delete/${I}/${le}`),onSuccess:()=>{P(e==null?void 0:e.preserve_filters),B(),Ti.success(n("Successfully deleted"))},onError:le=>{Fl(le)}}),{mutate:te,isPending:Z}=Ko({mutationFn:le=>qc(`/action/${I}/${O}`,le),onSuccess:()=>{P(e==null?void 0:e.preserve_filters),B(),Ti.success(n("Successfully applied"))},onError:()=>{Ti.error(n("Server error"))}}),Y=le=>$(le),ne=b.useCallback(()=>te({ids:_}),[te,_]),ee=r==null?void 0:r.datetime_format,Q=IQ(e,ee,b.useCallback(le=>S[le],[S]),b.useCallback((le,ue)=>{S[le]=ue,w(Le({},S)),v(d),m(h)},[d,h,S,w,v,m]),b.useCallback(le=>{delete S[le],w(Le({},S)),v(d),m(h)},[d,h,S,w,v,m]),b.useCallback(le=>{X(le.id)},[X]),b.useCallback(le=>{A(le)},[A])),re=le=>{W(le)},ae=le=>{G(le)},de=b.useCallback(()=>{var le,ue;return ce.jsxs(oi,{justify:"end",gutter:[8,8],children:[((e==null?void 0:e.actions)||[]).length>0&&(e==null?void 0:e.actions_on_top)&&ce.jsxs(jn,{children:[ce.jsx(Mi,{placeholder:n("Select Action By"),allowClear:!0,value:O,onChange:E,style:{width:300},children:((e==null?void 0:e.actions)||[]).map(be=>ce.jsx(Mi.Option,{value:be.name,children:be.description||be.name},be.name))}),ce.jsx(yn,{disabled:!O||_.length===0,style:{marginLeft:5},loading:Z,onClick:ne,children:n("Apply")})]}),((e==null?void 0:e.search_fields)||[]).length>0&&ce.jsx(jn,{children:ce.jsx(br.Search,{placeholder:(e==null?void 0:e.search_help_text)||n("Search By"),allowClear:!0,onSearch:x,style:{width:200}})}),((le=e==null?void 0:e.permissions)==null?void 0:le.includes(Ya.Export))&&ce.jsx(jn,{children:ce.jsx(hZ,{model:I,search:y,filters:un(Le({},S),{[e.fk_name]:t}),sortBy:C})}),((ue=e==null?void 0:e.permissions)==null?void 0:ue.includes(Ya.Add))&&ce.jsx(jn,{children:ce.jsxs(yn,{onClick:N,style:{marginRight:-10},children:[ce.jsx(nR,{})," ",n("Add")]})})]})},[e==null?void 0:e.actions,e==null?void 0:e.actions_on_top,e==null?void 0:e.search_fields,e==null?void 0:e.search_help_text,e==null?void 0:e.permissions,e.fk_name,n,O,E,_.length,Z,ne,x,I,y,S,t,C,N]),ve=b.useCallback(()=>{var le;return ce.jsx(ce.Fragment,{children:((le=e==null?void 0:e.permissions)==null?void 0:le.includes(Ya.Add))&&ce.jsx(oi,{justify:"space-between",children:ce.jsx(jn,{children:((e==null?void 0:e.actions)||[]).length>0&&(e==null?void 0:e.actions_on_bottom)&&ce.jsxs("div",{style:{marginLeft:-8},children:[ce.jsx(Mi,{placeholder:n("Select Action By"),allowClear:!0,value:O,onChange:E,style:{width:200},children:((e==null?void 0:e.actions)||[]).map(ue=>ce.jsx(Mi.Option,{value:ue.name,children:ue.description||ue.name},ue.name))}),ce.jsx(yn,{disabled:!O||_.length===0,style:{marginLeft:5},loading:Z,onClick:ne,children:n("Apply")})]})})})})},[n,O,Z,e==null?void 0:e.actions,e==null?void 0:e.actions_on_bottom,e==null?void 0:e.permissions,ne,_.length,E]);return ce.jsxs("div",{children:[ce.jsx(yn,{style:{minWidth:200},type:"dashed",onClick:M,children:n("Change")}),ce.jsx(oo,{width:"100%",open:i,title:Ka(e,!0),onCancel:R,footer:null,children:ce.jsx(oi,{children:ce.jsx(jn,{xs:24,children:ce.jsx(pZ,{title:de,footer:ve,loading:F,sticky:!0,rowSelection:((e==null?void 0:e.actions)||[]).length>0?{selectedRowKeys:_,onChange:Y}:void 0,columns:Q,onChange:T,rowKey:"id",dataSource:(L==null?void 0:L.results)||[],pagination:{current:p,pageSize:g,total:L==null?void 0:L.total,showSizeChanger:!0},scroll:{x:1e3}})})})}),ce.jsxs(oo,{width:600,open:a,title:`Add ${Ka(e)}`,onCancel:k,footer:null,children:[ce.jsx(Fc,{}),e!=null&&e.permissions.includes(Ya.Add)?ce.jsx(x1,{modelConfiguration:e,form:u,onFinish:re,mode:"inline-add",hasOperationError:U,children:ce.jsx(oi,{justify:"end",children:ce.jsx(jn,{children:ce.jsx(Di,{children:ce.jsxs(yn,{loading:V,htmlType:"submit",type:"primary",children:[ce.jsx(a1,{})," ",n("Add")]})})})})}):ce.jsx(io,{description:n("No permissions for model")})]}),ce.jsxs(oo,{width:600,open:!!l,title:`Change ${Ka(e)} ${l}`,onCancel:j,footer:null,children:[ce.jsx(Fc,{}),H&&e&&e.permissions.includes(Ya.Change)?ce.jsx(x1,{modelConfiguration:e,form:f,onFinish:ae,mode:"inline-change",hasOperationError:K,initialValues:dZ(H),children:ce.jsx(oi,{justify:"end",children:ce.jsx(jn,{children:ce.jsx(Di,{children:ce.jsxs(yn,{loading:q||z,htmlType:"submit",type:"primary",children:[ce.jsx(a1,{})," ",n("Save")]})})})})}):ce.jsx(io,{description:n("No permissions for model")})]})]})},x1=({modelConfiguration:e,id:t,form:n,onFinish:r,children:i,mode:o,hasOperationError:a,initialValues:s})=>{const{t:l}=ao("FormContainer"),[c,u]=b.useState(((e==null?void 0:e.fieldsets)||[]).filter(g=>{var m;return!(((m=g[1])==null?void 0:m.classes)||[]).includes("collapse")}).map(g=>{var m;return JSON.stringify((m=g[1])==null?void 0:m.fields)}));b.useEffect(()=>{a&&u(((e==null?void 0:e.fieldsets)||[]).map(g=>{var m;return JSON.stringify((m=g[1])==null?void 0:m.fields)}))},[a,e==null?void 0:e.fieldsets]);const f=b.useCallback(g=>{if(!g.form_widget_type)return null;const[m,y]=JR(g.form_widget_type,l,t);return ce.jsx(m,Le(Le({},y||{}),g.form_widget_props||{}))},[l,t]),d=b.useCallback(g=>o==="change"||o==="inline-change"?(g==null?void 0:g.change_configuration)||{}:(g==null?void 0:g.add_configuration)||{},[o]),h=b.useCallback(g=>g.map(m=>ce.jsx(Jn.Item,{name:m.name,label:WC(m.name),rules:[...d(m).required?[{required:!0}]:[],...d(m).form_widget_type===sr.EmailInput?[{type:"email"}]:[],...d(m).form_widget_type===sr.UrlInput?[{type:"url"}]:[],...d(m).form_widget_type===sr.JsonTextArea?[{validator:(y,x)=>Ci(this,null,function*(){if(!hFe(x))throw new Error(l("Invalid JSON"))})}]:[],...d(m).form_widget_type===sr.SlugInput?[{validator:(y,x)=>Ci(this,null,function*(){if(!pFe(x))throw new Error(l("Invalid Slug. Please use lowercase letters, numbers, and hyphens."))})}]:[]],valuePropName:[sr.Checkbox,sr.Switch,sr.CheckboxGroup].includes(d(m).form_widget_type)?"checked":void 0,children:f(d(m))},m.name)),[l,d,f]),p=b.useCallback(()=>{const g=((e==null?void 0:e.fields)||[]).filter(y=>!!d(y).form_widget_type).filter(y=>{var x,S,w,C;return o==="add"||o==="inline-add"?!((S=(x=y.add_configuration)==null?void 0:x.form_widget_props)!=null&&S.disabled)&&!((C=(w=y.add_configuration)==null?void 0:w.form_widget_props)!=null&&C.readOnly):!0}),m=(e==null?void 0:e.fieldsets)||[];if(m.length>0){const y=x=>u(x);return ce.jsx(jMe,{size:"small",expandIconPosition:"end",activeKey:c,onChange:y,items:m.map(x=>{var C;const S=x[0],w=(C=x[1])==null?void 0:C.fields;return{key:JSON.stringify(w),label:S||l("General"),children:h(g.filter(O=>(w||[]).includes(O.name)).sort((O,E)=>w.indexOf(O.name)-w.indexOf(E.name)))}})})}return h(g.sort((y,x)=>(d(y).index||0)-(d(x).index||0)))},[l,c,h,d,e==null?void 0:e.fields,e==null?void 0:e.fieldsets,o]),v=b.useCallback(()=>t?((e==null?void 0:e.inlines)||[]).map(g=>ce.jsx(Jn.Item,{label:Ka(g,!0),children:ce.jsx(dGe,{modelConfiguration:g,parentId:t})},g.name)):null,[e==null?void 0:e.inlines,t]);return ce.jsxs(Jn,{initialValues:s,layout:"vertical",form:n,onFinish:r,children:[(e==null?void 0:e.save_on_top)&&ce.jsxs(ce.Fragment,{children:[i,ce.jsx(Fc,{})]}),ce.jsxs(oi,{gutter:[32,32],children:[ce.jsx(jn,{xs:24,xl:o==="inline-add"||o==="inline-change"?24:12,children:p()}),o==="change"&&ce.jsx(jn,{xs:24,xl:12,children:v()})]}),ce.jsx(Fc,{}),i]})},hGe=()=>{const[e]=Jn.useForm(),t=zx(),n=Gv(),{configuration:r}=b.useContext(pl),{t:i}=ao("Add"),{model:o}=IC(),a=r.models.find(f=>f.name===o),{mutate:s,isPending:l,isError:c}=Ko({mutationFn:f=>qc(`/add/${o}`,f),onSuccess:()=>{Ti.success(i("Succesfully added")),t.invalidateQueries([`/list/${o}`]),n(`/list/${o}`)},onError:f=>{Fl(f,e)}}),u=f=>{const d=GC(f);s(d)};return ce.jsx(VC,{title:`${i("Add")} ${a&&Ka(a)}`,breadcrumbs:ce.jsx(My,{items:[{title:ce.jsx(vf,{to:"/",children:i("Dashboard")})},{title:ce.jsx(vf,{to:`/list/${o}`,children:a&&Ka(a)})},{title:i("Add")}]}),children:a!=null&&a.permissions.includes(Ya.Add)?ce.jsx(x1,{modelConfiguration:a,form:e,onFinish:u,mode:"add",hasOperationError:c,children:ce.jsx(oi,{justify:"end",children:ce.jsx(jn,{children:ce.jsx(Di,{children:ce.jsxs(yn,{loading:l,htmlType:"submit",type:"primary",children:[ce.jsx(a1,{})," ",i("Add")]})})})})}):ce.jsx(io,{description:i("No permissions for model")})})},pGe=()=>{const[e]=Jn.useForm(),t=f1(),n=zx(),r=Gv(),{configuration:i}=b.useContext(pl),{t:o}=ao("Change"),{model:a,id:s}=IC(),l=i.models.find(O=>O.name===a),{data:c,isLoading:u}=vc({queryKey:[`/retrieve/${a}/${s}`],queryFn:()=>Uc(`/retrieve/${a}/${s}`),refetchOnWindowFocus:!1}),{mutate:f,isPending:d,isError:h}=Ko({mutationFn:O=>qc(`/add/${a}`,O),onSuccess:()=>{Ti.success(o("Succesfully added")),n.invalidateQueries([`/list/${a}`]);const O=e.getFieldValue("next");O&&r(O)},onError:O=>{Fl(O,e)}}),{mutate:p,isPending:v,isError:g}=Ko({mutationFn:O=>bR(`/change/${a}/${s}`,O),onSuccess:()=>{Ti.success(o("Succesfully changed")),n.invalidateQueries([`/retrieve/${a}/${s}`]),n.invalidateQueries([`/list/${a}`]);const O=e.getFieldValue("next");O&&r(O)},onError:O=>{Fl(O,e)}}),{mutate:m}=Ko({mutationFn:()=>xR(`/delete/${a}/${s}`),onSuccess:()=>{Ti.success(o("Successfully deleted")),n.invalidateQueries([`/list/${a}`]),r(`/list/${a}`)},onError:()=>{Ti.error(o("Server error"))}}),y=O=>{if(e.getFieldValue("save_as_new")){f(GC(O));return}p(GC(O))},x=()=>m(),S=()=>{e.submit()},w=()=>{e.setFieldValue("next",`/add/${a}`),l!=null&&l.save_as&&e.setFieldValue("save_as_new",!0),e.submit()},C=()=>{l!=null&&l.save_as_continue||e.setFieldValue("next",`/list/${a}`),e.submit()};return ce.jsx(VC,{title:`${o("Change")} ${l&&Ka(l)} ${s}`,breadcrumbs:ce.jsx(My,{items:[{title:ce.jsx(vf,{to:"/",children:o("Dashboard")})},{title:ce.jsx(vf,{to:`/list/${a}`,children:l&&Ka(l)})},{title:s}]}),isLoading:u,children:c&&l&&l.permissions.includes(Ya.Change)?ce.jsx(x1,{modelConfiguration:l,id:s,form:e,onFinish:y,mode:"change",hasOperationError:g||h,initialValues:dZ(c),children:ce.jsxs(oi,{gutter:[8,8],justify:"space-between",children:[ce.jsx(jn,{children:ce.jsx(Di,{children:ce.jsx(U5,{title:o("Are you sure?"),onConfirm:x,children:ce.jsxs(yn,{danger:!0,children:[ce.jsx(vC,{})," ",o("Delete")]})})})}),ce.jsx(jn,{children:ce.jsxs(Di,{children:[!t&&!(l!=null&&l.save_as_continue)&&ce.jsxs(yn,{loading:v||d,onClick:S,type:"default",children:[ce.jsx(dX,{})," ",o("Save and continue editing")]}),!t&&ce.jsxs(yn,{loading:v||d,onClick:w,type:"default",children:[ce.jsx(dX,{})," ",l!=null&&l.save_as?o("Save as new"):o("Save and add another")]}),ce.jsxs(yn,{loading:v||d,onClick:C,type:"primary",children:[ce.jsx(a1,{})," ",o("Save")]})]})})]})}):ce.jsx(io,{description:o("No permissions for model")})})},NQ=()=>[["cartesian"]];NQ.props={};function vGe(e,t){return e=e%(2*Math.PI),t=t%(2*Math.PI),e<0&&(e=2*Math.PI+e),t<0&&(t=2*Math.PI+t),e>=t&&(t=t+2*Math.PI),{startAngle:e,endAngle:t}}const kQ=(e={})=>{const t={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},t),e);return Object.assign(Object.assign({},n),vGe(n.startAngle,n.endAngle))},S1=e=>{const{startAngle:t,endAngle:n,innerRadius:r,outerRadius:i}=kQ(e);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,n,r,i]]};S1.props={};const tN=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];tN.props={transform:!0};const gGe=(e={})=>{const t={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},t),e)},AQ=e=>{const{startAngle:t,endAngle:n,innerRadius:r,outerRadius:i}=gGe(e);return[...tN(),...S1({startAngle:t,endAngle:n,innerRadius:r,outerRadius:i})]};AQ.props={};const LQ=(e={})=>{const t={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},t),e)},nN=e=>{const{startAngle:t,endAngle:n,innerRadius:r,outerRadius:i}=LQ(e);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...S1({startAngle:t,endAngle:n,innerRadius:r,outerRadius:i})]};nN.props={};const rN=()=>[["parallel",0,1,0,1]];rN.props={};const jQ=({focusX:e=0,focusY:t=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",e,t,n,r,i]];jQ.props={transform:!0};const DQ=e=>{const{startAngle:t=-Math.PI/2,endAngle:n=Math.PI*3/2,innerRadius:r=0,outerRadius:i=1}=e;return[...rN(),...S1({startAngle:t,endAngle:n,innerRadius:r,outerRadius:i})]};DQ.props={};const FQ=({value:e})=>t=>t.map(()=>e);FQ.props={};const BQ=({value:e})=>t=>t.map(e);BQ.props={};const zQ=({value:e})=>t=>t.map(n=>n[e]);zQ.props={};const HQ=({value:e})=>()=>e;HQ.props={};var cg=function(e){return e!==null&&typeof e!="function"&&isFinite(e.length)},WQ=function(e,t){if(!cg(e))return e;for(var n=[],r=0;r<e.length;r++){var i=e[r];t(i,r)&&n.push(i)}return n};const ea=function(e){return typeof e=="function"};var hn=function(e){return e==null},mGe={}.toString,w1=function(e,t){return mGe.call(e)==="[object "+t+"]"};const Hi=function(e){return Array.isArray?Array.isArray(e):w1(e,"Array")},lh=function(e){var t=typeof e;return e!==null&&t==="object"||t==="function"};function iN(e,t){if(e){var n;if(Hi(e))for(var r=0,i=e.length;r<i&&(n=t(e[r],r),n!==!1);r++);else if(lh(e)){for(var o in e)if(e.hasOwnProperty(o)&&(n=t(e[o],o),n===!1))break}}}var oN=Object.keys?function(e){return Object.keys(e)}:function(e){var t=[];return iN(e,function(n,r){ea(e)&&r==="prototype"||t.push(r)}),t};function yGe(e,t){var n=oN(t),r=n.length;if(hn(e))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(t[o]!==e[o]||!(o in e))return!1}return!0}var aN=function(e){return typeof e=="object"&&e!==null},Yc=function(e){if(!aN(e)||!w1(e,"Object"))return!1;if(Object.getPrototypeOf(e)===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};function ug(e,t){if(!Hi(e))return null;var n;if(ea(t)&&(n=t),Yc(t)&&(n=function(i){return yGe(i,t)}),n){for(var r=0;r<e.length;r+=1)if(n(e[r]))return e[r]}return null}const pO=function(e){if(Hi(e))return e.reduce(function(t,n){return Math.max(t,n)},e[0])},vO=function(e){if(Hi(e))return e.reduce(function(t,n){return Math.min(t,n)},e[0])};var VQ=function(e,t,n){if(!Hi(e)&&!Yc(e))return e;var r=n;return iN(e,function(i,o){r=t(r,i,o)}),r};const Wr=function(e){return w1(e,"String")};function C1(e){if(cg(e)){var t=e;return t[t.length-1]}}var ai=function(e,t,n){return e<t?t:e>n?n:e},_r=function(e){return w1(e,"Number")},bGe=1e-5;function O1(e,t,n){return n===void 0&&(n=bGe),Math.abs(e-t)<n}const xGe=function(e,t){if(Hi(e)){for(var n,r=-1/0,i=0;i<e.length;i++){var o=e[i],a=ea(t)?t(o):o[t];a>r&&(n=o,r=a)}return n}},SGe=function(e,t){if(Hi(e)){for(var n,r=1/0,i=0;i<e.length;i++){var o=e[i],a=ea(t)?t(o):o[t];a<r&&(n=o,r=a)}return n}};var UQ=function(e,t){return(e%t+t)%t};const qQ=function(e){return hn(e)?"":e.toString()};var GQ=function(e){var t=qQ(e);return t.charAt(0).toLowerCase()+t.substring(1)};function wGe(e,t){return!e||!t?e:e.replace(/\\?\{([^{}]+)\}/g,function(n,r){return n.charAt(0)==="\\"?n.slice(1):t[r]===void 0?"":t[r]})}var mf=function(e){var t=qQ(e);return t.charAt(0).toUpperCase()+t.substring(1)},KQ=function(e){return w1(e,"Boolean")},CGe=function(e){return e===null},xr=function(e){return e===void 0};function YQ(e,t){for(var n in t)t.hasOwnProperty(n)&&n!=="constructor"&&t[n]!==void 0&&(e[n]=t[n])}function OGe(e,t,n,r){return t&&YQ(e,t),n&&YQ(e,n),e}var E1=function(e){if(typeof e!="object"||e===null)return e;var t;if(Hi(e)){t=[];for(var n=0,r=e.length;n<r;n++)typeof e[n]=="object"&&e[n]!=null?t[n]=E1(e[n]):t[n]=e[n]}else{t={};for(var i in e)typeof e[i]=="object"&&e[i]!=null?t[i]=E1(e[i]):t[i]=e[i]}return t};function XQ(e,t,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,e.apply(i,o)};clearTimeout(r),r=setTimeout(a,t)}}function EGe(e){var t,n,r,i=e;function o(s,l){++t>i&&(r=n,a(1),++t),n[s]=l}function a(s){t=0,n=Object.create(null),s||(r=Object.create(null))}return a(),{clear:a,has:function(s){return n[s]!==void 0||r[s]!==void 0},get:function(s){var l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return o(s,l),l},set:function(s,l){n[s]!==void 0?n[s]=l:o(s,l)}}}const _Ge=function(e,t,n){if(!ea(e))throw new TypeError("Expected a function");var r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var a=t?t.apply(this,i):i[0],s=r.cache;if(s.has(a))return s.get(a);var l=e.apply(this,i);return s.set(a,l),l};return r.cache=EGe(n),r};var $Ge=5;function PGe(e,t){if(Object.hasOwn)return Object.hasOwn(e,t);if(e==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}function ZQ(e,t,n,r){n=n||0,r=r||$Ge;for(var i in t)if(PGe(t,i)){var o=t[i];o!==null&&Yc(o)?(Yc(e[i])||(e[i]={}),n<r?ZQ(e[i],o,n+1,r):e[i]=t[i]):Hi(o)?(e[i]=[],e[i]=e[i].concat(o)):o!==void 0&&(e[i]=o)}}var Ue=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r+=1)ZQ(e,t[r]);return e},QQ=function(e,t){if(!cg(e))return-1;var n=Array.prototype.indexOf;if(n)return n.call(e,t);for(var r=-1,i=0;i<e.length;i++)if(e[i]===t){r=i;break}return r},gO=function(e,t){if(e===t)return!0;if(!e||!t||Wr(e)||Wr(t))return!1;if(cg(e)||cg(t)){if(e.length!==t.length)return!1;for(var n=!0,r=0;r<e.length&&(n=gO(e[r],t[r]),!!n);r++);return n}if(aN(e)||aN(t)){var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var n=!0,r=0;r<i.length&&(n=gO(e[i[r]],t[i[r]]),!!n);r++);return n}return!1};const Hn=function(e,t,n){for(var r=0,i=Wr(t)?t.split("."):t;e&&r<i.length;)e=e[i[r++]];return e===void 0||r<i.length?n:e},MGe=function(e,t,n){var r=e,i=Wr(t)?t.split("."):t;return i.forEach(function(o,a){a<i.length-1?(lh(r[o])||(r[o]=_r(i[a+1])?[]:{}),r=r[o]):r[o]=n}),e};var TGe=Object.prototype.hasOwnProperty;const sN=function(e,t){if(e===null||!Yc(e))return{};var n={};return iN(t,function(r){TGe.call(e,r)&&(n[r]=e[r])}),n},lN=function(e,t){return VQ(e,function(n,r,i){return t.includes(i)||(n[i]=r),n},{})},ch=function(e,t,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=n.leading===!1?0:Date.now(),r=null,a=e.apply(i,o),r||(i=o=null)},c=function(){var u=Date.now();!s&&n.leading===!1&&(s=u);var f=t-(u-s);return i=this,o=arguments,f<=0||f>t?(r&&(clearTimeout(r),r=null),s=u,a=e.apply(i,o),r||(i=o=null)):!r&&n.trailing!==!1&&(r=setTimeout(l,f)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c},cN=function(){},uh=function(e){return e};function _1(e){return hn(e)?0:cg(e)?e.length:Object.keys(e).length}var Vr=1e-6,pi=typeof Float32Array!="undefined"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function fg(){var e=new pi(9);return pi!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function IGe(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function RGe(e){var t=new pi(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function NGe(e,t,n,r,i,o,a,s,l){var c=new pi(9);return c[0]=e,c[1]=t,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=s,c[8]=l,c}function kGe(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=u*a-s*c,d=-u*o+s*l,h=c*o-a*l,p=n*f+r*d+i*h;return p?(p=1/p,e[0]=f*p,e[1]=(-u*r+i*c)*p,e[2]=(s*r-i*a)*p,e[3]=d*p,e[4]=(u*n-i*l)*p,e[5]=(-s*n+i*o)*p,e[6]=h*p,e[7]=(-c*n+r*l)*p,e[8]=(a*n-r*o)*p,e):null}function AGe(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],d=n[0],h=n[1],p=n[2],v=n[3],g=n[4],m=n[5],y=n[6],x=n[7],S=n[8];return e[0]=d*r+h*a+p*c,e[1]=d*i+h*s+p*u,e[2]=d*o+h*l+p*f,e[3]=v*r+g*a+m*c,e[4]=v*i+g*s+m*u,e[5]=v*o+g*l+m*f,e[6]=y*r+x*a+S*c,e[7]=y*i+x*s+S*u,e[8]=y*o+x*l+S*f,e}function LGe(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function jGe(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function DGe(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}var FGe=AGe;function er(){var e=new pi(16);return pi!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function uN(e){var t=new pi(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function dg(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function BGe(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,v){var g=new pi(16);return g[0]=e,g[1]=t,g[2]=n,g[3]=r,g[4]=i,g[5]=o,g[6]=a,g[7]=s,g[8]=l,g[9]=c,g[10]=u,g[11]=f,g[12]=d,g[13]=h,g[14]=p,g[15]=v,g}function fN(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,v,g){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e[9]=u,e[10]=f,e[11]=d,e[12]=h,e[13]=p,e[14]=v,e[15]=g,e}function fh(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function JQ(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function vl(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],v=t[13],g=t[14],m=t[15],y=n*s-r*a,x=n*l-i*a,S=n*c-o*a,w=r*l-i*s,C=r*c-o*s,O=i*c-o*l,E=u*v-f*p,_=u*g-d*p,$=u*m-h*p,P=f*g-d*v,T=f*m-h*v,I=d*m-h*g,M=y*I-x*T+S*P+w*$-C*_+O*E;return M?(M=1/M,e[0]=(s*I-l*T+c*P)*M,e[1]=(i*T-r*I-o*P)*M,e[2]=(v*O-g*C+m*w)*M,e[3]=(d*C-f*O-h*w)*M,e[4]=(l*$-a*I-c*_)*M,e[5]=(n*I-i*$+o*_)*M,e[6]=(g*S-p*O-m*x)*M,e[7]=(u*O-d*S+h*x)*M,e[8]=(a*T-s*$+c*E)*M,e[9]=(r*$-n*T-o*E)*M,e[10]=(p*C-v*S+m*y)*M,e[11]=(f*S-u*C-h*y)*M,e[12]=(s*_-a*P-l*E)*M,e[13]=(n*P-r*_+i*E)*M,e[14]=(v*x-p*w-g*y)*M,e[15]=(u*w-f*x+d*y)*M,e):null}function zGe(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],v=t[13],g=t[14],m=t[15];return e[0]=s*(d*m-h*g)-f*(l*m-c*g)+v*(l*h-c*d),e[1]=-(r*(d*m-h*g)-f*(i*m-o*g)+v*(i*h-o*d)),e[2]=r*(l*m-c*g)-s*(i*m-o*g)+v*(i*c-o*l),e[3]=-(r*(l*h-c*d)-s*(i*h-o*d)+f*(i*c-o*l)),e[4]=-(a*(d*m-h*g)-u*(l*m-c*g)+p*(l*h-c*d)),e[5]=n*(d*m-h*g)-u*(i*m-o*g)+p*(i*h-o*d),e[6]=-(n*(l*m-c*g)-a*(i*m-o*g)+p*(i*c-o*l)),e[7]=n*(l*h-c*d)-a*(i*h-o*d)+u*(i*c-o*l),e[8]=a*(f*m-h*v)-u*(s*m-c*v)+p*(s*h-c*f),e[9]=-(n*(f*m-h*v)-u*(r*m-o*v)+p*(r*h-o*f)),e[10]=n*(s*m-c*v)-a*(r*m-o*v)+p*(r*c-o*s),e[11]=-(n*(s*h-c*f)-a*(r*h-o*f)+u*(r*c-o*s)),e[12]=-(a*(f*g-d*v)-u*(s*g-l*v)+p*(s*d-l*f)),e[13]=n*(f*g-d*v)-u*(r*g-i*v)+p*(r*d-i*f),e[14]=-(n*(s*g-l*v)-a*(r*g-i*v)+p*(r*l-i*s)),e[15]=n*(s*d-l*f)-a*(r*d-i*f)+u*(r*l-i*s),e}function eJ(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],f=e[10],d=e[11],h=e[12],p=e[13],v=e[14],g=e[15],m=t*a-n*o,y=t*s-r*o,x=t*l-i*o,S=n*s-r*a,w=n*l-i*a,C=r*l-i*s,O=c*p-u*h,E=c*v-f*h,_=c*g-d*h,$=u*v-f*p,P=u*g-d*p,T=f*g-d*v;return m*T-y*P+x*$+S*_-w*E+C*O}function Do(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],d=t[9],h=t[10],p=t[11],v=t[12],g=t[13],m=t[14],y=t[15],x=n[0],S=n[1],w=n[2],C=n[3];return e[0]=x*r+S*s+w*f+C*v,e[1]=x*i+S*l+w*d+C*g,e[2]=x*o+S*c+w*h+C*m,e[3]=x*a+S*u+w*p+C*y,x=n[4],S=n[5],w=n[6],C=n[7],e[4]=x*r+S*s+w*f+C*v,e[5]=x*i+S*l+w*d+C*g,e[6]=x*o+S*c+w*h+C*m,e[7]=x*a+S*u+w*p+C*y,x=n[8],S=n[9],w=n[10],C=n[11],e[8]=x*r+S*s+w*f+C*v,e[9]=x*i+S*l+w*d+C*g,e[10]=x*o+S*c+w*h+C*m,e[11]=x*a+S*u+w*p+C*y,x=n[12],S=n[13],w=n[14],C=n[15],e[12]=x*r+S*s+w*f+C*v,e[13]=x*i+S*l+w*d+C*g,e[14]=x*o+S*c+w*h+C*m,e[15]=x*a+S*u+w*p+C*y,e}function hg(e,t,n){var r=n[0],i=n[1],o=n[2],a,s,l,c,u,f,d,h,p,v,g,m;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*o+t[12],e[13]=t[1]*r+t[5]*i+t[9]*o+t[13],e[14]=t[2]*r+t[6]*i+t[10]*o+t[14],e[15]=t[3]*r+t[7]*i+t[11]*o+t[15]):(a=t[0],s=t[1],l=t[2],c=t[3],u=t[4],f=t[5],d=t[6],h=t[7],p=t[8],v=t[9],g=t[10],m=t[11],e[0]=a,e[1]=s,e[2]=l,e[3]=c,e[4]=u,e[5]=f,e[6]=d,e[7]=h,e[8]=p,e[9]=v,e[10]=g,e[11]=m,e[12]=a*r+u*i+p*o+t[12],e[13]=s*r+f*i+v*o+t[13],e[14]=l*r+d*i+g*o+t[14],e[15]=c*r+h*i+m*o+t[15]),e}function tJ(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function HGe(e,t,n,r){var i=r[0],o=r[1],a=r[2],s=Math.hypot(i,o,a),l,c,u,f,d,h,p,v,g,m,y,x,S,w,C,O,E,_,$,P,T,I,M,R;return s<Vr?null:(s=1/s,i*=s,o*=s,a*=s,l=Math.sin(n),c=Math.cos(n),u=1-c,f=t[0],d=t[1],h=t[2],p=t[3],v=t[4],g=t[5],m=t[6],y=t[7],x=t[8],S=t[9],w=t[10],C=t[11],O=i*i*u+c,E=o*i*u+a*l,_=a*i*u-o*l,$=i*o*u-a*l,P=o*o*u+c,T=a*o*u+i*l,I=i*a*u+o*l,M=o*a*u-i*l,R=a*a*u+c,e[0]=f*O+v*E+x*_,e[1]=d*O+g*E+S*_,e[2]=h*O+m*E+w*_,e[3]=p*O+y*E+C*_,e[4]=f*$+v*P+x*T,e[5]=d*$+g*P+S*T,e[6]=h*$+m*P+w*T,e[7]=p*$+y*P+C*T,e[8]=f*I+v*M+x*R,e[9]=d*I+g*M+S*R,e[10]=h*I+m*M+w*R,e[11]=p*I+y*M+C*R,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function nJ(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*r,e[5]=a*i+u*r,e[6]=s*i+f*r,e[7]=l*i+d*r,e[8]=c*i-o*r,e[9]=u*i-a*r,e[10]=f*i-s*r,e[11]=d*i-l*r,e}function rJ(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],c=t[8],u=t[9],f=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*r,e[1]=a*i-u*r,e[2]=s*i-f*r,e[3]=l*i-d*r,e[8]=o*r+c*i,e[9]=a*r+u*i,e[10]=s*r+f*i,e[11]=l*r+d*i,e}function WGe(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],c=t[4],u=t[5],f=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*r,e[1]=a*i+u*r,e[2]=s*i+f*r,e[3]=l*i+d*r,e[4]=c*i-o*r,e[5]=u*i-a*r,e[6]=f*i-s*r,e[7]=d*i-l*r,e}function yf(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function bf(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function iJ(e,t,n){var r=n[0],i=n[1],o=n[2],a=Math.hypot(r,i,o),s,l,c;return a<Vr?null:(a=1/a,r*=a,i*=a,o*=a,s=Math.sin(t),l=Math.cos(t),c=1-l,e[0]=r*r*c+l,e[1]=i*r*c+o*s,e[2]=o*r*c-i*s,e[3]=0,e[4]=r*i*c-o*s,e[5]=i*i*c+l,e[6]=o*i*c+r*s,e[7]=0,e[8]=r*o*c+i*s,e[9]=i*o*c-r*s,e[10]=o*o*c+l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function oJ(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function aJ(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dN(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function sJ(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=r+r,l=i+i,c=o+o,u=r*s,f=r*l,d=r*c,h=i*l,p=i*c,v=o*c,g=a*s,m=a*l,y=a*c;return e[0]=1-(h+v),e[1]=f+y,e[2]=d-m,e[3]=0,e[4]=f-y,e[5]=1-(u+v),e[6]=p+g,e[7]=0,e[8]=d+m,e[9]=p-g,e[10]=1-(u+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function VGe(e,t){var n=new pi(3),r=-t[0],i=-t[1],o=-t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=(s*a+u*r+l*o-c*i)*2/f,n[1]=(l*a+u*i+c*r-s*o)*2/f,n[2]=(c*a+u*o+s*i-l*r)*2/f):(n[0]=(s*a+u*r+l*o-c*i)*2,n[1]=(l*a+u*i+c*r-s*o)*2,n[2]=(c*a+u*o+s*i-l*r)*2),sJ(e,t,n),e}function mO(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function pg(e,t){var n=t[0],r=t[1],i=t[2],o=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(o,a,s),e[2]=Math.hypot(l,c,u),e}function yO(e,t){var n=new pi(3);pg(n,t);var r=1/n[0],i=1/n[1],o=1/n[2],a=t[0]*r,s=t[1]*i,l=t[2]*o,c=t[4]*r,u=t[5]*i,f=t[6]*o,d=t[8]*r,h=t[9]*i,p=t[10]*o,v=a+u+p,g=0;return v>0?(g=Math.sqrt(v+1)*2,e[3]=.25*g,e[0]=(f-h)/g,e[1]=(d-l)/g,e[2]=(s-c)/g):a>u&&a>p?(g=Math.sqrt(1+a-u-p)*2,e[3]=(f-h)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(d+l)/g):u>p?(g=Math.sqrt(1+u-a-p)*2,e[3]=(d-l)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+h)/g):(g=Math.sqrt(1+p-a-u)*2,e[3]=(s-c)/g,e[0]=(d+l)/g,e[1]=(f+h)/g,e[2]=.25*g),e}function UGe(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3],l=i+i,c=o+o,u=a+a,f=i*l,d=i*c,h=i*u,p=o*c,v=o*u,g=a*u,m=s*l,y=s*c,x=s*u,S=r[0],w=r[1],C=r[2];return e[0]=(1-(p+g))*S,e[1]=(d+x)*S,e[2]=(h-y)*S,e[3]=0,e[4]=(d-x)*w,e[5]=(1-(f+g))*w,e[6]=(v+m)*w,e[7]=0,e[8]=(h+y)*C,e[9]=(v-m)*C,e[10]=(1-(f+p))*C,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function $1(e,t,n,r,i){var o=t[0],a=t[1],s=t[2],l=t[3],c=o+o,u=a+a,f=s+s,d=o*c,h=o*u,p=o*f,v=a*u,g=a*f,m=s*f,y=l*c,x=l*u,S=l*f,w=r[0],C=r[1],O=r[2],E=i[0],_=i[1],$=i[2],P=(1-(v+m))*w,T=(h+S)*w,I=(p-x)*w,M=(h-S)*C,R=(1-(d+m))*C,N=(g+y)*C,k=(p+x)*O,A=(g-y)*O,j=(1-(d+v))*O;return e[0]=P,e[1]=T,e[2]=I,e[3]=0,e[4]=M,e[5]=R,e[6]=N,e[7]=0,e[8]=k,e[9]=A,e[10]=j,e[11]=0,e[12]=n[0]+E-(P*E+M*_+k*$),e[13]=n[1]+_-(T*E+R*_+A*$),e[14]=n[2]+$-(I*E+N*_+j*$),e[15]=1,e}function hN(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,c=n*a,u=r*a,f=r*s,d=i*a,h=i*s,p=i*l,v=o*a,g=o*s,m=o*l;return e[0]=1-f-p,e[1]=u+m,e[2]=d-g,e[3]=0,e[4]=u-m,e[5]=1-c-p,e[6]=h+v,e[7]=0,e[8]=d+g,e[9]=h-v,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function qGe(e,t,n,r,i,o,a){var s=1/(n-t),l=1/(i-r),c=1/(o-a);return e[0]=o*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*l,e[10]=(a+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*c,e[15]=0,e}function lJ(e,t,n,r,i){var o=1/Math.tan(t/2),a;return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(a=1/(r-i),e[10]=(i+r)*a,e[14]=2*i*r*a):(e[10]=-1,e[14]=-2*r),e}var GGe=lJ;function KGe(e,t,n,r,i){var o=1/Math.tan(t/2),a;return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(a=1/(r-i),e[10]=i*a,e[14]=i*r*a):(e[10]=-1,e[14]=-r),e}function YGe(e,t,n,r){var i=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(a+s),c=2/(i+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((a-s)*l*.5),e[9]=(i-o)*c*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e}function cJ(e,t,n,r,i,o,a){var s=1/(t-n),l=1/(r-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(a+o)*c,e[15]=1,e}var uJ=cJ;function fJ(e,t,n,r,i,o,a){var s=1/(t-n),l=1/(r-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=o*c,e[15]=1,e}function dJ(e,t,n,r){var i,o,a,s,l,c,u,f,d,h,p=t[0],v=t[1],g=t[2],m=r[0],y=r[1],x=r[2],S=n[0],w=n[1],C=n[2];return Math.abs(p-S)<Vr&&Math.abs(v-w)<Vr&&Math.abs(g-C)<Vr?fh(e):(u=p-S,f=v-w,d=g-C,h=1/Math.hypot(u,f,d),u*=h,f*=h,d*=h,i=y*d-x*f,o=x*u-m*d,a=m*f-y*u,h=Math.hypot(i,o,a),h?(h=1/h,i*=h,o*=h,a*=h):(i=0,o=0,a=0),s=f*a-d*o,l=d*i-u*a,c=u*o-f*i,h=Math.hypot(s,l,c),h?(h=1/h,s*=h,l*=h,c*=h):(s=0,l=0,c=0),e[0]=i,e[1]=s,e[2]=u,e[3]=0,e[4]=o,e[5]=l,e[6]=f,e[7]=0,e[8]=a,e[9]=c,e[10]=d,e[11]=0,e[12]=-(i*p+o*v+a*g),e[13]=-(s*p+l*v+c*g),e[14]=-(u*p+f*v+d*g),e[15]=1,e)}function XGe(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=r[0],l=r[1],c=r[2],u=i-n[0],f=o-n[1],d=a-n[2],h=u*u+f*f+d*d;h>0&&(h=1/Math.sqrt(h),u*=h,f*=h,d*=h);var p=l*d-c*f,v=c*u-s*d,g=s*f-l*u;return h=p*p+v*v+g*g,h>0&&(h=1/Math.sqrt(h),p*=h,v*=h,g*=h),e[0]=p,e[1]=v,e[2]=g,e[3]=0,e[4]=f*g-d*v,e[5]=d*p-u*g,e[6]=u*v-f*p,e[7]=0,e[8]=u,e[9]=f,e[10]=d,e[11]=0,e[12]=i,e[13]=o,e[14]=a,e[15]=1,e}function ZGe(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function QGe(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function JGe(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function hJ(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function eKe(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function tKe(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e}function nKe(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function rKe(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],v=e[13],g=e[14],m=e[15],y=t[0],x=t[1],S=t[2],w=t[3],C=t[4],O=t[5],E=t[6],_=t[7],$=t[8],P=t[9],T=t[10],I=t[11],M=t[12],R=t[13],N=t[14],k=t[15];return Math.abs(n-y)<=Vr*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-x)<=Vr*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-S)<=Vr*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(o-w)<=Vr*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-C)<=Vr*Math.max(1,Math.abs(a),Math.abs(C))&&Math.abs(s-O)<=Vr*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(l-E)<=Vr*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-_)<=Vr*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-$)<=Vr*Math.max(1,Math.abs(u),Math.abs($))&&Math.abs(f-P)<=Vr*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(d-T)<=Vr*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(h-I)<=Vr*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(p-M)<=Vr*Math.max(1,Math.abs(p),Math.abs(M))&&Math.abs(v-R)<=Vr*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(g-N)<=Vr*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(m-k)<=Vr*Math.max(1,Math.abs(m),Math.abs(k))}var pN=Do,iKe=hJ;const oKe=Object.freeze(Object.defineProperty({__proto__:null,add:JGe,adjoint:zGe,clone:uN,copy:dg,create:er,determinant:eJ,equals:rKe,exactEquals:nKe,frob:QGe,fromQuat:hN,fromQuat2:VGe,fromRotation:iJ,fromRotationTranslation:sJ,fromRotationTranslationScale:UGe,fromRotationTranslationScaleOrigin:$1,fromScaling:bf,fromTranslation:yf,fromValues:BGe,fromXRotation:oJ,fromYRotation:aJ,fromZRotation:dN,frustum:qGe,getRotation:yO,getScaling:pg,getTranslation:mO,identity:fh,invert:vl,lookAt:dJ,mul:pN,multiply:Do,multiplyScalar:eKe,multiplyScalarAndAdd:tKe,ortho:uJ,orthoNO:cJ,orthoZO:fJ,perspective:GGe,perspectiveFromFieldOfView:YGe,perspectiveNO:lJ,perspectiveZO:KGe,rotate:HGe,rotateX:nJ,rotateY:rJ,rotateZ:WGe,scale:tJ,set:fN,str:ZGe,sub:iKe,subtract:hJ,targetTo:XGe,translate:hg,transpose:JQ},Symbol.toStringTag,{value:"Module"}));function Mn(){var e=new pi(3);return pi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Xc(e){var t=new pi(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Zc(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Un(e,t,n){var r=new pi(3);return r[0]=e,r[1]=t,r[2]=n,r}function xf(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function gl(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function vg(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function pJ(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function aKe(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function vN(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function sKe(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.hypot(n,r,i)}function dh(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Wl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function bO(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2];return e[0]=i*l-o*s,e[1]=o*a-r*l,e[2]=r*s-i*a,e}function gN(e,t,n,r){var i=t[0],o=t[1],a=t[2];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e}function Zi(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e}function vJ(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8],e}function lKe(e,t,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=t[0],l=t[1],c=t[2],u=i*c-o*l,f=o*s-r*c,d=r*l-i*s,h=i*d-o*f,p=o*u-r*d,v=r*f-i*u,g=a*2;return u*=g,f*=g,d*=g,h*=2,p*=2,v*=2,e[0]=s+u+h,e[1]=l+f+p,e[2]=c+d+v,e}function P1(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2];return Math.abs(n-o)<=Vr*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=Vr*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=Vr*Math.max(1,Math.abs(i),Math.abs(s))}var gJ=sKe,mJ=Zc;(function(){var e=Mn();return function(t,n,r,i,o,a){var s,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}})();function gg(){var e=new pi(4);return pi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function cKe(e,t,n,r){var i=new pi(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i}function uKe(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function fKe(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a,e}function mg(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e}(function(){var e=gg();return function(t,n,r,i,o,a){var s,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}})();function Ii(){var e=new pi(4);return pi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Sf(e,t,n){n=n*.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function wf(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],c=n[2],u=n[3];return e[0]=r*u+a*s+i*c-o*l,e[1]=i*u+a*l+o*s-r*c,e[2]=o*u+a*c+r*l-i*s,e[3]=a*u-r*s-i*l-o*c,e}function mN(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3],l=n[0],c=n[1],u=n[2],f=n[3],d,h,p,v,g;return h=i*l+o*c+a*u+s*f,h<0&&(h=-h,l=-l,c=-c,u=-u,f=-f),1-h>Vr?(d=Math.acos(h),p=Math.sin(d),v=Math.sin((1-r)*d)/p,g=Math.sin(r*d)/p):(v=1-r,g=r),e[0]=v*i+g*l,e[1]=v*o+g*c,e[2]=v*a+g*u,e[3]=v*s+g*f,e}function yN(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=o*s,e}function dKe(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[o*3+o]-t[a*3+a]+1),e[i]=.5*r,r=.5/r,e[3]=(t[o*3+a]-t[a*3+o])*r,e[o]=(t[o*3+i]+t[i*3+o])*r,e[a]=(t[a*3+i]+t[i*3+a])*r}return e}function xO(e,t,n,r){var i=.5*Math.PI/180;t*=i,n*=i,r*=i;var o=Math.sin(t),a=Math.cos(t),s=Math.sin(n),l=Math.cos(n),c=Math.sin(r),u=Math.cos(r);return e[0]=o*l*u-a*s*c,e[1]=a*s*u+o*l*c,e[2]=a*l*c-o*s*u,e[3]=a*l*u+o*s*c,e}var bN=cKe,SO=uKe,yJ=wf,wO=fKe;(function(){var e=Mn(),t=Un(1,0,0),n=Un(0,1,0);return function(r,i,o){var a=Wl(i,o);return a<-.999999?(bO(e,t,i),mJ(e)<1e-6&&bO(e,n,i),dh(e,e),Sf(r,e,Math.PI),r):a>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(bO(e,i,o),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+a,wO(r,r))}})(),function(){var e=Ii(),t=Ii();return function(n,r,i,o,a,s){return mN(e,r,a,s),mN(t,i,o,s),mN(n,e,t,2*s*(1-s)),n}}(),function(){var e=fg();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],wO(t,dKe(t,e))}}();function hKe(){var e=new pi(2);return pi!=Float32Array&&(e[0]=0,e[1]=0),e}function pKe(e,t){var n=new pi(2);return n[0]=e,n[1]=t,n}function vKe(e,t){return e[0]=t[0],e[1]=t[1],e}function gKe(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e}function mKe(e,t){return e[0]*t[0]+e[1]*t[1]}function yKe(e,t){return e[0]===t[0]&&e[1]===t[1]}(function(){var e=hKe();return function(t,n,r,i,o,a){var s,l;for(n||(n=2),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],o(e,e,a),t[s]=e[0],t[s+1]=e[1];return t}})();var bJ={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function bKe(e,t,n){if(e[n].length>7){e[n].shift();for(var r=e[n],i=n;r.length;)t[n]="A",e.splice(i+=1,0,["C"].concat(r.splice(0,6)));e.splice(n,1)}}var M1={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function xJ(e){return Array.isArray(e)&&e.every(function(t){var n=t[0].toLowerCase();return M1[n]===t.length-1&&"achlmqstvz".includes(n)})}function SJ(e){return xJ(e)&&e.every(function(t){var n=t[0];return n===n.toUpperCase()})}function wJ(e){return SJ(e)&&e.every(function(t){var n=t[0];return"ACLMQZ".includes(n)})}function CJ(e){for(var t=e.pathValue[e.segmentStart],n=t.toLowerCase(),r=e.data;r.length>=M1[n]&&(n==="m"&&r.length>2?(e.segments.push([t].concat(r.splice(0,2))),n="l",t=t==="m"?"l":"L"):e.segments.push([t].concat(r.splice(0,M1[n]))),!!M1[n]););}function xKe(e){var t=e.index,n=e.pathValue,r=n.charCodeAt(t);if(r===48){e.param=0,e.index+=1;return}if(r===49){e.param=1,e.index+=1;return}e.err='[path-util]: invalid Arc flag "'+n[t]+'", expecting 0 or 1 at index '+t}function SKe(e){return e>=48&&e<=57||e===43||e===45||e===46}function yg(e){return e>=48&&e<=57}function wKe(e){var t=e.max,n=e.pathValue,r=e.index,i=r,o=!1,a=!1,s=!1,l=!1,c;if(i>=t){e.err="[path-util]: Invalid path value at index "+i+', "pathValue" is missing param';return}if(c=n.charCodeAt(i),(c===43||c===45)&&(i+=1,c=n.charCodeAt(i)),!yg(c)&&c!==46){e.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" is not a number';return}if(c!==46){if(o=c===48,i+=1,c=n.charCodeAt(i),o&&i<t&&c&&yg(c)){e.err="[path-util]: Invalid path value at index "+r+', "'+n[r]+'" illegal number';return}for(;i<t&&yg(n.charCodeAt(i));)i+=1,a=!0;c=n.charCodeAt(i)}if(c===46){for(l=!0,i+=1;yg(n.charCodeAt(i));)i+=1,s=!0;c=n.charCodeAt(i)}if(c===101||c===69){if(l&&!a&&!s){e.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" invalid float exponent';return}if(i+=1,c=n.charCodeAt(i),(c===43||c===45)&&(i+=1),i<t&&yg(n.charCodeAt(i)))for(;i<t&&yg(n.charCodeAt(i));)i+=1;else{e.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" invalid integer exponent';return}}e.index=i,e.param=+e.pathValue.slice(r,i)}function CKe(e){var t=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return e===10||e===13||e===8232||e===8233||e===32||e===9||e===11||e===12||e===160||e>=5760&&t.includes(e)}function CO(e){for(var t=e.pathValue,n=e.max;e.index<n&&CKe(t.charCodeAt(e.index));)e.index+=1}function OKe(e){switch(e|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function EKe(e){return(e|32)===97}function _Ke(e){var t=e.max,n=e.pathValue,r=e.index,i=n.charCodeAt(r),o=M1[n[r].toLowerCase()];if(e.segmentStart=r,!OKe(i)){e.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command';return}if(e.index+=1,CO(e),e.data=[],!o){CJ(e);return}for(;;){for(var a=o;a>0;a-=1){if(EKe(i)&&(a===3||a===4)?xKe(e):wKe(e),e.err.length)return;e.data.push(e.param),CO(e),e.index<t&&n.charCodeAt(e.index)===44&&(e.index+=1,CO(e))}if(e.index>=e.max||!SKe(n.charCodeAt(e.index)))break}CJ(e)}var $Ke=function(){function e(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return e}();function PKe(e){if(xJ(e))return[].concat(e);var t=new $Ke(e);for(CO(t);t.index<t.max&&!t.err.length;)_Ke(t);return t.err?t.err:t.segments}function MKe(e){if(SJ(e))return[].concat(e);var t=PKe(e),n=0,r=0,i=0,o=0;return t.map(function(a){var s=a.slice(1).map(Number),l=a[0],c=l.toUpperCase();if(l==="M")return n=s[0],r=s[1],i=n,o=r,["M",n,r];var u;if(l!==c)switch(c){case"A":u=[c,s[0],s[1],s[2],s[3],s[4],s[5]+n,s[6]+r];break;case"V":u=[c,s[0]+r];break;case"H":u=[c,s[0]+n];break;default:{var f=s.map(function(h,p){return h+(p%2?r:n)});u=[c].concat(f)}}else u=[c].concat(s);var d=u.length;switch(c){case"Z":n=i,r=o;break;case"H":n=u[1];break;case"V":r=u[1];break;default:n=u[d-2],r=u[d-1],c==="M"&&(i=n,o=r)}return u})}function TKe(e,t){var n=e[0],r=t.x1,i=t.y1,o=t.x2,a=t.y2,s=e.slice(1).map(Number),l=e;if("TQ".includes(n)||(t.qx=null,t.qy=null),n==="H")l=["L",e[1],i];else if(n==="V")l=["L",r,e[1]];else if(n==="S"){var c=r*2-o,u=i*2-a;t.x1=c,t.y1=u,l=["C",c,u].concat(s)}else if(n==="T"){var f=r*2-t.qx,d=i*2-t.qy;t.qx=f,t.qy=d,l=["Q",f,d].concat(s)}else if(n==="Q"){var h=s[0],p=s[1];t.qx=h,t.qy=p}return l}function OO(e){if(wJ(e))return[].concat(e);for(var t=MKe(e),n=ke({},bJ),r=0;r<t.length;r+=1){t[r]=TKe(t[r],n);var i=t[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return t}function IKe(e){return wJ(e)&&e.every(function(t){var n=t[0];return"MC".includes(n)})}function EO(e,t,n){var r=e*Math.cos(n)-t*Math.sin(n),i=e*Math.sin(n)+t*Math.cos(n);return{x:r,y:i}}function xN(e,t,n,r,i,o,a,s,l,c){var u=e,f=t,d=n,h=r,p=s,v=l,g=Math.PI*120/180,m=Math.PI/180*(+i||0),y=[],x,S,w,C,O;if(c)S=c[0],w=c[1],C=c[2],O=c[3];else{x=EO(u,f,-m),u=x.x,f=x.y,x=EO(p,v,-m),p=x.x,v=x.y;var E=(u-p)/2,_=(f-v)/2,$=E*E/(d*d)+_*_/(h*h);$>1&&($=Math.sqrt($),d*=$,h*=$);var P=d*d,T=h*h,I=(o===a?-1:1)*Math.sqrt(Math.abs((P*T-P*_*_-T*E*E)/(P*_*_+T*E*E)));C=I*d*_/h+(u+p)/2,O=I*-h*E/d+(f+v)/2,S=Math.asin(((f-O)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((v-O)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),S=u<C?Math.PI-S:S,w=p<C?Math.PI-w:w,S<0&&(S=Math.PI*2+S),w<0&&(w=Math.PI*2+w),a&&S>w&&(S-=Math.PI*2),!a&&w>S&&(w-=Math.PI*2)}var M=w-S;if(Math.abs(M)>g){var R=w,N=p,k=v;w=S+g*(a&&w>S?1:-1),p=C+d*Math.cos(w),v=O+h*Math.sin(w),y=xN(p,v,d,h,i,0,a,N,k,[w,R,C,O])}M=w-S;var A=Math.cos(S),j=Math.sin(S),D=Math.cos(w),L=Math.sin(w),F=Math.tan(M/4),B=4/3*d*F,H=4/3*h*F,z=[u,f],W=[u+B*j,f-H*A],V=[p+B*L,v-H*D],U=[p,v];if(W[0]=2*z[0]-W[0],W[1]=2*z[1]-W[1],c)return W.concat(V,U,y);y=W.concat(V,U,y);for(var G=[],q=0,K=y.length;q<K;q+=1)G[q]=q%2?EO(y[q-1],y[q],m).y:EO(y[q],y[q+1],m).x;return G}function RKe(e,t,n,r,i,o){var a=.3333333333333333,s=2/3;return[a*e+s*n,a*t+s*r,a*i+s*n,a*o+s*r,i,o]}function Cf(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return[r+(o-r)*n,i+(a-i)*n]}var OJ=function(e,t,n,r){var i=.5,o=Cf([e,t],[n,r],i);return it(it([],o,!0),[n,r,n,r],!1)};function NKe(e,t){var n=e[0],r=e.slice(1).map(Number),i=r[0],o=r[1],a,s=t.x1,l=t.y1,c=t.x,u=t.y;switch("TQ".includes(n)||(t.qx=null,t.qy=null),n){case"M":return t.x=i,t.y=o,e;case"A":return a=[s,l].concat(r),["C"].concat(xN(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]));case"Q":return t.qx=i,t.qy=o,a=[s,l].concat(r),["C"].concat(RKe(a[0],a[1],a[2],a[3],a[4],a[5]));case"L":return["C"].concat(OJ(s,l,i,o));case"Z":return s===c&&l===u?["C",s,l,c,u,c,u]:["C"].concat(OJ(s,l,c,u))}return e}function SN(e,t){if(t===void 0&&(t=!1),IKe(e)){var n=[].concat(e);return t?[n,[]]:n}for(var r=OO(e),i=ke({},bJ),o=[],a="",s=r.length,l,c,u=[],f=0;f<s;f+=1){r[f]&&(a=r[f][0]),o[f]=a;var d=NKe(r[f],i);r[f]=d,bKe(r,o,f),s=r.length,a==="Z"&&u.push(f),l=r[f],c=l.length,i.x1=+l[c-2],i.y1=+l[c-1],i.x2=+l[c-4]||i.x1,i.y2=+l[c-3]||i.y1}return t?[r,u]:r}function kKe(e){return e.map(function(t){return Array.isArray(t)?[].concat(t):t})}function AKe(e){var t=e.slice(1).map(function(n,r,i){return r?i[r-1].slice(-2).concat(n.slice(1)):e[0].slice(1).concat(n.slice(1))}).map(function(n){return n.map(function(r,i){return n[n.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(t[0].slice(0,2))].concat(t.map(function(n){return["C"].concat(n.slice(2))}))}function xa(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}function wN(e,t,n,r,i){var o=xa([e,t],[n,r]),a={x:0,y:0};if(typeof i=="number")if(i<=0)a={x:e,y:t};else if(i>=o)a={x:n,y:r};else{var s=Cf([e,t],[n,r],i/o),l=s[0],c=s[1];a={x:l,y:c}}return{length:o,point:a,min:{x:Math.min(e,n),y:Math.min(t,r)},max:{x:Math.max(e,n),y:Math.max(t,r)}}}function EJ(e,t){var n=e.x,r=e.y,i=t.x,o=t.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))),l=n*o-r*i<0?-1:1,c=l*Math.acos(a/s);return c}function LKe(e,t,n,r,i,o,a,s,l,c){var u=Math.abs,f=Math.sin,d=Math.cos,h=Math.sqrt,p=Math.PI,v=u(n),g=u(r),m=(i%360+360)%360,y=m*(p/180);if(e===s&&t===l)return{x:e,y:t};if(v===0||g===0)return wN(e,t,s,l,c).point;var x=(e-s)/2,S=(t-l)/2,w={x:d(y)*x+f(y)*S,y:-f(y)*x+d(y)*S},C=Math.pow(w.x,2)/Math.pow(v,2)+Math.pow(w.y,2)/Math.pow(g,2);C>1&&(v*=h(C),g*=h(C));var O=Math.pow(v,2)*Math.pow(g,2)-Math.pow(v,2)*Math.pow(w.y,2)-Math.pow(g,2)*Math.pow(w.x,2),E=Math.pow(v,2)*Math.pow(w.y,2)+Math.pow(g,2)*Math.pow(w.x,2),_=O/E;_=_<0?0:_;var $=(o!==a?1:-1)*h(_),P={x:$*(v*w.y/g),y:$*(-(g*w.x)/v)},T={x:d(y)*P.x-f(y)*P.y+(e+s)/2,y:f(y)*P.x+d(y)*P.y+(t+l)/2},I={x:(w.x-P.x)/v,y:(w.y-P.y)/g},M=EJ({x:1,y:0},I),R={x:(-w.x-P.x)/v,y:(-w.y-P.y)/g},N=EJ(I,R);!a&&N>0?N-=2*p:a&&N<0&&(N+=2*p),N%=2*p;var k=M+N*c,A=v*d(k),j=g*f(k),D={x:d(y)*A-f(y)*j+T.x,y:f(y)*A+d(y)*j+T.y};return D}function jKe(e,t,n,r,i,o,a,s,l,c,u){var f,d=u.bbox,h=d===void 0?!0:d,p=u.length,v=p===void 0?!0:p,g=u.sampleSize,m=g===void 0?30:g,y=typeof c=="number",x=e,S=t,w=0,C=[x,S,w],O=[x,S],E=0,_={x:0,y:0},$=[{x,y:S}];y&&c<=0&&(_={x,y:S});for(var P=0;P<=m;P+=1){if(E=P/m,f=LKe(e,t,n,r,i,o,a,s,l,E),x=f.x,S=f.y,h&&$.push({x,y:S}),v&&(w+=xa(O,[x,S])),O=[x,S],y&&w>=c&&c>C[2]){var T=(w-c)/(w-C[2]);_={x:O[0]*(1-T)+C[0]*T,y:O[1]*(1-T)+C[1]*T}}C=[x,S,w]}return y&&c>=w&&(_={x:s,y:l}),{length:w,point:_,min:{x:Math.min.apply(null,$.map(function(I){return I.x})),y:Math.min.apply(null,$.map(function(I){return I.y}))},max:{x:Math.max.apply(null,$.map(function(I){return I.x})),y:Math.max.apply(null,$.map(function(I){return I.y}))}}}function DKe(e,t,n,r,i,o,a,s,l){var c=1-l;return{x:Math.pow(c,3)*e+3*Math.pow(c,2)*l*n+3*c*Math.pow(l,2)*i+Math.pow(l,3)*a,y:Math.pow(c,3)*t+3*Math.pow(c,2)*l*r+3*c*Math.pow(l,2)*o+Math.pow(l,3)*s}}function _J(e,t,n,r,i,o,a,s,l,c){var u,f=c.bbox,d=f===void 0?!0:f,h=c.length,p=h===void 0?!0:h,v=c.sampleSize,g=v===void 0?10:v,m=typeof l=="number",y=e,x=t,S=0,w=[y,x,S],C=[y,x],O=0,E={x:0,y:0},_=[{x:y,y:x}];m&&l<=0&&(E={x:y,y:x});for(var $=0;$<=g;$+=1){if(O=$/g,u=DKe(e,t,n,r,i,o,a,s,O),y=u.x,x=u.y,d&&_.push({x:y,y:x}),p&&(S+=xa(C,[y,x])),C=[y,x],m&&S>=l&&l>w[2]){var P=(S-l)/(S-w[2]);E={x:C[0]*(1-P)+w[0]*P,y:C[1]*(1-P)+w[1]*P}}w=[y,x,S]}return m&&l>=S&&(E={x:a,y:s}),{length:S,point:E,min:{x:Math.min.apply(null,_.map(function(T){return T.x})),y:Math.min.apply(null,_.map(function(T){return T.y}))},max:{x:Math.max.apply(null,_.map(function(T){return T.x})),y:Math.max.apply(null,_.map(function(T){return T.y}))}}}function FKe(e,t,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*e+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*t+2*s*a*r+Math.pow(a,2)*o}}function BKe(e,t,n,r,i,o,a,s){var l,c=s.bbox,u=c===void 0?!0:c,f=s.length,d=f===void 0?!0:f,h=s.sampleSize,p=h===void 0?10:h,v=typeof a=="number",g=e,m=t,y=0,x=[g,m,y],S=[g,m],w=0,C={x:0,y:0},O=[{x:g,y:m}];v&&a<=0&&(C={x:g,y:m});for(var E=0;E<=p;E+=1){if(w=E/p,l=FKe(e,t,n,r,i,o,w),g=l.x,m=l.y,u&&O.push({x:g,y:m}),d&&(y+=xa(S,[g,m])),S=[g,m],v&&y>=a&&a>x[2]){var _=(y-a)/(y-x[2]);C={x:S[0]*(1-_)+x[0]*_,y:S[1]*(1-_)+x[1]*_}}x=[g,m,y]}return v&&a>=y&&(C={x:i,y:o}),{length:y,point:C,min:{x:Math.min.apply(null,O.map(function($){return $.x})),y:Math.min.apply(null,O.map(function($){return $.y}))},max:{x:Math.max.apply(null,O.map(function($){return $.x})),y:Math.max.apply(null,O.map(function($){return $.y}))}}}function $J(e,t,n){for(var r,i,o,a,s,l,c=OO(e),u=typeof t=="number",f,d=[],h,p=0,v=0,g=0,m=0,y,x=[],S=[],w=0,C={x:0,y:0},O=C,E=C,_=C,$=0,P=0,T=c.length;P<T;P+=1)y=c[P],h=y[0],f=h==="M",d=f?d:[p,v].concat(y.slice(1)),f?(g=y[1],m=y[2],C={x:g,y:m},O=C,w=0,u&&t<.001&&(_=C)):h==="L"?(r=wN(d[0],d[1],d[2],d[3],(t||0)-$),w=r.length,C=r.min,O=r.max,E=r.point):h==="A"?(i=jKe(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(t||0)-$,n||{}),w=i.length,C=i.min,O=i.max,E=i.point):h==="C"?(o=_J(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(t||0)-$,n||{}),w=o.length,C=o.min,O=o.max,E=o.point):h==="Q"?(a=BKe(d[0],d[1],d[2],d[3],d[4],d[5],(t||0)-$,n||{}),w=a.length,C=a.min,O=a.max,E=a.point):h==="Z"&&(d=[p,v,g,m],s=wN(d[0],d[1],d[2],d[3],(t||0)-$),w=s.length,C=s.min,O=s.max,E=s.point),u&&$<t&&$+w>=t&&(_=E),S.push(O),x.push(C),$+=w,l=h!=="Z"?y.slice(-2):[g,m],p=l[0],v=l[1];return u&&t>=$&&(_={x:p,y:v}),{length:$,point:_,min:{x:Math.min.apply(null,x.map(function(I){return I.x})),y:Math.min.apply(null,x.map(function(I){return I.y}))},max:{x:Math.max.apply(null,S.map(function(I){return I.x})),y:Math.max.apply(null,S.map(function(I){return I.y}))}}}function zKe(e,t){return $J(e,void 0,ke(ke({},t),{bbox:!1,length:!0})).length}function HKe(e){var t=e.length,n=t-1;return e.map(function(r,i){return e.map(function(o,a){var s=i+a,l;return a===0||e[s]&&e[s][0]==="M"?(l=e[s],["M"].concat(l.slice(-2))):(s>=t&&(s-=n),e[s])})})}function WKe(e,t){var n=e.length-1,r=[],i=0,o=0,a=HKe(e);return a.forEach(function(s,l){e.slice(1).forEach(function(c,u){o+=xa(e[(l+u)%n].slice(-2),t[u%n].slice(-2))}),r[l]=o,o=0}),i=r.indexOf(Math.min.apply(null,r)),a[i]}function VKe(e,t,n,r,i,o,a,s){return 3*((s-t)*(n+i)-(a-e)*(r+o)+r*(e-i)-n*(t-o)+s*(i+e/3)-a*(o+t/3))/20}function UKe(e){var t=0,n=0,r=0;return SN(e).map(function(i){var o;switch(i[0]){case"M":return t=i[1],n=i[2],0;default:var a=i.slice(1),s=a[0],l=a[1],c=a[2],u=a[3],f=a[4],d=a[5];return r=VKe(t,n,s,l,c,u,f,d),o=i.slice(-2),t=o[0],n=o[1],r}}).reduce(function(i,o){return i+o},0)}function PJ(e){return UKe(e)>=0}function qKe(e,t,n){return $J(e,t,ke(ke({},n),{bbox:!1,length:!0})).point}function GKe(e,t){t===void 0&&(t=.5);var n=e.slice(0,2),r=e.slice(2,4),i=e.slice(4,6),o=e.slice(6,8),a=Cf(n,r,t),s=Cf(r,i,t),l=Cf(i,o,t),c=Cf(a,s,t),u=Cf(s,l,t),f=Cf(c,u,t);return[["C"].concat(a,c,f),["C"].concat(u,l,o)]}function MJ(e){return e.map(function(t,n,r){var i=n&&r[n-1].slice(-2).concat(t.slice(1)),o=n?_J(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,a;return n?a=o?GKe(i):[t,t]:a=[t],{s:t,ss:a,l:o}})}function TJ(e,t,n){var r=MJ(e),i=MJ(t),o=r.length,a=i.length,s=r.filter(function(g){return g.l}).length,l=i.filter(function(g){return g.l}).length,c=r.filter(function(g){return g.l}).reduce(function(g,m){var y=m.l;return g+y},0)/s||0,u=i.filter(function(g){return g.l}).reduce(function(g,m){var y=m.l;return g+y},0)/l||0,f=n||Math.max(o,a),d=[c,u],h=[f-o,f-a],p=0,v=[r,i].map(function(g,m){return g.l===f?g.map(function(y){return y.s}):g.map(function(y,x){return p=x&&h[m]&&y.l>=d[m],h[m]-=p?1:0,p?y.ss:[y.s]}).flat()});return v[0].length===v[1].length?v:TJ(v[0],v[1],f)}function IJ(e){var t=document.createElement("div");t.innerHTML=e;var n=t.childNodes[0];return n&&t.contains(n)&&t.removeChild(n),n}function Sr(e,t){if(e!==null)return{type:"column",value:e,field:t}}function _O(e,t){const n=Sr(e,t);return Object.assign(Object.assign({},n),{inferred:!0})}function $O(e,t){if(e!==null)return{type:"column",value:e,field:t,visual:!0}}function KKe(e,t){const n=Sr(e,t);return Object.assign(Object.assign({},n),{constant:!1})}function Of(e,t){const n=[];for(const r of e)n[r]=t;return n}function Dn(e,t){const n=e[t];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function T1(e,...t){for(const n of t)if(typeof n=="string"){const[r,i]=Dn(e,n);if(r!==null)return[r,i]}else return[n,null];return[null,null]}function I1(e){return e instanceof Date?!1:typeof e=="object"}const R1=()=>(e,t)=>{const{encode:n}=t,{y1:r}=n;return r!==void 0?[e,t]:[e,Ue({},t,{encode:{y1:_O(Of(e,0))}})]};R1.props={};function si(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function YKe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ef(e){let t,n,r;e.length!==2?(t=si,n=(s,l)=>si(e(s),l),r=(s,l)=>e(s)-l):(t=e===si||e===YKe?e:XKe,n=e,r=e);function i(s,l,c=0,u=s.length){if(c<u){if(t(l,l)!==0)return u;do{const f=c+u>>>1;n(s[f],l)<0?c=f+1:u=f}while(c<u)}return c}function o(s,l,c=0,u=s.length){if(c<u){if(t(l,l)!==0)return u;do{const f=c+u>>>1;n(s[f],l)<=0?c=f+1:u=f}while(c<u)}return c}function a(s,l,c=0,u=s.length){const f=i(s,l,c,u-1);return f>c&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function XKe(){return 0}function CN(e){return e===null?NaN:+e}function*ZKe(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const RJ=Ef(si),QKe=RJ.right,JKe=RJ.left,eYe=Ef(CN).center;function NJ(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function tYe(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let a of e)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of e)(s=t(s,++a,e))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function kJ(e,t){const n=tYe(e,t);return n&&Math.sqrt(n)}function Qc(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class hh{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=t+o,s=Math.abs(t)<Math.abs(o)?t-(a-o):o-(a-t);s&&(n[r++]=s),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}let nYe=class extends Map{constructor(t,n=oYe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(AJ(this,t))}has(t){return super.has(AJ(this,t))}set(t,n){return super.set(rYe(this,t),n)}delete(t){return super.delete(iYe(this,t))}};function AJ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function rYe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function iYe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function oYe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function N1(e){return e}function Rr(e,...t){return PO(e,N1,N1,t)}function ON(e,...t){return PO(e,Array.from,N1,t)}function EN(e,t,...n){return PO(e,N1,t,n)}function _N(e,t,...n){return PO(e,Array.from,t,n)}function PO(e,t,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new nYe,l=r[a++];let c=-1;for(const u of o){const f=l(u,++c,o),d=s.get(f);d?d.push(u):s.set(f,[u])}for(const[u,f]of s)s.set(u,i(f,a));return t(s)}(e,0)}function aYe(e,t){return Array.from(t,n=>e[n])}function ml(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){const r=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,o)=>{for(const a of t){const s=k1(a[i],a[o]);if(s)return s}})):(n=e.map(n),r.sort((i,o)=>k1(n[i],n[o]))),aYe(e,r)}return e.sort(LJ(n))}function LJ(e=si){if(e===si)return k1;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function k1(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function sYe(e,t,n){return(t.length!==2?ml(EN(e,t,n),([r,i],[o,a])=>si(i,a)||si(r,o)):ml(Rr(e,n),([r,i],[o,a])=>t(i,a)||si(r,o))).map(([r])=>r)}var lYe=Array.prototype,cYe=lYe.slice;function $N(e){return()=>e}const uYe=Math.sqrt(50),fYe=Math.sqrt(10),dYe=Math.sqrt(2);function MO(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=uYe?10:o>=fYe?5:o>=dYe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?MO(e,t,n*2):[s,l,c]}function hYe(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,a]=r?MO(t,e,n):MO(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c<s;++c)l[c]=(o-c)/-a;else for(let c=0;c<s;++c)l[c]=(o-c)*a;else if(a<0)for(let c=0;c<s;++c)l[c]=(i+c)/-a;else for(let c=0;c<s;++c)l[c]=(i+c)*a;return l}function PN(e,t,n){return t=+t,e=+e,n=+n,MO(e,t,n)[2]}function pYe(e,t,n){let r;for(;;){const i=PN(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function vYe(e){return Math.max(1,Math.ceil(Math.log(NJ(e))/Math.LN2)+1)}function gYe(){var e=N1,t=Qc,n=vYe;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,l,c=new Array(a);for(o=0;o<a;++o)c[o]=e(i[o],o,i);var u=t(c),f=u[0],d=u[1],h=n(c,f,d);if(!Array.isArray(h)){const x=d,S=+h;if(t===Qc&&([f,d]=pYe(f,d,S)),h=hYe(f,d,S),h[0]<=f&&(l=PN(f,d,S)),h[h.length-1]>=d)if(x>=d&&t===Qc){const w=PN(f,d,S);isFinite(w)&&(w>0?d=(Math.floor(d/w)+1)*w:w<0&&(d=(Math.ceil(d*-w)+1)/-w))}else h.pop()}for(var p=h.length,v=0,g=p;h[v]<=f;)++v;for(;h[g-1]>d;)--g;(v||g<p)&&(h=h.slice(v,g),p=g-v);var m=new Array(p+1),y;for(o=0;o<=p;++o)y=m[o]=[],y.x0=o>0?h[o-1]:f,y.x1=o<p?h[o]:d;if(isFinite(l)){if(l>0)for(o=0;o<a;++o)(s=c[o])!=null&&f<=s&&s<=d&&m[Math.min(p,Math.floor((s-f)/l))].push(i[o]);else if(l<0){for(o=0;o<a;++o)if((s=c[o])!=null&&f<=s&&s<=d){const x=Math.floor((f-s)*l);m[Math.min(p,x+(h[x]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=c[o])!=null&&f<=s&&s<=d&&m[QKe(h,s,0,p)].push(i[o]);return m}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:$N(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:$N([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:$N(Array.isArray(i)?cYe.call(i):i),r):n},r}function tr(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function bg(e,t){let n,r=-1,i=-1;if(t===void 0)for(const o of e)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Za(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function A1(e,t){let n,r=-1,i=-1;if(t===void 0)for(const o of e)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function MN(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?k1:LJ(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(t-c*f/l+d)),p=Math.min(r,Math.floor(t+(l-c)*f/l+d));MN(e,t,h,p,i)}const o=e[t];let a=n,s=r;for(L1(e,n,t),i(e[r],o)>0&&L1(e,n,r);a<s;){for(L1(e,a,s),++a,--s;i(e[a],o)<0;)++a;for(;i(e[s],o)>0;)--s}i(e[n],o)===0?L1(e,n,s):(++s,L1(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function L1(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function mYe(e,t=si){let n,r=!1;if(t.length===1){let i;for(const o of e){const a=t(o);(r?si(a,i)>0:si(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of e)(r?t(i,n)>0:t(i,i)===0)&&(n=i,r=!0);return n}function TO(e,t,n){if(e=Float64Array.from(ZKe(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Za(e);if(t>=1)return tr(e);var r,i=(r-1)*t,o=Math.floor(i),a=tr(MN(e,o).subarray(0,o+1)),s=Za(e.subarray(o+1));return a+(s-a)*(i-o)}}function yYe(e,t,n=CN){if(!isNaN(t=+t)){if(r=Float64Array.from(e,(s,l)=>CN(n(e[l],l,e))),t<=0)return A1(r);if(t>=1)return bg(r);var r,i=Uint32Array.from(e,(s,l)=>l),o=r.length-1,a=Math.floor(o*t);return MN(i,a,0,o,(s,l)=>k1(r[s],r[l])),a=mYe(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function bYe(e,t,n){const r=NJ(e),i=kJ(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function j1(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function TN(e,t){return TO(e,.5,t)}function xYe(e,t){return yYe(e,.5,t)}function*SYe(e){for(const t of e)yield*mj(t)}function jJ(e){return Array.from(SYe(e))}function xg(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Os(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}var wYe=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(e,t||[])).next())})};function ph(e){return e}function IN(e){return e.reduce((t,n)=>(r,...i)=>n(t(r,...i),...i),ph)}function CYe(e){return e.reduce((t,n)=>r=>wYe(this,void 0,void 0,function*(){const i=yield t(r);return n(i)}),ph)}function RN(e){return e.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function Sg(e=""){throw new Error(e)}function NN(e,t){const{attributes:n}=t,r=new Set(["id","className"]);for(const[i,o]of Object.entries(n))r.has(i)||e.attr(i,o)}function wr(e){return e!=null&&!Number.isNaN(e)}function OYe(e){const t=new Map;return n=>{if(t.has(n))return t.get(n);const r=e(n);return t.set(n,r),r}}function EYe(e,t){const{transform:n}=e.style,i=(o=>o==="none"||o===void 0)(n)?"":n;e.style.transform=`${i} ${t}`.trimStart()}function bt(e,t){return DJ(e,t)||{}}function DJ(e,t){const n=Object.entries(e||{}).filter(([r])=>r.startsWith(t)).map(([r,i])=>[GQ(r.replace(t,"").trim()),i]).filter(([r])=>!!r);return n.length===0?null:Object.fromEntries(n)}function _Ye(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>t.find(r=>n.startsWith(r))))}function kN(e,...t){return Object.fromEntries(Object.entries(e).filter(([n])=>t.every(r=>!n.startsWith(r))))}function FJ(e,t){if(e===void 0)return null;if(typeof e=="number")return e;const n=+e.replace("%","");return Number.isNaN(n)?null:n/100*t}function wg(e){return typeof e=="object"&&!(e instanceof Date)&&e!==null&&!Array.isArray(e)}function Jc(e){return e===null||e===!1}function BJ(e,t,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(t)){const o=t[i];!Yc(o)||!Yc(e[i])?e[i]=o:BJ(e[i],o,n,r+1)}return e}}function Vl(e,t){return Object.entries(e).reduce((n,[r,i])=>(n[r]=t(i,r,e),n),{})}function vh(e){return e.map((t,n)=>n)}function $Ye(e){return e[0]}function zJ(e){return e[e.length-1]}function PYe(e){return Array.from(new Set(e))}function HJ(e,t){const n=[[],[]];return e.forEach(r=>{n[t(r)?0:1].push(r)}),n}function WJ(e,t=e.length){if(t===1)return e.map(r=>[r]);const n=[];for(let r=0;r<e.length;r++){const i=e.slice(r+1);WJ(i,t-1).forEach(a=>{n.push([e[r],...a])})}return n}function MYe(e){if(e.length===1)return[e];const t=[];for(let n=1;n<=e.length;n++)t.push(...WJ(e,n));return t}function _f(e,t,n){const{encode:r}=n;if(e===null)return[t];const i=TYe(e).map(a=>{var s;return[a,(s=Dn(r,a))===null||s===void 0?void 0:s[0]]}).filter(([,a])=>wr(a)),o=a=>i.map(([,s])=>s[a]).join("-");return Array.from(Rr(t,o).values())}function VJ(e){return Array.isArray(e)?NYe(e):typeof e=="function"?RYe(e):e==="series"?IYe:e==="value"?kYe:e==="sum"?AYe:e==="maxIndex"?LYe:null}function UJ(e,t){for(const n of e)n.sort(t)}function qJ(e,t){return(t==null?void 0:t.domain)||Array.from(new Set(e))}function TYe(e){return Array.isArray(e)?e:[e]}function IYe(e,t,n){return D1(r=>n[r])}function RYe(e){return(t,n,r)=>D1(i=>e(t[i]))}function NYe(e){return(t,n,r)=>(i,o)=>e.reduce((a,s)=>a!==0?a:si(t[i][s],t[o][s]),0)}function kYe(e,t,n){return D1(r=>t[r])}function AYe(e,t,n){const r=vh(e),i=Array.from(Rr(r,a=>n[+a]).entries()),o=new Map(i.map(([a,s])=>[a,s.reduce((l,c)=>l+ +t[c])]));return D1(a=>o.get(n[a]))}function LYe(e,t,n){const r=vh(e),i=Array.from(Rr(r,a=>n[+a]).entries()),o=new Map(i.map(([a,s])=>[a,bg(s,l=>t[l])]));return D1(a=>o.get(n[a]))}function D1(e){return(t,n)=>si(e(t),e(n))}const GJ=(e={})=>{const{groupBy:t="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=e;return(s,l)=>{var c;const{data:u,encode:f,style:d={}}=l,[h,p]=Dn(f,"y"),[v,g]=Dn(f,"y1"),[m]=a?T1(f,"series","color"):Dn(f,"color"),y=_f(t,s,l),S=((c=VJ(n))!==null&&c!==void 0?c:()=>null)(u,h,m);S&&UJ(y,S);const w=new Array(s.length),C=new Array(s.length),O=new Array(s.length),E=[],_=[];for(const M of y){r&&M.reverse();const R=v?+v[M[0]]:0,N=[],k=[];for(const H of M){const z=O[H]=+h[H]-R;z<0?k.push(H):z>=0&&N.push(H)}const A=N.length>0?N:k,j=k.length>0?k:N;let D=N.length-1,L=0;for(;D>0&&h[A[D]]===0;)D--;for(;L<j.length-1&&h[j[L]]===0;)L++;E.push(A[D]),_.push(j[L]);let F=R;for(const H of k.reverse()){const z=O[H];F=w[H]=(C[H]=F)+z}let B=R;for(const H of N){const z=O[H];z>0?B=w[H]=(C[H]=B)+z:w[H]=C[H]=B}}const $=new Set(E),P=new Set(_),T=i==="y"?w:C,I=o==="y"?w:C;return[s,Ue({},l,{encode:{y0:_O(h,p),y:Sr(T,p),y1:Sr(I,g)},style:Object.assign({first:(M,R)=>$.has(R),last:(M,R)=>P.has(R)},d)})]}};GJ.props={};function F1(e){return Math.abs(e)>10?String(e):e.toString().padStart(2,"0")}function jYe(e){const t=e.getFullYear(),n=F1(e.getMonth()+1),r=F1(e.getDate()),i=`${t}-${n}-${r}`,o=e.getHours(),a=e.getMinutes(),s=e.getSeconds();return o||a||s?`${i} ${F1(o)}:${F1(a)}:${F1(s)}`:i}const IO=(e={})=>{const{channel:t="x"}=e;return(n,r)=>{const{encode:i}=r,{tooltip:o}=r;if(Jc(o))return[n,r];const{title:a}=o;if(a!==void 0)return[n,r];const s=Object.keys(i).filter(c=>c.startsWith(t)).filter(c=>!i[c].inferred).map(c=>Dn(i,c)).filter(([c])=>c).map(c=>c[0]);if(s.length===0)return[n,r];const l=[];for(const c of n)l[c]={value:s.map(u=>u[c]instanceof Date?jYe(u[c]):u[c]).join(", ")};return[n,Ue({},r,{tooltip:{title:l}})]}};IO.props={};const gh=()=>(e,t)=>{const{encode:n}=t,{x:r}=n;return r!==void 0?[e,t]:[e,Ue({},t,{encode:{x:_O(Of(e,0))},scale:{x:{guide:null}}})]};gh.props={};const RO=()=>(e,t)=>{const{encode:n}=t,{y:r}=n;return r!==void 0?[e,t]:[e,Ue({},t,{encode:{y:_O(Of(e,0))},scale:{y:{guide:null}}})]};RO.props={};const KJ=()=>(e,t)=>{const{encode:n}=t,{size:r}=n;return r!==void 0?[e,t]:[e,Ue({},t,{encode:{size:$O(Of(e,3))}})]};KJ.props={};var DYe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const YJ=()=>(e,t)=>{const{encode:n}=t,{key:r}=n,i=DYe(n,["key"]);if(r!==void 0)return[e,t];const o=Object.values(i).map(({value:s})=>s),a=e.map(s=>o.filter(Array.isArray).map(l=>l[s]).join("-"));return[e,Ue({},t,{encode:{key:Sr(a)}})]};YJ.props={};const AN=()=>(e,t)=>{const{encode:n}=t,{series:r,color:i}=n;if(r!==void 0||i===void 0)return[e,t];const[o,a]=Dn(n,"color");return[e,Ue({},t,{encode:{series:Sr(o,a)}})]};AN.props={};const XJ=()=>(e,t)=>{const{data:n}=t;return!Array.isArray(n)||n.some(I1)?[e,t]:[e,Ue({},t,{encode:{y:Sr(n)}})]};XJ.props={};const ZJ=()=>(e,t)=>{const{data:n}=t;return!Array.isArray(n)||n.some(I1)?[e,t]:[e,Ue({},t,{encode:{x:Sr(n)}})]};ZJ.props={};const QJ=()=>(e,t)=>{const{encode:n}=t,{y1:r}=n;if(r)return[e,t];const[i]=Dn(n,"y");return[e,Ue({},t,{encode:{y1:Sr([...i])}})]};QJ.props={};const JJ=()=>(e,t)=>{const{encode:n}=t,{x1:r}=n;if(r)return[e,t];const[i]=Dn(n,"x");return[e,Ue({},t,{encode:{x1:Sr([...i])}})]};JJ.props={};const eee=()=>(e,t)=>{const{data:n}=t;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(I1))){const r=(i,o)=>Array.isArray(i[0])?i.map(a=>a[o]):[i[o]];return[e,Ue({},t,{encode:{x:Sr(r(n,0)),x1:Sr(r(n,1))}})]}return[e,t]};eee.props={};const tee=()=>(e,t)=>{const{data:n}=t;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(I1))){const r=(i,o)=>Array.isArray(i[0])?i.map(a=>a[o]):[i[o]];return[e,Ue({},t,{encode:{y:Sr(r(n,0)),y1:Sr(r(n,1))}})]}return[e,t]};tee.props={};const NO=e=>{const{channel:t}=e;return(n,r)=>{const{encode:i,tooltip:o}=r;if(Jc(o))return[n,r];const{items:a=[]}=o;if(!a||a.length>0)return[n,r];const l=(Array.isArray(t)?t:[t]).flatMap(c=>Object.keys(i).filter(u=>u.startsWith(c)).map(u=>{const{field:f,value:d,inferred:h=!1,aggregate:p}=i[u];return h?null:p&&d?{channel:u}:f?{field:f}:d?{channel:u}:null}).filter(u=>u!==null));return[n,Ue({},r,{tooltip:{items:l}})]}};NO.props={};const LN=()=>(e,t)=>[e,Ue({scale:{x:{padding:0},y:{padding:0}}},t)];LN.props={};var nee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const kO=()=>(e,t)=>{const{data:n,style:r={}}=t,i=nee(t,["data","style"]),{x:o,y:a}=r,s=nee(r,["x","y"]);if(o==null||a==null)return[e,t];const l=o||0,c=a||0;return[[0],Ue({},i,{data:[0],cartesian:!0,encode:{x:Sr([l]),y:Sr([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};kO.props={};const ree=()=>(e,t)=>{const{style:n={}}=t;return[e,Ue({},t,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="function").map(([r,i])=>[r,()=>i])))})]};ree.props={};const AO=()=>(e,t)=>{const{data:n}=t;if(!Array.isArray(n)||n.some(I1))return[e,t];const r=Array.isArray(n[0])?n:[n],i=r.map(a=>a[0]),o=r.map(a=>a[1]);return[e,Ue({},t,{encode:{x:Sr(i),y:Sr(o)}})]};AO.props={};const iee=()=>(e,t)=>{const{style:n={},encode:r}=t,{series:i}=r,{gradient:o}=n;return!o||i?[e,t]:[e,Ue({},t,{encode:{series:$O(Of(e,void 0))}})]};iee.props={};var FYe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const oee=(e={})=>{const{groupBy:t="x",reverse:n=!1,orderBy:r,padding:i}=e;return FYe(e,["groupBy","reverse","orderBy","padding"]),(o,a)=>{const{data:s,encode:l,scale:c}=a,{series:u}=c,[f]=Dn(l,"y"),[d]=T1(l,"series","color"),h=qJ(d,u),p=Ue({},a,{scale:{series:{domain:h,paddingInner:i}}}),v=_f(t,o,a),g=VJ(r);if(!g)return[o,Ue(p,{encode:{series:Sr(d)}})];const m=g(s,f,d);m&&UJ(v,m);const y=new Array(o.length);for(const x of v){n&&x.reverse();for(let S=0;S<x.length;S++)y[x[S]]=h[S]}return[o,Ue(p,{encode:{series:Sr(r?y:d)}})]}};oee.props={};const aee=e=>{const{groupBy:t=["x"],reducer:n=(a,s)=>s[a[0]],orderBy:r=null,reverse:i=!1,duration:o}=e;return(a,s)=>{const{encode:l}=s,u=(Array.isArray(t)?t:[t]).map(g=>[g,Dn(l,g)[0]]);if(u.length===0)return[a,s];let f=[a];for(const[,g]of u){const m=[];for(const y of f){const x=Array.from(Rr(y,S=>g[S]).values());m.push(...x)}f=m}if(r){const[g]=Dn(l,r);g&&f.sort((m,y)=>n(m,g)-n(y,g)),i&&f.reverse()}const d=(o||3e3)/f.length,[h]=o?[Of(a,d)]:T1(l,"enterDuration",Of(a,d)),[p]=T1(l,"enterDelay",Of(a,0)),v=new Array(a.length);for(let g=0,m=0;g<f.length;g++){const y=f[g],x=tr(y,S=>+h[S]);for(const S of y)v[S]=+p[S]+m;m+=x}return[a,Ue({},s,{encode:{enterDuration:$O(h),enterDelay:$O(v)}})]}};aee.props={};var BYe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function zYe(e){return typeof e=="function"?e:{min:(n,r)=>Za(n,i=>r[+i]),max:(n,r)=>tr(n,i=>r[+i]),first:(n,r)=>r[n[0]],last:(n,r)=>r[n[n.length-1]],mean:(n,r)=>j1(n,i=>r[+i]),median:(n,r)=>TN(n,i=>r[+i]),sum:(n,r)=>Os(n,i=>r[+i]),deviation:(n,r)=>kJ(n,i=>r[+i])}[e]||tr}const see=(e={})=>{const{groupBy:t="x",basis:n="max"}=e;return(r,i)=>{const{encode:o,tooltip:a}=i,s=BYe(o,["x"]),l=Object.entries(s).filter(([p])=>p.startsWith("y")).map(([p])=>[p,Dn(o,p)[0]]),[,c]=l.find(([p])=>p==="y"),u=l.map(([p])=>[p,new Array(r.length)]),f=_f(t,r,i),d=zYe(n);for(const p of f){const v=d(p,c);for(const g of p)for(let m=0;m<l.length;m++){const[,y]=l[m],[,x]=u[m];x[g]=+y[g]/v}}const h=Jc(a)||(a==null?void 0:a.items)&&(a==null?void 0:a.items.length)!==0;return[r,Ue({},i,Object.assign({encode:Object.fromEntries(u.map(([p,v])=>[p,Sr(v,Dn(o,p)[1])]))},!h&&o.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};see.props={};function Cg(e,...t){return t.reduce((n,r)=>i=>n(r(i)),e)}function LO(e,t){return t-e?n=>(n-e)/(t-e):n=>.5}function HYe(e,t){const n=t<e?t:e,r=e>t?e:t;return i=>Math.min(Math.max(n,i),r)}function jN(e,t,n,r,i){let o=n||0,a=r||e.length;const s=i||(l=>l);for(;o<a;){const l=Math.floor((o+a)/2);s(e[l])>t?a=l:o=l+1}return o}const DN=Math.sqrt(50),FN=Math.sqrt(10),BN=Math.sqrt(2);function jO(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Ji(10,i);return i>=0?(o>=DN?10:o>=FN?5:o>=BN?2:1)*Ji(10,i):-Ji(10,-i)/(o>=DN?10:o>=FN?5:o>=BN?2:1)}function lee(e,t,n){const r=Math.abs(t-e)/Math.max(0,n);let i=Ji(10,Math.floor(Math.log(r)/Math.LN10));const o=r/i;return o>=DN?i*=10:o>=FN?i*=5:o>=BN&&(i*=2),t<e?-i:i}const cee=(e,t,n=5)=>{const r=[e,t];let i=0,o=r.length-1,a=r[i],s=r[o],l;return s<a&&([a,s]=[s,a],[i,o]=[o,i]),l=jO(a,s,n),l>0?(a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l,l=jO(a,s,n)):l<0&&(a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l,l=jO(a,s,n)),l>0?(r[i]=Math.floor(a/l)*l,r[o]=Math.ceil(s/l)*l):l<0&&(r[i]=Math.ceil(a*l)/l,r[o]=Math.floor(s*l)/l),r},B1=1e3,z1=B1*60,H1=z1*60,mh=H1*24,W1=mh*7,uee=mh*30,fee=mh*365;function Fo(e,t,n,r){const i=(c,u)=>{const f=h=>r(h)%u===0;let d=u;for(;d&&!f(c);)n(c,-1),d-=1;return c},o=(c,u)=>{u&&i(c,u),t(c)},a=(c,u)=>{const f=new Date(+c);return o(f,u),f},s=(c,u)=>{const f=new Date(+c-1);return o(f,u),n(f,u),o(f),f};return{ceil:s,floor:a,range:(c,u,f,d)=>{const h=[],p=Math.floor(f),v=d?s(c,f):s(c);for(let g=v;g<u;n(g,p),o(g))h.push(new Date(+g));return h},duration:e}}const WYe=Fo(1,e=>e,(e,t=1)=>{e.setTime(+e+t)},e=>e.getTime()),VYe=Fo(B1,e=>{e.setMilliseconds(0)},(e,t=1)=>{e.setTime(+e+B1*t)},e=>e.getSeconds()),UYe=Fo(z1,e=>{e.setSeconds(0,0)},(e,t=1)=>{e.setTime(+e+z1*t)},e=>e.getMinutes()),qYe=Fo(H1,e=>{e.setMinutes(0,0,0)},(e,t=1)=>{e.setTime(+e+H1*t)},e=>e.getHours()),GYe=Fo(mh,e=>{e.setHours(0,0,0,0)},(e,t=1)=>{e.setTime(+e+mh*t)},e=>e.getDate()-1),dee=Fo(uee,e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t=1)=>{const n=e.getMonth();e.setMonth(n+t)},e=>e.getMonth()),KYe=Fo(W1,e=>{e.setDate(e.getDate()-e.getDay()%7),e.setHours(0,0,0,0)},(e,t=1)=>{e.setDate(e.getDate()+7*t)},e=>{const t=dee.floor(e),n=new Date(+e);return Math.floor((+n-+t)/W1)}),YYe=Fo(fee,e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t=1)=>{const n=e.getFullYear();e.setFullYear(n+t)},e=>e.getFullYear()),hee={millisecond:WYe,second:VYe,minute:UYe,hour:qYe,day:GYe,week:KYe,month:dee,year:YYe},XYe=Fo(1,e=>e,(e,t=1)=>{e.setTime(+e+t)},e=>e.getTime()),ZYe=Fo(B1,e=>{e.setUTCMilliseconds(0)},(e,t=1)=>{e.setTime(+e+B1*t)},e=>e.getUTCSeconds()),QYe=Fo(z1,e=>{e.setUTCSeconds(0,0)},(e,t=1)=>{e.setTime(+e+z1*t)},e=>e.getUTCMinutes()),JYe=Fo(H1,e=>{e.setUTCMinutes(0,0,0)},(e,t=1)=>{e.setTime(+e+H1*t)},e=>e.getUTCHours()),eXe=Fo(mh,e=>{e.setUTCHours(0,0,0,0)},(e,t=1)=>{e.setTime(+e+mh*t)},e=>e.getUTCDate()-1),pee=Fo(uee,e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t=1)=>{const n=e.getUTCMonth();e.setUTCMonth(n+t)},e=>e.getUTCMonth()),tXe=Fo(W1,e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7)%7),e.setUTCHours(0,0,0,0)},(e,t=1)=>{e.setTime(+e+W1*t)},e=>{const t=pee.floor(e),n=new Date(+e);return Math.floor((+n-+t)/W1)}),nXe=Fo(fee,e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t=1)=>{const n=e.getUTCFullYear();e.setUTCFullYear(n+t)},e=>e.getUTCFullYear()),vee={millisecond:XYe,second:ZYe,minute:QYe,hour:JYe,day:eXe,week:tXe,month:pee,year:nXe};function rXe(e){const t=e?vee:hee,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:l,millisecond:c}=t;return{tickIntervals:[[l,1],[l,5],[l,15],[l,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:c}}function gee(e,t,n,r,i){const o=+e,a=+t,{tickIntervals:s,year:l,millisecond:c}=rXe(i),u=([g,m])=>g.duration*m,f=r?(a-o)/r:n||5,d=r||(a-o)/f,h=s.length,p=jN(s,d,0,h,u);let v;if(p===h){const g=lee(o/l.duration,a/l.duration,f);v=[l,g]}else if(p){const g=d/u(s[p-1])<u(s[p])/d,[m,y]=g?s[p-1]:s[p],x=r?Math.ceil(r/m.duration):y;v=[m,x]}else{const g=Math.max(lee(o,a,f),1);v=[c,g]}return v}const iXe=(e,t,n,r,i)=>{const o=e>t,a=o?t:e,s=o?e:t,[l,c]=gee(a,s,n,r,i),u=[l.floor(a,c),l.ceil(s,c)];return o?u.reverse():u};function DO(e){return!xr(e)&&!CGe(e)&&!Number.isNaN(e)}const mee=e=>t=>-e(-t),zN=(e,t)=>{const n=Math.log(e),r=e===Math.E?Math.log:e===10?Math.log10:e===2?Math.log2:i=>Math.log(i)/n;return t?mee(r):r},HN=(e,t)=>{const n=e===Math.E?Math.exp:r=>Ji(e,r);return t?mee(n):n},oXe=(e,t,n,r)=>{const i=e<0,o=zN(r,i),a=HN(r,i),s=e>t,l=s?t:e,c=s?e:t,u=[a(Math.floor(o(l))),a(Math.ceil(o(c)))];return s?u.reverse():u},aXe=e=>t=>{const n=e(t);return _r(n)?Math.round(n):n};function sXe(e,t){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[r]=this.chooseTransforms();this.composeOutput(r,this.chooseClamp(r))},n.prototype.initRange=function(){const{interpolator:r}=this.options;this.options.range=e(r)},n.prototype.composeOutput=function(r,i){const{domain:o,interpolator:a,round:s}=this.getOptions(),l=t(o.map(r)),c=s?aXe(a):a;this.output=Cg(c,l,i,r)},n.prototype.invert=void 0}}var yee={exports:{}},lXe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},bee={exports:{}},cXe=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},uXe=cXe,fXe=Array.prototype.concat,dXe=Array.prototype.slice,xee=bee.exports=function(t){for(var n=[],r=0,i=t.length;r<i;r++){var o=t[r];uXe(o)?n=fXe.call(n,dXe.call(o)):n.push(o)}return n};xee.wrap=function(e){return function(){return e(xee(arguments))}};var hXe=bee.exports,V1=lXe,U1=hXe,See=Object.hasOwnProperty,wee=Object.create(null);for(var WN in V1)See.call(V1,WN)&&(wee[V1[WN]]=WN);var Qa=yee.exports={to:{},get:{}};Qa.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case"hsl":n=Qa.get.hsl(e),r="hsl";break;case"hwb":n=Qa.get.hwb(e),r="hwb";break;default:n=Qa.get.rgb(e),r="rgb";break}return n?{model:r,value:n}:null},Qa.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,a=[0,0,0,1],s,l,c;if(s=e.match(n)){for(c=s[2],s=s[1],l=0;l<3;l++){var u=l*2;a[l]=parseInt(s.slice(u,u+2),16)}c&&(a[3]=parseInt(c,16)/255)}else if(s=e.match(t)){for(s=s[1],c=s[3],l=0;l<3;l++)a[l]=parseInt(s[l]+s[l],16);c&&(a[3]=parseInt(c+c,16)/255)}else if(s=e.match(r)){for(l=0;l<3;l++)a[l]=parseInt(s[l+1],0);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else if(s=e.match(i)){for(l=0;l<3;l++)a[l]=Math.round(parseFloat(s[l+1])*2.55);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else return(s=e.match(o))?s[1]==="transparent"?[0,0,0,0]:See.call(V1,s[1])?(a=V1[s[1]],a[3]=1,a):null:null;for(l=0;l<3;l++)a[l]=$f(a[l],0,255);return a[3]=$f(a[3],0,1),a},Qa.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=$f(parseFloat(n[2]),0,100),a=$f(parseFloat(n[3]),0,100),s=$f(isNaN(r)?1:r,0,1);return[i,o,a,s]}return null},Qa.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=$f(parseFloat(n[2]),0,100),a=$f(parseFloat(n[3]),0,100),s=$f(isNaN(r)?1:r,0,1);return[i,o,a,s]}return null},Qa.to.hex=function(){var e=U1(arguments);return"#"+FO(e[0])+FO(e[1])+FO(e[2])+(e[3]<1?FO(Math.round(e[3]*255)):"")},Qa.to.rgb=function(){var e=U1(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Qa.to.rgb.percent=function(){var e=U1(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"},Qa.to.hsl=function(){var e=U1(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Qa.to.hwb=function(){var e=U1(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},Qa.to.keyword=function(e){return wee[e.slice(0,3)]};function $f(e,t,n){return Math.min(Math.max(t,e),n)}function FO(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var pXe=yee.exports;const vXe=Rt(pXe);function VN(e,t,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function gXe(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100,i=e[3];if(n===0)return[r*255,r*255,r*255,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o,s=VN(a,o,t+1/3),l=VN(a,o,t),c=VN(a,o,t-1/3);return[s*255,l*255,c*255,i]}function Cee(e){const t=vXe.get(e);if(!t)return null;const{model:n,value:r}=t;return n==="rgb"?r:n==="hsl"?gXe(r):null}const Og=(e,t)=>n=>e*(1-n)+t*n,mXe=(e,t)=>{const n=Cee(e),r=Cee(t);return n===null||r===null?n?()=>e:()=>t:i=>{const o=new Array(4);for(let u=0;u<4;u+=1){const f=n[u],d=r[u];o[u]=f*(1-i)+d*i}const[a,s,l,c]=o;return`rgba(${Math.round(a)}, ${Math.round(s)}, ${Math.round(l)}, ${c})`}},q1=(e,t)=>typeof e=="number"&&typeof t=="number"?Og(e,t):typeof e=="string"&&typeof t=="string"?mXe(e,t):()=>e,yXe=(e,t)=>{const n=Og(e,t);return r=>Math.round(n(r))};function bXe(e,t){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:l}=t;return n.floor(e)<e?".SSS":r.floor(e)<e?":ss":i.floor(e)<e?"hh:mm":o.floor(e)<e?"hh A":s.floor(e)<e?a.floor(e)<e?"MMM DD":"ddd DD":l.floor(e)<e?"MMMM":"YYYY"}function Oee({map:e,initKey:t},n){const r=t(n);return e.has(r)?e.get(r):n}function xXe({map:e,initKey:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function SXe({map:e,initKey:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function wXe(e){return typeof e=="object"?e.valueOf():e}class Eee extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=wXe,t!==null)for(const[n,r]of t)this.set(n,r)}get(t){return super.get(Oee({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Oee({map:this.map,initKey:this.initKey},t))}set(t,n){return super.set(xXe({map:this.map,initKey:this.initKey},t),n)}delete(t){return super.delete(SXe({map:this.map,initKey:this.initKey},t))}}let G1=class{constructor(t){this.options=Ue({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=Ue({},this.options,t),this.rescale(t)}rescale(t){}};const BO=Symbol("defaultUnknown");function _ee(e,t,n){for(let r=0;r<t.length;r+=1)e.has(t[r])||e.set(n(t[r]),r)}function $ee(e){const{value:t,from:n,to:r,mapper:i,notFoundReturn:o}=e;let a=i.get(t);if(a===void 0){if(o!==BO)return o;a=n.push(t)-1,i.set(t,a)}return r[a%r.length]}function Pee(e){return e instanceof Date?t=>`${t}`:typeof e=="object"?t=>JSON.stringify(t):t=>t}let Mee=class qve extends G1{getDefaultOptions(){return{domain:[],range:[],unknown:BO}}constructor(t){super(t)}map(t){return this.domainIndexMap.size===0&&_ee(this.domainIndexMap,this.getDomain(),this.domainKey),$ee({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return this.rangeIndexMap.size===0&&_ee(this.rangeIndexMap,this.getRange(),this.rangeKey),$ee({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[n]=this.options.domain,[r]=this.options.range;if(this.domainKey=Pee(n),this.rangeKey=Pee(r),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!t||t.range)&&this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new qve(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:n}=this.options;return this.sortedDomain=n?[...t].sort(n):t,this.sortedDomain}};function CXe(e){const t=Math.min(...e);return e.map(n=>n/t)}function OXe(e,t){const n=e.length,r=t-n;return r>0?[...e,...new Array(r).fill(1)]:r<0?e.slice(0,t):e}function EXe(e){return Math.round(e*1e12)/1e12}function _Xe(e){const{domain:t,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=e,l=t.length,c=OXe(o,l),[u,f]=n,d=f-u,h=2/l*r+1-1/l*i,p=d/h,v=p*i/l,g=p-l*v,m=CXe(c),y=m.reduce((T,I)=>T+I),x=g/y,S=new Eee(t.map((T,I)=>{const M=m[I]*x;return[T,a?Math.floor(M):M]})),w=new Eee(t.map((T,I)=>{const R=m[I]*x+v;return[T,a?Math.floor(R):R]})),C=Array.from(w.values()).reduce((T,I)=>T+I),E=(d-(C-C/l*i))*s,_=u+E;let $=a?Math.round(_):_;const P=new Array(l);for(let T=0;T<l;T+=1){P[T]=EXe($);const I=t[T];$+=w.get(I)}return{valueBandWidth:S,valueStep:w,adjustedRange:P}}function $Xe(e){var t;const{domain:n}=e,r=n.length;if(r===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((t=e.flex)===null||t===void 0)&&t.length))return _Xe(e);const{range:o,paddingOuter:a,paddingInner:s,round:l,align:c}=e;let u,f,d=o[0];const p=o[1]-d,v=a*2,g=r-s;u=p/Math.max(1,v+g),l&&(u=Math.floor(u)),d+=(p-u*(r-s))*c,f=u*(1-s),l&&(d=Math.round(d),f=Math.round(f));const m=new Array(r).fill(0).map((y,x)=>d+x*u);return{valueStep:u,valueBandWidth:f,adjustedRange:m}}let Eg=class Gve extends Mee{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:BO,flex:[]}}constructor(t){super(t)}clone(){return new Gve(this.options)}getStep(t){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:t===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:t===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:n}=this.options;return t>0?t:n}getPaddingOuter(){const{padding:t,paddingOuter:n}=this.options;return t>0?t:n}rescale(){super.rescale();const{align:t,domain:n,range:r,round:i,flex:o}=this.options,{adjustedRange:a,valueBandWidth:s,valueStep:l}=$Xe({align:t,range:r,round:i,flex:o,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:n});this.valueStep=l,this.valueBandWidth=s,this.adjustedRange=a}};const yh=(e,t,n)=>{let r,i,o=e,a=t;if(o===a&&n>0)return[o];let s=jO(o,a,n);if(s===0||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)/s}return i};let UN=class Kve extends G1{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:yh}}map(t){const[n]=this.options.range;return n!==void 0?n:this.options.unknown}invert(t){const[n]=this.options.range;return t===n&&n!==void 0?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:n,tickCount:r}=this.options,[i,o]=n;return!_r(i)||!_r(o)?[]:t(i,o,r)}clone(){return new Kve(this.options)}};function K1(e){return Math.abs(e)<1e-14?e:parseFloat(e.toFixed(14))}const PXe=[1,5,2,2.5,4,3],Tee=Number.EPSILON*100;function MXe(e,t){return(e%t+t)%t}function TXe(e){return Math.round(e*1e12)/1e12}function IXe(e,t,n,r,i,o){const a=_1(t),s=QQ(t,e);let l=0;const c=MXe(r,o);return(c<Tee||o-c<Tee)&&r<=0&&i>=0&&(l=1),1-s/(a-1)-n+l}function RXe(e,t,n){const r=_1(t);return 1-QQ(t,e)/(r-1)-n+1}function NXe(e,t,n,r,i,o){const a=(e-1)/(o-i),s=(t-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function kXe(e,t){return e>=t?2-(e-1)/(t-1):1}function AXe(e,t,n,r){const i=t-e;return 1-.5*(Ji(t-r,2)+Ji(e-n,2))/Ji(.1*i,2)}function LXe(e,t,n){const r=t-e;if(n>r){const i=(n-r)/2;return 1-Ji(i,2)/Ji(.1*r,2)}return 1}function jXe(){return 1}const qN=(e,t,n=5,r=!0,i=PXe,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(e)||Number.isNaN(t)||typeof e!="number"||typeof t!="number"||!a)return[];if(t-e<1e-15||a===1)return[e];const s={score:-2,lmin:0,lmax:0,lstep:0};let l=1;for(;l<1/0;){for(let p=0;p<i.length;p+=1){const v=i[p],g=RXe(v,i,l);if(o[0]*g+o[1]+o[2]+o[3]<s.score){l=1/0;break}let m=2;for(;m<1/0;){const y=kXe(m,a);if(o[0]*g+o[1]+o[2]*y+o[3]<s.score)break;const x=(t-e)/(m+1)/l/v;let S=Math.ceil(Math.log10(x));for(;S<1/0;){const w=l*v*Ji(10,S),C=LXe(e,t,w*(m-1));if(o[0]*g+o[1]*C+o[2]*y+o[3]<s.score)break;const O=Math.floor(t/w)*l-(m-1)*l,E=Math.ceil(e/w)*l;if(O<=E){const _=E-O;for(let $=0;$<=_;$+=1){const T=(O+$)*(w/l),I=T+w*(m-1),M=w,R=IXe(v,i,l,T,I,M),N=AXe(e,t,T,I),k=NXe(m,a,e,t,T,I),A=jXe(),j=o[0]*R+o[1]*N+o[2]*k+o[3]*A;j>s.score&&(!r||T<=e&&I>=t)&&(s.lmin=T,s.lmax=I,s.lstep=M,s.score=j)}}S+=1}m+=1}}l+=1}const c=K1(s.lmax),u=K1(s.lmin),f=K1(s.lstep),d=Math.floor(TXe((c-u)/f))+1,h=new Array(d);h[0]=K1(u);for(let p=1;p<d;p+=1)h[p]=K1(h[p-1]+f);return h};let Iee=class Yve extends G1{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:qN}}map(t){return DO(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Yve(this.options)}getTicks(){const{domain:t,tickCount:n,tickMethod:r}=this.options,[i,o]=t;return!_r(i)||!_r(o)?[]:r(i,o,n)}};const DXe=(e,t,n)=>{const[r,i]=e,[o,a]=t;let s,l;return r<i?(s=LO(r,i),l=n(o,a)):(s=LO(i,r),l=n(a,o)),Cg(l,s)},FXe=(e,t,n)=>{const r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=e[0]>e[r],s=a?[...e].reverse():e,l=a?[...t].reverse():t;for(let c=0;c<r;c+=1)i[c]=LO(s[c],s[c+1]),o[c]=n(l[c],l[c+1]);return c=>{const u=jN(e,c,1,r)-1,f=i[u],d=o[u];return Cg(d,f)(c)}},Ree=(e,t,n,r)=>(Math.min(e.length,t.length)>2?FXe:DXe)(e,t,r?yXe:n);let zO=class extends G1{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Og,tickCount:5}}map(t){return DO(t)?this.output(t):this.options.unknown}invert(t){return DO(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,n,r,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,n,r,...i)}getTicks(){const{tickMethod:t}=this.options,[n,r,i,...o]=this.getTickMethodOptions();return t(n,r,i,...o)}getTickMethodOptions(){const{domain:t,tickCount:n}=this.options,r=t[0],i=t[t.length-1];return[r,i,n]}chooseNice(){return cee}rescale(){this.nice();const[t,n]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,n,this.chooseClamp(n))}chooseClamp(t){const{clamp:n,range:r}=this.options,i=this.options.domain.map(t),o=Math.min(i.length,r.length);return n?HYe(i[0],i[o-1]):uh}composeOutput(t,n){const{domain:r,range:i,round:o,interpolate:a}=this.options,s=Ree(r.map(t),i,a,o);this.output=Cg(s,n,t)}composeInput(t,n,r){const{domain:i,range:o}=this.options,a=Ree(o,i.map(t),Og);this.input=Cg(n,r,a)}},$r=class Xve extends zO{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:q1,tickMethod:yh,tickCount:5}}chooseTransforms(){return[uh,uh]}clone(){return new Xve(this.options)}},Nee=class Zve extends Eg{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:BO,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new Zve(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}};const BXe=e=>t=>t<0?-Ji(-t,e):Ji(t,e),zXe=e=>t=>t<0?-Ji(-t,1/e):Ji(t,1/e),HXe=e=>e<0?-Math.sqrt(-e):Math.sqrt(e);let kee=class Qve extends zO{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:q1,tickMethod:yh,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(t===1)return[uh,uh];const n=t===.5?HXe:BXe(t),r=zXe(t);return[n,r]}clone(){return new Qve(this.options)}},WXe=class Jve extends kee{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:q1,tickMethod:yh,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new Jve(this.options)}},HO=class ege extends G1{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!DO(t))return this.options.unknown;const n=jN(this.thresholds,t,0,this.n);return this.options.range[n]}invert(t){const{range:n}=this.options,r=n.indexOf(t),i=this.thresholds;return[i[r-1],i[r]]}clone(){return new ege(this.options)}rescale(){const{domain:t,range:n}=this.options;this.n=Math.min(t.length,n.length-1),this.thresholds=t}};const VXe=(e,t,n,r=10)=>{const i=e<0,o=HN(r,i),a=zN(r,i),s=t<e,l=s?t:e,c=s?e:t;let u=a(l),f=a(c),d=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const h=o(u);for(let p=r-1;p>=1;p-=1){const v=h*p;if(v>c)break;v>=l&&d.push(v)}}else for(;u<=f;u+=1){const h=o(u);for(let p=1;p<r;p+=1){const v=h*p;if(v>c)break;v>=l&&d.push(v)}}d.length*2<n&&(d=yh(l,c,n))}else{const h=n===-1?f-u:Math.min(f-u,n);d=yh(u,f,h).map(o)}return s?d.reverse():d};let UXe=class tge extends zO{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:q1,tickMethod:VXe,tickCount:5}}chooseNice(){return oXe}getTickMethodOptions(){const{domain:t,tickCount:n,base:r}=this.options,i=t[0],o=t[t.length-1];return[i,o,n,r]}chooseTransforms(){const{base:t,domain:n}=this.options,r=n[0]<0;return[zN(t,r),HN(t,r)]}clone(){return new tge(this.options)}},Aee=class nge extends HO{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:qN}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[n,r,i]=this.getTickMethodOptions();this.options.domain=cee(n,r,i)}}getTicks(){const{tickMethod:t}=this.options,[n,r,i]=this.getTickMethodOptions();return t(n,r,i)}getTickMethodOptions(){const{domain:t,tickCount:n}=this.options,r=t[0],i=t[t.length-1];return[r,i,n]}rescale(){this.nice();const{range:t,domain:n}=this.options,[r,i]=n;this.n=t.length-1,this.thresholds=new Array(this.n);for(let o=0;o<this.n;o+=1)this.thresholds[o]=((o+1)*i-(o-this.n)*r)/(this.n+1)}invert(t){const[n,r]=super.invert(t),[i,o]=this.options.domain;return n===void 0&&r===void 0?[n,r]:[n||i,r||o]}getThresholds(){return this.thresholds}clone(){return new nge(this.options)}};function qXe(e,t){const n=e.length;if(!n)return;if(n<2)return e[n-1];const r=(n-1)*t,i=Math.floor(r),o=e[i],a=e[i+1];return o+(a-o)*(r-i)}function GXe(e,t,n=!1){const r=e;n||r.sort((o,a)=>o-a);const i=[];for(let o=1;o<t;o+=1)i.push(qXe(r,o/t));return i}let Lee=class rge extends HO{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:qN}}constructor(t){super(t)}rescale(){const{domain:t,range:n}=this.options;this.n=n.length-1,this.thresholds=GXe(t,this.n+1,!1)}invert(t){const[n,r]=super.invert(t),{domain:i}=this.options,o=i[0],a=i[i.length-1];return n===void 0&&r===void 0?[n,r]:[n||o,r||a]}getThresholds(){return this.thresholds}clone(){return new rge(this.options)}getTicks(){const{tickCount:t,domain:n,tickMethod:r}=this.options,i=n.length-1,o=n[0],a=n[i];return r(o,a,t)}};var KXe=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,YXe=/\[([^]*?)\]/gm;function jee(e,t){for(var n=[],r=0,i=e.length;r<i;r++)n.push(e[r].substr(0,t));return n}function GN(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o=i[r];for(var a in o)e[a]=o[a]}return e}var Dee=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Fee=["January","February","March","April","May","June","July","August","September","October","November","December"],XXe=jee(Fee,3),ZXe=jee(Dee,3),QXe={dayNamesShort:ZXe,dayNames:Dee,monthNamesShort:XXe,monthNames:Fee,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},JXe=GN({},QXe),Sa=function(e,t){for(t===void 0&&(t=2),e=String(e);e.length<t;)e="0"+e;return e},eZe={D:function(e){return String(e.getDate())},DD:function(e){return Sa(e.getDate())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return Sa(e.getDay())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return Sa(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},YY:function(e){return Sa(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return Sa(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return Sa(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return Sa(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return Sa(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return Sa(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return Sa(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return Sa(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+Sa(Math.floor(Math.abs(t)/60)*100+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+Sa(Math.floor(Math.abs(t)/60),2)+":"+Sa(Math.abs(t)%60,2)}},Bee={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},tZe=function(e,t,n){if(t===void 0&&(t=Bee.default),n===void 0&&(n={}),typeof e=="number"&&(e=new Date(e)),Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");t=Bee[t]||t;var r=[];t=t.replace(YXe,function(o,a){return r.push(a),"@@@"});var i=GN(GN({},JXe),n);return t=t.replace(KXe,function(o){return eZe[o](e,i)}),t.replace(/@@@/g,function(){return r.shift()})};const nZe=(e,t,n,r,i)=>{const o=e>t,a=o?t:e,s=o?e:t,[l,c]=gee(a,s,n,r,i),u=l.range(a,new Date(+s+1),c,!0);return o?u.reverse():u};function rZe(e){const t=e.getTimezoneOffset(),n=new Date(e);return n.setMinutes(n.getMinutes()+t,n.getSeconds(),n.getMilliseconds()),n}let iZe=class ige extends zO{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:nZe,interpolate:Og,mask:void 0,utc:!1}}chooseTransforms(){return[r=>+r,r=>new Date(r)]}chooseNice(){return iXe}getTickMethodOptions(){const{domain:t,tickCount:n,tickInterval:r,utc:i}=this.options,o=t[0],a=t[t.length-1];return[o,a,n,r,i]}getFormatter(){const{mask:t,utc:n}=this.options,r=n?vee:hee,i=n?rZe:uh;return o=>tZe(i(o),t||bXe(o,r))}clone(){return new ige(this.options)}};var oZe=function(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},KN;function aZe(e){return[e(0),e(1)]}const sZe=e=>{const[t,n]=e;return Cg(Og(0,1),LO(t,n))};let YN=KN=class extends $r{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:uh,tickMethod:yh,tickCount:5}}constructor(t){super(t)}clone(){return new KN(this.options)}};YN=KN=oZe([sXe(aZe,sZe)],YN);function WO(e,t,n){if(e===null)return[-.5,.5];const r=qJ(e,t),o=new Eg({domain:r,range:[0,1],padding:n}).getBandWidth();return[-o/2,o/2]}function VO(e,t,n){return t*(1-e)+n*e}const zee=(e={})=>{const{padding:t=0,paddingX:n=t,paddingY:r=t,random:i=Math.random}=e;return(o,a)=>{const{encode:s,scale:l}=a,{x:c,y:u}=l,[f]=Dn(s,"x"),[d]=Dn(s,"y"),h=WO(f,c,n),p=WO(d,u,r),v=o.map(()=>VO(i(),...p)),g=o.map(()=>VO(i(),...h));return[o,Ue({scale:{x:{padding:.5},y:{padding:.5}}},a,{encode:{dy:Sr(v),dx:Sr(g)}})]}};zee.props={};const Hee=(e={})=>{const{padding:t=0,random:n=Math.random}=e;return(r,i)=>{const{encode:o,scale:a}=i,{x:s}=a,[l]=Dn(o,"x"),c=WO(l,s,t),u=r.map(()=>VO(n(),...c));return[r,Ue({scale:{x:{padding:.5}}},i,{encode:{dx:Sr(u)}})]}};Hee.props={};const Wee=(e={})=>{const{padding:t=0,random:n=Math.random}=e;return(r,i)=>{const{encode:o,scale:a}=i,{y:s}=a,[l]=Dn(o,"y"),c=WO(l,s,t),u=r.map(()=>VO(n(),...c));return[r,Ue({scale:{y:{padding:.5}}},i,{encode:{dy:Sr(u)}})]}};Wee.props={};var lZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Vee=(e={})=>{const{groupBy:t="x"}=e;return(n,r)=>{const{encode:i}=r,o=lZe(i,["x"]),a=Object.entries(o).filter(([f])=>f.startsWith("y")).map(([f])=>[f,Dn(i,f)[0]]),s=a.map(([f])=>[f,new Array(n.length)]),l=_f(t,n,r),c=new Array(l.length);for(let f=0;f<l.length;f++){const h=l[f].flatMap(g=>a.map(([,m])=>+m[g])),[p,v]=Qc(h);c[f]=(p+v)/2}const u=Math.max(...c);for(let f=0;f<l.length;f++){const d=u-c[f],h=l[f];for(const p of h)for(let v=0;v<a.length;v++){const[,g]=a[v],[,m]=s[v];m[p]=+g[p]+d}}return[n,Ue({},r,{encode:Object.fromEntries(s.map(([f,d])=>[f,Sr(d,Dn(i,f)[1])]))})]}};Vee.props={};const Uee=(e={})=>{const{groupBy:t="x",series:n=!0}=e;return(r,i)=>{const{encode:o}=i,[a]=Dn(o,"y"),[s,l]=Dn(o,"y1");n?T1(o,"series","color"):Dn(o,"color");const c=_f(t,r,i),u=new Array(r.length);for(const f of c){const d=f.map(h=>+a[h]);for(let h=0;h<f.length;h++){const p=f[h],v=Math.max(...d.filter((g,m)=>m!==h));u[p]=+a[p]>v?v:a[p]}}return[r,Ue({},i,{encode:{y1:Sr(u,l)}})]}};Uee.props={};function qee(e,t){return[e[0]]}function cZe(e,t){const n=e.length-1;return[e[n]]}function uZe(e,t){const n=bg(e,r=>t[r]);return[e[n]]}function fZe(e,t){const n=A1(e,r=>t[r]);return[e[n]]}function dZe(e){return typeof e=="function"?e:{first:qee,last:cZe,max:uZe,min:fZe}[e]||qee}const UO=(e={})=>{const{groupBy:t="series",channel:n,selector:r}=e;return(i,o)=>{const{encode:a}=o,s=_f(t,i,o),[l]=Dn(a,n),c=dZe(r);return[s.flatMap(u=>c(u,l)),o]}};UO.props={};var hZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Gee=(e={})=>{const{selector:t}=e,n=hZe(e,["selector"]);return UO(Object.assign({channel:"x",selector:t},n))};Gee.props={};var pZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Kee=(e={})=>{const{selector:t}=e,n=pZe(e,["selector"]);return UO(Object.assign({channel:"y",selector:t},n))};Kee.props={};var vZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function Pf(e){return t=>t===null?e:`${e} of ${t}`}function gZe(e){if(typeof e=="function")return[e,null];const n={mean:mZe,max:bZe,count:SZe,first:CZe,last:OZe,sum:wZe,min:xZe,median:yZe}[e];if(!n)throw new Error(`Unknown reducer: ${e}.`);return n()}function mZe(){const e=(n,r)=>j1(n,i=>+r[i]),t=Pf("mean");return[e,t]}function yZe(){const e=(n,r)=>TN(n,i=>+r[i]),t=Pf("median");return[e,t]}function bZe(){const e=(n,r)=>tr(n,i=>+r[i]),t=Pf("max");return[e,t]}function xZe(){const e=(n,r)=>Za(n,i=>+r[i]),t=Pf("min");return[e,t]}function SZe(){const e=(n,r)=>n.length,t=Pf("count");return[e,t]}function wZe(){const e=(n,r)=>Os(n,i=>+r[i]),t=Pf("sum");return[e,t]}function CZe(){const e=(n,r)=>r[n[0]],t=Pf("first");return[e,t]}function OZe(){const e=(n,r)=>r[n[n.length-1]],t=Pf("last");return[e,t]}const XN=(e={})=>{const{groupBy:t}=e,n=vZe(e,["groupBy"]);return(r,i)=>{const{data:o,encode:a}=i,s=t(r,i);if(!s)return[r,i];const l=(h,p)=>{if(h)return h;const{from:v}=p;if(!v)return h;const[,g]=Dn(a,v);return g},c=Object.entries(n).map(([h,p])=>{const[v,g]=gZe(p),[m,y]=Dn(a,h),x=l(y,p),S=s.map(w=>v(w,m!=null?m:o));return[h,Object.assign(Object.assign({},KKe(S,(g==null?void 0:g(x))||x)),{aggregate:!0})]}),u=Object.keys(a).map(h=>{const[p,v]=Dn(a,h),g=s.map(m=>p[m[0]]);return[h,Sr(g,v)]}),f=s.map(h=>o[h[0]]);return[vh(s),Ue({},i,{data:f,encode:Object.fromEntries([...u,...c])})]}};XN.props={};var EZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Y1=(e={})=>{const{channels:t=["x","y"]}=e,n=EZe(e,["channels"]),r=(i,o)=>_f(t,i,o);return XN(Object.assign(Object.assign({},n),{groupBy:r}))};Y1.props={};const Yee=(e={})=>Y1(Object.assign(Object.assign({},e),{channels:["x","color","series"]}));Yee.props={};const Xee=(e={})=>Y1(Object.assign(Object.assign({},e),{channels:["y","color","series"]}));Xee.props={};const Zee=(e={})=>Y1(Object.assign(Object.assign({},e),{channels:["color"]}));Zee.props={};var Qee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function _Ze(e,t,n){const{by:r=e,reducer:i="max"}=t,[o]=Dn(n,r);if(typeof i=="function")return a=>i(a,o);if(i==="max")return a=>tr(a,s=>+o[s]);if(i==="min")return a=>Za(a,s=>+o[s]);if(i==="sum")return a=>Os(a,s=>+o[s]);if(i==="median")return a=>TN(a,s=>+o[s]);if(i==="mean")return a=>j1(a,s=>+o[s]);if(i==="first")return a=>o[a[0]];if(i==="last")return a=>o[a[a.length-1]];throw new Error(`Unknown reducer: ${i}`)}function $Ze(e,t,n){const{reverse:r,channel:i}=n,{encode:o}=t,[a]=Dn(o,i),s=ml(e,l=>a[l]);return r&&s.reverse(),[s,t]}function PZe(e,t,n){if(!Array.isArray(n))return e;const r=new Set(n);return e.filter(i=>r.has(t[i]))}function MZe(e,t,n){var r;const{reverse:i,slice:o,channel:a}=n,s=Qee(n,["reverse","slice","channel"]),{encode:l,scale:c={}}=t,u=(r=c[a])===null||r===void 0?void 0:r.domain,[f]=Dn(l,a),d=_Ze(a,s,l),h=PZe(e,f,u),p=sYe(h,d,m=>f[m]);i&&p.reverse();const v=typeof o=="number"?[0,o]:o,g=o?p.slice(...v):p;return[e,Ue(t,{scale:{[a]:{domain:g}}})]}const qO=(e={})=>{const{reverse:t=!1,slice:n,channel:r,ordinal:i=!0}=e,o=Qee(e,["reverse","slice","channel","ordinal"]);return(a,s)=>i?MZe(a,s,Object.assign({reverse:t,slice:n,channel:r},o)):$Ze(a,s,Object.assign({reverse:t,slice:n,channel:r},o))};qO.props={};const Jee=(e={})=>qO(Object.assign(Object.assign({},e),{channel:"x"}));Jee.props={};const ete=(e={})=>qO(Object.assign(Object.assign({},e),{channel:"color"}));ete.props={};const tte=(e={})=>qO(Object.assign(Object.assign({},e),{channel:"y"}));tte.props={};function TZe(e,t){return typeof t=="string"?e.map(n=>n[t]):e.map(t)}function IZe(e,t){if(typeof e=="function")return n=>e(n,t);if(e==="sum")return n=>Os(n,r=>+t[r]);throw new Error(`Unknown reducer: ${e}`)}const nte=(e={})=>{const{field:t,channel:n="y",reducer:r="sum"}=e;return(i,o)=>{const{data:a,encode:s}=o,[l]=Dn(s,"x"),c=t?TZe(a,t):Dn(s,n)[0],u=IZe(r,c),f=_N(i,u,d=>l[d]).map(d=>d[1]);return[i,Ue({},o,{scale:{x:{flex:f}}})]}};nte.props={};function li([e,t],[n,r]){return[e-n,t-r]}function GO([e,t],[n,r]){return[e+n,t+r]}function Zr([e,t],[n,r]){return Math.sqrt(Math.pow(e-n,2)+Math.pow(t-r,2))}function Es([e,t]){return Math.atan2(t,e)}function _g([e,t]){return Es([e,t])+Math.PI/2}function rte(e,t){const n=Es(e),r=Es(t);return n<r?r-n:Math.PI*2-(n-r)}function ZN(e){let t=1/0,n=-1/0,r=1/0,i=-1/0;for(const[s,l]of e)t=Math.min(s,t),n=Math.max(s,n),r=Math.min(l,r),i=Math.max(l,i);const o=n-t,a=i-r;return[t,r,o,a]}function ite([e,t],[n,r]){return[(e+n)/2,(t+r)/2]}function RZe(e){const{padding:t=0,direction:n="col"}=e;return(r,i,o)=>{const a=r.length;if(a===0)return[];const{innerWidth:s,innerHeight:l}=o,c=l/s;let u=Math.ceil(Math.sqrt(i/c)),f=s/u,d=Math.ceil(i/u),h=d*f;for(;h>l;)u=u+1,f=s/u,d=Math.ceil(i/u),h=d*f;const p=l-d*f,v=d<=1?0:p/(d-1),[g,m]=d<=1?[(s-a*f)/(a-1),(l-f)/2]:[0,0];return r.map((y,x)=>{const[S,w,C,O]=ZN(y),E=n==="col"?x%u:Math.floor(x/d),_=n==="col"?Math.floor(x/u):x%d,$=E*f,P=(d-_-1)*f+p,T=(f-t)/C,I=(f-t)/O,M=$-S+g*E+1/2*t,R=P-w-v*_-m+1/2*t;return`translate(${M}, ${R}) scale(${T}, ${I})`})}}const ote=e=>(t,n)=>[t,Ue({},n,{modifier:RZe(e),axis:!1})];ote.props={};var NZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const ate="thresholds";function kZe(e){const[t,n]=Qc(e);return Math.min(200,bYe(e,t,n))}const QN=(e={})=>{const{groupChannels:t=["color"],binChannels:n=["x","y"]}=e,r=NZe(e,["groupChannels","binChannels"]),i={},o=(a,s)=>{const{encode:l}=s,c=n.map(p=>{const[v]=Dn(l,p);return v}),u=bt(r,ate),f=a.filter(p=>c.every(v=>wr(v[p]))),d=[...t.map(p=>{const[v]=Dn(l,p);return v}).filter(wr).map(p=>v=>p[v]),...n.map((p,v)=>{const g=c[v],m=u[p]||kZe(g),y=gYe().thresholds(m).value(S=>+g[S])(f),x=new Map(y.flatMap(S=>{const{x0:w,x1:C}=S,O=`${w},${C}`;return S.map(E=>[E,O])}));return i[p]=x,S=>x.get(S)})],h=p=>d.map(v=>v(p)).join("-");return Array.from(Rr(f,h).values())};return XN(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter(([a])=>!a.startsWith(ate)))),Object.fromEntries(n.flatMap(a=>{const s=([c])=>+i[a].get(c).split(",")[0],l=([c])=>+i[a].get(c).split(",")[1];return l.from=a,[[a,s],[`${a}1`,l]]}))),{groupBy:o}))};QN.props={};const ste=(e={})=>{const{thresholds:t}=e;return QN(Object.assign(Object.assign({},e),{thresholdsX:t,groupChannels:["color"],binChannels:["x"]}))};ste.props={};function AZe(e,t,n,r){const i=e.length;if(r>=i||r===0)return e;const o=h=>t[e[h]]*1,a=h=>n[e[h]]*1,s=[],l=(i-2)/(r-2);let c=0,u,f,d;s.push(c);for(let h=0;h<r-2;h++){let p=0,v=0,g=Math.floor((h+1)*l)+1,m=Math.floor((h+2)*l)+1;m=Math.min(m,i);const y=m-g;for(;g<m;g++)p+=o(g),v+=a(g);p/=y,v/=y;let x=Math.floor((h+0)*l)+1;const S=Math.floor((h+1)*l)+1,w=[o(c),a(c)];for(u=f=-1;x<S;x++)f=Math.abs((w[0]-p)*(o(x)-w[1])-(w[0]-a(x))*(v-w[0]))*.5,f>u&&(u=f,d=x);s.push(d),c=d}return s.push(i-1),s.map(h=>e[h])}function LZe(e){if(typeof e=="function")return e;if(e==="lttb")return AZe;const t={first:r=>[r[0]],last:r=>[r[r.length-1]],min:(r,i,o)=>[r[A1(r,a=>o[a])]],max:(r,i,o)=>[r[bg(r,a=>o[a])]],median:(r,i,o)=>[r[xYe(r,a=>o[a])]]},n=t[e]||t.median;return(r,i,o,a)=>{const s=Math.max(1,Math.floor(r.length/a));return jZe(r,s).flatMap(c=>n(c,i,o))}}function jZe(e,t){const n=e.length,r=[];let i=0;for(;i<n;)r.push(e.slice(i,i+=t));return r}const lte=(e={})=>{const{strategy:t="median",thresholds:n=2e3,groupBy:r=["series","color"]}=e,i=LZe(t);return(o,a)=>{const{encode:s}=a,l=_f(r,o,a),[c]=Dn(s,"x"),[u]=Dn(s,"y");return[l.flatMap(f=>i(f,c,u,n)),a]}};lte.props={};function DZe(e){return typeof e=="object"?[e.value,e.ordinal]:[e,!0]}function FZe(e){var t;const{encode:n}=e,r=Object.assign(Object.assign({},e),{encode:Object.assign(Object.assign({},e.encode),{y:Object.assign(Object.assign({},e.encode.y),{value:[]})})}),i=(t=n==null?void 0:n.color)===null||t===void 0?void 0:t.field;if(!n||!i)return r;let o;for(const[a,s]of Object.entries(n))(a==="x"||a==="y")&&s.field===i&&(o=Object.assign(Object.assign({},o),{[a]:Object.assign(Object.assign({},s),{value:[]})}));return o?Object.assign(Object.assign({},e),{encode:Object.assign(Object.assign({},e.encode),o)}):r}const cte=(e={})=>(t,n)=>{const{encode:r,data:i}=n,o=Object.entries(e).map(([u,f])=>{const[d]=Dn(r,u);if(!d)return null;const[h,p=!0]=DZe(f);if(typeof h=="function")return v=>h(d[v]);if(p){const v=Array.isArray(h)?h:[h];return v.length===0?null:g=>v.includes(d[g])}else{const[v,g]=h;return m=>d[m]>=v&&d[m]<=g}}).filter(wr),a=u=>o.every(f=>f(u)),s=t.filter(a),l=s.map((u,f)=>f);if(o.length===0){const u=FZe(n);return[t,u]}const c=Object.entries(r).map(([u,f])=>[u,Object.assign(Object.assign({},f),{value:l.map(d=>f.value[s[d]]).filter(d=>d!==void 0)})]);return[l,Ue({},n,{encode:Object.fromEntries(c),data:s.map(u=>i[u])})]};cte.props={};function Nr(e){return function(){return e}}const ute=Math.abs,Bo=Math.atan2,bh=Math.cos,BZe=Math.max,JN=Math.min,Ul=Math.sin,$g=Math.sqrt,zo=1e-12,X1=Math.PI,KO=X1/2,zZe=2*X1;function HZe(e){return e>1?0:e<-1?X1:Math.acos(e)}function fte(e){return e>=1?KO:e<=-1?-KO:Math.asin(e)}const ek=Math.PI,tk=2*ek,xh=1e-6,WZe=tk-xh;function dte(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function VZe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return dte;const n=Ji(10,t);return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let nk=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?dte:VZe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-t,c=i-n,u=a-t,f=s-n,d=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>xh)if(!(Math.abs(f*l-c*u)>xh)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-a,p=i-s,v=l*l+c*c,g=h*h+p*p,m=Math.sqrt(v),y=Math.sqrt(d),x=o*Math.tan((ek-Math.acos((v+d-g)/(2*m*y)))/2),S=x/y,w=x/m;Math.abs(S-1)>xh&&this._append`L${t+S*u},${n+S*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=t+w*l},${this._y1=n+w*c}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=t+s,u=n+l,f=1^a,d=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>xh||Math.abs(this._y1-u)>xh)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%tk+tk),d>WZe?this._append`A${r},${r},0,1,${f},${t-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>xh&&this._append`A${r},${r},0,${+(d>=ek)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function _s(){return new nk}_s.prototype=nk.prototype;function rk(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new nk(t)}function UZe(e){return e.innerRadius}function qZe(e){return e.outerRadius}function GZe(e){return e.startAngle}function KZe(e){return e.endAngle}function YZe(e){return e&&e.padAngle}function XZe(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,f=s-o,d=f*l-u*c;if(!(d*d<zo))return d=(u*(t-o)-f*(e-i))/d,[e+d*l,t+d*c]}function YO(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/$g(s*s+l*l),u=c*l,f=-c*s,d=e+u,h=t+f,p=n+u,v=r+f,g=(d+p)/2,m=(h+v)/2,y=p-d,x=v-h,S=y*y+x*x,w=i-o,C=d*v-p*h,O=(x<0?-1:1)*$g(BZe(0,w*w*S-C*C)),E=(C*x-y*O)/S,_=(-C*y-x*O)/S,$=(C*x+y*O)/S,P=(-C*y+x*O)/S,T=E-g,I=_-m,M=$-g,R=P-m;return T*T+I*I>M*M+R*R&&(E=$,_=P),{cx:E,cy:_,x01:-u,y01:-f,x11:E*(i/w-1),y11:_*(i/w-1)}}function XO(){var e=UZe,t=qZe,n=Nr(0),r=null,i=GZe,o=KZe,a=YZe,s=null,l=rk(c);function c(){var u,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-KO,v=o.apply(this,arguments)-KO,g=ute(v-p),m=v>p;if(s||(s=u=l()),h<d&&(f=h,h=d,d=f),!(h>zo))s.moveTo(0,0);else if(g>zZe-zo)s.moveTo(h*bh(p),h*Ul(p)),s.arc(0,0,h,p,v,!m),d>zo&&(s.moveTo(d*bh(v),d*Ul(v)),s.arc(0,0,d,v,p,m));else{var y=p,x=v,S=p,w=v,C=g,O=g,E=a.apply(this,arguments)/2,_=E>zo&&(r?+r.apply(this,arguments):$g(d*d+h*h)),$=JN(ute(h-d)/2,+n.apply(this,arguments)),P=$,T=$,I,M;if(_>zo){var R=fte(_/d*Ul(E)),N=fte(_/h*Ul(E));(C-=R*2)>zo?(R*=m?1:-1,S+=R,w-=R):(C=0,S=w=(p+v)/2),(O-=N*2)>zo?(N*=m?1:-1,y+=N,x-=N):(O=0,y=x=(p+v)/2)}var k=h*bh(y),A=h*Ul(y),j=d*bh(w),D=d*Ul(w);if($>zo){var L=h*bh(x),F=h*Ul(x),B=d*bh(S),H=d*Ul(S),z;if(g<X1)if(z=XZe(k,A,B,H,L,F,j,D)){var W=k-z[0],V=A-z[1],U=L-z[0],G=F-z[1],q=1/Ul(HZe((W*U+V*G)/($g(W*W+V*V)*$g(U*U+G*G)))/2),K=$g(z[0]*z[0]+z[1]*z[1]);P=JN($,(d-K)/(q-1)),T=JN($,(h-K)/(q+1))}else P=T=0}O>zo?T>zo?(I=YO(B,H,k,A,h,T,m),M=YO(L,F,j,D,h,T,m),s.moveTo(I.cx+I.x01,I.cy+I.y01),T<$?s.arc(I.cx,I.cy,T,Bo(I.y01,I.x01),Bo(M.y01,M.x01),!m):(s.arc(I.cx,I.cy,T,Bo(I.y01,I.x01),Bo(I.y11,I.x11),!m),s.arc(0,0,h,Bo(I.cy+I.y11,I.cx+I.x11),Bo(M.cy+M.y11,M.cx+M.x11),!m),s.arc(M.cx,M.cy,T,Bo(M.y11,M.x11),Bo(M.y01,M.x01),!m))):(s.moveTo(k,A),s.arc(0,0,h,y,x,!m)):s.moveTo(k,A),!(d>zo)||!(C>zo)?s.lineTo(j,D):P>zo?(I=YO(j,D,L,F,d,-P,m),M=YO(k,A,B,H,d,-P,m),s.lineTo(I.cx+I.x01,I.cy+I.y01),P<$?s.arc(I.cx,I.cy,P,Bo(I.y01,I.x01),Bo(M.y01,M.x01),!m):(s.arc(I.cx,I.cy,P,Bo(I.y01,I.x01),Bo(I.y11,I.x11),!m),s.arc(0,0,d,Bo(I.cy+I.y11,I.cx+I.x11),Bo(M.cy+M.y11,M.cx+M.x11),m),s.arc(M.cx,M.cy,P,Bo(M.y11,M.x11),Bo(M.y01,M.x01),!m))):s.arc(0,0,d,w,S,m)}if(s.closePath(),u)return s=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-X1/2;return[bh(f)*u,Ul(f)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:Nr(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:Nr(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:Nr(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:Nr(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:Nr(+u),c):i},c.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:Nr(+u),c):o},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:Nr(+u),c):a},c.context=function(u){return arguments.length?(s=u==null?null:u,c):s},c}function hte(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pte(e){this._context=e}pte.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Z1(e){return new pte(e)}function vte(e){return e[0]}function gte(e){return e[1]}function Sh(e,t){var n=Nr(!0),r=null,i=Z1,o=null,a=rk(s);e=typeof e=="function"?e:e===void 0?vte:Nr(e),t=typeof t=="function"?t:t===void 0?gte:Nr(t);function s(l){var c,u=(l=hte(l)).length,f,d=!1,h;for(r==null&&(o=i(h=a())),c=0;c<=u;++c)!(c<u&&n(f=l[c],c,l))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,c,l),+t(f,c,l));if(h)return o=null,h+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:Nr(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:Nr(+l),s):t},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Nr(!!l),s):n},s.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),s):i},s.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),s):r},s}function ik(e,t,n){var r=null,i=Nr(!0),o=null,a=Z1,s=null,l=rk(c);e=typeof e=="function"?e:e===void 0?vte:Nr(+e),t=typeof t=="function"?t:Nr(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?gte:Nr(+n);function c(f){var d,h,p,v=(f=hte(f)).length,g,m=!1,y,x=new Array(v),S=new Array(v);for(o==null&&(s=a(y=l())),d=0;d<=v;++d){if(!(d<v&&i(g=f[d],d,f))===m)if(m=!m)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=d-1;p>=h;--p)s.point(x[p],S[p]);s.lineEnd(),s.areaEnd()}m&&(x[d]=+e(g,d,f),S[d]=+t(g,d,f),s.point(r?+r(g,d,f):x[d],n?+n(g,d,f):S[d]))}if(y)return s=null,y+""||null}function u(){return Sh().defined(i).curve(a).context(o)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:Nr(+f),r=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Nr(+f),c):e},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Nr(+f),c):r},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:Nr(+f),n=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Nr(+f),c):t},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Nr(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Nr(!!f),c):i},c.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),c):a},c.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),c):o},c}var mte=ok(Z1);function yte(e){this._curve=e}yte.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function ok(e){function t(n){return new yte(e(n))}return t._curve=e,t}function Q1(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(ok(n)):t()._curve},e}function ZZe(){return Q1(Sh().curve(mte))}function QZe(){var e=ik().curve(mte),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,o=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return Q1(n())},delete e.lineX0,e.lineEndAngle=function(){return Q1(r())},delete e.lineX1,e.lineInnerRadius=function(){return Q1(i())},delete e.lineY0,e.lineOuterRadius=function(){return Q1(o())},delete e.lineY1,e.curve=function(a){return arguments.length?t(ok(a)):t()._curve},e}function Pg(){}function ak(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function sk(e,t){this._context=e,this._k=(1-t)/6}sk.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:ak(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ak(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function n(r){return new sk(r,t)}return n.tension=function(r){return e(+r)},n}(0);function lk(e,t){this._context=e,this._k=(1-t)/6}lk.prototype={areaStart:Pg,areaEnd:Pg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ak(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function n(r){return new lk(r,t)}return n.tension=function(r){return e(+r)},n}(0);function bte(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>zo){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>zo){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function xte(e,t){this._context=e,this._alpha=t}xte.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:bte(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function n(r){return t?new xte(r,t):new sk(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Ste(e,t){this._context=e,this._alpha=t}Ste.prototype={areaStart:Pg,areaEnd:Pg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=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 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:bte(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const wte=function e(t){function n(r){return t?new Ste(r,t):new lk(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Cte(e){this._context=e}Cte.prototype={areaStart:Pg,areaEnd:Pg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ck(e){return new Cte(e)}function Ote(e){return e<0?-1:1}function Ete(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Ote(o)+Ote(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function _te(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function uk(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function ZO(e){this._context=e}ZO.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:uk(this,this._t0,_te(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,uk(this,_te(this,n=Ete(this,e,t)),n);break;default:uk(this,this._t0,n=Ete(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function $te(e){this._context=new Pte(e)}($te.prototype=Object.create(ZO.prototype)).point=function(e,t){ZO.prototype.point.call(this,t,e)};function Pte(e){this._context=e}Pte.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function Mte(e){return new ZO(e)}function Tte(e){return new $te(e)}function QO(e,t){this._context=e,this._t=t}QO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Ite(e){return new QO(e,.5)}function Rte(e){return new QO(e,0)}function Nte(e){return new QO(e,1)}function kr(e){const{transformations:t}=e.getOptions();return t.map(([r])=>r).filter(r=>r==="transpose").length%2!==0}function hr(e){const{transformations:t}=e.getOptions();return t.some(([n])=>n==="polar")}function JO(e){const{transformations:t}=e.getOptions();return t.some(([n])=>n==="reflect")&&t.some(([n])=>n.startsWith("transpose"))}function kte(e){const{transformations:t}=e.getOptions();return t.some(([n])=>n==="helix")}function eE(e){const{transformations:t}=e.getOptions();return t.some(([n])=>n==="parallel")}function Ate(e){const{transformations:t}=e.getOptions();return t.some(([n])=>n==="fisheye")}function JZe(e){return eE(e)&&hr(e)}function Mg(e){return kte(e)||hr(e)}function eQe(e){return hr(e)&&kr(e)}function tQe(e){if(Mg(e)){const[t,n]=e.getSize(),r=e.getOptions().transformations.find(i=>i[0]==="polar");if(r)return Math.max(t,n)/2*r[4]}return 0}function tE(e){const{transformations:t}=e.getOptions(),[,,,n,r]=t.find(i=>i[0]==="polar");return[+n,+r]}function fk(e,t=!0){const{transformations:n}=e.getOptions(),[,r,i]=n.find(o=>o[0]==="polar");return t?[+r*180/Math.PI,+i*180/Math.PI]:[r,i]}function nQe(e,t){const{transformations:n}=e.getOptions(),[,...r]=n.find(i=>i[0]===t);return r}var Lte={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||l,d),p=n?n+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function a(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)t.call(u,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},s.prototype.listeners=function(c){var u=n?n+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},s.prototype.listenerCount=function(c){var u=n?n+c:c,f=this._events[u];return f?f.fn?1:f.length:0},s.prototype.emit=function(c,u,f,d,h,p){var v=n?n+c:c;if(!this._events[v])return!1;var g=this._events[v],m=arguments.length,y,x;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),m){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,f),!0;case 4:return g.fn.call(g.context,u,f,d),!0;case 5:return g.fn.call(g.context,u,f,d,h),!0;case 6:return g.fn.call(g.context,u,f,d,h,p),!0}for(x=1,y=new Array(m-1);x<m;x++)y[x-1]=arguments[x];g.fn.apply(g.context,y)}else{var S=g.length,w;for(x=0;x<S;x++)switch(g[x].once&&this.removeListener(c,g[x].fn,void 0,!0),m){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,u);break;case 3:g[x].fn.call(g[x].context,u,f);break;case 4:g[x].fn.call(g[x].context,u,f,d);break;default:if(!y)for(w=1,y=new Array(m-1);w<m;w++)y[w-1]=arguments[w];g[x].fn.apply(g[x].context,y)}}return!0},s.prototype.on=function(c,u,f){return o(this,c,u,f,!1)},s.prototype.once=function(c,u,f){return o(this,c,u,f,!0)},s.prototype.removeListener=function(c,u,f,d){var h=n?n+c:c;if(!this._events[h])return this;if(!u)return a(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!d||p.once)&&(!f||p.context===f)&&a(this,h);else{for(var v=0,g=[],m=p.length;v<m;v++)(p[v].fn!==u||d&&!p[v].once||f&&p[v].context!==f)&&g.push(p[v]);g.length?this._events[h]=g.length===1?g[0]:g:a(this,h)}return this},s.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&a(this,u)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(Lte);var rQe=Lte.exports;const dk=Rt(rQe);function nE(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Tg(){}var wh=.7,Ig=1/wh,Rg="\\s*([+-]?\\d+)\\s*",J1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ql="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iQe=/^#([0-9a-f]{3,8})$/,oQe=new RegExp(`^rgb\\(${Rg},${Rg},${Rg}\\)$`),aQe=new RegExp(`^rgb\\(${ql},${ql},${ql}\\)$`),sQe=new RegExp(`^rgba\\(${Rg},${Rg},${Rg},${J1}\\)$`),lQe=new RegExp(`^rgba\\(${ql},${ql},${ql},${J1}\\)$`),cQe=new RegExp(`^hsl\\(${J1},${ql},${ql}\\)$`),uQe=new RegExp(`^hsla\\(${J1},${ql},${ql},${J1}\\)$`),jte={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};nE(Tg,rE,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Dte,formatHex:Dte,formatHex8:fQe,formatHsl:dQe,formatRgb:Fte,toString:Fte});function Dte(){return this.rgb().formatHex()}function fQe(){return this.rgb().formatHex8()}function dQe(){return Ute(this).formatHsl()}function Fte(){return this.rgb().formatRgb()}function rE(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=iQe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Bte(t):n===3?new Ho(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?iE(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?iE(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=oQe.exec(e))?new Ho(t[1],t[2],t[3],1):(t=aQe.exec(e))?new Ho(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=sQe.exec(e))?iE(t[1],t[2],t[3],t[4]):(t=lQe.exec(e))?iE(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cQe.exec(e))?Vte(t[1],t[2]/100,t[3]/100,1):(t=uQe.exec(e))?Vte(t[1],t[2]/100,t[3]/100,t[4]):jte.hasOwnProperty(e)?Bte(jte[e]):e==="transparent"?new Ho(NaN,NaN,NaN,0):null}function Bte(e){return new Ho(e>>16&255,e>>8&255,e&255,1)}function iE(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ho(e,t,n,r)}function zte(e){return e instanceof Tg||(e=rE(e)),e?(e=e.rgb(),new Ho(e.r,e.g,e.b,e.opacity)):new Ho}function eb(e,t,n,r){return arguments.length===1?zte(e):new Ho(e,t,n,r==null?1:r)}function Ho(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}nE(Ho,eb,hk(Tg,{brighter(e){return e=e==null?Ig:Math.pow(Ig,e),new Ho(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wh:Math.pow(wh,e),new Ho(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ho(Ch(this.r),Ch(this.g),Ch(this.b),oE(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:Hte,formatHex:Hte,formatHex8:hQe,formatRgb:Wte,toString:Wte}));function Hte(){return`#${Oh(this.r)}${Oh(this.g)}${Oh(this.b)}`}function hQe(){return`#${Oh(this.r)}${Oh(this.g)}${Oh(this.b)}${Oh((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wte(){const e=oE(this.opacity);return`${e===1?"rgb(":"rgba("}${Ch(this.r)}, ${Ch(this.g)}, ${Ch(this.b)}${e===1?")":`, ${e})`}`}function oE(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ch(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oh(e){return e=Ch(e),(e<16?"0":"")+e.toString(16)}function Vte(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new yl(e,t,n,r)}function Ute(e){if(e instanceof yl)return new yl(e.h,e.s,e.l,e.opacity);if(e instanceof Tg||(e=rE(e)),!e)return new yl;if(e instanceof yl)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new yl(a,s,l,e.opacity)}function pQe(e,t,n,r){return arguments.length===1?Ute(e):new yl(e,t,n,r==null?1:r)}function yl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}nE(yl,pQe,hk(Tg,{brighter(e){return e=e==null?Ig:Math.pow(Ig,e),new yl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wh:Math.pow(wh,e),new yl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ho(pk(e>=240?e-240:e+120,i,r),pk(e,i,r),pk(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new yl(qte(this.h),aE(this.s),aE(this.l),oE(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 e=oE(this.opacity);return`${e===1?"hsl(":"hsla("}${qte(this.h)}, ${aE(this.s)*100}%, ${aE(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qte(e){return e=(e||0)%360,e<0?e+360:e}function aE(e){return Math.max(0,Math.min(1,e||0))}function pk(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const vQe=Math.PI/180,gQe=180/Math.PI;var Gte=-.14861,vk=1.78277,gk=-.29227,sE=-.90649,tb=1.97294,Kte=tb*sE,Yte=tb*vk,Xte=vk*gk-sE*Gte;function mQe(e){if(e instanceof Eh)return new Eh(e.h,e.s,e.l,e.opacity);e instanceof Ho||(e=zte(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Xte*r+Kte*t-Yte*n)/(Xte+Kte-Yte),o=r-i,a=(tb*(n-i)-gk*o)/sE,s=Math.sqrt(a*a+o*o)/(tb*i*(1-i)),l=s?Math.atan2(a,o)*gQe-120:NaN;return new Eh(l<0?l+360:l,s,i,e.opacity)}function Gl(e,t,n,r){return arguments.length===1?mQe(e):new Eh(e,t,n,r==null?1:r)}function Eh(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}nE(Eh,Gl,hk(Tg,{brighter(e){return e=e==null?Ig:Math.pow(Ig,e),new Eh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wh:Math.pow(wh,e),new Eh(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*vQe,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Ho(255*(t+n*(Gte*r+vk*i)),255*(t+n*(gk*r+sE*i)),255*(t+n*(tb*r)),this.opacity)}}));function eu(e,t,n,r){var i=e-n,o=t-r;return Math.sqrt(i*i+o*o)}function Zte(e,t){var n=Math.min.apply(Math,it([],se(e),!1)),r=Math.min.apply(Math,it([],se(t),!1)),i=Math.max.apply(Math,it([],se(e),!1)),o=Math.max.apply(Math,it([],se(t),!1));return{x:n,y:r,width:i-n,height:o-r}}function yQe(e,t,n){return Math.atan(-t/e*Math.tan(n))}function bQe(e,t,n){return Math.atan(t/(e*Math.tan(n)))}function xQe(e,t,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+e}function SQe(e,t,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+t}function wQe(e,t,n,r,i,o,a){for(var s=yQe(n,r,i),l=1/0,c=-1/0,u=[o,a],f=-Math.PI*2;f<=Math.PI*2;f+=Math.PI){var d=s+f;o<a?o<d&&d<a&&u.push(d):a<d&&d<o&&u.push(d)}for(var f=0;f<u.length;f++){var h=xQe(e,t,n,r,i,u[f]);h<l&&(l=h),h>c&&(c=h)}for(var p=bQe(n,r,i),v=1/0,g=-1/0,m=[o,a],f=-Math.PI*2;f<=Math.PI*2;f+=Math.PI){var y=p+f;o<a?o<y&&y<a&&m.push(y):a<y&&y<o&&m.push(y)}for(var f=0;f<m.length;f++){var x=SQe(e,t,n,r,i,m[f]);x<v&&(v=x),x>g&&(g=x)}return{x:l,y:v,width:c-l,height:g-v}}var CQe=1e-4;function Qte(e,t,n,r,i,o){var a=-1,s=1/0,l=[n,r],c=20;o&&o>200&&(c=o/10);for(var u=1/c,f=u/10,d=0;d<=c;d++){var h=d*u,p=[i.apply(void 0,it([],se(e.concat([h])),!1)),i.apply(void 0,it([],se(t.concat([h])),!1))],v=eu(l[0],l[1],p[0],p[1]);v<s&&(a=h,s=v)}if(a===0)return{x:e[0],y:t[0]};if(a===1){var g=e.length;return{x:e[g-1],y:t[g-1]}}s=1/0;for(var d=0;d<32&&!(f<CQe);d++){var m=a-f,y=a+f,p=[i.apply(void 0,it([],se(e.concat([m])),!1)),i.apply(void 0,it([],se(t.concat([m])),!1))],v=eu(l[0],l[1],p[0],p[1]);if(m>=0&&v<s)a=m,s=v;else{var x=[i.apply(void 0,it([],se(e.concat([y])),!1)),i.apply(void 0,it([],se(t.concat([y])),!1))],S=eu(l[0],l[1],x[0],x[1]);y<=1&&S<s?(a=y,s=S):f*=.5}}return{x:i.apply(void 0,it([],se(e.concat([a])),!1)),y:i.apply(void 0,it([],se(t.concat([a])),!1))}}function Jte(e,t,n,r){return eu(e,t,n,r)}function ene(e,t,n,r,i){return{x:(1-i)*e+i*n,y:(1-i)*t+i*r}}function OQe(e,t,n,r,i,o){var a=[n-e,r-t];if(yKe(a,[0,0]))return Math.sqrt((i-e)*(i-e)+(o-t)*(o-t));var s=[-a[1],a[0]];gKe(s,s);var l=[i-e,o-t];return Math.abs(mKe(l,s))}function mk(e,t,n,r,i){var o=1-i;return o*o*o*e+3*t*i*o*o+3*n*i*i*o+r*i*i*i}function tne(e,t,n,r){var i=-3*e+9*t-9*n+3*r,o=6*e-12*t+6*n,a=3*t-3*e,s=[],l,c,u;if(O1(i,0))O1(o,0)||(l=-a/o,l>=0&&l<=1&&s.push(l));else{var f=o*o-4*i*a;O1(f,0)?s.push(-o/(2*i)):f>0&&(u=Math.sqrt(f),l=(-o+u)/(2*i),c=(-o-u)/(2*i),l>=0&&l<=1&&s.push(l),c>=0&&c<=1&&s.push(c))}return s}function EQe(e,t,n,r,i,o,a,s){for(var l=[e,a],c=[t,s],u=tne(e,n,i,a),f=tne(t,r,o,s),d=0;d<u.length;d++)l.push(mk(e,n,i,a,u[d]));for(var d=0;d<f.length;d++)c.push(mk(t,r,o,s,f[d]));return Zte(l,c)}function _Qe(e,t,n,r,i,o,a,s,l,c,u){return Qte([e,n,i,a],[t,r,o,s],l,c,mk,u)}function nne(e,t,n,r,i,o,a,s,l,c,u){var f=_Qe(e,t,n,r,i,o,a,s,l,c,u);return eu(f.x,f.y,l,c)}function $Qe(e){if(e.length<2)return 0;for(var t=0,n=0;n<e.length-1;n++){var r=e[n],i=e[n+1];t+=eu(r[0],r[1],i[0],i[1])}return t}function PQe(e){return $Qe(e)}function yk(e,t,n,r){var i=1-r;return i*i*e+2*r*i*t+r*r*n}function rne(e,t,n){var r=e+n-2*t;if(O1(r,0))return[.5];var i=(e-t)/r;return i<=1&&i>=0?[i]:[]}function MQe(e,t,n,r,i,o){var a=rne(e,n,i)[0],s=rne(t,r,o)[0],l=[e,i],c=[t,o];return a!==void 0&&l.push(yk(e,n,i,a)),s!==void 0&&c.push(yk(t,r,o,s)),Zte(l,c)}function TQe(e,t,n,r,i,o,a,s){return Qte([e,n,i],[t,r,o],a,s,yk)}function IQe(e,t,n,r,i,o,a,s){var l=TQe(e,t,n,r,i,o,a,s);return eu(l.x,l.y,a,s)}var RQe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},ine={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(RQe,function(){function n(w,C,O,E,_){r(w,C,O||0,E||w.length-1,_||o)}function r(w,C,O,E,_){for(;E>O;){if(E-O>600){var $=E-O+1,P=C-O+1,T=Math.log($),I=.5*Math.exp(2*T/3),M=.5*Math.sqrt(T*I*($-I)/$)*(P-$/2<0?-1:1),R=Math.max(O,Math.floor(C-P*I/$+M)),N=Math.min(E,Math.floor(C+($-P)*I/$+M));r(w,C,R,N,_)}var k=w[C],A=O,j=E;for(i(w,O,C),_(w[E],k)>0&&i(w,O,E);A<j;){for(i(w,A,j),A++,j--;_(w[A],k)<0;)A++;for(;_(w[j],k)>0;)j--}_(w[O],k)===0?i(w,O,j):(j++,i(w,j,E)),j<=C&&(O=j+1),C<=j&&(E=j-1)}}function i(w,C,O){var E=w[C];w[C]=w[O],w[O]=E}function o(w,C){return w<C?-1:w>C?1:0}var a=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};a.prototype.all=function(){return this._all(this.data,[])},a.prototype.search=function(C){var O=this.data,E=[];if(!y(C,O))return E;for(var _=this.toBBox,$=[];O;){for(var P=0;P<O.children.length;P++){var T=O.children[P],I=O.leaf?_(T):T;y(C,I)&&(O.leaf?E.push(T):m(C,I)?this._all(T,E):$.push(T))}O=$.pop()}return E},a.prototype.collides=function(C){var O=this.data;if(!y(C,O))return!1;for(var E=[];O;){for(var _=0;_<O.children.length;_++){var $=O.children[_],P=O.leaf?this.toBBox($):$;if(y(C,P)){if(O.leaf||m(C,P))return!0;E.push($)}}O=E.pop()}return!1},a.prototype.load=function(C){if(!(C&&C.length))return this;if(C.length<this._minEntries){for(var O=0;O<C.length;O++)this.insert(C[O]);return this}var E=this._build(C.slice(),0,C.length-1,0);if(!this.data.children.length)this.data=E;else if(this.data.height===E.height)this._splitRoot(this.data,E);else{if(this.data.height<E.height){var _=this.data;this.data=E,E=_}this._insert(E,this.data.height-E.height-1,!0)}return this},a.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},a.prototype.clear=function(){return this.data=x([]),this},a.prototype.remove=function(C,O){if(!C)return this;for(var E=this.data,_=this.toBBox(C),$=[],P=[],T,I,M;E||$.length;){if(E||(E=$.pop(),I=$[$.length-1],T=P.pop(),M=!0),E.leaf){var R=s(C,E.children,O);if(R!==-1)return E.children.splice(R,1),$.push(E),this._condense($),this}!M&&!E.leaf&&m(E,_)?($.push(E),P.push(T),T=0,I=E,E=E.children[0]):I?(T++,E=I.children[T],M=!1):E=null}return this},a.prototype.toBBox=function(C){return C},a.prototype.compareMinX=function(C,O){return C.minX-O.minX},a.prototype.compareMinY=function(C,O){return C.minY-O.minY},a.prototype.toJSON=function(){return this.data},a.prototype.fromJSON=function(C){return this.data=C,this},a.prototype._all=function(C,O){for(var E=[];C;)C.leaf?O.push.apply(O,C.children):E.push.apply(E,C.children),C=E.pop();return O},a.prototype._build=function(C,O,E,_){var $=E-O+1,P=this._maxEntries,T;if($<=P)return T=x(C.slice(O,E+1)),l(T,this.toBBox),T;_||(_=Math.ceil(Math.log($)/Math.log(P)),P=Math.ceil($/Math.pow(P,_-1))),T=x([]),T.leaf=!1,T.height=_;var I=Math.ceil($/P),M=I*Math.ceil(Math.sqrt(P));S(C,O,E,M,this.compareMinX);for(var R=O;R<=E;R+=M){var N=Math.min(R+M-1,E);S(C,R,N,I,this.compareMinY);for(var k=R;k<=N;k+=I){var A=Math.min(k+I-1,N);T.children.push(this._build(C,k,A,_-1))}}return l(T,this.toBBox),T},a.prototype._chooseSubtree=function(C,O,E,_){for(;_.push(O),!(O.leaf||_.length-1===E);){for(var $=1/0,P=1/0,T=void 0,I=0;I<O.children.length;I++){var M=O.children[I],R=h(M),N=v(C,M)-R;N<P?(P=N,$=R<$?R:$,T=M):N===P&&R<$&&($=R,T=M)}O=T||O.children[0]}return O},a.prototype._insert=function(C,O,E){var _=E?C:this.toBBox(C),$=[],P=this._chooseSubtree(_,this.data,O,$);for(P.children.push(C),u(P,_);O>=0&&$[O].children.length>this._maxEntries;)this._split($,O),O--;this._adjustParentBBoxes(_,$,O)},a.prototype._split=function(C,O){var E=C[O],_=E.children.length,$=this._minEntries;this._chooseSplitAxis(E,$,_);var P=this._chooseSplitIndex(E,$,_),T=x(E.children.splice(P,E.children.length-P));T.height=E.height,T.leaf=E.leaf,l(E,this.toBBox),l(T,this.toBBox),O?C[O-1].children.push(T):this._splitRoot(E,T)},a.prototype._splitRoot=function(C,O){this.data=x([C,O]),this.data.height=C.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},a.prototype._chooseSplitIndex=function(C,O,E){for(var _,$=1/0,P=1/0,T=O;T<=E-O;T++){var I=c(C,0,T,this.toBBox),M=c(C,T,E,this.toBBox),R=g(I,M),N=h(I)+h(M);R<$?($=R,_=T,P=N<P?N:P):R===$&&N<P&&(P=N,_=T)}return _||E-O},a.prototype._chooseSplitAxis=function(C,O,E){var _=C.leaf?this.compareMinX:f,$=C.leaf?this.compareMinY:d,P=this._allDistMargin(C,O,E,_),T=this._allDistMargin(C,O,E,$);P<T&&C.children.sort(_)},a.prototype._allDistMargin=function(C,O,E,_){C.children.sort(_);for(var $=this.toBBox,P=c(C,0,O,$),T=c(C,E-O,E,$),I=p(P)+p(T),M=O;M<E-O;M++){var R=C.children[M];u(P,C.leaf?$(R):R),I+=p(P)}for(var N=E-O-1;N>=O;N--){var k=C.children[N];u(T,C.leaf?$(k):k),I+=p(T)}return I},a.prototype._adjustParentBBoxes=function(C,O,E){for(var _=E;_>=0;_--)u(O[_],C)},a.prototype._condense=function(C){for(var O=C.length-1,E=void 0;O>=0;O--)C[O].children.length===0?O>0?(E=C[O-1].children,E.splice(E.indexOf(C[O]),1)):this.clear():l(C[O],this.toBBox)};function s(w,C,O){if(!O)return C.indexOf(w);for(var E=0;E<C.length;E++)if(O(w,C[E]))return E;return-1}function l(w,C){c(w,0,w.children.length,C,w)}function c(w,C,O,E,_){_||(_=x(null)),_.minX=1/0,_.minY=1/0,_.maxX=-1/0,_.maxY=-1/0;for(var $=C;$<O;$++){var P=w.children[$];u(_,w.leaf?E(P):P)}return _}function u(w,C){return w.minX=Math.min(w.minX,C.minX),w.minY=Math.min(w.minY,C.minY),w.maxX=Math.max(w.maxX,C.maxX),w.maxY=Math.max(w.maxY,C.maxY),w}function f(w,C){return w.minX-C.minX}function d(w,C){return w.minY-C.minY}function h(w){return(w.maxX-w.minX)*(w.maxY-w.minY)}function p(w){return w.maxX-w.minX+(w.maxY-w.minY)}function v(w,C){return(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))}function g(w,C){var O=Math.max(w.minX,C.minX),E=Math.max(w.minY,C.minY),_=Math.min(w.maxX,C.maxX),$=Math.min(w.maxY,C.maxY);return Math.max(0,_-O)*Math.max(0,$-E)}function m(w,C){return w.minX<=C.minX&&w.minY<=C.minY&&C.maxX<=w.maxX&&C.maxY<=w.maxY}function y(w,C){return C.minX<=w.maxX&&C.minY<=w.maxY&&C.maxX>=w.minX&&C.maxY>=w.minY}function x(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function S(w,C,O,E,_){for(var $=[C,O];$.length;)if(O=$.pop(),C=$.pop(),!(O-C<=E)){var P=C+Math.ceil((O-C)/E/2)*E;n(w,P,C,O,_),$.push(C,P,P,O)}}return a})})(ine);var NQe=ine.exports,Ze;(function(e){e.GROUP="g",e.CIRCLE="circle",e.ELLIPSE="ellipse",e.IMAGE="image",e.RECT="rect",e.LINE="line",e.POLYLINE="polyline",e.POLYGON="polygon",e.TEXT="text",e.PATH="path",e.HTML="html",e.MESH="mesh"})(Ze||(Ze={}));var Ng;(function(e){e[e.ZERO=0]="ZERO",e[e.NEGATIVE_ONE=1]="NEGATIVE_ONE"})(Ng||(Ng={}));var Mf=function(){function e(){this.plugins=[]}return e.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach(function(n){var r=t.context.renderingPlugins.indexOf(n);r>=0&&t.context.renderingPlugins.splice(r,1)})},e}(),kQe=function(){function e(t){this.clipSpaceNearZ=Ng.NEGATIVE_ONE,this.plugins=[],this.config=ke({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},t)}return e.prototype.registerPlugin=function(t){var n=this.plugins.findIndex(function(r){return r===t});n===-1&&this.plugins.push(t)},e.prototype.unregisterPlugin=function(t){var n=this.plugins.findIndex(function(r){return r===t});n>-1&&this.plugins.splice(n,1)},e.prototype.getPlugins=function(){return this.plugins},e.prototype.getPlugin=function(t){return this.plugins.find(function(n){return n.name===t})},e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(t){Object.assign(this.config,t)},e}();function kg(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function bk(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function lE(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function one(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function AQe(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function LQe(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function Ag(e){return e===void 0?0:e>360||e<-360?e%360:e}function ta(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=0),Array.isArray(e)&&e.length===3?Xc(e):_r(e)?Un(e,t,n):Un(e[0],e[1]||t,e[2]||n)}function pr(e){return e*(Math.PI/180)}function $s(e){return e*(180/Math.PI)}function jQe(e){return 360*e}function DQe(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n,s=r*r,l=i*i,c=o*o,u=a+s+l+c,f=n*o-r*i;return f>.499995*u?(e[0]=Math.PI/2,e[1]=2*Math.atan2(r,n),e[2]=0):f<-.499995*u?(e[0]=-Math.PI/2,e[1]=2*Math.atan2(r,n),e[2]=0):(e[0]=Math.asin(2*(n*i-o*r)),e[1]=Math.atan2(2*(n*o+r*i),1-2*(l+c)),e[2]=Math.atan2(2*(n*r+i*o),1-2*(s+l))),e}function FQe(e,t){var n,r,i=Math.PI*.5,o=se(pg(Mn(),t),3),a=o[0],s=o[1],l=o[2],c=Math.asin(-t[2]/a);return c<i?c>-i?(n=Math.atan2(t[6]/s,t[10]/l),r=Math.atan2(t[1]/a,t[0]/a)):(r=0,n=-Math.atan2(t[4]/s,t[5]/s)):(r=0,n=Math.atan2(t[4]/s,t[5]/s)),e[0]=n,e[1]=c,e[2]=r,e}function xk(e,t){return t.length===16?FQe(e,t):DQe(e,t)}function BQe(e,t,n,r,i){var o=Math.cos(e),a=Math.sin(e);return NGe(r*o,i*a,0,-r*a,i*o,0,t,n,1)}function zQe(e,t,n,r,i,o,a,s){s===void 0&&(s=!1);var l=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d,h;return s?(d=-a/(a-o),h=-a*o/(a-o)):(d=-(a+o)/(a-o),h=-2*a*o/(a-o)),e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=u,e[9]=f,e[10]=d,e[11]=-1,e[12]=0,e[13]=0,e[14]=h,e[15]=0,e}function ane(e){var t=e[0],n=e[1],r=e[3],i=e[4],o=Math.sqrt(t*t+n*n),a=Math.sqrt(r*r+i*i),s=t*i-n*r;s<0&&(t<i?o=-o:a=-a),o&&(t*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var l=Math.atan2(n,t),c=$s(l);return[e[6],e[7],o,a,c]}var Kl=er(),bl=er(),nb=gg(),pn=[Mn(),Mn(),Mn()],sne=Mn();function HQe(e,t,n,r,i,o){if(!WQe(Kl,e)||(dg(bl,Kl),bl[3]=0,bl[7]=0,bl[11]=0,bl[15]=1,Math.abs(eJ(bl))<1e-8))return!1;var a=Kl[3],s=Kl[7],l=Kl[11],c=Kl[12],u=Kl[13],f=Kl[14],d=Kl[15];if(a!==0||s!==0||l!==0){nb[0]=a,nb[1]=s,nb[2]=l,nb[3]=d;var h=vl(bl,bl);if(!h)return!1;JQ(bl,bl),mg(i,nb,bl)}else i[0]=i[1]=i[2]=0,i[3]=1;if(t[0]=c,t[1]=u,t[2]=f,VQe(pn,Kl),n[0]=Zc(pn[0]),dh(pn[0],pn[0]),r[0]=Wl(pn[0],pn[1]),Sk(pn[1],pn[1],pn[0],1,-r[0]),n[1]=Zc(pn[1]),dh(pn[1],pn[1]),r[0]/=n[1],r[1]=Wl(pn[0],pn[2]),Sk(pn[2],pn[2],pn[0],1,-r[1]),r[2]=Wl(pn[1],pn[2]),Sk(pn[2],pn[2],pn[1],1,-r[2]),n[2]=Zc(pn[2]),dh(pn[2],pn[2]),r[1]/=n[2],r[2]/=n[2],bO(sne,pn[1],pn[2]),Wl(pn[0],sne)<0)for(var p=0;p<3;p++)n[p]*=-1,pn[p][0]*=-1,pn[p][1]*=-1,pn[p][2]*=-1;return o[0]=.5*Math.sqrt(Math.max(1+pn[0][0]-pn[1][1]-pn[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-pn[0][0]+pn[1][1]-pn[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-pn[0][0]-pn[1][1]+pn[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+pn[0][0]+pn[1][1]+pn[2][2],0)),pn[2][1]>pn[1][2]&&(o[0]=-o[0]),pn[0][2]>pn[2][0]&&(o[1]=-o[1]),pn[1][0]>pn[0][1]&&(o[2]=-o[2]),!0}function WQe(e,t){var n=t[15];if(n===0)return!1;for(var r=1/n,i=0;i<16;i++)e[i]=t[i]*r;return!0}function VQe(e,t){e[0][0]=t[0],e[0][1]=t[1],e[0][2]=t[2],e[1][0]=t[4],e[1][1]=t[5],e[1][2]=t[6],e[2][0]=t[8],e[2][1]=t[9],e[2][2]=t[10]}function Sk(e,t,n,r,i){e[0]=t[0]*r+n[0]*i,e[1]=t[1]*r+n[1]*i,e[2]=t[2]*r+n[2]*i}var vi=function(){function e(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return e.isEmpty=function(t){return!t||t.halfExtents[0]===0&&t.halfExtents[1]===0&&t.halfExtents[2]===0},e.prototype.update=function(t,n){kg(this.center,t),kg(this.halfExtents,n),bk(this.min,this.center,this.halfExtents),lE(this.max,this.center,this.halfExtents)},e.prototype.setMinMax=function(t,n){lE(this.center,n,t),one(this.center,this.center,.5),bk(this.halfExtents,n,t),one(this.halfExtents,this.halfExtents,.5),kg(this.min,t),kg(this.max,n)},e.prototype.getMin=function(){return this.min},e.prototype.getMax=function(){return this.max},e.prototype.add=function(t){if(!e.isEmpty(t)){if(e.isEmpty(this)){this.setMinMax(t.getMin(),t.getMax());return}var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],l=a[1],c=a[2],u=r-s,f=r+s,d=i-l,h=i+l,p=o-c,v=o+c,g=t.center,m=g[0],y=g[1],x=g[2],S=t.halfExtents,w=S[0],C=S[1],O=S[2],E=m-w,_=m+w,$=y-C,P=y+C,T=x-O,I=x+O;E<u&&(u=E),_>f&&(f=_),$<d&&(d=$),P>h&&(h=P),T<p&&(p=T),I>v&&(v=I),n[0]=(u+f)*.5,n[1]=(d+h)*.5,n[2]=(p+v)*.5,a[0]=(f-u)*.5,a[1]=(h-d)*.5,a[2]=(v-p)*.5,this.min[0]=u,this.min[1]=d,this.min[2]=p,this.max[0]=f,this.max[1]=h,this.max[2]=v}},e.prototype.setFromTransformedAABB=function(t,n){var r=this.center,i=this.halfExtents,o=t.center,a=t.halfExtents,s=n[0],l=n[4],c=n[8],u=n[1],f=n[5],d=n[9],h=n[2],p=n[6],v=n[10],g=Math.abs(s),m=Math.abs(l),y=Math.abs(c),x=Math.abs(u),S=Math.abs(f),w=Math.abs(d),C=Math.abs(h),O=Math.abs(p),E=Math.abs(v);r[0]=n[12]+s*o[0]+l*o[1]+c*o[2],r[1]=n[13]+u*o[0]+f*o[1]+d*o[2],r[2]=n[14]+h*o[0]+p*o[1]+v*o[2],i[0]=g*a[0]+m*a[1]+y*a[2],i[1]=x*a[0]+S*a[1]+w*a[2],i[2]=C*a[0]+O*a[1]+E*a[2],bk(this.min,r,i),lE(this.max,r,i)},e.prototype.intersects=function(t){var n=this.getMax(),r=this.getMin(),i=t.getMax(),o=t.getMin();return r[0]<=i[0]&&n[0]>=o[0]&&r[1]<=i[1]&&n[1]>=o[1]&&r[2]<=i[2]&&n[2]>=o[2]},e.prototype.intersection=function(t){if(!this.intersects(t))return null;var n=new e,r=AQe([0,0,0],this.getMin(),t.getMin()),i=LQe([0,0,0],this.getMax(),t.getMax());return n.setMinMax(r,i),n},e.prototype.getNegativeFarPoint=function(t){return t.pnVertexFlag===273?kg([0,0,0],this.min):t.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:t.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},e.prototype.getPositiveFarPoint=function(t){return t.pnVertexFlag===273?kg([0,0,0],this.max):t.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:t.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},e}(),UQe=function(){function e(t,n){this.distance=t||0,this.normal=n||Un(0,1,0),this.updatePNVertexFlag()}return e.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)},e.prototype.distanceToPoint=function(t){return Wl(t,this.normal)-this.distance},e.prototype.normalize=function(){var t=1/mJ(this.normal);vN(this.normal,this.normal,t),this.distance*=t},e.prototype.intersectsLine=function(t,n,r){var i=this.distanceToPoint(t),o=this.distanceToPoint(n),a=i/(i-o),s=a>=0&&a<=1;return s&&r&&gN(r,t,n,a),s},e}(),Tf;(function(e){e[e.OUTSIDE=4294967295]="OUTSIDE",e[e.INSIDE=0]="INSIDE",e[e.INDETERMINATE=2147483647]="INDETERMINATE"})(Tf||(Tf={}));var qQe=function(){function e(t){if(this.planes=[],t)this.planes=t;else for(var n=0;n<6;n++)this.planes.push(new UQe)}return e.prototype.extractFromVPMatrix=function(t){var n=se(t,16),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],f=n[8],d=n[9],h=n[10],p=n[11],v=n[12],g=n[13],m=n[14],y=n[15];gl(this.planes[0].normal,a-r,u-s,p-f),this.planes[0].distance=y-v,gl(this.planes[1].normal,a+r,u+s,p+f),this.planes[1].distance=y+v,gl(this.planes[2].normal,a+i,u+l,p+d),this.planes[2].distance=y+g,gl(this.planes[3].normal,a-i,u-l,p-d),this.planes[3].distance=y-g,gl(this.planes[4].normal,a-o,u-c,p-h),this.planes[4].distance=y-m,gl(this.planes[5].normal,a+o,u+c,p+h),this.planes[5].distance=y+m,this.planes.forEach(function(x){x.normalize(),x.updatePNVertexFlag()})},e}(),So=function(){function e(t,n){t===void 0&&(t=0),n===void 0&&(n=0),this.x=0,this.y=0,this.x=t,this.y=n}return e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},e}(),_h=function(){function e(t,n,r,i){this.x=t,this.y=n,this.width=r,this.height=i,this.left=t,this.right=t+r,this.top=n,this.bottom=n+i}return e.prototype.toJSON=function(){},e}(),vr="Method not implemented.",Lg="Use document.documentElement instead.",GQe="Cannot append a destroyed element.",nr;(function(e){e[e.ORBITING=0]="ORBITING",e[e.EXPLORING=1]="EXPLORING",e[e.TRACKING=2]="TRACKING"})(nr||(nr={}));var rb;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ROTATIONAL=1]="ROTATIONAL",e[e.TRANSLATIONAL=2]="TRANSLATIONAL",e[e.CINEMATIC=3]="CINEMATIC"})(rb||(rb={}));var wa;(function(e){e[e.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",e[e.PERSPECTIVE=1]="PERSPECTIVE"})(wa||(wa={}));var lne={UPDATED:"updated"},cne=2e-4,une=function(){function e(){this.clipSpaceNearZ=Ng.NEGATIVE_ONE,this.eventEmitter=new dk,this.matrix=er(),this.right=Un(1,0,0),this.up=Un(0,1,0),this.forward=Un(0,0,1),this.position=Un(0,0,1),this.focalPoint=Un(0,0,0),this.distanceVector=Un(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=er(),this.projectionMatrixInverse=er(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=nr.EXPLORING,this.trackingMode=rb.DEFAULT,this.projectionMode=wa.PERSPECTIVE,this.frustum=new qQe,this.orthoMatrix=er()}return e.prototype.isOrtho=function(){return this.projectionMode===wa.ORTHOGRAPHIC},e.prototype.getProjectionMode=function(){return this.projectionMode},e.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.prototype.getFrustum=function(){return this.frustum},e.prototype.getPosition=function(){return this.position},e.prototype.getFocalPoint=function(){return this.focalPoint},e.prototype.getDollyingStep=function(){return this.dollyingStep},e.prototype.getNear=function(){return this.near},e.prototype.getFar=function(){return this.far},e.prototype.getZoom=function(){return this.zoom},e.prototype.getOrthoMatrix=function(){return this.orthoMatrix},e.prototype.getView=function(){return this.view},e.prototype.setEnableUpdate=function(t){this.enableUpdate=t},e.prototype.setType=function(t,n){return this.type=t,this.type===nr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===nr.TRACKING&&n!==void 0&&this.setTrackingMode(n),this},e.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},e.prototype.setTrackingMode=function(t){if(this.type!==nr.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},e.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.prototype.getViewTransform=function(){return vl(er(),this.matrix)},e.prototype.getWorldTransform=function(){return this.matrix},e.prototype.jitterProjectionMatrix=function(t,n){var r=yf(er(),[t,n,0]);this.jitteredProjectionMatrix=Do(er(),r,this.projectionMatrix)},e.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},e.prototype.setProjectionMatrix=function(t){this.projectionMatrix=t},e.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.prototype.setNear=function(t){return this.projectionMode===wa.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},e.prototype.setFar=function(t){return this.projectionMode===wa.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},e.prototype.setViewOffset=function(t,n,r,i,o,a){return this.aspect=t/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===wa.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.clearViewOffset=function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===wa.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===wa.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===wa.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.prototype.setZoomByViewportPoint=function(t,n){var r=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),i=r.x,o=r.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(i,o),this.setFocalPoint(i,o),this.setZoom(t),this.rotate(0,0,a);var s=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),l=s.x,c=s.y,u=Un(l-i,c-o,0),f=Wl(u,this.right)/Zc(this.right),d=Wl(u,this.up)/Zc(this.up),h=se(this.getPosition(),2),p=h[0],v=h[1],g=se(this.getFocalPoint(),2),m=g[0],y=g[1];return this.setPosition(p-f,v-d),this.setFocalPoint(m-f,y-d),this},e.prototype.setPerspective=function(t,n,r,i){var o;this.projectionMode=wa.PERSPECTIVE,this.fov=r,this.near=t,this.far=n,this.aspect=i;var a=this.near*Math.tan(pr(.5*this.fov))/this.zoom,s=2*a,l=this.aspect*s,c=-.5*l;if(!((o=this.view)===null||o===void 0)&&o.enabled){var u=this.view.fullWidth,f=this.view.fullHeight;c+=this.view.offsetX*l/u,a-=this.view.offsetY*s/f,l*=this.view.width/u,s*=this.view.height/f}return zQe(this.projectionMatrix,c,c+l,a-s,a,t,this.far,this.clipSpaceNearZ===Ng.ZERO),vl(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.prototype.setOrthographic=function(t,n,r,i,o,a){var s;this.projectionMode=wa.ORTHOGRAPHIC,this.rright=n,this.left=t,this.top=r,this.bottom=i,this.near=o,this.far=a;var l=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,f=(this.top+this.bottom)/2,d=u-l,h=u+l,p=f+c,v=f-c;if(!((s=this.view)===null||s===void 0)&&s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d+=g*this.view.offsetX,h=d+g*this.view.width,p-=m*this.view.offsetY,v=p-m*this.view.height}return this.clipSpaceNearZ===Ng.NEGATIVE_ONE?uJ(this.projectionMatrix,d,h,p,v,o,a):fJ(this.projectionMatrix,d,h,p,v,o,a),vl(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.prototype.setPosition=function(t,n,r){n===void 0&&(n=this.position[1]),r===void 0&&(r=this.position[2]);var i=ta(t,n,r);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.prototype.setFocalPoint=function(t,n,r){n===void 0&&(n=this.focalPoint[1]),r===void 0&&(r=this.focalPoint[2]);var i=Un(0,1,0);if(this.focalPoint=ta(t,n,r),this.trackingMode===rb.CINEMATIC){var o=pJ(Mn(),this.focalPoint,this.position);t=o[0],n=o[1],r=o[2];var a=Zc(o),s=$s(Math.asin(n/a)),l=90+$s(Math.atan2(r,t)),c=er();rJ(c,c,pr(l)),nJ(c,c,pr(s)),i=Zi(Mn(),[0,1,0],c)}return vl(this.matrix,dJ(er(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.prototype.getDistance=function(){return this.distance},e.prototype.getDistanceVector=function(){return this.distanceVector},e.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<cne&&(this.distance=cne),this.dollyingStep=this.distance/100;var n=Mn();t=this.distance;var r=this.forward,i=this.focalPoint;return n[0]=t*r[0]+i[0],n[1]=t*r[1]+i[1],n[2]=t*r[2]+i[2],this._setPosition(n),this.triggerUpdate(),this},e.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},e.prototype.setMinDistance=function(t){return this.minDistance=t,this},e.prototype.setAzimuth=function(t){return this.azimuth=Ag(t),this.computeMatrix(),this._getAxes(),this.type===nr.ORBITING||this.type===nr.EXPLORING?this._getPosition():this.type===nr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getAzimuth=function(){return this.azimuth},e.prototype.setElevation=function(t){return this.elevation=Ag(t),this.computeMatrix(),this._getAxes(),this.type===nr.ORBITING||this.type===nr.EXPLORING?this._getPosition():this.type===nr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getElevation=function(){return this.elevation},e.prototype.setRoll=function(t){return this.roll=Ag(t),this.computeMatrix(),this._getAxes(),this.type===nr.ORBITING||this.type===nr.EXPLORING?this._getPosition():this.type===nr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getRoll=function(){return this.roll},e.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},e.prototype.computeMatrix=function(){var t=Sf(Ii(),[0,0,1],pr(this.roll));fh(this.matrix);var n=Sf(Ii(),[1,0,0],pr((this.rotateWorld&&this.type!==nr.TRACKING||this.type===nr.TRACKING?1:-1)*this.elevation)),r=Sf(Ii(),[0,1,0],pr((this.rotateWorld&&this.type!==nr.TRACKING||this.type===nr.TRACKING?1:-1)*this.azimuth)),i=wf(Ii(),r,n);i=wf(Ii(),i,t);var o=hN(er(),i);this.type===nr.ORBITING||this.type===nr.EXPLORING?(hg(this.matrix,this.matrix,this.focalPoint),Do(this.matrix,this.matrix,o),hg(this.matrix,this.matrix,[0,0,this.distance])):this.type===nr.TRACKING&&(hg(this.matrix,this.matrix,this.position),Do(this.matrix,this.matrix,o))},e.prototype._setPosition=function(t,n,r){this.position=ta(t,n,r);var i=this.matrix;i[12]=this.position[0],i[13]=this.position[1],i[14]=this.position[2],i[15]=1,this._getOrthoMatrix()},e.prototype._getAxes=function(){xf(this.right,ta(mg(gg(),[1,0,0,0],this.matrix))),xf(this.up,ta(mg(gg(),[0,1,0,0],this.matrix))),xf(this.forward,ta(mg(gg(),[0,0,1,0],this.matrix))),dh(this.right,this.right),dh(this.up,this.up),dh(this.forward,this.forward)},e.prototype._getAngles=function(){var t=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=Zc(this.distanceVector);if(i===0){this.elevation=0,this.azimuth=0;return}this.type===nr.TRACKING?(this.elevation=$s(Math.asin(n/i)),this.azimuth=$s(Math.atan2(-t,-r))):this.rotateWorld?(this.elevation=$s(Math.asin(n/i)),this.azimuth=$s(Math.atan2(-t,-r))):(this.elevation=-$s(Math.asin(n/i)),this.azimuth=-$s(Math.atan2(-t,-r)))},e.prototype._getPosition=function(){xf(this.position,ta(mg(gg(),[0,0,0,1],this.matrix))),this._getDistance()},e.prototype._getFocalPoint=function(){vJ(this.distanceVector,[0,0,-this.distance],IGe(fg(),this.matrix)),vg(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e.prototype._getDistance=function(){this.distanceVector=pJ(Mn(),this.focalPoint,this.position),this.distance=Zc(this.distanceVector),this.dollyingStep=this.distance/100},e.prototype._getOrthoMatrix=function(){if(this.projectionMode===wa.ORTHOGRAPHIC){var t=this.position,n=Sf(Ii(),[0,0,1],-this.roll*Math.PI/180);$1(this.orthoMatrix,n,Un((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Un(this.zoom,this.zoom,1),t)}},e.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),n=Do(er(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(n),this.eventEmitter.emit(lne.UPDATED)}},e.prototype.rotate=function(t,n,r){throw new Error(vr)},e.prototype.pan=function(t,n){throw new Error(vr)},e.prototype.dolly=function(t){throw new Error(vr)},e.prototype.createLandmark=function(t,n){throw new Error(vr)},e.prototype.gotoLandmark=function(t,n){throw new Error(vr)},e.prototype.cancelLandmarkAnimation=function(){throw new Error(vr)},e}();function wo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=e.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(wo.Cache||Map),n}wo.Cache=Map;var St;(function(e){e[e.kUnknown=0]="kUnknown",e[e.kNumber=1]="kNumber",e[e.kPercentage=2]="kPercentage",e[e.kEms=3]="kEms",e[e.kPixels=4]="kPixels",e[e.kRems=5]="kRems",e[e.kDegrees=6]="kDegrees",e[e.kRadians=7]="kRadians",e[e.kGradians=8]="kGradians",e[e.kTurns=9]="kTurns",e[e.kMilliseconds=10]="kMilliseconds",e[e.kSeconds=11]="kSeconds",e[e.kInteger=12]="kInteger"})(St||(St={}));var Ja;(function(e){e[e.kUNumber=0]="kUNumber",e[e.kUPercent=1]="kUPercent",e[e.kULength=2]="kULength",e[e.kUAngle=3]="kUAngle",e[e.kUTime=4]="kUTime",e[e.kUOther=5]="kUOther"})(Ja||(Ja={}));var fne;(function(e){e[e.kAll=0]="kAll",e[e.kNonNegative=1]="kNonNegative",e[e.kInteger=2]="kInteger",e[e.kNonNegativeInteger=3]="kNonNegativeInteger",e[e.kPositiveInteger=4]="kPositiveInteger"})(fne||(fne={}));var wk;(function(e){e[e.kYes=0]="kYes",e[e.kNo=1]="kNo"})(wk||(wk={}));var Ck;(function(e){e[e.kYes=0]="kYes",e[e.kNo=1]="kNo"})(Ck||(Ck={}));var KQe=[{name:"em",unit_type:St.kEms},{name:"px",unit_type:St.kPixels},{name:"deg",unit_type:St.kDegrees},{name:"rad",unit_type:St.kRadians},{name:"grad",unit_type:St.kGradians},{name:"ms",unit_type:St.kMilliseconds},{name:"s",unit_type:St.kSeconds},{name:"rem",unit_type:St.kRems},{name:"turn",unit_type:St.kTurns}],If;(function(e){e[e.kUnknownType=0]="kUnknownType",e[e.kUnparsedType=1]="kUnparsedType",e[e.kKeywordType=2]="kKeywordType",e[e.kUnitType=3]="kUnitType",e[e.kSumType=4]="kSumType",e[e.kProductType=5]="kProductType",e[e.kNegateType=6]="kNegateType",e[e.kInvertType=7]="kInvertType",e[e.kMinType=8]="kMinType",e[e.kMaxType=9]="kMaxType",e[e.kClampType=10]="kClampType",e[e.kTransformType=11]="kTransformType",e[e.kPositionType=12]="kPositionType",e[e.kURLImageType=13]="kURLImageType",e[e.kColorType=14]="kColorType",e[e.kUnsupportedColorType=15]="kUnsupportedColorType"})(If||(If={}));var YQe=function(e){return KQe.find(function(t){return t.name===e}).unit_type},XQe=function(e){return e?e==="number"?St.kNumber:e==="percent"||e==="%"?St.kPercentage:YQe(e):St.kUnknown},ZQe=function(e){switch(e){case St.kNumber:case St.kInteger:return Ja.kUNumber;case St.kPercentage:return Ja.kUPercent;case St.kPixels:return Ja.kULength;case St.kMilliseconds:case St.kSeconds:return Ja.kUTime;case St.kDegrees:case St.kRadians:case St.kGradians:case St.kTurns:return Ja.kUAngle;default:return Ja.kUOther}},QQe=function(e){switch(e){case Ja.kUNumber:return St.kNumber;case Ja.kULength:return St.kPixels;case Ja.kUPercent:return St.kPercentage;case Ja.kUTime:return St.kSeconds;case Ja.kUAngle:return St.kDegrees;default:return St.kUnknown}},dne=function(e){var t=1;switch(e){case St.kPixels:case St.kDegrees:case St.kSeconds:break;case St.kMilliseconds:t=.001;break;case St.kRadians:t=180/Math.PI;break;case St.kGradians:t=.9;break;case St.kTurns:t=360;break}return t},Ok=function(e){switch(e){case St.kNumber:case St.kInteger:return"";case St.kPercentage:return"%";case St.kEms:return"em";case St.kRems:return"rem";case St.kPixels:return"px";case St.kDegrees:return"deg";case St.kRadians:return"rad";case St.kGradians:return"grad";case St.kMilliseconds:return"ms";case St.kSeconds:return"s";case St.kTurns:return"turn"}return""},cE=function(){function e(){}return e.isAngle=function(t){return t===St.kDegrees||t===St.kRadians||t===St.kGradians||t===St.kTurns},e.isLength=function(t){return t>=St.kEms&&t<St.kDegrees},e.isRelativeUnit=function(t){return t===St.kPercentage||t===St.kEms||t===St.kRems},e.isTime=function(t){return t===St.kSeconds||t===St.kMilliseconds},e.prototype.toString=function(){return this.buildCSSText(wk.kNo,Ck.kNo,"")},e.prototype.isNumericValue=function(){return this.getType()>=If.kUnitType&&this.getType()<=If.kClampType},e}(),JQe=function(e){Nt(t,e);function t(n){var r=e.call(this)||this;return r.colorSpace=n,r}return t.prototype.getType=function(){return If.kColorType},t.prototype.to=function(n){return this},t}(cE),Yl;(function(e){e[e.Constant=0]="Constant",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient"})(Yl||(Yl={}));var uE=function(e){Nt(t,e);function t(n,r){var i=e.call(this)||this;return i.type=n,i.value=r,i}return t.prototype.clone=function(){return new t(this.type,this.value)},t.prototype.buildCSSText=function(n,r,i){return i},t.prototype.getType=function(){return If.kColorType},t}(cE),Ca=function(e){Nt(t,e);function t(n){var r=e.call(this)||this;return r.value=n,r}return t.prototype.clone=function(){return new t(this.value)},t.prototype.getType=function(){return If.kKeywordType},t.prototype.buildCSSText=function(n,r,i){return i+this.value},t}(cE),eJe=wo(function(e){return e===void 0&&(e=""),e.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}),hne=function(e){return e.split("").map(function(t,n){return t.toUpperCase()===t?"".concat(n!==0?"-":"").concat(t.toLowerCase()):t}).join("")};function tJe(e){if(!e)throw new Error}function jg(e){return typeof e=="function"}function nJe(e){return typeof e=="symbol"}var rJe={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Ek=wo(function(e){var t=eJe(e),n=rJe[t];return t=(n==null?void 0:n.alias)||t,t}),iJe=function(e,t){t===void 0&&(t="");var n="";return Number.isFinite(e)?(tJe(Number.isNaN(e)),n="NaN"):e>0?n="infinity":n="-infinity",n+=t},_k=function(e){return QQe(ZQe(e))},gr=function(e){Nt(t,e);function t(n,r){r===void 0&&(r=St.kNumber);var i=e.call(this)||this,o;return typeof r=="string"?o=XQe(r):o=r,i.unit=o,i.value=n,i}return t.prototype.clone=function(){return new t(this.value,this.unit)},t.prototype.equals=function(n){var r=n;return this.value===r.value&&this.unit===r.unit},t.prototype.getType=function(){return If.kUnitType},t.prototype.convertTo=function(n){if(this.unit===n)return new t(this.value,this.unit);var r=_k(this.unit);if(r!==_k(n)||r===St.kUnknown)return null;var i=dne(this.unit)/dne(n);return new t(this.value*i,n)},t.prototype.buildCSSText=function(n,r,i){var o;switch(this.unit){case St.kUnknown:break;case St.kInteger:o=Number(this.value).toFixed(0);break;case St.kNumber:case St.kPercentage:case St.kEms:case St.kRems:case St.kPixels:case St.kDegrees:case St.kRadians:case St.kGradians:case St.kMilliseconds:case St.kSeconds:case St.kTurns:{var a=-999999,s=999999,l=this.value,c=Ok(this.unit);if(l<a||l>s){var u=Ok(this.unit);!Number.isFinite(l)||Number.isNaN(l)?o=iJe(l,u):o=l+(u||"")}else o="".concat(l).concat(c)}}return i+=o,i},t}(cE),gi=new gr(0,"px");new gr(1,"px");var Ps=new gr(0,"deg"),$k=function(e){Nt(t,e);function t(n,r,i,o,a){o===void 0&&(o=1),a===void 0&&(a=!1);var s=e.call(this,"rgb")||this;return s.r=n,s.g=r,s.b=i,s.alpha=o,s.isNone=a,s}return t.prototype.clone=function(){return new t(this.r,this.g,this.b,this.alpha)},t.prototype.buildCSSText=function(n,r,i){return i+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},t}(JQe),Ar=new Ca("unset"),oJe=new Ca("initial"),aJe=new Ca("inherit"),Pk={"":Ar,unset:Ar,initial:oJe,inherit:aJe},Mk=function(e){return Pk[e]||(Pk[e]=new Ca(e)),Pk[e]},fE=new $k(0,0,0,0,!0),pne=new $k(0,0,0,0),sJe=wo(function(e,t,n,r){return new $k(e,t,n,r)},function(e,t,n,r){return"rgba(".concat(e,",").concat(t,",").concat(n,",").concat(r,")")}),Cr=function(e,t){return t===void 0&&(t=St.kNumber),new gr(e,t)};new gr(50,"%");var Tk;(function(e){e[e.Standard=0]="Standard"})(Tk||(Tk={}));var Dg;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"})(Dg||(Dg={}));var vne={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new _h(0,0,0,0)},Pt;(function(e){e.COORDINATE="<coordinate>",e.COLOR="<color>",e.PAINT="<paint>",e.NUMBER="<number>",e.ANGLE="<angle>",e.OPACITY_VALUE="<opacity-value>",e.SHADOW_BLUR="<shadow-blur>",e.LENGTH="<length>",e.PERCENTAGE="<percentage>",e.LENGTH_PERCENTAGE="<length> | <percentage>",e.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",e.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",e.LIST_OF_POINTS="<list-of-points>",e.PATH="<path>",e.FILTER="<filter>",e.Z_INDEX="<z-index>",e.OFFSET_DISTANCE="<offset-distance>",e.DEFINED_PATH="<defined-path>",e.MARKER="<marker>",e.TRANSFORM="<transform>",e.TRANSFORM_ORIGIN="<transform-origin>",e.TEXT="<text>",e.TEXT_TRANSFORM="<text-transform>"})(Pt||(Pt={}));function lJe(e){var t=e.type,n=e.value;return t==="hex"?"#".concat(n):t==="literal"?n:t==="rgb"?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}var cJe=function(){var e={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n(k){throw new Error(t+": "+k)}function r(){var k=i();return t.length>0&&n("Invalid input not EOF"),k}function i(){return x(o)}function o(){return a("linear-gradient",e.linearGradient,l)||a("repeating-linear-gradient",e.repeatingLinearGradient,l)||a("radial-gradient",e.radialGradient,f)||a("repeating-radial-gradient",e.repeatingRadialGradient,f)||a("conic-gradient",e.conicGradient,f)}function a(k,A,j){return s(A,function(D){var L=j();return L&&(R(e.comma)||n("Missing comma before color stops")),{type:k,orientation:L,colorStops:x(S)}})}function s(k,A){var j=R(k);if(j){R(e.startCall)||n("Missing (");var D=A(j);return R(e.endCall)||n("Missing )"),D}}function l(){return c()||u()}function c(){return M("directional",e.sideOrCorner,1)}function u(){return M("angular",e.angleValue,1)}function f(){var k,A=d(),j;return A&&(k=[],k.push(A),j=t,R(e.comma)&&(A=d(),A?k.push(A):t=j)),k}function d(){var k=h()||p();if(k)k.at=g();else{var A=v();if(A){k=A;var j=g();j&&(k.at=j)}else{var D=m();D&&(k={type:"default-radial",at:D})}}return k}function h(){var k=M("shape",/^(circle)/i,0);return k&&(k.style=I()||v()),k}function p(){var k=M("shape",/^(ellipse)/i,0);return k&&(k.style=P()||v()),k}function v(){return M("extent-keyword",e.extentKeywords,1)}function g(){if(M("position",/^at/,0)){var k=m();return k||n("Missing positioning value"),k}}function m(){var k=y();if(k.x||k.y)return{type:"position",value:k}}function y(){return{x:P(),y:P()}}function x(k){var A=k(),j=[];if(A)for(j.push(A);R(e.comma);)A=k(),A?j.push(A):n("One extra comma");return j}function S(){var k=w();return k||n("Expected color definition"),k.length=P(),k}function w(){return O()||_()||E()||C()}function C(){return M("literal",e.literalColor,0)}function O(){return M("hex",e.hexColor,1)}function E(){return s(e.rgbColor,function(){return{type:"rgb",value:x($)}})}function _(){return s(e.rgbaColor,function(){return{type:"rgba",value:x($)}})}function $(){return R(e.number)[1]}function P(){return M("%",e.percentageValue,1)||T()||I()}function T(){return M("position-keyword",e.positionKeywords,1)}function I(){return M("px",e.pixelValue,1)||M("em",e.emValue,1)}function M(k,A,j){var D=R(A);if(D)return{type:k,value:D[j]}}function R(k){var A=/^[\n\r\t\s]+/.exec(t);A&&N(A[0].length);var j=k.exec(t);return j&&N(j[0].length),j}function N(k){t=t.substring(k)}return function(k){return t=k,r()}}();function uJe(e,t,n,r){var i=pr(r.value),o=0,a=0,s=o+t/2,l=a+n/2,c=Math.abs(t*Math.cos(i))+Math.abs(n*Math.sin(i)),u=e[0]+s-Math.cos(i)*c/2,f=e[1]+l-Math.sin(i)*c/2,d=e[0]+s+Math.cos(i)*c/2,h=e[1]+l+Math.sin(i)*c/2;return{x1:u,y1:f,x2:d,y2:h}}function fJe(e,t,n,r,i,o){var a=r.value,s=i.value;r.unit===St.kPercentage&&(a=r.value/100*t),i.unit===St.kPercentage&&(s=i.value/100*n);var l=Math.max(xa([0,0],[a,s]),xa([0,n],[a,s]),xa([t,n],[a,s]),xa([t,0],[a,s]));return o&&(o instanceof gr?l=o.value:o instanceof Ca&&(o.value==="closest-side"?l=Math.min(a,t-a,s,n-s):o.value==="farthest-side"?l=Math.max(a,t-a,s,n-s):o.value==="closest-corner"&&(l=Math.min(xa([0,0],[a,s]),xa([0,n],[a,s]),xa([t,n],[a,s]),xa([t,0],[a,s]))))),{x:a+e[0],y:s+e[1],r:l}}var dJe=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,hJe=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,pJe=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,gne=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function vJe(e){var t,n,r,i=e.length;e[i-1].length=(t=e[i-1].length)!==null&&t!==void 0?t:{type:"%",value:"100"},i>1&&(e[0].length=(n=e[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"});for(var o=0,a=Number(e[0].length.value),s=1;s<i;s++){var l=(r=e[s].length)===null||r===void 0?void 0:r.value;if(!hn(l)&&!hn(a)){for(var c=1;c<s-o;c++)e[o+c].length={type:"%",value:"".concat(a+(Number(l)-a)*c/(s-o))};o=s,a=Number(l)}}}var gJe={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},mJe=wo(function(e){var t;return e.type==="angular"?t=Number(e.value):t=gJe[e.value]||0,Cr(t,"deg")}),yJe=wo(function(e){var t=50,n=50,r="%",i="%";if((e==null?void 0:e.type)==="position"){var o=e.value,a=o.x,s=o.y;(a==null?void 0:a.type)==="position-keyword"&&(a.value==="left"?t=0:a.value==="center"?t=50:a.value==="right"?t=100:a.value==="top"?n=0:a.value==="bottom"&&(n=100)),(s==null?void 0:s.type)==="position-keyword"&&(s.value==="left"?t=0:s.value==="center"?n=50:s.value==="right"?t=100:s.value==="top"?n=0:s.value==="bottom"&&(n=100)),((a==null?void 0:a.type)==="px"||(a==null?void 0:a.type)==="%"||(a==null?void 0:a.type)==="em")&&(r=a==null?void 0:a.type,t=Number(a.value)),((s==null?void 0:s.type)==="px"||(s==null?void 0:s.type)==="%"||(s==null?void 0:s.type)==="em")&&(i=s==null?void 0:s.type,n=Number(s.value))}return{cx:Cr(t,r),cy:Cr(n,i)}}),bJe=wo(function(e){var t;if(e.indexOf("linear")>-1||e.indexOf("radial")>-1){var n=cJe(e);return n.map(function(s){var l=s.type,c=s.orientation,u=s.colorStops;vJe(u);var f=u.map(function(x){return{offset:Cr(Number(x.length.value),"%"),color:lJe(x)}});if(l==="linear-gradient")return new uE(Yl.LinearGradient,{angle:c?mJe(c):Ps,steps:f});if(l==="radial-gradient"&&(c||(c=[{type:"shape",value:"circle"}]),c[0].type==="shape"&&c[0].value==="circle")){var d=yJe(c[0].at),h=d.cx,p=d.cy,v=void 0;if(c[0].style){var g=c[0].style,m=g.type,y=g.value;m==="extent-keyword"?v=Mk(y):v=Cr(y,m)}return new uE(Yl.RadialGradient,{cx:h,cy:p,size:v,steps:f})}})}var r=e[0];if(e[1]==="("||e[2]==="("){if(r==="l"){var i=dJe.exec(e);if(i){var o=((t=i[2].match(gne))===null||t===void 0?void 0:t.map(function(s){return s.split(":")}))||[];return[new uE(Yl.LinearGradient,{angle:Cr(parseFloat(i[1]),"deg"),steps:o.map(function(s){var l=se(s,2),c=l[0],u=l[1];return{offset:Cr(Number(c)*100,"%"),color:u}})})]}}else if(r==="r"){var a=xJe(e);if(a)if(Wr(a))e=a;else return[new uE(Yl.RadialGradient,a)]}else if(r==="p")return SJe(e)}});function xJe(e){var t,n=hJe.exec(e);if(n){var r=((t=n[4].match(gne))===null||t===void 0?void 0:t.map(function(i){return i.split(":")}))||[];return{cx:Cr(50,"%"),cy:Cr(50,"%"),steps:r.map(function(i){var o=se(i,2),a=o[0],s=o[1];return{offset:Cr(Number(a)*100,"%"),color:s}})}}return null}function SJe(e){var t=pJe.exec(e);if(t){var n=t[1],r=t[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;case"n":n="no-repeat";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}function ib(e){return e&&!!e.image}function dE(e){return e&&!hn(e.r)&&!hn(e.g)&&!hn(e.b)}var tu=wo(function(e){if(ib(e))return ke({repetition:"repeat"},e);if(hn(e)&&(e=""),e==="transparent")return pne;if(e==="currentColor")e="black";else if(e==="none")return fE;var t=bJe(e);if(t)return t;var n=rE(e),r=[0,0,0,0];return n!==null&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),sJe.apply(void 0,it([],se(r),!1))});function wJe(e,t){if(!(!dE(e)||!dE(t)))return[[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(n){var r=n.slice();if(r[3])for(var i=0;i<3;i++)r[i]=Math.round(ai(r[i],0,255));return r[3]=ai(r[3],0,1),"rgba(".concat(r.join(","),")")}]}function ob(e,t){if(hn(t))return Cr(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(e)>=0)return Cr(Number(t),"px");if("deg".search(e)>=0)return Cr(Number(t),"deg")}var n=[];t=t.replace(e,function(i){return n.push(i),"U"+i});var r="U("+e.source+")";return n.map(function(i){return Cr(Number(t.replace(new RegExp("U"+i,"g"),"").replace(new RegExp(r,"g"),"*0")),i)})[0]}var mne=function(e){return ob(new RegExp("px","g"),e)},CJe=wo(mne),OJe=function(e){return ob(new RegExp("%","g"),e)};wo(OJe);var ab=function(e){return _r(e)||isFinite(Number(e))?Cr(Number(e)||0,"px"):ob(new RegExp("px|%|em|rem","g"),e)},Fg=wo(ab),Ik=function(e){return ob(new RegExp("deg|rad|grad|turn","g"),e)},yne=wo(Ik);function EJe(e,t,n,r,i){i===void 0&&(i=0);var o="",a=e.value||0,s=t.value||0,l=_k(e.unit),c=e.convertTo(l),u=t.convertTo(l);return c&&u?(a=c.value,s=u.value,o=Ok(e.unit)):(gr.isLength(e.unit)||gr.isLength(t.unit))&&(a=es(e,i,n),s=es(t,i,n),o="px"),[a,s,function(f){return f+o}]}function Oa(e){var t=0;return e.unit===St.kDegrees?t=e.value:e.unit===St.kRadians?t=$s(Number(e.value)):e.unit===St.kTurns&&(t=jQe(Number(e.value))),t}function bne(e,t){var n;return Array.isArray(e)?n=e.map(function(r){return Number(r)}):Wr(e)?n=e.split(" ").map(function(r){return Number(r)}):_r(e)&&(n=[e]),t===2?n.length===1?[n[0],n[0]]:[n[0],n[1]]:n.length===1?[n[0],n[0],n[0],n[0]]:n.length===2?[n[0],n[1],n[0],n[1]]:n.length===3?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function xne(e){return Wr(e)?e.split(" ").map(function(t){return Fg(t)}):e.map(function(t){return Fg(t.toString())})}function es(e,t,n,r){if(r===void 0&&(r=!1),e.unit===St.kPixels)return Number(e.value);if(e.unit===St.kPercentage&&n){var i=n.nodeName===Ze.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[t]:0)+e.value/100*i.halfExtents[t]*2}return 0}var _Je=function(e){return ob(/deg|rad|grad|turn|px|%/g,e)},$Je=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Sne(e){if(e===void 0&&(e=""),e=e.toLowerCase().trim(),e==="none")return[];for(var t=/\s*([\w-]+)\(([^)]*)\)/g,n=[],r,i=0;r=t.exec(e);){if(r.index!==i)return[];if(i=r.index+r[0].length,$Je.indexOf(r[1])>-1&&n.push({name:r[1],params:r[2].split(" ").map(function(o){return _Je(o)||tu(o)})}),t.lastIndex===e.length)return n}return[]}function wne(e){return e.toString()}var Bg=function(e){return typeof e=="number"?Cr(e):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(e)?Cr(Number(e)):Cr(0)},$h=wo(Bg);wo(function(e){return Wr(e)?e.split(" ").map($h):e.map($h)});function Rk(e,t){return[e,t,wne]}function Nk(e,t){return function(n,r){return[n,r,function(i){return wne(ai(i,e,t))}]}}function Cne(e,t){if(e.length===t.length)return[e,t,function(n){return n}]}function kk(e){return e.parsedStyle.d.totalLength===0&&(e.parsedStyle.d.totalLength=zKe(e.parsedStyle.d.absolutePath)),e.parsedStyle.d.totalLength}function PJe(e){return e.parsedStyle.points.totalLength===0&&(e.parsedStyle.points.totalLength=PQe(e.parsedStyle.points.points)),e.parsedStyle.points.totalLength}function MJe(e){for(var t=0;t<e.length;t++){var n=e[t-1],r=e[t],i=r[0];if(i==="M"&&n){var o=n[0],a=[r[1],r[2]],s=void 0;o==="L"||o==="M"?s=[n[1],n[2]]:(o==="C"||o==="A"||o==="Q")&&(s=[n[n.length-2],n[n.length-1]]),s&&hE(a,s)&&(e.splice(t,1),t--)}}}function TJe(e){for(var t=!1,n=e.length,r=0;r<n;r++){var i=e[r],o=i[0];if(o==="C"||o==="A"||o==="Q"){t=!0;break}}return t}function IJe(e){for(var t=[],n=[],r=[],i=0;i<e.length;i++){var o=e[i],a=o[0];a==="M"?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):a==="Z"?r.length&&(t.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:t,polylines:n}}function hE(e,t){return e[0]===t[0]&&e[1]===t[1]}function RJe(e,t){for(var n=[],r=[],i=[],o=0;o<e.length;o++){var a=e[o],s=a.currentPoint,l=a.params,c=a.prePoint,u=void 0;switch(a.command){case"Q":u=MQe(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=EQe(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var f=a.arcParams;u=wQe(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1]);break}u&&(a.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height))}n=n.filter(function(m){return!Number.isNaN(m)&&m!==1/0&&m!==-1/0}),r=r.filter(function(m){return!Number.isNaN(m)&&m!==1/0&&m!==-1/0});var d=vO(n),h=vO(r),p=pO(n),v=pO(r);if(i.length===0)return{x:d,y:h,width:p-d,height:v-h};for(var o=0;o<i.length;o++){var a=i[o],s=a.currentPoint,g=void 0;s[0]===d?(g=pE(a,t),d=d-g.xExtra):s[0]===p&&(g=pE(a,t),p=p+g.xExtra),s[1]===h?(g=pE(a,t),h=h-g.yExtra):s[1]===v&&(g=pE(a,t),v=v+g.yExtra)}return{x:d,y:h,width:p-d,height:v-h}}function pE(e,t){var n=e.prePoint,r=e.currentPoint,i=e.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),l=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!l||Math.sin(l)===0||O1(l,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));c=c>Math.PI/2?Math.PI-c:c,u=u>Math.PI/2?Math.PI-u:u;var f={xExtra:Math.cos(l/2-c)*(t/2*(1/Math.sin(l/2)))-t/2||0,yExtra:Math.cos(u-l/2)*(t/2*(1/Math.sin(l/2)))-t/2||0};return f}function One(e,t){return[t[0]+(t[0]-e[0]),t[1]+(t[1]-e[1])]}var Ene=function(e,t){var n=e.x*t.x+e.y*t.y,r=Math.sqrt((Math.pow(e.x,2)+Math.pow(e.y,2))*(Math.pow(t.x,2)+Math.pow(t.y,2))),i=e.x*t.y-e.y*t.x<0?-1:1,o=i*Math.acos(n/r);return o},_ne=function(e,t,n,r,i,o,a,s){t=Math.abs(t),n=Math.abs(n),r=UQ(r,360);var l=pr(r);if(e.x===a.x&&e.y===a.y)return{x:e.x,y:e.y,ellipticalArcAngle:0};if(t===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var c=(e.x-a.x)/2,u=(e.y-a.y)/2,f={x:Math.cos(l)*c+Math.sin(l)*u,y:-Math.sin(l)*c+Math.cos(l)*u},d=Math.pow(f.x,2)/Math.pow(t,2)+Math.pow(f.y,2)/Math.pow(n,2);d>1&&(t=Math.sqrt(d)*t,n=Math.sqrt(d)*n);var h=Math.pow(t,2)*Math.pow(n,2)-Math.pow(t,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2),p=Math.pow(t,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2),v=h/p;v=v<0?0:v;var g=(i!==o?1:-1)*Math.sqrt(v),m={x:g*(t*f.y/n),y:g*(-(n*f.x)/t)},y={x:Math.cos(l)*m.x-Math.sin(l)*m.y+(e.x+a.x)/2,y:Math.sin(l)*m.x+Math.cos(l)*m.y+(e.y+a.y)/2},x={x:(f.x-m.x)/t,y:(f.y-m.y)/n},S=Ene({x:1,y:0},x),w={x:(-f.x-m.x)/t,y:(-f.y-m.y)/n},C=Ene(x,w);!o&&C>0?C-=2*Math.PI:o&&C<0&&(C+=2*Math.PI),C%=2*Math.PI;var O=S+C*s,E=t*Math.cos(O),_=n*Math.sin(O),$={x:Math.cos(l)*E-Math.sin(l)*_+y.x,y:Math.sin(l)*E+Math.cos(l)*_+y.y,ellipticalArcStartAngle:S,ellipticalArcEndAngle:S+C,ellipticalArcAngle:O,ellipticalArcCenter:y,resultantRx:t,resultantRy:n};return $};function NJe(e){for(var t=[],n=null,r=null,i=null,o=0,a=e.length,s=0;s<a;s++){var l=e[s];r=e[s+1];var c=l[0],u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],o=s;break;case"A":var f=kJe(n,l);u.arcParams=f;break}if(c==="Z")n=i,r=e[o+1];else{var d=l.length;n=[l[d-2],l[d-1]]}r&&r[0]==="Z"&&(r=e[o],t[o]&&(t[o].prePoint=n)),u.currentPoint=n,t[o]&&hE(n,t[o].currentPoint)&&(t[o].prePoint=u.prePoint);var h=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=h;var p=u.prePoint;if(["L","H","V"].includes(c))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if(c==="Q"){var v=[l[1],l[2]];u.startTangent=[p[0]-v[0],p[1]-v[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]]}else if(c==="T"){var g=t[s-1],v=One(g.currentPoint,p);g.command==="Q"?(u.command="Q",u.startTangent=[p[0]-v[0],p[1]-v[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if(c==="C"){var m=[l[1],l[2]],y=[l[3],l[4]];u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]],u.startTangent[0]===0&&u.startTangent[1]===0&&(u.startTangent=[m[0]-y[0],m[1]-y[1]]),u.endTangent[0]===0&&u.endTangent[1]===0&&(u.endTangent=[y[0]-m[0],y[1]-m[1]])}else if(c==="S"){var g=t[s-1],m=One(g.currentPoint,p),y=[l[1],l[2]];g.command==="C"?(u.command="C",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]]):(u.command="SQ",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]])}else if(c==="A"){var x=$ne(u,0),S=x.x,w=x.y,C=$ne(u,1,!1),O=C.x,E=C.y;u.startTangent=[S,w],u.endTangent=[O,E]}t.push(u)}return t}function $ne(e,t,n){n===void 0&&(n=!0);var r=e.arcParams,i=r.rx,o=i===void 0?0:i,a=r.ry,s=a===void 0?0:a,l=r.xRotation,c=r.arcFlag,u=r.sweepFlag,f=_ne({x:e.prePoint[0],y:e.prePoint[1]},o,s,l,!!c,!!u,{x:e.currentPoint[0],y:e.currentPoint[1]},t),d=_ne({x:e.prePoint[0],y:e.prePoint[1]},o,s,l,!!c,!!u,{x:e.currentPoint[0],y:e.currentPoint[1]},n?t+.005:t-.005),h=d.x-f.x,p=d.y-f.y,v=Math.sqrt(h*h+p*p);return{x:-h/v,y:-p/v}}function vE(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Ak(e,t){return vE(e)*vE(t)?(e[0]*t[0]+e[1]*t[1])/(vE(e)*vE(t)):1}function Pne(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Ak(e,t))}function kJe(e,t){var n=t[1],r=t[2],i=UQ(pr(t[3]),Math.PI*2),o=t[4],a=t[5],s=e[0],l=e[1],c=t[6],u=t[7],f=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-u)/2,d=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-u)/2,h=f*f/(n*n)+d*d/(r*r);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var p=n*n*(d*d)+r*r*(f*f),v=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(v*=-1),isNaN(v)&&(v=0);var g=r?v*n*d/r:0,m=n?v*-r*f/n:0,y=(s+c)/2+Math.cos(i)*g-Math.sin(i)*m,x=(l+u)/2+Math.sin(i)*g+Math.cos(i)*m,S=[(f-g)/n,(d-m)/r],w=[(-1*f-g)/n,(-1*d-m)/r],C=Pne([1,0],S),O=Pne(S,w);return Ak(S,w)<=-1&&(O=Math.PI),Ak(S,w)>=1&&(O=0),a===0&&O>0&&(O=O-2*Math.PI),a===1&&O<0&&(O=O+2*Math.PI),{cx:y,cy:x,rx:hE(e,[c,u])?0:n,ry:hE(e,[c,u])?0:r,startAngle:C,endAngle:C+O,xRotation:i,arcFlag:o,sweepFlag:a}}function AJe(e,t,n){return e.reduce(function(r,i){var o="";if(i[0]==="M"||i[0]==="L"){var a=Un(i[1],i[2],0);n&&Zi(a,a,n),o="".concat(i[0]).concat(a[0],",").concat(a[1])}else if(i[0]==="Z")o=i[0];else if(i[0]==="C"){var s=Un(i[1],i[2],0),l=Un(i[3],i[4],0),c=Un(i[5],i[6],0);n&&(Zi(s,s,n),Zi(l,l,n),Zi(c,c,n)),o="".concat(i[0]).concat(s[0],",").concat(s[1],",").concat(l[0],",").concat(l[1],",").concat(c[0],",").concat(c[1])}else if(i[0]==="A"){var u=Un(i[6],i[7],0);n&&Zi(u,u,n),o="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],",").concat(i[5],",").concat(u[0],",").concat(u[1])}else if(i[0]==="Q"){var s=Un(i[1],i[2],0),l=Un(i[3],i[4],0);n&&(Zi(s,s,n),Zi(l,l,n)),o="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],"}")}return r+=o},"")}function LJe(e,t,n,r){return[["M",e,t],["L",n,r]]}function Mne(e,t,n,r){var i=(-1+Math.sqrt(2))/3*4,o=e*i,a=t*i,s=n-e,l=n+e,c=r-t,u=r+t;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,l,r-a,l,r],["C",l,r+a,n+o,u,n,u],["C",n-o,u,s,r+a,s,r],["Z"]]}function jJe(e,t){var n=e.map(function(r,i){return[i===0?"M":"L",r[0],r[1]]});return t&&n.push(["Z"]),n}function DJe(e,t,n,r,i){if(i){var o=se(i,4),a=o[0],s=o[1],l=o[2],c=o[3],u=e>0?1:-1,f=t>0?1:-1,d=u+f!==0?1:0;return[["M",u*a+n,r],["L",e-u*s+n,r],s?["A",s,s,0,0,d,e+n,f*s+r]:null,["L",e+n,t-f*l+r],l?["A",l,l,0,0,d,e+n-u*l,t+r]:null,["L",n+u*c,t+r],c?["A",c,c,0,0,d,n,t+r-f*c]:null,["L",n,f*a+r],a?["A",a,a,0,0,d,u*a+n,r]:null,["Z"]].filter(function(h){return h})}return[["M",n,r],["L",n+e,r],["L",n+e,r+t],["L",n,r+t],["Z"]]}function Tne(e,t){t===void 0&&(t=e.getLocalTransform());var n=[];switch(e.nodeName){case Ze.LINE:var r=e.parsedStyle,i=r.x1,o=i===void 0?0:i,a=r.y1,s=a===void 0?0:a,l=r.x2,c=l===void 0?0:l,u=r.y2,f=u===void 0?0:u;n=LJe(o,s,c,f);break;case Ze.CIRCLE:{var d=e.parsedStyle,h=d.r,p=h===void 0?0:h,v=d.cx,g=v===void 0?0:v,m=d.cy,y=m===void 0?0:m;n=Mne(p,p,g,y);break}case Ze.ELLIPSE:{var x=e.parsedStyle,S=x.rx,w=S===void 0?0:S,C=x.ry,O=C===void 0?0:C,E=x.cx,g=E===void 0?0:E,_=x.cy,y=_===void 0?0:_;n=Mne(w,O,g,y);break}case Ze.POLYLINE:case Ze.POLYGON:var $=e.parsedStyle.points;n=jJe($.points,e.nodeName===Ze.POLYGON);break;case Ze.RECT:var P=e.parsedStyle,T=P.width,I=T===void 0?0:T,M=P.height,R=M===void 0?0:M,N=P.x,k=N===void 0?0:N,A=P.y,j=A===void 0?0:A,D=P.radius,L=D&&D.some(function(B){return B!==0});n=DJe(I,R,k,j,L&&D.map(function(B){return ai(B,0,Math.min(Math.abs(I)/2,Math.abs(R)/2))}));break;case Ze.PATH:var F=e.parsedStyle.d.absolutePath;n=it([],se(F),!1);break}if(n.length)return AJe(n,e,t)}var Ine=function(e){if(e===""||Array.isArray(e)&&e.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var t;try{t=OO(e)}catch(d){t=OO(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}MJe(t);var n=TJe(t),r=IJe(t),i=r.polygons,o=r.polylines,a=NJe(t),s=RJe(a,0),l=s.x,c=s.y,u=s.width,f=s.height;return{absolutePath:t,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},FJe=wo(Ine);function Lk(e){return Wr(e)?FJe(e):Ine(e)}function BJe(e,t,n){var r=e.curve,i=t.curve;(!r||r.length===0)&&(r=SN(e.absolutePath,!1),e.curve=r),(!i||i.length===0)&&(i=SN(t.absolutePath,!1),t.curve=i);var o=[r,i];r.length!==i.length&&(o=TJ(r,i));var a=PJ(o[0])!==PJ(o[1])?AKe(o[0]):kKe(o[0]);return[a,WKe(o[1],a),function(s){return s}]}function Rne(e,t){var n;return Wr(e)?n=e.split(" ").map(function(r){var i=se(r.split(","),2),o=i[0],a=i[1];return[Number(o),Number(a)]}):n=e,{points:n,totalLength:0,segments:[]}}function zJe(e,t){return[e.points,t.points,function(n){return n}]}var ci=null;function Ea(e){return function(t){var n=0;return e.map(function(r){return r===ci?t[n++]:r})}}function Ph(e){return e}var gE={matrix:["NNNNNN",[ci,ci,0,0,ci,ci,0,0,0,0,1,0,ci,ci,0,1],Ph],matrix3d:["NNNNNNNNNNNNNNNN",Ph],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Ea([ci,ci,new gr(1)]),Ph],scalex:["N",Ea([ci,new gr(1),new gr(1)]),Ea([ci,new gr(1)])],scaley:["N",Ea([new gr(1),ci,new gr(1)]),Ea([new gr(1),ci])],scalez:["N",Ea([new gr(1),new gr(1),ci])],scale3d:["NNN",Ph],skew:["Aa",null,Ph],skewx:["A",null,Ea([ci,Ps])],skewy:["A",null,Ea([Ps,ci])],translate:["Tt",Ea([ci,ci,gi]),Ph],translatex:["T",Ea([ci,gi,gi]),Ea([ci,gi])],translatey:["T",Ea([gi,ci,gi]),Ea([gi,ci])],translatez:["L",Ea([gi,gi,ci])],translate3d:["TTL",Ph]};function jk(e){if(e=(e||"none").toLowerCase().trim(),e==="none")return[];for(var t=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=t.exec(e);){if(r.index!==i)return[];i=r.index+r[0].length;var o=r[1],a=gE[o];if(!a)return[];var s=r[2].split(","),l=a[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var f=s[u],d=l[u],h=void 0;if(f?h={A:function(p){return p.trim()==="0"?Ps:yne(p)},N:$h,T:Fg,L:CJe}[d.toUpperCase()](f):h={a:Ps,n:c[0],t:gi}[d],h===void 0)return[];c.push(h)}if(n.push({t:o,d:c}),t.lastIndex===e.length)return n}return[]}function Nne(e){if(e=(e||"none").toLowerCase().trim(),e==="none")return[];for(var t=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=t.exec(e);){if(r.index!==i)return[];i=r.index+r[0].length;var o=r[1],a=gE[o];if(!a)return[];var s=r[2].split(","),l=a[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var f=s[u],d=l[u],h=void 0;if(f?h={A:function(p){return p.trim()==="0"?Ps:Ik(p)},N:Bg,T:ab,L:mne}[d.toUpperCase()](f):h={a:Ps,n:c[0],t:gi}[d],h===void 0)return[];c.push(h)}if(n.push({t:o,d:c}),t.lastIndex===e.length)return n}return[]}function HJe(e){var t,n,r,i;switch(e.t){case"rotatex":return i=pr(Oa(e.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=pr(Oa(e.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=pr(Oa(e.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":t=e.d[0].value,n=e.d[1].value,r=e.d[2].value,i=pr(Oa(e.d[3]));var o=t*t+n*n+r*r;if(o===0)t=1,n=0,r=0;else if(o!==1){var a=Math.sqrt(o);t/=a,n/=a,r/=a}var s=Math.sin(i/2),l=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(t*n*c+r*l),2*(t*r*c-n*l),0,2*(t*n*c-r*l),1-2*(t*t+r*r)*c,2*(n*r*c+t*l),0,2*(t*r*c+n*l),2*(n*r*c-t*l),1-2*(t*t+n*n)*c,0,0,0,0,1];case"scale":return[e.d[0].value,0,0,0,0,e.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[e.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,e.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,e.d[0].value,0,0,0,0,1];case"scale3d":return[e.d[0].value,0,0,0,0,e.d[1].value,0,0,0,0,e.d[2].value,0,0,0,0,1];case"skew":var u=pr(Oa(e.d[0])),f=pr(Oa(e.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=pr(Oa(e.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=pr(Oa(e.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return t=es(e.d[0],0,null)||0,n=es(e.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,n,0,1];case"translatex":return t=es(e.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,0,0,1];case"translatey":return n=es(e.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,n,0,1];case"translatez":return r=es(e.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r,1];case"translate3d":return t=es(e.d[0],0,null)||0,n=es(e.d[1],0,null)||0,r=es(e.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,n,r,1];case"perspective":var d=es(e.d[0],0,null)||0,h=d?-1/d:0;return[1,0,0,0,0,1,0,0,0,0,1,h,0,0,0,1];case"matrix":return[e.d[0].value,e.d[1].value,0,0,e.d[2].value,e.d[3].value,0,0,0,0,1,0,e.d[4].value,e.d[5].value,0,1];case"matrix3d":return e.d.map(function(p){return p.value})}}function WJe(e,t){return[e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12]*t[3],e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13]*t[3],e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]*t[3],e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]*t[3],e[0]*t[4]+e[4]*t[5]+e[8]*t[6]+e[12]*t[7],e[1]*t[4]+e[5]*t[5]+e[9]*t[6]+e[13]*t[7],e[2]*t[4]+e[6]*t[5]+e[10]*t[6]+e[14]*t[7],e[3]*t[4]+e[7]*t[5]+e[11]*t[6]+e[15]*t[7],e[0]*t[8]+e[4]*t[9]+e[8]*t[10]+e[12]*t[11],e[1]*t[8]+e[5]*t[9]+e[9]*t[10]+e[13]*t[11],e[2]*t[8]+e[6]*t[9]+e[10]*t[10]+e[14]*t[11],e[3]*t[8]+e[7]*t[9]+e[11]*t[10]+e[15]*t[11],e[0]*t[12]+e[4]*t[13]+e[8]*t[14]+e[12]*t[15],e[1]*t[12]+e[5]*t[13]+e[9]*t[14]+e[13]*t[15],e[2]*t[12]+e[6]*t[13]+e[10]*t[14]+e[14]*t[15],e[3]*t[12]+e[7]*t[13]+e[11]*t[14]+e[15]*t[15]]}function VJe(e){return e.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:e.map(HJe).reduce(WJe)}function kne(e){var t=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return HQe(VJe(e),t,n,r,i,o),[[t,n,r,o,i]]}var UJe=function(){function e(r,i){for(var o=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],a=0;a<4;a++)for(var s=0;s<4;s++)for(var l=0;l<4;l++)o[a][s]+=i[a][l]*r[l][s];return o}function t(r){return r[0][2]==0&&r[0][3]==0&&r[1][2]==0&&r[1][3]==0&&r[2][0]==0&&r[2][1]==0&&r[2][2]==1&&r[2][3]==0&&r[3][2]==0&&r[3][3]==1}function n(r,i,o,a,s){for(var l=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],c=0;c<4;c++)l[c][3]=s[c];for(var c=0;c<3;c++)for(var u=0;u<3;u++)l[3][c]+=r[u]*l[u][c];var f=a[0],d=a[1],h=a[2],p=a[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(d*d+h*h),v[0][1]=2*(f*d-h*p),v[0][2]=2*(f*h+d*p),v[1][0]=2*(f*d+h*p),v[1][1]=1-2*(f*f+h*h),v[1][2]=2*(d*h-f*p),v[2][0]=2*(f*h-d*p),v[2][1]=2*(d*h+f*p),v[2][2]=1-2*(f*f+d*d),l=e(l,v);var g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];o[2]&&(g[2][1]=o[2],l=e(l,g)),o[1]&&(g[2][1]=0,g[2][0]=o[0],l=e(l,g)),o[0]&&(g[2][0]=0,g[1][0]=o[0],l=e(l,g));for(var c=0;c<3;c++)for(var u=0;u<3;u++)l[c][u]*=i[c];return t(l)?[l[0][0],l[0][1],l[1][0],l[1][1],l[3][0],l[3][1]]:l[0].concat(l[1],l[2],l[3])}return n}();function qJe(e){return e.toFixed(6).replace(".000000","")}function Dk(e,t){var n,r;return e.decompositionPair!==t&&(e.decompositionPair=t,n=kne(e)),t.decompositionPair!==e&&(t.decompositionPair=e,r=kne(t)),n[0]===null||r[0]===null?[[!1],[!0],function(i){return i?t[0].d:e[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(i){var o=KJe(n[0][3],r[0][3],i[5]),a=UJe(i[0],i[1],i[2],o,i[4]),s=a.map(qJe).join(",");return s}])}function GJe(e,t){for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function KJe(e,t,n){var r=GJe(e,t);r=ai(r,-1,1);var i=[];if(r===1)i=e;else for(var o=Math.acos(r),a=Math.sin(n*o)*1/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(e[s]*(Math.cos(n*o)-r*a)+t[s]*a);return i}function Fk(e){return e.replace(/[xy]/,"")}function Bk(e){return e.replace(/(x|y|z|3d)?$/,"3d")}var YJe=function(e,t){return e==="perspective"&&t==="perspective"||(e==="matrix"||e==="matrix3d")&&(t==="matrix"||t==="matrix3d")};function XJe(e,t,n){var r=!1;if(!e.length||!t.length){e.length||(r=!0,e=t,t=[]);for(var i=function(C){var O=e[C],E=O.t,_=O.d,$=E.substring(0,5)==="scale"?1:0;t.push({t:E,d:_.map(function(P){return typeof P=="number"?Cr($):Cr($,P.unit)})})},o=0;o<e.length;o++)i(o)}var a=[],s=[],l=[];if(e.length!==t.length){var c=Dk(e,t);a=[c[0]],s=[c[1]],l=[["matrix",[c[2]]]]}else for(var o=0;o<e.length;o++){var u=e[o].t,f=t[o].t,d=e[o].d,h=t[o].d,p=gE[u],v=gE[f],g=void 0;if(YJe(u,f)){var c=Dk([e[o]],[t[o]]);a.push(c[0]),s.push(c[1]),l.push(["matrix",[c[2]]]);continue}else if(u===f)g=u;else if(p[2]&&v[2]&&Fk(u)===Fk(f))g=Fk(u),d=p[2](d),h=v[2](h);else if(p[1]&&v[1]&&Bk(u)===Bk(f))g=Bk(u),d=p[1](d),h=v[1](h);else{var c=Dk(e,t);a=[c[0]],s=[c[1]],l=[["matrix",[c[2]]]];break}for(var m=[],y=[],x=[],S=0;S<d.length;S++){var c=EJe(d[S],h[S],n,!1,S);m[S]=c[0],y[S]=c[1],x.push(c[2])}a.push(m),s.push(y),l.push([g,x])}if(r){var w=a;a=s,s=w}return[a,s,function(C){return C.map(function(O,E){var _=O.map(function($,P){return l[E][1][P]($)}).join(",");return l[E][0]==="matrix"&&_.split(",").length===16&&(l[E][0]="matrix3d"),l[E][0]==="matrix3d"&&_.split(",").length===6&&(l[E][0]="matrix"),l[E][0]+"("+_+")"}).join(" ")}]}var Ane=wo(function(e){if(Wr(e)){if(e==="text-anchor")return[Cr(0,"px"),Cr(0,"px")];var t=e.split(" ");return t.length===1&&(t[0]==="top"||t[0]==="bottom"?(t[1]=t[0],t[0]="center"):t[1]="center"),t.length!==2?null:[Fg(mE(t[0])),Fg(mE(t[1]))]}else return[Cr(e[0]||0,"px"),Cr(e[1]||0,"px")]}),ZJe=function(e){if(Wr(e)){if(e==="text-anchor")return[Cr(0,"px"),Cr(0,"px")];var t=e.split(" ");return t.length===1&&(t[0]==="top"||t[0]==="bottom"?(t[1]=t[0],t[0]="center"):t[1]="center"),t.length!==2?null:[ab(mE(t[0])),ab(mE(t[1]))]}else return[Cr(e[0]||0,"px"),Cr(e[1]||0,"px")]};function mE(e){return e==="center"?"50%":e==="left"||e==="top"?"0%":e==="right"||e==="bottom"?"100%":e}var zk=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Pt.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Pt.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Pt.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Pt.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Pt.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Pt.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Pt.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Pt.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Pt.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:Pt.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Pt.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Pt.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Pt.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Pt.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:Pt.FILTER},{n:"clipPath",syntax:Pt.DEFINED_PATH},{n:"textPath",syntax:Pt.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Pt.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Pt.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Pt.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Pt.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Pt.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Pt.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Pt.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:Pt.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Pt.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Pt.NUMBER,d:function(e){return e===Ze.PATH||e===Ze.POLYGON||e===Ze.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:Pt.MARKER},{n:"markerEnd",syntax:Pt.MARKER},{n:"markerMid",syntax:Pt.MARKER},{n:"markerStartOffset",syntax:Pt.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Pt.LENGTH,l:!0,int:!0,d:"0"}],Lne=zk.filter(function(e){return!!e.l}).map(function(e){return e.n}),Rf={},zg=new WeakMap,QJe=function(e,t){var n=zg.get(e);return!n||n.length===0?!0:n.includes(t)},JJe=function(){function e(t){var n=this;this.runtime=t,zk.forEach(function(r){n.registerMetadata(r)})}return e.prototype.registerMetadata=function(t){it([t.n],se(t.a||[]),!1).forEach(function(n){Rf[n]=t})},e.prototype.unregisterMetadata=function(t){delete Rf[t]},e.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},e.prototype.processProperties=function(t,n,r){var i=this;if(r===void 0&&(r={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0}),this.runtime.enableCSSParsing){var u=r.skipUpdateAttribute,f=r.skipParse,d=r.forceUpdateGeometry,h=r.usedAttributes,p=r.memoize,v=d,g=Object.keys(n);g.forEach(function(m){var y;u||(t.attributes[m]=n[m]),!v&&(!((y=Rf[m])===null||y===void 0)&&y.l)&&(v=!0)}),f||g.forEach(function(m){t.computedStyle[m]=i.parseProperty(m,t.attributes[m],t,p)}),h!=null&&h.length&&(g=Array.from(new Set(g.concat(h)))),g.forEach(function(m){m in t.computedStyle&&(t.parsedStyle[m]=i.computeProperty(m,t.computedStyle[m],t,p))}),v&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,r.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t)),g.forEach(function(m){m in t.parsedStyle&&i.postProcessProperty(m,t,g)}),this.runtime.enableCSSParsing&&t.children.length&&g.forEach(function(m){m in t.parsedStyle&&i.isPropertyInheritable(m)&&t.children.forEach(function(y){y.internalSetAttribute(m,null,{skipUpdateAttribute:!0,skipParse:!0})})})}else{Object.assign(t.attributes,n);var o=Object.keys(n),a=t.parsedStyle.clipPath,s=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,n);var l=!!r.forceUpdateGeometry;if(!l){for(var c=0;c<Lne.length;c++)if(Lne[c]in n){l=!0;break}}n.fill&&(t.parsedStyle.fill=tu(n.fill)),n.stroke&&(t.parsedStyle.stroke=tu(n.stroke)),n.shadowColor&&(t.parsedStyle.shadowColor=tu(n.shadowColor)),n.filter&&(t.parsedStyle.filter=Sne(n.filter)),hn(n.radius)||(t.parsedStyle.radius=bne(n.radius,4)),hn(n.lineDash)||(t.parsedStyle.lineDash=bne(n.lineDash,2)),n.points&&(t.parsedStyle.points=Rne(n.points)),n.d===""&&(t.parsedStyle.d=ke({},vne)),n.d&&(t.parsedStyle.d=Lk(n.d)),n.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},t,null),xr(n.clipPath)||this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,n.clipPath,t,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,n.offsetPath,t,this.runtime),n.transform&&(t.parsedStyle.transform=jk(n.transform)),n.transformOrigin&&(t.parsedStyle.transformOrigin=Ane(n.transformOrigin)),n.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),hn(n.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,o),hn(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,o),n.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,o),n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory["<transform-origin>"].postProcessor(t,o),l&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,r.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},e.prototype.parseProperty=function(t,n,r,i){var o=Rf[t],a=n;if((n===""||hn(n))&&(n="unset"),n==="unset"||n==="initial"||n==="inherit")a=Mk(n);else if(o){var s=o.k,l=o.syntax,c=l&&this.getPropertySyntax(l);s&&s.indexOf(n)>-1?a=Mk(n):c&&(!i&&c.parserUnmemoize?a=c.parserUnmemoize(n,r):c.parser&&(a=c.parser(n,r)))}return a},e.prototype.computeProperty=function(t,n,r,i){var o=Rf[t],a=r.id==="g-root",s=n;if(o){var l=o.syntax,c=o.inh,u=o.d;if(n instanceof Ca){var f=n.value;if(f==="unset"&&(c&&!a?f="inherit":f="initial"),f==="initial")hn(u)||(n=this.parseProperty(t,jg(u)?u(r.nodeName):u,r,i));else if(f==="inherit"){var d=this.tryToResolveProperty(r,t,{inherited:!0});if(hn(d)){this.addUnresolveProperty(r,t);return}else return d}}var h=l&&this.getPropertySyntax(l);if(h&&h.calculator){var p=r.parsedStyle[t];s=h.calculator(t,p,n,r,this.runtime)}else n instanceof Ca?s=n.value:s=n}return s},e.prototype.postProcessProperty=function(t,n,r){var i=Rf[t];if(i&&i.syntax){var o=i.syntax&&this.getPropertySyntax(i.syntax),a=o;a&&a.postProcessor&&a.postProcessor(n,r)}},e.prototype.addUnresolveProperty=function(t,n){var r=zg.get(t);r||(zg.set(t,[]),r=zg.get(t)),r.indexOf(n)===-1&&r.push(n)},e.prototype.tryToResolveProperty=function(t,n,r){r===void 0&&(r={});var i=r.inherited;if(i&&t.parentElement&&QJe(t.parentElement,n)){var o=t.parentElement.parsedStyle[n];return o==="unset"||o==="initial"||o==="inherit"?void 0:o}},e.prototype.recalc=function(t){var n=zg.get(t);if(n&&n.length){var r={};n.forEach(function(i){r[i]=t.attributes[i]}),this.processProperties(t,r),zg.delete(t)}},e.prototype.updateGeometry=function(t){var n=t.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=t.geometry;i.contentBounds||(i.contentBounds=new vi),i.renderBounds||(i.renderBounds=new vi);var o=t.parsedStyle,a=r.update(o,t),s=a.cx,l=s===void 0?0:s,c=a.cy,u=c===void 0?0:c,f=a.cz,d=f===void 0?0:f,h=a.hwidth,p=h===void 0?0:h,v=a.hheight,g=v===void 0?0:v,m=a.hdepth,y=m===void 0?0:m,x=[Math.abs(p),Math.abs(g),y],S=o,w=S.stroke,C=S.lineWidth,O=C===void 0?1:C,E=S.increasedLineWidthForHitTesting,_=E===void 0?0:E,$=S.shadowType,P=$===void 0?"outer":$,T=S.shadowColor,I=S.filter,M=I===void 0?[]:I,R=S.transformOrigin,N=[l,u,d];i.contentBounds.update(N,x);var k=n===Ze.POLYLINE||n===Ze.POLYGON||n===Ze.PATH?Math.SQRT2:.5,A=w&&!w.isNone;if(A){var j=((O||0)+(_||0))*k;x[0]+=j,x[1]+=j}if(i.renderBounds.update(N,x),T&&P&&P!=="inner"){var D=i.renderBounds,L=D.min,F=D.max,B=o,H=B.shadowBlur,z=B.shadowOffsetX,W=B.shadowOffsetY,V=H||0,U=z||0,G=W||0,q=L[0]-V+U,K=F[0]+V+U,X=L[1]-V+G,te=F[1]+V+G;L[0]=Math.min(L[0],q),F[0]=Math.max(F[0],K),L[1]=Math.min(L[1],X),F[1]=Math.max(F[1],te),i.renderBounds.setMinMax(L,F)}M.forEach(function(Q){var re=Q.name,ae=Q.params;if(re==="blur"){var de=ae[0].value;i.renderBounds.update(i.renderBounds.center,lE(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[de,de,0]))}else if(re==="drop-shadow"){var ve=ae[0].value,le=ae[1].value,ue=ae[2].value,be=i.renderBounds,ye=be.min,Oe=be.max,Me=ye[0]-ue+ve,Ne=Oe[0]+ue+ve,me=ye[1]-ue+le,_e=Oe[1]+ue+le;ye[0]=Math.min(ye[0],Me),Oe[0]=Math.max(Oe[0],Ne),ye[1]=Math.min(ye[1],me),Oe[1]=Math.max(Oe[1],_e),i.renderBounds.setMinMax(ye,Oe)}}),t.geometry.dirty=!1;var Z=p<0,Y=g<0,ne=(Z?-1:1)*(R?es(R[0],0,t,!0):0),ee=(Y?-1:1)*(R?es(R[1],1,t,!0):0);(ne||ee)&&t.setOrigin(ne,ee)}},e.prototype.updateSizeAttenuation=function(t,n){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/n,t.nodeName===Ze.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/n)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===Ze.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))},e.prototype.isPropertyInheritable=function(t){var n=Rf[t];return n?n.inh:!1},e}(),eet=function(){function e(){this.parser=yne,this.parserUnmemoize=Ik,this.parserWithCSSDisabled=null,this.mixer=Rk}return e.prototype.calculator=function(t,n,r,i){return Oa(r)},e}(),tet=function(){function e(){}return e.prototype.calculator=function(t,n,r,i,o){return r instanceof Ca&&(r=null),o.sceneGraphService.updateDisplayObjectDependency(t,n,r,i),t==="clipPath"&&i.forEach(function(a){a.childNodes.length===0&&o.sceneGraphService.dirtifyToRoot(a)}),r},e}(),net=function(){function e(){this.parser=tu,this.parserWithCSSDisabled=tu,this.mixer=wJe}return e.prototype.calculator=function(t,n,r,i){return r instanceof Ca?r.value==="none"?fE:pne:r},e}(),ret=function(){function e(){this.parser=Sne}return e.prototype.calculator=function(t,n,r){return r instanceof Ca?[]:r},e}();function jne(e){var t=e.parsedStyle.fontSize;return hn(t)?null:t}var Hk=function(){function e(){this.parser=Fg,this.parserUnmemoize=ab,this.parserWithCSSDisabled=null,this.mixer=Rk}return e.prototype.calculator=function(t,n,r,i,o){var a;if(_r(r))return r;if(gr.isRelativeUnit(r.unit)){var s=o.styleValueRegistry;if(r.unit===St.kPercentage)return 0;if(r.unit===St.kEms){if(i.parentNode){var l=jne(i.parentNode);if(l)return l*=r.value,l;s.addUnresolveProperty(i,t)}else s.addUnresolveProperty(i,t);return 0}else if(r.unit===St.kRems){if(!((a=i==null?void 0:i.ownerDocument)===null||a===void 0)&&a.documentElement){var l=jne(i.ownerDocument.documentElement);if(l)return l*=r.value,l;s.addUnresolveProperty(i,t)}else s.addUnresolveProperty(i,t);return 0}}else return r.value},e}(),iet=function(){function e(){this.mixer=Cne}return e.prototype.parser=function(t){var n=xne(_r(t)?[t]:t),r;return n.length===1?r=[n[0],n[0]]:r=[n[0],n[1]],r},e.prototype.calculator=function(t,n,r){return r.map(function(i){return i.value})},e}(),oet=function(){function e(){this.mixer=Cne}return e.prototype.parser=function(t){var n=xne(_r(t)?[t]:t),r;return n.length===1?r=[n[0],n[0],n[0],n[0]]:n.length===2?r=[n[0],n[1],n[0],n[1]]:n.length===3?r=[n[0],n[1],n[2],n[1]]:r=[n[0],n[1],n[2],n[3]],r},e.prototype.calculator=function(t,n,r){return r.map(function(i){return i.value})},e}(),aet=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){r instanceof Ca&&(r=null);var o=r==null?void 0:r.cloneNode(!0);return o&&(o.style.isMarker=!0),o},e}(),set=function(){function e(){this.mixer=Rk,this.parser=$h,this.parserUnmemoize=Bg,this.parserWithCSSDisabled=null}return e.prototype.calculator=function(t,n,r){return r.value},e}(),cet=function(){function e(){this.parser=$h,this.parserUnmemoize=Bg,this.parserWithCSSDisabled=null,this.mixer=Nk(0,1)}return e.prototype.calculator=function(t,n,r){return r.value},e.prototype.postProcessor=function(t){var n=t.parsedStyle,r=n.offsetPath,i=n.offsetDistance;if(r){var o=r.nodeName;if(o===Ze.LINE||o===Ze.PATH||o===Ze.POLYLINE){var a=r.getPoint(i);a&&t.setLocalPosition(a.x,a.y)}}},e}(),uet=function(){function e(){this.parser=$h,this.parserUnmemoize=Bg,this.parserWithCSSDisabled=null,this.mixer=Nk(0,1)}return e.prototype.calculator=function(t,n,r){return r.value},e}(),fet=function(){function e(){this.parser=Lk,this.parserWithCSSDisabled=Lk,this.mixer=BJe}return e.prototype.calculator=function(t,n,r){return r instanceof Ca&&r.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new _h(0,0,0,0)}:r},e}(),det=function(){function e(){this.parser=Rne,this.mixer=zJe}return e}(),het=function(e){Nt(t,e);function t(){var n=e.apply(this,it([],se(arguments),!1))||this;return n.mixer=Nk(0,1/0),n}return t}(Hk),pet=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){return r instanceof Ca?r.value==="unset"?"":r.value:"".concat(r)},e.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},e}(),vet=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){var o=i.getAttribute("text");if(o){var a=o;r.value==="capitalize"?a=o.charAt(0).toUpperCase()+o.slice(1):r.value==="lowercase"?a=o.toLowerCase():r.value==="uppercase"&&(a=o.toUpperCase()),i.parsedStyle.text=a}return r.value},e}(),Wk={},get=0;function met(e,t){if(e){var n=typeof e=="string"?e:e.id||get++;Wk[n]&&Wk[n].destroy(),Wk[n]=t}}var sb=typeof window!="undefined"&&typeof window.document!="undefined";function yet(e){return!!e.getAttribute}function bet(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;Dne(e[i],t)<0?n=i+1:r=i}return n}function Dne(e,t){var n=Number(e.parsedStyle.zIndex||0),r=Number(t.parsedStyle.zIndex||0);if(n===r){var i=e.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(e)-o.indexOf(t)}}return n-r}function Fne(e){var t,n=e;do{var r=(t=n.parsedStyle)===null||t===void 0?void 0:t.clipPath;if(r)return n;n=n.parentElement}while(n!==null);return null}var Bne="px";function xet(e,t,n){sb&&e.style&&(e.style.width=t+Bne,e.style.height=n+Bne)}function zne(e,t){if(sb)return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function wet(e){var t=zne(e,"width");return t==="auto"?e.offsetWidth:parseFloat(t)}function Cet(e){var t=zne(e,"height");return t==="auto"?e.offsetHeight:parseFloat(t)}var Oet=1,Eet={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Vk=typeof performance=="object"&&performance.now?performance:Date;function Mh(e,t,n){e===void 0&&(e="auto");var r=!1,i=!1,o=!!t&&!t.isNone,a=!!n&&!n.isNone;return e==="visiblepainted"||e==="painted"||e==="auto"?(r=o,i=a):e==="visiblefill"||e==="fill"?r=!0:e==="visiblestroke"||e==="stroke"?i=!0:(e==="visible"||e==="all")&&(r=!0,i=!0),[r,i]}var _et=1,$et=function(){return _et++},Xl=typeof self=="object"&&self.self==self?self:typeof global=="object"&&global.global==global?global:{},Pet=Date.now(),Met=function(){return Xl.performance&&typeof Xl.performance.now=="function"?Xl.performance.now():Date.now()-Pet},lb={},Hne=Date.now(),Tet=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");var t=Date.now(),n=t-Hne,r=n>16?0:16-n,i=$et();return lb[i]=e,Object.keys(lb).length>1||setTimeout(function(){Hne=t;var o=lb;lb={},Object.keys(o).forEach(function(a){return o[a](Met())})},r),i},Iet=function(e){delete lb[e]},Ret=["","webkit","moz","ms","o"],Wne=function(e){return typeof e!="string"?Tet:e===""?Xl.requestAnimationFrame:Xl[e+"RequestAnimationFrame"]},Net=function(e){return typeof e!="string"?Iet:e===""?Xl.cancelAnimationFrame:Xl[e+"CancelAnimationFrame"]||Xl[e+"CancelRequestAnimationFrame"]},ket=function(e,t){for(var n=0;e[n]!==void 0;){if(t(e[n]))return e[n];n=n+1}},Vne=ket(Ret,function(e){return!!Wne(e)}),Uk=Wne(Vne),Une=Net(Vne);Xl.requestAnimationFrame=Uk,Xl.cancelAnimationFrame=Une;var Aet=function(){function e(){this.callbacks=[]}return e.prototype.getCallbacksNum=function(){return this.callbacks.length},e.prototype.tapPromise=function(t,n){this.callbacks.push(n)},e.prototype.promise=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Promise.all(this.callbacks.map(function(r){return r.apply(void 0,it([],se(t),!1))}))},e}(),Let=function(){function e(){this.callbacks=[]}return e.prototype.tapPromise=function(t,n){this.callbacks.push(n)},e.prototype.promise=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return zl(this,void 0,void 0,function(){var r,i,o,a;return ag(this,function(s){switch(s.label){case 0:return this.callbacks.length?[4,(a=this.callbacks)[0].apply(a,it([],se(t),!1))]:[3,6];case 1:r=s.sent(),i=0,s.label=2;case 2:return i<this.callbacks.length-1?(o=this.callbacks[i],[4,o(r)]):[3,5];case 3:r=s.sent(),s.label=4;case 4:return i++,[3,2];case 5:return[2,r];case 6:return[2,null]}})})},e}(),na=function(){function e(){this.callbacks=[]}return e.prototype.tap=function(t,n){this.callbacks.push(n)},e.prototype.call=function(){var t=arguments;this.callbacks.forEach(function(n){n.apply(void 0,t)})},e}(),qk=function(){function e(){this.callbacks=[]}return e.prototype.tap=function(t,n){this.callbacks.push(n)},e.prototype.call=function(){if(this.callbacks.length){for(var t=arguments,n=this.callbacks[0].apply(void 0,t),r=0;r<this.callbacks.length-1;r++){var i=this.callbacks[r];n=i(n)}return n}return null},e}(),jet=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Det=/([\"\'])[^\'\"]+\1/;function Fet(e){for(var t=e.fontSize,n=t===void 0?16:t,r=e.fontFamily,i=r===void 0?"sans-serif":r,o=e.fontStyle,a=o===void 0?"normal":o,s=e.fontVariant,l=s===void 0?"normal":s,c=e.fontWeight,u=c===void 0?"normal":c,f=_r(n)&&"".concat(n,"px")||"16px",d=i.split(","),h=d.length-1;h>=0;h--){var p=d[h].trim();!Det.test(p)&&jet.indexOf(p)<0&&(p='"'.concat(p,'"')),d[h]=p}return"".concat(a," ").concat(l," ").concat(u," ").concat(f," ").concat(d.join(","))}function Gk(e,t,n){return fh(e),e[4]=Math.tan(t),e[1]=Math.tan(n),e}var cb=1e-5,Bet=er(),Ri=er();function qne(e,t){if(e.length){var n=fh(Bet);e.forEach(function(r){var i=r.t,o=r.d;if(i==="scale"){var a=(o==null?void 0:o.map(function(m){return Math.max(m.value,cb)}))||[1,1];bf(Ri,[a[0],a[1],1])}else if(i==="scalex"){var a=(o==null?void 0:o.map(function(y){return Math.max(y.value,cb)}))||[1];bf(Ri,[a[0],1,1])}else if(i==="scaley"){var a=(o==null?void 0:o.map(function(y){return Math.max(y.value,cb)}))||[1];bf(Ri,[1,a[0],1])}else if(i==="scalez"){var a=(o==null?void 0:o.map(function(y){return Math.max(y.value,cb)}))||[1];bf(Ri,[1,1,a[0]])}else if(i==="scale3d"){var a=(o==null?void 0:o.map(function(y){return Math.max(y.value,cb)}))||[1,1,1];bf(Ri,[a[0],a[1],a[2]])}else if(i==="translate"){var s=o||[gi,gi];yf(Ri,[s[0].value,s[1].value,0])}else if(i==="translatex"){var s=o||[gi];yf(Ri,[s[0].value,0,0])}else if(i==="translatey"){var s=o||[gi];yf(Ri,[0,s[0].value,0])}else if(i==="translatez"){var s=o||[gi];yf(Ri,[0,0,s[0].value])}else if(i==="translate3d"){var s=o||[gi,gi,gi];yf(Ri,[s[0].value,s[1].value,s[2].value])}else if(i==="rotate"){var l=o||[Ps];dN(Ri,pr(Oa(l[0])))}else if(i==="rotatex"){var l=o||[Ps];oJ(Ri,pr(Oa(l[0])))}else if(i==="rotatey"){var l=o||[Ps];aJ(Ri,pr(Oa(l[0])))}else if(i==="rotatez"){var l=o||[Ps];dN(Ri,pr(Oa(l[0])))}else if(i==="rotate3d"){var l=o||[gi,gi,gi,Ps];iJ(Ri,pr(Oa(l[3])),[l[0].value,l[1].value,l[2].value])}else if(i==="skew"){var c=(o==null?void 0:o.map(function(m){return m.value}))||[0,0];Gk(Ri,pr(c[0]),pr(c[1]))}else if(i==="skewx"){var c=(o==null?void 0:o.map(function(y){return y.value}))||[0];Gk(Ri,pr(c[0]),0)}else if(i==="skewy"){var c=(o==null?void 0:o.map(function(y){return y.value}))||[0];Gk(Ri,0,pr(c[0]))}else if(i==="matrix"){var u=se(o.map(function(m){return m.value}),6),f=u[0],d=u[1],h=u[2],p=u[3],v=u[4],g=u[5];fN(Ri,f,d,0,0,h,p,0,0,0,0,1,0,v,g,0,1)}else i==="matrix3d"&&fN.apply(oKe,it([Ri],se(o.map(function(m){return m.value})),!1));pN(n,n,Ri)}),t.setLocalTransform(n)}else t.resetLocalTransform();return t.getLocalTransform()}var zet=function(){function e(){this.parser=jk,this.parserUnmemoize=Nne,this.parserWithCSSDisabled=Nne,this.mixer=XJe}return e.prototype.calculator=function(t,n,r,i){return r instanceof Ca?[]:r},e.prototype.postProcessor=function(t){var n=t.parsedStyle.transform;qne(n,t)},e}(),Het=function(){function e(){this.parser=Ane,this.parserUnmemoize=ZJe}return e.prototype.postProcessor=function(t){var n=t.parsedStyle.transformOrigin;n[0].unit===St.kPixels&&n[1].unit===St.kPixels?t.setOrigin(n[0].value,n[1].value):t.getGeometryBounds()},e}(),Wet=function(){function e(){this.parser=$h,this.parserUnmemoize=Bg}return e.prototype.calculator=function(t,n,r,i){return r.value},e.prototype.postProcessor=function(t){if(t.parentNode){var n=t.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=Dg.Z_INDEX_CHANGED)}},e}(),Vet=function(){function e(){}return e.prototype.update=function(t,n){var r=t.cx,i=r===void 0?0:r,o=t.cy,a=o===void 0?0:o,s=t.r,l=s===void 0?0:s;return{cx:i,cy:a,hwidth:l,hheight:l}},e}(),Uet=function(){function e(){}return e.prototype.update=function(t,n){var r=t.cx,i=r===void 0?0:r,o=t.cy,a=o===void 0?0:o,s=t.rx,l=s===void 0?0:s,c=t.ry,u=c===void 0?0:c;return{cx:i,cy:a,hwidth:l,hheight:u}},e}(),qet=function(){function e(){}return e.prototype.update=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2,a=Math.min(n,i),s=Math.max(n,i),l=Math.min(r,o),c=Math.max(r,o),u=s-a,f=c-l,d=u/2,h=f/2;return{cx:a+d,cy:l+h,hwidth:d,hheight:h}},e}(),Get=function(){function e(){}return e.prototype.update=function(t){var n=t.d,r=n.rect,i=r.x,o=r.y,a=r.width,s=r.height,l=a/2,c=s/2;return{cx:i+l,cy:o+c,hwidth:l,hheight:c}},e}(),Ket=function(){function e(){}return e.prototype.update=function(t){if(t.points&&Hi(t.points.points)){var n=t.points.points,r=Math.min.apply(Math,it([],se(n.map(function(f){return f[0]})),!1)),i=Math.max.apply(Math,it([],se(n.map(function(f){return f[0]})),!1)),o=Math.min.apply(Math,it([],se(n.map(function(f){return f[1]})),!1)),a=Math.max.apply(Math,it([],se(n.map(function(f){return f[1]})),!1)),s=i-r,l=a-o,c=s/2,u=l/2;return{cx:r+c,cy:o+u,hwidth:c,hheight:u}}return{cx:0,cy:0,hwidth:0,hheight:0}},e}(),Yet=function(){function e(){}return e.prototype.update=function(t,n){var r=t.x,i=r===void 0?0:r,o=t.y,a=o===void 0?0:o,s=t.src,l=t.width,c=l===void 0?0:l,u=t.height,f=u===void 0?0:u,d=c,h=f;return s&&!Wr(s)&&(d||(d=s.width,t.width=d),h||(h=s.height,t.height=h)),{cx:i+d/2,cy:a+h/2,hwidth:d/2,hheight:h/2}},e}(),Xet=function(){function e(t){this.globalRuntime=t}return e.prototype.isReadyToMeasure=function(t,n){var r=t.text,i=t.textAlign,o=t.textBaseline,a=t.fontSize,s=t.fontStyle,l=t.fontWeight,c=t.fontVariant,u=t.lineWidth;return Ve.enableCSSParsing?r&&a&&s&&l&&c&&i&&o&&!hn(u):r},e.prototype.update=function(t,n){var r,i,o=t.text,a=t.textAlign,s=a===void 0?"start":a,l=t.lineWidth,c=l===void 0?1:l,u=t.textBaseline,f=u===void 0?"alphabetic":u,d=t.dx,h=d===void 0?0:d,p=t.dy,v=p===void 0?0:p,g=t.x,m=g===void 0?0:g,y=t.y,x=y===void 0?0:y;if(!this.isReadyToMeasure(t,n))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var S=(((i=(r=n==null?void 0:n.ownerDocument)===null||r===void 0?void 0:r.defaultView)===null||i===void 0?void 0:i.getConfig())||{}).offscreenCanvas,w=this.globalRuntime.textService.measureText(o,t,S);t.metrics=w;var C=w.width,O=w.height,E=w.lineHeight,_=w.fontProperties,$=C/2,P=O/2,T=m+$;s==="center"||s==="middle"?T+=c/2-$:(s==="right"||s==="end")&&(T+=c-$*2);var I=x-P;return f==="middle"?I+=P:f==="top"||f==="hanging"?I+=P*2:f==="alphabetic"?I+=this.globalRuntime.enableCSSParsing?E-_.ascent:0:(f==="bottom"||f==="ideographic")&&(I+=0),h&&(T+=h),v&&(I+=v),{cx:T,cy:I,hwidth:$,hheight:P}},e}(),Zet=function(){function e(){}return e.prototype.update=function(t,n){return{cx:0,cy:0,hwidth:0,hheight:0}},e}();function Qet(e){return!!e.type}var yE=function(){function e(t){this.eventPhase=e.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new So,this.page=new So,this.canvas=new So,this.viewport=new So,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),e.prototype.composedPath=function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(e.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.prototype.stopPropagation=function(){this.propagationStopped=!0},e.prototype.initEvent=function(){},e.prototype.initUIEvent=function(){},e.prototype.clone=function(){throw new Error(vr)},e}(),Gne=function(e){Nt(t,e);function t(){var n=e.apply(this,it([],se(arguments),!1))||this;return n.client=new So,n.movement=new So,n.offset=new So,n.global=new So,n.screen=new So,n}return Object.defineProperty(t.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),t.prototype.getModifierState=function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)},t.prototype.initMouseEvent=function(){throw new Error(vr)},t}(yE),Kk=function(e){Nt(t,e);function t(){var n=e.apply(this,it([],se(arguments),!1))||this;return n.width=0,n.height=0,n.isPrimary=!1,n}return t.prototype.getCoalescedEvents=function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]},t.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},t.prototype.clone=function(){return this.manager.clonePointerEvent(this)},t}(Gne),Yk=function(e){Nt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},t}(Gne),mr=function(e){Nt(t,e);function t(n,r){var i=e.call(this,null)||this;return i.type=n,i.detail=r,Object.assign(i,r),i}return t}(yE),Kne=":",Yne=function(){function e(){this.emitter=new dk}return e.prototype.on=function(t,n,r){return this.addEventListener(t,n,r),this},e.prototype.addEventListener=function(t,n,r){var i=KQ(r)&&r||lh(r)&&r.capture,o=lh(r)&&r.once,a=jg(n)?void 0:n,s=!1,l="";if(t.indexOf(Kne)>-1){var c=se(t.split(Kne),2),u=c[0],f=c[1];t=f,l=u,s=!0}if(t=i?"".concat(t,"capture"):t,n=jg(n)?n:n.handleEvent,s){var d=n;n=function(){for(var h,p=[],v=0;v<arguments.length;v++)p[v]=arguments[v];((h=p[0].target)===null||h===void 0?void 0:h.name)===l&&d.apply(void 0,it([],se(p),!1))}}return o?this.emitter.once(t,n,a):this.emitter.on(t,n,a),this},e.prototype.off=function(t,n,r){return t?this.removeEventListener(t,n,r):this.removeAllEventListeners(),this},e.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.prototype.removeEventListener=function(t,n,r){var i=KQ(r)&&r||lh(r)&&r.capture,o=jg(n)?void 0:n;return t=i?"".concat(t,"capture"):t,n=jg(n)?n:n==null?void 0:n.handleEvent,this.emitter.off(t,n,o),this},e.prototype.emit=function(t,n){this.dispatchEvent(new mr(t,n))},e.prototype.dispatchEvent=function(t,n){var r,i;if(n===void 0&&(n=!1),!Qet(t))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var o;if(this.document?o=this:this.defaultView?o=this.defaultView:o=(r=this.ownerDocument)===null||r===void 0?void 0:r.defaultView,o){if(t.manager=o.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],n||(t.target=this),(i=t.manager)===null||i===void 0||i.dispatchEvent(t,t.type,n)}return!t.defaultPrevented},e}(),so=function(e){Nt(t,e);function t(){var n=e.call(this)||this;return n.shadow=!1,n.ownerDocument=null,n.isConnected=!1,n.baseURI="",n.childNodes=[],n.nodeType=0,n.nodeName="",n.nodeValue=null,n.parentNode=null,n}return t.isNode=function(n){return!!n.childNodes},Object.defineProperty(t.prototype,"textContent",{get:function(){var n,r,i="";this.nodeName===Ze.TEXT&&(i+=this.style.text);try{for(var o=Xa(this.childNodes),a=o.next();!a.done;a=o.next()){var s=a.value;s.nodeName===Ze.TEXT?i+=s.nodeValue:i+=s.textContent}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},set:function(n){var r=this;this.childNodes.slice().forEach(function(i){r.removeChild(i)}),this.nodeName===Ze.TEXT&&(this.style.text="".concat(n))},enumerable:!1,configurable:!0}),t.prototype.getRootNode=function(n){return n===void 0&&(n={}),this.parentNode?this.parentNode.getRootNode(n):n.composed&&this.host?this.host.getRootNode(n):this},t.prototype.hasChildNodes=function(){return this.childNodes.length>0},t.prototype.isDefaultNamespace=function(n){throw new Error(vr)},t.prototype.lookupNamespaceURI=function(n){throw new Error(vr)},t.prototype.lookupPrefix=function(n){throw new Error(vr)},t.prototype.normalize=function(){throw new Error(vr)},t.prototype.isEqualNode=function(n){return this===n},t.prototype.isSameNode=function(n){return this.isEqualNode(n)},Object.defineProperty(t.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),t.prototype.compareDocumentPosition=function(n){var r;if(n===this)return 0;for(var i=n,o=this,a=[i],s=[o];(r=i.parentNode)!==null&&r!==void 0?r:o.parentNode;)i=i.parentNode?(a.push(i.parentNode),i.parentNode):i,o=o.parentNode?(s.push(o.parentNode),o.parentNode):o;if(i!==o)return t.DOCUMENT_POSITION_DISCONNECTED|t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|t.DOCUMENT_POSITION_PRECEDING;var l=a.length>s.length?a:s,c=l===a?s:a;if(l[l.length-c.length]===c[0])return l===a?t.DOCUMENT_POSITION_CONTAINED_BY|t.DOCUMENT_POSITION_FOLLOWING:t.DOCUMENT_POSITION_CONTAINS|t.DOCUMENT_POSITION_PRECEDING;for(var u=l.length-c.length,f=c.length-1;f>=0;f--){var d=c[f],h=l[u+f];if(h!==d){var p=d.parentNode.childNodes;return p.indexOf(d)<p.indexOf(h)?c===a?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING:l===a?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING}}return t.DOCUMENT_POSITION_FOLLOWING},t.prototype.contain=function(n){return this.contains(n)},t.prototype.contains=function(n){for(var r=n;r&&this!==r;)r=r.parentNode;return!!r},t.prototype.getAncestor=function(n){for(var r=this;n>0&&r;)r=r.parentNode,n--;return r},t.prototype.forEach=function(n,r){r===void 0&&(r=!1),n(this)||(r?this.childNodes.slice():this.childNodes).forEach(function(i){i.forEach(n)})},t.DOCUMENT_POSITION_DISCONNECTED=1,t.DOCUMENT_POSITION_PRECEDING=2,t.DOCUMENT_POSITION_FOLLOWING=4,t.DOCUMENT_POSITION_CONTAINS=8,t.DOCUMENT_POSITION_CONTAINED_BY=16,t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,t}(Yne),Jet=2048,ett=function(){function e(t,n){var r=this;this.globalRuntime=t,this.context=n,this.emitter=new dk,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=er(),this.tmpVec3=Mn(),this.onPointerDown=function(i){var o=r.createPointerEvent(i);if(r.dispatchEvent(o,"pointerdown"),o.pointerType==="touch")r.dispatchEvent(o,"touchstart");else if(o.pointerType==="mouse"||o.pointerType==="pen"){var a=o.button===2;r.dispatchEvent(o,a?"rightdown":"mousedown")}var s=r.trackingData(i.pointerId);s.pressTargetsByButton[i.button]=o.composedPath(),r.freeEvent(o)},this.onPointerUp=function(i){var o,a=Vk.now(),s=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(s,"pointerup"),s.pointerType==="touch")r.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.dispatchEvent(s,l?"rightup":"mouseup")}var c=r.trackingData(i.pointerId),u=r.findMountedTarget(c.pressTargetsByButton[i.button]),f=u;if(u&&!s.composedPath().includes(u)){for(var d=u;d&&!s.composedPath().includes(d);){if(s.currentTarget=d,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")r.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.notifyTarget(s,l?"rightupoutside":"mouseupoutside")}so.isNode(d)&&(d=d.parentNode)}delete c.pressTargetsByButton[i.button],f=d}if(f){var h=r.clonePointerEvent(s,"click");h.target=f,h.path=[],c.clicksByButton[i.button]||(c.clicksByButton[i.button]={clickCount:0,target:h.target,timeStamp:a});var p=c.clicksByButton[i.button];p.target===h.target&&a-p.timeStamp<200?++p.clickCount:p.clickCount=1,p.target=h.target,p.timeStamp=a,h.detail=p.clickCount,!((o=s.detail)===null||o===void 0)&&o.preventClick||(!r.context.config.useNativeClickEvent&&(h.pointerType==="mouse"||h.pointerType==="touch")&&r.dispatchEvent(h,"click"),r.dispatchEvent(h,"pointertap")),r.freeEvent(h)}r.freeEvent(s)},this.onPointerMove=function(i){var o=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),a=o.pointerType==="mouse"||o.pointerType==="pen",s=r.trackingData(i.pointerId),l=r.findMountedTarget(s.overTargets);if(s.overTargets&&l!==o.target){var c=i.type==="mousemove"?"mouseout":"pointerout",u=r.createPointerEvent(i,c,l||void 0);if(r.dispatchEvent(u,"pointerout"),a&&r.dispatchEvent(u,"mouseout"),!o.composedPath().includes(l)){var f=r.createPointerEvent(i,"pointerleave",l||void 0);for(f.eventPhase=f.AT_TARGET;f.target&&!o.composedPath().includes(f.target);)f.currentTarget=f.target,r.notifyTarget(f),a&&r.notifyTarget(f,"mouseleave"),so.isNode(f.target)&&(f.target=f.target.parentNode);r.freeEvent(f)}r.freeEvent(u)}if(l!==o.target){var d=i.type==="mousemove"?"mouseover":"pointerover",h=r.clonePointerEvent(o,d);r.dispatchEvent(h,"pointerover"),a&&r.dispatchEvent(h,"mouseover");for(var p=l&&so.isNode(l)&&l.parentNode;p&&p!==(so.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&p!==o.target;)p=p.parentNode;var v=!p||p===(so.isNode(r.rootTarget)&&r.rootTarget.parentNode);if(v){var g=r.clonePointerEvent(o,"pointerenter");for(g.eventPhase=g.AT_TARGET;g.target&&g.target!==l&&g.target!==(so.isNode(r.rootTarget)&&r.rootTarget.parentNode);)g.currentTarget=g.target,r.notifyTarget(g),a&&r.notifyTarget(g,"mouseenter"),so.isNode(g.target)&&(g.target=g.target.parentNode);r.freeEvent(g)}r.freeEvent(h)}r.dispatchEvent(o,"pointermove"),o.pointerType==="touch"&&r.dispatchEvent(o,"touchmove"),a&&(r.dispatchEvent(o,"mousemove"),r.cursor=r.getCursor(o.target)),s.overTargets=o.composedPath(),r.freeEvent(o)},this.onPointerOut=function(i){var o=r.trackingData(i.pointerId);if(o.overTargets){var a=i.pointerType==="mouse"||i.pointerType==="pen",s=r.findMountedTarget(o.overTargets),l=r.createPointerEvent(i,"pointerout",s||void 0);r.dispatchEvent(l),a&&r.dispatchEvent(l,"mouseout");var c=r.createPointerEvent(i,"pointerleave",s||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==(so.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),a&&r.notifyTarget(c,"mouseleave"),so.isNode(c.target)&&(c.target=c.target.parentNode);o.overTargets=null,r.freeEvent(l),r.freeEvent(c)}r.cursor=null},this.onPointerOver=function(i){var o=r.trackingData(i.pointerId),a=r.createPointerEvent(i),s=a.pointerType==="mouse"||a.pointerType==="pen";r.dispatchEvent(a,"pointerover"),s&&r.dispatchEvent(a,"mouseover"),a.pointerType==="mouse"&&(r.cursor=r.getCursor(a.target));var l=r.clonePointerEvent(a,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(so.isNode(r.rootTarget)&&r.rootTarget.parentNode);)l.currentTarget=l.target,r.notifyTarget(l),s&&r.notifyTarget(l,"mouseenter"),so.isNode(l.target)&&(l.target=l.target.parentNode);o.overTargets=a.composedPath(),r.freeEvent(a),r.freeEvent(l)},this.onPointerUpOutside=function(i){var o=r.trackingData(i.pointerId),a=r.findMountedTarget(o.pressTargetsByButton[i.button]),s=r.createPointerEvent(i);if(a){for(var l=a;l;)s.currentTarget=l,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"||(s.pointerType==="mouse"||s.pointerType==="pen")&&r.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),so.isNode(l)&&(l=l.parentNode);delete o.pressTargetsByButton[i.button]}r.freeEvent(s)},this.onWheel=function(i){var o=r.createWheelEvent(i);r.dispatchEvent(o),r.freeEvent(o)},this.onClick=function(i){if(r.context.config.useNativeClickEvent){var o=r.createPointerEvent(i);r.dispatchEvent(o),r.freeEvent(o)}},this.onPointerCancel=function(i){var o=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(o),r.freeEvent(o)}}return e.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},e.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.prototype.getScale=function(){var t=this.context.contextService.getBoundingClientRect(),n=1,r=1,i=this.context.contextService.getDomElement();if(i&&t){var o=i.offsetWidth,a=i.offsetHeight;o&&a&&(n=t.width/o,r=t.height/a)}return{scaleX:n,scaleY:r,bbox:t}},e.prototype.client2Viewport=function(t){var n=this.getScale(),r=n.scaleX,i=n.scaleY,o=n.bbox;return new So((t.x-((o==null?void 0:o.left)||0))/r,(t.y-((o==null?void 0:o.top)||0))/i)},e.prototype.viewport2Client=function(t){var n=this.getScale(),r=n.scaleX,i=n.scaleY,o=n.bbox;return new So((t.x+((o==null?void 0:o.left)||0))*r,(t.y+((o==null?void 0:o.top)||0))*i)},e.prototype.viewport2Canvas=function(t){var n=t.x,r=t.y,i=this.rootTarget.defaultView,o=i.getCamera(),a=this.context.config,s=a.width,l=a.height,c=o.getPerspectiveInverse(),u=o.getWorldTransform(),f=Do(this.tmpMatrix,u,c),d=gl(this.tmpVec3,n/s*2-1,(1-r/l)*2-1,0);return Zi(d,d,f),new So(d[0],d[1])},e.prototype.canvas2Viewport=function(t){var n=this.rootTarget.defaultView,r=n.getCamera(),i=r.getPerspective(),o=r.getViewTransform(),a=Do(this.tmpMatrix,i,o),s=gl(this.tmpVec3,t.x,t.y,0);Zi(this.tmpVec3,this.tmpVec3,a);var l=this.context.config,c=l.width,u=l.height;return new So((s[0]+1)/2*c,(1-(s[1]+1)/2)*u)},e.prototype.setPickHandler=function(t){this.pickHandler=t},e.prototype.addEventMapping=function(t,n){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:n,priority:0}),this.mappingTable[t].sort(function(r,i){return r.priority-i.priority})},e.prototype.mapEvent=function(t){if(this.rootTarget){var n=this.mappingTable[t.type];if(n)for(var r=0,i=n.length;r<i;r++)n[r].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},e.prototype.dispatchEvent=function(t,n,r){if(!r)t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,n);else{t.eventPhase=t.AT_TARGET;var i=this.rootTarget.defaultView||null;t.currentTarget=i,this.notifyListeners(t,n)}this.emitter.emit(n||t.type,t)},e.prototype.propagate=function(t,n){if(t.target){var r=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=r.length-1;i>=1;i--)if(t.currentTarget=r[i],this.notifyTarget(t,n),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,n),!(t.propagationStopped||t.propagationImmediatelyStopped)){var o=r.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var i=o+1;i<r.length;i++)if(t.currentTarget=r[i],this.notifyTarget(t,n),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.prototype.propagationPath=function(t){var n=[t],r=this.rootTarget.defaultView||null;if(r&&r===t)return n.unshift(r.document),n;for(var i=0;i<Jet&&t!==this.rootTarget;i++)so.isNode(t)&&t.parentNode&&(n.push(t.parentNode),t=t.parentNode);return r&&n.push(r),n},e.prototype.hitTest=function(t){var n=t.viewportX,r=t.viewportY,i=this.context.config,o=i.width,a=i.height,s=i.disableHitTesting;return n<0||r<0||n>o||r>a?null:!s&&this.pickHandler(t)||this.rootTarget||null},e.prototype.isNativeEventFromCanvas=function(t,n){var r=n==null?void 0:n.target;if(r!=null&&r.shadowRoot&&(r=n.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return n!=null&&n.composedPath?n.composedPath().indexOf(t)>-1:!1},e.prototype.getExistedHTML=function(t){var n,r;if(t.nativeEvent.composedPath)try{for(var i=Xa(t.nativeEvent.composedPath()),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.nativeHTMLMap.get(a);if(s)return s}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null},e.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},e.prototype.createPointerEvent=function(t,n,r,i){var o=this.allocateEvent(Kk);this.copyPointerData(t,o),this.copyMouseData(t,o),this.copyData(t,o),o.nativeEvent=t.nativeEvent,o.originalEvent=t;var a=this.getExistedHTML(o),s=this.context.contextService.getDomElement();return o.target=r!=null?r:a||this.isNativeEventFromCanvas(s,o.nativeEvent)&&this.pickTarget(o)||i,typeof n=="string"&&(o.type=n),o},e.prototype.createWheelEvent=function(t){var n=this.allocateEvent(Yk);this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t;var r=this.getExistedHTML(n),i=this.context.contextService.getDomElement();return n.target=r||this.isNativeEventFromCanvas(i,n.nativeEvent)&&this.pickTarget(n),n},e.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.prototype.cloneWheelEvent=function(t){var n=this.allocateEvent(Yk);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=t.type,n},e.prototype.clonePointerEvent=function(t,n){var r=this.allocateEvent(Kk);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=n!=null?n:r.type,r},e.prototype.copyPointerData=function(t,n){n.pointerId=t.pointerId,n.width=t.width,n.height=t.height,n.isPrimary=t.isPrimary,n.pointerType=t.pointerType,n.pressure=t.pressure,n.tangentialPressure=t.tangentialPressure,n.tiltX=t.tiltX,n.tiltY=t.tiltY,n.twist=t.twist},e.prototype.copyMouseData=function(t,n){n.altKey=t.altKey,n.button=t.button,n.buttons=t.buttons,n.ctrlKey=t.ctrlKey,n.metaKey=t.metaKey,n.shiftKey=t.shiftKey,n.client.copyFrom(t.client),n.movement.copyFrom(t.movement),n.canvas.copyFrom(t.canvas),n.screen.copyFrom(t.screen),n.global.copyFrom(t.global),n.offset.copyFrom(t.offset)},e.prototype.copyWheelData=function(t,n){n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ},e.prototype.copyData=function(t,n){n.isTrusted=t.isTrusted,n.timeStamp=Vk.now(),n.type=t.type,n.detail=t.detail,n.view=t.view,n.page.copyFrom(t.page),n.viewport.copyFrom(t.viewport)},e.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var n=this.eventPool.get(t).pop()||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n},e.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(t)},e.prototype.notifyTarget=function(t,n){n=n!=null?n:t.type;var r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,n)},e.prototype.notifyListeners=function(t,n){var r=t.currentTarget.emitter,i=r._events[n];if(i)if("fn"in i)i.once&&r.removeListener(n,i.fn,void 0,!0),i.fn.call(t.currentTarget||i.context,t);else for(var o=0;o<i.length&&!t.propagationImmediatelyStopped;o++)i[o].once&&r.removeListener(n,i[o].fn,void 0,!0),i[o].fn.call(t.currentTarget||i[o].context,t)},e.prototype.findMountedTarget=function(t){if(!t)return null;for(var n=t[t.length-1],r=t.length-2;r>=0;r--){var i=t[r];if(i===this.rootTarget||so.isNode(i)&&i.parentNode===n)n=t[r];else break}return n},e.prototype.getCursor=function(t){for(var n=t;n;){var r=yet(n)&&n.getAttribute("cursor");if(r)return r;n=so.isNode(n)&&n.parentNode}},e}(),ttt=function(){function e(){}return e.prototype.getOrCreateCanvas=function(t,n){if(this.canvas)return this.canvas;if(t||Ve.offscreenCanvas)this.canvas=t||Ve.offscreenCanvas,this.context=this.canvas.getContext("2d",ke({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",ke({willReadFrequently:!0},n)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",ke({willReadFrequently:!0},n))}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.prototype.getOrCreateContext=function(t,n){return this.context?this.context:(this.getOrCreateCanvas(t,n),this.context)},e}(),Nf;(function(e){e[e.CAMERA_CHANGED=0]="CAMERA_CHANGED",e[e.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",e[e.NONE=2]="NONE"})(Nf||(Nf={}));var ntt=function(){function e(t,n){this.globalRuntime=t,this.context=n,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new na,initAsync:new Aet,dirtycheck:new qk,cull:new qk,beginFrame:new na,beforeRender:new na,render:new na,afterRender:new na,endFrame:new na,destroy:new na,pick:new Let,pickSync:new qk,pointerDown:new na,pointerUp:new na,pointerMove:new na,pointerOut:new na,pointerOver:new na,pointerWheel:new na,pointerCancel:new na,click:new na}}return e.prototype.init=function(t){var n=this,r=ke(ke({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(i){i.apply(r,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){n.inited=!0,t()})},e.prototype.getStats=function(){return this.stats},e.prototype.disableDirtyRectangleRendering=function(){var t=this.context.config.renderer,n=t.getConfig().enableDirtyRectangleRendering;return!n||this.context.renderingContext.renderReasons.has(Nf.CAMERA_CHANGED)},e.prototype.render=function(t,n,r){var i=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var o=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(o.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),o.renderReasons.size&&this.inited){o.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=o.renderReasons.size===1&&o.renderReasons.has(Nf.CAMERA_CHANGED),s=!t.disableRenderHooks||!(t.disableRenderHooks&&a);s&&this.renderDisplayObject(o.root,t,o),this.hooks.beginFrame.call(n),s&&o.renderListCurrentFrame.forEach(function(l){i.hooks.beforeRender.call(l),i.hooks.render.call(l),i.hooks.afterRender.call(l)}),this.hooks.endFrame.call(n),o.renderListCurrentFrame=[],o.renderReasons.clear(),r()}},e.prototype.renderDisplayObject=function(t,n,r){var i=this,o=n.renderer.getConfig(),a=o.enableDirtyCheck,s=o.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var l=t.renderable,c=a?l.dirty||r.dirtyRectangleRenderingDisabled?t:null:t;if(c){var u=s?this.hooks.cull.call(c,this.context.camera):c;u&&(this.stats.rendered++,r.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var f=t.sortable;f.dirty&&(this.sort(t,f),f.dirty=!1,f.dirtyChildren=[],f.dirtyReason=void 0),(f.sorted||t.childNodes).forEach(function(d){i.renderDisplayObject(d,n,r)})},e.prototype.sort=function(t,n){n.sorted&&n.dirtyReason!==Dg.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(r){var i=t.childNodes.indexOf(r);if(i===-1){var o=n.sorted.indexOf(r);o>=0&&n.sorted.splice(o,1)}else if(n.sorted.length===0)n.sorted.push(r);else{var a=bet(n.sorted,r);n.sorted.splice(a,0,r)}}):n.sorted=t.childNodes.slice().sort(Dne)},e.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Nf.DISPLAY_OBJECT_CHANGED)},e}(),rtt=/\[\s*(.*)=(.*)\s*\]/,itt=function(){function e(){}return e.prototype.selectOne=function(t,n){var r=this;if(t.startsWith("."))return n.find(function(s){return((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.find(function(s){return s.id===r.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),o=i.name,a=i.value;return o?n.find(function(s){return n!==s&&(o==="name"?s.name===a:r.attributeToString(s,o)===a)}):null}else return n.find(function(s){return n!==s&&s.nodeName===t})},e.prototype.selectAll=function(t,n){var r=this;if(t.startsWith("."))return n.findAll(function(s){return n!==s&&((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.findAll(function(s){return n!==s&&s.id===r.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),o=i.name,a=i.value;return o?n.findAll(function(s){return n!==s&&(o==="name"?s.name===a:r.attributeToString(s,o)===a)}):[]}else return n.findAll(function(s){return n!==s&&s.nodeName===t})},e.prototype.is=function(t,n){if(t.startsWith("."))return n.className===this.getIdOrClassname(t);if(t.startsWith("#"))return n.id===this.getIdOrClassname(t);if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i==="name"?n.name===o:this.attributeToString(n,i)===o}else return n.nodeName===t},e.prototype.getIdOrClassname=function(t){return t.substring(1)},e.prototype.getAttribute=function(t){var n=t.match(rtt),r="",i="";return n&&n.length>2&&(r=n[1].replace(/"/g,""),i=n[2].replace(/"/g,"")),{name:r,value:i}},e.prototype.attributeToString=function(t,n){if(!t.getAttribute)return"";var r=t.getAttribute(n);return hn(r)?"":r.toString?r.toString():""},e}(),Th=function(e){Nt(t,e);function t(n,r,i,o,a,s,l,c){var u=e.call(this,null)||this;return u.relatedNode=r,u.prevValue=i,u.newValue=o,u.attrName=a,u.attrChange=s,u.prevParsedValue=l,u.newParsedValue=c,u.type=n,u}return t.ADDITION=2,t.MODIFICATION=1,t.REMOVAL=3,t}(yE),Sn;(function(e){e.REPARENT="reparent",e.DESTROY="destroy",e.ATTR_MODIFIED="DOMAttrModified",e.INSERTED="DOMNodeInserted",e.REMOVED="removed",e.MOUNTED="DOMNodeInsertedIntoDocument",e.UNMOUNTED="DOMNodeRemovedFromDocument",e.BOUNDS_CHANGED="bounds-changed",e.CULLED="culled"})(Sn||(Sn={}));function Xne(e){var t=e.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}var ott=new Th(Sn.REPARENT,null,"","","",0,"",""),att=function(){function e(t){var n=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new mr(Sn.BOUNDS_CHANGED),this.rotate=function(){var r=Ii();return function(i,o,a,s,l){a===void 0&&(a=0),s===void 0&&(s=0),l===void 0&&(l=!0),typeof o=="number"&&(o=Un(o,a,s));var c=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.rotateLocal(i,o);else{var u=Ii();xO(u,o[0],o[1],o[2]);var f=n.getRotation(i),d=n.getRotation(i.parentNode);SO(r,d),yN(r,r),wf(u,r,u),wf(c.localRotation,u,f),wO(c.localRotation,c.localRotation),l&&n.dirtifyLocal(i,c)}}}(),this.rotateLocal=function(){var r=Ii();return function(i,o,a,s,l){a===void 0&&(a=0),s===void 0&&(s=0),l===void 0&&(l=!0),typeof o=="number"&&(o=Un(o,a,s));var c=i.transformable;xO(r,o[0],o[1],o[2]),yJ(c.localRotation,c.localRotation,r),l&&n.dirtifyLocal(i,c)}}(),this.setEulerAngles=function(){var r=Ii();return function(i,o,a,s,l){a===void 0&&(a=0),s===void 0&&(s=0),l===void 0&&(l=!0),typeof o=="number"&&(o=Un(o,a,s));var c=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.setLocalEulerAngles(i,o);else{xO(c.localRotation,o[0],o[1],o[2]);var u=n.getRotation(i.parentNode);SO(r,yN(Ii(),u)),yJ(c.localRotation,c.localRotation,r),l&&n.dirtifyLocal(i,c)}}}(),this.translateLocal=function(){return function(r,i,o,a,s){o===void 0&&(o=0),a===void 0&&(a=0),s===void 0&&(s=!0),typeof i=="number"&&(i=Un(i,o,a));var l=r.transformable;P1(i,Mn())||(lKe(i,i,l.localRotation),vg(l.localPosition,l.localPosition,i),s&&n.dirtifyLocal(r,l))}}(),this.setPosition=function(){var r=er(),i=Mn();return function(o,a,s){s===void 0&&(s=!0);var l=o.transformable;if(i[0]=a[0],i[1]=a[1],i[2]=a[2]||0,!P1(n.getPosition(o),i)){if(xf(l.position,i),o.parentNode===null||!o.parentNode.transformable)xf(l.localPosition,i);else{var c=o.parentNode.transformable;dg(r,c.worldTransform),vl(r,r),Zi(l.localPosition,i,r)}s&&n.dirtifyLocal(o,l)}}}(),this.setLocalPosition=function(){var r=Mn();return function(i,o,a){a===void 0&&(a=!0);var s=i.transformable;r[0]=o[0],r[1]=o[1],r[2]=o[2]||0,!P1(s.localPosition,r)&&(xf(s.localPosition,r),a&&n.dirtifyLocal(i,s))}}(),this.translate=function(){var r=Mn(),i=Mn(),o=Mn();return function(a,s,l,c,u){l===void 0&&(l=0),c===void 0&&(c=0),u===void 0&&(u=!0),typeof s=="number"&&(s=gl(i,s,l,c)),!P1(s,r)&&(vg(o,n.getPosition(a),s),n.setPosition(a,o,u))}}(),this.setRotation=function(){var r=Ii();return function(i,o,a,s,l,c){c===void 0&&(c=!0);var u=i.transformable;if(typeof o=="number"&&(o=bN(o,a,s,l)),i.parentNode===null||!i.parentNode.transformable)n.setLocalRotation(i,o);else{var f=n.getRotation(i.parentNode);SO(r,f),yN(r,r),wf(u.localRotation,r,o),wO(u.localRotation,u.localRotation),c&&n.dirtifyLocal(i,u)}}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var r=er(),i=Mn(),o=bN(0,0,0,1);return function(a){var s=a.localSkew[0]!==0||a.localSkew[1]!==0;if(s){if($1(a.localTransform,a.localRotation,a.localPosition,Un(1,1,1),a.origin),a.localSkew[0]!==0||a.localSkew[1]!==0){var l=fh(r);l[4]=Math.tan(a.localSkew[0]),l[1]=Math.tan(a.localSkew[1]),Do(a.localTransform,a.localTransform,l)}var c=$1(r,o,i,a.localScale,a.origin);Do(a.localTransform,a.localTransform,c)}else $1(a.localTransform,a.localRotation,a.localPosition,a.localScale,a.origin)}}()}return e.prototype.matches=function(t,n){return this.runtime.sceneGraphSelector.is(t,n)},e.prototype.querySelector=function(t,n){return this.runtime.sceneGraphSelector.selectOne(t,n)},e.prototype.querySelectorAll=function(t,n){return this.runtime.sceneGraphSelector.selectAll(t,n)},e.prototype.attach=function(t,n,r){var i,o=!1;t.parentNode&&(o=t.parentNode!==n,this.detach(t)),t.parentNode=n,hn(r)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(r,0,t);var a=n.sortable;(!((i=a==null?void 0:a.sorted)===null||i===void 0)&&i.length||t.parsedStyle.zIndex)&&(a.dirtyChildren.indexOf(t)===-1&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=Dg.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(ott)},e.prototype.detach=function(t){var n,r;if(t.parentNode){var i=t.transformable,o=t.parentNode.sortable;(!((n=o==null?void 0:o.sorted)===null||n===void 0)&&n.length||!((r=t.style)===null||r===void 0)&&r.zIndex)&&(o.dirtyChildren.indexOf(t)===-1&&o.dirtyChildren.push(t),o.dirty=!0,o.dirtyReason=Dg.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(t,i),t.parentNode=null}},e.prototype.getOrigin=function(t){return t.getGeometryBounds(),t.transformable.origin},e.prototype.setOrigin=function(t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=[n,r,i]);var o=t.transformable;if(!(n[0]===o.origin[0]&&n[1]===o.origin[1]&&n[2]===o.origin[2])){var a=o.origin;a[0]=n[0],a[1]=n[1],a[2]=n[2]||0,this.dirtifyLocal(t,o)}},e.prototype.setLocalEulerAngles=function(t,n,r,i,o){r===void 0&&(r=0),i===void 0&&(i=0),o===void 0&&(o=!0),typeof n=="number"&&(n=Un(n,r,i));var a=t.transformable;xO(a.localRotation,n[0],n[1],n[2]),o&&this.dirtifyLocal(t,a)},e.prototype.scaleLocal=function(t,n,r){r===void 0&&(r=!0);var i=t.transformable;aKe(i.localScale,i.localScale,Un(n[0],n[1],n[2]||1)),r&&this.dirtifyLocal(t,i)},e.prototype.setLocalScale=function(t,n,r){r===void 0&&(r=!0);var i=t.transformable,o=Un(n[0],n[1],n[2]||i.localScale[2]);P1(o,i.localScale)||(xf(i.localScale,o),r&&this.dirtifyLocal(t,i))},e.prototype.setLocalRotation=function(t,n,r,i,o,a){a===void 0&&(a=!0),typeof n=="number"&&(n=bN(n,r,i,o));var s=t.transformable;SO(s.localRotation,n),a&&this.dirtifyLocal(t,s)},e.prototype.setLocalSkew=function(t,n,r){typeof n=="number"&&(n=pKe(n,r));var i=t.transformable;vKe(i.localSkew,n),this.dirtifyLocal(t,i)},e.prototype.dirtifyLocal=function(t,n){n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtifyWorld(t,n))},e.prototype.dirtifyWorld=function(t,n){n.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,n),this.dirtifyToRoot(t,!0)},e.prototype.triggerPendingEvents=function(){var t=this,n=new Set,r=function(i,o){i.isConnected&&!n.has(i.entity)&&(t.boundsChangedEvent.detail=o,t.boundsChangedEvent.target=i,i.isMutationObserved?i.dispatchEvent(t.boundsChangedEvent):i.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),n.add(i.entity))};this.pendingEvents.forEach(function(i){var o=se(i,2),a=o[0],s=o[1];s.affectChildren?a.forEach(function(l){r(l,s)}):r(a,s)}),this.clearPendingEvents(),n.clear()},e.prototype.clearPendingEvents=function(){this.pendingEvents=[]},e.prototype.dirtifyToRoot=function(t,n){n===void 0&&(n=!1);var r=t;for(r.renderable&&(r.renderable.dirty=!0);r;)Xne(r),r=r.parentNode;n&&t.forEach(function(i){Xne(i)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:n}])},e.prototype.updateDisplayObjectDependency=function(t,n,r,i){if(n&&n!==r){var o=this.displayObjectDependencyMap.get(n);if(o&&o[t]){var a=o[t].indexOf(i);o[t].splice(a,1)}}if(r){var s=this.displayObjectDependencyMap.get(r);s||(this.displayObjectDependencyMap.set(r,{}),s=this.displayObjectDependencyMap.get(r)),s[t]||(s[t]=[]),s[t].push(i)}},e.prototype.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(i){r[i].forEach(function(o){n.dirtifyToRoot(o,!0),o.dispatchEvent(new Th(Sn.ATTR_MODIFIED,o,n,n,i,Th.MODIFICATION,n,n)),o.isCustomElement&&o.isConnected&&o.attributeChangedCallback&&o.attributeChangedCallback(i,n,n)})})},e.prototype.getPosition=function(t){var n=t.transformable;return mO(n.position,this.getWorldTransform(t,n))},e.prototype.getRotation=function(t){var n=t.transformable;return yO(n.rotation,this.getWorldTransform(t,n))},e.prototype.getScale=function(t){var n=t.transformable;return pg(n.scaling,this.getWorldTransform(t,n))},e.prototype.getWorldTransform=function(t,n){return n===void 0&&(n=t.transformable),!n.localDirtyFlag&&!n.dirtyFlag||(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,n)),n.worldTransform},e.prototype.getLocalPosition=function(t){return t.transformable.localPosition},e.prototype.getLocalRotation=function(t){return t.transformable.localRotation},e.prototype.getLocalScale=function(t){return t.transformable.localScale},e.prototype.getLocalSkew=function(t){return t.transformable.localSkew},e.prototype.getLocalTransform=function(t){var n=t.transformable;return n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.localTransform},e.prototype.setLocalTransform=function(t,n){var r=mO(Mn(),n),i=yO(Ii(),n),o=pg(Mn(),n);this.setLocalScale(t,o,!1),this.setLocalPosition(t,r,!1),this.setLocalRotation(t,i,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)},e.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},e.prototype.getTransformedGeometryBounds=function(t,n,r){n===void 0&&(n=!1);var i=this.getGeometryBounds(t,n);if(vi.isEmpty(i))return null;var o=r||new vi;return o.setFromTransformedAABB(i,this.getWorldTransform(t)),o},e.prototype.getGeometryBounds=function(t,n){n===void 0&&(n=!1);var r=t.geometry;r.dirty&&Ve.styleValueRegistry.updateGeometry(t);var i=n?r.renderBounds:r.contentBounds||null;return i||new vi},e.prototype.getBounds=function(t,n){var r=this;n===void 0&&(n=!1);var i=t.renderable;if(!i.boundsDirty&&!n&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&n&&i.renderBounds)return i.renderBounds;var o=n?i.renderBounds:i.bounds,a=this.getTransformedGeometryBounds(t,n,o),s=t.childNodes;if(s.forEach(function(u){var f=r.getBounds(u,n);f&&(a?a.add(f):(a=o||new vi,a.update(f.center,f.halfExtents)))}),a||(a=new vi),n){var l=Fne(t);if(l){var c=l.parsedStyle.clipPath.getBounds(n);a?c&&(a=c.intersection(a)):a.update(c.center,c.halfExtents)}}return n?(i.renderBounds=a,i.renderBoundsDirty=!1):(i.bounds=a,i.boundsDirty=!1),a},e.prototype.getLocalBounds=function(t){if(t.parentNode){var n=er();t.parentNode.transformable&&(n=vl(er(),this.getWorldTransform(t.parentNode)));var r=this.getBounds(t);if(!vi.isEmpty(r)){var i=new vi;return i.setFromTransformedAABB(r,n),i}}return this.getBounds(t)},e.prototype.getBoundingClientRect=function(t){var n,r,i,o=this.getGeometryBounds(t);vi.isEmpty(o)||(i=new vi,i.setFromTransformedAABB(o,this.getWorldTransform(t)));var a=(r=(n=t.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.getContextService().getBoundingClientRect();if(i){var s=se(i.getMin(),2),l=s[0],c=s[1],u=se(i.getMax(),2),f=u[0],d=u[1];return new _h(l+((a==null?void 0:a.left)||0),c+((a==null?void 0:a.top)||0),f-l,d-c)}return new _h((a==null?void 0:a.left)||0,(a==null?void 0:a.top)||0,0,0)},e.prototype.dirtifyWorldInternal=function(t,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,t.childNodes.forEach(function(o){var a=o.transformable;a.dirtyFlag||r.dirtifyWorldInternal(o,a)});var i=t.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0)}},e.prototype.syncHierarchy=function(t){var n=t.transformable;if(!n.frozen){n.frozen=!0,(n.localDirtyFlag||n.dirtyFlag)&&this.sync(t,n);for(var r=t.childNodes,i=0;i<r.length;i++)this.syncHierarchy(r[i])}},e.prototype.sync=function(t,n){if(n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.dirtyFlag){var r=t.parentNode,i=r&&r.transformable;r===null||!i?dg(n.worldTransform,n.localTransform):Do(n.worldTransform,i.worldTransform,n.localTransform),n.dirtyFlag=!1}},e.prototype.unfreezeParentToRoot=function(t){for(var n=t.parentNode;n;){var r=n.transformable;r&&(r.frozen=!1),n=n.parentNode}},e}(),Ih={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Zne=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,stt=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,ltt=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,ctt=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,utt=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,ftt=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,dtt=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,htt=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,ptt=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,vtt=new RegExp("".concat(stt.source,"|").concat(ctt.source,"|").concat(ftt.source,"|").concat(htt.source)),gtt=new RegExp("".concat(ltt.source,"|").concat(utt.source,"|").concat(dtt.source,"|").concat(ptt.source)),mtt=function(){function e(t){var n=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(r,i){return n.isBreakingSpace(i)?!1:!!(r&&(gtt.exec(i)||vtt.exec(r)))},this.trimByKinsokuShorui=function(r){var i=it([],se(r),!1),o=i[i.length-2];if(!o)return r;var a=o[o.length-1];return i[i.length-2]=o.slice(0,-1),i[i.length-1]=a+i[i.length-1],i}}return e.prototype.measureFont=function(t,n){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var r={ascent:0,descent:0,fontSize:0},i=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(n),o=this.runtime.offscreenCanvasCreator.getOrCreateContext(n,{willReadFrequently:!0});o.font=t;var a=Ih.MetricsString+Ih.BaselineSymbol,s=Math.ceil(o.measureText(a).width),l=Math.ceil(o.measureText(Ih.BaselineSymbol).width),c=Ih.HeightMultiplier*l;l=l*Ih.BaselineMultiplier|0,i.width=s,i.height=c,o.fillStyle="#f00",o.fillRect(0,0,s,c),o.font=t,o.textBaseline="alphabetic",o.fillStyle="#000",o.fillText(a,0,l);var u=o.getImageData(0,0,s||1,c||1).data,f=u.length,d=s*4,h=0,p=0,v=!1;for(h=0;h<l;++h){for(var g=0;g<d;g+=4)if(u[p+g]!==255){v=!0;break}if(!v)p+=d;else break}for(r.ascent=l-h,p=f-d,v=!1,h=c;h>l;--h){for(var g=0;g<d;g+=4)if(u[p+g]!==255){v=!0;break}if(!v)p-=d;else break}return r.descent=h-l,r.fontSize=r.ascent+r.descent,this.fontMetricsCache[t]=r,r},e.prototype.measureText=function(t,n,r){var i=n.fontSize,o=i===void 0?16:i,a=n.wordWrap,s=a===void 0?!1:a,l=n.lineHeight,c=n.lineWidth,u=c===void 0?1:c,f=n.textBaseline,d=f===void 0?"alphabetic":f,h=n.textAlign,p=h===void 0?"start":h,v=n.letterSpacing,g=v===void 0?0:v,m=n.textPath;n.textPathSide,n.textPathStartOffset;var y=n.leading,x=y===void 0?0:y,S=Fet(n),w=this.measureFont(S,r);w.fontSize===0&&(w.fontSize=o,w.ascent=o);var C=this.runtime.offscreenCanvasCreator.getOrCreateContext(r);C.font=S,n.isOverflowing=!1;var O=s?this.wordWrap(t,n,r):t,E=O.split(/(?:\r\n|\r|\n)/),_=new Array(E.length),$=0;if(m){m.getTotalLength();for(var P=0;P<E.length;P++)var T=C.measureText(E[P]).width+(E[P].length-1)*g}else{for(var P=0;P<E.length;P++){var I=C.measureText(E[P]).width+(E[P].length-1)*g;_[P]=I,$=Math.max($,I)}var T=$+u,M=l||w.fontSize+u,R=Math.max(M,w.fontSize+u)+(E.length-1)*(M+x);M+=x;var N=0;return d==="middle"?N=-R/2:d==="bottom"||d==="alphabetic"||d==="ideographic"?N=-R:(d==="top"||d==="hanging")&&(N=0),{font:S,width:T,height:R,lines:E,lineWidths:_,lineHeight:M,maxLineWidth:$,fontProperties:w,lineMetrics:_.map(function(A,j){var D=0;return p==="center"||p==="middle"?D-=A/2:(p==="right"||p==="end")&&(D-=A),new _h(D-u/2,N+j*M,A+u,M)})}}},e.prototype.setGraphemeOnPath=function(){},e.prototype.wordWrap=function(t,n,r){var i=this,o=n.wordWrapWidth,a=o===void 0?0:o,s=n.letterSpacing,l=s===void 0?0:s,c=n.maxLines,u=c===void 0?1/0:c,f=n.textOverflow,d=this.runtime.offscreenCanvasCreator.getOrCreateContext(r),h=a+l,p="";f==="ellipsis"?p="...":f&&f!=="clip"&&(p=f);for(var v=[],g=0,m=0,y={},x=function(N){return i.getFromCache(N,l,y,d)},S=Array.from(p).reduce(function(N,k){return N+x(k)},0),w=Array.from(t),C=0;C<w.length;C++){var O=w[C],E=t[C-1],_=t[C+1],$=x(O);if(this.isNewline(O)){if(g++,g>=u){n.isOverflowing=!0;break}m=0,v[g]="";continue}if(m>0&&m+$>h){if(g+1>=u){if(n.isOverflowing=!0,S>0&&S<=h){for(var P=v[g].length,T=0,I=P,M=0;M<P;M++){var R=x(v[g][M]);if(T+R+S>h){I=M;break}T+=R}v[g]=(v[g]||"").slice(0,I)+p}break}if(g++,m=0,v[g]="",this.isBreakingSpace(O))continue;this.canBreakInLastChar(O)||(v=this.trimToBreakable(v),m=this.sumTextWidthByCache(v[g]||"",y)),this.shouldBreakByKinsokuShorui(O,_)&&(v=this.trimByKinsokuShorui(v),m+=x(E||""))}m+=$,v[g]=(v[g]||"")+O}return v.join(`
|
650
|
+
`,Zqe=1,Qqe=3,Jqe=function(e){Nt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.imageRef=b.createRef(),n.videoRef=b.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document!="undefined"?document:null,n.currentWindow=typeof window!="undefined"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver=="undefined"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=qqe(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=i.crop,a=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}else if(n.props.initialCroppedAreaPixels){var s=Kqe(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=s.crop,a=s.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}},n.computeSizes=function(){var r,i,o,a,s,l,c=n.imageRef.current||n.videoRef.current;if(c&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var u=n.containerRect.width/n.containerRect.height,f=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,d=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=n.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,h=c.offsetWidth<f||c.offsetHeight<d,p=f/d,v=void 0;if(h)switch(n.state.mediaObjectFit){default:case"contain":v=u>p?{width:n.containerRect.height*p,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/p};break;case"horizontal-cover":v={width:n.containerRect.width,height:n.containerRect.width/p};break;case"vertical-cover":v={width:n.containerRect.height*p,height:n.containerRect.height};break}else v={width:c.offsetWidth,height:c.offsetHeight};n.mediaSize=ke(ke({},v),{naturalWidth:f,naturalHeight:d}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var g=n.props.cropSize?n.props.cropSize:zqe(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((s=n.state.cropSize)===null||s===void 0?void 0:s.height)!==g.height||((l=n.state.cropSize)===null||l===void 0?void 0:l.width)!==g.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(g),n.setState({cropSize:g},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(g),g}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var i=t.getMousePoint(r),o=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var a=n.gestureRotationStart+r.rotation;n.props.onRotationChange(a)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,o,a=r.x,s=r.y;n.dragStartPosition={x:a,y:s},n.dragStartCrop=ke({},n.props.crop),(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i)},n.onDrag=function(r){var i=r.x,o=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||o===void 0)){var a=i-n.dragStartPosition.x,s=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+a,y:n.dragStartCrop.y+s},c=n.props.restrictPosition?uO(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(c)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=t.getMousePoint(r),o=Bqe(r).pixelY,a=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(a,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var s,l;return(l=(s=n.props).onInteractionStart)===null||l===void 0?void 0:l.call(s)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var s,l;return(l=(s=n.props).onInteractionEnd)===null||l===void 0?void 0:l.call(s)})},250)}},n.getPointOnContainer=function(r,i){var o=r.x,a=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-i.x),y:n.containerRect.height/2-(a-i.y)}},n.getPointOnMedia=function(r){var i=r.x,o=r.y,a=n.props,s=a.crop,l=a.zoom;return{x:(i+s.x)/l,y:(o+s.y)/l}},n.setNewZoom=function(r,i,o){var a=o===void 0?{}:o,s=a.shouldUpdatePosition,l=s===void 0?!0:s;if(!(!n.state.cropSize||!n.props.onZoomChange)){var c=fO(r,n.props.minZoom,n.props.maxZoom);if(l){var u=n.getPointOnContainer(i,n.containerPosition),f=n.getPointOnMedia(u),d={x:f.x*c-u.x,y:f.y*c-u.y},h=n.props.restrictPosition?uO(d,n.mediaSize,n.state.cropSize,c,n.props.rotation):d;n.props.onCropChange(h)}n.props.onZoomChange(c)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?uO(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return Wqe(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?uO(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver=="undefined"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=Xqe,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver=="undefined"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,i,o,a,s,l,c,u,f;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((o=n.cropSize)===null||o===void 0?void 0:o.width)!==((a=this.props.cropSize)===null||a===void 0?void 0:a.width)?this.computeSizes():(((s=n.crop)===null||s===void 0?void 0:s.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((c=n.crop)===null||c===void 0?void 0:c.y)!==((u=this.props.crop)===null||u===void 0?void 0:u.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((f=this.videoRef.current)===null||f===void 0||f.load());var d=this.getObjectFit();d!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:d},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},t.prototype.getObjectFit=function(){var n,r,i,o;if(this.props.objectFit==="cover"){var a=this.imageRef.current||this.videoRef.current;if(a&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,l=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,c=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,u=l/c;return u<s?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),i=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=CQ(r,i),this.lastPinchRotation=OQ(r,i),this.onDragStart(EQ(r,i))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]),a=EQ(i,o);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=CQ(i,o),l=r.props.zoom*(s/r.lastPinchDistance);r.setNewZoom(l,a,{shouldUpdatePosition:!1}),r.lastPinchDistance=s;var c=OQ(i,o),u=r.props.rotation+(c-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(u),r.lastPinchRotation=c})}},t.prototype.render=function(){var n=this,r,i=this.props,o=i.image,a=i.video,s=i.mediaProps,l=i.transform,c=i.crop,u=c.x,f=c.y,d=i.rotation,h=i.zoom,p=i.cropShape,v=i.showGrid,g=i.style,m=g.containerStyle,y=g.cropAreaStyle,x=g.mediaStyle,S=i.classes,w=S.containerClassName,C=S.cropAreaClassName,O=S.mediaClassName,E=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return b.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function($){return n.containerRef=$},"data-testid":"container",style:m,className:dO("reactEasyCrop_Container",w)},o?b.createElement("img",ke({alt:"",className:dO("reactEasyCrop_Image",E==="contain"&&"reactEasyCrop_Contain",E==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",E==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",O)},s,{src:o,ref:this.imageRef,style:ke(ke({},x),{transform:l||"translate(".concat(u,"px, ").concat(f,"px) rotate(").concat(d,"deg) scale(").concat(h,")")}),onLoad:this.onMediaLoad})):a&&b.createElement("video",ke({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:dO("reactEasyCrop_Video",E==="contain"&&"reactEasyCrop_Contain",E==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",E==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",O)},s,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:ke(ke({},x),{transform:l||"translate(".concat(u,"px, ").concat(f,"px) rotate(").concat(d,"deg) scale(").concat(h,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function(_){return b.createElement("source",ke({key:_.src},_))})),this.state.cropSize&&b.createElement("div",{style:ke(ke({},y),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:dO("reactEasyCrop_CropArea",p==="round"&&"reactEasyCrop_CropAreaRound",v&&"reactEasyCrop_CropAreaGrid",C)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:Qqe,minZoom:Zqe,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t}(b.Component);const Hl="img-crop",ZR=1,m1=.1,hO=0,_Q=-180,$Q=180,QR=1,PQ=.5,MQ=2,y1=.01,eGe=b.forwardRef((e,t)=>{const{cropperRef:n,zoomSlider:r,rotationSlider:i,aspectSlider:o,showReset:a,resetBtnText:s,modalImage:l,aspect:c,minZoom:u,maxZoom:f,cropShape:d,showGrid:h,cropperProps:p}=e,[v,g]=b.useState(ZR),[m,y]=b.useState(hO),[x,S]=b.useState(c),w=v!==ZR||m!==hO||x!==c,C=()=>{g(ZR),y(hO),S(c)},[O,E]=b.useState({x:0,y:0}),_=b.useRef({width:0,height:0,x:0,y:0}),$=b.useCallback((M,R)=>{_.current=R},[]);b.useImperativeHandle(t,()=>({rotation:m,cropPixelsRef:_,onReset:C}));const P="[display:flex] [align-items:center] [width:60%] [margin-inline:auto]",T="[display:flex] [align-items:center] [justify-content:center] [height:32px] [width:32px] [background:transparent] [border:0] [font-family:inherit] [font-size:18px] [cursor:pointer] disabled:[opacity:20%] disabled:[cursor:default]",I="[flex:1]";return ce.jsxs(ce.Fragment,{children:[ce.jsx(Jqe,Object.assign({},p,{ref:n,image:l,crop:O,zoom:v,rotation:m,aspect:x,minZoom:u,maxZoom:f,zoomWithScroll:r,cropShape:d,showGrid:h,onCropChange:E,onZoomChange:g,onRotationChange:y,onCropComplete:$,classes:{containerClassName:`${Hl}-container ![position:relative] [width:100%] [height:40vh] [&~section:first-of-type]:[margin-top:16px] [&~section:last-of-type]:[margin-bottom:16px]`,mediaClassName:`${Hl}-media`}})),r&&ce.jsxs("section",{className:`${Hl}-control ${Hl}-control-zoom ${P}`,children:[ce.jsx("button",{className:T,onClick:()=>g(+(v-m1).toFixed(1)),disabled:v-m1<u,children:"-"}),ce.jsx(X5,{className:I,min:u,max:f,step:m1,value:v,onChange:g}),ce.jsx("button",{className:T,onClick:()=>g(+(v+m1).toFixed(1)),disabled:v+m1>f,children:"+"})]}),i&&ce.jsxs("section",{className:`${Hl}-control ${Hl}-control-rotation ${P}`,children:[ce.jsx("button",{className:`${T} [font-size:16px]`,onClick:()=>y(m-QR),disabled:m===_Q,children:"↺"}),ce.jsx(X5,{className:I,min:_Q,max:$Q,step:QR,value:m,onChange:y}),ce.jsx("button",{className:`${T} [font-size:16px]`,onClick:()=>y(m+QR),disabled:m===$Q,children:"↻"})]}),o&&ce.jsxs("section",{className:`${Hl}-control ${Hl}-control-aspect ${P}`,children:[ce.jsx("button",{className:T,onClick:()=>S(+(x-y1).toFixed(2)),disabled:x-y1<PQ,children:"↕️"}),ce.jsx(X5,{className:I,min:PQ,max:MQ,step:y1,value:x,onChange:S}),ce.jsx("button",{className:T,onClick:()=>S(+(x+y1).toFixed(2)),disabled:x+y1>MQ,children:"↔️"})]}),a&&(r||i||o)&&ce.jsx(yn,{className:"[bottom:20px] [position:absolute]",style:w?{}:{opacity:.3,pointerEvents:"none"},onClick:C,children:s})]})});var tGe=b.memo(eGe);function nGe(e,t){t===void 0&&(t={});var n=t.insertAt;if(typeof document!="undefined"){var r=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css",n==="top"&&r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}var rGe=".visible{visibility:visible}.grid{display:grid}.\\[align-items\\:center\\]{align-items:center}.\\[background\\:transparent\\]{background:transparent}.\\[border\\:0\\]{border:0}.\\[bottom\\:20px\\]{bottom:20px}.\\[cursor\\:pointer\\]{cursor:pointer}.\\[display\\:flex\\]{display:flex}.\\[flex\\:1\\]{flex:1}.\\[font-family\\:inherit\\]{font-family:inherit}.\\[font-size\\:16px\\]{font-size:16px}.\\[font-size\\:18px\\]{font-size:18px}.\\[height\\:32px\\]{height:32px}.\\[height\\:40vh\\]{height:40vh}.\\[justify-content\\:center\\]{justify-content:center}.\\[margin-inline\\:auto\\]{margin-inline:auto}.\\[position\\:absolute\\]{position:absolute}.\\!\\[position\\:relative\\]{position:relative!important}.\\[width\\:100\\%\\]{width:100%}.\\[width\\:32px\\]{width:32px}.\\[width\\:60\\%\\]{width:60%}.disabled\\:\\[cursor\\:default\\]:disabled{cursor:default}.disabled\\:\\[opacity\\:20\\%\\]:disabled{opacity:20%}.\\[\\&\\~section\\:first-of-type\\]\\:\\[margin-top\\:16px\\]~section:first-of-type{margin-top:16px}.\\[\\&\\~section\\:last-of-type\\]\\:\\[margin-bottom\\:16px\\]~section:last-of-type{margin-bottom:16px}";nGe(rGe,{insertAt:"top"});const iGe=Tqe(QB,"4.23.0")===-1?"visible":"open",lg=(e,t,n)=>t in e?(console.error(`\`${t}\` is deprecated, please use \`${n}\` instead`),e[t]):e[n],oGe=b.forwardRef((e,t)=>{const{quality:n=.4,fillColor:r="white",zoomSlider:i=!0,rotationSlider:o=!1,aspectSlider:a=!1,showReset:s=!1,resetText:l,aspect:c=1,minZoom:u=1,maxZoom:f=3,cropShape:d="rect",showGrid:h=!1,cropperProps:p,modalClassName:v,modalTitle:g,modalWidth:m,modalOk:y,modalCancel:x,onModalOk:S,onModalCancel:w,modalProps:C,beforeCrop:O,children:E}=e,_=lg(e,"zoom","zoomSlider")||!0,$=lg(e,"rotate","rotationSlider")||!1,P=lg(e,"shape","cropShape")||"rect",T=lg(e,"grid","showGrid")||!1;"onUploadFail"in e&&console.error("`onUploadFail` is removed, because the only way it is called, is when the file is rejected by beforeUpload"),lg(e,"modalMaskTransitionName","modalProps.maskTransitionName"),lg(e,"modalTransitionName","modalProps.transitionName");const I=b.useRef({});I.current.onModalOk=S,I.current.onModalCancel=w,I.current.beforeCrop=O;const M=b.useRef(null),R=b.useCallback(G=>{var q;const K=document.createElement("canvas"),X=K.getContext("2d"),Z=(((q=G==null?void 0:G.getRootNode)===null||q===void 0?void 0:q.call(G))||document).querySelector(`.${Hl}-media`),{width:Y,height:ne,x:ee,y:Q}=M.current.cropPixelsRef.current;if($&&M.current.rotation!==hO){const{naturalWidth:re,naturalHeight:ae}=Z,de=M.current.rotation*(Math.PI/180),ve=Math.abs(Math.sin(de)),le=Math.abs(Math.cos(de)),ue=re*le+ae*ve,be=ae*le+re*ve;K.width=ue,K.height=be,X.fillStyle=r,X.fillRect(0,0,ue,be);const ye=ue/2,Oe=be/2;X.translate(ye,Oe),X.rotate(de),X.translate(-ye,-Oe);const Me=(ue-re)/2,Ne=(be-ae)/2;X.drawImage(Z,0,0,re,ae,Me,Ne,re,ae);const me=X.getImageData(0,0,ue,be);K.width=Y,K.height=ne,X.putImageData(me,-ee,-Q)}else K.width=Y,K.height=ne,X.fillStyle=r,X.fillRect(0,0,Y,ne),X.drawImage(Z,ee,Q,Y,ne,0,0,Y,ne);return K},[r,$]),[N,k]=b.useState(""),A=b.useRef(),j=b.useRef(),D=b.useCallback(G=>zl(void 0,[G],void 0,function*({beforeUpload:q,file:K,resolve:X,reject:te}){const Z=K;if(typeof q!="function"){X(Z);return}try{const Y=yield q(K,[K]);X(Y===!1?!1:Y!==!0&&Y||Z)}catch(Y){te(Y)}}),[]),L=b.useCallback(G=>(q,K)=>new Promise((X,te)=>zl(void 0,void 0,void 0,function*(){let Z=q;if(typeof I.current.beforeCrop=="function")try{const ne=yield I.current.beforeCrop(q,K);if(ne===!1)return D({beforeUpload:G,file:q,resolve:X,reject:te});ne!==!0&&(Z=ne||q)}catch(ne){return D({beforeUpload:G,file:q,resolve:X,reject:te})}const Y=new FileReader;Y.addEventListener("load",()=>{typeof Y.result=="string"&&k(Y.result)}),Y.readAsDataURL(Z),A.current=()=>{var ne,ee;k(""),M.current.onReset();let Q=!1;(ee=(ne=I.current).onModalCancel)===null||ee===void 0||ee.call(ne,re=>{X(re),Q=!0}),Q||X(OC.LIST_IGNORE)},j.current=ne=>zl(void 0,void 0,void 0,function*(){k(""),M.current.onReset();const ee=R(ne.target),{type:Q,name:re,uid:ae}=Z;ee.toBlob(de=>zl(void 0,void 0,void 0,function*(){const ve=new File([de],re,{type:Q});Object.assign(ve,{uid:ae}),D({beforeUpload:G,file:ve,resolve:le=>{var ue,be;X(le),(be=(ue=I.current).onModalOk)===null||be===void 0||be.call(ue,le)},reject:le=>{var ue,be;te(le),(be=(ue=I.current).onModalOk)===null||be===void 0||be.call(ue,le)}})}),Q,n)})})),[R,n,D]),F=b.useCallback(G=>{const q=Array.isArray(G)?G[0]:G,K=q.props,{beforeUpload:X,accept:te}=K,Z=Ir(K,["beforeUpload","accept"]);return Object.assign(Object.assign({},q),{props:Object.assign(Object.assign({},Z),{accept:te||"image/*",beforeUpload:L(X)})})},[L]),B=b.useMemo(()=>{const G={};return m!==void 0&&(G.width=m),y!==void 0&&(G.okText=y),x!==void 0&&(G.cancelText=x),G},[x,y,m]),H=`${Hl}-modal${v?` ${v}`:""}`,W=(typeof window=="undefined"?"":window.navigator.language)==="zh-CN",V=g||(W?"编辑图片":"Edit image"),U=l||(W?"重置":"Reset");return ce.jsxs(ce.Fragment,{children:[F(E),N&&ce.jsx(oo,Object.assign({},C,B,{[iGe]:!0,title:V,onCancel:A.current,onOk:j.current,wrapClassName:H,maskClosable:!1,destroyOnClose:!0,children:ce.jsx(tGe,{ref:M,cropperRef:t,zoomSlider:_,rotationSlider:$,aspectSlider:a,showReset:s,resetBtnText:U,modalImage:N,aspect:c,minZoom:u,maxZoom:f,cropShape:P,showGrid:T,cropperProps:p})}))]})});var aGe=e=>new Promise((t,n)=>{const r=new FileReader;r.readAsDataURL(e),r.onload=()=>t(r.result),r.onerror=i=>n(i)}),sGe=e=>Ci(this,null,function*(){const n=yield(yield fetch(e)).blob();return new Promise((r,i)=>{const o=new FileReader;o.readAsDataURL(n),o.onloadend=()=>{const a=o.result;r(a)},o.onerror=a=>i(a)})}),lGe=e=>Ci(this,null,function*(){return e.split(",")[0].match(/:(.*?);/)[1]}),cGe={fromFile:aGe,fromURL:sGe,mimeType:lGe};const TQ=Rt(cGe),uGe=o=>{var a=o,{parentId:e,value:t,onChange:n,multiple:r}=a,i=Vs(a,["parentId","value","onChange","multiple"]);const{t:s}=ao("UploadInput"),[l,c]=b.useState(),u=v=>Ci(this,null,function*(){const g=r?v.fileList:v.fileList.slice(-1),m=[];for(const y of g)if(y.originFileObj){const x=yield TQ.fromFile(y.originFileObj);m.push(x)}else m.push(y.url);r?n&&n(m):n&&n(m[0])}),f=b.useMemo(()=>t?(Qv(t)?t:[t]).map((g,m)=>({uid:m,status:"done",url:g})):void 0,[t]),d=v=>Ci(this,null,function*(){c(v.url?v.url:yield TQ.fromFile(v.originFileObj))}),h=()=>c(void 0),p=()=>!1;return ce.jsxs(ce.Fragment,{children:[ce.jsx(oGe,{rotationSlider:!0,children:ce.jsx(OC,un(Le({listType:"picture-card",withCredentials:!0,beforeUpload:p,onChange:u,defaultFileList:f,multiple:r,onPreview:d},i),{children:ce.jsxs(Di,{children:[ce.jsx(CDe,{}),s("Upload")]})}))}),ce.jsx(oo,{footer:null,title:s("Preview Image"),open:!!l,onCancel:h,children:ce.jsx(Jw,{preview:!1,src:l})})]})},JR=(e,t,n)=>{switch(e){case sr.Input:return[br,{}];case sr.InputNumber:return[P5,{style:{width:"100%"}}];case sr.EmailInput:return[br,{}];case sr.PhoneInput:return[WFe,{}];case sr.SlugInput:return[VFe,{}];case sr.UrlInput:return[br,{}];case sr.PasswordInput:return[FFe,{parentId:n}];case sr.TextArea:return[br.TextArea,{}];case sr.RichTextArea:return[Eqe,{}];case sr.JsonTextArea:return[DFe,{}];case sr.Select:return[Mi,{style:{width:"100%"}}];case sr.AsyncSelect:return[AFe,{style:{width:"100%"}}];case sr.AsyncTransfer:return[LFe,{}];case sr.Switch:return[sK,{}];case sr.Checkbox:return[xs,{}];case sr.CheckboxGroup:return[xs.Group,{}];case sr.RadioGroup:return[af.Group,{}];case sr.DatePicker:return[Bc,{style:{width:"100%"}}];case sr.TimePicker:return[Zy,{style:{width:"100%"}}];case sr.DateTimePicker:return[Bc,{style:{width:"100%"},showTime:!0}];case sr.RangePicker:return[Bc.RangePicker,{style:{width:"100%"},placeholder:[t("Start"),t("End")]}];case sr.Upload:return[uGe,{parentId:n}];default:return[br,{}]}},fGe=({widgetType:e,widgetProps:t,value:n,onFilter:r,onReset:i})=>{const{t:o}=ao("List"),[a,s]=b.useState(),[l,c]=JR(e,o);b.useEffect(()=>{s(n)},[n]);const u=()=>{r(a)},f=d=>{switch(l){case br:case br.TextArea:case af.Group:s(d.target.value);break;default:s(d);break}};return ce.jsxs(oi,{style:{width:400},children:[ce.jsx(jn,{xs:24,style:{padding:10},children:ce.jsx(l,Le(Le({value:a,size:"middle",onChange:f,placeholder:o("Filter By")},c||{}),t||{}))}),ce.jsx(jn,{xs:24,style:{padding:10},children:ce.jsxs(Di,{align:"end",children:[ce.jsx(yn,{onClick:i,size:"small",children:o("Reset")}),ce.jsx(yn,{type:"primary",onClick:u,icon:l===br?ce.jsx(xv,{}):ce.jsx(fX,{}),size:"small",children:o("Filter")})]})})]})},IQ=(e,t,n,r,i,o,a)=>{const{t:s}=ao("List"),l=(e||{fields:[]}).fields;return b.useMemo(()=>{const c=l.filter(u=>!!u.list_configuration).sort((u,f)=>{var d,h;return(((d=u.list_configuration)==null?void 0:d.index)||0)-(((h=f.list_configuration)==null?void 0:h.index)||0)}).map(u=>{var f,d,h,p;return{title:WC(u.name),dataIndex:u.name,key:u.name,sorter:(f=u.list_configuration)==null?void 0:f.sorter,width:(d=u.list_configuration)==null?void 0:d.width,ellipsis:!0,filterIcon:(h=u.list_configuration)!=null&&h.filter_widget_type?n(u.name)?ce.jsx(xo,{title:s("Click to reset this filter"),children:ce.jsx(LK,{style:{color:"red"}})}):ce.jsx(xo,{title:s("Click to filter"),children:ce.jsx(fX,{})}):void 0,filterDropdown:(p=u.list_configuration)!=null&&p.filter_widget_type?({confirm:v,clearFilters:g})=>{var x,S;const m=()=>{i(u.name),g(),v()},y=w=>{r(u.name,w),v()};return ce.jsx(fGe,{widgetType:(x=u.list_configuration)==null?void 0:x.filter_widget_type,widgetProps:(S=u.list_configuration)==null?void 0:S.filter_widget_props,value:n(u.name),onFilter:y,onReset:m})}:void 0,render:(v,g)=>{var y,x,S;if(v===void 0)return(y=u.list_configuration)==null?void 0:y.empty_value_display;const m=vFe(v,(x=u.list_configuration)==null?void 0:x.empty_value_display,t);if((S=u==null?void 0:u.list_configuration)!=null&&S.is_link){const w=()=>a(g);return ce.jsx(yn,{style:{padding:0},type:"link",onClick:w,children:m})}return qC(m)&&(m.startsWith("http")||m.startsWith("/"))?ce.jsx("a",{href:m,target:"_blank",rel:"noreferrer",children:m}):m}}});return c.push({title:s("Actions"),key:"actions",width:100,fixed:"right",render:u=>{const f=()=>o(u),d=()=>a(u);return ce.jsxs(Di,{children:[((e==null?void 0:e.permissions)||[]).includes(Ya.Delete)&&ce.jsx(U5,{title:s("Are you sure?"),onConfirm:f,children:ce.jsx(yn,{size:"small",danger:!0,children:ce.jsx(vC,{})})}),((e==null?void 0:e.permissions)||[]).includes(Ya.Change)&&ce.jsx(yn,{size:"small",onClick:d,children:ce.jsx($I,{})})]})}}),c},[s,t,l,n,e==null?void 0:e.permissions,r,a,o,i])},b1=1,eN=10,RQ=e=>{const[t,n]=b.useState(),[r,i]=b.useState([]),[o,a]=b.useState({}),[s,l]=b.useState(),[c,u]=b.useState(b1),[f,d]=b.useState(eN),[h,p]=b.useState();return b.useEffect(()=>{e!=null&&e.list_per_page&&d(e==null?void 0:e.list_per_page)},[e==null?void 0:e.list_per_page]),b.useEffect(()=>{e!=null&&e.name&&(u(b1),p(void 0),a({}))},[e==null?void 0:e.name]),{defaultPage:b1,defaultPageSize:eN,page:c,setPage:u,pageSize:f,setPageSize:d,search:s,setSearch:l,filters:o,setFilters:a,sortBy:h,setSortBy:p,action:t,setAction:n,selectedRowKeys:r,setSelectedRowKeys:i,onTableChange:(m,y,x)=>{m.pageSize!==f?u(b1):u(m.current),d(m.pageSize),x.field&&p(x.order==="ascend"?x.field:`-${x.field}`)},resetTable:m=>{n(void 0),i([]),u(b1),d(eN),p(void 0),m||(a({}),l(void 0))}}},dGe=({modelConfiguration:e,parentId:t})=>{const{t:n}=ao("Inline"),{configuration:r}=b.useContext(pl),[i,o]=b.useState(!1),[a,s]=b.useState(!1),[l,c]=b.useState(),[u]=Jn.useForm(),[f]=Jn.useForm(),{defaultPage:d,defaultPageSize:h,page:p,setPage:v,pageSize:g,setPageSize:m,search:y,setSearch:x,filters:S,setFilters:w,sortBy:C,action:O,setAction:E,selectedRowKeys:_,setSelectedRowKeys:$,resetTable:P,onTableChange:T}=RQ(e),I=e.name,M=b.useCallback(()=>{o(!0)},[]),R=b.useCallback(()=>{P(),o(!1)},[P]),N=b.useCallback(()=>{u.resetFields(),s(!0),c(void 0),u.setFieldValue(e.fk_name,t)},[u,t,e.fk_name]),k=b.useCallback(()=>{s(!1),c(void 0)},[]),A=b.useCallback(le=>{f.resetFields(),c(le==null?void 0:le.id),s(!1)},[f]),j=b.useCallback(()=>{c(void 0),s(!1)},[]),D=Zv.stringify(Le({search:y,sort_by:C,offset:(p-1)*g,limit:g,[e.fk_name]:t},$R(S))),{data:L,isLoading:F,refetch:B}=vc({queryKey:[`/list/${I}`,D],queryFn:()=>Uc(`/list/${I}?${D}`),enabled:i,refetchOnWindowFocus:!1}),{data:H,isLoading:z}=vc({queryKey:[`/retrieve/${I}/${l}`],queryFn:()=>Uc(`/retrieve/${I}/${l}`),enabled:!!l,refetchOnWindowFocus:!1}),{mutate:W,isPending:V,isError:U}=Ko({mutationFn:le=>qc(`/add/${I}`,le),onSuccess:()=>{Ti.success(n("Succesfully added")),B(),k()},onError:le=>{Fl(le,u)}}),{mutate:G,isPending:q,isError:K}=Ko({mutationFn:le=>bR(`/change/${I}/${l}`,le),onSuccess:()=>{Ti.success(n("Succesfully changed")),B(),j()},onError:le=>{Fl(le,f)}}),{mutate:X}=Ko({mutationFn:le=>xR(`/delete/${I}/${le}`),onSuccess:()=>{P(e==null?void 0:e.preserve_filters),B(),Ti.success(n("Successfully deleted"))},onError:le=>{Fl(le)}}),{mutate:te,isPending:Z}=Ko({mutationFn:le=>qc(`/action/${I}/${O}`,le),onSuccess:()=>{P(e==null?void 0:e.preserve_filters),B(),Ti.success(n("Successfully applied"))},onError:()=>{Ti.error(n("Server error"))}}),Y=le=>$(le),ne=b.useCallback(()=>te({ids:_}),[te,_]),ee=r==null?void 0:r.datetime_format,Q=IQ(e,ee,b.useCallback(le=>S[le],[S]),b.useCallback((le,ue)=>{S[le]=ue,w(Le({},S)),v(d),m(h)},[d,h,S,w,v,m]),b.useCallback(le=>{delete S[le],w(Le({},S)),v(d),m(h)},[d,h,S,w,v,m]),b.useCallback(le=>{X(le.id)},[X]),b.useCallback(le=>{A(le)},[A])),re=le=>{W(le)},ae=le=>{G(le)},de=b.useCallback(()=>{var le,ue;return ce.jsxs(oi,{justify:"end",gutter:[8,8],children:[((e==null?void 0:e.actions)||[]).length>0&&(e==null?void 0:e.actions_on_top)&&ce.jsxs(jn,{children:[ce.jsx(Mi,{placeholder:n("Select Action By"),allowClear:!0,value:O,onChange:E,style:{width:300},children:((e==null?void 0:e.actions)||[]).map(be=>ce.jsx(Mi.Option,{value:be.name,children:be.description||be.name},be.name))}),ce.jsx(yn,{disabled:!O||_.length===0,style:{marginLeft:5},loading:Z,onClick:ne,children:n("Apply")})]}),((e==null?void 0:e.search_fields)||[]).length>0&&ce.jsx(jn,{children:ce.jsx(br.Search,{placeholder:(e==null?void 0:e.search_help_text)||n("Search By"),allowClear:!0,onSearch:x,style:{width:200}})}),((le=e==null?void 0:e.permissions)==null?void 0:le.includes(Ya.Export))&&ce.jsx(jn,{children:ce.jsx(hZ,{model:I,search:y,filters:un(Le({},S),{[e.fk_name]:t}),sortBy:C})}),((ue=e==null?void 0:e.permissions)==null?void 0:ue.includes(Ya.Add))&&ce.jsx(jn,{children:ce.jsxs(yn,{onClick:N,style:{marginRight:-10},children:[ce.jsx(nR,{})," ",n("Add")]})})]})},[e==null?void 0:e.actions,e==null?void 0:e.actions_on_top,e==null?void 0:e.search_fields,e==null?void 0:e.search_help_text,e==null?void 0:e.permissions,e.fk_name,n,O,E,_.length,Z,ne,x,I,y,S,t,C,N]),ve=b.useCallback(()=>{var le;return ce.jsx(ce.Fragment,{children:((le=e==null?void 0:e.permissions)==null?void 0:le.includes(Ya.Add))&&ce.jsx(oi,{justify:"space-between",children:ce.jsx(jn,{children:((e==null?void 0:e.actions)||[]).length>0&&(e==null?void 0:e.actions_on_bottom)&&ce.jsxs("div",{style:{marginLeft:-8},children:[ce.jsx(Mi,{placeholder:n("Select Action By"),allowClear:!0,value:O,onChange:E,style:{width:200},children:((e==null?void 0:e.actions)||[]).map(ue=>ce.jsx(Mi.Option,{value:ue.name,children:ue.description||ue.name},ue.name))}),ce.jsx(yn,{disabled:!O||_.length===0,style:{marginLeft:5},loading:Z,onClick:ne,children:n("Apply")})]})})})})},[n,O,Z,e==null?void 0:e.actions,e==null?void 0:e.actions_on_bottom,e==null?void 0:e.permissions,ne,_.length,E]);return ce.jsxs("div",{children:[ce.jsx(yn,{style:{minWidth:200},type:"dashed",onClick:M,children:n("Change")}),ce.jsx(oo,{width:"100%",open:i,title:Ka(e,!0),onCancel:R,footer:null,children:ce.jsx(oi,{children:ce.jsx(jn,{xs:24,children:ce.jsx(pZ,{title:de,footer:ve,loading:F,sticky:!0,rowSelection:((e==null?void 0:e.actions)||[]).length>0?{selectedRowKeys:_,onChange:Y}:void 0,columns:Q,onChange:T,rowKey:"id",dataSource:(L==null?void 0:L.results)||[],pagination:{current:p,pageSize:g,total:L==null?void 0:L.total,showSizeChanger:!0},scroll:{x:1e3}})})})}),ce.jsxs(oo,{width:600,open:a,title:`Add ${Ka(e)}`,onCancel:k,footer:null,children:[ce.jsx(Fc,{}),e!=null&&e.permissions.includes(Ya.Add)?ce.jsx(x1,{modelConfiguration:e,form:u,onFinish:re,mode:"inline-add",hasOperationError:U,children:ce.jsx(oi,{justify:"end",children:ce.jsx(jn,{children:ce.jsx(Di,{children:ce.jsxs(yn,{loading:V,htmlType:"submit",type:"primary",children:[ce.jsx(a1,{})," ",n("Add")]})})})})}):ce.jsx(io,{description:n("No permissions for model")})]}),ce.jsxs(oo,{width:600,open:!!l,title:`Change ${Ka(e)} ${l}`,onCancel:j,footer:null,children:[ce.jsx(Fc,{}),H&&e&&e.permissions.includes(Ya.Change)?ce.jsx(x1,{modelConfiguration:e,form:f,onFinish:ae,mode:"inline-change",hasOperationError:K,initialValues:dZ(H),children:ce.jsx(oi,{justify:"end",children:ce.jsx(jn,{children:ce.jsx(Di,{children:ce.jsxs(yn,{loading:q||z,htmlType:"submit",type:"primary",children:[ce.jsx(a1,{})," ",n("Save")]})})})})}):ce.jsx(io,{description:n("No permissions for model")})]})]})},x1=({modelConfiguration:e,id:t,form:n,onFinish:r,children:i,mode:o,hasOperationError:a,initialValues:s})=>{const{t:l}=ao("FormContainer"),[c,u]=b.useState(((e==null?void 0:e.fieldsets)||[]).filter(g=>{var m;return!(((m=g[1])==null?void 0:m.classes)||[]).includes("collapse")}).map(g=>{var m;return JSON.stringify((m=g[1])==null?void 0:m.fields)}));b.useEffect(()=>{a&&u(((e==null?void 0:e.fieldsets)||[]).map(g=>{var m;return JSON.stringify((m=g[1])==null?void 0:m.fields)}))},[a,e==null?void 0:e.fieldsets]);const f=b.useCallback(g=>{if(!g.form_widget_type)return null;const[m,y]=JR(g.form_widget_type,l,t);return ce.jsx(m,Le(Le({},y||{}),g.form_widget_props||{}))},[l,t]),d=b.useCallback(g=>o==="change"||o==="inline-change"?(g==null?void 0:g.change_configuration)||{}:(g==null?void 0:g.add_configuration)||{},[o]),h=b.useCallback(g=>g.map(m=>ce.jsx(Jn.Item,{name:m.name,label:WC(m.name),rules:[...d(m).required?[{required:!0}]:[],...d(m).form_widget_type===sr.EmailInput?[{type:"email"}]:[],...d(m).form_widget_type===sr.UrlInput?[{type:"url"}]:[],...d(m).form_widget_type===sr.JsonTextArea?[{validator:(y,x)=>Ci(this,null,function*(){if(!hFe(x))throw new Error(l("Invalid JSON"))})}]:[],...d(m).form_widget_type===sr.SlugInput?[{validator:(y,x)=>Ci(this,null,function*(){if(!pFe(x))throw new Error(l("Invalid Slug. Please use lowercase letters, numbers, and hyphens."))})}]:[]],valuePropName:[sr.Checkbox,sr.Switch,sr.CheckboxGroup].includes(d(m).form_widget_type)?"checked":void 0,children:f(d(m))},m.name)),[l,d,f]),p=b.useCallback(()=>{const g=((e==null?void 0:e.fields)||[]).filter(y=>!!d(y).form_widget_type).filter(y=>{var x,S,w,C;return o==="add"||o==="inline-add"?!((S=(x=y.add_configuration)==null?void 0:x.form_widget_props)!=null&&S.disabled)&&!((C=(w=y.add_configuration)==null?void 0:w.form_widget_props)!=null&&C.readOnly):!0}),m=(e==null?void 0:e.fieldsets)||[];if(m.length>0){const y=x=>u(x);return ce.jsx(jMe,{size:"small",expandIconPosition:"end",activeKey:c,onChange:y,items:m.map(x=>{var C;const S=x[0],w=(C=x[1])==null?void 0:C.fields;return{key:JSON.stringify(w),label:S||l("General"),children:h(g.filter(O=>(w||[]).includes(O.name)).sort((O,E)=>w.indexOf(O.name)-w.indexOf(E.name)))}})})}return h(g.sort((y,x)=>(d(y).index||0)-(d(x).index||0)))},[l,c,h,d,e==null?void 0:e.fields,e==null?void 0:e.fieldsets,o]),v=b.useCallback(()=>t?((e==null?void 0:e.inlines)||[]).map(g=>ce.jsx(Jn.Item,{label:Ka(g,!0),children:ce.jsx(dGe,{modelConfiguration:g,parentId:t})},g.name)):null,[e==null?void 0:e.inlines,t]);return ce.jsxs(Jn,{initialValues:s,layout:"vertical",form:n,onFinish:r,children:[(e==null?void 0:e.save_on_top)&&ce.jsxs(ce.Fragment,{children:[i,ce.jsx(Fc,{})]}),ce.jsxs(oi,{gutter:[32,32],children:[ce.jsx(jn,{xs:24,xl:o==="inline-add"||o==="inline-change"?24:12,children:p()}),o==="change"&&ce.jsx(jn,{xs:24,xl:12,children:v()})]}),ce.jsx(Fc,{}),i]})},hGe=()=>{const[e]=Jn.useForm(),t=zx(),n=Gv(),{configuration:r}=b.useContext(pl),{t:i}=ao("Add"),{model:o}=IC(),a=r.models.find(f=>f.name===o),{mutate:s,isPending:l,isError:c}=Ko({mutationFn:f=>qc(`/add/${o}`,f),onSuccess:()=>{Ti.success(i("Succesfully added")),t.invalidateQueries([`/list/${o}`]),n(`/list/${o}`)},onError:f=>{Fl(f,e)}}),u=f=>{const d=GC(f);s(d)};return ce.jsx(VC,{title:`${i("Add")} ${a&&Ka(a)}`,breadcrumbs:ce.jsx(My,{items:[{title:ce.jsx(vf,{to:"/",children:i("Dashboard")})},{title:ce.jsx(vf,{to:`/list/${o}`,children:a&&Ka(a)})},{title:i("Add")}]}),children:a!=null&&a.permissions.includes(Ya.Add)?ce.jsx(x1,{modelConfiguration:a,form:e,onFinish:u,mode:"add",hasOperationError:c,children:ce.jsx(oi,{justify:"end",children:ce.jsx(jn,{children:ce.jsx(Di,{children:ce.jsxs(yn,{loading:l,htmlType:"submit",type:"primary",children:[ce.jsx(a1,{})," ",i("Add")]})})})})}):ce.jsx(io,{description:i("No permissions for model")})})},pGe=()=>{const[e]=Jn.useForm(),t=f1(),n=zx(),r=Gv(),{configuration:i}=b.useContext(pl),{t:o}=ao("Change"),{model:a,id:s}=IC(),l=i.models.find(O=>O.name===a),{data:c,isLoading:u}=vc({queryKey:[`/retrieve/${a}/${s}`],queryFn:()=>Uc(`/retrieve/${a}/${s}`),refetchOnWindowFocus:!1}),{mutate:f,isPending:d,isError:h}=Ko({mutationFn:O=>qc(`/add/${a}`,O),onSuccess:()=>{Ti.success(o("Succesfully added")),n.invalidateQueries([`/list/${a}`]);const O=e.getFieldValue("next");O&&r(O)},onError:O=>{Fl(O,e)}}),{mutate:p,isPending:v,isError:g}=Ko({mutationFn:O=>bR(`/change/${a}/${s}`,O),onSuccess:()=>{Ti.success(o("Succesfully changed")),n.invalidateQueries([`/retrieve/${a}/${s}`]),n.invalidateQueries([`/list/${a}`]);const O=e.getFieldValue("next");O&&r(O)},onError:O=>{Fl(O,e)}}),{mutate:m}=Ko({mutationFn:()=>xR(`/delete/${a}/${s}`),onSuccess:()=>{Ti.success(o("Successfully deleted")),n.invalidateQueries([`/list/${a}`]),r(`/list/${a}`)},onError:()=>{Ti.error(o("Server error"))}}),y=O=>{if(e.getFieldValue("save_as_new")){f(GC(O));return}p(GC(O))},x=()=>m(),S=()=>{e.submit()},w=()=>{e.setFieldValue("next",`/add/${a}`),l!=null&&l.save_as&&e.setFieldValue("save_as_new",!0),e.submit()},C=()=>{l!=null&&l.save_as_continue||e.setFieldValue("next",`/list/${a}`),e.submit()};return ce.jsx(VC,{title:`${o("Change")} ${l&&Ka(l)} ${s}`,breadcrumbs:ce.jsx(My,{items:[{title:ce.jsx(vf,{to:"/",children:o("Dashboard")})},{title:ce.jsx(vf,{to:`/list/${a}`,children:l&&Ka(l)})},{title:s}]}),isLoading:u,children:c&&l&&l.permissions.includes(Ya.Change)?ce.jsx(x1,{modelConfiguration:l,id:s,form:e,onFinish:y,mode:"change",hasOperationError:g||h,initialValues:dZ(c),children:ce.jsxs(oi,{gutter:[8,8],justify:"space-between",children:[ce.jsx(jn,{children:ce.jsx(Di,{children:ce.jsx(U5,{title:o("Are you sure?"),onConfirm:x,children:ce.jsxs(yn,{danger:!0,children:[ce.jsx(vC,{})," ",o("Delete")]})})})}),ce.jsx(jn,{children:ce.jsxs(Di,{children:[!t&&!(l!=null&&l.save_as_continue)&&ce.jsxs(yn,{loading:v||d,onClick:S,type:"default",children:[ce.jsx(dX,{})," ",o("Save and continue editing")]}),!t&&ce.jsxs(yn,{loading:v||d,onClick:w,type:"default",children:[ce.jsx(dX,{})," ",l!=null&&l.save_as?o("Save as new"):o("Save and add another")]}),ce.jsxs(yn,{loading:v||d,onClick:C,type:"primary",children:[ce.jsx(a1,{})," ",o("Save")]})]})})]})}):ce.jsx(io,{description:o("No permissions for model")})})},NQ=()=>[["cartesian"]];NQ.props={};function vGe(e,t){return e=e%(2*Math.PI),t=t%(2*Math.PI),e<0&&(e=2*Math.PI+e),t<0&&(t=2*Math.PI+t),e>=t&&(t=t+2*Math.PI),{startAngle:e,endAngle:t}}const kQ=(e={})=>{const t={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1},n=Object.assign(Object.assign({},t),e);return Object.assign(Object.assign({},n),vGe(n.startAngle,n.endAngle))},S1=e=>{const{startAngle:t,endAngle:n,innerRadius:r,outerRadius:i}=kQ(e);return[["translate",0,.5],["reflect.y"],["translate",0,-.5],["polar",t,n,r,i]]};S1.props={};const tN=()=>[["transpose"],["translate",.5,.5],["reflect.x"],["translate",-.5,-.5]];tN.props={transform:!0};const gGe=(e={})=>{const t={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},t),e)},AQ=e=>{const{startAngle:t,endAngle:n,innerRadius:r,outerRadius:i}=gGe(e);return[...tN(),...S1({startAngle:t,endAngle:n,innerRadius:r,outerRadius:i})]};AQ.props={};const LQ=(e={})=>{const t={startAngle:-Math.PI/2,endAngle:Math.PI*3/2,innerRadius:0,outerRadius:1};return Object.assign(Object.assign({},t),e)},nN=e=>{const{startAngle:t,endAngle:n,innerRadius:r,outerRadius:i}=LQ(e);return[["transpose"],["translate",.5,.5],["reflect"],["translate",-.5,-.5],...S1({startAngle:t,endAngle:n,innerRadius:r,outerRadius:i})]};nN.props={};const rN=()=>[["parallel",0,1,0,1]];rN.props={};const jQ=({focusX:e=0,focusY:t=0,distortionX:n=2,distortionY:r=2,visual:i=!1})=>[["fisheye",e,t,n,r,i]];jQ.props={transform:!0};const DQ=e=>{const{startAngle:t=-Math.PI/2,endAngle:n=Math.PI*3/2,innerRadius:r=0,outerRadius:i=1}=e;return[...rN(),...S1({startAngle:t,endAngle:n,innerRadius:r,outerRadius:i})]};DQ.props={};const FQ=({value:e})=>t=>t.map(()=>e);FQ.props={};const BQ=({value:e})=>t=>t.map(e);BQ.props={};const zQ=({value:e})=>t=>t.map(n=>n[e]);zQ.props={};const HQ=({value:e})=>()=>e;HQ.props={};var cg=function(e){return e!==null&&typeof e!="function"&&isFinite(e.length)},WQ=function(e,t){if(!cg(e))return e;for(var n=[],r=0;r<e.length;r++){var i=e[r];t(i,r)&&n.push(i)}return n};const ea=function(e){return typeof e=="function"};var hn=function(e){return e==null},mGe={}.toString,w1=function(e,t){return mGe.call(e)==="[object "+t+"]"};const Hi=function(e){return Array.isArray?Array.isArray(e):w1(e,"Array")},lh=function(e){var t=typeof e;return e!==null&&t==="object"||t==="function"};function iN(e,t){if(e){var n;if(Hi(e))for(var r=0,i=e.length;r<i&&(n=t(e[r],r),n!==!1);r++);else if(lh(e)){for(var o in e)if(e.hasOwnProperty(o)&&(n=t(e[o],o),n===!1))break}}}var oN=Object.keys?function(e){return Object.keys(e)}:function(e){var t=[];return iN(e,function(n,r){ea(e)&&r==="prototype"||t.push(r)}),t};function yGe(e,t){var n=oN(t),r=n.length;if(hn(e))return!r;for(var i=0;i<r;i+=1){var o=n[i];if(t[o]!==e[o]||!(o in e))return!1}return!0}var aN=function(e){return typeof e=="object"&&e!==null},Yc=function(e){if(!aN(e)||!w1(e,"Object"))return!1;if(Object.getPrototypeOf(e)===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t};function ug(e,t){if(!Hi(e))return null;var n;if(ea(t)&&(n=t),Yc(t)&&(n=function(i){return yGe(i,t)}),n){for(var r=0;r<e.length;r+=1)if(n(e[r]))return e[r]}return null}const pO=function(e){if(Hi(e))return e.reduce(function(t,n){return Math.max(t,n)},e[0])},vO=function(e){if(Hi(e))return e.reduce(function(t,n){return Math.min(t,n)},e[0])};var VQ=function(e,t,n){if(!Hi(e)&&!Yc(e))return e;var r=n;return iN(e,function(i,o){r=t(r,i,o)}),r};const Wr=function(e){return w1(e,"String")};function C1(e){if(cg(e)){var t=e;return t[t.length-1]}}var ai=function(e,t,n){return e<t?t:e>n?n:e},_r=function(e){return w1(e,"Number")},bGe=1e-5;function O1(e,t,n){return n===void 0&&(n=bGe),Math.abs(e-t)<n}const xGe=function(e,t){if(Hi(e)){for(var n,r=-1/0,i=0;i<e.length;i++){var o=e[i],a=ea(t)?t(o):o[t];a>r&&(n=o,r=a)}return n}},SGe=function(e,t){if(Hi(e)){for(var n,r=1/0,i=0;i<e.length;i++){var o=e[i],a=ea(t)?t(o):o[t];a<r&&(n=o,r=a)}return n}};var UQ=function(e,t){return(e%t+t)%t};const qQ=function(e){return hn(e)?"":e.toString()};var GQ=function(e){var t=qQ(e);return t.charAt(0).toLowerCase()+t.substring(1)};function wGe(e,t){return!e||!t?e:e.replace(/\\?\{([^{}]+)\}/g,function(n,r){return n.charAt(0)==="\\"?n.slice(1):t[r]===void 0?"":t[r]})}var mf=function(e){var t=qQ(e);return t.charAt(0).toUpperCase()+t.substring(1)},KQ=function(e){return w1(e,"Boolean")},CGe=function(e){return e===null},xr=function(e){return e===void 0};function YQ(e,t){for(var n in t)t.hasOwnProperty(n)&&n!=="constructor"&&t[n]!==void 0&&(e[n]=t[n])}function OGe(e,t,n,r){return t&&YQ(e,t),n&&YQ(e,n),e}var E1=function(e){if(typeof e!="object"||e===null)return e;var t;if(Hi(e)){t=[];for(var n=0,r=e.length;n<r;n++)typeof e[n]=="object"&&e[n]!=null?t[n]=E1(e[n]):t[n]=e[n]}else{t={};for(var i in e)typeof e[i]=="object"&&e[i]!=null?t[i]=E1(e[i]):t[i]=e[i]}return t};function XQ(e,t,n){var r;return function(){var i=this,o=arguments,a=function(){r=null,e.apply(i,o)};clearTimeout(r),r=setTimeout(a,t)}}function EGe(e){var t,n,r,i=e;function o(s,l){++t>i&&(r=n,a(1),++t),n[s]=l}function a(s){t=0,n=Object.create(null),s||(r=Object.create(null))}return a(),{clear:a,has:function(s){return n[s]!==void 0||r[s]!==void 0},get:function(s){var l=n[s];if(l!==void 0)return l;if((l=r[s])!==void 0)return o(s,l),l},set:function(s,l){n[s]!==void 0?n[s]=l:o(s,l)}}}const _Ge=function(e,t,n){if(!ea(e))throw new TypeError("Expected a function");var r=function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var a=t?t.apply(this,i):i[0],s=r.cache;if(s.has(a))return s.get(a);var l=e.apply(this,i);return s.set(a,l),l};return r.cache=EGe(n),r};var $Ge=5;function PGe(e,t){if(Object.hasOwn)return Object.hasOwn(e,t);if(e==null)throw new TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)}function ZQ(e,t,n,r){n=n||0,r=r||$Ge;for(var i in t)if(PGe(t,i)){var o=t[i];o!==null&&Yc(o)?(Yc(e[i])||(e[i]={}),n<r?ZQ(e[i],o,n+1,r):e[i]=t[i]):Hi(o)?(e[i]=[],e[i]=e[i].concat(o)):o!==void 0&&(e[i]=o)}}var Ue=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r+=1)ZQ(e,t[r]);return e},QQ=function(e,t){if(!cg(e))return-1;var n=Array.prototype.indexOf;if(n)return n.call(e,t);for(var r=-1,i=0;i<e.length;i++)if(e[i]===t){r=i;break}return r},gO=function(e,t){if(e===t)return!0;if(!e||!t||Wr(e)||Wr(t))return!1;if(cg(e)||cg(t)){if(e.length!==t.length)return!1;for(var n=!0,r=0;r<e.length&&(n=gO(e[r],t[r]),!!n);r++);return n}if(aN(e)||aN(t)){var i=Object.keys(e),o=Object.keys(t);if(i.length!==o.length)return!1;for(var n=!0,r=0;r<i.length&&(n=gO(e[i[r]],t[i[r]]),!!n);r++);return n}return!1};const Hn=function(e,t,n){for(var r=0,i=Wr(t)?t.split("."):t;e&&r<i.length;)e=e[i[r++]];return e===void 0||r<i.length?n:e},MGe=function(e,t,n){var r=e,i=Wr(t)?t.split("."):t;return i.forEach(function(o,a){a<i.length-1?(lh(r[o])||(r[o]=_r(i[a+1])?[]:{}),r=r[o]):r[o]=n}),e};var TGe=Object.prototype.hasOwnProperty;const sN=function(e,t){if(e===null||!Yc(e))return{};var n={};return iN(t,function(r){TGe.call(e,r)&&(n[r]=e[r])}),n},lN=function(e,t){return VQ(e,function(n,r,i){return t.includes(i)||(n[i]=r),n},{})},ch=function(e,t,n){var r,i,o,a,s=0;n||(n={});var l=function(){s=n.leading===!1?0:Date.now(),r=null,a=e.apply(i,o),r||(i=o=null)},c=function(){var u=Date.now();!s&&n.leading===!1&&(s=u);var f=t-(u-s);return i=this,o=arguments,f<=0||f>t?(r&&(clearTimeout(r),r=null),s=u,a=e.apply(i,o),r||(i=o=null)):!r&&n.trailing!==!1&&(r=setTimeout(l,f)),a};return c.cancel=function(){clearTimeout(r),s=0,r=i=o=null},c},cN=function(){},uh=function(e){return e};function _1(e){return hn(e)?0:cg(e)?e.length:Object.keys(e).length}var Vr=1e-6,pi=typeof Float32Array!="undefined"?Float32Array:Array;Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});function fg(){var e=new pi(9);return pi!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function IGe(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function RGe(e){var t=new pi(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function NGe(e,t,n,r,i,o,a,s,l){var c=new pi(9);return c[0]=e,c[1]=t,c[2]=n,c[3]=r,c[4]=i,c[5]=o,c[6]=a,c[7]=s,c[8]=l,c}function kGe(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=u*a-s*c,d=-u*o+s*l,h=c*o-a*l,p=n*f+r*d+i*h;return p?(p=1/p,e[0]=f*p,e[1]=(-u*r+i*c)*p,e[2]=(s*r-i*a)*p,e[3]=d*p,e[4]=(u*n-i*l)*p,e[5]=(-s*n+i*o)*p,e[6]=h*p,e[7]=(-c*n+r*l)*p,e[8]=(a*n-r*o)*p,e):null}function AGe(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],d=n[0],h=n[1],p=n[2],v=n[3],g=n[4],m=n[5],y=n[6],x=n[7],S=n[8];return e[0]=d*r+h*a+p*c,e[1]=d*i+h*s+p*u,e[2]=d*o+h*l+p*f,e[3]=v*r+g*a+m*c,e[4]=v*i+g*s+m*u,e[5]=v*o+g*l+m*f,e[6]=y*r+x*a+S*c,e[7]=y*i+x*s+S*u,e[8]=y*o+x*l+S*f,e}function LGe(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function jGe(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=-n,e[4]=r,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function DGe(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}var FGe=AGe;function er(){var e=new pi(16);return pi!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function uN(e){var t=new pi(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function dg(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function BGe(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,v){var g=new pi(16);return g[0]=e,g[1]=t,g[2]=n,g[3]=r,g[4]=i,g[5]=o,g[6]=a,g[7]=s,g[8]=l,g[9]=c,g[10]=u,g[11]=f,g[12]=d,g[13]=h,g[14]=p,g[15]=v,g}function fN(e,t,n,r,i,o,a,s,l,c,u,f,d,h,p,v,g){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e[4]=o,e[5]=a,e[6]=s,e[7]=l,e[8]=c,e[9]=u,e[10]=f,e[11]=d,e[12]=h,e[13]=p,e[14]=v,e[15]=g,e}function fh(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function JQ(e,t){if(e===t){var n=t[1],r=t[2],i=t[3],o=t[6],a=t[7],s=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=n,e[6]=t[9],e[7]=t[13],e[8]=r,e[9]=o,e[11]=t[14],e[12]=i,e[13]=a,e[14]=s}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function vl(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],v=t[13],g=t[14],m=t[15],y=n*s-r*a,x=n*l-i*a,S=n*c-o*a,w=r*l-i*s,C=r*c-o*s,O=i*c-o*l,E=u*v-f*p,_=u*g-d*p,$=u*m-h*p,P=f*g-d*v,T=f*m-h*v,I=d*m-h*g,M=y*I-x*T+S*P+w*$-C*_+O*E;return M?(M=1/M,e[0]=(s*I-l*T+c*P)*M,e[1]=(i*T-r*I-o*P)*M,e[2]=(v*O-g*C+m*w)*M,e[3]=(d*C-f*O-h*w)*M,e[4]=(l*$-a*I-c*_)*M,e[5]=(n*I-i*$+o*_)*M,e[6]=(g*S-p*O-m*x)*M,e[7]=(u*O-d*S+h*x)*M,e[8]=(a*T-s*$+c*E)*M,e[9]=(r*$-n*T-o*E)*M,e[10]=(p*C-v*S+m*y)*M,e[11]=(f*S-u*C-h*y)*M,e[12]=(s*_-a*P-l*E)*M,e[13]=(n*P-r*_+i*E)*M,e[14]=(v*x-p*w-g*y)*M,e[15]=(u*w-f*x+d*y)*M,e):null}function zGe(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],f=t[9],d=t[10],h=t[11],p=t[12],v=t[13],g=t[14],m=t[15];return e[0]=s*(d*m-h*g)-f*(l*m-c*g)+v*(l*h-c*d),e[1]=-(r*(d*m-h*g)-f*(i*m-o*g)+v*(i*h-o*d)),e[2]=r*(l*m-c*g)-s*(i*m-o*g)+v*(i*c-o*l),e[3]=-(r*(l*h-c*d)-s*(i*h-o*d)+f*(i*c-o*l)),e[4]=-(a*(d*m-h*g)-u*(l*m-c*g)+p*(l*h-c*d)),e[5]=n*(d*m-h*g)-u*(i*m-o*g)+p*(i*h-o*d),e[6]=-(n*(l*m-c*g)-a*(i*m-o*g)+p*(i*c-o*l)),e[7]=n*(l*h-c*d)-a*(i*h-o*d)+u*(i*c-o*l),e[8]=a*(f*m-h*v)-u*(s*m-c*v)+p*(s*h-c*f),e[9]=-(n*(f*m-h*v)-u*(r*m-o*v)+p*(r*h-o*f)),e[10]=n*(s*m-c*v)-a*(r*m-o*v)+p*(r*c-o*s),e[11]=-(n*(s*h-c*f)-a*(r*h-o*f)+u*(r*c-o*s)),e[12]=-(a*(f*g-d*v)-u*(s*g-l*v)+p*(s*d-l*f)),e[13]=n*(f*g-d*v)-u*(r*g-i*v)+p*(r*d-i*f),e[14]=-(n*(s*g-l*v)-a*(r*g-i*v)+p*(r*l-i*s)),e[15]=n*(s*d-l*f)-a*(r*d-i*f)+u*(r*l-i*s),e}function eJ(e){var t=e[0],n=e[1],r=e[2],i=e[3],o=e[4],a=e[5],s=e[6],l=e[7],c=e[8],u=e[9],f=e[10],d=e[11],h=e[12],p=e[13],v=e[14],g=e[15],m=t*a-n*o,y=t*s-r*o,x=t*l-i*o,S=n*s-r*a,w=n*l-i*a,C=r*l-i*s,O=c*p-u*h,E=c*v-f*h,_=c*g-d*h,$=u*v-f*p,P=u*g-d*p,T=f*g-d*v;return m*T-y*P+x*$+S*_-w*E+C*O}function Do(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=t[8],d=t[9],h=t[10],p=t[11],v=t[12],g=t[13],m=t[14],y=t[15],x=n[0],S=n[1],w=n[2],C=n[3];return e[0]=x*r+S*s+w*f+C*v,e[1]=x*i+S*l+w*d+C*g,e[2]=x*o+S*c+w*h+C*m,e[3]=x*a+S*u+w*p+C*y,x=n[4],S=n[5],w=n[6],C=n[7],e[4]=x*r+S*s+w*f+C*v,e[5]=x*i+S*l+w*d+C*g,e[6]=x*o+S*c+w*h+C*m,e[7]=x*a+S*u+w*p+C*y,x=n[8],S=n[9],w=n[10],C=n[11],e[8]=x*r+S*s+w*f+C*v,e[9]=x*i+S*l+w*d+C*g,e[10]=x*o+S*c+w*h+C*m,e[11]=x*a+S*u+w*p+C*y,x=n[12],S=n[13],w=n[14],C=n[15],e[12]=x*r+S*s+w*f+C*v,e[13]=x*i+S*l+w*d+C*g,e[14]=x*o+S*c+w*h+C*m,e[15]=x*a+S*u+w*p+C*y,e}function hg(e,t,n){var r=n[0],i=n[1],o=n[2],a,s,l,c,u,f,d,h,p,v,g,m;return t===e?(e[12]=t[0]*r+t[4]*i+t[8]*o+t[12],e[13]=t[1]*r+t[5]*i+t[9]*o+t[13],e[14]=t[2]*r+t[6]*i+t[10]*o+t[14],e[15]=t[3]*r+t[7]*i+t[11]*o+t[15]):(a=t[0],s=t[1],l=t[2],c=t[3],u=t[4],f=t[5],d=t[6],h=t[7],p=t[8],v=t[9],g=t[10],m=t[11],e[0]=a,e[1]=s,e[2]=l,e[3]=c,e[4]=u,e[5]=f,e[6]=d,e[7]=h,e[8]=p,e[9]=v,e[10]=g,e[11]=m,e[12]=a*r+u*i+p*o+t[12],e[13]=s*r+f*i+v*o+t[13],e[14]=l*r+d*i+g*o+t[14],e[15]=c*r+h*i+m*o+t[15]),e}function tJ(e,t,n){var r=n[0],i=n[1],o=n[2];return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function HGe(e,t,n,r){var i=r[0],o=r[1],a=r[2],s=Math.hypot(i,o,a),l,c,u,f,d,h,p,v,g,m,y,x,S,w,C,O,E,_,$,P,T,I,M,R;return s<Vr?null:(s=1/s,i*=s,o*=s,a*=s,l=Math.sin(n),c=Math.cos(n),u=1-c,f=t[0],d=t[1],h=t[2],p=t[3],v=t[4],g=t[5],m=t[6],y=t[7],x=t[8],S=t[9],w=t[10],C=t[11],O=i*i*u+c,E=o*i*u+a*l,_=a*i*u-o*l,$=i*o*u-a*l,P=o*o*u+c,T=a*o*u+i*l,I=i*a*u+o*l,M=o*a*u-i*l,R=a*a*u+c,e[0]=f*O+v*E+x*_,e[1]=d*O+g*E+S*_,e[2]=h*O+m*E+w*_,e[3]=p*O+y*E+C*_,e[4]=f*$+v*P+x*T,e[5]=d*$+g*P+S*T,e[6]=h*$+m*P+w*T,e[7]=p*$+y*P+C*T,e[8]=f*I+v*M+x*R,e[9]=d*I+g*M+S*R,e[10]=h*I+m*M+w*R,e[11]=p*I+y*M+C*R,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function nJ(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],f=t[10],d=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*i+c*r,e[5]=a*i+u*r,e[6]=s*i+f*r,e[7]=l*i+d*r,e[8]=c*i-o*r,e[9]=u*i-a*r,e[10]=f*i-s*r,e[11]=d*i-l*r,e}function rJ(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],c=t[8],u=t[9],f=t[10],d=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i-c*r,e[1]=a*i-u*r,e[2]=s*i-f*r,e[3]=l*i-d*r,e[8]=o*r+c*i,e[9]=a*r+u*i,e[10]=s*r+f*i,e[11]=l*r+d*i,e}function WGe(e,t,n){var r=Math.sin(n),i=Math.cos(n),o=t[0],a=t[1],s=t[2],l=t[3],c=t[4],u=t[5],f=t[6],d=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*i+c*r,e[1]=a*i+u*r,e[2]=s*i+f*r,e[3]=l*i+d*r,e[4]=c*i-o*r,e[5]=u*i-a*r,e[6]=f*i-s*r,e[7]=d*i-l*r,e}function yf(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function bf(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function iJ(e,t,n){var r=n[0],i=n[1],o=n[2],a=Math.hypot(r,i,o),s,l,c;return a<Vr?null:(a=1/a,r*=a,i*=a,o*=a,s=Math.sin(t),l=Math.cos(t),c=1-l,e[0]=r*r*c+l,e[1]=i*r*c+o*s,e[2]=o*r*c-i*s,e[3]=0,e[4]=r*i*c-o*s,e[5]=i*i*c+l,e[6]=o*i*c+r*s,e[7]=0,e[8]=r*o*c+i*s,e[9]=i*o*c-r*s,e[10]=o*o*c+l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function oJ(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=r,e[6]=n,e[7]=0,e[8]=0,e[9]=-n,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function aJ(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=0,e[2]=-n,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=n,e[9]=0,e[10]=r,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dN(e,t){var n=Math.sin(t),r=Math.cos(t);return e[0]=r,e[1]=n,e[2]=0,e[3]=0,e[4]=-n,e[5]=r,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function sJ(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=r+r,l=i+i,c=o+o,u=r*s,f=r*l,d=r*c,h=i*l,p=i*c,v=o*c,g=a*s,m=a*l,y=a*c;return e[0]=1-(h+v),e[1]=f+y,e[2]=d-m,e[3]=0,e[4]=f-y,e[5]=1-(u+v),e[6]=p+g,e[7]=0,e[8]=d+m,e[9]=p-g,e[10]=1-(u+h),e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function VGe(e,t){var n=new pi(3),r=-t[0],i=-t[1],o=-t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],f=r*r+i*i+o*o+a*a;return f>0?(n[0]=(s*a+u*r+l*o-c*i)*2/f,n[1]=(l*a+u*i+c*r-s*o)*2/f,n[2]=(c*a+u*o+s*i-l*r)*2/f):(n[0]=(s*a+u*r+l*o-c*i)*2,n[1]=(l*a+u*i+c*r-s*o)*2,n[2]=(c*a+u*o+s*i-l*r)*2),sJ(e,t,n),e}function mO(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function pg(e,t){var n=t[0],r=t[1],i=t[2],o=t[4],a=t[5],s=t[6],l=t[8],c=t[9],u=t[10];return e[0]=Math.hypot(n,r,i),e[1]=Math.hypot(o,a,s),e[2]=Math.hypot(l,c,u),e}function yO(e,t){var n=new pi(3);pg(n,t);var r=1/n[0],i=1/n[1],o=1/n[2],a=t[0]*r,s=t[1]*i,l=t[2]*o,c=t[4]*r,u=t[5]*i,f=t[6]*o,d=t[8]*r,h=t[9]*i,p=t[10]*o,v=a+u+p,g=0;return v>0?(g=Math.sqrt(v+1)*2,e[3]=.25*g,e[0]=(f-h)/g,e[1]=(d-l)/g,e[2]=(s-c)/g):a>u&&a>p?(g=Math.sqrt(1+a-u-p)*2,e[3]=(f-h)/g,e[0]=.25*g,e[1]=(s+c)/g,e[2]=(d+l)/g):u>p?(g=Math.sqrt(1+u-a-p)*2,e[3]=(d-l)/g,e[0]=(s+c)/g,e[1]=.25*g,e[2]=(f+h)/g):(g=Math.sqrt(1+p-a-u)*2,e[3]=(s-c)/g,e[0]=(d+l)/g,e[1]=(f+h)/g,e[2]=.25*g),e}function UGe(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3],l=i+i,c=o+o,u=a+a,f=i*l,d=i*c,h=i*u,p=o*c,v=o*u,g=a*u,m=s*l,y=s*c,x=s*u,S=r[0],w=r[1],C=r[2];return e[0]=(1-(p+g))*S,e[1]=(d+x)*S,e[2]=(h-y)*S,e[3]=0,e[4]=(d-x)*w,e[5]=(1-(f+g))*w,e[6]=(v+m)*w,e[7]=0,e[8]=(h+y)*C,e[9]=(v-m)*C,e[10]=(1-(f+p))*C,e[11]=0,e[12]=n[0],e[13]=n[1],e[14]=n[2],e[15]=1,e}function $1(e,t,n,r,i){var o=t[0],a=t[1],s=t[2],l=t[3],c=o+o,u=a+a,f=s+s,d=o*c,h=o*u,p=o*f,v=a*u,g=a*f,m=s*f,y=l*c,x=l*u,S=l*f,w=r[0],C=r[1],O=r[2],E=i[0],_=i[1],$=i[2],P=(1-(v+m))*w,T=(h+S)*w,I=(p-x)*w,M=(h-S)*C,R=(1-(d+m))*C,N=(g+y)*C,k=(p+x)*O,A=(g-y)*O,j=(1-(d+v))*O;return e[0]=P,e[1]=T,e[2]=I,e[3]=0,e[4]=M,e[5]=R,e[6]=N,e[7]=0,e[8]=k,e[9]=A,e[10]=j,e[11]=0,e[12]=n[0]+E-(P*E+M*_+k*$),e[13]=n[1]+_-(T*E+R*_+A*$),e[14]=n[2]+$-(I*E+N*_+j*$),e[15]=1,e}function hN(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n+n,s=r+r,l=i+i,c=n*a,u=r*a,f=r*s,d=i*a,h=i*s,p=i*l,v=o*a,g=o*s,m=o*l;return e[0]=1-f-p,e[1]=u+m,e[2]=d-g,e[3]=0,e[4]=u-m,e[5]=1-c-p,e[6]=h+v,e[7]=0,e[8]=d+g,e[9]=h-v,e[10]=1-c-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function qGe(e,t,n,r,i,o,a){var s=1/(n-t),l=1/(i-r),c=1/(o-a);return e[0]=o*2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*l,e[6]=0,e[7]=0,e[8]=(n+t)*s,e[9]=(i+r)*l,e[10]=(a+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=a*o*2*c,e[15]=0,e}function lJ(e,t,n,r,i){var o=1/Math.tan(t/2),a;return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(a=1/(r-i),e[10]=(i+r)*a,e[14]=2*i*r*a):(e[10]=-1,e[14]=-2*r),e}var GGe=lJ;function KGe(e,t,n,r,i){var o=1/Math.tan(t/2),a;return e[0]=o/n,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,i!=null&&i!==1/0?(a=1/(r-i),e[10]=i*a,e[14]=i*r*a):(e[10]=-1,e[14]=-r),e}function YGe(e,t,n,r){var i=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),a=Math.tan(t.leftDegrees*Math.PI/180),s=Math.tan(t.rightDegrees*Math.PI/180),l=2/(a+s),c=2/(i+o);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((a-s)*l*.5),e[9]=(i-o)*c*.5,e[10]=r/(n-r),e[11]=-1,e[12]=0,e[13]=0,e[14]=r*n/(n-r),e[15]=0,e}function cJ(e,t,n,r,i,o,a){var s=1/(t-n),l=1/(r-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=(a+o)*c,e[15]=1,e}var uJ=cJ;function fJ(e,t,n,r,i,o,a){var s=1/(t-n),l=1/(r-i),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+n)*s,e[13]=(i+r)*l,e[14]=o*c,e[15]=1,e}function dJ(e,t,n,r){var i,o,a,s,l,c,u,f,d,h,p=t[0],v=t[1],g=t[2],m=r[0],y=r[1],x=r[2],S=n[0],w=n[1],C=n[2];return Math.abs(p-S)<Vr&&Math.abs(v-w)<Vr&&Math.abs(g-C)<Vr?fh(e):(u=p-S,f=v-w,d=g-C,h=1/Math.hypot(u,f,d),u*=h,f*=h,d*=h,i=y*d-x*f,o=x*u-m*d,a=m*f-y*u,h=Math.hypot(i,o,a),h?(h=1/h,i*=h,o*=h,a*=h):(i=0,o=0,a=0),s=f*a-d*o,l=d*i-u*a,c=u*o-f*i,h=Math.hypot(s,l,c),h?(h=1/h,s*=h,l*=h,c*=h):(s=0,l=0,c=0),e[0]=i,e[1]=s,e[2]=u,e[3]=0,e[4]=o,e[5]=l,e[6]=f,e[7]=0,e[8]=a,e[9]=c,e[10]=d,e[11]=0,e[12]=-(i*p+o*v+a*g),e[13]=-(s*p+l*v+c*g),e[14]=-(u*p+f*v+d*g),e[15]=1,e)}function XGe(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=r[0],l=r[1],c=r[2],u=i-n[0],f=o-n[1],d=a-n[2],h=u*u+f*f+d*d;h>0&&(h=1/Math.sqrt(h),u*=h,f*=h,d*=h);var p=l*d-c*f,v=c*u-s*d,g=s*f-l*u;return h=p*p+v*v+g*g,h>0&&(h=1/Math.sqrt(h),p*=h,v*=h,g*=h),e[0]=p,e[1]=v,e[2]=g,e[3]=0,e[4]=f*g-d*v,e[5]=d*p-u*g,e[6]=u*v-f*p,e[7]=0,e[8]=u,e[9]=f,e[10]=d,e[11]=0,e[12]=i,e[13]=o,e[14]=a,e[15]=1,e}function ZGe(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function QGe(e){return Math.hypot(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15])}function JGe(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e[3]=t[3]+n[3],e[4]=t[4]+n[4],e[5]=t[5]+n[5],e[6]=t[6]+n[6],e[7]=t[7]+n[7],e[8]=t[8]+n[8],e[9]=t[9]+n[9],e[10]=t[10]+n[10],e[11]=t[11]+n[11],e[12]=t[12]+n[12],e[13]=t[13]+n[13],e[14]=t[14]+n[14],e[15]=t[15]+n[15],e}function hJ(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e[3]=t[3]-n[3],e[4]=t[4]-n[4],e[5]=t[5]-n[5],e[6]=t[6]-n[6],e[7]=t[7]-n[7],e[8]=t[8]-n[8],e[9]=t[9]-n[9],e[10]=t[10]-n[10],e[11]=t[11]-n[11],e[12]=t[12]-n[12],e[13]=t[13]-n[13],e[14]=t[14]-n[14],e[15]=t[15]-n[15],e}function eKe(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,e[11]=t[11]*n,e[12]=t[12]*n,e[13]=t[13]*n,e[14]=t[14]*n,e[15]=t[15]*n,e}function tKe(e,t,n,r){return e[0]=t[0]+n[0]*r,e[1]=t[1]+n[1]*r,e[2]=t[2]+n[2]*r,e[3]=t[3]+n[3]*r,e[4]=t[4]+n[4]*r,e[5]=t[5]+n[5]*r,e[6]=t[6]+n[6]*r,e[7]=t[7]+n[7]*r,e[8]=t[8]+n[8]*r,e[9]=t[9]+n[9]*r,e[10]=t[10]+n[10]*r,e[11]=t[11]+n[11]*r,e[12]=t[12]+n[12]*r,e[13]=t[13]+n[13]*r,e[14]=t[14]+n[14]*r,e[15]=t[15]+n[15]*r,e}function nKe(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function rKe(e,t){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],f=e[9],d=e[10],h=e[11],p=e[12],v=e[13],g=e[14],m=e[15],y=t[0],x=t[1],S=t[2],w=t[3],C=t[4],O=t[5],E=t[6],_=t[7],$=t[8],P=t[9],T=t[10],I=t[11],M=t[12],R=t[13],N=t[14],k=t[15];return Math.abs(n-y)<=Vr*Math.max(1,Math.abs(n),Math.abs(y))&&Math.abs(r-x)<=Vr*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(i-S)<=Vr*Math.max(1,Math.abs(i),Math.abs(S))&&Math.abs(o-w)<=Vr*Math.max(1,Math.abs(o),Math.abs(w))&&Math.abs(a-C)<=Vr*Math.max(1,Math.abs(a),Math.abs(C))&&Math.abs(s-O)<=Vr*Math.max(1,Math.abs(s),Math.abs(O))&&Math.abs(l-E)<=Vr*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-_)<=Vr*Math.max(1,Math.abs(c),Math.abs(_))&&Math.abs(u-$)<=Vr*Math.max(1,Math.abs(u),Math.abs($))&&Math.abs(f-P)<=Vr*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(d-T)<=Vr*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(h-I)<=Vr*Math.max(1,Math.abs(h),Math.abs(I))&&Math.abs(p-M)<=Vr*Math.max(1,Math.abs(p),Math.abs(M))&&Math.abs(v-R)<=Vr*Math.max(1,Math.abs(v),Math.abs(R))&&Math.abs(g-N)<=Vr*Math.max(1,Math.abs(g),Math.abs(N))&&Math.abs(m-k)<=Vr*Math.max(1,Math.abs(m),Math.abs(k))}var pN=Do,iKe=hJ;const oKe=Object.freeze(Object.defineProperty({__proto__:null,add:JGe,adjoint:zGe,clone:uN,copy:dg,create:er,determinant:eJ,equals:rKe,exactEquals:nKe,frob:QGe,fromQuat:hN,fromQuat2:VGe,fromRotation:iJ,fromRotationTranslation:sJ,fromRotationTranslationScale:UGe,fromRotationTranslationScaleOrigin:$1,fromScaling:bf,fromTranslation:yf,fromValues:BGe,fromXRotation:oJ,fromYRotation:aJ,fromZRotation:dN,frustum:qGe,getRotation:yO,getScaling:pg,getTranslation:mO,identity:fh,invert:vl,lookAt:dJ,mul:pN,multiply:Do,multiplyScalar:eKe,multiplyScalarAndAdd:tKe,ortho:uJ,orthoNO:cJ,orthoZO:fJ,perspective:GGe,perspectiveFromFieldOfView:YGe,perspectiveNO:lJ,perspectiveZO:KGe,rotate:HGe,rotateX:nJ,rotateY:rJ,rotateZ:WGe,scale:tJ,set:fN,str:ZGe,sub:iKe,subtract:hJ,targetTo:XGe,translate:hg,transpose:JQ},Symbol.toStringTag,{value:"Module"}));function Mn(){var e=new pi(3);return pi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function Xc(e){var t=new pi(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Zc(e){var t=e[0],n=e[1],r=e[2];return Math.hypot(t,n,r)}function Un(e,t,n){var r=new pi(3);return r[0]=e,r[1]=t,r[2]=n,r}function xf(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function gl(e,t,n,r){return e[0]=t,e[1]=n,e[2]=r,e}function vg(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function pJ(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function aKe(e,t,n){return e[0]=t[0]*n[0],e[1]=t[1]*n[1],e[2]=t[2]*n[2],e}function vN(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function sKe(e,t){var n=t[0]-e[0],r=t[1]-e[1],i=t[2]-e[2];return Math.hypot(n,r,i)}function dh(e,t){var n=t[0],r=t[1],i=t[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function Wl(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function bO(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[0],s=n[1],l=n[2];return e[0]=i*l-o*s,e[1]=o*a-r*l,e[2]=r*s-i*a,e}function gN(e,t,n,r){var i=t[0],o=t[1],a=t[2];return e[0]=i+r*(n[0]-i),e[1]=o+r*(n[1]-o),e[2]=a+r*(n[2]-a),e}function Zi(e,t,n){var r=t[0],i=t[1],o=t[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return a=a||1,e[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/a,e[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,e[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,e}function vJ(e,t,n){var r=t[0],i=t[1],o=t[2];return e[0]=r*n[0]+i*n[3]+o*n[6],e[1]=r*n[1]+i*n[4]+o*n[7],e[2]=r*n[2]+i*n[5]+o*n[8],e}function lKe(e,t,n){var r=n[0],i=n[1],o=n[2],a=n[3],s=t[0],l=t[1],c=t[2],u=i*c-o*l,f=o*s-r*c,d=r*l-i*s,h=i*d-o*f,p=o*u-r*d,v=r*f-i*u,g=a*2;return u*=g,f*=g,d*=g,h*=2,p*=2,v*=2,e[0]=s+u+h,e[1]=l+f+p,e[2]=c+d+v,e}function P1(e,t){var n=e[0],r=e[1],i=e[2],o=t[0],a=t[1],s=t[2];return Math.abs(n-o)<=Vr*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=Vr*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=Vr*Math.max(1,Math.abs(i),Math.abs(s))}var gJ=sKe,mJ=Zc;(function(){var e=Mn();return function(t,n,r,i,o,a){var s,l;for(n||(n=3),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2];return t}})();function gg(){var e=new pi(4);return pi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function cKe(e,t,n,r){var i=new pi(4);return i[0]=e,i[1]=t,i[2]=n,i[3]=r,i}function uKe(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}function fKe(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),e[0]=n*a,e[1]=r*a,e[2]=i*a,e[3]=o*a,e}function mg(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3];return e[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,e[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,e[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,e[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,e}(function(){var e=gg();return function(t,n,r,i,o,a){var s,l;for(n||(n=4),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],e[2]=t[s+2],e[3]=t[s+3],o(e,e,a),t[s]=e[0],t[s+1]=e[1],t[s+2]=e[2],t[s+3]=e[3];return t}})();function Ii(){var e=new pi(4);return pi!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Sf(e,t,n){n=n*.5;var r=Math.sin(n);return e[0]=r*t[0],e[1]=r*t[1],e[2]=r*t[2],e[3]=Math.cos(n),e}function wf(e,t,n){var r=t[0],i=t[1],o=t[2],a=t[3],s=n[0],l=n[1],c=n[2],u=n[3];return e[0]=r*u+a*s+i*c-o*l,e[1]=i*u+a*l+o*s-r*c,e[2]=o*u+a*c+r*l-i*s,e[3]=a*u-r*s-i*l-o*c,e}function mN(e,t,n,r){var i=t[0],o=t[1],a=t[2],s=t[3],l=n[0],c=n[1],u=n[2],f=n[3],d,h,p,v,g;return h=i*l+o*c+a*u+s*f,h<0&&(h=-h,l=-l,c=-c,u=-u,f=-f),1-h>Vr?(d=Math.acos(h),p=Math.sin(d),v=Math.sin((1-r)*d)/p,g=Math.sin(r*d)/p):(v=1-r,g=r),e[0]=v*i+g*l,e[1]=v*o+g*c,e[2]=v*a+g*u,e[3]=v*s+g*f,e}function yN(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return e[0]=-n*s,e[1]=-r*s,e[2]=-i*s,e[3]=o*s,e}function dKe(e,t){var n=t[0]+t[4]+t[8],r;if(n>0)r=Math.sqrt(n+1),e[3]=.5*r,r=.5/r,e[0]=(t[5]-t[7])*r,e[1]=(t[6]-t[2])*r,e[2]=(t[1]-t[3])*r;else{var i=0;t[4]>t[0]&&(i=1),t[8]>t[i*3+i]&&(i=2);var o=(i+1)%3,a=(i+2)%3;r=Math.sqrt(t[i*3+i]-t[o*3+o]-t[a*3+a]+1),e[i]=.5*r,r=.5/r,e[3]=(t[o*3+a]-t[a*3+o])*r,e[o]=(t[o*3+i]+t[i*3+o])*r,e[a]=(t[a*3+i]+t[i*3+a])*r}return e}function xO(e,t,n,r){var i=.5*Math.PI/180;t*=i,n*=i,r*=i;var o=Math.sin(t),a=Math.cos(t),s=Math.sin(n),l=Math.cos(n),c=Math.sin(r),u=Math.cos(r);return e[0]=o*l*u-a*s*c,e[1]=a*s*u+o*l*c,e[2]=a*l*c-o*s*u,e[3]=a*l*u+o*s*c,e}var bN=cKe,SO=uKe,yJ=wf,wO=fKe;(function(){var e=Mn(),t=Un(1,0,0),n=Un(0,1,0);return function(r,i,o){var a=Wl(i,o);return a<-.999999?(bO(e,t,i),mJ(e)<1e-6&&bO(e,n,i),dh(e,e),Sf(r,e,Math.PI),r):a>.999999?(r[0]=0,r[1]=0,r[2]=0,r[3]=1,r):(bO(e,i,o),r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=1+a,wO(r,r))}})(),function(){var e=Ii(),t=Ii();return function(n,r,i,o,a,s){return mN(e,r,a,s),mN(t,i,o,s),mN(n,e,t,2*s*(1-s)),n}}(),function(){var e=fg();return function(t,n,r,i){return e[0]=r[0],e[3]=r[1],e[6]=r[2],e[1]=i[0],e[4]=i[1],e[7]=i[2],e[2]=-n[0],e[5]=-n[1],e[8]=-n[2],wO(t,dKe(t,e))}}();function hKe(){var e=new pi(2);return pi!=Float32Array&&(e[0]=0,e[1]=0),e}function pKe(e,t){var n=new pi(2);return n[0]=e,n[1]=t,n}function vKe(e,t){return e[0]=t[0],e[1]=t[1],e}function gKe(e,t){var n=t[0],r=t[1],i=n*n+r*r;return i>0&&(i=1/Math.sqrt(i)),e[0]=t[0]*i,e[1]=t[1]*i,e}function mKe(e,t){return e[0]*t[0]+e[1]*t[1]}function yKe(e,t){return e[0]===t[0]&&e[1]===t[1]}(function(){var e=hKe();return function(t,n,r,i,o,a){var s,l;for(n||(n=2),r||(r=0),i?l=Math.min(i*n+r,t.length):l=t.length,s=r;s<l;s+=n)e[0]=t[s],e[1]=t[s+1],o(e,e,a),t[s]=e[0],t[s+1]=e[1];return t}})();var bJ={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function bKe(e,t,n){if(e[n].length>7){e[n].shift();for(var r=e[n],i=n;r.length;)t[n]="A",e.splice(i+=1,0,["C"].concat(r.splice(0,6)));e.splice(n,1)}}var M1={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function xJ(e){return Array.isArray(e)&&e.every(function(t){var n=t[0].toLowerCase();return M1[n]===t.length-1&&"achlmqstvz".includes(n)})}function SJ(e){return xJ(e)&&e.every(function(t){var n=t[0];return n===n.toUpperCase()})}function wJ(e){return SJ(e)&&e.every(function(t){var n=t[0];return"ACLMQZ".includes(n)})}function CJ(e){for(var t=e.pathValue[e.segmentStart],n=t.toLowerCase(),r=e.data;r.length>=M1[n]&&(n==="m"&&r.length>2?(e.segments.push([t].concat(r.splice(0,2))),n="l",t=t==="m"?"l":"L"):e.segments.push([t].concat(r.splice(0,M1[n]))),!!M1[n]););}function xKe(e){var t=e.index,n=e.pathValue,r=n.charCodeAt(t);if(r===48){e.param=0,e.index+=1;return}if(r===49){e.param=1,e.index+=1;return}e.err='[path-util]: invalid Arc flag "'+n[t]+'", expecting 0 or 1 at index '+t}function SKe(e){return e>=48&&e<=57||e===43||e===45||e===46}function yg(e){return e>=48&&e<=57}function wKe(e){var t=e.max,n=e.pathValue,r=e.index,i=r,o=!1,a=!1,s=!1,l=!1,c;if(i>=t){e.err="[path-util]: Invalid path value at index "+i+', "pathValue" is missing param';return}if(c=n.charCodeAt(i),(c===43||c===45)&&(i+=1,c=n.charCodeAt(i)),!yg(c)&&c!==46){e.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" is not a number';return}if(c!==46){if(o=c===48,i+=1,c=n.charCodeAt(i),o&&i<t&&c&&yg(c)){e.err="[path-util]: Invalid path value at index "+r+', "'+n[r]+'" illegal number';return}for(;i<t&&yg(n.charCodeAt(i));)i+=1,a=!0;c=n.charCodeAt(i)}if(c===46){for(l=!0,i+=1;yg(n.charCodeAt(i));)i+=1,s=!0;c=n.charCodeAt(i)}if(c===101||c===69){if(l&&!a&&!s){e.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" invalid float exponent';return}if(i+=1,c=n.charCodeAt(i),(c===43||c===45)&&(i+=1),i<t&&yg(n.charCodeAt(i)))for(;i<t&&yg(n.charCodeAt(i));)i+=1;else{e.err="[path-util]: Invalid path value at index "+i+', "'+n[i]+'" invalid integer exponent';return}}e.index=i,e.param=+e.pathValue.slice(r,i)}function CKe(e){var t=[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279];return e===10||e===13||e===8232||e===8233||e===32||e===9||e===11||e===12||e===160||e>=5760&&t.includes(e)}function CO(e){for(var t=e.pathValue,n=e.max;e.index<n&&CKe(t.charCodeAt(e.index));)e.index+=1}function OKe(e){switch(e|32){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}function EKe(e){return(e|32)===97}function _Ke(e){var t=e.max,n=e.pathValue,r=e.index,i=n.charCodeAt(r),o=M1[n[r].toLowerCase()];if(e.segmentStart=r,!OKe(i)){e.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command';return}if(e.index+=1,CO(e),e.data=[],!o){CJ(e);return}for(;;){for(var a=o;a>0;a-=1){if(EKe(i)&&(a===3||a===4)?xKe(e):wKe(e),e.err.length)return;e.data.push(e.param),CO(e),e.index<t&&n.charCodeAt(e.index)===44&&(e.index+=1,CO(e))}if(e.index>=e.max||!SKe(n.charCodeAt(e.index)))break}CJ(e)}var $Ke=function(){function e(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""}return e}();function PKe(e){if(xJ(e))return[].concat(e);var t=new $Ke(e);for(CO(t);t.index<t.max&&!t.err.length;)_Ke(t);return t.err?t.err:t.segments}function MKe(e){if(SJ(e))return[].concat(e);var t=PKe(e),n=0,r=0,i=0,o=0;return t.map(function(a){var s=a.slice(1).map(Number),l=a[0],c=l.toUpperCase();if(l==="M")return n=s[0],r=s[1],i=n,o=r,["M",n,r];var u;if(l!==c)switch(c){case"A":u=[c,s[0],s[1],s[2],s[3],s[4],s[5]+n,s[6]+r];break;case"V":u=[c,s[0]+r];break;case"H":u=[c,s[0]+n];break;default:{var f=s.map(function(h,p){return h+(p%2?r:n)});u=[c].concat(f)}}else u=[c].concat(s);var d=u.length;switch(c){case"Z":n=i,r=o;break;case"H":n=u[1];break;case"V":r=u[1];break;default:n=u[d-2],r=u[d-1],c==="M"&&(i=n,o=r)}return u})}function TKe(e,t){var n=e[0],r=t.x1,i=t.y1,o=t.x2,a=t.y2,s=e.slice(1).map(Number),l=e;if("TQ".includes(n)||(t.qx=null,t.qy=null),n==="H")l=["L",e[1],i];else if(n==="V")l=["L",r,e[1]];else if(n==="S"){var c=r*2-o,u=i*2-a;t.x1=c,t.y1=u,l=["C",c,u].concat(s)}else if(n==="T"){var f=r*2-t.qx,d=i*2-t.qy;t.qx=f,t.qy=d,l=["Q",f,d].concat(s)}else if(n==="Q"){var h=s[0],p=s[1];t.qx=h,t.qy=p}return l}function OO(e){if(wJ(e))return[].concat(e);for(var t=MKe(e),n=ke({},bJ),r=0;r<t.length;r+=1){t[r]=TKe(t[r],n);var i=t[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return t}function IKe(e){return wJ(e)&&e.every(function(t){var n=t[0];return"MC".includes(n)})}function EO(e,t,n){var r=e*Math.cos(n)-t*Math.sin(n),i=e*Math.sin(n)+t*Math.cos(n);return{x:r,y:i}}function xN(e,t,n,r,i,o,a,s,l,c){var u=e,f=t,d=n,h=r,p=s,v=l,g=Math.PI*120/180,m=Math.PI/180*(+i||0),y=[],x,S,w,C,O;if(c)S=c[0],w=c[1],C=c[2],O=c[3];else{x=EO(u,f,-m),u=x.x,f=x.y,x=EO(p,v,-m),p=x.x,v=x.y;var E=(u-p)/2,_=(f-v)/2,$=E*E/(d*d)+_*_/(h*h);$>1&&($=Math.sqrt($),d*=$,h*=$);var P=d*d,T=h*h,I=(o===a?-1:1)*Math.sqrt(Math.abs((P*T-P*_*_-T*E*E)/(P*_*_+T*E*E)));C=I*d*_/h+(u+p)/2,O=I*-h*E/d+(f+v)/2,S=Math.asin(((f-O)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),w=Math.asin(((v-O)/h*Math.pow(10,9)>>0)/Math.pow(10,9)),S=u<C?Math.PI-S:S,w=p<C?Math.PI-w:w,S<0&&(S=Math.PI*2+S),w<0&&(w=Math.PI*2+w),a&&S>w&&(S-=Math.PI*2),!a&&w>S&&(w-=Math.PI*2)}var M=w-S;if(Math.abs(M)>g){var R=w,N=p,k=v;w=S+g*(a&&w>S?1:-1),p=C+d*Math.cos(w),v=O+h*Math.sin(w),y=xN(p,v,d,h,i,0,a,N,k,[w,R,C,O])}M=w-S;var A=Math.cos(S),j=Math.sin(S),D=Math.cos(w),L=Math.sin(w),F=Math.tan(M/4),B=4/3*d*F,H=4/3*h*F,z=[u,f],W=[u+B*j,f-H*A],V=[p+B*L,v-H*D],U=[p,v];if(W[0]=2*z[0]-W[0],W[1]=2*z[1]-W[1],c)return W.concat(V,U,y);y=W.concat(V,U,y);for(var G=[],q=0,K=y.length;q<K;q+=1)G[q]=q%2?EO(y[q-1],y[q],m).y:EO(y[q],y[q+1],m).x;return G}function RKe(e,t,n,r,i,o){var a=.3333333333333333,s=2/3;return[a*e+s*n,a*t+s*r,a*i+s*n,a*o+s*r,i,o]}function Cf(e,t,n){var r=e[0],i=e[1],o=t[0],a=t[1];return[r+(o-r)*n,i+(a-i)*n]}var OJ=function(e,t,n,r){var i=.5,o=Cf([e,t],[n,r],i);return it(it([],o,!0),[n,r,n,r],!1)};function NKe(e,t){var n=e[0],r=e.slice(1).map(Number),i=r[0],o=r[1],a,s=t.x1,l=t.y1,c=t.x,u=t.y;switch("TQ".includes(n)||(t.qx=null,t.qy=null),n){case"M":return t.x=i,t.y=o,e;case"A":return a=[s,l].concat(r),["C"].concat(xN(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]));case"Q":return t.qx=i,t.qy=o,a=[s,l].concat(r),["C"].concat(RKe(a[0],a[1],a[2],a[3],a[4],a[5]));case"L":return["C"].concat(OJ(s,l,i,o));case"Z":return s===c&&l===u?["C",s,l,c,u,c,u]:["C"].concat(OJ(s,l,c,u))}return e}function SN(e,t){if(t===void 0&&(t=!1),IKe(e)){var n=[].concat(e);return t?[n,[]]:n}for(var r=OO(e),i=ke({},bJ),o=[],a="",s=r.length,l,c,u=[],f=0;f<s;f+=1){r[f]&&(a=r[f][0]),o[f]=a;var d=NKe(r[f],i);r[f]=d,bKe(r,o,f),s=r.length,a==="Z"&&u.push(f),l=r[f],c=l.length,i.x1=+l[c-2],i.y1=+l[c-1],i.x2=+l[c-4]||i.x1,i.y2=+l[c-3]||i.y1}return t?[r,u]:r}function kKe(e){return e.map(function(t){return Array.isArray(t)?[].concat(t):t})}function AKe(e){var t=e.slice(1).map(function(n,r,i){return r?i[r-1].slice(-2).concat(n.slice(1)):e[0].slice(1).concat(n.slice(1))}).map(function(n){return n.map(function(r,i){return n[n.length-i-2*(1-i%2)]})}).reverse();return[["M"].concat(t[0].slice(0,2))].concat(t.map(function(n){return["C"].concat(n.slice(2))}))}function xa(e,t){return Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1]))}function wN(e,t,n,r,i){var o=xa([e,t],[n,r]),a={x:0,y:0};if(typeof i=="number")if(i<=0)a={x:e,y:t};else if(i>=o)a={x:n,y:r};else{var s=Cf([e,t],[n,r],i/o),l=s[0],c=s[1];a={x:l,y:c}}return{length:o,point:a,min:{x:Math.min(e,n),y:Math.min(t,r)},max:{x:Math.max(e,n),y:Math.max(t,r)}}}function EJ(e,t){var n=e.x,r=e.y,i=t.x,o=t.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2))),l=n*o-r*i<0?-1:1,c=l*Math.acos(a/s);return c}function LKe(e,t,n,r,i,o,a,s,l,c){var u=Math.abs,f=Math.sin,d=Math.cos,h=Math.sqrt,p=Math.PI,v=u(n),g=u(r),m=(i%360+360)%360,y=m*(p/180);if(e===s&&t===l)return{x:e,y:t};if(v===0||g===0)return wN(e,t,s,l,c).point;var x=(e-s)/2,S=(t-l)/2,w={x:d(y)*x+f(y)*S,y:-f(y)*x+d(y)*S},C=Math.pow(w.x,2)/Math.pow(v,2)+Math.pow(w.y,2)/Math.pow(g,2);C>1&&(v*=h(C),g*=h(C));var O=Math.pow(v,2)*Math.pow(g,2)-Math.pow(v,2)*Math.pow(w.y,2)-Math.pow(g,2)*Math.pow(w.x,2),E=Math.pow(v,2)*Math.pow(w.y,2)+Math.pow(g,2)*Math.pow(w.x,2),_=O/E;_=_<0?0:_;var $=(o!==a?1:-1)*h(_),P={x:$*(v*w.y/g),y:$*(-(g*w.x)/v)},T={x:d(y)*P.x-f(y)*P.y+(e+s)/2,y:f(y)*P.x+d(y)*P.y+(t+l)/2},I={x:(w.x-P.x)/v,y:(w.y-P.y)/g},M=EJ({x:1,y:0},I),R={x:(-w.x-P.x)/v,y:(-w.y-P.y)/g},N=EJ(I,R);!a&&N>0?N-=2*p:a&&N<0&&(N+=2*p),N%=2*p;var k=M+N*c,A=v*d(k),j=g*f(k),D={x:d(y)*A-f(y)*j+T.x,y:f(y)*A+d(y)*j+T.y};return D}function jKe(e,t,n,r,i,o,a,s,l,c,u){var f,d=u.bbox,h=d===void 0?!0:d,p=u.length,v=p===void 0?!0:p,g=u.sampleSize,m=g===void 0?30:g,y=typeof c=="number",x=e,S=t,w=0,C=[x,S,w],O=[x,S],E=0,_={x:0,y:0},$=[{x,y:S}];y&&c<=0&&(_={x,y:S});for(var P=0;P<=m;P+=1){if(E=P/m,f=LKe(e,t,n,r,i,o,a,s,l,E),x=f.x,S=f.y,h&&$.push({x,y:S}),v&&(w+=xa(O,[x,S])),O=[x,S],y&&w>=c&&c>C[2]){var T=(w-c)/(w-C[2]);_={x:O[0]*(1-T)+C[0]*T,y:O[1]*(1-T)+C[1]*T}}C=[x,S,w]}return y&&c>=w&&(_={x:s,y:l}),{length:w,point:_,min:{x:Math.min.apply(null,$.map(function(I){return I.x})),y:Math.min.apply(null,$.map(function(I){return I.y}))},max:{x:Math.max.apply(null,$.map(function(I){return I.x})),y:Math.max.apply(null,$.map(function(I){return I.y}))}}}function DKe(e,t,n,r,i,o,a,s,l){var c=1-l;return{x:Math.pow(c,3)*e+3*Math.pow(c,2)*l*n+3*c*Math.pow(l,2)*i+Math.pow(l,3)*a,y:Math.pow(c,3)*t+3*Math.pow(c,2)*l*r+3*c*Math.pow(l,2)*o+Math.pow(l,3)*s}}function _J(e,t,n,r,i,o,a,s,l,c){var u,f=c.bbox,d=f===void 0?!0:f,h=c.length,p=h===void 0?!0:h,v=c.sampleSize,g=v===void 0?10:v,m=typeof l=="number",y=e,x=t,S=0,w=[y,x,S],C=[y,x],O=0,E={x:0,y:0},_=[{x:y,y:x}];m&&l<=0&&(E={x:y,y:x});for(var $=0;$<=g;$+=1){if(O=$/g,u=DKe(e,t,n,r,i,o,a,s,O),y=u.x,x=u.y,d&&_.push({x:y,y:x}),p&&(S+=xa(C,[y,x])),C=[y,x],m&&S>=l&&l>w[2]){var P=(S-l)/(S-w[2]);E={x:C[0]*(1-P)+w[0]*P,y:C[1]*(1-P)+w[1]*P}}w=[y,x,S]}return m&&l>=S&&(E={x:a,y:s}),{length:S,point:E,min:{x:Math.min.apply(null,_.map(function(T){return T.x})),y:Math.min.apply(null,_.map(function(T){return T.y}))},max:{x:Math.max.apply(null,_.map(function(T){return T.x})),y:Math.max.apply(null,_.map(function(T){return T.y}))}}}function FKe(e,t,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*e+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*t+2*s*a*r+Math.pow(a,2)*o}}function BKe(e,t,n,r,i,o,a,s){var l,c=s.bbox,u=c===void 0?!0:c,f=s.length,d=f===void 0?!0:f,h=s.sampleSize,p=h===void 0?10:h,v=typeof a=="number",g=e,m=t,y=0,x=[g,m,y],S=[g,m],w=0,C={x:0,y:0},O=[{x:g,y:m}];v&&a<=0&&(C={x:g,y:m});for(var E=0;E<=p;E+=1){if(w=E/p,l=FKe(e,t,n,r,i,o,w),g=l.x,m=l.y,u&&O.push({x:g,y:m}),d&&(y+=xa(S,[g,m])),S=[g,m],v&&y>=a&&a>x[2]){var _=(y-a)/(y-x[2]);C={x:S[0]*(1-_)+x[0]*_,y:S[1]*(1-_)+x[1]*_}}x=[g,m,y]}return v&&a>=y&&(C={x:i,y:o}),{length:y,point:C,min:{x:Math.min.apply(null,O.map(function($){return $.x})),y:Math.min.apply(null,O.map(function($){return $.y}))},max:{x:Math.max.apply(null,O.map(function($){return $.x})),y:Math.max.apply(null,O.map(function($){return $.y}))}}}function $J(e,t,n){for(var r,i,o,a,s,l,c=OO(e),u=typeof t=="number",f,d=[],h,p=0,v=0,g=0,m=0,y,x=[],S=[],w=0,C={x:0,y:0},O=C,E=C,_=C,$=0,P=0,T=c.length;P<T;P+=1)y=c[P],h=y[0],f=h==="M",d=f?d:[p,v].concat(y.slice(1)),f?(g=y[1],m=y[2],C={x:g,y:m},O=C,w=0,u&&t<.001&&(_=C)):h==="L"?(r=wN(d[0],d[1],d[2],d[3],(t||0)-$),w=r.length,C=r.min,O=r.max,E=r.point):h==="A"?(i=jKe(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(t||0)-$,n||{}),w=i.length,C=i.min,O=i.max,E=i.point):h==="C"?(o=_J(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(t||0)-$,n||{}),w=o.length,C=o.min,O=o.max,E=o.point):h==="Q"?(a=BKe(d[0],d[1],d[2],d[3],d[4],d[5],(t||0)-$,n||{}),w=a.length,C=a.min,O=a.max,E=a.point):h==="Z"&&(d=[p,v,g,m],s=wN(d[0],d[1],d[2],d[3],(t||0)-$),w=s.length,C=s.min,O=s.max,E=s.point),u&&$<t&&$+w>=t&&(_=E),S.push(O),x.push(C),$+=w,l=h!=="Z"?y.slice(-2):[g,m],p=l[0],v=l[1];return u&&t>=$&&(_={x:p,y:v}),{length:$,point:_,min:{x:Math.min.apply(null,x.map(function(I){return I.x})),y:Math.min.apply(null,x.map(function(I){return I.y}))},max:{x:Math.max.apply(null,S.map(function(I){return I.x})),y:Math.max.apply(null,S.map(function(I){return I.y}))}}}function zKe(e,t){return $J(e,void 0,ke(ke({},t),{bbox:!1,length:!0})).length}function HKe(e){var t=e.length,n=t-1;return e.map(function(r,i){return e.map(function(o,a){var s=i+a,l;return a===0||e[s]&&e[s][0]==="M"?(l=e[s],["M"].concat(l.slice(-2))):(s>=t&&(s-=n),e[s])})})}function WKe(e,t){var n=e.length-1,r=[],i=0,o=0,a=HKe(e);return a.forEach(function(s,l){e.slice(1).forEach(function(c,u){o+=xa(e[(l+u)%n].slice(-2),t[u%n].slice(-2))}),r[l]=o,o=0}),i=r.indexOf(Math.min.apply(null,r)),a[i]}function VKe(e,t,n,r,i,o,a,s){return 3*((s-t)*(n+i)-(a-e)*(r+o)+r*(e-i)-n*(t-o)+s*(i+e/3)-a*(o+t/3))/20}function UKe(e){var t=0,n=0,r=0;return SN(e).map(function(i){var o;switch(i[0]){case"M":return t=i[1],n=i[2],0;default:var a=i.slice(1),s=a[0],l=a[1],c=a[2],u=a[3],f=a[4],d=a[5];return r=VKe(t,n,s,l,c,u,f,d),o=i.slice(-2),t=o[0],n=o[1],r}}).reduce(function(i,o){return i+o},0)}function PJ(e){return UKe(e)>=0}function qKe(e,t,n){return $J(e,t,ke(ke({},n),{bbox:!1,length:!0})).point}function GKe(e,t){t===void 0&&(t=.5);var n=e.slice(0,2),r=e.slice(2,4),i=e.slice(4,6),o=e.slice(6,8),a=Cf(n,r,t),s=Cf(r,i,t),l=Cf(i,o,t),c=Cf(a,s,t),u=Cf(s,l,t),f=Cf(c,u,t);return[["C"].concat(a,c,f),["C"].concat(u,l,o)]}function MJ(e){return e.map(function(t,n,r){var i=n&&r[n-1].slice(-2).concat(t.slice(1)),o=n?_J(i[0],i[1],i[2],i[3],i[4],i[5],i[6],i[7],i[8],{bbox:!1}).length:0,a;return n?a=o?GKe(i):[t,t]:a=[t],{s:t,ss:a,l:o}})}function TJ(e,t,n){var r=MJ(e),i=MJ(t),o=r.length,a=i.length,s=r.filter(function(g){return g.l}).length,l=i.filter(function(g){return g.l}).length,c=r.filter(function(g){return g.l}).reduce(function(g,m){var y=m.l;return g+y},0)/s||0,u=i.filter(function(g){return g.l}).reduce(function(g,m){var y=m.l;return g+y},0)/l||0,f=n||Math.max(o,a),d=[c,u],h=[f-o,f-a],p=0,v=[r,i].map(function(g,m){return g.l===f?g.map(function(y){return y.s}):g.map(function(y,x){return p=x&&h[m]&&y.l>=d[m],h[m]-=p?1:0,p?y.ss:[y.s]}).flat()});return v[0].length===v[1].length?v:TJ(v[0],v[1],f)}function IJ(e){var t=document.createElement("div");t.innerHTML=e;var n=t.childNodes[0];return n&&t.contains(n)&&t.removeChild(n),n}function Sr(e,t){if(e!==null)return{type:"column",value:e,field:t}}function _O(e,t){const n=Sr(e,t);return Object.assign(Object.assign({},n),{inferred:!0})}function $O(e,t){if(e!==null)return{type:"column",value:e,field:t,visual:!0}}function KKe(e,t){const n=Sr(e,t);return Object.assign(Object.assign({},n),{constant:!1})}function Of(e,t){const n=[];for(const r of e)n[r]=t;return n}function Dn(e,t){const n=e[t];if(!n)return[null,null];const{value:r,field:i=null}=n;return[r,i]}function T1(e,...t){for(const n of t)if(typeof n=="string"){const[r,i]=Dn(e,n);if(r!==null)return[r,i]}else return[n,null];return[null,null]}function I1(e){return e instanceof Date?!1:typeof e=="object"}const R1=()=>(e,t)=>{const{encode:n}=t,{y1:r}=n;return r!==void 0?[e,t]:[e,Ue({},t,{encode:{y1:_O(Of(e,0))}})]};R1.props={};function si(e,t){return e==null||t==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function YKe(e,t){return e==null||t==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ef(e){let t,n,r;e.length!==2?(t=si,n=(s,l)=>si(e(s),l),r=(s,l)=>e(s)-l):(t=e===si||e===YKe?e:XKe,n=e,r=e);function i(s,l,c=0,u=s.length){if(c<u){if(t(l,l)!==0)return u;do{const f=c+u>>>1;n(s[f],l)<0?c=f+1:u=f}while(c<u)}return c}function o(s,l,c=0,u=s.length){if(c<u){if(t(l,l)!==0)return u;do{const f=c+u>>>1;n(s[f],l)<=0?c=f+1:u=f}while(c<u)}return c}function a(s,l,c=0,u=s.length){const f=i(s,l,c,u-1);return f>c&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:i,center:a,right:o}}function XKe(){return 0}function CN(e){return e===null?NaN:+e}function*ZKe(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const RJ=Ef(si),QKe=RJ.right,JKe=RJ.left,eYe=Ef(CN).center;function NJ(e,t){let n=0;for(let r of e)r!=null&&(r=+r)>=r&&++n;return n}function tYe(e,t){let n=0,r,i=0,o=0;if(t===void 0)for(let a of e)a!=null&&(a=+a)>=a&&(r=a-i,i+=r/++n,o+=r*(a-i));else{let a=-1;for(let s of e)(s=t(s,++a,e))!=null&&(s=+s)>=s&&(r=s-i,i+=r/++n,o+=r*(s-i))}if(n>1)return o/(n-1)}function kJ(e,t){const n=tYe(e,t);return n&&Math.sqrt(n)}function Qc(e,t){let n,r;if(t===void 0)for(const i of e)i!=null&&(n===void 0?i>=i&&(n=r=i):(n>i&&(n=i),r<i&&(r=i)));else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(n===void 0?o>=o&&(n=r=o):(n>o&&(n=o),r<o&&(r=o)))}return[n,r]}class hh{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let r=0;for(let i=0;i<this._n&&i<32;i++){const o=n[i],a=t+o,s=Math.abs(t)<Math.abs(o)?t-(a-o):o-(a-t);s&&(n[r++]=s),t=a}return n[r]=t,this._n=r+1,this}valueOf(){const t=this._partials;let n=this._n,r,i,o,a=0;if(n>0){for(a=t[--n];n>0&&(r=a,i=t[--n],a=r+i,o=i-(a-r),!o););n>0&&(o<0&&t[n-1]<0||o>0&&t[n-1]>0)&&(i=o*2,r=a+i,i==r-a&&(a=r))}return a}}let nYe=class extends Map{constructor(t,n=oYe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,i]of t)this.set(r,i)}get(t){return super.get(AJ(this,t))}has(t){return super.has(AJ(this,t))}set(t,n){return super.set(rYe(this,t),n)}delete(t){return super.delete(iYe(this,t))}};function AJ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function rYe({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function iYe({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function oYe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function N1(e){return e}function Rr(e,...t){return PO(e,N1,N1,t)}function ON(e,...t){return PO(e,Array.from,N1,t)}function EN(e,t,...n){return PO(e,N1,t,n)}function _N(e,t,...n){return PO(e,Array.from,t,n)}function PO(e,t,n,r){return function i(o,a){if(a>=r.length)return n(o);const s=new nYe,l=r[a++];let c=-1;for(const u of o){const f=l(u,++c,o),d=s.get(f);d?d.push(u):s.set(f,[u])}for(const[u,f]of s)s.set(u,i(f,a));return t(s)}(e,0)}function aYe(e,t){return Array.from(t,n=>e[n])}function ml(e,...t){if(typeof e[Symbol.iterator]!="function")throw new TypeError("values is not iterable");e=Array.from(e);let[n]=t;if(n&&n.length!==2||t.length>1){const r=Uint32Array.from(e,(i,o)=>o);return t.length>1?(t=t.map(i=>e.map(i)),r.sort((i,o)=>{for(const a of t){const s=k1(a[i],a[o]);if(s)return s}})):(n=e.map(n),r.sort((i,o)=>k1(n[i],n[o]))),aYe(e,r)}return e.sort(LJ(n))}function LJ(e=si){if(e===si)return k1;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function k1(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(e<t?-1:e>t?1:0)}function sYe(e,t,n){return(t.length!==2?ml(EN(e,t,n),([r,i],[o,a])=>si(i,a)||si(r,o)):ml(Rr(e,n),([r,i],[o,a])=>t(i,a)||si(r,o))).map(([r])=>r)}var lYe=Array.prototype,cYe=lYe.slice;function $N(e){return()=>e}const uYe=Math.sqrt(50),fYe=Math.sqrt(10),dYe=Math.sqrt(2);function MO(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),o=r/Math.pow(10,i),a=o>=uYe?10:o>=fYe?5:o>=dYe?2:1;let s,l,c;return i<0?(c=Math.pow(10,-i)/a,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,i)*a,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?MO(e,t,n*2):[s,l,c]}function hYe(e,t,n){if(t=+t,e=+e,n=+n,!(n>0))return[];if(e===t)return[e];const r=t<e,[i,o,a]=r?MO(t,e,n):MO(e,t,n);if(!(o>=i))return[];const s=o-i+1,l=new Array(s);if(r)if(a<0)for(let c=0;c<s;++c)l[c]=(o-c)/-a;else for(let c=0;c<s;++c)l[c]=(o-c)*a;else if(a<0)for(let c=0;c<s;++c)l[c]=(i+c)/-a;else for(let c=0;c<s;++c)l[c]=(i+c)*a;return l}function PN(e,t,n){return t=+t,e=+e,n=+n,MO(e,t,n)[2]}function pYe(e,t,n){let r;for(;;){const i=PN(e,t,n);if(i===r||i===0||!isFinite(i))return[e,t];i>0?(e=Math.floor(e/i)*i,t=Math.ceil(t/i)*i):i<0&&(e=Math.ceil(e*i)/i,t=Math.floor(t*i)/i),r=i}}function vYe(e){return Math.max(1,Math.ceil(Math.log(NJ(e))/Math.LN2)+1)}function gYe(){var e=N1,t=Qc,n=vYe;function r(i){Array.isArray(i)||(i=Array.from(i));var o,a=i.length,s,l,c=new Array(a);for(o=0;o<a;++o)c[o]=e(i[o],o,i);var u=t(c),f=u[0],d=u[1],h=n(c,f,d);if(!Array.isArray(h)){const x=d,S=+h;if(t===Qc&&([f,d]=pYe(f,d,S)),h=hYe(f,d,S),h[0]<=f&&(l=PN(f,d,S)),h[h.length-1]>=d)if(x>=d&&t===Qc){const w=PN(f,d,S);isFinite(w)&&(w>0?d=(Math.floor(d/w)+1)*w:w<0&&(d=(Math.ceil(d*-w)+1)/-w))}else h.pop()}for(var p=h.length,v=0,g=p;h[v]<=f;)++v;for(;h[g-1]>d;)--g;(v||g<p)&&(h=h.slice(v,g),p=g-v);var m=new Array(p+1),y;for(o=0;o<=p;++o)y=m[o]=[],y.x0=o>0?h[o-1]:f,y.x1=o<p?h[o]:d;if(isFinite(l)){if(l>0)for(o=0;o<a;++o)(s=c[o])!=null&&f<=s&&s<=d&&m[Math.min(p,Math.floor((s-f)/l))].push(i[o]);else if(l<0){for(o=0;o<a;++o)if((s=c[o])!=null&&f<=s&&s<=d){const x=Math.floor((f-s)*l);m[Math.min(p,x+(h[x]<=s))].push(i[o])}}}else for(o=0;o<a;++o)(s=c[o])!=null&&f<=s&&s<=d&&m[QKe(h,s,0,p)].push(i[o]);return m}return r.value=function(i){return arguments.length?(e=typeof i=="function"?i:$N(i),r):e},r.domain=function(i){return arguments.length?(t=typeof i=="function"?i:$N([i[0],i[1]]),r):t},r.thresholds=function(i){return arguments.length?(n=typeof i=="function"?i:$N(Array.isArray(i)?cYe.call(i):i),r):n},r}function tr(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n<r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n<i||n===void 0&&i>=i)&&(n=i)}return n}function bg(e,t){let n,r=-1,i=-1;if(t===void 0)for(const o of e)++i,o!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n<o||n===void 0&&o>=o)&&(n=o,r=i);return r}function Za(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n>i||n===void 0&&i>=i)&&(n=i)}return n}function A1(e,t){let n,r=-1,i=-1;if(t===void 0)for(const o of e)++i,o!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);else for(let o of e)(o=t(o,++i,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o,r=i);return r}function MN(e,t,n=0,r=1/0,i){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(i=i===void 0?k1:LJ(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),h=Math.max(n,Math.floor(t-c*f/l+d)),p=Math.min(r,Math.floor(t+(l-c)*f/l+d));MN(e,t,h,p,i)}const o=e[t];let a=n,s=r;for(L1(e,n,t),i(e[r],o)>0&&L1(e,n,r);a<s;){for(L1(e,a,s),++a,--s;i(e[a],o)<0;)++a;for(;i(e[s],o)>0;)--s}i(e[n],o)===0?L1(e,n,s):(++s,L1(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function L1(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function mYe(e,t=si){let n,r=!1;if(t.length===1){let i;for(const o of e){const a=t(o);(r?si(a,i)>0:si(a,a)===0)&&(n=o,i=a,r=!0)}}else for(const i of e)(r?t(i,n)>0:t(i,i)===0)&&(n=i,r=!0);return n}function TO(e,t,n){if(e=Float64Array.from(ZKe(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Za(e);if(t>=1)return tr(e);var r,i=(r-1)*t,o=Math.floor(i),a=tr(MN(e,o).subarray(0,o+1)),s=Za(e.subarray(o+1));return a+(s-a)*(i-o)}}function yYe(e,t,n=CN){if(!isNaN(t=+t)){if(r=Float64Array.from(e,(s,l)=>CN(n(e[l],l,e))),t<=0)return A1(r);if(t>=1)return bg(r);var r,i=Uint32Array.from(e,(s,l)=>l),o=r.length-1,a=Math.floor(o*t);return MN(i,a,0,o,(s,l)=>k1(r[s],r[l])),a=mYe(i.subarray(0,a+1),s=>r[s]),a>=0?a:-1}}function bYe(e,t,n){const r=NJ(e),i=kJ(e);return r&&i?Math.ceil((n-t)*Math.cbrt(r)/(3.49*i)):1}function j1(e,t){let n=0,r=0;if(t===void 0)for(let i of e)i!=null&&(i=+i)>=i&&(++n,r+=i);else{let i=-1;for(let o of e)(o=t(o,++i,e))!=null&&(o=+o)>=o&&(++n,r+=o)}if(n)return r/n}function TN(e,t){return TO(e,.5,t)}function xYe(e,t){return yYe(e,.5,t)}function*SYe(e){for(const t of e)yield*mj(t)}function jJ(e){return Array.from(SYe(e))}function xg(e,t,n){e=+e,t=+t,n=(i=arguments.length)<2?(t=e,e=0,1):i<3?1:+n;for(var r=-1,i=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(i);++r<i;)o[r]=e+r*n;return o}function Os(e,t){let n=0;if(t===void 0)for(let r of e)(r=+r)&&(n+=r);else{let r=-1;for(let i of e)(i=+t(i,++r,e))&&(n+=i)}return n}var wYe=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(e,t||[])).next())})};function ph(e){return e}function IN(e){return e.reduce((t,n)=>(r,...i)=>n(t(r,...i),...i),ph)}function CYe(e){return e.reduce((t,n)=>r=>wYe(this,void 0,void 0,function*(){const i=yield t(r);return n(i)}),ph)}function RN(e){return e.replace(/( |^)[a-z]/g,t=>t.toUpperCase())}function Sg(e=""){throw new Error(e)}function NN(e,t){const{attributes:n}=t,r=new Set(["id","className"]);for(const[i,o]of Object.entries(n))r.has(i)||e.attr(i,o)}function wr(e){return e!=null&&!Number.isNaN(e)}function OYe(e){const t=new Map;return n=>{if(t.has(n))return t.get(n);const r=e(n);return t.set(n,r),r}}function EYe(e,t){const{transform:n}=e.style,i=(o=>o==="none"||o===void 0)(n)?"":n;e.style.transform=`${i} ${t}`.trimStart()}function bt(e,t){return DJ(e,t)||{}}function DJ(e,t){const n=Object.entries(e||{}).filter(([r])=>r.startsWith(t)).map(([r,i])=>[GQ(r.replace(t,"").trim()),i]).filter(([r])=>!!r);return n.length===0?null:Object.fromEntries(n)}function _Ye(e,t){return Object.fromEntries(Object.entries(e).filter(([n])=>t.find(r=>n.startsWith(r))))}function kN(e,...t){return Object.fromEntries(Object.entries(e).filter(([n])=>t.every(r=>!n.startsWith(r))))}function FJ(e,t){if(e===void 0)return null;if(typeof e=="number")return e;const n=+e.replace("%","");return Number.isNaN(n)?null:n/100*t}function wg(e){return typeof e=="object"&&!(e instanceof Date)&&e!==null&&!Array.isArray(e)}function Jc(e){return e===null||e===!1}function BJ(e,t,n=5,r=0){if(!(r>=n)){for(const i of Object.keys(t)){const o=t[i];!Yc(o)||!Yc(e[i])?e[i]=o:BJ(e[i],o,n,r+1)}return e}}function Vl(e,t){return Object.entries(e).reduce((n,[r,i])=>(n[r]=t(i,r,e),n),{})}function vh(e){return e.map((t,n)=>n)}function $Ye(e){return e[0]}function zJ(e){return e[e.length-1]}function PYe(e){return Array.from(new Set(e))}function HJ(e,t){const n=[[],[]];return e.forEach(r=>{n[t(r)?0:1].push(r)}),n}function WJ(e,t=e.length){if(t===1)return e.map(r=>[r]);const n=[];for(let r=0;r<e.length;r++){const i=e.slice(r+1);WJ(i,t-1).forEach(a=>{n.push([e[r],...a])})}return n}function MYe(e){if(e.length===1)return[e];const t=[];for(let n=1;n<=e.length;n++)t.push(...WJ(e,n));return t}function _f(e,t,n){const{encode:r}=n;if(e===null)return[t];const i=TYe(e).map(a=>{var s;return[a,(s=Dn(r,a))===null||s===void 0?void 0:s[0]]}).filter(([,a])=>wr(a)),o=a=>i.map(([,s])=>s[a]).join("-");return Array.from(Rr(t,o).values())}function VJ(e){return Array.isArray(e)?NYe(e):typeof e=="function"?RYe(e):e==="series"?IYe:e==="value"?kYe:e==="sum"?AYe:e==="maxIndex"?LYe:null}function UJ(e,t){for(const n of e)n.sort(t)}function qJ(e,t){return(t==null?void 0:t.domain)||Array.from(new Set(e))}function TYe(e){return Array.isArray(e)?e:[e]}function IYe(e,t,n){return D1(r=>n[r])}function RYe(e){return(t,n,r)=>D1(i=>e(t[i]))}function NYe(e){return(t,n,r)=>(i,o)=>e.reduce((a,s)=>a!==0?a:si(t[i][s],t[o][s]),0)}function kYe(e,t,n){return D1(r=>t[r])}function AYe(e,t,n){const r=vh(e),i=Array.from(Rr(r,a=>n[+a]).entries()),o=new Map(i.map(([a,s])=>[a,s.reduce((l,c)=>l+ +t[c])]));return D1(a=>o.get(n[a]))}function LYe(e,t,n){const r=vh(e),i=Array.from(Rr(r,a=>n[+a]).entries()),o=new Map(i.map(([a,s])=>[a,bg(s,l=>t[l])]));return D1(a=>o.get(n[a]))}function D1(e){return(t,n)=>si(e(t),e(n))}const GJ=(e={})=>{const{groupBy:t="x",orderBy:n=null,reverse:r=!1,y:i="y",y1:o="y1",series:a=!0}=e;return(s,l)=>{var c;const{data:u,encode:f,style:d={}}=l,[h,p]=Dn(f,"y"),[v,g]=Dn(f,"y1"),[m]=a?T1(f,"series","color"):Dn(f,"color"),y=_f(t,s,l),S=((c=VJ(n))!==null&&c!==void 0?c:()=>null)(u,h,m);S&&UJ(y,S);const w=new Array(s.length),C=new Array(s.length),O=new Array(s.length),E=[],_=[];for(const M of y){r&&M.reverse();const R=v?+v[M[0]]:0,N=[],k=[];for(const H of M){const z=O[H]=+h[H]-R;z<0?k.push(H):z>=0&&N.push(H)}const A=N.length>0?N:k,j=k.length>0?k:N;let D=N.length-1,L=0;for(;D>0&&h[A[D]]===0;)D--;for(;L<j.length-1&&h[j[L]]===0;)L++;E.push(A[D]),_.push(j[L]);let F=R;for(const H of k.reverse()){const z=O[H];F=w[H]=(C[H]=F)+z}let B=R;for(const H of N){const z=O[H];z>0?B=w[H]=(C[H]=B)+z:w[H]=C[H]=B}}const $=new Set(E),P=new Set(_),T=i==="y"?w:C,I=o==="y"?w:C;return[s,Ue({},l,{encode:{y0:_O(h,p),y:Sr(T,p),y1:Sr(I,g)},style:Object.assign({first:(M,R)=>$.has(R),last:(M,R)=>P.has(R)},d)})]}};GJ.props={};function F1(e){return Math.abs(e)>10?String(e):e.toString().padStart(2,"0")}function jYe(e){const t=e.getFullYear(),n=F1(e.getMonth()+1),r=F1(e.getDate()),i=`${t}-${n}-${r}`,o=e.getHours(),a=e.getMinutes(),s=e.getSeconds();return o||a||s?`${i} ${F1(o)}:${F1(a)}:${F1(s)}`:i}const IO=(e={})=>{const{channel:t="x"}=e;return(n,r)=>{const{encode:i}=r,{tooltip:o}=r;if(Jc(o))return[n,r];const{title:a}=o;if(a!==void 0)return[n,r];const s=Object.keys(i).filter(c=>c.startsWith(t)).filter(c=>!i[c].inferred).map(c=>Dn(i,c)).filter(([c])=>c).map(c=>c[0]);if(s.length===0)return[n,r];const l=[];for(const c of n)l[c]={value:s.map(u=>u[c]instanceof Date?jYe(u[c]):u[c]).join(", ")};return[n,Ue({},r,{tooltip:{title:l}})]}};IO.props={};const gh=()=>(e,t)=>{const{encode:n}=t,{x:r}=n;return r!==void 0?[e,t]:[e,Ue({},t,{encode:{x:_O(Of(e,0))},scale:{x:{guide:null}}})]};gh.props={};const RO=()=>(e,t)=>{const{encode:n}=t,{y:r}=n;return r!==void 0?[e,t]:[e,Ue({},t,{encode:{y:_O(Of(e,0))},scale:{y:{guide:null}}})]};RO.props={};const KJ=()=>(e,t)=>{const{encode:n}=t,{size:r}=n;return r!==void 0?[e,t]:[e,Ue({},t,{encode:{size:$O(Of(e,3))}})]};KJ.props={};var DYe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const YJ=()=>(e,t)=>{const{encode:n}=t,{key:r}=n,i=DYe(n,["key"]);if(r!==void 0)return[e,t];const o=Object.values(i).map(({value:s})=>s),a=e.map(s=>o.filter(Array.isArray).map(l=>l[s]).join("-"));return[e,Ue({},t,{encode:{key:Sr(a)}})]};YJ.props={};const AN=()=>(e,t)=>{const{encode:n}=t,{series:r,color:i}=n;if(r!==void 0||i===void 0)return[e,t];const[o,a]=Dn(n,"color");return[e,Ue({},t,{encode:{series:Sr(o,a)}})]};AN.props={};const XJ=()=>(e,t)=>{const{data:n}=t;return!Array.isArray(n)||n.some(I1)?[e,t]:[e,Ue({},t,{encode:{y:Sr(n)}})]};XJ.props={};const ZJ=()=>(e,t)=>{const{data:n}=t;return!Array.isArray(n)||n.some(I1)?[e,t]:[e,Ue({},t,{encode:{x:Sr(n)}})]};ZJ.props={};const QJ=()=>(e,t)=>{const{encode:n}=t,{y1:r}=n;if(r)return[e,t];const[i]=Dn(n,"y");return[e,Ue({},t,{encode:{y1:Sr([...i])}})]};QJ.props={};const JJ=()=>(e,t)=>{const{encode:n}=t,{x1:r}=n;if(r)return[e,t];const[i]=Dn(n,"x");return[e,Ue({},t,{encode:{x1:Sr([...i])}})]};JJ.props={};const eee=()=>(e,t)=>{const{data:n}=t;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(I1))){const r=(i,o)=>Array.isArray(i[0])?i.map(a=>a[o]):[i[o]];return[e,Ue({},t,{encode:{x:Sr(r(n,0)),x1:Sr(r(n,1))}})]}return[e,t]};eee.props={};const tee=()=>(e,t)=>{const{data:n}=t;if(Array.isArray(n)&&(n.every(Array.isArray)||!n.some(I1))){const r=(i,o)=>Array.isArray(i[0])?i.map(a=>a[o]):[i[o]];return[e,Ue({},t,{encode:{y:Sr(r(n,0)),y1:Sr(r(n,1))}})]}return[e,t]};tee.props={};const NO=e=>{const{channel:t}=e;return(n,r)=>{const{encode:i,tooltip:o}=r;if(Jc(o))return[n,r];const{items:a=[]}=o;if(!a||a.length>0)return[n,r];const l=(Array.isArray(t)?t:[t]).flatMap(c=>Object.keys(i).filter(u=>u.startsWith(c)).map(u=>{const{field:f,value:d,inferred:h=!1,aggregate:p}=i[u];return h?null:p&&d?{channel:u}:f?{field:f}:d?{channel:u}:null}).filter(u=>u!==null));return[n,Ue({},r,{tooltip:{items:l}})]}};NO.props={};const LN=()=>(e,t)=>[e,Ue({scale:{x:{padding:0},y:{padding:0}}},t)];LN.props={};var nee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const kO=()=>(e,t)=>{const{data:n,style:r={}}=t,i=nee(t,["data","style"]),{x:o,y:a}=r,s=nee(r,["x","y"]);if(o==null||a==null)return[e,t];const l=o||0,c=a||0;return[[0],Ue({},i,{data:[0],cartesian:!0,encode:{x:Sr([l]),y:Sr([c])},scale:{x:{type:"identity",independent:!0,guide:null},y:{type:"identity",independent:!0,guide:null}},style:s})]};kO.props={};const ree=()=>(e,t)=>{const{style:n={}}=t;return[e,Ue({},t,{style:Object.assign(Object.assign({},n),Object.fromEntries(Object.entries(n).filter(([,r])=>typeof r=="function").map(([r,i])=>[r,()=>i])))})]};ree.props={};const AO=()=>(e,t)=>{const{data:n}=t;if(!Array.isArray(n)||n.some(I1))return[e,t];const r=Array.isArray(n[0])?n:[n],i=r.map(a=>a[0]),o=r.map(a=>a[1]);return[e,Ue({},t,{encode:{x:Sr(i),y:Sr(o)}})]};AO.props={};const iee=()=>(e,t)=>{const{style:n={},encode:r}=t,{series:i}=r,{gradient:o}=n;return!o||i?[e,t]:[e,Ue({},t,{encode:{series:$O(Of(e,void 0))}})]};iee.props={};var FYe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const oee=(e={})=>{const{groupBy:t="x",reverse:n=!1,orderBy:r,padding:i}=e;return FYe(e,["groupBy","reverse","orderBy","padding"]),(o,a)=>{const{data:s,encode:l,scale:c}=a,{series:u}=c,[f]=Dn(l,"y"),[d]=T1(l,"series","color"),h=qJ(d,u),p=Ue({},a,{scale:{series:{domain:h,paddingInner:i}}}),v=_f(t,o,a),g=VJ(r);if(!g)return[o,Ue(p,{encode:{series:Sr(d)}})];const m=g(s,f,d);m&&UJ(v,m);const y=new Array(o.length);for(const x of v){n&&x.reverse();for(let S=0;S<x.length;S++)y[x[S]]=h[S]}return[o,Ue(p,{encode:{series:Sr(r?y:d)}})]}};oee.props={};const aee=e=>{const{groupBy:t=["x"],reducer:n=(a,s)=>s[a[0]],orderBy:r=null,reverse:i=!1,duration:o}=e;return(a,s)=>{const{encode:l}=s,u=(Array.isArray(t)?t:[t]).map(g=>[g,Dn(l,g)[0]]);if(u.length===0)return[a,s];let f=[a];for(const[,g]of u){const m=[];for(const y of f){const x=Array.from(Rr(y,S=>g[S]).values());m.push(...x)}f=m}if(r){const[g]=Dn(l,r);g&&f.sort((m,y)=>n(m,g)-n(y,g)),i&&f.reverse()}const d=(o||3e3)/f.length,[h]=o?[Of(a,d)]:T1(l,"enterDuration",Of(a,d)),[p]=T1(l,"enterDelay",Of(a,0)),v=new Array(a.length);for(let g=0,m=0;g<f.length;g++){const y=f[g],x=tr(y,S=>+h[S]);for(const S of y)v[S]=+p[S]+m;m+=x}return[a,Ue({},s,{encode:{enterDuration:$O(h),enterDelay:$O(v)}})]}};aee.props={};var BYe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function zYe(e){return typeof e=="function"?e:{min:(n,r)=>Za(n,i=>r[+i]),max:(n,r)=>tr(n,i=>r[+i]),first:(n,r)=>r[n[0]],last:(n,r)=>r[n[n.length-1]],mean:(n,r)=>j1(n,i=>r[+i]),median:(n,r)=>TN(n,i=>r[+i]),sum:(n,r)=>Os(n,i=>r[+i]),deviation:(n,r)=>kJ(n,i=>r[+i])}[e]||tr}const see=(e={})=>{const{groupBy:t="x",basis:n="max"}=e;return(r,i)=>{const{encode:o,tooltip:a}=i,s=BYe(o,["x"]),l=Object.entries(s).filter(([p])=>p.startsWith("y")).map(([p])=>[p,Dn(o,p)[0]]),[,c]=l.find(([p])=>p==="y"),u=l.map(([p])=>[p,new Array(r.length)]),f=_f(t,r,i),d=zYe(n);for(const p of f){const v=d(p,c);for(const g of p)for(let m=0;m<l.length;m++){const[,y]=l[m],[,x]=u[m];x[g]=+y[g]/v}}const h=Jc(a)||(a==null?void 0:a.items)&&(a==null?void 0:a.items.length)!==0;return[r,Ue({},i,Object.assign({encode:Object.fromEntries(u.map(([p,v])=>[p,Sr(v,Dn(o,p)[1])]))},!h&&o.y0&&{tooltip:{items:[{channel:"y0"}]}}))]}};see.props={};function Cg(e,...t){return t.reduce((n,r)=>i=>n(r(i)),e)}function LO(e,t){return t-e?n=>(n-e)/(t-e):n=>.5}function HYe(e,t){const n=t<e?t:e,r=e>t?e:t;return i=>Math.min(Math.max(n,i),r)}function jN(e,t,n,r,i){let o=n||0,a=r||e.length;const s=i||(l=>l);for(;o<a;){const l=Math.floor((o+a)/2);s(e[l])>t?a=l:o=l+1}return o}const DN=Math.sqrt(50),FN=Math.sqrt(10),BN=Math.sqrt(2);function jO(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log(r)/Math.LN10),o=r/Ji(10,i);return i>=0?(o>=DN?10:o>=FN?5:o>=BN?2:1)*Ji(10,i):-Ji(10,-i)/(o>=DN?10:o>=FN?5:o>=BN?2:1)}function lee(e,t,n){const r=Math.abs(t-e)/Math.max(0,n);let i=Ji(10,Math.floor(Math.log(r)/Math.LN10));const o=r/i;return o>=DN?i*=10:o>=FN?i*=5:o>=BN&&(i*=2),t<e?-i:i}const cee=(e,t,n=5)=>{const r=[e,t];let i=0,o=r.length-1,a=r[i],s=r[o],l;return s<a&&([a,s]=[s,a],[i,o]=[o,i]),l=jO(a,s,n),l>0?(a=Math.floor(a/l)*l,s=Math.ceil(s/l)*l,l=jO(a,s,n)):l<0&&(a=Math.ceil(a*l)/l,s=Math.floor(s*l)/l,l=jO(a,s,n)),l>0?(r[i]=Math.floor(a/l)*l,r[o]=Math.ceil(s/l)*l):l<0&&(r[i]=Math.ceil(a*l)/l,r[o]=Math.floor(s*l)/l),r},B1=1e3,z1=B1*60,H1=z1*60,mh=H1*24,W1=mh*7,uee=mh*30,fee=mh*365;function Fo(e,t,n,r){const i=(c,u)=>{const f=h=>r(h)%u===0;let d=u;for(;d&&!f(c);)n(c,-1),d-=1;return c},o=(c,u)=>{u&&i(c,u),t(c)},a=(c,u)=>{const f=new Date(+c);return o(f,u),f},s=(c,u)=>{const f=new Date(+c-1);return o(f,u),n(f,u),o(f),f};return{ceil:s,floor:a,range:(c,u,f,d)=>{const h=[],p=Math.floor(f),v=d?s(c,f):s(c);for(let g=v;g<u;n(g,p),o(g))h.push(new Date(+g));return h},duration:e}}const WYe=Fo(1,e=>e,(e,t=1)=>{e.setTime(+e+t)},e=>e.getTime()),VYe=Fo(B1,e=>{e.setMilliseconds(0)},(e,t=1)=>{e.setTime(+e+B1*t)},e=>e.getSeconds()),UYe=Fo(z1,e=>{e.setSeconds(0,0)},(e,t=1)=>{e.setTime(+e+z1*t)},e=>e.getMinutes()),qYe=Fo(H1,e=>{e.setMinutes(0,0,0)},(e,t=1)=>{e.setTime(+e+H1*t)},e=>e.getHours()),GYe=Fo(mh,e=>{e.setHours(0,0,0,0)},(e,t=1)=>{e.setTime(+e+mh*t)},e=>e.getDate()-1),dee=Fo(uee,e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t=1)=>{const n=e.getMonth();e.setMonth(n+t)},e=>e.getMonth()),KYe=Fo(W1,e=>{e.setDate(e.getDate()-e.getDay()%7),e.setHours(0,0,0,0)},(e,t=1)=>{e.setDate(e.getDate()+7*t)},e=>{const t=dee.floor(e),n=new Date(+e);return Math.floor((+n-+t)/W1)}),YYe=Fo(fee,e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t=1)=>{const n=e.getFullYear();e.setFullYear(n+t)},e=>e.getFullYear()),hee={millisecond:WYe,second:VYe,minute:UYe,hour:qYe,day:GYe,week:KYe,month:dee,year:YYe},XYe=Fo(1,e=>e,(e,t=1)=>{e.setTime(+e+t)},e=>e.getTime()),ZYe=Fo(B1,e=>{e.setUTCMilliseconds(0)},(e,t=1)=>{e.setTime(+e+B1*t)},e=>e.getUTCSeconds()),QYe=Fo(z1,e=>{e.setUTCSeconds(0,0)},(e,t=1)=>{e.setTime(+e+z1*t)},e=>e.getUTCMinutes()),JYe=Fo(H1,e=>{e.setUTCMinutes(0,0,0)},(e,t=1)=>{e.setTime(+e+H1*t)},e=>e.getUTCHours()),eXe=Fo(mh,e=>{e.setUTCHours(0,0,0,0)},(e,t=1)=>{e.setTime(+e+mh*t)},e=>e.getUTCDate()-1),pee=Fo(uee,e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t=1)=>{const n=e.getUTCMonth();e.setUTCMonth(n+t)},e=>e.getUTCMonth()),tXe=Fo(W1,e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7)%7),e.setUTCHours(0,0,0,0)},(e,t=1)=>{e.setTime(+e+W1*t)},e=>{const t=pee.floor(e),n=new Date(+e);return Math.floor((+n-+t)/W1)}),nXe=Fo(fee,e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t=1)=>{const n=e.getUTCFullYear();e.setUTCFullYear(n+t)},e=>e.getUTCFullYear()),vee={millisecond:XYe,second:ZYe,minute:QYe,hour:JYe,day:eXe,week:tXe,month:pee,year:nXe};function rXe(e){const t=e?vee:hee,{year:n,month:r,week:i,day:o,hour:a,minute:s,second:l,millisecond:c}=t;return{tickIntervals:[[l,1],[l,5],[l,15],[l,30],[s,1],[s,5],[s,15],[s,30],[a,1],[a,3],[a,6],[a,12],[o,1],[o,2],[i,1],[r,1],[r,3],[n,1]],year:n,millisecond:c}}function gee(e,t,n,r,i){const o=+e,a=+t,{tickIntervals:s,year:l,millisecond:c}=rXe(i),u=([g,m])=>g.duration*m,f=r?(a-o)/r:n||5,d=r||(a-o)/f,h=s.length,p=jN(s,d,0,h,u);let v;if(p===h){const g=lee(o/l.duration,a/l.duration,f);v=[l,g]}else if(p){const g=d/u(s[p-1])<u(s[p])/d,[m,y]=g?s[p-1]:s[p],x=r?Math.ceil(r/m.duration):y;v=[m,x]}else{const g=Math.max(lee(o,a,f),1);v=[c,g]}return v}const iXe=(e,t,n,r,i)=>{const o=e>t,a=o?t:e,s=o?e:t,[l,c]=gee(a,s,n,r,i),u=[l.floor(a,c),l.ceil(s,c)];return o?u.reverse():u};function DO(e){return!xr(e)&&!CGe(e)&&!Number.isNaN(e)}const mee=e=>t=>-e(-t),zN=(e,t)=>{const n=Math.log(e),r=e===Math.E?Math.log:e===10?Math.log10:e===2?Math.log2:i=>Math.log(i)/n;return t?mee(r):r},HN=(e,t)=>{const n=e===Math.E?Math.exp:r=>Ji(e,r);return t?mee(n):n},oXe=(e,t,n,r)=>{const i=e<0,o=zN(r,i),a=HN(r,i),s=e>t,l=s?t:e,c=s?e:t,u=[a(Math.floor(o(l))),a(Math.ceil(o(c)))];return s?u.reverse():u},aXe=e=>t=>{const n=e(t);return _r(n)?Math.round(n):n};function sXe(e,t){return n=>{n.prototype.rescale=function(){this.initRange(),this.nice();const[r]=this.chooseTransforms();this.composeOutput(r,this.chooseClamp(r))},n.prototype.initRange=function(){const{interpolator:r}=this.options;this.options.range=e(r)},n.prototype.composeOutput=function(r,i){const{domain:o,interpolator:a,round:s}=this.getOptions(),l=t(o.map(r)),c=s?aXe(a):a;this.output=Cg(c,l,i,r)},n.prototype.invert=void 0}}var yee={exports:{}},lXe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},bee={exports:{}},cXe=function(t){return!t||typeof t=="string"?!1:t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&t.constructor.name!=="String")},uXe=cXe,fXe=Array.prototype.concat,dXe=Array.prototype.slice,xee=bee.exports=function(t){for(var n=[],r=0,i=t.length;r<i;r++){var o=t[r];uXe(o)?n=fXe.call(n,dXe.call(o)):n.push(o)}return n};xee.wrap=function(e){return function(){return e(xee(arguments))}};var hXe=bee.exports,V1=lXe,U1=hXe,See=Object.hasOwnProperty,wee=Object.create(null);for(var WN in V1)See.call(V1,WN)&&(wee[V1[WN]]=WN);var Qa=yee.exports={to:{},get:{}};Qa.get=function(e){var t=e.substring(0,3).toLowerCase(),n,r;switch(t){case"hsl":n=Qa.get.hsl(e),r="hsl";break;case"hwb":n=Qa.get.hwb(e),r="hwb";break;default:n=Qa.get.rgb(e),r="rgb";break}return n?{model:r,value:n}:null},Qa.get.rgb=function(e){if(!e)return null;var t=/^#([a-f0-9]{3,4})$/i,n=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,i=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,o=/^(\w+)$/,a=[0,0,0,1],s,l,c;if(s=e.match(n)){for(c=s[2],s=s[1],l=0;l<3;l++){var u=l*2;a[l]=parseInt(s.slice(u,u+2),16)}c&&(a[3]=parseInt(c,16)/255)}else if(s=e.match(t)){for(s=s[1],c=s[3],l=0;l<3;l++)a[l]=parseInt(s[l]+s[l],16);c&&(a[3]=parseInt(c+c,16)/255)}else if(s=e.match(r)){for(l=0;l<3;l++)a[l]=parseInt(s[l+1],0);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else if(s=e.match(i)){for(l=0;l<3;l++)a[l]=Math.round(parseFloat(s[l+1])*2.55);s[4]&&(s[5]?a[3]=parseFloat(s[4])*.01:a[3]=parseFloat(s[4]))}else return(s=e.match(o))?s[1]==="transparent"?[0,0,0,0]:See.call(V1,s[1])?(a=V1[s[1]],a[3]=1,a):null:null;for(l=0;l<3;l++)a[l]=$f(a[l],0,255);return a[3]=$f(a[3],0,1),a},Qa.get.hsl=function(e){if(!e)return null;var t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=$f(parseFloat(n[2]),0,100),a=$f(parseFloat(n[3]),0,100),s=$f(isNaN(r)?1:r,0,1);return[i,o,a,s]}return null},Qa.get.hwb=function(e){if(!e)return null;var t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){var r=parseFloat(n[4]),i=(parseFloat(n[1])%360+360)%360,o=$f(parseFloat(n[2]),0,100),a=$f(parseFloat(n[3]),0,100),s=$f(isNaN(r)?1:r,0,1);return[i,o,a,s]}return null},Qa.to.hex=function(){var e=U1(arguments);return"#"+FO(e[0])+FO(e[1])+FO(e[2])+(e[3]<1?FO(Math.round(e[3]*255)):"")},Qa.to.rgb=function(){var e=U1(arguments);return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},Qa.to.rgb.percent=function(){var e=U1(arguments),t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"},Qa.to.hsl=function(){var e=U1(arguments);return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},Qa.to.hwb=function(){var e=U1(arguments),t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},Qa.to.keyword=function(e){return wee[e.slice(0,3)]};function $f(e,t,n){return Math.min(Math.max(t,e),n)}function FO(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var pXe=yee.exports;const vXe=Rt(pXe);function VN(e,t,n){let r=n;return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function gXe(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100,i=e[3];if(n===0)return[r*255,r*255,r*255,i];const o=r<.5?r*(1+n):r+n-r*n,a=2*r-o,s=VN(a,o,t+1/3),l=VN(a,o,t),c=VN(a,o,t-1/3);return[s*255,l*255,c*255,i]}function Cee(e){const t=vXe.get(e);if(!t)return null;const{model:n,value:r}=t;return n==="rgb"?r:n==="hsl"?gXe(r):null}const Og=(e,t)=>n=>e*(1-n)+t*n,mXe=(e,t)=>{const n=Cee(e),r=Cee(t);return n===null||r===null?n?()=>e:()=>t:i=>{const o=new Array(4);for(let u=0;u<4;u+=1){const f=n[u],d=r[u];o[u]=f*(1-i)+d*i}const[a,s,l,c]=o;return`rgba(${Math.round(a)}, ${Math.round(s)}, ${Math.round(l)}, ${c})`}},q1=(e,t)=>typeof e=="number"&&typeof t=="number"?Og(e,t):typeof e=="string"&&typeof t=="string"?mXe(e,t):()=>e,yXe=(e,t)=>{const n=Og(e,t);return r=>Math.round(n(r))};function bXe(e,t){const{second:n,minute:r,hour:i,day:o,week:a,month:s,year:l}=t;return n.floor(e)<e?".SSS":r.floor(e)<e?":ss":i.floor(e)<e?"hh:mm":o.floor(e)<e?"hh A":s.floor(e)<e?a.floor(e)<e?"MMM DD":"ddd DD":l.floor(e)<e?"MMMM":"YYYY"}function Oee({map:e,initKey:t},n){const r=t(n);return e.has(r)?e.get(r):n}function xXe({map:e,initKey:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function SXe({map:e,initKey:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function wXe(e){return typeof e=="object"?e.valueOf():e}class Eee extends Map{constructor(t){if(super(),this.map=new Map,this.initKey=wXe,t!==null)for(const[n,r]of t)this.set(n,r)}get(t){return super.get(Oee({map:this.map,initKey:this.initKey},t))}has(t){return super.has(Oee({map:this.map,initKey:this.initKey},t))}set(t,n){return super.set(xXe({map:this.map,initKey:this.initKey},t),n)}delete(t){return super.delete(SXe({map:this.map,initKey:this.initKey},t))}}let G1=class{constructor(t){this.options=Ue({},this.getDefaultOptions()),this.update(t)}getOptions(){return this.options}update(t={}){this.options=Ue({},this.options,t),this.rescale(t)}rescale(t){}};const BO=Symbol("defaultUnknown");function _ee(e,t,n){for(let r=0;r<t.length;r+=1)e.has(t[r])||e.set(n(t[r]),r)}function $ee(e){const{value:t,from:n,to:r,mapper:i,notFoundReturn:o}=e;let a=i.get(t);if(a===void 0){if(o!==BO)return o;a=n.push(t)-1,i.set(t,a)}return r[a%r.length]}function Pee(e){return e instanceof Date?t=>`${t}`:typeof e=="object"?t=>JSON.stringify(t):t=>t}let Mee=class qve extends G1{getDefaultOptions(){return{domain:[],range:[],unknown:BO}}constructor(t){super(t)}map(t){return this.domainIndexMap.size===0&&_ee(this.domainIndexMap,this.getDomain(),this.domainKey),$ee({value:this.domainKey(t),mapper:this.domainIndexMap,from:this.getDomain(),to:this.getRange(),notFoundReturn:this.options.unknown})}invert(t){return this.rangeIndexMap.size===0&&_ee(this.rangeIndexMap,this.getRange(),this.rangeKey),$ee({value:this.rangeKey(t),mapper:this.rangeIndexMap,from:this.getRange(),to:this.getDomain(),notFoundReturn:this.options.unknown})}rescale(t){const[n]=this.options.domain,[r]=this.options.range;if(this.domainKey=Pee(n),this.rangeKey=Pee(r),!this.rangeIndexMap){this.rangeIndexMap=new Map,this.domainIndexMap=new Map;return}(!t||t.range)&&this.rangeIndexMap.clear(),(!t||t.domain||t.compare)&&(this.domainIndexMap.clear(),this.sortedDomain=void 0)}clone(){return new qve(this.options)}getRange(){return this.options.range}getDomain(){if(this.sortedDomain)return this.sortedDomain;const{domain:t,compare:n}=this.options;return this.sortedDomain=n?[...t].sort(n):t,this.sortedDomain}};function CXe(e){const t=Math.min(...e);return e.map(n=>n/t)}function OXe(e,t){const n=e.length,r=t-n;return r>0?[...e,...new Array(r).fill(1)]:r<0?e.slice(0,t):e}function EXe(e){return Math.round(e*1e12)/1e12}function _Xe(e){const{domain:t,range:n,paddingOuter:r,paddingInner:i,flex:o,round:a,align:s}=e,l=t.length,c=OXe(o,l),[u,f]=n,d=f-u,h=2/l*r+1-1/l*i,p=d/h,v=p*i/l,g=p-l*v,m=CXe(c),y=m.reduce((T,I)=>T+I),x=g/y,S=new Eee(t.map((T,I)=>{const M=m[I]*x;return[T,a?Math.floor(M):M]})),w=new Eee(t.map((T,I)=>{const R=m[I]*x+v;return[T,a?Math.floor(R):R]})),C=Array.from(w.values()).reduce((T,I)=>T+I),E=(d-(C-C/l*i))*s,_=u+E;let $=a?Math.round(_):_;const P=new Array(l);for(let T=0;T<l;T+=1){P[T]=EXe($);const I=t[T];$+=w.get(I)}return{valueBandWidth:S,valueStep:w,adjustedRange:P}}function $Xe(e){var t;const{domain:n}=e,r=n.length;if(r===0)return{valueBandWidth:void 0,valueStep:void 0,adjustedRange:[]};if(!!(!((t=e.flex)===null||t===void 0)&&t.length))return _Xe(e);const{range:o,paddingOuter:a,paddingInner:s,round:l,align:c}=e;let u,f,d=o[0];const p=o[1]-d,v=a*2,g=r-s;u=p/Math.max(1,v+g),l&&(u=Math.floor(u)),d+=(p-u*(r-s))*c,f=u*(1-s),l&&(d=Math.round(d),f=Math.round(f));const m=new Array(r).fill(0).map((y,x)=>d+x*u);return{valueStep:u,valueBandWidth:f,adjustedRange:m}}let Eg=class Gve extends Mee{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,paddingInner:0,paddingOuter:0,padding:0,unknown:BO,flex:[]}}constructor(t){super(t)}clone(){return new Gve(this.options)}getStep(t){return this.valueStep===void 0?1:typeof this.valueStep=="number"?this.valueStep:t===void 0?Array.from(this.valueStep.values())[0]:this.valueStep.get(t)}getBandWidth(t){return this.valueBandWidth===void 0?1:typeof this.valueBandWidth=="number"?this.valueBandWidth:t===void 0?Array.from(this.valueBandWidth.values())[0]:this.valueBandWidth.get(t)}getRange(){return this.adjustedRange}getPaddingInner(){const{padding:t,paddingInner:n}=this.options;return t>0?t:n}getPaddingOuter(){const{padding:t,paddingOuter:n}=this.options;return t>0?t:n}rescale(){super.rescale();const{align:t,domain:n,range:r,round:i,flex:o}=this.options,{adjustedRange:a,valueBandWidth:s,valueStep:l}=$Xe({align:t,range:r,round:i,flex:o,paddingInner:this.getPaddingInner(),paddingOuter:this.getPaddingOuter(),domain:n});this.valueStep=l,this.valueBandWidth=s,this.adjustedRange=a}};const yh=(e,t,n)=>{let r,i,o=e,a=t;if(o===a&&n>0)return[o];let s=jO(o,a,n);if(s===0||!Number.isFinite(s))return[];if(s>0){o=Math.ceil(o/s),a=Math.floor(a/s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)*s}else{s=-s,o=Math.ceil(o*s),a=Math.floor(a*s),i=new Array(r=Math.ceil(a-o+1));for(let l=0;l<r;l+=1)i[l]=(o+l)/s}return i};let UN=class Kve extends G1{getDefaultOptions(){return{range:[0],domain:[0,1],unknown:void 0,tickCount:5,tickMethod:yh}}map(t){const[n]=this.options.range;return n!==void 0?n:this.options.unknown}invert(t){const[n]=this.options.range;return t===n&&n!==void 0?this.options.domain:[]}getTicks(){const{tickMethod:t,domain:n,tickCount:r}=this.options,[i,o]=n;return!_r(i)||!_r(o)?[]:t(i,o,r)}clone(){return new Kve(this.options)}};function K1(e){return Math.abs(e)<1e-14?e:parseFloat(e.toFixed(14))}const PXe=[1,5,2,2.5,4,3],Tee=Number.EPSILON*100;function MXe(e,t){return(e%t+t)%t}function TXe(e){return Math.round(e*1e12)/1e12}function IXe(e,t,n,r,i,o){const a=_1(t),s=QQ(t,e);let l=0;const c=MXe(r,o);return(c<Tee||o-c<Tee)&&r<=0&&i>=0&&(l=1),1-s/(a-1)-n+l}function RXe(e,t,n){const r=_1(t);return 1-QQ(t,e)/(r-1)-n+1}function NXe(e,t,n,r,i,o){const a=(e-1)/(o-i),s=(t-1)/(Math.max(o,r)-Math.min(n,i));return 2-Math.max(a/s,s/a)}function kXe(e,t){return e>=t?2-(e-1)/(t-1):1}function AXe(e,t,n,r){const i=t-e;return 1-.5*(Ji(t-r,2)+Ji(e-n,2))/Ji(.1*i,2)}function LXe(e,t,n){const r=t-e;if(n>r){const i=(n-r)/2;return 1-Ji(i,2)/Ji(.1*r,2)}return 1}function jXe(){return 1}const qN=(e,t,n=5,r=!0,i=PXe,o=[.25,.2,.5,.05])=>{const a=n<0?0:Math.round(n);if(Number.isNaN(e)||Number.isNaN(t)||typeof e!="number"||typeof t!="number"||!a)return[];if(t-e<1e-15||a===1)return[e];const s={score:-2,lmin:0,lmax:0,lstep:0};let l=1;for(;l<1/0;){for(let p=0;p<i.length;p+=1){const v=i[p],g=RXe(v,i,l);if(o[0]*g+o[1]+o[2]+o[3]<s.score){l=1/0;break}let m=2;for(;m<1/0;){const y=kXe(m,a);if(o[0]*g+o[1]+o[2]*y+o[3]<s.score)break;const x=(t-e)/(m+1)/l/v;let S=Math.ceil(Math.log10(x));for(;S<1/0;){const w=l*v*Ji(10,S),C=LXe(e,t,w*(m-1));if(o[0]*g+o[1]*C+o[2]*y+o[3]<s.score)break;const O=Math.floor(t/w)*l-(m-1)*l,E=Math.ceil(e/w)*l;if(O<=E){const _=E-O;for(let $=0;$<=_;$+=1){const T=(O+$)*(w/l),I=T+w*(m-1),M=w,R=IXe(v,i,l,T,I,M),N=AXe(e,t,T,I),k=NXe(m,a,e,t,T,I),A=jXe(),j=o[0]*R+o[1]*N+o[2]*k+o[3]*A;j>s.score&&(!r||T<=e&&I>=t)&&(s.lmin=T,s.lmax=I,s.lstep=M,s.score=j)}}S+=1}m+=1}}l+=1}const c=K1(s.lmax),u=K1(s.lmin),f=K1(s.lstep),d=Math.floor(TXe((c-u)/f))+1,h=new Array(d);h[0]=K1(u);for(let p=1;p<d;p+=1)h[p]=K1(h[p-1]+f);return h};let Iee=class Yve extends G1{getDefaultOptions(){return{domain:[0,1],range:[0,1],tickCount:5,unknown:void 0,tickMethod:qN}}map(t){return DO(t)?t:this.options.unknown}invert(t){return this.map(t)}clone(){return new Yve(this.options)}getTicks(){const{domain:t,tickCount:n,tickMethod:r}=this.options,[i,o]=t;return!_r(i)||!_r(o)?[]:r(i,o,n)}};const DXe=(e,t,n)=>{const[r,i]=e,[o,a]=t;let s,l;return r<i?(s=LO(r,i),l=n(o,a)):(s=LO(i,r),l=n(a,o)),Cg(l,s)},FXe=(e,t,n)=>{const r=Math.min(e.length,t.length)-1,i=new Array(r),o=new Array(r),a=e[0]>e[r],s=a?[...e].reverse():e,l=a?[...t].reverse():t;for(let c=0;c<r;c+=1)i[c]=LO(s[c],s[c+1]),o[c]=n(l[c],l[c+1]);return c=>{const u=jN(e,c,1,r)-1,f=i[u],d=o[u];return Cg(d,f)(c)}},Ree=(e,t,n,r)=>(Math.min(e.length,t.length)>2?FXe:DXe)(e,t,r?yXe:n);let zO=class extends G1{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:Og,tickCount:5}}map(t){return DO(t)?this.output(t):this.options.unknown}invert(t){return DO(t)?this.input(t):this.options.unknown}nice(){if(!this.options.nice)return;const[t,n,r,...i]=this.getTickMethodOptions();this.options.domain=this.chooseNice()(t,n,r,...i)}getTicks(){const{tickMethod:t}=this.options,[n,r,i,...o]=this.getTickMethodOptions();return t(n,r,i,...o)}getTickMethodOptions(){const{domain:t,tickCount:n}=this.options,r=t[0],i=t[t.length-1];return[r,i,n]}chooseNice(){return cee}rescale(){this.nice();const[t,n]=this.chooseTransforms();this.composeOutput(t,this.chooseClamp(t)),this.composeInput(t,n,this.chooseClamp(n))}chooseClamp(t){const{clamp:n,range:r}=this.options,i=this.options.domain.map(t),o=Math.min(i.length,r.length);return n?HYe(i[0],i[o-1]):uh}composeOutput(t,n){const{domain:r,range:i,round:o,interpolate:a}=this.options,s=Ree(r.map(t),i,a,o);this.output=Cg(s,n,t)}composeInput(t,n,r){const{domain:i,range:o}=this.options,a=Ree(o,i.map(t),Og);this.input=Cg(n,r,a)}},$r=class Xve extends zO{getDefaultOptions(){return{domain:[0,1],range:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolate:q1,tickMethod:yh,tickCount:5}}chooseTransforms(){return[uh,uh]}clone(){return new Xve(this.options)}},Nee=class Zve extends Eg{getDefaultOptions(){return{domain:[],range:[0,1],align:.5,round:!1,padding:0,unknown:BO,paddingInner:1,paddingOuter:0}}constructor(t){super(t)}getPaddingInner(){return 1}clone(){return new Zve(this.options)}update(t){super.update(t)}getPaddingOuter(){return this.options.padding}};const BXe=e=>t=>t<0?-Ji(-t,e):Ji(t,e),zXe=e=>t=>t<0?-Ji(-t,1/e):Ji(t,1/e),HXe=e=>e<0?-Math.sqrt(-e):Math.sqrt(e);let kee=class Qve extends zO{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,exponent:2,interpolate:q1,tickMethod:yh,tickCount:5}}constructor(t){super(t)}chooseTransforms(){const{exponent:t}=this.options;if(t===1)return[uh,uh];const n=t===.5?HXe:BXe(t),r=zXe(t);return[n,r]}clone(){return new Qve(this.options)}},WXe=class Jve extends kee{getDefaultOptions(){return{domain:[0,1],range:[0,1],nice:!1,clamp:!1,round:!1,interpolate:q1,tickMethod:yh,tickCount:5,exponent:.5}}constructor(t){super(t)}update(t){super.update(t)}clone(){return new Jve(this.options)}},HO=class ege extends G1{getDefaultOptions(){return{domain:[.5],range:[0,1]}}constructor(t){super(t)}map(t){if(!DO(t))return this.options.unknown;const n=jN(this.thresholds,t,0,this.n);return this.options.range[n]}invert(t){const{range:n}=this.options,r=n.indexOf(t),i=this.thresholds;return[i[r-1],i[r]]}clone(){return new ege(this.options)}rescale(){const{domain:t,range:n}=this.options;this.n=Math.min(t.length,n.length-1),this.thresholds=t}};const VXe=(e,t,n,r=10)=>{const i=e<0,o=HN(r,i),a=zN(r,i),s=t<e,l=s?t:e,c=s?e:t;let u=a(l),f=a(c),d=[];if(!(r%1)&&f-u<n){if(u=Math.floor(u),f=Math.ceil(f),i)for(;u<=f;u+=1){const h=o(u);for(let p=r-1;p>=1;p-=1){const v=h*p;if(v>c)break;v>=l&&d.push(v)}}else for(;u<=f;u+=1){const h=o(u);for(let p=1;p<r;p+=1){const v=h*p;if(v>c)break;v>=l&&d.push(v)}}d.length*2<n&&(d=yh(l,c,n))}else{const h=n===-1?f-u:Math.min(f-u,n);d=yh(u,f,h).map(o)}return s?d.reverse():d};let UXe=class tge extends zO{getDefaultOptions(){return{domain:[1,10],range:[0,1],base:10,interpolate:q1,tickMethod:VXe,tickCount:5}}chooseNice(){return oXe}getTickMethodOptions(){const{domain:t,tickCount:n,base:r}=this.options,i=t[0],o=t[t.length-1];return[i,o,n,r]}chooseTransforms(){const{base:t,domain:n}=this.options,r=n[0]<0;return[zN(t,r),HN(t,r)]}clone(){return new tge(this.options)}},Aee=class nge extends HO{getDefaultOptions(){return{domain:[0,1],range:[.5],nice:!1,tickCount:5,tickMethod:qN}}constructor(t){super(t)}nice(){const{nice:t}=this.options;if(t){const[n,r,i]=this.getTickMethodOptions();this.options.domain=cee(n,r,i)}}getTicks(){const{tickMethod:t}=this.options,[n,r,i]=this.getTickMethodOptions();return t(n,r,i)}getTickMethodOptions(){const{domain:t,tickCount:n}=this.options,r=t[0],i=t[t.length-1];return[r,i,n]}rescale(){this.nice();const{range:t,domain:n}=this.options,[r,i]=n;this.n=t.length-1,this.thresholds=new Array(this.n);for(let o=0;o<this.n;o+=1)this.thresholds[o]=((o+1)*i-(o-this.n)*r)/(this.n+1)}invert(t){const[n,r]=super.invert(t),[i,o]=this.options.domain;return n===void 0&&r===void 0?[n,r]:[n||i,r||o]}getThresholds(){return this.thresholds}clone(){return new nge(this.options)}};function qXe(e,t){const n=e.length;if(!n)return;if(n<2)return e[n-1];const r=(n-1)*t,i=Math.floor(r),o=e[i],a=e[i+1];return o+(a-o)*(r-i)}function GXe(e,t,n=!1){const r=e;n||r.sort((o,a)=>o-a);const i=[];for(let o=1;o<t;o+=1)i.push(qXe(r,o/t));return i}let Lee=class rge extends HO{getDefaultOptions(){return{domain:[],range:[],tickCount:5,unknown:void 0,tickMethod:qN}}constructor(t){super(t)}rescale(){const{domain:t,range:n}=this.options;this.n=n.length-1,this.thresholds=GXe(t,this.n+1,!1)}invert(t){const[n,r]=super.invert(t),{domain:i}=this.options,o=i[0],a=i[i.length-1];return n===void 0&&r===void 0?[n,r]:[n||o,r||a]}getThresholds(){return this.thresholds}clone(){return new rge(this.options)}getTicks(){const{tickCount:t,domain:n,tickMethod:r}=this.options,i=n.length-1,o=n[0],a=n[i];return r(o,a,t)}};var KXe=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,YXe=/\[([^]*?)\]/gm;function jee(e,t){for(var n=[],r=0,i=e.length;r<i;r++)n.push(e[r].substr(0,t));return n}function GN(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o=i[r];for(var a in o)e[a]=o[a]}return e}var Dee=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Fee=["January","February","March","April","May","June","July","August","September","October","November","December"],XXe=jee(Fee,3),ZXe=jee(Dee,3),QXe={dayNamesShort:ZXe,dayNames:Dee,monthNamesShort:XXe,monthNames:Fee,amPm:["am","pm"],DoFn:function(e){return e+["th","st","nd","rd"][e%10>3?0:(e-e%10!==10?1:0)*e%10]}},JXe=GN({},QXe),Sa=function(e,t){for(t===void 0&&(t=2),e=String(e);e.length<t;)e="0"+e;return e},eZe={D:function(e){return String(e.getDate())},DD:function(e){return Sa(e.getDate())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return String(e.getDay())},dd:function(e){return Sa(e.getDay())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return String(e.getMonth()+1)},MM:function(e){return Sa(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},YY:function(e){return Sa(String(e.getFullYear()),4).substr(2)},YYYY:function(e){return Sa(e.getFullYear(),4)},h:function(e){return String(e.getHours()%12||12)},hh:function(e){return Sa(e.getHours()%12||12)},H:function(e){return String(e.getHours())},HH:function(e){return Sa(e.getHours())},m:function(e){return String(e.getMinutes())},mm:function(e){return Sa(e.getMinutes())},s:function(e){return String(e.getSeconds())},ss:function(e){return Sa(e.getSeconds())},S:function(e){return String(Math.round(e.getMilliseconds()/100))},SS:function(e){return Sa(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return Sa(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+Sa(Math.floor(Math.abs(t)/60)*100+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+Sa(Math.floor(Math.abs(t)/60),2)+":"+Sa(Math.abs(t)%60,2)}},Bee={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},tZe=function(e,t,n){if(t===void 0&&(t=Bee.default),n===void 0&&(n={}),typeof e=="number"&&(e=new Date(e)),Object.prototype.toString.call(e)!=="[object Date]"||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");t=Bee[t]||t;var r=[];t=t.replace(YXe,function(o,a){return r.push(a),"@@@"});var i=GN(GN({},JXe),n);return t=t.replace(KXe,function(o){return eZe[o](e,i)}),t.replace(/@@@/g,function(){return r.shift()})};const nZe=(e,t,n,r,i)=>{const o=e>t,a=o?t:e,s=o?e:t,[l,c]=gee(a,s,n,r,i),u=l.range(a,new Date(+s+1),c,!0);return o?u.reverse():u};function rZe(e){const t=e.getTimezoneOffset(),n=new Date(e);return n.setMinutes(n.getMinutes()+t,n.getSeconds(),n.getMilliseconds()),n}let iZe=class ige extends zO{getDefaultOptions(){return{domain:[new Date(2e3,0,1),new Date(2e3,0,2)],range:[0,1],nice:!1,tickCount:5,tickInterval:void 0,unknown:void 0,clamp:!1,tickMethod:nZe,interpolate:Og,mask:void 0,utc:!1}}chooseTransforms(){return[r=>+r,r=>new Date(r)]}chooseNice(){return iXe}getTickMethodOptions(){const{domain:t,tickCount:n,tickInterval:r,utc:i}=this.options,o=t[0],a=t[t.length-1];return[o,a,n,r,i]}getFormatter(){const{mask:t,utc:n}=this.options,r=n?vee:hee,i=n?rZe:uh;return o=>tZe(i(o),t||bXe(o,r))}clone(){return new ige(this.options)}};var oZe=function(e,t,n,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(i<3?a(o):i>3?a(t,n,o):a(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},KN;function aZe(e){return[e(0),e(1)]}const sZe=e=>{const[t,n]=e;return Cg(Og(0,1),LO(t,n))};let YN=KN=class extends $r{getDefaultOptions(){return{domain:[0,1],unknown:void 0,nice:!1,clamp:!1,round:!1,interpolator:uh,tickMethod:yh,tickCount:5}}constructor(t){super(t)}clone(){return new KN(this.options)}};YN=KN=oZe([sXe(aZe,sZe)],YN);function WO(e,t,n){if(e===null)return[-.5,.5];const r=qJ(e,t),o=new Eg({domain:r,range:[0,1],padding:n}).getBandWidth();return[-o/2,o/2]}function VO(e,t,n){return t*(1-e)+n*e}const zee=(e={})=>{const{padding:t=0,paddingX:n=t,paddingY:r=t,random:i=Math.random}=e;return(o,a)=>{const{encode:s,scale:l}=a,{x:c,y:u}=l,[f]=Dn(s,"x"),[d]=Dn(s,"y"),h=WO(f,c,n),p=WO(d,u,r),v=o.map(()=>VO(i(),...p)),g=o.map(()=>VO(i(),...h));return[o,Ue({scale:{x:{padding:.5},y:{padding:.5}}},a,{encode:{dy:Sr(v),dx:Sr(g)}})]}};zee.props={};const Hee=(e={})=>{const{padding:t=0,random:n=Math.random}=e;return(r,i)=>{const{encode:o,scale:a}=i,{x:s}=a,[l]=Dn(o,"x"),c=WO(l,s,t),u=r.map(()=>VO(n(),...c));return[r,Ue({scale:{x:{padding:.5}}},i,{encode:{dx:Sr(u)}})]}};Hee.props={};const Wee=(e={})=>{const{padding:t=0,random:n=Math.random}=e;return(r,i)=>{const{encode:o,scale:a}=i,{y:s}=a,[l]=Dn(o,"y"),c=WO(l,s,t),u=r.map(()=>VO(n(),...c));return[r,Ue({scale:{y:{padding:.5}}},i,{encode:{dy:Sr(u)}})]}};Wee.props={};var lZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Vee=(e={})=>{const{groupBy:t="x"}=e;return(n,r)=>{const{encode:i}=r,o=lZe(i,["x"]),a=Object.entries(o).filter(([f])=>f.startsWith("y")).map(([f])=>[f,Dn(i,f)[0]]),s=a.map(([f])=>[f,new Array(n.length)]),l=_f(t,n,r),c=new Array(l.length);for(let f=0;f<l.length;f++){const h=l[f].flatMap(g=>a.map(([,m])=>+m[g])),[p,v]=Qc(h);c[f]=(p+v)/2}const u=Math.max(...c);for(let f=0;f<l.length;f++){const d=u-c[f],h=l[f];for(const p of h)for(let v=0;v<a.length;v++){const[,g]=a[v],[,m]=s[v];m[p]=+g[p]+d}}return[n,Ue({},r,{encode:Object.fromEntries(s.map(([f,d])=>[f,Sr(d,Dn(i,f)[1])]))})]}};Vee.props={};const Uee=(e={})=>{const{groupBy:t="x",series:n=!0}=e;return(r,i)=>{const{encode:o}=i,[a]=Dn(o,"y"),[s,l]=Dn(o,"y1");n?T1(o,"series","color"):Dn(o,"color");const c=_f(t,r,i),u=new Array(r.length);for(const f of c){const d=f.map(h=>+a[h]);for(let h=0;h<f.length;h++){const p=f[h],v=Math.max(...d.filter((g,m)=>m!==h));u[p]=+a[p]>v?v:a[p]}}return[r,Ue({},i,{encode:{y1:Sr(u,l)}})]}};Uee.props={};function qee(e,t){return[e[0]]}function cZe(e,t){const n=e.length-1;return[e[n]]}function uZe(e,t){const n=bg(e,r=>t[r]);return[e[n]]}function fZe(e,t){const n=A1(e,r=>t[r]);return[e[n]]}function dZe(e){return typeof e=="function"?e:{first:qee,last:cZe,max:uZe,min:fZe}[e]||qee}const UO=(e={})=>{const{groupBy:t="series",channel:n,selector:r}=e;return(i,o)=>{const{encode:a}=o,s=_f(t,i,o),[l]=Dn(a,n),c=dZe(r);return[s.flatMap(u=>c(u,l)),o]}};UO.props={};var hZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Gee=(e={})=>{const{selector:t}=e,n=hZe(e,["selector"]);return UO(Object.assign({channel:"x",selector:t},n))};Gee.props={};var pZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Kee=(e={})=>{const{selector:t}=e,n=pZe(e,["selector"]);return UO(Object.assign({channel:"y",selector:t},n))};Kee.props={};var vZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function Pf(e){return t=>t===null?e:`${e} of ${t}`}function gZe(e){if(typeof e=="function")return[e,null];const n={mean:mZe,max:bZe,count:SZe,first:CZe,last:OZe,sum:wZe,min:xZe,median:yZe}[e];if(!n)throw new Error(`Unknown reducer: ${e}.`);return n()}function mZe(){const e=(n,r)=>j1(n,i=>+r[i]),t=Pf("mean");return[e,t]}function yZe(){const e=(n,r)=>TN(n,i=>+r[i]),t=Pf("median");return[e,t]}function bZe(){const e=(n,r)=>tr(n,i=>+r[i]),t=Pf("max");return[e,t]}function xZe(){const e=(n,r)=>Za(n,i=>+r[i]),t=Pf("min");return[e,t]}function SZe(){const e=(n,r)=>n.length,t=Pf("count");return[e,t]}function wZe(){const e=(n,r)=>Os(n,i=>+r[i]),t=Pf("sum");return[e,t]}function CZe(){const e=(n,r)=>r[n[0]],t=Pf("first");return[e,t]}function OZe(){const e=(n,r)=>r[n[n.length-1]],t=Pf("last");return[e,t]}const XN=(e={})=>{const{groupBy:t}=e,n=vZe(e,["groupBy"]);return(r,i)=>{const{data:o,encode:a}=i,s=t(r,i);if(!s)return[r,i];const l=(h,p)=>{if(h)return h;const{from:v}=p;if(!v)return h;const[,g]=Dn(a,v);return g},c=Object.entries(n).map(([h,p])=>{const[v,g]=gZe(p),[m,y]=Dn(a,h),x=l(y,p),S=s.map(w=>v(w,m!=null?m:o));return[h,Object.assign(Object.assign({},KKe(S,(g==null?void 0:g(x))||x)),{aggregate:!0})]}),u=Object.keys(a).map(h=>{const[p,v]=Dn(a,h),g=s.map(m=>p[m[0]]);return[h,Sr(g,v)]}),f=s.map(h=>o[h[0]]);return[vh(s),Ue({},i,{data:f,encode:Object.fromEntries([...u,...c])})]}};XN.props={};var EZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Y1=(e={})=>{const{channels:t=["x","y"]}=e,n=EZe(e,["channels"]),r=(i,o)=>_f(t,i,o);return XN(Object.assign(Object.assign({},n),{groupBy:r}))};Y1.props={};const Yee=(e={})=>Y1(Object.assign(Object.assign({},e),{channels:["x","color","series"]}));Yee.props={};const Xee=(e={})=>Y1(Object.assign(Object.assign({},e),{channels:["y","color","series"]}));Xee.props={};const Zee=(e={})=>Y1(Object.assign(Object.assign({},e),{channels:["color"]}));Zee.props={};var Qee=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function _Ze(e,t,n){const{by:r=e,reducer:i="max"}=t,[o]=Dn(n,r);if(typeof i=="function")return a=>i(a,o);if(i==="max")return a=>tr(a,s=>+o[s]);if(i==="min")return a=>Za(a,s=>+o[s]);if(i==="sum")return a=>Os(a,s=>+o[s]);if(i==="median")return a=>TN(a,s=>+o[s]);if(i==="mean")return a=>j1(a,s=>+o[s]);if(i==="first")return a=>o[a[0]];if(i==="last")return a=>o[a[a.length-1]];throw new Error(`Unknown reducer: ${i}`)}function $Ze(e,t,n){const{reverse:r,channel:i}=n,{encode:o}=t,[a]=Dn(o,i),s=ml(e,l=>a[l]);return r&&s.reverse(),[s,t]}function PZe(e,t,n){if(!Array.isArray(n))return e;const r=new Set(n);return e.filter(i=>r.has(t[i]))}function MZe(e,t,n){var r;const{reverse:i,slice:o,channel:a}=n,s=Qee(n,["reverse","slice","channel"]),{encode:l,scale:c={}}=t,u=(r=c[a])===null||r===void 0?void 0:r.domain,[f]=Dn(l,a),d=_Ze(a,s,l),h=PZe(e,f,u),p=sYe(h,d,m=>f[m]);i&&p.reverse();const v=typeof o=="number"?[0,o]:o,g=o?p.slice(...v):p;return[e,Ue(t,{scale:{[a]:{domain:g}}})]}const qO=(e={})=>{const{reverse:t=!1,slice:n,channel:r,ordinal:i=!0}=e,o=Qee(e,["reverse","slice","channel","ordinal"]);return(a,s)=>i?MZe(a,s,Object.assign({reverse:t,slice:n,channel:r},o)):$Ze(a,s,Object.assign({reverse:t,slice:n,channel:r},o))};qO.props={};const Jee=(e={})=>qO(Object.assign(Object.assign({},e),{channel:"x"}));Jee.props={};const ete=(e={})=>qO(Object.assign(Object.assign({},e),{channel:"color"}));ete.props={};const tte=(e={})=>qO(Object.assign(Object.assign({},e),{channel:"y"}));tte.props={};function TZe(e,t){return typeof t=="string"?e.map(n=>n[t]):e.map(t)}function IZe(e,t){if(typeof e=="function")return n=>e(n,t);if(e==="sum")return n=>Os(n,r=>+t[r]);throw new Error(`Unknown reducer: ${e}`)}const nte=(e={})=>{const{field:t,channel:n="y",reducer:r="sum"}=e;return(i,o)=>{const{data:a,encode:s}=o,[l]=Dn(s,"x"),c=t?TZe(a,t):Dn(s,n)[0],u=IZe(r,c),f=_N(i,u,d=>l[d]).map(d=>d[1]);return[i,Ue({},o,{scale:{x:{flex:f}}})]}};nte.props={};function li([e,t],[n,r]){return[e-n,t-r]}function GO([e,t],[n,r]){return[e+n,t+r]}function Zr([e,t],[n,r]){return Math.sqrt(Math.pow(e-n,2)+Math.pow(t-r,2))}function Es([e,t]){return Math.atan2(t,e)}function _g([e,t]){return Es([e,t])+Math.PI/2}function rte(e,t){const n=Es(e),r=Es(t);return n<r?r-n:Math.PI*2-(n-r)}function ZN(e){let t=1/0,n=-1/0,r=1/0,i=-1/0;for(const[s,l]of e)t=Math.min(s,t),n=Math.max(s,n),r=Math.min(l,r),i=Math.max(l,i);const o=n-t,a=i-r;return[t,r,o,a]}function ite([e,t],[n,r]){return[(e+n)/2,(t+r)/2]}function RZe(e){const{padding:t=0,direction:n="col"}=e;return(r,i,o)=>{const a=r.length;if(a===0)return[];const{innerWidth:s,innerHeight:l}=o,c=l/s;let u=Math.ceil(Math.sqrt(i/c)),f=s/u,d=Math.ceil(i/u),h=d*f;for(;h>l;)u=u+1,f=s/u,d=Math.ceil(i/u),h=d*f;const p=l-d*f,v=d<=1?0:p/(d-1),[g,m]=d<=1?[(s-a*f)/(a-1),(l-f)/2]:[0,0];return r.map((y,x)=>{const[S,w,C,O]=ZN(y),E=n==="col"?x%u:Math.floor(x/d),_=n==="col"?Math.floor(x/u):x%d,$=E*f,P=(d-_-1)*f+p,T=(f-t)/C,I=(f-t)/O,M=$-S+g*E+1/2*t,R=P-w-v*_-m+1/2*t;return`translate(${M}, ${R}) scale(${T}, ${I})`})}}const ote=e=>(t,n)=>[t,Ue({},n,{modifier:RZe(e),axis:!1})];ote.props={};var NZe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const ate="thresholds";function kZe(e){const[t,n]=Qc(e);return Math.min(200,bYe(e,t,n))}const QN=(e={})=>{const{groupChannels:t=["color"],binChannels:n=["x","y"]}=e,r=NZe(e,["groupChannels","binChannels"]),i={},o=(a,s)=>{const{encode:l}=s,c=n.map(p=>{const[v]=Dn(l,p);return v}),u=bt(r,ate),f=a.filter(p=>c.every(v=>wr(v[p]))),d=[...t.map(p=>{const[v]=Dn(l,p);return v}).filter(wr).map(p=>v=>p[v]),...n.map((p,v)=>{const g=c[v],m=u[p]||kZe(g),y=gYe().thresholds(m).value(S=>+g[S])(f),x=new Map(y.flatMap(S=>{const{x0:w,x1:C}=S,O=`${w},${C}`;return S.map(E=>[E,O])}));return i[p]=x,S=>x.get(S)})],h=p=>d.map(v=>v(p)).join("-");return Array.from(Rr(f,h).values())};return XN(Object.assign(Object.assign(Object.assign({},Object.fromEntries(Object.entries(r).filter(([a])=>!a.startsWith(ate)))),Object.fromEntries(n.flatMap(a=>{const s=([c])=>+i[a].get(c).split(",")[0],l=([c])=>+i[a].get(c).split(",")[1];return l.from=a,[[a,s],[`${a}1`,l]]}))),{groupBy:o}))};QN.props={};const ste=(e={})=>{const{thresholds:t}=e;return QN(Object.assign(Object.assign({},e),{thresholdsX:t,groupChannels:["color"],binChannels:["x"]}))};ste.props={};function AZe(e,t,n,r){const i=e.length;if(r>=i||r===0)return e;const o=h=>t[e[h]]*1,a=h=>n[e[h]]*1,s=[],l=(i-2)/(r-2);let c=0,u,f,d;s.push(c);for(let h=0;h<r-2;h++){let p=0,v=0,g=Math.floor((h+1)*l)+1,m=Math.floor((h+2)*l)+1;m=Math.min(m,i);const y=m-g;for(;g<m;g++)p+=o(g),v+=a(g);p/=y,v/=y;let x=Math.floor((h+0)*l)+1;const S=Math.floor((h+1)*l)+1,w=[o(c),a(c)];for(u=f=-1;x<S;x++)f=Math.abs((w[0]-p)*(o(x)-w[1])-(w[0]-a(x))*(v-w[0]))*.5,f>u&&(u=f,d=x);s.push(d),c=d}return s.push(i-1),s.map(h=>e[h])}function LZe(e){if(typeof e=="function")return e;if(e==="lttb")return AZe;const t={first:r=>[r[0]],last:r=>[r[r.length-1]],min:(r,i,o)=>[r[A1(r,a=>o[a])]],max:(r,i,o)=>[r[bg(r,a=>o[a])]],median:(r,i,o)=>[r[xYe(r,a=>o[a])]]},n=t[e]||t.median;return(r,i,o,a)=>{const s=Math.max(1,Math.floor(r.length/a));return jZe(r,s).flatMap(c=>n(c,i,o))}}function jZe(e,t){const n=e.length,r=[];let i=0;for(;i<n;)r.push(e.slice(i,i+=t));return r}const lte=(e={})=>{const{strategy:t="median",thresholds:n=2e3,groupBy:r=["series","color"]}=e,i=LZe(t);return(o,a)=>{const{encode:s}=a,l=_f(r,o,a),[c]=Dn(s,"x"),[u]=Dn(s,"y");return[l.flatMap(f=>i(f,c,u,n)),a]}};lte.props={};function DZe(e){return typeof e=="object"?[e.value,e.ordinal]:[e,!0]}function FZe(e){var t;const{encode:n}=e,r=Object.assign(Object.assign({},e),{encode:Object.assign(Object.assign({},e.encode),{y:Object.assign(Object.assign({},e.encode.y),{value:[]})})}),i=(t=n==null?void 0:n.color)===null||t===void 0?void 0:t.field;if(!n||!i)return r;let o;for(const[a,s]of Object.entries(n))(a==="x"||a==="y")&&s.field===i&&(o=Object.assign(Object.assign({},o),{[a]:Object.assign(Object.assign({},s),{value:[]})}));return o?Object.assign(Object.assign({},e),{encode:Object.assign(Object.assign({},e.encode),o)}):r}const cte=(e={})=>(t,n)=>{const{encode:r,data:i}=n,o=Object.entries(e).map(([u,f])=>{const[d]=Dn(r,u);if(!d)return null;const[h,p=!0]=DZe(f);if(typeof h=="function")return v=>h(d[v]);if(p){const v=Array.isArray(h)?h:[h];return v.length===0?null:g=>v.includes(d[g])}else{const[v,g]=h;return m=>d[m]>=v&&d[m]<=g}}).filter(wr),a=u=>o.every(f=>f(u)),s=t.filter(a),l=s.map((u,f)=>f);if(o.length===0){const u=FZe(n);return[t,u]}const c=Object.entries(r).map(([u,f])=>[u,Object.assign(Object.assign({},f),{value:l.map(d=>f.value[s[d]]).filter(d=>d!==void 0)})]);return[l,Ue({},n,{encode:Object.fromEntries(c),data:s.map(u=>i[u])})]};cte.props={};function Nr(e){return function(){return e}}const ute=Math.abs,Bo=Math.atan2,bh=Math.cos,BZe=Math.max,JN=Math.min,Ul=Math.sin,$g=Math.sqrt,zo=1e-12,X1=Math.PI,KO=X1/2,zZe=2*X1;function HZe(e){return e>1?0:e<-1?X1:Math.acos(e)}function fte(e){return e>=1?KO:e<=-1?-KO:Math.asin(e)}const ek=Math.PI,tk=2*ek,xh=1e-6,WZe=tk-xh;function dte(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}function VZe(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return dte;const n=Ji(10,t);return function(r){this._+=r[0];for(let i=1,o=r.length;i<o;++i)this._+=Math.round(arguments[i]*n)/n+r[i]}}let nk=class{constructor(t){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=t==null?dte:VZe(t)}moveTo(t,n){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(t,n){this._append`L${this._x1=+t},${this._y1=+n}`}quadraticCurveTo(t,n,r,i){this._append`Q${+t},${+n},${this._x1=+r},${this._y1=+i}`}bezierCurveTo(t,n,r,i,o,a){this._append`C${+t},${+n},${+r},${+i},${this._x1=+o},${this._y1=+a}`}arcTo(t,n,r,i,o){if(t=+t,n=+n,r=+r,i=+i,o=+o,o<0)throw new Error(`negative radius: ${o}`);let a=this._x1,s=this._y1,l=r-t,c=i-n,u=a-t,f=s-n,d=u*u+f*f;if(this._x1===null)this._append`M${this._x1=t},${this._y1=n}`;else if(d>xh)if(!(Math.abs(f*l-c*u)>xh)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-a,p=i-s,v=l*l+c*c,g=h*h+p*p,m=Math.sqrt(v),y=Math.sqrt(d),x=o*Math.tan((ek-Math.acos((v+d-g)/(2*m*y)))/2),S=x/y,w=x/m;Math.abs(S-1)>xh&&this._append`L${t+S*u},${n+S*f}`,this._append`A${o},${o},0,0,${+(f*h>u*p)},${this._x1=t+w*l},${this._y1=n+w*c}`}}arc(t,n,r,i,o,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(i),l=r*Math.sin(i),c=t+s,u=n+l,f=1^a,d=a?i-o:o-i;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>xh||Math.abs(this._y1-u)>xh)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%tk+tk),d>WZe?this._append`A${r},${r},0,1,${f},${t-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>xh&&this._append`A${r},${r},0,${+(d>=ek)},${f},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+i}h${-r}Z`}toString(){return this._}};function _s(){return new nk}_s.prototype=nk.prototype;function rk(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new nk(t)}function UZe(e){return e.innerRadius}function qZe(e){return e.outerRadius}function GZe(e){return e.startAngle}function KZe(e){return e.endAngle}function YZe(e){return e&&e.padAngle}function XZe(e,t,n,r,i,o,a,s){var l=n-e,c=r-t,u=a-i,f=s-o,d=f*l-u*c;if(!(d*d<zo))return d=(u*(t-o)-f*(e-i))/d,[e+d*l,t+d*c]}function YO(e,t,n,r,i,o,a){var s=e-n,l=t-r,c=(a?o:-o)/$g(s*s+l*l),u=c*l,f=-c*s,d=e+u,h=t+f,p=n+u,v=r+f,g=(d+p)/2,m=(h+v)/2,y=p-d,x=v-h,S=y*y+x*x,w=i-o,C=d*v-p*h,O=(x<0?-1:1)*$g(BZe(0,w*w*S-C*C)),E=(C*x-y*O)/S,_=(-C*y-x*O)/S,$=(C*x+y*O)/S,P=(-C*y+x*O)/S,T=E-g,I=_-m,M=$-g,R=P-m;return T*T+I*I>M*M+R*R&&(E=$,_=P),{cx:E,cy:_,x01:-u,y01:-f,x11:E*(i/w-1),y11:_*(i/w-1)}}function XO(){var e=UZe,t=qZe,n=Nr(0),r=null,i=GZe,o=KZe,a=YZe,s=null,l=rk(c);function c(){var u,f,d=+e.apply(this,arguments),h=+t.apply(this,arguments),p=i.apply(this,arguments)-KO,v=o.apply(this,arguments)-KO,g=ute(v-p),m=v>p;if(s||(s=u=l()),h<d&&(f=h,h=d,d=f),!(h>zo))s.moveTo(0,0);else if(g>zZe-zo)s.moveTo(h*bh(p),h*Ul(p)),s.arc(0,0,h,p,v,!m),d>zo&&(s.moveTo(d*bh(v),d*Ul(v)),s.arc(0,0,d,v,p,m));else{var y=p,x=v,S=p,w=v,C=g,O=g,E=a.apply(this,arguments)/2,_=E>zo&&(r?+r.apply(this,arguments):$g(d*d+h*h)),$=JN(ute(h-d)/2,+n.apply(this,arguments)),P=$,T=$,I,M;if(_>zo){var R=fte(_/d*Ul(E)),N=fte(_/h*Ul(E));(C-=R*2)>zo?(R*=m?1:-1,S+=R,w-=R):(C=0,S=w=(p+v)/2),(O-=N*2)>zo?(N*=m?1:-1,y+=N,x-=N):(O=0,y=x=(p+v)/2)}var k=h*bh(y),A=h*Ul(y),j=d*bh(w),D=d*Ul(w);if($>zo){var L=h*bh(x),F=h*Ul(x),B=d*bh(S),H=d*Ul(S),z;if(g<X1)if(z=XZe(k,A,B,H,L,F,j,D)){var W=k-z[0],V=A-z[1],U=L-z[0],G=F-z[1],q=1/Ul(HZe((W*U+V*G)/($g(W*W+V*V)*$g(U*U+G*G)))/2),K=$g(z[0]*z[0]+z[1]*z[1]);P=JN($,(d-K)/(q-1)),T=JN($,(h-K)/(q+1))}else P=T=0}O>zo?T>zo?(I=YO(B,H,k,A,h,T,m),M=YO(L,F,j,D,h,T,m),s.moveTo(I.cx+I.x01,I.cy+I.y01),T<$?s.arc(I.cx,I.cy,T,Bo(I.y01,I.x01),Bo(M.y01,M.x01),!m):(s.arc(I.cx,I.cy,T,Bo(I.y01,I.x01),Bo(I.y11,I.x11),!m),s.arc(0,0,h,Bo(I.cy+I.y11,I.cx+I.x11),Bo(M.cy+M.y11,M.cx+M.x11),!m),s.arc(M.cx,M.cy,T,Bo(M.y11,M.x11),Bo(M.y01,M.x01),!m))):(s.moveTo(k,A),s.arc(0,0,h,y,x,!m)):s.moveTo(k,A),!(d>zo)||!(C>zo)?s.lineTo(j,D):P>zo?(I=YO(j,D,L,F,d,-P,m),M=YO(k,A,B,H,d,-P,m),s.lineTo(I.cx+I.x01,I.cy+I.y01),P<$?s.arc(I.cx,I.cy,P,Bo(I.y01,I.x01),Bo(M.y01,M.x01),!m):(s.arc(I.cx,I.cy,P,Bo(I.y01,I.x01),Bo(I.y11,I.x11),!m),s.arc(0,0,d,Bo(I.cy+I.y11,I.cx+I.x11),Bo(M.cy+M.y11,M.cx+M.x11),m),s.arc(M.cx,M.cy,P,Bo(M.y11,M.x11),Bo(M.y01,M.x01),!m))):s.arc(0,0,d,w,S,m)}if(s.closePath(),u)return s=null,u+""||null}return c.centroid=function(){var u=(+e.apply(this,arguments)+ +t.apply(this,arguments))/2,f=(+i.apply(this,arguments)+ +o.apply(this,arguments))/2-X1/2;return[bh(f)*u,Ul(f)*u]},c.innerRadius=function(u){return arguments.length?(e=typeof u=="function"?u:Nr(+u),c):e},c.outerRadius=function(u){return arguments.length?(t=typeof u=="function"?u:Nr(+u),c):t},c.cornerRadius=function(u){return arguments.length?(n=typeof u=="function"?u:Nr(+u),c):n},c.padRadius=function(u){return arguments.length?(r=u==null?null:typeof u=="function"?u:Nr(+u),c):r},c.startAngle=function(u){return arguments.length?(i=typeof u=="function"?u:Nr(+u),c):i},c.endAngle=function(u){return arguments.length?(o=typeof u=="function"?u:Nr(+u),c):o},c.padAngle=function(u){return arguments.length?(a=typeof u=="function"?u:Nr(+u),c):a},c.context=function(u){return arguments.length?(s=u==null?null:u,c):s},c}function hte(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function pte(e){this._context=e}pte.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(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Z1(e){return new pte(e)}function vte(e){return e[0]}function gte(e){return e[1]}function Sh(e,t){var n=Nr(!0),r=null,i=Z1,o=null,a=rk(s);e=typeof e=="function"?e:e===void 0?vte:Nr(e),t=typeof t=="function"?t:t===void 0?gte:Nr(t);function s(l){var c,u=(l=hte(l)).length,f,d=!1,h;for(r==null&&(o=i(h=a())),c=0;c<=u;++c)!(c<u&&n(f=l[c],c,l))===d&&((d=!d)?o.lineStart():o.lineEnd()),d&&o.point(+e(f,c,l),+t(f,c,l));if(h)return o=null,h+""||null}return s.x=function(l){return arguments.length?(e=typeof l=="function"?l:Nr(+l),s):e},s.y=function(l){return arguments.length?(t=typeof l=="function"?l:Nr(+l),s):t},s.defined=function(l){return arguments.length?(n=typeof l=="function"?l:Nr(!!l),s):n},s.curve=function(l){return arguments.length?(i=l,r!=null&&(o=i(r)),s):i},s.context=function(l){return arguments.length?(l==null?r=o=null:o=i(r=l),s):r},s}function ik(e,t,n){var r=null,i=Nr(!0),o=null,a=Z1,s=null,l=rk(c);e=typeof e=="function"?e:e===void 0?vte:Nr(+e),t=typeof t=="function"?t:Nr(t===void 0?0:+t),n=typeof n=="function"?n:n===void 0?gte:Nr(+n);function c(f){var d,h,p,v=(f=hte(f)).length,g,m=!1,y,x=new Array(v),S=new Array(v);for(o==null&&(s=a(y=l())),d=0;d<=v;++d){if(!(d<v&&i(g=f[d],d,f))===m)if(m=!m)h=d,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),p=d-1;p>=h;--p)s.point(x[p],S[p]);s.lineEnd(),s.areaEnd()}m&&(x[d]=+e(g,d,f),S[d]=+t(g,d,f),s.point(r?+r(g,d,f):x[d],n?+n(g,d,f):S[d]))}if(y)return s=null,y+""||null}function u(){return Sh().defined(i).curve(a).context(o)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:Nr(+f),r=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Nr(+f),c):e},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Nr(+f),c):r},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:Nr(+f),n=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Nr(+f),c):t},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Nr(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Nr(!!f),c):i},c.curve=function(f){return arguments.length?(a=f,o!=null&&(s=a(o)),c):a},c.context=function(f){return arguments.length?(f==null?o=s=null:s=a(o=f),c):o},c}var mte=ok(Z1);function yte(e){this._curve=e}yte.prototype={areaStart:function(){this._curve.areaStart()},areaEnd:function(){this._curve.areaEnd()},lineStart:function(){this._curve.lineStart()},lineEnd:function(){this._curve.lineEnd()},point:function(e,t){this._curve.point(t*Math.sin(e),t*-Math.cos(e))}};function ok(e){function t(n){return new yte(e(n))}return t._curve=e,t}function Q1(e){var t=e.curve;return e.angle=e.x,delete e.x,e.radius=e.y,delete e.y,e.curve=function(n){return arguments.length?t(ok(n)):t()._curve},e}function ZZe(){return Q1(Sh().curve(mte))}function QZe(){var e=ik().curve(mte),t=e.curve,n=e.lineX0,r=e.lineX1,i=e.lineY0,o=e.lineY1;return e.angle=e.x,delete e.x,e.startAngle=e.x0,delete e.x0,e.endAngle=e.x1,delete e.x1,e.radius=e.y,delete e.y,e.innerRadius=e.y0,delete e.y0,e.outerRadius=e.y1,delete e.y1,e.lineStartAngle=function(){return Q1(n())},delete e.lineX0,e.lineEndAngle=function(){return Q1(r())},delete e.lineX1,e.lineInnerRadius=function(){return Q1(i())},delete e.lineY0,e.lineOuterRadius=function(){return Q1(o())},delete e.lineY1,e.curve=function(a){return arguments.length?t(ok(a)):t()._curve},e}function Pg(){}function ak(e,t,n){e._context.bezierCurveTo(e._x1+e._k*(e._x2-e._x0),e._y1+e._k*(e._y2-e._y0),e._x2+e._k*(e._x1-t),e._y2+e._k*(e._y1-n),e._x2,e._y2)}function sk(e,t){this._context=e,this._k=(1-t)/6}sk.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:ak(this,this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2,this._x1=e,this._y1=t;break;case 2:this._point=3;default:ak(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function n(r){return new sk(r,t)}return n.tension=function(r){return e(+r)},n}(0);function lk(e,t){this._context=e,this._k=(1-t)/6}lk.prototype={areaStart:Pg,areaEnd:Pg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:ak(this,e,t);break}this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function n(r){return new lk(r,t)}return n.tension=function(r){return e(+r)},n}(0);function bte(e,t,n){var r=e._x1,i=e._y1,o=e._x2,a=e._y2;if(e._l01_a>zo){var s=2*e._l01_2a+3*e._l01_a*e._l12_a+e._l12_2a,l=3*e._l01_a*(e._l01_a+e._l12_a);r=(r*s-e._x0*e._l12_2a+e._x2*e._l01_2a)/l,i=(i*s-e._y0*e._l12_2a+e._y2*e._l01_2a)/l}if(e._l23_a>zo){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,u=3*e._l23_a*(e._l23_a+e._l12_a);o=(o*c+e._x1*e._l23_2a-t*e._l12_2a)/u,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/u}e._context.bezierCurveTo(r,i,o,a,e._x2,e._y2)}function xte(e,t){this._context=e,this._alpha=t}xte.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(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3;default:bte(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}},function e(t){function n(r){return t?new xte(r,t):new sk(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Ste(e,t){this._context=e,this._alpha=t}Ste.prototype={areaStart:Pg,areaEnd:Pg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=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 1:{this._context.moveTo(this._x3,this._y3),this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3),this._context.closePath();break}case 3:{this.point(this._x3,this._y3),this.point(this._x4,this._y4),this.point(this._x5,this._y5);break}}},point:function(e,t){if(e=+e,t=+t,this._point){var n=this._x2-e,r=this._y2-t;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(n*n+r*r,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=t;break;case 1:this._point=2,this._context.moveTo(this._x4=e,this._y4=t);break;case 2:this._point=3,this._x5=e,this._y5=t;break;default:bte(this,e,t);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=e,this._y0=this._y1,this._y1=this._y2,this._y2=t}};const wte=function e(t){function n(r){return t?new Ste(r,t):new lk(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function Cte(e){this._context=e}Cte.prototype={areaStart:Pg,areaEnd:Pg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function ck(e){return new Cte(e)}function Ote(e){return e<0?-1:1}function Ete(e,t,n){var r=e._x1-e._x0,i=t-e._x1,o=(e._y1-e._y0)/(r||i<0&&-0),a=(n-e._y1)/(i||r<0&&-0),s=(o*i+a*r)/(r+i);return(Ote(o)+Ote(a))*Math.min(Math.abs(o),Math.abs(a),.5*Math.abs(s))||0}function _te(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function uk(e,t,n){var r=e._x0,i=e._y0,o=e._x1,a=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,i+s*t,o-s,a-s*n,o,a)}function ZO(e){this._context=e}ZO.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:uk(this,this._t0,_te(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,uk(this,_te(this,n=Ete(this,e,t)),n);break;default:uk(this,this._t0,n=Ete(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function $te(e){this._context=new Pte(e)}($te.prototype=Object.create(ZO.prototype)).point=function(e,t){ZO.prototype.point.call(this,t,e)};function Pte(e){this._context=e}Pte.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,i,o){this._context.bezierCurveTo(t,e,r,n,o,i)}};function Mte(e){return new ZO(e)}function Tte(e){return new $te(e)}function QO(e,t){this._context=e,this._t=t}QO.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function Ite(e){return new QO(e,.5)}function Rte(e){return new QO(e,0)}function Nte(e){return new QO(e,1)}function kr(e){const{transformations:t}=e.getOptions();return t.map(([r])=>r).filter(r=>r==="transpose").length%2!==0}function hr(e){const{transformations:t}=e.getOptions();return t.some(([n])=>n==="polar")}function JO(e){const{transformations:t}=e.getOptions();return t.some(([n])=>n==="reflect")&&t.some(([n])=>n.startsWith("transpose"))}function kte(e){const{transformations:t}=e.getOptions();return t.some(([n])=>n==="helix")}function eE(e){const{transformations:t}=e.getOptions();return t.some(([n])=>n==="parallel")}function Ate(e){const{transformations:t}=e.getOptions();return t.some(([n])=>n==="fisheye")}function JZe(e){return eE(e)&&hr(e)}function Mg(e){return kte(e)||hr(e)}function eQe(e){return hr(e)&&kr(e)}function tQe(e){if(Mg(e)){const[t,n]=e.getSize(),r=e.getOptions().transformations.find(i=>i[0]==="polar");if(r)return Math.max(t,n)/2*r[4]}return 0}function tE(e){const{transformations:t}=e.getOptions(),[,,,n,r]=t.find(i=>i[0]==="polar");return[+n,+r]}function fk(e,t=!0){const{transformations:n}=e.getOptions(),[,r,i]=n.find(o=>o[0]==="polar");return t?[+r*180/Math.PI,+i*180/Math.PI]:[r,i]}function nQe(e,t){const{transformations:n}=e.getOptions(),[,...r]=n.find(i=>i[0]===t);return r}var Lte={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,f,d){if(typeof u!="function")throw new TypeError("The listener must be a function");var h=new i(u,f||l,d),p=n?n+c:c;return l._events[p]?l._events[p].fn?l._events[p]=[l._events[p],h]:l._events[p].push(h):(l._events[p]=h,l._eventsCount++),l}function a(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function s(){this._events=new r,this._eventsCount=0}s.prototype.eventNames=function(){var c=[],u,f;if(this._eventsCount===0)return c;for(f in u=this._events)t.call(u,f)&&c.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},s.prototype.listeners=function(c){var u=n?n+c:c,f=this._events[u];if(!f)return[];if(f.fn)return[f.fn];for(var d=0,h=f.length,p=new Array(h);d<h;d++)p[d]=f[d].fn;return p},s.prototype.listenerCount=function(c){var u=n?n+c:c,f=this._events[u];return f?f.fn?1:f.length:0},s.prototype.emit=function(c,u,f,d,h,p){var v=n?n+c:c;if(!this._events[v])return!1;var g=this._events[v],m=arguments.length,y,x;if(g.fn){switch(g.once&&this.removeListener(c,g.fn,void 0,!0),m){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,u),!0;case 3:return g.fn.call(g.context,u,f),!0;case 4:return g.fn.call(g.context,u,f,d),!0;case 5:return g.fn.call(g.context,u,f,d,h),!0;case 6:return g.fn.call(g.context,u,f,d,h,p),!0}for(x=1,y=new Array(m-1);x<m;x++)y[x-1]=arguments[x];g.fn.apply(g.context,y)}else{var S=g.length,w;for(x=0;x<S;x++)switch(g[x].once&&this.removeListener(c,g[x].fn,void 0,!0),m){case 1:g[x].fn.call(g[x].context);break;case 2:g[x].fn.call(g[x].context,u);break;case 3:g[x].fn.call(g[x].context,u,f);break;case 4:g[x].fn.call(g[x].context,u,f,d);break;default:if(!y)for(w=1,y=new Array(m-1);w<m;w++)y[w-1]=arguments[w];g[x].fn.apply(g[x].context,y)}}return!0},s.prototype.on=function(c,u,f){return o(this,c,u,f,!1)},s.prototype.once=function(c,u,f){return o(this,c,u,f,!0)},s.prototype.removeListener=function(c,u,f,d){var h=n?n+c:c;if(!this._events[h])return this;if(!u)return a(this,h),this;var p=this._events[h];if(p.fn)p.fn===u&&(!d||p.once)&&(!f||p.context===f)&&a(this,h);else{for(var v=0,g=[],m=p.length;v<m;v++)(p[v].fn!==u||d&&!p[v].once||f&&p[v].context!==f)&&g.push(p[v]);g.length?this._events[h]=g.length===1?g[0]:g:a(this,h)}return this},s.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&a(this,u)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s})(Lte);var rQe=Lte.exports;const dk=Rt(rQe);function nE(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function hk(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Tg(){}var wh=.7,Ig=1/wh,Rg="\\s*([+-]?\\d+)\\s*",J1="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ql="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",iQe=/^#([0-9a-f]{3,8})$/,oQe=new RegExp(`^rgb\\(${Rg},${Rg},${Rg}\\)$`),aQe=new RegExp(`^rgb\\(${ql},${ql},${ql}\\)$`),sQe=new RegExp(`^rgba\\(${Rg},${Rg},${Rg},${J1}\\)$`),lQe=new RegExp(`^rgba\\(${ql},${ql},${ql},${J1}\\)$`),cQe=new RegExp(`^hsl\\(${J1},${ql},${ql}\\)$`),uQe=new RegExp(`^hsla\\(${J1},${ql},${ql},${J1}\\)$`),jte={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};nE(Tg,rE,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Dte,formatHex:Dte,formatHex8:fQe,formatHsl:dQe,formatRgb:Fte,toString:Fte});function Dte(){return this.rgb().formatHex()}function fQe(){return this.rgb().formatHex8()}function dQe(){return Ute(this).formatHsl()}function Fte(){return this.rgb().formatRgb()}function rE(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=iQe.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Bte(t):n===3?new Ho(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?iE(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?iE(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=oQe.exec(e))?new Ho(t[1],t[2],t[3],1):(t=aQe.exec(e))?new Ho(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=sQe.exec(e))?iE(t[1],t[2],t[3],t[4]):(t=lQe.exec(e))?iE(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=cQe.exec(e))?Vte(t[1],t[2]/100,t[3]/100,1):(t=uQe.exec(e))?Vte(t[1],t[2]/100,t[3]/100,t[4]):jte.hasOwnProperty(e)?Bte(jte[e]):e==="transparent"?new Ho(NaN,NaN,NaN,0):null}function Bte(e){return new Ho(e>>16&255,e>>8&255,e&255,1)}function iE(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ho(e,t,n,r)}function zte(e){return e instanceof Tg||(e=rE(e)),e?(e=e.rgb(),new Ho(e.r,e.g,e.b,e.opacity)):new Ho}function eb(e,t,n,r){return arguments.length===1?zte(e):new Ho(e,t,n,r==null?1:r)}function Ho(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}nE(Ho,eb,hk(Tg,{brighter(e){return e=e==null?Ig:Math.pow(Ig,e),new Ho(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?wh:Math.pow(wh,e),new Ho(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ho(Ch(this.r),Ch(this.g),Ch(this.b),oE(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:Hte,formatHex:Hte,formatHex8:hQe,formatRgb:Wte,toString:Wte}));function Hte(){return`#${Oh(this.r)}${Oh(this.g)}${Oh(this.b)}`}function hQe(){return`#${Oh(this.r)}${Oh(this.g)}${Oh(this.b)}${Oh((isNaN(this.opacity)?1:this.opacity)*255)}`}function Wte(){const e=oE(this.opacity);return`${e===1?"rgb(":"rgba("}${Ch(this.r)}, ${Ch(this.g)}, ${Ch(this.b)}${e===1?")":`, ${e})`}`}function oE(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ch(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Oh(e){return e=Ch(e),(e<16?"0":"")+e.toString(16)}function Vte(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new yl(e,t,n,r)}function Ute(e){if(e instanceof yl)return new yl(e.h,e.s,e.l,e.opacity);if(e instanceof Tg||(e=rE(e)),!e)return new yl;if(e instanceof yl)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),o=Math.max(t,n,r),a=NaN,s=o-i,l=(o+i)/2;return s?(t===o?a=(n-r)/s+(n<r)*6:n===o?a=(r-t)/s+2:a=(t-n)/s+4,s/=l<.5?o+i:2-o-i,a*=60):s=l>0&&l<1?0:a,new yl(a,s,l,e.opacity)}function pQe(e,t,n,r){return arguments.length===1?Ute(e):new yl(e,t,n,r==null?1:r)}function yl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}nE(yl,pQe,hk(Tg,{brighter(e){return e=e==null?Ig:Math.pow(Ig,e),new yl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wh:Math.pow(wh,e),new yl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ho(pk(e>=240?e-240:e+120,i,r),pk(e,i,r),pk(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new yl(qte(this.h),aE(this.s),aE(this.l),oE(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 e=oE(this.opacity);return`${e===1?"hsl(":"hsla("}${qte(this.h)}, ${aE(this.s)*100}%, ${aE(this.l)*100}%${e===1?")":`, ${e})`}`}}));function qte(e){return e=(e||0)%360,e<0?e+360:e}function aE(e){return Math.max(0,Math.min(1,e||0))}function pk(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const vQe=Math.PI/180,gQe=180/Math.PI;var Gte=-.14861,vk=1.78277,gk=-.29227,sE=-.90649,tb=1.97294,Kte=tb*sE,Yte=tb*vk,Xte=vk*gk-sE*Gte;function mQe(e){if(e instanceof Eh)return new Eh(e.h,e.s,e.l,e.opacity);e instanceof Ho||(e=zte(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(Xte*r+Kte*t-Yte*n)/(Xte+Kte-Yte),o=r-i,a=(tb*(n-i)-gk*o)/sE,s=Math.sqrt(a*a+o*o)/(tb*i*(1-i)),l=s?Math.atan2(a,o)*gQe-120:NaN;return new Eh(l<0?l+360:l,s,i,e.opacity)}function Gl(e,t,n,r){return arguments.length===1?mQe(e):new Eh(e,t,n,r==null?1:r)}function Eh(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}nE(Eh,Gl,hk(Tg,{brighter(e){return e=e==null?Ig:Math.pow(Ig,e),new Eh(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?wh:Math.pow(wh,e),new Eh(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*vQe,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Ho(255*(t+n*(Gte*r+vk*i)),255*(t+n*(gk*r+sE*i)),255*(t+n*(tb*r)),this.opacity)}}));function eu(e,t,n,r){var i=e-n,o=t-r;return Math.sqrt(i*i+o*o)}function Zte(e,t){var n=Math.min.apply(Math,it([],se(e),!1)),r=Math.min.apply(Math,it([],se(t),!1)),i=Math.max.apply(Math,it([],se(e),!1)),o=Math.max.apply(Math,it([],se(t),!1));return{x:n,y:r,width:i-n,height:o-r}}function yQe(e,t,n){return Math.atan(-t/e*Math.tan(n))}function bQe(e,t,n){return Math.atan(t/(e*Math.tan(n)))}function xQe(e,t,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+e}function SQe(e,t,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+t}function wQe(e,t,n,r,i,o,a){for(var s=yQe(n,r,i),l=1/0,c=-1/0,u=[o,a],f=-Math.PI*2;f<=Math.PI*2;f+=Math.PI){var d=s+f;o<a?o<d&&d<a&&u.push(d):a<d&&d<o&&u.push(d)}for(var f=0;f<u.length;f++){var h=xQe(e,t,n,r,i,u[f]);h<l&&(l=h),h>c&&(c=h)}for(var p=bQe(n,r,i),v=1/0,g=-1/0,m=[o,a],f=-Math.PI*2;f<=Math.PI*2;f+=Math.PI){var y=p+f;o<a?o<y&&y<a&&m.push(y):a<y&&y<o&&m.push(y)}for(var f=0;f<m.length;f++){var x=SQe(e,t,n,r,i,m[f]);x<v&&(v=x),x>g&&(g=x)}return{x:l,y:v,width:c-l,height:g-v}}var CQe=1e-4;function Qte(e,t,n,r,i,o){var a=-1,s=1/0,l=[n,r],c=20;o&&o>200&&(c=o/10);for(var u=1/c,f=u/10,d=0;d<=c;d++){var h=d*u,p=[i.apply(void 0,it([],se(e.concat([h])),!1)),i.apply(void 0,it([],se(t.concat([h])),!1))],v=eu(l[0],l[1],p[0],p[1]);v<s&&(a=h,s=v)}if(a===0)return{x:e[0],y:t[0]};if(a===1){var g=e.length;return{x:e[g-1],y:t[g-1]}}s=1/0;for(var d=0;d<32&&!(f<CQe);d++){var m=a-f,y=a+f,p=[i.apply(void 0,it([],se(e.concat([m])),!1)),i.apply(void 0,it([],se(t.concat([m])),!1))],v=eu(l[0],l[1],p[0],p[1]);if(m>=0&&v<s)a=m,s=v;else{var x=[i.apply(void 0,it([],se(e.concat([y])),!1)),i.apply(void 0,it([],se(t.concat([y])),!1))],S=eu(l[0],l[1],x[0],x[1]);y<=1&&S<s?(a=y,s=S):f*=.5}}return{x:i.apply(void 0,it([],se(e.concat([a])),!1)),y:i.apply(void 0,it([],se(t.concat([a])),!1))}}function Jte(e,t,n,r){return eu(e,t,n,r)}function ene(e,t,n,r,i){return{x:(1-i)*e+i*n,y:(1-i)*t+i*r}}function OQe(e,t,n,r,i,o){var a=[n-e,r-t];if(yKe(a,[0,0]))return Math.sqrt((i-e)*(i-e)+(o-t)*(o-t));var s=[-a[1],a[0]];gKe(s,s);var l=[i-e,o-t];return Math.abs(mKe(l,s))}function mk(e,t,n,r,i){var o=1-i;return o*o*o*e+3*t*i*o*o+3*n*i*i*o+r*i*i*i}function tne(e,t,n,r){var i=-3*e+9*t-9*n+3*r,o=6*e-12*t+6*n,a=3*t-3*e,s=[],l,c,u;if(O1(i,0))O1(o,0)||(l=-a/o,l>=0&&l<=1&&s.push(l));else{var f=o*o-4*i*a;O1(f,0)?s.push(-o/(2*i)):f>0&&(u=Math.sqrt(f),l=(-o+u)/(2*i),c=(-o-u)/(2*i),l>=0&&l<=1&&s.push(l),c>=0&&c<=1&&s.push(c))}return s}function EQe(e,t,n,r,i,o,a,s){for(var l=[e,a],c=[t,s],u=tne(e,n,i,a),f=tne(t,r,o,s),d=0;d<u.length;d++)l.push(mk(e,n,i,a,u[d]));for(var d=0;d<f.length;d++)c.push(mk(t,r,o,s,f[d]));return Zte(l,c)}function _Qe(e,t,n,r,i,o,a,s,l,c,u){return Qte([e,n,i,a],[t,r,o,s],l,c,mk,u)}function nne(e,t,n,r,i,o,a,s,l,c,u){var f=_Qe(e,t,n,r,i,o,a,s,l,c,u);return eu(f.x,f.y,l,c)}function $Qe(e){if(e.length<2)return 0;for(var t=0,n=0;n<e.length-1;n++){var r=e[n],i=e[n+1];t+=eu(r[0],r[1],i[0],i[1])}return t}function PQe(e){return $Qe(e)}function yk(e,t,n,r){var i=1-r;return i*i*e+2*r*i*t+r*r*n}function rne(e,t,n){var r=e+n-2*t;if(O1(r,0))return[.5];var i=(e-t)/r;return i<=1&&i>=0?[i]:[]}function MQe(e,t,n,r,i,o){var a=rne(e,n,i)[0],s=rne(t,r,o)[0],l=[e,i],c=[t,o];return a!==void 0&&l.push(yk(e,n,i,a)),s!==void 0&&c.push(yk(t,r,o,s)),Zte(l,c)}function TQe(e,t,n,r,i,o,a,s){return Qte([e,n,i],[t,r,o],a,s,yk)}function IQe(e,t,n,r,i,o,a,s){var l=TQe(e,t,n,r,i,o,a,s);return eu(l.x,l.y,a,s)}var RQe=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},ine={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(RQe,function(){function n(w,C,O,E,_){r(w,C,O||0,E||w.length-1,_||o)}function r(w,C,O,E,_){for(;E>O;){if(E-O>600){var $=E-O+1,P=C-O+1,T=Math.log($),I=.5*Math.exp(2*T/3),M=.5*Math.sqrt(T*I*($-I)/$)*(P-$/2<0?-1:1),R=Math.max(O,Math.floor(C-P*I/$+M)),N=Math.min(E,Math.floor(C+($-P)*I/$+M));r(w,C,R,N,_)}var k=w[C],A=O,j=E;for(i(w,O,C),_(w[E],k)>0&&i(w,O,E);A<j;){for(i(w,A,j),A++,j--;_(w[A],k)<0;)A++;for(;_(w[j],k)>0;)j--}_(w[O],k)===0?i(w,O,j):(j++,i(w,j,E)),j<=C&&(O=j+1),C<=j&&(E=j-1)}}function i(w,C,O){var E=w[C];w[C]=w[O],w[O]=E}function o(w,C){return w<C?-1:w>C?1:0}var a=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()};a.prototype.all=function(){return this._all(this.data,[])},a.prototype.search=function(C){var O=this.data,E=[];if(!y(C,O))return E;for(var _=this.toBBox,$=[];O;){for(var P=0;P<O.children.length;P++){var T=O.children[P],I=O.leaf?_(T):T;y(C,I)&&(O.leaf?E.push(T):m(C,I)?this._all(T,E):$.push(T))}O=$.pop()}return E},a.prototype.collides=function(C){var O=this.data;if(!y(C,O))return!1;for(var E=[];O;){for(var _=0;_<O.children.length;_++){var $=O.children[_],P=O.leaf?this.toBBox($):$;if(y(C,P)){if(O.leaf||m(C,P))return!0;E.push($)}}O=E.pop()}return!1},a.prototype.load=function(C){if(!(C&&C.length))return this;if(C.length<this._minEntries){for(var O=0;O<C.length;O++)this.insert(C[O]);return this}var E=this._build(C.slice(),0,C.length-1,0);if(!this.data.children.length)this.data=E;else if(this.data.height===E.height)this._splitRoot(this.data,E);else{if(this.data.height<E.height){var _=this.data;this.data=E,E=_}this._insert(E,this.data.height-E.height-1,!0)}return this},a.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},a.prototype.clear=function(){return this.data=x([]),this},a.prototype.remove=function(C,O){if(!C)return this;for(var E=this.data,_=this.toBBox(C),$=[],P=[],T,I,M;E||$.length;){if(E||(E=$.pop(),I=$[$.length-1],T=P.pop(),M=!0),E.leaf){var R=s(C,E.children,O);if(R!==-1)return E.children.splice(R,1),$.push(E),this._condense($),this}!M&&!E.leaf&&m(E,_)?($.push(E),P.push(T),T=0,I=E,E=E.children[0]):I?(T++,E=I.children[T],M=!1):E=null}return this},a.prototype.toBBox=function(C){return C},a.prototype.compareMinX=function(C,O){return C.minX-O.minX},a.prototype.compareMinY=function(C,O){return C.minY-O.minY},a.prototype.toJSON=function(){return this.data},a.prototype.fromJSON=function(C){return this.data=C,this},a.prototype._all=function(C,O){for(var E=[];C;)C.leaf?O.push.apply(O,C.children):E.push.apply(E,C.children),C=E.pop();return O},a.prototype._build=function(C,O,E,_){var $=E-O+1,P=this._maxEntries,T;if($<=P)return T=x(C.slice(O,E+1)),l(T,this.toBBox),T;_||(_=Math.ceil(Math.log($)/Math.log(P)),P=Math.ceil($/Math.pow(P,_-1))),T=x([]),T.leaf=!1,T.height=_;var I=Math.ceil($/P),M=I*Math.ceil(Math.sqrt(P));S(C,O,E,M,this.compareMinX);for(var R=O;R<=E;R+=M){var N=Math.min(R+M-1,E);S(C,R,N,I,this.compareMinY);for(var k=R;k<=N;k+=I){var A=Math.min(k+I-1,N);T.children.push(this._build(C,k,A,_-1))}}return l(T,this.toBBox),T},a.prototype._chooseSubtree=function(C,O,E,_){for(;_.push(O),!(O.leaf||_.length-1===E);){for(var $=1/0,P=1/0,T=void 0,I=0;I<O.children.length;I++){var M=O.children[I],R=h(M),N=v(C,M)-R;N<P?(P=N,$=R<$?R:$,T=M):N===P&&R<$&&($=R,T=M)}O=T||O.children[0]}return O},a.prototype._insert=function(C,O,E){var _=E?C:this.toBBox(C),$=[],P=this._chooseSubtree(_,this.data,O,$);for(P.children.push(C),u(P,_);O>=0&&$[O].children.length>this._maxEntries;)this._split($,O),O--;this._adjustParentBBoxes(_,$,O)},a.prototype._split=function(C,O){var E=C[O],_=E.children.length,$=this._minEntries;this._chooseSplitAxis(E,$,_);var P=this._chooseSplitIndex(E,$,_),T=x(E.children.splice(P,E.children.length-P));T.height=E.height,T.leaf=E.leaf,l(E,this.toBBox),l(T,this.toBBox),O?C[O-1].children.push(T):this._splitRoot(E,T)},a.prototype._splitRoot=function(C,O){this.data=x([C,O]),this.data.height=C.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},a.prototype._chooseSplitIndex=function(C,O,E){for(var _,$=1/0,P=1/0,T=O;T<=E-O;T++){var I=c(C,0,T,this.toBBox),M=c(C,T,E,this.toBBox),R=g(I,M),N=h(I)+h(M);R<$?($=R,_=T,P=N<P?N:P):R===$&&N<P&&(P=N,_=T)}return _||E-O},a.prototype._chooseSplitAxis=function(C,O,E){var _=C.leaf?this.compareMinX:f,$=C.leaf?this.compareMinY:d,P=this._allDistMargin(C,O,E,_),T=this._allDistMargin(C,O,E,$);P<T&&C.children.sort(_)},a.prototype._allDistMargin=function(C,O,E,_){C.children.sort(_);for(var $=this.toBBox,P=c(C,0,O,$),T=c(C,E-O,E,$),I=p(P)+p(T),M=O;M<E-O;M++){var R=C.children[M];u(P,C.leaf?$(R):R),I+=p(P)}for(var N=E-O-1;N>=O;N--){var k=C.children[N];u(T,C.leaf?$(k):k),I+=p(T)}return I},a.prototype._adjustParentBBoxes=function(C,O,E){for(var _=E;_>=0;_--)u(O[_],C)},a.prototype._condense=function(C){for(var O=C.length-1,E=void 0;O>=0;O--)C[O].children.length===0?O>0?(E=C[O-1].children,E.splice(E.indexOf(C[O]),1)):this.clear():l(C[O],this.toBBox)};function s(w,C,O){if(!O)return C.indexOf(w);for(var E=0;E<C.length;E++)if(O(w,C[E]))return E;return-1}function l(w,C){c(w,0,w.children.length,C,w)}function c(w,C,O,E,_){_||(_=x(null)),_.minX=1/0,_.minY=1/0,_.maxX=-1/0,_.maxY=-1/0;for(var $=C;$<O;$++){var P=w.children[$];u(_,w.leaf?E(P):P)}return _}function u(w,C){return w.minX=Math.min(w.minX,C.minX),w.minY=Math.min(w.minY,C.minY),w.maxX=Math.max(w.maxX,C.maxX),w.maxY=Math.max(w.maxY,C.maxY),w}function f(w,C){return w.minX-C.minX}function d(w,C){return w.minY-C.minY}function h(w){return(w.maxX-w.minX)*(w.maxY-w.minY)}function p(w){return w.maxX-w.minX+(w.maxY-w.minY)}function v(w,C){return(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))}function g(w,C){var O=Math.max(w.minX,C.minX),E=Math.max(w.minY,C.minY),_=Math.min(w.maxX,C.maxX),$=Math.min(w.maxY,C.maxY);return Math.max(0,_-O)*Math.max(0,$-E)}function m(w,C){return w.minX<=C.minX&&w.minY<=C.minY&&C.maxX<=w.maxX&&C.maxY<=w.maxY}function y(w,C){return C.minX<=w.maxX&&C.minY<=w.maxY&&C.maxX>=w.minX&&C.maxY>=w.minY}function x(w){return{children:w,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function S(w,C,O,E,_){for(var $=[C,O];$.length;)if(O=$.pop(),C=$.pop(),!(O-C<=E)){var P=C+Math.ceil((O-C)/E/2)*E;n(w,P,C,O,_),$.push(C,P,P,O)}}return a})})(ine);var NQe=ine.exports,Ze;(function(e){e.GROUP="g",e.CIRCLE="circle",e.ELLIPSE="ellipse",e.IMAGE="image",e.RECT="rect",e.LINE="line",e.POLYLINE="polyline",e.POLYGON="polygon",e.TEXT="text",e.PATH="path",e.HTML="html",e.MESH="mesh"})(Ze||(Ze={}));var Ng;(function(e){e[e.ZERO=0]="ZERO",e[e.NEGATIVE_ONE=1]="NEGATIVE_ONE"})(Ng||(Ng={}));var Mf=function(){function e(){this.plugins=[]}return e.prototype.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.prototype.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach(function(n){var r=t.context.renderingPlugins.indexOf(n);r>=0&&t.context.renderingPlugins.splice(r,1)})},e}(),kQe=function(){function e(t){this.clipSpaceNearZ=Ng.NEGATIVE_ONE,this.plugins=[],this.config=ke({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1,enableSizeAttenuation:!0},t)}return e.prototype.registerPlugin=function(t){var n=this.plugins.findIndex(function(r){return r===t});n===-1&&this.plugins.push(t)},e.prototype.unregisterPlugin=function(t){var n=this.plugins.findIndex(function(r){return r===t});n>-1&&this.plugins.splice(n,1)},e.prototype.getPlugins=function(){return this.plugins},e.prototype.getPlugin=function(t){return this.plugins.find(function(n){return n.name===t})},e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(t){Object.assign(this.config,t)},e}();function kg(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function bk(e,t,n){return e[0]=t[0]-n[0],e[1]=t[1]-n[1],e[2]=t[2]-n[2],e}function lE(e,t,n){return e[0]=t[0]+n[0],e[1]=t[1]+n[1],e[2]=t[2]+n[2],e}function one(e,t,n){return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e}function AQe(e,t,n){return e[0]=Math.max(t[0],n[0]),e[1]=Math.max(t[1],n[1]),e[2]=Math.max(t[2],n[2]),e}function LQe(e,t,n){return e[0]=Math.min(t[0],n[0]),e[1]=Math.min(t[1],n[1]),e[2]=Math.min(t[2],n[2]),e}function Ag(e){return e===void 0?0:e>360||e<-360?e%360:e}function ta(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=0),Array.isArray(e)&&e.length===3?Xc(e):_r(e)?Un(e,t,n):Un(e[0],e[1]||t,e[2]||n)}function pr(e){return e*(Math.PI/180)}function $s(e){return e*(180/Math.PI)}function jQe(e){return 360*e}function DQe(e,t){var n=t[0],r=t[1],i=t[2],o=t[3],a=n*n,s=r*r,l=i*i,c=o*o,u=a+s+l+c,f=n*o-r*i;return f>.499995*u?(e[0]=Math.PI/2,e[1]=2*Math.atan2(r,n),e[2]=0):f<-.499995*u?(e[0]=-Math.PI/2,e[1]=2*Math.atan2(r,n),e[2]=0):(e[0]=Math.asin(2*(n*i-o*r)),e[1]=Math.atan2(2*(n*o+r*i),1-2*(l+c)),e[2]=Math.atan2(2*(n*r+i*o),1-2*(s+l))),e}function FQe(e,t){var n,r,i=Math.PI*.5,o=se(pg(Mn(),t),3),a=o[0],s=o[1],l=o[2],c=Math.asin(-t[2]/a);return c<i?c>-i?(n=Math.atan2(t[6]/s,t[10]/l),r=Math.atan2(t[1]/a,t[0]/a)):(r=0,n=-Math.atan2(t[4]/s,t[5]/s)):(r=0,n=Math.atan2(t[4]/s,t[5]/s)),e[0]=n,e[1]=c,e[2]=r,e}function xk(e,t){return t.length===16?FQe(e,t):DQe(e,t)}function BQe(e,t,n,r,i){var o=Math.cos(e),a=Math.sin(e);return NGe(r*o,i*a,0,-r*a,i*o,0,t,n,1)}function zQe(e,t,n,r,i,o,a,s){s===void 0&&(s=!1);var l=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d,h;return s?(d=-a/(a-o),h=-a*o/(a-o)):(d=-(a+o)/(a-o),h=-2*a*o/(a-o)),e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=u,e[9]=f,e[10]=d,e[11]=-1,e[12]=0,e[13]=0,e[14]=h,e[15]=0,e}function ane(e){var t=e[0],n=e[1],r=e[3],i=e[4],o=Math.sqrt(t*t+n*n),a=Math.sqrt(r*r+i*i),s=t*i-n*r;s<0&&(t<i?o=-o:a=-a),o&&(t*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var l=Math.atan2(n,t),c=$s(l);return[e[6],e[7],o,a,c]}var Kl=er(),bl=er(),nb=gg(),pn=[Mn(),Mn(),Mn()],sne=Mn();function HQe(e,t,n,r,i,o){if(!WQe(Kl,e)||(dg(bl,Kl),bl[3]=0,bl[7]=0,bl[11]=0,bl[15]=1,Math.abs(eJ(bl))<1e-8))return!1;var a=Kl[3],s=Kl[7],l=Kl[11],c=Kl[12],u=Kl[13],f=Kl[14],d=Kl[15];if(a!==0||s!==0||l!==0){nb[0]=a,nb[1]=s,nb[2]=l,nb[3]=d;var h=vl(bl,bl);if(!h)return!1;JQ(bl,bl),mg(i,nb,bl)}else i[0]=i[1]=i[2]=0,i[3]=1;if(t[0]=c,t[1]=u,t[2]=f,VQe(pn,Kl),n[0]=Zc(pn[0]),dh(pn[0],pn[0]),r[0]=Wl(pn[0],pn[1]),Sk(pn[1],pn[1],pn[0],1,-r[0]),n[1]=Zc(pn[1]),dh(pn[1],pn[1]),r[0]/=n[1],r[1]=Wl(pn[0],pn[2]),Sk(pn[2],pn[2],pn[0],1,-r[1]),r[2]=Wl(pn[1],pn[2]),Sk(pn[2],pn[2],pn[1],1,-r[2]),n[2]=Zc(pn[2]),dh(pn[2],pn[2]),r[1]/=n[2],r[2]/=n[2],bO(sne,pn[1],pn[2]),Wl(pn[0],sne)<0)for(var p=0;p<3;p++)n[p]*=-1,pn[p][0]*=-1,pn[p][1]*=-1,pn[p][2]*=-1;return o[0]=.5*Math.sqrt(Math.max(1+pn[0][0]-pn[1][1]-pn[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-pn[0][0]+pn[1][1]-pn[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-pn[0][0]-pn[1][1]+pn[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+pn[0][0]+pn[1][1]+pn[2][2],0)),pn[2][1]>pn[1][2]&&(o[0]=-o[0]),pn[0][2]>pn[2][0]&&(o[1]=-o[1]),pn[1][0]>pn[0][1]&&(o[2]=-o[2]),!0}function WQe(e,t){var n=t[15];if(n===0)return!1;for(var r=1/n,i=0;i<16;i++)e[i]=t[i]*r;return!0}function VQe(e,t){e[0][0]=t[0],e[0][1]=t[1],e[0][2]=t[2],e[1][0]=t[4],e[1][1]=t[5],e[1][2]=t[6],e[2][0]=t[8],e[2][1]=t[9],e[2][2]=t[10]}function Sk(e,t,n,r,i){e[0]=t[0]*r+n[0]*i,e[1]=t[1]*r+n[1]*i,e[2]=t[2]*r+n[2]*i}var vi=function(){function e(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return e.isEmpty=function(t){return!t||t.halfExtents[0]===0&&t.halfExtents[1]===0&&t.halfExtents[2]===0},e.prototype.update=function(t,n){kg(this.center,t),kg(this.halfExtents,n),bk(this.min,this.center,this.halfExtents),lE(this.max,this.center,this.halfExtents)},e.prototype.setMinMax=function(t,n){lE(this.center,n,t),one(this.center,this.center,.5),bk(this.halfExtents,n,t),one(this.halfExtents,this.halfExtents,.5),kg(this.min,t),kg(this.max,n)},e.prototype.getMin=function(){return this.min},e.prototype.getMax=function(){return this.max},e.prototype.add=function(t){if(!e.isEmpty(t)){if(e.isEmpty(this)){this.setMinMax(t.getMin(),t.getMax());return}var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],l=a[1],c=a[2],u=r-s,f=r+s,d=i-l,h=i+l,p=o-c,v=o+c,g=t.center,m=g[0],y=g[1],x=g[2],S=t.halfExtents,w=S[0],C=S[1],O=S[2],E=m-w,_=m+w,$=y-C,P=y+C,T=x-O,I=x+O;E<u&&(u=E),_>f&&(f=_),$<d&&(d=$),P>h&&(h=P),T<p&&(p=T),I>v&&(v=I),n[0]=(u+f)*.5,n[1]=(d+h)*.5,n[2]=(p+v)*.5,a[0]=(f-u)*.5,a[1]=(h-d)*.5,a[2]=(v-p)*.5,this.min[0]=u,this.min[1]=d,this.min[2]=p,this.max[0]=f,this.max[1]=h,this.max[2]=v}},e.prototype.setFromTransformedAABB=function(t,n){var r=this.center,i=this.halfExtents,o=t.center,a=t.halfExtents,s=n[0],l=n[4],c=n[8],u=n[1],f=n[5],d=n[9],h=n[2],p=n[6],v=n[10],g=Math.abs(s),m=Math.abs(l),y=Math.abs(c),x=Math.abs(u),S=Math.abs(f),w=Math.abs(d),C=Math.abs(h),O=Math.abs(p),E=Math.abs(v);r[0]=n[12]+s*o[0]+l*o[1]+c*o[2],r[1]=n[13]+u*o[0]+f*o[1]+d*o[2],r[2]=n[14]+h*o[0]+p*o[1]+v*o[2],i[0]=g*a[0]+m*a[1]+y*a[2],i[1]=x*a[0]+S*a[1]+w*a[2],i[2]=C*a[0]+O*a[1]+E*a[2],bk(this.min,r,i),lE(this.max,r,i)},e.prototype.intersects=function(t){var n=this.getMax(),r=this.getMin(),i=t.getMax(),o=t.getMin();return r[0]<=i[0]&&n[0]>=o[0]&&r[1]<=i[1]&&n[1]>=o[1]&&r[2]<=i[2]&&n[2]>=o[2]},e.prototype.intersection=function(t){if(!this.intersects(t))return null;var n=new e,r=AQe([0,0,0],this.getMin(),t.getMin()),i=LQe([0,0,0],this.getMax(),t.getMax());return n.setMinMax(r,i),n},e.prototype.getNegativeFarPoint=function(t){return t.pnVertexFlag===273?kg([0,0,0],this.min):t.pnVertexFlag===272?[this.min[0],this.min[1],this.max[2]]:t.pnVertexFlag===257?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===256?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===17?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===16?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===1?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},e.prototype.getPositiveFarPoint=function(t){return t.pnVertexFlag===273?kg([0,0,0],this.max):t.pnVertexFlag===272?[this.max[0],this.max[1],this.min[2]]:t.pnVertexFlag===257?[this.max[0],this.min[1],this.max[2]]:t.pnVertexFlag===256?[this.max[0],this.min[1],this.min[2]]:t.pnVertexFlag===17?[this.min[0],this.max[1],this.max[2]]:t.pnVertexFlag===16?[this.min[0],this.max[1],this.min[2]]:t.pnVertexFlag===1?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},e}(),UQe=function(){function e(t,n){this.distance=t||0,this.normal=n||Un(0,1,0),this.updatePNVertexFlag()}return e.prototype.updatePNVertexFlag=function(){this.pnVertexFlag=(+(this.normal[0]>=0)<<8)+(+(this.normal[1]>=0)<<4)+ +(this.normal[2]>=0)},e.prototype.distanceToPoint=function(t){return Wl(t,this.normal)-this.distance},e.prototype.normalize=function(){var t=1/mJ(this.normal);vN(this.normal,this.normal,t),this.distance*=t},e.prototype.intersectsLine=function(t,n,r){var i=this.distanceToPoint(t),o=this.distanceToPoint(n),a=i/(i-o),s=a>=0&&a<=1;return s&&r&&gN(r,t,n,a),s},e}(),Tf;(function(e){e[e.OUTSIDE=4294967295]="OUTSIDE",e[e.INSIDE=0]="INSIDE",e[e.INDETERMINATE=2147483647]="INDETERMINATE"})(Tf||(Tf={}));var qQe=function(){function e(t){if(this.planes=[],t)this.planes=t;else for(var n=0;n<6;n++)this.planes.push(new UQe)}return e.prototype.extractFromVPMatrix=function(t){var n=se(t,16),r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],c=n[6],u=n[7],f=n[8],d=n[9],h=n[10],p=n[11],v=n[12],g=n[13],m=n[14],y=n[15];gl(this.planes[0].normal,a-r,u-s,p-f),this.planes[0].distance=y-v,gl(this.planes[1].normal,a+r,u+s,p+f),this.planes[1].distance=y+v,gl(this.planes[2].normal,a+i,u+l,p+d),this.planes[2].distance=y+g,gl(this.planes[3].normal,a-i,u-l,p-d),this.planes[3].distance=y-g,gl(this.planes[4].normal,a-o,u-c,p-h),this.planes[4].distance=y-m,gl(this.planes[5].normal,a+o,u+c,p+h),this.planes[5].distance=y+m,this.planes.forEach(function(x){x.normalize(),x.updatePNVertexFlag()})},e}(),So=function(){function e(t,n){t===void 0&&(t=0),n===void 0&&(n=0),this.x=0,this.y=0,this.x=t,this.y=n}return e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.copyFrom=function(t){this.x=t.x,this.y=t.y},e}(),_h=function(){function e(t,n,r,i){this.x=t,this.y=n,this.width=r,this.height=i,this.left=t,this.right=t+r,this.top=n,this.bottom=n+i}return e.prototype.toJSON=function(){},e}(),vr="Method not implemented.",Lg="Use document.documentElement instead.",GQe="Cannot append a destroyed element.",nr;(function(e){e[e.ORBITING=0]="ORBITING",e[e.EXPLORING=1]="EXPLORING",e[e.TRACKING=2]="TRACKING"})(nr||(nr={}));var rb;(function(e){e[e.DEFAULT=0]="DEFAULT",e[e.ROTATIONAL=1]="ROTATIONAL",e[e.TRANSLATIONAL=2]="TRANSLATIONAL",e[e.CINEMATIC=3]="CINEMATIC"})(rb||(rb={}));var wa;(function(e){e[e.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",e[e.PERSPECTIVE=1]="PERSPECTIVE"})(wa||(wa={}));var lne={UPDATED:"updated"},cne=2e-4,une=function(){function e(){this.clipSpaceNearZ=Ng.NEGATIVE_ONE,this.eventEmitter=new dk,this.matrix=er(),this.right=Un(1,0,0),this.up=Un(0,1,0),this.forward=Un(0,0,1),this.position=Un(0,0,1),this.focalPoint=Un(0,0,0),this.distanceVector=Un(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.projectionMatrix=er(),this.projectionMatrixInverse=er(),this.jitteredProjectionMatrix=void 0,this.enableUpdate=!0,this.type=nr.EXPLORING,this.trackingMode=rb.DEFAULT,this.projectionMode=wa.PERSPECTIVE,this.frustum=new qQe,this.orthoMatrix=er()}return e.prototype.isOrtho=function(){return this.projectionMode===wa.ORTHOGRAPHIC},e.prototype.getProjectionMode=function(){return this.projectionMode},e.prototype.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},e.prototype.getPerspectiveInverse=function(){return this.projectionMatrixInverse},e.prototype.getFrustum=function(){return this.frustum},e.prototype.getPosition=function(){return this.position},e.prototype.getFocalPoint=function(){return this.focalPoint},e.prototype.getDollyingStep=function(){return this.dollyingStep},e.prototype.getNear=function(){return this.near},e.prototype.getFar=function(){return this.far},e.prototype.getZoom=function(){return this.zoom},e.prototype.getOrthoMatrix=function(){return this.orthoMatrix},e.prototype.getView=function(){return this.view},e.prototype.setEnableUpdate=function(t){this.enableUpdate=t},e.prototype.setType=function(t,n){return this.type=t,this.type===nr.EXPLORING?this.setWorldRotation(!0):this.setWorldRotation(!1),this._getAngles(),this.type===nr.TRACKING&&n!==void 0&&this.setTrackingMode(n),this},e.prototype.setProjectionMode=function(t){return this.projectionMode=t,this},e.prototype.setTrackingMode=function(t){if(this.type!==nr.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=t,this},e.prototype.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},e.prototype.getViewTransform=function(){return vl(er(),this.matrix)},e.prototype.getWorldTransform=function(){return this.matrix},e.prototype.jitterProjectionMatrix=function(t,n){var r=yf(er(),[t,n,0]);this.jitteredProjectionMatrix=Do(er(),r,this.projectionMatrix)},e.prototype.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},e.prototype.setMatrix=function(t){return this.matrix=t,this._update(),this},e.prototype.setProjectionMatrix=function(t){this.projectionMatrix=t},e.prototype.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},e.prototype.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},e.prototype.setNear=function(t){return this.projectionMode===wa.PERSPECTIVE?this.setPerspective(t,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,t,this.far),this},e.prototype.setFar=function(t){return this.projectionMode===wa.PERSPECTIVE?this.setPerspective(this.near,t,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,t),this},e.prototype.setViewOffset=function(t,n,r,i,o,a){return this.aspect=t/n,this.view===void 0&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=t,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===wa.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.clearViewOffset=function(){return this.view!==void 0&&(this.view.enabled=!1),this.projectionMode===wa.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},e.prototype.setZoom=function(t){return this.zoom=t,this.projectionMode===wa.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===wa.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},e.prototype.setZoomByViewportPoint=function(t,n){var r=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),i=r.x,o=r.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(i,o),this.setFocalPoint(i,o),this.setZoom(t),this.rotate(0,0,a);var s=this.canvas.viewport2Canvas({x:n[0],y:n[1]}),l=s.x,c=s.y,u=Un(l-i,c-o,0),f=Wl(u,this.right)/Zc(this.right),d=Wl(u,this.up)/Zc(this.up),h=se(this.getPosition(),2),p=h[0],v=h[1],g=se(this.getFocalPoint(),2),m=g[0],y=g[1];return this.setPosition(p-f,v-d),this.setFocalPoint(m-f,y-d),this},e.prototype.setPerspective=function(t,n,r,i){var o;this.projectionMode=wa.PERSPECTIVE,this.fov=r,this.near=t,this.far=n,this.aspect=i;var a=this.near*Math.tan(pr(.5*this.fov))/this.zoom,s=2*a,l=this.aspect*s,c=-.5*l;if(!((o=this.view)===null||o===void 0)&&o.enabled){var u=this.view.fullWidth,f=this.view.fullHeight;c+=this.view.offsetX*l/u,a-=this.view.offsetY*s/f,l*=this.view.width/u,s*=this.view.height/f}return zQe(this.projectionMatrix,c,c+l,a-s,a,t,this.far,this.clipSpaceNearZ===Ng.ZERO),vl(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},e.prototype.setOrthographic=function(t,n,r,i,o,a){var s;this.projectionMode=wa.ORTHOGRAPHIC,this.rright=n,this.left=t,this.top=r,this.bottom=i,this.near=o,this.far=a;var l=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),u=(this.rright+this.left)/2,f=(this.top+this.bottom)/2,d=u-l,h=u+l,p=f+c,v=f-c;if(!((s=this.view)===null||s===void 0)&&s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;d+=g*this.view.offsetX,h=d+g*this.view.width,p-=m*this.view.offsetY,v=p-m*this.view.height}return this.clipSpaceNearZ===Ng.NEGATIVE_ONE?uJ(this.projectionMatrix,d,h,p,v,o,a):fJ(this.projectionMatrix,d,h,p,v,o,a),vl(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},e.prototype.setPosition=function(t,n,r){n===void 0&&(n=this.position[1]),r===void 0&&(r=this.position[2]);var i=ta(t,n,r);return this._setPosition(i),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},e.prototype.setFocalPoint=function(t,n,r){n===void 0&&(n=this.focalPoint[1]),r===void 0&&(r=this.focalPoint[2]);var i=Un(0,1,0);if(this.focalPoint=ta(t,n,r),this.trackingMode===rb.CINEMATIC){var o=pJ(Mn(),this.focalPoint,this.position);t=o[0],n=o[1],r=o[2];var a=Zc(o),s=$s(Math.asin(n/a)),l=90+$s(Math.atan2(r,t)),c=er();rJ(c,c,pr(l)),nJ(c,c,pr(s)),i=Zi(Mn(),[0,1,0],c)}return vl(this.matrix,dJ(er(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},e.prototype.getDistance=function(){return this.distance},e.prototype.getDistanceVector=function(){return this.distanceVector},e.prototype.setDistance=function(t){if(this.distance===t||t<0)return this;this.distance=t,this.distance<cne&&(this.distance=cne),this.dollyingStep=this.distance/100;var n=Mn();t=this.distance;var r=this.forward,i=this.focalPoint;return n[0]=t*r[0]+i[0],n[1]=t*r[1]+i[1],n[2]=t*r[2]+i[2],this._setPosition(n),this.triggerUpdate(),this},e.prototype.setMaxDistance=function(t){return this.maxDistance=t,this},e.prototype.setMinDistance=function(t){return this.minDistance=t,this},e.prototype.setAzimuth=function(t){return this.azimuth=Ag(t),this.computeMatrix(),this._getAxes(),this.type===nr.ORBITING||this.type===nr.EXPLORING?this._getPosition():this.type===nr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getAzimuth=function(){return this.azimuth},e.prototype.setElevation=function(t){return this.elevation=Ag(t),this.computeMatrix(),this._getAxes(),this.type===nr.ORBITING||this.type===nr.EXPLORING?this._getPosition():this.type===nr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getElevation=function(){return this.elevation},e.prototype.setRoll=function(t){return this.roll=Ag(t),this.computeMatrix(),this._getAxes(),this.type===nr.ORBITING||this.type===nr.EXPLORING?this._getPosition():this.type===nr.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},e.prototype.getRoll=function(){return this.roll},e.prototype._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},e.prototype.computeMatrix=function(){var t=Sf(Ii(),[0,0,1],pr(this.roll));fh(this.matrix);var n=Sf(Ii(),[1,0,0],pr((this.rotateWorld&&this.type!==nr.TRACKING||this.type===nr.TRACKING?1:-1)*this.elevation)),r=Sf(Ii(),[0,1,0],pr((this.rotateWorld&&this.type!==nr.TRACKING||this.type===nr.TRACKING?1:-1)*this.azimuth)),i=wf(Ii(),r,n);i=wf(Ii(),i,t);var o=hN(er(),i);this.type===nr.ORBITING||this.type===nr.EXPLORING?(hg(this.matrix,this.matrix,this.focalPoint),Do(this.matrix,this.matrix,o),hg(this.matrix,this.matrix,[0,0,this.distance])):this.type===nr.TRACKING&&(hg(this.matrix,this.matrix,this.position),Do(this.matrix,this.matrix,o))},e.prototype._setPosition=function(t,n,r){this.position=ta(t,n,r);var i=this.matrix;i[12]=this.position[0],i[13]=this.position[1],i[14]=this.position[2],i[15]=1,this._getOrthoMatrix()},e.prototype._getAxes=function(){xf(this.right,ta(mg(gg(),[1,0,0,0],this.matrix))),xf(this.up,ta(mg(gg(),[0,1,0,0],this.matrix))),xf(this.forward,ta(mg(gg(),[0,0,1,0],this.matrix))),dh(this.right,this.right),dh(this.up,this.up),dh(this.forward,this.forward)},e.prototype._getAngles=function(){var t=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=Zc(this.distanceVector);if(i===0){this.elevation=0,this.azimuth=0;return}this.type===nr.TRACKING?(this.elevation=$s(Math.asin(n/i)),this.azimuth=$s(Math.atan2(-t,-r))):this.rotateWorld?(this.elevation=$s(Math.asin(n/i)),this.azimuth=$s(Math.atan2(-t,-r))):(this.elevation=-$s(Math.asin(n/i)),this.azimuth=-$s(Math.atan2(-t,-r)))},e.prototype._getPosition=function(){xf(this.position,ta(mg(gg(),[0,0,0,1],this.matrix))),this._getDistance()},e.prototype._getFocalPoint=function(){vJ(this.distanceVector,[0,0,-this.distance],IGe(fg(),this.matrix)),vg(this.focalPoint,this.position,this.distanceVector),this._getDistance()},e.prototype._getDistance=function(){this.distanceVector=pJ(Mn(),this.focalPoint,this.position),this.distance=Zc(this.distanceVector),this.dollyingStep=this.distance/100},e.prototype._getOrthoMatrix=function(){if(this.projectionMode===wa.ORTHOGRAPHIC){var t=this.position,n=Sf(Ii(),[0,0,1],-this.roll*Math.PI/180);$1(this.orthoMatrix,n,Un((this.rright-this.left)/2-t[0],(this.top-this.bottom)/2-t[1],0),Un(this.zoom,this.zoom,1),t)}},e.prototype.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),n=Do(er(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(n),this.eventEmitter.emit(lne.UPDATED)}},e.prototype.rotate=function(t,n,r){throw new Error(vr)},e.prototype.pan=function(t,n){throw new Error(vr)},e.prototype.dolly=function(t){throw new Error(vr)},e.prototype.createLandmark=function(t,n){throw new Error(vr)},e.prototype.gotoLandmark=function(t,n){throw new Error(vr)},e.prototype.cancelLandmarkAnimation=function(){throw new Error(vr)},e}();function wo(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=t?t.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=e.apply(this,r);return n.cache=a.set(o,s)||a,s};return n.cache=new(wo.Cache||Map),n}wo.Cache=Map;var St;(function(e){e[e.kUnknown=0]="kUnknown",e[e.kNumber=1]="kNumber",e[e.kPercentage=2]="kPercentage",e[e.kEms=3]="kEms",e[e.kPixels=4]="kPixels",e[e.kRems=5]="kRems",e[e.kDegrees=6]="kDegrees",e[e.kRadians=7]="kRadians",e[e.kGradians=8]="kGradians",e[e.kTurns=9]="kTurns",e[e.kMilliseconds=10]="kMilliseconds",e[e.kSeconds=11]="kSeconds",e[e.kInteger=12]="kInteger"})(St||(St={}));var Ja;(function(e){e[e.kUNumber=0]="kUNumber",e[e.kUPercent=1]="kUPercent",e[e.kULength=2]="kULength",e[e.kUAngle=3]="kUAngle",e[e.kUTime=4]="kUTime",e[e.kUOther=5]="kUOther"})(Ja||(Ja={}));var fne;(function(e){e[e.kAll=0]="kAll",e[e.kNonNegative=1]="kNonNegative",e[e.kInteger=2]="kInteger",e[e.kNonNegativeInteger=3]="kNonNegativeInteger",e[e.kPositiveInteger=4]="kPositiveInteger"})(fne||(fne={}));var wk;(function(e){e[e.kYes=0]="kYes",e[e.kNo=1]="kNo"})(wk||(wk={}));var Ck;(function(e){e[e.kYes=0]="kYes",e[e.kNo=1]="kNo"})(Ck||(Ck={}));var KQe=[{name:"em",unit_type:St.kEms},{name:"px",unit_type:St.kPixels},{name:"deg",unit_type:St.kDegrees},{name:"rad",unit_type:St.kRadians},{name:"grad",unit_type:St.kGradians},{name:"ms",unit_type:St.kMilliseconds},{name:"s",unit_type:St.kSeconds},{name:"rem",unit_type:St.kRems},{name:"turn",unit_type:St.kTurns}],If;(function(e){e[e.kUnknownType=0]="kUnknownType",e[e.kUnparsedType=1]="kUnparsedType",e[e.kKeywordType=2]="kKeywordType",e[e.kUnitType=3]="kUnitType",e[e.kSumType=4]="kSumType",e[e.kProductType=5]="kProductType",e[e.kNegateType=6]="kNegateType",e[e.kInvertType=7]="kInvertType",e[e.kMinType=8]="kMinType",e[e.kMaxType=9]="kMaxType",e[e.kClampType=10]="kClampType",e[e.kTransformType=11]="kTransformType",e[e.kPositionType=12]="kPositionType",e[e.kURLImageType=13]="kURLImageType",e[e.kColorType=14]="kColorType",e[e.kUnsupportedColorType=15]="kUnsupportedColorType"})(If||(If={}));var YQe=function(e){return KQe.find(function(t){return t.name===e}).unit_type},XQe=function(e){return e?e==="number"?St.kNumber:e==="percent"||e==="%"?St.kPercentage:YQe(e):St.kUnknown},ZQe=function(e){switch(e){case St.kNumber:case St.kInteger:return Ja.kUNumber;case St.kPercentage:return Ja.kUPercent;case St.kPixels:return Ja.kULength;case St.kMilliseconds:case St.kSeconds:return Ja.kUTime;case St.kDegrees:case St.kRadians:case St.kGradians:case St.kTurns:return Ja.kUAngle;default:return Ja.kUOther}},QQe=function(e){switch(e){case Ja.kUNumber:return St.kNumber;case Ja.kULength:return St.kPixels;case Ja.kUPercent:return St.kPercentage;case Ja.kUTime:return St.kSeconds;case Ja.kUAngle:return St.kDegrees;default:return St.kUnknown}},dne=function(e){var t=1;switch(e){case St.kPixels:case St.kDegrees:case St.kSeconds:break;case St.kMilliseconds:t=.001;break;case St.kRadians:t=180/Math.PI;break;case St.kGradians:t=.9;break;case St.kTurns:t=360;break}return t},Ok=function(e){switch(e){case St.kNumber:case St.kInteger:return"";case St.kPercentage:return"%";case St.kEms:return"em";case St.kRems:return"rem";case St.kPixels:return"px";case St.kDegrees:return"deg";case St.kRadians:return"rad";case St.kGradians:return"grad";case St.kMilliseconds:return"ms";case St.kSeconds:return"s";case St.kTurns:return"turn"}return""},cE=function(){function e(){}return e.isAngle=function(t){return t===St.kDegrees||t===St.kRadians||t===St.kGradians||t===St.kTurns},e.isLength=function(t){return t>=St.kEms&&t<St.kDegrees},e.isRelativeUnit=function(t){return t===St.kPercentage||t===St.kEms||t===St.kRems},e.isTime=function(t){return t===St.kSeconds||t===St.kMilliseconds},e.prototype.toString=function(){return this.buildCSSText(wk.kNo,Ck.kNo,"")},e.prototype.isNumericValue=function(){return this.getType()>=If.kUnitType&&this.getType()<=If.kClampType},e}(),JQe=function(e){Nt(t,e);function t(n){var r=e.call(this)||this;return r.colorSpace=n,r}return t.prototype.getType=function(){return If.kColorType},t.prototype.to=function(n){return this},t}(cE),Yl;(function(e){e[e.Constant=0]="Constant",e[e.LinearGradient=1]="LinearGradient",e[e.RadialGradient=2]="RadialGradient"})(Yl||(Yl={}));var uE=function(e){Nt(t,e);function t(n,r){var i=e.call(this)||this;return i.type=n,i.value=r,i}return t.prototype.clone=function(){return new t(this.type,this.value)},t.prototype.buildCSSText=function(n,r,i){return i},t.prototype.getType=function(){return If.kColorType},t}(cE),Ca=function(e){Nt(t,e);function t(n){var r=e.call(this)||this;return r.value=n,r}return t.prototype.clone=function(){return new t(this.value)},t.prototype.getType=function(){return If.kKeywordType},t.prototype.buildCSSText=function(n,r,i){return i+this.value},t}(cE),eJe=wo(function(e){return e===void 0&&(e=""),e.replace(/-([a-z])/g,function(t){return t[1].toUpperCase()})}),hne=function(e){return e.split("").map(function(t,n){return t.toUpperCase()===t?"".concat(n!==0?"-":"").concat(t.toLowerCase()):t}).join("")};function tJe(e){if(!e)throw new Error}function jg(e){return typeof e=="function"}function nJe(e){return typeof e=="symbol"}var rJe={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Ek=wo(function(e){var t=eJe(e),n=rJe[t];return t=(n==null?void 0:n.alias)||t,t}),iJe=function(e,t){t===void 0&&(t="");var n="";return Number.isFinite(e)?(tJe(Number.isNaN(e)),n="NaN"):e>0?n="infinity":n="-infinity",n+=t},_k=function(e){return QQe(ZQe(e))},gr=function(e){Nt(t,e);function t(n,r){r===void 0&&(r=St.kNumber);var i=e.call(this)||this,o;return typeof r=="string"?o=XQe(r):o=r,i.unit=o,i.value=n,i}return t.prototype.clone=function(){return new t(this.value,this.unit)},t.prototype.equals=function(n){var r=n;return this.value===r.value&&this.unit===r.unit},t.prototype.getType=function(){return If.kUnitType},t.prototype.convertTo=function(n){if(this.unit===n)return new t(this.value,this.unit);var r=_k(this.unit);if(r!==_k(n)||r===St.kUnknown)return null;var i=dne(this.unit)/dne(n);return new t(this.value*i,n)},t.prototype.buildCSSText=function(n,r,i){var o;switch(this.unit){case St.kUnknown:break;case St.kInteger:o=Number(this.value).toFixed(0);break;case St.kNumber:case St.kPercentage:case St.kEms:case St.kRems:case St.kPixels:case St.kDegrees:case St.kRadians:case St.kGradians:case St.kMilliseconds:case St.kSeconds:case St.kTurns:{var a=-999999,s=999999,l=this.value,c=Ok(this.unit);if(l<a||l>s){var u=Ok(this.unit);!Number.isFinite(l)||Number.isNaN(l)?o=iJe(l,u):o=l+(u||"")}else o="".concat(l).concat(c)}}return i+=o,i},t}(cE),gi=new gr(0,"px");new gr(1,"px");var Ps=new gr(0,"deg"),$k=function(e){Nt(t,e);function t(n,r,i,o,a){o===void 0&&(o=1),a===void 0&&(a=!1);var s=e.call(this,"rgb")||this;return s.r=n,s.g=r,s.b=i,s.alpha=o,s.isNone=a,s}return t.prototype.clone=function(){return new t(this.r,this.g,this.b,this.alpha)},t.prototype.buildCSSText=function(n,r,i){return i+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")},t}(JQe),Ar=new Ca("unset"),oJe=new Ca("initial"),aJe=new Ca("inherit"),Pk={"":Ar,unset:Ar,initial:oJe,inherit:aJe},Mk=function(e){return Pk[e]||(Pk[e]=new Ca(e)),Pk[e]},fE=new $k(0,0,0,0,!0),pne=new $k(0,0,0,0),sJe=wo(function(e,t,n,r){return new $k(e,t,n,r)},function(e,t,n,r){return"rgba(".concat(e,",").concat(t,",").concat(n,",").concat(r,")")}),Cr=function(e,t){return t===void 0&&(t=St.kNumber),new gr(e,t)};new gr(50,"%");var Tk;(function(e){e[e.Standard=0]="Standard"})(Tk||(Tk={}));var Dg;(function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED",e[e.Z_INDEX_CHANGED=2]="Z_INDEX_CHANGED"})(Dg||(Dg={}));var vne={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new _h(0,0,0,0)},Pt;(function(e){e.COORDINATE="<coordinate>",e.COLOR="<color>",e.PAINT="<paint>",e.NUMBER="<number>",e.ANGLE="<angle>",e.OPACITY_VALUE="<opacity-value>",e.SHADOW_BLUR="<shadow-blur>",e.LENGTH="<length>",e.PERCENTAGE="<percentage>",e.LENGTH_PERCENTAGE="<length> | <percentage>",e.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",e.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",e.LIST_OF_POINTS="<list-of-points>",e.PATH="<path>",e.FILTER="<filter>",e.Z_INDEX="<z-index>",e.OFFSET_DISTANCE="<offset-distance>",e.DEFINED_PATH="<defined-path>",e.MARKER="<marker>",e.TRANSFORM="<transform>",e.TRANSFORM_ORIGIN="<transform-origin>",e.TEXT="<text>",e.TEXT_TRANSFORM="<text-transform>"})(Pt||(Pt={}));function lJe(e){var t=e.type,n=e.value;return t==="hex"?"#".concat(n):t==="literal"?n:t==="rgb"?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}var cJe=function(){var e={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},t="";function n(k){throw new Error(t+": "+k)}function r(){var k=i();return t.length>0&&n("Invalid input not EOF"),k}function i(){return x(o)}function o(){return a("linear-gradient",e.linearGradient,l)||a("repeating-linear-gradient",e.repeatingLinearGradient,l)||a("radial-gradient",e.radialGradient,f)||a("repeating-radial-gradient",e.repeatingRadialGradient,f)||a("conic-gradient",e.conicGradient,f)}function a(k,A,j){return s(A,function(D){var L=j();return L&&(R(e.comma)||n("Missing comma before color stops")),{type:k,orientation:L,colorStops:x(S)}})}function s(k,A){var j=R(k);if(j){R(e.startCall)||n("Missing (");var D=A(j);return R(e.endCall)||n("Missing )"),D}}function l(){return c()||u()}function c(){return M("directional",e.sideOrCorner,1)}function u(){return M("angular",e.angleValue,1)}function f(){var k,A=d(),j;return A&&(k=[],k.push(A),j=t,R(e.comma)&&(A=d(),A?k.push(A):t=j)),k}function d(){var k=h()||p();if(k)k.at=g();else{var A=v();if(A){k=A;var j=g();j&&(k.at=j)}else{var D=m();D&&(k={type:"default-radial",at:D})}}return k}function h(){var k=M("shape",/^(circle)/i,0);return k&&(k.style=I()||v()),k}function p(){var k=M("shape",/^(ellipse)/i,0);return k&&(k.style=P()||v()),k}function v(){return M("extent-keyword",e.extentKeywords,1)}function g(){if(M("position",/^at/,0)){var k=m();return k||n("Missing positioning value"),k}}function m(){var k=y();if(k.x||k.y)return{type:"position",value:k}}function y(){return{x:P(),y:P()}}function x(k){var A=k(),j=[];if(A)for(j.push(A);R(e.comma);)A=k(),A?j.push(A):n("One extra comma");return j}function S(){var k=w();return k||n("Expected color definition"),k.length=P(),k}function w(){return O()||_()||E()||C()}function C(){return M("literal",e.literalColor,0)}function O(){return M("hex",e.hexColor,1)}function E(){return s(e.rgbColor,function(){return{type:"rgb",value:x($)}})}function _(){return s(e.rgbaColor,function(){return{type:"rgba",value:x($)}})}function $(){return R(e.number)[1]}function P(){return M("%",e.percentageValue,1)||T()||I()}function T(){return M("position-keyword",e.positionKeywords,1)}function I(){return M("px",e.pixelValue,1)||M("em",e.emValue,1)}function M(k,A,j){var D=R(A);if(D)return{type:k,value:D[j]}}function R(k){var A=/^[\n\r\t\s]+/.exec(t);A&&N(A[0].length);var j=k.exec(t);return j&&N(j[0].length),j}function N(k){t=t.substring(k)}return function(k){return t=k,r()}}();function uJe(e,t,n,r){var i=pr(r.value),o=0,a=0,s=o+t/2,l=a+n/2,c=Math.abs(t*Math.cos(i))+Math.abs(n*Math.sin(i)),u=e[0]+s-Math.cos(i)*c/2,f=e[1]+l-Math.sin(i)*c/2,d=e[0]+s+Math.cos(i)*c/2,h=e[1]+l+Math.sin(i)*c/2;return{x1:u,y1:f,x2:d,y2:h}}function fJe(e,t,n,r,i,o){var a=r.value,s=i.value;r.unit===St.kPercentage&&(a=r.value/100*t),i.unit===St.kPercentage&&(s=i.value/100*n);var l=Math.max(xa([0,0],[a,s]),xa([0,n],[a,s]),xa([t,n],[a,s]),xa([t,0],[a,s]));return o&&(o instanceof gr?l=o.value:o instanceof Ca&&(o.value==="closest-side"?l=Math.min(a,t-a,s,n-s):o.value==="farthest-side"?l=Math.max(a,t-a,s,n-s):o.value==="closest-corner"&&(l=Math.min(xa([0,0],[a,s]),xa([0,n],[a,s]),xa([t,n],[a,s]),xa([t,0],[a,s]))))),{x:a+e[0],y:s+e[1],r:l}}var dJe=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,hJe=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,pJe=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,gne=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;function vJe(e){var t,n,r,i=e.length;e[i-1].length=(t=e[i-1].length)!==null&&t!==void 0?t:{type:"%",value:"100"},i>1&&(e[0].length=(n=e[0].length)!==null&&n!==void 0?n:{type:"%",value:"0"});for(var o=0,a=Number(e[0].length.value),s=1;s<i;s++){var l=(r=e[s].length)===null||r===void 0?void 0:r.value;if(!hn(l)&&!hn(a)){for(var c=1;c<s-o;c++)e[o+c].length={type:"%",value:"".concat(a+(Number(l)-a)*c/(s-o))};o=s,a=Number(l)}}}var gJe={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},mJe=wo(function(e){var t;return e.type==="angular"?t=Number(e.value):t=gJe[e.value]||0,Cr(t,"deg")}),yJe=wo(function(e){var t=50,n=50,r="%",i="%";if((e==null?void 0:e.type)==="position"){var o=e.value,a=o.x,s=o.y;(a==null?void 0:a.type)==="position-keyword"&&(a.value==="left"?t=0:a.value==="center"?t=50:a.value==="right"?t=100:a.value==="top"?n=0:a.value==="bottom"&&(n=100)),(s==null?void 0:s.type)==="position-keyword"&&(s.value==="left"?t=0:s.value==="center"?n=50:s.value==="right"?t=100:s.value==="top"?n=0:s.value==="bottom"&&(n=100)),((a==null?void 0:a.type)==="px"||(a==null?void 0:a.type)==="%"||(a==null?void 0:a.type)==="em")&&(r=a==null?void 0:a.type,t=Number(a.value)),((s==null?void 0:s.type)==="px"||(s==null?void 0:s.type)==="%"||(s==null?void 0:s.type)==="em")&&(i=s==null?void 0:s.type,n=Number(s.value))}return{cx:Cr(t,r),cy:Cr(n,i)}}),bJe=wo(function(e){var t;if(e.indexOf("linear")>-1||e.indexOf("radial")>-1){var n=cJe(e);return n.map(function(s){var l=s.type,c=s.orientation,u=s.colorStops;vJe(u);var f=u.map(function(x){return{offset:Cr(Number(x.length.value),"%"),color:lJe(x)}});if(l==="linear-gradient")return new uE(Yl.LinearGradient,{angle:c?mJe(c):Ps,steps:f});if(l==="radial-gradient"&&(c||(c=[{type:"shape",value:"circle"}]),c[0].type==="shape"&&c[0].value==="circle")){var d=yJe(c[0].at),h=d.cx,p=d.cy,v=void 0;if(c[0].style){var g=c[0].style,m=g.type,y=g.value;m==="extent-keyword"?v=Mk(y):v=Cr(y,m)}return new uE(Yl.RadialGradient,{cx:h,cy:p,size:v,steps:f})}})}var r=e[0];if(e[1]==="("||e[2]==="("){if(r==="l"){var i=dJe.exec(e);if(i){var o=((t=i[2].match(gne))===null||t===void 0?void 0:t.map(function(s){return s.split(":")}))||[];return[new uE(Yl.LinearGradient,{angle:Cr(parseFloat(i[1]),"deg"),steps:o.map(function(s){var l=se(s,2),c=l[0],u=l[1];return{offset:Cr(Number(c)*100,"%"),color:u}})})]}}else if(r==="r"){var a=xJe(e);if(a)if(Wr(a))e=a;else return[new uE(Yl.RadialGradient,a)]}else if(r==="p")return SJe(e)}});function xJe(e){var t,n=hJe.exec(e);if(n){var r=((t=n[4].match(gne))===null||t===void 0?void 0:t.map(function(i){return i.split(":")}))||[];return{cx:Cr(50,"%"),cy:Cr(50,"%"),steps:r.map(function(i){var o=se(i,2),a=o[0],s=o[1];return{offset:Cr(Number(a)*100,"%"),color:s}})}}return null}function SJe(e){var t=pJe.exec(e);if(t){var n=t[1],r=t[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;case"n":n="no-repeat";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}function ib(e){return e&&!!e.image}function dE(e){return e&&!hn(e.r)&&!hn(e.g)&&!hn(e.b)}var tu=wo(function(e){if(ib(e))return ke({repetition:"repeat"},e);if(hn(e)&&(e=""),e==="transparent")return pne;if(e==="currentColor")e="black";else if(e==="none")return fE;var t=bJe(e);if(t)return t;var n=rE(e),r=[0,0,0,0];return n!==null&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),sJe.apply(void 0,it([],se(r),!1))});function wJe(e,t){if(!(!dE(e)||!dE(t)))return[[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],function(n){var r=n.slice();if(r[3])for(var i=0;i<3;i++)r[i]=Math.round(ai(r[i],0,255));return r[3]=ai(r[3],0,1),"rgba(".concat(r.join(","),")")}]}function ob(e,t){if(hn(t))return Cr(0,"px");if(t="".concat(t).trim().toLowerCase(),isFinite(Number(t))){if("px".search(e)>=0)return Cr(Number(t),"px");if("deg".search(e)>=0)return Cr(Number(t),"deg")}var n=[];t=t.replace(e,function(i){return n.push(i),"U"+i});var r="U("+e.source+")";return n.map(function(i){return Cr(Number(t.replace(new RegExp("U"+i,"g"),"").replace(new RegExp(r,"g"),"*0")),i)})[0]}var mne=function(e){return ob(new RegExp("px","g"),e)},CJe=wo(mne),OJe=function(e){return ob(new RegExp("%","g"),e)};wo(OJe);var ab=function(e){return _r(e)||isFinite(Number(e))?Cr(Number(e)||0,"px"):ob(new RegExp("px|%|em|rem","g"),e)},Fg=wo(ab),Ik=function(e){return ob(new RegExp("deg|rad|grad|turn","g"),e)},yne=wo(Ik);function EJe(e,t,n,r,i){i===void 0&&(i=0);var o="",a=e.value||0,s=t.value||0,l=_k(e.unit),c=e.convertTo(l),u=t.convertTo(l);return c&&u?(a=c.value,s=u.value,o=Ok(e.unit)):(gr.isLength(e.unit)||gr.isLength(t.unit))&&(a=es(e,i,n),s=es(t,i,n),o="px"),[a,s,function(f){return f+o}]}function Oa(e){var t=0;return e.unit===St.kDegrees?t=e.value:e.unit===St.kRadians?t=$s(Number(e.value)):e.unit===St.kTurns&&(t=jQe(Number(e.value))),t}function bne(e,t){var n;return Array.isArray(e)?n=e.map(function(r){return Number(r)}):Wr(e)?n=e.split(" ").map(function(r){return Number(r)}):_r(e)&&(n=[e]),t===2?n.length===1?[n[0],n[0]]:[n[0],n[1]]:n.length===1?[n[0],n[0],n[0],n[0]]:n.length===2?[n[0],n[1],n[0],n[1]]:n.length===3?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function xne(e){return Wr(e)?e.split(" ").map(function(t){return Fg(t)}):e.map(function(t){return Fg(t.toString())})}function es(e,t,n,r){if(r===void 0&&(r=!1),e.unit===St.kPixels)return Number(e.value);if(e.unit===St.kPercentage&&n){var i=n.nodeName===Ze.GROUP?n.getLocalBounds():n.getGeometryBounds();return(r?i.min[t]:0)+e.value/100*i.halfExtents[t]*2}return 0}var _Je=function(e){return ob(/deg|rad|grad|turn|px|%/g,e)},$Je=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Sne(e){if(e===void 0&&(e=""),e=e.toLowerCase().trim(),e==="none")return[];for(var t=/\s*([\w-]+)\(([^)]*)\)/g,n=[],r,i=0;r=t.exec(e);){if(r.index!==i)return[];if(i=r.index+r[0].length,$Je.indexOf(r[1])>-1&&n.push({name:r[1],params:r[2].split(" ").map(function(o){return _Je(o)||tu(o)})}),t.lastIndex===e.length)return n}return[]}function wne(e){return e.toString()}var Bg=function(e){return typeof e=="number"?Cr(e):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(e)?Cr(Number(e)):Cr(0)},$h=wo(Bg);wo(function(e){return Wr(e)?e.split(" ").map($h):e.map($h)});function Rk(e,t){return[e,t,wne]}function Nk(e,t){return function(n,r){return[n,r,function(i){return wne(ai(i,e,t))}]}}function Cne(e,t){if(e.length===t.length)return[e,t,function(n){return n}]}function kk(e){return e.parsedStyle.d.totalLength===0&&(e.parsedStyle.d.totalLength=zKe(e.parsedStyle.d.absolutePath)),e.parsedStyle.d.totalLength}function PJe(e){return e.parsedStyle.points.totalLength===0&&(e.parsedStyle.points.totalLength=PQe(e.parsedStyle.points.points)),e.parsedStyle.points.totalLength}function MJe(e){for(var t=0;t<e.length;t++){var n=e[t-1],r=e[t],i=r[0];if(i==="M"&&n){var o=n[0],a=[r[1],r[2]],s=void 0;o==="L"||o==="M"?s=[n[1],n[2]]:(o==="C"||o==="A"||o==="Q")&&(s=[n[n.length-2],n[n.length-1]]),s&&hE(a,s)&&(e.splice(t,1),t--)}}}function TJe(e){for(var t=!1,n=e.length,r=0;r<n;r++){var i=e[r],o=i[0];if(o==="C"||o==="A"||o==="Q"){t=!0;break}}return t}function IJe(e){for(var t=[],n=[],r=[],i=0;i<e.length;i++){var o=e[i],a=o[0];a==="M"?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):a==="Z"?r.length&&(t.push(r),r=[]):r.push([o[1],o[2]])}return r.length>0&&n.push(r),{polygons:t,polylines:n}}function hE(e,t){return e[0]===t[0]&&e[1]===t[1]}function RJe(e,t){for(var n=[],r=[],i=[],o=0;o<e.length;o++){var a=e[o],s=a.currentPoint,l=a.params,c=a.prePoint,u=void 0;switch(a.command){case"Q":u=MQe(c[0],c[1],l[1],l[2],l[3],l[4]);break;case"C":u=EQe(c[0],c[1],l[1],l[2],l[3],l[4],l[5],l[6]);break;case"A":var f=a.arcParams;u=wQe(f.cx,f.cy,f.rx,f.ry,f.xRotation,f.startAngle,f.endAngle);break;default:n.push(s[0]),r.push(s[1]);break}u&&(a.box=u,n.push(u.x,u.x+u.width),r.push(u.y,u.y+u.height))}n=n.filter(function(m){return!Number.isNaN(m)&&m!==1/0&&m!==-1/0}),r=r.filter(function(m){return!Number.isNaN(m)&&m!==1/0&&m!==-1/0});var d=vO(n),h=vO(r),p=pO(n),v=pO(r);if(i.length===0)return{x:d,y:h,width:p-d,height:v-h};for(var o=0;o<i.length;o++){var a=i[o],s=a.currentPoint,g=void 0;s[0]===d?(g=pE(a,t),d=d-g.xExtra):s[0]===p&&(g=pE(a,t),p=p+g.xExtra),s[1]===h?(g=pE(a,t),h=h-g.yExtra):s[1]===v&&(g=pE(a,t),v=v+g.yExtra)}return{x:d,y:h,width:p-d,height:v-h}}function pE(e,t){var n=e.prePoint,r=e.currentPoint,i=e.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),l=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!l||Math.sin(l)===0||O1(l,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),u=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));c=c>Math.PI/2?Math.PI-c:c,u=u>Math.PI/2?Math.PI-u:u;var f={xExtra:Math.cos(l/2-c)*(t/2*(1/Math.sin(l/2)))-t/2||0,yExtra:Math.cos(u-l/2)*(t/2*(1/Math.sin(l/2)))-t/2||0};return f}function One(e,t){return[t[0]+(t[0]-e[0]),t[1]+(t[1]-e[1])]}var Ene=function(e,t){var n=e.x*t.x+e.y*t.y,r=Math.sqrt((Math.pow(e.x,2)+Math.pow(e.y,2))*(Math.pow(t.x,2)+Math.pow(t.y,2))),i=e.x*t.y-e.y*t.x<0?-1:1,o=i*Math.acos(n/r);return o},_ne=function(e,t,n,r,i,o,a,s){t=Math.abs(t),n=Math.abs(n),r=UQ(r,360);var l=pr(r);if(e.x===a.x&&e.y===a.y)return{x:e.x,y:e.y,ellipticalArcAngle:0};if(t===0||n===0)return{x:0,y:0,ellipticalArcAngle:0};var c=(e.x-a.x)/2,u=(e.y-a.y)/2,f={x:Math.cos(l)*c+Math.sin(l)*u,y:-Math.sin(l)*c+Math.cos(l)*u},d=Math.pow(f.x,2)/Math.pow(t,2)+Math.pow(f.y,2)/Math.pow(n,2);d>1&&(t=Math.sqrt(d)*t,n=Math.sqrt(d)*n);var h=Math.pow(t,2)*Math.pow(n,2)-Math.pow(t,2)*Math.pow(f.y,2)-Math.pow(n,2)*Math.pow(f.x,2),p=Math.pow(t,2)*Math.pow(f.y,2)+Math.pow(n,2)*Math.pow(f.x,2),v=h/p;v=v<0?0:v;var g=(i!==o?1:-1)*Math.sqrt(v),m={x:g*(t*f.y/n),y:g*(-(n*f.x)/t)},y={x:Math.cos(l)*m.x-Math.sin(l)*m.y+(e.x+a.x)/2,y:Math.sin(l)*m.x+Math.cos(l)*m.y+(e.y+a.y)/2},x={x:(f.x-m.x)/t,y:(f.y-m.y)/n},S=Ene({x:1,y:0},x),w={x:(-f.x-m.x)/t,y:(-f.y-m.y)/n},C=Ene(x,w);!o&&C>0?C-=2*Math.PI:o&&C<0&&(C+=2*Math.PI),C%=2*Math.PI;var O=S+C*s,E=t*Math.cos(O),_=n*Math.sin(O),$={x:Math.cos(l)*E-Math.sin(l)*_+y.x,y:Math.sin(l)*E+Math.cos(l)*_+y.y,ellipticalArcStartAngle:S,ellipticalArcEndAngle:S+C,ellipticalArcAngle:O,ellipticalArcCenter:y,resultantRx:t,resultantRy:n};return $};function NJe(e){for(var t=[],n=null,r=null,i=null,o=0,a=e.length,s=0;s<a;s++){var l=e[s];r=e[s+1];var c=l[0],u={command:c,prePoint:n,params:l,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(c){case"M":i=[l[1],l[2]],o=s;break;case"A":var f=kJe(n,l);u.arcParams=f;break}if(c==="Z")n=i,r=e[o+1];else{var d=l.length;n=[l[d-2],l[d-1]]}r&&r[0]==="Z"&&(r=e[o],t[o]&&(t[o].prePoint=n)),u.currentPoint=n,t[o]&&hE(n,t[o].currentPoint)&&(t[o].prePoint=u.prePoint);var h=r?[r[r.length-2],r[r.length-1]]:null;u.nextPoint=h;var p=u.prePoint;if(["L","H","V"].includes(c))u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]];else if(c==="Q"){var v=[l[1],l[2]];u.startTangent=[p[0]-v[0],p[1]-v[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]]}else if(c==="T"){var g=t[s-1],v=One(g.currentPoint,p);g.command==="Q"?(u.command="Q",u.startTangent=[p[0]-v[0],p[1]-v[1]],u.endTangent=[n[0]-v[0],n[1]-v[1]]):(u.command="TL",u.startTangent=[p[0]-n[0],p[1]-n[1]],u.endTangent=[n[0]-p[0],n[1]-p[1]])}else if(c==="C"){var m=[l[1],l[2]],y=[l[3],l[4]];u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]],u.startTangent[0]===0&&u.startTangent[1]===0&&(u.startTangent=[m[0]-y[0],m[1]-y[1]]),u.endTangent[0]===0&&u.endTangent[1]===0&&(u.endTangent=[y[0]-m[0],y[1]-m[1]])}else if(c==="S"){var g=t[s-1],m=One(g.currentPoint,p),y=[l[1],l[2]];g.command==="C"?(u.command="C",u.startTangent=[p[0]-m[0],p[1]-m[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]]):(u.command="SQ",u.startTangent=[p[0]-y[0],p[1]-y[1]],u.endTangent=[n[0]-y[0],n[1]-y[1]])}else if(c==="A"){var x=$ne(u,0),S=x.x,w=x.y,C=$ne(u,1,!1),O=C.x,E=C.y;u.startTangent=[S,w],u.endTangent=[O,E]}t.push(u)}return t}function $ne(e,t,n){n===void 0&&(n=!0);var r=e.arcParams,i=r.rx,o=i===void 0?0:i,a=r.ry,s=a===void 0?0:a,l=r.xRotation,c=r.arcFlag,u=r.sweepFlag,f=_ne({x:e.prePoint[0],y:e.prePoint[1]},o,s,l,!!c,!!u,{x:e.currentPoint[0],y:e.currentPoint[1]},t),d=_ne({x:e.prePoint[0],y:e.prePoint[1]},o,s,l,!!c,!!u,{x:e.currentPoint[0],y:e.currentPoint[1]},n?t+.005:t-.005),h=d.x-f.x,p=d.y-f.y,v=Math.sqrt(h*h+p*p);return{x:-h/v,y:-p/v}}function vE(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Ak(e,t){return vE(e)*vE(t)?(e[0]*t[0]+e[1]*t[1])/(vE(e)*vE(t)):1}function Pne(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(Ak(e,t))}function kJe(e,t){var n=t[1],r=t[2],i=UQ(pr(t[3]),Math.PI*2),o=t[4],a=t[5],s=e[0],l=e[1],c=t[6],u=t[7],f=Math.cos(i)*(s-c)/2+Math.sin(i)*(l-u)/2,d=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(l-u)/2,h=f*f/(n*n)+d*d/(r*r);h>1&&(n*=Math.sqrt(h),r*=Math.sqrt(h));var p=n*n*(d*d)+r*r*(f*f),v=p?Math.sqrt((n*n*(r*r)-p)/p):1;o===a&&(v*=-1),isNaN(v)&&(v=0);var g=r?v*n*d/r:0,m=n?v*-r*f/n:0,y=(s+c)/2+Math.cos(i)*g-Math.sin(i)*m,x=(l+u)/2+Math.sin(i)*g+Math.cos(i)*m,S=[(f-g)/n,(d-m)/r],w=[(-1*f-g)/n,(-1*d-m)/r],C=Pne([1,0],S),O=Pne(S,w);return Ak(S,w)<=-1&&(O=Math.PI),Ak(S,w)>=1&&(O=0),a===0&&O>0&&(O=O-2*Math.PI),a===1&&O<0&&(O=O+2*Math.PI),{cx:y,cy:x,rx:hE(e,[c,u])?0:n,ry:hE(e,[c,u])?0:r,startAngle:C,endAngle:C+O,xRotation:i,arcFlag:o,sweepFlag:a}}function AJe(e,t,n){return e.reduce(function(r,i){var o="";if(i[0]==="M"||i[0]==="L"){var a=Un(i[1],i[2],0);n&&Zi(a,a,n),o="".concat(i[0]).concat(a[0],",").concat(a[1])}else if(i[0]==="Z")o=i[0];else if(i[0]==="C"){var s=Un(i[1],i[2],0),l=Un(i[3],i[4],0),c=Un(i[5],i[6],0);n&&(Zi(s,s,n),Zi(l,l,n),Zi(c,c,n)),o="".concat(i[0]).concat(s[0],",").concat(s[1],",").concat(l[0],",").concat(l[1],",").concat(c[0],",").concat(c[1])}else if(i[0]==="A"){var u=Un(i[6],i[7],0);n&&Zi(u,u,n),o="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],",").concat(i[5],",").concat(u[0],",").concat(u[1])}else if(i[0]==="Q"){var s=Un(i[1],i[2],0),l=Un(i[3],i[4],0);n&&(Zi(s,s,n),Zi(l,l,n)),o="".concat(i[0]).concat(i[1],",").concat(i[2],",").concat(i[3],",").concat(i[4],"}")}return r+=o},"")}function LJe(e,t,n,r){return[["M",e,t],["L",n,r]]}function Mne(e,t,n,r){var i=(-1+Math.sqrt(2))/3*4,o=e*i,a=t*i,s=n-e,l=n+e,c=r-t,u=r+t;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,l,r-a,l,r],["C",l,r+a,n+o,u,n,u],["C",n-o,u,s,r+a,s,r],["Z"]]}function jJe(e,t){var n=e.map(function(r,i){return[i===0?"M":"L",r[0],r[1]]});return t&&n.push(["Z"]),n}function DJe(e,t,n,r,i){if(i){var o=se(i,4),a=o[0],s=o[1],l=o[2],c=o[3],u=e>0?1:-1,f=t>0?1:-1,d=u+f!==0?1:0;return[["M",u*a+n,r],["L",e-u*s+n,r],s?["A",s,s,0,0,d,e+n,f*s+r]:null,["L",e+n,t-f*l+r],l?["A",l,l,0,0,d,e+n-u*l,t+r]:null,["L",n+u*c,t+r],c?["A",c,c,0,0,d,n,t+r-f*c]:null,["L",n,f*a+r],a?["A",a,a,0,0,d,u*a+n,r]:null,["Z"]].filter(function(h){return h})}return[["M",n,r],["L",n+e,r],["L",n+e,r+t],["L",n,r+t],["Z"]]}function Tne(e,t){t===void 0&&(t=e.getLocalTransform());var n=[];switch(e.nodeName){case Ze.LINE:var r=e.parsedStyle,i=r.x1,o=i===void 0?0:i,a=r.y1,s=a===void 0?0:a,l=r.x2,c=l===void 0?0:l,u=r.y2,f=u===void 0?0:u;n=LJe(o,s,c,f);break;case Ze.CIRCLE:{var d=e.parsedStyle,h=d.r,p=h===void 0?0:h,v=d.cx,g=v===void 0?0:v,m=d.cy,y=m===void 0?0:m;n=Mne(p,p,g,y);break}case Ze.ELLIPSE:{var x=e.parsedStyle,S=x.rx,w=S===void 0?0:S,C=x.ry,O=C===void 0?0:C,E=x.cx,g=E===void 0?0:E,_=x.cy,y=_===void 0?0:_;n=Mne(w,O,g,y);break}case Ze.POLYLINE:case Ze.POLYGON:var $=e.parsedStyle.points;n=jJe($.points,e.nodeName===Ze.POLYGON);break;case Ze.RECT:var P=e.parsedStyle,T=P.width,I=T===void 0?0:T,M=P.height,R=M===void 0?0:M,N=P.x,k=N===void 0?0:N,A=P.y,j=A===void 0?0:A,D=P.radius,L=D&&D.some(function(B){return B!==0});n=DJe(I,R,k,j,L&&D.map(function(B){return ai(B,0,Math.min(Math.abs(I)/2,Math.abs(R)/2))}));break;case Ze.PATH:var F=e.parsedStyle.d.absolutePath;n=it([],se(F),!1);break}if(n.length)return AJe(n,e,t)}var Ine=function(e){if(e===""||Array.isArray(e)&&e.length===0)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var t;try{t=OO(e)}catch(d){t=OO(""),console.error("[g]: Invalid SVG Path definition: ".concat(e))}MJe(t);var n=TJe(t),r=IJe(t),i=r.polygons,o=r.polylines,a=NJe(t),s=RJe(a,0),l=s.x,c=s.y,u=s.width,f=s.height;return{absolutePath:t,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(l)?l:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(u)?u:0,height:Number.isFinite(f)?f:0}}},FJe=wo(Ine);function Lk(e){return Wr(e)?FJe(e):Ine(e)}function BJe(e,t,n){var r=e.curve,i=t.curve;(!r||r.length===0)&&(r=SN(e.absolutePath,!1),e.curve=r),(!i||i.length===0)&&(i=SN(t.absolutePath,!1),t.curve=i);var o=[r,i];r.length!==i.length&&(o=TJ(r,i));var a=PJ(o[0])!==PJ(o[1])?AKe(o[0]):kKe(o[0]);return[a,WKe(o[1],a),function(s){return s}]}function Rne(e,t){var n;return Wr(e)?n=e.split(" ").map(function(r){var i=se(r.split(","),2),o=i[0],a=i[1];return[Number(o),Number(a)]}):n=e,{points:n,totalLength:0,segments:[]}}function zJe(e,t){return[e.points,t.points,function(n){return n}]}var ci=null;function Ea(e){return function(t){var n=0;return e.map(function(r){return r===ci?t[n++]:r})}}function Ph(e){return e}var gE={matrix:["NNNNNN",[ci,ci,0,0,ci,ci,0,0,0,0,1,0,ci,ci,0,1],Ph],matrix3d:["NNNNNNNNNNNNNNNN",Ph],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Ea([ci,ci,new gr(1)]),Ph],scalex:["N",Ea([ci,new gr(1),new gr(1)]),Ea([ci,new gr(1)])],scaley:["N",Ea([new gr(1),ci,new gr(1)]),Ea([new gr(1),ci])],scalez:["N",Ea([new gr(1),new gr(1),ci])],scale3d:["NNN",Ph],skew:["Aa",null,Ph],skewx:["A",null,Ea([ci,Ps])],skewy:["A",null,Ea([Ps,ci])],translate:["Tt",Ea([ci,ci,gi]),Ph],translatex:["T",Ea([ci,gi,gi]),Ea([ci,gi])],translatey:["T",Ea([gi,ci,gi]),Ea([gi,ci])],translatez:["L",Ea([gi,gi,ci])],translate3d:["TTL",Ph]};function jk(e){if(e=(e||"none").toLowerCase().trim(),e==="none")return[];for(var t=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=t.exec(e);){if(r.index!==i)return[];i=r.index+r[0].length;var o=r[1],a=gE[o];if(!a)return[];var s=r[2].split(","),l=a[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var f=s[u],d=l[u],h=void 0;if(f?h={A:function(p){return p.trim()==="0"?Ps:yne(p)},N:$h,T:Fg,L:CJe}[d.toUpperCase()](f):h={a:Ps,n:c[0],t:gi}[d],h===void 0)return[];c.push(h)}if(n.push({t:o,d:c}),t.lastIndex===e.length)return n}return[]}function Nne(e){if(e=(e||"none").toLowerCase().trim(),e==="none")return[];for(var t=/\s*(\w+)\(([^)]*)\)/g,n=[],r,i=0;r=t.exec(e);){if(r.index!==i)return[];i=r.index+r[0].length;var o=r[1],a=gE[o];if(!a)return[];var s=r[2].split(","),l=a[0];if(l.length<s.length)return[];for(var c=[],u=0;u<l.length;u++){var f=s[u],d=l[u],h=void 0;if(f?h={A:function(p){return p.trim()==="0"?Ps:Ik(p)},N:Bg,T:ab,L:mne}[d.toUpperCase()](f):h={a:Ps,n:c[0],t:gi}[d],h===void 0)return[];c.push(h)}if(n.push({t:o,d:c}),t.lastIndex===e.length)return n}return[]}function HJe(e){var t,n,r,i;switch(e.t){case"rotatex":return i=pr(Oa(e.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=pr(Oa(e.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=pr(Oa(e.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":t=e.d[0].value,n=e.d[1].value,r=e.d[2].value,i=pr(Oa(e.d[3]));var o=t*t+n*n+r*r;if(o===0)t=1,n=0,r=0;else if(o!==1){var a=Math.sqrt(o);t/=a,n/=a,r/=a}var s=Math.sin(i/2),l=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(t*n*c+r*l),2*(t*r*c-n*l),0,2*(t*n*c-r*l),1-2*(t*t+r*r)*c,2*(n*r*c+t*l),0,2*(t*r*c+n*l),2*(n*r*c-t*l),1-2*(t*t+n*n)*c,0,0,0,0,1];case"scale":return[e.d[0].value,0,0,0,0,e.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[e.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,e.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,e.d[0].value,0,0,0,0,1];case"scale3d":return[e.d[0].value,0,0,0,0,e.d[1].value,0,0,0,0,e.d[2].value,0,0,0,0,1];case"skew":var u=pr(Oa(e.d[0])),f=pr(Oa(e.d[1]));return[1,Math.tan(f),0,0,Math.tan(u),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=pr(Oa(e.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=pr(Oa(e.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return t=es(e.d[0],0,null)||0,n=es(e.d[1],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,n,0,1];case"translatex":return t=es(e.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,0,0,1];case"translatey":return n=es(e.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,n,0,1];case"translatez":return r=es(e.d[0],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r,1];case"translate3d":return t=es(e.d[0],0,null)||0,n=es(e.d[1],0,null)||0,r=es(e.d[2],0,null)||0,[1,0,0,0,0,1,0,0,0,0,1,0,t,n,r,1];case"perspective":var d=es(e.d[0],0,null)||0,h=d?-1/d:0;return[1,0,0,0,0,1,0,0,0,0,1,h,0,0,0,1];case"matrix":return[e.d[0].value,e.d[1].value,0,0,e.d[2].value,e.d[3].value,0,0,0,0,1,0,e.d[4].value,e.d[5].value,0,1];case"matrix3d":return e.d.map(function(p){return p.value})}}function WJe(e,t){return[e[0]*t[0]+e[4]*t[1]+e[8]*t[2]+e[12]*t[3],e[1]*t[0]+e[5]*t[1]+e[9]*t[2]+e[13]*t[3],e[2]*t[0]+e[6]*t[1]+e[10]*t[2]+e[14]*t[3],e[3]*t[0]+e[7]*t[1]+e[11]*t[2]+e[15]*t[3],e[0]*t[4]+e[4]*t[5]+e[8]*t[6]+e[12]*t[7],e[1]*t[4]+e[5]*t[5]+e[9]*t[6]+e[13]*t[7],e[2]*t[4]+e[6]*t[5]+e[10]*t[6]+e[14]*t[7],e[3]*t[4]+e[7]*t[5]+e[11]*t[6]+e[15]*t[7],e[0]*t[8]+e[4]*t[9]+e[8]*t[10]+e[12]*t[11],e[1]*t[8]+e[5]*t[9]+e[9]*t[10]+e[13]*t[11],e[2]*t[8]+e[6]*t[9]+e[10]*t[10]+e[14]*t[11],e[3]*t[8]+e[7]*t[9]+e[11]*t[10]+e[15]*t[11],e[0]*t[12]+e[4]*t[13]+e[8]*t[14]+e[12]*t[15],e[1]*t[12]+e[5]*t[13]+e[9]*t[14]+e[13]*t[15],e[2]*t[12]+e[6]*t[13]+e[10]*t[14]+e[14]*t[15],e[3]*t[12]+e[7]*t[13]+e[11]*t[14]+e[15]*t[15]]}function VJe(e){return e.length===0?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:e.map(HJe).reduce(WJe)}function kne(e){var t=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return HQe(VJe(e),t,n,r,i,o),[[t,n,r,o,i]]}var UJe=function(){function e(r,i){for(var o=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],a=0;a<4;a++)for(var s=0;s<4;s++)for(var l=0;l<4;l++)o[a][s]+=i[a][l]*r[l][s];return o}function t(r){return r[0][2]==0&&r[0][3]==0&&r[1][2]==0&&r[1][3]==0&&r[2][0]==0&&r[2][1]==0&&r[2][2]==1&&r[2][3]==0&&r[3][2]==0&&r[3][3]==1}function n(r,i,o,a,s){for(var l=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],c=0;c<4;c++)l[c][3]=s[c];for(var c=0;c<3;c++)for(var u=0;u<3;u++)l[3][c]+=r[u]*l[u][c];var f=a[0],d=a[1],h=a[2],p=a[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(d*d+h*h),v[0][1]=2*(f*d-h*p),v[0][2]=2*(f*h+d*p),v[1][0]=2*(f*d+h*p),v[1][1]=1-2*(f*f+h*h),v[1][2]=2*(d*h-f*p),v[2][0]=2*(f*h-d*p),v[2][1]=2*(d*h+f*p),v[2][2]=1-2*(f*f+d*d),l=e(l,v);var g=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];o[2]&&(g[2][1]=o[2],l=e(l,g)),o[1]&&(g[2][1]=0,g[2][0]=o[0],l=e(l,g)),o[0]&&(g[2][0]=0,g[1][0]=o[0],l=e(l,g));for(var c=0;c<3;c++)for(var u=0;u<3;u++)l[c][u]*=i[c];return t(l)?[l[0][0],l[0][1],l[1][0],l[1][1],l[3][0],l[3][1]]:l[0].concat(l[1],l[2],l[3])}return n}();function qJe(e){return e.toFixed(6).replace(".000000","")}function Dk(e,t){var n,r;return e.decompositionPair!==t&&(e.decompositionPair=t,n=kne(e)),t.decompositionPair!==e&&(t.decompositionPair=e,r=kne(t)),n[0]===null||r[0]===null?[[!1],[!0],function(i){return i?t[0].d:e[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(i){var o=KJe(n[0][3],r[0][3],i[5]),a=UJe(i[0],i[1],i[2],o,i[4]),s=a.map(qJe).join(",");return s}])}function GJe(e,t){for(var n=0,r=0;r<e.length;r++)n+=e[r]*t[r];return n}function KJe(e,t,n){var r=GJe(e,t);r=ai(r,-1,1);var i=[];if(r===1)i=e;else for(var o=Math.acos(r),a=Math.sin(n*o)*1/Math.sqrt(1-r*r),s=0;s<4;s++)i.push(e[s]*(Math.cos(n*o)-r*a)+t[s]*a);return i}function Fk(e){return e.replace(/[xy]/,"")}function Bk(e){return e.replace(/(x|y|z|3d)?$/,"3d")}var YJe=function(e,t){return e==="perspective"&&t==="perspective"||(e==="matrix"||e==="matrix3d")&&(t==="matrix"||t==="matrix3d")};function XJe(e,t,n){var r=!1;if(!e.length||!t.length){e.length||(r=!0,e=t,t=[]);for(var i=function(C){var O=e[C],E=O.t,_=O.d,$=E.substring(0,5)==="scale"?1:0;t.push({t:E,d:_.map(function(P){return typeof P=="number"?Cr($):Cr($,P.unit)})})},o=0;o<e.length;o++)i(o)}var a=[],s=[],l=[];if(e.length!==t.length){var c=Dk(e,t);a=[c[0]],s=[c[1]],l=[["matrix",[c[2]]]]}else for(var o=0;o<e.length;o++){var u=e[o].t,f=t[o].t,d=e[o].d,h=t[o].d,p=gE[u],v=gE[f],g=void 0;if(YJe(u,f)){var c=Dk([e[o]],[t[o]]);a.push(c[0]),s.push(c[1]),l.push(["matrix",[c[2]]]);continue}else if(u===f)g=u;else if(p[2]&&v[2]&&Fk(u)===Fk(f))g=Fk(u),d=p[2](d),h=v[2](h);else if(p[1]&&v[1]&&Bk(u)===Bk(f))g=Bk(u),d=p[1](d),h=v[1](h);else{var c=Dk(e,t);a=[c[0]],s=[c[1]],l=[["matrix",[c[2]]]];break}for(var m=[],y=[],x=[],S=0;S<d.length;S++){var c=EJe(d[S],h[S],n,!1,S);m[S]=c[0],y[S]=c[1],x.push(c[2])}a.push(m),s.push(y),l.push([g,x])}if(r){var w=a;a=s,s=w}return[a,s,function(C){return C.map(function(O,E){var _=O.map(function($,P){return l[E][1][P]($)}).join(",");return l[E][0]==="matrix"&&_.split(",").length===16&&(l[E][0]="matrix3d"),l[E][0]==="matrix3d"&&_.split(",").length===6&&(l[E][0]="matrix"),l[E][0]+"("+_+")"}).join(" ")}]}var Ane=wo(function(e){if(Wr(e)){if(e==="text-anchor")return[Cr(0,"px"),Cr(0,"px")];var t=e.split(" ");return t.length===1&&(t[0]==="top"||t[0]==="bottom"?(t[1]=t[0],t[0]="center"):t[1]="center"),t.length!==2?null:[Fg(mE(t[0])),Fg(mE(t[1]))]}else return[Cr(e[0]||0,"px"),Cr(e[1]||0,"px")]}),ZJe=function(e){if(Wr(e)){if(e==="text-anchor")return[Cr(0,"px"),Cr(0,"px")];var t=e.split(" ");return t.length===1&&(t[0]==="top"||t[0]==="bottom"?(t[1]=t[0],t[0]="center"):t[1]="center"),t.length!==2?null:[ab(mE(t[0])),ab(mE(t[1]))]}else return[Cr(e[0]||0,"px"),Cr(e[1]||0,"px")]};function mE(e){return e==="center"?"50%":e==="left"||e==="top"?"0%":e==="right"||e==="bottom"?"100%":e}var zk=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:Pt.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:Pt.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:Pt.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:Pt.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:Pt.PAINT,l:!0},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:Pt.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:Pt.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:Pt.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:Pt.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:Pt.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:Pt.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:Pt.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:Pt.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:Pt.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,int:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:Pt.FILTER},{n:"clipPath",syntax:Pt.DEFINED_PATH},{n:"textPath",syntax:Pt.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:Pt.TRANSFORM},{n:"transformOrigin",p:100,d:"0 0",l:!0,syntax:Pt.TRANSFORM_ORIGIN},{n:"cx",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"cy",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"cz",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"x",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"y",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"z",int:!0,l:!0,d:"0",syntax:Pt.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:Pt.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:Pt.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"y1",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"z1",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"x2",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"y2",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"z2",int:!0,l:!0,syntax:Pt.COORDINATE},{n:"d",int:!0,l:!0,d:"",syntax:Pt.PATH,p:50},{n:"points",int:!0,l:!0,syntax:Pt.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:Pt.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:Pt.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:Pt.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:Pt.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:Pt.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:Pt.NUMBER,d:function(e){return e===Ze.PATH||e===Ze.POLYGON||e===Ze.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:Pt.MARKER},{n:"markerEnd",syntax:Pt.MARKER},{n:"markerMid",syntax:Pt.MARKER},{n:"markerStartOffset",syntax:Pt.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:Pt.LENGTH,l:!0,int:!0,d:"0"}],Lne=zk.filter(function(e){return!!e.l}).map(function(e){return e.n}),Rf={},zg=new WeakMap,QJe=function(e,t){var n=zg.get(e);return!n||n.length===0?!0:n.includes(t)},JJe=function(){function e(t){var n=this;this.runtime=t,zk.forEach(function(r){n.registerMetadata(r)})}return e.prototype.registerMetadata=function(t){it([t.n],se(t.a||[]),!1).forEach(function(n){Rf[n]=t})},e.prototype.unregisterMetadata=function(t){delete Rf[t]},e.prototype.getPropertySyntax=function(t){return this.runtime.CSSPropertySyntaxFactory[t]},e.prototype.processProperties=function(t,n,r){var i=this;if(r===void 0&&(r={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[],memoize:!0}),this.runtime.enableCSSParsing){var u=r.skipUpdateAttribute,f=r.skipParse,d=r.forceUpdateGeometry,h=r.usedAttributes,p=r.memoize,v=d,g=Object.keys(n);g.forEach(function(m){var y;u||(t.attributes[m]=n[m]),!v&&(!((y=Rf[m])===null||y===void 0)&&y.l)&&(v=!0)}),f||g.forEach(function(m){t.computedStyle[m]=i.parseProperty(m,t.attributes[m],t,p)}),h!=null&&h.length&&(g=Array.from(new Set(g.concat(h)))),g.forEach(function(m){m in t.computedStyle&&(t.parsedStyle[m]=i.computeProperty(m,t.computedStyle[m],t,p))}),v&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,r.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t)),g.forEach(function(m){m in t.parsedStyle&&i.postProcessProperty(m,t,g)}),this.runtime.enableCSSParsing&&t.children.length&&g.forEach(function(m){m in t.parsedStyle&&i.isPropertyInheritable(m)&&t.children.forEach(function(y){y.internalSetAttribute(m,null,{skipUpdateAttribute:!0,skipParse:!0})})})}else{Object.assign(t.attributes,n);var o=Object.keys(n),a=t.parsedStyle.clipPath,s=t.parsedStyle.offsetPath;t.parsedStyle=Object.assign(t.parsedStyle,n);var l=!!r.forceUpdateGeometry;if(!l){for(var c=0;c<Lne.length;c++)if(Lne[c]in n){l=!0;break}}n.fill&&(t.parsedStyle.fill=tu(n.fill)),n.stroke&&(t.parsedStyle.stroke=tu(n.stroke)),n.shadowColor&&(t.parsedStyle.shadowColor=tu(n.shadowColor)),n.filter&&(t.parsedStyle.filter=Sne(n.filter)),hn(n.radius)||(t.parsedStyle.radius=bne(n.radius,4)),hn(n.lineDash)||(t.parsedStyle.lineDash=bne(n.lineDash,2)),n.points&&(t.parsedStyle.points=Rne(n.points)),n.d===""&&(t.parsedStyle.d=ke({},vne)),n.d&&(t.parsedStyle.d=Lk(n.d)),n.textTransform&&this.runtime.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},t,null),xr(n.clipPath)||this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",a,n.clipPath,t,this.runtime),n.offsetPath&&this.runtime.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,n.offsetPath,t,this.runtime),n.transform&&(t.parsedStyle.transform=jk(n.transform)),n.transformOrigin&&(t.parsedStyle.transformOrigin=Ane(n.transformOrigin)),n.markerStart&&(t.parsedStyle.markerStart=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(t.parsedStyle.markerEnd=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(t.parsedStyle.markerMid=this.runtime.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),hn(n.zIndex)||this.runtime.CSSPropertySyntaxFactory["<z-index>"].postProcessor(t,o),hn(n.offsetDistance)||this.runtime.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(t,o),n.transform&&this.runtime.CSSPropertySyntaxFactory["<transform>"].postProcessor(t,o),n.transformOrigin&&this.runtime.CSSPropertySyntaxFactory["<transform-origin>"].postProcessor(t,o),l&&(t.geometry.dirty=!0,t.renderable.boundsDirty=!0,t.renderable.renderBoundsDirty=!0,r.forceUpdateGeometry||this.runtime.sceneGraphService.dirtifyToRoot(t))}},e.prototype.parseProperty=function(t,n,r,i){var o=Rf[t],a=n;if((n===""||hn(n))&&(n="unset"),n==="unset"||n==="initial"||n==="inherit")a=Mk(n);else if(o){var s=o.k,l=o.syntax,c=l&&this.getPropertySyntax(l);s&&s.indexOf(n)>-1?a=Mk(n):c&&(!i&&c.parserUnmemoize?a=c.parserUnmemoize(n,r):c.parser&&(a=c.parser(n,r)))}return a},e.prototype.computeProperty=function(t,n,r,i){var o=Rf[t],a=r.id==="g-root",s=n;if(o){var l=o.syntax,c=o.inh,u=o.d;if(n instanceof Ca){var f=n.value;if(f==="unset"&&(c&&!a?f="inherit":f="initial"),f==="initial")hn(u)||(n=this.parseProperty(t,jg(u)?u(r.nodeName):u,r,i));else if(f==="inherit"){var d=this.tryToResolveProperty(r,t,{inherited:!0});if(hn(d)){this.addUnresolveProperty(r,t);return}else return d}}var h=l&&this.getPropertySyntax(l);if(h&&h.calculator){var p=r.parsedStyle[t];s=h.calculator(t,p,n,r,this.runtime)}else n instanceof Ca?s=n.value:s=n}return s},e.prototype.postProcessProperty=function(t,n,r){var i=Rf[t];if(i&&i.syntax){var o=i.syntax&&this.getPropertySyntax(i.syntax),a=o;a&&a.postProcessor&&a.postProcessor(n,r)}},e.prototype.addUnresolveProperty=function(t,n){var r=zg.get(t);r||(zg.set(t,[]),r=zg.get(t)),r.indexOf(n)===-1&&r.push(n)},e.prototype.tryToResolveProperty=function(t,n,r){r===void 0&&(r={});var i=r.inherited;if(i&&t.parentElement&&QJe(t.parentElement,n)){var o=t.parentElement.parsedStyle[n];return o==="unset"||o==="initial"||o==="inherit"?void 0:o}},e.prototype.recalc=function(t){var n=zg.get(t);if(n&&n.length){var r={};n.forEach(function(i){r[i]=t.attributes[i]}),this.processProperties(t,r),zg.delete(t)}},e.prototype.updateGeometry=function(t){var n=t.nodeName,r=this.runtime.geometryUpdaterFactory[n];if(r){var i=t.geometry;i.contentBounds||(i.contentBounds=new vi),i.renderBounds||(i.renderBounds=new vi);var o=t.parsedStyle,a=r.update(o,t),s=a.cx,l=s===void 0?0:s,c=a.cy,u=c===void 0?0:c,f=a.cz,d=f===void 0?0:f,h=a.hwidth,p=h===void 0?0:h,v=a.hheight,g=v===void 0?0:v,m=a.hdepth,y=m===void 0?0:m,x=[Math.abs(p),Math.abs(g),y],S=o,w=S.stroke,C=S.lineWidth,O=C===void 0?1:C,E=S.increasedLineWidthForHitTesting,_=E===void 0?0:E,$=S.shadowType,P=$===void 0?"outer":$,T=S.shadowColor,I=S.filter,M=I===void 0?[]:I,R=S.transformOrigin,N=[l,u,d];i.contentBounds.update(N,x);var k=n===Ze.POLYLINE||n===Ze.POLYGON||n===Ze.PATH?Math.SQRT2:.5,A=w&&!w.isNone;if(A){var j=((O||0)+(_||0))*k;x[0]+=j,x[1]+=j}if(i.renderBounds.update(N,x),T&&P&&P!=="inner"){var D=i.renderBounds,L=D.min,F=D.max,B=o,H=B.shadowBlur,z=B.shadowOffsetX,W=B.shadowOffsetY,V=H||0,U=z||0,G=W||0,q=L[0]-V+U,K=F[0]+V+U,X=L[1]-V+G,te=F[1]+V+G;L[0]=Math.min(L[0],q),F[0]=Math.max(F[0],K),L[1]=Math.min(L[1],X),F[1]=Math.max(F[1],te),i.renderBounds.setMinMax(L,F)}M.forEach(function(Q){var re=Q.name,ae=Q.params;if(re==="blur"){var de=ae[0].value;i.renderBounds.update(i.renderBounds.center,lE(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[de,de,0]))}else if(re==="drop-shadow"){var ve=ae[0].value,le=ae[1].value,ue=ae[2].value,be=i.renderBounds,ye=be.min,Oe=be.max,Me=ye[0]-ue+ve,Ne=Oe[0]+ue+ve,me=ye[1]-ue+le,_e=Oe[1]+ue+le;ye[0]=Math.min(ye[0],Me),Oe[0]=Math.max(Oe[0],Ne),ye[1]=Math.min(ye[1],me),Oe[1]=Math.max(Oe[1],_e),i.renderBounds.setMinMax(ye,Oe)}}),t.geometry.dirty=!1;var Z=p<0,Y=g<0,ne=(Z?-1:1)*(R?es(R[0],0,t,!0):0),ee=(Y?-1:1)*(R?es(R[1],1,t,!0):0);(ne||ee)&&t.setOrigin(ne,ee)}},e.prototype.updateSizeAttenuation=function(t,n){t.style.isSizeAttenuation?(t.style.rawLineWidth||(t.style.rawLineWidth=t.style.lineWidth),t.style.lineWidth=(t.style.rawLineWidth||1)/n,t.nodeName===Ze.CIRCLE&&(t.style.rawR||(t.style.rawR=t.style.r),t.style.r=(t.style.rawR||1)/n)):(t.style.rawLineWidth&&(t.style.lineWidth=t.style.rawLineWidth,delete t.style.rawLineWidth),t.nodeName===Ze.CIRCLE&&t.style.rawR&&(t.style.r=t.style.rawR,delete t.style.rawR))},e.prototype.isPropertyInheritable=function(t){var n=Rf[t];return n?n.inh:!1},e}(),eet=function(){function e(){this.parser=yne,this.parserUnmemoize=Ik,this.parserWithCSSDisabled=null,this.mixer=Rk}return e.prototype.calculator=function(t,n,r,i){return Oa(r)},e}(),tet=function(){function e(){}return e.prototype.calculator=function(t,n,r,i,o){return r instanceof Ca&&(r=null),o.sceneGraphService.updateDisplayObjectDependency(t,n,r,i),t==="clipPath"&&i.forEach(function(a){a.childNodes.length===0&&o.sceneGraphService.dirtifyToRoot(a)}),r},e}(),net=function(){function e(){this.parser=tu,this.parserWithCSSDisabled=tu,this.mixer=wJe}return e.prototype.calculator=function(t,n,r,i){return r instanceof Ca?r.value==="none"?fE:pne:r},e}(),ret=function(){function e(){this.parser=Sne}return e.prototype.calculator=function(t,n,r){return r instanceof Ca?[]:r},e}();function jne(e){var t=e.parsedStyle.fontSize;return hn(t)?null:t}var Hk=function(){function e(){this.parser=Fg,this.parserUnmemoize=ab,this.parserWithCSSDisabled=null,this.mixer=Rk}return e.prototype.calculator=function(t,n,r,i,o){var a;if(_r(r))return r;if(gr.isRelativeUnit(r.unit)){var s=o.styleValueRegistry;if(r.unit===St.kPercentage)return 0;if(r.unit===St.kEms){if(i.parentNode){var l=jne(i.parentNode);if(l)return l*=r.value,l;s.addUnresolveProperty(i,t)}else s.addUnresolveProperty(i,t);return 0}else if(r.unit===St.kRems){if(!((a=i==null?void 0:i.ownerDocument)===null||a===void 0)&&a.documentElement){var l=jne(i.ownerDocument.documentElement);if(l)return l*=r.value,l;s.addUnresolveProperty(i,t)}else s.addUnresolveProperty(i,t);return 0}}else return r.value},e}(),iet=function(){function e(){this.mixer=Cne}return e.prototype.parser=function(t){var n=xne(_r(t)?[t]:t),r;return n.length===1?r=[n[0],n[0]]:r=[n[0],n[1]],r},e.prototype.calculator=function(t,n,r){return r.map(function(i){return i.value})},e}(),oet=function(){function e(){this.mixer=Cne}return e.prototype.parser=function(t){var n=xne(_r(t)?[t]:t),r;return n.length===1?r=[n[0],n[0],n[0],n[0]]:n.length===2?r=[n[0],n[1],n[0],n[1]]:n.length===3?r=[n[0],n[1],n[2],n[1]]:r=[n[0],n[1],n[2],n[3]],r},e.prototype.calculator=function(t,n,r){return r.map(function(i){return i.value})},e}(),aet=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){r instanceof Ca&&(r=null);var o=r==null?void 0:r.cloneNode(!0);return o&&(o.style.isMarker=!0),o},e}(),set=function(){function e(){this.mixer=Rk,this.parser=$h,this.parserUnmemoize=Bg,this.parserWithCSSDisabled=null}return e.prototype.calculator=function(t,n,r){return r.value},e}(),cet=function(){function e(){this.parser=$h,this.parserUnmemoize=Bg,this.parserWithCSSDisabled=null,this.mixer=Nk(0,1)}return e.prototype.calculator=function(t,n,r){return r.value},e.prototype.postProcessor=function(t){var n=t.parsedStyle,r=n.offsetPath,i=n.offsetDistance;if(r){var o=r.nodeName;if(o===Ze.LINE||o===Ze.PATH||o===Ze.POLYLINE){var a=r.getPoint(i);a&&t.setLocalPosition(a.x,a.y)}}},e}(),uet=function(){function e(){this.parser=$h,this.parserUnmemoize=Bg,this.parserWithCSSDisabled=null,this.mixer=Nk(0,1)}return e.prototype.calculator=function(t,n,r){return r.value},e}(),fet=function(){function e(){this.parser=Lk,this.parserWithCSSDisabled=Lk,this.mixer=BJe}return e.prototype.calculator=function(t,n,r){return r instanceof Ca&&r.value==="unset"?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new _h(0,0,0,0)}:r},e}(),det=function(){function e(){this.parser=Rne,this.mixer=zJe}return e}(),het=function(e){Nt(t,e);function t(){var n=e.apply(this,it([],se(arguments),!1))||this;return n.mixer=Nk(0,1/0),n}return t}(Hk),pet=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){return r instanceof Ca?r.value==="unset"?"":r.value:"".concat(r)},e.prototype.postProcessor=function(t){t.nodeValue="".concat(t.parsedStyle.text)||""},e}(),vet=function(){function e(){}return e.prototype.calculator=function(t,n,r,i){var o=i.getAttribute("text");if(o){var a=o;r.value==="capitalize"?a=o.charAt(0).toUpperCase()+o.slice(1):r.value==="lowercase"?a=o.toLowerCase():r.value==="uppercase"&&(a=o.toUpperCase()),i.parsedStyle.text=a}return r.value},e}(),Wk={},get=0;function met(e,t){if(e){var n=typeof e=="string"?e:e.id||get++;Wk[n]&&Wk[n].destroy(),Wk[n]=t}}var sb=typeof window!="undefined"&&typeof window.document!="undefined";function yet(e){return!!e.getAttribute}function bet(e,t){for(var n=0,r=e.length;n<r;){var i=n+r>>>1;Dne(e[i],t)<0?n=i+1:r=i}return n}function Dne(e,t){var n=Number(e.parsedStyle.zIndex||0),r=Number(t.parsedStyle.zIndex||0);if(n===r){var i=e.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(e)-o.indexOf(t)}}return n-r}function Fne(e){var t,n=e;do{var r=(t=n.parsedStyle)===null||t===void 0?void 0:t.clipPath;if(r)return n;n=n.parentElement}while(n!==null);return null}var Bne="px";function xet(e,t,n){sb&&e.style&&(e.style.width=t+Bne,e.style.height=n+Bne)}function zne(e,t){if(sb)return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function wet(e){var t=zne(e,"width");return t==="auto"?e.offsetWidth:parseFloat(t)}function Cet(e){var t=zne(e,"height");return t==="auto"?e.offsetHeight:parseFloat(t)}var Oet=1,Eet={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Vk=typeof performance=="object"&&performance.now?performance:Date;function Mh(e,t,n){e===void 0&&(e="auto");var r=!1,i=!1,o=!!t&&!t.isNone,a=!!n&&!n.isNone;return e==="visiblepainted"||e==="painted"||e==="auto"?(r=o,i=a):e==="visiblefill"||e==="fill"?r=!0:e==="visiblestroke"||e==="stroke"?i=!0:(e==="visible"||e==="all")&&(r=!0,i=!0),[r,i]}var _et=1,$et=function(){return _et++},Xl=typeof self=="object"&&self.self==self?self:typeof global=="object"&&global.global==global?global:{},Pet=Date.now(),Met=function(){return Xl.performance&&typeof Xl.performance.now=="function"?Xl.performance.now():Date.now()-Pet},lb={},Hne=Date.now(),Tet=function(e){if(typeof e!="function")throw new TypeError(e+" is not a function");var t=Date.now(),n=t-Hne,r=n>16?0:16-n,i=$et();return lb[i]=e,Object.keys(lb).length>1||setTimeout(function(){Hne=t;var o=lb;lb={},Object.keys(o).forEach(function(a){return o[a](Met())})},r),i},Iet=function(e){delete lb[e]},Ret=["","webkit","moz","ms","o"],Wne=function(e){return typeof e!="string"?Tet:e===""?Xl.requestAnimationFrame:Xl[e+"RequestAnimationFrame"]},Net=function(e){return typeof e!="string"?Iet:e===""?Xl.cancelAnimationFrame:Xl[e+"CancelAnimationFrame"]||Xl[e+"CancelRequestAnimationFrame"]},ket=function(e,t){for(var n=0;e[n]!==void 0;){if(t(e[n]))return e[n];n=n+1}},Vne=ket(Ret,function(e){return!!Wne(e)}),Uk=Wne(Vne),Une=Net(Vne);Xl.requestAnimationFrame=Uk,Xl.cancelAnimationFrame=Une;var Aet=function(){function e(){this.callbacks=[]}return e.prototype.getCallbacksNum=function(){return this.callbacks.length},e.prototype.tapPromise=function(t,n){this.callbacks.push(n)},e.prototype.promise=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Promise.all(this.callbacks.map(function(r){return r.apply(void 0,it([],se(t),!1))}))},e}(),Let=function(){function e(){this.callbacks=[]}return e.prototype.tapPromise=function(t,n){this.callbacks.push(n)},e.prototype.promise=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return zl(this,void 0,void 0,function(){var r,i,o,a;return ag(this,function(s){switch(s.label){case 0:return this.callbacks.length?[4,(a=this.callbacks)[0].apply(a,it([],se(t),!1))]:[3,6];case 1:r=s.sent(),i=0,s.label=2;case 2:return i<this.callbacks.length-1?(o=this.callbacks[i],[4,o(r)]):[3,5];case 3:r=s.sent(),s.label=4;case 4:return i++,[3,2];case 5:return[2,r];case 6:return[2,null]}})})},e}(),na=function(){function e(){this.callbacks=[]}return e.prototype.tap=function(t,n){this.callbacks.push(n)},e.prototype.call=function(){var t=arguments;this.callbacks.forEach(function(n){n.apply(void 0,t)})},e}(),qk=function(){function e(){this.callbacks=[]}return e.prototype.tap=function(t,n){this.callbacks.push(n)},e.prototype.call=function(){if(this.callbacks.length){for(var t=arguments,n=this.callbacks[0].apply(void 0,t),r=0;r<this.callbacks.length-1;r++){var i=this.callbacks[r];n=i(n)}return n}return null},e}(),jet=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Det=/([\"\'])[^\'\"]+\1/;function Fet(e){for(var t=e.fontSize,n=t===void 0?16:t,r=e.fontFamily,i=r===void 0?"sans-serif":r,o=e.fontStyle,a=o===void 0?"normal":o,s=e.fontVariant,l=s===void 0?"normal":s,c=e.fontWeight,u=c===void 0?"normal":c,f=_r(n)&&"".concat(n,"px")||"16px",d=i.split(","),h=d.length-1;h>=0;h--){var p=d[h].trim();!Det.test(p)&&jet.indexOf(p)<0&&(p='"'.concat(p,'"')),d[h]=p}return"".concat(a," ").concat(l," ").concat(u," ").concat(f," ").concat(d.join(","))}function Gk(e,t,n){return fh(e),e[4]=Math.tan(t),e[1]=Math.tan(n),e}var cb=1e-5,Bet=er(),Ri=er();function qne(e,t){if(e.length){var n=fh(Bet);e.forEach(function(r){var i=r.t,o=r.d;if(i==="scale"){var a=(o==null?void 0:o.map(function(m){return Math.max(m.value,cb)}))||[1,1];bf(Ri,[a[0],a[1],1])}else if(i==="scalex"){var a=(o==null?void 0:o.map(function(y){return Math.max(y.value,cb)}))||[1];bf(Ri,[a[0],1,1])}else if(i==="scaley"){var a=(o==null?void 0:o.map(function(y){return Math.max(y.value,cb)}))||[1];bf(Ri,[1,a[0],1])}else if(i==="scalez"){var a=(o==null?void 0:o.map(function(y){return Math.max(y.value,cb)}))||[1];bf(Ri,[1,1,a[0]])}else if(i==="scale3d"){var a=(o==null?void 0:o.map(function(y){return Math.max(y.value,cb)}))||[1,1,1];bf(Ri,[a[0],a[1],a[2]])}else if(i==="translate"){var s=o||[gi,gi];yf(Ri,[s[0].value,s[1].value,0])}else if(i==="translatex"){var s=o||[gi];yf(Ri,[s[0].value,0,0])}else if(i==="translatey"){var s=o||[gi];yf(Ri,[0,s[0].value,0])}else if(i==="translatez"){var s=o||[gi];yf(Ri,[0,0,s[0].value])}else if(i==="translate3d"){var s=o||[gi,gi,gi];yf(Ri,[s[0].value,s[1].value,s[2].value])}else if(i==="rotate"){var l=o||[Ps];dN(Ri,pr(Oa(l[0])))}else if(i==="rotatex"){var l=o||[Ps];oJ(Ri,pr(Oa(l[0])))}else if(i==="rotatey"){var l=o||[Ps];aJ(Ri,pr(Oa(l[0])))}else if(i==="rotatez"){var l=o||[Ps];dN(Ri,pr(Oa(l[0])))}else if(i==="rotate3d"){var l=o||[gi,gi,gi,Ps];iJ(Ri,pr(Oa(l[3])),[l[0].value,l[1].value,l[2].value])}else if(i==="skew"){var c=(o==null?void 0:o.map(function(m){return m.value}))||[0,0];Gk(Ri,pr(c[0]),pr(c[1]))}else if(i==="skewx"){var c=(o==null?void 0:o.map(function(y){return y.value}))||[0];Gk(Ri,pr(c[0]),0)}else if(i==="skewy"){var c=(o==null?void 0:o.map(function(y){return y.value}))||[0];Gk(Ri,0,pr(c[0]))}else if(i==="matrix"){var u=se(o.map(function(m){return m.value}),6),f=u[0],d=u[1],h=u[2],p=u[3],v=u[4],g=u[5];fN(Ri,f,d,0,0,h,p,0,0,0,0,1,0,v,g,0,1)}else i==="matrix3d"&&fN.apply(oKe,it([Ri],se(o.map(function(m){return m.value})),!1));pN(n,n,Ri)}),t.setLocalTransform(n)}else t.resetLocalTransform();return t.getLocalTransform()}var zet=function(){function e(){this.parser=jk,this.parserUnmemoize=Nne,this.parserWithCSSDisabled=Nne,this.mixer=XJe}return e.prototype.calculator=function(t,n,r,i){return r instanceof Ca?[]:r},e.prototype.postProcessor=function(t){var n=t.parsedStyle.transform;qne(n,t)},e}(),Het=function(){function e(){this.parser=Ane,this.parserUnmemoize=ZJe}return e.prototype.postProcessor=function(t){var n=t.parsedStyle.transformOrigin;n[0].unit===St.kPixels&&n[1].unit===St.kPixels?t.setOrigin(n[0].value,n[1].value):t.getGeometryBounds()},e}(),Wet=function(){function e(){this.parser=$h,this.parserUnmemoize=Bg}return e.prototype.calculator=function(t,n,r,i){return r.value},e.prototype.postProcessor=function(t){if(t.parentNode){var n=t.parentNode,r=n.renderable,i=n.sortable;r&&(r.dirty=!0),i&&(i.dirty=!0,i.dirtyReason=Dg.Z_INDEX_CHANGED)}},e}(),Vet=function(){function e(){}return e.prototype.update=function(t,n){var r=t.cx,i=r===void 0?0:r,o=t.cy,a=o===void 0?0:o,s=t.r,l=s===void 0?0:s;return{cx:i,cy:a,hwidth:l,hheight:l}},e}(),Uet=function(){function e(){}return e.prototype.update=function(t,n){var r=t.cx,i=r===void 0?0:r,o=t.cy,a=o===void 0?0:o,s=t.rx,l=s===void 0?0:s,c=t.ry,u=c===void 0?0:c;return{cx:i,cy:a,hwidth:l,hheight:u}},e}(),qet=function(){function e(){}return e.prototype.update=function(t){var n=t.x1,r=t.y1,i=t.x2,o=t.y2,a=Math.min(n,i),s=Math.max(n,i),l=Math.min(r,o),c=Math.max(r,o),u=s-a,f=c-l,d=u/2,h=f/2;return{cx:a+d,cy:l+h,hwidth:d,hheight:h}},e}(),Get=function(){function e(){}return e.prototype.update=function(t){var n=t.d,r=n.rect,i=r.x,o=r.y,a=r.width,s=r.height,l=a/2,c=s/2;return{cx:i+l,cy:o+c,hwidth:l,hheight:c}},e}(),Ket=function(){function e(){}return e.prototype.update=function(t){if(t.points&&Hi(t.points.points)){var n=t.points.points,r=Math.min.apply(Math,it([],se(n.map(function(f){return f[0]})),!1)),i=Math.max.apply(Math,it([],se(n.map(function(f){return f[0]})),!1)),o=Math.min.apply(Math,it([],se(n.map(function(f){return f[1]})),!1)),a=Math.max.apply(Math,it([],se(n.map(function(f){return f[1]})),!1)),s=i-r,l=a-o,c=s/2,u=l/2;return{cx:r+c,cy:o+u,hwidth:c,hheight:u}}return{cx:0,cy:0,hwidth:0,hheight:0}},e}(),Yet=function(){function e(){}return e.prototype.update=function(t,n){var r=t.x,i=r===void 0?0:r,o=t.y,a=o===void 0?0:o,s=t.src,l=t.width,c=l===void 0?0:l,u=t.height,f=u===void 0?0:u,d=c,h=f;return s&&!Wr(s)&&(d||(d=s.width,t.width=d),h||(h=s.height,t.height=h)),{cx:i+d/2,cy:a+h/2,hwidth:d/2,hheight:h/2}},e}(),Xet=function(){function e(t){this.globalRuntime=t}return e.prototype.isReadyToMeasure=function(t,n){var r=t.text,i=t.textAlign,o=t.textBaseline,a=t.fontSize,s=t.fontStyle,l=t.fontWeight,c=t.fontVariant,u=t.lineWidth;return Ve.enableCSSParsing?r&&a&&s&&l&&c&&i&&o&&!hn(u):r},e.prototype.update=function(t,n){var r,i,o=t.text,a=t.textAlign,s=a===void 0?"start":a,l=t.lineWidth,c=l===void 0?1:l,u=t.textBaseline,f=u===void 0?"alphabetic":u,d=t.dx,h=d===void 0?0:d,p=t.dy,v=p===void 0?0:p,g=t.x,m=g===void 0?0:g,y=t.y,x=y===void 0?0:y;if(!this.isReadyToMeasure(t,n))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{hwidth:0,hheight:0,cx:0,cy:0};var S=(((i=(r=n==null?void 0:n.ownerDocument)===null||r===void 0?void 0:r.defaultView)===null||i===void 0?void 0:i.getConfig())||{}).offscreenCanvas,w=this.globalRuntime.textService.measureText(o,t,S);t.metrics=w;var C=w.width,O=w.height,E=w.lineHeight,_=w.fontProperties,$=C/2,P=O/2,T=m+$;s==="center"||s==="middle"?T+=c/2-$:(s==="right"||s==="end")&&(T+=c-$*2);var I=x-P;return f==="middle"?I+=P:f==="top"||f==="hanging"?I+=P*2:f==="alphabetic"?I+=this.globalRuntime.enableCSSParsing?E-_.ascent:0:(f==="bottom"||f==="ideographic")&&(I+=0),h&&(T+=h),v&&(I+=v),{cx:T,cy:I,hwidth:$,hheight:P}},e}(),Zet=function(){function e(){}return e.prototype.update=function(t,n){return{cx:0,cy:0,hwidth:0,hheight:0}},e}();function Qet(e){return!!e.type}var yE=function(){function e(t){this.eventPhase=e.prototype.NONE,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.defaultPrevented=!1,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new So,this.page=new So,this.canvas=new So,this.viewport=new So,this.composed=!1,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=t}return Object.defineProperty(e.prototype,"name",{get:function(){return this.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layerX",{get:function(){return this.layer.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"layerY",{get:function(){return this.layer.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageX",{get:function(){return this.page.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pageY",{get:function(){return this.page.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"x",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"y",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasX",{get:function(){return this.canvas.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canvasY",{get:function(){return this.canvas.y},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportX",{get:function(){return this.viewport.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"viewportY",{get:function(){return this.viewport.y},enumerable:!1,configurable:!0}),e.prototype.composedPath=function(){return this.manager&&(!this.path||this.path[0]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},Object.defineProperty(e.prototype,"propagationPath",{get:function(){return this.composedPath()},enumerable:!1,configurable:!0}),e.prototype.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.prototype.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.prototype.stopPropagation=function(){this.propagationStopped=!0},e.prototype.initEvent=function(){},e.prototype.initUIEvent=function(){},e.prototype.clone=function(){throw new Error(vr)},e}(),Gne=function(e){Nt(t,e);function t(){var n=e.apply(this,it([],se(arguments),!1))||this;return n.client=new So,n.movement=new So,n.offset=new So,n.global=new So,n.screen=new So,n}return Object.defineProperty(t.prototype,"clientX",{get:function(){return this.client.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clientY",{get:function(){return this.client.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"movementX",{get:function(){return this.movement.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"movementY",{get:function(){return this.movement.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsetX",{get:function(){return this.offset.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"offsetY",{get:function(){return this.offset.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"globalX",{get:function(){return this.global.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"globalY",{get:function(){return this.global.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenX",{get:function(){return this.screen.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"screenY",{get:function(){return this.screen.y},enumerable:!1,configurable:!0}),t.prototype.getModifierState=function(n){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(n)},t.prototype.initMouseEvent=function(){throw new Error(vr)},t}(yE),Kk=function(e){Nt(t,e);function t(){var n=e.apply(this,it([],se(arguments),!1))||this;return n.width=0,n.height=0,n.isPrimary=!1,n}return t.prototype.getCoalescedEvents=function(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]},t.prototype.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},t.prototype.clone=function(){return this.manager.clonePointerEvent(this)},t}(Gne),Yk=function(e){Nt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},t}(Gne),mr=function(e){Nt(t,e);function t(n,r){var i=e.call(this,null)||this;return i.type=n,i.detail=r,Object.assign(i,r),i}return t}(yE),Kne=":",Yne=function(){function e(){this.emitter=new dk}return e.prototype.on=function(t,n,r){return this.addEventListener(t,n,r),this},e.prototype.addEventListener=function(t,n,r){var i=KQ(r)&&r||lh(r)&&r.capture,o=lh(r)&&r.once,a=jg(n)?void 0:n,s=!1,l="";if(t.indexOf(Kne)>-1){var c=se(t.split(Kne),2),u=c[0],f=c[1];t=f,l=u,s=!0}if(t=i?"".concat(t,"capture"):t,n=jg(n)?n:n.handleEvent,s){var d=n;n=function(){for(var h,p=[],v=0;v<arguments.length;v++)p[v]=arguments[v];((h=p[0].target)===null||h===void 0?void 0:h.name)===l&&d.apply(void 0,it([],se(p),!1))}}return o?this.emitter.once(t,n,a):this.emitter.on(t,n,a),this},e.prototype.off=function(t,n,r){return t?this.removeEventListener(t,n,r):this.removeAllEventListeners(),this},e.prototype.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.prototype.removeEventListener=function(t,n,r){var i=KQ(r)&&r||lh(r)&&r.capture,o=jg(n)?void 0:n;return t=i?"".concat(t,"capture"):t,n=jg(n)?n:n==null?void 0:n.handleEvent,this.emitter.off(t,n,o),this},e.prototype.emit=function(t,n){this.dispatchEvent(new mr(t,n))},e.prototype.dispatchEvent=function(t,n){var r,i;if(n===void 0&&(n=!1),!Qet(t))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var o;if(this.document?o=this:this.defaultView?o=this.defaultView:o=(r=this.ownerDocument)===null||r===void 0?void 0:r.defaultView,o){if(t.manager=o.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],n||(t.target=this),(i=t.manager)===null||i===void 0||i.dispatchEvent(t,t.type,n)}return!t.defaultPrevented},e}(),so=function(e){Nt(t,e);function t(){var n=e.call(this)||this;return n.shadow=!1,n.ownerDocument=null,n.isConnected=!1,n.baseURI="",n.childNodes=[],n.nodeType=0,n.nodeName="",n.nodeValue=null,n.parentNode=null,n}return t.isNode=function(n){return!!n.childNodes},Object.defineProperty(t.prototype,"textContent",{get:function(){var n,r,i="";this.nodeName===Ze.TEXT&&(i+=this.style.text);try{for(var o=Xa(this.childNodes),a=o.next();!a.done;a=o.next()){var s=a.value;s.nodeName===Ze.TEXT?i+=s.nodeValue:i+=s.textContent}}catch(l){n={error:l}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},set:function(n){var r=this;this.childNodes.slice().forEach(function(i){r.removeChild(i)}),this.nodeName===Ze.TEXT&&(this.style.text="".concat(n))},enumerable:!1,configurable:!0}),t.prototype.getRootNode=function(n){return n===void 0&&(n={}),this.parentNode?this.parentNode.getRootNode(n):n.composed&&this.host?this.host.getRootNode(n):this},t.prototype.hasChildNodes=function(){return this.childNodes.length>0},t.prototype.isDefaultNamespace=function(n){throw new Error(vr)},t.prototype.lookupNamespaceURI=function(n){throw new Error(vr)},t.prototype.lookupPrefix=function(n){throw new Error(vr)},t.prototype.normalize=function(){throw new Error(vr)},t.prototype.isEqualNode=function(n){return this===n},t.prototype.isSameNode=function(n){return this.isEqualNode(n)},Object.defineProperty(t.prototype,"parent",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstChild",{get:function(){return this.childNodes.length>0?this.childNodes[0]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null},enumerable:!1,configurable:!0}),t.prototype.compareDocumentPosition=function(n){var r;if(n===this)return 0;for(var i=n,o=this,a=[i],s=[o];(r=i.parentNode)!==null&&r!==void 0?r:o.parentNode;)i=i.parentNode?(a.push(i.parentNode),i.parentNode):i,o=o.parentNode?(s.push(o.parentNode),o.parentNode):o;if(i!==o)return t.DOCUMENT_POSITION_DISCONNECTED|t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|t.DOCUMENT_POSITION_PRECEDING;var l=a.length>s.length?a:s,c=l===a?s:a;if(l[l.length-c.length]===c[0])return l===a?t.DOCUMENT_POSITION_CONTAINED_BY|t.DOCUMENT_POSITION_FOLLOWING:t.DOCUMENT_POSITION_CONTAINS|t.DOCUMENT_POSITION_PRECEDING;for(var u=l.length-c.length,f=c.length-1;f>=0;f--){var d=c[f],h=l[u+f];if(h!==d){var p=d.parentNode.childNodes;return p.indexOf(d)<p.indexOf(h)?c===a?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING:l===a?t.DOCUMENT_POSITION_PRECEDING:t.DOCUMENT_POSITION_FOLLOWING}}return t.DOCUMENT_POSITION_FOLLOWING},t.prototype.contain=function(n){return this.contains(n)},t.prototype.contains=function(n){for(var r=n;r&&this!==r;)r=r.parentNode;return!!r},t.prototype.getAncestor=function(n){for(var r=this;n>0&&r;)r=r.parentNode,n--;return r},t.prototype.forEach=function(n,r){r===void 0&&(r=!1),n(this)||(r?this.childNodes.slice():this.childNodes).forEach(function(i){i.forEach(n)})},t.DOCUMENT_POSITION_DISCONNECTED=1,t.DOCUMENT_POSITION_PRECEDING=2,t.DOCUMENT_POSITION_FOLLOWING=4,t.DOCUMENT_POSITION_CONTAINS=8,t.DOCUMENT_POSITION_CONTAINED_BY=16,t.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32,t}(Yne),Jet=2048,ett=function(){function e(t,n){var r=this;this.globalRuntime=t,this.context=n,this.emitter=new dk,this.nativeHTMLMap=new WeakMap,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.tmpMatrix=er(),this.tmpVec3=Mn(),this.onPointerDown=function(i){var o=r.createPointerEvent(i);if(r.dispatchEvent(o,"pointerdown"),o.pointerType==="touch")r.dispatchEvent(o,"touchstart");else if(o.pointerType==="mouse"||o.pointerType==="pen"){var a=o.button===2;r.dispatchEvent(o,a?"rightdown":"mousedown")}var s=r.trackingData(i.pointerId);s.pressTargetsByButton[i.button]=o.composedPath(),r.freeEvent(o)},this.onPointerUp=function(i){var o,a=Vk.now(),s=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(s,"pointerup"),s.pointerType==="touch")r.dispatchEvent(s,"touchend");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.dispatchEvent(s,l?"rightup":"mouseup")}var c=r.trackingData(i.pointerId),u=r.findMountedTarget(c.pressTargetsByButton[i.button]),f=u;if(u&&!s.composedPath().includes(u)){for(var d=u;d&&!s.composedPath().includes(d);){if(s.currentTarget=d,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch")r.notifyTarget(s,"touchendoutside");else if(s.pointerType==="mouse"||s.pointerType==="pen"){var l=s.button===2;r.notifyTarget(s,l?"rightupoutside":"mouseupoutside")}so.isNode(d)&&(d=d.parentNode)}delete c.pressTargetsByButton[i.button],f=d}if(f){var h=r.clonePointerEvent(s,"click");h.target=f,h.path=[],c.clicksByButton[i.button]||(c.clicksByButton[i.button]={clickCount:0,target:h.target,timeStamp:a});var p=c.clicksByButton[i.button];p.target===h.target&&a-p.timeStamp<200?++p.clickCount:p.clickCount=1,p.target=h.target,p.timeStamp=a,h.detail=p.clickCount,!((o=s.detail)===null||o===void 0)&&o.preventClick||(!r.context.config.useNativeClickEvent&&(h.pointerType==="mouse"||h.pointerType==="touch")&&r.dispatchEvent(h,"click"),r.dispatchEvent(h,"pointertap")),r.freeEvent(h)}r.freeEvent(s)},this.onPointerMove=function(i){var o=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),a=o.pointerType==="mouse"||o.pointerType==="pen",s=r.trackingData(i.pointerId),l=r.findMountedTarget(s.overTargets);if(s.overTargets&&l!==o.target){var c=i.type==="mousemove"?"mouseout":"pointerout",u=r.createPointerEvent(i,c,l||void 0);if(r.dispatchEvent(u,"pointerout"),a&&r.dispatchEvent(u,"mouseout"),!o.composedPath().includes(l)){var f=r.createPointerEvent(i,"pointerleave",l||void 0);for(f.eventPhase=f.AT_TARGET;f.target&&!o.composedPath().includes(f.target);)f.currentTarget=f.target,r.notifyTarget(f),a&&r.notifyTarget(f,"mouseleave"),so.isNode(f.target)&&(f.target=f.target.parentNode);r.freeEvent(f)}r.freeEvent(u)}if(l!==o.target){var d=i.type==="mousemove"?"mouseover":"pointerover",h=r.clonePointerEvent(o,d);r.dispatchEvent(h,"pointerover"),a&&r.dispatchEvent(h,"mouseover");for(var p=l&&so.isNode(l)&&l.parentNode;p&&p!==(so.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&p!==o.target;)p=p.parentNode;var v=!p||p===(so.isNode(r.rootTarget)&&r.rootTarget.parentNode);if(v){var g=r.clonePointerEvent(o,"pointerenter");for(g.eventPhase=g.AT_TARGET;g.target&&g.target!==l&&g.target!==(so.isNode(r.rootTarget)&&r.rootTarget.parentNode);)g.currentTarget=g.target,r.notifyTarget(g),a&&r.notifyTarget(g,"mouseenter"),so.isNode(g.target)&&(g.target=g.target.parentNode);r.freeEvent(g)}r.freeEvent(h)}r.dispatchEvent(o,"pointermove"),o.pointerType==="touch"&&r.dispatchEvent(o,"touchmove"),a&&(r.dispatchEvent(o,"mousemove"),r.cursor=r.getCursor(o.target)),s.overTargets=o.composedPath(),r.freeEvent(o)},this.onPointerOut=function(i){var o=r.trackingData(i.pointerId);if(o.overTargets){var a=i.pointerType==="mouse"||i.pointerType==="pen",s=r.findMountedTarget(o.overTargets),l=r.createPointerEvent(i,"pointerout",s||void 0);r.dispatchEvent(l),a&&r.dispatchEvent(l,"mouseout");var c=r.createPointerEvent(i,"pointerleave",s||void 0);for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==(so.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),a&&r.notifyTarget(c,"mouseleave"),so.isNode(c.target)&&(c.target=c.target.parentNode);o.overTargets=null,r.freeEvent(l),r.freeEvent(c)}r.cursor=null},this.onPointerOver=function(i){var o=r.trackingData(i.pointerId),a=r.createPointerEvent(i),s=a.pointerType==="mouse"||a.pointerType==="pen";r.dispatchEvent(a,"pointerover"),s&&r.dispatchEvent(a,"mouseover"),a.pointerType==="mouse"&&(r.cursor=r.getCursor(a.target));var l=r.clonePointerEvent(a,"pointerenter");for(l.eventPhase=l.AT_TARGET;l.target&&l.target!==(so.isNode(r.rootTarget)&&r.rootTarget.parentNode);)l.currentTarget=l.target,r.notifyTarget(l),s&&r.notifyTarget(l,"mouseenter"),so.isNode(l.target)&&(l.target=l.target.parentNode);o.overTargets=a.composedPath(),r.freeEvent(a),r.freeEvent(l)},this.onPointerUpOutside=function(i){var o=r.trackingData(i.pointerId),a=r.findMountedTarget(o.pressTargetsByButton[i.button]),s=r.createPointerEvent(i);if(a){for(var l=a;l;)s.currentTarget=l,r.notifyTarget(s,"pointerupoutside"),s.pointerType==="touch"||(s.pointerType==="mouse"||s.pointerType==="pen")&&r.notifyTarget(s,s.button===2?"rightupoutside":"mouseupoutside"),so.isNode(l)&&(l=l.parentNode);delete o.pressTargetsByButton[i.button]}r.freeEvent(s)},this.onWheel=function(i){var o=r.createWheelEvent(i);r.dispatchEvent(o),r.freeEvent(o)},this.onClick=function(i){if(r.context.config.useNativeClickEvent){var o=r.createPointerEvent(i);r.dispatchEvent(o),r.freeEvent(o)}},this.onPointerCancel=function(i){var o=r.createPointerEvent(i,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(o),r.freeEvent(o)}}return e.prototype.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},e.prototype.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.prototype.getScale=function(){var t=this.context.contextService.getBoundingClientRect(),n=1,r=1,i=this.context.contextService.getDomElement();if(i&&t){var o=i.offsetWidth,a=i.offsetHeight;o&&a&&(n=t.width/o,r=t.height/a)}return{scaleX:n,scaleY:r,bbox:t}},e.prototype.client2Viewport=function(t){var n=this.getScale(),r=n.scaleX,i=n.scaleY,o=n.bbox;return new So((t.x-((o==null?void 0:o.left)||0))/r,(t.y-((o==null?void 0:o.top)||0))/i)},e.prototype.viewport2Client=function(t){var n=this.getScale(),r=n.scaleX,i=n.scaleY,o=n.bbox;return new So((t.x+((o==null?void 0:o.left)||0))*r,(t.y+((o==null?void 0:o.top)||0))*i)},e.prototype.viewport2Canvas=function(t){var n=t.x,r=t.y,i=this.rootTarget.defaultView,o=i.getCamera(),a=this.context.config,s=a.width,l=a.height,c=o.getPerspectiveInverse(),u=o.getWorldTransform(),f=Do(this.tmpMatrix,u,c),d=gl(this.tmpVec3,n/s*2-1,(1-r/l)*2-1,0);return Zi(d,d,f),new So(d[0],d[1])},e.prototype.canvas2Viewport=function(t){var n=this.rootTarget.defaultView,r=n.getCamera(),i=r.getPerspective(),o=r.getViewTransform(),a=Do(this.tmpMatrix,i,o),s=gl(this.tmpVec3,t.x,t.y,0);Zi(this.tmpVec3,this.tmpVec3,a);var l=this.context.config,c=l.width,u=l.height;return new So((s[0]+1)/2*c,(1-(s[1]+1)/2)*u)},e.prototype.setPickHandler=function(t){this.pickHandler=t},e.prototype.addEventMapping=function(t,n){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:n,priority:0}),this.mappingTable[t].sort(function(r,i){return r.priority-i.priority})},e.prototype.mapEvent=function(t){if(this.rootTarget){var n=this.mappingTable[t.type];if(n)for(var r=0,i=n.length;r<i;r++)n[r].fn(t);else console.warn("[EventService]: Event mapping not defined for ".concat(t.type))}},e.prototype.dispatchEvent=function(t,n,r){if(!r)t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,n);else{t.eventPhase=t.AT_TARGET;var i=this.rootTarget.defaultView||null;t.currentTarget=i,this.notifyListeners(t,n)}this.emitter.emit(n||t.type,t)},e.prototype.propagate=function(t,n){if(t.target){var r=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var i=r.length-1;i>=1;i--)if(t.currentTarget=r[i],this.notifyTarget(t,n),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,n),!(t.propagationStopped||t.propagationImmediatelyStopped)){var o=r.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var i=o+1;i<r.length;i++)if(t.currentTarget=r[i],this.notifyTarget(t,n),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.prototype.propagationPath=function(t){var n=[t],r=this.rootTarget.defaultView||null;if(r&&r===t)return n.unshift(r.document),n;for(var i=0;i<Jet&&t!==this.rootTarget;i++)so.isNode(t)&&t.parentNode&&(n.push(t.parentNode),t=t.parentNode);return r&&n.push(r),n},e.prototype.hitTest=function(t){var n=t.viewportX,r=t.viewportY,i=this.context.config,o=i.width,a=i.height,s=i.disableHitTesting;return n<0||r<0||n>o||r>a?null:!s&&this.pickHandler(t)||this.rootTarget||null},e.prototype.isNativeEventFromCanvas=function(t,n){var r=n==null?void 0:n.target;if(r!=null&&r.shadowRoot&&(r=n.composedPath()[0]),r){if(r===t)return!0;if(t&&t.contains)return t.contains(r)}return n!=null&&n.composedPath?n.composedPath().indexOf(t)>-1:!1},e.prototype.getExistedHTML=function(t){var n,r;if(t.nativeEvent.composedPath)try{for(var i=Xa(t.nativeEvent.composedPath()),o=i.next();!o.done;o=i.next()){var a=o.value,s=this.nativeHTMLMap.get(a);if(s)return s}}catch(l){n={error:l}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return null},e.prototype.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},e.prototype.createPointerEvent=function(t,n,r,i){var o=this.allocateEvent(Kk);this.copyPointerData(t,o),this.copyMouseData(t,o),this.copyData(t,o),o.nativeEvent=t.nativeEvent,o.originalEvent=t;var a=this.getExistedHTML(o),s=this.context.contextService.getDomElement();return o.target=r!=null?r:a||this.isNativeEventFromCanvas(s,o.nativeEvent)&&this.pickTarget(o)||i,typeof n=="string"&&(o.type=n),o},e.prototype.createWheelEvent=function(t){var n=this.allocateEvent(Yk);this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.nativeEvent=t.nativeEvent,n.originalEvent=t;var r=this.getExistedHTML(n),i=this.context.contextService.getDomElement();return n.target=r||this.isNativeEventFromCanvas(i,n.nativeEvent)&&this.pickTarget(n),n},e.prototype.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.prototype.cloneWheelEvent=function(t){var n=this.allocateEvent(Yk);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyWheelData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=t.type,n},e.prototype.clonePointerEvent=function(t,n){var r=this.allocateEvent(Kk);return r.nativeEvent=t.nativeEvent,r.originalEvent=t.originalEvent,this.copyPointerData(t,r),this.copyMouseData(t,r),this.copyData(t,r),r.target=t.target,r.path=t.composedPath().slice(),r.type=n!=null?n:r.type,r},e.prototype.copyPointerData=function(t,n){n.pointerId=t.pointerId,n.width=t.width,n.height=t.height,n.isPrimary=t.isPrimary,n.pointerType=t.pointerType,n.pressure=t.pressure,n.tangentialPressure=t.tangentialPressure,n.tiltX=t.tiltX,n.tiltY=t.tiltY,n.twist=t.twist},e.prototype.copyMouseData=function(t,n){n.altKey=t.altKey,n.button=t.button,n.buttons=t.buttons,n.ctrlKey=t.ctrlKey,n.metaKey=t.metaKey,n.shiftKey=t.shiftKey,n.client.copyFrom(t.client),n.movement.copyFrom(t.movement),n.canvas.copyFrom(t.canvas),n.screen.copyFrom(t.screen),n.global.copyFrom(t.global),n.offset.copyFrom(t.offset)},e.prototype.copyWheelData=function(t,n){n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ},e.prototype.copyData=function(t,n){n.isTrusted=t.isTrusted,n.timeStamp=Vk.now(),n.type=t.type,n.detail=t.detail,n.view=t.view,n.page.copyFrom(t.page),n.viewport.copyFrom(t.viewport)},e.prototype.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var n=this.eventPool.get(t).pop()||new t(this);return n.eventPhase=n.NONE,n.currentTarget=null,n.path=[],n.target=null,n},e.prototype.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var n=t.constructor;this.eventPool.has(n)||this.eventPool.set(n,[]),this.eventPool.get(n).push(t)},e.prototype.notifyTarget=function(t,n){n=n!=null?n:t.type;var r=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?"".concat(n,"capture"):n;this.notifyListeners(t,r),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,n)},e.prototype.notifyListeners=function(t,n){var r=t.currentTarget.emitter,i=r._events[n];if(i)if("fn"in i)i.once&&r.removeListener(n,i.fn,void 0,!0),i.fn.call(t.currentTarget||i.context,t);else for(var o=0;o<i.length&&!t.propagationImmediatelyStopped;o++)i[o].once&&r.removeListener(n,i[o].fn,void 0,!0),i[o].fn.call(t.currentTarget||i[o].context,t)},e.prototype.findMountedTarget=function(t){if(!t)return null;for(var n=t[t.length-1],r=t.length-2;r>=0;r--){var i=t[r];if(i===this.rootTarget||so.isNode(i)&&i.parentNode===n)n=t[r];else break}return n},e.prototype.getCursor=function(t){for(var n=t;n;){var r=yet(n)&&n.getAttribute("cursor");if(r)return r;n=so.isNode(n)&&n.parentNode}},e}(),ttt=function(){function e(){}return e.prototype.getOrCreateCanvas=function(t,n){if(this.canvas)return this.canvas;if(t||Ve.offscreenCanvas)this.canvas=t||Ve.offscreenCanvas,this.context=this.canvas.getContext("2d",ke({willReadFrequently:!0},n));else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",ke({willReadFrequently:!0},n)),(!this.context||!this.context.measureText)&&(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(r){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d",ke({willReadFrequently:!0},n))}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.prototype.getOrCreateContext=function(t,n){return this.context?this.context:(this.getOrCreateCanvas(t,n),this.context)},e}(),Nf;(function(e){e[e.CAMERA_CHANGED=0]="CAMERA_CHANGED",e[e.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",e[e.NONE=2]="NONE"})(Nf||(Nf={}));var ntt=function(){function e(t,n){this.globalRuntime=t,this.context=n,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.hooks={init:new na,initAsync:new Aet,dirtycheck:new qk,cull:new qk,beginFrame:new na,beforeRender:new na,render:new na,afterRender:new na,endFrame:new na,destroy:new na,pick:new Let,pickSync:new qk,pointerDown:new na,pointerUp:new na,pointerMove:new na,pointerOut:new na,pointerOver:new na,pointerWheel:new na,pointerCancel:new na,click:new na}}return e.prototype.init=function(t){var n=this,r=ke(ke({},this.globalRuntime),this.context);this.context.renderingPlugins.forEach(function(i){i.apply(r,n.globalRuntime)}),this.hooks.init.call(),this.hooks.initAsync.getCallbacksNum()===0?(this.inited=!0,t()):this.hooks.initAsync.promise().then(function(){n.inited=!0,t()})},e.prototype.getStats=function(){return this.stats},e.prototype.disableDirtyRectangleRendering=function(){var t=this.context.config.renderer,n=t.getConfig().enableDirtyRectangleRendering;return!n||this.context.renderingContext.renderReasons.has(Nf.CAMERA_CHANGED)},e.prototype.render=function(t,n,r){var i=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var o=this.context.renderingContext;if(this.globalRuntime.sceneGraphService.syncHierarchy(o.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),o.renderReasons.size&&this.inited){o.dirtyRectangleRenderingDisabled=this.disableDirtyRectangleRendering();var a=o.renderReasons.size===1&&o.renderReasons.has(Nf.CAMERA_CHANGED),s=!t.disableRenderHooks||!(t.disableRenderHooks&&a);s&&this.renderDisplayObject(o.root,t,o),this.hooks.beginFrame.call(n),s&&o.renderListCurrentFrame.forEach(function(l){i.hooks.beforeRender.call(l),i.hooks.render.call(l),i.hooks.afterRender.call(l)}),this.hooks.endFrame.call(n),o.renderListCurrentFrame=[],o.renderReasons.clear(),r()}},e.prototype.renderDisplayObject=function(t,n,r){var i=this,o=n.renderer.getConfig(),a=o.enableDirtyCheck,s=o.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var l=t.renderable,c=a?l.dirty||r.dirtyRectangleRenderingDisabled?t:null:t;if(c){var u=s?this.hooks.cull.call(c,this.context.camera):c;u&&(this.stats.rendered++,r.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var f=t.sortable;f.dirty&&(this.sort(t,f),f.dirty=!1,f.dirtyChildren=[],f.dirtyReason=void 0),(f.sorted||t.childNodes).forEach(function(d){i.renderDisplayObject(d,n,r)})},e.prototype.sort=function(t,n){n.sorted&&n.dirtyReason!==Dg.Z_INDEX_CHANGED?n.dirtyChildren.forEach(function(r){var i=t.childNodes.indexOf(r);if(i===-1){var o=n.sorted.indexOf(r);o>=0&&n.sorted.splice(o,1)}else if(n.sorted.length===0)n.sorted.push(r);else{var a=bet(n.sorted,r);n.sorted.splice(a,0,r)}}):n.sorted=t.childNodes.slice().sort(Dne)},e.prototype.destroy=function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()},e.prototype.dirtify=function(){this.context.renderingContext.renderReasons.add(Nf.DISPLAY_OBJECT_CHANGED)},e}(),rtt=/\[\s*(.*)=(.*)\s*\]/,itt=function(){function e(){}return e.prototype.selectOne=function(t,n){var r=this;if(t.startsWith("."))return n.find(function(s){return((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.find(function(s){return s.id===r.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),o=i.name,a=i.value;return o?n.find(function(s){return n!==s&&(o==="name"?s.name===a:r.attributeToString(s,o)===a)}):null}else return n.find(function(s){return n!==s&&s.nodeName===t})},e.prototype.selectAll=function(t,n){var r=this;if(t.startsWith("."))return n.findAll(function(s){return n!==s&&((s==null?void 0:s.classList)||[]).indexOf(r.getIdOrClassname(t))>-1});if(t.startsWith("#"))return n.findAll(function(s){return n!==s&&s.id===r.getIdOrClassname(t)});if(t.startsWith("[")){var i=this.getAttribute(t),o=i.name,a=i.value;return o?n.findAll(function(s){return n!==s&&(o==="name"?s.name===a:r.attributeToString(s,o)===a)}):[]}else return n.findAll(function(s){return n!==s&&s.nodeName===t})},e.prototype.is=function(t,n){if(t.startsWith("."))return n.className===this.getIdOrClassname(t);if(t.startsWith("#"))return n.id===this.getIdOrClassname(t);if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i==="name"?n.name===o:this.attributeToString(n,i)===o}else return n.nodeName===t},e.prototype.getIdOrClassname=function(t){return t.substring(1)},e.prototype.getAttribute=function(t){var n=t.match(rtt),r="",i="";return n&&n.length>2&&(r=n[1].replace(/"/g,""),i=n[2].replace(/"/g,"")),{name:r,value:i}},e.prototype.attributeToString=function(t,n){if(!t.getAttribute)return"";var r=t.getAttribute(n);return hn(r)?"":r.toString?r.toString():""},e}(),Th=function(e){Nt(t,e);function t(n,r,i,o,a,s,l,c){var u=e.call(this,null)||this;return u.relatedNode=r,u.prevValue=i,u.newValue=o,u.attrName=a,u.attrChange=s,u.prevParsedValue=l,u.newParsedValue=c,u.type=n,u}return t.ADDITION=2,t.MODIFICATION=1,t.REMOVAL=3,t}(yE),Sn;(function(e){e.REPARENT="reparent",e.DESTROY="destroy",e.ATTR_MODIFIED="DOMAttrModified",e.INSERTED="DOMNodeInserted",e.REMOVED="removed",e.MOUNTED="DOMNodeInsertedIntoDocument",e.UNMOUNTED="DOMNodeRemovedFromDocument",e.BOUNDS_CHANGED="bounds-changed",e.CULLED="culled"})(Sn||(Sn={}));function Xne(e){var t=e.renderable;t&&(t.renderBoundsDirty=!0,t.boundsDirty=!0)}var ott=new Th(Sn.REPARENT,null,"","","",0,"",""),att=function(){function e(t){var n=this;this.runtime=t,this.pendingEvents=[],this.boundsChangedEvent=new mr(Sn.BOUNDS_CHANGED),this.rotate=function(){var r=Ii();return function(i,o,a,s,l){a===void 0&&(a=0),s===void 0&&(s=0),l===void 0&&(l=!0),typeof o=="number"&&(o=Un(o,a,s));var c=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.rotateLocal(i,o);else{var u=Ii();xO(u,o[0],o[1],o[2]);var f=n.getRotation(i),d=n.getRotation(i.parentNode);SO(r,d),yN(r,r),wf(u,r,u),wf(c.localRotation,u,f),wO(c.localRotation,c.localRotation),l&&n.dirtifyLocal(i,c)}}}(),this.rotateLocal=function(){var r=Ii();return function(i,o,a,s,l){a===void 0&&(a=0),s===void 0&&(s=0),l===void 0&&(l=!0),typeof o=="number"&&(o=Un(o,a,s));var c=i.transformable;xO(r,o[0],o[1],o[2]),yJ(c.localRotation,c.localRotation,r),l&&n.dirtifyLocal(i,c)}}(),this.setEulerAngles=function(){var r=Ii();return function(i,o,a,s,l){a===void 0&&(a=0),s===void 0&&(s=0),l===void 0&&(l=!0),typeof o=="number"&&(o=Un(o,a,s));var c=i.transformable;if(i.parentNode===null||!i.parentNode.transformable)n.setLocalEulerAngles(i,o);else{xO(c.localRotation,o[0],o[1],o[2]);var u=n.getRotation(i.parentNode);SO(r,yN(Ii(),u)),yJ(c.localRotation,c.localRotation,r),l&&n.dirtifyLocal(i,c)}}}(),this.translateLocal=function(){return function(r,i,o,a,s){o===void 0&&(o=0),a===void 0&&(a=0),s===void 0&&(s=!0),typeof i=="number"&&(i=Un(i,o,a));var l=r.transformable;P1(i,Mn())||(lKe(i,i,l.localRotation),vg(l.localPosition,l.localPosition,i),s&&n.dirtifyLocal(r,l))}}(),this.setPosition=function(){var r=er(),i=Mn();return function(o,a,s){s===void 0&&(s=!0);var l=o.transformable;if(i[0]=a[0],i[1]=a[1],i[2]=a[2]||0,!P1(n.getPosition(o),i)){if(xf(l.position,i),o.parentNode===null||!o.parentNode.transformable)xf(l.localPosition,i);else{var c=o.parentNode.transformable;dg(r,c.worldTransform),vl(r,r),Zi(l.localPosition,i,r)}s&&n.dirtifyLocal(o,l)}}}(),this.setLocalPosition=function(){var r=Mn();return function(i,o,a){a===void 0&&(a=!0);var s=i.transformable;r[0]=o[0],r[1]=o[1],r[2]=o[2]||0,!P1(s.localPosition,r)&&(xf(s.localPosition,r),a&&n.dirtifyLocal(i,s))}}(),this.translate=function(){var r=Mn(),i=Mn(),o=Mn();return function(a,s,l,c,u){l===void 0&&(l=0),c===void 0&&(c=0),u===void 0&&(u=!0),typeof s=="number"&&(s=gl(i,s,l,c)),!P1(s,r)&&(vg(o,n.getPosition(a),s),n.setPosition(a,o,u))}}(),this.setRotation=function(){var r=Ii();return function(i,o,a,s,l,c){c===void 0&&(c=!0);var u=i.transformable;if(typeof o=="number"&&(o=bN(o,a,s,l)),i.parentNode===null||!i.parentNode.transformable)n.setLocalRotation(i,o);else{var f=n.getRotation(i.parentNode);SO(r,f),yN(r,r),wf(u.localRotation,r,o),wO(u.localRotation,u.localRotation),c&&n.dirtifyLocal(i,u)}}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var r=er(),i=Mn(),o=bN(0,0,0,1);return function(a){var s=a.localSkew[0]!==0||a.localSkew[1]!==0;if(s){if($1(a.localTransform,a.localRotation,a.localPosition,Un(1,1,1),a.origin),a.localSkew[0]!==0||a.localSkew[1]!==0){var l=fh(r);l[4]=Math.tan(a.localSkew[0]),l[1]=Math.tan(a.localSkew[1]),Do(a.localTransform,a.localTransform,l)}var c=$1(r,o,i,a.localScale,a.origin);Do(a.localTransform,a.localTransform,c)}else $1(a.localTransform,a.localRotation,a.localPosition,a.localScale,a.origin)}}()}return e.prototype.matches=function(t,n){return this.runtime.sceneGraphSelector.is(t,n)},e.prototype.querySelector=function(t,n){return this.runtime.sceneGraphSelector.selectOne(t,n)},e.prototype.querySelectorAll=function(t,n){return this.runtime.sceneGraphSelector.selectAll(t,n)},e.prototype.attach=function(t,n,r){var i,o=!1;t.parentNode&&(o=t.parentNode!==n,this.detach(t)),t.parentNode=n,hn(r)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(r,0,t);var a=n.sortable;(!((i=a==null?void 0:a.sorted)===null||i===void 0)&&i.length||t.parsedStyle.zIndex)&&(a.dirtyChildren.indexOf(t)===-1&&a.dirtyChildren.push(t),a.dirty=!0,a.dirtyReason=Dg.ADDED);var s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),o&&t.dispatchEvent(ott)},e.prototype.detach=function(t){var n,r;if(t.parentNode){var i=t.transformable,o=t.parentNode.sortable;(!((n=o==null?void 0:o.sorted)===null||n===void 0)&&n.length||!((r=t.style)===null||r===void 0)&&r.zIndex)&&(o.dirtyChildren.indexOf(t)===-1&&o.dirtyChildren.push(t),o.dirty=!0,o.dirtyReason=Dg.REMOVED);var a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),i&&this.dirtifyWorld(t,i),t.parentNode=null}},e.prototype.getOrigin=function(t){return t.getGeometryBounds(),t.transformable.origin},e.prototype.setOrigin=function(t,n,r,i){r===void 0&&(r=0),i===void 0&&(i=0),typeof n=="number"&&(n=[n,r,i]);var o=t.transformable;if(!(n[0]===o.origin[0]&&n[1]===o.origin[1]&&n[2]===o.origin[2])){var a=o.origin;a[0]=n[0],a[1]=n[1],a[2]=n[2]||0,this.dirtifyLocal(t,o)}},e.prototype.setLocalEulerAngles=function(t,n,r,i,o){r===void 0&&(r=0),i===void 0&&(i=0),o===void 0&&(o=!0),typeof n=="number"&&(n=Un(n,r,i));var a=t.transformable;xO(a.localRotation,n[0],n[1],n[2]),o&&this.dirtifyLocal(t,a)},e.prototype.scaleLocal=function(t,n,r){r===void 0&&(r=!0);var i=t.transformable;aKe(i.localScale,i.localScale,Un(n[0],n[1],n[2]||1)),r&&this.dirtifyLocal(t,i)},e.prototype.setLocalScale=function(t,n,r){r===void 0&&(r=!0);var i=t.transformable,o=Un(n[0],n[1],n[2]||i.localScale[2]);P1(o,i.localScale)||(xf(i.localScale,o),r&&this.dirtifyLocal(t,i))},e.prototype.setLocalRotation=function(t,n,r,i,o,a){a===void 0&&(a=!0),typeof n=="number"&&(n=bN(n,r,i,o));var s=t.transformable;SO(s.localRotation,n),a&&this.dirtifyLocal(t,s)},e.prototype.setLocalSkew=function(t,n,r){typeof n=="number"&&(n=pKe(n,r));var i=t.transformable;vKe(i.localSkew,n),this.dirtifyLocal(t,i)},e.prototype.dirtifyLocal=function(t,n){n.localDirtyFlag||(n.localDirtyFlag=!0,n.dirtyFlag||this.dirtifyWorld(t,n))},e.prototype.dirtifyWorld=function(t,n){n.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,n),this.dirtifyToRoot(t,!0)},e.prototype.triggerPendingEvents=function(){var t=this,n=new Set,r=function(i,o){i.isConnected&&!n.has(i.entity)&&(t.boundsChangedEvent.detail=o,t.boundsChangedEvent.target=i,i.isMutationObserved?i.dispatchEvent(t.boundsChangedEvent):i.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),n.add(i.entity))};this.pendingEvents.forEach(function(i){var o=se(i,2),a=o[0],s=o[1];s.affectChildren?a.forEach(function(l){r(l,s)}):r(a,s)}),this.clearPendingEvents(),n.clear()},e.prototype.clearPendingEvents=function(){this.pendingEvents=[]},e.prototype.dirtifyToRoot=function(t,n){n===void 0&&(n=!1);var r=t;for(r.renderable&&(r.renderable.dirty=!0);r;)Xne(r),r=r.parentNode;n&&t.forEach(function(i){Xne(i)}),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:n}])},e.prototype.updateDisplayObjectDependency=function(t,n,r,i){if(n&&n!==r){var o=this.displayObjectDependencyMap.get(n);if(o&&o[t]){var a=o[t].indexOf(i);o[t].splice(a,1)}}if(r){var s=this.displayObjectDependencyMap.get(r);s||(this.displayObjectDependencyMap.set(r,{}),s=this.displayObjectDependencyMap.get(r)),s[t]||(s[t]=[]),s[t].push(i)}},e.prototype.informDependentDisplayObjects=function(t){var n=this,r=this.displayObjectDependencyMap.get(t);r&&Object.keys(r).forEach(function(i){r[i].forEach(function(o){n.dirtifyToRoot(o,!0),o.dispatchEvent(new Th(Sn.ATTR_MODIFIED,o,n,n,i,Th.MODIFICATION,n,n)),o.isCustomElement&&o.isConnected&&o.attributeChangedCallback&&o.attributeChangedCallback(i,n,n)})})},e.prototype.getPosition=function(t){var n=t.transformable;return mO(n.position,this.getWorldTransform(t,n))},e.prototype.getRotation=function(t){var n=t.transformable;return yO(n.rotation,this.getWorldTransform(t,n))},e.prototype.getScale=function(t){var n=t.transformable;return pg(n.scaling,this.getWorldTransform(t,n))},e.prototype.getWorldTransform=function(t,n){return n===void 0&&(n=t.transformable),!n.localDirtyFlag&&!n.dirtyFlag||(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,n)),n.worldTransform},e.prototype.getLocalPosition=function(t){return t.transformable.localPosition},e.prototype.getLocalRotation=function(t){return t.transformable.localRotation},e.prototype.getLocalScale=function(t){return t.transformable.localScale},e.prototype.getLocalSkew=function(t){return t.transformable.localSkew},e.prototype.getLocalTransform=function(t){var n=t.transformable;return n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.localTransform},e.prototype.setLocalTransform=function(t,n){var r=mO(Mn(),n),i=yO(Ii(),n),o=pg(Mn(),n);this.setLocalScale(t,o,!1),this.setLocalPosition(t,r,!1),this.setLocalRotation(t,i,void 0,void 0,void 0,!1),this.dirtifyLocal(t,t.transformable)},e.prototype.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},e.prototype.getTransformedGeometryBounds=function(t,n,r){n===void 0&&(n=!1);var i=this.getGeometryBounds(t,n);if(vi.isEmpty(i))return null;var o=r||new vi;return o.setFromTransformedAABB(i,this.getWorldTransform(t)),o},e.prototype.getGeometryBounds=function(t,n){n===void 0&&(n=!1);var r=t.geometry;r.dirty&&Ve.styleValueRegistry.updateGeometry(t);var i=n?r.renderBounds:r.contentBounds||null;return i||new vi},e.prototype.getBounds=function(t,n){var r=this;n===void 0&&(n=!1);var i=t.renderable;if(!i.boundsDirty&&!n&&i.bounds)return i.bounds;if(!i.renderBoundsDirty&&n&&i.renderBounds)return i.renderBounds;var o=n?i.renderBounds:i.bounds,a=this.getTransformedGeometryBounds(t,n,o),s=t.childNodes;if(s.forEach(function(u){var f=r.getBounds(u,n);f&&(a?a.add(f):(a=o||new vi,a.update(f.center,f.halfExtents)))}),a||(a=new vi),n){var l=Fne(t);if(l){var c=l.parsedStyle.clipPath.getBounds(n);a?c&&(a=c.intersection(a)):a.update(c.center,c.halfExtents)}}return n?(i.renderBounds=a,i.renderBoundsDirty=!1):(i.bounds=a,i.boundsDirty=!1),a},e.prototype.getLocalBounds=function(t){if(t.parentNode){var n=er();t.parentNode.transformable&&(n=vl(er(),this.getWorldTransform(t.parentNode)));var r=this.getBounds(t);if(!vi.isEmpty(r)){var i=new vi;return i.setFromTransformedAABB(r,n),i}}return this.getBounds(t)},e.prototype.getBoundingClientRect=function(t){var n,r,i,o=this.getGeometryBounds(t);vi.isEmpty(o)||(i=new vi,i.setFromTransformedAABB(o,this.getWorldTransform(t)));var a=(r=(n=t.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.getContextService().getBoundingClientRect();if(i){var s=se(i.getMin(),2),l=s[0],c=s[1],u=se(i.getMax(),2),f=u[0],d=u[1];return new _h(l+((a==null?void 0:a.left)||0),c+((a==null?void 0:a.top)||0),f-l,d-c)}return new _h((a==null?void 0:a.left)||0,(a==null?void 0:a.top)||0,0,0)},e.prototype.dirtifyWorldInternal=function(t,n){var r=this;if(!n.dirtyFlag){n.dirtyFlag=!0,n.frozen=!1,t.childNodes.forEach(function(o){var a=o.transformable;a.dirtyFlag||r.dirtifyWorldInternal(o,a)});var i=t.renderable;i&&(i.renderBoundsDirty=!0,i.boundsDirty=!0,i.dirty=!0)}},e.prototype.syncHierarchy=function(t){var n=t.transformable;if(!n.frozen){n.frozen=!0,(n.localDirtyFlag||n.dirtyFlag)&&this.sync(t,n);for(var r=t.childNodes,i=0;i<r.length;i++)this.syncHierarchy(r[i])}},e.prototype.sync=function(t,n){if(n.localDirtyFlag&&(this.calcLocalTransform(n),n.localDirtyFlag=!1),n.dirtyFlag){var r=t.parentNode,i=r&&r.transformable;r===null||!i?dg(n.worldTransform,n.localTransform):Do(n.worldTransform,i.worldTransform,n.localTransform),n.dirtyFlag=!1}},e.prototype.unfreezeParentToRoot=function(t){for(var n=t.parentNode;n;){var r=n.transformable;r&&(r.frozen=!1),n=n.parentNode}},e}(),Ih={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Zne=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,stt=/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/,ltt=/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/,ctt=/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/,utt=/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/,ftt=/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/,dtt=/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/,htt=/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/,ptt=/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/,vtt=new RegExp("".concat(stt.source,"|").concat(ctt.source,"|").concat(ftt.source,"|").concat(htt.source)),gtt=new RegExp("".concat(ltt.source,"|").concat(utt.source,"|").concat(dtt.source,"|").concat(ptt.source)),mtt=function(){function e(t){var n=this;this.runtime=t,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(r,i){return n.isBreakingSpace(i)?!1:!!(r&&(gtt.exec(i)||vtt.exec(r)))},this.trimByKinsokuShorui=function(r){var i=it([],se(r),!1),o=i[i.length-2];if(!o)return r;var a=o[o.length-1];return i[i.length-2]=o.slice(0,-1),i[i.length-1]=a+i[i.length-1],i}}return e.prototype.measureFont=function(t,n){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var r={ascent:0,descent:0,fontSize:0},i=this.runtime.offscreenCanvasCreator.getOrCreateCanvas(n),o=this.runtime.offscreenCanvasCreator.getOrCreateContext(n,{willReadFrequently:!0});o.font=t;var a=Ih.MetricsString+Ih.BaselineSymbol,s=Math.ceil(o.measureText(a).width),l=Math.ceil(o.measureText(Ih.BaselineSymbol).width),c=Ih.HeightMultiplier*l;l=l*Ih.BaselineMultiplier|0,i.width=s,i.height=c,o.fillStyle="#f00",o.fillRect(0,0,s,c),o.font=t,o.textBaseline="alphabetic",o.fillStyle="#000",o.fillText(a,0,l);var u=o.getImageData(0,0,s||1,c||1).data,f=u.length,d=s*4,h=0,p=0,v=!1;for(h=0;h<l;++h){for(var g=0;g<d;g+=4)if(u[p+g]!==255){v=!0;break}if(!v)p+=d;else break}for(r.ascent=l-h,p=f-d,v=!1,h=c;h>l;--h){for(var g=0;g<d;g+=4)if(u[p+g]!==255){v=!0;break}if(!v)p-=d;else break}return r.descent=h-l,r.fontSize=r.ascent+r.descent,this.fontMetricsCache[t]=r,r},e.prototype.measureText=function(t,n,r){var i=n.fontSize,o=i===void 0?16:i,a=n.wordWrap,s=a===void 0?!1:a,l=n.lineHeight,c=n.lineWidth,u=c===void 0?1:c,f=n.textBaseline,d=f===void 0?"alphabetic":f,h=n.textAlign,p=h===void 0?"start":h,v=n.letterSpacing,g=v===void 0?0:v,m=n.textPath;n.textPathSide,n.textPathStartOffset;var y=n.leading,x=y===void 0?0:y,S=Fet(n),w=this.measureFont(S,r);w.fontSize===0&&(w.fontSize=o,w.ascent=o);var C=this.runtime.offscreenCanvasCreator.getOrCreateContext(r);C.font=S,n.isOverflowing=!1;var O=s?this.wordWrap(t,n,r):t,E=O.split(/(?:\r\n|\r|\n)/),_=new Array(E.length),$=0;if(m){m.getTotalLength();for(var P=0;P<E.length;P++)var T=C.measureText(E[P]).width+(E[P].length-1)*g}else{for(var P=0;P<E.length;P++){var I=C.measureText(E[P]).width+(E[P].length-1)*g;_[P]=I,$=Math.max($,I)}var T=$+u,M=l||w.fontSize+u,R=Math.max(M,w.fontSize+u)+(E.length-1)*(M+x);M+=x;var N=0;return d==="middle"?N=-R/2:d==="bottom"||d==="alphabetic"||d==="ideographic"?N=-R:(d==="top"||d==="hanging")&&(N=0),{font:S,width:T,height:R,lines:E,lineWidths:_,lineHeight:M,maxLineWidth:$,fontProperties:w,lineMetrics:_.map(function(A,j){var D=0;return p==="center"||p==="middle"?D-=A/2:(p==="right"||p==="end")&&(D-=A),new _h(D-u/2,N+j*M,A+u,M)})}}},e.prototype.setGraphemeOnPath=function(){},e.prototype.wordWrap=function(t,n,r){var i=this,o=n.wordWrapWidth,a=o===void 0?0:o,s=n.letterSpacing,l=s===void 0?0:s,c=n.maxLines,u=c===void 0?1/0:c,f=n.textOverflow,d=this.runtime.offscreenCanvasCreator.getOrCreateContext(r),h=a+l,p="";f==="ellipsis"?p="...":f&&f!=="clip"&&(p=f);for(var v=[],g=0,m=0,y={},x=function(N){return i.getFromCache(N,l,y,d)},S=Array.from(p).reduce(function(N,k){return N+x(k)},0),w=Array.from(t),C=0;C<w.length;C++){var O=w[C],E=t[C-1],_=t[C+1],$=x(O);if(this.isNewline(O)){if(g++,g>=u){n.isOverflowing=!0;break}m=0,v[g]="";continue}if(m>0&&m+$>h){if(g+1>=u){if(n.isOverflowing=!0,S>0&&S<=h){for(var P=v[g].length,T=0,I=P,M=0;M<P;M++){var R=x(v[g][M]);if(T+R+S>h){I=M;break}T+=R}v[g]=(v[g]||"").slice(0,I)+p}break}if(g++,m=0,v[g]="",this.isBreakingSpace(O))continue;this.canBreakInLastChar(O)||(v=this.trimToBreakable(v),m=this.sumTextWidthByCache(v[g]||"",y)),this.shouldBreakByKinsokuShorui(O,_)&&(v=this.trimByKinsokuShorui(v),m+=x(E||""))}m+=$,v[g]=(v[g]||"")+O}return v.join(`
|
651
651
|
`)},e.prototype.isBreakingSpace=function(t){return typeof t!="string"?!1:Ih.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.prototype.isNewline=function(t){return typeof t!="string"?!1:Ih.Newlines.indexOf(t.charCodeAt(0))>=0},e.prototype.trimToBreakable=function(t){var n=it([],se(t),!1),r=n[n.length-2],i=this.findBreakableIndex(r);if(i===-1||!r)return n;var o=r.slice(i,i+1),a=this.isBreakingSpace(o),s=i+1,l=i+(a?0:1);return n[n.length-1]+=r.slice(s,r.length),n[n.length-2]=r.slice(0,l),n},e.prototype.canBreakInLastChar=function(t){return!(t&&Zne.test(t))},e.prototype.sumTextWidthByCache=function(t,n){return t.split("").reduce(function(r,i){if(!n[i])throw Error("cannot count the word without cache");return r+n[i]},0)},e.prototype.findBreakableIndex=function(t){for(var n=t.length-1;n>=0;n--)if(!Zne.test(t[n]))return n;return-1},e.prototype.getFromCache=function(t,n,r,i){var o=r[t];if(typeof o!="number"){var a=t.length*n;o=i.measureText(t).width+a,r[t]=o}return o},e}(),Ve={},ytt=function(){var e,t=new Yet,n=new Ket;return e={},e[Ze.CIRCLE]=new Vet,e[Ze.ELLIPSE]=new Uet,e[Ze.RECT]=t,e[Ze.IMAGE]=t,e[Ze.GROUP]=new Zet,e[Ze.LINE]=new qet,e[Ze.TEXT]=new Xet(Ve),e[Ze.POLYLINE]=n,e[Ze.POLYGON]=n,e[Ze.PATH]=new Get,e[Ze.HTML]=null,e[Ze.MESH]=null,e}(),btt=function(){var e,t=new net,n=new Hk;return e={},e[Pt.PERCENTAGE]=null,e[Pt.NUMBER]=new set,e[Pt.ANGLE]=new eet,e[Pt.DEFINED_PATH]=new tet,e[Pt.PAINT]=t,e[Pt.COLOR]=t,e[Pt.FILTER]=new ret,e[Pt.LENGTH]=n,e[Pt.LENGTH_PERCENTAGE]=n,e[Pt.LENGTH_PERCENTAGE_12]=new iet,e[Pt.LENGTH_PERCENTAGE_14]=new oet,e[Pt.COORDINATE]=new Hk,e[Pt.OFFSET_DISTANCE]=new cet,e[Pt.OPACITY_VALUE]=new uet,e[Pt.PATH]=new fet,e[Pt.LIST_OF_POINTS]=new det,e[Pt.SHADOW_BLUR]=new het,e[Pt.TEXT]=new pet,e[Pt.TEXT_TRANSFORM]=new vet,e[Pt.TRANSFORM]=new zet,e[Pt.TRANSFORM_ORIGIN]=new Het,e[Pt.Z_INDEX]=new Wet,e[Pt.MARKER]=new aet,e}(),xtt=function(){return typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:typeof global!="undefined"?global:{}};Ve.CameraContribution=une,Ve.AnimationTimeline=null,Ve.EasingFunction=null,Ve.offscreenCanvasCreator=new ttt,Ve.sceneGraphSelector=new itt,Ve.sceneGraphService=new att(Ve),Ve.textService=new mtt(Ve),Ve.geometryUpdaterFactory=ytt,Ve.CSSPropertySyntaxFactory=btt,Ve.styleValueRegistry=new JJe(Ve),Ve.layoutRegistry=null,Ve.globalThis=xtt(),Ve.enableCSSParsing=!1,Ve.enableDataset=!1,Ve.enableStyleSyntax=!0,Ve.enableAttributeDashCased=!1,Ve.enableSizeAttenuation=!1;var Stt=0,Qne=new Th(Sn.INSERTED,null,"","","",0,"",""),Jne=new Th(Sn.REMOVED,null,"","","",0,"",""),wtt=new mr(Sn.DESTROY),Ctt=function(e){Nt(t,e);function t(){var n=e.call(this)||this;return n.entity=Stt++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1},n.cullable={strategy:Tk.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},n.sortable={dirty:!1,sorted:void 0,renderOrder:0,dirtyChildren:[],dirtyReason:void 0},n.geometry={contentBounds:void 0,renderBounds:void 0,dirty:!0},n.rBushNode={aabb:void 0},n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle=Ve.enableCSSParsing?{opacity:Ar,fillOpacity:Ar,strokeOpacity:Ar,fill:Ar,stroke:Ar,transform:Ar,transformOrigin:Ar,visibility:Ar,pointerEvents:Ar,lineWidth:Ar,lineCap:Ar,lineJoin:Ar,increasedLineWidthForHitTesting:Ar,fontSize:Ar,fontFamily:Ar,fontStyle:Ar,fontWeight:Ar,fontVariant:Ar,textAlign:Ar,textBaseline:Ar,textTransform:Ar,zIndex:Ar,filter:Ar,shadowType:Ar}:null,n.parsedStyle={},n.attributes={},n}return Object.defineProperty(t.prototype,"className",{get:function(){return this.getAttribute("class")||""},set:function(n){this.setAttribute("class",n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"classList",{get:function(){return this.className.split(" ").filter(function(n){return n!==""})},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.nodeName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parentElement",{get:function(){return this.parentNode},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nextSibling",{get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n+1]||null}return null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"previousSibling",{get:function(){if(this.parentNode){var n=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[n-1]||null}return null},enumerable:!1,configurable:!0}),t.prototype.cloneNode=function(n){throw new Error(vr)},t.prototype.appendChild=function(n,r){var i;if(n.destroyed)throw new Error(GQe);return Ve.sceneGraphService.attach(n,this,r),!((i=this.ownerDocument)===null||i===void 0)&&i.defaultView&&this.ownerDocument.defaultView.mountChildren(n),this.isMutationObserved&&(Qne.relatedNode=this,n.dispatchEvent(Qne)),n},t.prototype.insertBefore=function(n,r){if(!r)this.appendChild(n);else{n.parentElement&&n.parentElement.removeChild(n);var i=this.childNodes.indexOf(r);i===-1?this.appendChild(n):this.appendChild(n,i)}return n},t.prototype.replaceChild=function(n,r){var i=this.childNodes.indexOf(r);return this.removeChild(r),this.appendChild(n,i),r},t.prototype.removeChild=function(n){var r;return Jne.relatedNode=this,n.dispatchEvent(Jne),!((r=n.ownerDocument)===null||r===void 0)&&r.defaultView&&n.ownerDocument.defaultView.unmountChildren(n),Ve.sceneGraphService.detach(n),n},t.prototype.removeChildren=function(){for(var n=this.childNodes.length-1;n>=0;n--){var r=this.childNodes[n];this.removeChild(r)}},t.prototype.destroyChildren=function(){for(var n=this.childNodes.length-1;n>=0;n--){var r=this.childNodes[n];r.childNodes.length&&r.destroyChildren(),r.destroy()}},t.prototype.matches=function(n){return Ve.sceneGraphService.matches(n,this)},t.prototype.getElementById=function(n){return Ve.sceneGraphService.querySelector("#".concat(n),this)},t.prototype.getElementsByName=function(n){return Ve.sceneGraphService.querySelectorAll('[name="'.concat(n,'"]'),this)},t.prototype.getElementsByClassName=function(n){return Ve.sceneGraphService.querySelectorAll(".".concat(n),this)},t.prototype.getElementsByTagName=function(n){return Ve.sceneGraphService.querySelectorAll(n,this)},t.prototype.querySelector=function(n){return Ve.sceneGraphService.querySelector(n,this)},t.prototype.querySelectorAll=function(n){return Ve.sceneGraphService.querySelectorAll(n,this)},t.prototype.closest=function(n){var r=this;do{if(Ve.sceneGraphService.matches(n,r))return r;r=r.parentElement}while(r!==null);return null},t.prototype.find=function(n){var r=this,i=null;return this.forEach(function(o){return o!==r&&n(o)?(i=o,!0):!1}),i},t.prototype.findAll=function(n){var r=this,i=[];return this.forEach(function(o){o!==r&&n(o)&&i.push(o)}),i},t.prototype.after=function(){for(var n=this,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(this.parentNode){var o=this.parentNode.childNodes.indexOf(this);r.forEach(function(a,s){var l;return(l=n.parentNode)===null||l===void 0?void 0:l.appendChild(a,o+s+1)})}},t.prototype.before=function(){for(var n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];if(this.parentNode){var o=this.parentNode.childNodes.indexOf(this),a=se(r),s=a[0],l=a.slice(1);this.parentNode.appendChild(s,o),(n=s).after.apply(n,it([],se(l),!1))}},t.prototype.replaceWith=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];this.after.apply(this,it([],se(n),!1)),this.remove()},t.prototype.append=function(){for(var n=this,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];r.forEach(function(o){return n.appendChild(o)})},t.prototype.prepend=function(){for(var n=this,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];r.forEach(function(o,a){return n.appendChild(o,a)})},t.prototype.replaceChildren=function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,it([],se(n),!1))},t.prototype.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},t.prototype.destroy=function(){this.dispatchEvent(wtt),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},t.prototype.getGeometryBounds=function(){return Ve.sceneGraphService.getGeometryBounds(this)},t.prototype.getRenderBounds=function(){return Ve.sceneGraphService.getBounds(this,!0)},t.prototype.getBounds=function(){return Ve.sceneGraphService.getBounds(this)},t.prototype.getLocalBounds=function(){return Ve.sceneGraphService.getLocalBounds(this)},t.prototype.getBoundingClientRect=function(){return Ve.sceneGraphService.getBoundingClientRect(this)},t.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},t.prototype.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},t.prototype.getAttributeNames=function(){return Object.keys(this.attributes)},t.prototype.getAttribute=function(n){if(nJe(n))return Ve.enableCSSParsing?null:void 0;var r=this.attributes[n];if(r===void 0){if(Ve.enableAttributeDashCased){var i=Ek(n);r=this.attributes[i]}return Ve.enableCSSParsing&&hn(r)?null:r}else return r},t.prototype.hasAttribute=function(n){return this.getAttributeNames().includes(n)},t.prototype.hasAttributes=function(){return!!this.getAttributeNames().length},t.prototype.removeAttribute=function(n){this.setAttribute(n,null),delete this.attributes[n]},t.prototype.setAttribute=function(n,r,i,o){this.attributes[n]=r},t.prototype.getAttributeNS=function(n,r){throw new Error(vr)},t.prototype.getAttributeNode=function(n){throw new Error(vr)},t.prototype.getAttributeNodeNS=function(n,r){throw new Error(vr)},t.prototype.hasAttributeNS=function(n,r){throw new Error(vr)},t.prototype.removeAttributeNS=function(n,r){throw new Error(vr)},t.prototype.removeAttributeNode=function(n){throw new Error(vr)},t.prototype.setAttributeNS=function(n,r,i){throw new Error(vr)},t.prototype.setAttributeNode=function(n){throw new Error(vr)},t.prototype.setAttributeNodeNS=function(n){throw new Error(vr)},t.prototype.toggleAttribute=function(n,r){throw new Error(vr)},t}(so);function Wn(e){return!!(e!=null&&e.nodeName)}var ere=Ve.globalThis.Proxy?Ve.globalThis.Proxy:function(){},nu=new Th(Sn.ATTR_MODIFIED,null,null,null,null,Th.MODIFICATION,null,null),Ott={opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Ett={fill:fE,stroke:fE,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},_tt=["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],$tt=it(it([],se(_tt),!1),["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],!1),tre="data-",Wo=function(e){Nt(t,e);function t(n){var r=e.call(this)||this;return r.isCustomElement=!1,r.isMutationObserved=!1,r.activeAnimations=[],r.config=n,r.id=r.config.id||"",r.name=r.config.name||"",(r.config.className||r.config.class)&&(r.className=r.config.className||r.config.class),r.nodeName=r.config.type||Ze.GROUP,Ve.enableCSSParsing?(Object.assign(r.attributes,Ott),Object.assign(r.parsedStyle,Ett,r.config.initialParsedStyle)):r.config.initialParsedStyle&&Object.assign(r.parsedStyle,r.config.initialParsedStyle),r.initAttributes(r.config.style),Ve.enableDataset&&(r.dataset=new ere({},{get:function(i,o){var a="".concat(tre).concat(hne(o));return i[a]!==void 0?i[a]:r.getAttribute(a)},set:function(i,o,a){return r.setAttribute("".concat(tre).concat(hne(o)),a),!0}})),Ve.enableStyleSyntax&&(r.style=new ere({setProperty:function(i,o){r.setAttribute(i,o)},getPropertyValue:function(i){return r.getAttribute(i)},removeProperty:function(i){r.removeAttribute(i)},item:function(){return""}},{get:function(i,o){return i[o]!==void 0?i[o]:r.getAttribute(o)},set:function(i,o,a){return r.setAttribute(o,a),!0}})),r}return t.prototype.destroy=function(){e.prototype.destroy.call(this),this.getAnimations().forEach(function(n){n.cancel()})},t.prototype.cloneNode=function(n,r){var i=ke({},this.attributes);for(var o in i){var a=i[o];Wn(a)&&o!=="clipPath"&&o!=="offsetPath"&&o!=="textPath"&&(i[o]=a.cloneNode(n)),r&&(i[o]=r(o,a))}var s=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:i});return s.setLocalTransform(this.getLocalTransform()),n&&this.children.forEach(function(l){if(!l.style.isMarker){var c=l.cloneNode(n);s.appendChild(c)}}),s},t.prototype.initAttributes=function(n){n===void 0&&(n={});var r=this.renderable,i={forceUpdateGeometry:!0};Ve.enableCSSParsing&&(i.usedAttributes=$tt);var o=n;if(Ve.enableAttributeDashCased){o={};for(var a in n){var s=Ek(a);o[s]=n[a]}}Ve.styleValueRegistry.processProperties(this,o,i),r.dirty=!0},t.prototype.setAttribute=function(n,r,i,o){i===void 0&&(i=!1),o===void 0&&(o=!0),Ve.enableAttributeDashCased&&(n=Ek(n)),!xr(r)&&(i||r!==this.attributes[n])&&(this.internalSetAttribute(n,r,{memoize:o}),e.prototype.setAttribute.call(this,n,r))},t.prototype.internalSetAttribute=function(n,r,i){var o;i===void 0&&(i={});var a=this.renderable,s=this.attributes[n],l=this.parsedStyle[n];Ve.styleValueRegistry.processProperties(this,(o={},o[n]=r,o),i),a.dirty=!0;var c=this.parsedStyle[n];this.isConnected&&(nu.relatedNode=this,nu.prevValue=s,nu.newValue=r,nu.attrName=n,nu.prevParsedValue=l,nu.newParsedValue=c,this.isMutationObserved?this.dispatchEvent(nu):(nu.target=this,this.ownerDocument.defaultView.dispatchEvent(nu,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(n,s,r,l,c)},t.prototype.getBBox=function(){var n=this.getBounds(),r=se(n.getMin(),2),i=r[0],o=r[1],a=se(n.getMax(),2),s=a[0],l=a[1];return new _h(i,o,s-i,l-o)},t.prototype.setOrigin=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),Ve.sceneGraphService.setOrigin(this,ta(n,r,i)),this},t.prototype.getOrigin=function(){return Ve.sceneGraphService.getOrigin(this)},t.prototype.setPosition=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),Ve.sceneGraphService.setPosition(this,ta(n,r,i)),this},t.prototype.setLocalPosition=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),Ve.sceneGraphService.setLocalPosition(this,ta(n,r,i)),this},t.prototype.translate=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),Ve.sceneGraphService.translate(this,ta(n,r,i)),this},t.prototype.translateLocal=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),Ve.sceneGraphService.translateLocal(this,ta(n,r,i)),this},t.prototype.getPosition=function(){return Ve.sceneGraphService.getPosition(this)},t.prototype.getLocalPosition=function(){return Ve.sceneGraphService.getLocalPosition(this)},t.prototype.scale=function(n,r,i){return this.scaleLocal(n,r,i)},t.prototype.scaleLocal=function(n,r,i){return typeof n=="number"&&(r=r||n,i=i||n,n=ta(n,r,i)),Ve.sceneGraphService.scaleLocal(this,n),this},t.prototype.setLocalScale=function(n,r,i){return typeof n=="number"&&(r=r||n,i=i||n,n=ta(n,r,i)),Ve.sceneGraphService.setLocalScale(this,n),this},t.prototype.getLocalScale=function(){return Ve.sceneGraphService.getLocalScale(this)},t.prototype.getScale=function(){return Ve.sceneGraphService.getScale(this)},t.prototype.getEulerAngles=function(){var n=se(xk(Mn(),Ve.sceneGraphService.getWorldTransform(this)),3),r=n[2];return $s(r)},t.prototype.getLocalEulerAngles=function(){var n=se(xk(Mn(),Ve.sceneGraphService.getLocalRotation(this)),3),r=n[2];return $s(r)},t.prototype.setEulerAngles=function(n){return Ve.sceneGraphService.setEulerAngles(this,0,0,n),this},t.prototype.setLocalEulerAngles=function(n){return Ve.sceneGraphService.setLocalEulerAngles(this,0,0,n),this},t.prototype.rotateLocal=function(n,r,i){return hn(r)&&hn(i)?Ve.sceneGraphService.rotateLocal(this,0,0,n):Ve.sceneGraphService.rotateLocal(this,n,r,i),this},t.prototype.rotate=function(n,r,i){return hn(r)&&hn(i)?Ve.sceneGraphService.rotate(this,0,0,n):Ve.sceneGraphService.rotate(this,n,r,i),this},t.prototype.setRotation=function(n,r,i,o){return Ve.sceneGraphService.setRotation(this,n,r,i,o),this},t.prototype.setLocalRotation=function(n,r,i,o){return Ve.sceneGraphService.setLocalRotation(this,n,r,i,o),this},t.prototype.setLocalSkew=function(n,r){return Ve.sceneGraphService.setLocalSkew(this,n,r),this},t.prototype.getRotation=function(){return Ve.sceneGraphService.getRotation(this)},t.prototype.getLocalRotation=function(){return Ve.sceneGraphService.getLocalRotation(this)},t.prototype.getLocalSkew=function(){return Ve.sceneGraphService.getLocalSkew(this)},t.prototype.getLocalTransform=function(){return Ve.sceneGraphService.getLocalTransform(this)},t.prototype.getWorldTransform=function(){return Ve.sceneGraphService.getWorldTransform(this)},t.prototype.setLocalTransform=function(n){return Ve.sceneGraphService.setLocalTransform(this,n),this},t.prototype.resetLocalTransform=function(){Ve.sceneGraphService.resetLocalTransform(this)},t.prototype.getAnimations=function(){return this.activeAnimations},t.prototype.animate=function(n,r){var i,o=(i=this.ownerDocument)===null||i===void 0?void 0:i.timeline;return o?o.play(this,n,r):null},t.prototype.isVisible=function(){var n,r;return Ve.enableCSSParsing?((n=this.parsedStyle)===null||n===void 0?void 0:n.visibility)==="visible":((r=this.parsedStyle)===null||r===void 0?void 0:r.visibility)!=="hidden"},Object.defineProperty(t.prototype,"interactive",{get:function(){return this.isInteractive()},set:function(n){this.style.pointerEvents=n?"auto":"none"},enumerable:!1,configurable:!0}),t.prototype.isInteractive=function(){var n;return((n=this.parsedStyle)===null||n===void 0?void 0:n.pointerEvents)!=="none"},t.prototype.isCulled=function(){return!!(this.cullable&&this.cullable.enable&&!this.cullable.visible)},t.prototype.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,it([],se(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})),!1))+1),this},t.prototype.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,it([],se(this.parentNode.children.map(function(n){return Number(n.style.zIndex)})),!1))-1),this},t.prototype.getConfig=function(){return this.config},t.prototype.attr=function(){for(var n=this,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var o=se(r,2),a=o[0],s=o[1];return a?lh(a)?(Object.keys(a).forEach(function(l){n.setAttribute(l,a[l])}),this):r.length===2?(this.setAttribute(a,s),this):this.attributes[a]:this.attributes},t.prototype.getMatrix=function(n){var r=n||this.getWorldTransform(),i=se(mO(Mn(),r),2),o=i[0],a=i[1],s=se(pg(Mn(),r),2),l=s[0],c=s[1],u=yO(Ii(),r),f=se(xk(Mn(),u),3),d=f[0],h=f[2];return BQe(d||h,o,a,l,c)},t.prototype.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},t.prototype.setMatrix=function(n){var r=se(ane(n),5),i=r[0],o=r[1],a=r[2],s=r[3],l=r[4];this.setEulerAngles(l).setPosition(i,o).setLocalScale(a,s)},t.prototype.setLocalMatrix=function(n){var r=se(ane(n),5),i=r[0],o=r[1],a=r[2],s=r[3],l=r[4];this.setLocalEulerAngles(l).setLocalPosition(i,o).setLocalScale(a,s)},t.prototype.show=function(){Ve.enableCSSParsing?this.style.visibility="visible":this.forEach(function(n){n.style.visibility="visible"})},t.prototype.hide=function(){Ve.enableCSSParsing?this.style.visibility="hidden":this.forEach(function(n){n.style.visibility="hidden"})},t.prototype.getCount=function(){return this.childElementCount},t.prototype.getParent=function(){return this.parentElement},t.prototype.getChildren=function(){return this.children},t.prototype.getFirst=function(){return this.firstElementChild},t.prototype.getLast=function(){return this.lastElementChild},t.prototype.getChildByIndex=function(n){return this.children[n]||null},t.prototype.add=function(n,r){return this.appendChild(n,r)},t.prototype.set=function(n,r){this.config[n]=r},t.prototype.get=function(n){return this.config[n]},t.prototype.moveTo=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),this.setPosition(n,r,i),this},t.prototype.move=function(n,r,i){return r===void 0&&(r=0),i===void 0&&(i=0),this.setPosition(n,r,i),this},t.prototype.setZIndex=function(n){return this.style.zIndex=n,this},t}(Ctt),kf=function(e){Nt(t,e);function t(n){return n===void 0&&(n={}),e.call(this,ke({type:Ze.CIRCLE},n))||this}return t}(Wo),bE=function(e){Nt(t,e);function t(n){n===void 0&&(n={});var r=this,i=n.style,o=Ir(n,["style"]);return r=e.call(this,ke({style:Ve.enableCSSParsing?ke({},i):ke({},i)},o))||this,r.isCustomElement=!0,r}return t}(Wo),Xk=function(e){Nt(t,e);function t(n){return n===void 0&&(n={}),e.call(this,ke({type:Ze.ELLIPSE},n))||this}return t}(Wo),lo=function(e){Nt(t,e);function t(n){return n===void 0&&(n={}),e.call(this,ke({type:Ze.GROUP},n))||this}return t}(Wo),xE=function(e){Nt(t,e);function t(n){n===void 0&&(n={});var r=this,i=n.style,o=Ir(n,["style"]);return r=e.call(this,ke({type:Ze.HTML,style:Ve.enableCSSParsing?ke({x:"",y:"",width:"auto",height:"auto",innerHTML:""},i):ke({},i)},o))||this,r.cullable.enable=!1,r}return t.prototype.getDomElement=function(){return this.parsedStyle.$el},t.prototype.getBoundingClientRect=function(){if(this.parsedStyle.$el)return this.parsedStyle.$el.getBoundingClientRect();var n=this.parsedStyle,r=n.x,i=n.y,o=n.width,a=n.height;return new _h(r,i,o,a)},t.prototype.getClientRects=function(){return[this.getBoundingClientRect()]},t.prototype.getBounds=function(){var n,r,i=this.getBoundingClientRect(),o=(r=(n=this.ownerDocument)===null||n===void 0?void 0:n.defaultView)===null||r===void 0?void 0:r.getContextService().getBoundingClientRect(),a=new vi,s=i.left-((o==null?void 0:o.left)||0),l=i.top-((o==null?void 0:o.top)||0);return a.setMinMax([s,l,0],[s+i.width,l+i.height,0]),a},t.prototype.getLocalBounds=function(){if(this.parentNode){var n=vl(er(),this.parentNode.getWorldTransform()),r=this.getBounds();if(!vi.isEmpty(r)){var i=new vi;return i.setFromTransformedAABB(r,n),i}}return this.getBounds()},t}(Wo),Zk=function(e){Nt(t,e);function t(n){return n===void 0&&(n={}),e.call(this,ke({type:Ze.IMAGE},n))||this}return t}(Wo),Hg=function(e){Nt(t,e);function t(n){n===void 0&&(n={});var r=this,i=n.style,o=Ir(n,["style"]);r=e.call(this,ke({type:Ze.LINE,style:ke({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0},i)},o))||this,r.markerStartAngle=0,r.markerEndAngle=0;var a=r.parsedStyle,s=a.markerStart,l=a.markerEnd;return s&&Wn(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),l&&Wn(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return t.prototype.attributeChangedCallback=function(n,r,i,o,a){n==="x1"||n==="y1"||n==="x2"||n==="y2"||n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(o&&Wn(o)&&(this.markerStartAngle=0,o.remove()),a&&Wn(a)&&(this.markerStartAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!0))):n==="markerEnd"&&(o&&Wn(o)&&(this.markerEndAngle=0,o.remove()),a&&Wn(a)&&(this.markerEndAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!1)))},t.prototype.transformMarker=function(n){var r=this.parsedStyle,i=r.markerStart,o=r.markerEnd,a=r.markerStartOffset,s=r.markerEndOffset,l=r.x1,c=r.x2,u=r.y1,f=r.y2,d=n?i:o;if(!(!d||!Wn(d))){var h=0,p,v,g,m,y,x;n?(g=l,m=u,p=c-l,v=f-u,y=a||0,x=this.markerStartAngle):(g=c,m=f,p=l-c,v=u-f,y=s||0,x=this.markerEndAngle),h=Math.atan2(v,p),d.setLocalEulerAngles(h*180/Math.PI+x),d.setLocalPosition(g+Math.cos(h)*y,m+Math.sin(h)*y)}},t.prototype.getPoint=function(n,r){r===void 0&&(r=!1);var i=this.parsedStyle,o=i.x1,a=i.y1,s=i.x2,l=i.y2,c=ene(o,a,s,l,n),u=c.x,f=c.y,d=Zi(Mn(),Un(u,f,0),r?this.getWorldTransform():this.getLocalTransform());return new So(d[0],d[1])},t.prototype.getPointAtLength=function(n,r){return r===void 0&&(r=!1),this.getPoint(n/this.getTotalLength(),r)},t.prototype.getTotalLength=function(){var n=this.parsedStyle,r=n.x1,i=n.y1,o=n.x2,a=n.y2;return Jte(r,i,o,a)},t}(Wo),ra=function(e){Nt(t,e);function t(n){n===void 0&&(n={});var r=this,i=n.style,o=Ir(n,["style"]);r=e.call(this,ke({type:Ze.PATH,style:Ve.enableCSSParsing?ke({d:"",miterLimit:""},i):ke({},i),initialParsedStyle:Ve.enableCSSParsing?null:{miterLimit:4,d:ke({},vne)}},o))||this,r.markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var a=r.parsedStyle,s=a.markerStart,l=a.markerEnd,c=a.markerMid;return s&&Wn(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),c&&Wn(c)&&r.placeMarkerMid(c),l&&Wn(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return t.prototype.attributeChangedCallback=function(n,r,i,o,a){n==="d"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(o&&Wn(o)&&(this.markerStartAngle=0,o.remove()),a&&Wn(a)&&(this.markerStartAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!0))):n==="markerEnd"?(o&&Wn(o)&&(this.markerEndAngle=0,o.remove()),a&&Wn(a)&&(this.markerEndAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(a)},t.prototype.transformMarker=function(n){var r=this.parsedStyle,i=r.markerStart,o=r.markerEnd,a=r.markerStartOffset,s=r.markerEndOffset,l=n?i:o;if(!(!l||!Wn(l))){var c=0,u,f,d,h,p,v;if(n){var g=se(this.getStartTangent(),2),m=g[0],y=g[1];d=y[0],h=y[1],u=m[0]-y[0],f=m[1]-y[1],p=a||0,v=this.markerStartAngle}else{var x=se(this.getEndTangent(),2),m=x[0],y=x[1];d=y[0],h=y[1],u=m[0]-y[0],f=m[1]-y[1],p=s||0,v=this.markerEndAngle}c=Math.atan2(f,u),l.setLocalEulerAngles(c*180/Math.PI+v),l.setLocalPosition(d+Math.cos(c)*p,h+Math.sin(c)*p)}},t.prototype.placeMarkerMid=function(n){var r=this.parsedStyle.d.segments;if(this.markerMidList.forEach(function(c){c.remove()}),n&&Wn(n))for(var i=1;i<r.length-1;i++){var o=se(r[i].currentPoint,2),a=o[0],s=o[1],l=i===1?n:n.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(a,s)}},t.prototype.getTotalLength=function(){return kk(this)},t.prototype.getPointAtLength=function(n,r){r===void 0&&(r=!1);var i=this.parsedStyle.d.absolutePath,o=qKe(i,n),a=o.x,s=o.y,l=Zi(Mn(),Un(a,s,0),r?this.getWorldTransform():this.getLocalTransform());return new So(l[0],l[1])},t.prototype.getPoint=function(n,r){return r===void 0&&(r=!1),this.getPointAtLength(n*kk(this),r)},t.prototype.getStartTangent=function(){var n=this.parsedStyle.d.segments,r=[];if(n.length>1){var i=n[0].currentPoint,o=n[1].currentPoint,a=n[1].startTangent;r=[],a?(r.push([i[0]-a[0],i[1]-a[1]]),r.push([i[0],i[1]])):(r.push([o[0],o[1]]),r.push([i[0],i[1]]))}return r},t.prototype.getEndTangent=function(){var n=this.parsedStyle.d.segments,r=n.length,i=[];if(r>1){var o=n[r-2].currentPoint,a=n[r-1].currentPoint,s=n[r-1].endTangent;i=[],s?(i.push([a[0]-s[0],a[1]-s[1]]),i.push([a[0],a[1]])):(i.push([o[0],o[1]]),i.push([a[0],a[1]]))}return i},t}(Wo),ub=function(e){Nt(t,e);function t(n){n===void 0&&(n={});var r=this,i=n.style,o=Ir(n,["style"]);r=e.call(this,ke({type:Ze.POLYGON,style:Ve.enableCSSParsing?ke({points:"",miterLimit:"",isClosed:!0},i):ke({},i),initialParsedStyle:Ve.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},o))||this,r.markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var a=r.parsedStyle,s=a.markerStart,l=a.markerEnd,c=a.markerMid;return s&&Wn(s)&&(r.markerStartAngle=s.getLocalEulerAngles(),r.appendChild(s)),c&&Wn(c)&&r.placeMarkerMid(c),l&&Wn(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}return t.prototype.attributeChangedCallback=function(n,r,i,o,a){n==="points"?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):n==="markerStartOffset"||n==="markerEndOffset"?(this.transformMarker(!0),this.transformMarker(!1)):n==="markerStart"?(o&&Wn(o)&&(this.markerStartAngle=0,o.remove()),a&&Wn(a)&&(this.markerStartAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!0))):n==="markerEnd"?(o&&Wn(o)&&(this.markerEndAngle=0,o.remove()),a&&Wn(a)&&(this.markerEndAngle=a.getLocalEulerAngles(),this.appendChild(a),this.transformMarker(!1))):n==="markerMid"&&this.placeMarkerMid(a)},t.prototype.transformMarker=function(n){var r=this.parsedStyle,i=r.markerStart,o=r.markerEnd,a=r.markerStartOffset,s=r.markerEndOffset,l=r.points,c=(l||{}).points,u=n?i:o;if(!(!u||!Wn(u)||!c)){var f=0,d,h,p,v,g,m;if(p=c[0][0],v=c[0][1],n)d=c[1][0]-c[0][0],h=c[1][1]-c[0][1],g=a||0,m=this.markerStartAngle;else{var y=c.length;this.parsedStyle.isClosed?(d=c[y-1][0]-c[0][0],h=c[y-1][1]-c[0][1]):(p=c[y-1][0],v=c[y-1][1],d=c[y-2][0]-c[y-1][0],h=c[y-2][1]-c[y-1][1]),g=s||0,m=this.markerEndAngle}f=Math.atan2(h,d),u.setLocalEulerAngles(f*180/Math.PI+m),u.setLocalPosition(p+Math.cos(f)*g,v+Math.sin(f)*g)}},t.prototype.placeMarkerMid=function(n){var r=this.parsedStyle.points,i=(r||{}).points;if(this.markerMidList.forEach(function(c){c.remove()}),this.markerMidList=[],n&&Wn(n)&&i)for(var o=1;o<(this.parsedStyle.isClosed?i.length:i.length-1);o++){var a=i[o][0],s=i[o][1],l=o===1?n:n.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(a,s)}},t}(Wo),Qk=function(e){Nt(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=Ir(n,["style"]);return e.call(this,ke({type:Ze.POLYLINE,style:Ve.enableCSSParsing?ke({points:"",miterLimit:"",isClosed:!1},r):ke({},r),initialParsedStyle:Ve.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},i))||this}return t.prototype.getTotalLength=function(){return PJe(this)},t.prototype.getPointAtLength=function(n,r){return r===void 0&&(r=!1),this.getPoint(n/this.getTotalLength(),r)},t.prototype.getPoint=function(n,r){r===void 0&&(r=!1);var i=this.parsedStyle.points.points;if(this.parsedStyle.points.segments.length===0){var o=[],a=0,s,l,c=this.getTotalLength();i.forEach(function(g,m){i[m+1]&&(s=[0,0],s[0]=a/c,l=Jte(g[0],g[1],i[m+1][0],i[m+1][1]),a+=l,s[1]=a/c,o.push(s))}),this.parsedStyle.points.segments=o}var u=0,f=0;this.parsedStyle.points.segments.forEach(function(g,m){n>=g[0]&&n<=g[1]&&(u=(n-g[0])/(g[1]-g[0]),f=m)});var d=ene(i[f][0],i[f][1],i[f+1][0],i[f+1][1],u),h=d.x,p=d.y,v=Zi(Mn(),Un(h,p,0),r?this.getWorldTransform():this.getLocalTransform());return new So(v[0],v[1])},t.prototype.getStartTangent=function(){var n=this.parsedStyle.points.points,r=[];return r.push([n[1][0],n[1][1]]),r.push([n[0][0],n[0][1]]),r},t.prototype.getEndTangent=function(){var n=this.parsedStyle.points.points,r=n.length-1,i=[];return i.push([n[r-1][0],n[r-1][1]]),i.push([n[r][0],n[r][1]]),i},t}(ub),Rh=function(e){Nt(t,e);function t(n){return n===void 0&&(n={}),e.call(this,ke({type:Ze.RECT},n))||this}return t}(Wo),xl=function(e){Nt(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=Ir(n,["style"]);return e.call(this,ke({type:Ze.TEXT,style:Ve.enableCSSParsing?ke({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},r):ke({fill:"black"},r)},i))||this}return t.prototype.getComputedTextLength=function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.maxLineWidth)||0},t.prototype.getLineBoundingRects=function(){var n;return this.getGeometryBounds(),((n=this.parsedStyle.metrics)===null||n===void 0?void 0:n.lineMetrics)||[]},t.prototype.isOverflowing=function(){return this.getGeometryBounds(),!!this.parsedStyle.isOverflowing},t}(Wo),Ptt=function(){function e(){this.registry={},this.define(Ze.CIRCLE,kf),this.define(Ze.ELLIPSE,Xk),this.define(Ze.RECT,Rh),this.define(Ze.IMAGE,Zk),this.define(Ze.LINE,Hg),this.define(Ze.GROUP,lo),this.define(Ze.PATH,ra),this.define(Ze.POLYGON,ub),this.define(Ze.POLYLINE,Qk),this.define(Ze.TEXT,xl),this.define(Ze.HTML,xE)}return e.prototype.define=function(t,n){this.registry[t]=n},e.prototype.get=function(t){return this.registry[t]},e}(),nre={number:function(e){return new gr(e)},percent:function(e){return new gr(e,"%")},px:function(e){return new gr(e,"px")},em:function(e){return new gr(e,"em")},rem:function(e){return new gr(e,"rem")},deg:function(e){return new gr(e,"deg")},grad:function(e){return new gr(e,"grad")},rad:function(e){return new gr(e,"rad")},turn:function(e){return new gr(e,"turn")},s:function(e){return new gr(e,"s")},ms:function(e){return new gr(e,"ms")},registerProperty:function(e){var t=e.name,n=e.inherits,r=e.interpolable,i=e.initialValue,o=e.syntax;Ve.styleValueRegistry.registerMetadata({n:t,inh:n,int:r,d:i,syntax:o})},registerLayout:function(e,t){Ve.layoutRegistry.registerLayout(e,t)}},Mtt=function(e){Nt(t,e);function t(){var n=e.call(this)||this;n.defaultView=null,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new Ve.AnimationTimeline(n)}catch(i){}var r={};return zk.forEach(function(i){var o=i.n,a=i.inh,s=i.d;a&&s&&(r[o]=jg(s)?s(Ze.GROUP):s)}),n.documentElement=new lo({id:"g-root",style:r}),n.documentElement.ownerDocument=n,n.documentElement.parentNode=n,n.childNodes=[n.documentElement],n}return Object.defineProperty(t.prototype,"children",{get:function(){return this.childNodes},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childElementCount",{get:function(){return this.childNodes.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"firstElementChild",{get:function(){return this.firstChild},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastElementChild",{get:function(){return this.lastChild},enumerable:!1,configurable:!0}),t.prototype.createElement=function(n,r){if(n==="svg")return this.documentElement;var i=this.defaultView.customElements.get(n);i||(console.warn("Unsupported tagName: ",n),i=n==="tspan"?xl:lo);var o=new i(r);return o.ownerDocument=this,o},t.prototype.createElementNS=function(n,r,i){return this.createElement(r,i)},t.prototype.cloneNode=function(n){throw new Error(vr)},t.prototype.destroy=function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(n){}},t.prototype.elementsFromBBox=function(n,r,i,o){var a=this.defaultView.context.rBushRoot,s=a.search({minX:n,minY:r,maxX:i,maxY:o}),l=[];return s.forEach(function(c){var u=c.displayObject,f=u.parsedStyle.pointerEvents,d=f===void 0?"auto":f,h=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(d);(!h||h&&u.isVisible())&&!u.isCulled()&&u.isInteractive()&&l.push(u)}),l.sort(function(c,u){return u.sortable.renderOrder-c.sortable.renderOrder}),l},t.prototype.elementFromPointSync=function(n,r){var i=this.defaultView.canvas2Viewport({x:n,y:r}),o=i.x,a=i.y,s=this.defaultView.getConfig(),l=s.width,c=s.height;if(o<0||a<0||o>l||a>c)return null;var u=this.defaultView.viewport2Client({x:o,y:a}),f=u.x,d=u.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:n,y:r,viewportX:o,viewportY:a,clientX:f,clientY:d},picked:[]}).picked;return h&&h[0]||this.documentElement},t.prototype.elementFromPoint=function(n,r){return zl(this,void 0,void 0,function(){var i,o,a,s,l,c,u,f,d,h;return ag(this,function(p){switch(p.label){case 0:return i=this.defaultView.canvas2Viewport({x:n,y:r}),o=i.x,a=i.y,s=this.defaultView.getConfig(),l=s.width,c=s.height,o<0||a<0||o>l||a>c?[2,null]:(u=this.defaultView.viewport2Client({x:o,y:a}),f=u.x,d=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:n,y:r,viewportX:o,viewportY:a,clientX:f,clientY:d},picked:[]})]);case 1:return h=p.sent().picked,[2,h&&h[0]||this.documentElement]}})})},t.prototype.elementsFromPointSync=function(n,r){var i=this.defaultView.canvas2Viewport({x:n,y:r}),o=i.x,a=i.y,s=this.defaultView.getConfig(),l=s.width,c=s.height;if(o<0||a<0||o>l||a>c)return[];var u=this.defaultView.viewport2Client({x:o,y:a}),f=u.x,d=u.y,h=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:n,y:r,viewportX:o,viewportY:a,clientX:f,clientY:d},picked:[]}).picked;return h[h.length-1]!==this.documentElement&&h.push(this.documentElement),h},t.prototype.elementsFromPoint=function(n,r){return zl(this,void 0,void 0,function(){var i,o,a,s,l,c,u,f,d,h;return ag(this,function(p){switch(p.label){case 0:return i=this.defaultView.canvas2Viewport({x:n,y:r}),o=i.x,a=i.y,s=this.defaultView.getConfig(),l=s.width,c=s.height,o<0||a<0||o>l||a>c?[2,[]]:(u=this.defaultView.viewport2Client({x:o,y:a}),f=u.x,d=u.y,[4,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:n,y:r,viewportX:o,viewportY:a,clientX:f,clientY:d},picked:[]})]);case 1:return h=p.sent().picked,h[h.length-1]!==this.documentElement&&h.push(this.documentElement),[2,h]}})})},t.prototype.appendChild=function(n,r){throw new Error(Lg)},t.prototype.insertBefore=function(n,r){throw new Error(Lg)},t.prototype.removeChild=function(n,r){throw new Error(Lg)},t.prototype.replaceChild=function(n,r,i){throw new Error(Lg)},t.prototype.append=function(){throw new Error(Lg)},t.prototype.prepend=function(){throw new Error(Lg)},t.prototype.getElementById=function(n){return this.documentElement.getElementById(n)},t.prototype.getElementsByName=function(n){return this.documentElement.getElementsByName(n)},t.prototype.getElementsByTagName=function(n){return this.documentElement.getElementsByTagName(n)},t.prototype.getElementsByClassName=function(n){return this.documentElement.getElementsByClassName(n)},t.prototype.querySelector=function(n){return this.documentElement.querySelector(n)},t.prototype.querySelectorAll=function(n){return this.documentElement.querySelectorAll(n)},t.prototype.find=function(n){return this.documentElement.find(n)},t.prototype.findAll=function(n){return this.documentElement.findAll(n)},t}(so),Ttt=function(){function e(t){this.strategies=t}return e.prototype.apply=function(t){var n=t.camera,r=t.renderingService,i=t.renderingContext,o=this.strategies;r.hooks.cull.tap(e.tag,function(a){if(a){var s=a.cullable;return o.length===0?s.visible=i.unculledEntities.indexOf(a.entity)>-1:s.visible=o.every(function(l){return l.isVisible(n,a)}),!a.isCulled()&&a.isVisible()?a:(a.dispatchEvent(new mr(Sn.CULLED)),null)}return a}),r.hooks.afterRender.tap(e.tag,function(a){a.cullable.visibilityPlaneMask=-1})},e.tag="Culling",e}(),Itt=function(){function e(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Kk(null),this.rootWheelEvent=new Yk(null),this.onPointerMove=function(n){var r,i,o,a,s=(a=(o=t.context.renderingContext.root)===null||o===void 0?void 0:o.ownerDocument)===null||a===void 0?void 0:a.defaultView;if(!(s.supportsTouchEvents&&n.pointerType==="touch")){var l=t.normalizeToPointerEvent(n,s);try{for(var c=Xa(l),u=c.next();!u.done;u=c.next()){var f=u.value,d=t.bootstrapEvent(t.rootPointerEvent,f,s,n);t.context.eventService.mapEvent(d)}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}t.setCursor(t.context.eventService.cursor)}},this.onClick=function(n){var r,i,o,a,s=(a=(o=t.context.renderingContext.root)===null||o===void 0?void 0:o.ownerDocument)===null||a===void 0?void 0:a.defaultView,l=t.normalizeToPointerEvent(n,s);try{for(var c=Xa(l),u=c.next();!u.done;u=c.next()){var f=u.value,d=t.bootstrapEvent(t.rootPointerEvent,f,s,n);t.context.eventService.mapEvent(d)}}catch(h){r={error:h}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}t.setCursor(t.context.eventService.cursor)}}return e.prototype.apply=function(t){var n=this;this.context=t;var r=t.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(o){var a=n.context.renderingService.hooks.pickSync.call({position:o,picked:[],topmost:!0}).picked;return a[0]||null}),r.hooks.pointerWheel.tap(e.tag,function(o){var a=n.normalizeWheelEvent(o);n.context.eventService.mapEvent(a)}),r.hooks.pointerDown.tap(e.tag,function(o){var a,s;if(!(i.supportsTouchEvents&&o.pointerType==="touch")){var l=n.normalizeToPointerEvent(o,i);if(n.autoPreventDefault&&l[0].isNormalized){var c=o.cancelable||!("cancelable"in o);c&&o.preventDefault()}try{for(var u=Xa(l),f=u.next();!f.done;f=u.next()){var d=f.value,h=n.bootstrapEvent(n.rootPointerEvent,d,i,o);n.context.eventService.mapEvent(h)}}catch(p){a={error:p}}finally{try{f&&!f.done&&(s=u.return)&&s.call(u)}finally{if(a)throw a.error}}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerUp.tap(e.tag,function(o){var a,s;if(!(i.supportsTouchEvents&&o.pointerType==="touch")){var l=n.context.contextService.getDomElement(),c=n.context.eventService.isNativeEventFromCanvas(l,o),u=c?"":"outside",f=n.normalizeToPointerEvent(o,i);try{for(var d=Xa(f),h=d.next();!h.done;h=d.next()){var p=h.value,v=n.bootstrapEvent(n.rootPointerEvent,p,i,o);v.type+=u,n.context.eventService.mapEvent(v)}}catch(g){a={error:g}}finally{try{h&&!h.done&&(s=d.return)&&s.call(d)}finally{if(a)throw a.error}}n.setCursor(n.context.eventService.cursor)}}),r.hooks.pointerMove.tap(e.tag,this.onPointerMove),r.hooks.pointerOver.tap(e.tag,this.onPointerMove),r.hooks.pointerOut.tap(e.tag,this.onPointerMove),r.hooks.click.tap(e.tag,this.onClick),r.hooks.pointerCancel.tap(e.tag,function(o){var a,s,l=n.normalizeToPointerEvent(o,i);try{for(var c=Xa(l),u=c.next();!u.done;u=c.next()){var f=u.value,d=n.bootstrapEvent(n.rootPointerEvent,f,i,o);n.context.eventService.mapEvent(d)}}catch(h){a={error:h}}finally{try{u&&!u.done&&(s=c.return)&&s.call(c)}finally{if(a)throw a.error}}n.setCursor(n.context.eventService.cursor)})},e.prototype.bootstrapEvent=function(t,n,r,i){t.view=r,t.originalEvent=null,t.nativeEvent=i,t.pointerId=n.pointerId,t.width=n.width,t.height=n.height,t.isPrimary=n.isPrimary,t.pointerType=n.pointerType,t.pressure=n.pressure,t.tangentialPressure=n.tangentialPressure,t.tiltX=n.tiltX,t.tiltY=n.tiltY,t.twist=n.twist,this.transferMouseData(t,n);var o=this.context.eventService.client2Viewport({x:n.clientX,y:n.clientY}),a=o.x,s=o.y;t.viewport.x=a,t.viewport.y=s;var l=this.context.eventService.viewport2Canvas(t.viewport),c=l.x,u=l.y;return t.canvas.x=c,t.canvas.y=u,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=i.isTrusted,t.type==="pointerleave"&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Eet[t.type]||t.type),t},e.prototype.normalizeWheelEvent=function(t){var n=this.rootWheelEvent;this.transferMouseData(n,t),n.deltaMode=t.deltaMode,n.deltaX=t.deltaX,n.deltaY=t.deltaY,n.deltaZ=t.deltaZ;var r=this.context.eventService.client2Viewport({x:t.clientX,y:t.clientY}),i=r.x,o=r.y;n.viewport.x=i,n.viewport.y=o;var a=this.context.eventService.viewport2Canvas(n.viewport),s=a.x,l=a.y;return n.canvas.x=s,n.canvas.y=l,n.global.copyFrom(n.canvas),n.offset.copyFrom(n.canvas),n.nativeEvent=t,n.type=t.type,n},e.prototype.transferMouseData=function(t,n){t.isTrusted=n.isTrusted,t.srcElement=n.srcElement,t.timeStamp=Vk.now(),t.type=n.type,t.altKey=n.altKey,t.metaKey=n.metaKey,t.shiftKey=n.shiftKey,t.ctrlKey=n.ctrlKey,t.button=n.button,t.buttons=n.buttons,t.client.x=n.clientX,t.client.y=n.clientY,t.movement.x=n.movementX,t.movement.y=n.movementY,t.page.x=n.pageX,t.page.y=n.pageY,t.screen.x=n.screenX,t.screen.y=n.screenY,t.relatedTarget=null},e.prototype.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},e.prototype.normalizeToPointerEvent=function(t,n){var r=[];if(n.isTouchEvent(t))for(var i=0;i<t.changedTouches.length;i++){var o=t.changedTouches[i];xr(o.button)&&(o.button=0),xr(o.buttons)&&(o.buttons=1),xr(o.isPrimary)&&(o.isPrimary=t.touches.length===1&&t.type==="touchstart"),xr(o.width)&&(o.width=o.radiusX||1),xr(o.height)&&(o.height=o.radiusY||1),xr(o.tiltX)&&(o.tiltX=0),xr(o.tiltY)&&(o.tiltY=0),xr(o.pointerType)&&(o.pointerType="touch"),xr(o.pointerId)&&(o.pointerId=o.identifier||0),xr(o.pressure)&&(o.pressure=o.force||.5),xr(o.twist)&&(o.twist=0),xr(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,o.type=t.type,r.push(o)}else if(n.isMouseEvent(t)){var a=t;xr(a.isPrimary)&&(a.isPrimary=!0),xr(a.width)&&(a.width=1),xr(a.height)&&(a.height=1),xr(a.tiltX)&&(a.tiltX=0),xr(a.tiltY)&&(a.tiltY=0),xr(a.pointerType)&&(a.pointerType="mouse"),xr(a.pointerId)&&(a.pointerId=Oet),xr(a.pressure)&&(a.pressure=.5),xr(a.twist)&&(a.twist=0),xr(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,r.push(a)}else r.push(t);return r},e.tag="Event",e}(),Rtt=[Ze.CIRCLE,Ze.ELLIPSE,Ze.IMAGE,Ze.RECT,Ze.LINE,Ze.POLYLINE,Ze.POLYGON,Ze.TEXT,Ze.PATH,Ze.HTML],Ntt=function(){function e(){}return e.prototype.isVisible=function(t,n){var r,i,o=n.cullable;if(!o.enable)return!0;var a=n.getRenderBounds();if(vi.isEmpty(a))return!1;var s=t.getFrustum(),l=(i=(r=n.parentNode)===null||r===void 0?void 0:r.cullable)===null||i===void 0?void 0:i.visibilityPlaneMask;return o.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,a,l||Tf.INDETERMINATE,s.planes),o.visible=o.visibilityPlaneMask!==Tf.OUTSIDE,o.visible},e.prototype.computeVisibilityWithPlaneMask=function(t,n,r,i){if(r===Tf.OUTSIDE||r===Tf.INSIDE)return r;for(var o=Tf.INSIDE,a=Rtt.indexOf(t.nodeName)>-1,s=0,l=i.length;s<l;++s){var c=1<<s;if(r&c&&!(a&&(s===4||s===5))){var u=i[s],f=u.normal,d=u.distance;if(Wl(f,n.getPositiveFarPoint(i[s]))+d<0)return Tf.OUTSIDE;Wl(f,n.getNegativeFarPoint(i[s]))+d<0&&(o|=c)}}return o},e}(),ktt=function(){function e(){this.toSync=new Set,this.isFirstTimeRendering=!0,this.syncing=!1,this.isFirstTimeRenderingFinished=!1}return e.prototype.apply=function(t){var n=this,r,i=t.renderingService,o=t.renderingContext,a=t.rBushRoot,s=o.root.ownerDocument.defaultView;this.rBush=a;var l=function(h){var p=h.target;p.renderable.dirty=!0,i.dirtify()},c=function(h){var p=h.detail.affectChildren,v=h.target;p&&v.forEach(function(m){n.toSync.add(m)});for(var g=v;g;)g.renderable&&n.toSync.add(g),g=g.parentElement;i.dirtify()},u=function(h){var p=h.target;Ve.enableSizeAttenuation&&Ve.styleValueRegistry.updateSizeAttenuation(p,s.getCamera().getZoom()),Ve.enableCSSParsing&&Ve.styleValueRegistry.recalc(p),Ve.sceneGraphService.dirtifyToRoot(p),i.dirtify()},f=function(h){var p=h.target,v=p.rBushNode;v.aabb&&n.rBush.remove(v.aabb),n.toSync.delete(p),Ve.sceneGraphService.dirtifyToRoot(p),i.dirtify()};i.hooks.init.tap(e.tag,function(){s.addEventListener(Sn.MOUNTED,u),s.addEventListener(Sn.UNMOUNTED,f),s.addEventListener(Sn.ATTR_MODIFIED,l),s.addEventListener(Sn.BOUNDS_CHANGED,c)}),i.hooks.destroy.tap(e.tag,function(){s.removeEventListener(Sn.MOUNTED,u),s.removeEventListener(Sn.UNMOUNTED,f),s.removeEventListener(Sn.ATTR_MODIFIED,l),s.removeEventListener(Sn.BOUNDS_CHANGED,c),n.toSync.clear()});var d=(r=Ve.globalThis.requestIdleCallback)!==null&&r!==void 0?r:Uk.bind(Ve.globalThis);i.hooks.endFrame.tap(e.tag,function(){n.isFirstTimeRendering?(n.isFirstTimeRendering=!1,n.syncing=!0,d(function(){n.syncRTree(!0),n.isFirstTimeRenderingFinished=!0})):n.syncRTree()})},e.prototype.syncRTree=function(t){var n=this;if(t===void 0&&(t=!1),!(!t&&(this.syncing||this.toSync.size===0))){this.syncing=!0;var r=[];Array.from(this.toSync).filter(function(i){return i.isConnected}).forEach(function(i){var o=i.rBushNode;o&&o.aabb&&n.rBush.remove(o.aabb);var a=i.getRenderBounds();if(a){var s=i.renderable;t&&(s.dirtyRenderBounds||(s.dirtyRenderBounds=new vi),s.dirtyRenderBounds.update(a.center,a.halfExtents));var l=se(a.getMin(),2),c=l[0],u=l[1],f=se(a.getMax(),2),d=f[0],h=f[1];o.aabb||(o.aabb={}),o.aabb.displayObject=i,o.aabb.minX=c,o.aabb.minY=u,o.aabb.maxX=d,o.aabb.maxY=h}o.aabb&&!isNaN(o.aabb.maxX)&&!isNaN(o.aabb.maxX)&&!isNaN(o.aabb.minX)&&!isNaN(o.aabb.minY)&&r.push(o.aabb)}),this.rBush.load(r),r.length=0,this.toSync.clear(),this.syncing=!1}},e.tag="Prepare",e}(),_a;(function(e){e.READY="ready",e.BEFORE_RENDER="beforerender",e.RERENDER="rerender",e.AFTER_RENDER="afterrender",e.BEFORE_DESTROY="beforedestroy",e.AFTER_DESTROY="afterdestroy",e.RESIZE="resize",e.DIRTY_RECTANGLE="dirtyrectangle",e.RENDERER_CHANGED="rendererchanged"})(_a||(_a={}));var rre=500,Att=.1,Ltt=1e3,Jk=new mr(Sn.MOUNTED),e6=new mr(Sn.UNMOUNTED),ire=new mr(_a.BEFORE_RENDER),jtt=new mr(_a.RERENDER),ore=new mr(_a.AFTER_RENDER),are=function(e){Nt(t,e);function t(n){var r=e.call(this)||this;r.Element=Wo,r.inited=!1,r.context={},r.document=new Mtt,r.document.defaultView=r,r.customElements=new Ptt;var i=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,l=n.height,c=n.devicePixelRatio,u=n.renderer,f=n.background,d=n.cursor,h=n.document,p=n.requestAnimationFrame,v=n.cancelAnimationFrame,g=n.createImage,m=n.supportsPointerEvents,y=n.supportsTouchEvents,x=n.supportsCSSTransform,S=n.supportsMutipleCanvasesInOneContainer,w=n.useNativeClickEvent,C=n.alwaysTriggerPointerEventOnCanvas,O=n.isTouchEvent,E=n.isMouseEvent;S||met(i,r);var _=s,$=l,P=c;return o&&(P=c||sb&&window.devicePixelRatio||1,P=P>=1?Math.ceil(P):1,_=s||wet(o)||o.width/P,$=l||Cet(o)||o.height/P),a&&(Ve.offscreenCanvas=a),r.devicePixelRatio=P,r.requestAnimationFrame=p!=null?p:Uk.bind(Ve.globalThis),r.cancelAnimationFrame=v!=null?v:Une.bind(Ve.globalThis),r.supportsTouchEvents=y!=null?y:"ontouchstart"in Ve.globalThis,r.supportsPointerEvents=m!=null?m:!!Ve.globalThis.PointerEvent,r.isTouchEvent=O!=null?O:function(T){return r.supportsTouchEvents&&T instanceof Ve.globalThis.TouchEvent},r.isMouseEvent=E!=null?E:function(T){return!Ve.globalThis.MouseEvent||T instanceof Ve.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(T instanceof Ve.globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:o,width:_,height:$,renderer:u,offscreenCanvas:a,devicePixelRatio:P,cursor:d||"default",background:f||"transparent",createImage:g,document:h,supportsCSSTransform:x,useNativeClickEvent:w,alwaysTriggerPointerEventOnCanvas:C}),r.initDefaultCamera(_,$,u.clipSpaceNearZ),r.initRenderer(u,!0),r}return t.prototype.initRenderingContext=function(n){this.context.config=n,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},t.prototype.initDefaultCamera=function(n,r,i){var o=this,a=new Ve.CameraContribution;a.clipSpaceNearZ=i,a.setType(nr.EXPLORING,rb.DEFAULT).setPosition(n/2,r/2,rre).setFocalPoint(n/2,r/2,0).setOrthographic(n/-2,n/2,r/2,r/-2,Att,Ltt),a.canvas=this,a.eventEmitter.on(lne.UPDATED,function(){o.context.renderingContext.renderReasons.add(Nf.CAMERA_CHANGED),Ve.enableSizeAttenuation&&o.getConfig().renderer.getConfig().enableSizeAttenuation&&o.updateSizeAttenuation()}),this.context.camera=a},t.prototype.updateSizeAttenuation=function(){var n=this.getCamera().getZoom();this.document.documentElement.forEach(function(r){Ve.styleValueRegistry.updateSizeAttenuation(r,n)})},t.prototype.getConfig=function(){return this.context.config},t.prototype.getRoot=function(){return this.document.documentElement},t.prototype.getCamera=function(){return this.context.camera},t.prototype.getContextService=function(){return this.context.contextService},t.prototype.getEventService=function(){return this.context.eventService},t.prototype.getRenderingService=function(){return this.context.renderingService},t.prototype.getRenderingContext=function(){return this.context.renderingContext},t.prototype.getStats=function(){return this.getRenderingService().getStats()},Object.defineProperty(t.prototype,"ready",{get:function(){var n=this;return this.readyPromise||(this.readyPromise=new Promise(function(r){n.resolveReadyPromise=function(){r(n)}}),this.inited&&this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),t.prototype.destroy=function(n,r){if(n===void 0&&(n=!0),r===void 0&&(r=!1),r||this.dispatchEvent(new mr(_a.BEFORE_DESTROY)),this.frameId){var i=this.getConfig().cancelAnimationFrame||cancelAnimationFrame;i(this.frameId)}var o=this.getRoot();this.unmountChildren(o),n&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),n&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),r||this.dispatchEvent(new mr(_a.AFTER_DESTROY))},t.prototype.changeSize=function(n,r){this.resize(n,r)},t.prototype.resize=function(n,r){var i=this.context.config;i.width=n,i.height=r,this.getContextService().resize(n,r);var o=this.context.camera,a=o.getProjectionMode();o.setPosition(n/2,r/2,rre).setFocalPoint(n/2,r/2,0),a===wa.ORTHOGRAPHIC?o.setOrthographic(n/-2,n/2,r/2,r/-2,o.getNear(),o.getFar()):o.setAspect(n/r),this.dispatchEvent(new mr(_a.RESIZE,{width:n,height:r}))},t.prototype.appendChild=function(n,r){return this.document.documentElement.appendChild(n,r)},t.prototype.insertBefore=function(n,r){return this.document.documentElement.insertBefore(n,r)},t.prototype.removeChild=function(n){return this.document.documentElement.removeChild(n)},t.prototype.removeChildren=function(){this.document.documentElement.removeChildren()},t.prototype.destroyChildren=function(){this.document.documentElement.destroyChildren()},t.prototype.render=function(n){var r=this;n&&(ire.detail=n,ore.detail=n),this.dispatchEvent(ire);var i=this.getRenderingService();i.render(this.getConfig(),n,function(){r.dispatchEvent(jtt)}),this.dispatchEvent(ore)},t.prototype.run=function(){var n=this,r=function(i,o){n.render(o),n.frameId=n.requestAnimationFrame(r)};r()},t.prototype.initRenderer=function(n,r){var i=this;if(r===void 0&&(r=!1),!n)throw new Error("Renderer is required.");this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new NQe,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Itt,new ktt,new Ttt([new Ntt])),this.loadRendererContainerModule(n),this.context.contextService=new this.context.ContextService(ke(ke({},Ve),this.context)),this.context.renderingService=new ntt(Ve,this.context),this.context.eventService=new ett(Ve,this.context),this.context.eventService.init(),this.context.contextService.init?(this.context.contextService.init(),this.initRenderingService(n,r,!0)):this.context.contextService.initAsync().then(function(){i.initRenderingService(n,r)})},t.prototype.initRenderingService=function(n,r,i){var o=this;r===void 0&&(r=!1),i===void 0&&(i=!1),this.context.renderingService.init(function(){o.inited=!0,r?i?o.requestAnimationFrame(function(){o.dispatchEvent(new mr(_a.READY))}):o.dispatchEvent(new mr(_a.READY)):o.dispatchEvent(new mr(_a.RENDERER_CHANGED)),o.readyPromise&&o.resolveReadyPromise(),r||o.getRoot().forEach(function(a){var s=a.renderable;s&&(s.renderBoundsDirty=!0,s.boundsDirty=!0,s.dirty=!0)}),o.mountChildren(o.getRoot()),n.getConfig().enableAutoRendering&&o.run()})},t.prototype.loadRendererContainerModule=function(n){var r=this,i=n.getPlugins();i.forEach(function(o){o.context=r.context,o.init(Ve)})},t.prototype.setRenderer=function(n){var r=this.getConfig();if(r.renderer!==n){var i=r.renderer;r.renderer=n,this.destroy(!1,!0),it([],se(i==null?void 0:i.getPlugins()),!1).reverse().forEach(function(o){o.destroy(Ve)}),this.initRenderer(n)}},t.prototype.setCursor=function(n){var r=this.getConfig();r.cursor=n,this.getContextService().applyCursorStyle(n)},t.prototype.unmountChildren=function(n){var r=this;n.childNodes.forEach(function(i){r.unmountChildren(i)}),this.inited&&(n.isMutationObserved?n.dispatchEvent(e6):(e6.target=n,this.dispatchEvent(e6,!0)),n!==this.document.documentElement&&(n.ownerDocument=null),n.isConnected=!1),n.isCustomElement&&n.disconnectedCallback&&n.disconnectedCallback()},t.prototype.mountChildren=function(n){var r=this;this.inited?n.isConnected||(n.ownerDocument=this.document,n.isConnected=!0,n.isMutationObserved?n.dispatchEvent(Jk):(Jk.target=n,this.dispatchEvent(Jk,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",n.nodeName),n.childNodes.forEach(function(i){r.mountChildren(i)}),n.isCustomElement&&n.connectedCallback&&n.connectedCallback()},t.prototype.client2Viewport=function(n){return this.getEventService().client2Viewport(n)},t.prototype.viewport2Client=function(n){return this.getEventService().viewport2Client(n)},t.prototype.viewport2Canvas=function(n){return this.getEventService().viewport2Canvas(n)},t.prototype.canvas2Viewport=function(n){return this.getEventService().canvas2Viewport(n)},t.prototype.getPointByClient=function(n,r){return this.client2Viewport({x:n,y:r})},t.prototype.getClientByPoint=function(n,r){return this.viewport2Client({x:n,y:r})},t}(Yne),Dtt=function(e){Nt(t,e);function t(){var n=e.apply(this,it([],se(arguments),!1))||this;return n.landmarks=[],n}return t.prototype.rotate=function(n,r,i){if(this.relElevation=Ag(r),this.relAzimuth=Ag(n),this.relRoll=Ag(i),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===nr.EXPLORING){var o=Sf(Ii(),[1,0,0],pr((this.rotateWorld?1:-1)*this.relElevation)),a=Sf(Ii(),[0,1,0],pr((this.rotateWorld?1:-1)*this.relAzimuth)),s=Sf(Ii(),[0,0,1],pr(this.relRoll)),l=wf(Ii(),a,o);l=wf(Ii(),l,s);var c=hN(er(),l);hg(this.matrix,this.matrix,[0,0,-this.distance]),Do(this.matrix,this.matrix,c),hg(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===nr.ORBITING||this.type===nr.EXPLORING?this._getPosition():this.type===nr.TRACKING&&this._getFocalPoint(),this._update(),this},t.prototype.pan=function(n,r){var i=ta(n,r,0),o=Xc(this.position);return vg(o,o,vN(Mn(),this.right,i[0])),vg(o,o,vN(Mn(),this.up,i[1])),this._setPosition(o),this.triggerUpdate(),this},t.prototype.dolly=function(n){var r=this.forward,i=Xc(this.position),o=n*this.dollyingStep,a=this.distance+n*this.dollyingStep;return o=Math.max(Math.min(a,this.maxDistance),this.minDistance)-this.distance,i[0]+=o*r[0],i[1]+=o*r[1],i[2]+=o*r[2],this._setPosition(i),this.type===nr.ORBITING||this.type===nr.EXPLORING?this._getDistance():this.type===nr.TRACKING&&vg(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},t.prototype.cancelLandmarkAnimation=function(){this.landmarkAnimationID!==void 0&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},t.prototype.createLandmark=function(n,r){var i,o,a,s;r===void 0&&(r={});var l=r.position,c=l===void 0?this.position:l,u=r.focalPoint,f=u===void 0?this.focalPoint:u,d=r.roll,h=r.zoom,p=new Ve.CameraContribution;p.setType(this.type,void 0),p.setPosition(c[0],(i=c[1])!==null&&i!==void 0?i:this.position[1],(o=c[2])!==null&&o!==void 0?o:this.position[2]),p.setFocalPoint(f[0],(a=f[1])!==null&&a!==void 0?a:this.focalPoint[1],(s=f[2])!==null&&s!==void 0?s:this.focalPoint[2]),p.setRoll(d!=null?d:this.roll),p.setZoom(h!=null?h:this.zoom);var v={name:n,matrix:uN(p.getWorldTransform()),right:Xc(p.right),up:Xc(p.up),forward:Xc(p.forward),position:Xc(p.getPosition()),focalPoint:Xc(p.getFocalPoint()),distanceVector:Xc(p.getDistanceVector()),distance:p.getDistance(),dollyingStep:p.getDollyingStep(),azimuth:p.getAzimuth(),elevation:p.getElevation(),roll:p.getRoll(),relAzimuth:p.relAzimuth,relElevation:p.relElevation,relRoll:p.relRoll,zoom:p.getZoom()};return this.landmarks.push(v),v},t.prototype.gotoLandmark=function(n,r){var i=this;r===void 0&&(r={});var o=Wr(n)?this.landmarks.find(function($){return $.name===n}):n;if(o){var a=_r(r)?{duration:r}:r,s=a.easing,l=s===void 0?"linear":s,c=a.duration,u=c===void 0?100:c,f=a.easingFunction,d=f===void 0?void 0:f,h=a.onfinish,p=h===void 0?void 0:h,v=a.onframe,g=v===void 0?void 0:v,m=.01;this.cancelLandmarkAnimation();var y=o.position,x=o.focalPoint,S=o.zoom,w=o.roll,C=d||Ve.EasingFunction(l),O,E=function(){i.setFocalPoint(x),i.setPosition(y),i.setRoll(w),i.setZoom(S),i.computeMatrix(),i.triggerUpdate(),p==null||p()};if(u===0)return E();var _=function($){O===void 0&&(O=$);var P=$-O;if(P>=u){E();return}var T=C(P/u),I=Mn(),M=Mn(),R=1,N=0;gN(I,i.focalPoint,x,T),gN(M,i.position,y,T),N=i.roll*(1-T)+w*T,R=i.zoom*(1-T)+S*T,i.setFocalPoint(I),i.setPosition(M),i.setRoll(N),i.setZoom(R);var k=gJ(I,x)+gJ(M,y);if(k<=m&&S==null&&w==null)return E();i.computeMatrix(),i.triggerUpdate(),P<u&&(g==null||g(T),i.landmarkAnimationID=i.canvas.requestAnimationFrame(_))};this.canvas.requestAnimationFrame(_)}},t}(une);Ve.CameraContribution=Dtt;var t6=function(e){Nt(t,e);function t(n,r,i,o){var a=e.call(this,n)||this;return a.currentTime=i,a.timelineTime=o,a.target=r,a.type="finish",a.bubbles=!1,a.currentTarget=r,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=i,a.timelineTime=o,a}return t}(yE),Ftt=0,Btt=function(){function e(t,n){var r;this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._playbackRate=1,this._inTimeline=!0,this.effect=t,t.animation=this,this.timeline=n,this.id="".concat(Ftt++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number((r=this.effect)===null||r===void 0?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return Object.defineProperty(e.prototype,"pending",{get:function(){return this._startTime===null&&!this._paused&&this.playbackRate!==0||this.currentTimePending},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playState",{get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ready",{get:function(){var t=this;return this.readyPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise(function(n,r){t.resolveReadyPromise=function(){n(t)},t.rejectReadyPromise=function(){r(new Error)}}),this.pending||this.resolveReadyPromise()),this.readyPromise},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"finished",{get:function(){var t=this;return this.finishedPromise||(this.timeline.animationsWithPromises.indexOf(this)===-1&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise(function(n,r){t.resolveFinishedPromise=function(){n(t)},t.rejectFinishedPromise=function(){r(new Error)}}),this.playState==="finished"&&this.resolveFinishedPromise()),this.finishedPromise},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"currentTime",{get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){var n;t=Number(t),!isNaN(t)&&(this.timeline.restart(),!this._paused&&this._startTime!==null&&(this._startTime=Number((n=this.timeline)===null||n===void 0?void 0:n.currentTime)-t/this.playbackRate),this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this)))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"startTime",{get:function(){return this._startTime},set:function(t){if(t!==null){if(this.updatePromises(),t=Number(t),isNaN(t)||this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var n=this.currentTime;this._playbackRate=t,this.startTime=null,this.playState!=="paused"&&this.playState!=="idle"&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),n!==null&&(this.currentTime=n),this.updatePromises()}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_isFinished",{get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||this._playbackRate<0&&Number(this._currentTime)<=0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"totalDuration",{get:function(){return this._totalDuration},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"_needsTick",{get:function(){return this.pending||this.playState==="running"||!this._finishedFlag},enumerable:!1,configurable:!0}),e.prototype.updatePromises=function(){var t=this.oldPlayState,n=this.pending?"pending":this.playState;return this.readyPromise&&n!==t&&(n==="idle"?(this.rejectReadyPromise(),this.readyPromise=void 0):t==="pending"?this.resolveReadyPromise():n==="pending"&&(this.readyPromise=void 0)),this.finishedPromise&&n!==t&&(n==="idle"?(this.rejectFinishedPromise(),this.finishedPromise=void 0):n==="finished"?this.resolveFinishedPromise():t==="finished"&&(this.finishedPromise=void 0)),this.oldPlayState=n,this.readyPromise||this.finishedPromise},e.prototype.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),this.timeline.animations.indexOf(this)===-1&&this.timeline.animations.push(this),this.updatePromises()},e.prototype.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),!this._isFinished&&!this._paused&&!this._idle?this.currentTimePending=!0:this._idle&&(this.rewind(),this._idle=!1),this._startTime=null,this._paused=!0,this.updatePromises()},e.prototype.finish=function(){this.updatePromises(),!this._idle&&(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.prototype.cancel=function(){var t=this;if(this.updatePromises(),!!this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises(),this.oncancel)){var n=new t6(null,this,this.currentTime,null);setTimeout(function(){t.oncancel(n)})}},e.prototype.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),t!==null&&(this.currentTime=t),this.updatePromises()},e.prototype.updatePlaybackRate=function(t){this.playbackRate=t},e.prototype.targetAnimations=function(){var t,n=(t=this.effect)===null||t===void 0?void 0:t.target;return n.getAnimations()},e.prototype.markTarget=function(){var t=this.targetAnimations();t.indexOf(this)===-1&&t.push(this)},e.prototype.unmarkTarget=function(){var t=this.targetAnimations(),n=t.indexOf(this);n!==-1&&t.splice(n,1)},e.prototype.tick=function(t,n){!this._idle&&!this._paused&&(this._startTime===null?n&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),n&&(this.currentTimePending=!1,this.fireEvents(t))},e.prototype.rewind=function(){if(this.playbackRate>=0)this.currentTime=0;else if(this._totalDuration<1/0)this.currentTime=this._totalDuration;else throw new Error("Unable to rewind negative playback rate animation with infinite duration")},e.prototype.persist=function(){throw new Error(vr)},e.prototype.addEventListener=function(t,n,r){throw new Error(vr)},e.prototype.removeEventListener=function(t,n,r){throw new Error(vr)},e.prototype.dispatchEvent=function(t){throw new Error(vr)},e.prototype.commitStyles=function(){throw new Error(vr)},e.prototype.ensureAlive=function(){var t,n;this.playbackRate<0&&this.currentTime===0?this._inEffect=!!(!((t=this.effect)===null||t===void 0)&&t.update(-1)):this._inEffect=!!(!((n=this.effect)===null||n===void 0)&&n.update(this.currentTime)),!this._inTimeline&&(this._inEffect||!this._finishedFlag)&&(this._inTimeline=!0,this.timeline.animations.push(this))},e.prototype.tickCurrentTime=function(t,n){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!n&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},e.prototype.fireEvents=function(t){var n=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var r=new t6(null,this,this.currentTime,t);setTimeout(function(){n.onfinish&&n.onfinish(r)})}this._finishedFlag=!0}}else{if(this.onframe&&this.playState==="running"){var i=new t6(null,this,this.currentTime,t);this.onframe(i)}this._finishedFlag=!1}},e}(),ztt=4,Htt=.001,Wtt=1e-7,Vtt=10,fb=11,SE=1/(fb-1),Utt=typeof Float32Array=="function",sre=function(e,t){return 1-3*t+3*e},lre=function(e,t){return 3*t-6*e},cre=function(e){return 3*e},wE=function(e,t,n){return((sre(t,n)*e+lre(t,n))*e+cre(t))*e},ure=function(e,t,n){return 3*sre(t,n)*e*e+2*lre(t,n)*e+cre(t)},qtt=function(e,t,n,r,i){var o,a,s=0;do a=t+(n-t)/2,o=wE(a,r,i)-e,o>0?n=a:t=a;while(Math.abs(o)>Wtt&&++s<Vtt);return a},Gtt=function(e,t,n,r){for(var i=0;i<ztt;++i){var o=ure(t,n,r);if(o===0)return t;var a=wE(t,n,r)-e;t-=a/o}return t},n6=function(e,t,n,r){if(!(0<=e&&e<=1&&0<=n&&n<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===t&&n===r)return function(s){return s};for(var i=Utt?new Float32Array(fb):new Array(fb),o=0;o<fb;++o)i[o]=wE(o*SE,e,n);var a=function(s){for(var l=0,c=1,u=fb-1;c!==u&&i[c]<=s;++c)l+=SE;--c;var f=(s-i[c])/(i[c+1]-i[c]),d=l+f*SE,h=ure(d,e,n);return h>=Htt?Gtt(s,d,e,n):h===0?d:qtt(s,l,l+SE,e,n)};return function(s){return s===0||s===1?s:wE(a(s),t,r)}},Ktt=function(e){return e=e.replace(/([A-Z])/g,function(t){return"-".concat(t.toLowerCase())}),e.charAt(0)==="-"?e.substring(1):e},CE=function(e){return Math.pow(e,2)},OE=function(e){return Math.pow(e,3)},EE=function(e){return Math.pow(e,4)},_E=function(e){return Math.pow(e,5)},$E=function(e){return Math.pow(e,6)},PE=function(e){return 1-Math.cos(e*Math.PI/2)},ME=function(e){return 1-Math.sqrt(1-e*e)},TE=function(e){return e*e*(3*e-2)},IE=function(e){for(var t,n=4;e<((t=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)},RE=function(e,t){t===void 0&&(t=[]);var n=se(t,2),r=n[0],i=r===void 0?1:r,o=n[1],a=o===void 0?.5:o,s=ai(Number(i),1,10),l=ai(Number(a),.1,2);return e===0||e===1?e:-s*Math.pow(2,10*(e-1))*Math.sin((e-1-l/(Math.PI*2)*Math.asin(1/s))*(Math.PI*2)/l)},db=function(e,t,n){t===void 0&&(t=[]);var r=se(t,4),i=r[0],o=i===void 0?1:i,a=r[1],s=a===void 0?100:a,l=r[2],c=l===void 0?10:l,u=r[3],f=u===void 0?0:u;o=ai(o,.1,1e3),s=ai(s,.1,1e3),c=ai(c,.1,1e3),f=ai(f,.1,1e3);var d=Math.sqrt(s/o),h=c/(2*Math.sqrt(s*o)),p=h<1?d*Math.sqrt(1-h*h):0,v=1,g=h<1?(h*d+-f)/p:-f+d,m=n?n*e/1e3:e;return h<1?m=Math.exp(-m*h*d)*(v*Math.cos(p*m)+g*Math.sin(p*m)):m=(v+g*m)*Math.exp(-m*d),e===0||e===1?e:1-m},r6=function(e,t){t===void 0&&(t=[]);var n=se(t,2),r=n[0],i=r===void 0?10:r,o=n[1],a=o=="start"?Math.ceil:Math.floor;return a(ai(e,0,1)*i)/i},fre=function(e,t){t===void 0&&(t=[]);var n=se(t,4),r=n[0],i=n[1],o=n[2],a=n[3];return n6(r,i,o,a)(e)},NE=n6(.42,0,1,1),Ms=function(e){return function(t,n,r){return n===void 0&&(n=[]),1-e(1-t,n,r)}},Ts=function(e){return function(t,n,r){return n===void 0&&(n=[]),t<.5?e(t*2,n,r)/2:1-e(t*-2+2,n,r)/2}},Is=function(e){return function(t,n,r){return n===void 0&&(n=[]),t<.5?(1-e(1-t*2,n,r))/2:(e(t*2-1,n,r)+1)/2}},dre={steps:r6,"step-start":function(e){return r6(e,[1,"start"])},"step-end":function(e){return r6(e,[1,"end"])},linear:function(e){return e},"cubic-bezier":fre,ease:function(e){return fre(e,[.25,.1,.25,1])},in:NE,out:Ms(NE),"in-out":Ts(NE),"out-in":Is(NE),"in-quad":CE,"out-quad":Ms(CE),"in-out-quad":Ts(CE),"out-in-quad":Is(CE),"in-cubic":OE,"out-cubic":Ms(OE),"in-out-cubic":Ts(OE),"out-in-cubic":Is(OE),"in-quart":EE,"out-quart":Ms(EE),"in-out-quart":Ts(EE),"out-in-quart":Is(EE),"in-quint":_E,"out-quint":Ms(_E),"in-out-quint":Ts(_E),"out-in-quint":Is(_E),"in-expo":$E,"out-expo":Ms($E),"in-out-expo":Ts($E),"out-in-expo":Is($E),"in-sine":PE,"out-sine":Ms(PE),"in-out-sine":Ts(PE),"out-in-sine":Is(PE),"in-circ":ME,"out-circ":Ms(ME),"in-out-circ":Ts(ME),"out-in-circ":Is(ME),"in-back":TE,"out-back":Ms(TE),"in-out-back":Ts(TE),"out-in-back":Is(TE),"in-bounce":IE,"out-bounce":Ms(IE),"in-out-bounce":Ts(IE),"out-in-bounce":Is(IE),"in-elastic":RE,"out-elastic":Ms(RE),"in-out-elastic":Ts(RE),"out-in-elastic":Is(RE),spring:db,"spring-in":db,"spring-out":Ms(db),"spring-in-out":Ts(db),"spring-out-in":Is(db)},Ytt=function(e){return Ktt(e).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()},Xtt=function(e){return dre[Ytt(e)]||dre.linear},Ztt=function(e){return e},Qtt=1,Jtt=.5,hre=0;function pre(e,t){return function(n){if(n>=1)return 1;var r=1/e;return n+=t*r,n-n%r}}var kE="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",ent=new RegExp("cubic-bezier\\("+kE+","+kE+","+kE+","+kE+"\\)"),tnt=/steps\(\s*(\d+)\s*\)/,nnt=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function i6(e){var t=ent.exec(e);if(t)return n6.apply(void 0,it([],se(t.slice(1).map(Number)),!1));var n=tnt.exec(e);if(n)return pre(Number(n[1]),hre);var r=nnt.exec(e);return r?pre(Number(r[1]),{start:Qtt,middle:Jtt,end:hre}[r[2]]):Xtt(e)}function rnt(e){return Math.abs(int(e)/(e.playbackRate||1))}function int(e){var t;return e.duration===0||e.iterations===0?0:(e.duration==="auto"?0:Number(e.duration))*((t=e.iterations)!==null&&t!==void 0?t:1)}var vre=0,o6=1,AE=2,gre=3;function ont(e,t,n){if(t===null)return vre;var r=n.endTime;return t<Math.min(n.delay,r)?o6:t>=Math.min(n.delay+e+n.endDelay,r)?AE:gre}function ant(e,t,n,r,i){switch(r){case o6:return t==="backwards"||t==="both"?0:null;case gre:return n-i;case AE:return t==="forwards"||t==="both"?e:null;case vre:return null}}function snt(e,t,n,r,i){var o=i;return e===0?t!==o6&&(o+=n):o+=r/e,o}function lnt(e,t,n,r,i,o){var a=e===1/0?t%1:e%1;return a===0&&n===AE&&r!==0&&(i!==0||o===0)&&(a=1),a}function cnt(e,t,n,r){return e===AE&&t===1/0?1/0:n===1?Math.floor(r)-1:Math.floor(r)}function unt(e,t,n){var r=e;if(e!=="normal"&&e!=="reverse"){var i=t;e==="alternate-reverse"&&(i+=1),r="normal",i!==1/0&&i%2!==0&&(r="reverse")}return r==="normal"?n:1-n}function fnt(e,t,n){var r=ont(e,t,n),i=ant(e,n.fill,t,r,n.delay);if(i===null)return null;var o=n.duration==="auto"?0:n.duration,a=snt(o,r,n.iterations,i,n.iterationStart),s=lnt(a,n.iterationStart,r,n.iterations,i,o),l=cnt(r,n.iterations,s,a),c=unt(n.direction,l,s);return n.currentIteration=l,n.progress=c,n.easingFunction(c)}function dnt(e,t,n){var r=hnt(e,t),i=pnt(r,n);return function(o,a){if(a!==null)i.filter(function(l){return a>=l.applyFrom&&a<l.applyTo}).forEach(function(l){var c=a-l.startOffset,u=l.endOffset-l.startOffset,f=u===0?0:c/u;o.setAttribute(l.property,l.interpolation(f),!1,!1)});else for(var s in r)mre(s)&&o.setAttribute(s,null)}}function mre(e){return e!=="offset"&&e!=="easing"&&e!=="composite"&&e!=="computedOffset"}function hnt(e,t){for(var n={},r=0;r<e.length;r++)for(var i in e[r])if(mre(i)){var o={offset:e[r].offset,computedOffset:e[r].computedOffset,easing:e[r].easing,easingFunction:i6(e[r].easing)||t.easingFunction,value:e[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}function pnt(e,t){var n=[];for(var r in e)for(var i=e[r],o=0;o<i.length-1;o++){var a=o,s=o+1,l=i[a].computedOffset,c=i[s].computedOffset,u=l,f=c;o===0&&(u=-1/0,c===0&&(s=a)),o===i.length-2&&(f=1/0,l===1&&(a=s)),n.push({applyFrom:u,applyTo:f,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:vnt(r,i[a].value,i[s].value,t)})}return n.sort(function(d,h){return d.startOffset-h.startOffset}),n}var yre=function(e,t,n){return function(r){var i=bre(e,t,r);return!Ve.enableCSSParsing&&_r(i)?i:n(i)}};function vnt(e,t,n,r){var i=Rf[e];if(i&&i.syntax&&i.int){var o=Ve.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=void 0,s=void 0;if(Ve.enableCSSParsing){var l=Ve.styleValueRegistry.parseProperty(e,t,r,!1),c=Ve.styleValueRegistry.parseProperty(e,n,r,!1);a=Ve.styleValueRegistry.computeProperty(e,l,r,!1),s=Ve.styleValueRegistry.computeProperty(e,c,r,!1)}else{var u=o.parserWithCSSDisabled;a=u?u(t,r):t,s=u?u(n,r):n}var f=o.mixer(a,s,r);if(f){var d=yre.apply(void 0,it([],se(f),!1));return function(h){return h===0?t:h===1?n:d(h)}}}}return yre(!1,!0,function(h){return h?n:t})}function bre(e,t,n){if(typeof e=="number"&&typeof t=="number")return e*(1-n)+t*n;if(typeof e=="boolean"&&typeof t=="boolean"||typeof e=="string"&&typeof t=="string")return n<.5?e:t;if(Array.isArray(e)&&Array.isArray(t)){for(var r=e.length,i=t.length,o=Math.max(r,i),a=[],s=0;s<o;s++)a.push(bre(e[s<r?s:r-1],t[s<i?s:i-1],n));return a}throw new Error("Mismatched interpolation arguments "+e+":"+t)}var gnt=function(){function e(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Ztt,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.currentIteration=null,this.progress=null}return Object.defineProperty(e.prototype,"easing",{get:function(){return this._easing},set:function(t){this.easingFunction=i6(t),this._easing=t},enumerable:!1,configurable:!0}),e}();function mnt(e){var t=[];for(var n in e)if(!(n in["easing","offset","composite"])){var r=e[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;o<i;o++){if(!t[o]){var a={};"offset"in e&&(a.offset=Number(e.offset)),"easing"in e&&(a.easing=e.easing),"composite"in e&&(a.composite=e.composite),t[o]=a}r[o]!==void 0&&r[o]!==null&&(t[o][n]=r[o])}}return t.sort(function(s,l){return(s.computedOffset||0)-(l.computedOffset||0)}),t}function xre(e,t){if(e===null)return[];Array.isArray(e)||(e=mnt(e));for(var n=e.map(function(l){var c={};t!=null&&t.composite&&(c.composite="auto");for(var u in l){var f=l[u];if(u==="offset"){if(f!==null){if(f=Number(f),!isFinite(f))throw new Error("Keyframe offsets must be numbers.");if(f<0||f>1)throw new Error("Keyframe offsets must be between 0 and 1.");c.computedOffset=f}}else if(u==="composite"&&["replace","add","accumulate","auto"].indexOf(f)===-1)throw new Error("".concat(f," compositing is not supported"));c[u]=f}return c.offset===void 0&&(c.offset=null),c.easing===void 0&&(c.easing=(t==null?void 0:t.easing)||"linear"),c.composite===void 0&&(c.composite="auto"),c}),r=!0,i=-1/0,o=0;o<n.length;o++){var a=n[o].offset;if(hn(a))r=!1;else{if(a<i)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}n=n.filter(function(l){return Number(l.offset)>=0&&Number(l.offset)<=1});function s(){var l,c,u=n.length;n[u-1].computedOffset=Number((l=n[u-1].offset)!==null&&l!==void 0?l:1),u>1&&(n[0].computedOffset=Number((c=n[0].offset)!==null&&c!==void 0?c:0));for(var f=0,d=Number(n[0].computedOffset),h=1;h<u;h++){var p=n[h].computedOffset;if(!hn(p)&&!hn(d)){for(var v=1;v<h-f;v++)n[f+v].computedOffset=d+(Number(p)-d)*v/(h-f);f=h,d=Number(p)}}}return r||s(),n}var ynt="backwards|forwards|both|none".split("|"),bnt="reverse|alternate|alternate-reverse".split("|");function xnt(e,t){var n=new gnt;return typeof e=="number"&&!isNaN(e)?n.duration=e:e!==void 0&&Object.keys(e).forEach(function(r){if(e[r]!==void 0&&e[r]!==null&&e[r]!=="auto"){if((typeof n[r]=="number"||r==="duration")&&(typeof e[r]!="number"||isNaN(e[r]))||r==="fill"&&ynt.indexOf(e[r])===-1||r==="direction"&&bnt.indexOf(e[r])===-1)return;n[r]=e[r]}}),n}function Snt(e,t){return e=wnt(e!=null?e:{duration:"auto"}),xnt(e)}function wnt(e){return typeof e=="number"&&(isNaN(e)?e={duration:"auto"}:e={duration:e}),e}var Cnt=function(){function e(t,n,r){var i=this;this.composite="replace",this.iterationComposite="replace",this.target=t,this.timing=Snt(r),this.timing.effect=this,this.timing.activeDuration=rnt(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=xre(n,this.timing),this.interpolations=dnt(this.normalizedKeyframes,this.timing,this.target);var o=Ve.globalThis.Proxy;this.computedTiming=o?new o(this.timing,{get:function(a,s){return s==="duration"?a.duration==="auto"?0:a.duration:s==="fill"?a.fill==="auto"?"none":a.fill:s==="localTime"?i.animation&&i.animation.currentTime||null:s==="currentIteration"?!i.animation||i.animation.playState!=="running"?null:a.currentIteration||0:s==="progress"?!i.animation||i.animation.playState!=="running"?null:a.progress||0:a[s]},set:function(){return!0}}):this.timing}return e.prototype.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.prototype.update=function(t){return t===null?!1:(this.timeFraction=fnt(this.timing.activeDuration,t,this.timing),this.timeFraction!==null)},e.prototype.getKeyframes=function(){return this.normalizedKeyframes},e.prototype.setKeyframes=function(t){this.normalizedKeyframes=xre(t)},e.prototype.getComputedTiming=function(){return this.computedTiming},e.prototype.getTiming=function(){return this.timing},e.prototype.updateTiming=function(t){var n=this;Object.keys(t||{}).forEach(function(r){n.timing[r]=t[r]})},e}();function Sre(e,t){return Number(e.id)-Number(t.id)}var Ont=function(){function e(t){var n=this;this.document=t,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.webAnimationsNextTick=function(r){n.currentTime=r,n.discardAnimations(),n.animations.length===0?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(r){var i=n.rafCallbacks;n.rafCallbacks=[],r<Number(n.currentTime)&&(r=Number(n.currentTime)),n.animations.sort(Sre),n.animations=n.tick(r,!0,n.animations)[0],i.forEach(function(o){o[1](r)}),n.applyPendingEffects()}}return e.prototype.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.prototype.isTicking=function(){return this.inTick},e.prototype.play=function(t,n,r){var i=new Cnt(t,n,r),o=new Btt(i,this);return this.animations.push(o),this.restartWebAnimationsNextTick(),o.updatePromises(),o.play(),o.updatePromises(),o},e.prototype.applyDirtiedAnimation=function(t){var n=this;if(!this.inTick){t.markTarget();var r=t.targetAnimations();r.sort(Sre);var i=this.tick(Number(this.currentTime),!1,r.slice())[1];i.forEach(function(o){var a=n.animations.indexOf(o);a!==-1&&n.animations.splice(a,1)}),this.applyPendingEffects()}},e.prototype.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame(function(){}),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.prototype.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.prototype.applyPendingEffects=function(){this.pendingEffects.forEach(function(t){t==null||t.applyInterpolations()}),this.pendingEffects=[]},e.prototype.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter(function(t){return t.updatePromises()})},e.prototype.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter(function(t){return t.playState!=="finished"&&t.playState!=="idle"})},e.prototype.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.prototype.rAF=function(t){var n=this.rafId++;return this.rafCallbacks.length===0&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([n,t]),n},e.prototype.requestAnimationFrame=function(t){var n=this;return this.rAF(function(r){n.updateAnimationsPromises(),t(r),n.updateAnimationsPromises()})},e.prototype.tick=function(t,n,r){var i,o,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var s=[],l=[],c=[],u=[];return r.forEach(function(f){f.tick(t,n),f._inEffect?(l.push(f.effect),f.markTarget()):(s.push(f.effect),f.unmarkTarget()),f._needsTick&&(a.ticking=!0);var d=f._inEffect||f._needsTick;f._inTimeline=d,d?c.push(f):u.push(f)}),(i=this.pendingEffects).push.apply(i,it([],se(s),!1)),(o=this.pendingEffects).push.apply(o,it([],se(l),!1)),this.ticking&&this.requestAnimationFrame(function(){}),this.inTick=!1,[c,u]},e}();Ve.EasingFunction=i6,Ve.AnimationTimeline=Ont;function Jt(e){return new LE([e],null,e,e.ownerDocument)}let LE=class $o{constructor(t=null,n=null,r=null,i=null,o=[null,null,null,null,null],a=[],s=[]){this._elements=Array.from(t),this._data=n,this._parent=r,this._document=i,this._enter=o[0],this._update=o[1],this._exit=o[2],this._merge=o[3],this._split=o[4],this._transitions=a,this._facetElements=s}selectAll(t){const n=typeof t=="string"?this._parent.querySelectorAll(t):t;return new $o(n,null,this._elements[0],this._document)}selectFacetAll(t){const n=typeof t=="string"?this._parent.querySelectorAll(t):t;return new $o(this._elements,null,this._parent,this._document,void 0,void 0,n)}select(t){const n=typeof t=="string"?this._parent.querySelectorAll(t)[0]||null:t;return new $o([n],null,n,this._document)}append(t){const n=typeof t=="function"?t:()=>this.createElement(t),r=[];if(this._data!==null){for(let i=0;i<this._data.length;i++){const o=this._data[i],[a,s]=Array.isArray(o)?o:[o,null],l=n(a,i);l.__data__=a,s!==null&&(l.__fromElements__=s),this._parent.appendChild(l),r.push(l)}return new $o(r,null,this._parent,this._document)}else{for(let i=0;i<this._elements.length;i++){const o=this._elements[i],a=o.__data__,s=n(a,i);o.appendChild(s),r.push(s)}return new $o(r,null,r[0],this._document)}}maybeAppend(t,n,r){const i=this._elements[0],o=i.getElementById(t);if(o)return new $o([o],null,this._parent,this._document);const a=typeof n=="string"?this.createElement(n):n();return a.id=t,r&&(a.className=r),i.appendChild(a),new $o([a],null,this._parent,this._document)}data(t,n=i=>i,r=()=>null){const i=[],o=[],a=new Set(this._elements),s=[],l=new Set,c=new Map(this._elements.map((h,p)=>[n(h.__data__,p),h])),u=new Map(this._facetElements.map((h,p)=>[n(h.__data__,p),h])),f=Rr(this._elements,h=>r(h.__data__));for(let h=0;h<t.length;h++){const p=t[h],v=n(p,h),g=r(p,h);if(c.has(v)){const m=c.get(v);m.__data__=p,m.__facet__=!1,o.push(m),a.delete(m),c.delete(v)}else if(u.has(v)){const m=u.get(v);m.__data__=p,m.__facet__=!0,o.push(m),u.delete(v)}else if(f.has(v)){const m=f.get(v);s.push([p,m]);for(const y of m)a.delete(y);f.delete(v)}else if(c.has(g)){const m=c.get(g);m.__toData__?m.__toData__.push(p):m.__toData__=[p],l.add(m),a.delete(m)}else i.push(p)}const d=[new $o([],i,this._parent,this._document),new $o(o,null,this._parent,this._document),new $o(a,null,this._parent,this._document),new $o([],s,this._parent,this._document),new $o(l,null,this._parent,this._document)];return new $o(this._elements,null,this._parent,this._document,d)}merge(t){const n=[...this._elements,...t._elements],r=[...this._transitions,...t._transitions];return new $o(n,null,this._parent,this._document,void 0,r)}createElement(t){if(this._document)return this._document.createElement(t,{});const n=$o.registry[t];return n?new n:Sg(`Unknown node type: ${t}`)}join(t=a=>a,n=a=>a,r=a=>a.remove(),i=a=>a,o=a=>a.remove()){const a=t(this._enter),s=n(this._update),l=r(this._exit),c=i(this._merge),u=o(this._split);return s.merge(a).merge(l).merge(c).merge(u)}remove(){for(let t=0;t<this._elements.length;t++){const n=this._transitions[t];if(n){const r=Array.isArray(n)?n:[n];Promise.all(r.map(i=>i.finished)).then(()=>{this._elements[t].remove()})}else this._elements[t].remove()}return new $o([],null,this._parent,this._document,void 0,this._transitions)}each(t){for(let n=0;n<this._elements.length;n++){const r=this._elements[n],i=r.__data__;t(i,n,r)}return this}attr(t,n){const r=typeof n!="function"?()=>n:n;return this.each(function(i,o,a){n!==void 0&&(a[t]=r(i,o,a))})}style(t,n){const r=typeof n!="function"?()=>n:n;return this.each(function(i,o,a){n!==void 0&&(a.style[t]=r(i,o,a))})}transition(t){const n=typeof t!="function"?()=>t:t,{_transitions:r}=this;return this.each(function(i,o,a){r[o]=n(i,o,a)})}on(t,n){return this.each(function(r,i,o){o.addEventListener(t,n)}),this}call(t,...n){return t(this,...n),this}node(){return this._elements[0]}nodes(){return this._elements}transitions(){return this._transitions}parent(){return this._parent}};LE.registry={g:lo,rect:Rh,circle:kf,path:ra,text:xl,ellipse:Xk,image:Zk,line:Hg,polygon:ub,polyline:Qk,html:xE};function jE(e,t,n){return Math.max(t,Math.min(e,n))}function DE(e,t=10){return typeof e!="number"||Math.abs(e)<1e-15?e:parseFloat(e.toFixed(t))}function Dt(e,t){for(const[n,r]of Object.entries(t))e.style(n,r)}function Ent(e,t){return t.forEach((n,r)=>r===0?e.moveTo(n[0],n[1]):e.lineTo(n[0],n[1])),e.closePath(),e}function _nt(e,t,n){const{arrowSize:r}=n,i=typeof r=="string"?+parseFloat(r)/100*Zr(e,t):r,o=Math.PI/6,a=Math.atan2(t[1]-e[1],t[0]-e[0]),s=Math.PI/2-a-o,l=[t[0]-i*Math.sin(s),t[1]-i*Math.cos(s)],c=a-o,u=[t[0]-i*Math.cos(c),t[1]-i*Math.sin(c)];return[l,u]}function hb(e,t,n,r,i){const o=Es(li(r,t))+Math.PI,a=Es(li(r,n))+Math.PI;return e.arc(r[0],r[1],i,o,a,a-o<0),e}function wre(e,t,n,r="y",i="between",o=!1){const a=(g,m)=>g==="y"||g===!0?m?180:90:m?90:0,s=r==="y"||r===!0?n:t,l=a(r,o),c=vh(s),[u,f]=Qc(c,g=>s[g]),d=new $r({domain:[u,f],range:[0,100]}),h=g=>_r(s[g])&&!Number.isNaN(s[g])?d.map(s[g]):0,p={between:g=>`${e[g]} ${h(g)}%`,start:g=>g===0?`${e[g]} ${h(g)}%`:`${e[g-1]} ${h(g)}%, ${e[g]} ${h(g)}%`,end:g=>g===e.length-1?`${e[g]} ${h(g)}%`:`${e[g]} ${h(g)}%, ${e[g+1]} ${h(g)}%`},v=c.sort((g,m)=>h(g)-h(m)).map(p[i]||p.between).join(",");return`linear-gradient(${l}deg, ${v})`}function FE(e){const[t,n,r,i]=e;return[i,t,n,r]}function Nh(e,t,n){const[r,i,,o]=kr(e)?FE(t):t,[a,s]=n,l=e.getCenter(),c=_g(li(r,l)),u=_g(li(i,l)),f=u===c&&a!==s?u+Math.PI*2:u;return{startAngle:c,endAngle:f-c>=0?f:Math.PI*2+f,innerRadius:Zr(o,l),outerRadius:Zr(r,l)}}function a6(e){const{colorAttribute:t,opacityAttribute:n=t}=e;return`${n}Opacity`}function Cre(e,t){if(!hr(e))return"";const n=e.getCenter(),{transform:r}=t;return`translate(${n[0]}, ${n[1]}) ${r||""}`}function s6(e){if(e.length===1)return e[0];const[[t,n,r=0],[i,o,a=0]]=e;return[(t+i)/2,(n+o)/2,(r+a)/2]}var BE=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function Ore(e,t,n,r,i={}){const{inset:o=0,radius:a=0,insetLeft:s=o,insetTop:l=o,insetRight:c=o,insetBottom:u=o,radiusBottomLeft:f=a,radiusBottomRight:d=a,radiusTopLeft:h=a,radiusTopRight:p=a,minWidth:v=-1/0,maxWidth:g=1/0,minHeight:m=-1/0}=i,y=BE(i,["inset","radius","insetLeft","insetTop","insetRight","insetBottom","radiusBottomLeft","radiusBottomRight","radiusTopLeft","radiusTopRight","minWidth","maxWidth","minHeight"]);if(!hr(r)&&!kte(r)){const E=!!kr(r),[_,,$]=E?FE(t):t,[P,T]=_,[I,M]=li($,_),R=I>0?P:P+I,N=M>0?T:T+M,k=Math.abs(I),A=Math.abs(M),j=R+s,D=N+l,L=k-(s+c),F=A-(l+u),B=E?jE(L,m,1/0):jE(L,v,g),H=E?jE(F,v,g):jE(F,m,1/0),z=E?j:j-(B-L)/2,W=E?D-(H-F)/2:D-(H-F);return Jt(e.createElement("rect",{})).style("x",z).style("y",W).style("width",B).style("height",H).style("radius",[h,p,d,f]).call(Dt,y).node()}const{y:x,y1:S}=n,w=r.getCenter(),C=Nh(r,t,[x,S]),O=XO().cornerRadius(a).padAngle(o*Math.PI/180);return Jt(e.createElement("path",{})).style("d",O(C)).style("transform",`translate(${w[0]}, ${w[1]})`).style("radius",a).style("inset",o).call(Dt,y).node()}const pb=(e,t)=>{const{colorAttribute:n,opacityAttribute:r="fill",first:i=!0,last:o=!0}=e,a=BE(e,["colorAttribute","opacityAttribute","first","last"]),{coordinate:s,document:l}=t;return(c,u,f)=>{const{color:d,radius:h=0}=f,p=BE(f,["color","radius"]),v=p.lineWidth||1,{stroke:g,radius:m=h,radiusTopLeft:y=m,radiusTopRight:x=m,radiusBottomRight:S=m,radiusBottomLeft:w=m,innerRadius:C=0,innerRadiusTopLeft:O=C,innerRadiusTopRight:E=C,innerRadiusBottomRight:_=C,innerRadiusBottomLeft:$=C,lineWidth:P=n==="stroke"||g?v:0,inset:T=0,insetLeft:I=T,insetRight:M=T,insetBottom:R=T,insetTop:N=T,minWidth:k,maxWidth:A,minHeight:j}=a,D=BE(a,["stroke","radius","radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft","innerRadius","innerRadiusTopLeft","innerRadiusTopRight","innerRadiusBottomRight","innerRadiusBottomLeft","lineWidth","inset","insetLeft","insetRight","insetBottom","insetTop","minWidth","maxWidth","minHeight"]),{color:L=d,opacity:F}=u,B=[i?y:O,i?x:E,o?S:_,o?w:$],H=["radiusTopLeft","radiusTopRight","radiusBottomRight","radiusBottomLeft"];kr(s)&&H.push(H.shift());const z=Object.assign(Object.assign({radius:m},Object.fromEntries(H.map((W,V)=>[W,B[V]]))),{inset:T,insetLeft:I,insetRight:M,insetBottom:R,insetTop:N,minWidth:k,maxWidth:A,minHeight:j});return Jt(Ore(l,c,u,s,z)).call(Dt,p).style("fill","transparent").style(n,L).style(a6(e),F).style("lineWidth",P).style("stroke",g===void 0?L:g).call(Dt,D).node()}};pb.props={defaultEnterAnimation:"scaleInY",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const kh=(e,t)=>pb(Object.assign({colorAttribute:"fill"},e),t);kh.props=Object.assign(Object.assign({},pb.props),{defaultMarker:"square"});const zE=(e,t)=>pb(Object.assign({colorAttribute:"stroke"},e),t);zE.props=Object.assign(Object.assign({},pb.props),{defaultMarker:"hollowSquare"});var Ere=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function $nt(e,t,n){const[r,i,o,a]=e;if(kr(n)){const c=[t?t[0][0]:i[0],i[1]],u=[t?t[3][0]:o[0],o[1]];return[r,c,u,a]}const s=[i[0],t?t[0][1]:i[1]],l=[o[0],t?t[3][1]:o[1]];return[r,s,l,a]}const l6=(e,t)=>{const{adjustPoints:n=$nt}=e,r=Ere(e,["adjustPoints"]),{coordinate:i,document:o}=t;return(a,s,l,c)=>{const{index:u}=s,{color:f}=l,d=Ere(l,["color"]),h=c[u+1],p=n(a,h,i),v=!!kr(i),[g,m,y,x]=v?FE(p):p,{color:S=f,opacity:w}=s,C=Sh().curve(ck)([g,m,y,x]);return Jt(o.createElement("path",{})).call(Dt,d).style("d",C).style("fill",S).style("fillOpacity",w).call(Dt,r).node()}};l6.props={defaultMarker:"square"};function Pnt(e,t,n){const[r,i,o,a]=e;if(kr(n)){const c=[t?t[0][0]:(i[0]+o[0])/2,i[1]],u=[t?t[3][0]:(i[0]+o[0])/2,o[1]];return[r,c,u,a]}const s=[i[0],t?t[0][1]:(i[1]+o[1])/2],l=[o[0],t?t[3][1]:(i[1]+o[1])/2];return[r,s,l,a]}const _re=(e,t)=>l6(Object.assign({adjustPoints:Pnt},e),t);_re.props={defaultMarker:"square"};function Wg(e){const t=typeof e=="function"?e:e.render;return class extends bE{connectedCallback(){this.draw()}attributeChangedCallback(){this.draw()}draw(){t(this)}}}var $re=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Mnt=Wg(e=>{const{d1:t,d2:n,style1:r,style2:i}=e.attributes,o=e.ownerDocument;Jt(e).maybeAppend("line",()=>o.createElement("path",{})).style("d",t).call(Dt,r),Jt(e).maybeAppend("line1",()=>o.createElement("path",{})).style("d",n).call(Dt,i)});function Tnt(e,t){const n=[],r=[];let i=!1,o=null;for(const a of e)!t(a[0])||!t(a[1])?i=!0:(n.push(a),i&&(i=!1,r.push([o,a])),o=a);return[n,r]}const Rs=(e,t)=>{const{curve:n,gradient:r=!1,gradientColor:i="between",defined:o=u=>!Number.isNaN(u)&&u!==void 0&&u!==null,connect:a=!1}=e,s=$re(e,["curve","gradient","gradientColor","defined","connect"]),{coordinate:l,document:c}=t;return(u,f,d)=>{const{color:h,lineWidth:p}=d,v=$re(d,["color","lineWidth"]),{color:g=h,size:m=p,seriesColor:y,seriesX:x,seriesY:S}=f,w=Cre(l,f),C=kr(l),O=r&&y?wre(y,x,S,r,i,C):g,E=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},v),O&&{stroke:O}),m&&{lineWidth:m}),w&&{transform:w}),s);let _;if(hr(l)){const R=l.getCenter();_=N=>ZZe().angle((k,A)=>_g(li(N[A],R))).radius((k,A)=>Zr(N[A],R)).defined(([k,A])=>o(k)&&o(A)).curve(n)(N)}else _=Sh().x(R=>R[0]).y(R=>R[1]).defined(([R,N])=>o(R)&&o(N)).curve(n);const[$,P]=Tnt(u,o),T=bt(E,"connect"),I=!!P.length;if(!I||a&&!Object.keys(T).length)return Jt(c.createElement("path",{})).style("d",_($)||[]).call(Dt,E).node();if(I&&!a)return Jt(c.createElement("path",{})).style("d",_(u)).call(Dt,E).node();const M=R=>R.map(_).join(",");return Jt(new Mnt).style("style1",Object.assign(Object.assign({},E),T)).style("style2",E).style("d1",M(P)).style("d2",_(u)).node()}};Rs.props={defaultMarker:"smooth",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const Pre=(e,t)=>{const{coordinate:n}=t;return(...r)=>{const i=hr(n)?ck:Z1;return Rs(Object.assign({curve:i},e),t)(...r)}};Pre.props=Object.assign(Object.assign({},Rs.props),{defaultMarker:"line"});var Int=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const Mre=(e,t)=>{const n=Int(e,[]),{coordinate:r}=t;return(...i)=>{const o=hr(r)?wte:kr(r)?Tte:Mte;return Rs(Object.assign({curve:o},n),t)(...i)}};Mre.props=Object.assign(Object.assign({},Rs.props),{defaultMarker:"smooth"});const Tre=(e,t)=>Rs(Object.assign({curve:Nte},e),t);Tre.props=Object.assign(Object.assign({},Rs.props),{defaultMarker:"hv"});const Ire=(e,t)=>Rs(Object.assign({curve:Rte},e),t);Ire.props=Object.assign(Object.assign({},Rs.props),{defaultMarker:"vh"});const Rre=(e,t)=>Rs(Object.assign({curve:Ite},e),t);Rre.props=Object.assign(Object.assign({},Rs.props),{defaultMarker:"hvh"});var Rnt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function Nnt(e,t,n,r,i){const o=li(n,t),a=Es(o),s=a+Math.PI/2,l=[r/2*Math.cos(s),r/2*Math.sin(s)],c=[i/2*Math.cos(s),i/2*Math.sin(s)],u=[i/2*Math.cos(a),i/2*Math.sin(a)],f=[r/2*Math.cos(a),r/2*Math.sin(a)],d=GO(t,l),h=GO(n,c),p=GO(h,u),v=GO(n,u),g=li(v,c),m=li(n,c),y=li(t,l),x=li(y,f),S=li(t,f),w=li(d,f);e.moveTo(...d),e.lineTo(...h),e.arcTo(...p,...v,i/2),e.arcTo(...g,...m,i/2),e.lineTo(...y),e.arcTo(...x,...S,r/2),e.arcTo(...w,...d,r/2),e.closePath()}const Nre=(e,t)=>{const{document:n}=t;return(r,i,o)=>{const{seriesSize:a,color:s}=i,{color:l}=o,c=Rnt(o,["color"]),u=_s();for(let f=0;f<r.length-1;f++){const d=r[f],h=r[f+1],p=a[f],v=a[f+1];[...d,...h].every(wr)&&Nnt(u,d,h,p,v)}return Jt(n.createElement("path",{})).call(Dt,c).style("fill",s||l).style("d",u.toString()).call(Dt,e).node()}};Nre.props=Object.assign(Object.assign({},Rs.props),{defaultMarker:"line"});var knt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const c6=(e,t,n)=>[["M",e-n,t],["A",n,n,0,1,0,e+n,t],["A",n,n,0,1,0,e-n,t],["Z"]];c6.style=["fill"];const kre=c6.bind(void 0);kre.style=["stroke","lineWidth"];const HE=(e,t,n)=>[["M",e-n,t-n],["L",e+n,t-n],["L",e+n,t+n],["L",e-n,t+n],["Z"]];HE.style=["fill"];const Are=HE.bind(void 0);Are.style=["fill"];const Lre=HE.bind(void 0);Lre.style=["stroke","lineWidth"];const u6=(e,t,n)=>{const r=n*.618;return[["M",e-r,t],["L",e,t-n],["L",e+r,t],["L",e,t+n],["Z"]]};u6.style=["fill"];const jre=u6.bind(void 0);jre.style=["stroke","lineWidth"];const f6=(e,t,n)=>{const r=n*Math.sin(.3333333333333333*Math.PI);return[["M",e-n,t+r],["L",e,t-r],["L",e+n,t+r],["Z"]]};f6.style=["fill"];const Dre=f6.bind(void 0);Dre.style=["stroke","lineWidth"];const d6=(e,t,n)=>{const r=n*Math.sin(.3333333333333333*Math.PI);return[["M",e-n,t-r],["L",e+n,t-r],["L",e,t+r],["Z"]]};d6.style=["fill"];const Fre=d6.bind(void 0);Fre.style=["stroke","lineWidth"];const h6=(e,t,n)=>{const r=n/2*Math.sqrt(3);return[["M",e,t-n],["L",e+r,t-n/2],["L",e+r,t+n/2],["L",e,t+n],["L",e-r,t+n/2],["L",e-r,t-n/2],["Z"]]};h6.style=["fill"];const Bre=h6.bind(void 0);Bre.style=["stroke","lineWidth"];const p6=(e,t,n)=>{const r=n-1.5;return[["M",e-n,t-r],["L",e+n,t+r],["L",e+n,t-r],["L",e-n,t+r],["Z"]]};p6.style=["fill"];const zre=p6.bind(void 0);zre.style=["stroke","lineWidth"];const Hre=(e,t,n)=>[["M",e,t+n],["L",e,t-n]];Hre.style=["stroke","lineWidth"];const Wre=(e,t,n)=>[["M",e-n,t-n],["L",e+n,t+n],["M",e+n,t-n],["L",e-n,t+n]];Wre.style=["stroke","lineWidth"];const Vre=(e,t,n)=>[["M",e-n/2,t-n],["L",e+n/2,t-n],["M",e,t-n],["L",e,t+n],["M",e-n/2,t+n],["L",e+n/2,t+n]];Vre.style=["stroke","lineWidth"];const Ure=(e,t,n)=>[["M",e-n,t],["L",e+n,t],["M",e,t-n],["L",e,t+n]];Ure.style=["stroke","lineWidth"];const qre=(e,t,n)=>[["M",e-n,t],["L",e+n,t]];qre.style=["stroke","lineWidth"];const v6=(e,t,n)=>[["M",e-n,t],["L",e+n,t]];v6.style=["stroke","lineWidth"];const Gre=v6.bind(void 0);Gre.style=["stroke","lineWidth"];const Kre=(e,t,n)=>[["M",e-n,t],["A",n/2,n/2,0,1,1,e,t],["A",n/2,n/2,0,1,0,e+n,t]];Kre.style=["stroke","lineWidth"];const Yre=(e,t,n)=>[["M",e-n-1,t-2.5],["L",e,t-2.5],["L",e,t+2.5],["L",e+n+1,t+2.5]];Yre.style=["stroke","lineWidth"];const Xre=(e,t,n)=>[["M",e-n-1,t+2.5],["L",e,t+2.5],["L",e,t-2.5],["L",e+n+1,t-2.5]];Xre.style=["stroke","lineWidth"];const Zre=(e,t,n)=>[["M",e-(n+1),t+2.5],["L",e-n/2,t+2.5],["L",e-n/2,t-2.5],["L",e+n/2,t-2.5],["L",e+n/2,t+2.5],["L",e+n+1,t+2.5]];Zre.style=["stroke","lineWidth"];const Qre=(e,t,n)=>[["M",e-5,t+2.5],["L",e-5,t],["L",e,t],["L",e,t-3],["L",e,t+3],["L",e+6.5,t+3]];Qre.style=["stroke","lineWidth"];const WE=new Map([["bowtie",p6],["cross",Wre],["dash",Gre],["diamond",u6],["dot",v6],["hexagon",h6],["hollowBowtie",zre],["hollowDiamond",jre],["hollowHexagon",Bre],["hollowPoint",kre],["hollowSquare",Lre],["hollowTriangle",Dre],["hollowTriangleDown",Fre],["hv",Yre],["hvh",Zre],["hyphen",qre],["line",Hre],["plus",Ure],["point",c6],["rect",Are],["smooth",Kre],["square",HE],["tick",Vre],["triangleDown",d6],["triangle",f6],["vh",Xre],["vhv",Qre]]);function Ant(e,t){var{d:n,fill:r,lineWidth:i,path:o,stroke:a,color:s}=t,l=knt(t,["d","fill","lineWidth","path","stroke","color"]);const c=WE.get(e)||WE.get("point");return(...u)=>new ra({style:Object.assign(Object.assign({},l),{d:c(...u),stroke:c.style.includes("stroke")?s||a:"",fill:c.style.includes("fill")?s||r:"",lineWidth:c.style.includes("lineWidth")?i||i||2:0})})}var Lnt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function Jre(e,t,n,r){if(t.length===1)return;const{size:i}=n;if(e==="fixed")return i;if(e==="normal"||Ate(r)){const[[o,a],[s,l]]=t,c=Math.abs((s-o)/2),u=Math.abs((l-a)/2);return Math.max(0,(c+u)/2)}return i}const Nn=(e,t)=>{const{colorAttribute:n,symbol:r,mode:i="auto"}=e,o=Lnt(e,["colorAttribute","symbol","mode"]),a=WE.get(r)||WE.get("point"),{coordinate:s,document:l}=t;return(c,u,f)=>{const{lineWidth:d,color:h}=f,p=o.stroke?d||1:d,{color:v=h,transform:g,opacity:m}=u,[y,x]=s6(c),w=Jre(i,c,u,s)||o.r||f.r;return Jt(l.createElement("path",{})).call(Dt,f).style("fill","transparent").style("d",a(y,x,w)).style("lineWidth",p).style("transform",g).style("transformOrigin",`${y-w} ${x-w}`).style("stroke",v).style(a6(e),m).style(n,v).call(Dt,o).node()}};Nn.props={defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};const eie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"bowtie"},e),t);eie.props=Object.assign({defaultMarker:"hollowBowtie"},Nn.props);const tie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"diamond"},e),t);tie.props=Object.assign({defaultMarker:"hollowDiamond"},Nn.props);const nie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"hexagon"},e),t);nie.props=Object.assign({defaultMarker:"hollowHexagon"},Nn.props);const rie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"point"},e),t);rie.props=Object.assign({defaultMarker:"hollowPoint"},Nn.props);const iie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"square"},e),t);iie.props=Object.assign({defaultMarker:"hollowSquare"},Nn.props);const oie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"triangle"},e),t);oie.props=Object.assign({defaultMarker:"hollowTriangle"},Nn.props);const aie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"triangle-down"},e),t);aie.props=Object.assign({defaultMarker:"hollowTriangleDown"},Nn.props);var jnt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const sie=(e,t)=>{const{colorAttribute:n,mode:r="auto"}=e,i=jnt(e,["colorAttribute","mode"]),{coordinate:o,document:a}=t;return(s,l,c)=>{const{lineWidth:u,color:f}=c,d=i.stroke?u||1:u,{color:h=f,transform:p,opacity:v}=l,[g,m]=s6(s),x=Jre(r,s,l,o)||i.r||c.r;return Jt(a.createElement("circle",{})).call(Dt,c).style("fill","transparent").style("cx",g).style("cy",m).style("r",x).style("lineWidth",d).style("transform",p).style("transformOrigin",`${g} ${m}`).style("stroke",h).style(a6(e),v).style(n,h).call(Dt,i).node()}},g6=(e,t)=>sie(Object.assign({colorAttribute:"fill"},e),t);g6.props={defaultMarker:"circle",defaultEnterAnimation:"fadeIn",defaultExitAnimation:"fadeOut"};const lie=(e,t)=>sie(Object.assign({colorAttribute:"stroke"},e),t);lie.props=Object.assign({defaultMarker:"hollowPoint"},g6.props);const cie=(e,t)=>Nn(Object.assign({colorAttribute:"fill",symbol:"bowtie"},e),t);cie.props=Object.assign({defaultMarker:"bowtie"},Nn.props);const uie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"cross"},e),t);uie.props=Object.assign({defaultMarker:"cross"},Nn.props);const fie=(e,t)=>Nn(Object.assign({colorAttribute:"fill",symbol:"diamond"},e),t);fie.props=Object.assign({defaultMarker:"diamond"},Nn.props);const die=(e,t)=>Nn(Object.assign({colorAttribute:"fill",symbol:"hexagon"},e),t);die.props=Object.assign({defaultMarker:"hexagon"},Nn.props);const hie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"hyphen"},e),t);hie.props=Object.assign({defaultMarker:"hyphen"},Nn.props);const pie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"line"},e),t);pie.props=Object.assign({defaultMarker:"line"},Nn.props);const vie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"plus"},e),t);vie.props=Object.assign({defaultMarker:"plus"},Nn.props);const gie=(e,t)=>Nn(Object.assign({colorAttribute:"fill",symbol:"point"},e),t);gie.props=Object.assign({defaultMarker:"point"},Nn.props);const mie=(e,t)=>Nn(Object.assign({colorAttribute:"fill",symbol:"square"},e),t);mie.props=Object.assign({defaultMarker:"square"},Nn.props);const yie=(e,t)=>Nn(Object.assign({colorAttribute:"stroke",symbol:"tick"},e),t);yie.props=Object.assign({defaultMarker:"tick"},Nn.props);const bie=(e,t)=>Nn(Object.assign({colorAttribute:"fill",symbol:"triangle"},e),t);bie.props=Object.assign({defaultMarker:"triangle"},Nn.props);const xie=(e,t)=>Nn(Object.assign({colorAttribute:"fill",symbol:"triangle-down"},e),t);xie.props=Object.assign({defaultMarker:"triangleDown"},Nn.props);var Sie=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const m6=(e,t)=>{const{arrow:n=!0,arrowSize:r="40%"}=e,i=Sie(e,["arrow","arrowSize"]),{document:o}=t;return(a,s,l)=>{const{defaultColor:c}=l,u=Sie(l,["defaultColor"]),{color:f=c,transform:d}=s,[h,p]=a,v=_s();if(v.moveTo(...h),v.lineTo(...p),n){const[g,m]=_nt(h,p,{arrowSize:r});v.moveTo(...g),v.lineTo(...p),v.lineTo(...m)}return Jt(o.createElement("path",{})).call(Dt,u).style("d",v.toString()).style("stroke",f).style("transform",d).call(Dt,i).node()}};m6.props={defaultMarker:"line",defaultEnterAnimation:"fadeIn",defaultUpdateAnimation:"morphing",defaultExitAnimation:"fadeOut"};function wie(e,t){t(e),e.children&&e.children.forEach(function(n){n&&wie(n,t)})}function vb(e){VE(e,!0)}function Af(e){VE(e,!1)}function VE(e,t){var n=t?"visible":"hidden";wie(e,function(r){r.attr("visibility",n)})}var Dnt=function(e){Nt(t,e);function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=e.apply(this,it([],se(n),!1))||this;return i.isMutationObserved=!0,i.addEventListener(Sn.INSERTED,function(){Af(i)}),i}return t}(lo);function Cie(e){var t=e.appendChild(new Dnt({class:"offscreen"}));return Af(t),t}function Fnt(e){for(var t=e;t;){if(t.className==="offscreen")return!0;t=t.parent}return!1}var y6=function(e){Nt(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=Ir(n,["style"]);return e.call(this,ke({style:ke({text:"",fill:"black",fontFamily:"sans-serif",fontSize:16,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1,textAlign:"start",textBaseline:"middle"},r)},i))||this}return Object.defineProperty(t.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Cie(this)),this._offscreen},enumerable:!1,configurable:!0}),t.prototype.disconnectedCallback=function(){var n;(n=this._offscreen)===null||n===void 0||n.destroy()},t}(xl);function Vg(e){return e*Math.PI/180}function Oie(e){return Number((e*180/Math.PI).toPrecision(5))}var Ur=function(){function e(t,n,r,i){t===void 0&&(t=0),n===void 0&&(n=0),r===void 0&&(r=0),i===void 0&&(i=0),this.x=0,this.y=0,this.width=0,this.height=0,this.x=t,this.y=n,this.width=r,this.height=i}return Object.defineProperty(e.prototype,"bottom",{get:function(){return this.y+this.height},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"left",{get:function(){return this.x},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.x+this.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.y},enumerable:!1,configurable:!0}),e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e.prototype.toJSON=function(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.top,right:this.right,bottom:this.bottom,left:this.left}},e.prototype.isPointIn=function(t,n){return t>=this.left&&t<=this.right&&n>=this.top&&n<=this.bottom},e}();function Ns(e,t){return ea(e)?e.apply(void 0,it([],se(t),!1)):e}var ks=function(e,t){var n=function(i){return"".concat(t,"-").concat(i)},r=Object.fromEntries(Object.entries(e).map(function(i){var o=se(i,2),a=o[0],s=o[1],l=n(s);return[a,{name:l,class:".".concat(l),id:"#".concat(l),toString:function(){return l}}]}));return Object.assign(r,{prefix:n}),r},Bnt=5,Eie=function(e,t,n,r){n===void 0&&(n=0),r===void 0&&(r=Bnt),Object.entries(t).forEach(function(i){var o=se(i,2),a=o[0],s=o[1],l=e;Object.prototype.hasOwnProperty.call(t,a)&&(s?Yc(s)?(Yc(e[a])||(l[a]={}),n<r?Eie(e[a],s,n+1,r):l[a]=t[a]):Hi(s)?(l[a]=[],l[a]=l[a].concat(s)):l[a]=s:l[a]=s)})},ru=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=0;r<t.length;r+=1)Eie(e,t[r]);return e},_ie=function(e){return e!==void 0&&e!=null&&!Number.isNaN(e)},UE,znt=_Ge(function(e,t){var n=t.fontSize,r=t.fontFamily,i=t.fontWeight,o=t.fontStyle,a=t.fontVariant;return UE||(UE=Ve.offscreenCanvasCreator.getOrCreateContext(void 0)),UE.font=[o,a,i,"".concat(n,"px"),r].join(" "),UE.measureText(e).width},function(e,t){return[e,Object.values(t||$ie(e)).join()].join("")},4096),$ie=function(e){var t=e.style.fontFamily||"sans-serif",n=e.style.fontWeight||"normal",r=e.style.fontStyle||"normal",i=e.style.fontVariant,o=e.style.fontSize;return o=typeof o=="object"?o.value:o,{fontSize:o,fontFamily:t,fontWeight:n,fontStyle:r,fontVariant:i}};function Pie(e){return e.nodeName==="text"?e:e.nodeName==="g"&&e.children.length===1&&e.children[0].nodeName==="text"?e.children[0]:null}function Mie(e,t){var n=Pie(e);n&&n.attr(t)}function b6(e,t,n){n===void 0&&(n="..."),Mie(e,{wordWrap:!0,wordWrapWidth:t,maxLines:1,textOverflow:n})}function Hnt(e,t,n,r){n===void 0&&(n=2),r===void 0&&(r="top"),Mie(e,{wordWrap:!0,wordWrapWidth:t,maxLines:n,textBaseline:r})}function qE(e){var t=e.canvas,n=e.touches,r=e.offsetX,i=e.offsetY;if(t){var o=t.x,a=t.y;return[o,a]}if(n){var s=n[0],l=s.clientX,c=s.clientY;return[l,c]}return r&&i?[r,i]:[0,0]}function Ah(e){return typeof e=="function"?e():Wr(e)||_r(e)?new y6({style:{text:String(e)}}):e}function Wnt(e,t){return e.reduce(function(n,r){return(n[r[t]]=n[r[t]]||[]).push(r),n},{})}function $a(e,t,n,r,i){return r===void 0&&(r=!0),i===void 0&&(i=function(o){o.node().removeChildren()}),e?n(t):(r&&i(t),null)}function Co(e,t,n,r,i){return r===void 0&&(r=!0),i===void 0&&(i=!1),r&&e===t||i&&e===n?!0:e>t&&e<n}var Vnt=function(e,t){return function(n){return e*(1-n)+t*n}};function Unt(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0;return function(i){var o=new Array(r),a=new Array(n),s=0;for(s=0;s<r;++s)o[s]=x6(e[s],t[s]);for(;s<n;++s)a[s]=t[s];for(s=0;s<r;++s)a[s]=o[s](i);return a}}function qnt(e,t){e===void 0&&(e={}),t===void 0&&(t={});var n={},r={};return Object.entries(t).forEach(function(i){var o=se(i,2),a=o[0],s=o[1];a in e?n[a]=x6(e[a],s):r[a]=s}),function(i){return Object.entries(n).forEach(function(o){var a=se(o,2),s=a[0],l=a[1];return r[s]=l(i)}),r}}function x6(e,t){return typeof e=="number"&&typeof t=="number"?Vnt(e,t):Array.isArray(e)&&Array.isArray(t)?Unt(e,t):typeof e=="object"&&typeof t=="object"?qnt(e,t):function(n){return e}}function Gnt(e,t,n,r){if(!r)return e.attr("__keyframe_data__",n),null;var i=r.duration,o=i===void 0?0:i,a=x6(t,n),s=Math.ceil(+o/16),l=new Array(s).fill(0).map(function(c,u,f){return{__keyframe_data__:a(u/(f.length-1))}});return e.animate(l,ke({fill:"both"},r))}function Tie(e){for(var t=1/0,n=1/0,r=-1/0,i=-1/0,o=0;o<e.length;o++){var a=e[o],s=a.x,l=a.y,c=a.width,u=a.height,f=se([s+c,l+u],2),d=f[0],h=f[1];s<t&&(t=s),l<n&&(n=l),d>r&&(r=d),h>i&&(i=h)}return new Ur(t,n,r-t,i-n)}var Knt=function(e,t,n){var r=e.width,i=e.height,o=n.flexDirection,a=o===void 0?"row":o;n.flexWrap;var s=n.justifyContent,l=s===void 0?"flex-start":s;n.alignContent;var c=n.alignItems,u=c===void 0?"flex-start":c,f=a==="row",d=a==="row"||a==="column",h=f?d?[1,0]:[-1,0]:d?[0,1]:[0,-1],p=se([0,0],2),v=p[0],g=p[1],m=t.map(function(E){var _,$=E.width,P=E.height,T=se([v,g],2),I=T[0],M=T[1];return _=se([v+$*h[0],g+P*h[1]],2),v=_[0],g=_[1],new Ur(I,M,$,P)}),y=Tie(m),x={"flex-start":0,"flex-end":f?r-y.width:i-y.height,center:f?(r-y.width)/2:(i-y.height)/2},S=m.map(function(E){var _=E.x,$=E.y,P=Ur.fromRect(E);return P.x=f?_+x[l]:_,P.y=f?$:$+x[l],P});Tie(S);var w=function(E){var _=se(f?["height",i]:["width",r],2),$=_[0],P=_[1];switch(u){case"flex-start":return 0;case"flex-end":return P-E[$];case"center":return P/2-E[$]/2;default:return 0}},C=S.map(function(E){var _=E.x,$=E.y,P=Ur.fromRect(E);return P.x=f?_:_+w(P),P.y=f?$+w(P):$,P}),O=C.map(function(E){var _,$,P=Ur.fromRect(E);return P.x+=(_=e.x)!==null&&_!==void 0?_:0,P.y+=($=e.y)!==null&&$!==void 0?$:0,P});return O},Ynt=function(e,t,n){return[]};const Xnt=function(e,t,n){if(t.length===0)return[];var r={flex:Knt,grid:Ynt},i=n.display in r?r[n.display]:null;return(i==null?void 0:i.call(null,e,t,n))||[]};function iu(e,t){return[e[0]*t,e[1]*t]}function gb(e,t){return[e[0]+t[0],e[1]+t[1]]}function S6(e,t){return[e[0]-t[0],e[1]-t[1]]}function Lh(e,t){return[Math.min(e[0],t[0]),Math.min(e[1],t[1])]}function jh(e,t){return[Math.max(e[0],t[0]),Math.max(e[1],t[1])]}function mb(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))}function Iie(e){if(e[0]===0&&e[1]===0)return[0,0];var t=Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2));return[e[0]/t,e[1]/t]}function Znt(e,t){return t?[e[1],-e[0]]:[-e[1],e[0]]}function w6(e,t){return+e.toPrecision(t)}function Rie(e,t){var n={},r=Array.isArray(t)?t:[t];for(var i in e)r.includes(i)||(n[i]=e[i]);return n}function Qnt(e,t,n,r){var i,o=[],a=!!r,s,l,c=[1/0,1/0],u=[-1/0,-1/0],f,d,h;if(a){i=se(r,2),c=i[0],u=i[1];for(var p=0,v=e.length;p<v;p+=1){var g=e[p];c=Lh(c,g),u=jh(u,g)}}for(var p=0,m=e.length;p<m;p+=1){var g=e[p];if(p===0&&!n)h=g;else if(p===m-1&&!n)d=g,o.push(h),o.push(d);else{var y=[p?p-1:m-1,p-1][1];s=e[y],l=e[p+1];var x=[0,0];x=S6(l,s),x=iu(x,t);var S=mb(g,s),w=mb(g,l),C=S+w;C!==0&&(S/=C,w/=C);var O=iu(x,-S),E=iu(x,w);d=gb(g,O),f=gb(g,E),f=Lh(f,jh(l,g)),f=jh(f,Lh(l,g)),O=S6(f,g),O=iu(O,-S/w),d=gb(g,O),d=Lh(d,jh(s,g)),d=jh(d,Lh(s,g)),E=S6(g,d),E=iu(E,w/S),f=gb(g,E),a&&(d=jh(d,c),d=Lh(d,u),f=jh(f,c),f=Lh(f,u)),o.push(h),o.push(d),h=f}}return o}function Jnt(e,t,n){n===void 0&&(n=[[0,0],[1,1]]);for(var r=!!t,i=[],o=0,a=e.length;o<a;o+=2)i.push([e[o],e[o+1]]);for(var s=Qnt(i,.4,r,n),l=i.length,c=[],u,f,d,o=0;o<l-1;o+=1)u=s[o*2],f=s[o*2+1],d=i[o+1],c.push(["C",u[0],u[1],f[0],f[1],d[0],d[1]]);return c}var ert=["$el","cx","cy","d","dx","dy","fill","fillOpacity","filter","fontFamily","fontSize","fontStyle","fontVariant","fontWeight","height","img","increasedLineWidthForHitTesting","innerHTML","isBillboard","billboardRotation","isSizeAttenuation","isClosed","isOverflowing","leading","letterSpacing","lineDash","lineHeight","lineWidth","markerEnd","markerEndOffset","markerMid","markerStart","markerStartOffset","maxLines","metrics","miterLimit","offsetX","offsetY","opacity","path","points","r","radius","rx","ry","shadowColor","src","stroke","strokeOpacity","text","textAlign","textBaseline","textDecorationColor","textDecorationLine","textDecorationStyle","textOverflow","textPath","textPathSide","textPathStartOffset","transform","transformOrigin","visibility","width","wordWrap","wordWrapWidth","x","x1","x2","y","y1","y2","z1","z2","zIndex"];function trt(e){return ert.includes(e)}function Nie(e){var t={};for(var n in e)trt(n)&&(t[n]=e[n]);return t}function nrt(e,t){if(e.length<=t)return e;for(var n=Math.floor(e.length/t),r=[],i=0;i<e.length;i+=n)r.push(e[i]);return r}function C6(e,t,n){var r=e.getBBox(),i=r.width,o=r.height,a=t/Math.max(i,o);return e.style.transform="scale(".concat(a,")"),a}function rrt(e,t){var n=new Map;return e.forEach(function(r){var i=t(r);n.has(i)||n.set(i,[]),n.get(i).push(r)}),n}function irt(e){throw new Error(e)}var ort=function(){function e(i,o,a,s,l,c,u){i===void 0&&(i=null),o===void 0&&(o=null),a===void 0&&(a=null),s===void 0&&(s=null),l===void 0&&(l=[null,null,null,null,null]),c===void 0&&(c=[]),u===void 0&&(u=[]),t.add(this),this._elements=Array.from(i),this._data=o,this._parent=a,this._document=s,this._enter=l[0],this._update=l[1],this._exit=l[2],this._merge=l[3],this._split=l[4],this._transitions=c,this._facetElements=u}e.prototype.selectAll=function(i){var o=typeof i=="string"?this._parent.querySelectorAll(i):i;return new n(o,null,this._elements[0],this._document)},e.prototype.selectFacetAll=function(i){var o=typeof i=="string"?this._parent.querySelectorAll(i):i;return new n(this._elements,null,this._parent,this._document,void 0,void 0,o)},e.prototype.select=function(i){var o=typeof i=="string"?this._parent.querySelectorAll(i)[0]||null:i;return new n([o],null,o,this._document)},e.prototype.append=function(i){var o=this,a=typeof i=="function"?i:function(){return o.createElement(i)},s=[];if(this._data!==null){for(var l=0;l<this._data.length;l++){var c=this._data[l],u=se(Array.isArray(c)?c:[c,null],2),f=u[0],d=u[1],h=a(f,l);h.__data__=f,d!==null&&(h.__fromElements__=d),this._parent.appendChild(h),s.push(h)}return new n(s,null,this._parent,this._document)}for(var l=0;l<this._elements.length;l++){var p=this._elements[l],f=p.__data__,h=a(f,l);p.appendChild(h),s.push(h)}return new n(s,null,s[0],this._document)},e.prototype.maybeAppend=function(i,o){var a=HR(this,t,"m",r).call(this,i[0]==="#"?i:"#".concat(i),o);return a.attr("id",i),a},e.prototype.maybeAppendByClassName=function(i,o){var a=i.toString(),s=HR(this,t,"m",r).call(this,a[0]==="."?a:".".concat(a),o);return s.attr("className",a),s},e.prototype.maybeAppendByName=function(i,o){var a=HR(this,t,"m",r).call(this,'[name="'.concat(i,'"]'),o);return a.attr("name",i),a},e.prototype.data=function(i,o,a){var s,l;o===void 0&&(o=function($){return $}),a===void 0&&(a=function(){return null});for(var c=[],u=[],f=new Set(this._elements),d=[],h=new Set,p=new Map(this._elements.map(function($,P){return[o($.__data__,P),$]})),v=new Map(this._facetElements.map(function($,P){return[o($.__data__,P),$]})),g=rrt(this._elements,function($){return a($.__data__)}),m=0;m<i.length;m++){var y=i[m],x=o(y,m),S=a(y,m);if(p.has(x)){var w=p.get(x);w.__data__=y,w.__facet__=!1,u.push(w),f.delete(w),p.delete(x)}else if(v.has(x)){var w=v.get(x);w.__data__=y,w.__facet__=!0,u.push(w),v.delete(x)}else if(g.has(x)){var C=g.get(x);d.push([y,C]);try{for(var O=(s=void 0,Xa(C)),E=O.next();!E.done;E=O.next()){var w=E.value;f.delete(w)}}catch($){s={error:$}}finally{try{E&&!E.done&&(l=O.return)&&l.call(O)}finally{if(s)throw s.error}}g.delete(x)}else if(p.has(S)){var w=p.get(S);w.__toData__?w.__toData__.push(y):w.__toData__=[y],h.add(w),f.delete(w)}else c.push(y)}var _=[new n([],c,this._parent,this._document),new n(u,null,this._parent,this._document),new n(f,null,this._parent,this._document),new n([],d,this._parent,this._document),new n(h,null,this._parent,this._document)];return new n(this._elements,null,this._parent,this._document,_)},e.prototype.merge=function(i){var o=it(it([],se(this._elements),!1),se(i._elements),!1),a=it(it([],se(this._transitions),!1),se(i._transitions),!1);return new n(o,null,this._parent,this._document,void 0,a)},e.prototype.createElement=function(i){if(this._document)return this._document.createElement(i,{});var o=n.registry[i];return o?new o:irt("Unknown node type: ".concat(i))},e.prototype.join=function(i,o,a,s,l){i===void 0&&(i=function(p){return p}),o===void 0&&(o=function(p){return p}),a===void 0&&(a=function(p){return p.remove()}),s===void 0&&(s=function(p){return p}),l===void 0&&(l=function(p){return p.remove()});var c=i(this._enter),u=o(this._update),f=a(this._exit),d=s(this._merge),h=l(this._split);return u.merge(c).merge(f).merge(d).merge(h)},e.prototype.remove=function(){for(var i=function(s){var l=o._elements[s],c=o._transitions[s];c?c.then(function(){return l.remove()}):l.remove()},o=this,a=0;a<this._elements.length;a++)i(a);return new n([],null,this._parent,this._document,void 0,this._transitions)},e.prototype.each=function(i){for(var o=0;o<this._elements.length;o++){var a=this._elements[o],s=a.__data__;i.call(a,s,o)}return this},e.prototype.attr=function(i,o){var a=typeof o!="function"?function(){return o}:o;return this.each(function(s,l){o!==void 0&&(this[i]=a.call(this,s,l))})},e.prototype.style=function(i,o,a){a===void 0&&(a=!0);var s=typeof o!="function"||!a?function(){return o}:o;return this.each(function(l,c){o!==void 0&&(this.style[i]=s.call(this,l,c))})},e.prototype.styles=function(i,o){return i===void 0&&(i={}),o===void 0&&(o=!0),this.each(function(a,s){var l=this;Object.entries(i).forEach(function(c){var u=se(c,2),f=u[0],d=u[1],h=typeof d!="function"||!o?function(){return d}:d;d!==void 0&&l.attr(f,h.call(l,a,s))})})},e.prototype.update=function(i,o){o===void 0&&(o=!0);var a=typeof i!="function"||!o?function(){return i}:i;return this.each(function(s,l){i&&this.update&&this.update(a.call(this,s,l))})},e.prototype.maybeUpdate=function(i,o){o===void 0&&(o=!0);var a=typeof i!="function"||!o?function(){return i}:i;return this.each(function(s,l){i&&this.update&&this.update(a.call(this,s,l))})},e.prototype.transition=function(i){var o=this._transitions;return this.each(function(a,s){o[s]=i.call(this,a,s)})},e.prototype.on=function(i,o){return this.each(function(){this.addEventListener(i,o)}),this},e.prototype.call=function(i){for(var o=[],a=1;a<arguments.length;a++)o[a-1]=arguments[a];return i.call.apply(i,it([this._parent,this],se(o),!1)),this},e.prototype.node=function(){return this._elements[0]},e.prototype.nodes=function(){return this._elements},e.prototype.transitions=function(){return this._transitions.filter(function(i){return!!i})},e.prototype.parent=function(){return this._parent};var t,n,r;return n=e,t=new WeakSet,r=function(o,a){var s=this._elements[0],l=s.querySelector(o);if(l)return new n([l],null,this._parent,this._document);var c=typeof a=="string"?this.createElement(a):a();return s.appendChild(c),new n([c],null,this._parent,this._document)},e.registry={g:lo,rect:Rh,circle:kf,path:ra,text:y6,ellipse:Xk,image:Zk,line:Hg,polygon:ub,polyline:Qk,html:xE},e}();function gn(e){return new ort([e],null,e,e.ownerDocument)}function art(e,t,n){return e.querySelector(t)?gn(e).select(t):gn(e).append(n)}function Oo(e){if(_r(e))return[e,e,e,e];if(Hi(e)){var t=e.length;if(t===1)return[e[0],e[0],e[0],e[0]];if(t===2)return[e[0],e[1],e[0],e[1]];if(t===3)return[e[0],e[1],e[2],e[1]];if(t===4)return e}return[0,0,0,0]}function kie(e){var t=e.getLocalBounds(),n=t.min,r=t.max,i=se([n,r],2),o=se(i[0],2),a=o[0],s=o[1],l=se(i[1],2),c=l[0],u=l[1];return{x:a,y:s,width:c-a,height:u-s,left:a,bottom:u,top:s,right:c}}function srt(e,t){var n=se(e,2),r=n[0],i=n[1],o=se(t,2),a=o[0],s=o[1];return r!==a&&i===s}function lrt(e,t){var n,r,i=t.attributes;try{for(var o=Xa(Object.entries(i)),a=o.next();!a.done;a=o.next()){var s=se(a.value,2),l=s[0],c=s[1];l!=="id"&&l!=="className"&&e.attr(l,c)}}catch(u){n={error:u}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function O6(e){return e.toString().charAt(0).toUpperCase()+e.toString().slice(1)}function crt(e){return e.toString().charAt(0).toLowerCase()+e.toString().slice(1)}function urt(e,t){return"".concat(t).concat(O6(e))}function Aie(e,t,n){var r;n===void 0&&(n=!0);var i=t||((r=e.match(/^([a-z][a-z0-9]+)/))===null||r===void 0?void 0:r[0])||"",o=e.replace(new RegExp("^(".concat(i,")")),"");return n?crt(o):o}function frt(e,t){Object.entries(t).forEach(function(n){var r=se(n,2),i=r[0],o=r[1];it([e],se(e.querySelectorAll(i)),!1).filter(function(a){return a.matches(i)}).forEach(function(a){if(a){var s=a;s.style.cssText+=Object.entries(o).reduce(function(l,c){return"".concat(l).concat(c.join(":"),";")},"")}})})}var GE=function(e,t){if(!(e!=null&&e.startsWith(t)))return!1;var n=e[t.length];return n>="A"&&n<="Z"};function Pn(e,t,n){n===void 0&&(n=!1);var r={};return Object.entries(e).forEach(function(i){var o=se(i,2),a=o[0],s=o[1];if(!(a==="className"||a==="class")){if(GE(a,"show")&&GE(Aie(a,"show"),t)!==n)a===urt(t,"show")?r[a]=s:r[a.replace(new RegExp(O6(t)),"")]=s;else if(!GE(a,"show")&&GE(a,t)!==n){var l=Aie(a,t);l==="filter"&&typeof s=="function"||(r[l]=s)}}}),r}function Zl(e,t){return Object.entries(e).reduce(function(n,r){var i=se(r,2),o=i[0],a=i[1];return o.startsWith("show")?n["show".concat(t).concat(o.slice(4))]=a:n["".concat(t).concat(O6(o))]=a,n},{})}function ou(e,t){t===void 0&&(t=["x","y","class","className"]);var n=["transform","transformOrigin","anchor","visibility","pointerEvents","zIndex","cursor","clipPath","clipPathTargets","offsetPath","offsetPathTargets","offsetDistance","draggable","droppable"],r={},i={};return Object.entries(e).forEach(function(o){var a=se(o,2),s=a[0],l=a[1];t.includes(s)||(n.indexOf(s)!==-1?i[s]=l:r[s]=l)}),[r,i]}function drt(e,t,n){var r=e.getBBox(),i=r.width,o=r.height,a=se([t,n].map(function(c,u){var f;return c.includes("%")?parseFloat(((f=c.match(/[+-]?([0-9]*[.])?[0-9]+/))===null||f===void 0?void 0:f[0])||"0")/100*(u===0?i:o):c}),2),s=a[0],l=a[1];return[s,l]}function Lie(e,t){if(t)try{var n=/translate\(([+-]*[\d]+[%]*),[ ]*([+-]*[\d]+[%]*)\)/g,r=t.replace(n,function(i,o,a){return"translate(".concat(drt(e,o,a),")")});e.attr("transform",r)}catch(i){}}function hrt(e){var t;return((t=e[0])===null||t===void 0?void 0:t.map(function(n,r){return e.map(function(i){return i[r]})}))||[]}function prt(){VE(this,this.attributes.visibility!=="hidden")}var co=function(e){Nt(t,e);function t(n,r){r===void 0&&(r={});var i=e.call(this,ru({},{style:r},n))||this;return i.initialized=!1,i._defaultOptions=r,i}return Object.defineProperty(t.prototype,"offscreenGroup",{get:function(){return this._offscreen||(this._offscreen=Cie(this)),this._offscreen},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"defaultOptions",{get:function(){return this._defaultOptions},enumerable:!1,configurable:!0}),t.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this),this.initialized=!0},t.prototype.disconnectedCallback=function(){var n;(n=this._offscreen)===null||n===void 0||n.destroy()},t.prototype.attributeChangedCallback=function(n){n==="visibility"&&prt.call(this)},t.prototype.update=function(n,r){var i;return this.attr(ru({},this.attributes,n||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,r)},t.prototype.clear=function(){this.removeChildren()},t.prototype.bindEvents=function(n,r){},t.prototype.getSubShapeStyle=function(n){n.x,n.y,n.transform,n.transformOrigin,n.class,n.className,n.zIndex;var r=Ir(n,["x","y","transform","transformOrigin","class","className","zIndex"]);return r},t}(bE),jie=function(e,t,n){return[["M",e-n,t],["A",n,n,0,1,0,e+n,t],["A",n,n,0,1,0,e-n,t],["Z"]]},vrt=jie,grt=function(e,t,n){return[["M",e-n,t-n],["L",e+n,t-n],["L",e+n,t+n],["L",e-n,t+n],["Z"]]},mrt=function(e,t,n){return[["M",e-n,t],["L",e,t-n],["L",e+n,t],["L",e,t+n],["Z"]]},yrt=function(e,t,n){var r=n*Math.sin(.3333333333333333*Math.PI);return[["M",e-n,t+r],["L",e,t-r],["L",e+n,t+r],["Z"]]},brt=function(e,t,n){var r=n*Math.sin(.3333333333333333*Math.PI);return[["M",e-n,t-r],["L",e+n,t-r],["L",e,t+r],["Z"]]},xrt=function(e,t,n){var r=n/2*Math.sqrt(3);return[["M",e,t-n],["L",e+r,t-n/2],["L",e+r,t+n/2],["L",e,t+n],["L",e-r,t+n/2],["L",e-r,t-n/2],["Z"]]},Srt=function(e,t,n){var r=n-1.5;return[["M",e-n,t-r],["L",e+n,t+r],["L",e+n,t-r],["L",e-n,t+r],["Z"]]},Die=function(e,t,n){return[["M",e,t+n],["L",e,t-n]]},wrt=function(e,t,n){return[["M",e-n,t-n],["L",e+n,t+n],["M",e+n,t-n],["L",e-n,t+n]]},Crt=function(e,t,n){return[["M",e-n/2,t-n],["L",e+n/2,t-n],["M",e,t-n],["L",e,t+n],["M",e-n/2,t+n],["L",e+n/2,t+n]]},Ort=function(e,t,n){return[["M",e-n,t],["L",e+n,t],["M",e,t-n],["L",e,t+n]]},Ert=function(e,t,n){return[["M",e-n,t],["L",e+n,t]]},Fie=function(e,t,n){return[["M",e-n,t],["L",e+n,t]]},_rt=Fie,$rt=function(e,t,n){return[["M",e-n,t],["A",n/2,n/2,0,1,1,e,t],["A",n/2,n/2,0,1,0,e+n,t]]},Prt=function(e,t,n){return[["M",e-n-1,t-2.5],["L",e,t-2.5],["L",e,t+2.5],["L",e+n+1,t+2.5]]},Mrt=function(e,t,n){return[["M",e-n-1,t+2.5],["L",e,t+2.5],["L",e,t-2.5],["L",e+n+1,t-2.5]]},Trt=function(e,t,n){return[["M",e-(n+1),t+2.5],["L",e-n/2,t+2.5],["L",e-n/2,t-2.5],["L",e+n/2,t-2.5],["L",e+n/2,t+2.5],["L",e+n+1,t+2.5]]};function Irt(e,t){return[["M",e-5,t+2.5],["L",e-5,t],["L",e,t],["L",e,t-3],["L",e,t+3],["L",e+6.5,t+3]]}var Rrt=function(e,t,n){return[["M",e-n,t-n],["L",e+n,t],["L",e-n,t+n],["Z"]]};function Nrt(e){var t="default";if(lh(e)&&e instanceof Image)t="image";else if(ea(e))t="symbol";else if(Wr(e)){var n=new RegExp("data:(image|text)");e.match(n)?t="base64":/^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(e)?t="url":t="symbol"}return t}function krt(e){var t=Nrt(e);return["base64","url","image"].includes(t)?"image":e&&t==="symbol"?"path":null}var Yn=function(e){Nt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(n,r){var i=n.x,o=i===void 0?0:i,a=n.y,s=a===void 0?0:a,l=this.getSubShapeStyle(n),c=l.symbol,u=l.size,f=u===void 0?16:u,d=Ir(l,["symbol","size"]),h=krt(c);$a(!!h,gn(r),function(p){p.maybeAppendByClassName("marker",h).attr("className","marker ".concat(h,"-marker")).call(function(v){if(h==="image"){var g=f*2;v.styles({img:c,width:g,height:g,x:o-f,y:s-f})}else{var g=f/2,m=ea(c)?c:t.getSymbol(c);v.styles(ke({d:m==null?void 0:m(o,s,g)},d))}})})},t.MARKER_SYMBOL_MAP=new Map,t.registerSymbol=function(n,r){t.MARKER_SYMBOL_MAP.set(n,r)},t.getSymbol=function(n){return t.MARKER_SYMBOL_MAP.get(n)},t.getSymbols=function(){return Array.from(t.MARKER_SYMBOL_MAP.keys())},t}(co);Yn.registerSymbol("cross",wrt),Yn.registerSymbol("hyphen",Ert),Yn.registerSymbol("line",Die),Yn.registerSymbol("plus",Ort),Yn.registerSymbol("tick",Crt),Yn.registerSymbol("circle",jie),Yn.registerSymbol("point",vrt),Yn.registerSymbol("bowtie",Srt),Yn.registerSymbol("hexagon",xrt),Yn.registerSymbol("square",grt),Yn.registerSymbol("diamond",mrt),Yn.registerSymbol("triangle",yrt),Yn.registerSymbol("triangle-down",brt),Yn.registerSymbol("line",Die),Yn.registerSymbol("dot",Fie),Yn.registerSymbol("dash",_rt),Yn.registerSymbol("smooth",$rt),Yn.registerSymbol("hv",Prt),Yn.registerSymbol("vh",Mrt),Yn.registerSymbol("hvh",Trt),Yn.registerSymbol("vhv",Irt);var Art=function(e){Nt(t,e);function t(n){var r=this,i=n.style,o=Ir(n,["style"]);return r=e.call(this,Ue({},{type:"column"},ke({style:i},o)))||this,r.columnsGroup=new lo({name:"columns"}),r.appendChild(r.columnsGroup),r.render(),r}return t.prototype.render=function(){var n=this.attributes,r=n.columns,i=n.x,o=n.y;this.columnsGroup.style.transform="translate(".concat(i,", ").concat(o,")"),gn(this.columnsGroup).selectAll(".column").data(r.flat()).join(function(a){return a.append("rect").attr("className","column").each(function(s){this.attr(s)})},function(a){return a.each(function(s){this.attr(s)})},function(a){return a.remove()})},t.prototype.update=function(n){this.attr(ru({},this.attributes,n)),this.render()},t.prototype.clear=function(){this.removeChildren()},t}(Wo),Lrt=function(e){Nt(t,e);function t(n){var r=this,i=n.style,o=Ir(n,["style"]);return r=e.call(this,Ue({},{type:"lines"},ke({style:i},o)))||this,r.linesGroup=r.appendChild(new lo),r.areasGroup=r.appendChild(new lo),r.render(),r}return t.prototype.render=function(){var n=this.attributes,r=n.lines,i=n.areas,o=n.x,a=n.y;this.style.transform="translate(".concat(o,", ").concat(a,")"),r&&this.renderLines(r),i&&this.renderAreas(i)},t.prototype.clear=function(){this.linesGroup.removeChildren(),this.areasGroup.removeChildren()},t.prototype.update=function(n){this.attr(ru({},this.attributes,n)),this.render()},t.prototype.renderLines=function(n){gn(this.linesGroup).selectAll(".line").data(n).join(function(r){return r.append("path").attr("className","line").each(function(i){this.attr(i)})},function(r){return r.each(function(i){this.attr(i)})},function(r){return r.remove()})},t.prototype.renderAreas=function(n){gn(this.linesGroup).selectAll(".area").data(n).join(function(r){return r.append("path").attr("className","area").each(function(i){this.attr(i)})},function(r){return r.each(function(i){this.style(i)})},function(r){return r.remove()})},t}(Wo);function jrt(e,t){var n,r=t.x,i=t.y,o=se(i.getOptions().range||[0,0],2),a=o[0],s=o[1];return s>a&&(n=se([a,s],2),s=n[0],a=n[1]),e.map(function(l){var c=l.map(function(u,f){return[r.map(f),ai(i.map(u),s,a)]});return c})}function yb(e,t){t===void 0&&(t=!1);var n=t?e.length-1:0,r=e.map(function(i,o){return it([o===n?"M":"L"],se(i),!1)});return t?r.reverse():r}function KE(e,t){if(t===void 0&&(t=!1),e.length<=2)return yb(e);for(var n=[],r=e.length,i=0;i<r;i+=1){var o=t?e[r-i-1]:e[i];gO(o,n.slice(-2))||n.push.apply(n,it([],se(o),!1))}var a=Jnt(n,!1);return t?a.unshift(it(["M"],se(e[r-1]),!1)):a.unshift(it(["M"],se(e[0]),!1)),a}function E6(e,t,n){var r=E1(e);return r.push(["L",t,n],["L",0,n],["Z"]),r}function Drt(e,t,n,r){return e.map(function(i){return E6(t?KE(i):yb(i),n,r)})}function Frt(e,t,n){for(var r=[],i=e.length-1;i>=0;i-=1){var o=e[i],a=yb(o),s=void 0;if(i===0)s=E6(a,t,n);else{var l=e[i-1],c=yb(l,!0);c[0][0]="L",s=it(it(it([],se(a),!1),se(c),!1),[["Z"]],!1)}r.push(s)}return r}function Brt(e,t,n){for(var r=[],i=e.length-1;i>=0;i-=1){var o=e[i],a=KE(o),s=void 0;if(i===0)s=E6(a,t,n);else{var l=e[i-1],c=KE(l,!0),u=o[0];c[0][0]="L",s=it(it(it([],se(a),!1),se(c),!1),[it(["M"],se(u),!1),["Z"]],!1)}r.push(s)}return r}function Bie(e){return e.length===0?[0,0]:[vO(SGe(e,function(t){return vO(t)||0})),pO(xGe(e,function(t){return pO(t)||0}))]}function zie(e){for(var t=E1(e),n=t[0].length,r=se([Array(n).fill(0),Array(n).fill(0)],2),i=r[0],o=r[1],a=0;a<t.length;a+=1)for(var s=t[a],l=0;l<n;l+=1)s[l]>=0?(s[l]+=i[l],i[l]=s[l]):(s[l]+=o[l],o[l]=s[l]);return t}var zrt=function(e){Nt(t,e);function t(n){return e.call(this,n,{type:"line",x:0,y:0,width:200,height:20,isStack:!1,color:["#83daad","#edbf45","#d2cef9","#e290b3","#6f63f4"],smooth:!0,lineLineWidth:1,areaOpacity:0,isGroup:!1,columnLineWidth:1,columnStroke:"#fff",scale:1,spacing:0})||this}return Object.defineProperty(t.prototype,"rawData",{get:function(){var n=this.attributes.data;if(!n||(n==null?void 0:n.length)===0)return[[]];var r=E1(n);return _r(r[0])?[r]:r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"data",{get:function(){return this.attributes.isStack?zie(this.rawData):this.rawData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scales",{get:function(){return this.createScales(this.data)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseline",{get:function(){var n=this.scales.y,r=se(n.getOptions().domain||[0,0],2),i=r[0],o=r[1];return o<0?n.map(o):n.map(i<0?0:i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"containerShape",{get:function(){var n=this.attributes,r=n.width,i=n.height;return{width:r,height:i}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"linesStyle",{get:function(){var n=this,r=this.attributes,i=r.type,o=r.isStack,a=r.smooth;if(i!=="line")throw new Error("linesStyle can only be used in line type");var s=Pn(this.attributes,"area"),l=Pn(this.attributes,"line"),c=this.containerShape.width,u=this.data;if(u[0].length===0)return{lines:[],areas:[]};var f=this.scales,d=f.x,h=f.y,p=jrt(u,{type:"line",x:d,y:h}),v=[];if(s){var g=this.baseline;o?v=a?Brt(p,c,g):Frt(p,c,g):v=Drt(p,a,c,g)}return{lines:p.map(function(m,y){return ke({stroke:n.getColor(y),d:a?KE(m):yb(m)},l)}),areas:v.map(function(m,y){return ke({d:m,fill:n.getColor(y)},s)})}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"columnsStyle",{get:function(){var n=this,r=Pn(this.attributes,"column"),i=this.attributes,o=i.isStack,a=i.type,s=i.scale;if(a!=="column")throw new Error("columnsStyle can only be used in column type");var l=this.containerShape.height,c=this.rawData;if(!c)return{columns:[]};o&&(c=zie(c));var u=this.createScales(c),f=u.x,d=u.y,h=se(Bie(c),2),p=h[0],v=h[1],g=new $r({domain:[0,v-(p>0?0:p)],range:[0,l*s]}),m=f.getBandWidth(),y=this.rawData;return{columns:c.map(function(x,S){return x.map(function(w,C){var O=m/c.length,E=function(){return{x:f.map(C)+O*S,y:w>=0?d.map(w):d.map(0),width:O,height:g.map(Math.abs(w))}},_=function(){return{x:f.map(C),y:d.map(w),width:m,height:g.map(y[S][C])}};return ke(ke({fill:n.getColor(S)},r),o?_():E())})})}},enumerable:!1,configurable:!0}),t.prototype.render=function(n,r){art(r,".container","rect").attr("className","container").node();var i=n.type,o=n.x,a=n.y,s="spark".concat(i),l=ke({x:o,y:a},i==="line"?this.linesStyle:this.columnsStyle);gn(r).selectAll(".spark").data([i]).join(function(c){return c.append(function(u){return u==="line"?new Lrt({className:s,style:l}):new Art({className:s,style:l})}).attr("className","spark ".concat(s))},function(c){return c.update(l)},function(c){return c.remove()})},t.prototype.getColor=function(n){var r=this.attributes.color;return Hi(r)?r[n%r.length]:ea(r)?r.call(null,n):r},t.prototype.createScales=function(n){var r,i,o=this.attributes,a=o.type,s=o.scale,l=o.range,c=l===void 0?[]:l,u=o.spacing,f=this.containerShape,d=f.width,h=f.height,p=se(Bie(n),2),v=p[0],g=p[1],m=new $r({domain:[(r=c[0])!==null&&r!==void 0?r:v,(i=c[1])!==null&&i!==void 0?i:g],range:[h,h*(1-s)]});return a==="line"?{type:a,x:new $r({domain:[0,n[0].length-1],range:[0,d]}),y:m}:{type:a,x:new Eg({domain:n[0].map(function(y,x){return x}),range:[0,d],paddingInner:u,paddingOuter:u/2,align:.5}),y:m}},t.tag="sparkline",t}(co);function Hrt(e){return typeof e=="boolean"?!1:"enter"in e&&"update"in e&&"exit"in e}function Hie(e){if(!e)return{enter:!1,update:!1,exit:!1};var t=["enter","update","exit"],n=Object.fromEntries(Object.entries(e).filter(function(r){var i=se(r,1),o=i[0];return!t.includes(o)}));return Object.fromEntries(t.map(function(r){return Hrt(e)?e[r]===!1?[r,!1]:[r,ke(ke({},e[r]),n)]:[r,n]}))}function Ug(e,t){e?e.finished.then(t):t()}function Wrt(e,t){e.length===0?t():Promise.all(e.map(function(n){return n==null?void 0:n.finished})).then(t)}function Wie(e,t){"update"in e?e.update(t):e.attr(t)}function Vie(e,t,n){if(t.length===0)return null;if(!n){var r=t.slice(-1)[0];return Wie(e,{style:r}),null}return e.animate(t,n)}function Vrt(e,t){return!(e.nodeName!=="text"||t.nodeName!=="text"||e.attributes.text!==t.attributes.text)}function Urt(e,t,n,r){if(r===void 0&&(r="destroy"),Vrt(e,t))return e.remove(),[null];var i=function(){r==="destroy"?e.destroy():r==="hide"&&Af(e),t.isVisible()&&vb(t)};if(!n)return i(),[null];var o=n.duration,a=o===void 0?0:o,s=n.delay,l=s===void 0?0:s,c=Math.ceil(+a/2),u=+a/4,f=se(e.getGeometryBounds().center,2),d=f[0],h=f[1],p=se(t.getGeometryBounds().center,2),v=p[0],g=p[1],m=se([(d+v)/2-d,(h+g)/2-h],2),y=m[0],x=m[1],S=e.style.opacity,w=S===void 0?1:S,C=t.style.opacity,O=C===void 0?1:C,E=e.style.transform||"",_=t.style.transform||"",$=e.animate([{opacity:w,transform:"translate(0, 0) ".concat(E)},{opacity:0,transform:"translate(".concat(y,", ").concat(x,") ").concat(E)}],ke(ke({fill:"both"},n),{duration:l+c+u})),P=t.animate([{opacity:0,transform:"translate(".concat(-y,", ").concat(-x,") ").concat(_),offset:.01},{opacity:O,transform:"translate(0, 0) ".concat(_)}],ke(ke({fill:"both"},n),{duration:c+u,delay:l+c-u}));return Ug(P,i),[$,P]}function Sl(e,t,n){var r={},i={};return Object.entries(t).forEach(function(o){var a=se(o,2),s=a[0],l=a[1];if(!hn(l)){var c=e.style[s]||e.parsedStyle[s]||0;c!==l&&(r[s]=c,i[s]=l)}}),n?Vie(e,[r,i],ke({fill:"both"},n)):(Wie(e,i),null)}function YE(e,t){return e.style.opacity||(e.style.opacity=1),Sl(e,{opacity:0},t)}var Uie={fill:"#fff",lineWidth:1,radius:2,size:10,stroke:"#bfbfbf",strokeOpacity:1,zIndex:0},qie={fill:"#000",fillOpacity:.45,fontSize:12,textAlign:"center",textBaseline:"middle",zIndex:1},Gie={x:0,y:0,orientation:"horizontal",showLabel:!0,type:"start"},Ql=ks({foreground:"foreground",handle:"handle",selection:"selection",sparkline:"sparkline",sparklineGroup:"sparkline-group",track:"track",brushArea:"brush-area"},"slider"),Lf=ks({labelGroup:"label-group",label:"label",iconGroup:"icon-group",icon:"icon",iconRect:"icon-rect",iconLine:"icon-line"},"handle"),qrt=function(e){Nt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(n,r){var i=n.x,o=n.y,a=n.size,s=a===void 0?10:a,l=n.radius,c=l===void 0?s/4:l,u=n.orientation,f=Ir(n,["x","y","size","radius","orientation"]),d=s,h=d*2.4,p=gn(r).maybeAppendByClassName(Lf.iconRect,"rect").styles(ke(ke({},f),{width:d,height:h,radius:c,x:i-d/2,y:o-h/2,transformOrigin:"center"})),v=i+1/3*d-d/2,g=i+2/3*d-d/2,m=o+1/4*h-h/2,y=o+3/4*h-h/2;p.maybeAppendByClassName("".concat(Lf.iconLine,"-1"),"line").styles(ke({x1:v,x2:v,y1:m,y2:y},f)),p.maybeAppendByClassName("".concat(Lf.iconLine,"-2"),"line").styles(ke({x1:g,x2:g,y1:m,y2:y},f)),u==="vertical"&&(p.node().style.transform="rotate(90)")},t}(co),Kie=function(e){Nt(t,e);function t(n){return e.call(this,n,Gie)||this}return t.prototype.renderLabel=function(n){var r=this,i=this.attributes,o=i.x,a=i.y,s=i.showLabel,l=Pn(this.attributes,"label"),c=l.x,u=c===void 0?0:c,f=l.y,d=f===void 0?0:f,h=l.transform,p=l.transformOrigin,v=Ir(l,["x","y","transform","transformOrigin"]),g=se(ou(v,[]),2),m=g[0],y=g[1],x=gn(n).maybeAppendByClassName(Lf.labelGroup,"g").styles(y),S=ke(ke({},qie),m),w=S.text,C=Ir(S,["text"]);$a(!!s,x,function(O){r.label=O.maybeAppendByClassName(Lf.label,"text").styles(ke(ke({},C),{x:o+u,y:a+d,transform:h,transformOrigin:p,text:"".concat(w)})),r.label.on("mousedown",function(E){E.stopPropagation()}),r.label.on("touchstart",function(E){E.stopPropagation()})})},t.prototype.renderIcon=function(n){var r=this.attributes,i=r.x,o=r.y,a=r.orientation,s=r.type,l=ke(ke({x:i,y:o,orientation:a},Uie),Pn(this.attributes,"icon")),c=this.attributes.iconShape,u=c===void 0?function(){return new qrt({style:l})}:c,f=gn(n).maybeAppendByClassName(Lf.iconGroup,"g");f.selectAll(Lf.icon.class).data([u]).join(function(d){return d.append(typeof u=="string"?u:function(){return u(s)}).attr("className",Lf.icon.name)},function(d){return d.update(l)},function(d){return d.remove()})},t.prototype.render=function(n,r){this.renderIcon(r),this.renderLabel(r)},t}(co),Yie=function(e){Nt(t,e);function t(n){var r=e.call(this,n,ke(ke(ke({x:0,y:0,animate:{duration:100,fill:"both"},brushable:!0,formatter:function(i){return i.toString()},handleSpacing:2,orientation:"horizontal",padding:0,autoFitLabel:!0,scrollable:!0,selectionFill:"#5B8FF9",selectionFillOpacity:.45,selectionZIndex:2,showHandle:!0,showLabel:!0,slidable:!0,trackFill:"#416180",trackLength:200,trackOpacity:.05,trackSize:20,trackZIndex:-1,values:[0,1],type:"range",selectionType:"select",handleIconOffset:0},Zl(Gie,"handle")),Zl(Uie,"handleIcon")),Zl(qie,"handleLabel")))||this;return r.range=[0,1],r.onDragStart=function(i){return function(o){o.stopPropagation(),r.target=i,r.prevPos=r.getOrientVal(qE(o));var a=r.availableSpace,s=a.x,l=a.y,c=r.getBBox(),u=c.x,f=c.y;r.selectionStartPos=r.getRatio(r.prevPos-r.getOrientVal([s,l])-r.getOrientVal([+u,+f])),r.selectionWidth=0,document.addEventListener("pointermove",r.onDragging),document.addEventListener("pointerup",r.onDragEnd)}},r.onDragging=function(i){var o=r.attributes,a=o.slidable,s=o.brushable,l=o.type;i.stopPropagation();var c=r.getOrientVal(qE(i)),u=c-r.prevPos;if(u){var f=r.getRatio(u);switch(r.target){case"start":a&&r.setValuesOffset(f);break;case"end":a&&r.setValuesOffset(0,f);break;case"selection":a&&r.setValuesOffset(f,f);break;case"track":if(!s)return;r.selectionWidth+=f,l==="range"?r.innerSetValues([r.selectionStartPos,r.selectionStartPos+r.selectionWidth].sort(),!0):r.innerSetValues([0,r.selectionStartPos+r.selectionWidth],!0);break}r.prevPos=c}},r.onDragEnd=function(){document.removeEventListener("pointermove",r.onDragging),document.removeEventListener("pointermove",r.onDragging),document.removeEventListener("pointerup",r.onDragEnd),r.target="",r.updateHandlesPosition(!1)},r.onValueChange=function(i){var o=r.attributes,a=o.onChange,s=o.type,l=s==="range"?i:i[1],c=s==="range"?r.getValues():r.getValues()[1],u=new mr("valuechange",{detail:{oldValue:l,value:c}});r.dispatchEvent(u),a==null||a(c)},r.selectionStartPos=0,r.selectionWidth=0,r.prevPos=0,r.target="",r}return Object.defineProperty(t.prototype,"values",{get:function(){return this.attributes.values},set:function(n){this.attributes.values=this.clampValues(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sparklineStyle",{get:function(){var n=this.attributes.orientation;if(n!=="horizontal")return null;var r=Pn(this.attributes,"sparkline");return ke(ke({zIndex:0},this.availableSpace),r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shape",{get:function(){var n=this.attributes,r=n.trackLength,i=n.trackSize,o=se(this.getOrientVal([[r,i],[i,r]]),2),a=o[0],s=o[1];return{width:a,height:s}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableSpace",{get:function(){var n=this.attributes;n.x,n.y;var r=n.padding,i=se(Oo(r),4),o=i[0],a=i[1],s=i[2],l=i[3],c=this.shape,u=c.width,f=c.height;return{x:l,y:o,width:u-(l+a),height:f-(o+s)}},enumerable:!1,configurable:!0}),t.prototype.getValues=function(){return this.values},t.prototype.setValues=function(n,r){n===void 0&&(n=[0,0]),r===void 0&&(r=!1),this.attributes.values=n;var i=r===!1?!1:this.attributes.animate;this.updateSelectionArea(i),this.updateHandlesPosition(i)},t.prototype.updateSelectionArea=function(n){var r=this.calcSelectionArea();this.foregroundGroup.selectAll(Ql.selection.class).each(function(i,o){Sl(this,r[o],n)})},t.prototype.updateHandlesPosition=function(n){this.attributes.showHandle&&(this.startHandle&&Sl(this.startHandle,this.getHandleStyle("start"),n),this.endHandle&&Sl(this.endHandle,this.getHandleStyle("end"),n))},t.prototype.innerSetValues=function(n,r){n===void 0&&(n=[0,0]),r===void 0&&(r=!1);var i=this.values,o=this.clampValues(n);this.attributes.values=o,this.setValues(o),r&&this.onValueChange(i)},t.prototype.renderTrack=function(n){var r=this.attributes,i=r.x,o=r.y,a=Pn(this.attributes,"track");this.trackShape=gn(n).maybeAppendByClassName(Ql.track,"rect").styles(ke(ke({x:i,y:o},this.shape),a))},t.prototype.renderBrushArea=function(n){var r=this.attributes,i=r.x,o=r.y,a=r.brushable;this.brushArea=gn(n).maybeAppendByClassName(Ql.brushArea,"rect").styles(ke({x:i,y:o,fill:"transparent",cursor:a?"crosshair":"default"},this.shape))},t.prototype.renderSparkline=function(n){var r=this,i=this.attributes,o=i.x,a=i.y,s=i.orientation,l=gn(n).maybeAppendByClassName(Ql.sparklineGroup,"g");$a(s==="horizontal",l,function(c){var u=ke(ke({},r.sparklineStyle),{x:o,y:a});c.maybeAppendByClassName(Ql.sparkline,function(){return new zrt({style:u})}).update(u)})},t.prototype.renderHandles=function(){var n=this,r,i=this.attributes,o=i.showHandle,a=i.type,s=a==="range"?["start","end"]:["end"],l=o?s:[],c=this;(r=this.foregroundGroup)===null||r===void 0||r.selectAll(Ql.handle.class).data(l.map(function(u){return{type:u}}),function(u){return u.type}).join(function(u){return u.append(function(f){var d=f.type;return new Kie({style:n.getHandleStyle(d)})}).each(function(f){var d=f.type;this.attr("class","".concat(Ql.handle.name," ").concat(d,"-handle"));var h="".concat(d,"Handle");c[h]=this,this.addEventListener("pointerdown",c.onDragStart(d))})},function(u){return u.each(function(f){var d=f.type;this.update(c.getHandleStyle(d))})},function(u){return u.each(function(f){var d=f.type,h="".concat(d,"Handle");c[h]=void 0}).remove()})},t.prototype.renderSelection=function(n){var r=this.attributes,i=r.x,o=r.y,a=r.type,s=r.selectionType;this.foregroundGroup=gn(n).maybeAppendByClassName(Ql.foreground,"g");var l=Pn(this.attributes,"selection"),c=function(f){return f.style("visibility",function(d){return d.show?"visible":"hidden"}).style("cursor",function(d){return s==="select"?"grab":s==="invert"?"crosshair":"default"}).styles(ke(ke({},l),{transform:"translate(".concat(i,", ").concat(o,")")}))},u=this;this.foregroundGroup.selectAll(Ql.selection.class).data(a==="value"?[]:this.calcSelectionArea().map(function(f,d){return{style:ke({},f),index:d,show:s==="select"?d===1:d!==1}}),function(f){return f.index}).join(function(f){return f.append("rect").attr("className",Ql.selection.name).call(c).each(function(d,h){var p=this;h===1?(u.selectionShape=gn(this),this.on("pointerdown",function(v){p.attr("cursor","grabbing"),u.onDragStart("selection")(v)}),u.dispatchCustomEvent(this,"pointerenter","selectionMouseenter"),u.dispatchCustomEvent(this,"pointerleave","selectionMouseleave"),u.dispatchCustomEvent(this,"click","selectionClick"),this.addEventListener("pointerdown",function(){p.attr("cursor","grabbing")}),this.addEventListener("pointerup",function(){p.attr("cursor","pointer")}),this.addEventListener("pointerover",function(){p.attr("cursor","pointer")})):this.on("pointerdown",u.onDragStart("track"))})},function(f){return f.call(c)},function(f){return f.remove()}),this.updateSelectionArea(!1),this.renderHandles()},t.prototype.render=function(n,r){this.renderTrack(r),this.renderSparkline(r),this.renderBrushArea(r),this.renderSelection(r)},t.prototype.clampValues=function(n,r){var i;r===void 0&&(r=4);var o=se(this.range,2),a=o[0],s=o[1],l=se(this.getValues().map(function(g){return w6(g,r)}),2),c=l[0],u=l[1],f=Array.isArray(n)?n:[c,n!=null?n:u],d=se((f||[c,u]).map(function(g){return w6(g,r)}),2),h=d[0],p=d[1];if(this.attributes.type==="value")return[0,ai(p,a,s)];h>p&&(i=se([p,h],2),h=i[0],p=i[1]);var v=p-h;return v>s-a?[a,s]:h<a?c===a&&u===p?[a,p]:[a,v+a]:p>s?u===s&&c===h?[h,s]:[s-v,s]:[h,p]},t.prototype.calcSelectionArea=function(n){var r=se(this.clampValues(n),2),i=r[0],o=r[1],a=this.availableSpace,s=a.x,l=a.y,c=a.width,u=a.height;return this.getOrientVal([[{y:l,height:u,x:s,width:i*c},{y:l,height:u,x:i*c+s,width:(o-i)*c},{y:l,height:u,x:o*c,width:(1-o)*c}],[{x:s,width:c,y:l,height:i*u},{x:s,width:c,y:i*u+l,height:(o-i)*u},{x:s,width:c,y:o*u,height:(1-o)*u}]])},t.prototype.calcHandlePosition=function(n){var r=this.attributes.handleIconOffset,i=this.availableSpace,o=i.x,a=i.y,s=i.width,l=i.height,c=se(this.clampValues(),2),u=c[0],f=c[1],d=n==="start"?-r:r,h=(n==="start"?u:f)*this.getOrientVal([s,l])+d;return{x:o+this.getOrientVal([h,s/2]),y:a+this.getOrientVal([l/2,h])}},t.prototype.inferTextStyle=function(n){var r=this.attributes.orientation;return r==="horizontal"?{}:n==="start"?{transformOrigin:"left center",transform:"rotate(90)",textAlign:"start"}:n==="end"?{transformOrigin:"right center",transform:"rotate(90)",textAlign:"end"}:{}},t.prototype.calcHandleText=function(n){var r,i=this.attributes,o=i.type,a=i.orientation,s=i.formatter,l=i.autoFitLabel,c=Pn(this.attributes,"handle"),u=Pn(c,"label"),f=c.spacing,d=this.getHandleSize(),h=this.clampValues(),p=n==="start"?h[0]:h[1],v=s(p),g=new y6({style:ke(ke(ke({},u),this.inferTextStyle(n)),{text:v})}),m=g.getBBox(),y=m.width,x=m.height;if(g.destroy(),!l){if(o==="value")return{text:v,x:0,y:-x-f};var S=f+d+(a==="horizontal"?y/2:0);return r={text:v},r[a==="horizontal"?"x":"y"]=n==="start"?-S:S,r}var w=0,C=0,O=this.availableSpace,E=O.width,_=O.height,$=this.calcSelectionArea()[1],P=$.x,T=$.y,I=$.width,M=$.height,R=f+d;if(a==="horizontal"){var N=R+y/2;if(n==="start"){var k=P-R-y;w=k>0?-N:N}else{var A=E-P-I-R>y;w=A?N:-N}}else{var j=R,D=x+R;n==="start"?C=T-d>x?-D:j:C=_-(T+M)-d>x?D:-j}return{x:w,y:C,text:v}},t.prototype.getHandleLabelStyle=function(n){var r=Pn(this.attributes,"handleLabel");return ke(ke(ke({},r),this.calcHandleText(n)),this.inferTextStyle(n))},t.prototype.getHandleIconStyle=function(){var n=this.attributes.handleIconShape,r=Pn(this.attributes,"handleIcon"),i=this.getOrientVal(["ew-resize","ns-resize"]),o=this.getHandleSize();return ke({cursor:i,shape:n,size:o},r)},t.prototype.getHandleStyle=function(n){var r=this.attributes,i=r.x,o=r.y,a=r.showLabel,s=r.showLabelOnInteraction,l=r.orientation,c=this.calcHandlePosition(n),u=c.x,f=c.y,d=this.calcHandleText(n),h=a;return!a&&s&&(this.target?h=!0:h=!1),ke(ke(ke({},Zl(this.getHandleIconStyle(),"icon")),Zl(ke(ke({},this.getHandleLabelStyle(n)),d),"label")),{transform:"translate(".concat(u+i,", ").concat(f+o,")"),orientation:l,showLabel:h,type:n,zIndex:3})},t.prototype.getHandleSize=function(){var n=this.attributes,r=n.handleIconSize,i=n.width,o=n.height;return r||Math.floor((this.getOrientVal([+o,+i])+4)/2.4)},t.prototype.getOrientVal=function(n){var r=se(n,2),i=r[0],o=r[1],a=this.attributes.orientation;return a==="horizontal"?i:o},t.prototype.setValuesOffset=function(n,r,i){r===void 0&&(r=0),i===void 0&&(i=!1);var o=this.attributes.type,a=se(this.getValues(),2),s=a[0],l=a[1],c=o==="range"?n:0,u=[s+c,l+r].sort();i?this.setValues(u):this.innerSetValues(u,!0)},t.prototype.getRatio=function(n){var r=this.availableSpace,i=r.width,o=r.height;return n/this.getOrientVal([i,o])},t.prototype.dispatchCustomEvent=function(n,r,i){var o=this;n.on(r,function(a){a.stopPropagation(),o.dispatchEvent(new mr(i,{detail:a}))})},t.prototype.bindEvents=function(){this.addEventListener("wheel",this.onScroll);var n=this.brushArea;this.dispatchCustomEvent(n,"click","trackClick"),this.dispatchCustomEvent(n,"pointerenter","trackMouseenter"),this.dispatchCustomEvent(n,"pointerleave","trackMouseleave"),n.on("pointerdown",this.onDragStart("track"))},t.prototype.onScroll=function(n){var r=this.attributes.scrollable;if(r){var i=n.deltaX,o=n.deltaY,a=o||i,s=this.getRatio(a);this.setValuesOffset(s,s,!0)}},t.tag="slider",t}(co),Grt=function(e){Nt(t,e);function t(n){var r=e.call(this,n,{x:0,y:0,isRound:!0,orientation:"vertical",padding:[2,2,2,2],scrollable:!0,slidable:!0,thumbCursor:"default",trackSize:10,value:0})||this;return r.range=[0,1],r.onValueChange=function(i){var o=r.attributes.value;if(i!==o){var a={detail:{oldValue:i,value:o}};r.dispatchEvent(new mr("scroll",a)),r.dispatchEvent(new mr("valuechange",a))}},r.onTrackClick=function(i){var o=r.attributes.slidable;if(o){var a=se(r.getLocalPosition(),2),s=a[0],l=a[1],c=se(r.padding,4),u=c[0],f=c[3],d=r.getOrientVal([s+f,l+u]),h=r.getOrientVal(qE(i)),p=(h-d)/r.trackLength;r.setValue(p,!0)}},r.onThumbMouseenter=function(i){r.dispatchEvent(new mr("thumbMouseenter",{detail:i.detail}))},r.onTrackMouseenter=function(i){r.dispatchEvent(new mr("trackMouseenter",{detail:i.detail}))},r.onThumbMouseleave=function(i){r.dispatchEvent(new mr("thumbMouseleave",{detail:i.detail}))},r.onTrackMouseleave=function(i){r.dispatchEvent(new mr("trackMouseleave",{detail:i.detail}))},r}return Object.defineProperty(t.prototype,"padding",{get:function(){var n=this.attributes.padding;return Oo(n)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var n=this.attributes.value,r=se(this.range,2),i=r[0],o=r[1];return ai(n,i,o)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trackLength",{get:function(){var n=this.attributes,r=n.viewportLength,i=n.trackLength,o=i===void 0?r:i;return o},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"availableSpace",{get:function(){var n=this.attributes.trackSize,r=this.trackLength,i=se(this.padding,4),o=i[0],a=i[1],s=i[2],l=i[3],c=se(this.getOrientVal([[r,n],[n,r]]),2),u=c[0],f=c[1];return{x:l,y:o,width:+u-(l+a),height:+f-(o+s)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"trackRadius",{get:function(){var n=this.attributes,r=n.isRound,i=n.trackSize;return r?i/2:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"thumbRadius",{get:function(){var n=this.attributes,r=n.isRound,i=n.thumbRadius;if(!r)return 0;var o=this.availableSpace,a=o.width,s=o.height;return i||this.getOrientVal([s,a])/2},enumerable:!1,configurable:!0}),t.prototype.getValues=function(n){n===void 0&&(n=this.value);var r=this.attributes,i=r.viewportLength,o=r.contentLength,a=i/o,s=se(this.range,2),l=s[0],c=s[1],u=n*(c-l-a);return[u,u+a]},t.prototype.getValue=function(){return this.value},t.prototype.renderSlider=function(n){var r=this.attributes,i=r.x,o=r.y,a=r.orientation,s=r.trackSize,l=r.padding,c=r.slidable,u=Pn(this.attributes,"track"),f=Pn(this.attributes,"thumb"),d=ke(ke({x:i,y:o,brushable:!1,orientation:a,padding:l,selectionRadius:this.thumbRadius,showHandle:!1,slidable:c,trackLength:this.trackLength,trackRadius:this.trackRadius,trackSize:s,values:this.getValues()},Zl(u,"track")),Zl(f,"selection"));this.slider=gn(n).maybeAppendByClassName("scrollbar",function(){return new Yie({style:d})}).update(d).node()},t.prototype.render=function(n,r){this.renderSlider(r)},t.prototype.setValue=function(n,r){r===void 0&&(r=!1);var i=this.attributes.value,o=se(this.range,2),a=o[0],s=o[1];this.slider.setValues(this.getValues(ai(n,a,s)),r),this.onValueChange(i)},t.prototype.bindEvents=function(){var n=this;this.slider.addEventListener("trackClick",function(r){r.stopPropagation(),n.onTrackClick(r.detail)}),this.onHover()},t.prototype.getOrientVal=function(n){var r=this.attributes.orientation;return r==="horizontal"?n[0]:n[1]},t.prototype.onHover=function(){this.slider.addEventListener("selectionMouseenter",this.onThumbMouseenter),this.slider.addEventListener("trackMouseenter",this.onTrackMouseenter),this.slider.addEventListener("selectionMouseleave",this.onThumbMouseleave),this.slider.addEventListener("trackMouseleave",this.onTrackMouseleave)},t.tag="scrollbar",t}(co),_6={data:[],animate:{enter:!1,update:{duration:100,easing:"ease-in-out-sine",fill:"both"},exit:{duration:100,fill:"both"}},showArrow:!0,showGrid:!0,showLabel:!0,showLine:!0,showTick:!0,showTitle:!0,showTrunc:!1,dataThreshold:100,lineLineWidth:1,lineStroke:"black",crossPadding:10,titleFill:"black",titleFontSize:12,titlePosition:"lb",titleSpacing:0,titleTextAlign:"center",titleTextBaseline:"middle",lineArrow:function(){return new ra({style:{d:[["M",10,10],["L",-10,0],["L",10,-10],["L",0,0],["L",10,10],["Z"]],fill:"black",transformOrigin:"center"}})},labelAlign:"parallel",labelDirection:"positive",labelFontSize:12,labelSpacing:0,gridConnect:"line",gridControlAngles:[],gridDirection:"positive",gridLength:0,gridType:"segment",lineArrowOffset:15,lineArrowSize:10,tickDirection:"positive",tickLength:5,tickLineWidth:1,tickStroke:"black",labelOverlap:[]};Ue({},_6,{style:{type:"arc"}}),Ue({},_6,{style:{}});var lr=ks({mainGroup:"main-group",gridGroup:"grid-group",grid:"grid",lineGroup:"line-group",line:"line",tickGroup:"tick-group",tick:"tick",tickItem:"tick-item",labelGroup:"label-group",label:"label",labelItem:"label-item",titleGroup:"title-group",title:"title",lineFirst:"line-first",lineSecond:"line-second"},"axis"),qg=ks({lineGroup:"line-group",line:"line",regionGroup:"region-group",region:"region"},"grid");function Xie(e){return e.reduce(function(t,n,r){return t.push(it([r===0?"M":"L"],se(n),!1)),t},[])}function Krt(e,t,n){var r=t.connect,i=r===void 0?"line":r,o=t.center;if(i==="line")return Xie(e);if(!o)return[];var a=mb(e[0],o),s=n?0:1;return e.reduce(function(l,c,u){return u===0?l.push(it(["M"],se(c),!1)):l.push(it(["A",a,a,0,0,s],se(c),!1)),l},[])}function $6(e,t,n){return t.type==="surround"?Krt(e,t,n):Xie(e)}function Yrt(e,t,n){var r=n.type,i=n.connect,o=n.center,a=n.closed,s=a?[["Z"]]:[],l=se([$6(e,n),$6(t.slice().reverse(),n,!0)],2),c=l[0],u=l[1],f=se([e[0],t.slice(-1)[0]],2),d=f[0],h=f[1],p=function(y,x){return[c,y,u,x,s].flat()};if(i==="line"||r==="surround")return p([it(["L"],se(h),!1)],[it(["L"],se(d),!1)]);if(!o)throw new Error("Arc grid need to specified center");var v=se([mb(h,o),mb(d,o)],2),g=v[0],m=v[1];return p([it(["A",g,g,0,0,1],se(h),!1),it(["L"],se(h),!1)],[it(["A",m,m,0,0,0],se(d),!1),it(["L"],se(d),!1)])}function Xrt(e,t,n,r){var i=n.animate,o=n.isBillboard,a=t.map(function(s,l){return{id:s.id||"grid-line-".concat(l),d:$6(s.points,n)}});return e.selectAll(qg.line.class).data(a,function(s){return s.id}).join(function(s){return s.append("path").each(function(l,c){var u=Ns(Nie(ke({d:l.d},r)),[l,c,a]);this.attr(ke({class:qg.line.name,stroke:"#D9D9D9",lineWidth:1,lineDash:[4,4],isBillboard:o},u))})},function(s){return s.transition(function(l,c){var u=Ns(Nie(ke({d:l.d},r)),[l,c,a]);return Sl(this,u,i.update)})},function(s){return s.transition(function(){var l=this,c=YE(this,i.exit);return Ug(c,function(){return l.remove()}),c})}).transitions()}function Zrt(e,t,n){var r=n.animate,i=n.connect,o=n.areaFill;if(t.length<2||!o||!i)return[];for(var a=Array.isArray(o)?o:[o,"transparent"],s=function(p){return a[p%a.length]},l=[],c=0;c<t.length-1;c++){var u=se([t[c].points,t[c+1].points],2),f=u[0],d=u[1],h=Yrt(f,d,n);l.push({d:h,fill:s(c)})}return e.selectAll(qg.region.class).data(l,function(p,v){return v}).join(function(p){return p.append("path").each(function(v,g){var m=Ns(v,[v,g,l]);this.attr(m)}).attr("className",qg.region.name)},function(p){return p.transition(function(v,g){var m=Ns(v,[v,g,l]);return Sl(this,m,r.update)})},function(p){return p.transition(function(){var v=this,g=YE(this,r.exit);return Ug(g,function(){return v.remove()}),g})}).transitions()}function Qrt(e){var t=e.data,n=t===void 0?[]:t,r=e.closed;return r?n.map(function(i){var o=i.points,a=se(o,1),s=a[0];return ke(ke({},i),{points:it(it([],se(o),!1),[s],!1)})}):n}var Jrt=function(e){Nt(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(n,r){n.type,n.center,n.areaFill,n.closed;var i=Ir(n,["type","center","areaFill","closed"]),o=Qrt(n),a=gn(r).maybeAppendByClassName(qg.lineGroup,"g"),s=gn(r).maybeAppendByClassName(qg.regionGroup,"g"),l=Xrt(a,o,n,i),c=Zrt(s,o,n);return it(it([],se(l),!1),se(c),!1)},t}(co);function Zie(e,t){return Object.fromEntries(Object.entries(e).map(function(n){var r=se(n,2),i=r[0],o=r[1];return[i,Ns(o,t)]}))}function P6(e,t){return t&&ea(t)?e.filter(t):e}function Qie(e,t){var n=t.startAngle,r=t.endAngle;return(r-n)*e+n}function XE(e,t){if(t.type==="linear"){var n=se(t.startPos,2),r=n[0],i=n[1],o=se(t.endPos,2),a=o[0],s=o[1],l=se([a-r,s-i],2),c=l[0],u=l[1];return Iie([c,u])}var f=Vg(Qie(e,t));return[-Math.sin(f),Math.cos(f)]}function M6(e,t,n){var r=XE(e,n);return Znt(r,t!=="positive")}function bb(e,t){return M6(e,t.labelDirection,t)}function eit(e,t){var n=se(t.startPos,2),r=n[0],i=n[1],o=se(t.endPos,2),a=o[0],s=o[1],l=se([a-r,s-i],2),c=l[0],u=l[1];return[r+c*e,i+u*e]}function tit(e,t){var n=t.radius,r=se(t.center,2),i=r[0],o=r[1],a=Vg(Qie(e,t));return[i+n*Math.cos(a),o+n*Math.sin(a)]}function ZE(e,t){return t.type==="linear"?eit(e,t):tit(e,t)}function Jie(e){return XE(0,e)[1]===0}function eoe(e){return XE(0,e)[0]===0}function toe(e,t){return t-e===360}function noe(e,t,n,r,i){var o=t-e,a=se([i,i],2),s=a[0],l=a[1],c=se([Vg(e),Vg(t)],2),u=c[0],f=c[1],d=function(_){return[n+i*Math.cos(_),r+i*Math.sin(_)]},h=se(d(u),2),p=h[0],v=h[1],g=se(d(f),2),m=g[0],y=g[1];if(toe(e,t)){var x=(f+u)/2,S=se(d(x),2),w=S[0],C=S[1];return[["M",p,v],["A",s,l,0,1,0,w,C],["A",s,l,0,1,0,m,y]]}var O=o>180?1:0,E=e>t?0:1;return"M".concat(p,",").concat(v,",A").concat(s,",").concat(l,",0,").concat(O,",").concat(E,",").concat(m,",").concat(y)}function nit(e){var t=e.attributes,n=t.startAngle,r=t.endAngle,i=t.center,o=t.radius;return it(it([n,r],se(i),!1),[o],!1)}function rit(e,t,n,r){var i=t.startAngle,o=t.endAngle,a=t.center,s=t.radius;return e.selectAll(lr.line.class).data([{d:noe.apply(void 0,it(it([i,o],se(a),!1),[s],!1))}],function(l,c){return c}).join(function(l){return l.append("path").attr("className",lr.line.name).styles(t).styles({d:function(c){return c.d}})},function(l){return l.transition(function(){var c=this,u=Gnt(this,nit(this),it(it([i,o],se(a),!1),[s],!1),r.update);if(u){var f=function(){var d=Hn(c.attributes,"__keyframe_data__");c.style.d=noe.apply(void 0,it([],se(d),!1))};u.onframe=f,u.onfinish=f}return u}).styles(t)},function(l){return l.remove()}).styles(n).transitions()}function iit(e,t){t.truncRange,t.truncShape,t.lineExtension}function oit(e,t,n){n===void 0&&(n=[0,0]);var r=se([e,t,n],3),i=se(r[0],2),o=i[0],a=i[1],s=se(r[1],2),l=s[0],c=s[1],u=se(r[2],2),f=u[0],d=u[1],h=se([l-o,c-a],2),p=h[0],v=h[1],g=Math.sqrt(Math.pow(p,2)+Math.pow(v,2)),m=se([-f/g,d/g],2),y=m[0],x=m[1];return[y*p,y*v,x*p,x*v]}function roe(e){var t=se(e,2),n=se(t[0],2),r=n[0],i=n[1],o=se(t[1],2),a=o[0],s=o[1];return{x1:r,y1:i,x2:a,y2:s}}function ait(e,t,n,r){var i=t.showTrunc,o=t.startPos,a=t.endPos,s=t.truncRange,l=t.lineExtension,c=se([o,a],2),u=se(c[0],2),f=u[0],d=u[1],h=se(c[1],2),p=h[0],v=h[1],g=se(l?oit(o,a,l):new Array(4).fill(0),4),m=g[0],y=g[1],x=g[2],S=g[3],w=function(A){return e.selectAll(lr.line.class).data(A,function(j,D){return D}).join(function(j){return j.append("line").attr("className",function(D){return"".concat(lr.line.name," ").concat(D.className)}).styles(n).transition(function(D){return Sl(this,roe(D.line),!1)})},function(j){return j.styles(n).transition(function(D){var L=D.line;return Sl(this,roe(L),r.update)})},function(j){return j.remove()}).transitions()};if(!i||!s)return w([{line:[[f+m,d+y],[p+x,v+S]],className:lr.line.name}]);var C=se(s,2),O=C[0],E=C[1],_=p-f,$=v-d,P=se([f+_*O,d+$*O],2),T=P[0],I=P[1],M=se([f+_*E,d+$*E],2),R=M[0],N=M[1],k=w([{line:[[f+m,d+y],[T,I]],className:lr.lineFirst.name},{line:[[R,N],[p+x,v+S]],className:lr.lineSecond.name}]);return iit(e,t),k}function sit(e,t,n,r){var i=n.showArrow,o=n.showTrunc,a=n.lineArrow,s=n.lineArrowOffset,l=n.lineArrowSize,c;if(t==="arc"?c=e.select(lr.line.class):o?c=e.select(lr.lineSecond.class):c=e.select(lr.line.class),!i||!a||n.type==="arc"&&toe(n.startAngle,n.endAngle)){var u=c.node();u&&(u.style.markerEnd=void 0);return}var f=Ah(a);f.attr(r),C6(f,l),c.style("markerEnd",f).style("markerEndOffset",-s)}function lit(e,t,n){var r=t.type,i,o=Pn(t,"line");return r==="linear"?i=ait(e,t,Rie(o,"arrow"),n):i=rit(e,t,Rie(o,"arrow"),n),sit(e,r,t,o),i}function cit(e,t){return M6(e,t.gridDirection,t)}function ioe(e){var t=e.type,n=e.gridCenter;return t==="linear"?n:n||e.center}function uit(e,t){var n=t.gridLength;return e.map(function(r,i){var o=r.value,a=se(ZE(o,t),2),s=a[0],l=a[1],c=se(iu(cit(o,t),n),2),u=c[0],f=c[1];return{id:i,points:[[s,l],[s+u,l+f]]}})}function fit(e,t){var n=t.gridControlAngles,r=ioe(t);if(!r)throw new Error("grid center is not provide");if(e.length<2)throw new Error("Invalid grid data");if(!n||n.length===0)throw new Error("Invalid gridControlAngles");var i=se(r,2),o=i[0],a=i[1];return e.map(function(s,l){var c=s.value,u=se(ZE(c,t),2),f=u[0],d=u[1],h=se([f-o,d-a],2),p=h[0],v=h[1],g=[];return n.forEach(function(m){var y=Vg(m),x=se([Math.cos(y),Math.sin(y)],2),S=x[0],w=x[1],C=p*S-v*w+o,O=p*w+v*S+a;g.push([C,O])}),{points:g,id:l}})}function dit(e,t,n,r){var i=Pn(n,"grid"),o=i.type,a=i.areaFill,s=ioe(n),l=P6(t,n.gridFilter),c=o==="segment"?uit(l,n):fit(l,n),u=ke(ke({},i),{center:s,areaFill:ea(a)?l.map(function(f,d){return Ns(a,[f,d,l])}):a,animate:r,data:c});return e.selectAll(lr.grid.class).data([1]).join(function(f){return f.append(function(){return new Jrt({style:u})}).attr("className",lr.grid.name)},function(f){return f.transition(function(){return this.update(u)})},function(f){return f.remove()}).transitions()}var T6=function(){function e(t,n,r,i){this.set(t,n,r,i)}return Object.defineProperty(e.prototype,"left",{get:function(){return this.x1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"top",{get:function(){return this.y1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"right",{get:function(){return this.x2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bottom",{get:function(){return this.y2},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"width",{get:function(){return this.defined("x2")&&this.defined("x1")?this.x2-this.x1:void 0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this.defined("y2")&&this.defined("y1")?this.y2-this.y1:void 0},enumerable:!1,configurable:!0}),e.prototype.rotatedPoints=function(t,n,r){var i=this,o=i.x1,a=i.y1,s=i.x2,l=i.y2,c=Math.cos(t),u=Math.sin(t),f=n-n*c+r*u,d=r-n*u-r*c,h=[[c*o-u*l+f,u*o+c*l+d],[c*s-u*l+f,u*s+c*l+d],[c*o-u*a+f,u*o+c*a+d],[c*s-u*a+f,u*s+c*a+d]];return h},e.prototype.set=function(t,n,r,i){return r<t?(this.x2=t,this.x1=r):(this.x1=t,this.x2=r),i<n?(this.y2=n,this.y1=i):(this.y1=n,this.y2=i),this},e.prototype.defined=function(t){return this[t]!==Number.MAX_VALUE&&this[t]!==-Number.MAX_VALUE},e}();function I6(e,t){var n=e.getEulerAngles()||0;e.setEulerAngles(0);var r=e.getBounds(),i=se(r.min,2),o=i[0],a=i[1],s=se(r.max,2),l=s[0],c=s[1],u=e.getBBox(),f=u.width,d=u.height,h=d,p=0,v=0,g=o,m=a,y=Pie(e);if(y){h-=1.5;var x=y.style.textAlign,S=y.style.textBaseline;x==="center"?g=(o+l)/2:(x==="right"||x==="end")&&(g=l),S==="middle"?m=(a+c)/2:S==="bottom"&&(m=c)}var w=se(Oo(t),4),C=w[0],O=C===void 0?0:C,E=w[1],_=E===void 0?0:E,$=w[2],P=$===void 0?O:$,T=w[3],I=T===void 0?_:T,M=new T6((p+=o)-I,(v+=a)-O,p+f+_,v+h+P);return e.setEulerAngles(n),M.rotatedPoints(Vg(n),g,m)}function xb(e,t){return t[0]<=Math.max(e[0][0],e[1][0])&&t[0]<=Math.min(e[0][0],e[1][0])&&t[1]<=Math.max(e[0][1],e[1][1])&&t[1]<=Math.min(e[0][1],e[1][1])}function Sb(e,t,n){var r=(t[1]-e[1])*(n[0]-t[0])-(t[0]-e[0])*(n[1]-t[1]);return r===0?0:r<0?2:1}function hit(e,t){var n=Sb(e[0],e[1],t[0]),r=Sb(e[0],e[1],t[1]),i=Sb(t[0],t[1],e[0]),o=Sb(t[0],t[1],e[1]);return!!(n!==r&&i!==o||n===0&&xb(e,t[0])||r===0&&xb(e,t[1])||i===0&&xb(t,e[0])||o===0&&xb(t,e[1]))}function pit(e,t){var n=e.length;if(n<3)return!1;var r=[t,[9999,t[1]]],i=0,o=0;do{var a=[e[o],e[(o+1)%n]];if(hit(a,r)){if(Sb(a[0],t,a[1])===0)return xb(a,t);i++}o=(o+1)%n}while(o!==0);return!!(i&1)}function vit(e,t){return t.every(function(n){return pit(e,n)})}function git(e,t,n){var r=e.x1,i=e.x2,o=e.y1,a=e.y2,s=[[r,o],[i,o],[i,a],[r,a]],l=I6(t,n);return vit(s,l)}function mit(e,t){var n=se(e,4),r=n[0],i=n[1],o=n[2],a=n[3],s=se(t,4),l=s[0],c=s[1],u=s[2],f=s[3],d=o-r,h=a-i,p=u-l,v=f-c,g=d*v-p*h;if(g===0)return!1;var m=g>0,y=r-l,x=i-c,S=d*x-h*y;if(S<0===m)return!1;var w=p*x-v*y;return!(w<0===m||S>g===m||w>g===m)}function yit(e,t){var n=[[e[0],e[1],e[2],e[3]],[e[2],e[3],e[4],e[5]],[e[4],e[5],e[6],e[7]],[e[6],e[7],e[0],e[1]]];return n.some(function(r){return mit(t,r)})}function bit(e,t,n){var r,i,o=I6(e,n).flat(1),a=I6(t,n).flat(1),s=[[o[0],o[1],o[2],o[3]],[o[0],o[1],o[4],o[5]],[o[4],o[5],o[6],o[7]],[o[2],o[3],o[6],o[7]]];try{for(var l=Xa(s),c=l.next();!c.done;c=l.next()){var u=c.value;if(yit(a,u))return!0}}catch(f){r={error:f}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return!1}function xit(e,t){var n=e.type,r=e.labelDirection,i=e.crossSize;if(!i)return!1;if(n==="arc"){var o=e.center,a=e.radius,s=se(o,2),l=s[0],c=s[1],u=r==="negative"?0:i,f=-a-u,d=a+u,h=se(Oo(t),4),p=h[0],v=h[1],g=h[2],m=h[3];return new T6(l+f-m,c+f-p,l+d+v,c+d+g)}var y=se(e.startPos,2),x=y[0],S=y[1],w=se(e.endPos,2),C=w[0],O=w[1],E=se(eoe(e)?[-t,0,t,0]:[0,t,0,-t],4),_=E[0],$=E[1],P=E[2],T=E[3],I=bb(0,e),M=iu(I,i),R=new T6(x,S,C,O);return R.x1+=T,R.y1+=_,R.x2+=$+M[0],R.y2+=P+M[1],R}function QE(e,t,n){var r,i,o=t.crossPadding,a=new Set,s=null,l=xit(t,o),c=function(p){return l?git(l,p):!0},u=function(p,v){return!p||!p.firstChild?!0:!bit(p.firstChild,v.firstChild,Oo(n))};try{for(var f=Xa(e),d=f.next();!d.done;d=f.next()){var h=d.value;c(h)?!s||u(s,h)?s=h:(a.add(s),a.add(h)):a.add(h)}}catch(p){r={error:p}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return Array.from(a)}function R6(e,t){return t===void 0&&(t={}),hn(e)?0:typeof e=="number"?e:Math.floor(znt(e,t))}function Sit(e,t,n,r){if(!(e.length<=1)){var i=t.suffix,o=i===void 0?"...":i,a=t.minLength,s=t.maxLength,l=s===void 0?1/0:s,c=t.step,u=c===void 0?" ":c,f=t.margin,d=f===void 0?[0,0,0,0]:f,h=$ie(r.getTextShape(e[0])),p=R6(u,h),v=a?R6(a,h):p,g=R6(l,h);(hn(g)||g===1/0)&&(g=Math.max.apply(null,e.map(function(C){return C.getBBox().width})));var m=e.slice(),y=se(d,4);y[0],y[1],y[2],y[3];for(var x=function(C){if(m.forEach(function(O){r.ellipsis(r.getTextShape(O),C,o)}),m=QE(e,n,d),m.length<1)return{value:void 0}},S=g;S>v+p;S-=p){var w=x(S);if(typeof w=="object")return w.value}}}var wit={parity:function(e,t){var n=t.seq,r=n===void 0?2:n;return e.filter(function(i,o){return o%r?(Af(i),!1):!0})}},Cit=function(e){return e.filter(_ie)};function Oit(e,t,n,r){var i=e.length,o=t.keepHeader,a=t.keepTail;if(!(i<=1||i===2&&o&&a)){var s=wit.parity,l=function(x){return x.forEach(r.show),x},c=2,u=e.slice(),f=e.slice(),d=Math.min.apply(Math,it([1],se(e.map(function(x){return x.getBBox().width})),!1));if(n.type==="linear"&&(Jie(n)||eoe(n))){var h=kie(e[0]).left,p=kie(e[i-1]).right,v=Math.abs(p-h)||1;c=Math.max(Math.floor(i*d/v),c)}var g,m;for(o&&(g=u.splice(0,1)[0]),a&&(m=u.splice(-1,1)[0],u.reverse()),l(u);c<e.length&&QE(Cit(m?it(it([m],se(f),!1),[g],!1):it([g],se(f),!1)),n,t==null?void 0:t.margin).length;){if(m&&!g&&c%2===0){var y=u.splice(0,1);y.forEach(r.hide)}else if(m&&g){var y=u.splice(0,1);y.forEach(r.hide)}f=s(l(u),{seq:c}),c++}}}function Eit(e,t,n,r){var i,o,a=t.optionalAngles,s=a===void 0?[0,45,90]:a,l=t.margin,c=t.recoverWhenFailed,u=c===void 0?!0:c,f=e.map(function(m){return m.getLocalEulerAngles()}),d=function(){return QE(e,n,l).length<1},h=function(m){return e.forEach(function(y,x){var S=Array.isArray(m)?m[x]:m;r.rotate(y,+S)})};try{for(var p=Xa(s),v=p.next();!v.done;v=p.next()){var g=v.value;if(h(g),d())return}}catch(m){i={error:m}}finally{try{v&&!v.done&&(o=p.return)&&o.call(p)}finally{if(i)throw i.error}}u&&h(f)}function _it(e){var t=e.type,n=e.labelDirection;return t==="linear"&&Jie(e)?n==="negative"?"bottom":"top":"middle"}function $it(e,t,n,r){var i=t.wordWrapWidth,o=i===void 0?50:i,a=t.maxLines,s=a===void 0?3:a,l=t.recoverWhenFailed,c=l===void 0?!0:l,u=t.margin,f=u===void 0?[0,0,0,0]:u,d=e.map(function(y){return y.attr("maxLines")||1}),h=Math.min.apply(Math,it([],se(d),!1)),p=function(){return QE(e,n,f).length<1},v=_it(n),g=function(y){return e.forEach(function(x,S){var w=Array.isArray(y)?y[S]:y;r.wrap(x,o,w,v)})};if(!(h>s)){for(var m=h;m<=s;m++)if(g(m),p())return;c&&g(d)}}var Pit=new Map([["hide",Oit],["rotate",Eit],["ellipsis",Sit],["wrap",$it]]);function Mit(e,t,n){return t.labelOverlap.length<1?!1:n==="hide"?!Fnt(e[0]):n==="rotate"?!e.some(function(r){var i;return!!(!((i=r.attr("transform"))===null||i===void 0)&&i.includes("rotate"))}):n==="ellipsis"||n==="wrap"?e.filter(function(r){return r.querySelector("text")}).length>1:!0}function Tit(e,t,n){var r=t.labelOverlap,i=r===void 0?[]:r;i.length&&i.forEach(function(o){var a=o.type,s=Pit.get(a);Mit(e,t,a)&&(s==null||s(e,o,t,n))})}function Iit(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=function(r){return r==="positive"?-1:1};return e.reduce(function(r,i){return r*n(i)},1)}function ooe(e){for(var t=e;t<0;)t+=360;return Math.round(t%360)}function N6(e,t){var n=se(e,2),r=n[0],i=n[1],o=se(t,2),a=o[0],s=o[1],l=se([r*a+i*s,r*s-i*a],2),c=l[0],u=l[1];return Math.atan2(u,c)}function Rit(e){var t=(e+360)%180;return Co(t,-90,90)||(t+=180),t}function Nit(e,t,n){var r,i=n.labelAlign,o=(r=t.style.transform)===null||r===void 0?void 0:r.includes("rotate");if(o)return t.getLocalEulerAngles();var a=0,s=bb(e.value,n),l=XE(e.value,n);return i==="horizontal"?0:(i==="perpendicular"?a=N6([1,0],s):a=N6([l[0]<0?-1:1,0],l),Rit(Oie(a)))}function aoe(e,t,n){var r=n.type,i=n.labelAlign,o=bb(e,n),a=ooe(t),s=ooe(Oie(N6([1,0],o))),l="center",c="middle";return r==="linear"?[90,270].includes(s)&&a===0?(l="center",c=o[1]===1?"top":"bottom"):!(s%180)&&[90,270].includes(a)?l="center":s===0?(Co(a,0,90,!1,!0)||Co(a,0,90)||Co(a,270,360))&&(l="start"):s===90?Co(a,0,90,!1,!0)?l="start":(Co(a,90,180)||Co(a,270,360))&&(l="end"):s===270?Co(a,0,90,!1,!0)?l="end":(Co(a,90,180)||Co(a,270,360))&&(l="start"):s===180&&(a===90?l="start":(Co(a,0,90)||Co(a,270,360))&&(l="end")):i==="parallel"?Co(s,0,180,!0)?c="top":c="bottom":i==="horizontal"?Co(s,90,270,!1)?l="end":(Co(s,270,360,!1)||Co(s,0,90))&&(l="start"):i==="perpendicular"&&(Co(s,90,270)?l="end":l="start"),{textAlign:l,textBaseline:c}}function kit(e,t,n){t.setLocalEulerAngles(e);var r=t.__data__.value,i=aoe(r,e,n),o=t.querySelector(lr.labelItem.class);o&&loe(o,i)}function soe(e,t,n){var r=n.showTick,i=n.tickLength,o=n.tickDirection,a=n.labelDirection,s=n.labelSpacing,l=t.indexOf(e),c=Ns(s,[e,l,t]),u=se([bb(e.value,n),Iit(a,o)],2),f=u[0],d=u[1],h=d===1?Ns(r?i:0,[e,l,t]):0,p=se(gb(iu(f,c+h),ZE(e.value,n)),2),v=p[0],g=p[1];return{x:v,y:g}}function Ait(e,t,n,r){var i=r.labelFormatter,o=ea(i)?function(){return Ah(Ns(i,[e,t,n,bb(e.value,r)]))}:function(){return Ah(e.label||"")};return o}function loe(e,t){e.nodeName==="text"&&e.attr(t)}function coe(e){Tit(this.node().childNodes,e,{hide:Af,show:vb,rotate:function(t,n){kit(+n,t,e)},ellipsis:function(t,n,r){t&&b6(t,n||1/0,r)},wrap:function(t,n,r){t&&Hnt(t,n,r)},getTextShape:function(t){return t.querySelector("text")}})}function uoe(e,t,n,r,i){var o=n.indexOf(t),a=gn(e).append(Ait(t,o,n,i)).attr("className",lr.labelItem.name).node(),s=se(ou(Zie(r,[t,o,n])),2),l=s[0],c=s[1],u=c.transform,f=Ir(c,["transform"]);Lie(a,u);var d=Nit(t,a,i);return a.getLocalEulerAngles()||a.setLocalEulerAngles(d),loe(a,ke(ke({},aoe(t.value,d,i)),l)),e.attr(f),a}function Lit(e,t,n,r){var i=P6(t,n.labelFilter),o=Pn(n,"label");return e.selectAll(lr.label.class).data(i,function(a,s){return s}).join(function(a){return a.append("g").attr("className",lr.label.name).transition(function(s){uoe(this,s,t,o,n);var l=soe(s,t,n),c=l.x,u=l.y;return this.style.transform="translate(".concat(c,", ").concat(u,")"),null}).call(function(){coe.call(e,n)})},function(a){return a.transition(function(s){var l=this.querySelector(lr.labelItem.class),c=uoe(this,s,t,o,n),u=Urt(l,c,r.update),f=soe(s,t,n),d=f.x,h=f.y,p=Sl(this,{transform:"translate(".concat(d,", ").concat(h,")")},r.update);return it(it([],se(u),!1),[p],!1)}).call(function(s){var l=Hn(s,"_transitions").flat().filter(_ie);Wrt(l,function(){coe.call(e,n)})})},function(a){return a.transition(function(){var s=this,l=YE(this.childNodes[0],r.exit);return Ug(l,function(){return gn(s).remove()}),l})}).transitions()}function foe(e,t){return M6(e,t.tickDirection,t)}function jit(e,t){var n=se(e,2),r=n[0],i=n[1];return[[0,0],[r*t,i*t]]}function Dit(e,t,n,r,i){var o=i.tickLength,a=se(jit(r,Ns(o,[e,t,n])),2),s=se(a[0],2),l=s[0],c=s[1],u=se(a[1],2),f=u[0],d=u[1];return{x1:l,x2:f,y1:c,y2:d}}function Fit(e,t,n,r,i){var o=i.tickFormatter,a=foe(t.value,i),s="line";return ea(o)&&(s=function(){return Ns(o,[t,n,r,a])}),e.append(s).attr("className",lr.tickItem.name)}function Bit(e,t,n,r,i,o,a){var s=foe(e.value,o),l=Dit(e,t,n,s,o),c=l.x1,u=l.x2,f=l.y1,d=l.y2,h=se(ou(Zie(a,[e,t,n,s])),2),p=h[0],v=h[1];r.node().nodeName==="line"&&r.styles(ke({x1:c,x2:u,y1:f,y2:d},p)),i.attr(v),r.styles(p)}function doe(e,t,n,r,i,o){var a=Fit(gn(this),e,t,n,r);Bit(e,t,n,a,this,r,i);var s=se(ZE(e.value,r),2),l=s[0],c=s[1];return Sl(this,{transform:"translate(".concat(l,", ").concat(c,")")},o)}function zit(e,t,n,r){var i=P6(t,n.tickFilter),o=Pn(n,"tick");return e.selectAll(lr.tick.class).data(i,function(a){return a.id||a.label}).join(function(a){return a.append("g").attr("className",lr.tick.name).transition(function(s,l){return doe.call(this,s,l,i,n,o,!1)})},function(a){return a.transition(function(s,l){return this.removeChildren(),doe.call(this,s,l,i,n,o,r.update)})},function(a){return a.transition(function(){var s=this,l=YE(this.childNodes[0],r.exit);return Ug(l,function(){return s.remove()}),l})}).transitions()}var hoe=ks({text:"text"},"title");function JE(e){return/\S+-\S+/g.test(e)?e.split("-").map(function(t){return t[0]}):e.length>2?[e[0]]:e.split("")}function Hit(e,t){var n=e.attributes,r=n.position,i=n.spacing,o=n.inset,a=n.text,s=e.getBBox(),l=t.getBBox(),c=JE(r),u=se(Oo(a?i:0),4),f=u[0],d=u[1],h=u[2],p=u[3],v=se(Oo(o),4),g=v[0],m=v[1],y=v[2],x=v[3],S=se([p+d,f+h],2),w=S[0],C=S[1],O=se([x+m,g+y],2),E=O[0],_=O[1];if(c[0]==="l")return new Ur(s.x,s.y,l.width+s.width+w+E,Math.max(l.height+_,s.height));if(c[0]==="t")return new Ur(s.x,s.y,Math.max(l.width+E,s.width),l.height+s.height+C+_);var $=se([t.attributes.width||l.width,t.attributes.height||l.height],2),P=$[0],T=$[1];return new Ur(l.x,l.y,P+s.width+w+E,T+s.height+C+_)}function Wit(e,t){var n=Object.entries(t).reduce(function(r,i){var o=se(i,2),a=o[0],s=o[1],l=e.node().attr(a);return l||(r[a]=s),r},{});e.styles(n)}function Vit(e){var t,n,r,i,o=e,a=o.width,s=o.height,l=o.position,c=se([+a/2,+s/2],2),u=c[0],f=c[1],d=se([+u,+f,"center","middle"],4),h=d[0],p=d[1],v=d[2],g=d[3],m=JE(l);return m.includes("l")&&(t=se([0,"start"],2),h=t[0],v=t[1]),m.includes("r")&&(n=se([+a,"end"],2),h=n[0],v=n[1]),m.includes("t")&&(r=se([0,"top"],2),p=r[0],g=r[1]),m.includes("b")&&(i=se([+s,"bottom"],2),p=i[0],g=i[1]),{x:h,y:p,textAlign:v,textBaseline:g}}var poe=function(e){Nt(t,e);function t(n){return e.call(this,n,{text:"",width:0,height:0,fill:"#4a505a",fontWeight:"bold",fontSize:12,fontFamily:"sans-serif",inset:0,spacing:0,position:"top-left"})||this}return t.prototype.getAvailableSpace=function(){var n=this,r=this.attributes,i=r.width,o=r.height,a=r.position,s=r.spacing,l=r.inset,c=n.querySelector(hoe.text.class);if(!c)return new Ur(0,0,+i,+o);var u=c.getBBox(),f=u.width,d=u.height,h=se(Oo(s),4),p=h[0],v=h[1],g=h[2],m=h[3],y=se([0,0,+i,+o],4),x=y[0],S=y[1],w=y[2],C=y[3],O=JE(a);if(O.includes("i"))return new Ur(x,S,w,C);O.forEach(function(N,k){var A,j,D,L;N==="t"&&(A=se(k===0?[d+g,+o-d-g]:[0,+o],2),S=A[0],C=A[1]),N==="r"&&(j=se([+i-f-m],1),w=j[0]),N==="b"&&(D=se([+o-d-p],1),C=D[0]),N==="l"&&(L=se(k===0?[f+v,+i-f-v]:[0,+i],2),x=L[0],w=L[1])});var E=se(Oo(l),4),_=E[0],$=E[1],P=E[2],T=E[3],I=se([T+$,_+P],2),M=I[0],R=I[1];return new Ur(x+T,S+_,w-M,C-R)},t.prototype.getBBox=function(){return this.title?this.title.getBBox():new Ur(0,0,0,0)},t.prototype.render=function(n,r){var i=this;n.width,n.height,n.position,n.spacing;var o=Ir(n,["width","height","position","spacing"]),a=se(ou(o),1),s=a[0],l=Vit(n),c=l.x,u=l.y,f=l.textAlign,d=l.textBaseline;$a(!!o.text,gn(r),function(h){i.title=h.maybeAppendByClassName(hoe.text,"text").styles(s).call(Wit,{x:c,y:u,textAlign:f,textBaseline:d}).node()})},t}(co);function Uit(e,t,n){var r=n.titlePosition,i=r===void 0?"lb":r,o=n.titleSpacing,a=JE(i),s=e.node().getLocalBounds(),l=se(s.min,2),c=l[0],u=l[1],f=se(s.halfExtents,2),d=f[0],h=f[1],p=se(t.node().getLocalBounds().halfExtents,2),v=p[0],g=p[1],m=se([c+d,u+h],2),y=m[0],x=m[1],S=se(Oo(o),4),w=S[0],C=S[1],O=S[2],E=S[3];if(["start","end"].includes(i)&&n.type==="linear"){var _=n.startPos,$=n.endPos,P=se(i==="start"?[_,$]:[$,_],2),T=P[0],I=P[1],M=Iie([-I[0]+T[0],-I[1]+T[1]]),R=se(iu(M,w),2),N=R[0],k=R[1];return{x:T[0]+N,y:T[1]+k}}return a.includes("t")&&(x-=h+g+w),a.includes("r")&&(y+=d+v+C),a.includes("l")&&(y-=d+v+E),a.includes("b")&&(x+=h+g+O),{x:y,y:x}}function qit(e,t,n){var r=e.getGeometryBounds().halfExtents,i=r[1]*2;if(t==="vertical"){if(n==="left")return"rotate(-90) translate(0, ".concat(i/2,")");if(n==="right")return"rotate(-90) translate(0, -".concat(i/2,")")}return""}function voe(e,t,n,r,i){var o=Pn(r,"title"),a=se(ou(o),2),s=a[0],l=a[1],c=l.transform,u=l.transformOrigin,f=Ir(l,["transform","transformOrigin"]);t.styles(f);var d=c||qit(e.node(),s.direction,s.position);e.styles(ke(ke({},s),{transformOrigin:u})),Lie(e.node(),d);var h=Uit(gn(n._offscreen||n.querySelector(lr.mainGroup.class)),t,r),p=h.x,v=h.y,g=Sl(t.node(),{transform:"translate(".concat(p,", ").concat(v,")")},i);return g}function Git(e,t,n,r){var i=n.titleText;return e.selectAll(lr.title.class).data([{title:i}].filter(function(o){return!!o.title}),function(o,a){return o.title}).join(function(o){return o.append(function(){return Ah(i)}).attr("className",lr.title.name).transition(function(){return voe(gn(this),e,t,n,r.enter)})},function(o){return o.transition(function(){return voe(gn(this),e,t,n,r.update)})},function(o){return o.remove()}).transitions()}function goe(e,t,n,r){var i=e.showLine,o=e.showTick,a=e.showLabel,s=t.maybeAppendByClassName(lr.lineGroup,"g"),l=$a(i,s,function(h){return lit(h,e,r)})||[],c=t.maybeAppendByClassName(lr.tickGroup,"g"),u=$a(o,c,function(h){return zit(h,n,e,r)})||[],f=t.maybeAppendByClassName(lr.labelGroup,"g"),d=$a(a,f,function(h){return Lit(h,n,e,r)})||[];return it(it(it([],se(l),!1),se(u),!1),se(d),!1).filter(function(h){return!!h})}var k6=function(e){Nt(t,e);function t(n){return e.call(this,n,_6)||this}return t.prototype.render=function(n,r,i){var o=this,a=n.titleText,s=n.data,l=n.animate,c=n.showTitle,u=n.showGrid,f=n.dataThreshold,d=n.truncRange,h=nrt(s,f).filter(function(w){var C=w.value;return!(d&&C>d[0]&&C<d[1])}),p=Hie(i===void 0?l:i),v=gn(r).maybeAppendByClassName(lr.gridGroup,"g"),g=$a(u,v,function(w){return dit(w,h,n,p)})||[],m=gn(r).maybeAppendByClassName(lr.mainGroup,"g");a&&(!this.initialized&&p.enter||this.initialized&&p.update)&&goe(n,gn(this.offscreenGroup),h,Hie(!1));var y=goe(n,gn(m.node()),h,p),x=gn(r).maybeAppendByClassName(lr.titleGroup,"g"),S=$a(c,x,function(w){return Git(w,o,n,p)})||[];return it(it(it([],se(g),!1),se(y),!1),se(S),!1).flat().filter(function(w){return!!w})},t}(co),As=ks({prevBtnGroup:"prev-btn-group",prevBtn:"prev-btn",nextBtnGroup:"next-btn-group",nextBtn:"next-btn",pageInfoGroup:"page-info-group",pageInfo:"page-info",playWindow:"play-window",contentGroup:"content-group",controller:"controller",clipPath:"clip-path"},"navigator"),Kit=function(e){Nt(t,e);function t(n){var r=e.call(this,n,{x:0,y:0,animate:{easing:"linear",duration:200,fill:"both"},buttonCursor:"pointer",buttonFill:"black",buttonD:Rrt(0,0,6),buttonSize:12,controllerPadding:5,controllerSpacing:5,formatter:function(i,o){return"".concat(i,"/").concat(o)},defaultPage:0,loop:!1,orientation:"horizontal",pageNumFill:"black",pageNumFontSize:12,pageNumTextAlign:"start",pageNumTextBaseline:"middle"})||this;return r.playState="idle",r.contentGroup=r.appendChild(new lo({class:As.contentGroup.name})),r.playWindow=r.contentGroup.appendChild(new lo({class:As.playWindow.name})),r.innerCurrPage=r.defaultPage,r}return Object.defineProperty(t.prototype,"defaultPage",{get:function(){var n=this.attributes.defaultPage;return ai(n,0,Math.max(this.pageViews.length-1,0))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageViews",{get:function(){return this.playWindow.children},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"controllerShape",{get:function(){return this.totalPages>1?{width:55,height:0}:{width:0,height:0}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageShape",{get:function(){var n=this.pageViews,r=se(hrt(n.map(function(f){var d=f.getBBox(),h=d.width,p=d.height;return[h,p]})).map(function(f){return Math.max.apply(Math,it([],se(f),!1))}),2),i=r[0],o=r[1],a=this.attributes,s=a.pageWidth,l=s===void 0?i:s,c=a.pageHeight,u=c===void 0?o:c;return{pageWidth:l,pageHeight:u}},enumerable:!1,configurable:!0}),t.prototype.getContainer=function(){return this.playWindow},Object.defineProperty(t.prototype,"totalPages",{get:function(){return this.pageViews.length},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currPage",{get:function(){return this.innerCurrPage},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var n=e.prototype.getBBox.call(this),r=n.x,i=n.y,o=this.controllerShape,a=this.pageShape,s=a.pageWidth,l=a.pageHeight;return new Ur(r,i,s+o.width,l)},t.prototype.goTo=function(n){var r=this,i=this.attributes.animate,o=this,a=o.currPage,s=o.playState,l=o.playWindow,c=o.pageViews;if(s!=="idle"||n<0||c.length<=0||n>=c.length)return null;c[a].setLocalPosition(0,0),this.prepareFollowingPage(n);var u=se(this.getFollowingPageDiff(n),2),f=u[0],d=u[1];this.playState="running";var h=Vie(l,[{transform:"translate(0, 0)"},{transform:"translate(".concat(-f,", ").concat(-d,")")}],i);return Ug(h,function(){r.innerCurrPage=n,r.playState="idle",r.setVisiblePages([n]),r.updatePageInfo()}),h},t.prototype.prev=function(){var n=this.attributes.loop,r=this.pageViews.length,i=this.currPage;if(!n&&i<=0)return null;var o=n?(i-1+r)%r:ai(i-1,0,r);return this.goTo(o)},t.prototype.next=function(){var n=this.attributes.loop,r=this.pageViews.length,i=this.currPage;if(!n&&i>=r-1)return null;var o=n?(i+1)%r:ai(i+1,0,r);return this.goTo(o)},t.prototype.renderClipPath=function(n){var r=this.pageShape,i=r.pageWidth,o=r.pageHeight;if(!i||!o){this.contentGroup.style.clipPath=void 0;return}this.clipPath=n.maybeAppendByClassName(As.clipPath,"rect").styles({width:i,height:o}),this.contentGroup.attr("clipPath",this.clipPath.node())},t.prototype.setVisiblePages=function(n){this.playWindow.children.forEach(function(r,i){n.includes(i)?vb(r):Af(r)})},t.prototype.adjustControllerLayout=function(){var n=this,r=n.prevBtnGroup,i=n.nextBtnGroup,o=n.pageInfoGroup,a=this.attributes,s=a.orientation,l=a.controllerPadding,c=o.getBBox(),u=c.width;c.height;var f=se(s==="horizontal"?[-180,0]:[-90,90],2),d=f[0],h=f[1];r.setLocalEulerAngles(d),i.setLocalEulerAngles(h);var p=r.getBBox(),v=p.width,g=p.height,m=i.getBBox(),y=m.width,x=m.height,S=Math.max(v,u,y),w=s==="horizontal"?{offset:[[0,0],[v/2+l,0],[v+u+l*2,0]],textAlign:"start"}:{offset:[[S/2,-g-l],[S/2,0],[S/2,x+l]],textAlign:"center"},C=se(w.offset,3),O=se(C[0],2),E=O[0],_=O[1],$=se(C[1],2),P=$[0],T=$[1],I=se(C[2],2),M=I[0],R=I[1],N=w.textAlign,k=o.querySelector("text");k&&(k.style.textAlign=N),r.setLocalPosition(E,_),o.setLocalPosition(P,T),i.setLocalPosition(M,R)},t.prototype.updatePageInfo=function(){var n,r=this,i=r.currPage,o=r.pageViews,a=r.attributes.formatter;o.length<2||((n=this.pageInfoGroup.querySelector(As.pageInfo.class))===null||n===void 0||n.attr("text",a(i+1,o.length)),this.adjustControllerLayout())},t.prototype.getFollowingPageDiff=function(n){var r=this.currPage;if(r===n)return[0,0];var i=this.attributes.orientation,o=this.pageShape,a=o.pageWidth,s=o.pageHeight,l=n<r?-1:1;return i==="horizontal"?[l*a,0]:[0,l*s]},t.prototype.prepareFollowingPage=function(n){var r=this,i=r.currPage,o=r.pageViews;if(this.setVisiblePages([n,i]),n!==i){var a=se(this.getFollowingPageDiff(n),2),s=a[0],l=a[1];o[n].setLocalPosition(s,l)}},t.prototype.renderController=function(n){var r=this,i=this.attributes.controllerSpacing,o=this.pageShape,a=o.pageWidth,s=o.pageHeight,l=this.pageViews.length>=2,c=n.maybeAppendByClassName(As.controller,"g");if(VE(c.node(),l),!!l){var u=Pn(this.attributes,"button"),f=Pn(this.attributes,"pageNum"),d=se(ou(u),2),h=d[0],p=d[1],v=h.size,g=Ir(h,["size"]),m=!c.select(As.prevBtnGroup.class).node(),y=c.maybeAppendByClassName(As.prevBtnGroup,"g").styles(p);this.prevBtnGroup=y.node();var x=y.maybeAppendByClassName(As.prevBtn,"path"),S=c.maybeAppendByClassName(As.nextBtnGroup,"g").styles(p);this.nextBtnGroup=S.node();var w=S.maybeAppendByClassName(As.nextBtn,"path");[x,w].forEach(function(O){O.styles(ke(ke({},g),{transformOrigin:"center"})),C6(O.node(),v)});var C=c.maybeAppendByClassName(As.pageInfoGroup,"g");this.pageInfoGroup=C.node(),C.maybeAppendByClassName(As.pageInfo,"text").styles(f),this.updatePageInfo(),c.node().setLocalPosition(a+i,s/2),m&&(this.prevBtnGroup.addEventListener("click",function(){r.prev()}),this.nextBtnGroup.addEventListener("click",function(){r.next()}))}},t.prototype.render=function(n,r){var i=n.x,o=i===void 0?0:i,a=n.y,s=a===void 0?0:a;this.attr("transform","translate(".concat(o,", ").concat(s,")"));var l=gn(r);this.renderClipPath(l),this.renderController(l),this.setVisiblePages([this.defaultPage]),this.goTo(this.defaultPage)},t.prototype.bindEvents=function(){var n=this,r=XQ(function(){return n.render(n.attributes,n)},50);this.playWindow.addEventListener(Sn.INSERTED,r),this.playWindow.addEventListener(Sn.REMOVED,r)},t}(co);function Yit(e,t,n){var r=Math.round((e-n)/t);return n+r*t}function Xit(e,t,n){var r=1.4,i=r*n;return[["M",e-n,t-i],["L",e+n,t-i],["L",e+n,t+i],["L",e-n,t+i],["Z"]]}var moe=1.4,yoe=.4;function Zit(e,t,n){var r=n,i=r*moe,o=r/2,a=r/6,s=e+i*yoe;return[["M",e,t],["L",s,t+o],["L",e+i,t+o],["L",e+i,t-o],["L",s,t-o],["Z"],["M",s,t+a],["L",e+i-2,t+a],["M",s,t-a],["L",e+i-2,t-a]]}function Qit(e,t,n){var r=n,i=r*moe,o=r/2,a=r/6,s=t+i*yoe;return[["M",e,t],["L",e-o,s],["L",e-o,t+i],["L",e+o,t+i],["L",e+o,s],["Z"],["M",e-a,s],["L",e-a,t+i-2],["M",e+a,s],["L",e+a,t+i-2]]}Yn.registerSymbol("hiddenHandle",Xit),Yn.registerSymbol("verticalHandle",Zit),Yn.registerSymbol("horizontalHandle",Qit);function Jit(e,t,n,r){var i,o=se(e,2),a=o[0],s=o[1],l=se(t,2),c=l[0],u=l[1],f=se(n,2),d=f[0],h=f[1],p=se([c,u],2),v=p[0],g=p[1],m=g-v;return v>g&&(i=se([g,v],2),v=i[0],g=i[1]),m>s-a?[a,s]:v<a?d===a&&h===g?[a,g]:[a,m+a]:g>s?h===s&&d===v?[v,s]:[s-m,s]:[v,g]}function Jl(e,t,n){return e===void 0&&(e="horizontal"),e==="horizontal"?t:n}var ts=ks({layout:"flex",markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label",valueGroup:"value-group",value:"value",backgroundGroup:"background-group",background:"background"},"legend-category-item");function eot(e){var t=e.querySelector(ts.marker.class);return t?t.style:{}}var tot=function(e){Nt(t,e);function t(n){return e.call(this,n,{span:[1,1],marker:function(){return new kf({style:{r:6}})},markerSize:10,labelFill:"#646464",valueFill:"#646464",labelFontSize:12,valueFontSize:12,labelTextBaseline:"middle",valueTextBaseline:"middle"})||this}return Object.defineProperty(t.prototype,"showValue",{get:function(){var n=this.attributes.valueText;return n?typeof n=="string"||typeof n=="number"?n!=="":typeof n=="function"?!0:n.attr("text")!=="":!1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"actualSpace",{get:function(){var n=this.labelGroup,r=this.valueGroup,i=this.attributes.markerSize,o=n.node().getBBox(),a=o.width,s=o.height,l=r.node().getBBox(),c=l.width,u=l.height;return{markerWidth:i,labelWidth:a,valueWidth:c,height:Math.max(i,s,u)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"span",{get:function(){var n=this.attributes.span;if(!n)return[1,1];var r=se(Oo(n),2),i=r[0],o=r[1],a=this.showValue?o:0,s=i+a;return[i/s,a/s]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"shape",{get:function(){var n,r=this.attributes,i=r.markerSize,o=r.width,a=this.actualSpace,s=a.markerWidth,l=a.height,c=this.actualSpace,u=c.labelWidth,f=c.valueWidth,d=se(this.spacing,2),h=d[0],p=d[1];if(o){var v=o-i-h-p,g=se(this.span,2),m=g[0],y=g[1];n=se([m*v,y*v],2),u=n[0],f=n[1]}var x=s+u+f+h+p;return{width:x,height:l,markerWidth:s,labelWidth:u,valueWidth:f}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"spacing",{get:function(){var n=this.attributes.spacing;if(!n)return[0,0];var r=se(Oo(n),2),i=r[0],o=r[1];return this.showValue?[i,o]:[i,0]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"layout",{get:function(){var n=this.shape,r=n.markerWidth,i=n.labelWidth,o=n.valueWidth,a=n.width,s=n.height,l=se(this.spacing,2),c=l[0],u=l[1];return{height:s,width:a,markerWidth:r,labelWidth:i,valueWidth:o,position:[r/2,r+c,r+i+c+u]}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scaleSize",{get:function(){var n=eot(this.markerGroup.node()),r=this.attributes,i=r.markerSize,o=r.markerStrokeWidth,a=o===void 0?n.strokeWidth:o,s=r.markerLineWidth,l=s===void 0?n.lineWidth:s,c=r.markerStroke,u=c===void 0?n.stroke:c,f=+(a||l||(u?1:0))*Math.sqrt(2),d=this.markerGroup.node().getBBox(),h=d.width,p=d.height;return(1-f/Math.max(h,p))*i},enumerable:!1,configurable:!0}),t.prototype.renderMarker=function(n){var r=this,i=this.attributes.marker,o=Pn(this.attributes,"marker");this.markerGroup=n.maybeAppendByClassName(ts.markerGroup,"g").style("zIndex",0),$a(!!i,this.markerGroup,function(){var a,s=r.markerGroup.node(),l=(a=s.childNodes)===null||a===void 0?void 0:a[0],c=typeof i=="string"?new Yn({style:{symbol:i},className:ts.marker.name}):i();l?c.nodeName===l.nodeName?l instanceof Yn?l.update(ke(ke({},o),{symbol:i})):(lrt(l,c),gn(l).styles(o)):(l.remove(),gn(c).attr("className",ts.marker.name).styles(o),s.appendChild(c)):(c instanceof Yn||gn(c).attr("className",ts.marker.name).styles(o),s.appendChild(c)),r.markerGroup.node().scale(1/r.markerGroup.node().getScale()[0]);var u=C6(r.markerGroup.node(),r.scaleSize);r.markerGroup.node().style._transform="scale(".concat(u,")")})},t.prototype.renderLabel=function(n){var r=Pn(this.attributes,"label"),i=r.text,o=Ir(r,["text"]);this.labelGroup=n.maybeAppendByClassName(ts.labelGroup,"g").style("zIndex",0),this.labelGroup.maybeAppendByClassName(ts.label,function(){return Ah(i)}).styles(o)},t.prototype.renderValue=function(n){var r=this,i=Pn(this.attributes,"value"),o=i.text,a=Ir(i,["text"]);this.valueGroup=n.maybeAppendByClassName(ts.valueGroup,"g").style("zIndex",0),$a(this.showValue,this.valueGroup,function(){r.valueGroup.maybeAppendByClassName(ts.value,function(){return Ah(o)}).styles(a)})},t.prototype.renderBackground=function(n){var r=this.shape,i=r.width,o=r.height,a=Pn(this.attributes,"background");this.background=n.maybeAppendByClassName(ts.backgroundGroup,"g").style("zIndex",-1),this.background.maybeAppendByClassName(ts.background,"rect").styles(ke({width:i,height:o},a))},t.prototype.adjustLayout=function(){var n=this.layout,r=n.labelWidth,i=n.valueWidth,o=n.height,a=se(n.position,3),s=a[0],l=a[1],c=a[2],u=o/2;this.markerGroup.styles({transform:"translate(".concat(s,", ").concat(u,")").concat(this.markerGroup.node().style._transform)}),this.labelGroup.styles({transform:"translate(".concat(l,", ").concat(u,")")}),b6(this.labelGroup.select(ts.label.class).node(),Math.ceil(r)),this.showValue&&(this.valueGroup.styles({transform:"translate(".concat(c,", ").concat(u,")")}),b6(this.valueGroup.select(ts.value.class).node(),Math.ceil(i)))},t.prototype.render=function(n,r){var i=gn(r),o=n.x,a=o===void 0?0:o,s=n.y,l=s===void 0?0:s;i.styles({transform:"translate(".concat(a,", ").concat(l,")")}),this.renderMarker(i),this.renderLabel(i),this.renderValue(i),this.renderBackground(i),this.adjustLayout()},t}(co),Dh=ks({page:"item-page",navigator:"navigator",item:"item"},"items"),boe=function(e,t,n){return n===void 0&&(n=!0),e?t(e):n},not=function(e){Nt(t,e);function t(n){var r=e.call(this,n,{data:[],gridRow:1/0,gridCol:void 0,padding:0,width:1e3,height:100,rowPadding:0,colPadding:0,layout:"flex",orientation:"horizontal",click:cN,mouseenter:cN,mouseleave:cN})||this;return r.navigatorShape=[0,0],r}return Object.defineProperty(t.prototype,"pageViews",{get:function(){return this.navigator.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grid",{get:function(){var n=this.attributes,r=n.gridRow,i=n.gridCol,o=n.data;if(!r&&!i)throw new Error("gridRow and gridCol can not be set null at the same time");return r&&i?[r,i]:r?[r,o.length]:[o.length,i]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"renderData",{get:function(){var n=this.attributes,r=n.data,i=n.layout,o=Pn(this.attributes,"item"),a=r.map(function(s,l){var c=s.id,u=c===void 0?l:c,f=s.label,d=s.value;return{id:"".concat(u),index:l,style:ke({layout:i,labelText:f,valueText:d},Object.fromEntries(Object.entries(o).map(function(h){var p=se(h,2),v=p[0],g=p[1];return[v,Ns(g,[s,l,r])]})))}});return a},enumerable:!1,configurable:!0}),t.prototype.getGridLayout=function(){var n=this,r=this.attributes,i=r.orientation,o=r.width,a=r.rowPadding,s=r.colPadding,l=se(this.navigatorShape,1),c=l[0],u=se(this.grid,2),f=u[0],d=u[1],h=d*f,p=0;return this.pageViews.children.map(function(v,g){var m,y,x=Math.floor(g/h),S=g%h,w=n.ifHorizontal(d,f),C=[Math.floor(S/w),S%w];i==="vertical"&&C.reverse();var O=se(C,2),E=O[0],_=O[1],$=(o-c-(d-1)*s)/d,P=v.getBBox().height,T=se([0,0],2),I=T[0],M=T[1];return i==="horizontal"?(m=se([p,E*(P+a)],2),I=m[0],M=m[1],p=_===d-1?0:p+$+s):(y=se([_*($+s),p],2),I=y[0],M=y[1],p=E===f-1?0:p+P+a),{page:x,index:g,row:E,col:_,pageIndex:S,width:$,height:P,x:I,y:M}})},t.prototype.getFlexLayout=function(){var n=this.attributes,r=n.width,i=n.height,o=n.rowPadding,a=n.colPadding,s=se(this.navigatorShape,1),l=s[0],c=se(this.grid,2),u=c[0],f=c[1],d=se([r-l,i],2),h=d[0],p=d[1],v=se([0,0,0,0,0,0,0,0],8),g=v[0],m=v[1],y=v[2],x=v[3],S=v[4],w=v[5],C=v[6],O=v[7];return this.pageViews.children.map(function(E,_){var $,P,T,I,M=E.getBBox(),R=M.width,N=M.height,k=C===0?0:a,A=C+k+R;if(A<=h&&boe(S,function(D){return D<f}))return $=se([C+k,O,A],3),g=$[0],m=$[1],C=$[2],{width:R,height:N,x:g,y:m,page:y,index:_,pageIndex:x++,row:w,col:S++};P=se([w+1,0,0,O+N+o],4),w=P[0],S=P[1],C=P[2],O=P[3];var j=O+N;return j<=p&&boe(w,function(D){return D<u})?(T=se([C,O,R],3),g=T[0],m=T[1],C=T[2],{width:R,height:N,x:g,y:m,page:y,index:_,pageIndex:x++,row:w,col:S++}):(I=se([0,0,R,0,y+1,0,0,0],8),g=I[0],m=I[1],C=I[2],O=I[3],y=I[4],x=I[5],w=I[6],S=I[7],{width:R,height:N,x:g,y:m,page:y,index:_,pageIndex:x++,row:w,col:S++})})},Object.defineProperty(t.prototype,"itemsLayout",{get:function(){this.navigatorShape=[0,0];var n=this.attributes.layout==="grid"?this.getGridLayout:this.getFlexLayout,r=n.call(this);return r.slice(-1)[0].page>0?(this.navigatorShape=[55,0],n.call(this)):r},enumerable:!1,configurable:!0}),t.prototype.ifHorizontal=function(n,r){var i=this.attributes.orientation;return Jl(i,n,r)},t.prototype.flattenPage=function(n){n.querySelectorAll(Dh.item.class).forEach(function(r){n.appendChild(r)}),n.querySelectorAll(Dh.page.class).forEach(function(r){var i=n.removeChild(r);i.destroy()})},t.prototype.renderItems=function(n){var r=this.attributes,i=r.click,o=r.mouseenter,a=r.mouseleave;this.flattenPage(n);var s=this.dispatchCustomEvent.bind(this);gn(n).selectAll(Dh.item.class).data(this.renderData,function(l){return l.id}).join(function(l){return l.append(function(c){var u=c.style;return new tot({style:u})}).attr("className",Dh.item.name).on("click",function(){i==null||i(this),s("itemClick",{item:this})}).on("pointerenter",function(){o==null||o(this),s("itemMouseenter",{item:this})}).on("pointerleave",function(){a==null||a(this),s("itemMouseleave",{item:this})})},function(l){return l.each(function(c){var u=c.style;this.update(u)})},function(l){return l.remove()})},t.prototype.relayoutNavigator=function(){var n,r=this.attributes,i=r.layout,o=r.width,a=((n=this.pageViews.children[0])===null||n===void 0?void 0:n.getBBox().height)||0,s=se(this.navigatorShape,2),l=s[0],c=s[1];this.navigator.update(i==="grid"?{pageWidth:o-l,pageHeight:a-c}:{})},t.prototype.adjustLayout=function(){var n=this,r=Object.entries(Wnt(this.itemsLayout,"page")).map(function(o){var a=se(o,2),s=a[0],l=a[1];return{page:s,layouts:l}}),i=it([],se(this.navigator.getContainer().children),!1);r.forEach(function(o){var a=o.layouts,s=n.pageViews.appendChild(new lo({className:Dh.page.name}));a.forEach(function(l){var c=l.x,u=l.y,f=l.index,d=l.width,h=l.height,p=i[f];s.appendChild(p),MGe(p,"__layout__",l),p.update({x:c,y:u,width:d,height:h})})}),this.relayoutNavigator()},t.prototype.renderNavigator=function(n){var r=this.attributes.orientation,i=Pn(this.attributes,"nav"),o=ru({orientation:r},i),a=this;return n.selectAll(Dh.navigator.class).data(["nav"]).join(function(s){return s.append(function(){return new Kit({style:o})}).attr("className",Dh.navigator.name).each(function(){a.navigator=this})},function(s){return s.each(function(){this.update(o)})},function(s){return s.remove()}),this.navigator},t.prototype.getBBox=function(){return this.navigator.getBBox()},t.prototype.render=function(n,r){var i=this.attributes.data;if(!(!i||i.length===0)){var o=this.renderNavigator(gn(r));this.renderItems(o.getContainer()),this.adjustLayout()}},t.prototype.dispatchCustomEvent=function(n,r){var i=new mr(n,{detail:r});this.dispatchEvent(i)},t}(co),wb=ks({markerGroup:"marker-group",marker:"marker",labelGroup:"label-group",label:"label"},"handle"),xoe={showLabel:!0,formatter:function(e){return e.toString()},markerSize:25,markerStroke:"#c5c5c5",markerFill:"#fff",markerLineWidth:1,labelFontSize:12,labelFill:"#c5c5c5",labelText:"",orientation:"vertical",spacing:0},rot=function(e){Nt(t,e);function t(n){return e.call(this,n,xoe)||this}return t.prototype.render=function(n,r){var i=gn(r).maybeAppendByClassName(wb.markerGroup,"g");this.renderMarker(i);var o=gn(r).maybeAppendByClassName(wb.labelGroup,"g");this.renderLabel(o)},t.prototype.renderMarker=function(n){var r=this,i=this.attributes,o=i.orientation,a=i.markerSymbol,s=a===void 0?Jl(o,"horizontalHandle","verticalHandle"):a;$a(!!s,n,function(l){var c=Pn(r.attributes,"marker"),u=ke({symbol:s},c);r.marker=l.maybeAppendByClassName(wb.marker,function(){return new Yn({style:u})}).update(u)})},t.prototype.renderLabel=function(n){var r=this,i=this.attributes,o=i.showLabel,a=i.orientation,s=i.spacing,l=s===void 0?0:s,c=i.formatter;$a(o,n,function(u){var f,d=Pn(r.attributes,"label"),h=d.text,p=Ir(d,["text"]),v=((f=u.select(wb.marker.class))===null||f===void 0?void 0:f.node().getBBox())||{},g=v.width,m=g===void 0?0:g,y=v.height,x=y===void 0?0:y,S=se(Jl(a,[0,x+l,"center","top"],[m+l,0,"start","middle"]),4),w=S[0],C=S[1],O=S[2],E=S[3];u.maybeAppendByClassName(wb.label,"text").styles(ke(ke({},p),{x:w,y:C,text:c(h).toString(),textAlign:O,textBaseline:E}))})},t}(co),Soe={showTitle:!0,padding:0,orientation:"horizontal",backgroundFill:"transparent",titleText:"",titleSpacing:4,titlePosition:"top-left",titleFill:"#2C3542",titleFontWeight:"bold",titleFontFamily:"sans-serif",titleFontSize:12},iot=ru({},Soe,{}),oot=ru({},Soe,Zl(xoe,"handle"),{color:["#d0e3fa","#acc7f6","#8daaf2","#6d8eea","#4d73cd","#325bb1","#5a3e75","#8c3c79","#e23455","#e7655b"],indicatorBackgroundFill:"#262626",indicatorLabelFill:"white",indicatorLabelFontSize:12,indicatorVisibility:"hidden",labelAlign:"value",labelDirection:"positive",labelSpacing:5,showHandle:!0,showIndicator:!0,showLabel:!0,slidable:!0,titleText:"",type:"continuous"}),aot=.01,Eo=ks({title:"title",titleGroup:"title-group",items:"items",itemsGroup:"items-group",contentGroup:"content-group",ribbonGroup:"ribbon-group",ribbon:"ribbon",handlesGroup:"handles-group",handle:"handle",startHandle:"start-handle",endHandle:"end-handle",labelGroup:"label-group",label:"label",indicator:"indicator"},"legend"),sot=function(e){Nt(t,e);function t(n){return e.call(this,n,iot)||this}return t.prototype.renderTitle=function(n,r,i){var o=this.attributes,a=o.showTitle,s=o.titleText,l=Pn(this.attributes,"title"),c=se(ou(l),2),u=c[0],f=c[1];this.titleGroup=n.maybeAppendByClassName(Eo.titleGroup,"g").styles(f);var d=ke(ke({width:r,height:i},u),{text:a?s:""});this.title=this.titleGroup.maybeAppendByClassName(Eo.title,function(){return new poe({style:d})}).update(d)},t.prototype.renderItems=function(n,r){var i=r.x,o=r.y,a=r.width,s=r.height,l=Pn(this.attributes,"title",!0),c=se(ou(l),2),u=c[0],f=c[1],d=ke(ke({},u),{width:a,height:s,x:0,y:0});this.itemsGroup=n.maybeAppendByClassName(Eo.itemsGroup,"g").styles(ke(ke({},f),{transform:"translate(".concat(i,", ").concat(o,")")}));var h=this;this.itemsGroup.selectAll(Eo.items.class).data(["items"]).join(function(p){return p.append(function(){return new not({style:d})}).attr("className",Eo.items.name).each(function(){h.items=gn(this)})},function(p){return p.update(d)},function(p){return p.remove()})},t.prototype.adjustLayout=function(){var n=this.attributes.showTitle;if(n){var r=this.title.node().getAvailableSpace(),i=r.x,o=r.y;this.itemsGroup.node().style.transform="translate(".concat(i,", ").concat(o,")")}},Object.defineProperty(t.prototype,"availableSpace",{get:function(){var n=this.attributes,r=n.showTitle,i=n.width,o=n.height;return r?this.title.node().getAvailableSpace():new Ur(0,0,i,o)},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var n,r,i=(n=this.title)===null||n===void 0?void 0:n.node(),o=(r=this.items)===null||r===void 0?void 0:r.node();return!i||!o?e.prototype.getBBox.call(this):Hit(i,o)},t.prototype.render=function(n,r){var i=this.attributes,o=i.width,a=i.height,s=i.x,l=s===void 0?0:s,c=i.y,u=c===void 0?0:c,f=gn(r);r.style.transform="translate(".concat(l,", ").concat(u,")"),this.renderTitle(f,o,a),this.renderItems(f,this.availableSpace),this.adjustLayout()},t}(co),lot={backgroundFill:"#262626",backgroundLineCap:"round",backgroundLineWidth:1,backgroundStroke:"#333",backgroundZIndex:-1,formatter:function(e){return e.toString()},labelFill:"#fff",labelFontSize:12,labelTextBaseline:"middle",padding:[2,4],position:"right",radius:0,zIndex:999},A6=ks({background:"background",labelGroup:"label-group",label:"label"},"indicator"),cot=function(e){Nt(t,e);function t(n){var r=e.call(this,n,lot)||this;return r.point=[0,0],r.group=r.appendChild(new lo({})),r.isMutationObserved=!0,r}return t.prototype.renderBackground=function(){if(this.label){var n=this.attributes,r=n.position,i=n.padding,o=se(Oo(i),4),a=o[0],s=o[1],l=o[2],c=o[3],u=this.label.node().getLocalBounds(),f=u.min,d=u.max,h=new Ur(f[0]-c,f[1]-a,d[0]+s-f[0]+c,d[1]+l-f[1]+a),p=this.getPath(r,h),v=Pn(this.attributes,"background");this.background=gn(this.group).maybeAppendByClassName(A6.background,"path").styles(ke(ke({},v),{d:p})),this.group.appendChild(this.label.node())}},t.prototype.renderLabel=function(){var n=this.attributes,r=n.formatter,i=n.labelText,o=Pn(this.attributes,"label"),a=se(ou(o),2),s=a[0],l=a[1];s.text;var c=Ir(s,["text"]);if(this.label=gn(this.group).maybeAppendByClassName(A6.labelGroup,"g").styles(l),!!i){var u=this.label.maybeAppendByClassName(A6.label,function(){return Ah(r(i))}).style("text",r(i).toString());u.selectAll("text").styles(c)}},t.prototype.adjustLayout=function(){var n=se(this.point,2),r=n[0],i=n[1],o=this.attributes,a=o.x,s=o.y;this.group.attr("transform","translate(".concat(a-r,", ").concat(s-i,")"))},t.prototype.getPath=function(n,r){var i=this.attributes.radius,o=r.x,a=r.y,s=r.width,l=r.height,c=[["M",o+i,a],["L",o+s-i,a],["A",i,i,0,0,1,o+s,a+i],["L",o+s,a+l-i],["A",i,i,0,0,1,o+s-i,a+l],["L",o+i,a+l],["A",i,i,0,0,1,o,a+l-i],["L",o,a+i],["A",i,i,0,0,1,o+i,a],["Z"]],u={top:4,right:6,bottom:0,left:2},f=u[n],d=this.createCorner([c[f].slice(-2),c[f+1].slice(-2)]);return c.splice.apply(c,it([f+1,1],se(d),!1)),c[0][0]="M",c},t.prototype.createCorner=function(n,r){r===void 0&&(r=10);var i=.8,o=srt.apply(void 0,it([],se(n),!1)),a=se(n,2),s=se(a[0],2),l=s[0],c=s[1],u=se(a[1],2),f=u[0],d=u[1],h=se(o?[f-l,[l,f]]:[d-c,[c,d]],2),p=h[0],v=se(h[1],2),g=v[0],m=v[1],y=p/2,x=p/Math.abs(p),S=r*x,w=S/2,C=S*Math.sqrt(3)/2*i,O=se([g,g+y-w,g+y,g+y+w,m],5),E=O[0],_=O[1],$=O[2],P=O[3],T=O[4];return o?(this.point=[$,c-C],[["L",E,c],["L",_,c],["L",$,c-C],["L",P,c],["L",T,c]]):(this.point=[l+C,$],[["L",l,E],["L",l,_],["L",l+C,$],["L",l,P],["L",l,T]])},t.prototype.applyVisibility=function(){var n=this.attributes.visibility;n==="hidden"?Af(this):vb(this)},t.prototype.bindEvents=function(){this.label.on(Sn.BOUNDS_CHANGED,this.renderBackground)},t.prototype.render=function(){this.renderLabel(),this.renderBackground(),this.adjustLayout(),this.applyVisibility()},t}(co);function uot(e,t){for(var n=1;n<e.length;n+=1){var r=e[n-1],i=e[n];if(t>=r&&t<=i)return[r,i]}return[t,t]}function fot(e,t,n){var r=Array.from(t),i=e.length;return new Array(i).fill(0).reduce(function(o,a,s){var l=r[s%r.length];return o+=" ".concat(e[s],":").concat(l).concat(s<i-1?" ".concat(e[s+1],":").concat(l):"")},"l(".concat(n==="horizontal"?"0":"270",")"))}function woe(e,t){var n=se(uot(e,t),2),r=n[0],i=n[1];return{tick:t>(r+i)/2?i:r,range:[r,i]}}var Cb=ks({trackGroup:"background-group",track:"background",selectionGroup:"ribbon-group",selection:"ribbon",clipPath:"clip-path"},"ribbon");function Coe(e){var t=e.orientation,n=e.size,r=e.length;return Jl(t,[r,n],[n,r])}function Ooe(e){var t=e.type,n=se(Coe(e),2),r=n[0],i=n[1];return t==="size"?[["M",0,i],["L",0+r,0],["L",0+r,i],["Z"]]:[["M",0,i],["L",0,0],["L",0+r,0],["L",0+r,i],["Z"]]}function dot(e){return Ooe(e)}function hot(e){var t=e.orientation,n=e.color,r=e.block,i=e.partition,o;if(ea(n)){var a=20;o=new Array(a).fill(0).map(function(c,u,f){return n(u/(f.length-1))})}else o=n;var s=o.length,l=o.map(function(c){return tu(c).toString()});return s?s===1?l[0]:r?fot(i,l,t):l.reduce(function(c,u,f){return c+=" ".concat(f/(s-1),":").concat(u)},"l(".concat(Jl(t,"0","270"),")")):""}function pot(e){var t=e.orientation,n=e.range;if(!n)return[];var r=se(Coe(e),2),i=r[0],o=r[1],a=se(n,2),s=a[0],l=a[1],c=Jl(t,s*i,0),u=Jl(t,0,s*o),f=Jl(t,l*i,i),d=Jl(t,o,l*o);return[["M",c,u],["L",c,d],["L",f,d],["L",f,u],["Z"]]}function vot(e,t){var n=Pn(t,"track");e.maybeAppendByClassName(Cb.track,"path").styles(ke({d:Ooe(t)},n))}function got(e,t){var n=Pn(t,"selection"),r=hot(t),i=e.maybeAppendByClassName(Cb.selection,"path").styles(ke({d:dot(t),fill:r},n)),o=i.maybeAppendByClassName(Cb.clipPath,"path").styles({d:pot(t)}).node();i.style("clipPath",o)}var mot=function(e){Nt(t,e);function t(n){return e.call(this,n,{type:"color",orientation:"horizontal",size:30,range:[0,1],length:200,block:!1,partition:[],color:["#fff","#000"],trackFill:"#e5e5e5"})||this}return t.prototype.render=function(n,r){var i=gn(r).maybeAppendByClassName(Cb.trackGroup,"g");vot(i,n);var o=gn(r).maybeAppendByClassName(Cb.selectionGroup,"g");got(o,n)},t}(co);function yot(e){return{min:Math.min.apply(Math,it([],se(e.map(function(t){return t.value})),!1)),max:Math.max.apply(Math,it([],se(e.map(function(t){return t.value})),!1))}}var bot=function(e){Nt(t,e);function t(n){var r=e.call(this,n,oot)||this;return r.eventToOffsetScale=new $r({}),r.innerRibbonScale=new $r({}),r.cacheLabelBBox=null,r.cacheHandleBBox=null,r.onHovering=function(i){var o=r.attributes,a=o.data,s=o.block;i.stopPropagation();var l=r.getValueByCanvasPoint(i);if(s){var c=woe(a.map(function(d){var h=d.value;return h}),l).range,u=r.getRealSelection(c);r.showIndicator((c[0]+c[1])/2,"".concat(u[0],"-").concat(u[1])),r.dispatchIndicated(l,c)}else{var f=r.getTickValue(l);r.showIndicator(f,"".concat(r.getRealValue(f))),r.dispatchIndicated(f)}},r.onDragStart=function(i){return function(o){o.stopPropagation(),r.attributes.slidable&&(r.target=i,r.prevValue=r.getTickValue(r.getValueByCanvasPoint(o)),document.addEventListener("mousemove",r.onDragging),document.addEventListener("touchmove",r.onDragging),document.addEventListener("mouseleave",r.onDragEnd),document.addEventListener("mouseup",r.onDragEnd),document.addEventListener("mouseup",r.onDragEnd),document.addEventListener("touchend",r.onDragEnd))}},r.onDragging=function(i){var o=r.target;r.updateMouse();var a=se(r.selection,2),s=a[0],l=a[1],c=r.getTickValue(r.getValueByCanvasPoint(i)),u=c-r.prevValue;o==="start"?s!==c&&r.updateSelection(c,l):o==="end"?l!==c&&r.updateSelection(s,c):o==="ribbon"&&u!==0&&(r.prevValue=c,r.updateSelection(u,u,!0))},r.onDragEnd=function(){r.style.cursor="pointer",document.removeEventListener("mousemove",r.onDragging),document.removeEventListener("touchmove",r.onDragging),document.removeEventListener("mouseup",r.onDragEnd),document.removeEventListener("touchend",r.onDragEnd)},r}return Object.defineProperty(t.prototype,"handleOffsetRatio",{get:function(){return this.ifHorizontal(.5,.5)},enumerable:!1,configurable:!0}),t.prototype.getBBox=function(){var n=this.attributes,r=n.width,i=n.height;return new Ur(0,0,r,i)},t.prototype.render=function(n,r){var i=this,o=n.showLabel;this.renderTitle(gn(r));var a=this.availableSpace,s=a.x,l=a.y,c=gn(r).maybeAppendByClassName(Eo.contentGroup,"g").styles({transform:"translate(".concat(s,", ").concat(l,")")}),u=c.maybeAppendByClassName(Eo.labelGroup,"g").styles({zIndex:1});$a(!!o,u,function(d){i.renderLabel(d)});var f=c.maybeAppendByClassName(Eo.ribbonGroup,"g").styles({zIndex:0});this.handlesGroup=c.maybeAppendByClassName(Eo.handlesGroup,"g").styles({zIndex:2}),this.renderHandles(),this.renderRibbon(f),this.renderIndicator(c),this.adjustLabel(),this.adjustHandles()},Object.defineProperty(t.prototype,"range",{get:function(){var n=this.attributes,r=n.data,i=n.domain;return i?{min:i[0],max:i[1]}:yot(r)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ribbonScale",{get:function(){var n=this.range,r=n.min,i=n.max;return this.innerRibbonScale.update({domain:[r,i],range:[0,1]}),this.innerRibbonScale},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ribbonRange",{get:function(){var n=se(this.selection,2),r=n[0],i=n[1],o=this.ribbonScale;return[o.map(r),o.map(i)]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){var n=this.range,r=n.min,i=n.max,o=this.attributes.defaultValue,a=o===void 0?[r,i]:o,s=se(a,2),l=s[0],c=s[1];return[l,c]},enumerable:!1,configurable:!0}),t.prototype.ifHorizontal=function(n,r){return Jl(this.attributes.orientation,typeof n=="function"?n():n,typeof r=="function"?r():r)},t.prototype.renderTitle=function(n){var r=this.attributes,i=r.showTitle,o=r.titleText,a=r.width,s=r.height,l=Pn(this.attributes,"title"),c=ke(ke({},l),{width:a,height:s,text:o}),u=this;n.selectAll(Eo.title.class).data(i?[o]:[]).join(function(f){return f.append(function(){return new poe({style:c})}).attr("className",Eo.title.name).each(function(){u.title=this})},function(f){return f.update(c)},function(f){return f.each(function(){u.title=void 0}).remove()})},Object.defineProperty(t.prototype,"availableSpace",{get:function(){if(this.title)return this.title.getAvailableSpace();var n=this.attributes,r=n.width,i=n.height;return new Ur(0,0,r,i)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"labelFixedSpacing",{get:function(){var n=this.attributes.showTick;return n?5:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"labelPosition",{get:function(){var n=this.attributes,r=n.orientation,i=n.labelDirection,o={vertical:{positive:"right",negative:"left"},horizontal:{positive:"bottom",negative:"top"}};return o[r][i]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"labelBBox",{get:function(){var n,r=this.attributes.showLabel;if(!r)return new Ur(0,0,0,0);if(this.cacheLabelBBox)return this.cacheLabelBBox;var i=((n=this.label.querySelector(lr.labelGroup.class))===null||n===void 0?void 0:n.children.slice(-1)[0]).getBBox(),o=i.width,a=i.height;return this.cacheLabelBBox=new Ur(0,0,o,a),this.cacheLabelBBox},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"labelShape",{get:function(){var n=this.attributes,r=n.showLabel,i=n.labelSpacing,o=i===void 0?0:i;if(!r)return{width:0,height:0,size:0,length:0};var a=this.labelBBox,s=a.width,l=a.height,c=this.ifHorizontal(l,s)+o+this.labelFixedSpacing,u=this.ifHorizontal(s,l);return{width:s,height:l,size:c,length:u}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ribbonBBox",{get:function(){var n=this.attributes,r=n.showHandle,i=n.ribbonSize,o=this.availableSpace,a=o.width,s=o.height,l=this.labelShape,c=l.size,u=l.length,f=se(this.ifHorizontal([s,a],[a,s]),2),d=f[0],h=f[1],p=r?this.handleShape:{size:0,length:0},v=p.size,g=p.length,m=this.handleOffsetRatio,y=0,x=this.labelPosition;i?y=i:["bottom","right"].includes(x)?y=Math.min(d-c,(d-v)/m):d*(1-m)>v?y=Math.max(d-c,0):y=Math.max((d-c-v)/m,0);var S=Math.max(g,u),w=h-S,C=se(this.ifHorizontal([w,y],[y,w]),2),O=C[0],E=C[1],_=["top","left"].includes(x)?c:0,$=se(this.ifHorizontal([S/2,_],[_,S/2]),2),P=$[0],T=$[1];return new Ur(P,T,O,E)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"ribbonShape",{get:function(){var n=this.ribbonBBox,r=n.width,i=n.height;return this.ifHorizontal({size:i,length:r},{size:r,length:i})},enumerable:!1,configurable:!0}),t.prototype.renderRibbon=function(n){var r=this.attributes,i=r.data,o=r.type,a=r.orientation,s=r.color,l=r.block,c=Pn(this.attributes,"ribbon"),u=this.range,f=u.min,d=u.max,h=this.ribbonBBox,p=h.x,v=h.y,g=this.ribbonShape,m=g.length,y=g.size,x=ru({transform:"translate(".concat(p,", ").concat(v,")"),length:m,size:y,type:o,orientation:a,color:s,block:l,partition:i.map(function(S){return(S.value-f)/(d-f)}),range:this.ribbonRange},c);this.ribbon=n.maybeAppendByClassName(Eo.ribbon,function(){return new mot({style:x})}).update(x)},t.prototype.getHandleClassName=function(n){return"".concat(Eo.prefix("".concat(n,"-handle")))},t.prototype.renderHandles=function(){var n=this.attributes,r=n.showHandle,i=n.orientation,o=Pn(this.attributes,"handle"),a=se(this.selection,2),s=a[0],l=a[1],c=ke(ke({},o),{orientation:i}),u=o.shape,f=u===void 0?"slider":u,d=f==="basic"?rot:Kie,h=this;this.handlesGroup.selectAll(Eo.handle.class).data(r?[{value:s,type:"start"},{value:l,type:"end"}]:[],function(p){return p.type}).join(function(p){return p.append(function(){return new d({style:c})}).attr("className",function(v){var g=v.type;return"".concat(Eo.handle," ").concat(h.getHandleClassName(g))}).each(function(v){var g=v.type,m=v.value;this.update({labelText:m});var y="".concat(g,"Handle");h[y]=this,this.addEventListener("pointerdown",h.onDragStart(g))})},function(p){return p.update(c).each(function(v){var g=v.value;this.update({labelText:g})})},function(p){return p.each(function(v){var g=v.type,m="".concat(g,"Handle");h[m]=void 0}).remove()})},t.prototype.adjustHandles=function(){var n=se(this.selection,2),r=n[0],i=n[1];this.setHandlePosition("start",r),this.setHandlePosition("end",i)},Object.defineProperty(t.prototype,"handleBBox",{get:function(){if(this.cacheHandleBBox)return this.cacheHandleBBox;if(!this.attributes.showHandle)return new Ur(0,0,0,0);var n=this.startHandle.getBBox(),r=n.width,i=n.height,o=this.endHandle.getBBox(),a=o.width,s=o.height,l=se([Math.max(r,a),Math.max(i,s)],2),c=l[0],u=l[1];return this.cacheHandleBBox=new Ur(0,0,c,u),this.cacheHandleBBox},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"handleShape",{get:function(){var n=this.handleBBox,r=n.width,i=n.height,o=se(this.ifHorizontal([i,r],[r,i]),2),a=o[0],s=o[1];return{width:r,height:i,size:a,length:s}},enumerable:!1,configurable:!0}),t.prototype.setHandlePosition=function(n,r){var i=this.attributes.handleFormatter,o=this.ribbonBBox,a=o.x,s=o.y,l=this.ribbonShape.size,c=this.getOffset(r),u=se(this.ifHorizontal([a+c,s+l*this.handleOffsetRatio],[a+l*this.handleOffsetRatio,s+c]),2),f=u[0],d=u[1],h=this.handlesGroup.select(".".concat(this.getHandleClassName(n))).node();h==null||h.update({transform:"translate(".concat(f,", ").concat(d,")"),formatter:i})},t.prototype.renderIndicator=function(n){var r=Pn(this.attributes,"indicator");this.indicator=n.maybeAppendByClassName(Eo.indicator,function(){return new cot({})}).update(r)},Object.defineProperty(t.prototype,"labelData",{get:function(){var n=this,r=this.attributes.data;return r.reduce(function(i,o,a,s){var l,c,u=(l=o==null?void 0:o.id)!==null&&l!==void 0?l:a.toString();if(i.push(ke(ke({},o),{id:u,index:a,type:"value",label:(c=o==null?void 0:o.label)!==null&&c!==void 0?c:o.value.toString(),value:n.ribbonScale.map(o.value)})),a<s.length-1){var f=s[a+1],d=se([o.value,f.value],2),h=d[0],p=d[1],v=(h+p)/2;i.push(ke(ke({},o),{id:u,index:a,type:"range",range:[h,p],label:[h,p].join("~"),value:n.ribbonScale.map(v)}))}return i},[])},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"labelStyle",{get:function(){var n=se(["center","middle"],2),r=n[0],i=n[1],o=this.labelPosition;return o==="top"?i="bottom":o==="bottom"?i="top":o==="left"?r="end":o==="right"&&(r="start"),{labelTextAlign:r,labelTextBaseline:i}},enumerable:!1,configurable:!0}),t.prototype.renderLabel=function(n){var r=this.attributes,i=r.showTick,o=i===void 0?!1:i,a=r.labelFilter,s=r.labelFormatter,l=Pn(this.attributes,"tick"),c=Pn(this.attributes,"label"),u=c.align,f=ru(ke({showLine:!1,showGrid:!1,showTick:o,type:"linear",startPos:[0,0],endPos:[0,0],tickDirection:"negative",labelTransform:"rotate(0)"},this.labelStyle),Zl(l,"tick"),Zl(c,"label"),{data:this.labelData}),d={tickFilter:function(p,v,g){return(p==null?void 0:p.type)!=="value"?!1:a?a(p,p.index,g.filter(function(m){return m.type!=="value"})):!0},labelFilter:function(p,v,g){return(p==null?void 0:p.type)!==u?!1:a?a(p,p.index,g.filter(function(m){return m.type===u})):!0},labelFormatter:s},h=ke(ke(ke({},f),d),{labelOverlap:[{type:"hide"}]});this.label=n.maybeAppendByClassName(Eo.label,function(){return new k6({style:h})}).node(),this.label.update(h,!1)},Object.defineProperty(t.prototype,"labelAxisStyle",{get:function(){var n=this.attributes,r=n.showTick,i=n.labelDirection,o=n.labelSpacing,a=n.tickLength,s=this.ribbonShape.size,l=this.labelPosition,c=this.labelFixedSpacing,u=se([0,0,0],3),f=u[0],d=u[1],h=u[2],p=a!=null?a:s;return r?(h=p,d=c,i==="positive"?l==="right"?(f=p,h=p):l==="bottom"&&(f=h):i==="negative"&&(l==="top"||l==="left")&&(f=s)):i==="positive"?l==="right"?d=p:l==="bottom"&&(f=s+c,d=o):i==="negative"&&(l==="left"||l==="top")&&(d=o),{offset:f,spacing:d,tickLength:h}},enumerable:!1,configurable:!0}),t.prototype.adjustLabel=function(){var n=this.attributes.showLabel;if(n){var r=this.ribbonBBox,i=r.x,o=r.y,a=r.width,s=r.height,l=this.labelAxisStyle,c=l.offset,u=l.spacing,f=l.tickLength,d=se(this.ifHorizontal([[i,o+c],[i+a,o+c]],[[i+c,o+s],[i+c,o]]),2),h=d[0],p=d[1];this.label.update({startPos:h,endPos:p,tickLength:f,labelSpacing:u},!1)}},t.prototype.bindEvents=function(){this.style.cursor="pointer",this.ribbon.on("pointerdown",this.onDragStart("ribbon")),this.ribbon.on("pointermove",this.onHovering),this.addEventListener("pointerout",this.hideIndicator)},t.prototype.showIndicator=function(n,r){r===void 0&&(r="".concat(n));var i=this.attributes.showIndicator;if(!i||typeof n!="number"){this.hideIndicator();return}var o=this.range,a=o.min,s=o.max,l=this.ribbonBBox,c=l.x,u=l.y,f=ai(n,a,s),d=this.getOffset(f),h=this.ifHorizontal([d+c,u],[c,d+u]);this.indicator.update({x:h[0],y:h[1],position:this.ifHorizontal("top","left"),labelText:r}),vb(this.indicator.node())},t.prototype.hideIndicator=function(){Af(this.indicator.node())},t.prototype.updateMouse=function(){this.attributes.slidable&&(this.style.cursor="grabbing")},t.prototype.setSelection=function(n,r){this.updateSelection(n,r)},t.prototype.updateSelection=function(n,r,i){var o;i===void 0&&(i=!1);var a=se(this.selection,2),s=a[0],l=a[1],c=se([n,r],2),u=c[0],f=c[1];i&&(u+=s,f+=l);var d=this.range,h=d.min,p=d.max;o=se(Jit([h,p],[u,f],this.selection),2),u=o[0],f=o[1],this.update({defaultValue:[u,f]}),this.dispatchSelection()},Object.defineProperty(t.prototype,"step",{get:function(){var n=this.attributes.step,r=n===void 0?1:n,i=this.range,o=i.min,a=i.max;return xr(r)?w6((a-o)*aot,0):r},enumerable:!1,configurable:!0}),t.prototype.getTickValue=function(n){var r=this.attributes,i=r.data,o=r.block,a=this.range.min;return o?woe(i.map(function(s){var l=s.value;return l}),n).tick:Yit(n,this.step,a)},t.prototype.getValueByCanvasPoint=function(n){var r=this.range,i=r.min,o=r.max,a=se(this.ribbon.node().getPosition(),2),s=a[0],l=a[1],c=this.ifHorizontal(s,l),u=this.ifHorizontal.apply(this,it([],se(qE(n)),!1)),f=u-c,d=ai(this.getOffset(f,!0),i,o);return d},t.prototype.getOffset=function(n,r){r===void 0&&(r=!1);var i=this.range,o=i.min,a=i.max,s=this.ribbonShape.length,l=this.eventToOffsetScale;return l.update({domain:[o,a],range:[0,s]}),r?l.invert(n):l.map(n)},t.prototype.getRealSelection=function(n){var r=this.range.max,i=se(n,2),o=i[0],a=i[1];return this.ifHorizontal([o,a],[r-a,r-o])},t.prototype.getRealValue=function(n){var r=this.range.max;return this.ifHorizontal(n,r-n)},t.prototype.dispatchSelection=function(){var n=this.getRealSelection(this.selection),r=new mr("valuechange",{detail:{value:n}});this.dispatchEvent(r)},t.prototype.dispatchIndicated=function(n,r){var i=this,o=this.range.max,a=this.ifHorizontal(function(){return{value:n,range:r}},function(){return{value:o-n,range:r?i.getRealSelection(r):void 0}}),s=new mr("indicate",{detail:a});this.dispatchEvent(s)},t}(co);function L6(e){return e===void 0&&(e=""),{CONTAINER:"".concat(e,"tooltip"),TITLE:"".concat(e,"tooltip-title"),LIST:"".concat(e,"tooltip-list"),LIST_ITEM:"".concat(e,"tooltip-list-item"),NAME:"".concat(e,"tooltip-list-item-name"),MARKER:"".concat(e,"tooltip-list-item-marker"),NAME_LABEL:"".concat(e,"tooltip-list-item-name-label"),VALUE:"".concat(e,"tooltip-list-item-value"),CROSSHAIR_X:"".concat(e,"tooltip-crosshair-x"),CROSSHAIR_Y:"".concat(e,"tooltip-crosshair-y")}}var Eoe={overflow:"hidden","white-space":"nowrap","text-overflow":"ellipsis"};function xot(e){var t;e===void 0&&(e="");var n=L6(e);return t={},t[".".concat(n.CONTAINER)]={position:"absolute",visibility:"visible","z-index":8,transition:"visibility 0.2s cubic-bezier(0.23, 1, 0.32, 1), left 0.4s cubic-bezier(0.23, 1, 0.32, 1), top 0.4s cubic-bezier(0.23, 1, 0.32, 1)","background-color":"rgba(255, 255, 255, 0.96)","box-shadow":"0 6px 12px 0 rgba(0, 0, 0, 0.12)","border-radius":"4px",color:"rgba(0, 0, 0, 0.65)","font-size":"12px","line-height":"20px",padding:"12px","min-width":"120px","max-width":"360px","font-family":"Roboto-Regular"},t[".".concat(n.TITLE)]={color:"rgba(0, 0, 0, 0.45)"},t[".".concat(n.LIST)]={margin:"0px","list-style-type":"none",padding:"0px"},t[".".concat(n.LIST_ITEM)]={"list-style-type":"none",display:"flex","line-height":"2em","align-items":"center","justify-content":"space-between","white-space":"nowrap"},t[".".concat(n.MARKER)]={width:"8px",height:"8px","border-radius":"50%",display:"inline-block","margin-right":"4px"},t[".".concat(n.NAME)]={display:"flex","align-items":"center","max-width":"216px"},t[".".concat(n.NAME_LABEL)]=ke({flex:1},Eoe),t[".".concat(n.VALUE)]=ke({display:"inline-block",float:"right",flex:1,"text-align":"right","min-width":"28px","margin-left":"30px",color:"rgba(0, 0, 0, 0.85)"},Eoe),t[".".concat(n.CROSSHAIR_X)]={position:"absolute",width:"1px","background-color":"rgba(0, 0, 0, 0.25)"},t[".".concat(n.CROSSHAIR_Y)]={position:"absolute",height:"1px","background-color":"rgba(0, 0, 0, 0.25)"},t}var Sot=function(e){Nt(t,e);function t(n){var r=this,i,o,a=(o=(i=n.style)===null||i===void 0?void 0:i.template)===null||o===void 0?void 0:o.prefixCls,s=L6(a);return r=e.call(this,n,{data:[],x:0,y:0,visibility:"visible",title:"",position:"bottom-right",offset:[5,5],enterable:!1,container:{x:0,y:0},bounding:null,template:{prefixCls:"",container:'<div class="'.concat(s.CONTAINER,'"></div>'),title:'<div class="'.concat(s.TITLE,'"></div>'),item:'<li class="'.concat(s.LIST_ITEM,`" data-index={index}>
|
652
652
|
<span class="`).concat(s.NAME,`">
|
653
653
|
<span class="`).concat(s.MARKER,`" style="background:{color}"></span>
|
@@ -752,4 +752,4 @@ A`,a,a,0,s?1:0,1,o.p1.x,o.p1.y)}return r.join(" ")}}const Phe=e=>{const{sets:t="
|
|
752
752
|
transform: translate(24px, 0);
|
753
753
|
}
|
754
754
|
}
|
755
|
-
`,n.classList.add("loading"),n.innerHTML="<div></div><div></div><div></div><div></div>",t.appendChild(r),t.appendChild(n)},q1t=function(e){var t=e.loadingTemplate,n=e.theme,r=n===void 0?"light":n,i=ge.useRef(null);ge.useEffect(function(){!t&&i.current&&U1t(i.current)},[]);var o=function(){return t||ge.createElement("div",{ref:i})};return ge.createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:r==="dark"?"rgb(20, 20, 20)":"rgb(255, 255, 255)"}},o())},G1t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K1t=function(e){G1t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={hasError:!1},n.renderError=function(r){var i=n.props.errorTemplate;switch(r){default:return typeof i=="function"?i(r):i||ge.createElement("h5",null,"组件出错了,请核查后重试: ",r.message)}},n}return t.getDerivedStateFromError=function(n){return{hasError:!0,error:n}},t.getDerivedStateFromProps=function(n,r){return r.children!==n.children?{children:n.children,hasError:!1,error:void 0}:null},t.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):ge.createElement(b.Fragment,null,this.props.children)},t}(ge.Component),qhe=typeof global=="object"&&global&&global.Object===Object&&global,Y1t=typeof self=="object"&&self&&self.Object===Object&&self,Ol=qhe||Y1t||Function("return this")(),Hs=Ol.Symbol,Ghe=Object.prototype,X1t=Ghe.hasOwnProperty,Z1t=Ghe.toString,ux=Hs?Hs.toStringTag:void 0;function Q1t(e){var t=X1t.call(e,ux),n=e[ux];try{e[ux]=void 0;var r=!0}catch(o){}var i=Z1t.call(e);return r&&(t?e[ux]=n:delete e[ux]),i}var J1t=Object.prototype,ebt=J1t.toString;function tbt(e){return ebt.call(e)}var nbt="[object Null]",rbt="[object Undefined]",Khe=Hs?Hs.toStringTag:void 0;function cc(e){return e==null?e===void 0?rbt:nbt:Khe&&Khe in Object(e)?Q1t(e):tbt(e)}function Ta(e){return e!=null&&typeof e=="object"}var ibt="[object Symbol]";function fx(e){return typeof e=="symbol"||Ta(e)&&cc(e)==ibt}var obt=NaN;function Yhe(e){return typeof e=="number"?e:fx(e)?obt:+e}function b$(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var ir=Array.isArray,abt=1/0,Xhe=Hs?Hs.prototype:void 0,Zhe=Xhe?Xhe.toString:void 0;function x$(e){if(typeof e=="string")return e;if(ir(e))return b$(e,x$)+"";if(fx(e))return Zhe?Zhe.call(e):"";var t=e+"";return t=="0"&&1/e==-abt?"-0":t}function sbt(e,t){return function(n,r){var i;if(n===void 0&&r===void 0)return t;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=x$(n),r=x$(r)):(n=Yhe(n),r=Yhe(r)),i=e(n,r)}return i}}var lbt=/\s/;function cbt(e){for(var t=e.length;t--&&lbt.test(e.charAt(t)););return t}var ubt=/^\s+/;function fbt(e){return e&&e.slice(0,cbt(e)+1).replace(ubt,"")}function sa(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Qhe=NaN,dbt=/^[-+]0x[0-9a-f]+$/i,hbt=/^0b[01]+$/i,pbt=/^0o[0-7]+$/i,vbt=parseInt;function Jhe(e){if(typeof e=="number")return e;if(fx(e))return Qhe;if(sa(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=sa(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=fbt(e);var n=hbt.test(e);return n||pbt.test(e)?vbt(e.slice(2),n?2:8):dbt.test(e)?Qhe:+e}var epe=1/0,gbt=17976931348623157e292;function mbt(e){if(!e)return e===0?e:0;if(e=Jhe(e),e===epe||e===-epe){var t=e<0?-1:1;return t*gbt}return e===e?e:0}function tpe(e){var t=mbt(e),n=t%1;return t===t?n?t-n:t:0}function pL(e){return e}var ybt="[object AsyncFunction]",bbt="[object Function]",xbt="[object GeneratorFunction]",Sbt="[object Proxy]";function ym(e){if(!sa(e))return!1;var t=cc(e);return t==bbt||t==xbt||t==ybt||t==Sbt}var vL=Ol["__core-js_shared__"],npe=function(){var e=/[^.]+$/.exec(vL&&vL.keys&&vL.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function wbt(e){return!!npe&&npe in e}var Cbt=Function.prototype,Obt=Cbt.toString;function Kh(e){if(e!=null){try{return Obt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var Ebt=/[\\^$.*+?()[\]{}|]/g,_bt=/^\[object .+?Constructor\]$/,$bt=Function.prototype,Pbt=Object.prototype,Mbt=$bt.toString,Tbt=Pbt.hasOwnProperty,Ibt=RegExp("^"+Mbt.call(Tbt).replace(Ebt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Rbt(e){if(!sa(e)||wbt(e))return!1;var t=ym(e)?Ibt:_bt;return t.test(Kh(e))}function Nbt(e,t){return e==null?void 0:e[t]}function Yh(e,t){var n=Nbt(e,t);return Rbt(n)?n:void 0}var dx=Yh(Ol,"WeakMap"),rpe=dx&&new dx,ipe=Object.create,gL=function(){function e(){}return function(t){if(!sa(t))return{};if(ipe)return ipe(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function kbt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function mL(){}var Abt=4294967295;function bm(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Abt,this.__views__=[]}bm.prototype=gL(mL.prototype),bm.prototype.constructor=bm;function ope(){}var ape=rpe?function(e){return rpe.get(e)}:ope,spe={},Lbt=Object.prototype,jbt=Lbt.hasOwnProperty;function S$(e){for(var t=e.name+"",n=spe[t],r=jbt.call(spe,t)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==e)return i.name}return t}function Yf(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Yf.prototype=gL(mL.prototype),Yf.prototype.constructor=Yf;function yL(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function Dbt(e){if(e instanceof bm)return e.clone();var t=new Yf(e.__wrapped__,e.__chain__);return t.__actions__=yL(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Fbt=Object.prototype,Bbt=Fbt.hasOwnProperty;function w$(e){if(Ta(e)&&!ir(e)&&!(e instanceof bm)){if(e instanceof Yf)return e;if(Bbt.call(e,"__wrapped__"))return Dbt(e)}return new Yf(e)}w$.prototype=mL.prototype,w$.prototype.constructor=w$;function lpe(e){var t=S$(e),n=w$[t];if(typeof n!="function"||!(t in bm.prototype))return!1;if(e===n)return!0;var r=ape(n);return!!r&&e===r[0]}var zbt=800,Hbt=16,Wbt=Date.now;function Vbt(e){var t=0,n=0;return function(){var r=Wbt(),i=Hbt-(r-n);if(n=r,i>0){if(++t>=zbt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ubt(e){return function(){return e}}var C$=function(){try{var e=Yh(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),qbt=C$?function(e,t){return C$(e,"toString",{configurable:!0,enumerable:!1,value:Ubt(t),writable:!0})}:pL,cpe=Vbt(qbt);function Gbt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function Kbt(e,t,n,r){for(var i=e.length,o=n+-1;++o<i;)if(t(e[o],o,e))return o;return-1}function Ybt(e){return e!==e}function Xbt(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function upe(e,t,n){return t===t?Xbt(e,t,n):Kbt(e,Ybt,n)}function Zbt(e,t){var n=e==null?0:e.length;return!!n&&upe(e,t,0)>-1}var Qbt=9007199254740991,Jbt=/^(?:0|[1-9]\d*)$/;function O$(e,t){var n=typeof e;return t=t==null?Qbt:t,!!t&&(n=="number"||n!="symbol"&&Jbt.test(e))&&e>-1&&e%1==0&&e<t}function E$(e,t,n){t=="__proto__"&&C$?C$(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function hx(e,t){return e===t||e!==e&&t!==t}var ext=Object.prototype,txt=ext.hasOwnProperty;function _$(e,t,n){var r=e[t];(!(txt.call(e,t)&&hx(r,n))||n===void 0&&!(t in e))&&E$(e,t,n)}function Xh(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=void 0;l===void 0&&(l=e[s]),i?E$(n,s,l):_$(n,s,l)}return n}var fpe=Math.max;function dpe(e,t,n){return t=fpe(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=fpe(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),kbt(e,this,s)}}function nxt(e,t){return cpe(dpe(e,t,pL),e+"")}var rxt=9007199254740991;function bL(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=rxt}function Xf(e){return e!=null&&bL(e.length)&&!ym(e)}function ixt(e,t,n){if(!sa(n))return!1;var r=typeof t;return(r=="number"?Xf(n)&&O$(t,n.length):r=="string"&&t in n)?hx(n[t],e):!1}function hpe(e){return nxt(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&ixt(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}var oxt=Object.prototype;function $$(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||oxt;return e===n}function axt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var sxt="[object Arguments]";function ppe(e){return Ta(e)&&cc(e)==sxt}var vpe=Object.prototype,lxt=vpe.hasOwnProperty,cxt=vpe.propertyIsEnumerable,px=ppe(function(){return arguments}())?ppe:function(e){return Ta(e)&&lxt.call(e,"callee")&&!cxt.call(e,"callee")};function uxt(){return!1}var gpe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mpe=gpe&&typeof module=="object"&&module&&!module.nodeType&&module,fxt=mpe&&mpe.exports===gpe,ype=fxt?Ol.Buffer:void 0,dxt=ype?ype.isBuffer:void 0,vx=dxt||uxt,hxt="[object Arguments]",pxt="[object Array]",vxt="[object Boolean]",gxt="[object Date]",mxt="[object Error]",yxt="[object Function]",bxt="[object Map]",xxt="[object Number]",Sxt="[object Object]",wxt="[object RegExp]",Cxt="[object Set]",Oxt="[object String]",Ext="[object WeakMap]",_xt="[object ArrayBuffer]",$xt="[object DataView]",Pxt="[object Float32Array]",Mxt="[object Float64Array]",Txt="[object Int8Array]",Ixt="[object Int16Array]",Rxt="[object Int32Array]",Nxt="[object Uint8Array]",kxt="[object Uint8ClampedArray]",Axt="[object Uint16Array]",Lxt="[object Uint32Array]",qr={};qr[Pxt]=qr[Mxt]=qr[Txt]=qr[Ixt]=qr[Rxt]=qr[Nxt]=qr[kxt]=qr[Axt]=qr[Lxt]=!0,qr[hxt]=qr[pxt]=qr[_xt]=qr[vxt]=qr[$xt]=qr[gxt]=qr[mxt]=qr[yxt]=qr[bxt]=qr[xxt]=qr[Sxt]=qr[wxt]=qr[Cxt]=qr[Oxt]=qr[Ext]=!1;function jxt(e){return Ta(e)&&bL(e.length)&&!!qr[cc(e)]}function xL(e){return function(t){return e(t)}}var bpe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,gx=bpe&&typeof module=="object"&&module&&!module.nodeType&&module,Dxt=gx&&gx.exports===bpe,SL=Dxt&&qhe.process,xm=function(){try{var e=gx&&gx.require&&gx.require("util").types;return e||SL&&SL.binding&&SL.binding("util")}catch(t){}}(),xpe=xm&&xm.isTypedArray,wL=xpe?xL(xpe):jxt,Fxt=Object.prototype,Bxt=Fxt.hasOwnProperty;function Spe(e,t){var n=ir(e),r=!n&&px(e),i=!n&&!r&&vx(e),o=!n&&!r&&!i&&wL(e),a=n||r||i||o,s=a?axt(e.length,String):[],l=s.length;for(var c in e)(t||Bxt.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||O$(c,l)))&&s.push(c);return s}function wpe(e,t){return function(n){return e(t(n))}}var zxt=wpe(Object.keys,Object),Hxt=Object.prototype,Wxt=Hxt.hasOwnProperty;function Vxt(e){if(!$$(e))return zxt(e);var t=[];for(var n in Object(e))Wxt.call(e,n)&&n!="constructor"&&t.push(n);return t}function Zh(e){return Xf(e)?Spe(e):Vxt(e)}var Uxt=Object.prototype,qxt=Uxt.hasOwnProperty,Cpe=hpe(function(e,t){if($$(t)||Xf(t)){Xh(t,Zh(t),e);return}for(var n in t)qxt.call(t,n)&&_$(e,n,t[n])});function Gxt(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Kxt=Object.prototype,Yxt=Kxt.hasOwnProperty;function Xxt(e){if(!sa(e))return Gxt(e);var t=$$(e),n=[];for(var r in e)r=="constructor"&&(t||!Yxt.call(e,r))||n.push(r);return n}function mx(e){return Xf(e)?Spe(e,!0):Xxt(e)}var Zxt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qxt=/^\w*$/;function CL(e,t){if(ir(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||fx(e)?!0:Qxt.test(e)||!Zxt.test(e)||t!=null&&e in Object(t)}var yx=Yh(Object,"create");function Jxt(){this.__data__=yx?yx(null):{},this.size=0}function e2t(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var t2t="__lodash_hash_undefined__",n2t=Object.prototype,r2t=n2t.hasOwnProperty;function i2t(e){var t=this.__data__;if(yx){var n=t[e];return n===t2t?void 0:n}return r2t.call(t,e)?t[e]:void 0}var o2t=Object.prototype,a2t=o2t.hasOwnProperty;function s2t(e){var t=this.__data__;return yx?t[e]!==void 0:a2t.call(t,e)}var l2t="__lodash_hash_undefined__";function c2t(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yx&&t===void 0?l2t:t,this}function Qh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qh.prototype.clear=Jxt,Qh.prototype.delete=e2t,Qh.prototype.get=i2t,Qh.prototype.has=s2t,Qh.prototype.set=c2t;function u2t(){this.__data__=[],this.size=0}function P$(e,t){for(var n=e.length;n--;)if(hx(e[n][0],t))return n;return-1}var f2t=Array.prototype,d2t=f2t.splice;function h2t(e){var t=this.__data__,n=P$(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():d2t.call(t,n,1),--this.size,!0}function p2t(e){var t=this.__data__,n=P$(t,e);return n<0?void 0:t[n][1]}function v2t(e){return P$(this.__data__,e)>-1}function g2t(e,t){var n=this.__data__,r=P$(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function gu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}gu.prototype.clear=u2t,gu.prototype.delete=h2t,gu.prototype.get=p2t,gu.prototype.has=v2t,gu.prototype.set=g2t;var bx=Yh(Ol,"Map");function m2t(){this.size=0,this.__data__={hash:new Qh,map:new(bx||gu),string:new Qh}}function y2t(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function M$(e,t){var n=e.__data__;return y2t(t)?n[typeof t=="string"?"string":"hash"]:n.map}function b2t(e){var t=M$(this,e).delete(e);return this.size-=t?1:0,t}function x2t(e){return M$(this,e).get(e)}function S2t(e){return M$(this,e).has(e)}function w2t(e,t){var n=M$(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function mu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mu.prototype.clear=m2t,mu.prototype.delete=b2t,mu.prototype.get=x2t,mu.prototype.has=S2t,mu.prototype.set=w2t;var C2t="Expected a function";function OL(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(C2t);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(OL.Cache||mu),n}OL.Cache=mu;var O2t=500;function E2t(e){var t=OL(e,function(r){return n.size===O2t&&n.clear(),r}),n=t.cache;return t}var _2t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$2t=/\\(\\)?/g,P2t=E2t(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(_2t,function(n,r,i,o){t.push(i?o.replace($2t,"$1"):r||n)}),t});function EL(e){return e==null?"":x$(e)}function Sm(e,t){return ir(e)?e:CL(e,t)?[e]:P2t(EL(e))}var M2t=1/0;function wm(e){if(typeof e=="string"||fx(e))return e;var t=e+"";return t=="0"&&1/e==-M2t?"-0":t}function T$(e,t){t=Sm(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[wm(t[n++])];return n&&n==r?e:void 0}function Mr(e,t,n){var r=e==null?void 0:T$(e,t);return r===void 0?n:r}function _L(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Ope=Hs?Hs.isConcatSpreadable:void 0;function T2t(e){return ir(e)||px(e)||!!(Ope&&e&&e[Ope])}function I2t(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=T2t),i||(i=[]);++o<a;){var s=e[o];n(s)?_L(i,s):i[i.length]=s}return i}function R2t(e){var t=e==null?0:e.length;return t?I2t(e):[]}function $L(e){return cpe(dpe(e,void 0,R2t),e+"")}var PL=wpe(Object.getPrototypeOf,Object),N2t="[object Object]",k2t=Function.prototype,A2t=Object.prototype,Epe=k2t.toString,L2t=A2t.hasOwnProperty,j2t=Epe.call(Object);function ML(e){if(!Ta(e)||cc(e)!=N2t)return!1;var t=PL(e);if(t===null)return!0;var n=L2t.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Epe.call(n)==j2t}function D2t(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var F2t=Ol.isFinite,B2t=Math.min;function z2t(e){var t=Math[e];return function(n,r){if(n=Jhe(n),r=r==null?0:B2t(tpe(r),292),r&&F2t(n)){var i=(EL(n)+"e").split("e"),o=t(i[0]+"e"+(+i[1]+r));return i=(EL(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return t(n)}}var H2t=z2t("ceil");function W2t(){this.__data__=new gu,this.size=0}function V2t(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function U2t(e){return this.__data__.get(e)}function q2t(e){return this.__data__.has(e)}var G2t=200;function K2t(e,t){var n=this.__data__;if(n instanceof gu){var r=n.__data__;if(!bx||r.length<G2t-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mu(r)}return n.set(e,t),this.size=n.size,this}function El(e){var t=this.__data__=new gu(e);this.size=t.size}El.prototype.clear=W2t,El.prototype.delete=V2t,El.prototype.get=U2t,El.prototype.has=q2t,El.prototype.set=K2t;function Y2t(e,t){return e&&Xh(t,Zh(t),e)}function X2t(e,t){return e&&Xh(t,mx(t),e)}var _pe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$pe=_pe&&typeof module=="object"&&module&&!module.nodeType&&module,Z2t=$pe&&$pe.exports===_pe,Ppe=Z2t?Ol.Buffer:void 0,Mpe=Ppe?Ppe.allocUnsafe:void 0;function Tpe(e,t){if(t)return e.slice();var n=e.length,r=Mpe?Mpe(n):new e.constructor(n);return e.copy(r),r}function Q2t(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Ipe(){return[]}var J2t=Object.prototype,eSt=J2t.propertyIsEnumerable,Rpe=Object.getOwnPropertySymbols,TL=Rpe?function(e){return e==null?[]:(e=Object(e),Q2t(Rpe(e),function(t){return eSt.call(e,t)}))}:Ipe;function tSt(e,t){return Xh(e,TL(e),t)}var nSt=Object.getOwnPropertySymbols,Npe=nSt?function(e){for(var t=[];e;)_L(t,TL(e)),e=PL(e);return t}:Ipe;function rSt(e,t){return Xh(e,Npe(e),t)}function kpe(e,t,n){var r=t(e);return ir(e)?r:_L(r,n(e))}function IL(e){return kpe(e,Zh,TL)}function Ape(e){return kpe(e,mx,Npe)}var RL=Yh(Ol,"DataView"),NL=Yh(Ol,"Promise"),Cm=Yh(Ol,"Set"),Lpe="[object Map]",iSt="[object Object]",jpe="[object Promise]",Dpe="[object Set]",Fpe="[object WeakMap]",Bpe="[object DataView]",oSt=Kh(RL),aSt=Kh(bx),sSt=Kh(NL),lSt=Kh(Cm),cSt=Kh(dx),_l=cc;(RL&&_l(new RL(new ArrayBuffer(1)))!=Bpe||bx&&_l(new bx)!=Lpe||NL&&_l(NL.resolve())!=jpe||Cm&&_l(new Cm)!=Dpe||dx&&_l(new dx)!=Fpe)&&(_l=function(e){var t=cc(e),n=t==iSt?e.constructor:void 0,r=n?Kh(n):"";if(r)switch(r){case oSt:return Bpe;case aSt:return Lpe;case sSt:return jpe;case lSt:return Dpe;case cSt:return Fpe}return t});var uSt=Object.prototype,fSt=uSt.hasOwnProperty;function dSt(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&fSt.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var I$=Ol.Uint8Array;function kL(e){var t=new e.constructor(e.byteLength);return new I$(t).set(new I$(e)),t}function hSt(e,t){var n=t?kL(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var pSt=/\w*$/;function vSt(e){var t=new e.constructor(e.source,pSt.exec(e));return t.lastIndex=e.lastIndex,t}var zpe=Hs?Hs.prototype:void 0,Hpe=zpe?zpe.valueOf:void 0;function gSt(e){return Hpe?Object(Hpe.call(e)):{}}function Wpe(e,t){var n=t?kL(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var mSt="[object Boolean]",ySt="[object Date]",bSt="[object Map]",xSt="[object Number]",SSt="[object RegExp]",wSt="[object Set]",CSt="[object String]",OSt="[object Symbol]",ESt="[object ArrayBuffer]",_St="[object DataView]",$St="[object Float32Array]",PSt="[object Float64Array]",MSt="[object Int8Array]",TSt="[object Int16Array]",ISt="[object Int32Array]",RSt="[object Uint8Array]",NSt="[object Uint8ClampedArray]",kSt="[object Uint16Array]",ASt="[object Uint32Array]";function LSt(e,t,n){var r=e.constructor;switch(t){case ESt:return kL(e);case mSt:case ySt:return new r(+e);case _St:return hSt(e,n);case $St:case PSt:case MSt:case TSt:case ISt:case RSt:case NSt:case kSt:case ASt:return Wpe(e,n);case bSt:return new r;case xSt:case CSt:return new r(e);case SSt:return vSt(e);case wSt:return new r;case OSt:return gSt(e)}}function Vpe(e){return typeof e.constructor=="function"&&!$$(e)?gL(PL(e)):{}}var jSt="[object Map]";function DSt(e){return Ta(e)&&_l(e)==jSt}var Upe=xm&&xm.isMap,FSt=Upe?xL(Upe):DSt,BSt="[object Set]";function zSt(e){return Ta(e)&&_l(e)==BSt}var qpe=xm&&xm.isSet,HSt=qpe?xL(qpe):zSt,WSt=1,VSt=2,USt=4,Gpe="[object Arguments]",qSt="[object Array]",GSt="[object Boolean]",KSt="[object Date]",YSt="[object Error]",Kpe="[object Function]",XSt="[object GeneratorFunction]",ZSt="[object Map]",QSt="[object Number]",Ype="[object Object]",JSt="[object RegExp]",ewt="[object Set]",twt="[object String]",nwt="[object Symbol]",rwt="[object WeakMap]",iwt="[object ArrayBuffer]",owt="[object DataView]",awt="[object Float32Array]",swt="[object Float64Array]",lwt="[object Int8Array]",cwt="[object Int16Array]",uwt="[object Int32Array]",fwt="[object Uint8Array]",dwt="[object Uint8ClampedArray]",hwt="[object Uint16Array]",pwt="[object Uint32Array]",jr={};jr[Gpe]=jr[qSt]=jr[iwt]=jr[owt]=jr[GSt]=jr[KSt]=jr[awt]=jr[swt]=jr[lwt]=jr[cwt]=jr[uwt]=jr[ZSt]=jr[QSt]=jr[Ype]=jr[JSt]=jr[ewt]=jr[twt]=jr[nwt]=jr[fwt]=jr[dwt]=jr[hwt]=jr[pwt]=!0,jr[YSt]=jr[Kpe]=jr[rwt]=!1;function xx(e,t,n,r,i,o){var a,s=t&WSt,l=t&VSt,c=t&USt;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!sa(e))return e;var u=ir(e);if(u){if(a=dSt(e),!s)return yL(e,a)}else{var f=_l(e),d=f==Kpe||f==XSt;if(vx(e))return Tpe(e,s);if(f==Ype||f==Gpe||d&&!i){if(a=l||d?{}:Vpe(e),!s)return l?rSt(e,X2t(a,e)):tSt(e,Y2t(a,e))}else{if(!jr[f])return i?e:{};a=LSt(e,f,s)}}o||(o=new El);var h=o.get(e);if(h)return h;o.set(e,a),HSt(e)?e.forEach(function(g){a.add(xx(g,t,n,g,e,o))}):FSt(e)&&e.forEach(function(g,m){a.set(m,xx(g,t,n,m,e,o))});var p=c?l?Ape:IL:l?mx:Zh,v=u?void 0:p(e);return Gbt(v||e,function(g,m){v&&(m=g,g=e[m]),_$(a,m,xx(g,t,n,m,e,o))}),a}var vwt=1,gwt=4;function Xpe(e){return xx(e,vwt|gwt)}var mwt="__lodash_hash_undefined__";function ywt(e){return this.__data__.set(e,mwt),this}function bwt(e){return this.__data__.has(e)}function Sx(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new mu;++t<n;)this.add(e[t])}Sx.prototype.add=Sx.prototype.push=ywt,Sx.prototype.has=bwt;function xwt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Zpe(e,t){return e.has(t)}var Swt=1,wwt=2;function Qpe(e,t,n,r,i,o){var a=n&Swt,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var f=-1,d=!0,h=n&wwt?new Sx:void 0;for(o.set(e,t),o.set(t,e);++f<s;){var p=e[f],v=t[f];if(r)var g=a?r(v,p,f,t,e,o):r(p,v,f,e,t,o);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!xwt(t,function(m,y){if(!Zpe(h,y)&&(p===m||i(p,m,n,r,o)))return h.push(y)})){d=!1;break}}else if(!(p===v||i(p,v,n,r,o))){d=!1;break}}return o.delete(e),o.delete(t),d}function Cwt(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function AL(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Owt=1,Ewt=2,_wt="[object Boolean]",$wt="[object Date]",Pwt="[object Error]",Mwt="[object Map]",Twt="[object Number]",Iwt="[object RegExp]",Rwt="[object Set]",Nwt="[object String]",kwt="[object Symbol]",Awt="[object ArrayBuffer]",Lwt="[object DataView]",Jpe=Hs?Hs.prototype:void 0,LL=Jpe?Jpe.valueOf:void 0;function jwt(e,t,n,r,i,o,a){switch(n){case Lwt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Awt:return!(e.byteLength!=t.byteLength||!o(new I$(e),new I$(t)));case _wt:case $wt:case Twt:return hx(+e,+t);case Pwt:return e.name==t.name&&e.message==t.message;case Iwt:case Nwt:return e==t+"";case Mwt:var s=Cwt;case Rwt:var l=r&Owt;if(s||(s=AL),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=Ewt,a.set(e,t);var u=Qpe(s(e),s(t),r,i,o,a);return a.delete(e),u;case kwt:if(LL)return LL.call(e)==LL.call(t)}return!1}var Dwt=1,Fwt=Object.prototype,Bwt=Fwt.hasOwnProperty;function zwt(e,t,n,r,i,o){var a=n&Dwt,s=IL(e),l=s.length,c=IL(t),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in t:Bwt.call(t,d)))return!1}var h=o.get(e),p=o.get(t);if(h&&p)return h==t&&p==e;var v=!0;o.set(e,t),o.set(t,e);for(var g=a;++f<l;){d=s[f];var m=e[d],y=t[d];if(r)var x=a?r(y,m,d,t,e,o):r(m,y,d,e,t,o);if(!(x===void 0?m===y||i(m,y,n,r,o):x)){v=!1;break}g||(g=d=="constructor")}if(v&&!g){var S=e.constructor,w=t.constructor;S!=w&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof w=="function"&&w instanceof w)&&(v=!1)}return o.delete(e),o.delete(t),v}var Hwt=1,eve="[object Arguments]",tve="[object Array]",R$="[object Object]",Wwt=Object.prototype,nve=Wwt.hasOwnProperty;function Vwt(e,t,n,r,i,o){var a=ir(e),s=ir(t),l=a?tve:_l(e),c=s?tve:_l(t);l=l==eve?R$:l,c=c==eve?R$:c;var u=l==R$,f=c==R$,d=l==c;if(d&&vx(e)){if(!vx(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new El),a||wL(e)?Qpe(e,t,n,r,i,o):jwt(e,t,l,n,r,i,o);if(!(n&Hwt)){var h=u&&nve.call(e,"__wrapped__"),p=f&&nve.call(t,"__wrapped__");if(h||p){var v=h?e.value():e,g=p?t.value():t;return o||(o=new El),i(v,g,n,r,o)}}return d?(o||(o=new El),zwt(e,t,n,r,i,o)):!1}function N$(e,t,n,r,i){return e===t?!0:e==null||t==null||!Ta(e)&&!Ta(t)?e!==e&&t!==t:Vwt(e,t,n,r,N$,i)}var Uwt=1,qwt=2;function Gwt(e,t,n,r){var i=n.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var s=a[0],l=e[s],c=a[1];if(a[2]){if(l===void 0&&!(s in e))return!1}else{var u=new El,f;if(!(f===void 0?N$(c,l,Uwt|qwt,r,u):f))return!1}}return!0}function rve(e){return e===e&&!sa(e)}function Kwt(e){for(var t=Zh(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,rve(i)]}return t}function ive(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Ywt(e){var t=Kwt(e);return t.length==1&&t[0][2]?ive(t[0][0],t[0][1]):function(n){return n===e||Gwt(n,e,t)}}function Xwt(e,t){return e!=null&&t in Object(e)}function Zwt(e,t,n){t=Sm(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=wm(t[r]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&bL(i)&&O$(a,i)&&(ir(e)||px(e)))}function ove(e,t){return e!=null&&Zwt(e,t,Xwt)}var Qwt=1,Jwt=2;function eCt(e,t){return CL(e)&&rve(t)?ive(wm(e),t):function(n){var r=Mr(n,e);return r===void 0&&r===t?ove(n,e):N$(t,r,Qwt|Jwt)}}function tCt(e){return function(t){return t==null?void 0:t[e]}}function nCt(e){return function(t){return T$(t,e)}}function rCt(e){return CL(e)?tCt(wm(e)):nCt(e)}function jL(e){return typeof e=="function"?e:e==null?pL:typeof e=="object"?ir(e)?eCt(e[0],e[1]):Ywt(e):rCt(e)}function iCt(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function oCt(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[++i];if(n(o[l],l,o)===!1)break}return t}}var ave=oCt();function aCt(e,t){return e&&ave(e,t,Zh)}function sCt(e,t){return function(n,r){if(n==null)return n;if(!Xf(n))return e(n,r);for(var i=n.length,o=-1,a=Object(n);++o<i&&r(a[o],o,a)!==!1;);return n}}var sve=sCt(aCt);function lCt(e,t,n,r){return sve(e,function(i,o,a){t(r,i,n(i),a)}),r}function cCt(e,t){return function(n,r){var i=ir(n)?iCt:lCt,o=t?t():{};return i(n,e,jL(r),o)}}function DL(e,t,n){(n!==void 0&&!hx(e[t],n)||n===void 0&&!(t in e))&&E$(e,t,n)}function uCt(e){return Ta(e)&&Xf(e)}function FL(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function fCt(e){return Xh(e,mx(e))}function dCt(e,t,n,r,i,o,a){var s=FL(e,n),l=FL(t,n),c=a.get(l);if(c){DL(e,n,c);return}var u=o?o(s,l,n+"",e,t,a):void 0,f=u===void 0;if(f){var d=ir(l),h=!d&&vx(l),p=!d&&!h&&wL(l);u=l,d||h||p?ir(s)?u=s:uCt(s)?u=yL(s):h?(f=!1,u=Tpe(l,!0)):p?(f=!1,u=Wpe(l,!0)):u=[]:ML(l)||px(l)?(u=s,px(s)?u=fCt(s):(!sa(s)||ym(s))&&(u=Vpe(l))):f=!1}f&&(a.set(l,u),i(u,l,r,o,a),a.delete(l)),DL(e,n,u)}function lve(e,t,n,r,i){e!==t&&ave(t,function(o,a){if(i||(i=new El),sa(o))dCt(e,t,a,n,lve,r,i);else{var s=r?r(FL(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),DL(e,a,s)}},mx)}var hCt=hpe(function(e,t,n,r){lve(e,t,n,r)});function pCt(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var vCt=sbt(function(e,t){return e/t},1);function gCt(e,t){var n=-1,r=Xf(e)?Array(e.length):[];return sve(e,function(i,o,a){r[++n]=t(i,o,a)}),r}function Om(e,t){var n=ir(e)?b$:gCt;return n(e,jL(t))}var mCt="Expected a function",yCt=8,bCt=32,xCt=128,SCt=256;function wCt(e){return $L(function(t){for(var n=t.length,r=n,i=Yf.prototype.thru;r--;){var o=t[r];if(typeof o!="function")throw new TypeError(mCt);if(i&&!a&&S$(o)=="wrapper")var a=new Yf([],!0)}for(r=a?r:n;++r<n;){o=t[r];var s=S$(o),l=s=="wrapper"?ape(o):void 0;l&&lpe(l[0])&&l[1]==(xCt|yCt|bCt|SCt)&&!l[4].length&&l[9]==1?a=a[S$(l[0])].apply(a,l[3]):a=o.length==1&&lpe(o)?a[s]():a.thru(o)}return function(){var c=arguments,u=c[0];if(a&&c.length==1&&ir(u))return a.plant(u).value();for(var f=0,d=n?t[f].apply(this,c):u;++f<n;)d=t[f].call(this,d);return d}})}var Zn=wCt(),CCt=Object.prototype,OCt=CCt.hasOwnProperty,cve=cCt(function(e,t,n){OCt.call(e,n)?e[n].push(t):E$(e,n,[t])}),ECt="[object String]";function uve(e){return typeof e=="string"||!ir(e)&&Ta(e)&&cc(e)==ECt}function _Ct(e,t){return b$(t,function(n){return e[n]})}function $Ct(e){return e==null?[]:_Ct(e,Zh(e))}var PCt=Math.max;function MCt(e,t,n,r){e=Xf(e)?e:$Ct(e),n=n&&!r?tpe(n):0;var i=e.length;return n<0&&(n=PCt(i+n,0)),uve(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&upe(e,t,n)>-1}function TCt(e,t){return t.length<2?e:T$(e,D2t(t,0,-1))}var ICt="[object Boolean]";function BL(e){return e===!0||e===!1||Ta(e)&&cc(e)==ICt}function fve(e,t){return N$(e,t)}var RCt="[object Number]";function Em(e){return typeof e=="number"||Ta(e)&&cc(e)==RCt}function NCt(e){return e==null}function kCt(e){return e===void 0}function ACt(e,t){return t=Sm(t,e),e=TCt(e,t),e==null||delete e[wm(pCt(t))]}function LCt(e){return ML(e)?void 0:e}var jCt=1,DCt=2,FCt=4,zL=$L(function(e,t){var n={};if(e==null)return n;var r=!1;t=b$(t,function(o){return o=Sm(o,e),r||(r=o.length>1),o}),Xh(e,Ape(e),n),r&&(n=xx(n,jCt|DCt|FCt,LCt));for(var i=t.length;i--;)ACt(n,t[i]);return n});function dve(e,t,n,r){if(!sa(e))return e;t=Sm(t,e);for(var i=-1,o=t.length,a=o-1,s=e;s!=null&&++i<o;){var l=wm(t[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=a){var u=s[l];c=void 0,c===void 0&&(c=sa(u)?u:O$(t[i+1])?[]:{})}_$(s,l,c),s=s[l]}return e}function BCt(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=T$(e,a);n(s,a)&&dve(o,Sm(a,e),s)}return o}function zCt(e,t){return BCt(e,t,function(n,r){return ove(e,r)})}var hve=$L(function(e,t){return e==null?{}:zCt(e,t)});function Qt(e,t,n){return e==null?e:dve(e,t,n)}var HCt=1/0,WCt=Cm&&1/AL(new Cm([,-0]))[1]==HCt?function(e){return new Cm(e)}:ope,VCt=200;function UCt(e,t,n){var r=-1,i=Zbt,o=e.length,a=!0,s=[],l=s;if(o>=VCt){var c=t?null:WCt(e);if(c)return AL(c);a=!1,i=Zpe,l=new Sx}else l=t?[]:s;e:for(;++r<o;){var u=e[r],f=t?t(u):u;if(u=u!==0?u:0,a&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue e;t&&l.push(f),s.push(u)}else i(l,f,n)||(l!==s&&l.push(f),s.push(u))}return s}function HL(e,t){return e&&e.length?UCt(e,jL(t)):[]}var qCt=function(e){var t=/react|\.jsx|children:\[\(|return\s+[A-Za-z0-9].createElement\((?!['"][g|circle|ellipse|image|rect|line|polyline|polygon|text|path|html|mesh]['"])([^\)])*,/i;return t.test(e)},WL=function(){return WL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},WL.apply(this,arguments)},pve=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function GCt(e,t){var n=b.useRef(),r=b.useRef(),i=b.useRef(null),o=t.onReady,a=t.onEvent,s=function(u,f){var d;u===void 0&&(u="image/png");var h=(d=i.current)===null||d===void 0?void 0:d.getElementsByTagName("canvas")[0];return h==null?void 0:h.toDataURL(u,f)},l=function(u,f,d){u===void 0&&(u="download"),f===void 0&&(f="image/png");var h=u;u.indexOf(".")===-1&&(h="".concat(u,".").concat(f.split("/")[1]));var p=s(f,d),v=document.createElement("a");return v.href=p,v.download=h,document.body.appendChild(v),v.click(),document.body.removeChild(v),v=null,h},c=function(u,f){f===void 0&&(f=!1);var d=Object.keys(u),h=f;d.forEach(function(p){var v=u[p];p==="tooltip"&&(h=!0),ym(v)&&qCt("".concat(v))?u[p]=function(){for(var g=[],m=0;m<arguments.length;m++)g[m]=arguments[m];return V1t(v.apply(void 0,g),h)}:ir(v)?v.forEach(function(g){c(g,h)}):sa(v)?c(v,h):h=f})};return b.useEffect(function(){if(n.current&&!fve(r.current,t)){var u=!1;if(r.current){var f=r.current;f.data;var d=pve(f,["data"]);t.data;var h=pve(t,["data"]);u=fve(d,h)}r.current=Xpe(t),u?n.current.changeData(Mr(t,"data")):(c(t),n.current.update(t),n.current.render())}},[t]),b.useEffect(function(){if(!i.current)return function(){return null};r.current||(r.current=Xpe(t)),c(t);var u=new e(i.current,WL({},t));u.toDataURL=s,u.downloadImage=l,u.render(),n.current=u,o&&o(u);var f=function(d){a&&a(u,d)};return u.on("*",f),function(){n.current&&(n.current.destroy(),n.current.off("*",f),n.current=void 0)}},[]),{chart:n,container:i}}const KCt={field:"value",size:[1,1],round:!1,padding:0,sort:(e,t)=>t.value-e.value,as:["x","y"],ignoreParentValue:!0},YCt="nodeIndex",wx="childNodeCount",XCt="nodeAncestor",VL="Invalid field: it must be a string!";function ZCt(e,t){const{field:n,fields:r}=e;if(Wr(n))return n;if(Hi(n))return console.warn(VL),n[0];if(console.warn(`${VL} will try to get fields instead.`),Wr(r))return r;if(Hi(r)&&r.length)return r[0];throw new TypeError(VL)}function QCt(e){const t=[];if(e&&e.each){let n,r;e.each(i=>{var o,a;i.parent!==n?(n=i.parent,r=0):r+=1;const s=WQ((((o=i.ancestors)===null||o===void 0?void 0:o.call(i))||[]).map(l=>t.find(c=>c.name===l.name)||l),({depth:l})=>l>0&&l<i.depth);i[XCt]=s,i[wx]=((a=i.children)===null||a===void 0?void 0:a.length)||0,i[YCt]=r,t.push(i)})}else e&&e.eachNode&&e.eachNode(n=>{t.push(n)});return t}function JCt(e,t){t=OGe({},KCt,t);const n=t.as;if(!Hi(n)||n.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');let r;try{r=ZCt(t)}catch(l){console.warn(l)}const o=(l=>zst().size(t.size).round(t.round).padding(t.padding)(Yg(l).sum(c=>_1(c.children)?t.ignoreParentValue?0:c[r]-VQ(c.children,(u,f)=>u+f[r],0):c[r]).sort(t.sort)))(e),a=n[0],s=n[1];return o.each(l=>{var c,u;l[a]=[l.x0,l.x1,l.x1,l.x0],l[s]=[l.y1,l.y1,l.y0,l.y0],l.name=l.name||((c=l.data)===null||c===void 0?void 0:c.name)||((u=l.data)===null||u===void 0?void 0:u.label),l.data.name=l.name,["x0","x1","y0","y1"].forEach(f=>{n.indexOf(f)===-1&&delete l[f]})}),QCt(o)}var eOt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const _m="sunburst",UL="markType",vve="path",k$="ancestor-node";function tOt(e){const{data:t,encode:n}=e,{color:r,value:i}=n,a=JCt(t,{field:i,type:"hierarchy.partition",as:["x","y"]}),s=[];return a.forEach(l=>{var c,u,f,d;if(l.depth===0)return null;let h=l.data.name;const p=[h];let v=Object.assign({},l);for(;v.depth>1;)h=`${(c=v.parent.data)===null||c===void 0?void 0:c.name} / ${h}`,p.unshift((u=v.parent.data)===null||u===void 0?void 0:u.name),v=v.parent;const g=Object.assign(Object.assign(Object.assign({},sN(l.data,[i])),{[vve]:h,[k$]:v.data.name}),l);r&&r!==k$&&(g[r]=l.data[r]||((d=(f=l.parent)===null||f===void 0?void 0:f.data)===null||d===void 0?void 0:d[r])),s.push(g)}),s.map(l=>{const c=l.x.slice(0,2),u=[l.y[2],l.y[0]];return c[0]===c[1]&&(u[0]=u[1]=(l.y[2]+l.y[0])/2),Object.assign(Object.assign({},l),{x:c,y:u,fillOpacity:Math.pow(.85,l.depth)})})}const gve={id:_m,encode:{x:"x",y:"y",key:vve,color:k$,value:"value"},axis:{x:!1,y:!1},style:{[UL]:_m,stroke:"#fff",lineWidth:.5,fillOpacity:"fillOpacity",[wx]:wx,depth:"depth"},state:{active:{zIndex:2,stroke:"#000"},inactive:{zIndex:1,stroke:"#fff"}},legend:!1,interaction:{drillDown:!0},coordinate:{type:"polar",innerRadius:.2}},mve=e=>{const{encode:t,data:n=[],legend:r}=e,i=eOt(e,["encode","data","legend"]),o=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(Hn(i,["coordinate","innerRadius"],.2),1e-5)}),a=Object.assign(Object.assign({},gve.encode),t),{value:s}=a,l=tOt({encode:a,data:n});return console.log(l,"rectData"),[Ue({},gve,Object.assign(Object.assign({type:"rect",data:l,encode:a,tooltip:{title:"path",items:[c=>({name:s,value:c[s]})]}},i),{coordinate:o}))]};mve.props={};var nOt=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(e,t||[])).next())})};const rOt=e=>e.querySelectorAll(".element").filter(t=>Hn(t,["style",UL])===_m);function iOt(e){return Jt(e).select(`.${Ab}`).node()}const oOt={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function aOt(e={}){const{breadCrumb:t={},isFixedColor:n=!1}=e,r=Ue({},oOt,t);return i=>{const{update:o,setState:a,container:s,view:l,options:c}=i,u=s.ownerDocument,f=iOt(s),d=c.marks.find(({id:x})=>x===_m),{state:h}=d,p=u.createElement("g");f.appendChild(p);const v=(x,S)=>nOt(this,void 0,void 0,function*(){if(p.removeChildren(),x){const w=u.createElement("text",{style:Object.assign({x:0,text:r.rootText,depth:0},r.style)});p.appendChild(w);let C="";const O=x==null?void 0:x.split(" / ");let E=r.style.y,_=p.getBBox().width;const $=f.getBBox().width,P=O.map((T,I)=>{const M=u.createElement("text",{style:Object.assign(Object.assign({x:_,text:" / "},r.style),{y:E})});p.appendChild(M),_+=M.getBBox().width,C=`${C}${T} / `;const R=u.createElement("text",{name:C.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:T,x:_,depth:I+1},r.style),{y:E})});return p.appendChild(R),_+=R.getBBox().width,_>$&&(E=p.getBBox().height,_=0,M.attr({x:_,y:E}),_+=M.getBBox().width,R.attr({x:_,y:E}),_+=R.getBBox().width),R});[w,...P].forEach((T,I)=>{if(I===P.length)return;const M=Object.assign({},T.attributes);T.attr("cursor","pointer"),T.addEventListener("mouseenter",()=>{T.attr(r.active)}),T.addEventListener("mouseleave",()=>{T.attr(M)}),T.addEventListener("click",()=>{v(T.name,Hn(T,["style","depth"]))})})}a("drillDown",w=>{const{marks:C}=w,O=C.map(E=>{if(E.id!==_m&&E.type!=="rect")return E;const{data:_}=E,$=Object.fromEntries(["color"].map(T=>[T,{domain:l.scale[T].getOptions().domain}])),P=_.filter(T=>{const I=T.path;return n||(T[k$]=I.split(" / ")[S]),x?new RegExp(`^${x}.+`).test(I):!0});return Ue({},E,n?{data:P,scale:$}:{data:P})});return Object.assign(Object.assign({},w),{marks:O})}),yield o()}),g=x=>{const S=x.target;if(Hn(S,["style",UL])!==_m||Hn(S,["markType"])!=="rect"||!Hn(S,["style",wx]))return;const w=Hn(S,["__data__","key"]),C=Hn(S,["style","depth"]);S.style.cursor="pointer",v(w,C)};f.addEventListener("click",g);const m=oN(Object.assign(Object.assign({},h.active),h.inactive)),y=()=>{rOt(f).forEach(S=>{const w=Hn(S,["style",wx]);if(Hn(S,["style","cursor"])!=="pointer"&&w){S.style.cursor="pointer";const O=sN(S.attributes,m);S.addEventListener("mouseenter",()=>{S.attr(h.active)}),S.addEventListener("mouseleave",()=>{S.attr(Ue(O,h.inactive))})}})};return f.addEventListener("mousemove",y),()=>{p.remove(),f.removeEventListener("click",g),f.removeEventListener("mousemove",y)}}}function sOt(){return{"interaction.drillDown":aOt,"mark.sunburst":mve}}var A$=function(){return A$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},A$.apply(this,arguments)},lOt=c1t(j1t,A$(A$({},Nhe()),sOt())),or=function(e){var t=uOt(e),n=t.children,r=n===void 0?[]:n,i=zL(t,[].concat(xve,L$.map(function(c){return c.key}))),o=function(c){var u;return(u=vOt.find(function(f){return f.key===c}))===null||u===void 0?void 0:u.callback},a=function(c,u,f){var d=o(u);d?d(c,u,f):c[u]=Zf({},c[u],f)},s=function(c){Object.keys(c).forEach(function(u){if(c[u]){var f=L$.find(function(p){return p.key===u});if(f){var d=f.type,h=f.extend_keys;d?r.push(l(Zf({},hve(c,h),{type:d},c[u]))):ir(c[u])&&c[u].forEach(function(p){r.push(l(p))})}}})},l=function(c){return s(c),Object.keys(GL).forEach(function(u){var f=GL[u];if(!kCt(c[u]))if(sa(f)){var d=f.value,h=f.target,p=d(c[u]);a(c,h,p)}else Qt(c,f,c[u])}),c};return r.forEach(function(c){var u=Zf({},i,c);l(Zf(c,u))}),s(t),cOt(t),e},yve=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},cOt=function(e){var t=e.children,n=t===void 0?[]:t,r=Object.keys(GL).concat(L$.map(function(i){return i.key}));return r.forEach(function(i){delete e[i]}),n.forEach(function(i){Object.keys(i).forEach(function(o){r.includes(o)&&delete i[o]})}),Object.keys(e).forEach(function(i){yve(yve([],xve,!0),YL.map(function(o){return o.key}),!0).includes(i)||delete e[i]}),e},uOt=function(e){var t=e.options,n=t.children,r=n===void 0?[]:n;return r.forEach(function(i){Object.keys(i).forEach(function(o){ir(i[o])&&o!=="data"&&(i[o]=i[o].filter(function(a){return!a[qL]}))})}),t},bve=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},fOt=function(e,t){if(ir(t))return t},Zf=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return hCt.apply(void 0,bve(bve([],e,!1),[fOt],!1))};function Cx(e){switch(typeof e){case"function":return e;case"string":return function(t){return Mr(t,[e])};default:return function(){return e}}}var Ox=function(){return Ox=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ox.apply(this,arguments)},dOt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},hOt=["renderer"],xve=["width","height","autoFit","theme","inset","insetLeft","insetRight","insetTop","insetBottom","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","depth","title","clip","children","type","data","direction"],qL="__transform__",pOt="__skipDelCustomKeys__",Jh=function(e,t){return BL(t)?{type:e,available:t}:Ox({type:e},t)},GL={xField:"encode.x",yField:"encode.y",colorField:"encode.color",angleField:"encode.y",keyField:"encode.key",sizeField:"encode.size",shapeField:"encode.shape",seriesField:"encode.series",positionField:"encode.position",textField:"encode.text",valueField:"encode.value",binField:"encode.x",srcField:"encode.src",linkColorField:"encode.linkColor",fontSizeField:"encode.fontSize",radius:"coordinate.outerRadius",innerRadius:"coordinate.innerRadius",startAngle:"coordinate.startAngle",endAngle:"coordinate.endAngle",focusX:"coordinate.focusX",focusY:"coordinate.focusY",distortionX:"coordinate.distortionX",distortionY:"coordinate.distortionY",visual:"coordinate.visual",stack:{target:"transform",value:function(e){return Jh("stackY",e)}},normalize:{target:"transform",value:function(e){return Jh("normalizeY",e)}},percent:{target:"transform",value:function(e){return Jh("normalizeY",e)}},group:{target:"transform",value:function(e){return Jh("dodgeX",e)}},sort:{target:"transform",value:function(e){return Jh("sortX",e)}},symmetry:{target:"transform",value:function(e){return Jh("symmetryY",e)}},diff:{target:"transform",value:function(e){return Jh("diffY",e)}},meta:{target:"scale",value:function(e){return e}},label:{target:"labels",value:function(e){return e}},shape:"style.shape",connectNulls:{target:"style",value:function(e){return BL(e)?{connect:e}:e}}},KL=["xField","yField","seriesField","colorField","keyField","positionField","meta","tooltip","animate","stack","normalize","percent","group","sort","symmetry","diff"],L$=[{key:"annotations",extend_keys:[]},{key:"line",type:"line",extend_keys:KL},{key:"point",type:"point",extend_keys:KL},{key:"area",type:"area",extend_keys:KL}],vOt=[{key:"transform",callback:function(e,t,n){var r;e[t]=e[t]||[];var i=n.available,o=i===void 0?!0:i,a=dOt(n,["available"]);if(o)e[t].push(Ox((r={},r[qL]=!0,r),a));else{var s=e[t].indexOf(function(l){return l.type===n.type});s!==-1&&e[t].splice(s,1)}}},{key:"labels",callback:function(e,t,n){var r;if(!n||ir(n)){e[t]=n||[];return}n.text||(n.text=e.yField),e[t]=e[t]||[],e[t].push(Ox((r={},r[qL]=!0,r),n))}}],YL=[{key:"conversionTag",shape:"ConversionTag"},{key:"axisText",shape:"BidirectionalBarAxisText"}],gOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),j$=function(){return j$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},j$.apply(this,arguments)},mOt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Sve=function(e){gOt(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=mOt(n,["style"]);return e.call(this,j$({style:j$({text:"",fontSize:12,textBaseline:"middle",textAlign:"center",fill:"#000",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1},r)},i))||this}return t}(xl),yOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),D$=function(){return D$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},D$.apply(this,arguments)},bOt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},xOt=function(e){yOt(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=bOt(n,["style"]);return e.call(this,D$({style:D$({fill:"#eee"},r)},i))||this}return t}(ub),SOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wve=function(e){SOt(t,e);function t(n,r,i){var o=e.call(this,{style:Zf(i,r)})||this;return o.chart=n,o}return t.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this)},t.prototype.disconnectedCallback=function(){},t.prototype.attributeChangedCallback=function(n){},t.prototype.update=function(n,r){var i;return this.attr(Zf({},this.attributes,n||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,r)},t.prototype.clear=function(){this.removeChildren()},t.prototype.getElementsLayout=function(){var n=this.chart.getContext().canvas,r=n.document.getElementsByClassName("element"),i=[];return r.forEach(function(o){var a=o.getBBox(),s=a.x,l=a.y,c=a.width,u=a.height,f=o.__data__;i.push({bbox:a,x:s,y:l,width:c,height:u,key:f.key,data:f})}),i},t.prototype.bindEvents=function(n,r){},t}(bE),wOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),F$=function(){return F$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},F$.apply(this,arguments)},COt=function(e){wOt(t,e);function t(n,r){return e.call(this,n,r,{type:t.tag})||this}return t.prototype.getConversionTagLayout=function(){var n=this.direction==="vertical",r=this.getElementsLayout(),i=r[0],o=i.x,a=i.y,s=i.height,l=i.width,c=i.data,u=["items",0,"value"],f=Mr(c,u),d=n?r[1].y-a-s:r[1].x-o-l,h=[],p=this.attributes,v=p.size,g=v===void 0?40:v,m=p.arrowSize,y=m===void 0?20:m,x=p.spacing,S=x===void 0?4:x;return r.forEach(function(w,C){if(C>0){var O=w.x,E=w.y,_=w.height,$=w.width,P=w.data,T=w.key,I=Mr(P,u),M=g/2;if(n){var R=O+$/2,N=E;h.push({points:[[R+M,N-d+S],[R+M,N-y-S],[R,N-S],[R-M,N-y-S],[R-M,N-d+S]],center:[R,N-d/2-S],width:d,value:[f,I],key:T})}else{var R=O,N=E+_/2;h.push({points:[[O-d+S,N-M],[O-y-S,N-M],[R-S,N],[O-y-S,N+M],[O-d+S,N+M]],center:[R-d/2-S,N],width:d,value:[f,I],key:T})}f=I}}),h},t.prototype.render=function(){this.setDirection(),this.drawConversionTag()},t.prototype.setDirection=function(){var n=this.chart.getCoordinate(),r=Mr(n,"options.transformations"),i="horizontal";r.forEach(function(o){o.includes("transpose")&&(i="vertical")}),this.direction=i},t.prototype.drawConversionTag=function(){var n=this,r=this.getConversionTagLayout(),i=this.attributes,o=i.style,a=i.text,s=a.style,l=a.formatter;r.forEach(function(c){var u=c.points,f=c.center,d=c.value,h=c.key,p=d[0],v=d[1],g=f[0],m=f[1],y=new xOt({style:F$({points:u,fill:"#eee"},o),id:"polygon-".concat(h)}),x=new Sve({style:F$({x:g,y:m,text:ym(l)?l(p,v):(v/p*100).toFixed(2)+"%"},s),id:"text-".concat(h)});n.appendChild(y),n.appendChild(x)})},t.prototype.update=function(){var n=this,r=this.getConversionTagLayout();r.forEach(function(i){var o=i.points,a=i.center,s=i.key,l=a[0],c=a[1],u=n.getElementById("polygon-".concat(s)),f=n.getElementById("text-".concat(s));u.setAttribute("points",o),f.setAttribute("x",l),f.setAttribute("y",c)})},t.tag="ConversionTag",t}(wve),XL=32,Cve=16,Ove=48,OOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ex=function(){return Ex=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ex.apply(this,arguments)},EOt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},_Ot=function(e){OOt(t,e);function t(n,r){return e.call(this,n,r,{type:t.tag})||this}return t.prototype.render=function(){this.drawText()},t.prototype.getBidirectionalBarAxisTextLayout=function(){var n=this.attributes.layout,r=n==="vertical",i=this.getElementsLayout(),o=r?HL(i,"x"):HL(i,"y"),a=["title"],s=[],l=this.chart.getContext().views,c=Mr(l,[0,"layout"]),u=c.width,f=c.height;return o.forEach(function(d){var h=d.x,p=d.y,v=d.height,g=d.width,m=d.data,y=d.key,x=Mr(m,a);r?s.push({x:h+g/2,y:f,text:x,key:y}):s.push({x:u,y:p+v/2,text:x,key:y})}),HL(s,"text").length!==s.length&&(s=Object.values(cve(s,"text")).map(function(d){var h,p=d.reduce(function(v,g){return v+(r?g.x:g.y)},0);return Ex(Ex({},d[0]),(h={},h[r?"x":"y"]=p/d.length,h))})),s},t.prototype.transformLabelStyle=function(n){var r={},i=/^label[A-Z]/;return Object.keys(n).forEach(function(o){i.test(o)&&(r[o.replace("label","").replace(/^[A-Z]/,function(a){return a.toLowerCase()})]=n[o])}),r},t.prototype.drawText=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout(),i=this.attributes,o=i.layout,a=i.labelFormatter,s=EOt(i,["layout","labelFormatter"]);r.forEach(function(l){var c=l.x,u=l.y,f=l.text,d=l.key,h=new Sve({style:Ex({x:c,y:u,text:ym(a)?a(f):f,wordWrap:!0,wordWrapWidth:o==="horizontal"?XL*2:120,maxLines:2,textOverflow:"ellipsis"},n.transformLabelStyle(s)),id:"text-".concat(d)});n.appendChild(h)})},t.prototype.update=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout();r.forEach(function(i){var o=i.x,a=i.y,s=i.key,l=n.getElementById("text-".concat(s));l.setAttribute("x",o),l.setAttribute("y",a)})},t.tag="BidirectionalBarAxisText",t}(wve),$Ot={ConversionTag:COt,BidirectionalBarAxisText:_Ot},POt=function(){function e(t,n){this.container=new Map,this.chart=t,this.config=n,this.init()}return e.prototype.init=function(){var t=this;YL.forEach(function(n){var r,i=n.key,o=n.shape,a=t.config[i];if(a){var s=new $Ot[o](t.chart,a),l=t.chart.getContext().canvas;l.appendChild(s),t.container.set(i,s)}else(r=t.container.get(i))===null||r===void 0||r.clear()})},e.prototype.update=function(){var t=this;this.container.size&&YL.forEach(function(n){var r=n.key,i=t.container.get(r);i==null||i.update()})},e}(),MOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$m=function(){return $m=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},$m.apply(this,arguments)},Eve="data-chart-source-type",qn=function(e){MOt(t,e);function t(n,r){var i=e.call(this)||this;return i.container=typeof n=="string"?document.getElementById(n):n,i.options=i.mergeOption(r),i.createG2(),i.bindEvents(),i}return t.prototype.getChartOptions=function(){return $m($m({},hve(this.options,hOt)),{container:this.container})},t.prototype.getSpecOptions=function(){return this.type==="base"||this[pOt]?$m($m({},this.options),this.getChartOptions()):this.options},t.prototype.createG2=function(){if(!this.container)throw Error("The container is not initialized!");this.chart=new lOt(this.getChartOptions()),this.container.setAttribute(Eve,"Ant Design Charts")},t.prototype.bindEvents=function(){var n=this;this.chart&&this.chart.on("*",function(r){r!=null&&r.type&&n.emit(r.type,r)})},t.prototype.getBaseOptions=function(){return{type:"view",autoFit:!0}},t.prototype.getDefaultOptions=function(){},t.prototype.render=function(){var n=this;this.type!=="base"&&this.execAdaptor(),this.chart.options(this.getSpecOptions()),this.chart.render().then(function(){n.annotation=new POt(n.chart,n.options)}),this.bindSizeSensor()},t.prototype.update=function(n){this.options=this.mergeOption(n)},t.prototype.mergeOption=function(n){return Zf({},this.getBaseOptions(),this.getDefaultOptions(),n)},t.prototype.changeData=function(n){this.chart.changeData(n)},t.prototype.changeSize=function(n,r){this.chart.changeSize(n,r)},t.prototype.destroy=function(){this.chart.destroy(),this.off(),this.container.removeAttribute(Eve)},t.prototype.execAdaptor=function(){var n=this.getSchemaAdaptor();n({chart:this.chart,options:this.options})},t.prototype.triggerResize=function(){this.chart.forceFit()},t.prototype.bindSizeSensor=function(){var n=this,r=this.options.autoFit,i=r===void 0?!0:r;i&&this.chart.on(rr.AFTER_CHANGE_SIZE,function(){n.annotation.update()})},t}(_A),TOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),IOt=function(e){TOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="base",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"line"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return function(n){return n}},t}(qn),ZL=function(){return ZL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ZL.apply(this,arguments)};function ROt(e){var t=e.options,n=t.stack,r=t.tooltip,i=t.xField;if(!n)return e;var o=L$.map(function(s){return s.type}).filter(function(s){return!!s}),a=!1;return o.forEach(function(s){t[s]&&(a=!0,Qt(t,[s,"stack"],ZL({y1:"y"},typeof n=="object"?n:{})))}),a&&!BL(r)&&!r&&Qt(t,"tooltip",{title:i,items:[{channel:"y"}]}),e}function fi(e){return Zn(ROt)(e)}function NOt(e){var t=e.options.layout,n=t===void 0?"horizontal":t;return e.options.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}],e}function kOt(e){NOt(e);var t=e.options.layout,n=t===void 0?"horizontal":t;return e.options.children.forEach(function(r){var i;!((i=r==null?void 0:r.coordinate)===null||i===void 0)&&i.transform&&(r.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}])}),e}function AOt(e){return Zn(fi,or)(e)}var LOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jOt=function(e){LOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="area",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"area"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return AOt},t}(qn),Pm=function(){return Pm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Pm.apply(this,arguments)};function _ve(e){var t=function(n){var r=n.options;Mr(r,"children.length")>1&&Qt(r,"children",[{type:"interval"}]);var i=r.scale,o=r.markBackground,a=r.data,s=r.children,l=r.yField,c=Mr(i,"y.domain",[]);if(o&&c.length&&ir(a)){var u="domainMax",f=a.map(function(d){var h;return Pm(Pm({originData:Pm({},d)},zL(d,l)),(h={},h[u]=c[c.length-1],h))});s.unshift(Pm({type:"interval",data:f,yField:u,tooltip:!1,style:{fill:"#eee"},label:!1},o))}return n};return Zn(t,fi,or)(e)}var DOt=function(){var e=function(t,n){return function(r){var i=t.fill,o=i===void 0?"#2888FF":i,a=t.stroke,s=t.fillOpacity,l=s===void 0?1:s,c=t.strokeOpacity,u=c===void 0?.2:c,f=t.pitch,d=f===void 0?8:f,h=r[0],p=r[1],v=r[2],g=r[3],m=(p[1]-h[1])/2,y=n.document,x=y.createElement("g",{}),S=y.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+m],[v[0]-d,h[1]+m],g],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),w=y.createElement("polygon",{style:{points:[[h[0]-d,h[1]+m],p,v,[v[0]-d,h[1]+m]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),C=y.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+m],p,[h[0]+d,h[1]+m]],fill:o,fillOpacity:l-.2}});return x.appendChild(S),x.appendChild(w),x.appendChild(C),x}};Ahe("shape.interval.bar25D",e)},FOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();DOt();var BOt=function(e){FOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="Bar",n}return t.getDefaultOptions=function(){return{type:"view",coordinate:{transform:[{type:"transpose"}]},children:[{type:"interval"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0},elementHighlight:{background:!0}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return _ve},t}(qn),zOt=function(){var e=function(t,n){return function(r){var i=t.fill,o=i===void 0?"#2888FF":i,a=t.stroke,s=t.fillOpacity,l=s===void 0?1:s,c=t.strokeOpacity,u=c===void 0?.2:c,f=t.pitch,d=f===void 0?8:f,h=r[1][0]-r[0][0],p=h/2+r[0][0],v=n.document,g=v.createElement("g",{}),m=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]+d],[p,r[3][1]+d],[r[3][0],r[3][1]]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),y=v.createElement("polygon",{style:{points:[[p,r[1][1]+d],[r[1][0],r[1][1]],[r[2][0],r[2][1]],[p,r[2][1]+d]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),x=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]-d],[r[1][0],r[1][1]],[p,r[1][1]+d]],fill:o,fillOpacity:l-.2}});return g.appendChild(y),g.appendChild(m),g.appendChild(x),g}};Ahe("shape.interval.column25D",e)},HOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();zOt();var WOt=function(e){HOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="column",n}return t.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0},elementHighlight:{background:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return _ve},t}(qn);function VOt(e){var t=function(r){var i=r.options,o=i.children,a=o===void 0?[]:o,s=i.legend;return s&&a.forEach(function(l){if(!Mr(l,"colorField")){var c=Mr(l,"yField");Qt(l,"colorField",function(){return c})}}),r},n=function(r){var i=r.options,o=i.annotations,a=o===void 0?[]:o,s=i.children,l=s===void 0?[]:s,c=i.scale,u=!1;return Mr(c,"y.key")||l.forEach(function(f,d){if(!Mr(f,"scale.y.key")){var h="child".concat(d,"Scale");Qt(f,"scale.y.key",h);var p=f.annotations,v=p===void 0?[]:p;v.length>0&&(Qt(f,"scale.y.independent",!1),v.forEach(function(g){Qt(g,"scale.y.key",h)})),!u&&a.length>0&&Mr(f,"scale.y.independent")===void 0&&(u=!0,Qt(f,"scale.y.independent",!1),a.forEach(function(g){Qt(g,"scale.y.key",h)}))}}),r};return Zn(t,n,fi,or)(e)}var UOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$ve=function(e){UOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="DualAxes",n}return t.getDefaultOptions=function(){return{type:"view",axis:{y:{title:!1,tick:!1},x:{title:!1}},scale:{y:{independent:!0,nice:!0}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return VOt},t}(qn);function qOt(e){var t=function(o){var a=o.options,s=a.xField,l=a.colorField;return l||Qt(a,"colorField",s),o},n=function(o){var a=o.options,s=a.compareField,l=a.transform,c=a.isTransposed,u=c===void 0?!0:c,f=a.coordinate;return l||(s?Qt(a,"transform",[]):Qt(a,"transform",[{type:"symmetryY"}])),!f&&u&&Qt(a,"coordinate",{transform:[{type:"transpose"}]}),o},r=function(o){var a=o.options,s=a.compareField,l=a.seriesField,c=a.data,u=a.children,f=a.yField,d=a.isTransposed,h=d===void 0?!0:d;if(s||l){var p=Object.values(cve(c,function(v){return v[s||l]}));u[0].data=p[0],u.push({type:"interval",data:p[1],yField:function(v){return-v[f]}}),delete a.compareField,delete a.data}return l&&(Qt(a,"type","spaceFlex"),Qt(a,"ratio",[1,1]),Qt(a,"direction",h?"row":"col"),delete a.seriesField),o},i=function(o){var a=o.options,s=a.tooltip,l=a.xField,c=a.yField;return s||Qt(a,"tooltip",{title:!1,items:[function(u){return{name:u[l],value:u[c]}}]}),o};return Zn(t,n,r,i,fi,or)(e)}var GOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),KOt=function(e){GOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="column",n}return t.getDefaultOptions=function(){return{type:"view",scale:{x:{padding:0}},animate:{enter:{type:"fadeIn"}},axis:!1,shapeField:"funnel",label:{position:"inside",transform:[{type:"contrastReverse"}]},children:[{type:"interval"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return qOt},t}(qn);function YOt(e){return Zn(fi,or)(e)}var XOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZOt=function(e){XOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="line",n}return t.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"line"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return YOt},t}(qn),Qf=function(){return Qf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Qf.apply(this,arguments)};function QOt(e){var t=function(n){var r=n.options,i=r.angleField,o=r.data,a=r.label,s=r.tooltip,l=r.colorField,c=Cx(l);if(ir(o)){var u=o.reduce(function(d,h){return d+h[i]},0);if(u===0){var f=o.map(function(d){var h;return Qf(Qf({},d),(h={},h[i]=1,h))});Qt(r,"data",f),a&&Qt(r,"label",Qf(Qf({},a),{formatter:function(){return 0}})),s!==!1&&Qt(r,"tooltip",Qf(Qf({},s),{items:[function(d,h,p){return{name:c(d,h,p),value:0}}]}))}}return n};return Zn(t,or)(e)}var JOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eEt=function(e){JOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="pie",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"theta"},transform:[{type:"stackY",reverse:!0}],animate:{enter:{type:"waveIn"}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return QOt},t}(qn);function tEt(e){return Zn(fi,or)(e)}var nEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rEt=function(e){nEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="scatter",n}return t.getDefaultOptions=function(){return{axis:{y:{title:!1},x:{title:!1}},legend:{size:!1},children:[{type:"point"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return tEt},t}(qn);function iEt(e){var t=function(n){return Qt(n,"options.coordinate",{type:Mr(n,"options.coordinateType","polar")}),n};return Zn(t,or)(e)}var oEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),aEt=function(e){oEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="radar",n}return t.getDefaultOptions=function(){return{axis:{x:{grid:!0,line:!0},y:{zIndex:1,title:!1,line:!0,nice:!0}},meta:{x:{padding:.5,align:0}},interaction:{tooltip:{style:{crosshairsLineDash:[4,4]}}},children:[{type:"line"}],coordinateType:"polar"}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return iEt},t}(qn),yu=function(){return yu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},yu.apply(this,arguments)},sEt="__stock-range__",lEt="trend",cEt="up",uEt="down";function fEt(e){var t=function(r){var i=r.options,o=i.data,a=i.yField;return r.options.data=Om(o,function(s){var l=s&&yu({},s);if(Array.isArray(a)&&l){var c=a[0],u=a[1],f=a[2],d=a[3];l[lEt]=l[c]<=l[u]?cEt:uEt,l[sEt]=[l[c],l[u],l[f],l[d]]}return l}),r},n=function(r){var i=r.options,o=i.xField,a=i.yField,s=i.fallingFill,l=i.risingFill,c=a[0],u=a[1],f=a[2],d=a[3],h=Cx(o);return r.options.children=Om(r.options.children,function(p,v){var g=v===0;return yu(yu({},p),{tooltip:{title:function(m,y,x){var S=h(m,y,x);return S instanceof Date?S.toLocaleString():S},items:[{field:f},{field:d},{field:c},{field:u}]},encode:yu(yu({},p.encode||{}),{y:g?[f,d]:[c,u],color:function(m){return Math.sign(m[u]-m[c])}}),style:yu(yu({},p.style||{}),{lineWidth:g?1:10})})}),delete i.yField,r.options.legend={color:!1},s&&Qt(r,"options.scale.color.range[0]",s),l&&Qt(r,"options.scale.color.range[2]",l),r};return Zn(t,n,or)(e)}var dEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hEt=["#26a69a","#999999","#ef5350"],pEt=function(e){dEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="stock",n}return t.getDefaultOptions=function(){return{type:"view",scale:{color:{domain:[-1,0,1],range:hEt},y:{nice:!0}},children:[{type:"link"},{type:"link"}],axis:{x:{title:!1,grid:!1},y:{title:!1,grid:!0,gridLineDash:null}},animate:{enter:{type:"scaleInY"}},interaction:{tooltip:{shared:!0,marker:!1,groupName:!1,crosshairs:!0}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return fEt},t}(qn);function vEt(e){return Zn(fi,or)(e)}var gEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mEt=function(e){gEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="TinyLine",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"line",axis:!1}],animate:{enter:{type:"growInX",duration:500}},padding:0,margin:0,tooltip:!1}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return vEt},t}(qn);function yEt(e){return Zn(fi,or)(e)}var bEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xEt=function(e){bEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="TinyArea",n}return t.getDefaultOptions=function(){return{type:"view",animate:{enter:{type:"growInX",duration:500}},children:[{type:"area",axis:!1}],padding:0,margin:0,tooltip:!1}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return yEt},t}(qn);function SEt(e){return Zn(fi,or)(e)}var wEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),CEt=function(e){wEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="TinyColumn",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"interval",axis:!1}],padding:0,margin:0,tooltip:!1}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return SEt},t}(qn),QL=function(){return QL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},QL.apply(this,arguments)};function OEt(e){var t=function(n){var r=n.options,i=r.percent,o=r.color,a=o===void 0?[]:o;if(!i)return n;var s={scale:{color:{range:a.length?a:[]}},data:[1,i]};return Object.assign(r,QL({},s)),n};return Zn(t,fi,or)(e)}var EEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_Et=function(e){EEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="TinyProgress",n}return t.getDefaultOptions=function(){return{type:"view",data:[],margin:0,padding:0,tooltip:!1,children:[{interaction:{tooltip:!1},coordinate:{transform:[{type:"transpose"}]},type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return OEt},t}(qn),JL=function(){return JL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},JL.apply(this,arguments)};function $Et(e){var t=function(r){var i=r.options,o=i.radius,a=o===void 0?.8:o;return Qt(r,"options.coordinate.innerRadius",a),r},n=function(r){var i=r.options,o=i.percent,a=i.color,s=a===void 0?[]:a;if(!o)return r;var l={scale:{color:{range:s.length?s:[]}},data:[1,o]};return Object.assign(i,JL({},l)),r};return Zn(t,n,fi,or)(e)}var PEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),MEt=function(e){PEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="TinyRing",n}return t.getDefaultOptions=function(){return{type:"view",data:[],margin:0,padding:0,coordinate:{type:"theta"},animate:{enter:{type:"waveIn"}},interaction:{tooltip:!1},tooltip:!1,children:[{type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return $Et},t}(qn);function TEt(e){return Zn(or)(e)}var IEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),REt=function(e){IEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="rose",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"polar"},animate:{enter:{type:"waveIn"}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return TEt},t}(qn),ej="__start__",Mm="__end__",tj="__waterfall_value__",nj=function(){return nj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},nj.apply(this,arguments)},NEt=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};function kEt(e){var t=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.yField;return a.length&&(a.reduce(function(l,c,u){var f,d=Cx(s),h=d(c,u,a);if(u===0||c.isTotal)c[ej]=0,c[Mm]=h,c[tj]=h;else{var p=(f=l[Mm])!==null&&f!==void 0?f:d(l,u,a);c[ej]=p,c[Mm]=p+h,c[tj]=l[Mm]}return c},[]),Object.assign(i,{yField:[ej,Mm]})),r},n=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.xField,l=i.children,c=i.linkStyle,u=NEt([],a,!0);return u.reduce(function(f,d,h){return h>0&&(d.x1=f[s],d.x2=d[s],d.y1=f[Mm]),d},[]),u.shift(),l.push({type:"link",xField:["x1","x2"],yField:"y1",zIndex:-1,data:u,style:nj({stroke:"#697474"},c),label:!1,tooltip:!1}),r};return Zn(t,n,fi,or)(e)}var AEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),LEt=function(e){AEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="waterfall",n}return t.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{field:tj,valueFormatter:"~s",name:"value"},axis:{y:{title:null,labelFormatter:"~s"},x:{title:null}},children:[{type:"interval",interaction:{elementHighlight:{background:!0}}}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return kEt},t}(qn);function jEt(e){var t=function(n){var r=n.options,i=r.data,o=r.binNumber,a=r.binWidth,s=r.children,l=r.channel,c=l===void 0?"count":l,u=Mr(s,"[0].transform[0]",{});return Em(a)?(Cpe(u,{thresholds:H2t(vCt(i.length,a)),y:c}),n):(Em(o)&&Cpe(u,{thresholds:o,y:c}),n)};return Zn(t,fi,or)(e)}var DEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),FEt=function(e){DEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="Histogram",n}return t.getDefaultOptions=function(){return{type:"view",autoFit:!0,axis:{y:{title:!1},x:{title:!1}},children:[{type:"rect",transform:[{type:"binX",y:"count"}],interaction:{elementHighlight:{background:!0}}}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return jEt},t}(qn);function BEt(e){var t=function(r){var i=r.options,o=i.tooltip,a=o===void 0?{}:o,s=i.colorField,l=i.sizeField;return a&&!a.field&&(a.field=s||l),r},n=function(r){var i=r.options,o=i.mark,a=i.children;return o&&(a[0].type=o),r};return Zn(t,n,fi,or)(e)}var zEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),HEt=function(e){zEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="heatmap",n}return t.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{valueFormatter:"~s"},axis:{y:{title:null,grid:!0},x:{title:null,grid:!0}},children:[{type:"point",interaction:{elementHighlight:{background:!0}}}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return BEt},t}(qn);function WEt(e){var t=function(n){var r=n.options.boxType,i=r===void 0?"box":r;return n.options.children[0].type=i,n};return Zn(t,fi,or)(e)}var VEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),UEt=function(e){VEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="box",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"box"}],axis:{y:{title:!1},x:{title:!1}},tooltip:{items:[{name:"min",channel:"y"},{name:"q1",channel:"y1"},{name:"q2",channel:"y2"},{name:"q3",channel:"y3"},{name:"max",channel:"y4"}]}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return WEt},t}(qn);function qEt(e){var t=function(n){var r=n.options,i=r.data,o=[{type:"custom",callback:function(s){return{links:s}}}];if(ir(i))i.length>0?Qt(r,"data",{value:i,transform:o}):delete r.children;else if(Mr(i,"type")==="fetch"&&Mr(i,"value")){var a=Mr(i,"transform");ir(a)?Qt(i,"transform",a.concat(o)):Qt(i,"transform",o)}return n};return Zn(t,fi,or)(e)}var GEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),KEt=function(e){GEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="sankey",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"sankey"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return qEt},t}(qn),$l=function(){return $l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},$l.apply(this,arguments)},B$=["#f0efff","#5B8FF9","#3D76DD"];function rj(e,t,n,r){r===void 0&&(r=!0);var i=0,o=!1,a=Om(e,function(s){var l,c,u=Mr(s,[t]);if(NCt(u))return[];if(uve(u)){var f=Number(u);return isNaN(f)?[]:(l={},l[n]=s[n],l[t]=f,l)}return ir(u)?(o=!0,i=Math.max(i,u.length),Om(r?u.sort(function(d,h){return h-d}):u,function(d,h){var p;return p={},p[n]=s[n],p[t]=d,p.index=h,p})):(i=Math.max(1,i),c={},c[n]=s[n],c[t]=u,c)}).flat();return o?[a.map(function(s){return $l({index:0},s)}),i]:[a,i]}function ij(e,t){return new Array(e).fill("").map(function(n,r){return ir(t)?t[r%t.length]:t})}function YEt(e){var t=function(i){var o=i.options,a=o.color,s=o.rangeField,l=s===void 0?"ranges":s,c=o.measureField,u=c===void 0?"measures":c,f=o.targetField,d=f===void 0?"targets":f,h=o.xField,p=h===void 0?"title":h,v=o.mapField,g=o.data,m=rj(g,l,p),y=m[0],x=m[1],S=rj(g,u,p,!1),w=S[0],C=S[1],O=rj(g,d,p,!1),E=O[0],_=O[1],$=Mr(a,[l],B$[0]),P=Mr(a,[u],B$[1]),T=Mr(a,[d],B$[2]),I=[ij(x,$),ij(C,P),ij(_,T)].flat();return i.options.children=Om(i.options.children,function(M,R){var N=[y,w,E][R],k=[l,u,d][R];return $l($l({},M),{data:N,encode:$l($l({},M.encode||{}),{x:p,y:k,color:function(A){var j=A.index,D=Em(j)?"".concat(k,"_").concat(j):k;return v?Mr(v,[k,j],D):D}}),style:$l($l({},M.style||{}),{zIndex:function(A){return-A[k]}}),labels:R!==0?Om(M.labels,function(A){return $l($l({},A),{text:k})}):void 0})}),i.options.scale.color.range=I,i.options.legend.color.itemMarker=function(M){return v&&MCt(v==null?void 0:v[d],M)||(M==null?void 0:M.replace(/\_\d$/,""))===d?"line":"square"},i},n=function(i){var o=i.options.layout,a=o===void 0?"horizontal":o;return a!=="horizontal"&&Qt(i,"options.children[2].shapeField","hyphen"),i},r=function(i){var o=i.options,a=o.range,s=a===void 0?{}:a,l=o.measure,c=l===void 0?{}:l,u=o.target,f=u===void 0?{}:u,d=o.children;return i.options.children=[s,c,f].map(function(h,p){return Zf(d[p],h)}),i};return Zn(t,n,r,kOt,or)(e)}var XEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZEt=function(e){XEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="bullet",n}return t.getDefaultOptions=function(){return{type:"view",scale:{color:{range:B$}},legend:{color:{itemMarker:function(n){return n==="target"?"line":"square"}}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval",style:{maxWidth:30},axis:{y:{grid:!0,gridLineWidth:2}}},{type:"interval",style:{maxWidth:20},transform:[{type:"stackY"}]},{type:"point",encode:{size:8,shape:"line"}}],interaction:{tooltip:{shared:!0}},coordinate:{transform:[{type:"transpose"}]}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return YEt},t}(qn);function QEt(e){var t=function(n){var r=n.options.data;return n.options.data={value:r},n};return Zn(t,fi,or)(e)}var JEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),e_t=function(e){JEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="Gauge",n}return t.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"gauge"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return QEt},t}(qn);function t_t(e){var t=function(n){var r=n.options.percent;return Em(r)&&Qt(n,"options.data",r),n};return Zn(t,fi,or)(e)}var n_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),r_t=function(e){n_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="Liquid",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"liquid"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return t_t},t}(qn);function i_t(e){return Zn(fi,or)(e)}var o_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),a_t=function(e){o_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="WordCloud",n}return t.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"wordCloud"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return i_t},t}(qn);function s_t(e){var t=function(n){var r=n.options,i=r.data;return i&&Qt(r,"data",{value:i}),n};return Zn(t,fi,or)(e)}var l_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),c_t=function(e){l_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="treemap",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"treemap"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return s_t},t}(qn),ep=function(){return ep=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ep.apply(this,arguments)};function u_t(e){var t=function(i){var o=i.options,a=o.startAngle,s=o.maxAngle,l=o.coordinate,c=Em(a)?a/(2*Math.PI)*360:-90,u=Em(s)?(Number(s)+c)/180*Math.PI:Math.PI;return Qt(i,["options","coordinate"],ep(ep({},l),{endAngle:u,startAngle:a!=null?a:-Math.PI/2})),i},n=function(i){var o=i.options,a=o.tooltip,s=o.xField,l=o.yField,c=Cx(s),u=Cx(l);return a||Qt(o,"tooltip",{title:!1,items:[function(f,d,h){return{name:c(f,d,h),value:u(f,d,h)}}]}),i},r=function(i){var o=i.options,a=o.markBackground,s=o.children,l=o.scale,c=o.coordinate,u=o.xField,f=Mr(l,"y.domain",[]);return a&&s.unshift(ep({type:"interval",xField:u,yField:f[f.length-1],colorField:a.color,scale:{color:{type:"identity"}},style:{fillOpacity:a.opacity,fill:a.color?void 0:"#e0e4ee"},coordinate:ep(ep({},c),{startAngle:-Math.PI/2,endAngle:1.5*Math.PI}),animate:!1},a)),i};return Zn(t,n,r,fi,or)(e)}var f_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),d_t=function(e){f_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="radial",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"radial",innerRadius:.1,outerRadius:1,endAngle:Math.PI},animate:{enter:{type:"waveIn",duration:800}},axis:{y:{nice:!0,labelAutoHide:!0,labelAutoRotate:!1},x:{title:!1,nice:!0,labelAutoRotate:!1,labelAutoHide:{type:"equidistance",cfg:{minGap:6}}}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return u_t},t}(qn);function h_t(e){return Zn(or)(e)}var p_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),v_t=function(e){p_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="CirclePacking",n}return t.getDefaultOptions=function(){return{legend:!1,type:"view",children:[{type:"pack"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return h_t},t}(qn),z$=function(){return z$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},z$.apply(this,arguments)};function g_t(e){var t=function(n){var r=n.options,i=r.xField,o=r.yField,a=r.seriesField,s=r.children,l=s==null?void 0:s.map(function(c){return z$(z$({},c),{xField:i,yField:o,seriesField:a,colorField:a,data:c.type==="density"?{transform:[{type:"kde",field:o,groupBy:[i,a]}]}:c.data})}).filter(function(c){return r.violinType!=="density"||c.type==="density"});return Qt(r,"children",l),r.violinType==="polar"&&Qt(r,"coordinate",{type:"polar"}),Qt(r,"violinType",void 0),n};return Zn(t,fi,or)(e)}var m_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),y_t=function(e){m_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="violin",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"density",sizeField:"size",tooltip:!1},{type:"boxplot",shapeField:"violin",style:{opacity:.5,point:!1}}],animate:{enter:{type:"fadeIn"}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return g_t},t}(qn),_x=function(){return _x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},_x.apply(this,arguments)},b_t=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};function x_t(e){var t=function(o){var a=o.options,s=a.yField,l=a.children;return l.forEach(function(c,u){Qt(c,"yField",s[u])}),o},n=function(o){var a=o.options,s=a.yField,l=a.children,c=a.data;if(ML(c))return o;var u=ir(Mr(c,[0]))?c:[c,c];return l.forEach(function(f,d){Qt(f,"data",b_t([],u[d].map(function(h){return _x({groupKey:s[d]},h)}),!0))}),o},r=function(o){var a=o.options,s=a.yField,l=s[0],c=s[1],u=a.tooltip;return u||Qt(a,"tooltip",{items:[{field:l,value:l},{field:c,value:c}]}),o},i=function(o){var a=o.options,s=a.children,l=a.layout,c=a.coordinate.transform,u=a.paddingBottom,f=u===void 0?Ove:u,d=a.paddingLeft,h=d===void 0?Ove:d,p=a.axis;Qt(a,"axisText",_x(_x({},(p==null?void 0:p.x)||{}),{layout:l}));var v=s[0],g=s[1];if(l==="vertical")Qt(a,"direction","col"),Qt(a,"paddingLeft",h),Qt(a,"coordinate.transform",c.filter(function(w){return w.type!=="transpose"})),Qt(v,"paddingBottom",Cve),Qt(g,"paddingTop",Cve),Qt(g,"axis",{x:{position:"top"}}),Qt(g,"scale",{y:{range:[0,1]}});else{Qt(a,"paddingBottom",f),Qt(v,"scale",{y:{range:[0,1]}});var m=v.paddingRight,y=m===void 0?XL:m,x=g.paddingLeft,S=x===void 0?XL:x;Qt(v,"paddingRight",y),Qt(v,"axis",{x:{position:"right"}}),Qt(g,"paddingLeft",S)}return o};return Zn(t,n,r,i,fi,or)(e)}var S_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),w_t=function(e){S_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="BidirectionalBar",n}return t.getDefaultOptions=function(){return{type:"spaceFlex",coordinate:{transform:[{type:"transpose"}]},scale:{y:{nice:!0}},direction:"row",layout:"horizontal",legend:!1,axis:{y:{title:!1},x:{title:!1,label:!1}},children:[{type:"interval"},{type:"interval"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return x_t},t}(qn),tp;(function(e){e.color="key",e.d="path"})(tp||(tp={}));function C_t(e){var t=function(n){var r=n.options,i=r.data,o=r.setsField,a=r.sizeField;return ir(i)&&(Qt(r,"data",{type:"inline",value:i,transform:[{type:"venn",sets:o,size:a,as:[tp.color,tp.d]}]}),Qt(r,"colorField",o),Qt(r,["children","0","encode","d"],tp.d)),Qt(n,"options",zL(r,["sizeField","setsField"])),n};return Zn(t,or)(e)}var O_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),E_t=function(e){O_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="venn",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"path"}],legend:{color:{itemMarker:"circle"}},encode:{color:tp.color,d:tp.d}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return C_t},t}(qn);function __t(e){var t=function(n){return n};return Zn(t,or)(e)}var $_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),P_t=function(e){$_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="Sunburst",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"sunburst"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return __t},t}(qn),M_t={Base:IOt,Line:ZOt,Column:WOt,Pie:eEt,Area:jOt,Bar:BOt,DualAxes:$ve,Funnel:KOt,Scatter:rEt,Radar:aEt,Rose:REt,Stock:pEt,TinyLine:mEt,TinyArea:xEt,TinyColumn:CEt,TinyProgress:_Et,TinyRing:MEt,Waterfall:LEt,Histogram:FEt,Heatmap:HEt,Box:UEt,Sankey:KEt,Bullet:ZEt,Gauge:e_t,Liquid:r_t,WordCloud:a_t,Treemap:c_t,RadialBar:d_t,CirclePacking:v_t,Violin:y_t,BidirectionalBar:w_t,Venn:E_t,Mix:$ve,Sunburst:P_t},oj=function(){return oj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},oj.apply(this,arguments)},Pve=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},$x=b.forwardRef(function(e,t){var n=e.chartType,r=n===void 0?"Base":n,i=Pve(e,["chartType"]),o=i.containerStyle,a=o===void 0?{height:"inherit",flex:1}:o,s=i.containerAttributes,l=s===void 0?{}:s,c=i.className,u=i.loading,f=i.loadingTemplate,d=i.errorTemplate,h=Pve(i,["containerStyle","containerAttributes","className","loading","loadingTemplate","errorTemplate"]),p=GCt(M_t[r],h),v=p.chart,g=p.container;return b.useImperativeHandle(t,function(){return v.current}),ge.createElement(K1t,{errorTemplate:d},u&&ge.createElement(q1t,{loadingTemplate:f}),ge.createElement("div",oj({className:c,style:a,ref:g},l)))}),aj=function(){return aj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},aj.apply(this,arguments)},T_t=b.forwardRef(function(e,t){return ge.createElement($x,aj({},e,{chartType:"Area",ref:t}))}),sj=function(){return sj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},sj.apply(this,arguments)},I_t=b.forwardRef(function(e,t){return ge.createElement($x,sj({},e,{chartType:"Bar",ref:t}))}),lj=function(){return lj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},lj.apply(this,arguments)},R_t=b.forwardRef(function(e,t){return ge.createElement($x,lj({},e,{chartType:"Column",ref:t}))}),cj=function(){return cj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},cj.apply(this,arguments)},N_t=b.forwardRef(function(e,t){return ge.createElement($x,cj({},e,{chartType:"Line",ref:t}))}),uj=function(){return uj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},uj.apply(this,arguments)},k_t=b.forwardRef(function(e,t){return ge.createElement($x,uj({},e,{chartType:"Pie",ref:t}))});const{useToken:A_t}=Xy,L_t=({widget:e})=>{const{t}=ao("DashboardWidget"),{token:n}=A_t(),[r,i]=ge.useState(),[o,a]=ge.useState(),[s,l]=ge.useState(),c=Zv.stringify({min_x_field:h1(r),max_x_field:h1(o),period_x_field:h1(s)}),{data:u,isLoading:f}=vc({queryKey:["/dashboard-widget"],queryFn:()=>Uc(`/dashboard-widget/${e.key}?${c}`),refetchOnWindowFocus:!1});b.useEffect(()=>{u&&(i(p1(u.min_x_field)),a(p1(u.max_x_field)),l(p1(u.period_x_field)))},[u]);const d=b.useCallback((h,p,v,g)=>{if(!h.x_field_filter_widget_type)return null;const[m,y]=JR(h.x_field_filter_widget_type,t),x=S=>{m===br||m===br.TextArea||m===af.Group?g(S.target.value):g(S)};return ce.jsx(m,un(Le(Le({size:"small",placeholder:p},y||{}),h.x_field_filter_widget_props||{}),{value:v,onChange:x}))},[t]);return ce.jsxs(Iv,{title:ce.jsxs(oi,{justify:"space-between",style:{lineHeight:2},children:[ce.jsx(jn,{children:e.title}),e.x_field_filter_widget_type&&ce.jsx(jn,{children:ce.jsxs(Di,{children:[e.x_field_periods&&ce.jsx(Mi,{allowClear:!0,style:{width:100},options:e.x_field_periods.map(h=>({label:WC(h),value:h})),value:s,onChange:l,size:"small"}),d(e,t("From"),r,i),ce.jsx(Qw,{}),d(e,t("To"),o,a)]})})]}),children:[!f&&e.dashboard_widget_type===Jv.ChartLine&&ce.jsx(N_t,{data:(u==null?void 0:u.results)||[],xField:e.x_field,yField:e.y_field,seriesField:e.series_field,legend:{position:"top-left"},color:n.colorPrimary}),!f&&e.dashboard_widget_type===Jv.ChartArea&&ce.jsx(T_t,{data:(u==null?void 0:u.results)||[],xField:e.x_field,yField:e.y_field,seriesField:e.series_field,legend:{position:"top-left"}}),!f&&e.dashboard_widget_type===Jv.ChartColumn&&ce.jsx(R_t,{data:(u==null?void 0:u.results)||[],xField:e.x_field,yField:e.y_field,seriesField:e.series_field,legend:{position:"top-left"},color:n.colorPrimary}),!f&&e.dashboard_widget_type===Jv.ChartBar&&ce.jsx(I_t,{data:(u==null?void 0:u.results)||[],xField:e.x_field,yField:e.y_field,seriesField:e.series_field,legend:{position:"top-left"},color:n.colorPrimary}),!f&&e.dashboard_widget_type===Jv.ChartPie&&ce.jsx(k_t,{data:(u==null?void 0:u.results)||[],colorField:e.x_field,angleField:e.y_field,legend:{position:"top-left"}}),f&&ce.jsx(oi,{justify:"center",align:"middle",children:ce.jsx(jn,{children:ce.jsx(tC,{})})})]},e.title)},j_t=()=>{const{t:e}=ao("Dashboard"),{configuration:t}=b.useContext(pl);return ce.jsxs(VC,{title:e("Dashboard"),children:[ce.jsx(oi,{gutter:[16,16],children:t.dashboard_widgets.map(n=>ce.jsx(jn,{xs:24,md:12,children:ce.jsx(L_t,{widget:n})},n.title))}),t.dashboard_widgets.length===0&&ce.jsx(io,{})]})},D_t=()=>{var j,D;const{configuration:e}=b.useContext(pl),t=Gv(),{t:n}=ao("List"),{model:r}=IC(),i=f1(),o=e.models.find(L=>L.name===r),{defaultPage:a,defaultPageSize:s,page:l,setPage:c,pageSize:u,setPageSize:f,search:d,setSearch:h,filters:p,setFilters:v,sortBy:g,action:m,setAction:y,selectedRowKeys:x,setSelectedRowKeys:S,onTableChange:w,resetTable:C}=RQ(o),O=Zv.stringify(Le({search:d,sort_by:g,offset:(l-1)*u,limit:u},$R(p))),{data:E,isLoading:_,refetch:$}=vc({queryKey:[`/list/${r}`,O],queryFn:()=>Uc(`/list/${r}?${O}`),refetchOnWindowFocus:!1}),{mutate:P}=Ko({mutationFn:L=>xR(`/delete/${r}/${L}`),onSuccess:()=>{C(o==null?void 0:o.preserve_filters),$(),Ti.success(n("Successfully deleted"))},onError:L=>{Fl(L)}}),{mutate:T,isPending:I}=Ko({mutationFn:L=>qc(`/action/${r}/${m}`,L),onSuccess:()=>{C(o==null?void 0:o.preserve_filters),$(),Ti.success(n("Successfully applied"))},onError:()=>{Ti.error(n("Server error"))}}),M=L=>S(L),R=b.useCallback(()=>T({ids:x}),[T,x]),N=b.useCallback(()=>t(`/add/${r}`),[r,t]),k=e==null?void 0:e.datetime_format,A=IQ(o,k,b.useCallback(L=>p[L],[p]),b.useCallback((L,F)=>{p[L]=F,v(Le({},p)),c(a),f(s)},[a,s,p,v,c,f]),b.useCallback(L=>{delete p[L],v(Le({},p)),c(a),f(s)},[a,s,p,v,c,f]),b.useCallback(L=>{P(L.id)},[P]),b.useCallback(L=>{t(`/change/${r}/${L.id}`)},[r,t]));return ce.jsx(VC,{title:o?Ka(o,!0):"",breadcrumbs:ce.jsx(My,{items:[{title:ce.jsx(vf,{to:"/",children:n("Dashboard")})},{title:ce.jsx(vf,{to:`/list/${r}`,children:o&&Ka(o)})}]}),viewOnSite:o==null?void 0:o.view_on_site,headerActions:ce.jsxs(oi,{style:{marginTop:10,marginBottom:10},gutter:[8,8],children:[((o==null?void 0:o.actions)||[]).length>0&&(o==null?void 0:o.actions_on_top)&&ce.jsxs(jn,{children:[ce.jsx(Mi,{placeholder:n("Select Action By"),allowClear:!0,value:m,onChange:y,style:{width:300},children:((o==null?void 0:o.actions)||[]).map(L=>ce.jsx(Mi.Option,{value:L.name,children:L.description||L.name},L.name))}),ce.jsx(yn,{disabled:!m||x.length===0,style:{marginLeft:5},loading:I,onClick:R,children:n("Apply")})]}),((o==null?void 0:o.search_fields)||[]).length>0&&ce.jsx(jn,{children:ce.jsx(br.Search,{placeholder:(o==null?void 0:o.search_help_text)||n("Search By"),allowClear:!0,onSearch:h,style:{width:200}})}),((j=o==null?void 0:o.permissions)==null?void 0:j.includes(Ya.Export))&&ce.jsx(jn,{children:ce.jsx(hZ,{model:r,search:d,filters:p,sortBy:g})}),((D=o==null?void 0:o.permissions)==null?void 0:D.includes(Ya.Add))&&ce.jsx(jn,{children:ce.jsxs(yn,{onClick:N,children:[ce.jsx(nR,{})," ",n("Add")]})})]}),bottomActions:ce.jsx(ce.Fragment,{children:((o==null?void 0:o.actions)||[]).length>0&&(o==null?void 0:o.actions_on_bottom)&&ce.jsxs("div",{style:{marginTop:i?10:-50},children:[ce.jsx(Mi,{placeholder:n("Select Action By"),allowClear:!0,value:m,onChange:y,style:{width:200},children:((o==null?void 0:o.actions)||[]).map(L=>ce.jsx(Mi.Option,{value:L.name,children:L.description||L.name},L.name))}),ce.jsx(yn,{disabled:!m||x.length===0,style:{marginLeft:5},loading:I,onClick:R,children:n("Apply")})]})}),children:o?ce.jsx(pZ,{loading:_,rowSelection:((o==null?void 0:o.actions)||[]).length>0?{selectedRowKeys:x,onChange:M}:void 0,columns:A,onChange:w,rowKey:"id",dataSource:(E==null?void 0:E.results)||[],pagination:{current:l,pageSize:u,total:E==null?void 0:E.total,showSizeChanger:!0}}):ce.jsx(io,{description:n("No permissions for model")})})},F_t=({title:e,children:t})=>{const{signedIn:n}=b.useContext(d1),r=Gv();return b.useEffect(()=>{n&&r("/")},[r,n]),ce.jsxs("div",{style:{height:"100vh"},children:[ce.jsx(GI,{defaultTitle:e,children:ce.jsx("meta",{name:"description",content:e})}),ce.jsx(oi,{justify:"center",align:"middle",style:{height:"100%"},children:ce.jsx(jn,{xs:24,xl:8,children:t})})]})},B_t=()=>{const[e]=Jn.useForm(),{token:{colorPrimary:t}}=Xy.useToken(),{configuration:n}=b.useContext(pl),{signedInUserRefetch:r}=b.useContext(d1),{t:i}=ao("SignIn"),{mutate:o,isPending:a}=Ko({mutationFn:l=>qc("/sign-in",l),onSuccess:()=>{r()},onError:l=>{Fl(l,e)}}),s=l=>{o(l)};return ce.jsx(F_t,{title:`${i("Sign In")}`,children:ce.jsxs(Iv,{children:[ce.jsx(oi,{justify:"center",children:ce.jsx(jn,{children:ce.jsxs(Di,{style:{marginBottom:20},children:[ce.jsx(Jw,{src:window.SERVER_DOMAIN+n.site_sign_in_logo,height:80,alt:n.site_name,preview:!1}),ce.jsx("span",{style:{color:t,fontSize:36,fontWeight:600},children:n.site_name})]})})}),ce.jsxs(Jn,{initialValues:{remember:!0},onFinish:s,autoComplete:"off",layout:"vertical",children:[ce.jsx(Jn.Item,{label:WC((n==null?void 0:n.username_field)||"username"),name:"username",rules:[{required:!0}],children:ce.jsx(br,{})}),ce.jsx(Jn.Item,{label:"Password",name:"password",rules:[{required:!0}],children:ce.jsx(br.Password,{})}),ce.jsx(oi,{justify:"end",children:ce.jsx(jn,{children:ce.jsx(Jn.Item,{children:ce.jsx(yn,{type:"primary",htmlType:"submit",loading:a,children:i("Sign In")})})})})]})]})})},z_t=()=>{const{configuration:e}=b.useContext(pl),{t}=ao("App");return ce.jsxs(ov,{theme:{token:{colorPrimary:e.primary_color,colorLink:e.primary_color,colorLinkActive:e.primary_color,colorLinkHover:e.primary_color}},form:{validateMessages:{required:t("${label} is required."),types:{email:t("${label} is not valid."),number:t("${label} is not valid.")},number:{range:t("${label} must be between ${min} and ${max}")}}},children:[ce.jsxs(GI,{titleTemplate:"FastAPI Admin | %s",defaultTitle:t("FastAPI Admin"),children:[ce.jsx("meta",{name:"description",content:t("FastAPI Admin")}),ce.jsx("link",{rel:"icon",href:window.SERVER_DOMAIN+e.site_favicon})]}),ce.jsxs(eDe,{children:[ce.jsx(Kv,{path:"/sign-in",element:ce.jsx(B_t,{})}),ce.jsx(Kv,{path:"/",element:ce.jsx(j_t,{})}),ce.jsx(Kv,{path:"/list/:model",element:ce.jsx(D_t,{})}),ce.jsx(Kv,{path:"/add/:model",element:ce.jsx(hGe,{})}),ce.jsx(Kv,{path:"/change/:model/:id",element:ce.jsx(pGe,{})})]})]})},H_t=({children:e})=>ce.jsx(X9e,{children:ce.jsx(Y9e,{children:e})}),W_t=({children:e,client:t,i18n:n})=>ce.jsx(aDe,{children:ce.jsx(Bge,{client:t,children:ce.jsx(d7e,{i18n:n,children:ce.jsx(DY,{children:e})})})}),V_t=new Age;fo.init({interpolation:{escapeValue:!1}});const Mve=document.getElementById("root");if(!Mve)throw new Error("Root element not found");cP.createRoot(Mve).render(ce.jsx(ge.StrictMode,{children:ce.jsx(W_t,{client:V_t,locale:Po,i18n:fo,children:ce.jsx(H_t,{children:ce.jsx(z_t,{})})})}))});
|
755
|
+
`,n.classList.add("loading"),n.innerHTML="<div></div><div></div><div></div><div></div>",t.appendChild(r),t.appendChild(n)},q1t=function(e){var t=e.loadingTemplate,n=e.theme,r=n===void 0?"light":n,i=ge.useRef(null);ge.useEffect(function(){!t&&i.current&&U1t(i.current)},[]);var o=function(){return t||ge.createElement("div",{ref:i})};return ge.createElement("div",{className:"charts-loading-container",style:{position:"absolute",width:"100%",height:"100%",display:"flex",alignItems:"center",justifyContent:"center",left:0,top:0,zIndex:99,backgroundColor:r==="dark"?"rgb(20, 20, 20)":"rgb(255, 255, 255)"}},o())},G1t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),K1t=function(e){G1t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.state={hasError:!1},n.renderError=function(r){var i=n.props.errorTemplate;switch(r){default:return typeof i=="function"?i(r):i||ge.createElement("h5",null,"组件出错了,请核查后重试: ",r.message)}},n}return t.getDerivedStateFromError=function(n){return{hasError:!0,error:n}},t.getDerivedStateFromProps=function(n,r){return r.children!==n.children?{children:n.children,hasError:!1,error:void 0}:null},t.prototype.render=function(){return this.state.hasError?this.renderError(this.state.error):ge.createElement(b.Fragment,null,this.props.children)},t}(ge.Component),qhe=typeof global=="object"&&global&&global.Object===Object&&global,Y1t=typeof self=="object"&&self&&self.Object===Object&&self,Ol=qhe||Y1t||Function("return this")(),Hs=Ol.Symbol,Ghe=Object.prototype,X1t=Ghe.hasOwnProperty,Z1t=Ghe.toString,ux=Hs?Hs.toStringTag:void 0;function Q1t(e){var t=X1t.call(e,ux),n=e[ux];try{e[ux]=void 0;var r=!0}catch(o){}var i=Z1t.call(e);return r&&(t?e[ux]=n:delete e[ux]),i}var J1t=Object.prototype,ebt=J1t.toString;function tbt(e){return ebt.call(e)}var nbt="[object Null]",rbt="[object Undefined]",Khe=Hs?Hs.toStringTag:void 0;function cc(e){return e==null?e===void 0?rbt:nbt:Khe&&Khe in Object(e)?Q1t(e):tbt(e)}function Ta(e){return e!=null&&typeof e=="object"}var ibt="[object Symbol]";function fx(e){return typeof e=="symbol"||Ta(e)&&cc(e)==ibt}var obt=NaN;function Yhe(e){return typeof e=="number"?e:fx(e)?obt:+e}function b$(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var ir=Array.isArray,abt=1/0,Xhe=Hs?Hs.prototype:void 0,Zhe=Xhe?Xhe.toString:void 0;function x$(e){if(typeof e=="string")return e;if(ir(e))return b$(e,x$)+"";if(fx(e))return Zhe?Zhe.call(e):"";var t=e+"";return t=="0"&&1/e==-abt?"-0":t}function sbt(e,t){return function(n,r){var i;if(n===void 0&&r===void 0)return t;if(n!==void 0&&(i=n),r!==void 0){if(i===void 0)return r;typeof n=="string"||typeof r=="string"?(n=x$(n),r=x$(r)):(n=Yhe(n),r=Yhe(r)),i=e(n,r)}return i}}var lbt=/\s/;function cbt(e){for(var t=e.length;t--&&lbt.test(e.charAt(t)););return t}var ubt=/^\s+/;function fbt(e){return e&&e.slice(0,cbt(e)+1).replace(ubt,"")}function sa(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Qhe=NaN,dbt=/^[-+]0x[0-9a-f]+$/i,hbt=/^0b[01]+$/i,pbt=/^0o[0-7]+$/i,vbt=parseInt;function Jhe(e){if(typeof e=="number")return e;if(fx(e))return Qhe;if(sa(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=sa(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=fbt(e);var n=hbt.test(e);return n||pbt.test(e)?vbt(e.slice(2),n?2:8):dbt.test(e)?Qhe:+e}var epe=1/0,gbt=17976931348623157e292;function mbt(e){if(!e)return e===0?e:0;if(e=Jhe(e),e===epe||e===-epe){var t=e<0?-1:1;return t*gbt}return e===e?e:0}function tpe(e){var t=mbt(e),n=t%1;return t===t?n?t-n:t:0}function pL(e){return e}var ybt="[object AsyncFunction]",bbt="[object Function]",xbt="[object GeneratorFunction]",Sbt="[object Proxy]";function ym(e){if(!sa(e))return!1;var t=cc(e);return t==bbt||t==xbt||t==ybt||t==Sbt}var vL=Ol["__core-js_shared__"],npe=function(){var e=/[^.]+$/.exec(vL&&vL.keys&&vL.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function wbt(e){return!!npe&&npe in e}var Cbt=Function.prototype,Obt=Cbt.toString;function Kh(e){if(e!=null){try{return Obt.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var Ebt=/[\\^$.*+?()[\]{}|]/g,_bt=/^\[object .+?Constructor\]$/,$bt=Function.prototype,Pbt=Object.prototype,Mbt=$bt.toString,Tbt=Pbt.hasOwnProperty,Ibt=RegExp("^"+Mbt.call(Tbt).replace(Ebt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Rbt(e){if(!sa(e)||wbt(e))return!1;var t=ym(e)?Ibt:_bt;return t.test(Kh(e))}function Nbt(e,t){return e==null?void 0:e[t]}function Yh(e,t){var n=Nbt(e,t);return Rbt(n)?n:void 0}var dx=Yh(Ol,"WeakMap"),rpe=dx&&new dx,ipe=Object.create,gL=function(){function e(){}return function(t){if(!sa(t))return{};if(ipe)return ipe(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function kbt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function mL(){}var Abt=4294967295;function bm(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Abt,this.__views__=[]}bm.prototype=gL(mL.prototype),bm.prototype.constructor=bm;function ope(){}var ape=rpe?function(e){return rpe.get(e)}:ope,spe={},Lbt=Object.prototype,jbt=Lbt.hasOwnProperty;function S$(e){for(var t=e.name+"",n=spe[t],r=jbt.call(spe,t)?n.length:0;r--;){var i=n[r],o=i.func;if(o==null||o==e)return i.name}return t}function Yf(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}Yf.prototype=gL(mL.prototype),Yf.prototype.constructor=Yf;function yL(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}function Dbt(e){if(e instanceof bm)return e.clone();var t=new Yf(e.__wrapped__,e.__chain__);return t.__actions__=yL(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Fbt=Object.prototype,Bbt=Fbt.hasOwnProperty;function w$(e){if(Ta(e)&&!ir(e)&&!(e instanceof bm)){if(e instanceof Yf)return e;if(Bbt.call(e,"__wrapped__"))return Dbt(e)}return new Yf(e)}w$.prototype=mL.prototype,w$.prototype.constructor=w$;function lpe(e){var t=S$(e),n=w$[t];if(typeof n!="function"||!(t in bm.prototype))return!1;if(e===n)return!0;var r=ape(n);return!!r&&e===r[0]}var zbt=800,Hbt=16,Wbt=Date.now;function Vbt(e){var t=0,n=0;return function(){var r=Wbt(),i=Hbt-(r-n);if(n=r,i>0){if(++t>=zbt)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Ubt(e){return function(){return e}}var C$=function(){try{var e=Yh(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),qbt=C$?function(e,t){return C$(e,"toString",{configurable:!0,enumerable:!1,value:Ubt(t),writable:!0})}:pL,cpe=Vbt(qbt);function Gbt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}function Kbt(e,t,n,r){for(var i=e.length,o=n+-1;++o<i;)if(t(e[o],o,e))return o;return-1}function Ybt(e){return e!==e}function Xbt(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}function upe(e,t,n){return t===t?Xbt(e,t,n):Kbt(e,Ybt,n)}function Zbt(e,t){var n=e==null?0:e.length;return!!n&&upe(e,t,0)>-1}var Qbt=9007199254740991,Jbt=/^(?:0|[1-9]\d*)$/;function O$(e,t){var n=typeof e;return t=t==null?Qbt:t,!!t&&(n=="number"||n!="symbol"&&Jbt.test(e))&&e>-1&&e%1==0&&e<t}function E$(e,t,n){t=="__proto__"&&C$?C$(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function hx(e,t){return e===t||e!==e&&t!==t}var ext=Object.prototype,txt=ext.hasOwnProperty;function _$(e,t,n){var r=e[t];(!(txt.call(e,t)&&hx(r,n))||n===void 0&&!(t in e))&&E$(e,t,n)}function Xh(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],l=void 0;l===void 0&&(l=e[s]),i?E$(n,s,l):_$(n,s,l)}return n}var fpe=Math.max;function dpe(e,t,n){return t=fpe(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=fpe(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(a),kbt(e,this,s)}}function nxt(e,t){return cpe(dpe(e,t,pL),e+"")}var rxt=9007199254740991;function bL(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=rxt}function Xf(e){return e!=null&&bL(e.length)&&!ym(e)}function ixt(e,t,n){if(!sa(n))return!1;var r=typeof t;return(r=="number"?Xf(n)&&O$(t,n.length):r=="string"&&t in n)?hx(n[t],e):!1}function hpe(e){return nxt(function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&ixt(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t})}var oxt=Object.prototype;function $$(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||oxt;return e===n}function axt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var sxt="[object Arguments]";function ppe(e){return Ta(e)&&cc(e)==sxt}var vpe=Object.prototype,lxt=vpe.hasOwnProperty,cxt=vpe.propertyIsEnumerable,px=ppe(function(){return arguments}())?ppe:function(e){return Ta(e)&&lxt.call(e,"callee")&&!cxt.call(e,"callee")};function uxt(){return!1}var gpe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,mpe=gpe&&typeof module=="object"&&module&&!module.nodeType&&module,fxt=mpe&&mpe.exports===gpe,ype=fxt?Ol.Buffer:void 0,dxt=ype?ype.isBuffer:void 0,vx=dxt||uxt,hxt="[object Arguments]",pxt="[object Array]",vxt="[object Boolean]",gxt="[object Date]",mxt="[object Error]",yxt="[object Function]",bxt="[object Map]",xxt="[object Number]",Sxt="[object Object]",wxt="[object RegExp]",Cxt="[object Set]",Oxt="[object String]",Ext="[object WeakMap]",_xt="[object ArrayBuffer]",$xt="[object DataView]",Pxt="[object Float32Array]",Mxt="[object Float64Array]",Txt="[object Int8Array]",Ixt="[object Int16Array]",Rxt="[object Int32Array]",Nxt="[object Uint8Array]",kxt="[object Uint8ClampedArray]",Axt="[object Uint16Array]",Lxt="[object Uint32Array]",qr={};qr[Pxt]=qr[Mxt]=qr[Txt]=qr[Ixt]=qr[Rxt]=qr[Nxt]=qr[kxt]=qr[Axt]=qr[Lxt]=!0,qr[hxt]=qr[pxt]=qr[_xt]=qr[vxt]=qr[$xt]=qr[gxt]=qr[mxt]=qr[yxt]=qr[bxt]=qr[xxt]=qr[Sxt]=qr[wxt]=qr[Cxt]=qr[Oxt]=qr[Ext]=!1;function jxt(e){return Ta(e)&&bL(e.length)&&!!qr[cc(e)]}function xL(e){return function(t){return e(t)}}var bpe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,gx=bpe&&typeof module=="object"&&module&&!module.nodeType&&module,Dxt=gx&&gx.exports===bpe,SL=Dxt&&qhe.process,xm=function(){try{var e=gx&&gx.require&&gx.require("util").types;return e||SL&&SL.binding&&SL.binding("util")}catch(t){}}(),xpe=xm&&xm.isTypedArray,wL=xpe?xL(xpe):jxt,Fxt=Object.prototype,Bxt=Fxt.hasOwnProperty;function Spe(e,t){var n=ir(e),r=!n&&px(e),i=!n&&!r&&vx(e),o=!n&&!r&&!i&&wL(e),a=n||r||i||o,s=a?axt(e.length,String):[],l=s.length;for(var c in e)(t||Bxt.call(e,c))&&!(a&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||O$(c,l)))&&s.push(c);return s}function wpe(e,t){return function(n){return e(t(n))}}var zxt=wpe(Object.keys,Object),Hxt=Object.prototype,Wxt=Hxt.hasOwnProperty;function Vxt(e){if(!$$(e))return zxt(e);var t=[];for(var n in Object(e))Wxt.call(e,n)&&n!="constructor"&&t.push(n);return t}function Zh(e){return Xf(e)?Spe(e):Vxt(e)}var Uxt=Object.prototype,qxt=Uxt.hasOwnProperty,Cpe=hpe(function(e,t){if($$(t)||Xf(t)){Xh(t,Zh(t),e);return}for(var n in t)qxt.call(t,n)&&_$(e,n,t[n])});function Gxt(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var Kxt=Object.prototype,Yxt=Kxt.hasOwnProperty;function Xxt(e){if(!sa(e))return Gxt(e);var t=$$(e),n=[];for(var r in e)r=="constructor"&&(t||!Yxt.call(e,r))||n.push(r);return n}function mx(e){return Xf(e)?Spe(e,!0):Xxt(e)}var Zxt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Qxt=/^\w*$/;function CL(e,t){if(ir(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||fx(e)?!0:Qxt.test(e)||!Zxt.test(e)||t!=null&&e in Object(t)}var yx=Yh(Object,"create");function Jxt(){this.__data__=yx?yx(null):{},this.size=0}function e2t(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var t2t="__lodash_hash_undefined__",n2t=Object.prototype,r2t=n2t.hasOwnProperty;function i2t(e){var t=this.__data__;if(yx){var n=t[e];return n===t2t?void 0:n}return r2t.call(t,e)?t[e]:void 0}var o2t=Object.prototype,a2t=o2t.hasOwnProperty;function s2t(e){var t=this.__data__;return yx?t[e]!==void 0:a2t.call(t,e)}var l2t="__lodash_hash_undefined__";function c2t(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yx&&t===void 0?l2t:t,this}function Qh(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qh.prototype.clear=Jxt,Qh.prototype.delete=e2t,Qh.prototype.get=i2t,Qh.prototype.has=s2t,Qh.prototype.set=c2t;function u2t(){this.__data__=[],this.size=0}function P$(e,t){for(var n=e.length;n--;)if(hx(e[n][0],t))return n;return-1}var f2t=Array.prototype,d2t=f2t.splice;function h2t(e){var t=this.__data__,n=P$(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():d2t.call(t,n,1),--this.size,!0}function p2t(e){var t=this.__data__,n=P$(t,e);return n<0?void 0:t[n][1]}function v2t(e){return P$(this.__data__,e)>-1}function g2t(e,t){var n=this.__data__,r=P$(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function gu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}gu.prototype.clear=u2t,gu.prototype.delete=h2t,gu.prototype.get=p2t,gu.prototype.has=v2t,gu.prototype.set=g2t;var bx=Yh(Ol,"Map");function m2t(){this.size=0,this.__data__={hash:new Qh,map:new(bx||gu),string:new Qh}}function y2t(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function M$(e,t){var n=e.__data__;return y2t(t)?n[typeof t=="string"?"string":"hash"]:n.map}function b2t(e){var t=M$(this,e).delete(e);return this.size-=t?1:0,t}function x2t(e){return M$(this,e).get(e)}function S2t(e){return M$(this,e).has(e)}function w2t(e,t){var n=M$(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function mu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}mu.prototype.clear=m2t,mu.prototype.delete=b2t,mu.prototype.get=x2t,mu.prototype.has=S2t,mu.prototype.set=w2t;var C2t="Expected a function";function OL(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(C2t);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(OL.Cache||mu),n}OL.Cache=mu;var O2t=500;function E2t(e){var t=OL(e,function(r){return n.size===O2t&&n.clear(),r}),n=t.cache;return t}var _2t=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$2t=/\\(\\)?/g,P2t=E2t(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(_2t,function(n,r,i,o){t.push(i?o.replace($2t,"$1"):r||n)}),t});function EL(e){return e==null?"":x$(e)}function Sm(e,t){return ir(e)?e:CL(e,t)?[e]:P2t(EL(e))}var M2t=1/0;function wm(e){if(typeof e=="string"||fx(e))return e;var t=e+"";return t=="0"&&1/e==-M2t?"-0":t}function T$(e,t){t=Sm(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[wm(t[n++])];return n&&n==r?e:void 0}function Mr(e,t,n){var r=e==null?void 0:T$(e,t);return r===void 0?n:r}function _L(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}var Ope=Hs?Hs.isConcatSpreadable:void 0;function T2t(e){return ir(e)||px(e)||!!(Ope&&e&&e[Ope])}function I2t(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=T2t),i||(i=[]);++o<a;){var s=e[o];n(s)?_L(i,s):i[i.length]=s}return i}function R2t(e){var t=e==null?0:e.length;return t?I2t(e):[]}function $L(e){return cpe(dpe(e,void 0,R2t),e+"")}var PL=wpe(Object.getPrototypeOf,Object),N2t="[object Object]",k2t=Function.prototype,A2t=Object.prototype,Epe=k2t.toString,L2t=A2t.hasOwnProperty,j2t=Epe.call(Object);function ML(e){if(!Ta(e)||cc(e)!=N2t)return!1;var t=PL(e);if(t===null)return!0;var n=L2t.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Epe.call(n)==j2t}function D2t(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r<i;)o[r]=e[r+t];return o}var F2t=Ol.isFinite,B2t=Math.min;function z2t(e){var t=Math[e];return function(n,r){if(n=Jhe(n),r=r==null?0:B2t(tpe(r),292),r&&F2t(n)){var i=(EL(n)+"e").split("e"),o=t(i[0]+"e"+(+i[1]+r));return i=(EL(o)+"e").split("e"),+(i[0]+"e"+(+i[1]-r))}return t(n)}}var H2t=z2t("ceil");function W2t(){this.__data__=new gu,this.size=0}function V2t(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function U2t(e){return this.__data__.get(e)}function q2t(e){return this.__data__.has(e)}var G2t=200;function K2t(e,t){var n=this.__data__;if(n instanceof gu){var r=n.__data__;if(!bx||r.length<G2t-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new mu(r)}return n.set(e,t),this.size=n.size,this}function El(e){var t=this.__data__=new gu(e);this.size=t.size}El.prototype.clear=W2t,El.prototype.delete=V2t,El.prototype.get=U2t,El.prototype.has=q2t,El.prototype.set=K2t;function Y2t(e,t){return e&&Xh(t,Zh(t),e)}function X2t(e,t){return e&&Xh(t,mx(t),e)}var _pe=typeof exports=="object"&&exports&&!exports.nodeType&&exports,$pe=_pe&&typeof module=="object"&&module&&!module.nodeType&&module,Z2t=$pe&&$pe.exports===_pe,Ppe=Z2t?Ol.Buffer:void 0,Mpe=Ppe?Ppe.allocUnsafe:void 0;function Tpe(e,t){if(t)return e.slice();var n=e.length,r=Mpe?Mpe(n):new e.constructor(n);return e.copy(r),r}function Q2t(e,t){for(var n=-1,r=e==null?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function Ipe(){return[]}var J2t=Object.prototype,eSt=J2t.propertyIsEnumerable,Rpe=Object.getOwnPropertySymbols,TL=Rpe?function(e){return e==null?[]:(e=Object(e),Q2t(Rpe(e),function(t){return eSt.call(e,t)}))}:Ipe;function tSt(e,t){return Xh(e,TL(e),t)}var nSt=Object.getOwnPropertySymbols,Npe=nSt?function(e){for(var t=[];e;)_L(t,TL(e)),e=PL(e);return t}:Ipe;function rSt(e,t){return Xh(e,Npe(e),t)}function kpe(e,t,n){var r=t(e);return ir(e)?r:_L(r,n(e))}function IL(e){return kpe(e,Zh,TL)}function Ape(e){return kpe(e,mx,Npe)}var RL=Yh(Ol,"DataView"),NL=Yh(Ol,"Promise"),Cm=Yh(Ol,"Set"),Lpe="[object Map]",iSt="[object Object]",jpe="[object Promise]",Dpe="[object Set]",Fpe="[object WeakMap]",Bpe="[object DataView]",oSt=Kh(RL),aSt=Kh(bx),sSt=Kh(NL),lSt=Kh(Cm),cSt=Kh(dx),_l=cc;(RL&&_l(new RL(new ArrayBuffer(1)))!=Bpe||bx&&_l(new bx)!=Lpe||NL&&_l(NL.resolve())!=jpe||Cm&&_l(new Cm)!=Dpe||dx&&_l(new dx)!=Fpe)&&(_l=function(e){var t=cc(e),n=t==iSt?e.constructor:void 0,r=n?Kh(n):"";if(r)switch(r){case oSt:return Bpe;case aSt:return Lpe;case sSt:return jpe;case lSt:return Dpe;case cSt:return Fpe}return t});var uSt=Object.prototype,fSt=uSt.hasOwnProperty;function dSt(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&fSt.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var I$=Ol.Uint8Array;function kL(e){var t=new e.constructor(e.byteLength);return new I$(t).set(new I$(e)),t}function hSt(e,t){var n=t?kL(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var pSt=/\w*$/;function vSt(e){var t=new e.constructor(e.source,pSt.exec(e));return t.lastIndex=e.lastIndex,t}var zpe=Hs?Hs.prototype:void 0,Hpe=zpe?zpe.valueOf:void 0;function gSt(e){return Hpe?Object(Hpe.call(e)):{}}function Wpe(e,t){var n=t?kL(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var mSt="[object Boolean]",ySt="[object Date]",bSt="[object Map]",xSt="[object Number]",SSt="[object RegExp]",wSt="[object Set]",CSt="[object String]",OSt="[object Symbol]",ESt="[object ArrayBuffer]",_St="[object DataView]",$St="[object Float32Array]",PSt="[object Float64Array]",MSt="[object Int8Array]",TSt="[object Int16Array]",ISt="[object Int32Array]",RSt="[object Uint8Array]",NSt="[object Uint8ClampedArray]",kSt="[object Uint16Array]",ASt="[object Uint32Array]";function LSt(e,t,n){var r=e.constructor;switch(t){case ESt:return kL(e);case mSt:case ySt:return new r(+e);case _St:return hSt(e,n);case $St:case PSt:case MSt:case TSt:case ISt:case RSt:case NSt:case kSt:case ASt:return Wpe(e,n);case bSt:return new r;case xSt:case CSt:return new r(e);case SSt:return vSt(e);case wSt:return new r;case OSt:return gSt(e)}}function Vpe(e){return typeof e.constructor=="function"&&!$$(e)?gL(PL(e)):{}}var jSt="[object Map]";function DSt(e){return Ta(e)&&_l(e)==jSt}var Upe=xm&&xm.isMap,FSt=Upe?xL(Upe):DSt,BSt="[object Set]";function zSt(e){return Ta(e)&&_l(e)==BSt}var qpe=xm&&xm.isSet,HSt=qpe?xL(qpe):zSt,WSt=1,VSt=2,USt=4,Gpe="[object Arguments]",qSt="[object Array]",GSt="[object Boolean]",KSt="[object Date]",YSt="[object Error]",Kpe="[object Function]",XSt="[object GeneratorFunction]",ZSt="[object Map]",QSt="[object Number]",Ype="[object Object]",JSt="[object RegExp]",ewt="[object Set]",twt="[object String]",nwt="[object Symbol]",rwt="[object WeakMap]",iwt="[object ArrayBuffer]",owt="[object DataView]",awt="[object Float32Array]",swt="[object Float64Array]",lwt="[object Int8Array]",cwt="[object Int16Array]",uwt="[object Int32Array]",fwt="[object Uint8Array]",dwt="[object Uint8ClampedArray]",hwt="[object Uint16Array]",pwt="[object Uint32Array]",jr={};jr[Gpe]=jr[qSt]=jr[iwt]=jr[owt]=jr[GSt]=jr[KSt]=jr[awt]=jr[swt]=jr[lwt]=jr[cwt]=jr[uwt]=jr[ZSt]=jr[QSt]=jr[Ype]=jr[JSt]=jr[ewt]=jr[twt]=jr[nwt]=jr[fwt]=jr[dwt]=jr[hwt]=jr[pwt]=!0,jr[YSt]=jr[Kpe]=jr[rwt]=!1;function xx(e,t,n,r,i,o){var a,s=t&WSt,l=t&VSt,c=t&USt;if(n&&(a=i?n(e,r,i,o):n(e)),a!==void 0)return a;if(!sa(e))return e;var u=ir(e);if(u){if(a=dSt(e),!s)return yL(e,a)}else{var f=_l(e),d=f==Kpe||f==XSt;if(vx(e))return Tpe(e,s);if(f==Ype||f==Gpe||d&&!i){if(a=l||d?{}:Vpe(e),!s)return l?rSt(e,X2t(a,e)):tSt(e,Y2t(a,e))}else{if(!jr[f])return i?e:{};a=LSt(e,f,s)}}o||(o=new El);var h=o.get(e);if(h)return h;o.set(e,a),HSt(e)?e.forEach(function(g){a.add(xx(g,t,n,g,e,o))}):FSt(e)&&e.forEach(function(g,m){a.set(m,xx(g,t,n,m,e,o))});var p=c?l?Ape:IL:l?mx:Zh,v=u?void 0:p(e);return Gbt(v||e,function(g,m){v&&(m=g,g=e[m]),_$(a,m,xx(g,t,n,m,e,o))}),a}var vwt=1,gwt=4;function Xpe(e){return xx(e,vwt|gwt)}var mwt="__lodash_hash_undefined__";function ywt(e){return this.__data__.set(e,mwt),this}function bwt(e){return this.__data__.has(e)}function Sx(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new mu;++t<n;)this.add(e[t])}Sx.prototype.add=Sx.prototype.push=ywt,Sx.prototype.has=bwt;function xwt(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}function Zpe(e,t){return e.has(t)}var Swt=1,wwt=2;function Qpe(e,t,n,r,i,o){var a=n&Swt,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var c=o.get(e),u=o.get(t);if(c&&u)return c==t&&u==e;var f=-1,d=!0,h=n&wwt?new Sx:void 0;for(o.set(e,t),o.set(t,e);++f<s;){var p=e[f],v=t[f];if(r)var g=a?r(v,p,f,t,e,o):r(p,v,f,e,t,o);if(g!==void 0){if(g)continue;d=!1;break}if(h){if(!xwt(t,function(m,y){if(!Zpe(h,y)&&(p===m||i(p,m,n,r,o)))return h.push(y)})){d=!1;break}}else if(!(p===v||i(p,v,n,r,o))){d=!1;break}}return o.delete(e),o.delete(t),d}function Cwt(e){var t=-1,n=Array(e.size);return e.forEach(function(r,i){n[++t]=[i,r]}),n}function AL(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var Owt=1,Ewt=2,_wt="[object Boolean]",$wt="[object Date]",Pwt="[object Error]",Mwt="[object Map]",Twt="[object Number]",Iwt="[object RegExp]",Rwt="[object Set]",Nwt="[object String]",kwt="[object Symbol]",Awt="[object ArrayBuffer]",Lwt="[object DataView]",Jpe=Hs?Hs.prototype:void 0,LL=Jpe?Jpe.valueOf:void 0;function jwt(e,t,n,r,i,o,a){switch(n){case Lwt:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case Awt:return!(e.byteLength!=t.byteLength||!o(new I$(e),new I$(t)));case _wt:case $wt:case Twt:return hx(+e,+t);case Pwt:return e.name==t.name&&e.message==t.message;case Iwt:case Nwt:return e==t+"";case Mwt:var s=Cwt;case Rwt:var l=r&Owt;if(s||(s=AL),e.size!=t.size&&!l)return!1;var c=a.get(e);if(c)return c==t;r|=Ewt,a.set(e,t);var u=Qpe(s(e),s(t),r,i,o,a);return a.delete(e),u;case kwt:if(LL)return LL.call(e)==LL.call(t)}return!1}var Dwt=1,Fwt=Object.prototype,Bwt=Fwt.hasOwnProperty;function zwt(e,t,n,r,i,o){var a=n&Dwt,s=IL(e),l=s.length,c=IL(t),u=c.length;if(l!=u&&!a)return!1;for(var f=l;f--;){var d=s[f];if(!(a?d in t:Bwt.call(t,d)))return!1}var h=o.get(e),p=o.get(t);if(h&&p)return h==t&&p==e;var v=!0;o.set(e,t),o.set(t,e);for(var g=a;++f<l;){d=s[f];var m=e[d],y=t[d];if(r)var x=a?r(y,m,d,t,e,o):r(m,y,d,e,t,o);if(!(x===void 0?m===y||i(m,y,n,r,o):x)){v=!1;break}g||(g=d=="constructor")}if(v&&!g){var S=e.constructor,w=t.constructor;S!=w&&"constructor"in e&&"constructor"in t&&!(typeof S=="function"&&S instanceof S&&typeof w=="function"&&w instanceof w)&&(v=!1)}return o.delete(e),o.delete(t),v}var Hwt=1,eve="[object Arguments]",tve="[object Array]",R$="[object Object]",Wwt=Object.prototype,nve=Wwt.hasOwnProperty;function Vwt(e,t,n,r,i,o){var a=ir(e),s=ir(t),l=a?tve:_l(e),c=s?tve:_l(t);l=l==eve?R$:l,c=c==eve?R$:c;var u=l==R$,f=c==R$,d=l==c;if(d&&vx(e)){if(!vx(t))return!1;a=!0,u=!1}if(d&&!u)return o||(o=new El),a||wL(e)?Qpe(e,t,n,r,i,o):jwt(e,t,l,n,r,i,o);if(!(n&Hwt)){var h=u&&nve.call(e,"__wrapped__"),p=f&&nve.call(t,"__wrapped__");if(h||p){var v=h?e.value():e,g=p?t.value():t;return o||(o=new El),i(v,g,n,r,o)}}return d?(o||(o=new El),zwt(e,t,n,r,i,o)):!1}function N$(e,t,n,r,i){return e===t?!0:e==null||t==null||!Ta(e)&&!Ta(t)?e!==e&&t!==t:Vwt(e,t,n,r,N$,i)}var Uwt=1,qwt=2;function Gwt(e,t,n,r){var i=n.length,o=i;if(e==null)return!o;for(e=Object(e);i--;){var a=n[i];if(a[2]?a[1]!==e[a[0]]:!(a[0]in e))return!1}for(;++i<o;){a=n[i];var s=a[0],l=e[s],c=a[1];if(a[2]){if(l===void 0&&!(s in e))return!1}else{var u=new El,f;if(!(f===void 0?N$(c,l,Uwt|qwt,r,u):f))return!1}}return!0}function rve(e){return e===e&&!sa(e)}function Kwt(e){for(var t=Zh(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,rve(i)]}return t}function ive(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}function Ywt(e){var t=Kwt(e);return t.length==1&&t[0][2]?ive(t[0][0],t[0][1]):function(n){return n===e||Gwt(n,e,t)}}function Xwt(e,t){return e!=null&&t in Object(e)}function Zwt(e,t,n){t=Sm(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=wm(t[r]);if(!(o=e!=null&&n(e,a)))break;e=e[a]}return o||++r!=i?o:(i=e==null?0:e.length,!!i&&bL(i)&&O$(a,i)&&(ir(e)||px(e)))}function ove(e,t){return e!=null&&Zwt(e,t,Xwt)}var Qwt=1,Jwt=2;function eCt(e,t){return CL(e)&&rve(t)?ive(wm(e),t):function(n){var r=Mr(n,e);return r===void 0&&r===t?ove(n,e):N$(t,r,Qwt|Jwt)}}function tCt(e){return function(t){return t==null?void 0:t[e]}}function nCt(e){return function(t){return T$(t,e)}}function rCt(e){return CL(e)?tCt(wm(e)):nCt(e)}function jL(e){return typeof e=="function"?e:e==null?pL:typeof e=="object"?ir(e)?eCt(e[0],e[1]):Ywt(e):rCt(e)}function iCt(e,t,n,r){for(var i=-1,o=e==null?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function oCt(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var l=a[++i];if(n(o[l],l,o)===!1)break}return t}}var ave=oCt();function aCt(e,t){return e&&ave(e,t,Zh)}function sCt(e,t){return function(n,r){if(n==null)return n;if(!Xf(n))return e(n,r);for(var i=n.length,o=-1,a=Object(n);++o<i&&r(a[o],o,a)!==!1;);return n}}var sve=sCt(aCt);function lCt(e,t,n,r){return sve(e,function(i,o,a){t(r,i,n(i),a)}),r}function cCt(e,t){return function(n,r){var i=ir(n)?iCt:lCt,o=t?t():{};return i(n,e,jL(r),o)}}function DL(e,t,n){(n!==void 0&&!hx(e[t],n)||n===void 0&&!(t in e))&&E$(e,t,n)}function uCt(e){return Ta(e)&&Xf(e)}function FL(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}function fCt(e){return Xh(e,mx(e))}function dCt(e,t,n,r,i,o,a){var s=FL(e,n),l=FL(t,n),c=a.get(l);if(c){DL(e,n,c);return}var u=o?o(s,l,n+"",e,t,a):void 0,f=u===void 0;if(f){var d=ir(l),h=!d&&vx(l),p=!d&&!h&&wL(l);u=l,d||h||p?ir(s)?u=s:uCt(s)?u=yL(s):h?(f=!1,u=Tpe(l,!0)):p?(f=!1,u=Wpe(l,!0)):u=[]:ML(l)||px(l)?(u=s,px(s)?u=fCt(s):(!sa(s)||ym(s))&&(u=Vpe(l))):f=!1}f&&(a.set(l,u),i(u,l,r,o,a),a.delete(l)),DL(e,n,u)}function lve(e,t,n,r,i){e!==t&&ave(t,function(o,a){if(i||(i=new El),sa(o))dCt(e,t,a,n,lve,r,i);else{var s=r?r(FL(e,a),o,a+"",e,t,i):void 0;s===void 0&&(s=o),DL(e,a,s)}},mx)}var hCt=hpe(function(e,t,n,r){lve(e,t,n,r)});function pCt(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var vCt=sbt(function(e,t){return e/t},1);function gCt(e,t){var n=-1,r=Xf(e)?Array(e.length):[];return sve(e,function(i,o,a){r[++n]=t(i,o,a)}),r}function Om(e,t){var n=ir(e)?b$:gCt;return n(e,jL(t))}var mCt="Expected a function",yCt=8,bCt=32,xCt=128,SCt=256;function wCt(e){return $L(function(t){for(var n=t.length,r=n,i=Yf.prototype.thru;r--;){var o=t[r];if(typeof o!="function")throw new TypeError(mCt);if(i&&!a&&S$(o)=="wrapper")var a=new Yf([],!0)}for(r=a?r:n;++r<n;){o=t[r];var s=S$(o),l=s=="wrapper"?ape(o):void 0;l&&lpe(l[0])&&l[1]==(xCt|yCt|bCt|SCt)&&!l[4].length&&l[9]==1?a=a[S$(l[0])].apply(a,l[3]):a=o.length==1&&lpe(o)?a[s]():a.thru(o)}return function(){var c=arguments,u=c[0];if(a&&c.length==1&&ir(u))return a.plant(u).value();for(var f=0,d=n?t[f].apply(this,c):u;++f<n;)d=t[f].call(this,d);return d}})}var Zn=wCt(),CCt=Object.prototype,OCt=CCt.hasOwnProperty,cve=cCt(function(e,t,n){OCt.call(e,n)?e[n].push(t):E$(e,n,[t])}),ECt="[object String]";function uve(e){return typeof e=="string"||!ir(e)&&Ta(e)&&cc(e)==ECt}function _Ct(e,t){return b$(t,function(n){return e[n]})}function $Ct(e){return e==null?[]:_Ct(e,Zh(e))}var PCt=Math.max;function MCt(e,t,n,r){e=Xf(e)?e:$Ct(e),n=n&&!r?tpe(n):0;var i=e.length;return n<0&&(n=PCt(i+n,0)),uve(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&upe(e,t,n)>-1}function TCt(e,t){return t.length<2?e:T$(e,D2t(t,0,-1))}var ICt="[object Boolean]";function BL(e){return e===!0||e===!1||Ta(e)&&cc(e)==ICt}function fve(e,t){return N$(e,t)}var RCt="[object Number]";function Em(e){return typeof e=="number"||Ta(e)&&cc(e)==RCt}function NCt(e){return e==null}function kCt(e){return e===void 0}function ACt(e,t){return t=Sm(t,e),e=TCt(e,t),e==null||delete e[wm(pCt(t))]}function LCt(e){return ML(e)?void 0:e}var jCt=1,DCt=2,FCt=4,zL=$L(function(e,t){var n={};if(e==null)return n;var r=!1;t=b$(t,function(o){return o=Sm(o,e),r||(r=o.length>1),o}),Xh(e,Ape(e),n),r&&(n=xx(n,jCt|DCt|FCt,LCt));for(var i=t.length;i--;)ACt(n,t[i]);return n});function dve(e,t,n,r){if(!sa(e))return e;t=Sm(t,e);for(var i=-1,o=t.length,a=o-1,s=e;s!=null&&++i<o;){var l=wm(t[i]),c=n;if(l==="__proto__"||l==="constructor"||l==="prototype")return e;if(i!=a){var u=s[l];c=void 0,c===void 0&&(c=sa(u)?u:O$(t[i+1])?[]:{})}_$(s,l,c),s=s[l]}return e}function BCt(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=T$(e,a);n(s,a)&&dve(o,Sm(a,e),s)}return o}function zCt(e,t){return BCt(e,t,function(n,r){return ove(e,r)})}var hve=$L(function(e,t){return e==null?{}:zCt(e,t)});function Qt(e,t,n){return e==null?e:dve(e,t,n)}var HCt=1/0,WCt=Cm&&1/AL(new Cm([,-0]))[1]==HCt?function(e){return new Cm(e)}:ope,VCt=200;function UCt(e,t,n){var r=-1,i=Zbt,o=e.length,a=!0,s=[],l=s;if(o>=VCt){var c=t?null:WCt(e);if(c)return AL(c);a=!1,i=Zpe,l=new Sx}else l=t?[]:s;e:for(;++r<o;){var u=e[r],f=t?t(u):u;if(u=u!==0?u:0,a&&f===f){for(var d=l.length;d--;)if(l[d]===f)continue e;t&&l.push(f),s.push(u)}else i(l,f,n)||(l!==s&&l.push(f),s.push(u))}return s}function HL(e,t){return e&&e.length?UCt(e,jL(t)):[]}var qCt=function(e){var t=/react|\.jsx|children:\[\(|return\s+[A-Za-z0-9].createElement\((?!['"][g|circle|ellipse|image|rect|line|polyline|polygon|text|path|html|mesh]['"])([^\)])*,/i;return t.test(e)},WL=function(){return WL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},WL.apply(this,arguments)},pve=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function GCt(e,t){var n=b.useRef(),r=b.useRef(),i=b.useRef(null),o=t.onReady,a=t.onEvent,s=function(u,f){var d;u===void 0&&(u="image/png");var h=(d=i.current)===null||d===void 0?void 0:d.getElementsByTagName("canvas")[0];return h==null?void 0:h.toDataURL(u,f)},l=function(u,f,d){u===void 0&&(u="download"),f===void 0&&(f="image/png");var h=u;u.indexOf(".")===-1&&(h="".concat(u,".").concat(f.split("/")[1]));var p=s(f,d),v=document.createElement("a");return v.href=p,v.download=h,document.body.appendChild(v),v.click(),document.body.removeChild(v),v=null,h},c=function(u,f){f===void 0&&(f=!1);var d=Object.keys(u),h=f;d.forEach(function(p){var v=u[p];p==="tooltip"&&(h=!0),ym(v)&&qCt("".concat(v))?u[p]=function(){for(var g=[],m=0;m<arguments.length;m++)g[m]=arguments[m];return V1t(v.apply(void 0,g),h)}:ir(v)?v.forEach(function(g){c(g,h)}):sa(v)?c(v,h):h=f})};return b.useEffect(function(){if(n.current&&!fve(r.current,t)){var u=!1;if(r.current){var f=r.current;f.data;var d=pve(f,["data"]);t.data;var h=pve(t,["data"]);u=fve(d,h)}r.current=Xpe(t),u?n.current.changeData(Mr(t,"data")):(c(t),n.current.update(t),n.current.render())}},[t]),b.useEffect(function(){if(!i.current)return function(){return null};r.current||(r.current=Xpe(t)),c(t);var u=new e(i.current,WL({},t));u.toDataURL=s,u.downloadImage=l,u.render(),n.current=u,o&&o(u);var f=function(d){a&&a(u,d)};return u.on("*",f),function(){n.current&&(n.current.destroy(),n.current.off("*",f),n.current=void 0)}},[]),{chart:n,container:i}}const KCt={field:"value",size:[1,1],round:!1,padding:0,sort:(e,t)=>t.value-e.value,as:["x","y"],ignoreParentValue:!0},YCt="nodeIndex",wx="childNodeCount",XCt="nodeAncestor",VL="Invalid field: it must be a string!";function ZCt(e,t){const{field:n,fields:r}=e;if(Wr(n))return n;if(Hi(n))return console.warn(VL),n[0];if(console.warn(`${VL} will try to get fields instead.`),Wr(r))return r;if(Hi(r)&&r.length)return r[0];throw new TypeError(VL)}function QCt(e){const t=[];if(e&&e.each){let n,r;e.each(i=>{var o,a;i.parent!==n?(n=i.parent,r=0):r+=1;const s=WQ((((o=i.ancestors)===null||o===void 0?void 0:o.call(i))||[]).map(l=>t.find(c=>c.name===l.name)||l),({depth:l})=>l>0&&l<i.depth);i[XCt]=s,i[wx]=((a=i.children)===null||a===void 0?void 0:a.length)||0,i[YCt]=r,t.push(i)})}else e&&e.eachNode&&e.eachNode(n=>{t.push(n)});return t}function JCt(e,t){t=OGe({},KCt,t);const n=t.as;if(!Hi(n)||n.length!==2)throw new TypeError('Invalid as: it must be an array with 2 strings (e.g. [ "x", "y" ])!');let r;try{r=ZCt(t)}catch(l){console.warn(l)}const o=(l=>zst().size(t.size).round(t.round).padding(t.padding)(Yg(l).sum(c=>_1(c.children)?t.ignoreParentValue?0:c[r]-VQ(c.children,(u,f)=>u+f[r],0):c[r]).sort(t.sort)))(e),a=n[0],s=n[1];return o.each(l=>{var c,u;l[a]=[l.x0,l.x1,l.x1,l.x0],l[s]=[l.y1,l.y1,l.y0,l.y0],l.name=l.name||((c=l.data)===null||c===void 0?void 0:c.name)||((u=l.data)===null||u===void 0?void 0:u.label),l.data.name=l.name,["x0","x1","y0","y1"].forEach(f=>{n.indexOf(f)===-1&&delete l[f]})}),QCt(o)}var eOt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};const _m="sunburst",UL="markType",vve="path",k$="ancestor-node";function tOt(e){const{data:t,encode:n}=e,{color:r,value:i}=n,a=JCt(t,{field:i,type:"hierarchy.partition",as:["x","y"]}),s=[];return a.forEach(l=>{var c,u,f,d;if(l.depth===0)return null;let h=l.data.name;const p=[h];let v=Object.assign({},l);for(;v.depth>1;)h=`${(c=v.parent.data)===null||c===void 0?void 0:c.name} / ${h}`,p.unshift((u=v.parent.data)===null||u===void 0?void 0:u.name),v=v.parent;const g=Object.assign(Object.assign(Object.assign({},sN(l.data,[i])),{[vve]:h,[k$]:v.data.name}),l);r&&r!==k$&&(g[r]=l.data[r]||((d=(f=l.parent)===null||f===void 0?void 0:f.data)===null||d===void 0?void 0:d[r])),s.push(g)}),s.map(l=>{const c=l.x.slice(0,2),u=[l.y[2],l.y[0]];return c[0]===c[1]&&(u[0]=u[1]=(l.y[2]+l.y[0])/2),Object.assign(Object.assign({},l),{x:c,y:u,fillOpacity:Math.pow(.85,l.depth)})})}const gve={id:_m,encode:{x:"x",y:"y",key:vve,color:k$,value:"value"},axis:{x:!1,y:!1},style:{[UL]:_m,stroke:"#fff",lineWidth:.5,fillOpacity:"fillOpacity",[wx]:wx,depth:"depth"},state:{active:{zIndex:2,stroke:"#000"},inactive:{zIndex:1,stroke:"#fff"}},legend:!1,interaction:{drillDown:!0},coordinate:{type:"polar",innerRadius:.2}},mve=e=>{const{encode:t,data:n=[],legend:r}=e,i=eOt(e,["encode","data","legend"]),o=Object.assign(Object.assign({},i.coordinate),{innerRadius:Math.max(Hn(i,["coordinate","innerRadius"],.2),1e-5)}),a=Object.assign(Object.assign({},gve.encode),t),{value:s}=a,l=tOt({encode:a,data:n});return console.log(l,"rectData"),[Ue({},gve,Object.assign(Object.assign({type:"rect",data:l,encode:a,tooltip:{title:"path",items:[c=>({name:s,value:c[s]})]}},i),{coordinate:o}))]};mve.props={};var nOt=function(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?o(u.value):i(u.value).then(s,l)}c((r=r.apply(e,t||[])).next())})};const rOt=e=>e.querySelectorAll(".element").filter(t=>Hn(t,["style",UL])===_m);function iOt(e){return Jt(e).select(`.${Ab}`).node()}const oOt={rootText:"root",style:{fill:"rgba(0, 0, 0, 0.85)",fontSize:12,y:1},active:{fill:"rgba(0, 0, 0, 0.5)"}};function aOt(e={}){const{breadCrumb:t={},isFixedColor:n=!1}=e,r=Ue({},oOt,t);return i=>{const{update:o,setState:a,container:s,view:l,options:c}=i,u=s.ownerDocument,f=iOt(s),d=c.marks.find(({id:x})=>x===_m),{state:h}=d,p=u.createElement("g");f.appendChild(p);const v=(x,S)=>nOt(this,void 0,void 0,function*(){if(p.removeChildren(),x){const w=u.createElement("text",{style:Object.assign({x:0,text:r.rootText,depth:0},r.style)});p.appendChild(w);let C="";const O=x==null?void 0:x.split(" / ");let E=r.style.y,_=p.getBBox().width;const $=f.getBBox().width,P=O.map((T,I)=>{const M=u.createElement("text",{style:Object.assign(Object.assign({x:_,text:" / "},r.style),{y:E})});p.appendChild(M),_+=M.getBBox().width,C=`${C}${T} / `;const R=u.createElement("text",{name:C.replace(/\s\/\s$/,""),style:Object.assign(Object.assign({text:T,x:_,depth:I+1},r.style),{y:E})});return p.appendChild(R),_+=R.getBBox().width,_>$&&(E=p.getBBox().height,_=0,M.attr({x:_,y:E}),_+=M.getBBox().width,R.attr({x:_,y:E}),_+=R.getBBox().width),R});[w,...P].forEach((T,I)=>{if(I===P.length)return;const M=Object.assign({},T.attributes);T.attr("cursor","pointer"),T.addEventListener("mouseenter",()=>{T.attr(r.active)}),T.addEventListener("mouseleave",()=>{T.attr(M)}),T.addEventListener("click",()=>{v(T.name,Hn(T,["style","depth"]))})})}a("drillDown",w=>{const{marks:C}=w,O=C.map(E=>{if(E.id!==_m&&E.type!=="rect")return E;const{data:_}=E,$=Object.fromEntries(["color"].map(T=>[T,{domain:l.scale[T].getOptions().domain}])),P=_.filter(T=>{const I=T.path;return n||(T[k$]=I.split(" / ")[S]),x?new RegExp(`^${x}.+`).test(I):!0});return Ue({},E,n?{data:P,scale:$}:{data:P})});return Object.assign(Object.assign({},w),{marks:O})}),yield o()}),g=x=>{const S=x.target;if(Hn(S,["style",UL])!==_m||Hn(S,["markType"])!=="rect"||!Hn(S,["style",wx]))return;const w=Hn(S,["__data__","key"]),C=Hn(S,["style","depth"]);S.style.cursor="pointer",v(w,C)};f.addEventListener("click",g);const m=oN(Object.assign(Object.assign({},h.active),h.inactive)),y=()=>{rOt(f).forEach(S=>{const w=Hn(S,["style",wx]);if(Hn(S,["style","cursor"])!=="pointer"&&w){S.style.cursor="pointer";const O=sN(S.attributes,m);S.addEventListener("mouseenter",()=>{S.attr(h.active)}),S.addEventListener("mouseleave",()=>{S.attr(Ue(O,h.inactive))})}})};return f.addEventListener("mousemove",y),()=>{p.remove(),f.removeEventListener("click",g),f.removeEventListener("mousemove",y)}}}function sOt(){return{"interaction.drillDown":aOt,"mark.sunburst":mve}}var A$=function(){return A$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},A$.apply(this,arguments)},lOt=c1t(j1t,A$(A$({},Nhe()),sOt())),or=function(e){var t=uOt(e),n=t.children,r=n===void 0?[]:n,i=zL(t,[].concat(xve,L$.map(function(c){return c.key}))),o=function(c){var u;return(u=vOt.find(function(f){return f.key===c}))===null||u===void 0?void 0:u.callback},a=function(c,u,f){var d=o(u);d?d(c,u,f):c[u]=Zf({},c[u],f)},s=function(c){Object.keys(c).forEach(function(u){if(c[u]){var f=L$.find(function(p){return p.key===u});if(f){var d=f.type,h=f.extend_keys;d?r.push(l(Zf({},hve(c,h),{type:d},c[u]))):ir(c[u])&&c[u].forEach(function(p){r.push(l(p))})}}})},l=function(c){return s(c),Object.keys(GL).forEach(function(u){var f=GL[u];if(!kCt(c[u]))if(sa(f)){var d=f.value,h=f.target,p=d(c[u]);a(c,h,p)}else Qt(c,f,c[u])}),c};return r.forEach(function(c){var u=Zf({},i,c);l(Zf(c,u))}),s(t),cOt(t),e},yve=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},cOt=function(e){var t=e.children,n=t===void 0?[]:t,r=Object.keys(GL).concat(L$.map(function(i){return i.key}));return r.forEach(function(i){delete e[i]}),n.forEach(function(i){Object.keys(i).forEach(function(o){r.includes(o)&&delete i[o]})}),Object.keys(e).forEach(function(i){yve(yve([],xve,!0),YL.map(function(o){return o.key}),!0).includes(i)||delete e[i]}),e},uOt=function(e){var t=e.options,n=t.children,r=n===void 0?[]:n;return r.forEach(function(i){Object.keys(i).forEach(function(o){ir(i[o])&&o!=="data"&&(i[o]=i[o].filter(function(a){return!a[qL]}))})}),t},bve=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))},fOt=function(e,t){if(ir(t))return t},Zf=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return hCt.apply(void 0,bve(bve([],e,!1),[fOt],!1))};function Cx(e){switch(typeof e){case"function":return e;case"string":return function(t){return Mr(t,[e])};default:return function(){return e}}}var Ox=function(){return Ox=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ox.apply(this,arguments)},dOt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},hOt=["renderer"],xve=["width","height","autoFit","theme","inset","insetLeft","insetRight","insetTop","insetBottom","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","margin","marginTop","marginRight","marginBottom","marginLeft","depth","title","clip","children","type","data","direction"],qL="__transform__",pOt="__skipDelCustomKeys__",Jh=function(e,t){return BL(t)?{type:e,available:t}:Ox({type:e},t)},GL={xField:"encode.x",yField:"encode.y",colorField:"encode.color",angleField:"encode.y",keyField:"encode.key",sizeField:"encode.size",shapeField:"encode.shape",seriesField:"encode.series",positionField:"encode.position",textField:"encode.text",valueField:"encode.value",binField:"encode.x",srcField:"encode.src",linkColorField:"encode.linkColor",fontSizeField:"encode.fontSize",radius:"coordinate.outerRadius",innerRadius:"coordinate.innerRadius",startAngle:"coordinate.startAngle",endAngle:"coordinate.endAngle",focusX:"coordinate.focusX",focusY:"coordinate.focusY",distortionX:"coordinate.distortionX",distortionY:"coordinate.distortionY",visual:"coordinate.visual",stack:{target:"transform",value:function(e){return Jh("stackY",e)}},normalize:{target:"transform",value:function(e){return Jh("normalizeY",e)}},percent:{target:"transform",value:function(e){return Jh("normalizeY",e)}},group:{target:"transform",value:function(e){return Jh("dodgeX",e)}},sort:{target:"transform",value:function(e){return Jh("sortX",e)}},symmetry:{target:"transform",value:function(e){return Jh("symmetryY",e)}},diff:{target:"transform",value:function(e){return Jh("diffY",e)}},meta:{target:"scale",value:function(e){return e}},label:{target:"labels",value:function(e){return e}},shape:"style.shape",connectNulls:{target:"style",value:function(e){return BL(e)?{connect:e}:e}}},KL=["xField","yField","seriesField","colorField","keyField","positionField","meta","tooltip","animate","stack","normalize","percent","group","sort","symmetry","diff"],L$=[{key:"annotations",extend_keys:[]},{key:"line",type:"line",extend_keys:KL},{key:"point",type:"point",extend_keys:KL},{key:"area",type:"area",extend_keys:KL}],vOt=[{key:"transform",callback:function(e,t,n){var r;e[t]=e[t]||[];var i=n.available,o=i===void 0?!0:i,a=dOt(n,["available"]);if(o)e[t].push(Ox((r={},r[qL]=!0,r),a));else{var s=e[t].indexOf(function(l){return l.type===n.type});s!==-1&&e[t].splice(s,1)}}},{key:"labels",callback:function(e,t,n){var r;if(!n||ir(n)){e[t]=n||[];return}n.text||(n.text=e.yField),e[t]=e[t]||[],e[t].push(Ox((r={},r[qL]=!0,r),n))}}],YL=[{key:"conversionTag",shape:"ConversionTag"},{key:"axisText",shape:"BidirectionalBarAxisText"}],gOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),j$=function(){return j$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},j$.apply(this,arguments)},mOt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},Sve=function(e){gOt(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=mOt(n,["style"]);return e.call(this,j$({style:j$({text:"",fontSize:12,textBaseline:"middle",textAlign:"center",fill:"#000",fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",lineWidth:1},r)},i))||this}return t}(xl),yOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),D$=function(){return D$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},D$.apply(this,arguments)},bOt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},xOt=function(e){yOt(t,e);function t(n){n===void 0&&(n={});var r=n.style,i=bOt(n,["style"]);return e.call(this,D$({style:D$({fill:"#eee"},r)},i))||this}return t}(ub),SOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wve=function(e){SOt(t,e);function t(n,r,i){var o=e.call(this,{style:Zf(i,r)})||this;return o.chart=n,o}return t.prototype.connectedCallback=function(){this.render(this.attributes,this),this.bindEvents(this.attributes,this)},t.prototype.disconnectedCallback=function(){},t.prototype.attributeChangedCallback=function(n){},t.prototype.update=function(n,r){var i;return this.attr(Zf({},this.attributes,n||{})),(i=this.render)===null||i===void 0?void 0:i.call(this,this.attributes,this,r)},t.prototype.clear=function(){this.removeChildren()},t.prototype.getElementsLayout=function(){var n=this.chart.getContext().canvas,r=n.document.getElementsByClassName("element"),i=[];return r.forEach(function(o){var a=o.getBBox(),s=a.x,l=a.y,c=a.width,u=a.height,f=o.__data__;i.push({bbox:a,x:s,y:l,width:c,height:u,key:f.key,data:f})}),i},t.prototype.bindEvents=function(n,r){},t}(bE),wOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),F$=function(){return F$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},F$.apply(this,arguments)},COt=function(e){wOt(t,e);function t(n,r){return e.call(this,n,r,{type:t.tag})||this}return t.prototype.getConversionTagLayout=function(){var n=this.direction==="vertical",r=this.getElementsLayout(),i=r[0],o=i.x,a=i.y,s=i.height,l=i.width,c=i.data,u=["items",0,"value"],f=Mr(c,u),d=n?r[1].y-a-s:r[1].x-o-l,h=[],p=this.attributes,v=p.size,g=v===void 0?40:v,m=p.arrowSize,y=m===void 0?20:m,x=p.spacing,S=x===void 0?4:x;return r.forEach(function(w,C){if(C>0){var O=w.x,E=w.y,_=w.height,$=w.width,P=w.data,T=w.key,I=Mr(P,u),M=g/2;if(n){var R=O+$/2,N=E;h.push({points:[[R+M,N-d+S],[R+M,N-y-S],[R,N-S],[R-M,N-y-S],[R-M,N-d+S]],center:[R,N-d/2-S],width:d,value:[f,I],key:T})}else{var R=O,N=E+_/2;h.push({points:[[O-d+S,N-M],[O-y-S,N-M],[R-S,N],[O-y-S,N+M],[O-d+S,N+M]],center:[R-d/2-S,N],width:d,value:[f,I],key:T})}f=I}}),h},t.prototype.render=function(){this.setDirection(),this.drawConversionTag()},t.prototype.setDirection=function(){var n=this.chart.getCoordinate(),r=Mr(n,"options.transformations"),i="horizontal";r.forEach(function(o){o.includes("transpose")&&(i="vertical")}),this.direction=i},t.prototype.drawConversionTag=function(){var n=this,r=this.getConversionTagLayout(),i=this.attributes,o=i.style,a=i.text,s=a.style,l=a.formatter;r.forEach(function(c){var u=c.points,f=c.center,d=c.value,h=c.key,p=d[0],v=d[1],g=f[0],m=f[1],y=new xOt({style:F$({points:u,fill:"#eee"},o),id:"polygon-".concat(h)}),x=new Sve({style:F$({x:g,y:m,text:ym(l)?l(p,v):(v/p*100).toFixed(2)+"%"},s),id:"text-".concat(h)});n.appendChild(y),n.appendChild(x)})},t.prototype.update=function(){var n=this,r=this.getConversionTagLayout();r.forEach(function(i){var o=i.points,a=i.center,s=i.key,l=a[0],c=a[1],u=n.getElementById("polygon-".concat(s)),f=n.getElementById("text-".concat(s));u.setAttribute("points",o),f.setAttribute("x",l),f.setAttribute("y",c)})},t.tag="ConversionTag",t}(wve),XL=32,Cve=16,Ove=48,OOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ex=function(){return Ex=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Ex.apply(this,arguments)},EOt=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},_Ot=function(e){OOt(t,e);function t(n,r){return e.call(this,n,r,{type:t.tag})||this}return t.prototype.render=function(){this.drawText()},t.prototype.getBidirectionalBarAxisTextLayout=function(){var n=this.attributes.layout,r=n==="vertical",i=this.getElementsLayout(),o=r?HL(i,"x"):HL(i,"y"),a=["title"],s=[],l=this.chart.getContext().views,c=Mr(l,[0,"layout"]),u=c.width,f=c.height;return o.forEach(function(d){var h=d.x,p=d.y,v=d.height,g=d.width,m=d.data,y=d.key,x=Mr(m,a);r?s.push({x:h+g/2,y:f,text:x,key:y}):s.push({x:u,y:p+v/2,text:x,key:y})}),HL(s,"text").length!==s.length&&(s=Object.values(cve(s,"text")).map(function(d){var h,p=d.reduce(function(v,g){return v+(r?g.x:g.y)},0);return Ex(Ex({},d[0]),(h={},h[r?"x":"y"]=p/d.length,h))})),s},t.prototype.transformLabelStyle=function(n){var r={},i=/^label[A-Z]/;return Object.keys(n).forEach(function(o){i.test(o)&&(r[o.replace("label","").replace(/^[A-Z]/,function(a){return a.toLowerCase()})]=n[o])}),r},t.prototype.drawText=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout(),i=this.attributes,o=i.layout,a=i.labelFormatter,s=EOt(i,["layout","labelFormatter"]);r.forEach(function(l){var c=l.x,u=l.y,f=l.text,d=l.key,h=new Sve({style:Ex({x:c,y:u,text:ym(a)?a(f):f,wordWrap:!0,wordWrapWidth:o==="horizontal"?XL*2:120,maxLines:2,textOverflow:"ellipsis"},n.transformLabelStyle(s)),id:"text-".concat(d)});n.appendChild(h)})},t.prototype.update=function(){var n=this,r=this.getBidirectionalBarAxisTextLayout();r.forEach(function(i){var o=i.x,a=i.y,s=i.key,l=n.getElementById("text-".concat(s));l.setAttribute("x",o),l.setAttribute("y",a)})},t.tag="BidirectionalBarAxisText",t}(wve),$Ot={ConversionTag:COt,BidirectionalBarAxisText:_Ot},POt=function(){function e(t,n){this.container=new Map,this.chart=t,this.config=n,this.init()}return e.prototype.init=function(){var t=this;YL.forEach(function(n){var r,i=n.key,o=n.shape,a=t.config[i];if(a){var s=new $Ot[o](t.chart,a),l=t.chart.getContext().canvas;l.appendChild(s),t.container.set(i,s)}else(r=t.container.get(i))===null||r===void 0||r.clear()})},e.prototype.update=function(){var t=this;this.container.size&&YL.forEach(function(n){var r=n.key,i=t.container.get(r);i==null||i.update()})},e}(),MOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$m=function(){return $m=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},$m.apply(this,arguments)},Eve="data-chart-source-type",qn=function(e){MOt(t,e);function t(n,r){var i=e.call(this)||this;return i.container=typeof n=="string"?document.getElementById(n):n,i.options=i.mergeOption(r),i.createG2(),i.bindEvents(),i}return t.prototype.getChartOptions=function(){return $m($m({},hve(this.options,hOt)),{container:this.container})},t.prototype.getSpecOptions=function(){return this.type==="base"||this[pOt]?$m($m({},this.options),this.getChartOptions()):this.options},t.prototype.createG2=function(){if(!this.container)throw Error("The container is not initialized!");this.chart=new lOt(this.getChartOptions()),this.container.setAttribute(Eve,"Ant Design Charts")},t.prototype.bindEvents=function(){var n=this;this.chart&&this.chart.on("*",function(r){r!=null&&r.type&&n.emit(r.type,r)})},t.prototype.getBaseOptions=function(){return{type:"view",autoFit:!0}},t.prototype.getDefaultOptions=function(){},t.prototype.render=function(){var n=this;this.type!=="base"&&this.execAdaptor(),this.chart.options(this.getSpecOptions()),this.chart.render().then(function(){n.annotation=new POt(n.chart,n.options)}),this.bindSizeSensor()},t.prototype.update=function(n){this.options=this.mergeOption(n)},t.prototype.mergeOption=function(n){return Zf({},this.getBaseOptions(),this.getDefaultOptions(),n)},t.prototype.changeData=function(n){this.chart.changeData(n)},t.prototype.changeSize=function(n,r){this.chart.changeSize(n,r)},t.prototype.destroy=function(){this.chart.destroy(),this.off(),this.container.removeAttribute(Eve)},t.prototype.execAdaptor=function(){var n=this.getSchemaAdaptor();n({chart:this.chart,options:this.options})},t.prototype.triggerResize=function(){this.chart.forceFit()},t.prototype.bindSizeSensor=function(){var n=this,r=this.options.autoFit,i=r===void 0?!0:r;i&&this.chart.on(rr.AFTER_CHANGE_SIZE,function(){n.annotation.update()})},t}(_A),TOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),IOt=function(e){TOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="base",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"line"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return function(n){return n}},t}(qn),ZL=function(){return ZL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ZL.apply(this,arguments)};function ROt(e){var t=e.options,n=t.stack,r=t.tooltip,i=t.xField;if(!n)return e;var o=L$.map(function(s){return s.type}).filter(function(s){return!!s}),a=!1;return o.forEach(function(s){t[s]&&(a=!0,Qt(t,[s,"stack"],ZL({y1:"y"},typeof n=="object"?n:{})))}),a&&!BL(r)&&!r&&Qt(t,"tooltip",{title:i,items:[{channel:"y"}]}),e}function fi(e){return Zn(ROt)(e)}function NOt(e){var t=e.options.layout,n=t===void 0?"horizontal":t;return e.options.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}],e}function kOt(e){NOt(e);var t=e.options.layout,n=t===void 0?"horizontal":t;return e.options.children.forEach(function(r){var i;!((i=r==null?void 0:r.coordinate)===null||i===void 0)&&i.transform&&(r.coordinate.transform=n!=="horizontal"?void 0:[{type:"transpose"}])}),e}function AOt(e){return Zn(fi,or)(e)}var LOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jOt=function(e){LOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="area",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"area"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return AOt},t}(qn),Pm=function(){return Pm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Pm.apply(this,arguments)};function _ve(e){var t=function(n){var r=n.options;Mr(r,"children.length")>1&&Qt(r,"children",[{type:"interval"}]);var i=r.scale,o=r.markBackground,a=r.data,s=r.children,l=r.yField,c=Mr(i,"y.domain",[]);if(o&&c.length&&ir(a)){var u="domainMax",f=a.map(function(d){var h;return Pm(Pm({originData:Pm({},d)},zL(d,l)),(h={},h[u]=c[c.length-1],h))});s.unshift(Pm({type:"interval",data:f,yField:u,tooltip:!1,style:{fill:"#eee"},label:!1},o))}return n};return Zn(t,fi,or)(e)}var DOt=function(){var e=function(t,n){return function(r){var i=t.fill,o=i===void 0?"#2888FF":i,a=t.stroke,s=t.fillOpacity,l=s===void 0?1:s,c=t.strokeOpacity,u=c===void 0?.2:c,f=t.pitch,d=f===void 0?8:f,h=r[0],p=r[1],v=r[2],g=r[3],m=(p[1]-h[1])/2,y=n.document,x=y.createElement("g",{}),S=y.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+m],[v[0]-d,h[1]+m],g],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),w=y.createElement("polygon",{style:{points:[[h[0]-d,h[1]+m],p,v,[v[0]-d,h[1]+m]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),C=y.createElement("polygon",{style:{points:[h,[h[0]-d,h[1]+m],p,[h[0]+d,h[1]+m]],fill:o,fillOpacity:l-.2}});return x.appendChild(S),x.appendChild(w),x.appendChild(C),x}};Ahe("shape.interval.bar25D",e)},FOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();DOt();var BOt=function(e){FOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="Bar",n}return t.getDefaultOptions=function(){return{type:"view",coordinate:{transform:[{type:"transpose"}]},children:[{type:"interval"}],scale:{y:{nice:!0}},axis:{y:{title:!1},x:{title:!1}},interaction:{tooltip:{shared:!0},elementHighlight:{background:!0}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return _ve},t}(qn),zOt=function(){var e=function(t,n){return function(r){var i=t.fill,o=i===void 0?"#2888FF":i,a=t.stroke,s=t.fillOpacity,l=s===void 0?1:s,c=t.strokeOpacity,u=c===void 0?.2:c,f=t.pitch,d=f===void 0?8:f,h=r[1][0]-r[0][0],p=h/2+r[0][0],v=n.document,g=v.createElement("g",{}),m=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]+d],[p,r[3][1]+d],[r[3][0],r[3][1]]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u,inset:30}}),y=v.createElement("polygon",{style:{points:[[p,r[1][1]+d],[r[1][0],r[1][1]],[r[2][0],r[2][1]],[p,r[2][1]+d]],fill:o,fillOpacity:l,stroke:a,strokeOpacity:u}}),x=v.createElement("polygon",{style:{points:[[r[0][0],r[0][1]],[p,r[1][1]-d],[r[1][0],r[1][1]],[p,r[1][1]+d]],fill:o,fillOpacity:l-.2}});return g.appendChild(y),g.appendChild(m),g.appendChild(x),g}};Ahe("shape.interval.column25D",e)},HOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();zOt();var WOt=function(e){HOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="column",n}return t.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0},elementHighlight:{background:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return _ve},t}(qn);function VOt(e){var t=function(r){var i=r.options,o=i.children,a=o===void 0?[]:o,s=i.legend;return s&&a.forEach(function(l){if(!Mr(l,"colorField")){var c=Mr(l,"yField");Qt(l,"colorField",function(){return c})}}),r},n=function(r){var i=r.options,o=i.annotations,a=o===void 0?[]:o,s=i.children,l=s===void 0?[]:s,c=i.scale,u=!1;return Mr(c,"y.key")||l.forEach(function(f,d){if(!Mr(f,"scale.y.key")){var h="child".concat(d,"Scale");Qt(f,"scale.y.key",h);var p=f.annotations,v=p===void 0?[]:p;v.length>0&&(Qt(f,"scale.y.independent",!1),v.forEach(function(g){Qt(g,"scale.y.key",h)})),!u&&a.length>0&&Mr(f,"scale.y.independent")===void 0&&(u=!0,Qt(f,"scale.y.independent",!1),a.forEach(function(g){Qt(g,"scale.y.key",h)}))}}),r};return Zn(t,n,fi,or)(e)}var UOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$ve=function(e){UOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="DualAxes",n}return t.getDefaultOptions=function(){return{type:"view",axis:{y:{title:!1,tick:!1},x:{title:!1}},scale:{y:{independent:!0,nice:!0}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return VOt},t}(qn);function qOt(e){var t=function(o){var a=o.options,s=a.xField,l=a.colorField;return l||Qt(a,"colorField",s),o},n=function(o){var a=o.options,s=a.compareField,l=a.transform,c=a.isTransposed,u=c===void 0?!0:c,f=a.coordinate;return l||(s?Qt(a,"transform",[]):Qt(a,"transform",[{type:"symmetryY"}])),!f&&u&&Qt(a,"coordinate",{transform:[{type:"transpose"}]}),o},r=function(o){var a=o.options,s=a.compareField,l=a.seriesField,c=a.data,u=a.children,f=a.yField,d=a.isTransposed,h=d===void 0?!0:d;if(s||l){var p=Object.values(cve(c,function(v){return v[s||l]}));u[0].data=p[0],u.push({type:"interval",data:p[1],yField:function(v){return-v[f]}}),delete a.compareField,delete a.data}return l&&(Qt(a,"type","spaceFlex"),Qt(a,"ratio",[1,1]),Qt(a,"direction",h?"row":"col"),delete a.seriesField),o},i=function(o){var a=o.options,s=a.tooltip,l=a.xField,c=a.yField;return s||Qt(a,"tooltip",{title:!1,items:[function(u){return{name:u[l],value:u[c]}}]}),o};return Zn(t,n,r,i,fi,or)(e)}var GOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),KOt=function(e){GOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="column",n}return t.getDefaultOptions=function(){return{type:"view",scale:{x:{padding:0}},animate:{enter:{type:"fadeIn"}},axis:!1,shapeField:"funnel",label:{position:"inside",transform:[{type:"contrastReverse"}]},children:[{type:"interval"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return qOt},t}(qn);function YOt(e){return Zn(fi,or)(e)}var XOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZOt=function(e){XOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="line",n}return t.getDefaultOptions=function(){return{type:"view",scale:{y:{nice:!0}},interaction:{tooltip:{shared:!0}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"line"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return YOt},t}(qn),Qf=function(){return Qf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Qf.apply(this,arguments)};function QOt(e){var t=function(n){var r=n.options,i=r.angleField,o=r.data,a=r.label,s=r.tooltip,l=r.colorField,c=Cx(l);if(ir(o)){var u=o.reduce(function(d,h){return d+h[i]},0);if(u===0){var f=o.map(function(d){var h;return Qf(Qf({},d),(h={},h[i]=1,h))});Qt(r,"data",f),a&&Qt(r,"label",Qf(Qf({},a),{formatter:function(){return 0}})),s!==!1&&Qt(r,"tooltip",Qf(Qf({},s),{items:[function(d,h,p){return{name:c(d,h,p),value:0}}]}))}}return n};return Zn(t,or)(e)}var JOt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),eEt=function(e){JOt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="pie",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"theta"},transform:[{type:"stackY",reverse:!0}],animate:{enter:{type:"waveIn"}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return QOt},t}(qn);function tEt(e){return Zn(fi,or)(e)}var nEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),rEt=function(e){nEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="scatter",n}return t.getDefaultOptions=function(){return{axis:{y:{title:!1},x:{title:!1}},legend:{size:!1},children:[{type:"point"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return tEt},t}(qn);function iEt(e){var t=function(n){return Qt(n,"options.coordinate",{type:Mr(n,"options.coordinateType","polar")}),n};return Zn(t,or)(e)}var oEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),aEt=function(e){oEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="radar",n}return t.getDefaultOptions=function(){return{axis:{x:{grid:!0,line:!0},y:{zIndex:1,title:!1,line:!0,nice:!0}},meta:{x:{padding:.5,align:0}},interaction:{tooltip:{style:{crosshairsLineDash:[4,4]}}},children:[{type:"line"}],coordinateType:"polar"}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return iEt},t}(qn),yu=function(){return yu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},yu.apply(this,arguments)},sEt="__stock-range__",lEt="trend",cEt="up",uEt="down";function fEt(e){var t=function(r){var i=r.options,o=i.data,a=i.yField;return r.options.data=Om(o,function(s){var l=s&&yu({},s);if(Array.isArray(a)&&l){var c=a[0],u=a[1],f=a[2],d=a[3];l[lEt]=l[c]<=l[u]?cEt:uEt,l[sEt]=[l[c],l[u],l[f],l[d]]}return l}),r},n=function(r){var i=r.options,o=i.xField,a=i.yField,s=i.fallingFill,l=i.risingFill,c=a[0],u=a[1],f=a[2],d=a[3],h=Cx(o);return r.options.children=Om(r.options.children,function(p,v){var g=v===0;return yu(yu({},p),{tooltip:{title:function(m,y,x){var S=h(m,y,x);return S instanceof Date?S.toLocaleString():S},items:[{field:f},{field:d},{field:c},{field:u}]},encode:yu(yu({},p.encode||{}),{y:g?[f,d]:[c,u],color:function(m){return Math.sign(m[u]-m[c])}}),style:yu(yu({},p.style||{}),{lineWidth:g?1:10})})}),delete i.yField,r.options.legend={color:!1},s&&Qt(r,"options.scale.color.range[0]",s),l&&Qt(r,"options.scale.color.range[2]",l),r};return Zn(t,n,or)(e)}var dEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hEt=["#26a69a","#999999","#ef5350"],pEt=function(e){dEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="stock",n}return t.getDefaultOptions=function(){return{type:"view",scale:{color:{domain:[-1,0,1],range:hEt},y:{nice:!0}},children:[{type:"link"},{type:"link"}],axis:{x:{title:!1,grid:!1},y:{title:!1,grid:!0,gridLineDash:null}},animate:{enter:{type:"scaleInY"}},interaction:{tooltip:{shared:!0,marker:!1,groupName:!1,crosshairs:!0}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return fEt},t}(qn);function vEt(e){return Zn(fi,or)(e)}var gEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mEt=function(e){gEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="TinyLine",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"line",axis:!1}],animate:{enter:{type:"growInX",duration:500}},padding:0,margin:0,tooltip:!1}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return vEt},t}(qn);function yEt(e){return Zn(fi,or)(e)}var bEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xEt=function(e){bEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="TinyArea",n}return t.getDefaultOptions=function(){return{type:"view",animate:{enter:{type:"growInX",duration:500}},children:[{type:"area",axis:!1}],padding:0,margin:0,tooltip:!1}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return yEt},t}(qn);function SEt(e){return Zn(fi,or)(e)}var wEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),CEt=function(e){wEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="TinyColumn",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"interval",axis:!1}],padding:0,margin:0,tooltip:!1}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return SEt},t}(qn),QL=function(){return QL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},QL.apply(this,arguments)};function OEt(e){var t=function(n){var r=n.options,i=r.percent,o=r.color,a=o===void 0?[]:o;if(!i)return n;var s={scale:{color:{range:a.length?a:[]}},data:[1,i]};return Object.assign(r,QL({},s)),n};return Zn(t,fi,or)(e)}var EEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_Et=function(e){EEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="TinyProgress",n}return t.getDefaultOptions=function(){return{type:"view",data:[],margin:0,padding:0,tooltip:!1,children:[{interaction:{tooltip:!1},coordinate:{transform:[{type:"transpose"}]},type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return OEt},t}(qn),JL=function(){return JL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},JL.apply(this,arguments)};function $Et(e){var t=function(r){var i=r.options,o=i.radius,a=o===void 0?.8:o;return Qt(r,"options.coordinate.innerRadius",a),r},n=function(r){var i=r.options,o=i.percent,a=i.color,s=a===void 0?[]:a;if(!o)return r;var l={scale:{color:{range:s.length?s:[]}},data:[1,o]};return Object.assign(i,JL({},l)),r};return Zn(t,n,fi,or)(e)}var PEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),MEt=function(e){PEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="TinyRing",n}return t.getDefaultOptions=function(){return{type:"view",data:[],margin:0,padding:0,coordinate:{type:"theta"},animate:{enter:{type:"waveIn"}},interaction:{tooltip:!1},tooltip:!1,children:[{type:"interval",axis:!1,legend:!1,encode:{y:function(n){return n},color:function(n,r){return r}}}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return $Et},t}(qn);function TEt(e){return Zn(or)(e)}var IEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),REt=function(e){IEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="rose",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"polar"},animate:{enter:{type:"waveIn"}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return TEt},t}(qn),ej="__start__",Mm="__end__",tj="__waterfall_value__",nj=function(){return nj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},nj.apply(this,arguments)},NEt=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};function kEt(e){var t=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.yField;return a.length&&(a.reduce(function(l,c,u){var f,d=Cx(s),h=d(c,u,a);if(u===0||c.isTotal)c[ej]=0,c[Mm]=h,c[tj]=h;else{var p=(f=l[Mm])!==null&&f!==void 0?f:d(l,u,a);c[ej]=p,c[Mm]=p+h,c[tj]=l[Mm]}return c},[]),Object.assign(i,{yField:[ej,Mm]})),r},n=function(r){var i=r.options,o=i.data,a=o===void 0?[]:o,s=i.xField,l=i.children,c=i.linkStyle,u=NEt([],a,!0);return u.reduce(function(f,d,h){return h>0&&(d.x1=f[s],d.x2=d[s],d.y1=f[Mm]),d},[]),u.shift(),l.push({type:"link",xField:["x1","x2"],yField:"y1",zIndex:-1,data:u,style:nj({stroke:"#697474"},c),label:!1,tooltip:!1}),r};return Zn(t,n,fi,or)(e)}var AEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),LEt=function(e){AEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="waterfall",n}return t.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{field:tj,valueFormatter:"~s",name:"value"},axis:{y:{title:null,labelFormatter:"~s"},x:{title:null}},children:[{type:"interval",interaction:{elementHighlight:{background:!0}}}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return kEt},t}(qn);function jEt(e){var t=function(n){var r=n.options,i=r.data,o=r.binNumber,a=r.binWidth,s=r.children,l=r.channel,c=l===void 0?"count":l,u=Mr(s,"[0].transform[0]",{});return Em(a)?(Cpe(u,{thresholds:H2t(vCt(i.length,a)),y:c}),n):(Em(o)&&Cpe(u,{thresholds:o,y:c}),n)};return Zn(t,fi,or)(e)}var DEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),FEt=function(e){DEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="Histogram",n}return t.getDefaultOptions=function(){return{type:"view",autoFit:!0,axis:{y:{title:!1},x:{title:!1}},children:[{type:"rect",transform:[{type:"binX",y:"count"}],interaction:{elementHighlight:{background:!0}}}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return jEt},t}(qn);function BEt(e){var t=function(r){var i=r.options,o=i.tooltip,a=o===void 0?{}:o,s=i.colorField,l=i.sizeField;return a&&!a.field&&(a.field=s||l),r},n=function(r){var i=r.options,o=i.mark,a=i.children;return o&&(a[0].type=o),r};return Zn(t,n,fi,or)(e)}var zEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),HEt=function(e){zEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="heatmap",n}return t.getDefaultOptions=function(){return{type:"view",legend:null,tooltip:{valueFormatter:"~s"},axis:{y:{title:null,grid:!0},x:{title:null,grid:!0}},children:[{type:"point",interaction:{elementHighlight:{background:!0}}}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return BEt},t}(qn);function WEt(e){var t=function(n){var r=n.options.boxType,i=r===void 0?"box":r;return n.options.children[0].type=i,n};return Zn(t,fi,or)(e)}var VEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),UEt=function(e){VEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="box",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"box"}],axis:{y:{title:!1},x:{title:!1}},tooltip:{items:[{name:"min",channel:"y"},{name:"q1",channel:"y1"},{name:"q2",channel:"y2"},{name:"q3",channel:"y3"},{name:"max",channel:"y4"}]}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return WEt},t}(qn);function qEt(e){var t=function(n){var r=n.options,i=r.data,o=[{type:"custom",callback:function(s){return{links:s}}}];if(ir(i))i.length>0?Qt(r,"data",{value:i,transform:o}):delete r.children;else if(Mr(i,"type")==="fetch"&&Mr(i,"value")){var a=Mr(i,"transform");ir(a)?Qt(i,"transform",a.concat(o)):Qt(i,"transform",o)}return n};return Zn(t,fi,or)(e)}var GEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),KEt=function(e){GEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="sankey",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"sankey"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return qEt},t}(qn),$l=function(){return $l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},$l.apply(this,arguments)},B$=["#f0efff","#5B8FF9","#3D76DD"];function rj(e,t,n,r){r===void 0&&(r=!0);var i=0,o=!1,a=Om(e,function(s){var l,c,u=Mr(s,[t]);if(NCt(u))return[];if(uve(u)){var f=Number(u);return isNaN(f)?[]:(l={},l[n]=s[n],l[t]=f,l)}return ir(u)?(o=!0,i=Math.max(i,u.length),Om(r?u.sort(function(d,h){return h-d}):u,function(d,h){var p;return p={},p[n]=s[n],p[t]=d,p.index=h,p})):(i=Math.max(1,i),c={},c[n]=s[n],c[t]=u,c)}).flat();return o?[a.map(function(s){return $l({index:0},s)}),i]:[a,i]}function ij(e,t){return new Array(e).fill("").map(function(n,r){return ir(t)?t[r%t.length]:t})}function YEt(e){var t=function(i){var o=i.options,a=o.color,s=o.rangeField,l=s===void 0?"ranges":s,c=o.measureField,u=c===void 0?"measures":c,f=o.targetField,d=f===void 0?"targets":f,h=o.xField,p=h===void 0?"title":h,v=o.mapField,g=o.data,m=rj(g,l,p),y=m[0],x=m[1],S=rj(g,u,p,!1),w=S[0],C=S[1],O=rj(g,d,p,!1),E=O[0],_=O[1],$=Mr(a,[l],B$[0]),P=Mr(a,[u],B$[1]),T=Mr(a,[d],B$[2]),I=[ij(x,$),ij(C,P),ij(_,T)].flat();return i.options.children=Om(i.options.children,function(M,R){var N=[y,w,E][R],k=[l,u,d][R];return $l($l({},M),{data:N,encode:$l($l({},M.encode||{}),{x:p,y:k,color:function(A){var j=A.index,D=Em(j)?"".concat(k,"_").concat(j):k;return v?Mr(v,[k,j],D):D}}),style:$l($l({},M.style||{}),{zIndex:function(A){return-A[k]}}),labels:R!==0?Om(M.labels,function(A){return $l($l({},A),{text:k})}):void 0})}),i.options.scale.color.range=I,i.options.legend.color.itemMarker=function(M){return v&&MCt(v==null?void 0:v[d],M)||(M==null?void 0:M.replace(/\_\d$/,""))===d?"line":"square"},i},n=function(i){var o=i.options.layout,a=o===void 0?"horizontal":o;return a!=="horizontal"&&Qt(i,"options.children[2].shapeField","hyphen"),i},r=function(i){var o=i.options,a=o.range,s=a===void 0?{}:a,l=o.measure,c=l===void 0?{}:l,u=o.target,f=u===void 0?{}:u,d=o.children;return i.options.children=[s,c,f].map(function(h,p){return Zf(d[p],h)}),i};return Zn(t,n,r,kOt,or)(e)}var XEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ZEt=function(e){XEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="bullet",n}return t.getDefaultOptions=function(){return{type:"view",scale:{color:{range:B$}},legend:{color:{itemMarker:function(n){return n==="target"?"line":"square"}}},axis:{y:{title:!1},x:{title:!1}},children:[{type:"interval",style:{maxWidth:30},axis:{y:{grid:!0,gridLineWidth:2}}},{type:"interval",style:{maxWidth:20},transform:[{type:"stackY"}]},{type:"point",encode:{size:8,shape:"line"}}],interaction:{tooltip:{shared:!0}},coordinate:{transform:[{type:"transpose"}]}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return YEt},t}(qn);function QEt(e){var t=function(n){var r=n.options.data;return n.options.data={value:r},n};return Zn(t,fi,or)(e)}var JEt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),e_t=function(e){JEt(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="Gauge",n}return t.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"gauge"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return QEt},t}(qn);function t_t(e){var t=function(n){var r=n.options.percent;return Em(r)&&Qt(n,"options.data",r),n};return Zn(t,fi,or)(e)}var n_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),r_t=function(e){n_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="Liquid",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"liquid"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return t_t},t}(qn);function i_t(e){return Zn(fi,or)(e)}var o_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),a_t=function(e){o_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="WordCloud",n}return t.getDefaultOptions=function(){return{type:"view",legend:!1,children:[{type:"wordCloud"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return i_t},t}(qn);function s_t(e){var t=function(n){var r=n.options,i=r.data;return i&&Qt(r,"data",{value:i}),n};return Zn(t,fi,or)(e)}var l_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),c_t=function(e){l_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="treemap",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"treemap"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return s_t},t}(qn),ep=function(){return ep=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},ep.apply(this,arguments)};function u_t(e){var t=function(i){var o=i.options,a=o.startAngle,s=o.maxAngle,l=o.coordinate,c=Em(a)?a/(2*Math.PI)*360:-90,u=Em(s)?(Number(s)+c)/180*Math.PI:Math.PI;return Qt(i,["options","coordinate"],ep(ep({},l),{endAngle:u,startAngle:a!=null?a:-Math.PI/2})),i},n=function(i){var o=i.options,a=o.tooltip,s=o.xField,l=o.yField,c=Cx(s),u=Cx(l);return a||Qt(o,"tooltip",{title:!1,items:[function(f,d,h){return{name:c(f,d,h),value:u(f,d,h)}}]}),i},r=function(i){var o=i.options,a=o.markBackground,s=o.children,l=o.scale,c=o.coordinate,u=o.xField,f=Mr(l,"y.domain",[]);return a&&s.unshift(ep({type:"interval",xField:u,yField:f[f.length-1],colorField:a.color,scale:{color:{type:"identity"}},style:{fillOpacity:a.opacity,fill:a.color?void 0:"#e0e4ee"},coordinate:ep(ep({},c),{startAngle:-Math.PI/2,endAngle:1.5*Math.PI}),animate:!1},a)),i};return Zn(t,n,r,fi,or)(e)}var f_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),d_t=function(e){f_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="radial",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"interval"}],coordinate:{type:"radial",innerRadius:.1,outerRadius:1,endAngle:Math.PI},animate:{enter:{type:"waveIn",duration:800}},axis:{y:{nice:!0,labelAutoHide:!0,labelAutoRotate:!1},x:{title:!1,nice:!0,labelAutoRotate:!1,labelAutoHide:{type:"equidistance",cfg:{minGap:6}}}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return u_t},t}(qn);function h_t(e){return Zn(or)(e)}var p_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),v_t=function(e){p_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="CirclePacking",n}return t.getDefaultOptions=function(){return{legend:!1,type:"view",children:[{type:"pack"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return h_t},t}(qn),z$=function(){return z$=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},z$.apply(this,arguments)};function g_t(e){var t=function(n){var r=n.options,i=r.xField,o=r.yField,a=r.seriesField,s=r.children,l=s==null?void 0:s.map(function(c){return z$(z$({},c),{xField:i,yField:o,seriesField:a,colorField:a,data:c.type==="density"?{transform:[{type:"kde",field:o,groupBy:[i,a]}]}:c.data})}).filter(function(c){return r.violinType!=="density"||c.type==="density"});return Qt(r,"children",l),r.violinType==="polar"&&Qt(r,"coordinate",{type:"polar"}),Qt(r,"violinType",void 0),n};return Zn(t,fi,or)(e)}var m_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),y_t=function(e){m_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="violin",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"density",sizeField:"size",tooltip:!1},{type:"boxplot",shapeField:"violin",style:{opacity:.5,point:!1}}],animate:{enter:{type:"fadeIn"}}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return g_t},t}(qn),_x=function(){return _x=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},_x.apply(this,arguments)},b_t=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))};function x_t(e){var t=function(o){var a=o.options,s=a.yField,l=a.children;return l.forEach(function(c,u){Qt(c,"yField",s[u])}),o},n=function(o){var a=o.options,s=a.yField,l=a.children,c=a.data;if(ML(c))return o;var u=ir(Mr(c,[0]))?c:[c,c];return l.forEach(function(f,d){Qt(f,"data",b_t([],u[d].map(function(h){return _x({groupKey:s[d]},h)}),!0))}),o},r=function(o){var a=o.options,s=a.yField,l=s[0],c=s[1],u=a.tooltip;return u||Qt(a,"tooltip",{items:[{field:l,value:l},{field:c,value:c}]}),o},i=function(o){var a=o.options,s=a.children,l=a.layout,c=a.coordinate.transform,u=a.paddingBottom,f=u===void 0?Ove:u,d=a.paddingLeft,h=d===void 0?Ove:d,p=a.axis;Qt(a,"axisText",_x(_x({},(p==null?void 0:p.x)||{}),{layout:l}));var v=s[0],g=s[1];if(l==="vertical")Qt(a,"direction","col"),Qt(a,"paddingLeft",h),Qt(a,"coordinate.transform",c.filter(function(w){return w.type!=="transpose"})),Qt(v,"paddingBottom",Cve),Qt(g,"paddingTop",Cve),Qt(g,"axis",{x:{position:"top"}}),Qt(g,"scale",{y:{range:[0,1]}});else{Qt(a,"paddingBottom",f),Qt(v,"scale",{y:{range:[0,1]}});var m=v.paddingRight,y=m===void 0?XL:m,x=g.paddingLeft,S=x===void 0?XL:x;Qt(v,"paddingRight",y),Qt(v,"axis",{x:{position:"right"}}),Qt(g,"paddingLeft",S)}return o};return Zn(t,n,r,i,fi,or)(e)}var S_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),w_t=function(e){S_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="BidirectionalBar",n}return t.getDefaultOptions=function(){return{type:"spaceFlex",coordinate:{transform:[{type:"transpose"}]},scale:{y:{nice:!0}},direction:"row",layout:"horizontal",legend:!1,axis:{y:{title:!1},x:{title:!1,label:!1}},children:[{type:"interval"},{type:"interval"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return x_t},t}(qn),tp;(function(e){e.color="key",e.d="path"})(tp||(tp={}));function C_t(e){var t=function(n){var r=n.options,i=r.data,o=r.setsField,a=r.sizeField;return ir(i)&&(Qt(r,"data",{type:"inline",value:i,transform:[{type:"venn",sets:o,size:a,as:[tp.color,tp.d]}]}),Qt(r,"colorField",o),Qt(r,["children","0","encode","d"],tp.d)),Qt(n,"options",zL(r,["sizeField","setsField"])),n};return Zn(t,or)(e)}var O_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),E_t=function(e){O_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="venn",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"path"}],legend:{color:{itemMarker:"circle"}},encode:{color:tp.color,d:tp.d}}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return C_t},t}(qn);function __t(e){var t=function(n){return n};return Zn(t,or)(e)}var $_t=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),P_t=function(e){$_t(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type="Sunburst",n}return t.getDefaultOptions=function(){return{type:"view",children:[{type:"sunburst"}]}},t.prototype.getDefaultOptions=function(){return t.getDefaultOptions()},t.prototype.getSchemaAdaptor=function(){return __t},t}(qn),M_t={Base:IOt,Line:ZOt,Column:WOt,Pie:eEt,Area:jOt,Bar:BOt,DualAxes:$ve,Funnel:KOt,Scatter:rEt,Radar:aEt,Rose:REt,Stock:pEt,TinyLine:mEt,TinyArea:xEt,TinyColumn:CEt,TinyProgress:_Et,TinyRing:MEt,Waterfall:LEt,Histogram:FEt,Heatmap:HEt,Box:UEt,Sankey:KEt,Bullet:ZEt,Gauge:e_t,Liquid:r_t,WordCloud:a_t,Treemap:c_t,RadialBar:d_t,CirclePacking:v_t,Violin:y_t,BidirectionalBar:w_t,Venn:E_t,Mix:$ve,Sunburst:P_t},oj=function(){return oj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},oj.apply(this,arguments)},Pve=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},$x=b.forwardRef(function(e,t){var n=e.chartType,r=n===void 0?"Base":n,i=Pve(e,["chartType"]),o=i.containerStyle,a=o===void 0?{height:"inherit",flex:1}:o,s=i.containerAttributes,l=s===void 0?{}:s,c=i.className,u=i.loading,f=i.loadingTemplate,d=i.errorTemplate,h=Pve(i,["containerStyle","containerAttributes","className","loading","loadingTemplate","errorTemplate"]),p=GCt(M_t[r],h),v=p.chart,g=p.container;return b.useImperativeHandle(t,function(){return v.current}),ge.createElement(K1t,{errorTemplate:d},u&&ge.createElement(q1t,{loadingTemplate:f}),ge.createElement("div",oj({className:c,style:a,ref:g},l)))}),aj=function(){return aj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},aj.apply(this,arguments)},T_t=b.forwardRef(function(e,t){return ge.createElement($x,aj({},e,{chartType:"Area",ref:t}))}),sj=function(){return sj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},sj.apply(this,arguments)},I_t=b.forwardRef(function(e,t){return ge.createElement($x,sj({},e,{chartType:"Bar",ref:t}))}),lj=function(){return lj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},lj.apply(this,arguments)},R_t=b.forwardRef(function(e,t){return ge.createElement($x,lj({},e,{chartType:"Column",ref:t}))}),cj=function(){return cj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},cj.apply(this,arguments)},N_t=b.forwardRef(function(e,t){return ge.createElement($x,cj({},e,{chartType:"Line",ref:t}))}),uj=function(){return uj=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},uj.apply(this,arguments)},k_t=b.forwardRef(function(e,t){return ge.createElement($x,uj({},e,{chartType:"Pie",ref:t}))});const{useToken:A_t}=Xy,L_t=({widget:e})=>{const{t}=ao("DashboardWidget"),{token:n}=A_t(),[r,i]=ge.useState(),[o,a]=ge.useState(),[s,l]=ge.useState(),c=Zv.stringify({min_x_field:h1(r),max_x_field:h1(o),period_x_field:h1(s)}),{data:u,isLoading:f}=vc({queryKey:["/dashboard-widget",c],queryFn:()=>Uc(`/dashboard-widget/${e.key}?${c}`),refetchOnWindowFocus:!1});b.useEffect(()=>{u&&(i(p1(u.min_x_field)),a(p1(u.max_x_field)),l(p1(u.period_x_field)))},[u]);const d=b.useCallback((h,p,v,g)=>{if(!h.x_field_filter_widget_type)return null;const[m,y]=JR(h.x_field_filter_widget_type,t),x=S=>{switch(m){case br:case br.TextArea:case af.Group:g(S.target.value);break;default:g(S);break}};return ce.jsx(m,un(Le(Le({size:"small",placeholder:p},y||{}),h.x_field_filter_widget_props||{}),{value:v,onChange:x}))},[t]);return ce.jsxs(Iv,{title:ce.jsxs(oi,{justify:"space-between",style:{lineHeight:2},children:[ce.jsx(jn,{children:e.title}),e.x_field_filter_widget_type&&ce.jsx(jn,{children:ce.jsxs(Di,{children:[e.x_field_periods&&ce.jsx(Mi,{allowClear:!0,style:{width:100},options:e.x_field_periods.map(h=>({label:WC(h),value:h})),value:s,onChange:l,size:"small"}),d(e,t("From"),r,i),ce.jsx(Qw,{}),d(e,t("To"),o,a)]})})]}),children:[!f&&e.dashboard_widget_type===Jv.ChartLine&&ce.jsx(N_t,Le({data:(u==null?void 0:u.results)||[],xField:e.x_field,yField:e.y_field,legend:{position:"top-left"},colorField:n.colorPrimary},e.dashboard_widget_props||{})),!f&&e.dashboard_widget_type===Jv.ChartArea&&ce.jsx(T_t,Le({data:(u==null?void 0:u.results)||[],xField:e.x_field,yField:e.y_field,legend:{position:"top-left"},colorField:n.colorPrimary},e.dashboard_widget_props||{})),!f&&e.dashboard_widget_type===Jv.ChartColumn&&ce.jsx(R_t,Le({data:(u==null?void 0:u.results)||[],xField:e.x_field,yField:e.y_field,legend:{position:"top-left"},colorField:n.colorPrimary},e.dashboard_widget_props||{})),!f&&e.dashboard_widget_type===Jv.ChartBar&&ce.jsx(I_t,Le({data:(u==null?void 0:u.results)||[],xField:e.x_field,yField:e.y_field,legend:{position:"top-left"},colorField:n.colorPrimary},e.dashboard_widget_props||{})),!f&&e.dashboard_widget_type===Jv.ChartPie&&ce.jsx(k_t,Le({data:(u==null?void 0:u.results)||[],colorField:e.x_field,angleField:e.y_field,legend:{position:"top-left"}},e.dashboard_widget_props||{})),f&&ce.jsx(oi,{justify:"center",align:"middle",children:ce.jsx(jn,{children:ce.jsx(tC,{})})})]},e.title)},j_t=()=>{const{t:e}=ao("Dashboard"),{configuration:t}=b.useContext(pl);return ce.jsxs(VC,{title:e("Dashboard"),children:[ce.jsx(oi,{gutter:[16,16],children:t.dashboard_widgets.map(n=>ce.jsx(jn,{xs:24,md:12,children:ce.jsx(L_t,{widget:n})},n.title))}),t.dashboard_widgets.length===0&&ce.jsx(io,{})]})},D_t=()=>{var j,D;const{configuration:e}=b.useContext(pl),t=Gv(),{t:n}=ao("List"),{model:r}=IC(),i=f1(),o=e.models.find(L=>L.name===r),{defaultPage:a,defaultPageSize:s,page:l,setPage:c,pageSize:u,setPageSize:f,search:d,setSearch:h,filters:p,setFilters:v,sortBy:g,action:m,setAction:y,selectedRowKeys:x,setSelectedRowKeys:S,onTableChange:w,resetTable:C}=RQ(o),O=Zv.stringify(Le({search:d,sort_by:g,offset:(l-1)*u,limit:u},$R(p))),{data:E,isLoading:_,refetch:$}=vc({queryKey:[`/list/${r}`,O],queryFn:()=>Uc(`/list/${r}?${O}`),refetchOnWindowFocus:!1}),{mutate:P}=Ko({mutationFn:L=>xR(`/delete/${r}/${L}`),onSuccess:()=>{C(o==null?void 0:o.preserve_filters),$(),Ti.success(n("Successfully deleted"))},onError:L=>{Fl(L)}}),{mutate:T,isPending:I}=Ko({mutationFn:L=>qc(`/action/${r}/${m}`,L),onSuccess:()=>{C(o==null?void 0:o.preserve_filters),$(),Ti.success(n("Successfully applied"))},onError:()=>{Ti.error(n("Server error"))}}),M=L=>S(L),R=b.useCallback(()=>T({ids:x}),[T,x]),N=b.useCallback(()=>t(`/add/${r}`),[r,t]),k=e==null?void 0:e.datetime_format,A=IQ(o,k,b.useCallback(L=>p[L],[p]),b.useCallback((L,F)=>{p[L]=F,v(Le({},p)),c(a),f(s)},[a,s,p,v,c,f]),b.useCallback(L=>{delete p[L],v(Le({},p)),c(a),f(s)},[a,s,p,v,c,f]),b.useCallback(L=>{P(L.id)},[P]),b.useCallback(L=>{t(`/change/${r}/${L.id}`)},[r,t]));return ce.jsx(VC,{title:o?Ka(o,!0):"",breadcrumbs:ce.jsx(My,{items:[{title:ce.jsx(vf,{to:"/",children:n("Dashboard")})},{title:ce.jsx(vf,{to:`/list/${r}`,children:o&&Ka(o)})}]}),viewOnSite:o==null?void 0:o.view_on_site,headerActions:ce.jsxs(oi,{style:{marginTop:10,marginBottom:10},gutter:[8,8],children:[((o==null?void 0:o.actions)||[]).length>0&&(o==null?void 0:o.actions_on_top)&&ce.jsxs(jn,{children:[ce.jsx(Mi,{placeholder:n("Select Action By"),allowClear:!0,value:m,onChange:y,style:{width:300},children:((o==null?void 0:o.actions)||[]).map(L=>ce.jsx(Mi.Option,{value:L.name,children:L.description||L.name},L.name))}),ce.jsx(yn,{disabled:!m||x.length===0,style:{marginLeft:5},loading:I,onClick:R,children:n("Apply")})]}),((o==null?void 0:o.search_fields)||[]).length>0&&ce.jsx(jn,{children:ce.jsx(br.Search,{placeholder:(o==null?void 0:o.search_help_text)||n("Search By"),allowClear:!0,onSearch:h,style:{width:200}})}),((j=o==null?void 0:o.permissions)==null?void 0:j.includes(Ya.Export))&&ce.jsx(jn,{children:ce.jsx(hZ,{model:r,search:d,filters:p,sortBy:g})}),((D=o==null?void 0:o.permissions)==null?void 0:D.includes(Ya.Add))&&ce.jsx(jn,{children:ce.jsxs(yn,{onClick:N,children:[ce.jsx(nR,{})," ",n("Add")]})})]}),bottomActions:ce.jsx(ce.Fragment,{children:((o==null?void 0:o.actions)||[]).length>0&&(o==null?void 0:o.actions_on_bottom)&&ce.jsxs("div",{style:{marginTop:i?10:-50},children:[ce.jsx(Mi,{placeholder:n("Select Action By"),allowClear:!0,value:m,onChange:y,style:{width:200},children:((o==null?void 0:o.actions)||[]).map(L=>ce.jsx(Mi.Option,{value:L.name,children:L.description||L.name},L.name))}),ce.jsx(yn,{disabled:!m||x.length===0,style:{marginLeft:5},loading:I,onClick:R,children:n("Apply")})]})}),children:o?ce.jsx(pZ,{loading:_,rowSelection:((o==null?void 0:o.actions)||[]).length>0?{selectedRowKeys:x,onChange:M}:void 0,columns:A,onChange:w,rowKey:"id",dataSource:(E==null?void 0:E.results)||[],pagination:{current:l,pageSize:u,total:E==null?void 0:E.total,showSizeChanger:!0}}):ce.jsx(io,{description:n("No permissions for model")})})},F_t=({title:e,children:t})=>{const{signedIn:n}=b.useContext(d1),r=Gv();return b.useEffect(()=>{n&&r("/")},[r,n]),ce.jsxs("div",{style:{height:"100vh"},children:[ce.jsx(GI,{defaultTitle:e,children:ce.jsx("meta",{name:"description",content:e})}),ce.jsx(oi,{justify:"center",align:"middle",style:{height:"100%"},children:ce.jsx(jn,{xs:24,xl:8,children:t})})]})},B_t=()=>{const[e]=Jn.useForm(),{token:{colorPrimary:t}}=Xy.useToken(),{configuration:n}=b.useContext(pl),{signedInUserRefetch:r}=b.useContext(d1),{t:i}=ao("SignIn"),{mutate:o,isPending:a}=Ko({mutationFn:l=>qc("/sign-in",l),onSuccess:()=>{r()},onError:l=>{Fl(l,e)}}),s=l=>{o(l)};return ce.jsx(F_t,{title:`${i("Sign In")}`,children:ce.jsxs(Iv,{children:[ce.jsx(oi,{justify:"center",children:ce.jsx(jn,{children:ce.jsxs(Di,{style:{marginBottom:20},children:[ce.jsx(Jw,{src:window.SERVER_DOMAIN+n.site_sign_in_logo,height:80,alt:n.site_name,preview:!1}),ce.jsx("span",{style:{color:t,fontSize:36,fontWeight:600},children:n.site_name})]})})}),ce.jsxs(Jn,{initialValues:{remember:!0},onFinish:s,autoComplete:"off",layout:"vertical",children:[ce.jsx(Jn.Item,{label:WC((n==null?void 0:n.username_field)||"username"),name:"username",rules:[{required:!0}],children:ce.jsx(br,{})}),ce.jsx(Jn.Item,{label:"Password",name:"password",rules:[{required:!0}],children:ce.jsx(br.Password,{})}),ce.jsx(oi,{justify:"end",children:ce.jsx(jn,{children:ce.jsx(Jn.Item,{children:ce.jsx(yn,{type:"primary",htmlType:"submit",loading:a,children:i("Sign In")})})})})]})]})})},z_t=()=>{const{configuration:e}=b.useContext(pl),{t}=ao("App");return ce.jsxs(ov,{theme:{token:{colorPrimary:e.primary_color,colorLink:e.primary_color,colorLinkActive:e.primary_color,colorLinkHover:e.primary_color}},form:{validateMessages:{required:t("${label} is required."),types:{email:t("${label} is not valid."),number:t("${label} is not valid.")},number:{range:t("${label} must be between ${min} and ${max}")}}},children:[ce.jsxs(GI,{titleTemplate:"FastAPI Admin | %s",defaultTitle:t("FastAPI Admin"),children:[ce.jsx("meta",{name:"description",content:t("FastAPI Admin")}),ce.jsx("link",{rel:"icon",href:window.SERVER_DOMAIN+e.site_favicon})]}),ce.jsxs(eDe,{children:[ce.jsx(Kv,{path:"/sign-in",element:ce.jsx(B_t,{})}),ce.jsx(Kv,{path:"/",element:ce.jsx(j_t,{})}),ce.jsx(Kv,{path:"/list/:model",element:ce.jsx(D_t,{})}),ce.jsx(Kv,{path:"/add/:model",element:ce.jsx(hGe,{})}),ce.jsx(Kv,{path:"/change/:model/:id",element:ce.jsx(pGe,{})})]})]})},H_t=({children:e})=>ce.jsx(X9e,{children:ce.jsx(Y9e,{children:e})}),W_t=({children:e,client:t,i18n:n})=>ce.jsx(aDe,{children:ce.jsx(Bge,{client:t,children:ce.jsx(d7e,{i18n:n,children:ce.jsx(DY,{children:e})})})}),V_t=new Age;fo.init({interpolation:{escapeValue:!1}});const Mve=document.getElementById("root");if(!Mve)throw new Error("Root element not found");cP.createRoot(Mve).render(ce.jsx(ge.StrictMode,{children:ce.jsx(W_t,{client:V_t,locale:Po,i18n:fo,children:ce.jsx(H_t,{children:ce.jsx(z_t,{})})})}))});
|