@reearth/core 0.0.7-alpha.40 → 0.0.7-alpha.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core.js +160 -166
- package/dist/core.umd.cjs +2 -2
- package/package.json +1 -1
- package/src/engines/Cesium/core/presets.ts +10 -16
package/dist/core.umd.cjs
CHANGED
|
@@ -5829,7 +5829,7 @@ void main()
|
|
|
5829
5829
|
`;let defaultVertexShaderSource=`${PolylineCommon}
|
|
5830
5830
|
${PolylineMaterialAppearanceVS}`;const defaultFragmentShaderSource=PolylineFS;FeatureDetection.isInternetExplorer()||(defaultVertexShaderSource=`#define CLIP_POLYLINE
|
|
5831
5831
|
${defaultVertexShaderSource}`);function PolylineMaterialAppearance(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);const n=defaultValue(t.translucent,!0),o=!1,s=PolylineMaterialAppearance.VERTEX_FORMAT;this.material=defined(t.material)?t.material:Material.fromType(Material.ColorType),this.translucent=n,this._vertexShaderSource=defaultValue(t.vertexShaderSource,defaultVertexShaderSource),this._fragmentShaderSource=defaultValue(t.fragmentShaderSource,defaultFragmentShaderSource),this._renderState=Appearance.getDefaultRenderState(n,o,t.renderState),this._closed=o,this._vertexFormat=s}Object.defineProperties(PolylineMaterialAppearance.prototype,{vertexShaderSource:{get:function(){let t=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(t=`#define POLYLINE_DASH
|
|
5832
|
-
${t}`),t}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),PolylineMaterialAppearance.VERTEX_FORMAT=VertexFormat.POSITION_AND_ST,PolylineMaterialAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,PolylineMaterialAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,PolylineMaterialAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;function GroundPolylinePrimitive(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let n=t.appearance;defined(n)||(n=new PolylineMaterialAppearance),this.appearance=n,this.show=defaultValue(t.show,!0),this.classificationType=defaultValue(t.classificationType,ClassificationType$1.BOTH),this.debugShowBoundingVolume=defaultValue(t.debugShowBoundingVolume,!1),this._debugShowShadowVolume=defaultValue(t.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:defaultValue(t.interleave,!1),releaseGeometryInstances:defaultValue(t.releaseGeometryInstances,!0),allowPicking:defaultValue(t.allowPicking,!0),asynchronous:defaultValue(t.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=getRenderState(!1),this._renderState3DTiles=getRenderState(!0),this._renderStateMorph=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},depthTest:{enabled:!0},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(GroundPolylinePrimitive.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),GroundPolylinePrimitive.initializeTerrainHeights=function(){return ApproximateTerrainHeights.initialize()};function createShaderProgram(t,n,o){const s=n.context,c=t._primitive,d=c._attributeLocations;let h=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeVS);h=Primitive._appendShowToShader(c,h),h=Primitive._appendDistanceDisplayConditionToShader(c,h),h=Primitive._modifyShaderPosition(t,h,n.scene3DOnly);let p=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphVS);p=Primitive._appendShowToShader(c,p),p=Primitive._appendDistanceDisplayConditionToShader(c,p),p=Primitive._modifyShaderPosition(t,p,n.scene3DOnly);let y=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeFS);const S=[`GLOBE_MINIMUM_ALTITUDE ${n.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let P="",L="";defined(o.material)?(L=defined(o.material)?o.material.shaderSource:"",L.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&S.push("ANGLE_VARYING"),L.search(/in\s+float\s+v_width;/g)!==-1&&S.push("WIDTH_VARYING")):P="PER_INSTANCE_COLOR",S.push(P);const F=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",P]:[P],N=new ShaderSource({defines:S,sources:[h]}),z=new ShaderSource({defines:F,sources:[L,y]});t._sp=ShaderProgram.replaceCache({context:s,shaderProgram:c._sp,vertexShaderSource:N,fragmentShaderSource:z,attributeLocations:d});let W=s.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!defined(W)){const Pe=new ShaderSource({defines:S.concat(["COLUMBUS_VIEW_2D"]),sources:[h]});W=s.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:s,shaderProgram:t._sp2D,vertexShaderSource:Pe,fragmentShaderSource:z,attributeLocations:d})}t._sp2D=W;let nt=s.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!defined(nt)){const Pe=new ShaderSource({defines:S.concat([`MAX_TERRAIN_HEIGHT ${ApproximateTerrainHeights._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[p]});y=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphFS);const se=new ShaderSource({defines:F,sources:[L,y]});nt=s.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:s,shaderProgram:t._spMorph,vertexShaderSource:Pe,fragmentShaderSource:se,attributeLocations:d})}t._spMorph=nt}function getRenderState(t){return RenderState.fromCache({cull:{enabled:!0},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.EQUAL,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK}})}function createCommands(t,n,o,s,c,d){const h=t._primitive,p=h._va.length;c.length=p,d.length=p;const S=n instanceof PolylineColorAppearance?{}:o._uniforms,P=h._batchTable.getUniformMapCallback()(S);for(let L=0;L<p;L++){const F=h._va[L];let N=c[L];defined(N)||(N=c[L]=new DrawCommand({owner:t,primitiveType:h._primitiveType})),N.vertexArray=F,N.renderState=t._renderState,N.shaderProgram=t._sp,N.uniformMap=P,N.pass=Pass$1.TERRAIN_CLASSIFICATION,N.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const z=DrawCommand.shallowClone(N,N.derivedCommands.tileset);z.renderState=t._renderState3DTiles,z.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,N.derivedCommands.tileset=z;const W=DrawCommand.shallowClone(N,N.derivedCommands.color2D);W.shaderProgram=t._sp2D,N.derivedCommands.color2D=W;const nt=DrawCommand.shallowClone(z,z.derivedCommands.color2D);nt.shaderProgram=t._sp2D,z.derivedCommands.color2D=nt;const Pe=DrawCommand.shallowClone(N,N.derivedCommands.colorMorph);Pe.renderState=t._renderStateMorph,Pe.shaderProgram=t._spMorph,Pe.pickId="czm_batchTable_pickColor(v_batchId)",N.derivedCommands.colorMorph=Pe}}function updateAndQueueCommand(t,n,o,s,c,d,h){o.mode===SceneMode$1.MORPHING?n=n.derivedCommands.colorMorph:o.mode!==SceneMode$1.SCENE3D&&(n=n.derivedCommands.color2D),n.modelMatrix=s,n.boundingVolume=d,n.cull=c,n.debugShowBoundingVolume=h,o.commandList.push(n)}function updateAndQueueCommands(t,n,o,s,c,d,h){const p=t._primitive;Primitive._updateBoundingVolumes(p,n,c);let y;n.mode===SceneMode$1.SCENE3D?y=p._boundingSphereWC:n.mode===SceneMode$1.COLUMBUS_VIEW?y=p._boundingSphereCV:n.mode===SceneMode$1.SCENE2D&&defined(p._boundingSphere2D)?y=p._boundingSphere2D:defined(p._boundingSphereMorph)&&(y=p._boundingSphereMorph);const S=n.mode===SceneMode$1.MORPHING,P=t.classificationType,L=P!==ClassificationType$1.CESIUM_3D_TILE,F=P!==ClassificationType$1.TERRAIN&&!S;let N;const z=n.passes;if(z.render||z.pick&&p.allowPicking){const W=o.length;for(let nt=0;nt<W;++nt){const Pe=y[nt];L&&(N=o[nt],updateAndQueueCommand(t,N,n,c,d,Pe,h)),F&&(N=o[nt].derivedCommands.tileset,updateAndQueueCommand(t,N,n,c,d,Pe,h))}}}GroundPolylinePrimitive.prototype.update=function(t){if(!defined(this._primitive)&&!defined(this.geometryInstances))return;if(!ApproximateTerrainHeights.initialized){if(!this.asynchronous)throw new DeveloperError("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");GroundPolylinePrimitive.initializeTerrainHeights();return}let n;const o=this,s=this._primitiveOptions;if(!defined(this._primitive)){const c=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],d=c.length,h=new Array(d);let p;for(n=0;n<d;++n)if(p=c[n].attributes,!defined(p)||!defined(p.color)){this._hasPerInstanceColors=!1;break}for(n=0;n<d;++n){const y=c[n];p={};const S=y.attributes;for(const P in S)S.hasOwnProperty(P)&&(p[P]=S[P]);defined(p.width)||(p.width=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,value:[y.geometry.width]})),y.geometry._scene3DOnly=t.scene3DOnly,GroundPolylineGeometry.setProjectionAndEllipsoid(y.geometry,t.mapProjection),h[n]=new GeometryInstance({geometry:y.geometry,attributes:p,id:y.id,pickPrimitive:o})}s.geometryInstances=h,s.appearance=this.appearance,s._createShaderProgramFunction=function(y,S,P){createShaderProgram(o,S,P)},s._createCommandsFunction=function(y,S,P,L,F,N,z){createCommands(o,S,P,L,N,z)},s._updateAndQueueCommandsFunction=function(y,S,P,L,F,N,z,W){updateAndQueueCommands(o,S,P,L,F,N,z)},this._primitive=new Primitive(s)}if(this.appearance instanceof PolylineColorAppearance&&!this._hasPerInstanceColors)throw new DeveloperError("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(t),t.afterRender.push(()=>{!this._ready&&defined(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},GroundPolylinePrimitive.prototype.getGeometryInstanceAttributes=function(t){if(!defined(this._primitive))throw new DeveloperError("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},GroundPolylinePrimitive.isSupported=function(t){return t.frameState.context.depthTexture},GroundPolylinePrimitive.prototype.isDestroyed=function(){return!1},GroundPolylinePrimitive.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,destroyObject(this)};const defaultRepeat=new Cartesian2(1,1),defaultTransparent=!1,defaultColor$1=Color$1.WHITE;function ImageMaterialProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=t.image,this.repeat=t.repeat,this.color=t.color,this.transparent=t.transparent}Object.defineProperties(ImageMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._image)&&Property.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:createPropertyDescriptor("image"),repeat:createPropertyDescriptor("repeat"),color:createPropertyDescriptor("color"),transparent:createPropertyDescriptor("transparent")}),ImageMaterialProperty.prototype.getType=function(t){return"Image"},ImageMaterialProperty.prototype.getValue=function(t,n){return defined(n)||(n={}),n.image=Property.getValueOrUndefined(this._image,t),n.repeat=Property.getValueOrClonedDefault(this._repeat,t,defaultRepeat,n.repeat),n.color=Property.getValueOrClonedDefault(this._color,t,defaultColor$1,n.color),Property.getValueOrDefault(this._transparent,t,defaultTransparent)&&(n.color.alpha=Math.min(.99,n.color.alpha)),n},ImageMaterialProperty.prototype.equals=function(t){return this===t||t instanceof ImageMaterialProperty&&Property.equals(this._image,t._image)&&Property.equals(this._repeat,t._repeat)&&Property.equals(this._color,t._color)&&Property.equals(this._transparent,t._transparent)};function createMaterialProperty(t){if(t instanceof Color$1)return new ColorMaterialProperty(t);if(typeof t=="string"||t instanceof Resource$1||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){const n=new ImageMaterialProperty;return n.image=t,n}throw new DeveloperError(`Unable to infer material type: ${t}`)}function createMaterialPropertyDescriptor(t,n){return createPropertyDescriptor(t,n,createMaterialProperty)}function BoxGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(BoxGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),dimensions:createPropertyDescriptor("dimensions"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),BoxGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.dimensions=this.dimensions,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new BoxGraphics(this)},BoxGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.dimensions=defaultValue(this.dimensions,t.dimensions),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PositionProperty(){DeveloperError.throwInstantiationError()}Object.defineProperties(PositionProperty.prototype,{isConstant:{get:DeveloperError.throwInstantiationError},definitionChanged:{get:DeveloperError.throwInstantiationError},referenceFrame:{get:DeveloperError.throwInstantiationError}}),PositionProperty.prototype.getValue=DeveloperError.throwInstantiationError,PositionProperty.prototype.getValueInReferenceFrame=DeveloperError.throwInstantiationError,PositionProperty.prototype.equals=DeveloperError.throwInstantiationError;const scratchMatrix3=new Matrix3;PositionProperty.convertToReferenceFrame=function(t,n,o,s,c){if(!defined(n))return n;if(defined(c)||(c=new Cartesian3),o===s)return Cartesian3.clone(n,c);let d=Transforms.computeIcrfToFixedMatrix(t,scratchMatrix3);if(defined(d)||(d=Transforms.computeTemeToPseudoFixedMatrix(t,scratchMatrix3)),o===ReferenceFrame$1.INERTIAL)return Matrix3.multiplyByVector(d,n,c);if(o===ReferenceFrame$1.FIXED)return Matrix3.multiplyByVector(Matrix3.transpose(d,scratchMatrix3),n,c)};function ConstantPositionProperty(t,n){this._definitionChanged=new Event$1,this._value=Cartesian3.clone(t),this._referenceFrame=defaultValue(n,ReferenceFrame$1.FIXED)}Object.defineProperties(ConstantPositionProperty.prototype,{isConstant:{get:function(){return!defined(this._value)||this._referenceFrame===ReferenceFrame$1.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),ConstantPositionProperty.prototype.getValue=function(t,n){return this.getValueInReferenceFrame(t,ReferenceFrame$1.FIXED,n)},ConstantPositionProperty.prototype.setValue=function(t,n){let o=!1;Cartesian3.equals(this._value,t)||(o=!0,this._value=Cartesian3.clone(t)),defined(n)&&this._referenceFrame!==n&&(o=!0,this._referenceFrame=n),o&&this._definitionChanged.raiseEvent(this)},ConstantPositionProperty.prototype.getValueInReferenceFrame=function(t,n,o){if(!defined(t))throw new DeveloperError("time is required.");if(!defined(n))throw new DeveloperError("referenceFrame is required.");return PositionProperty.convertToReferenceFrame(t,this._value,this._referenceFrame,n,o)},ConstantPositionProperty.prototype.equals=function(t){return this===t||t instanceof ConstantPositionProperty&&Cartesian3.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame};function CorridorGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(CorridorGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),width:createPropertyDescriptor("width"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),cornerType:createPropertyDescriptor("cornerType"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),CorridorGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.width=this.width,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.cornerType=this.cornerType,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new CorridorGraphics(this)},CorridorGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.width=defaultValue(this.width,t.width),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.cornerType=defaultValue(this.cornerType,t.cornerType),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function createRawProperty(t){return t}function createRawPropertyDescriptor(t,n){return createPropertyDescriptor(t,n,createRawProperty)}function CylinderGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(CylinderGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),length:createPropertyDescriptor("length"),topRadius:createPropertyDescriptor("topRadius"),bottomRadius:createPropertyDescriptor("bottomRadius"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),numberOfVerticalLines:createPropertyDescriptor("numberOfVerticalLines"),slices:createPropertyDescriptor("slices"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),CylinderGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.length=this.length,t.topRadius=this.topRadius,t.bottomRadius=this.bottomRadius,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.numberOfVerticalLines=this.numberOfVerticalLines,t.slices=this.slices,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new CylinderGraphics(this)},CylinderGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.length=defaultValue(this.length,t.length),this.topRadius=defaultValue(this.topRadius,t.topRadius),this.bottomRadius=defaultValue(this.bottomRadius,t.bottomRadius),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=defaultValue(this.numberOfVerticalLines,t.numberOfVerticalLines),this.slices=defaultValue(this.slices,t.slices),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function EllipseGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(EllipseGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),semiMajorAxis:createPropertyDescriptor("semiMajorAxis"),semiMinorAxis:createPropertyDescriptor("semiMinorAxis"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),rotation:createPropertyDescriptor("rotation"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),numberOfVerticalLines:createPropertyDescriptor("numberOfVerticalLines"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),EllipseGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.semiMajorAxis=this.semiMajorAxis,t.semiMinorAxis=this.semiMinorAxis,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.rotation=this.rotation,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.numberOfVerticalLines=this.numberOfVerticalLines,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new EllipseGraphics(this)},EllipseGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.semiMajorAxis=defaultValue(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=defaultValue(this.semiMinorAxis,t.semiMinorAxis),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.rotation=defaultValue(this.rotation,t.rotation),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=defaultValue(this.numberOfVerticalLines,t.numberOfVerticalLines),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function EllipsoidGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(EllipsoidGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),radii:createPropertyDescriptor("radii"),innerRadii:createPropertyDescriptor("innerRadii"),minimumClock:createPropertyDescriptor("minimumClock"),maximumClock:createPropertyDescriptor("maximumClock"),minimumCone:createPropertyDescriptor("minimumCone"),maximumCone:createPropertyDescriptor("maximumCone"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),stackPartitions:createPropertyDescriptor("stackPartitions"),slicePartitions:createPropertyDescriptor("slicePartitions"),subdivisions:createPropertyDescriptor("subdivisions"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),EllipsoidGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.radii=this.radii,t.innerRadii=this.innerRadii,t.minimumClock=this.minimumClock,t.maximumClock=this.maximumClock,t.minimumCone=this.minimumCone,t.maximumCone=this.maximumCone,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.stackPartitions=this.stackPartitions,t.slicePartitions=this.slicePartitions,t.subdivisions=this.subdivisions,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new EllipsoidGraphics(this)},EllipsoidGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.radii=defaultValue(this.radii,t.radii),this.innerRadii=defaultValue(this.innerRadii,t.innerRadii),this.minimumClock=defaultValue(this.minimumClock,t.minimumClock),this.maximumClock=defaultValue(this.maximumClock,t.maximumClock),this.minimumCone=defaultValue(this.minimumCone,t.minimumCone),this.maximumCone=defaultValue(this.maximumCone,t.maximumCone),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.stackPartitions=defaultValue(this.stackPartitions,t.stackPartitions),this.slicePartitions=defaultValue(this.slicePartitions,t.slicePartitions),this.subdivisions=defaultValue(this.subdivisions,t.subdivisions),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function LabelGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(LabelGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),text:createPropertyDescriptor("text"),font:createPropertyDescriptor("font"),style:createPropertyDescriptor("style"),scale:createPropertyDescriptor("scale"),showBackground:createPropertyDescriptor("showBackground"),backgroundColor:createPropertyDescriptor("backgroundColor"),backgroundPadding:createPropertyDescriptor("backgroundPadding"),pixelOffset:createPropertyDescriptor("pixelOffset"),eyeOffset:createPropertyDescriptor("eyeOffset"),horizontalOrigin:createPropertyDescriptor("horizontalOrigin"),verticalOrigin:createPropertyDescriptor("verticalOrigin"),heightReference:createPropertyDescriptor("heightReference"),fillColor:createPropertyDescriptor("fillColor"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),pixelOffsetScaleByDistance:createPropertyDescriptor("pixelOffsetScaleByDistance"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),LabelGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.text=this.text,t.font=this.font,t.style=this.style,t.scale=this.scale,t.showBackground=this.showBackground,t.backgroundColor=this.backgroundColor,t.backgroundPadding=this.backgroundPadding,t.pixelOffset=this.pixelOffset,t.eyeOffset=this.eyeOffset,t.horizontalOrigin=this.horizontalOrigin,t.verticalOrigin=this.verticalOrigin,t.heightReference=this.heightReference,t.fillColor=this.fillColor,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.translucencyByDistance=this.translucencyByDistance,t.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,t.scaleByDistance=this.scaleByDistance,t.distanceDisplayCondition=this.distanceDisplayCondition,t.disableDepthTestDistance=this.disableDepthTestDistance,t):new LabelGraphics(this)},LabelGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.text=defaultValue(this.text,t.text),this.font=defaultValue(this.font,t.font),this.style=defaultValue(this.style,t.style),this.scale=defaultValue(this.scale,t.scale),this.showBackground=defaultValue(this.showBackground,t.showBackground),this.backgroundColor=defaultValue(this.backgroundColor,t.backgroundColor),this.backgroundPadding=defaultValue(this.backgroundPadding,t.backgroundPadding),this.pixelOffset=defaultValue(this.pixelOffset,t.pixelOffset),this.eyeOffset=defaultValue(this.eyeOffset,t.eyeOffset),this.horizontalOrigin=defaultValue(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=defaultValue(this.verticalOrigin,t.verticalOrigin),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fillColor=defaultValue(this.fillColor,t.fillColor),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.translucencyByDistance=defaultValue(this.translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=defaultValue(this.pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.scaleByDistance=defaultValue(this.scaleByDistance,t.scaleByDistance),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this.disableDepthTestDistance,t.disableDepthTestDistance)};const defaultNodeTransformation=new TranslationRotationScale;function NodeTransformationProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale}Object.defineProperties(NodeTransformationProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._translation)&&Property.isConstant(this._rotation)&&Property.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:createPropertyDescriptor("translation"),rotation:createPropertyDescriptor("rotation"),scale:createPropertyDescriptor("scale")}),NodeTransformationProperty.prototype.getValue=function(t,n){return defined(n)||(n=new TranslationRotationScale),n.translation=Property.getValueOrClonedDefault(this._translation,t,defaultNodeTransformation.translation,n.translation),n.rotation=Property.getValueOrClonedDefault(this._rotation,t,defaultNodeTransformation.rotation,n.rotation),n.scale=Property.getValueOrClonedDefault(this._scale,t,defaultNodeTransformation.scale,n.scale),n},NodeTransformationProperty.prototype.equals=function(t){return this===t||t instanceof NodeTransformationProperty&&Property.equals(this._translation,t._translation)&&Property.equals(this._rotation,t._rotation)&&Property.equals(this._scale,t._scale)};function PropertyBag(t,n){this._propertyNames=[],this._definitionChanged=new Event$1,defined(t)&&this.merge(t,n)}Object.defineProperties(PropertyBag.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){const t=this._propertyNames;for(let n=0,o=t.length;n<o;n++)if(!Property.isConstant(this[t[n]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),PropertyBag.prototype.hasProperty=function(t){return this._propertyNames.indexOf(t)!==-1};function createConstantProperty(t){return new ConstantProperty(t)}PropertyBag.prototype.addProperty=function(t,n,o){const s=this._propertyNames;if(!defined(t))throw new DeveloperError("propertyName is required.");if(s.indexOf(t)!==-1)throw new DeveloperError(`${t} is already a registered property.`);s.push(t),Object.defineProperty(this,t,createPropertyDescriptor(t,!0,defaultValue(o,createConstantProperty))),defined(n)&&(this[t]=n),this._definitionChanged.raiseEvent(this)},PropertyBag.prototype.removeProperty=function(t){const o=this._propertyNames.indexOf(t);if(!defined(t))throw new DeveloperError("propertyName is required.");if(o===-1)throw new DeveloperError(`${t} is not a registered property.`);this._propertyNames.splice(o,1),delete this[t],this._definitionChanged.raiseEvent(this)},PropertyBag.prototype.getValue=function(t,n){if(!defined(t))throw new DeveloperError("time is required.");defined(n)||(n={});const o=this._propertyNames;for(let s=0,c=o.length;s<c;s++){const d=o[s];n[d]=Property.getValueOrUndefined(this[d],t,n[d])}return n},PropertyBag.prototype.merge=function(t,n){if(!defined(t))throw new DeveloperError("source is required.");const o=this._propertyNames,s=defined(t._propertyNames)?t._propertyNames:Object.keys(t);for(let c=0,d=s.length;c<d;c++){const h=s[c],p=this[h],y=t[h];p===void 0&&o.indexOf(h)===-1&&this.addProperty(h,void 0,n),y!==void 0&&(p!==void 0?defined(p)&&defined(p.merge)&&p.merge(y):defined(y)&&defined(y.merge)&&defined(y.clone)?this[h]=y.clone():this[h]=y)}};function propertiesEqual(t,n){const o=t._propertyNames,s=n._propertyNames,c=o.length;if(c!==s.length)return!1;for(let d=0;d<c;++d){const h=o[d];if(s.indexOf(h)===-1||!Property.equals(t[h],n[h]))return!1}return!0}PropertyBag.prototype.equals=function(t){return this===t||t instanceof PropertyBag&&propertiesEqual(this,t)};function createNodeTransformationProperty(t){return new NodeTransformationProperty(t)}function createNodeTransformationPropertyBag(t){return new PropertyBag(t,createNodeTransformationProperty)}function createArticulationStagePropertyBag(t){return new PropertyBag(t)}function ModelGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(ModelGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),uri:createPropertyDescriptor("uri"),scale:createPropertyDescriptor("scale"),minimumPixelSize:createPropertyDescriptor("minimumPixelSize"),maximumScale:createPropertyDescriptor("maximumScale"),incrementallyLoadTextures:createPropertyDescriptor("incrementallyLoadTextures"),runAnimations:createPropertyDescriptor("runAnimations"),clampAnimations:createPropertyDescriptor("clampAnimations"),shadows:createPropertyDescriptor("shadows"),heightReference:createPropertyDescriptor("heightReference"),silhouetteColor:createPropertyDescriptor("silhouetteColor"),silhouetteSize:createPropertyDescriptor("silhouetteSize"),color:createPropertyDescriptor("color"),colorBlendMode:createPropertyDescriptor("colorBlendMode"),colorBlendAmount:createPropertyDescriptor("colorBlendAmount"),imageBasedLightingFactor:createPropertyDescriptor("imageBasedLightingFactor"),lightColor:createPropertyDescriptor("lightColor"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),nodeTransformations:createPropertyDescriptor("nodeTransformations",void 0,createNodeTransformationPropertyBag),articulations:createPropertyDescriptor("articulations",void 0,createArticulationStagePropertyBag),clippingPlanes:createPropertyDescriptor("clippingPlanes"),customShader:createPropertyDescriptor("customShader")}),ModelGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.uri=this.uri,t.scale=this.scale,t.minimumPixelSize=this.minimumPixelSize,t.maximumScale=this.maximumScale,t.incrementallyLoadTextures=this.incrementallyLoadTextures,t.runAnimations=this.runAnimations,t.clampAnimations=this.clampAnimations,t.heightReference=this._heightReference,t.silhouetteColor=this.silhouetteColor,t.silhouetteSize=this.silhouetteSize,t.color=this.color,t.colorBlendMode=this.colorBlendMode,t.colorBlendAmount=this.colorBlendAmount,t.imageBasedLightingFactor=this.imageBasedLightingFactor,t.lightColor=this.lightColor,t.distanceDisplayCondition=this.distanceDisplayCondition,t.nodeTransformations=this.nodeTransformations,t.articulations=this.articulations,t.clippingPlanes=this.clippingPlanes,t.customShader=this.customShader,t):new ModelGraphics(this)},ModelGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.uri=defaultValue(this.uri,t.uri),this.scale=defaultValue(this.scale,t.scale),this.minimumPixelSize=defaultValue(this.minimumPixelSize,t.minimumPixelSize),this.maximumScale=defaultValue(this.maximumScale,t.maximumScale),this.incrementallyLoadTextures=defaultValue(this.incrementallyLoadTextures,t.incrementallyLoadTextures),this.runAnimations=defaultValue(this.runAnimations,t.runAnimations),this.clampAnimations=defaultValue(this.clampAnimations,t.clampAnimations),this.shadows=defaultValue(this.shadows,t.shadows),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.silhouetteColor=defaultValue(this.silhouetteColor,t.silhouetteColor),this.silhouetteSize=defaultValue(this.silhouetteSize,t.silhouetteSize),this.color=defaultValue(this.color,t.color),this.colorBlendMode=defaultValue(this.colorBlendMode,t.colorBlendMode),this.colorBlendAmount=defaultValue(this.colorBlendAmount,t.colorBlendAmount),this.imageBasedLightingFactor=defaultValue(this.imageBasedLightingFactor,t.imageBasedLightingFactor),this.lightColor=defaultValue(this.lightColor,t.lightColor),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.clippingPlanes=defaultValue(this.clippingPlanes,t.clippingPlanes),this.customShader=defaultValue(this.customShader,t.customShader);const n=t.nodeTransformations;if(defined(n)){const s=this.nodeTransformations;defined(s)?s.merge(n):this.nodeTransformations=new PropertyBag(n,createNodeTransformationProperty)}const o=t.articulations;if(defined(o)){const s=this.articulations;defined(s)?s.merge(o):this.articulations=new PropertyBag(o)}};function Cesium3DTilesetGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(Cesium3DTilesetGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),uri:createPropertyDescriptor("uri"),maximumScreenSpaceError:createPropertyDescriptor("maximumScreenSpaceError")}),Cesium3DTilesetGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.uri=this.uri,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t):new Cesium3DTilesetGraphics(this)},Cesium3DTilesetGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.uri=defaultValue(this.uri,t.uri),this.maximumScreenSpaceError=defaultValue(this.maximumScreenSpaceError,t.maximumScreenSpaceError)};function PathGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PathGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),leadTime:createPropertyDescriptor("leadTime"),trailTime:createPropertyDescriptor("trailTime"),width:createPropertyDescriptor("width"),resolution:createPropertyDescriptor("resolution"),material:createMaterialPropertyDescriptor("material"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PathGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.leadTime=this.leadTime,t.trailTime=this.trailTime,t.width=this.width,t.resolution=this.resolution,t.material=this.material,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PathGraphics(this)},PathGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.leadTime=defaultValue(this.leadTime,t.leadTime),this.trailTime=defaultValue(this.trailTime,t.trailTime),this.width=defaultValue(this.width,t.width),this.resolution=defaultValue(this.resolution,t.resolution),this.material=defaultValue(this.material,t.material),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PlaneGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PlaneGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),plane:createPropertyDescriptor("plane"),dimensions:createPropertyDescriptor("dimensions"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PlaneGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.plane=this.plane,t.dimensions=this.dimensions,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PlaneGraphics(this)},PlaneGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.plane=defaultValue(this.plane,t.plane),this.dimensions=defaultValue(this.dimensions,t.dimensions),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PointGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PointGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),pixelSize:createPropertyDescriptor("pixelSize"),heightReference:createPropertyDescriptor("heightReference"),color:createPropertyDescriptor("color"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),PointGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.pixelSize=this.pixelSize,t.heightReference=this.heightReference,t.color=this.color,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.scaleByDistance=this.scaleByDistance,t.translucencyByDistance=this._translucencyByDistance,t.distanceDisplayCondition=this.distanceDisplayCondition,t.disableDepthTestDistance=this.disableDepthTestDistance,t):new PointGraphics(this)},PointGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.pixelSize=defaultValue(this.pixelSize,t.pixelSize),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.color=defaultValue(this.color,t.color),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.scaleByDistance=defaultValue(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=defaultValue(this._translucencyByDistance,t.translucencyByDistance),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this.disableDepthTestDistance,t.disableDepthTestDistance)};function createPolygonHierarchyProperty(t){return Array.isArray(t)&&(t=new PolygonHierarchy(t)),new ConstantProperty(t)}function PolygonGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolygonGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),hierarchy:createPropertyDescriptor("hierarchy",void 0,createPolygonHierarchyProperty),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),perPositionHeight:createPropertyDescriptor("perPositionHeight"),closeTop:createPropertyDescriptor("closeTop"),closeBottom:createPropertyDescriptor("closeBottom"),arcType:createPropertyDescriptor("arcType"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex"),textureCoordinates:createPropertyDescriptor("textureCoordinates")}),PolygonGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.hierarchy=this.hierarchy,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.perPositionHeight=this.perPositionHeight,t.closeTop=this.closeTop,t.closeBottom=this.closeBottom,t.arcType=this.arcType,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t.textureCoordinates=this.textureCoordinates,t):new PolygonGraphics(this)},PolygonGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.hierarchy=defaultValue(this.hierarchy,t.hierarchy),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.perPositionHeight=defaultValue(this.perPositionHeight,t.perPositionHeight),this.closeTop=defaultValue(this.closeTop,t.closeTop),this.closeBottom=defaultValue(this.closeBottom,t.closeBottom),this.arcType=defaultValue(this.arcType,t.arcType),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex),this.textureCoordinates=defaultValue(this.textureCoordinates,t.textureCoordinates)};function PolylineGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolylineGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),width:createPropertyDescriptor("width"),granularity:createPropertyDescriptor("granularity"),material:createMaterialPropertyDescriptor("material"),depthFailMaterial:createMaterialPropertyDescriptor("depthFailMaterial"),arcType:createPropertyDescriptor("arcType"),clampToGround:createPropertyDescriptor("clampToGround"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),PolylineGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.width=this.width,t.granularity=this.granularity,t.material=this.material,t.depthFailMaterial=this.depthFailMaterial,t.arcType=this.arcType,t.clampToGround=this.clampToGround,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new PolylineGraphics(this)},PolylineGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.width=defaultValue(this.width,t.width),this.granularity=defaultValue(this.granularity,t.granularity),this.material=defaultValue(this.material,t.material),this.depthFailMaterial=defaultValue(this.depthFailMaterial,t.depthFailMaterial),this.arcType=defaultValue(this.arcType,t.arcType),this.clampToGround=defaultValue(this.clampToGround,t.clampToGround),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function PolylineVolumeGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolylineVolumeGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),shape:createPropertyDescriptor("shape"),cornerType:createPropertyDescriptor("cornerType"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PolylineVolumeGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.shape=this.shape,t.cornerType=this.cornerType,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PolylineVolumeGraphics(this)},PolylineVolumeGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.shape=defaultValue(this.shape,t.shape),this.cornerType=defaultValue(this.cornerType,t.cornerType),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function RectangleGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(RectangleGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),coordinates:createPropertyDescriptor("coordinates"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),rotation:createPropertyDescriptor("rotation"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),RectangleGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.coordinates=this.coordinates,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.rotation=this.rotation,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new RectangleGraphics(this)},RectangleGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.coordinates=defaultValue(this.coordinates,t.coordinates),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.rotation=defaultValue(this.rotation,t.rotation),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function WallGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(WallGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),minimumHeights:createPropertyDescriptor("minimumHeights"),maximumHeights:createPropertyDescriptor("maximumHeights"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),WallGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.minimumHeights=this.minimumHeights,t.maximumHeights=this.maximumHeights,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new WallGraphics(this)},WallGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.minimumHeights=defaultValue(this.minimumHeights,t.minimumHeights),this.maximumHeights=defaultValue(this.maximumHeights,t.maximumHeights),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};const cartoScratch=new Cartographic,ExtraPropertyNames=[];function createConstantPositionProperty(t){return new ConstantPositionProperty(t)}function createPositionPropertyDescriptor(t){return createPropertyDescriptor(t,void 0,createConstantPositionProperty)}function createPropertyTypeDescriptor(t,n){return createPropertyDescriptor(t,void 0,function(o){return o instanceof n?o:new n(o)})}function Entity$1(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);let n=t.id;defined(n)||(n=createGuid()),this._availability=void 0,this._id=n,this._definitionChanged=new Event$1,this._name=t.name,this._show=defaultValue(t.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...ExtraPropertyNames],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=t.parent,this.merge(t)}function updateShow(t,n,o){const s=n.length;for(let c=0;c<s;c++){const d=n[c],h=d._show;(!o&&h)!==(o&&h)&&updateShow(d,d._children,o)}t._definitionChanged.raiseEvent(t,"isShowing",o,!o)}Object.defineProperties(Entity$1.prototype,{availability:createRawPropertyDescriptor("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:createRawPropertyDescriptor("name"),show:{get:function(){return this._show},set:function(t){if(!defined(t))throw new DeveloperError("value is required.");if(t===this._show)return;const n=this.isShowing;this._show=t;const o=this.isShowing;n!==o&&updateShow(this,this._children,o),this._definitionChanged.raiseEvent(this,"show",t,!t)}},isShowing:{get:function(){return this._show&&(!defined(this.entityCollection)||this.entityCollection.show)&&(!defined(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(t){const n=this._parent;if(n===t)return;const o=this.isShowing;if(defined(n)){const c=n._children.indexOf(this);n._children.splice(c,1)}this._parent=t,defined(t)&&t._children.push(this);const s=this.isShowing;o!==s&&updateShow(this,this._children,s),this._definitionChanged.raiseEvent(this,"parent",t,n)}},propertyNames:{get:function(){return this._propertyNames}},billboard:createPropertyTypeDescriptor("billboard",BillboardGraphics),box:createPropertyTypeDescriptor("box",BoxGraphics),corridor:createPropertyTypeDescriptor("corridor",CorridorGraphics),cylinder:createPropertyTypeDescriptor("cylinder",CylinderGraphics),description:createPropertyDescriptor("description"),ellipse:createPropertyTypeDescriptor("ellipse",EllipseGraphics),ellipsoid:createPropertyTypeDescriptor("ellipsoid",EllipsoidGraphics),label:createPropertyTypeDescriptor("label",LabelGraphics),model:createPropertyTypeDescriptor("model",ModelGraphics),tileset:createPropertyTypeDescriptor("tileset",Cesium3DTilesetGraphics),orientation:createPropertyDescriptor("orientation"),path:createPropertyTypeDescriptor("path",PathGraphics),plane:createPropertyTypeDescriptor("plane",PlaneGraphics),point:createPropertyTypeDescriptor("point",PointGraphics),polygon:createPropertyTypeDescriptor("polygon",PolygonGraphics),polyline:createPropertyTypeDescriptor("polyline",PolylineGraphics),polylineVolume:createPropertyTypeDescriptor("polylineVolume",PolylineVolumeGraphics),properties:createPropertyTypeDescriptor("properties",PropertyBag),position:createPositionPropertyDescriptor("position"),rectangle:createPropertyTypeDescriptor("rectangle",RectangleGraphics),viewFrom:createPropertyDescriptor("viewFrom"),wall:createPropertyTypeDescriptor("wall",WallGraphics)}),Entity$1.registerEntityType=function(t,n){Object.defineProperties(Entity$1.prototype,{[t]:createPropertyTypeDescriptor(t,n)}),ExtraPropertyNames.includes(t)||ExtraPropertyNames.push(t)},Entity$1.prototype.isAvailable=function(t){if(!defined(t))throw new DeveloperError("time is required.");const n=this._availability;return!defined(n)||n.contains(t)},Entity$1.prototype.addProperty=function(t){const n=this._propertyNames;if(!defined(t))throw new DeveloperError("propertyName is required.");if(n.indexOf(t)!==-1)throw new DeveloperError(`${t} is already a registered property.`);if(t in this)throw new DeveloperError(`${t} is a reserved property name.`);n.push(t),Object.defineProperty(this,t,createRawPropertyDescriptor(t,!0))},Entity$1.prototype.removeProperty=function(t){const o=this._propertyNames.indexOf(t);if(!defined(t))throw new DeveloperError("propertyName is required.");if(o===-1)throw new DeveloperError(`${t} is not a registered property.`);this._propertyNames.splice(o,1),delete this[t]},Entity$1.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.name=defaultValue(this.name,t.name),this.availability=defaultValue(this.availability,t.availability);const n=this._propertyNames,o=defined(t._propertyNames)?t._propertyNames:Object.keys(t),s=o.length;for(let c=0;c<s;c++){const d=o[c];if(d==="parent"||d==="name"||d==="availability"||d==="children")continue;const h=this[d],p=t[d];!defined(h)&&n.indexOf(d)===-1&&this.addProperty(d),defined(p)&&(defined(h)?defined(h.merge)&&h.merge(p):defined(p.merge)&&defined(p.clone)?this[d]=p.clone():this[d]=p)}};const matrix3Scratch=new Matrix3,positionScratch$2=new Cartesian3,orientationScratch=new Quaternion;Entity$1.prototype.computeModelMatrix=function(t,n){Check.typeOf.object("time",t);const o=Property.getValueOrUndefined(this._position,t,positionScratch$2);if(!defined(o))return;const s=Property.getValueOrUndefined(this._orientation,t,orientationScratch);return defined(s)?n=Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(s,matrix3Scratch),o,n):n=Transforms.eastNorthUpToFixedFrame(o,void 0,n),n},Entity$1.prototype.computeModelMatrixForHeightReference=function(t,n,o,s,c){Check.typeOf.object("time",t);const d=Property.getValueOrDefault(n,t,HeightReference$1.NONE);let h=Property.getValueOrUndefined(this._position,t,positionScratch$2);if(d===HeightReference$1.NONE||!defined(h)||Cartesian3.equalsEpsilon(h,Cartesian3.ZERO,CesiumMath.EPSILON8))return this.computeModelMatrix(t,c);const p=s.cartesianToCartographic(h,cartoScratch);isHeightReferenceClamp(d)?p.height=o:p.height+=o,h=s.cartographicToCartesian(p,h);const y=Property.getValueOrUndefined(this._orientation,t,orientationScratch);return defined(y)?c=Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(y,matrix3Scratch),h,c):c=Transforms.eastNorthUpToFixedFrame(h,void 0,c),c},Entity$1.supportsMaterialsforEntitiesOnTerrain=function(t){return GroundPrimitive.supportsMaterials(t)},Entity$1.supportsPolylinesOnTerrain=function(t){return GroundPolylinePrimitive.isSupported(t)};function CallbackProperty(t,n){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new Event$1,this.setCallback(t,n)}Object.defineProperties(CallbackProperty.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),CallbackProperty.prototype.getValue=function(t,n){return this._callback(t,n)},CallbackProperty.prototype.setCallback=function(t,n){if(!defined(t))throw new DeveloperError("callback is required.");if(!defined(n))throw new DeveloperError("isConstant is required.");const o=this._callback!==t||this._isConstant!==n;this._callback=t,this._isConstant=n,o&&this._definitionChanged.raiseEvent(this)},CallbackProperty.prototype.equals=function(t){return this===t||t instanceof CallbackProperty&&this._callback===t._callback&&this._isConstant===t._isConstant};const SceneTransforms={},actualPositionScratch=new Cartesian4(0,0,0,1);let positionCC=new Cartesian4;const scratchViewport=new BoundingRectangle,scratchWindowCoord0=new Cartesian2,scratchWindowCoord1=new Cartesian2;SceneTransforms.wgs84ToWindowCoordinates=function(t,n,o){return SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(t,n,Cartesian3.ZERO,o)};const scratchCartesian4=new Cartesian4,scratchEyeOffset=new Cartesian3;function worldToClip(t,n,o,s){const c=o.viewMatrix,d=Matrix4.multiplyByVector(c,Cartesian4.fromElements(t.x,t.y,t.z,1,scratchCartesian4),scratchCartesian4),h=Cartesian3.multiplyComponents(n,Cartesian3.normalize(d,scratchEyeOffset),scratchEyeOffset);return d.x+=n.x+h.x,d.y+=n.y+h.y,d.z+=h.z,Matrix4.multiplyByVector(o.frustum.projectionMatrix,d,s)}const scratchMaxCartographic=new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO),scratchProjectedCartesian=new Cartesian3,scratchCameraPosition=new Cartesian3;SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates=function(t,n,o,s){if(!defined(t))throw new DeveloperError("scene is required.");if(!defined(n))throw new DeveloperError("position is required.");const c=t.frameState,d=SceneTransforms.computeActualWgs84Position(c,n,actualPositionScratch);if(!defined(d))return;const h=t.canvas,p=scratchViewport;p.x=0,p.y=0,p.width=h.clientWidth,p.height=h.clientHeight;const y=t.camera;let S=!1;if(c.mode===SceneMode$1.SCENE2D){const P=t.mapProjection,L=scratchMaxCartographic,F=P.project(L,scratchProjectedCartesian),N=Cartesian3.clone(y.position,scratchCameraPosition),z=y.frustum.clone(),W=Matrix4.computeViewportTransformation(p,0,1,new Matrix4),nt=y.frustum.projectionMatrix,Pe=y.positionWC.y,se=Cartesian3.fromElements(CesiumMath.sign(Pe)*F.x-Pe,0,-y.positionWC.x),mt=Transforms.pointToGLWindowCoordinates(nt,W,se);if(Pe===0||mt.x<=0||mt.x>=h.clientWidth)S=!0;else{if(mt.x>h.clientWidth*.5){p.width=mt.x,y.frustum.right=F.x-Pe,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord0),p.x+=mt.x,y.position.x=-y.position.x;const kt=y.frustum.right;y.frustum.right=-y.frustum.left,y.frustum.left=-kt,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord1)}else{p.x+=mt.x,p.width-=mt.x,y.frustum.left=-F.x-Pe,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord0),p.x=p.x-p.width,y.position.x=-y.position.x;const kt=y.frustum.left;y.frustum.left=-y.frustum.right,y.frustum.right=-kt,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord1)}Cartesian3.clone(N,y.position),y.frustum=z.clone(),s=Cartesian2.clone(scratchWindowCoord0,s),(s.x<0||s.x>h.clientWidth)&&(s.x=scratchWindowCoord1.x)}}if(c.mode!==SceneMode$1.SCENE2D||S){if(positionCC=worldToClip(d,o,y,positionCC),positionCC.z<0&&!(y.frustum instanceof OrthographicFrustum)&&!(y.frustum instanceof OrthographicOffCenterFrustum))return;s=SceneTransforms.clipToGLWindowCoordinates(p,positionCC,s)}return s.y=h.clientHeight-s.y,s},SceneTransforms.wgs84ToDrawingBufferCoordinates=function(t,n,o){if(o=SceneTransforms.wgs84ToWindowCoordinates(t,n,o),!!defined(o))return SceneTransforms.transformWindowToDrawingBuffer(t,o,o)};const projectedPosition=new Cartesian3,positionInCartographic=new Cartographic;SceneTransforms.computeActualWgs84Position=function(t,n,o){const s=t.mode;if(s===SceneMode$1.SCENE3D)return Cartesian3.clone(n,o);const c=t.mapProjection,d=c.ellipsoid.cartesianToCartographic(n,positionInCartographic);if(!defined(d))return;if(c.project(d,projectedPosition),s===SceneMode$1.COLUMBUS_VIEW)return Cartesian3.fromElements(projectedPosition.z,projectedPosition.x,projectedPosition.y,o);if(s===SceneMode$1.SCENE2D)return Cartesian3.fromElements(0,projectedPosition.x,projectedPosition.y,o);const h=t.morphTime;return Cartesian3.fromElements(CesiumMath.lerp(projectedPosition.z,n.x,h),CesiumMath.lerp(projectedPosition.x,n.y,h),CesiumMath.lerp(projectedPosition.y,n.z,h),o)};const positionNDC=new Cartesian3,positionWC=new Cartesian3,viewportTransform=new Matrix4;SceneTransforms.clipToGLWindowCoordinates=function(t,n,o){return Cartesian3.divideByScalar(n,n.w,positionNDC),Matrix4.computeViewportTransformation(t,0,1,viewportTransform),Matrix4.multiplyByPoint(viewportTransform,positionNDC,positionWC),Cartesian2.fromCartesian3(positionWC,o)},SceneTransforms.transformWindowToDrawingBuffer=function(t,n,o){const s=t.canvas,c=t.drawingBufferWidth/s.clientWidth,d=t.drawingBufferHeight/s.clientHeight;return Cartesian2.fromElements(n.x*c,n.y*d,o)};const scratchNDC=new Cartesian4,scratchWorldCoords=new Cartesian4;SceneTransforms.drawingBufferToWgs84Coordinates=function(t,n,o,s){const d=t.context.uniformState,h=d.currentFrustum,p=h.x,y=h.y;if(t.frameState.useLogDepth){const N=o*d.log2FarDepthFromNearPlusOne,z=Math.pow(2,N)-1;o=y*(1-p/(z+p))/(y-p)}const S=t.view.passState.viewport,P=Cartesian4.clone(Cartesian4.UNIT_W,scratchNDC);P.x=(n.x-S.x)/S.width*2-1,P.y=(n.y-S.y)/S.height*2-1,P.z=o*2-1,P.w=1;let L,F=t.camera.frustum;if(defined(F.fovy)){L=Matrix4.multiplyByVector(d.inverseViewProjection,P,scratchWorldCoords);const N=1/L.w;Cartesian3.multiplyByScalar(L,N,L)}else{const N=F.offCenterFrustum;defined(N)&&(F=N),L=scratchWorldCoords,L.x=(P.x*(F.right-F.left)+F.left+F.right)*.5,L.y=(P.y*(F.top-F.bottom)+F.bottom+F.top)*.5,L.z=(P.z*(p-y)-p-y)*.5,L.w=1,L=Matrix4.multiplyByVector(d.inverseView,L,L)}return Cartesian3.fromCartesian4(L,s)};const LabelStyle={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},LabelStyle$1=Object.freeze(LabelStyle),Cesium3DTilePass={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},passOptions=new Array(Cesium3DTilePass.NUMBER_OF_PASSES);passOptions[Cesium3DTilePass.RENDER]=Object.freeze({pass:Cesium3DTilePass.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PICK]=Object.freeze({pass:Cesium3DTilePass.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1}),passOptions[Cesium3DTilePass.SHADOW]=Object.freeze({pass:Cesium3DTilePass.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PRELOAD]=Object.freeze({pass:Cesium3DTilePass.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.PRELOAD_FLIGHT]=Object.freeze({pass:Cesium3DTilePass.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Cesium3DTilePass.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PICK]=Object.freeze({pass:Cesium3DTilePass.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1}),Cesium3DTilePass.getPassOptions=function(t){return passOptions[t]};const Cesium3DTilePass$1=Object.freeze(Cesium3DTilePass),defaultColor=Color$1.WHITE,defaultGapColor=Color$1.TRANSPARENT,defaultDashLength=16,defaultDashPattern=255;function PolylineDashMaterialProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=t.color,this.gapColor=t.gapColor,this.dashLength=t.dashLength,this.dashPattern=t.dashPattern}Object.defineProperties(PolylineDashMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._gapColor)&&Property.isConstant(this._dashLength)&&Property.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),gapColor:createPropertyDescriptor("gapColor"),dashLength:createPropertyDescriptor("dashLength"),dashPattern:createPropertyDescriptor("dashPattern")}),PolylineDashMaterialProperty.prototype.getType=function(t){return"PolylineDash"},PolylineDashMaterialProperty.prototype.getValue=function(t,n){return defined(n)||(n={}),n.color=Property.getValueOrClonedDefault(this._color,t,defaultColor,n.color),n.gapColor=Property.getValueOrClonedDefault(this._gapColor,t,defaultGapColor,n.gapColor),n.dashLength=Property.getValueOrDefault(this._dashLength,t,defaultDashLength,n.dashLength),n.dashPattern=Property.getValueOrDefault(this._dashPattern,t,defaultDashPattern,n.dashPattern),n},PolylineDashMaterialProperty.prototype.equals=function(t){return this===t||t instanceof PolylineDashMaterialProperty&&Property.equals(this._color,t._color)&&Property.equals(this._gapColor,t._gapColor)&&Property.equals(this._dashLength,t._dashLength)&&Property.equals(this._dashPattern,t._dashPattern)};function DiscardEmptyTileImagePolicy(t){}DiscardEmptyTileImagePolicy.prototype.isReady=function(){return!0},DiscardEmptyTileImagePolicy.prototype.shouldDiscardImage=function(t){return DiscardEmptyTileImagePolicy.EMPTY_IMAGE===t};let emptyImage;Object.defineProperties(DiscardEmptyTileImagePolicy,{EMPTY_IMAGE:{get:function(){return defined(emptyImage)||(emptyImage=new Image,emptyImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),emptyImage}}});function Cesium3DTilePassState(t){Check.typeOf.object("options",t),Check.typeOf.number("options.pass",t.pass),this.pass=t.pass,this.commandList=t.commandList,this.camera=t.camera,this.cullingVolume=t.cullingVolume,this.ready=!1}var __create=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__markAsModule=t=>__defProp$1(t,"__esModule",{value:!0}),__commonJS=(t,n)=>function(){return n||(0,t[Object.keys(t)[0]])((n={exports:{}}).exports,n),n.exports},__reExport=(t,n,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of __getOwnPropNames(n))!__hasOwnProp$1.call(t,s)&&s!=="default"&&__defProp$1(t,s,{get:()=>n[s],enumerable:!(o=__getOwnPropDesc(n,s))||o.enumerable});return t},__toModule=t=>__reExport(__markAsModule(__defProp$1(t!=null?__create(__getProtoOf(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),__async=(t,n,o)=>new Promise((s,c)=>{var d=y=>{try{p(o.next(y))}catch(S){c(S)}},h=y=>{try{p(o.throw(y))}catch(S){c(S)}},p=y=>y.done?s(y.value):Promise.resolve(y.value).then(d,h);p((o=o.apply(t,n)).next())}),require_point_geometry=__commonJS({"node_modules/@mapbox/point-geometry/index.js"(t,n){n.exports=o;function o(s,c){this.x=s,this.y=c}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,c){return this.clone()._rotateAround(s,c)},matMult:function(s){return this.clone()._matMult(s)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var c=s.x-this.x,d=s.y-this.y;return c*c+d*d},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,c){return Math.atan2(this.x*c-this.y*s,this.x*s+this.y*c)},_matMult:function(s){var c=s[0]*this.x+s[1]*this.y,d=s[2]*this.x+s[3]*this.y;return this.x=c,this.y=d,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var c=Math.cos(s),d=Math.sin(s),h=c*this.x-d*this.y,p=d*this.x+c*this.y;return this.x=h,this.y=p,this},_rotateAround:function(s,c){var d=Math.cos(s),h=Math.sin(s),p=c.x+d*(this.x-c.x)-h*(this.y-c.y),y=c.y+h*(this.x-c.x)+d*(this.y-c.y);return this.x=p,this.y=y,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(s){return s instanceof o?s:Array.isArray(s)?new o(s[0],s[1]):s}}}),require_vectortilefeature=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortilefeature.js"(t,n){var o=require_point_geometry();n.exports=s;function s(y,S,P,L,F){this.properties={},this.extent=P,this.type=0,this._pbf=y,this._geometry=-1,this._keys=L,this._values=F,y.readFields(c,this,S)}function c(y,S,P){y==1?S.id=P.readVarint():y==2?d(P,S):y==3?S.type=P.readVarint():y==4&&(S._geometry=P.pos)}function d(y,S){for(var P=y.readVarint()+y.pos;y.pos<P;){var L=S._keys[y.readVarint()],F=S._values[y.readVarint()];S.properties[L]=F}}s.types=["Unknown","Point","LineString","Polygon"],s.prototype.loadGeometry=function(){var y=this._pbf;y.pos=this._geometry;for(var S=y.readVarint()+y.pos,P=1,L=0,F=0,N=0,z=[],W;y.pos<S;){if(L<=0){var nt=y.readVarint();P=nt&7,L=nt>>3}if(L--,P===1||P===2)F+=y.readSVarint(),N+=y.readSVarint(),P===1&&(W&&z.push(W),W=[]),W.push(new o(F,N));else if(P===7)W&&W.push(W[0].clone());else throw new Error("unknown command "+P)}return W&&z.push(W),z},s.prototype.bbox=function(){var y=this._pbf;y.pos=this._geometry;for(var S=y.readVarint()+y.pos,P=1,L=0,F=0,N=0,z=1/0,W=-1/0,nt=1/0,Pe=-1/0;y.pos<S;){if(L<=0){var se=y.readVarint();P=se&7,L=se>>3}if(L--,P===1||P===2)F+=y.readSVarint(),N+=y.readSVarint(),F<z&&(z=F),F>W&&(W=F),N<nt&&(nt=N),N>Pe&&(Pe=N);else if(P!==7)throw new Error("unknown command "+P)}return[z,nt,W,Pe]},s.prototype.toGeoJSON=function(y,S,P){var L=this.extent*Math.pow(2,P),F=this.extent*y,N=this.extent*S,z=this.loadGeometry(),W=s.types[this.type],nt,Pe;function se(mn){for(var _i=0;_i<mn.length;_i++){var zi=mn[_i],Sa=180-(zi.y+N)*360/L;mn[_i]=[(zi.x+F)*360/L-180,360/Math.PI*Math.atan(Math.exp(Sa*Math.PI/180))-90]}}switch(this.type){case 1:var mt=[];for(nt=0;nt<z.length;nt++)mt[nt]=z[nt][0];z=mt,se(z);break;case 2:for(nt=0;nt<z.length;nt++)se(z[nt]);break;case 3:for(z=h(z),nt=0;nt<z.length;nt++)for(Pe=0;Pe<z[nt].length;Pe++)se(z[nt][Pe]);break}z.length===1?z=z[0]:W="Multi"+W;var kt={type:"Feature",geometry:{type:W,coordinates:z},properties:this.properties};return"id"in this&&(kt.id=this.id),kt};function h(y){var S=y.length;if(S<=1)return[y];for(var P=[],L,F,N=0;N<S;N++){var z=p(y[N]);z!==0&&(F===void 0&&(F=z<0),F===z<0?(L&&P.push(L),L=[y[N]]):L.push(y[N]))}return L&&P.push(L),P}function p(y){for(var S=0,P=0,L=y.length,F=L-1,N,z;P<L;F=P++)N=y[P],z=y[F],S+=(z.x-N.x)*(N.y+z.y);return S}}}),require_vectortilelayer=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortilelayer.js"(t,n){var o=require_vectortilefeature();n.exports=s;function s(h,p){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=h,this._keys=[],this._values=[],this._features=[],h.readFields(c,this,p),this.length=this._features.length}function c(h,p,y){h===15?p.version=y.readVarint():h===1?p.name=y.readString():h===5?p.extent=y.readVarint():h===2?p._features.push(y.pos):h===3?p._keys.push(y.readString()):h===4&&p._values.push(d(y))}function d(h){for(var p=null,y=h.readVarint()+h.pos;h.pos<y;){var S=h.readVarint()>>3;p=S===1?h.readString():S===2?h.readFloat():S===3?h.readDouble():S===4?h.readVarint64():S===5?h.readVarint():S===6?h.readSVarint():S===7?h.readBoolean():null}return p}s.prototype.feature=function(h){if(h<0||h>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[h];var p=this._pbf.readVarint()+this._pbf.pos;return new o(this._pbf,p,this.extent,this._keys,this._values)}}}),require_vectortile=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortile.js"(t,n){var o=require_vectortilelayer();n.exports=s;function s(d,h){this.layers=d.readFields(c,{},h)}function c(d,h,p){if(d===3){var y=new o(p,p.readVarint()+p.pos);y.length&&(h[y.name]=y)}}}}),require_vector_tile=__commonJS({"node_modules/@mapbox/vector-tile/index.js"(t,n){n.exports.VectorTile=require_vectortile(),n.exports.VectorTileFeature=require_vectortilefeature(),n.exports.VectorTileLayer=require_vectortilelayer()}}),require_ieee754=__commonJS({"node_modules/ieee754/index.js"(t){t.read=function(n,o,s,c,d){var h,p,y=d*8-c-1,S=(1<<y)-1,P=S>>1,L=-7,F=s?d-1:0,N=s?-1:1,z=n[o+F];for(F+=N,h=z&(1<<-L)-1,z>>=-L,L+=y;L>0;h=h*256+n[o+F],F+=N,L-=8);for(p=h&(1<<-L)-1,h>>=-L,L+=c;L>0;p=p*256+n[o+F],F+=N,L-=8);if(h===0)h=1-P;else{if(h===S)return p?NaN:(z?-1:1)*(1/0);p=p+Math.pow(2,c),h=h-P}return(z?-1:1)*p*Math.pow(2,h-c)},t.write=function(n,o,s,c,d,h){var p,y,S,P=h*8-d-1,L=(1<<P)-1,F=L>>1,N=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=c?0:h-1,W=c?1:-1,nt=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(y=isNaN(o)?1:0,p=L):(p=Math.floor(Math.log(o)/Math.LN2),o*(S=Math.pow(2,-p))<1&&(p--,S*=2),p+F>=1?o+=N/S:o+=N*Math.pow(2,1-F),o*S>=2&&(p++,S/=2),p+F>=L?(y=0,p=L):p+F>=1?(y=(o*S-1)*Math.pow(2,d),p=p+F):(y=o*Math.pow(2,F-1)*Math.pow(2,d),p=0));d>=8;n[s+z]=y&255,z+=W,y/=256,d-=8);for(p=p<<d|y,P+=d;P>0;n[s+z]=p&255,z+=W,p/=256,P-=8);n[s+z-W]|=nt*128}}}),require_pbf=__commonJS({"node_modules/pbf/index.js"(t,n){n.exports=s;var o=require_ieee754();function s(lt){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(lt)?lt:new Uint8Array(lt||0),this.pos=0,this.type=0,this.length=this.buf.length}s.Varint=0,s.Fixed64=1,s.Bytes=2,s.Fixed32=5;var c=65536*65536,d=1/c,h=12,p=typeof TextDecoder>"u"?null:new TextDecoder("utf8");s.prototype={destroy:function(){this.buf=null},readFields:function(lt,pi,ba){for(ba=ba||this.length;this.pos<ba;){var Sc=this.readVarint(),ms=Sc>>3,Xs=this.pos;this.type=Sc&7,lt(ms,pi,this),this.pos===Xs&&this.skip(Sc)}return pi},readMessage:function(lt,pi){return this.readFields(lt,pi,this.readVarint()+this.pos)},readFixed32:function(){var lt=Sa(this.buf,this.pos);return this.pos+=4,lt},readSFixed32:function(){var lt=La(this.buf,this.pos);return this.pos+=4,lt},readFixed64:function(){var lt=Sa(this.buf,this.pos)+Sa(this.buf,this.pos+4)*c;return this.pos+=8,lt},readSFixed64:function(){var lt=Sa(this.buf,this.pos)+La(this.buf,this.pos+4)*c;return this.pos+=8,lt},readFloat:function(){var lt=o.read(this.buf,this.pos,!0,23,4);return this.pos+=4,lt},readDouble:function(){var lt=o.read(this.buf,this.pos,!0,52,8);return this.pos+=8,lt},readVarint:function(lt){var pi=this.buf,ba,Sc;return Sc=pi[this.pos++],ba=Sc&127,Sc<128||(Sc=pi[this.pos++],ba|=(Sc&127)<<7,Sc<128)||(Sc=pi[this.pos++],ba|=(Sc&127)<<14,Sc<128)||(Sc=pi[this.pos++],ba|=(Sc&127)<<21,Sc<128)?ba:(Sc=pi[this.pos],ba|=(Sc&15)<<28,y(ba,lt,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var lt=this.readVarint();return lt%2===1?(lt+1)/-2:lt/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var lt=this.readVarint()+this.pos,pi=this.pos;return this.pos=lt,lt-pi>=h&&p?ma(this.buf,pi,lt):Ra(this.buf,pi,lt)},readBytes:function(){var lt=this.readVarint()+this.pos,pi=this.buf.subarray(this.pos,lt);return this.pos=lt,pi},readPackedVarint:function(lt,pi){if(this.type!==s.Bytes)return lt.push(this.readVarint(pi));var ba=S(this);for(lt=lt||[];this.pos<ba;)lt.push(this.readVarint(pi));return lt},readPackedSVarint:function(lt){if(this.type!==s.Bytes)return lt.push(this.readSVarint());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readSVarint());return lt},readPackedBoolean:function(lt){if(this.type!==s.Bytes)return lt.push(this.readBoolean());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readBoolean());return lt},readPackedFloat:function(lt){if(this.type!==s.Bytes)return lt.push(this.readFloat());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readFloat());return lt},readPackedDouble:function(lt){if(this.type!==s.Bytes)return lt.push(this.readDouble());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readDouble());return lt},readPackedFixed32:function(lt){if(this.type!==s.Bytes)return lt.push(this.readFixed32());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readFixed32());return lt},readPackedSFixed32:function(lt){if(this.type!==s.Bytes)return lt.push(this.readSFixed32());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readSFixed32());return lt},readPackedFixed64:function(lt){if(this.type!==s.Bytes)return lt.push(this.readFixed64());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readFixed64());return lt},readPackedSFixed64:function(lt){if(this.type!==s.Bytes)return lt.push(this.readSFixed64());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readSFixed64());return lt},skip:function(lt){var pi=lt&7;if(pi===s.Varint)for(;this.buf[this.pos++]>127;);else if(pi===s.Bytes)this.pos=this.readVarint()+this.pos;else if(pi===s.Fixed32)this.pos+=4;else if(pi===s.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+pi)},writeTag:function(lt,pi){this.writeVarint(lt<<3|pi)},realloc:function(lt){for(var pi=this.length||16;pi<this.pos+lt;)pi*=2;if(pi!==this.length){var ba=new Uint8Array(pi);ba.set(this.buf),this.buf=ba,this.length=pi}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(lt){this.realloc(4),fa(this.buf,lt,this.pos),this.pos+=4},writeSFixed32:function(lt){this.realloc(4),fa(this.buf,lt,this.pos),this.pos+=4},writeFixed64:function(lt){this.realloc(8),fa(this.buf,lt&-1,this.pos),fa(this.buf,Math.floor(lt*d),this.pos+4),this.pos+=8},writeSFixed64:function(lt){this.realloc(8),fa(this.buf,lt&-1,this.pos),fa(this.buf,Math.floor(lt*d),this.pos+4),this.pos+=8},writeVarint:function(lt){if(lt=+lt||0,lt>268435455||lt<0){L(lt,this);return}this.realloc(4),this.buf[this.pos++]=lt&127|(lt>127?128:0),!(lt<=127)&&(this.buf[this.pos++]=(lt>>>=7)&127|(lt>127?128:0),!(lt<=127)&&(this.buf[this.pos++]=(lt>>>=7)&127|(lt>127?128:0),!(lt<=127)&&(this.buf[this.pos++]=lt>>>7&127)))},writeSVarint:function(lt){this.writeVarint(lt<0?-lt*2-1:lt*2)},writeBoolean:function(lt){this.writeVarint(!!lt)},writeString:function(lt){lt=String(lt),this.realloc(lt.length*4),this.pos++;var pi=this.pos;this.pos=yt(this.buf,lt,this.pos);var ba=this.pos-pi;ba>=128&&z(pi,ba,this),this.pos=pi-1,this.writeVarint(ba),this.pos+=ba},writeFloat:function(lt){this.realloc(4),o.write(this.buf,lt,this.pos,!0,23,4),this.pos+=4},writeDouble:function(lt){this.realloc(8),o.write(this.buf,lt,this.pos,!0,52,8),this.pos+=8},writeBytes:function(lt){var pi=lt.length;this.writeVarint(pi),this.realloc(pi);for(var ba=0;ba<pi;ba++)this.buf[this.pos++]=lt[ba]},writeRawMessage:function(lt,pi){this.pos++;var ba=this.pos;lt(pi,this);var Sc=this.pos-ba;Sc>=128&&z(ba,Sc,this),this.pos=ba-1,this.writeVarint(Sc),this.pos+=Sc},writeMessage:function(lt,pi,ba){this.writeTag(lt,s.Bytes),this.writeRawMessage(pi,ba)},writePackedVarint:function(lt,pi){pi.length&&this.writeMessage(lt,W,pi)},writePackedSVarint:function(lt,pi){pi.length&&this.writeMessage(lt,nt,pi)},writePackedBoolean:function(lt,pi){pi.length&&this.writeMessage(lt,mt,pi)},writePackedFloat:function(lt,pi){pi.length&&this.writeMessage(lt,Pe,pi)},writePackedDouble:function(lt,pi){pi.length&&this.writeMessage(lt,se,pi)},writePackedFixed32:function(lt,pi){pi.length&&this.writeMessage(lt,kt,pi)},writePackedSFixed32:function(lt,pi){pi.length&&this.writeMessage(lt,mn,pi)},writePackedFixed64:function(lt,pi){pi.length&&this.writeMessage(lt,_i,pi)},writePackedSFixed64:function(lt,pi){pi.length&&this.writeMessage(lt,zi,pi)},writeBytesField:function(lt,pi){this.writeTag(lt,s.Bytes),this.writeBytes(pi)},writeFixed32Field:function(lt,pi){this.writeTag(lt,s.Fixed32),this.writeFixed32(pi)},writeSFixed32Field:function(lt,pi){this.writeTag(lt,s.Fixed32),this.writeSFixed32(pi)},writeFixed64Field:function(lt,pi){this.writeTag(lt,s.Fixed64),this.writeFixed64(pi)},writeSFixed64Field:function(lt,pi){this.writeTag(lt,s.Fixed64),this.writeSFixed64(pi)},writeVarintField:function(lt,pi){this.writeTag(lt,s.Varint),this.writeVarint(pi)},writeSVarintField:function(lt,pi){this.writeTag(lt,s.Varint),this.writeSVarint(pi)},writeStringField:function(lt,pi){this.writeTag(lt,s.Bytes),this.writeString(pi)},writeFloatField:function(lt,pi){this.writeTag(lt,s.Fixed32),this.writeFloat(pi)},writeDoubleField:function(lt,pi){this.writeTag(lt,s.Fixed64),this.writeDouble(pi)},writeBooleanField:function(lt,pi){this.writeVarintField(lt,!!pi)}};function y(lt,pi,ba){var Sc=ba.buf,ms,Xs;if(Xs=Sc[ba.pos++],ms=(Xs&112)>>4,Xs<128||(Xs=Sc[ba.pos++],ms|=(Xs&127)<<3,Xs<128)||(Xs=Sc[ba.pos++],ms|=(Xs&127)<<10,Xs<128)||(Xs=Sc[ba.pos++],ms|=(Xs&127)<<17,Xs<128)||(Xs=Sc[ba.pos++],ms|=(Xs&127)<<24,Xs<128)||(Xs=Sc[ba.pos++],ms|=(Xs&1)<<31,Xs<128))return P(lt,ms,pi);throw new Error("Expected varint not more than 10 bytes")}function S(lt){return lt.type===s.Bytes?lt.readVarint()+lt.pos:lt.pos+1}function P(lt,pi,ba){return ba?pi*4294967296+(lt>>>0):(pi>>>0)*4294967296+(lt>>>0)}function L(lt,pi){var ba,Sc;if(lt>=0?(ba=lt%4294967296|0,Sc=lt/4294967296|0):(ba=~(-lt%4294967296),Sc=~(-lt/4294967296),ba^4294967295?ba=ba+1|0:(ba=0,Sc=Sc+1|0)),lt>=18446744073709552e3||lt<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");pi.realloc(10),F(ba,Sc,pi),N(Sc,pi)}function F(lt,pi,ba){ba.buf[ba.pos++]=lt&127|128,lt>>>=7,ba.buf[ba.pos++]=lt&127|128,lt>>>=7,ba.buf[ba.pos++]=lt&127|128,lt>>>=7,ba.buf[ba.pos++]=lt&127|128,lt>>>=7,ba.buf[ba.pos]=lt&127}function N(lt,pi){var ba=(lt&7)<<4;pi.buf[pi.pos++]|=ba|((lt>>>=3)?128:0),lt&&(pi.buf[pi.pos++]=lt&127|((lt>>>=7)?128:0),lt&&(pi.buf[pi.pos++]=lt&127|((lt>>>=7)?128:0),lt&&(pi.buf[pi.pos++]=lt&127|((lt>>>=7)?128:0),lt&&(pi.buf[pi.pos++]=lt&127|((lt>>>=7)?128:0),lt&&(pi.buf[pi.pos++]=lt&127)))))}function z(lt,pi,ba){var Sc=pi<=16383?1:pi<=2097151?2:pi<=268435455?3:Math.floor(Math.log(pi)/(Math.LN2*7));ba.realloc(Sc);for(var ms=ba.pos-1;ms>=lt;ms--)ba.buf[ms+Sc]=ba.buf[ms]}function W(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeVarint(lt[ba])}function nt(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeSVarint(lt[ba])}function Pe(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeFloat(lt[ba])}function se(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeDouble(lt[ba])}function mt(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeBoolean(lt[ba])}function kt(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeFixed32(lt[ba])}function mn(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeSFixed32(lt[ba])}function _i(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeFixed64(lt[ba])}function zi(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeSFixed64(lt[ba])}function Sa(lt,pi){return(lt[pi]|lt[pi+1]<<8|lt[pi+2]<<16)+lt[pi+3]*16777216}function fa(lt,pi,ba){lt[ba]=pi,lt[ba+1]=pi>>>8,lt[ba+2]=pi>>>16,lt[ba+3]=pi>>>24}function La(lt,pi){return(lt[pi]|lt[pi+1]<<8|lt[pi+2]<<16)+(lt[pi+3]<<24)}function Ra(lt,pi,ba){for(var Sc="",ms=pi;ms<ba;){var Xs=lt[ms],Nl=null,pu=Xs>239?4:Xs>223?3:Xs>191?2:1;if(ms+pu>ba)break;var yu,Ru,Vd;pu===1?Xs<128&&(Nl=Xs):pu===2?(yu=lt[ms+1],(yu&192)===128&&(Nl=(Xs&31)<<6|yu&63,Nl<=127&&(Nl=null))):pu===3?(yu=lt[ms+1],Ru=lt[ms+2],(yu&192)===128&&(Ru&192)===128&&(Nl=(Xs&15)<<12|(yu&63)<<6|Ru&63,(Nl<=2047||Nl>=55296&&Nl<=57343)&&(Nl=null))):pu===4&&(yu=lt[ms+1],Ru=lt[ms+2],Vd=lt[ms+3],(yu&192)===128&&(Ru&192)===128&&(Vd&192)===128&&(Nl=(Xs&15)<<18|(yu&63)<<12|(Ru&63)<<6|Vd&63,(Nl<=65535||Nl>=1114112)&&(Nl=null))),Nl===null?(Nl=65533,pu=1):Nl>65535&&(Nl-=65536,Sc+=String.fromCharCode(Nl>>>10&1023|55296),Nl=56320|Nl&1023),Sc+=String.fromCharCode(Nl),ms+=pu}return Sc}function ma(lt,pi,ba){return p.decode(lt.subarray(pi,ba))}function yt(lt,pi,ba){for(var Sc=0,ms,Xs;Sc<pi.length;Sc++){if(ms=pi.charCodeAt(Sc),ms>55295&&ms<57344)if(Xs)if(ms<56320){lt[ba++]=239,lt[ba++]=191,lt[ba++]=189,Xs=ms;continue}else ms=Xs-55296<<10|ms-56320|65536,Xs=null;else{ms>56319||Sc+1===pi.length?(lt[ba++]=239,lt[ba++]=191,lt[ba++]=189):Xs=ms;continue}else Xs&&(lt[ba++]=239,lt[ba++]=191,lt[ba++]=189,Xs=null);ms<128?lt[ba++]=ms:(ms<2048?lt[ba++]=ms>>6|192:(ms<65536?lt[ba++]=ms>>12|224:(lt[ba++]=ms>>18|240,lt[ba++]=ms>>12&63|128),lt[ba++]=ms>>6&63|128),lt[ba++]=ms&63|128)}return ba}}}),require_rbush_min=__commonJS({"node_modules/rbush/rbush.min.js"(t,n){(function(o,s){typeof t=="object"&&typeof n<"u"?n.exports=s():typeof define=="function"&&define.amd?define(s):(o=o||self).RBush=s()})(t,function(){function o(se,mt,kt,mn,_i){(function zi(Sa,fa,La,Ra,ma){for(;Ra>La;){if(Ra-La>600){var yt=Ra-La+1,lt=fa-La+1,pi=Math.log(yt),ba=.5*Math.exp(2*pi/3),Sc=.5*Math.sqrt(pi*ba*(yt-ba)/yt)*(lt-yt/2<0?-1:1),ms=Math.max(La,Math.floor(fa-lt*ba/yt+Sc)),Xs=Math.min(Ra,Math.floor(fa+(yt-lt)*ba/yt+Sc));zi(Sa,fa,ms,Xs,ma)}var Nl=Sa[fa],pu=La,yu=Ra;for(s(Sa,La,fa),ma(Sa[Ra],Nl)>0&&s(Sa,La,Ra);pu<yu;){for(s(Sa,pu,yu),pu++,yu--;ma(Sa[pu],Nl)<0;)pu++;for(;ma(Sa[yu],Nl)>0;)yu--}ma(Sa[La],Nl)===0?s(Sa,La,yu):s(Sa,++yu,Ra),yu<=fa&&(La=yu+1),fa<=yu&&(Ra=yu-1)}})(se,mt,kt||0,mn||se.length-1,_i||c)}function s(se,mt,kt){var mn=se[mt];se[mt]=se[kt],se[kt]=mn}function c(se,mt){return se<mt?-1:se>mt?1:0}var d=function(se){se===void 0&&(se=9),this._maxEntries=Math.max(4,se),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function h(se,mt,kt){if(!kt)return mt.indexOf(se);for(var mn=0;mn<mt.length;mn++)if(kt(se,mt[mn]))return mn;return-1}function p(se,mt){y(se,0,se.children.length,mt,se)}function y(se,mt,kt,mn,_i){_i||(_i=nt(null)),_i.minX=1/0,_i.minY=1/0,_i.maxX=-1/0,_i.maxY=-1/0;for(var zi=mt;zi<kt;zi++){var Sa=se.children[zi];S(_i,se.leaf?mn(Sa):Sa)}return _i}function S(se,mt){return se.minX=Math.min(se.minX,mt.minX),se.minY=Math.min(se.minY,mt.minY),se.maxX=Math.max(se.maxX,mt.maxX),se.maxY=Math.max(se.maxY,mt.maxY),se}function P(se,mt){return se.minX-mt.minX}function L(se,mt){return se.minY-mt.minY}function F(se){return(se.maxX-se.minX)*(se.maxY-se.minY)}function N(se){return se.maxX-se.minX+(se.maxY-se.minY)}function z(se,mt){return se.minX<=mt.minX&&se.minY<=mt.minY&&mt.maxX<=se.maxX&&mt.maxY<=se.maxY}function W(se,mt){return mt.minX<=se.maxX&&mt.minY<=se.maxY&&mt.maxX>=se.minX&&mt.maxY>=se.minY}function nt(se){return{children:se,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Pe(se,mt,kt,mn,_i){for(var zi=[mt,kt];zi.length;)if(!((kt=zi.pop())-(mt=zi.pop())<=mn)){var Sa=mt+Math.ceil((kt-mt)/mn/2)*mn;o(se,Sa,mt,kt,_i),zi.push(mt,Sa,Sa,kt)}}return d.prototype.all=function(){return this._all(this.data,[])},d.prototype.search=function(se){var mt=this.data,kt=[];if(!W(se,mt))return kt;for(var mn=this.toBBox,_i=[];mt;){for(var zi=0;zi<mt.children.length;zi++){var Sa=mt.children[zi],fa=mt.leaf?mn(Sa):Sa;W(se,fa)&&(mt.leaf?kt.push(Sa):z(se,fa)?this._all(Sa,kt):_i.push(Sa))}mt=_i.pop()}return kt},d.prototype.collides=function(se){var mt=this.data;if(!W(se,mt))return!1;for(var kt=[];mt;){for(var mn=0;mn<mt.children.length;mn++){var _i=mt.children[mn],zi=mt.leaf?this.toBBox(_i):_i;if(W(se,zi)){if(mt.leaf||z(se,zi))return!0;kt.push(_i)}}mt=kt.pop()}return!1},d.prototype.load=function(se){if(!se||!se.length)return this;if(se.length<this._minEntries){for(var mt=0;mt<se.length;mt++)this.insert(se[mt]);return this}var kt=this._build(se.slice(),0,se.length-1,0);if(this.data.children.length)if(this.data.height===kt.height)this._splitRoot(this.data,kt);else{if(this.data.height<kt.height){var mn=this.data;this.data=kt,kt=mn}this._insert(kt,this.data.height-kt.height-1,!0)}else this.data=kt;return this},d.prototype.insert=function(se){return se&&this._insert(se,this.data.height-1),this},d.prototype.clear=function(){return this.data=nt([]),this},d.prototype.remove=function(se,mt){if(!se)return this;for(var kt,mn,_i,zi=this.data,Sa=this.toBBox(se),fa=[],La=[];zi||fa.length;){if(zi||(zi=fa.pop(),mn=fa[fa.length-1],kt=La.pop(),_i=!0),zi.leaf){var Ra=h(se,zi.children,mt);if(Ra!==-1)return zi.children.splice(Ra,1),fa.push(zi),this._condense(fa),this}_i||zi.leaf||!z(zi,Sa)?mn?(kt++,zi=mn.children[kt],_i=!1):zi=null:(fa.push(zi),La.push(kt),kt=0,mn=zi,zi=zi.children[0])}return this},d.prototype.toBBox=function(se){return se},d.prototype.compareMinX=function(se,mt){return se.minX-mt.minX},d.prototype.compareMinY=function(se,mt){return se.minY-mt.minY},d.prototype.toJSON=function(){return this.data},d.prototype.fromJSON=function(se){return this.data=se,this},d.prototype._all=function(se,mt){for(var kt=[];se;)se.leaf?mt.push.apply(mt,se.children):kt.push.apply(kt,se.children),se=kt.pop();return mt},d.prototype._build=function(se,mt,kt,mn){var _i,zi=kt-mt+1,Sa=this._maxEntries;if(zi<=Sa)return p(_i=nt(se.slice(mt,kt+1)),this.toBBox),_i;mn||(mn=Math.ceil(Math.log(zi)/Math.log(Sa)),Sa=Math.ceil(zi/Math.pow(Sa,mn-1))),(_i=nt([])).leaf=!1,_i.height=mn;var fa=Math.ceil(zi/Sa),La=fa*Math.ceil(Math.sqrt(Sa));Pe(se,mt,kt,La,this.compareMinX);for(var Ra=mt;Ra<=kt;Ra+=La){var ma=Math.min(Ra+La-1,kt);Pe(se,Ra,ma,fa,this.compareMinY);for(var yt=Ra;yt<=ma;yt+=fa){var lt=Math.min(yt+fa-1,ma);_i.children.push(this._build(se,yt,lt,mn-1))}}return p(_i,this.toBBox),_i},d.prototype._chooseSubtree=function(se,mt,kt,mn){for(;mn.push(mt),!mt.leaf&&mn.length-1!==kt;){for(var _i=1/0,zi=1/0,Sa=void 0,fa=0;fa<mt.children.length;fa++){var La=mt.children[fa],Ra=F(La),ma=(yt=se,lt=La,(Math.max(lt.maxX,yt.maxX)-Math.min(lt.minX,yt.minX))*(Math.max(lt.maxY,yt.maxY)-Math.min(lt.minY,yt.minY))-Ra);ma<zi?(zi=ma,_i=Ra<_i?Ra:_i,Sa=La):ma===zi&&Ra<_i&&(_i=Ra,Sa=La)}mt=Sa||mt.children[0]}var yt,lt;return mt},d.prototype._insert=function(se,mt,kt){var mn=kt?se:this.toBBox(se),_i=[],zi=this._chooseSubtree(mn,this.data,mt,_i);for(zi.children.push(se),S(zi,mn);mt>=0&&_i[mt].children.length>this._maxEntries;)this._split(_i,mt),mt--;this._adjustParentBBoxes(mn,_i,mt)},d.prototype._split=function(se,mt){var kt=se[mt],mn=kt.children.length,_i=this._minEntries;this._chooseSplitAxis(kt,_i,mn);var zi=this._chooseSplitIndex(kt,_i,mn),Sa=nt(kt.children.splice(zi,kt.children.length-zi));Sa.height=kt.height,Sa.leaf=kt.leaf,p(kt,this.toBBox),p(Sa,this.toBBox),mt?se[mt-1].children.push(Sa):this._splitRoot(kt,Sa)},d.prototype._splitRoot=function(se,mt){this.data=nt([se,mt]),this.data.height=se.height+1,this.data.leaf=!1,p(this.data,this.toBBox)},d.prototype._chooseSplitIndex=function(se,mt,kt){for(var mn,_i,zi,Sa,fa,La,Ra,ma=1/0,yt=1/0,lt=mt;lt<=kt-mt;lt++){var pi=y(se,0,lt,this.toBBox),ba=y(se,lt,kt,this.toBBox),Sc=(_i=pi,zi=ba,Sa=void 0,fa=void 0,La=void 0,Ra=void 0,Sa=Math.max(_i.minX,zi.minX),fa=Math.max(_i.minY,zi.minY),La=Math.min(_i.maxX,zi.maxX),Ra=Math.min(_i.maxY,zi.maxY),Math.max(0,La-Sa)*Math.max(0,Ra-fa)),ms=F(pi)+F(ba);Sc<ma?(ma=Sc,mn=lt,yt=ms<yt?ms:yt):Sc===ma&&ms<yt&&(yt=ms,mn=lt)}return mn||kt-mt},d.prototype._chooseSplitAxis=function(se,mt,kt){var mn=se.leaf?this.compareMinX:P,_i=se.leaf?this.compareMinY:L;this._allDistMargin(se,mt,kt,mn)<this._allDistMargin(se,mt,kt,_i)&&se.children.sort(mn)},d.prototype._allDistMargin=function(se,mt,kt,mn){se.children.sort(mn);for(var _i=this.toBBox,zi=y(se,0,mt,_i),Sa=y(se,kt-mt,kt,_i),fa=N(zi)+N(Sa),La=mt;La<kt-mt;La++){var Ra=se.children[La];S(zi,se.leaf?_i(Ra):Ra),fa+=N(zi)}for(var ma=kt-mt-1;ma>=mt;ma--){var yt=se.children[ma];S(Sa,se.leaf?_i(yt):yt),fa+=N(Sa)}return fa},d.prototype._adjustParentBBoxes=function(se,mt,kt){for(var mn=kt;mn>=0;mn--)S(mt[mn],se)},d.prototype._condense=function(se){for(var mt=se.length-1,kt=void 0;mt>=0;mt--)se[mt].children.length===0?mt>0?(kt=se[mt-1].children).splice(kt.indexOf(se[mt]),1):this.clear():p(se[mt],this.toBBox)},d})}}),require_unitbezier_d=__commonJS({"src/types/unitbezier.d.ts"(){}}),require_tinyqueue=__commonJS({"node_modules/tinyqueue/tinyqueue.js"(t,n){(function(o,s){typeof t=="object"&&typeof n<"u"?n.exports=s():typeof define=="function"&&define.amd?define(s):(o=o||self,o.TinyQueue=s())})(t,function(){var o=function(d,h){if(d===void 0&&(d=[]),h===void 0&&(h=s),this.data=d,this.length=this.data.length,this.compare=h,this.length>0)for(var p=(this.length>>1)-1;p>=0;p--)this._down(p)};o.prototype.push=function(d){this.data.push(d),this.length++,this._up(this.length-1)},o.prototype.pop=function(){if(this.length!==0){var d=this.data[0],h=this.data.pop();return this.length--,this.length>0&&(this.data[0]=h,this._down(0)),d}},o.prototype.peek=function(){return this.data[0]},o.prototype._up=function(d){for(var h=this,p=h.data,y=h.compare,S=p[d];d>0;){var P=d-1>>1,L=p[P];if(y(S,L)>=0)break;p[d]=L,d=P}p[d]=S},o.prototype._down=function(d){for(var h=this,p=h.data,y=h.compare,S=this.length>>1,P=p[d];d<S;){var L=(d<<1)+1,F=p[L],N=L+1;if(N<this.length&&y(p[N],F)<0&&(L=N,F=p[N]),y(F,P)>=0)break;p[d]=F,d=L}p[d]=P};function s(c,d){return c<d?-1:c>d?1:0}return o})}}),require_polylabel=__commonJS({"node_modules/polylabel/polylabel.js"(t,n){var o=require_tinyqueue();o.default&&(o=o.default),n.exports=s,n.exports.default=s;function s(S,P,L){P=P||1;for(var F,N,z,W,nt=0;nt<S[0].length;nt++){var Pe=S[0][nt];(!nt||Pe[0]<F)&&(F=Pe[0]),(!nt||Pe[1]<N)&&(N=Pe[1]),(!nt||Pe[0]>z)&&(z=Pe[0]),(!nt||Pe[1]>W)&&(W=Pe[1])}var se=z-F,mt=W-N,kt=Math.min(se,mt),mn=kt/2;if(kt===0){var _i=[F,N];return _i.distance=0,_i}for(var zi=new o(void 0,c),Sa=F;Sa<z;Sa+=kt)for(var fa=N;fa<W;fa+=kt)zi.push(new d(Sa+mn,fa+mn,mn,S));var La=p(S),Ra=new d(F+se/2,N+mt/2,0,S);Ra.d>La.d&&(La=Ra);for(var ma=zi.length;zi.length;){var yt=zi.pop();yt.d>La.d&&(La=yt,L&&console.log("found best %d after %d probes",Math.round(1e4*yt.d)/1e4,ma)),!(yt.max-La.d<=P)&&(mn=yt.h/2,zi.push(new d(yt.x-mn,yt.y-mn,mn,S)),zi.push(new d(yt.x+mn,yt.y-mn,mn,S)),zi.push(new d(yt.x-mn,yt.y+mn,mn,S)),zi.push(new d(yt.x+mn,yt.y+mn,mn,S)),ma+=4)}L&&(console.log("num probes: "+ma),console.log("best distance: "+La.d));var lt=[La.x,La.y];return lt.distance=La.d,lt}function c(S,P){return P.max-S.max}function d(S,P,L,F){this.x=S,this.y=P,this.h=L,this.d=h(S,P,F),this.max=this.d+this.h*Math.SQRT2}function h(S,P,L){for(var F=!1,N=1/0,z=0;z<L.length;z++)for(var W=L[z],nt=0,Pe=W.length,se=Pe-1;nt<Pe;se=nt++){var mt=W[nt],kt=W[se];mt[1]>P!=kt[1]>P&&S<(kt[0]-mt[0])*(P-mt[1])/(kt[1]-mt[1])+mt[0]&&(F=!F),N=Math.min(N,y(S,P,mt,kt))}return N===0?0:(F?1:-1)*Math.sqrt(N)}function p(S){for(var P=0,L=0,F=0,N=S[0],z=0,W=N.length,nt=W-1;z<W;nt=z++){var Pe=N[z],se=N[nt],mt=Pe[0]*se[1]-se[0]*Pe[1];L+=(Pe[0]+se[0])*mt,F+=(Pe[1]+se[1])*mt,P+=mt*3}return P===0?new d(N[0][0],N[0][1],0,S):new d(L/P,F/P,0,S)}function y(S,P,L,F){var N=L[0],z=L[1],W=F[0]-N,nt=F[1]-z;if(W!==0||nt!==0){var Pe=((S-N)*W+(P-z)*nt)/(W*W+nt*nt);Pe>1?(N=F[0],z=F[1]):Pe>0&&(N+=W*Pe,z+=nt*Pe)}return W=S-N,nt=P-z,W*W+nt*nt}}});__toModule(require_point_geometry()),__toModule(require_point_geometry());var import_point_geometry=__toModule(require_point_geometry()),import_vector_tile=__toModule(require_vector_tile()),import_pbf=__toModule(require_pbf()),u8=Uint8Array,u16=Uint16Array,u32=Uint32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),freb=function(t,n){for(var o=new u16(31),s=0;s<31;++s)o[s]=n+=1<<t[s-1];for(var c=new u32(o[30]),s=1;s<30;++s)for(var d=o[s];d<o[s+1];++d)c[d]=d-o[s]<<5|s;return[o,c]},_a$1=freb(fleb,2),fl$1=_a$1[0],revfl=_a$1[1];fl$1[28]=258,revfl[258]=28,freb(fdeb,0);var rev=new u16(32768);for(i=0;i<32768;++i)x=(i&43690)>>>1|(i&21845)<<1,x=(x&52428)>>>2|(x&13107)<<2,x=(x&61680)>>>4|(x&3855)<<4,rev[i]=((x&65280)>>>8|(x&255)<<8)>>>1;var x,i,flt=new u8(288);for(i=0;i<144;++i)flt[i]=8;var i;for(i=144;i<256;++i)flt[i]=9;var i;for(i=256;i<280;++i)flt[i]=7;var i;for(i=280;i<288;++i)flt[i]=8;var i,fdt=new u8(32);for(i=0;i<32;++i)fdt[i]=5;var i,et$1=new u8(0),td$1=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td$1.decode(et$1,{stream:!0}),tds=1}catch(t){}var GeomType;(function(t){t[t.Point=1]="Point",t[t.Line=2]="Line",t[t.Polygon=3]="Polygon"})(GeomType||(GeomType={}));function toIndex(t){return t.x+":"+t.y+":"+t.z}var loadGeomAndBbox=(t,n,o)=>{t.pos=n;for(var s=t.readVarint()+t.pos,c=1,d=0,h=0,p=0,y=1/0,S=-1/0,P=1/0,L=-1/0,F=[],N=[];t.pos<s;){if(d<=0){var z=t.readVarint();c=z&7,d=z>>3}if(d--,c===1||c===2)h+=t.readSVarint()*o,p+=t.readSVarint()*o,h<y&&(y=h),h>S&&(S=h),p<P&&(P=p),p>L&&(L=p),c===1&&(N.length>0&&F.push(N),N=[]),N.push(new import_point_geometry.default(h,p));else if(c===7)N&&N.push(N[0].clone());else throw new Error("unknown command "+c)}return N&&F.push(N),{geom:F,bbox:{minX:y,minY:P,maxX:S,maxY:L}}};function parseTile(t,n){let o=new import_vector_tile.VectorTile(new import_pbf.default(t)),s=new Map;for(let[c,d]of Object.entries(o.layers)){let h=[],p=d;for(let y=0;y<p.length;y++){let S=loadGeomAndBbox(p.feature(y)._pbf,p.feature(y)._geometry,n/p.extent),P=0;for(let L of S.geom)P+=L.length;h.push({id:p.feature(y).id,geomType:p.feature(y).type,geom:S.geom,numVertices:P,bbox:S.bbox,props:p.feature(y).properties})}s.set(c,h)}return s}var ZxySource=class{constructor(t,n){this.url=t,this.controllers=[],this.shouldCancelZooms=n}get(t,n){return __async(this,null,function*(){this.shouldCancelZooms&&(this.controllers=this.controllers.filter(d=>d[0]!=t.z?(d[1].abort(),!1):!0));let o=this.url.replace("{z}",t.z.toString()).replace("{x}",t.x.toString()).replace("{y}",t.y.toString());const s=new AbortController;this.controllers.push([t.z,s]);const c=s.signal;return new Promise((d,h)=>{fetch(o,{signal:c}).then(p=>p.arrayBuffer()).then(p=>{let y=parseTile(p,n);d(y)}).catch(p=>{h(p)})})})}},R=6378137,MAX_LATITUDE=85.0511287798,MAXCOORD=R*Math.PI,project=t=>{let n=Math.PI/180,o=Math.max(Math.min(MAX_LATITUDE,t[0]),-85.0511287798),s=Math.sin(o*n);return new import_point_geometry.default(R*t[1]*n,R*Math.log((1+s)/(1-s))/2)};function sqr(t){return t*t}function dist2(t,n){return sqr(t.x-n.x)+sqr(t.y-n.y)}function distToSegmentSquared(t,n,o){var s=dist2(n,o);if(s===0)return dist2(t,n);var c=((t.x-n.x)*(o.x-n.x)+(t.y-n.y)*(o.y-n.y))/s;return c=Math.max(0,Math.min(1,c)),dist2(t,new import_point_geometry.default(n.x+c*(o.x-n.x),n.y+c*(o.y-n.y)))}function isInRing(t,n){for(var o=!1,s=0,c=n.length-1;s<n.length;c=s++){var d=n[s].x,h=n[s].y,p=n[c].x,y=n[c].y,S=h>t.y!=y>t.y&&t.x<(p-d)*(t.y-h)/(y-h)+d;S&&(o=!o)}return o}function isCCW(t){for(var n=0,o=0;o<t.length;o++){let s=(o+1)%t.length;n+=t[o].x*t[s].y,n-=t[s].x*t[o].y}return n<0}function pointInPolygon(t,n){var o=!1;for(let s of n)if(isCCW(s))isInRing(t,s)&&(o=!1);else{if(o)return!0;isInRing(t,s)&&(o=!0)}return o}function pointMinDistToPoints(t,n){let o=1/0;for(let s of n){let c=Math.sqrt(dist2(t,s[0]));c<o&&(o=c)}return o}function pointMinDistToLines(t,n){let o=1/0;for(let c of n)for(var s=0;s<c.length-1;s++){let d=Math.sqrt(distToSegmentSquared(t,c[s],c[s+1]));d<o&&(o=d)}return o}var TileCache=class{constructor(t,n){this.source=t,this.cache=new Map,this.inflight=new Map,this.tileSize=n}queryFeatures(t,n,o,s){let c=project([n,t]);var d=new import_point_geometry.default((c.x+MAXCOORD)/(MAXCOORD*2),1-(c.y+MAXCOORD)/(MAXCOORD*2));d.x>1&&(d.x=d.x-Math.floor(d.x));let h=d.mult(1<<o),p=Math.floor(h.x),y=Math.floor(h.y);const S=toIndex({z:o,x:p,y});let P=[],L=this.cache.get(S);if(L){const F=new import_point_geometry.default((h.x-p)*this.tileSize,(h.y-y)*this.tileSize);for(let[N,z]of L.data.entries())for(let W of z)W.geomType==1?pointMinDistToPoints(F,W.geom)<s&&P.push({feature:W,layerName:N}):W.geomType==2?pointMinDistToLines(F,W.geom)<s&&P.push({feature:W,layerName:N}):pointInPolygon(F,W.geom)&&P.push({feature:W,layerName:N})}return P}get(t){return __async(this,null,function*(){const n=toIndex(t);return new Promise((o,s)=>{let c=this.cache.get(n);if(c)c.used=performance.now(),o(c.data);else{let d=this.inflight.get(n);d?d.push([o,s]):(this.inflight.set(n,[]),this.source.get(t,this.tileSize).then(h=>{this.cache.set(n,{used:performance.now(),data:h});let p=this.inflight.get(n);if(p&&p.forEach(y=>y[0](h)),this.inflight.delete(n),o(h),this.cache.size>=64){let y=1/0,S;this.cache.forEach((P,L)=>{P.used<y&&(y=P.used,S=L)}),S&&this.cache.delete(S)}}).catch(h=>{let p=this.inflight.get(n);p&&p.forEach(y=>y[1](h)),this.inflight.delete(n),s(h)}))}})})}};__toModule(require_point_geometry()),__toModule(require_point_geometry()),__toModule(require_rbush_min());var e=t=>parseInt(t.replace(/_/g,""),36);"1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,n)=>{const o=e(n.substring(0,3)),s=e(n.substring(3)).toString(16);let c="";for(let d=0;d<6-s.length;d++)c+="0";return t[o]=`${c}${s}`,t},{});var _$1=(t,n)=>Array.from(Array(n)).map(()=>t).join("");new RegExp(`^#${_$1("([a-f0-9])",3)}([a-f0-9])?$`,"i"),new RegExp(`^#${_$1("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${_$1(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),__toModule(require_point_geometry()),__toModule(require_unitbezier_d()),__toModule(require_polylabel()),__toModule(require_point_geometry());var Justify;(function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"})(Justify||(Justify={}));var TextPlacements;(function(t){t[t.N=1]="N",t[t.NE=2]="NE",t[t.E=3]="E",t[t.SE=4]="SE",t[t.S=5]="S",t[t.SW=6]="SW",t[t.W=7]="W",t[t.NW=8]="NW"})(TextPlacements||(TextPlacements={}));var LineLabelPlacement;(function(t){t[t.Above=1]="Above",t[t.Center=2]="Center",t[t.Below=3]="Below"})(LineLabelPlacement||(LineLabelPlacement={})),__toModule(require_point_geometry());/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function makeKey({x:t,y:n,level:o}){return`${o}:${t}:${n}`}function getTileCoords(t,n){if(n!=null&&t.level>n){const o=2**(t.level-n);return{x:Math.floor(t.x/o),y:Math.floor(t.y/o),z:n}}return{x:t.x,y:t.y,z:t.level}}class JapanGSIOptimalBVmapImageryProviderBase{constructor(n){Rf(this,"defaultAlpha");Rf(this,"defaultNightAlpha");Rf(this,"defaultDayAlpha");Rf(this,"defaultBrightness");Rf(this,"defaultContrast");Rf(this,"defaultHue");Rf(this,"defaultSaturation");Rf(this,"defaultGamma");Rf(this,"defaultMinificationFilter");Rf(this,"defaultMagnificationFilter");Rf(this,"ready",!0);Rf(this,"readyPromise",Promise.resolve(!0));Rf(this,"tileWidth",256);Rf(this,"tileHeight",256);Rf(this,"maximumLevel");Rf(this,"minimumLevel",0);Rf(this,"tilingScheme",new WebMercatorTilingScheme);Rf(this,"rectangle",this.tilingScheme.rectangle);Rf(this,"tileDiscardPolicy");Rf(this,"errorEvent",new Event$1);Rf(this,"credit");Rf(this,"proxy");Rf(this,"hasAlphaChannel",!0);(n==null?void 0:n.tilingScheme)!=null&&(this.tilingScheme=n.tilingScheme),(n==null?void 0:n.tileWidth)!=null&&(this.tileWidth=n.tileWidth),(n==null?void 0:n.tileHeight)!=null&&(this.tileHeight=n.tileHeight)}getTileCredits(n,o,s){}requestImage(n,o,s,c){}pickFeatures(n,o,s,c,d){}get _ready(){return this.ready}get _readyPromise(){return this.readyPromise}}class JapanGSIOptimalBVmapLabelImageryProvider extends JapanGSIOptimalBVmapImageryProviderBase{constructor(o){super(o);Rf(this,"minimumDataLevel");Rf(this,"maximumDataLevel");Rf(this,"tileCache");Rf(this,"image");Rf(this,"discardedTileCoords",new Set);this.tileDiscardPolicy=new DiscardEmptyTileImagePolicy,this.minimumDataLevel=o.minimumDataLevel,this.maximumDataLevel=o.maximumDataLevel;const s=new ZxySource(o.url,!1);this.tileCache=new TileCache(s,1024),this.image=document.createElement("canvas"),this.image.width=1,this.image.height=1}requestImage(o,s,c,d){const h=makeKey({x:o,y:s,level:c});return(async()=>c<this.minimumDataLevel||this.discardedTileCoords.has(h)?DiscardEmptyTileImagePolicy.EMPTY_IMAGE:(await this.tileCache.get(getTileCoords({x:o,y:s,level:c},this.maximumDataLevel)),this.image))().catch(()=>(this.discardedTileCoords.add(h),DiscardEmptyTileImagePolicy.EMPTY_IMAGE))}}const tiles={default:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.AERIAL,{accessToken:t}).catch(console.error),default_label:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.AERIAL_WITH_LABELS,{accessToken:t}).catch(console.error),default_road:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.ROAD,{accessToken:t}).catch(console.error),open_street_map:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://a.tile.openstreetmap.org/",credit:"Copyright: Tiles © Esri — Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012"}),esri_world_topo:()=>Cesium$1.ArcGisMapServerImageryProvider.fromUrl("https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",{credit:"Copyright: Tiles © Esri — Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Communit",enablePickFeatures:!1}).catch(console.error),black_marble:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(3812,{accessToken:t}).catch(console.error),japan_gsi_standard:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://cyberjapandata.gsi.go.jp/xyz/std/"}),url:({url:t,heatmap:n,tile_zoomLevel:o}={})=>t?new Cesium$1.UrlTemplateImageryProvider({url:t,tileDiscardPolicy:n?new Cesium$1.DiscardEmptyTileImagePolicy:void 0,minimumLevel:o==null?void 0:o[0],maximumLevel:o==null?void 0:o[1]}):null};function ImageryLayers({tiles:t,cesiumIonAccessToken:n,onTilesChange:o}){const{providers:s,updated:c}=useImageryProviders({tiles:t,cesiumIonAccessToken:n,presets:tiles}),[d,h]=React.useState(0);return React.useLayoutEffect(()=>{c&&h(p=>p+1)},[s,c]),React.useEffect(()=>{o==null||o()},[t,d,o]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t==null?void 0:t.map(({id:p,...y})=>{var S;return{...y,id:p,provider:(S=s[p])==null?void 0:S[2]}}).map(({id:p,opacity:y,zoomLevel:S,provider:P,heatmap:L},F)=>P?jsxRuntimeExports.jsx(Ns$1,{imageryProvider:P,minimumTerrainLevel:S==null?void 0:S[0],maximumTerrainLevel:S==null?void 0:S[1],alpha:y,index:F,colorToAlpha:L?Cesium$1.Color.WHITE:void 0,colorToAlphaThreshold:L?1:void 0,magnificationFilter:L?Cesium$1.TextureMagnificationFilter.LINEAR:void 0,minificationFilter:L?Cesium$1.TextureMinificationFilter.NEAREST:void 0},`${p}_${F}_${d}`):null)})}function useImageryProviders({tiles:t=[],cesiumIonAccessToken:n,presets:o}){const s=React.useCallback((F,N)=>o[F.type||"default"]({url:F.url,cesiumIonAccessToken:N,heatmap:F.heatmap,zoomLevel:F.zoomLevelForURL}),[o]),c=React.useRef(n),d=t.map(F=>F.id).join(","),h=React.useRef(d),p=React.useRef({}),y=React.useMemo(()=>t.map(F=>{if(F.id&&F.zoomLevel)return{[F.id]:F.zoomLevel}}),[t]),S=React.useRef(y),{providers:P,updated:L}=React.useMemo(()=>{const F=c.current!==n,N=Object.keys(p.current),z=t.map(se=>se.id).filter(se=>se&&!N.includes(se)),W=[...Object.entries(p.current),...z.map(se=>[se,void 0])].map(([se,mt])=>({key:se,added:z.includes(se),prevType:mt==null?void 0:mt[0],prevUrl:mt==null?void 0:mt[1],prevProvider:mt==null?void 0:mt[2],tile:t.find(kt=>kt.id===se)})),nt=Object.fromEntries(W.map(({key:se,added:mt,prevType:kt,prevUrl:mn,prevProvider:_i,tile:zi})=>zi?[se,mt||kt!==zi.type||mn!==zi.url||F&&(!zi.type||zi.type==="default")?[zi.type,zi.url,s(zi,n)]:[kt,mn,_i]]:null).filter(se=>!!(se!=null&&se[1][2]))),Pe=!!z.length||!!F||!isEqual(h.current,d)||!isEqual(S.current,y)||W.some(se=>se.tile&&(se.prevType!==se.tile.type||se.prevUrl!==se.tile.url));return h.current=d,S.current=y,c.current=n,{providers:nt,updated:Pe}},[n,t,d,s,y]);return p.current=P,{providers:P,updated:L}}const useTransition=(t,n,o)=>{const[s,c]=React.useState(t?"entered":o&&o.mountOnEnter?"unmounted":"exited"),d=React.useRef(),h=React.useRef(),p=React.useCallback(()=>{c(t?"entered":o&&o.unmountOnExit?"unmounted":"exited"),h.current=void 0},[t,!!o&&o.unmountOnExit,h]),y=React.useCallback(()=>{c("entered"),h.current=void 0},[h]),S=React.useCallback(()=>{c(t?"entered":o&&o.unmountOnExit?"unmounted":"exited"),h.current=void 0},[t,!!o&&o.unmountOnExit,h]),P=React.useCallback(()=>{c(t?"entering":"exiting"),d.current=setTimeout(S,n),h.current=Date.now()+n},[t,n,S,d,h]);return React.useEffect(()=>{if(t?s==="entered":s==="exited"||s==="unmounted"){h.current=void 0;return}const L=Date.now(),F=typeof h.current>"u"?n:n-(h.current-L);return!t&&(s==="entered"||s==="entering")?(c("exiting"),d.current=setTimeout(p,F)):t&&(s==="exited"||s==="exiting")?(c("entering"),d.current=setTimeout(y,F)):(c(t?"exited":"entered"),d.current=setTimeout(P,30)),h.current=L+F,()=>{clearTimeout(d.current)}},[t]),s},SvgCrosshair=t=>React__namespace.createElement("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25 5.02586C34.6974 5.52871 42.4713 13.3026 42.9741 23H47C47.5523 23 48 23.4477 48 24C48 24.5523 47.5523 25 47 25H42.9741C42.4713 34.6974 34.6974 42.4713 25 42.9741V47C25 47.5523 24.5523 48 24 48C23.4477 48 23 47.5523 23 47V42.9741C13.3026 42.4713 5.52871 34.6974 5.02586 25H1C0.447715 25 0 24.5523 0 24C0 23.4477 0.447715 23 1 23H5.02586C5.52871 13.3026 13.3026 5.52871 23 5.02586V1C23 0.447715 23.4477 0 24 0C24.5523 0 25 0.447715 25 1V5.02586ZM41.5 24C41.5 33.665 33.665 41.5 24 41.5C14.335 41.5 6.5 33.665 6.5 24C6.5 14.335 14.335 6.5 24 6.5C33.665 6.5 41.5 14.335 41.5 24Z",fill:"white"}));function Indicator({className:t,property:n,timelineManagerRef:o}){const{viewer:s}=$e$1(),[c,d]=React.useState(!0),[h,p]=React.useState(),y=useTransition(!!h&&c,500,{mountOnEnter:!0,unmountOnExit:!0}),{type:S,image:P,imageScale:L}=(n==null?void 0:n.indicator)??{},[F,N,z]=useIcon({image:P,imageSize:L});return React.useEffect(()=>{!S||S==="default"?s==null||s.selectionIndicator.viewModel.selectionIndicatorElement.removeAttribute("hidden"):s==null||s.selectionIndicator.viewModel.selectionIndicatorElement.setAttribute("hidden","true")},[S,s,s==null?void 0:s.selectionIndicator]),React.useEffect(()=>{if(!s)return;const W=()=>{var _i,zi,Sa;if(s.isDestroyed())return;const Pe=s.selectedEntity,se=(zi=(_i=o==null?void 0:o.current)==null?void 0:_i.timeline)!=null&&zi.current?Cesium$1.JulianDate.fromDate((Sa=o==null?void 0:o.current)==null?void 0:Sa.timeline.current):void 0;if(!(Pe!=null&&Pe.isShowing)||se&&!Pe.isAvailable(se)||!Pe.position){d(!1);return}let mt;const kt=new Cesium$1.BoundingSphere;if(s.dataSourceDisplay.getBoundingSphere(Pe,!0,kt)!==2?mt=kt.center:Pe.position&&se&&(mt=Pe.position.getValue(se,mt)),mt){const fa=Cesium$1.SceneTransforms.wgs84ToWindowCoordinates(s.scene,mt);p(fa),d(!0)}else d(!1)},nt=o==null?void 0:o.current;return nt==null||nt.onTick(W),()=>{nt==null||nt.offTick(W)}},[s,o]),y!=="unmounted"&&h?S==="crosshair"?jsxRuntimeExports.jsx("div",{className:t,style:{width:48,height:48,fontSize:0,display:"inline-block",transitionProperty:"color, background",left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"},children:jsxRuntimeExports.jsx(SvgCrosshair,{})}):S==="custom"?jsxRuntimeExports.jsx("img",{src:F,width:N,height:z,style:{left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"}}):jsxRuntimeExports.jsx("div",{style:{left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"}}):null}const annotationTypes={municipalities:[110,140],towns:[120,130,210,220,800],roads:[411],railways:[421],stations:[422],landmarks:[412,413,423,431,432,441,511,521,522,523,531,532,533,534,611,612,613,615,621,631,632,633,634,651,653,661,662,671,673,681,860,870,880,881,882,883,884,885,886,887,888,889,890,899],topography:[311,312,313,314,315,316,321,322,323,331,332,333,341,342,343,344,345,346,347,348,351,352,353,361,810,820,822,830,831,832,840,841,842,843,850]},typeMap=fromPairs(Object.entries(annotationTypes).flatMap(([t,n])=>n.map(o=>[o,t])));function getAnnotationType(t){return typeMap[t]}function useSceneEvent(t,n){const{viewer:o}=$e$1(),s=o==null?void 0:o.scene,c=React.useRef(n);c.current=n,React.useLayoutEffect(()=>s==null?void 0:s[t].addEventListener((d,h)=>{try{c.current(d,h)}catch(p){console.error(p)}}),[t,s])}function usePreRender(t){useSceneEvent("preRender",t)}const isPromise=t=>typeof t=="object"&&typeof t.then=="function",globalCache=[];function shallowEqualArrays(t,n,o=(s,c)=>s===c){if(t===n)return!0;if(!t||!n)return!1;const s=t.length;if(n.length!==s)return!1;for(let c=0;c<s;c++)if(!o(t[c],n[c]))return!1;return!0}function query(t,n=null,o=!1,s={}){n===null&&(n=[t]);for(const d of globalCache)if(shallowEqualArrays(n,d.keys,d.equal)){if(o)return;if(Object.prototype.hasOwnProperty.call(d,"error"))throw d.error;if(Object.prototype.hasOwnProperty.call(d,"response"))return s.lifespan&&s.lifespan>0&&(d.timeout&&clearTimeout(d.timeout),d.timeout=setTimeout(d.remove,s.lifespan)),d.response;if(!o)throw d.promise}const c={keys:n,equal:s.equal,remove:()=>{const d=globalCache.indexOf(c);d!==-1&&globalCache.splice(d,1)},promise:(isPromise(t)?t:t(...n)).then(d=>{c.response=d,s.lifespan&&s.lifespan>0&&(c.timeout=setTimeout(c.remove,s.lifespan))}).catch(d=>c.error=d)};if(globalCache.push(c),!o)throw c.promise}const suspend=(t,n,o)=>query(t,n,!1,o);function coordEach(t,n,o){if(t!==null)for(var s,c,d,h,p,y,S,P=0,L=0,F,N=t.type,z=N==="FeatureCollection",W=N==="Feature",nt=z?t.features.length:1,Pe=0;Pe<nt;Pe++){S=z?t.features[Pe].geometry:W?t.geometry:t,F=S?S.type==="GeometryCollection":!1,p=F?S.geometries.length:1;for(var se=0;se<p;se++){var mt=0,kt=0;if(h=F?S.geometries[se]:S,h!==null){y=h.coordinates;var mn=h.type;switch(P=o&&(mn==="Polygon"||mn==="MultiPolygon")?1:0,mn){case null:break;case"Point":if(n(y,L,Pe,mt,kt)===!1)return!1;L++,mt++;break;case"LineString":case"MultiPoint":for(s=0;s<y.length;s++){if(n(y[s],L,Pe,mt,kt)===!1)return!1;L++,mn==="MultiPoint"&&mt++}mn==="LineString"&&mt++;break;case"Polygon":case"MultiLineString":for(s=0;s<y.length;s++){for(c=0;c<y[s].length-P;c++){if(n(y[s][c],L,Pe,mt,kt)===!1)return!1;L++}mn==="MultiLineString"&&mt++,mn==="Polygon"&&kt++}mn==="Polygon"&&mt++;break;case"MultiPolygon":for(s=0;s<y.length;s++){for(kt=0,c=0;c<y[s].length;c++){for(d=0;d<y[s][c].length-P;d++){if(n(y[s][c][d],L,Pe,mt,kt)===!1)return!1;L++}kt++}mt++}break;case"GeometryCollection":for(s=0;s<h.geometries.length;s++)if(coordEach(h.geometries[s],n,o)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function featureEach(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var o=0;o<t.features.length&&n(t.features[o],o)!==!1;o++);}function geomEach(t,n){var o,s,c,d,h,p,y,S,P,L,F=0,N=t.type==="FeatureCollection",z=t.type==="Feature",W=N?t.features.length:1;for(o=0;o<W;o++){for(p=N?t.features[o].geometry:z?t.geometry:t,S=N?t.features[o].properties:z?t.properties:{},P=N?t.features[o].bbox:z?t.bbox:void 0,L=N?t.features[o].id:z?t.id:void 0,y=p?p.type==="GeometryCollection":!1,h=y?p.geometries.length:1,c=0;c<h;c++){if(d=y?p.geometries[c]:p,d===null){if(n(null,F,S,P,L)===!1)return!1;continue}switch(d.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(d,F,S,P,L)===!1)return!1;break}case"GeometryCollection":{for(s=0;s<d.geometries.length;s++)if(n(d.geometries[s],F,S,P,L)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}F++}}function geomReduce(t,n,o){var s=o;return geomEach(t,function(c,d,h,p,y){s=n(s,c,d,h,p,y)}),s}function flattenEach(t,n){geomEach(t,function(o,s,c,d,h){var p=o===null?null:o.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return n(feature$1(o,c,{bbox:d,id:h}),s,0)===!1?!1:void 0}var y;switch(p){case"MultiPoint":y="Point";break;case"MultiLineString":y="LineString";break;case"MultiPolygon":y="Polygon";break}for(var S=0;S<o.coordinates.length;S++){var P=o.coordinates[S],L={type:y,coordinates:P};if(n(feature$1(L,c),s,S)===!1)return!1}})}var rbush$2={exports:{}},quickselect$2={exports:{}};(function(t,n){(function(o,s){t.exports=s()})(commonjsGlobal,function(){function o(h,p,y,S,P){s(h,p,y||0,S||h.length-1,P||d)}function s(h,p,y,S,P){for(;S>y;){if(S-y>600){var L=S-y+1,F=p-y+1,N=Math.log(L),z=.5*Math.exp(2*N/3),W=.5*Math.sqrt(N*z*(L-z)/L)*(F-L/2<0?-1:1),nt=Math.max(y,Math.floor(p-F*z/L+W)),Pe=Math.min(S,Math.floor(p+(L-F)*z/L+W));s(h,p,nt,Pe,P)}var se=h[p],mt=y,kt=S;for(c(h,y,p),P(h[S],se)>0&&c(h,y,S);mt<kt;){for(c(h,mt,kt),mt++,kt--;P(h[mt],se)<0;)mt++;for(;P(h[kt],se)>0;)kt--}P(h[y],se)===0?c(h,y,kt):(kt++,c(h,kt,S)),kt<=p&&(y=kt+1),p<=kt&&(S=kt-1)}}function c(h,p,y){var S=h[p];h[p]=h[y],h[y]=S}function d(h,p){return h<p?-1:h>p?1:0}return o})})(quickselect$2);var quickselectExports=quickselect$2.exports;rbush$2.exports=rbush,rbush$2.exports.default=rbush;var quickselect$1=quickselectExports;function rbush(t,n){if(!(this instanceof rbush))return new rbush(t,n);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),n&&this._initFormat(n),this.clear()}rbush.prototype={all:function(){return this._all(this.data,[])},search:function(t){var n=this.data,o=[],s=this.toBBox;if(!intersects(t,n))return o;for(var c=[],d,h,p,y;n;){for(d=0,h=n.children.length;d<h;d++)p=n.children[d],y=n.leaf?s(p):p,intersects(t,y)&&(n.leaf?o.push(p):contains(t,y)?this._all(p,o):c.push(p));n=c.pop()}return o},collides:function(t){var n=this.data,o=this.toBBox;if(!intersects(t,n))return!1;for(var s=[],c,d,h,p;n;){for(c=0,d=n.children.length;c<d;c++)if(h=n.children[c],p=n.leaf?o(h):h,intersects(t,p)){if(n.leaf||contains(t,p))return!0;s.push(h)}n=s.pop()}return!1},load:function(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var n=0,o=t.length;n<o;n++)this.insert(t[n]);return this}var s=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=s;else if(this.data.height===s.height)this._splitRoot(this.data,s);else{if(this.data.height<s.height){var c=this.data;this.data=s,s=c}this._insert(s,this.data.height-s.height-1,!0)}return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=createNode([]),this},remove:function(t,n){if(!t)return this;for(var o=this.data,s=this.toBBox(t),c=[],d=[],h,p,y,S;o||c.length;){if(o||(o=c.pop(),p=c[c.length-1],h=d.pop(),S=!0),o.leaf&&(y=findItem(t,o.children,n),y!==-1))return o.children.splice(y,1),c.push(o),this._condense(c),this;!S&&!o.leaf&&contains(o,s)?(c.push(o),d.push(h),h=0,p=o,o=o.children[0]):p?(h++,o=p.children[h],S=!1):o=null}return this},toBBox:function(t){return t},compareMinX:compareNodeMinX,compareMinY:compareNodeMinY,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,n){for(var o=[];t;)t.leaf?n.push.apply(n,t.children):o.push.apply(o,t.children),t=o.pop();return n},_build:function(t,n,o,s){var c=o-n+1,d=this._maxEntries,h;if(c<=d)return h=createNode(t.slice(n,o+1)),calcBBox(h,this.toBBox),h;s||(s=Math.ceil(Math.log(c)/Math.log(d)),d=Math.ceil(c/Math.pow(d,s-1))),h=createNode([]),h.leaf=!1,h.height=s;var p=Math.ceil(c/d),y=p*Math.ceil(Math.sqrt(d)),S,P,L,F;for(multiSelect(t,n,o,y,this.compareMinX),S=n;S<=o;S+=y)for(L=Math.min(S+y-1,o),multiSelect(t,S,L,p,this.compareMinY),P=S;P<=L;P+=p)F=Math.min(P+p-1,L),h.children.push(this._build(t,P,F,s-1));return calcBBox(h,this.toBBox),h},_chooseSubtree:function(t,n,o,s){for(var c,d,h,p,y,S,P,L;s.push(n),!(n.leaf||s.length-1===o);){for(P=L=1/0,c=0,d=n.children.length;c<d;c++)h=n.children[c],y=bboxArea(h),S=enlargedArea(t,h)-y,S<L?(L=S,P=y<P?y:P,p=h):S===L&&y<P&&(P=y,p=h);n=p||n.children[0]}return n},_insert:function(t,n,o){var s=this.toBBox,c=o?t:s(t),d=[],h=this._chooseSubtree(c,this.data,n,d);for(h.children.push(t),extend$1(h,c);n>=0&&d[n].children.length>this._maxEntries;)this._split(d,n),n--;this._adjustParentBBoxes(c,d,n)},_split:function(t,n){var o=t[n],s=o.children.length,c=this._minEntries;this._chooseSplitAxis(o,c,s);var d=this._chooseSplitIndex(o,c,s),h=createNode(o.children.splice(d,o.children.length-d));h.height=o.height,h.leaf=o.leaf,calcBBox(o,this.toBBox),calcBBox(h,this.toBBox),n?t[n-1].children.push(h):this._splitRoot(o,h)},_splitRoot:function(t,n){this.data=createNode([t,n]),this.data.height=t.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)},_chooseSplitIndex:function(t,n,o){var s,c,d,h,p,y,S,P;for(y=S=1/0,s=n;s<=o-n;s++)c=distBBox(t,0,s,this.toBBox),d=distBBox(t,s,o,this.toBBox),h=intersectionArea(c,d),p=bboxArea(c)+bboxArea(d),h<y?(y=h,P=s,S=p<S?p:S):h===y&&p<S&&(S=p,P=s);return P},_chooseSplitAxis:function(t,n,o){var s=t.leaf?this.compareMinX:compareNodeMinX,c=t.leaf?this.compareMinY:compareNodeMinY,d=this._allDistMargin(t,n,o,s),h=this._allDistMargin(t,n,o,c);d<h&&t.children.sort(s)},_allDistMargin:function(t,n,o,s){t.children.sort(s);var c=this.toBBox,d=distBBox(t,0,n,c),h=distBBox(t,o-n,o,c),p=bboxMargin(d)+bboxMargin(h),y,S;for(y=n;y<o-n;y++)S=t.children[y],extend$1(d,t.leaf?c(S):S),p+=bboxMargin(d);for(y=o-n-1;y>=n;y--)S=t.children[y],extend$1(h,t.leaf?c(S):S),p+=bboxMargin(h);return p},_adjustParentBBoxes:function(t,n,o){for(var s=o;s>=0;s--)extend$1(n[s],t)},_condense:function(t){for(var n=t.length-1,o;n>=0;n--)t[n].children.length===0?n>0?(o=t[n-1].children,o.splice(o.indexOf(t[n]),1)):this.clear():calcBBox(t[n],this.toBBox)},_initFormat:function(t){var n=["return a"," - b",";"];this.compareMinX=new Function("a","b",n.join(t[0])),this.compareMinY=new Function("a","b",n.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};function findItem(t,n,o){if(!o)return n.indexOf(t);for(var s=0;s<n.length;s++)if(o(t,n[s]))return s;return-1}function calcBBox(t,n){distBBox(t,0,t.children.length,n,t)}function distBBox(t,n,o,s,c){c||(c=createNode(null)),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0;for(var d=n,h;d<o;d++)h=t.children[d],extend$1(c,t.leaf?s(h):h);return c}function extend$1(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function compareNodeMinX(t,n){return t.minX-n.minX}function compareNodeMinY(t,n){return t.minY-n.minY}function bboxArea(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function bboxMargin(t){return t.maxX-t.minX+(t.maxY-t.minY)}function enlargedArea(t,n){return(Math.max(n.maxX,t.maxX)-Math.min(n.minX,t.minX))*(Math.max(n.maxY,t.maxY)-Math.min(n.minY,t.minY))}function intersectionArea(t,n){var o=Math.max(t.minX,n.minX),s=Math.max(t.minY,n.minY),c=Math.min(t.maxX,n.maxX),d=Math.min(t.maxY,n.maxY);return Math.max(0,c-o)*Math.max(0,d-s)}function contains(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function intersects(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function createNode(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(t,n,o,s,c){for(var d=[n,o],h;d.length;)o=d.pop(),n=d.pop(),!(o-n<=s)&&(h=n+Math.ceil((o-n)/s/2)*s,quickselect$1(t,h,n,o,c),d.push(n,h,h,o))}var rbushExports=rbush$2.exports;const rbush$1=getDefaultExportFromCjs(rbushExports);var RADIUS=6378137;function area(t){return geomReduce(t,function(n,o){return n+calculateArea(o)},0)}function calculateArea(t){var n=0,o;switch(t.type){case"Polygon":return polygonArea(t.coordinates);case"MultiPolygon":for(o=0;o<t.coordinates.length;o++)n+=polygonArea(t.coordinates[o]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function polygonArea(t){var n=0;if(t&&t.length>0){n+=Math.abs(ringArea(t[0]));for(var o=1;o<t.length;o++)n-=Math.abs(ringArea(t[o]))}return n}function ringArea(t){var n,o,s,c,d,h,p,y=0,S=t.length;if(S>2){for(p=0;p<S;p++)p===S-2?(c=S-2,d=S-1,h=0):p===S-1?(c=S-1,d=0,h=1):(c=p,d=p+1,h=p+2),n=t[c],o=t[d],s=t[h],y+=(rad(s[0])-rad(n[0]))*Math.sin(rad(o[1]));y=y*RADIUS*RADIUS/2}return y}function rad(t){return t*Math.PI/180}function booleanPointInPolygon(t,n,o){if(o===void 0&&(o={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var s=getCoord$2(t),c=getGeom$2(n),d=c.type,h=n.bbox,p=c.coordinates;if(h&&inBBox(s,h)===!1)return!1;d==="Polygon"&&(p=[p]);for(var y=!1,S=0;S<p.length&&!y;S++)if(inRing(s,p[S][0],o.ignoreBoundary)){for(var P=!1,L=1;L<p[S].length&&!P;)inRing(s,p[S][L],!o.ignoreBoundary)&&(P=!0),L++;P||(y=!0)}return y}function inRing(t,n,o){var s=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var c=0,d=n.length-1;c<n.length;d=c++){var h=n[c][0],p=n[c][1],y=n[d][0],S=n[d][1],P=t[1]*(h-y)+p*(y-t[0])+S*(t[0]-h)===0&&(h-t[0])*(y-t[0])<=0&&(p-t[1])*(S-t[1])<=0;if(P)return!o;var L=p>t[1]!=S>t[1]&&t[0]<(y-h)*(t[1]-p)/(S-p)+h;L&&(s=!s)}return s}function inBBox(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function isects(t,n,o){if(t.geometry.type!=="Polygon")throw new Error("The input feature must be a Polygon");o===void 0&&(o=1);var s=t.geometry.coordinates,c=[],d={};if(o){for(var h=[],p=0;p<s.length;p++)for(var y=0;y<s[p].length-1;y++)h.push(nt(p,y));var S=rbush$1();S.load(h)}for(var P=0;P<s.length;P++)for(var L=0;L<s[P].length-1;L++)if(o){var F=S.search(nt(P,L));F.forEach(function(Pe){var se=Pe.ring,mt=Pe.edge;W(P,L,se,mt)})}else for(var N=0;N<s.length;N++)for(var z=0;z<s[N].length-1;z++)W(P,L,N,z);return n||(c={type:"Feature",geometry:{type:"MultiPoint",coordinates:c}}),c;function W(Pe,se,mt,kt){var mn=s[Pe][se],_i=s[Pe][se+1],zi=s[mt][kt],Sa=s[mt][kt+1],fa=intersect(mn,_i,zi,Sa);if(fa!==null){var La,Ra;if(_i[0]!==mn[0]?La=(fa[0]-mn[0])/(_i[0]-mn[0]):La=(fa[1]-mn[1])/(_i[1]-mn[1]),Sa[0]!==zi[0]?Ra=(fa[0]-zi[0])/(Sa[0]-zi[0]):Ra=(fa[1]-zi[1])/(Sa[1]-zi[1]),!(La>=1||La<=0||Ra>=1||Ra<=0)){var ma=fa,yt=!d[ma];yt&&(d[ma]=!0),c.push(n(fa,Pe,se,mn,_i,La,mt,kt,zi,Sa,Ra,yt))}}}function nt(Pe,se){var mt=s[Pe][se],kt=s[Pe][se+1],mn,_i,zi,Sa;return mt[0]<kt[0]?(mn=mt[0],_i=kt[0]):(mn=kt[0],_i=mt[0]),mt[1]<kt[1]?(zi=mt[1],Sa=kt[1]):(zi=kt[1],Sa=mt[1]),{minX:mn,minY:zi,maxX:_i,maxY:Sa,ring:Pe,edge:se}}}function intersect(t,n,o,s){if(equalArrays(t,o)||equalArrays(t,s)||equalArrays(n,o)||equalArrays(s,o))return null;var c=t[0],d=t[1],h=n[0],p=n[1],y=o[0],S=o[1],P=s[0],L=s[1],F=(c-h)*(S-L)-(d-p)*(y-P);if(F===0)return null;var N=((c*p-d*h)*(y-P)-(c-h)*(y*L-S*P))/F,z=((c*p-d*h)*(S-L)-(d-p)*(y*L-S*P))/F;return[N,z]}function equalArrays(t,n){if(!t||!n||t.length!==n.length)return!1;for(var o=0,s=t.length;o<s;o++)if(t[o]instanceof Array&&n[o]instanceof Array){if(!equalArrays(t[o],n[o]))return!1}else if(t[o]!==n[o])return!1;return!0}function simplepolygon(t){if(t.type!="Feature")throw new Error("The input must a geojson object of type Feature");if(t.geometry===void 0||t.geometry==null)throw new Error("The input must a geojson object with a non-empty geometry");if(t.geometry.type!="Polygon")throw new Error("The input must be a geojson Polygon");for(var n=t.geometry.coordinates.length,o=[],se=0;se<n;se++){var s=t.geometry.coordinates[se];equalArrays$1(s[0],s[s.length-1])||s.push(s[0]),o.push.apply(o,s.slice(0,s.length-1))}if(!isUnique(o))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var c=o.length,d=isects(t,function(Vd,Gd,uf,ff,pf,hf,of,gf,Ef,xf,Wa,af){return[Vd,Gd,uf,ff,pf,hf,of,gf,Ef,xf,Wa,af]}),h=d.length;if(h==0){for(var zi=[],se=0;se<n;se++)zi.push(polygon([t.geometry.coordinates[se]],{parent:-1,winding:windingOfRing(t.geometry.coordinates[se])}));var Xs=featureCollection$2(zi);return Nl(),pu(),Xs}for(var p=[],y=[],se=0;se<n;se++){p.push([]);for(var S=0;S<t.geometry.coordinates[se].length-1;S++)p[se].push([new PseudoVtx(t.geometry.coordinates[se][modulo(S+1,t.geometry.coordinates[se].length-1)],1,[se,S],[se,modulo(S+1,t.geometry.coordinates[se].length-1)],void 0)]),y.push(new Isect(t.geometry.coordinates[se][S],[se,modulo(S-1,t.geometry.coordinates[se].length-1)],[se,S],void 0,void 0,!1,!0))}for(var se=0;se<h;se++)p[d[se][1]][d[se][2]].push(new PseudoVtx(d[se][0],d[se][5],[d[se][1],d[se][2]],[d[se][6],d[se][7]],void 0)),d[se][11]&&y.push(new Isect(d[se][0],[d[se][1],d[se][2]],[d[se][6],d[se][7]],void 0,void 0,!0,!0));for(var P=y.length,se=0;se<p.length;se++)for(var S=0;S<p[se].length;S++)p[se][S].sort(function(Gd,uf){return Gd.param<uf.param?-1:1});for(var L=[],se=0;se<P;se++)L.push({minX:y[se].coord[0],minY:y[se].coord[1],maxX:y[se].coord[0],maxY:y[se].coord[1],index:se});var F=rbush$1();F.load(L);for(var se=0;se<p.length;se++)for(var S=0;S<p[se].length;S++)for(var N=0;N<p[se][S].length;N++){var z;N==p[se][S].length-1?z=p[se][modulo(S+1,t.geometry.coordinates[se].length-1)][0].coord:z=p[se][S][N+1].coord;var W=F.search({minX:z[0],minY:z[1],maxX:z[0],maxY:z[1]})[0];p[se][S][N].nxtIsectAlongEdgeIn=W.index}for(var se=0;se<p.length;se++)for(var S=0;S<p[se].length;S++)for(var N=0;N<p[se][S].length;N++){var z=p[se][S][N].coord,W=F.search({minX:z[0],minY:z[1],maxX:z[0],maxY:z[1]})[0],nt=W.index;nt<c?y[nt].nxtIsectAlongRingAndEdge2=p[se][S][N].nxtIsectAlongEdgeIn:equalArrays$1(y[nt].ringAndEdge1,p[se][S][N].ringAndEdgeIn)?y[nt].nxtIsectAlongRingAndEdge1=p[se][S][N].nxtIsectAlongEdgeIn:y[nt].nxtIsectAlongRingAndEdge2=p[se][S][N].nxtIsectAlongEdgeIn}for(var Pe=[],se=0,S=0;S<n;S++){for(var mt=se,N=0;N<t.geometry.coordinates[S].length-1;N++)y[se].coord[0]<y[mt].coord[0]&&(mt=se),se++;for(var kt=y[mt].nxtIsectAlongRingAndEdge2,N=0;N<y.length;N++)if(y[N].nxtIsectAlongRingAndEdge1==mt||y[N].nxtIsectAlongRingAndEdge2==mt){var mn=N;break}var _i=isConvex([y[mn].coord,y[mt].coord,y[kt].coord],!0)?1:-1;Pe.push({isect:mt,parent:-1,winding:_i})}Pe.sort(function(Ru,Vd){return y[Ru.isect].coord>y[Vd.isect].coord?-1:1});for(var zi=[];Pe.length>0;){var Sa=Pe.pop(),fa=Sa.isect,La=Sa.parent,Ra=Sa.winding,ma=zi.length,yt=[y[fa].coord],lt=fa;if(y[fa].ringAndEdge1Walkable)var pi=y[fa].ringAndEdge1,ba=y[fa].nxtIsectAlongRingAndEdge1;else var pi=y[fa].ringAndEdge2,ba=y[fa].nxtIsectAlongRingAndEdge2;for(;!equalArrays$1(y[fa].coord,y[ba].coord);){yt.push(y[ba].coord);for(var Sc=void 0,se=0;se<Pe.length;se++)if(Pe[se].isect==ba){Sc=se;break}if(Sc!=null&&Pe.splice(Sc,1),equalArrays$1(pi,y[ba].ringAndEdge1)){if(pi=y[ba].ringAndEdge2,y[ba].ringAndEdge2Walkable=!1,y[ba].ringAndEdge1Walkable){var ms={isect:ba};isConvex([y[lt].coord,y[ba].coord,y[y[ba].nxtIsectAlongRingAndEdge2].coord],Ra==1)?(ms.parent=La,ms.winding=-Ra):(ms.parent=ma,ms.winding=Ra),Pe.push(ms)}lt=ba,ba=y[ba].nxtIsectAlongRingAndEdge2}else{if(pi=y[ba].ringAndEdge1,y[ba].ringAndEdge1Walkable=!1,y[ba].ringAndEdge2Walkable){var ms={isect:ba};isConvex([y[lt].coord,y[ba].coord,y[y[ba].nxtIsectAlongRingAndEdge1].coord],Ra==1)?(ms.parent=La,ms.winding=-Ra):(ms.parent=ma,ms.winding=Ra),Pe.push(ms)}lt=ba,ba=y[ba].nxtIsectAlongRingAndEdge1}}yt.push(y[ba].coord),zi.push(polygon([yt],{index:ma,parent:La,winding:Ra,netWinding:void 0}))}var Xs=featureCollection$2(zi);Nl(),pu();function Nl(){for(var Ru=[],Vd=0;Vd<Xs.features.length;Vd++)Xs.features[Vd].properties.parent==-1&&Ru.push(Vd);if(Ru.length>1)for(var Vd=0;Vd<Ru.length;Vd++){for(var Gd=-1,uf=1/0,ff=0;ff<Xs.features.length;ff++)Ru[Vd]!=ff&&booleanPointInPolygon(Xs.features[Ru[Vd]].geometry.coordinates[0][0],Xs.features[ff],{ignoreBoundary:!0})&&area(Xs.features[ff])<uf&&(Gd=ff);Xs.features[Ru[Vd]].properties.parent=Gd}}function pu(){for(var Ru=0;Ru<Xs.features.length;Ru++)if(Xs.features[Ru].properties.parent==-1){var Vd=Xs.features[Ru].properties.winding;Xs.features[Ru].properties.netWinding=Vd,yu(Ru,Vd)}}function yu(Ru,Vd){for(var Gd=0;Gd<Xs.features.length;Gd++)if(Xs.features[Gd].properties.parent==Ru){var uf=Vd+Xs.features[Gd].properties.winding;Xs.features[Gd].properties.netWinding=uf,yu(Gd,uf)}}return Xs}var PseudoVtx=function(t,n,o,s,c){this.coord=t,this.param=n,this.ringAndEdgeIn=o,this.ringAndEdgeOut=s,this.nxtIsectAlongEdgeIn=c},Isect=function(t,n,o,s,c,d,h){this.coord=t,this.ringAndEdge1=n,this.ringAndEdge2=o,this.nxtIsectAlongRingAndEdge1=s,this.nxtIsectAlongRingAndEdge2=c,this.ringAndEdge1Walkable=d,this.ringAndEdge2Walkable=h};function isConvex(t,n){if(typeof n>"u"&&(n=!0),t.length!=3)throw new Error("This function requires an array of three points [x,y]");var o=(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0]);return o>=0==n}function windingOfRing(t){for(var n=0,o=0;o<t.length-1;o++)t[o][0]<t[n][0]&&(n=o);if(isConvex([t[modulo(n-1,t.length-1)],t[n],t[modulo(n+1,t.length-1)]],!0))var s=1;else var s=-1;return s}function equalArrays$1(t,n){if(!t||!n||t.length!=n.length)return!1;for(var o=0,s=t.length;o<s;o++)if(t[o]instanceof Array&&n[o]instanceof Array){if(!equalArrays$1(t[o],n[o]))return!1}else if(t[o]!=n[o])return!1;return!0}function modulo(t,n){return(t%n+n)%n}function isUnique(t){for(var n={},o=1,s=0,c=t.length;s<c;++s){if(Object.prototype.hasOwnProperty.call(n,t[s])){o=0;break}n[t[s]]=1}return o}function unkinkPolygon(t){var n=[];return flattenEach(t,function(o){o.geometry.type==="Polygon"&&featureEach(simplepolygon(o),function(s){n.push(polygon(s.geometry.coordinates,o.properties))})}),featureCollection$2(n)}function isNotNullish(t){return t!=null}function coordinatesToPositionsArray(t){return t.map(n=>n.map(([o,s])=>Cartesian3.fromDegrees(o,s,0)))}function convertGeometryToPositionsArray(t){return(t.type==="LineString"?coordinatesToPositionsArray([t.coordinates]):t.type==="Polygon"?coordinatesToPositionsArray(t.coordinates):t.coordinates.flatMap(n=>coordinatesToPositionsArray(n))).filter(({length:n})=>n>0)}function coordinatesToHierarchy(t){return t.length>0?{positions:t[0].map(([n,o])=>Cartesian3.fromDegrees(n,o,0)),holes:t.slice(1).map(n=>({positions:n.map(([o,s])=>Cartesian3.fromDegrees(o,s,0)),holes:[]}))}:void 0}function convertPolygonToHierarchyArray(t){return unkinkPolygon(t).features.map(o=>coordinatesToHierarchy(o.geometry.coordinates)).filter(isNotNullish)}const fontScale=5,scaleByDistance=new NearFarScalar(0,1/fontScale,Number.POSITIVE_INFINITY,1/fontScale),defaultStyle={default:{fontFamily:"sans-serif",fillColor:Color$1.BLACK,outlineColor:Color$1.WHITE.withAlpha(.8),outlineWidth:5},municipalities:{fontSize:12},towns:{fontSize:8,fillColor:Color$1.BLACK.withAlpha(.6)},roads:{fontSize:8},railways:{fontSize:8},stations:{fontSize:9},landmarks:{fontSize:8},topography:{fontSize:8,fillColor:Color$1.BLACK.withAlpha(.6)}};function resolveStyle(t,n){const o=getAnnotationType(t);if(o==null)return;const s=n==null?void 0:n[o];if(s===!1)return;const c=merge({},defaultStyle.default,defaultStyle[o],n==null?void 0:n.default,s),d=Object.fromEntries(Object.entries(c).map(([h,p])=>[h,typeof p=="string"&&isColor(p)?toColor$1(p):p]));return{scaleByDistance,...omit(d,["fontSize","fontFamily"]),font:(d==null?void 0:d.fontSize)!=null&&d.fontFamily!=null?`${d.fontSize*fontScale}pt ${d.fontFamily}`:void 0}}const positionScratch$1=new Cartesian3,cartographicScratch$1=new Cartographic;function getPosition(t,n,o,s,c,d,h,p=new Cartesian3){let y=n.geom[0][0].x/c,S=n.geom[0][0].y/c;if(t.level===17&&(y=y*2-t.x%2,S=S*2-t.y%2),y<0||y>1||S<0||S>1)return;const P=Cartographic.fromRadians(o.west+o.width*y,o.south+o.height*(1-S),d,cartographicScratch$1);if((s==null?void 0:s.some(L=>Rectangle.contains(L,P)))!==!0)return Cartographic.toCartesian(P,h,p)}const JapanGSIOptimalBVmapLabelImagery=React.memo(({imageryProvider:t,imagery:n,descendants:o,height:s=50,style:c=defaultStyle,labelCollection:d,near:h,far:p})=>{const y=$e$1(),S=suspend(async()=>await t.tileCache.get(getTileCoords(n,16)),[JapanGSIOptimalBVmapLabelImagery,n.key]),P=React.useMemo(()=>t.tilingScheme.tileXYToRectangle(n.x,n.y,n.level),[t,n]),L=React.useMemo(()=>o==null?void 0:o.map(Pe=>t.tilingScheme.tileXYToRectangle(Pe.x,Pe.y,Pe.level)),[t,o]),F=React.useMemo(()=>{const Pe=S.get("Anno");return Pe==null?[]:Pe.filter(se=>typeof se.props.vt_code=="number"&&`${se.props.vt_code}`.length===3&&typeof se.props.vt_text=="string"&&(se.props.vt_arrng==null||typeof se.props.vt_arrng=="number")&&(se.props.vt_arrngagl==null||typeof se.props.vt_arrngagl=="number")&&(n.level<16||n.level===16&&se.props.vt_flag17!==2||n.level===17&&se.props.vr_flag17!==0))},[S,n]),N=React.useRef(),z=y==null?void 0:y.scene,W=React.useCallback(()=>{const Pe=N.current;Pe!=null&&(Pe.forEach(([se,mt])=>{var mn;const kt=getPosition(n,se,P,L,t.tileCache.tileSize,s,(mn=z==null?void 0:z.globe)==null?void 0:mn.ellipsoid,positionScratch$1);kt!=null?(mt.position=kt,mt.show=!0):mt.show=!1}),z==null||z.requestRender())},[t,n,s,P,L,z]),nt=React.useRef(W);return nt.current=W,React.useEffect(()=>{if(!z||!d)return;const Pe=[],se=F.map(kt=>{const mn=resolveStyle(kt.props.vt_code,c);if(mn==null)return;const _i=kt.props.vt_text;if(Pe.includes(_i))return;Pe.push(_i);const zi={text:_i,style:LabelStyle$1.FILL_AND_OUTLINE,horizontalOrigin:HorizontalOrigin$1.CENTER,verticalOrigin:VerticalOrigin$1.BOTTOM,heightReference:HeightReference$1.CLAMP_TO_GROUND,distanceDisplayCondition:h||p?new Cesium$1.DistanceDisplayCondition(h,p):void 0,disableDepthTestDistance:1/0,...mn};return[kt,d.add(zi)]}).filter(isNotNullish);N.current=se,nt.current();const mt=()=>{d.isDestroyed()||se.forEach(([,kt])=>{d.remove(kt)}),z.isDestroyed()||z==null||z.postRender.removeEventListener(mt)};return()=>{N.current=void 0,z.isDestroyed()||z==null||z.postRender.addEventListener(mt)}},[c,F,z,d,h,p]),React.useEffect(()=>{W()},[W]),null});JapanGSIOptimalBVmapLabelImagery.displayName="JapanGSIOptimalBVmapLabelImagery";const hasMethod=t=>n=>n!=null&&typeof n=="object"&&t in n&&typeof n[t]=="function";function createDestructor(t,n){if(t.owner!=null){invariant$1(t.transferOwnership!=null);const o=t.owner,s=t.transferOwnership(n,t.owner);return()=>{(!hasMethod("isDestroyed")(o)||!o.isDestroyed())&&s()}}else{const o=t.destroy;return()=>{typeof o=="function"?o(n):o!==null&&hasMethod("destroy")(n)&&n.destroy()}}}function useInstance(t){const[n,o]=React.useState(),s=React.useRef();return s.current==null&&(s.current=t.create()),React.useEffect(()=>{s.current==null&&(s.current=t.create(),o(s.current));const c=s.current,d=createDestructor(t,c);return()=>{d(),s.current=void 0,o(void 0)}},[t.owner,...t.keys]),n??s.current}const LabelImageryLayer=React.forwardRef(function({url:n,tilingScheme:o,tileWidth:s,tileHeight:c,minimumLevel:d,maximumLevel:h,minimumDataLevel:p,maximumDataLevel:y,...S},P){const L=useInstance({keys:[n,o,s,c,p,y],create:()=>new JapanGSIOptimalBVmapLabelImageryProvider({url:n,tilingScheme:o??new Cesium$1.WebMercatorTilingScheme,tileWidth:s,tileHeight:c,minimumDataLevel:p,maximumDataLevel:y})});return Object.assign(L,{minimumLevel:d,maximumLevel:h}),jsxRuntimeExports.jsx(Ns$1,{ref:P,imageryProvider:L,...S})});function getAncestorKeys(t,n){if(t.level===n)return[];const o=2**t.level,s=t.x/o,c=t.y/o;return[...Array(t.level-n)].map((d,h)=>{const p=t.level-(h+1),y=2**p;return makeKey({x:Math.floor(s*y),y:Math.floor(c*y),level:p})})}function isEqualKeys(t,n){return n!=null&&t.length===n.length&&xorBy(t,n,"key").length===0}function getImageriesToRender(t,n){const o=t.globe;let s=1/0,c=-1/0;const d=uniqBy(o._surface._tilesToRender.flatMap(p=>{var y;return((y=p.data)==null?void 0:y.imagery.map(S=>S.readyImagery).filter(S=>(S==null?void 0:S.imageryLayer.imageryProvider)!==n?!1:(S.key=makeKey(S),S.level<s&&(s=S.level),S.level>c&&(c=S.level),!0)))??[]}),"key").sort((p,y)=>p.key.localeCompare(y.key));if(s===c||s===1/0||c===-1/0)return d;const h=fromPairs(d.map(p=>[p.key,{imagery:p,children:[],descendants:[]}]));return d.forEach(p=>{getAncestorKeys(p,s).forEach(S=>{const P=h[S];P!=null&&(P.descendants.push(p),p.level-P.imagery.level===1&&P.children.push(p))})}),Object.values(h).forEach(({imagery:p,children:y,descendants:S})=>{isEqualKeys(y,p.children)||(p.children=y),isEqualKeys(S,p.descendants)||(p.descendants=S)}),d.filter(p=>p.children!=null&&p.children.length<4)}const LabelImageryCollection=({imageryProvider:t,imageriesAtom:n,style:o,labelCollection:s,near:c,far:d})=>{const h=useAtomValue(n);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:h.map(p=>jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntimeExports.jsx(JapanGSIOptimalBVmapLabelImagery,{imageryProvider:t,imagery:p,descendants:p.descendants,style:o,labelCollection:s,near:c,far:d})},p.key))})},JapanGSIOptimalBVmapVectorMapLabel=({style:t,near:n,far:o})=>{const[s,c]=React.useState(),d=React.useCallback(N=>{var z;c(((z=N==null?void 0:N.cesiumElement)==null?void 0:z.imageryProvider)instanceof JapanGSIOptimalBVmapLabelImageryProvider?N.cesiumElement.imageryProvider:void 0)},[]),h=React.useMemo(()=>{const N=atom([]);return atom(z=>z(N),(z,W,nt)=>{const Pe=z(N),se=typeof nt=="function"?nt(Pe):nt;Pe.length!==se.length&&xorBy(Pe,se,"key").length>0&&W(N,se)})},[]),p=useSetAtom(h);usePreRender(N=>{if(s==null)return;const z=getImageriesToRender(N,s);p(z)});const{labelCollection:y,scene:S}=$e$1(),P=React.useRef(!1),L=React.useMemo(()=>y??(S?new Cesium$1.LabelCollection({scene:S}):void 0),[S,y]);React.useEffect(()=>{!y&&S&&!P.current&&(S.primitives.add(L),P.current=!0)},[y,L,S]);const F=React.useRef(0);return usePreRender(N=>{L&&F.current!==L._labelsToUpdate.length&&(N.requestRender(),F.current=L._labelsToUpdate.length)}),React.useEffect(()=>()=>{S!=null&&S.isDestroyed()||S==null||S.requestRender()},[S]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LabelImageryLayer,{ref:d,url:"https://cyberjapandata.gsi.go.jp/xyz/optimal_bvmap-v1/{z}/{x}/{y}.pbf",tileWidth:1024,tileHeight:1024,maximumLevel:17,minimumDataLevel:4,maximumDataLevel:16}),s!=null&&jsxRuntimeExports.jsx(LabelImageryCollection,{imageryProvider:s,imageriesAtom:h,style:t,labelCollection:L,near:n,far:o})]})},LabelImageryLayers=React.memo(({tileLabels:t=[]})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t.map(n=>{if(!n)return null;switch(n.labelType){case"japan_gsi_optimal_bvmap":return jsxRuntimeExports.jsx(JapanGSIOptimalBVmapVectorMapLabel,{style:n.style,near:n.near,far:n.far},n.id);default:return null}})}),(t,n)=>isEqual(t.tileLabels,n.tileLabels));LabelImageryLayers.displayName="LabelImageryLayers";function Event({onMount:t,onUnmount:n}){return React.useEffect(()=>(t==null||t(),()=>n==null?void 0:n()),[t,n]),null}const perf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,warned$1=new Set,emitWarning$1=(t,n,o,s)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(t,n,o,s):console.error(`[${o}] ${n}: ${t}`)},shouldWarn=t=>!warned$1.has(t),isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),getUintArray=t=>isPosInt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(n){super(n),this.fill(0)}}const Am=class Am{constructor(n,o){Rf(this,"heap");Rf(this,"length");if(!ef(Am,Om))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new o(n),this.length=0}static create(n){const o=getUintArray(n);if(!o)return[];zf(Am,Om,!0);const s=new Am(n,o);return zf(Am,Om,!1),s}push(n){this.heap[this.length++]=n}pop(){return this.heap[--this.length]}};Om=new WeakMap,Jf(Am,Om,!1);let Stack=Am;const ig=class ig{constructor(n){Jf(this,Bp);Jf(this,Qp);Jf(this,Pp);Jf(this,Ip);Jf(this,Yp);Jf(this,Wp);Jf(this,Zp);Jf(this,tp);Jf(this,jp);Jf(this,zp);Jf(this,Dm,void 0);Jf(this,dp,void 0);Jf(this,Sp,void 0);Jf(this,Ep,void 0);Jf(this,Up,void 0);Rf(this,"ttl");Rf(this,"ttlResolution");Rf(this,"ttlAutopurge");Rf(this,"updateAgeOnGet");Rf(this,"updateAgeOnHas");Rf(this,"allowStale");Rf(this,"noDisposeOnSet");Rf(this,"noUpdateTTL");Rf(this,"maxEntrySize");Rf(this,"sizeCalculation");Rf(this,"noDeleteOnFetchRejection");Rf(this,"noDeleteOnStaleGet");Rf(this,"allowStaleOnFetchAbort");Rf(this,"allowStaleOnFetchRejection");Rf(this,"ignoreFetchAbort");Jf(this,lp,void 0);Jf(this,Tp,void 0);Jf(this,up,void 0);Jf(this,ip,void 0);Jf(this,$f,void 0);Jf(this,bp,void 0);Jf(this,_p,void 0);Jf(this,gp,void 0);Jf(this,hp,void 0);Jf(this,wp,void 0);Jf(this,pp,void 0);Jf(this,Vp,void 0);Jf(this,Lp,void 0);Jf(this,Rp,void 0);Jf(this,Mp,void 0);Jf(this,Ap,void 0);Jf(this,vp,void 0);Jf(this,Np,()=>{});Jf(this,Op,()=>{});Jf(this,$p,()=>{});Jf(this,xp,()=>!1);Jf(this,kp,n=>{});Jf(this,Xp,(n,o,s)=>{});Jf(this,Hp,(n,o,s,c)=>{if(s||c)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:o=0,ttl:s,ttlResolution:c=1,ttlAutopurge:d,updateAgeOnGet:h,updateAgeOnHas:p,allowStale:y,dispose:S,disposeAfter:P,noDisposeOnSet:L,noUpdateTTL:F,maxSize:N=0,maxEntrySize:z=0,sizeCalculation:W,fetchMethod:nt,noDeleteOnFetchRejection:Pe,noDeleteOnStaleGet:se,allowStaleOnFetchRejection:mt,allowStaleOnFetchAbort:kt,ignoreFetchAbort:mn}=n;if(o!==0&&!isPosInt(o))throw new TypeError("max option must be a nonnegative integer");const _i=o?getUintArray(o):Array;if(!_i)throw new Error("invalid max value: "+o);if(zf(this,Dm,o),zf(this,dp,N),this.maxEntrySize=z||ef(this,dp),this.sizeCalculation=W,this.sizeCalculation){if(!ef(this,dp)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(nt!==void 0&&typeof nt!="function")throw new TypeError("fetchMethod must be a function if specified");if(zf(this,Up,nt),zf(this,Ap,!!nt),zf(this,up,new Map),zf(this,ip,new Array(o).fill(void 0)),zf(this,$f,new Array(o).fill(void 0)),zf(this,bp,new _i(o)),zf(this,_p,new _i(o)),zf(this,gp,0),zf(this,hp,0),zf(this,wp,Stack.create(o)),zf(this,lp,0),zf(this,Tp,0),typeof S=="function"&&zf(this,Sp,S),typeof P=="function"?(zf(this,Ep,P),zf(this,pp,[])):(zf(this,Ep,void 0),zf(this,pp,void 0)),zf(this,Mp,!!ef(this,Sp)),zf(this,vp,!!ef(this,Ep)),this.noDisposeOnSet=!!L,this.noUpdateTTL=!!F,this.noDeleteOnFetchRejection=!!Pe,this.allowStaleOnFetchRejection=!!mt,this.allowStaleOnFetchAbort=!!kt,this.ignoreFetchAbort=!!mn,this.maxEntrySize!==0){if(ef(this,dp)!==0&&!isPosInt(ef(this,dp)))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");kf(this,Qp,ug).call(this)}if(this.allowStale=!!y,this.noDeleteOnStaleGet=!!se,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!p,this.ttlResolution=isPosInt(c)||c===0?c:1,this.ttlAutopurge=!!d,this.ttl=s||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");kf(this,Bp,ag).call(this)}if(ef(this,Dm)===0&&this.ttl===0&&ef(this,dp)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!ef(this,Dm)&&!ef(this,dp)){const zi="LRU_CACHE_UNBOUNDED";shouldWarn(zi)&&(warned$1.add(zi),emitWarning$1("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",zi,ig))}}static unsafeExposeInternals(n){return{starts:ef(n,Lp),ttls:ef(n,Rp),sizes:ef(n,Vp),keyMap:ef(n,up),keyList:ef(n,ip),valList:ef(n,$f),next:ef(n,bp),prev:ef(n,_p),get head(){return ef(n,gp)},get tail(){return ef(n,hp)},free:ef(n,wp),isBackgroundFetch:o=>{var s;return kf(s=n,tp,op).call(s,o)},backgroundFetch:(o,s,c,d)=>{var h;return kf(h=n,Zp,ng).call(h,o,s,c,d)},moveToTail:o=>{var s;return kf(s=n,zp,Jp).call(s,o)},indexes:o=>{var s;return kf(s=n,Pp,Gp).call(s,o)},rindexes:o=>{var s;return kf(s=n,Ip,Dp).call(s,o)},isStale:o=>{var s;return ef(s=n,xp).call(s,o)}}}get max(){return ef(this,Dm)}get maxSize(){return ef(this,dp)}get calculatedSize(){return ef(this,Tp)}get size(){return ef(this,lp)}get fetchMethod(){return ef(this,Up)}get dispose(){return ef(this,Sp)}get disposeAfter(){return ef(this,Ep)}getRemainingTTL(n){return ef(this,up).has(n)?1/0:0}*entries(){for(const n of kf(this,Pp,Gp).call(this))ef(this,$f)[n]!==void 0&&ef(this,ip)[n]!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield[ef(this,ip)[n],ef(this,$f)[n]])}*rentries(){for(const n of kf(this,Ip,Dp).call(this))ef(this,$f)[n]!==void 0&&ef(this,ip)[n]!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield[ef(this,ip)[n],ef(this,$f)[n]])}*keys(){for(const n of kf(this,Pp,Gp).call(this)){const o=ef(this,ip)[n];o!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield o)}}*rkeys(){for(const n of kf(this,Ip,Dp).call(this)){const o=ef(this,ip)[n];o!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield o)}}*values(){for(const n of kf(this,Pp,Gp).call(this))ef(this,$f)[n]!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield ef(this,$f)[n])}*rvalues(){for(const n of kf(this,Ip,Dp).call(this))ef(this,$f)[n]!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield ef(this,$f)[n])}[Symbol.iterator](){return this.entries()}find(n,o={}){for(const s of kf(this,Pp,Gp).call(this)){const c=ef(this,$f)[s],d=kf(this,tp,op).call(this,c)?c.__staleWhileFetching:c;if(d!==void 0&&n(d,ef(this,ip)[s],this))return this.get(ef(this,ip)[s],o)}}forEach(n,o=this){for(const s of kf(this,Pp,Gp).call(this)){const c=ef(this,$f)[s],d=kf(this,tp,op).call(this,c)?c.__staleWhileFetching:c;d!==void 0&&n.call(o,d,ef(this,ip)[s],this)}}rforEach(n,o=this){for(const s of kf(this,Ip,Dp).call(this)){const c=ef(this,$f)[s],d=kf(this,tp,op).call(this,c)?c.__staleWhileFetching:c;d!==void 0&&n.call(o,d,ef(this,ip)[s],this)}}purgeStale(){let n=!1;for(const o of kf(this,Ip,Dp).call(this,{allowStale:!0}))ef(this,xp).call(this,o)&&(this.delete(ef(this,ip)[o]),n=!0);return n}dump(){const n=[];for(const o of kf(this,Pp,Gp).call(this,{allowStale:!0})){const s=ef(this,ip)[o],c=ef(this,$f)[o],d=kf(this,tp,op).call(this,c)?c.__staleWhileFetching:c;if(d===void 0||s===void 0)continue;const h={value:d};if(ef(this,Rp)&&ef(this,Lp)){h.ttl=ef(this,Rp)[o];const p=perf.now()-ef(this,Lp)[o];h.start=Math.floor(Date.now()-p)}ef(this,Vp)&&(h.size=ef(this,Vp)[o]),n.unshift([s,h])}return n}load(n){this.clear();for(const[o,s]of n){if(s.start){const c=Date.now()-s.start;s.start=perf.now()-c}this.set(o,s.value,s)}}set(n,o,s={}){var F,N,z;const{ttl:c=this.ttl,start:d,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:p=this.sizeCalculation,status:y}=s;let{noUpdateTTL:S=this.noUpdateTTL}=s;const P=ef(this,Hp).call(this,n,o,s.size||0,p);if(this.maxEntrySize&&P>this.maxEntrySize)return y&&(y.set="miss",y.maxEntrySizeExceeded=!0),this.delete(n),this;let L=ef(this,lp)===0?void 0:ef(this,up).get(n);if(L===void 0)L=ef(this,lp)===0?ef(this,hp):ef(this,wp).length!==0?ef(this,wp).pop():ef(this,lp)===ef(this,Dm)?kf(this,Wp,tg).call(this,!1):ef(this,lp),ef(this,ip)[L]=n,ef(this,$f)[L]=o,ef(this,up).set(n,L),ef(this,bp)[ef(this,hp)]=L,ef(this,_p)[L]=ef(this,hp),zf(this,hp,L),eg(this,lp)._++,ef(this,Xp).call(this,L,P,y),y&&(y.set="add"),S=!1;else{kf(this,zp,Jp).call(this,L);const W=ef(this,$f)[L];if(o!==W){if(ef(this,Ap)&&kf(this,tp,op).call(this,W)?W.__abortController.abort(new Error("replaced")):h||(ef(this,Mp)&&((F=ef(this,Sp))==null||F.call(this,W,n,"set")),ef(this,vp)&&((N=ef(this,pp))==null||N.push([W,n,"set"]))),ef(this,kp).call(this,L),ef(this,Xp).call(this,L,P,y),ef(this,$f)[L]=o,y){y.set="replace";const nt=W&&kf(this,tp,op).call(this,W)?W.__staleWhileFetching:W;nt!==void 0&&(y.oldValue=nt)}}else y&&(y.set="update")}if(c!==0&&!ef(this,Rp)&&kf(this,Bp,ag).call(this),ef(this,Rp)&&(S||ef(this,$p).call(this,L,c,d),y&&ef(this,Op).call(this,y,L)),!h&&ef(this,vp)&&ef(this,pp)){const W=ef(this,pp);let nt;for(;nt=W==null?void 0:W.shift();)(z=ef(this,Ep))==null||z.call(this,...nt)}return this}pop(){var n;try{for(;ef(this,lp);){const o=ef(this,$f)[ef(this,gp)];if(kf(this,Wp,tg).call(this,!0),kf(this,tp,op).call(this,o)){if(o.__staleWhileFetching)return o.__staleWhileFetching}else if(o!==void 0)return o}}finally{if(ef(this,vp)&&ef(this,pp)){const o=ef(this,pp);let s;for(;s=o==null?void 0:o.shift();)(n=ef(this,Ep))==null||n.call(this,...s)}}}has(n,o={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:c}=o,d=ef(this,up).get(n);if(d!==void 0){const h=ef(this,$f)[d];if(kf(this,tp,op).call(this,h)&&h.__staleWhileFetching===void 0)return!1;if(ef(this,xp).call(this,d))c&&(c.has="stale",ef(this,Op).call(this,c,d));else return s&&ef(this,Np).call(this,d),c&&(c.has="hit",ef(this,Op).call(this,c,d)),!0}else c&&(c.has="miss");return!1}peek(n,o={}){const{allowStale:s=this.allowStale}=o,c=ef(this,up).get(n);if(c!==void 0&&(s||!ef(this,xp).call(this,c))){const d=ef(this,$f)[c];return kf(this,tp,op).call(this,d)?d.__staleWhileFetching:d}}async fetch(n,o={}){const{allowStale:s=this.allowStale,updateAgeOnGet:c=this.updateAgeOnGet,noDeleteOnStaleGet:d=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:y=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:P=this.noUpdateTTL,noDeleteOnFetchRejection:L=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:F=this.allowStaleOnFetchRejection,ignoreFetchAbort:N=this.ignoreFetchAbort,allowStaleOnFetchAbort:z=this.allowStaleOnFetchAbort,context:W,forceRefresh:nt=!1,status:Pe,signal:se}=o;if(!ef(this,Ap))return Pe&&(Pe.fetch="get"),this.get(n,{allowStale:s,updateAgeOnGet:c,noDeleteOnStaleGet:d,status:Pe});const mt={allowStale:s,updateAgeOnGet:c,noDeleteOnStaleGet:d,ttl:h,noDisposeOnSet:p,size:y,sizeCalculation:S,noUpdateTTL:P,noDeleteOnFetchRejection:L,allowStaleOnFetchRejection:F,allowStaleOnFetchAbort:z,ignoreFetchAbort:N,status:Pe,signal:se};let kt=ef(this,up).get(n);if(kt===void 0){Pe&&(Pe.fetch="miss");const mn=kf(this,Zp,ng).call(this,n,kt,mt,W);return mn.__returned=mn}else{const mn=ef(this,$f)[kt];if(kf(this,tp,op).call(this,mn)){const La=s&&mn.__staleWhileFetching!==void 0;return Pe&&(Pe.fetch="inflight",La&&(Pe.returnedStale=!0)),La?mn.__staleWhileFetching:mn.__returned=mn}const _i=ef(this,xp).call(this,kt);if(!nt&&!_i)return Pe&&(Pe.fetch="hit"),kf(this,zp,Jp).call(this,kt),c&&ef(this,Np).call(this,kt),Pe&&ef(this,Op).call(this,Pe,kt),mn;const zi=kf(this,Zp,ng).call(this,n,kt,mt,W),fa=zi.__staleWhileFetching!==void 0&&s;return Pe&&(Pe.fetch=_i?"stale":"refresh",fa&&_i&&(Pe.returnedStale=!0)),fa?zi.__staleWhileFetching:zi.__returned=zi}}get(n,o={}){const{allowStale:s=this.allowStale,updateAgeOnGet:c=this.updateAgeOnGet,noDeleteOnStaleGet:d=this.noDeleteOnStaleGet,status:h}=o,p=ef(this,up).get(n);if(p!==void 0){const y=ef(this,$f)[p],S=kf(this,tp,op).call(this,y);return h&&ef(this,Op).call(this,h,p),ef(this,xp).call(this,p)?(h&&(h.get="stale"),S?(h&&s&&y.__staleWhileFetching!==void 0&&(h.returnedStale=!0),s?y.__staleWhileFetching:void 0):(d||this.delete(n),h&&s&&(h.returnedStale=!0),s?y:void 0)):(h&&(h.get="hit"),S?y.__staleWhileFetching:(kf(this,zp,Jp).call(this,p),c&&ef(this,Np).call(this,p),y))}else h&&(h.get="miss")}delete(n){var s,c,d,h;let o=!1;if(ef(this,lp)!==0){const p=ef(this,up).get(n);if(p!==void 0)if(o=!0,ef(this,lp)===1)this.clear();else{ef(this,kp).call(this,p);const y=ef(this,$f)[p];kf(this,tp,op).call(this,y)?y.__abortController.abort(new Error("deleted")):(ef(this,Mp)||ef(this,vp))&&(ef(this,Mp)&&((s=ef(this,Sp))==null||s.call(this,y,n,"delete")),ef(this,vp)&&((c=ef(this,pp))==null||c.push([y,n,"delete"]))),ef(this,up).delete(n),ef(this,ip)[p]=void 0,ef(this,$f)[p]=void 0,p===ef(this,hp)?zf(this,hp,ef(this,_p)[p]):p===ef(this,gp)?zf(this,gp,ef(this,bp)[p]):(ef(this,bp)[ef(this,_p)[p]]=ef(this,bp)[p],ef(this,_p)[ef(this,bp)[p]]=ef(this,_p)[p]),eg(this,lp)._--,ef(this,wp).push(p)}}if(ef(this,vp)&&((d=ef(this,pp))!=null&&d.length)){const p=ef(this,pp);let y;for(;y=p==null?void 0:p.shift();)(h=ef(this,Ep))==null||h.call(this,...y)}return o}clear(){var n,o,s;for(const c of kf(this,Ip,Dp).call(this,{allowStale:!0})){const d=ef(this,$f)[c];if(kf(this,tp,op).call(this,d))d.__abortController.abort(new Error("deleted"));else{const h=ef(this,ip)[c];ef(this,Mp)&&((n=ef(this,Sp))==null||n.call(this,d,h,"delete")),ef(this,vp)&&((o=ef(this,pp))==null||o.push([d,h,"delete"]))}}if(ef(this,up).clear(),ef(this,$f).fill(void 0),ef(this,ip).fill(void 0),ef(this,Rp)&&ef(this,Lp)&&(ef(this,Rp).fill(0),ef(this,Lp).fill(0)),ef(this,Vp)&&ef(this,Vp).fill(0),zf(this,gp,0),zf(this,hp,0),ef(this,wp).length=0,zf(this,Tp,0),zf(this,lp,0),ef(this,vp)&&ef(this,pp)){const c=ef(this,pp);let d;for(;d=c==null?void 0:c.shift();)(s=ef(this,Ep))==null||s.call(this,...d)}}};Dm=new WeakMap,dp=new WeakMap,Sp=new WeakMap,Ep=new WeakMap,Up=new WeakMap,lp=new WeakMap,Tp=new WeakMap,up=new WeakMap,ip=new WeakMap,$f=new WeakMap,bp=new WeakMap,_p=new WeakMap,gp=new WeakMap,hp=new WeakMap,wp=new WeakMap,pp=new WeakMap,Vp=new WeakMap,Lp=new WeakMap,Rp=new WeakMap,Mp=new WeakMap,Ap=new WeakMap,vp=new WeakMap,Bp=new WeakSet,ag=function(){const n=new ZeroArray(ef(this,Dm)),o=new ZeroArray(ef(this,Dm));zf(this,Rp,n),zf(this,Lp,o),zf(this,$p,(d,h,p=perf.now())=>{if(o[d]=h!==0?p:0,n[d]=h,h!==0&&this.ttlAutopurge){const y=setTimeout(()=>{ef(this,xp).call(this,d)&&this.delete(ef(this,ip)[d])},h+1);y.unref&&y.unref()}}),zf(this,Np,d=>{o[d]=n[d]!==0?perf.now():0}),zf(this,Op,(d,h)=>{if(n[h]){const p=n[h],y=o[h];d.ttl=p,d.start=y,d.now=s||c(),d.remainingTTL=d.now+p-y}});let s=0;const c=()=>{const d=perf.now();if(this.ttlResolution>0){s=d;const h=setTimeout(()=>s=0,this.ttlResolution);h.unref&&h.unref()}return d};this.getRemainingTTL=d=>{const h=ef(this,up).get(d);return h===void 0?0:n[h]===0||o[h]===0?1/0:o[h]+n[h]-(s||c())},zf(this,xp,d=>n[d]!==0&&o[d]!==0&&(s||c())-o[d]>n[d])},Np=new WeakMap,Op=new WeakMap,$p=new WeakMap,xp=new WeakMap,Qp=new WeakSet,ug=function(){const n=new ZeroArray(ef(this,Dm));zf(this,Tp,0),zf(this,Vp,n),zf(this,kp,o=>{zf(this,Tp,ef(this,Tp)-n[o]),n[o]=0}),zf(this,Hp,(o,s,c,d)=>{if(kf(this,tp,op).call(this,s))return 0;if(!isPosInt(c))if(d){if(typeof d!="function")throw new TypeError("sizeCalculation must be a function");if(c=d(s,o),!isPosInt(c))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return c}),zf(this,Xp,(o,s,c)=>{if(n[o]=s,ef(this,dp)){const d=ef(this,dp)-n[o];for(;ef(this,Tp)>d;)kf(this,Wp,tg).call(this,!0)}zf(this,Tp,ef(this,Tp)+n[o]),c&&(c.entrySize=s,c.totalCalculatedSize=ef(this,Tp))})},kp=new WeakMap,Xp=new WeakMap,Hp=new WeakMap,Pp=new WeakSet,Gp=function*({allowStale:n=this.allowStale}={}){if(ef(this,lp))for(let o=ef(this,hp);!(!kf(this,Yp,og).call(this,o)||((n||!ef(this,xp).call(this,o))&&(yield o),o===ef(this,gp)));)o=ef(this,_p)[o]},Ip=new WeakSet,Dp=function*({allowStale:n=this.allowStale}={}){if(ef(this,lp))for(let o=ef(this,gp);!(!kf(this,Yp,og).call(this,o)||((n||!ef(this,xp).call(this,o))&&(yield o),o===ef(this,hp)));)o=ef(this,bp)[o]},Yp=new WeakSet,og=function(n){return n!==void 0&&ef(this,up).get(ef(this,ip)[n])===n},Wp=new WeakSet,tg=function(n){var d,h;const o=ef(this,gp),s=ef(this,ip)[o],c=ef(this,$f)[o];return ef(this,Ap)&&kf(this,tp,op).call(this,c)?c.__abortController.abort(new Error("evicted")):(ef(this,Mp)||ef(this,vp))&&(ef(this,Mp)&&((d=ef(this,Sp))==null||d.call(this,c,s,"evict")),ef(this,vp)&&((h=ef(this,pp))==null||h.push([c,s,"evict"]))),ef(this,kp).call(this,o),n&&(ef(this,ip)[o]=void 0,ef(this,$f)[o]=void 0,ef(this,wp).push(o)),ef(this,lp)===1?(zf(this,gp,zf(this,hp,0)),ef(this,wp).length=0):zf(this,gp,ef(this,bp)[o]),ef(this,up).delete(s),eg(this,lp)._--,o},Zp=new WeakSet,ng=function(n,o,s,c){const d=o===void 0?void 0:ef(this,$f)[o];if(kf(this,tp,op).call(this,d))return d;const h=new AbortController,{signal:p}=s;p==null||p.addEventListener("abort",()=>h.abort(p.reason),{signal:h.signal});const y={signal:h.signal,options:s,context:c},S=(W,nt=!1)=>{const{aborted:Pe}=h.signal,se=s.ignoreFetchAbort&&W!==void 0;if(s.status&&(Pe&&!nt?(s.status.fetchAborted=!0,s.status.fetchError=h.signal.reason,se&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),Pe&&!se&&!nt)return L(h.signal.reason);const mt=N;return ef(this,$f)[o]===N&&(W===void 0?mt.__staleWhileFetching?ef(this,$f)[o]=mt.__staleWhileFetching:this.delete(n):(s.status&&(s.status.fetchUpdated=!0),this.set(n,W,y.options))),W},P=W=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=W),L(W)),L=W=>{const{aborted:nt}=h.signal,Pe=nt&&s.allowStaleOnFetchAbort,se=Pe||s.allowStaleOnFetchRejection,mt=se||s.noDeleteOnFetchRejection,kt=N;if(ef(this,$f)[o]===N&&(!mt||kt.__staleWhileFetching===void 0?this.delete(n):Pe||(ef(this,$f)[o]=kt.__staleWhileFetching)),se)return s.status&&kt.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),kt.__staleWhileFetching;if(kt.__returned===kt)throw W},F=(W,nt)=>{var se;const Pe=(se=ef(this,Up))==null?void 0:se.call(this,n,d,y);Pe&&Pe instanceof Promise&&Pe.then(mt=>W(mt),nt),h.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(W(),s.allowStaleOnFetchAbort&&(W=mt=>S(mt,!0)))})};s.status&&(s.status.fetchDispatched=!0);const N=new Promise(F).then(S,P),z=Object.assign(N,{__abortController:h,__staleWhileFetching:d,__returned:void 0});return o===void 0?(this.set(n,z,{...y.options,status:void 0}),o=ef(this,up).get(n)):ef(this,$f)[o]=z,z},tp=new WeakSet,op=function(n){if(!ef(this,Ap))return!1;const o=n;return!!o&&o instanceof Promise&&o.hasOwnProperty("__staleWhileFetching")&&o.__abortController instanceof AbortController},jp=new WeakSet,sg=function(n,o){ef(this,_p)[o]=n,ef(this,bp)[n]=o},zp=new WeakSet,Jp=function(n){n!==ef(this,hp)&&(n===ef(this,gp)?zf(this,gp,ef(this,bp)[n]):kf(this,jp,sg).call(this,ef(this,_p)[n],ef(this,bp)[n]),kf(this,jp,sg).call(this,ef(this,hp),n),zf(this,hp,n))};let LRUCache=ig;const SIDE_PLANES=[new Cesium$1.Plane(new Cesium$1.Cartesian3(0,0,1),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,0,-1),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,1,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,-1,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(1,0,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(-1,0,0),.5)],CORNER_POINT_VECTORS=[new Cesium$1.Cartesian3(.5,.5,.5),new Cesium$1.Cartesian3(.5,-.5,.5),new Cesium$1.Cartesian3(-.5,-.5,.5),new Cesium$1.Cartesian3(-.5,.5,.5)],FACE_POINT_VECTORS=[new Cesium$1.Cartesian3(.5,0,0),new Cesium$1.Cartesian3(0,.5,0),new Cesium$1.Cartesian3(0,0,.5)],SCALE_POINT_VECTORS=[...CORNER_POINT_VECTORS,...FACE_POINT_VECTORS],SCALE_POINTS=SCALE_POINT_VECTORS.map(t=>({point:t,oppositePoint:Cesium$1.Cartesian3.multiplyByScalar(t,-1,new Cesium$1.Cartesian3)})),BOX_EDGES=CORNER_POINT_VECTORS.flatMap((t,n)=>{const o=t,s=Cesium$1.Cartesian3.clone(o,new Cesium$1.Cartesian3);s.z*=-1;const c=CORNER_POINT_VECTORS[(n+1)%4],d=Cesium$1.Cartesian3.clone(c,new Cesium$1.Cartesian3);return d.z*=-1,[{start:o,end:s,isDraggable:!0},{start:c,end:o},{start:d,end:s}]}),SIDE_PLANE_NAMES=["bottom","top","front","back","left","right"];var composeRefs$1={};Object.defineProperty(composeRefs$1,"__esModule",{value:!0});function composeRefs(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length===2)return composeTwoRefs(t[0],t[1])||null;var o=t.slice(1).reduce(function(s,c){return composeTwoRefs(s,c)},t[0]);return o||null}var _default=composeRefs$1.default=composeRefs,composedRefCache=new WeakMap;function composeTwoRefs(t,n){if(t&&n){var o=composedRefCache.get(t)||new WeakMap;composedRefCache.set(t,o);var s=o.get(n)||function(c){updateRef(t,c),updateRef(n,c)};return o.set(n,s),s}return t||n}function updateRef(t,n){typeof t=="function"?t(n):t.current=n}var md5$1={exports:{}};/**
|
|
5832
|
+
${t}`),t}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}}),PolylineMaterialAppearance.VERTEX_FORMAT=VertexFormat.POSITION_AND_ST,PolylineMaterialAppearance.prototype.getFragmentShaderSource=Appearance.prototype.getFragmentShaderSource,PolylineMaterialAppearance.prototype.isTranslucent=Appearance.prototype.isTranslucent,PolylineMaterialAppearance.prototype.getRenderState=Appearance.prototype.getRenderState;function GroundPolylinePrimitive(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let n=t.appearance;defined(n)||(n=new PolylineMaterialAppearance),this.appearance=n,this.show=defaultValue(t.show,!0),this.classificationType=defaultValue(t.classificationType,ClassificationType$1.BOTH),this.debugShowBoundingVolume=defaultValue(t.debugShowBoundingVolume,!1),this._debugShowShadowVolume=defaultValue(t.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:defaultValue(t.interleave,!1),releaseGeometryInstances:defaultValue(t.releaseGeometryInstances,!0),allowPicking:defaultValue(t.allowPicking,!0),asynchronous:defaultValue(t.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=getRenderState(!1),this._renderState3DTiles=getRenderState(!0),this._renderStateMorph=RenderState.fromCache({cull:{enabled:!0,face:CullFace$1.FRONT},depthTest:{enabled:!0},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(GroundPolylinePrimitive.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),GroundPolylinePrimitive.initializeTerrainHeights=function(){return ApproximateTerrainHeights.initialize()};function createShaderProgram(t,n,o){const s=n.context,c=t._primitive,d=c._attributeLocations;let h=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeVS);h=Primitive._appendShowToShader(c,h),h=Primitive._appendDistanceDisplayConditionToShader(c,h),h=Primitive._modifyShaderPosition(t,h,n.scene3DOnly);let p=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphVS);p=Primitive._appendShowToShader(c,p),p=Primitive._appendDistanceDisplayConditionToShader(c,p),p=Primitive._modifyShaderPosition(t,p,n.scene3DOnly);let y=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeFS);const S=[`GLOBE_MINIMUM_ALTITUDE ${n.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let P="",L="";defined(o.material)?(L=defined(o.material)?o.material.shaderSource:"",L.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&S.push("ANGLE_VARYING"),L.search(/in\s+float\s+v_width;/g)!==-1&&S.push("WIDTH_VARYING")):P="PER_INSTANCE_COLOR",S.push(P);const F=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",P]:[P],N=new ShaderSource({defines:S,sources:[h]}),z=new ShaderSource({defines:F,sources:[L,y]});t._sp=ShaderProgram.replaceCache({context:s,shaderProgram:c._sp,vertexShaderSource:N,fragmentShaderSource:z,attributeLocations:d});let W=s.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!defined(W)){const Pe=new ShaderSource({defines:S.concat(["COLUMBUS_VIEW_2D"]),sources:[h]});W=s.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:s,shaderProgram:t._sp2D,vertexShaderSource:Pe,fragmentShaderSource:z,attributeLocations:d})}t._sp2D=W;let nt=s.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!defined(nt)){const Pe=new ShaderSource({defines:S.concat([`MAX_TERRAIN_HEIGHT ${ApproximateTerrainHeights._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[p]});y=c._batchTable.getVertexShaderCallback()(PolylineShadowVolumeMorphFS);const se=new ShaderSource({defines:F,sources:[L,y]});nt=s.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:s,shaderProgram:t._spMorph,vertexShaderSource:Pe,fragmentShaderSource:se,attributeLocations:d})}t._spMorph=nt}function getRenderState(t){return RenderState.fromCache({cull:{enabled:!0},blending:BlendingState$1.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:StencilFunction$1.EQUAL,frontOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},backFunction:StencilFunction$1.EQUAL,backOperation:{fail:StencilOperation$1.KEEP,zFail:StencilOperation$1.KEEP,zPass:StencilOperation$1.KEEP},reference:StencilConstants$1.CESIUM_3D_TILE_MASK,mask:StencilConstants$1.CESIUM_3D_TILE_MASK}})}function createCommands(t,n,o,s,c,d){const h=t._primitive,p=h._va.length;c.length=p,d.length=p;const S=n instanceof PolylineColorAppearance?{}:o._uniforms,P=h._batchTable.getUniformMapCallback()(S);for(let L=0;L<p;L++){const F=h._va[L];let N=c[L];defined(N)||(N=c[L]=new DrawCommand({owner:t,primitiveType:h._primitiveType})),N.vertexArray=F,N.renderState=t._renderState,N.shaderProgram=t._sp,N.uniformMap=P,N.pass=Pass$1.TERRAIN_CLASSIFICATION,N.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const z=DrawCommand.shallowClone(N,N.derivedCommands.tileset);z.renderState=t._renderState3DTiles,z.pass=Pass$1.CESIUM_3D_TILE_CLASSIFICATION,N.derivedCommands.tileset=z;const W=DrawCommand.shallowClone(N,N.derivedCommands.color2D);W.shaderProgram=t._sp2D,N.derivedCommands.color2D=W;const nt=DrawCommand.shallowClone(z,z.derivedCommands.color2D);nt.shaderProgram=t._sp2D,z.derivedCommands.color2D=nt;const Pe=DrawCommand.shallowClone(N,N.derivedCommands.colorMorph);Pe.renderState=t._renderStateMorph,Pe.shaderProgram=t._spMorph,Pe.pickId="czm_batchTable_pickColor(v_batchId)",N.derivedCommands.colorMorph=Pe}}function updateAndQueueCommand(t,n,o,s,c,d,h){o.mode===SceneMode$1.MORPHING?n=n.derivedCommands.colorMorph:o.mode!==SceneMode$1.SCENE3D&&(n=n.derivedCommands.color2D),n.modelMatrix=s,n.boundingVolume=d,n.cull=c,n.debugShowBoundingVolume=h,o.commandList.push(n)}function updateAndQueueCommands(t,n,o,s,c,d,h){const p=t._primitive;Primitive._updateBoundingVolumes(p,n,c);let y;n.mode===SceneMode$1.SCENE3D?y=p._boundingSphereWC:n.mode===SceneMode$1.COLUMBUS_VIEW?y=p._boundingSphereCV:n.mode===SceneMode$1.SCENE2D&&defined(p._boundingSphere2D)?y=p._boundingSphere2D:defined(p._boundingSphereMorph)&&(y=p._boundingSphereMorph);const S=n.mode===SceneMode$1.MORPHING,P=t.classificationType,L=P!==ClassificationType$1.CESIUM_3D_TILE,F=P!==ClassificationType$1.TERRAIN&&!S;let N;const z=n.passes;if(z.render||z.pick&&p.allowPicking){const W=o.length;for(let nt=0;nt<W;++nt){const Pe=y[nt];L&&(N=o[nt],updateAndQueueCommand(t,N,n,c,d,Pe,h)),F&&(N=o[nt].derivedCommands.tileset,updateAndQueueCommand(t,N,n,c,d,Pe,h))}}}GroundPolylinePrimitive.prototype.update=function(t){if(!defined(this._primitive)&&!defined(this.geometryInstances))return;if(!ApproximateTerrainHeights.initialized){if(!this.asynchronous)throw new DeveloperError("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");GroundPolylinePrimitive.initializeTerrainHeights();return}let n;const o=this,s=this._primitiveOptions;if(!defined(this._primitive)){const c=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],d=c.length,h=new Array(d);let p;for(n=0;n<d;++n)if(p=c[n].attributes,!defined(p)||!defined(p.color)){this._hasPerInstanceColors=!1;break}for(n=0;n<d;++n){const y=c[n];p={};const S=y.attributes;for(const P in S)S.hasOwnProperty(P)&&(p[P]=S[P]);defined(p.width)||(p.width=new GeometryInstanceAttribute({componentDatatype:ComponentDatatype$1.UNSIGNED_BYTE,componentsPerAttribute:1,value:[y.geometry.width]})),y.geometry._scene3DOnly=t.scene3DOnly,GroundPolylineGeometry.setProjectionAndEllipsoid(y.geometry,t.mapProjection),h[n]=new GeometryInstance({geometry:y.geometry,attributes:p,id:y.id,pickPrimitive:o})}s.geometryInstances=h,s.appearance=this.appearance,s._createShaderProgramFunction=function(y,S,P){createShaderProgram(o,S,P)},s._createCommandsFunction=function(y,S,P,L,F,N,z){createCommands(o,S,P,L,N,z)},s._updateAndQueueCommandsFunction=function(y,S,P,L,F,N,z,W){updateAndQueueCommands(o,S,P,L,F,N,z)},this._primitive=new Primitive(s)}if(this.appearance instanceof PolylineColorAppearance&&!this._hasPerInstanceColors)throw new DeveloperError("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(t),t.afterRender.push(()=>{!this._ready&&defined(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})},GroundPolylinePrimitive.prototype.getGeometryInstanceAttributes=function(t){if(!defined(this._primitive))throw new DeveloperError("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},GroundPolylinePrimitive.isSupported=function(t){return t.frameState.context.depthTexture},GroundPolylinePrimitive.prototype.isDestroyed=function(){return!1},GroundPolylinePrimitive.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,destroyObject(this)};const defaultRepeat=new Cartesian2(1,1),defaultTransparent=!1,defaultColor$1=Color$1.WHITE;function ImageMaterialProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=t.image,this.repeat=t.repeat,this.color=t.color,this.transparent=t.transparent}Object.defineProperties(ImageMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._image)&&Property.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:createPropertyDescriptor("image"),repeat:createPropertyDescriptor("repeat"),color:createPropertyDescriptor("color"),transparent:createPropertyDescriptor("transparent")}),ImageMaterialProperty.prototype.getType=function(t){return"Image"},ImageMaterialProperty.prototype.getValue=function(t,n){return defined(n)||(n={}),n.image=Property.getValueOrUndefined(this._image,t),n.repeat=Property.getValueOrClonedDefault(this._repeat,t,defaultRepeat,n.repeat),n.color=Property.getValueOrClonedDefault(this._color,t,defaultColor$1,n.color),Property.getValueOrDefault(this._transparent,t,defaultTransparent)&&(n.color.alpha=Math.min(.99,n.color.alpha)),n},ImageMaterialProperty.prototype.equals=function(t){return this===t||t instanceof ImageMaterialProperty&&Property.equals(this._image,t._image)&&Property.equals(this._repeat,t._repeat)&&Property.equals(this._color,t._color)&&Property.equals(this._transparent,t._transparent)};function createMaterialProperty(t){if(t instanceof Color$1)return new ColorMaterialProperty(t);if(typeof t=="string"||t instanceof Resource$1||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement){const n=new ImageMaterialProperty;return n.image=t,n}throw new DeveloperError(`Unable to infer material type: ${t}`)}function createMaterialPropertyDescriptor(t,n){return createPropertyDescriptor(t,n,createMaterialProperty)}function BoxGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(BoxGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),dimensions:createPropertyDescriptor("dimensions"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),BoxGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.dimensions=this.dimensions,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new BoxGraphics(this)},BoxGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.dimensions=defaultValue(this.dimensions,t.dimensions),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PositionProperty(){DeveloperError.throwInstantiationError()}Object.defineProperties(PositionProperty.prototype,{isConstant:{get:DeveloperError.throwInstantiationError},definitionChanged:{get:DeveloperError.throwInstantiationError},referenceFrame:{get:DeveloperError.throwInstantiationError}}),PositionProperty.prototype.getValue=DeveloperError.throwInstantiationError,PositionProperty.prototype.getValueInReferenceFrame=DeveloperError.throwInstantiationError,PositionProperty.prototype.equals=DeveloperError.throwInstantiationError;const scratchMatrix3=new Matrix3;PositionProperty.convertToReferenceFrame=function(t,n,o,s,c){if(!defined(n))return n;if(defined(c)||(c=new Cartesian3),o===s)return Cartesian3.clone(n,c);let d=Transforms.computeIcrfToFixedMatrix(t,scratchMatrix3);if(defined(d)||(d=Transforms.computeTemeToPseudoFixedMatrix(t,scratchMatrix3)),o===ReferenceFrame$1.INERTIAL)return Matrix3.multiplyByVector(d,n,c);if(o===ReferenceFrame$1.FIXED)return Matrix3.multiplyByVector(Matrix3.transpose(d,scratchMatrix3),n,c)};function ConstantPositionProperty(t,n){this._definitionChanged=new Event$1,this._value=Cartesian3.clone(t),this._referenceFrame=defaultValue(n,ReferenceFrame$1.FIXED)}Object.defineProperties(ConstantPositionProperty.prototype,{isConstant:{get:function(){return!defined(this._value)||this._referenceFrame===ReferenceFrame$1.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}}),ConstantPositionProperty.prototype.getValue=function(t,n){return this.getValueInReferenceFrame(t,ReferenceFrame$1.FIXED,n)},ConstantPositionProperty.prototype.setValue=function(t,n){let o=!1;Cartesian3.equals(this._value,t)||(o=!0,this._value=Cartesian3.clone(t)),defined(n)&&this._referenceFrame!==n&&(o=!0,this._referenceFrame=n),o&&this._definitionChanged.raiseEvent(this)},ConstantPositionProperty.prototype.getValueInReferenceFrame=function(t,n,o){if(!defined(t))throw new DeveloperError("time is required.");if(!defined(n))throw new DeveloperError("referenceFrame is required.");return PositionProperty.convertToReferenceFrame(t,this._value,this._referenceFrame,n,o)},ConstantPositionProperty.prototype.equals=function(t){return this===t||t instanceof ConstantPositionProperty&&Cartesian3.equals(this._value,t._value)&&this._referenceFrame===t._referenceFrame};function CorridorGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(CorridorGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),width:createPropertyDescriptor("width"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),cornerType:createPropertyDescriptor("cornerType"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),CorridorGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.width=this.width,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.cornerType=this.cornerType,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new CorridorGraphics(this)},CorridorGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.width=defaultValue(this.width,t.width),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.cornerType=defaultValue(this.cornerType,t.cornerType),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function createRawProperty(t){return t}function createRawPropertyDescriptor(t,n){return createPropertyDescriptor(t,n,createRawProperty)}function CylinderGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(CylinderGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),length:createPropertyDescriptor("length"),topRadius:createPropertyDescriptor("topRadius"),bottomRadius:createPropertyDescriptor("bottomRadius"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),numberOfVerticalLines:createPropertyDescriptor("numberOfVerticalLines"),slices:createPropertyDescriptor("slices"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),CylinderGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.length=this.length,t.topRadius=this.topRadius,t.bottomRadius=this.bottomRadius,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.numberOfVerticalLines=this.numberOfVerticalLines,t.slices=this.slices,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new CylinderGraphics(this)},CylinderGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.length=defaultValue(this.length,t.length),this.topRadius=defaultValue(this.topRadius,t.topRadius),this.bottomRadius=defaultValue(this.bottomRadius,t.bottomRadius),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=defaultValue(this.numberOfVerticalLines,t.numberOfVerticalLines),this.slices=defaultValue(this.slices,t.slices),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function EllipseGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(EllipseGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),semiMajorAxis:createPropertyDescriptor("semiMajorAxis"),semiMinorAxis:createPropertyDescriptor("semiMinorAxis"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),rotation:createPropertyDescriptor("rotation"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),numberOfVerticalLines:createPropertyDescriptor("numberOfVerticalLines"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),EllipseGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.semiMajorAxis=this.semiMajorAxis,t.semiMinorAxis=this.semiMinorAxis,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.rotation=this.rotation,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.numberOfVerticalLines=this.numberOfVerticalLines,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new EllipseGraphics(this)},EllipseGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.semiMajorAxis=defaultValue(this.semiMajorAxis,t.semiMajorAxis),this.semiMinorAxis=defaultValue(this.semiMinorAxis,t.semiMinorAxis),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.rotation=defaultValue(this.rotation,t.rotation),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.numberOfVerticalLines=defaultValue(this.numberOfVerticalLines,t.numberOfVerticalLines),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function EllipsoidGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(EllipsoidGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),radii:createPropertyDescriptor("radii"),innerRadii:createPropertyDescriptor("innerRadii"),minimumClock:createPropertyDescriptor("minimumClock"),maximumClock:createPropertyDescriptor("maximumClock"),minimumCone:createPropertyDescriptor("minimumCone"),maximumCone:createPropertyDescriptor("maximumCone"),heightReference:createPropertyDescriptor("heightReference"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),stackPartitions:createPropertyDescriptor("stackPartitions"),slicePartitions:createPropertyDescriptor("slicePartitions"),subdivisions:createPropertyDescriptor("subdivisions"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),EllipsoidGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.radii=this.radii,t.innerRadii=this.innerRadii,t.minimumClock=this.minimumClock,t.maximumClock=this.maximumClock,t.minimumCone=this.minimumCone,t.maximumCone=this.maximumCone,t.heightReference=this.heightReference,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.stackPartitions=this.stackPartitions,t.slicePartitions=this.slicePartitions,t.subdivisions=this.subdivisions,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new EllipsoidGraphics(this)},EllipsoidGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.radii=defaultValue(this.radii,t.radii),this.innerRadii=defaultValue(this.innerRadii,t.innerRadii),this.minimumClock=defaultValue(this.minimumClock,t.minimumClock),this.maximumClock=defaultValue(this.maximumClock,t.maximumClock),this.minimumCone=defaultValue(this.minimumCone,t.minimumCone),this.maximumCone=defaultValue(this.maximumCone,t.maximumCone),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.stackPartitions=defaultValue(this.stackPartitions,t.stackPartitions),this.slicePartitions=defaultValue(this.slicePartitions,t.slicePartitions),this.subdivisions=defaultValue(this.subdivisions,t.subdivisions),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function LabelGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(LabelGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),text:createPropertyDescriptor("text"),font:createPropertyDescriptor("font"),style:createPropertyDescriptor("style"),scale:createPropertyDescriptor("scale"),showBackground:createPropertyDescriptor("showBackground"),backgroundColor:createPropertyDescriptor("backgroundColor"),backgroundPadding:createPropertyDescriptor("backgroundPadding"),pixelOffset:createPropertyDescriptor("pixelOffset"),eyeOffset:createPropertyDescriptor("eyeOffset"),horizontalOrigin:createPropertyDescriptor("horizontalOrigin"),verticalOrigin:createPropertyDescriptor("verticalOrigin"),heightReference:createPropertyDescriptor("heightReference"),fillColor:createPropertyDescriptor("fillColor"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),pixelOffsetScaleByDistance:createPropertyDescriptor("pixelOffsetScaleByDistance"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),LabelGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.text=this.text,t.font=this.font,t.style=this.style,t.scale=this.scale,t.showBackground=this.showBackground,t.backgroundColor=this.backgroundColor,t.backgroundPadding=this.backgroundPadding,t.pixelOffset=this.pixelOffset,t.eyeOffset=this.eyeOffset,t.horizontalOrigin=this.horizontalOrigin,t.verticalOrigin=this.verticalOrigin,t.heightReference=this.heightReference,t.fillColor=this.fillColor,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.translucencyByDistance=this.translucencyByDistance,t.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,t.scaleByDistance=this.scaleByDistance,t.distanceDisplayCondition=this.distanceDisplayCondition,t.disableDepthTestDistance=this.disableDepthTestDistance,t):new LabelGraphics(this)},LabelGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.text=defaultValue(this.text,t.text),this.font=defaultValue(this.font,t.font),this.style=defaultValue(this.style,t.style),this.scale=defaultValue(this.scale,t.scale),this.showBackground=defaultValue(this.showBackground,t.showBackground),this.backgroundColor=defaultValue(this.backgroundColor,t.backgroundColor),this.backgroundPadding=defaultValue(this.backgroundPadding,t.backgroundPadding),this.pixelOffset=defaultValue(this.pixelOffset,t.pixelOffset),this.eyeOffset=defaultValue(this.eyeOffset,t.eyeOffset),this.horizontalOrigin=defaultValue(this.horizontalOrigin,t.horizontalOrigin),this.verticalOrigin=defaultValue(this.verticalOrigin,t.verticalOrigin),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.fillColor=defaultValue(this.fillColor,t.fillColor),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.translucencyByDistance=defaultValue(this.translucencyByDistance,t.translucencyByDistance),this.pixelOffsetScaleByDistance=defaultValue(this.pixelOffsetScaleByDistance,t.pixelOffsetScaleByDistance),this.scaleByDistance=defaultValue(this.scaleByDistance,t.scaleByDistance),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this.disableDepthTestDistance,t.disableDepthTestDistance)};const defaultNodeTransformation=new TranslationRotationScale;function NodeTransformationProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=t.translation,this.rotation=t.rotation,this.scale=t.scale}Object.defineProperties(NodeTransformationProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._translation)&&Property.isConstant(this._rotation)&&Property.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:createPropertyDescriptor("translation"),rotation:createPropertyDescriptor("rotation"),scale:createPropertyDescriptor("scale")}),NodeTransformationProperty.prototype.getValue=function(t,n){return defined(n)||(n=new TranslationRotationScale),n.translation=Property.getValueOrClonedDefault(this._translation,t,defaultNodeTransformation.translation,n.translation),n.rotation=Property.getValueOrClonedDefault(this._rotation,t,defaultNodeTransformation.rotation,n.rotation),n.scale=Property.getValueOrClonedDefault(this._scale,t,defaultNodeTransformation.scale,n.scale),n},NodeTransformationProperty.prototype.equals=function(t){return this===t||t instanceof NodeTransformationProperty&&Property.equals(this._translation,t._translation)&&Property.equals(this._rotation,t._rotation)&&Property.equals(this._scale,t._scale)};function PropertyBag(t,n){this._propertyNames=[],this._definitionChanged=new Event$1,defined(t)&&this.merge(t,n)}Object.defineProperties(PropertyBag.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){const t=this._propertyNames;for(let n=0,o=t.length;n<o;n++)if(!Property.isConstant(this[t[n]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}}),PropertyBag.prototype.hasProperty=function(t){return this._propertyNames.indexOf(t)!==-1};function createConstantProperty(t){return new ConstantProperty(t)}PropertyBag.prototype.addProperty=function(t,n,o){const s=this._propertyNames;if(!defined(t))throw new DeveloperError("propertyName is required.");if(s.indexOf(t)!==-1)throw new DeveloperError(`${t} is already a registered property.`);s.push(t),Object.defineProperty(this,t,createPropertyDescriptor(t,!0,defaultValue(o,createConstantProperty))),defined(n)&&(this[t]=n),this._definitionChanged.raiseEvent(this)},PropertyBag.prototype.removeProperty=function(t){const o=this._propertyNames.indexOf(t);if(!defined(t))throw new DeveloperError("propertyName is required.");if(o===-1)throw new DeveloperError(`${t} is not a registered property.`);this._propertyNames.splice(o,1),delete this[t],this._definitionChanged.raiseEvent(this)},PropertyBag.prototype.getValue=function(t,n){if(!defined(t))throw new DeveloperError("time is required.");defined(n)||(n={});const o=this._propertyNames;for(let s=0,c=o.length;s<c;s++){const d=o[s];n[d]=Property.getValueOrUndefined(this[d],t,n[d])}return n},PropertyBag.prototype.merge=function(t,n){if(!defined(t))throw new DeveloperError("source is required.");const o=this._propertyNames,s=defined(t._propertyNames)?t._propertyNames:Object.keys(t);for(let c=0,d=s.length;c<d;c++){const h=s[c],p=this[h],y=t[h];p===void 0&&o.indexOf(h)===-1&&this.addProperty(h,void 0,n),y!==void 0&&(p!==void 0?defined(p)&&defined(p.merge)&&p.merge(y):defined(y)&&defined(y.merge)&&defined(y.clone)?this[h]=y.clone():this[h]=y)}};function propertiesEqual(t,n){const o=t._propertyNames,s=n._propertyNames,c=o.length;if(c!==s.length)return!1;for(let d=0;d<c;++d){const h=o[d];if(s.indexOf(h)===-1||!Property.equals(t[h],n[h]))return!1}return!0}PropertyBag.prototype.equals=function(t){return this===t||t instanceof PropertyBag&&propertiesEqual(this,t)};function createNodeTransformationProperty(t){return new NodeTransformationProperty(t)}function createNodeTransformationPropertyBag(t){return new PropertyBag(t,createNodeTransformationProperty)}function createArticulationStagePropertyBag(t){return new PropertyBag(t)}function ModelGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(ModelGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),uri:createPropertyDescriptor("uri"),scale:createPropertyDescriptor("scale"),minimumPixelSize:createPropertyDescriptor("minimumPixelSize"),maximumScale:createPropertyDescriptor("maximumScale"),incrementallyLoadTextures:createPropertyDescriptor("incrementallyLoadTextures"),runAnimations:createPropertyDescriptor("runAnimations"),clampAnimations:createPropertyDescriptor("clampAnimations"),shadows:createPropertyDescriptor("shadows"),heightReference:createPropertyDescriptor("heightReference"),silhouetteColor:createPropertyDescriptor("silhouetteColor"),silhouetteSize:createPropertyDescriptor("silhouetteSize"),color:createPropertyDescriptor("color"),colorBlendMode:createPropertyDescriptor("colorBlendMode"),colorBlendAmount:createPropertyDescriptor("colorBlendAmount"),imageBasedLightingFactor:createPropertyDescriptor("imageBasedLightingFactor"),lightColor:createPropertyDescriptor("lightColor"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),nodeTransformations:createPropertyDescriptor("nodeTransformations",void 0,createNodeTransformationPropertyBag),articulations:createPropertyDescriptor("articulations",void 0,createArticulationStagePropertyBag),clippingPlanes:createPropertyDescriptor("clippingPlanes"),customShader:createPropertyDescriptor("customShader")}),ModelGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.uri=this.uri,t.scale=this.scale,t.minimumPixelSize=this.minimumPixelSize,t.maximumScale=this.maximumScale,t.incrementallyLoadTextures=this.incrementallyLoadTextures,t.runAnimations=this.runAnimations,t.clampAnimations=this.clampAnimations,t.heightReference=this._heightReference,t.silhouetteColor=this.silhouetteColor,t.silhouetteSize=this.silhouetteSize,t.color=this.color,t.colorBlendMode=this.colorBlendMode,t.colorBlendAmount=this.colorBlendAmount,t.imageBasedLightingFactor=this.imageBasedLightingFactor,t.lightColor=this.lightColor,t.distanceDisplayCondition=this.distanceDisplayCondition,t.nodeTransformations=this.nodeTransformations,t.articulations=this.articulations,t.clippingPlanes=this.clippingPlanes,t.customShader=this.customShader,t):new ModelGraphics(this)},ModelGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.uri=defaultValue(this.uri,t.uri),this.scale=defaultValue(this.scale,t.scale),this.minimumPixelSize=defaultValue(this.minimumPixelSize,t.minimumPixelSize),this.maximumScale=defaultValue(this.maximumScale,t.maximumScale),this.incrementallyLoadTextures=defaultValue(this.incrementallyLoadTextures,t.incrementallyLoadTextures),this.runAnimations=defaultValue(this.runAnimations,t.runAnimations),this.clampAnimations=defaultValue(this.clampAnimations,t.clampAnimations),this.shadows=defaultValue(this.shadows,t.shadows),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.silhouetteColor=defaultValue(this.silhouetteColor,t.silhouetteColor),this.silhouetteSize=defaultValue(this.silhouetteSize,t.silhouetteSize),this.color=defaultValue(this.color,t.color),this.colorBlendMode=defaultValue(this.colorBlendMode,t.colorBlendMode),this.colorBlendAmount=defaultValue(this.colorBlendAmount,t.colorBlendAmount),this.imageBasedLightingFactor=defaultValue(this.imageBasedLightingFactor,t.imageBasedLightingFactor),this.lightColor=defaultValue(this.lightColor,t.lightColor),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.clippingPlanes=defaultValue(this.clippingPlanes,t.clippingPlanes),this.customShader=defaultValue(this.customShader,t.customShader);const n=t.nodeTransformations;if(defined(n)){const s=this.nodeTransformations;defined(s)?s.merge(n):this.nodeTransformations=new PropertyBag(n,createNodeTransformationProperty)}const o=t.articulations;if(defined(o)){const s=this.articulations;defined(s)?s.merge(o):this.articulations=new PropertyBag(o)}};function Cesium3DTilesetGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(Cesium3DTilesetGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),uri:createPropertyDescriptor("uri"),maximumScreenSpaceError:createPropertyDescriptor("maximumScreenSpaceError")}),Cesium3DTilesetGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.uri=this.uri,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t):new Cesium3DTilesetGraphics(this)},Cesium3DTilesetGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.uri=defaultValue(this.uri,t.uri),this.maximumScreenSpaceError=defaultValue(this.maximumScreenSpaceError,t.maximumScreenSpaceError)};function PathGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PathGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),leadTime:createPropertyDescriptor("leadTime"),trailTime:createPropertyDescriptor("trailTime"),width:createPropertyDescriptor("width"),resolution:createPropertyDescriptor("resolution"),material:createMaterialPropertyDescriptor("material"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PathGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.leadTime=this.leadTime,t.trailTime=this.trailTime,t.width=this.width,t.resolution=this.resolution,t.material=this.material,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PathGraphics(this)},PathGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.leadTime=defaultValue(this.leadTime,t.leadTime),this.trailTime=defaultValue(this.trailTime,t.trailTime),this.width=defaultValue(this.width,t.width),this.resolution=defaultValue(this.resolution,t.resolution),this.material=defaultValue(this.material,t.material),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PlaneGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PlaneGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),plane:createPropertyDescriptor("plane"),dimensions:createPropertyDescriptor("dimensions"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PlaneGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.plane=this.plane,t.dimensions=this.dimensions,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PlaneGraphics(this)},PlaneGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.plane=defaultValue(this.plane,t.plane),this.dimensions=defaultValue(this.dimensions,t.dimensions),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function PointGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PointGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),pixelSize:createPropertyDescriptor("pixelSize"),heightReference:createPropertyDescriptor("heightReference"),color:createPropertyDescriptor("color"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),scaleByDistance:createPropertyDescriptor("scaleByDistance"),translucencyByDistance:createPropertyDescriptor("translucencyByDistance"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),disableDepthTestDistance:createPropertyDescriptor("disableDepthTestDistance")}),PointGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.pixelSize=this.pixelSize,t.heightReference=this.heightReference,t.color=this.color,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.scaleByDistance=this.scaleByDistance,t.translucencyByDistance=this._translucencyByDistance,t.distanceDisplayCondition=this.distanceDisplayCondition,t.disableDepthTestDistance=this.disableDepthTestDistance,t):new PointGraphics(this)},PointGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.pixelSize=defaultValue(this.pixelSize,t.pixelSize),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.color=defaultValue(this.color,t.color),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.scaleByDistance=defaultValue(this.scaleByDistance,t.scaleByDistance),this.translucencyByDistance=defaultValue(this._translucencyByDistance,t.translucencyByDistance),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.disableDepthTestDistance=defaultValue(this.disableDepthTestDistance,t.disableDepthTestDistance)};function createPolygonHierarchyProperty(t){return Array.isArray(t)&&(t=new PolygonHierarchy(t)),new ConstantProperty(t)}function PolygonGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolygonGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),hierarchy:createPropertyDescriptor("hierarchy",void 0,createPolygonHierarchyProperty),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),perPositionHeight:createPropertyDescriptor("perPositionHeight"),closeTop:createPropertyDescriptor("closeTop"),closeBottom:createPropertyDescriptor("closeBottom"),arcType:createPropertyDescriptor("arcType"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex"),textureCoordinates:createPropertyDescriptor("textureCoordinates")}),PolygonGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.hierarchy=this.hierarchy,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.perPositionHeight=this.perPositionHeight,t.closeTop=this.closeTop,t.closeBottom=this.closeBottom,t.arcType=this.arcType,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t.textureCoordinates=this.textureCoordinates,t):new PolygonGraphics(this)},PolygonGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.hierarchy=defaultValue(this.hierarchy,t.hierarchy),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.perPositionHeight=defaultValue(this.perPositionHeight,t.perPositionHeight),this.closeTop=defaultValue(this.closeTop,t.closeTop),this.closeBottom=defaultValue(this.closeBottom,t.closeBottom),this.arcType=defaultValue(this.arcType,t.arcType),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex),this.textureCoordinates=defaultValue(this.textureCoordinates,t.textureCoordinates)};function PolylineGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolylineGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),width:createPropertyDescriptor("width"),granularity:createPropertyDescriptor("granularity"),material:createMaterialPropertyDescriptor("material"),depthFailMaterial:createMaterialPropertyDescriptor("depthFailMaterial"),arcType:createPropertyDescriptor("arcType"),clampToGround:createPropertyDescriptor("clampToGround"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),PolylineGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.width=this.width,t.granularity=this.granularity,t.material=this.material,t.depthFailMaterial=this.depthFailMaterial,t.arcType=this.arcType,t.clampToGround=this.clampToGround,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new PolylineGraphics(this)},PolylineGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.width=defaultValue(this.width,t.width),this.granularity=defaultValue(this.granularity,t.granularity),this.material=defaultValue(this.material,t.material),this.depthFailMaterial=defaultValue(this.depthFailMaterial,t.depthFailMaterial),this.arcType=defaultValue(this.arcType,t.arcType),this.clampToGround=defaultValue(this.clampToGround,t.clampToGround),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function PolylineVolumeGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(PolylineVolumeGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),shape:createPropertyDescriptor("shape"),cornerType:createPropertyDescriptor("cornerType"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),PolylineVolumeGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.shape=this.shape,t.cornerType=this.cornerType,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new PolylineVolumeGraphics(this)},PolylineVolumeGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.shape=defaultValue(this.shape,t.shape),this.cornerType=defaultValue(this.cornerType,t.cornerType),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};function RectangleGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(RectangleGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),coordinates:createPropertyDescriptor("coordinates"),height:createPropertyDescriptor("height"),heightReference:createPropertyDescriptor("heightReference"),extrudedHeight:createPropertyDescriptor("extrudedHeight"),extrudedHeightReference:createPropertyDescriptor("extrudedHeightReference"),rotation:createPropertyDescriptor("rotation"),stRotation:createPropertyDescriptor("stRotation"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition"),classificationType:createPropertyDescriptor("classificationType"),zIndex:createPropertyDescriptor("zIndex")}),RectangleGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.coordinates=this.coordinates,t.height=this.height,t.heightReference=this.heightReference,t.extrudedHeight=this.extrudedHeight,t.extrudedHeightReference=this.extrudedHeightReference,t.rotation=this.rotation,t.stRotation=this.stRotation,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t.classificationType=this.classificationType,t.zIndex=this.zIndex,t):new RectangleGraphics(this)},RectangleGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.coordinates=defaultValue(this.coordinates,t.coordinates),this.height=defaultValue(this.height,t.height),this.heightReference=defaultValue(this.heightReference,t.heightReference),this.extrudedHeight=defaultValue(this.extrudedHeight,t.extrudedHeight),this.extrudedHeightReference=defaultValue(this.extrudedHeightReference,t.extrudedHeightReference),this.rotation=defaultValue(this.rotation,t.rotation),this.stRotation=defaultValue(this.stRotation,t.stRotation),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition),this.classificationType=defaultValue(this.classificationType,t.classificationType),this.zIndex=defaultValue(this.zIndex,t.zIndex)};function WallGraphics(t){this._definitionChanged=new Event$1,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(defaultValue(t,defaultValue.EMPTY_OBJECT))}Object.defineProperties(WallGraphics.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:createPropertyDescriptor("show"),positions:createPropertyDescriptor("positions"),minimumHeights:createPropertyDescriptor("minimumHeights"),maximumHeights:createPropertyDescriptor("maximumHeights"),granularity:createPropertyDescriptor("granularity"),fill:createPropertyDescriptor("fill"),material:createMaterialPropertyDescriptor("material"),outline:createPropertyDescriptor("outline"),outlineColor:createPropertyDescriptor("outlineColor"),outlineWidth:createPropertyDescriptor("outlineWidth"),shadows:createPropertyDescriptor("shadows"),distanceDisplayCondition:createPropertyDescriptor("distanceDisplayCondition")}),WallGraphics.prototype.clone=function(t){return defined(t)?(t.show=this.show,t.positions=this.positions,t.minimumHeights=this.minimumHeights,t.maximumHeights=this.maximumHeights,t.granularity=this.granularity,t.fill=this.fill,t.material=this.material,t.outline=this.outline,t.outlineColor=this.outlineColor,t.outlineWidth=this.outlineWidth,t.shadows=this.shadows,t.distanceDisplayCondition=this.distanceDisplayCondition,t):new WallGraphics(this)},WallGraphics.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.show=defaultValue(this.show,t.show),this.positions=defaultValue(this.positions,t.positions),this.minimumHeights=defaultValue(this.minimumHeights,t.minimumHeights),this.maximumHeights=defaultValue(this.maximumHeights,t.maximumHeights),this.granularity=defaultValue(this.granularity,t.granularity),this.fill=defaultValue(this.fill,t.fill),this.material=defaultValue(this.material,t.material),this.outline=defaultValue(this.outline,t.outline),this.outlineColor=defaultValue(this.outlineColor,t.outlineColor),this.outlineWidth=defaultValue(this.outlineWidth,t.outlineWidth),this.shadows=defaultValue(this.shadows,t.shadows),this.distanceDisplayCondition=defaultValue(this.distanceDisplayCondition,t.distanceDisplayCondition)};const cartoScratch=new Cartographic,ExtraPropertyNames=[];function createConstantPositionProperty(t){return new ConstantPositionProperty(t)}function createPositionPropertyDescriptor(t){return createPropertyDescriptor(t,void 0,createConstantPositionProperty)}function createPropertyTypeDescriptor(t,n){return createPropertyDescriptor(t,void 0,function(o){return o instanceof n?o:new n(o)})}function Entity$1(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT);let n=t.id;defined(n)||(n=createGuid()),this._availability=void 0,this._id=n,this._definitionChanged=new Event$1,this._name=t.name,this._show=defaultValue(t.show,!0),this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...ExtraPropertyNames],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=t.parent,this.merge(t)}function updateShow(t,n,o){const s=n.length;for(let c=0;c<s;c++){const d=n[c],h=d._show;(!o&&h)!==(o&&h)&&updateShow(d,d._children,o)}t._definitionChanged.raiseEvent(t,"isShowing",o,!o)}Object.defineProperties(Entity$1.prototype,{availability:createRawPropertyDescriptor("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:createRawPropertyDescriptor("name"),show:{get:function(){return this._show},set:function(t){if(!defined(t))throw new DeveloperError("value is required.");if(t===this._show)return;const n=this.isShowing;this._show=t;const o=this.isShowing;n!==o&&updateShow(this,this._children,o),this._definitionChanged.raiseEvent(this,"show",t,!t)}},isShowing:{get:function(){return this._show&&(!defined(this.entityCollection)||this.entityCollection.show)&&(!defined(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(t){const n=this._parent;if(n===t)return;const o=this.isShowing;if(defined(n)){const c=n._children.indexOf(this);n._children.splice(c,1)}this._parent=t,defined(t)&&t._children.push(this);const s=this.isShowing;o!==s&&updateShow(this,this._children,s),this._definitionChanged.raiseEvent(this,"parent",t,n)}},propertyNames:{get:function(){return this._propertyNames}},billboard:createPropertyTypeDescriptor("billboard",BillboardGraphics),box:createPropertyTypeDescriptor("box",BoxGraphics),corridor:createPropertyTypeDescriptor("corridor",CorridorGraphics),cylinder:createPropertyTypeDescriptor("cylinder",CylinderGraphics),description:createPropertyDescriptor("description"),ellipse:createPropertyTypeDescriptor("ellipse",EllipseGraphics),ellipsoid:createPropertyTypeDescriptor("ellipsoid",EllipsoidGraphics),label:createPropertyTypeDescriptor("label",LabelGraphics),model:createPropertyTypeDescriptor("model",ModelGraphics),tileset:createPropertyTypeDescriptor("tileset",Cesium3DTilesetGraphics),orientation:createPropertyDescriptor("orientation"),path:createPropertyTypeDescriptor("path",PathGraphics),plane:createPropertyTypeDescriptor("plane",PlaneGraphics),point:createPropertyTypeDescriptor("point",PointGraphics),polygon:createPropertyTypeDescriptor("polygon",PolygonGraphics),polyline:createPropertyTypeDescriptor("polyline",PolylineGraphics),polylineVolume:createPropertyTypeDescriptor("polylineVolume",PolylineVolumeGraphics),properties:createPropertyTypeDescriptor("properties",PropertyBag),position:createPositionPropertyDescriptor("position"),rectangle:createPropertyTypeDescriptor("rectangle",RectangleGraphics),viewFrom:createPropertyDescriptor("viewFrom"),wall:createPropertyTypeDescriptor("wall",WallGraphics)}),Entity$1.registerEntityType=function(t,n){Object.defineProperties(Entity$1.prototype,{[t]:createPropertyTypeDescriptor(t,n)}),ExtraPropertyNames.includes(t)||ExtraPropertyNames.push(t)},Entity$1.prototype.isAvailable=function(t){if(!defined(t))throw new DeveloperError("time is required.");const n=this._availability;return!defined(n)||n.contains(t)},Entity$1.prototype.addProperty=function(t){const n=this._propertyNames;if(!defined(t))throw new DeveloperError("propertyName is required.");if(n.indexOf(t)!==-1)throw new DeveloperError(`${t} is already a registered property.`);if(t in this)throw new DeveloperError(`${t} is a reserved property name.`);n.push(t),Object.defineProperty(this,t,createRawPropertyDescriptor(t,!0))},Entity$1.prototype.removeProperty=function(t){const o=this._propertyNames.indexOf(t);if(!defined(t))throw new DeveloperError("propertyName is required.");if(o===-1)throw new DeveloperError(`${t} is not a registered property.`);this._propertyNames.splice(o,1),delete this[t]},Entity$1.prototype.merge=function(t){if(!defined(t))throw new DeveloperError("source is required.");this.name=defaultValue(this.name,t.name),this.availability=defaultValue(this.availability,t.availability);const n=this._propertyNames,o=defined(t._propertyNames)?t._propertyNames:Object.keys(t),s=o.length;for(let c=0;c<s;c++){const d=o[c];if(d==="parent"||d==="name"||d==="availability"||d==="children")continue;const h=this[d],p=t[d];!defined(h)&&n.indexOf(d)===-1&&this.addProperty(d),defined(p)&&(defined(h)?defined(h.merge)&&h.merge(p):defined(p.merge)&&defined(p.clone)?this[d]=p.clone():this[d]=p)}};const matrix3Scratch=new Matrix3,positionScratch$2=new Cartesian3,orientationScratch=new Quaternion;Entity$1.prototype.computeModelMatrix=function(t,n){Check.typeOf.object("time",t);const o=Property.getValueOrUndefined(this._position,t,positionScratch$2);if(!defined(o))return;const s=Property.getValueOrUndefined(this._orientation,t,orientationScratch);return defined(s)?n=Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(s,matrix3Scratch),o,n):n=Transforms.eastNorthUpToFixedFrame(o,void 0,n),n},Entity$1.prototype.computeModelMatrixForHeightReference=function(t,n,o,s,c){Check.typeOf.object("time",t);const d=Property.getValueOrDefault(n,t,HeightReference$1.NONE);let h=Property.getValueOrUndefined(this._position,t,positionScratch$2);if(d===HeightReference$1.NONE||!defined(h)||Cartesian3.equalsEpsilon(h,Cartesian3.ZERO,CesiumMath.EPSILON8))return this.computeModelMatrix(t,c);const p=s.cartesianToCartographic(h,cartoScratch);isHeightReferenceClamp(d)?p.height=o:p.height+=o,h=s.cartographicToCartesian(p,h);const y=Property.getValueOrUndefined(this._orientation,t,orientationScratch);return defined(y)?c=Matrix4.fromRotationTranslation(Matrix3.fromQuaternion(y,matrix3Scratch),h,c):c=Transforms.eastNorthUpToFixedFrame(h,void 0,c),c},Entity$1.supportsMaterialsforEntitiesOnTerrain=function(t){return GroundPrimitive.supportsMaterials(t)},Entity$1.supportsPolylinesOnTerrain=function(t){return GroundPolylinePrimitive.isSupported(t)};function CallbackProperty(t,n){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new Event$1,this.setCallback(t,n)}Object.defineProperties(CallbackProperty.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}}),CallbackProperty.prototype.getValue=function(t,n){return this._callback(t,n)},CallbackProperty.prototype.setCallback=function(t,n){if(!defined(t))throw new DeveloperError("callback is required.");if(!defined(n))throw new DeveloperError("isConstant is required.");const o=this._callback!==t||this._isConstant!==n;this._callback=t,this._isConstant=n,o&&this._definitionChanged.raiseEvent(this)},CallbackProperty.prototype.equals=function(t){return this===t||t instanceof CallbackProperty&&this._callback===t._callback&&this._isConstant===t._isConstant};const SceneTransforms={},actualPositionScratch=new Cartesian4(0,0,0,1);let positionCC=new Cartesian4;const scratchViewport=new BoundingRectangle,scratchWindowCoord0=new Cartesian2,scratchWindowCoord1=new Cartesian2;SceneTransforms.wgs84ToWindowCoordinates=function(t,n,o){return SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates(t,n,Cartesian3.ZERO,o)};const scratchCartesian4=new Cartesian4,scratchEyeOffset=new Cartesian3;function worldToClip(t,n,o,s){const c=o.viewMatrix,d=Matrix4.multiplyByVector(c,Cartesian4.fromElements(t.x,t.y,t.z,1,scratchCartesian4),scratchCartesian4),h=Cartesian3.multiplyComponents(n,Cartesian3.normalize(d,scratchEyeOffset),scratchEyeOffset);return d.x+=n.x+h.x,d.y+=n.y+h.y,d.z+=h.z,Matrix4.multiplyByVector(o.frustum.projectionMatrix,d,s)}const scratchMaxCartographic=new Cartographic(Math.PI,CesiumMath.PI_OVER_TWO),scratchProjectedCartesian=new Cartesian3,scratchCameraPosition=new Cartesian3;SceneTransforms.wgs84WithEyeOffsetToWindowCoordinates=function(t,n,o,s){if(!defined(t))throw new DeveloperError("scene is required.");if(!defined(n))throw new DeveloperError("position is required.");const c=t.frameState,d=SceneTransforms.computeActualWgs84Position(c,n,actualPositionScratch);if(!defined(d))return;const h=t.canvas,p=scratchViewport;p.x=0,p.y=0,p.width=h.clientWidth,p.height=h.clientHeight;const y=t.camera;let S=!1;if(c.mode===SceneMode$1.SCENE2D){const P=t.mapProjection,L=scratchMaxCartographic,F=P.project(L,scratchProjectedCartesian),N=Cartesian3.clone(y.position,scratchCameraPosition),z=y.frustum.clone(),W=Matrix4.computeViewportTransformation(p,0,1,new Matrix4),nt=y.frustum.projectionMatrix,Pe=y.positionWC.y,se=Cartesian3.fromElements(CesiumMath.sign(Pe)*F.x-Pe,0,-y.positionWC.x),mt=Transforms.pointToGLWindowCoordinates(nt,W,se);if(Pe===0||mt.x<=0||mt.x>=h.clientWidth)S=!0;else{if(mt.x>h.clientWidth*.5){p.width=mt.x,y.frustum.right=F.x-Pe,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord0),p.x+=mt.x,y.position.x=-y.position.x;const kt=y.frustum.right;y.frustum.right=-y.frustum.left,y.frustum.left=-kt,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord1)}else{p.x+=mt.x,p.width-=mt.x,y.frustum.left=-F.x-Pe,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord0),p.x=p.x-p.width,y.position.x=-y.position.x;const kt=y.frustum.left;y.frustum.left=-y.frustum.right,y.frustum.right=-kt,positionCC=worldToClip(d,o,y,positionCC),SceneTransforms.clipToGLWindowCoordinates(p,positionCC,scratchWindowCoord1)}Cartesian3.clone(N,y.position),y.frustum=z.clone(),s=Cartesian2.clone(scratchWindowCoord0,s),(s.x<0||s.x>h.clientWidth)&&(s.x=scratchWindowCoord1.x)}}if(c.mode!==SceneMode$1.SCENE2D||S){if(positionCC=worldToClip(d,o,y,positionCC),positionCC.z<0&&!(y.frustum instanceof OrthographicFrustum)&&!(y.frustum instanceof OrthographicOffCenterFrustum))return;s=SceneTransforms.clipToGLWindowCoordinates(p,positionCC,s)}return s.y=h.clientHeight-s.y,s},SceneTransforms.wgs84ToDrawingBufferCoordinates=function(t,n,o){if(o=SceneTransforms.wgs84ToWindowCoordinates(t,n,o),!!defined(o))return SceneTransforms.transformWindowToDrawingBuffer(t,o,o)};const projectedPosition=new Cartesian3,positionInCartographic=new Cartographic;SceneTransforms.computeActualWgs84Position=function(t,n,o){const s=t.mode;if(s===SceneMode$1.SCENE3D)return Cartesian3.clone(n,o);const c=t.mapProjection,d=c.ellipsoid.cartesianToCartographic(n,positionInCartographic);if(!defined(d))return;if(c.project(d,projectedPosition),s===SceneMode$1.COLUMBUS_VIEW)return Cartesian3.fromElements(projectedPosition.z,projectedPosition.x,projectedPosition.y,o);if(s===SceneMode$1.SCENE2D)return Cartesian3.fromElements(0,projectedPosition.x,projectedPosition.y,o);const h=t.morphTime;return Cartesian3.fromElements(CesiumMath.lerp(projectedPosition.z,n.x,h),CesiumMath.lerp(projectedPosition.x,n.y,h),CesiumMath.lerp(projectedPosition.y,n.z,h),o)};const positionNDC=new Cartesian3,positionWC=new Cartesian3,viewportTransform=new Matrix4;SceneTransforms.clipToGLWindowCoordinates=function(t,n,o){return Cartesian3.divideByScalar(n,n.w,positionNDC),Matrix4.computeViewportTransformation(t,0,1,viewportTransform),Matrix4.multiplyByPoint(viewportTransform,positionNDC,positionWC),Cartesian2.fromCartesian3(positionWC,o)},SceneTransforms.transformWindowToDrawingBuffer=function(t,n,o){const s=t.canvas,c=t.drawingBufferWidth/s.clientWidth,d=t.drawingBufferHeight/s.clientHeight;return Cartesian2.fromElements(n.x*c,n.y*d,o)};const scratchNDC=new Cartesian4,scratchWorldCoords=new Cartesian4;SceneTransforms.drawingBufferToWgs84Coordinates=function(t,n,o,s){const d=t.context.uniformState,h=d.currentFrustum,p=h.x,y=h.y;if(t.frameState.useLogDepth){const N=o*d.log2FarDepthFromNearPlusOne,z=Math.pow(2,N)-1;o=y*(1-p/(z+p))/(y-p)}const S=t.view.passState.viewport,P=Cartesian4.clone(Cartesian4.UNIT_W,scratchNDC);P.x=(n.x-S.x)/S.width*2-1,P.y=(n.y-S.y)/S.height*2-1,P.z=o*2-1,P.w=1;let L,F=t.camera.frustum;if(defined(F.fovy)){L=Matrix4.multiplyByVector(d.inverseViewProjection,P,scratchWorldCoords);const N=1/L.w;Cartesian3.multiplyByScalar(L,N,L)}else{const N=F.offCenterFrustum;defined(N)&&(F=N),L=scratchWorldCoords,L.x=(P.x*(F.right-F.left)+F.left+F.right)*.5,L.y=(P.y*(F.top-F.bottom)+F.bottom+F.top)*.5,L.z=(P.z*(p-y)-p-y)*.5,L.w=1,L=Matrix4.multiplyByVector(d.inverseView,L,L)}return Cartesian3.fromCartesian4(L,s)};const LabelStyle={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},LabelStyle$1=Object.freeze(LabelStyle),Cesium3DTilePass={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},passOptions=new Array(Cesium3DTilePass.NUMBER_OF_PASSES);passOptions[Cesium3DTilePass.RENDER]=Object.freeze({pass:Cesium3DTilePass.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PICK]=Object.freeze({pass:Cesium3DTilePass.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1}),passOptions[Cesium3DTilePass.SHADOW]=Object.freeze({pass:Cesium3DTilePass.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1}),passOptions[Cesium3DTilePass.PRELOAD]=Object.freeze({pass:Cesium3DTilePass.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.PRELOAD_FLIGHT]=Object.freeze({pass:Cesium3DTilePass.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Cesium3DTilePass.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Cesium3DTilePass.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0}),passOptions[Cesium3DTilePass.MOST_DETAILED_PICK]=Object.freeze({pass:Cesium3DTilePass.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1}),Cesium3DTilePass.getPassOptions=function(t){return passOptions[t]};const Cesium3DTilePass$1=Object.freeze(Cesium3DTilePass),defaultColor=Color$1.WHITE,defaultGapColor=Color$1.TRANSPARENT,defaultDashLength=16,defaultDashPattern=255;function PolylineDashMaterialProperty(t){t=defaultValue(t,defaultValue.EMPTY_OBJECT),this._definitionChanged=new Event$1,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=t.color,this.gapColor=t.gapColor,this.dashLength=t.dashLength,this.dashPattern=t.dashPattern}Object.defineProperties(PolylineDashMaterialProperty.prototype,{isConstant:{get:function(){return Property.isConstant(this._color)&&Property.isConstant(this._gapColor)&&Property.isConstant(this._dashLength)&&Property.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:createPropertyDescriptor("color"),gapColor:createPropertyDescriptor("gapColor"),dashLength:createPropertyDescriptor("dashLength"),dashPattern:createPropertyDescriptor("dashPattern")}),PolylineDashMaterialProperty.prototype.getType=function(t){return"PolylineDash"},PolylineDashMaterialProperty.prototype.getValue=function(t,n){return defined(n)||(n={}),n.color=Property.getValueOrClonedDefault(this._color,t,defaultColor,n.color),n.gapColor=Property.getValueOrClonedDefault(this._gapColor,t,defaultGapColor,n.gapColor),n.dashLength=Property.getValueOrDefault(this._dashLength,t,defaultDashLength,n.dashLength),n.dashPattern=Property.getValueOrDefault(this._dashPattern,t,defaultDashPattern,n.dashPattern),n},PolylineDashMaterialProperty.prototype.equals=function(t){return this===t||t instanceof PolylineDashMaterialProperty&&Property.equals(this._color,t._color)&&Property.equals(this._gapColor,t._gapColor)&&Property.equals(this._dashLength,t._dashLength)&&Property.equals(this._dashPattern,t._dashPattern)};function DiscardEmptyTileImagePolicy(t){}DiscardEmptyTileImagePolicy.prototype.isReady=function(){return!0},DiscardEmptyTileImagePolicy.prototype.shouldDiscardImage=function(t){return DiscardEmptyTileImagePolicy.EMPTY_IMAGE===t};let emptyImage;Object.defineProperties(DiscardEmptyTileImagePolicy,{EMPTY_IMAGE:{get:function(){return defined(emptyImage)||(emptyImage=new Image,emptyImage.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),emptyImage}}});function Cesium3DTilePassState(t){Check.typeOf.object("options",t),Check.typeOf.number("options.pass",t.pass),this.pass=t.pass,this.commandList=t.commandList,this.camera=t.camera,this.cullingVolume=t.cullingVolume,this.ready=!1}var __create=Object.create,__defProp$1=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__getProtoOf=Object.getPrototypeOf,__hasOwnProp$1=Object.prototype.hasOwnProperty,__markAsModule=t=>__defProp$1(t,"__esModule",{value:!0}),__commonJS=(t,n)=>function(){return n||(0,t[Object.keys(t)[0]])((n={exports:{}}).exports,n),n.exports},__reExport=(t,n,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let s of __getOwnPropNames(n))!__hasOwnProp$1.call(t,s)&&s!=="default"&&__defProp$1(t,s,{get:()=>n[s],enumerable:!(o=__getOwnPropDesc(n,s))||o.enumerable});return t},__toModule=t=>__reExport(__markAsModule(__defProp$1(t!=null?__create(__getProtoOf(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t),__async=(t,n,o)=>new Promise((s,c)=>{var d=y=>{try{p(o.next(y))}catch(S){c(S)}},h=y=>{try{p(o.throw(y))}catch(S){c(S)}},p=y=>y.done?s(y.value):Promise.resolve(y.value).then(d,h);p((o=o.apply(t,n)).next())}),require_point_geometry=__commonJS({"node_modules/@mapbox/point-geometry/index.js"(t,n){n.exports=o;function o(s,c){this.x=s,this.y=c}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(s){return this.clone()._add(s)},sub:function(s){return this.clone()._sub(s)},multByPoint:function(s){return this.clone()._multByPoint(s)},divByPoint:function(s){return this.clone()._divByPoint(s)},mult:function(s){return this.clone()._mult(s)},div:function(s){return this.clone()._div(s)},rotate:function(s){return this.clone()._rotate(s)},rotateAround:function(s,c){return this.clone()._rotateAround(s,c)},matMult:function(s){return this.clone()._matMult(s)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(s){return this.x===s.x&&this.y===s.y},dist:function(s){return Math.sqrt(this.distSqr(s))},distSqr:function(s){var c=s.x-this.x,d=s.y-this.y;return c*c+d*d},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(s){return Math.atan2(this.y-s.y,this.x-s.x)},angleWith:function(s){return this.angleWithSep(s.x,s.y)},angleWithSep:function(s,c){return Math.atan2(this.x*c-this.y*s,this.x*s+this.y*c)},_matMult:function(s){var c=s[0]*this.x+s[1]*this.y,d=s[2]*this.x+s[3]*this.y;return this.x=c,this.y=d,this},_add:function(s){return this.x+=s.x,this.y+=s.y,this},_sub:function(s){return this.x-=s.x,this.y-=s.y,this},_mult:function(s){return this.x*=s,this.y*=s,this},_div:function(s){return this.x/=s,this.y/=s,this},_multByPoint:function(s){return this.x*=s.x,this.y*=s.y,this},_divByPoint:function(s){return this.x/=s.x,this.y/=s.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var s=this.y;return this.y=this.x,this.x=-s,this},_rotate:function(s){var c=Math.cos(s),d=Math.sin(s),h=c*this.x-d*this.y,p=d*this.x+c*this.y;return this.x=h,this.y=p,this},_rotateAround:function(s,c){var d=Math.cos(s),h=Math.sin(s),p=c.x+d*(this.x-c.x)-h*(this.y-c.y),y=c.y+h*(this.x-c.x)+d*(this.y-c.y);return this.x=p,this.y=y,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(s){return s instanceof o?s:Array.isArray(s)?new o(s[0],s[1]):s}}}),require_vectortilefeature=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortilefeature.js"(t,n){var o=require_point_geometry();n.exports=s;function s(y,S,P,L,F){this.properties={},this.extent=P,this.type=0,this._pbf=y,this._geometry=-1,this._keys=L,this._values=F,y.readFields(c,this,S)}function c(y,S,P){y==1?S.id=P.readVarint():y==2?d(P,S):y==3?S.type=P.readVarint():y==4&&(S._geometry=P.pos)}function d(y,S){for(var P=y.readVarint()+y.pos;y.pos<P;){var L=S._keys[y.readVarint()],F=S._values[y.readVarint()];S.properties[L]=F}}s.types=["Unknown","Point","LineString","Polygon"],s.prototype.loadGeometry=function(){var y=this._pbf;y.pos=this._geometry;for(var S=y.readVarint()+y.pos,P=1,L=0,F=0,N=0,z=[],W;y.pos<S;){if(L<=0){var nt=y.readVarint();P=nt&7,L=nt>>3}if(L--,P===1||P===2)F+=y.readSVarint(),N+=y.readSVarint(),P===1&&(W&&z.push(W),W=[]),W.push(new o(F,N));else if(P===7)W&&W.push(W[0].clone());else throw new Error("unknown command "+P)}return W&&z.push(W),z},s.prototype.bbox=function(){var y=this._pbf;y.pos=this._geometry;for(var S=y.readVarint()+y.pos,P=1,L=0,F=0,N=0,z=1/0,W=-1/0,nt=1/0,Pe=-1/0;y.pos<S;){if(L<=0){var se=y.readVarint();P=se&7,L=se>>3}if(L--,P===1||P===2)F+=y.readSVarint(),N+=y.readSVarint(),F<z&&(z=F),F>W&&(W=F),N<nt&&(nt=N),N>Pe&&(Pe=N);else if(P!==7)throw new Error("unknown command "+P)}return[z,nt,W,Pe]},s.prototype.toGeoJSON=function(y,S,P){var L=this.extent*Math.pow(2,P),F=this.extent*y,N=this.extent*S,z=this.loadGeometry(),W=s.types[this.type],nt,Pe;function se(mn){for(var _i=0;_i<mn.length;_i++){var zi=mn[_i],Sa=180-(zi.y+N)*360/L;mn[_i]=[(zi.x+F)*360/L-180,360/Math.PI*Math.atan(Math.exp(Sa*Math.PI/180))-90]}}switch(this.type){case 1:var mt=[];for(nt=0;nt<z.length;nt++)mt[nt]=z[nt][0];z=mt,se(z);break;case 2:for(nt=0;nt<z.length;nt++)se(z[nt]);break;case 3:for(z=h(z),nt=0;nt<z.length;nt++)for(Pe=0;Pe<z[nt].length;Pe++)se(z[nt][Pe]);break}z.length===1?z=z[0]:W="Multi"+W;var kt={type:"Feature",geometry:{type:W,coordinates:z},properties:this.properties};return"id"in this&&(kt.id=this.id),kt};function h(y){var S=y.length;if(S<=1)return[y];for(var P=[],L,F,N=0;N<S;N++){var z=p(y[N]);z!==0&&(F===void 0&&(F=z<0),F===z<0?(L&&P.push(L),L=[y[N]]):L.push(y[N]))}return L&&P.push(L),P}function p(y){for(var S=0,P=0,L=y.length,F=L-1,N,z;P<L;F=P++)N=y[P],z=y[F],S+=(z.x-N.x)*(N.y+z.y);return S}}}),require_vectortilelayer=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortilelayer.js"(t,n){var o=require_vectortilefeature();n.exports=s;function s(h,p){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=h,this._keys=[],this._values=[],this._features=[],h.readFields(c,this,p),this.length=this._features.length}function c(h,p,y){h===15?p.version=y.readVarint():h===1?p.name=y.readString():h===5?p.extent=y.readVarint():h===2?p._features.push(y.pos):h===3?p._keys.push(y.readString()):h===4&&p._values.push(d(y))}function d(h){for(var p=null,y=h.readVarint()+h.pos;h.pos<y;){var S=h.readVarint()>>3;p=S===1?h.readString():S===2?h.readFloat():S===3?h.readDouble():S===4?h.readVarint64():S===5?h.readVarint():S===6?h.readSVarint():S===7?h.readBoolean():null}return p}s.prototype.feature=function(h){if(h<0||h>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[h];var p=this._pbf.readVarint()+this._pbf.pos;return new o(this._pbf,p,this.extent,this._keys,this._values)}}}),require_vectortile=__commonJS({"node_modules/@mapbox/vector-tile/lib/vectortile.js"(t,n){var o=require_vectortilelayer();n.exports=s;function s(d,h){this.layers=d.readFields(c,{},h)}function c(d,h,p){if(d===3){var y=new o(p,p.readVarint()+p.pos);y.length&&(h[y.name]=y)}}}}),require_vector_tile=__commonJS({"node_modules/@mapbox/vector-tile/index.js"(t,n){n.exports.VectorTile=require_vectortile(),n.exports.VectorTileFeature=require_vectortilefeature(),n.exports.VectorTileLayer=require_vectortilelayer()}}),require_ieee754=__commonJS({"node_modules/ieee754/index.js"(t){t.read=function(n,o,s,c,d){var h,p,y=d*8-c-1,S=(1<<y)-1,P=S>>1,L=-7,F=s?d-1:0,N=s?-1:1,z=n[o+F];for(F+=N,h=z&(1<<-L)-1,z>>=-L,L+=y;L>0;h=h*256+n[o+F],F+=N,L-=8);for(p=h&(1<<-L)-1,h>>=-L,L+=c;L>0;p=p*256+n[o+F],F+=N,L-=8);if(h===0)h=1-P;else{if(h===S)return p?NaN:(z?-1:1)*(1/0);p=p+Math.pow(2,c),h=h-P}return(z?-1:1)*p*Math.pow(2,h-c)},t.write=function(n,o,s,c,d,h){var p,y,S,P=h*8-d-1,L=(1<<P)-1,F=L>>1,N=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=c?0:h-1,W=c?1:-1,nt=o<0||o===0&&1/o<0?1:0;for(o=Math.abs(o),isNaN(o)||o===1/0?(y=isNaN(o)?1:0,p=L):(p=Math.floor(Math.log(o)/Math.LN2),o*(S=Math.pow(2,-p))<1&&(p--,S*=2),p+F>=1?o+=N/S:o+=N*Math.pow(2,1-F),o*S>=2&&(p++,S/=2),p+F>=L?(y=0,p=L):p+F>=1?(y=(o*S-1)*Math.pow(2,d),p=p+F):(y=o*Math.pow(2,F-1)*Math.pow(2,d),p=0));d>=8;n[s+z]=y&255,z+=W,y/=256,d-=8);for(p=p<<d|y,P+=d;P>0;n[s+z]=p&255,z+=W,p/=256,P-=8);n[s+z-W]|=nt*128}}}),require_pbf=__commonJS({"node_modules/pbf/index.js"(t,n){n.exports=s;var o=require_ieee754();function s(lt){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(lt)?lt:new Uint8Array(lt||0),this.pos=0,this.type=0,this.length=this.buf.length}s.Varint=0,s.Fixed64=1,s.Bytes=2,s.Fixed32=5;var c=65536*65536,d=1/c,h=12,p=typeof TextDecoder>"u"?null:new TextDecoder("utf8");s.prototype={destroy:function(){this.buf=null},readFields:function(lt,pi,ba){for(ba=ba||this.length;this.pos<ba;){var Sc=this.readVarint(),ms=Sc>>3,Xs=this.pos;this.type=Sc&7,lt(ms,pi,this),this.pos===Xs&&this.skip(Sc)}return pi},readMessage:function(lt,pi){return this.readFields(lt,pi,this.readVarint()+this.pos)},readFixed32:function(){var lt=Sa(this.buf,this.pos);return this.pos+=4,lt},readSFixed32:function(){var lt=La(this.buf,this.pos);return this.pos+=4,lt},readFixed64:function(){var lt=Sa(this.buf,this.pos)+Sa(this.buf,this.pos+4)*c;return this.pos+=8,lt},readSFixed64:function(){var lt=Sa(this.buf,this.pos)+La(this.buf,this.pos+4)*c;return this.pos+=8,lt},readFloat:function(){var lt=o.read(this.buf,this.pos,!0,23,4);return this.pos+=4,lt},readDouble:function(){var lt=o.read(this.buf,this.pos,!0,52,8);return this.pos+=8,lt},readVarint:function(lt){var pi=this.buf,ba,Sc;return Sc=pi[this.pos++],ba=Sc&127,Sc<128||(Sc=pi[this.pos++],ba|=(Sc&127)<<7,Sc<128)||(Sc=pi[this.pos++],ba|=(Sc&127)<<14,Sc<128)||(Sc=pi[this.pos++],ba|=(Sc&127)<<21,Sc<128)?ba:(Sc=pi[this.pos],ba|=(Sc&15)<<28,y(ba,lt,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var lt=this.readVarint();return lt%2===1?(lt+1)/-2:lt/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var lt=this.readVarint()+this.pos,pi=this.pos;return this.pos=lt,lt-pi>=h&&p?ma(this.buf,pi,lt):Ra(this.buf,pi,lt)},readBytes:function(){var lt=this.readVarint()+this.pos,pi=this.buf.subarray(this.pos,lt);return this.pos=lt,pi},readPackedVarint:function(lt,pi){if(this.type!==s.Bytes)return lt.push(this.readVarint(pi));var ba=S(this);for(lt=lt||[];this.pos<ba;)lt.push(this.readVarint(pi));return lt},readPackedSVarint:function(lt){if(this.type!==s.Bytes)return lt.push(this.readSVarint());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readSVarint());return lt},readPackedBoolean:function(lt){if(this.type!==s.Bytes)return lt.push(this.readBoolean());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readBoolean());return lt},readPackedFloat:function(lt){if(this.type!==s.Bytes)return lt.push(this.readFloat());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readFloat());return lt},readPackedDouble:function(lt){if(this.type!==s.Bytes)return lt.push(this.readDouble());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readDouble());return lt},readPackedFixed32:function(lt){if(this.type!==s.Bytes)return lt.push(this.readFixed32());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readFixed32());return lt},readPackedSFixed32:function(lt){if(this.type!==s.Bytes)return lt.push(this.readSFixed32());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readSFixed32());return lt},readPackedFixed64:function(lt){if(this.type!==s.Bytes)return lt.push(this.readFixed64());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readFixed64());return lt},readPackedSFixed64:function(lt){if(this.type!==s.Bytes)return lt.push(this.readSFixed64());var pi=S(this);for(lt=lt||[];this.pos<pi;)lt.push(this.readSFixed64());return lt},skip:function(lt){var pi=lt&7;if(pi===s.Varint)for(;this.buf[this.pos++]>127;);else if(pi===s.Bytes)this.pos=this.readVarint()+this.pos;else if(pi===s.Fixed32)this.pos+=4;else if(pi===s.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+pi)},writeTag:function(lt,pi){this.writeVarint(lt<<3|pi)},realloc:function(lt){for(var pi=this.length||16;pi<this.pos+lt;)pi*=2;if(pi!==this.length){var ba=new Uint8Array(pi);ba.set(this.buf),this.buf=ba,this.length=pi}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(lt){this.realloc(4),fa(this.buf,lt,this.pos),this.pos+=4},writeSFixed32:function(lt){this.realloc(4),fa(this.buf,lt,this.pos),this.pos+=4},writeFixed64:function(lt){this.realloc(8),fa(this.buf,lt&-1,this.pos),fa(this.buf,Math.floor(lt*d),this.pos+4),this.pos+=8},writeSFixed64:function(lt){this.realloc(8),fa(this.buf,lt&-1,this.pos),fa(this.buf,Math.floor(lt*d),this.pos+4),this.pos+=8},writeVarint:function(lt){if(lt=+lt||0,lt>268435455||lt<0){L(lt,this);return}this.realloc(4),this.buf[this.pos++]=lt&127|(lt>127?128:0),!(lt<=127)&&(this.buf[this.pos++]=(lt>>>=7)&127|(lt>127?128:0),!(lt<=127)&&(this.buf[this.pos++]=(lt>>>=7)&127|(lt>127?128:0),!(lt<=127)&&(this.buf[this.pos++]=lt>>>7&127)))},writeSVarint:function(lt){this.writeVarint(lt<0?-lt*2-1:lt*2)},writeBoolean:function(lt){this.writeVarint(!!lt)},writeString:function(lt){lt=String(lt),this.realloc(lt.length*4),this.pos++;var pi=this.pos;this.pos=yt(this.buf,lt,this.pos);var ba=this.pos-pi;ba>=128&&z(pi,ba,this),this.pos=pi-1,this.writeVarint(ba),this.pos+=ba},writeFloat:function(lt){this.realloc(4),o.write(this.buf,lt,this.pos,!0,23,4),this.pos+=4},writeDouble:function(lt){this.realloc(8),o.write(this.buf,lt,this.pos,!0,52,8),this.pos+=8},writeBytes:function(lt){var pi=lt.length;this.writeVarint(pi),this.realloc(pi);for(var ba=0;ba<pi;ba++)this.buf[this.pos++]=lt[ba]},writeRawMessage:function(lt,pi){this.pos++;var ba=this.pos;lt(pi,this);var Sc=this.pos-ba;Sc>=128&&z(ba,Sc,this),this.pos=ba-1,this.writeVarint(Sc),this.pos+=Sc},writeMessage:function(lt,pi,ba){this.writeTag(lt,s.Bytes),this.writeRawMessage(pi,ba)},writePackedVarint:function(lt,pi){pi.length&&this.writeMessage(lt,W,pi)},writePackedSVarint:function(lt,pi){pi.length&&this.writeMessage(lt,nt,pi)},writePackedBoolean:function(lt,pi){pi.length&&this.writeMessage(lt,mt,pi)},writePackedFloat:function(lt,pi){pi.length&&this.writeMessage(lt,Pe,pi)},writePackedDouble:function(lt,pi){pi.length&&this.writeMessage(lt,se,pi)},writePackedFixed32:function(lt,pi){pi.length&&this.writeMessage(lt,kt,pi)},writePackedSFixed32:function(lt,pi){pi.length&&this.writeMessage(lt,mn,pi)},writePackedFixed64:function(lt,pi){pi.length&&this.writeMessage(lt,_i,pi)},writePackedSFixed64:function(lt,pi){pi.length&&this.writeMessage(lt,zi,pi)},writeBytesField:function(lt,pi){this.writeTag(lt,s.Bytes),this.writeBytes(pi)},writeFixed32Field:function(lt,pi){this.writeTag(lt,s.Fixed32),this.writeFixed32(pi)},writeSFixed32Field:function(lt,pi){this.writeTag(lt,s.Fixed32),this.writeSFixed32(pi)},writeFixed64Field:function(lt,pi){this.writeTag(lt,s.Fixed64),this.writeFixed64(pi)},writeSFixed64Field:function(lt,pi){this.writeTag(lt,s.Fixed64),this.writeSFixed64(pi)},writeVarintField:function(lt,pi){this.writeTag(lt,s.Varint),this.writeVarint(pi)},writeSVarintField:function(lt,pi){this.writeTag(lt,s.Varint),this.writeSVarint(pi)},writeStringField:function(lt,pi){this.writeTag(lt,s.Bytes),this.writeString(pi)},writeFloatField:function(lt,pi){this.writeTag(lt,s.Fixed32),this.writeFloat(pi)},writeDoubleField:function(lt,pi){this.writeTag(lt,s.Fixed64),this.writeDouble(pi)},writeBooleanField:function(lt,pi){this.writeVarintField(lt,!!pi)}};function y(lt,pi,ba){var Sc=ba.buf,ms,Xs;if(Xs=Sc[ba.pos++],ms=(Xs&112)>>4,Xs<128||(Xs=Sc[ba.pos++],ms|=(Xs&127)<<3,Xs<128)||(Xs=Sc[ba.pos++],ms|=(Xs&127)<<10,Xs<128)||(Xs=Sc[ba.pos++],ms|=(Xs&127)<<17,Xs<128)||(Xs=Sc[ba.pos++],ms|=(Xs&127)<<24,Xs<128)||(Xs=Sc[ba.pos++],ms|=(Xs&1)<<31,Xs<128))return P(lt,ms,pi);throw new Error("Expected varint not more than 10 bytes")}function S(lt){return lt.type===s.Bytes?lt.readVarint()+lt.pos:lt.pos+1}function P(lt,pi,ba){return ba?pi*4294967296+(lt>>>0):(pi>>>0)*4294967296+(lt>>>0)}function L(lt,pi){var ba,Sc;if(lt>=0?(ba=lt%4294967296|0,Sc=lt/4294967296|0):(ba=~(-lt%4294967296),Sc=~(-lt/4294967296),ba^4294967295?ba=ba+1|0:(ba=0,Sc=Sc+1|0)),lt>=18446744073709552e3||lt<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");pi.realloc(10),F(ba,Sc,pi),N(Sc,pi)}function F(lt,pi,ba){ba.buf[ba.pos++]=lt&127|128,lt>>>=7,ba.buf[ba.pos++]=lt&127|128,lt>>>=7,ba.buf[ba.pos++]=lt&127|128,lt>>>=7,ba.buf[ba.pos++]=lt&127|128,lt>>>=7,ba.buf[ba.pos]=lt&127}function N(lt,pi){var ba=(lt&7)<<4;pi.buf[pi.pos++]|=ba|((lt>>>=3)?128:0),lt&&(pi.buf[pi.pos++]=lt&127|((lt>>>=7)?128:0),lt&&(pi.buf[pi.pos++]=lt&127|((lt>>>=7)?128:0),lt&&(pi.buf[pi.pos++]=lt&127|((lt>>>=7)?128:0),lt&&(pi.buf[pi.pos++]=lt&127|((lt>>>=7)?128:0),lt&&(pi.buf[pi.pos++]=lt&127)))))}function z(lt,pi,ba){var Sc=pi<=16383?1:pi<=2097151?2:pi<=268435455?3:Math.floor(Math.log(pi)/(Math.LN2*7));ba.realloc(Sc);for(var ms=ba.pos-1;ms>=lt;ms--)ba.buf[ms+Sc]=ba.buf[ms]}function W(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeVarint(lt[ba])}function nt(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeSVarint(lt[ba])}function Pe(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeFloat(lt[ba])}function se(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeDouble(lt[ba])}function mt(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeBoolean(lt[ba])}function kt(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeFixed32(lt[ba])}function mn(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeSFixed32(lt[ba])}function _i(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeFixed64(lt[ba])}function zi(lt,pi){for(var ba=0;ba<lt.length;ba++)pi.writeSFixed64(lt[ba])}function Sa(lt,pi){return(lt[pi]|lt[pi+1]<<8|lt[pi+2]<<16)+lt[pi+3]*16777216}function fa(lt,pi,ba){lt[ba]=pi,lt[ba+1]=pi>>>8,lt[ba+2]=pi>>>16,lt[ba+3]=pi>>>24}function La(lt,pi){return(lt[pi]|lt[pi+1]<<8|lt[pi+2]<<16)+(lt[pi+3]<<24)}function Ra(lt,pi,ba){for(var Sc="",ms=pi;ms<ba;){var Xs=lt[ms],Nl=null,pu=Xs>239?4:Xs>223?3:Xs>191?2:1;if(ms+pu>ba)break;var yu,Ru,Vd;pu===1?Xs<128&&(Nl=Xs):pu===2?(yu=lt[ms+1],(yu&192)===128&&(Nl=(Xs&31)<<6|yu&63,Nl<=127&&(Nl=null))):pu===3?(yu=lt[ms+1],Ru=lt[ms+2],(yu&192)===128&&(Ru&192)===128&&(Nl=(Xs&15)<<12|(yu&63)<<6|Ru&63,(Nl<=2047||Nl>=55296&&Nl<=57343)&&(Nl=null))):pu===4&&(yu=lt[ms+1],Ru=lt[ms+2],Vd=lt[ms+3],(yu&192)===128&&(Ru&192)===128&&(Vd&192)===128&&(Nl=(Xs&15)<<18|(yu&63)<<12|(Ru&63)<<6|Vd&63,(Nl<=65535||Nl>=1114112)&&(Nl=null))),Nl===null?(Nl=65533,pu=1):Nl>65535&&(Nl-=65536,Sc+=String.fromCharCode(Nl>>>10&1023|55296),Nl=56320|Nl&1023),Sc+=String.fromCharCode(Nl),ms+=pu}return Sc}function ma(lt,pi,ba){return p.decode(lt.subarray(pi,ba))}function yt(lt,pi,ba){for(var Sc=0,ms,Xs;Sc<pi.length;Sc++){if(ms=pi.charCodeAt(Sc),ms>55295&&ms<57344)if(Xs)if(ms<56320){lt[ba++]=239,lt[ba++]=191,lt[ba++]=189,Xs=ms;continue}else ms=Xs-55296<<10|ms-56320|65536,Xs=null;else{ms>56319||Sc+1===pi.length?(lt[ba++]=239,lt[ba++]=191,lt[ba++]=189):Xs=ms;continue}else Xs&&(lt[ba++]=239,lt[ba++]=191,lt[ba++]=189,Xs=null);ms<128?lt[ba++]=ms:(ms<2048?lt[ba++]=ms>>6|192:(ms<65536?lt[ba++]=ms>>12|224:(lt[ba++]=ms>>18|240,lt[ba++]=ms>>12&63|128),lt[ba++]=ms>>6&63|128),lt[ba++]=ms&63|128)}return ba}}}),require_rbush_min=__commonJS({"node_modules/rbush/rbush.min.js"(t,n){(function(o,s){typeof t=="object"&&typeof n<"u"?n.exports=s():typeof define=="function"&&define.amd?define(s):(o=o||self).RBush=s()})(t,function(){function o(se,mt,kt,mn,_i){(function zi(Sa,fa,La,Ra,ma){for(;Ra>La;){if(Ra-La>600){var yt=Ra-La+1,lt=fa-La+1,pi=Math.log(yt),ba=.5*Math.exp(2*pi/3),Sc=.5*Math.sqrt(pi*ba*(yt-ba)/yt)*(lt-yt/2<0?-1:1),ms=Math.max(La,Math.floor(fa-lt*ba/yt+Sc)),Xs=Math.min(Ra,Math.floor(fa+(yt-lt)*ba/yt+Sc));zi(Sa,fa,ms,Xs,ma)}var Nl=Sa[fa],pu=La,yu=Ra;for(s(Sa,La,fa),ma(Sa[Ra],Nl)>0&&s(Sa,La,Ra);pu<yu;){for(s(Sa,pu,yu),pu++,yu--;ma(Sa[pu],Nl)<0;)pu++;for(;ma(Sa[yu],Nl)>0;)yu--}ma(Sa[La],Nl)===0?s(Sa,La,yu):s(Sa,++yu,Ra),yu<=fa&&(La=yu+1),fa<=yu&&(Ra=yu-1)}})(se,mt,kt||0,mn||se.length-1,_i||c)}function s(se,mt,kt){var mn=se[mt];se[mt]=se[kt],se[kt]=mn}function c(se,mt){return se<mt?-1:se>mt?1:0}var d=function(se){se===void 0&&(se=9),this._maxEntries=Math.max(4,se),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function h(se,mt,kt){if(!kt)return mt.indexOf(se);for(var mn=0;mn<mt.length;mn++)if(kt(se,mt[mn]))return mn;return-1}function p(se,mt){y(se,0,se.children.length,mt,se)}function y(se,mt,kt,mn,_i){_i||(_i=nt(null)),_i.minX=1/0,_i.minY=1/0,_i.maxX=-1/0,_i.maxY=-1/0;for(var zi=mt;zi<kt;zi++){var Sa=se.children[zi];S(_i,se.leaf?mn(Sa):Sa)}return _i}function S(se,mt){return se.minX=Math.min(se.minX,mt.minX),se.minY=Math.min(se.minY,mt.minY),se.maxX=Math.max(se.maxX,mt.maxX),se.maxY=Math.max(se.maxY,mt.maxY),se}function P(se,mt){return se.minX-mt.minX}function L(se,mt){return se.minY-mt.minY}function F(se){return(se.maxX-se.minX)*(se.maxY-se.minY)}function N(se){return se.maxX-se.minX+(se.maxY-se.minY)}function z(se,mt){return se.minX<=mt.minX&&se.minY<=mt.minY&&mt.maxX<=se.maxX&&mt.maxY<=se.maxY}function W(se,mt){return mt.minX<=se.maxX&&mt.minY<=se.maxY&&mt.maxX>=se.minX&&mt.maxY>=se.minY}function nt(se){return{children:se,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Pe(se,mt,kt,mn,_i){for(var zi=[mt,kt];zi.length;)if(!((kt=zi.pop())-(mt=zi.pop())<=mn)){var Sa=mt+Math.ceil((kt-mt)/mn/2)*mn;o(se,Sa,mt,kt,_i),zi.push(mt,Sa,Sa,kt)}}return d.prototype.all=function(){return this._all(this.data,[])},d.prototype.search=function(se){var mt=this.data,kt=[];if(!W(se,mt))return kt;for(var mn=this.toBBox,_i=[];mt;){for(var zi=0;zi<mt.children.length;zi++){var Sa=mt.children[zi],fa=mt.leaf?mn(Sa):Sa;W(se,fa)&&(mt.leaf?kt.push(Sa):z(se,fa)?this._all(Sa,kt):_i.push(Sa))}mt=_i.pop()}return kt},d.prototype.collides=function(se){var mt=this.data;if(!W(se,mt))return!1;for(var kt=[];mt;){for(var mn=0;mn<mt.children.length;mn++){var _i=mt.children[mn],zi=mt.leaf?this.toBBox(_i):_i;if(W(se,zi)){if(mt.leaf||z(se,zi))return!0;kt.push(_i)}}mt=kt.pop()}return!1},d.prototype.load=function(se){if(!se||!se.length)return this;if(se.length<this._minEntries){for(var mt=0;mt<se.length;mt++)this.insert(se[mt]);return this}var kt=this._build(se.slice(),0,se.length-1,0);if(this.data.children.length)if(this.data.height===kt.height)this._splitRoot(this.data,kt);else{if(this.data.height<kt.height){var mn=this.data;this.data=kt,kt=mn}this._insert(kt,this.data.height-kt.height-1,!0)}else this.data=kt;return this},d.prototype.insert=function(se){return se&&this._insert(se,this.data.height-1),this},d.prototype.clear=function(){return this.data=nt([]),this},d.prototype.remove=function(se,mt){if(!se)return this;for(var kt,mn,_i,zi=this.data,Sa=this.toBBox(se),fa=[],La=[];zi||fa.length;){if(zi||(zi=fa.pop(),mn=fa[fa.length-1],kt=La.pop(),_i=!0),zi.leaf){var Ra=h(se,zi.children,mt);if(Ra!==-1)return zi.children.splice(Ra,1),fa.push(zi),this._condense(fa),this}_i||zi.leaf||!z(zi,Sa)?mn?(kt++,zi=mn.children[kt],_i=!1):zi=null:(fa.push(zi),La.push(kt),kt=0,mn=zi,zi=zi.children[0])}return this},d.prototype.toBBox=function(se){return se},d.prototype.compareMinX=function(se,mt){return se.minX-mt.minX},d.prototype.compareMinY=function(se,mt){return se.minY-mt.minY},d.prototype.toJSON=function(){return this.data},d.prototype.fromJSON=function(se){return this.data=se,this},d.prototype._all=function(se,mt){for(var kt=[];se;)se.leaf?mt.push.apply(mt,se.children):kt.push.apply(kt,se.children),se=kt.pop();return mt},d.prototype._build=function(se,mt,kt,mn){var _i,zi=kt-mt+1,Sa=this._maxEntries;if(zi<=Sa)return p(_i=nt(se.slice(mt,kt+1)),this.toBBox),_i;mn||(mn=Math.ceil(Math.log(zi)/Math.log(Sa)),Sa=Math.ceil(zi/Math.pow(Sa,mn-1))),(_i=nt([])).leaf=!1,_i.height=mn;var fa=Math.ceil(zi/Sa),La=fa*Math.ceil(Math.sqrt(Sa));Pe(se,mt,kt,La,this.compareMinX);for(var Ra=mt;Ra<=kt;Ra+=La){var ma=Math.min(Ra+La-1,kt);Pe(se,Ra,ma,fa,this.compareMinY);for(var yt=Ra;yt<=ma;yt+=fa){var lt=Math.min(yt+fa-1,ma);_i.children.push(this._build(se,yt,lt,mn-1))}}return p(_i,this.toBBox),_i},d.prototype._chooseSubtree=function(se,mt,kt,mn){for(;mn.push(mt),!mt.leaf&&mn.length-1!==kt;){for(var _i=1/0,zi=1/0,Sa=void 0,fa=0;fa<mt.children.length;fa++){var La=mt.children[fa],Ra=F(La),ma=(yt=se,lt=La,(Math.max(lt.maxX,yt.maxX)-Math.min(lt.minX,yt.minX))*(Math.max(lt.maxY,yt.maxY)-Math.min(lt.minY,yt.minY))-Ra);ma<zi?(zi=ma,_i=Ra<_i?Ra:_i,Sa=La):ma===zi&&Ra<_i&&(_i=Ra,Sa=La)}mt=Sa||mt.children[0]}var yt,lt;return mt},d.prototype._insert=function(se,mt,kt){var mn=kt?se:this.toBBox(se),_i=[],zi=this._chooseSubtree(mn,this.data,mt,_i);for(zi.children.push(se),S(zi,mn);mt>=0&&_i[mt].children.length>this._maxEntries;)this._split(_i,mt),mt--;this._adjustParentBBoxes(mn,_i,mt)},d.prototype._split=function(se,mt){var kt=se[mt],mn=kt.children.length,_i=this._minEntries;this._chooseSplitAxis(kt,_i,mn);var zi=this._chooseSplitIndex(kt,_i,mn),Sa=nt(kt.children.splice(zi,kt.children.length-zi));Sa.height=kt.height,Sa.leaf=kt.leaf,p(kt,this.toBBox),p(Sa,this.toBBox),mt?se[mt-1].children.push(Sa):this._splitRoot(kt,Sa)},d.prototype._splitRoot=function(se,mt){this.data=nt([se,mt]),this.data.height=se.height+1,this.data.leaf=!1,p(this.data,this.toBBox)},d.prototype._chooseSplitIndex=function(se,mt,kt){for(var mn,_i,zi,Sa,fa,La,Ra,ma=1/0,yt=1/0,lt=mt;lt<=kt-mt;lt++){var pi=y(se,0,lt,this.toBBox),ba=y(se,lt,kt,this.toBBox),Sc=(_i=pi,zi=ba,Sa=void 0,fa=void 0,La=void 0,Ra=void 0,Sa=Math.max(_i.minX,zi.minX),fa=Math.max(_i.minY,zi.minY),La=Math.min(_i.maxX,zi.maxX),Ra=Math.min(_i.maxY,zi.maxY),Math.max(0,La-Sa)*Math.max(0,Ra-fa)),ms=F(pi)+F(ba);Sc<ma?(ma=Sc,mn=lt,yt=ms<yt?ms:yt):Sc===ma&&ms<yt&&(yt=ms,mn=lt)}return mn||kt-mt},d.prototype._chooseSplitAxis=function(se,mt,kt){var mn=se.leaf?this.compareMinX:P,_i=se.leaf?this.compareMinY:L;this._allDistMargin(se,mt,kt,mn)<this._allDistMargin(se,mt,kt,_i)&&se.children.sort(mn)},d.prototype._allDistMargin=function(se,mt,kt,mn){se.children.sort(mn);for(var _i=this.toBBox,zi=y(se,0,mt,_i),Sa=y(se,kt-mt,kt,_i),fa=N(zi)+N(Sa),La=mt;La<kt-mt;La++){var Ra=se.children[La];S(zi,se.leaf?_i(Ra):Ra),fa+=N(zi)}for(var ma=kt-mt-1;ma>=mt;ma--){var yt=se.children[ma];S(Sa,se.leaf?_i(yt):yt),fa+=N(Sa)}return fa},d.prototype._adjustParentBBoxes=function(se,mt,kt){for(var mn=kt;mn>=0;mn--)S(mt[mn],se)},d.prototype._condense=function(se){for(var mt=se.length-1,kt=void 0;mt>=0;mt--)se[mt].children.length===0?mt>0?(kt=se[mt-1].children).splice(kt.indexOf(se[mt]),1):this.clear():p(se[mt],this.toBBox)},d})}}),require_unitbezier_d=__commonJS({"src/types/unitbezier.d.ts"(){}}),require_tinyqueue=__commonJS({"node_modules/tinyqueue/tinyqueue.js"(t,n){(function(o,s){typeof t=="object"&&typeof n<"u"?n.exports=s():typeof define=="function"&&define.amd?define(s):(o=o||self,o.TinyQueue=s())})(t,function(){var o=function(d,h){if(d===void 0&&(d=[]),h===void 0&&(h=s),this.data=d,this.length=this.data.length,this.compare=h,this.length>0)for(var p=(this.length>>1)-1;p>=0;p--)this._down(p)};o.prototype.push=function(d){this.data.push(d),this.length++,this._up(this.length-1)},o.prototype.pop=function(){if(this.length!==0){var d=this.data[0],h=this.data.pop();return this.length--,this.length>0&&(this.data[0]=h,this._down(0)),d}},o.prototype.peek=function(){return this.data[0]},o.prototype._up=function(d){for(var h=this,p=h.data,y=h.compare,S=p[d];d>0;){var P=d-1>>1,L=p[P];if(y(S,L)>=0)break;p[d]=L,d=P}p[d]=S},o.prototype._down=function(d){for(var h=this,p=h.data,y=h.compare,S=this.length>>1,P=p[d];d<S;){var L=(d<<1)+1,F=p[L],N=L+1;if(N<this.length&&y(p[N],F)<0&&(L=N,F=p[N]),y(F,P)>=0)break;p[d]=F,d=L}p[d]=P};function s(c,d){return c<d?-1:c>d?1:0}return o})}}),require_polylabel=__commonJS({"node_modules/polylabel/polylabel.js"(t,n){var o=require_tinyqueue();o.default&&(o=o.default),n.exports=s,n.exports.default=s;function s(S,P,L){P=P||1;for(var F,N,z,W,nt=0;nt<S[0].length;nt++){var Pe=S[0][nt];(!nt||Pe[0]<F)&&(F=Pe[0]),(!nt||Pe[1]<N)&&(N=Pe[1]),(!nt||Pe[0]>z)&&(z=Pe[0]),(!nt||Pe[1]>W)&&(W=Pe[1])}var se=z-F,mt=W-N,kt=Math.min(se,mt),mn=kt/2;if(kt===0){var _i=[F,N];return _i.distance=0,_i}for(var zi=new o(void 0,c),Sa=F;Sa<z;Sa+=kt)for(var fa=N;fa<W;fa+=kt)zi.push(new d(Sa+mn,fa+mn,mn,S));var La=p(S),Ra=new d(F+se/2,N+mt/2,0,S);Ra.d>La.d&&(La=Ra);for(var ma=zi.length;zi.length;){var yt=zi.pop();yt.d>La.d&&(La=yt,L&&console.log("found best %d after %d probes",Math.round(1e4*yt.d)/1e4,ma)),!(yt.max-La.d<=P)&&(mn=yt.h/2,zi.push(new d(yt.x-mn,yt.y-mn,mn,S)),zi.push(new d(yt.x+mn,yt.y-mn,mn,S)),zi.push(new d(yt.x-mn,yt.y+mn,mn,S)),zi.push(new d(yt.x+mn,yt.y+mn,mn,S)),ma+=4)}L&&(console.log("num probes: "+ma),console.log("best distance: "+La.d));var lt=[La.x,La.y];return lt.distance=La.d,lt}function c(S,P){return P.max-S.max}function d(S,P,L,F){this.x=S,this.y=P,this.h=L,this.d=h(S,P,F),this.max=this.d+this.h*Math.SQRT2}function h(S,P,L){for(var F=!1,N=1/0,z=0;z<L.length;z++)for(var W=L[z],nt=0,Pe=W.length,se=Pe-1;nt<Pe;se=nt++){var mt=W[nt],kt=W[se];mt[1]>P!=kt[1]>P&&S<(kt[0]-mt[0])*(P-mt[1])/(kt[1]-mt[1])+mt[0]&&(F=!F),N=Math.min(N,y(S,P,mt,kt))}return N===0?0:(F?1:-1)*Math.sqrt(N)}function p(S){for(var P=0,L=0,F=0,N=S[0],z=0,W=N.length,nt=W-1;z<W;nt=z++){var Pe=N[z],se=N[nt],mt=Pe[0]*se[1]-se[0]*Pe[1];L+=(Pe[0]+se[0])*mt,F+=(Pe[1]+se[1])*mt,P+=mt*3}return P===0?new d(N[0][0],N[0][1],0,S):new d(L/P,F/P,0,S)}function y(S,P,L,F){var N=L[0],z=L[1],W=F[0]-N,nt=F[1]-z;if(W!==0||nt!==0){var Pe=((S-N)*W+(P-z)*nt)/(W*W+nt*nt);Pe>1?(N=F[0],z=F[1]):Pe>0&&(N+=W*Pe,z+=nt*Pe)}return W=S-N,nt=P-z,W*W+nt*nt}}});__toModule(require_point_geometry()),__toModule(require_point_geometry());var import_point_geometry=__toModule(require_point_geometry()),import_vector_tile=__toModule(require_vector_tile()),import_pbf=__toModule(require_pbf()),u8=Uint8Array,u16=Uint16Array,u32=Uint32Array,fleb=new u8([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),fdeb=new u8([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),freb=function(t,n){for(var o=new u16(31),s=0;s<31;++s)o[s]=n+=1<<t[s-1];for(var c=new u32(o[30]),s=1;s<30;++s)for(var d=o[s];d<o[s+1];++d)c[d]=d-o[s]<<5|s;return[o,c]},_a$1=freb(fleb,2),fl$1=_a$1[0],revfl=_a$1[1];fl$1[28]=258,revfl[258]=28,freb(fdeb,0);var rev=new u16(32768);for(i=0;i<32768;++i)x=(i&43690)>>>1|(i&21845)<<1,x=(x&52428)>>>2|(x&13107)<<2,x=(x&61680)>>>4|(x&3855)<<4,rev[i]=((x&65280)>>>8|(x&255)<<8)>>>1;var x,i,flt=new u8(288);for(i=0;i<144;++i)flt[i]=8;var i;for(i=144;i<256;++i)flt[i]=9;var i;for(i=256;i<280;++i)flt[i]=7;var i;for(i=280;i<288;++i)flt[i]=8;var i,fdt=new u8(32);for(i=0;i<32;++i)fdt[i]=5;var i,et$1=new u8(0),td$1=typeof TextDecoder<"u"&&new TextDecoder,tds=0;try{td$1.decode(et$1,{stream:!0}),tds=1}catch(t){}var GeomType;(function(t){t[t.Point=1]="Point",t[t.Line=2]="Line",t[t.Polygon=3]="Polygon"})(GeomType||(GeomType={}));function toIndex(t){return t.x+":"+t.y+":"+t.z}var loadGeomAndBbox=(t,n,o)=>{t.pos=n;for(var s=t.readVarint()+t.pos,c=1,d=0,h=0,p=0,y=1/0,S=-1/0,P=1/0,L=-1/0,F=[],N=[];t.pos<s;){if(d<=0){var z=t.readVarint();c=z&7,d=z>>3}if(d--,c===1||c===2)h+=t.readSVarint()*o,p+=t.readSVarint()*o,h<y&&(y=h),h>S&&(S=h),p<P&&(P=p),p>L&&(L=p),c===1&&(N.length>0&&F.push(N),N=[]),N.push(new import_point_geometry.default(h,p));else if(c===7)N&&N.push(N[0].clone());else throw new Error("unknown command "+c)}return N&&F.push(N),{geom:F,bbox:{minX:y,minY:P,maxX:S,maxY:L}}};function parseTile(t,n){let o=new import_vector_tile.VectorTile(new import_pbf.default(t)),s=new Map;for(let[c,d]of Object.entries(o.layers)){let h=[],p=d;for(let y=0;y<p.length;y++){let S=loadGeomAndBbox(p.feature(y)._pbf,p.feature(y)._geometry,n/p.extent),P=0;for(let L of S.geom)P+=L.length;h.push({id:p.feature(y).id,geomType:p.feature(y).type,geom:S.geom,numVertices:P,bbox:S.bbox,props:p.feature(y).properties})}s.set(c,h)}return s}var ZxySource=class{constructor(t,n){this.url=t,this.controllers=[],this.shouldCancelZooms=n}get(t,n){return __async(this,null,function*(){this.shouldCancelZooms&&(this.controllers=this.controllers.filter(d=>d[0]!=t.z?(d[1].abort(),!1):!0));let o=this.url.replace("{z}",t.z.toString()).replace("{x}",t.x.toString()).replace("{y}",t.y.toString());const s=new AbortController;this.controllers.push([t.z,s]);const c=s.signal;return new Promise((d,h)=>{fetch(o,{signal:c}).then(p=>p.arrayBuffer()).then(p=>{let y=parseTile(p,n);d(y)}).catch(p=>{h(p)})})})}},R=6378137,MAX_LATITUDE=85.0511287798,MAXCOORD=R*Math.PI,project=t=>{let n=Math.PI/180,o=Math.max(Math.min(MAX_LATITUDE,t[0]),-85.0511287798),s=Math.sin(o*n);return new import_point_geometry.default(R*t[1]*n,R*Math.log((1+s)/(1-s))/2)};function sqr(t){return t*t}function dist2(t,n){return sqr(t.x-n.x)+sqr(t.y-n.y)}function distToSegmentSquared(t,n,o){var s=dist2(n,o);if(s===0)return dist2(t,n);var c=((t.x-n.x)*(o.x-n.x)+(t.y-n.y)*(o.y-n.y))/s;return c=Math.max(0,Math.min(1,c)),dist2(t,new import_point_geometry.default(n.x+c*(o.x-n.x),n.y+c*(o.y-n.y)))}function isInRing(t,n){for(var o=!1,s=0,c=n.length-1;s<n.length;c=s++){var d=n[s].x,h=n[s].y,p=n[c].x,y=n[c].y,S=h>t.y!=y>t.y&&t.x<(p-d)*(t.y-h)/(y-h)+d;S&&(o=!o)}return o}function isCCW(t){for(var n=0,o=0;o<t.length;o++){let s=(o+1)%t.length;n+=t[o].x*t[s].y,n-=t[s].x*t[o].y}return n<0}function pointInPolygon(t,n){var o=!1;for(let s of n)if(isCCW(s))isInRing(t,s)&&(o=!1);else{if(o)return!0;isInRing(t,s)&&(o=!0)}return o}function pointMinDistToPoints(t,n){let o=1/0;for(let s of n){let c=Math.sqrt(dist2(t,s[0]));c<o&&(o=c)}return o}function pointMinDistToLines(t,n){let o=1/0;for(let c of n)for(var s=0;s<c.length-1;s++){let d=Math.sqrt(distToSegmentSquared(t,c[s],c[s+1]));d<o&&(o=d)}return o}var TileCache=class{constructor(t,n){this.source=t,this.cache=new Map,this.inflight=new Map,this.tileSize=n}queryFeatures(t,n,o,s){let c=project([n,t]);var d=new import_point_geometry.default((c.x+MAXCOORD)/(MAXCOORD*2),1-(c.y+MAXCOORD)/(MAXCOORD*2));d.x>1&&(d.x=d.x-Math.floor(d.x));let h=d.mult(1<<o),p=Math.floor(h.x),y=Math.floor(h.y);const S=toIndex({z:o,x:p,y});let P=[],L=this.cache.get(S);if(L){const F=new import_point_geometry.default((h.x-p)*this.tileSize,(h.y-y)*this.tileSize);for(let[N,z]of L.data.entries())for(let W of z)W.geomType==1?pointMinDistToPoints(F,W.geom)<s&&P.push({feature:W,layerName:N}):W.geomType==2?pointMinDistToLines(F,W.geom)<s&&P.push({feature:W,layerName:N}):pointInPolygon(F,W.geom)&&P.push({feature:W,layerName:N})}return P}get(t){return __async(this,null,function*(){const n=toIndex(t);return new Promise((o,s)=>{let c=this.cache.get(n);if(c)c.used=performance.now(),o(c.data);else{let d=this.inflight.get(n);d?d.push([o,s]):(this.inflight.set(n,[]),this.source.get(t,this.tileSize).then(h=>{this.cache.set(n,{used:performance.now(),data:h});let p=this.inflight.get(n);if(p&&p.forEach(y=>y[0](h)),this.inflight.delete(n),o(h),this.cache.size>=64){let y=1/0,S;this.cache.forEach((P,L)=>{P.used<y&&(y=P.used,S=L)}),S&&this.cache.delete(S)}}).catch(h=>{let p=this.inflight.get(n);p&&p.forEach(y=>y[1](h)),this.inflight.delete(n),s(h)}))}})})}};__toModule(require_point_geometry()),__toModule(require_point_geometry()),__toModule(require_rbush_min());var e=t=>parseInt(t.replace(/_/g,""),36);"1q29ehhb 1n09sgk7 1kl1ekf_ _yl4zsno 16z9eiv3 1p29lhp8 _bd9zg04 17u0____ _iw9zhe5 _to73___ _r45e31e _7l6g016 _jh8ouiv _zn3qba8 1jy4zshs 11u87k0u 1ro9yvyo 1aj3xael 1gz9zjz0 _3w8l4xo 1bf1ekf_ _ke3v___ _4rrkb__ 13j776yz _646mbhl _nrjr4__ _le6mbhl 1n37ehkb _m75f91n _qj3bzfz 1939yygw 11i5z6x8 _1k5f8xs 1509441m 15t5lwgf _ae2th1n _tg1ugcv 1lp1ugcv 16e14up_ _h55rw7n _ny9yavn _7a11xb_ 1ih442g9 _pv442g9 1mv16xof 14e6y7tu 1oo9zkds 17d1cisi _4v9y70f _y98m8kc 1019pq0v 12o9zda8 _348j4f4 1et50i2o _8epa8__ _ts6senj 1o350i2o 1mi9eiuo 1259yrp0 1ln80gnw _632xcoy 1cn9zldc _f29edu4 1n490c8q _9f9ziet 1b94vk74 _m49zkct 1kz6s73a 1eu9dtog _q58s1rz 1dy9sjiq __u89jo3 _aj5nkwg _ld89jo3 13h9z6wx _qa9z2ii _l119xgq _bs5arju 1hj4nwk9 1qt4nwk9 1ge6wau6 14j9zlcw 11p1edc_ _ms1zcxe _439shk6 _jt9y70f _754zsow 1la40eju _oq5p___ _x279qkz 1fa5r3rv _yd2d9ip _424tcku _8y1di2_ _zi2uabw _yy7rn9h 12yz980_ __39ljp6 1b59zg0x _n39zfzp 1fy9zest _b33k___ _hp9wq92 1il50hz4 _io472ub _lj9z3eo 19z9ykg0 _8t8iu3a 12b9bl4a 1ak5yw0o _896v4ku _tb8k8lv _s59zi6t _c09ze0p 1lg80oqn 1id9z8wb _238nba5 1kq6wgdi _154zssg _tn3zk49 _da9y6tc 1sg7cv4f _r12jvtt 1gq5fmkz 1cs9rvci _lp9jn1c _xw1tdnb 13f9zje6 16f6973h _vo7ir40 _bt5arjf _rc45e4t _hr4e100 10v4e100 _hc9zke2 _w91egv_ _sj2r1kk 13c87yx8 _vqpds__ _ni8ggk8 _tj9yqfb 1ia2j4r4 _7x9b10u 1fc9ld4j 1eq9zldr _5j9lhpx _ez9zl6o _md61fzm".split(" ").reduce((t,n)=>{const o=e(n.substring(0,3)),s=e(n.substring(3)).toString(16);let c="";for(let d=0;d<6-s.length;d++)c+="0";return t[o]=`${c}${s}`,t},{});var _$1=(t,n)=>Array.from(Array(n)).map(()=>t).join("");new RegExp(`^#${_$1("([a-f0-9])",3)}([a-f0-9])?$`,"i"),new RegExp(`^#${_$1("([a-f0-9]{2})",3)}([a-f0-9]{2})?$`,"i"),new RegExp(`^rgba?\\(\\s*(\\d+)\\s*${_$1(",\\s*(\\d+)\\s*",2)}(?:,\\s*([\\d.]+))?\\s*\\)$`,"i"),__toModule(require_point_geometry()),__toModule(require_unitbezier_d()),__toModule(require_polylabel()),__toModule(require_point_geometry());var Justify;(function(t){t[t.Left=1]="Left",t[t.Center=2]="Center",t[t.Right=3]="Right"})(Justify||(Justify={}));var TextPlacements;(function(t){t[t.N=1]="N",t[t.NE=2]="NE",t[t.E=3]="E",t[t.SE=4]="SE",t[t.S=5]="S",t[t.SW=6]="SW",t[t.W=7]="W",t[t.NW=8]="NW"})(TextPlacements||(TextPlacements={}));var LineLabelPlacement;(function(t){t[t.Above=1]="Above",t[t.Center=2]="Center",t[t.Below=3]="Below"})(LineLabelPlacement||(LineLabelPlacement={})),__toModule(require_point_geometry());/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */function makeKey({x:t,y:n,level:o}){return`${o}:${t}:${n}`}function getTileCoords(t,n){if(n!=null&&t.level>n){const o=2**(t.level-n);return{x:Math.floor(t.x/o),y:Math.floor(t.y/o),z:n}}return{x:t.x,y:t.y,z:t.level}}class JapanGSIOptimalBVmapImageryProviderBase{constructor(n){Rf(this,"defaultAlpha");Rf(this,"defaultNightAlpha");Rf(this,"defaultDayAlpha");Rf(this,"defaultBrightness");Rf(this,"defaultContrast");Rf(this,"defaultHue");Rf(this,"defaultSaturation");Rf(this,"defaultGamma");Rf(this,"defaultMinificationFilter");Rf(this,"defaultMagnificationFilter");Rf(this,"ready",!0);Rf(this,"readyPromise",Promise.resolve(!0));Rf(this,"tileWidth",256);Rf(this,"tileHeight",256);Rf(this,"maximumLevel");Rf(this,"minimumLevel",0);Rf(this,"tilingScheme",new WebMercatorTilingScheme);Rf(this,"rectangle",this.tilingScheme.rectangle);Rf(this,"tileDiscardPolicy");Rf(this,"errorEvent",new Event$1);Rf(this,"credit");Rf(this,"proxy");Rf(this,"hasAlphaChannel",!0);(n==null?void 0:n.tilingScheme)!=null&&(this.tilingScheme=n.tilingScheme),(n==null?void 0:n.tileWidth)!=null&&(this.tileWidth=n.tileWidth),(n==null?void 0:n.tileHeight)!=null&&(this.tileHeight=n.tileHeight)}getTileCredits(n,o,s){}requestImage(n,o,s,c){}pickFeatures(n,o,s,c,d){}get _ready(){return this.ready}get _readyPromise(){return this.readyPromise}}class JapanGSIOptimalBVmapLabelImageryProvider extends JapanGSIOptimalBVmapImageryProviderBase{constructor(o){super(o);Rf(this,"minimumDataLevel");Rf(this,"maximumDataLevel");Rf(this,"tileCache");Rf(this,"image");Rf(this,"discardedTileCoords",new Set);this.tileDiscardPolicy=new DiscardEmptyTileImagePolicy,this.minimumDataLevel=o.minimumDataLevel,this.maximumDataLevel=o.maximumDataLevel;const s=new ZxySource(o.url,!1);this.tileCache=new TileCache(s,1024),this.image=document.createElement("canvas"),this.image.width=1,this.image.height=1}requestImage(o,s,c,d){const h=makeKey({x:o,y:s,level:c});return(async()=>c<this.minimumDataLevel||this.discardedTileCoords.has(h)?DiscardEmptyTileImagePolicy.EMPTY_IMAGE:(await this.tileCache.get(getTileCoords({x:o,y:s,level:c},this.maximumDataLevel)),this.image))().catch(()=>(this.discardedTileCoords.add(h),DiscardEmptyTileImagePolicy.EMPTY_IMAGE))}}const tiles={default:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.AERIAL,{accessToken:t}).catch(console.error),default_label:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.AERIAL_WITH_LABELS,{accessToken:t}).catch(console.error),default_road:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(Cesium$1.IonWorldImageryStyle.ROAD,{accessToken:t}).catch(console.error),open_street_map:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://tile.openstreetmap.org/{zoom}/{x}/{y}.png",credit:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'}),black_marble:({cesiumIonAccessToken:t}={})=>Cesium$1.IonImageryProvider.fromAssetId(3812,{accessToken:t}).catch(console.error),japan_gsi_standard:()=>new Cesium$1.OpenStreetMapImageryProvider({url:"https://cyberjapandata.gsi.go.jp/xyz/std/",credit:`<a href='https://maps.gsi.go.jp/development/ichiran.html'>国土地理院</a>, Shoreline data is derived from: United States. National Imagery and Mapping Agency. "Vector Map Level 0 (VMAP0)." Bethesda, MD: Denver, CO: The Agency; USGS Information Services, 1997.`}),url:({url:t,heatmap:n,tile_zoomLevel:o}={})=>t?new Cesium$1.UrlTemplateImageryProvider({url:t,tileDiscardPolicy:n?new Cesium$1.DiscardEmptyTileImagePolicy:void 0,minimumLevel:o==null?void 0:o[0],maximumLevel:o==null?void 0:o[1]}):null};function ImageryLayers({tiles:t,cesiumIonAccessToken:n,onTilesChange:o}){const{providers:s,updated:c}=useImageryProviders({tiles:t,cesiumIonAccessToken:n,presets:tiles}),[d,h]=React.useState(0);return React.useLayoutEffect(()=>{c&&h(p=>p+1)},[s,c]),React.useEffect(()=>{o==null||o()},[t,d,o]),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t==null?void 0:t.map(({id:p,...y})=>{var S;return{...y,id:p,provider:(S=s[p])==null?void 0:S[2]}}).map(({id:p,opacity:y,zoomLevel:S,provider:P,heatmap:L},F)=>P?jsxRuntimeExports.jsx(Ns$1,{imageryProvider:P,minimumTerrainLevel:S==null?void 0:S[0],maximumTerrainLevel:S==null?void 0:S[1],alpha:y,index:F,colorToAlpha:L?Cesium$1.Color.WHITE:void 0,colorToAlphaThreshold:L?1:void 0,magnificationFilter:L?Cesium$1.TextureMagnificationFilter.LINEAR:void 0,minificationFilter:L?Cesium$1.TextureMinificationFilter.NEAREST:void 0},`${p}_${F}_${d}`):null)})}function useImageryProviders({tiles:t=[],cesiumIonAccessToken:n,presets:o}){const s=React.useCallback((F,N)=>o[F.type||"default"]({url:F.url,cesiumIonAccessToken:N,heatmap:F.heatmap,zoomLevel:F.zoomLevelForURL}),[o]),c=React.useRef(n),d=t.map(F=>F.id).join(","),h=React.useRef(d),p=React.useRef({}),y=React.useMemo(()=>t.map(F=>{if(F.id&&F.zoomLevel)return{[F.id]:F.zoomLevel}}),[t]),S=React.useRef(y),{providers:P,updated:L}=React.useMemo(()=>{const F=c.current!==n,N=Object.keys(p.current),z=t.map(se=>se.id).filter(se=>se&&!N.includes(se)),W=[...Object.entries(p.current),...z.map(se=>[se,void 0])].map(([se,mt])=>({key:se,added:z.includes(se),prevType:mt==null?void 0:mt[0],prevUrl:mt==null?void 0:mt[1],prevProvider:mt==null?void 0:mt[2],tile:t.find(kt=>kt.id===se)})),nt=Object.fromEntries(W.map(({key:se,added:mt,prevType:kt,prevUrl:mn,prevProvider:_i,tile:zi})=>zi?[se,mt||kt!==zi.type||mn!==zi.url||F&&(!zi.type||zi.type==="default")?[zi.type,zi.url,s(zi,n)]:[kt,mn,_i]]:null).filter(se=>!!(se!=null&&se[1][2]))),Pe=!!z.length||!!F||!isEqual(h.current,d)||!isEqual(S.current,y)||W.some(se=>se.tile&&(se.prevType!==se.tile.type||se.prevUrl!==se.tile.url));return h.current=d,S.current=y,c.current=n,{providers:nt,updated:Pe}},[n,t,d,s,y]);return p.current=P,{providers:P,updated:L}}const useTransition=(t,n,o)=>{const[s,c]=React.useState(t?"entered":o&&o.mountOnEnter?"unmounted":"exited"),d=React.useRef(),h=React.useRef(),p=React.useCallback(()=>{c(t?"entered":o&&o.unmountOnExit?"unmounted":"exited"),h.current=void 0},[t,!!o&&o.unmountOnExit,h]),y=React.useCallback(()=>{c("entered"),h.current=void 0},[h]),S=React.useCallback(()=>{c(t?"entered":o&&o.unmountOnExit?"unmounted":"exited"),h.current=void 0},[t,!!o&&o.unmountOnExit,h]),P=React.useCallback(()=>{c(t?"entering":"exiting"),d.current=setTimeout(S,n),h.current=Date.now()+n},[t,n,S,d,h]);return React.useEffect(()=>{if(t?s==="entered":s==="exited"||s==="unmounted"){h.current=void 0;return}const L=Date.now(),F=typeof h.current>"u"?n:n-(h.current-L);return!t&&(s==="entered"||s==="entering")?(c("exiting"),d.current=setTimeout(p,F)):t&&(s==="exited"||s==="exiting")?(c("entering"),d.current=setTimeout(y,F)):(c(t?"exited":"entered"),d.current=setTimeout(P,30)),h.current=L+F,()=>{clearTimeout(d.current)}},[t]),s},SvgCrosshair=t=>React__namespace.createElement("svg",{width:48,height:48,viewBox:"0 0 48 48",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t},React__namespace.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M25 5.02586C34.6974 5.52871 42.4713 13.3026 42.9741 23H47C47.5523 23 48 23.4477 48 24C48 24.5523 47.5523 25 47 25H42.9741C42.4713 34.6974 34.6974 42.4713 25 42.9741V47C25 47.5523 24.5523 48 24 48C23.4477 48 23 47.5523 23 47V42.9741C13.3026 42.4713 5.52871 34.6974 5.02586 25H1C0.447715 25 0 24.5523 0 24C0 23.4477 0.447715 23 1 23H5.02586C5.52871 13.3026 13.3026 5.52871 23 5.02586V1C23 0.447715 23.4477 0 24 0C24.5523 0 25 0.447715 25 1V5.02586ZM41.5 24C41.5 33.665 33.665 41.5 24 41.5C14.335 41.5 6.5 33.665 6.5 24C6.5 14.335 14.335 6.5 24 6.5C33.665 6.5 41.5 14.335 41.5 24Z",fill:"white"}));function Indicator({className:t,property:n,timelineManagerRef:o}){const{viewer:s}=$e$1(),[c,d]=React.useState(!0),[h,p]=React.useState(),y=useTransition(!!h&&c,500,{mountOnEnter:!0,unmountOnExit:!0}),{type:S,image:P,imageScale:L}=(n==null?void 0:n.indicator)??{},[F,N,z]=useIcon({image:P,imageSize:L});return React.useEffect(()=>{!S||S==="default"?s==null||s.selectionIndicator.viewModel.selectionIndicatorElement.removeAttribute("hidden"):s==null||s.selectionIndicator.viewModel.selectionIndicatorElement.setAttribute("hidden","true")},[S,s,s==null?void 0:s.selectionIndicator]),React.useEffect(()=>{if(!s)return;const W=()=>{var _i,zi,Sa;if(s.isDestroyed())return;const Pe=s.selectedEntity,se=(zi=(_i=o==null?void 0:o.current)==null?void 0:_i.timeline)!=null&&zi.current?Cesium$1.JulianDate.fromDate((Sa=o==null?void 0:o.current)==null?void 0:Sa.timeline.current):void 0;if(!(Pe!=null&&Pe.isShowing)||se&&!Pe.isAvailable(se)||!Pe.position){d(!1);return}let mt;const kt=new Cesium$1.BoundingSphere;if(s.dataSourceDisplay.getBoundingSphere(Pe,!0,kt)!==2?mt=kt.center:Pe.position&&se&&(mt=Pe.position.getValue(se,mt)),mt){const fa=Cesium$1.SceneTransforms.wgs84ToWindowCoordinates(s.scene,mt);p(fa),d(!0)}else d(!1)},nt=o==null?void 0:o.current;return nt==null||nt.onTick(W),()=>{nt==null||nt.offTick(W)}},[s,o]),y!=="unmounted"&&h?S==="crosshair"?jsxRuntimeExports.jsx("div",{className:t,style:{width:48,height:48,fontSize:0,display:"inline-block",transitionProperty:"color, background",left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"},children:jsxRuntimeExports.jsx(SvgCrosshair,{})}):S==="custom"?jsxRuntimeExports.jsx("img",{src:F,width:N,height:z,style:{left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"}}):jsxRuntimeExports.jsx("div",{style:{left:h.x+"px",top:h.y+"px",position:"absolute",transform:"translate(-50%, -50%)",transition:y==="entering"||y==="exiting"?"all 0.5s ease":"",opacity:y==="entering"||y==="entered"?1:0,pointerEvents:"none"}}):null}const annotationTypes={municipalities:[110,140],towns:[120,130,210,220,800],roads:[411],railways:[421],stations:[422],landmarks:[412,413,423,431,432,441,511,521,522,523,531,532,533,534,611,612,613,615,621,631,632,633,634,651,653,661,662,671,673,681,860,870,880,881,882,883,884,885,886,887,888,889,890,899],topography:[311,312,313,314,315,316,321,322,323,331,332,333,341,342,343,344,345,346,347,348,351,352,353,361,810,820,822,830,831,832,840,841,842,843,850]},typeMap=fromPairs(Object.entries(annotationTypes).flatMap(([t,n])=>n.map(o=>[o,t])));function getAnnotationType(t){return typeMap[t]}function useSceneEvent(t,n){const{viewer:o}=$e$1(),s=o==null?void 0:o.scene,c=React.useRef(n);c.current=n,React.useLayoutEffect(()=>s==null?void 0:s[t].addEventListener((d,h)=>{try{c.current(d,h)}catch(p){console.error(p)}}),[t,s])}function usePreRender(t){useSceneEvent("preRender",t)}const isPromise=t=>typeof t=="object"&&typeof t.then=="function",globalCache=[];function shallowEqualArrays(t,n,o=(s,c)=>s===c){if(t===n)return!0;if(!t||!n)return!1;const s=t.length;if(n.length!==s)return!1;for(let c=0;c<s;c++)if(!o(t[c],n[c]))return!1;return!0}function query(t,n=null,o=!1,s={}){n===null&&(n=[t]);for(const d of globalCache)if(shallowEqualArrays(n,d.keys,d.equal)){if(o)return;if(Object.prototype.hasOwnProperty.call(d,"error"))throw d.error;if(Object.prototype.hasOwnProperty.call(d,"response"))return s.lifespan&&s.lifespan>0&&(d.timeout&&clearTimeout(d.timeout),d.timeout=setTimeout(d.remove,s.lifespan)),d.response;if(!o)throw d.promise}const c={keys:n,equal:s.equal,remove:()=>{const d=globalCache.indexOf(c);d!==-1&&globalCache.splice(d,1)},promise:(isPromise(t)?t:t(...n)).then(d=>{c.response=d,s.lifespan&&s.lifespan>0&&(c.timeout=setTimeout(c.remove,s.lifespan))}).catch(d=>c.error=d)};if(globalCache.push(c),!o)throw c.promise}const suspend=(t,n,o)=>query(t,n,!1,o);function coordEach(t,n,o){if(t!==null)for(var s,c,d,h,p,y,S,P=0,L=0,F,N=t.type,z=N==="FeatureCollection",W=N==="Feature",nt=z?t.features.length:1,Pe=0;Pe<nt;Pe++){S=z?t.features[Pe].geometry:W?t.geometry:t,F=S?S.type==="GeometryCollection":!1,p=F?S.geometries.length:1;for(var se=0;se<p;se++){var mt=0,kt=0;if(h=F?S.geometries[se]:S,h!==null){y=h.coordinates;var mn=h.type;switch(P=o&&(mn==="Polygon"||mn==="MultiPolygon")?1:0,mn){case null:break;case"Point":if(n(y,L,Pe,mt,kt)===!1)return!1;L++,mt++;break;case"LineString":case"MultiPoint":for(s=0;s<y.length;s++){if(n(y[s],L,Pe,mt,kt)===!1)return!1;L++,mn==="MultiPoint"&&mt++}mn==="LineString"&&mt++;break;case"Polygon":case"MultiLineString":for(s=0;s<y.length;s++){for(c=0;c<y[s].length-P;c++){if(n(y[s][c],L,Pe,mt,kt)===!1)return!1;L++}mn==="MultiLineString"&&mt++,mn==="Polygon"&&kt++}mn==="Polygon"&&mt++;break;case"MultiPolygon":for(s=0;s<y.length;s++){for(kt=0,c=0;c<y[s].length;c++){for(d=0;d<y[s][c].length-P;d++){if(n(y[s][c][d],L,Pe,mt,kt)===!1)return!1;L++}kt++}mt++}break;case"GeometryCollection":for(s=0;s<h.geometries.length;s++)if(coordEach(h.geometries[s],n,o)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function featureEach(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var o=0;o<t.features.length&&n(t.features[o],o)!==!1;o++);}function geomEach(t,n){var o,s,c,d,h,p,y,S,P,L,F=0,N=t.type==="FeatureCollection",z=t.type==="Feature",W=N?t.features.length:1;for(o=0;o<W;o++){for(p=N?t.features[o].geometry:z?t.geometry:t,S=N?t.features[o].properties:z?t.properties:{},P=N?t.features[o].bbox:z?t.bbox:void 0,L=N?t.features[o].id:z?t.id:void 0,y=p?p.type==="GeometryCollection":!1,h=y?p.geometries.length:1,c=0;c<h;c++){if(d=y?p.geometries[c]:p,d===null){if(n(null,F,S,P,L)===!1)return!1;continue}switch(d.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(d,F,S,P,L)===!1)return!1;break}case"GeometryCollection":{for(s=0;s<d.geometries.length;s++)if(n(d.geometries[s],F,S,P,L)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}F++}}function geomReduce(t,n,o){var s=o;return geomEach(t,function(c,d,h,p,y){s=n(s,c,d,h,p,y)}),s}function flattenEach(t,n){geomEach(t,function(o,s,c,d,h){var p=o===null?null:o.type;switch(p){case null:case"Point":case"LineString":case"Polygon":return n(feature$1(o,c,{bbox:d,id:h}),s,0)===!1?!1:void 0}var y;switch(p){case"MultiPoint":y="Point";break;case"MultiLineString":y="LineString";break;case"MultiPolygon":y="Polygon";break}for(var S=0;S<o.coordinates.length;S++){var P=o.coordinates[S],L={type:y,coordinates:P};if(n(feature$1(L,c),s,S)===!1)return!1}})}var rbush$2={exports:{}},quickselect$2={exports:{}};(function(t,n){(function(o,s){t.exports=s()})(commonjsGlobal,function(){function o(h,p,y,S,P){s(h,p,y||0,S||h.length-1,P||d)}function s(h,p,y,S,P){for(;S>y;){if(S-y>600){var L=S-y+1,F=p-y+1,N=Math.log(L),z=.5*Math.exp(2*N/3),W=.5*Math.sqrt(N*z*(L-z)/L)*(F-L/2<0?-1:1),nt=Math.max(y,Math.floor(p-F*z/L+W)),Pe=Math.min(S,Math.floor(p+(L-F)*z/L+W));s(h,p,nt,Pe,P)}var se=h[p],mt=y,kt=S;for(c(h,y,p),P(h[S],se)>0&&c(h,y,S);mt<kt;){for(c(h,mt,kt),mt++,kt--;P(h[mt],se)<0;)mt++;for(;P(h[kt],se)>0;)kt--}P(h[y],se)===0?c(h,y,kt):(kt++,c(h,kt,S)),kt<=p&&(y=kt+1),p<=kt&&(S=kt-1)}}function c(h,p,y){var S=h[p];h[p]=h[y],h[y]=S}function d(h,p){return h<p?-1:h>p?1:0}return o})})(quickselect$2);var quickselectExports=quickselect$2.exports;rbush$2.exports=rbush,rbush$2.exports.default=rbush;var quickselect$1=quickselectExports;function rbush(t,n){if(!(this instanceof rbush))return new rbush(t,n);this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),n&&this._initFormat(n),this.clear()}rbush.prototype={all:function(){return this._all(this.data,[])},search:function(t){var n=this.data,o=[],s=this.toBBox;if(!intersects(t,n))return o;for(var c=[],d,h,p,y;n;){for(d=0,h=n.children.length;d<h;d++)p=n.children[d],y=n.leaf?s(p):p,intersects(t,y)&&(n.leaf?o.push(p):contains(t,y)?this._all(p,o):c.push(p));n=c.pop()}return o},collides:function(t){var n=this.data,o=this.toBBox;if(!intersects(t,n))return!1;for(var s=[],c,d,h,p;n;){for(c=0,d=n.children.length;c<d;c++)if(h=n.children[c],p=n.leaf?o(h):h,intersects(t,p)){if(n.leaf||contains(t,p))return!0;s.push(h)}n=s.pop()}return!1},load:function(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(var n=0,o=t.length;n<o;n++)this.insert(t[n]);return this}var s=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=s;else if(this.data.height===s.height)this._splitRoot(this.data,s);else{if(this.data.height<s.height){var c=this.data;this.data=s,s=c}this._insert(s,this.data.height-s.height-1,!0)}return this},insert:function(t){return t&&this._insert(t,this.data.height-1),this},clear:function(){return this.data=createNode([]),this},remove:function(t,n){if(!t)return this;for(var o=this.data,s=this.toBBox(t),c=[],d=[],h,p,y,S;o||c.length;){if(o||(o=c.pop(),p=c[c.length-1],h=d.pop(),S=!0),o.leaf&&(y=findItem(t,o.children,n),y!==-1))return o.children.splice(y,1),c.push(o),this._condense(c),this;!S&&!o.leaf&&contains(o,s)?(c.push(o),d.push(h),h=0,p=o,o=o.children[0]):p?(h++,o=p.children[h],S=!1):o=null}return this},toBBox:function(t){return t},compareMinX:compareNodeMinX,compareMinY:compareNodeMinY,toJSON:function(){return this.data},fromJSON:function(t){return this.data=t,this},_all:function(t,n){for(var o=[];t;)t.leaf?n.push.apply(n,t.children):o.push.apply(o,t.children),t=o.pop();return n},_build:function(t,n,o,s){var c=o-n+1,d=this._maxEntries,h;if(c<=d)return h=createNode(t.slice(n,o+1)),calcBBox(h,this.toBBox),h;s||(s=Math.ceil(Math.log(c)/Math.log(d)),d=Math.ceil(c/Math.pow(d,s-1))),h=createNode([]),h.leaf=!1,h.height=s;var p=Math.ceil(c/d),y=p*Math.ceil(Math.sqrt(d)),S,P,L,F;for(multiSelect(t,n,o,y,this.compareMinX),S=n;S<=o;S+=y)for(L=Math.min(S+y-1,o),multiSelect(t,S,L,p,this.compareMinY),P=S;P<=L;P+=p)F=Math.min(P+p-1,L),h.children.push(this._build(t,P,F,s-1));return calcBBox(h,this.toBBox),h},_chooseSubtree:function(t,n,o,s){for(var c,d,h,p,y,S,P,L;s.push(n),!(n.leaf||s.length-1===o);){for(P=L=1/0,c=0,d=n.children.length;c<d;c++)h=n.children[c],y=bboxArea(h),S=enlargedArea(t,h)-y,S<L?(L=S,P=y<P?y:P,p=h):S===L&&y<P&&(P=y,p=h);n=p||n.children[0]}return n},_insert:function(t,n,o){var s=this.toBBox,c=o?t:s(t),d=[],h=this._chooseSubtree(c,this.data,n,d);for(h.children.push(t),extend$1(h,c);n>=0&&d[n].children.length>this._maxEntries;)this._split(d,n),n--;this._adjustParentBBoxes(c,d,n)},_split:function(t,n){var o=t[n],s=o.children.length,c=this._minEntries;this._chooseSplitAxis(o,c,s);var d=this._chooseSplitIndex(o,c,s),h=createNode(o.children.splice(d,o.children.length-d));h.height=o.height,h.leaf=o.leaf,calcBBox(o,this.toBBox),calcBBox(h,this.toBBox),n?t[n-1].children.push(h):this._splitRoot(o,h)},_splitRoot:function(t,n){this.data=createNode([t,n]),this.data.height=t.height+1,this.data.leaf=!1,calcBBox(this.data,this.toBBox)},_chooseSplitIndex:function(t,n,o){var s,c,d,h,p,y,S,P;for(y=S=1/0,s=n;s<=o-n;s++)c=distBBox(t,0,s,this.toBBox),d=distBBox(t,s,o,this.toBBox),h=intersectionArea(c,d),p=bboxArea(c)+bboxArea(d),h<y?(y=h,P=s,S=p<S?p:S):h===y&&p<S&&(S=p,P=s);return P},_chooseSplitAxis:function(t,n,o){var s=t.leaf?this.compareMinX:compareNodeMinX,c=t.leaf?this.compareMinY:compareNodeMinY,d=this._allDistMargin(t,n,o,s),h=this._allDistMargin(t,n,o,c);d<h&&t.children.sort(s)},_allDistMargin:function(t,n,o,s){t.children.sort(s);var c=this.toBBox,d=distBBox(t,0,n,c),h=distBBox(t,o-n,o,c),p=bboxMargin(d)+bboxMargin(h),y,S;for(y=n;y<o-n;y++)S=t.children[y],extend$1(d,t.leaf?c(S):S),p+=bboxMargin(d);for(y=o-n-1;y>=n;y--)S=t.children[y],extend$1(h,t.leaf?c(S):S),p+=bboxMargin(h);return p},_adjustParentBBoxes:function(t,n,o){for(var s=o;s>=0;s--)extend$1(n[s],t)},_condense:function(t){for(var n=t.length-1,o;n>=0;n--)t[n].children.length===0?n>0?(o=t[n-1].children,o.splice(o.indexOf(t[n]),1)):this.clear():calcBBox(t[n],this.toBBox)},_initFormat:function(t){var n=["return a"," - b",";"];this.compareMinX=new Function("a","b",n.join(t[0])),this.compareMinY=new Function("a","b",n.join(t[1])),this.toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}};function findItem(t,n,o){if(!o)return n.indexOf(t);for(var s=0;s<n.length;s++)if(o(t,n[s]))return s;return-1}function calcBBox(t,n){distBBox(t,0,t.children.length,n,t)}function distBBox(t,n,o,s,c){c||(c=createNode(null)),c.minX=1/0,c.minY=1/0,c.maxX=-1/0,c.maxY=-1/0;for(var d=n,h;d<o;d++)h=t.children[d],extend$1(c,t.leaf?s(h):h);return c}function extend$1(t,n){return t.minX=Math.min(t.minX,n.minX),t.minY=Math.min(t.minY,n.minY),t.maxX=Math.max(t.maxX,n.maxX),t.maxY=Math.max(t.maxY,n.maxY),t}function compareNodeMinX(t,n){return t.minX-n.minX}function compareNodeMinY(t,n){return t.minY-n.minY}function bboxArea(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function bboxMargin(t){return t.maxX-t.minX+(t.maxY-t.minY)}function enlargedArea(t,n){return(Math.max(n.maxX,t.maxX)-Math.min(n.minX,t.minX))*(Math.max(n.maxY,t.maxY)-Math.min(n.minY,t.minY))}function intersectionArea(t,n){var o=Math.max(t.minX,n.minX),s=Math.max(t.minY,n.minY),c=Math.min(t.maxX,n.maxX),d=Math.min(t.maxY,n.maxY);return Math.max(0,c-o)*Math.max(0,d-s)}function contains(t,n){return t.minX<=n.minX&&t.minY<=n.minY&&n.maxX<=t.maxX&&n.maxY<=t.maxY}function intersects(t,n){return n.minX<=t.maxX&&n.minY<=t.maxY&&n.maxX>=t.minX&&n.maxY>=t.minY}function createNode(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function multiSelect(t,n,o,s,c){for(var d=[n,o],h;d.length;)o=d.pop(),n=d.pop(),!(o-n<=s)&&(h=n+Math.ceil((o-n)/s/2)*s,quickselect$1(t,h,n,o,c),d.push(n,h,h,o))}var rbushExports=rbush$2.exports;const rbush$1=getDefaultExportFromCjs(rbushExports);var RADIUS=6378137;function area(t){return geomReduce(t,function(n,o){return n+calculateArea(o)},0)}function calculateArea(t){var n=0,o;switch(t.type){case"Polygon":return polygonArea(t.coordinates);case"MultiPolygon":for(o=0;o<t.coordinates.length;o++)n+=polygonArea(t.coordinates[o]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0}return 0}function polygonArea(t){var n=0;if(t&&t.length>0){n+=Math.abs(ringArea(t[0]));for(var o=1;o<t.length;o++)n-=Math.abs(ringArea(t[o]))}return n}function ringArea(t){var n,o,s,c,d,h,p,y=0,S=t.length;if(S>2){for(p=0;p<S;p++)p===S-2?(c=S-2,d=S-1,h=0):p===S-1?(c=S-1,d=0,h=1):(c=p,d=p+1,h=p+2),n=t[c],o=t[d],s=t[h],y+=(rad(s[0])-rad(n[0]))*Math.sin(rad(o[1]));y=y*RADIUS*RADIUS/2}return y}function rad(t){return t*Math.PI/180}function booleanPointInPolygon(t,n,o){if(o===void 0&&(o={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var s=getCoord$2(t),c=getGeom$2(n),d=c.type,h=n.bbox,p=c.coordinates;if(h&&inBBox(s,h)===!1)return!1;d==="Polygon"&&(p=[p]);for(var y=!1,S=0;S<p.length&&!y;S++)if(inRing(s,p[S][0],o.ignoreBoundary)){for(var P=!1,L=1;L<p[S].length&&!P;)inRing(s,p[S][L],!o.ignoreBoundary)&&(P=!0),L++;P||(y=!0)}return y}function inRing(t,n,o){var s=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var c=0,d=n.length-1;c<n.length;d=c++){var h=n[c][0],p=n[c][1],y=n[d][0],S=n[d][1],P=t[1]*(h-y)+p*(y-t[0])+S*(t[0]-h)===0&&(h-t[0])*(y-t[0])<=0&&(p-t[1])*(S-t[1])<=0;if(P)return!o;var L=p>t[1]!=S>t[1]&&t[0]<(y-h)*(t[1]-p)/(S-p)+h;L&&(s=!s)}return s}function inBBox(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function isects(t,n,o){if(t.geometry.type!=="Polygon")throw new Error("The input feature must be a Polygon");o===void 0&&(o=1);var s=t.geometry.coordinates,c=[],d={};if(o){for(var h=[],p=0;p<s.length;p++)for(var y=0;y<s[p].length-1;y++)h.push(nt(p,y));var S=rbush$1();S.load(h)}for(var P=0;P<s.length;P++)for(var L=0;L<s[P].length-1;L++)if(o){var F=S.search(nt(P,L));F.forEach(function(Pe){var se=Pe.ring,mt=Pe.edge;W(P,L,se,mt)})}else for(var N=0;N<s.length;N++)for(var z=0;z<s[N].length-1;z++)W(P,L,N,z);return n||(c={type:"Feature",geometry:{type:"MultiPoint",coordinates:c}}),c;function W(Pe,se,mt,kt){var mn=s[Pe][se],_i=s[Pe][se+1],zi=s[mt][kt],Sa=s[mt][kt+1],fa=intersect(mn,_i,zi,Sa);if(fa!==null){var La,Ra;if(_i[0]!==mn[0]?La=(fa[0]-mn[0])/(_i[0]-mn[0]):La=(fa[1]-mn[1])/(_i[1]-mn[1]),Sa[0]!==zi[0]?Ra=(fa[0]-zi[0])/(Sa[0]-zi[0]):Ra=(fa[1]-zi[1])/(Sa[1]-zi[1]),!(La>=1||La<=0||Ra>=1||Ra<=0)){var ma=fa,yt=!d[ma];yt&&(d[ma]=!0),c.push(n(fa,Pe,se,mn,_i,La,mt,kt,zi,Sa,Ra,yt))}}}function nt(Pe,se){var mt=s[Pe][se],kt=s[Pe][se+1],mn,_i,zi,Sa;return mt[0]<kt[0]?(mn=mt[0],_i=kt[0]):(mn=kt[0],_i=mt[0]),mt[1]<kt[1]?(zi=mt[1],Sa=kt[1]):(zi=kt[1],Sa=mt[1]),{minX:mn,minY:zi,maxX:_i,maxY:Sa,ring:Pe,edge:se}}}function intersect(t,n,o,s){if(equalArrays(t,o)||equalArrays(t,s)||equalArrays(n,o)||equalArrays(s,o))return null;var c=t[0],d=t[1],h=n[0],p=n[1],y=o[0],S=o[1],P=s[0],L=s[1],F=(c-h)*(S-L)-(d-p)*(y-P);if(F===0)return null;var N=((c*p-d*h)*(y-P)-(c-h)*(y*L-S*P))/F,z=((c*p-d*h)*(S-L)-(d-p)*(y*L-S*P))/F;return[N,z]}function equalArrays(t,n){if(!t||!n||t.length!==n.length)return!1;for(var o=0,s=t.length;o<s;o++)if(t[o]instanceof Array&&n[o]instanceof Array){if(!equalArrays(t[o],n[o]))return!1}else if(t[o]!==n[o])return!1;return!0}function simplepolygon(t){if(t.type!="Feature")throw new Error("The input must a geojson object of type Feature");if(t.geometry===void 0||t.geometry==null)throw new Error("The input must a geojson object with a non-empty geometry");if(t.geometry.type!="Polygon")throw new Error("The input must be a geojson Polygon");for(var n=t.geometry.coordinates.length,o=[],se=0;se<n;se++){var s=t.geometry.coordinates[se];equalArrays$1(s[0],s[s.length-1])||s.push(s[0]),o.push.apply(o,s.slice(0,s.length-1))}if(!isUnique(o))throw new Error("The input polygon may not have duplicate vertices (except for the first and last vertex of each ring)");var c=o.length,d=isects(t,function(Vd,Gd,uf,ff,pf,hf,of,gf,Ef,xf,Wa,af){return[Vd,Gd,uf,ff,pf,hf,of,gf,Ef,xf,Wa,af]}),h=d.length;if(h==0){for(var zi=[],se=0;se<n;se++)zi.push(polygon([t.geometry.coordinates[se]],{parent:-1,winding:windingOfRing(t.geometry.coordinates[se])}));var Xs=featureCollection$2(zi);return Nl(),pu(),Xs}for(var p=[],y=[],se=0;se<n;se++){p.push([]);for(var S=0;S<t.geometry.coordinates[se].length-1;S++)p[se].push([new PseudoVtx(t.geometry.coordinates[se][modulo(S+1,t.geometry.coordinates[se].length-1)],1,[se,S],[se,modulo(S+1,t.geometry.coordinates[se].length-1)],void 0)]),y.push(new Isect(t.geometry.coordinates[se][S],[se,modulo(S-1,t.geometry.coordinates[se].length-1)],[se,S],void 0,void 0,!1,!0))}for(var se=0;se<h;se++)p[d[se][1]][d[se][2]].push(new PseudoVtx(d[se][0],d[se][5],[d[se][1],d[se][2]],[d[se][6],d[se][7]],void 0)),d[se][11]&&y.push(new Isect(d[se][0],[d[se][1],d[se][2]],[d[se][6],d[se][7]],void 0,void 0,!0,!0));for(var P=y.length,se=0;se<p.length;se++)for(var S=0;S<p[se].length;S++)p[se][S].sort(function(Gd,uf){return Gd.param<uf.param?-1:1});for(var L=[],se=0;se<P;se++)L.push({minX:y[se].coord[0],minY:y[se].coord[1],maxX:y[se].coord[0],maxY:y[se].coord[1],index:se});var F=rbush$1();F.load(L);for(var se=0;se<p.length;se++)for(var S=0;S<p[se].length;S++)for(var N=0;N<p[se][S].length;N++){var z;N==p[se][S].length-1?z=p[se][modulo(S+1,t.geometry.coordinates[se].length-1)][0].coord:z=p[se][S][N+1].coord;var W=F.search({minX:z[0],minY:z[1],maxX:z[0],maxY:z[1]})[0];p[se][S][N].nxtIsectAlongEdgeIn=W.index}for(var se=0;se<p.length;se++)for(var S=0;S<p[se].length;S++)for(var N=0;N<p[se][S].length;N++){var z=p[se][S][N].coord,W=F.search({minX:z[0],minY:z[1],maxX:z[0],maxY:z[1]})[0],nt=W.index;nt<c?y[nt].nxtIsectAlongRingAndEdge2=p[se][S][N].nxtIsectAlongEdgeIn:equalArrays$1(y[nt].ringAndEdge1,p[se][S][N].ringAndEdgeIn)?y[nt].nxtIsectAlongRingAndEdge1=p[se][S][N].nxtIsectAlongEdgeIn:y[nt].nxtIsectAlongRingAndEdge2=p[se][S][N].nxtIsectAlongEdgeIn}for(var Pe=[],se=0,S=0;S<n;S++){for(var mt=se,N=0;N<t.geometry.coordinates[S].length-1;N++)y[se].coord[0]<y[mt].coord[0]&&(mt=se),se++;for(var kt=y[mt].nxtIsectAlongRingAndEdge2,N=0;N<y.length;N++)if(y[N].nxtIsectAlongRingAndEdge1==mt||y[N].nxtIsectAlongRingAndEdge2==mt){var mn=N;break}var _i=isConvex([y[mn].coord,y[mt].coord,y[kt].coord],!0)?1:-1;Pe.push({isect:mt,parent:-1,winding:_i})}Pe.sort(function(Ru,Vd){return y[Ru.isect].coord>y[Vd.isect].coord?-1:1});for(var zi=[];Pe.length>0;){var Sa=Pe.pop(),fa=Sa.isect,La=Sa.parent,Ra=Sa.winding,ma=zi.length,yt=[y[fa].coord],lt=fa;if(y[fa].ringAndEdge1Walkable)var pi=y[fa].ringAndEdge1,ba=y[fa].nxtIsectAlongRingAndEdge1;else var pi=y[fa].ringAndEdge2,ba=y[fa].nxtIsectAlongRingAndEdge2;for(;!equalArrays$1(y[fa].coord,y[ba].coord);){yt.push(y[ba].coord);for(var Sc=void 0,se=0;se<Pe.length;se++)if(Pe[se].isect==ba){Sc=se;break}if(Sc!=null&&Pe.splice(Sc,1),equalArrays$1(pi,y[ba].ringAndEdge1)){if(pi=y[ba].ringAndEdge2,y[ba].ringAndEdge2Walkable=!1,y[ba].ringAndEdge1Walkable){var ms={isect:ba};isConvex([y[lt].coord,y[ba].coord,y[y[ba].nxtIsectAlongRingAndEdge2].coord],Ra==1)?(ms.parent=La,ms.winding=-Ra):(ms.parent=ma,ms.winding=Ra),Pe.push(ms)}lt=ba,ba=y[ba].nxtIsectAlongRingAndEdge2}else{if(pi=y[ba].ringAndEdge1,y[ba].ringAndEdge1Walkable=!1,y[ba].ringAndEdge2Walkable){var ms={isect:ba};isConvex([y[lt].coord,y[ba].coord,y[y[ba].nxtIsectAlongRingAndEdge1].coord],Ra==1)?(ms.parent=La,ms.winding=-Ra):(ms.parent=ma,ms.winding=Ra),Pe.push(ms)}lt=ba,ba=y[ba].nxtIsectAlongRingAndEdge1}}yt.push(y[ba].coord),zi.push(polygon([yt],{index:ma,parent:La,winding:Ra,netWinding:void 0}))}var Xs=featureCollection$2(zi);Nl(),pu();function Nl(){for(var Ru=[],Vd=0;Vd<Xs.features.length;Vd++)Xs.features[Vd].properties.parent==-1&&Ru.push(Vd);if(Ru.length>1)for(var Vd=0;Vd<Ru.length;Vd++){for(var Gd=-1,uf=1/0,ff=0;ff<Xs.features.length;ff++)Ru[Vd]!=ff&&booleanPointInPolygon(Xs.features[Ru[Vd]].geometry.coordinates[0][0],Xs.features[ff],{ignoreBoundary:!0})&&area(Xs.features[ff])<uf&&(Gd=ff);Xs.features[Ru[Vd]].properties.parent=Gd}}function pu(){for(var Ru=0;Ru<Xs.features.length;Ru++)if(Xs.features[Ru].properties.parent==-1){var Vd=Xs.features[Ru].properties.winding;Xs.features[Ru].properties.netWinding=Vd,yu(Ru,Vd)}}function yu(Ru,Vd){for(var Gd=0;Gd<Xs.features.length;Gd++)if(Xs.features[Gd].properties.parent==Ru){var uf=Vd+Xs.features[Gd].properties.winding;Xs.features[Gd].properties.netWinding=uf,yu(Gd,uf)}}return Xs}var PseudoVtx=function(t,n,o,s,c){this.coord=t,this.param=n,this.ringAndEdgeIn=o,this.ringAndEdgeOut=s,this.nxtIsectAlongEdgeIn=c},Isect=function(t,n,o,s,c,d,h){this.coord=t,this.ringAndEdge1=n,this.ringAndEdge2=o,this.nxtIsectAlongRingAndEdge1=s,this.nxtIsectAlongRingAndEdge2=c,this.ringAndEdge1Walkable=d,this.ringAndEdge2Walkable=h};function isConvex(t,n){if(typeof n>"u"&&(n=!0),t.length!=3)throw new Error("This function requires an array of three points [x,y]");var o=(t[1][0]-t[0][0])*(t[2][1]-t[0][1])-(t[1][1]-t[0][1])*(t[2][0]-t[0][0]);return o>=0==n}function windingOfRing(t){for(var n=0,o=0;o<t.length-1;o++)t[o][0]<t[n][0]&&(n=o);if(isConvex([t[modulo(n-1,t.length-1)],t[n],t[modulo(n+1,t.length-1)]],!0))var s=1;else var s=-1;return s}function equalArrays$1(t,n){if(!t||!n||t.length!=n.length)return!1;for(var o=0,s=t.length;o<s;o++)if(t[o]instanceof Array&&n[o]instanceof Array){if(!equalArrays$1(t[o],n[o]))return!1}else if(t[o]!=n[o])return!1;return!0}function modulo(t,n){return(t%n+n)%n}function isUnique(t){for(var n={},o=1,s=0,c=t.length;s<c;++s){if(Object.prototype.hasOwnProperty.call(n,t[s])){o=0;break}n[t[s]]=1}return o}function unkinkPolygon(t){var n=[];return flattenEach(t,function(o){o.geometry.type==="Polygon"&&featureEach(simplepolygon(o),function(s){n.push(polygon(s.geometry.coordinates,o.properties))})}),featureCollection$2(n)}function isNotNullish(t){return t!=null}function coordinatesToPositionsArray(t){return t.map(n=>n.map(([o,s])=>Cartesian3.fromDegrees(o,s,0)))}function convertGeometryToPositionsArray(t){return(t.type==="LineString"?coordinatesToPositionsArray([t.coordinates]):t.type==="Polygon"?coordinatesToPositionsArray(t.coordinates):t.coordinates.flatMap(n=>coordinatesToPositionsArray(n))).filter(({length:n})=>n>0)}function coordinatesToHierarchy(t){return t.length>0?{positions:t[0].map(([n,o])=>Cartesian3.fromDegrees(n,o,0)),holes:t.slice(1).map(n=>({positions:n.map(([o,s])=>Cartesian3.fromDegrees(o,s,0)),holes:[]}))}:void 0}function convertPolygonToHierarchyArray(t){return unkinkPolygon(t).features.map(o=>coordinatesToHierarchy(o.geometry.coordinates)).filter(isNotNullish)}const fontScale=5,scaleByDistance=new NearFarScalar(0,1/fontScale,Number.POSITIVE_INFINITY,1/fontScale),defaultStyle={default:{fontFamily:"sans-serif",fillColor:Color$1.BLACK,outlineColor:Color$1.WHITE.withAlpha(.8),outlineWidth:5},municipalities:{fontSize:12},towns:{fontSize:8,fillColor:Color$1.BLACK.withAlpha(.6)},roads:{fontSize:8},railways:{fontSize:8},stations:{fontSize:9},landmarks:{fontSize:8},topography:{fontSize:8,fillColor:Color$1.BLACK.withAlpha(.6)}};function resolveStyle(t,n){const o=getAnnotationType(t);if(o==null)return;const s=n==null?void 0:n[o];if(s===!1)return;const c=merge({},defaultStyle.default,defaultStyle[o],n==null?void 0:n.default,s),d=Object.fromEntries(Object.entries(c).map(([h,p])=>[h,typeof p=="string"&&isColor(p)?toColor$1(p):p]));return{scaleByDistance,...omit(d,["fontSize","fontFamily"]),font:(d==null?void 0:d.fontSize)!=null&&d.fontFamily!=null?`${d.fontSize*fontScale}pt ${d.fontFamily}`:void 0}}const positionScratch$1=new Cartesian3,cartographicScratch$1=new Cartographic;function getPosition(t,n,o,s,c,d,h,p=new Cartesian3){let y=n.geom[0][0].x/c,S=n.geom[0][0].y/c;if(t.level===17&&(y=y*2-t.x%2,S=S*2-t.y%2),y<0||y>1||S<0||S>1)return;const P=Cartographic.fromRadians(o.west+o.width*y,o.south+o.height*(1-S),d,cartographicScratch$1);if((s==null?void 0:s.some(L=>Rectangle.contains(L,P)))!==!0)return Cartographic.toCartesian(P,h,p)}const JapanGSIOptimalBVmapLabelImagery=React.memo(({imageryProvider:t,imagery:n,descendants:o,height:s=50,style:c=defaultStyle,labelCollection:d,near:h,far:p})=>{const y=$e$1(),S=suspend(async()=>await t.tileCache.get(getTileCoords(n,16)),[JapanGSIOptimalBVmapLabelImagery,n.key]),P=React.useMemo(()=>t.tilingScheme.tileXYToRectangle(n.x,n.y,n.level),[t,n]),L=React.useMemo(()=>o==null?void 0:o.map(Pe=>t.tilingScheme.tileXYToRectangle(Pe.x,Pe.y,Pe.level)),[t,o]),F=React.useMemo(()=>{const Pe=S.get("Anno");return Pe==null?[]:Pe.filter(se=>typeof se.props.vt_code=="number"&&`${se.props.vt_code}`.length===3&&typeof se.props.vt_text=="string"&&(se.props.vt_arrng==null||typeof se.props.vt_arrng=="number")&&(se.props.vt_arrngagl==null||typeof se.props.vt_arrngagl=="number")&&(n.level<16||n.level===16&&se.props.vt_flag17!==2||n.level===17&&se.props.vr_flag17!==0))},[S,n]),N=React.useRef(),z=y==null?void 0:y.scene,W=React.useCallback(()=>{const Pe=N.current;Pe!=null&&(Pe.forEach(([se,mt])=>{var mn;const kt=getPosition(n,se,P,L,t.tileCache.tileSize,s,(mn=z==null?void 0:z.globe)==null?void 0:mn.ellipsoid,positionScratch$1);kt!=null?(mt.position=kt,mt.show=!0):mt.show=!1}),z==null||z.requestRender())},[t,n,s,P,L,z]),nt=React.useRef(W);return nt.current=W,React.useEffect(()=>{if(!z||!d)return;const Pe=[],se=F.map(kt=>{const mn=resolveStyle(kt.props.vt_code,c);if(mn==null)return;const _i=kt.props.vt_text;if(Pe.includes(_i))return;Pe.push(_i);const zi={text:_i,style:LabelStyle$1.FILL_AND_OUTLINE,horizontalOrigin:HorizontalOrigin$1.CENTER,verticalOrigin:VerticalOrigin$1.BOTTOM,heightReference:HeightReference$1.CLAMP_TO_GROUND,distanceDisplayCondition:h||p?new Cesium$1.DistanceDisplayCondition(h,p):void 0,disableDepthTestDistance:1/0,...mn};return[kt,d.add(zi)]}).filter(isNotNullish);N.current=se,nt.current();const mt=()=>{d.isDestroyed()||se.forEach(([,kt])=>{d.remove(kt)}),z.isDestroyed()||z==null||z.postRender.removeEventListener(mt)};return()=>{N.current=void 0,z.isDestroyed()||z==null||z.postRender.addEventListener(mt)}},[c,F,z,d,h,p]),React.useEffect(()=>{W()},[W]),null});JapanGSIOptimalBVmapLabelImagery.displayName="JapanGSIOptimalBVmapLabelImagery";const hasMethod=t=>n=>n!=null&&typeof n=="object"&&t in n&&typeof n[t]=="function";function createDestructor(t,n){if(t.owner!=null){invariant$1(t.transferOwnership!=null);const o=t.owner,s=t.transferOwnership(n,t.owner);return()=>{(!hasMethod("isDestroyed")(o)||!o.isDestroyed())&&s()}}else{const o=t.destroy;return()=>{typeof o=="function"?o(n):o!==null&&hasMethod("destroy")(n)&&n.destroy()}}}function useInstance(t){const[n,o]=React.useState(),s=React.useRef();return s.current==null&&(s.current=t.create()),React.useEffect(()=>{s.current==null&&(s.current=t.create(),o(s.current));const c=s.current,d=createDestructor(t,c);return()=>{d(),s.current=void 0,o(void 0)}},[t.owner,...t.keys]),n??s.current}const LabelImageryLayer=React.forwardRef(function({url:n,tilingScheme:o,tileWidth:s,tileHeight:c,minimumLevel:d,maximumLevel:h,minimumDataLevel:p,maximumDataLevel:y,...S},P){const L=useInstance({keys:[n,o,s,c,p,y],create:()=>new JapanGSIOptimalBVmapLabelImageryProvider({url:n,tilingScheme:o??new Cesium$1.WebMercatorTilingScheme,tileWidth:s,tileHeight:c,minimumDataLevel:p,maximumDataLevel:y})});return Object.assign(L,{minimumLevel:d,maximumLevel:h}),jsxRuntimeExports.jsx(Ns$1,{ref:P,imageryProvider:L,...S})});function getAncestorKeys(t,n){if(t.level===n)return[];const o=2**t.level,s=t.x/o,c=t.y/o;return[...Array(t.level-n)].map((d,h)=>{const p=t.level-(h+1),y=2**p;return makeKey({x:Math.floor(s*y),y:Math.floor(c*y),level:p})})}function isEqualKeys(t,n){return n!=null&&t.length===n.length&&xorBy(t,n,"key").length===0}function getImageriesToRender(t,n){const o=t.globe;let s=1/0,c=-1/0;const d=uniqBy(o._surface._tilesToRender.flatMap(p=>{var y;return((y=p.data)==null?void 0:y.imagery.map(S=>S.readyImagery).filter(S=>(S==null?void 0:S.imageryLayer.imageryProvider)!==n?!1:(S.key=makeKey(S),S.level<s&&(s=S.level),S.level>c&&(c=S.level),!0)))??[]}),"key").sort((p,y)=>p.key.localeCompare(y.key));if(s===c||s===1/0||c===-1/0)return d;const h=fromPairs(d.map(p=>[p.key,{imagery:p,children:[],descendants:[]}]));return d.forEach(p=>{getAncestorKeys(p,s).forEach(S=>{const P=h[S];P!=null&&(P.descendants.push(p),p.level-P.imagery.level===1&&P.children.push(p))})}),Object.values(h).forEach(({imagery:p,children:y,descendants:S})=>{isEqualKeys(y,p.children)||(p.children=y),isEqualKeys(S,p.descendants)||(p.descendants=S)}),d.filter(p=>p.children!=null&&p.children.length<4)}const LabelImageryCollection=({imageryProvider:t,imageriesAtom:n,style:o,labelCollection:s,near:c,far:d})=>{const h=useAtomValue(n);return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:h.map(p=>jsxRuntimeExports.jsx(React.Suspense,{children:jsxRuntimeExports.jsx(JapanGSIOptimalBVmapLabelImagery,{imageryProvider:t,imagery:p,descendants:p.descendants,style:o,labelCollection:s,near:c,far:d})},p.key))})},JapanGSIOptimalBVmapVectorMapLabel=({style:t,near:n,far:o})=>{const[s,c]=React.useState(),d=React.useCallback(N=>{var z;c(((z=N==null?void 0:N.cesiumElement)==null?void 0:z.imageryProvider)instanceof JapanGSIOptimalBVmapLabelImageryProvider?N.cesiumElement.imageryProvider:void 0)},[]),h=React.useMemo(()=>{const N=atom([]);return atom(z=>z(N),(z,W,nt)=>{const Pe=z(N),se=typeof nt=="function"?nt(Pe):nt;Pe.length!==se.length&&xorBy(Pe,se,"key").length>0&&W(N,se)})},[]),p=useSetAtom(h);usePreRender(N=>{if(s==null)return;const z=getImageriesToRender(N,s);p(z)});const{labelCollection:y,scene:S}=$e$1(),P=React.useRef(!1),L=React.useMemo(()=>y??(S?new Cesium$1.LabelCollection({scene:S}):void 0),[S,y]);React.useEffect(()=>{!y&&S&&!P.current&&(S.primitives.add(L),P.current=!0)},[y,L,S]);const F=React.useRef(0);return usePreRender(N=>{L&&F.current!==L._labelsToUpdate.length&&(N.requestRender(),F.current=L._labelsToUpdate.length)}),React.useEffect(()=>()=>{S!=null&&S.isDestroyed()||S==null||S.requestRender()},[S]),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(LabelImageryLayer,{ref:d,url:"https://cyberjapandata.gsi.go.jp/xyz/optimal_bvmap-v1/{z}/{x}/{y}.pbf",tileWidth:1024,tileHeight:1024,maximumLevel:17,minimumDataLevel:4,maximumDataLevel:16}),s!=null&&jsxRuntimeExports.jsx(LabelImageryCollection,{imageryProvider:s,imageriesAtom:h,style:t,labelCollection:L,near:n,far:o})]})},LabelImageryLayers=React.memo(({tileLabels:t=[]})=>jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:t.map(n=>{if(!n)return null;switch(n.labelType){case"japan_gsi_optimal_bvmap":return jsxRuntimeExports.jsx(JapanGSIOptimalBVmapVectorMapLabel,{style:n.style,near:n.near,far:n.far},n.id);default:return null}})}),(t,n)=>isEqual(t.tileLabels,n.tileLabels));LabelImageryLayers.displayName="LabelImageryLayers";function Event({onMount:t,onUnmount:n}){return React.useEffect(()=>(t==null||t(),()=>n==null?void 0:n()),[t,n]),null}const perf=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,warned$1=new Set,emitWarning$1=(t,n,o,s)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(t,n,o,s):console.error(`[${o}] ${n}: ${t}`)},shouldWarn=t=>!warned$1.has(t),isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),getUintArray=t=>isPosInt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null:null;class ZeroArray extends Array{constructor(n){super(n),this.fill(0)}}const Am=class Am{constructor(n,o){Rf(this,"heap");Rf(this,"length");if(!ef(Am,Om))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new o(n),this.length=0}static create(n){const o=getUintArray(n);if(!o)return[];zf(Am,Om,!0);const s=new Am(n,o);return zf(Am,Om,!1),s}push(n){this.heap[this.length++]=n}pop(){return this.heap[--this.length]}};Om=new WeakMap,Jf(Am,Om,!1);let Stack=Am;const ig=class ig{constructor(n){Jf(this,Bp);Jf(this,Qp);Jf(this,Pp);Jf(this,Ip);Jf(this,Yp);Jf(this,Wp);Jf(this,Zp);Jf(this,tp);Jf(this,jp);Jf(this,zp);Jf(this,Dm,void 0);Jf(this,dp,void 0);Jf(this,Sp,void 0);Jf(this,Ep,void 0);Jf(this,Up,void 0);Rf(this,"ttl");Rf(this,"ttlResolution");Rf(this,"ttlAutopurge");Rf(this,"updateAgeOnGet");Rf(this,"updateAgeOnHas");Rf(this,"allowStale");Rf(this,"noDisposeOnSet");Rf(this,"noUpdateTTL");Rf(this,"maxEntrySize");Rf(this,"sizeCalculation");Rf(this,"noDeleteOnFetchRejection");Rf(this,"noDeleteOnStaleGet");Rf(this,"allowStaleOnFetchAbort");Rf(this,"allowStaleOnFetchRejection");Rf(this,"ignoreFetchAbort");Jf(this,lp,void 0);Jf(this,Tp,void 0);Jf(this,up,void 0);Jf(this,ip,void 0);Jf(this,$f,void 0);Jf(this,bp,void 0);Jf(this,_p,void 0);Jf(this,gp,void 0);Jf(this,hp,void 0);Jf(this,wp,void 0);Jf(this,pp,void 0);Jf(this,Vp,void 0);Jf(this,Lp,void 0);Jf(this,Rp,void 0);Jf(this,Mp,void 0);Jf(this,Ap,void 0);Jf(this,vp,void 0);Jf(this,Np,()=>{});Jf(this,Op,()=>{});Jf(this,$p,()=>{});Jf(this,xp,()=>!1);Jf(this,kp,n=>{});Jf(this,Xp,(n,o,s)=>{});Jf(this,Hp,(n,o,s,c)=>{if(s||c)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});const{max:o=0,ttl:s,ttlResolution:c=1,ttlAutopurge:d,updateAgeOnGet:h,updateAgeOnHas:p,allowStale:y,dispose:S,disposeAfter:P,noDisposeOnSet:L,noUpdateTTL:F,maxSize:N=0,maxEntrySize:z=0,sizeCalculation:W,fetchMethod:nt,noDeleteOnFetchRejection:Pe,noDeleteOnStaleGet:se,allowStaleOnFetchRejection:mt,allowStaleOnFetchAbort:kt,ignoreFetchAbort:mn}=n;if(o!==0&&!isPosInt(o))throw new TypeError("max option must be a nonnegative integer");const _i=o?getUintArray(o):Array;if(!_i)throw new Error("invalid max value: "+o);if(zf(this,Dm,o),zf(this,dp,N),this.maxEntrySize=z||ef(this,dp),this.sizeCalculation=W,this.sizeCalculation){if(!ef(this,dp)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(nt!==void 0&&typeof nt!="function")throw new TypeError("fetchMethod must be a function if specified");if(zf(this,Up,nt),zf(this,Ap,!!nt),zf(this,up,new Map),zf(this,ip,new Array(o).fill(void 0)),zf(this,$f,new Array(o).fill(void 0)),zf(this,bp,new _i(o)),zf(this,_p,new _i(o)),zf(this,gp,0),zf(this,hp,0),zf(this,wp,Stack.create(o)),zf(this,lp,0),zf(this,Tp,0),typeof S=="function"&&zf(this,Sp,S),typeof P=="function"?(zf(this,Ep,P),zf(this,pp,[])):(zf(this,Ep,void 0),zf(this,pp,void 0)),zf(this,Mp,!!ef(this,Sp)),zf(this,vp,!!ef(this,Ep)),this.noDisposeOnSet=!!L,this.noUpdateTTL=!!F,this.noDeleteOnFetchRejection=!!Pe,this.allowStaleOnFetchRejection=!!mt,this.allowStaleOnFetchAbort=!!kt,this.ignoreFetchAbort=!!mn,this.maxEntrySize!==0){if(ef(this,dp)!==0&&!isPosInt(ef(this,dp)))throw new TypeError("maxSize must be a positive integer if specified");if(!isPosInt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");kf(this,Qp,ug).call(this)}if(this.allowStale=!!y,this.noDeleteOnStaleGet=!!se,this.updateAgeOnGet=!!h,this.updateAgeOnHas=!!p,this.ttlResolution=isPosInt(c)||c===0?c:1,this.ttlAutopurge=!!d,this.ttl=s||0,this.ttl){if(!isPosInt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");kf(this,Bp,ag).call(this)}if(ef(this,Dm)===0&&this.ttl===0&&ef(this,dp)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!ef(this,Dm)&&!ef(this,dp)){const zi="LRU_CACHE_UNBOUNDED";shouldWarn(zi)&&(warned$1.add(zi),emitWarning$1("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",zi,ig))}}static unsafeExposeInternals(n){return{starts:ef(n,Lp),ttls:ef(n,Rp),sizes:ef(n,Vp),keyMap:ef(n,up),keyList:ef(n,ip),valList:ef(n,$f),next:ef(n,bp),prev:ef(n,_p),get head(){return ef(n,gp)},get tail(){return ef(n,hp)},free:ef(n,wp),isBackgroundFetch:o=>{var s;return kf(s=n,tp,op).call(s,o)},backgroundFetch:(o,s,c,d)=>{var h;return kf(h=n,Zp,ng).call(h,o,s,c,d)},moveToTail:o=>{var s;return kf(s=n,zp,Jp).call(s,o)},indexes:o=>{var s;return kf(s=n,Pp,Gp).call(s,o)},rindexes:o=>{var s;return kf(s=n,Ip,Dp).call(s,o)},isStale:o=>{var s;return ef(s=n,xp).call(s,o)}}}get max(){return ef(this,Dm)}get maxSize(){return ef(this,dp)}get calculatedSize(){return ef(this,Tp)}get size(){return ef(this,lp)}get fetchMethod(){return ef(this,Up)}get dispose(){return ef(this,Sp)}get disposeAfter(){return ef(this,Ep)}getRemainingTTL(n){return ef(this,up).has(n)?1/0:0}*entries(){for(const n of kf(this,Pp,Gp).call(this))ef(this,$f)[n]!==void 0&&ef(this,ip)[n]!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield[ef(this,ip)[n],ef(this,$f)[n]])}*rentries(){for(const n of kf(this,Ip,Dp).call(this))ef(this,$f)[n]!==void 0&&ef(this,ip)[n]!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield[ef(this,ip)[n],ef(this,$f)[n]])}*keys(){for(const n of kf(this,Pp,Gp).call(this)){const o=ef(this,ip)[n];o!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield o)}}*rkeys(){for(const n of kf(this,Ip,Dp).call(this)){const o=ef(this,ip)[n];o!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield o)}}*values(){for(const n of kf(this,Pp,Gp).call(this))ef(this,$f)[n]!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield ef(this,$f)[n])}*rvalues(){for(const n of kf(this,Ip,Dp).call(this))ef(this,$f)[n]!==void 0&&!kf(this,tp,op).call(this,ef(this,$f)[n])&&(yield ef(this,$f)[n])}[Symbol.iterator](){return this.entries()}find(n,o={}){for(const s of kf(this,Pp,Gp).call(this)){const c=ef(this,$f)[s],d=kf(this,tp,op).call(this,c)?c.__staleWhileFetching:c;if(d!==void 0&&n(d,ef(this,ip)[s],this))return this.get(ef(this,ip)[s],o)}}forEach(n,o=this){for(const s of kf(this,Pp,Gp).call(this)){const c=ef(this,$f)[s],d=kf(this,tp,op).call(this,c)?c.__staleWhileFetching:c;d!==void 0&&n.call(o,d,ef(this,ip)[s],this)}}rforEach(n,o=this){for(const s of kf(this,Ip,Dp).call(this)){const c=ef(this,$f)[s],d=kf(this,tp,op).call(this,c)?c.__staleWhileFetching:c;d!==void 0&&n.call(o,d,ef(this,ip)[s],this)}}purgeStale(){let n=!1;for(const o of kf(this,Ip,Dp).call(this,{allowStale:!0}))ef(this,xp).call(this,o)&&(this.delete(ef(this,ip)[o]),n=!0);return n}dump(){const n=[];for(const o of kf(this,Pp,Gp).call(this,{allowStale:!0})){const s=ef(this,ip)[o],c=ef(this,$f)[o],d=kf(this,tp,op).call(this,c)?c.__staleWhileFetching:c;if(d===void 0||s===void 0)continue;const h={value:d};if(ef(this,Rp)&&ef(this,Lp)){h.ttl=ef(this,Rp)[o];const p=perf.now()-ef(this,Lp)[o];h.start=Math.floor(Date.now()-p)}ef(this,Vp)&&(h.size=ef(this,Vp)[o]),n.unshift([s,h])}return n}load(n){this.clear();for(const[o,s]of n){if(s.start){const c=Date.now()-s.start;s.start=perf.now()-c}this.set(o,s.value,s)}}set(n,o,s={}){var F,N,z;const{ttl:c=this.ttl,start:d,noDisposeOnSet:h=this.noDisposeOnSet,sizeCalculation:p=this.sizeCalculation,status:y}=s;let{noUpdateTTL:S=this.noUpdateTTL}=s;const P=ef(this,Hp).call(this,n,o,s.size||0,p);if(this.maxEntrySize&&P>this.maxEntrySize)return y&&(y.set="miss",y.maxEntrySizeExceeded=!0),this.delete(n),this;let L=ef(this,lp)===0?void 0:ef(this,up).get(n);if(L===void 0)L=ef(this,lp)===0?ef(this,hp):ef(this,wp).length!==0?ef(this,wp).pop():ef(this,lp)===ef(this,Dm)?kf(this,Wp,tg).call(this,!1):ef(this,lp),ef(this,ip)[L]=n,ef(this,$f)[L]=o,ef(this,up).set(n,L),ef(this,bp)[ef(this,hp)]=L,ef(this,_p)[L]=ef(this,hp),zf(this,hp,L),eg(this,lp)._++,ef(this,Xp).call(this,L,P,y),y&&(y.set="add"),S=!1;else{kf(this,zp,Jp).call(this,L);const W=ef(this,$f)[L];if(o!==W){if(ef(this,Ap)&&kf(this,tp,op).call(this,W)?W.__abortController.abort(new Error("replaced")):h||(ef(this,Mp)&&((F=ef(this,Sp))==null||F.call(this,W,n,"set")),ef(this,vp)&&((N=ef(this,pp))==null||N.push([W,n,"set"]))),ef(this,kp).call(this,L),ef(this,Xp).call(this,L,P,y),ef(this,$f)[L]=o,y){y.set="replace";const nt=W&&kf(this,tp,op).call(this,W)?W.__staleWhileFetching:W;nt!==void 0&&(y.oldValue=nt)}}else y&&(y.set="update")}if(c!==0&&!ef(this,Rp)&&kf(this,Bp,ag).call(this),ef(this,Rp)&&(S||ef(this,$p).call(this,L,c,d),y&&ef(this,Op).call(this,y,L)),!h&&ef(this,vp)&&ef(this,pp)){const W=ef(this,pp);let nt;for(;nt=W==null?void 0:W.shift();)(z=ef(this,Ep))==null||z.call(this,...nt)}return this}pop(){var n;try{for(;ef(this,lp);){const o=ef(this,$f)[ef(this,gp)];if(kf(this,Wp,tg).call(this,!0),kf(this,tp,op).call(this,o)){if(o.__staleWhileFetching)return o.__staleWhileFetching}else if(o!==void 0)return o}}finally{if(ef(this,vp)&&ef(this,pp)){const o=ef(this,pp);let s;for(;s=o==null?void 0:o.shift();)(n=ef(this,Ep))==null||n.call(this,...s)}}}has(n,o={}){const{updateAgeOnHas:s=this.updateAgeOnHas,status:c}=o,d=ef(this,up).get(n);if(d!==void 0){const h=ef(this,$f)[d];if(kf(this,tp,op).call(this,h)&&h.__staleWhileFetching===void 0)return!1;if(ef(this,xp).call(this,d))c&&(c.has="stale",ef(this,Op).call(this,c,d));else return s&&ef(this,Np).call(this,d),c&&(c.has="hit",ef(this,Op).call(this,c,d)),!0}else c&&(c.has="miss");return!1}peek(n,o={}){const{allowStale:s=this.allowStale}=o,c=ef(this,up).get(n);if(c!==void 0&&(s||!ef(this,xp).call(this,c))){const d=ef(this,$f)[c];return kf(this,tp,op).call(this,d)?d.__staleWhileFetching:d}}async fetch(n,o={}){const{allowStale:s=this.allowStale,updateAgeOnGet:c=this.updateAgeOnGet,noDeleteOnStaleGet:d=this.noDeleteOnStaleGet,ttl:h=this.ttl,noDisposeOnSet:p=this.noDisposeOnSet,size:y=0,sizeCalculation:S=this.sizeCalculation,noUpdateTTL:P=this.noUpdateTTL,noDeleteOnFetchRejection:L=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:F=this.allowStaleOnFetchRejection,ignoreFetchAbort:N=this.ignoreFetchAbort,allowStaleOnFetchAbort:z=this.allowStaleOnFetchAbort,context:W,forceRefresh:nt=!1,status:Pe,signal:se}=o;if(!ef(this,Ap))return Pe&&(Pe.fetch="get"),this.get(n,{allowStale:s,updateAgeOnGet:c,noDeleteOnStaleGet:d,status:Pe});const mt={allowStale:s,updateAgeOnGet:c,noDeleteOnStaleGet:d,ttl:h,noDisposeOnSet:p,size:y,sizeCalculation:S,noUpdateTTL:P,noDeleteOnFetchRejection:L,allowStaleOnFetchRejection:F,allowStaleOnFetchAbort:z,ignoreFetchAbort:N,status:Pe,signal:se};let kt=ef(this,up).get(n);if(kt===void 0){Pe&&(Pe.fetch="miss");const mn=kf(this,Zp,ng).call(this,n,kt,mt,W);return mn.__returned=mn}else{const mn=ef(this,$f)[kt];if(kf(this,tp,op).call(this,mn)){const La=s&&mn.__staleWhileFetching!==void 0;return Pe&&(Pe.fetch="inflight",La&&(Pe.returnedStale=!0)),La?mn.__staleWhileFetching:mn.__returned=mn}const _i=ef(this,xp).call(this,kt);if(!nt&&!_i)return Pe&&(Pe.fetch="hit"),kf(this,zp,Jp).call(this,kt),c&&ef(this,Np).call(this,kt),Pe&&ef(this,Op).call(this,Pe,kt),mn;const zi=kf(this,Zp,ng).call(this,n,kt,mt,W),fa=zi.__staleWhileFetching!==void 0&&s;return Pe&&(Pe.fetch=_i?"stale":"refresh",fa&&_i&&(Pe.returnedStale=!0)),fa?zi.__staleWhileFetching:zi.__returned=zi}}get(n,o={}){const{allowStale:s=this.allowStale,updateAgeOnGet:c=this.updateAgeOnGet,noDeleteOnStaleGet:d=this.noDeleteOnStaleGet,status:h}=o,p=ef(this,up).get(n);if(p!==void 0){const y=ef(this,$f)[p],S=kf(this,tp,op).call(this,y);return h&&ef(this,Op).call(this,h,p),ef(this,xp).call(this,p)?(h&&(h.get="stale"),S?(h&&s&&y.__staleWhileFetching!==void 0&&(h.returnedStale=!0),s?y.__staleWhileFetching:void 0):(d||this.delete(n),h&&s&&(h.returnedStale=!0),s?y:void 0)):(h&&(h.get="hit"),S?y.__staleWhileFetching:(kf(this,zp,Jp).call(this,p),c&&ef(this,Np).call(this,p),y))}else h&&(h.get="miss")}delete(n){var s,c,d,h;let o=!1;if(ef(this,lp)!==0){const p=ef(this,up).get(n);if(p!==void 0)if(o=!0,ef(this,lp)===1)this.clear();else{ef(this,kp).call(this,p);const y=ef(this,$f)[p];kf(this,tp,op).call(this,y)?y.__abortController.abort(new Error("deleted")):(ef(this,Mp)||ef(this,vp))&&(ef(this,Mp)&&((s=ef(this,Sp))==null||s.call(this,y,n,"delete")),ef(this,vp)&&((c=ef(this,pp))==null||c.push([y,n,"delete"]))),ef(this,up).delete(n),ef(this,ip)[p]=void 0,ef(this,$f)[p]=void 0,p===ef(this,hp)?zf(this,hp,ef(this,_p)[p]):p===ef(this,gp)?zf(this,gp,ef(this,bp)[p]):(ef(this,bp)[ef(this,_p)[p]]=ef(this,bp)[p],ef(this,_p)[ef(this,bp)[p]]=ef(this,_p)[p]),eg(this,lp)._--,ef(this,wp).push(p)}}if(ef(this,vp)&&((d=ef(this,pp))!=null&&d.length)){const p=ef(this,pp);let y;for(;y=p==null?void 0:p.shift();)(h=ef(this,Ep))==null||h.call(this,...y)}return o}clear(){var n,o,s;for(const c of kf(this,Ip,Dp).call(this,{allowStale:!0})){const d=ef(this,$f)[c];if(kf(this,tp,op).call(this,d))d.__abortController.abort(new Error("deleted"));else{const h=ef(this,ip)[c];ef(this,Mp)&&((n=ef(this,Sp))==null||n.call(this,d,h,"delete")),ef(this,vp)&&((o=ef(this,pp))==null||o.push([d,h,"delete"]))}}if(ef(this,up).clear(),ef(this,$f).fill(void 0),ef(this,ip).fill(void 0),ef(this,Rp)&&ef(this,Lp)&&(ef(this,Rp).fill(0),ef(this,Lp).fill(0)),ef(this,Vp)&&ef(this,Vp).fill(0),zf(this,gp,0),zf(this,hp,0),ef(this,wp).length=0,zf(this,Tp,0),zf(this,lp,0),ef(this,vp)&&ef(this,pp)){const c=ef(this,pp);let d;for(;d=c==null?void 0:c.shift();)(s=ef(this,Ep))==null||s.call(this,...d)}}};Dm=new WeakMap,dp=new WeakMap,Sp=new WeakMap,Ep=new WeakMap,Up=new WeakMap,lp=new WeakMap,Tp=new WeakMap,up=new WeakMap,ip=new WeakMap,$f=new WeakMap,bp=new WeakMap,_p=new WeakMap,gp=new WeakMap,hp=new WeakMap,wp=new WeakMap,pp=new WeakMap,Vp=new WeakMap,Lp=new WeakMap,Rp=new WeakMap,Mp=new WeakMap,Ap=new WeakMap,vp=new WeakMap,Bp=new WeakSet,ag=function(){const n=new ZeroArray(ef(this,Dm)),o=new ZeroArray(ef(this,Dm));zf(this,Rp,n),zf(this,Lp,o),zf(this,$p,(d,h,p=perf.now())=>{if(o[d]=h!==0?p:0,n[d]=h,h!==0&&this.ttlAutopurge){const y=setTimeout(()=>{ef(this,xp).call(this,d)&&this.delete(ef(this,ip)[d])},h+1);y.unref&&y.unref()}}),zf(this,Np,d=>{o[d]=n[d]!==0?perf.now():0}),zf(this,Op,(d,h)=>{if(n[h]){const p=n[h],y=o[h];d.ttl=p,d.start=y,d.now=s||c(),d.remainingTTL=d.now+p-y}});let s=0;const c=()=>{const d=perf.now();if(this.ttlResolution>0){s=d;const h=setTimeout(()=>s=0,this.ttlResolution);h.unref&&h.unref()}return d};this.getRemainingTTL=d=>{const h=ef(this,up).get(d);return h===void 0?0:n[h]===0||o[h]===0?1/0:o[h]+n[h]-(s||c())},zf(this,xp,d=>n[d]!==0&&o[d]!==0&&(s||c())-o[d]>n[d])},Np=new WeakMap,Op=new WeakMap,$p=new WeakMap,xp=new WeakMap,Qp=new WeakSet,ug=function(){const n=new ZeroArray(ef(this,Dm));zf(this,Tp,0),zf(this,Vp,n),zf(this,kp,o=>{zf(this,Tp,ef(this,Tp)-n[o]),n[o]=0}),zf(this,Hp,(o,s,c,d)=>{if(kf(this,tp,op).call(this,s))return 0;if(!isPosInt(c))if(d){if(typeof d!="function")throw new TypeError("sizeCalculation must be a function");if(c=d(s,o),!isPosInt(c))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return c}),zf(this,Xp,(o,s,c)=>{if(n[o]=s,ef(this,dp)){const d=ef(this,dp)-n[o];for(;ef(this,Tp)>d;)kf(this,Wp,tg).call(this,!0)}zf(this,Tp,ef(this,Tp)+n[o]),c&&(c.entrySize=s,c.totalCalculatedSize=ef(this,Tp))})},kp=new WeakMap,Xp=new WeakMap,Hp=new WeakMap,Pp=new WeakSet,Gp=function*({allowStale:n=this.allowStale}={}){if(ef(this,lp))for(let o=ef(this,hp);!(!kf(this,Yp,og).call(this,o)||((n||!ef(this,xp).call(this,o))&&(yield o),o===ef(this,gp)));)o=ef(this,_p)[o]},Ip=new WeakSet,Dp=function*({allowStale:n=this.allowStale}={}){if(ef(this,lp))for(let o=ef(this,gp);!(!kf(this,Yp,og).call(this,o)||((n||!ef(this,xp).call(this,o))&&(yield o),o===ef(this,hp)));)o=ef(this,bp)[o]},Yp=new WeakSet,og=function(n){return n!==void 0&&ef(this,up).get(ef(this,ip)[n])===n},Wp=new WeakSet,tg=function(n){var d,h;const o=ef(this,gp),s=ef(this,ip)[o],c=ef(this,$f)[o];return ef(this,Ap)&&kf(this,tp,op).call(this,c)?c.__abortController.abort(new Error("evicted")):(ef(this,Mp)||ef(this,vp))&&(ef(this,Mp)&&((d=ef(this,Sp))==null||d.call(this,c,s,"evict")),ef(this,vp)&&((h=ef(this,pp))==null||h.push([c,s,"evict"]))),ef(this,kp).call(this,o),n&&(ef(this,ip)[o]=void 0,ef(this,$f)[o]=void 0,ef(this,wp).push(o)),ef(this,lp)===1?(zf(this,gp,zf(this,hp,0)),ef(this,wp).length=0):zf(this,gp,ef(this,bp)[o]),ef(this,up).delete(s),eg(this,lp)._--,o},Zp=new WeakSet,ng=function(n,o,s,c){const d=o===void 0?void 0:ef(this,$f)[o];if(kf(this,tp,op).call(this,d))return d;const h=new AbortController,{signal:p}=s;p==null||p.addEventListener("abort",()=>h.abort(p.reason),{signal:h.signal});const y={signal:h.signal,options:s,context:c},S=(W,nt=!1)=>{const{aborted:Pe}=h.signal,se=s.ignoreFetchAbort&&W!==void 0;if(s.status&&(Pe&&!nt?(s.status.fetchAborted=!0,s.status.fetchError=h.signal.reason,se&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),Pe&&!se&&!nt)return L(h.signal.reason);const mt=N;return ef(this,$f)[o]===N&&(W===void 0?mt.__staleWhileFetching?ef(this,$f)[o]=mt.__staleWhileFetching:this.delete(n):(s.status&&(s.status.fetchUpdated=!0),this.set(n,W,y.options))),W},P=W=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=W),L(W)),L=W=>{const{aborted:nt}=h.signal,Pe=nt&&s.allowStaleOnFetchAbort,se=Pe||s.allowStaleOnFetchRejection,mt=se||s.noDeleteOnFetchRejection,kt=N;if(ef(this,$f)[o]===N&&(!mt||kt.__staleWhileFetching===void 0?this.delete(n):Pe||(ef(this,$f)[o]=kt.__staleWhileFetching)),se)return s.status&&kt.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),kt.__staleWhileFetching;if(kt.__returned===kt)throw W},F=(W,nt)=>{var se;const Pe=(se=ef(this,Up))==null?void 0:se.call(this,n,d,y);Pe&&Pe instanceof Promise&&Pe.then(mt=>W(mt),nt),h.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(W(),s.allowStaleOnFetchAbort&&(W=mt=>S(mt,!0)))})};s.status&&(s.status.fetchDispatched=!0);const N=new Promise(F).then(S,P),z=Object.assign(N,{__abortController:h,__staleWhileFetching:d,__returned:void 0});return o===void 0?(this.set(n,z,{...y.options,status:void 0}),o=ef(this,up).get(n)):ef(this,$f)[o]=z,z},tp=new WeakSet,op=function(n){if(!ef(this,Ap))return!1;const o=n;return!!o&&o instanceof Promise&&o.hasOwnProperty("__staleWhileFetching")&&o.__abortController instanceof AbortController},jp=new WeakSet,sg=function(n,o){ef(this,_p)[o]=n,ef(this,bp)[n]=o},zp=new WeakSet,Jp=function(n){n!==ef(this,hp)&&(n===ef(this,gp)?zf(this,gp,ef(this,bp)[n]):kf(this,jp,sg).call(this,ef(this,_p)[n],ef(this,bp)[n]),kf(this,jp,sg).call(this,ef(this,hp),n),zf(this,hp,n))};let LRUCache=ig;const SIDE_PLANES=[new Cesium$1.Plane(new Cesium$1.Cartesian3(0,0,1),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,0,-1),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,1,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(0,-1,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(1,0,0),.5),new Cesium$1.Plane(new Cesium$1.Cartesian3(-1,0,0),.5)],CORNER_POINT_VECTORS=[new Cesium$1.Cartesian3(.5,.5,.5),new Cesium$1.Cartesian3(.5,-.5,.5),new Cesium$1.Cartesian3(-.5,-.5,.5),new Cesium$1.Cartesian3(-.5,.5,.5)],FACE_POINT_VECTORS=[new Cesium$1.Cartesian3(.5,0,0),new Cesium$1.Cartesian3(0,.5,0),new Cesium$1.Cartesian3(0,0,.5)],SCALE_POINT_VECTORS=[...CORNER_POINT_VECTORS,...FACE_POINT_VECTORS],SCALE_POINTS=SCALE_POINT_VECTORS.map(t=>({point:t,oppositePoint:Cesium$1.Cartesian3.multiplyByScalar(t,-1,new Cesium$1.Cartesian3)})),BOX_EDGES=CORNER_POINT_VECTORS.flatMap((t,n)=>{const o=t,s=Cesium$1.Cartesian3.clone(o,new Cesium$1.Cartesian3);s.z*=-1;const c=CORNER_POINT_VECTORS[(n+1)%4],d=Cesium$1.Cartesian3.clone(c,new Cesium$1.Cartesian3);return d.z*=-1,[{start:o,end:s,isDraggable:!0},{start:c,end:o},{start:d,end:s}]}),SIDE_PLANE_NAMES=["bottom","top","front","back","left","right"];var composeRefs$1={};Object.defineProperty(composeRefs$1,"__esModule",{value:!0});function composeRefs(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(t.length===2)return composeTwoRefs(t[0],t[1])||null;var o=t.slice(1).reduce(function(s,c){return composeTwoRefs(s,c)},t[0]);return o||null}var _default=composeRefs$1.default=composeRefs,composedRefCache=new WeakMap;function composeTwoRefs(t,n){if(t&&n){var o=composedRefCache.get(t)||new WeakMap;composedRefCache.set(t,o);var s=o.get(n)||function(c){updateRef(t,c),updateRef(n,c)};return o.set(n,s),s}return t||n}function updateRef(t,n){typeof t=="function"?t(n):t.current=n}var md5$1={exports:{}};/**
|
|
5833
5833
|
* [js-md5]{@link https://github.com/emn178/js-md5}
|
|
5834
5834
|
*
|
|
5835
5835
|
* @namespace md5
|
|
@@ -6742,7 +6742,7 @@ vec3 getTurboColormap(const float v) {
|
|
|
6742
6742
|
${reconstructPosition}
|
|
6743
6743
|
${turboColorMap}
|
|
6744
6744
|
${ambientOcclusionModulate}
|
|
6745
|
-
`,uniforms:{...pick(P,["color","frustumLength","blackPoint","whitePoint","gamma"]),globeDepthTexture:()=>(y==null?void 0:y())??F._depthTexture}});if(c){const N=createBilateralFilterStage({prefix:t,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:y,uniforms:{textureScale:n,...pick(P,["frustumLength","normalExponent","depthExponent"])}}),z=new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion_generate_and_filter`,stages:[L,N]});return F.uniforms.ambientOcclusionTexture=z.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[z,F],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:L,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:N,uniforms:["frustumLength","normalExponent","depthExponent"]},{stage:F,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}else return F.uniforms.ambientOcclusionTexture=L.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[L,F],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:L,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:F,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}const AmbientOcclusionStage=({enabled:t=!0,textureScale:n,directions:o,steps:s,denoise:c,accurateNormalReconstruction:d,outputType:h,useGlobeDepth:p,...y})=>{const{viewer:S}=$e$1(),P=S==null?void 0:S.scene,L=useInstance({owner:P==null?void 0:P.postProcessStages,keys:[n,s,o,c,d,h,p],create:()=>{const F=createAmbientOcclusionStage({textureScale:n,steps:s,directions:o,denoise:c,accurateNormalReconstruction:d,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:()=>P.context.uniformState.globeDepthTexture,uniforms:y});return F.enabled=t,F},transferOwnership:(F,N)=>(N==null||N.add(F),()=>{N==null||N.remove(F)})});return L.enabled=t,Object.assign(L.uniforms,y),P==null||P.requestRender(),usePreRender(()=>{const F=P==null?void 0:P.camera.frustum;if(F instanceof Cesium$1.PerspectiveFrustum){const N=1/Math.tan(F.fovy/2);L.uniforms.focalLength.x=N*F.aspectRatio,L.uniforms.focalLength.y=N}}),null},AmbientOcclusion=t=>{const n=$e$1(),[o,s]=React.useState(!1);return usePreRender(()=>{const c=n.scene;s(!(c!=null&&c.globe.depthTestAgainstTerrain));const{globeHeight:d}=c;if(!c||d==null)return;const h=c.camera.positionCartographic.height-d,p=c==null?void 0:c.camera.frustum;p instanceof Cesium$1.PerspectiveFrustum&&(c.camera.frustum.near=Cesium$1.Math.clamp(h-1,1,5)/Math.tan(p.fov/2))}),jsxRuntimeExports.jsx(AmbientOcclusionStage,{...t,useGlobeDepth:o})};var AmbientOcclusionOutputType=(t=>(t[t.Occlusion=1]="Occlusion",t[t.Normal=2]="Normal",t[t.Depth=3]="Depth",t[t.Weight=4]="Weight",t[t.Shade=5]="Shade",t))(AmbientOcclusionOutputType||{});const AMBIENT_OCCLUSION_QUALITY={low:{directions:4,steps:4,textureScale:.5,maxRadius:30},medium:{directions:4,steps:8,textureScale:.5,maxRadius:40},high:{directions:8,steps:8,textureScale:1,maxRadius:40},extreme:{directions:16,steps:16,textureScale:1,maxRadius:40}},DEFAULT_SKETCH_COLOR="#00bebe",DEFAULT_EDIT_COLOR="#3B3CD0",SELECTED_EDIT_COLOR="#FF9900",ADDING_POINT_COLOR="#3B3CD0";let drawPointImage,editPointImage,selectedPointImage,addingPointImage;const ControlPoint=({position:t,clampToGround:n=!1,index:o,isEditing:s,isSelected:c,isAddingPoint:d,isExtrudedControlPoint:h,handleControlPointMouseEvent:p})=>{const y=React.useRef(t);y.current=t;const S=useConstant$2(()=>new CallbackProperty((N,z)=>"getValue"in y.current?y.current.getValue(N,z):y.current,!1)),P=React.useMemo(()=>({position:S,billboard:{image:s?d?getAddingPointImage():c?getSelectedPointImage():getEditPointImage():getDrawPointImage(),width:s?16:8,height:s?16:8,heightReference:n?HeightReference$1.CLAMP_TO_GROUND:HeightReference$1.NONE,disableDepthTestDistance:1/0}}),[n,S,d,s,c]),L=React.useCallback(()=>{p==null||p(o,!!h,"mousedown")},[o,h,p]),F=React.useCallback(()=>{p==null||p(o,!!h,"click")},[o,h,p]);return jsxRuntimeExports.jsx(Is$1,{...P,onMouseDown:L,onClick:F})};function getDrawPointImage(){if(drawPointImage!=null)return drawPointImage;drawPointImage=document.createElement("canvas"),drawPointImage.width=16,drawPointImage.height=16;const t=drawPointImage.getContext("2d");return invariant$1(t!=null),t.fillStyle="white",t.fillRect(3,3,10,10),t.strokeStyle="black",t.lineWidth=2,t.strokeRect(3,3,10,10),drawPointImage}function getEditPointImage(){return getImage(editPointImage,{size:32,color:"white",strokeColor:DEFAULT_EDIT_COLOR})}function getSelectedPointImage(){return getImage(selectedPointImage,{size:32,color:"white",strokeColor:SELECTED_EDIT_COLOR})}function getAddingPointImage(){if(addingPointImage!=null)return addingPointImage;addingPointImage=document.createElement("canvas"),addingPointImage.width=32,addingPointImage.height=32;const t=addingPointImage.getContext("2d");return invariant$1(t!=null),t.beginPath(),t.arc(16,16,12,0,2*Math.PI),t.fillStyle="white",t.fill(),t.strokeStyle=ADDING_POINT_COLOR,t.lineWidth=4,t.stroke(),t.beginPath(),t.moveTo(16,8),t.lineTo(16,24),t.stroke(),t.moveTo(8,16),t.lineTo(24,16),t.stroke(),addingPointImage}function getImage(t,n){if(t!=null)return t;t=document.createElement("canvas"),t.width=n.size,t.height=n.size;const o=t.getContext("2d");return invariant$1(o!=null),o.beginPath(),o.arc(n.size/2,n.size/2,n.size/2-4,0,2*Math.PI),o.fillStyle=n.color,o.fill(),o.strokeStyle=n.strokeColor,o.lineWidth=4,o.stroke(),t}function assignForwardedRef(t,n){if(typeof t=="function")return t(n),()=>{t(null)};if(t!=null)return t.current=n,()=>{t.current=null}}const Entity=React.memo(React.forwardRef(({entities:t,...n},o)=>{const{viewer:s}=$e$1(),c=s==null?void 0:s.scene,d=s==null?void 0:s.entities,h=t??d,[p,y]=React.useState(()=>new Entity$1(n));return React.useEffect(()=>{y(new Entity$1(n))},[n.id]),React.useEffect(()=>(h==null||h.add(p),()=>{h==null||h.remove(p),c==null||c.requestRender()}),[c,h,p]),React.useEffect(()=>assignForwardedRef(o,p),[o,p]),Object.assign(p,omit(n,"id")),c==null||c.requestRender(),null})),textStyle={padding:"5px",color:"#fff",backgroundColor:"#000",borderRadius:"5px",lineHeight:1},MeasurementText=({children:t})=>jsxRuntimeExports.jsx("div",{style:textStyle,children:t}),MotionConfigContext=React.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),MotionContext=React.createContext({}),PresenceContext=React.createContext(null),isBrowser=typeof document<"u",useIsomorphicLayoutEffect$1=isBrowser?React.useLayoutEffect:React.useEffect,LazyContext=React.createContext({strict:!1}),camelToDash=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId),MotionGlobalConfig={skipAnimations:!1,useManualTiming:!1};class Queue{constructor(){this.order=[],this.scheduled=new Set}add(n){if(!this.scheduled.has(n))return this.scheduled.add(n),this.order.push(n),!0}remove(n){const o=this.order.indexOf(n);o!==-1&&(this.order.splice(o,1),this.scheduled.delete(n))}clear(){this.order.length=0,this.scheduled.clear()}}function createRenderStep(t){let n=new Queue,o=new Queue,s=0,c=!1,d=!1;const h=new WeakSet,p={schedule:(y,S=!1,P=!1)=>{const L=P&&c,F=L?n:o;return S&&h.add(y),F.add(y)&&L&&c&&(s=n.order.length),y},cancel:y=>{o.remove(y),h.delete(y)},process:y=>{if(c){d=!0;return}if(c=!0,[n,o]=[o,n],o.clear(),s=n.order.length,s)for(let S=0;S<s;S++){const P=n.order[S];h.has(P)&&(p.schedule(P),t()),P(y)}c=!1,d&&(d=!1,p.process(y))}};return p}const stepsOrder=["read","resolveKeyframes","update","preRender","render","postRender"],maxElapsed=40;function createRenderBatcher(t,n){let o=!1,s=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=stepsOrder.reduce((L,F)=>(L[F]=createRenderStep(()=>o=!0),L),{}),h=L=>{d[L].process(c)},p=()=>{const L=performance.now();o=!1,c.delta=s?1e3/60:Math.max(Math.min(L-c.timestamp,maxElapsed),1),c.timestamp=L,c.isProcessing=!0,stepsOrder.forEach(h),c.isProcessing=!1,o&&n&&(s=!1,t(p))},y=()=>{o=!0,s=!0,c.isProcessing||t(p)};return{schedule:stepsOrder.reduce((L,F)=>{const N=d[F];return L[F]=(z,W=!1,nt=!1)=>(o||y(),N.schedule(z,W,nt)),L},{}),cancel:L=>stepsOrder.forEach(F=>d[F].cancel(L)),state:c,steps:d}}const{schedule:microtask,cancel:cancelMicrotask}=createRenderBatcher(queueMicrotask,!1);function useVisualElement(t,n,o,s){const{visualElement:c}=React.useContext(MotionContext),d=React.useContext(LazyContext),h=React.useContext(PresenceContext),p=React.useContext(MotionConfigContext).reducedMotion,y=React.useRef();s=s||d.renderer,!y.current&&s&&(y.current=s(t,{visualState:n,parent:c,props:o,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:p}));const S=y.current;React.useInsertionEffect(()=>{S&&S.update(o,h)});const P=React.useRef(!!(o[optimizedAppearDataAttribute]&&!window.HandoffComplete));return useIsomorphicLayoutEffect$1(()=>{S&&(microtask.postRender(S.render),P.current&&S.animationState&&S.animationState.animateChanges())}),React.useEffect(()=>{S&&(S.updateFeatures(),!P.current&&S.animationState&&S.animationState.animateChanges(),P.current&&(P.current=!1,window.HandoffComplete=!0))}),S}function isRefObject(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function useMotionRef(t,n,o){return React.useCallback(s=>{s&&t.mount&&t.mount(s),n&&(s?n.mount(s):n.unmount()),o&&(typeof o=="function"?o(s):isRefObject(o)&&(o.current=s))},[n])}function isVariantLabel(t){return typeof t=="string"||Array.isArray(t)}function isAnimationControls(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(t){return isAnimationControls(t.animate)||variantProps.some(n=>isVariantLabel(t[n]))}function isVariantNode(t){return!!(isControllingVariants(t)||t.variants)}function getCurrentTreeVariants(t,n){if(isControllingVariants(t)){const{initial:o,animate:s}=t;return{initial:o===!1||isVariantLabel(o)?o:void 0,animate:isVariantLabel(s)?s:void 0}}return t.inherit!==!1?n:{}}function useCreateMotionContext(t){const{initial:n,animate:o}=getCurrentTreeVariants(t,React.useContext(MotionContext));return React.useMemo(()=>({initial:n,animate:o}),[variantLabelsAsDependency(n),variantLabelsAsDependency(o)])}function variantLabelsAsDependency(t){return Array.isArray(t)?t.join(" "):t}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const t in featureProps)featureDefinitions[t]={isEnabled:n=>featureProps[t].some(o=>!!n[o])};function loadFeatures(t){for(const n in t)featureDefinitions[n]={...featureDefinitions[n],...t[n]}}const LayoutGroupContext=React.createContext({}),SwitchLayoutGroupContext=React.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol");function createMotionComponent({preloadedFeatures:t,createVisualElement:n,useRender:o,useVisualState:s,Component:c}){t&&loadFeatures(t);function d(p,y){let S;const P={...React.useContext(MotionConfigContext),...p,layoutId:useLayoutId(p)},{isStatic:L}=P,F=useCreateMotionContext(p),N=s(p,L);if(!L&&isBrowser){F.visualElement=useVisualElement(c,N,P,n);const z=React.useContext(SwitchLayoutGroupContext),W=React.useContext(LazyContext).strict;F.visualElement&&(S=F.visualElement.loadFeatures(P,W,t,z))}return React__namespace.createElement(MotionContext.Provider,{value:F},S&&F.visualElement?React__namespace.createElement(S,{visualElement:F.visualElement,...P}):null,o(c,p,useMotionRef(N,F.visualElement,y),N,L,F.visualElement))}const h=React.forwardRef(d);return h[motionComponentSymbol]=c,h}function useLayoutId({layoutId:t}){const n=React.useContext(LayoutGroupContext).id;return n&&t!==void 0?n+"-"+t:t}function createMotionProxy(t){function n(s,c={}){return createMotionComponent(t(s,c))}if(typeof Proxy>"u")return n;const o=new Map;return new Proxy(n,{get:(s,c)=>(o.has(c)||o.set(c,n(c)),o.get(c))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(t){return typeof t!="string"||t.includes("-")?!1:!!(lowercaseSVGElements.indexOf(t)>-1||/[A-Z]/u.test(t))}const scaleCorrectors={};function addScaleCorrector(t){Object.assign(scaleCorrectors,t)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(t,{layout:n,layoutId:o}){return transformProps.has(t)||t.startsWith("origin")||(n||o!==void 0)&&(!!scaleCorrectors[t]||t==="opacity")}const isMotionValue=t=>!!(t&&t.getVelocity),translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(t,{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},s,c){let d="";for(let h=0;h<numTransforms;h++){const p=transformPropOrder[h];if(t[p]!==void 0){const y=translateAlias[p]||p;d+=`${y}(${t[p]}) `}}return n&&!t.z&&(d+="translateZ(0)"),d=d.trim(),c?d=c(t,s?"":d):o&&s&&(d="none"),d}const checkStringStartsWith=t=>n=>typeof n=="string"&&n.startsWith(t),isCSSVariableName=checkStringStartsWith("--"),startsAsVariableToken=checkStringStartsWith("var(--"),isCSSVariableToken=t=>startsAsVariableToken(t)?singleCssVariableRegex.test(t.split("/*")[0].trim()):!1,singleCssVariableRegex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,getValueAsType=(t,n)=>n&&typeof t=="number"?n.transform(t):t,clamp=(t,n,o)=>o>n?n:o<t?t:o,number={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},alpha={...number,transform:t=>clamp(0,1,t)},scale={...number,default:1},sanitize=t=>Math.round(t*1e5)/1e5,floatRegex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,colorRegex=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,singleColorRegex=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function isString$1(t){return typeof t=="string"}const createUnitType=t=>({test:n=>isString$1(n)&&n.endsWith(t)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${t}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:t=>percent.parse(t)/100,transform:t=>percent.transform(t*100)},int={...number,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,backgroundPositionX:px,backgroundPositionY:px,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(t,n,o,s){const{style:c,vars:d,transform:h,transformOrigin:p}=t;let y=!1,S=!1,P=!0;for(const L in n){const F=n[L];if(isCSSVariableName(L)){d[L]=F;continue}const N=numberValueTypes[L],z=getValueAsType(F,N);if(transformProps.has(L)){if(y=!0,h[L]=z,!P)continue;F!==(N.default||0)&&(P=!1)}else L.startsWith("origin")?(S=!0,p[L]=z):c[L]=z}if(n.transform||(y||s?c.transform=buildTransform(t.transform,o,P,s):c.transform&&(c.transform="none")),S){const{originX:L="50%",originY:F="50%",originZ:N=0}=p;c.transformOrigin=`${L} ${F} ${N}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(t,n,o){for(const s in n)!isMotionValue(n[s])&&!isForcedMotionValue(s,o)&&(t[s]=n[s])}function useInitialMotionValues({transformTemplate:t},n,o){return React.useMemo(()=>{const s=createHtmlRenderState();return buildHTMLStyles(s,n,{enableHardwareAcceleration:!o},t),Object.assign({},s.vars,s.style)},[n])}function useStyle(t,n,o){const s=t.style||{},c={};return copyRawValuesOnly(c,s,t),Object.assign(c,useInitialMotionValues(t,n,o)),c}function useHTMLProps(t,n,o){const s={},c=useStyle(t,n,o);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,c.userSelect=c.WebkitUserSelect=c.WebkitTouchCallout="none",c.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=c,s}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function isValidMotionProp(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||validMotionProps.has(t)}let shouldForward=t=>!isValidMotionProp(t);function loadExternalIsValidProp(t){t&&(shouldForward=n=>n.startsWith("on")?!isValidMotionProp(n):t(n))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch(t){}function filterProps(t,n,o){const s={};for(const c in t)c==="values"&&typeof t.values=="object"||(shouldForward(c)||o===!0&&isValidMotionProp(c)||!n&&!isValidMotionProp(c)||t.draggable&&c.startsWith("onDrag"))&&(s[c]=t[c]);return s}function calcOrigin$1(t,n,o){return typeof t=="string"?t:px.transform(n+o*t)}function calcSVGTransformOrigin(t,n,o){const s=calcOrigin$1(n,t.x,t.width),c=calcOrigin$1(o,t.y,t.height);return`${s} ${c}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(t,n,o=1,s=0,c=!0){t.pathLength=1;const d=c?dashKeys:camelKeys;t[d.offset]=px.transform(-s);const h=px.transform(n),p=px.transform(o);t[d.array]=`${h} ${p}`}function buildSVGAttrs(t,{attrX:n,attrY:o,attrScale:s,originX:c,originY:d,pathLength:h,pathSpacing:p=1,pathOffset:y=0,...S},P,L,F){if(buildHTMLStyles(t,S,P,F),L){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:N,style:z,dimensions:W}=t;N.transform&&(W&&(z.transform=N.transform),delete N.transform),W&&(c!==void 0||d!==void 0||z.transform)&&(z.transformOrigin=calcSVGTransformOrigin(W,c!==void 0?c:.5,d!==void 0?d:.5)),n!==void 0&&(N.x=n),o!==void 0&&(N.y=o),s!==void 0&&(N.scale=s),h!==void 0&&buildSVGPath(N,h,p,y,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=t=>typeof t=="string"&&t.toLowerCase()==="svg";function useSVGProps(t,n,o,s){const c=React.useMemo(()=>{const d=createSvgRenderState();return buildSVGAttrs(d,n,{enableHardwareAcceleration:!1},isSVGTag(s),t.transformTemplate),{...d.attrs,style:{...d.style}}},[n]);if(t.style){const d={};copyRawValuesOnly(d,t.style,t),c.style={...d,...c.style}}return c}function createUseRender(t=!1){return(o,s,c,{latestValues:d},h)=>{const y=(isSVGComponent(o)?useSVGProps:useHTMLProps)(s,d,h,o),S=filterProps(s,typeof o=="string",t),P=o!==React.Fragment?{...S,...y,ref:c}:{},{children:L}=s,F=React.useMemo(()=>isMotionValue(L)?L.get():L,[L]);return React.createElement(o,{...P,children:F})}}function renderHTML(t,{style:n,vars:o},s,c){Object.assign(t.style,n,c&&c.getProjectionStyles(s));for(const d in o)t.style.setProperty(d,o[d])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(t,n,o,s){renderHTML(t,n,void 0,s);for(const c in n.attrs)t.setAttribute(camelCaseAttributes.has(c)?c:camelToDash(c),n.attrs[c])}function scrapeMotionValuesFromProps$1(t,n,o){var s;const{style:c}=t,d={};for(const h in c)(isMotionValue(c[h])||n.style&&isMotionValue(n.style[h])||isForcedMotionValue(h,t)||((s=o==null?void 0:o.getValue(h))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(d[h]=c[h]);return d}function scrapeMotionValuesFromProps(t,n,o){const s=scrapeMotionValuesFromProps$1(t,n,o);for(const c in t)if(isMotionValue(t[c])||isMotionValue(n[c])){const d=transformPropOrder.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;s[d]=t[c]}return s}function resolveVariantFromProps(t,n,o,s={},c={}){return typeof n=="function"&&(n=n(o!==void 0?o:t.custom,s,c)),typeof n=="string"&&(n=t.variants&&t.variants[n]),typeof n=="function"&&(n=n(o!==void 0?o:t.custom,s,c)),n}function useConstant(t){const n=React.useRef(null);return n.current===null&&(n.current=t()),n.current}const isKeyframesTarget=t=>Array.isArray(t),isCustomValue=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),resolveFinalValueInKeyframes=t=>isKeyframesTarget(t)?t[t.length-1]||0:t;function resolveMotionValue(t){const n=isMotionValue(t)?t.get():t;return isCustomValue(n)?n.toValue():n}function makeState({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:o},s,c,d){const h={latestValues:makeLatestValues(s,c,d,t),renderState:n()};return o&&(h.mount=p=>o(s,p,h)),h}const makeUseVisualState=t=>(n,o)=>{const s=React.useContext(MotionContext),c=React.useContext(PresenceContext),d=()=>makeState(t,n,s,c);return o?d():useConstant(d)};function makeLatestValues(t,n,o,s){const c={},d=s(t,{});for(const F in d)c[F]=resolveMotionValue(d[F]);let{initial:h,animate:p}=t;const y=isControllingVariants(t),S=isVariantNode(t);n&&S&&!y&&t.inherit!==!1&&(h===void 0&&(h=n.initial),p===void 0&&(p=n.animate));let P=o?o.initial===!1:!1;P=P||h===!1;const L=P?p:h;return L&&typeof L!="boolean"&&!isAnimationControls(L)&&(Array.isArray(L)?L:[L]).forEach(N=>{const z=resolveVariantFromProps(t,N);if(!z)return;const{transitionEnd:W,transition:nt,...Pe}=z;for(const se in Pe){let mt=Pe[se];if(Array.isArray(mt)){const kt=P?mt.length-1:0;mt=mt[kt]}mt!==null&&(c[se]=mt)}for(const se in W)c[se]=W[se]}),c}const noop$1=t=>t,{schedule:frame,cancel:cancelFrame,state:frameData,steps}=createRenderBatcher(typeof requestAnimationFrame<"u"?requestAnimationFrame:noop$1,!0),svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(t,n,{renderState:o,latestValues:s})=>{frame.read(()=>{try{o.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{o.dimensions={x:0,y:0,width:0,height:0}}}),frame.render(()=>{buildSVGAttrs(o,s,{enableHardwareAcceleration:!1},isSVGTag(n.tagName),t.transformTemplate),renderSVG(n,o)})}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(t,{forwardMotionProps:n=!1},o,s){return{...isSVGComponent(t)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:o,useRender:createUseRender(n),createVisualElement:s,Component:t}}function addDomEvent(t,n,o,s={passive:!0}){return t.addEventListener(n,o,s),()=>t.removeEventListener(n,o)}const isPrimaryPointer=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function extractEventInfo(t,n="page"){return{point:{x:t[n+"X"],y:t[n+"Y"]}}}const addPointerInfo=t=>n=>isPrimaryPointer(n)&&t(n,extractEventInfo(n));function addPointerEvent(t,n,o,s){return addDomEvent(t,n,addPointerInfo(o),s)}const combineFunctions=(t,n)=>o=>n(t(o)),pipe=(...t)=>t.reduce(combineFunctions);function createLock(t){let n=null;return()=>{const o=()=>{n=null};return n===null?(n=t,o):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(t){let n=!1;if(t==="y")n=globalVerticalLock();else if(t==="x")n=globalHorizontalLock();else{const o=globalHorizontalLock(),s=globalVerticalLock();o&&s?n=()=>{o(),s()}:(o&&o(),s&&s())}return n}function isDragActive(){const t=getGlobalLock(!0);return t?(t(),!1):!0}class Feature{constructor(n){this.isMounted=!1,this.node=n}update(){}}function addHoverEvent(t,n){const o="pointer"+(n?"enter":"leave"),s="onHover"+(n?"Start":"End"),c=(d,h)=>{if(d.pointerType==="touch"||isDragActive())return;const p=t.getProps();t.animationState&&p.whileHover&&t.animationState.setActive("whileHover",n),p[s]&&p[s](d,h)};return addPointerEvent(t.current,o,c,{passive:!t.getProps()[s]})}class HoverGesture extends Feature{mount(){this.unmount=pipe(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(t,n)=>n?t===n?!0:isNodeOrChild(t,n.parentElement):!1;function fireSyntheticPointerEvent(t,n){if(!n)return;const o=new PointerEvent("pointer"+t);n(o,extractEventInfo(o))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$1,this.removeEndListeners=noop$1,this.removeAccessibleListeners=noop$1,this.startPointerPress=(n,o)=>{if(this.isPressing)return;this.removeEndListeners();const s=this.node.getProps(),d=addPointerEvent(window,"pointerup",(p,y)=>{if(!this.checkPressEnd())return;const{onTap:S,onTapCancel:P,globalTapTarget:L}=this.node.getProps();!L&&!isNodeOrChild(this.node.current,p.target)?P&&P(p,y):S&&S(p,y)},{passive:!(s.onTap||s.onPointerUp)}),h=addPointerEvent(window,"pointercancel",(p,y)=>this.cancelPress(p,y),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=pipe(d,h),this.startPress(n,o)},this.startAccessiblePress=()=>{const n=d=>{if(d.key!=="Enter"||this.isPressing)return;const h=p=>{p.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(y,S)=>{const{onTap:P}=this.node.getProps();P&&P(y,S)})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",h),fireSyntheticPointerEvent("down",(p,y)=>{this.startPress(p,y)})},o=addDomEvent(this.node.current,"keydown",n),s=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(d,h)=>this.cancelPress(d,h))},c=addDomEvent(this.node.current,"blur",s);this.removeAccessibleListeners=pipe(o,c)}}startPress(n,o){this.isPressing=!0;const{onTapStart:s,whileTap:c}=this.node.getProps();c&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&s(n,o)}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(n,o){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&s(n,o)}mount(){const n=this.node.getProps(),o=addPointerEvent(n.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(n.onTapStart||n.onPointerStart)}),s=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe(o,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=t=>{const n=observerCallbacks.get(t.target);n&&n(t)},fireAllObserverCallbacks=t=>{t.forEach(fireObserverCallback)};function initIntersectionObserver({root:t,...n}){const o=t||document;observers.has(o)||observers.set(o,{});const s=observers.get(o),c=JSON.stringify(n);return s[c]||(s[c]=new IntersectionObserver(fireAllObserverCallbacks,{root:t,...n})),s[c]}function observeIntersection(t,n,o){const s=initIntersectionObserver(n);return observerCallbacks.set(t,o),s.observe(t),()=>{observerCallbacks.delete(t),s.unobserve(t)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:n={}}=this.node.getProps(),{root:o,margin:s,amount:c="some",once:d}=n,h={root:o?o.current:void 0,rootMargin:s,threshold:typeof c=="number"?c:thresholdNames[c]},p=y=>{const{isIntersecting:S}=y;if(this.isInView===S||(this.isInView=S,d&&!S&&this.hasEnteredView))return;S&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",S);const{onViewportEnter:P,onViewportLeave:L}=this.node.getProps(),F=S?P:L;F&&F(y)};return observeIntersection(this.node.current,h,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:o}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(n,o))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:t={}},{viewport:n={}}={}){return o=>t[o]!==n[o]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(t,n){if(!Array.isArray(n))return!1;const o=n.length;if(o!==t.length)return!1;for(let s=0;s<o;s++)if(n[s]!==t[s])return!1;return!0}function getCurrent(t){const n={};return t.values.forEach((o,s)=>n[s]=o.get()),n}function getVelocity$1(t){const n={};return t.values.forEach((o,s)=>n[s]=o.getVelocity()),n}function resolveVariant(t,n,o){const s=t.getProps();return resolveVariantFromProps(s,n,o!==void 0?o:s.custom,getCurrent(t),getVelocity$1(t))}const secondsToMilliseconds=t=>t*1e3,millisecondsToSeconds=t=>t/1e3,underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(t,{keyframes:n})=>n.length>2?keyframesTransition:transformProps.has(t)?t.startsWith("scale")?criticallyDampedSpring(n[1]):underDampedSpring:ease;function isTransitionDefined({when:t,delay:n,delayChildren:o,staggerChildren:s,staggerDirection:c,repeat:d,repeatType:h,repeatDelay:p,from:y,elapsed:S,...P}){return!!Object.keys(P).length}function getValueTransition(t,n){return t[n]||t.default||t}const isNotNull=t=>t!==null;function getFinalKeyframe(t,{repeat:n,repeatType:o="loop"},s){const c=t.filter(isNotNull),d=n&&o!=="loop"&&n%2===1?0:c.length-1;return!d||s===void 0?c[d]:s}let now;function clearTime(){now=void 0}const time={now:()=>(now===void 0&&time.set(frameData.isProcessing||MotionGlobalConfig.useManualTiming?frameData.timestamp:performance.now()),now),set:t=>{now=t,queueMicrotask(clearTime)}},isZeroValueString=t=>/^0[^.\s]+$/u.test(t);function isNone(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||isZeroValueString(t):!0}let warning=noop$1,invariant=noop$1;process.env.NODE_ENV!=="production"&&(warning=(t,n)=>{!t&&typeof console<"u"&&console.warn(n)},invariant=(t,n)=>{if(!t)throw new Error(n)});const isNumericalString=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),splitCSSVariableRegex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function parseCSSVariable(t){const n=splitCSSVariableRegex.exec(t);if(!n)return[,];const[,o,s,c]=n;return[`--${o??s}`,c]}const maxDepth=4;function getVariableValue(t,n,o=1){invariant(o<=maxDepth,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,c]=parseCSSVariable(t);if(!s)return;const d=window.getComputedStyle(n).getPropertyValue(s);if(d){const h=d.trim();return isNumericalString(h)?parseFloat(h):h}return isCSSVariableToken(c)?getVariableValue(c,n,o+1):c}const positionalKeys=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),isNumOrPxType=t=>t===number||t===px,getPosFromMatrix=(t,n)=>parseFloat(t.split(", ")[n]),getTranslateFromMatrix=(t,n)=>(o,{transform:s})=>{if(s==="none"||!s)return 0;const c=s.match(/^matrix3d\((.+)\)$/u);if(c)return getPosFromMatrix(c[1],n);{const d=s.match(/^matrix\((.+)\)$/u);return d?getPosFromMatrix(d[1],t):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(t=>!transformKeys.has(t));function removeNonTranslationalTransform(t){const n=[];return nonTranslationalTransformKeys.forEach(o=>{const s=t.getValue(o);s!==void 0&&(n.push([o,s.get()]),s.set(o.startsWith("scale")?1:0))}),n}const positionalValues={width:({x:t},{paddingLeft:n="0",paddingRight:o="0"})=>t.max-t.min-parseFloat(n)-parseFloat(o),height:({y:t},{paddingTop:n="0",paddingBottom:o="0"})=>t.max-t.min-parseFloat(n)-parseFloat(o),top:(t,{top:n})=>parseFloat(n),left:(t,{left:n})=>parseFloat(n),bottom:({y:t},{top:n})=>parseFloat(n)+(t.max-t.min),right:({x:t},{left:n})=>parseFloat(n)+(t.max-t.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)};positionalValues.translateX=positionalValues.x,positionalValues.translateY=positionalValues.y;const testValueType=t=>n=>n.test(t),auto={test:t=>t==="auto",parse:t=>t},dimensionValueTypes=[number,px,percent,degrees,vw,vh,auto],findDimensionValueType=t=>dimensionValueTypes.find(testValueType(t)),toResolve=new Set;let isScheduled=!1,anyNeedsMeasurement=!1;function measureAllKeyframes(){if(anyNeedsMeasurement){const t=Array.from(toResolve).filter(s=>s.needsMeasurement),n=new Set(t.map(s=>s.element)),o=new Map;n.forEach(s=>{removeNonTranslationalTransform(s).length&&(o.set(s,removeNonTranslationalTransform(s)),s.render())}),t.forEach(s=>s.measureInitialState()),n.forEach(s=>{s.render()}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}anyNeedsMeasurement=!1,isScheduled=!1,toResolve.forEach(t=>t.complete()),toResolve.clear()}function readAllKeyframes(){toResolve.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(anyNeedsMeasurement=!0)})}function flushKeyframeResolvers(){readAllKeyframes(),measureAllKeyframes()}class KeyframeResolver{constructor(n,o,s,c,d,h=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...n],this.onComplete=o,this.name=s,this.motionValue=c,this.element=d,this.isAsync=h}scheduleResolve(){this.isScheduled=!0,this.isAsync?(toResolve.add(this),isScheduled||(isScheduled=!0,frame.read(readAllKeyframes),frame.resolveKeyframes(measureAllKeyframes))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:o,element:s,motionValue:c}=this;for(let d=0;d<n.length;d++)if(n[d]===null)if(d===0){const h=c==null?void 0:c.get(),p=n[n.length-1];if(h!==void 0)n[0]=h;else if(s&&o){const y=s.readValue(o,p);y!=null&&(n[0]=y)}n[0]===void 0&&(n[0]=p),c&&h===void 0&&c.set(n[0])}else n[d]=n[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),toResolve.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,toResolve.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const isColorString=(t,n)=>o=>!!(isString$1(o)&&singleColorRegex.test(o)&&o.startsWith(t)||n&&Object.prototype.hasOwnProperty.call(o,n)),splitColor=(t,n,o)=>s=>{if(!isString$1(s))return s;const[c,d,h,p]=s.match(floatRegex);return{[t]:parseFloat(c),[n]:parseFloat(d),[o]:parseFloat(h),alpha:p!==void 0?parseFloat(p):1}},clampRgbUnit=t=>clamp(0,255,t),rgbUnit={...number,transform:t=>Math.round(clampRgbUnit(t))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:t,green:n,blue:o,alpha:s=1})=>"rgba("+rgbUnit.transform(t)+", "+rgbUnit.transform(n)+", "+rgbUnit.transform(o)+", "+sanitize(alpha.transform(s))+")"};function parseHex(t){let n="",o="",s="",c="";return t.length>5?(n=t.substring(1,3),o=t.substring(3,5),s=t.substring(5,7),c=t.substring(7,9)):(n=t.substring(1,2),o=t.substring(2,3),s=t.substring(3,4),c=t.substring(4,5),n+=n,o+=o,s+=s,c+=c),{red:parseInt(n,16),green:parseInt(o,16),blue:parseInt(s,16),alpha:c?parseInt(c,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:o,alpha:s=1})=>"hsla("+Math.round(t)+", "+percent.transform(sanitize(n))+", "+percent.transform(sanitize(o))+", "+sanitize(alpha.transform(s))+")"},color={test:t=>rgba.test(t)||hex.test(t)||hsla.test(t),parse:t=>rgba.test(t)?rgba.parse(t):hsla.test(t)?hsla.parse(t):hex.parse(t),transform:t=>isString$1(t)?t:t.hasOwnProperty("red")?rgba.transform(t):hsla.transform(t)};function test(t){var n,o;return isNaN(t)&&isString$1(t)&&(((n=t.match(floatRegex))===null||n===void 0?void 0:n.length)||0)+(((o=t.match(colorRegex))===null||o===void 0?void 0:o.length)||0)>0}const NUMBER_TOKEN="number",COLOR_TOKEN="color",VAR_TOKEN="var",VAR_FUNCTION_TOKEN="var(",SPLIT_TOKEN="${}",complexRegex=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function analyseComplexValue(t){const n=t.toString(),o=[],s={color:[],number:[],var:[]},c=[];let d=0;const p=n.replace(complexRegex,y=>(color.test(y)?(s.color.push(d),c.push(COLOR_TOKEN),o.push(color.parse(y))):y.startsWith(VAR_FUNCTION_TOKEN)?(s.var.push(d),c.push(VAR_TOKEN),o.push(y)):(s.number.push(d),c.push(NUMBER_TOKEN),o.push(parseFloat(y))),++d,SPLIT_TOKEN)).split(SPLIT_TOKEN);return{values:o,split:p,indexes:s,types:c}}function parseComplexValue(t){return analyseComplexValue(t).values}function createTransformer(t){const{split:n,types:o}=analyseComplexValue(t),s=n.length;return c=>{let d="";for(let h=0;h<s;h++)if(d+=n[h],c[h]!==void 0){const p=o[h];p===NUMBER_TOKEN?d+=sanitize(c[h]):p===COLOR_TOKEN?d+=color.transform(c[h]):d+=c[h]}return d}}const convertNumbersToZero=t=>typeof t=="number"?0:t;function getAnimatableNone$1(t){const n=parseComplexValue(t);return createTransformer(t)(n.map(convertNumbersToZero))}const complex={test,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(t){const[n,o]=t.slice(0,-1).split("(");if(n==="drop-shadow")return t;const[s]=o.match(floatRegex)||[];if(!s)return t;const c=o.replace(s,"");let d=maxDefaults.has(n)?1:0;return s!==o&&(d*=100),n+"("+d+c+")"}const functionRegex=/\b([a-z-]*)\(.*?\)/gu,filter={...complex,getAnimatableNone:t=>{const n=t.match(functionRegex);return n?n.map(applyDefaultFilter).join(" "):t}},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter,WebkitFilter:filter},getDefaultValueType=t=>defaultValueTypes[t];function getAnimatableNone(t,n){let o=getDefaultValueType(t);return o!==filter&&(o=complex),o.getAnimatableNone?o.getAnimatableNone(n):void 0}function makeNoneKeyframesAnimatable(t,n,o){let s=0,c;for(;s<t.length&&!c;)typeof t[s]=="string"&&t[s]!=="none"&&t[s]!=="0"&&(c=t[s]),s++;if(c&&o)for(const d of n)t[d]=getAnimatableNone(o,c)}class DOMKeyframesResolver extends KeyframeResolver{constructor(n,o,s,c){super(n,o,s,c,c==null?void 0:c.owner,!0)}readKeyframes(){const{unresolvedKeyframes:n,element:o,name:s}=this;if(!o.current)return;super.readKeyframes();for(let y=0;y<n.length;y++){const S=n[y];if(typeof S=="string"&&isCSSVariableToken(S)){const P=getVariableValue(S,o.current);P!==void 0&&(n[y]=P)}}if(!positionalKeys.has(s)||n.length!==2)return this.resolveNoneKeyframes();const[c,d]=n,h=findDimensionValueType(c),p=findDimensionValueType(d);if(h!==p)if(isNumOrPxType(h)&&isNumOrPxType(p))for(let y=0;y<n.length;y++){const S=n[y];typeof S=="string"&&(n[y]=parseFloat(S))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:n,name:o}=this,s=[];for(let c=0;c<n.length;c++)isNone(n[c])&&s.push(c);s.length&&makeNoneKeyframesAnimatable(n,s,o)}measureInitialState(){const{element:n,unresolvedKeyframes:o,name:s}=this;if(!n.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=positionalValues[s](n.measureViewportBox(),window.getComputedStyle(n.current)),o[0]=this.measuredOrigin;const c=o[o.length-1];c!==void 0&&n.getValue(s,c).jump(c,!1)}measureEndState(){var n;const{element:o,name:s,unresolvedKeyframes:c}=this;if(!o.current)return;const d=o.getValue(s);d&&d.jump(this.measuredOrigin,!1);const h=c.length-1,p=c[h];c[h]=positionalValues[s](o.measureViewportBox(),window.getComputedStyle(o.current)),p!==null&&(this.finalKeyframe=p),!((n=this.removedTransforms)===null||n===void 0)&&n.length&&this.removedTransforms.forEach(([y,S])=>{o.getValue(y).set(S)}),this.resolveNoneKeyframes()}}function memo(t){let n;return()=>(n===void 0&&(n=t()),n)}const isAnimatable=(t,n)=>n==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(complex.test(t)||t==="0")&&!t.startsWith("url("));function hasKeyframesChanged(t){const n=t[0];if(t.length===1)return!0;for(let o=0;o<t.length;o++)if(t[o]!==n)return!0}function canAnimate(t,n,o,s){const c=t[0];if(c===null)return!1;const d=t[t.length-1],h=isAnimatable(c,n),p=isAnimatable(d,n);return warning(h===p,`You are trying to animate ${n} from "${c}" to "${d}". ${c} is not an animatable value - to enable this animation set ${c} to a value animatable to ${d} via the \`style\` property.`),!h||!p?!1:hasKeyframesChanged(t)||o==="spring"&&s}class BaseAnimation{constructor({autoplay:n=!0,delay:o=0,type:s="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:h="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:n,delay:o,type:s,repeat:c,repeatDelay:d,repeatType:h,...p},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&flushKeyframeResolvers(),this._resolved}onKeyframesResolved(n,o){this.hasAttemptedResolve=!0;const{name:s,type:c,velocity:d,delay:h,onComplete:p,onUpdate:y,isGenerator:S}=this.options;if(!S&&!canAnimate(n,s,c,d))if(h)this.options.duration=0;else{y==null||y(getFinalKeyframe(n,this.options,o)),p==null||p(),this.resolveFinishedPromise();return}const P=this.initPlayback(n,o);P!==!1&&(this._resolved={keyframes:n,finalKeyframe:o,...P},this.onPostResolved())}onPostResolved(){}then(n,o){return this.currentFinishedPromise.then(n,o)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(n=>{this.resolveFinishedPromise=n})}}function velocityPerSecond(t,n){return n?t*(1e3/n):0}const velocitySampleDuration=5;function calcGeneratorVelocity(t,n,o){const s=Math.max(n-velocitySampleDuration,0);return velocityPerSecond(o-t(s),n-s)}const safeMin=.001,minDuration=.01,maxDuration$1=10,minDamping=.05,maxDamping=1;function findSpring({duration:t=800,bounce:n=.25,velocity:o=0,mass:s=1}){let c,d;warning(t<=secondsToMilliseconds(maxDuration$1),"Spring duration must be 10 seconds or less");let h=1-n;h=clamp(minDamping,maxDamping,h),t=clamp(minDuration,maxDuration$1,millisecondsToSeconds(t)),h<1?(c=S=>{const P=S*h,L=P*t,F=P-o,N=calcAngularFreq(S,h),z=Math.exp(-L);return safeMin-F/N*z},d=S=>{const L=S*h*t,F=L*o+o,N=Math.pow(h,2)*Math.pow(S,2)*t,z=Math.exp(-L),W=calcAngularFreq(Math.pow(S,2),h);return(-c(S)+safeMin>0?-1:1)*((F-N)*z)/W}):(c=S=>{const P=Math.exp(-S*t),L=(S-o)*t+1;return-.001+P*L},d=S=>{const P=Math.exp(-S*t),L=(o-S)*(t*t);return P*L});const p=5/t,y=approximateRoot(c,d,p);if(t=secondsToMilliseconds(t),isNaN(y))return{stiffness:100,damping:10,duration:t};{const S=Math.pow(y,2)*s;return{stiffness:S,damping:h*2*Math.sqrt(s*S),duration:t}}}const rootIterations=12;function approximateRoot(t,n,o){let s=o;for(let c=1;c<rootIterations;c++)s=s-t(s)/n(s);return s}function calcAngularFreq(t,n){return t*Math.sqrt(1-n*n)}const durationKeys=["duration","bounce"],physicsKeys=["stiffness","damping","mass"];function isSpringType(t,n){return n.some(o=>t[o]!==void 0)}function getSpringOptions(t){let n={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!isSpringType(t,physicsKeys)&&isSpringType(t,durationKeys)){const o=findSpring(t);n={...n,...o,mass:1},n.isResolvedFromDuration=!0}return n}function spring({keyframes:t,restDelta:n,restSpeed:o,...s}){const c=t[0],d=t[t.length-1],h={done:!1,value:c},{stiffness:p,damping:y,mass:S,duration:P,velocity:L,isResolvedFromDuration:F}=getSpringOptions({...s,velocity:-millisecondsToSeconds(s.velocity||0)}),N=L||0,z=y/(2*Math.sqrt(p*S)),W=d-c,nt=millisecondsToSeconds(Math.sqrt(p/S)),Pe=Math.abs(W)<5;o||(o=Pe?.01:2),n||(n=Pe?.005:.5);let se;if(z<1){const mt=calcAngularFreq(nt,z);se=kt=>{const mn=Math.exp(-z*nt*kt);return d-mn*((N+z*nt*W)/mt*Math.sin(mt*kt)+W*Math.cos(mt*kt))}}else if(z===1)se=mt=>d-Math.exp(-nt*mt)*(W+(N+nt*W)*mt);else{const mt=nt*Math.sqrt(z*z-1);se=kt=>{const mn=Math.exp(-z*nt*kt),_i=Math.min(mt*kt,300);return d-mn*((N+z*nt*W)*Math.sinh(_i)+mt*W*Math.cosh(_i))/mt}}return{calculatedDuration:F&&P||null,next:mt=>{const kt=se(mt);if(F)h.done=mt>=P;else{let mn=N;mt!==0&&(z<1?mn=calcGeneratorVelocity(se,mt,kt):mn=0);const _i=Math.abs(mn)<=o,zi=Math.abs(d-kt)<=n;h.done=_i&&zi}return h.value=h.done?d:kt,h}}}function inertia({keyframes:t,velocity:n=0,power:o=.8,timeConstant:s=325,bounceDamping:c=10,bounceStiffness:d=500,modifyTarget:h,min:p,max:y,restDelta:S=.5,restSpeed:P}){const L=t[0],F={done:!1,value:L},N=Sa=>p!==void 0&&Sa<p||y!==void 0&&Sa>y,z=Sa=>p===void 0?y:y===void 0||Math.abs(p-Sa)<Math.abs(y-Sa)?p:y;let W=o*n;const nt=L+W,Pe=h===void 0?nt:h(nt);Pe!==nt&&(W=Pe-L);const se=Sa=>-W*Math.exp(-Sa/s),mt=Sa=>Pe+se(Sa),kt=Sa=>{const fa=se(Sa),La=mt(Sa);F.done=Math.abs(fa)<=S,F.value=F.done?Pe:La};let mn,_i;const zi=Sa=>{N(F.value)&&(mn=Sa,_i=spring({keyframes:[F.value,z(F.value)],velocity:calcGeneratorVelocity(mt,Sa,F.value),damping:c,stiffness:d,restDelta:S,restSpeed:P}))};return zi(0),{calculatedDuration:null,next:Sa=>{let fa=!1;return!_i&&mn===void 0&&(fa=!0,kt(Sa),zi(Sa)),mn!==void 0&&Sa>=mn?_i.next(Sa-mn):(!fa&&kt(Sa),F)}}}const calcBezier=(t,n,o)=>(((1-3*o+3*n)*t+(3*o-6*n))*t+3*n)*t,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(t,n,o,s,c){let d,h,p=0;do h=n+(o-n)/2,d=calcBezier(h,s,c)-t,d>0?o=h:n=h;while(Math.abs(d)>subdivisionPrecision&&++p<subdivisionMaxIterations);return h}function cubicBezier(t,n,o,s){if(t===n&&o===s)return noop$1;const c=d=>binarySubdivide(d,0,1,t,o);return d=>d===0||d===1?d:calcBezier(c(d),n,s)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=t=>Array.isArray(t)&&typeof t[0]!="number",mirrorEasing=t=>n=>n<=.5?t(2*n)/2:(2-t(2*(1-n)))/2,reverseEasing=t=>n=>1-t(1-n),circIn=t=>1-Math.sin(Math.acos(t)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circIn),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=t=>(t*=2)<1?.5*backIn(t):.5*(2-Math.pow(2,-10*(t-1))),easingLookup={linear:noop$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=t=>{if(Array.isArray(t)){invariant(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[n,o,s,c]=t;return cubicBezier(n,o,s,c)}else if(typeof t=="string")return invariant(easingLookup[t]!==void 0,`Invalid easing type '${t}'`),easingLookup[t];return t},progress=(t,n,o)=>{const s=n-t;return s===0?1:(o-t)/s},mixNumber$1=(t,n,o)=>t+(n-t)*o;function hueToRgb(t,n,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+(n-t)*6*o:o<1/2?n:o<2/3?t+(n-t)*(2/3-o)*6:t}function hslaToRgba({hue:t,saturation:n,lightness:o,alpha:s}){t/=360,n/=100,o/=100;let c=0,d=0,h=0;if(!n)c=d=h=o;else{const p=o<.5?o*(1+n):o+n-o*n,y=2*o-p;c=hueToRgb(y,p,t+1/3),d=hueToRgb(y,p,t),h=hueToRgb(y,p,t-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(h*255),alpha:s}}const mixLinearColor=(t,n,o)=>{const s=t*t,c=o*(n*n-s)+s;return c<0?0:Math.sqrt(c)},colorTypes=[hex,rgba,hsla],getColorType=t=>colorTypes.find(n=>n.test(t));function asRGBA(t){const n=getColorType(t);invariant(!!n,`'${t}' is not an animatable color. Use the equivalent color code instead.`);let o=n.parse(t);return n===hsla&&(o=hslaToRgba(o)),o}const mixColor=(t,n)=>{const o=asRGBA(t),s=asRGBA(n),c={...o};return d=>(c.red=mixLinearColor(o.red,s.red,d),c.green=mixLinearColor(o.green,s.green,d),c.blue=mixLinearColor(o.blue,s.blue,d),c.alpha=mixNumber$1(o.alpha,s.alpha,d),rgba.transform(c))};function mixImmediate(t,n){return o=>o>0?n:t}function mixNumber(t,n){return o=>mixNumber$1(t,n,o)}function getMixer(t){return typeof t=="number"?mixNumber:typeof t=="string"?isCSSVariableToken(t)?mixImmediate:color.test(t)?mixColor:mixComplex:Array.isArray(t)?mixArray:typeof t=="object"?color.test(t)?mixColor:mixObject:mixImmediate}function mixArray(t,n){const o=[...t],s=o.length,c=t.map((d,h)=>getMixer(d)(d,n[h]));return d=>{for(let h=0;h<s;h++)o[h]=c[h](d);return o}}function mixObject(t,n){const o={...t,...n},s={};for(const c in o)t[c]!==void 0&&n[c]!==void 0&&(s[c]=getMixer(t[c])(t[c],n[c]));return c=>{for(const d in s)o[d]=s[d](c);return o}}function matchOrder(t,n){var o;const s=[],c={color:0,var:0,number:0};for(let d=0;d<n.values.length;d++){const h=n.types[d],p=t.indexes[h][c[h]],y=(o=t.values[p])!==null&&o!==void 0?o:0;s[d]=y,c[h]++}return s}const mixComplex=(t,n)=>{const o=complex.createTransformer(n),s=analyseComplexValue(t),c=analyseComplexValue(n);return s.indexes.var.length===c.indexes.var.length&&s.indexes.color.length===c.indexes.color.length&&s.indexes.number.length>=c.indexes.number.length?pipe(mixArray(matchOrder(s,c),c.values),o):(warning(!0,`Complex values '${t}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),mixImmediate(t,n))};function mix(t,n,o){return typeof t=="number"&&typeof n=="number"&&typeof o=="number"?mixNumber$1(t,n,o):getMixer(t)(t,n)}function createMixers(t,n,o){const s=[],c=o||mix,d=t.length-1;for(let h=0;h<d;h++){let p=c(t[h],t[h+1]);if(n){const y=Array.isArray(n)?n[h]||noop$1:n;p=pipe(y,p)}s.push(p)}return s}function interpolate(t,n,{clamp:o=!0,ease:s,mixer:c}={}){const d=t.length;if(invariant(d===n.length,"Both input and output ranges must be the same length"),d===1)return()=>n[0];if(d===2&&t[0]===t[1])return()=>n[1];t[0]>t[d-1]&&(t=[...t].reverse(),n=[...n].reverse());const h=createMixers(n,s,c),p=h.length,y=S=>{let P=0;if(p>1)for(;P<t.length-2&&!(S<t[P+1]);P++);const L=progress(t[P],t[P+1],S);return h[P](L)};return o?S=>y(clamp(t[0],t[d-1],S)):y}function fillOffset(t,n){const o=t[t.length-1];for(let s=1;s<=n;s++){const c=progress(0,n,s);t.push(mixNumber$1(o,1,c))}}function defaultOffset(t){const n=[0];return fillOffset(n,t.length-1),n}function convertOffsetToTimes(t,n){return t.map(o=>o*n)}function defaultEasing(t,n){return t.map(()=>n||easeInOut).splice(0,t.length-1)}function keyframes({duration:t=300,keyframes:n,times:o,ease:s="easeInOut"}){const c=isEasingArray(s)?s.map(easingDefinitionToFunction):easingDefinitionToFunction(s),d={done:!1,value:n[0]},h=convertOffsetToTimes(o&&o.length===n.length?o:defaultOffset(n),t),p=interpolate(h,n,{ease:Array.isArray(c)?c:defaultEasing(n,c)});return{calculatedDuration:t,next:y=>(d.value=p(y),d.done=y>=t,d)}}const maxGeneratorDuration=2e4;function calcGeneratorDuration(t){let n=0;const o=50;let s=t.next(n);for(;!s.done&&n<maxGeneratorDuration;)n+=o,s=t.next(n);return n>=maxGeneratorDuration?1/0:n}const frameloopDriver=t=>{const n=({timestamp:o})=>t(o);return{start:()=>frame.update(n,!0),stop:()=>cancelFrame(n),now:()=>frameData.isProcessing?frameData.timestamp:time.now()}},generators={decay:inertia,inertia,tween:keyframes,keyframes,spring},percentToProgress=t=>t/100;class MainThreadAnimation extends BaseAnimation{constructor({KeyframeResolver:n=KeyframeResolver,...o}){super(o),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle";const{name:s,motionValue:c,keyframes:d}=this.options,h=(p,y)=>this.onKeyframesResolved(p,y);s&&c&&c.owner?this.resolver=c.owner.resolveKeyframes(d,h,s,c):this.resolver=new n(d,h,s,c),this.resolver.scheduleResolve()}initPlayback(n){const{type:o="keyframes",repeat:s=0,repeatDelay:c=0,repeatType:d,velocity:h=0}=this.options,p=generators[o]||keyframes;let y,S;p!==keyframes&&typeof n[0]!="number"&&(process.env.NODE_ENV!=="production"&&invariant(n.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${n}`),y=pipe(percentToProgress,mix(n[0],n[1])),n=[0,100]);const P=p({...this.options,keyframes:n});d==="mirror"&&(S=p({...this.options,keyframes:[...n].reverse(),velocity:-h})),P.calculatedDuration===null&&(P.calculatedDuration=calcGeneratorDuration(P));const{calculatedDuration:L}=P,F=L+c,N=F*(s+1)-c;return{generator:P,mirroredGenerator:S,mapPercentToKeyframes:y,calculatedDuration:L,resolvedDuration:F,totalDuration:N}}onPostResolved(){const{autoplay:n=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!n?this.pause():this.state=this.pendingPlayState}tick(n,o=!1){const{resolved:s}=this;if(!s){const{keyframes:Sa}=this.options;return{done:!0,value:Sa[Sa.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:h,mapPercentToKeyframes:p,keyframes:y,calculatedDuration:S,totalDuration:P,resolvedDuration:L}=s;if(this.startTime===null)return d.next(0);const{delay:F,repeat:N,repeatType:z,repeatDelay:W,onUpdate:nt}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-P/this.speed,this.startTime)),o?this.currentTime=n:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(n-this.startTime)*this.speed;const Pe=this.currentTime-F*(this.speed>=0?1:-1),se=this.speed>=0?Pe<0:Pe>P;this.currentTime=Math.max(Pe,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=P);let mt=this.currentTime,kt=d;if(N){const Sa=Math.min(this.currentTime,P)/L;let fa=Math.floor(Sa),La=Sa%1;!La&&Sa>=1&&(La=1),La===1&&fa--,fa=Math.min(fa,N+1),!!(fa%2)&&(z==="reverse"?(La=1-La,W&&(La-=W/L)):z==="mirror"&&(kt=h)),mt=clamp(0,1,La)*L}const mn=se?{done:!1,value:y[0]}:kt.next(mt);p&&(mn.value=p(mn.value));let{done:_i}=mn;!se&&S!==null&&(_i=this.speed>=0?this.currentTime>=P:this.currentTime<=0);const zi=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_i);return zi&&c!==void 0&&(mn.value=getFinalKeyframe(y,this.options,c)),nt&&nt(mn.value),zi&&this.finish(),mn}get duration(){const{resolved:n}=this;return n?millisecondsToSeconds(n.calculatedDuration):0}get time(){return millisecondsToSeconds(this.currentTime)}set time(n){n=secondsToMilliseconds(n),this.currentTime=n,this.holdTime!==null||this.speed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.speed)}get speed(){return this.playbackSpeed}set speed(n){const o=this.playbackSpeed!==n;this.playbackSpeed=n,o&&(this.time=millisecondsToSeconds(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:n=frameloopDriver,onPlay:o}=this.options;this.driver||(this.driver=n(c=>this.tick(c))),o&&o();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=s),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var n;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(n=this.currentTime)!==null&&n!==void 0?n:0}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:n}=this.options;n&&n()}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:n}=this.options;n&&n()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(n){return this.startTime=0,this.tick(n,!0)}}const isBezierDefinition=t=>Array.isArray(t)&&typeof t[0]=="number";function isWaapiSupportedEasing(t){return!!(!t||typeof t=="string"&&supportedWaapiEasing[t]||isBezierDefinition(t)||Array.isArray(t)&&t.every(isWaapiSupportedEasing))}const cubicBezierAsString=([t,n,o,s])=>`cubic-bezier(${t}, ${n}, ${o}, ${s})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasing(t){if(t)return isBezierDefinition(t)?cubicBezierAsString(t):Array.isArray(t)?t.map(mapEasingToNativeEasing):supportedWaapiEasing[t]}function animateStyle(t,n,o,{delay:s=0,duration:c=300,repeat:d=0,repeatType:h="loop",ease:p,times:y}={}){const S={[n]:o};y&&(S.offset=y);const P=mapEasingToNativeEasing(p);return Array.isArray(P)&&(S.easing=P),t.animate(S,{delay:s,duration:c,easing:Array.isArray(P)?"linear":P,fill:"both",iterations:d+1,direction:h==="reverse"?"alternate":"normal"})}const supportsWaapi=memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),acceleratedValues=new Set(["opacity","clipPath","filter","transform"]),sampleDelta=10,maxDuration=2e4;function requiresPregeneratedKeyframes(t){return t.type==="spring"||t.name==="backgroundColor"||!isWaapiSupportedEasing(t.ease)}function pregenerateKeyframes(t,n){const o=new MainThreadAnimation({...n,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const c=[];let d=0;for(;!s.done&&d<maxDuration;)s=o.sample(d),c.push(s.value),d+=sampleDelta;return{times:void 0,keyframes:c,duration:d-sampleDelta,ease:"linear"}}class AcceleratedAnimation extends BaseAnimation{constructor(n){super(n);const{name:o,motionValue:s,keyframes:c}=this.options;this.resolver=new DOMKeyframesResolver(c,(d,h)=>this.onKeyframesResolved(d,h),o,s),this.resolver.scheduleResolve()}initPlayback(n,o){var s;let{duration:c=300,times:d,ease:h,type:p,motionValue:y,name:S}=this.options;if(!(!((s=y.owner)===null||s===void 0)&&s.current))return!1;if(requiresPregeneratedKeyframes(this.options)){const{onComplete:L,onUpdate:F,motionValue:N,...z}=this.options,W=pregenerateKeyframes(n,z);n=W.keyframes,n.length===1&&(n[1]=n[0]),c=W.duration,d=W.times,h=W.ease,p="keyframes"}const P=animateStyle(y.owner.current,S,n,{...this.options,duration:c,times:d,ease:h});return P.startTime=time.now(),this.pendingTimeline?(P.timeline=this.pendingTimeline,this.pendingTimeline=void 0):P.onfinish=()=>{const{onComplete:L}=this.options;y.set(getFinalKeyframe(n,this.options,o)),L&&L(),this.cancel(),this.resolveFinishedPromise()},{animation:P,duration:c,times:d,type:p,ease:h,keyframes:n}}get duration(){const{resolved:n}=this;if(!n)return 0;const{duration:o}=n;return millisecondsToSeconds(o)}get time(){const{resolved:n}=this;if(!n)return 0;const{animation:o}=n;return millisecondsToSeconds(o.currentTime||0)}set time(n){const{resolved:o}=this;if(!o)return;const{animation:s}=o;s.currentTime=secondsToMilliseconds(n)}get speed(){const{resolved:n}=this;if(!n)return 1;const{animation:o}=n;return o.playbackRate}set speed(n){const{resolved:o}=this;if(!o)return;const{animation:s}=o;s.playbackRate=n}get state(){const{resolved:n}=this;if(!n)return"idle";const{animation:o}=n;return o.playState}attachTimeline(n){if(!this._resolved)this.pendingTimeline=n;else{const{resolved:o}=this;if(!o)return noop$1;const{animation:s}=o;s.timeline=n,s.onfinish=null}return noop$1}play(){if(this.isStopped)return;const{resolved:n}=this;if(!n)return;const{animation:o}=n;o.playState==="finished"&&this.updateFinishedPromise(),o.play()}pause(){const{resolved:n}=this;if(!n)return;const{animation:o}=n;o.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:n}=this;if(!n)return;const{animation:o,keyframes:s,duration:c,type:d,ease:h,times:p}=n;if(!(o.playState==="idle"||o.playState==="finished")){if(this.time){const{motionValue:y,onUpdate:S,onComplete:P,...L}=this.options,F=new MainThreadAnimation({...L,keyframes:s,duration:c,type:d,ease:h,times:p,isGenerator:!0}),N=secondsToMilliseconds(this.time);y.setWithVelocity(F.sample(N-sampleDelta).value,F.sample(N).value,sampleDelta)}this.cancel()}}complete(){const{resolved:n}=this;n&&n.animation.finish()}cancel(){const{resolved:n}=this;n&&n.animation.cancel()}static supports(n){const{motionValue:o,name:s,repeatDelay:c,repeatType:d,damping:h,type:p}=n;return supportsWaapi()&&s&&acceleratedValues.has(s)&&o&&o.owner&&o.owner.current instanceof HTMLElement&&!o.owner.getProps().onUpdate&&!c&&d!=="mirror"&&h!==0&&p!=="inertia"}}const animateMotionValue=(t,n,o,s={},c,d)=>h=>{const p=getValueTransition(s,t)||{},y=p.delay||s.delay||0;let{elapsed:S=0}=s;S=S-secondsToMilliseconds(y);let P={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:n.getVelocity(),...p,delay:-S,onUpdate:F=>{n.set(F),p.onUpdate&&p.onUpdate(F)},onComplete:()=>{h(),p.onComplete&&p.onComplete()},name:t,motionValue:n,element:d?void 0:c};isTransitionDefined(p)||(P={...P,...getDefaultTransition(t,P)}),P.duration&&(P.duration=secondsToMilliseconds(P.duration)),P.repeatDelay&&(P.repeatDelay=secondsToMilliseconds(P.repeatDelay)),P.from!==void 0&&(P.keyframes[0]=P.from);let L=!1;if((P.type===!1||P.duration===0&&!P.repeatDelay)&&(P.duration=0,P.delay===0&&(L=!0)),L&&!d&&n.get()!==void 0){const F=getFinalKeyframe(P.keyframes,p);if(F!==void 0){frame.update(()=>{P.onUpdate(F),P.onComplete()});return}}return!d&&AcceleratedAnimation.supports(P)?new AcceleratedAnimation(P):new MainThreadAnimation(P)};function isWillChangeMotionValue(t){return!!(isMotionValue(t)&&t.add)}function addUniqueItem(t,n){t.indexOf(n)===-1&&t.push(n)}function removeItem(t,n){const o=t.indexOf(n);o>-1&&t.splice(o,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(n){return addUniqueItem(this.subscriptions,n),()=>removeItem(this.subscriptions,n)}notify(n,o,s){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](n,o,s);else for(let d=0;d<c;d++){const h=this.subscriptions[d];h&&h(n,o,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const warned=new Set;function warnOnce(t,n,o){t||warned.has(n)||(console.warn(n),warned.add(n))}const MAX_VELOCITY_DELTA=30,isFloat=t=>!isNaN(parseFloat(t));class MotionValue{constructor(n,o={}){this.version="11.0.27",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(s,c=!0)=>{const d=time.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(n),this.canTrackVelocity=isFloat(this.current),this.owner=o.owner}setCurrent(n){this.current=n,this.updatedAt=time.now()}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return process.env.NODE_ENV!=="production"&&warnOnce(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",n)}on(n,o){this.events[n]||(this.events[n]=new SubscriptionManager);const s=this.events[n].add(o);return n==="change"?()=>{s(),frame.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,o){this.passiveEffect=n,this.stopPassiveEffect=o}set(n,o=!0){!o||!this.passiveEffect?this.updateAndNotify(n,o):this.passiveEffect(n,this.updateAndNotify)}setWithVelocity(n,o,s){this.set(o),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-s}jump(n,o=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const n=time.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>MAX_VELOCITY_DELTA)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,MAX_VELOCITY_DELTA);return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(n){return this.stop(),new Promise(o=>{this.hasAnimated=!0,this.animation=n(o),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(t,n){return new MotionValue(t,n)}function setMotionValue(t,n,o){t.hasValue(n)?t.getValue(n).set(o):t.addValue(n,motionValue(o))}function setTarget(t,n){const o=resolveVariant(t,n);let{transitionEnd:s={},transition:c={},...d}=o||{};d={...d,...s};for(const h in d){const p=resolveFinalValueInKeyframes(d[h]);setMotionValue(t,h,p)}}function shouldBlockAnimation({protectedKeys:t,needsAnimating:n},o){const s=t.hasOwnProperty(o)&&n[o]!==!0;return n[o]=!1,s}function animateTarget(t,n,{delay:o=0,transitionOverride:s,type:c}={}){var d;let{transition:h=t.getDefaultTransition(),transitionEnd:p,...y}=n;const S=t.getValue("willChange");s&&(h=s);const P=[],L=c&&t.animationState&&t.animationState.getState()[c];for(const F in y){const N=t.getValue(F,(d=t.latestValues[F])!==null&&d!==void 0?d:null),z=y[F];if(z===void 0||L&&shouldBlockAnimation(L,F))continue;const W={delay:o,elapsed:0,...getValueTransition(h||{},F)};let nt=!1;if(window.HandoffAppearAnimations){const se=t.getProps()[optimizedAppearDataAttribute];if(se){const mt=window.HandoffAppearAnimations(se,F);mt!==null&&(W.elapsed=mt,nt=!0)}}N.start(animateMotionValue(F,N,z,t.shouldReduceMotion&&transformProps.has(F)?{type:!1}:W,t,nt));const Pe=N.animation;Pe&&(isWillChangeMotionValue(S)&&(S.add(F),Pe.then(()=>S.remove(F))),P.push(Pe))}return p&&Promise.all(P).then(()=>{frame.update(()=>{p&&setTarget(t,p)})}),P}function animateVariant(t,n,o={}){var s;const c=resolveVariant(t,n,o.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:d=t.getDefaultTransition()||{}}=c||{};o.transitionOverride&&(d=o.transitionOverride);const h=c?()=>Promise.all(animateTarget(t,c,o)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(S=0)=>{const{delayChildren:P=0,staggerChildren:L,staggerDirection:F}=d;return animateChildren(t,n,P+S,L,F,o)}:()=>Promise.resolve(),{when:y}=d;if(y){const[S,P]=y==="beforeChildren"?[h,p]:[p,h];return S().then(()=>P())}else return Promise.all([h(),p(o.delay)])}function animateChildren(t,n,o=0,s=0,c=1,d){const h=[],p=(t.variantChildren.size-1)*s,y=c===1?(S=0)=>S*s:(S=0)=>p-S*s;return Array.from(t.variantChildren).sort(sortByTreeOrder).forEach((S,P)=>{S.notify("AnimationStart",n),h.push(animateVariant(S,n,{...d,delay:o+y(P)}).then(()=>S.notify("AnimationComplete",n)))}),Promise.all(h)}function sortByTreeOrder(t,n){return t.sortNodePosition(n)}function animateVisualElement(t,n,o={}){t.notify("AnimationStart",n);let s;if(Array.isArray(n)){const c=n.map(d=>animateVariant(t,d,o));s=Promise.all(c)}else if(typeof n=="string")s=animateVariant(t,n,o);else{const c=typeof n=="function"?resolveVariant(t,n,o.custom):n;s=Promise.all(animateTarget(t,c,o))}return s.then(()=>{frame.postRender(()=>{t.notify("AnimationComplete",n)})})}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(t){return n=>Promise.all(n.map(({animation:o,options:s})=>animateVisualElement(t,o,s)))}function createAnimationState(t){let n=animateList(t);const o=createState();let s=!0;const c=y=>(S,P)=>{var L;const F=resolveVariant(t,P,y==="exit"?(L=t.presenceContext)===null||L===void 0?void 0:L.custom:void 0);if(F){const{transition:N,transitionEnd:z,...W}=F;S={...S,...W,...z}}return S};function d(y){n=y(t)}function h(y){const S=t.getProps(),P=t.getVariantContext(!0)||{},L=[],F=new Set;let N={},z=1/0;for(let nt=0;nt<numAnimationTypes;nt++){const Pe=reversePriorityOrder[nt],se=o[Pe],mt=S[Pe]!==void 0?S[Pe]:P[Pe],kt=isVariantLabel(mt),mn=Pe===y?se.isActive:null;mn===!1&&(z=nt);let _i=mt===P[Pe]&&mt!==S[Pe]&&kt;if(_i&&s&&t.manuallyAnimateOnMount&&(_i=!1),se.protectedKeys={...N},!se.isActive&&mn===null||!mt&&!se.prevProp||isAnimationControls(mt)||typeof mt=="boolean")continue;let Sa=checkVariantsDidChange(se.prevProp,mt)||Pe===y&&se.isActive&&!_i&&kt||nt>z&&kt,fa=!1;const La=Array.isArray(mt)?mt:[mt];let Ra=La.reduce(c(Pe),{});mn===!1&&(Ra={});const{prevResolvedValues:ma={}}=se,yt={...ma,...Ra},lt=pi=>{Sa=!0,F.has(pi)&&(fa=!0,F.delete(pi)),se.needsAnimating[pi]=!0;const ba=t.getValue(pi);ba&&(ba.liveStyle=!1)};for(const pi in yt){const ba=Ra[pi],Sc=ma[pi];if(N.hasOwnProperty(pi))continue;let ms=!1;isKeyframesTarget(ba)&&isKeyframesTarget(Sc)?ms=!shallowCompare(ba,Sc):ms=ba!==Sc,ms?ba!=null?lt(pi):F.add(pi):ba!==void 0&&F.has(pi)?lt(pi):se.protectedKeys[pi]=!0}se.prevProp=mt,se.prevResolvedValues=Ra,se.isActive&&(N={...N,...Ra}),s&&t.blockInitialAnimation&&(Sa=!1),Sa&&(!_i||fa)&&L.push(...La.map(pi=>({animation:pi,options:{type:Pe}})))}if(F.size){const nt={};F.forEach(Pe=>{const se=t.getBaseTarget(Pe),mt=t.getValue(Pe);mt&&(mt.liveStyle=!0),nt[Pe]=se===void 0?null:se}),L.push({animation:nt})}let W=!!L.length;return s&&(S.initial===!1||S.initial===S.animate)&&!t.manuallyAnimateOnMount&&(W=!1),s=!1,W?n(L):Promise.resolve()}function p(y,S){var P;if(o[y].isActive===S)return Promise.resolve();(P=t.variantChildren)===null||P===void 0||P.forEach(F=>{var N;return(N=F.animationState)===null||N===void 0?void 0:N.setActive(y,S)}),o[y].isActive=S;const L=h(y);for(const F in o)o[F].protectedKeys={};return L}return{animateChanges:h,setActive:p,setAnimateFunction:d,getState:()=>o}}function checkVariantsDidChange(t,n){return typeof n=="string"?n!==t:Array.isArray(n)?!shallowCompare(n,t):!1}function createTypeState(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(n){super(n),n.animationState||(n.animationState=createAnimationState(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();this.unmount(),isAnimationControls(n)&&(this.unmount=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:o}=this.node.prevProps||{};n!==o&&this.updateAnimationControlsSubscription()}unmount(){}}let id$1=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$1++}update(){if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:o}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===s)return;const c=this.node.animationState.setActive("exit",!n);o&&!n&&c.then(()=>o(this.id))}mount(){const{register:n}=this.node.presenceContext||{};n&&(this.unmount=n(this.id))}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(t,n)=>Math.abs(t-n);function distance2D(t,n){const o=distance(t.x,n.x),s=distance(t.y,n.y);return Math.sqrt(o**2+s**2)}class PanSession{constructor(n,o,{transformPagePoint:s,contextWindow:c,dragSnapToOrigin:d=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=getPanInfo(this.lastMoveEventInfo,this.history),F=this.startEvent!==null,N=distance2D(L.offset,{x:0,y:0})>=3;if(!F&&!N)return;const{point:z}=L,{timestamp:W}=frameData;this.history.push({...z,timestamp:W});const{onStart:nt,onMove:Pe}=this.handlers;F||(nt&&nt(this.lastMoveEvent,L),this.startEvent=this.lastMoveEvent),Pe&&Pe(this.lastMoveEvent,L)},this.handlePointerMove=(L,F)=>{this.lastMoveEvent=L,this.lastMoveEventInfo=transformPoint(F,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(L,F)=>{this.end();const{onEnd:N,onSessionEnd:z,resumeAnimation:W}=this.handlers;if(this.dragSnapToOrigin&&W&&W(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const nt=getPanInfo(L.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(F,this.transformPagePoint),this.history);this.startEvent&&N&&N(L,nt),z&&z(L,nt)},!isPrimaryPointer(n))return;this.dragSnapToOrigin=d,this.handlers=o,this.transformPagePoint=s,this.contextWindow=c||window;const h=extractEventInfo(n),p=transformPoint(h,this.transformPagePoint),{point:y}=p,{timestamp:S}=frameData;this.history=[{...y,timestamp:S}];const{onSessionStart:P}=o;P&&P(n,getPanInfo(p,this.history)),this.removeListeners=pipe(addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove),addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp),addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),cancelFrame(this.updatePoint)}}function transformPoint(t,n){return n?{point:n(t.point)}:t}function subtractPoint(t,n){return{x:t.x-n.x,y:t.y-n.y}}function getPanInfo({point:t},n){return{point:t,delta:subtractPoint(t,lastDevicePoint(n)),offset:subtractPoint(t,startDevicePoint(n)),velocity:getVelocity(n,.1)}}function startDevicePoint(t){return t[0]}function lastDevicePoint(t){return t[t.length-1]}function getVelocity(t,n){if(t.length<2)return{x:0,y:0};let o=t.length-1,s=null;const c=lastDevicePoint(t);for(;o>=0&&(s=t[o],!(c.timestamp-s.timestamp>secondsToMilliseconds(n)));)o--;if(!s)return{x:0,y:0};const d=millisecondsToSeconds(c.timestamp-s.timestamp);if(d===0)return{x:0,y:0};const h={x:(c.x-s.x)/d,y:(c.y-s.y)/d};return h.x===1/0&&(h.x=0),h.y===1/0&&(h.y=0),h}function calcLength(t){return t.max-t.min}function isNear(t,n=0,o=.01){return Math.abs(t-n)<=o}function calcAxisDelta(t,n,o,s=.5){t.origin=s,t.originPoint=mixNumber$1(n.min,n.max,t.origin),t.scale=calcLength(o)/calcLength(n),(isNear(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=mixNumber$1(o.min,o.max,t.origin)-t.originPoint,(isNear(t.translate)||isNaN(t.translate))&&(t.translate=0)}function calcBoxDelta(t,n,o,s){calcAxisDelta(t.x,n.x,o.x,s?s.originX:void 0),calcAxisDelta(t.y,n.y,o.y,s?s.originY:void 0)}function calcRelativeAxis(t,n,o){t.min=o.min+n.min,t.max=t.min+calcLength(n)}function calcRelativeBox(t,n,o){calcRelativeAxis(t.x,n.x,o.x),calcRelativeAxis(t.y,n.y,o.y)}function calcRelativeAxisPosition(t,n,o){t.min=n.min-o.min,t.max=t.min+calcLength(n)}function calcRelativePosition(t,n,o){calcRelativeAxisPosition(t.x,n.x,o.x),calcRelativeAxisPosition(t.y,n.y,o.y)}function applyConstraints(t,{min:n,max:o},s){return n!==void 0&&t<n?t=s?mixNumber$1(n,t,s.min):Math.max(t,n):o!==void 0&&t>o&&(t=s?mixNumber$1(o,t,s.max):Math.min(t,o)),t}function calcRelativeAxisConstraints(t,n,o){return{min:n!==void 0?t.min+n:void 0,max:o!==void 0?t.max+o-(t.max-t.min):void 0}}function calcRelativeConstraints(t,{top:n,left:o,bottom:s,right:c}){return{x:calcRelativeAxisConstraints(t.x,o,c),y:calcRelativeAxisConstraints(t.y,n,s)}}function calcViewportAxisConstraints(t,n){let o=n.min-t.min,s=n.max-t.max;return n.max-n.min<t.max-t.min&&([o,s]=[s,o]),{min:o,max:s}}function calcViewportConstraints(t,n){return{x:calcViewportAxisConstraints(t.x,n.x),y:calcViewportAxisConstraints(t.y,n.y)}}function calcOrigin(t,n){let o=.5;const s=calcLength(t),c=calcLength(n);return c>s?o=progress(n.min,n.max-s,t.min):s>c&&(o=progress(t.min,t.max-c,n.min)),clamp(0,1,o)}function rebaseAxisConstraints(t,n){const o={};return n.min!==void 0&&(o.min=n.min-t.min),n.max!==void 0&&(o.max=n.max-t.min),o}const defaultElastic=.35;function resolveDragElastic(t=defaultElastic){return t===!1?t=0:t===!0&&(t=defaultElastic),{x:resolveAxisElastic(t,"left","right"),y:resolveAxisElastic(t,"top","bottom")}}function resolveAxisElastic(t,n,o){return{min:resolvePointElastic(t,n),max:resolvePointElastic(t,o)}}function resolvePointElastic(t,n){return typeof t=="number"?t:t[n]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(t){return[t("x"),t("y")]}function convertBoundingBoxToBox({top:t,left:n,right:o,bottom:s}){return{x:{min:n,max:o},y:{min:t,max:s}}}function convertBoxToBoundingBox({x:t,y:n}){return{top:n.min,right:t.max,bottom:n.max,left:t.min}}function transformBoxPoints(t,n){if(!n)return t;const o=n({x:t.left,y:t.top}),s=n({x:t.right,y:t.bottom});return{top:o.y,left:o.x,bottom:s.y,right:s.x}}function isIdentityScale(t){return t===void 0||t===1}function hasScale({scale:t,scaleX:n,scaleY:o}){return!isIdentityScale(t)||!isIdentityScale(n)||!isIdentityScale(o)}function hasTransform(t){return hasScale(t)||has2DTranslate(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function has2DTranslate(t){return is2DTranslate(t.x)||is2DTranslate(t.y)}function is2DTranslate(t){return t&&t!=="0%"}function scalePoint(t,n,o){const s=t-o,c=n*s;return o+c}function applyPointDelta(t,n,o,s,c){return c!==void 0&&(t=scalePoint(t,c,s)),scalePoint(t,o,s)+n}function applyAxisDelta(t,n=0,o=1,s,c){t.min=applyPointDelta(t.min,n,o,s,c),t.max=applyPointDelta(t.max,n,o,s,c)}function applyBoxDelta(t,{x:n,y:o}){applyAxisDelta(t.x,n.translate,n.scale,n.originPoint),applyAxisDelta(t.y,o.translate,o.scale,o.originPoint)}function applyTreeDeltas(t,n,o,s=!1){const c=o.length;if(!c)return;n.x=n.y=1;let d,h;for(let p=0;p<c;p++){d=o[p],h=d.projectionDelta;const y=d.instance;y&&y.style&&y.style.display==="contents"||(s&&d.options.layoutScroll&&d.scroll&&d!==d.root&&transformBox(t,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),h&&(n.x*=h.x.scale,n.y*=h.y.scale,applyBoxDelta(t,h)),s&&hasTransform(d.latestValues)&&transformBox(t,d.latestValues))}n.x=snapToDefault(n.x),n.y=snapToDefault(n.y)}function snapToDefault(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function translateAxis(t,n){t.min=t.min+n,t.max=t.max+n}function transformAxis(t,n,[o,s,c]){const d=n[c]!==void 0?n[c]:.5,h=mixNumber$1(t.min,t.max,d);applyAxisDelta(t,n[o],n[s],h,n.scale)}const xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(t,n){transformAxis(t.x,n,xKeys$1),transformAxis(t.y,n,yKeys$1)}function measureViewportBox(t,n){return convertBoundingBoxToBox(transformBoxPoints(t.getBoundingClientRect(),n))}function measurePageBox(t,n,o){const s=measureViewportBox(t,o),{scroll:c}=n;return c&&(translateAxis(s.x,c.offset.x),translateAxis(s.y,c.offset.y)),s}const getContextWindow=({current:t})=>t?t.ownerDocument.defaultView:null,elementDragControls=new WeakMap;class VisualElementDragControls{constructor(n){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=n}start(n,{snapToCursor:o=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const c=P=>{const{dragSnapToOrigin:L}=this.getProps();L?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(extractEventInfo(P,"page").point)},d=(P,L)=>{const{drag:F,dragPropagation:N,onDragStart:z}=this.getProps();if(F&&!N&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(F),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(nt=>{let Pe=this.getAxisMotionValue(nt).get()||0;if(percent.test(Pe)){const{projection:se}=this.visualElement;if(se&&se.layout){const mt=se.layout.layoutBox[nt];mt&&(Pe=calcLength(mt)*(parseFloat(Pe)/100))}}this.originPoint[nt]=Pe}),z&&z(P,L);const{animationState:W}=this.visualElement;W&&W.setActive("whileDrag",!0)},h=(P,L)=>{const{dragPropagation:F,dragDirectionLock:N,onDirectionLock:z,onDrag:W}=this.getProps();if(!F&&!this.openGlobalLock)return;const{offset:nt}=L;if(N&&this.currentDirection===null){this.currentDirection=getCurrentDirection(nt),this.currentDirection!==null&&z&&z(this.currentDirection);return}this.updateAxis("x",L.point,nt),this.updateAxis("y",L.point,nt),this.visualElement.render(),W&&W(P,L)},p=(P,L)=>this.stop(P,L),y=()=>eachAxis(P=>{var L;return this.getAnimationState(P)==="paused"&&((L=this.getAxisMotionValue(P).animation)===null||L===void 0?void 0:L.play())}),{dragSnapToOrigin:S}=this.getProps();this.panSession=new PanSession(n,{onSessionStart:c,onStart:d,onMove:h,onSessionEnd:p,resumeAnimation:y},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:S,contextWindow:getContextWindow(this.visualElement)})}stop(n,o){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&d(n,o)}cancel(){this.isDragging=!1;const{projection:n,animationState:o}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),o&&o.setActive("whileDrag",!1)}updateAxis(n,o,s){const{drag:c}=this.getProps();if(!s||!shouldDrag(n,c,this.currentDirection))return;const d=this.getAxisMotionValue(n);let h=this.originPoint[n]+s[n];this.constraints&&this.constraints[n]&&(h=applyConstraints(h,this.constraints[n],this.elastic[n])),d.set(h)}resolveConstraints(){var n;const{dragConstraints:o,dragElastic:s}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(n=this.visualElement.projection)===null||n===void 0?void 0:n.layout,d=this.constraints;o&&isRefObject(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&c?this.constraints=calcRelativeConstraints(c.layoutBox,o):this.constraints=!1,this.elastic=resolveDragElastic(s),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(h=>{this.getAxisMotionValue(h)&&(this.constraints[h]=rebaseAxisConstraints(c.layoutBox[h],this.constraints[h]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:o}=this.getProps();if(!n||!isRefObject(n))return!1;const s=n.current;invariant(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=measurePageBox(s,c.root,this.visualElement.getTransformPagePoint());let h=calcViewportConstraints(c.layout.layoutBox,d);if(o){const p=o(convertBoxToBoundingBox(h));this.hasMutatedConstraints=!!p,p&&(h=convertBoundingBoxToBox(p))}return h}startAnimation(n){const{drag:o,dragMomentum:s,dragElastic:c,dragTransition:d,dragSnapToOrigin:h,onDragTransitionEnd:p}=this.getProps(),y=this.constraints||{},S=eachAxis(P=>{if(!shouldDrag(P,o,this.currentDirection))return;let L=y[P]||{};h&&(L={min:0,max:0});const F=c?200:1e6,N=c?40:1e7,z={type:"inertia",velocity:s?n[P]:0,bounceStiffness:F,bounceDamping:N,timeConstant:750,restDelta:1,restSpeed:10,...d,...L};return this.startAxisValueAnimation(P,z)});return Promise.all(S).then(p)}startAxisValueAnimation(n,o){const s=this.getAxisMotionValue(n);return s.start(animateMotionValue(n,s,0,o,this.visualElement))}stopAnimation(){eachAxis(n=>this.getAxisMotionValue(n).stop())}pauseAnimation(){eachAxis(n=>{var o;return(o=this.getAxisMotionValue(n).animation)===null||o===void 0?void 0:o.pause()})}getAnimationState(n){var o;return(o=this.getAxisMotionValue(n).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(n){const o="_drag"+n.toUpperCase(),s=this.visualElement.getProps(),c=s[o];return c||this.visualElement.getValue(n,(s.initial?s.initial[n]:void 0)||0)}snapToCursor(n){eachAxis(o=>{const{drag:s}=this.getProps();if(!shouldDrag(o,s,this.currentDirection))return;const{projection:c}=this.visualElement,d=this.getAxisMotionValue(o);if(c&&c.layout){const{min:h,max:p}=c.layout.layoutBox[o];d.set(n[o]-mixNumber$1(h,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:o}=this.getProps(),{projection:s}=this.visualElement;if(!isRefObject(o)||!s||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};eachAxis(h=>{const p=this.getAxisMotionValue(h);if(p){const y=p.get();c[h]=calcOrigin({min:y,max:y},this.constraints[h])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),eachAxis(h=>{if(!shouldDrag(h,n,null))return;const p=this.getAxisMotionValue(h),{min:y,max:S}=this.constraints[h];p.set(mixNumber$1(y,S,c[h]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const n=this.visualElement.current,o=addPointerEvent(n,"pointerdown",y=>{const{drag:S,dragListener:P=!0}=this.getProps();S&&P&&this.start(y)}),s=()=>{const{dragConstraints:y}=this.getProps();isRefObject(y)&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,d=c.addEventListener("measure",s);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),s();const h=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",({delta:y,hasLayoutChanged:S})=>{this.isDragging&&S&&(eachAxis(P=>{const L=this.getAxisMotionValue(P);L&&(this.originPoint[P]+=y[P].translate,L.set(L.get()+y[P].translate))}),this.visualElement.render())});return()=>{h(),o(),d(),p&&p()}}getProps(){const n=this.visualElement.getProps(),{drag:o=!1,dragDirectionLock:s=!1,dragPropagation:c=!1,dragConstraints:d=!1,dragElastic:h=defaultElastic,dragMomentum:p=!0}=n;return{...n,drag:o,dragDirectionLock:s,dragPropagation:c,dragConstraints:d,dragElastic:h,dragMomentum:p}}}function shouldDrag(t,n,o){return(n===!0||n===t)&&(o===null||o===t)}function getCurrentDirection(t,n=10){let o=null;return Math.abs(t.y)>n?o="y":Math.abs(t.x)>n&&(o="x"),o}class DragGesture extends Feature{constructor(n){super(n),this.removeGroupControls=noop$1,this.removeListeners=noop$1,this.controls=new VisualElementDragControls(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$1}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=t=>(n,o)=>{t&&t(n,o)};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$1}onPointerDown(n){this.session=new PanSession(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:getContextWindow(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:o,onPan:s,onPanEnd:c}=this.node.getProps();return{onSessionStart:asyncHandler(n),onStart:asyncHandler(o),onMove:s,onEnd:(d,h)=>{delete this.session,c&&c(d,h)}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const t=React.useContext(PresenceContext);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:o,register:s}=t,c=React.useId();return React.useEffect(()=>s(c),[]),!n&&o?[!1,()=>o&&o(c)]:[!0]}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pixelsToPercent(t,n){return n.max===n.min?0:t/(n.max-n.min)*100}const correctBorderRadius={correct:(t,n)=>{if(!n.target)return t;if(typeof t=="string")if(px.test(t))t=parseFloat(t);else return t;const o=pixelsToPercent(t,n.target.x),s=pixelsToPercent(t,n.target.y);return`${o}% ${s}%`}},correctBoxShadow={correct:(t,{treeScale:n,projectionDelta:o})=>{const s=t,c=complex.parse(t);if(c.length>5)return s;const d=complex.createTransformer(t),h=typeof c[0]!="number"?1:0,p=o.x.scale*n.x,y=o.y.scale*n.y;c[0+h]/=p,c[1+h]/=y;const S=mixNumber$1(p,y,.5);return typeof c[2+h]=="number"&&(c[2+h]/=S),typeof c[3+h]=="number"&&(c[3+h]/=S),d(c)}};class MeasureLayoutWithContext extends React.Component{componentDidMount(){const{visualElement:n,layoutGroup:o,switchLayoutGroup:s,layoutId:c}=this.props,{projection:d}=n;addScaleCorrector(defaultScaleCorrectors),d&&(o.group&&o.group.add(d),s&&s.register&&c&&s.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:o,visualElement:s,drag:c,isPresent:d}=this.props,h=s.projection;return h&&(h.isPresent=d,c||n.layoutDependency!==o||o===void 0?h.willUpdate():this.safeToRemove(),n.isPresent!==d&&(d?h.promote():h.relegate()||frame.postRender(()=>{const p=h.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:n}=this.props.visualElement;n&&(n.root.didUpdate(),microtask.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:o,switchLayoutGroup:s}=this.props,{projection:c}=n;c&&(c.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(c),s&&s.deregister&&s.deregister(c))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function MeasureLayout(t){const[n,o]=usePresence(),s=React.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,{...t,layoutGroup:s,switchLayoutGroup:React.useContext(SwitchLayoutGroupContext),isPresent:n,safeToRemove:o})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=t=>typeof t=="string"?parseFloat(t):t,isPx=t=>typeof t=="number"||px.test(t);function mixValues(t,n,o,s,c,d){c?(t.opacity=mixNumber$1(0,o.opacity!==void 0?o.opacity:1,easeCrossfadeIn(s)),t.opacityExit=mixNumber$1(n.opacity!==void 0?n.opacity:1,0,easeCrossfadeOut(s))):d&&(t.opacity=mixNumber$1(n.opacity!==void 0?n.opacity:1,o.opacity!==void 0?o.opacity:1,s));for(let h=0;h<numBorders;h++){const p=`border${borders[h]}Radius`;let y=getRadius(n,p),S=getRadius(o,p);if(y===void 0&&S===void 0)continue;y||(y=0),S||(S=0),y===0||S===0||isPx(y)===isPx(S)?(t[p]=Math.max(mixNumber$1(asNumber(y),asNumber(S),s),0),(percent.test(S)||percent.test(y))&&(t[p]+="%")):t[p]=S}(n.rotate||o.rotate)&&(t.rotate=mixNumber$1(n.rotate||0,o.rotate||0,s))}function getRadius(t,n){return t[n]!==void 0?t[n]:t.borderRadius}const easeCrossfadeIn=compress(0,.5,circOut),easeCrossfadeOut=compress(.5,.95,noop$1);function compress(t,n,o){return s=>s<t?0:s>n?1:o(progress(t,n,s))}function copyAxisInto(t,n){t.min=n.min,t.max=n.max}function copyBoxInto(t,n){copyAxisInto(t.x,n.x),copyAxisInto(t.y,n.y)}function removePointDelta(t,n,o,s,c){return t-=n,t=scalePoint(t,1/o,s),c!==void 0&&(t=scalePoint(t,1/c,s)),t}function removeAxisDelta(t,n=0,o=1,s=.5,c,d=t,h=t){if(percent.test(n)&&(n=parseFloat(n),n=mixNumber$1(h.min,h.max,n/100)-h.min),typeof n!="number")return;let p=mixNumber$1(d.min,d.max,s);t===d&&(p-=n),t.min=removePointDelta(t.min,n,o,p,c),t.max=removePointDelta(t.max,n,o,p,c)}function removeAxisTransforms(t,n,[o,s,c],d,h){removeAxisDelta(t,n[o],n[s],n[c],n.scale,d,h)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(t,n,o,s){removeAxisTransforms(t.x,n,xKeys,o?o.x:void 0,s?s.x:void 0),removeAxisTransforms(t.y,n,yKeys,o?o.y:void 0,s?s.y:void 0)}function isAxisDeltaZero(t){return t.translate===0&&t.scale===1}function isDeltaZero(t){return isAxisDeltaZero(t.x)&&isAxisDeltaZero(t.y)}function boxEquals(t,n){return t.x.min===n.x.min&&t.x.max===n.x.max&&t.y.min===n.y.min&&t.y.max===n.y.max}function boxEqualsRounded(t,n){return Math.round(t.x.min)===Math.round(n.x.min)&&Math.round(t.x.max)===Math.round(n.x.max)&&Math.round(t.y.min)===Math.round(n.y.min)&&Math.round(t.y.max)===Math.round(n.y.max)}function aspectRatio(t){return calcLength(t.x)/calcLength(t.y)}class NodeStack{constructor(){this.members=[]}add(n){addUniqueItem(this.members,n),n.scheduleRender()}remove(n){if(removeItem(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const o=this.members[this.members.length-1];o&&this.promote(o)}}relegate(n){const o=this.members.findIndex(c=>n===c);if(o===0)return!1;let s;for(let c=o;c>=0;c--){const d=this.members[c];if(d.isPresent!==!1){s=d;break}}return s?(this.promote(s),!0):!1}promote(n,o){const s=this.lead;if(n!==s&&(this.prevLead=s,this.lead=n,n.show(),s)){s.instance&&s.scheduleRender(),n.scheduleRender(),n.resumeFrom=s,o&&(n.resumeFrom.preserveOpacity=!0),s.snapshot&&(n.snapshot=s.snapshot,n.snapshot.latestValues=s.animationValues||s.latestValues),n.root&&n.root.isUpdating&&(n.isLayoutDirty=!0);const{crossfade:c}=n.options;c===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(n=>{const{options:o,resumingFrom:s}=n;o.onExitComplete&&o.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(n=>{n.instance&&n.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(t,n,o){let s="";const c=t.x.translate/n.x,d=t.y.translate/n.y,h=(o==null?void 0:o.z)||0;if((c||d||h)&&(s=`translate3d(${c}px, ${d}px, ${h}px) `),(n.x!==1||n.y!==1)&&(s+=`scale(${1/n.x}, ${1/n.y}) `),o){const{transformPerspective:S,rotate:P,rotateX:L,rotateY:F,skewX:N,skewY:z}=o;S&&(s=`perspective(${S}px) ${s}`),P&&(s+=`rotate(${P}deg) `),L&&(s+=`rotateX(${L}deg) `),F&&(s+=`rotateY(${F}deg) `),N&&(s+=`skewX(${N}deg) `),z&&(s+=`skewY(${z}deg) `)}const p=t.x.scale*n.x,y=t.y.scale*n.y;return(p!==1||y!==1)&&(s+=`scale(${p}, ${y})`),s||"none"}const compareByDepth=(t,n)=>t.depth-n.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(n){addUniqueItem(this.children,n),this.isDirty=!0}remove(n){removeItem(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(n)}}function delay(t,n){const o=time.now(),s=({timestamp:c})=>{const d=c-o;d>=n&&(cancelFrame(s),t(d-n))};return frame.read(s,!0),()=>cancelFrame(s)}function record(t){window.MotionDebug&&window.MotionDebug.record(t)}function isSVGElement(t){return t instanceof SVGElement&&t.tagName!=="svg"}function animateSingleValue(t,n,o){const s=isMotionValue(t)?t:motionValue(t);return s.start(animateMotionValue("",s,n,o)),s.animation}const transformAxes=["","X","Y","Z"],hiddenVisibility={visibility:"hidden"},animationTarget=1e3;let id=0;const projectionFrameData={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function resetDistortingTransform(t,n,o,s){const{latestValues:c}=n;c[t]&&(o[t]=c[t],n.setStaticValue(t,0),s&&(s[t]=0))}function createProjectionNode({attachResizeListener:t,defaultParent:n,measureScroll:o,checkIsScrollRoot:s,resetTransform:c}){return class{constructor(h={},p=n==null?void 0:n()){this.id=id++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,projectionFrameData.totalNodes=projectionFrameData.resolvedTargetDeltas=projectionFrameData.recalculatedProjection=0,this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),record(projectionFrameData)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=h,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let y=0;y<this.path.length;y++)this.path[y].shouldResetTransform=!0;this.root===this&&(this.nodes=new FlatTree)}addEventListener(h,p){return this.eventHandlers.has(h)||this.eventHandlers.set(h,new SubscriptionManager),this.eventHandlers.get(h).add(p)}notifyListeners(h,...p){const y=this.eventHandlers.get(h);y&&y.notify(...p)}hasListeners(h){return this.eventHandlers.has(h)}mount(h,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=isSVGElement(h),this.instance=h;const{layoutId:y,layout:S,visualElement:P}=this.options;if(P&&!P.current&&P.mount(h),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(S||y)&&(this.isLayoutDirty=!0),t){let L;const F=()=>this.root.updateBlockedByResize=!1;t(h,()=>{this.root.updateBlockedByResize=!0,L&&L(),L=delay(F,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}y&&this.root.registerSharedNode(y,this),this.options.animate!==!1&&P&&(y||S)&&this.addEventListener("didUpdate",({delta:L,hasLayoutChanged:F,hasRelativeTargetChanged:N,layout:z})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const W=this.options.transition||P.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:nt,onLayoutAnimationComplete:Pe}=P.getProps(),se=!this.targetLayout||!boxEqualsRounded(this.targetLayout,z)||N,mt=!F&&N;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||mt||F&&(se||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(L,mt);const kt={...getValueTransition(W,"layout"),onPlay:nt,onComplete:Pe};(P.shouldReduceMotion||this.options.layoutRoot)&&(kt.delay=0,kt.type=!1),this.startAnimation(kt)}else F||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=z})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const h=this.getStack();h&&h.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelFrame(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetSkewAndRotation),this.animationId++)}getTransformTemplate(){const{visualElement:h}=this.options;return h&&h.getProps().transformTemplate}willUpdate(h=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let P=0;P<this.path.length;P++){const L=this.path[P];L.shouldResetTransform=!0,L.updateScroll("snapshot"),L.options.layoutRoot&&L.willUpdate(!1)}const{layoutId:p,layout:y}=this.options;if(p===void 0&&!y)return;const S=this.getTransformTemplate();this.prevTransformTemplateValue=S?S(this.latestValues,""):void 0,this.updateSnapshot(),h&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(clearMeasurements);return}this.isUpdating||this.nodes.forEach(clearIsLayoutDirty),this.isUpdating=!1,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes.forEach(resetTransformStyle),this.nodes.forEach(updateLayout),this.nodes.forEach(notifyLayoutUpdate),this.clearAllSnapshots();const p=time.now();frameData.delta=clamp(0,1e3/60,p-frameData.timestamp),frameData.timestamp=p,frameData.isProcessing=!0,steps.update.process(frameData),steps.preRender.process(frameData),steps.render.process(frameData),frameData.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,microtask.read(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(clearSnapshot),this.sharedNodes.forEach(removeLeadSnapshots)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,frame.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){frame.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let y=0;y<this.path.length;y++)this.path[y].updateScroll();const h=this.layout;this.layout=this.measure(!1),this.layoutCorrected=createBox(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,h?h.layoutBox:void 0)}updateScroll(h="measure"){let p=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===h&&(p=!1),p&&(this.scroll={animationId:this.root.animationId,phase:h,isRoot:s(this.instance),offset:o(this.instance)})}resetTransform(){if(!c)return;const h=this.isLayoutDirty||this.shouldResetTransform,p=this.projectionDelta&&!isDeltaZero(this.projectionDelta),y=this.getTransformTemplate(),S=y?y(this.latestValues,""):void 0,P=S!==this.prevTransformTemplateValue;h&&(p||hasTransform(this.latestValues)||P)&&(c(this.instance,S),this.shouldResetTransform=!1,this.scheduleRender())}measure(h=!0){const p=this.measurePageBox();let y=this.removeElementScroll(p);return h&&(y=this.removeTransform(y)),roundBox(y),{animationId:this.root.animationId,measuredBox:p,layoutBox:y,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:h}=this.options;if(!h)return createBox();const p=h.measureViewportBox(),{scroll:y}=this.root;return y&&(translateAxis(p.x,y.offset.x),translateAxis(p.y,y.offset.y)),p}removeElementScroll(h){const p=createBox();copyBoxInto(p,h);for(let y=0;y<this.path.length;y++){const S=this.path[y],{scroll:P,options:L}=S;if(S!==this.root&&P&&L.layoutScroll){if(P.isRoot){copyBoxInto(p,h);const{scroll:F}=this.root;F&&(translateAxis(p.x,-F.offset.x),translateAxis(p.y,-F.offset.y))}translateAxis(p.x,P.offset.x),translateAxis(p.y,P.offset.y)}}return p}applyTransform(h,p=!1){const y=createBox();copyBoxInto(y,h);for(let S=0;S<this.path.length;S++){const P=this.path[S];!p&&P.options.layoutScroll&&P.scroll&&P!==P.root&&transformBox(y,{x:-P.scroll.offset.x,y:-P.scroll.offset.y}),hasTransform(P.latestValues)&&transformBox(y,P.latestValues)}return hasTransform(this.latestValues)&&transformBox(y,this.latestValues),y}removeTransform(h){const p=createBox();copyBoxInto(p,h);for(let y=0;y<this.path.length;y++){const S=this.path[y];if(!S.instance||!hasTransform(S.latestValues))continue;hasScale(S.latestValues)&&S.updateSnapshot();const P=createBox(),L=S.measurePageBox();copyBoxInto(P,L),removeBoxTransforms(p,S.latestValues,S.snapshot?S.snapshot.layoutBox:void 0,P)}return hasTransform(this.latestValues)&&removeBoxTransforms(p,this.latestValues),p}setTargetDelta(h){this.targetDelta=h,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(h){this.options={...this.options,...h,crossfade:h.crossfade!==void 0?h.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==frameData.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(h=!1){var p;const y=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=y.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=y.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=y.isSharedProjectionDirty);const S=!!this.resumingFrom||this!==y;if(!(h||S&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:L,layoutId:F}=this.options;if(!(!this.layout||!(L||F))){if(this.resolvedRelativeTargetAt=frameData.timestamp,!this.targetDelta&&!this.relativeTarget){const N=this.getClosestProjectingParent();N&&N.layout&&this.animationProgress!==1?(this.relativeParent=N,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.layout.layoutBox,N.layout.layoutBox),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=createBox(),this.targetWithTransforms=createBox()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),calcRelativeBox(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):copyBoxInto(this.target,this.layout.layoutBox),applyBoxDelta(this.target,this.targetDelta)):copyBoxInto(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const N=this.getClosestProjectingParent();N&&!!N.resumingFrom==!!this.resumingFrom&&!N.options.layoutScroll&&N.target&&this.animationProgress!==1?(this.relativeParent=N,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.target,N.target),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}projectionFrameData.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||hasScale(this.parent.latestValues)||has2DTranslate(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var h;const p=this.getLead(),y=!!this.resumingFrom||this!==p;let S=!0;if((this.isProjectionDirty||!((h=this.parent)===null||h===void 0)&&h.isProjectionDirty)&&(S=!1),y&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(S=!1),this.resolvedRelativeTargetAt===frameData.timestamp&&(S=!1),S)return;const{layout:P,layoutId:L}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(P||L))return;copyBoxInto(this.layoutCorrected,this.layout.layoutBox);const F=this.treeScale.x,N=this.treeScale.y;applyTreeDeltas(this.layoutCorrected,this.treeScale,this.path,y),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=createBox());const{target:z}=p;if(!z){this.projectionTransform&&(this.projectionDelta=createDelta(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=createDelta(),this.projectionDeltaWithTransform=createDelta());const W=this.projectionTransform;calcBoxDelta(this.projectionDelta,this.layoutCorrected,z,this.latestValues),this.projectionTransform=buildProjectionTransform(this.projectionDelta,this.treeScale),(this.projectionTransform!==W||this.treeScale.x!==F||this.treeScale.y!==N)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",z)),projectionFrameData.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(h=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),h){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(h,p=!1){const y=this.snapshot,S=y?y.latestValues:{},P={...this.latestValues},L=createDelta();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const F=createBox(),N=y?y.source:void 0,z=this.layout?this.layout.source:void 0,W=N!==z,nt=this.getStack(),Pe=!nt||nt.members.length<=1,se=!!(W&&!Pe&&this.options.crossfade===!0&&!this.path.some(hasOpacityCrossfade));this.animationProgress=0;let mt;this.mixTargetDelta=kt=>{const mn=kt/1e3;mixAxisDelta(L.x,h.x,mn),mixAxisDelta(L.y,h.y,mn),this.setTargetDelta(L),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(F,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,F,mn),mt&&boxEquals(this.relativeTarget,mt)&&(this.isProjectionDirty=!1),mt||(mt=createBox()),copyBoxInto(mt,this.relativeTarget)),W&&(this.animationValues=P,mixValues(P,S,this.latestValues,mn,se,Pe)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=mn},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(h){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelFrame(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=frame.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...h,onUpdate:p=>{this.mixTargetDelta(p),h.onUpdate&&h.onUpdate(p)},onComplete:()=>{h.onComplete&&h.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const h=this.getStack();h&&h.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const h=this.getLead();let{targetWithTransforms:p,target:y,layout:S,latestValues:P}=h;if(!(!p||!y||!S)){if(this!==h&&this.layout&&S&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,S.layoutBox)){y=this.target||createBox();const L=calcLength(this.layout.layoutBox.x);y.x.min=h.target.x.min,y.x.max=y.x.min+L;const F=calcLength(this.layout.layoutBox.y);y.y.min=h.target.y.min,y.y.max=y.y.min+F}copyBoxInto(p,y),transformBox(p,P),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,p,P)}}registerSharedNode(h,p){this.sharedNodes.has(h)||this.sharedNodes.set(h,new NodeStack),this.sharedNodes.get(h).add(p);const S=p.options.initialPromotionConfig;p.promote({transition:S?S.transition:void 0,preserveFollowOpacity:S&&S.shouldPreserveFollowOpacity?S.shouldPreserveFollowOpacity(p):void 0})}isLead(){const h=this.getStack();return h?h.lead===this:!0}getLead(){var h;const{layoutId:p}=this.options;return p?((h=this.getStack())===null||h===void 0?void 0:h.lead)||this:this}getPrevLead(){var h;const{layoutId:p}=this.options;return p?(h=this.getStack())===null||h===void 0?void 0:h.prevLead:void 0}getStack(){const{layoutId:h}=this.options;if(h)return this.root.sharedNodes.get(h)}promote({needsReset:h,transition:p,preserveFollowOpacity:y}={}){const S=this.getStack();S&&S.promote(this,y),h&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const h=this.getStack();return h?h.relegate(this):!1}resetSkewAndRotation(){const{visualElement:h}=this.options;if(!h)return;let p=!1;const{latestValues:y}=h;if((y.z||y.rotate||y.rotateX||y.rotateY||y.rotateZ||y.skewX||y.skewY)&&(p=!0),!p)return;const S={};y.z&&resetDistortingTransform("z",h,S,this.animationValues);for(let P=0;P<transformAxes.length;P++)resetDistortingTransform(`rotate${transformAxes[P]}`,h,S,this.animationValues),resetDistortingTransform(`skew${transformAxes[P]}`,h,S,this.animationValues);h.render();for(const P in S)h.setStaticValue(P,S[P]),this.animationValues&&(this.animationValues[P]=S[P]);h.scheduleRender()}getProjectionStyles(h){var p,y;if(!this.instance||this.isSVG)return;if(!this.isVisible)return hiddenVisibility;const S={visibility:""},P=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,S.opacity="",S.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||"",S.transform=P?P(this.latestValues,""):"none",S;const L=this.getLead();if(!this.projectionDelta||!this.layout||!L.target){const W={};return this.options.layoutId&&(W.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,W.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||""),this.hasProjected&&!hasTransform(this.latestValues)&&(W.transform=P?P({},""):"none",this.hasProjected=!1),W}const F=L.animationValues||L.latestValues;this.applyTransformsToTarget(),S.transform=buildProjectionTransform(this.projectionDeltaWithTransform,this.treeScale,F),P&&(S.transform=P(F,S.transform));const{x:N,y:z}=this.projectionDelta;S.transformOrigin=`${N.origin*100}% ${z.origin*100}% 0`,L.animationValues?S.opacity=L===this?(y=(p=F.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&y!==void 0?y:1:this.preserveOpacity?this.latestValues.opacity:F.opacityExit:S.opacity=L===this?F.opacity!==void 0?F.opacity:"":F.opacityExit!==void 0?F.opacityExit:0;for(const W in scaleCorrectors){if(F[W]===void 0)continue;const{correct:nt,applyTo:Pe}=scaleCorrectors[W],se=S.transform==="none"?F[W]:nt(F[W],L);if(Pe){const mt=Pe.length;for(let kt=0;kt<mt;kt++)S[Pe[kt]]=se}else S[W]=se}return this.options.layoutId&&(S.pointerEvents=L===this?resolveMotionValue(h==null?void 0:h.pointerEvents)||"":"none"),S}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(h=>{var p;return(p=h.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(t){t.updateLayout()}function notifyLayoutUpdate(t){var n;const o=((n=t.resumeFrom)===null||n===void 0?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:c}=t.layout,{animationType:d}=t.options,h=o.source!==t.layout.source;d==="size"?eachAxis(L=>{const F=h?o.measuredBox[L]:o.layoutBox[L],N=calcLength(F);F.min=s[L].min,F.max=F.min+N}):shouldAnimatePositionOnly(d,o.layoutBox,s)&&eachAxis(L=>{const F=h?o.measuredBox[L]:o.layoutBox[L],N=calcLength(s[L]);F.max=F.min+N,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[L].max=t.relativeTarget[L].min+N)});const p=createDelta();calcBoxDelta(p,s,o.layoutBox);const y=createDelta();h?calcBoxDelta(y,t.applyTransform(c,!0),o.measuredBox):calcBoxDelta(y,s,o.layoutBox);const S=!isDeltaZero(p);let P=!1;if(!t.resumeFrom){const L=t.getClosestProjectingParent();if(L&&!L.resumeFrom){const{snapshot:F,layout:N}=L;if(F&&N){const z=createBox();calcRelativePosition(z,o.layoutBox,F.layoutBox);const W=createBox();calcRelativePosition(W,s,N.layoutBox),boxEqualsRounded(z,W)||(P=!0),L.options.layoutRoot&&(t.relativeTarget=W,t.relativeTargetOrigin=z,t.relativeParent=L)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:o,delta:y,layoutDelta:p,hasLayoutChanged:S,hasRelativeTargetChanged:P})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function propagateDirtyNodes(t){projectionFrameData.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function cleanDirtyNodes(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function clearSnapshot(t){t.clearSnapshot()}function clearMeasurements(t){t.clearMeasurements()}function clearIsLayoutDirty(t){t.isLayoutDirty=!1}function resetTransformStyle(t){const{visualElement:n}=t.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),t.resetTransform()}function finishAnimation(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function resolveTargetDelta(t){t.resolveTargetDelta()}function calcProjection(t){t.calcProjection()}function resetSkewAndRotation(t){t.resetSkewAndRotation()}function removeLeadSnapshots(t){t.removeLeadSnapshot()}function mixAxisDelta(t,n,o){t.translate=mixNumber$1(n.translate,0,o),t.scale=mixNumber$1(n.scale,1,o),t.origin=n.origin,t.originPoint=n.originPoint}function mixAxis(t,n,o,s){t.min=mixNumber$1(n.min,o.min,s),t.max=mixNumber$1(n.max,o.max,s)}function mixBox(t,n,o,s){mixAxis(t.x,n.x,o.x,s),mixAxis(t.y,n.y,o.y,s)}function hasOpacityCrossfade(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]},userAgentContains=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),roundPoint=userAgentContains("applewebkit/")&&!userAgentContains("chrome/")?Math.round:noop$1;function roundAxis(t){t.min=roundPoint(t.min),t.max=roundPoint(t.max)}function roundBox(t){roundAxis(t.x),roundAxis(t.y)}function shouldAnimatePositionOnly(t,n,o){return t==="position"||t==="preserve-aspect"&&!isNear(aspectRatio(n),aspectRatio(o),.2)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(t,n)=>addDomEvent(t,"resize",n),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const t=new DocumentProjectionNode({});t.mount(window),t.setOptions({layoutScroll:!0}),rootProjectionNode.current=t}return rootProjectionNode.current},resetTransform:(t,n)=>{t.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),n=()=>prefersReducedMotion.current=t.matches;t.addListener(n),n()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(t,n,o){const{willChange:s}=n;for(const c in n){const d=n[c],h=o[c];if(isMotionValue(d))t.addValue(c,d),isWillChangeMotionValue(s)&&s.add(c),process.env.NODE_ENV==="development"&&warnOnce(d.version==="11.0.27",`Attempting to mix Framer Motion versions ${d.version} with 11.0.27 may not work as expected.`);else if(isMotionValue(h))t.addValue(c,motionValue(d,{owner:t})),isWillChangeMotionValue(s)&&s.remove(c);else if(h!==d)if(t.hasValue(c)){const p=t.getValue(c);p.liveStyle===!0?p.jump(d):p.hasAnimated||p.set(d)}else{const p=t.getStaticValue(c);t.addValue(c,motionValue(p!==void 0?p:d,{owner:t}))}}for(const c in o)n[c]===void 0&&t.removeValue(c);return n}const visualElementStore=new WeakMap,valueTypes=[...dimensionValueTypes,color,complex],findValueType=t=>valueTypes.find(testValueType(t)),featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length,propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;function getClosestProjectingNode(t){if(t)return t.options.allowProjection!==!1?t.projection:getClosestProjectingNode(t.parent)}class VisualElement{constructor({parent:n,props:o,presenceContext:s,reducedMotionConfig:c,blockInitialAnimation:d,visualState:h},p={}){this.resolveKeyframes=(F,N,z,W)=>new this.KeyframeResolver(F,N,z,W,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=KeyframeResolver,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>frame.render(this.render,!1,!0);const{latestValues:y,renderState:S}=h;this.latestValues=y,this.baseTarget={...y},this.initialValues=o.initial?{...y}:{},this.renderState=S,this.parent=n,this.props=o,this.presenceContext=s,this.depth=n?n.depth+1:0,this.reducedMotionConfig=c,this.options=p,this.blockInitialAnimation=!!d,this.isControllingVariants=isControllingVariants(o),this.isVariantNode=isVariantNode(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(n&&n.current);const{willChange:P,...L}=this.scrapeMotionValuesFromProps(o,{},this);for(const F in L){const N=L[F];y[F]!==void 0&&isMotionValue(N)&&(N.set(y[F],!1),isWillChangeMotionValue(P)&&P.add(F))}}scrapeMotionValuesFromProps(n,o,s){return{}}mount(n){this.current=n,visualElementStore.set(n,this),this.projection&&!this.projection.instance&&this.projection.mount(n),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,s)=>this.bindToMotionValue(s,o)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,process.env.NODE_ENV!=="production"&&warnOnce(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach(n=>n()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const n in this.events)this.events[n].clear();for(const n in this.features)this.features[n].unmount();this.current=null}bindToMotionValue(n,o){const s=transformProps.has(n),c=o.on("change",h=>{this.latestValues[n]=h,this.props.onUpdate&&frame.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),d=o.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(n,()=>{c(),d(),o.owner&&o.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}loadFeatures({children:n,...o},s,c,d){let h,p;if(process.env.NODE_ENV!=="production"&&c&&s){const y="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";o.ignoreStrict?warning(!1,y):invariant(!1,y)}for(let y=0;y<numFeatures;y++){const S=featureNames[y],{isEnabled:P,Feature:L,ProjectionNode:F,MeasureLayout:N}=featureDefinitions[S];F&&(h=F),P(o)&&(!this.features[S]&&L&&(this.features[S]=new L(this)),N&&(p=N))}if((this.type==="html"||this.type==="svg")&&!this.projection&&h){this.projection=new h(this.latestValues,getClosestProjectingNode(this.parent));const{layoutId:y,layout:S,drag:P,dragConstraints:L,layoutScroll:F,layoutRoot:N}=o;this.projection.setOptions({layoutId:y,layout:S,alwaysMeasureLayout:!!P||L&&isRefObject(L),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof S=="string"?S:"both",initialPromotionConfig:d,layoutScroll:F,layoutRoot:N})}return p}updateFeatures(){for(const n in this.features){const o=this.features[n];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,o){this.latestValues[n]=o}update(n,o){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let s=0;s<propEventHandlers.length;s++){const c=propEventHandlers[s];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const d=n["on"+c];d&&(this.propEventSubscriptions[c]=this.on(c,d))}this.prevMotionValues=updateMotionValuesFromProps(this,this.scrapeMotionValuesFromProps(n,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(n){return this.props.variants?this.props.variants[n]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(n=!1){if(n)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const s=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(s.initial=this.props.initial),s}const o={};for(let s=0;s<numVariantProps;s++){const c=variantProps[s],d=this.props[c];(isVariantLabel(d)||d===!1)&&(o[c]=d)}return o}addVariantChild(n){const o=this.getClosestVariantNode();if(o)return o.variantChildren&&o.variantChildren.add(n),()=>o.variantChildren.delete(n)}addValue(n,o){o!==this.values.get(n)&&(this.removeValue(n),this.bindToMotionValue(n,o)),this.values.set(n,o),this.latestValues[n]=o.get()}removeValue(n){this.values.delete(n);const o=this.valueSubscriptions.get(n);o&&(o(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,o){if(this.props.values&&this.props.values[n])return this.props.values[n];let s=this.values.get(n);return s===void 0&&o!==void 0&&(s=motionValue(o===null?void 0:o,{owner:this}),this.addValue(n,s)),s}readValue(n,o){var s;let c=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:(s=this.getBaseTargetFromProps(this.props,n))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,n,this.options);return c!=null&&(typeof c=="string"&&(isNumericalString(c)||isZeroValueString(c))?c=parseFloat(c):!findValueType(c)&&complex.test(o)&&(c=getAnimatableNone(n,o)),this.setBaseTarget(n,isMotionValue(c)?c.get():c)),isMotionValue(c)?c.get():c}setBaseTarget(n,o){this.baseTarget[n]=o}getBaseTarget(n){var o,s;const{initial:c}=this.props,d=typeof c=="string"||typeof c=="object"?(s=resolveVariantFromProps(this.props,c,(o=this.presenceContext)===null||o===void 0?void 0:o.custom))===null||s===void 0?void 0:s[n]:void 0;if(c&&d!==void 0)return d;const h=this.getBaseTargetFromProps(this.props,n);return h!==void 0&&!isMotionValue(h)?h:this.initialValues[n]!==void 0&&d===void 0?void 0:this.baseTarget[n]}on(n,o){return this.events[n]||(this.events[n]=new SubscriptionManager),this.events[n].add(o)}notify(n,...o){this.events[n]&&this.events[n].notify(...o)}}class DOMVisualElement extends VisualElement{constructor(){super(...arguments),this.KeyframeResolver=DOMKeyframesResolver}sortInstanceNodePosition(n,o){return n.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(n,o){return n.style?n.style[o]:void 0}removeValueFromRenderState(n,{vars:o,style:s}){delete o[n],delete s[n]}}function getComputedStyle(t){return window.getComputedStyle(t)}class HTMLVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="html"}readValueFromInstance(n,o){if(transformProps.has(o)){const s=getDefaultValueType(o);return s&&s.default||0}else{const s=getComputedStyle(n),c=(isCSSVariableName(o)?s.getPropertyValue(o):s[o])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(n,{transformPagePoint:o}){return measureViewportBox(n,o)}build(n,o,s,c){buildHTMLStyles(n,o,s,c.transformTemplate)}scrapeMotionValuesFromProps(n,o,s){return scrapeMotionValuesFromProps$1(n,o,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;isMotionValue(n)&&(this.childSubscription=n.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}renderInstance(n,o,s,c){renderHTML(n,o,s,c)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(n,o){return n[o]}readValueFromInstance(n,o){if(transformProps.has(o)){const s=getDefaultValueType(o);return s&&s.default||0}return o=camelCaseAttributes.has(o)?o:camelToDash(o),n.getAttribute(o)}measureInstanceViewportBox(){return createBox()}scrapeMotionValuesFromProps(n,o){return scrapeMotionValuesFromProps(n,o,this)}build(n,o,s,c){buildSVGAttrs(n,o,s,this.isSVGTag,c.transformTemplate)}renderInstance(n,o,s,c){renderSVG(n,o,s,c)}mount(n){this.isSVGTag=isSVGTag(n.tagName),super.mount(n)}}const createDomVisualElement=(t,n)=>isSVGComponent(t)?new SVGVisualElement(n,{enableHardwareAcceleration:!1}):new HTMLVisualElement(n,{allowProjection:t!==React.Fragment,enableHardwareAcceleration:!0}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations,...gestureAnimations,...drag,...layout},motion=createMotionProxy((t,n)=>createDomMotionConfig(t,n,preloadedFeatures,createDomVisualElement));function useMotionValue(t){const n=useConstant(()=>motionValue(t)),{isStatic:o}=React.useContext(MotionConfigContext);if(o){const[,s]=React.useState(t);React.useEffect(()=>n.on("change",s),[])}return n}function assignRef(t,n){return typeof t=="function"?t(n):t&&(t.current=n),t}function useCallbackRef(t,n){var o=React.useState(function(){return{value:t,callback:n,facade:{get current(){return o.value},set current(s){var c=o.value;c!==s&&(o.value=s,o.callback(s,c))}}}})[0];return o.callback=n,o.facade}var useIsomorphicLayoutEffect=typeof window<"u"?React__namespace.useLayoutEffect:React__namespace.useEffect,currentValues=new WeakMap;function useMergeRefs(t,n){var o=useCallbackRef(null,function(s){return t.forEach(function(c){return assignRef(c,s)})});return useIsomorphicLayoutEffect(function(){var s=currentValues.get(o);if(s){var c=new Set(s),d=new Set(t),h=o.current;c.forEach(function(p){d.has(p)||assignRef(p,null)}),d.forEach(function(p){c.has(p)||assignRef(p,h)})}currentValues.set(o,t)},[t]),o}const occluder=new EllipsoidalOccluder(Ellipsoid$1.WGS84,Cartesian3.ZERO),ScreenSpaceElement=React.forwardRef(({position:t,children:n,...o},s)=>{const c=useConstant$2(()=>new Cartesian3);t==null||t.clone(c);const d=useMotionValue(""),h=useMotionValue("none"),{toWindowPosition:p,getCamera:y,toXYZ:S,isPositionVisible:P}=useContext(),L=React.useRef(null);usePreRender(()=>{if(L.current==null)return;let N;try{const se=p==null?void 0:p([c.x,c.y,c.z]);N=new Cartesian2(se==null?void 0:se[0],se==null?void 0:se[1])}catch{h.set("none");return}const z=y==null?void 0:y();if(!z)return;const W=S==null?void 0:S(z==null?void 0:z.lng,z==null?void 0:z.lat,z==null?void 0:z.height);if(!W)return;if(occluder.cameraPosition=new Cartesian3(W[0],W[1],W[2]),N==null||N.x<0||N.y<0||N.x>window.innerWidth||N.y>window.innerHeight||!(P!=null&&P([c.x,c.y,c.z]))){h.set("none");return}const nt=`calc(${N.x}px - 50%)`,Pe=`calc(${N.y}px - 50%)`;d.set(`translate(${nt}, ${Pe})`),h.set("block")});const F=useMergeRefs([L,s]);return jsxRuntimeExports.jsx(motion.div,{ref:F,...o,style:{...o.style,transform:d,display:h,position:"absolute",pointerEvents:"none",left:0,top:0},children:n})});ScreenSpaceElement.displayName="ScreenSpaceElement";const MeasurementLine$1=({a:t,b:n,color:o})=>{const s=React.useRef([t,n]);s.current=[t,n];const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=React.useMemo(()=>({polyline:{positions:c,width:1.5,material:new PolylineDashMaterialProperty({color:o,dashLength:8})}}),[o,c]);return jsxRuntimeExports.jsx(Entity,{...d})},ExtrudedMeasurement=({a:t,b:n,extrudedHeight:o,color:s,showLine:c})=>{const d=useConstant$2(()=>new Cartesian3);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScreenSpaceElement,{position:Cartesian3.midpoint(t,n,d),children:jsxRuntimeExports.jsx(MeasurementText,{children:o<1e3?`${o.toFixed(1)} m`:`${(o/1e3).toFixed(1)} km`})}),c&&jsxRuntimeExports.jsx(MeasurementLine$1,{a:t,b:n,color:s})]})},ExtrudedControlPoints=React.memo(({geometryOptions:{controlPoints:t,type:n},extrudedHeight:o,color:s,isEditing:c,extrudedPoint:d,centroidBasePoint:h,centroidExtrudedPoint:p,catchedExtrudedPoint:y,handleControlPointMouseEvent:S})=>{const P=t[t.length-1],L=d?new Cartesian3(...d):void 0,F=h?new Cartesian3(...h):void 0,N=p?new Cartesian3(...p):void 0;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[L&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ControlPoint,{index:-1,position:L,isEditing:c,isExtrudedControlPoint:!0,handleControlPointMouseEvent:S}),(!c||y)&&jsxRuntimeExports.jsx(ExtrudedMeasurement,{a:P,b:L,extrudedHeight:o,color:c?Color$1.fromCssColorString(DEFAULT_EDIT_COLOR):s,showLine:n!=="extrudedPolygon"})]}),F&&jsxRuntimeExports.jsx(ControlPoint,{index:-1,position:F,isEditing:c,isExtrudedControlPoint:!0}),N&&jsxRuntimeExports.jsx(ControlPoint,{index:-1,position:N,isEditing:c,isExtrudedControlPoint:!0})]})});ExtrudedControlPoints.displayName="ExtrudedControlPoints";const ExtrudedPolygonEntity=({id:t,hierarchy:n,extrudedHeight:o,color:s,disableShadow:c=!1,isEditing:d})=>{const h=React.useRef(n);h.current=n;const y=useConstant$2(()=>new CallbackProperty(()=>h.current,!1)),S=React.useRef(o);S.current=o;const L=useConstant$2(()=>new CallbackProperty(()=>S.current,!1)),F=React.useMemo(()=>({polygon:{hierarchy:y,heightReference:HeightReference$1.RELATIVE_TO_TERRAIN,extrudedHeight:L,extrudedHeightReference:HeightReference$1.RELATIVE_TO_TERRAIN,fill:!0,outline:!0,outlineWidth:1,outlineColor:d?Color$1.fromCssColorString(DEFAULT_EDIT_COLOR):s==null?void 0:s.withAlpha(1),material:new ColorMaterialProperty(d?s==null?void 0:s.withAlpha(.2):s),classificationType:ClassificationType$1.TERRAIN,shadows:c?ShadowMode$1.DISABLED:ShadowMode$1.ENABLED}}),[L,c,y,s,d]),{requestRender:N}=useContext();return N==null||N(),jsxRuntimeExports.jsx(Entity,{id:t,...F})},PolygonEntity=({dynamic:t=!1,hierarchy:n,color:o})=>{const s=React.useRef(n);s.current=n;const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=t?c:n,h=React.useMemo(()=>({polygon:{hierarchy:d,fill:!0,material:o==null?void 0:o.withAlpha(.5),classificationType:ClassificationType$1.TERRAIN}}),[o,d]),{requestRender:p}=useContext();return p==null||p(),jsxRuntimeExports.jsx(Entity,{...h})},PolylineEntity=({dynamic:t=!1,positions:n,color:o,isEditing:s})=>{const c=React.useRef(n);c.current=n;const d=useConstant$2(()=>new CallbackProperty(()=>c.current,!t)),h=t?d:n,p=React.useMemo(()=>({polyline:{positions:h,width:1.5,material:s?Color$1.fromCssColorString(DEFAULT_EDIT_COLOR):o,classificationType:ClassificationType$1.TERRAIN,clampToGround:!0}}),[o,h,s]),{requestRender:y}=useContext();return y==null||y(),jsxRuntimeExports.jsx(Entity,{...p})},cartesianScratch1$1=new Cartesian3,SurfaceAddingPoints=React.memo(({geometryOptions:{type:t,controlPoints:n},isEditing:o,handleAddControlPoint:s})=>{if(!["polyline","polygon","extrudedPolygon"].includes(t))return null;const c=[];for(let d=0;d<n.length-1;d++){const h=n[d+1],p=Cartesian3.midpoint(n[d],h,cartesianScratch1$1);c.push(p.clone())}if(t==="polygon"||t==="extrudedPolygon"){const d=Cartesian3.midpoint(n[n.length-1],n[0],cartesianScratch1$1);c.push(d.clone())}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:c.map((d,h)=>jsxRuntimeExports.jsx(ControlPoint,{position:d,isAddingPoint:!0,index:h,clampToGround:!0,isEditing:o,handleControlPointMouseEvent:()=>s==null?void 0:s([d.x,d.y,d.z],h)},h))})});SurfaceAddingPoints.displayName="SurfaceAddingPoints";const MeasurementLine=({a:t,b:n,color:o})=>{const s=React.useRef([t,n]);s.current=[t,n];const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=React.useMemo(()=>({polyline:{positions:c,width:1.5,material:new PolylineDashMaterialProperty({color:o,dashLength:8}),classificationType:ClassificationType$1.TERRAIN,clampToGround:!0}}),[o,c]),{requestRender:h}=useContext();return h==null||h(),jsxRuntimeExports.jsx(Entity,{...d})},SurfaceMeasurement=({a:t,b:n,color:o,showLine:s=!1})=>{const c=useConstant$2(()=>new Cartesian3),{getSurfaceDistance:d}=useContext(),h=d==null?void 0:d(t,n);return h!==void 0?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScreenSpaceElement,{position:Cartesian3.midpoint(t,n,c),children:jsxRuntimeExports.jsx(MeasurementText,{children:h<1e3?`${h.toFixed(1)} m`:`${(h/1e3).toFixed(1)} km`})}),s&&jsxRuntimeExports.jsx(MeasurementLine,{a:t,b:n,color:o})]}):null},cartesianScratch1=new Cartesian3,SurfaceControlPoints=React.memo(({geometryOptions:{type:t,controlPoints:n},color:o,isEditing:s,catchedControlPointIndex:c,selectedControlPointIndex:d,handleControlPointMouseEvent:h})=>{const p=[];if(n.length>=2)if(s){if(c!==void 0&&c!==-1)switch(t){case"polyline":c>0&&p.push({points:[n[c-1],n[c]],showLine:!1}),c<n.length-1&&p.push({points:[n[c],n[c+1]],showLine:!1});break;case"circle":case"extrudedCircle":c!==2&&p.push({points:[n[0],n[1]],showLine:!0});break;case"rectangle":case"extrudedRectangle":if(c<=1)p.push({points:[n[0],n[1]],showLine:!1});else if(c===2){const[y,S,P]=n,L=Cartesian3.midpoint(y,S,cartesianScratch1);p.push({points:[L,P],showLine:!0})}break;case"polygon":case"extrudedPolygon":p.push({points:[n[c],c===0?n[n.length-1]:n[c-1]],showLine:!1}),p.push({points:[n[c],c===n.length-1?n[0]:n[c+1]],showLine:!1});break}}else switch(t){case"rectangle":if(n.length===2)p.push({points:n,showLine:!0});else if(n.length===3){const[y,S,P]=n,L=Cartesian3.midpoint(y,S,cartesianScratch1);p.push({points:[L,P],showLine:!0})}break;default:p.push({points:n.slice(-2),showLine:t==="circle"});break}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[n.map((y,S)=>jsxRuntimeExports.jsx(ControlPoint,{position:y,index:S,isSelected:d===S,clampToGround:!0,isEditing:s,handleControlPointMouseEvent:h},S)),p.map(({points:y,showLine:S},P)=>jsxRuntimeExports.jsx(SurfaceMeasurement,{a:y[0],b:y[1],color:s?Color$1.fromCssColorString(DEFAULT_EDIT_COLOR):o,showLine:S},P))]})});SurfaceControlPoints.displayName="SurfaceControlPoints";const SketchComponent=React.memo(({geometryOptions:t,extrudedHeight:n,disableShadow:o,color:s,isEditing:c,extrudedPoint:d,centroidBasePoint:h,centroidExtrudedPoint:p,catchedControlPointIndex:y,catchedExtrudedPoint:S,selectedControlPointIndex:P,handleControlPointMouseEvent:L,handleAddControlPoint:F})=>{const N=React.useMemo(()=>t?{...t,controlPoints:t==null?void 0:t.controlPoints.map(se=>new Cesium$1.Cartesian3(...se))}:null,[t]),z=React.useMemo(()=>N?createGeometry(N):null,[N]),{positionsArray:W,hierarchyArray:nt}=React.useMemo(()=>(z==null?void 0:z.type)==="Point"?{}:(z==null?void 0:z.type)==="LineString"?{positionsArray:convertGeometryToPositionsArray(z)}:z!=null?{positionsArray:convertGeometryToPositionsArray(z),hierarchyArray:convertPolygonToHierarchyArray(z)}:{},[z]),Pe=React.useMemo(()=>Color$1.fromCssColorString(s??DEFAULT_SKETCH_COLOR),[s]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[W==null?void 0:W.map((se,mt)=>jsxRuntimeExports.jsx(PolylineEntity,{dynamic:!0,positions:se,color:Pe,isEditing:c},mt)),nt==null?void 0:nt.map((se,mt)=>jsxRuntimeExports.jsx(PolygonEntity,{dynamic:!0,hierarchy:se,color:Pe},mt)),N!=null&&(!n||c)&&jsxRuntimeExports.jsx(SurfaceControlPoints,{geometryOptions:N,color:Pe,isEditing:c,catchedControlPointIndex:y,selectedControlPointIndex:P,handleControlPointMouseEvent:L}),N!=null&&c&&jsxRuntimeExports.jsx(SurfaceAddingPoints,{geometryOptions:N,isEditing:c,handleAddControlPoint:F}),N!=null&&n&&jsxRuntimeExports.jsx(ExtrudedControlPoints,{geometryOptions:N,extrudedHeight:n,extrudedPoint:d,centroidBasePoint:h,centroidExtrudedPoint:p,catchedExtrudedPoint:S,color:Pe,isEditing:c,handleControlPointMouseEvent:L}),n&&(nt==null?void 0:nt.map((se,mt)=>jsxRuntimeExports.jsx(ExtrudedPolygonEntity,{hierarchy:se,extrudedHeight:n,disableShadow:o,color:Pe,isEditing:c},mt)))]})});SketchComponent.displayName="SketchComponent";const Cesium=({className:t,style:n,property:o,time:s,camera:c,small:d,ready:h,children:p,selectedLayerId:y,isLayerDraggable:S,isLayerDragging:P,shouldRender:L,layerSelectionReason:F,meta:N,displayCredits:z,layersRef:W,featureFlags:nt,requestingRenderMode:Pe,timelineManagerRef:se,cameraForceHorizontalRoll:mt,onLayerSelect:kt,onCameraChange:mn,onLayerDrag:_i,onLayerDrop:zi,onLayerEdit:Sa,onLayerSelectWithRectStart:fa,onLayerSelectWithRectMove:La,onLayerSelectWithRectEnd:Ra,onMount:ma,onLayerVisibility:yt,onLayerLoad:lt,onCreditsUpdate:pi},ba)=>{var gd,pd,Zd,cf,sf,nf,df,Cf,mf,Sf,Pf,Af,Hf,_f,wf,Yf,Nf,vf,Ff,Xf,Wf,Qf,_m,Bf,$m,qf,qm,ep,Tf,rf,bf,If,Uf,jf,jm,sp,cp,fp,mp,al,tf,lf;const{cesium:Sc,mouseEventHandles:ms,cesiumIonAccessToken:Xs,context:Nl,layerSelectWithRectEventHandlers:pu,sceneLight:yu,sceneBackgroundColor:Ru,sceneMsaaSamples:Vd,sceneMode:Gd,cameraViewBoundaries:uf,cameraViewOuterBoundaries:ff,cameraViewBoundariesMaterial:pf,handleCameraChange:hf,handleCameraMoveEnd:of,handleUpdate:gf,handleClick:Ef,handleMount:xf,handleUnmount:Wa,handleTilesChange:af,handleTerrainProviderChange:Xd}=useHooks$1({ref:ba,property:o,time:s,selectedLayerId:y,selectionReason:F,meta:N,layersRef:W,featureFlags:nt,timelineManagerRef:se,isLayerDraggable:S,isLayerDragging:P,shouldRender:L,requestingRenderMode:Pe,camera:c,cameraForceHorizontalRoll:mt,onLayerDrag:_i,onLayerDrop:zi,onLayerSelect:kt,onLayerEdit:Sa,onLayerSelectWithRectStart:fa,onLayerSelectWithRectMove:La,onLayerSelectWithRectEnd:Ra,onLayerVisibility:yt,onLayerLoad:lt,onCameraChange:mn,onMount:ma,onCreditsUpdate:pi});return jsxRuntimeExports.jsxs(Aa$1,{ref:Sc,onUpdate:gf,className:t,requestRenderMode:!0,animation:!1,timeline:!1,baseLayer:!1,fullscreenButton:!1,homeButton:!1,geocoder:!1,infoBox:!1,baseLayerPicker:!1,navigationHelpButton:!1,projectionPicker:!1,sceneModePicker:!1,creditContainer:z?void 0:creditContainer,style:{width:d?"300px":"auto",height:d?"300px":"100%",display:h?void 0:"none",cursor:P?"grab":void 0,...n},shadows:!!((pd=(gd=o==null?void 0:o.scene)==null?void 0:gd.shadow)!=null&&pd.enabled),onClick:Ef,onDoubleClick:ms.doubleClick,onMouseDown:ms.mouseDown,onMouseUp:ms.mouseUp,onRightClick:ms.rightClick,onRightDown:ms.rightDown,onRightUp:ms.rightUp,onMiddleClick:ms.middleClick,onMiddleDown:ms.middleDown,onMiddleUp:ms.middleUp,onMouseMove:ms.mouseMove,onMouseEnter:ms.mouseEnter,onMouseLeave:ms.mouseLeave,onWheel:ms.wheel,children:[jsxRuntimeExports.jsx(Event,{onMount:xf,onUnmount:Wa}),jsxRuntimeExports.jsx(ReearthClock,{timelineManagerRef:se}),jsxRuntimeExports.jsx(ImageryLayers,{tiles:o==null?void 0:o.tiles,cesiumIonAccessToken:Xs,onTilesChange:af}),jsxRuntimeExports.jsx(LabelImageryLayers,{tileLabels:o==null?void 0:o.tileLabels}),jsxRuntimeExports.jsx(Indicator,{property:o,timelineManagerRef:se}),jsxRuntimeExports.jsxs(ka$1,{useDefault:!0,children:[jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_CLICK}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOUBLE_CLICK})]}),jsxRuntimeExports.jsxs(ka$1,{children:[jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,action:pu.start.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:pu.start.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,action:pu.move.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:pu.move.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,action:pu.end.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:pu.end.shift})]}),jsxRuntimeExports.jsx(Ta$1,{maximumZoomDistance:(cf=(Zd=o==null?void 0:o.camera)==null?void 0:Zd.limiter)!=null&&cf.enabled?((df=(nf=(sf=o.camera)==null?void 0:sf.limiter)==null?void 0:nf.targetArea)==null?void 0:df.height)??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY,enableCollisionDetection:!((Cf=o==null?void 0:o.camera)!=null&&Cf.allowEnterGround)}),jsxRuntimeExports.jsx(Ps$1,{percentageChanged:.2,onChange:hf,onMoveEnd:of}),uf&&((Sf=(mf=o==null?void 0:o.camera)==null?void 0:mf.limiter)==null?void 0:Sf.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:uf,width:1,material:Cesium$1.Color.RED,arcType:Cesium$1.ArcType.RHUMB})}),ff&&((Af=(Pf=o==null?void 0:o.camera)==null?void 0:Pf.limiter)==null?void 0:Af.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:ff,width:1,material:pf,arcType:Cesium$1.ArcType.RHUMB})}),jsxRuntimeExports.jsx($a$1,{backgroundColor:Ru,light:yu,mode:Gd,msaaSamples:Vd,useDepthPicking:!1,useWebVR:!!((Hf=o==null?void 0:o.scene)!=null&&Hf.vr)||void 0,debugShowFramesPerSecond:!!((_f=o==null?void 0:o.debug)!=null&&_f.showFramesPerSecond),verticalExaggerationRelativeHeight:(wf=o==null?void 0:o.scene)==null?void 0:wf.verticalExaggerationRelativeHeight,verticalExaggeration:(Yf=o==null?void 0:o.scene)==null?void 0:Yf.verticalExaggeration}),jsxRuntimeExports.jsx(Oa$1,{show:((vf=(Nf=o==null?void 0:o.sky)==null?void 0:Nf.skyBox)==null?void 0:vf.show)??!0}),jsxRuntimeExports.jsx(Vs,{enabled:((Xf=(Ff=o==null?void 0:o.sky)==null?void 0:Ff.fog)==null?void 0:Xf.enabled)??!0,density:(Qf=(Wf=o==null?void 0:o.sky)==null?void 0:Wf.fog)==null?void 0:Qf.density}),jsxRuntimeExports.jsx(Ga$1,{show:((Bf=(_m=o==null?void 0:o.sky)==null?void 0:_m.sun)==null?void 0:Bf.show)??!0}),jsxRuntimeExports.jsx(ea,{show:((qf=($m=o==null?void 0:o.sky)==null?void 0:$m.moon)==null?void 0:qf.show)??!0}),jsxRuntimeExports.jsx(_a$2,{show:((ep=(qm=o==null?void 0:o.sky)==null?void 0:qm.skyAtmosphere)==null?void 0:ep.show)??!0,atmosphereLightIntensity:(rf=(Tf=o==null?void 0:o.sky)==null?void 0:Tf.skyAtmosphere)==null?void 0:rf.lightIntensity,saturationShift:(If=(bf=o==null?void 0:o.sky)==null?void 0:bf.skyAtmosphere)==null?void 0:If.saturationShift,brightnessShift:(jf=(Uf=o==null?void 0:o.sky)==null?void 0:Uf.skyAtmosphere)==null?void 0:jf.brightnessShift}),jsxRuntimeExports.jsx(Globe,{property:o,cesiumIonAccessToken:Xs,onTerrainProviderChange:Xd}),jsxRuntimeExports.jsx(context.Provider,{value:Nl,children:h?p:null}),jsxRuntimeExports.jsx(AmbientOcclusion,{...AMBIENT_OCCLUSION_QUALITY[((sp=(jm=o==null?void 0:o.render)==null?void 0:jm.ambientOcclusion)==null?void 0:sp.quality)||"low"],enabled:!!((fp=(cp=o==null?void 0:o.render)==null?void 0:cp.ambientOcclusion)!=null&&fp.enabled),intensity:((al=(mp=o==null?void 0:o.render)==null?void 0:mp.ambientOcclusion)==null?void 0:al.intensity)??100,outputType:(lf=(tf=o==null?void 0:o.render)==null?void 0:tf.ambientOcclusion)!=null&&lf.ambientOcclusionOnly?AmbientOcclusionOutputType.Occlusion:null})]})},creditContainer=document.createElement("div"),Component=React.forwardRef(Cesium),engine={component:Component,featureComponent:Feature$1,clusterComponent:Cluster,sketchComponent:SketchComponent,delegatedDataTypes:["czml","wms","mvt","3dtiles","osm-buildings","kml"]},engines={cesium:engine};function Error$1({error:t,resetErrorBoundary:n}){return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{children:"Oops! An Error Occurred"}),jsxRuntimeExports.jsx("p",{children:t.message}),jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("button",{style:{color:"#fff"},onClick:n,children:"Retry"})})]})}const version$1="0.0.7-alpha.40",useCoreAPI=({viewerProperty:t})=>{const n=React.useRef(t);n.current=t;const o=React.useMemo(()=>({get version(){return version$1},get viewerProperty(){return n.current}}),[]);React.useEffect(()=>{window.reearth_core=o},[o])},viewportMobileMaxWidth=768,useViewport=({wrapperRef:t})=>{const n=React.useMemo(()=>paramsToObject(new URLSearchParams(window.location.search)),[]),[o,s]=React.useState({width:void 0,height:void 0,isMobile:void 0,query:n});return React.useEffect(()=>{const c=new ResizeObserver(d=>{var S,P;const[h]=d;let p,y;if(h.contentBoxSize){const L=Array.isArray(h.contentBoxSize)?h.contentBoxSize[0]:h.contentBoxSize;p=L.inlineSize,y=L.blockSize}else h.contentRect?(p=h.contentRect.width,y=h.contentRect.height):(p=(S=t.current)==null?void 0:S.clientWidth,y=(P=t.current)==null?void 0:P.clientHeight);s(L=>({width:p,height:y,isMobile:p?p<=viewportMobileMaxWidth:void 0,query:L.query}))});return t.current&&c.observe(t.current),()=>{c.disconnect()}},[t]),o};function paramsToObject(t){const n={};for(const[o,s]of t)n[o]=s;return n}function useHooks({camera:t,interactionMode:n,zoomedLayerId:o,viewerProperty:s,onLayerSelect:c,onCameraChange:d,onInteractionModeChange:h,onZoomToLayer:p,onLayerDrop:y,onSketchTypeChangeProp:S},P){const L=React.useRef(null);React.useImperativeHandle(P,()=>L.current,[]);const F=React.useRef(null),N=useViewport({wrapperRef:F}),[z,W]=React.useState({}),[nt,Pe]=React.useState(),[se,mt]=React.useState(),kt=React.useCallback(async(_f,wf,Yf,Nf,vf)=>{var Qf,_m,Bf,$m,qf,qm,ep,Tf,rf,bf,If;const Ff=((Qf=z.layer)==null?void 0:Qf.layer.type)==="simple"&&(($m=(Bf=(_m=z.layer)==null?void 0:_m.layer)==null?void 0:Bf.data)==null?void 0:$m.isSketchLayer);if(z.layerId===_f&&z.featureId===wf&&!Ff)return;const Xf=await(Yf==null?void 0:Yf()),Wf=_f&&wf?(Ff?(qf=Xf==null?void 0:Xf.features)==null?void 0:qf.find(Uf=>Uf.id===wf):(Tf=(qm=L.current)==null?void 0:(ep=qm.engine).findComputedFeatureById)==null?void 0:Tf.call(ep,_f,wf))??(vf==null?void 0:vf.feature):void 0;Pe(_f&&wf?(If=(rf=L.current)==null?void 0:(bf=rf.engine).findFeatureById)==null?void 0:If.call(bf,_f,wf):void 0),mt(Wf),W(Uf=>Uf.layerId===_f&&Uf.featureId===wf?Uf:{layerId:_f,featureId:wf,layer:Xf,reason:Nf}),c==null||c(_f,Yf,Wf,Nf)},[z,c]),mn=React.useRef(),[_i,zi]=useValue(t,d),[Sa,fa]=React.useState(!1),La=React.useCallback(_f=>{fa(!!_f)},[]),[Ra,ma]=useValue(n||"default",h);React.useEffect(()=>{var _f,wf;Ra==="default"&&((wf=(_f=L==null?void 0:L.current)==null?void 0:_f.engine)==null||wf.setCursor("auto"))},[Ra]);const yt=INTERACTION_MODES[Ra??"default"],lt=React.useRef(),pi=React.useCallback(_f=>{lt.current=_f},[]),ba=React.useCallback(_f=>{var wf;(wf=lt.current)==null||wf.call(lt,_f)},[]),Sc=React.useRef(),ms=React.useCallback(_f=>{Sc.current=_f},[]),Xs=React.useCallback(_f=>{var wf;(wf=Sc.current)==null||wf.call(Sc,_f)},[]),Nl=React.useRef(),pu=React.useCallback(_f=>{Nl.current=_f},[]),yu=React.useCallback(_f=>{var wf;(wf=Nl.current)==null||wf.call(Nl,_f)},[]),Ru=React.useRef(),Vd=React.useCallback(_f=>{Ru.current=_f},[]),Gd=React.useCallback(_f=>{var wf;(wf=Ru.current)==null||wf.call(Ru,_f)},[]),uf=React.useRef(),ff=React.useCallback(_f=>{uf.current=_f},[]),pf=React.useCallback(_f=>{var wf;(wf=uf.current)==null||wf.call(uf,_f)},[]),hf=React.useRef(),of=React.useCallback(_f=>{hf.current=_f},[]),gf=React.useCallback(_f=>{var wf;(wf=hf.current)==null||wf.call(hf,_f)},[]),Ef=React.useRef([]),xf=React.useCallback(_f=>{Ef.current.push(_f)},[]),Wa=React.useCallback(_f=>{Ef.current.forEach(wf=>wf(_f))},[]),af=React.useRef([]),Xd=React.useCallback(_f=>{af.current.push(_f)},[]),gd=React.useCallback(_f=>{af.current.forEach(wf=>wf(_f))},[]),pd=React.useRef([]),Zd=React.useCallback(_f=>{pd.current.push(_f)},[]),cf=React.useCallback(_f=>{pd.current.forEach(wf=>wf(_f))},[]),sf=React.useRef([]),nf=React.useCallback(_f=>{sf.current.push(_f)},[]),df=React.useCallback((_f,wf)=>{sf.current.forEach(Yf=>Yf(_f)),S==null||S(_f,wf)},[S]);React.useEffect(()=>{var _f,wf;o&&((wf=(_f=L.current)==null?void 0:_f.engine)==null||wf.lookAtLayer(o),p==null||p(void 0))},[o,p]);const[Cf,mf]=React.useState(!1),Sf=React.useCallback(()=>{mf(!0)},[]),Pf=React.useCallback((_f,wf,Yf)=>{var Ff;mf(!1);const Nf=(Ff=L.current)==null?void 0:Ff.layers.findById(_f),vf=Nf!=null&&Nf.property.default.location?"default.location":Nf!=null&&Nf.property.default.position?"default.position":void 0;Yf&&Nf&&Nf.propertyId&&vf&&(y==null||y(Nf.propertyId,vf,Yf))},[y,L]),Af=React.useMemo(()=>({interactionMode:Ra,selectedLayer:z,selectedComputedFeature:se,viewport:N,handleCameraForceHorizontalRollChange:La,handleInteractionModeChange:ma,onSketchPluginFeatureCreate:xf,onSketchPluginFeatureUpdate:Xd,onSketchPluginFeatureDelete:Zd,onSketchTypeChange:nf,onLayerVisibility:ms,onLayerLoad:pu,onLayerEdit:pi,onLayerSelectWithRectStart:Vd,onLayerSelectWithRectMove:ff,onLayerSelectWithRectEnd:of}),[Ra,z,se,N,ma,La,pi,xf,Xd,Zd,nf,ms,pu,Vd,ff,of]),Hf=React.useMemo(()=>({position:"relative",width:"100%",height:"100%",overflow:"hidden"}),[]);return useCoreAPI({viewerProperty:s}),{mapRef:L,wrapperRef:F,selectedFeature:nt,camera:_i,featureFlags:yt,isLayerDragging:Cf,timelineManagerRef:mn,cameraForceHorizontalRoll:Sa,coreContextValue:Af,containerStyle:Hf,overriddenInteractionMode:Ra,handleLayerSelect:kt,handleLayerDrag:Sf,handleLayerDrop:Pf,handleLayerEdit:ba,handleCameraChange:zi,handleInteractionModeChange:ma,handleSketchPluginFeatureCreate:Wa,handleSketchPluginFeatureUpdate:gd,handleSketchPluginFeatureDelete:cf,handleSketchTypeChange:df,handleLayerVisibility:Xs,handleLayerLoad:yu,handleLayerSelectWithRectStart:Gd,handleLayerSelectWithRectMove:pf,handleLayerSelectWithRectEnd:gf}}function useValue(t,n){const[o,s]=React.useState(t),c=React.useCallback(d=>{d&&(s(d),n==null||n(d))},[n]);return React.useEffect(()=>{s(t)},[t]),[o,c]}const CoreVisualizer=React.memo(React.forwardRef(({engine:t,isBuilt:n,isEditable:o,viewerProperty:s,layers:c,clusters:d,small:h,ready:p,hiddenLayers:y,camera:S,time:P,interactionMode:L,shouldRender:F,meta:N,displayCredits:z=!0,style:W,zoomedLayerId:nt,children:Pe,onLayerDrop:se,onLayerSelect:mt,onCameraChange:kt,onZoomToLayer:mn,onInteractionModeChange:_i,onMount:zi,onSketchTypeChangeProp:Sa,onSketchFeatureCreate:fa,onSketchFeatureUpdate:La,onSketchFeatureDelete:Ra,onAPIReady:ma,onCreditsUpdate:yt},lt)=>{const{mapRef:pi,wrapperRef:ba,selectedFeature:Sc,camera:ms,featureFlags:Xs,isLayerDragging:Nl,timelineManagerRef:pu,cameraForceHorizontalRoll:yu,coreContextValue:Ru,containerStyle:Vd,overriddenInteractionMode:Gd,handleLayerSelect:uf,handleLayerDrag:ff,handleLayerDrop:pf,handleLayerEdit:hf,handleCameraChange:of,handleInteractionModeChange:gf,handleSketchPluginFeatureCreate:Ef,handleSketchPluginFeatureUpdate:xf,handleSketchPluginFeatureDelete:Wa,handleSketchTypeChange:af,handleLayerVisibility:Xd,handleLayerLoad:gd,handleLayerSelectWithRectStart:pd,handleLayerSelectWithRectMove:Zd,handleLayerSelectWithRectEnd:cf}=useHooks({camera:S,interactionMode:L,zoomedLayerId:nt,viewerProperty:s,onLayerSelect:mt,onCameraChange:kt,onZoomToLayer:mn,onLayerDrop:se,onInteractionModeChange:_i,onSketchTypeChangeProp:Sa},lt);return jsxRuntimeExports.jsx(ErrorBoundary,{FallbackComponent:Error$1,children:jsxRuntimeExports.jsx(VisualizerProvider,{mapRef:pi,children:jsxRuntimeExports.jsxs("div",{ref:ba,style:Vd,children:[jsxRuntimeExports.jsx(Map$1,{ref:pi,isBuilt:n,isEditable:o,engine:t,layers:c,engines,camera:ms,cameraForceHorizontalRoll:yu,clusters:d,hiddenLayers:y,isLayerDragging:Nl,isLayerDraggable:o,meta:N,displayCredits:z,style:W,featureFlags:Xs,shouldRender:F,property:s,time:P,small:h,ready:p,timelineManagerRef:pu,interactionMode:Gd,selectedFeature:Sc,onCameraChange:of,onLayerDrag:ff,onLayerDrop:pf,onLayerSelect:uf,onLayerEdit:hf,overrideInteractionMode:gf,onSketchFeatureCreate:fa,onSketchPluginFeatureCreate:Ef,onSketchFeatureUpdate:La,onSketchPluginFeatureUpdate:xf,onSketchFeatureDelete:Ra,onSketchPluginFeatureDelete:Wa,onSketchTypeChange:af,onMount:zi,onLayerVisibility:Xd,onLayerLoad:gd,onLayerSelectWithRectStart:pd,onLayerSelectWithRectMove:Zd,onLayerSelectWithRectEnd:cf,onAPIReady:ma,onCreditsUpdate:yt}),jsxRuntimeExports.jsx(coreContext.Provider,{value:Ru,children:Pe})]})})})}));var global$1=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,inited=!1;function init(){inited=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=t.length;n<o;++n)lookup[n]=t[n],revLookup[t.charCodeAt(n)]=n;revLookup[45]=62,revLookup[95]=63}function toByteArray(t){inited||init();var n,o,s,c,d,h,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");d=t[p-2]==="="?2:t[p-1]==="="?1:0,h=new Arr(p*3/4-d),s=d>0?p-4:p;var y=0;for(n=0,o=0;n<s;n+=4,o+=3)c=revLookup[t.charCodeAt(n)]<<18|revLookup[t.charCodeAt(n+1)]<<12|revLookup[t.charCodeAt(n+2)]<<6|revLookup[t.charCodeAt(n+3)],h[y++]=c>>16&255,h[y++]=c>>8&255,h[y++]=c&255;return d===2?(c=revLookup[t.charCodeAt(n)]<<2|revLookup[t.charCodeAt(n+1)]>>4,h[y++]=c&255):d===1&&(c=revLookup[t.charCodeAt(n)]<<10|revLookup[t.charCodeAt(n+1)]<<4|revLookup[t.charCodeAt(n+2)]>>2,h[y++]=c>>8&255,h[y++]=c&255),h}function tripletToBase64(t){return lookup[t>>18&63]+lookup[t>>12&63]+lookup[t>>6&63]+lookup[t&63]}function encodeChunk(t,n,o){for(var s,c=[],d=n;d<o;d+=3)s=(t[d]<<16)+(t[d+1]<<8)+t[d+2],c.push(tripletToBase64(s));return c.join("")}function fromByteArray(t){inited||init();for(var n,o=t.length,s=o%3,c="",d=[],h=16383,p=0,y=o-s;p<y;p+=h)d.push(encodeChunk(t,p,p+h>y?y:p+h));return s===1?(n=t[o-1],c+=lookup[n>>2],c+=lookup[n<<4&63],c+="=="):s===2&&(n=(t[o-2]<<8)+t[o-1],c+=lookup[n>>10],c+=lookup[n>>4&63],c+=lookup[n<<2&63],c+="="),d.push(c),d.join("")}function read(t,n,o,s,c){var d,h,p=c*8-s-1,y=(1<<p)-1,S=y>>1,P=-7,L=o?c-1:0,F=o?-1:1,N=t[n+L];for(L+=F,d=N&(1<<-P)-1,N>>=-P,P+=p;P>0;d=d*256+t[n+L],L+=F,P-=8);for(h=d&(1<<-P)-1,d>>=-P,P+=s;P>0;h=h*256+t[n+L],L+=F,P-=8);if(d===0)d=1-S;else{if(d===y)return h?NaN:(N?-1:1)*(1/0);h=h+Math.pow(2,s),d=d-S}return(N?-1:1)*h*Math.pow(2,d-s)}function write(t,n,o,s,c,d){var h,p,y,S=d*8-c-1,P=(1<<S)-1,L=P>>1,F=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=s?0:d-1,z=s?1:-1,W=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(p=isNaN(n)?1:0,h=P):(h=Math.floor(Math.log(n)/Math.LN2),n*(y=Math.pow(2,-h))<1&&(h--,y*=2),h+L>=1?n+=F/y:n+=F*Math.pow(2,1-L),n*y>=2&&(h++,y/=2),h+L>=P?(p=0,h=P):h+L>=1?(p=(n*y-1)*Math.pow(2,c),h=h+L):(p=n*Math.pow(2,L-1)*Math.pow(2,c),h=0));c>=8;t[o+N]=p&255,N+=z,p/=256,c-=8);for(h=h<<c|p,S+=c;S>0;t[o+N]=h&255,N+=z,h/=256,S-=8);t[o+N-z]|=W*128}var toString={}.toString,isArray$1=Array.isArray||function(t){return toString.call(t)=="[object Array]"},INSPECT_MAX_BYTES=50;Buffer$1.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==void 0?global$1.TYPED_ARRAY_SUPPORT:!0,kMaxLength();function kMaxLength(){return Buffer$1.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(t,n){if(kMaxLength()<n)throw new RangeError("Invalid typed array length");return Buffer$1.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(n),t.__proto__=Buffer$1.prototype):(t===null&&(t=new Buffer$1(n)),t.length=n),t}function Buffer$1(t,n,o){if(!Buffer$1.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer$1))return new Buffer$1(t,n,o);if(typeof t=="number"){if(typeof n=="string")throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,t)}return from(this,t,n,o)}Buffer$1.poolSize=8192,Buffer$1._augment=function(t){return t.__proto__=Buffer$1.prototype,t};function from(t,n,o,s){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer?fromArrayBuffer(t,n,o,s):typeof n=="string"?fromString(t,n,o):fromObject(t,n)}Buffer$1.from=function(t,n,o){return from(null,t,n,o)},Buffer$1.TYPED_ARRAY_SUPPORT&&(Buffer$1.prototype.__proto__=Uint8Array.prototype,Buffer$1.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Buffer$1[Symbol.species]);function assertSize(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function alloc(t,n,o,s){return assertSize(n),n<=0?createBuffer(t,n):o!==void 0?typeof s=="string"?createBuffer(t,n).fill(o,s):createBuffer(t,n).fill(o):createBuffer(t,n)}Buffer$1.alloc=function(t,n,o){return alloc(null,t,n,o)};function allocUnsafe(t,n){if(assertSize(n),t=createBuffer(t,n<0?0:checked(n)|0),!Buffer$1.TYPED_ARRAY_SUPPORT)for(var o=0;o<n;++o)t[o]=0;return t}Buffer$1.allocUnsafe=function(t){return allocUnsafe(null,t)},Buffer$1.allocUnsafeSlow=function(t){return allocUnsafe(null,t)};function fromString(t,n,o){if((typeof o!="string"||o==="")&&(o="utf8"),!Buffer$1.isEncoding(o))throw new TypeError('"encoding" must be a valid string encoding');var s=byteLength(n,o)|0;t=createBuffer(t,s);var c=t.write(n,o);return c!==s&&(t=t.slice(0,c)),t}function fromArrayLike(t,n){var o=n.length<0?0:checked(n.length)|0;t=createBuffer(t,o);for(var s=0;s<o;s+=1)t[s]=n[s]&255;return t}function fromArrayBuffer(t,n,o,s){if(n.byteLength,o<0||n.byteLength<o)throw new RangeError("'offset' is out of bounds");if(n.byteLength<o+(s||0))throw new RangeError("'length' is out of bounds");return o===void 0&&s===void 0?n=new Uint8Array(n):s===void 0?n=new Uint8Array(n,o):n=new Uint8Array(n,o,s),Buffer$1.TYPED_ARRAY_SUPPORT?(t=n,t.__proto__=Buffer$1.prototype):t=fromArrayLike(t,n),t}function fromObject(t,n){if(internalIsBuffer(n)){var o=checked(n.length)|0;return t=createBuffer(t,o),t.length===0||n.copy(t,0,0,o),t}if(n){if(typeof ArrayBuffer<"u"&&n.buffer instanceof ArrayBuffer||"length"in n)return typeof n.length!="number"||isnan(n.length)?createBuffer(t,0):fromArrayLike(t,n);if(n.type==="Buffer"&&isArray$1(n.data))return fromArrayLike(t,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(t){if(t>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return t|0}Buffer$1.isBuffer=isBuffer;function internalIsBuffer(t){return!!(t!=null&&t._isBuffer)}Buffer$1.compare=function t(n,o){if(!internalIsBuffer(n)||!internalIsBuffer(o))throw new TypeError("Arguments must be Buffers");if(n===o)return 0;for(var s=n.length,c=o.length,d=0,h=Math.min(s,c);d<h;++d)if(n[d]!==o[d]){s=n[d],c=o[d];break}return s<c?-1:c<s?1:0},Buffer$1.isEncoding=function t(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer$1.concat=function t(n,o){if(!isArray$1(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return Buffer$1.alloc(0);var s;if(o===void 0)for(o=0,s=0;s<n.length;++s)o+=n[s].length;var c=Buffer$1.allocUnsafe(o),d=0;for(s=0;s<n.length;++s){var h=n[s];if(!internalIsBuffer(h))throw new TypeError('"list" argument must be an Array of Buffers');h.copy(c,d),d+=h.length}return c};function byteLength(t,n){if(internalIsBuffer(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var o=t.length;if(o===0)return 0;for(var s=!1;;)switch(n){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":case void 0:return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return base64ToBytes(t).length;default:if(s)return utf8ToBytes(t).length;n=(""+n).toLowerCase(),s=!0}}Buffer$1.byteLength=byteLength;function slowToString(t,n,o){var s=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((o===void 0||o>this.length)&&(o=this.length),o<=0)||(o>>>=0,n>>>=0,o<=n))return"";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice(this,n,o);case"utf8":case"utf-8":return utf8Slice(this,n,o);case"ascii":return asciiSlice(this,n,o);case"latin1":case"binary":return latin1Slice(this,n,o);case"base64":return base64Slice(this,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,n,o);default:if(s)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}Buffer$1.prototype._isBuffer=!0;function swap(t,n,o){var s=t[n];t[n]=t[o],t[o]=s}Buffer$1.prototype.swap16=function t(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var o=0;o<n;o+=2)swap(this,o,o+1);return this},Buffer$1.prototype.swap32=function t(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var o=0;o<n;o+=4)swap(this,o,o+3),swap(this,o+1,o+2);return this},Buffer$1.prototype.swap64=function t(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var o=0;o<n;o+=8)swap(this,o,o+7),swap(this,o+1,o+6),swap(this,o+2,o+5),swap(this,o+3,o+4);return this},Buffer$1.prototype.toString=function t(){var n=this.length|0;return n===0?"":arguments.length===0?utf8Slice(this,0,n):slowToString.apply(this,arguments)},Buffer$1.prototype.equals=function t(n){if(!internalIsBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:Buffer$1.compare(this,n)===0},Buffer$1.prototype.inspect=function t(){var n="",o=INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,o).match(/.{2}/g).join(" "),this.length>o&&(n+=" ... ")),"<Buffer "+n+">"},Buffer$1.prototype.compare=function t(n,o,s,c,d){if(!internalIsBuffer(n))throw new TypeError("Argument must be a Buffer");if(o===void 0&&(o=0),s===void 0&&(s=n?n.length:0),c===void 0&&(c=0),d===void 0&&(d=this.length),o<0||s>n.length||c<0||d>this.length)throw new RangeError("out of range index");if(c>=d&&o>=s)return 0;if(c>=d)return-1;if(o>=s)return 1;if(o>>>=0,s>>>=0,c>>>=0,d>>>=0,this===n)return 0;for(var h=d-c,p=s-o,y=Math.min(h,p),S=this.slice(c,d),P=n.slice(o,s),L=0;L<y;++L)if(S[L]!==P[L]){h=S[L],p=P[L];break}return h<p?-1:p<h?1:0};function bidirectionalIndexOf(t,n,o,s,c){if(t.length===0)return-1;if(typeof o=="string"?(s=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,isNaN(o)&&(o=c?0:t.length-1),o<0&&(o=t.length+o),o>=t.length){if(c)return-1;o=t.length-1}else if(o<0)if(c)o=0;else return-1;if(typeof n=="string"&&(n=Buffer$1.from(n,s)),internalIsBuffer(n))return n.length===0?-1:arrayIndexOf(t,n,o,s,c);if(typeof n=="number")return n=n&255,Buffer$1.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?c?Uint8Array.prototype.indexOf.call(t,n,o):Uint8Array.prototype.lastIndexOf.call(t,n,o):arrayIndexOf(t,[n],o,s,c);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,n,o,s,c){var d=1,h=t.length,p=n.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(t.length<2||n.length<2)return-1;d=2,h/=2,p/=2,o/=2}function y(N,z){return d===1?N[z]:N.readUInt16BE(z*d)}var S;if(c){var P=-1;for(S=o;S<h;S++)if(y(t,S)===y(n,P===-1?0:S-P)){if(P===-1&&(P=S),S-P+1===p)return P*d}else P!==-1&&(S-=S-P),P=-1}else for(o+p>h&&(o=h-p),S=o;S>=0;S--){for(var L=!0,F=0;F<p;F++)if(y(t,S+F)!==y(n,F)){L=!1;break}if(L)return S}return-1}Buffer$1.prototype.includes=function t(n,o,s){return this.indexOf(n,o,s)!==-1},Buffer$1.prototype.indexOf=function t(n,o,s){return bidirectionalIndexOf(this,n,o,s,!0)},Buffer$1.prototype.lastIndexOf=function t(n,o,s){return bidirectionalIndexOf(this,n,o,s,!1)};function hexWrite(t,n,o,s){o=Number(o)||0;var c=t.length-o;s?(s=Number(s),s>c&&(s=c)):s=c;var d=n.length;if(d%2!==0)throw new TypeError("Invalid hex string");s>d/2&&(s=d/2);for(var h=0;h<s;++h){var p=parseInt(n.substr(h*2,2),16);if(isNaN(p))return h;t[o+h]=p}return h}function utf8Write(t,n,o,s){return blitBuffer(utf8ToBytes(n,t.length-o),t,o,s)}function asciiWrite(t,n,o,s){return blitBuffer(asciiToBytes(n),t,o,s)}function latin1Write(t,n,o,s){return asciiWrite(t,n,o,s)}function base64Write(t,n,o,s){return blitBuffer(base64ToBytes(n),t,o,s)}function ucs2Write(t,n,o,s){return blitBuffer(utf16leToBytes(n,t.length-o),t,o,s)}Buffer$1.prototype.write=function t(n,o,s,c){if(o===void 0)c="utf8",s=this.length,o=0;else if(s===void 0&&typeof o=="string")c=o,s=this.length,o=0;else if(isFinite(o))o=o|0,isFinite(s)?(s=s|0,c===void 0&&(c="utf8")):(c=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var d=this.length-o;if((s===void 0||s>d)&&(s=d),n.length>0&&(s<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");for(var h=!1;;)switch(c){case"hex":return hexWrite(this,n,o,s);case"utf8":case"utf-8":return utf8Write(this,n,o,s);case"ascii":return asciiWrite(this,n,o,s);case"latin1":case"binary":return latin1Write(this,n,o,s);case"base64":return base64Write(this,n,o,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,n,o,s);default:if(h)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),h=!0}},Buffer$1.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(t,n,o){return n===0&&o===t.length?fromByteArray(t):fromByteArray(t.slice(n,o))}function utf8Slice(t,n,o){o=Math.min(t.length,o);for(var s=[],c=n;c<o;){var d=t[c],h=null,p=d>239?4:d>223?3:d>191?2:1;if(c+p<=o){var y,S,P,L;switch(p){case 1:d<128&&(h=d);break;case 2:y=t[c+1],(y&192)===128&&(L=(d&31)<<6|y&63,L>127&&(h=L));break;case 3:y=t[c+1],S=t[c+2],(y&192)===128&&(S&192)===128&&(L=(d&15)<<12|(y&63)<<6|S&63,L>2047&&(L<55296||L>57343)&&(h=L));break;case 4:y=t[c+1],S=t[c+2],P=t[c+3],(y&192)===128&&(S&192)===128&&(P&192)===128&&(L=(d&15)<<18|(y&63)<<12|(S&63)<<6|P&63,L>65535&&L<1114112&&(h=L))}}h===null?(h=65533,p=1):h>65535&&(h-=65536,s.push(h>>>10&1023|55296),h=56320|h&1023),s.push(h),c+=p}return decodeCodePointsArray(s)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(t){var n=t.length;if(n<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,t);for(var o="",s=0;s<n;)o+=String.fromCharCode.apply(String,t.slice(s,s+=MAX_ARGUMENTS_LENGTH));return o}function asciiSlice(t,n,o){var s="";o=Math.min(t.length,o);for(var c=n;c<o;++c)s+=String.fromCharCode(t[c]&127);return s}function latin1Slice(t,n,o){var s="";o=Math.min(t.length,o);for(var c=n;c<o;++c)s+=String.fromCharCode(t[c]);return s}function hexSlice(t,n,o){var s=t.length;(!n||n<0)&&(n=0),(!o||o<0||o>s)&&(o=s);for(var c="",d=n;d<o;++d)c+=toHex(t[d]);return c}function utf16leSlice(t,n,o){for(var s=t.slice(n,o),c="",d=0;d<s.length;d+=2)c+=String.fromCharCode(s[d]+s[d+1]*256);return c}Buffer$1.prototype.slice=function t(n,o){var s=this.length;n=~~n,o=o===void 0?s:~~o,n<0?(n+=s,n<0&&(n=0)):n>s&&(n=s),o<0?(o+=s,o<0&&(o=0)):o>s&&(o=s),o<n&&(o=n);var c;if(Buffer$1.TYPED_ARRAY_SUPPORT)c=this.subarray(n,o),c.__proto__=Buffer$1.prototype;else{var d=o-n;c=new Buffer$1(d,void 0);for(var h=0;h<d;++h)c[h]=this[h+n]}return c};function checkOffset(t,n,o){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+n>o)throw new RangeError("Trying to access beyond buffer length")}Buffer$1.prototype.readUIntLE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n],d=1,h=0;++h<o&&(d*=256);)c+=this[n+h]*d;return c},Buffer$1.prototype.readUIntBE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n+--o],d=1;o>0&&(d*=256);)c+=this[n+--o]*d;return c},Buffer$1.prototype.readUInt8=function t(n,o){return o||checkOffset(n,1,this.length),this[n]},Buffer$1.prototype.readUInt16LE=function t(n,o){return o||checkOffset(n,2,this.length),this[n]|this[n+1]<<8},Buffer$1.prototype.readUInt16BE=function t(n,o){return o||checkOffset(n,2,this.length),this[n]<<8|this[n+1]},Buffer$1.prototype.readUInt32LE=function t(n,o){return o||checkOffset(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},Buffer$1.prototype.readUInt32BE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},Buffer$1.prototype.readIntLE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n],d=1,h=0;++h<o&&(d*=256);)c+=this[n+h]*d;return d*=128,c>=d&&(c-=Math.pow(2,8*o)),c},Buffer$1.prototype.readIntBE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=o,d=1,h=this[n+--c];c>0&&(d*=256);)h+=this[n+--c]*d;return d*=128,h>=d&&(h-=Math.pow(2,8*o)),h},Buffer$1.prototype.readInt8=function t(n,o){return o||checkOffset(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},Buffer$1.prototype.readInt16LE=function t(n,o){o||checkOffset(n,2,this.length);var s=this[n]|this[n+1]<<8;return s&32768?s|4294901760:s},Buffer$1.prototype.readInt16BE=function t(n,o){o||checkOffset(n,2,this.length);var s=this[n+1]|this[n]<<8;return s&32768?s|4294901760:s},Buffer$1.prototype.readInt32LE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},Buffer$1.prototype.readInt32BE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},Buffer$1.prototype.readFloatLE=function t(n,o){return o||checkOffset(n,4,this.length),read(this,n,!0,23,4)},Buffer$1.prototype.readFloatBE=function t(n,o){return o||checkOffset(n,4,this.length),read(this,n,!1,23,4)},Buffer$1.prototype.readDoubleLE=function t(n,o){return o||checkOffset(n,8,this.length),read(this,n,!0,52,8)},Buffer$1.prototype.readDoubleBE=function t(n,o){return o||checkOffset(n,8,this.length),read(this,n,!1,52,8)};function checkInt(t,n,o,s,c,d){if(!internalIsBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>c||n<d)throw new RangeError('"value" argument is out of bounds');if(o+s>t.length)throw new RangeError("Index out of range")}Buffer$1.prototype.writeUIntLE=function t(n,o,s,c){if(n=+n,o=o|0,s=s|0,!c){var d=Math.pow(2,8*s)-1;checkInt(this,n,o,s,d,0)}var h=1,p=0;for(this[o]=n&255;++p<s&&(h*=256);)this[o+p]=n/h&255;return o+s},Buffer$1.prototype.writeUIntBE=function t(n,o,s,c){if(n=+n,o=o|0,s=s|0,!c){var d=Math.pow(2,8*s)-1;checkInt(this,n,o,s,d,0)}var h=s-1,p=1;for(this[o+h]=n&255;--h>=0&&(p*=256);)this[o+h]=n/p&255;return o+s},Buffer$1.prototype.writeUInt8=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,1,255,0),Buffer$1.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[o]=n&255,o+1};function objectWriteUInt16(t,n,o,s){n<0&&(n=65535+n+1);for(var c=0,d=Math.min(t.length-o,2);c<d;++c)t[o+c]=(n&255<<8*(s?c:1-c))>>>(s?c:1-c)*8}Buffer$1.prototype.writeUInt16LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8):objectWriteUInt16(this,n,o,!0),o+2},Buffer$1.prototype.writeUInt16BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>8,this[o+1]=n&255):objectWriteUInt16(this,n,o,!1),o+2};function objectWriteUInt32(t,n,o,s){n<0&&(n=4294967295+n+1);for(var c=0,d=Math.min(t.length-o,4);c<d;++c)t[o+c]=n>>>(s?c:3-c)*8&255}Buffer$1.prototype.writeUInt32LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o+3]=n>>>24,this[o+2]=n>>>16,this[o+1]=n>>>8,this[o]=n&255):objectWriteUInt32(this,n,o,!0),o+4},Buffer$1.prototype.writeUInt32BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255):objectWriteUInt32(this,n,o,!1),o+4},Buffer$1.prototype.writeIntLE=function t(n,o,s,c){if(n=+n,o=o|0,!c){var d=Math.pow(2,8*s-1);checkInt(this,n,o,s,d-1,-d)}var h=0,p=1,y=0;for(this[o]=n&255;++h<s&&(p*=256);)n<0&&y===0&&this[o+h-1]!==0&&(y=1),this[o+h]=(n/p>>0)-y&255;return o+s},Buffer$1.prototype.writeIntBE=function t(n,o,s,c){if(n=+n,o=o|0,!c){var d=Math.pow(2,8*s-1);checkInt(this,n,o,s,d-1,-d)}var h=s-1,p=1,y=0;for(this[o+h]=n&255;--h>=0&&(p*=256);)n<0&&y===0&&this[o+h+1]!==0&&(y=1),this[o+h]=(n/p>>0)-y&255;return o+s},Buffer$1.prototype.writeInt8=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,1,127,-128),Buffer$1.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[o]=n&255,o+1},Buffer$1.prototype.writeInt16LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8):objectWriteUInt16(this,n,o,!0),o+2},Buffer$1.prototype.writeInt16BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>8,this[o+1]=n&255):objectWriteUInt16(this,n,o,!1),o+2},Buffer$1.prototype.writeInt32LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,2147483647,-2147483648),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8,this[o+2]=n>>>16,this[o+3]=n>>>24):objectWriteUInt32(this,n,o,!0),o+4},Buffer$1.prototype.writeInt32BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255):objectWriteUInt32(this,n,o,!1),o+4};function checkIEEE754(t,n,o,s,c,d){if(o+s>t.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function writeFloat(t,n,o,s,c){return c||checkIEEE754(t,n,o,4),write(t,n,o,s,23,4),o+4}Buffer$1.prototype.writeFloatLE=function t(n,o,s){return writeFloat(this,n,o,!0,s)},Buffer$1.prototype.writeFloatBE=function t(n,o,s){return writeFloat(this,n,o,!1,s)};function writeDouble(t,n,o,s,c){return c||checkIEEE754(t,n,o,8),write(t,n,o,s,52,8),o+8}Buffer$1.prototype.writeDoubleLE=function t(n,o,s){return writeDouble(this,n,o,!0,s)},Buffer$1.prototype.writeDoubleBE=function t(n,o,s){return writeDouble(this,n,o,!1,s)},Buffer$1.prototype.copy=function t(n,o,s,c){if(s||(s=0),!c&&c!==0&&(c=this.length),o>=n.length&&(o=n.length),o||(o=0),c>0&&c<s&&(c=s),c===s||n.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("sourceStart out of bounds");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),n.length-o<c-s&&(c=n.length-o+s);var d=c-s,h;if(this===n&&s<o&&o<c)for(h=d-1;h>=0;--h)n[h+o]=this[h+s];else if(d<1e3||!Buffer$1.TYPED_ARRAY_SUPPORT)for(h=0;h<d;++h)n[h+o]=this[h+s];else Uint8Array.prototype.set.call(n,this.subarray(s,s+d),o);return d},Buffer$1.prototype.fill=function t(n,o,s,c){if(typeof n=="string"){if(typeof o=="string"?(c=o,o=0,s=this.length):typeof s=="string"&&(c=s,s=this.length),n.length===1){var d=n.charCodeAt(0);d<256&&(n=d)}if(c!==void 0&&typeof c!="string")throw new TypeError("encoding must be a string");if(typeof c=="string"&&!Buffer$1.isEncoding(c))throw new TypeError("Unknown encoding: "+c)}else typeof n=="number"&&(n=n&255);if(o<0||this.length<o||this.length<s)throw new RangeError("Out of range index");if(s<=o)return this;o=o>>>0,s=s===void 0?this.length:s>>>0,n||(n=0);var h;if(typeof n=="number")for(h=o;h<s;++h)this[h]=n;else{var p=internalIsBuffer(n)?n:utf8ToBytes(new Buffer$1(n,c).toString()),y=p.length;for(h=0;h<s-o;++h)this[h+o]=p[h%y]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(t){if(t=stringtrim(t).replace(INVALID_BASE64_RE,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function stringtrim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function toHex(t){return t<16?"0"+t.toString(16):t.toString(16)}function utf8ToBytes(t,n){n=n||1/0;for(var o,s=t.length,c=null,d=[],h=0;h<s;++h){if(o=t.charCodeAt(h),o>55295&&o<57344){if(!c){if(o>56319){(n-=3)>-1&&d.push(239,191,189);continue}else if(h+1===s){(n-=3)>-1&&d.push(239,191,189);continue}c=o;continue}if(o<56320){(n-=3)>-1&&d.push(239,191,189),c=o;continue}o=(c-55296<<10|o-56320)+65536}else c&&(n-=3)>-1&&d.push(239,191,189);if(c=null,o<128){if((n-=1)<0)break;d.push(o)}else if(o<2048){if((n-=2)<0)break;d.push(o>>6|192,o&63|128)}else if(o<65536){if((n-=3)<0)break;d.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((n-=4)<0)break;d.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return d}function asciiToBytes(t){for(var n=[],o=0;o<t.length;++o)n.push(t.charCodeAt(o)&255);return n}function utf16leToBytes(t,n){for(var o,s,c,d=[],h=0;h<t.length&&!((n-=2)<0);++h)o=t.charCodeAt(h),s=o>>8,c=o%256,d.push(c),d.push(s);return d}function base64ToBytes(t){return toByteArray(base64clean(t))}function blitBuffer(t,n,o,s){for(var c=0;c<s&&!(c+o>=n.length||c>=t.length);++c)n[c+o]=t[c];return c}function isnan(t){return t!==t}function isBuffer(t){return t!=null&&(!!t._isBuffer||isFastBuffer(t)||isSlowBuffer(t))}function isFastBuffer(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function isSlowBuffer(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&isFastBuffer(t.slice(0,0))}var domain;function EventHandlers(){}EventHandlers.prototype=Object.create(null);function EventEmitter(){EventEmitter.init.call(this)}EventEmitter.EventEmitter=EventEmitter,EventEmitter.usingDomains=!1,EventEmitter.prototype.domain=void 0,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.init=function(){this.domain=null,EventEmitter.usingDomains&&domain.active,(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new EventHandlers,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function t(n){if(typeof n!="number"||n<0||isNaN(n))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=n,this};function $getMaxListeners(t){return t._maxListeners===void 0?EventEmitter.defaultMaxListeners:t._maxListeners}EventEmitter.prototype.getMaxListeners=function t(){return $getMaxListeners(this)};function emitNone(t,n,o){if(n)t.call(o);else for(var s=t.length,c=arrayClone(t,s),d=0;d<s;++d)c[d].call(o)}function emitOne(t,n,o,s){if(n)t.call(o,s);else for(var c=t.length,d=arrayClone(t,c),h=0;h<c;++h)d[h].call(o,s)}function emitTwo(t,n,o,s,c){if(n)t.call(o,s,c);else for(var d=t.length,h=arrayClone(t,d),p=0;p<d;++p)h[p].call(o,s,c)}function emitThree(t,n,o,s,c,d){if(n)t.call(o,s,c,d);else for(var h=t.length,p=arrayClone(t,h),y=0;y<h;++y)p[y].call(o,s,c,d)}function emitMany(t,n,o,s){if(n)t.apply(o,s);else for(var c=t.length,d=arrayClone(t,c),h=0;h<c;++h)d[h].apply(o,s)}EventEmitter.prototype.emit=function t(n){var o,s,c,d,h,p,y,S=n==="error";if(p=this._events,p)S=S&&p.error==null;else if(!S)return!1;if(y=this.domain,S){if(o=arguments[1],y)o||(o=new Error('Uncaught, unspecified "error" event')),o.domainEmitter=this,o.domain=y,o.domainThrown=!1,y.emit("error",o);else{if(o instanceof Error)throw o;var P=new Error('Uncaught, unspecified "error" event. ('+o+")");throw P.context=o,P}return!1}if(s=p[n],!s)return!1;var L=typeof s=="function";switch(c=arguments.length,c){case 1:emitNone(s,L,this);break;case 2:emitOne(s,L,this,arguments[1]);break;case 3:emitTwo(s,L,this,arguments[1],arguments[2]);break;case 4:emitThree(s,L,this,arguments[1],arguments[2],arguments[3]);break;default:for(d=new Array(c-1),h=1;h<c;h++)d[h-1]=arguments[h];emitMany(s,L,this,d)}return!0};function _addListener(t,n,o,s){var c,d,h;if(typeof o!="function")throw new TypeError('"listener" argument must be a function');if(d=t._events,d?(d.newListener&&(t.emit("newListener",n,o.listener?o.listener:o),d=t._events),h=d[n]):(d=t._events=new EventHandlers,t._eventsCount=0),!h)h=d[n]=o,++t._eventsCount;else if(typeof h=="function"?h=d[n]=s?[o,h]:[h,o]:s?h.unshift(o):h.push(o),!h.warned&&(c=$getMaxListeners(t),c&&c>0&&h.length>c)){h.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+h.length+" "+n+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=t,p.type=n,p.count=h.length,emitWarning(p)}return t}function emitWarning(t){typeof console.warn=="function"?console.warn(t):console.log(t)}EventEmitter.prototype.addListener=function t(n,o){return _addListener(this,n,o,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function t(n,o){return _addListener(this,n,o,!0)};function _onceWrap(t,n,o){var s=!1;function c(){t.removeListener(n,c),s||(s=!0,o.apply(t,arguments))}return c.listener=o,c}EventEmitter.prototype.once=function t(n,o){if(typeof o!="function")throw new TypeError('"listener" argument must be a function');return this.on(n,_onceWrap(this,n,o)),this},EventEmitter.prototype.prependOnceListener=function t(n,o){if(typeof o!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(n,_onceWrap(this,n,o)),this},EventEmitter.prototype.removeListener=function t(n,o){var s,c,d,h,p;if(typeof o!="function")throw new TypeError('"listener" argument must be a function');if(c=this._events,!c)return this;if(s=c[n],!s)return this;if(s===o||s.listener&&s.listener===o)--this._eventsCount===0?this._events=new EventHandlers:(delete c[n],c.removeListener&&this.emit("removeListener",n,s.listener||o));else if(typeof s!="function"){for(d=-1,h=s.length;h-- >0;)if(s[h]===o||s[h].listener&&s[h].listener===o){p=s[h].listener,d=h;break}if(d<0)return this;if(s.length===1){if(s[0]=void 0,--this._eventsCount===0)return this._events=new EventHandlers,this;delete c[n]}else spliceOne(s,d);c.removeListener&&this.emit("removeListener",n,p||o)}return this},EventEmitter.prototype.removeAllListeners=function t(n){var o,s;if(s=this._events,!s)return this;if(!s.removeListener)return arguments.length===0?(this._events=new EventHandlers,this._eventsCount=0):s[n]&&(--this._eventsCount===0?this._events=new EventHandlers:delete s[n]),this;if(arguments.length===0){for(var c=Object.keys(s),d=0,h;d<c.length;++d)h=c[d],h!=="removeListener"&&this.removeAllListeners(h);return this.removeAllListeners("removeListener"),this._events=new EventHandlers,this._eventsCount=0,this}if(o=s[n],typeof o=="function")this.removeListener(n,o);else if(o)do this.removeListener(n,o[o.length-1]);while(o[0]);return this},EventEmitter.prototype.listeners=function t(n){var o,s,c=this._events;return c?(o=c[n],o?typeof o=="function"?s=[o.listener||o]:s=unwrapListeners(o):s=[]):s=[],s},EventEmitter.listenerCount=function(t,n){return typeof t.listenerCount=="function"?t.listenerCount(n):listenerCount$1.call(t,n)},EventEmitter.prototype.listenerCount=listenerCount$1;function listenerCount$1(t){var n=this._events;if(n){var o=n[t];if(typeof o=="function")return 1;if(o)return o.length}return 0}EventEmitter.prototype.eventNames=function t(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function spliceOne(t,n){for(var o=n,s=o+1,c=t.length;s<c;o+=1,s+=1)t[o]=t[s];t.pop()}function arrayClone(t,n){for(var o=new Array(n);n--;)o[n]=t[n];return o}function unwrapListeners(t){for(var n=new Array(t.length),o=0;o<n.length;++o)n[o]=t[o].listener||t[o];return n}function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;typeof global$1.setTimeout=="function"&&(cachedSetTimeout=setTimeout),typeof global$1.clearTimeout=="function"&&(cachedClearTimeout=clearTimeout);function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch{try{return cachedSetTimeout.call(null,t,0)}catch{return cachedSetTimeout.call(this,t,0)}}}function runClearTimeout(t){if(cachedClearTimeout===clearTimeout)return clearTimeout(t);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(t);try{return cachedClearTimeout(t)}catch{try{return cachedClearTimeout.call(null,t)}catch{return cachedClearTimeout.call(this,t)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var t=runTimeout(cleanUpNextTick);draining=!0;for(var n=queue.length;n;){for(currentQueue=queue,queue=[];++queueIndex<n;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,n=queue.length}currentQueue=null,draining=!1,runClearTimeout(t)}}function nextTick(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)n[o-1]=arguments[o];queue.push(new Item(t,n)),queue.length===1&&!draining&&runTimeout(drainQueue)}function Item(t,n){this.fun=t,this.array=n}Item.prototype.run=function(){this.fun.apply(null,this.array)};var title="browser",platform="browser",browser=!0,env={},argv=[],version="",versions={},release={},config={};function noop(){}var on=noop,addListener=noop,once=noop,off=noop,removeListener=noop,removeAllListeners=noop,emit=noop;function binding(t){throw new Error("process.binding is not supported")}function cwd(){return"/"}function chdir(t){throw new Error("process.chdir is not supported")}function umask(){return 0}var performance$1=global$1.performance||{},performanceNow=performance$1.now||performance$1.mozNow||performance$1.msNow||performance$1.oNow||performance$1.webkitNow||function(){return new Date().getTime()};function hrtime(t){var n=performanceNow.call(performance$1)*.001,o=Math.floor(n),s=Math.floor(n%1*1e9);return t&&(o=o-t[0],s=s-t[1],s<0&&(o--,s+=1e9)),[o,s]}var startTime=new Date;function uptime(){var t=new Date,n=t-startTime;return n/1e3}var process$1={nextTick,title,browser,env,argv,version,versions,on,addListener,once,off,removeListener,removeAllListeners,emit,binding,cwd,chdir,umask,hrtime,platform,release,config,uptime},inherits;typeof Object.create=="function"?inherits=function(n,o){n.super_=o,n.prototype=Object.create(o.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:inherits=function(n,o){n.super_=o;var s=function(){};s.prototype=o.prototype,n.prototype=new s,n.prototype.constructor=n};var inherits$1=inherits,formatRegExp=/%[sdj%]/g;function format(t){if(!isString(t)){for(var n=[],o=0;o<arguments.length;o++)n.push(inspect(arguments[o]));return n.join(" ")}for(var o=1,s=arguments,c=s.length,d=String(t).replace(formatRegExp,function(p){if(p==="%%")return"%";if(o>=c)return p;switch(p){case"%s":return String(s[o++]);case"%d":return Number(s[o++]);case"%j":try{return JSON.stringify(s[o++])}catch{return"[Circular]"}default:return p}}),h=s[o];o<c;h=s[++o])isNull(h)||!isObject(h)?d+=" "+h:d+=" "+inspect(h);return d}function deprecate(t,n){if(isUndefined(global$1.process))return function(){return deprecate(t,n).apply(this,arguments)};if(process$1.noDeprecation===!0)return t;var o=!1;function s(){if(!o){if(process$1.throwDeprecation)throw new Error(n);process$1.traceDeprecation?console.trace(n):console.error(n),o=!0}return t.apply(this,arguments)}return s}var debugs={},debugEnviron;function debuglog(t){if(isUndefined(debugEnviron)&&(debugEnviron=process$1.env.NODE_DEBUG||""),t=t.toUpperCase(),!debugs[t])if(new RegExp("\\b"+t+"\\b","i").test(debugEnviron)){var n=0;debugs[t]=function(){var o=format.apply(null,arguments);console.error("%s %d: %s",t,n,o)}}else debugs[t]=function(){};return debugs[t]}function inspect(t,n){var o={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(o.depth=arguments[2]),arguments.length>=4&&(o.colors=arguments[3]),isBoolean(n)?o.showHidden=n:n&&_extend(o,n),isUndefined(o.showHidden)&&(o.showHidden=!1),isUndefined(o.depth)&&(o.depth=2),isUndefined(o.colors)&&(o.colors=!1),isUndefined(o.customInspect)&&(o.customInspect=!0),o.colors&&(o.stylize=stylizeWithColor),formatValue(o,t,o.depth)}inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(t,n){var o=inspect.styles[n];return o?"\x1B["+inspect.colors[o][0]+"m"+t+"\x1B["+inspect.colors[o][1]+"m":t}function stylizeNoColor(t,n){return t}function arrayToHash(t){var n={};return t.forEach(function(o,s){n[o]=!0}),n}function formatValue(t,n,o){if(t.customInspect&&n&&isFunction(n.inspect)&&n.inspect!==inspect&&!(n.constructor&&n.constructor.prototype===n)){var s=n.inspect(o,t);return isString(s)||(s=formatValue(t,s,o)),s}var c=formatPrimitive(t,n);if(c)return c;var d=Object.keys(n),h=arrayToHash(d);if(t.showHidden&&(d=Object.getOwnPropertyNames(n)),isError(n)&&(d.indexOf("message")>=0||d.indexOf("description")>=0))return formatError(n);if(d.length===0){if(isFunction(n)){var p=n.name?": "+n.name:"";return t.stylize("[Function"+p+"]","special")}if(isRegExp(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(isDate(n))return t.stylize(Date.prototype.toString.call(n),"date");if(isError(n))return formatError(n)}var y="",S=!1,P=["{","}"];if(isArray(n)&&(S=!0,P=["[","]"]),isFunction(n)){var L=n.name?": "+n.name:"";y=" [Function"+L+"]"}if(isRegExp(n)&&(y=" "+RegExp.prototype.toString.call(n)),isDate(n)&&(y=" "+Date.prototype.toUTCString.call(n)),isError(n)&&(y=" "+formatError(n)),d.length===0&&(!S||n.length==0))return P[0]+y+P[1];if(o<0)return isRegExp(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var F;return S?F=formatArray(t,n,o,h,d):F=d.map(function(N){return formatProperty(t,n,o,h,N,S)}),t.seen.pop(),reduceToSingleString(F,y,P)}function formatPrimitive(t,n){if(isUndefined(n))return t.stylize("undefined","undefined");if(isString(n)){var o="'"+JSON.stringify(n).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(o,"string")}if(isNumber(n))return t.stylize(""+n,"number");if(isBoolean(n))return t.stylize(""+n,"boolean");if(isNull(n))return t.stylize("null","null")}function formatError(t){return"["+Error.prototype.toString.call(t)+"]"}function formatArray(t,n,o,s,c){for(var d=[],h=0,p=n.length;h<p;++h)hasOwnProperty(n,String(h))?d.push(formatProperty(t,n,o,s,String(h),!0)):d.push("");return c.forEach(function(y){y.match(/^\d+$/)||d.push(formatProperty(t,n,o,s,y,!0))}),d}function formatProperty(t,n,o,s,c,d){var h,p,y;if(y=Object.getOwnPropertyDescriptor(n,c)||{value:n[c]},y.get?y.set?p=t.stylize("[Getter/Setter]","special"):p=t.stylize("[Getter]","special"):y.set&&(p=t.stylize("[Setter]","special")),hasOwnProperty(s,c)||(h="["+c+"]"),p||(t.seen.indexOf(y.value)<0?(isNull(o)?p=formatValue(t,y.value,null):p=formatValue(t,y.value,o-1),p.indexOf(`
|
|
6745
|
+
`,uniforms:{...pick(P,["color","frustumLength","blackPoint","whitePoint","gamma"]),globeDepthTexture:()=>(y==null?void 0:y())??F._depthTexture}});if(c){const N=createBilateralFilterStage({prefix:t,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:y,uniforms:{textureScale:n,...pick(P,["frustumLength","normalExponent","depthExponent"])}}),z=new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion_generate_and_filter`,stages:[L,N]});return F.uniforms.ambientOcclusionTexture=z.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[z,F],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:L,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:N,uniforms:["frustumLength","normalExponent","depthExponent"]},{stage:F,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}else return F.uniforms.ambientOcclusionTexture=L.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[L,F],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:L,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:F,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}const AmbientOcclusionStage=({enabled:t=!0,textureScale:n,directions:o,steps:s,denoise:c,accurateNormalReconstruction:d,outputType:h,useGlobeDepth:p,...y})=>{const{viewer:S}=$e$1(),P=S==null?void 0:S.scene,L=useInstance({owner:P==null?void 0:P.postProcessStages,keys:[n,s,o,c,d,h,p],create:()=>{const F=createAmbientOcclusionStage({textureScale:n,steps:s,directions:o,denoise:c,accurateNormalReconstruction:d,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:()=>P.context.uniformState.globeDepthTexture,uniforms:y});return F.enabled=t,F},transferOwnership:(F,N)=>(N==null||N.add(F),()=>{N==null||N.remove(F)})});return L.enabled=t,Object.assign(L.uniforms,y),P==null||P.requestRender(),usePreRender(()=>{const F=P==null?void 0:P.camera.frustum;if(F instanceof Cesium$1.PerspectiveFrustum){const N=1/Math.tan(F.fovy/2);L.uniforms.focalLength.x=N*F.aspectRatio,L.uniforms.focalLength.y=N}}),null},AmbientOcclusion=t=>{const n=$e$1(),[o,s]=React.useState(!1);return usePreRender(()=>{const c=n.scene;s(!(c!=null&&c.globe.depthTestAgainstTerrain));const{globeHeight:d}=c;if(!c||d==null)return;const h=c.camera.positionCartographic.height-d,p=c==null?void 0:c.camera.frustum;p instanceof Cesium$1.PerspectiveFrustum&&(c.camera.frustum.near=Cesium$1.Math.clamp(h-1,1,5)/Math.tan(p.fov/2))}),jsxRuntimeExports.jsx(AmbientOcclusionStage,{...t,useGlobeDepth:o})};var AmbientOcclusionOutputType=(t=>(t[t.Occlusion=1]="Occlusion",t[t.Normal=2]="Normal",t[t.Depth=3]="Depth",t[t.Weight=4]="Weight",t[t.Shade=5]="Shade",t))(AmbientOcclusionOutputType||{});const AMBIENT_OCCLUSION_QUALITY={low:{directions:4,steps:4,textureScale:.5,maxRadius:30},medium:{directions:4,steps:8,textureScale:.5,maxRadius:40},high:{directions:8,steps:8,textureScale:1,maxRadius:40},extreme:{directions:16,steps:16,textureScale:1,maxRadius:40}},DEFAULT_SKETCH_COLOR="#00bebe",DEFAULT_EDIT_COLOR="#3B3CD0",SELECTED_EDIT_COLOR="#FF9900",ADDING_POINT_COLOR="#3B3CD0";let drawPointImage,editPointImage,selectedPointImage,addingPointImage;const ControlPoint=({position:t,clampToGround:n=!1,index:o,isEditing:s,isSelected:c,isAddingPoint:d,isExtrudedControlPoint:h,handleControlPointMouseEvent:p})=>{const y=React.useRef(t);y.current=t;const S=useConstant$2(()=>new CallbackProperty((N,z)=>"getValue"in y.current?y.current.getValue(N,z):y.current,!1)),P=React.useMemo(()=>({position:S,billboard:{image:s?d?getAddingPointImage():c?getSelectedPointImage():getEditPointImage():getDrawPointImage(),width:s?16:8,height:s?16:8,heightReference:n?HeightReference$1.CLAMP_TO_GROUND:HeightReference$1.NONE,disableDepthTestDistance:1/0}}),[n,S,d,s,c]),L=React.useCallback(()=>{p==null||p(o,!!h,"mousedown")},[o,h,p]),F=React.useCallback(()=>{p==null||p(o,!!h,"click")},[o,h,p]);return jsxRuntimeExports.jsx(Is$1,{...P,onMouseDown:L,onClick:F})};function getDrawPointImage(){if(drawPointImage!=null)return drawPointImage;drawPointImage=document.createElement("canvas"),drawPointImage.width=16,drawPointImage.height=16;const t=drawPointImage.getContext("2d");return invariant$1(t!=null),t.fillStyle="white",t.fillRect(3,3,10,10),t.strokeStyle="black",t.lineWidth=2,t.strokeRect(3,3,10,10),drawPointImage}function getEditPointImage(){return getImage(editPointImage,{size:32,color:"white",strokeColor:DEFAULT_EDIT_COLOR})}function getSelectedPointImage(){return getImage(selectedPointImage,{size:32,color:"white",strokeColor:SELECTED_EDIT_COLOR})}function getAddingPointImage(){if(addingPointImage!=null)return addingPointImage;addingPointImage=document.createElement("canvas"),addingPointImage.width=32,addingPointImage.height=32;const t=addingPointImage.getContext("2d");return invariant$1(t!=null),t.beginPath(),t.arc(16,16,12,0,2*Math.PI),t.fillStyle="white",t.fill(),t.strokeStyle=ADDING_POINT_COLOR,t.lineWidth=4,t.stroke(),t.beginPath(),t.moveTo(16,8),t.lineTo(16,24),t.stroke(),t.moveTo(8,16),t.lineTo(24,16),t.stroke(),addingPointImage}function getImage(t,n){if(t!=null)return t;t=document.createElement("canvas"),t.width=n.size,t.height=n.size;const o=t.getContext("2d");return invariant$1(o!=null),o.beginPath(),o.arc(n.size/2,n.size/2,n.size/2-4,0,2*Math.PI),o.fillStyle=n.color,o.fill(),o.strokeStyle=n.strokeColor,o.lineWidth=4,o.stroke(),t}function assignForwardedRef(t,n){if(typeof t=="function")return t(n),()=>{t(null)};if(t!=null)return t.current=n,()=>{t.current=null}}const Entity=React.memo(React.forwardRef(({entities:t,...n},o)=>{const{viewer:s}=$e$1(),c=s==null?void 0:s.scene,d=s==null?void 0:s.entities,h=t??d,[p,y]=React.useState(()=>new Entity$1(n));return React.useEffect(()=>{y(new Entity$1(n))},[n.id]),React.useEffect(()=>(h==null||h.add(p),()=>{h==null||h.remove(p),c==null||c.requestRender()}),[c,h,p]),React.useEffect(()=>assignForwardedRef(o,p),[o,p]),Object.assign(p,omit(n,"id")),c==null||c.requestRender(),null})),textStyle={padding:"5px",color:"#fff",backgroundColor:"#000",borderRadius:"5px",lineHeight:1},MeasurementText=({children:t})=>jsxRuntimeExports.jsx("div",{style:textStyle,children:t}),MotionConfigContext=React.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),MotionContext=React.createContext({}),PresenceContext=React.createContext(null),isBrowser=typeof document<"u",useIsomorphicLayoutEffect$1=isBrowser?React.useLayoutEffect:React.useEffect,LazyContext=React.createContext({strict:!1}),camelToDash=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),optimizedAppearDataId="framerAppearId",optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId),MotionGlobalConfig={skipAnimations:!1,useManualTiming:!1};class Queue{constructor(){this.order=[],this.scheduled=new Set}add(n){if(!this.scheduled.has(n))return this.scheduled.add(n),this.order.push(n),!0}remove(n){const o=this.order.indexOf(n);o!==-1&&(this.order.splice(o,1),this.scheduled.delete(n))}clear(){this.order.length=0,this.scheduled.clear()}}function createRenderStep(t){let n=new Queue,o=new Queue,s=0,c=!1,d=!1;const h=new WeakSet,p={schedule:(y,S=!1,P=!1)=>{const L=P&&c,F=L?n:o;return S&&h.add(y),F.add(y)&&L&&c&&(s=n.order.length),y},cancel:y=>{o.remove(y),h.delete(y)},process:y=>{if(c){d=!0;return}if(c=!0,[n,o]=[o,n],o.clear(),s=n.order.length,s)for(let S=0;S<s;S++){const P=n.order[S];h.has(P)&&(p.schedule(P),t()),P(y)}c=!1,d&&(d=!1,p.process(y))}};return p}const stepsOrder=["read","resolveKeyframes","update","preRender","render","postRender"],maxElapsed=40;function createRenderBatcher(t,n){let o=!1,s=!0;const c={delta:0,timestamp:0,isProcessing:!1},d=stepsOrder.reduce((L,F)=>(L[F]=createRenderStep(()=>o=!0),L),{}),h=L=>{d[L].process(c)},p=()=>{const L=performance.now();o=!1,c.delta=s?1e3/60:Math.max(Math.min(L-c.timestamp,maxElapsed),1),c.timestamp=L,c.isProcessing=!0,stepsOrder.forEach(h),c.isProcessing=!1,o&&n&&(s=!1,t(p))},y=()=>{o=!0,s=!0,c.isProcessing||t(p)};return{schedule:stepsOrder.reduce((L,F)=>{const N=d[F];return L[F]=(z,W=!1,nt=!1)=>(o||y(),N.schedule(z,W,nt)),L},{}),cancel:L=>stepsOrder.forEach(F=>d[F].cancel(L)),state:c,steps:d}}const{schedule:microtask,cancel:cancelMicrotask}=createRenderBatcher(queueMicrotask,!1);function useVisualElement(t,n,o,s){const{visualElement:c}=React.useContext(MotionContext),d=React.useContext(LazyContext),h=React.useContext(PresenceContext),p=React.useContext(MotionConfigContext).reducedMotion,y=React.useRef();s=s||d.renderer,!y.current&&s&&(y.current=s(t,{visualState:n,parent:c,props:o,presenceContext:h,blockInitialAnimation:h?h.initial===!1:!1,reducedMotionConfig:p}));const S=y.current;React.useInsertionEffect(()=>{S&&S.update(o,h)});const P=React.useRef(!!(o[optimizedAppearDataAttribute]&&!window.HandoffComplete));return useIsomorphicLayoutEffect$1(()=>{S&&(microtask.postRender(S.render),P.current&&S.animationState&&S.animationState.animateChanges())}),React.useEffect(()=>{S&&(S.updateFeatures(),!P.current&&S.animationState&&S.animationState.animateChanges(),P.current&&(P.current=!1,window.HandoffComplete=!0))}),S}function isRefObject(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function useMotionRef(t,n,o){return React.useCallback(s=>{s&&t.mount&&t.mount(s),n&&(s?n.mount(s):n.unmount()),o&&(typeof o=="function"?o(s):isRefObject(o)&&(o.current=s))},[n])}function isVariantLabel(t){return typeof t=="string"||Array.isArray(t)}function isAnimationControls(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const variantPriorityOrder=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],variantProps=["initial",...variantPriorityOrder];function isControllingVariants(t){return isAnimationControls(t.animate)||variantProps.some(n=>isVariantLabel(t[n]))}function isVariantNode(t){return!!(isControllingVariants(t)||t.variants)}function getCurrentTreeVariants(t,n){if(isControllingVariants(t)){const{initial:o,animate:s}=t;return{initial:o===!1||isVariantLabel(o)?o:void 0,animate:isVariantLabel(s)?s:void 0}}return t.inherit!==!1?n:{}}function useCreateMotionContext(t){const{initial:n,animate:o}=getCurrentTreeVariants(t,React.useContext(MotionContext));return React.useMemo(()=>({initial:n,animate:o}),[variantLabelsAsDependency(n),variantLabelsAsDependency(o)])}function variantLabelsAsDependency(t){return Array.isArray(t)?t.join(" "):t}const featureProps={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},featureDefinitions={};for(const t in featureProps)featureDefinitions[t]={isEnabled:n=>featureProps[t].some(o=>!!n[o])};function loadFeatures(t){for(const n in t)featureDefinitions[n]={...featureDefinitions[n],...t[n]}}const LayoutGroupContext=React.createContext({}),SwitchLayoutGroupContext=React.createContext({}),motionComponentSymbol=Symbol.for("motionComponentSymbol");function createMotionComponent({preloadedFeatures:t,createVisualElement:n,useRender:o,useVisualState:s,Component:c}){t&&loadFeatures(t);function d(p,y){let S;const P={...React.useContext(MotionConfigContext),...p,layoutId:useLayoutId(p)},{isStatic:L}=P,F=useCreateMotionContext(p),N=s(p,L);if(!L&&isBrowser){F.visualElement=useVisualElement(c,N,P,n);const z=React.useContext(SwitchLayoutGroupContext),W=React.useContext(LazyContext).strict;F.visualElement&&(S=F.visualElement.loadFeatures(P,W,t,z))}return React__namespace.createElement(MotionContext.Provider,{value:F},S&&F.visualElement?React__namespace.createElement(S,{visualElement:F.visualElement,...P}):null,o(c,p,useMotionRef(N,F.visualElement,y),N,L,F.visualElement))}const h=React.forwardRef(d);return h[motionComponentSymbol]=c,h}function useLayoutId({layoutId:t}){const n=React.useContext(LayoutGroupContext).id;return n&&t!==void 0?n+"-"+t:t}function createMotionProxy(t){function n(s,c={}){return createMotionComponent(t(s,c))}if(typeof Proxy>"u")return n;const o=new Map;return new Proxy(n,{get:(s,c)=>(o.has(c)||o.set(c,n(c)),o.get(c))})}const lowercaseSVGElements=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function isSVGComponent(t){return typeof t!="string"||t.includes("-")?!1:!!(lowercaseSVGElements.indexOf(t)>-1||/[A-Z]/u.test(t))}const scaleCorrectors={};function addScaleCorrector(t){Object.assign(scaleCorrectors,t)}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set(transformPropOrder);function isForcedMotionValue(t,{layout:n,layoutId:o}){return transformProps.has(t)||t.startsWith("origin")||(n||o!==void 0)&&(!!scaleCorrectors[t]||t==="opacity")}const isMotionValue=t=>!!(t&&t.getVelocity),translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(t,{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},s,c){let d="";for(let h=0;h<numTransforms;h++){const p=transformPropOrder[h];if(t[p]!==void 0){const y=translateAlias[p]||p;d+=`${y}(${t[p]}) `}}return n&&!t.z&&(d+="translateZ(0)"),d=d.trim(),c?d=c(t,s?"":d):o&&s&&(d="none"),d}const checkStringStartsWith=t=>n=>typeof n=="string"&&n.startsWith(t),isCSSVariableName=checkStringStartsWith("--"),startsAsVariableToken=checkStringStartsWith("var(--"),isCSSVariableToken=t=>startsAsVariableToken(t)?singleCssVariableRegex.test(t.split("/*")[0].trim()):!1,singleCssVariableRegex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,getValueAsType=(t,n)=>n&&typeof t=="number"?n.transform(t):t,clamp=(t,n,o)=>o>n?n:o<t?t:o,number={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},alpha={...number,transform:t=>clamp(0,1,t)},scale={...number,default:1},sanitize=t=>Math.round(t*1e5)/1e5,floatRegex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,colorRegex=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,singleColorRegex=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function isString$1(t){return typeof t=="string"}const createUnitType=t=>({test:n=>isString$1(n)&&n.endsWith(t)&&n.split(" ").length===1,parse:parseFloat,transform:n=>`${n}${t}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:t=>percent.parse(t)/100,transform:t=>percent.transform(t*100)},int={...number,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,radius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,size:px,top:px,right:px,bottom:px,left:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,rotate:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px,zIndex:int,backgroundPositionX:px,backgroundPositionY:px,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int};function buildHTMLStyles(t,n,o,s){const{style:c,vars:d,transform:h,transformOrigin:p}=t;let y=!1,S=!1,P=!0;for(const L in n){const F=n[L];if(isCSSVariableName(L)){d[L]=F;continue}const N=numberValueTypes[L],z=getValueAsType(F,N);if(transformProps.has(L)){if(y=!0,h[L]=z,!P)continue;F!==(N.default||0)&&(P=!1)}else L.startsWith("origin")?(S=!0,p[L]=z):c[L]=z}if(n.transform||(y||s?c.transform=buildTransform(t.transform,o,P,s):c.transform&&(c.transform="none")),S){const{originX:L="50%",originY:F="50%",originZ:N=0}=p;c.transformOrigin=`${L} ${F} ${N}`}}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(t,n,o){for(const s in n)!isMotionValue(n[s])&&!isForcedMotionValue(s,o)&&(t[s]=n[s])}function useInitialMotionValues({transformTemplate:t},n,o){return React.useMemo(()=>{const s=createHtmlRenderState();return buildHTMLStyles(s,n,{enableHardwareAcceleration:!o},t),Object.assign({},s.vars,s.style)},[n])}function useStyle(t,n,o){const s=t.style||{},c={};return copyRawValuesOnly(c,s,t),Object.assign(c,useInitialMotionValues(t,n,o)),c}function useHTMLProps(t,n,o){const s={},c=useStyle(t,n,o);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,c.userSelect=c.WebkitUserSelect=c.WebkitTouchCallout="none",c.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=c,s}const validMotionProps=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function isValidMotionProp(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||validMotionProps.has(t)}let shouldForward=t=>!isValidMotionProp(t);function loadExternalIsValidProp(t){t&&(shouldForward=n=>n.startsWith("on")?!isValidMotionProp(n):t(n))}try{loadExternalIsValidProp(require("@emotion/is-prop-valid").default)}catch(t){}function filterProps(t,n,o){const s={};for(const c in t)c==="values"&&typeof t.values=="object"||(shouldForward(c)||o===!0&&isValidMotionProp(c)||!n&&!isValidMotionProp(c)||t.draggable&&c.startsWith("onDrag"))&&(s[c]=t[c]);return s}function calcOrigin$1(t,n,o){return typeof t=="string"?t:px.transform(n+o*t)}function calcSVGTransformOrigin(t,n,o){const s=calcOrigin$1(n,t.x,t.width),c=calcOrigin$1(o,t.y,t.height);return`${s} ${c}`}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(t,n,o=1,s=0,c=!0){t.pathLength=1;const d=c?dashKeys:camelKeys;t[d.offset]=px.transform(-s);const h=px.transform(n),p=px.transform(o);t[d.array]=`${h} ${p}`}function buildSVGAttrs(t,{attrX:n,attrY:o,attrScale:s,originX:c,originY:d,pathLength:h,pathSpacing:p=1,pathOffset:y=0,...S},P,L,F){if(buildHTMLStyles(t,S,P,F),L){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:N,style:z,dimensions:W}=t;N.transform&&(W&&(z.transform=N.transform),delete N.transform),W&&(c!==void 0||d!==void 0||z.transform)&&(z.transformOrigin=calcSVGTransformOrigin(W,c!==void 0?c:.5,d!==void 0?d:.5)),n!==void 0&&(N.x=n),o!==void 0&&(N.y=o),s!==void 0&&(N.scale=s),h!==void 0&&buildSVGPath(N,h,p,y,!1)}const createSvgRenderState=()=>({...createHtmlRenderState(),attrs:{}}),isSVGTag=t=>typeof t=="string"&&t.toLowerCase()==="svg";function useSVGProps(t,n,o,s){const c=React.useMemo(()=>{const d=createSvgRenderState();return buildSVGAttrs(d,n,{enableHardwareAcceleration:!1},isSVGTag(s),t.transformTemplate),{...d.attrs,style:{...d.style}}},[n]);if(t.style){const d={};copyRawValuesOnly(d,t.style,t),c.style={...d,...c.style}}return c}function createUseRender(t=!1){return(o,s,c,{latestValues:d},h)=>{const y=(isSVGComponent(o)?useSVGProps:useHTMLProps)(s,d,h,o),S=filterProps(s,typeof o=="string",t),P=o!==React.Fragment?{...S,...y,ref:c}:{},{children:L}=s,F=React.useMemo(()=>isMotionValue(L)?L.get():L,[L]);return React.createElement(o,{...P,children:F})}}function renderHTML(t,{style:n,vars:o},s,c){Object.assign(t.style,n,c&&c.getProjectionStyles(s));for(const d in o)t.style.setProperty(d,o[d])}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function renderSVG(t,n,o,s){renderHTML(t,n,void 0,s);for(const c in n.attrs)t.setAttribute(camelCaseAttributes.has(c)?c:camelToDash(c),n.attrs[c])}function scrapeMotionValuesFromProps$1(t,n,o){var s;const{style:c}=t,d={};for(const h in c)(isMotionValue(c[h])||n.style&&isMotionValue(n.style[h])||isForcedMotionValue(h,t)||((s=o==null?void 0:o.getValue(h))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(d[h]=c[h]);return d}function scrapeMotionValuesFromProps(t,n,o){const s=scrapeMotionValuesFromProps$1(t,n,o);for(const c in t)if(isMotionValue(t[c])||isMotionValue(n[c])){const d=transformPropOrder.indexOf(c)!==-1?"attr"+c.charAt(0).toUpperCase()+c.substring(1):c;s[d]=t[c]}return s}function resolveVariantFromProps(t,n,o,s={},c={}){return typeof n=="function"&&(n=n(o!==void 0?o:t.custom,s,c)),typeof n=="string"&&(n=t.variants&&t.variants[n]),typeof n=="function"&&(n=n(o!==void 0?o:t.custom,s,c)),n}function useConstant(t){const n=React.useRef(null);return n.current===null&&(n.current=t()),n.current}const isKeyframesTarget=t=>Array.isArray(t),isCustomValue=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),resolveFinalValueInKeyframes=t=>isKeyframesTarget(t)?t[t.length-1]||0:t;function resolveMotionValue(t){const n=isMotionValue(t)?t.get():t;return isCustomValue(n)?n.toValue():n}function makeState({scrapeMotionValuesFromProps:t,createRenderState:n,onMount:o},s,c,d){const h={latestValues:makeLatestValues(s,c,d,t),renderState:n()};return o&&(h.mount=p=>o(s,p,h)),h}const makeUseVisualState=t=>(n,o)=>{const s=React.useContext(MotionContext),c=React.useContext(PresenceContext),d=()=>makeState(t,n,s,c);return o?d():useConstant(d)};function makeLatestValues(t,n,o,s){const c={},d=s(t,{});for(const F in d)c[F]=resolveMotionValue(d[F]);let{initial:h,animate:p}=t;const y=isControllingVariants(t),S=isVariantNode(t);n&&S&&!y&&t.inherit!==!1&&(h===void 0&&(h=n.initial),p===void 0&&(p=n.animate));let P=o?o.initial===!1:!1;P=P||h===!1;const L=P?p:h;return L&&typeof L!="boolean"&&!isAnimationControls(L)&&(Array.isArray(L)?L:[L]).forEach(N=>{const z=resolveVariantFromProps(t,N);if(!z)return;const{transitionEnd:W,transition:nt,...Pe}=z;for(const se in Pe){let mt=Pe[se];if(Array.isArray(mt)){const kt=P?mt.length-1:0;mt=mt[kt]}mt!==null&&(c[se]=mt)}for(const se in W)c[se]=W[se]}),c}const noop$1=t=>t,{schedule:frame,cancel:cancelFrame,state:frameData,steps}=createRenderBatcher(typeof requestAnimationFrame<"u"?requestAnimationFrame:noop$1,!0),svgMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps,createRenderState:createSvgRenderState,onMount:(t,n,{renderState:o,latestValues:s})=>{frame.read(()=>{try{o.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{o.dimensions={x:0,y:0,width:0,height:0}}}),frame.render(()=>{buildSVGAttrs(o,s,{enableHardwareAcceleration:!1},isSVGTag(n.tagName),t.transformTemplate),renderSVG(n,o)})}})},htmlMotionConfig={useVisualState:makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState})};function createDomMotionConfig(t,{forwardMotionProps:n=!1},o,s){return{...isSVGComponent(t)?svgMotionConfig:htmlMotionConfig,preloadedFeatures:o,useRender:createUseRender(n),createVisualElement:s,Component:t}}function addDomEvent(t,n,o,s={passive:!0}){return t.addEventListener(n,o,s),()=>t.removeEventListener(n,o)}const isPrimaryPointer=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function extractEventInfo(t,n="page"){return{point:{x:t[n+"X"],y:t[n+"Y"]}}}const addPointerInfo=t=>n=>isPrimaryPointer(n)&&t(n,extractEventInfo(n));function addPointerEvent(t,n,o,s){return addDomEvent(t,n,addPointerInfo(o),s)}const combineFunctions=(t,n)=>o=>n(t(o)),pipe=(...t)=>t.reduce(combineFunctions);function createLock(t){let n=null;return()=>{const o=()=>{n=null};return n===null?(n=t,o):!1}}const globalHorizontalLock=createLock("dragHorizontal"),globalVerticalLock=createLock("dragVertical");function getGlobalLock(t){let n=!1;if(t==="y")n=globalVerticalLock();else if(t==="x")n=globalHorizontalLock();else{const o=globalHorizontalLock(),s=globalVerticalLock();o&&s?n=()=>{o(),s()}:(o&&o(),s&&s())}return n}function isDragActive(){const t=getGlobalLock(!0);return t?(t(),!1):!0}class Feature{constructor(n){this.isMounted=!1,this.node=n}update(){}}function addHoverEvent(t,n){const o="pointer"+(n?"enter":"leave"),s="onHover"+(n?"Start":"End"),c=(d,h)=>{if(d.pointerType==="touch"||isDragActive())return;const p=t.getProps();t.animationState&&p.whileHover&&t.animationState.setActive("whileHover",n),p[s]&&p[s](d,h)};return addPointerEvent(t.current,o,c,{passive:!t.getProps()[s]})}class HoverGesture extends Feature{mount(){this.unmount=pipe(addHoverEvent(this.node,!0),addHoverEvent(this.node,!1))}unmount(){}}class FocusGesture extends Feature{constructor(){super(...arguments),this.isActive=!1}onFocus(){let n=!1;try{n=this.node.current.matches(":focus-visible")}catch{n=!0}!n||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const isNodeOrChild=(t,n)=>n?t===n?!0:isNodeOrChild(t,n.parentElement):!1;function fireSyntheticPointerEvent(t,n){if(!n)return;const o=new PointerEvent("pointer"+t);n(o,extractEventInfo(o))}class PressGesture extends Feature{constructor(){super(...arguments),this.removeStartListeners=noop$1,this.removeEndListeners=noop$1,this.removeAccessibleListeners=noop$1,this.startPointerPress=(n,o)=>{if(this.isPressing)return;this.removeEndListeners();const s=this.node.getProps(),d=addPointerEvent(window,"pointerup",(p,y)=>{if(!this.checkPressEnd())return;const{onTap:S,onTapCancel:P,globalTapTarget:L}=this.node.getProps();!L&&!isNodeOrChild(this.node.current,p.target)?P&&P(p,y):S&&S(p,y)},{passive:!(s.onTap||s.onPointerUp)}),h=addPointerEvent(window,"pointercancel",(p,y)=>this.cancelPress(p,y),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=pipe(d,h),this.startPress(n,o)},this.startAccessiblePress=()=>{const n=d=>{if(d.key!=="Enter"||this.isPressing)return;const h=p=>{p.key!=="Enter"||!this.checkPressEnd()||fireSyntheticPointerEvent("up",(y,S)=>{const{onTap:P}=this.node.getProps();P&&P(y,S)})};this.removeEndListeners(),this.removeEndListeners=addDomEvent(this.node.current,"keyup",h),fireSyntheticPointerEvent("down",(p,y)=>{this.startPress(p,y)})},o=addDomEvent(this.node.current,"keydown",n),s=()=>{this.isPressing&&fireSyntheticPointerEvent("cancel",(d,h)=>this.cancelPress(d,h))},c=addDomEvent(this.node.current,"blur",s);this.removeAccessibleListeners=pipe(o,c)}}startPress(n,o){this.isPressing=!0;const{onTapStart:s,whileTap:c}=this.node.getProps();c&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&s(n,o)}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!isDragActive()}cancelPress(n,o){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&s(n,o)}mount(){const n=this.node.getProps(),o=addPointerEvent(n.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(n.onTapStart||n.onPointerStart)}),s=addDomEvent(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=pipe(o,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const observerCallbacks=new WeakMap,observers=new WeakMap,fireObserverCallback=t=>{const n=observerCallbacks.get(t.target);n&&n(t)},fireAllObserverCallbacks=t=>{t.forEach(fireObserverCallback)};function initIntersectionObserver({root:t,...n}){const o=t||document;observers.has(o)||observers.set(o,{});const s=observers.get(o),c=JSON.stringify(n);return s[c]||(s[c]=new IntersectionObserver(fireAllObserverCallbacks,{root:t,...n})),s[c]}function observeIntersection(t,n,o){const s=initIntersectionObserver(n);return observerCallbacks.set(t,o),s.observe(t),()=>{observerCallbacks.delete(t),s.unobserve(t)}}const thresholdNames={some:0,all:1};class InViewFeature extends Feature{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:n={}}=this.node.getProps(),{root:o,margin:s,amount:c="some",once:d}=n,h={root:o?o.current:void 0,rootMargin:s,threshold:typeof c=="number"?c:thresholdNames[c]},p=y=>{const{isIntersecting:S}=y;if(this.isInView===S||(this.isInView=S,d&&!S&&this.hasEnteredView))return;S&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",S);const{onViewportEnter:P,onViewportLeave:L}=this.node.getProps(),F=S?P:L;F&&F(y)};return observeIntersection(this.node.current,h,p)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:n,prevProps:o}=this.node;["amount","margin","root"].some(hasViewportOptionChanged(n,o))&&this.startObserver()}unmount(){}}function hasViewportOptionChanged({viewport:t={}},{viewport:n={}}={}){return o=>t[o]!==n[o]}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};function shallowCompare(t,n){if(!Array.isArray(n))return!1;const o=n.length;if(o!==t.length)return!1;for(let s=0;s<o;s++)if(n[s]!==t[s])return!1;return!0}function getCurrent(t){const n={};return t.values.forEach((o,s)=>n[s]=o.get()),n}function getVelocity$1(t){const n={};return t.values.forEach((o,s)=>n[s]=o.getVelocity()),n}function resolveVariant(t,n,o){const s=t.getProps();return resolveVariantFromProps(s,n,o!==void 0?o:s.custom,getCurrent(t),getVelocity$1(t))}const secondsToMilliseconds=t=>t*1e3,millisecondsToSeconds=t=>t/1e3,underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(t,{keyframes:n})=>n.length>2?keyframesTransition:transformProps.has(t)?t.startsWith("scale")?criticallyDampedSpring(n[1]):underDampedSpring:ease;function isTransitionDefined({when:t,delay:n,delayChildren:o,staggerChildren:s,staggerDirection:c,repeat:d,repeatType:h,repeatDelay:p,from:y,elapsed:S,...P}){return!!Object.keys(P).length}function getValueTransition(t,n){return t[n]||t.default||t}const isNotNull=t=>t!==null;function getFinalKeyframe(t,{repeat:n,repeatType:o="loop"},s){const c=t.filter(isNotNull),d=n&&o!=="loop"&&n%2===1?0:c.length-1;return!d||s===void 0?c[d]:s}let now;function clearTime(){now=void 0}const time={now:()=>(now===void 0&&time.set(frameData.isProcessing||MotionGlobalConfig.useManualTiming?frameData.timestamp:performance.now()),now),set:t=>{now=t,queueMicrotask(clearTime)}},isZeroValueString=t=>/^0[^.\s]+$/u.test(t);function isNone(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||isZeroValueString(t):!0}let warning=noop$1,invariant=noop$1;process.env.NODE_ENV!=="production"&&(warning=(t,n)=>{!t&&typeof console<"u"&&console.warn(n)},invariant=(t,n)=>{if(!t)throw new Error(n)});const isNumericalString=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),splitCSSVariableRegex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function parseCSSVariable(t){const n=splitCSSVariableRegex.exec(t);if(!n)return[,];const[,o,s,c]=n;return[`--${o??s}`,c]}const maxDepth=4;function getVariableValue(t,n,o=1){invariant(o<=maxDepth,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,c]=parseCSSVariable(t);if(!s)return;const d=window.getComputedStyle(n).getPropertyValue(s);if(d){const h=d.trim();return isNumericalString(h)?parseFloat(h):h}return isCSSVariableToken(c)?getVariableValue(c,n,o+1):c}const positionalKeys=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),isNumOrPxType=t=>t===number||t===px,getPosFromMatrix=(t,n)=>parseFloat(t.split(", ")[n]),getTranslateFromMatrix=(t,n)=>(o,{transform:s})=>{if(s==="none"||!s)return 0;const c=s.match(/^matrix3d\((.+)\)$/u);if(c)return getPosFromMatrix(c[1],n);{const d=s.match(/^matrix\((.+)\)$/u);return d?getPosFromMatrix(d[1],t):0}},transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(t=>!transformKeys.has(t));function removeNonTranslationalTransform(t){const n=[];return nonTranslationalTransformKeys.forEach(o=>{const s=t.getValue(o);s!==void 0&&(n.push([o,s.get()]),s.set(o.startsWith("scale")?1:0))}),n}const positionalValues={width:({x:t},{paddingLeft:n="0",paddingRight:o="0"})=>t.max-t.min-parseFloat(n)-parseFloat(o),height:({y:t},{paddingTop:n="0",paddingBottom:o="0"})=>t.max-t.min-parseFloat(n)-parseFloat(o),top:(t,{top:n})=>parseFloat(n),left:(t,{left:n})=>parseFloat(n),bottom:({y:t},{top:n})=>parseFloat(n)+(t.max-t.min),right:({x:t},{left:n})=>parseFloat(n)+(t.max-t.min),x:getTranslateFromMatrix(4,13),y:getTranslateFromMatrix(5,14)};positionalValues.translateX=positionalValues.x,positionalValues.translateY=positionalValues.y;const testValueType=t=>n=>n.test(t),auto={test:t=>t==="auto",parse:t=>t},dimensionValueTypes=[number,px,percent,degrees,vw,vh,auto],findDimensionValueType=t=>dimensionValueTypes.find(testValueType(t)),toResolve=new Set;let isScheduled=!1,anyNeedsMeasurement=!1;function measureAllKeyframes(){if(anyNeedsMeasurement){const t=Array.from(toResolve).filter(s=>s.needsMeasurement),n=new Set(t.map(s=>s.element)),o=new Map;n.forEach(s=>{removeNonTranslationalTransform(s).length&&(o.set(s,removeNonTranslationalTransform(s)),s.render())}),t.forEach(s=>s.measureInitialState()),n.forEach(s=>{s.render()}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}anyNeedsMeasurement=!1,isScheduled=!1,toResolve.forEach(t=>t.complete()),toResolve.clear()}function readAllKeyframes(){toResolve.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(anyNeedsMeasurement=!0)})}function flushKeyframeResolvers(){readAllKeyframes(),measureAllKeyframes()}class KeyframeResolver{constructor(n,o,s,c,d,h=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...n],this.onComplete=o,this.name=s,this.motionValue=c,this.element=d,this.isAsync=h}scheduleResolve(){this.isScheduled=!0,this.isAsync?(toResolve.add(this),isScheduled||(isScheduled=!0,frame.read(readAllKeyframes),frame.resolveKeyframes(measureAllKeyframes))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:n,name:o,element:s,motionValue:c}=this;for(let d=0;d<n.length;d++)if(n[d]===null)if(d===0){const h=c==null?void 0:c.get(),p=n[n.length-1];if(h!==void 0)n[0]=h;else if(s&&o){const y=s.readValue(o,p);y!=null&&(n[0]=y)}n[0]===void 0&&(n[0]=p),c&&h===void 0&&c.set(n[0])}else n[d]=n[d-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),toResolve.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,toResolve.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const isColorString=(t,n)=>o=>!!(isString$1(o)&&singleColorRegex.test(o)&&o.startsWith(t)||n&&Object.prototype.hasOwnProperty.call(o,n)),splitColor=(t,n,o)=>s=>{if(!isString$1(s))return s;const[c,d,h,p]=s.match(floatRegex);return{[t]:parseFloat(c),[n]:parseFloat(d),[o]:parseFloat(h),alpha:p!==void 0?parseFloat(p):1}},clampRgbUnit=t=>clamp(0,255,t),rgbUnit={...number,transform:t=>Math.round(clampRgbUnit(t))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red:t,green:n,blue:o,alpha:s=1})=>"rgba("+rgbUnit.transform(t)+", "+rgbUnit.transform(n)+", "+rgbUnit.transform(o)+", "+sanitize(alpha.transform(s))+")"};function parseHex(t){let n="",o="",s="",c="";return t.length>5?(n=t.substring(1,3),o=t.substring(3,5),s=t.substring(5,7),c=t.substring(7,9)):(n=t.substring(1,2),o=t.substring(2,3),s=t.substring(3,4),c=t.substring(4,5),n+=n,o+=o,s+=s,c+=c),{red:parseInt(n,16),green:parseInt(o,16),blue:parseInt(s,16),alpha:c?parseInt(c,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue:t,saturation:n,lightness:o,alpha:s=1})=>"hsla("+Math.round(t)+", "+percent.transform(sanitize(n))+", "+percent.transform(sanitize(o))+", "+sanitize(alpha.transform(s))+")"},color={test:t=>rgba.test(t)||hex.test(t)||hsla.test(t),parse:t=>rgba.test(t)?rgba.parse(t):hsla.test(t)?hsla.parse(t):hex.parse(t),transform:t=>isString$1(t)?t:t.hasOwnProperty("red")?rgba.transform(t):hsla.transform(t)};function test(t){var n,o;return isNaN(t)&&isString$1(t)&&(((n=t.match(floatRegex))===null||n===void 0?void 0:n.length)||0)+(((o=t.match(colorRegex))===null||o===void 0?void 0:o.length)||0)>0}const NUMBER_TOKEN="number",COLOR_TOKEN="color",VAR_TOKEN="var",VAR_FUNCTION_TOKEN="var(",SPLIT_TOKEN="${}",complexRegex=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function analyseComplexValue(t){const n=t.toString(),o=[],s={color:[],number:[],var:[]},c=[];let d=0;const p=n.replace(complexRegex,y=>(color.test(y)?(s.color.push(d),c.push(COLOR_TOKEN),o.push(color.parse(y))):y.startsWith(VAR_FUNCTION_TOKEN)?(s.var.push(d),c.push(VAR_TOKEN),o.push(y)):(s.number.push(d),c.push(NUMBER_TOKEN),o.push(parseFloat(y))),++d,SPLIT_TOKEN)).split(SPLIT_TOKEN);return{values:o,split:p,indexes:s,types:c}}function parseComplexValue(t){return analyseComplexValue(t).values}function createTransformer(t){const{split:n,types:o}=analyseComplexValue(t),s=n.length;return c=>{let d="";for(let h=0;h<s;h++)if(d+=n[h],c[h]!==void 0){const p=o[h];p===NUMBER_TOKEN?d+=sanitize(c[h]):p===COLOR_TOKEN?d+=color.transform(c[h]):d+=c[h]}return d}}const convertNumbersToZero=t=>typeof t=="number"?0:t;function getAnimatableNone$1(t){const n=parseComplexValue(t);return createTransformer(t)(n.map(convertNumbersToZero))}const complex={test,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1},maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(t){const[n,o]=t.slice(0,-1).split("(");if(n==="drop-shadow")return t;const[s]=o.match(floatRegex)||[];if(!s)return t;const c=o.replace(s,"");let d=maxDefaults.has(n)?1:0;return s!==o&&(d*=100),n+"("+d+c+")"}const functionRegex=/\b([a-z-]*)\(.*?\)/gu,filter={...complex,getAnimatableNone:t=>{const n=t.match(functionRegex);return n?n.map(applyDefaultFilter).join(" "):t}},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter,WebkitFilter:filter},getDefaultValueType=t=>defaultValueTypes[t];function getAnimatableNone(t,n){let o=getDefaultValueType(t);return o!==filter&&(o=complex),o.getAnimatableNone?o.getAnimatableNone(n):void 0}function makeNoneKeyframesAnimatable(t,n,o){let s=0,c;for(;s<t.length&&!c;)typeof t[s]=="string"&&t[s]!=="none"&&t[s]!=="0"&&(c=t[s]),s++;if(c&&o)for(const d of n)t[d]=getAnimatableNone(o,c)}class DOMKeyframesResolver extends KeyframeResolver{constructor(n,o,s,c){super(n,o,s,c,c==null?void 0:c.owner,!0)}readKeyframes(){const{unresolvedKeyframes:n,element:o,name:s}=this;if(!o.current)return;super.readKeyframes();for(let y=0;y<n.length;y++){const S=n[y];if(typeof S=="string"&&isCSSVariableToken(S)){const P=getVariableValue(S,o.current);P!==void 0&&(n[y]=P)}}if(!positionalKeys.has(s)||n.length!==2)return this.resolveNoneKeyframes();const[c,d]=n,h=findDimensionValueType(c),p=findDimensionValueType(d);if(h!==p)if(isNumOrPxType(h)&&isNumOrPxType(p))for(let y=0;y<n.length;y++){const S=n[y];typeof S=="string"&&(n[y]=parseFloat(S))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:n,name:o}=this,s=[];for(let c=0;c<n.length;c++)isNone(n[c])&&s.push(c);s.length&&makeNoneKeyframesAnimatable(n,s,o)}measureInitialState(){const{element:n,unresolvedKeyframes:o,name:s}=this;if(!n.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=positionalValues[s](n.measureViewportBox(),window.getComputedStyle(n.current)),o[0]=this.measuredOrigin;const c=o[o.length-1];c!==void 0&&n.getValue(s,c).jump(c,!1)}measureEndState(){var n;const{element:o,name:s,unresolvedKeyframes:c}=this;if(!o.current)return;const d=o.getValue(s);d&&d.jump(this.measuredOrigin,!1);const h=c.length-1,p=c[h];c[h]=positionalValues[s](o.measureViewportBox(),window.getComputedStyle(o.current)),p!==null&&(this.finalKeyframe=p),!((n=this.removedTransforms)===null||n===void 0)&&n.length&&this.removedTransforms.forEach(([y,S])=>{o.getValue(y).set(S)}),this.resolveNoneKeyframes()}}function memo(t){let n;return()=>(n===void 0&&(n=t()),n)}const isAnimatable=(t,n)=>n==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(complex.test(t)||t==="0")&&!t.startsWith("url("));function hasKeyframesChanged(t){const n=t[0];if(t.length===1)return!0;for(let o=0;o<t.length;o++)if(t[o]!==n)return!0}function canAnimate(t,n,o,s){const c=t[0];if(c===null)return!1;const d=t[t.length-1],h=isAnimatable(c,n),p=isAnimatable(d,n);return warning(h===p,`You are trying to animate ${n} from "${c}" to "${d}". ${c} is not an animatable value - to enable this animation set ${c} to a value animatable to ${d} via the \`style\` property.`),!h||!p?!1:hasKeyframesChanged(t)||o==="spring"&&s}class BaseAnimation{constructor({autoplay:n=!0,delay:o=0,type:s="keyframes",repeat:c=0,repeatDelay:d=0,repeatType:h="loop",...p}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:n,delay:o,type:s,repeat:c,repeatDelay:d,repeatType:h,...p},this.updateFinishedPromise()}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&flushKeyframeResolvers(),this._resolved}onKeyframesResolved(n,o){this.hasAttemptedResolve=!0;const{name:s,type:c,velocity:d,delay:h,onComplete:p,onUpdate:y,isGenerator:S}=this.options;if(!S&&!canAnimate(n,s,c,d))if(h)this.options.duration=0;else{y==null||y(getFinalKeyframe(n,this.options,o)),p==null||p(),this.resolveFinishedPromise();return}const P=this.initPlayback(n,o);P!==!1&&(this._resolved={keyframes:n,finalKeyframe:o,...P},this.onPostResolved())}onPostResolved(){}then(n,o){return this.currentFinishedPromise.then(n,o)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(n=>{this.resolveFinishedPromise=n})}}function velocityPerSecond(t,n){return n?t*(1e3/n):0}const velocitySampleDuration=5;function calcGeneratorVelocity(t,n,o){const s=Math.max(n-velocitySampleDuration,0);return velocityPerSecond(o-t(s),n-s)}const safeMin=.001,minDuration=.01,maxDuration$1=10,minDamping=.05,maxDamping=1;function findSpring({duration:t=800,bounce:n=.25,velocity:o=0,mass:s=1}){let c,d;warning(t<=secondsToMilliseconds(maxDuration$1),"Spring duration must be 10 seconds or less");let h=1-n;h=clamp(minDamping,maxDamping,h),t=clamp(minDuration,maxDuration$1,millisecondsToSeconds(t)),h<1?(c=S=>{const P=S*h,L=P*t,F=P-o,N=calcAngularFreq(S,h),z=Math.exp(-L);return safeMin-F/N*z},d=S=>{const L=S*h*t,F=L*o+o,N=Math.pow(h,2)*Math.pow(S,2)*t,z=Math.exp(-L),W=calcAngularFreq(Math.pow(S,2),h);return(-c(S)+safeMin>0?-1:1)*((F-N)*z)/W}):(c=S=>{const P=Math.exp(-S*t),L=(S-o)*t+1;return-.001+P*L},d=S=>{const P=Math.exp(-S*t),L=(o-S)*(t*t);return P*L});const p=5/t,y=approximateRoot(c,d,p);if(t=secondsToMilliseconds(t),isNaN(y))return{stiffness:100,damping:10,duration:t};{const S=Math.pow(y,2)*s;return{stiffness:S,damping:h*2*Math.sqrt(s*S),duration:t}}}const rootIterations=12;function approximateRoot(t,n,o){let s=o;for(let c=1;c<rootIterations;c++)s=s-t(s)/n(s);return s}function calcAngularFreq(t,n){return t*Math.sqrt(1-n*n)}const durationKeys=["duration","bounce"],physicsKeys=["stiffness","damping","mass"];function isSpringType(t,n){return n.some(o=>t[o]!==void 0)}function getSpringOptions(t){let n={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!isSpringType(t,physicsKeys)&&isSpringType(t,durationKeys)){const o=findSpring(t);n={...n,...o,mass:1},n.isResolvedFromDuration=!0}return n}function spring({keyframes:t,restDelta:n,restSpeed:o,...s}){const c=t[0],d=t[t.length-1],h={done:!1,value:c},{stiffness:p,damping:y,mass:S,duration:P,velocity:L,isResolvedFromDuration:F}=getSpringOptions({...s,velocity:-millisecondsToSeconds(s.velocity||0)}),N=L||0,z=y/(2*Math.sqrt(p*S)),W=d-c,nt=millisecondsToSeconds(Math.sqrt(p/S)),Pe=Math.abs(W)<5;o||(o=Pe?.01:2),n||(n=Pe?.005:.5);let se;if(z<1){const mt=calcAngularFreq(nt,z);se=kt=>{const mn=Math.exp(-z*nt*kt);return d-mn*((N+z*nt*W)/mt*Math.sin(mt*kt)+W*Math.cos(mt*kt))}}else if(z===1)se=mt=>d-Math.exp(-nt*mt)*(W+(N+nt*W)*mt);else{const mt=nt*Math.sqrt(z*z-1);se=kt=>{const mn=Math.exp(-z*nt*kt),_i=Math.min(mt*kt,300);return d-mn*((N+z*nt*W)*Math.sinh(_i)+mt*W*Math.cosh(_i))/mt}}return{calculatedDuration:F&&P||null,next:mt=>{const kt=se(mt);if(F)h.done=mt>=P;else{let mn=N;mt!==0&&(z<1?mn=calcGeneratorVelocity(se,mt,kt):mn=0);const _i=Math.abs(mn)<=o,zi=Math.abs(d-kt)<=n;h.done=_i&&zi}return h.value=h.done?d:kt,h}}}function inertia({keyframes:t,velocity:n=0,power:o=.8,timeConstant:s=325,bounceDamping:c=10,bounceStiffness:d=500,modifyTarget:h,min:p,max:y,restDelta:S=.5,restSpeed:P}){const L=t[0],F={done:!1,value:L},N=Sa=>p!==void 0&&Sa<p||y!==void 0&&Sa>y,z=Sa=>p===void 0?y:y===void 0||Math.abs(p-Sa)<Math.abs(y-Sa)?p:y;let W=o*n;const nt=L+W,Pe=h===void 0?nt:h(nt);Pe!==nt&&(W=Pe-L);const se=Sa=>-W*Math.exp(-Sa/s),mt=Sa=>Pe+se(Sa),kt=Sa=>{const fa=se(Sa),La=mt(Sa);F.done=Math.abs(fa)<=S,F.value=F.done?Pe:La};let mn,_i;const zi=Sa=>{N(F.value)&&(mn=Sa,_i=spring({keyframes:[F.value,z(F.value)],velocity:calcGeneratorVelocity(mt,Sa,F.value),damping:c,stiffness:d,restDelta:S,restSpeed:P}))};return zi(0),{calculatedDuration:null,next:Sa=>{let fa=!1;return!_i&&mn===void 0&&(fa=!0,kt(Sa),zi(Sa)),mn!==void 0&&Sa>=mn?_i.next(Sa-mn):(!fa&&kt(Sa),F)}}}const calcBezier=(t,n,o)=>(((1-3*o+3*n)*t+(3*o-6*n))*t+3*n)*t,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(t,n,o,s,c){let d,h,p=0;do h=n+(o-n)/2,d=calcBezier(h,s,c)-t,d>0?o=h:n=h;while(Math.abs(d)>subdivisionPrecision&&++p<subdivisionMaxIterations);return h}function cubicBezier(t,n,o,s){if(t===n&&o===s)return noop$1;const c=d=>binarySubdivide(d,0,1,t,o);return d=>d===0||d===1?d:calcBezier(c(d),n,s)}const easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=t=>Array.isArray(t)&&typeof t[0]!="number",mirrorEasing=t=>n=>n<=.5?t(2*n)/2:(2-t(2*(1-n)))/2,reverseEasing=t=>n=>1-t(1-n),circIn=t=>1-Math.sin(Math.acos(t)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circIn),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=t=>(t*=2)<1?.5*backIn(t):.5*(2-Math.pow(2,-10*(t-1))),easingLookup={linear:noop$1,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},easingDefinitionToFunction=t=>{if(Array.isArray(t)){invariant(t.length===4,"Cubic bezier arrays must contain four numerical values.");const[n,o,s,c]=t;return cubicBezier(n,o,s,c)}else if(typeof t=="string")return invariant(easingLookup[t]!==void 0,`Invalid easing type '${t}'`),easingLookup[t];return t},progress=(t,n,o)=>{const s=n-t;return s===0?1:(o-t)/s},mixNumber$1=(t,n,o)=>t+(n-t)*o;function hueToRgb(t,n,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?t+(n-t)*6*o:o<1/2?n:o<2/3?t+(n-t)*(2/3-o)*6:t}function hslaToRgba({hue:t,saturation:n,lightness:o,alpha:s}){t/=360,n/=100,o/=100;let c=0,d=0,h=0;if(!n)c=d=h=o;else{const p=o<.5?o*(1+n):o+n-o*n,y=2*o-p;c=hueToRgb(y,p,t+1/3),d=hueToRgb(y,p,t),h=hueToRgb(y,p,t-1/3)}return{red:Math.round(c*255),green:Math.round(d*255),blue:Math.round(h*255),alpha:s}}const mixLinearColor=(t,n,o)=>{const s=t*t,c=o*(n*n-s)+s;return c<0?0:Math.sqrt(c)},colorTypes=[hex,rgba,hsla],getColorType=t=>colorTypes.find(n=>n.test(t));function asRGBA(t){const n=getColorType(t);invariant(!!n,`'${t}' is not an animatable color. Use the equivalent color code instead.`);let o=n.parse(t);return n===hsla&&(o=hslaToRgba(o)),o}const mixColor=(t,n)=>{const o=asRGBA(t),s=asRGBA(n),c={...o};return d=>(c.red=mixLinearColor(o.red,s.red,d),c.green=mixLinearColor(o.green,s.green,d),c.blue=mixLinearColor(o.blue,s.blue,d),c.alpha=mixNumber$1(o.alpha,s.alpha,d),rgba.transform(c))};function mixImmediate(t,n){return o=>o>0?n:t}function mixNumber(t,n){return o=>mixNumber$1(t,n,o)}function getMixer(t){return typeof t=="number"?mixNumber:typeof t=="string"?isCSSVariableToken(t)?mixImmediate:color.test(t)?mixColor:mixComplex:Array.isArray(t)?mixArray:typeof t=="object"?color.test(t)?mixColor:mixObject:mixImmediate}function mixArray(t,n){const o=[...t],s=o.length,c=t.map((d,h)=>getMixer(d)(d,n[h]));return d=>{for(let h=0;h<s;h++)o[h]=c[h](d);return o}}function mixObject(t,n){const o={...t,...n},s={};for(const c in o)t[c]!==void 0&&n[c]!==void 0&&(s[c]=getMixer(t[c])(t[c],n[c]));return c=>{for(const d in s)o[d]=s[d](c);return o}}function matchOrder(t,n){var o;const s=[],c={color:0,var:0,number:0};for(let d=0;d<n.values.length;d++){const h=n.types[d],p=t.indexes[h][c[h]],y=(o=t.values[p])!==null&&o!==void 0?o:0;s[d]=y,c[h]++}return s}const mixComplex=(t,n)=>{const o=complex.createTransformer(n),s=analyseComplexValue(t),c=analyseComplexValue(n);return s.indexes.var.length===c.indexes.var.length&&s.indexes.color.length===c.indexes.color.length&&s.indexes.number.length>=c.indexes.number.length?pipe(mixArray(matchOrder(s,c),c.values),o):(warning(!0,`Complex values '${t}' and '${n}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),mixImmediate(t,n))};function mix(t,n,o){return typeof t=="number"&&typeof n=="number"&&typeof o=="number"?mixNumber$1(t,n,o):getMixer(t)(t,n)}function createMixers(t,n,o){const s=[],c=o||mix,d=t.length-1;for(let h=0;h<d;h++){let p=c(t[h],t[h+1]);if(n){const y=Array.isArray(n)?n[h]||noop$1:n;p=pipe(y,p)}s.push(p)}return s}function interpolate(t,n,{clamp:o=!0,ease:s,mixer:c}={}){const d=t.length;if(invariant(d===n.length,"Both input and output ranges must be the same length"),d===1)return()=>n[0];if(d===2&&t[0]===t[1])return()=>n[1];t[0]>t[d-1]&&(t=[...t].reverse(),n=[...n].reverse());const h=createMixers(n,s,c),p=h.length,y=S=>{let P=0;if(p>1)for(;P<t.length-2&&!(S<t[P+1]);P++);const L=progress(t[P],t[P+1],S);return h[P](L)};return o?S=>y(clamp(t[0],t[d-1],S)):y}function fillOffset(t,n){const o=t[t.length-1];for(let s=1;s<=n;s++){const c=progress(0,n,s);t.push(mixNumber$1(o,1,c))}}function defaultOffset(t){const n=[0];return fillOffset(n,t.length-1),n}function convertOffsetToTimes(t,n){return t.map(o=>o*n)}function defaultEasing(t,n){return t.map(()=>n||easeInOut).splice(0,t.length-1)}function keyframes({duration:t=300,keyframes:n,times:o,ease:s="easeInOut"}){const c=isEasingArray(s)?s.map(easingDefinitionToFunction):easingDefinitionToFunction(s),d={done:!1,value:n[0]},h=convertOffsetToTimes(o&&o.length===n.length?o:defaultOffset(n),t),p=interpolate(h,n,{ease:Array.isArray(c)?c:defaultEasing(n,c)});return{calculatedDuration:t,next:y=>(d.value=p(y),d.done=y>=t,d)}}const maxGeneratorDuration=2e4;function calcGeneratorDuration(t){let n=0;const o=50;let s=t.next(n);for(;!s.done&&n<maxGeneratorDuration;)n+=o,s=t.next(n);return n>=maxGeneratorDuration?1/0:n}const frameloopDriver=t=>{const n=({timestamp:o})=>t(o);return{start:()=>frame.update(n,!0),stop:()=>cancelFrame(n),now:()=>frameData.isProcessing?frameData.timestamp:time.now()}},generators={decay:inertia,inertia,tween:keyframes,keyframes,spring},percentToProgress=t=>t/100;class MainThreadAnimation extends BaseAnimation{constructor({KeyframeResolver:n=KeyframeResolver,...o}){super(o),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle";const{name:s,motionValue:c,keyframes:d}=this.options,h=(p,y)=>this.onKeyframesResolved(p,y);s&&c&&c.owner?this.resolver=c.owner.resolveKeyframes(d,h,s,c):this.resolver=new n(d,h,s,c),this.resolver.scheduleResolve()}initPlayback(n){const{type:o="keyframes",repeat:s=0,repeatDelay:c=0,repeatType:d,velocity:h=0}=this.options,p=generators[o]||keyframes;let y,S;p!==keyframes&&typeof n[0]!="number"&&(process.env.NODE_ENV!=="production"&&invariant(n.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${n}`),y=pipe(percentToProgress,mix(n[0],n[1])),n=[0,100]);const P=p({...this.options,keyframes:n});d==="mirror"&&(S=p({...this.options,keyframes:[...n].reverse(),velocity:-h})),P.calculatedDuration===null&&(P.calculatedDuration=calcGeneratorDuration(P));const{calculatedDuration:L}=P,F=L+c,N=F*(s+1)-c;return{generator:P,mirroredGenerator:S,mapPercentToKeyframes:y,calculatedDuration:L,resolvedDuration:F,totalDuration:N}}onPostResolved(){const{autoplay:n=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!n?this.pause():this.state=this.pendingPlayState}tick(n,o=!1){const{resolved:s}=this;if(!s){const{keyframes:Sa}=this.options;return{done:!0,value:Sa[Sa.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:h,mapPercentToKeyframes:p,keyframes:y,calculatedDuration:S,totalDuration:P,resolvedDuration:L}=s;if(this.startTime===null)return d.next(0);const{delay:F,repeat:N,repeatType:z,repeatDelay:W,onUpdate:nt}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-P/this.speed,this.startTime)),o?this.currentTime=n:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(n-this.startTime)*this.speed;const Pe=this.currentTime-F*(this.speed>=0?1:-1),se=this.speed>=0?Pe<0:Pe>P;this.currentTime=Math.max(Pe,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=P);let mt=this.currentTime,kt=d;if(N){const Sa=Math.min(this.currentTime,P)/L;let fa=Math.floor(Sa),La=Sa%1;!La&&Sa>=1&&(La=1),La===1&&fa--,fa=Math.min(fa,N+1),!!(fa%2)&&(z==="reverse"?(La=1-La,W&&(La-=W/L)):z==="mirror"&&(kt=h)),mt=clamp(0,1,La)*L}const mn=se?{done:!1,value:y[0]}:kt.next(mt);p&&(mn.value=p(mn.value));let{done:_i}=mn;!se&&S!==null&&(_i=this.speed>=0?this.currentTime>=P:this.currentTime<=0);const zi=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&_i);return zi&&c!==void 0&&(mn.value=getFinalKeyframe(y,this.options,c)),nt&&nt(mn.value),zi&&this.finish(),mn}get duration(){const{resolved:n}=this;return n?millisecondsToSeconds(n.calculatedDuration):0}get time(){return millisecondsToSeconds(this.currentTime)}set time(n){n=secondsToMilliseconds(n),this.currentTime=n,this.holdTime!==null||this.speed===0?this.holdTime=n:this.driver&&(this.startTime=this.driver.now()-n/this.speed)}get speed(){return this.playbackSpeed}set speed(n){const o=this.playbackSpeed!==n;this.playbackSpeed=n,o&&(this.time=millisecondsToSeconds(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:n=frameloopDriver,onPlay:o}=this.options;this.driver||(this.driver=n(c=>this.tick(c))),o&&o();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:(!this.startTime||this.state==="finished")&&(this.startTime=s),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var n;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(n=this.currentTime)!==null&&n!==void 0?n:0}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:n}=this.options;n&&n()}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:n}=this.options;n&&n()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(n){return this.startTime=0,this.tick(n,!0)}}const isBezierDefinition=t=>Array.isArray(t)&&typeof t[0]=="number";function isWaapiSupportedEasing(t){return!!(!t||typeof t=="string"&&supportedWaapiEasing[t]||isBezierDefinition(t)||Array.isArray(t)&&t.every(isWaapiSupportedEasing))}const cubicBezierAsString=([t,n,o,s])=>`cubic-bezier(${t}, ${n}, ${o}, ${s})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasing(t){if(t)return isBezierDefinition(t)?cubicBezierAsString(t):Array.isArray(t)?t.map(mapEasingToNativeEasing):supportedWaapiEasing[t]}function animateStyle(t,n,o,{delay:s=0,duration:c=300,repeat:d=0,repeatType:h="loop",ease:p,times:y}={}){const S={[n]:o};y&&(S.offset=y);const P=mapEasingToNativeEasing(p);return Array.isArray(P)&&(S.easing=P),t.animate(S,{delay:s,duration:c,easing:Array.isArray(P)?"linear":P,fill:"both",iterations:d+1,direction:h==="reverse"?"alternate":"normal"})}const supportsWaapi=memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),acceleratedValues=new Set(["opacity","clipPath","filter","transform"]),sampleDelta=10,maxDuration=2e4;function requiresPregeneratedKeyframes(t){return t.type==="spring"||t.name==="backgroundColor"||!isWaapiSupportedEasing(t.ease)}function pregenerateKeyframes(t,n){const o=new MainThreadAnimation({...n,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const c=[];let d=0;for(;!s.done&&d<maxDuration;)s=o.sample(d),c.push(s.value),d+=sampleDelta;return{times:void 0,keyframes:c,duration:d-sampleDelta,ease:"linear"}}class AcceleratedAnimation extends BaseAnimation{constructor(n){super(n);const{name:o,motionValue:s,keyframes:c}=this.options;this.resolver=new DOMKeyframesResolver(c,(d,h)=>this.onKeyframesResolved(d,h),o,s),this.resolver.scheduleResolve()}initPlayback(n,o){var s;let{duration:c=300,times:d,ease:h,type:p,motionValue:y,name:S}=this.options;if(!(!((s=y.owner)===null||s===void 0)&&s.current))return!1;if(requiresPregeneratedKeyframes(this.options)){const{onComplete:L,onUpdate:F,motionValue:N,...z}=this.options,W=pregenerateKeyframes(n,z);n=W.keyframes,n.length===1&&(n[1]=n[0]),c=W.duration,d=W.times,h=W.ease,p="keyframes"}const P=animateStyle(y.owner.current,S,n,{...this.options,duration:c,times:d,ease:h});return P.startTime=time.now(),this.pendingTimeline?(P.timeline=this.pendingTimeline,this.pendingTimeline=void 0):P.onfinish=()=>{const{onComplete:L}=this.options;y.set(getFinalKeyframe(n,this.options,o)),L&&L(),this.cancel(),this.resolveFinishedPromise()},{animation:P,duration:c,times:d,type:p,ease:h,keyframes:n}}get duration(){const{resolved:n}=this;if(!n)return 0;const{duration:o}=n;return millisecondsToSeconds(o)}get time(){const{resolved:n}=this;if(!n)return 0;const{animation:o}=n;return millisecondsToSeconds(o.currentTime||0)}set time(n){const{resolved:o}=this;if(!o)return;const{animation:s}=o;s.currentTime=secondsToMilliseconds(n)}get speed(){const{resolved:n}=this;if(!n)return 1;const{animation:o}=n;return o.playbackRate}set speed(n){const{resolved:o}=this;if(!o)return;const{animation:s}=o;s.playbackRate=n}get state(){const{resolved:n}=this;if(!n)return"idle";const{animation:o}=n;return o.playState}attachTimeline(n){if(!this._resolved)this.pendingTimeline=n;else{const{resolved:o}=this;if(!o)return noop$1;const{animation:s}=o;s.timeline=n,s.onfinish=null}return noop$1}play(){if(this.isStopped)return;const{resolved:n}=this;if(!n)return;const{animation:o}=n;o.playState==="finished"&&this.updateFinishedPromise(),o.play()}pause(){const{resolved:n}=this;if(!n)return;const{animation:o}=n;o.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;const{resolved:n}=this;if(!n)return;const{animation:o,keyframes:s,duration:c,type:d,ease:h,times:p}=n;if(!(o.playState==="idle"||o.playState==="finished")){if(this.time){const{motionValue:y,onUpdate:S,onComplete:P,...L}=this.options,F=new MainThreadAnimation({...L,keyframes:s,duration:c,type:d,ease:h,times:p,isGenerator:!0}),N=secondsToMilliseconds(this.time);y.setWithVelocity(F.sample(N-sampleDelta).value,F.sample(N).value,sampleDelta)}this.cancel()}}complete(){const{resolved:n}=this;n&&n.animation.finish()}cancel(){const{resolved:n}=this;n&&n.animation.cancel()}static supports(n){const{motionValue:o,name:s,repeatDelay:c,repeatType:d,damping:h,type:p}=n;return supportsWaapi()&&s&&acceleratedValues.has(s)&&o&&o.owner&&o.owner.current instanceof HTMLElement&&!o.owner.getProps().onUpdate&&!c&&d!=="mirror"&&h!==0&&p!=="inertia"}}const animateMotionValue=(t,n,o,s={},c,d)=>h=>{const p=getValueTransition(s,t)||{},y=p.delay||s.delay||0;let{elapsed:S=0}=s;S=S-secondsToMilliseconds(y);let P={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:n.getVelocity(),...p,delay:-S,onUpdate:F=>{n.set(F),p.onUpdate&&p.onUpdate(F)},onComplete:()=>{h(),p.onComplete&&p.onComplete()},name:t,motionValue:n,element:d?void 0:c};isTransitionDefined(p)||(P={...P,...getDefaultTransition(t,P)}),P.duration&&(P.duration=secondsToMilliseconds(P.duration)),P.repeatDelay&&(P.repeatDelay=secondsToMilliseconds(P.repeatDelay)),P.from!==void 0&&(P.keyframes[0]=P.from);let L=!1;if((P.type===!1||P.duration===0&&!P.repeatDelay)&&(P.duration=0,P.delay===0&&(L=!0)),L&&!d&&n.get()!==void 0){const F=getFinalKeyframe(P.keyframes,p);if(F!==void 0){frame.update(()=>{P.onUpdate(F),P.onComplete()});return}}return!d&&AcceleratedAnimation.supports(P)?new AcceleratedAnimation(P):new MainThreadAnimation(P)};function isWillChangeMotionValue(t){return!!(isMotionValue(t)&&t.add)}function addUniqueItem(t,n){t.indexOf(n)===-1&&t.push(n)}function removeItem(t,n){const o=t.indexOf(n);o>-1&&t.splice(o,1)}class SubscriptionManager{constructor(){this.subscriptions=[]}add(n){return addUniqueItem(this.subscriptions,n),()=>removeItem(this.subscriptions,n)}notify(n,o,s){const c=this.subscriptions.length;if(c)if(c===1)this.subscriptions[0](n,o,s);else for(let d=0;d<c;d++){const h=this.subscriptions[d];h&&h(n,o,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const warned=new Set;function warnOnce(t,n,o){t||warned.has(n)||(console.warn(n),warned.add(n))}const MAX_VELOCITY_DELTA=30,isFloat=t=>!isNaN(parseFloat(t));class MotionValue{constructor(n,o={}){this.version="11.0.27",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(s,c=!0)=>{const d=time.now();this.updatedAt!==d&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),c&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(n),this.canTrackVelocity=isFloat(this.current),this.owner=o.owner}setCurrent(n){this.current=n,this.updatedAt=time.now()}setPrevFrameValue(n=this.current){this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt}onChange(n){return process.env.NODE_ENV!=="production"&&warnOnce(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",n)}on(n,o){this.events[n]||(this.events[n]=new SubscriptionManager);const s=this.events[n].add(o);return n==="change"?()=>{s(),frame.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const n in this.events)this.events[n].clear()}attach(n,o){this.passiveEffect=n,this.stopPassiveEffect=o}set(n,o=!0){!o||!this.passiveEffect?this.updateAndNotify(n,o):this.passiveEffect(n,this.updateAndNotify)}setWithVelocity(n,o,s){this.set(o),this.prev=void 0,this.prevFrameValue=n,this.prevUpdatedAt=this.updatedAt-s}jump(n,o=!0){this.updateAndNotify(n),this.prev=n,this.prevUpdatedAt=this.prevFrameValue=void 0,o&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const n=time.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||n-this.updatedAt>MAX_VELOCITY_DELTA)return 0;const o=Math.min(this.updatedAt-this.prevUpdatedAt,MAX_VELOCITY_DELTA);return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),o)}start(n){return this.stop(),new Promise(o=>{this.hasAnimated=!0,this.animation=n(o),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function motionValue(t,n){return new MotionValue(t,n)}function setMotionValue(t,n,o){t.hasValue(n)?t.getValue(n).set(o):t.addValue(n,motionValue(o))}function setTarget(t,n){const o=resolveVariant(t,n);let{transitionEnd:s={},transition:c={},...d}=o||{};d={...d,...s};for(const h in d){const p=resolveFinalValueInKeyframes(d[h]);setMotionValue(t,h,p)}}function shouldBlockAnimation({protectedKeys:t,needsAnimating:n},o){const s=t.hasOwnProperty(o)&&n[o]!==!0;return n[o]=!1,s}function animateTarget(t,n,{delay:o=0,transitionOverride:s,type:c}={}){var d;let{transition:h=t.getDefaultTransition(),transitionEnd:p,...y}=n;const S=t.getValue("willChange");s&&(h=s);const P=[],L=c&&t.animationState&&t.animationState.getState()[c];for(const F in y){const N=t.getValue(F,(d=t.latestValues[F])!==null&&d!==void 0?d:null),z=y[F];if(z===void 0||L&&shouldBlockAnimation(L,F))continue;const W={delay:o,elapsed:0,...getValueTransition(h||{},F)};let nt=!1;if(window.HandoffAppearAnimations){const se=t.getProps()[optimizedAppearDataAttribute];if(se){const mt=window.HandoffAppearAnimations(se,F);mt!==null&&(W.elapsed=mt,nt=!0)}}N.start(animateMotionValue(F,N,z,t.shouldReduceMotion&&transformProps.has(F)?{type:!1}:W,t,nt));const Pe=N.animation;Pe&&(isWillChangeMotionValue(S)&&(S.add(F),Pe.then(()=>S.remove(F))),P.push(Pe))}return p&&Promise.all(P).then(()=>{frame.update(()=>{p&&setTarget(t,p)})}),P}function animateVariant(t,n,o={}){var s;const c=resolveVariant(t,n,o.type==="exit"?(s=t.presenceContext)===null||s===void 0?void 0:s.custom:void 0);let{transition:d=t.getDefaultTransition()||{}}=c||{};o.transitionOverride&&(d=o.transitionOverride);const h=c?()=>Promise.all(animateTarget(t,c,o)):()=>Promise.resolve(),p=t.variantChildren&&t.variantChildren.size?(S=0)=>{const{delayChildren:P=0,staggerChildren:L,staggerDirection:F}=d;return animateChildren(t,n,P+S,L,F,o)}:()=>Promise.resolve(),{when:y}=d;if(y){const[S,P]=y==="beforeChildren"?[h,p]:[p,h];return S().then(()=>P())}else return Promise.all([h(),p(o.delay)])}function animateChildren(t,n,o=0,s=0,c=1,d){const h=[],p=(t.variantChildren.size-1)*s,y=c===1?(S=0)=>S*s:(S=0)=>p-S*s;return Array.from(t.variantChildren).sort(sortByTreeOrder).forEach((S,P)=>{S.notify("AnimationStart",n),h.push(animateVariant(S,n,{...d,delay:o+y(P)}).then(()=>S.notify("AnimationComplete",n)))}),Promise.all(h)}function sortByTreeOrder(t,n){return t.sortNodePosition(n)}function animateVisualElement(t,n,o={}){t.notify("AnimationStart",n);let s;if(Array.isArray(n)){const c=n.map(d=>animateVariant(t,d,o));s=Promise.all(c)}else if(typeof n=="string")s=animateVariant(t,n,o);else{const c=typeof n=="function"?resolveVariant(t,n,o.custom):n;s=Promise.all(animateTarget(t,c,o))}return s.then(()=>{frame.postRender(()=>{t.notify("AnimationComplete",n)})})}const reversePriorityOrder=[...variantPriorityOrder].reverse(),numAnimationTypes=variantPriorityOrder.length;function animateList(t){return n=>Promise.all(n.map(({animation:o,options:s})=>animateVisualElement(t,o,s)))}function createAnimationState(t){let n=animateList(t);const o=createState();let s=!0;const c=y=>(S,P)=>{var L;const F=resolveVariant(t,P,y==="exit"?(L=t.presenceContext)===null||L===void 0?void 0:L.custom:void 0);if(F){const{transition:N,transitionEnd:z,...W}=F;S={...S,...W,...z}}return S};function d(y){n=y(t)}function h(y){const S=t.getProps(),P=t.getVariantContext(!0)||{},L=[],F=new Set;let N={},z=1/0;for(let nt=0;nt<numAnimationTypes;nt++){const Pe=reversePriorityOrder[nt],se=o[Pe],mt=S[Pe]!==void 0?S[Pe]:P[Pe],kt=isVariantLabel(mt),mn=Pe===y?se.isActive:null;mn===!1&&(z=nt);let _i=mt===P[Pe]&&mt!==S[Pe]&&kt;if(_i&&s&&t.manuallyAnimateOnMount&&(_i=!1),se.protectedKeys={...N},!se.isActive&&mn===null||!mt&&!se.prevProp||isAnimationControls(mt)||typeof mt=="boolean")continue;let Sa=checkVariantsDidChange(se.prevProp,mt)||Pe===y&&se.isActive&&!_i&&kt||nt>z&&kt,fa=!1;const La=Array.isArray(mt)?mt:[mt];let Ra=La.reduce(c(Pe),{});mn===!1&&(Ra={});const{prevResolvedValues:ma={}}=se,yt={...ma,...Ra},lt=pi=>{Sa=!0,F.has(pi)&&(fa=!0,F.delete(pi)),se.needsAnimating[pi]=!0;const ba=t.getValue(pi);ba&&(ba.liveStyle=!1)};for(const pi in yt){const ba=Ra[pi],Sc=ma[pi];if(N.hasOwnProperty(pi))continue;let ms=!1;isKeyframesTarget(ba)&&isKeyframesTarget(Sc)?ms=!shallowCompare(ba,Sc):ms=ba!==Sc,ms?ba!=null?lt(pi):F.add(pi):ba!==void 0&&F.has(pi)?lt(pi):se.protectedKeys[pi]=!0}se.prevProp=mt,se.prevResolvedValues=Ra,se.isActive&&(N={...N,...Ra}),s&&t.blockInitialAnimation&&(Sa=!1),Sa&&(!_i||fa)&&L.push(...La.map(pi=>({animation:pi,options:{type:Pe}})))}if(F.size){const nt={};F.forEach(Pe=>{const se=t.getBaseTarget(Pe),mt=t.getValue(Pe);mt&&(mt.liveStyle=!0),nt[Pe]=se===void 0?null:se}),L.push({animation:nt})}let W=!!L.length;return s&&(S.initial===!1||S.initial===S.animate)&&!t.manuallyAnimateOnMount&&(W=!1),s=!1,W?n(L):Promise.resolve()}function p(y,S){var P;if(o[y].isActive===S)return Promise.resolve();(P=t.variantChildren)===null||P===void 0||P.forEach(F=>{var N;return(N=F.animationState)===null||N===void 0?void 0:N.setActive(y,S)}),o[y].isActive=S;const L=h(y);for(const F in o)o[F].protectedKeys={};return L}return{animateChanges:h,setActive:p,setAnimateFunction:d,getState:()=>o}}function checkVariantsDidChange(t,n){return typeof n=="string"?n!==t:Array.isArray(n)?!shallowCompare(n,t):!1}function createTypeState(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function createState(){return{animate:createTypeState(!0),whileInView:createTypeState(),whileHover:createTypeState(),whileTap:createTypeState(),whileDrag:createTypeState(),whileFocus:createTypeState(),exit:createTypeState()}}class AnimationFeature extends Feature{constructor(n){super(n),n.animationState||(n.animationState=createAnimationState(n))}updateAnimationControlsSubscription(){const{animate:n}=this.node.getProps();this.unmount(),isAnimationControls(n)&&(this.unmount=n.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:n}=this.node.getProps(),{animate:o}=this.node.prevProps||{};n!==o&&this.updateAnimationControlsSubscription()}unmount(){}}let id$1=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments),this.id=id$1++}update(){if(!this.node.presenceContext)return;const{isPresent:n,onExitComplete:o}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||n===s)return;const c=this.node.animationState.setActive("exit",!n);o&&!n&&c.then(()=>o(this.id))}mount(){const{register:n}=this.node.presenceContext||{};n&&(this.unmount=n(this.id))}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}},distance=(t,n)=>Math.abs(t-n);function distance2D(t,n){const o=distance(t.x,n.x),s=distance(t.y,n.y);return Math.sqrt(o**2+s**2)}class PanSession{constructor(n,o,{transformPagePoint:s,contextWindow:c,dragSnapToOrigin:d=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const L=getPanInfo(this.lastMoveEventInfo,this.history),F=this.startEvent!==null,N=distance2D(L.offset,{x:0,y:0})>=3;if(!F&&!N)return;const{point:z}=L,{timestamp:W}=frameData;this.history.push({...z,timestamp:W});const{onStart:nt,onMove:Pe}=this.handlers;F||(nt&&nt(this.lastMoveEvent,L),this.startEvent=this.lastMoveEvent),Pe&&Pe(this.lastMoveEvent,L)},this.handlePointerMove=(L,F)=>{this.lastMoveEvent=L,this.lastMoveEventInfo=transformPoint(F,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(L,F)=>{this.end();const{onEnd:N,onSessionEnd:z,resumeAnimation:W}=this.handlers;if(this.dragSnapToOrigin&&W&&W(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const nt=getPanInfo(L.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(F,this.transformPagePoint),this.history);this.startEvent&&N&&N(L,nt),z&&z(L,nt)},!isPrimaryPointer(n))return;this.dragSnapToOrigin=d,this.handlers=o,this.transformPagePoint=s,this.contextWindow=c||window;const h=extractEventInfo(n),p=transformPoint(h,this.transformPagePoint),{point:y}=p,{timestamp:S}=frameData;this.history=[{...y,timestamp:S}];const{onSessionStart:P}=o;P&&P(n,getPanInfo(p,this.history)),this.removeListeners=pipe(addPointerEvent(this.contextWindow,"pointermove",this.handlePointerMove),addPointerEvent(this.contextWindow,"pointerup",this.handlePointerUp),addPointerEvent(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(n){this.handlers=n}end(){this.removeListeners&&this.removeListeners(),cancelFrame(this.updatePoint)}}function transformPoint(t,n){return n?{point:n(t.point)}:t}function subtractPoint(t,n){return{x:t.x-n.x,y:t.y-n.y}}function getPanInfo({point:t},n){return{point:t,delta:subtractPoint(t,lastDevicePoint(n)),offset:subtractPoint(t,startDevicePoint(n)),velocity:getVelocity(n,.1)}}function startDevicePoint(t){return t[0]}function lastDevicePoint(t){return t[t.length-1]}function getVelocity(t,n){if(t.length<2)return{x:0,y:0};let o=t.length-1,s=null;const c=lastDevicePoint(t);for(;o>=0&&(s=t[o],!(c.timestamp-s.timestamp>secondsToMilliseconds(n)));)o--;if(!s)return{x:0,y:0};const d=millisecondsToSeconds(c.timestamp-s.timestamp);if(d===0)return{x:0,y:0};const h={x:(c.x-s.x)/d,y:(c.y-s.y)/d};return h.x===1/0&&(h.x=0),h.y===1/0&&(h.y=0),h}function calcLength(t){return t.max-t.min}function isNear(t,n=0,o=.01){return Math.abs(t-n)<=o}function calcAxisDelta(t,n,o,s=.5){t.origin=s,t.originPoint=mixNumber$1(n.min,n.max,t.origin),t.scale=calcLength(o)/calcLength(n),(isNear(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=mixNumber$1(o.min,o.max,t.origin)-t.originPoint,(isNear(t.translate)||isNaN(t.translate))&&(t.translate=0)}function calcBoxDelta(t,n,o,s){calcAxisDelta(t.x,n.x,o.x,s?s.originX:void 0),calcAxisDelta(t.y,n.y,o.y,s?s.originY:void 0)}function calcRelativeAxis(t,n,o){t.min=o.min+n.min,t.max=t.min+calcLength(n)}function calcRelativeBox(t,n,o){calcRelativeAxis(t.x,n.x,o.x),calcRelativeAxis(t.y,n.y,o.y)}function calcRelativeAxisPosition(t,n,o){t.min=n.min-o.min,t.max=t.min+calcLength(n)}function calcRelativePosition(t,n,o){calcRelativeAxisPosition(t.x,n.x,o.x),calcRelativeAxisPosition(t.y,n.y,o.y)}function applyConstraints(t,{min:n,max:o},s){return n!==void 0&&t<n?t=s?mixNumber$1(n,t,s.min):Math.max(t,n):o!==void 0&&t>o&&(t=s?mixNumber$1(o,t,s.max):Math.min(t,o)),t}function calcRelativeAxisConstraints(t,n,o){return{min:n!==void 0?t.min+n:void 0,max:o!==void 0?t.max+o-(t.max-t.min):void 0}}function calcRelativeConstraints(t,{top:n,left:o,bottom:s,right:c}){return{x:calcRelativeAxisConstraints(t.x,o,c),y:calcRelativeAxisConstraints(t.y,n,s)}}function calcViewportAxisConstraints(t,n){let o=n.min-t.min,s=n.max-t.max;return n.max-n.min<t.max-t.min&&([o,s]=[s,o]),{min:o,max:s}}function calcViewportConstraints(t,n){return{x:calcViewportAxisConstraints(t.x,n.x),y:calcViewportAxisConstraints(t.y,n.y)}}function calcOrigin(t,n){let o=.5;const s=calcLength(t),c=calcLength(n);return c>s?o=progress(n.min,n.max-s,t.min):s>c&&(o=progress(t.min,t.max-c,n.min)),clamp(0,1,o)}function rebaseAxisConstraints(t,n){const o={};return n.min!==void 0&&(o.min=n.min-t.min),n.max!==void 0&&(o.max=n.max-t.min),o}const defaultElastic=.35;function resolveDragElastic(t=defaultElastic){return t===!1?t=0:t===!0&&(t=defaultElastic),{x:resolveAxisElastic(t,"left","right"),y:resolveAxisElastic(t,"top","bottom")}}function resolveAxisElastic(t,n,o){return{min:resolvePointElastic(t,n),max:resolvePointElastic(t,o)}}function resolvePointElastic(t,n){return typeof t=="number"?t:t[n]||0}const createAxisDelta=()=>({translate:0,scale:1,origin:0,originPoint:0}),createDelta=()=>({x:createAxisDelta(),y:createAxisDelta()}),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()});function eachAxis(t){return[t("x"),t("y")]}function convertBoundingBoxToBox({top:t,left:n,right:o,bottom:s}){return{x:{min:n,max:o},y:{min:t,max:s}}}function convertBoxToBoundingBox({x:t,y:n}){return{top:n.min,right:t.max,bottom:n.max,left:t.min}}function transformBoxPoints(t,n){if(!n)return t;const o=n({x:t.left,y:t.top}),s=n({x:t.right,y:t.bottom});return{top:o.y,left:o.x,bottom:s.y,right:s.x}}function isIdentityScale(t){return t===void 0||t===1}function hasScale({scale:t,scaleX:n,scaleY:o}){return!isIdentityScale(t)||!isIdentityScale(n)||!isIdentityScale(o)}function hasTransform(t){return hasScale(t)||has2DTranslate(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function has2DTranslate(t){return is2DTranslate(t.x)||is2DTranslate(t.y)}function is2DTranslate(t){return t&&t!=="0%"}function scalePoint(t,n,o){const s=t-o,c=n*s;return o+c}function applyPointDelta(t,n,o,s,c){return c!==void 0&&(t=scalePoint(t,c,s)),scalePoint(t,o,s)+n}function applyAxisDelta(t,n=0,o=1,s,c){t.min=applyPointDelta(t.min,n,o,s,c),t.max=applyPointDelta(t.max,n,o,s,c)}function applyBoxDelta(t,{x:n,y:o}){applyAxisDelta(t.x,n.translate,n.scale,n.originPoint),applyAxisDelta(t.y,o.translate,o.scale,o.originPoint)}function applyTreeDeltas(t,n,o,s=!1){const c=o.length;if(!c)return;n.x=n.y=1;let d,h;for(let p=0;p<c;p++){d=o[p],h=d.projectionDelta;const y=d.instance;y&&y.style&&y.style.display==="contents"||(s&&d.options.layoutScroll&&d.scroll&&d!==d.root&&transformBox(t,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),h&&(n.x*=h.x.scale,n.y*=h.y.scale,applyBoxDelta(t,h)),s&&hasTransform(d.latestValues)&&transformBox(t,d.latestValues))}n.x=snapToDefault(n.x),n.y=snapToDefault(n.y)}function snapToDefault(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function translateAxis(t,n){t.min=t.min+n,t.max=t.max+n}function transformAxis(t,n,[o,s,c]){const d=n[c]!==void 0?n[c]:.5,h=mixNumber$1(t.min,t.max,d);applyAxisDelta(t,n[o],n[s],h,n.scale)}const xKeys$1=["x","scaleX","originX"],yKeys$1=["y","scaleY","originY"];function transformBox(t,n){transformAxis(t.x,n,xKeys$1),transformAxis(t.y,n,yKeys$1)}function measureViewportBox(t,n){return convertBoundingBoxToBox(transformBoxPoints(t.getBoundingClientRect(),n))}function measurePageBox(t,n,o){const s=measureViewportBox(t,o),{scroll:c}=n;return c&&(translateAxis(s.x,c.offset.x),translateAxis(s.y,c.offset.y)),s}const getContextWindow=({current:t})=>t?t.ownerDocument.defaultView:null,elementDragControls=new WeakMap;class VisualElementDragControls{constructor(n){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=createBox(),this.visualElement=n}start(n,{snapToCursor:o=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const c=P=>{const{dragSnapToOrigin:L}=this.getProps();L?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(extractEventInfo(P,"page").point)},d=(P,L)=>{const{drag:F,dragPropagation:N,onDragStart:z}=this.getProps();if(F&&!N&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(F),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),eachAxis(nt=>{let Pe=this.getAxisMotionValue(nt).get()||0;if(percent.test(Pe)){const{projection:se}=this.visualElement;if(se&&se.layout){const mt=se.layout.layoutBox[nt];mt&&(Pe=calcLength(mt)*(parseFloat(Pe)/100))}}this.originPoint[nt]=Pe}),z&&z(P,L);const{animationState:W}=this.visualElement;W&&W.setActive("whileDrag",!0)},h=(P,L)=>{const{dragPropagation:F,dragDirectionLock:N,onDirectionLock:z,onDrag:W}=this.getProps();if(!F&&!this.openGlobalLock)return;const{offset:nt}=L;if(N&&this.currentDirection===null){this.currentDirection=getCurrentDirection(nt),this.currentDirection!==null&&z&&z(this.currentDirection);return}this.updateAxis("x",L.point,nt),this.updateAxis("y",L.point,nt),this.visualElement.render(),W&&W(P,L)},p=(P,L)=>this.stop(P,L),y=()=>eachAxis(P=>{var L;return this.getAnimationState(P)==="paused"&&((L=this.getAxisMotionValue(P).animation)===null||L===void 0?void 0:L.play())}),{dragSnapToOrigin:S}=this.getProps();this.panSession=new PanSession(n,{onSessionStart:c,onStart:d,onMove:h,onSessionEnd:p,resumeAnimation:y},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:S,contextWindow:getContextWindow(this.visualElement)})}stop(n,o){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&d(n,o)}cancel(){this.isDragging=!1;const{projection:n,animationState:o}=this.visualElement;n&&(n.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),o&&o.setActive("whileDrag",!1)}updateAxis(n,o,s){const{drag:c}=this.getProps();if(!s||!shouldDrag(n,c,this.currentDirection))return;const d=this.getAxisMotionValue(n);let h=this.originPoint[n]+s[n];this.constraints&&this.constraints[n]&&(h=applyConstraints(h,this.constraints[n],this.elastic[n])),d.set(h)}resolveConstraints(){var n;const{dragConstraints:o,dragElastic:s}=this.getProps(),c=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(n=this.visualElement.projection)===null||n===void 0?void 0:n.layout,d=this.constraints;o&&isRefObject(o)?this.constraints||(this.constraints=this.resolveRefConstraints()):o&&c?this.constraints=calcRelativeConstraints(c.layoutBox,o):this.constraints=!1,this.elastic=resolveDragElastic(s),d!==this.constraints&&c&&this.constraints&&!this.hasMutatedConstraints&&eachAxis(h=>{this.getAxisMotionValue(h)&&(this.constraints[h]=rebaseAxisConstraints(c.layoutBox[h],this.constraints[h]))})}resolveRefConstraints(){const{dragConstraints:n,onMeasureDragConstraints:o}=this.getProps();if(!n||!isRefObject(n))return!1;const s=n.current;invariant(s!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:c}=this.visualElement;if(!c||!c.layout)return!1;const d=measurePageBox(s,c.root,this.visualElement.getTransformPagePoint());let h=calcViewportConstraints(c.layout.layoutBox,d);if(o){const p=o(convertBoxToBoundingBox(h));this.hasMutatedConstraints=!!p,p&&(h=convertBoundingBoxToBox(p))}return h}startAnimation(n){const{drag:o,dragMomentum:s,dragElastic:c,dragTransition:d,dragSnapToOrigin:h,onDragTransitionEnd:p}=this.getProps(),y=this.constraints||{},S=eachAxis(P=>{if(!shouldDrag(P,o,this.currentDirection))return;let L=y[P]||{};h&&(L={min:0,max:0});const F=c?200:1e6,N=c?40:1e7,z={type:"inertia",velocity:s?n[P]:0,bounceStiffness:F,bounceDamping:N,timeConstant:750,restDelta:1,restSpeed:10,...d,...L};return this.startAxisValueAnimation(P,z)});return Promise.all(S).then(p)}startAxisValueAnimation(n,o){const s=this.getAxisMotionValue(n);return s.start(animateMotionValue(n,s,0,o,this.visualElement))}stopAnimation(){eachAxis(n=>this.getAxisMotionValue(n).stop())}pauseAnimation(){eachAxis(n=>{var o;return(o=this.getAxisMotionValue(n).animation)===null||o===void 0?void 0:o.pause()})}getAnimationState(n){var o;return(o=this.getAxisMotionValue(n).animation)===null||o===void 0?void 0:o.state}getAxisMotionValue(n){const o="_drag"+n.toUpperCase(),s=this.visualElement.getProps(),c=s[o];return c||this.visualElement.getValue(n,(s.initial?s.initial[n]:void 0)||0)}snapToCursor(n){eachAxis(o=>{const{drag:s}=this.getProps();if(!shouldDrag(o,s,this.currentDirection))return;const{projection:c}=this.visualElement,d=this.getAxisMotionValue(o);if(c&&c.layout){const{min:h,max:p}=c.layout.layoutBox[o];d.set(n[o]-mixNumber$1(h,p,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:n,dragConstraints:o}=this.getProps(),{projection:s}=this.visualElement;if(!isRefObject(o)||!s||!this.constraints)return;this.stopAnimation();const c={x:0,y:0};eachAxis(h=>{const p=this.getAxisMotionValue(h);if(p){const y=p.get();c[h]=calcOrigin({min:y,max:y},this.constraints[h])}});const{transformTemplate:d}=this.visualElement.getProps();this.visualElement.current.style.transform=d?d({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),eachAxis(h=>{if(!shouldDrag(h,n,null))return;const p=this.getAxisMotionValue(h),{min:y,max:S}=this.constraints[h];p.set(mixNumber$1(y,S,c[h]))})}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const n=this.visualElement.current,o=addPointerEvent(n,"pointerdown",y=>{const{drag:S,dragListener:P=!0}=this.getProps();S&&P&&this.start(y)}),s=()=>{const{dragConstraints:y}=this.getProps();isRefObject(y)&&(this.constraints=this.resolveRefConstraints())},{projection:c}=this.visualElement,d=c.addEventListener("measure",s);c&&!c.layout&&(c.root&&c.root.updateScroll(),c.updateLayout()),s();const h=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints()),p=c.addEventListener("didUpdate",({delta:y,hasLayoutChanged:S})=>{this.isDragging&&S&&(eachAxis(P=>{const L=this.getAxisMotionValue(P);L&&(this.originPoint[P]+=y[P].translate,L.set(L.get()+y[P].translate))}),this.visualElement.render())});return()=>{h(),o(),d(),p&&p()}}getProps(){const n=this.visualElement.getProps(),{drag:o=!1,dragDirectionLock:s=!1,dragPropagation:c=!1,dragConstraints:d=!1,dragElastic:h=defaultElastic,dragMomentum:p=!0}=n;return{...n,drag:o,dragDirectionLock:s,dragPropagation:c,dragConstraints:d,dragElastic:h,dragMomentum:p}}}function shouldDrag(t,n,o){return(n===!0||n===t)&&(o===null||o===t)}function getCurrentDirection(t,n=10){let o=null;return Math.abs(t.y)>n?o="y":Math.abs(t.x)>n&&(o="x"),o}class DragGesture extends Feature{constructor(n){super(n),this.removeGroupControls=noop$1,this.removeListeners=noop$1,this.controls=new VisualElementDragControls(n)}mount(){const{dragControls:n}=this.node.getProps();n&&(this.removeGroupControls=n.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||noop$1}unmount(){this.removeGroupControls(),this.removeListeners()}}const asyncHandler=t=>(n,o)=>{t&&t(n,o)};class PanGesture extends Feature{constructor(){super(...arguments),this.removePointerDownListener=noop$1}onPointerDown(n){this.session=new PanSession(n,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:getContextWindow(this.node)})}createPanHandlers(){const{onPanSessionStart:n,onPanStart:o,onPan:s,onPanEnd:c}=this.node.getProps();return{onSessionStart:asyncHandler(n),onStart:asyncHandler(o),onMove:s,onEnd:(d,h)=>{delete this.session,c&&c(d,h)}}}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",n=>this.onPointerDown(n))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function usePresence(){const t=React.useContext(PresenceContext);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:o,register:s}=t,c=React.useId();return React.useEffect(()=>s(c),[]),!n&&o?[!1,()=>o&&o(c)]:[!0]}const globalProjectionState={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function pixelsToPercent(t,n){return n.max===n.min?0:t/(n.max-n.min)*100}const correctBorderRadius={correct:(t,n)=>{if(!n.target)return t;if(typeof t=="string")if(px.test(t))t=parseFloat(t);else return t;const o=pixelsToPercent(t,n.target.x),s=pixelsToPercent(t,n.target.y);return`${o}% ${s}%`}},correctBoxShadow={correct:(t,{treeScale:n,projectionDelta:o})=>{const s=t,c=complex.parse(t);if(c.length>5)return s;const d=complex.createTransformer(t),h=typeof c[0]!="number"?1:0,p=o.x.scale*n.x,y=o.y.scale*n.y;c[0+h]/=p,c[1+h]/=y;const S=mixNumber$1(p,y,.5);return typeof c[2+h]=="number"&&(c[2+h]/=S),typeof c[3+h]=="number"&&(c[3+h]/=S),d(c)}};class MeasureLayoutWithContext extends React.Component{componentDidMount(){const{visualElement:n,layoutGroup:o,switchLayoutGroup:s,layoutId:c}=this.props,{projection:d}=n;addScaleCorrector(defaultScaleCorrectors),d&&(o.group&&o.group.add(d),s&&s.register&&c&&s.register(d),d.root.didUpdate(),d.addEventListener("animationComplete",()=>{this.safeToRemove()}),d.setOptions({...d.options,onExitComplete:()=>this.safeToRemove()})),globalProjectionState.hasEverUpdated=!0}getSnapshotBeforeUpdate(n){const{layoutDependency:o,visualElement:s,drag:c,isPresent:d}=this.props,h=s.projection;return h&&(h.isPresent=d,c||n.layoutDependency!==o||o===void 0?h.willUpdate():this.safeToRemove(),n.isPresent!==d&&(d?h.promote():h.relegate()||frame.postRender(()=>{const p=h.getStack();(!p||!p.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:n}=this.props.visualElement;n&&(n.root.didUpdate(),microtask.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:n,layoutGroup:o,switchLayoutGroup:s}=this.props,{projection:c}=n;c&&(c.scheduleCheckAfterUnmount(),o&&o.group&&o.group.remove(c),s&&s.deregister&&s.deregister(c))}safeToRemove(){const{safeToRemove:n}=this.props;n&&n()}render(){return null}}function MeasureLayout(t){const[n,o]=usePresence(),s=React.useContext(LayoutGroupContext);return React.createElement(MeasureLayoutWithContext,{...t,layoutGroup:s,switchLayoutGroup:React.useContext(SwitchLayoutGroupContext),isPresent:n,safeToRemove:o})}const defaultScaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow},borders=["TopLeft","TopRight","BottomLeft","BottomRight"],numBorders=borders.length,asNumber=t=>typeof t=="string"?parseFloat(t):t,isPx=t=>typeof t=="number"||px.test(t);function mixValues(t,n,o,s,c,d){c?(t.opacity=mixNumber$1(0,o.opacity!==void 0?o.opacity:1,easeCrossfadeIn(s)),t.opacityExit=mixNumber$1(n.opacity!==void 0?n.opacity:1,0,easeCrossfadeOut(s))):d&&(t.opacity=mixNumber$1(n.opacity!==void 0?n.opacity:1,o.opacity!==void 0?o.opacity:1,s));for(let h=0;h<numBorders;h++){const p=`border${borders[h]}Radius`;let y=getRadius(n,p),S=getRadius(o,p);if(y===void 0&&S===void 0)continue;y||(y=0),S||(S=0),y===0||S===0||isPx(y)===isPx(S)?(t[p]=Math.max(mixNumber$1(asNumber(y),asNumber(S),s),0),(percent.test(S)||percent.test(y))&&(t[p]+="%")):t[p]=S}(n.rotate||o.rotate)&&(t.rotate=mixNumber$1(n.rotate||0,o.rotate||0,s))}function getRadius(t,n){return t[n]!==void 0?t[n]:t.borderRadius}const easeCrossfadeIn=compress(0,.5,circOut),easeCrossfadeOut=compress(.5,.95,noop$1);function compress(t,n,o){return s=>s<t?0:s>n?1:o(progress(t,n,s))}function copyAxisInto(t,n){t.min=n.min,t.max=n.max}function copyBoxInto(t,n){copyAxisInto(t.x,n.x),copyAxisInto(t.y,n.y)}function removePointDelta(t,n,o,s,c){return t-=n,t=scalePoint(t,1/o,s),c!==void 0&&(t=scalePoint(t,1/c,s)),t}function removeAxisDelta(t,n=0,o=1,s=.5,c,d=t,h=t){if(percent.test(n)&&(n=parseFloat(n),n=mixNumber$1(h.min,h.max,n/100)-h.min),typeof n!="number")return;let p=mixNumber$1(d.min,d.max,s);t===d&&(p-=n),t.min=removePointDelta(t.min,n,o,p,c),t.max=removePointDelta(t.max,n,o,p,c)}function removeAxisTransforms(t,n,[o,s,c],d,h){removeAxisDelta(t,n[o],n[s],n[c],n.scale,d,h)}const xKeys=["x","scaleX","originX"],yKeys=["y","scaleY","originY"];function removeBoxTransforms(t,n,o,s){removeAxisTransforms(t.x,n,xKeys,o?o.x:void 0,s?s.x:void 0),removeAxisTransforms(t.y,n,yKeys,o?o.y:void 0,s?s.y:void 0)}function isAxisDeltaZero(t){return t.translate===0&&t.scale===1}function isDeltaZero(t){return isAxisDeltaZero(t.x)&&isAxisDeltaZero(t.y)}function boxEquals(t,n){return t.x.min===n.x.min&&t.x.max===n.x.max&&t.y.min===n.y.min&&t.y.max===n.y.max}function boxEqualsRounded(t,n){return Math.round(t.x.min)===Math.round(n.x.min)&&Math.round(t.x.max)===Math.round(n.x.max)&&Math.round(t.y.min)===Math.round(n.y.min)&&Math.round(t.y.max)===Math.round(n.y.max)}function aspectRatio(t){return calcLength(t.x)/calcLength(t.y)}class NodeStack{constructor(){this.members=[]}add(n){addUniqueItem(this.members,n),n.scheduleRender()}remove(n){if(removeItem(this.members,n),n===this.prevLead&&(this.prevLead=void 0),n===this.lead){const o=this.members[this.members.length-1];o&&this.promote(o)}}relegate(n){const o=this.members.findIndex(c=>n===c);if(o===0)return!1;let s;for(let c=o;c>=0;c--){const d=this.members[c];if(d.isPresent!==!1){s=d;break}}return s?(this.promote(s),!0):!1}promote(n,o){const s=this.lead;if(n!==s&&(this.prevLead=s,this.lead=n,n.show(),s)){s.instance&&s.scheduleRender(),n.scheduleRender(),n.resumeFrom=s,o&&(n.resumeFrom.preserveOpacity=!0),s.snapshot&&(n.snapshot=s.snapshot,n.snapshot.latestValues=s.animationValues||s.latestValues),n.root&&n.root.isUpdating&&(n.isLayoutDirty=!0);const{crossfade:c}=n.options;c===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(n=>{const{options:o,resumingFrom:s}=n;o.onExitComplete&&o.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(n=>{n.instance&&n.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function buildProjectionTransform(t,n,o){let s="";const c=t.x.translate/n.x,d=t.y.translate/n.y,h=(o==null?void 0:o.z)||0;if((c||d||h)&&(s=`translate3d(${c}px, ${d}px, ${h}px) `),(n.x!==1||n.y!==1)&&(s+=`scale(${1/n.x}, ${1/n.y}) `),o){const{transformPerspective:S,rotate:P,rotateX:L,rotateY:F,skewX:N,skewY:z}=o;S&&(s=`perspective(${S}px) ${s}`),P&&(s+=`rotate(${P}deg) `),L&&(s+=`rotateX(${L}deg) `),F&&(s+=`rotateY(${F}deg) `),N&&(s+=`skewX(${N}deg) `),z&&(s+=`skewY(${z}deg) `)}const p=t.x.scale*n.x,y=t.y.scale*n.y;return(p!==1||y!==1)&&(s+=`scale(${p}, ${y})`),s||"none"}const compareByDepth=(t,n)=>t.depth-n.depth;class FlatTree{constructor(){this.children=[],this.isDirty=!1}add(n){addUniqueItem(this.children,n),this.isDirty=!0}remove(n){removeItem(this.children,n),this.isDirty=!0}forEach(n){this.isDirty&&this.children.sort(compareByDepth),this.isDirty=!1,this.children.forEach(n)}}function delay(t,n){const o=time.now(),s=({timestamp:c})=>{const d=c-o;d>=n&&(cancelFrame(s),t(d-n))};return frame.read(s,!0),()=>cancelFrame(s)}function record(t){window.MotionDebug&&window.MotionDebug.record(t)}function isSVGElement(t){return t instanceof SVGElement&&t.tagName!=="svg"}function animateSingleValue(t,n,o){const s=isMotionValue(t)?t:motionValue(t);return s.start(animateMotionValue("",s,n,o)),s.animation}const transformAxes=["","X","Y","Z"],hiddenVisibility={visibility:"hidden"},animationTarget=1e3;let id=0;const projectionFrameData={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function resetDistortingTransform(t,n,o,s){const{latestValues:c}=n;c[t]&&(o[t]=c[t],n.setStaticValue(t,0),s&&(s[t]=0))}function createProjectionNode({attachResizeListener:t,defaultParent:n,measureScroll:o,checkIsScrollRoot:s,resetTransform:c}){return class{constructor(h={},p=n==null?void 0:n()){this.id=id++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,projectionFrameData.totalNodes=projectionFrameData.resolvedTargetDeltas=projectionFrameData.recalculatedProjection=0,this.nodes.forEach(propagateDirtyNodes),this.nodes.forEach(resolveTargetDelta),this.nodes.forEach(calcProjection),this.nodes.forEach(cleanDirtyNodes),record(projectionFrameData)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=h,this.root=p?p.root||p:this,this.path=p?[...p.path,p]:[],this.parent=p,this.depth=p?p.depth+1:0;for(let y=0;y<this.path.length;y++)this.path[y].shouldResetTransform=!0;this.root===this&&(this.nodes=new FlatTree)}addEventListener(h,p){return this.eventHandlers.has(h)||this.eventHandlers.set(h,new SubscriptionManager),this.eventHandlers.get(h).add(p)}notifyListeners(h,...p){const y=this.eventHandlers.get(h);y&&y.notify(...p)}hasListeners(h){return this.eventHandlers.has(h)}mount(h,p=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=isSVGElement(h),this.instance=h;const{layoutId:y,layout:S,visualElement:P}=this.options;if(P&&!P.current&&P.mount(h),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(S||y)&&(this.isLayoutDirty=!0),t){let L;const F=()=>this.root.updateBlockedByResize=!1;t(h,()=>{this.root.updateBlockedByResize=!0,L&&L(),L=delay(F,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}y&&this.root.registerSharedNode(y,this),this.options.animate!==!1&&P&&(y||S)&&this.addEventListener("didUpdate",({delta:L,hasLayoutChanged:F,hasRelativeTargetChanged:N,layout:z})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const W=this.options.transition||P.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:nt,onLayoutAnimationComplete:Pe}=P.getProps(),se=!this.targetLayout||!boxEqualsRounded(this.targetLayout,z)||N,mt=!F&&N;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||mt||F&&(se||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(L,mt);const kt={...getValueTransition(W,"layout"),onPlay:nt,onComplete:Pe};(P.shouldReduceMotion||this.options.layoutRoot)&&(kt.delay=0,kt.type=!1),this.startAnimation(kt)}else F||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=z})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const h=this.getStack();h&&h.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,cancelFrame(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(resetSkewAndRotation),this.animationId++)}getTransformTemplate(){const{visualElement:h}=this.options;return h&&h.getProps().transformTemplate}willUpdate(h=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let P=0;P<this.path.length;P++){const L=this.path[P];L.shouldResetTransform=!0,L.updateScroll("snapshot"),L.options.layoutRoot&&L.willUpdate(!1)}const{layoutId:p,layout:y}=this.options;if(p===void 0&&!y)return;const S=this.getTransformTemplate();this.prevTransformTemplateValue=S?S(this.latestValues,""):void 0,this.updateSnapshot(),h&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(clearMeasurements);return}this.isUpdating||this.nodes.forEach(clearIsLayoutDirty),this.isUpdating=!1,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes.forEach(resetTransformStyle),this.nodes.forEach(updateLayout),this.nodes.forEach(notifyLayoutUpdate),this.clearAllSnapshots();const p=time.now();frameData.delta=clamp(0,1e3/60,p-frameData.timestamp),frameData.timestamp=p,frameData.isProcessing=!0,steps.update.process(frameData),steps.preRender.process(frameData),steps.render.process(frameData),frameData.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,microtask.read(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(clearSnapshot),this.sharedNodes.forEach(removeLeadSnapshots)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,frame.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){frame.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let y=0;y<this.path.length;y++)this.path[y].updateScroll();const h=this.layout;this.layout=this.measure(!1),this.layoutCorrected=createBox(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:p}=this.options;p&&p.notify("LayoutMeasure",this.layout.layoutBox,h?h.layoutBox:void 0)}updateScroll(h="measure"){let p=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===h&&(p=!1),p&&(this.scroll={animationId:this.root.animationId,phase:h,isRoot:s(this.instance),offset:o(this.instance)})}resetTransform(){if(!c)return;const h=this.isLayoutDirty||this.shouldResetTransform,p=this.projectionDelta&&!isDeltaZero(this.projectionDelta),y=this.getTransformTemplate(),S=y?y(this.latestValues,""):void 0,P=S!==this.prevTransformTemplateValue;h&&(p||hasTransform(this.latestValues)||P)&&(c(this.instance,S),this.shouldResetTransform=!1,this.scheduleRender())}measure(h=!0){const p=this.measurePageBox();let y=this.removeElementScroll(p);return h&&(y=this.removeTransform(y)),roundBox(y),{animationId:this.root.animationId,measuredBox:p,layoutBox:y,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:h}=this.options;if(!h)return createBox();const p=h.measureViewportBox(),{scroll:y}=this.root;return y&&(translateAxis(p.x,y.offset.x),translateAxis(p.y,y.offset.y)),p}removeElementScroll(h){const p=createBox();copyBoxInto(p,h);for(let y=0;y<this.path.length;y++){const S=this.path[y],{scroll:P,options:L}=S;if(S!==this.root&&P&&L.layoutScroll){if(P.isRoot){copyBoxInto(p,h);const{scroll:F}=this.root;F&&(translateAxis(p.x,-F.offset.x),translateAxis(p.y,-F.offset.y))}translateAxis(p.x,P.offset.x),translateAxis(p.y,P.offset.y)}}return p}applyTransform(h,p=!1){const y=createBox();copyBoxInto(y,h);for(let S=0;S<this.path.length;S++){const P=this.path[S];!p&&P.options.layoutScroll&&P.scroll&&P!==P.root&&transformBox(y,{x:-P.scroll.offset.x,y:-P.scroll.offset.y}),hasTransform(P.latestValues)&&transformBox(y,P.latestValues)}return hasTransform(this.latestValues)&&transformBox(y,this.latestValues),y}removeTransform(h){const p=createBox();copyBoxInto(p,h);for(let y=0;y<this.path.length;y++){const S=this.path[y];if(!S.instance||!hasTransform(S.latestValues))continue;hasScale(S.latestValues)&&S.updateSnapshot();const P=createBox(),L=S.measurePageBox();copyBoxInto(P,L),removeBoxTransforms(p,S.latestValues,S.snapshot?S.snapshot.layoutBox:void 0,P)}return hasTransform(this.latestValues)&&removeBoxTransforms(p,this.latestValues),p}setTargetDelta(h){this.targetDelta=h,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(h){this.options={...this.options,...h,crossfade:h.crossfade!==void 0?h.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==frameData.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(h=!1){var p;const y=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=y.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=y.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=y.isSharedProjectionDirty);const S=!!this.resumingFrom||this!==y;if(!(h||S&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:L,layoutId:F}=this.options;if(!(!this.layout||!(L||F))){if(this.resolvedRelativeTargetAt=frameData.timestamp,!this.targetDelta&&!this.relativeTarget){const N=this.getClosestProjectingParent();N&&N.layout&&this.animationProgress!==1?(this.relativeParent=N,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.layout.layoutBox,N.layout.layoutBox),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=createBox(),this.targetWithTransforms=createBox()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),calcRelativeBox(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):copyBoxInto(this.target,this.layout.layoutBox),applyBoxDelta(this.target,this.targetDelta)):copyBoxInto(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const N=this.getClosestProjectingParent();N&&!!N.resumingFrom==!!this.resumingFrom&&!N.options.layoutScroll&&N.target&&this.animationProgress!==1?(this.relativeParent=N,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.target,N.target),copyBoxInto(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}projectionFrameData.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||hasScale(this.parent.latestValues)||has2DTranslate(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var h;const p=this.getLead(),y=!!this.resumingFrom||this!==p;let S=!0;if((this.isProjectionDirty||!((h=this.parent)===null||h===void 0)&&h.isProjectionDirty)&&(S=!1),y&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(S=!1),this.resolvedRelativeTargetAt===frameData.timestamp&&(S=!1),S)return;const{layout:P,layoutId:L}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(P||L))return;copyBoxInto(this.layoutCorrected,this.layout.layoutBox);const F=this.treeScale.x,N=this.treeScale.y;applyTreeDeltas(this.layoutCorrected,this.treeScale,this.path,y),p.layout&&!p.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(p.target=p.layout.layoutBox,p.targetWithTransforms=createBox());const{target:z}=p;if(!z){this.projectionTransform&&(this.projectionDelta=createDelta(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=createDelta(),this.projectionDeltaWithTransform=createDelta());const W=this.projectionTransform;calcBoxDelta(this.projectionDelta,this.layoutCorrected,z,this.latestValues),this.projectionTransform=buildProjectionTransform(this.projectionDelta,this.treeScale),(this.projectionTransform!==W||this.treeScale.x!==F||this.treeScale.y!==N)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",z)),projectionFrameData.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(h=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),h){const p=this.getStack();p&&p.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(h,p=!1){const y=this.snapshot,S=y?y.latestValues:{},P={...this.latestValues},L=createDelta();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const F=createBox(),N=y?y.source:void 0,z=this.layout?this.layout.source:void 0,W=N!==z,nt=this.getStack(),Pe=!nt||nt.members.length<=1,se=!!(W&&!Pe&&this.options.crossfade===!0&&!this.path.some(hasOpacityCrossfade));this.animationProgress=0;let mt;this.mixTargetDelta=kt=>{const mn=kt/1e3;mixAxisDelta(L.x,h.x,mn),mixAxisDelta(L.y,h.y,mn),this.setTargetDelta(L),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(F,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,F,mn),mt&&boxEquals(this.relativeTarget,mt)&&(this.isProjectionDirty=!1),mt||(mt=createBox()),copyBoxInto(mt,this.relativeTarget)),W&&(this.animationValues=P,mixValues(P,S,this.latestValues,mn,se,Pe)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=mn},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(h){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(cancelFrame(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=frame.update(()=>{globalProjectionState.hasAnimatedSinceResize=!0,this.currentAnimation=animateSingleValue(0,animationTarget,{...h,onUpdate:p=>{this.mixTargetDelta(p),h.onUpdate&&h.onUpdate(p)},onComplete:()=>{h.onComplete&&h.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const h=this.getStack();h&&h.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(animationTarget),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const h=this.getLead();let{targetWithTransforms:p,target:y,layout:S,latestValues:P}=h;if(!(!p||!y||!S)){if(this!==h&&this.layout&&S&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,S.layoutBox)){y=this.target||createBox();const L=calcLength(this.layout.layoutBox.x);y.x.min=h.target.x.min,y.x.max=y.x.min+L;const F=calcLength(this.layout.layoutBox.y);y.y.min=h.target.y.min,y.y.max=y.y.min+F}copyBoxInto(p,y),transformBox(p,P),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,p,P)}}registerSharedNode(h,p){this.sharedNodes.has(h)||this.sharedNodes.set(h,new NodeStack),this.sharedNodes.get(h).add(p);const S=p.options.initialPromotionConfig;p.promote({transition:S?S.transition:void 0,preserveFollowOpacity:S&&S.shouldPreserveFollowOpacity?S.shouldPreserveFollowOpacity(p):void 0})}isLead(){const h=this.getStack();return h?h.lead===this:!0}getLead(){var h;const{layoutId:p}=this.options;return p?((h=this.getStack())===null||h===void 0?void 0:h.lead)||this:this}getPrevLead(){var h;const{layoutId:p}=this.options;return p?(h=this.getStack())===null||h===void 0?void 0:h.prevLead:void 0}getStack(){const{layoutId:h}=this.options;if(h)return this.root.sharedNodes.get(h)}promote({needsReset:h,transition:p,preserveFollowOpacity:y}={}){const S=this.getStack();S&&S.promote(this,y),h&&(this.projectionDelta=void 0,this.needsReset=!0),p&&this.setOptions({transition:p})}relegate(){const h=this.getStack();return h?h.relegate(this):!1}resetSkewAndRotation(){const{visualElement:h}=this.options;if(!h)return;let p=!1;const{latestValues:y}=h;if((y.z||y.rotate||y.rotateX||y.rotateY||y.rotateZ||y.skewX||y.skewY)&&(p=!0),!p)return;const S={};y.z&&resetDistortingTransform("z",h,S,this.animationValues);for(let P=0;P<transformAxes.length;P++)resetDistortingTransform(`rotate${transformAxes[P]}`,h,S,this.animationValues),resetDistortingTransform(`skew${transformAxes[P]}`,h,S,this.animationValues);h.render();for(const P in S)h.setStaticValue(P,S[P]),this.animationValues&&(this.animationValues[P]=S[P]);h.scheduleRender()}getProjectionStyles(h){var p,y;if(!this.instance||this.isSVG)return;if(!this.isVisible)return hiddenVisibility;const S={visibility:""},P=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,S.opacity="",S.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||"",S.transform=P?P(this.latestValues,""):"none",S;const L=this.getLead();if(!this.projectionDelta||!this.layout||!L.target){const W={};return this.options.layoutId&&(W.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,W.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||""),this.hasProjected&&!hasTransform(this.latestValues)&&(W.transform=P?P({},""):"none",this.hasProjected=!1),W}const F=L.animationValues||L.latestValues;this.applyTransformsToTarget(),S.transform=buildProjectionTransform(this.projectionDeltaWithTransform,this.treeScale,F),P&&(S.transform=P(F,S.transform));const{x:N,y:z}=this.projectionDelta;S.transformOrigin=`${N.origin*100}% ${z.origin*100}% 0`,L.animationValues?S.opacity=L===this?(y=(p=F.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&y!==void 0?y:1:this.preserveOpacity?this.latestValues.opacity:F.opacityExit:S.opacity=L===this?F.opacity!==void 0?F.opacity:"":F.opacityExit!==void 0?F.opacityExit:0;for(const W in scaleCorrectors){if(F[W]===void 0)continue;const{correct:nt,applyTo:Pe}=scaleCorrectors[W],se=S.transform==="none"?F[W]:nt(F[W],L);if(Pe){const mt=Pe.length;for(let kt=0;kt<mt;kt++)S[Pe[kt]]=se}else S[W]=se}return this.options.layoutId&&(S.pointerEvents=L===this?resolveMotionValue(h==null?void 0:h.pointerEvents)||"":"none"),S}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(h=>{var p;return(p=h.currentAnimation)===null||p===void 0?void 0:p.stop()}),this.root.nodes.forEach(clearMeasurements),this.root.sharedNodes.clear()}}}function updateLayout(t){t.updateLayout()}function notifyLayoutUpdate(t){var n;const o=((n=t.resumeFrom)===null||n===void 0?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&o&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:c}=t.layout,{animationType:d}=t.options,h=o.source!==t.layout.source;d==="size"?eachAxis(L=>{const F=h?o.measuredBox[L]:o.layoutBox[L],N=calcLength(F);F.min=s[L].min,F.max=F.min+N}):shouldAnimatePositionOnly(d,o.layoutBox,s)&&eachAxis(L=>{const F=h?o.measuredBox[L]:o.layoutBox[L],N=calcLength(s[L]);F.max=F.min+N,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[L].max=t.relativeTarget[L].min+N)});const p=createDelta();calcBoxDelta(p,s,o.layoutBox);const y=createDelta();h?calcBoxDelta(y,t.applyTransform(c,!0),o.measuredBox):calcBoxDelta(y,s,o.layoutBox);const S=!isDeltaZero(p);let P=!1;if(!t.resumeFrom){const L=t.getClosestProjectingParent();if(L&&!L.resumeFrom){const{snapshot:F,layout:N}=L;if(F&&N){const z=createBox();calcRelativePosition(z,o.layoutBox,F.layoutBox);const W=createBox();calcRelativePosition(W,s,N.layoutBox),boxEqualsRounded(z,W)||(P=!0),L.options.layoutRoot&&(t.relativeTarget=W,t.relativeTargetOrigin=z,t.relativeParent=L)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:o,delta:y,layoutDelta:p,hasLayoutChanged:S,hasRelativeTargetChanged:P})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function propagateDirtyNodes(t){projectionFrameData.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function cleanDirtyNodes(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function clearSnapshot(t){t.clearSnapshot()}function clearMeasurements(t){t.clearMeasurements()}function clearIsLayoutDirty(t){t.isLayoutDirty=!1}function resetTransformStyle(t){const{visualElement:n}=t.options;n&&n.getProps().onBeforeLayoutMeasure&&n.notify("BeforeLayoutMeasure"),t.resetTransform()}function finishAnimation(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function resolveTargetDelta(t){t.resolveTargetDelta()}function calcProjection(t){t.calcProjection()}function resetSkewAndRotation(t){t.resetSkewAndRotation()}function removeLeadSnapshots(t){t.removeLeadSnapshot()}function mixAxisDelta(t,n,o){t.translate=mixNumber$1(n.translate,0,o),t.scale=mixNumber$1(n.scale,1,o),t.origin=n.origin,t.originPoint=n.originPoint}function mixAxis(t,n,o,s){t.min=mixNumber$1(n.min,o.min,s),t.max=mixNumber$1(n.max,o.max,s)}function mixBox(t,n,o,s){mixAxis(t.x,n.x,o.x,s),mixAxis(t.y,n.y,o.y,s)}function hasOpacityCrossfade(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const defaultLayoutTransition={duration:.45,ease:[.4,0,.1,1]},userAgentContains=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),roundPoint=userAgentContains("applewebkit/")&&!userAgentContains("chrome/")?Math.round:noop$1;function roundAxis(t){t.min=roundPoint(t.min),t.max=roundPoint(t.max)}function roundBox(t){roundAxis(t.x),roundAxis(t.y)}function shouldAnimatePositionOnly(t,n,o){return t==="position"||t==="preserve-aspect"&&!isNear(aspectRatio(n),aspectRatio(o),.2)}const DocumentProjectionNode=createProjectionNode({attachResizeListener:(t,n)=>addDomEvent(t,"resize",n),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rootProjectionNode={current:void 0},HTMLProjectionNode=createProjectionNode({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!rootProjectionNode.current){const t=new DocumentProjectionNode({});t.mount(window),t.setOptions({layoutScroll:!0}),rootProjectionNode.current=t}return rootProjectionNode.current},resetTransform:(t,n)=>{t.style.transform=n!==void 0?n:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),drag={pan:{Feature:PanGesture},drag:{Feature:DragGesture,ProjectionNode:HTMLProjectionNode,MeasureLayout}},prefersReducedMotion={current:null},hasReducedMotionListener={current:!1};function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),n=()=>prefersReducedMotion.current=t.matches;t.addListener(n),n()}else prefersReducedMotion.current=!1}function updateMotionValuesFromProps(t,n,o){const{willChange:s}=n;for(const c in n){const d=n[c],h=o[c];if(isMotionValue(d))t.addValue(c,d),isWillChangeMotionValue(s)&&s.add(c),process.env.NODE_ENV==="development"&&warnOnce(d.version==="11.0.27",`Attempting to mix Framer Motion versions ${d.version} with 11.0.27 may not work as expected.`);else if(isMotionValue(h))t.addValue(c,motionValue(d,{owner:t})),isWillChangeMotionValue(s)&&s.remove(c);else if(h!==d)if(t.hasValue(c)){const p=t.getValue(c);p.liveStyle===!0?p.jump(d):p.hasAnimated||p.set(d)}else{const p=t.getStaticValue(c);t.addValue(c,motionValue(p!==void 0?p:d,{owner:t}))}}for(const c in o)n[c]===void 0&&t.removeValue(c);return n}const visualElementStore=new WeakMap,valueTypes=[...dimensionValueTypes,color,complex],findValueType=t=>valueTypes.find(testValueType(t)),featureNames=Object.keys(featureDefinitions),numFeatures=featureNames.length,propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],numVariantProps=variantProps.length;function getClosestProjectingNode(t){if(t)return t.options.allowProjection!==!1?t.projection:getClosestProjectingNode(t.parent)}class VisualElement{constructor({parent:n,props:o,presenceContext:s,reducedMotionConfig:c,blockInitialAnimation:d,visualState:h},p={}){this.resolveKeyframes=(F,N,z,W)=>new this.KeyframeResolver(F,N,z,W,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=KeyframeResolver,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>frame.render(this.render,!1,!0);const{latestValues:y,renderState:S}=h;this.latestValues=y,this.baseTarget={...y},this.initialValues=o.initial?{...y}:{},this.renderState=S,this.parent=n,this.props=o,this.presenceContext=s,this.depth=n?n.depth+1:0,this.reducedMotionConfig=c,this.options=p,this.blockInitialAnimation=!!d,this.isControllingVariants=isControllingVariants(o),this.isVariantNode=isVariantNode(o),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(n&&n.current);const{willChange:P,...L}=this.scrapeMotionValuesFromProps(o,{},this);for(const F in L){const N=L[F];y[F]!==void 0&&isMotionValue(N)&&(N.set(y[F],!1),isWillChangeMotionValue(P)&&P.add(F))}}scrapeMotionValuesFromProps(n,o,s){return{}}mount(n){this.current=n,visualElementStore.set(n,this),this.projection&&!this.projection.instance&&this.projection.mount(n),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((o,s)=>this.bindToMotionValue(s,o)),hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:prefersReducedMotion.current,process.env.NODE_ENV!=="production"&&warnOnce(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){visualElementStore.delete(this.current),this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach(n=>n()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const n in this.events)this.events[n].clear();for(const n in this.features)this.features[n].unmount();this.current=null}bindToMotionValue(n,o){const s=transformProps.has(n),c=o.on("change",h=>{this.latestValues[n]=h,this.props.onUpdate&&frame.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),d=o.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(n,()=>{c(),d(),o.owner&&o.stop()})}sortNodePosition(n){return!this.current||!this.sortInstanceNodePosition||this.type!==n.type?0:this.sortInstanceNodePosition(this.current,n.current)}loadFeatures({children:n,...o},s,c,d){let h,p;if(process.env.NODE_ENV!=="production"&&c&&s){const y="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";o.ignoreStrict?warning(!1,y):invariant(!1,y)}for(let y=0;y<numFeatures;y++){const S=featureNames[y],{isEnabled:P,Feature:L,ProjectionNode:F,MeasureLayout:N}=featureDefinitions[S];F&&(h=F),P(o)&&(!this.features[S]&&L&&(this.features[S]=new L(this)),N&&(p=N))}if((this.type==="html"||this.type==="svg")&&!this.projection&&h){this.projection=new h(this.latestValues,getClosestProjectingNode(this.parent));const{layoutId:y,layout:S,drag:P,dragConstraints:L,layoutScroll:F,layoutRoot:N}=o;this.projection.setOptions({layoutId:y,layout:S,alwaysMeasureLayout:!!P||L&&isRefObject(L),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof S=="string"?S:"both",initialPromotionConfig:d,layoutScroll:F,layoutRoot:N})}return p}updateFeatures(){for(const n in this.features){const o=this.features[n];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(n){return this.latestValues[n]}setStaticValue(n,o){this.latestValues[n]=o}update(n,o){(n.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=n,this.prevPresenceContext=this.presenceContext,this.presenceContext=o;for(let s=0;s<propEventHandlers.length;s++){const c=propEventHandlers[s];this.propEventSubscriptions[c]&&(this.propEventSubscriptions[c](),delete this.propEventSubscriptions[c]);const d=n["on"+c];d&&(this.propEventSubscriptions[c]=this.on(c,d))}this.prevMotionValues=updateMotionValuesFromProps(this,this.scrapeMotionValuesFromProps(n,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(n){return this.props.variants?this.props.variants[n]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(n=!1){if(n)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const s=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(s.initial=this.props.initial),s}const o={};for(let s=0;s<numVariantProps;s++){const c=variantProps[s],d=this.props[c];(isVariantLabel(d)||d===!1)&&(o[c]=d)}return o}addVariantChild(n){const o=this.getClosestVariantNode();if(o)return o.variantChildren&&o.variantChildren.add(n),()=>o.variantChildren.delete(n)}addValue(n,o){o!==this.values.get(n)&&(this.removeValue(n),this.bindToMotionValue(n,o)),this.values.set(n,o),this.latestValues[n]=o.get()}removeValue(n){this.values.delete(n);const o=this.valueSubscriptions.get(n);o&&(o(),this.valueSubscriptions.delete(n)),delete this.latestValues[n],this.removeValueFromRenderState(n,this.renderState)}hasValue(n){return this.values.has(n)}getValue(n,o){if(this.props.values&&this.props.values[n])return this.props.values[n];let s=this.values.get(n);return s===void 0&&o!==void 0&&(s=motionValue(o===null?void 0:o,{owner:this}),this.addValue(n,s)),s}readValue(n,o){var s;let c=this.latestValues[n]!==void 0||!this.current?this.latestValues[n]:(s=this.getBaseTargetFromProps(this.props,n))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,n,this.options);return c!=null&&(typeof c=="string"&&(isNumericalString(c)||isZeroValueString(c))?c=parseFloat(c):!findValueType(c)&&complex.test(o)&&(c=getAnimatableNone(n,o)),this.setBaseTarget(n,isMotionValue(c)?c.get():c)),isMotionValue(c)?c.get():c}setBaseTarget(n,o){this.baseTarget[n]=o}getBaseTarget(n){var o,s;const{initial:c}=this.props,d=typeof c=="string"||typeof c=="object"?(s=resolveVariantFromProps(this.props,c,(o=this.presenceContext)===null||o===void 0?void 0:o.custom))===null||s===void 0?void 0:s[n]:void 0;if(c&&d!==void 0)return d;const h=this.getBaseTargetFromProps(this.props,n);return h!==void 0&&!isMotionValue(h)?h:this.initialValues[n]!==void 0&&d===void 0?void 0:this.baseTarget[n]}on(n,o){return this.events[n]||(this.events[n]=new SubscriptionManager),this.events[n].add(o)}notify(n,...o){this.events[n]&&this.events[n].notify(...o)}}class DOMVisualElement extends VisualElement{constructor(){super(...arguments),this.KeyframeResolver=DOMKeyframesResolver}sortInstanceNodePosition(n,o){return n.compareDocumentPosition(o)&2?1:-1}getBaseTargetFromProps(n,o){return n.style?n.style[o]:void 0}removeValueFromRenderState(n,{vars:o,style:s}){delete o[n],delete s[n]}}function getComputedStyle(t){return window.getComputedStyle(t)}class HTMLVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="html"}readValueFromInstance(n,o){if(transformProps.has(o)){const s=getDefaultValueType(o);return s&&s.default||0}else{const s=getComputedStyle(n),c=(isCSSVariableName(o)?s.getPropertyValue(o):s[o])||0;return typeof c=="string"?c.trim():c}}measureInstanceViewportBox(n,{transformPagePoint:o}){return measureViewportBox(n,o)}build(n,o,s,c){buildHTMLStyles(n,o,s,c.transformTemplate)}scrapeMotionValuesFromProps(n,o,s){return scrapeMotionValuesFromProps$1(n,o,s)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:n}=this.props;isMotionValue(n)&&(this.childSubscription=n.on("change",o=>{this.current&&(this.current.textContent=`${o}`)}))}renderInstance(n,o,s,c){renderHTML(n,o,s,c)}}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(n,o){return n[o]}readValueFromInstance(n,o){if(transformProps.has(o)){const s=getDefaultValueType(o);return s&&s.default||0}return o=camelCaseAttributes.has(o)?o:camelToDash(o),n.getAttribute(o)}measureInstanceViewportBox(){return createBox()}scrapeMotionValuesFromProps(n,o){return scrapeMotionValuesFromProps(n,o,this)}build(n,o,s,c){buildSVGAttrs(n,o,s,this.isSVGTag,c.transformTemplate)}renderInstance(n,o,s,c){renderSVG(n,o,s,c)}mount(n){this.isSVGTag=isSVGTag(n.tagName),super.mount(n)}}const createDomVisualElement=(t,n)=>isSVGComponent(t)?new SVGVisualElement(n,{enableHardwareAcceleration:!1}):new HTMLVisualElement(n,{allowProjection:t!==React.Fragment,enableHardwareAcceleration:!0}),layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}},preloadedFeatures={...animations,...gestureAnimations,...drag,...layout},motion=createMotionProxy((t,n)=>createDomMotionConfig(t,n,preloadedFeatures,createDomVisualElement));function useMotionValue(t){const n=useConstant(()=>motionValue(t)),{isStatic:o}=React.useContext(MotionConfigContext);if(o){const[,s]=React.useState(t);React.useEffect(()=>n.on("change",s),[])}return n}function assignRef(t,n){return typeof t=="function"?t(n):t&&(t.current=n),t}function useCallbackRef(t,n){var o=React.useState(function(){return{value:t,callback:n,facade:{get current(){return o.value},set current(s){var c=o.value;c!==s&&(o.value=s,o.callback(s,c))}}}})[0];return o.callback=n,o.facade}var useIsomorphicLayoutEffect=typeof window<"u"?React__namespace.useLayoutEffect:React__namespace.useEffect,currentValues=new WeakMap;function useMergeRefs(t,n){var o=useCallbackRef(null,function(s){return t.forEach(function(c){return assignRef(c,s)})});return useIsomorphicLayoutEffect(function(){var s=currentValues.get(o);if(s){var c=new Set(s),d=new Set(t),h=o.current;c.forEach(function(p){d.has(p)||assignRef(p,null)}),d.forEach(function(p){c.has(p)||assignRef(p,h)})}currentValues.set(o,t)},[t]),o}const occluder=new EllipsoidalOccluder(Ellipsoid$1.WGS84,Cartesian3.ZERO),ScreenSpaceElement=React.forwardRef(({position:t,children:n,...o},s)=>{const c=useConstant$2(()=>new Cartesian3);t==null||t.clone(c);const d=useMotionValue(""),h=useMotionValue("none"),{toWindowPosition:p,getCamera:y,toXYZ:S,isPositionVisible:P}=useContext(),L=React.useRef(null);usePreRender(()=>{if(L.current==null)return;let N;try{const se=p==null?void 0:p([c.x,c.y,c.z]);N=new Cartesian2(se==null?void 0:se[0],se==null?void 0:se[1])}catch{h.set("none");return}const z=y==null?void 0:y();if(!z)return;const W=S==null?void 0:S(z==null?void 0:z.lng,z==null?void 0:z.lat,z==null?void 0:z.height);if(!W)return;if(occluder.cameraPosition=new Cartesian3(W[0],W[1],W[2]),N==null||N.x<0||N.y<0||N.x>window.innerWidth||N.y>window.innerHeight||!(P!=null&&P([c.x,c.y,c.z]))){h.set("none");return}const nt=`calc(${N.x}px - 50%)`,Pe=`calc(${N.y}px - 50%)`;d.set(`translate(${nt}, ${Pe})`),h.set("block")});const F=useMergeRefs([L,s]);return jsxRuntimeExports.jsx(motion.div,{ref:F,...o,style:{...o.style,transform:d,display:h,position:"absolute",pointerEvents:"none",left:0,top:0},children:n})});ScreenSpaceElement.displayName="ScreenSpaceElement";const MeasurementLine$1=({a:t,b:n,color:o})=>{const s=React.useRef([t,n]);s.current=[t,n];const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=React.useMemo(()=>({polyline:{positions:c,width:1.5,material:new PolylineDashMaterialProperty({color:o,dashLength:8})}}),[o,c]);return jsxRuntimeExports.jsx(Entity,{...d})},ExtrudedMeasurement=({a:t,b:n,extrudedHeight:o,color:s,showLine:c})=>{const d=useConstant$2(()=>new Cartesian3);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScreenSpaceElement,{position:Cartesian3.midpoint(t,n,d),children:jsxRuntimeExports.jsx(MeasurementText,{children:o<1e3?`${o.toFixed(1)} m`:`${(o/1e3).toFixed(1)} km`})}),c&&jsxRuntimeExports.jsx(MeasurementLine$1,{a:t,b:n,color:s})]})},ExtrudedControlPoints=React.memo(({geometryOptions:{controlPoints:t,type:n},extrudedHeight:o,color:s,isEditing:c,extrudedPoint:d,centroidBasePoint:h,centroidExtrudedPoint:p,catchedExtrudedPoint:y,handleControlPointMouseEvent:S})=>{const P=t[t.length-1],L=d?new Cartesian3(...d):void 0,F=h?new Cartesian3(...h):void 0,N=p?new Cartesian3(...p):void 0;return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[L&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ControlPoint,{index:-1,position:L,isEditing:c,isExtrudedControlPoint:!0,handleControlPointMouseEvent:S}),(!c||y)&&jsxRuntimeExports.jsx(ExtrudedMeasurement,{a:P,b:L,extrudedHeight:o,color:c?Color$1.fromCssColorString(DEFAULT_EDIT_COLOR):s,showLine:n!=="extrudedPolygon"})]}),F&&jsxRuntimeExports.jsx(ControlPoint,{index:-1,position:F,isEditing:c,isExtrudedControlPoint:!0}),N&&jsxRuntimeExports.jsx(ControlPoint,{index:-1,position:N,isEditing:c,isExtrudedControlPoint:!0})]})});ExtrudedControlPoints.displayName="ExtrudedControlPoints";const ExtrudedPolygonEntity=({id:t,hierarchy:n,extrudedHeight:o,color:s,disableShadow:c=!1,isEditing:d})=>{const h=React.useRef(n);h.current=n;const y=useConstant$2(()=>new CallbackProperty(()=>h.current,!1)),S=React.useRef(o);S.current=o;const L=useConstant$2(()=>new CallbackProperty(()=>S.current,!1)),F=React.useMemo(()=>({polygon:{hierarchy:y,heightReference:HeightReference$1.RELATIVE_TO_TERRAIN,extrudedHeight:L,extrudedHeightReference:HeightReference$1.RELATIVE_TO_TERRAIN,fill:!0,outline:!0,outlineWidth:1,outlineColor:d?Color$1.fromCssColorString(DEFAULT_EDIT_COLOR):s==null?void 0:s.withAlpha(1),material:new ColorMaterialProperty(d?s==null?void 0:s.withAlpha(.2):s),classificationType:ClassificationType$1.TERRAIN,shadows:c?ShadowMode$1.DISABLED:ShadowMode$1.ENABLED}}),[L,c,y,s,d]),{requestRender:N}=useContext();return N==null||N(),jsxRuntimeExports.jsx(Entity,{id:t,...F})},PolygonEntity=({dynamic:t=!1,hierarchy:n,color:o})=>{const s=React.useRef(n);s.current=n;const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=t?c:n,h=React.useMemo(()=>({polygon:{hierarchy:d,fill:!0,material:o==null?void 0:o.withAlpha(.5),classificationType:ClassificationType$1.TERRAIN}}),[o,d]),{requestRender:p}=useContext();return p==null||p(),jsxRuntimeExports.jsx(Entity,{...h})},PolylineEntity=({dynamic:t=!1,positions:n,color:o,isEditing:s})=>{const c=React.useRef(n);c.current=n;const d=useConstant$2(()=>new CallbackProperty(()=>c.current,!t)),h=t?d:n,p=React.useMemo(()=>({polyline:{positions:h,width:1.5,material:s?Color$1.fromCssColorString(DEFAULT_EDIT_COLOR):o,classificationType:ClassificationType$1.TERRAIN,clampToGround:!0}}),[o,h,s]),{requestRender:y}=useContext();return y==null||y(),jsxRuntimeExports.jsx(Entity,{...p})},cartesianScratch1$1=new Cartesian3,SurfaceAddingPoints=React.memo(({geometryOptions:{type:t,controlPoints:n},isEditing:o,handleAddControlPoint:s})=>{if(!["polyline","polygon","extrudedPolygon"].includes(t))return null;const c=[];for(let d=0;d<n.length-1;d++){const h=n[d+1],p=Cartesian3.midpoint(n[d],h,cartesianScratch1$1);c.push(p.clone())}if(t==="polygon"||t==="extrudedPolygon"){const d=Cartesian3.midpoint(n[n.length-1],n[0],cartesianScratch1$1);c.push(d.clone())}return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:c.map((d,h)=>jsxRuntimeExports.jsx(ControlPoint,{position:d,isAddingPoint:!0,index:h,clampToGround:!0,isEditing:o,handleControlPointMouseEvent:()=>s==null?void 0:s([d.x,d.y,d.z],h)},h))})});SurfaceAddingPoints.displayName="SurfaceAddingPoints";const MeasurementLine=({a:t,b:n,color:o})=>{const s=React.useRef([t,n]);s.current=[t,n];const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!1)),d=React.useMemo(()=>({polyline:{positions:c,width:1.5,material:new PolylineDashMaterialProperty({color:o,dashLength:8}),classificationType:ClassificationType$1.TERRAIN,clampToGround:!0}}),[o,c]),{requestRender:h}=useContext();return h==null||h(),jsxRuntimeExports.jsx(Entity,{...d})},SurfaceMeasurement=({a:t,b:n,color:o,showLine:s=!1})=>{const c=useConstant$2(()=>new Cartesian3),{getSurfaceDistance:d}=useContext(),h=d==null?void 0:d(t,n);return h!==void 0?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScreenSpaceElement,{position:Cartesian3.midpoint(t,n,c),children:jsxRuntimeExports.jsx(MeasurementText,{children:h<1e3?`${h.toFixed(1)} m`:`${(h/1e3).toFixed(1)} km`})}),s&&jsxRuntimeExports.jsx(MeasurementLine,{a:t,b:n,color:o})]}):null},cartesianScratch1=new Cartesian3,SurfaceControlPoints=React.memo(({geometryOptions:{type:t,controlPoints:n},color:o,isEditing:s,catchedControlPointIndex:c,selectedControlPointIndex:d,handleControlPointMouseEvent:h})=>{const p=[];if(n.length>=2)if(s){if(c!==void 0&&c!==-1)switch(t){case"polyline":c>0&&p.push({points:[n[c-1],n[c]],showLine:!1}),c<n.length-1&&p.push({points:[n[c],n[c+1]],showLine:!1});break;case"circle":case"extrudedCircle":c!==2&&p.push({points:[n[0],n[1]],showLine:!0});break;case"rectangle":case"extrudedRectangle":if(c<=1)p.push({points:[n[0],n[1]],showLine:!1});else if(c===2){const[y,S,P]=n,L=Cartesian3.midpoint(y,S,cartesianScratch1);p.push({points:[L,P],showLine:!0})}break;case"polygon":case"extrudedPolygon":p.push({points:[n[c],c===0?n[n.length-1]:n[c-1]],showLine:!1}),p.push({points:[n[c],c===n.length-1?n[0]:n[c+1]],showLine:!1});break}}else switch(t){case"rectangle":if(n.length===2)p.push({points:n,showLine:!0});else if(n.length===3){const[y,S,P]=n,L=Cartesian3.midpoint(y,S,cartesianScratch1);p.push({points:[L,P],showLine:!0})}break;default:p.push({points:n.slice(-2),showLine:t==="circle"});break}return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[n.map((y,S)=>jsxRuntimeExports.jsx(ControlPoint,{position:y,index:S,isSelected:d===S,clampToGround:!0,isEditing:s,handleControlPointMouseEvent:h},S)),p.map(({points:y,showLine:S},P)=>jsxRuntimeExports.jsx(SurfaceMeasurement,{a:y[0],b:y[1],color:s?Color$1.fromCssColorString(DEFAULT_EDIT_COLOR):o,showLine:S},P))]})});SurfaceControlPoints.displayName="SurfaceControlPoints";const SketchComponent=React.memo(({geometryOptions:t,extrudedHeight:n,disableShadow:o,color:s,isEditing:c,extrudedPoint:d,centroidBasePoint:h,centroidExtrudedPoint:p,catchedControlPointIndex:y,catchedExtrudedPoint:S,selectedControlPointIndex:P,handleControlPointMouseEvent:L,handleAddControlPoint:F})=>{const N=React.useMemo(()=>t?{...t,controlPoints:t==null?void 0:t.controlPoints.map(se=>new Cesium$1.Cartesian3(...se))}:null,[t]),z=React.useMemo(()=>N?createGeometry(N):null,[N]),{positionsArray:W,hierarchyArray:nt}=React.useMemo(()=>(z==null?void 0:z.type)==="Point"?{}:(z==null?void 0:z.type)==="LineString"?{positionsArray:convertGeometryToPositionsArray(z)}:z!=null?{positionsArray:convertGeometryToPositionsArray(z),hierarchyArray:convertPolygonToHierarchyArray(z)}:{},[z]),Pe=React.useMemo(()=>Color$1.fromCssColorString(s??DEFAULT_SKETCH_COLOR),[s]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[W==null?void 0:W.map((se,mt)=>jsxRuntimeExports.jsx(PolylineEntity,{dynamic:!0,positions:se,color:Pe,isEditing:c},mt)),nt==null?void 0:nt.map((se,mt)=>jsxRuntimeExports.jsx(PolygonEntity,{dynamic:!0,hierarchy:se,color:Pe},mt)),N!=null&&(!n||c)&&jsxRuntimeExports.jsx(SurfaceControlPoints,{geometryOptions:N,color:Pe,isEditing:c,catchedControlPointIndex:y,selectedControlPointIndex:P,handleControlPointMouseEvent:L}),N!=null&&c&&jsxRuntimeExports.jsx(SurfaceAddingPoints,{geometryOptions:N,isEditing:c,handleAddControlPoint:F}),N!=null&&n&&jsxRuntimeExports.jsx(ExtrudedControlPoints,{geometryOptions:N,extrudedHeight:n,extrudedPoint:d,centroidBasePoint:h,centroidExtrudedPoint:p,catchedExtrudedPoint:S,color:Pe,isEditing:c,handleControlPointMouseEvent:L}),n&&(nt==null?void 0:nt.map((se,mt)=>jsxRuntimeExports.jsx(ExtrudedPolygonEntity,{hierarchy:se,extrudedHeight:n,disableShadow:o,color:Pe,isEditing:c},mt)))]})});SketchComponent.displayName="SketchComponent";const Cesium=({className:t,style:n,property:o,time:s,camera:c,small:d,ready:h,children:p,selectedLayerId:y,isLayerDraggable:S,isLayerDragging:P,shouldRender:L,layerSelectionReason:F,meta:N,displayCredits:z,layersRef:W,featureFlags:nt,requestingRenderMode:Pe,timelineManagerRef:se,cameraForceHorizontalRoll:mt,onLayerSelect:kt,onCameraChange:mn,onLayerDrag:_i,onLayerDrop:zi,onLayerEdit:Sa,onLayerSelectWithRectStart:fa,onLayerSelectWithRectMove:La,onLayerSelectWithRectEnd:Ra,onMount:ma,onLayerVisibility:yt,onLayerLoad:lt,onCreditsUpdate:pi},ba)=>{var gd,pd,Zd,cf,sf,nf,df,Cf,mf,Sf,Pf,Af,Hf,_f,wf,Yf,Nf,vf,Ff,Xf,Wf,Qf,_m,Bf,$m,qf,qm,ep,Tf,rf,bf,If,Uf,jf,jm,sp,cp,fp,mp,al,tf,lf;const{cesium:Sc,mouseEventHandles:ms,cesiumIonAccessToken:Xs,context:Nl,layerSelectWithRectEventHandlers:pu,sceneLight:yu,sceneBackgroundColor:Ru,sceneMsaaSamples:Vd,sceneMode:Gd,cameraViewBoundaries:uf,cameraViewOuterBoundaries:ff,cameraViewBoundariesMaterial:pf,handleCameraChange:hf,handleCameraMoveEnd:of,handleUpdate:gf,handleClick:Ef,handleMount:xf,handleUnmount:Wa,handleTilesChange:af,handleTerrainProviderChange:Xd}=useHooks$1({ref:ba,property:o,time:s,selectedLayerId:y,selectionReason:F,meta:N,layersRef:W,featureFlags:nt,timelineManagerRef:se,isLayerDraggable:S,isLayerDragging:P,shouldRender:L,requestingRenderMode:Pe,camera:c,cameraForceHorizontalRoll:mt,onLayerDrag:_i,onLayerDrop:zi,onLayerSelect:kt,onLayerEdit:Sa,onLayerSelectWithRectStart:fa,onLayerSelectWithRectMove:La,onLayerSelectWithRectEnd:Ra,onLayerVisibility:yt,onLayerLoad:lt,onCameraChange:mn,onMount:ma,onCreditsUpdate:pi});return jsxRuntimeExports.jsxs(Aa$1,{ref:Sc,onUpdate:gf,className:t,requestRenderMode:!0,animation:!1,timeline:!1,baseLayer:!1,fullscreenButton:!1,homeButton:!1,geocoder:!1,infoBox:!1,baseLayerPicker:!1,navigationHelpButton:!1,projectionPicker:!1,sceneModePicker:!1,creditContainer:z?void 0:creditContainer,style:{width:d?"300px":"auto",height:d?"300px":"100%",display:h?void 0:"none",cursor:P?"grab":void 0,...n},shadows:!!((pd=(gd=o==null?void 0:o.scene)==null?void 0:gd.shadow)!=null&&pd.enabled),onClick:Ef,onDoubleClick:ms.doubleClick,onMouseDown:ms.mouseDown,onMouseUp:ms.mouseUp,onRightClick:ms.rightClick,onRightDown:ms.rightDown,onRightUp:ms.rightUp,onMiddleClick:ms.middleClick,onMiddleDown:ms.middleDown,onMiddleUp:ms.middleUp,onMouseMove:ms.mouseMove,onMouseEnter:ms.mouseEnter,onMouseLeave:ms.mouseLeave,onWheel:ms.wheel,children:[jsxRuntimeExports.jsx(Event,{onMount:xf,onUnmount:Wa}),jsxRuntimeExports.jsx(ReearthClock,{timelineManagerRef:se}),jsxRuntimeExports.jsx(ImageryLayers,{tiles:o==null?void 0:o.tiles,cesiumIonAccessToken:Xs,onTilesChange:af}),jsxRuntimeExports.jsx(LabelImageryLayers,{tileLabels:o==null?void 0:o.tileLabels}),jsxRuntimeExports.jsx(Indicator,{property:o,timelineManagerRef:se}),jsxRuntimeExports.jsxs(ka$1,{useDefault:!0,children:[jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_CLICK}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOUBLE_CLICK})]}),jsxRuntimeExports.jsxs(ka$1,{children:[jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,action:pu.start.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:pu.start.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,action:pu.move.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:pu.move.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,action:pu.end.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:pu.end.shift})]}),jsxRuntimeExports.jsx(Ta$1,{maximumZoomDistance:(cf=(Zd=o==null?void 0:o.camera)==null?void 0:Zd.limiter)!=null&&cf.enabled?((df=(nf=(sf=o.camera)==null?void 0:sf.limiter)==null?void 0:nf.targetArea)==null?void 0:df.height)??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY,enableCollisionDetection:!((Cf=o==null?void 0:o.camera)!=null&&Cf.allowEnterGround)}),jsxRuntimeExports.jsx(Ps$1,{percentageChanged:.2,onChange:hf,onMoveEnd:of}),uf&&((Sf=(mf=o==null?void 0:o.camera)==null?void 0:mf.limiter)==null?void 0:Sf.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:uf,width:1,material:Cesium$1.Color.RED,arcType:Cesium$1.ArcType.RHUMB})}),ff&&((Af=(Pf=o==null?void 0:o.camera)==null?void 0:Pf.limiter)==null?void 0:Af.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:ff,width:1,material:pf,arcType:Cesium$1.ArcType.RHUMB})}),jsxRuntimeExports.jsx($a$1,{backgroundColor:Ru,light:yu,mode:Gd,msaaSamples:Vd,useDepthPicking:!1,useWebVR:!!((Hf=o==null?void 0:o.scene)!=null&&Hf.vr)||void 0,debugShowFramesPerSecond:!!((_f=o==null?void 0:o.debug)!=null&&_f.showFramesPerSecond),verticalExaggerationRelativeHeight:(wf=o==null?void 0:o.scene)==null?void 0:wf.verticalExaggerationRelativeHeight,verticalExaggeration:(Yf=o==null?void 0:o.scene)==null?void 0:Yf.verticalExaggeration}),jsxRuntimeExports.jsx(Oa$1,{show:((vf=(Nf=o==null?void 0:o.sky)==null?void 0:Nf.skyBox)==null?void 0:vf.show)??!0}),jsxRuntimeExports.jsx(Vs,{enabled:((Xf=(Ff=o==null?void 0:o.sky)==null?void 0:Ff.fog)==null?void 0:Xf.enabled)??!0,density:(Qf=(Wf=o==null?void 0:o.sky)==null?void 0:Wf.fog)==null?void 0:Qf.density}),jsxRuntimeExports.jsx(Ga$1,{show:((Bf=(_m=o==null?void 0:o.sky)==null?void 0:_m.sun)==null?void 0:Bf.show)??!0}),jsxRuntimeExports.jsx(ea,{show:((qf=($m=o==null?void 0:o.sky)==null?void 0:$m.moon)==null?void 0:qf.show)??!0}),jsxRuntimeExports.jsx(_a$2,{show:((ep=(qm=o==null?void 0:o.sky)==null?void 0:qm.skyAtmosphere)==null?void 0:ep.show)??!0,atmosphereLightIntensity:(rf=(Tf=o==null?void 0:o.sky)==null?void 0:Tf.skyAtmosphere)==null?void 0:rf.lightIntensity,saturationShift:(If=(bf=o==null?void 0:o.sky)==null?void 0:bf.skyAtmosphere)==null?void 0:If.saturationShift,brightnessShift:(jf=(Uf=o==null?void 0:o.sky)==null?void 0:Uf.skyAtmosphere)==null?void 0:jf.brightnessShift}),jsxRuntimeExports.jsx(Globe,{property:o,cesiumIonAccessToken:Xs,onTerrainProviderChange:Xd}),jsxRuntimeExports.jsx(context.Provider,{value:Nl,children:h?p:null}),jsxRuntimeExports.jsx(AmbientOcclusion,{...AMBIENT_OCCLUSION_QUALITY[((sp=(jm=o==null?void 0:o.render)==null?void 0:jm.ambientOcclusion)==null?void 0:sp.quality)||"low"],enabled:!!((fp=(cp=o==null?void 0:o.render)==null?void 0:cp.ambientOcclusion)!=null&&fp.enabled),intensity:((al=(mp=o==null?void 0:o.render)==null?void 0:mp.ambientOcclusion)==null?void 0:al.intensity)??100,outputType:(lf=(tf=o==null?void 0:o.render)==null?void 0:tf.ambientOcclusion)!=null&&lf.ambientOcclusionOnly?AmbientOcclusionOutputType.Occlusion:null})]})},creditContainer=document.createElement("div"),Component=React.forwardRef(Cesium),engine={component:Component,featureComponent:Feature$1,clusterComponent:Cluster,sketchComponent:SketchComponent,delegatedDataTypes:["czml","wms","mvt","3dtiles","osm-buildings","kml"]},engines={cesium:engine};function Error$1({error:t,resetErrorBoundary:n}){return jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h1",{children:"Oops! An Error Occurred"}),jsxRuntimeExports.jsx("p",{children:t.message}),jsxRuntimeExports.jsx("p",{children:jsxRuntimeExports.jsx("button",{style:{color:"#fff"},onClick:n,children:"Retry"})})]})}const version$1="0.0.7-alpha.41",useCoreAPI=({viewerProperty:t})=>{const n=React.useRef(t);n.current=t;const o=React.useMemo(()=>({get version(){return version$1},get viewerProperty(){return n.current}}),[]);React.useEffect(()=>{window.reearth_core=o},[o])},viewportMobileMaxWidth=768,useViewport=({wrapperRef:t})=>{const n=React.useMemo(()=>paramsToObject(new URLSearchParams(window.location.search)),[]),[o,s]=React.useState({width:void 0,height:void 0,isMobile:void 0,query:n});return React.useEffect(()=>{const c=new ResizeObserver(d=>{var S,P;const[h]=d;let p,y;if(h.contentBoxSize){const L=Array.isArray(h.contentBoxSize)?h.contentBoxSize[0]:h.contentBoxSize;p=L.inlineSize,y=L.blockSize}else h.contentRect?(p=h.contentRect.width,y=h.contentRect.height):(p=(S=t.current)==null?void 0:S.clientWidth,y=(P=t.current)==null?void 0:P.clientHeight);s(L=>({width:p,height:y,isMobile:p?p<=viewportMobileMaxWidth:void 0,query:L.query}))});return t.current&&c.observe(t.current),()=>{c.disconnect()}},[t]),o};function paramsToObject(t){const n={};for(const[o,s]of t)n[o]=s;return n}function useHooks({camera:t,interactionMode:n,zoomedLayerId:o,viewerProperty:s,onLayerSelect:c,onCameraChange:d,onInteractionModeChange:h,onZoomToLayer:p,onLayerDrop:y,onSketchTypeChangeProp:S},P){const L=React.useRef(null);React.useImperativeHandle(P,()=>L.current,[]);const F=React.useRef(null),N=useViewport({wrapperRef:F}),[z,W]=React.useState({}),[nt,Pe]=React.useState(),[se,mt]=React.useState(),kt=React.useCallback(async(_f,wf,Yf,Nf,vf)=>{var Qf,_m,Bf,$m,qf,qm,ep,Tf,rf,bf,If;const Ff=((Qf=z.layer)==null?void 0:Qf.layer.type)==="simple"&&(($m=(Bf=(_m=z.layer)==null?void 0:_m.layer)==null?void 0:Bf.data)==null?void 0:$m.isSketchLayer);if(z.layerId===_f&&z.featureId===wf&&!Ff)return;const Xf=await(Yf==null?void 0:Yf()),Wf=_f&&wf?(Ff?(qf=Xf==null?void 0:Xf.features)==null?void 0:qf.find(Uf=>Uf.id===wf):(Tf=(qm=L.current)==null?void 0:(ep=qm.engine).findComputedFeatureById)==null?void 0:Tf.call(ep,_f,wf))??(vf==null?void 0:vf.feature):void 0;Pe(_f&&wf?(If=(rf=L.current)==null?void 0:(bf=rf.engine).findFeatureById)==null?void 0:If.call(bf,_f,wf):void 0),mt(Wf),W(Uf=>Uf.layerId===_f&&Uf.featureId===wf?Uf:{layerId:_f,featureId:wf,layer:Xf,reason:Nf}),c==null||c(_f,Yf,Wf,Nf)},[z,c]),mn=React.useRef(),[_i,zi]=useValue(t,d),[Sa,fa]=React.useState(!1),La=React.useCallback(_f=>{fa(!!_f)},[]),[Ra,ma]=useValue(n||"default",h);React.useEffect(()=>{var _f,wf;Ra==="default"&&((wf=(_f=L==null?void 0:L.current)==null?void 0:_f.engine)==null||wf.setCursor("auto"))},[Ra]);const yt=INTERACTION_MODES[Ra??"default"],lt=React.useRef(),pi=React.useCallback(_f=>{lt.current=_f},[]),ba=React.useCallback(_f=>{var wf;(wf=lt.current)==null||wf.call(lt,_f)},[]),Sc=React.useRef(),ms=React.useCallback(_f=>{Sc.current=_f},[]),Xs=React.useCallback(_f=>{var wf;(wf=Sc.current)==null||wf.call(Sc,_f)},[]),Nl=React.useRef(),pu=React.useCallback(_f=>{Nl.current=_f},[]),yu=React.useCallback(_f=>{var wf;(wf=Nl.current)==null||wf.call(Nl,_f)},[]),Ru=React.useRef(),Vd=React.useCallback(_f=>{Ru.current=_f},[]),Gd=React.useCallback(_f=>{var wf;(wf=Ru.current)==null||wf.call(Ru,_f)},[]),uf=React.useRef(),ff=React.useCallback(_f=>{uf.current=_f},[]),pf=React.useCallback(_f=>{var wf;(wf=uf.current)==null||wf.call(uf,_f)},[]),hf=React.useRef(),of=React.useCallback(_f=>{hf.current=_f},[]),gf=React.useCallback(_f=>{var wf;(wf=hf.current)==null||wf.call(hf,_f)},[]),Ef=React.useRef([]),xf=React.useCallback(_f=>{Ef.current.push(_f)},[]),Wa=React.useCallback(_f=>{Ef.current.forEach(wf=>wf(_f))},[]),af=React.useRef([]),Xd=React.useCallback(_f=>{af.current.push(_f)},[]),gd=React.useCallback(_f=>{af.current.forEach(wf=>wf(_f))},[]),pd=React.useRef([]),Zd=React.useCallback(_f=>{pd.current.push(_f)},[]),cf=React.useCallback(_f=>{pd.current.forEach(wf=>wf(_f))},[]),sf=React.useRef([]),nf=React.useCallback(_f=>{sf.current.push(_f)},[]),df=React.useCallback((_f,wf)=>{sf.current.forEach(Yf=>Yf(_f)),S==null||S(_f,wf)},[S]);React.useEffect(()=>{var _f,wf;o&&((wf=(_f=L.current)==null?void 0:_f.engine)==null||wf.lookAtLayer(o),p==null||p(void 0))},[o,p]);const[Cf,mf]=React.useState(!1),Sf=React.useCallback(()=>{mf(!0)},[]),Pf=React.useCallback((_f,wf,Yf)=>{var Ff;mf(!1);const Nf=(Ff=L.current)==null?void 0:Ff.layers.findById(_f),vf=Nf!=null&&Nf.property.default.location?"default.location":Nf!=null&&Nf.property.default.position?"default.position":void 0;Yf&&Nf&&Nf.propertyId&&vf&&(y==null||y(Nf.propertyId,vf,Yf))},[y,L]),Af=React.useMemo(()=>({interactionMode:Ra,selectedLayer:z,selectedComputedFeature:se,viewport:N,handleCameraForceHorizontalRollChange:La,handleInteractionModeChange:ma,onSketchPluginFeatureCreate:xf,onSketchPluginFeatureUpdate:Xd,onSketchPluginFeatureDelete:Zd,onSketchTypeChange:nf,onLayerVisibility:ms,onLayerLoad:pu,onLayerEdit:pi,onLayerSelectWithRectStart:Vd,onLayerSelectWithRectMove:ff,onLayerSelectWithRectEnd:of}),[Ra,z,se,N,ma,La,pi,xf,Xd,Zd,nf,ms,pu,Vd,ff,of]),Hf=React.useMemo(()=>({position:"relative",width:"100%",height:"100%",overflow:"hidden"}),[]);return useCoreAPI({viewerProperty:s}),{mapRef:L,wrapperRef:F,selectedFeature:nt,camera:_i,featureFlags:yt,isLayerDragging:Cf,timelineManagerRef:mn,cameraForceHorizontalRoll:Sa,coreContextValue:Af,containerStyle:Hf,overriddenInteractionMode:Ra,handleLayerSelect:kt,handleLayerDrag:Sf,handleLayerDrop:Pf,handleLayerEdit:ba,handleCameraChange:zi,handleInteractionModeChange:ma,handleSketchPluginFeatureCreate:Wa,handleSketchPluginFeatureUpdate:gd,handleSketchPluginFeatureDelete:cf,handleSketchTypeChange:df,handleLayerVisibility:Xs,handleLayerLoad:yu,handleLayerSelectWithRectStart:Gd,handleLayerSelectWithRectMove:pf,handleLayerSelectWithRectEnd:gf}}function useValue(t,n){const[o,s]=React.useState(t),c=React.useCallback(d=>{d&&(s(d),n==null||n(d))},[n]);return React.useEffect(()=>{s(t)},[t]),[o,c]}const CoreVisualizer=React.memo(React.forwardRef(({engine:t,isBuilt:n,isEditable:o,viewerProperty:s,layers:c,clusters:d,small:h,ready:p,hiddenLayers:y,camera:S,time:P,interactionMode:L,shouldRender:F,meta:N,displayCredits:z=!0,style:W,zoomedLayerId:nt,children:Pe,onLayerDrop:se,onLayerSelect:mt,onCameraChange:kt,onZoomToLayer:mn,onInteractionModeChange:_i,onMount:zi,onSketchTypeChangeProp:Sa,onSketchFeatureCreate:fa,onSketchFeatureUpdate:La,onSketchFeatureDelete:Ra,onAPIReady:ma,onCreditsUpdate:yt},lt)=>{const{mapRef:pi,wrapperRef:ba,selectedFeature:Sc,camera:ms,featureFlags:Xs,isLayerDragging:Nl,timelineManagerRef:pu,cameraForceHorizontalRoll:yu,coreContextValue:Ru,containerStyle:Vd,overriddenInteractionMode:Gd,handleLayerSelect:uf,handleLayerDrag:ff,handleLayerDrop:pf,handleLayerEdit:hf,handleCameraChange:of,handleInteractionModeChange:gf,handleSketchPluginFeatureCreate:Ef,handleSketchPluginFeatureUpdate:xf,handleSketchPluginFeatureDelete:Wa,handleSketchTypeChange:af,handleLayerVisibility:Xd,handleLayerLoad:gd,handleLayerSelectWithRectStart:pd,handleLayerSelectWithRectMove:Zd,handleLayerSelectWithRectEnd:cf}=useHooks({camera:S,interactionMode:L,zoomedLayerId:nt,viewerProperty:s,onLayerSelect:mt,onCameraChange:kt,onZoomToLayer:mn,onLayerDrop:se,onInteractionModeChange:_i,onSketchTypeChangeProp:Sa},lt);return jsxRuntimeExports.jsx(ErrorBoundary,{FallbackComponent:Error$1,children:jsxRuntimeExports.jsx(VisualizerProvider,{mapRef:pi,children:jsxRuntimeExports.jsxs("div",{ref:ba,style:Vd,children:[jsxRuntimeExports.jsx(Map$1,{ref:pi,isBuilt:n,isEditable:o,engine:t,layers:c,engines,camera:ms,cameraForceHorizontalRoll:yu,clusters:d,hiddenLayers:y,isLayerDragging:Nl,isLayerDraggable:o,meta:N,displayCredits:z,style:W,featureFlags:Xs,shouldRender:F,property:s,time:P,small:h,ready:p,timelineManagerRef:pu,interactionMode:Gd,selectedFeature:Sc,onCameraChange:of,onLayerDrag:ff,onLayerDrop:pf,onLayerSelect:uf,onLayerEdit:hf,overrideInteractionMode:gf,onSketchFeatureCreate:fa,onSketchPluginFeatureCreate:Ef,onSketchFeatureUpdate:La,onSketchPluginFeatureUpdate:xf,onSketchFeatureDelete:Ra,onSketchPluginFeatureDelete:Wa,onSketchTypeChange:af,onMount:zi,onLayerVisibility:Xd,onLayerLoad:gd,onLayerSelectWithRectStart:pd,onLayerSelectWithRectMove:Zd,onLayerSelectWithRectEnd:cf,onAPIReady:ma,onCreditsUpdate:yt}),jsxRuntimeExports.jsx(coreContext.Provider,{value:Ru,children:Pe})]})})})}));var global$1=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,inited=!1;function init(){inited=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=t.length;n<o;++n)lookup[n]=t[n],revLookup[t.charCodeAt(n)]=n;revLookup[45]=62,revLookup[95]=63}function toByteArray(t){inited||init();var n,o,s,c,d,h,p=t.length;if(p%4>0)throw new Error("Invalid string. Length must be a multiple of 4");d=t[p-2]==="="?2:t[p-1]==="="?1:0,h=new Arr(p*3/4-d),s=d>0?p-4:p;var y=0;for(n=0,o=0;n<s;n+=4,o+=3)c=revLookup[t.charCodeAt(n)]<<18|revLookup[t.charCodeAt(n+1)]<<12|revLookup[t.charCodeAt(n+2)]<<6|revLookup[t.charCodeAt(n+3)],h[y++]=c>>16&255,h[y++]=c>>8&255,h[y++]=c&255;return d===2?(c=revLookup[t.charCodeAt(n)]<<2|revLookup[t.charCodeAt(n+1)]>>4,h[y++]=c&255):d===1&&(c=revLookup[t.charCodeAt(n)]<<10|revLookup[t.charCodeAt(n+1)]<<4|revLookup[t.charCodeAt(n+2)]>>2,h[y++]=c>>8&255,h[y++]=c&255),h}function tripletToBase64(t){return lookup[t>>18&63]+lookup[t>>12&63]+lookup[t>>6&63]+lookup[t&63]}function encodeChunk(t,n,o){for(var s,c=[],d=n;d<o;d+=3)s=(t[d]<<16)+(t[d+1]<<8)+t[d+2],c.push(tripletToBase64(s));return c.join("")}function fromByteArray(t){inited||init();for(var n,o=t.length,s=o%3,c="",d=[],h=16383,p=0,y=o-s;p<y;p+=h)d.push(encodeChunk(t,p,p+h>y?y:p+h));return s===1?(n=t[o-1],c+=lookup[n>>2],c+=lookup[n<<4&63],c+="=="):s===2&&(n=(t[o-2]<<8)+t[o-1],c+=lookup[n>>10],c+=lookup[n>>4&63],c+=lookup[n<<2&63],c+="="),d.push(c),d.join("")}function read(t,n,o,s,c){var d,h,p=c*8-s-1,y=(1<<p)-1,S=y>>1,P=-7,L=o?c-1:0,F=o?-1:1,N=t[n+L];for(L+=F,d=N&(1<<-P)-1,N>>=-P,P+=p;P>0;d=d*256+t[n+L],L+=F,P-=8);for(h=d&(1<<-P)-1,d>>=-P,P+=s;P>0;h=h*256+t[n+L],L+=F,P-=8);if(d===0)d=1-S;else{if(d===y)return h?NaN:(N?-1:1)*(1/0);h=h+Math.pow(2,s),d=d-S}return(N?-1:1)*h*Math.pow(2,d-s)}function write(t,n,o,s,c,d){var h,p,y,S=d*8-c-1,P=(1<<S)-1,L=P>>1,F=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=s?0:d-1,z=s?1:-1,W=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(p=isNaN(n)?1:0,h=P):(h=Math.floor(Math.log(n)/Math.LN2),n*(y=Math.pow(2,-h))<1&&(h--,y*=2),h+L>=1?n+=F/y:n+=F*Math.pow(2,1-L),n*y>=2&&(h++,y/=2),h+L>=P?(p=0,h=P):h+L>=1?(p=(n*y-1)*Math.pow(2,c),h=h+L):(p=n*Math.pow(2,L-1)*Math.pow(2,c),h=0));c>=8;t[o+N]=p&255,N+=z,p/=256,c-=8);for(h=h<<c|p,S+=c;S>0;t[o+N]=h&255,N+=z,h/=256,S-=8);t[o+N-z]|=W*128}var toString={}.toString,isArray$1=Array.isArray||function(t){return toString.call(t)=="[object Array]"},INSPECT_MAX_BYTES=50;Buffer$1.TYPED_ARRAY_SUPPORT=global$1.TYPED_ARRAY_SUPPORT!==void 0?global$1.TYPED_ARRAY_SUPPORT:!0,kMaxLength();function kMaxLength(){return Buffer$1.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function createBuffer(t,n){if(kMaxLength()<n)throw new RangeError("Invalid typed array length");return Buffer$1.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(n),t.__proto__=Buffer$1.prototype):(t===null&&(t=new Buffer$1(n)),t.length=n),t}function Buffer$1(t,n,o){if(!Buffer$1.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer$1))return new Buffer$1(t,n,o);if(typeof t=="number"){if(typeof n=="string")throw new Error("If encoding is specified then the first argument must be a string");return allocUnsafe(this,t)}return from(this,t,n,o)}Buffer$1.poolSize=8192,Buffer$1._augment=function(t){return t.__proto__=Buffer$1.prototype,t};function from(t,n,o,s){if(typeof n=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&n instanceof ArrayBuffer?fromArrayBuffer(t,n,o,s):typeof n=="string"?fromString(t,n,o):fromObject(t,n)}Buffer$1.from=function(t,n,o){return from(null,t,n,o)},Buffer$1.TYPED_ARRAY_SUPPORT&&(Buffer$1.prototype.__proto__=Uint8Array.prototype,Buffer$1.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&Buffer$1[Symbol.species]);function assertSize(t){if(typeof t!="number")throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function alloc(t,n,o,s){return assertSize(n),n<=0?createBuffer(t,n):o!==void 0?typeof s=="string"?createBuffer(t,n).fill(o,s):createBuffer(t,n).fill(o):createBuffer(t,n)}Buffer$1.alloc=function(t,n,o){return alloc(null,t,n,o)};function allocUnsafe(t,n){if(assertSize(n),t=createBuffer(t,n<0?0:checked(n)|0),!Buffer$1.TYPED_ARRAY_SUPPORT)for(var o=0;o<n;++o)t[o]=0;return t}Buffer$1.allocUnsafe=function(t){return allocUnsafe(null,t)},Buffer$1.allocUnsafeSlow=function(t){return allocUnsafe(null,t)};function fromString(t,n,o){if((typeof o!="string"||o==="")&&(o="utf8"),!Buffer$1.isEncoding(o))throw new TypeError('"encoding" must be a valid string encoding');var s=byteLength(n,o)|0;t=createBuffer(t,s);var c=t.write(n,o);return c!==s&&(t=t.slice(0,c)),t}function fromArrayLike(t,n){var o=n.length<0?0:checked(n.length)|0;t=createBuffer(t,o);for(var s=0;s<o;s+=1)t[s]=n[s]&255;return t}function fromArrayBuffer(t,n,o,s){if(n.byteLength,o<0||n.byteLength<o)throw new RangeError("'offset' is out of bounds");if(n.byteLength<o+(s||0))throw new RangeError("'length' is out of bounds");return o===void 0&&s===void 0?n=new Uint8Array(n):s===void 0?n=new Uint8Array(n,o):n=new Uint8Array(n,o,s),Buffer$1.TYPED_ARRAY_SUPPORT?(t=n,t.__proto__=Buffer$1.prototype):t=fromArrayLike(t,n),t}function fromObject(t,n){if(internalIsBuffer(n)){var o=checked(n.length)|0;return t=createBuffer(t,o),t.length===0||n.copy(t,0,0,o),t}if(n){if(typeof ArrayBuffer<"u"&&n.buffer instanceof ArrayBuffer||"length"in n)return typeof n.length!="number"||isnan(n.length)?createBuffer(t,0):fromArrayLike(t,n);if(n.type==="Buffer"&&isArray$1(n.data))return fromArrayLike(t,n.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function checked(t){if(t>=kMaxLength())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+kMaxLength().toString(16)+" bytes");return t|0}Buffer$1.isBuffer=isBuffer;function internalIsBuffer(t){return!!(t!=null&&t._isBuffer)}Buffer$1.compare=function t(n,o){if(!internalIsBuffer(n)||!internalIsBuffer(o))throw new TypeError("Arguments must be Buffers");if(n===o)return 0;for(var s=n.length,c=o.length,d=0,h=Math.min(s,c);d<h;++d)if(n[d]!==o[d]){s=n[d],c=o[d];break}return s<c?-1:c<s?1:0},Buffer$1.isEncoding=function t(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer$1.concat=function t(n,o){if(!isArray$1(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return Buffer$1.alloc(0);var s;if(o===void 0)for(o=0,s=0;s<n.length;++s)o+=n[s].length;var c=Buffer$1.allocUnsafe(o),d=0;for(s=0;s<n.length;++s){var h=n[s];if(!internalIsBuffer(h))throw new TypeError('"list" argument must be an Array of Buffers');h.copy(c,d),d+=h.length}return c};function byteLength(t,n){if(internalIsBuffer(t))return t.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;typeof t!="string"&&(t=""+t);var o=t.length;if(o===0)return 0;for(var s=!1;;)switch(n){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":case void 0:return utf8ToBytes(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return base64ToBytes(t).length;default:if(s)return utf8ToBytes(t).length;n=(""+n).toLowerCase(),s=!0}}Buffer$1.byteLength=byteLength;function slowToString(t,n,o){var s=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((o===void 0||o>this.length)&&(o=this.length),o<=0)||(o>>>=0,n>>>=0,o<=n))return"";for(t||(t="utf8");;)switch(t){case"hex":return hexSlice(this,n,o);case"utf8":case"utf-8":return utf8Slice(this,n,o);case"ascii":return asciiSlice(this,n,o);case"latin1":case"binary":return latin1Slice(this,n,o);case"base64":return base64Slice(this,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return utf16leSlice(this,n,o);default:if(s)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),s=!0}}Buffer$1.prototype._isBuffer=!0;function swap(t,n,o){var s=t[n];t[n]=t[o],t[o]=s}Buffer$1.prototype.swap16=function t(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var o=0;o<n;o+=2)swap(this,o,o+1);return this},Buffer$1.prototype.swap32=function t(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var o=0;o<n;o+=4)swap(this,o,o+3),swap(this,o+1,o+2);return this},Buffer$1.prototype.swap64=function t(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var o=0;o<n;o+=8)swap(this,o,o+7),swap(this,o+1,o+6),swap(this,o+2,o+5),swap(this,o+3,o+4);return this},Buffer$1.prototype.toString=function t(){var n=this.length|0;return n===0?"":arguments.length===0?utf8Slice(this,0,n):slowToString.apply(this,arguments)},Buffer$1.prototype.equals=function t(n){if(!internalIsBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:Buffer$1.compare(this,n)===0},Buffer$1.prototype.inspect=function t(){var n="",o=INSPECT_MAX_BYTES;return this.length>0&&(n=this.toString("hex",0,o).match(/.{2}/g).join(" "),this.length>o&&(n+=" ... ")),"<Buffer "+n+">"},Buffer$1.prototype.compare=function t(n,o,s,c,d){if(!internalIsBuffer(n))throw new TypeError("Argument must be a Buffer");if(o===void 0&&(o=0),s===void 0&&(s=n?n.length:0),c===void 0&&(c=0),d===void 0&&(d=this.length),o<0||s>n.length||c<0||d>this.length)throw new RangeError("out of range index");if(c>=d&&o>=s)return 0;if(c>=d)return-1;if(o>=s)return 1;if(o>>>=0,s>>>=0,c>>>=0,d>>>=0,this===n)return 0;for(var h=d-c,p=s-o,y=Math.min(h,p),S=this.slice(c,d),P=n.slice(o,s),L=0;L<y;++L)if(S[L]!==P[L]){h=S[L],p=P[L];break}return h<p?-1:p<h?1:0};function bidirectionalIndexOf(t,n,o,s,c){if(t.length===0)return-1;if(typeof o=="string"?(s=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,isNaN(o)&&(o=c?0:t.length-1),o<0&&(o=t.length+o),o>=t.length){if(c)return-1;o=t.length-1}else if(o<0)if(c)o=0;else return-1;if(typeof n=="string"&&(n=Buffer$1.from(n,s)),internalIsBuffer(n))return n.length===0?-1:arrayIndexOf(t,n,o,s,c);if(typeof n=="number")return n=n&255,Buffer$1.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?c?Uint8Array.prototype.indexOf.call(t,n,o):Uint8Array.prototype.lastIndexOf.call(t,n,o):arrayIndexOf(t,[n],o,s,c);throw new TypeError("val must be string, number or Buffer")}function arrayIndexOf(t,n,o,s,c){var d=1,h=t.length,p=n.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(t.length<2||n.length<2)return-1;d=2,h/=2,p/=2,o/=2}function y(N,z){return d===1?N[z]:N.readUInt16BE(z*d)}var S;if(c){var P=-1;for(S=o;S<h;S++)if(y(t,S)===y(n,P===-1?0:S-P)){if(P===-1&&(P=S),S-P+1===p)return P*d}else P!==-1&&(S-=S-P),P=-1}else for(o+p>h&&(o=h-p),S=o;S>=0;S--){for(var L=!0,F=0;F<p;F++)if(y(t,S+F)!==y(n,F)){L=!1;break}if(L)return S}return-1}Buffer$1.prototype.includes=function t(n,o,s){return this.indexOf(n,o,s)!==-1},Buffer$1.prototype.indexOf=function t(n,o,s){return bidirectionalIndexOf(this,n,o,s,!0)},Buffer$1.prototype.lastIndexOf=function t(n,o,s){return bidirectionalIndexOf(this,n,o,s,!1)};function hexWrite(t,n,o,s){o=Number(o)||0;var c=t.length-o;s?(s=Number(s),s>c&&(s=c)):s=c;var d=n.length;if(d%2!==0)throw new TypeError("Invalid hex string");s>d/2&&(s=d/2);for(var h=0;h<s;++h){var p=parseInt(n.substr(h*2,2),16);if(isNaN(p))return h;t[o+h]=p}return h}function utf8Write(t,n,o,s){return blitBuffer(utf8ToBytes(n,t.length-o),t,o,s)}function asciiWrite(t,n,o,s){return blitBuffer(asciiToBytes(n),t,o,s)}function latin1Write(t,n,o,s){return asciiWrite(t,n,o,s)}function base64Write(t,n,o,s){return blitBuffer(base64ToBytes(n),t,o,s)}function ucs2Write(t,n,o,s){return blitBuffer(utf16leToBytes(n,t.length-o),t,o,s)}Buffer$1.prototype.write=function t(n,o,s,c){if(o===void 0)c="utf8",s=this.length,o=0;else if(s===void 0&&typeof o=="string")c=o,s=this.length,o=0;else if(isFinite(o))o=o|0,isFinite(s)?(s=s|0,c===void 0&&(c="utf8")):(c=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var d=this.length-o;if((s===void 0||s>d)&&(s=d),n.length>0&&(s<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");for(var h=!1;;)switch(c){case"hex":return hexWrite(this,n,o,s);case"utf8":case"utf-8":return utf8Write(this,n,o,s);case"ascii":return asciiWrite(this,n,o,s);case"latin1":case"binary":return latin1Write(this,n,o,s);case"base64":return base64Write(this,n,o,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ucs2Write(this,n,o,s);default:if(h)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),h=!0}},Buffer$1.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function base64Slice(t,n,o){return n===0&&o===t.length?fromByteArray(t):fromByteArray(t.slice(n,o))}function utf8Slice(t,n,o){o=Math.min(t.length,o);for(var s=[],c=n;c<o;){var d=t[c],h=null,p=d>239?4:d>223?3:d>191?2:1;if(c+p<=o){var y,S,P,L;switch(p){case 1:d<128&&(h=d);break;case 2:y=t[c+1],(y&192)===128&&(L=(d&31)<<6|y&63,L>127&&(h=L));break;case 3:y=t[c+1],S=t[c+2],(y&192)===128&&(S&192)===128&&(L=(d&15)<<12|(y&63)<<6|S&63,L>2047&&(L<55296||L>57343)&&(h=L));break;case 4:y=t[c+1],S=t[c+2],P=t[c+3],(y&192)===128&&(S&192)===128&&(P&192)===128&&(L=(d&15)<<18|(y&63)<<12|(S&63)<<6|P&63,L>65535&&L<1114112&&(h=L))}}h===null?(h=65533,p=1):h>65535&&(h-=65536,s.push(h>>>10&1023|55296),h=56320|h&1023),s.push(h),c+=p}return decodeCodePointsArray(s)}var MAX_ARGUMENTS_LENGTH=4096;function decodeCodePointsArray(t){var n=t.length;if(n<=MAX_ARGUMENTS_LENGTH)return String.fromCharCode.apply(String,t);for(var o="",s=0;s<n;)o+=String.fromCharCode.apply(String,t.slice(s,s+=MAX_ARGUMENTS_LENGTH));return o}function asciiSlice(t,n,o){var s="";o=Math.min(t.length,o);for(var c=n;c<o;++c)s+=String.fromCharCode(t[c]&127);return s}function latin1Slice(t,n,o){var s="";o=Math.min(t.length,o);for(var c=n;c<o;++c)s+=String.fromCharCode(t[c]);return s}function hexSlice(t,n,o){var s=t.length;(!n||n<0)&&(n=0),(!o||o<0||o>s)&&(o=s);for(var c="",d=n;d<o;++d)c+=toHex(t[d]);return c}function utf16leSlice(t,n,o){for(var s=t.slice(n,o),c="",d=0;d<s.length;d+=2)c+=String.fromCharCode(s[d]+s[d+1]*256);return c}Buffer$1.prototype.slice=function t(n,o){var s=this.length;n=~~n,o=o===void 0?s:~~o,n<0?(n+=s,n<0&&(n=0)):n>s&&(n=s),o<0?(o+=s,o<0&&(o=0)):o>s&&(o=s),o<n&&(o=n);var c;if(Buffer$1.TYPED_ARRAY_SUPPORT)c=this.subarray(n,o),c.__proto__=Buffer$1.prototype;else{var d=o-n;c=new Buffer$1(d,void 0);for(var h=0;h<d;++h)c[h]=this[h+n]}return c};function checkOffset(t,n,o){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+n>o)throw new RangeError("Trying to access beyond buffer length")}Buffer$1.prototype.readUIntLE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n],d=1,h=0;++h<o&&(d*=256);)c+=this[n+h]*d;return c},Buffer$1.prototype.readUIntBE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n+--o],d=1;o>0&&(d*=256);)c+=this[n+--o]*d;return c},Buffer$1.prototype.readUInt8=function t(n,o){return o||checkOffset(n,1,this.length),this[n]},Buffer$1.prototype.readUInt16LE=function t(n,o){return o||checkOffset(n,2,this.length),this[n]|this[n+1]<<8},Buffer$1.prototype.readUInt16BE=function t(n,o){return o||checkOffset(n,2,this.length),this[n]<<8|this[n+1]},Buffer$1.prototype.readUInt32LE=function t(n,o){return o||checkOffset(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},Buffer$1.prototype.readUInt32BE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},Buffer$1.prototype.readIntLE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=this[n],d=1,h=0;++h<o&&(d*=256);)c+=this[n+h]*d;return d*=128,c>=d&&(c-=Math.pow(2,8*o)),c},Buffer$1.prototype.readIntBE=function t(n,o,s){n=n|0,o=o|0,s||checkOffset(n,o,this.length);for(var c=o,d=1,h=this[n+--c];c>0&&(d*=256);)h+=this[n+--c]*d;return d*=128,h>=d&&(h-=Math.pow(2,8*o)),h},Buffer$1.prototype.readInt8=function t(n,o){return o||checkOffset(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},Buffer$1.prototype.readInt16LE=function t(n,o){o||checkOffset(n,2,this.length);var s=this[n]|this[n+1]<<8;return s&32768?s|4294901760:s},Buffer$1.prototype.readInt16BE=function t(n,o){o||checkOffset(n,2,this.length);var s=this[n+1]|this[n]<<8;return s&32768?s|4294901760:s},Buffer$1.prototype.readInt32LE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},Buffer$1.prototype.readInt32BE=function t(n,o){return o||checkOffset(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},Buffer$1.prototype.readFloatLE=function t(n,o){return o||checkOffset(n,4,this.length),read(this,n,!0,23,4)},Buffer$1.prototype.readFloatBE=function t(n,o){return o||checkOffset(n,4,this.length),read(this,n,!1,23,4)},Buffer$1.prototype.readDoubleLE=function t(n,o){return o||checkOffset(n,8,this.length),read(this,n,!0,52,8)},Buffer$1.prototype.readDoubleBE=function t(n,o){return o||checkOffset(n,8,this.length),read(this,n,!1,52,8)};function checkInt(t,n,o,s,c,d){if(!internalIsBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>c||n<d)throw new RangeError('"value" argument is out of bounds');if(o+s>t.length)throw new RangeError("Index out of range")}Buffer$1.prototype.writeUIntLE=function t(n,o,s,c){if(n=+n,o=o|0,s=s|0,!c){var d=Math.pow(2,8*s)-1;checkInt(this,n,o,s,d,0)}var h=1,p=0;for(this[o]=n&255;++p<s&&(h*=256);)this[o+p]=n/h&255;return o+s},Buffer$1.prototype.writeUIntBE=function t(n,o,s,c){if(n=+n,o=o|0,s=s|0,!c){var d=Math.pow(2,8*s)-1;checkInt(this,n,o,s,d,0)}var h=s-1,p=1;for(this[o+h]=n&255;--h>=0&&(p*=256);)this[o+h]=n/p&255;return o+s},Buffer$1.prototype.writeUInt8=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,1,255,0),Buffer$1.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[o]=n&255,o+1};function objectWriteUInt16(t,n,o,s){n<0&&(n=65535+n+1);for(var c=0,d=Math.min(t.length-o,2);c<d;++c)t[o+c]=(n&255<<8*(s?c:1-c))>>>(s?c:1-c)*8}Buffer$1.prototype.writeUInt16LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8):objectWriteUInt16(this,n,o,!0),o+2},Buffer$1.prototype.writeUInt16BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,65535,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>8,this[o+1]=n&255):objectWriteUInt16(this,n,o,!1),o+2};function objectWriteUInt32(t,n,o,s){n<0&&(n=4294967295+n+1);for(var c=0,d=Math.min(t.length-o,4);c<d;++c)t[o+c]=n>>>(s?c:3-c)*8&255}Buffer$1.prototype.writeUInt32LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o+3]=n>>>24,this[o+2]=n>>>16,this[o+1]=n>>>8,this[o]=n&255):objectWriteUInt32(this,n,o,!0),o+4},Buffer$1.prototype.writeUInt32BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,4294967295,0),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255):objectWriteUInt32(this,n,o,!1),o+4},Buffer$1.prototype.writeIntLE=function t(n,o,s,c){if(n=+n,o=o|0,!c){var d=Math.pow(2,8*s-1);checkInt(this,n,o,s,d-1,-d)}var h=0,p=1,y=0;for(this[o]=n&255;++h<s&&(p*=256);)n<0&&y===0&&this[o+h-1]!==0&&(y=1),this[o+h]=(n/p>>0)-y&255;return o+s},Buffer$1.prototype.writeIntBE=function t(n,o,s,c){if(n=+n,o=o|0,!c){var d=Math.pow(2,8*s-1);checkInt(this,n,o,s,d-1,-d)}var h=s-1,p=1,y=0;for(this[o+h]=n&255;--h>=0&&(p*=256);)n<0&&y===0&&this[o+h+1]!==0&&(y=1),this[o+h]=(n/p>>0)-y&255;return o+s},Buffer$1.prototype.writeInt8=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,1,127,-128),Buffer$1.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[o]=n&255,o+1},Buffer$1.prototype.writeInt16LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8):objectWriteUInt16(this,n,o,!0),o+2},Buffer$1.prototype.writeInt16BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,2,32767,-32768),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>8,this[o+1]=n&255):objectWriteUInt16(this,n,o,!1),o+2},Buffer$1.prototype.writeInt32LE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,2147483647,-2147483648),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n&255,this[o+1]=n>>>8,this[o+2]=n>>>16,this[o+3]=n>>>24):objectWriteUInt32(this,n,o,!0),o+4},Buffer$1.prototype.writeInt32BE=function t(n,o,s){return n=+n,o=o|0,s||checkInt(this,n,o,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),Buffer$1.TYPED_ARRAY_SUPPORT?(this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255):objectWriteUInt32(this,n,o,!1),o+4};function checkIEEE754(t,n,o,s,c,d){if(o+s>t.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function writeFloat(t,n,o,s,c){return c||checkIEEE754(t,n,o,4),write(t,n,o,s,23,4),o+4}Buffer$1.prototype.writeFloatLE=function t(n,o,s){return writeFloat(this,n,o,!0,s)},Buffer$1.prototype.writeFloatBE=function t(n,o,s){return writeFloat(this,n,o,!1,s)};function writeDouble(t,n,o,s,c){return c||checkIEEE754(t,n,o,8),write(t,n,o,s,52,8),o+8}Buffer$1.prototype.writeDoubleLE=function t(n,o,s){return writeDouble(this,n,o,!0,s)},Buffer$1.prototype.writeDoubleBE=function t(n,o,s){return writeDouble(this,n,o,!1,s)},Buffer$1.prototype.copy=function t(n,o,s,c){if(s||(s=0),!c&&c!==0&&(c=this.length),o>=n.length&&(o=n.length),o||(o=0),c>0&&c<s&&(c=s),c===s||n.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("sourceStart out of bounds");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),n.length-o<c-s&&(c=n.length-o+s);var d=c-s,h;if(this===n&&s<o&&o<c)for(h=d-1;h>=0;--h)n[h+o]=this[h+s];else if(d<1e3||!Buffer$1.TYPED_ARRAY_SUPPORT)for(h=0;h<d;++h)n[h+o]=this[h+s];else Uint8Array.prototype.set.call(n,this.subarray(s,s+d),o);return d},Buffer$1.prototype.fill=function t(n,o,s,c){if(typeof n=="string"){if(typeof o=="string"?(c=o,o=0,s=this.length):typeof s=="string"&&(c=s,s=this.length),n.length===1){var d=n.charCodeAt(0);d<256&&(n=d)}if(c!==void 0&&typeof c!="string")throw new TypeError("encoding must be a string");if(typeof c=="string"&&!Buffer$1.isEncoding(c))throw new TypeError("Unknown encoding: "+c)}else typeof n=="number"&&(n=n&255);if(o<0||this.length<o||this.length<s)throw new RangeError("Out of range index");if(s<=o)return this;o=o>>>0,s=s===void 0?this.length:s>>>0,n||(n=0);var h;if(typeof n=="number")for(h=o;h<s;++h)this[h]=n;else{var p=internalIsBuffer(n)?n:utf8ToBytes(new Buffer$1(n,c).toString()),y=p.length;for(h=0;h<s-o;++h)this[h+o]=p[h%y]}return this};var INVALID_BASE64_RE=/[^+\/0-9A-Za-z-_]/g;function base64clean(t){if(t=stringtrim(t).replace(INVALID_BASE64_RE,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function stringtrim(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function toHex(t){return t<16?"0"+t.toString(16):t.toString(16)}function utf8ToBytes(t,n){n=n||1/0;for(var o,s=t.length,c=null,d=[],h=0;h<s;++h){if(o=t.charCodeAt(h),o>55295&&o<57344){if(!c){if(o>56319){(n-=3)>-1&&d.push(239,191,189);continue}else if(h+1===s){(n-=3)>-1&&d.push(239,191,189);continue}c=o;continue}if(o<56320){(n-=3)>-1&&d.push(239,191,189),c=o;continue}o=(c-55296<<10|o-56320)+65536}else c&&(n-=3)>-1&&d.push(239,191,189);if(c=null,o<128){if((n-=1)<0)break;d.push(o)}else if(o<2048){if((n-=2)<0)break;d.push(o>>6|192,o&63|128)}else if(o<65536){if((n-=3)<0)break;d.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((n-=4)<0)break;d.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return d}function asciiToBytes(t){for(var n=[],o=0;o<t.length;++o)n.push(t.charCodeAt(o)&255);return n}function utf16leToBytes(t,n){for(var o,s,c,d=[],h=0;h<t.length&&!((n-=2)<0);++h)o=t.charCodeAt(h),s=o>>8,c=o%256,d.push(c),d.push(s);return d}function base64ToBytes(t){return toByteArray(base64clean(t))}function blitBuffer(t,n,o,s){for(var c=0;c<s&&!(c+o>=n.length||c>=t.length);++c)n[c+o]=t[c];return c}function isnan(t){return t!==t}function isBuffer(t){return t!=null&&(!!t._isBuffer||isFastBuffer(t)||isSlowBuffer(t))}function isFastBuffer(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function isSlowBuffer(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&isFastBuffer(t.slice(0,0))}var domain;function EventHandlers(){}EventHandlers.prototype=Object.create(null);function EventEmitter(){EventEmitter.init.call(this)}EventEmitter.EventEmitter=EventEmitter,EventEmitter.usingDomains=!1,EventEmitter.prototype.domain=void 0,EventEmitter.prototype._events=void 0,EventEmitter.prototype._maxListeners=void 0,EventEmitter.defaultMaxListeners=10,EventEmitter.init=function(){this.domain=null,EventEmitter.usingDomains&&domain.active,(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new EventHandlers,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},EventEmitter.prototype.setMaxListeners=function t(n){if(typeof n!="number"||n<0||isNaN(n))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=n,this};function $getMaxListeners(t){return t._maxListeners===void 0?EventEmitter.defaultMaxListeners:t._maxListeners}EventEmitter.prototype.getMaxListeners=function t(){return $getMaxListeners(this)};function emitNone(t,n,o){if(n)t.call(o);else for(var s=t.length,c=arrayClone(t,s),d=0;d<s;++d)c[d].call(o)}function emitOne(t,n,o,s){if(n)t.call(o,s);else for(var c=t.length,d=arrayClone(t,c),h=0;h<c;++h)d[h].call(o,s)}function emitTwo(t,n,o,s,c){if(n)t.call(o,s,c);else for(var d=t.length,h=arrayClone(t,d),p=0;p<d;++p)h[p].call(o,s,c)}function emitThree(t,n,o,s,c,d){if(n)t.call(o,s,c,d);else for(var h=t.length,p=arrayClone(t,h),y=0;y<h;++y)p[y].call(o,s,c,d)}function emitMany(t,n,o,s){if(n)t.apply(o,s);else for(var c=t.length,d=arrayClone(t,c),h=0;h<c;++h)d[h].apply(o,s)}EventEmitter.prototype.emit=function t(n){var o,s,c,d,h,p,y,S=n==="error";if(p=this._events,p)S=S&&p.error==null;else if(!S)return!1;if(y=this.domain,S){if(o=arguments[1],y)o||(o=new Error('Uncaught, unspecified "error" event')),o.domainEmitter=this,o.domain=y,o.domainThrown=!1,y.emit("error",o);else{if(o instanceof Error)throw o;var P=new Error('Uncaught, unspecified "error" event. ('+o+")");throw P.context=o,P}return!1}if(s=p[n],!s)return!1;var L=typeof s=="function";switch(c=arguments.length,c){case 1:emitNone(s,L,this);break;case 2:emitOne(s,L,this,arguments[1]);break;case 3:emitTwo(s,L,this,arguments[1],arguments[2]);break;case 4:emitThree(s,L,this,arguments[1],arguments[2],arguments[3]);break;default:for(d=new Array(c-1),h=1;h<c;h++)d[h-1]=arguments[h];emitMany(s,L,this,d)}return!0};function _addListener(t,n,o,s){var c,d,h;if(typeof o!="function")throw new TypeError('"listener" argument must be a function');if(d=t._events,d?(d.newListener&&(t.emit("newListener",n,o.listener?o.listener:o),d=t._events),h=d[n]):(d=t._events=new EventHandlers,t._eventsCount=0),!h)h=d[n]=o,++t._eventsCount;else if(typeof h=="function"?h=d[n]=s?[o,h]:[h,o]:s?h.unshift(o):h.push(o),!h.warned&&(c=$getMaxListeners(t),c&&c>0&&h.length>c)){h.warned=!0;var p=new Error("Possible EventEmitter memory leak detected. "+h.length+" "+n+" listeners added. Use emitter.setMaxListeners() to increase limit");p.name="MaxListenersExceededWarning",p.emitter=t,p.type=n,p.count=h.length,emitWarning(p)}return t}function emitWarning(t){typeof console.warn=="function"?console.warn(t):console.log(t)}EventEmitter.prototype.addListener=function t(n,o){return _addListener(this,n,o,!1)},EventEmitter.prototype.on=EventEmitter.prototype.addListener,EventEmitter.prototype.prependListener=function t(n,o){return _addListener(this,n,o,!0)};function _onceWrap(t,n,o){var s=!1;function c(){t.removeListener(n,c),s||(s=!0,o.apply(t,arguments))}return c.listener=o,c}EventEmitter.prototype.once=function t(n,o){if(typeof o!="function")throw new TypeError('"listener" argument must be a function');return this.on(n,_onceWrap(this,n,o)),this},EventEmitter.prototype.prependOnceListener=function t(n,o){if(typeof o!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(n,_onceWrap(this,n,o)),this},EventEmitter.prototype.removeListener=function t(n,o){var s,c,d,h,p;if(typeof o!="function")throw new TypeError('"listener" argument must be a function');if(c=this._events,!c)return this;if(s=c[n],!s)return this;if(s===o||s.listener&&s.listener===o)--this._eventsCount===0?this._events=new EventHandlers:(delete c[n],c.removeListener&&this.emit("removeListener",n,s.listener||o));else if(typeof s!="function"){for(d=-1,h=s.length;h-- >0;)if(s[h]===o||s[h].listener&&s[h].listener===o){p=s[h].listener,d=h;break}if(d<0)return this;if(s.length===1){if(s[0]=void 0,--this._eventsCount===0)return this._events=new EventHandlers,this;delete c[n]}else spliceOne(s,d);c.removeListener&&this.emit("removeListener",n,p||o)}return this},EventEmitter.prototype.removeAllListeners=function t(n){var o,s;if(s=this._events,!s)return this;if(!s.removeListener)return arguments.length===0?(this._events=new EventHandlers,this._eventsCount=0):s[n]&&(--this._eventsCount===0?this._events=new EventHandlers:delete s[n]),this;if(arguments.length===0){for(var c=Object.keys(s),d=0,h;d<c.length;++d)h=c[d],h!=="removeListener"&&this.removeAllListeners(h);return this.removeAllListeners("removeListener"),this._events=new EventHandlers,this._eventsCount=0,this}if(o=s[n],typeof o=="function")this.removeListener(n,o);else if(o)do this.removeListener(n,o[o.length-1]);while(o[0]);return this},EventEmitter.prototype.listeners=function t(n){var o,s,c=this._events;return c?(o=c[n],o?typeof o=="function"?s=[o.listener||o]:s=unwrapListeners(o):s=[]):s=[],s},EventEmitter.listenerCount=function(t,n){return typeof t.listenerCount=="function"?t.listenerCount(n):listenerCount$1.call(t,n)},EventEmitter.prototype.listenerCount=listenerCount$1;function listenerCount$1(t){var n=this._events;if(n){var o=n[t];if(typeof o=="function")return 1;if(o)return o.length}return 0}EventEmitter.prototype.eventNames=function t(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function spliceOne(t,n){for(var o=n,s=o+1,c=t.length;s<c;o+=1,s+=1)t[o]=t[s];t.pop()}function arrayClone(t,n){for(var o=new Array(n);n--;)o[n]=t[n];return o}function unwrapListeners(t){for(var n=new Array(t.length),o=0;o<n.length;++o)n[o]=t[o].listener||t[o];return n}function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}var cachedSetTimeout=defaultSetTimout,cachedClearTimeout=defaultClearTimeout;typeof global$1.setTimeout=="function"&&(cachedSetTimeout=setTimeout),typeof global$1.clearTimeout=="function"&&(cachedClearTimeout=clearTimeout);function runTimeout(t){if(cachedSetTimeout===setTimeout)return setTimeout(t,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(t,0);try{return cachedSetTimeout(t,0)}catch{try{return cachedSetTimeout.call(null,t,0)}catch{return cachedSetTimeout.call(this,t,0)}}}function runClearTimeout(t){if(cachedClearTimeout===clearTimeout)return clearTimeout(t);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(t);try{return cachedClearTimeout(t)}catch{try{return cachedClearTimeout.call(null,t)}catch{return cachedClearTimeout.call(this,t)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var t=runTimeout(cleanUpNextTick);draining=!0;for(var n=queue.length;n;){for(currentQueue=queue,queue=[];++queueIndex<n;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,n=queue.length}currentQueue=null,draining=!1,runClearTimeout(t)}}function nextTick(t){var n=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)n[o-1]=arguments[o];queue.push(new Item(t,n)),queue.length===1&&!draining&&runTimeout(drainQueue)}function Item(t,n){this.fun=t,this.array=n}Item.prototype.run=function(){this.fun.apply(null,this.array)};var title="browser",platform="browser",browser=!0,env={},argv=[],version="",versions={},release={},config={};function noop(){}var on=noop,addListener=noop,once=noop,off=noop,removeListener=noop,removeAllListeners=noop,emit=noop;function binding(t){throw new Error("process.binding is not supported")}function cwd(){return"/"}function chdir(t){throw new Error("process.chdir is not supported")}function umask(){return 0}var performance$1=global$1.performance||{},performanceNow=performance$1.now||performance$1.mozNow||performance$1.msNow||performance$1.oNow||performance$1.webkitNow||function(){return new Date().getTime()};function hrtime(t){var n=performanceNow.call(performance$1)*.001,o=Math.floor(n),s=Math.floor(n%1*1e9);return t&&(o=o-t[0],s=s-t[1],s<0&&(o--,s+=1e9)),[o,s]}var startTime=new Date;function uptime(){var t=new Date,n=t-startTime;return n/1e3}var process$1={nextTick,title,browser,env,argv,version,versions,on,addListener,once,off,removeListener,removeAllListeners,emit,binding,cwd,chdir,umask,hrtime,platform,release,config,uptime},inherits;typeof Object.create=="function"?inherits=function(n,o){n.super_=o,n.prototype=Object.create(o.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}})}:inherits=function(n,o){n.super_=o;var s=function(){};s.prototype=o.prototype,n.prototype=new s,n.prototype.constructor=n};var inherits$1=inherits,formatRegExp=/%[sdj%]/g;function format(t){if(!isString(t)){for(var n=[],o=0;o<arguments.length;o++)n.push(inspect(arguments[o]));return n.join(" ")}for(var o=1,s=arguments,c=s.length,d=String(t).replace(formatRegExp,function(p){if(p==="%%")return"%";if(o>=c)return p;switch(p){case"%s":return String(s[o++]);case"%d":return Number(s[o++]);case"%j":try{return JSON.stringify(s[o++])}catch{return"[Circular]"}default:return p}}),h=s[o];o<c;h=s[++o])isNull(h)||!isObject(h)?d+=" "+h:d+=" "+inspect(h);return d}function deprecate(t,n){if(isUndefined(global$1.process))return function(){return deprecate(t,n).apply(this,arguments)};if(process$1.noDeprecation===!0)return t;var o=!1;function s(){if(!o){if(process$1.throwDeprecation)throw new Error(n);process$1.traceDeprecation?console.trace(n):console.error(n),o=!0}return t.apply(this,arguments)}return s}var debugs={},debugEnviron;function debuglog(t){if(isUndefined(debugEnviron)&&(debugEnviron=process$1.env.NODE_DEBUG||""),t=t.toUpperCase(),!debugs[t])if(new RegExp("\\b"+t+"\\b","i").test(debugEnviron)){var n=0;debugs[t]=function(){var o=format.apply(null,arguments);console.error("%s %d: %s",t,n,o)}}else debugs[t]=function(){};return debugs[t]}function inspect(t,n){var o={seen:[],stylize:stylizeNoColor};return arguments.length>=3&&(o.depth=arguments[2]),arguments.length>=4&&(o.colors=arguments[3]),isBoolean(n)?o.showHidden=n:n&&_extend(o,n),isUndefined(o.showHidden)&&(o.showHidden=!1),isUndefined(o.depth)&&(o.depth=2),isUndefined(o.colors)&&(o.colors=!1),isUndefined(o.customInspect)&&(o.customInspect=!0),o.colors&&(o.stylize=stylizeWithColor),formatValue(o,t,o.depth)}inspect.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},inspect.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function stylizeWithColor(t,n){var o=inspect.styles[n];return o?"\x1B["+inspect.colors[o][0]+"m"+t+"\x1B["+inspect.colors[o][1]+"m":t}function stylizeNoColor(t,n){return t}function arrayToHash(t){var n={};return t.forEach(function(o,s){n[o]=!0}),n}function formatValue(t,n,o){if(t.customInspect&&n&&isFunction(n.inspect)&&n.inspect!==inspect&&!(n.constructor&&n.constructor.prototype===n)){var s=n.inspect(o,t);return isString(s)||(s=formatValue(t,s,o)),s}var c=formatPrimitive(t,n);if(c)return c;var d=Object.keys(n),h=arrayToHash(d);if(t.showHidden&&(d=Object.getOwnPropertyNames(n)),isError(n)&&(d.indexOf("message")>=0||d.indexOf("description")>=0))return formatError(n);if(d.length===0){if(isFunction(n)){var p=n.name?": "+n.name:"";return t.stylize("[Function"+p+"]","special")}if(isRegExp(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(isDate(n))return t.stylize(Date.prototype.toString.call(n),"date");if(isError(n))return formatError(n)}var y="",S=!1,P=["{","}"];if(isArray(n)&&(S=!0,P=["[","]"]),isFunction(n)){var L=n.name?": "+n.name:"";y=" [Function"+L+"]"}if(isRegExp(n)&&(y=" "+RegExp.prototype.toString.call(n)),isDate(n)&&(y=" "+Date.prototype.toUTCString.call(n)),isError(n)&&(y=" "+formatError(n)),d.length===0&&(!S||n.length==0))return P[0]+y+P[1];if(o<0)return isRegExp(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var F;return S?F=formatArray(t,n,o,h,d):F=d.map(function(N){return formatProperty(t,n,o,h,N,S)}),t.seen.pop(),reduceToSingleString(F,y,P)}function formatPrimitive(t,n){if(isUndefined(n))return t.stylize("undefined","undefined");if(isString(n)){var o="'"+JSON.stringify(n).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(o,"string")}if(isNumber(n))return t.stylize(""+n,"number");if(isBoolean(n))return t.stylize(""+n,"boolean");if(isNull(n))return t.stylize("null","null")}function formatError(t){return"["+Error.prototype.toString.call(t)+"]"}function formatArray(t,n,o,s,c){for(var d=[],h=0,p=n.length;h<p;++h)hasOwnProperty(n,String(h))?d.push(formatProperty(t,n,o,s,String(h),!0)):d.push("");return c.forEach(function(y){y.match(/^\d+$/)||d.push(formatProperty(t,n,o,s,y,!0))}),d}function formatProperty(t,n,o,s,c,d){var h,p,y;if(y=Object.getOwnPropertyDescriptor(n,c)||{value:n[c]},y.get?y.set?p=t.stylize("[Getter/Setter]","special"):p=t.stylize("[Getter]","special"):y.set&&(p=t.stylize("[Setter]","special")),hasOwnProperty(s,c)||(h="["+c+"]"),p||(t.seen.indexOf(y.value)<0?(isNull(o)?p=formatValue(t,y.value,null):p=formatValue(t,y.value,o-1),p.indexOf(`
|
|
6746
6746
|
`)>-1&&(d?p=p.split(`
|
|
6747
6747
|
`).map(function(S){return" "+S}).join(`
|
|
6748
6748
|
`).substr(2):p=`
|