@reearth/core 0.0.7-alpha.3 → 0.0.7-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.umd.cjs
CHANGED
|
@@ -5791,7 +5791,7 @@ ${t}`),t}},fragmentShaderSource:{get:function(){return this._fragmentShaderSourc
|
|
|
5791
5791
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
5792
5792
|
* @copyright Chen, Yi-Cyuan 2014-2017
|
|
5793
5793
|
* @license MIT
|
|
5794
|
-
*/(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}(root.JS_MD5_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t){return function(n){return new Md5(!0).update(n)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Md5},t.update=function(s){return t.create().update(s)};for(var n=0;n<OUTPUT_TYPES.length;++n){var o=OUTPUT_TYPES[n];t[o]=createOutputMethod(o)}return t},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(t){if(typeof t=="string")return crypto.createHash("md5").update(t,"utf8").digest("hex");if(t==null)throw ERROR;return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash("md5").update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod};function Md5(t){if(t)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var n=new ArrayBuffer(68);this.buffer8=new Uint8Array(n),this.blocks=new Uint32Array(n)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(t){if(!this.finalized){var n,o=typeof t;if(o!=="string"){if(o==="object"){if(t===null)throw ERROR;if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw ERROR}else throw ERROR;n=!0}for(var s,c=0,d,h=t.length,p=this.blocks,y=this.buffer8;c<h;){if(this.hashed&&(this.hashed=!1,p[0]=p[16],p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0),n)if(ARRAY_BUFFER)for(d=this.start;c<h&&d<64;++c)y[d++]=t[c];else for(d=this.start;c<h&&d<64;++c)p[d>>2]|=t[c]<<SHIFT[d++&3];else if(ARRAY_BUFFER)for(d=this.start;c<h&&d<64;++c)s=t.charCodeAt(c),s<128?y[d++]=s:s<2048?(y[d++]=192|s>>6,y[d++]=128|s&63):s<55296||s>=57344?(y[d++]=224|s>>12,y[d++]=128|s>>6&63,y[d++]=128|s&63):(s=65536+((s&1023)<<10|t.charCodeAt(++c)&1023),y[d++]=240|s>>18,y[d++]=128|s>>12&63,y[d++]=128|s>>6&63,y[d++]=128|s&63);else for(d=this.start;c<h&&d<64;++c)s=t.charCodeAt(c),s<128?p[d>>2]|=s<<SHIFT[d++&3]:s<2048?(p[d>>2]|=(192|s>>6)<<SHIFT[d++&3],p[d>>2]|=(128|s&63)<<SHIFT[d++&3]):s<55296||s>=57344?(p[d>>2]|=(224|s>>12)<<SHIFT[d++&3],p[d>>2]|=(128|s>>6&63)<<SHIFT[d++&3],p[d>>2]|=(128|s&63)<<SHIFT[d++&3]):(s=65536+((s&1023)<<10|t.charCodeAt(++c)&1023),p[d>>2]|=(240|s>>18)<<SHIFT[d++&3],p[d>>2]|=(128|s>>12&63)<<SHIFT[d++&3],p[d>>2]|=(128|s>>6&63)<<SHIFT[d++&3],p[d>>2]|=(128|s&63)<<SHIFT[d++&3]);this.lastByteIndex=d,this.bytes+=d-this.start,d>=64?(this.start=d-64,this.hash(),this.hashed=!0):this.start=d}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,n=this.lastByteIndex;t[n>>2]|=EXTRA[n&3],n>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,t[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var t,n,o,s,c,d,h=this.blocks;this.first?(t=h[0]-680876937,t=(t<<7|t>>>25)-271733879<<0,s=(-1732584194^t&2004318071)+h[1]-117830708,s=(s<<12|s>>>20)+t<<0,o=(-271733879^s&(t^-271733879))+h[2]-1126478375,o=(o<<17|o>>>15)+s<<0,n=(t^o&(s^t))+h[3]-1316259209,n=(n<<22|n>>>10)+o<<0):(t=this.h0,n=this.h1,o=this.h2,s=this.h3,t+=(s^n&(o^s))+h[0]-680876936,t=(t<<7|t>>>25)+n<<0,s+=(o^t&(n^o))+h[1]-389564586,s=(s<<12|s>>>20)+t<<0,o+=(n^s&(t^n))+h[2]+606105819,o=(o<<17|o>>>15)+s<<0,n+=(t^o&(s^t))+h[3]-1044525330,n=(n<<22|n>>>10)+o<<0),t+=(s^n&(o^s))+h[4]-176418897,t=(t<<7|t>>>25)+n<<0,s+=(o^t&(n^o))+h[5]+1200080426,s=(s<<12|s>>>20)+t<<0,o+=(n^s&(t^n))+h[6]-1473231341,o=(o<<17|o>>>15)+s<<0,n+=(t^o&(s^t))+h[7]-45705983,n=(n<<22|n>>>10)+o<<0,t+=(s^n&(o^s))+h[8]+1770035416,t=(t<<7|t>>>25)+n<<0,s+=(o^t&(n^o))+h[9]-1958414417,s=(s<<12|s>>>20)+t<<0,o+=(n^s&(t^n))+h[10]-42063,o=(o<<17|o>>>15)+s<<0,n+=(t^o&(s^t))+h[11]-1990404162,n=(n<<22|n>>>10)+o<<0,t+=(s^n&(o^s))+h[12]+1804603682,t=(t<<7|t>>>25)+n<<0,s+=(o^t&(n^o))+h[13]-40341101,s=(s<<12|s>>>20)+t<<0,o+=(n^s&(t^n))+h[14]-1502002290,o=(o<<17|o>>>15)+s<<0,n+=(t^o&(s^t))+h[15]+1236535329,n=(n<<22|n>>>10)+o<<0,t+=(o^s&(n^o))+h[1]-165796510,t=(t<<5|t>>>27)+n<<0,s+=(n^o&(t^n))+h[6]-1069501632,s=(s<<9|s>>>23)+t<<0,o+=(t^n&(s^t))+h[11]+643717713,o=(o<<14|o>>>18)+s<<0,n+=(s^t&(o^s))+h[0]-373897302,n=(n<<20|n>>>12)+o<<0,t+=(o^s&(n^o))+h[5]-701558691,t=(t<<5|t>>>27)+n<<0,s+=(n^o&(t^n))+h[10]+38016083,s=(s<<9|s>>>23)+t<<0,o+=(t^n&(s^t))+h[15]-660478335,o=(o<<14|o>>>18)+s<<0,n+=(s^t&(o^s))+h[4]-405537848,n=(n<<20|n>>>12)+o<<0,t+=(o^s&(n^o))+h[9]+568446438,t=(t<<5|t>>>27)+n<<0,s+=(n^o&(t^n))+h[14]-1019803690,s=(s<<9|s>>>23)+t<<0,o+=(t^n&(s^t))+h[3]-187363961,o=(o<<14|o>>>18)+s<<0,n+=(s^t&(o^s))+h[8]+1163531501,n=(n<<20|n>>>12)+o<<0,t+=(o^s&(n^o))+h[13]-1444681467,t=(t<<5|t>>>27)+n<<0,s+=(n^o&(t^n))+h[2]-51403784,s=(s<<9|s>>>23)+t<<0,o+=(t^n&(s^t))+h[7]+1735328473,o=(o<<14|o>>>18)+s<<0,n+=(s^t&(o^s))+h[12]-1926607734,n=(n<<20|n>>>12)+o<<0,c=n^o,t+=(c^s)+h[5]-378558,t=(t<<4|t>>>28)+n<<0,s+=(c^t)+h[8]-2022574463,s=(s<<11|s>>>21)+t<<0,d=s^t,o+=(d^n)+h[11]+1839030562,o=(o<<16|o>>>16)+s<<0,n+=(d^o)+h[14]-35309556,n=(n<<23|n>>>9)+o<<0,c=n^o,t+=(c^s)+h[1]-1530992060,t=(t<<4|t>>>28)+n<<0,s+=(c^t)+h[4]+1272893353,s=(s<<11|s>>>21)+t<<0,d=s^t,o+=(d^n)+h[7]-155497632,o=(o<<16|o>>>16)+s<<0,n+=(d^o)+h[10]-1094730640,n=(n<<23|n>>>9)+o<<0,c=n^o,t+=(c^s)+h[13]+681279174,t=(t<<4|t>>>28)+n<<0,s+=(c^t)+h[0]-358537222,s=(s<<11|s>>>21)+t<<0,d=s^t,o+=(d^n)+h[3]-722521979,o=(o<<16|o>>>16)+s<<0,n+=(d^o)+h[6]+76029189,n=(n<<23|n>>>9)+o<<0,c=n^o,t+=(c^s)+h[9]-640364487,t=(t<<4|t>>>28)+n<<0,s+=(c^t)+h[12]-421815835,s=(s<<11|s>>>21)+t<<0,d=s^t,o+=(d^n)+h[15]+530742520,o=(o<<16|o>>>16)+s<<0,n+=(d^o)+h[2]-995338651,n=(n<<23|n>>>9)+o<<0,t+=(o^(n|~s))+h[0]-198630844,t=(t<<6|t>>>26)+n<<0,s+=(n^(t|~o))+h[7]+1126891415,s=(s<<10|s>>>22)+t<<0,o+=(t^(s|~n))+h[14]-1416354905,o=(o<<15|o>>>17)+s<<0,n+=(s^(o|~t))+h[5]-57434055,n=(n<<21|n>>>11)+o<<0,t+=(o^(n|~s))+h[12]+1700485571,t=(t<<6|t>>>26)+n<<0,s+=(n^(t|~o))+h[3]-1894986606,s=(s<<10|s>>>22)+t<<0,o+=(t^(s|~n))+h[10]-1051523,o=(o<<15|o>>>17)+s<<0,n+=(s^(o|~t))+h[1]-2054922799,n=(n<<21|n>>>11)+o<<0,t+=(o^(n|~s))+h[8]+1873313359,t=(t<<6|t>>>26)+n<<0,s+=(n^(t|~o))+h[15]-30611744,s=(s<<10|s>>>22)+t<<0,o+=(t^(s|~n))+h[6]-1560198380,o=(o<<15|o>>>17)+s<<0,n+=(s^(o|~t))+h[13]+1309151649,n=(n<<21|n>>>11)+o<<0,t+=(o^(n|~s))+h[4]-145523070,t=(t<<6|t>>>26)+n<<0,s+=(n^(t|~o))+h[11]-1120210379,s=(s<<10|s>>>22)+t<<0,o+=(t^(s|~n))+h[2]+718787259,o=(o<<15|o>>>17)+s<<0,n+=(s^(o|~t))+h[9]-343485551,n=(n<<21|n>>>11)+o<<0,this.first?(this.h0=t+1732584193<<0,this.h1=n-271733879<<0,this.h2=o-1732584194<<0,this.h3=s+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+n<<0,this.h2=this.h2+o<<0,this.h3=this.h3+s<<0)},Md5.prototype.hex=function(){this.finalize();var t=this.h0,n=this.h1,o=this.h2,s=this.h3;return HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var t=this.h0,n=this.h1,o=this.h2,s=this.h3;return[t&255,t>>8&255,t>>16&255,t>>24&255,n&255,n>>8&255,n>>16&255,n>>24&255,o&255,o>>8&255,o>>16&255,o>>24&255,s&255,s>>8&255,s>>16&255,s>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(16),n=new Uint32Array(t);return n[0]=this.h0,n[1]=this.h1,n[2]=this.h2,n[3]=this.h3,t},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var t,n,o,s="",c=this.array(),d=0;d<15;)t=c[d++],n=c[d++],o=c[d++],s+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[(t<<4|n>>>4)&63]+BASE64_ENCODE_CHAR[(n<<2|o>>>6)&63]+BASE64_ENCODE_CHAR[o&63];return t=c[d],s+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[t<<4&63]+"==",s};var exports=createMethod();COMMON_JS?module.exports=exports:root.md5=exports})()})(md5$1);var md5Exports=md5$1.exports;const md5=getDefaultExportFromCjs(md5Exports),EntityExt=React.forwardRef(EntityExtComponent);function EntityExtComponent({layerId:t,featureId:n,draggable:o,unselectable:s,legacyLocationPropertyKey:c,hideIndicator:d,...h},p){const y=React.useRef(null);return React.useLayoutEffect(()=>{var E;attachTag((E=y.current)==null?void 0:E.cesiumElement,{layerId:t||h.id,featureId:n,draggable:o,unselectable:s,legacyLocationPropertyKey:c,hideIndicator:d})},[o,n,t,c,h.id,s,d]),jsxRuntimeExports.jsx(Is$1,{ref:_default(p,y),...h})}function attachTag(t,n){if(t){if(t instanceof Cesium$1.Cesium3DTileset){t[tagKey]=n;return}if(t instanceof Cesium$1.Cesium3DTileFeature||t instanceof Cesium$1.Cesium3DTilePointFeature||t instanceof Cesium$1.Model||t instanceof Cesium$1.ImageryLayer){t[tagKey]=n;return}if(t instanceof Cesium$1.Primitive){t[tagKey]=n;return}if(t instanceof Cesium$1.GroundPrimitive){t[tagKey]=n;return}t.properties||(t.properties=new Cesium$1.PropertyBag);for(const o of tagKeys)!(o in n)&&t.properties.hasProperty(`reearth_${o}`)?t.properties.removeProperty(`reearth_${o}`):t.properties[`reearth_${o}`]=n[o]}}function getTag(t){if(t){if(t instanceof Cesium$1.Cesium3DTileset||t instanceof Cesium$1.Cesium3DTileFeature||t instanceof Cesium$1.Cesium3DTilePointFeature||t instanceof Cesium$1.Model||t instanceof Cesium$1.ImageryLayer||t instanceof Cesium$1.Primitive||t instanceof Cesium$1.GroundPrimitive)return t[tagKey];if(t.properties)return Object.fromEntries(Object.entries(t.properties).map(([n,o])=>tagKeys.includes(n.replace("reearth_",""))?[n.replace("reearth_",""),o]:null).filter(n=>!!n))}}const tagObj={draggable:1,featureId:1,layerId:1,unselectable:1,originalProperties:1,computedFeature:1,hideIndicator:1,appearanceType:1,featureIndex:1,isFeatureSelected:1},tagKeys=Object.keys(tagObj),tagKey="__reearth_tag",extractSimpleLayer=t=>{const n=t&&"layer"in t?t.layer:t;if((n==null?void 0:n.type)==="simple")return n},extractSimpleLayerData=t=>{var n;return(n=extractSimpleLayer(t))==null?void 0:n.data},toColor=t=>{if(!t||typeof t!="string")return;const n=t.match(/^#([A-Fa-f0-9]{6})([A-Fa-f0-9]{2})$|^#([A-Fa-f0-9]{3})([A-Fa-f0-9])$/);if(!n)return Cesium$1.Color.fromCssColorString(t);const o=parseInt(n[4]?n[4].repeat(2):n[2],16)/255;return Cesium$1.Color.fromCssColorString(`#${n[1]??n[3]}`).withAlpha(o)},toTimeInterval=t=>{if(t)return new Cesium$1.TimeIntervalCollection([new Cesium$1.TimeInterval({start:Cesium$1.JulianDate.fromDate(t[0]),stop:t[1]?Cesium$1.JulianDate.fromDate(t[1]):Cesium$1.Iso8601.MAXIMUM_VALUE})])},toDistanceDisplayCondition=(t,n)=>typeof t=="number"||typeof n=="number"?new Cesium$1.DistanceDisplayCondition(t??0,n??Number.MAX_VALUE):void 0,generateIDWithMD5=t=>{const n=md5.create();return n.update(t),n.hex()},usePick=(t,n)=>{const o=React.useMemo(()=>t?pick(t,n):void 0,[t,n]);return React.useMemo(()=>o,[JSON.stringify(o)])},useHooks$7=({id:t,index:n,edge:o,isHovered:s,fillColor:c,trs:d,hoverColor:h,onMouseDown:p,onMouseMove:y,onMouseUp:E})=>{const{viewer:L}=De$1(),[F]=React.useState(()=>new Cesium$1.CallbackProperty(()=>{const J=new Cesium$1.Cartesian3,lt=new Cesium$1.Cartesian3,yt=Cesium$1.Matrix4.fromTranslationRotationScale(d);return Cesium$1.Matrix4.multiplyByPoint(yt,o.start,J),Cesium$1.Matrix4.multiplyByPoint(yt,o.end,lt),[J,lt]},!1)),N=React.useRef(!1),[z]=React.useState(()=>new Cesium$1.ColorMaterialProperty(new Cesium$1.CallbackProperty(()=>N.current?h??c:c,!1)));React.useEffect(()=>{N.current=s},[s]);const H=React.useCallback(J=>{var yt,pi;!L||((pi=getTag((yt=L.scene.pick(J.position))==null?void 0:yt.id))==null?void 0:pi.layerId)!==t||p==null||p(J,{layerId:t,index:n})},[p,t,n,L]),W=React.useCallback(J=>{y==null||y(J,{layerId:t,index:n})},[y,n,t]),oe=React.useCallback(J=>{E==null||E(J,{layerId:t,index:n})},[E,n,t]),nt=React.useMemo(()=>new Cesium$1.ScreenSpaceEventHandler(L==null?void 0:L.scene.canvas),[L]);return React.useEffect(()=>{nt.setInputAction(H,Cesium$1.ScreenSpaceEventType.LEFT_DOWN),nt.setInputAction(W,Cesium$1.ScreenSpaceEventType.MOUSE_MOVE),nt.setInputAction(oe,Cesium$1.ScreenSpaceEventType.LEFT_UP)},[nt,H,W,oe]),React.useEffect(()=>()=>nt.destroy(),[nt]),{cbp:F,outlineColor:z}},Edge=React.memo(function t({layerId:n,featureId:o,index:s,edge:c,isHovered:d,fillColor:h,trs:p,width:y,hoverColor:E,availability:L,distanceDisplayCondition:F,onMouseDown:N,onMouseMove:z,onMouseUp:H,hideIndicator:W}){const{cbp:oe,outlineColor:nt}=useHooks$7({id:n,index:s,edge:c,isHovered:d,fillColor:h,trs:p,hoverColor:E,onMouseDown:N,onMouseMove:z,onMouseUp:H});return jsxRuntimeExports.jsx(EntityExt,{layerId:n,featureId:o,availability:L,hideIndicator:W,children:jsxRuntimeExports.jsx(ua$1,{positions:oe,width:y,material:nt,arcType:Cesium$1.ArcType.NONE,distanceDisplayCondition:F})})}),context=React.createContext({}),useContext=()=>React.useContext(context),convertCartesian3ToPosition=(t,n)=>{if(!n)return;const o=t==null?void 0:t.scene.globe.ellipsoid.cartesianToCartographic(n);if(o)return{lat:Cesium$1.Math.toDegrees(o.latitude),lng:Cesium$1.Math.toDegrees(o.longitude),height:o.height}},translationWithClamping=(t,n,o)=>{if(!n){const s=Cesium$1.Cartographic.fromCartesian(t.translation,void 0,new Cesium$1.Cartographic),c=s.height-t.scale.z/2,d=o;c<d&&(s.height+=d-c,Cesium$1.Cartographic.toCartesian(s,void 0,t.translation))}},getModelFromTileContent=t=>{if(!t.featuresLength&&"_model"in t&&t._model instanceof Cesium$1.Model)return t._model};function lookupFeatures(t,n){var c;if(!t)return;const o=getModelFromTileContent(t);if(o)return n(o,t);const s=t.featuresLength;for(let d=0;d<s;d++){const h=t.getFeature(d);h&&n(h,t,d)}(c=t.innerContents)==null||c.forEach(d=>lookupFeatures(d,n))}const findFeatureFrom3DTile=(t,n,o)=>{var c;let s;if(n&&(s=(c=o==null?void 0:o.find(n))==null?void 0:c[0],s&&s instanceof Cesium$1.Cesium3DTileFeature)||(lookupFeatures(t.content,d=>{const h=getTag(d);(h==null?void 0:h.featureId)===n&&(s=d)}),s&&s instanceof Cesium$1.Cesium3DTileFeature))return s;for(const d of t.children){const h=findFeatureFrom3DTile(d,n);if(h)return h}};function findEntity(t,n,o,s){const c=o??n,d=o?"featureId":"layerId";if(!c)return;let h=t.entities.getById(c);if(h||(h=t.entities.values.find(p=>{var y;return((y=getTag(p))==null?void 0:y[d])===c}),h))return h;for(const p of[t.dataSourceDisplay.dataSources,t.dataSources])for(let y=0;y<p.length;y++){const L=p.get(y).entities.values.find(F=>{var N;return((N=getTag(F))==null?void 0:N[d])===c});if(L)return L}for(let p=0;p<t.scene.primitives.length;p++){const y=t.scene.primitives.get(p);if(!(!(y instanceof Cesium$1.Cesium3DTileset)&&!(y instanceof Cesium$1.Primitive)&&!(y instanceof Cesium$1.GroundPrimitive))){if(n&&!o){const E=getTag(y);if(E!=null&&E.layerId&&n&&(E==null?void 0:E.layerId)===n)return y;continue}if(!y.isDestroyed()&&!s&&y instanceof Cesium$1.Cesium3DTileset){const E=findFeatureFrom3DTile(y.root,o);if(E)return E}}}for(let p=0;p<t.imageryLayers.length;p++){const y=t.imageryLayers.get(p),E=getTag(y);if((E==null?void 0:E.layerId)===n)return y}}const findFeaturesFrom3DTile=(t,n,o,s=new Set)=>{lookupFeatures(t.content,c=>{const d=getTag(c);if(n.includes((d==null?void 0:d.featureId)??"")){const h=o==null?void 0:o(c);h?s.add(h):s.add(c)}});for(const c of t.children)findFeaturesFrom3DTile(c,n,o,s)},filterEntity=(t,n,o,s)=>{const c=[];for(const d of t){const h=getTag(d);if((h==null?void 0:h.layerId)===n&&o.includes(h.featureId||"")){const p=s==null?void 0:s(d);p?c.push(p):d&&c.push(d)}}return c},findEntityFromDatasource=(t,n,o,s)=>{let c=[];for(const d of[t.dataSourceDisplay.dataSources,t.dataSources])for(let h=0;h<d.length;h++){const p=d.get(h).entities.values,y=filterEntity(p,n,o,s);y.length&&(c=c.concat(y))}return c},findTile3DFeaturesFromScene=(t,n,o,s)=>{const c=new Set;for(let d=0;d<t.scene.primitives.length;d++){const h=t.scene.primitives.get(d);if(!(h instanceof Cesium$1.Cesium3DTileset)||h.isDestroyed())continue;const p=getTag(h);if((p==null?void 0:p.layerId)!==n)continue;const y=p.featureIndex;if(y)return o.flatMap(L=>y.find(L)).filter(L=>!!L).map(L=>s==null?void 0:s(L,h)).filter(L=>!!L);if(findFeaturesFrom3DTile(h.root,o,s,c),c.size)return Array.from(c.values())}return[]};function findFeaturesFromLayer(t,n,o,s){const c=filterEntity(t.entities.values,n,o,s);if(c.length)return c;const d=findEntityFromDatasource(t,n,o,s);return d.length?d:findTile3DFeaturesFromScene(t,n,o,s)}const getEntityContent=(t,n,o)=>{var c;const s={description:{type:"html",value:t instanceof Cesium$1.ImageryLayerFeatureInfo?t.description:(c=t.description)==null?void 0:c.getValue(n)},attributes:{type:"table",value:!(t instanceof Cesium$1.Entity)&&"properties"in t&&t.properties&&typeof t.properties=="object"?propertiesToTableContent(t.properties):t instanceof Cesium$1.Entity&&t.properties?propertiesToTableContent(t.properties.getValue(n)):[]}};return o?s[o]:s.attributes??s.description};function propertiesToTableContent(t){return Object.entries(t).reduce((n,[o,s])=>[...n,{key:o,value:s}],[])}function getPixelRatio(t){return t.pixelRatio}const convertEntityProperties=(t,n)=>{var s;const o=(s=n.properties)==null?void 0:s.getValue(t);return n.properties&&o?Object.fromEntries(n.properties.propertyNames.map(c=>[c,o[c]])):{}},convertEntityDescription=(t,n)=>{var s;const o=(s=n.description)==null?void 0:s.getValue(t);if(typeof o=="string")return o},convertCesium3DTileFeatureProperties=t=>Object.fromEntries(t.getPropertyIds().map(n=>[n,t.getProperty(n)])),convertObjToComputedFeature=(t,n)=>{if(n instanceof Cesium$1.Cesium3DTileFeature||n instanceof Cesium$1.Cesium3DTilePointFeature){const o=getTag(n);return[o==null?void 0:o.layerId,(o==null?void 0:o.computedFeature)??{type:"computedFeature",id:(o==null?void 0:o.featureId)??"",properties:convertCesium3DTileFeatureProperties(n)}]}if(n instanceof Cesium$1.Model){const o=getTag(n);return[o==null?void 0:o.layerId,{type:"computedFeature",id:(o==null?void 0:o.featureId)??"",properties:{}}]}if(n instanceof Cesium$1.Entity||"id"in n&&n.id instanceof Cesium$1.Entity){const o=n instanceof Cesium$1.Entity?n:n.id,s=getTag(o);return[s==null?void 0:s.layerId,(s==null?void 0:s.computedFeature)??{type:"computedFeature",id:(s==null?void 0:s.featureId)??"",properties:convertEntityProperties(t,o),metaData:{description:convertEntityDescription(t,o)}}]}},updateTrs=(t,n,o,s,c)=>{const{height:d,width:h,length:p,heading:y,pitch:E,roll:L}=n??{},F=(s==null?void 0:s.type)==="Point"?s.coordinates:n!=null&&n.location?[n.location.lng,n.location.lat,n.location.height??0]:void 0,N=F?Cesium$1.Cartesian3.fromDegrees(F[0],F[1],F[2]):void 0;N&&Cesium$1.Cartesian3.clone(N,t.translation),c||translationWithClamping(t,!!c,o);const z=y&&E&&L?Cesium$1.Matrix3.fromHeadingPitchRoll(new Cesium$1.HeadingPitchRoll(y,E,L)):Cesium$1.Matrix3.getRotation(Cesium$1.Matrix4.getMatrix3(Cesium$1.Transforms.eastNorthUpToFixedFrame(t.translation),new Cesium$1.Matrix3),new Cesium$1.Matrix3);return Cesium$1.Quaternion.clone(Cesium$1.Quaternion.fromRotationMatrix(z),t.rotation),Cesium$1.Cartesian3.clone(new Cesium$1.Cartesian3(h||100,p||100,d||100),t.scale),t};function screenProjectVector(t,n,o,s,c){const d=new Cesium$1.Ray;d.origin=n,d.direction=o;const h=t.cartesianToCanvasCoordinates(Cesium$1.Ray.getPoint(d,0),new Cesium$1.Cartesian2),p=t.cartesianToCanvasCoordinates(Cesium$1.Ray.getPoint(d,s),new Cesium$1.Cartesian2);return Cesium$1.Cartesian2.subtract(p,h,c)}const dotMousePosition=(t,n,o,s)=>{const c=Cesium$1.Cartesian2.subtract(n.endPosition,n.startPosition,new Cesium$1.Cartesian2),d=screenProjectVector(t,o,s,1,new Cesium$1.Cartesian2),h=Cesium$1.Cartesian2.normalize(d,new Cesium$1.Cartesian2),p=Cesium$1.Cartesian2.magnitude(d),y=Cesium$1.Cartesian2.dot(c,h);return{pixelsPerStep:p,moveAmount:y/p}},computeMoveAmount=(t,n,o,s)=>{const c=Cesium$1.Cartesian2.subtract(n.endPosition,n.startPosition,new Cesium$1.Cartesian2),d=screenProjectVector(t,o,s,1,new Cesium$1.Cartesian2),h=Cesium$1.Cartesian2.normalize(d,new Cesium$1.Cartesian2),p=Cesium$1.Cartesian2.magnitude(d),y=Cesium$1.Cartesian2.dot(c,h);return{pixelsPerStep:p,moveAmount:y/p}},computeMouseMoveAmount=(t,n,o,s,c)=>{const{moveAmount:d,pixelsPerStep:h}=dotMousePosition(t,n,o,s),p=d/c;return{pixelLengthAfterScaling:h*c+h*c*p,scaleAmount:p}};function setPlaneDimensions(t,n,o){n===Cesium$1.Axis.X?(o.x=t.y,o.y=t.z):n===Cesium$1.Axis.Y?(o.x=t.x,o.y=t.z):n===Cesium$1.Axis.Z&&(o.x=t.x,o.y=t.y)}const useHooks$6=({property:t,geometry:n,feature:o,onLayerEdit:s})=>{const{viewer:c}=De$1(),d=useContext(),{fillColor:h,outlineColor:p,activeOutlineColor:y,outlineWidth:E,draggableOutlineColor:L,activeDraggableOutlineColor:F,draggableOutlineWidth:N,pointFillColor:z,pointOutlineColor:H,activePointOutlineColor:W,axisLineColor:oe,cursor:nt,allowEnterGround:J}=t??{},[lt,yt]=React.useState(0),[pi]=React.useState(()=>updateTrs(new Cesium$1.TranslationRotationScale,t,lt,n,J)),Ai=React.useRef(!1),Vd=React.useCallback(()=>{Ai.current||!J&&c&&(Ai.current=!0,sampleTerrainHeightFromCartesian(c.scene,pi.translation).then(mf=>{yt(mf??0),Ai.current=!1}))},[J,c,pi]),{requestRender:Gd}=useContext();React.useEffect(()=>{updateTrs(pi,t,lt,n,J),Gd==null||Gd(),Vd()},[t,n,pi,c,lt,Vd,J,Gd]);const md=React.useMemo(()=>({fillColor:toColor(h),outlineColor:toColor(p),activeOutlineColor:toColor(y),draggableOutlineColor:toColor(L),activeDraggableOutlineColor:toColor(F),outlineWidth:E,draggableOutlineWidth:N,fill:!!h,outline:!!p}),[h,p,y,E,N,L,F]),tf=React.useMemo(()=>({pointFillColor:toColor(z)??md.fillColor,pointOutlineColor:toColor(H)??md.outlineColor,activePointOutlineColor:toColor(W)??md.outlineColor,axisLineColor:toColor(oe)??md.outlineColor}),[z,H,oe,md,W]),nf=React.useRef(),ef=React.useCallback((mf,{index:ff})=>{c&&(updateMapController(c,!1),nf.current=ff)},[c]),mt=React.useRef(),Ee=React.useCallback((mf,{position:ff,oppositePosition:pf,pointLocal:xf,index:Rf,layerId:Vf})=>{var Df;if(nf.current!==Rf||!ff||!pf||!xf||!c)return;const Lf=mf.startPosition;if(mt.current===void 0){mt.current=new Cesium$1.Cartesian2(Lf.x,Lf.y);return}const Pf=new Cesium$1.Cartesian2(Lf.x,Lf.y),Uf=Cesium$1.Cartesian3.subtract(ff,pf,new Cesium$1.Cartesian3),Bf=Cesium$1.Cartesian3.magnitude(Uf),Tf=Cesium$1.Cartesian3.normalize(Uf,new Cesium$1.Cartesian3),{scaleAmount:Xd,pixelLengthAfterScaling:gf}=computeMouseMoveAmount(c.scene,{startPosition:mt.current,endPosition:Pf},ff,Tf,Bf);mt.current=Pf.clone();const yf=Cesium$1.Cartesian3.normalize(xf,new Cesium$1.Cartesian3),hf=Math.abs(Cesium$1.Cartesian3.dot(new Cesium$1.Cartesian3(1,0,0),yf)),df=Math.abs(Cesium$1.Cartesian3.dot(new Cesium$1.Cartesian3(0,1,0),yf)),bf=Math.abs(Cesium$1.Cartesian3.dot(new Cesium$1.Cartesian3(0,0,1),yf)),Ef=hf&&df&&bf;if(Xd<0&&(yf.x&&yf.y&&yf.y?gf/Math.sqrt(2):gf)<20)return;const wf=Cesium$1.Cartesian3.multiplyByScalar(Cesium$1.Cartesian3.abs(Cesium$1.Cartesian3.multiplyComponents(pi.scale,Ef?new Cesium$1.Cartesian3(1,1,1):yf,new Cesium$1.Cartesian3),new Cesium$1.Cartesian3),Xd,new Cesium$1.Cartesian3),vf=Cesium$1.Cartesian3.multiplyByScalar(Uf,Xd/2,new Cesium$1.Cartesian3),Of=yf.z<0,Gf=Xd>0;!J&&Gf&&Of&&Cesium$1.Cartographic.fromCartesian(pi.translation,void 0,new Cesium$1.Cartographic).height-pi.scale.z/2-Math.abs(vf.z)<0&&(wf.z=0);const If=new Cesium$1.Cartesian3,zf=new Cesium$1.Cartesian3;Cesium$1.Cartesian3.add(pi.scale,wf,If),Cesium$1.Cartesian3.add(pi.translation,vf,zf);const Mf=c==null?void 0:c.scene.globe.ellipsoid.cartesianToCartographic(zf);s==null||s({layerId:Vf,scale:{width:If.x,length:If.y,height:If.z,location:{lat:Cesium$1.Math.toDegrees(Mf==null?void 0:Mf.latitude),lng:Cesium$1.Math.toDegrees(Mf==null?void 0:Mf.longitude),height:Mf==null?void 0:Mf.height}}}),(Df=d==null?void 0:d.onLayerEdit)==null||Df.call(d,{layerId:Vf,scale:{width:If.x,length:If.y,height:If.z,location:{lat:Cesium$1.Math.toDegrees(Mf==null?void 0:Mf.latitude),lng:Cesium$1.Math.toDegrees(Mf==null?void 0:Mf.longitude),height:Mf==null?void 0:Mf.height}}})},[pi,c,J,d,s]),sl=React.useCallback(()=>{c&&(nf.current=void 0,mt.current=void 0,updateMapController(c,!0))},[c]),Zd=React.useRef(),rf=React.useCallback((mf,{index:ff})=>{c&&(Zd.current=ff,updateMapController(c,!1))},[c]),uf=React.useRef(),lf=React.useCallback((mf,{index:ff,layerId:pf})=>{var Xd;if(Zd.current!==ff)return;const xf=mf.startPosition;if(uf.current===void 0){uf.current=xf.x;return}const Rf=xf.x-uf.current;uf.current=xf.x;const Vf=.05,Lf=new Cesium$1.HeadingPitchRoll(0,0,0);Lf.heading=-Rf*Vf,Lf.pitch=0,Lf.roll=0;const Pf=new Cesium$1.Quaternion;Cesium$1.Quaternion.multiply(pi.rotation,Cesium$1.Quaternion.fromHeadingPitchRoll(Lf),Pf);const{heading:Uf,pitch:Bf,roll:Tf}=Cesium$1.HeadingPitchRoll.fromQuaternion(Pf);s==null||s({layerId:pf,rotate:{heading:Uf,pitch:Bf,roll:Tf}}),(Xd=d==null?void 0:d.onLayerEdit)==null||Xd.call(d,{layerId:pf,rotate:{heading:Uf,pitch:Bf,roll:Tf}})},[pi,d,s]),af=React.useCallback(()=>{c&&(Zd.current=void 0,uf.current=void 0,updateMapController(c,!0))},[c]);React.useEffect(()=>{document.body.style.cursor=nt||"default"},[nt]);const of=React.useMemo(()=>toTimeInterval(o==null?void 0:o.interval),[o==null?void 0:o.interval]),sf=React.useMemo(()=>toDistanceDisplayCondition(t==null?void 0:t.near,t==null?void 0:t.far),[t==null?void 0:t.near,t==null?void 0:t.far]);return{style:md,trs:pi,scalePointStyle:tf,availability:of,distanceDisplayCondition:sf,handlePointMouseDown:ef,handlePointMouseMove:Ee,handlePointMouseUp:sl,handleEdgeMouseDown:rf,handleEdgeMouseMove:lf,handleEdgeMouseUp:af}},useHooks$5=({id:t,index:n,scalePoint:o,isHovered:s,pointOutlineColor:c,hoverPointOutlineColor:d,axisLineColor:h,trs:p,dimensions:y,onPointMouseDown:E,onPointMouseMove:L,onPointMouseUp:F})=>{const N=`${t}-${n}`,z=`${t}-opposite-${n}`,{viewer:H}=De$1(),[W]=React.useState(()=>{const nf=new Cesium$1.Cartesian3,ef=new Cesium$1.Cartesian3,mt=new Cesium$1.CallbackProperty(()=>{const sl=Cesium$1.Matrix4.fromTranslationRotationScale(p);return Cesium$1.Matrix4.multiplyByPoint(sl,o.point,nf),nf},!1),Ee=new Cesium$1.CallbackProperty(()=>{const sl=Cesium$1.Matrix4.fromTranslationRotationScale(p);return Cesium$1.Matrix4.multiplyByPoint(sl,o.oppositePoint,ef),ef},!1);return{point:mt,oppositePoint:Ee,axisLine:new Cesium$1.CallbackProperty(()=>[mt.getValue(Cesium$1.JulianDate.now()),Ee.getValue(Cesium$1.JulianDate.now())],!1)}}),oe=React.useRef(!1),[nt]=React.useState(()=>new Cesium$1.CallbackProperty(()=>oe.current?d:c,!1));React.useEffect(()=>{oe.current=s},[s]);const[J]=React.useState(()=>new Cesium$1.Cartesian3(y==null?void 0:y.width,y==null?void 0:y.length,y==null?void 0:y.height)),[lt]=React.useState(()=>new Cesium$1.CallbackProperty(()=>J,!1)),[yt]=React.useState(()=>new Cesium$1.CallbackProperty(()=>Cesium$1.Quaternion.IDENTITY,!1)),pi=React.useMemo(()=>new Cesium$1.PolylineDashMaterialProperty({color:h,dashLength:8}),[h]),Ai=React.useRef(!1),Vd=React.useCallback(nf=>{var mt,Ee;if(!H)return;const ef=(Ee=getTag((mt=H.scene.pick(nf.position))==null?void 0:mt.id))==null?void 0:Ee.layerId;Ai.current=ef===z,(ef===N||ef===z)&&(E==null||E(nf,{layerId:Ai.current?z:N,index:n,opposite:Ai.current}))},[E,n,N,z,H]),Gd=React.useCallback(nf=>{L==null||L(nf,{layerId:Ai.current?z:N,index:n,opposite:Ai.current,position:Ai.current?W.oppositePoint.getValue(Cesium$1.JulianDate.now()):W.point.getValue(Cesium$1.JulianDate.now()),oppositePosition:Ai.current?W.point.getValue(Cesium$1.JulianDate.now()):W.oppositePoint.getValue(Cesium$1.JulianDate.now()),pointLocal:Ai?o.oppositePoint:o.point})},[L,n,W,o,N,z]),md=React.useCallback(nf=>{F==null||F(nf,{layerId:Ai.current?z:N,index:n,opposite:Ai.current})},[F,n,N,z]);React.useEffect(()=>{Cesium$1.Cartesian3.clone(new Cesium$1.Cartesian3(y==null?void 0:y.width,y==null?void 0:y.length,y==null?void 0:y.height),J)},[y,J]);const tf=React.useMemo(()=>new Cesium$1.ScreenSpaceEventHandler(H==null?void 0:H.scene.canvas),[H]);return React.useEffect(()=>{tf.setInputAction(Vd,Cesium$1.ScreenSpaceEventType.LEFT_DOWN),tf.setInputAction(Gd,Cesium$1.ScreenSpaceEventType.MOUSE_MOVE),tf.setInputAction(md,Cesium$1.ScreenSpaceEventType.LEFT_UP)},[tf,Vd,Gd,md]),React.useEffect(()=>()=>tf.destroy(),[tf]),{entitiesPosition:W,pointOutlineColorCb:nt,cesiumDimensionsCallbackProperty:lt,orientation:yt,axisColorProperty:pi}},ScalePoints=React.memo(function t({layerId:n,featureId:o,index:s,scalePoint:c,isHovered:d,pointFillColor:h,pointOutlineColor:p,hoverPointOutlineColor:y,pointOutlineWidth:E,axisLineColor:L,axisLineWidth:F,trs:N,dimensions:z,visiblePoint:H,visibleAxisLine:W,availability:oe,distanceDisplayCondition:nt,onPointMouseDown:J,onPointMouseMove:lt,onPointMouseUp:yt,hideIndicator:pi}){const{entitiesPosition:Ai,pointOutlineColorCb:Vd,cesiumDimensionsCallbackProperty:Gd,orientation:md,axisColorProperty:tf}=useHooks$5({id:n,index:s,scalePoint:c,isHovered:d,pointOutlineColor:p,hoverPointOutlineColor:y,axisLineColor:L,trs:N,dimensions:z,onPointMouseDown:J,onPointMouseMove:lt,onPointMouseUp:yt});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(EntityExt,{layerId:`${n}-${s}`,featureId:`${o}-${s}`,position:Ai.point,orientation:md,hideIndicator:pi,availability:oe,children:jsxRuntimeExports.jsx(Cs$1,{show:H,dimensions:Gd,material:h,fill:!!h,outline:!!p,outlineColor:Vd,outlineWidth:E,distanceDisplayCondition:nt})}),jsxRuntimeExports.jsx(EntityExt,{layerId:`${n}-opposite-${s}`,featureId:`${o}-opposite-${s}`,position:Ai.oppositePoint,orientation:md,hideIndicator:pi,availability:oe,children:jsxRuntimeExports.jsx(Cs$1,{show:H,dimensions:Gd,material:h,fill:!!h,outline:!!p,outlineColor:Vd,outlineWidth:E,distanceDisplayCondition:nt})}),jsxRuntimeExports.jsx(EntityExt,{layerId:`${n}-axis-line-${s}`,featureId:`${o}-axis-line-${s}`,hideIndicator:pi,availability:oe,children:jsxRuntimeExports.jsx(ua$1,{positions:Ai.axisLine,show:W,material:tf,width:F,arcType:Cesium$1.ArcType.NONE,distanceDisplayCondition:nt})})]})}),useHooks$4=({planeLocal:t,isActive:n,outlineColor:o,activeOutlineColor:s,trs:c})=>{const d=React.useMemo(()=>new Cesium$1.CallbackProperty(()=>c.translation,!1),[c]),[h,p,y]=React.useMemo(()=>[new Cesium$1.CallbackProperty(()=>{const F=new Cesium$1.Matrix4,N=Cesium$1.Matrix4.fromScale(c.scale,F);return Cesium$1.Plane.transform(t,N,new Cesium$1.Plane(Cesium$1.Cartesian3.UNIT_Z,0))},!1),new Cesium$1.CallbackProperty(()=>{const F=t.normal.x?Cesium$1.Axis.X:t.normal.y?Cesium$1.Axis.Y:Cesium$1.Axis.Z,N=new Cesium$1.Cartesian3;return setPlaneDimensions(c.scale,F,N),N},!1),new Cesium$1.CallbackProperty(()=>c.rotation,!1)],[c,t]),E=React.useRef(!1),[L]=React.useState(()=>new Cesium$1.CallbackProperty(()=>E.current?s??o:o,!1));return React.useEffect(()=>{E.current=n},[n]),{cbRef:d,plane:h,dimension:p,orientation:y,outlineColorCb:L}},Side=React.memo(function t({layerId:n,featureId:o,planeLocal:s,isActive:c,fill:d,fillColor:h,outlineColor:p,activeOutlineColor:y,trs:E,availability:L,distanceDisplayCondition:F,hideIndicator:N}){const{cbRef:z,plane:H,dimension:W,orientation:oe,outlineColorCb:nt}=useHooks$4({planeLocal:s,isActive:c,outlineColor:p,activeOutlineColor:y,trs:E});return jsxRuntimeExports.jsx(EntityExt,{layerId:n,featureId:o,position:z,orientation:oe,availability:L,hideIndicator:N,children:jsxRuntimeExports.jsx(na$1,{plane:H,dimensions:W,fill:d,material:h,outlineWidth:1,outlineColor:nt,distanceDisplayCondition:F,outline:!0})})}),Box=React.memo(function t({property:n,geometry:o,isVisible:s,layer:c,feature:d,onLayerEdit:h}){const{show:p=!0,height:y=100,width:E=100,length:L=100,pointOutlineWidth:F,axisLineWidth:N,scalePoint:z=!0,axisLine:H=!0,activeBox:W,activeEdgeIndex:oe,activeScalePointIndex:nt,hideIndicator:J,disabledSelection:lt}=n??{},{style:yt,trs:pi,scalePointStyle:Ai,availability:Vd,distanceDisplayCondition:Gd,handlePointMouseDown:md,handlePointMouseMove:tf,handlePointMouseUp:nf,handleEdgeMouseDown:ef,handleEdgeMouseMove:mt,handleEdgeMouseUp:Ee}=useHooks$6({property:n,geometry:o,feature:d,onLayerEdit:h}),sl=(E+y+L)/3*.05,[Zd,rf]=[c==null?void 0:c.id,d==null?void 0:d.id];return!s||!p?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[SIDE_PLANES.map((uf,lf)=>jsxRuntimeExports.jsx(Side,{layerId:`${Zd}-plane-${SIDE_PLANE_NAMES[lf]}`,featureId:`${rf}-plane-${SIDE_PLANE_NAMES[lf]}`,planeLocal:uf,fill:yt.fill,fillColor:yt.fillColor,outlineColor:yt.outlineColor,isActive:lt?!!W:!1,activeOutlineColor:yt.activeOutlineColor,trs:pi,availability:Vd,distanceDisplayCondition:Gd,hideIndicator:J},`${Zd}-plane-${SIDE_PLANE_NAMES[lf]}`)),BOX_EDGES.map((uf,lf)=>jsxRuntimeExports.jsx(Edge,{featureId:`${rf}-edge${uf.isDraggable?"-draggable":""}-${lf}`,layerId:`${Zd}-edge${uf.isDraggable?"-draggable":""}-${lf}`,index:lf,edge:uf,isHovered:lt?oe===lf||!uf.isDraggable&&!!W:!1,width:uf.isDraggable&<?yt.draggableOutlineWidth:yt.outlineWidth,fillColor:uf.isDraggable?yt.draggableOutlineColor:yt.outlineColor,hoverColor:lt?uf.isDraggable?yt.activeDraggableOutlineColor:yt.activeOutlineColor:void 0,trs:pi,onMouseDown:uf.isDraggable&<?ef:void 0,onMouseMove:uf.isDraggable&<?mt:void 0,onMouseUp:uf.isDraggable&<?Ee:void 0,availability:Vd,distanceDisplayCondition:Gd,hideIndicator:J},`${Zd}-edge-${lf}`)),z&&SCALE_POINTS.map((uf,lf)=>jsxRuntimeExports.jsx(ScalePoints,{layerId:`${Zd}-scale-point`,featureId:`${rf}-scale-point`,index:lf,scalePoint:uf,trs:pi,isHovered:lt?nt===lf:!1,pointFillColor:lt?Ai.pointFillColor:void 0,pointOutlineColor:lt?Ai.pointOutlineColor:void 0,hoverPointOutlineColor:lt?Ai.activePointOutlineColor:void 0,pointOutlineWidth:F,axisLineColor:Ai.axisLineColor,axisLineWidth:N,dimensions:{width:sl,height:sl,length:sl},visiblePoint:z,visibleAxisLine:H&&nt===lf,onPointMouseDown:lt?md:void 0,onPointMouseMove:lt?tf:void 0,onPointMouseUp:lt?nf:void 0,availability:Vd,distanceDisplayCondition:Gd,hideIndicator:J},`${Zd}-scale-point-${lf}`))]})}),config$d={noLayer:!0};function Ellipse({id:t,isVisible:n,property:o,geometry:s,layer:c,feature:d}){const{show:h=!0}=o??{},p=React.useMemo(()=>(s==null?void 0:s.type)==="Point"?s.coordinates:void 0,[s==null?void 0:s.coordinates,s==null?void 0:s.type]),{heightReference:y,shadows:E,radius:L=1e3,fillColor:F,fill:N,classificationType:z}=o??{},{useTransition:H,translate:W}=(c==null?void 0:c.transition)??{},oe=React.useMemo(()=>p?Cesium$1.Cartesian3.fromDegrees(p[0],p[1],p[2]):void 0,[p]),nt=React.useMemo(()=>H&&W?new Cesium$1.CallbackProperty(()=>Cesium$1.Cartesian3.fromDegrees(...W),!1):void 0,[H,W]),J=React.useMemo(()=>H?new Cesium$1.CallbackProperty(()=>L,!1):L,[L]),lt=React.useMemo(()=>toColor(F),[F]),yt=React.useMemo(()=>toTimeInterval(d==null?void 0:d.interval),[d==null?void 0:d.interval]),pi=React.useMemo(()=>toDistanceDisplayCondition(o==null?void 0:o.near,o==null?void 0:o.far),[o==null?void 0:o.near,o==null?void 0:o.far]);return!n||!oe||!h?null:jsxRuntimeExports.jsx(EntityExt,{id:t,position:nt||oe,layerId:c==null?void 0:c.id,featureId:d==null?void 0:d.id,draggable:!0,availability:yt,properties:d==null?void 0:d.properties,children:jsxRuntimeExports.jsx(As$1,{semiMajorAxis:J,semiMinorAxis:J,material:lt,fill:N,heightReference:heightReference(y),classificationType:classificationType(z),shadows:shadowMode(E),distanceDisplayCondition:pi})})}const config$c={noLayer:!0};function Ellipsoid({id:t,isVisible:n,property:o,geometry:s,layer:c,feature:d}){const{show:h=!0}=o??{},p=React.useMemo(()=>(s==null?void 0:s.type)==="Point"?s.coordinates:o!=null&&o.position?[o.position.lng,o.position.lat,o.height??0]:o!=null&&o.location?[o.location.lng,o.location.lat,o.height??0]:void 0,[s==null?void 0:s.coordinates,s==null?void 0:s.type,o==null?void 0:o.height,o==null?void 0:o.location]),{heightReference:y,shadows:E,radius:L=1e3,fillColor:F}=o??{},N=React.useMemo(()=>p?Cesium$1.Cartesian3.fromDegrees(p[0],p[1],p[2]):void 0,[p]),z=React.useMemo(()=>new Cesium$1.Cartesian3(L,L,L),[L]),H=React.useMemo(()=>toColor$2(F),[F]),W=React.useMemo(()=>toTimeInterval(d==null?void 0:d.interval),[d==null?void 0:d.interval]),oe=React.useMemo(()=>toDistanceDisplayCondition(o==null?void 0:o.near,o==null?void 0:o.far),[o==null?void 0:o.near,o==null?void 0:o.far]);return!n||!N||!h?null:jsxRuntimeExports.jsx(EntityExt,{id:t,position:N,layerId:c==null?void 0:c.id,featureId:d==null?void 0:d.id,draggable:!0,legacyLocationPropertyKey:"default.position",availability:W,properties:d==null?void 0:d.properties,children:jsxRuntimeExports.jsx(Fs$1,{radii:z,material:H,heightReference:heightReference(y),shadows:shadowMode(E),distanceDisplayCondition:oe})})}const config$b={noLayer:!0},fragmentShaderSource=`in vec3 v_positionEC;
|
|
5794
|
+
*/(function(module){(function(){var ERROR="input is invalid type",WINDOW=typeof window=="object",root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&typeof self=="object",NODE_JS=!root.JS_MD5_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&!0&&module.exports,ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}(root.JS_MD5_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return Object.prototype.toString.call(t)==="[object Array]"}),ARRAY_BUFFER&&(root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return typeof t=="object"&&t.buffer&&t.buffer.constructor===ArrayBuffer});var createOutputMethod=function(t){return function(n){return new Md5(!0).update(n)[t]()}},createMethod=function(){var t=createOutputMethod("hex");NODE_JS&&(t=nodeWrap(t)),t.create=function(){return new Md5},t.update=function(s){return t.create().update(s)};for(var n=0;n<OUTPUT_TYPES.length;++n){var o=OUTPUT_TYPES[n];t[o]=createOutputMethod(o)}return t},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(t){if(typeof t=="string")return crypto.createHash("md5").update(t,"utf8").digest("hex");if(t==null)throw ERROR;return t.constructor===ArrayBuffer&&(t=new Uint8Array(t)),Array.isArray(t)||ArrayBuffer.isView(t)||t.constructor===Buffer?crypto.createHash("md5").update(new Buffer(t)).digest("hex"):method(t)};return nodeMethod};function Md5(t){if(t)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var n=new ArrayBuffer(68);this.buffer8=new Uint8Array(n),this.blocks=new Uint32Array(n)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(t){if(!this.finalized){var n,o=typeof t;if(o!=="string"){if(o==="object"){if(t===null)throw ERROR;if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw ERROR}else throw ERROR;n=!0}for(var s,c=0,d,h=t.length,p=this.blocks,y=this.buffer8;c<h;){if(this.hashed&&(this.hashed=!1,p[0]=p[16],p[16]=p[1]=p[2]=p[3]=p[4]=p[5]=p[6]=p[7]=p[8]=p[9]=p[10]=p[11]=p[12]=p[13]=p[14]=p[15]=0),n)if(ARRAY_BUFFER)for(d=this.start;c<h&&d<64;++c)y[d++]=t[c];else for(d=this.start;c<h&&d<64;++c)p[d>>2]|=t[c]<<SHIFT[d++&3];else if(ARRAY_BUFFER)for(d=this.start;c<h&&d<64;++c)s=t.charCodeAt(c),s<128?y[d++]=s:s<2048?(y[d++]=192|s>>6,y[d++]=128|s&63):s<55296||s>=57344?(y[d++]=224|s>>12,y[d++]=128|s>>6&63,y[d++]=128|s&63):(s=65536+((s&1023)<<10|t.charCodeAt(++c)&1023),y[d++]=240|s>>18,y[d++]=128|s>>12&63,y[d++]=128|s>>6&63,y[d++]=128|s&63);else for(d=this.start;c<h&&d<64;++c)s=t.charCodeAt(c),s<128?p[d>>2]|=s<<SHIFT[d++&3]:s<2048?(p[d>>2]|=(192|s>>6)<<SHIFT[d++&3],p[d>>2]|=(128|s&63)<<SHIFT[d++&3]):s<55296||s>=57344?(p[d>>2]|=(224|s>>12)<<SHIFT[d++&3],p[d>>2]|=(128|s>>6&63)<<SHIFT[d++&3],p[d>>2]|=(128|s&63)<<SHIFT[d++&3]):(s=65536+((s&1023)<<10|t.charCodeAt(++c)&1023),p[d>>2]|=(240|s>>18)<<SHIFT[d++&3],p[d>>2]|=(128|s>>12&63)<<SHIFT[d++&3],p[d>>2]|=(128|s>>6&63)<<SHIFT[d++&3],p[d>>2]|=(128|s&63)<<SHIFT[d++&3]);this.lastByteIndex=d,this.bytes+=d-this.start,d>=64?(this.start=d-64,this.hash(),this.hashed=!0):this.start=d}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,n=this.lastByteIndex;t[n>>2]|=EXTRA[n&3],n>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,t[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var t,n,o,s,c,d,h=this.blocks;this.first?(t=h[0]-680876937,t=(t<<7|t>>>25)-271733879<<0,s=(-1732584194^t&2004318071)+h[1]-117830708,s=(s<<12|s>>>20)+t<<0,o=(-271733879^s&(t^-271733879))+h[2]-1126478375,o=(o<<17|o>>>15)+s<<0,n=(t^o&(s^t))+h[3]-1316259209,n=(n<<22|n>>>10)+o<<0):(t=this.h0,n=this.h1,o=this.h2,s=this.h3,t+=(s^n&(o^s))+h[0]-680876936,t=(t<<7|t>>>25)+n<<0,s+=(o^t&(n^o))+h[1]-389564586,s=(s<<12|s>>>20)+t<<0,o+=(n^s&(t^n))+h[2]+606105819,o=(o<<17|o>>>15)+s<<0,n+=(t^o&(s^t))+h[3]-1044525330,n=(n<<22|n>>>10)+o<<0),t+=(s^n&(o^s))+h[4]-176418897,t=(t<<7|t>>>25)+n<<0,s+=(o^t&(n^o))+h[5]+1200080426,s=(s<<12|s>>>20)+t<<0,o+=(n^s&(t^n))+h[6]-1473231341,o=(o<<17|o>>>15)+s<<0,n+=(t^o&(s^t))+h[7]-45705983,n=(n<<22|n>>>10)+o<<0,t+=(s^n&(o^s))+h[8]+1770035416,t=(t<<7|t>>>25)+n<<0,s+=(o^t&(n^o))+h[9]-1958414417,s=(s<<12|s>>>20)+t<<0,o+=(n^s&(t^n))+h[10]-42063,o=(o<<17|o>>>15)+s<<0,n+=(t^o&(s^t))+h[11]-1990404162,n=(n<<22|n>>>10)+o<<0,t+=(s^n&(o^s))+h[12]+1804603682,t=(t<<7|t>>>25)+n<<0,s+=(o^t&(n^o))+h[13]-40341101,s=(s<<12|s>>>20)+t<<0,o+=(n^s&(t^n))+h[14]-1502002290,o=(o<<17|o>>>15)+s<<0,n+=(t^o&(s^t))+h[15]+1236535329,n=(n<<22|n>>>10)+o<<0,t+=(o^s&(n^o))+h[1]-165796510,t=(t<<5|t>>>27)+n<<0,s+=(n^o&(t^n))+h[6]-1069501632,s=(s<<9|s>>>23)+t<<0,o+=(t^n&(s^t))+h[11]+643717713,o=(o<<14|o>>>18)+s<<0,n+=(s^t&(o^s))+h[0]-373897302,n=(n<<20|n>>>12)+o<<0,t+=(o^s&(n^o))+h[5]-701558691,t=(t<<5|t>>>27)+n<<0,s+=(n^o&(t^n))+h[10]+38016083,s=(s<<9|s>>>23)+t<<0,o+=(t^n&(s^t))+h[15]-660478335,o=(o<<14|o>>>18)+s<<0,n+=(s^t&(o^s))+h[4]-405537848,n=(n<<20|n>>>12)+o<<0,t+=(o^s&(n^o))+h[9]+568446438,t=(t<<5|t>>>27)+n<<0,s+=(n^o&(t^n))+h[14]-1019803690,s=(s<<9|s>>>23)+t<<0,o+=(t^n&(s^t))+h[3]-187363961,o=(o<<14|o>>>18)+s<<0,n+=(s^t&(o^s))+h[8]+1163531501,n=(n<<20|n>>>12)+o<<0,t+=(o^s&(n^o))+h[13]-1444681467,t=(t<<5|t>>>27)+n<<0,s+=(n^o&(t^n))+h[2]-51403784,s=(s<<9|s>>>23)+t<<0,o+=(t^n&(s^t))+h[7]+1735328473,o=(o<<14|o>>>18)+s<<0,n+=(s^t&(o^s))+h[12]-1926607734,n=(n<<20|n>>>12)+o<<0,c=n^o,t+=(c^s)+h[5]-378558,t=(t<<4|t>>>28)+n<<0,s+=(c^t)+h[8]-2022574463,s=(s<<11|s>>>21)+t<<0,d=s^t,o+=(d^n)+h[11]+1839030562,o=(o<<16|o>>>16)+s<<0,n+=(d^o)+h[14]-35309556,n=(n<<23|n>>>9)+o<<0,c=n^o,t+=(c^s)+h[1]-1530992060,t=(t<<4|t>>>28)+n<<0,s+=(c^t)+h[4]+1272893353,s=(s<<11|s>>>21)+t<<0,d=s^t,o+=(d^n)+h[7]-155497632,o=(o<<16|o>>>16)+s<<0,n+=(d^o)+h[10]-1094730640,n=(n<<23|n>>>9)+o<<0,c=n^o,t+=(c^s)+h[13]+681279174,t=(t<<4|t>>>28)+n<<0,s+=(c^t)+h[0]-358537222,s=(s<<11|s>>>21)+t<<0,d=s^t,o+=(d^n)+h[3]-722521979,o=(o<<16|o>>>16)+s<<0,n+=(d^o)+h[6]+76029189,n=(n<<23|n>>>9)+o<<0,c=n^o,t+=(c^s)+h[9]-640364487,t=(t<<4|t>>>28)+n<<0,s+=(c^t)+h[12]-421815835,s=(s<<11|s>>>21)+t<<0,d=s^t,o+=(d^n)+h[15]+530742520,o=(o<<16|o>>>16)+s<<0,n+=(d^o)+h[2]-995338651,n=(n<<23|n>>>9)+o<<0,t+=(o^(n|~s))+h[0]-198630844,t=(t<<6|t>>>26)+n<<0,s+=(n^(t|~o))+h[7]+1126891415,s=(s<<10|s>>>22)+t<<0,o+=(t^(s|~n))+h[14]-1416354905,o=(o<<15|o>>>17)+s<<0,n+=(s^(o|~t))+h[5]-57434055,n=(n<<21|n>>>11)+o<<0,t+=(o^(n|~s))+h[12]+1700485571,t=(t<<6|t>>>26)+n<<0,s+=(n^(t|~o))+h[3]-1894986606,s=(s<<10|s>>>22)+t<<0,o+=(t^(s|~n))+h[10]-1051523,o=(o<<15|o>>>17)+s<<0,n+=(s^(o|~t))+h[1]-2054922799,n=(n<<21|n>>>11)+o<<0,t+=(o^(n|~s))+h[8]+1873313359,t=(t<<6|t>>>26)+n<<0,s+=(n^(t|~o))+h[15]-30611744,s=(s<<10|s>>>22)+t<<0,o+=(t^(s|~n))+h[6]-1560198380,o=(o<<15|o>>>17)+s<<0,n+=(s^(o|~t))+h[13]+1309151649,n=(n<<21|n>>>11)+o<<0,t+=(o^(n|~s))+h[4]-145523070,t=(t<<6|t>>>26)+n<<0,s+=(n^(t|~o))+h[11]-1120210379,s=(s<<10|s>>>22)+t<<0,o+=(t^(s|~n))+h[2]+718787259,o=(o<<15|o>>>17)+s<<0,n+=(s^(o|~t))+h[9]-343485551,n=(n<<21|n>>>11)+o<<0,this.first?(this.h0=t+1732584193<<0,this.h1=n-271733879<<0,this.h2=o-1732584194<<0,this.h3=s+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+n<<0,this.h2=this.h2+o<<0,this.h3=this.h3+s<<0)},Md5.prototype.hex=function(){this.finalize();var t=this.h0,n=this.h1,o=this.h2,s=this.h3;return HEX_CHARS[t>>4&15]+HEX_CHARS[t&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[n&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[o&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[s&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var t=this.h0,n=this.h1,o=this.h2,s=this.h3;return[t&255,t>>8&255,t>>16&255,t>>24&255,n&255,n>>8&255,n>>16&255,n>>24&255,o&255,o>>8&255,o>>16&255,o>>24&255,s&255,s>>8&255,s>>16&255,s>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(16),n=new Uint32Array(t);return n[0]=this.h0,n[1]=this.h1,n[2]=this.h2,n[3]=this.h3,t},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var t,n,o,s="",c=this.array(),d=0;d<15;)t=c[d++],n=c[d++],o=c[d++],s+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[(t<<4|n>>>4)&63]+BASE64_ENCODE_CHAR[(n<<2|o>>>6)&63]+BASE64_ENCODE_CHAR[o&63];return t=c[d],s+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[t<<4&63]+"==",s};var exports=createMethod();COMMON_JS?module.exports=exports:root.md5=exports})()})(md5$1);var md5Exports=md5$1.exports;const md5=getDefaultExportFromCjs(md5Exports),EntityExt=React.forwardRef(EntityExtComponent);function EntityExtComponent({layerId:t,featureId:n,draggable:o,unselectable:s,legacyLocationPropertyKey:c,hideIndicator:d,...h},p){var E;const y=React.useRef(null);return React.useLayoutEffect(()=>{var L;attachTag((L=y.current)==null?void 0:L.cesiumElement,{layerId:t||h.id,featureId:n,draggable:o,unselectable:s,legacyLocationPropertyKey:c,hideIndicator:d})},[o,n,t,c,h.id,s,d,(E=y.current)==null?void 0:E.cesiumElement]),jsxRuntimeExports.jsx(Is$1,{ref:_default(p,y),...h})}function attachTag(t,n){if(t){if(t instanceof Cesium$1.Cesium3DTileset){t[tagKey]=n;return}if(t instanceof Cesium$1.Cesium3DTileFeature||t instanceof Cesium$1.Cesium3DTilePointFeature||t instanceof Cesium$1.Model||t instanceof Cesium$1.ImageryLayer){t[tagKey]=n;return}if(t instanceof Cesium$1.Primitive){t[tagKey]=n;return}if(t instanceof Cesium$1.GroundPrimitive){t[tagKey]=n;return}t.properties||(t.properties=new Cesium$1.PropertyBag);for(const o of tagKeys)!(o in n)&&t.properties.hasProperty(`reearth_${o}`)?t.properties.removeProperty(`reearth_${o}`):t.properties[`reearth_${o}`]=n[o]}}function getTag(t){if(t){if(t instanceof Cesium$1.Cesium3DTileset||t instanceof Cesium$1.Cesium3DTileFeature||t instanceof Cesium$1.Cesium3DTilePointFeature||t instanceof Cesium$1.Model||t instanceof Cesium$1.ImageryLayer||t instanceof Cesium$1.Primitive||t instanceof Cesium$1.GroundPrimitive)return t[tagKey];if(t.properties)return Object.fromEntries(Object.entries(t.properties).map(([n,o])=>tagKeys.includes(n.replace("reearth_",""))?[n.replace("reearth_",""),o]:null).filter(n=>!!n))}}const tagObj={draggable:1,featureId:1,layerId:1,unselectable:1,originalProperties:1,computedFeature:1,hideIndicator:1,appearanceType:1,featureIndex:1,isFeatureSelected:1},tagKeys=Object.keys(tagObj),tagKey="__reearth_tag",extractSimpleLayer=t=>{const n=t&&"layer"in t?t.layer:t;if((n==null?void 0:n.type)==="simple")return n},extractSimpleLayerData=t=>{var n;return(n=extractSimpleLayer(t))==null?void 0:n.data},toColor=t=>{if(!t||typeof t!="string")return;const n=t.match(/^#([A-Fa-f0-9]{6})([A-Fa-f0-9]{2})$|^#([A-Fa-f0-9]{3})([A-Fa-f0-9])$/);if(!n)return Cesium$1.Color.fromCssColorString(t);const o=parseInt(n[4]?n[4].repeat(2):n[2],16)/255;return Cesium$1.Color.fromCssColorString(`#${n[1]??n[3]}`).withAlpha(o)},toTimeInterval=t=>{if(t)return new Cesium$1.TimeIntervalCollection([new Cesium$1.TimeInterval({start:Cesium$1.JulianDate.fromDate(t[0]),stop:t[1]?Cesium$1.JulianDate.fromDate(t[1]):Cesium$1.Iso8601.MAXIMUM_VALUE})])},toDistanceDisplayCondition=(t,n)=>typeof t=="number"||typeof n=="number"?new Cesium$1.DistanceDisplayCondition(t??0,n??Number.MAX_VALUE):void 0,generateIDWithMD5=t=>{const n=md5.create();return n.update(t),n.hex()},usePick=(t,n)=>{const o=React.useMemo(()=>t?pick(t,n):void 0,[t,n]);return React.useMemo(()=>o,[JSON.stringify(o)])},useHooks$7=({id:t,index:n,edge:o,isHovered:s,fillColor:c,trs:d,hoverColor:h,onMouseDown:p,onMouseMove:y,onMouseUp:E})=>{const{viewer:L}=De$1(),[F]=React.useState(()=>new Cesium$1.CallbackProperty(()=>{const J=new Cesium$1.Cartesian3,lt=new Cesium$1.Cartesian3,yt=Cesium$1.Matrix4.fromTranslationRotationScale(d);return Cesium$1.Matrix4.multiplyByPoint(yt,o.start,J),Cesium$1.Matrix4.multiplyByPoint(yt,o.end,lt),[J,lt]},!1)),N=React.useRef(!1),[z]=React.useState(()=>new Cesium$1.ColorMaterialProperty(new Cesium$1.CallbackProperty(()=>N.current?h??c:c,!1)));React.useEffect(()=>{N.current=s},[s]);const H=React.useCallback(J=>{var yt,pi;!L||((pi=getTag((yt=L.scene.pick(J.position))==null?void 0:yt.id))==null?void 0:pi.layerId)!==t||p==null||p(J,{layerId:t,index:n})},[p,t,n,L]),W=React.useCallback(J=>{y==null||y(J,{layerId:t,index:n})},[y,n,t]),oe=React.useCallback(J=>{E==null||E(J,{layerId:t,index:n})},[E,n,t]),nt=React.useMemo(()=>new Cesium$1.ScreenSpaceEventHandler(L==null?void 0:L.scene.canvas),[L]);return React.useEffect(()=>{nt.setInputAction(H,Cesium$1.ScreenSpaceEventType.LEFT_DOWN),nt.setInputAction(W,Cesium$1.ScreenSpaceEventType.MOUSE_MOVE),nt.setInputAction(oe,Cesium$1.ScreenSpaceEventType.LEFT_UP)},[nt,H,W,oe]),React.useEffect(()=>()=>nt.destroy(),[nt]),{cbp:F,outlineColor:z}},Edge=React.memo(function t({layerId:n,featureId:o,index:s,edge:c,isHovered:d,fillColor:h,trs:p,width:y,hoverColor:E,availability:L,distanceDisplayCondition:F,onMouseDown:N,onMouseMove:z,onMouseUp:H,hideIndicator:W}){const{cbp:oe,outlineColor:nt}=useHooks$7({id:n,index:s,edge:c,isHovered:d,fillColor:h,trs:p,hoverColor:E,onMouseDown:N,onMouseMove:z,onMouseUp:H});return jsxRuntimeExports.jsx(EntityExt,{layerId:n,featureId:o,availability:L,hideIndicator:W,children:jsxRuntimeExports.jsx(ua$1,{positions:oe,width:y,material:nt,arcType:Cesium$1.ArcType.NONE,distanceDisplayCondition:F})})}),context=React.createContext({}),useContext=()=>React.useContext(context),convertCartesian3ToPosition=(t,n)=>{if(!n)return;const o=t==null?void 0:t.scene.globe.ellipsoid.cartesianToCartographic(n);if(o)return{lat:Cesium$1.Math.toDegrees(o.latitude),lng:Cesium$1.Math.toDegrees(o.longitude),height:o.height}},translationWithClamping=(t,n,o)=>{if(!n){const s=Cesium$1.Cartographic.fromCartesian(t.translation,void 0,new Cesium$1.Cartographic),c=s.height-t.scale.z/2,d=o;c<d&&(s.height+=d-c,Cesium$1.Cartographic.toCartesian(s,void 0,t.translation))}},getModelFromTileContent=t=>{if(!t.featuresLength&&"_model"in t&&t._model instanceof Cesium$1.Model)return t._model};function lookupFeatures(t,n){var c;if(!t)return;const o=getModelFromTileContent(t);if(o)return n(o,t);const s=t.featuresLength;for(let d=0;d<s;d++){const h=t.getFeature(d);h&&n(h,t,d)}(c=t.innerContents)==null||c.forEach(d=>lookupFeatures(d,n))}const findFeatureFrom3DTile=(t,n,o)=>{var c;let s;if(n&&(s=(c=o==null?void 0:o.find(n))==null?void 0:c[0],s&&s instanceof Cesium$1.Cesium3DTileFeature)||(lookupFeatures(t.content,d=>{const h=getTag(d);(h==null?void 0:h.featureId)===n&&(s=d)}),s&&s instanceof Cesium$1.Cesium3DTileFeature))return s;for(const d of t.children){const h=findFeatureFrom3DTile(d,n);if(h)return h}};function findEntity(t,n,o,s){const c=o??n,d=o?"featureId":"layerId";if(!c)return;let h=t.entities.getById(c);if(h||(h=t.entities.values.find(p=>{var y;return((y=getTag(p))==null?void 0:y[d])===c}),h))return h;for(const p of[t.dataSourceDisplay.dataSources,t.dataSources])for(let y=0;y<p.length;y++){const L=p.get(y).entities.values.find(F=>{var N;return((N=getTag(F))==null?void 0:N[d])===c});if(L)return L}for(let p=0;p<t.scene.primitives.length;p++){const y=t.scene.primitives.get(p);if(!(!(y instanceof Cesium$1.Cesium3DTileset)&&!(y instanceof Cesium$1.Primitive)&&!(y instanceof Cesium$1.GroundPrimitive))){if(n&&!o){const E=getTag(y);if(E!=null&&E.layerId&&n&&(E==null?void 0:E.layerId)===n)return y;continue}if(!y.isDestroyed()&&!s&&y instanceof Cesium$1.Cesium3DTileset){const E=findFeatureFrom3DTile(y.root,o);if(E)return E}}}for(let p=0;p<t.imageryLayers.length;p++){const y=t.imageryLayers.get(p),E=getTag(y);if((E==null?void 0:E.layerId)===n)return y}}const findFeaturesFrom3DTile=(t,n,o,s=new Set)=>{lookupFeatures(t.content,c=>{const d=getTag(c);if(n.includes((d==null?void 0:d.featureId)??"")){const h=o==null?void 0:o(c);h?s.add(h):s.add(c)}});for(const c of t.children)findFeaturesFrom3DTile(c,n,o,s)},filterEntity=(t,n,o,s)=>{const c=[];for(const d of t){const h=getTag(d);if((h==null?void 0:h.layerId)===n&&o.includes(h.featureId||"")){const p=s==null?void 0:s(d);p?c.push(p):d&&c.push(d)}}return c},findEntityFromDatasource=(t,n,o,s)=>{let c=[];for(const d of[t.dataSourceDisplay.dataSources,t.dataSources])for(let h=0;h<d.length;h++){const p=d.get(h).entities.values,y=filterEntity(p,n,o,s);y.length&&(c=c.concat(y))}return c},findTile3DFeaturesFromScene=(t,n,o,s)=>{const c=new Set;for(let d=0;d<t.scene.primitives.length;d++){const h=t.scene.primitives.get(d);if(!(h instanceof Cesium$1.Cesium3DTileset)||h.isDestroyed())continue;const p=getTag(h);if((p==null?void 0:p.layerId)!==n)continue;const y=p.featureIndex;if(y)return o.flatMap(L=>y.find(L)).filter(L=>!!L).map(L=>s==null?void 0:s(L,h)).filter(L=>!!L);if(findFeaturesFrom3DTile(h.root,o,s,c),c.size)return Array.from(c.values())}return[]};function findFeaturesFromLayer(t,n,o,s){const c=filterEntity(t.entities.values,n,o,s);if(c.length)return c;const d=findEntityFromDatasource(t,n,o,s);return d.length?d:findTile3DFeaturesFromScene(t,n,o,s)}const getEntityContent=(t,n,o)=>{var c;const s={description:{type:"html",value:t instanceof Cesium$1.ImageryLayerFeatureInfo?t.description:(c=t.description)==null?void 0:c.getValue(n)},attributes:{type:"table",value:!(t instanceof Cesium$1.Entity)&&"properties"in t&&t.properties&&typeof t.properties=="object"?propertiesToTableContent(t.properties):t instanceof Cesium$1.Entity&&t.properties?propertiesToTableContent(t.properties.getValue(n)):[]}};return o?s[o]:s.attributes??s.description};function propertiesToTableContent(t){return Object.entries(t).reduce((n,[o,s])=>[...n,{key:o,value:s}],[])}function getPixelRatio(t){return t.pixelRatio}const convertEntityProperties=(t,n)=>{var s;const o=(s=n.properties)==null?void 0:s.getValue(t);return n.properties&&o?Object.fromEntries(n.properties.propertyNames.map(c=>[c,o[c]])):{}},convertEntityDescription=(t,n)=>{var s;const o=(s=n.description)==null?void 0:s.getValue(t);if(typeof o=="string")return o},convertCesium3DTileFeatureProperties=t=>Object.fromEntries(t.getPropertyIds().map(n=>[n,t.getProperty(n)])),convertObjToComputedFeature=(t,n)=>{if(n instanceof Cesium$1.Cesium3DTileFeature||n instanceof Cesium$1.Cesium3DTilePointFeature){const o=getTag(n);return[o==null?void 0:o.layerId,(o==null?void 0:o.computedFeature)??{type:"computedFeature",id:(o==null?void 0:o.featureId)??"",properties:convertCesium3DTileFeatureProperties(n)}]}if(n instanceof Cesium$1.Model){const o=getTag(n);return[o==null?void 0:o.layerId,{type:"computedFeature",id:(o==null?void 0:o.featureId)??"",properties:{}}]}if(n instanceof Cesium$1.Entity||"id"in n&&n.id instanceof Cesium$1.Entity){const o=n instanceof Cesium$1.Entity?n:n.id,s=getTag(o);return[s==null?void 0:s.layerId,(s==null?void 0:s.computedFeature)??{type:"computedFeature",id:(s==null?void 0:s.featureId)??"",properties:convertEntityProperties(t,o),metaData:{description:convertEntityDescription(t,o)}}]}},updateTrs=(t,n,o,s,c)=>{const{height:d,width:h,length:p,heading:y,pitch:E,roll:L}=n??{},F=(s==null?void 0:s.type)==="Point"?s.coordinates:n!=null&&n.location?[n.location.lng,n.location.lat,n.location.height??0]:void 0,N=F?Cesium$1.Cartesian3.fromDegrees(F[0],F[1],F[2]):void 0;N&&Cesium$1.Cartesian3.clone(N,t.translation),c||translationWithClamping(t,!!c,o);const z=y&&E&&L?Cesium$1.Matrix3.fromHeadingPitchRoll(new Cesium$1.HeadingPitchRoll(y,E,L)):Cesium$1.Matrix3.getRotation(Cesium$1.Matrix4.getMatrix3(Cesium$1.Transforms.eastNorthUpToFixedFrame(t.translation),new Cesium$1.Matrix3),new Cesium$1.Matrix3);return Cesium$1.Quaternion.clone(Cesium$1.Quaternion.fromRotationMatrix(z),t.rotation),Cesium$1.Cartesian3.clone(new Cesium$1.Cartesian3(h||100,p||100,d||100),t.scale),t};function screenProjectVector(t,n,o,s,c){const d=new Cesium$1.Ray;d.origin=n,d.direction=o;const h=t.cartesianToCanvasCoordinates(Cesium$1.Ray.getPoint(d,0),new Cesium$1.Cartesian2),p=t.cartesianToCanvasCoordinates(Cesium$1.Ray.getPoint(d,s),new Cesium$1.Cartesian2);return Cesium$1.Cartesian2.subtract(p,h,c)}const dotMousePosition=(t,n,o,s)=>{const c=Cesium$1.Cartesian2.subtract(n.endPosition,n.startPosition,new Cesium$1.Cartesian2),d=screenProjectVector(t,o,s,1,new Cesium$1.Cartesian2),h=Cesium$1.Cartesian2.normalize(d,new Cesium$1.Cartesian2),p=Cesium$1.Cartesian2.magnitude(d),y=Cesium$1.Cartesian2.dot(c,h);return{pixelsPerStep:p,moveAmount:y/p}},computeMoveAmount=(t,n,o,s)=>{const c=Cesium$1.Cartesian2.subtract(n.endPosition,n.startPosition,new Cesium$1.Cartesian2),d=screenProjectVector(t,o,s,1,new Cesium$1.Cartesian2),h=Cesium$1.Cartesian2.normalize(d,new Cesium$1.Cartesian2),p=Cesium$1.Cartesian2.magnitude(d),y=Cesium$1.Cartesian2.dot(c,h);return{pixelsPerStep:p,moveAmount:y/p}},computeMouseMoveAmount=(t,n,o,s,c)=>{const{moveAmount:d,pixelsPerStep:h}=dotMousePosition(t,n,o,s),p=d/c;return{pixelLengthAfterScaling:h*c+h*c*p,scaleAmount:p}};function setPlaneDimensions(t,n,o){n===Cesium$1.Axis.X?(o.x=t.y,o.y=t.z):n===Cesium$1.Axis.Y?(o.x=t.x,o.y=t.z):n===Cesium$1.Axis.Z&&(o.x=t.x,o.y=t.y)}const useHooks$6=({property:t,geometry:n,feature:o,onLayerEdit:s})=>{const{viewer:c}=De$1(),d=useContext(),{fillColor:h,outlineColor:p,activeOutlineColor:y,outlineWidth:E,draggableOutlineColor:L,activeDraggableOutlineColor:F,draggableOutlineWidth:N,pointFillColor:z,pointOutlineColor:H,activePointOutlineColor:W,axisLineColor:oe,cursor:nt,allowEnterGround:J}=t??{},[lt,yt]=React.useState(0),[pi]=React.useState(()=>updateTrs(new Cesium$1.TranslationRotationScale,t,lt,n,J)),Ai=React.useRef(!1),Vd=React.useCallback(()=>{Ai.current||!J&&c&&(Ai.current=!0,sampleTerrainHeightFromCartesian(c.scene,pi.translation).then(mf=>{yt(mf??0),Ai.current=!1}))},[J,c,pi]),{requestRender:Gd}=useContext();React.useEffect(()=>{updateTrs(pi,t,lt,n,J),Gd==null||Gd(),Vd()},[t,n,pi,c,lt,Vd,J,Gd]);const md=React.useMemo(()=>({fillColor:toColor(h),outlineColor:toColor(p),activeOutlineColor:toColor(y),draggableOutlineColor:toColor(L),activeDraggableOutlineColor:toColor(F),outlineWidth:E,draggableOutlineWidth:N,fill:!!h,outline:!!p}),[h,p,y,E,N,L,F]),tf=React.useMemo(()=>({pointFillColor:toColor(z)??md.fillColor,pointOutlineColor:toColor(H)??md.outlineColor,activePointOutlineColor:toColor(W)??md.outlineColor,axisLineColor:toColor(oe)??md.outlineColor}),[z,H,oe,md,W]),nf=React.useRef(),ef=React.useCallback((mf,{index:ff})=>{c&&(updateMapController(c,!1),nf.current=ff)},[c]),mt=React.useRef(),Ee=React.useCallback((mf,{position:ff,oppositePosition:pf,pointLocal:xf,index:Rf,layerId:Vf})=>{var Df;if(nf.current!==Rf||!ff||!pf||!xf||!c)return;const Lf=mf.startPosition;if(mt.current===void 0){mt.current=new Cesium$1.Cartesian2(Lf.x,Lf.y);return}const Pf=new Cesium$1.Cartesian2(Lf.x,Lf.y),Uf=Cesium$1.Cartesian3.subtract(ff,pf,new Cesium$1.Cartesian3),Bf=Cesium$1.Cartesian3.magnitude(Uf),Tf=Cesium$1.Cartesian3.normalize(Uf,new Cesium$1.Cartesian3),{scaleAmount:Xd,pixelLengthAfterScaling:gf}=computeMouseMoveAmount(c.scene,{startPosition:mt.current,endPosition:Pf},ff,Tf,Bf);mt.current=Pf.clone();const yf=Cesium$1.Cartesian3.normalize(xf,new Cesium$1.Cartesian3),hf=Math.abs(Cesium$1.Cartesian3.dot(new Cesium$1.Cartesian3(1,0,0),yf)),df=Math.abs(Cesium$1.Cartesian3.dot(new Cesium$1.Cartesian3(0,1,0),yf)),bf=Math.abs(Cesium$1.Cartesian3.dot(new Cesium$1.Cartesian3(0,0,1),yf)),Ef=hf&&df&&bf;if(Xd<0&&(yf.x&&yf.y&&yf.y?gf/Math.sqrt(2):gf)<20)return;const wf=Cesium$1.Cartesian3.multiplyByScalar(Cesium$1.Cartesian3.abs(Cesium$1.Cartesian3.multiplyComponents(pi.scale,Ef?new Cesium$1.Cartesian3(1,1,1):yf,new Cesium$1.Cartesian3),new Cesium$1.Cartesian3),Xd,new Cesium$1.Cartesian3),vf=Cesium$1.Cartesian3.multiplyByScalar(Uf,Xd/2,new Cesium$1.Cartesian3),Of=yf.z<0,Gf=Xd>0;!J&&Gf&&Of&&Cesium$1.Cartographic.fromCartesian(pi.translation,void 0,new Cesium$1.Cartographic).height-pi.scale.z/2-Math.abs(vf.z)<0&&(wf.z=0);const If=new Cesium$1.Cartesian3,zf=new Cesium$1.Cartesian3;Cesium$1.Cartesian3.add(pi.scale,wf,If),Cesium$1.Cartesian3.add(pi.translation,vf,zf);const Mf=c==null?void 0:c.scene.globe.ellipsoid.cartesianToCartographic(zf);s==null||s({layerId:Vf,scale:{width:If.x,length:If.y,height:If.z,location:{lat:Cesium$1.Math.toDegrees(Mf==null?void 0:Mf.latitude),lng:Cesium$1.Math.toDegrees(Mf==null?void 0:Mf.longitude),height:Mf==null?void 0:Mf.height}}}),(Df=d==null?void 0:d.onLayerEdit)==null||Df.call(d,{layerId:Vf,scale:{width:If.x,length:If.y,height:If.z,location:{lat:Cesium$1.Math.toDegrees(Mf==null?void 0:Mf.latitude),lng:Cesium$1.Math.toDegrees(Mf==null?void 0:Mf.longitude),height:Mf==null?void 0:Mf.height}}})},[pi,c,J,d,s]),sl=React.useCallback(()=>{c&&(nf.current=void 0,mt.current=void 0,updateMapController(c,!0))},[c]),Zd=React.useRef(),rf=React.useCallback((mf,{index:ff})=>{c&&(Zd.current=ff,updateMapController(c,!1))},[c]),uf=React.useRef(),lf=React.useCallback((mf,{index:ff,layerId:pf})=>{var Xd;if(Zd.current!==ff)return;const xf=mf.startPosition;if(uf.current===void 0){uf.current=xf.x;return}const Rf=xf.x-uf.current;uf.current=xf.x;const Vf=.05,Lf=new Cesium$1.HeadingPitchRoll(0,0,0);Lf.heading=-Rf*Vf,Lf.pitch=0,Lf.roll=0;const Pf=new Cesium$1.Quaternion;Cesium$1.Quaternion.multiply(pi.rotation,Cesium$1.Quaternion.fromHeadingPitchRoll(Lf),Pf);const{heading:Uf,pitch:Bf,roll:Tf}=Cesium$1.HeadingPitchRoll.fromQuaternion(Pf);s==null||s({layerId:pf,rotate:{heading:Uf,pitch:Bf,roll:Tf}}),(Xd=d==null?void 0:d.onLayerEdit)==null||Xd.call(d,{layerId:pf,rotate:{heading:Uf,pitch:Bf,roll:Tf}})},[pi,d,s]),af=React.useCallback(()=>{c&&(Zd.current=void 0,uf.current=void 0,updateMapController(c,!0))},[c]);React.useEffect(()=>{document.body.style.cursor=nt||"default"},[nt]);const of=React.useMemo(()=>toTimeInterval(o==null?void 0:o.interval),[o==null?void 0:o.interval]),sf=React.useMemo(()=>toDistanceDisplayCondition(t==null?void 0:t.near,t==null?void 0:t.far),[t==null?void 0:t.near,t==null?void 0:t.far]);return{style:md,trs:pi,scalePointStyle:tf,availability:of,distanceDisplayCondition:sf,handlePointMouseDown:ef,handlePointMouseMove:Ee,handlePointMouseUp:sl,handleEdgeMouseDown:rf,handleEdgeMouseMove:lf,handleEdgeMouseUp:af}},useHooks$5=({id:t,index:n,scalePoint:o,isHovered:s,pointOutlineColor:c,hoverPointOutlineColor:d,axisLineColor:h,trs:p,dimensions:y,onPointMouseDown:E,onPointMouseMove:L,onPointMouseUp:F})=>{const N=`${t}-${n}`,z=`${t}-opposite-${n}`,{viewer:H}=De$1(),[W]=React.useState(()=>{const nf=new Cesium$1.Cartesian3,ef=new Cesium$1.Cartesian3,mt=new Cesium$1.CallbackProperty(()=>{const sl=Cesium$1.Matrix4.fromTranslationRotationScale(p);return Cesium$1.Matrix4.multiplyByPoint(sl,o.point,nf),nf},!1),Ee=new Cesium$1.CallbackProperty(()=>{const sl=Cesium$1.Matrix4.fromTranslationRotationScale(p);return Cesium$1.Matrix4.multiplyByPoint(sl,o.oppositePoint,ef),ef},!1);return{point:mt,oppositePoint:Ee,axisLine:new Cesium$1.CallbackProperty(()=>[mt.getValue(Cesium$1.JulianDate.now()),Ee.getValue(Cesium$1.JulianDate.now())],!1)}}),oe=React.useRef(!1),[nt]=React.useState(()=>new Cesium$1.CallbackProperty(()=>oe.current?d:c,!1));React.useEffect(()=>{oe.current=s},[s]);const[J]=React.useState(()=>new Cesium$1.Cartesian3(y==null?void 0:y.width,y==null?void 0:y.length,y==null?void 0:y.height)),[lt]=React.useState(()=>new Cesium$1.CallbackProperty(()=>J,!1)),[yt]=React.useState(()=>new Cesium$1.CallbackProperty(()=>Cesium$1.Quaternion.IDENTITY,!1)),pi=React.useMemo(()=>new Cesium$1.PolylineDashMaterialProperty({color:h,dashLength:8}),[h]),Ai=React.useRef(!1),Vd=React.useCallback(nf=>{var mt,Ee;if(!H)return;const ef=(Ee=getTag((mt=H.scene.pick(nf.position))==null?void 0:mt.id))==null?void 0:Ee.layerId;Ai.current=ef===z,(ef===N||ef===z)&&(E==null||E(nf,{layerId:Ai.current?z:N,index:n,opposite:Ai.current}))},[E,n,N,z,H]),Gd=React.useCallback(nf=>{L==null||L(nf,{layerId:Ai.current?z:N,index:n,opposite:Ai.current,position:Ai.current?W.oppositePoint.getValue(Cesium$1.JulianDate.now()):W.point.getValue(Cesium$1.JulianDate.now()),oppositePosition:Ai.current?W.point.getValue(Cesium$1.JulianDate.now()):W.oppositePoint.getValue(Cesium$1.JulianDate.now()),pointLocal:Ai?o.oppositePoint:o.point})},[L,n,W,o,N,z]),md=React.useCallback(nf=>{F==null||F(nf,{layerId:Ai.current?z:N,index:n,opposite:Ai.current})},[F,n,N,z]);React.useEffect(()=>{Cesium$1.Cartesian3.clone(new Cesium$1.Cartesian3(y==null?void 0:y.width,y==null?void 0:y.length,y==null?void 0:y.height),J)},[y,J]);const tf=React.useMemo(()=>new Cesium$1.ScreenSpaceEventHandler(H==null?void 0:H.scene.canvas),[H]);return React.useEffect(()=>{tf.setInputAction(Vd,Cesium$1.ScreenSpaceEventType.LEFT_DOWN),tf.setInputAction(Gd,Cesium$1.ScreenSpaceEventType.MOUSE_MOVE),tf.setInputAction(md,Cesium$1.ScreenSpaceEventType.LEFT_UP)},[tf,Vd,Gd,md]),React.useEffect(()=>()=>tf.destroy(),[tf]),{entitiesPosition:W,pointOutlineColorCb:nt,cesiumDimensionsCallbackProperty:lt,orientation:yt,axisColorProperty:pi}},ScalePoints=React.memo(function t({layerId:n,featureId:o,index:s,scalePoint:c,isHovered:d,pointFillColor:h,pointOutlineColor:p,hoverPointOutlineColor:y,pointOutlineWidth:E,axisLineColor:L,axisLineWidth:F,trs:N,dimensions:z,visiblePoint:H,visibleAxisLine:W,availability:oe,distanceDisplayCondition:nt,onPointMouseDown:J,onPointMouseMove:lt,onPointMouseUp:yt,hideIndicator:pi}){const{entitiesPosition:Ai,pointOutlineColorCb:Vd,cesiumDimensionsCallbackProperty:Gd,orientation:md,axisColorProperty:tf}=useHooks$5({id:n,index:s,scalePoint:c,isHovered:d,pointOutlineColor:p,hoverPointOutlineColor:y,axisLineColor:L,trs:N,dimensions:z,onPointMouseDown:J,onPointMouseMove:lt,onPointMouseUp:yt});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(EntityExt,{layerId:`${n}-${s}`,featureId:`${o}-${s}`,position:Ai.point,orientation:md,hideIndicator:pi,availability:oe,children:jsxRuntimeExports.jsx(Cs$1,{show:H,dimensions:Gd,material:h,fill:!!h,outline:!!p,outlineColor:Vd,outlineWidth:E,distanceDisplayCondition:nt})}),jsxRuntimeExports.jsx(EntityExt,{layerId:`${n}-opposite-${s}`,featureId:`${o}-opposite-${s}`,position:Ai.oppositePoint,orientation:md,hideIndicator:pi,availability:oe,children:jsxRuntimeExports.jsx(Cs$1,{show:H,dimensions:Gd,material:h,fill:!!h,outline:!!p,outlineColor:Vd,outlineWidth:E,distanceDisplayCondition:nt})}),jsxRuntimeExports.jsx(EntityExt,{layerId:`${n}-axis-line-${s}`,featureId:`${o}-axis-line-${s}`,hideIndicator:pi,availability:oe,children:jsxRuntimeExports.jsx(ua$1,{positions:Ai.axisLine,show:W,material:tf,width:F,arcType:Cesium$1.ArcType.NONE,distanceDisplayCondition:nt})})]})}),useHooks$4=({planeLocal:t,isActive:n,outlineColor:o,activeOutlineColor:s,trs:c})=>{const d=React.useMemo(()=>new Cesium$1.CallbackProperty(()=>c.translation,!1),[c]),[h,p,y]=React.useMemo(()=>[new Cesium$1.CallbackProperty(()=>{const F=new Cesium$1.Matrix4,N=Cesium$1.Matrix4.fromScale(c.scale,F);return Cesium$1.Plane.transform(t,N,new Cesium$1.Plane(Cesium$1.Cartesian3.UNIT_Z,0))},!1),new Cesium$1.CallbackProperty(()=>{const F=t.normal.x?Cesium$1.Axis.X:t.normal.y?Cesium$1.Axis.Y:Cesium$1.Axis.Z,N=new Cesium$1.Cartesian3;return setPlaneDimensions(c.scale,F,N),N},!1),new Cesium$1.CallbackProperty(()=>c.rotation,!1)],[c,t]),E=React.useRef(!1),[L]=React.useState(()=>new Cesium$1.CallbackProperty(()=>E.current?s??o:o,!1));return React.useEffect(()=>{E.current=n},[n]),{cbRef:d,plane:h,dimension:p,orientation:y,outlineColorCb:L}},Side=React.memo(function t({layerId:n,featureId:o,planeLocal:s,isActive:c,fill:d,fillColor:h,outlineColor:p,activeOutlineColor:y,trs:E,availability:L,distanceDisplayCondition:F,hideIndicator:N}){const{cbRef:z,plane:H,dimension:W,orientation:oe,outlineColorCb:nt}=useHooks$4({planeLocal:s,isActive:c,outlineColor:p,activeOutlineColor:y,trs:E});return jsxRuntimeExports.jsx(EntityExt,{layerId:n,featureId:o,position:z,orientation:oe,availability:L,hideIndicator:N,children:jsxRuntimeExports.jsx(na$1,{plane:H,dimensions:W,fill:d,material:h,outlineWidth:1,outlineColor:nt,distanceDisplayCondition:F,outline:!0})})}),Box=React.memo(function t({property:n,geometry:o,isVisible:s,layer:c,feature:d,onLayerEdit:h}){const{show:p=!0,height:y=100,width:E=100,length:L=100,pointOutlineWidth:F,axisLineWidth:N,scalePoint:z=!0,axisLine:H=!0,activeBox:W,activeEdgeIndex:oe,activeScalePointIndex:nt,hideIndicator:J,disabledSelection:lt}=n??{},{style:yt,trs:pi,scalePointStyle:Ai,availability:Vd,distanceDisplayCondition:Gd,handlePointMouseDown:md,handlePointMouseMove:tf,handlePointMouseUp:nf,handleEdgeMouseDown:ef,handleEdgeMouseMove:mt,handleEdgeMouseUp:Ee}=useHooks$6({property:n,geometry:o,feature:d,onLayerEdit:h}),sl=(E+y+L)/3*.05,[Zd,rf]=[c==null?void 0:c.id,d==null?void 0:d.id];return!s||!p?null:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[SIDE_PLANES.map((uf,lf)=>jsxRuntimeExports.jsx(Side,{layerId:`${Zd}-plane-${SIDE_PLANE_NAMES[lf]}`,featureId:`${rf}-plane-${SIDE_PLANE_NAMES[lf]}`,planeLocal:uf,fill:yt.fill,fillColor:yt.fillColor,outlineColor:yt.outlineColor,isActive:lt?!!W:!1,activeOutlineColor:yt.activeOutlineColor,trs:pi,availability:Vd,distanceDisplayCondition:Gd,hideIndicator:J},`${Zd}-plane-${SIDE_PLANE_NAMES[lf]}`)),BOX_EDGES.map((uf,lf)=>jsxRuntimeExports.jsx(Edge,{featureId:`${rf}-edge${uf.isDraggable?"-draggable":""}-${lf}`,layerId:`${Zd}-edge${uf.isDraggable?"-draggable":""}-${lf}`,index:lf,edge:uf,isHovered:lt?oe===lf||!uf.isDraggable&&!!W:!1,width:uf.isDraggable&<?yt.draggableOutlineWidth:yt.outlineWidth,fillColor:uf.isDraggable?yt.draggableOutlineColor:yt.outlineColor,hoverColor:lt?uf.isDraggable?yt.activeDraggableOutlineColor:yt.activeOutlineColor:void 0,trs:pi,onMouseDown:uf.isDraggable&<?ef:void 0,onMouseMove:uf.isDraggable&<?mt:void 0,onMouseUp:uf.isDraggable&<?Ee:void 0,availability:Vd,distanceDisplayCondition:Gd,hideIndicator:J},`${Zd}-edge-${lf}`)),z&&SCALE_POINTS.map((uf,lf)=>jsxRuntimeExports.jsx(ScalePoints,{layerId:`${Zd}-scale-point`,featureId:`${rf}-scale-point`,index:lf,scalePoint:uf,trs:pi,isHovered:lt?nt===lf:!1,pointFillColor:lt?Ai.pointFillColor:void 0,pointOutlineColor:lt?Ai.pointOutlineColor:void 0,hoverPointOutlineColor:lt?Ai.activePointOutlineColor:void 0,pointOutlineWidth:F,axisLineColor:Ai.axisLineColor,axisLineWidth:N,dimensions:{width:sl,height:sl,length:sl},visiblePoint:z,visibleAxisLine:H&&nt===lf,onPointMouseDown:lt?md:void 0,onPointMouseMove:lt?tf:void 0,onPointMouseUp:lt?nf:void 0,availability:Vd,distanceDisplayCondition:Gd,hideIndicator:J},`${Zd}-scale-point-${lf}`))]})}),config$d={noLayer:!0};function Ellipse({id:t,isVisible:n,property:o,geometry:s,layer:c,feature:d}){const{show:h=!0}=o??{},p=React.useMemo(()=>(s==null?void 0:s.type)==="Point"?s.coordinates:void 0,[s==null?void 0:s.coordinates,s==null?void 0:s.type]),{heightReference:y,shadows:E,radius:L=1e3,fillColor:F,fill:N,classificationType:z}=o??{},{useTransition:H,translate:W}=(c==null?void 0:c.transition)??{},oe=React.useMemo(()=>p?Cesium$1.Cartesian3.fromDegrees(p[0],p[1],p[2]):void 0,[p]),nt=React.useMemo(()=>H&&W?new Cesium$1.CallbackProperty(()=>Cesium$1.Cartesian3.fromDegrees(...W),!1):void 0,[H,W]),J=React.useMemo(()=>H?new Cesium$1.CallbackProperty(()=>L,!1):L,[L]),lt=React.useMemo(()=>toColor(F),[F]),yt=React.useMemo(()=>toTimeInterval(d==null?void 0:d.interval),[d==null?void 0:d.interval]),pi=React.useMemo(()=>toDistanceDisplayCondition(o==null?void 0:o.near,o==null?void 0:o.far),[o==null?void 0:o.near,o==null?void 0:o.far]);return!n||!oe||!h?null:jsxRuntimeExports.jsx(EntityExt,{id:t,position:nt||oe,layerId:c==null?void 0:c.id,featureId:d==null?void 0:d.id,draggable:!0,availability:yt,properties:d==null?void 0:d.properties,children:jsxRuntimeExports.jsx(As$1,{semiMajorAxis:J,semiMinorAxis:J,material:lt,fill:N,heightReference:heightReference(y),classificationType:classificationType(z),shadows:shadowMode(E),distanceDisplayCondition:pi})})}const config$c={noLayer:!0};function Ellipsoid({id:t,isVisible:n,property:o,geometry:s,layer:c,feature:d}){const{show:h=!0}=o??{},p=React.useMemo(()=>(s==null?void 0:s.type)==="Point"?s.coordinates:o!=null&&o.position?[o.position.lng,o.position.lat,o.height??0]:o!=null&&o.location?[o.location.lng,o.location.lat,o.height??0]:void 0,[s==null?void 0:s.coordinates,s==null?void 0:s.type,o==null?void 0:o.height,o==null?void 0:o.location]),{heightReference:y,shadows:E,radius:L=1e3,fillColor:F}=o??{},N=React.useMemo(()=>p?Cesium$1.Cartesian3.fromDegrees(p[0],p[1],p[2]):void 0,[p]),z=React.useMemo(()=>new Cesium$1.Cartesian3(L,L,L),[L]),H=React.useMemo(()=>toColor$2(F),[F]),W=React.useMemo(()=>toTimeInterval(d==null?void 0:d.interval),[d==null?void 0:d.interval]),oe=React.useMemo(()=>toDistanceDisplayCondition(o==null?void 0:o.near,o==null?void 0:o.far),[o==null?void 0:o.near,o==null?void 0:o.far]);return!n||!N||!h?null:jsxRuntimeExports.jsx(EntityExt,{id:t,position:N,layerId:c==null?void 0:c.id,featureId:d==null?void 0:d.id,draggable:!0,legacyLocationPropertyKey:"default.position",availability:W,properties:d==null?void 0:d.properties,children:jsxRuntimeExports.jsx(Fs$1,{radii:z,material:H,heightReference:heightReference(y),shadows:shadowMode(E),distanceDisplayCondition:oe})})}const config$b={noLayer:!0},fragmentShaderSource=`in vec3 v_positionEC;
|
|
5795
5795
|
in vec3 v_normalEC;
|
|
5796
5796
|
in vec3 v_tangentEC;
|
|
5797
5797
|
in vec3 v_bitangentEC;
|
|
@@ -6700,7 +6700,7 @@ vec3 getTurboColormap(const float v) {
|
|
|
6700
6700
|
${reconstructPosition}
|
|
6701
6701
|
${turboColorMap}
|
|
6702
6702
|
${ambientOcclusionModulate}
|
|
6703
|
-
`,uniforms:{...pick(L,["color","frustumLength","blackPoint","whitePoint","gamma"]),globeDepthTexture:()=>(y==null?void 0:y())??N._depthTexture}});if(c){const z=createBilateralFilterStage({prefix:t,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:y,uniforms:{textureScale:n,...pick(L,["frustumLength","normalExponent","depthExponent"])}}),H=new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion_generate_and_filter`,stages:[F,z]});return N.uniforms.ambientOcclusionTexture=H.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[H,N],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:F,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:z,uniforms:["frustumLength","normalExponent","depthExponent"]},{stage:N,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}else return N.uniforms.ambientOcclusionTexture=F.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[F,N],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:F,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:N,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:E}=De$1(),L=E==null?void 0:E.scene,F=useInstance({owner:L==null?void 0:L.postProcessStages,keys:[n,s,o,c,d,h,p],create:()=>{const N=createAmbientOcclusionStage({textureScale:n,steps:s,directions:o,denoise:c,accurateNormalReconstruction:d,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:()=>L.context.uniformState.globeDepthTexture,uniforms:y});return N.enabled=t,N},transferOwnership:(N,z)=>(z==null||z.add(N),()=>{z==null||z.remove(N)})});return F.enabled=t,Object.assign(F.uniforms,y),L==null||L.requestRender(),usePreRender(()=>{const N=L==null?void 0:L.camera.frustum;if(N instanceof Cesium$1.PerspectiveFrustum){const z=1/Math.tan(N.fovy/2);F.uniforms.focalLength.x=z*N.aspectRatio,F.uniforms.focalLength.y=z}}),null},AmbientOcclusion=t=>{const n=De$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}};let image;function getImage(){if(image!=null)return image;image=document.createElement("canvas"),image.width=16,image.height=16;const t=image.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),image}const ControlPoint=({position:t,clampToGround:n=!1})=>{const o=React.useRef(t);o.current=t;const s=useConstant$2(()=>new CallbackProperty((d,h)=>"getValue"in o.current?o.current.getValue(d,h):o.current,!1)),c=React.useMemo(()=>({position:s,billboard:{image:getImage(),width:8,height:8,heightReference:n?HeightReference$1.CLAMP_TO_GROUND:HeightReference$1.NONE,disableDepthTestDistance:1/0}}),[n,s]);return jsxRuntimeExports.jsx(Is$1,{...c})};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}=De$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,E=!1,L=!1)=>{const F=L&&c,N=F?n:o;return E&&h.add(y),N.add(y)&&F&&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 E=0;E<s;E++){const L=n.order[E];h.has(L)&&(p.schedule(L),t()),L(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((F,N)=>(F[N]=createRenderStep(()=>o=!0),F),{}),h=F=>{d[F].process(c)},p=()=>{const F=performance.now();o=!1,c.delta=s?1e3/60:Math.max(Math.min(F-c.timestamp,maxElapsed),1),c.timestamp=F,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((F,N)=>{const z=d[N];return F[N]=(H,W=!1,oe=!1)=>(o||y(),z.schedule(H,W,oe)),F},{}),cancel:F=>stepsOrder.forEach(N=>d[N].cancel(F)),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 E=y.current;React.useInsertionEffect(()=>{E&&E.update(o,h)});const L=React.useRef(!!(o[optimizedAppearDataAttribute]&&!window.HandoffComplete));return useIsomorphicLayoutEffect$1(()=>{E&&(microtask.postRender(E.render),L.current&&E.animationState&&E.animationState.animateChanges())}),React.useEffect(()=>{E&&(E.updateFeatures(),!L.current&&E.animationState&&E.animationState.animateChanges(),L.current&&(L.current=!1,window.HandoffComplete=!0))}),E}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 E;const L={...React.useContext(MotionConfigContext),...p,layoutId:useLayoutId(p)},{isStatic:F}=L,N=useCreateMotionContext(p),z=s(p,F);if(!F&&isBrowser){N.visualElement=useVisualElement(c,z,L,n);const H=React.useContext(SwitchLayoutGroupContext),W=React.useContext(LazyContext).strict;N.visualElement&&(E=N.visualElement.loadFeatures(L,W,t,H))}return React__namespace.createElement(MotionContext.Provider,{value:N},E&&N.visualElement?React__namespace.createElement(E,{visualElement:N.visualElement,...L}):null,o(c,p,useMotionRef(z,N.visualElement,y),z,F,N.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,E=!1,L=!0;for(const F in n){const N=n[F];if(isCSSVariableName(F)){d[F]=N;continue}const z=numberValueTypes[F],H=getValueAsType(N,z);if(transformProps.has(F)){if(y=!0,h[F]=H,!L)continue;N!==(z.default||0)&&(L=!1)}else F.startsWith("origin")?(E=!0,p[F]=H):c[F]=H}if(n.transform||(y||s?c.transform=buildTransform(t.transform,o,L,s):c.transform&&(c.transform="none")),E){const{originX:F="50%",originY:N="50%",originZ:z=0}=p;c.transformOrigin=`${F} ${N} ${z}`}}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,...E},L,F,N){if(buildHTMLStyles(t,E,L,N),F){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:z,style:H,dimensions:W}=t;z.transform&&(W&&(H.transform=z.transform),delete z.transform),W&&(c!==void 0||d!==void 0||H.transform)&&(H.transformOrigin=calcSVGTransformOrigin(W,c!==void 0?c:.5,d!==void 0?d:.5)),n!==void 0&&(z.x=n),o!==void 0&&(z.y=o),s!==void 0&&(z.scale=s),h!==void 0&&buildSVGPath(z,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),E=filterProps(s,typeof o=="string",t),L=o!==React.Fragment?{...E,...y,ref:c}:{},{children:F}=s,N=React.useMemo(()=>isMotionValue(F)?F.get():F,[F]);return React.createElement(o,{...L,children:N})}}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 N in d)c[N]=resolveMotionValue(d[N]);let{initial:h,animate:p}=t;const y=isControllingVariants(t),E=isVariantNode(t);n&&E&&!y&&t.inherit!==!1&&(h===void 0&&(h=n.initial),p===void 0&&(p=n.animate));let L=o?o.initial===!1:!1;L=L||h===!1;const F=L?p:h;return F&&typeof F!="boolean"&&!isAnimationControls(F)&&(Array.isArray(F)?F:[F]).forEach(z=>{const H=resolveVariantFromProps(t,z);if(!H)return;const{transitionEnd:W,transition:oe,...nt}=H;for(const J in nt){let lt=nt[J];if(Array.isArray(lt)){const yt=L?lt.length-1:0;lt=lt[yt]}lt!==null&&(c[J]=lt)}for(const J in W)c[J]=W[J]}),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:E,onTapCancel:L,globalTapTarget:F}=this.node.getProps();!F&&!isNodeOrChild(this.node.current,p.target)?L&&L(p,y):E&&E(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,E)=>{const{onTap:L}=this.node.getProps();L&&L(y,E)})};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:E}=y;if(this.isInView===E||(this.isInView=E,d&&!E&&this.hasEnteredView))return;E&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",E);const{onViewportEnter:L,onViewportLeave:F}=this.node.getProps(),N=E?L:F;N&&N(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:E,...L}){return!!Object.keys(L).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 E=n[y];if(typeof E=="string"&&isCSSVariableToken(E)){const L=getVariableValue(E,o.current);L!==void 0&&(n[y]=L)}}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 E=n[y];typeof E=="string"&&(n[y]=parseFloat(E))}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,E])=>{o.getValue(y).set(E)}),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:E}=this.options;if(!E&&!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 L=this.initPlayback(n,o);L!==!1&&(this._resolved={keyframes:n,finalKeyframe:o,...L},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=E=>{const L=E*h,F=L*t,N=L-o,z=calcAngularFreq(E,h),H=Math.exp(-F);return safeMin-N/z*H},d=E=>{const F=E*h*t,N=F*o+o,z=Math.pow(h,2)*Math.pow(E,2)*t,H=Math.exp(-F),W=calcAngularFreq(Math.pow(E,2),h);return(-c(E)+safeMin>0?-1:1)*((N-z)*H)/W}):(c=E=>{const L=Math.exp(-E*t),F=(E-o)*t+1;return-safeMin+L*F},d=E=>{const L=Math.exp(-E*t),F=(o-E)*(t*t);return L*F});const p=5/t,y=approximateRoot(c,d,p);if(t=secondsToMilliseconds(t),isNaN(y))return{stiffness:100,damping:10,duration:t};{const E=Math.pow(y,2)*s;return{stiffness:E,damping:h*2*Math.sqrt(s*E),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:E,duration:L,velocity:F,isResolvedFromDuration:N}=getSpringOptions({...s,velocity:-millisecondsToSeconds(s.velocity||0)}),z=F||0,H=y/(2*Math.sqrt(p*E)),W=d-c,oe=millisecondsToSeconds(Math.sqrt(p/E)),nt=Math.abs(W)<5;o||(o=nt?.01:2),n||(n=nt?.005:.5);let J;if(H<1){const lt=calcAngularFreq(oe,H);J=yt=>{const pi=Math.exp(-H*oe*yt);return d-pi*((z+H*oe*W)/lt*Math.sin(lt*yt)+W*Math.cos(lt*yt))}}else if(H===1)J=lt=>d-Math.exp(-oe*lt)*(W+(z+oe*W)*lt);else{const lt=oe*Math.sqrt(H*H-1);J=yt=>{const pi=Math.exp(-H*oe*yt),Ai=Math.min(lt*yt,300);return d-pi*((z+H*oe*W)*Math.sinh(Ai)+lt*W*Math.cosh(Ai))/lt}}return{calculatedDuration:N&&L||null,next:lt=>{const yt=J(lt);if(N)h.done=lt>=L;else{let pi=z;lt!==0&&(H<1?pi=calcGeneratorVelocity(J,lt,yt):pi=0);const Ai=Math.abs(pi)<=o,Vd=Math.abs(d-yt)<=n;h.done=Ai&&Vd}return h.value=h.done?d:yt,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:E=.5,restSpeed:L}){const F=t[0],N={done:!1,value:F},z=Gd=>p!==void 0&&Gd<p||y!==void 0&&Gd>y,H=Gd=>p===void 0?y:y===void 0||Math.abs(p-Gd)<Math.abs(y-Gd)?p:y;let W=o*n;const oe=F+W,nt=h===void 0?oe:h(oe);nt!==oe&&(W=nt-F);const J=Gd=>-W*Math.exp(-Gd/s),lt=Gd=>nt+J(Gd),yt=Gd=>{const md=J(Gd),tf=lt(Gd);N.done=Math.abs(md)<=E,N.value=N.done?nt:tf};let pi,Ai;const Vd=Gd=>{z(N.value)&&(pi=Gd,Ai=spring({keyframes:[N.value,H(N.value)],velocity:calcGeneratorVelocity(lt,Gd,N.value),damping:c,stiffness:d,restDelta:E,restSpeed:L}))};return Vd(0),{calculatedDuration:null,next:Gd=>{let md=!1;return!Ai&&pi===void 0&&(md=!0,yt(Gd),Vd(Gd)),pi!==void 0&&Gd>=pi?Ai.next(Gd-pi):(!md&&yt(Gd),N)}}}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=E=>{let L=0;if(p>1)for(;L<t.length-2&&!(E<t[L+1]);L++);const F=progress(t[L],t[L+1],E);return h[L](F)};return o?E=>y(clamp(t[0],t[d-1],E)):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,E;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 L=p({...this.options,keyframes:n});d==="mirror"&&(E=p({...this.options,keyframes:[...n].reverse(),velocity:-h})),L.calculatedDuration===null&&(L.calculatedDuration=calcGeneratorDuration(L));const{calculatedDuration:F}=L,N=F+c,z=N*(s+1)-c;return{generator:L,mirroredGenerator:E,mapPercentToKeyframes:y,calculatedDuration:F,resolvedDuration:N,totalDuration:z}}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:Gd}=this.options;return{done:!0,value:Gd[Gd.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:h,mapPercentToKeyframes:p,keyframes:y,calculatedDuration:E,totalDuration:L,resolvedDuration:F}=s;if(this.startTime===null)return d.next(0);const{delay:N,repeat:z,repeatType:H,repeatDelay:W,onUpdate:oe}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-L/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 nt=this.currentTime-N*(this.speed>=0?1:-1),J=this.speed>=0?nt<0:nt>L;this.currentTime=Math.max(nt,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=L);let lt=this.currentTime,yt=d;if(z){const Gd=Math.min(this.currentTime,L)/F;let md=Math.floor(Gd),tf=Gd%1;!tf&&Gd>=1&&(tf=1),tf===1&&md--,md=Math.min(md,z+1),!!(md%2)&&(H==="reverse"?(tf=1-tf,W&&(tf-=W/F)):H==="mirror"&&(yt=h)),lt=clamp(0,1,tf)*F}const pi=J?{done:!1,value:y[0]}:yt.next(lt);p&&(pi.value=p(pi.value));let{done:Ai}=pi;!J&&E!==null&&(Ai=this.speed>=0?this.currentTime>=L:this.currentTime<=0);const Vd=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&Ai);return Vd&&c!==void 0&&(pi.value=getFinalKeyframe(y,this.options,c)),oe&&oe(pi.value),Vd&&this.finish(),pi}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 E={[n]:o};y&&(E.offset=y);const L=mapEasingToNativeEasing(p);return Array.isArray(L)&&(E.easing=L),t.animate(E,{delay:s,duration:c,easing:Array.isArray(L)?"linear":L,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:E}=this.options;if(!(!((s=y.owner)===null||s===void 0)&&s.current))return!1;if(requiresPregeneratedKeyframes(this.options)){const{onComplete:F,onUpdate:N,motionValue:z,...H}=this.options,W=pregenerateKeyframes(n,H);n=W.keyframes,n.length===1&&(n[1]=n[0]),c=W.duration,d=W.times,h=W.ease,p="keyframes"}const L=animateStyle(y.owner.current,E,n,{...this.options,duration:c,times:d,ease:h});return L.startTime=time.now(),this.pendingTimeline?(L.timeline=this.pendingTimeline,this.pendingTimeline=void 0):L.onfinish=()=>{const{onComplete:F}=this.options;y.set(getFinalKeyframe(n,this.options,o)),F&&F(),this.cancel(),this.resolveFinishedPromise()},{animation:L,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:E,onComplete:L,...F}=this.options,N=new MainThreadAnimation({...F,keyframes:s,duration:c,type:d,ease:h,times:p,isGenerator:!0}),z=secondsToMilliseconds(this.time);y.setWithVelocity(N.sample(z-sampleDelta).value,N.sample(z).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:E=0}=s;E=E-secondsToMilliseconds(y);let L={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:n.getVelocity(),...p,delay:-E,onUpdate:N=>{n.set(N),p.onUpdate&&p.onUpdate(N)},onComplete:()=>{h(),p.onComplete&&p.onComplete()},name:t,motionValue:n,element:d?void 0:c};isTransitionDefined(p)||(L={...L,...getDefaultTransition(t,L)}),L.duration&&(L.duration=secondsToMilliseconds(L.duration)),L.repeatDelay&&(L.repeatDelay=secondsToMilliseconds(L.repeatDelay)),L.from!==void 0&&(L.keyframes[0]=L.from);let F=!1;if((L.type===!1||L.duration===0&&!L.repeatDelay)&&(L.duration=0,L.delay===0&&(F=!0)),F&&!d&&n.get()!==void 0){const N=getFinalKeyframe(L.keyframes,p);if(N!==void 0){frame.update(()=>{L.onUpdate(N),L.onComplete()});return}}return!d&&AcceleratedAnimation.supports(L)?new AcceleratedAnimation(L):new MainThreadAnimation(L)};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),o&&console.warn(o),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 E=t.getValue("willChange");s&&(h=s);const L=[],F=c&&t.animationState&&t.animationState.getState()[c];for(const N in y){const z=t.getValue(N,(d=t.latestValues[N])!==null&&d!==void 0?d:null),H=y[N];if(H===void 0||F&&shouldBlockAnimation(F,N))continue;const W={delay:o,elapsed:0,...getValueTransition(h||{},N)};let oe=!1;if(window.HandoffAppearAnimations){const J=t.getProps()[optimizedAppearDataAttribute];if(J){const lt=window.HandoffAppearAnimations(J,N);lt!==null&&(W.elapsed=lt,oe=!0)}}z.start(animateMotionValue(N,z,H,t.shouldReduceMotion&&transformProps.has(N)?{type:!1}:W,t,oe));const nt=z.animation;nt&&(isWillChangeMotionValue(E)&&(E.add(N),nt.then(()=>E.remove(N))),L.push(nt))}return p&&Promise.all(L).then(()=>{frame.update(()=>{p&&setTarget(t,p)})}),L}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?(E=0)=>{const{delayChildren:L=0,staggerChildren:F,staggerDirection:N}=d;return animateChildren(t,n,L+E,F,N,o)}:()=>Promise.resolve(),{when:y}=d;if(y){const[E,L]=y==="beforeChildren"?[h,p]:[p,h];return E().then(()=>L())}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?(E=0)=>E*s:(E=0)=>p-E*s;return Array.from(t.variantChildren).sort(sortByTreeOrder).forEach((E,L)=>{E.notify("AnimationStart",n),h.push(animateVariant(E,n,{...d,delay:o+y(L)}).then(()=>E.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=>(E,L)=>{var F;const N=resolveVariant(t,L,y==="exit"?(F=t.presenceContext)===null||F===void 0?void 0:F.custom:void 0);if(N){const{transition:z,transitionEnd:H,...W}=N;E={...E,...W,...H}}return E};function d(y){n=y(t)}function h(y){const E=t.getProps(),L=t.getVariantContext(!0)||{},F=[],N=new Set;let z={},H=1/0;for(let oe=0;oe<numAnimationTypes;oe++){const nt=reversePriorityOrder[oe],J=o[nt],lt=E[nt]!==void 0?E[nt]:L[nt],yt=isVariantLabel(lt),pi=nt===y?J.isActive:null;pi===!1&&(H=oe);let Ai=lt===L[nt]&<!==E[nt]&&yt;if(Ai&&s&&t.manuallyAnimateOnMount&&(Ai=!1),J.protectedKeys={...z},!J.isActive&&pi===null||!lt&&!J.prevProp||isAnimationControls(lt)||typeof lt=="boolean")continue;let Gd=checkVariantsDidChange(J.prevProp,lt)||nt===y&&J.isActive&&!Ai&&yt||oe>H&&yt,md=!1;const tf=Array.isArray(lt)?lt:[lt];let nf=tf.reduce(c(nt),{});pi===!1&&(nf={});const{prevResolvedValues:ef={}}=J,mt={...ef,...nf},Ee=sl=>{Gd=!0,N.has(sl)&&(md=!0,N.delete(sl)),J.needsAnimating[sl]=!0;const Zd=t.getValue(sl);Zd&&(Zd.liveStyle=!1)};for(const sl in mt){const Zd=nf[sl],rf=ef[sl];if(z.hasOwnProperty(sl))continue;let uf=!1;isKeyframesTarget(Zd)&&isKeyframesTarget(rf)?uf=!shallowCompare(Zd,rf):uf=Zd!==rf,uf?Zd!=null?Ee(sl):N.add(sl):Zd!==void 0&&N.has(sl)?Ee(sl):J.protectedKeys[sl]=!0}J.prevProp=lt,J.prevResolvedValues=nf,J.isActive&&(z={...z,...nf}),s&&t.blockInitialAnimation&&(Gd=!1),Gd&&(!Ai||md)&&F.push(...tf.map(sl=>({animation:sl,options:{type:nt}})))}if(N.size){const oe={};N.forEach(nt=>{const J=t.getBaseTarget(nt),lt=t.getValue(nt);lt&&(lt.liveStyle=!0),oe[nt]=J===void 0?null:J}),F.push({animation:oe})}let W=!!F.length;return s&&(E.initial===!1||E.initial===E.animate)&&!t.manuallyAnimateOnMount&&(W=!1),s=!1,W?n(F):Promise.resolve()}function p(y,E){var L;if(o[y].isActive===E)return Promise.resolve();(L=t.variantChildren)===null||L===void 0||L.forEach(N=>{var z;return(z=N.animationState)===null||z===void 0?void 0:z.setActive(y,E)}),o[y].isActive=E;const F=h(y);for(const N in o)o[N].protectedKeys={};return F}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 F=getPanInfo(this.lastMoveEventInfo,this.history),N=this.startEvent!==null,z=distance2D(F.offset,{x:0,y:0})>=3;if(!N&&!z)return;const{point:H}=F,{timestamp:W}=frameData;this.history.push({...H,timestamp:W});const{onStart:oe,onMove:nt}=this.handlers;N||(oe&&oe(this.lastMoveEvent,F),this.startEvent=this.lastMoveEvent),nt&&nt(this.lastMoveEvent,F)},this.handlePointerMove=(F,N)=>{this.lastMoveEvent=F,this.lastMoveEventInfo=transformPoint(N,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(F,N)=>{this.end();const{onEnd:z,onSessionEnd:H,resumeAnimation:W}=this.handlers;if(this.dragSnapToOrigin&&W&&W(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const oe=getPanInfo(F.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(N,this.transformPagePoint),this.history);this.startEvent&&z&&z(F,oe),H&&H(F,oe)},!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:E}=frameData;this.history=[{...y,timestamp:E}];const{onSessionStart:L}=o;L&&L(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=L=>{const{dragSnapToOrigin:F}=this.getProps();F?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(extractEventInfo(L,"page").point)},d=(L,F)=>{const{drag:N,dragPropagation:z,onDragStart:H}=this.getProps();if(N&&!z&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(N),!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(oe=>{let nt=this.getAxisMotionValue(oe).get()||0;if(percent.test(nt)){const{projection:J}=this.visualElement;if(J&&J.layout){const lt=J.layout.layoutBox[oe];lt&&(nt=calcLength(lt)*(parseFloat(nt)/100))}}this.originPoint[oe]=nt}),H&&H(L,F);const{animationState:W}=this.visualElement;W&&W.setActive("whileDrag",!0)},h=(L,F)=>{const{dragPropagation:N,dragDirectionLock:z,onDirectionLock:H,onDrag:W}=this.getProps();if(!N&&!this.openGlobalLock)return;const{offset:oe}=F;if(z&&this.currentDirection===null){this.currentDirection=getCurrentDirection(oe),this.currentDirection!==null&&H&&H(this.currentDirection);return}this.updateAxis("x",F.point,oe),this.updateAxis("y",F.point,oe),this.visualElement.render(),W&&W(L,F)},p=(L,F)=>this.stop(L,F),y=()=>eachAxis(L=>{var F;return this.getAnimationState(L)==="paused"&&((F=this.getAxisMotionValue(L).animation)===null||F===void 0?void 0:F.play())}),{dragSnapToOrigin:E}=this.getProps();this.panSession=new PanSession(n,{onSessionStart:c,onStart:d,onMove:h,onSessionEnd:p,resumeAnimation:y},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:E,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||{},E=eachAxis(L=>{if(!shouldDrag(L,o,this.currentDirection))return;let F=y&&y[L]||{};h&&(F={min:0,max:0});const N=c?200:1e6,z=c?40:1e7,H={type:"inertia",velocity:s?n[L]:0,bounceStiffness:N,bounceDamping:z,timeConstant:750,restDelta:1,restSpeed:10,...d,...F};return this.startAxisValueAnimation(L,H)});return Promise.all(E).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:E}=this.constraints[h];p.set(mixNumber$1(y,E,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:E,dragListener:L=!0}=this.getProps();E&&L&&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:E})=>{this.isDragging&&E&&(eachAxis(L=>{const F=this.getAxisMotionValue(L);F&&(this.originPoint[L]+=y[L].translate,F.set(F.get()+y[L].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 E=mixNumber$1(p,y,.5);return typeof c[2+h]=="number"&&(c[2+h]/=E),typeof c[3+h]=="number"&&(c[3+h]/=E),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),E=getRadius(o,p);if(y===void 0&&E===void 0)continue;y||(y=0),E||(E=0),y===0||E===0||isPx(y)===isPx(E)?(t[p]=Math.max(mixNumber$1(asNumber(y),asNumber(E),s),0),(percent.test(E)||percent.test(y))&&(t[p]+="%")):t[p]=E}(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:E,rotate:L,rotateX:F,rotateY:N,skewX:z,skewY:H}=o;E&&(s=`perspective(${E}px) ${s}`),L&&(s+=`rotate(${L}deg) `),F&&(s+=`rotateX(${F}deg) `),N&&(s+=`rotateY(${N}deg) `),z&&(s+=`skewX(${z}deg) `),H&&(s+=`skewY(${H}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:E,visualElement:L}=this.options;if(L&&!L.current&&L.mount(h),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(E||y)&&(this.isLayoutDirty=!0),t){let F;const N=()=>this.root.updateBlockedByResize=!1;t(h,()=>{this.root.updateBlockedByResize=!0,F&&F(),F=delay(N,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}y&&this.root.registerSharedNode(y,this),this.options.animate!==!1&&L&&(y||E)&&this.addEventListener("didUpdate",({delta:F,hasLayoutChanged:N,hasRelativeTargetChanged:z,layout:H})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const W=this.options.transition||L.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:oe,onLayoutAnimationComplete:nt}=L.getProps(),J=!this.targetLayout||!boxEqualsRounded(this.targetLayout,H)||z,lt=!N&&z;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||lt||N&&(J||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(F,lt);const yt={...getValueTransition(W,"layout"),onPlay:oe,onComplete:nt};(L.shouldReduceMotion||this.options.layoutRoot)&&(yt.delay=0,yt.type=!1),this.startAnimation(yt)}else N||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=H})}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 L=0;L<this.path.length;L++){const F=this.path[L];F.shouldResetTransform=!0,F.updateScroll("snapshot"),F.options.layoutRoot&&F.willUpdate(!1)}const{layoutId:p,layout:y}=this.options;if(p===void 0&&!y)return;const E=this.getTransformTemplate();this.prevTransformTemplateValue=E?E(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(),E=y?y(this.latestValues,""):void 0,L=E!==this.prevTransformTemplateValue;h&&(p||hasTransform(this.latestValues)||L)&&(c(this.instance,E),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 E=this.path[y],{scroll:L,options:F}=E;if(E!==this.root&&L&&F.layoutScroll){if(L.isRoot){copyBoxInto(p,h);const{scroll:N}=this.root;N&&(translateAxis(p.x,-N.offset.x),translateAxis(p.y,-N.offset.y))}translateAxis(p.x,L.offset.x),translateAxis(p.y,L.offset.y)}}return p}applyTransform(h,p=!1){const y=createBox();copyBoxInto(y,h);for(let E=0;E<this.path.length;E++){const L=this.path[E];!p&&L.options.layoutScroll&&L.scroll&&L!==L.root&&transformBox(y,{x:-L.scroll.offset.x,y:-L.scroll.offset.y}),hasTransform(L.latestValues)&&transformBox(y,L.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 E=this.path[y];if(!E.instance||!hasTransform(E.latestValues))continue;hasScale(E.latestValues)&&E.updateSnapshot();const L=createBox(),F=E.measurePageBox();copyBoxInto(L,F),removeBoxTransforms(p,E.latestValues,E.snapshot?E.snapshot.layoutBox:void 0,L)}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 E=!!this.resumingFrom||this!==y;if(!(h||E&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:F,layoutId:N}=this.options;if(!(!this.layout||!(F||N))){if(this.resolvedRelativeTargetAt=frameData.timestamp,!this.targetDelta&&!this.relativeTarget){const z=this.getClosestProjectingParent();z&&z.layout&&this.animationProgress!==1?(this.relativeParent=z,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.layout.layoutBox,z.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 z=this.getClosestProjectingParent();z&&!!z.resumingFrom==!!this.resumingFrom&&!z.options.layoutScroll&&z.target&&this.animationProgress!==1?(this.relativeParent=z,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.target,z.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 E=!0;if((this.isProjectionDirty||!((h=this.parent)===null||h===void 0)&&h.isProjectionDirty)&&(E=!1),y&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(E=!1),this.resolvedRelativeTargetAt===frameData.timestamp&&(E=!1),E)return;const{layout:L,layoutId:F}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(L||F))return;copyBoxInto(this.layoutCorrected,this.layout.layoutBox);const N=this.treeScale.x,z=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:H}=p;if(!H){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,H,this.latestValues),this.projectionTransform=buildProjectionTransform(this.projectionDelta,this.treeScale),(this.projectionTransform!==W||this.treeScale.x!==N||this.treeScale.y!==z)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",H)),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,E=y?y.latestValues:{},L={...this.latestValues},F=createDelta();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const N=createBox(),z=y?y.source:void 0,H=this.layout?this.layout.source:void 0,W=z!==H,oe=this.getStack(),nt=!oe||oe.members.length<=1,J=!!(W&&!nt&&this.options.crossfade===!0&&!this.path.some(hasOpacityCrossfade));this.animationProgress=0;let lt;this.mixTargetDelta=yt=>{const pi=yt/1e3;mixAxisDelta(F.x,h.x,pi),mixAxisDelta(F.y,h.y,pi),this.setTargetDelta(F),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(N,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,N,pi),lt&&boxEquals(this.relativeTarget,lt)&&(this.isProjectionDirty=!1),lt||(lt=createBox()),copyBoxInto(lt,this.relativeTarget)),W&&(this.animationValues=L,mixValues(L,E,this.latestValues,pi,J,nt)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=pi},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:E,latestValues:L}=h;if(!(!p||!y||!E)){if(this!==h&&this.layout&&E&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,E.layoutBox)){y=this.target||createBox();const F=calcLength(this.layout.layoutBox.x);y.x.min=h.target.x.min,y.x.max=y.x.min+F;const N=calcLength(this.layout.layoutBox.y);y.y.min=h.target.y.min,y.y.max=y.y.min+N}copyBoxInto(p,y),transformBox(p,L),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,p,L)}}registerSharedNode(h,p){this.sharedNodes.has(h)||this.sharedNodes.set(h,new NodeStack),this.sharedNodes.get(h).add(p);const E=p.options.initialPromotionConfig;p.promote({transition:E?E.transition:void 0,preserveFollowOpacity:E&&E.shouldPreserveFollowOpacity?E.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 E=this.getStack();E&&E.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 E={};y.z&&resetDistortingTransform("z",h,E,this.animationValues);for(let L=0;L<transformAxes.length;L++)resetDistortingTransform(`rotate${transformAxes[L]}`,h,E,this.animationValues),resetDistortingTransform(`skew${transformAxes[L]}`,h,E,this.animationValues);h.render();for(const L in E)h.setStaticValue(L,E[L]),this.animationValues&&(this.animationValues[L]=E[L]);h.scheduleRender()}getProjectionStyles(h){var p,y;if(!this.instance||this.isSVG)return;if(!this.isVisible)return hiddenVisibility;const E={visibility:""},L=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,E.opacity="",E.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||"",E.transform=L?L(this.latestValues,""):"none",E;const F=this.getLead();if(!this.projectionDelta||!this.layout||!F.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=L?L({},""):"none",this.hasProjected=!1),W}const N=F.animationValues||F.latestValues;this.applyTransformsToTarget(),E.transform=buildProjectionTransform(this.projectionDeltaWithTransform,this.treeScale,N),L&&(E.transform=L(N,E.transform));const{x:z,y:H}=this.projectionDelta;E.transformOrigin=`${z.origin*100}% ${H.origin*100}% 0`,F.animationValues?E.opacity=F===this?(y=(p=N.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&y!==void 0?y:1:this.preserveOpacity?this.latestValues.opacity:N.opacityExit:E.opacity=F===this?N.opacity!==void 0?N.opacity:"":N.opacityExit!==void 0?N.opacityExit:0;for(const W in scaleCorrectors){if(N[W]===void 0)continue;const{correct:oe,applyTo:nt}=scaleCorrectors[W],J=E.transform==="none"?N[W]:oe(N[W],F);if(nt){const lt=nt.length;for(let yt=0;yt<lt;yt++)E[nt[yt]]=J}else E[W]=J}return this.options.layoutId&&(E.pointerEvents=F===this?resolveMotionValue(h==null?void 0:h.pointerEvents)||"":"none"),E}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(F=>{const N=h?o.measuredBox[F]:o.layoutBox[F],z=calcLength(N);N.min=s[F].min,N.max=N.min+z}):shouldAnimatePositionOnly(d,o.layoutBox,s)&&eachAxis(F=>{const N=h?o.measuredBox[F]:o.layoutBox[F],z=calcLength(s[F]);N.max=N.min+z,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[F].max=t.relativeTarget[F].min+z)});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 E=!isDeltaZero(p);let L=!1;if(!t.resumeFrom){const F=t.getClosestProjectingParent();if(F&&!F.resumeFrom){const{snapshot:N,layout:z}=F;if(N&&z){const H=createBox();calcRelativePosition(H,o.layoutBox,N.layoutBox);const W=createBox();calcRelativePosition(W,s,z.layoutBox),boxEqualsRounded(H,W)||(L=!0),F.options.layoutRoot&&(t.relativeTarget=W,t.relativeTargetOrigin=H,t.relativeParent=F)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:o,delta:y,layoutDelta:p,hasLayoutChanged:E,hasRelativeTargetChanged:L})}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=(N,z,H,W)=>new this.KeyframeResolver(N,z,H,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:E}=h;this.latestValues=y,this.baseTarget={...y},this.initialValues=o.initial?{...y}:{},this.renderState=E,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:L,...F}=this.scrapeMotionValuesFromProps(o,{},this);for(const N in F){const z=F[N];y[N]!==void 0&&isMotionValue(z)&&(z.set(y[N],!1),isWillChangeMotionValue(L)&&L.add(N))}}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 E=featureNames[y],{isEnabled:L,Feature:F,ProjectionNode:N,MeasureLayout:z}=featureDefinitions[E];N&&(h=N),L(o)&&(!this.features[E]&&F&&(this.features[E]=new F(this)),z&&(p=z))}if((this.type==="html"||this.type==="svg")&&!this.projection&&h){this.projection=new h(this.latestValues,getClosestProjectingNode(this.parent));const{layoutId:y,layout:E,drag:L,dragConstraints:F,layoutScroll:N,layoutRoot:z}=o;this.projection.setOptions({layoutId:y,layout:E,alwaysMeasureLayout:!!L||F&&isRefObject(F),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof E=="string"?E:"both",initialPromotionConfig:d,layoutScroll:N,layoutRoot:z})}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(n||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:E,isPositionVisible:L}=useContext(),F=React.useRef(null);usePreRender(()=>{if(F.current==null)return;let z;try{const J=p==null?void 0:p([c.x,c.y,c.z]);z=new Cartesian2(J==null?void 0:J[0],J==null?void 0:J[1])}catch{h.set("none");return}const H=y==null?void 0:y();if(!H)return;const W=E==null?void 0:E(H==null?void 0:H.lng,H==null?void 0:H.lat,H==null?void 0:H.height);if(!W)return;if(occluder.cameraPosition=new Cartesian3(W[0],W[1],W[2]),z==null||z.x<0||z.y<0||z.x>window.innerWidth||z.y>window.innerHeight||!(L!=null&&L([c.x,c.y,c.z]))){h.set("none");return}const oe=`calc(${z.x}px - 50%)`,nt=`calc(${z.y}px - 50%)`;d.set(`translate(${oe}, ${nt})`),h.set("block")});const N=useMergeRefs([F,s]);return jsxRuntimeExports.jsx(motion.div,{ref:N,...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})=>{const c=useConstant$2(()=>new Cartesian3);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScreenSpaceElement,{position:Cartesian3.midpoint(t,n,c),children:jsxRuntimeExports.jsx(MeasurementText,{children:o<1e3?`${o.toFixed(1)} m`:`${(o/1e3).toFixed(1)} km`})}),jsxRuntimeExports.jsx(MeasurementLine$1,{a:t,b:n,color:s})]})},cartesianScratch=new Cartesian3,ExtrudedControlPoints=React.memo(({geometryOptions:{controlPoints:t},extrudedHeight:n,color:o})=>{var p;const{viewer:s}=De$1(),c=t[t.length-1],d=(p=s==null?void 0:s.scene)==null?void 0:p.globe.ellipsoid.geodeticSurfaceNormal(c,cartesianScratch);invariant$1(d!==void 0);const h=Cartesian3.add(c,Cartesian3.multiplyByScalar(d,n,cartesianScratch),cartesianScratch);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ControlPoint,{position:c,clampToGround:!0}),jsxRuntimeExports.jsx(ControlPoint,{position:h}),jsxRuntimeExports.jsx(ExtrudedMeasurement,{a:c,b:h,extrudedHeight:n,color:o})]})});ExtrudedControlPoints.displayName="ExtrudedControlPoints";const ExtrudedPolygonEntity=({dynamic:t=!1,id:n,hierarchy:o,extrudedHeight:s,color:c,disableShadow:d=!1,enableRelativeHeight:h=!1})=>{const p=React.useRef(o);p.current=o;const y=useConstant$2(()=>new CallbackProperty(()=>p.current,!1)),E=t?y:o,L=React.useRef(s);L.current=s;const F=useConstant$2(()=>new CallbackProperty(()=>L.current,!1)),N=t?F:s,z=React.useMemo(()=>({polygon:{hierarchy:E,extrudedHeight:N,extrudedHeightReference:HeightReference$1.RELATIVE_TO_GROUND,fill:!0,outline:!0,outlineWidth:1,outlineColor:c==null?void 0:c.withAlpha(1),material:new ColorMaterialProperty(c),classificationType:ClassificationType$1.TERRAIN,shadows:d?ShadowMode$1.DISABLED:ShadowMode$1.ENABLED,...h?{height:0,heightReference:HeightReference$1.RELATIVE_TO_GROUND}:void 0}}),[N,d,E,c,h]),{requestRender:H}=useContext();return H==null||H(),jsxRuntimeExports.jsx(Entity,{id:n,...z})},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})=>{const s=React.useRef(n);s.current=n;const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!t)),d=t?c:n,h=React.useMemo(()=>({polyline:{positions:d,width:1.5,material:o,classificationType:ClassificationType$1.TERRAIN,clampToGround:!0}}),[o,d]),{requestRender:p}=useContext();return p==null||p(),jsxRuntimeExports.jsx(Entity,{...h})},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,cartesianScratch2=new Cartesian3,SurfaceControlPoints=React.memo(({geometryOptions:{type:t,controlPoints:n},color:o})=>{let s=[...n],c,d=!1;if(t==="rectangle"&&s.length===3){const[h,p,y]=s,E=Cartesian3.projectVector(Cartesian3.subtract(y,h,cartesianScratch1),Cartesian3.subtract(p,h,cartesianScratch2),cartesianScratch1),L=Cartesian3.subtract(y,Cartesian3.add(h,E,cartesianScratch1),cartesianScratch2),F=Cartesian3.midpoint(h,p,cartesianScratch1),N=Cartesian3.add(F,L,cartesianScratch2);s=[h,p,N],c=[F,N],d=!0}else t==="marker"?(c=void 0,s=[]):s.length>=2&&(c=s.slice(-2),d=t==="circle");return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[s.map((h,p)=>jsxRuntimeExports.jsx(ControlPoint,{position:h,clampToGround:!0},p)),c!=null&&jsxRuntimeExports.jsx(SurfaceMeasurement,{a:c[0],b:c[1],color:o,showLine:d})]})});SurfaceControlPoints.displayName="SurfaceControlPoints";const DEFAULT_SKETCH_COLOR="#00bebe",SketchComponent=React.memo(({geometry:t,geometryOptions:n,extrudedHeight:o,disableShadow:s,color:c,enableRelativeHeight:d})=>{const h=React.useMemo(()=>n?{...n,controlPoints:n==null?void 0:n.controlPoints.map(F=>new Cesium$1.Cartesian3(...F))}:null,[n]),p=React.useMemo(()=>t??(h?createGeometry(h):null),[t,h]),{positionsArray:y,hierarchyArray:E}=React.useMemo(()=>(p==null?void 0:p.type)==="Point"?{}:(p==null?void 0:p.type)==="LineString"?{positionsArray:convertGeometryToPositionsArray(p)}:p!=null?{positionsArray:convertGeometryToPositionsArray(p),hierarchyArray:convertPolygonToHierarchyArray(p)}:{},[p]),L=React.useMemo(()=>Color$1.fromCssColorString(c??DEFAULT_SKETCH_COLOR),[c]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[y==null?void 0:y.map((F,N)=>jsxRuntimeExports.jsx(PolylineEntity,{dynamic:!0,positions:F,color:L},N)),E==null?void 0:E.map((F,N)=>jsxRuntimeExports.jsx(PolygonEntity,{dynamic:!0,hierarchy:F,color:L},N)),h!=null&&o==null&&jsxRuntimeExports.jsx(SurfaceControlPoints,{geometryOptions:h,color:L}),h!=null&&o!=null&&jsxRuntimeExports.jsx(ExtrudedControlPoints,{geometryOptions:h,extrudedHeight:o,color:L}),o!=null&&(E==null?void 0:E.map((F,N)=>jsxRuntimeExports.jsx(ExtrudedPolygonEntity,{dynamic:!0,hierarchy:F,extrudedHeight:o,disableShadow:s,color:L,enableRelativeHeight:d},N)))]})});SketchComponent.displayName="SketchComponent";const Cesium=({className:t,style:n,property:o,time:s,camera:c,small:d,ready:h,children:p,selectedLayerId:y,isLayerDraggable:E,isLayerDragging:L,shouldRender:F,layerSelectionReason:N,meta:z,layersRef:H,featureFlags:W,requestingRenderMode:oe,timelineManagerRef:nt,cameraForceHorizontalRoll:J,onLayerSelect:lt,onCameraChange:yt,onLayerDrag:pi,onLayerDrop:Ai,onLayerEdit:Vd,onLayerSelectWithRectStart:Gd,onLayerSelectWithRectMove:md,onLayerSelectWithRectEnd:tf,onMount:nf,onLayerVisibility:ef,onLayerLoad:mt},Ee)=>{var Tf,Xd,gf,yf,hf,df,bf,Ef,wf,vf,Of,Gf,If,zf,Mf,Df,Em,Qf,qf,kf,Zf,Pm,jm,qm,ep,op,$m,Nf,Af,Yf,Kf,tp,Qm,wm,lp,up,pp,gp,fp,dp,mp,yp;const{cesium:sl,mouseEventHandles:Zd,cesiumIonAccessToken:rf,context:uf,layerSelectWithRectEventHandlers:lf,sceneLight:af,sceneBackgroundColor:of,sceneMsaaSamples:sf,sceneMode:mf,cameraViewBoundaries:ff,cameraViewOuterBoundaries:pf,cameraViewBoundariesMaterial:xf,handleCameraChange:Rf,handleCameraMoveEnd:Vf,handleUpdate:Lf,handleClick:Pf,handleMount:Uf,handleUnmount:Bf}=useHooks$1({ref:Ee,property:o,time:s,selectedLayerId:y,selectionReason:N,meta:z,layersRef:H,featureFlags:W,timelineManagerRef:nt,isLayerDraggable:E,isLayerDragging:L,shouldRender:F,requestingRenderMode:oe,camera:c,cameraForceHorizontalRoll:J,onLayerDrag:pi,onLayerDrop:Ai,onLayerSelect:lt,onLayerEdit:Vd,onLayerSelectWithRectStart:Gd,onLayerSelectWithRectMove:md,onLayerSelectWithRectEnd:tf,onLayerVisibility:ef,onLayerLoad:mt,onCameraChange:yt,onMount:nf});return jsxRuntimeExports.jsxs(Aa$1,{ref:sl,onUpdate:Lf,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,style:{width:d?"300px":"auto",height:d?"300px":"100%",display:h?void 0:"none",cursor:L?"grab":void 0,...n},shadows:!!((Xd=(Tf=o==null?void 0:o.scene)==null?void 0:Tf.shadow)!=null&&Xd.enabled),onClick:Pf,onDoubleClick:Zd.doubleClick,onMouseDown:Zd.mouseDown,onMouseUp:Zd.mouseUp,onRightClick:Zd.rightClick,onRightDown:Zd.rightDown,onRightUp:Zd.rightUp,onMiddleClick:Zd.middleClick,onMiddleDown:Zd.middleDown,onMiddleUp:Zd.middleUp,onMouseMove:Zd.mouseMove,onMouseEnter:Zd.mouseEnter,onMouseLeave:Zd.mouseLeave,onWheel:Zd.wheel,children:[jsxRuntimeExports.jsx(Event,{onMount:Uf,onUnmount:Bf}),jsxRuntimeExports.jsx(ReearthClock,{timelineManagerRef:nt}),jsxRuntimeExports.jsx(ImageryLayers,{tiles:o==null?void 0:o.tiles,cesiumIonAccessToken:rf}),jsxRuntimeExports.jsx(LabelImageryLayers,{tileLabels:o==null?void 0:o.tileLabels}),jsxRuntimeExports.jsx(Indicator,{property:o,timelineManagerRef:nt}),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:lf.start.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:lf.start.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,action:lf.move.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:lf.move.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,action:lf.end.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:lf.end.shift})]}),jsxRuntimeExports.jsx(Ta$1,{maximumZoomDistance:(yf=(gf=o==null?void 0:o.camera)==null?void 0:gf.limiter)!=null&&yf.enabled?((bf=(df=(hf=o.camera)==null?void 0:hf.limiter)==null?void 0:df.targetArea)==null?void 0:bf.height)??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY,enableCollisionDetection:!((Ef=o==null?void 0:o.camera)!=null&&Ef.allowEnterGround)}),jsxRuntimeExports.jsx(Ps$1,{percentageChanged:.2,onChange:Rf,onMoveEnd:Vf}),ff&&((vf=(wf=o==null?void 0:o.camera)==null?void 0:wf.limiter)==null?void 0:vf.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:ff,width:1,material:Cesium$1.Color.RED,arcType:Cesium$1.ArcType.RHUMB})}),pf&&((Gf=(Of=o==null?void 0:o.camera)==null?void 0:Of.limiter)==null?void 0:Gf.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:pf,width:1,material:xf,arcType:Cesium$1.ArcType.RHUMB})}),jsxRuntimeExports.jsx($a$1,{backgroundColor:of,light:af,mode:mf,msaaSamples:sf,useDepthPicking:!1,useWebVR:!!((If=o==null?void 0:o.scene)!=null&&If.vr)||void 0,debugShowFramesPerSecond:!!((zf=o==null?void 0:o.debug)!=null&&zf.showFramesPerSecond),verticalExaggerationRelativeHeight:(Mf=o==null?void 0:o.scene)==null?void 0:Mf.verticalExaggerationRelativeHeight,verticalExaggeration:(Df=o==null?void 0:o.scene)==null?void 0:Df.verticalExaggeration}),jsxRuntimeExports.jsx(Oa$1,{show:((Qf=(Em=o==null?void 0:o.sky)==null?void 0:Em.skyBox)==null?void 0:Qf.show)??!0}),jsxRuntimeExports.jsx(Vs$1,{enabled:((kf=(qf=o==null?void 0:o.sky)==null?void 0:qf.fog)==null?void 0:kf.enabled)??!0,density:(Pm=(Zf=o==null?void 0:o.sky)==null?void 0:Zf.fog)==null?void 0:Pm.density}),jsxRuntimeExports.jsx(Ga$1,{show:((qm=(jm=o==null?void 0:o.sky)==null?void 0:jm.sun)==null?void 0:qm.show)??!0}),jsxRuntimeExports.jsx(ea$1,{show:((op=(ep=o==null?void 0:o.sky)==null?void 0:ep.moon)==null?void 0:op.show)??!0}),jsxRuntimeExports.jsx(_a$2,{show:((Nf=($m=o==null?void 0:o.sky)==null?void 0:$m.skyAtmosphere)==null?void 0:Nf.show)??!0,atmosphereLightIntensity:(Yf=(Af=o==null?void 0:o.sky)==null?void 0:Af.skyAtmosphere)==null?void 0:Yf.lightIntensity,saturationShift:(tp=(Kf=o==null?void 0:o.sky)==null?void 0:Kf.skyAtmosphere)==null?void 0:tp.saturationShift,brightnessShift:(wm=(Qm=o==null?void 0:o.sky)==null?void 0:Qm.skyAtmosphere)==null?void 0:wm.brightnessShift}),jsxRuntimeExports.jsx(Globe,{property:o,cesiumIonAccessToken:rf}),jsxRuntimeExports.jsx(context.Provider,{value:uf,children:h?p:null}),jsxRuntimeExports.jsx(AmbientOcclusion,{...AMBIENT_OCCLUSION_QUALITY[((up=(lp=o==null?void 0:o.render)==null?void 0:lp.ambientOcclusion)==null?void 0:up.quality)||"low"],enabled:!!((gp=(pp=o==null?void 0:o.render)==null?void 0:pp.ambientOcclusion)!=null&&gp.enabled),intensity:((dp=(fp=o==null?void 0:o.render)==null?void 0:fp.ambientOcclusion)==null?void 0:dp.intensity)??100,outputType:(yp=(mp=o==null?void 0:o.render)==null?void 0:mp.ambientOcclusion)!=null&&yp.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.3",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 E,L;const[h]=d;let p,y;if(h.contentBoxSize){const F=Array.isArray(h.contentBoxSize)?h.contentBoxSize[0]:h.contentBoxSize;p=F.inlineSize,y=F.blockSize}else h.contentRect?(p=h.contentRect.width,y=h.contentRect.height):(p=(E=t.current)==null?void 0:E.clientWidth,y=(L=t.current)==null?void 0:L.clientHeight);s(F=>({width:p,height:y,isMobile:p?p<=viewportMobileMaxWidth:void 0,query:F.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:E},L){const F=React.useRef(null);React.useImperativeHandle(L,()=>F.current,[]);const N=React.useRef(null),z=useViewport({wrapperRef:N}),[H,W]=React.useState({}),[oe,nt]=React.useState(),[J,lt]=React.useState(),yt=React.useCallback(async(Mf,Df,Em,Qf,qf)=>{var Pm,jm,qm,ep,op,$m;if(H.layerId===Mf&&H.featureId===Df)return;const kf=await(Em==null?void 0:Em()),Zf=Mf&&Df?((qm=(Pm=F.current)==null?void 0:(jm=Pm.engine).findComputedFeatureById)==null?void 0:qm.call(jm,Mf,Df))??(qf==null?void 0:qf.feature):void 0;nt(Mf&&Df?($m=(ep=F.current)==null?void 0:(op=ep.engine).findFeatureById)==null?void 0:$m.call(op,Mf,Df):void 0),lt(Zf),W(Nf=>Nf.layerId===Mf&&Nf.featureId===Df?Nf:{layerId:Mf,featureId:Df,layer:kf,reason:Qf}),c==null||c(Mf,Em,Zf,Qf)},[H,c]),pi=React.useRef(),[Ai,Vd]=useValue(t,d),[Gd,md]=React.useState(!1),tf=React.useCallback(Mf=>{md(!!Mf)},[]),[nf,ef]=useValue(n,h),mt=nf||"default",[Ee,sl]=React.useState("auto");React.useEffect(()=>{sl(mt==="sketch"?"crosshair":mt==="move"?"grab":"auto")},[mt]);const Zd=INTERACTION_MODES[mt],rf=React.useRef(),uf=React.useCallback(Mf=>{rf.current=Mf},[]),lf=React.useCallback(Mf=>{var Df;(Df=rf.current)==null||Df.call(rf,Mf)},[]),af=React.useRef(),of=React.useCallback(Mf=>{af.current=Mf},[]),sf=React.useCallback(Mf=>{var Df;(Df=af.current)==null||Df.call(af,Mf)},[]),mf=React.useRef(),ff=React.useCallback(Mf=>{mf.current=Mf},[]),pf=React.useCallback(Mf=>{var Df;(Df=mf.current)==null||Df.call(mf,Mf)},[]),xf=React.useRef(),Rf=React.useCallback(Mf=>{xf.current=Mf},[]),Vf=React.useCallback(Mf=>{var Df;(Df=xf.current)==null||Df.call(xf,Mf)},[]),Lf=React.useRef(),Pf=React.useCallback(Mf=>{Lf.current=Mf},[]),Uf=React.useCallback(Mf=>{var Df;(Df=Lf.current)==null||Df.call(Lf,Mf)},[]),Bf=React.useRef(),Tf=React.useCallback(Mf=>{Bf.current=Mf},[]),Xd=React.useCallback(Mf=>{var Df;(Df=Bf.current)==null||Df.call(Bf,Mf)},[]),gf=React.useRef([]),yf=React.useCallback(Mf=>{gf.current.push(Mf)},[]),hf=React.useCallback(Mf=>{gf.current.forEach(Df=>Df(Mf))},[]),df=React.useRef([]),bf=React.useCallback(Mf=>{df.current.push(Mf)},[]),Ef=React.useCallback((Mf,Df)=>{df.current.forEach(Em=>Em(Mf)),E==null||E(Mf,Df)},[E]);React.useEffect(()=>{var Mf,Df;o&&((Df=(Mf=F.current)==null?void 0:Mf.engine)==null||Df.lookAtLayer(o),p==null||p(void 0))},[o,p]);const[wf,vf]=React.useState(!1),Of=React.useCallback(()=>{vf(!0)},[]),Gf=React.useCallback((Mf,Df,Em)=>{var kf;vf(!1);const Qf=(kf=F.current)==null?void 0:kf.layers.findById(Mf),qf=Qf!=null&&Qf.property.default.location?"default.location":Qf!=null&&Qf.property.default.position?"default.position":void 0;Em&&Qf&&Qf.propertyId&&qf&&(y==null||y(Qf.propertyId,qf,Em))},[y,F]),If=React.useMemo(()=>({interactionMode:mt,selectedLayer:H,selectedComputedFeature:J,viewport:z,handleCameraForceHorizontalRollChange:tf,handleInteractionModeChange:ef,onSketchPluginFeatureCreate:yf,onSketchTypeChange:bf,onLayerVisibility:of,onLayerLoad:ff,onLayerEdit:uf,onLayerSelectWithRectStart:Rf,onLayerSelectWithRectMove:Pf,onLayerSelectWithRectEnd:Tf}),[mt,H,J,z,ef,tf,uf,yf,bf,of,ff,Rf,Pf,Tf]),zf=React.useMemo(()=>({position:"relative",width:"100%",height:"100%",overflow:"hidden"}),[]);return useCoreAPI({viewerProperty:s}),{mapRef:F,wrapperRef:N,selectedFeature:oe,camera:Ai,featureFlags:Zd,isLayerDragging:wf,timelineManagerRef:pi,cursor:Ee,cameraForceHorizontalRoll:Gd,coreContextValue:If,containerStyle:zf,handleLayerSelect:yt,handleLayerDrag:Of,handleLayerDrop:Gf,handleLayerEdit:lf,handleCameraChange:Vd,handleInteractionModeChange:ef,handleSketchPluginFeatureCreate:hf,handleSketchTypeChange:Ef,handleLayerVisibility:sf,handleLayerLoad:pf,handleLayerSelectWithRectStart:Vf,handleLayerSelectWithRectMove:Uf,handleLayerSelectWithRectEnd:Xd}}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:E,time:L,interactionMode:F,shouldRender:N,meta:z,style:H,zoomedLayerId:W,children:oe,onLayerDrop:nt,onLayerSelect:J,onCameraChange:lt,onZoomToLayer:yt,onInteractionModeChange:pi,onMount:Ai,onSketchTypeChangeProp:Vd,onSketchFeatureCreate:Gd},md)=>{const{mapRef:tf,wrapperRef:nf,selectedFeature:ef,camera:mt,featureFlags:Ee,isLayerDragging:sl,timelineManagerRef:Zd,cursor:rf,cameraForceHorizontalRoll:uf,coreContextValue:lf,containerStyle:af,handleLayerSelect:of,handleLayerDrag:sf,handleLayerDrop:mf,handleLayerEdit:ff,handleCameraChange:pf,handleInteractionModeChange:xf,handleSketchPluginFeatureCreate:Rf,handleSketchTypeChange:Vf,handleLayerVisibility:Lf,handleLayerLoad:Pf,handleLayerSelectWithRectStart:Uf,handleLayerSelectWithRectMove:Bf,handleLayerSelectWithRectEnd:Tf}=useHooks({camera:E,interactionMode:F,zoomedLayerId:W,viewerProperty:s,onLayerSelect:J,onCameraChange:lt,onZoomToLayer:yt,onLayerDrop:nt,onInteractionModeChange:pi,onSketchTypeChangeProp:Vd},md);return jsxRuntimeExports.jsx(ErrorBoundary,{FallbackComponent:Error$1,children:jsxRuntimeExports.jsx(VisualizerProvider,{mapRef:tf,children:jsxRuntimeExports.jsxs("div",{ref:nf,style:af,children:[jsxRuntimeExports.jsx(Map$1,{ref:tf,isBuilt:n,isEditable:o,engine:t,layers:c,engines,camera:mt,cameraForceHorizontalRoll:uf,clusters:d,hiddenLayers:y,isLayerDragging:sl,isLayerDraggable:o,meta:z,style:H,featureFlags:Ee,shouldRender:N,property:s,time:L,small:h,ready:p,timelineManagerRef:Zd,interactionMode:F,selectedFeature:ef,cursor:rf,onCameraChange:pf,onLayerDrag:sf,onLayerDrop:mf,onLayerSelect:of,onLayerEdit:ff,overrideInteractionMode:xf,onSketchFeatureCreate:Gd,onSketchPluginFeatureCreate:Rf,onSketchTypeChange:Vf,onMount:Ai,onLayerVisibility:Lf,onLayerLoad:Pf,onLayerSelectWithRectStart:Uf,onLayerSelectWithRectMove:Bf,onLayerSelectWithRectEnd:Tf}),jsxRuntimeExports.jsx(coreContext.Provider,{value:lf,children:oe})]})})})}));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,E=y>>1,L=-7,F=o?c-1:0,N=o?-1:1,z=t[n+F];for(F+=N,d=z&(1<<-L)-1,z>>=-L,L+=p;L>0;d=d*256+t[n+F],F+=N,L-=8);for(h=d&(1<<-L)-1,d>>=-L,L+=s;L>0;h=h*256+t[n+F],F+=N,L-=8);if(d===0)d=1-E;else{if(d===y)return h?NaN:(z?-1:1)*(1/0);h=h+Math.pow(2,s),d=d-E}return(z?-1:1)*h*Math.pow(2,d-s)}function write(t,n,o,s,c,d){var h,p,y,E=d*8-c-1,L=(1<<E)-1,F=L>>1,N=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=s?0:d-1,H=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=L):(h=Math.floor(Math.log(n)/Math.LN2),n*(y=Math.pow(2,-h))<1&&(h--,y*=2),h+F>=1?n+=N/y:n+=N*Math.pow(2,1-F),n*y>=2&&(h++,y/=2),h+F>=L?(p=0,h=L):h+F>=1?(p=(n*y-1)*Math.pow(2,c),h=h+F):(p=n*Math.pow(2,F-1)*Math.pow(2,c),h=0));c>=8;t[o+z]=p&255,z+=H,p/=256,c-=8);for(h=h<<c|p,E+=c;E>0;t[o+z]=h&255,z+=H,h/=256,E-=8);t[o+z-H]|=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),E=this.slice(c,d),L=n.slice(o,s),F=0;F<y;++F)if(E[F]!==L[F]){h=E[F],p=L[F];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(z,H){return d===1?z[H]:z.readUInt16BE(H*d)}var E;if(c){var L=-1;for(E=o;E<h;E++)if(y(t,E)===y(n,L===-1?0:E-L)){if(L===-1&&(L=E),E-L+1===p)return L*d}else L!==-1&&(E-=E-L),L=-1}else for(o+p>h&&(o=h-p),E=o;E>=0;E--){for(var F=!0,N=0;N<p;N++)if(y(t,E+N)!==y(n,N)){F=!1;break}if(F)return E}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,E,L,F;switch(p){case 1:d<128&&(h=d);break;case 2:y=t[c+1],(y&192)===128&&(F=(d&31)<<6|y&63,F>127&&(h=F));break;case 3:y=t[c+1],E=t[c+2],(y&192)===128&&(E&192)===128&&(F=(d&15)<<12|(y&63)<<6|E&63,F>2047&&(F<55296||F>57343)&&(h=F));break;case 4:y=t[c+1],E=t[c+2],L=t[c+3],(y&192)===128&&(E&192)===128&&(L&192)===128&&(F=(d&15)<<18|(y&63)<<12|(E&63)<<6|L&63,F>65535&&F<1114112&&(h=F))}}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,E=n==="error";if(p=this._events,p)E=E&&p.error==null;else if(!E)return!1;if(y=this.domain,E){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 L=new Error('Uncaught, unspecified "error" event. ('+o+")");throw L.context=o,L}return!1}if(s=p[n],!s)return!1;var F=typeof s=="function";switch(c=arguments.length,c){case 1:emitNone(s,F,this);break;case 2:emitOne(s,F,this,arguments[1]);break;case 3:emitTwo(s,F,this,arguments[1],arguments[2]);break;case 4:emitThree(s,F,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,F,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="",E=!1,L=["{","}"];if(isArray(n)&&(E=!0,L=["[","]"]),isFunction(n)){var F=n.name?": "+n.name:"";y=" [Function"+F+"]"}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&&(!E||n.length==0))return L[0]+y+L[1];if(o<0)return isRegExp(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var N;return E?N=formatArray(t,n,o,h,d):N=d.map(function(z){return formatProperty(t,n,o,h,z,E)}),t.seen.pop(),reduceToSingleString(N,y,L)}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(`
|
|
6703
|
+
`,uniforms:{...pick(L,["color","frustumLength","blackPoint","whitePoint","gamma"]),globeDepthTexture:()=>(y==null?void 0:y())??N._depthTexture}});if(c){const z=createBilateralFilterStage({prefix:t,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:y,uniforms:{textureScale:n,...pick(L,["frustumLength","normalExponent","depthExponent"])}}),H=new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion_generate_and_filter`,stages:[F,z]});return N.uniforms.ambientOcclusionTexture=H.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[H,N],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:F,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:z,uniforms:["frustumLength","normalExponent","depthExponent"]},{stage:N,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}else return N.uniforms.ambientOcclusionTexture=F.name,new Cesium$1.PostProcessStageComposite({name:`${t}_ambient_occlusion`,stages:[F,N],inputPreviousStageTexture:!1,uniforms:createUniforms([{stage:F,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:N,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:E}=De$1(),L=E==null?void 0:E.scene,F=useInstance({owner:L==null?void 0:L.postProcessStages,keys:[n,s,o,c,d,h,p],create:()=>{const N=createAmbientOcclusionStage({textureScale:n,steps:s,directions:o,denoise:c,accurateNormalReconstruction:d,outputType:h,useGlobeDepth:p,getGlobeDepthTexture:()=>L.context.uniformState.globeDepthTexture,uniforms:y});return N.enabled=t,N},transferOwnership:(N,z)=>(z==null||z.add(N),()=>{z==null||z.remove(N)})});return F.enabled=t,Object.assign(F.uniforms,y),L==null||L.requestRender(),usePreRender(()=>{const N=L==null?void 0:L.camera.frustum;if(N instanceof Cesium$1.PerspectiveFrustum){const z=1/Math.tan(N.fovy/2);F.uniforms.focalLength.x=z*N.aspectRatio,F.uniforms.focalLength.y=z}}),null},AmbientOcclusion=t=>{const n=De$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}};let image;function getImage(){if(image!=null)return image;image=document.createElement("canvas"),image.width=16,image.height=16;const t=image.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),image}const ControlPoint=({position:t,clampToGround:n=!1})=>{const o=React.useRef(t);o.current=t;const s=useConstant$2(()=>new CallbackProperty((d,h)=>"getValue"in o.current?o.current.getValue(d,h):o.current,!1)),c=React.useMemo(()=>({position:s,billboard:{image:getImage(),width:8,height:8,heightReference:n?HeightReference$1.CLAMP_TO_GROUND:HeightReference$1.NONE,disableDepthTestDistance:1/0}}),[n,s]);return jsxRuntimeExports.jsx(Is$1,{...c})};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}=De$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,E=!1,L=!1)=>{const F=L&&c,N=F?n:o;return E&&h.add(y),N.add(y)&&F&&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 E=0;E<s;E++){const L=n.order[E];h.has(L)&&(p.schedule(L),t()),L(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((F,N)=>(F[N]=createRenderStep(()=>o=!0),F),{}),h=F=>{d[F].process(c)},p=()=>{const F=performance.now();o=!1,c.delta=s?1e3/60:Math.max(Math.min(F-c.timestamp,maxElapsed),1),c.timestamp=F,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((F,N)=>{const z=d[N];return F[N]=(H,W=!1,oe=!1)=>(o||y(),z.schedule(H,W,oe)),F},{}),cancel:F=>stepsOrder.forEach(N=>d[N].cancel(F)),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 E=y.current;React.useInsertionEffect(()=>{E&&E.update(o,h)});const L=React.useRef(!!(o[optimizedAppearDataAttribute]&&!window.HandoffComplete));return useIsomorphicLayoutEffect$1(()=>{E&&(microtask.postRender(E.render),L.current&&E.animationState&&E.animationState.animateChanges())}),React.useEffect(()=>{E&&(E.updateFeatures(),!L.current&&E.animationState&&E.animationState.animateChanges(),L.current&&(L.current=!1,window.HandoffComplete=!0))}),E}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 E;const L={...React.useContext(MotionConfigContext),...p,layoutId:useLayoutId(p)},{isStatic:F}=L,N=useCreateMotionContext(p),z=s(p,F);if(!F&&isBrowser){N.visualElement=useVisualElement(c,z,L,n);const H=React.useContext(SwitchLayoutGroupContext),W=React.useContext(LazyContext).strict;N.visualElement&&(E=N.visualElement.loadFeatures(L,W,t,H))}return React__namespace.createElement(MotionContext.Provider,{value:N},E&&N.visualElement?React__namespace.createElement(E,{visualElement:N.visualElement,...L}):null,o(c,p,useMotionRef(z,N.visualElement,y),z,F,N.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,E=!1,L=!0;for(const F in n){const N=n[F];if(isCSSVariableName(F)){d[F]=N;continue}const z=numberValueTypes[F],H=getValueAsType(N,z);if(transformProps.has(F)){if(y=!0,h[F]=H,!L)continue;N!==(z.default||0)&&(L=!1)}else F.startsWith("origin")?(E=!0,p[F]=H):c[F]=H}if(n.transform||(y||s?c.transform=buildTransform(t.transform,o,L,s):c.transform&&(c.transform="none")),E){const{originX:F="50%",originY:N="50%",originZ:z=0}=p;c.transformOrigin=`${F} ${N} ${z}`}}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,...E},L,F,N){if(buildHTMLStyles(t,E,L,N),F){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:z,style:H,dimensions:W}=t;z.transform&&(W&&(H.transform=z.transform),delete z.transform),W&&(c!==void 0||d!==void 0||H.transform)&&(H.transformOrigin=calcSVGTransformOrigin(W,c!==void 0?c:.5,d!==void 0?d:.5)),n!==void 0&&(z.x=n),o!==void 0&&(z.y=o),s!==void 0&&(z.scale=s),h!==void 0&&buildSVGPath(z,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),E=filterProps(s,typeof o=="string",t),L=o!==React.Fragment?{...E,...y,ref:c}:{},{children:F}=s,N=React.useMemo(()=>isMotionValue(F)?F.get():F,[F]);return React.createElement(o,{...L,children:N})}}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 N in d)c[N]=resolveMotionValue(d[N]);let{initial:h,animate:p}=t;const y=isControllingVariants(t),E=isVariantNode(t);n&&E&&!y&&t.inherit!==!1&&(h===void 0&&(h=n.initial),p===void 0&&(p=n.animate));let L=o?o.initial===!1:!1;L=L||h===!1;const F=L?p:h;return F&&typeof F!="boolean"&&!isAnimationControls(F)&&(Array.isArray(F)?F:[F]).forEach(z=>{const H=resolveVariantFromProps(t,z);if(!H)return;const{transitionEnd:W,transition:oe,...nt}=H;for(const J in nt){let lt=nt[J];if(Array.isArray(lt)){const yt=L?lt.length-1:0;lt=lt[yt]}lt!==null&&(c[J]=lt)}for(const J in W)c[J]=W[J]}),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:E,onTapCancel:L,globalTapTarget:F}=this.node.getProps();!F&&!isNodeOrChild(this.node.current,p.target)?L&&L(p,y):E&&E(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,E)=>{const{onTap:L}=this.node.getProps();L&&L(y,E)})};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:E}=y;if(this.isInView===E||(this.isInView=E,d&&!E&&this.hasEnteredView))return;E&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",E);const{onViewportEnter:L,onViewportLeave:F}=this.node.getProps(),N=E?L:F;N&&N(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:E,...L}){return!!Object.keys(L).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 E=n[y];if(typeof E=="string"&&isCSSVariableToken(E)){const L=getVariableValue(E,o.current);L!==void 0&&(n[y]=L)}}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 E=n[y];typeof E=="string"&&(n[y]=parseFloat(E))}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,E])=>{o.getValue(y).set(E)}),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:E}=this.options;if(!E&&!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 L=this.initPlayback(n,o);L!==!1&&(this._resolved={keyframes:n,finalKeyframe:o,...L},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=E=>{const L=E*h,F=L*t,N=L-o,z=calcAngularFreq(E,h),H=Math.exp(-F);return safeMin-N/z*H},d=E=>{const F=E*h*t,N=F*o+o,z=Math.pow(h,2)*Math.pow(E,2)*t,H=Math.exp(-F),W=calcAngularFreq(Math.pow(E,2),h);return(-c(E)+safeMin>0?-1:1)*((N-z)*H)/W}):(c=E=>{const L=Math.exp(-E*t),F=(E-o)*t+1;return-safeMin+L*F},d=E=>{const L=Math.exp(-E*t),F=(o-E)*(t*t);return L*F});const p=5/t,y=approximateRoot(c,d,p);if(t=secondsToMilliseconds(t),isNaN(y))return{stiffness:100,damping:10,duration:t};{const E=Math.pow(y,2)*s;return{stiffness:E,damping:h*2*Math.sqrt(s*E),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:E,duration:L,velocity:F,isResolvedFromDuration:N}=getSpringOptions({...s,velocity:-millisecondsToSeconds(s.velocity||0)}),z=F||0,H=y/(2*Math.sqrt(p*E)),W=d-c,oe=millisecondsToSeconds(Math.sqrt(p/E)),nt=Math.abs(W)<5;o||(o=nt?.01:2),n||(n=nt?.005:.5);let J;if(H<1){const lt=calcAngularFreq(oe,H);J=yt=>{const pi=Math.exp(-H*oe*yt);return d-pi*((z+H*oe*W)/lt*Math.sin(lt*yt)+W*Math.cos(lt*yt))}}else if(H===1)J=lt=>d-Math.exp(-oe*lt)*(W+(z+oe*W)*lt);else{const lt=oe*Math.sqrt(H*H-1);J=yt=>{const pi=Math.exp(-H*oe*yt),Ai=Math.min(lt*yt,300);return d-pi*((z+H*oe*W)*Math.sinh(Ai)+lt*W*Math.cosh(Ai))/lt}}return{calculatedDuration:N&&L||null,next:lt=>{const yt=J(lt);if(N)h.done=lt>=L;else{let pi=z;lt!==0&&(H<1?pi=calcGeneratorVelocity(J,lt,yt):pi=0);const Ai=Math.abs(pi)<=o,Vd=Math.abs(d-yt)<=n;h.done=Ai&&Vd}return h.value=h.done?d:yt,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:E=.5,restSpeed:L}){const F=t[0],N={done:!1,value:F},z=Gd=>p!==void 0&&Gd<p||y!==void 0&&Gd>y,H=Gd=>p===void 0?y:y===void 0||Math.abs(p-Gd)<Math.abs(y-Gd)?p:y;let W=o*n;const oe=F+W,nt=h===void 0?oe:h(oe);nt!==oe&&(W=nt-F);const J=Gd=>-W*Math.exp(-Gd/s),lt=Gd=>nt+J(Gd),yt=Gd=>{const md=J(Gd),tf=lt(Gd);N.done=Math.abs(md)<=E,N.value=N.done?nt:tf};let pi,Ai;const Vd=Gd=>{z(N.value)&&(pi=Gd,Ai=spring({keyframes:[N.value,H(N.value)],velocity:calcGeneratorVelocity(lt,Gd,N.value),damping:c,stiffness:d,restDelta:E,restSpeed:L}))};return Vd(0),{calculatedDuration:null,next:Gd=>{let md=!1;return!Ai&&pi===void 0&&(md=!0,yt(Gd),Vd(Gd)),pi!==void 0&&Gd>=pi?Ai.next(Gd-pi):(!md&&yt(Gd),N)}}}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=E=>{let L=0;if(p>1)for(;L<t.length-2&&!(E<t[L+1]);L++);const F=progress(t[L],t[L+1],E);return h[L](F)};return o?E=>y(clamp(t[0],t[d-1],E)):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,E;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 L=p({...this.options,keyframes:n});d==="mirror"&&(E=p({...this.options,keyframes:[...n].reverse(),velocity:-h})),L.calculatedDuration===null&&(L.calculatedDuration=calcGeneratorDuration(L));const{calculatedDuration:F}=L,N=F+c,z=N*(s+1)-c;return{generator:L,mirroredGenerator:E,mapPercentToKeyframes:y,calculatedDuration:F,resolvedDuration:N,totalDuration:z}}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:Gd}=this.options;return{done:!0,value:Gd[Gd.length-1]}}const{finalKeyframe:c,generator:d,mirroredGenerator:h,mapPercentToKeyframes:p,keyframes:y,calculatedDuration:E,totalDuration:L,resolvedDuration:F}=s;if(this.startTime===null)return d.next(0);const{delay:N,repeat:z,repeatType:H,repeatDelay:W,onUpdate:oe}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,n):this.speed<0&&(this.startTime=Math.min(n-L/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 nt=this.currentTime-N*(this.speed>=0?1:-1),J=this.speed>=0?nt<0:nt>L;this.currentTime=Math.max(nt,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=L);let lt=this.currentTime,yt=d;if(z){const Gd=Math.min(this.currentTime,L)/F;let md=Math.floor(Gd),tf=Gd%1;!tf&&Gd>=1&&(tf=1),tf===1&&md--,md=Math.min(md,z+1),!!(md%2)&&(H==="reverse"?(tf=1-tf,W&&(tf-=W/F)):H==="mirror"&&(yt=h)),lt=clamp(0,1,tf)*F}const pi=J?{done:!1,value:y[0]}:yt.next(lt);p&&(pi.value=p(pi.value));let{done:Ai}=pi;!J&&E!==null&&(Ai=this.speed>=0?this.currentTime>=L:this.currentTime<=0);const Vd=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&Ai);return Vd&&c!==void 0&&(pi.value=getFinalKeyframe(y,this.options,c)),oe&&oe(pi.value),Vd&&this.finish(),pi}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 E={[n]:o};y&&(E.offset=y);const L=mapEasingToNativeEasing(p);return Array.isArray(L)&&(E.easing=L),t.animate(E,{delay:s,duration:c,easing:Array.isArray(L)?"linear":L,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:E}=this.options;if(!(!((s=y.owner)===null||s===void 0)&&s.current))return!1;if(requiresPregeneratedKeyframes(this.options)){const{onComplete:F,onUpdate:N,motionValue:z,...H}=this.options,W=pregenerateKeyframes(n,H);n=W.keyframes,n.length===1&&(n[1]=n[0]),c=W.duration,d=W.times,h=W.ease,p="keyframes"}const L=animateStyle(y.owner.current,E,n,{...this.options,duration:c,times:d,ease:h});return L.startTime=time.now(),this.pendingTimeline?(L.timeline=this.pendingTimeline,this.pendingTimeline=void 0):L.onfinish=()=>{const{onComplete:F}=this.options;y.set(getFinalKeyframe(n,this.options,o)),F&&F(),this.cancel(),this.resolveFinishedPromise()},{animation:L,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:E,onComplete:L,...F}=this.options,N=new MainThreadAnimation({...F,keyframes:s,duration:c,type:d,ease:h,times:p,isGenerator:!0}),z=secondsToMilliseconds(this.time);y.setWithVelocity(N.sample(z-sampleDelta).value,N.sample(z).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:E=0}=s;E=E-secondsToMilliseconds(y);let L={keyframes:Array.isArray(o)?o:[null,o],ease:"easeOut",velocity:n.getVelocity(),...p,delay:-E,onUpdate:N=>{n.set(N),p.onUpdate&&p.onUpdate(N)},onComplete:()=>{h(),p.onComplete&&p.onComplete()},name:t,motionValue:n,element:d?void 0:c};isTransitionDefined(p)||(L={...L,...getDefaultTransition(t,L)}),L.duration&&(L.duration=secondsToMilliseconds(L.duration)),L.repeatDelay&&(L.repeatDelay=secondsToMilliseconds(L.repeatDelay)),L.from!==void 0&&(L.keyframes[0]=L.from);let F=!1;if((L.type===!1||L.duration===0&&!L.repeatDelay)&&(L.duration=0,L.delay===0&&(F=!0)),F&&!d&&n.get()!==void 0){const N=getFinalKeyframe(L.keyframes,p);if(N!==void 0){frame.update(()=>{L.onUpdate(N),L.onComplete()});return}}return!d&&AcceleratedAnimation.supports(L)?new AcceleratedAnimation(L):new MainThreadAnimation(L)};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),o&&console.warn(o),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 E=t.getValue("willChange");s&&(h=s);const L=[],F=c&&t.animationState&&t.animationState.getState()[c];for(const N in y){const z=t.getValue(N,(d=t.latestValues[N])!==null&&d!==void 0?d:null),H=y[N];if(H===void 0||F&&shouldBlockAnimation(F,N))continue;const W={delay:o,elapsed:0,...getValueTransition(h||{},N)};let oe=!1;if(window.HandoffAppearAnimations){const J=t.getProps()[optimizedAppearDataAttribute];if(J){const lt=window.HandoffAppearAnimations(J,N);lt!==null&&(W.elapsed=lt,oe=!0)}}z.start(animateMotionValue(N,z,H,t.shouldReduceMotion&&transformProps.has(N)?{type:!1}:W,t,oe));const nt=z.animation;nt&&(isWillChangeMotionValue(E)&&(E.add(N),nt.then(()=>E.remove(N))),L.push(nt))}return p&&Promise.all(L).then(()=>{frame.update(()=>{p&&setTarget(t,p)})}),L}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?(E=0)=>{const{delayChildren:L=0,staggerChildren:F,staggerDirection:N}=d;return animateChildren(t,n,L+E,F,N,o)}:()=>Promise.resolve(),{when:y}=d;if(y){const[E,L]=y==="beforeChildren"?[h,p]:[p,h];return E().then(()=>L())}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?(E=0)=>E*s:(E=0)=>p-E*s;return Array.from(t.variantChildren).sort(sortByTreeOrder).forEach((E,L)=>{E.notify("AnimationStart",n),h.push(animateVariant(E,n,{...d,delay:o+y(L)}).then(()=>E.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=>(E,L)=>{var F;const N=resolveVariant(t,L,y==="exit"?(F=t.presenceContext)===null||F===void 0?void 0:F.custom:void 0);if(N){const{transition:z,transitionEnd:H,...W}=N;E={...E,...W,...H}}return E};function d(y){n=y(t)}function h(y){const E=t.getProps(),L=t.getVariantContext(!0)||{},F=[],N=new Set;let z={},H=1/0;for(let oe=0;oe<numAnimationTypes;oe++){const nt=reversePriorityOrder[oe],J=o[nt],lt=E[nt]!==void 0?E[nt]:L[nt],yt=isVariantLabel(lt),pi=nt===y?J.isActive:null;pi===!1&&(H=oe);let Ai=lt===L[nt]&<!==E[nt]&&yt;if(Ai&&s&&t.manuallyAnimateOnMount&&(Ai=!1),J.protectedKeys={...z},!J.isActive&&pi===null||!lt&&!J.prevProp||isAnimationControls(lt)||typeof lt=="boolean")continue;let Gd=checkVariantsDidChange(J.prevProp,lt)||nt===y&&J.isActive&&!Ai&&yt||oe>H&&yt,md=!1;const tf=Array.isArray(lt)?lt:[lt];let nf=tf.reduce(c(nt),{});pi===!1&&(nf={});const{prevResolvedValues:ef={}}=J,mt={...ef,...nf},Ee=sl=>{Gd=!0,N.has(sl)&&(md=!0,N.delete(sl)),J.needsAnimating[sl]=!0;const Zd=t.getValue(sl);Zd&&(Zd.liveStyle=!1)};for(const sl in mt){const Zd=nf[sl],rf=ef[sl];if(z.hasOwnProperty(sl))continue;let uf=!1;isKeyframesTarget(Zd)&&isKeyframesTarget(rf)?uf=!shallowCompare(Zd,rf):uf=Zd!==rf,uf?Zd!=null?Ee(sl):N.add(sl):Zd!==void 0&&N.has(sl)?Ee(sl):J.protectedKeys[sl]=!0}J.prevProp=lt,J.prevResolvedValues=nf,J.isActive&&(z={...z,...nf}),s&&t.blockInitialAnimation&&(Gd=!1),Gd&&(!Ai||md)&&F.push(...tf.map(sl=>({animation:sl,options:{type:nt}})))}if(N.size){const oe={};N.forEach(nt=>{const J=t.getBaseTarget(nt),lt=t.getValue(nt);lt&&(lt.liveStyle=!0),oe[nt]=J===void 0?null:J}),F.push({animation:oe})}let W=!!F.length;return s&&(E.initial===!1||E.initial===E.animate)&&!t.manuallyAnimateOnMount&&(W=!1),s=!1,W?n(F):Promise.resolve()}function p(y,E){var L;if(o[y].isActive===E)return Promise.resolve();(L=t.variantChildren)===null||L===void 0||L.forEach(N=>{var z;return(z=N.animationState)===null||z===void 0?void 0:z.setActive(y,E)}),o[y].isActive=E;const F=h(y);for(const N in o)o[N].protectedKeys={};return F}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 F=getPanInfo(this.lastMoveEventInfo,this.history),N=this.startEvent!==null,z=distance2D(F.offset,{x:0,y:0})>=3;if(!N&&!z)return;const{point:H}=F,{timestamp:W}=frameData;this.history.push({...H,timestamp:W});const{onStart:oe,onMove:nt}=this.handlers;N||(oe&&oe(this.lastMoveEvent,F),this.startEvent=this.lastMoveEvent),nt&&nt(this.lastMoveEvent,F)},this.handlePointerMove=(F,N)=>{this.lastMoveEvent=F,this.lastMoveEventInfo=transformPoint(N,this.transformPagePoint),frame.update(this.updatePoint,!0)},this.handlePointerUp=(F,N)=>{this.end();const{onEnd:z,onSessionEnd:H,resumeAnimation:W}=this.handlers;if(this.dragSnapToOrigin&&W&&W(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const oe=getPanInfo(F.type==="pointercancel"?this.lastMoveEventInfo:transformPoint(N,this.transformPagePoint),this.history);this.startEvent&&z&&z(F,oe),H&&H(F,oe)},!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:E}=frameData;this.history=[{...y,timestamp:E}];const{onSessionStart:L}=o;L&&L(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=L=>{const{dragSnapToOrigin:F}=this.getProps();F?this.pauseAnimation():this.stopAnimation(),o&&this.snapToCursor(extractEventInfo(L,"page").point)},d=(L,F)=>{const{drag:N,dragPropagation:z,onDragStart:H}=this.getProps();if(N&&!z&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=getGlobalLock(N),!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(oe=>{let nt=this.getAxisMotionValue(oe).get()||0;if(percent.test(nt)){const{projection:J}=this.visualElement;if(J&&J.layout){const lt=J.layout.layoutBox[oe];lt&&(nt=calcLength(lt)*(parseFloat(nt)/100))}}this.originPoint[oe]=nt}),H&&H(L,F);const{animationState:W}=this.visualElement;W&&W.setActive("whileDrag",!0)},h=(L,F)=>{const{dragPropagation:N,dragDirectionLock:z,onDirectionLock:H,onDrag:W}=this.getProps();if(!N&&!this.openGlobalLock)return;const{offset:oe}=F;if(z&&this.currentDirection===null){this.currentDirection=getCurrentDirection(oe),this.currentDirection!==null&&H&&H(this.currentDirection);return}this.updateAxis("x",F.point,oe),this.updateAxis("y",F.point,oe),this.visualElement.render(),W&&W(L,F)},p=(L,F)=>this.stop(L,F),y=()=>eachAxis(L=>{var F;return this.getAnimationState(L)==="paused"&&((F=this.getAxisMotionValue(L).animation)===null||F===void 0?void 0:F.play())}),{dragSnapToOrigin:E}=this.getProps();this.panSession=new PanSession(n,{onSessionStart:c,onStart:d,onMove:h,onSessionEnd:p,resumeAnimation:y},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:E,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||{},E=eachAxis(L=>{if(!shouldDrag(L,o,this.currentDirection))return;let F=y&&y[L]||{};h&&(F={min:0,max:0});const N=c?200:1e6,z=c?40:1e7,H={type:"inertia",velocity:s?n[L]:0,bounceStiffness:N,bounceDamping:z,timeConstant:750,restDelta:1,restSpeed:10,...d,...F};return this.startAxisValueAnimation(L,H)});return Promise.all(E).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:E}=this.constraints[h];p.set(mixNumber$1(y,E,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:E,dragListener:L=!0}=this.getProps();E&&L&&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:E})=>{this.isDragging&&E&&(eachAxis(L=>{const F=this.getAxisMotionValue(L);F&&(this.originPoint[L]+=y[L].translate,F.set(F.get()+y[L].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 E=mixNumber$1(p,y,.5);return typeof c[2+h]=="number"&&(c[2+h]/=E),typeof c[3+h]=="number"&&(c[3+h]/=E),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),E=getRadius(o,p);if(y===void 0&&E===void 0)continue;y||(y=0),E||(E=0),y===0||E===0||isPx(y)===isPx(E)?(t[p]=Math.max(mixNumber$1(asNumber(y),asNumber(E),s),0),(percent.test(E)||percent.test(y))&&(t[p]+="%")):t[p]=E}(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:E,rotate:L,rotateX:F,rotateY:N,skewX:z,skewY:H}=o;E&&(s=`perspective(${E}px) ${s}`),L&&(s+=`rotate(${L}deg) `),F&&(s+=`rotateX(${F}deg) `),N&&(s+=`rotateY(${N}deg) `),z&&(s+=`skewX(${z}deg) `),H&&(s+=`skewY(${H}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:E,visualElement:L}=this.options;if(L&&!L.current&&L.mount(h),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),p&&(E||y)&&(this.isLayoutDirty=!0),t){let F;const N=()=>this.root.updateBlockedByResize=!1;t(h,()=>{this.root.updateBlockedByResize=!0,F&&F(),F=delay(N,250),globalProjectionState.hasAnimatedSinceResize&&(globalProjectionState.hasAnimatedSinceResize=!1,this.nodes.forEach(finishAnimation))})}y&&this.root.registerSharedNode(y,this),this.options.animate!==!1&&L&&(y||E)&&this.addEventListener("didUpdate",({delta:F,hasLayoutChanged:N,hasRelativeTargetChanged:z,layout:H})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const W=this.options.transition||L.getDefaultTransition()||defaultLayoutTransition,{onLayoutAnimationStart:oe,onLayoutAnimationComplete:nt}=L.getProps(),J=!this.targetLayout||!boxEqualsRounded(this.targetLayout,H)||z,lt=!N&&z;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||lt||N&&(J||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(F,lt);const yt={...getValueTransition(W,"layout"),onPlay:oe,onComplete:nt};(L.shouldReduceMotion||this.options.layoutRoot)&&(yt.delay=0,yt.type=!1),this.startAnimation(yt)}else N||finishAnimation(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=H})}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 L=0;L<this.path.length;L++){const F=this.path[L];F.shouldResetTransform=!0,F.updateScroll("snapshot"),F.options.layoutRoot&&F.willUpdate(!1)}const{layoutId:p,layout:y}=this.options;if(p===void 0&&!y)return;const E=this.getTransformTemplate();this.prevTransformTemplateValue=E?E(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(),E=y?y(this.latestValues,""):void 0,L=E!==this.prevTransformTemplateValue;h&&(p||hasTransform(this.latestValues)||L)&&(c(this.instance,E),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 E=this.path[y],{scroll:L,options:F}=E;if(E!==this.root&&L&&F.layoutScroll){if(L.isRoot){copyBoxInto(p,h);const{scroll:N}=this.root;N&&(translateAxis(p.x,-N.offset.x),translateAxis(p.y,-N.offset.y))}translateAxis(p.x,L.offset.x),translateAxis(p.y,L.offset.y)}}return p}applyTransform(h,p=!1){const y=createBox();copyBoxInto(y,h);for(let E=0;E<this.path.length;E++){const L=this.path[E];!p&&L.options.layoutScroll&&L.scroll&&L!==L.root&&transformBox(y,{x:-L.scroll.offset.x,y:-L.scroll.offset.y}),hasTransform(L.latestValues)&&transformBox(y,L.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 E=this.path[y];if(!E.instance||!hasTransform(E.latestValues))continue;hasScale(E.latestValues)&&E.updateSnapshot();const L=createBox(),F=E.measurePageBox();copyBoxInto(L,F),removeBoxTransforms(p,E.latestValues,E.snapshot?E.snapshot.layoutBox:void 0,L)}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 E=!!this.resumingFrom||this!==y;if(!(h||E&&this.isSharedProjectionDirty||this.isProjectionDirty||!((p=this.parent)===null||p===void 0)&&p.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:F,layoutId:N}=this.options;if(!(!this.layout||!(F||N))){if(this.resolvedRelativeTargetAt=frameData.timestamp,!this.targetDelta&&!this.relativeTarget){const z=this.getClosestProjectingParent();z&&z.layout&&this.animationProgress!==1?(this.relativeParent=z,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.layout.layoutBox,z.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 z=this.getClosestProjectingParent();z&&!!z.resumingFrom==!!this.resumingFrom&&!z.options.layoutScroll&&z.target&&this.animationProgress!==1?(this.relativeParent=z,this.forceRelativeParentToResolveTarget(),this.relativeTarget=createBox(),this.relativeTargetOrigin=createBox(),calcRelativePosition(this.relativeTargetOrigin,this.target,z.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 E=!0;if((this.isProjectionDirty||!((h=this.parent)===null||h===void 0)&&h.isProjectionDirty)&&(E=!1),y&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(E=!1),this.resolvedRelativeTargetAt===frameData.timestamp&&(E=!1),E)return;const{layout:L,layoutId:F}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(L||F))return;copyBoxInto(this.layoutCorrected,this.layout.layoutBox);const N=this.treeScale.x,z=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:H}=p;if(!H){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,H,this.latestValues),this.projectionTransform=buildProjectionTransform(this.projectionDelta,this.treeScale),(this.projectionTransform!==W||this.treeScale.x!==N||this.treeScale.y!==z)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",H)),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,E=y?y.latestValues:{},L={...this.latestValues},F=createDelta();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!p;const N=createBox(),z=y?y.source:void 0,H=this.layout?this.layout.source:void 0,W=z!==H,oe=this.getStack(),nt=!oe||oe.members.length<=1,J=!!(W&&!nt&&this.options.crossfade===!0&&!this.path.some(hasOpacityCrossfade));this.animationProgress=0;let lt;this.mixTargetDelta=yt=>{const pi=yt/1e3;mixAxisDelta(F.x,h.x,pi),mixAxisDelta(F.y,h.y,pi),this.setTargetDelta(F),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(calcRelativePosition(N,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mixBox(this.relativeTarget,this.relativeTargetOrigin,N,pi),lt&&boxEquals(this.relativeTarget,lt)&&(this.isProjectionDirty=!1),lt||(lt=createBox()),copyBoxInto(lt,this.relativeTarget)),W&&(this.animationValues=L,mixValues(L,E,this.latestValues,pi,J,nt)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=pi},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:E,latestValues:L}=h;if(!(!p||!y||!E)){if(this!==h&&this.layout&&E&&shouldAnimatePositionOnly(this.options.animationType,this.layout.layoutBox,E.layoutBox)){y=this.target||createBox();const F=calcLength(this.layout.layoutBox.x);y.x.min=h.target.x.min,y.x.max=y.x.min+F;const N=calcLength(this.layout.layoutBox.y);y.y.min=h.target.y.min,y.y.max=y.y.min+N}copyBoxInto(p,y),transformBox(p,L),calcBoxDelta(this.projectionDeltaWithTransform,this.layoutCorrected,p,L)}}registerSharedNode(h,p){this.sharedNodes.has(h)||this.sharedNodes.set(h,new NodeStack),this.sharedNodes.get(h).add(p);const E=p.options.initialPromotionConfig;p.promote({transition:E?E.transition:void 0,preserveFollowOpacity:E&&E.shouldPreserveFollowOpacity?E.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 E=this.getStack();E&&E.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 E={};y.z&&resetDistortingTransform("z",h,E,this.animationValues);for(let L=0;L<transformAxes.length;L++)resetDistortingTransform(`rotate${transformAxes[L]}`,h,E,this.animationValues),resetDistortingTransform(`skew${transformAxes[L]}`,h,E,this.animationValues);h.render();for(const L in E)h.setStaticValue(L,E[L]),this.animationValues&&(this.animationValues[L]=E[L]);h.scheduleRender()}getProjectionStyles(h){var p,y;if(!this.instance||this.isSVG)return;if(!this.isVisible)return hiddenVisibility;const E={visibility:""},L=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,E.opacity="",E.pointerEvents=resolveMotionValue(h==null?void 0:h.pointerEvents)||"",E.transform=L?L(this.latestValues,""):"none",E;const F=this.getLead();if(!this.projectionDelta||!this.layout||!F.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=L?L({},""):"none",this.hasProjected=!1),W}const N=F.animationValues||F.latestValues;this.applyTransformsToTarget(),E.transform=buildProjectionTransform(this.projectionDeltaWithTransform,this.treeScale,N),L&&(E.transform=L(N,E.transform));const{x:z,y:H}=this.projectionDelta;E.transformOrigin=`${z.origin*100}% ${H.origin*100}% 0`,F.animationValues?E.opacity=F===this?(y=(p=N.opacity)!==null&&p!==void 0?p:this.latestValues.opacity)!==null&&y!==void 0?y:1:this.preserveOpacity?this.latestValues.opacity:N.opacityExit:E.opacity=F===this?N.opacity!==void 0?N.opacity:"":N.opacityExit!==void 0?N.opacityExit:0;for(const W in scaleCorrectors){if(N[W]===void 0)continue;const{correct:oe,applyTo:nt}=scaleCorrectors[W],J=E.transform==="none"?N[W]:oe(N[W],F);if(nt){const lt=nt.length;for(let yt=0;yt<lt;yt++)E[nt[yt]]=J}else E[W]=J}return this.options.layoutId&&(E.pointerEvents=F===this?resolveMotionValue(h==null?void 0:h.pointerEvents)||"":"none"),E}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(F=>{const N=h?o.measuredBox[F]:o.layoutBox[F],z=calcLength(N);N.min=s[F].min,N.max=N.min+z}):shouldAnimatePositionOnly(d,o.layoutBox,s)&&eachAxis(F=>{const N=h?o.measuredBox[F]:o.layoutBox[F],z=calcLength(s[F]);N.max=N.min+z,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[F].max=t.relativeTarget[F].min+z)});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 E=!isDeltaZero(p);let L=!1;if(!t.resumeFrom){const F=t.getClosestProjectingParent();if(F&&!F.resumeFrom){const{snapshot:N,layout:z}=F;if(N&&z){const H=createBox();calcRelativePosition(H,o.layoutBox,N.layoutBox);const W=createBox();calcRelativePosition(W,s,z.layoutBox),boxEqualsRounded(H,W)||(L=!0),F.options.layoutRoot&&(t.relativeTarget=W,t.relativeTargetOrigin=H,t.relativeParent=F)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:o,delta:y,layoutDelta:p,hasLayoutChanged:E,hasRelativeTargetChanged:L})}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=(N,z,H,W)=>new this.KeyframeResolver(N,z,H,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:E}=h;this.latestValues=y,this.baseTarget={...y},this.initialValues=o.initial?{...y}:{},this.renderState=E,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:L,...F}=this.scrapeMotionValuesFromProps(o,{},this);for(const N in F){const z=F[N];y[N]!==void 0&&isMotionValue(z)&&(z.set(y[N],!1),isWillChangeMotionValue(L)&&L.add(N))}}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 E=featureNames[y],{isEnabled:L,Feature:F,ProjectionNode:N,MeasureLayout:z}=featureDefinitions[E];N&&(h=N),L(o)&&(!this.features[E]&&F&&(this.features[E]=new F(this)),z&&(p=z))}if((this.type==="html"||this.type==="svg")&&!this.projection&&h){this.projection=new h(this.latestValues,getClosestProjectingNode(this.parent));const{layoutId:y,layout:E,drag:L,dragConstraints:F,layoutScroll:N,layoutRoot:z}=o;this.projection.setOptions({layoutId:y,layout:E,alwaysMeasureLayout:!!L||F&&isRefObject(F),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof E=="string"?E:"both",initialPromotionConfig:d,layoutScroll:N,layoutRoot:z})}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(n||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:E,isPositionVisible:L}=useContext(),F=React.useRef(null);usePreRender(()=>{if(F.current==null)return;let z;try{const J=p==null?void 0:p([c.x,c.y,c.z]);z=new Cartesian2(J==null?void 0:J[0],J==null?void 0:J[1])}catch{h.set("none");return}const H=y==null?void 0:y();if(!H)return;const W=E==null?void 0:E(H==null?void 0:H.lng,H==null?void 0:H.lat,H==null?void 0:H.height);if(!W)return;if(occluder.cameraPosition=new Cartesian3(W[0],W[1],W[2]),z==null||z.x<0||z.y<0||z.x>window.innerWidth||z.y>window.innerHeight||!(L!=null&&L([c.x,c.y,c.z]))){h.set("none");return}const oe=`calc(${z.x}px - 50%)`,nt=`calc(${z.y}px - 50%)`;d.set(`translate(${oe}, ${nt})`),h.set("block")});const N=useMergeRefs([F,s]);return jsxRuntimeExports.jsx(motion.div,{ref:N,...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})=>{const c=useConstant$2(()=>new Cartesian3);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ScreenSpaceElement,{position:Cartesian3.midpoint(t,n,c),children:jsxRuntimeExports.jsx(MeasurementText,{children:o<1e3?`${o.toFixed(1)} m`:`${(o/1e3).toFixed(1)} km`})}),jsxRuntimeExports.jsx(MeasurementLine$1,{a:t,b:n,color:s})]})},cartesianScratch=new Cartesian3,ExtrudedControlPoints=React.memo(({geometryOptions:{controlPoints:t},extrudedHeight:n,color:o})=>{var p;const{viewer:s}=De$1(),c=t[t.length-1],d=(p=s==null?void 0:s.scene)==null?void 0:p.globe.ellipsoid.geodeticSurfaceNormal(c,cartesianScratch);invariant$1(d!==void 0);const h=Cartesian3.add(c,Cartesian3.multiplyByScalar(d,n,cartesianScratch),cartesianScratch);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(ControlPoint,{position:c,clampToGround:!0}),jsxRuntimeExports.jsx(ControlPoint,{position:h}),jsxRuntimeExports.jsx(ExtrudedMeasurement,{a:c,b:h,extrudedHeight:n,color:o})]})});ExtrudedControlPoints.displayName="ExtrudedControlPoints";const ExtrudedPolygonEntity=({dynamic:t=!1,id:n,hierarchy:o,extrudedHeight:s,color:c,disableShadow:d=!1,enableRelativeHeight:h=!1})=>{const p=React.useRef(o);p.current=o;const y=useConstant$2(()=>new CallbackProperty(()=>p.current,!1)),E=t?y:o,L=React.useRef(s);L.current=s;const F=useConstant$2(()=>new CallbackProperty(()=>L.current,!1)),N=t?F:s,z=React.useMemo(()=>({polygon:{hierarchy:E,extrudedHeight:N,extrudedHeightReference:HeightReference$1.RELATIVE_TO_GROUND,fill:!0,outline:!0,outlineWidth:1,outlineColor:c==null?void 0:c.withAlpha(1),material:new ColorMaterialProperty(c),classificationType:ClassificationType$1.TERRAIN,shadows:d?ShadowMode$1.DISABLED:ShadowMode$1.ENABLED,...h?{height:0,heightReference:HeightReference$1.RELATIVE_TO_GROUND}:void 0}}),[N,d,E,c,h]),{requestRender:H}=useContext();return H==null||H(),jsxRuntimeExports.jsx(Entity,{id:n,...z})},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})=>{const s=React.useRef(n);s.current=n;const c=useConstant$2(()=>new CallbackProperty(()=>s.current,!t)),d=t?c:n,h=React.useMemo(()=>({polyline:{positions:d,width:1.5,material:o,classificationType:ClassificationType$1.TERRAIN,clampToGround:!0}}),[o,d]),{requestRender:p}=useContext();return p==null||p(),jsxRuntimeExports.jsx(Entity,{...h})},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,cartesianScratch2=new Cartesian3,SurfaceControlPoints=React.memo(({geometryOptions:{type:t,controlPoints:n},color:o})=>{let s=[...n],c,d=!1;if(t==="rectangle"&&s.length===3){const[h,p,y]=s,E=Cartesian3.projectVector(Cartesian3.subtract(y,h,cartesianScratch1),Cartesian3.subtract(p,h,cartesianScratch2),cartesianScratch1),L=Cartesian3.subtract(y,Cartesian3.add(h,E,cartesianScratch1),cartesianScratch2),F=Cartesian3.midpoint(h,p,cartesianScratch1),N=Cartesian3.add(F,L,cartesianScratch2);s=[h,p,N],c=[F,N],d=!0}else t==="marker"?(c=void 0,s=[]):s.length>=2&&(c=s.slice(-2),d=t==="circle");return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[s.map((h,p)=>jsxRuntimeExports.jsx(ControlPoint,{position:h,clampToGround:!0},p)),c!=null&&jsxRuntimeExports.jsx(SurfaceMeasurement,{a:c[0],b:c[1],color:o,showLine:d})]})});SurfaceControlPoints.displayName="SurfaceControlPoints";const DEFAULT_SKETCH_COLOR="#00bebe",SketchComponent=React.memo(({geometry:t,geometryOptions:n,extrudedHeight:o,disableShadow:s,color:c,enableRelativeHeight:d})=>{const h=React.useMemo(()=>n?{...n,controlPoints:n==null?void 0:n.controlPoints.map(F=>new Cesium$1.Cartesian3(...F))}:null,[n]),p=React.useMemo(()=>t??(h?createGeometry(h):null),[t,h]),{positionsArray:y,hierarchyArray:E}=React.useMemo(()=>(p==null?void 0:p.type)==="Point"?{}:(p==null?void 0:p.type)==="LineString"?{positionsArray:convertGeometryToPositionsArray(p)}:p!=null?{positionsArray:convertGeometryToPositionsArray(p),hierarchyArray:convertPolygonToHierarchyArray(p)}:{},[p]),L=React.useMemo(()=>Color$1.fromCssColorString(c??DEFAULT_SKETCH_COLOR),[c]);return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[y==null?void 0:y.map((F,N)=>jsxRuntimeExports.jsx(PolylineEntity,{dynamic:!0,positions:F,color:L},N)),E==null?void 0:E.map((F,N)=>jsxRuntimeExports.jsx(PolygonEntity,{dynamic:!0,hierarchy:F,color:L},N)),h!=null&&o==null&&jsxRuntimeExports.jsx(SurfaceControlPoints,{geometryOptions:h,color:L}),h!=null&&o!=null&&jsxRuntimeExports.jsx(ExtrudedControlPoints,{geometryOptions:h,extrudedHeight:o,color:L}),o!=null&&(E==null?void 0:E.map((F,N)=>jsxRuntimeExports.jsx(ExtrudedPolygonEntity,{dynamic:!0,hierarchy:F,extrudedHeight:o,disableShadow:s,color:L,enableRelativeHeight:d},N)))]})});SketchComponent.displayName="SketchComponent";const Cesium=({className:t,style:n,property:o,time:s,camera:c,small:d,ready:h,children:p,selectedLayerId:y,isLayerDraggable:E,isLayerDragging:L,shouldRender:F,layerSelectionReason:N,meta:z,layersRef:H,featureFlags:W,requestingRenderMode:oe,timelineManagerRef:nt,cameraForceHorizontalRoll:J,onLayerSelect:lt,onCameraChange:yt,onLayerDrag:pi,onLayerDrop:Ai,onLayerEdit:Vd,onLayerSelectWithRectStart:Gd,onLayerSelectWithRectMove:md,onLayerSelectWithRectEnd:tf,onMount:nf,onLayerVisibility:ef,onLayerLoad:mt},Ee)=>{var Tf,Xd,gf,yf,hf,df,bf,Ef,wf,vf,Of,Gf,If,zf,Mf,Df,Em,Qf,qf,kf,Zf,Pm,jm,qm,ep,op,$m,Nf,Af,Yf,Kf,tp,Qm,wm,lp,up,pp,gp,fp,dp,mp,yp;const{cesium:sl,mouseEventHandles:Zd,cesiumIonAccessToken:rf,context:uf,layerSelectWithRectEventHandlers:lf,sceneLight:af,sceneBackgroundColor:of,sceneMsaaSamples:sf,sceneMode:mf,cameraViewBoundaries:ff,cameraViewOuterBoundaries:pf,cameraViewBoundariesMaterial:xf,handleCameraChange:Rf,handleCameraMoveEnd:Vf,handleUpdate:Lf,handleClick:Pf,handleMount:Uf,handleUnmount:Bf}=useHooks$1({ref:Ee,property:o,time:s,selectedLayerId:y,selectionReason:N,meta:z,layersRef:H,featureFlags:W,timelineManagerRef:nt,isLayerDraggable:E,isLayerDragging:L,shouldRender:F,requestingRenderMode:oe,camera:c,cameraForceHorizontalRoll:J,onLayerDrag:pi,onLayerDrop:Ai,onLayerSelect:lt,onLayerEdit:Vd,onLayerSelectWithRectStart:Gd,onLayerSelectWithRectMove:md,onLayerSelectWithRectEnd:tf,onLayerVisibility:ef,onLayerLoad:mt,onCameraChange:yt,onMount:nf});return jsxRuntimeExports.jsxs(Aa$1,{ref:sl,onUpdate:Lf,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,style:{width:d?"300px":"auto",height:d?"300px":"100%",display:h?void 0:"none",cursor:L?"grab":void 0,...n},shadows:!!((Xd=(Tf=o==null?void 0:o.scene)==null?void 0:Tf.shadow)!=null&&Xd.enabled),onClick:Pf,onDoubleClick:Zd.doubleClick,onMouseDown:Zd.mouseDown,onMouseUp:Zd.mouseUp,onRightClick:Zd.rightClick,onRightDown:Zd.rightDown,onRightUp:Zd.rightUp,onMiddleClick:Zd.middleClick,onMiddleDown:Zd.middleDown,onMiddleUp:Zd.middleUp,onMouseMove:Zd.mouseMove,onMouseEnter:Zd.mouseEnter,onMouseLeave:Zd.mouseLeave,onWheel:Zd.wheel,children:[jsxRuntimeExports.jsx(Event,{onMount:Uf,onUnmount:Bf}),jsxRuntimeExports.jsx(ReearthClock,{timelineManagerRef:nt}),jsxRuntimeExports.jsx(ImageryLayers,{tiles:o==null?void 0:o.tiles,cesiumIonAccessToken:rf}),jsxRuntimeExports.jsx(LabelImageryLayers,{tileLabels:o==null?void 0:o.tileLabels}),jsxRuntimeExports.jsx(Indicator,{property:o,timelineManagerRef:nt}),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:lf.start.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_DOWN,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:lf.start.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,action:lf.move.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.MOUSE_MOVE,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:lf.move.shift}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,action:lf.end.handler}),jsxRuntimeExports.jsx(Ma$1,{type:Cesium$1.ScreenSpaceEventType.LEFT_UP,modifier:Cesium$1.KeyboardEventModifier.SHIFT,action:lf.end.shift})]}),jsxRuntimeExports.jsx(Ta$1,{maximumZoomDistance:(yf=(gf=o==null?void 0:o.camera)==null?void 0:gf.limiter)!=null&&yf.enabled?((bf=(df=(hf=o.camera)==null?void 0:hf.limiter)==null?void 0:df.targetArea)==null?void 0:bf.height)??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY,enableCollisionDetection:!((Ef=o==null?void 0:o.camera)!=null&&Ef.allowEnterGround)}),jsxRuntimeExports.jsx(Ps$1,{percentageChanged:.2,onChange:Rf,onMoveEnd:Vf}),ff&&((vf=(wf=o==null?void 0:o.camera)==null?void 0:wf.limiter)==null?void 0:vf.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:ff,width:1,material:Cesium$1.Color.RED,arcType:Cesium$1.ArcType.RHUMB})}),pf&&((Gf=(Of=o==null?void 0:o.camera)==null?void 0:Of.limiter)==null?void 0:Gf.showHelper)&&jsxRuntimeExports.jsx(Is$1,{children:jsxRuntimeExports.jsx(ua$1,{positions:pf,width:1,material:xf,arcType:Cesium$1.ArcType.RHUMB})}),jsxRuntimeExports.jsx($a$1,{backgroundColor:of,light:af,mode:mf,msaaSamples:sf,useDepthPicking:!1,useWebVR:!!((If=o==null?void 0:o.scene)!=null&&If.vr)||void 0,debugShowFramesPerSecond:!!((zf=o==null?void 0:o.debug)!=null&&zf.showFramesPerSecond),verticalExaggerationRelativeHeight:(Mf=o==null?void 0:o.scene)==null?void 0:Mf.verticalExaggerationRelativeHeight,verticalExaggeration:(Df=o==null?void 0:o.scene)==null?void 0:Df.verticalExaggeration}),jsxRuntimeExports.jsx(Oa$1,{show:((Qf=(Em=o==null?void 0:o.sky)==null?void 0:Em.skyBox)==null?void 0:Qf.show)??!0}),jsxRuntimeExports.jsx(Vs$1,{enabled:((kf=(qf=o==null?void 0:o.sky)==null?void 0:qf.fog)==null?void 0:kf.enabled)??!0,density:(Pm=(Zf=o==null?void 0:o.sky)==null?void 0:Zf.fog)==null?void 0:Pm.density}),jsxRuntimeExports.jsx(Ga$1,{show:((qm=(jm=o==null?void 0:o.sky)==null?void 0:jm.sun)==null?void 0:qm.show)??!0}),jsxRuntimeExports.jsx(ea$1,{show:((op=(ep=o==null?void 0:o.sky)==null?void 0:ep.moon)==null?void 0:op.show)??!0}),jsxRuntimeExports.jsx(_a$2,{show:((Nf=($m=o==null?void 0:o.sky)==null?void 0:$m.skyAtmosphere)==null?void 0:Nf.show)??!0,atmosphereLightIntensity:(Yf=(Af=o==null?void 0:o.sky)==null?void 0:Af.skyAtmosphere)==null?void 0:Yf.lightIntensity,saturationShift:(tp=(Kf=o==null?void 0:o.sky)==null?void 0:Kf.skyAtmosphere)==null?void 0:tp.saturationShift,brightnessShift:(wm=(Qm=o==null?void 0:o.sky)==null?void 0:Qm.skyAtmosphere)==null?void 0:wm.brightnessShift}),jsxRuntimeExports.jsx(Globe,{property:o,cesiumIonAccessToken:rf}),jsxRuntimeExports.jsx(context.Provider,{value:uf,children:h?p:null}),jsxRuntimeExports.jsx(AmbientOcclusion,{...AMBIENT_OCCLUSION_QUALITY[((up=(lp=o==null?void 0:o.render)==null?void 0:lp.ambientOcclusion)==null?void 0:up.quality)||"low"],enabled:!!((gp=(pp=o==null?void 0:o.render)==null?void 0:pp.ambientOcclusion)!=null&&gp.enabled),intensity:((dp=(fp=o==null?void 0:o.render)==null?void 0:fp.ambientOcclusion)==null?void 0:dp.intensity)??100,outputType:(yp=(mp=o==null?void 0:o.render)==null?void 0:mp.ambientOcclusion)!=null&&yp.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.4",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 E,L;const[h]=d;let p,y;if(h.contentBoxSize){const F=Array.isArray(h.contentBoxSize)?h.contentBoxSize[0]:h.contentBoxSize;p=F.inlineSize,y=F.blockSize}else h.contentRect?(p=h.contentRect.width,y=h.contentRect.height):(p=(E=t.current)==null?void 0:E.clientWidth,y=(L=t.current)==null?void 0:L.clientHeight);s(F=>({width:p,height:y,isMobile:p?p<=viewportMobileMaxWidth:void 0,query:F.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:E},L){const F=React.useRef(null);React.useImperativeHandle(L,()=>F.current,[]);const N=React.useRef(null),z=useViewport({wrapperRef:N}),[H,W]=React.useState({}),[oe,nt]=React.useState(),[J,lt]=React.useState(),yt=React.useCallback(async(Mf,Df,Em,Qf,qf)=>{var Pm,jm,qm,ep,op,$m;if(H.layerId===Mf&&H.featureId===Df)return;const kf=await(Em==null?void 0:Em()),Zf=Mf&&Df?((qm=(Pm=F.current)==null?void 0:(jm=Pm.engine).findComputedFeatureById)==null?void 0:qm.call(jm,Mf,Df))??(qf==null?void 0:qf.feature):void 0;nt(Mf&&Df?($m=(ep=F.current)==null?void 0:(op=ep.engine).findFeatureById)==null?void 0:$m.call(op,Mf,Df):void 0),lt(Zf),W(Nf=>Nf.layerId===Mf&&Nf.featureId===Df?Nf:{layerId:Mf,featureId:Df,layer:kf,reason:Qf}),c==null||c(Mf,Em,Zf,Qf)},[H,c]),pi=React.useRef(),[Ai,Vd]=useValue(t,d),[Gd,md]=React.useState(!1),tf=React.useCallback(Mf=>{md(!!Mf)},[]),[nf,ef]=useValue(n,h),mt=nf||"default",[Ee,sl]=React.useState("auto");React.useEffect(()=>{sl(mt==="sketch"?"crosshair":mt==="move"?"grab":"auto")},[mt]);const Zd=INTERACTION_MODES[mt],rf=React.useRef(),uf=React.useCallback(Mf=>{rf.current=Mf},[]),lf=React.useCallback(Mf=>{var Df;(Df=rf.current)==null||Df.call(rf,Mf)},[]),af=React.useRef(),of=React.useCallback(Mf=>{af.current=Mf},[]),sf=React.useCallback(Mf=>{var Df;(Df=af.current)==null||Df.call(af,Mf)},[]),mf=React.useRef(),ff=React.useCallback(Mf=>{mf.current=Mf},[]),pf=React.useCallback(Mf=>{var Df;(Df=mf.current)==null||Df.call(mf,Mf)},[]),xf=React.useRef(),Rf=React.useCallback(Mf=>{xf.current=Mf},[]),Vf=React.useCallback(Mf=>{var Df;(Df=xf.current)==null||Df.call(xf,Mf)},[]),Lf=React.useRef(),Pf=React.useCallback(Mf=>{Lf.current=Mf},[]),Uf=React.useCallback(Mf=>{var Df;(Df=Lf.current)==null||Df.call(Lf,Mf)},[]),Bf=React.useRef(),Tf=React.useCallback(Mf=>{Bf.current=Mf},[]),Xd=React.useCallback(Mf=>{var Df;(Df=Bf.current)==null||Df.call(Bf,Mf)},[]),gf=React.useRef([]),yf=React.useCallback(Mf=>{gf.current.push(Mf)},[]),hf=React.useCallback(Mf=>{gf.current.forEach(Df=>Df(Mf))},[]),df=React.useRef([]),bf=React.useCallback(Mf=>{df.current.push(Mf)},[]),Ef=React.useCallback((Mf,Df)=>{df.current.forEach(Em=>Em(Mf)),E==null||E(Mf,Df)},[E]);React.useEffect(()=>{var Mf,Df;o&&((Df=(Mf=F.current)==null?void 0:Mf.engine)==null||Df.lookAtLayer(o),p==null||p(void 0))},[o,p]);const[wf,vf]=React.useState(!1),Of=React.useCallback(()=>{vf(!0)},[]),Gf=React.useCallback((Mf,Df,Em)=>{var kf;vf(!1);const Qf=(kf=F.current)==null?void 0:kf.layers.findById(Mf),qf=Qf!=null&&Qf.property.default.location?"default.location":Qf!=null&&Qf.property.default.position?"default.position":void 0;Em&&Qf&&Qf.propertyId&&qf&&(y==null||y(Qf.propertyId,qf,Em))},[y,F]),If=React.useMemo(()=>({interactionMode:mt,selectedLayer:H,selectedComputedFeature:J,viewport:z,handleCameraForceHorizontalRollChange:tf,handleInteractionModeChange:ef,onSketchPluginFeatureCreate:yf,onSketchTypeChange:bf,onLayerVisibility:of,onLayerLoad:ff,onLayerEdit:uf,onLayerSelectWithRectStart:Rf,onLayerSelectWithRectMove:Pf,onLayerSelectWithRectEnd:Tf}),[mt,H,J,z,ef,tf,uf,yf,bf,of,ff,Rf,Pf,Tf]),zf=React.useMemo(()=>({position:"relative",width:"100%",height:"100%",overflow:"hidden"}),[]);return useCoreAPI({viewerProperty:s}),{mapRef:F,wrapperRef:N,selectedFeature:oe,camera:Ai,featureFlags:Zd,isLayerDragging:wf,timelineManagerRef:pi,cursor:Ee,cameraForceHorizontalRoll:Gd,coreContextValue:If,containerStyle:zf,handleLayerSelect:yt,handleLayerDrag:Of,handleLayerDrop:Gf,handleLayerEdit:lf,handleCameraChange:Vd,handleInteractionModeChange:ef,handleSketchPluginFeatureCreate:hf,handleSketchTypeChange:Ef,handleLayerVisibility:sf,handleLayerLoad:pf,handleLayerSelectWithRectStart:Vf,handleLayerSelectWithRectMove:Uf,handleLayerSelectWithRectEnd:Xd}}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:E,time:L,interactionMode:F,shouldRender:N,meta:z,style:H,zoomedLayerId:W,children:oe,onLayerDrop:nt,onLayerSelect:J,onCameraChange:lt,onZoomToLayer:yt,onInteractionModeChange:pi,onMount:Ai,onSketchTypeChangeProp:Vd,onSketchFeatureCreate:Gd},md)=>{const{mapRef:tf,wrapperRef:nf,selectedFeature:ef,camera:mt,featureFlags:Ee,isLayerDragging:sl,timelineManagerRef:Zd,cursor:rf,cameraForceHorizontalRoll:uf,coreContextValue:lf,containerStyle:af,handleLayerSelect:of,handleLayerDrag:sf,handleLayerDrop:mf,handleLayerEdit:ff,handleCameraChange:pf,handleInteractionModeChange:xf,handleSketchPluginFeatureCreate:Rf,handleSketchTypeChange:Vf,handleLayerVisibility:Lf,handleLayerLoad:Pf,handleLayerSelectWithRectStart:Uf,handleLayerSelectWithRectMove:Bf,handleLayerSelectWithRectEnd:Tf}=useHooks({camera:E,interactionMode:F,zoomedLayerId:W,viewerProperty:s,onLayerSelect:J,onCameraChange:lt,onZoomToLayer:yt,onLayerDrop:nt,onInteractionModeChange:pi,onSketchTypeChangeProp:Vd},md);return jsxRuntimeExports.jsx(ErrorBoundary,{FallbackComponent:Error$1,children:jsxRuntimeExports.jsx(VisualizerProvider,{mapRef:tf,children:jsxRuntimeExports.jsxs("div",{ref:nf,style:af,children:[jsxRuntimeExports.jsx(Map$1,{ref:tf,isBuilt:n,isEditable:o,engine:t,layers:c,engines,camera:mt,cameraForceHorizontalRoll:uf,clusters:d,hiddenLayers:y,isLayerDragging:sl,isLayerDraggable:o,meta:z,style:H,featureFlags:Ee,shouldRender:N,property:s,time:L,small:h,ready:p,timelineManagerRef:Zd,interactionMode:F,selectedFeature:ef,cursor:rf,onCameraChange:pf,onLayerDrag:sf,onLayerDrop:mf,onLayerSelect:of,onLayerEdit:ff,overrideInteractionMode:xf,onSketchFeatureCreate:Gd,onSketchPluginFeatureCreate:Rf,onSketchTypeChange:Vf,onMount:Ai,onLayerVisibility:Lf,onLayerLoad:Pf,onLayerSelectWithRectStart:Uf,onLayerSelectWithRectMove:Bf,onLayerSelectWithRectEnd:Tf}),jsxRuntimeExports.jsx(coreContext.Provider,{value:lf,children:oe})]})})})}));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,E=y>>1,L=-7,F=o?c-1:0,N=o?-1:1,z=t[n+F];for(F+=N,d=z&(1<<-L)-1,z>>=-L,L+=p;L>0;d=d*256+t[n+F],F+=N,L-=8);for(h=d&(1<<-L)-1,d>>=-L,L+=s;L>0;h=h*256+t[n+F],F+=N,L-=8);if(d===0)d=1-E;else{if(d===y)return h?NaN:(z?-1:1)*(1/0);h=h+Math.pow(2,s),d=d-E}return(z?-1:1)*h*Math.pow(2,d-s)}function write(t,n,o,s,c,d){var h,p,y,E=d*8-c-1,L=(1<<E)-1,F=L>>1,N=c===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=s?0:d-1,H=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=L):(h=Math.floor(Math.log(n)/Math.LN2),n*(y=Math.pow(2,-h))<1&&(h--,y*=2),h+F>=1?n+=N/y:n+=N*Math.pow(2,1-F),n*y>=2&&(h++,y/=2),h+F>=L?(p=0,h=L):h+F>=1?(p=(n*y-1)*Math.pow(2,c),h=h+F):(p=n*Math.pow(2,F-1)*Math.pow(2,c),h=0));c>=8;t[o+z]=p&255,z+=H,p/=256,c-=8);for(h=h<<c|p,E+=c;E>0;t[o+z]=h&255,z+=H,h/=256,E-=8);t[o+z-H]|=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),E=this.slice(c,d),L=n.slice(o,s),F=0;F<y;++F)if(E[F]!==L[F]){h=E[F],p=L[F];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(z,H){return d===1?z[H]:z.readUInt16BE(H*d)}var E;if(c){var L=-1;for(E=o;E<h;E++)if(y(t,E)===y(n,L===-1?0:E-L)){if(L===-1&&(L=E),E-L+1===p)return L*d}else L!==-1&&(E-=E-L),L=-1}else for(o+p>h&&(o=h-p),E=o;E>=0;E--){for(var F=!0,N=0;N<p;N++)if(y(t,E+N)!==y(n,N)){F=!1;break}if(F)return E}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,E,L,F;switch(p){case 1:d<128&&(h=d);break;case 2:y=t[c+1],(y&192)===128&&(F=(d&31)<<6|y&63,F>127&&(h=F));break;case 3:y=t[c+1],E=t[c+2],(y&192)===128&&(E&192)===128&&(F=(d&15)<<12|(y&63)<<6|E&63,F>2047&&(F<55296||F>57343)&&(h=F));break;case 4:y=t[c+1],E=t[c+2],L=t[c+3],(y&192)===128&&(E&192)===128&&(L&192)===128&&(F=(d&15)<<18|(y&63)<<12|(E&63)<<6|L&63,F>65535&&F<1114112&&(h=F))}}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,E=n==="error";if(p=this._events,p)E=E&&p.error==null;else if(!E)return!1;if(y=this.domain,E){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 L=new Error('Uncaught, unspecified "error" event. ('+o+")");throw L.context=o,L}return!1}if(s=p[n],!s)return!1;var F=typeof s=="function";switch(c=arguments.length,c){case 1:emitNone(s,F,this);break;case 2:emitOne(s,F,this,arguments[1]);break;case 3:emitTwo(s,F,this,arguments[1],arguments[2]);break;case 4:emitThree(s,F,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,F,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="",E=!1,L=["{","}"];if(isArray(n)&&(E=!0,L=["[","]"]),isFunction(n)){var F=n.name?": "+n.name:"";y=" [Function"+F+"]"}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&&(!E||n.length==0))return L[0]+y+L[1];if(o<0)return isRegExp(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var N;return E?N=formatArray(t,n,o,h,d):N=d.map(function(z){return formatProperty(t,n,o,h,z,E)}),t.seen.pop(),reduceToSingleString(N,y,L)}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(`
|
|
6704
6704
|
`)>-1&&(d?p=p.split(`
|
|
6705
6705
|
`).map(function(E){return" "+E}).join(`
|
|
6706
6706
|
`).substr(2):p=`
|