diff --git a/build/assets/AddContentIcon-d2758ba1.js b/build/assets/AddContentIcon-8ff66903.js similarity index 97% rename from build/assets/AddContentIcon-d2758ba1.js rename to build/assets/AddContentIcon-8ff66903.js index 3ee3267c9..fc729046f 100644 --- a/build/assets/AddContentIcon-d2758ba1.js +++ b/build/assets/AddContentIcon-8ff66903.js @@ -1 +1 @@ -import{j as C}from"./index-0cb90706.js";const r=s=>C.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("mask",{id:"mask0_1259_25",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:C.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),C.jsx("g",{mask:"url(#mask0_1259_25)",children:C.jsx("path",{d:"M11.25 12.75V16C11.25 16.2125 11.3219 16.3906 11.4657 16.5343C11.6095 16.6781 11.7877 16.75 12.0003 16.75C12.2129 16.75 12.391 16.6781 12.5346 16.5343C12.6782 16.3906 12.75 16.2125 12.75 16V12.75H16C16.2125 12.75 16.3906 12.6781 16.5344 12.5343C16.6781 12.3904 16.75 12.2122 16.75 11.9997C16.75 11.7871 16.6781 11.609 16.5344 11.4654C16.3906 11.3218 16.2125 11.25 16 11.25H12.75V7.99998C12.75 7.78748 12.6781 7.60935 12.5343 7.4656C12.3905 7.32187 12.2123 7.25 11.9997 7.25C11.7871 7.25 11.609 7.32187 11.4654 7.4656C11.3218 7.60935 11.25 7.78748 11.25 7.99998V11.25H8.00001C7.78751 11.25 7.60939 11.3219 7.46566 11.4657C7.32191 11.6095 7.25003 11.7877 7.25003 12.0003C7.25003 12.2129 7.32191 12.391 7.46566 12.5346C7.60939 12.6782 7.78751 12.75 8.00001 12.75H11.25ZM12.0017 21.5C10.6877 21.5 9.45271 21.2506 8.29658 20.752C7.14043 20.2533 6.13475 19.5765 5.27953 18.7217C4.4243 17.8669 3.74724 16.8616 3.24836 15.706C2.74947 14.5504 2.50003 13.3156 2.50003 12.0017C2.50003 10.6877 2.74936 9.45268 3.24803 8.29655C3.7467 7.1404 4.42345 6.13472 5.27828 5.2795C6.13313 4.42427 7.13837 3.74721 8.29401 3.24833C9.44962 2.74944 10.6844 2.5 11.9983 2.5C13.3123 2.5 14.5473 2.74933 15.7034 3.248C16.8596 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.1331 20.2528 7.13834 20.7517 8.29398C21.2505 9.44959 21.5 10.6844 21.5 11.9983C21.5 13.3122 21.2506 14.5473 20.752 15.7034C20.2533 16.8596 19.5766 17.8652 18.7217 18.7205C17.8669 19.5757 16.8616 20.2527 15.706 20.7516C14.5504 21.2505 13.3156 21.5 12.0017 21.5ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76664 19.225 7.87498 17.675 6.32498C16.125 4.77498 14.2333 3.99998 12 3.99998C9.76667 3.99998 7.87501 4.77498 6.32501 6.32498C4.77501 7.87498 4.00001 9.76664 4.00001 12C4.00001 14.2333 4.77501 16.125 6.32501 17.675C7.87501 19.225 9.76667 20 12 20Z",fill:"currentColor"})})]});export{r as A}; +import{j as C}from"./index-ead79979.js";const r=s=>C.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[C.jsx("mask",{id:"mask0_1259_25",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:C.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),C.jsx("g",{mask:"url(#mask0_1259_25)",children:C.jsx("path",{d:"M11.25 12.75V16C11.25 16.2125 11.3219 16.3906 11.4657 16.5343C11.6095 16.6781 11.7877 16.75 12.0003 16.75C12.2129 16.75 12.391 16.6781 12.5346 16.5343C12.6782 16.3906 12.75 16.2125 12.75 16V12.75H16C16.2125 12.75 16.3906 12.6781 16.5344 12.5343C16.6781 12.3904 16.75 12.2122 16.75 11.9997C16.75 11.7871 16.6781 11.609 16.5344 11.4654C16.3906 11.3218 16.2125 11.25 16 11.25H12.75V7.99998C12.75 7.78748 12.6781 7.60935 12.5343 7.4656C12.3905 7.32187 12.2123 7.25 11.9997 7.25C11.7871 7.25 11.609 7.32187 11.4654 7.4656C11.3218 7.60935 11.25 7.78748 11.25 7.99998V11.25H8.00001C7.78751 11.25 7.60939 11.3219 7.46566 11.4657C7.32191 11.6095 7.25003 11.7877 7.25003 12.0003C7.25003 12.2129 7.32191 12.391 7.46566 12.5346C7.60939 12.6782 7.78751 12.75 8.00001 12.75H11.25ZM12.0017 21.5C10.6877 21.5 9.45271 21.2506 8.29658 20.752C7.14043 20.2533 6.13475 19.5765 5.27953 18.7217C4.4243 17.8669 3.74724 16.8616 3.24836 15.706C2.74947 14.5504 2.50003 13.3156 2.50003 12.0017C2.50003 10.6877 2.74936 9.45268 3.24803 8.29655C3.7467 7.1404 4.42345 6.13472 5.27828 5.2795C6.13313 4.42427 7.13837 3.74721 8.29401 3.24833C9.44962 2.74944 10.6844 2.5 11.9983 2.5C13.3123 2.5 14.5473 2.74933 15.7034 3.248C16.8596 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.1331 20.2528 7.13834 20.7517 8.29398C21.2505 9.44959 21.5 10.6844 21.5 11.9983C21.5 13.3122 21.2506 14.5473 20.752 15.7034C20.2533 16.8596 19.5766 17.8652 18.7217 18.7205C17.8669 19.5757 16.8616 20.2527 15.706 20.7516C14.5504 21.2505 13.3156 21.5 12.0017 21.5ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76664 19.225 7.87498 17.675 6.32498C16.125 4.77498 14.2333 3.99998 12 3.99998C9.76667 3.99998 7.87501 4.77498 6.32501 6.32498C4.77501 7.87498 4.00001 9.76664 4.00001 12C4.00001 14.2333 4.77501 16.125 6.32501 17.675C7.87501 19.225 9.76667 20 12 20Z",fill:"currentColor"})})]});export{r as A}; diff --git a/build/assets/DailyMotion-5a12792b.js b/build/assets/DailyMotion-4594d2ab.js similarity index 95% rename from build/assets/DailyMotion-5a12792b.js rename to build/assets/DailyMotion-4594d2ab.js index 0d560110f..f8ae8a79a 100644 --- a/build/assets/DailyMotion-5a12792b.js +++ b/build/assets/DailyMotion-4594d2ab.js @@ -1 +1 @@ -import{L as P,r as v}from"./index-0cb90706.js";import{u as D,p as O}from"./index-cf45412f.js";function b(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,s=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,j=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,E=(t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of S(e))!T.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(o=w(e,a))||o.enumerable});return t},A=(t,e,r)=>(r=t!=null?M(j(t)):{},h(e||!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t)),C=t=>h(s({},"__esModule",{value:!0}),t),n=(t,e,r)=>(E(t,typeof e!="symbol"?e+"":e,r),r),d={};L(d,{default:()=>p});var _=C(d),c=A(v),l=D,f=O;const x="https://api.dmcdn.net/all.js",N="DM",K="dmAsyncInit";class p extends c.Component{constructor(){super(...arguments),n(this,"callPlayer",l.callPlayer),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:r,config:o,onError:a,playing:i}=this.props,[,y]=e.match(f.MATCH_URL_DAILYMOTION);if(this.player){this.player.load(y,{start:(0,l.parseStartTime)(e),autoplay:i});return}(0,l.getSDK)(x,N,K,u=>u.player).then(u=>{if(!this.container)return;const m=u.player;this.player=new m(this.container,{width:"100%",height:"100%",video:y,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:(0,l.parseStartTime)(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:g=>a(g)}})},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}n(p,"displayName","DailyMotion");n(p,"canPlay",f.canPlay.dailymotion);n(p,"loopOnEnded",!0);const R=P(_),k=b({__proto__:null,default:R},[_]);export{k as D}; +import{L as P,r as v}from"./index-ead79979.js";import{u as D,p as O}from"./index-b0542bac.js";function b(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,s=Object.defineProperty,w=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,j=Object.getPrototypeOf,T=Object.prototype.hasOwnProperty,E=(t,e,r)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of S(e))!T.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(o=w(e,a))||o.enumerable});return t},A=(t,e,r)=>(r=t!=null?M(j(t)):{},h(e||!t||!t.__esModule?s(r,"default",{value:t,enumerable:!0}):r,t)),C=t=>h(s({},"__esModule",{value:!0}),t),n=(t,e,r)=>(E(t,typeof e!="symbol"?e+"":e,r),r),d={};L(d,{default:()=>p});var _=C(d),c=A(v),l=D,f=O;const x="https://api.dmcdn.net/all.js",N="DM",K="dmAsyncInit";class p extends c.Component{constructor(){super(...arguments),n(this,"callPlayer",l.callPlayer),n(this,"onDurationChange",()=>{const e=this.getDuration();this.props.onDuration(e)}),n(this,"mute",()=>{this.callPlayer("setMuted",!0)}),n(this,"unmute",()=>{this.callPlayer("setMuted",!1)}),n(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{controls:r,config:o,onError:a,playing:i}=this.props,[,y]=e.match(f.MATCH_URL_DAILYMOTION);if(this.player){this.player.load(y,{start:(0,l.parseStartTime)(e),autoplay:i});return}(0,l.getSDK)(x,N,K,u=>u.player).then(u=>{if(!this.container)return;const m=u.player;this.player=new m(this.container,{width:"100%",height:"100%",video:y,params:{controls:r,autoplay:this.props.playing,mute:this.props.muted,start:(0,l.parseStartTime)(e),origin:window.location.origin,...o.params},events:{apiready:this.props.onReady,seeked:()=>this.props.onSeek(this.player.currentTime),video_end:this.props.onEnded,durationchange:this.onDurationChange,pause:this.props.onPause,playing:this.props.onPlay,waiting:this.props.onBuffer,error:g=>a(g)}})},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.player.duration||null}getCurrentTime(){return this.player.currentTime}getSecondsLoaded(){return this.player.bufferedTime}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}n(p,"displayName","DailyMotion");n(p,"canPlay",f.canPlay.dailymotion);n(p,"loopOnEnded",!0);const R=P(_),k=b({__proto__:null,default:R},[_]);export{k as D}; diff --git a/build/assets/Facebook-dc95d236.js b/build/assets/Facebook-9feea0b9.js similarity index 96% rename from build/assets/Facebook-dc95d236.js rename to build/assets/Facebook-9feea0b9.js index 800e8e70a..29bd54160 100644 --- a/build/assets/Facebook-dc95d236.js +++ b/build/assets/Facebook-9feea0b9.js @@ -1 +1 @@ -import{L as _,r as P}from"./index-0cb90706.js";import{u as g,p as m}from"./index-cf45412f.js";function v(t,e){for(var r=0;ra[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var O=Object.create,i=Object.defineProperty,D=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,I=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!j.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(a=D(e,s))||a.enumerable});return t},w=(t,e,r)=>(r=t!=null?O(S(t)):{},h(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),F=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(I(t,typeof e!="symbol"?e+"":e,r),r),b={};k(b,{default:()=>l});var d=F(b),u=w(P),n=g,L=m;const c="https://connect.facebook.net/en_US/sdk.js",f="FB",y="fbAsyncInit",x="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${x}${(0,n.randomString)()}`),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){(0,n.getSDK)(c,f,y).then(a=>a.XFBML.parse());return}(0,n.getSDK)(c,f,y).then(a=>{a.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),a.Event.subscribe("xfbml.render",s=>{this.props.onLoaded()}),a.Event.subscribe("xfbml.ready",s=>{s.type==="video"&&s.id===this.playerID&&(this.player=s.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config,r={width:"100%",height:"100%"};return u.default.createElement("div",{style:r,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}o(l,"displayName","Facebook");o(l,"canPlay",L.canPlay.facebook);o(l,"loopOnEnded",!0);const M=_(d),N=v({__proto__:null,default:M},[d]);export{N as F}; +import{L as _,r as P}from"./index-ead79979.js";import{u as g,p as m}from"./index-b0542bac.js";function v(t,e){for(var r=0;ra[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var O=Object.create,i=Object.defineProperty,D=Object.getOwnPropertyDescriptor,E=Object.getOwnPropertyNames,S=Object.getPrototypeOf,j=Object.prototype.hasOwnProperty,I=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,k=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of E(e))!j.call(t,s)&&s!==r&&i(t,s,{get:()=>e[s],enumerable:!(a=D(e,s))||a.enumerable});return t},w=(t,e,r)=>(r=t!=null?O(S(t)):{},h(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),F=t=>h(i({},"__esModule",{value:!0}),t),o=(t,e,r)=>(I(t,typeof e!="symbol"?e+"":e,r),r),b={};k(b,{default:()=>l});var d=F(b),u=w(P),n=g,L=m;const c="https://connect.facebook.net/en_US/sdk.js",f="FB",y="fbAsyncInit",x="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${x}${(0,n.randomString)()}`),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){if(r){(0,n.getSDK)(c,f,y).then(a=>a.XFBML.parse());return}(0,n.getSDK)(c,f,y).then(a=>{a.init({appId:this.props.config.appId,xfbml:!0,version:this.props.config.version}),a.Event.subscribe("xfbml.render",s=>{this.props.onLoaded()}),a.Event.subscribe("xfbml.ready",s=>{s.type==="video"&&s.id===this.playerID&&(this.player=s.instance,this.player.subscribe("startedPlaying",this.props.onPlay),this.player.subscribe("paused",this.props.onPause),this.player.subscribe("finishedPlaying",this.props.onEnded),this.player.subscribe("startedBuffering",this.props.onBuffer),this.player.subscribe("finishedBuffering",this.props.onBufferEnd),this.player.subscribe("error",this.props.onError),this.props.muted?this.callPlayer("mute"):this.callPlayer("unmute"),this.props.onReady(),document.getElementById(this.playerID).querySelector("iframe").style.visibility="visible")})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentPosition")}getSecondsLoaded(){return null}render(){const{attributes:e}=this.props.config,r={width:"100%",height:"100%"};return u.default.createElement("div",{style:r,id:this.playerID,className:"fb-video","data-href":this.props.url,"data-autoplay":this.props.playing?"true":"false","data-allowfullscreen":"true","data-controls":this.props.controls?"true":"false",...e})}}o(l,"displayName","Facebook");o(l,"canPlay",L.canPlay.facebook);o(l,"loopOnEnded",!0);const M=_(d),N=v({__proto__:null,default:M},[d]);export{N as F}; diff --git a/build/assets/FilePlayer-ec53d639.js b/build/assets/FilePlayer-e8e2f43e.js similarity index 98% rename from build/assets/FilePlayer-ec53d639.js rename to build/assets/FilePlayer-e8e2f43e.js index 7d8959b15..6bb4de95a 100644 --- a/build/assets/FilePlayer-ec53d639.js +++ b/build/assets/FilePlayer-e8e2f43e.js @@ -1 +1 @@ -import{L as b,r as _}from"./index-0cb90706.js";import{u as O,p as A}from"./index-cf45412f.js";function R(s,e){for(var t=0;ti[n]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var I=Object.create,u=Object.defineProperty,D=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,M=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,U=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e)u(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!k.call(s,n)&&n!==t&&u(s,n,{get:()=>e[n],enumerable:!(i=D(e,n))||i.enumerable});return s},j=(s,e,t)=>(t=s!=null?I(M(s)):{},E(e||!s||!s.__esModule?u(t,"default",{value:s,enumerable:!0}):t,s)),H=s=>E(u({},"__esModule",{value:!0}),s),r=(s,e,t)=>(U(s,typeof e!="symbol"?e+"":e,t),t),m={};N(m,{default:()=>P});var g=H(m),c=j(_),a=O,d=A;const y=typeof navigator<"u",F=y&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,v=y&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||F)&&!window.MSStream,V=y&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,T="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",C="Hls",B="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",x="dashjs",K="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",G="flvjs",X=/www\.dropbox\.com\/.+/,f=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,W="https://videodelivery.net/{id}/manifest/video.m3u8";class P extends c.Component{constructor(){super(...arguments),r(this,"onReady",(...e)=>this.props.onReady(...e)),r(this,"onPlay",(...e)=>this.props.onPlay(...e)),r(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),r(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),r(this,"onPause",(...e)=>this.props.onPause(...e)),r(this,"onEnded",(...e)=>this.props.onEnded(...e)),r(this,"onError",(...e)=>this.props.onError(...e)),r(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),r(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),r(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:i}=this.props;t(e),i&&this.play()}),r(this,"onPresentationModeChange",e=>{if(this.player&&(0,a.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;t==="picture-in-picture"?this.onEnablePIP(e):t==="inline"&&this.onDisablePIP(e)}}),r(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),r(this,"mute",()=>{this.player.muted=!0}),r(this,"unmute",()=>{this.player.muted=!1}),r(this,"renderSourceElement",(e,t)=>typeof e=="string"?c.default.createElement("source",{key:t,src:e}):c.default.createElement("source",{key:t,...e})),r(this,"renderTrack",(e,t)=>c.default.createElement("track",{key:t,...e})),r(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(v||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!(0,a.isMediaStream)(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:i}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),i&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:d.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return V&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:v||this.props.config.forceDisableHls?!1:d.HLS_EXTENSIONS.test(e)||f.test(e)}shouldUseDASH(e){return d.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return d.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:i,dashVersion:n,flvVersion:l}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,a.getSDK)(T.replace("VERSION",t),C).then(o=>{if(this.hls=new o(i),this.hls.on(o.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.hls,o)}),f.test(e)){const h=e.match(f)[1];this.hls.loadSource(W.replace("{id}",h))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,a.getSDK)(B.replace("VERSION",n),x).then(o=>{this.dash=o.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(n)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:o.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,a.getSDK)(K.replace("VERSION",l),G).then(o=>{this.flv=o.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.flv,o)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,a.isMediaStream)(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getSource(e){const t=this.shouldUseHLS(e),i=this.shouldUseDASH(e),n=this.shouldUseFLV(e);if(!(e instanceof Array||(0,a.isMediaStream)(e)||t||i||n))return X.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:i,controls:n,muted:l,config:o,width:h,height:p}=this.props,L=this.shouldUseAudio(this.props)?"audio":"video",S={width:h==="auto"?h:"100%",height:p==="auto"?p:"100%"};return c.default.createElement(L,{ref:this.ref,src:this.getSource(e),style:S,preload:"auto",autoPlay:t||void 0,controls:n,muted:l,loop:i,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}r(P,"displayName","FilePlayer");r(P,"canPlay",d.canPlay.file);const z=b(g),Q=R({__proto__:null,default:z},[g]);export{Q as F}; +import{L as b,r as _}from"./index-ead79979.js";import{u as O,p as A}from"./index-b0542bac.js";function R(s,e){for(var t=0;ti[n]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}var I=Object.create,u=Object.defineProperty,D=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,M=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty,U=(s,e,t)=>e in s?u(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,N=(s,e)=>{for(var t in e)u(s,t,{get:e[t],enumerable:!0})},E=(s,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of w(e))!k.call(s,n)&&n!==t&&u(s,n,{get:()=>e[n],enumerable:!(i=D(e,n))||i.enumerable});return s},j=(s,e,t)=>(t=s!=null?I(M(s)):{},E(e||!s||!s.__esModule?u(t,"default",{value:s,enumerable:!0}):t,s)),H=s=>E(u({},"__esModule",{value:!0}),s),r=(s,e,t)=>(U(s,typeof e!="symbol"?e+"":e,t),t),m={};N(m,{default:()=>P});var g=H(m),c=j(_),a=O,d=A;const y=typeof navigator<"u",F=y&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,v=y&&(/iPad|iPhone|iPod/.test(navigator.userAgent)||F)&&!window.MSStream,V=y&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&!window.MSStream,T="https://cdn.jsdelivr.net/npm/hls.js@VERSION/dist/hls.min.js",C="Hls",B="https://cdnjs.cloudflare.com/ajax/libs/dashjs/VERSION/dash.all.min.js",x="dashjs",K="https://cdn.jsdelivr.net/npm/flv.js@VERSION/dist/flv.min.js",G="flvjs",X=/www\.dropbox\.com\/.+/,f=/https:\/\/watch\.cloudflarestream\.com\/([a-z0-9]+)/,W="https://videodelivery.net/{id}/manifest/video.m3u8";class P extends c.Component{constructor(){super(...arguments),r(this,"onReady",(...e)=>this.props.onReady(...e)),r(this,"onPlay",(...e)=>this.props.onPlay(...e)),r(this,"onBuffer",(...e)=>this.props.onBuffer(...e)),r(this,"onBufferEnd",(...e)=>this.props.onBufferEnd(...e)),r(this,"onPause",(...e)=>this.props.onPause(...e)),r(this,"onEnded",(...e)=>this.props.onEnded(...e)),r(this,"onError",(...e)=>this.props.onError(...e)),r(this,"onPlayBackRateChange",e=>this.props.onPlaybackRateChange(e.target.playbackRate)),r(this,"onEnablePIP",(...e)=>this.props.onEnablePIP(...e)),r(this,"onDisablePIP",e=>{const{onDisablePIP:t,playing:i}=this.props;t(e),i&&this.play()}),r(this,"onPresentationModeChange",e=>{if(this.player&&(0,a.supportsWebKitPresentationMode)(this.player)){const{webkitPresentationMode:t}=this.player;t==="picture-in-picture"?this.onEnablePIP(e):t==="inline"&&this.onDisablePIP(e)}}),r(this,"onSeek",e=>{this.props.onSeek(e.target.currentTime)}),r(this,"mute",()=>{this.player.muted=!0}),r(this,"unmute",()=>{this.player.muted=!1}),r(this,"renderSourceElement",(e,t)=>typeof e=="string"?c.default.createElement("source",{key:t,src:e}):c.default.createElement("source",{key:t,...e})),r(this,"renderTrack",(e,t)=>c.default.createElement("track",{key:t,...e})),r(this,"ref",e=>{this.player&&(this.prevPlayer=this.player),this.player=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this),this.addListeners(this.player);const e=this.getSource(this.props.url);e&&(this.player.src=e),(v||this.props.config.forceDisableHls)&&this.player.load()}componentDidUpdate(e){this.shouldUseAudio(this.props)!==this.shouldUseAudio(e)&&(this.removeListeners(this.prevPlayer,e.url),this.addListeners(this.player)),this.props.url!==e.url&&!(0,a.isMediaStream)(this.props.url)&&!(this.props.url instanceof Array)&&(this.player.srcObject=null)}componentWillUnmount(){this.player.removeAttribute("src"),this.removeListeners(this.player),this.hls&&this.hls.destroy()}addListeners(e){const{url:t,playsinline:i}=this.props;e.addEventListener("play",this.onPlay),e.addEventListener("waiting",this.onBuffer),e.addEventListener("playing",this.onBufferEnd),e.addEventListener("pause",this.onPause),e.addEventListener("seeked",this.onSeek),e.addEventListener("ended",this.onEnded),e.addEventListener("error",this.onError),e.addEventListener("ratechange",this.onPlayBackRateChange),e.addEventListener("enterpictureinpicture",this.onEnablePIP),e.addEventListener("leavepictureinpicture",this.onDisablePIP),e.addEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.addEventListener("canplay",this.onReady),i&&(e.setAttribute("playsinline",""),e.setAttribute("webkit-playsinline",""),e.setAttribute("x5-playsinline",""))}removeListeners(e,t){e.removeEventListener("canplay",this.onReady),e.removeEventListener("play",this.onPlay),e.removeEventListener("waiting",this.onBuffer),e.removeEventListener("playing",this.onBufferEnd),e.removeEventListener("pause",this.onPause),e.removeEventListener("seeked",this.onSeek),e.removeEventListener("ended",this.onEnded),e.removeEventListener("error",this.onError),e.removeEventListener("ratechange",this.onPlayBackRateChange),e.removeEventListener("enterpictureinpicture",this.onEnablePIP),e.removeEventListener("leavepictureinpicture",this.onDisablePIP),e.removeEventListener("webkitpresentationmodechanged",this.onPresentationModeChange),this.shouldUseHLS(t)||e.removeEventListener("canplay",this.onReady)}shouldUseAudio(e){return e.config.forceVideo||e.config.attributes.poster?!1:d.AUDIO_EXTENSIONS.test(e.url)||e.config.forceAudio}shouldUseHLS(e){return V&&this.props.config.forceSafariHLS||this.props.config.forceHLS?!0:v||this.props.config.forceDisableHls?!1:d.HLS_EXTENSIONS.test(e)||f.test(e)}shouldUseDASH(e){return d.DASH_EXTENSIONS.test(e)||this.props.config.forceDASH}shouldUseFLV(e){return d.FLV_EXTENSIONS.test(e)||this.props.config.forceFLV}load(e){const{hlsVersion:t,hlsOptions:i,dashVersion:n,flvVersion:l}=this.props.config;if(this.hls&&this.hls.destroy(),this.dash&&this.dash.reset(),this.shouldUseHLS(e)&&(0,a.getSDK)(T.replace("VERSION",t),C).then(o=>{if(this.hls=new o(i),this.hls.on(o.Events.MANIFEST_PARSED,()=>{this.props.onReady()}),this.hls.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.hls,o)}),f.test(e)){const h=e.match(f)[1];this.hls.loadSource(W.replace("{id}",h))}else this.hls.loadSource(e);this.hls.attachMedia(this.player),this.props.onLoaded()}),this.shouldUseDASH(e)&&(0,a.getSDK)(B.replace("VERSION",n),x).then(o=>{this.dash=o.MediaPlayer().create(),this.dash.initialize(this.player,e,this.props.playing),this.dash.on("error",this.props.onError),parseInt(n)<3?this.dash.getDebug().setLogToBrowserConsole(!1):this.dash.updateSettings({debug:{logLevel:o.Debug.LOG_LEVEL_NONE}}),this.props.onLoaded()}),this.shouldUseFLV(e)&&(0,a.getSDK)(K.replace("VERSION",l),G).then(o=>{this.flv=o.createPlayer({type:"flv",url:e}),this.flv.attachMediaElement(this.player),this.flv.on(o.Events.ERROR,(h,p)=>{this.props.onError(h,p,this.flv,o)}),this.flv.load(),this.props.onLoaded()}),e instanceof Array)this.player.load();else if((0,a.isMediaStream)(e))try{this.player.srcObject=e}catch{this.player.src=window.URL.createObjectURL(e)}}play(){const e=this.player.play();e&&e.catch(this.props.onError)}pause(){this.player.pause()}stop(){this.player.removeAttribute("src"),this.dash&&this.dash.reset()}seekTo(e,t=!0){this.player.currentTime=e,t||this.pause()}setVolume(e){this.player.volume=e}enablePIP(){this.player.requestPictureInPicture&&document.pictureInPictureElement!==this.player?this.player.requestPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="picture-in-picture"&&this.player.webkitSetPresentationMode("picture-in-picture")}disablePIP(){document.exitPictureInPicture&&document.pictureInPictureElement===this.player?document.exitPictureInPicture():(0,a.supportsWebKitPresentationMode)(this.player)&&this.player.webkitPresentationMode!=="inline"&&this.player.webkitSetPresentationMode("inline")}setPlaybackRate(e){try{this.player.playbackRate=e}catch(t){this.props.onError(t)}}getDuration(){if(!this.player)return null;const{duration:e,seekable:t}=this.player;return e===1/0&&t.length>0?t.end(t.length-1):e}getCurrentTime(){return this.player?this.player.currentTime:null}getSecondsLoaded(){if(!this.player)return null;const{buffered:e}=this.player;if(e.length===0)return 0;const t=e.end(e.length-1),i=this.getDuration();return t>i?i:t}getSource(e){const t=this.shouldUseHLS(e),i=this.shouldUseDASH(e),n=this.shouldUseFLV(e);if(!(e instanceof Array||(0,a.isMediaStream)(e)||t||i||n))return X.test(e)?e.replace("www.dropbox.com","dl.dropboxusercontent.com"):e}render(){const{url:e,playing:t,loop:i,controls:n,muted:l,config:o,width:h,height:p}=this.props,L=this.shouldUseAudio(this.props)?"audio":"video",S={width:h==="auto"?h:"100%",height:p==="auto"?p:"100%"};return c.default.createElement(L,{ref:this.ref,src:this.getSource(e),style:S,preload:"auto",autoPlay:t||void 0,controls:n,muted:l,loop:i,...o.attributes},e instanceof Array&&e.map(this.renderSourceElement),o.tracks.map(this.renderTrack))}}r(P,"displayName","FilePlayer");r(P,"canPlay",d.canPlay.file);const z=b(g),Q=R({__proto__:null,default:z},[g]);export{Q as F}; diff --git a/build/assets/Kaltura-fe5cbead.js b/build/assets/Kaltura-cb2185ba.js similarity index 95% rename from build/assets/Kaltura-fe5cbead.js rename to build/assets/Kaltura-cb2185ba.js index 651f7fc0a..67f0a5d94 100644 --- a/build/assets/Kaltura-fe5cbead.js +++ b/build/assets/Kaltura-cb2185ba.js @@ -1 +1 @@ -import{L as y,r as f}from"./index-0cb90706.js";import{u as _,p as m}from"./index-cf45412f.js";function P(r,e){for(var t=0;to[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?n(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,L=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},c=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!w.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(o=b(e,a))||o.enumerable});return r},K=(r,e,t)=>(t=r!=null?g(O(r)):{},c(e||!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>c(n({},"__esModule",{value:!0}),r),s=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),h={};L(h,{default:()=>i});var d=D(h),u=K(f),p=_,S=m;const T="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs";class i extends u.Component{constructor(){super(...arguments),s(this,"callPlayer",p.callPlayer),s(this,"duration",null),s(this,"currentTime",null),s(this,"secondsLoaded",null),s(this,"mute",()=>{this.callPlayer("mute")}),s(this,"unmute",()=>{this.callPlayer("unmute")}),s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(T,E).then(t=>{this.iframe&&(this.player=new t.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:o,seconds:a})=>{this.duration=o,this.currentTime=a})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}s(i,"displayName","Kaltura");s(i,"canPlay",S.canPlay.kaltura);const M=y(d),N=P({__proto__:null,default:M},[d]);export{N as K}; +import{L as y,r as f}from"./index-ead79979.js";import{u as _,p as m}from"./index-b0542bac.js";function P(r,e){for(var t=0;to[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?n(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,L=(r,e)=>{for(var t in e)n(r,t,{get:e[t],enumerable:!0})},c=(r,e,t,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of v(e))!w.call(r,a)&&a!==t&&n(r,a,{get:()=>e[a],enumerable:!(o=b(e,a))||o.enumerable});return r},K=(r,e,t)=>(t=r!=null?g(O(r)):{},c(e||!r||!r.__esModule?n(t,"default",{value:r,enumerable:!0}):t,r)),D=r=>c(n({},"__esModule",{value:!0}),r),s=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),h={};L(h,{default:()=>i});var d=D(h),u=K(f),p=_,S=m;const T="https://cdn.embed.ly/player-0.1.0.min.js",E="playerjs";class i extends u.Component{constructor(){super(...arguments),s(this,"callPlayer",p.callPlayer),s(this,"duration",null),s(this,"currentTime",null),s(this,"secondsLoaded",null),s(this,"mute",()=>{this.callPlayer("mute")}),s(this,"unmute",()=>{this.callPlayer("unmute")}),s(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(T,E).then(t=>{this.iframe&&(this.player=new t.Player(this.iframe),this.player.on("ready",()=>{setTimeout(()=>{this.player.isReady=!0,this.player.setLoop(this.props.loop),this.props.muted&&this.player.mute(),this.addListeners(this.player,this.props),this.props.onReady()},500)}))},this.props.onError)}addListeners(e,t){e.on("play",t.onPlay),e.on("pause",t.onPause),e.on("ended",t.onEnded),e.on("error",t.onError),e.on("timeupdate",({duration:o,seconds:a})=>{this.duration=o,this.currentTime=a})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,t=!0){this.callPlayer("setCurrentTime",e),t||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e={width:"100%",height:"100%"};return u.default.createElement("iframe",{ref:this.ref,src:this.props.url,frameBorder:"0",scrolling:"no",style:e,allow:"encrypted-media; autoplay; fullscreen;",referrerPolicy:"no-referrer-when-downgrade"})}}s(i,"displayName","Kaltura");s(i,"canPlay",S.canPlay.kaltura);const M=y(d),N=P({__proto__:null,default:M},[d]);export{N as K}; diff --git a/build/assets/Mixcloud-c4cbc003.js b/build/assets/Mixcloud-a525a3b3.js similarity index 95% rename from build/assets/Mixcloud-c4cbc003.js rename to build/assets/Mixcloud-a525a3b3.js index c72902dd9..5c04ec7d8 100644 --- a/build/assets/Mixcloud-c4cbc003.js +++ b/build/assets/Mixcloud-a525a3b3.js @@ -1 +1 @@ -import{L as _,r as f}from"./index-0cb90706.js";import{u as m,p as g}from"./index-cf45412f.js";function v(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,i=Object.defineProperty,O=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,M=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,x=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!w.call(t,o)&&o!==r&&i(t,o,{get:()=>e[o],enumerable:!(s=O(e,o))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?P(M(t)):{},c(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>c(i({},"__esModule",{value:!0}),t),a=(t,e,r)=>(x(t,typeof e!="symbol"?e+"":e,r),r),d={};j(d,{default:()=>l});var h=S(d),u=D(f),p=m,y=g;const L="https://widget.mixcloud.com/media/js/widgetApi.js",E="Mixcloud";class l extends u.Component{constructor(){super(...arguments),a(this,"callPlayer",p.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"secondsLoaded",null),a(this,"mute",()=>{}),a(this,"unmute",()=>{}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(L,E).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((s,o)=>{this.currentTime=s,this.duration=o}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:r}=this.props,s=e.match(y.MATCH_URL_MIXCLOUD)[1],o={width:"100%",height:"100%"},n=(0,p.queryString)({...r.options,feed:`/${s}/`});return u.default.createElement("iframe",{key:s,ref:this.ref,style:o,src:`https://www.mixcloud.com/widget/iframe/?${n}`,frameBorder:"0",allow:"autoplay"})}}a(l,"displayName","Mixcloud");a(l,"canPlay",y.canPlay.mixcloud);a(l,"loopOnEnded",!0);const T=_(h),N=v({__proto__:null,default:T},[h]);export{N as M}; +import{L as _,r as f}from"./index-ead79979.js";import{u as m,p as g}from"./index-b0542bac.js";function v(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var P=Object.create,i=Object.defineProperty,O=Object.getOwnPropertyDescriptor,b=Object.getOwnPropertyNames,M=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty,x=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!w.call(t,o)&&o!==r&&i(t,o,{get:()=>e[o],enumerable:!(s=O(e,o))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?P(M(t)):{},c(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>c(i({},"__esModule",{value:!0}),t),a=(t,e,r)=>(x(t,typeof e!="symbol"?e+"":e,r),r),d={};j(d,{default:()=>l});var h=S(d),u=D(f),p=m,y=g;const L="https://widget.mixcloud.com/media/js/widgetApi.js",E="Mixcloud";class l extends u.Component{constructor(){super(...arguments),a(this,"callPlayer",p.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"secondsLoaded",null),a(this,"mute",()=>{}),a(this,"unmute",()=>{}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,p.getSDK)(L,E).then(r=>{this.player=r.PlayerWidget(this.iframe),this.player.ready.then(()=>{this.player.events.play.on(this.props.onPlay),this.player.events.pause.on(this.props.onPause),this.player.events.ended.on(this.props.onEnded),this.player.events.error.on(this.props.error),this.player.events.progress.on((s,o)=>{this.currentTime=s,this.duration=o}),this.props.onReady()})},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return null}render(){const{url:e,config:r}=this.props,s=e.match(y.MATCH_URL_MIXCLOUD)[1],o={width:"100%",height:"100%"},n=(0,p.queryString)({...r.options,feed:`/${s}/`});return u.default.createElement("iframe",{key:s,ref:this.ref,style:o,src:`https://www.mixcloud.com/widget/iframe/?${n}`,frameBorder:"0",allow:"autoplay"})}}a(l,"displayName","Mixcloud");a(l,"canPlay",y.canPlay.mixcloud);a(l,"loopOnEnded",!0);const T=_(h),N=v({__proto__:null,default:T},[h]);export{N as M}; diff --git a/build/assets/Preview-ba421c6e.js b/build/assets/Preview-24af5c04.js similarity index 97% rename from build/assets/Preview-ba421c6e.js rename to build/assets/Preview-24af5c04.js index ae788b858..bfeaaccb9 100644 --- a/build/assets/Preview-ba421c6e.js +++ b/build/assets/Preview-24af5c04.js @@ -1 +1 @@ -import{L as y,r as b}from"./index-0cb90706.js";function v(r,e){for(var t=0;tn[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var w=Object.create,i=Object.defineProperty,P=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,x=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?i(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,E=(r,e)=>{for(var t in e)i(r,t,{get:e[t],enumerable:!0})},h=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!I.call(r,a)&&a!==t&&i(r,a,{get:()=>e[a],enumerable:!(n=P(e,a))||n.enumerable});return r},S=(r,e,t)=>(t=r!=null?w(x(r)):{},h(e||!r||!r.__esModule?i(t,"default",{value:r,enumerable:!0}):t,r)),C=r=>h(i({},"__esModule",{value:!0}),r),p=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),_={};E(_,{default:()=>N});var g=C(_),s=S(b);const u="64px",d={};class N extends s.Component{constructor(){super(...arguments),p(this,"mounted",!1),p(this,"state",{image:null}),p(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;(e.url!==t||e.light!==n)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!s.default.isValidElement(t)){if(typeof t=="string"){this.setState({image:t});return}if(d[e]){this.setState({image:d[e]});return}return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(a=>a.json()).then(a=>{if(a.thumbnail_url&&this.mounted){const o=a.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:o}),d[e]=o}})}}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:a}=this.props,{image:o}=this.state,l=s.default.isValidElement(e),f={display:"flex",alignItems:"center",justifyContent:"center"},c={preview:{width:"100%",height:"100%",backgroundImage:o&&!l?`url(${o})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...f},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:u,width:u,height:u,position:l?"absolute":void 0,...f},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},m=s.default.createElement("div",{style:c.shadow,className:"react-player__shadow"},s.default.createElement("div",{style:c.playIcon,className:"react-player__play-icon"}));return s.default.createElement("div",{style:c.preview,className:"react-player__preview",onClick:t,tabIndex:a,onKeyPress:this.handleKeyPress},l?e:null,n||m)}}const k=y(g),M=v({__proto__:null,default:k},[g]);export{M as P}; +import{L as y,r as b}from"./index-ead79979.js";function v(r,e){for(var t=0;tn[a]})}}}return Object.freeze(Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}))}var w=Object.create,i=Object.defineProperty,P=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,x=Object.getPrototypeOf,I=Object.prototype.hasOwnProperty,j=(r,e,t)=>e in r?i(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,E=(r,e)=>{for(var t in e)i(r,t,{get:e[t],enumerable:!0})},h=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!I.call(r,a)&&a!==t&&i(r,a,{get:()=>e[a],enumerable:!(n=P(e,a))||n.enumerable});return r},S=(r,e,t)=>(t=r!=null?w(x(r)):{},h(e||!r||!r.__esModule?i(t,"default",{value:r,enumerable:!0}):t,r)),C=r=>h(i({},"__esModule",{value:!0}),r),p=(r,e,t)=>(j(r,typeof e!="symbol"?e+"":e,t),t),_={};E(_,{default:()=>N});var g=C(_),s=S(b);const u="64px",d={};class N extends s.Component{constructor(){super(...arguments),p(this,"mounted",!1),p(this,"state",{image:null}),p(this,"handleKeyPress",e=>{(e.key==="Enter"||e.key===" ")&&this.props.onClick()})}componentDidMount(){this.mounted=!0,this.fetchImage(this.props)}componentDidUpdate(e){const{url:t,light:n}=this.props;(e.url!==t||e.light!==n)&&this.fetchImage(this.props)}componentWillUnmount(){this.mounted=!1}fetchImage({url:e,light:t,oEmbedUrl:n}){if(!s.default.isValidElement(t)){if(typeof t=="string"){this.setState({image:t});return}if(d[e]){this.setState({image:d[e]});return}return this.setState({image:null}),window.fetch(n.replace("{url}",e)).then(a=>a.json()).then(a=>{if(a.thumbnail_url&&this.mounted){const o=a.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");this.setState({image:o}),d[e]=o}})}}render(){const{light:e,onClick:t,playIcon:n,previewTabIndex:a}=this.props,{image:o}=this.state,l=s.default.isValidElement(e),f={display:"flex",alignItems:"center",justifyContent:"center"},c={preview:{width:"100%",height:"100%",backgroundImage:o&&!l?`url(${o})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...f},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:u,width:u,height:u,position:l?"absolute":void 0,...f},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},m=s.default.createElement("div",{style:c.shadow,className:"react-player__shadow"},s.default.createElement("div",{style:c.playIcon,className:"react-player__play-icon"}));return s.default.createElement("div",{style:c.preview,className:"react-player__preview",onClick:t,tabIndex:a,onKeyPress:this.handleKeyPress},l?e:null,n||m)}}const k=y(g),M=v({__proto__:null,default:k},[g]);export{M as P}; diff --git a/build/assets/Skeleton-b299e336.js b/build/assets/Skeleton-63ee525b.js similarity index 97% rename from build/assets/Skeleton-b299e336.js rename to build/assets/Skeleton-63ee525b.js index 458e3ff00..e547bb388 100644 --- a/build/assets/Skeleton-b299e336.js +++ b/build/assets/Skeleton-63ee525b.js @@ -1,4 +1,4 @@ -import{o as y,p as w,y as b,s as R,a as o,x as _,H as u,r as S,t as $,_ as U,j as M,v as j,n as A}from"./index-0cb90706.js";function X(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function N(t){return parseFloat(t)}function B(t){return y("MuiSkeleton",t)}w("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const E=["animation","className","component","height","style","variant","width"];let r=t=>t,p,g,m,f;const F=t=>{const{classes:a,variant:e,animation:i,hasChildren:n,width:l,height:s}=t;return A({root:["root",e,i,n&&"withChildren",n&&!l&&"fitContent",n&&!s&&"heightAuto"]},B,a)},K=b(p||(p=r` +import{o as y,p as w,y as b,s as R,a as o,x as _,H as u,r as S,t as $,_ as U,j as M,v as j,n as A}from"./index-ead79979.js";function X(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function N(t){return parseFloat(t)}function B(t){return y("MuiSkeleton",t)}w("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const E=["animation","className","component","height","style","variant","width"];let r=t=>t,p,g,m,f;const F=t=>{const{classes:a,variant:e,animation:i,hasChildren:n,width:l,height:s}=t;return A({root:["root",e,i,n&&"withChildren",n&&!l&&"fitContent",n&&!s&&"heightAuto"]},B,a)},K=b(p||(p=r` 0% { opacity: 1; } diff --git a/build/assets/SoundCloud-3bf40c11.js b/build/assets/SoundCloud-9d20082d.js similarity index 95% rename from build/assets/SoundCloud-3bf40c11.js rename to build/assets/SoundCloud-9d20082d.js index e923173c2..17c652ae7 100644 --- a/build/assets/SoundCloud-3bf40c11.js +++ b/build/assets/SoundCloud-9d20082d.js @@ -1 +1 @@ -import{L as P,r as g}from"./index-0cb90706.js";import{u as b,p as v}from"./index-cf45412f.js";function O(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,w=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,C=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!E.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t},R=(t,e,r)=>(r=t!=null?S(C(t)):{},d(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),T=t=>d(l({},"__esModule",{value:!0}),t),a=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),h={};L(h,{default:()=>u});var f=T(h),p=R(g),c=b,M=v;const x="https://w.soundcloud.com/player/api.js",A="SC";class u extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",c.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"fractionLoaded",null),a(this,"mute",()=>{this.setVolume(0)}),a(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){(0,c.getSDK)(x,A).then(s=>{if(!this.iframe)return;const{PLAY:o,PLAY_PROGRESS:i,PAUSE:y,FINISH:_,ERROR:m}=s.Widget.Events;r||(this.player=s.Widget(this.iframe),this.player.bind(o,this.props.onPlay),this.player.bind(y,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,n=>{this.currentTime=n.currentPosition/1e3,this.fractionLoaded=n.loadedProgress}),this.player.bind(_,()=>this.props.onEnded()),this.player.bind(m,n=>this.props.onError(n))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(n=>{this.duration=n/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return p.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}}a(u,"displayName","SoundCloud");a(u,"canPlay",M.canPlay.soundcloud);a(u,"loopOnEnded",!0);const N=P(f),I=O({__proto__:null,default:N},[f]);export{I as S}; +import{L as P,r as g}from"./index-ead79979.js";import{u as b,p as v}from"./index-b0542bac.js";function O(t,e){for(var r=0;rs[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,w=Object.getOwnPropertyDescriptor,j=Object.getOwnPropertyNames,C=Object.getPrototypeOf,E=Object.prototype.hasOwnProperty,D=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,L=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},d=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of j(e))!E.call(t,o)&&o!==r&&l(t,o,{get:()=>e[o],enumerable:!(s=w(e,o))||s.enumerable});return t},R=(t,e,r)=>(r=t!=null?S(C(t)):{},d(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),T=t=>d(l({},"__esModule",{value:!0}),t),a=(t,e,r)=>(D(t,typeof e!="symbol"?e+"":e,r),r),h={};L(h,{default:()=>u});var f=T(h),p=R(g),c=b,M=v;const x="https://w.soundcloud.com/player/api.js",A="SC";class u extends p.Component{constructor(){super(...arguments),a(this,"callPlayer",c.callPlayer),a(this,"duration",null),a(this,"currentTime",null),a(this,"fractionLoaded",null),a(this,"mute",()=>{this.setVolume(0)}),a(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),a(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){(0,c.getSDK)(x,A).then(s=>{if(!this.iframe)return;const{PLAY:o,PLAY_PROGRESS:i,PAUSE:y,FINISH:_,ERROR:m}=s.Widget.Events;r||(this.player=s.Widget(this.iframe),this.player.bind(o,this.props.onPlay),this.player.bind(y,()=>{this.duration-this.currentTime<.05||this.props.onPause()}),this.player.bind(i,n=>{this.currentTime=n.currentPosition/1e3,this.fractionLoaded=n.loadedProgress}),this.player.bind(_,()=>this.props.onEnded()),this.player.bind(m,n=>this.props.onError(n))),this.player.load(e,{...this.props.config.options,callback:()=>{this.player.getDuration(n=>{this.duration=n/1e3,this.props.onReady()})}})})}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("seekTo",e*1e3),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.fractionLoaded*this.duration}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return p.default.createElement("iframe",{ref:this.ref,src:`https://w.soundcloud.com/player/?url=${encodeURIComponent(this.props.url)}`,style:r,frameBorder:0,allow:"autoplay"})}}a(u,"displayName","SoundCloud");a(u,"canPlay",M.canPlay.soundcloud);a(u,"loopOnEnded",!0);const N=P(f),I=O({__proto__:null,default:N},[f]);export{I as S}; diff --git a/build/assets/Streamable-6e26f005.js b/build/assets/Streamable-5b03b8b7.js similarity index 95% rename from build/assets/Streamable-6e26f005.js rename to build/assets/Streamable-5b03b8b7.js index 8808d3c0e..60e255775 100644 --- a/build/assets/Streamable-6e26f005.js +++ b/build/assets/Streamable-5b03b8b7.js @@ -1 +1 @@ -import{L as m,r as f}from"./index-0cb90706.js";import{u as _,p as b}from"./index-cf45412f.js";function P(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,l=Object.defineProperty,v=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,S=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty,j=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!L.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=v(e,a))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?g(S(t)):{},c(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>c(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(j(t,typeof e!="symbol"?e+"":e,r),r),h={};w(h,{default:()=>i});var y=E(h),p=D(f),u=_,d=b;const M="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends p.Component{constructor(){super(...arguments),o(this,"callPlayer",u.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(M,T).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:s,seconds:a})=>{this.duration=s,this.currentTime=a}),this.player.on("buffered",({percent:s})=>{this.duration&&(this.secondsLoaded=this.duration*s)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(d.MATCH_URL_STREAMABLE)[1],r={width:"100%",height:"100%"};return p.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}}o(i,"displayName","Streamable");o(i,"canPlay",d.canPlay.streamable);const x=m(y),N=P({__proto__:null,default:x},[y]);export{N as S}; +import{L as m,r as f}from"./index-ead79979.js";import{u as _,p as b}from"./index-b0542bac.js";function P(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,l=Object.defineProperty,v=Object.getOwnPropertyDescriptor,O=Object.getOwnPropertyNames,S=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty,j=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},c=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of O(e))!L.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=v(e,a))||s.enumerable});return t},D=(t,e,r)=>(r=t!=null?g(S(t)):{},c(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),E=t=>c(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(j(t,typeof e!="symbol"?e+"":e,r),r),h={};w(h,{default:()=>i});var y=E(h),p=D(f),u=_,d=b;const M="https://cdn.embed.ly/player-0.1.0.min.js",T="playerjs";class i extends p.Component{constructor(){super(...arguments),o(this,"callPlayer",u.callPlayer),o(this,"duration",null),o(this,"currentTime",null),o(this,"secondsLoaded",null),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unmute")}),o(this,"ref",e=>{this.iframe=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){(0,u.getSDK)(M,T).then(r=>{this.iframe&&(this.player=new r.Player(this.iframe),this.player.setLoop(this.props.loop),this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seeked",this.props.onSeek),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({duration:s,seconds:a})=>{this.duration=s,this.currentTime=a}),this.player.on("buffered",({percent:s})=>{this.duration&&(this.secondsLoaded=this.duration*s)}),this.props.muted&&this.player.mute())},this.props.onError)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const e=this.props.url.match(d.MATCH_URL_STREAMABLE)[1],r={width:"100%",height:"100%"};return p.default.createElement("iframe",{ref:this.ref,src:`https://streamable.com/o/${e}`,frameBorder:"0",scrolling:"no",style:r,allow:"encrypted-media; autoplay; fullscreen;"})}}o(i,"displayName","Streamable");o(i,"canPlay",d.canPlay.streamable);const x=m(y),N=P({__proto__:null,default:x},[y]);export{N as S}; diff --git a/build/assets/Twitch-70bf2796.js b/build/assets/Twitch-6cf2c593.js similarity index 95% rename from build/assets/Twitch-70bf2796.js rename to build/assets/Twitch-6cf2c593.js index ad2250de7..c2f8d7f8e 100644 --- a/build/assets/Twitch-70bf2796.js +++ b/build/assets/Twitch-6cf2c593.js @@ -1 +1 @@ -import{L as w,r as D}from"./index-0cb90706.js";import{u as C,p as N}from"./index-cf45412f.js";function I(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,j=Object.getOwnPropertyDescriptor,A=Object.getOwnPropertyNames,M=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty,R=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of A(e))!H.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=j(e,a))||s.enumerable});return t},F=(t,e,r)=>(r=t!=null?S(M(t)):{},_(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>_(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(R(t,typeof e!="symbol"?e+"":e,r),r),P={};x(P,{default:()=>h});var f=U(P),d=F(D),c=C,u=N;const K="https://player.twitch.tv/js/embed/v1.js",V="Twitch",$="twitch-player-";class h extends d.Component{constructor(){super(...arguments),o(this,"callPlayer",c.callPlayer),o(this,"playerID",this.props.config.playerId||`${$}${(0,c.randomString)()}`),o(this,"mute",()=>{this.callPlayer("setMuted",!0)}),o(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){const{playsinline:s,onError:a,config:n,controls:v}=this.props,i=u.MATCH_URL_TWITCH_CHANNEL.test(e),p=i?e.match(u.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(u.MATCH_URL_TWITCH_VIDEO)[1];if(r){i?this.player.setChannel(p):this.player.setVideo("v"+p);return}(0,c.getSDK)(K,V).then(y=>{this.player=new y.Player(this.playerID,{video:i?"":p,channel:i?p:"",height:"100%",width:"100%",playsinline:s,autoplay:this.props.playing,muted:this.props.muted,controls:i?!0:v,time:(0,c.parseStartTime)(e),...n.options});const{READY:m,PLAYING:g,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=y.Player;this.player.addEventListener(m,this.props.onReady),this.player.addEventListener(g,this.props.onPlay),this.player.addEventListener(E,this.props.onPause),this.player.addEventListener(O,this.props.onEnded),this.player.addEventListener(T,this.props.onSeek),this.player.addEventListener(L,this.props.onLoaded),this.player.addEventListener(b,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){const e={width:"100%",height:"100%"};return d.default.createElement("div",{style:e,id:this.playerID})}}o(h,"displayName","Twitch");o(h,"canPlay",u.canPlay.twitch);o(h,"loopOnEnded",!0);const W=w(f),k=I({__proto__:null,default:W},[f]);export{k as T}; +import{L as w,r as D}from"./index-ead79979.js";import{u as C,p as N}from"./index-b0542bac.js";function I(t,e){for(var r=0;rs[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var S=Object.create,l=Object.defineProperty,j=Object.getOwnPropertyDescriptor,A=Object.getOwnPropertyNames,M=Object.getPrototypeOf,H=Object.prototype.hasOwnProperty,R=(t,e,r)=>e in t?l(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e)l(t,r,{get:e[r],enumerable:!0})},_=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of A(e))!H.call(t,a)&&a!==r&&l(t,a,{get:()=>e[a],enumerable:!(s=j(e,a))||s.enumerable});return t},F=(t,e,r)=>(r=t!=null?S(M(t)):{},_(e||!t||!t.__esModule?l(r,"default",{value:t,enumerable:!0}):r,t)),U=t=>_(l({},"__esModule",{value:!0}),t),o=(t,e,r)=>(R(t,typeof e!="symbol"?e+"":e,r),r),P={};x(P,{default:()=>h});var f=U(P),d=F(D),c=C,u=N;const K="https://player.twitch.tv/js/embed/v1.js",V="Twitch",$="twitch-player-";class h extends d.Component{constructor(){super(...arguments),o(this,"callPlayer",c.callPlayer),o(this,"playerID",this.props.config.playerId||`${$}${(0,c.randomString)()}`),o(this,"mute",()=>{this.callPlayer("setMuted",!0)}),o(this,"unmute",()=>{this.callPlayer("setMuted",!1)})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e,r){const{playsinline:s,onError:a,config:n,controls:v}=this.props,i=u.MATCH_URL_TWITCH_CHANNEL.test(e),p=i?e.match(u.MATCH_URL_TWITCH_CHANNEL)[1]:e.match(u.MATCH_URL_TWITCH_VIDEO)[1];if(r){i?this.player.setChannel(p):this.player.setVideo("v"+p);return}(0,c.getSDK)(K,V).then(y=>{this.player=new y.Player(this.playerID,{video:i?"":p,channel:i?p:"",height:"100%",width:"100%",playsinline:s,autoplay:this.props.playing,muted:this.props.muted,controls:i?!0:v,time:(0,c.parseStartTime)(e),...n.options});const{READY:m,PLAYING:g,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=y.Player;this.player.addEventListener(m,this.props.onReady),this.player.addEventListener(g,this.props.onPlay),this.player.addEventListener(E,this.props.onPause),this.player.addEventListener(O,this.props.onEnded),this.player.addEventListener(T,this.props.onSeek),this.player.addEventListener(L,this.props.onLoaded),this.player.addEventListener(b,this.props.onLoaded)},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.callPlayer("pause")}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return null}render(){const e={width:"100%",height:"100%"};return d.default.createElement("div",{style:e,id:this.playerID})}}o(h,"displayName","Twitch");o(h,"canPlay",u.canPlay.twitch);o(h,"loopOnEnded",!0);const W=w(f),k=I({__proto__:null,default:W},[f]);export{k as T}; diff --git a/build/assets/Vidyard-f0355643.js b/build/assets/Vidyard-e01910ab.js similarity index 95% rename from build/assets/Vidyard-f0355643.js rename to build/assets/Vidyard-e01910ab.js index 85b6864d6..a12213965 100644 --- a/build/assets/Vidyard-f0355643.js +++ b/build/assets/Vidyard-e01910ab.js @@ -1 +1 @@ -import{L as g,r as v}from"./index-0cb90706.js";import{u as b,p as O}from"./index-cf45412f.js";function V(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var D=Object.create,i=Object.defineProperty,j=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,S=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty,M=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!L.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(o=j(e,a))||o.enumerable});return t},E=(t,e,r)=>(r=t!=null?D(S(t)):{},h(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>h(i({},"__esModule",{value:!0}),t),s=(t,e,r)=>(M(t,typeof e!="symbol"?e+"":e,r),r),_={};A(_,{default:()=>y});var f=R(_),c=E(v),d=b,P=O;const x="https://play.vidyard.com/embed/v4.js",C="VidyardV4",N="onVidyardAPI";class y extends c.Component{constructor(){super(...arguments),s(this,"callPlayer",d.callPlayer),s(this,"mute",()=>{this.setVolume(0)}),s(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),s(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:r,config:o,onError:a,onDuration:n}=this.props,l=e&&e.match(P.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,d.getSDK)(x,C,N).then(p=>{this.container&&(p.api.addReadyListener((u,m)=>{this.player||(this.player=m,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...o.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,n(u.length_in_seconds)}))},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}s(y,"displayName","Vidyard");s(y,"canPlay",P.canPlay.vidyard);const T=g(f),B=V({__proto__:null,default:T},[f]);export{B as V}; +import{L as g,r as v}from"./index-ead79979.js";import{u as b,p as O}from"./index-b0542bac.js";function V(t,e){for(var r=0;ro[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var D=Object.create,i=Object.defineProperty,j=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyNames,S=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty,M=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,A=(t,e)=>{for(var r in e)i(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of w(e))!L.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(o=j(e,a))||o.enumerable});return t},E=(t,e,r)=>(r=t!=null?D(S(t)):{},h(e||!t||!t.__esModule?i(r,"default",{value:t,enumerable:!0}):r,t)),R=t=>h(i({},"__esModule",{value:!0}),t),s=(t,e,r)=>(M(t,typeof e!="symbol"?e+"":e,r),r),_={};A(_,{default:()=>y});var f=R(_),c=E(v),d=b,P=O;const x="https://play.vidyard.com/embed/v4.js",C="VidyardV4",N="onVidyardAPI";class y extends c.Component{constructor(){super(...arguments),s(this,"callPlayer",d.callPlayer),s(this,"mute",()=>{this.setVolume(0)}),s(this,"unmute",()=>{this.props.volume!==null&&this.setVolume(this.props.volume)}),s(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:r,config:o,onError:a,onDuration:n}=this.props,l=e&&e.match(P.MATCH_URL_VIDYARD)[1];this.player&&this.stop(),(0,d.getSDK)(x,C,N).then(p=>{this.container&&(p.api.addReadyListener((u,m)=>{this.player||(this.player=m,this.player.on("ready",this.props.onReady),this.player.on("play",this.props.onPlay),this.player.on("pause",this.props.onPause),this.player.on("seek",this.props.onSeek),this.player.on("playerComplete",this.props.onEnded))},l),p.api.renderPlayer({uuid:l,container:this.container,autoplay:r?1:0,...o.options}),p.api.getPlayerMetadata(l).then(u=>{this.duration=u.length_in_seconds,n(u.length_in_seconds)}))},a)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){window.VidyardV4.api.destroyPlayer(this.player)}seekTo(e,r=!0){this.callPlayer("seek",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setPlaybackRate(e){this.callPlayer("setPlaybackSpeed",e)}getDuration(){return this.duration}getCurrentTime(){return this.callPlayer("currentTime")}getSecondsLoaded(){return null}render(){const{display:e}=this.props,r={width:"100%",height:"100%",display:e};return c.default.createElement("div",{style:r},c.default.createElement("div",{ref:this.ref}))}}s(y,"displayName","Vidyard");s(y,"canPlay",P.canPlay.vidyard);const T=g(f),B=V({__proto__:null,default:T},[f]);export{B as V}; diff --git a/build/assets/Vimeo-2cd6f914.js b/build/assets/Vimeo-bc107f3b.js similarity index 96% rename from build/assets/Vimeo-2cd6f914.js rename to build/assets/Vimeo-bc107f3b.js index 7337ff4be..c36fc68c3 100644 --- a/build/assets/Vimeo-2cd6f914.js +++ b/build/assets/Vimeo-bc107f3b.js @@ -1 +1 @@ -import{L as d,r as f}from"./index-0cb90706.js";import{u as m,p as _}from"./index-cf45412f.js";function P(t,e){for(var r=0;ra[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,w=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!D.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(a=b(e,o))||a.enumerable});return t},L=(t,e,r)=>(r=t!=null?g(O(t)):{},h(e||!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),M=t=>h(n({},"__esModule",{value:!0}),t),i=(t,e,r)=>(w(t,typeof e!="symbol"?e+"":e,r),r),c={};j(c,{default:()=>l});var y=M(c),p=L(f),u=m,E=_;const S="https://player.vimeo.com/api/player.js",V="Vimeo",k=t=>t.replace("/manage/videos","");class l extends p.Component{constructor(){super(...arguments),i(this,"callPlayer",u.callPlayer),i(this,"duration",null),i(this,"currentTime",null),i(this,"secondsLoaded",null),i(this,"mute",()=>{this.setMuted(!0)}),i(this,"unmute",()=>{this.setMuted(!1)}),i(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,u.getSDK)(S,V).then(r=>{if(!this.container)return;const{playerOptions:a,title:o}=this.props.config;this.player=new r.Player(this.container,{url:k(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...a}),this.player.ready().then(()=>{const s=this.container.querySelector("iframe");s.style.width="100%",s.style.height="100%",o&&(s.title=o)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",s=>this.props.onSeek(s.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:s})=>{this.currentTime=s}),this.player.on("progress",({seconds:s})=>{this.secondsLoaded=s}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",s=>this.props.onPlaybackRateChange(s.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return p.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}}i(l,"displayName","Vimeo");i(l,"canPlay",E.canPlay.vimeo);i(l,"forceLoad",!0);const T=d(y),R=P({__proto__:null,default:T},[y]);export{R as V}; +import{L as d,r as f}from"./index-ead79979.js";import{u as m,p as _}from"./index-b0542bac.js";function P(t,e){for(var r=0;ra[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var g=Object.create,n=Object.defineProperty,b=Object.getOwnPropertyDescriptor,v=Object.getOwnPropertyNames,O=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty,w=(t,e,r)=>e in t?n(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j=(t,e)=>{for(var r in e)n(t,r,{get:e[r],enumerable:!0})},h=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of v(e))!D.call(t,o)&&o!==r&&n(t,o,{get:()=>e[o],enumerable:!(a=b(e,o))||a.enumerable});return t},L=(t,e,r)=>(r=t!=null?g(O(t)):{},h(e||!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),M=t=>h(n({},"__esModule",{value:!0}),t),i=(t,e,r)=>(w(t,typeof e!="symbol"?e+"":e,r),r),c={};j(c,{default:()=>l});var y=M(c),p=L(f),u=m,E=_;const S="https://player.vimeo.com/api/player.js",V="Vimeo",k=t=>t.replace("/manage/videos","");class l extends p.Component{constructor(){super(...arguments),i(this,"callPlayer",u.callPlayer),i(this,"duration",null),i(this,"currentTime",null),i(this,"secondsLoaded",null),i(this,"mute",()=>{this.setMuted(!0)}),i(this,"unmute",()=>{this.setMuted(!1)}),i(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){this.duration=null,(0,u.getSDK)(S,V).then(r=>{if(!this.container)return;const{playerOptions:a,title:o}=this.props.config;this.player=new r.Player(this.container,{url:k(e),autoplay:this.props.playing,muted:this.props.muted,loop:this.props.loop,playsinline:this.props.playsinline,controls:this.props.controls,...a}),this.player.ready().then(()=>{const s=this.container.querySelector("iframe");s.style.width="100%",s.style.height="100%",o&&(s.title=o)}).catch(this.props.onError),this.player.on("loaded",()=>{this.props.onReady(),this.refreshDuration()}),this.player.on("play",()=>{this.props.onPlay(),this.refreshDuration()}),this.player.on("pause",this.props.onPause),this.player.on("seeked",s=>this.props.onSeek(s.seconds)),this.player.on("ended",this.props.onEnded),this.player.on("error",this.props.onError),this.player.on("timeupdate",({seconds:s})=>{this.currentTime=s}),this.player.on("progress",({seconds:s})=>{this.secondsLoaded=s}),this.player.on("bufferstart",this.props.onBuffer),this.player.on("bufferend",this.props.onBufferEnd),this.player.on("playbackratechange",s=>this.props.onPlaybackRateChange(s.playbackRate))},this.props.onError)}refreshDuration(){this.player.getDuration().then(e=>{this.duration=e})}play(){const e=this.callPlayer("play");e&&e.catch(this.props.onError)}pause(){this.callPlayer("pause")}stop(){this.callPlayer("unload")}seekTo(e,r=!0){this.callPlayer("setCurrentTime",e),r||this.pause()}setVolume(e){this.callPlayer("setVolume",e)}setMuted(e){this.callPlayer("setMuted",e)}setLoop(e){this.callPlayer("setLoop",e)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}getDuration(){return this.duration}getCurrentTime(){return this.currentTime}getSecondsLoaded(){return this.secondsLoaded}render(){const{display:e}=this.props,r={width:"100%",height:"100%",overflow:"hidden",display:e};return p.default.createElement("div",{key:this.props.url,ref:this.ref,style:r})}}i(l,"displayName","Vimeo");i(l,"canPlay",E.canPlay.vimeo);i(l,"forceLoad",!0);const T=d(y),R=P({__proto__:null,default:T},[y]);export{R as V}; diff --git a/build/assets/Wistia-3c8f1ab9.js b/build/assets/Wistia-25e10489.js similarity index 96% rename from build/assets/Wistia-3c8f1ab9.js rename to build/assets/Wistia-25e10489.js index 08333dc07..616e8ed65 100644 --- a/build/assets/Wistia-3c8f1ab9.js +++ b/build/assets/Wistia-25e10489.js @@ -1 +1 @@ -import{L as m,r as g}from"./index-0cb90706.js";import{u as v,p as w}from"./index-cf45412f.js";function O(t,e){for(var a=0;as[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var C=Object.create,i=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,E=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=(t,e,a)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,j=(t,e)=>{for(var a in e)i(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!S.call(t,r)&&r!==a&&i(t,r,{get:()=>e[r],enumerable:!(s=k(e,r))||s.enumerable});return t},I=(t,e,a)=>(a=t!=null?C(E(t)):{},h(e||!t||!t.__esModule?i(a,"default",{value:t,enumerable:!0}):a,t)),W=t=>h(i({},"__esModule",{value:!0}),t),n=(t,e,a)=>(R(t,typeof e!="symbol"?e+"":e,a),a),d={};j(d,{default:()=>l});var _=W(d),y=I(g),c=v,P=w;const L="https://fast.wistia.com/assets/external/E-v1.js",M="Wistia",x="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${x}${(0,c.randomString)()}`),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onSeek",(...e)=>this.props.onSeek(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),n(this,"mute",()=>{this.callPlayer("mute")}),n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:a,muted:s,controls:r,onReady:o,config:p,onError:b}=this.props;(0,c.getSDK)(L,M).then(f=>{p.customControls&&p.customControls.forEach(u=>f.defineControl(u)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:a,silentAutoPlay:"allow",muted:s,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...p.options},onReady:u=>{this.player=u,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),o()}})},b)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,a=!0){this.callPlayer("time",e),a||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,a=e&&e.match(P.MATCH_URL_WISTIA)[1],s=`wistia_embed wistia_async_${a}`,r={width:"100%",height:"100%"};return y.default.createElement("div",{id:this.playerID,key:a,className:s,style:r})}}n(l,"displayName","Wistia");n(l,"canPlay",P.canPlay.wistia);n(l,"loopOnEnded",!0);const A=m(_),$=O({__proto__:null,default:A},[_]);export{$ as W}; +import{L as m,r as g}from"./index-ead79979.js";import{u as v,p as w}from"./index-b0542bac.js";function O(t,e){for(var a=0;as[r]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var C=Object.create,i=Object.defineProperty,k=Object.getOwnPropertyDescriptor,D=Object.getOwnPropertyNames,E=Object.getPrototypeOf,S=Object.prototype.hasOwnProperty,R=(t,e,a)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,j=(t,e)=>{for(var a in e)i(t,a,{get:e[a],enumerable:!0})},h=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of D(e))!S.call(t,r)&&r!==a&&i(t,r,{get:()=>e[r],enumerable:!(s=k(e,r))||s.enumerable});return t},I=(t,e,a)=>(a=t!=null?C(E(t)):{},h(e||!t||!t.__esModule?i(a,"default",{value:t,enumerable:!0}):a,t)),W=t=>h(i({},"__esModule",{value:!0}),t),n=(t,e,a)=>(R(t,typeof e!="symbol"?e+"":e,a),a),d={};j(d,{default:()=>l});var _=W(d),y=I(g),c=v,P=w;const L="https://fast.wistia.com/assets/external/E-v1.js",M="Wistia",x="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${x}${(0,c.randomString)()}`),n(this,"onPlay",(...e)=>this.props.onPlay(...e)),n(this,"onPause",(...e)=>this.props.onPause(...e)),n(this,"onSeek",(...e)=>this.props.onSeek(...e)),n(this,"onEnded",(...e)=>this.props.onEnded(...e)),n(this,"onPlaybackRateChange",(...e)=>this.props.onPlaybackRateChange(...e)),n(this,"mute",()=>{this.callPlayer("mute")}),n(this,"unmute",()=>{this.callPlayer("unmute")})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}load(e){const{playing:a,muted:s,controls:r,onReady:o,config:p,onError:b}=this.props;(0,c.getSDK)(L,M).then(f=>{p.customControls&&p.customControls.forEach(u=>f.defineControl(u)),window._wq=window._wq||[],window._wq.push({id:this.playerID,options:{autoPlay:a,silentAutoPlay:"allow",muted:s,controlsVisibleOnLoad:r,fullscreenButton:r,playbar:r,playbackRateControl:r,qualityControl:r,volumeControl:r,settingsControl:r,smallPlayButton:r,...p.options},onReady:u=>{this.player=u,this.unbind(),this.player.bind("play",this.onPlay),this.player.bind("pause",this.onPause),this.player.bind("seek",this.onSeek),this.player.bind("end",this.onEnded),this.player.bind("playbackratechange",this.onPlaybackRateChange),o()}})},b)}unbind(){this.player.unbind("play",this.onPlay),this.player.unbind("pause",this.onPause),this.player.unbind("seek",this.onSeek),this.player.unbind("end",this.onEnded),this.player.unbind("playbackratechange",this.onPlaybackRateChange)}play(){this.callPlayer("play")}pause(){this.callPlayer("pause")}stop(){this.unbind(),this.callPlayer("remove")}seekTo(e,a=!0){this.callPlayer("time",e),a||this.pause()}setVolume(e){this.callPlayer("volume",e)}setPlaybackRate(e){this.callPlayer("playbackRate",e)}getDuration(){return this.callPlayer("duration")}getCurrentTime(){return this.callPlayer("time")}getSecondsLoaded(){return null}render(){const{url:e}=this.props,a=e&&e.match(P.MATCH_URL_WISTIA)[1],s=`wistia_embed wistia_async_${a}`,r={width:"100%",height:"100%"};return y.default.createElement("div",{id:this.playerID,key:a,className:s,style:r})}}n(l,"displayName","Wistia");n(l,"canPlay",P.canPlay.wistia);n(l,"loopOnEnded",!0);const A=m(_),$=O({__proto__:null,default:A},[_]);export{$ as W}; diff --git a/build/assets/YouTube-78286ba8.js b/build/assets/YouTube-90bf904b.js similarity index 97% rename from build/assets/YouTube-78286ba8.js rename to build/assets/YouTube-90bf904b.js index 10c218d84..e6723c2bc 100644 --- a/build/assets/YouTube-78286ba8.js +++ b/build/assets/YouTube-90bf904b.js @@ -1 +1 @@ -import{L as R,r as U}from"./index-0cb90706.js";import{u as I,p as Y}from"./index-cf45412f.js";function k(a,e){for(var t=0;ts[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,u=Object.defineProperty,j=Object.getOwnPropertyDescriptor,N=Object.getOwnPropertyNames,V=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,x=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,K=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of N(e))!B.call(a,r)&&r!==t&&u(a,r,{get:()=>e[r],enumerable:!(s=j(e,r))||s.enumerable});return a},F=(a,e,t)=>(t=a!=null?M(V(a)):{},v(e||!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>v(u({},"__esModule",{value:!0}),a),o=(a,e,t)=>(x(a,typeof e!="symbol"?e+"":e,t),t),w={};K(w,{default:()=>O});var S=H(w),m=F(U),p=I,D=Y;const G="https://www.youtube.com/iframe_api",T="YT",z="onYouTubeIframeAPIReady",f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,b=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends m.Component{constructor(){super(...arguments),o(this,"callPlayer",p.callPlayer),o(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(b.test(e)){const[,t]=e.match(b);return{listType:"user_uploads",list:t}}return{}}),o(this,"onStateChange",e=>{const{data:t}=e,{onPlay:s,onPause:r,onBuffer:n,onBufferEnd:P,onEnded:_,onReady:g,loop:y,config:{playerVars:l,onUnstarted:h}}=this.props,{UNSTARTED:d,PLAYING:c,PAUSED:i,BUFFERING:E,ENDED:A,CUED:C}=window[T].PlayerState;if(t===d&&h(),t===c&&(s(),P()),t===i&&r(),t===E&&n(),t===A){const L=!!this.callPlayer("getPlaylist");y&&!L&&(l.start?this.seekTo(l.start):this.play()),_()}t===C&&g()}),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unMute")}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(D.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:s,muted:r,playsinline:n,controls:P,loop:_,config:g,onError:y}=this.props,{playerVars:l,embedOptions:h}=g,d=this.getID(e);if(t){if(f.test(e)||b.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:d,startSeconds:(0,p.parseStartTime)(e)||l.start,endSeconds:(0,p.parseEndTime)(e)||l.end});return}(0,p.getSDK)(G,T,z,c=>c.loaded).then(c=>{this.container&&(this.player=new c.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:s?1:0,mute:r?1:0,controls:P?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:n?1:0,...this.parsePlaylist(e),...l},events:{onReady:()=>{_&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:i=>this.props.onPlaybackRateChange(i.data),onPlaybackQualityChange:i=>this.props.onPlaybackQualityChange(i),onStateChange:this.onStateChange,onError:i=>y(i.data)},host:Q.test(e)?Z:void 0,...h}))},y),h.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),!t&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return m.default.createElement("div",{style:t},m.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=R(S),W=k({__proto__:null,default:$},[S]);export{W as Y}; +import{L as R,r as U}from"./index-ead79979.js";import{u as I,p as Y}from"./index-b0542bac.js";function k(a,e){for(var t=0;ts[r]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var M=Object.create,u=Object.defineProperty,j=Object.getOwnPropertyDescriptor,N=Object.getOwnPropertyNames,V=Object.getPrototypeOf,B=Object.prototype.hasOwnProperty,x=(a,e,t)=>e in a?u(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t,K=(a,e)=>{for(var t in e)u(a,t,{get:e[t],enumerable:!0})},v=(a,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of N(e))!B.call(a,r)&&r!==t&&u(a,r,{get:()=>e[r],enumerable:!(s=j(e,r))||s.enumerable});return a},F=(a,e,t)=>(t=a!=null?M(V(a)):{},v(e||!a||!a.__esModule?u(t,"default",{value:a,enumerable:!0}):t,a)),H=a=>v(u({},"__esModule",{value:!0}),a),o=(a,e,t)=>(x(a,typeof e!="symbol"?e+"":e,t),t),w={};K(w,{default:()=>O});var S=H(w),m=F(U),p=I,D=Y;const G="https://www.youtube.com/iframe_api",T="YT",z="onYouTubeIframeAPIReady",f=/[?&](?:list|channel)=([a-zA-Z0-9_-]+)/,b=/user\/([a-zA-Z0-9_-]+)\/?/,Q=/youtube-nocookie\.com/,Z="https://www.youtube-nocookie.com";class O extends m.Component{constructor(){super(...arguments),o(this,"callPlayer",p.callPlayer),o(this,"parsePlaylist",e=>{if(e instanceof Array)return{listType:"playlist",playlist:e.map(this.getID).join(",")};if(f.test(e)){const[,t]=e.match(f);return{listType:"playlist",list:t.replace(/^UC/,"UU")}}if(b.test(e)){const[,t]=e.match(b);return{listType:"user_uploads",list:t}}return{}}),o(this,"onStateChange",e=>{const{data:t}=e,{onPlay:s,onPause:r,onBuffer:n,onBufferEnd:P,onEnded:_,onReady:g,loop:y,config:{playerVars:l,onUnstarted:h}}=this.props,{UNSTARTED:d,PLAYING:c,PAUSED:i,BUFFERING:E,ENDED:A,CUED:C}=window[T].PlayerState;if(t===d&&h(),t===c&&(s(),P()),t===i&&r(),t===E&&n(),t===A){const L=!!this.callPlayer("getPlaylist");y&&!L&&(l.start?this.seekTo(l.start):this.play()),_()}t===C&&g()}),o(this,"mute",()=>{this.callPlayer("mute")}),o(this,"unmute",()=>{this.callPlayer("unMute")}),o(this,"ref",e=>{this.container=e})}componentDidMount(){this.props.onMount&&this.props.onMount(this)}getID(e){return!e||e instanceof Array||f.test(e)?null:e.match(D.MATCH_URL_YOUTUBE)[1]}load(e,t){const{playing:s,muted:r,playsinline:n,controls:P,loop:_,config:g,onError:y}=this.props,{playerVars:l,embedOptions:h}=g,d=this.getID(e);if(t){if(f.test(e)||b.test(e)||e instanceof Array){this.player.loadPlaylist(this.parsePlaylist(e));return}this.player.cueVideoById({videoId:d,startSeconds:(0,p.parseStartTime)(e)||l.start,endSeconds:(0,p.parseEndTime)(e)||l.end});return}(0,p.getSDK)(G,T,z,c=>c.loaded).then(c=>{this.container&&(this.player=new c.Player(this.container,{width:"100%",height:"100%",videoId:d,playerVars:{autoplay:s?1:0,mute:r?1:0,controls:P?1:0,start:(0,p.parseStartTime)(e),end:(0,p.parseEndTime)(e),origin:window.location.origin,playsinline:n?1:0,...this.parsePlaylist(e),...l},events:{onReady:()=>{_&&this.player.setLoop(!0),this.props.onReady()},onPlaybackRateChange:i=>this.props.onPlaybackRateChange(i.data),onPlaybackQualityChange:i=>this.props.onPlaybackQualityChange(i),onStateChange:this.onStateChange,onError:i=>y(i.data)},host:Q.test(e)?Z:void 0,...h}))},y),h.events&&console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer’s callback props instead, eg onReady, onPlay, onPause")}play(){this.callPlayer("playVideo")}pause(){this.callPlayer("pauseVideo")}stop(){document.body.contains(this.callPlayer("getIframe"))&&this.callPlayer("stopVideo")}seekTo(e,t=!1){this.callPlayer("seekTo",e),!t&&!this.props.playing&&this.pause()}setVolume(e){this.callPlayer("setVolume",e*100)}setPlaybackRate(e){this.callPlayer("setPlaybackRate",e)}setLoop(e){this.callPlayer("setLoop",e)}getDuration(){return this.callPlayer("getDuration")}getCurrentTime(){return this.callPlayer("getCurrentTime")}getSecondsLoaded(){return this.callPlayer("getVideoLoadedFraction")*this.getDuration()}render(){const{display:e}=this.props,t={width:"100%",height:"100%",display:e};return m.default.createElement("div",{style:t},m.default.createElement("div",{ref:this.ref}))}}o(O,"displayName","YouTube");o(O,"canPlay",D.canPlay.youtube);const $=R(S),W=k({__proto__:null,default:$},[S]);export{W as Y}; diff --git a/build/assets/index-aeca93f0.js b/build/assets/index-07fdb50a.js similarity index 86% rename from build/assets/index-aeca93f0.js rename to build/assets/index-07fdb50a.js index 9ccd942f5..058fdbe6e 100644 --- a/build/assets/index-aeca93f0.js +++ b/build/assets/index-07fdb50a.js @@ -1,4 +1,4 @@ -import{j as e,Q as i,S as t,U as c,ad as y,r as l,O as S,M as b,a1 as M,am as $,bE as D}from"./index-0cb90706.js";import{aE as E,B as j,aF as R}from"./index-7a7c9631.js";import{S as I}from"./Skeleton-b299e336.js";const z=d=>e.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 60 52",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M12.849 16.2461L31.5592 5.44376L50.2694 16.2461V37.8508L31.5592 48.6531L12.849 37.8508V16.2461Z",stroke:"#6B7A8D",fill:"currentColor","stroke-width":"2"}),e.jsx("path",{d:"M50.7383 16.0509L31.559 27.047M31.559 27.047L12.3798 16.0509M31.559 27.047L31.559 49.2949",stroke:"#6B7A8D","stroke-width":"2"}),e.jsx("path",{d:"M7.44052 9.03136C5.80715 8.08833 3.71857 8.64797 2.77554 10.2813C1.83251 11.9147 2.39215 14.0033 4.02552 14.9463L52.5595 42.9674C54.1929 43.9104 56.2814 43.3508 57.2245 41.7174L55.4924 40.7174L57.2245 41.7174C58.1675 40.0841 57.6079 37.9955 55.9745 37.0525L7.44052 9.03136Z",fill:"currentColor",stroke:"#23252F","stroke-width":"4","stroke-linecap":"round"})]}),A=({nodeName:d})=>e.jsx(c,{children:e.jsxs(c,{align:"center",direction:"column",justify:"space-between",children:[e.jsx(G,{children:e.jsx(z,{})}),e.jsxs(T,{children:["Are you sure you want to delete ",d||"this item","?"]})]})}),T=i(c)` +import{j as e,Q as i,S as t,U as c,ad as y,r as l,O as S,M as b,a1 as M,am as $,bE as D}from"./index-ead79979.js";import{aF as R,B as j,aG as E}from"./index-74184c93.js";import{S as I}from"./Skeleton-63ee525b.js";const z=d=>e.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 60 52",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M12.849 16.2461L31.5592 5.44376L50.2694 16.2461V37.8508L31.5592 48.6531L12.849 37.8508V16.2461Z",stroke:"#6B7A8D",fill:"currentColor","stroke-width":"2"}),e.jsx("path",{d:"M50.7383 16.0509L31.559 27.047M31.559 27.047L12.3798 16.0509M31.559 27.047L31.559 49.2949",stroke:"#6B7A8D","stroke-width":"2"}),e.jsx("path",{d:"M7.44052 9.03136C5.80715 8.08833 3.71857 8.64797 2.77554 10.2813C1.83251 11.9147 2.39215 14.0033 4.02552 14.9463L52.5595 42.9674C54.1929 43.9104 56.2814 43.3508 57.2245 41.7174L55.4924 40.7174L57.2245 41.7174C58.1675 40.0841 57.6079 37.9955 55.9745 37.0525L7.44052 9.03136Z",fill:"currentColor",stroke:"#23252F","stroke-width":"4","stroke-linecap":"round"})]}),A=({nodeName:d})=>e.jsx(c,{children:e.jsxs(c,{align:"center",direction:"column",justify:"space-between",children:[e.jsx(T,{children:e.jsx(z,{})}),e.jsxs(G,{children:["Are you sure you want to delete ",d||"this item","?"]})]})}),G=i(c)` color: ${t.white}; font-family: 'Barlow'; font-size: 20px; @@ -9,7 +9,7 @@ import{j as e,Q as i,S as t,U as c,ad as y,r as l,O as S,M as b,a1 as M,am as $, padding: 0 20px; width: 100%; word-wrap: break-word; -`,G=i(c)` +`,T=i(c)` justify-content: center; align-items: center; font-size: 52px; @@ -19,7 +19,7 @@ import{j as e,Q as i,S as t,U as c,ad as y,r as l,O as S,M as b,a1 as M,am as $, path:nth-child(3) { color: #6b7a8d; } -`,F=()=>{const{close:d}=y("removeNode"),{close:f}=y("editNodeName"),[m,p]=l.useState(!1),[g]=S(s=>[s.setSelectedNode]),[v]=b(s=>[s.removeNode]),[k,w]=l.useState(!1),[n,L]=l.useState(),[a,C]=l.useState(),o=M(),h=()=>{d()};l.useEffect(()=>{(async()=>{if(o){w(!0);try{if(o.type==="topic"){const{data:r}=await $({search:o==null?void 0:o.name}),u=r.find(x=>x.name===o.name);C(u)}else L(o)}catch(r){console.log(r)}finally{w(!1)}}})()},[o]);const B=async()=>{p(!0);try{g(null),h(),f()}catch(s){console.warn(s)}finally{p(!1)}},N=async()=>{let s="";const r=n||a;if(!r)return;r!=null&&r.ref_id&&(s=r.ref_id),p(!0);const u=o==null?void 0:o.ref_id;try{await D(s),v(u),g(null),h(),f()}catch(x){console.warn(x)}finally{p(!1)}};return e.jsxs(W,{children:[e.jsx(A,{nodeName:(n==null?void 0:n.name)||(a==null?void 0:a.name)||""}),k?e.jsx(I,{}):e.jsxs(c,{direction:"row",mt:34,children:[e.jsx(_,{color:"secondary",onClick:h,size:"large",style:{flex:1,marginRight:20},variant:"contained",children:"Cancel"}),e.jsxs(O,{color:"secondary",disabled:m||!n&&!a,onClick:n||a?N:B,size:"large",style:{flex:1},variant:"contained",children:["Delete",m&&e.jsx(V,{children:e.jsx(E,{color:t.lightGray,size:12})})]})]})]})},W=i(c)` +`,F=()=>{const{close:d}=y("removeNode"),{close:f}=y("editNodeName"),[m,p]=l.useState(!1),[g]=S(s=>[s.setSelectedNode]),[v]=b(s=>[s.removeNode]),[k,w]=l.useState(!1),[n,L]=l.useState(),[a,C]=l.useState(),o=M(),h=()=>{d()};l.useEffect(()=>{(async()=>{if(o){w(!0);try{if(o.type==="topic"){const{data:r}=await $({search:o==null?void 0:o.name}),u=r.find(x=>x.name===o.name);C(u)}else L(o)}catch(r){console.log(r)}finally{w(!1)}}})()},[o]);const B=async()=>{p(!0);try{g(null),h(),f()}catch(s){console.warn(s)}finally{p(!1)}},N=async()=>{let s="";const r=n||a;if(!r)return;r!=null&&r.ref_id&&(s=r.ref_id),p(!0);const u=o==null?void 0:o.ref_id;try{await D(s),v(u),g(null),h(),f()}catch(x){console.warn(x)}finally{p(!1)}};return e.jsxs(W,{children:[e.jsx(A,{nodeName:(n==null?void 0:n.name)||(a==null?void 0:a.name)||""}),k?e.jsx(I,{}):e.jsxs(c,{direction:"row",mt:34,children:[e.jsx(_,{color:"secondary",onClick:h,size:"large",style:{flex:1,marginRight:20},variant:"contained",children:"Cancel"}),e.jsxs(O,{color:"secondary",disabled:m||!n&&!a,onClick:n||a?N:B,size:"large",style:{flex:1},variant:"contained",children:["Delete",m&&e.jsx(V,{children:e.jsx(R,{color:t.lightGray,size:12})})]})]})]})},W=i(c)` padding: 4px 12px 16px; `,_=i(j)` && { @@ -47,4 +47,4 @@ import{j as e,Q as i,S as t,U as c,ad as y,r as l,O as S,M as b,a1 as M,am as $, } `,V=i.span` margin-top: 2px; -`,U=()=>e.jsx(R,{id:"removeNode",kind:"small",preventOutsideClose:!0,children:e.jsx(F,{})});export{U as RemoveNodeModal}; +`,U=()=>e.jsx(E,{id:"removeNode",kind:"small",preventOutsideClose:!0,children:e.jsx(F,{})});export{U as RemoveNodeModal}; diff --git a/build/assets/index-7c6a1cbf.js b/build/assets/index-0c8a47fb.js similarity index 85% rename from build/assets/index-7c6a1cbf.js rename to build/assets/index-0c8a47fb.js index a8c9af9a3..99e912901 100644 --- a/build/assets/index-7c6a1cbf.js +++ b/build/assets/index-0c8a47fb.js @@ -1,4 +1,4 @@ -import{r as l,ak as A,j as e,U as p,ap as B,Q as s,a5 as _,ad as F,a1 as k,S as v,am as M,at as O}from"./index-0cb90706.js";import{aS as z,ab as N,aO as D,aP as P,aT as Y,aV as X,aW as R,aX as U,aU as W,aY as C,ae as H,aF as G,af as Q,aE as I,aZ as Z,B as $}from"./index-7a7c9631.js";const q=({topicId:o,onSelect:i,selectedValue:d,dataId:c})=>{const[x,h]=l.useState([]),[b,u]=l.useState(!1),w=l.useMemo(()=>{const t=async f=>{const n={is_muted:"False",sort_by:Y,search:f,skip:"0",limit:"1000"};u(!0);try{const T=(await B(n.search)).data.filter(a=>(a==null?void 0:a.ref_id)!==o);h(T)}catch{h([])}finally{u(!1)}};return A.debounce(t,300)},[o]),r=t=>{if(!t){h([]);return}t.length>2&&w(t)},m=t=>{const f=t?x.find(n=>n.ref_id===t.value):null;i(f||null)},j=t=>({label:t.search_value,value:t.ref_id,type:t.node_type}),y=t=>t.map(j);return d?e.jsxs(p,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:d.search_value}),e.jsx(z,{onClick:()=>i(null),size:"medium",children:e.jsx(N,{})})]}):e.jsx(D,{dataId:c,handleInputChange:r,isLoading:b,onSelect:m,options:y(x)||P,selectedValue:d?j(d):null})},J=({from:o,onSelect:i,selectedToNode:d,isSwapped:c,setIsSwapped:x})=>e.jsxs(p,{mb:20,children:[e.jsx(p,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(p,{align:"center",direction:"row",children:e.jsx(K,{children:"Merge topic"})})}),e.jsxs(te,{swap:c,children:[e.jsx(V,{children:e.jsx(oe,{disabled:!0,label:c?"To":"From",swap:c,value:o==null?void 0:o.name})}),e.jsxs(p,{my:16,children:[e.jsx(ae,{children:"Type"}),e.jsx(_,{children:"IS ALIAS"})]}),e.jsx(p,{"data-testid":"to-section-container",children:e.jsxs(se,{children:[e.jsx(ne,{children:c?"From":"To"}),e.jsx(q,{dataId:"to-node",onSelect:i,selectedValue:d,topicId:o==null?void 0:o.ref_id})]})}),e.jsxs(ee,{children:[e.jsx(ie,{children:e.jsx(X,{})}),e.jsx(re,{"data-testid":"swap-icon",onClick:x,children:e.jsx(R,{})}),e.jsx(le,{children:e.jsx(U,{})})]})]})]}),K=s(_)` +import{r as l,ak as B,j as e,U as p,ap as E,Q as s,a5 as _,ad as F,a1 as k,S as v,am as M,at as z}from"./index-ead79979.js";import{aT as N,ac as O,aP as D,aQ as P,aU as Y,aW as X,aX as R,aY as U,aV as W,aZ as C,af as G,aG as H,ag as Q,aF as I,a_ as Z,B as $}from"./index-74184c93.js";const q=({topicId:o,onSelect:i,selectedValue:d,dataId:c})=>{const[x,h]=l.useState([]),[b,u]=l.useState(!1),w=l.useMemo(()=>{const t=async f=>{const n={is_muted:"False",sort_by:Y,search:f,skip:"0",limit:"1000"};u(!0);try{const T=(await E(n.search)).data.filter(a=>(a==null?void 0:a.ref_id)!==o);h(T)}catch{h([])}finally{u(!1)}};return B.debounce(t,300)},[o]),r=t=>{if(!t){h([]);return}t.length>2&&w(t)},m=t=>{const f=t?x.find(n=>n.ref_id===t.value):null;i(f||null)},j=t=>({label:t.search_value,value:t.ref_id,type:t.node_type}),y=t=>t.map(j);return d?e.jsxs(p,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:d.search_value}),e.jsx(N,{onClick:()=>i(null),size:"medium",children:e.jsx(O,{})})]}):e.jsx(D,{dataId:c,handleInputChange:r,isLoading:b,onSelect:m,options:y(x)||P,selectedValue:d?j(d):null})},J=({from:o,onSelect:i,selectedToNode:d,isSwapped:c,setIsSwapped:x})=>e.jsxs(p,{mb:20,children:[e.jsx(p,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(p,{align:"center",direction:"row",children:e.jsx(K,{children:"Merge topic"})})}),e.jsxs(te,{swap:c,children:[e.jsx(V,{children:e.jsx(oe,{disabled:!0,label:c?"To":"From",swap:c,value:o==null?void 0:o.name})}),e.jsxs(p,{my:16,children:[e.jsx(ae,{children:"Type"}),e.jsx(_,{children:"IS ALIAS"})]}),e.jsx(p,{"data-testid":"to-section-container",children:e.jsxs(se,{children:[e.jsx(ne,{children:c?"From":"To"}),e.jsx(q,{dataId:"to-node",onSelect:i,selectedValue:d,topicId:o==null?void 0:o.ref_id})]})}),e.jsxs(ee,{children:[e.jsx(ie,{children:e.jsx(X,{})}),e.jsx(re,{"data-testid":"swap-icon",onClick:x,children:e.jsx(R,{})}),e.jsx(le,{children:e.jsx(U,{})})]})]})]}),K=s(_)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -87,7 +87,7 @@ import{r as l,ak as A,j as e,U as p,ap as B,Q as s,a5 as _,ad as F,a1 as k,S as transform: translateY(10px) translateX(3px); color: #6b7a8d; line-height: 1; -`,he=()=>{const{close:o}=F("mergeToNode"),[i,d,c]=C(a=>[a.data,a.ids,a.total]),x=H({mode:"onChange"}),[h,b]=l.useState(!1),[u,w]=l.useState(!1),[r,m]=l.useState(null),[j,y]=l.useState(!1),[t,f]=l.useState(),n=k();l.useEffect(()=>{(async()=>{if(n){y(!0);try{if(n.type==="topic"){const g=await M({search:n==null?void 0:n.name}),L=g==null?void 0:g.data.find(E=>E.name===n.name);f(L)}}catch(g){console.log(g)}finally{y(!1)}}})()},[n]);const S=()=>{m(null),o()},T=async()=>{if(!(!r||!i)){b(!0);try{await O({from:t==null?void 0:t.ref_id,to:r==null?void 0:r.ref_id}),t!=null&&t.ref_id&&(i[t==null?void 0:t.ref_id]={...i[t==null?void 0:t.ref_id],edgeList:[Z],edgeCount:i[t==null?void 0:t.ref_id].edgeCount-1},C.setState({ids:d.filter(a=>a!==r.ref_id),total:c-1})),S()}catch(a){console.warn(a)}finally{b(!1)}}};return e.jsx(G,{id:"mergeToNode",kind:"small",onClose:S,preventOutsideClose:!0,children:e.jsxs(Q,{...x,children:[j?e.jsx(p,{align:"center",my:24,children:e.jsx(I,{color:v.lightGray,size:24})}):e.jsx(J,{from:t,isSwapped:u,onSelect:m,selectedToNode:r,setIsSwapped:()=>w(!u)}),e.jsxs(de,{color:"secondary","data-testid":"merge-topics-button",disabled:h||!r,onClick:T,size:"large",variant:"contained",children:["Merge topics",h&&e.jsx(ce,{children:e.jsx(I,{color:v.BLUE_PRESS_STATE,size:12})})]})]})})},de=s($)` +`,he=()=>{const{close:o}=F("mergeToNode"),[i,d,c]=C(a=>[a.data,a.ids,a.total]),x=G({mode:"onChange"}),[h,b]=l.useState(!1),[u,w]=l.useState(!1),[r,m]=l.useState(null),[j,y]=l.useState(!1),[t,f]=l.useState(),n=k();l.useEffect(()=>{(async()=>{if(n){y(!0);try{if(n.type==="topic"){const g=await M({search:n==null?void 0:n.name}),L=g==null?void 0:g.data.find(A=>A.name===n.name);f(L)}}catch(g){console.log(g)}finally{y(!1)}}})()},[n]);const S=()=>{m(null),o()},T=async()=>{if(!(!r||!i)){b(!0);try{await z({from:t==null?void 0:t.ref_id,to:r==null?void 0:r.ref_id}),t!=null&&t.ref_id&&(i[t==null?void 0:t.ref_id]={...i[t==null?void 0:t.ref_id],edgeList:[Z],edgeCount:i[t==null?void 0:t.ref_id].edgeCount-1},C.setState({ids:d.filter(a=>a!==r.ref_id),total:c-1})),S()}catch(a){console.warn(a)}finally{b(!1)}}};return e.jsx(H,{id:"mergeToNode",kind:"small",onClose:S,preventOutsideClose:!0,children:e.jsxs(Q,{...x,children:[j?e.jsx(p,{align:"center",my:24,children:e.jsx(I,{color:v.lightGray,size:24})}):e.jsx(J,{from:t,isSwapped:u,onSelect:m,selectedToNode:r,setIsSwapped:()=>w(!u)}),e.jsxs(de,{color:"secondary","data-testid":"merge-topics-button",disabled:h||!r,onClick:T,size:"large",variant:"contained",children:["Merge topics",h&&e.jsx(ce,{children:e.jsx(I,{color:v.BLUE_PRESS_STATE,size:12})})]})]})})},de=s($)` width: 293px !important; margin: 0 0 10px auto !important; `,ce=s.span` diff --git a/build/assets/index-9e4e320f.js b/build/assets/index-0dc61e70.js similarity index 84% rename from build/assets/index-9e4e320f.js rename to build/assets/index-0dc61e70.js index de69c87e0..4c00181a8 100644 --- a/build/assets/index-9e4e320f.js +++ b/build/assets/index-0dc61e70.js @@ -1,21 +1,21 @@ -import{r as b,a as $a,j as M,R as Zr,Y as hu,Q as Ve,S as qe,U as Ys,M as kn,N as du,a3 as bo,b1 as $d,b3 as Qd,a1 as Jt,O as nt,b4 as Eo,X as Kd,b5 as Jd,b6 as ef,b7 as tf,b8 as sf,b9 as nf,ba as rf,bb as of,bc as af,ad as $o,bd as cf,be as lf,ak as uf,bf as hf,b2 as df}from"./index-0cb90706.js";import{u as ge,a as Qa,e as Ka,b as wt,L as ff,c as pf,d as mf,m as _f,f as gf,g as vf,h as fu,H as dr,t as pu,T as yf,i as xf,j as Tf,D as kf,C as wf,P as Sf,k as Cf}from"./index-fc41172c.js";import{D as br,F as bf,V as K,a as Ne,T as Oo,b as Ef,C as ds,W as Of,c as Af,E as Ja,d as Tt,N as Zn,e as Mf,B as ci,U as _s,M as Df,f as Rf,g as Pf,h as If,i as Nf,j as Er,k as Ri,S as es,l as Ff,m as $,R as Uf,n as ks,o as ka,P as mu,p as ec,q as tl,r as Lf,L as Xr,s as zf,t as _u,u as gu,v as vu,w as yu,x as sl,y as Bf,z as Vf,A as Or,H as jf,G as Hf,I as qf,J as Wf,K as Gf,O as Yf,Q as fr}from"./three.module-a2e04964.js";import{T as Zf,B as xu,_ as Fe,a as jt,u as tc,b as nl,A as Xf,D as $f,c as Qf,M as Kf,d as Jf,P as ep,e as tp,f as sp,g as np,h as ip,O as rp,i as op}from"./index-7a7c9631.js";function ap(n){let e;const t=new Set,s=(l,u)=>{const h=typeof l=="function"?l(e):l;if(h!==e){const d=e;e=u?h:Object.assign({},e,h),t.forEach(f=>f(e,d))}},i=()=>e,r=(l,u=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(e);function f(){const m=u(e);if(!h(d,m)){const p=d;l(d=m,p)}}return t.add(f),()=>t.delete(f)},c={setState:s,getState:i,subscribe:(l,u,h)=>u||h?r(l,u,h):(t.add(l),()=>t.delete(l)),destroy:()=>t.clear()};return e=n(s,i,c),c}const cp=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),il=cp?b.useEffect:b.useLayoutEffect;function lp(n){const e=typeof n=="function"?ap(n):n,t=(s=e.getState,i=Object.is)=>{const[,r]=b.useReducer(g=>g+1,0),o=e.getState(),a=b.useRef(o),c=b.useRef(s),l=b.useRef(i),u=b.useRef(!1),h=b.useRef();h.current===void 0&&(h.current=s(o));let d,f=!1;(a.current!==o||c.current!==s||l.current!==i||u.current)&&(d=s(o),f=!i(h.current,d)),il(()=>{f&&(h.current=d),a.current=o,c.current=s,l.current=i,u.current=!1});const m=b.useRef(o);il(()=>{const g=()=>{try{const w=e.getState(),S=c.current(w);l.current(h.current,S)||(a.current=w,h.current=S,r())}catch{u.current=!0,r()}},y=e.subscribe(g);return e.getState()!==m.current&&g(),y},[]);const p=f?d:h.current;return b.useDebugValue(p),p};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const s=[t,e];return{next(){const i=s.length<=0;return{value:s.shift(),done:i}}}},t}let mi=0;const up=lp(n=>(br.onStart=(e,t,s)=>{n({active:!0,item:e,loaded:t,total:s,progress:(t-mi)/(s-mi)*100})},br.onLoad=()=>{n({active:!1})},br.onError=e=>n(t=>({errors:[...t.errors,e]})),br.onProgress=(e,t,s)=>{t===s&&(mi=s),n({active:!0,item:e,loaded:t,total:s,progress:(t-mi)/(s-mi)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})),hp=n=>`Loading ${n.toFixed(2)}%`;function dp({containerStyles:n,innerStyles:e,barStyles:t,dataStyles:s,dataInterpolation:i=hp,initialState:r=o=>o}){const{active:o,progress:a}=up(),c=b.useRef(0),l=b.useRef(0),u=b.useRef(null),[h,d]=b.useState(r(o));b.useEffect(()=>{let m;return o!==h&&(m=setTimeout(()=>d(o),300)),()=>clearTimeout(m)},[h,o]);const f=b.useCallback(()=>{u.current&&(c.current+=(a-c.current)/2,(c.current>.95*a||a===100)&&(c.current=a),u.current.innerText=i(c.current),c.current(f(),()=>cancelAnimationFrame(l.current)),[f]),h?b.createElement("div",{style:{...Ar.container,opacity:o?1:0,...n}},b.createElement("div",null,b.createElement("div",{style:{...Ar.inner,...e}},b.createElement("div",{style:{...Ar.bar,transform:`scaleX(${a/100})`,...t}}),b.createElement("span",{ref:u,style:{...Ar.data,...s}})))):null}const Ar={container:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"#171717",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 300ms ease",zIndex:1e3},inner:{width:100,height:3,background:"#272727",textAlign:"center"},bar:{height:3,width:"100%",background:"white",transition:"transform 200ms",transformOrigin:"left center"},data:{display:"inline-block",position:"relative",fontVariantNumeric:"tabular-nums",marginTop:"0.8em",color:"#f0f0f0",fontSize:"0.6em",fontFamily:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Helvetica, Arial, Roboto, Ubuntu, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',whiteSpace:"nowrap"}};let _i;function fp(){var n;if(_i!==void 0)return _i;try{let e;const t=document.createElement("canvas");return _i=!!(window.WebGL2RenderingContext&&(e=t.getContext("webgl2"))),e&&((n=e.getExtension("WEBGL_lose_context"))==null||n.loseContext()),_i}catch{return _i=!1}}const Qo=new bf,Ko=new K,An=new K,It=new K,is=new K,Wt=new K,rs=new K,os=new K,gi=new K,vi=new K,yi=new K,Mr=new K,xi=new K,Ti=new K,ki=new K;class pp{constructor(e,t,s){this.camera=e,this.scene=t,this.startPoint=new K,this.endPoint=new K,this.collection=[],this.deep=s||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(Qo,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){An.copy(e),An.x=Math.min(e.x,t.x),An.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),It.setFromMatrixPosition(this.camera.matrixWorld),is.copy(An),Wt.set(t.x,An.y,0),rs.copy(t),os.set(An.x,t.y,0),is.unproject(this.camera),Wt.unproject(this.camera),rs.unproject(this.camera),os.unproject(this.camera),xi.copy(is).sub(It),Ti.copy(Wt).sub(It),ki.copy(rs).sub(It),xi.normalize(),Ti.normalize(),ki.normalize(),xi.multiplyScalar(this.deep),Ti.multiplyScalar(this.deep),ki.multiplyScalar(this.deep),xi.add(It),Ti.add(It),ki.add(It);var s=Qo.planes;s[0].setFromCoplanarPoints(It,is,Wt),s[1].setFromCoplanarPoints(It,Wt,rs),s[2].setFromCoplanarPoints(rs,os,It),s[3].setFromCoplanarPoints(os,is,It),s[4].setFromCoplanarPoints(Wt,rs,os),s[5].setFromCoplanarPoints(ki,Ti,xi),s[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const i=Math.min(e.x,t.x),r=Math.max(e.y,t.y),o=Math.max(e.x,t.x),a=Math.min(e.y,t.y);is.set(i,r,-1),Wt.set(o,r,-1),rs.set(o,a,-1),os.set(i,a,-1),gi.set(i,r,1),vi.set(o,r,1),yi.set(o,a,1),Mr.set(i,a,1),is.unproject(this.camera),Wt.unproject(this.camera),rs.unproject(this.camera),os.unproject(this.camera),gi.unproject(this.camera),vi.unproject(this.camera),yi.unproject(this.camera),Mr.unproject(this.camera);var s=Qo.planes;s[0].setFromCoplanarPoints(is,gi,vi),s[1].setFromCoplanarPoints(Wt,vi,yi),s[2].setFromCoplanarPoints(yi,Mr,os),s[3].setFromCoplanarPoints(Mr,gi,is),s[4].setFromCoplanarPoints(Wt,rs,os),s[5].setFromCoplanarPoints(yi,vi,gi),s[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&t.material!==void 0&&(t.geometry.boundingSphere===null&&t.geometry.computeBoundingSphere(),Ko.copy(t.geometry.boundingSphere.center),Ko.applyMatrix4(t.matrixWorld),e.containsPoint(Ko)&&this.collection.push(t)),t.children.length>0)for(let s=0;sc,...a}){const{setEvents:c,camera:l,raycaster:u,gl:h,controls:d,size:f,get:m}=ge(),[p,g]=b.useState(!1),[y,w]=b.useReducer((T,{object:x,shift:k})=>x===void 0?[]:Array.isArray(x)?x:k?T.includes(x)?T.filter(C=>C!==x):[x,...T]:T[0]===x?[]:[x],[]);b.useEffect(()=>void(s==null?void 0:s(y)),[y]);const S=b.useCallback(T=>{T.stopPropagation(),w({object:o([T.object])[0],shift:e&&T.shiftKey})},[]),v=b.useCallback(T=>!p&&w({}),[p]),_=b.useRef(null);return b.useEffect(()=>{if(!n||!e)return;const T=new pp(l,_.current),x=document.createElement("div");x.style.pointerEvents="none",x.style.border=i,x.style.backgroundColor=r,x.style.position="fixed";const k=new Ne,C=new Ne,E=new Ne,O=m().events.enabled,A=d==null?void 0:d.enabled;let R=!1;function P(z,Te){const{offsetX:ae,offsetY:X}=z,{width:me,height:Ye}=f;Te.set(ae/me*2-1,-(X/Ye)*2+1)}function F(z){var Te;d&&(d.enabled=!1),c({enabled:!1}),R=!0,(Te=h.domElement.parentElement)==null||Te.appendChild(x),x.style.left=`${z.clientX}px`,x.style.top=`${z.clientY}px`,x.style.width="0px",x.style.height="0px",k.x=z.clientX,k.y=z.clientY}function N(z){E.x=Math.max(k.x,z.clientX),E.y=Math.max(k.y,z.clientY),C.x=Math.min(k.x,z.clientX),C.y=Math.min(k.y,z.clientY),x.style.left=`${C.x}px`,x.style.top=`${C.y}px`,x.style.width=`${E.x-C.x}px`,x.style.height=`${E.y-C.y}px`}function U(){if(R){var z;d&&(d.enabled=A),c({enabled:O}),R=!1,(z=x.parentElement)==null||z.removeChild(x)}}function V(z){z.shiftKey&&(F(z),P(z,T.startPoint))}let B=[];function q(z){if(R){N(z),P(z,T.endPoint);const Te=T.select().sort(ae=>ae.uuid).filter(ae=>ae.isMesh);mp(Te,B)||(B=Te,w({object:o(Te)}))}}function j(z){R&&U()}return document.addEventListener("pointerdown",V,{passive:!0}),document.addEventListener("pointermove",q,{passive:!0,capture:!0}),document.addEventListener("pointerup",j,{passive:!0}),()=>{document.removeEventListener("pointerdown",V),document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",j)}},[f.width,f.height,u,l,d,h]),b.createElement("group",$a({ref:_,onClick:S,onPointerOver:()=>g(!0),onPointerOut:()=>g(!1),onPointerMissed:v},a),b.createElement(_p.Provider,{value:y},t))}const rl=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function cn(n,e){const t=ge(i=>i.gl),s=Qa(Oo,rl(n)?Object.values(n):n);if(b.useLayoutEffect(()=>{e==null||e(s)},[e]),b.useEffect(()=>{(Array.isArray(s)?s:[s]).forEach(t.initTexture)},[t,s]),rl(n)){const i=Object.keys(n),r={};return i.forEach(o=>Object.assign(r,{[o]:s[i.indexOf(o)]})),r}else return s}cn.preload=n=>Qa.preload(Oo,n);cn.clear=n=>Qa.clear(Oo,n);/*! +import{r as b,a as $a,j as M,R as Zr,Y as hu,Q as Ve,S as qe,U as Ys,M as kn,N as du,a3 as bo,b1 as $d,b3 as Qd,a1 as Jt,O as nt,b4 as Eo,X as Kd,b5 as Jd,b6 as ef,b7 as tf,b8 as sf,b9 as nf,ba as rf,bb as of,bc as af,ad as $o,bd as cf,be as lf,ak as uf,bf as hf,b2 as df}from"./index-ead79979.js";import{u as ge,a as Qa,e as Ka,b as wt,L as ff,c as pf,d as mf,m as _f,f as gf,g as vf,h as fu,H as dr,t as pu,T as yf,i as xf,j as Tf,D as kf,C as wf,P as Sf,k as Cf}from"./index-8d2e6a42.js";import{D as br,F as bf,V as K,a as Ne,T as Oo,b as Ef,C as ds,W as Of,c as Af,E as Ja,d as Tt,N as Zn,e as Mf,B as ci,U as _s,M as Df,f as Rf,g as Pf,h as If,i as Nf,j as Er,k as Ri,S as es,l as Ff,m as $,R as Uf,n as ks,o as ka,P as mu,p as ec,q as tl,r as Lf,L as Xr,s as zf,t as _u,u as gu,v as vu,w as yu,x as sl,y as Bf,z as Vf,A as Or,H as jf,G as Hf,I as qf,J as Wf,K as Gf,O as Yf,Q as fr}from"./three.module-a2e04964.js";import{T as Zf,B as xu,_ as Fe,a as jt,u as tc,b as nl,A as Xf,D as $f,c as Qf,d as Kf,M as Jf,e as ep,P as tp,f as sp,g as np,h as ip,i as rp,O as op,j as ap}from"./index-74184c93.js";function cp(n){let e;const t=new Set,s=(l,u)=>{const h=typeof l=="function"?l(e):l;if(h!==e){const d=e;e=u?h:Object.assign({},e,h),t.forEach(f=>f(e,d))}},i=()=>e,r=(l,u=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(e);function f(){const m=u(e);if(!h(d,m)){const p=d;l(d=m,p)}}return t.add(f),()=>t.delete(f)},c={setState:s,getState:i,subscribe:(l,u,h)=>u||h?r(l,u,h):(t.add(l),()=>t.delete(l)),destroy:()=>t.clear()};return e=n(s,i,c),c}const lp=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),il=lp?b.useEffect:b.useLayoutEffect;function up(n){const e=typeof n=="function"?cp(n):n,t=(s=e.getState,i=Object.is)=>{const[,r]=b.useReducer(g=>g+1,0),o=e.getState(),a=b.useRef(o),c=b.useRef(s),l=b.useRef(i),u=b.useRef(!1),h=b.useRef();h.current===void 0&&(h.current=s(o));let d,f=!1;(a.current!==o||c.current!==s||l.current!==i||u.current)&&(d=s(o),f=!i(h.current,d)),il(()=>{f&&(h.current=d),a.current=o,c.current=s,l.current=i,u.current=!1});const m=b.useRef(o);il(()=>{const g=()=>{try{const w=e.getState(),S=c.current(w);l.current(h.current,S)||(a.current=w,h.current=S,r())}catch{u.current=!0,r()}},y=e.subscribe(g);return e.getState()!==m.current&&g(),y},[]);const p=f?d:h.current;return b.useDebugValue(p),p};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const s=[t,e];return{next(){const i=s.length<=0;return{value:s.shift(),done:i}}}},t}let mi=0;const hp=up(n=>(br.onStart=(e,t,s)=>{n({active:!0,item:e,loaded:t,total:s,progress:(t-mi)/(s-mi)*100})},br.onLoad=()=>{n({active:!1})},br.onError=e=>n(t=>({errors:[...t.errors,e]})),br.onProgress=(e,t,s)=>{t===s&&(mi=s),n({active:!0,item:e,loaded:t,total:s,progress:(t-mi)/(s-mi)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})),dp=n=>`Loading ${n.toFixed(2)}%`;function fp({containerStyles:n,innerStyles:e,barStyles:t,dataStyles:s,dataInterpolation:i=dp,initialState:r=o=>o}){const{active:o,progress:a}=hp(),c=b.useRef(0),l=b.useRef(0),u=b.useRef(null),[h,d]=b.useState(r(o));b.useEffect(()=>{let m;return o!==h&&(m=setTimeout(()=>d(o),300)),()=>clearTimeout(m)},[h,o]);const f=b.useCallback(()=>{u.current&&(c.current+=(a-c.current)/2,(c.current>.95*a||a===100)&&(c.current=a),u.current.innerText=i(c.current),c.current(f(),()=>cancelAnimationFrame(l.current)),[f]),h?b.createElement("div",{style:{...Ar.container,opacity:o?1:0,...n}},b.createElement("div",null,b.createElement("div",{style:{...Ar.inner,...e}},b.createElement("div",{style:{...Ar.bar,transform:`scaleX(${a/100})`,...t}}),b.createElement("span",{ref:u,style:{...Ar.data,...s}})))):null}const Ar={container:{position:"absolute",top:0,left:0,width:"100%",height:"100%",background:"#171717",display:"flex",alignItems:"center",justifyContent:"center",transition:"opacity 300ms ease",zIndex:1e3},inner:{width:100,height:3,background:"#272727",textAlign:"center"},bar:{height:3,width:"100%",background:"white",transition:"transform 200ms",transformOrigin:"left center"},data:{display:"inline-block",position:"relative",fontVariantNumeric:"tabular-nums",marginTop:"0.8em",color:"#f0f0f0",fontSize:"0.6em",fontFamily:'-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Helvetica Neue", Helvetica, Arial, Roboto, Ubuntu, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',whiteSpace:"nowrap"}};let _i;function pp(){var n;if(_i!==void 0)return _i;try{let e;const t=document.createElement("canvas");return _i=!!(window.WebGL2RenderingContext&&(e=t.getContext("webgl2"))),e&&((n=e.getExtension("WEBGL_lose_context"))==null||n.loseContext()),_i}catch{return _i=!1}}const Qo=new bf,Ko=new K,An=new K,It=new K,is=new K,Wt=new K,rs=new K,os=new K,gi=new K,vi=new K,yi=new K,Mr=new K,xi=new K,Ti=new K,ki=new K;class mp{constructor(e,t,s){this.camera=e,this.scene=t,this.startPoint=new K,this.endPoint=new K,this.collection=[],this.deep=s||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(Qo,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){An.copy(e),An.x=Math.min(e.x,t.x),An.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),It.setFromMatrixPosition(this.camera.matrixWorld),is.copy(An),Wt.set(t.x,An.y,0),rs.copy(t),os.set(An.x,t.y,0),is.unproject(this.camera),Wt.unproject(this.camera),rs.unproject(this.camera),os.unproject(this.camera),xi.copy(is).sub(It),Ti.copy(Wt).sub(It),ki.copy(rs).sub(It),xi.normalize(),Ti.normalize(),ki.normalize(),xi.multiplyScalar(this.deep),Ti.multiplyScalar(this.deep),ki.multiplyScalar(this.deep),xi.add(It),Ti.add(It),ki.add(It);var s=Qo.planes;s[0].setFromCoplanarPoints(It,is,Wt),s[1].setFromCoplanarPoints(It,Wt,rs),s[2].setFromCoplanarPoints(rs,os,It),s[3].setFromCoplanarPoints(os,is,It),s[4].setFromCoplanarPoints(Wt,rs,os),s[5].setFromCoplanarPoints(ki,Ti,xi),s[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const i=Math.min(e.x,t.x),r=Math.max(e.y,t.y),o=Math.max(e.x,t.x),a=Math.min(e.y,t.y);is.set(i,r,-1),Wt.set(o,r,-1),rs.set(o,a,-1),os.set(i,a,-1),gi.set(i,r,1),vi.set(o,r,1),yi.set(o,a,1),Mr.set(i,a,1),is.unproject(this.camera),Wt.unproject(this.camera),rs.unproject(this.camera),os.unproject(this.camera),gi.unproject(this.camera),vi.unproject(this.camera),yi.unproject(this.camera),Mr.unproject(this.camera);var s=Qo.planes;s[0].setFromCoplanarPoints(is,gi,vi),s[1].setFromCoplanarPoints(Wt,vi,yi),s[2].setFromCoplanarPoints(yi,Mr,os),s[3].setFromCoplanarPoints(Mr,gi,is),s[4].setFromCoplanarPoints(Wt,rs,os),s[5].setFromCoplanarPoints(yi,vi,gi),s[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&t.material!==void 0&&(t.geometry.boundingSphere===null&&t.geometry.computeBoundingSphere(),Ko.copy(t.geometry.boundingSphere.center),Ko.applyMatrix4(t.matrixWorld),e.containsPoint(Ko)&&this.collection.push(t)),t.children.length>0)for(let s=0;sc,...a}){const{setEvents:c,camera:l,raycaster:u,gl:h,controls:d,size:f,get:m}=ge(),[p,g]=b.useState(!1),[y,w]=b.useReducer((T,{object:x,shift:k})=>x===void 0?[]:Array.isArray(x)?x:k?T.includes(x)?T.filter(C=>C!==x):[x,...T]:T[0]===x?[]:[x],[]);b.useEffect(()=>void(s==null?void 0:s(y)),[y]);const S=b.useCallback(T=>{T.stopPropagation(),w({object:o([T.object])[0],shift:e&&T.shiftKey})},[]),v=b.useCallback(T=>!p&&w({}),[p]),_=b.useRef(null);return b.useEffect(()=>{if(!n||!e)return;const T=new mp(l,_.current),x=document.createElement("div");x.style.pointerEvents="none",x.style.border=i,x.style.backgroundColor=r,x.style.position="fixed";const k=new Ne,C=new Ne,E=new Ne,O=m().events.enabled,A=d==null?void 0:d.enabled;let R=!1;function P(z,Te){const{offsetX:ae,offsetY:X}=z,{width:me,height:Ye}=f;Te.set(ae/me*2-1,-(X/Ye)*2+1)}function F(z){var Te;d&&(d.enabled=!1),c({enabled:!1}),R=!0,(Te=h.domElement.parentElement)==null||Te.appendChild(x),x.style.left=`${z.clientX}px`,x.style.top=`${z.clientY}px`,x.style.width="0px",x.style.height="0px",k.x=z.clientX,k.y=z.clientY}function N(z){E.x=Math.max(k.x,z.clientX),E.y=Math.max(k.y,z.clientY),C.x=Math.min(k.x,z.clientX),C.y=Math.min(k.y,z.clientY),x.style.left=`${C.x}px`,x.style.top=`${C.y}px`,x.style.width=`${E.x-C.x}px`,x.style.height=`${E.y-C.y}px`}function U(){if(R){var z;d&&(d.enabled=A),c({enabled:O}),R=!1,(z=x.parentElement)==null||z.removeChild(x)}}function V(z){z.shiftKey&&(F(z),P(z,T.startPoint))}let B=[];function q(z){if(R){N(z),P(z,T.endPoint);const Te=T.select().sort(ae=>ae.uuid).filter(ae=>ae.isMesh);_p(Te,B)||(B=Te,w({object:o(Te)}))}}function j(z){R&&U()}return document.addEventListener("pointerdown",V,{passive:!0}),document.addEventListener("pointermove",q,{passive:!0,capture:!0}),document.addEventListener("pointerup",j,{passive:!0}),()=>{document.removeEventListener("pointerdown",V),document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",j)}},[f.width,f.height,u,l,d,h]),b.createElement("group",$a({ref:_,onClick:S,onPointerOver:()=>g(!0),onPointerOut:()=>g(!1),onPointerMissed:v},a),b.createElement(gp.Provider,{value:y},t))}const rl=n=>n===Object(n)&&!Array.isArray(n)&&typeof n!="function";function cn(n,e){const t=ge(i=>i.gl),s=Qa(Oo,rl(n)?Object.values(n):n);if(b.useLayoutEffect(()=>{e==null||e(s)},[e]),b.useEffect(()=>{(Array.isArray(s)?s:[s]).forEach(t.initTexture)},[t,s]),rl(n)){const i=Object.keys(n),r={};return i.forEach(o=>Object.assign(r,{[o]:s[i.indexOf(o)]})),r}else return s}cn.preload=n=>Qa.preload(Oo,n);cn.clear=n=>Qa.clear(Oo,n);/*! * camera-controls * https://github.com/yomotsu/camera-controls * (c) 2017 @yomotsu * Released under the MIT License. - */const Z={LEFT:1,RIGHT:2,MIDDLE:4},D=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),Mn={NONE:0,IN:1,OUT:-1};function Js(n){return n.isPerspectiveCamera}function Ms(n){return n.isOrthographicCamera}const Dn=Math.PI*2,ol=Math.PI/2,Tu=1e-5,wi=Math.PI/180;function Nt(n,e,t){return Math.max(e,Math.min(t,n))}function _e(n,e=Tu){return Math.abs(n)0==f>u&&(f=u,t.value=(f-u)/r),f}function cl(n,e,t,s,i=1/0,r,o){s=Math.max(1e-4,s);const a=2/s,c=a*r,l=1/(1+c+.48*c*c+.235*c*c*c);let u=e.x,h=e.y,d=e.z,f=n.x-u,m=n.y-h,p=n.z-d;const g=u,y=h,w=d,S=i*s,v=S*S,_=f*f+m*m+p*p;if(_>v){const F=Math.sqrt(_);f=f/F*S,m=m/F*S,p=p/F*S}u=n.x-f,h=n.y-m,d=n.z-p;const T=(t.x+a*f)*r,x=(t.y+a*m)*r,k=(t.z+a*p)*r;t.x=(t.x-a*T)*l,t.y=(t.y-a*x)*l,t.z=(t.z-a*k)*l,o.x=u+(f+T)*l,o.y=h+(m+x)*l,o.z=d+(p+k)*l;const C=g-n.x,E=y-n.y,O=w-n.z,A=o.x-g,R=o.y-y,P=o.z-w;return C*A+E*R+O*P>0&&(o.x=g,o.y=y,o.z=w,t.x=(o.x-g)/r,t.y=(o.y-y)/r,t.z=(o.z-w)/r),o}function Jo(n,e){e.set(0,0),n.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=n.length,e.y/=n.length}function ea(n,e){return Ms(n)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class vp{constructor(){this._listeners={}}addEventListener(e,t){const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let r=0,o=i.length;r{},this._enabled=!0,this._state=D.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Mn.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new G.Vector3,this._focalOffsetVelocity=new G.Vector3,this._zoomVelocity={value:0},this._truckInternal=(v,_,T)=>{let x,k;if(Js(this._camera)){const C=J.copy(this._camera.position).sub(this._target),E=this._camera.getEffectiveFOV()*wi,O=C.length()*Math.tan(E*.5);x=this.truckSpeed*v*O/this._elementRect.height,k=this.truckSpeed*_*O/this._elementRect.height}else if(Ms(this._camera)){const C=this._camera;x=v*(C.right-C.left)/C.zoom/this._elementRect.width,k=_*(C.top-C.bottom)/C.zoom/this._elementRect.height}else return;this.verticalDragToForward?(T?this.setFocalOffset(this._focalOffsetEnd.x+x,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(x,0,!0),this.forward(-k,!0)):T?this.setFocalOffset(this._focalOffsetEnd.x+x,this._focalOffsetEnd.y+k,this._focalOffsetEnd.z,!0):this.truck(x,k,!0)},this._rotateInternal=(v,_)=>{const T=Dn*this.azimuthRotateSpeed*v/this._elementRect.height,x=Dn*this.polarRotateSpeed*_/this._elementRect.height;this.rotate(T,x,!0)},this._dollyInternal=(v,_,T)=>{const x=Math.pow(.95,-v*this.dollySpeed),k=this._sphericalEnd.radius,C=this._sphericalEnd.radius*x,E=Nt(C,this.minDistance,this.maxDistance),O=E-C;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(C,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(O,!0),this._dollyToNoClamp(E,!0)):this._dollyToNoClamp(E,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?C:E)-k,this._dollyControlCoord.set(_,T)),this._lastDollyDirection=Math.sign(-v)},this._zoomInternal=(v,_,T)=>{const x=Math.pow(.95,v*this.dollySpeed),k=this._zoom,C=this._zoom*x;this.zoomTo(C,!0),this.dollyToCursor&&(this._changedZoom+=C-k,this._dollyControlCoord.set(_,T))},typeof G>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new G.Quaternion().setFromUnitVectors(this._camera.up,Pr),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=D.NONE,this._target=new G.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new G.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new G.Spherical().setFromVector3(J.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new G.Vector3,new G.Vector3,new G.Vector3,new G.Vector3],this._updateNearPlaneCorners(),this._boundary=new G.Box3(new G.Vector3(-1/0,-1/0,-1/0),new G.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new G.Vector2,this.mouseButtons={left:D.ROTATE,middle:D.DOLLY,right:D.TRUCK,wheel:Js(this._camera)?D.DOLLY:Ms(this._camera)?D.ZOOM:D.NONE},this.touches={one:D.TOUCH_ROTATE,two:Js(this._camera)?D.TOUCH_DOLLY_TRUCK:Ms(this._camera)?D.TOUCH_ZOOM_TRUCK:D.NONE,three:D.TOUCH_TRUCK};const s=new G.Vector2,i=new G.Vector2,r=new G.Vector2,o=v=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const x=this._domElement.getBoundingClientRect(),k=v.clientX/x.width,C=v.clientY/x.height;if(kthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const _=v.pointerType!=="mouse"?null:(v.buttons&Z.LEFT)===Z.LEFT?Z.LEFT:(v.buttons&Z.MIDDLE)===Z.MIDDLE?Z.MIDDLE:(v.buttons&Z.RIGHT)===Z.RIGHT?Z.RIGHT:null;if(_!==null){const x=this._findPointerByMouseButton(_);x&&this._disposePointer(x)}if((v.buttons&Z.LEFT)===Z.LEFT&&this._lockedPointer)return;const T={pointerId:v.pointerId,clientX:v.clientX,clientY:v.clientY,deltaX:0,deltaY:0,mouseButton:_};this._activePointers.push(T),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",u),this._isDragging=!0,p(v)},a=v=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const x=this._domElement.getBoundingClientRect(),k=v.clientX/x.width,C=v.clientY/x.height;if(kthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const _=(v.buttons&Z.LEFT)===Z.LEFT?Z.LEFT:(v.buttons&Z.MIDDLE)===Z.MIDDLE?Z.MIDDLE:(v.buttons&Z.RIGHT)===Z.RIGHT?Z.RIGHT:null;if(_!==null){const x=this._findPointerByMouseButton(_);x&&this._disposePointer(x)}const T={pointerId:1,clientX:v.clientX,clientY:v.clientY,deltaX:0,deltaY:0,mouseButton:(v.buttons&Z.LEFT)===Z.LEFT?Z.LEFT:(v.buttons&Z.MIDDLE)===Z.LEFT?Z.MIDDLE:(v.buttons&Z.RIGHT)===Z.LEFT?Z.RIGHT:null};this._activePointers.push(T),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",h),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",h),this._isDragging=!0,p(v)},c=v=>{v.cancelable&&v.preventDefault();const _=v.pointerId,T=this._lockedPointer||this._findPointerById(_);if(T){if(T.clientX=v.clientX,T.clientY=v.clientY,T.deltaX=v.movementX,T.deltaY=v.movementY,this._state=0,v.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(v.buttons&Z.LEFT)===Z.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(v.buttons&Z.MIDDLE)===Z.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(v.buttons&Z.RIGHT)===Z.RIGHT&&(this._state=this._state|this.mouseButtons.right);g()}},l=v=>{const _=this._lockedPointer||this._findPointerById(1);_&&(_.clientX=v.clientX,_.clientY=v.clientY,_.deltaX=v.movementX,_.deltaY=v.movementY,this._state=0,(this._lockedPointer||(v.buttons&Z.LEFT)===Z.LEFT)&&(this._state=this._state|this.mouseButtons.left),(v.buttons&Z.MIDDLE)===Z.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(v.buttons&Z.RIGHT)===Z.RIGHT&&(this._state=this._state|this.mouseButtons.right),g())},u=v=>{const _=this._findPointerById(v.pointerId);if(!(_&&_===this._lockedPointer)){if(_&&this._disposePointer(_),v.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=D.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=D.NONE;y()}},h=()=>{const v=this._findPointerById(1);v&&v===this._lockedPointer||(v&&this._disposePointer(v),this._state=D.NONE,y())};let d=-1;const f=v=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===D.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const C=this._domElement.getBoundingClientRect(),E=v.clientX/C.width,O=v.clientY/C.height;if(Ethis._interactiveArea.right||Othis._interactiveArea.bottom)return}if(v.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===D.ROTATE||this.mouseButtons.wheel===D.TRUCK){const C=performance.now();d-C<1e3&&this._getClientRect(this._elementRect),d=C}const _=xp?-1:-3,T=v.deltaMode===1?v.deltaY/_:v.deltaY/(_*10),x=this.dollyToCursor?(v.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,k=this.dollyToCursor?(v.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case D.ROTATE:{this._rotateInternal(v.deltaX,v.deltaY),this._isUserControllingRotate=!0;break}case D.TRUCK:{this._truckInternal(v.deltaX,v.deltaY,!1),this._isUserControllingTruck=!0;break}case D.OFFSET:{this._truckInternal(v.deltaX,v.deltaY,!0),this._isUserControllingOffset=!0;break}case D.DOLLY:{this._dollyInternal(-T,x,k),this._isUserControllingDolly=!0;break}case D.ZOOM:{this._zoomInternal(-T,x,k),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},m=v=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===wa.ACTION.NONE){const _=v instanceof PointerEvent?v.pointerId:(v instanceof MouseEvent,0),T=this._findPointerById(_);T&&this._disposePointer(T),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",h);return}v.preventDefault()}},p=v=>{if(!this._enabled)return;if(Jo(this._activePointers,ot),this._getClientRect(this._elementRect),s.copy(ot),i.copy(ot),this._activePointers.length>=2){const T=ot.x-this._activePointers[1].clientX,x=ot.y-this._activePointers[1].clientY,k=Math.sqrt(T*T+x*x);r.set(0,k);const C=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,E=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(C,E)}if(this._state=0,!v)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in v&&v.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(v.buttons&Z.LEFT)===Z.LEFT&&(this._state=this._state|this.mouseButtons.left),(v.buttons&Z.MIDDLE)===Z.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(v.buttons&Z.RIGHT)===Z.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&D.ROTATE)===D.ROTATE||(this._state&D.TOUCH_ROTATE)===D.TOUCH_ROTATE||(this._state&D.TOUCH_DOLLY_ROTATE)===D.TOUCH_DOLLY_ROTATE||(this._state&D.TOUCH_ZOOM_ROTATE)===D.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&D.TRUCK)===D.TRUCK||(this._state&D.TOUCH_TRUCK)===D.TOUCH_TRUCK||(this._state&D.TOUCH_DOLLY_TRUCK)===D.TOUCH_DOLLY_TRUCK||(this._state&D.TOUCH_ZOOM_TRUCK)===D.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&D.DOLLY)===D.DOLLY||(this._state&D.TOUCH_DOLLY)===D.TOUCH_DOLLY||(this._state&D.TOUCH_DOLLY_TRUCK)===D.TOUCH_DOLLY_TRUCK||(this._state&D.TOUCH_DOLLY_OFFSET)===D.TOUCH_DOLLY_OFFSET||(this._state&D.TOUCH_DOLLY_ROTATE)===D.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&D.ZOOM)===D.ZOOM||(this._state&D.TOUCH_ZOOM)===D.TOUCH_ZOOM||(this._state&D.TOUCH_ZOOM_TRUCK)===D.TOUCH_ZOOM_TRUCK||(this._state&D.TOUCH_ZOOM_OFFSET)===D.TOUCH_ZOOM_OFFSET||(this._state&D.TOUCH_ZOOM_ROTATE)===D.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&D.OFFSET)===D.OFFSET||(this._state&D.TOUCH_OFFSET)===D.TOUCH_OFFSET||(this._state&D.TOUCH_DOLLY_OFFSET)===D.TOUCH_DOLLY_OFFSET||(this._state&D.TOUCH_ZOOM_OFFSET)===D.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},g=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Jo(this._activePointers,ot);const _=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,T=_?-_.deltaX:i.x-ot.x,x=_?-_.deltaY:i.y-ot.y;if(i.copy(ot),((this._state&D.ROTATE)===D.ROTATE||(this._state&D.TOUCH_ROTATE)===D.TOUCH_ROTATE||(this._state&D.TOUCH_DOLLY_ROTATE)===D.TOUCH_DOLLY_ROTATE||(this._state&D.TOUCH_ZOOM_ROTATE)===D.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(T,x),this._isUserControllingRotate=!0),(this._state&D.DOLLY)===D.DOLLY||(this._state&D.ZOOM)===D.ZOOM){const k=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,C=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,E=this.dollyDragInverted?-1:1;(this._state&D.DOLLY)===D.DOLLY?(this._dollyInternal(E*x*Rr,k,C),this._isUserControllingDolly=!0):(this._zoomInternal(E*x*Rr,k,C),this._isUserControllingZoom=!0)}if((this._state&D.TOUCH_DOLLY)===D.TOUCH_DOLLY||(this._state&D.TOUCH_ZOOM)===D.TOUCH_ZOOM||(this._state&D.TOUCH_DOLLY_TRUCK)===D.TOUCH_DOLLY_TRUCK||(this._state&D.TOUCH_ZOOM_TRUCK)===D.TOUCH_ZOOM_TRUCK||(this._state&D.TOUCH_DOLLY_OFFSET)===D.TOUCH_DOLLY_OFFSET||(this._state&D.TOUCH_ZOOM_OFFSET)===D.TOUCH_ZOOM_OFFSET||(this._state&D.TOUCH_DOLLY_ROTATE)===D.TOUCH_DOLLY_ROTATE||(this._state&D.TOUCH_ZOOM_ROTATE)===D.TOUCH_ZOOM_ROTATE){const k=ot.x-this._activePointers[1].clientX,C=ot.y-this._activePointers[1].clientY,E=Math.sqrt(k*k+C*C),O=r.y-E;r.set(0,E);const A=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,R=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&D.TOUCH_DOLLY)===D.TOUCH_DOLLY||(this._state&D.TOUCH_DOLLY_ROTATE)===D.TOUCH_DOLLY_ROTATE||(this._state&D.TOUCH_DOLLY_TRUCK)===D.TOUCH_DOLLY_TRUCK||(this._state&D.TOUCH_DOLLY_OFFSET)===D.TOUCH_DOLLY_OFFSET?(this._dollyInternal(O*Rr,A,R),this._isUserControllingDolly=!0):(this._zoomInternal(O*Rr,A,R),this._isUserControllingZoom=!0)}((this._state&D.TRUCK)===D.TRUCK||(this._state&D.TOUCH_TRUCK)===D.TOUCH_TRUCK||(this._state&D.TOUCH_DOLLY_TRUCK)===D.TOUCH_DOLLY_TRUCK||(this._state&D.TOUCH_ZOOM_TRUCK)===D.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(T,x,!1),this._isUserControllingTruck=!0),((this._state&D.OFFSET)===D.OFFSET||(this._state&D.TOUCH_OFFSET)===D.TOUCH_OFFSET||(this._state&D.TOUCH_DOLLY_OFFSET)===D.TOUCH_DOLLY_OFFSET||(this._state&D.TOUCH_ZOOM_OFFSET)===D.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(T,x,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},y=()=>{Jo(this._activePointers,ot),i.copy(ot),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mouseup",h),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",w),this._domElement.ownerDocument.addEventListener("pointerlockerror",S),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",u),p())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",w),this._domElement.ownerDocument.removeEventListener("pointerlockerror",S))};const w=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},S=()=>{this.unlockPointer()};this._addAllEventListeners=v=>{this._domElement=v,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),Tp&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",u),this._domElement.addEventListener("wheel",f,{passive:!1}),this._domElement.addEventListener("contextmenu",m)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",a),this._domElement.removeEventListener("pointercancel",u),this._domElement.removeEventListener("wheel",f,{passive:!1}),this._domElement.removeEventListener("contextmenu",m),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mouseup",h),this._domElement.ownerDocument.removeEventListener("pointerlockchange",w),this._domElement.ownerDocument.removeEventListener("pointerlockerror",S))},this.cancel=()=>{this._state!==D.NONE&&(this._state=D.NONE,this._activePointers.length=0,y())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=Nt(e.width,0,1),this._interactiveArea.height=Nt(e.height,0,1),this._interactiveArea.x=Nt(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Nt(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,s=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,s)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,s=!1){this._isUserControllingRotate=!1;const i=Nt(e,this.minAzimuthAngle,this.maxAzimuthAngle),r=Nt(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=r,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!s||oe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&oe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Mn.NONE,this._changedDolly=0,this._dollyToNoClamp(Nt(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=oe(o,this._spherical.radius);if(!(s>e)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,o)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const r=!t||oe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(bi).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const s=!t||oe(this._target.x,this._targetEnd.x,this.restThreshold)&&oe(this._target.y,this._targetEnd.y,this.restThreshold)&&oe(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=Nt(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const s=!t||oe(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(e,t,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,s)}truck(e,t,s=!1){this._camera.updateMatrix(),Gt.setFromMatrixColumn(this._camera.matrix,0),Yt.setFromMatrixColumn(this._camera.matrix,1),Gt.multiplyScalar(e),Yt.multiplyScalar(-t);const i=J.copy(Gt).add(Yt),r=ne.copy(this._targetEnd).add(i);return this.moveTo(r.x,r.y,r.z,s)}forward(e,t=!1){J.setFromMatrixColumn(this._camera.matrix,0),J.crossVectors(this._camera.up,J),J.multiplyScalar(e);const s=ne.copy(this._targetEnd).add(J);return this.moveTo(s.x,s.y,s.z,t)}elevate(e,t=!1){return J.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+J.x,this._targetEnd.y+J.y,this._targetEnd.z+J.z,t)}moveTo(e,t,s,i=!1){this._isUserControllingTruck=!1;const r=J.set(e,t,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||oe(this._target.x,this._targetEnd.x,this.restThreshold)&&oe(this._target.y,this._targetEnd.y,this.restThreshold)&&oe(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,s,i=!1){const a=J.set(e,t,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(a.x,a.y,a.z,i)}fitToBox(e,t,{cover:s=!1,paddingLeft:i=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const c=[],l=e.isBox3?Pn.copy(e):Pn.setFromObject(e);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=al(this._sphericalEnd.theta,ol),h=al(this._sphericalEnd.phi,ol);c.push(this.rotateTo(u,h,t));const d=J.setFromSpherical(this._sphericalEnd).normalize(),f=fl.setFromUnitVectors(d,ta),m=oe(Math.abs(d.y),1);m&&f.multiply(na.setFromAxisAngle(Pr,u)),f.multiply(this._yAxisUpSpaceInverse);const p=dl.makeEmpty();ne.copy(l.min).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.min).setX(l.max.x).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.min).setY(l.max.y).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.max).setZ(l.min.z).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.min).setZ(l.max.z).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.max).setY(l.min.y).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.max).setX(l.min.x).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.max).applyQuaternion(f),p.expandByPoint(ne),p.min.x-=i,p.min.y-=o,p.max.x+=r,p.max.y+=a,f.setFromUnitVectors(ta,d),m&&f.premultiply(na.invert()),f.premultiply(this._yAxisUpSpace);const g=p.getSize(J),y=p.getCenter(ne).applyQuaternion(f);if(Js(this._camera)){const w=this.getDistanceToFitBox(g.x,g.y,g.z,s);c.push(this.moveTo(y.x,y.y,y.z,t)),c.push(this.dollyTo(w,t)),c.push(this.setFocalOffset(0,0,0,t))}else if(Ms(this._camera)){const w=this._camera,S=w.right-w.left,v=w.top-w.bottom,_=s?Math.max(S/g.x,v/g.y):Math.min(S/g.x,v/g.y);c.push(this.moveTo(y.x,y.y,y.z,t)),c.push(this.zoomTo(_,t)),c.push(this.setFocalOffset(0,0,0,t))}return Promise.all(c)}fitToSphere(e,t){const s=[],r=e instanceof G.Sphere?sa.copy(e):wa.createBoundingSphere(e,sa);if(s.push(this.moveTo(r.center.x,r.center.y,r.center.z,t)),Js(this._camera)){const o=this.getDistanceToFitSphere(r.radius);s.push(this.dollyTo(o,t))}else if(Ms(this._camera)){const o=this._camera.right-this._camera.left,a=this._camera.top-this._camera.bottom,c=2*r.radius,l=Math.min(o/c,a/c);s.push(this.zoomTo(l,t))}return s.push(this.setFocalOffset(0,0,0,t)),Promise.all(s)}setLookAt(e,t,s,i,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Mn.NONE,this._changedDolly=0;const c=ne.set(i,r,o),l=J.set(e,t,s);this._targetEnd.copy(c),this._sphericalEnd.setFromVector3(l.sub(c).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!a||oe(this._target.x,this._targetEnd.x,this.restThreshold)&&oe(this._target.y,this._targetEnd.y,this.restThreshold)&&oe(this._target.z,this._targetEnd.z,this.restThreshold)&&oe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&oe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&oe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(e,t,s,i,r,o,a,c,l,u,h,d,f,m=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Mn.NONE,this._changedDolly=0;const p=J.set(i,r,o),g=ne.set(e,t,s);Ct.setFromVector3(g.sub(p).applyQuaternion(this._yAxisUpSpace));const y=Rn.set(u,h,d),w=ne.set(a,c,l);Ei.setFromVector3(w.sub(y).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(p.lerp(y,f));const S=Ei.theta-Ct.theta,v=Ei.phi-Ct.phi,_=Ei.radius-Ct.radius;this._sphericalEnd.set(Ct.radius+_*f,Ct.phi+v*f,Ct.theta+S*f),this.normalizeRotations(),this._needsUpdate=!0,m||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const T=!m||oe(this._target.x,this._targetEnd.x,this.restThreshold)&&oe(this._target.y,this._targetEnd.y,this.restThreshold)&&oe(this._target.z,this._targetEnd.z,this.restThreshold)&&oe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&oe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&oe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(T)}setPosition(e,t,s,i=!1){return this.setLookAt(e,t,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(e,t,s,i=!1){const r=this.getPosition(J),o=this.setLookAt(r.x,r.y,r.z,e,t,s,i);return this._sphericalEnd.phi=Nt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const r=!i||oe(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&oe(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&oe(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(e,t,s){this._camera.updateMatrixWorld(),Gt.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Yt.setFromMatrixColumn(this._camera.matrixWorldInverse,1),en.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=J.set(e,t,s),r=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);Gt.multiplyScalar(o.x),Yt.multiplyScalar(o.y),en.multiplyScalar(o.z),J.copy(Gt).add(Yt).add(en),J.z=J.z+r,this.dollyTo(r,!1),this.setFocalOffset(-J.x,J.y,-J.z,!1),this.moveTo(e,t,s,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,s,i){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new G.Vector4,typeof e=="number"?this._viewport.set(e,t,s,i):this._viewport.copy(e)}getDistanceToFitBox(e,t,s,i=!1){if(ea(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=e/t,o=this._camera.getEffectiveFOV()*wi,a=this._camera.aspect;return((i?r>a:rt.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,s){const i=t.lengthSq();if(i===0)return e;const r=ne.copy(t).add(e),a=this._boundary.clampPoint(r,Rn).sub(r),c=a.lengthSq();if(c===0)return e.add(t);if(c===i)return e;if(s===0)return e.add(t).add(a);{const l=1+s*c/t.dot(a);return e.add(ne.copy(t).multiplyScalar(l)).add(a.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Js(this._camera)){const e=this._camera,t=e.near,s=e.getEffectiveFOV()*wi,i=Math.tan(s*.5)*t,r=i*e.aspect;this._nearPlaneCorners[0].set(-r,-i,0),this._nearPlaneCorners[1].set(r,-i,0),this._nearPlaneCorners[2].set(r,i,0),this._nearPlaneCorners[3].set(-r,i,0)}else if(Ms(this._camera)){const e=this._camera,t=1/e.zoom,s=e.left*t,i=e.right*t,r=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(s,r,0),this._nearPlaneCorners[1].set(i,r,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||ea(this._camera,"_collisionTest"))return e;const s=this._getTargetDirection(bi);ia.lookAt(ll,s,this._camera.up);for(let i=0;i<4;i++){const r=ne.copy(this._nearPlaneCorners[i]);r.applyMatrix4(ia);const o=Rn.addVectors(this._target,r);Ir.set(o,s),Ir.far=this._spherical.radius+1;const a=Ir.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{const s=()=>{this.removeEventListener("rest",s),t()};this.addEventListener("rest",s)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new G.Sphere){const s=t,i=s.center;Pn.makeEmpty(),e.traverseVisible(o=>{o.isMesh&&Pn.expandByObject(o)}),Pn.getCenter(i);let r=0;return e.traverseVisible(o=>{if(!o.isMesh)return;const a=o,c=a.geometry.clone();c.applyMatrix4(a.matrixWorld);const u=c.attributes.position;for(let h=0,d=u.count;h{b.useMemo(()=>{ra.install({THREE:Ef}),Ka({CameraControlsImpl:ra})},[]);const{camera:t,domElement:s,makeDefault:i,onStart:r,onEnd:o,onChange:a,regress:c,...l}=n,u=ge(_=>_.camera),h=ge(_=>_.gl),d=ge(_=>_.invalidate),f=ge(_=>_.events),m=ge(_=>_.setEvents),p=ge(_=>_.set),g=ge(_=>_.get),y=ge(_=>_.performance),w=t||u,S=s||f.connected||h.domElement,v=b.useMemo(()=>new ra(w),[w]);return wt((_,T)=>{v.enabled&&v.update(T)},-1),b.useEffect(()=>(v.connect(S),()=>void v.disconnect()),[S,v]),b.useEffect(()=>{const _=k=>{d(),c&&y.regress(),a&&a(k)},T=k=>{r&&r(k)},x=k=>{o&&o(k)};return v.addEventListener("update",_),v.addEventListener("controlstart",T),v.addEventListener("controlend",x),()=>{v.removeEventListener("update",_),v.removeEventListener("controlstart",T),v.removeEventListener("controlend",x)}},[v,r,o,d,m,c,a]),b.useEffect(()=>{if(i){const _=g().controls;return p({controls:v}),()=>p({controls:_})}},[i,v]),b.createElement("primitive",$a({ref:e,object:v},l))}),wu=b.createContext(null),wp=b.forwardRef((n,e)=>{b.useMemo(()=>Ka({SegmentObject:Sp}),[]);const{limit:t=1e3,lineWidth:s=1,children:i,...r}=n,[o,a]=b.useState([]),[c]=b.useState(()=>new ff),[l]=b.useState(()=>new pf),[u]=b.useState(()=>new mf),[h]=b.useState(()=>new Ne(512,512)),[d]=b.useState(()=>Array(t*6).fill(0)),[f]=b.useState(()=>Array(t*6).fill(0)),m=b.useMemo(()=>({subscribe:p=>(a(g=>[...g,p]),()=>a(g=>g.filter(y=>y.current!==p.current)))}),[]);return wt(()=>{for(let g=0;gn instanceof K?n:new K(...typeof n=="number"?[n,n,n]:n),Cp=b.forwardRef(({color:n,start:e,end:t},s)=>{const i=b.useContext(wu);if(!i)throw"Segment must used inside Segments component.";const r=b.useRef(null);return b.useLayoutEffect(()=>i.subscribe(r),[]),b.createElement("segmentObject",{ref:_f([r,s]),color:n,start:pl(e),end:pl(t)})});function bp({all:n,scene:e,camera:t}){const s=ge(({gl:o})=>o),i=ge(({camera:o})=>o),r=ge(({scene:o})=>o);return b.useLayoutEffect(()=>{const o=[];n&&(e||r).traverse(l=>{l.visible===!1&&(o.push(l),l.visible=!0)}),s.compile(e||r,t||i);const a=new Of(128);new Af(.01,1e5,a).update(s,e||r),a.dispose(),o.forEach(l=>l.visible=!1)},[]),null}function Ep({pixelated:n}){const e=ge(o=>o.gl),t=ge(o=>o.internal.active),s=ge(o=>o.performance.current),i=ge(o=>o.viewport.initialDpr),r=ge(o=>o.setDpr);return b.useEffect(()=>{const o=e.domElement;return()=>{t&&r(i),n&&o&&(o.style.imageRendering="auto")}},[]),b.useEffect(()=>{r(s*i),n&&e.domElement&&(e.domElement.style.imageRendering=s===1?"auto":"pixelated")},[s]),null}function Op(){const n=ge(s=>s.get),e=ge(s=>s.setEvents),t=ge(s=>s.performance.current);return b.useEffect(()=>{const s=n().events.enabled;return()=>e({enabled:s})},[]),b.useEffect(()=>e({enabled:t===1}),[t]),null}const sc=b.createContext(null);function Ap({children:n,enabled:e=!0}){const[t,s]=b.useState([]),i=b.useMemo(()=>({selected:t,select:s,enabled:e}),[t,s,e]);return M.jsx(sc.Provider,{value:i,children:n})}function Mp({enabled:n=!1,children:e,...t}){const s=b.useRef(null),i=b.useContext(sc);return b.useEffect(()=>{if(i&&n){let r=!1;const o=[];if(s.current.traverse(a=>{a.type==="Mesh"&&o.push(a),i.selected.indexOf(a)===-1&&(r=!0)}),r)return i.select(a=>[...a,...o]),()=>{i.select(a=>a.filter(c=>!o.includes(c)))}}},[n,e,i]),M.jsx("group",{ref:s,...t,children:e})}/** + */const Z={LEFT:1,RIGHT:2,MIDDLE:4},D=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),Mn={NONE:0,IN:1,OUT:-1};function Js(n){return n.isPerspectiveCamera}function Ms(n){return n.isOrthographicCamera}const Dn=Math.PI*2,ol=Math.PI/2,Tu=1e-5,wi=Math.PI/180;function Nt(n,e,t){return Math.max(e,Math.min(t,n))}function _e(n,e=Tu){return Math.abs(n)0==f>u&&(f=u,t.value=(f-u)/r),f}function cl(n,e,t,s,i=1/0,r,o){s=Math.max(1e-4,s);const a=2/s,c=a*r,l=1/(1+c+.48*c*c+.235*c*c*c);let u=e.x,h=e.y,d=e.z,f=n.x-u,m=n.y-h,p=n.z-d;const g=u,y=h,w=d,S=i*s,v=S*S,_=f*f+m*m+p*p;if(_>v){const F=Math.sqrt(_);f=f/F*S,m=m/F*S,p=p/F*S}u=n.x-f,h=n.y-m,d=n.z-p;const T=(t.x+a*f)*r,x=(t.y+a*m)*r,k=(t.z+a*p)*r;t.x=(t.x-a*T)*l,t.y=(t.y-a*x)*l,t.z=(t.z-a*k)*l,o.x=u+(f+T)*l,o.y=h+(m+x)*l,o.z=d+(p+k)*l;const C=g-n.x,E=y-n.y,O=w-n.z,A=o.x-g,R=o.y-y,P=o.z-w;return C*A+E*R+O*P>0&&(o.x=g,o.y=y,o.z=w,t.x=(o.x-g)/r,t.y=(o.y-y)/r,t.z=(o.z-w)/r),o}function Jo(n,e){e.set(0,0),n.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=n.length,e.y/=n.length}function ea(n,e){return Ms(n)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class yp{constructor(){this._listeners={}}addEventListener(e,t){const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let r=0,o=i.length;r{},this._enabled=!0,this._state=D.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Mn.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new G.Vector3,this._focalOffsetVelocity=new G.Vector3,this._zoomVelocity={value:0},this._truckInternal=(v,_,T)=>{let x,k;if(Js(this._camera)){const C=J.copy(this._camera.position).sub(this._target),E=this._camera.getEffectiveFOV()*wi,O=C.length()*Math.tan(E*.5);x=this.truckSpeed*v*O/this._elementRect.height,k=this.truckSpeed*_*O/this._elementRect.height}else if(Ms(this._camera)){const C=this._camera;x=v*(C.right-C.left)/C.zoom/this._elementRect.width,k=_*(C.top-C.bottom)/C.zoom/this._elementRect.height}else return;this.verticalDragToForward?(T?this.setFocalOffset(this._focalOffsetEnd.x+x,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(x,0,!0),this.forward(-k,!0)):T?this.setFocalOffset(this._focalOffsetEnd.x+x,this._focalOffsetEnd.y+k,this._focalOffsetEnd.z,!0):this.truck(x,k,!0)},this._rotateInternal=(v,_)=>{const T=Dn*this.azimuthRotateSpeed*v/this._elementRect.height,x=Dn*this.polarRotateSpeed*_/this._elementRect.height;this.rotate(T,x,!0)},this._dollyInternal=(v,_,T)=>{const x=Math.pow(.95,-v*this.dollySpeed),k=this._sphericalEnd.radius,C=this._sphericalEnd.radius*x,E=Nt(C,this.minDistance,this.maxDistance),O=E-C;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(C,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(O,!0),this._dollyToNoClamp(E,!0)):this._dollyToNoClamp(E,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?C:E)-k,this._dollyControlCoord.set(_,T)),this._lastDollyDirection=Math.sign(-v)},this._zoomInternal=(v,_,T)=>{const x=Math.pow(.95,v*this.dollySpeed),k=this._zoom,C=this._zoom*x;this.zoomTo(C,!0),this.dollyToCursor&&(this._changedZoom+=C-k,this._dollyControlCoord.set(_,T))},typeof G>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new G.Quaternion().setFromUnitVectors(this._camera.up,Pr),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=D.NONE,this._target=new G.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new G.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new G.Spherical().setFromVector3(J.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new G.Vector3,new G.Vector3,new G.Vector3,new G.Vector3],this._updateNearPlaneCorners(),this._boundary=new G.Box3(new G.Vector3(-1/0,-1/0,-1/0),new G.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new G.Vector2,this.mouseButtons={left:D.ROTATE,middle:D.DOLLY,right:D.TRUCK,wheel:Js(this._camera)?D.DOLLY:Ms(this._camera)?D.ZOOM:D.NONE},this.touches={one:D.TOUCH_ROTATE,two:Js(this._camera)?D.TOUCH_DOLLY_TRUCK:Ms(this._camera)?D.TOUCH_ZOOM_TRUCK:D.NONE,three:D.TOUCH_TRUCK};const s=new G.Vector2,i=new G.Vector2,r=new G.Vector2,o=v=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const x=this._domElement.getBoundingClientRect(),k=v.clientX/x.width,C=v.clientY/x.height;if(kthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const _=v.pointerType!=="mouse"?null:(v.buttons&Z.LEFT)===Z.LEFT?Z.LEFT:(v.buttons&Z.MIDDLE)===Z.MIDDLE?Z.MIDDLE:(v.buttons&Z.RIGHT)===Z.RIGHT?Z.RIGHT:null;if(_!==null){const x=this._findPointerByMouseButton(_);x&&this._disposePointer(x)}if((v.buttons&Z.LEFT)===Z.LEFT&&this._lockedPointer)return;const T={pointerId:v.pointerId,clientX:v.clientX,clientY:v.clientY,deltaX:0,deltaY:0,mouseButton:_};this._activePointers.push(T),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",u),this._isDragging=!0,p(v)},a=v=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const x=this._domElement.getBoundingClientRect(),k=v.clientX/x.width,C=v.clientY/x.height;if(kthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const _=(v.buttons&Z.LEFT)===Z.LEFT?Z.LEFT:(v.buttons&Z.MIDDLE)===Z.MIDDLE?Z.MIDDLE:(v.buttons&Z.RIGHT)===Z.RIGHT?Z.RIGHT:null;if(_!==null){const x=this._findPointerByMouseButton(_);x&&this._disposePointer(x)}const T={pointerId:1,clientX:v.clientX,clientY:v.clientY,deltaX:0,deltaY:0,mouseButton:(v.buttons&Z.LEFT)===Z.LEFT?Z.LEFT:(v.buttons&Z.MIDDLE)===Z.LEFT?Z.MIDDLE:(v.buttons&Z.RIGHT)===Z.LEFT?Z.RIGHT:null};this._activePointers.push(T),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",h),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",h),this._isDragging=!0,p(v)},c=v=>{v.cancelable&&v.preventDefault();const _=v.pointerId,T=this._lockedPointer||this._findPointerById(_);if(T){if(T.clientX=v.clientX,T.clientY=v.clientY,T.deltaX=v.movementX,T.deltaY=v.movementY,this._state=0,v.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(v.buttons&Z.LEFT)===Z.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(v.buttons&Z.MIDDLE)===Z.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(v.buttons&Z.RIGHT)===Z.RIGHT&&(this._state=this._state|this.mouseButtons.right);g()}},l=v=>{const _=this._lockedPointer||this._findPointerById(1);_&&(_.clientX=v.clientX,_.clientY=v.clientY,_.deltaX=v.movementX,_.deltaY=v.movementY,this._state=0,(this._lockedPointer||(v.buttons&Z.LEFT)===Z.LEFT)&&(this._state=this._state|this.mouseButtons.left),(v.buttons&Z.MIDDLE)===Z.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(v.buttons&Z.RIGHT)===Z.RIGHT&&(this._state=this._state|this.mouseButtons.right),g())},u=v=>{const _=this._findPointerById(v.pointerId);if(!(_&&_===this._lockedPointer)){if(_&&this._disposePointer(_),v.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=D.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=D.NONE;y()}},h=()=>{const v=this._findPointerById(1);v&&v===this._lockedPointer||(v&&this._disposePointer(v),this._state=D.NONE,y())};let d=-1;const f=v=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===D.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const C=this._domElement.getBoundingClientRect(),E=v.clientX/C.width,O=v.clientY/C.height;if(Ethis._interactiveArea.right||Othis._interactiveArea.bottom)return}if(v.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===D.ROTATE||this.mouseButtons.wheel===D.TRUCK){const C=performance.now();d-C<1e3&&this._getClientRect(this._elementRect),d=C}const _=Tp?-1:-3,T=v.deltaMode===1?v.deltaY/_:v.deltaY/(_*10),x=this.dollyToCursor?(v.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,k=this.dollyToCursor?(v.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case D.ROTATE:{this._rotateInternal(v.deltaX,v.deltaY),this._isUserControllingRotate=!0;break}case D.TRUCK:{this._truckInternal(v.deltaX,v.deltaY,!1),this._isUserControllingTruck=!0;break}case D.OFFSET:{this._truckInternal(v.deltaX,v.deltaY,!0),this._isUserControllingOffset=!0;break}case D.DOLLY:{this._dollyInternal(-T,x,k),this._isUserControllingDolly=!0;break}case D.ZOOM:{this._zoomInternal(-T,x,k),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},m=v=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===wa.ACTION.NONE){const _=v instanceof PointerEvent?v.pointerId:(v instanceof MouseEvent,0),T=this._findPointerById(_);T&&this._disposePointer(T),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",h);return}v.preventDefault()}},p=v=>{if(!this._enabled)return;if(Jo(this._activePointers,ot),this._getClientRect(this._elementRect),s.copy(ot),i.copy(ot),this._activePointers.length>=2){const T=ot.x-this._activePointers[1].clientX,x=ot.y-this._activePointers[1].clientY,k=Math.sqrt(T*T+x*x);r.set(0,k);const C=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,E=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(C,E)}if(this._state=0,!v)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in v&&v.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(v.buttons&Z.LEFT)===Z.LEFT&&(this._state=this._state|this.mouseButtons.left),(v.buttons&Z.MIDDLE)===Z.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(v.buttons&Z.RIGHT)===Z.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&D.ROTATE)===D.ROTATE||(this._state&D.TOUCH_ROTATE)===D.TOUCH_ROTATE||(this._state&D.TOUCH_DOLLY_ROTATE)===D.TOUCH_DOLLY_ROTATE||(this._state&D.TOUCH_ZOOM_ROTATE)===D.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&D.TRUCK)===D.TRUCK||(this._state&D.TOUCH_TRUCK)===D.TOUCH_TRUCK||(this._state&D.TOUCH_DOLLY_TRUCK)===D.TOUCH_DOLLY_TRUCK||(this._state&D.TOUCH_ZOOM_TRUCK)===D.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&D.DOLLY)===D.DOLLY||(this._state&D.TOUCH_DOLLY)===D.TOUCH_DOLLY||(this._state&D.TOUCH_DOLLY_TRUCK)===D.TOUCH_DOLLY_TRUCK||(this._state&D.TOUCH_DOLLY_OFFSET)===D.TOUCH_DOLLY_OFFSET||(this._state&D.TOUCH_DOLLY_ROTATE)===D.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&D.ZOOM)===D.ZOOM||(this._state&D.TOUCH_ZOOM)===D.TOUCH_ZOOM||(this._state&D.TOUCH_ZOOM_TRUCK)===D.TOUCH_ZOOM_TRUCK||(this._state&D.TOUCH_ZOOM_OFFSET)===D.TOUCH_ZOOM_OFFSET||(this._state&D.TOUCH_ZOOM_ROTATE)===D.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&D.OFFSET)===D.OFFSET||(this._state&D.TOUCH_OFFSET)===D.TOUCH_OFFSET||(this._state&D.TOUCH_DOLLY_OFFSET)===D.TOUCH_DOLLY_OFFSET||(this._state&D.TOUCH_ZOOM_OFFSET)===D.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},g=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Jo(this._activePointers,ot);const _=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,T=_?-_.deltaX:i.x-ot.x,x=_?-_.deltaY:i.y-ot.y;if(i.copy(ot),((this._state&D.ROTATE)===D.ROTATE||(this._state&D.TOUCH_ROTATE)===D.TOUCH_ROTATE||(this._state&D.TOUCH_DOLLY_ROTATE)===D.TOUCH_DOLLY_ROTATE||(this._state&D.TOUCH_ZOOM_ROTATE)===D.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(T,x),this._isUserControllingRotate=!0),(this._state&D.DOLLY)===D.DOLLY||(this._state&D.ZOOM)===D.ZOOM){const k=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,C=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,E=this.dollyDragInverted?-1:1;(this._state&D.DOLLY)===D.DOLLY?(this._dollyInternal(E*x*Rr,k,C),this._isUserControllingDolly=!0):(this._zoomInternal(E*x*Rr,k,C),this._isUserControllingZoom=!0)}if((this._state&D.TOUCH_DOLLY)===D.TOUCH_DOLLY||(this._state&D.TOUCH_ZOOM)===D.TOUCH_ZOOM||(this._state&D.TOUCH_DOLLY_TRUCK)===D.TOUCH_DOLLY_TRUCK||(this._state&D.TOUCH_ZOOM_TRUCK)===D.TOUCH_ZOOM_TRUCK||(this._state&D.TOUCH_DOLLY_OFFSET)===D.TOUCH_DOLLY_OFFSET||(this._state&D.TOUCH_ZOOM_OFFSET)===D.TOUCH_ZOOM_OFFSET||(this._state&D.TOUCH_DOLLY_ROTATE)===D.TOUCH_DOLLY_ROTATE||(this._state&D.TOUCH_ZOOM_ROTATE)===D.TOUCH_ZOOM_ROTATE){const k=ot.x-this._activePointers[1].clientX,C=ot.y-this._activePointers[1].clientY,E=Math.sqrt(k*k+C*C),O=r.y-E;r.set(0,E);const A=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,R=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&D.TOUCH_DOLLY)===D.TOUCH_DOLLY||(this._state&D.TOUCH_DOLLY_ROTATE)===D.TOUCH_DOLLY_ROTATE||(this._state&D.TOUCH_DOLLY_TRUCK)===D.TOUCH_DOLLY_TRUCK||(this._state&D.TOUCH_DOLLY_OFFSET)===D.TOUCH_DOLLY_OFFSET?(this._dollyInternal(O*Rr,A,R),this._isUserControllingDolly=!0):(this._zoomInternal(O*Rr,A,R),this._isUserControllingZoom=!0)}((this._state&D.TRUCK)===D.TRUCK||(this._state&D.TOUCH_TRUCK)===D.TOUCH_TRUCK||(this._state&D.TOUCH_DOLLY_TRUCK)===D.TOUCH_DOLLY_TRUCK||(this._state&D.TOUCH_ZOOM_TRUCK)===D.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(T,x,!1),this._isUserControllingTruck=!0),((this._state&D.OFFSET)===D.OFFSET||(this._state&D.TOUCH_OFFSET)===D.TOUCH_OFFSET||(this._state&D.TOUCH_DOLLY_OFFSET)===D.TOUCH_DOLLY_OFFSET||(this._state&D.TOUCH_ZOOM_OFFSET)===D.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(T,x,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},y=()=>{Jo(this._activePointers,ot),i.copy(ot),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mouseup",h),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",w),this._domElement.ownerDocument.addEventListener("pointerlockerror",S),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",u),p())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",w),this._domElement.ownerDocument.removeEventListener("pointerlockerror",S))};const w=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},S=()=>{this.unlockPointer()};this._addAllEventListeners=v=>{this._domElement=v,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),kp&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",u),this._domElement.addEventListener("wheel",f,{passive:!1}),this._domElement.addEventListener("contextmenu",m)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",a),this._domElement.removeEventListener("pointercancel",u),this._domElement.removeEventListener("wheel",f,{passive:!1}),this._domElement.removeEventListener("contextmenu",m),this._domElement.ownerDocument.removeEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",u),this._domElement.ownerDocument.removeEventListener("mouseup",h),this._domElement.ownerDocument.removeEventListener("pointerlockchange",w),this._domElement.ownerDocument.removeEventListener("pointerlockerror",S))},this.cancel=()=>{this._state!==D.NONE&&(this._state=D.NONE,this._activePointers.length=0,y())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=Nt(e.width,0,1),this._interactiveArea.height=Nt(e.height,0,1),this._interactiveArea.x=Nt(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Nt(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,s=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,s)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,s=!1){this._isUserControllingRotate=!1;const i=Nt(e,this.minAzimuthAngle,this.maxAzimuthAngle),r=Nt(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=r,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!s||oe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&oe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Mn.NONE,this._changedDolly=0,this._dollyToNoClamp(Nt(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=oe(o,this._spherical.radius);if(!(s>e)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,o)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const r=!t||oe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(bi).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const s=!t||oe(this._target.x,this._targetEnd.x,this.restThreshold)&&oe(this._target.y,this._targetEnd.y,this.restThreshold)&&oe(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=Nt(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const s=!t||oe(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(e,t,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,s)}truck(e,t,s=!1){this._camera.updateMatrix(),Gt.setFromMatrixColumn(this._camera.matrix,0),Yt.setFromMatrixColumn(this._camera.matrix,1),Gt.multiplyScalar(e),Yt.multiplyScalar(-t);const i=J.copy(Gt).add(Yt),r=ne.copy(this._targetEnd).add(i);return this.moveTo(r.x,r.y,r.z,s)}forward(e,t=!1){J.setFromMatrixColumn(this._camera.matrix,0),J.crossVectors(this._camera.up,J),J.multiplyScalar(e);const s=ne.copy(this._targetEnd).add(J);return this.moveTo(s.x,s.y,s.z,t)}elevate(e,t=!1){return J.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+J.x,this._targetEnd.y+J.y,this._targetEnd.z+J.z,t)}moveTo(e,t,s,i=!1){this._isUserControllingTruck=!1;const r=J.set(e,t,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||oe(this._target.x,this._targetEnd.x,this.restThreshold)&&oe(this._target.y,this._targetEnd.y,this.restThreshold)&&oe(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,s,i=!1){const a=J.set(e,t,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(a.x,a.y,a.z,i)}fitToBox(e,t,{cover:s=!1,paddingLeft:i=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const c=[],l=e.isBox3?Pn.copy(e):Pn.setFromObject(e);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=al(this._sphericalEnd.theta,ol),h=al(this._sphericalEnd.phi,ol);c.push(this.rotateTo(u,h,t));const d=J.setFromSpherical(this._sphericalEnd).normalize(),f=fl.setFromUnitVectors(d,ta),m=oe(Math.abs(d.y),1);m&&f.multiply(na.setFromAxisAngle(Pr,u)),f.multiply(this._yAxisUpSpaceInverse);const p=dl.makeEmpty();ne.copy(l.min).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.min).setX(l.max.x).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.min).setY(l.max.y).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.max).setZ(l.min.z).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.min).setZ(l.max.z).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.max).setY(l.min.y).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.max).setX(l.min.x).applyQuaternion(f),p.expandByPoint(ne),ne.copy(l.max).applyQuaternion(f),p.expandByPoint(ne),p.min.x-=i,p.min.y-=o,p.max.x+=r,p.max.y+=a,f.setFromUnitVectors(ta,d),m&&f.premultiply(na.invert()),f.premultiply(this._yAxisUpSpace);const g=p.getSize(J),y=p.getCenter(ne).applyQuaternion(f);if(Js(this._camera)){const w=this.getDistanceToFitBox(g.x,g.y,g.z,s);c.push(this.moveTo(y.x,y.y,y.z,t)),c.push(this.dollyTo(w,t)),c.push(this.setFocalOffset(0,0,0,t))}else if(Ms(this._camera)){const w=this._camera,S=w.right-w.left,v=w.top-w.bottom,_=s?Math.max(S/g.x,v/g.y):Math.min(S/g.x,v/g.y);c.push(this.moveTo(y.x,y.y,y.z,t)),c.push(this.zoomTo(_,t)),c.push(this.setFocalOffset(0,0,0,t))}return Promise.all(c)}fitToSphere(e,t){const s=[],r=e instanceof G.Sphere?sa.copy(e):wa.createBoundingSphere(e,sa);if(s.push(this.moveTo(r.center.x,r.center.y,r.center.z,t)),Js(this._camera)){const o=this.getDistanceToFitSphere(r.radius);s.push(this.dollyTo(o,t))}else if(Ms(this._camera)){const o=this._camera.right-this._camera.left,a=this._camera.top-this._camera.bottom,c=2*r.radius,l=Math.min(o/c,a/c);s.push(this.zoomTo(l,t))}return s.push(this.setFocalOffset(0,0,0,t)),Promise.all(s)}setLookAt(e,t,s,i,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Mn.NONE,this._changedDolly=0;const c=ne.set(i,r,o),l=J.set(e,t,s);this._targetEnd.copy(c),this._sphericalEnd.setFromVector3(l.sub(c).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!a||oe(this._target.x,this._targetEnd.x,this.restThreshold)&&oe(this._target.y,this._targetEnd.y,this.restThreshold)&&oe(this._target.z,this._targetEnd.z,this.restThreshold)&&oe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&oe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&oe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(e,t,s,i,r,o,a,c,l,u,h,d,f,m=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Mn.NONE,this._changedDolly=0;const p=J.set(i,r,o),g=ne.set(e,t,s);Ct.setFromVector3(g.sub(p).applyQuaternion(this._yAxisUpSpace));const y=Rn.set(u,h,d),w=ne.set(a,c,l);Ei.setFromVector3(w.sub(y).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(p.lerp(y,f));const S=Ei.theta-Ct.theta,v=Ei.phi-Ct.phi,_=Ei.radius-Ct.radius;this._sphericalEnd.set(Ct.radius+_*f,Ct.phi+v*f,Ct.theta+S*f),this.normalizeRotations(),this._needsUpdate=!0,m||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const T=!m||oe(this._target.x,this._targetEnd.x,this.restThreshold)&&oe(this._target.y,this._targetEnd.y,this.restThreshold)&&oe(this._target.z,this._targetEnd.z,this.restThreshold)&&oe(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&oe(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&oe(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(T)}setPosition(e,t,s,i=!1){return this.setLookAt(e,t,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(e,t,s,i=!1){const r=this.getPosition(J),o=this.setLookAt(r.x,r.y,r.z,e,t,s,i);return this._sphericalEnd.phi=Nt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const r=!i||oe(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&oe(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&oe(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(e,t,s){this._camera.updateMatrixWorld(),Gt.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Yt.setFromMatrixColumn(this._camera.matrixWorldInverse,1),en.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=J.set(e,t,s),r=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);Gt.multiplyScalar(o.x),Yt.multiplyScalar(o.y),en.multiplyScalar(o.z),J.copy(Gt).add(Yt).add(en),J.z=J.z+r,this.dollyTo(r,!1),this.setFocalOffset(-J.x,J.y,-J.z,!1),this.moveTo(e,t,s,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,s,i){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new G.Vector4,typeof e=="number"?this._viewport.set(e,t,s,i):this._viewport.copy(e)}getDistanceToFitBox(e,t,s,i=!1){if(ea(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=e/t,o=this._camera.getEffectiveFOV()*wi,a=this._camera.aspect;return((i?r>a:rt.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,s){const i=t.lengthSq();if(i===0)return e;const r=ne.copy(t).add(e),a=this._boundary.clampPoint(r,Rn).sub(r),c=a.lengthSq();if(c===0)return e.add(t);if(c===i)return e;if(s===0)return e.add(t).add(a);{const l=1+s*c/t.dot(a);return e.add(ne.copy(t).multiplyScalar(l)).add(a.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Js(this._camera)){const e=this._camera,t=e.near,s=e.getEffectiveFOV()*wi,i=Math.tan(s*.5)*t,r=i*e.aspect;this._nearPlaneCorners[0].set(-r,-i,0),this._nearPlaneCorners[1].set(r,-i,0),this._nearPlaneCorners[2].set(r,i,0),this._nearPlaneCorners[3].set(-r,i,0)}else if(Ms(this._camera)){const e=this._camera,t=1/e.zoom,s=e.left*t,i=e.right*t,r=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(s,r,0),this._nearPlaneCorners[1].set(i,r,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||ea(this._camera,"_collisionTest"))return e;const s=this._getTargetDirection(bi);ia.lookAt(ll,s,this._camera.up);for(let i=0;i<4;i++){const r=ne.copy(this._nearPlaneCorners[i]);r.applyMatrix4(ia);const o=Rn.addVectors(this._target,r);Ir.set(o,s),Ir.far=this._spherical.radius+1;const a=Ir.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{const s=()=>{this.removeEventListener("rest",s),t()};this.addEventListener("rest",s)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new G.Sphere){const s=t,i=s.center;Pn.makeEmpty(),e.traverseVisible(o=>{o.isMesh&&Pn.expandByObject(o)}),Pn.getCenter(i);let r=0;return e.traverseVisible(o=>{if(!o.isMesh)return;const a=o,c=a.geometry.clone();c.applyMatrix4(a.matrixWorld);const u=c.attributes.position;for(let h=0,d=u.count;h{b.useMemo(()=>{ra.install({THREE:Ef}),Ka({CameraControlsImpl:ra})},[]);const{camera:t,domElement:s,makeDefault:i,onStart:r,onEnd:o,onChange:a,regress:c,...l}=n,u=ge(_=>_.camera),h=ge(_=>_.gl),d=ge(_=>_.invalidate),f=ge(_=>_.events),m=ge(_=>_.setEvents),p=ge(_=>_.set),g=ge(_=>_.get),y=ge(_=>_.performance),w=t||u,S=s||f.connected||h.domElement,v=b.useMemo(()=>new ra(w),[w]);return wt((_,T)=>{v.enabled&&v.update(T)},-1),b.useEffect(()=>(v.connect(S),()=>void v.disconnect()),[S,v]),b.useEffect(()=>{const _=k=>{d(),c&&y.regress(),a&&a(k)},T=k=>{r&&r(k)},x=k=>{o&&o(k)};return v.addEventListener("update",_),v.addEventListener("controlstart",T),v.addEventListener("controlend",x),()=>{v.removeEventListener("update",_),v.removeEventListener("controlstart",T),v.removeEventListener("controlend",x)}},[v,r,o,d,m,c,a]),b.useEffect(()=>{if(i){const _=g().controls;return p({controls:v}),()=>p({controls:_})}},[i,v]),b.createElement("primitive",$a({ref:e,object:v},l))}),wu=b.createContext(null),Sp=b.forwardRef((n,e)=>{b.useMemo(()=>Ka({SegmentObject:Cp}),[]);const{limit:t=1e3,lineWidth:s=1,children:i,...r}=n,[o,a]=b.useState([]),[c]=b.useState(()=>new ff),[l]=b.useState(()=>new pf),[u]=b.useState(()=>new mf),[h]=b.useState(()=>new Ne(512,512)),[d]=b.useState(()=>Array(t*6).fill(0)),[f]=b.useState(()=>Array(t*6).fill(0)),m=b.useMemo(()=>({subscribe:p=>(a(g=>[...g,p]),()=>a(g=>g.filter(y=>y.current!==p.current)))}),[]);return wt(()=>{for(let g=0;gn instanceof K?n:new K(...typeof n=="number"?[n,n,n]:n),bp=b.forwardRef(({color:n,start:e,end:t},s)=>{const i=b.useContext(wu);if(!i)throw"Segment must used inside Segments component.";const r=b.useRef(null);return b.useLayoutEffect(()=>i.subscribe(r),[]),b.createElement("segmentObject",{ref:_f([r,s]),color:n,start:pl(e),end:pl(t)})});function Ep({all:n,scene:e,camera:t}){const s=ge(({gl:o})=>o),i=ge(({camera:o})=>o),r=ge(({scene:o})=>o);return b.useLayoutEffect(()=>{const o=[];n&&(e||r).traverse(l=>{l.visible===!1&&(o.push(l),l.visible=!0)}),s.compile(e||r,t||i);const a=new Of(128);new Af(.01,1e5,a).update(s,e||r),a.dispose(),o.forEach(l=>l.visible=!1)},[]),null}function Op({pixelated:n}){const e=ge(o=>o.gl),t=ge(o=>o.internal.active),s=ge(o=>o.performance.current),i=ge(o=>o.viewport.initialDpr),r=ge(o=>o.setDpr);return b.useEffect(()=>{const o=e.domElement;return()=>{t&&r(i),n&&o&&(o.style.imageRendering="auto")}},[]),b.useEffect(()=>{r(s*i),n&&e.domElement&&(e.domElement.style.imageRendering=s===1?"auto":"pixelated")},[s]),null}function Ap(){const n=ge(s=>s.get),e=ge(s=>s.setEvents),t=ge(s=>s.performance.current);return b.useEffect(()=>{const s=n().events.enabled;return()=>e({enabled:s})},[]),b.useEffect(()=>e({enabled:t===1}),[t]),null}const sc=b.createContext(null);function Mp({children:n,enabled:e=!0}){const[t,s]=b.useState([]),i=b.useMemo(()=>({selected:t,select:s,enabled:e}),[t,s,e]);return M.jsx(sc.Provider,{value:i,children:n})}function Dp({enabled:n=!1,children:e,...t}){const s=b.useRef(null),i=b.useContext(sc);return b.useEffect(()=>{if(i&&n){let r=!1;const o=[];if(s.current.traverse(a=>{a.type==="Mesh"&&o.push(a),i.selected.indexOf(a)===-1&&(r=!0)}),r)return i.select(a=>[...a,...o]),()=>{i.select(a=>a.filter(c=>!o.includes(c)))}}},[n,e,i]),M.jsx("group",{ref:s,...t,children:e})}/** * postprocessing v6.33.4 build Sat Dec 02 2023 * https://github.com/pmndrs/postprocessing * Copyright 2015-2023 Raoul van Rüschen * @license Zlib - */var Su="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",ee={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},Cu="",He="srgb",Ao="srgb-linear",fs={NONE:0,DEPTH:1,CONVOLUTION:2},ie={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},Mo={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},Nr={DEFAULT:0,ESKIL:1},bu=Number(ec.replace(/\D+/g,"")),Eu=bu>=152,Dp=new Map([[vu,Ao],[yu,He]]),Rp=new Map([[Ao,vu],[He,yu]]);function Xn(n){return n===null?null:Eu?n.outputColorSpace:Dp.get(n.outputEncoding)}function Ns(n,e){n!==null&&(Eu?n.colorSpace=e:n.encoding=Rp.get(e))}function pr(n){return bu<154?n.replace("colorspace_fragment","encodings_fragment"):n}var Pp=`#ifdef FRAMEBUFFER_PRECISION_HIGH + */var Su="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",ee={SKIP:9,SET:30,ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},Cu="",He="srgb",Ao="srgb-linear",fs={NONE:0,DEPTH:1,CONVOLUTION:2},ie={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},Mo={VERY_SMALL:0,SMALL:1,MEDIUM:2,LARGE:3,VERY_LARGE:4,HUGE:5},Nr={DEFAULT:0,ESKIL:1},bu=Number(ec.replace(/\D+/g,"")),Eu=bu>=152,Rp=new Map([[vu,Ao],[yu,He]]),Pp=new Map([[Ao,vu],[He,yu]]);function Xn(n){return n===null?null:Eu?n.outputColorSpace:Rp.get(n.outputEncoding)}function Ns(n,e){n!==null&&(Eu?n.colorSpace=e:n.encoding=Pp.get(e))}function pr(n){return bu<154?n.replace("colorspace_fragment","encodings_fragment"):n}var Ip=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; #else uniform lowp sampler2D inputBuffer; #endif varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25; #include -}`,Ip="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",Np=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],Fp=class extends es{constructor(n=new sl){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new $(null),texelSize:new $(new sl),scale:new $(1),kernel:new $(0)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Pp,vertexShader:Ip}),this.fragmentShader=pr(this.fragmentShader),this.setTexelSize(n.x,n.y),this.kernelSize=Mo.MEDIUM}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.inputBuffer=n}get kernelSequence(){return Np[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(n){this.uniforms.scale.value=n}getScale(){return this.uniforms.scale.value}setScale(n){this.uniforms.scale.value=n}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(n){this.uniforms.kernel.value=n}setKernel(n){this.kernel=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e,n*.5,e*.5)}setSize(n,e){const t=1/n,s=1/e;this.uniforms.texelSize.value.set(t,s,t*.5,s*.5)}},Up=`#include +}`,Np="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",Fp=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],Up=class extends es{constructor(n=new sl){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new $(null),texelSize:new $(new sl),scale:new $(1),kernel:new $(0)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Ip,vertexShader:Np}),this.fragmentShader=pr(this.fragmentShader),this.setTexelSize(n.x,n.y),this.kernelSize=Mo.MEDIUM}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.inputBuffer=n}get kernelSequence(){return Fp[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(n){this.uniforms.scale.value=n}getScale(){return this.uniforms.scale.value}setScale(n){this.uniforms.scale.value=n}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(n){this.uniforms.kernel.value=n}setKernel(n){this.kernel=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e,n*.5,e*.5)}setSize(n,e){const t=1/n,s=1/e;this.uniforms.texelSize.value.set(t,s,t*.5,s*.5)}},Lp=`#include #include #ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; @@ -25,7 +25,7 @@ uniform lowp sampler2D inputBuffer; uniform float opacity;varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);gl_FragColor=opacity*texel; #include #include -}`,Ou=class extends es{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new $(null),opacity:new $(1)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Up,vertexShader:Su}),this.fragmentShader=pr(this.fragmentShader)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},Lp=`#include +}`,Ou=class extends es{constructor(){super({name:"CopyMaterial",uniforms:{inputBuffer:new $(null),opacity:new $(1)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Lp,vertexShader:Su}),this.fragmentShader=pr(this.fragmentShader)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}getOpacity(n){return this.uniforms.opacity.value}setOpacity(n){this.uniforms.opacity.value=n}},zp=`#include #include #ifdef GL_FRAGMENT_PRECISION_HIGH uniform highp sampler2D depthBuffer; @@ -45,7 +45,7 @@ float viewZ=perspectiveDepthToViewZ(fragCoordZ,cameraNear,cameraFar); #else float viewZ=orthographicDepthToViewZ(fragCoordZ,cameraNear,cameraFar); #endif -float depthTest=(-vViewZ>-viewZ)?1.0:0.0;gl_FragColor.rg=vec2(0.0,depthTest);}`,zp=`#include +float depthTest=(-vViewZ>-viewZ)?1.0:0.0;gl_FragColor.rg=vec2(0.0,depthTest);}`,Bp=`#include #include #include #include @@ -57,7 +57,7 @@ varying float vViewZ;varying vec4 vProjTexCoord;void main(){ #include vViewZ=mvPosition.z;vProjTexCoord=gl_Position; #include -}`,Bp=class extends es{constructor(n=null,e){super({name:"DepthComparisonMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new $(null),cameraNear:new $(.3),cameraFar:new $(1e3)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Lp,vertexShader:zp}),this.depthBuffer=n,this.depthPacking=ka,this.copyCameraSettings(e)}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=ka){this.depthBuffer=n,this.depthPacking=e}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof mu?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},Vp=`#include +}`,Vp=class extends es{constructor(n=null,e){super({name:"DepthComparisonMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new $(null),cameraNear:new $(.3),cameraFar:new $(1e3)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:zp,vertexShader:Bp}),this.depthBuffer=n,this.depthPacking=ka,this.copyCameraSettings(e)}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=ka){this.depthBuffer=n,this.depthPacking=e}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof mu?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}},jp=`#include #ifdef GL_FRAGMENT_PRECISION_HIGH uniform highp sampler2D depthBuffer; #else @@ -78,7 +78,7 @@ vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1 #else vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0); #endif -gl_FragColor=vec4(n[index],d[index]);}`,jp="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",Hp=class extends es{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new $(null),normalBuffer:new $(null),texelSize:new $(new Ne)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Vp,vertexShader:jp})}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=ci){this.depthBuffer=n,this.depthPacking=e}set normalBuffer(n){this.uniforms.normalBuffer.value=n,n!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(n){this.normalBuffer=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},qp=`#ifdef FRAMEBUFFER_PRECISION_HIGH +gl_FragColor=vec4(n[index],d[index]);}`,Hp="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",qp=class extends es{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new $(null),normalBuffer:new $(null),texelSize:new $(new Ne)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:jp,vertexShader:Hp})}set depthBuffer(n){this.uniforms.depthBuffer.value=n}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=ci){this.depthBuffer=n,this.depthPacking=e}set normalBuffer(n){this.uniforms.normalBuffer.value=n,n!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(n){this.normalBuffer=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},Wp=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer; #else uniform lowp sampler2D inputBuffer; @@ -87,7 +87,7 @@ uniform lowp sampler2D inputBuffer; #define WEIGHT_OUTER 0.0555555 varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c; #include -}`,Wp="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",Gp=class extends es{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new $(null),texelSize:new $(new Ne)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:qp,vertexShader:Wp}),this.fragmentShader=pr(this.fragmentShader)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},Yp=`#include +}`,Gp="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",Yp=class extends es{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new $(null),texelSize:new $(new Ne)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Wp,vertexShader:Gp}),this.fragmentShader=pr(this.fragmentShader)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},Zp=`#include #include #include #define packFloatToRGBA(v) packDepthToRGBA(v) @@ -128,7 +128,7 @@ return orthographicDepthToViewZ(depth,cameraNear,cameraFar); #include #endif #include -}`,Zp="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",Xp=class extends es{constructor(n,e,t,s,i=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:ec.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new $(null),depthBuffer:new $(null),resolution:new $(new Ne),texelSize:new $(new Ne),cameraNear:new $(.3),cameraFar:new $(1e3),aspect:new $(1),time:new $(0)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:i}),n&&this.setShaderParts(n),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(s)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=ci){this.depthBuffer=n,this.depthPacking=e}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){return this.fragmentShader=Yp.replace(ie.FRAGMENT_HEAD,n.get(ie.FRAGMENT_HEAD)||"").replace(ie.FRAGMENT_MAIN_UV,n.get(ie.FRAGMENT_MAIN_UV)||"").replace(ie.FRAGMENT_MAIN_IMAGE,n.get(ie.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=Zp.replace(ie.VERTEX_HEAD,n.get(ie.VERTEX_HEAD)||"").replace(ie.VERTEX_MAIN_SUPPORT,n.get(ie.VERTEX_MAIN_SUPPORT)||""),this.fragmentShader=pr(this.fragmentShader),this.needsUpdate=!0,this}setDefines(n){for(const e of n.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(n){for(const e of n.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(n){this.extensions={};for(const e of n)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof mu?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,e){const t=this.uniforms;t.resolution.value.set(n,e),t.texelSize.value.set(1/n,1/e),t.aspect.value=n/e}static get Section(){return ie}},$p=`#include +}`,Xp="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",$p=class extends es{constructor(n,e,t,s,i=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:ec.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new $(null),depthBuffer:new $(null),resolution:new $(new Ne),texelSize:new $(new Ne),cameraNear:new $(.3),cameraFar:new $(1e3),aspect:new $(1),time:new $(0)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:i}),n&&this.setShaderParts(n),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(s)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(n){this.uniforms.depthBuffer.value=n}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(n){this.defines.DEPTH_PACKING=n.toFixed(0),this.needsUpdate=!0}setDepthBuffer(n,e=ci){this.depthBuffer=n,this.depthPacking=e}setShaderData(n){this.setShaderParts(n.shaderParts),this.setDefines(n.defines),this.setUniforms(n.uniforms),this.setExtensions(n.extensions)}setShaderParts(n){return this.fragmentShader=Zp.replace(ie.FRAGMENT_HEAD,n.get(ie.FRAGMENT_HEAD)||"").replace(ie.FRAGMENT_MAIN_UV,n.get(ie.FRAGMENT_MAIN_UV)||"").replace(ie.FRAGMENT_MAIN_IMAGE,n.get(ie.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=Xp.replace(ie.VERTEX_HEAD,n.get(ie.VERTEX_HEAD)||"").replace(ie.VERTEX_MAIN_SUPPORT,n.get(ie.VERTEX_MAIN_SUPPORT)||""),this.fragmentShader=pr(this.fragmentShader),this.needsUpdate=!0,this}setDefines(n){for(const e of n.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(n){for(const e of n.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(n){this.extensions={};for(const e of n)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(n){this.encodeOutput!==n&&(n?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(n){return this.encodeOutput}setOutputEncodingEnabled(n){this.encodeOutput=n}get time(){return this.uniforms.time.value}set time(n){this.uniforms.time.value=n}setDeltaTime(n){this.uniforms.time.value+=n}adoptCameraSettings(n){this.copyCameraSettings(n)}copyCameraSettings(n){n&&(this.uniforms.cameraNear.value=n.near,this.uniforms.cameraFar.value=n.far,n instanceof mu?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(n,e){const t=this.uniforms;t.resolution.value.set(n,e),t.texelSize.value.set(1/n,1/e),t.aspect.value=n/e}static get Section(){return ie}},Qp=`#include #if THREE_REVISION < 143 #define luminance(v) linearToRelativeLuminance(v) #endif @@ -153,14 +153,14 @@ gl_FragColor=vec4(texel.rgb*l,l); #else gl_FragColor=vec4(l); #endif -}`,Qp=class extends es{constructor(n=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:ec.replace(/\D+/g,"")},uniforms:{inputBuffer:new $(null),threshold:new $(0),smoothing:new $(1),range:new $(null)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:$p,vertexShader:Su}),this.colorOutput=n,this.luminanceRange=e}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get threshold(){return this.uniforms.threshold.value}set threshold(n){this.smoothing>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=n}getThreshold(){return this.threshold}setThreshold(n){this.threshold=n}get smoothing(){return this.uniforms.smoothing.value}set smoothing(n){this.threshold>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=n}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(n){this.smoothing=n}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(n){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(n){n?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(n){return this.colorOutput}setColorOutputEnabled(n){this.colorOutput=n}get useRange(){return this.luminanceRange!==null}set useRange(n){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(n){n!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=n,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(n){this.luminanceRange=n}},Kp="uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}",Jp="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}",e0=class extends es{constructor(n=new Ne){super({name:"OutlineMaterial",uniforms:{inputBuffer:new $(null),texelSize:new $(new Ne)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Kp,vertexShader:Jp}),this.uniforms.texelSize.value.set(n.x,n.y),this.uniforms.maskTexture=this.uniforms.inputBuffer}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},t0=`#ifdef FRAMEBUFFER_PRECISION_HIGH +}`,Kp=class extends es{constructor(n=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:ec.replace(/\D+/g,"")},uniforms:{inputBuffer:new $(null),threshold:new $(0),smoothing:new $(1),range:new $(null)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Qp,vertexShader:Su}),this.colorOutput=n,this.luminanceRange=e}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}get threshold(){return this.uniforms.threshold.value}set threshold(n){this.smoothing>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=n}getThreshold(){return this.threshold}setThreshold(n){this.threshold=n}get smoothing(){return this.uniforms.smoothing.value}set smoothing(n){this.threshold>0||n>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=n}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(n){this.smoothing=n}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(n){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(n){n?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(n){return this.colorOutput}setColorOutputEnabled(n){this.colorOutput=n}get useRange(){return this.luminanceRange!==null}set useRange(n){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(n){n!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=n,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(n){this.luminanceRange=n}},Jp="uniform lowp sampler2D inputBuffer;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 c0=texture2D(inputBuffer,vUv0).rg;vec2 c1=texture2D(inputBuffer,vUv1).rg;vec2 c2=texture2D(inputBuffer,vUv2).rg;vec2 c3=texture2D(inputBuffer,vUv3).rg;float d0=(c0.x-c1.x)*0.5;float d1=(c2.x-c3.x)*0.5;float d=length(vec2(d0,d1));float a0=min(c0.y,c1.y);float a1=min(c2.y,c3.y);float visibilityFactor=min(a0,a1);gl_FragColor.rg=(1.0-visibilityFactor>0.001)?vec2(d,0.0):vec2(0.0,d);}",e0="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=vec2(uv.x+texelSize.x,uv.y);vUv1=vec2(uv.x-texelSize.x,uv.y);vUv2=vec2(uv.x,uv.y+texelSize.y);vUv3=vec2(uv.x,uv.y-texelSize.y);gl_Position=vec4(position.xy,1.0,1.0);}",t0=class extends es{constructor(n=new Ne){super({name:"OutlineMaterial",uniforms:{inputBuffer:new $(null),texelSize:new $(new Ne)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Jp,vertexShader:e0}),this.uniforms.texelSize.value.set(n.x,n.y),this.uniforms.maskTexture=this.uniforms.inputBuffer}set inputBuffer(n){this.uniforms.inputBuffer.value=n}setInputBuffer(n){this.uniforms.inputBuffer.value=n}setTexelSize(n,e){this.uniforms.texelSize.value.set(n,e)}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},s0=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer; #else uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer; #endif uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius); #include -}`,s0="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",n0=class extends es{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new $(null),supportBuffer:new $(null),texelSize:new $(new Ne),radius:new $(.85)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:t0,vertexShader:s0}),this.fragmentShader=pr(this.fragmentShader)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}set supportBuffer(n){this.uniforms.supportBuffer.value=n}get radius(){return this.uniforms.radius.value}set radius(n){this.uniforms.radius.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},i0=new Bf,Es=null;function r0(){if(Es===null){const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Es=new Vf,Es.setAttribute!==void 0?(Es.setAttribute("position",new Or(n,3)),Es.setAttribute("uv",new Or(e,2))):(Es.addAttribute("position",new Or(n,3)),Es.addAttribute("uv",new Or(e,2)))}return Es}var it=class Au{constructor(e="Pass",t=new tl,s=i0){this.name=e,this.renderer=null,this.scene=t,this.camera=s,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new Lf(r0(),e),t.frustumCulled=!1,this.scene===null&&(this.scene=new tl),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=ci){}render(e,t,s,i,r){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,s){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof Tt||t instanceof _u||t instanceof gu||t instanceof Au)&&this[e].dispose()}}},o0=class extends it{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new Ou,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new Tt(1,1,{minFilter:Xr,magFilter:Xr,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,s,i){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==_s?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":Xn(n)===He&&Ns(this.renderTarget.texture,He))}},a0=class extends it{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,s,i){const r=n.state.buffers.stencil;r.setLocked(!1),r.setTest(!1)}},ml=new ds,nc=class extends it{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,s,i){const r=this.overrideClearColor,o=this.overrideClearAlpha,a=n.getClearAlpha(),c=r!==null,l=o>=0;c?(n.getClearColor(ml),n.setClearColor(r,l?o:a)):l&&n.setClearAlpha(o),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),c?n.setClearColor(ml,a):l&&n.setClearAlpha(a)}},Do=class extends it{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new nc,this.overrideMaterialManager=t===null?null:new gl(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new gl(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,s,i){const r=this.scene,o=this.camera,a=this.selection,c=o.layers.mask,l=r.background,u=n.shadowMap.autoUpdate,h=this.renderToScreen?null:e;a!==null&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(r.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(h),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,r,o):n.render(r,o),o.layers.mask=c,r.background=l,n.shadowMap.autoUpdate=u}},c0=class extends it{constructor(n,e,{renderTarget:t,resolutionScale:s=1,width:i=Ee.AUTO_SIZE,height:r=Ee.AUTO_SIZE,resolutionX:o=i,resolutionY:a=r}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new Do(n,e,new zf({depthPacking:ka}));const c=this.renderPass;c.skipShadowMapUpdate=!0,c.ignoreBackground=!0;const l=c.clearPass;l.overrideClearColor=new ds(16777215),l.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new Tt(1,1,{minFilter:Zn,magFilter:Zn}),this.renderTarget.texture.name="DepthPass.Target");const u=this.resolution=new Ee(this,o,a,s);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,s,i){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},l0=class extends it{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=Ee.AUTO_SIZE,height:s=Ee.AUTO_SIZE,resolutionX:i=t,resolutionY:r=s}={}){super("DepthDownsamplingPass");const o=new Hp;o.normalBuffer=n,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Tt(1,1,{minFilter:Zn,magFilter:Zn,depthBuffer:!1,type:Mf}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const a=this.resolution=new Ee(this,i,r,e);a.addEventListener("change",c=>this.setSize(a.baseWidth,a.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=ci){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,s,i){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const s=n.getContext();if(!(s.getExtension("EXT_color_buffer_float")||s.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}};function _l(n,e,t){for(const s of e){const i="$1"+n+s.charAt(0).toUpperCase()+s.slice(1),r=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(const o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(r,i))}}function u0(n,e,t){let s=e.getFragmentShader(),i=e.getVertexShader();const r=s!==void 0&&/mainImage/.test(s),o=s!==void 0&&/mainUv/.test(s);if(t.attributes|=e.getAttributes(),s===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(o&&t.attributes&fs.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!r&&!o)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const a=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,c=t.shaderParts;let l=c.get(ie.FRAGMENT_HEAD)||"",u=c.get(ie.FRAGMENT_MAIN_UV)||"",h=c.get(ie.FRAGMENT_MAIN_IMAGE)||"",d=c.get(ie.VERTEX_HEAD)||"",f=c.get(ie.VERTEX_MAIN_SUPPORT)||"";const m=new Set,p=new Set;if(o&&(u+=` ${n}MainUv(UV); +}`,n0="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",i0=class extends es{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new $(null),supportBuffer:new $(null),texelSize:new $(new Ne),radius:new $(.85)},blending:ks,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:s0,vertexShader:n0}),this.fragmentShader=pr(this.fragmentShader)}set inputBuffer(n){this.uniforms.inputBuffer.value=n}set supportBuffer(n){this.uniforms.supportBuffer.value=n}get radius(){return this.uniforms.radius.value}set radius(n){this.uniforms.radius.value=n}setSize(n,e){this.uniforms.texelSize.value.set(1/n,1/e)}},r0=new Bf,Es=null;function o0(){if(Es===null){const n=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]);Es=new Vf,Es.setAttribute!==void 0?(Es.setAttribute("position",new Or(n,3)),Es.setAttribute("uv",new Or(e,2))):(Es.addAttribute("position",new Or(n,3)),Es.addAttribute("uv",new Or(e,2)))}return Es}var it=class Au{constructor(e="Pass",t=new tl,s=r0){this.name=e,this.renderer=null,this.scene=t,this.camera=s,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new Lf(o0(),e),t.frustumCulled=!1,this.scene===null&&(this.scene=new tl),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=ci){}render(e,t,s,i,r){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,s){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof Tt||t instanceof _u||t instanceof gu||t instanceof Au)&&this[e].dispose()}}},a0=class extends it{constructor(n,e=!0){super("CopyPass"),this.fullscreenMaterial=new Ou,this.needsSwap=!1,this.renderTarget=n,n===void 0&&(this.renderTarget=new Tt(1,1,{minFilter:Xr,magFilter:Xr,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(n){this.autoResize=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(n){this.autoResize=n}render(n,e,t,s,i){this.fullscreenMaterial.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){this.autoResize&&this.renderTarget.setSize(n,e)}initialize(n,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==_s?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":Xn(n)===He&&Ns(this.renderTarget.texture,He))}},c0=class extends it{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(n,e,t,s,i){const r=n.state.buffers.stencil;r.setLocked(!1),r.setTest(!1)}},ml=new ds,nc=class extends it{constructor(n=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=n,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(n,e,t){this.color=n,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(n){this.overrideClearColor=n}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(n){this.overrideClearAlpha=n}render(n,e,t,s,i){const r=this.overrideClearColor,o=this.overrideClearAlpha,a=n.getClearAlpha(),c=r!==null,l=o>=0;c?(n.getClearColor(ml),n.setClearColor(r,l?o:a)):l&&n.setClearAlpha(o),n.setRenderTarget(this.renderToScreen?null:e),n.clear(this.color,this.depth,this.stencil),c?n.setClearColor(ml,a):l&&n.setClearAlpha(a)}},Do=class extends it{constructor(n,e,t=null){super("RenderPass",n,e),this.needsSwap=!1,this.clearPass=new nc,this.overrideMaterialManager=t===null?null:new gl(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get renderToScreen(){return super.renderToScreen}set renderToScreen(n){super.renderToScreen=n,this.clearPass.renderToScreen=n}get overrideMaterial(){const n=this.overrideMaterialManager;return n!==null?n.material:null}set overrideMaterial(n){const e=this.overrideMaterialManager;n!==null?e!==null?e.setMaterial(n):this.overrideMaterialManager=new gl(n):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(n){this.overrideMaterial=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getSelection(){return this.selection}setSelection(n){this.selection=n}isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(n){this.ignoreBackground=n}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(n){this.skipShadowMapUpdate=n}getClearPass(){return this.clearPass}render(n,e,t,s,i){const r=this.scene,o=this.camera,a=this.selection,c=o.layers.mask,l=r.background,u=n.shadowMap.autoUpdate,h=this.renderToScreen?null:e;a!==null&&o.layers.set(a.getLayer()),this.skipShadowMapUpdate&&(n.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(r.background=null),this.clearPass.enabled&&this.clearPass.render(n,e),n.setRenderTarget(h),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(n,r,o):n.render(r,o),o.layers.mask=c,r.background=l,n.shadowMap.autoUpdate=u}},l0=class extends it{constructor(n,e,{renderTarget:t,resolutionScale:s=1,width:i=Ee.AUTO_SIZE,height:r=Ee.AUTO_SIZE,resolutionX:o=i,resolutionY:a=r}={}){super("DepthPass"),this.needsSwap=!1,this.renderPass=new Do(n,e,new zf({depthPacking:ka}));const c=this.renderPass;c.skipShadowMapUpdate=!0,c.ignoreBackground=!0;const l=c.clearPass;l.overrideClearColor=new ds(16777215),l.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new Tt(1,1,{minFilter:Zn,magFilter:Zn}),this.renderTarget.texture.name="DepthPass.Target");const u=this.resolution=new Ee(this,o,a,s);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,s,i){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},u0=class extends it{constructor({normalBuffer:n=null,resolutionScale:e=.5,width:t=Ee.AUTO_SIZE,height:s=Ee.AUTO_SIZE,resolutionX:i=t,resolutionY:r=s}={}){super("DepthDownsamplingPass");const o=new qp;o.normalBuffer=n,this.fullscreenMaterial=o,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Tt(1,1,{minFilter:Zn,magFilter:Zn,depthBuffer:!1,type:Mf}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const a=this.resolution=new Ee(this,i,r,e);a.addEventListener("change",c=>this.setSize(a.baseWidth,a.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(n,e=ci){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e}render(n,e,t,s,i){n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(n,e)}initialize(n,e,t){const s=n.getContext();if(!(s.getExtension("EXT_color_buffer_float")||s.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}};function _l(n,e,t){for(const s of e){const i="$1"+n+s.charAt(0).toUpperCase()+s.slice(1),r=new RegExp("([^\\.])(\\b"+s+"\\b)","g");for(const o of t.entries())o[1]!==null&&t.set(o[0],o[1].replace(r,i))}}function h0(n,e,t){let s=e.getFragmentShader(),i=e.getVertexShader();const r=s!==void 0&&/mainImage/.test(s),o=s!==void 0&&/mainUv/.test(s);if(t.attributes|=e.getAttributes(),s===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(o&&t.attributes&fs.CONVOLUTION)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!r&&!o)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const a=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,c=t.shaderParts;let l=c.get(ie.FRAGMENT_HEAD)||"",u=c.get(ie.FRAGMENT_MAIN_UV)||"",h=c.get(ie.FRAGMENT_MAIN_IMAGE)||"",d=c.get(ie.VERTEX_HEAD)||"",f=c.get(ie.VERTEX_MAIN_SUPPORT)||"";const m=new Set,p=new Set;if(o&&(u+=` ${n}MainUv(UV); `,t.uvTransformation=!0),i!==null&&/mainSupport/.test(i)){const w=/mainSupport *\([\w\s]*?uv\s*?\)/.test(i);f+=` ${n}MainSupport(`,f+=w?`vUv); `:`); `;for(const S of i.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const v of S[1].split(/\s*,\s*/))t.varyings.add(v),m.add(v),p.add(v);for(const S of i.matchAll(a))p.add(S[1])}for(const w of s.matchAll(a))p.add(w[1]);for(const w of e.defines.keys())p.add(w.replace(/\([\w\s,]*\)/g,""));for(const w of e.uniforms.keys())p.add(w);p.delete("while"),p.delete("for"),p.delete("if"),e.uniforms.forEach((w,S)=>t.uniforms.set(n+S.charAt(0).toUpperCase()+S.slice(1),w)),e.defines.forEach((w,S)=>t.defines.set(n+S.charAt(0).toUpperCase()+S.slice(1),w));const g=new Map([["fragment",s],["vertex",i]]);_l(n,p,t.defines),_l(n,p,g),s=g.get("fragment"),i=g.get("vertex");const y=e.blendMode;if(t.blendModes.set(y.blendFunction,y),r){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(h+=e.inputColorSpace===He?`color0 = LinearTosRGB(color0); @@ -172,18 +172,18 @@ uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varyin `}if(l+=s+` `,i!==null&&(d+=i+` -`),c.set(ie.FRAGMENT_HEAD,l),c.set(ie.FRAGMENT_MAIN_UV,u),c.set(ie.FRAGMENT_MAIN_IMAGE,h),c.set(ie.VERTEX_HEAD,d),c.set(ie.VERTEX_MAIN_SUPPORT,f),e.extensions!==null)for(const w of e.extensions)t.extensions.add(w)}}var h0=class extends it{constructor(n,...e){super("EffectPass"),this.fullscreenMaterial=new Xp(null,null,null,n),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const e of this.effects)e.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const e of this.effects)e.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const e=this.fullscreenMaterial;e.dithering=n,e.needsUpdate=!0}setEffects(n){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=n.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const n=new x0;let e=0;for(const o of this.effects)if(o.blendMode.blendFunction===ee.DST)n.attributes|=o.getAttributes()&fs.DEPTH;else{if(n.attributes&o.getAttributes()&fs.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${o.name})`);u0("e"+e++,o,n)}let t=n.shaderParts.get(ie.FRAGMENT_HEAD),s=n.shaderParts.get(ie.FRAGMENT_MAIN_IMAGE),i=n.shaderParts.get(ie.FRAGMENT_MAIN_UV);const r=/\bblend\b/g;for(const o of n.blendModes.values())t+=o.getShaderCode().replace(r,`blend${o.blendFunction}`)+` +`),c.set(ie.FRAGMENT_HEAD,l),c.set(ie.FRAGMENT_MAIN_UV,u),c.set(ie.FRAGMENT_MAIN_IMAGE,h),c.set(ie.VERTEX_HEAD,d),c.set(ie.VERTEX_MAIN_SUPPORT,f),e.extensions!==null)for(const w of e.extensions)t.extensions.add(w)}}var d0=class extends it{constructor(n,...e){super("EffectPass"),this.fullscreenMaterial=new $p(null,null,null,n),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(n){for(const e of this.effects)e.mainScene=n}set mainCamera(n){this.fullscreenMaterial.copyCameraSettings(n);for(const e of this.effects)e.mainCamera=n}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(n){this.fullscreenMaterial.encodeOutput=n}get dithering(){return this.fullscreenMaterial.dithering}set dithering(n){const e=this.fullscreenMaterial;e.dithering=n,e.needsUpdate=!0}setEffects(n){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=n.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const n=new T0;let e=0;for(const o of this.effects)if(o.blendMode.blendFunction===ee.DST)n.attributes|=o.getAttributes()&fs.DEPTH;else{if(n.attributes&o.getAttributes()&fs.CONVOLUTION)throw new Error(`Convolution effects cannot be merged (${o.name})`);h0("e"+e++,o,n)}let t=n.shaderParts.get(ie.FRAGMENT_HEAD),s=n.shaderParts.get(ie.FRAGMENT_MAIN_IMAGE),i=n.shaderParts.get(ie.FRAGMENT_MAIN_UV);const r=/\bblend\b/g;for(const o of n.blendModes.values())t+=o.getShaderCode().replace(r,`blend${o.blendFunction}`)+` `;n.attributes&fs.DEPTH?(n.readDepth&&(s=`float depth = readDepth(UV); `+s),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,n.colorSpace===He&&(s+=`color0 = sRGBToLinear(color0); `),n.uvTransformation?(i=`vec2 transformedUv = vUv; `+i,n.defines.set("UV","transformedUv")):n.defines.set("UV","vUv"),n.shaderParts.set(ie.FRAGMENT_HEAD,t),n.shaderParts.set(ie.FRAGMENT_MAIN_IMAGE,s),n.shaderParts.set(ie.FRAGMENT_MAIN_UV,i);for(const[o,a]of n.shaderParts)a!==null&&n.shaderParts.set(o,a.trim().replace(/^#/,` -#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=ci){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,s,i){for(const r of this.effects)r.update(n,e,s);if(!this.skipRendering||this.renderToScreen){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,r.time+=s*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const s of this.effects)s.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==_s&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},Mu=class extends it{constructor({kernelSize:n=Mo.MEDIUM,resolutionScale:e=.5,width:t=Ee.AUTO_SIZE,height:s=Ee.AUTO_SIZE,resolutionX:i=t,resolutionY:r=s}={}){super("KawaseBlurPass"),this.renderTargetA=new Tt(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const o=this.resolution=new Ee(this,i,r,e);o.addEventListener("change",a=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new Fp,this._blurMaterial.kernelSize=n,this.copyMaterial=new Ou}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,s,i){const r=this.scene,o=this.camera,a=this.renderTargetA,c=this.renderTargetB,l=this.blurMaterial,u=l.kernelSequence;let h=e;this.fullscreenMaterial=l;for(let d=0,f=u.length;dthis.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,e,t,s,i){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}initialize(n,e,t){t!==void 0&&t!==_s&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},f0=class extends it{constructor(n,e){super("MaskPass",n,e),this.needsSwap=!1,this.clearPass=new nc(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,e,t,s,i){const r=n.getContext(),o=n.state.buffers,a=this.scene,c=this.camera,l=this.clearPass,u=this.inverted?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),o.stencil.setFunc(r.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?l.render(n,null):(l.render(n,e),l.render(n,t))),this.renderToScreen?(n.setRenderTarget(null),n.render(a,c)):(n.setRenderTarget(e),n.render(a,c),n.setRenderTarget(t),n.render(a,c)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(r.EQUAL,1,4294967295),o.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),o.stencil.setLocked(!0)}},p0=class extends it{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new Tt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new Gp,this.upsamplingMaterial=new n0,this.resolution=new Ne}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(n){if(this.levels!==n){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t=0;--d){const f=u[d];c.setSize(h.width,h.height),c.inputBuffer=h.texture,c.supportBuffer=l[d].texture,n.setRenderTarget(f),n.render(r,o),h=f}}setSize(n,e){const t=this.resolution;t.set(n,e);let s=t.width,i=t.height;for(let r=0,o=this.downsamplingMipmaps.length;rthis.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,s,i){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},_0=class extends it{constructor(n,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=n,this.input=e}setInput(n){this.input=n}render(n,e,t,s,i){const r=this.fullscreenMaterial.uniforms;e!==null&&r!==void 0&&r[this.input]!==void 0&&(r[this.input].value=e.texture),n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}initialize(n,e,t){t!==void 0&&t!==_s&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},oa=1/1e3,g0=1e3,v0=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*oa}get fixedDelta(){return this._fixedDelta*oa}set fixedDelta(n){this._fixedDelta=n*g0}get elapsed(){return this._elapsed*oa}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},y0=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:s=!1,multisampling:i=0,frameBufferType:r}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,s,r,i),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new o0,this.depthTexture=null,this.passes=[],this.timer=new v0,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){const t=this.inputBuffer,s=this.multisampling;s>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):s!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){const t=e.getSize(new Ne),s=e.getContext().getContextAttributes().alpha,i=this.inputBuffer.texture.type;i===_s&&Xn(e)===He&&(Ns(this.inputBuffer.texture,He),Ns(this.outputBuffer.texture,He),this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(const r of this.passes)r.initialize(e,s,i)}}replaceRenderer(e,t=!0){const s=this.renderer,i=s.domElement.parentNode;return this.setRenderer(e),t&&i!==null&&(i.removeChild(s.domElement),i.appendChild(e.domElement)),s}createDepthTexture(){const e=this.depthTexture=new Rf;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=Pf,e.type=If):e.type=Nf,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,s,i){const r=this.renderer,o=r===null?new Ne:r.getDrawingBufferSize(new Ne),a={minFilter:Xr,magFilter:Xr,stencilBuffer:t,depthBuffer:e,type:s},c=new Tt(o.width,o.height,a);return i>0&&(c.ignoreDepthForMultisampleCopy=!1,c.samples=i),s===_s&&Xn(r)===He&&Ns(c.texture,He),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}setMainScene(e){for(const t of this.passes)t.mainScene=e}setMainCamera(e){for(const t of this.passes)t.mainCamera=e}addPass(e,t){const s=this.passes,i=this.renderer,r=i.getDrawingBufferSize(new Ne),o=i.getContext().getContextAttributes().alpha,a=this.inputBuffer.texture.type;if(e.setRenderer(i),e.setSize(r.width,r.height),e.initialize(i,o,a),this.autoRenderToScreen&&(s.length>0&&(s[s.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t!==void 0?s.splice(t,0,e):s.push(e),this.autoRenderToScreen&&(s[s.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const c=this.createDepthTexture();for(e of s)e.setDepthTexture(c)}else e.setDepthTexture(this.depthTexture)}removePass(e){const t=this.passes,s=t.indexOf(e);if(s!==-1&&t.splice(s,1).length>0){if(this.depthTexture!==null){const o=(c,l)=>c||l.needsDepthTexture;t.reduce(o,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&s===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){const e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){const t=this.renderer,s=this.copyPass;let i=this.inputBuffer,r=this.outputBuffer,o=!1,a,c,l;e===void 0&&(this.timer.update(),e=this.timer.delta);for(const u of this.passes)u.enabled&&(u.render(t,i,r,e,o),u.needsSwap&&(o&&(s.renderToScreen=u.renderToScreen,a=t.getContext(),c=t.state.buffers.stencil,c.setFunc(a.NOTEQUAL,1,4294967295),s.render(t,i,r,e,o),c.setFunc(a.EQUAL,1,4294967295)),l=i,i=r,r=l),u instanceof f0?o=!0:u instanceof a0&&(o=!1))}setSize(e,t,s){const i=this.renderer,r=i.getSize(new Ne);(e===void 0||t===void 0)&&(e=r.width,t=r.height),(r.width!==e||r.height!==t)&&i.setSize(e,t,s);const o=i.getDrawingBufferSize(new Ne);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height);for(const a of this.passes)a.setSize(o.width,o.height)}reset(){const e=this.timer.autoReset;this.dispose(),this.autoRenderToScreen=!0,this.timer.autoReset=e}dispose(){for(const e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},x0=class{constructor(){this.shaderParts=new Map([[ie.FRAGMENT_HEAD,null],[ie.FRAGMENT_MAIN_UV,null],[ie.FRAGMENT_MAIN_IMAGE,null],[ie.VERTEX_HEAD,null],[ie.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=fs.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Ao}},aa=!1,gl=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Ri:t=this.materialsFlatShadedDoubleSide;break;case Er:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Ri:t=this.materialsDoubleSide;break;case Er:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof es))return n.clone();const e=n.uniforms,t=new Map;for(const i in e){const r=e[i].value;r.isRenderTargetTexture&&(e[i].value=null,t.set(i,r))}const s=n.clone();for(const i of t)e[i[0]].value=i[1],s.uniforms[i[0]].value=i[1];return s}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=Ff;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.side=Er,s}),this.materialsDoubleSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.side=Ri,s}),this.materialsFlatShaded=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.flatShading=!0,s}),this.materialsFlatShadedBackSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.flatShading=!0,s.side=Er,s}),this.materialsFlatShadedDoubleSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.flatShading=!0,s.side=Ri,s})}}render(n,e,t){const s=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,aa){const i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const r of i)r[0].material=r[1];this.meshCount!==i.size&&i.clear()}else{const i=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=i}n.shadowMap.enabled=s}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return aa}static set workaroundEnabled(n){aa=n}},Os=-1,Ee=class extends Ja{constructor(n,e=Os,t=Os,s=1){super(),this.resizable=n,this.baseSize=new Ne(1,1),this.preferredSize=new Ne(e,t),this.target=this.preferredSize,this.s=s,this.effectiveSize=new Ne,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,s=this.scale;e.width!==Os?t.width=e.width:e.height!==Os?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*s),e.height!==Os?t.height=e.height:e.width!==Os?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*s)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(Os),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return Os}},T0=class extends Set{constructor(n,e=10){super(),this.l=e,this.exclusive=!1,n!==void 0&&this.set(n)}get layer(){return this.l}set layer(n){const e=this.l;for(const t of this)t.layers.disable(e),t.layers.enable(n);this.l=n}getLayer(){return this.layer}setLayer(n){this.layer=n}isExclusive(){return this.exclusive}setExclusive(n){this.exclusive=n}clear(){const n=this.layer;for(const e of this)e.layers.disable(n);return super.clear()}set(n){this.clear();for(const e of n)this.add(e);return this}indexOf(n){return this.has(n)?0:-1}add(n){return this.exclusive?n.layers.set(this.layer):n.layers.enable(this.layer),super.add(n)}delete(n){return this.has(n)&&n.layers.disable(this.layer),super.delete(n)}toggle(n){let e;return this.has(n)?(this.delete(n),e=!1):(this.add(n),e=!0),e}setVisible(n){for(const e of this)n?e.layers.enable(0):e.layers.disable(0);return this}},k0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",w0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",S0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",C0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",b0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}",E0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}",O0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",A0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",M0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",D0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",R0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}",P0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",I0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}",N0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",F0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",U0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",L0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}",z0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",B0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}",V0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",j0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",H0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}",q0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",W0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}",G0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}",Y0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}",Z0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",X0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}",$0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}",Q0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",K0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}",J0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}",em=new Map([[ee.ADD,k0],[ee.ALPHA,w0],[ee.AVERAGE,S0],[ee.COLOR,C0],[ee.COLOR_BURN,b0],[ee.COLOR_DODGE,E0],[ee.DARKEN,O0],[ee.DIFFERENCE,A0],[ee.DIVIDE,M0],[ee.DST,null],[ee.EXCLUSION,D0],[ee.HARD_LIGHT,R0],[ee.HARD_MIX,P0],[ee.HUE,I0],[ee.INVERT,N0],[ee.INVERT_RGB,F0],[ee.LIGHTEN,U0],[ee.LINEAR_BURN,L0],[ee.LINEAR_DODGE,z0],[ee.LINEAR_LIGHT,B0],[ee.LUMINOSITY,V0],[ee.MULTIPLY,j0],[ee.NEGATION,H0],[ee.NORMAL,q0],[ee.OVERLAY,W0],[ee.PIN_LIGHT,G0],[ee.REFLECT,Y0],[ee.SATURATION,Z0],[ee.SCREEN,X0],[ee.SOFT_LIGHT,$0],[ee.SRC,Q0],[ee.SUBTRACT,K0],[ee.VIVID_LIGHT,J0]]),tm=class extends Ja{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new $(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return em.get(this.blendFunction)}},zi=class extends Ja{constructor(e,t,{attributes:s=fs.NONE,blendFunction:i=ee.NORMAL,defines:r=new Map,uniforms:o=new Map,extensions:a=null,vertexShader:c=null}={}){super(),this.name=e,this.renderer=null,this.attributes=s,this.fragmentShader=t,this.vertexShader=c,this.defines=r,this.uniforms=o,this.extensions=a,this.blendMode=new tm(i),this.blendMode.addEventListener("change",l=>this.setChanged()),this._inputColorSpace=Ao,this._outputColorSpace=Cu}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(e){this._inputColorSpace=e,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e,this.setChanged()}set mainScene(e){}set mainCamera(e){}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e,t=ci){}update(e,t,s){}setSize(e,t){}initialize(e,t,s){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof Tt||t instanceof _u||t instanceof gu||t instanceof it)&&this[e].dispose()}}},sm=`#ifdef FRAMEBUFFER_PRECISION_HIGH +#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(n)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(n,e=ci){this.fullscreenMaterial.depthBuffer=n,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(n,e)}render(n,e,t,s,i){for(const r of this.effects)r.update(n,e,s);if(!this.skipRendering||this.renderToScreen){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,r.time+=s*this.timeScale,n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}}setSize(n,e){this.fullscreenMaterial.setSize(n,e);for(const t of this.effects)t.setSize(n,e)}initialize(n,e,t){this.renderer=n;for(const s of this.effects)s.initialize(n,e,t);this.updateMaterial(),t!==void 0&&t!==_s&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const n of this.effects)n.removeEventListener("change",this.listener),n.dispose()}handleEvent(n){switch(n.type){case"change":this.recompile();break}}},Mu=class extends it{constructor({kernelSize:n=Mo.MEDIUM,resolutionScale:e=.5,width:t=Ee.AUTO_SIZE,height:s=Ee.AUTO_SIZE,resolutionX:i=t,resolutionY:r=s}={}){super("KawaseBlurPass"),this.renderTargetA=new Tt(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const o=this.resolution=new Ee(this,i,r,e);o.addEventListener("change",a=>this.setSize(o.baseWidth,o.baseHeight)),this._blurMaterial=new Up,this._blurMaterial.kernelSize=n,this.copyMaterial=new Ou}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(n){this._blurMaterial=n}get dithering(){return this.copyMaterial.dithering}set dithering(n){this.copyMaterial.dithering=n}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(n){this.blurMaterial.kernelSize=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get scale(){return this.blurMaterial.scale}set scale(n){this.blurMaterial.scale=n}getScale(){return this.blurMaterial.scale}setScale(n){this.blurMaterial.scale=n}getKernelSize(){return this.kernelSize}setKernelSize(n){this.kernelSize=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,s,i){const r=this.scene,o=this.camera,a=this.renderTargetA,c=this.renderTargetB,l=this.blurMaterial,u=l.kernelSequence;let h=e;this.fullscreenMaterial=l;for(let d=0,f=u.length;dthis.setSize(c.baseWidth,c.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(n,e,t,s,i){const r=this.fullscreenMaterial;r.inputBuffer=e.texture,n.setRenderTarget(this.renderToScreen?null:this.renderTarget),n.render(this.scene,this.camera)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}initialize(n,e,t){t!==void 0&&t!==_s&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},p0=class extends it{constructor(n,e){super("MaskPass",n,e),this.needsSwap=!1,this.clearPass=new nc(!1,!1,!0),this.inverse=!1}set mainScene(n){this.scene=n}set mainCamera(n){this.camera=n}get inverted(){return this.inverse}set inverted(n){this.inverse=n}get clear(){return this.clearPass.enabled}set clear(n){this.clearPass.enabled=n}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(n){this.inverted=n}render(n,e,t,s,i){const r=n.getContext(),o=n.state.buffers,a=this.scene,c=this.camera,l=this.clearPass,u=this.inverted?0:1,h=1-u;o.color.setMask(!1),o.depth.setMask(!1),o.color.setLocked(!0),o.depth.setLocked(!0),o.stencil.setTest(!0),o.stencil.setOp(r.REPLACE,r.REPLACE,r.REPLACE),o.stencil.setFunc(r.ALWAYS,u,4294967295),o.stencil.setClear(h),o.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?l.render(n,null):(l.render(n,e),l.render(n,t))),this.renderToScreen?(n.setRenderTarget(null),n.render(a,c)):(n.setRenderTarget(e),n.render(a,c),n.setRenderTarget(t),n.render(a,c)),o.color.setLocked(!1),o.depth.setLocked(!1),o.stencil.setLocked(!1),o.stencil.setFunc(r.EQUAL,1,4294967295),o.stencil.setOp(r.KEEP,r.KEEP,r.KEEP),o.stencil.setLocked(!0)}},m0=class extends it{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new Tt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new Yp,this.upsamplingMaterial=new i0,this.resolution=new Ne}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(n){if(this.levels!==n){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t=0;--d){const f=u[d];c.setSize(h.width,h.height),c.inputBuffer=h.texture,c.supportBuffer=l[d].texture,n.setRenderTarget(f),n.render(r,o),h=f}}setSize(n,e){const t=this.resolution;t.set(n,e);let s=t.width,i=t.height;for(let r=0,o=this.downsamplingMipmaps.length;rthis.setSize(u.baseWidth,u.baseHeight))}set mainScene(n){this.renderPass.mainScene=n}set mainCamera(n){this.renderPass.mainCamera=n}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}render(n,e,t,s,i){const r=this.renderToScreen?null:this.renderTarget;this.renderPass.render(n,r,r)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height)}},g0=class extends it{constructor(n,e="inputBuffer"){super("ShaderPass"),this.fullscreenMaterial=n,this.input=e}setInput(n){this.input=n}render(n,e,t,s,i){const r=this.fullscreenMaterial.uniforms;e!==null&&r!==void 0&&r[this.input]!==void 0&&(r[this.input].value=e.texture),n.setRenderTarget(this.renderToScreen?null:t),n.render(this.scene,this.camera)}initialize(n,e,t){t!==void 0&&t!==_s&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},oa=1/1e3,v0=1e3,y0=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(n){typeof document<"u"&&document.hidden!==void 0&&(n?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=n)}get delta(){return this._delta*oa}get fixedDelta(){return this._fixedDelta*oa}set fixedDelta(n){this._fixedDelta=n*v0}get elapsed(){return this._elapsed*oa}update(n){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(n!==void 0?n:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}handleEvent(n){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},x0=class{constructor(e=null,{depthBuffer:t=!0,stencilBuffer:s=!1,multisampling:i=0,frameBufferType:r}={}){this.renderer=null,this.inputBuffer=this.createBuffer(t,s,r,i),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new a0,this.depthTexture=null,this.passes=[],this.timer=new y0,this.autoRenderToScreen=!0,this.setRenderer(e)}get multisampling(){return this.inputBuffer.samples||0}set multisampling(e){const t=this.inputBuffer,s=this.multisampling;s>0&&e>0?(this.inputBuffer.samples=e,this.outputBuffer.samples=e,this.inputBuffer.dispose(),this.outputBuffer.dispose()):s!==e&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(t.depthBuffer,t.stencilBuffer,t.texture.type,e),this.inputBuffer.depthTexture=this.depthTexture,this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(e){if(this.renderer=e,e!==null){const t=e.getSize(new Ne),s=e.getContext().getContextAttributes().alpha,i=this.inputBuffer.texture.type;i===_s&&Xn(e)===He&&(Ns(this.inputBuffer.texture,He),Ns(this.outputBuffer.texture,He),this.inputBuffer.dispose(),this.outputBuffer.dispose()),e.autoClear=!1,this.setSize(t.width,t.height);for(const r of this.passes)r.initialize(e,s,i)}}replaceRenderer(e,t=!0){const s=this.renderer,i=s.domElement.parentNode;return this.setRenderer(e),t&&i!==null&&(i.removeChild(s.domElement),i.appendChild(e.domElement)),s}createDepthTexture(){const e=this.depthTexture=new Rf;return this.inputBuffer.depthTexture=e,this.inputBuffer.dispose(),this.inputBuffer.stencilBuffer?(e.format=Pf,e.type=If):e.type=Nf,e}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.inputBuffer.depthTexture=null,this.inputBuffer.dispose();for(const e of this.passes)e.setDepthTexture(null)}}createBuffer(e,t,s,i){const r=this.renderer,o=r===null?new Ne:r.getDrawingBufferSize(new Ne),a={minFilter:Xr,magFilter:Xr,stencilBuffer:t,depthBuffer:e,type:s},c=new Tt(o.width,o.height,a);return i>0&&(c.ignoreDepthForMultisampleCopy=!1,c.samples=i),s===_s&&Xn(r)===He&&Ns(c.texture,He),c.texture.name="EffectComposer.Buffer",c.texture.generateMipmaps=!1,c}setMainScene(e){for(const t of this.passes)t.mainScene=e}setMainCamera(e){for(const t of this.passes)t.mainCamera=e}addPass(e,t){const s=this.passes,i=this.renderer,r=i.getDrawingBufferSize(new Ne),o=i.getContext().getContextAttributes().alpha,a=this.inputBuffer.texture.type;if(e.setRenderer(i),e.setSize(r.width,r.height),e.initialize(i,o,a),this.autoRenderToScreen&&(s.length>0&&(s[s.length-1].renderToScreen=!1),e.renderToScreen&&(this.autoRenderToScreen=!1)),t!==void 0?s.splice(t,0,e):s.push(e),this.autoRenderToScreen&&(s[s.length-1].renderToScreen=!0),e.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const c=this.createDepthTexture();for(e of s)e.setDepthTexture(c)}else e.setDepthTexture(this.depthTexture)}removePass(e){const t=this.passes,s=t.indexOf(e);if(s!==-1&&t.splice(s,1).length>0){if(this.depthTexture!==null){const o=(c,l)=>c||l.needsDepthTexture;t.reduce(o,!1)||(e.getDepthTexture()===this.depthTexture&&e.setDepthTexture(null),this.deleteDepthTexture())}this.autoRenderToScreen&&s===t.length&&(e.renderToScreen=!1,t.length>0&&(t[t.length-1].renderToScreen=!0))}}removeAllPasses(){const e=this.passes;this.deleteDepthTexture(),e.length>0&&(this.autoRenderToScreen&&(e[e.length-1].renderToScreen=!1),this.passes=[])}render(e){const t=this.renderer,s=this.copyPass;let i=this.inputBuffer,r=this.outputBuffer,o=!1,a,c,l;e===void 0&&(this.timer.update(),e=this.timer.delta);for(const u of this.passes)u.enabled&&(u.render(t,i,r,e,o),u.needsSwap&&(o&&(s.renderToScreen=u.renderToScreen,a=t.getContext(),c=t.state.buffers.stencil,c.setFunc(a.NOTEQUAL,1,4294967295),s.render(t,i,r,e,o),c.setFunc(a.EQUAL,1,4294967295)),l=i,i=r,r=l),u instanceof p0?o=!0:u instanceof c0&&(o=!1))}setSize(e,t,s){const i=this.renderer,r=i.getSize(new Ne);(e===void 0||t===void 0)&&(e=r.width,t=r.height),(r.width!==e||r.height!==t)&&i.setSize(e,t,s);const o=i.getDrawingBufferSize(new Ne);this.inputBuffer.setSize(o.width,o.height),this.outputBuffer.setSize(o.width,o.height);for(const a of this.passes)a.setSize(o.width,o.height)}reset(){const e=this.timer.autoReset;this.dispose(),this.autoRenderToScreen=!0,this.timer.autoReset=e}dispose(){for(const e of this.passes)e.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose()}},T0=class{constructor(){this.shaderParts=new Map([[ie.FRAGMENT_HEAD,null],[ie.FRAGMENT_MAIN_UV,null],[ie.FRAGMENT_MAIN_IMAGE,null],[ie.VERTEX_HEAD,null],[ie.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=fs.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Ao}},aa=!1,gl=class{constructor(n=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(n),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Ri:t=this.materialsFlatShadedDoubleSide;break;case Er:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Ri:t=this.materialsDoubleSide;break;case Er:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(n){if(!(n instanceof es))return n.clone();const e=n.uniforms,t=new Map;for(const i in e){const r=e[i].value;r.isRenderTargetTexture&&(e[i].value=null,t.set(i,r))}const s=n.clone();for(const i of t)e[i[0]].value=i[1],s.uniforms[i[0]].value=i[1];return s}setMaterial(n){if(this.disposeMaterials(),this.material=n,n!==null){const e=this.materials=[this.cloneMaterial(n),this.cloneMaterial(n),this.cloneMaterial(n)];for(const t of e)t.uniforms=Object.assign({},n.uniforms),t.side=Ff;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.side=Er,s}),this.materialsDoubleSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.side=Ri,s}),this.materialsFlatShaded=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.flatShading=!0,s}),this.materialsFlatShadedBackSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.flatShading=!0,s.side=Er,s}),this.materialsFlatShadedDoubleSide=e.map(t=>{const s=this.cloneMaterial(t);return s.uniforms=Object.assign({},n.uniforms),s.flatShading=!0,s.side=Ri,s})}}render(n,e,t){const s=n.shadowMap.enabled;if(n.shadowMap.enabled=!1,aa){const i=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),n.render(e,t);for(const r of i)r[0].material=r[1];this.meshCount!==i.size&&i.clear()}else{const i=e.overrideMaterial;e.overrideMaterial=this.material,n.render(e,t),e.overrideMaterial=i}n.shadowMap.enabled=s}disposeMaterials(){if(this.material!==null){const n=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of n)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return aa}static set workaroundEnabled(n){aa=n}},Os=-1,Ee=class extends Ja{constructor(n,e=Os,t=Os,s=1){super(),this.resizable=n,this.baseSize=new Ne(1,1),this.preferredSize=new Ne(e,t),this.target=this.preferredSize,this.s=s,this.effectiveSize=new Ne,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const n=this.baseSize,e=this.preferredSize,t=this.effectiveSize,s=this.scale;e.width!==Os?t.width=e.width:e.height!==Os?t.width=Math.round(e.height*(n.width/Math.max(n.height,1))):t.width=Math.round(n.width*s),e.height!==Os?t.height=e.height:e.width!==Os?t.height=Math.round(e.width/Math.max(n.width/Math.max(n.height,1),1)):t.height=Math.round(n.height*s)}get width(){return this.effectiveSize.width}set width(n){this.preferredWidth=n}get height(){return this.effectiveSize.height}set height(n){this.preferredHeight=n}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(n){this.s!==n&&(this.s=n,this.preferredSize.setScalar(Os),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(n){this.scale=n}get baseWidth(){return this.baseSize.width}set baseWidth(n){this.baseSize.width!==n&&(this.baseSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(n){this.baseWidth=n}get baseHeight(){return this.baseSize.height}set baseHeight(n){this.baseSize.height!==n&&(this.baseSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(n){this.baseHeight=n}setBaseSize(n,e){(this.baseSize.width!==n||this.baseSize.height!==e)&&(this.baseSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(n){this.preferredSize.width!==n&&(this.preferredSize.width=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(n){this.preferredWidth=n}get preferredHeight(){return this.preferredSize.height}set preferredHeight(n){this.preferredSize.height!==n&&(this.preferredSize.height=n,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(n){this.preferredHeight=n}setPreferredSize(n,e){(this.preferredSize.width!==n||this.preferredSize.height!==e)&&(this.preferredSize.set(n,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(n){this.s=n.scale,this.baseSize.set(n.baseWidth,n.baseHeight),this.preferredSize.set(n.preferredWidth,n.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return Os}},k0=class extends Set{constructor(n,e=10){super(),this.l=e,this.exclusive=!1,n!==void 0&&this.set(n)}get layer(){return this.l}set layer(n){const e=this.l;for(const t of this)t.layers.disable(e),t.layers.enable(n);this.l=n}getLayer(){return this.layer}setLayer(n){this.layer=n}isExclusive(){return this.exclusive}setExclusive(n){this.exclusive=n}clear(){const n=this.layer;for(const e of this)e.layers.disable(n);return super.clear()}set(n){this.clear();for(const e of n)this.add(e);return this}indexOf(n){return this.has(n)?0:-1}add(n){return this.exclusive?n.layers.set(this.layer):n.layers.enable(this.layer),super.add(n)}delete(n){return this.has(n)&&n.layers.disable(this.layer),super.delete(n)}toggle(n){let e;return this.has(n)?(this.delete(n),e=!1):(this.add(n),e=!0),e}setVisible(n){for(const e of this)n?e.layers.enable(0):e.layers.disable(0);return this}},w0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y,opacity);}",S0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,min(y.a,opacity));}",C0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y)*0.5,opacity);}",b0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.rg,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",E0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(step(0.0,y)*(1.0-min(vec4(1.0),(1.0-x)/y)),vec4(1.0),step(1.0,x));return mix(x,z,opacity);}",O0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=step(0.0,x)*mix(min(vec4(1.0),x/max(1.0-y,1e-9)),vec4(1.0),step(1.0,y));return mix(x,z,opacity);}",A0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x,y),opacity);}",M0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,abs(x-y),opacity);}",D0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x/max(y,1e-12),opacity);}",R0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,(x+y-2.0*x*y),opacity);}",P0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 a=min(x,1.0),b=min(y,1.0);vec4 z=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,y));return mix(x,z,opacity);}",I0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,step(1.0,x+y),opacity);}",N0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(yHSL.r,xHSL.gb));return vec4(mix(x.rgb,z,opacity),y.a);}",F0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-y,opacity);}",U0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y*(1.0-x),opacity);}",L0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x,y),opacity);}",z0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(y+x-1.0,0.0,1.0),opacity);}",B0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,min(x+y,1.0),opacity);}",V0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,clamp(2.0*y+x-1.0,0.0,1.0),opacity);}",j0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.rg,yHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",H0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x*y,opacity);}",q0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,1.0-abs(1.0-x-y),opacity);}",W0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,y,opacity);}",G0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(2.0*y*x,1.0-2.0*(1.0-y)*(1.0-x),step(0.5,x));return mix(x,z,opacity);}",Y0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 z=mix(mix(y2,x,step(0.5*x,y)),max(vec4(0.0),y2-1.0),step(x,(y2-1.0)));return mix(x,z,opacity);}",Z0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(min(x*x/max(1.0-y,1e-12),1.0),y,step(1.0,y));return mix(x,z,opacity);}",X0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec3 xHSL=RGBToHSL(x.rgb);vec3 yHSL=RGBToHSL(y.rgb);vec3 z=HSLToRGB(vec3(xHSL.r,yHSL.g,xHSL.b));return vec4(mix(x.rgb,z,opacity),y.a);}",$0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,x+y-min(x*y,1.0),opacity);}",Q0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 y2=2.0*y;vec4 w=step(0.5,y);vec4 z=mix(x-(1.0-y2)*x*(1.0-x),mix(x+(y2-1.0)*(sqrt(x)-x),x+(y2-1.0)*x*((16.0*x-12.0)*x+3.0),w*(1.0-step(0.25,x))),w);return mix(x,z,opacity);}",K0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return y;}",J0="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){return mix(x,max(x+y-1.0,0.0),opacity);}",em="vec4 blend(const in vec4 x,const in vec4 y,const in float opacity){vec4 z=mix(max(1.0-min((1.0-x)/(2.0*y),1.0),0.0),min(x/(2.0*(1.0-y)),1.0),step(0.5,y));return mix(x,z,opacity);}",tm=new Map([[ee.ADD,w0],[ee.ALPHA,S0],[ee.AVERAGE,C0],[ee.COLOR,b0],[ee.COLOR_BURN,E0],[ee.COLOR_DODGE,O0],[ee.DARKEN,A0],[ee.DIFFERENCE,M0],[ee.DIVIDE,D0],[ee.DST,null],[ee.EXCLUSION,R0],[ee.HARD_LIGHT,P0],[ee.HARD_MIX,I0],[ee.HUE,N0],[ee.INVERT,F0],[ee.INVERT_RGB,U0],[ee.LIGHTEN,L0],[ee.LINEAR_BURN,z0],[ee.LINEAR_DODGE,B0],[ee.LINEAR_LIGHT,V0],[ee.LUMINOSITY,j0],[ee.MULTIPLY,H0],[ee.NEGATION,q0],[ee.NORMAL,W0],[ee.OVERLAY,G0],[ee.PIN_LIGHT,Y0],[ee.REFLECT,Z0],[ee.SATURATION,X0],[ee.SCREEN,$0],[ee.SOFT_LIGHT,Q0],[ee.SRC,K0],[ee.SUBTRACT,J0],[ee.VIVID_LIGHT,em]]),sm=class extends Ja{constructor(n,e=1){super(),this._blendFunction=n,this.opacity=new $(e)}getOpacity(){return this.opacity.value}setOpacity(n){this.opacity.value=n}get blendFunction(){return this._blendFunction}set blendFunction(n){this._blendFunction=n,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(n){this.blendFunction=n}getShaderCode(){return tm.get(this.blendFunction)}},zi=class extends Ja{constructor(e,t,{attributes:s=fs.NONE,blendFunction:i=ee.NORMAL,defines:r=new Map,uniforms:o=new Map,extensions:a=null,vertexShader:c=null}={}){super(),this.name=e,this.renderer=null,this.attributes=s,this.fragmentShader=t,this.vertexShader=c,this.defines=r,this.uniforms=o,this.extensions=a,this.blendMode=new sm(i),this.blendMode.addEventListener("change",l=>this.setChanged()),this._inputColorSpace=Ao,this._outputColorSpace=Cu}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(e){this._inputColorSpace=e,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e,this.setChanged()}set mainScene(e){}set mainCamera(e){}getName(){return this.name}setRenderer(e){this.renderer=e}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(e){this.attributes=e,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(e){this.fragmentShader=e,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(e){this.vertexShader=e,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(e,t=ci){}update(e,t,s){}setSize(e,t){}initialize(e,t,s){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof Tt||t instanceof _u||t instanceof gu||t instanceof it)&&this[e].dispose()}}},nm=`#ifdef FRAMEBUFFER_PRECISION_HIGH uniform mediump sampler2D map; #else uniform lowp sampler2D map; #endif -uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 texel=texture2D(map,uv);outputColor=vec4(texel.rgb*intensity,texel.a);}`,nm=class extends zi{constructor({blendFunction:n=ee.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,mipmapBlur:s=!1,intensity:i=1,radius:r=.85,levels:o=8,kernelSize:a=Mo.LARGE,resolutionScale:c=.5,width:l=Ee.AUTO_SIZE,height:u=Ee.AUTO_SIZE,resolutionX:h=l,resolutionY:d=u}={}){super("BloomEffect",sm,{blendFunction:n,uniforms:new Map([["map",new $(null)],["intensity",new $(i)]])}),this.renderTarget=new Tt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new Mu({kernelSize:a}),this.luminancePass=new d0({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new p0,this.mipmapBlurPass.enabled=s,this.mipmapBlurPass.radius=r,this.mipmapBlurPass.levels=o,this.uniforms.get("map").value=s?this.mipmapBlurPass.texture:this.renderTarget.texture;const f=this.resolution=new Ee(this,h,d,c);f.addEventListener("change",m=>this.setSize(f.baseWidth,f.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(n){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(n){this.uniforms.get("intensity").value=n}getIntensity(){return this.intensity}setIntensity(n){this.intensity=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}update(n,e,t){const s=this.renderTarget,i=this.luminancePass;i.enabled?(i.render(n,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,i.renderTarget):this.blurPass.render(n,i.renderTarget,s)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,e):this.blurPass.render(n,e,s)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(n,e),this.mipmapBlurPass.setSize(n,e)}initialize(n,e,t){this.blurPass.initialize(n,e,t),this.luminancePass.initialize(n,e,t),this.mipmapBlurPass.initialize(n,e,t),t!==void 0&&(this.renderTarget.texture.type=t,Xn(n)===He&&Ns(this.renderTarget.texture,He))}},im=`uniform lowp sampler2D edgeTexture;uniform lowp sampler2D maskTexture;uniform vec3 visibleEdgeColor;uniform vec3 hiddenEdgeColor;uniform float pulse;uniform float edgeStrength; +uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){vec4 texel=texture2D(map,uv);outputColor=vec4(texel.rgb*intensity,texel.a);}`,im=class extends zi{constructor({blendFunction:n=ee.SCREEN,luminanceThreshold:e=.9,luminanceSmoothing:t=.025,mipmapBlur:s=!1,intensity:i=1,radius:r=.85,levels:o=8,kernelSize:a=Mo.LARGE,resolutionScale:c=.5,width:l=Ee.AUTO_SIZE,height:u=Ee.AUTO_SIZE,resolutionX:h=l,resolutionY:d=u}={}){super("BloomEffect",nm,{blendFunction:n,uniforms:new Map([["map",new $(null)],["intensity",new $(i)]])}),this.renderTarget=new Tt(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new Mu({kernelSize:a}),this.luminancePass=new f0({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new m0,this.mipmapBlurPass.enabled=s,this.mipmapBlurPass.radius=r,this.mipmapBlurPass.levels=o,this.uniforms.get("map").value=s?this.mipmapBlurPass.texture:this.renderTarget.texture;const f=this.resolution=new Ee(this,h,d,c);f.addEventListener("change",m=>this.setSize(f.baseWidth,f.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(n){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(n){this.uniforms.get("intensity").value=n}getIntensity(){return this.intensity}setIntensity(n){this.intensity=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}update(n,e,t){const s=this.renderTarget,i=this.luminancePass;i.enabled?(i.render(n,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,i.renderTarget):this.blurPass.render(n,i.renderTarget,s)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(n,e):this.blurPass.render(n,e,s)}setSize(n,e){const t=this.resolution;t.setBaseSize(n,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(n,e),this.mipmapBlurPass.setSize(n,e)}initialize(n,e,t){this.blurPass.initialize(n,e,t),this.luminancePass.initialize(n,e,t),this.mipmapBlurPass.initialize(n,e,t),t!==void 0&&(this.renderTarget.texture.type=t,Xn(n)===He&&Ns(this.renderTarget.texture,He))}},rm=`uniform lowp sampler2D edgeTexture;uniform lowp sampler2D maskTexture;uniform vec3 visibleEdgeColor;uniform vec3 hiddenEdgeColor;uniform float pulse;uniform float edgeStrength; #ifdef USE_PATTERN uniform lowp sampler2D patternTexture;varying vec2 vUvPattern; #endif @@ -207,13 +207,13 @@ outputColor=vec4(color,alpha); #else outputColor=vec4(color,max(alpha,inputColor.a)); #endif -}`,rm="uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}",om=class extends zi{constructor(n,e,{blendFunction:t=ee.SCREEN,patternTexture:s=null,patternScale:i=1,edgeStrength:r=1,pulseSpeed:o=0,visibleEdgeColor:a=16777215,hiddenEdgeColor:c=2230538,kernelSize:l=Mo.VERY_SMALL,blur:u=!1,xRay:h=!0,multisampling:d=0,resolutionScale:f=.5,width:m=Ee.AUTO_SIZE,height:p=Ee.AUTO_SIZE,resolutionX:g=m,resolutionY:y=p}={}){super("OutlineEffect",im,{uniforms:new Map([["maskTexture",new $(null)],["edgeTexture",new $(null)],["edgeStrength",new $(r)],["visibleEdgeColor",new $(new ds(a))],["hiddenEdgeColor",new $(new ds(c))],["pulse",new $(1)],["patternScale",new $(i)],["patternTexture",new $(null)]])}),this.blendMode.addEventListener("change",_=>{this.blendMode.blendFunction===ee.ALPHA?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA"),this.setChanged()}),this.blendMode.blendFunction=t,this.patternTexture=s,this.xRay=h,this.scene=n,this.camera=e,this.renderTargetMask=new Tt(1,1),this.renderTargetMask.samples=d,this.renderTargetMask.texture.name="Outline.Mask",this.uniforms.get("maskTexture").value=this.renderTargetMask.texture,this.renderTargetOutline=new Tt(1,1,{depthBuffer:!1}),this.renderTargetOutline.texture.name="Outline.Edges",this.uniforms.get("edgeTexture").value=this.renderTargetOutline.texture,this.clearPass=new nc,this.clearPass.overrideClearColor=new ds(0),this.clearPass.overrideClearAlpha=1,this.depthPass=new c0(n,e),this.maskPass=new Do(n,e,new Bp(this.depthPass.texture,e));const w=this.maskPass.clearPass;w.overrideClearColor=new ds(16777215),w.overrideClearAlpha=1,this.blurPass=new Mu({resolutionScale:f,resolutionX:g,resolutionY:y,kernelSize:l}),this.blurPass.enabled=u;const S=this.blurPass.resolution;S.addEventListener("change",_=>this.setSize(S.baseWidth,S.baseHeight)),this.outlinePass=new _0(new e0);const v=this.outlinePass.fullscreenMaterial;v.inputBuffer=this.renderTargetMask.texture,this.time=0,this.forceUpdate=!0,this.selection=new T0,this.selection.layer=10,this.pulseSpeed=o}set mainScene(n){this.scene=n,this.depthPass.mainScene=n,this.maskPass.mainScene=n}set mainCamera(n){this.camera=n,this.depthPass.mainCamera=n,this.maskPass.mainCamera=n,this.maskPass.overrideMaterial.copyCameraSettings(n)}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.getResolution()}get multisampling(){return this.renderTargetMask.samples}set multisampling(n){this.renderTargetMask.samples=n,this.renderTargetMask.dispose()}get patternScale(){return this.uniforms.get("patternScale").value}set patternScale(n){this.uniforms.get("patternScale").value=n}get edgeStrength(){return this.uniforms.get("edgeStrength").value}set edgeStrength(n){this.uniforms.get("edgeStrength").value=n}get visibleEdgeColor(){return this.uniforms.get("visibleEdgeColor").value}set visibleEdgeColor(n){this.uniforms.get("visibleEdgeColor").value=n}get hiddenEdgeColor(){return this.uniforms.get("hiddenEdgeColor").value}set hiddenEdgeColor(n){this.uniforms.get("hiddenEdgeColor").value=n}getBlurPass(){return this.blurPass}getSelection(){return this.selection}getPulseSpeed(){return this.pulseSpeed}setPulseSpeed(n){this.pulseSpeed=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get selectionLayer(){return this.selection.layer}set selectionLayer(n){this.selection.layer=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get blur(){return this.blurPass.enabled}set blur(n){this.blurPass.enabled=n}get xRay(){return this.defines.has("X_RAY")}set xRay(n){this.xRay!==n&&(n?this.defines.set("X_RAY","1"):this.defines.delete("X_RAY"),this.setChanged())}isXRayEnabled(){return this.xRay}setXRayEnabled(n){this.xRay=n}get patternTexture(){return this.uniforms.get("patternTexture").value}set patternTexture(n){n!==null?(n.wrapS=n.wrapT=Uf,this.defines.set("USE_PATTERN","1"),this.setVertexShader(rm)):(this.defines.delete("USE_PATTERN"),this.setVertexShader(null)),this.uniforms.get("patternTexture").value=n,this.setChanged()}setPatternTexture(n){this.patternTexture=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}setSelection(n){return this.selection.set(n),this}clearSelection(){return this.selection.clear(),this}selectObject(n){return this.selection.add(n),this}deselectObject(n){return this.selection.delete(n),this}update(n,e,t){const s=this.scene,i=this.camera,r=this.selection,a=this.uniforms.get("pulse"),c=s.background,l=i.layers.mask;(this.forceUpdate||r.size>0)&&(s.background=null,a.value=1,this.pulseSpeed>0&&(a.value=Math.cos(this.time*this.pulseSpeed*10)*.375+.625),this.time+=t,r.setVisible(!1),this.depthPass.render(n),r.setVisible(!0),i.layers.set(r.layer),this.maskPass.render(n,this.renderTargetMask),i.layers.mask=l,s.background=c,this.outlinePass.render(n,null,this.renderTargetOutline),this.blurPass.enabled&&this.blurPass.render(n,this.renderTargetOutline,this.renderTargetOutline)),this.forceUpdate=r.size>0}setSize(n,e){this.blurPass.setSize(n,e),this.renderTargetMask.setSize(n,e);const t=this.resolution;t.setBaseSize(n,e);const s=t.width,i=t.height;this.depthPass.setSize(s,i),this.renderTargetOutline.setSize(s,i),this.outlinePass.fullscreenMaterial.setSize(s,i)}initialize(n,e,t){this.blurPass.initialize(n,e,_s),t!==void 0&&(this.depthPass.initialize(n,e,t),this.maskPass.initialize(n,e,t),this.outlinePass.initialize(n,e,t))}},am=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; +}`,om="uniform float patternScale;varying vec2 vUvPattern;void mainSupport(const in vec2 uv){vUvPattern=uv*vec2(aspect,1.0)*patternScale;}",am=class extends zi{constructor(n,e,{blendFunction:t=ee.SCREEN,patternTexture:s=null,patternScale:i=1,edgeStrength:r=1,pulseSpeed:o=0,visibleEdgeColor:a=16777215,hiddenEdgeColor:c=2230538,kernelSize:l=Mo.VERY_SMALL,blur:u=!1,xRay:h=!0,multisampling:d=0,resolutionScale:f=.5,width:m=Ee.AUTO_SIZE,height:p=Ee.AUTO_SIZE,resolutionX:g=m,resolutionY:y=p}={}){super("OutlineEffect",rm,{uniforms:new Map([["maskTexture",new $(null)],["edgeTexture",new $(null)],["edgeStrength",new $(r)],["visibleEdgeColor",new $(new ds(a))],["hiddenEdgeColor",new $(new ds(c))],["pulse",new $(1)],["patternScale",new $(i)],["patternTexture",new $(null)]])}),this.blendMode.addEventListener("change",_=>{this.blendMode.blendFunction===ee.ALPHA?this.defines.set("ALPHA","1"):this.defines.delete("ALPHA"),this.setChanged()}),this.blendMode.blendFunction=t,this.patternTexture=s,this.xRay=h,this.scene=n,this.camera=e,this.renderTargetMask=new Tt(1,1),this.renderTargetMask.samples=d,this.renderTargetMask.texture.name="Outline.Mask",this.uniforms.get("maskTexture").value=this.renderTargetMask.texture,this.renderTargetOutline=new Tt(1,1,{depthBuffer:!1}),this.renderTargetOutline.texture.name="Outline.Edges",this.uniforms.get("edgeTexture").value=this.renderTargetOutline.texture,this.clearPass=new nc,this.clearPass.overrideClearColor=new ds(0),this.clearPass.overrideClearAlpha=1,this.depthPass=new l0(n,e),this.maskPass=new Do(n,e,new Vp(this.depthPass.texture,e));const w=this.maskPass.clearPass;w.overrideClearColor=new ds(16777215),w.overrideClearAlpha=1,this.blurPass=new Mu({resolutionScale:f,resolutionX:g,resolutionY:y,kernelSize:l}),this.blurPass.enabled=u;const S=this.blurPass.resolution;S.addEventListener("change",_=>this.setSize(S.baseWidth,S.baseHeight)),this.outlinePass=new g0(new t0);const v=this.outlinePass.fullscreenMaterial;v.inputBuffer=this.renderTargetMask.texture,this.time=0,this.forceUpdate=!0,this.selection=new k0,this.selection.layer=10,this.pulseSpeed=o}set mainScene(n){this.scene=n,this.depthPass.mainScene=n,this.maskPass.mainScene=n}set mainCamera(n){this.camera=n,this.depthPass.mainCamera=n,this.maskPass.mainCamera=n,this.maskPass.overrideMaterial.copyCameraSettings(n)}get resolution(){return this.blurPass.resolution}getResolution(){return this.blurPass.getResolution()}get multisampling(){return this.renderTargetMask.samples}set multisampling(n){this.renderTargetMask.samples=n,this.renderTargetMask.dispose()}get patternScale(){return this.uniforms.get("patternScale").value}set patternScale(n){this.uniforms.get("patternScale").value=n}get edgeStrength(){return this.uniforms.get("edgeStrength").value}set edgeStrength(n){this.uniforms.get("edgeStrength").value=n}get visibleEdgeColor(){return this.uniforms.get("visibleEdgeColor").value}set visibleEdgeColor(n){this.uniforms.get("visibleEdgeColor").value=n}get hiddenEdgeColor(){return this.uniforms.get("hiddenEdgeColor").value}set hiddenEdgeColor(n){this.uniforms.get("hiddenEdgeColor").value=n}getBlurPass(){return this.blurPass}getSelection(){return this.selection}getPulseSpeed(){return this.pulseSpeed}setPulseSpeed(n){this.pulseSpeed=n}get width(){return this.resolution.width}set width(n){this.resolution.preferredWidth=n}get height(){return this.resolution.height}set height(n){this.resolution.preferredHeight=n}get selectionLayer(){return this.selection.layer}set selectionLayer(n){this.selection.layer=n}get dithering(){return this.blurPass.dithering}set dithering(n){this.blurPass.dithering=n}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(n){this.blurPass.kernelSize=n}get blur(){return this.blurPass.enabled}set blur(n){this.blurPass.enabled=n}get xRay(){return this.defines.has("X_RAY")}set xRay(n){this.xRay!==n&&(n?this.defines.set("X_RAY","1"):this.defines.delete("X_RAY"),this.setChanged())}isXRayEnabled(){return this.xRay}setXRayEnabled(n){this.xRay=n}get patternTexture(){return this.uniforms.get("patternTexture").value}set patternTexture(n){n!==null?(n.wrapS=n.wrapT=Uf,this.defines.set("USE_PATTERN","1"),this.setVertexShader(om)):(this.defines.delete("USE_PATTERN"),this.setVertexShader(null)),this.uniforms.get("patternTexture").value=n,this.setChanged()}setPatternTexture(n){this.patternTexture=n}getResolutionScale(){return this.resolution.scale}setResolutionScale(n){this.resolution.scale=n}setSelection(n){return this.selection.set(n),this}clearSelection(){return this.selection.clear(),this}selectObject(n){return this.selection.add(n),this}deselectObject(n){return this.selection.delete(n),this}update(n,e,t){const s=this.scene,i=this.camera,r=this.selection,a=this.uniforms.get("pulse"),c=s.background,l=i.layers.mask;(this.forceUpdate||r.size>0)&&(s.background=null,a.value=1,this.pulseSpeed>0&&(a.value=Math.cos(this.time*this.pulseSpeed*10)*.375+.625),this.time+=t,r.setVisible(!1),this.depthPass.render(n),r.setVisible(!0),i.layers.set(r.layer),this.maskPass.render(n,this.renderTargetMask),i.layers.mask=l,s.background=c,this.outlinePass.render(n,null,this.renderTargetOutline),this.blurPass.enabled&&this.blurPass.render(n,this.renderTargetOutline,this.renderTargetOutline)),this.forceUpdate=r.size>0}setSize(n,e){this.blurPass.setSize(n,e),this.renderTargetMask.setSize(n,e);const t=this.resolution;t.setBaseSize(n,e);const s=t.width,i=t.height;this.depthPass.setSize(s,i),this.renderTargetOutline.setSize(s,i),this.outlinePass.fullscreenMaterial.setSize(s,i)}initialize(n,e,t){this.blurPass.initialize(n,e,_s),t!==void 0&&(this.depthPass.initialize(n,e,t),this.maskPass.initialize(n,e,t),this.outlinePass.initialize(n,e,t))}},cm=`uniform float offset;uniform float darkness;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){const vec2 center=vec2(0.5);vec3 color=inputColor.rgb; #if VIGNETTE_TECHNIQUE == 0 float d=distance(uv,center);color*=smoothstep(0.8,offset*0.799,d*(darkness+offset)); #else vec2 coord=(uv-center)*vec2(offset);color=mix(color,vec3(1.0-darkness),dot(coord,coord)); #endif -outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFunction:n,technique:e=Nr.DEFAULT,eskil:t=!1,offset:s=.5,darkness:i=.5}={}){super("VignetteEffect",am,{blendFunction:n,defines:new Map([["VIGNETTE_TECHNIQUE",e.toFixed(0)]]),uniforms:new Map([["offset",new $(s)],["darkness",new $(i)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(n){this.technique!==n&&(this.defines.set("VIGNETTE_TECHNIQUE",n.toFixed(0)),this.setChanged())}get eskil(){return this.technique===Nr.ESKIL}set eskil(n){this.technique=n?Nr.ESKIL:Nr.DEFAULT}getTechnique(){return this.technique}setTechnique(n){this.technique=n}get offset(){return this.uniforms.get("offset").value}set offset(n){this.uniforms.get("offset").value=n}getOffset(){return this.offset}setOffset(n){this.offset=n}get darkness(){return this.uniforms.get("darkness").value}set darkness(n){this.uniforms.get("darkness").value=n}getDarkness(){return this.darkness}setDarkness(n){this.darkness=n}};const Du=b.createContext(null),vl=n=>(n.getAttributes()&fs.CONVOLUTION)===fs.CONVOLUTION,lm=Zr.memo(b.forwardRef(({children:n,camera:e,scene:t,resolutionScale:s,enabled:i=!0,renderPriority:r=1,autoClear:o=!0,depthBuffer:a,disableNormalPass:c,stencilBuffer:l,multisampling:u=8,frameBufferType:h=jf},d)=>{const{gl:f,scene:m,camera:p,size:g}=ge(),y=t||m,w=e||p,[S,v,_]=b.useMemo(()=>{const C=fp(),E=new y0(f,{depthBuffer:a,stencilBuffer:l,multisampling:u>0&&C?u:0,frameBufferType:h});E.addPass(new Do(y,w));let O=null,A=null;return c||(A=new m0(y,w),A.enabled=!1,E.addPass(A),s!==void 0&&C&&(O=new l0({normalBuffer:A.texture,resolutionScale:s}),O.enabled=!1,E.addPass(O))),[E,A,O]},[w,f,a,l,u,h,y,c,s]);b.useEffect(()=>S==null?void 0:S.setSize(g.width,g.height),[S,g]),wt((C,E)=>{if(i){const O=f.autoClear;f.autoClear=o,l&&!o&&f.clearStencil(),S.render(E),f.autoClear=O}},i?r:0);const T=b.useRef(null),x=gf(T);b.useLayoutEffect(()=>{const C=[];if(T.current&&x.current&&S){const E=x.current.objects;for(let O=0;O{for(const E of C)S==null||S.removePass(E);v&&(v.enabled=!1),_&&(_.enabled=!1)}},[S,n,w,v,_,x]);const k=b.useMemo(()=>({composer:S,normalPass:v,downSamplingPass:_,resolutionScale:s,camera:w,scene:y}),[S,v,_,s,w,y]);return b.useImperativeHandle(d,()=>S,[S]),M.jsx(Du.Provider,{value:k,children:M.jsx("group",{ref:T,children:n})})})),yl=n=>typeof n=="object"&&n!=null&&"current"in n?n.current:n;let um=0;const xl=new WeakMap,Ru=(n,e)=>Zr.forwardRef(function({blendFunction:s=e==null?void 0:e.blendFunction,opacity:i=e==null?void 0:e.opacity,...r},o){let a=xl.get(n);if(!a){const u=`@react-three/postprocessing/${n.name}-${um++}`;Ka({[u]:n}),xl.set(n,a=u)}const c=ge(u=>u.camera),l=Zr.useMemo(()=>{var u,h;return[...(u=e==null?void 0:e.args)!=null?u:[],...(h=r.args)!=null?h:[{...e,...r}]]},[JSON.stringify(r)]);return M.jsx(a,{camera:c,"blendMode-blendFunction":s,"blendMode-opacity-value":i,...r,ref:o,args:l})}),hm=Ru(nm,{blendFunction:ee.ADD}),dm=b.forwardRef(function({selection:e=[],selectionLayer:t=10,blendFunction:s,patternTexture:i,edgeStrength:r,pulseSpeed:o,visibleEdgeColor:a,hiddenEdgeColor:c,width:l,height:u,kernelSize:h,blur:d,xRay:f,...m},p){const g=ge(_=>_.invalidate),{scene:y,camera:w}=b.useContext(Du),S=b.useMemo(()=>new om(y,w,{blendFunction:s,patternTexture:i,edgeStrength:r,pulseSpeed:o,visibleEdgeColor:a,hiddenEdgeColor:c,width:l,height:u,kernelSize:h,blur:d,xRay:f,...m}),[s,d,w,r,u,c,h,i,o,y,a,l,f]),v=b.useContext(sc);return b.useEffect(()=>{if(!v&&e)return S.selection.set(Array.isArray(e)?e.map(yl):[yl(e)]),g(),()=>{S.selection.clear(),g()}},[S,e,v,g]),b.useEffect(()=>{S.selectionLayer=t,g()},[S,g,t]),b.useRef(),b.useEffect(()=>{var _;if(v&&v.enabled&&(_=v.selected)!=null&&_.length)return S.selection.set(v.selected),g(),()=>{S.selection.clear(),g()}},[v,S.selection,g]),b.useEffect(()=>()=>{S.dispose()},[S]),M.jsx("primitive",{ref:p,object:S})}),fm=Ru(cm),pm={isUserDragging:!1,isUserScrolling:!1,userMovedCamera:!1,isUserScrollingOnHtmlPanel:!1},Fs=hu(n=>({...pm,setIsUserDragging:e=>n({isUserDragging:e}),setIsUserScrolling:e=>n({isUserScrolling:e}),setUserMovedCamera:e=>n({userMovedCamera:e}),setIsUserScrollingOnHtmlPanel:e=>n({isUserScrollingOnHtmlPanel:e})})),mm=n=>M.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:M.jsxs("g",{id:"arrow_forward",children:[M.jsx("mask",{id:"mask0_8513_325",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:M.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),M.jsx("g",{mask:"url(#mask0_8513_325)",children:M.jsx("path",{id:"arrow_forward_2",d:"M12.4702 9.56277H3.9375C3.77789 9.56277 3.64424 9.50892 3.53655 9.40123C3.42885 9.29355 3.375 9.1599 3.375 9.00028C3.375 8.84067 3.42885 8.70702 3.53655 8.59933C3.64424 8.49165 3.77789 8.4378 3.9375 8.4378H12.4702L8.59326 4.56087C8.48172 4.44933 8.42667 4.3188 8.42812 4.16929C8.42956 4.01977 8.48846 3.88683 8.60481 3.7705C8.72114 3.66185 8.85287 3.6056 8.99998 3.60175C9.14709 3.5979 9.27882 3.65415 9.39516 3.7705L14.1504 8.52578C14.2206 8.59597 14.2701 8.67 14.299 8.74789C14.3278 8.82577 14.3423 8.9099 14.3423 9.00028C14.3423 9.09067 14.3278 9.1748 14.299 9.25268C14.2701 9.33057 14.2206 9.4046 14.1504 9.47479L9.39516 14.2301C9.29132 14.3339 9.16272 14.387 9.00936 14.3894C8.85599 14.3918 8.72114 14.3387 8.60481 14.2301C8.48846 14.1137 8.43028 13.9801 8.43028 13.8291C8.43028 13.6782 8.48846 13.5445 8.60481 13.4282L12.4702 9.56277Z",fill:"currentColor"})})]})}),_m=n=>M.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:M.jsxs("g",{id:"captive_portal",children:[M.jsx("mask",{id:"mask0_8513_13265",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:M.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),M.jsxs("g",{mask:"url(#mask0_8513_13265)",children:[M.jsx("path",{id:"captive_portal_2",d:"M9.99992 17.9154C8.90589 17.9154 7.87735 17.7073 6.91429 17.2912C5.9511 16.8751 5.11318 16.3107 4.40054 15.5981C3.6879 14.8854 3.12353 14.0475 2.70742 13.0843C2.29131 12.1213 2.08325 11.0927 2.08325 9.9987C2.08325 8.90467 2.29131 7.87613 2.70742 6.91307C3.12353 5.94988 3.6879 5.11196 4.40054 4.39932C5.11318 3.68668 5.9511 3.12231 6.91429 2.7062C7.87735 2.29009 8.90589 2.08203 9.99992 2.08203C11.0939 2.08203 12.1225 2.29009 13.0855 2.7062C14.0487 3.12231 14.8867 3.68668 15.5993 4.39932C16.3119 5.11196 16.8763 5.94988 17.2924 6.91307C17.7085 7.87613 17.9166 8.90467 17.9166 9.9987C17.9166 10.1429 17.9131 10.2983 17.9062 10.4649C17.8992 10.6316 17.8861 10.7871 17.8668 10.9314C17.8444 11.1088 17.7699 11.2487 17.6433 11.3512C17.5167 11.4538 17.3605 11.5052 17.1745 11.5052C17.011 11.5052 16.8717 11.4346 16.7564 11.2935C16.641 11.1525 16.5945 10.9977 16.617 10.8289C16.6448 10.6846 16.66 10.5462 16.6626 10.4137C16.6653 10.2812 16.6666 10.1429 16.6666 9.9987C16.6666 9.69425 16.6466 9.39113 16.6066 9.08932C16.5664 8.78738 16.5037 8.48689 16.4183 8.18786H13.3203C13.3727 8.48689 13.4107 8.78738 13.4343 9.08932C13.4578 9.39113 13.4695 9.69425 13.4695 9.9987C13.4695 10.1429 13.4682 10.2962 13.4655 10.4587C13.4628 10.6211 13.4544 10.7743 13.4405 10.9185C13.4182 11.0959 13.345 11.2379 13.221 11.3447C13.0971 11.4517 12.9464 11.5052 12.7691 11.5052C12.6056 11.5052 12.4628 11.4389 12.3405 11.3064C12.2182 11.1739 12.1682 11.0233 12.1905 10.8545C12.2044 10.7102 12.2128 10.5676 12.2155 10.4266C12.2182 10.2855 12.2195 10.1429 12.2195 9.9987C12.2195 9.69425 12.2078 9.39113 12.1843 9.08932C12.1607 8.78738 12.1228 8.48689 12.0705 8.18786H7.92929C7.87707 8.48689 7.83915 8.78738 7.81554 9.08932C7.79207 9.39113 7.78033 9.69425 7.78033 9.9987C7.78033 10.3031 7.79207 10.6063 7.81554 10.9081C7.83915 11.21 7.87707 11.5105 7.92929 11.8095H10.3685C10.5458 11.8095 10.6944 11.8694 10.8141 11.9891C10.9337 12.1087 10.9935 12.2572 10.9935 12.4345C10.9935 12.6119 10.9337 12.7604 10.8141 12.8802C10.6944 12.9997 10.5458 13.0595 10.3685 13.0595H8.21617C8.39895 13.7155 8.63693 14.3445 8.93013 14.9466C9.22346 15.5487 9.58006 16.1157 9.99992 16.6477C10.1495 16.6477 10.2991 16.6485 10.4487 16.6502C10.5983 16.6517 10.7451 16.6429 10.8893 16.6237C11.0614 16.6012 11.2051 16.6455 11.3203 16.7566C11.4358 16.8677 11.4935 17.0093 11.4935 17.1814C11.4935 17.3672 11.4457 17.5222 11.3501 17.6462C11.2544 17.7701 11.1179 17.8432 10.9405 17.8656C10.7964 17.8849 10.641 17.898 10.4743 17.9049C10.3076 17.9119 10.1495 17.9154 9.99992 17.9154ZM3.58159 11.8095H6.6795C6.62714 11.5105 6.58915 11.21 6.56554 10.9081C6.54207 10.6063 6.53033 10.3031 6.53033 9.9987C6.53033 9.69425 6.54207 9.39113 6.56554 9.08932C6.58915 8.78738 6.62714 8.48689 6.6795 8.18786H3.58159C3.49617 8.48689 3.43339 8.78738 3.39325 9.08932C3.35325 9.39113 3.33325 9.69425 3.33325 9.9987C3.33325 10.3031 3.35325 10.6063 3.39325 10.9081C3.43339 11.21 3.49617 11.5105 3.58159 11.8095ZM8.38617 16.4345C8.05075 15.9143 7.76256 15.3715 7.52159 14.8064C7.28061 14.2413 7.08429 13.659 6.93263 13.0595H4.10575C4.54047 13.9174 5.1302 14.6413 5.87492 15.231C6.61964 15.8209 7.45672 16.222 8.38617 16.4345ZM4.10575 6.93786H6.93263C7.0736 6.33314 7.26325 5.74821 7.50159 5.18307C7.73978 4.61779 8.03464 4.07773 8.38617 3.56286C7.45131 3.77009 6.6129 4.16856 5.87096 4.75828C5.12888 5.348 4.54047 6.07453 4.10575 6.93786ZM8.21617 6.93786H11.7837C11.6063 6.28189 11.3669 5.65557 11.0655 5.05891C10.7643 4.4621 10.4091 3.89238 9.99992 3.34974C9.58534 3.88168 9.22874 4.4487 8.93013 5.05078C8.63152 5.65286 8.39353 6.28189 8.21617 6.93786ZM13.0672 6.93786H15.8941C15.4594 6.07453 14.871 5.34668 14.1289 4.75432C13.3869 4.16182 12.5485 3.76467 11.6137 3.56286C11.9491 4.08314 12.2333 4.62717 12.4662 5.19495C12.6991 5.76286 12.8994 6.34384 13.0672 6.93786Z",fill:"currentColor"}),M.jsx("path",{id:"travel_explore",d:"M18.0634 18.7783L16.8556 17.5822C16.6378 17.7211 16.4031 17.8331 16.1517 17.9184C15.9003 18.0038 15.6342 18.0465 15.3535 18.0465C14.6044 18.0465 13.9694 17.7857 13.4484 17.2642C12.9275 16.7428 12.667 16.1071 12.667 15.3572C12.667 14.6074 12.9275 13.9717 13.4484 13.4502C13.9694 12.9287 14.6044 12.668 15.3535 12.668C16.1026 12.668 16.7376 12.9287 17.2586 13.4502C17.7795 13.9717 18.04 14.6074 18.04 15.3572C18.04 15.6425 17.9963 15.9121 17.9089 16.166C17.8215 16.4198 17.7063 16.6557 17.5633 16.8738L18.7711 18.0698C18.8684 18.1628 18.917 18.2798 18.917 18.4208C18.917 18.5618 18.8684 18.6809 18.7711 18.7783C18.6781 18.8714 18.5611 18.918 18.4203 18.918C18.2796 18.918 18.1606 18.8714 18.0634 18.7783ZM15.3535 17.038C15.8236 17.038 16.221 16.8755 16.5456 16.5506C16.8703 16.2256 17.0326 15.8278 17.0326 15.3572C17.0326 14.8866 16.8703 14.4888 16.5456 14.1639C16.221 13.8389 15.8236 13.6764 15.3535 13.6764C14.8834 13.6764 14.486 13.8389 14.1614 14.1639C13.8367 14.4888 13.6744 14.8866 13.6744 15.3572C13.6744 15.8278 13.8367 16.2256 14.1614 16.5506C14.486 16.8755 14.8834 17.038 15.3535 17.038Z",fill:"currentColor"})]})]})}),gm=()=>{const[n,e]=b.useState(""),[t,s]=b.useState([]),{fetchData:i,setAbortRequests:r}=kn(f=>f),[o]=du(f=>[f.setBudget]),a=bo(f=>f.setUniverseQuestionIsOpen),c=$d(f=>f.resetAiSummaryAnswer);b.useEffect(()=>{(async()=>{try{const m=await Qd();m.seed_questions&&s(m.seed_questions)}catch(m){console.error("Error fetching seed questions:",m)}})()},[]);const l=async f=>{f&&(c(),a()),await i(o,r,f)},u=!0,h=async f=>{f.keyCode===13&&f.shiftKey===!1&&u&&(f.preventDefault(),l(n))},d=async f=>{e(f),await l(f)};return M.jsxs(xm,{children:["Ideas have shape",M.jsxs(ym,{onKeyDown:h,py:12,tabIndex:-1,children:[M.jsx(vm,{minRows:5,onChange:f=>e(f.target.value),placeholder:"Enter your question",value:n}),M.jsx(Tm,{color:"secondary",endIcon:M.jsx(mm,{}),onClick:()=>l(n),variant:"contained",children:"Search"})]}),t.length>0&&M.jsx(wm,{children:t.map(f=>M.jsx(Sm,{onClick:()=>d(f),children:f},f))}),M.jsx(km,{onClick:a,startIcon:M.jsx(_m,{}),children:"Explore graph"})]})},vm=Ve(Zf)` +outputColor=vec4(color,inputColor.a);}`,lm=class extends zi{constructor({blendFunction:n,technique:e=Nr.DEFAULT,eskil:t=!1,offset:s=.5,darkness:i=.5}={}){super("VignetteEffect",cm,{blendFunction:n,defines:new Map([["VIGNETTE_TECHNIQUE",e.toFixed(0)]]),uniforms:new Map([["offset",new $(s)],["darkness",new $(i)]])})}get technique(){return Number(this.defines.get("VIGNETTE_TECHNIQUE"))}set technique(n){this.technique!==n&&(this.defines.set("VIGNETTE_TECHNIQUE",n.toFixed(0)),this.setChanged())}get eskil(){return this.technique===Nr.ESKIL}set eskil(n){this.technique=n?Nr.ESKIL:Nr.DEFAULT}getTechnique(){return this.technique}setTechnique(n){this.technique=n}get offset(){return this.uniforms.get("offset").value}set offset(n){this.uniforms.get("offset").value=n}getOffset(){return this.offset}setOffset(n){this.offset=n}get darkness(){return this.uniforms.get("darkness").value}set darkness(n){this.uniforms.get("darkness").value=n}getDarkness(){return this.darkness}setDarkness(n){this.darkness=n}};const Du=b.createContext(null),vl=n=>(n.getAttributes()&fs.CONVOLUTION)===fs.CONVOLUTION,um=Zr.memo(b.forwardRef(({children:n,camera:e,scene:t,resolutionScale:s,enabled:i=!0,renderPriority:r=1,autoClear:o=!0,depthBuffer:a,disableNormalPass:c,stencilBuffer:l,multisampling:u=8,frameBufferType:h=jf},d)=>{const{gl:f,scene:m,camera:p,size:g}=ge(),y=t||m,w=e||p,[S,v,_]=b.useMemo(()=>{const C=pp(),E=new x0(f,{depthBuffer:a,stencilBuffer:l,multisampling:u>0&&C?u:0,frameBufferType:h});E.addPass(new Do(y,w));let O=null,A=null;return c||(A=new _0(y,w),A.enabled=!1,E.addPass(A),s!==void 0&&C&&(O=new u0({normalBuffer:A.texture,resolutionScale:s}),O.enabled=!1,E.addPass(O))),[E,A,O]},[w,f,a,l,u,h,y,c,s]);b.useEffect(()=>S==null?void 0:S.setSize(g.width,g.height),[S,g]),wt((C,E)=>{if(i){const O=f.autoClear;f.autoClear=o,l&&!o&&f.clearStencil(),S.render(E),f.autoClear=O}},i?r:0);const T=b.useRef(null),x=gf(T);b.useLayoutEffect(()=>{const C=[];if(T.current&&x.current&&S){const E=x.current.objects;for(let O=0;O{for(const E of C)S==null||S.removePass(E);v&&(v.enabled=!1),_&&(_.enabled=!1)}},[S,n,w,v,_,x]);const k=b.useMemo(()=>({composer:S,normalPass:v,downSamplingPass:_,resolutionScale:s,camera:w,scene:y}),[S,v,_,s,w,y]);return b.useImperativeHandle(d,()=>S,[S]),M.jsx(Du.Provider,{value:k,children:M.jsx("group",{ref:T,children:n})})})),yl=n=>typeof n=="object"&&n!=null&&"current"in n?n.current:n;let hm=0;const xl=new WeakMap,Ru=(n,e)=>Zr.forwardRef(function({blendFunction:s=e==null?void 0:e.blendFunction,opacity:i=e==null?void 0:e.opacity,...r},o){let a=xl.get(n);if(!a){const u=`@react-three/postprocessing/${n.name}-${hm++}`;Ka({[u]:n}),xl.set(n,a=u)}const c=ge(u=>u.camera),l=Zr.useMemo(()=>{var u,h;return[...(u=e==null?void 0:e.args)!=null?u:[],...(h=r.args)!=null?h:[{...e,...r}]]},[JSON.stringify(r)]);return M.jsx(a,{camera:c,"blendMode-blendFunction":s,"blendMode-opacity-value":i,...r,ref:o,args:l})}),dm=Ru(im,{blendFunction:ee.ADD}),fm=b.forwardRef(function({selection:e=[],selectionLayer:t=10,blendFunction:s,patternTexture:i,edgeStrength:r,pulseSpeed:o,visibleEdgeColor:a,hiddenEdgeColor:c,width:l,height:u,kernelSize:h,blur:d,xRay:f,...m},p){const g=ge(_=>_.invalidate),{scene:y,camera:w}=b.useContext(Du),S=b.useMemo(()=>new am(y,w,{blendFunction:s,patternTexture:i,edgeStrength:r,pulseSpeed:o,visibleEdgeColor:a,hiddenEdgeColor:c,width:l,height:u,kernelSize:h,blur:d,xRay:f,...m}),[s,d,w,r,u,c,h,i,o,y,a,l,f]),v=b.useContext(sc);return b.useEffect(()=>{if(!v&&e)return S.selection.set(Array.isArray(e)?e.map(yl):[yl(e)]),g(),()=>{S.selection.clear(),g()}},[S,e,v,g]),b.useEffect(()=>{S.selectionLayer=t,g()},[S,g,t]),b.useRef(),b.useEffect(()=>{var _;if(v&&v.enabled&&(_=v.selected)!=null&&_.length)return S.selection.set(v.selected),g(),()=>{S.selection.clear(),g()}},[v,S.selection,g]),b.useEffect(()=>()=>{S.dispose()},[S]),M.jsx("primitive",{ref:p,object:S})}),pm=Ru(lm),mm={isUserDragging:!1,isUserScrolling:!1,userMovedCamera:!1,isUserScrollingOnHtmlPanel:!1},Fs=hu(n=>({...mm,setIsUserDragging:e=>n({isUserDragging:e}),setIsUserScrolling:e=>n({isUserScrolling:e}),setUserMovedCamera:e=>n({userMovedCamera:e}),setIsUserScrollingOnHtmlPanel:e=>n({isUserScrollingOnHtmlPanel:e})})),_m=n=>M.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:M.jsxs("g",{id:"arrow_forward",children:[M.jsx("mask",{id:"mask0_8513_325",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:M.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),M.jsx("g",{mask:"url(#mask0_8513_325)",children:M.jsx("path",{id:"arrow_forward_2",d:"M12.4702 9.56277H3.9375C3.77789 9.56277 3.64424 9.50892 3.53655 9.40123C3.42885 9.29355 3.375 9.1599 3.375 9.00028C3.375 8.84067 3.42885 8.70702 3.53655 8.59933C3.64424 8.49165 3.77789 8.4378 3.9375 8.4378H12.4702L8.59326 4.56087C8.48172 4.44933 8.42667 4.3188 8.42812 4.16929C8.42956 4.01977 8.48846 3.88683 8.60481 3.7705C8.72114 3.66185 8.85287 3.6056 8.99998 3.60175C9.14709 3.5979 9.27882 3.65415 9.39516 3.7705L14.1504 8.52578C14.2206 8.59597 14.2701 8.67 14.299 8.74789C14.3278 8.82577 14.3423 8.9099 14.3423 9.00028C14.3423 9.09067 14.3278 9.1748 14.299 9.25268C14.2701 9.33057 14.2206 9.4046 14.1504 9.47479L9.39516 14.2301C9.29132 14.3339 9.16272 14.387 9.00936 14.3894C8.85599 14.3918 8.72114 14.3387 8.60481 14.2301C8.48846 14.1137 8.43028 13.9801 8.43028 13.8291C8.43028 13.6782 8.48846 13.5445 8.60481 13.4282L12.4702 9.56277Z",fill:"currentColor"})})]})}),gm=n=>M.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:M.jsxs("g",{id:"captive_portal",children:[M.jsx("mask",{id:"mask0_8513_13265",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:M.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),M.jsxs("g",{mask:"url(#mask0_8513_13265)",children:[M.jsx("path",{id:"captive_portal_2",d:"M9.99992 17.9154C8.90589 17.9154 7.87735 17.7073 6.91429 17.2912C5.9511 16.8751 5.11318 16.3107 4.40054 15.5981C3.6879 14.8854 3.12353 14.0475 2.70742 13.0843C2.29131 12.1213 2.08325 11.0927 2.08325 9.9987C2.08325 8.90467 2.29131 7.87613 2.70742 6.91307C3.12353 5.94988 3.6879 5.11196 4.40054 4.39932C5.11318 3.68668 5.9511 3.12231 6.91429 2.7062C7.87735 2.29009 8.90589 2.08203 9.99992 2.08203C11.0939 2.08203 12.1225 2.29009 13.0855 2.7062C14.0487 3.12231 14.8867 3.68668 15.5993 4.39932C16.3119 5.11196 16.8763 5.94988 17.2924 6.91307C17.7085 7.87613 17.9166 8.90467 17.9166 9.9987C17.9166 10.1429 17.9131 10.2983 17.9062 10.4649C17.8992 10.6316 17.8861 10.7871 17.8668 10.9314C17.8444 11.1088 17.7699 11.2487 17.6433 11.3512C17.5167 11.4538 17.3605 11.5052 17.1745 11.5052C17.011 11.5052 16.8717 11.4346 16.7564 11.2935C16.641 11.1525 16.5945 10.9977 16.617 10.8289C16.6448 10.6846 16.66 10.5462 16.6626 10.4137C16.6653 10.2812 16.6666 10.1429 16.6666 9.9987C16.6666 9.69425 16.6466 9.39113 16.6066 9.08932C16.5664 8.78738 16.5037 8.48689 16.4183 8.18786H13.3203C13.3727 8.48689 13.4107 8.78738 13.4343 9.08932C13.4578 9.39113 13.4695 9.69425 13.4695 9.9987C13.4695 10.1429 13.4682 10.2962 13.4655 10.4587C13.4628 10.6211 13.4544 10.7743 13.4405 10.9185C13.4182 11.0959 13.345 11.2379 13.221 11.3447C13.0971 11.4517 12.9464 11.5052 12.7691 11.5052C12.6056 11.5052 12.4628 11.4389 12.3405 11.3064C12.2182 11.1739 12.1682 11.0233 12.1905 10.8545C12.2044 10.7102 12.2128 10.5676 12.2155 10.4266C12.2182 10.2855 12.2195 10.1429 12.2195 9.9987C12.2195 9.69425 12.2078 9.39113 12.1843 9.08932C12.1607 8.78738 12.1228 8.48689 12.0705 8.18786H7.92929C7.87707 8.48689 7.83915 8.78738 7.81554 9.08932C7.79207 9.39113 7.78033 9.69425 7.78033 9.9987C7.78033 10.3031 7.79207 10.6063 7.81554 10.9081C7.83915 11.21 7.87707 11.5105 7.92929 11.8095H10.3685C10.5458 11.8095 10.6944 11.8694 10.8141 11.9891C10.9337 12.1087 10.9935 12.2572 10.9935 12.4345C10.9935 12.6119 10.9337 12.7604 10.8141 12.8802C10.6944 12.9997 10.5458 13.0595 10.3685 13.0595H8.21617C8.39895 13.7155 8.63693 14.3445 8.93013 14.9466C9.22346 15.5487 9.58006 16.1157 9.99992 16.6477C10.1495 16.6477 10.2991 16.6485 10.4487 16.6502C10.5983 16.6517 10.7451 16.6429 10.8893 16.6237C11.0614 16.6012 11.2051 16.6455 11.3203 16.7566C11.4358 16.8677 11.4935 17.0093 11.4935 17.1814C11.4935 17.3672 11.4457 17.5222 11.3501 17.6462C11.2544 17.7701 11.1179 17.8432 10.9405 17.8656C10.7964 17.8849 10.641 17.898 10.4743 17.9049C10.3076 17.9119 10.1495 17.9154 9.99992 17.9154ZM3.58159 11.8095H6.6795C6.62714 11.5105 6.58915 11.21 6.56554 10.9081C6.54207 10.6063 6.53033 10.3031 6.53033 9.9987C6.53033 9.69425 6.54207 9.39113 6.56554 9.08932C6.58915 8.78738 6.62714 8.48689 6.6795 8.18786H3.58159C3.49617 8.48689 3.43339 8.78738 3.39325 9.08932C3.35325 9.39113 3.33325 9.69425 3.33325 9.9987C3.33325 10.3031 3.35325 10.6063 3.39325 10.9081C3.43339 11.21 3.49617 11.5105 3.58159 11.8095ZM8.38617 16.4345C8.05075 15.9143 7.76256 15.3715 7.52159 14.8064C7.28061 14.2413 7.08429 13.659 6.93263 13.0595H4.10575C4.54047 13.9174 5.1302 14.6413 5.87492 15.231C6.61964 15.8209 7.45672 16.222 8.38617 16.4345ZM4.10575 6.93786H6.93263C7.0736 6.33314 7.26325 5.74821 7.50159 5.18307C7.73978 4.61779 8.03464 4.07773 8.38617 3.56286C7.45131 3.77009 6.6129 4.16856 5.87096 4.75828C5.12888 5.348 4.54047 6.07453 4.10575 6.93786ZM8.21617 6.93786H11.7837C11.6063 6.28189 11.3669 5.65557 11.0655 5.05891C10.7643 4.4621 10.4091 3.89238 9.99992 3.34974C9.58534 3.88168 9.22874 4.4487 8.93013 5.05078C8.63152 5.65286 8.39353 6.28189 8.21617 6.93786ZM13.0672 6.93786H15.8941C15.4594 6.07453 14.871 5.34668 14.1289 4.75432C13.3869 4.16182 12.5485 3.76467 11.6137 3.56286C11.9491 4.08314 12.2333 4.62717 12.4662 5.19495C12.6991 5.76286 12.8994 6.34384 13.0672 6.93786Z",fill:"currentColor"}),M.jsx("path",{id:"travel_explore",d:"M18.0634 18.7783L16.8556 17.5822C16.6378 17.7211 16.4031 17.8331 16.1517 17.9184C15.9003 18.0038 15.6342 18.0465 15.3535 18.0465C14.6044 18.0465 13.9694 17.7857 13.4484 17.2642C12.9275 16.7428 12.667 16.1071 12.667 15.3572C12.667 14.6074 12.9275 13.9717 13.4484 13.4502C13.9694 12.9287 14.6044 12.668 15.3535 12.668C16.1026 12.668 16.7376 12.9287 17.2586 13.4502C17.7795 13.9717 18.04 14.6074 18.04 15.3572C18.04 15.6425 17.9963 15.9121 17.9089 16.166C17.8215 16.4198 17.7063 16.6557 17.5633 16.8738L18.7711 18.0698C18.8684 18.1628 18.917 18.2798 18.917 18.4208C18.917 18.5618 18.8684 18.6809 18.7711 18.7783C18.6781 18.8714 18.5611 18.918 18.4203 18.918C18.2796 18.918 18.1606 18.8714 18.0634 18.7783ZM15.3535 17.038C15.8236 17.038 16.221 16.8755 16.5456 16.5506C16.8703 16.2256 17.0326 15.8278 17.0326 15.3572C17.0326 14.8866 16.8703 14.4888 16.5456 14.1639C16.221 13.8389 15.8236 13.6764 15.3535 13.6764C14.8834 13.6764 14.486 13.8389 14.1614 14.1639C13.8367 14.4888 13.6744 14.8866 13.6744 15.3572C13.6744 15.8278 13.8367 16.2256 14.1614 16.5506C14.486 16.8755 14.8834 17.038 15.3535 17.038Z",fill:"currentColor"})]})]})}),vm=()=>{const[n,e]=b.useState(""),[t,s]=b.useState([]),{fetchData:i,setAbortRequests:r}=kn(f=>f),[o]=du(f=>[f.setBudget]),a=bo(f=>f.setUniverseQuestionIsOpen),c=$d(f=>f.resetAiSummaryAnswer);b.useEffect(()=>{(async()=>{try{const m=await Qd();m.seed_questions&&s(m.seed_questions)}catch(m){console.error("Error fetching seed questions:",m)}})()},[]);const l=async f=>{f&&(c(),a()),await i(o,r,f)},u=!0,h=async f=>{f.keyCode===13&&f.shiftKey===!1&&u&&(f.preventDefault(),l(n))},d=async f=>{e(f),await l(f)};return M.jsxs(Tm,{children:["Ideas have shape",M.jsxs(xm,{onKeyDown:h,py:12,tabIndex:-1,children:[M.jsx(ym,{minRows:5,onChange:f=>e(f.target.value),placeholder:"Enter your question",value:n}),M.jsx(km,{color:"secondary",endIcon:M.jsx(_m,{}),onClick:()=>l(n),variant:"contained",children:"Search"})]}),t.length>0&&M.jsx(Sm,{children:t.map(f=>M.jsx(Cm,{onClick:()=>d(f),children:f},f))}),M.jsx(wm,{onClick:a,startIcon:M.jsx(gm,{}),children:"Explore graph"})]})},ym=Ve(Zf)` background: ${qe.BG1}; max-width: 702px; width: 702px; @@ -231,10 +231,10 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu &::placeholder { color: #0bf; } -`,ym=Ve(Ys)` +`,xm=Ve(Ys)` position: relative; margin-top: 30px; -`,xm=Ve(Ys)` +`,Tm=Ve(Ys)` background: #16161de3; position: absolute; left: 0; @@ -248,7 +248,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu font-style: normal; font-weight: 700; line-height: 16px; -`,Tm=Ve(xu)` +`,km=Ve(xu)` && { position: absolute; bottom: 20px; @@ -256,21 +256,21 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu height: 32px; border-radius: 16px; } -`,km=Ve(xu)` +`,wm=Ve(xu)` && { position: absolute; bottom: 20px; right: 20px; border-radius: 16px; } -`,wm=Ve.div` +`,Sm=Ve.div` display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; max-width: 702px; width: 100%; -`,Sm=Ve.div` +`,Cm=Ve.div` background: ${qe.BG1}; color: ${qe.white}; padding: 15px 20px; @@ -294,7 +294,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu * Subject to the terms at https://gsap.com/standard-license or for * Club GSAP members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com -*/var yt={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},$n={duration:.5,overwrite:!1,delay:0},ic,$e,Ae,Ot=1e8,fe=1/Ot,Sa=Math.PI*2,Cm=Sa/4,bm=0,Iu=Math.sqrt,Em=Math.cos,Om=Math.sin,Ge=function(e){return typeof e=="string"},De=function(e){return typeof e=="function"},gs=function(e){return typeof e=="number"},rc=function(e){return typeof e>"u"},Qt=function(e){return typeof e=="object"},ct=function(e){return e!==!1},oc=function(){return typeof window<"u"},Fr=function(e){return De(e)||Ge(e)},Nu=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Qe=Array.isArray,Ca=/(?:-?\.?\d|\.)+/gi,Fu=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ln=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,ca=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Uu=/[+-]=-?[.\d]+/,Lu=/[^,'"\[\]\s]+/gi,Am=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ce,Et,ba,ac,kt={},$r={},zu,Bu=function(e){return($r=mn(e,kt))&&ft},cc=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Bi=function(e,t){return!t&&console.warn(e)},Vu=function(e,t){return e&&(kt[e]=t)&&$r&&($r[e]=t)||kt},Vi=function(){return 0},Mm={suppressEvents:!0,isStart:!0,kill:!1},Hr={suppressEvents:!0,kill:!1},Dm={suppressEvents:!0},lc={},Us=[],Ea={},ju,_t={},la={},Tl=30,qr=[],uc="",hc=function(e){var t=e[0],s,i;if(Qt(t)||De(t)||(e=[e]),!(s=(t._gsap||{}).harness)){for(i=qr.length;i--&&!qr[i].targetTest(t););s=qr[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new dh(e[i],s)))||e.splice(i,1);return e},ln=function(e){return e._gsap||hc(At(e))[0]._gsap},Hu=function(e,t,s){return(s=e[t])&&De(s)?e[t]():rc(s)&&e.getAttribute&&e.getAttribute(t)||s},lt=function(e,t){return(e=e.split(",")).forEach(t)||e},Pe=function(e){return Math.round(e*1e5)/1e5||0},je=function(e){return Math.round(e*1e7)/1e7||0},Hn=function(e,t){var s=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),s==="+"?e+i:s==="-"?e-i:s==="*"?e*i:e/i},Rm=function(e,t){for(var s=t.length,i=0;e.indexOf(t[i])<0&&++ia;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[s],e[s]=t),t._next?t._next._prev=t:e[i]=t,t._prev=o,t.parent=t._dp=e,t},Ro=function(e,t,s,i){s===void 0&&(s="_first"),i===void 0&&(i="_last");var r=t._prev,o=t._next;r?r._next=o:e[s]===t&&(e[s]=o),o?o._prev=r:e[i]===t&&(e[i]=r),t._next=t._prev=t.parent=null},Bs=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},un=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var s=e;s;)s._dirty=1,s=s.parent;return e},Nm=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},Oa=function(e,t,s,i){return e._startAt&&($e?e._startAt.revert(Hr):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},Fm=function n(e){return!e||e._ts&&n(e.parent)},wl=function(e){return e._repeat?Qn(e._tTime,e=e.duration()+e._rDelay)*e:0},Qn=function(e,t){var s=Math.floor(e/=t);return e&&s===e?s-1:s},Jr=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Po=function(e){return e._end=je(e._start+(e._tDur/Math.abs(e._ts||e._rts||fe)||0))},Io=function(e,t){var s=e._dp;return s&&s.smoothChildTiming&&e._ts&&(e._start=je(s._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Po(e),s._dirty||un(s,e)),e},Zu=function(e,t){var s;if((t._time||!t._dur&&t._initted||t._startfe)&&t.render(s,!0)),un(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&s.totalTime(s._tTime),s=s._dp;e._zTime=-fe}},Zt=function(e,t,s,i){return t.parent&&Bs(t),t._start=je((gs(s)?s:s||e!==Ce?bt(e,s,t):e._time)+t._delay),t._end=je(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Yu(e,t,"_first","_last",e._sort?"_start":0),Aa(t)||(e._recent=t),i||Zu(e,t),e._ts<0&&Io(e,e._tTime),e},Xu=function(e,t){return(kt.ScrollTrigger||cc("scrollTrigger",t))&&kt.ScrollTrigger.create(t,e)},$u=function(e,t,s,i,r){if(fc(e,t,r),!e._initted)return 1;if(!s&&e._pt&&!$e&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&ju!==gt.frame)return Us.push(e),e._lazy=[r,i],1},Um=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},Aa=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},Lm=function(e,t,s,i){var r=e.ratio,o=t<0||!t&&(!e._start&&Um(e)&&!(!e._initted&&Aa(e))||(e._ts<0||e._dp._ts<0)&&!Aa(e))?0:1,a=e._rDelay,c=0,l,u,h;if(a&&e._repeat&&(c=mr(0,e._tDur,t),u=Qn(c,a),e._yoyo&&u&1&&(o=1-o),u!==Qn(e._tTime,a)&&(r=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==r||$e||i||e._zTime===fe||!t&&e._zTime){if(!e._initted&&$u(e,t,i,s,c))return;for(h=e._zTime,e._zTime=t||(s?fe:0),s||(s=t&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=c,l=e._pt;l;)l.r(o,l.d),l=l._next;t<0&&Oa(e,t,s,!0),e._onUpdate&&!s&&vt(e,"onUpdate"),c&&e._repeat&&!s&&e.parent&&vt(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&Bs(e,1),!s&&!$e&&(vt(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},zm=function(e,t,s){var i;if(s>t)for(i=e._first;i&&i._start<=s;){if(i.data==="isPause"&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=s;){if(i.data==="isPause"&&i._start0&&!i&&Io(e,e._tTime=e._tDur*a),e.parent&&Po(e),s||un(e.parent,e),e},Sl=function(e){return e instanceof tt?un(e):Kn(e,e._dur)},Bm={_start:0,endTime:Vi,totalDuration:Vi},bt=function n(e,t,s){var i=e.labels,r=e._recent||Bm,o=e.duration()>=Ot?r.endTime(!1):e._dur,a,c,l;return Ge(t)&&(isNaN(t)||t in i)?(c=t.charAt(0),l=t.substr(-1)==="%",a=t.indexOf("="),c==="<"||c===">"?(a>=0&&(t=t.replace(/=/,"")),(c==="<"?r._start:r.endTime(r._repeat>=0))+(parseFloat(t.substr(1))||0)*(l?(a<0?r:s).totalDuration()/100:1)):a<0?(t in i||(i[t]=o),i[t]):(c=parseFloat(t.charAt(a-1)+t.substr(a+1)),l&&s&&(c=c/100*(Qe(s)?s[0]:s).totalDuration()),a>1?n(e,t.substr(0,a-1),s)+c:o+c)):t==null?o:+t},Fi=function(e,t,s){var i=gs(t[1]),r=(i?2:1)+(e<2?0:1),o=t[r],a,c;if(i&&(o.duration=t[1]),o.parent=s,e){for(a=o,c=s;c&&!("immediateRender"in a);)a=c.vars.defaults||{},c=ct(c.vars.inherit)&&c.parent;o.immediateRender=ct(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[r-1]}return new Le(t[0],o,t[r+1])},Zs=function(e,t){return e||e===0?t(e):t},mr=function(e,t,s){return st?t:s},Xe=function(e,t){return!Ge(e)||!(t=Am.exec(e))?"":t[1]},Vm=function(e,t,s){return Zs(s,function(i){return mr(e,t,i)})},Ma=[].slice,Qu=function(e,t){return e&&Qt(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Qt(e[0]))&&!e.nodeType&&e!==Et},jm=function(e,t,s){return s===void 0&&(s=[]),e.forEach(function(i){var r;return Ge(i)&&!t||Qu(i,1)?(r=s).push.apply(r,At(i)):s.push(i)})||s},At=function(e,t,s){return Ae&&!t&&Ae.selector?Ae.selector(e):Ge(e)&&!s&&(ba||!Jn())?Ma.call((t||ac).querySelectorAll(e),0):Qe(e)?jm(e,s):Qu(e)?Ma.call(e,0):e?[e]:[]},Da=function(e){return e=At(e)[0]||Bi("Invalid scope")||{},function(t){var s=e.current||e.nativeElement||e;return At(t,s.querySelectorAll?s:s===e?Bi("Invalid scope")||ac.createElement("div"):e)}},Ku=function(e){return e.sort(function(){return .5-Math.random()})},Ju=function(e){if(De(e))return e;var t=Qt(e)?e:{each:e},s=hn(t.ease),i=t.from||0,r=parseFloat(t.base)||0,o={},a=i>0&&i<1,c=isNaN(i)||a,l=t.axis,u=i,h=i;return Ge(i)?u=h={center:.5,edges:.5,end:1}[i]||0:!a&&c&&(u=i[0],h=i[1]),function(d,f,m){var p=(m||t).length,g=o[p],y,w,S,v,_,T,x,k,C;if(!g){if(C=t.grid==="auto"?0:(t.grid||[1,Ot])[1],!C){for(x=-Ot;x<(x=m[C++].getBoundingClientRect().left)&&Cx&&(x=_),_p?p-1:l?l==="y"?p/C:C:Math.max(C,p/C))||0)*(i==="edges"?-1:1),g.b=p<0?r-p:r,g.u=Xe(t.amount||t.each)||0,s=s&&p<0?lh(s):s}return p=(g[d]-g.min)/g.max||0,je(g.b+(s?s(p):p)*g.v)+g.u}},Ra=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(s){var i=je(Math.round(parseFloat(s)/e)*e*t);return(i-i%1)/t+(gs(s)?0:Xe(s))}},eh=function(e,t){var s=Qe(e),i,r;return!s&&Qt(e)&&(i=s=e.radius||Ot,e.values?(e=At(e.values),(r=!gs(e[0]))&&(i*=i)):e=Ra(e.increment)),Zs(t,s?De(e)?function(o){return r=e(o),Math.abs(r-o)<=i?r:o}:function(o){for(var a=parseFloat(r?o.x:o),c=parseFloat(r?o.y:0),l=Ot,u=0,h=e.length,d,f;h--;)r?(d=e[h].x-a,f=e[h].y-c,d=d*d+f*f):d=Math.abs(e[h]-a),di?r-o:o)})},ji=function(e){for(var t=0,s="",i,r,o,a;~(i=e.indexOf("random(",t));)o=e.indexOf(")",i),a=e.charAt(i+7)==="[",r=e.substr(i+7,o-i-7).match(a?Lu:Ca),s+=e.substr(t,i-t)+th(a?r:+r[0],a?0:+r[1],+r[2]||1e-5),t=o+1;return s+e.substr(t,e.length-t)},nh=function(e,t,s,i,r){var o=t-e,a=i-s;return Zs(r,function(c){return s+((c-e)/o*a||0)})},Zm=function n(e,t,s,i){var r=isNaN(e+t)?0:function(f){return(1-f)*e+f*t};if(!r){var o=Ge(e),a={},c,l,u,h,d;if(s===!0&&(i=1)&&(s=null),o)e={p:e},t={p:t};else if(Qe(e)&&!Qe(t)){for(u=[],h=e.length,d=h-2,l=1;l(a=Math.abs(a))&&(c=o,r=a);return c},vt=function(e,t,s){var i=e.vars,r=i[t],o=Ae,a=e._ctx,c,l,u;if(r)return c=i[t+"Params"],l=i.callbackScope||e,s&&Us.length&&Qr(),a&&(Ae=a),u=c?r.apply(l,c):r.call(l),Ae=o,u},Pi=function(e){return Bs(e),e.scrollTrigger&&e.scrollTrigger.kill(!!$e),e.progress()<1&&vt(e,"onInterrupt"),e},zn,ih=[],rh=function(e){if(oc()&&e){e=!e.name&&e.default||e;var t=e.name,s=De(e),i=t&&!s&&e.init?function(){this._props=[]}:e,r={init:Vi,render:_c,add:dc,kill:u_,modifier:l_,rawVars:0},o={targetTest:0,get:0,getSetter:mc,aliases:{},register:0};if(Jn(),e!==i){if(_t[t])return;Rt(i,Rt(Kr(e,r),o)),mn(i.prototype,mn(r,Kr(e,o))),_t[i.prop=t]=i,e.targetTest&&(qr.push(i),lc[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}Vu(t,i),e.register&&e.register(ft,i,ut)}else e&&ih.push(e)},de=255,Ii={aqua:[0,de,de],lime:[0,de,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,de],navy:[0,0,128],white:[de,de,de],olive:[128,128,0],yellow:[de,de,0],orange:[de,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[de,0,0],pink:[de,192,203],cyan:[0,de,de],transparent:[de,de,de,0]},ua=function(e,t,s){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(s-t)*e*6:e<.5?s:e*3<2?t+(s-t)*(2/3-e)*6:t)*de+.5|0},oh=function(e,t,s){var i=e?gs(e)?[e>>16,e>>8&de,e&de]:0:Ii.black,r,o,a,c,l,u,h,d,f,m;if(!i){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Ii[e])i=Ii[e];else if(e.charAt(0)==="#"){if(e.length<6&&(r=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+r+r+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return i=parseInt(e.substr(1,6),16),[i>>16,i>>8&de,i&de,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),i=[e>>16,e>>8&de,e&de]}else if(e.substr(0,3)==="hsl"){if(i=m=e.match(Ca),!t)c=+i[0]%360/360,l=+i[1]/100,u=+i[2]/100,o=u<=.5?u*(l+1):u+l-u*l,r=u*2-o,i.length>3&&(i[3]*=1),i[0]=ua(c+1/3,r,o),i[1]=ua(c,r,o),i[2]=ua(c-1/3,r,o);else if(~e.indexOf("="))return i=e.match(Fu),s&&i.length<4&&(i[3]=1),i}else i=e.match(Ca)||Ii.transparent;i=i.map(Number)}return t&&!m&&(r=i[0]/de,o=i[1]/de,a=i[2]/de,h=Math.max(r,o,a),d=Math.min(r,o,a),u=(h+d)/2,h===d?c=l=0:(f=h-d,l=u>.5?f/(2-h-d):f/(h+d),c=h===r?(o-a)/f+(oe&&(s+=y-t),i+=y,_=i-s,S=_-o,(S>0||w)&&(T=++h.frame,d=_-h.time*1e3,h.time=_=_/1e3,o+=S+(S>=r?4:r-S),v=1),w||(c=l(p)),v)for(f=0;f=y&&f--},_listeners:a},h}(),Jn=function(){return!Hi&>.wake()},se={},$m=/^[\d.\-M][\d.\-,\s]/,Qm=/["']/g,Km=function(e){for(var t={},s=e.substr(1,e.length-3).split(":"),i=s[0],r=1,o=s.length,a,c,l;r1&&s.config?s.config.apply(null,~e.indexOf("{")?[Km(t[1])]:Jm(e).split(",").map(Wu)):se._CE&&$m.test(e)?se._CE("",e):s},lh=function(e){return function(t){return 1-e(1-t)}},uh=function n(e,t){for(var s=e._first,i;s;)s instanceof tt?n(s,t):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==t&&(s.timeline?n(s.timeline,t):(i=s._ease,s._ease=s._yEase,s._yEase=i,s._yoyo=t)),s=s._next},hn=function(e,t){return e&&(De(e)?e:se[e]||e_(e))||t},wn=function(e,t,s,i){s===void 0&&(s=function(c){return 1-t(1-c)}),i===void 0&&(i=function(c){return c<.5?t(c*2)/2:1-t((1-c)*2)/2});var r={easeIn:t,easeOut:s,easeInOut:i},o;return lt(e,function(a){se[a]=kt[a]=r,se[o=a.toLowerCase()]=s;for(var c in r)se[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=se[a+"."+c]=r[c]}),r},hh=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},ha=function n(e,t,s){var i=t>=1?t:1,r=(s||(e?.3:.45))/(t<1?t:1),o=r/Sa*(Math.asin(1/i)||0),a=function(u){return u===1?1:i*Math.pow(2,-10*u)*Om((u-o)*r)+1},c=e==="out"?a:e==="in"?function(l){return 1-a(1-l)}:hh(a);return r=Sa/r,c.config=function(l,u){return n(e,l,u)},c},da=function n(e,t){t===void 0&&(t=1.70158);var s=function(o){return o?--o*o*((t+1)*o+t)+1:0},i=e==="out"?s:e==="in"?function(r){return 1-s(1-r)}:hh(s);return i.config=function(r){return n(e,r)},i};lt("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;wn(n+",Power"+(t-1),e?function(s){return Math.pow(s,t)}:function(s){return s},function(s){return 1-Math.pow(1-s,t)},function(s){return s<.5?Math.pow(s*2,t)/2:1-Math.pow((1-s)*2,t)/2})});se.Linear.easeNone=se.none=se.Linear.easeIn;wn("Elastic",ha("in"),ha("out"),ha());(function(n,e){var t=1/e,s=2*t,i=2.5*t,r=function(a){return a0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},e.totalDuration=function(s){return arguments.length?(this._dirty=0,Kn(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(s,i){if(Jn(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Io(this,s),!r._dp||r.parent||Zu(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s0||!this._tDur&&!s)&&Zt(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===fe||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),qu(this,s,i)),this},e.time=function(s,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+wl(this))%(this._dur+this._rDelay)||(s?this._dur:0),i):this._time},e.totalProgress=function(s,i){return arguments.length?this.totalTime(this.totalDuration()*s,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(s,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+wl(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(s,i){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*r,i):this._repeat?Qn(this._tTime,r)+1:1},e.timeScale=function(s,i){if(!arguments.length)return this._rts===-fe?0:this._rts;if(this._rts===s)return this;var r=this.parent&&this._ts?Jr(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-fe?0:this._rts,this.totalTime(mr(-Math.abs(this._delay),this._tDur,r),i!==!1),Po(this),Nm(this)},e.paused=function(s){return arguments.length?(this._ps!==s&&(this._ps=s,s?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Jn(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==fe&&(this._tTime-=fe)))),this):this._ps},e.startTime=function(s){if(arguments.length){this._start=s;var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Zt(i,this,s-this._delay),this}return this._start},e.endTime=function(s){return this._start+(ct(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(s){var i=this.parent||this._dp;return i?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Jr(i.rawTime(s),this):this._tTime:this._tTime},e.revert=function(s){s===void 0&&(s=Dm);var i=$e;return $e=s,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),$e=i,this},e.globalTime=function(s){for(var i=this,r=arguments.length?s:i.rawTime();i;)r=i._start+r/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(s):r},e.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,Sl(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(s){if(arguments.length){var i=this._time;return this._rDelay=s,Sl(this),i?this.time(i):this}return this._rDelay},e.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},e.seek=function(s,i){return this.totalTime(bt(this,s),ct(i))},e.restart=function(s,i){return this.play().totalTime(s?-this._delay:0,ct(i))},e.play=function(s,i){return s!=null&&this.seek(s,i),this.reversed(!1).paused(!1)},e.reverse=function(s,i){return s!=null&&this.seek(s||this.totalDuration(),i),this.reversed(!0).paused(!1)},e.pause=function(s,i){return s!=null&&this.seek(s,i),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-fe:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-fe,this},e.isActive=function(){var s=this.parent||this._dp,i=this._start,r;return!!(!s||this._ts&&this._initted&&s.isActive()&&(r=s.rawTime(!0))>=i&&r1?(i?(o[s]=i,r&&(o[s+"Params"]=r),s==="onUpdate"&&(this._onUpdate=i)):delete o[s],this):o[s]},e.then=function(s){var i=this;return new Promise(function(r){var o=De(s)?s:Gu,a=function(){var l=i.then;i.then=null,De(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=l),r(o),i.then=l};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?a():i._prom=a})},e.kill=function(){Pi(this)},n}();Rt(qi.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-fe,_prom:0,_ps:!1,_rts:1});var tt=function(n){Pu(e,n);function e(s,i){var r;return s===void 0&&(s={}),r=n.call(this,s)||this,r.labels={},r.smoothChildTiming=!!s.smoothChildTiming,r.autoRemoveChildren=!!s.autoRemoveChildren,r._sort=ct(s.sortChildren),Ce&&Zt(s.parent||Ce,ls(r),i),s.reversed&&r.reverse(),s.paused&&r.paused(!0),s.scrollTrigger&&Xu(ls(r),s.scrollTrigger),r}var t=e.prototype;return t.to=function(i,r,o){return Fi(0,arguments,this),this},t.from=function(i,r,o){return Fi(1,arguments,this),this},t.fromTo=function(i,r,o,a){return Fi(2,arguments,this),this},t.set=function(i,r,o){return r.duration=0,r.parent=this,Ni(r).repeatDelay||(r.repeat=0),r.immediateRender=!!r.immediateRender,new Le(i,r,bt(this,o),1),this},t.call=function(i,r,o){return Zt(this,Le.delayedCall(0,i,r),o)},t.staggerTo=function(i,r,o,a,c,l,u){return o.duration=r,o.stagger=o.stagger||a,o.onComplete=l,o.onCompleteParams=u,o.parent=this,new Le(i,o,bt(this,c)),this},t.staggerFrom=function(i,r,o,a,c,l,u){return o.runBackwards=1,Ni(o).immediateRender=ct(o.immediateRender),this.staggerTo(i,r,o,a,c,l,u)},t.staggerFromTo=function(i,r,o,a,c,l,u,h){return a.startAt=o,Ni(a).immediateRender=ct(a.immediateRender),this.staggerTo(i,r,a,c,l,u,h)},t.render=function(i,r,o){var a=this._time,c=this._dirty?this.totalDuration():this._tDur,l=this._dur,u=i<=0?0:je(i),h=this._zTime<0!=i<0&&(this._initted||!l),d,f,m,p,g,y,w,S,v,_,T,x;if(this!==Ce&&u>c&&i>=0&&(u=c),u!==this._tTime||o||h){if(a!==this._time&&l&&(u+=this._time-a,i+=this._time-a),d=u,v=this._start,S=this._ts,y=!S,h&&(l||(a=this._zTime),(i||!r)&&(this._zTime=i)),this._repeat){if(T=this._yoyo,g=l+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(g*100+i,r,o);if(d=je(u%g),u===c?(p=this._repeat,d=l):(p=~~(u/g),p&&p===u/g&&(d=l,p--),d>l&&(d=l)),_=Qn(this._tTime,g),!a&&this._tTime&&_!==p&&this._tTime-_*g-this._dur<=0&&(_=p),T&&p&1&&(d=l-d,x=1),p!==_&&!this._lock){var k=T&&_&1,C=k===(T&&p&1);if(p<_&&(k=!k),a=k?0:u%l?l:u,this._lock=1,this.render(a||(x?0:je(p*g)),r,!l)._lock=0,this._tTime=u,!r&&this.parent&&vt(this,"onRepeat"),this.vars.repeatRefresh&&!x&&(this.invalidate()._lock=1),a&&a!==this._time||y!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,c=this._tDur,C&&(this._lock=2,a=k?l:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!x&&this.invalidate()),this._lock=0,!this._ts&&!y)return this;uh(this,x)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(w=zm(this,je(a),je(d)),w&&(u-=d-(d=w._start))),this._tTime=u,this._time=d,this._act=!S,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,a=0),!a&&d&&!r&&!p&&(vt(this,"onStart"),this._tTime!==u))return this;if(d>=a&&i>=0)for(f=this._first;f;){if(m=f._next,(f._act||d>=f._start)&&f._ts&&w!==f){if(f.parent!==this)return this.render(i,r,o);if(f.render(f._ts>0?(d-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(d-f._start)*f._ts,r,o),d!==this._time||!this._ts&&!y){w=0,m&&(u+=this._zTime=-fe);break}}f=m}else{f=this._last;for(var E=i<0?i:d;f;){if(m=f._prev,(f._act||E<=f._end)&&f._ts&&w!==f){if(f.parent!==this)return this.render(i,r,o);if(f.render(f._ts>0?(E-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(E-f._start)*f._ts,r,o||$e&&(f._initted||f._startAt)),d!==this._time||!this._ts&&!y){w=0,m&&(u+=this._zTime=E?-fe:fe);break}}f=m}}if(w&&!r&&(this.pause(),w.render(d>=a?0:-fe)._zTime=d>=a?1:-1,this._ts))return this._start=v,Po(this),this.render(i,r,o);this._onUpdate&&!r&&vt(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&a)&&(v===this._start||Math.abs(S)!==Math.abs(this._ts))&&(this._lock||((i||!l)&&(u===c&&this._ts>0||!u&&this._ts<0)&&Bs(this,1),!r&&!(i<0&&!a)&&(u||a||!c)&&(vt(this,u===c&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u0)&&this._prom())))}return this},t.add=function(i,r){var o=this;if(gs(r)||(r=bt(this,r,i)),!(i instanceof qi)){if(Qe(i))return i.forEach(function(a){return o.add(a,r)}),this;if(Ge(i))return this.addLabel(i,r);if(De(i))i=Le.delayedCall(0,i);else return this}return this!==i?Zt(this,i,r):this},t.getChildren=function(i,r,o,a){i===void 0&&(i=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),a===void 0&&(a=-Ot);for(var c=[],l=this._first;l;)l._start>=a&&(l instanceof Le?r&&c.push(l):(o&&c.push(l),i&&c.push.apply(c,l.getChildren(!0,r,o)))),l=l._next;return c},t.getById=function(i){for(var r=this.getChildren(1,1,1),o=r.length;o--;)if(r[o].vars.id===i)return r[o]},t.remove=function(i){return Ge(i)?this.removeLabel(i):De(i)?this.killTweensOf(i):(Ro(this,i),i===this._recent&&(this._recent=this._last),un(this))},t.totalTime=function(i,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=je(gt.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),n.prototype.totalTime.call(this,i,r),this._forcing=0,this):this._tTime},t.addLabel=function(i,r){return this.labels[i]=bt(this,r),this},t.removeLabel=function(i){return delete this.labels[i],this},t.addPause=function(i,r,o){var a=Le.delayedCall(0,r||Vi,o);return a.data="isPause",this._hasPause=1,Zt(this,a,bt(this,i))},t.removePause=function(i){var r=this._first;for(i=bt(this,i);r;)r._start===i&&r.data==="isPause"&&Bs(r),r=r._next},t.killTweensOf=function(i,r,o){for(var a=this.getTweensOf(i,o),c=a.length;c--;)Rs!==a[c]&&a[c].kill(i,r);return this},t.getTweensOf=function(i,r){for(var o=[],a=At(i),c=this._first,l=gs(r),u;c;)c instanceof Le?Rm(c._targets,a)&&(l?(!Rs||c._initted&&c._ts)&&c.globalTime(0)<=r&&c.globalTime(c.totalDuration())>r:!r||c.isActive())&&o.push(c):(u=c.getTweensOf(a,r)).length&&o.push.apply(o,u),c=c._next;return o},t.tweenTo=function(i,r){r=r||{};var o=this,a=bt(o,i),c=r,l=c.startAt,u=c.onStart,h=c.onStartParams,d=c.immediateRender,f,m=Le.to(o,Rt({ease:r.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale())||fe,onStart:function(){if(o.pause(),!f){var g=r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale());m._dur!==g&&Kn(m,g,0,1).render(m._time,!0,!0),f=1}u&&u.apply(m,h||[])}},r));return d?m.render(0):m},t.tweenFromTo=function(i,r,o){return this.tweenTo(r,Rt({startAt:{time:bt(this,i)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(i){return i===void 0&&(i=this._time),Cl(this,bt(this,i))},t.previousLabel=function(i){return i===void 0&&(i=this._time),Cl(this,bt(this,i),1)},t.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+fe)},t.shiftChildren=function(i,r,o){o===void 0&&(o=0);for(var a=this._first,c=this.labels,l;a;)a._start>=o&&(a._start+=i,a._end+=i),a=a._next;if(r)for(l in c)c[l]>=o&&(c[l]+=i);return un(this)},t.invalidate=function(i){var r=this._first;for(this._lock=0;r;)r.invalidate(i),r=r._next;return n.prototype.invalidate.call(this,i)},t.clear=function(i){i===void 0&&(i=!0);for(var r=this._first,o;r;)o=r._next,this.remove(r),r=o;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),un(this)},t.totalDuration=function(i){var r=0,o=this,a=o._last,c=Ot,l,u,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));if(o._dirty){for(h=o.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),u=a._start,u>c&&o._sort&&a._ts&&!o._lock?(o._lock=1,Zt(o,a,u-a._delay,1)._lock=0):c=u,u<0&&a._ts&&(r-=u,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=u/o._ts,o._time-=u,o._tTime-=u),o.shiftChildren(-u,!1,-1/0),c=0),a._end>r&&a._ts&&(r=a._end),a=l;Kn(o,o===Ce&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(i){if(Ce._ts&&(qu(Ce,Jr(i,Ce)),ju=gt.frame),gt.frame>=Tl){Tl+=yt.autoSleep||120;var r=Ce._first;if((!r||!r._ts)&&yt.autoSleep&>._listeners.length<2){for(;r&&!r._ts;)r=r._next;r||gt.sleep()}}},e}(qi);Rt(tt.prototype,{_lock:0,_hasPause:0,_forcing:0});var t_=function(e,t,s,i,r,o,a){var c=new ut(this._pt,e,t,0,1,vh,null,r),l=0,u=0,h,d,f,m,p,g,y,w;for(c.b=s,c.e=i,s+="",i+="",(y=~i.indexOf("random("))&&(i=ji(i)),o&&(w=[s,i],o(w,e,t),s=w[0],i=w[1]),d=s.match(ca)||[];h=ca.exec(i);)m=h[0],p=i.substring(l,h.index),f?f=(f+1)%5:p.substr(-5)==="rgba("&&(f=1),m!==d[u++]&&(g=parseFloat(d[u-1])||0,c._pt={_next:c._pt,p:p||u===1?p:",",s:g,c:m.charAt(1)==="="?Hn(g,m)-g:parseFloat(m)-g,m:f&&f<4?Math.round:0},l=ca.lastIndex);return c.c=l")}),v.duration();else{T={};for(k in m)k==="ease"||k==="easeEach"||r_(k,m[k],T,m.easeEach);for(k in T)for(R=T[k].sort(function(N,U){return N.t-U.t}),A=0,_=0;_c-fe&&!u?c:il&&(d=l)),y=this._yoyo&&m&1,y&&(v=this._yEase,d=l-d),g=Qn(this._tTime,p),d===a&&!o&&this._initted&&m===g)return this._tTime=h,this;m!==g&&(S&&this._yEase&&uh(S,y),this.vars.repeatRefresh&&!y&&!this._lock&&this._time!==l&&this._initted&&(this._lock=o=1,this.render(je(p*m),!0).invalidate()._lock=0))}if(!this._initted){if($u(this,u?i:d,o,r,h))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&m!==g))return this;if(l!==this._dur)return this.render(i,r,o)}if(this._tTime=h,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=w=(v||this._ease)(d/l),this._from&&(this.ratio=w=1-w),d&&!a&&!r&&!m&&(vt(this,"onStart"),this._tTime!==h))return this;for(f=this._pt;f;)f.r(w,f.d),f=f._next;S&&S.render(i<0?i:!d&&y?-fe:S._dur*S._ease(d/this._dur),r,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!r&&(u&&Oa(this,i,r,o),vt(this,"onUpdate")),this._repeat&&m!==g&&this.vars.onRepeat&&!r&&this.parent&&vt(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&Oa(this,i,!0,!0),(i||!l)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Bs(this,1),!r&&!(u&&!a)&&(h||a||y)&&(vt(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),n.prototype.invalidate.call(this,i)},t.resetTo=function(i,r,o,a,c){Hi||gt.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||fc(this,l),u=this._ease(l/this._dur),n_(this,i,r,o,a,u,l,c)?this.resetTo(i,r,o,a,1):(Io(this,0),this.parent||Yu(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(i,r){if(r===void 0&&(r="all"),!i&&(!r||r==="all"))return this._lazy=this._pt=0,this.parent?Pi(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,r,Rs&&Rs.vars.overwrite!==!0)._first||Pi(this),this.parent&&o!==this.timeline.totalDuration()&&Kn(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,c=i?At(i):a,l=this._ptLookup,u=this._pt,h,d,f,m,p,g,y;if((!r||r==="all")&&Im(a,c))return r==="all"&&(this._pt=0),Pi(this);for(h=this._op=this._op||[],r!=="all"&&(Ge(r)&&(p={},lt(r,function(w){return p[w]=1}),r=p),r=i_(a,r)),y=a.length;y--;)if(~c.indexOf(a[y])){d=l[y],r==="all"?(h[y]=r,m=d,f={}):(f=h[y]=h[y]||{},m=r);for(p in m)g=d&&d[p],g&&((!("kill"in g.d)||g.d.kill(p)===!0)&&Ro(this,g,"_pt"),delete d[p]),f!=="all"&&(f[p]=1)}return this._initted&&!this._pt&&u&&Pi(this),this},e.to=function(i,r){return new e(i,r,arguments[2])},e.from=function(i,r){return Fi(1,arguments)},e.delayedCall=function(i,r,o,a){return new e(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:r,onReverseComplete:r,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(i,r,o){return Fi(2,arguments)},e.set=function(i,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new e(i,r)},e.killTweensOf=function(i,r,o){return Ce.killTweensOf(i,r,o)},e}(qi);Rt(Le.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});lt("staggerTo,staggerFrom,staggerFromTo",function(n){Le[n]=function(){var e=new tt,t=Ma.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var pc=function(e,t,s){return e[t]=s},_h=function(e,t,s){return e[t](s)},o_=function(e,t,s,i){return e[t](i.fp,s)},a_=function(e,t,s){return e.setAttribute(t,s)},mc=function(e,t){return De(e[t])?_h:rc(e[t])&&e.setAttribute?a_:pc},gh=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},c_=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},vh=function(e,t){var s=t._pt,i="";if(!e&&t.b)i=t.b;else if(e===1&&t.e)i=t.e;else{for(;s;)i=s.p+(s.m?s.m(s.s+s.c*e):Math.round((s.s+s.c*e)*1e4)/1e4)+i,s=s._next;i+=t.c}t.set(t.t,t.p,i,t)},_c=function(e,t){for(var s=t._pt;s;)s.r(e,s.d),s=s._next},l_=function(e,t,s,i){for(var r=this._pt,o;r;)o=r._next,r.p===i&&r.modifier(e,t,s),r=o},u_=function(e){for(var t=this._pt,s,i;t;)i=t._next,t.p===e&&!t.op||t.op===e?Ro(this,t,"_pt"):t.dep||(s=1),t=i;return!s},h_=function(e,t,s,i){i.mSet(e,t,i.m.call(i.tween,s,i.mt),i)},yh=function(e){for(var t=e._pt,s,i,r,o;t;){for(s=t._next,i=r;i&&i.pr>t.pr;)i=i._next;(t._prev=i?i._prev:o)?t._prev._next=t:r=t,(t._next=i)?i._prev=t:o=t,t=s}e._pt=r},ut=function(){function n(t,s,i,r,o,a,c,l,u){this.t=s,this.s=r,this.c=o,this.p=i,this.r=a||gh,this.d=c||this,this.set=l||pc,this.pr=u||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(s,i,r){this.mSet=this.mSet||this.set,this.set=h_,this.m=s,this.mt=r,this.tween=i},n}();lt(uc+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(n){return lc[n]=1});kt.TweenMax=kt.TweenLite=Le;kt.TimelineLite=kt.TimelineMax=tt;Ce=new tt({sortChildren:!1,defaults:$n,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});yt.stringFilter=ch;var dn=[],Wr={},d_=[],El=0,f_=0,fa=function(e){return(Wr[e]||d_).map(function(t){return t()})},Ia=function(){var e=Date.now(),t=[];e-El>2&&(fa("matchMediaInit"),dn.forEach(function(s){var i=s.queries,r=s.conditions,o,a,c,l;for(a in i)o=Et.matchMedia(i[a]).matches,o&&(c=1),o!==r[a]&&(r[a]=o,l=1);l&&(s.revert(),c&&t.push(s))}),fa("matchMediaRevert"),t.forEach(function(s){return s.onMatch(s,function(i){return s.add(null,i)})}),El=e,fa("matchMedia"))},xh=function(){function n(t,s){this.selector=s&&Da(s),this.data=[],this._r=[],this.isReverted=!1,this.id=f_++,t&&this.add(t)}var e=n.prototype;return e.add=function(s,i,r){De(s)&&(r=i,i=s,s=De);var o=this,a=function(){var l=Ae,u=o.selector,h;return l&&l!==o&&l.data.push(o),r&&(o.selector=Da(r)),Ae=o,h=i.apply(o,arguments),De(h)&&o._r.push(h),Ae=l,o.selector=u,o.isReverted=!1,h};return o.last=a,s===De?a(o,function(c){return o.add(null,c)}):s?o[s]=a:a},e.ignore=function(s){var i=Ae;Ae=null,s(this),Ae=i},e.getTweens=function(){var s=[];return this.data.forEach(function(i){return i instanceof n?s.push.apply(s,i.getTweens()):i instanceof Le&&!(i.parent&&i.parent.data==="nested")&&s.push(i)}),s},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(s,i){var r=this;if(s?function(){for(var a=r.getTweens(),c=r.data.length,l;c--;)l=r.data[c],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}));for(a.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,h){return h.g-u.g||-1/0}).forEach(function(u){return u.t.revert(s)}),c=r.data.length;c--;)l=r.data[c],l instanceof tt?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Le)&&l.revert&&l.revert(s);r._r.forEach(function(u){return u(s,r)}),r.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),i)for(var o=dn.length;o--;)dn[o].id===this.id&&dn.splice(o,1)},e.revert=function(s){this.kill(s||{})},n}(),p_=function(){function n(t){this.contexts=[],this.scope=t}var e=n.prototype;return e.add=function(s,i,r){Qt(s)||(s={matches:s});var o=new xh(0,r||this.scope),a=o.conditions={},c,l,u;Ae&&!o.selector&&(o.selector=Ae.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=s;for(l in s)l==="all"?u=1:(c=Et.matchMedia(s[l]),c&&(dn.indexOf(o)<0&&dn.push(o),(a[l]=c.matches)&&(u=1),c.addListener?c.addListener(Ia):c.addEventListener("change",Ia)));return u&&i(o,function(h){return o.add(null,h)}),this},e.revert=function(s){this.kill(s||{})},e.kill=function(s){this.contexts.forEach(function(i){return i.kill(s,!0)})},n}(),eo={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),s=0;s1){var i=e.map(function(u){return ft.quickSetter(u,t,s)}),r=i.length;return function(u){for(var h=r;h--;)i[h](u)}}e=e[0]||{};var o=_t[t],a=ln(e),c=a.harness&&(a.harness.aliases||{})[t]||t,l=o?function(u){var h=new o;zn._pt=0,h.init(e,s?u+s:u,zn,0,[e]),h.render(1,h),zn._pt&&_c(1,zn)}:a.set(e,c);return o?l:function(u){return l(e,c,s?u+s:u,a,1)}},quickTo:function(e,t,s){var i,r=ft.to(e,mn((i={},i[t]="+=0.1",i.paused=!0,i),s||{})),o=function(c,l,u){return r.resetTo(t,c,l,u)};return o.tween=r,o},isTweening:function(e){return Ce.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=hn(e.ease,$n.ease)),kl($n,e||{})},config:function(e){return kl(yt,e||{})},registerEffect:function(e){var t=e.name,s=e.effect,i=e.plugins,r=e.defaults,o=e.extendTimeline;(i||"").split(",").forEach(function(a){return a&&!_t[a]&&!kt[a]&&Bi(t+" effect requires "+a+" plugin.")}),la[t]=function(a,c,l){return s(At(a),Rt(c||{},r),l)},o&&(tt.prototype[t]=function(a,c,l){return this.add(la[t](a,Qt(c)?c:(l=c)&&{},this),l)})},registerEase:function(e,t){se[e]=hn(t)},parseEase:function(e,t){return arguments.length?hn(e,t):se},getById:function(e){return Ce.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var s=new tt(e),i,r;for(s.smoothChildTiming=ct(e.smoothChildTiming),Ce.remove(s),s._dp=0,s._time=s._tTime=Ce._time,i=Ce._first;i;)r=i._next,(t||!(!i._dur&&i instanceof Le&&i.vars.onComplete===i._targets[0]))&&Zt(s,i,i._start-i._delay),i=r;return Zt(Ce,s,0),s},context:function(e,t){return e?new xh(e,t):Ae},matchMedia:function(e){return new p_(e)},matchMediaRefresh:function(){return dn.forEach(function(e){var t=e.conditions,s,i;for(i in t)t[i]&&(t[i]=!1,s=1);s&&e.revert()})||Ia()},addEventListener:function(e,t){var s=Wr[e]||(Wr[e]=[]);~s.indexOf(t)||s.push(t)},removeEventListener:function(e,t){var s=Wr[e],i=s&&s.indexOf(t);i>=0&&s.splice(i,1)},utils:{wrap:Gm,wrapYoyo:Ym,distribute:Ju,random:th,snap:eh,normalize:Wm,getUnit:Xe,clamp:Vm,splitColor:oh,toArray:At,selector:Da,mapRange:nh,pipe:Hm,unitize:qm,interpolate:Zm,shuffle:Ku},install:Bu,effects:la,ticker:gt,updateRoot:tt.updateRoot,plugins:_t,globalTimeline:Ce,core:{PropTween:ut,globals:Vu,Tween:Le,Timeline:tt,Animation:qi,getCache:ln,_removeLinkedListItem:Ro,reverting:function(){return $e},context:function(e){return e&&Ae&&(Ae.data.push(e),e._ctx=Ae),Ae},suppressOverwrites:function(e){return ic=e}}};lt("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return eo[n]=Le[n]});gt.add(tt.updateRoot);zn=eo.to({},{duration:0});var m_=function(e,t){for(var s=e._pt;s&&s.p!==t&&s.op!==t&&s.fp!==t;)s=s._next;return s},__=function(e,t){var s=e._targets,i,r,o;for(i in t)for(r=s.length;r--;)o=e._ptLookup[r][i],o&&(o=o.d)&&(o._pt&&(o=m_(o,i)),o&&o.modifier&&o.modifier(t[i],e,s[r],i))},pa=function(e,t){return{name:e,rawVars:1,init:function(i,r,o){o._onInit=function(a){var c,l;if(Ge(r)&&(c={},lt(r,function(u){return c[u]=1}),r=c),t){c={};for(l in r)c[l]=t(r[l]);r=c}__(a,r)}}}},ft=eo.registerPlugin({name:"attr",init:function(e,t,s,i,r){var o,a,c;this.tween=s;for(o in t)c=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(c||0)+"",t[o],i,r,0,0,o),a.op=o,a.b=c,this._props.push(o)},render:function(e,t){for(var s=t._pt;s;)$e?s.set(s.t,s.p,s.b,s):s.r(e,s.d),s=s._next}},{name:"endArray",init:function(e,t){for(var s=t.length;s--;)this.add(e,s,e[s]||0,t[s],0,0,0,0,0,1)}},pa("roundProps",Ra),pa("modifiers"),pa("snap",eh))||eo;Le.version=tt.version=ft.version="3.12.4";zu=1;oc()&&Jn();se.Power0;se.Power1;se.Power2;se.Power3;se.Power4;se.Linear;se.Quad;se.Cubic;se.Quart;se.Quint;se.Strong;se.Elastic;se.Back;se.SteppedEase;se.Bounce;se.Sine;se.Expo;se.Circ;/*! +*/var yt={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},$n={duration:.5,overwrite:!1,delay:0},ic,$e,Ae,Ot=1e8,fe=1/Ot,Sa=Math.PI*2,bm=Sa/4,Em=0,Iu=Math.sqrt,Om=Math.cos,Am=Math.sin,Ge=function(e){return typeof e=="string"},De=function(e){return typeof e=="function"},gs=function(e){return typeof e=="number"},rc=function(e){return typeof e>"u"},Qt=function(e){return typeof e=="object"},ct=function(e){return e!==!1},oc=function(){return typeof window<"u"},Fr=function(e){return De(e)||Ge(e)},Nu=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},Qe=Array.isArray,Ca=/(?:-?\.?\d|\.)+/gi,Fu=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Ln=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,ca=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Uu=/[+-]=-?[.\d]+/,Lu=/[^,'"\[\]\s]+/gi,Mm=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Ce,Et,ba,ac,kt={},$r={},zu,Bu=function(e){return($r=mn(e,kt))&&ft},cc=function(e,t){return console.warn("Invalid property",e,"set to",t,"Missing plugin? gsap.registerPlugin()")},Bi=function(e,t){return!t&&console.warn(e)},Vu=function(e,t){return e&&(kt[e]=t)&&$r&&($r[e]=t)||kt},Vi=function(){return 0},Dm={suppressEvents:!0,isStart:!0,kill:!1},Hr={suppressEvents:!0,kill:!1},Rm={suppressEvents:!0},lc={},Us=[],Ea={},ju,_t={},la={},Tl=30,qr=[],uc="",hc=function(e){var t=e[0],s,i;if(Qt(t)||De(t)||(e=[e]),!(s=(t._gsap||{}).harness)){for(i=qr.length;i--&&!qr[i].targetTest(t););s=qr[i]}for(i=e.length;i--;)e[i]&&(e[i]._gsap||(e[i]._gsap=new dh(e[i],s)))||e.splice(i,1);return e},ln=function(e){return e._gsap||hc(At(e))[0]._gsap},Hu=function(e,t,s){return(s=e[t])&&De(s)?e[t]():rc(s)&&e.getAttribute&&e.getAttribute(t)||s},lt=function(e,t){return(e=e.split(",")).forEach(t)||e},Pe=function(e){return Math.round(e*1e5)/1e5||0},je=function(e){return Math.round(e*1e7)/1e7||0},Hn=function(e,t){var s=t.charAt(0),i=parseFloat(t.substr(2));return e=parseFloat(e),s==="+"?e+i:s==="-"?e-i:s==="*"?e*i:e/i},Pm=function(e,t){for(var s=t.length,i=0;e.indexOf(t[i])<0&&++ia;)o=o._prev;return o?(t._next=o._next,o._next=t):(t._next=e[s],e[s]=t),t._next?t._next._prev=t:e[i]=t,t._prev=o,t.parent=t._dp=e,t},Ro=function(e,t,s,i){s===void 0&&(s="_first"),i===void 0&&(i="_last");var r=t._prev,o=t._next;r?r._next=o:e[s]===t&&(e[s]=o),o?o._prev=r:e[i]===t&&(e[i]=r),t._next=t._prev=t.parent=null},Bs=function(e,t){e.parent&&(!t||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},un=function(e,t){if(e&&(!t||t._end>e._dur||t._start<0))for(var s=e;s;)s._dirty=1,s=s.parent;return e},Fm=function(e){for(var t=e.parent;t&&t.parent;)t._dirty=1,t.totalDuration(),t=t.parent;return e},Oa=function(e,t,s,i){return e._startAt&&($e?e._startAt.revert(Hr):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(t,!0,i))},Um=function n(e){return!e||e._ts&&n(e.parent)},wl=function(e){return e._repeat?Qn(e._tTime,e=e.duration()+e._rDelay)*e:0},Qn=function(e,t){var s=Math.floor(e/=t);return e&&s===e?s-1:s},Jr=function(e,t){return(e-t._start)*t._ts+(t._ts>=0?0:t._dirty?t.totalDuration():t._tDur)},Po=function(e){return e._end=je(e._start+(e._tDur/Math.abs(e._ts||e._rts||fe)||0))},Io=function(e,t){var s=e._dp;return s&&s.smoothChildTiming&&e._ts&&(e._start=je(s._time-(e._ts>0?t/e._ts:((e._dirty?e.totalDuration():e._tDur)-t)/-e._ts)),Po(e),s._dirty||un(s,e)),e},Zu=function(e,t){var s;if((t._time||!t._dur&&t._initted||t._startfe)&&t.render(s,!0)),un(e,t)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur=0&&s.totalTime(s._tTime),s=s._dp;e._zTime=-fe}},Zt=function(e,t,s,i){return t.parent&&Bs(t),t._start=je((gs(s)?s:s||e!==Ce?bt(e,s,t):e._time)+t._delay),t._end=je(t._start+(t.totalDuration()/Math.abs(t.timeScale())||0)),Yu(e,t,"_first","_last",e._sort?"_start":0),Aa(t)||(e._recent=t),i||Zu(e,t),e._ts<0&&Io(e,e._tTime),e},Xu=function(e,t){return(kt.ScrollTrigger||cc("scrollTrigger",t))&&kt.ScrollTrigger.create(t,e)},$u=function(e,t,s,i,r){if(fc(e,t,r),!e._initted)return 1;if(!s&&e._pt&&!$e&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&ju!==gt.frame)return Us.push(e),e._lazy=[r,i],1},Lm=function n(e){var t=e.parent;return t&&t._ts&&t._initted&&!t._lock&&(t.rawTime()<0||n(t))},Aa=function(e){var t=e.data;return t==="isFromStart"||t==="isStart"},zm=function(e,t,s,i){var r=e.ratio,o=t<0||!t&&(!e._start&&Lm(e)&&!(!e._initted&&Aa(e))||(e._ts<0||e._dp._ts<0)&&!Aa(e))?0:1,a=e._rDelay,c=0,l,u,h;if(a&&e._repeat&&(c=mr(0,e._tDur,t),u=Qn(c,a),e._yoyo&&u&1&&(o=1-o),u!==Qn(e._tTime,a)&&(r=1-o,e.vars.repeatRefresh&&e._initted&&e.invalidate())),o!==r||$e||i||e._zTime===fe||!t&&e._zTime){if(!e._initted&&$u(e,t,i,s,c))return;for(h=e._zTime,e._zTime=t||(s?fe:0),s||(s=t&&!h),e.ratio=o,e._from&&(o=1-o),e._time=0,e._tTime=c,l=e._pt;l;)l.r(o,l.d),l=l._next;t<0&&Oa(e,t,s,!0),e._onUpdate&&!s&&vt(e,"onUpdate"),c&&e._repeat&&!s&&e.parent&&vt(e,"onRepeat"),(t>=e._tDur||t<0)&&e.ratio===o&&(o&&Bs(e,1),!s&&!$e&&(vt(e,o?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=t)},Bm=function(e,t,s){var i;if(s>t)for(i=e._first;i&&i._start<=s;){if(i.data==="isPause"&&i._start>t)return i;i=i._next}else for(i=e._last;i&&i._start>=s;){if(i.data==="isPause"&&i._start0&&!i&&Io(e,e._tTime=e._tDur*a),e.parent&&Po(e),s||un(e.parent,e),e},Sl=function(e){return e instanceof tt?un(e):Kn(e,e._dur)},Vm={_start:0,endTime:Vi,totalDuration:Vi},bt=function n(e,t,s){var i=e.labels,r=e._recent||Vm,o=e.duration()>=Ot?r.endTime(!1):e._dur,a,c,l;return Ge(t)&&(isNaN(t)||t in i)?(c=t.charAt(0),l=t.substr(-1)==="%",a=t.indexOf("="),c==="<"||c===">"?(a>=0&&(t=t.replace(/=/,"")),(c==="<"?r._start:r.endTime(r._repeat>=0))+(parseFloat(t.substr(1))||0)*(l?(a<0?r:s).totalDuration()/100:1)):a<0?(t in i||(i[t]=o),i[t]):(c=parseFloat(t.charAt(a-1)+t.substr(a+1)),l&&s&&(c=c/100*(Qe(s)?s[0]:s).totalDuration()),a>1?n(e,t.substr(0,a-1),s)+c:o+c)):t==null?o:+t},Fi=function(e,t,s){var i=gs(t[1]),r=(i?2:1)+(e<2?0:1),o=t[r],a,c;if(i&&(o.duration=t[1]),o.parent=s,e){for(a=o,c=s;c&&!("immediateRender"in a);)a=c.vars.defaults||{},c=ct(c.vars.inherit)&&c.parent;o.immediateRender=ct(a.immediateRender),e<2?o.runBackwards=1:o.startAt=t[r-1]}return new Le(t[0],o,t[r+1])},Zs=function(e,t){return e||e===0?t(e):t},mr=function(e,t,s){return st?t:s},Xe=function(e,t){return!Ge(e)||!(t=Mm.exec(e))?"":t[1]},jm=function(e,t,s){return Zs(s,function(i){return mr(e,t,i)})},Ma=[].slice,Qu=function(e,t){return e&&Qt(e)&&"length"in e&&(!t&&!e.length||e.length-1 in e&&Qt(e[0]))&&!e.nodeType&&e!==Et},Hm=function(e,t,s){return s===void 0&&(s=[]),e.forEach(function(i){var r;return Ge(i)&&!t||Qu(i,1)?(r=s).push.apply(r,At(i)):s.push(i)})||s},At=function(e,t,s){return Ae&&!t&&Ae.selector?Ae.selector(e):Ge(e)&&!s&&(ba||!Jn())?Ma.call((t||ac).querySelectorAll(e),0):Qe(e)?Hm(e,s):Qu(e)?Ma.call(e,0):e?[e]:[]},Da=function(e){return e=At(e)[0]||Bi("Invalid scope")||{},function(t){var s=e.current||e.nativeElement||e;return At(t,s.querySelectorAll?s:s===e?Bi("Invalid scope")||ac.createElement("div"):e)}},Ku=function(e){return e.sort(function(){return .5-Math.random()})},Ju=function(e){if(De(e))return e;var t=Qt(e)?e:{each:e},s=hn(t.ease),i=t.from||0,r=parseFloat(t.base)||0,o={},a=i>0&&i<1,c=isNaN(i)||a,l=t.axis,u=i,h=i;return Ge(i)?u=h={center:.5,edges:.5,end:1}[i]||0:!a&&c&&(u=i[0],h=i[1]),function(d,f,m){var p=(m||t).length,g=o[p],y,w,S,v,_,T,x,k,C;if(!g){if(C=t.grid==="auto"?0:(t.grid||[1,Ot])[1],!C){for(x=-Ot;x<(x=m[C++].getBoundingClientRect().left)&&Cx&&(x=_),_p?p-1:l?l==="y"?p/C:C:Math.max(C,p/C))||0)*(i==="edges"?-1:1),g.b=p<0?r-p:r,g.u=Xe(t.amount||t.each)||0,s=s&&p<0?lh(s):s}return p=(g[d]-g.min)/g.max||0,je(g.b+(s?s(p):p)*g.v)+g.u}},Ra=function(e){var t=Math.pow(10,((e+"").split(".")[1]||"").length);return function(s){var i=je(Math.round(parseFloat(s)/e)*e*t);return(i-i%1)/t+(gs(s)?0:Xe(s))}},eh=function(e,t){var s=Qe(e),i,r;return!s&&Qt(e)&&(i=s=e.radius||Ot,e.values?(e=At(e.values),(r=!gs(e[0]))&&(i*=i)):e=Ra(e.increment)),Zs(t,s?De(e)?function(o){return r=e(o),Math.abs(r-o)<=i?r:o}:function(o){for(var a=parseFloat(r?o.x:o),c=parseFloat(r?o.y:0),l=Ot,u=0,h=e.length,d,f;h--;)r?(d=e[h].x-a,f=e[h].y-c,d=d*d+f*f):d=Math.abs(e[h]-a),di?r-o:o)})},ji=function(e){for(var t=0,s="",i,r,o,a;~(i=e.indexOf("random(",t));)o=e.indexOf(")",i),a=e.charAt(i+7)==="[",r=e.substr(i+7,o-i-7).match(a?Lu:Ca),s+=e.substr(t,i-t)+th(a?r:+r[0],a?0:+r[1],+r[2]||1e-5),t=o+1;return s+e.substr(t,e.length-t)},nh=function(e,t,s,i,r){var o=t-e,a=i-s;return Zs(r,function(c){return s+((c-e)/o*a||0)})},Xm=function n(e,t,s,i){var r=isNaN(e+t)?0:function(f){return(1-f)*e+f*t};if(!r){var o=Ge(e),a={},c,l,u,h,d;if(s===!0&&(i=1)&&(s=null),o)e={p:e},t={p:t};else if(Qe(e)&&!Qe(t)){for(u=[],h=e.length,d=h-2,l=1;l(a=Math.abs(a))&&(c=o,r=a);return c},vt=function(e,t,s){var i=e.vars,r=i[t],o=Ae,a=e._ctx,c,l,u;if(r)return c=i[t+"Params"],l=i.callbackScope||e,s&&Us.length&&Qr(),a&&(Ae=a),u=c?r.apply(l,c):r.call(l),Ae=o,u},Pi=function(e){return Bs(e),e.scrollTrigger&&e.scrollTrigger.kill(!!$e),e.progress()<1&&vt(e,"onInterrupt"),e},zn,ih=[],rh=function(e){if(oc()&&e){e=!e.name&&e.default||e;var t=e.name,s=De(e),i=t&&!s&&e.init?function(){this._props=[]}:e,r={init:Vi,render:_c,add:dc,kill:h_,modifier:u_,rawVars:0},o={targetTest:0,get:0,getSetter:mc,aliases:{},register:0};if(Jn(),e!==i){if(_t[t])return;Rt(i,Rt(Kr(e,r),o)),mn(i.prototype,mn(r,Kr(e,o))),_t[i.prop=t]=i,e.targetTest&&(qr.push(i),lc[t]=1),t=(t==="css"?"CSS":t.charAt(0).toUpperCase()+t.substr(1))+"Plugin"}Vu(t,i),e.register&&e.register(ft,i,ut)}else e&&ih.push(e)},de=255,Ii={aqua:[0,de,de],lime:[0,de,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,de],navy:[0,0,128],white:[de,de,de],olive:[128,128,0],yellow:[de,de,0],orange:[de,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[de,0,0],pink:[de,192,203],cyan:[0,de,de],transparent:[de,de,de,0]},ua=function(e,t,s){return e+=e<0?1:e>1?-1:0,(e*6<1?t+(s-t)*e*6:e<.5?s:e*3<2?t+(s-t)*(2/3-e)*6:t)*de+.5|0},oh=function(e,t,s){var i=e?gs(e)?[e>>16,e>>8&de,e&de]:0:Ii.black,r,o,a,c,l,u,h,d,f,m;if(!i){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),Ii[e])i=Ii[e];else if(e.charAt(0)==="#"){if(e.length<6&&(r=e.charAt(1),o=e.charAt(2),a=e.charAt(3),e="#"+r+r+o+o+a+a+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return i=parseInt(e.substr(1,6),16),[i>>16,i>>8&de,i&de,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),i=[e>>16,e>>8&de,e&de]}else if(e.substr(0,3)==="hsl"){if(i=m=e.match(Ca),!t)c=+i[0]%360/360,l=+i[1]/100,u=+i[2]/100,o=u<=.5?u*(l+1):u+l-u*l,r=u*2-o,i.length>3&&(i[3]*=1),i[0]=ua(c+1/3,r,o),i[1]=ua(c,r,o),i[2]=ua(c-1/3,r,o);else if(~e.indexOf("="))return i=e.match(Fu),s&&i.length<4&&(i[3]=1),i}else i=e.match(Ca)||Ii.transparent;i=i.map(Number)}return t&&!m&&(r=i[0]/de,o=i[1]/de,a=i[2]/de,h=Math.max(r,o,a),d=Math.min(r,o,a),u=(h+d)/2,h===d?c=l=0:(f=h-d,l=u>.5?f/(2-h-d):f/(h+d),c=h===r?(o-a)/f+(oe&&(s+=y-t),i+=y,_=i-s,S=_-o,(S>0||w)&&(T=++h.frame,d=_-h.time*1e3,h.time=_=_/1e3,o+=S+(S>=r?4:r-S),v=1),w||(c=l(p)),v)for(f=0;f=y&&f--},_listeners:a},h}(),Jn=function(){return!Hi&>.wake()},se={},Qm=/^[\d.\-M][\d.\-,\s]/,Km=/["']/g,Jm=function(e){for(var t={},s=e.substr(1,e.length-3).split(":"),i=s[0],r=1,o=s.length,a,c,l;r1&&s.config?s.config.apply(null,~e.indexOf("{")?[Jm(t[1])]:e_(e).split(",").map(Wu)):se._CE&&Qm.test(e)?se._CE("",e):s},lh=function(e){return function(t){return 1-e(1-t)}},uh=function n(e,t){for(var s=e._first,i;s;)s instanceof tt?n(s,t):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==t&&(s.timeline?n(s.timeline,t):(i=s._ease,s._ease=s._yEase,s._yEase=i,s._yoyo=t)),s=s._next},hn=function(e,t){return e&&(De(e)?e:se[e]||t_(e))||t},wn=function(e,t,s,i){s===void 0&&(s=function(c){return 1-t(1-c)}),i===void 0&&(i=function(c){return c<.5?t(c*2)/2:1-t((1-c)*2)/2});var r={easeIn:t,easeOut:s,easeInOut:i},o;return lt(e,function(a){se[a]=kt[a]=r,se[o=a.toLowerCase()]=s;for(var c in r)se[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=se[a+"."+c]=r[c]}),r},hh=function(e){return function(t){return t<.5?(1-e(1-t*2))/2:.5+e((t-.5)*2)/2}},ha=function n(e,t,s){var i=t>=1?t:1,r=(s||(e?.3:.45))/(t<1?t:1),o=r/Sa*(Math.asin(1/i)||0),a=function(u){return u===1?1:i*Math.pow(2,-10*u)*Am((u-o)*r)+1},c=e==="out"?a:e==="in"?function(l){return 1-a(1-l)}:hh(a);return r=Sa/r,c.config=function(l,u){return n(e,l,u)},c},da=function n(e,t){t===void 0&&(t=1.70158);var s=function(o){return o?--o*o*((t+1)*o+t)+1:0},i=e==="out"?s:e==="in"?function(r){return 1-s(1-r)}:hh(s);return i.config=function(r){return n(e,r)},i};lt("Linear,Quad,Cubic,Quart,Quint,Strong",function(n,e){var t=e<5?e+1:e;wn(n+",Power"+(t-1),e?function(s){return Math.pow(s,t)}:function(s){return s},function(s){return 1-Math.pow(1-s,t)},function(s){return s<.5?Math.pow(s*2,t)/2:1-Math.pow((1-s)*2,t)/2})});se.Linear.easeNone=se.none=se.Linear.easeIn;wn("Elastic",ha("in"),ha("out"),ha());(function(n,e){var t=1/e,s=2*t,i=2.5*t,r=function(a){return a0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},e.totalDuration=function(s){return arguments.length?(this._dirty=0,Kn(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(s,i){if(Jn(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Io(this,s),!r._dp||r.parent||Zu(r,this);r&&r.parent;)r.parent._time!==r._start+(r._ts>=0?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&s0||!this._tDur&&!s)&&Zt(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!i||this._initted&&Math.abs(this._zTime)===fe||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),qu(this,s,i)),this},e.time=function(s,i){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+wl(this))%(this._dur+this._rDelay)||(s?this._dur:0),i):this._time},e.totalProgress=function(s,i){return arguments.length?this.totalTime(this.totalDuration()*s,i):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},e.progress=function(s,i){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+wl(this),i):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(s,i){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*r,i):this._repeat?Qn(this._tTime,r)+1:1},e.timeScale=function(s,i){if(!arguments.length)return this._rts===-fe?0:this._rts;if(this._rts===s)return this;var r=this.parent&&this._ts?Jr(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-fe?0:this._rts,this.totalTime(mr(-Math.abs(this._delay),this._tDur,r),i!==!1),Po(this),Fm(this)},e.paused=function(s){return arguments.length?(this._ps!==s&&(this._ps=s,s?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Jn(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==fe&&(this._tTime-=fe)))),this):this._ps},e.startTime=function(s){if(arguments.length){this._start=s;var i=this.parent||this._dp;return i&&(i._sort||!this.parent)&&Zt(i,this,s-this._delay),this}return this._start},e.endTime=function(s){return this._start+(ct(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(s){var i=this.parent||this._dp;return i?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Jr(i.rawTime(s),this):this._tTime:this._tTime},e.revert=function(s){s===void 0&&(s=Rm);var i=$e;return $e=s,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),$e=i,this},e.globalTime=function(s){for(var i=this,r=arguments.length?s:i.rawTime();i;)r=i._start+r/(Math.abs(i._ts)||1),i=i._dp;return!this.parent&&this._sat?this._sat.globalTime(s):r},e.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,Sl(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(s){if(arguments.length){var i=this._time;return this._rDelay=s,Sl(this),i?this.time(i):this}return this._rDelay},e.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},e.seek=function(s,i){return this.totalTime(bt(this,s),ct(i))},e.restart=function(s,i){return this.play().totalTime(s?-this._delay:0,ct(i))},e.play=function(s,i){return s!=null&&this.seek(s,i),this.reversed(!1).paused(!1)},e.reverse=function(s,i){return s!=null&&this.seek(s||this.totalDuration(),i),this.reversed(!0).paused(!1)},e.pause=function(s,i){return s!=null&&this.seek(s,i),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-fe:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-fe,this},e.isActive=function(){var s=this.parent||this._dp,i=this._start,r;return!!(!s||this._ts&&this._initted&&s.isActive()&&(r=s.rawTime(!0))>=i&&r1?(i?(o[s]=i,r&&(o[s+"Params"]=r),s==="onUpdate"&&(this._onUpdate=i)):delete o[s],this):o[s]},e.then=function(s){var i=this;return new Promise(function(r){var o=De(s)?s:Gu,a=function(){var l=i.then;i.then=null,De(o)&&(o=o(i))&&(o.then||o===i)&&(i.then=l),r(o),i.then=l};i._initted&&i.totalProgress()===1&&i._ts>=0||!i._tTime&&i._ts<0?a():i._prom=a})},e.kill=function(){Pi(this)},n}();Rt(qi.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-fe,_prom:0,_ps:!1,_rts:1});var tt=function(n){Pu(e,n);function e(s,i){var r;return s===void 0&&(s={}),r=n.call(this,s)||this,r.labels={},r.smoothChildTiming=!!s.smoothChildTiming,r.autoRemoveChildren=!!s.autoRemoveChildren,r._sort=ct(s.sortChildren),Ce&&Zt(s.parent||Ce,ls(r),i),s.reversed&&r.reverse(),s.paused&&r.paused(!0),s.scrollTrigger&&Xu(ls(r),s.scrollTrigger),r}var t=e.prototype;return t.to=function(i,r,o){return Fi(0,arguments,this),this},t.from=function(i,r,o){return Fi(1,arguments,this),this},t.fromTo=function(i,r,o,a){return Fi(2,arguments,this),this},t.set=function(i,r,o){return r.duration=0,r.parent=this,Ni(r).repeatDelay||(r.repeat=0),r.immediateRender=!!r.immediateRender,new Le(i,r,bt(this,o),1),this},t.call=function(i,r,o){return Zt(this,Le.delayedCall(0,i,r),o)},t.staggerTo=function(i,r,o,a,c,l,u){return o.duration=r,o.stagger=o.stagger||a,o.onComplete=l,o.onCompleteParams=u,o.parent=this,new Le(i,o,bt(this,c)),this},t.staggerFrom=function(i,r,o,a,c,l,u){return o.runBackwards=1,Ni(o).immediateRender=ct(o.immediateRender),this.staggerTo(i,r,o,a,c,l,u)},t.staggerFromTo=function(i,r,o,a,c,l,u,h){return a.startAt=o,Ni(a).immediateRender=ct(a.immediateRender),this.staggerTo(i,r,a,c,l,u,h)},t.render=function(i,r,o){var a=this._time,c=this._dirty?this.totalDuration():this._tDur,l=this._dur,u=i<=0?0:je(i),h=this._zTime<0!=i<0&&(this._initted||!l),d,f,m,p,g,y,w,S,v,_,T,x;if(this!==Ce&&u>c&&i>=0&&(u=c),u!==this._tTime||o||h){if(a!==this._time&&l&&(u+=this._time-a,i+=this._time-a),d=u,v=this._start,S=this._ts,y=!S,h&&(l||(a=this._zTime),(i||!r)&&(this._zTime=i)),this._repeat){if(T=this._yoyo,g=l+this._rDelay,this._repeat<-1&&i<0)return this.totalTime(g*100+i,r,o);if(d=je(u%g),u===c?(p=this._repeat,d=l):(p=~~(u/g),p&&p===u/g&&(d=l,p--),d>l&&(d=l)),_=Qn(this._tTime,g),!a&&this._tTime&&_!==p&&this._tTime-_*g-this._dur<=0&&(_=p),T&&p&1&&(d=l-d,x=1),p!==_&&!this._lock){var k=T&&_&1,C=k===(T&&p&1);if(p<_&&(k=!k),a=k?0:u%l?l:u,this._lock=1,this.render(a||(x?0:je(p*g)),r,!l)._lock=0,this._tTime=u,!r&&this.parent&&vt(this,"onRepeat"),this.vars.repeatRefresh&&!x&&(this.invalidate()._lock=1),a&&a!==this._time||y!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(l=this._dur,c=this._tDur,C&&(this._lock=2,a=k?l:-1e-4,this.render(a,!0),this.vars.repeatRefresh&&!x&&this.invalidate()),this._lock=0,!this._ts&&!y)return this;uh(this,x)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(w=Bm(this,je(a),je(d)),w&&(u-=d-(d=w._start))),this._tTime=u,this._time=d,this._act=!S,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=i,a=0),!a&&d&&!r&&!p&&(vt(this,"onStart"),this._tTime!==u))return this;if(d>=a&&i>=0)for(f=this._first;f;){if(m=f._next,(f._act||d>=f._start)&&f._ts&&w!==f){if(f.parent!==this)return this.render(i,r,o);if(f.render(f._ts>0?(d-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(d-f._start)*f._ts,r,o),d!==this._time||!this._ts&&!y){w=0,m&&(u+=this._zTime=-fe);break}}f=m}else{f=this._last;for(var E=i<0?i:d;f;){if(m=f._prev,(f._act||E<=f._end)&&f._ts&&w!==f){if(f.parent!==this)return this.render(i,r,o);if(f.render(f._ts>0?(E-f._start)*f._ts:(f._dirty?f.totalDuration():f._tDur)+(E-f._start)*f._ts,r,o||$e&&(f._initted||f._startAt)),d!==this._time||!this._ts&&!y){w=0,m&&(u+=this._zTime=E?-fe:fe);break}}f=m}}if(w&&!r&&(this.pause(),w.render(d>=a?0:-fe)._zTime=d>=a?1:-1,this._ts))return this._start=v,Po(this),this.render(i,r,o);this._onUpdate&&!r&&vt(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&a)&&(v===this._start||Math.abs(S)!==Math.abs(this._ts))&&(this._lock||((i||!l)&&(u===c&&this._ts>0||!u&&this._ts<0)&&Bs(this,1),!r&&!(i<0&&!a)&&(u||a||!c)&&(vt(this,u===c&&i>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u0)&&this._prom())))}return this},t.add=function(i,r){var o=this;if(gs(r)||(r=bt(this,r,i)),!(i instanceof qi)){if(Qe(i))return i.forEach(function(a){return o.add(a,r)}),this;if(Ge(i))return this.addLabel(i,r);if(De(i))i=Le.delayedCall(0,i);else return this}return this!==i?Zt(this,i,r):this},t.getChildren=function(i,r,o,a){i===void 0&&(i=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),a===void 0&&(a=-Ot);for(var c=[],l=this._first;l;)l._start>=a&&(l instanceof Le?r&&c.push(l):(o&&c.push(l),i&&c.push.apply(c,l.getChildren(!0,r,o)))),l=l._next;return c},t.getById=function(i){for(var r=this.getChildren(1,1,1),o=r.length;o--;)if(r[o].vars.id===i)return r[o]},t.remove=function(i){return Ge(i)?this.removeLabel(i):De(i)?this.killTweensOf(i):(Ro(this,i),i===this._recent&&(this._recent=this._last),un(this))},t.totalTime=function(i,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=je(gt.time-(this._ts>0?i/this._ts:(this.totalDuration()-i)/-this._ts))),n.prototype.totalTime.call(this,i,r),this._forcing=0,this):this._tTime},t.addLabel=function(i,r){return this.labels[i]=bt(this,r),this},t.removeLabel=function(i){return delete this.labels[i],this},t.addPause=function(i,r,o){var a=Le.delayedCall(0,r||Vi,o);return a.data="isPause",this._hasPause=1,Zt(this,a,bt(this,i))},t.removePause=function(i){var r=this._first;for(i=bt(this,i);r;)r._start===i&&r.data==="isPause"&&Bs(r),r=r._next},t.killTweensOf=function(i,r,o){for(var a=this.getTweensOf(i,o),c=a.length;c--;)Rs!==a[c]&&a[c].kill(i,r);return this},t.getTweensOf=function(i,r){for(var o=[],a=At(i),c=this._first,l=gs(r),u;c;)c instanceof Le?Pm(c._targets,a)&&(l?(!Rs||c._initted&&c._ts)&&c.globalTime(0)<=r&&c.globalTime(c.totalDuration())>r:!r||c.isActive())&&o.push(c):(u=c.getTweensOf(a,r)).length&&o.push.apply(o,u),c=c._next;return o},t.tweenTo=function(i,r){r=r||{};var o=this,a=bt(o,i),c=r,l=c.startAt,u=c.onStart,h=c.onStartParams,d=c.immediateRender,f,m=Le.to(o,Rt({ease:r.ease||"none",lazy:!1,immediateRender:!1,time:a,overwrite:"auto",duration:r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale())||fe,onStart:function(){if(o.pause(),!f){var g=r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale());m._dur!==g&&Kn(m,g,0,1).render(m._time,!0,!0),f=1}u&&u.apply(m,h||[])}},r));return d?m.render(0):m},t.tweenFromTo=function(i,r,o){return this.tweenTo(r,Rt({startAt:{time:bt(this,i)}},o))},t.recent=function(){return this._recent},t.nextLabel=function(i){return i===void 0&&(i=this._time),Cl(this,bt(this,i))},t.previousLabel=function(i){return i===void 0&&(i=this._time),Cl(this,bt(this,i),1)},t.currentLabel=function(i){return arguments.length?this.seek(i,!0):this.previousLabel(this._time+fe)},t.shiftChildren=function(i,r,o){o===void 0&&(o=0);for(var a=this._first,c=this.labels,l;a;)a._start>=o&&(a._start+=i,a._end+=i),a=a._next;if(r)for(l in c)c[l]>=o&&(c[l]+=i);return un(this)},t.invalidate=function(i){var r=this._first;for(this._lock=0;r;)r.invalidate(i),r=r._next;return n.prototype.invalidate.call(this,i)},t.clear=function(i){i===void 0&&(i=!0);for(var r=this._first,o;r;)o=r._next,this.remove(r),r=o;return this._dp&&(this._time=this._tTime=this._pTime=0),i&&(this.labels={}),un(this)},t.totalDuration=function(i){var r=0,o=this,a=o._last,c=Ot,l,u,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-i:i));if(o._dirty){for(h=o.parent;a;)l=a._prev,a._dirty&&a.totalDuration(),u=a._start,u>c&&o._sort&&a._ts&&!o._lock?(o._lock=1,Zt(o,a,u-a._delay,1)._lock=0):c=u,u<0&&a._ts&&(r-=u,(!h&&!o._dp||h&&h.smoothChildTiming)&&(o._start+=u/o._ts,o._time-=u,o._tTime-=u),o.shiftChildren(-u,!1,-1/0),c=0),a._end>r&&a._ts&&(r=a._end),a=l;Kn(o,o===Ce&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},e.updateRoot=function(i){if(Ce._ts&&(qu(Ce,Jr(i,Ce)),ju=gt.frame),gt.frame>=Tl){Tl+=yt.autoSleep||120;var r=Ce._first;if((!r||!r._ts)&&yt.autoSleep&>._listeners.length<2){for(;r&&!r._ts;)r=r._next;r||gt.sleep()}}},e}(qi);Rt(tt.prototype,{_lock:0,_hasPause:0,_forcing:0});var s_=function(e,t,s,i,r,o,a){var c=new ut(this._pt,e,t,0,1,vh,null,r),l=0,u=0,h,d,f,m,p,g,y,w;for(c.b=s,c.e=i,s+="",i+="",(y=~i.indexOf("random("))&&(i=ji(i)),o&&(w=[s,i],o(w,e,t),s=w[0],i=w[1]),d=s.match(ca)||[];h=ca.exec(i);)m=h[0],p=i.substring(l,h.index),f?f=(f+1)%5:p.substr(-5)==="rgba("&&(f=1),m!==d[u++]&&(g=parseFloat(d[u-1])||0,c._pt={_next:c._pt,p:p||u===1?p:",",s:g,c:m.charAt(1)==="="?Hn(g,m)-g:parseFloat(m)-g,m:f&&f<4?Math.round:0},l=ca.lastIndex);return c.c=l")}),v.duration();else{T={};for(k in m)k==="ease"||k==="easeEach"||o_(k,m[k],T,m.easeEach);for(k in T)for(R=T[k].sort(function(N,U){return N.t-U.t}),A=0,_=0;_c-fe&&!u?c:il&&(d=l)),y=this._yoyo&&m&1,y&&(v=this._yEase,d=l-d),g=Qn(this._tTime,p),d===a&&!o&&this._initted&&m===g)return this._tTime=h,this;m!==g&&(S&&this._yEase&&uh(S,y),this.vars.repeatRefresh&&!y&&!this._lock&&this._time!==l&&this._initted&&(this._lock=o=1,this.render(je(p*m),!0).invalidate()._lock=0))}if(!this._initted){if($u(this,u?i:d,o,r,h))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&m!==g))return this;if(l!==this._dur)return this.render(i,r,o)}if(this._tTime=h,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=w=(v||this._ease)(d/l),this._from&&(this.ratio=w=1-w),d&&!a&&!r&&!m&&(vt(this,"onStart"),this._tTime!==h))return this;for(f=this._pt;f;)f.r(w,f.d),f=f._next;S&&S.render(i<0?i:!d&&y?-fe:S._dur*S._ease(d/this._dur),r,o)||this._startAt&&(this._zTime=i),this._onUpdate&&!r&&(u&&Oa(this,i,r,o),vt(this,"onUpdate")),this._repeat&&m!==g&&this.vars.onRepeat&&!r&&this.parent&&vt(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&Oa(this,i,!0,!0),(i||!l)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Bs(this,1),!r&&!(u&&!a)&&(h||a||y)&&(vt(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom()))}return this},t.targets=function(){return this._targets},t.invalidate=function(i){return(!i||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(i),n.prototype.invalidate.call(this,i)},t.resetTo=function(i,r,o,a,c){Hi||gt.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||fc(this,l),u=this._ease(l/this._dur),i_(this,i,r,o,a,u,l,c)?this.resetTo(i,r,o,a,1):(Io(this,0),this.parent||Yu(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},t.kill=function(i,r){if(r===void 0&&(r="all"),!i&&(!r||r==="all"))return this._lazy=this._pt=0,this.parent?Pi(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(i,r,Rs&&Rs.vars.overwrite!==!0)._first||Pi(this),this.parent&&o!==this.timeline.totalDuration()&&Kn(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,c=i?At(i):a,l=this._ptLookup,u=this._pt,h,d,f,m,p,g,y;if((!r||r==="all")&&Nm(a,c))return r==="all"&&(this._pt=0),Pi(this);for(h=this._op=this._op||[],r!=="all"&&(Ge(r)&&(p={},lt(r,function(w){return p[w]=1}),r=p),r=r_(a,r)),y=a.length;y--;)if(~c.indexOf(a[y])){d=l[y],r==="all"?(h[y]=r,m=d,f={}):(f=h[y]=h[y]||{},m=r);for(p in m)g=d&&d[p],g&&((!("kill"in g.d)||g.d.kill(p)===!0)&&Ro(this,g,"_pt"),delete d[p]),f!=="all"&&(f[p]=1)}return this._initted&&!this._pt&&u&&Pi(this),this},e.to=function(i,r){return new e(i,r,arguments[2])},e.from=function(i,r){return Fi(1,arguments)},e.delayedCall=function(i,r,o,a){return new e(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:i,onComplete:r,onReverseComplete:r,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},e.fromTo=function(i,r,o){return Fi(2,arguments)},e.set=function(i,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new e(i,r)},e.killTweensOf=function(i,r,o){return Ce.killTweensOf(i,r,o)},e}(qi);Rt(Le.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});lt("staggerTo,staggerFrom,staggerFromTo",function(n){Le[n]=function(){var e=new tt,t=Ma.call(arguments,0);return t.splice(n==="staggerFromTo"?5:4,0,0),e[n].apply(e,t)}});var pc=function(e,t,s){return e[t]=s},_h=function(e,t,s){return e[t](s)},a_=function(e,t,s,i){return e[t](i.fp,s)},c_=function(e,t,s){return e.setAttribute(t,s)},mc=function(e,t){return De(e[t])?_h:rc(e[t])&&e.setAttribute?c_:pc},gh=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e6)/1e6,t)},l_=function(e,t){return t.set(t.t,t.p,!!(t.s+t.c*e),t)},vh=function(e,t){var s=t._pt,i="";if(!e&&t.b)i=t.b;else if(e===1&&t.e)i=t.e;else{for(;s;)i=s.p+(s.m?s.m(s.s+s.c*e):Math.round((s.s+s.c*e)*1e4)/1e4)+i,s=s._next;i+=t.c}t.set(t.t,t.p,i,t)},_c=function(e,t){for(var s=t._pt;s;)s.r(e,s.d),s=s._next},u_=function(e,t,s,i){for(var r=this._pt,o;r;)o=r._next,r.p===i&&r.modifier(e,t,s),r=o},h_=function(e){for(var t=this._pt,s,i;t;)i=t._next,t.p===e&&!t.op||t.op===e?Ro(this,t,"_pt"):t.dep||(s=1),t=i;return!s},d_=function(e,t,s,i){i.mSet(e,t,i.m.call(i.tween,s,i.mt),i)},yh=function(e){for(var t=e._pt,s,i,r,o;t;){for(s=t._next,i=r;i&&i.pr>t.pr;)i=i._next;(t._prev=i?i._prev:o)?t._prev._next=t:r=t,(t._next=i)?i._prev=t:o=t,t=s}e._pt=r},ut=function(){function n(t,s,i,r,o,a,c,l,u){this.t=s,this.s=r,this.c=o,this.p=i,this.r=a||gh,this.d=c||this,this.set=l||pc,this.pr=u||0,this._next=t,t&&(t._prev=this)}var e=n.prototype;return e.modifier=function(s,i,r){this.mSet=this.mSet||this.set,this.set=d_,this.m=s,this.mt=r,this.tween=i},n}();lt(uc+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(n){return lc[n]=1});kt.TweenMax=kt.TweenLite=Le;kt.TimelineLite=kt.TimelineMax=tt;Ce=new tt({sortChildren:!1,defaults:$n,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});yt.stringFilter=ch;var dn=[],Wr={},f_=[],El=0,p_=0,fa=function(e){return(Wr[e]||f_).map(function(t){return t()})},Ia=function(){var e=Date.now(),t=[];e-El>2&&(fa("matchMediaInit"),dn.forEach(function(s){var i=s.queries,r=s.conditions,o,a,c,l;for(a in i)o=Et.matchMedia(i[a]).matches,o&&(c=1),o!==r[a]&&(r[a]=o,l=1);l&&(s.revert(),c&&t.push(s))}),fa("matchMediaRevert"),t.forEach(function(s){return s.onMatch(s,function(i){return s.add(null,i)})}),El=e,fa("matchMedia"))},xh=function(){function n(t,s){this.selector=s&&Da(s),this.data=[],this._r=[],this.isReverted=!1,this.id=p_++,t&&this.add(t)}var e=n.prototype;return e.add=function(s,i,r){De(s)&&(r=i,i=s,s=De);var o=this,a=function(){var l=Ae,u=o.selector,h;return l&&l!==o&&l.data.push(o),r&&(o.selector=Da(r)),Ae=o,h=i.apply(o,arguments),De(h)&&o._r.push(h),Ae=l,o.selector=u,o.isReverted=!1,h};return o.last=a,s===De?a(o,function(c){return o.add(null,c)}):s?o[s]=a:a},e.ignore=function(s){var i=Ae;Ae=null,s(this),Ae=i},e.getTweens=function(){var s=[];return this.data.forEach(function(i){return i instanceof n?s.push.apply(s,i.getTweens()):i instanceof Le&&!(i.parent&&i.parent.data==="nested")&&s.push(i)}),s},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(s,i){var r=this;if(s?function(){for(var a=r.getTweens(),c=r.data.length,l;c--;)l=r.data[c],l.data==="isFlip"&&(l.revert(),l.getChildren(!0,!0,!1).forEach(function(u){return a.splice(a.indexOf(u),1)}));for(a.map(function(u){return{g:u._dur||u._delay||u._sat&&!u._sat.vars.immediateRender?u.globalTime(0):-1/0,t:u}}).sort(function(u,h){return h.g-u.g||-1/0}).forEach(function(u){return u.t.revert(s)}),c=r.data.length;c--;)l=r.data[c],l instanceof tt?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Le)&&l.revert&&l.revert(s);r._r.forEach(function(u){return u(s,r)}),r.isReverted=!0}():this.data.forEach(function(a){return a.kill&&a.kill()}),this.clear(),i)for(var o=dn.length;o--;)dn[o].id===this.id&&dn.splice(o,1)},e.revert=function(s){this.kill(s||{})},n}(),m_=function(){function n(t){this.contexts=[],this.scope=t}var e=n.prototype;return e.add=function(s,i,r){Qt(s)||(s={matches:s});var o=new xh(0,r||this.scope),a=o.conditions={},c,l,u;Ae&&!o.selector&&(o.selector=Ae.selector),this.contexts.push(o),i=o.add("onMatch",i),o.queries=s;for(l in s)l==="all"?u=1:(c=Et.matchMedia(s[l]),c&&(dn.indexOf(o)<0&&dn.push(o),(a[l]=c.matches)&&(u=1),c.addListener?c.addListener(Ia):c.addEventListener("change",Ia)));return u&&i(o,function(h){return o.add(null,h)}),this},e.revert=function(s){this.kill(s||{})},e.kill=function(s){this.contexts.forEach(function(i){return i.kill(s,!0)})},n}(),eo={registerPlugin:function(){for(var e=arguments.length,t=new Array(e),s=0;s1){var i=e.map(function(u){return ft.quickSetter(u,t,s)}),r=i.length;return function(u){for(var h=r;h--;)i[h](u)}}e=e[0]||{};var o=_t[t],a=ln(e),c=a.harness&&(a.harness.aliases||{})[t]||t,l=o?function(u){var h=new o;zn._pt=0,h.init(e,s?u+s:u,zn,0,[e]),h.render(1,h),zn._pt&&_c(1,zn)}:a.set(e,c);return o?l:function(u){return l(e,c,s?u+s:u,a,1)}},quickTo:function(e,t,s){var i,r=ft.to(e,mn((i={},i[t]="+=0.1",i.paused=!0,i),s||{})),o=function(c,l,u){return r.resetTo(t,c,l,u)};return o.tween=r,o},isTweening:function(e){return Ce.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=hn(e.ease,$n.ease)),kl($n,e||{})},config:function(e){return kl(yt,e||{})},registerEffect:function(e){var t=e.name,s=e.effect,i=e.plugins,r=e.defaults,o=e.extendTimeline;(i||"").split(",").forEach(function(a){return a&&!_t[a]&&!kt[a]&&Bi(t+" effect requires "+a+" plugin.")}),la[t]=function(a,c,l){return s(At(a),Rt(c||{},r),l)},o&&(tt.prototype[t]=function(a,c,l){return this.add(la[t](a,Qt(c)?c:(l=c)&&{},this),l)})},registerEase:function(e,t){se[e]=hn(t)},parseEase:function(e,t){return arguments.length?hn(e,t):se},getById:function(e){return Ce.getById(e)},exportRoot:function(e,t){e===void 0&&(e={});var s=new tt(e),i,r;for(s.smoothChildTiming=ct(e.smoothChildTiming),Ce.remove(s),s._dp=0,s._time=s._tTime=Ce._time,i=Ce._first;i;)r=i._next,(t||!(!i._dur&&i instanceof Le&&i.vars.onComplete===i._targets[0]))&&Zt(s,i,i._start-i._delay),i=r;return Zt(Ce,s,0),s},context:function(e,t){return e?new xh(e,t):Ae},matchMedia:function(e){return new m_(e)},matchMediaRefresh:function(){return dn.forEach(function(e){var t=e.conditions,s,i;for(i in t)t[i]&&(t[i]=!1,s=1);s&&e.revert()})||Ia()},addEventListener:function(e,t){var s=Wr[e]||(Wr[e]=[]);~s.indexOf(t)||s.push(t)},removeEventListener:function(e,t){var s=Wr[e],i=s&&s.indexOf(t);i>=0&&s.splice(i,1)},utils:{wrap:Ym,wrapYoyo:Zm,distribute:Ju,random:th,snap:eh,normalize:Gm,getUnit:Xe,clamp:jm,splitColor:oh,toArray:At,selector:Da,mapRange:nh,pipe:qm,unitize:Wm,interpolate:Xm,shuffle:Ku},install:Bu,effects:la,ticker:gt,updateRoot:tt.updateRoot,plugins:_t,globalTimeline:Ce,core:{PropTween:ut,globals:Vu,Tween:Le,Timeline:tt,Animation:qi,getCache:ln,_removeLinkedListItem:Ro,reverting:function(){return $e},context:function(e){return e&&Ae&&(Ae.data.push(e),e._ctx=Ae),Ae},suppressOverwrites:function(e){return ic=e}}};lt("to,from,fromTo,delayedCall,set,killTweensOf",function(n){return eo[n]=Le[n]});gt.add(tt.updateRoot);zn=eo.to({},{duration:0});var __=function(e,t){for(var s=e._pt;s&&s.p!==t&&s.op!==t&&s.fp!==t;)s=s._next;return s},g_=function(e,t){var s=e._targets,i,r,o;for(i in t)for(r=s.length;r--;)o=e._ptLookup[r][i],o&&(o=o.d)&&(o._pt&&(o=__(o,i)),o&&o.modifier&&o.modifier(t[i],e,s[r],i))},pa=function(e,t){return{name:e,rawVars:1,init:function(i,r,o){o._onInit=function(a){var c,l;if(Ge(r)&&(c={},lt(r,function(u){return c[u]=1}),r=c),t){c={};for(l in r)c[l]=t(r[l]);r=c}g_(a,r)}}}},ft=eo.registerPlugin({name:"attr",init:function(e,t,s,i,r){var o,a,c;this.tween=s;for(o in t)c=e.getAttribute(o)||"",a=this.add(e,"setAttribute",(c||0)+"",t[o],i,r,0,0,o),a.op=o,a.b=c,this._props.push(o)},render:function(e,t){for(var s=t._pt;s;)$e?s.set(s.t,s.p,s.b,s):s.r(e,s.d),s=s._next}},{name:"endArray",init:function(e,t){for(var s=t.length;s--;)this.add(e,s,e[s]||0,t[s],0,0,0,0,0,1)}},pa("roundProps",Ra),pa("modifiers"),pa("snap",eh))||eo;Le.version=tt.version=ft.version="3.12.4";zu=1;oc()&&Jn();se.Power0;se.Power1;se.Power2;se.Power3;se.Power4;se.Linear;se.Quad;se.Cubic;se.Quart;se.Quint;se.Strong;se.Elastic;se.Back;se.SteppedEase;se.Bounce;se.Sine;se.Expo;se.Circ;/*! * CSSPlugin 3.12.4 * https://gsap.com * @@ -302,9 +302,9 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu * Subject to the terms at https://gsap.com/standard-license or for * Club GSAP members, the agreement issued with that membership. * @author: Jack Doyle, jack@greensock.com -*/var Ol,Ps,qn,gc,on,Al,vc,g_=function(){return typeof window<"u"},vs={},nn=180/Math.PI,Wn=Math.PI/180,In=Math.atan2,Ml=1e8,yc=/([A-Z])/g,v_=/(left|right|width|margin|padding|x)/i,y_=/[\s,\(]\S/,Xt={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Na=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},x_=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},T_=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},k_=function(e,t){var s=t.s+t.c*e;t.set(t.t,t.p,~~(s+(s<0?-.5:.5))+t.u,t)},Th=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},kh=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},w_=function(e,t,s){return e.style[t]=s},S_=function(e,t,s){return e.style.setProperty(t,s)},C_=function(e,t,s){return e._gsap[t]=s},b_=function(e,t,s){return e._gsap.scaleX=e._gsap.scaleY=s},E_=function(e,t,s,i,r){var o=e._gsap;o.scaleX=o.scaleY=s,o.renderTransform(r,o)},O_=function(e,t,s,i,r){var o=e._gsap;o[t]=s,o.renderTransform(r,o)},be="transform",ht=be+"Origin",A_=function n(e,t){var s=this,i=this.target,r=i.style,o=i._gsap;if(e in vs&&r){if(this.tfm=this.tfm||{},e!=="transform")e=Xt[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return s.tfm[a]=hs(i,a)}):this.tfm[e]=o.x?o[e]:hs(i,e),e===ht&&(this.tfm.zOrigin=o.zOrigin);else return Xt.transform.split(",").forEach(function(a){return n.call(s,a,t)});if(this.props.indexOf(be)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(ht,t,"")),e=be}(r||t)&&this.props.push(e,t,r[e])},wh=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},M_=function(){var e=this.props,t=this.target,s=t.style,i=t._gsap,r,o;for(r=0;r=0?Dl[o]:"")+e},Ua=function(){g_()&&window.document&&(Ol=window,Ps=Ol.document,qn=Ps.documentElement,on=Fa("div")||{style:{}},Fa("div"),be=ei(be),ht=be+"Origin",on.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ch=!!ei("perspective"),vc=ft.core.reverting,gc=1)},ma=function n(e){var t=Fa("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=this.parentNode,i=this.nextSibling,r=this.style.cssText,o;if(qn.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=n}catch{}else this._gsapBBox&&(o=this._gsapBBox());return s&&(i?s.insertBefore(this,i):s.appendChild(this)),qn.removeChild(t),this.style.cssText=r,o},Rl=function(e,t){for(var s=t.length;s--;)if(e.hasAttribute(t[s]))return e.getAttribute(t[s])},bh=function(e){var t;try{t=e.getBBox()}catch{t=ma.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===ma||(t=ma.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+Rl(e,["x","cx","x1"])||0,y:+Rl(e,["y","cy","y1"])||0,width:0,height:0}:t},Eh=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&bh(e))},_n=function(e,t){if(t){var s=e.style,i;t in vs&&t!==ht&&(t=be),s.removeProperty?(i=t.substr(0,2),(i==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),s.removeProperty(i==="--"?t:t.replace(yc,"-$1").toLowerCase())):s.removeAttribute(t)}},Is=function(e,t,s,i,r,o){var a=new ut(e._pt,t,s,0,1,o?kh:Th);return e._pt=a,a.b=i,a.e=r,e._props.push(s),a},Pl={deg:1,rad:1,turn:1},D_={grid:1,flex:1},Vs=function n(e,t,s,i){var r=parseFloat(s)||0,o=(s+"").trim().substr((r+"").length)||"px",a=on.style,c=v_.test(t),l=e.tagName.toLowerCase()==="svg",u=(l?"client":"offset")+(c?"Width":"Height"),h=100,d=i==="px",f=i==="%",m,p,g,y;if(i===o||!r||Pl[i]||Pl[o])return r;if(o!=="px"&&!d&&(r=n(e,t,s,"px")),y=e.getCTM&&Eh(e),(f||o==="%")&&(vs[t]||~t.indexOf("adius")))return m=y?e.getBBox()[c?"width":"height"]:e[u],Pe(f?r/m*h:r/100*m);if(a[c?"width":"height"]=h+(d?o:i),p=~t.indexOf("adius")||i==="em"&&e.appendChild&&!l?e:e.parentNode,y&&(p=(e.ownerSVGElement||{}).parentNode),(!p||p===Ps||!p.appendChild)&&(p=Ps.body),g=p._gsap,g&&f&&g.width&&c&&g.time===gt.time&&!g.uncache)return Pe(r/g.width*h);if(f&&(t==="height"||t==="width")){var w=e.style[t];e.style[t]=h+i,m=e[u],w?e.style[t]=w:_n(e,t)}else(f||o==="%")&&!D_[$t(p,"display")]&&(a.position=$t(e,"position")),p===e&&(a.position="static"),p.appendChild(on),m=on[u],p.removeChild(on),a.position="absolute";return c&&f&&(g=ln(p),g.time=gt.time,g.width=p[u]),Pe(d?m*r/h:m&&r?h/m*r:0)},hs=function(e,t,s,i){var r;return gc||Ua(),t in Xt&&t!=="transform"&&(t=Xt[t],~t.indexOf(",")&&(t=t.split(",")[0])),vs[t]&&t!=="transform"?(r=Gi(e,i),r=t!=="transformOrigin"?r[t]:r.svg?r.origin:so($t(e,ht))+" "+r.zOrigin+"px"):(r=e.style[t],(!r||r==="auto"||i||~(r+"").indexOf("calc("))&&(r=to[t]&&to[t](e,t,s)||$t(e,t)||Hu(e,t)||(t==="opacity"?1:0))),s&&!~(r+"").trim().indexOf(" ")?Vs(e,t,r,s)+s:r},R_=function(e,t,s,i){if(!s||s==="none"){var r=ei(t,e,1),o=r&&$t(e,r,1);o&&o!==s?(t=r,s=o):t==="borderColor"&&(s=$t(e,"borderTopColor"))}var a=new ut(this._pt,e.style,t,0,1,vh),c=0,l=0,u,h,d,f,m,p,g,y,w,S,v,_;if(a.b=s,a.e=i,s+="",i+="",i==="auto"&&(p=e.style[t],e.style[t]=i,i=$t(e,t)||i,p?e.style[t]=p:_n(e,t)),u=[s,i],ch(u),s=u[0],i=u[1],d=s.match(Ln)||[],_=i.match(Ln)||[],_.length){for(;h=Ln.exec(i);)g=h[0],w=i.substring(c,h.index),m?m=(m+1)%5:(w.substr(-5)==="rgba("||w.substr(-5)==="hsla(")&&(m=1),g!==(p=d[l++]||"")&&(f=parseFloat(p)||0,v=p.substr((f+"").length),g.charAt(1)==="="&&(g=Hn(f,g)+v),y=parseFloat(g),S=g.substr((y+"").length),c=Ln.lastIndex-S.length,S||(S=S||yt.units[t]||v,c===i.length&&(i+=S,a.e+=S)),v!==S&&(f=Vs(e,t,p,S)||0),a._pt={_next:a._pt,p:w||l===1?w:",",s:f,c:y-f,m:m&&m<4||t==="zIndex"?Math.round:0});a.c=c-1;)a=r[l],vs[a]&&(c=1,a=a==="transformOrigin"?ht:be),_n(s,a);c&&(_n(s,be),o&&(o.svg&&s.removeAttribute("transform"),Gi(s,1),o.uncache=1,wh(i)))}},to={clearProps:function(e,t,s,i,r){if(r.data!=="isFromStart"){var o=e._pt=new ut(e._pt,t,s,0,0,I_);return o.u=i,o.pr=-10,o.tween=r,e._props.push(s),1}}},Wi=[1,0,0,1,0,0],Oh={},Ah=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Nl=function(e){var t=$t(e,be);return Ah(t)?Wi:t.substr(7).match(Fu).map(Pe)},xc=function(e,t){var s=e._gsap||ln(e),i=e.style,r=Nl(e),o,a,c,l;return s.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,r=[c.a,c.b,c.c,c.d,c.e,c.f],r.join(",")==="1,0,0,1,0,0"?Wi:r):(r===Wi&&!e.offsetParent&&e!==qn&&!s.svg&&(c=i.display,i.display="block",o=e.parentNode,(!o||!e.offsetParent)&&(l=1,a=e.nextElementSibling,qn.appendChild(e)),r=Nl(e),c?i.display=c:_n(e,"display"),l&&(a?o.insertBefore(e,a):o?o.appendChild(e):qn.removeChild(e))),t&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r)},La=function(e,t,s,i,r,o){var a=e._gsap,c=r||xc(e,!0),l=a.xOrigin||0,u=a.yOrigin||0,h=a.xOffset||0,d=a.yOffset||0,f=c[0],m=c[1],p=c[2],g=c[3],y=c[4],w=c[5],S=t.split(" "),v=parseFloat(S[0])||0,_=parseFloat(S[1])||0,T,x,k,C;s?c!==Wi&&(x=f*g-m*p)&&(k=v*(g/x)+_*(-p/x)+(p*w-g*y)/x,C=v*(-m/x)+_*(f/x)-(f*w-m*y)/x,v=k,_=C):(T=bh(e),v=T.x+(~S[0].indexOf("%")?v/100*T.width:v),_=T.y+(~(S[1]||S[0]).indexOf("%")?_/100*T.height:_)),i||i!==!1&&a.smooth?(y=v-l,w=_-u,a.xOffset=h+(y*f+w*p)-y,a.yOffset=d+(y*m+w*g)-w):a.xOffset=a.yOffset=0,a.xOrigin=v,a.yOrigin=_,a.smooth=!!i,a.origin=t,a.originIsAbsolute=!!s,e.style[ht]="0px 0px",o&&(Is(o,a,"xOrigin",l,v),Is(o,a,"yOrigin",u,_),Is(o,a,"xOffset",h,a.xOffset),Is(o,a,"yOffset",d,a.yOffset)),e.setAttribute("data-svg-origin",v+" "+_)},Gi=function(e,t){var s=e._gsap||new dh(e);if("x"in s&&!t&&!s.uncache)return s;var i=e.style,r=s.scaleX<0,o="px",a="deg",c=getComputedStyle(e),l=$t(e,ht)||"0",u,h,d,f,m,p,g,y,w,S,v,_,T,x,k,C,E,O,A,R,P,F,N,U,V,B,q,j,z,Te,ae,X;return u=h=d=p=g=y=w=S=v=0,f=m=1,s.svg=!!(e.getCTM&&Eh(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(i[be]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[be]!=="none"?c[be]:"")),i.scale=i.rotate=i.translate="none"),x=xc(e,s.svg),s.svg&&(s.uncache?(V=e.getBBox(),l=s.xOrigin-V.x+"px "+(s.yOrigin-V.y)+"px",U=""):U=!t&&e.getAttribute("data-svg-origin"),La(e,U||l,!!U||s.originIsAbsolute,s.smooth!==!1,x)),_=s.xOrigin||0,T=s.yOrigin||0,x!==Wi&&(O=x[0],A=x[1],R=x[2],P=x[3],u=F=x[4],h=N=x[5],x.length===6?(f=Math.sqrt(O*O+A*A),m=Math.sqrt(P*P+R*R),p=O||A?In(A,O)*nn:0,w=R||P?In(R,P)*nn+p:0,w&&(m*=Math.abs(Math.cos(w*Wn))),s.svg&&(u-=_-(_*O+T*R),h-=T-(_*A+T*P))):(X=x[6],Te=x[7],q=x[8],j=x[9],z=x[10],ae=x[11],u=x[12],h=x[13],d=x[14],k=In(X,z),g=k*nn,k&&(C=Math.cos(-k),E=Math.sin(-k),U=F*C+q*E,V=N*C+j*E,B=X*C+z*E,q=F*-E+q*C,j=N*-E+j*C,z=X*-E+z*C,ae=Te*-E+ae*C,F=U,N=V,X=B),k=In(-R,z),y=k*nn,k&&(C=Math.cos(-k),E=Math.sin(-k),U=O*C-q*E,V=A*C-j*E,B=R*C-z*E,ae=P*E+ae*C,O=U,A=V,R=B),k=In(A,O),p=k*nn,k&&(C=Math.cos(k),E=Math.sin(k),U=O*C+A*E,V=F*C+N*E,A=A*C-O*E,N=N*C-F*E,O=U,F=V),g&&Math.abs(g)+Math.abs(p)>359.9&&(g=p=0,y=180-y),f=Pe(Math.sqrt(O*O+A*A+R*R)),m=Pe(Math.sqrt(N*N+X*X)),k=In(F,N),w=Math.abs(k)>2e-4?k*nn:0,v=ae?1/(ae<0?-ae:ae):0),s.svg&&(U=e.getAttribute("transform"),s.forceCSS=e.setAttribute("transform","")||!Ah($t(e,be)),U&&e.setAttribute("transform",U))),Math.abs(w)>90&&Math.abs(w)<270&&(r?(f*=-1,w+=p<=0?180:-180,p+=p<=0?180:-180):(m*=-1,w+=w<=0?180:-180)),t=t||s.uncache,s.x=u-((s.xPercent=u&&(!t&&s.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-u)?-50:0)))?e.offsetWidth*s.xPercent/100:0)+o,s.y=h-((s.yPercent=h&&(!t&&s.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*s.yPercent/100:0)+o,s.z=d+o,s.scaleX=Pe(f),s.scaleY=Pe(m),s.rotation=Pe(p)+a,s.rotationX=Pe(g)+a,s.rotationY=Pe(y)+a,s.skewX=w+a,s.skewY=S+a,s.transformPerspective=v+o,(s.zOrigin=parseFloat(l.split(" ")[2])||!t&&s.zOrigin||0)&&(i[ht]=so(l)),s.xOffset=s.yOffset=0,s.force3D=yt.force3D,s.renderTransform=s.svg?F_:Ch?Mh:N_,s.uncache=0,s},so=function(e){return(e=e.split(" "))[0]+" "+e[1]},_a=function(e,t,s){var i=Xe(t);return Pe(parseFloat(t)+parseFloat(Vs(e,"x",s+"px",i)))+i},N_=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Mh(e,t)},tn="0deg",Oi="0px",sn=") ",Mh=function(e,t){var s=t||this,i=s.xPercent,r=s.yPercent,o=s.x,a=s.y,c=s.z,l=s.rotation,u=s.rotationY,h=s.rotationX,d=s.skewX,f=s.skewY,m=s.scaleX,p=s.scaleY,g=s.transformPerspective,y=s.force3D,w=s.target,S=s.zOrigin,v="",_=y==="auto"&&e&&e!==1||y===!0;if(S&&(h!==tn||u!==tn)){var T=parseFloat(u)*Wn,x=Math.sin(T),k=Math.cos(T),C;T=parseFloat(h)*Wn,C=Math.cos(T),o=_a(w,o,x*C*-S),a=_a(w,a,-Math.sin(T)*-S),c=_a(w,c,k*C*-S+S)}g!==Oi&&(v+="perspective("+g+sn),(i||r)&&(v+="translate("+i+"%, "+r+"%) "),(_||o!==Oi||a!==Oi||c!==Oi)&&(v+=c!==Oi||_?"translate3d("+o+", "+a+", "+c+") ":"translate("+o+", "+a+sn),l!==tn&&(v+="rotate("+l+sn),u!==tn&&(v+="rotateY("+u+sn),h!==tn&&(v+="rotateX("+h+sn),(d!==tn||f!==tn)&&(v+="skew("+d+", "+f+sn),(m!==1||p!==1)&&(v+="scale("+m+", "+p+sn),w.style[be]=v||"translate(0, 0)"},F_=function(e,t){var s=t||this,i=s.xPercent,r=s.yPercent,o=s.x,a=s.y,c=s.rotation,l=s.skewX,u=s.skewY,h=s.scaleX,d=s.scaleY,f=s.target,m=s.xOrigin,p=s.yOrigin,g=s.xOffset,y=s.yOffset,w=s.forceCSS,S=parseFloat(o),v=parseFloat(a),_,T,x,k,C;c=parseFloat(c),l=parseFloat(l),u=parseFloat(u),u&&(u=parseFloat(u),l+=u,c+=u),c||l?(c*=Wn,l*=Wn,_=Math.cos(c)*h,T=Math.sin(c)*h,x=Math.sin(c-l)*-d,k=Math.cos(c-l)*d,l&&(u*=Wn,C=Math.tan(l-u),C=Math.sqrt(1+C*C),x*=C,k*=C,u&&(C=Math.tan(u),C=Math.sqrt(1+C*C),_*=C,T*=C)),_=Pe(_),T=Pe(T),x=Pe(x),k=Pe(k)):(_=h,k=d,T=x=0),(S&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(S=Vs(f,"x",o,"px"),v=Vs(f,"y",a,"px")),(m||p||g||y)&&(S=Pe(S+m-(m*_+p*x)+g),v=Pe(v+p-(m*T+p*k)+y)),(i||r)&&(C=f.getBBox(),S=Pe(S+i/100*C.width),v=Pe(v+r/100*C.height)),C="matrix("+_+","+T+","+x+","+k+","+S+","+v+")",f.setAttribute("transform",C),w&&(f.style[be]=C)},U_=function(e,t,s,i,r){var o=360,a=Ge(r),c=parseFloat(r)*(a&&~r.indexOf("rad")?nn:1),l=c-i,u=i+l+"deg",h,d;return a&&(h=r.split("_")[1],h==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),h==="cw"&&l<0?l=(l+o*Ml)%o-~~(l/o)*o:h==="ccw"&&l>0&&(l=(l-o*Ml)%o-~~(l/o)*o)),e._pt=d=new ut(e._pt,t,s,i,l,x_),d.e=u,d.u="deg",e._props.push(s),d},Fl=function(e,t){for(var s in t)e[s]=t[s];return e},L_=function(e,t,s){var i=Fl({},s._gsap),r="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,c,l,u,h,d,f,m;i.svg?(l=s.getAttribute("transform"),s.setAttribute("transform",""),o[be]=t,a=Gi(s,1),_n(s,be),s.setAttribute("transform",l)):(l=getComputedStyle(s)[be],o[be]=t,a=Gi(s,1),o[be]=l);for(c in vs)l=i[c],u=a[c],l!==u&&r.indexOf(c)<0&&(f=Xe(l),m=Xe(u),h=f!==m?Vs(s,c,l,m):parseFloat(l),d=parseFloat(u),e._pt=new ut(e._pt,a,c,h,d-h,Na),e._pt.u=m||0,e._props.push(c));Fl(a,i)};lt("padding,margin,Width,Radius",function(n,e){var t="Top",s="Right",i="Bottom",r="Left",o=(e<3?[t,s,i,r]:[t+r,t+s,i+s,i+r]).map(function(a){return e<2?n+a:"border"+a+n});to[e>1?"border"+n:n]=function(a,c,l,u,h){var d,f;if(arguments.length<4)return d=o.map(function(m){return hs(a,m,l)}),f=d.join(" "),f.split(d[0]).length===5?d[0]:f;d=(u+"").split(" "),f={},o.forEach(function(m,p){return f[m]=d[p]=d[p]||d[(p-1)/2|0]}),a.init(c,f,h)}});var Dh={name:"css",register:Ua,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,s,i,r){var o=this._props,a=e.style,c=s.vars.startAt,l,u,h,d,f,m,p,g,y,w,S,v,_,T,x,k;gc||Ua(),this.styles=this.styles||Sh(e),k=this.styles.props,this.tween=s;for(p in t)if(p!=="autoRound"&&(u=t[p],!(_t[p]&&fh(p,t,s,i,e,r)))){if(f=typeof u,m=to[p],f==="function"&&(u=u.call(s,i,e,r),f=typeof u),f==="string"&&~u.indexOf("random(")&&(u=ji(u)),m)m(this,e,p,u,s)&&(x=1);else if(p.substr(0,2)==="--")l=(getComputedStyle(e).getPropertyValue(p)+"").trim(),u+="",Ls.lastIndex=0,Ls.test(l)||(g=Xe(l),y=Xe(u)),y?g!==y&&(l=Vs(e,p,l,y)+y):g&&(u+=g),this.add(a,"setProperty",l,u,i,r,0,0,p),o.push(p),k.push(p,0,a[p]);else if(f!=="undefined"){if(c&&p in c?(l=typeof c[p]=="function"?c[p].call(s,i,e,r):c[p],Ge(l)&&~l.indexOf("random(")&&(l=ji(l)),Xe(l+"")||l==="auto"||(l+=yt.units[p]||Xe(hs(e,p))||""),(l+"").charAt(1)==="="&&(l=hs(e,p))):l=hs(e,p),d=parseFloat(l),w=f==="string"&&u.charAt(1)==="="&&u.substr(0,2),w&&(u=u.substr(2)),h=parseFloat(u),p in Xt&&(p==="autoAlpha"&&(d===1&&hs(e,"visibility")==="hidden"&&h&&(d=0),k.push("visibility",0,a.visibility),Is(this,a,"visibility",d?"inherit":"hidden",h?"inherit":"hidden",!h)),p!=="scale"&&p!=="transform"&&(p=Xt[p],~p.indexOf(",")&&(p=p.split(",")[0]))),S=p in vs,S){if(this.styles.save(p),v||(_=e._gsap,_.renderTransform&&!t.parseTransform||Gi(e,t.parseTransform),T=t.smoothOrigin!==!1&&_.smooth,v=this._pt=new ut(this._pt,a,be,0,1,_.renderTransform,_,0,-1),v.dep=1),p==="scale")this._pt=new ut(this._pt,_,"scaleY",_.scaleY,(w?Hn(_.scaleY,w+h):h)-_.scaleY||0,Na),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){k.push(ht,0,a[ht]),u=P_(u),_.svg?La(e,u,0,T,0,this):(y=parseFloat(u.split(" ")[2])||0,y!==_.zOrigin&&Is(this,_,"zOrigin",_.zOrigin,y),Is(this,a,p,so(l),so(u)));continue}else if(p==="svgOrigin"){La(e,u,1,T,0,this);continue}else if(p in Oh){U_(this,_,p,d,w?Hn(d,w+u):u);continue}else if(p==="smoothOrigin"){Is(this,_,"smooth",_.smooth,u);continue}else if(p==="force3D"){_[p]=u;continue}else if(p==="transform"){L_(this,u,e);continue}}else p in a||(p=ei(p)||p);if(S||(h||h===0)&&(d||d===0)&&!y_.test(u)&&p in a)g=(l+"").substr((d+"").length),h||(h=0),y=Xe(u)||(p in yt.units?yt.units[p]:g),g!==y&&(d=Vs(e,p,l,y)),this._pt=new ut(this._pt,S?_:a,p,d,(w?Hn(d,w+h):h)-d,!S&&(y==="px"||p==="zIndex")&&t.autoRound!==!1?k_:Na),this._pt.u=y||0,g!==y&&y!=="%"&&(this._pt.b=l,this._pt.r=T_);else if(p in a)R_.call(this,e,p,l,w?w+u:u);else if(p in e)this.add(e,p,l||e[p],w?w+u:u,i,r);else if(p!=="parseTransform"){cc(p,u);continue}S||(p in a?k.push(p,0,a[p]):k.push(p,1,l||e[p])),o.push(p)}}x&&yh(this)},render:function(e,t){if(t.tween._time||!vc())for(var s=t._pt;s;)s.r(e,s.d),s=s._next;else t.styles.revert()},get:hs,aliases:Xt,getSetter:function(e,t,s){var i=Xt[t];return i&&i.indexOf(",")<0&&(t=i),t in vs&&t!==ht&&(e._gsap.x||hs(e,"x"))?s&&Al===s?t==="scale"?b_:C_:(Al=s||{})&&(t==="scale"?E_:O_):e.style&&!rc(e.style[t])?w_:~t.indexOf("-")?S_:mc(e,t)},core:{_removeProperty:_n,_getMatrix:xc}};ft.utils.checkPrefix=ei;ft.core.getStyleSaver=Sh;(function(n,e,t,s){var i=lt(n+","+e+","+t,function(r){vs[r]=1});lt(e,function(r){yt.units[r]="deg",Oh[r]=1}),Xt[i[13]]=n+","+e,lt(s,function(r){var o=r.split(":");Xt[o[1]]=i[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");lt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){yt.units[n]="px"});ft.registerPlugin(Dh);var Tc=ft.registerPlugin(Dh)||ft;Tc.core.Tween;const z_=(n,e,t,s,i)=>{const r=new qf,o=1e-5;r.absarc(o,o,o,-Math.PI/2,-Math.PI,!0),r.absarc(o,e-s*2,o,Math.PI,Math.PI/2,!0),r.absarc(n-s*2,e-s*2,o,Math.PI/2,0,!0),r.absarc(n-s*2,o,o,0,-Math.PI/2,!0);const a=new Wf(r,{depth:t-s*2,bevelEnabled:!0,bevelSegments:i,steps:2,bevelSize:s,bevelThickness:s,curveSegments:i});a.center();const c=[],l=a.getAttribute("normal"),u=a.getAttribute("position");for(let h=0;h.9?(m=f.x/n+.5,p=1-(f.z/t+.5)):Math.abs(d.x)>.9?(m=-f.z/t+.5,p=1-(-f.y/e+.5)):Math.abs(d.z)>.9&&(m=f.x/n+.5,p=1-(-f.y/e+.5)),c.push(m,p)}return a.setAttribute("uv",new Gf(c,2)),a};z_(10,10,10,2,10);const Ul=new Hf(10,10,10),B_=500,V_=800,j_=new K(0,0,0),H_=16777215,q_=20,W_=(n,e)=>{var r,o;if(!(n!=null&&n.ref_id)||!(e!=null&&e.ref_id))return!1;let t=!1;const s=n.guests,i=e.guests;return((r=n.children)!=null&&r.includes(e.ref_id)||(o=e.children)!=null&&o.includes(n.ref_id))&&(t=!0),(s!=null&&s.find(a=>a.ref_id===e.ref_id)||i!=null&&i.find(a=>a.ref_id===n.ref_id))&&(t=!0),t};let Ai=null;const G_=500,kc=(n,e)=>{if(Ai)return null;Ai=setTimeout(()=>{Ai&&(clearTimeout(Ai),Ai=null)},G_);const t=[];return n.forEach(i=>{const r=e.position.distanceTo(j_.set(i.x,i.y,i.z));ri.distance-r.distance).slice(0,B_).map(i=>i.id)},ps=new K(5e3,600,1600),Ll=100,Y_=600,Z_=2e3,ga={x:172.7392402058252,y:-239.04675366094037,z:-2e3},Rh="14.8.49",zl=(n,e,t)=>({endTime:e,insertTime:t,type:"exponentialRampToValue",value:n}),Bl=(n,e,t)=>({endTime:e,insertTime:t,type:"linearRampToValue",value:n}),za=(n,e)=>({startTime:e,type:"setValue",value:n}),Ph=(n,e,t)=>({duration:t,startTime:e,type:"setValueCurve",values:n}),Ih=(n,e,{startTime:t,target:s,timeConstant:i})=>s+(e-s)*Math.exp((t-n)/i),Bn=n=>n.type==="exponentialRampToValue",no=n=>n.type==="linearRampToValue",Ds=n=>Bn(n)||no(n),wc=n=>n.type==="setValue",us=n=>n.type==="setValueCurve",io=(n,e,t,s)=>{const i=n[e];return i===void 0?s:Ds(i)||wc(i)?i.value:us(i)?i.values[i.values.length-1]:Ih(t,io(n,e-1,i.startTime,s),i)},Vl=(n,e,t,s,i)=>t===void 0?[s.insertTime,i]:Ds(t)?[t.endTime,t.value]:wc(t)?[t.startTime,t.value]:us(t)?[t.startTime+t.duration,t.values[t.values.length-1]]:[t.startTime,io(n,e-1,t.startTime,i)],Ba=n=>n.type==="cancelAndHold",Va=n=>n.type==="cancelScheduledValues",As=n=>Ba(n)||Va(n)?n.cancelTime:Bn(n)||no(n)?n.endTime:n.startTime,jl=(n,e,t,{endTime:s,value:i})=>t===i?i:0t+(n-e)/(s-e)*(i-t),X_=(n,e)=>{const t=Math.floor(e),s=Math.ceil(e);return t===s?n[t]:(1-(e-t))*n[t]+(1-(s-e))*n[s]},$_=(n,{duration:e,startTime:t,values:s})=>{const i=(n-t)/e*(s.length-1);return X_(s,i)},Ur=n=>n.type==="setTarget";class Q_{constructor(e){this._automationEvents=[],this._currenTime=0,this._defaultValue=e}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(e){const t=As(e);if(Ba(e)||Va(e)){const s=this._automationEvents.findIndex(r=>Va(e)&&us(r)?r.startTime+r.duration>=t:As(r)>=t),i=this._automationEvents[s];if(s!==-1&&(this._automationEvents=this._automationEvents.slice(0,s)),Ba(e)){const r=this._automationEvents[this._automationEvents.length-1];if(i!==void 0&&Ds(i)){if(r!==void 0&&Ur(r))throw new Error("The internal list is malformed.");const o=r===void 0?i.insertTime:us(r)?r.startTime+r.duration:As(r),a=r===void 0?this._defaultValue:us(r)?r.values[r.values.length-1]:r.value,c=Bn(i)?jl(t,o,a,i):Hl(t,o,a,i),l=Bn(i)?zl(c,t,this._currenTime):Bl(c,t,this._currenTime);this._automationEvents.push(l)}if(r!==void 0&&Ur(r)&&this._automationEvents.push(za(this.getValue(t),t)),r!==void 0&&us(r)&&r.startTime+r.duration>t){const o=t-r.startTime,a=(r.values.length-1)/r.duration,c=Math.max(2,1+Math.ceil(o*a)),l=o/(c-1)*a,u=r.values.slice(0,c);if(l<1)for(let h=1;hAs(o)>t),i=s===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[s-1];if(i!==void 0&&us(i)&&As(i)+i.duration>t)return!1;const r=Bn(e)?zl(e.value,e.endTime,this._currenTime):no(e)?Bl(e.value,t,this._currenTime):e;if(s===-1)this._automationEvents.push(r);else{if(us(e)&&t+e.duration>As(this._automationEvents[s]))return!1;this._automationEvents.splice(s,0,r)}}return!0}flush(e){const t=this._automationEvents.findIndex(s=>As(s)>e);if(t>1){const s=this._automationEvents.slice(t-1),i=s[0];Ur(i)&&s.unshift(za(io(this._automationEvents,t-2,i.startTime,this._defaultValue),i.startTime)),this._automationEvents=s}}getValue(e){if(this._automationEvents.length===0)return this._defaultValue;const t=this._automationEvents.findIndex(o=>As(o)>e),s=this._automationEvents[t],i=(t===-1?this._automationEvents.length:t)-1,r=this._automationEvents[i];if(r!==void 0&&Ur(r)&&(s===void 0||!Ds(s)||s.insertTime>e))return Ih(e,io(this._automationEvents,i-1,r.startTime,this._defaultValue),r);if(r!==void 0&&wc(r)&&(s===void 0||!Ds(s)))return r.value;if(r!==void 0&&us(r)&&(s===void 0||!Ds(s)||r.startTime+r.duration>e))return e({cancelTime:n,type:"cancelAndHold"}),J_=n=>({cancelTime:n,type:"cancelScheduledValues"}),eg=(n,e)=>({endTime:e,type:"exponentialRampToValue",value:n}),tg=(n,e)=>({endTime:e,type:"linearRampToValue",value:n}),sg=(n,e,t)=>({startTime:e,target:n,timeConstant:t,type:"setTarget"}),ng=()=>new DOMException("","AbortError"),ig=n=>(e,t,[s,i,r],o)=>{n(e[i],[t,s,r],a=>a[0]===t&&a[1]===s,o)},rg=n=>(e,t,s)=>{const i=[];for(let r=0;r(e,t)=>{n.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})},ti=new WeakSet,Nh=new WeakMap,Sc=new WeakMap,Fh=new WeakMap,Cc=new WeakMap,No=new WeakMap,Uh=new WeakMap,ja=new WeakMap,Ha=new WeakMap,qa=new WeakMap,Lh={construct(){return Lh}},ag=n=>{try{const e=new Proxy(n,Lh);new e}catch{return!1}return!0},ql=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,Wl=(n,e)=>{const t=[];let s=n.replace(/^[\s]+/,""),i=s.match(ql);for(;i!==null;){const r=i[1].slice(1,-1),o=i[0].replace(/([\s]+)?;?$/,"").replace(r,new URL(r,e).toString());t.push(o),s=s.slice(i[0].length).replace(/^[\s]+/,""),i=s.match(ql)}return[t.join(";"),s]},Gl=n=>{if(n!==void 0&&!Array.isArray(n))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},Yl=n=>{if(!ag(n))throw new TypeError("The given value for processorCtor should be a constructor.");if(n.prototype===null||typeof n.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},cg=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>{let f=0;return(m,p,g={credentials:"omit"})=>{const y=u.get(m);if(y!==void 0&&y.has(p))return Promise.resolve();const w=l.get(m);if(w!==void 0){const _=w.get(p);if(_!==void 0)return _}const S=r(m),v=S.audioWorklet===void 0?i(p).then(([_,T])=>{const[x,k]=Wl(_,T),C=`${x};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${k} +*/var Ol,Ps,qn,gc,on,Al,vc,v_=function(){return typeof window<"u"},vs={},nn=180/Math.PI,Wn=Math.PI/180,In=Math.atan2,Ml=1e8,yc=/([A-Z])/g,y_=/(left|right|width|margin|padding|x)/i,x_=/[\s,\(]\S/,Xt={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Na=function(e,t){return t.set(t.t,t.p,Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},T_=function(e,t){return t.set(t.t,t.p,e===1?t.e:Math.round((t.s+t.c*e)*1e4)/1e4+t.u,t)},k_=function(e,t){return t.set(t.t,t.p,e?Math.round((t.s+t.c*e)*1e4)/1e4+t.u:t.b,t)},w_=function(e,t){var s=t.s+t.c*e;t.set(t.t,t.p,~~(s+(s<0?-.5:.5))+t.u,t)},Th=function(e,t){return t.set(t.t,t.p,e?t.e:t.b,t)},kh=function(e,t){return t.set(t.t,t.p,e!==1?t.b:t.e,t)},S_=function(e,t,s){return e.style[t]=s},C_=function(e,t,s){return e.style.setProperty(t,s)},b_=function(e,t,s){return e._gsap[t]=s},E_=function(e,t,s){return e._gsap.scaleX=e._gsap.scaleY=s},O_=function(e,t,s,i,r){var o=e._gsap;o.scaleX=o.scaleY=s,o.renderTransform(r,o)},A_=function(e,t,s,i,r){var o=e._gsap;o[t]=s,o.renderTransform(r,o)},be="transform",ht=be+"Origin",M_=function n(e,t){var s=this,i=this.target,r=i.style,o=i._gsap;if(e in vs&&r){if(this.tfm=this.tfm||{},e!=="transform")e=Xt[e]||e,~e.indexOf(",")?e.split(",").forEach(function(a){return s.tfm[a]=hs(i,a)}):this.tfm[e]=o.x?o[e]:hs(i,e),e===ht&&(this.tfm.zOrigin=o.zOrigin);else return Xt.transform.split(",").forEach(function(a){return n.call(s,a,t)});if(this.props.indexOf(be)>=0)return;o.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(ht,t,"")),e=be}(r||t)&&this.props.push(e,t,r[e])},wh=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},D_=function(){var e=this.props,t=this.target,s=t.style,i=t._gsap,r,o;for(r=0;r=0?Dl[o]:"")+e},Ua=function(){v_()&&window.document&&(Ol=window,Ps=Ol.document,qn=Ps.documentElement,on=Fa("div")||{style:{}},Fa("div"),be=ei(be),ht=be+"Origin",on.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Ch=!!ei("perspective"),vc=ft.core.reverting,gc=1)},ma=function n(e){var t=Fa("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=this.parentNode,i=this.nextSibling,r=this.style.cssText,o;if(qn.appendChild(t),t.appendChild(this),this.style.display="block",e)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=n}catch{}else this._gsapBBox&&(o=this._gsapBBox());return s&&(i?s.insertBefore(this,i):s.appendChild(this)),qn.removeChild(t),this.style.cssText=r,o},Rl=function(e,t){for(var s=t.length;s--;)if(e.hasAttribute(t[s]))return e.getAttribute(t[s])},bh=function(e){var t;try{t=e.getBBox()}catch{t=ma.call(e,!0)}return t&&(t.width||t.height)||e.getBBox===ma||(t=ma.call(e,!0)),t&&!t.width&&!t.x&&!t.y?{x:+Rl(e,["x","cx","x1"])||0,y:+Rl(e,["y","cy","y1"])||0,width:0,height:0}:t},Eh=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&bh(e))},_n=function(e,t){if(t){var s=e.style,i;t in vs&&t!==ht&&(t=be),s.removeProperty?(i=t.substr(0,2),(i==="ms"||t.substr(0,6)==="webkit")&&(t="-"+t),s.removeProperty(i==="--"?t:t.replace(yc,"-$1").toLowerCase())):s.removeAttribute(t)}},Is=function(e,t,s,i,r,o){var a=new ut(e._pt,t,s,0,1,o?kh:Th);return e._pt=a,a.b=i,a.e=r,e._props.push(s),a},Pl={deg:1,rad:1,turn:1},R_={grid:1,flex:1},Vs=function n(e,t,s,i){var r=parseFloat(s)||0,o=(s+"").trim().substr((r+"").length)||"px",a=on.style,c=y_.test(t),l=e.tagName.toLowerCase()==="svg",u=(l?"client":"offset")+(c?"Width":"Height"),h=100,d=i==="px",f=i==="%",m,p,g,y;if(i===o||!r||Pl[i]||Pl[o])return r;if(o!=="px"&&!d&&(r=n(e,t,s,"px")),y=e.getCTM&&Eh(e),(f||o==="%")&&(vs[t]||~t.indexOf("adius")))return m=y?e.getBBox()[c?"width":"height"]:e[u],Pe(f?r/m*h:r/100*m);if(a[c?"width":"height"]=h+(d?o:i),p=~t.indexOf("adius")||i==="em"&&e.appendChild&&!l?e:e.parentNode,y&&(p=(e.ownerSVGElement||{}).parentNode),(!p||p===Ps||!p.appendChild)&&(p=Ps.body),g=p._gsap,g&&f&&g.width&&c&&g.time===gt.time&&!g.uncache)return Pe(r/g.width*h);if(f&&(t==="height"||t==="width")){var w=e.style[t];e.style[t]=h+i,m=e[u],w?e.style[t]=w:_n(e,t)}else(f||o==="%")&&!R_[$t(p,"display")]&&(a.position=$t(e,"position")),p===e&&(a.position="static"),p.appendChild(on),m=on[u],p.removeChild(on),a.position="absolute";return c&&f&&(g=ln(p),g.time=gt.time,g.width=p[u]),Pe(d?m*r/h:m&&r?h/m*r:0)},hs=function(e,t,s,i){var r;return gc||Ua(),t in Xt&&t!=="transform"&&(t=Xt[t],~t.indexOf(",")&&(t=t.split(",")[0])),vs[t]&&t!=="transform"?(r=Gi(e,i),r=t!=="transformOrigin"?r[t]:r.svg?r.origin:so($t(e,ht))+" "+r.zOrigin+"px"):(r=e.style[t],(!r||r==="auto"||i||~(r+"").indexOf("calc("))&&(r=to[t]&&to[t](e,t,s)||$t(e,t)||Hu(e,t)||(t==="opacity"?1:0))),s&&!~(r+"").trim().indexOf(" ")?Vs(e,t,r,s)+s:r},P_=function(e,t,s,i){if(!s||s==="none"){var r=ei(t,e,1),o=r&&$t(e,r,1);o&&o!==s?(t=r,s=o):t==="borderColor"&&(s=$t(e,"borderTopColor"))}var a=new ut(this._pt,e.style,t,0,1,vh),c=0,l=0,u,h,d,f,m,p,g,y,w,S,v,_;if(a.b=s,a.e=i,s+="",i+="",i==="auto"&&(p=e.style[t],e.style[t]=i,i=$t(e,t)||i,p?e.style[t]=p:_n(e,t)),u=[s,i],ch(u),s=u[0],i=u[1],d=s.match(Ln)||[],_=i.match(Ln)||[],_.length){for(;h=Ln.exec(i);)g=h[0],w=i.substring(c,h.index),m?m=(m+1)%5:(w.substr(-5)==="rgba("||w.substr(-5)==="hsla(")&&(m=1),g!==(p=d[l++]||"")&&(f=parseFloat(p)||0,v=p.substr((f+"").length),g.charAt(1)==="="&&(g=Hn(f,g)+v),y=parseFloat(g),S=g.substr((y+"").length),c=Ln.lastIndex-S.length,S||(S=S||yt.units[t]||v,c===i.length&&(i+=S,a.e+=S)),v!==S&&(f=Vs(e,t,p,S)||0),a._pt={_next:a._pt,p:w||l===1?w:",",s:f,c:y-f,m:m&&m<4||t==="zIndex"?Math.round:0});a.c=c-1;)a=r[l],vs[a]&&(c=1,a=a==="transformOrigin"?ht:be),_n(s,a);c&&(_n(s,be),o&&(o.svg&&s.removeAttribute("transform"),Gi(s,1),o.uncache=1,wh(i)))}},to={clearProps:function(e,t,s,i,r){if(r.data!=="isFromStart"){var o=e._pt=new ut(e._pt,t,s,0,0,N_);return o.u=i,o.pr=-10,o.tween=r,e._props.push(s),1}}},Wi=[1,0,0,1,0,0],Oh={},Ah=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},Nl=function(e){var t=$t(e,be);return Ah(t)?Wi:t.substr(7).match(Fu).map(Pe)},xc=function(e,t){var s=e._gsap||ln(e),i=e.style,r=Nl(e),o,a,c,l;return s.svg&&e.getAttribute("transform")?(c=e.transform.baseVal.consolidate().matrix,r=[c.a,c.b,c.c,c.d,c.e,c.f],r.join(",")==="1,0,0,1,0,0"?Wi:r):(r===Wi&&!e.offsetParent&&e!==qn&&!s.svg&&(c=i.display,i.display="block",o=e.parentNode,(!o||!e.offsetParent)&&(l=1,a=e.nextElementSibling,qn.appendChild(e)),r=Nl(e),c?i.display=c:_n(e,"display"),l&&(a?o.insertBefore(e,a):o?o.appendChild(e):qn.removeChild(e))),t&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r)},La=function(e,t,s,i,r,o){var a=e._gsap,c=r||xc(e,!0),l=a.xOrigin||0,u=a.yOrigin||0,h=a.xOffset||0,d=a.yOffset||0,f=c[0],m=c[1],p=c[2],g=c[3],y=c[4],w=c[5],S=t.split(" "),v=parseFloat(S[0])||0,_=parseFloat(S[1])||0,T,x,k,C;s?c!==Wi&&(x=f*g-m*p)&&(k=v*(g/x)+_*(-p/x)+(p*w-g*y)/x,C=v*(-m/x)+_*(f/x)-(f*w-m*y)/x,v=k,_=C):(T=bh(e),v=T.x+(~S[0].indexOf("%")?v/100*T.width:v),_=T.y+(~(S[1]||S[0]).indexOf("%")?_/100*T.height:_)),i||i!==!1&&a.smooth?(y=v-l,w=_-u,a.xOffset=h+(y*f+w*p)-y,a.yOffset=d+(y*m+w*g)-w):a.xOffset=a.yOffset=0,a.xOrigin=v,a.yOrigin=_,a.smooth=!!i,a.origin=t,a.originIsAbsolute=!!s,e.style[ht]="0px 0px",o&&(Is(o,a,"xOrigin",l,v),Is(o,a,"yOrigin",u,_),Is(o,a,"xOffset",h,a.xOffset),Is(o,a,"yOffset",d,a.yOffset)),e.setAttribute("data-svg-origin",v+" "+_)},Gi=function(e,t){var s=e._gsap||new dh(e);if("x"in s&&!t&&!s.uncache)return s;var i=e.style,r=s.scaleX<0,o="px",a="deg",c=getComputedStyle(e),l=$t(e,ht)||"0",u,h,d,f,m,p,g,y,w,S,v,_,T,x,k,C,E,O,A,R,P,F,N,U,V,B,q,j,z,Te,ae,X;return u=h=d=p=g=y=w=S=v=0,f=m=1,s.svg=!!(e.getCTM&&Eh(e)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(i[be]=(c.translate!=="none"?"translate3d("+(c.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(c.rotate!=="none"?"rotate("+c.rotate+") ":"")+(c.scale!=="none"?"scale("+c.scale.split(" ").join(",")+") ":"")+(c[be]!=="none"?c[be]:"")),i.scale=i.rotate=i.translate="none"),x=xc(e,s.svg),s.svg&&(s.uncache?(V=e.getBBox(),l=s.xOrigin-V.x+"px "+(s.yOrigin-V.y)+"px",U=""):U=!t&&e.getAttribute("data-svg-origin"),La(e,U||l,!!U||s.originIsAbsolute,s.smooth!==!1,x)),_=s.xOrigin||0,T=s.yOrigin||0,x!==Wi&&(O=x[0],A=x[1],R=x[2],P=x[3],u=F=x[4],h=N=x[5],x.length===6?(f=Math.sqrt(O*O+A*A),m=Math.sqrt(P*P+R*R),p=O||A?In(A,O)*nn:0,w=R||P?In(R,P)*nn+p:0,w&&(m*=Math.abs(Math.cos(w*Wn))),s.svg&&(u-=_-(_*O+T*R),h-=T-(_*A+T*P))):(X=x[6],Te=x[7],q=x[8],j=x[9],z=x[10],ae=x[11],u=x[12],h=x[13],d=x[14],k=In(X,z),g=k*nn,k&&(C=Math.cos(-k),E=Math.sin(-k),U=F*C+q*E,V=N*C+j*E,B=X*C+z*E,q=F*-E+q*C,j=N*-E+j*C,z=X*-E+z*C,ae=Te*-E+ae*C,F=U,N=V,X=B),k=In(-R,z),y=k*nn,k&&(C=Math.cos(-k),E=Math.sin(-k),U=O*C-q*E,V=A*C-j*E,B=R*C-z*E,ae=P*E+ae*C,O=U,A=V,R=B),k=In(A,O),p=k*nn,k&&(C=Math.cos(k),E=Math.sin(k),U=O*C+A*E,V=F*C+N*E,A=A*C-O*E,N=N*C-F*E,O=U,F=V),g&&Math.abs(g)+Math.abs(p)>359.9&&(g=p=0,y=180-y),f=Pe(Math.sqrt(O*O+A*A+R*R)),m=Pe(Math.sqrt(N*N+X*X)),k=In(F,N),w=Math.abs(k)>2e-4?k*nn:0,v=ae?1/(ae<0?-ae:ae):0),s.svg&&(U=e.getAttribute("transform"),s.forceCSS=e.setAttribute("transform","")||!Ah($t(e,be)),U&&e.setAttribute("transform",U))),Math.abs(w)>90&&Math.abs(w)<270&&(r?(f*=-1,w+=p<=0?180:-180,p+=p<=0?180:-180):(m*=-1,w+=w<=0?180:-180)),t=t||s.uncache,s.x=u-((s.xPercent=u&&(!t&&s.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-u)?-50:0)))?e.offsetWidth*s.xPercent/100:0)+o,s.y=h-((s.yPercent=h&&(!t&&s.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-h)?-50:0)))?e.offsetHeight*s.yPercent/100:0)+o,s.z=d+o,s.scaleX=Pe(f),s.scaleY=Pe(m),s.rotation=Pe(p)+a,s.rotationX=Pe(g)+a,s.rotationY=Pe(y)+a,s.skewX=w+a,s.skewY=S+a,s.transformPerspective=v+o,(s.zOrigin=parseFloat(l.split(" ")[2])||!t&&s.zOrigin||0)&&(i[ht]=so(l)),s.xOffset=s.yOffset=0,s.force3D=yt.force3D,s.renderTransform=s.svg?U_:Ch?Mh:F_,s.uncache=0,s},so=function(e){return(e=e.split(" "))[0]+" "+e[1]},_a=function(e,t,s){var i=Xe(t);return Pe(parseFloat(t)+parseFloat(Vs(e,"x",s+"px",i)))+i},F_=function(e,t){t.z="0px",t.rotationY=t.rotationX="0deg",t.force3D=0,Mh(e,t)},tn="0deg",Oi="0px",sn=") ",Mh=function(e,t){var s=t||this,i=s.xPercent,r=s.yPercent,o=s.x,a=s.y,c=s.z,l=s.rotation,u=s.rotationY,h=s.rotationX,d=s.skewX,f=s.skewY,m=s.scaleX,p=s.scaleY,g=s.transformPerspective,y=s.force3D,w=s.target,S=s.zOrigin,v="",_=y==="auto"&&e&&e!==1||y===!0;if(S&&(h!==tn||u!==tn)){var T=parseFloat(u)*Wn,x=Math.sin(T),k=Math.cos(T),C;T=parseFloat(h)*Wn,C=Math.cos(T),o=_a(w,o,x*C*-S),a=_a(w,a,-Math.sin(T)*-S),c=_a(w,c,k*C*-S+S)}g!==Oi&&(v+="perspective("+g+sn),(i||r)&&(v+="translate("+i+"%, "+r+"%) "),(_||o!==Oi||a!==Oi||c!==Oi)&&(v+=c!==Oi||_?"translate3d("+o+", "+a+", "+c+") ":"translate("+o+", "+a+sn),l!==tn&&(v+="rotate("+l+sn),u!==tn&&(v+="rotateY("+u+sn),h!==tn&&(v+="rotateX("+h+sn),(d!==tn||f!==tn)&&(v+="skew("+d+", "+f+sn),(m!==1||p!==1)&&(v+="scale("+m+", "+p+sn),w.style[be]=v||"translate(0, 0)"},U_=function(e,t){var s=t||this,i=s.xPercent,r=s.yPercent,o=s.x,a=s.y,c=s.rotation,l=s.skewX,u=s.skewY,h=s.scaleX,d=s.scaleY,f=s.target,m=s.xOrigin,p=s.yOrigin,g=s.xOffset,y=s.yOffset,w=s.forceCSS,S=parseFloat(o),v=parseFloat(a),_,T,x,k,C;c=parseFloat(c),l=parseFloat(l),u=parseFloat(u),u&&(u=parseFloat(u),l+=u,c+=u),c||l?(c*=Wn,l*=Wn,_=Math.cos(c)*h,T=Math.sin(c)*h,x=Math.sin(c-l)*-d,k=Math.cos(c-l)*d,l&&(u*=Wn,C=Math.tan(l-u),C=Math.sqrt(1+C*C),x*=C,k*=C,u&&(C=Math.tan(u),C=Math.sqrt(1+C*C),_*=C,T*=C)),_=Pe(_),T=Pe(T),x=Pe(x),k=Pe(k)):(_=h,k=d,T=x=0),(S&&!~(o+"").indexOf("px")||v&&!~(a+"").indexOf("px"))&&(S=Vs(f,"x",o,"px"),v=Vs(f,"y",a,"px")),(m||p||g||y)&&(S=Pe(S+m-(m*_+p*x)+g),v=Pe(v+p-(m*T+p*k)+y)),(i||r)&&(C=f.getBBox(),S=Pe(S+i/100*C.width),v=Pe(v+r/100*C.height)),C="matrix("+_+","+T+","+x+","+k+","+S+","+v+")",f.setAttribute("transform",C),w&&(f.style[be]=C)},L_=function(e,t,s,i,r){var o=360,a=Ge(r),c=parseFloat(r)*(a&&~r.indexOf("rad")?nn:1),l=c-i,u=i+l+"deg",h,d;return a&&(h=r.split("_")[1],h==="short"&&(l%=o,l!==l%(o/2)&&(l+=l<0?o:-o)),h==="cw"&&l<0?l=(l+o*Ml)%o-~~(l/o)*o:h==="ccw"&&l>0&&(l=(l-o*Ml)%o-~~(l/o)*o)),e._pt=d=new ut(e._pt,t,s,i,l,T_),d.e=u,d.u="deg",e._props.push(s),d},Fl=function(e,t){for(var s in t)e[s]=t[s];return e},z_=function(e,t,s){var i=Fl({},s._gsap),r="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,c,l,u,h,d,f,m;i.svg?(l=s.getAttribute("transform"),s.setAttribute("transform",""),o[be]=t,a=Gi(s,1),_n(s,be),s.setAttribute("transform",l)):(l=getComputedStyle(s)[be],o[be]=t,a=Gi(s,1),o[be]=l);for(c in vs)l=i[c],u=a[c],l!==u&&r.indexOf(c)<0&&(f=Xe(l),m=Xe(u),h=f!==m?Vs(s,c,l,m):parseFloat(l),d=parseFloat(u),e._pt=new ut(e._pt,a,c,h,d-h,Na),e._pt.u=m||0,e._props.push(c));Fl(a,i)};lt("padding,margin,Width,Radius",function(n,e){var t="Top",s="Right",i="Bottom",r="Left",o=(e<3?[t,s,i,r]:[t+r,t+s,i+s,i+r]).map(function(a){return e<2?n+a:"border"+a+n});to[e>1?"border"+n:n]=function(a,c,l,u,h){var d,f;if(arguments.length<4)return d=o.map(function(m){return hs(a,m,l)}),f=d.join(" "),f.split(d[0]).length===5?d[0]:f;d=(u+"").split(" "),f={},o.forEach(function(m,p){return f[m]=d[p]=d[p]||d[(p-1)/2|0]}),a.init(c,f,h)}});var Dh={name:"css",register:Ua,targetTest:function(e){return e.style&&e.nodeType},init:function(e,t,s,i,r){var o=this._props,a=e.style,c=s.vars.startAt,l,u,h,d,f,m,p,g,y,w,S,v,_,T,x,k;gc||Ua(),this.styles=this.styles||Sh(e),k=this.styles.props,this.tween=s;for(p in t)if(p!=="autoRound"&&(u=t[p],!(_t[p]&&fh(p,t,s,i,e,r)))){if(f=typeof u,m=to[p],f==="function"&&(u=u.call(s,i,e,r),f=typeof u),f==="string"&&~u.indexOf("random(")&&(u=ji(u)),m)m(this,e,p,u,s)&&(x=1);else if(p.substr(0,2)==="--")l=(getComputedStyle(e).getPropertyValue(p)+"").trim(),u+="",Ls.lastIndex=0,Ls.test(l)||(g=Xe(l),y=Xe(u)),y?g!==y&&(l=Vs(e,p,l,y)+y):g&&(u+=g),this.add(a,"setProperty",l,u,i,r,0,0,p),o.push(p),k.push(p,0,a[p]);else if(f!=="undefined"){if(c&&p in c?(l=typeof c[p]=="function"?c[p].call(s,i,e,r):c[p],Ge(l)&&~l.indexOf("random(")&&(l=ji(l)),Xe(l+"")||l==="auto"||(l+=yt.units[p]||Xe(hs(e,p))||""),(l+"").charAt(1)==="="&&(l=hs(e,p))):l=hs(e,p),d=parseFloat(l),w=f==="string"&&u.charAt(1)==="="&&u.substr(0,2),w&&(u=u.substr(2)),h=parseFloat(u),p in Xt&&(p==="autoAlpha"&&(d===1&&hs(e,"visibility")==="hidden"&&h&&(d=0),k.push("visibility",0,a.visibility),Is(this,a,"visibility",d?"inherit":"hidden",h?"inherit":"hidden",!h)),p!=="scale"&&p!=="transform"&&(p=Xt[p],~p.indexOf(",")&&(p=p.split(",")[0]))),S=p in vs,S){if(this.styles.save(p),v||(_=e._gsap,_.renderTransform&&!t.parseTransform||Gi(e,t.parseTransform),T=t.smoothOrigin!==!1&&_.smooth,v=this._pt=new ut(this._pt,a,be,0,1,_.renderTransform,_,0,-1),v.dep=1),p==="scale")this._pt=new ut(this._pt,_,"scaleY",_.scaleY,(w?Hn(_.scaleY,w+h):h)-_.scaleY||0,Na),this._pt.u=0,o.push("scaleY",p),p+="X";else if(p==="transformOrigin"){k.push(ht,0,a[ht]),u=I_(u),_.svg?La(e,u,0,T,0,this):(y=parseFloat(u.split(" ")[2])||0,y!==_.zOrigin&&Is(this,_,"zOrigin",_.zOrigin,y),Is(this,a,p,so(l),so(u)));continue}else if(p==="svgOrigin"){La(e,u,1,T,0,this);continue}else if(p in Oh){L_(this,_,p,d,w?Hn(d,w+u):u);continue}else if(p==="smoothOrigin"){Is(this,_,"smooth",_.smooth,u);continue}else if(p==="force3D"){_[p]=u;continue}else if(p==="transform"){z_(this,u,e);continue}}else p in a||(p=ei(p)||p);if(S||(h||h===0)&&(d||d===0)&&!x_.test(u)&&p in a)g=(l+"").substr((d+"").length),h||(h=0),y=Xe(u)||(p in yt.units?yt.units[p]:g),g!==y&&(d=Vs(e,p,l,y)),this._pt=new ut(this._pt,S?_:a,p,d,(w?Hn(d,w+h):h)-d,!S&&(y==="px"||p==="zIndex")&&t.autoRound!==!1?w_:Na),this._pt.u=y||0,g!==y&&y!=="%"&&(this._pt.b=l,this._pt.r=k_);else if(p in a)P_.call(this,e,p,l,w?w+u:u);else if(p in e)this.add(e,p,l||e[p],w?w+u:u,i,r);else if(p!=="parseTransform"){cc(p,u);continue}S||(p in a?k.push(p,0,a[p]):k.push(p,1,l||e[p])),o.push(p)}}x&&yh(this)},render:function(e,t){if(t.tween._time||!vc())for(var s=t._pt;s;)s.r(e,s.d),s=s._next;else t.styles.revert()},get:hs,aliases:Xt,getSetter:function(e,t,s){var i=Xt[t];return i&&i.indexOf(",")<0&&(t=i),t in vs&&t!==ht&&(e._gsap.x||hs(e,"x"))?s&&Al===s?t==="scale"?E_:b_:(Al=s||{})&&(t==="scale"?O_:A_):e.style&&!rc(e.style[t])?S_:~t.indexOf("-")?C_:mc(e,t)},core:{_removeProperty:_n,_getMatrix:xc}};ft.utils.checkPrefix=ei;ft.core.getStyleSaver=Sh;(function(n,e,t,s){var i=lt(n+","+e+","+t,function(r){vs[r]=1});lt(e,function(r){yt.units[r]="deg",Oh[r]=1}),Xt[i[13]]=n+","+e,lt(s,function(r){var o=r.split(":");Xt[o[1]]=i[o[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");lt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(n){yt.units[n]="px"});ft.registerPlugin(Dh);var Tc=ft.registerPlugin(Dh)||ft;Tc.core.Tween;const B_=(n,e,t,s,i)=>{const r=new qf,o=1e-5;r.absarc(o,o,o,-Math.PI/2,-Math.PI,!0),r.absarc(o,e-s*2,o,Math.PI,Math.PI/2,!0),r.absarc(n-s*2,e-s*2,o,Math.PI/2,0,!0),r.absarc(n-s*2,o,o,0,-Math.PI/2,!0);const a=new Wf(r,{depth:t-s*2,bevelEnabled:!0,bevelSegments:i,steps:2,bevelSize:s,bevelThickness:s,curveSegments:i});a.center();const c=[],l=a.getAttribute("normal"),u=a.getAttribute("position");for(let h=0;h.9?(m=f.x/n+.5,p=1-(f.z/t+.5)):Math.abs(d.x)>.9?(m=-f.z/t+.5,p=1-(-f.y/e+.5)):Math.abs(d.z)>.9&&(m=f.x/n+.5,p=1-(-f.y/e+.5)),c.push(m,p)}return a.setAttribute("uv",new Gf(c,2)),a};B_(10,10,10,2,10);const Ul=new Hf(10,10,10),V_=500,j_=800,H_=new K(0,0,0),q_=16777215,W_=20,G_=(n,e)=>{var r,o;if(!(n!=null&&n.ref_id)||!(e!=null&&e.ref_id))return!1;let t=!1;const s=n.guests,i=e.guests;return((r=n.children)!=null&&r.includes(e.ref_id)||(o=e.children)!=null&&o.includes(n.ref_id))&&(t=!0),(s!=null&&s.find(a=>a.ref_id===e.ref_id)||i!=null&&i.find(a=>a.ref_id===n.ref_id))&&(t=!0),t};let Ai=null;const Y_=500,kc=(n,e)=>{if(Ai)return null;Ai=setTimeout(()=>{Ai&&(clearTimeout(Ai),Ai=null)},Y_);const t=[];return n.forEach(i=>{const r=e.position.distanceTo(H_.set(i.x,i.y,i.z));ri.distance-r.distance).slice(0,V_).map(i=>i.id)},ps=new K(5e3,600,1600),Ll=100,Z_=600,X_=2e3,ga={x:172.7392402058252,y:-239.04675366094037,z:-2e3},Rh="14.8.49",zl=(n,e,t)=>({endTime:e,insertTime:t,type:"exponentialRampToValue",value:n}),Bl=(n,e,t)=>({endTime:e,insertTime:t,type:"linearRampToValue",value:n}),za=(n,e)=>({startTime:e,type:"setValue",value:n}),Ph=(n,e,t)=>({duration:t,startTime:e,type:"setValueCurve",values:n}),Ih=(n,e,{startTime:t,target:s,timeConstant:i})=>s+(e-s)*Math.exp((t-n)/i),Bn=n=>n.type==="exponentialRampToValue",no=n=>n.type==="linearRampToValue",Ds=n=>Bn(n)||no(n),wc=n=>n.type==="setValue",us=n=>n.type==="setValueCurve",io=(n,e,t,s)=>{const i=n[e];return i===void 0?s:Ds(i)||wc(i)?i.value:us(i)?i.values[i.values.length-1]:Ih(t,io(n,e-1,i.startTime,s),i)},Vl=(n,e,t,s,i)=>t===void 0?[s.insertTime,i]:Ds(t)?[t.endTime,t.value]:wc(t)?[t.startTime,t.value]:us(t)?[t.startTime+t.duration,t.values[t.values.length-1]]:[t.startTime,io(n,e-1,t.startTime,i)],Ba=n=>n.type==="cancelAndHold",Va=n=>n.type==="cancelScheduledValues",As=n=>Ba(n)||Va(n)?n.cancelTime:Bn(n)||no(n)?n.endTime:n.startTime,jl=(n,e,t,{endTime:s,value:i})=>t===i?i:0t+(n-e)/(s-e)*(i-t),$_=(n,e)=>{const t=Math.floor(e),s=Math.ceil(e);return t===s?n[t]:(1-(e-t))*n[t]+(1-(s-e))*n[s]},Q_=(n,{duration:e,startTime:t,values:s})=>{const i=(n-t)/e*(s.length-1);return $_(s,i)},Ur=n=>n.type==="setTarget";class K_{constructor(e){this._automationEvents=[],this._currenTime=0,this._defaultValue=e}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(e){const t=As(e);if(Ba(e)||Va(e)){const s=this._automationEvents.findIndex(r=>Va(e)&&us(r)?r.startTime+r.duration>=t:As(r)>=t),i=this._automationEvents[s];if(s!==-1&&(this._automationEvents=this._automationEvents.slice(0,s)),Ba(e)){const r=this._automationEvents[this._automationEvents.length-1];if(i!==void 0&&Ds(i)){if(r!==void 0&&Ur(r))throw new Error("The internal list is malformed.");const o=r===void 0?i.insertTime:us(r)?r.startTime+r.duration:As(r),a=r===void 0?this._defaultValue:us(r)?r.values[r.values.length-1]:r.value,c=Bn(i)?jl(t,o,a,i):Hl(t,o,a,i),l=Bn(i)?zl(c,t,this._currenTime):Bl(c,t,this._currenTime);this._automationEvents.push(l)}if(r!==void 0&&Ur(r)&&this._automationEvents.push(za(this.getValue(t),t)),r!==void 0&&us(r)&&r.startTime+r.duration>t){const o=t-r.startTime,a=(r.values.length-1)/r.duration,c=Math.max(2,1+Math.ceil(o*a)),l=o/(c-1)*a,u=r.values.slice(0,c);if(l<1)for(let h=1;hAs(o)>t),i=s===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[s-1];if(i!==void 0&&us(i)&&As(i)+i.duration>t)return!1;const r=Bn(e)?zl(e.value,e.endTime,this._currenTime):no(e)?Bl(e.value,t,this._currenTime):e;if(s===-1)this._automationEvents.push(r);else{if(us(e)&&t+e.duration>As(this._automationEvents[s]))return!1;this._automationEvents.splice(s,0,r)}}return!0}flush(e){const t=this._automationEvents.findIndex(s=>As(s)>e);if(t>1){const s=this._automationEvents.slice(t-1),i=s[0];Ur(i)&&s.unshift(za(io(this._automationEvents,t-2,i.startTime,this._defaultValue),i.startTime)),this._automationEvents=s}}getValue(e){if(this._automationEvents.length===0)return this._defaultValue;const t=this._automationEvents.findIndex(o=>As(o)>e),s=this._automationEvents[t],i=(t===-1?this._automationEvents.length:t)-1,r=this._automationEvents[i];if(r!==void 0&&Ur(r)&&(s===void 0||!Ds(s)||s.insertTime>e))return Ih(e,io(this._automationEvents,i-1,r.startTime,this._defaultValue),r);if(r!==void 0&&wc(r)&&(s===void 0||!Ds(s)))return r.value;if(r!==void 0&&us(r)&&(s===void 0||!Ds(s)||r.startTime+r.duration>e))return e({cancelTime:n,type:"cancelAndHold"}),eg=n=>({cancelTime:n,type:"cancelScheduledValues"}),tg=(n,e)=>({endTime:e,type:"exponentialRampToValue",value:n}),sg=(n,e)=>({endTime:e,type:"linearRampToValue",value:n}),ng=(n,e,t)=>({startTime:e,target:n,timeConstant:t,type:"setTarget"}),ig=()=>new DOMException("","AbortError"),rg=n=>(e,t,[s,i,r],o)=>{n(e[i],[t,s,r],a=>a[0]===t&&a[1]===s,o)},og=n=>(e,t,s)=>{const i=[];for(let r=0;r(e,t)=>{n.set(e,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:t})},ti=new WeakSet,Nh=new WeakMap,Sc=new WeakMap,Fh=new WeakMap,Cc=new WeakMap,No=new WeakMap,Uh=new WeakMap,ja=new WeakMap,Ha=new WeakMap,qa=new WeakMap,Lh={construct(){return Lh}},cg=n=>{try{const e=new Proxy(n,Lh);new e}catch{return!1}return!0},ql=/^import(?:(?:[\s]+[\w]+|(?:[\s]+[\w]+[\s]*,)?[\s]*\{[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?(?:[\s]*,[\s]*[\w]+(?:[\s]+as[\s]+[\w]+)?)*[\s]*}|(?:[\s]+[\w]+[\s]*,)?[\s]*\*[\s]+as[\s]+[\w]+)[\s]+from)?(?:[\s]*)("([^"\\]|\\.)+"|'([^'\\]|\\.)+')(?:[\s]*);?/,Wl=(n,e)=>{const t=[];let s=n.replace(/^[\s]+/,""),i=s.match(ql);for(;i!==null;){const r=i[1].slice(1,-1),o=i[0].replace(/([\s]+)?;?$/,"").replace(r,new URL(r,e).toString());t.push(o),s=s.slice(i[0].length).replace(/^[\s]+/,""),i=s.match(ql)}return[t.join(";"),s]},Gl=n=>{if(n!==void 0&&!Array.isArray(n))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},Yl=n=>{if(!cg(n))throw new TypeError("The given value for processorCtor should be a constructor.");if(n.prototype===null||typeof n.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},lg=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>{let f=0;return(m,p,g={credentials:"omit"})=>{const y=u.get(m);if(y!==void 0&&y.has(p))return Promise.resolve();const w=l.get(m);if(w!==void 0){const _=w.get(p);if(_!==void 0)return _}const S=r(m),v=S.audioWorklet===void 0?i(p).then(([_,T])=>{const[x,k]=Wl(_,T),C=`${x};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${k} })})(window,'_AWGS')`;return t(C)}).then(()=>{const _=d._AWGS.pop();if(_===void 0)throw new SyntaxError;s(S.currentTime,S.sampleRate,()=>_(class{},void 0,(T,x)=>{if(T.trim()==="")throw e();const k=Ha.get(S);if(k!==void 0){if(k.has(T))throw e();Yl(x),Gl(x.parameterDescriptors),k.set(T,x)}else Yl(x),Gl(x.parameterDescriptors),Ha.set(S,new Map([[T,x]]))},S.sampleRate,void 0,void 0))}):Promise.all([i(p),Promise.resolve(n(h,h))]).then(([[_,T],x])=>{const k=f+1;f=k;const[C,E]=Wl(_,T),P=`${C};((AudioWorkletProcessor,registerProcessor)=>{${E} -})(${x?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${x?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${x?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${k}',class extends AudioWorkletProcessor{process(){return !1}})`,F=new Blob([P],{type:"application/javascript; charset=utf-8"}),N=URL.createObjectURL(F);return S.audioWorklet.addModule(N,g).then(()=>{if(a(S))return S;const U=o(S);return U.audioWorklet.addModule(N,g).then(()=>U)}).then(U=>{if(c===null)throw new SyntaxError;try{new c(U,`__sac${k}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(N))});return w===void 0?l.set(m,new Map([[p,v]])):w.set(p,v),v.then(()=>{const _=u.get(m);_===void 0?u.set(m,new Set([p])):_.add(p)}).finally(()=>{const _=l.get(m);_!==void 0&&_.delete(p)}),v}},Bt=(n,e)=>{const t=n.get(e);if(t===void 0)throw new Error("A value with the given key could not be found.");return t},Fo=(n,e)=>{const t=Array.from(n).filter(e);if(t.length>1)throw Error("More than one element was found.");if(t.length===0)throw Error("No element was found.");const[s]=t;return n.delete(s),s},zh=(n,e,t,s)=>{const i=Bt(n,e),r=Fo(i,o=>o[0]===t&&o[1]===s);return i.size===0&&n.delete(e),r},_r=n=>Bt(Uh,n),si=n=>{if(ti.has(n))throw new Error("The AudioNode is already stored.");ti.add(n),_r(n).forEach(e=>e(!0))},Bh=n=>"port"in n,gr=n=>{if(!ti.has(n))throw new Error("The AudioNode is not stored.");ti.delete(n),_r(n).forEach(e=>e(!1))},Wa=(n,e)=>{!Bh(n)&&e.every(t=>t.size===0)&&gr(n)},lg=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>{const f=new WeakMap;return(m,p,g,y,w)=>{const{activeInputs:S,passiveInputs:v}=r(p),{outputs:_}=r(m),T=a(m),x=k=>{const C=c(p),E=c(m);if(k){const O=zh(v,m,g,y);n(S,m,O,!1),!w&&!h(m)&&t(E,C,g,y),d(p)&&si(p)}else{const O=s(S,m,g,y);e(v,y,O,!1),!w&&!h(m)&&i(E,C,g,y);const A=o(p);if(A===0)u(p)&&Wa(p,S);else{const R=f.get(p);R!==void 0&&clearTimeout(R),f.set(p,setTimeout(()=>{u(p)&&Wa(p,S)},A*1e3))}}};return l(_,[p,g,y],k=>k[0]===p&&k[1]===g&&k[2]===y,!0)?(T.add(x),u(m)?n(S,m,[g,y,x],!0):e(v,y,[m,g,x],!0),!0):!1}},ug=n=>(e,t,[s,i,r],o)=>{const a=e.get(s);a===void 0?e.set(s,new Set([[i,t,r]])):n(a,[i,t,r],c=>c[0]===i&&c[1]===t,o)},hg=n=>(e,t)=>{const s=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(s).connect(e.destination);const i=()=>{t.removeEventListener("ended",i),t.disconnect(s),s.disconnect()};t.addEventListener("ended",i)},dg=n=>(e,t)=>{n(e).add(t)},fg={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},pg=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=i(a),u={...fg,...c},h=s(l,u),d=r(l)?e():null;super(a,!1,h,d),this._nativeAnalyserNode=h}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(a){this._nativeAnalyserNode.fftSize=a}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(a){const c=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=a,!(a>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=c,t()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(a){const c=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=a,!(this._nativeAnalyserNode.maxDecibels>a))throw this._nativeAnalyserNode.minDecibels=c,t()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(a){this._nativeAnalyserNode.smoothingTimeConstant=a}getByteFrequencyData(a){this._nativeAnalyserNode.getByteFrequencyData(a)}getByteTimeDomainData(a){this._nativeAnalyserNode.getByteTimeDomainData(a)}getFloatFrequencyData(a){this._nativeAnalyserNode.getFloatFrequencyData(a)}getFloatTimeDomainData(a){this._nativeAnalyserNode.getFloatTimeDomainData(a)}},Je=(n,e)=>n.context===e,mg=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!Je(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,fftSize:a.fftSize,maxDecibels:a.maxDecibels,minDecibels:a.minDecibels,smoothingTimeConstant:a.smoothingTimeConstant};a=n(o,l)}return s.set(o,a),await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},ro=n=>{try{n.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},ts=()=>new DOMException("","IndexSizeError"),bc=n=>{n.getChannelData=(e=>t=>{try{return e.call(n,t)}catch(s){throw s.code===12?ts():s}})(n.getChannelData)},_g={numberOfChannels:1},gg=(n,e,t,s,i,r,o,a)=>{let c=null;return class Vh{constructor(u){if(i===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:h,numberOfChannels:d,sampleRate:f}={..._g,...u};c===null&&(c=new i(1,1,44100));const m=s!==null&&e(r,r)?new s({length:h,numberOfChannels:d,sampleRate:f}):c.createBuffer(d,h,f);if(m.numberOfChannels===0)throw t();return typeof m.copyFromChannel!="function"?(o(m),bc(m)):e(ro,()=>ro(m))||a(m),n.add(m),m}static[Symbol.hasInstance](u){return u!==null&&typeof u=="object"&&Object.getPrototypeOf(u)===Vh.prototype||n.has(u)}}},at=-34028234663852886e22,et=-at,ms=n=>ti.has(n),vg={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},yg=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d={...vg,...u},f=i(h,d),m=o(h),p=m?e():null;super(l,!1,f,p),this._audioBufferSourceNodeRenderer=p,this._isBufferNullified=!1,this._isBufferSet=d.buffer!==null,this._nativeAudioBufferSourceNode=f,this._onended=null,this._playbackRate=t(this,m,f.playbackRate,et,at)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(l){if(this._nativeAudioBufferSourceNode.buffer=l,l!==null){if(this._isBufferSet)throw s();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(l){this._nativeAudioBufferSourceNode.loop=l}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(l){this._nativeAudioBufferSourceNode.loopEnd=l}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(l){this._nativeAudioBufferSourceNode.loopStart=l}get onended(){return this._onended}set onended(l){const u=typeof l=="function"?a(this,l):null;this._nativeAudioBufferSourceNode.onended=u;const h=this._nativeAudioBufferSourceNode.onended;this._onended=h!==null&&h===u?l:h}get playbackRate(){return this._playbackRate}start(l=0,u=0,h){if(this._nativeAudioBufferSourceNode.start(l,u,h),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=h===void 0?[l,u]:[l,u,h]),this.context.state!=="closed"){si(this);const d=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",d),ms(this)&&gr(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",d)}}stop(l=0){this._nativeAudioBufferSourceNode.stop(l),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=l)}},xg=(n,e,t,s,i)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=t(l);const d=Je(h,u);if(!d){const f={buffer:h.buffer,channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,loop:h.loop,loopEnd:h.loopEnd,loopStart:h.loopStart,playbackRate:h.playbackRate.value};h=e(u,f),o!==null&&h.start(...o),a!==null&&h.stop(a)}return r.set(u,h),d?await n(u,l.playbackRate,h.playbackRate):await s(u,l.playbackRate,h.playbackRate),await i(l,u,h),h};return{set start(l){o=l},set stop(l){a=l},render(l,u){const h=r.get(u);return h!==void 0?Promise.resolve(h):c(l,u)}}},Tg=n=>"playbackRate"in n,kg=n=>"frequency"in n&&"gain"in n,wg=n=>"offset"in n,Sg=n=>!("frequency"in n)&&"gain"in n,Cg=n=>"detune"in n&&"frequency"in n,bg=n=>"pan"in n,st=n=>Bt(Nh,n),vr=n=>Bt(Fh,n),Ga=(n,e)=>{const{activeInputs:t}=st(n);t.forEach(i=>i.forEach(([r])=>{e.includes(n)||Ga(r,[...e,n])}));const s=Tg(n)?[n.playbackRate]:Bh(n)?Array.from(n.parameters.values()):kg(n)?[n.Q,n.detune,n.frequency,n.gain]:wg(n)?[n.offset]:Sg(n)?[n.gain]:Cg(n)?[n.detune,n.frequency]:bg(n)?[n.pan]:[];for(const i of s){const r=vr(i);r!==void 0&&r.activeInputs.forEach(([o])=>Ga(o,e))}ms(n)&&gr(n)},jh=n=>{Ga(n.destination,[])},Eg=n=>n===void 0||typeof n=="number"||typeof n=="string"&&(n==="balanced"||n==="interactive"||n==="playback"),Og=(n,e,t,s,i,r,o,a,c)=>class extends n{constructor(u={}){if(c===null)throw new Error("Missing the native AudioContext constructor.");let h;try{h=new c(u)}catch(m){throw m.code===12&&m.message==="sampleRate is not in range"?t():m}if(h===null)throw s();if(!Eg(u.latencyHint))throw new TypeError(`The provided value '${u.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(u.sampleRate!==void 0&&h.sampleRate!==u.sampleRate)throw t();super(h,2);const{latencyHint:d}=u,{sampleRate:f}=h;if(this._baseLatency=typeof h.baseLatency=="number"?h.baseLatency:d==="balanced"?512/f:d==="interactive"||d===void 0?256/f:d==="playback"?1024/f:Math.max(2,Math.min(128,Math.round(d*f/128)))*128/f,this._nativeAudioContext=h,c.name==="webkitAudioContext"?(this._nativeGainNode=h.createGain(),this._nativeOscillatorNode=h.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(h.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,h.state==="running"){this._state="suspended";const m=()=>{this._state==="suspended"&&(this._state=null),h.removeEventListener("statechange",m)};h.addEventListener("statechange",m)}}get baseLatency(){return this._baseLatency}get state(){return this._state!==null?this._state:this._nativeAudioContext.state}close(){return this.state==="closed"?this._nativeAudioContext.close().then(()=>{throw e()}):(this._state==="suspended"&&(this._state=null),this._nativeAudioContext.close().then(()=>{this._nativeGainNode!==null&&this._nativeOscillatorNode!==null&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),jh(this)}))}createMediaElementSource(u){return new i(this,{mediaElement:u})}createMediaStreamDestination(){return new r(this)}createMediaStreamSource(u){return new o(this,{mediaStream:u})}createMediaStreamTrackSource(u){return new a(this,{mediaStreamTrack:u})}resume(){return this._state==="suspended"?new Promise((u,h)=>{const d=()=>{this._nativeAudioContext.removeEventListener("statechange",d),this._nativeAudioContext.state==="running"?u():this.resume().then(u,h)};this._nativeAudioContext.addEventListener("statechange",d)}):this._nativeAudioContext.resume().catch(u=>{throw u===void 0||u.code===15?e():u})}suspend(){return this._nativeAudioContext.suspend().catch(u=>{throw u===void 0?e():u})}},Ag=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d=o(h),f=i(h,u,d),m=d?e(a):null;super(l,!1,f,m),this._isNodeOfNativeOfflineAudioContext=d,this._nativeAudioDestinationNode=f}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(l){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(l>this._nativeAudioDestinationNode.maxChannelCount)throw t();this._nativeAudioDestinationNode.channelCount=l}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(l){if(this._isNodeOfNativeOfflineAudioContext)throw s();this._nativeAudioDestinationNode.channelCountMode=l}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},Mg=n=>{const e=new WeakMap,t=async(s,i)=>{const r=i.destination;return e.set(i,r),await n(s,i,r),r};return{render(s,i){const r=e.get(i);return r!==void 0?Promise.resolve(r):t(s,i)}}},Dg=(n,e,t,s,i,r,o,a)=>(c,l)=>{const u=l.listener,h=()=>{const _=new Float32Array(1),T=e(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),x=o(l);let k=!1,C=[0,0,-1,0,1,0],E=[0,0,0];const O=()=>{if(k)return;k=!0;const F=s(l,256,9,0);F.onaudioprocess=({inputBuffer:N})=>{const U=[r(N,_,0),r(N,_,1),r(N,_,2),r(N,_,3),r(N,_,4),r(N,_,5)];U.some((B,q)=>B!==C[q])&&(u.setOrientation(...U),C=U);const V=[r(N,_,6),r(N,_,7),r(N,_,8)];V.some((B,q)=>B!==E[q])&&(u.setPosition(...V),E=V)},T.connect(F)},A=F=>N=>{N!==C[F]&&(C[F]=N,u.setOrientation(...C))},R=F=>N=>{N!==E[F]&&(E[F]=N,u.setPosition(...E))},P=(F,N,U)=>{const V=t(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:N});V.connect(T,0,F),V.start(),Object.defineProperty(V.offset,"defaultValue",{get(){return N}});const B=n({context:c},x,V.offset,et,at);return a(B,"value",q=>()=>q.call(B),q=>j=>{try{q.call(B,j)}catch(z){if(z.code!==9)throw z}O(),x&&U(j)}),B.cancelAndHoldAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.cancelAndHoldAtTime),B.cancelScheduledValues=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.cancelScheduledValues),B.exponentialRampToValueAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.exponentialRampToValueAtTime),B.linearRampToValueAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.linearRampToValueAtTime),B.setTargetAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.setTargetAtTime),B.setValueAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.setValueAtTime),B.setValueCurveAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.setValueCurveAtTime),B};return{forwardX:P(0,0,A(0)),forwardY:P(1,0,A(1)),forwardZ:P(2,-1,A(2)),positionX:P(6,0,R(0)),positionY:P(7,0,R(1)),positionZ:P(8,0,R(2)),upX:P(3,0,A(3)),upY:P(4,1,A(4)),upZ:P(5,0,A(5))}},{forwardX:d,forwardY:f,forwardZ:m,positionX:p,positionY:g,positionZ:y,upX:w,upY:S,upZ:v}=u.forwardX===void 0?h():u;return{get forwardX(){return d},get forwardY(){return f},get forwardZ(){return m},get positionX(){return p},get positionY(){return g},get positionZ(){return y},get upX(){return w},get upY(){return S},get upZ(){return v}}},oo=n=>"context"in n,yr=n=>oo(n[0]),Sn=(n,e,t,s)=>{for(const i of n)if(t(i)){if(s)return!1;throw Error("The set contains at least one similar element.")}return n.add(e),!0},Zl=(n,e,[t,s],i)=>{Sn(n,[e,t,s],r=>r[0]===e&&r[1]===t,i)},Xl=(n,[e,t,s],i)=>{const r=n.get(e);r===void 0?n.set(e,new Set([[t,s]])):Sn(r,[t,s],o=>o[0]===t,i)},li=n=>"inputs"in n,ao=(n,e,t,s)=>{if(li(e)){const i=e.inputs[s];return n.connect(i,t,0),[i,t,0]}return n.connect(e,t,s),[e,t,s]},Hh=(n,e,t)=>{for(const s of n)if(s[0]===e&&s[1]===t)return n.delete(s),s;return null},Rg=(n,e,t)=>Fo(n,s=>s[0]===e&&s[1]===t),qh=(n,e)=>{if(!_r(n).delete(e))throw new Error("Missing the expected event listener.")},Wh=(n,e,t)=>{const s=Bt(n,e),i=Fo(s,r=>r[0]===t);return s.size===0&&n.delete(e),i},co=(n,e,t,s)=>{li(e)?n.disconnect(e.inputs[s],t,0):n.disconnect(e,t,s)},ke=n=>Bt(Sc,n),Yi=n=>Bt(Cc,n),gn=n=>ja.has(n),Gr=n=>!ti.has(n),$l=(n,e)=>new Promise(t=>{if(e!==null)t(!0);else{const s=n.createScriptProcessor(256,1,1),i=n.createGain(),r=n.createBuffer(1,2,44100),o=r.getChannelData(0);o[0]=1,o[1]=1;const a=n.createBufferSource();a.buffer=r,a.loop=!0,a.connect(s).connect(n.destination),a.connect(i),a.disconnect(i),s.onaudioprocess=c=>{const l=c.inputBuffer.getChannelData(0);Array.prototype.some.call(l,u=>u===1)?t(!0):t(!1),a.stop(),s.onaudioprocess=null,a.disconnect(s),s.disconnect(n.destination)},a.start()}}),va=(n,e)=>{const t=new Map;for(const s of n)for(const i of s){const r=t.get(i);t.set(i,r===void 0?1:r+1)}t.forEach((s,i)=>e(i,s))},lo=n=>"context"in n,Pg=n=>{const e=new Map;n.connect=(t=>(s,i=0,r=0)=>{const o=lo(s)?t(s,i,r):t(s,i),a=e.get(s);return a===void 0?e.set(s,[{input:r,output:i}]):a.every(c=>c.input!==r||c.output!==i)&&a.push({input:r,output:i}),o})(n.connect.bind(n)),n.disconnect=(t=>(s,i,r)=>{if(t.apply(n),s===void 0)e.clear();else if(typeof s=="number")for(const[o,a]of e){const c=a.filter(l=>l.output!==s);c.length===0?e.delete(o):e.set(o,c)}else if(e.has(s))if(i===void 0)e.delete(s);else{const o=e.get(s);if(o!==void 0){const a=o.filter(c=>c.output!==i&&(c.input!==r||r===void 0));a.length===0?e.delete(s):e.set(s,a)}}for(const[o,a]of e)a.forEach(c=>{lo(o)?n.connect(o,c.output,c.input):n.connect(o,c.output)})})(n.disconnect)},Ig=(n,e,t,s)=>{const{activeInputs:i,passiveInputs:r}=vr(e),{outputs:o}=st(n),a=_r(n),c=l=>{const u=ke(n),h=Yi(e);if(l){const d=Wh(r,n,t);Zl(i,n,d,!1),!s&&!gn(n)&&u.connect(h,t)}else{const d=Rg(i,n,t);Xl(r,d,!1),!s&&!gn(n)&&u.disconnect(h,t)}};return Sn(o,[e,t],l=>l[0]===e&&l[1]===t,!0)?(a.add(c),ms(n)?Zl(i,n,[t,c],!0):Xl(r,[n,t,c],!0),!0):!1},Ng=(n,e,t,s)=>{const{activeInputs:i,passiveInputs:r}=st(e),o=Hh(i[s],n,t);return o===null?[zh(r,n,t,s)[2],!1]:[o[2],!0]},Fg=(n,e,t)=>{const{activeInputs:s,passiveInputs:i}=vr(e),r=Hh(s,n,t);return r===null?[Wh(i,n,t)[1],!1]:[r[2],!0]},Ec=(n,e,t,s,i)=>{const[r,o]=Ng(n,t,s,i);if(r!==null&&(qh(n,r),o&&!e&&!gn(n)&&co(ke(n),ke(t),s,i)),ms(t)){const{activeInputs:a}=st(t);Wa(t,a)}},Oc=(n,e,t,s)=>{const[i,r]=Fg(n,t,s);i!==null&&(qh(n,i),r&&!e&&!gn(n)&&ke(n).disconnect(Yi(t),s))},Ug=(n,e)=>{const t=st(n),s=[];for(const i of t.outputs)yr(i)?Ec(n,e,...i):Oc(n,e,...i),s.push(i[0]);return t.outputs.clear(),s},Lg=(n,e,t)=>{const s=st(n),i=[];for(const r of s.outputs)r[1]===t&&(yr(r)?Ec(n,e,...r):Oc(n,e,...r),i.push(r[0]),s.outputs.delete(r));return i},zg=(n,e,t,s,i)=>{const r=st(n);return Array.from(r.outputs).filter(o=>o[0]===t&&(s===void 0||o[1]===s)&&(i===void 0||o[2]===i)).map(o=>(yr(o)?Ec(n,e,...o):Oc(n,e,...o),r.outputs.delete(o),o[0]))},Bg=(n,e,t,s,i,r,o,a,c,l,u,h,d,f,m,p)=>class extends l{constructor(y,w,S,v){super(S),this._context=y,this._nativeAudioNode=S;const _=u(y);h(_)&&t($l,()=>$l(_,p))!==!0&&Pg(S),Sc.set(this,S),Uh.set(this,new Set),y.state!=="closed"&&w&&si(this),n(this,v,S)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(y){this._nativeAudioNode.channelCount=y}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(y){this._nativeAudioNode.channelCountMode=y}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(y){this._nativeAudioNode.channelInterpretation=y}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(y,w=0,S=0){if(w<0||w>=this._nativeAudioNode.numberOfOutputs)throw i();const v=u(this._context),_=m(v);if(d(y)||f(y))throw r();if(oo(y)){const k=ke(y);try{const E=ao(this._nativeAudioNode,k,w,S),O=Gr(this);(_||O)&&this._nativeAudioNode.disconnect(...E),this.context.state!=="closed"&&!O&&Gr(y)&&si(y)}catch(E){throw E.code===12?r():E}if(e(this,y,w,S,_)){const E=c([this],y);va(E,s(_))}return y}const T=Yi(y);if(T.name==="playbackRate"&&T.maxValue===1024)throw o();try{this._nativeAudioNode.connect(T,w),(_||Gr(this))&&this._nativeAudioNode.disconnect(T,w)}catch(k){throw k.code===12?r():k}if(Ig(this,y,w,_)){const k=c([this],y);va(k,s(_))}}disconnect(y,w,S){let v;const _=u(this._context),T=m(_);if(y===void 0)v=Ug(this,T);else if(typeof y=="number"){if(y<0||y>=this.numberOfOutputs)throw i();v=Lg(this,T,y)}else{if(w!==void 0&&(w<0||w>=this.numberOfOutputs)||oo(y)&&S!==void 0&&(S<0||S>=y.numberOfInputs))throw i();if(v=zg(this,T,y,w,S),v.length===0)throw r()}for(const x of v){const k=c([this],x);va(k,a)}}},Vg=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>(f,m,p,g=null,y=null)=>{const w=p.value,S=new Q_(w),v=m?s(S):null,_={get defaultValue(){return w},get maxValue(){return g===null?p.maxValue:g},get minValue(){return y===null?p.minValue:y},get value(){return p.value},set value(T){p.value=T,_.setValueAtTime(T,f.context.currentTime)},cancelAndHoldAtTime(T){if(typeof p.cancelAndHoldAtTime=="function")v===null&&S.flush(f.context.currentTime),S.add(i(T)),p.cancelAndHoldAtTime(T);else{const x=Array.from(S).pop();v===null&&S.flush(f.context.currentTime),S.add(i(T));const k=Array.from(S).pop();p.cancelScheduledValues(T),x!==k&&k!==void 0&&(k.type==="exponentialRampToValue"?p.exponentialRampToValueAtTime(k.value,k.endTime):k.type==="linearRampToValue"?p.linearRampToValueAtTime(k.value,k.endTime):k.type==="setValue"?p.setValueAtTime(k.value,k.startTime):k.type==="setValueCurve"&&p.setValueCurveAtTime(k.values,k.startTime,k.duration))}return _},cancelScheduledValues(T){return v===null&&S.flush(f.context.currentTime),S.add(r(T)),p.cancelScheduledValues(T),_},exponentialRampToValueAtTime(T,x){if(T===0)throw new RangeError;if(!Number.isFinite(x)||x<0)throw new RangeError;const k=f.context.currentTime;return v===null&&S.flush(k),Array.from(S).length===0&&(S.add(l(w,k)),p.setValueAtTime(w,k)),S.add(o(T,x)),p.exponentialRampToValueAtTime(T,x),_},linearRampToValueAtTime(T,x){const k=f.context.currentTime;return v===null&&S.flush(k),Array.from(S).length===0&&(S.add(l(w,k)),p.setValueAtTime(w,k)),S.add(a(T,x)),p.linearRampToValueAtTime(T,x),_},setTargetAtTime(T,x,k){return v===null&&S.flush(f.context.currentTime),S.add(c(T,x,k)),p.setTargetAtTime(T,x,k),_},setValueAtTime(T,x){return v===null&&S.flush(f.context.currentTime),S.add(l(T,x)),p.setValueAtTime(T,x),_},setValueCurveAtTime(T,x,k){const C=T instanceof Float32Array?T:new Float32Array(T);if(h!==null&&h.name==="webkitAudioContext"){const E=x+k,O=f.context.sampleRate,A=Math.ceil(x*O),R=Math.floor(E*O),P=R-A,F=new Float32Array(P);for(let U=0;U({replay(e){for(const t of n)if(t.type==="exponentialRampToValue"){const{endTime:s,value:i}=t;e.exponentialRampToValueAtTime(i,s)}else if(t.type==="linearRampToValue"){const{endTime:s,value:i}=t;e.linearRampToValueAtTime(i,s)}else if(t.type==="setTarget"){const{startTime:s,target:i,timeConstant:r}=t;e.setTargetAtTime(i,s,r)}else if(t.type==="setValue"){const{startTime:s,value:i}=t;e.setValueAtTime(i,s)}else if(t.type==="setValueCurve"){const{duration:s,startTime:i,values:r}=t;e.setValueCurveAtTime(r,i,s)}else throw new Error("Can't apply an unknown automation.")}});class Gh{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach((s,i)=>e.call(t,s,i,this))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const Hg={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},qg=(n,e,t,s,i,r,o,a,c,l,u,h,d,f)=>class extends e{constructor(p,g,y){var w;const S=a(p),v=c(S),_=u({...Hg,...y});d(_);const T=Ha.get(S),x=T==null?void 0:T.get(g),k=v||S.state!=="closed"?S:(w=o(S))!==null&&w!==void 0?w:S,C=i(k,v?null:p.baseLatency,l,g,x,_),E=v?s(g,_,x):null;super(p,!0,C,E);const O=[];C.parameters.forEach((R,P)=>{const F=t(this,v,R);O.push([P,F])}),this._nativeAudioWorkletNode=C,this._onprocessorerror=null,this._parameters=new Gh(O),v&&n(S,this);const{activeInputs:A}=r(this);h(C,A)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(p){const g=typeof p=="function"?f(this,p):null;this._nativeAudioWorkletNode.onprocessorerror=g;const y=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=y!==null&&y===g?p:y}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function uo(n,e,t,s,i){if(typeof n.copyFromChannel=="function")e[t].byteLength===0&&(e[t]=new Float32Array(128)),n.copyFromChannel(e[t],s,i);else{const r=n.getChannelData(s);if(e[t].byteLength===0)e[t]=r.slice(i,i+128);else{const o=new Float32Array(r.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);e[t].set(o)}}}const Yh=(n,e,t,s,i)=>{typeof n.copyToChannel=="function"?e[t].byteLength!==0&&n.copyToChannel(e[t],s,i):e[t].byteLength!==0&&n.getChannelData(s).set(e[t],i)},ho=(n,e)=>{const t=[];for(let s=0;s{const t=Bt(qa,n),s=ke(e);return Bt(t,s)},Gg=async(n,e,t,s,i,r,o)=>{const a=e===null?Math.ceil(n.context.length/128)*128:e.length,c=s.channelCount*s.numberOfInputs,l=i.reduce((g,y)=>g+y,0),u=l===0?null:t.createBuffer(l,a,t.sampleRate);if(r===void 0)throw new Error("Missing the processor constructor.");const h=st(n),d=await Wg(t,n),f=ho(s.numberOfInputs,s.channelCount),m=ho(s.numberOfOutputs,i),p=Array.from(n.parameters.keys()).reduce((g,y)=>({...g,[y]:new Float32Array(128)}),{});for(let g=0;g0&&e!==null)for(let y=0;y{uo(e,p,y,c+w,g)});for(let y=0;yh.activeInputs[v].size===0?[]:S),w=o(g/t.sampleRate,t.sampleRate,()=>d.process(y,m,p));if(u!==null)for(let S=0,v=0;S(g,y,w)=>{const S=new WeakMap;let v=null;const _=async(T,x)=>{let k=u(T),C=null;const E=Je(k,x),O=Array.isArray(y.outputChannelCount)?y.outputChannelCount:Array.from(y.outputChannelCount);if(h===null){const A=O.reduce((N,U)=>N+U,0),R=i(x,{channelCount:Math.max(1,A),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,A)}),P=[];for(let N=0;N{const j=new d(B,Math.ceil(T.context.length/128)*128,x.sampleRate),z=[],Te=[];for(let me=0;me{const Ye=r(j,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:me.value});return await f(j,me,Ye.offset),Ye})),X=s(j,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,U+V)});for(let me=0;mem(T,j,me))),p(j)})(),x,y,O,w,l)}const A=await v,R=t(x,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[P,F,N]=C;A!==null&&(R.buffer=A,R.start(0)),R.connect(P);for(let U=0,V=0;Uclass extends m{constructor(_,T){super(_,T),this._nativeContext=_,this._audioWorklet=n===void 0?void 0:{addModule:(x,k)=>n(this,x,k)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new e(this)}createBiquadFilter(){return new i(this)}createBuffer(_,T,x){return new t({length:T,numberOfChannels:_,sampleRate:x})}createBufferSource(){return new s(this)}createChannelMerger(_=6){return new r(this,{numberOfInputs:_})}createChannelSplitter(_=6){return new o(this,{numberOfOutputs:_})}createConstantSource(){return new a(this)}createConvolver(){return new c(this)}createDelay(_=1){return new u(this,{maxDelayTime:_})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(_,T){return new f(this,{feedback:T,feedforward:_})}createOscillator(){return new p(this)}createPanner(){return new g(this)}createPeriodicWave(_,T,x={disableNormalization:!1}){return new y(this,{...x,imag:T,real:_})}createStereoPanner(){return new w(this)}createWaveShaper(){return new S(this)}decodeAudioData(_,T,x){return l(this._nativeContext,_).then(k=>(typeof T=="function"&&T(k),k),k=>{throw typeof x=="function"&&x(k),k})}},Xg={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},$g=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d={...Xg,...u},f=i(h,d),m=o(h),p=m?t():null;super(l,!1,f,p),this._Q=e(this,m,f.Q,et,at),this._detune=e(this,m,f.detune,1200*Math.log2(et),-1200*Math.log2(et)),this._frequency=e(this,m,f.frequency,l.sampleRate/2,0),this._gain=e(this,m,f.gain,40*Math.log10(et),at),this._nativeBiquadFilterNode=f,a(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(l){this._nativeBiquadFilterNode.type=l}getFrequencyResponse(l,u,h){try{this._nativeBiquadFilterNode.getFrequencyResponse(l,u,h)}catch(d){throw d.code===11?s():d}if(l.length!==u.length||u.length!==h.length)throw s()}},Qg=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=Je(l,c);if(!u){const h={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=e(c,h)}return r.set(c,l),u?(await n(c,a.Q,l.Q),await n(c,a.detune,l.detune),await n(c,a.frequency,l.frequency),await n(c,a.gain,l.gain)):(await s(c,a.Q,l.Q),await s(c,a.detune,l.detune),await s(c,a.frequency,l.frequency),await s(c,a.gain,l.gain)),await i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},Kg=(n,e)=>(t,s)=>{const i=e.get(t);if(i!==void 0)return i;const r=n.get(t);if(r!==void 0)return r;try{const o=s();return o instanceof Promise?(n.set(t,o),o.catch(()=>!1).then(a=>(n.delete(t),e.set(t,a),a))):(e.set(t,o),o)}catch{return e.set(t,!1),!1}},Jg={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},e1=(n,e,t,s,i)=>class extends n{constructor(o,a){const c=s(o),l={...Jg,...a},u=t(c,l),h=i(c)?e():null;super(o,!1,u,h)}},t1=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!Je(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=n(o,l)}return s.set(o,a),await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},s1={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},n1=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=s(a),u=r({...s1,...c}),h=t(l,u),d=i(l)?e():null;super(a,!1,h,d)}},i1=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!Je(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=n(o,l)}return s.set(o,a),await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},r1=n=>(e,t,s)=>n(t,e,s),o1=n=>(e,t,s=0,i=0)=>{const r=e[s];if(r===void 0)throw n();return lo(t)?r.connect(t,0,i):r.connect(t,0)},a1=n=>(e,t)=>{const s=n(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),i=e.createBuffer(1,2,44100);return s.buffer=i,s.loop=!0,s.connect(t),s.start(),()=>{s.stop(),s.disconnect(t)}},c1={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},l1=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...c1,...l},d=s(u,h),f=r(u),m=f?t():null;super(c,!1,d,m),this._constantSourceNodeRenderer=m,this._nativeConstantSourceNode=d,this._offset=e(this,f,d.offset,et,at),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(c){const l=typeof c=="function"?o(this,c):null;this._nativeConstantSourceNode.onended=l;const u=this._nativeConstantSourceNode.onended;this._onended=u!==null&&u===l?c:u}start(c=0){if(this._nativeConstantSourceNode.start(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.start=c),this.context.state!=="closed"){si(this);const l=()=>{this._nativeConstantSourceNode.removeEventListener("ended",l),ms(this)&&gr(this)};this._nativeConstantSourceNode.addEventListener("ended",l)}}stop(c=0){this._nativeConstantSourceNode.stop(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=c)}},u1=(n,e,t,s,i)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=t(l);const d=Je(h,u);if(!d){const f={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,offset:h.offset.value};h=e(u,f),o!==null&&h.start(o),a!==null&&h.stop(a)}return r.set(u,h),d?await n(u,l.offset,h.offset):await s(u,l.offset,h.offset),await i(l,u,h),h};return{set start(l){o=l},set stop(l){a=l},render(l,u){const h=r.get(u);return h!==void 0?Promise.resolve(h):c(l,u)}}},h1=n=>e=>(n[0]=e,n[0]),d1={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},f1=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=s(a),u={...d1,...c},h=t(l,u),f=i(l)?e():null;super(a,!1,h,f),this._isBufferNullified=!1,this._nativeConvolverNode=h,u.buffer!==null&&r(this,u.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(a){if(this._nativeConvolverNode.buffer=a,a===null&&this._nativeConvolverNode.buffer!==null){const c=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=c.createBuffer(1,1,c.sampleRate),this._isBufferNullified=!0,r(this,0)}else this._isBufferNullified=!1,r(this,this._nativeConvolverNode.buffer===null?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(a){this._nativeConvolverNode.normalize=a}},p1=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!Je(a,o)){const l={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=n(o,l)}return s.set(o,a),li(a)?await t(r,o,a.inputs[0]):await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},m1=(n,e)=>(t,s,i)=>{if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new e(t,s,i)}catch(r){throw r.name==="SyntaxError"?n():r}},_1=()=>new DOMException("","DataCloneError"),Ql=n=>{const{port1:e,port2:t}=new MessageChannel;return new Promise(s=>{const i=()=>{t.onmessage=null,e.close(),t.close(),s()};t.onmessage=()=>i();try{e.postMessage(n,[n])}catch{}finally{i()}})},g1=(n,e,t,s,i,r,o,a,c,l,u)=>(h,d)=>{const f=o(h)?h:r(h);if(i.has(d)){const m=t();return Promise.reject(m)}try{i.add(d)}catch{}return e(c,()=>c(f))?f.decodeAudioData(d).then(m=>(Ql(d).catch(()=>{}),e(a,()=>a(m))||u(m),n.add(m),m)):new Promise((m,p)=>{const g=async()=>{try{await Ql(d)}catch{}},y=w=>{p(w),g()};try{f.decodeAudioData(d,w=>{typeof w.copyFromChannel!="function"&&(l(w),bc(w)),n.add(w),g().then(()=>m(w))},w=>{y(w===null?s():w)})}catch(w){y(w)}})},v1=(n,e,t,s,i,r,o,a)=>(c,l)=>{const u=e.get(c);if(u===void 0)throw new Error("Missing the expected cycle count.");const h=r(c.context),d=a(h);if(u===l){if(e.delete(c),!d&&o(c)){const f=s(c),{outputs:m}=t(c);for(const p of m)if(yr(p)){const g=s(p[0]);n(f,g,p[1],p[2])}else{const g=i(p[0]);f.connect(g,p[1])}}}else e.set(c,u-l)},y1={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},x1=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...y1,...l},d=s(u,h),f=r(u),m=f?t(h.maxDelayTime):null;super(c,!1,d,m),this._delayTime=e(this,f,d.delayTime),o(this,h.maxDelayTime)}get delayTime(){return this._delayTime}},T1=(n,e,t,s,i)=>r=>{const o=new WeakMap,a=async(c,l)=>{let u=t(c);const h=Je(u,l);if(!h){const d={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:r};u=e(l,d)}return o.set(l,u),h?await n(l,c.delayTime,u.delayTime):await s(l,c.delayTime,u.delayTime),await i(c,l,u),u};return{render(c,l){const u=o.get(l);return u!==void 0?Promise.resolve(u):a(c,l)}}},k1=n=>(e,t,s,i)=>n(e[i],r=>r[0]===t&&r[1]===s),w1=n=>(e,t)=>{n(e).delete(t)},S1=n=>"delayTime"in n,C1=(n,e,t)=>function s(i,r){const o=oo(r)?r:t(n,r);if(S1(o))return[];if(i[0]===o)return[i];if(i.includes(o))return[];const{outputs:a}=e(o);return Array.from(a).map(c=>s([...i,o],c[0])).reduce((c,l)=>c.concat(l),[])},Lr=(n,e,t)=>{const s=e[t];if(s===void 0)throw n();return s},b1=n=>(e,t=void 0,s=void 0,i=0)=>t===void 0?e.forEach(r=>r.disconnect()):typeof t=="number"?Lr(n,e,t).disconnect():lo(t)?s===void 0?e.forEach(r=>r.disconnect(t)):i===void 0?Lr(n,e,s).disconnect(t,0):Lr(n,e,s).disconnect(t,0,i):s===void 0?e.forEach(r=>r.disconnect(t)):Lr(n,e,s).disconnect(t,0),E1={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},O1=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d={...E1,...u},f=s(h,d),m=o(h),p=m?t():null;super(l,!1,f,p),this._attack=e(this,m,f.attack),this._knee=e(this,m,f.knee),this._nativeDynamicsCompressorNode=f,this._ratio=e(this,m,f.ratio),this._release=e(this,m,f.release),this._threshold=e(this,m,f.threshold),a(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(l){const u=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=l,l>2)throw this._nativeDynamicsCompressorNode.channelCount=u,i()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(l){const u=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=l,l==="max")throw this._nativeDynamicsCompressorNode.channelCountMode=u,i()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return typeof this._nativeDynamicsCompressorNode.reduction.value=="number"?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}},A1=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=Je(l,c);if(!u){const h={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=e(c,h)}return r.set(c,l),u?(await n(c,a.attack,l.attack),await n(c,a.knee,l.knee),await n(c,a.ratio,l.ratio),await n(c,a.release,l.release),await n(c,a.threshold,l.threshold)):(await s(c,a.attack,l.attack),await s(c,a.knee,l.knee),await s(c,a.ratio,l.ratio),await s(c,a.release,l.release),await s(c,a.threshold,l.threshold)),await i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},M1=()=>new DOMException("","EncodingError"),D1=n=>e=>new Promise((t,s)=>{if(n===null){s(new SyntaxError);return}const i=n.document.head;if(i===null)s(new SyntaxError);else{const r=n.document.createElement("script"),o=new Blob([e],{type:"application/javascript"}),a=URL.createObjectURL(o),c=n.onerror,l=()=>{n.onerror=c,URL.revokeObjectURL(a)};n.onerror=(u,h,d,f,m)=>{if(h===a||h===n.location.href&&d===1&&f===1)return l(),s(m),!1;if(c!==null)return c(u,h,d,f,m)},r.onerror=()=>{l(),s(new SyntaxError)},r.onload=()=>{l(),t()},r.src=a,r.type="module",i.appendChild(r)}}),R1=n=>class{constructor(t){this._nativeEventTarget=t,this._listeners=new WeakMap}addEventListener(t,s,i){if(s!==null){let r=this._listeners.get(s);r===void 0&&(r=n(this,s),typeof s=="function"&&this._listeners.set(s,r)),this._nativeEventTarget.addEventListener(t,r,i)}}dispatchEvent(t){return this._nativeEventTarget.dispatchEvent(t)}removeEventListener(t,s,i){const r=s===null?void 0:this._listeners.get(s);this._nativeEventTarget.removeEventListener(t,r===void 0?null:r,i)}},P1=n=>(e,t,s)=>{Object.defineProperties(n,{currentFrame:{configurable:!0,get(){return Math.round(e*t)}},currentTime:{configurable:!0,get(){return e}}});try{return s()}finally{n!==null&&(delete n.currentFrame,delete n.currentTime)}},I1=n=>async e=>{try{const t=await fetch(e);if(t.ok)return[await t.text(),t.url]}catch{}throw n()},N1={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},F1=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=i(a),u={...N1,...c},h=s(l,u),d=r(l),f=d?t():null;super(a,!1,h,f),this._gain=e(this,d,h.gain,et,at)}get gain(){return this._gain}},U1=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=Je(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=e(c,h)}return r.set(c,l),u?await n(c,a.gain,l.gain):await s(c,a.gain,l.gain),await i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},L1=(n,e)=>t=>e(n,t),z1=n=>e=>{const t=n(e);if(t.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return t.renderer},B1=n=>e=>{var t;return(t=n.get(e))!==null&&t!==void 0?t:0},V1=n=>e=>{const t=n(e);if(t.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return t.renderer},j1=n=>e=>n.get(e),We=()=>new DOMException("","InvalidStateError"),H1=n=>e=>{const t=n.get(e);if(t===void 0)throw We();return t},q1=(n,e)=>t=>{let s=n.get(t);if(s!==void 0)return s;if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new e(1,1,44100),n.set(t,s),s},W1=n=>e=>{const t=n.get(e);if(t===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return t},Uo=()=>new DOMException("","InvalidAccessError"),G1=n=>{n.getFrequencyResponse=(e=>(t,s,i)=>{if(t.length!==s.length||s.length!==i.length)throw Uo();return e.call(n,t,s,i)})(n.getFrequencyResponse)},Y1={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},Z1=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=s(a),u=i(l),h={...Y1,...c},d=e(l,u?null:a.baseLatency,h),f=u?t(h.feedback,h.feedforward):null;super(a,!1,d,f),G1(d),this._nativeIIRFilterNode=d,r(this,1)}getFrequencyResponse(a,c,l){return this._nativeIIRFilterNode.getFrequencyResponse(a,c,l)}},Zh=(n,e,t,s,i,r,o,a,c,l,u)=>{const h=l.length;let d=a;for(let f=0;f{const i=t instanceof Float64Array?t:new Float64Array(t),r=s instanceof Float64Array?s:new Float64Array(s),o=i.length,a=r.length,c=Math.min(o,a);if(i[0]!==1){for(let m=0;m(r,o)=>{const a=new WeakMap;let c=null;const l=async(u,h)=>{let d=null,f=e(u);const m=Je(f,h);if(h.createIIRFilter===void 0?d=n(h,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):m||(f=h.createIIRFilter(o,r)),a.set(h,d===null?f:d),d!==null){if(c===null){if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");const g=new t(u.context.destination.channelCount,u.context.length,h.sampleRate);c=(async()=>{await s(u,g,g.destination);const y=await i(g);return X1(y,h,r,o)})()}const p=await c;return d.buffer=p,d.start(0),d}return await s(u,h,f),f};return{render(u,h){const d=a.get(h);return d!==void 0?Promise.resolve(d):l(u,h)}}},Q1=(n,e,t,s,i,r)=>o=>(a,c)=>{const l=n.get(a);if(l===void 0){if(!o&&r(a)){const u=s(a),{outputs:h}=t(a);for(const d of h)if(yr(d)){const f=s(d[0]);e(u,f,d[1],d[2])}else{const f=i(d[0]);u.disconnect(f,d[1])}}n.set(a,c)}else n.set(a,l+c)},K1=(n,e)=>t=>{const s=n.get(t);return e(s)||e(t)},J1=(n,e)=>t=>n.has(t)||e(t),ev=(n,e)=>t=>n.has(t)||e(t),tv=(n,e)=>t=>{const s=n.get(t);return e(s)||e(t)},sv=n=>e=>n!==null&&e instanceof n,nv=n=>e=>n!==null&&typeof n.AudioNode=="function"&&e instanceof n.AudioNode,iv=n=>e=>n!==null&&typeof n.AudioParam=="function"&&e instanceof n.AudioParam,rv=(n,e)=>t=>n(t)||e(t),ov=n=>e=>n!==null&&e instanceof n,av=n=>n!==null&&n.isSecureContext,cv=(n,e,t,s)=>class extends n{constructor(r,o){const a=t(r),c=e(a,o);if(s(a))throw TypeError();super(r,!0,c,null),this._nativeMediaElementAudioSourceNode=c}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},lv={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},uv=(n,e,t,s)=>class extends n{constructor(r,o){const a=t(r);if(s(a))throw new TypeError;const c={...lv,...o},l=e(a,c);super(r,!1,l,null),this._nativeMediaStreamAudioDestinationNode=l}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},hv=(n,e,t,s)=>class extends n{constructor(r,o){const a=t(r),c=e(a,o);if(s(a))throw new TypeError;super(r,!0,c,null),this._nativeMediaStreamAudioSourceNode=c}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},dv=(n,e,t)=>class extends n{constructor(i,r){const o=t(i),a=e(o,r);super(i,!0,a,null)}},fv=(n,e,t,s,i,r)=>class extends t{constructor(a,c){super(a),this._nativeContext=a,No.set(this,a),s(a)&&i.set(a,new Set),this._destination=new n(this,c),this._listener=e(this,a),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(a){const c=typeof a=="function"?r(this,a):null;this._nativeContext.onstatechange=c;const l=this._nativeContext.onstatechange;this._onstatechange=l!==null&&l===c?a:l}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},Zi=n=>{const e=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const t=n.decodeAudioData(e.buffer,()=>{});return t===void 0?!1:(t.catch(()=>{}),!0)}catch{}return!1},pv=(n,e)=>(t,s,i)=>{const r=new Set;return t.connect=(o=>(a,c=0,l=0)=>{const u=r.size===0;if(e(a))return o.call(t,a,c,l),n(r,[a,c,l],h=>h[0]===a&&h[1]===c&&h[2]===l,!0),u&&s(),a;o.call(t,a,c),n(r,[a,c],h=>h[0]===a&&h[1]===c,!0),u&&s()})(t.connect),t.disconnect=(o=>(a,c,l)=>{const u=r.size>0;if(a===void 0)o.apply(t),r.clear();else if(typeof a=="number"){o.call(t,a);for(const d of r)d[1]===a&&r.delete(d)}else{e(a)?o.call(t,a,c,l):o.call(t,a,c);for(const d of r)d[0]===a&&(c===void 0||d[1]===c)&&(l===void 0||d[2]===l)&&r.delete(d)}const h=r.size===0;u&&h&&i()})(t.disconnect),t},we=(n,e,t)=>{const s=e[t];s!==void 0&&s!==n[t]&&(n[t]=s)},Be=(n,e)=>{we(n,e,"channelCount"),we(n,e,"channelCountMode"),we(n,e,"channelInterpretation")},Kl=n=>typeof n.getFloatTimeDomainData=="function",mv=n=>{n.getFloatTimeDomainData=e=>{const t=new Uint8Array(e.length);n.getByteTimeDomainData(t);const s=Math.max(t.length,n.fftSize);for(let i=0;i(t,s)=>{const i=t.createAnalyser();if(Be(i,s),!(s.maxDecibels>s.minDecibels))throw e();return we(i,s,"fftSize"),we(i,s,"maxDecibels"),we(i,s,"minDecibels"),we(i,s,"smoothingTimeConstant"),n(Kl,()=>Kl(i))||mv(i),i},gv=n=>n===null?null:n.hasOwnProperty("AudioBuffer")?n.AudioBuffer:null,Me=(n,e,t)=>{const s=e[t];s!==void 0&&s!==n[t].value&&(n[t].value=s)},vv=n=>{n.start=(e=>{let t=!1;return(s=0,i=0,r)=>{if(t)throw We();e.call(n,s,i,r),t=!0}})(n.start)},Ac=n=>{n.start=(e=>(t=0,s=0,i)=>{if(typeof i=="number"&&i<0||s<0||t<0)throw new RangeError("The parameters can't be negative.");e.call(n,t,s,i)})(n.start)},Mc=n=>{n.stop=(e=>(t=0)=>{if(t<0)throw new RangeError("The parameter can't be negative.");e.call(n,t)})(n.stop)},yv=(n,e,t,s,i,r,o,a,c,l,u)=>(h,d)=>{const f=h.createBufferSource();return Be(f,d),Me(f,d,"playbackRate"),we(f,d,"buffer"),we(f,d,"loop"),we(f,d,"loopEnd"),we(f,d,"loopStart"),e(t,()=>t(h))||vv(f),e(s,()=>s(h))||c(f),e(i,()=>i(h))||l(f,h),e(r,()=>r(h))||Ac(f),e(o,()=>o(h))||u(f,h),e(a,()=>a(h))||Mc(f),n(h,f),f},xv=n=>n===null?null:n.hasOwnProperty("AudioContext")?n.AudioContext:n.hasOwnProperty("webkitAudioContext")?n.webkitAudioContext:null,Tv=(n,e)=>(t,s,i)=>{const r=t.destination;if(r.channelCount!==s)try{r.channelCount=s}catch{}i&&r.channelCountMode!=="explicit"&&(r.channelCountMode="explicit"),r.maxChannelCount===0&&Object.defineProperty(r,"maxChannelCount",{value:s});const o=n(t,{channelCount:s,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,gain:1});return e(o,"channelCount",a=>()=>a.call(o),a=>c=>{a.call(o,c);try{r.channelCount=c}catch(l){if(c>r.maxChannelCount)throw l}}),e(o,"channelCountMode",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelCountMode=c}),e(o,"channelInterpretation",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelInterpretation=c}),Object.defineProperty(o,"maxChannelCount",{get:()=>r.maxChannelCount}),o.connect(r),o},kv=n=>n===null?null:n.hasOwnProperty("AudioWorkletNode")?n.AudioWorkletNode:null,wv=n=>{const{port1:e}=new MessageChannel;try{e.postMessage(n)}finally{e.close()}},Sv=(n,e,t,s,i)=>(r,o,a,c,l,u)=>{if(a!==null)try{const h=new a(r,c,u),d=new Map;let f=null;if(Object.defineProperties(h,{channelCount:{get:()=>u.channelCount,set:()=>{throw n()}},channelCountMode:{get:()=>"explicit",set:()=>{throw n()}},onprocessorerror:{get:()=>f,set:m=>{typeof f=="function"&&h.removeEventListener("processorerror",f),f=typeof m=="function"?m:null,typeof f=="function"&&h.addEventListener("processorerror",f)}}}),h.addEventListener=(m=>(...p)=>{if(p[0]==="processorerror"){const g=typeof p[1]=="function"?p[1]:typeof p[1]=="object"&&p[1]!==null&&typeof p[1].handleEvent=="function"?p[1].handleEvent:null;if(g!==null){const y=d.get(p[1]);y!==void 0?p[1]=y:(p[1]=w=>{w.type==="error"?(Object.defineProperties(w,{type:{value:"processorerror"}}),g(w)):g(new ErrorEvent(p[0],{...w}))},d.set(g,p[1]))}}return m.call(h,"error",p[1],p[2]),m.call(h,...p)})(h.addEventListener),h.removeEventListener=(m=>(...p)=>{if(p[0]==="processorerror"){const g=d.get(p[1]);g!==void 0&&(d.delete(p[1]),p[1]=g)}return m.call(h,"error",p[1],p[2]),m.call(h,p[0],p[1],p[2])})(h.removeEventListener),u.numberOfOutputs!==0){const m=t(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return h.connect(m).connect(r.destination),i(h,()=>m.disconnect(),()=>m.connect(r.destination))}return h}catch(h){throw h.code===11?s():h}if(l===void 0)throw s();return wv(u),e(r,o,l,u)},Xh=(n,e)=>n===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(n*e))))),Cv=n=>new Promise((e,t)=>{const{port1:s,port2:i}=new MessageChannel;s.onmessage=({data:r})=>{s.close(),i.close(),e(r)},s.onmessageerror=({data:r})=>{s.close(),i.close(),t(r)},i.postMessage(n)}),bv=async(n,e)=>{const t=await Cv(e);return new n(t)},Ev=(n,e,t,s)=>{let i=qa.get(n);i===void 0&&(i=new WeakMap,qa.set(n,i));const r=bv(t,s);return i.set(e,r),r},Ov=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>(f,m,p,g)=>{if(g.numberOfInputs===0&&g.numberOfOutputs===0)throw c();const y=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(y.some(L=>L<1))throw c();if(y.length!==g.numberOfOutputs)throw e();if(g.channelCountMode!=="explicit")throw c();const w=g.channelCount*g.numberOfInputs,S=y.reduce((L,Y)=>L+Y,0),v=p.parameterDescriptors===void 0?0:p.parameterDescriptors.length;if(w+v>6||S>6)throw c();const _=new MessageChannel,T=[],x=[];for(let L=0;LL===void 0?0:L},maxValue:{get:()=>Y===void 0?et:Y},minValue:{get:()=>ze===void 0?at:ze}}),k.push(re)}const C=s(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,w+v)}),E=Xh(m,f.sampleRate),O=a(f,E,w+v,Math.max(1,S)),A=i(f,{channelCount:Math.max(1,S),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,S)}),R=[];for(let L=0;L{const ze=k[Y];return ze.connect(C,0,w+Y),ze.start(0),[L,ze.offset]}));C.connect(O);let F=g.channelInterpretation,N=null;const U=g.numberOfOutputs===0?[O]:R,V={get bufferSize(){return E},get channelCount(){return g.channelCount},set channelCount(L){throw t()},get channelCountMode(){return g.channelCountMode},set channelCountMode(L){throw t()},get channelInterpretation(){return F},set channelInterpretation(L){for(const Y of T)Y.channelInterpretation=L;F=L},get context(){return O.context},get inputs(){return T},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return N},set onprocessorerror(L){typeof N=="function"&&V.removeEventListener("processorerror",N),N=typeof L=="function"?L:null,typeof N=="function"&&V.addEventListener("processorerror",N)},get parameters(){return P},get port(){return _.port2},addEventListener(...L){return O.addEventListener(L[0],L[1],L[2])},connect:n.bind(null,U),disconnect:l.bind(null,U),dispatchEvent(...L){return O.dispatchEvent(L[0])},removeEventListener(...L){return O.removeEventListener(L[0],L[1],L[2])}},B=new Map;_.port1.addEventListener=(L=>(...Y)=>{if(Y[0]==="message"){const ze=typeof Y[1]=="function"?Y[1]:typeof Y[1]=="object"&&Y[1]!==null&&typeof Y[1].handleEvent=="function"?Y[1].handleEvent:null;if(ze!==null){const Se=B.get(Y[1]);Se!==void 0?Y[1]=Se:(Y[1]=re=>{u(f.currentTime,f.sampleRate,()=>ze(re))},B.set(ze,Y[1]))}}return L.call(_.port1,Y[0],Y[1],Y[2])})(_.port1.addEventListener),_.port1.removeEventListener=(L=>(...Y)=>{if(Y[0]==="message"){const ze=B.get(Y[1]);ze!==void 0&&(B.delete(Y[1]),Y[1]=ze)}return L.call(_.port1,Y[0],Y[1],Y[2])})(_.port1.removeEventListener);let q=null;Object.defineProperty(_.port1,"onmessage",{get:()=>q,set:L=>{typeof q=="function"&&_.port1.removeEventListener("message",q),q=typeof L=="function"?L:null,typeof q=="function"&&(_.port1.addEventListener("message",q),_.port1.start())}}),p.prototype.port=_.port1;let j=null;Ev(f,V,p,g).then(L=>j=L);const Te=ho(g.numberOfInputs,g.channelCount),ae=ho(g.numberOfOutputs,y),X=p.parameterDescriptors===void 0?[]:p.parameterDescriptors.reduce((L,{name:Y})=>({...L,[Y]:new Float32Array(128)}),{});let me=!0;const Ye=()=>{g.numberOfOutputs>0&&O.disconnect(A);for(let L=0,Y=0;L{if(j!==null){const ze=h(V);for(let Se=0;Se{uo(L,X,re,w+Oe,Se)});for(let re=0;re{if(ze[bs].size>0)return H.set(bs,E/128),St;const Xo=H.get(bs);return Xo===void 0?[]:(St.every(Zd=>Zd.every(Xd=>Xd===0))&&(Xo===1?H.delete(bs):H.set(bs,Xo-1)),St)});me=u(f.currentTime+Se/f.sampleRate,f.sampleRate,()=>j.process(re,ae,X));for(let St=0,bs=0;StO.connect(Ks).connect(f.destination),On=()=>{O.disconnect(Ks),Ks.disconnect()},Gd=()=>{if(me){On(),g.numberOfOutputs>0&&O.connect(A);for(let L=0,Y=0;L{me&&(En(),Ye()),Qs=!1};return En(),d(V,Gd,Yd)},$h=(n,e)=>{const t=n.createBiquadFilter();return Be(t,e),Me(t,e,"Q"),Me(t,e,"detune"),Me(t,e,"frequency"),Me(t,e,"gain"),we(t,e,"type"),t},Av=(n,e)=>(t,s)=>{const i=t.createChannelMerger(s.numberOfInputs);return n!==null&&n.name==="webkitAudioContext"&&e(t,i),Be(i,s),i},Mv=n=>{const e=n.numberOfOutputs;Object.defineProperty(n,"channelCount",{get:()=>e,set:t=>{if(t!==e)throw We()}}),Object.defineProperty(n,"channelCountMode",{get:()=>"explicit",set:t=>{if(t!=="explicit")throw We()}}),Object.defineProperty(n,"channelInterpretation",{get:()=>"discrete",set:t=>{if(t!=="discrete")throw We()}})},xr=(n,e)=>{const t=n.createChannelSplitter(e.numberOfOutputs);return Be(t,e),Mv(t),t},Dv=(n,e,t,s,i)=>(r,o)=>{if(r.createConstantSource===void 0)return t(r,o);const a=r.createConstantSource();return Be(a,o),Me(a,o,"offset"),e(s,()=>s(r))||Ac(a),e(i,()=>i(r))||Mc(a),n(r,a),a},ui=(n,e)=>(n.connect=e.connect.bind(e),n.disconnect=e.disconnect.bind(e),n),Rv=(n,e,t,s)=>(i,{offset:r,...o})=>{const a=i.createBuffer(1,2,44100),c=e(i,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),l=t(i,{...o,gain:r}),u=a.getChannelData(0);u[0]=1,u[1]=1,c.buffer=a,c.loop=!0;const h={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(m){l.channelCount=m},get channelCountMode(){return l.channelCountMode},set channelCountMode(m){l.channelCountMode=m},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(m){l.channelInterpretation=m},get context(){return l.context},get inputs(){return[]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return l.numberOfOutputs},get offset(){return l.gain},get onended(){return c.onended},set onended(m){c.onended=m},addEventListener(...m){return c.addEventListener(m[0],m[1],m[2])},dispatchEvent(...m){return c.dispatchEvent(m[0])},removeEventListener(...m){return c.removeEventListener(m[0],m[1],m[2])},start(m=0){c.start.call(c,m)},stop(m=0){c.stop.call(c,m)}},d=()=>c.connect(l),f=()=>c.disconnect(l);return n(i,c),s(ui(h,l),d,f)},Pv=(n,e)=>(t,s)=>{const i=t.createConvolver();if(Be(i,s),s.disableNormalization===i.normalize&&(i.normalize=!s.disableNormalization),we(i,s,"buffer"),s.channelCount>2||(e(i,"channelCount",r=>()=>r.call(i),r=>o=>{if(o>2)throw n();return r.call(i,o)}),s.channelCountMode==="max"))throw n();return e(i,"channelCountMode",r=>()=>r.call(i),r=>o=>{if(o==="max")throw n();return r.call(i,o)}),i},Qh=(n,e)=>{const t=n.createDelay(e.maxDelayTime);return Be(t,e),Me(t,e,"delayTime"),t},Iv=n=>(e,t)=>{const s=e.createDynamicsCompressor();if(Be(s,t),t.channelCount>2||t.channelCountMode==="max")throw n();return Me(s,t,"attack"),Me(s,t,"knee"),Me(s,t,"ratio"),Me(s,t,"release"),Me(s,t,"threshold"),s},pt=(n,e)=>{const t=n.createGain();return Be(t,e),Me(t,e,"gain"),t},Nv=n=>(e,t,s)=>{if(e.createIIRFilter===void 0)return n(e,t,s);const i=e.createIIRFilter(s.feedforward,s.feedback);return Be(i,s),i};function Fv(n,e){const t=e[0]*e[0]+e[1]*e[1];return[(n[0]*e[0]+n[1]*e[1])/t,(n[1]*e[0]-n[0]*e[1])/t]}function Uv(n,e){return[n[0]*e[0]-n[1]*e[1],n[0]*e[1]+n[1]*e[0]]}function Jl(n,e){let t=[0,0];for(let s=n.length-1;s>=0;s-=1)t=Uv(t,e),t[0]+=n[s];return t}const Lv=(n,e,t,s)=>(i,r,{channelCount:o,channelCountMode:a,channelInterpretation:c,feedback:l,feedforward:u})=>{const h=Xh(r,i.sampleRate),d=l instanceof Float64Array?l:new Float64Array(l),f=u instanceof Float64Array?u:new Float64Array(u),m=d.length,p=f.length,g=Math.min(m,p);if(m===0||m>20)throw s();if(d[0]===0)throw e();if(p===0||p>20)throw s();if(f[0]===0)throw e();if(d[0]!==1){for(let k=0;k{const C=k.inputBuffer,E=k.outputBuffer,O=C.numberOfChannels;for(let A=0;An.createMediaElementSource(e.mediaElement),Bv=(n,e)=>{const t=n.createMediaStreamDestination();return Be(t,e),t.numberOfOutputs===1&&Object.defineProperty(t,"numberOfOutputs",{get:()=>0}),t},Vv=(n,{mediaStream:e})=>{const t=e.getAudioTracks();t.sort((r,o)=>r.ido.id?1:0);const s=t.slice(0,1),i=n.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(i,"mediaStream",{value:e}),i},jv=(n,e)=>(t,{mediaStreamTrack:s})=>{if(typeof t.createMediaStreamTrackSource=="function")return t.createMediaStreamTrackSource(s);const i=new MediaStream([s]),r=t.createMediaStreamSource(i);if(s.kind!=="audio")throw n();if(e(t))throw new TypeError;return r},Hv=n=>n===null?null:n.hasOwnProperty("OfflineAudioContext")?n.OfflineAudioContext:n.hasOwnProperty("webkitOfflineAudioContext")?n.webkitOfflineAudioContext:null,qv=(n,e,t,s,i,r)=>(o,a)=>{const c=o.createOscillator();return Be(c,a),Me(c,a,"detune"),Me(c,a,"frequency"),a.periodicWave!==void 0?c.setPeriodicWave(a.periodicWave):we(c,a,"type"),e(t,()=>t(o))||Ac(c),e(s,()=>s(o))||r(c,o),e(i,()=>i(o))||Mc(c),n(o,c),c},Wv=n=>(e,t)=>{const s=e.createPanner();return s.orientationX===void 0?n(e,t):(Be(s,t),Me(s,t,"orientationX"),Me(s,t,"orientationY"),Me(s,t,"orientationZ"),Me(s,t,"positionX"),Me(s,t,"positionY"),Me(s,t,"positionZ"),we(s,t,"coneInnerAngle"),we(s,t,"coneOuterAngle"),we(s,t,"coneOuterGain"),we(s,t,"distanceModel"),we(s,t,"maxDistance"),we(s,t,"panningModel"),we(s,t,"refDistance"),we(s,t,"rolloffFactor"),s)},Gv=(n,e,t,s,i,r,o,a,c,l)=>(u,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:f,distanceModel:m,maxDistance:p,orientationX:g,orientationY:y,orientationZ:w,panningModel:S,positionX:v,positionY:_,positionZ:T,refDistance:x,rolloffFactor:k,...C})=>{const E=u.createPanner();if(C.channelCount>2||C.channelCountMode==="max")throw o();Be(E,C);const O={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},A=t(u,{...O,channelInterpretation:"speakers",numberOfInputs:6}),R=s(u,{...C,gain:1}),P=s(u,{...O,gain:1}),F=s(u,{...O,gain:0}),N=s(u,{...O,gain:0}),U=s(u,{...O,gain:0}),V=s(u,{...O,gain:0}),B=s(u,{...O,gain:0}),q=i(u,256,6,1),j=r(u,{...O,curve:new Float32Array([1,1]),oversample:"none"});let z=[g,y,w],Te=[v,_,T];const ae=new Float32Array(1);q.onaudioprocess=({inputBuffer:H})=>{const Qs=[c(H,ae,0),c(H,ae,1),c(H,ae,2)];Qs.some((En,On)=>En!==z[On])&&(E.setOrientation(...Qs),z=Qs);const Ks=[c(H,ae,3),c(H,ae,4),c(H,ae,5)];Ks.some((En,On)=>En!==Te[On])&&(E.setPosition(...Ks),Te=Ks)},Object.defineProperty(F.gain,"defaultValue",{get:()=>0}),Object.defineProperty(N.gain,"defaultValue",{get:()=>0}),Object.defineProperty(U.gain,"defaultValue",{get:()=>0}),Object.defineProperty(V.gain,"defaultValue",{get:()=>0}),Object.defineProperty(B.gain,"defaultValue",{get:()=>0});const X={get bufferSize(){},get channelCount(){return E.channelCount},set channelCount(H){if(H>2)throw o();R.channelCount=H,E.channelCount=H},get channelCountMode(){return E.channelCountMode},set channelCountMode(H){if(H==="max")throw o();R.channelCountMode=H,E.channelCountMode=H},get channelInterpretation(){return E.channelInterpretation},set channelInterpretation(H){R.channelInterpretation=H,E.channelInterpretation=H},get coneInnerAngle(){return E.coneInnerAngle},set coneInnerAngle(H){E.coneInnerAngle=H},get coneOuterAngle(){return E.coneOuterAngle},set coneOuterAngle(H){E.coneOuterAngle=H},get coneOuterGain(){return E.coneOuterGain},set coneOuterGain(H){if(H<0||H>1)throw e();E.coneOuterGain=H},get context(){return E.context},get distanceModel(){return E.distanceModel},set distanceModel(H){E.distanceModel=H},get inputs(){return[R]},get maxDistance(){return E.maxDistance},set maxDistance(H){if(H<0)throw new RangeError;E.maxDistance=H},get numberOfInputs(){return E.numberOfInputs},get numberOfOutputs(){return E.numberOfOutputs},get orientationX(){return P.gain},get orientationY(){return F.gain},get orientationZ(){return N.gain},get panningModel(){return E.panningModel},set panningModel(H){E.panningModel=H},get positionX(){return U.gain},get positionY(){return V.gain},get positionZ(){return B.gain},get refDistance(){return E.refDistance},set refDistance(H){if(H<0)throw new RangeError;E.refDistance=H},get rolloffFactor(){return E.rolloffFactor},set rolloffFactor(H){if(H<0)throw new RangeError;E.rolloffFactor=H},addEventListener(...H){return R.addEventListener(H[0],H[1],H[2])},dispatchEvent(...H){return R.dispatchEvent(H[0])},removeEventListener(...H){return R.removeEventListener(H[0],H[1],H[2])}};h!==X.coneInnerAngle&&(X.coneInnerAngle=h),d!==X.coneOuterAngle&&(X.coneOuterAngle=d),f!==X.coneOuterGain&&(X.coneOuterGain=f),m!==X.distanceModel&&(X.distanceModel=m),p!==X.maxDistance&&(X.maxDistance=p),g!==X.orientationX.value&&(X.orientationX.value=g),y!==X.orientationY.value&&(X.orientationY.value=y),w!==X.orientationZ.value&&(X.orientationZ.value=w),S!==X.panningModel&&(X.panningModel=S),v!==X.positionX.value&&(X.positionX.value=v),_!==X.positionY.value&&(X.positionY.value=_),T!==X.positionZ.value&&(X.positionZ.value=T),x!==X.refDistance&&(X.refDistance=x),k!==X.rolloffFactor&&(X.rolloffFactor=k),(z[0]!==1||z[1]!==0||z[2]!==0)&&E.setOrientation(...z),(Te[0]!==0||Te[1]!==0||Te[2]!==0)&&E.setPosition(...Te);const me=()=>{R.connect(E),n(R,j,0,0),j.connect(P).connect(A,0,0),j.connect(F).connect(A,0,1),j.connect(N).connect(A,0,2),j.connect(U).connect(A,0,3),j.connect(V).connect(A,0,4),j.connect(B).connect(A,0,5),A.connect(q).connect(u.destination)},Ye=()=>{R.disconnect(E),a(R,j,0,0),j.disconnect(P),P.disconnect(A),j.disconnect(F),F.disconnect(A),j.disconnect(N),N.disconnect(A),j.disconnect(U),U.disconnect(A),j.disconnect(V),V.disconnect(A),j.disconnect(B),B.disconnect(A),A.disconnect(q),q.disconnect(u.destination)};return l(ui(X,E),me,Ye)},Yv=n=>(e,{disableNormalization:t,imag:s,real:i})=>{const r=s instanceof Float32Array?s:new Float32Array(s),o=i instanceof Float32Array?i:new Float32Array(i),a=e.createPeriodicWave(o,r,{disableNormalization:t});if(Array.from(s).length<2)throw n();return a},Tr=(n,e,t,s)=>n.createScriptProcessor(e,t,s),Zv=(n,e)=>(t,s)=>{const i=s.channelCountMode;if(i==="clamped-max")throw e();if(t.createStereoPanner===void 0)return n(t,s);const r=t.createStereoPanner();return Be(r,s),Me(r,s,"pan"),Object.defineProperty(r,"channelCountMode",{get:()=>i,set:o=>{if(o!==i)throw e()}}),r},Xv=(n,e,t,s,i,r)=>{const a=new Float32Array([1,1]),c=Math.PI/2,l={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...l,oversample:"none"},h=(m,p,g,y)=>{const w=new Float32Array(16385),S=new Float32Array(16385);for(let C=0;C<16385;C+=1){const E=C/16384*c;w[C]=Math.cos(E),S[C]=Math.sin(E)}const v=t(m,{...l,gain:0}),_=s(m,{...u,curve:w}),T=s(m,{...u,curve:a}),x=t(m,{...l,gain:0}),k=s(m,{...u,curve:S});return{connectGraph(){p.connect(v),p.connect(T.inputs===void 0?T:T.inputs[0]),p.connect(x),T.connect(g),g.connect(_.inputs===void 0?_:_.inputs[0]),g.connect(k.inputs===void 0?k:k.inputs[0]),_.connect(v.gain),k.connect(x.gain),v.connect(y,0,0),x.connect(y,0,1)},disconnectGraph(){p.disconnect(v),p.disconnect(T.inputs===void 0?T:T.inputs[0]),p.disconnect(x),T.disconnect(g),g.disconnect(_.inputs===void 0?_:_.inputs[0]),g.disconnect(k.inputs===void 0?k:k.inputs[0]),_.disconnect(v.gain),k.disconnect(x.gain),v.disconnect(y,0,0),x.disconnect(y,0,1)}}},d=(m,p,g,y)=>{const w=new Float32Array(16385),S=new Float32Array(16385),v=new Float32Array(16385),_=new Float32Array(16385),T=Math.floor(16385/2);for(let U=0;U<16385;U+=1)if(U>T){const V=(U-T)/(16384-T)*c;w[U]=Math.cos(V),S[U]=Math.sin(V),v[U]=0,_[U]=1}else{const V=U/(16384-T)*c;w[U]=1,S[U]=0,v[U]=Math.cos(V),_[U]=Math.sin(V)}const x=e(m,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),k=t(m,{...l,gain:0}),C=s(m,{...u,curve:w}),E=t(m,{...l,gain:0}),O=s(m,{...u,curve:S}),A=s(m,{...u,curve:a}),R=t(m,{...l,gain:0}),P=s(m,{...u,curve:v}),F=t(m,{...l,gain:0}),N=s(m,{...u,curve:_});return{connectGraph(){p.connect(x),p.connect(A.inputs===void 0?A:A.inputs[0]),x.connect(k,0),x.connect(E,0),x.connect(R,1),x.connect(F,1),A.connect(g),g.connect(C.inputs===void 0?C:C.inputs[0]),g.connect(O.inputs===void 0?O:O.inputs[0]),g.connect(P.inputs===void 0?P:P.inputs[0]),g.connect(N.inputs===void 0?N:N.inputs[0]),C.connect(k.gain),O.connect(E.gain),P.connect(R.gain),N.connect(F.gain),k.connect(y,0,0),R.connect(y,0,0),E.connect(y,0,1),F.connect(y,0,1)},disconnectGraph(){p.disconnect(x),p.disconnect(A.inputs===void 0?A:A.inputs[0]),x.disconnect(k,0),x.disconnect(E,0),x.disconnect(R,1),x.disconnect(F,1),A.disconnect(g),g.disconnect(C.inputs===void 0?C:C.inputs[0]),g.disconnect(O.inputs===void 0?O:O.inputs[0]),g.disconnect(P.inputs===void 0?P:P.inputs[0]),g.disconnect(N.inputs===void 0?N:N.inputs[0]),C.disconnect(k.gain),O.disconnect(E.gain),P.disconnect(R.gain),N.disconnect(F.gain),k.disconnect(y,0,0),R.disconnect(y,0,0),E.disconnect(y,0,1),F.disconnect(y,0,1)}}},f=(m,p,g,y,w)=>{if(p===1)return h(m,g,y,w);if(p===2)return d(m,g,y,w);throw i()};return(m,{channelCount:p,channelCountMode:g,pan:y,...w})=>{if(g==="max")throw i();const S=n(m,{...w,channelCount:1,channelCountMode:g,numberOfInputs:2}),v=t(m,{...w,channelCount:p,channelCountMode:g,gain:1}),_=t(m,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:y});let{connectGraph:T,disconnectGraph:x}=f(m,p,v,_,S);Object.defineProperty(_.gain,"defaultValue",{get:()=>0}),Object.defineProperty(_.gain,"maxValue",{get:()=>1}),Object.defineProperty(_.gain,"minValue",{get:()=>-1});const k={get bufferSize(){},get channelCount(){return v.channelCount},set channelCount(A){v.channelCount!==A&&(C&&x(),{connectGraph:T,disconnectGraph:x}=f(m,A,v,_,S),C&&T()),v.channelCount=A},get channelCountMode(){return v.channelCountMode},set channelCountMode(A){if(A==="clamped-max"||A==="max")throw i();v.channelCountMode=A},get channelInterpretation(){return v.channelInterpretation},set channelInterpretation(A){v.channelInterpretation=A},get context(){return v.context},get inputs(){return[v]},get numberOfInputs(){return v.numberOfInputs},get numberOfOutputs(){return v.numberOfOutputs},get pan(){return _.gain},addEventListener(...A){return v.addEventListener(A[0],A[1],A[2])},dispatchEvent(...A){return v.dispatchEvent(A[0])},removeEventListener(...A){return v.removeEventListener(A[0],A[1],A[2])}};let C=!1;const E=()=>{T(),C=!0},O=()=>{x(),C=!1};return r(ui(k,S),E,O)}},$v=(n,e,t,s,i,r,o)=>(a,c)=>{const l=a.createWaveShaper();if(r!==null&&r.name==="webkitAudioContext"&&a.createGain().gain.automationRate===void 0)return t(a,c);Be(l,c);const u=c.curve===null||c.curve instanceof Float32Array?c.curve:new Float32Array(c.curve);if(u!==null&&u.length<2)throw e();we(l,{curve:u},"curve"),we(l,c,"oversample");let h=null,d=!1;return o(l,"curve",p=>()=>p.call(l),p=>g=>(p.call(l,g),d&&(s(g)&&h===null?h=n(a,l):!s(g)&&h!==null&&(h(),h=null)),g)),i(l,()=>{d=!0,s(l.curve)&&(h=n(a,l))},()=>{d=!1,h!==null&&(h(),h=null)})},Qv=(n,e,t,s,i)=>(r,{curve:o,oversample:a,...c})=>{const l=r.createWaveShaper(),u=r.createWaveShaper();Be(l,c),Be(u,c);const h=t(r,{...c,gain:1}),d=t(r,{...c,gain:-1}),f=t(r,{...c,gain:1}),m=t(r,{...c,gain:-1});let p=null,g=!1,y=null;const w={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(_){h.channelCount=_,d.channelCount=_,l.channelCount=_,f.channelCount=_,u.channelCount=_,m.channelCount=_},get channelCountMode(){return l.channelCountMode},set channelCountMode(_){h.channelCountMode=_,d.channelCountMode=_,l.channelCountMode=_,f.channelCountMode=_,u.channelCountMode=_,m.channelCountMode=_},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(_){h.channelInterpretation=_,d.channelInterpretation=_,l.channelInterpretation=_,f.channelInterpretation=_,u.channelInterpretation=_,m.channelInterpretation=_},get context(){return l.context},get curve(){return y},set curve(_){if(_!==null&&_.length<2)throw e();if(_===null)l.curve=_,u.curve=_;else{const T=_.length,x=new Float32Array(T+2-T%2),k=new Float32Array(T+2-T%2);x[0]=_[0],k[0]=-_[T-1];const C=Math.ceil((T+1)/2),E=(T+1)/2-1;for(let O=1;O{h.connect(l).connect(f),h.connect(d).connect(u).connect(m).connect(f),g=!0,s(y)&&(p=n(r,h))},v=()=>{h.disconnect(l),l.disconnect(f),h.disconnect(d),d.disconnect(u),u.disconnect(m),m.disconnect(f),g=!1,p!==null&&(p(),p=null)};return i(ui(w,f),S,v)},rt=()=>new DOMException("","NotSupportedError"),Kv={numberOfChannels:1},Jv=(n,e,t,s,i)=>class extends n{constructor(o,a,c){let l;if(typeof o=="number"&&a!==void 0&&c!==void 0)l={length:a,numberOfChannels:o,sampleRate:c};else if(typeof o=="object")l=o;else throw new Error("The given parameters are not valid.");const{length:u,numberOfChannels:h,sampleRate:d}={...Kv,...l},f=s(h,u,d);e(Zi,()=>Zi(f))||f.addEventListener("statechange",(()=>{let m=0;const p=g=>{this._state==="running"&&(m>0?(f.removeEventListener("statechange",p),g.stopImmediatePropagation(),this._waitForThePromiseToSettle(g)):m+=1)};return p})()),super(f,h),this._length=u,this._nativeOfflineAudioContext=f,this._state=null}get length(){return this._nativeOfflineAudioContext.length===void 0?this._length:this._nativeOfflineAudioContext.length}get state(){return this._state===null?this._nativeOfflineAudioContext.state:this._state}startRendering(){return this._state==="running"?Promise.reject(t()):(this._state="running",i(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,jh(this)}))}_waitForThePromiseToSettle(o){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(o):setTimeout(()=>this._waitForThePromiseToSettle(o))}},ey={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},ty=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...ey,...l},d=t(u,h),f=r(u),m=f?s():null,p=c.sampleRate/2;super(c,!1,d,m),this._detune=e(this,f,d.detune,153600,-153600),this._frequency=e(this,f,d.frequency,p,-p),this._nativeOscillatorNode=d,this._onended=null,this._oscillatorNodeRenderer=m,this._oscillatorNodeRenderer!==null&&h.periodicWave!==void 0&&(this._oscillatorNodeRenderer.periodicWave=h.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(c){const l=typeof c=="function"?o(this,c):null;this._nativeOscillatorNode.onended=l;const u=this._nativeOscillatorNode.onended;this._onended=u!==null&&u===l?c:u}get type(){return this._nativeOscillatorNode.type}set type(c){this._nativeOscillatorNode.type=c,this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(c){this._nativeOscillatorNode.setPeriodicWave(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=c)}start(c=0){if(this._nativeOscillatorNode.start(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.start=c),this.context.state!=="closed"){si(this);const l=()=>{this._nativeOscillatorNode.removeEventListener("ended",l),ms(this)&&gr(this)};this._nativeOscillatorNode.addEventListener("ended",l)}}stop(c=0){this._nativeOscillatorNode.stop(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=c)}},sy=(n,e,t,s,i)=>()=>{const r=new WeakMap;let o=null,a=null,c=null;const l=async(u,h)=>{let d=t(u);const f=Je(d,h);if(!f){const m={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:o===null?void 0:o,type:d.type};d=e(h,m),a!==null&&d.start(a),c!==null&&d.stop(c)}return r.set(h,d),f?(await n(h,u.detune,d.detune),await n(h,u.frequency,d.frequency)):(await s(h,u.detune,d.detune),await s(h,u.frequency,d.frequency)),await i(u,h,d),d};return{set periodicWave(u){o=u},set start(u){a=u},set stop(u){c=u},render(u,h){const d=r.get(h);return d!==void 0?Promise.resolve(d):l(u,h)}}},ny={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},iy=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...ny,...l},d=t(u,h),f=r(u),m=f?s():null;super(c,!1,d,m),this._nativePannerNode=d,this._orientationX=e(this,f,d.orientationX,et,at),this._orientationY=e(this,f,d.orientationY,et,at),this._orientationZ=e(this,f,d.orientationZ,et,at),this._positionX=e(this,f,d.positionX,et,at),this._positionY=e(this,f,d.positionY,et,at),this._positionZ=e(this,f,d.positionZ,et,at),o(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(c){this._nativePannerNode.coneInnerAngle=c}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(c){this._nativePannerNode.coneOuterAngle=c}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(c){this._nativePannerNode.coneOuterGain=c}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(c){this._nativePannerNode.distanceModel=c}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(c){this._nativePannerNode.maxDistance=c}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(c){this._nativePannerNode.panningModel=c}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(c){this._nativePannerNode.refDistance=c}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(c){this._nativePannerNode.rolloffFactor=c}},ry=(n,e,t,s,i,r,o,a,c,l)=>()=>{const u=new WeakMap;let h=null;const d=async(f,m)=>{let p=null,g=r(f);const y={channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation},w={...y,coneInnerAngle:g.coneInnerAngle,coneOuterAngle:g.coneOuterAngle,coneOuterGain:g.coneOuterGain,distanceModel:g.distanceModel,maxDistance:g.maxDistance,panningModel:g.panningModel,refDistance:g.refDistance,rolloffFactor:g.rolloffFactor},S=Je(g,m);if("bufferSize"in g)p=s(m,{...y,gain:1});else if(!S){const v={...w,orientationX:g.orientationX.value,orientationY:g.orientationY.value,orientationZ:g.orientationZ.value,positionX:g.positionX.value,positionY:g.positionY.value,positionZ:g.positionZ.value};g=i(m,v)}if(u.set(m,p===null?g:p),p!==null){if(h===null){if(o===null)throw new Error("Missing the native OfflineAudioContext constructor.");const O=new o(6,f.context.length,m.sampleRate),A=e(O,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});A.connect(O.destination),h=(async()=>{const R=await Promise.all([f.orientationX,f.orientationY,f.orientationZ,f.positionX,f.positionY,f.positionZ].map(async(P,F)=>{const N=t(O,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:F===0?1:0});return await a(O,P,N.offset),N}));for(let P=0;P<6;P+=1)R[P].connect(A,0,P),R[P].start(0);return l(O)})()}const v=await h,_=s(m,{...y,gain:1});await c(f,m,_);const T=[];for(let O=0;OP!==x[F])||R.some((P,F)=>P!==k[F])){x=A,k=R;const P=O/m.sampleRate;C.gain.setValueAtTime(0,P),C=s(m,{...y,gain:0}),E=i(m,{...w,orientationX:x[0],orientationY:x[1],orientationZ:x[2],positionX:k[0],positionY:k[1],positionZ:k[2]}),C.gain.setValueAtTime(1,P),_.connect(C).connect(E.inputs[0]),E.connect(p)}}return p}return S?(await n(m,f.orientationX,g.orientationX),await n(m,f.orientationY,g.orientationY),await n(m,f.orientationZ,g.orientationZ),await n(m,f.positionX,g.positionX),await n(m,f.positionY,g.positionY),await n(m,f.positionZ,g.positionZ)):(await a(m,f.orientationX,g.orientationX),await a(m,f.orientationY,g.orientationY),await a(m,f.orientationZ,g.orientationZ),await a(m,f.positionX,g.positionX),await a(m,f.positionY,g.positionY),await a(m,f.positionZ,g.positionZ)),li(g)?await c(f,m,g.inputs[0]):await c(f,m,g),g};return{render(f,m){const p=u.get(m);return p!==void 0?Promise.resolve(p):d(f,m)}}},oy={disableNormalization:!1},ay=(n,e,t,s)=>class Kh{constructor(r,o){const a=e(r),c=s({...oy,...o}),l=n(a,c);return t.add(l),l}static[Symbol.hasInstance](r){return r!==null&&typeof r=="object"&&Object.getPrototypeOf(r)===Kh.prototype||t.has(r)}},cy=(n,e)=>(t,s,i)=>(n(s).replay(i),e(s,t,i)),ly=(n,e,t)=>async(s,i,r)=>{const o=n(s);await Promise.all(o.activeInputs.map((a,c)=>Array.from(a).map(async([l,u])=>{const d=await e(l).render(l,i),f=s.context.destination;!t(l)&&(s!==f||!t(s))&&d.connect(r,u,c)})).reduce((a,c)=>[...a,...c],[]))},uy=(n,e,t)=>async(s,i,r)=>{const o=e(s);await Promise.all(Array.from(o.activeInputs).map(async([a,c])=>{const u=await n(a).render(a,i);t(a)||u.connect(r,c)}))},hy=(n,e,t,s)=>i=>n(Zi,()=>Zi(i))?Promise.resolve(n(s,s)).then(r=>{if(!r){const o=t(i,512,0,1);i.oncomplete=()=>{o.onaudioprocess=null,o.disconnect()},o.onaudioprocess=()=>i.currentTime,o.connect(i.destination)}return i.startRendering()}):new Promise(r=>{const o=e(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});i.oncomplete=a=>{o.disconnect(),r(a.renderedBuffer)},o.connect(i.destination),i.startRendering()}),dy=n=>(e,t)=>{n.set(e,t)},fy=n=>(e,t)=>n.set(e,t),py=(n,e,t,s,i,r,o,a)=>(c,l)=>t(c).render(c,l).then(()=>Promise.all(Array.from(s(l)).map(u=>t(u).render(u,l)))).then(()=>i(l)).then(u=>(typeof u.copyFromChannel!="function"?(o(u),bc(u)):e(r,()=>r(u))||a(u),n.add(u),u)),my={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},_y=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=i(a),u={...my,...c},h=t(l,u),d=r(l),f=d?s():null;super(a,!1,h,f),this._pan=e(this,d,h.pan)}get pan(){return this._pan}},gy=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=Je(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=e(c,h)}return r.set(c,l),u?await n(c,a.pan,l.pan):await s(c,a.pan,l.pan),li(l)?await i(a,c,l.inputs[0]):await i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},vy=n=>()=>{if(n===null)return!1;try{new n({length:1,sampleRate:44100})}catch{return!1}return!0},yy=(n,e)=>async()=>{if(n===null)return!0;if(e===null)return!1;const t=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new e(1,128,44100),i=URL.createObjectURL(t);let r=!1,o=!1;try{await s.audioWorklet.addModule(i);const a=new n(s,"a",{numberOfOutputs:0}),c=s.createOscillator();a.port.onmessage=()=>r=!0,a.onprocessorerror=()=>o=!0,c.connect(a),c.start(0),await s.startRendering(),await new Promise(l=>setTimeout(l))}catch{}finally{URL.revokeObjectURL(i)}return r&&!o},xy=(n,e)=>()=>{if(e===null)return Promise.resolve(!1);const t=new e(1,1,44100),s=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(i=>{t.oncomplete=()=>{s.disconnect(),i(t.currentTime!==0)},t.startRendering()})},Ty=()=>new DOMException("","UnknownError"),ky={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},wy=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...ky,...l},d=t(u,h),m=r(u)?s():null;super(c,!0,d,m),this._isCurveNullified=!1,this._nativeWaveShaperNode=d,o(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(c){if(c===null)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(c.length<2)throw e();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=c}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(c){this._nativeWaveShaperNode.oversample=c}},Sy=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!Je(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=n(o,l)}return s.set(o,a),li(a)?await t(r,o,a.inputs[0]):await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},Cy=()=>typeof window>"u"?null:window,by=(n,e)=>t=>{t.copyFromChannel=(s,i,r=0)=>{const o=n(r),a=n(i);if(a>=t.numberOfChannels)throw e();const c=t.length,l=t.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+o{const o=n(r),a=n(i);if(a>=t.numberOfChannels)throw e();const c=t.length,l=t.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+oe=>{e.copyFromChannel=(t=>(s,i,r=0)=>{const o=n(r),a=n(i);if(o(s,i,r=0)=>{const o=n(r),a=n(i);if(o(e,t)=>{const s=t.createBuffer(1,1,44100);e.buffer===null&&(e.buffer=s),n(e,"buffer",i=>()=>{const r=i.call(e);return r===s?null:r},i=>r=>i.call(e,r===null?s:r))},Ay=(n,e)=>(t,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw n()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw n()}});const i=t.createBufferSource();e(s,()=>{const a=s.numberOfInputs;for(let c=0;ci.disconnect(s))},Jh=(n,e,t)=>n.copyFromChannel===void 0?n.getChannelData(t)[0]:(n.copyFromChannel(e,t),e[0]),ed=n=>{if(n===null)return!1;const e=n.length;return e%2!==0?n[Math.floor(e/2)]!==0:n[e/2-1]+n[e/2]!==0},kr=(n,e,t,s)=>{let i=n;for(;!i.hasOwnProperty(e);)i=Object.getPrototypeOf(i);const{get:r,set:o}=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(n,e,{get:t(r),set:s(o)})},My=n=>({...n,outputChannelCount:n.outputChannelCount!==void 0?n.outputChannelCount:n.numberOfInputs===1&&n.numberOfOutputs===1?[n.channelCount]:Array.from({length:n.numberOfOutputs},()=>1)}),Dy=n=>({...n,channelCount:n.numberOfOutputs}),Ry=n=>{const{imag:e,real:t}=n;return e===void 0?t===void 0?{...n,imag:[0,0],real:[0,0]}:{...n,imag:Array.from(t,()=>0),real:t}:t===void 0?{...n,imag:e,real:Array.from(e,()=>0)}:{...n,imag:e,real:t}},td=(n,e,t)=>{try{n.setValueAtTime(e,t)}catch(s){if(s.code!==9)throw s;td(n,e,t+1e-7)}},Py=n=>{const e=n.createBufferSource();e.start();try{e.start()}catch{return!0}return!1},Iy=n=>{const e=n.createBufferSource(),t=n.createBuffer(1,1,44100);e.buffer=t;try{e.start(0,1)}catch{return!1}return!0},Ny=n=>{const e=n.createBufferSource();e.start();try{e.stop()}catch{return!1}return!0},Dc=n=>{const e=n.createOscillator();try{e.start(-1)}catch(t){return t instanceof RangeError}return!1},sd=n=>{const e=n.createBuffer(1,1,44100),t=n.createBufferSource();t.buffer=e,t.start(),t.stop();try{return t.stop(),!0}catch{return!1}},Rc=n=>{const e=n.createOscillator();try{e.stop(-1)}catch(t){return t instanceof RangeError}return!1},Fy=n=>{const{port1:e,port2:t}=new MessageChannel;try{e.postMessage(n)}finally{e.close(),t.close()}},Uy=n=>{n.start=(e=>(t=0,s=0,i)=>{const r=n.buffer,o=r===null?s:Math.min(r.duration,s);r!==null&&o>r.duration-.5/n.context.sampleRate?e.call(n,t,0,0):e.call(n,t,o,i)})(n.start)},nd=(n,e)=>{const t=e.createGain();n.connect(t);const s=(i=>()=>{i.call(n,t),n.removeEventListener("ended",s)})(n.disconnect);n.addEventListener("ended",s),ui(n,t),n.stop=(i=>{let r=!1;return(o=0)=>{if(r)try{i.call(n,o)}catch{t.gain.setValueAtTime(0,o)}else i.call(n,o),r=!0}})(n.stop)},hi=(n,e)=>t=>{const s={value:n};return Object.defineProperties(t,{currentTarget:s,target:s}),typeof e=="function"?e.call(n,t):e.handleEvent.call(n,t)},Ly=ig(Sn),zy=ug(Sn),By=k1(Fo),id=new WeakMap,Vy=B1(id),Ht=Kg(new Map,new WeakMap),Kt=Cy(),rd=_v(Ht,ts),Pc=z1(st),Ze=ly(st,Pc,gn),jy=mg(rd,ke,Ze),ye=H1(No),ws=Hv(Kt),he=ov(ws),od=new WeakMap,ad=R1(hi),wr=xv(Kt),Ic=sv(wr),Nc=nv(Kt),cd=iv(Kt),Xi=kv(Kt),Ue=Bg(rg(Nh),lg(Ly,zy,ao,By,co,st,Vy,_r,ke,Sn,ms,gn,Gr),Ht,Q1(ja,co,st,ke,Yi,ms),ts,Uo,rt,v1(ao,ja,st,ke,Yi,ye,ms,he),C1(od,st,Bt),ad,ye,Ic,Nc,cd,he,Xi),Hy=pg(Ue,jy,ts,rd,ye,he),Fc=new WeakSet,eu=gv(Kt),ld=h1(new Uint32Array(1)),Uc=by(ld,ts),Lc=Ey(ld),ud=gg(Fc,Ht,rt,eu,ws,vy(eu),Uc,Lc),Lo=hg(pt),hd=uy(Pc,vr,gn),ss=r1(hd),di=yv(Lo,Ht,Py,Iy,Ny,Dc,sd,Rc,Uy,Oy(kr),nd),ns=cy(V1(vr),hd),qy=xg(ss,di,ke,ns,Ze),qt=Vg(og(Fh),od,Cc,jg,K_,J_,eg,tg,sg,za,Ph,wr,td),Wy=yg(Ue,qy,qt,We,di,ye,he,hi),Gy=Ag(Ue,Mg,ts,We,Tv(pt,kr),ye,he,Ze),Yy=Qg(ss,$h,ke,ns,Ze),Cn=fy(id),Zy=$g(Ue,qt,Yy,Uo,$h,ye,he,Cn),Xs=pv(Sn,Nc),Xy=Ay(We,Xs),$s=Av(wr,Xy),$y=t1($s,ke,Ze),Qy=e1(Ue,$y,$s,ye,he),Ky=i1(xr,ke,Ze),Jy=n1(Ue,Ky,xr,ye,he,Dy),ex=Rv(Lo,di,pt,Xs),fi=Dv(Lo,Ht,ex,Dc,Rc),tx=u1(ss,fi,ke,ns,Ze),sx=l1(Ue,qt,tx,fi,ye,he,hi),dd=Pv(rt,kr),nx=p1(dd,ke,Ze),ix=f1(Ue,nx,dd,ye,he,Cn),rx=T1(ss,Qh,ke,ns,Ze),ox=x1(Ue,qt,rx,Qh,ye,he,Cn),fd=Iv(rt),ax=A1(ss,fd,ke,ns,Ze),cx=O1(Ue,qt,ax,fd,rt,ye,he,Cn),lx=U1(ss,pt,ke,ns,Ze),ux=F1(Ue,qt,lx,pt,ye,he),hx=Lv(Uo,We,Tr,rt),zo=hy(Ht,pt,Tr,xy(pt,ws)),dx=$1(di,ke,ws,Ze,zo),fx=Nv(hx),px=Z1(Ue,fx,dx,ye,he,Cn),mx=Dg(qt,$s,fi,Tr,rt,Jh,he,kr),pd=new WeakMap,_x=fv(Gy,mx,ad,he,pd,hi),md=qv(Lo,Ht,Dc,sd,Rc,nd),gx=sy(ss,md,ke,ns,Ze),vx=ty(Ue,qt,md,gx,ye,he,hi),_d=a1(di),yx=Qv(_d,We,pt,ed,Xs),Bo=$v(_d,We,yx,ed,Xs,wr,kr),xx=Gv(ao,We,$s,pt,Tr,Bo,rt,co,Jh,Xs),gd=Wv(xx),Tx=ry(ss,$s,fi,pt,gd,ke,ws,ns,Ze,zo),kx=iy(Ue,qt,gd,Tx,ye,he,Cn),wx=Yv(ts),Sx=ay(wx,ye,new WeakSet,Ry),Cx=Xv($s,xr,pt,Bo,rt,Xs),vd=Zv(Cx,rt),bx=gy(ss,vd,ke,ns,Ze),Ex=_y(Ue,qt,vd,bx,ye,he),Ox=Sy(Bo,ke,Ze),Ax=wy(Ue,We,Bo,Ox,ye,he,Cn),yd=av(Kt),zc=P1(Kt),xd=new WeakMap,Mx=q1(xd,ws),Dx=yd?cg(Ht,rt,D1(Kt),zc,I1(ng),ye,Mx,he,Xi,new WeakMap,new WeakMap,yy(Xi,ws),Kt):void 0,Rx=rv(Ic,he),Px=g1(Fc,Ht,_1,M1,new WeakSet,ye,Rx,ro,Zi,Uc,Lc),Td=Zg(Dx,Hy,ud,Wy,Zy,Qy,Jy,sx,ix,Px,ox,cx,ux,px,_x,vx,kx,Sx,Ex,Ax),Ix=cv(Ue,zv,ye,he),Nx=uv(Ue,Bv,ye,he),Fx=hv(Ue,Vv,ye,he),Ux=jv(We,he),Lx=dv(Ue,Ux,ye),zx=Og(Td,We,rt,Ty,Ix,Nx,Fx,Lx,wr),Bc=W1(pd),Bx=dg(Bc),kd=o1(ts),Vx=w1(Bc),wd=b1(ts),Sd=new WeakMap,jx=L1(Sd,Bt),Hx=Ov(kd,ts,We,$s,xr,fi,pt,Tr,rt,wd,zc,jx,Xs),qx=Sv(We,Hx,pt,rt,Xs),Wx=Yg(ss,kd,di,$s,xr,fi,pt,Vx,wd,zc,ke,Xi,ws,ns,Ze,zo),Gx=j1(xd),Yx=dy(Sd),tu=yd?qg(Bx,Ue,qt,Wx,qx,st,Gx,ye,he,Xi,My,Yx,Fy,hi):void 0,Zx=m1(rt,ws),Xx=py(Fc,Ht,Pc,Bc,zo,ro,Uc,Lc),$x=Jv(Td,Ht,We,Zx,Xx),Qx=K1(No,Ic),Kx=J1(Sc,Nc),Jx=ev(Cc,cd),eT=tv(No,he);function xt(n){return typeof n>"u"}function te(n){return!xt(n)}function tT(n){return typeof n=="function"}function js(n){return typeof n=="number"}function fn(n){return Object.prototype.toString.call(n)==="[object Object]"&&n.constructor===Object}function sT(n){return typeof n=="boolean"}function zt(n){return Array.isArray(n)}function ys(n){return typeof n=="string"}function zr(n){return ys(n)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(n)}function Q(n,e){if(!n)throw new Error(e)}function Vt(n,e,t=1/0){if(!(e<=n&&n<=t))throw new RangeError(`Value must be within [${e}, ${t}], got: ${n}`)}function Cd(n){!n.isOffline&&n.state!=="running"&&Vc('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let bd=!1,su=!1;function nu(n){bd=n}function nT(n){xt(n)&&bd&&!su&&(su=!0,Vc("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let Ed=console;function iT(...n){Ed.log(...n)}function Vc(...n){Ed.warn(...n)}function rT(n){return new zx(n)}function oT(n,e,t){return new $x(n,e,t)}const pn=typeof self=="object"?self:null,aT=pn&&(pn.hasOwnProperty("AudioContext")||pn.hasOwnProperty("webkitAudioContext"));function cT(n,e,t){return Q(te(tu),"This node only works in a secure context (https or localhost)"),new tu(n,e,t)}class lT{constructor(e,t,s,i){this._callback=e,this._type=t,this._minimumUpdateInterval=Math.max(128/(i||44100),.001),this.updateInterval=s,this._createClock()}_createWorker(){const e=new Blob([` +})(${x?"AudioWorkletProcessor":"class extends AudioWorkletProcessor {__b=new WeakSet();constructor(){super();(p=>p.postMessage=(q=>(m,t)=>q.call(p,m,t?t.filter(u=>!this.__b.has(u)):t))(p.postMessage))(this.port)}}"},(n,p)=>registerProcessor(n,class extends p{${x?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${x?"":"i.forEach(this.__c);o.forEach(this.__c);this.__c(Object.values(p));"}return super.process(i.map(j=>j.some(k=>k.length===0)?[]:j),o,p)}}));registerProcessor('__sac${k}',class extends AudioWorkletProcessor{process(){return !1}})`,F=new Blob([P],{type:"application/javascript; charset=utf-8"}),N=URL.createObjectURL(F);return S.audioWorklet.addModule(N,g).then(()=>{if(a(S))return S;const U=o(S);return U.audioWorklet.addModule(N,g).then(()=>U)}).then(U=>{if(c===null)throw new SyntaxError;try{new c(U,`__sac${k}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(N))});return w===void 0?l.set(m,new Map([[p,v]])):w.set(p,v),v.then(()=>{const _=u.get(m);_===void 0?u.set(m,new Set([p])):_.add(p)}).finally(()=>{const _=l.get(m);_!==void 0&&_.delete(p)}),v}},Bt=(n,e)=>{const t=n.get(e);if(t===void 0)throw new Error("A value with the given key could not be found.");return t},Fo=(n,e)=>{const t=Array.from(n).filter(e);if(t.length>1)throw Error("More than one element was found.");if(t.length===0)throw Error("No element was found.");const[s]=t;return n.delete(s),s},zh=(n,e,t,s)=>{const i=Bt(n,e),r=Fo(i,o=>o[0]===t&&o[1]===s);return i.size===0&&n.delete(e),r},_r=n=>Bt(Uh,n),si=n=>{if(ti.has(n))throw new Error("The AudioNode is already stored.");ti.add(n),_r(n).forEach(e=>e(!0))},Bh=n=>"port"in n,gr=n=>{if(!ti.has(n))throw new Error("The AudioNode is not stored.");ti.delete(n),_r(n).forEach(e=>e(!1))},Wa=(n,e)=>{!Bh(n)&&e.every(t=>t.size===0)&&gr(n)},ug=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>{const f=new WeakMap;return(m,p,g,y,w)=>{const{activeInputs:S,passiveInputs:v}=r(p),{outputs:_}=r(m),T=a(m),x=k=>{const C=c(p),E=c(m);if(k){const O=zh(v,m,g,y);n(S,m,O,!1),!w&&!h(m)&&t(E,C,g,y),d(p)&&si(p)}else{const O=s(S,m,g,y);e(v,y,O,!1),!w&&!h(m)&&i(E,C,g,y);const A=o(p);if(A===0)u(p)&&Wa(p,S);else{const R=f.get(p);R!==void 0&&clearTimeout(R),f.set(p,setTimeout(()=>{u(p)&&Wa(p,S)},A*1e3))}}};return l(_,[p,g,y],k=>k[0]===p&&k[1]===g&&k[2]===y,!0)?(T.add(x),u(m)?n(S,m,[g,y,x],!0):e(v,y,[m,g,x],!0),!0):!1}},hg=n=>(e,t,[s,i,r],o)=>{const a=e.get(s);a===void 0?e.set(s,new Set([[i,t,r]])):n(a,[i,t,r],c=>c[0]===i&&c[1]===t,o)},dg=n=>(e,t)=>{const s=n(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});t.connect(s).connect(e.destination);const i=()=>{t.removeEventListener("ended",i),t.disconnect(s),s.disconnect()};t.addEventListener("ended",i)},fg=n=>(e,t)=>{n(e).add(t)},pg={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},mg=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=i(a),u={...pg,...c},h=s(l,u),d=r(l)?e():null;super(a,!1,h,d),this._nativeAnalyserNode=h}get fftSize(){return this._nativeAnalyserNode.fftSize}set fftSize(a){this._nativeAnalyserNode.fftSize=a}get frequencyBinCount(){return this._nativeAnalyserNode.frequencyBinCount}get maxDecibels(){return this._nativeAnalyserNode.maxDecibels}set maxDecibels(a){const c=this._nativeAnalyserNode.maxDecibels;if(this._nativeAnalyserNode.maxDecibels=a,!(a>this._nativeAnalyserNode.minDecibels))throw this._nativeAnalyserNode.maxDecibels=c,t()}get minDecibels(){return this._nativeAnalyserNode.minDecibels}set minDecibels(a){const c=this._nativeAnalyserNode.minDecibels;if(this._nativeAnalyserNode.minDecibels=a,!(this._nativeAnalyserNode.maxDecibels>a))throw this._nativeAnalyserNode.minDecibels=c,t()}get smoothingTimeConstant(){return this._nativeAnalyserNode.smoothingTimeConstant}set smoothingTimeConstant(a){this._nativeAnalyserNode.smoothingTimeConstant=a}getByteFrequencyData(a){this._nativeAnalyserNode.getByteFrequencyData(a)}getByteTimeDomainData(a){this._nativeAnalyserNode.getByteTimeDomainData(a)}getFloatFrequencyData(a){this._nativeAnalyserNode.getFloatFrequencyData(a)}getFloatTimeDomainData(a){this._nativeAnalyserNode.getFloatTimeDomainData(a)}},Je=(n,e)=>n.context===e,_g=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!Je(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,fftSize:a.fftSize,maxDecibels:a.maxDecibels,minDecibels:a.minDecibels,smoothingTimeConstant:a.smoothingTimeConstant};a=n(o,l)}return s.set(o,a),await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},ro=n=>{try{n.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},ts=()=>new DOMException("","IndexSizeError"),bc=n=>{n.getChannelData=(e=>t=>{try{return e.call(n,t)}catch(s){throw s.code===12?ts():s}})(n.getChannelData)},gg={numberOfChannels:1},vg=(n,e,t,s,i,r,o,a)=>{let c=null;return class Vh{constructor(u){if(i===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:h,numberOfChannels:d,sampleRate:f}={...gg,...u};c===null&&(c=new i(1,1,44100));const m=s!==null&&e(r,r)?new s({length:h,numberOfChannels:d,sampleRate:f}):c.createBuffer(d,h,f);if(m.numberOfChannels===0)throw t();return typeof m.copyFromChannel!="function"?(o(m),bc(m)):e(ro,()=>ro(m))||a(m),n.add(m),m}static[Symbol.hasInstance](u){return u!==null&&typeof u=="object"&&Object.getPrototypeOf(u)===Vh.prototype||n.has(u)}}},at=-34028234663852886e22,et=-at,ms=n=>ti.has(n),yg={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},xg=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d={...yg,...u},f=i(h,d),m=o(h),p=m?e():null;super(l,!1,f,p),this._audioBufferSourceNodeRenderer=p,this._isBufferNullified=!1,this._isBufferSet=d.buffer!==null,this._nativeAudioBufferSourceNode=f,this._onended=null,this._playbackRate=t(this,m,f.playbackRate,et,at)}get buffer(){return this._isBufferNullified?null:this._nativeAudioBufferSourceNode.buffer}set buffer(l){if(this._nativeAudioBufferSourceNode.buffer=l,l!==null){if(this._isBufferSet)throw s();this._isBufferSet=!0}}get loop(){return this._nativeAudioBufferSourceNode.loop}set loop(l){this._nativeAudioBufferSourceNode.loop=l}get loopEnd(){return this._nativeAudioBufferSourceNode.loopEnd}set loopEnd(l){this._nativeAudioBufferSourceNode.loopEnd=l}get loopStart(){return this._nativeAudioBufferSourceNode.loopStart}set loopStart(l){this._nativeAudioBufferSourceNode.loopStart=l}get onended(){return this._onended}set onended(l){const u=typeof l=="function"?a(this,l):null;this._nativeAudioBufferSourceNode.onended=u;const h=this._nativeAudioBufferSourceNode.onended;this._onended=h!==null&&h===u?l:h}get playbackRate(){return this._playbackRate}start(l=0,u=0,h){if(this._nativeAudioBufferSourceNode.start(l,u,h),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.start=h===void 0?[l,u]:[l,u,h]),this.context.state!=="closed"){si(this);const d=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",d),ms(this)&&gr(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",d)}}stop(l=0){this._nativeAudioBufferSourceNode.stop(l),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=l)}},Tg=(n,e,t,s,i)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=t(l);const d=Je(h,u);if(!d){const f={buffer:h.buffer,channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,loop:h.loop,loopEnd:h.loopEnd,loopStart:h.loopStart,playbackRate:h.playbackRate.value};h=e(u,f),o!==null&&h.start(...o),a!==null&&h.stop(a)}return r.set(u,h),d?await n(u,l.playbackRate,h.playbackRate):await s(u,l.playbackRate,h.playbackRate),await i(l,u,h),h};return{set start(l){o=l},set stop(l){a=l},render(l,u){const h=r.get(u);return h!==void 0?Promise.resolve(h):c(l,u)}}},kg=n=>"playbackRate"in n,wg=n=>"frequency"in n&&"gain"in n,Sg=n=>"offset"in n,Cg=n=>!("frequency"in n)&&"gain"in n,bg=n=>"detune"in n&&"frequency"in n,Eg=n=>"pan"in n,st=n=>Bt(Nh,n),vr=n=>Bt(Fh,n),Ga=(n,e)=>{const{activeInputs:t}=st(n);t.forEach(i=>i.forEach(([r])=>{e.includes(n)||Ga(r,[...e,n])}));const s=kg(n)?[n.playbackRate]:Bh(n)?Array.from(n.parameters.values()):wg(n)?[n.Q,n.detune,n.frequency,n.gain]:Sg(n)?[n.offset]:Cg(n)?[n.gain]:bg(n)?[n.detune,n.frequency]:Eg(n)?[n.pan]:[];for(const i of s){const r=vr(i);r!==void 0&&r.activeInputs.forEach(([o])=>Ga(o,e))}ms(n)&&gr(n)},jh=n=>{Ga(n.destination,[])},Og=n=>n===void 0||typeof n=="number"||typeof n=="string"&&(n==="balanced"||n==="interactive"||n==="playback"),Ag=(n,e,t,s,i,r,o,a,c)=>class extends n{constructor(u={}){if(c===null)throw new Error("Missing the native AudioContext constructor.");let h;try{h=new c(u)}catch(m){throw m.code===12&&m.message==="sampleRate is not in range"?t():m}if(h===null)throw s();if(!Og(u.latencyHint))throw new TypeError(`The provided value '${u.latencyHint}' is not a valid enum value of type AudioContextLatencyCategory.`);if(u.sampleRate!==void 0&&h.sampleRate!==u.sampleRate)throw t();super(h,2);const{latencyHint:d}=u,{sampleRate:f}=h;if(this._baseLatency=typeof h.baseLatency=="number"?h.baseLatency:d==="balanced"?512/f:d==="interactive"||d===void 0?256/f:d==="playback"?1024/f:Math.max(2,Math.min(128,Math.round(d*f/128)))*128/f,this._nativeAudioContext=h,c.name==="webkitAudioContext"?(this._nativeGainNode=h.createGain(),this._nativeOscillatorNode=h.createOscillator(),this._nativeGainNode.gain.value=1e-37,this._nativeOscillatorNode.connect(this._nativeGainNode).connect(h.destination),this._nativeOscillatorNode.start()):(this._nativeGainNode=null,this._nativeOscillatorNode=null),this._state=null,h.state==="running"){this._state="suspended";const m=()=>{this._state==="suspended"&&(this._state=null),h.removeEventListener("statechange",m)};h.addEventListener("statechange",m)}}get baseLatency(){return this._baseLatency}get state(){return this._state!==null?this._state:this._nativeAudioContext.state}close(){return this.state==="closed"?this._nativeAudioContext.close().then(()=>{throw e()}):(this._state==="suspended"&&(this._state=null),this._nativeAudioContext.close().then(()=>{this._nativeGainNode!==null&&this._nativeOscillatorNode!==null&&(this._nativeOscillatorNode.stop(),this._nativeGainNode.disconnect(),this._nativeOscillatorNode.disconnect()),jh(this)}))}createMediaElementSource(u){return new i(this,{mediaElement:u})}createMediaStreamDestination(){return new r(this)}createMediaStreamSource(u){return new o(this,{mediaStream:u})}createMediaStreamTrackSource(u){return new a(this,{mediaStreamTrack:u})}resume(){return this._state==="suspended"?new Promise((u,h)=>{const d=()=>{this._nativeAudioContext.removeEventListener("statechange",d),this._nativeAudioContext.state==="running"?u():this.resume().then(u,h)};this._nativeAudioContext.addEventListener("statechange",d)}):this._nativeAudioContext.resume().catch(u=>{throw u===void 0||u.code===15?e():u})}suspend(){return this._nativeAudioContext.suspend().catch(u=>{throw u===void 0?e():u})}},Mg=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d=o(h),f=i(h,u,d),m=d?e(a):null;super(l,!1,f,m),this._isNodeOfNativeOfflineAudioContext=d,this._nativeAudioDestinationNode=f}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(l){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(l>this._nativeAudioDestinationNode.maxChannelCount)throw t();this._nativeAudioDestinationNode.channelCount=l}get channelCountMode(){return this._nativeAudioDestinationNode.channelCountMode}set channelCountMode(l){if(this._isNodeOfNativeOfflineAudioContext)throw s();this._nativeAudioDestinationNode.channelCountMode=l}get maxChannelCount(){return this._nativeAudioDestinationNode.maxChannelCount}},Dg=n=>{const e=new WeakMap,t=async(s,i)=>{const r=i.destination;return e.set(i,r),await n(s,i,r),r};return{render(s,i){const r=e.get(i);return r!==void 0?Promise.resolve(r):t(s,i)}}},Rg=(n,e,t,s,i,r,o,a)=>(c,l)=>{const u=l.listener,h=()=>{const _=new Float32Array(1),T=e(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),x=o(l);let k=!1,C=[0,0,-1,0,1,0],E=[0,0,0];const O=()=>{if(k)return;k=!0;const F=s(l,256,9,0);F.onaudioprocess=({inputBuffer:N})=>{const U=[r(N,_,0),r(N,_,1),r(N,_,2),r(N,_,3),r(N,_,4),r(N,_,5)];U.some((B,q)=>B!==C[q])&&(u.setOrientation(...U),C=U);const V=[r(N,_,6),r(N,_,7),r(N,_,8)];V.some((B,q)=>B!==E[q])&&(u.setPosition(...V),E=V)},T.connect(F)},A=F=>N=>{N!==C[F]&&(C[F]=N,u.setOrientation(...C))},R=F=>N=>{N!==E[F]&&(E[F]=N,u.setPosition(...E))},P=(F,N,U)=>{const V=t(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:N});V.connect(T,0,F),V.start(),Object.defineProperty(V.offset,"defaultValue",{get(){return N}});const B=n({context:c},x,V.offset,et,at);return a(B,"value",q=>()=>q.call(B),q=>j=>{try{q.call(B,j)}catch(z){if(z.code!==9)throw z}O(),x&&U(j)}),B.cancelAndHoldAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.cancelAndHoldAtTime),B.cancelScheduledValues=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.cancelScheduledValues),B.exponentialRampToValueAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.exponentialRampToValueAtTime),B.linearRampToValueAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.linearRampToValueAtTime),B.setTargetAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.setTargetAtTime),B.setValueAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.setValueAtTime),B.setValueCurveAtTime=(q=>x?()=>{throw i()}:(...j)=>{const z=q.apply(B,j);return O(),z})(B.setValueCurveAtTime),B};return{forwardX:P(0,0,A(0)),forwardY:P(1,0,A(1)),forwardZ:P(2,-1,A(2)),positionX:P(6,0,R(0)),positionY:P(7,0,R(1)),positionZ:P(8,0,R(2)),upX:P(3,0,A(3)),upY:P(4,1,A(4)),upZ:P(5,0,A(5))}},{forwardX:d,forwardY:f,forwardZ:m,positionX:p,positionY:g,positionZ:y,upX:w,upY:S,upZ:v}=u.forwardX===void 0?h():u;return{get forwardX(){return d},get forwardY(){return f},get forwardZ(){return m},get positionX(){return p},get positionY(){return g},get positionZ(){return y},get upX(){return w},get upY(){return S},get upZ(){return v}}},oo=n=>"context"in n,yr=n=>oo(n[0]),Sn=(n,e,t,s)=>{for(const i of n)if(t(i)){if(s)return!1;throw Error("The set contains at least one similar element.")}return n.add(e),!0},Zl=(n,e,[t,s],i)=>{Sn(n,[e,t,s],r=>r[0]===e&&r[1]===t,i)},Xl=(n,[e,t,s],i)=>{const r=n.get(e);r===void 0?n.set(e,new Set([[t,s]])):Sn(r,[t,s],o=>o[0]===t,i)},li=n=>"inputs"in n,ao=(n,e,t,s)=>{if(li(e)){const i=e.inputs[s];return n.connect(i,t,0),[i,t,0]}return n.connect(e,t,s),[e,t,s]},Hh=(n,e,t)=>{for(const s of n)if(s[0]===e&&s[1]===t)return n.delete(s),s;return null},Pg=(n,e,t)=>Fo(n,s=>s[0]===e&&s[1]===t),qh=(n,e)=>{if(!_r(n).delete(e))throw new Error("Missing the expected event listener.")},Wh=(n,e,t)=>{const s=Bt(n,e),i=Fo(s,r=>r[0]===t);return s.size===0&&n.delete(e),i},co=(n,e,t,s)=>{li(e)?n.disconnect(e.inputs[s],t,0):n.disconnect(e,t,s)},ke=n=>Bt(Sc,n),Yi=n=>Bt(Cc,n),gn=n=>ja.has(n),Gr=n=>!ti.has(n),$l=(n,e)=>new Promise(t=>{if(e!==null)t(!0);else{const s=n.createScriptProcessor(256,1,1),i=n.createGain(),r=n.createBuffer(1,2,44100),o=r.getChannelData(0);o[0]=1,o[1]=1;const a=n.createBufferSource();a.buffer=r,a.loop=!0,a.connect(s).connect(n.destination),a.connect(i),a.disconnect(i),s.onaudioprocess=c=>{const l=c.inputBuffer.getChannelData(0);Array.prototype.some.call(l,u=>u===1)?t(!0):t(!1),a.stop(),s.onaudioprocess=null,a.disconnect(s),s.disconnect(n.destination)},a.start()}}),va=(n,e)=>{const t=new Map;for(const s of n)for(const i of s){const r=t.get(i);t.set(i,r===void 0?1:r+1)}t.forEach((s,i)=>e(i,s))},lo=n=>"context"in n,Ig=n=>{const e=new Map;n.connect=(t=>(s,i=0,r=0)=>{const o=lo(s)?t(s,i,r):t(s,i),a=e.get(s);return a===void 0?e.set(s,[{input:r,output:i}]):a.every(c=>c.input!==r||c.output!==i)&&a.push({input:r,output:i}),o})(n.connect.bind(n)),n.disconnect=(t=>(s,i,r)=>{if(t.apply(n),s===void 0)e.clear();else if(typeof s=="number")for(const[o,a]of e){const c=a.filter(l=>l.output!==s);c.length===0?e.delete(o):e.set(o,c)}else if(e.has(s))if(i===void 0)e.delete(s);else{const o=e.get(s);if(o!==void 0){const a=o.filter(c=>c.output!==i&&(c.input!==r||r===void 0));a.length===0?e.delete(s):e.set(s,a)}}for(const[o,a]of e)a.forEach(c=>{lo(o)?n.connect(o,c.output,c.input):n.connect(o,c.output)})})(n.disconnect)},Ng=(n,e,t,s)=>{const{activeInputs:i,passiveInputs:r}=vr(e),{outputs:o}=st(n),a=_r(n),c=l=>{const u=ke(n),h=Yi(e);if(l){const d=Wh(r,n,t);Zl(i,n,d,!1),!s&&!gn(n)&&u.connect(h,t)}else{const d=Pg(i,n,t);Xl(r,d,!1),!s&&!gn(n)&&u.disconnect(h,t)}};return Sn(o,[e,t],l=>l[0]===e&&l[1]===t,!0)?(a.add(c),ms(n)?Zl(i,n,[t,c],!0):Xl(r,[n,t,c],!0),!0):!1},Fg=(n,e,t,s)=>{const{activeInputs:i,passiveInputs:r}=st(e),o=Hh(i[s],n,t);return o===null?[zh(r,n,t,s)[2],!1]:[o[2],!0]},Ug=(n,e,t)=>{const{activeInputs:s,passiveInputs:i}=vr(e),r=Hh(s,n,t);return r===null?[Wh(i,n,t)[1],!1]:[r[2],!0]},Ec=(n,e,t,s,i)=>{const[r,o]=Fg(n,t,s,i);if(r!==null&&(qh(n,r),o&&!e&&!gn(n)&&co(ke(n),ke(t),s,i)),ms(t)){const{activeInputs:a}=st(t);Wa(t,a)}},Oc=(n,e,t,s)=>{const[i,r]=Ug(n,t,s);i!==null&&(qh(n,i),r&&!e&&!gn(n)&&ke(n).disconnect(Yi(t),s))},Lg=(n,e)=>{const t=st(n),s=[];for(const i of t.outputs)yr(i)?Ec(n,e,...i):Oc(n,e,...i),s.push(i[0]);return t.outputs.clear(),s},zg=(n,e,t)=>{const s=st(n),i=[];for(const r of s.outputs)r[1]===t&&(yr(r)?Ec(n,e,...r):Oc(n,e,...r),i.push(r[0]),s.outputs.delete(r));return i},Bg=(n,e,t,s,i)=>{const r=st(n);return Array.from(r.outputs).filter(o=>o[0]===t&&(s===void 0||o[1]===s)&&(i===void 0||o[2]===i)).map(o=>(yr(o)?Ec(n,e,...o):Oc(n,e,...o),r.outputs.delete(o),o[0]))},Vg=(n,e,t,s,i,r,o,a,c,l,u,h,d,f,m,p)=>class extends l{constructor(y,w,S,v){super(S),this._context=y,this._nativeAudioNode=S;const _=u(y);h(_)&&t($l,()=>$l(_,p))!==!0&&Ig(S),Sc.set(this,S),Uh.set(this,new Set),y.state!=="closed"&&w&&si(this),n(this,v,S)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(y){this._nativeAudioNode.channelCount=y}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(y){this._nativeAudioNode.channelCountMode=y}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(y){this._nativeAudioNode.channelInterpretation=y}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(y,w=0,S=0){if(w<0||w>=this._nativeAudioNode.numberOfOutputs)throw i();const v=u(this._context),_=m(v);if(d(y)||f(y))throw r();if(oo(y)){const k=ke(y);try{const E=ao(this._nativeAudioNode,k,w,S),O=Gr(this);(_||O)&&this._nativeAudioNode.disconnect(...E),this.context.state!=="closed"&&!O&&Gr(y)&&si(y)}catch(E){throw E.code===12?r():E}if(e(this,y,w,S,_)){const E=c([this],y);va(E,s(_))}return y}const T=Yi(y);if(T.name==="playbackRate"&&T.maxValue===1024)throw o();try{this._nativeAudioNode.connect(T,w),(_||Gr(this))&&this._nativeAudioNode.disconnect(T,w)}catch(k){throw k.code===12?r():k}if(Ng(this,y,w,_)){const k=c([this],y);va(k,s(_))}}disconnect(y,w,S){let v;const _=u(this._context),T=m(_);if(y===void 0)v=Lg(this,T);else if(typeof y=="number"){if(y<0||y>=this.numberOfOutputs)throw i();v=zg(this,T,y)}else{if(w!==void 0&&(w<0||w>=this.numberOfOutputs)||oo(y)&&S!==void 0&&(S<0||S>=y.numberOfInputs))throw i();if(v=Bg(this,T,y,w,S),v.length===0)throw r()}for(const x of v){const k=c([this],x);va(k,a)}}},jg=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>(f,m,p,g=null,y=null)=>{const w=p.value,S=new K_(w),v=m?s(S):null,_={get defaultValue(){return w},get maxValue(){return g===null?p.maxValue:g},get minValue(){return y===null?p.minValue:y},get value(){return p.value},set value(T){p.value=T,_.setValueAtTime(T,f.context.currentTime)},cancelAndHoldAtTime(T){if(typeof p.cancelAndHoldAtTime=="function")v===null&&S.flush(f.context.currentTime),S.add(i(T)),p.cancelAndHoldAtTime(T);else{const x=Array.from(S).pop();v===null&&S.flush(f.context.currentTime),S.add(i(T));const k=Array.from(S).pop();p.cancelScheduledValues(T),x!==k&&k!==void 0&&(k.type==="exponentialRampToValue"?p.exponentialRampToValueAtTime(k.value,k.endTime):k.type==="linearRampToValue"?p.linearRampToValueAtTime(k.value,k.endTime):k.type==="setValue"?p.setValueAtTime(k.value,k.startTime):k.type==="setValueCurve"&&p.setValueCurveAtTime(k.values,k.startTime,k.duration))}return _},cancelScheduledValues(T){return v===null&&S.flush(f.context.currentTime),S.add(r(T)),p.cancelScheduledValues(T),_},exponentialRampToValueAtTime(T,x){if(T===0)throw new RangeError;if(!Number.isFinite(x)||x<0)throw new RangeError;const k=f.context.currentTime;return v===null&&S.flush(k),Array.from(S).length===0&&(S.add(l(w,k)),p.setValueAtTime(w,k)),S.add(o(T,x)),p.exponentialRampToValueAtTime(T,x),_},linearRampToValueAtTime(T,x){const k=f.context.currentTime;return v===null&&S.flush(k),Array.from(S).length===0&&(S.add(l(w,k)),p.setValueAtTime(w,k)),S.add(a(T,x)),p.linearRampToValueAtTime(T,x),_},setTargetAtTime(T,x,k){return v===null&&S.flush(f.context.currentTime),S.add(c(T,x,k)),p.setTargetAtTime(T,x,k),_},setValueAtTime(T,x){return v===null&&S.flush(f.context.currentTime),S.add(l(T,x)),p.setValueAtTime(T,x),_},setValueCurveAtTime(T,x,k){const C=T instanceof Float32Array?T:new Float32Array(T);if(h!==null&&h.name==="webkitAudioContext"){const E=x+k,O=f.context.sampleRate,A=Math.ceil(x*O),R=Math.floor(E*O),P=R-A,F=new Float32Array(P);for(let U=0;U({replay(e){for(const t of n)if(t.type==="exponentialRampToValue"){const{endTime:s,value:i}=t;e.exponentialRampToValueAtTime(i,s)}else if(t.type==="linearRampToValue"){const{endTime:s,value:i}=t;e.linearRampToValueAtTime(i,s)}else if(t.type==="setTarget"){const{startTime:s,target:i,timeConstant:r}=t;e.setTargetAtTime(i,s,r)}else if(t.type==="setValue"){const{startTime:s,value:i}=t;e.setValueAtTime(i,s)}else if(t.type==="setValueCurve"){const{duration:s,startTime:i,values:r}=t;e.setValueCurveAtTime(r,i,s)}else throw new Error("Can't apply an unknown automation.")}});class Gh{constructor(e){this._map=new Map(e)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(e,t=null){return this._map.forEach((s,i)=>e.call(t,s,i,this))}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){return this._map.keys()}values(){return this._map.values()}}const qg={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},Wg=(n,e,t,s,i,r,o,a,c,l,u,h,d,f)=>class extends e{constructor(p,g,y){var w;const S=a(p),v=c(S),_=u({...qg,...y});d(_);const T=Ha.get(S),x=T==null?void 0:T.get(g),k=v||S.state!=="closed"?S:(w=o(S))!==null&&w!==void 0?w:S,C=i(k,v?null:p.baseLatency,l,g,x,_),E=v?s(g,_,x):null;super(p,!0,C,E);const O=[];C.parameters.forEach((R,P)=>{const F=t(this,v,R);O.push([P,F])}),this._nativeAudioWorkletNode=C,this._onprocessorerror=null,this._parameters=new Gh(O),v&&n(S,this);const{activeInputs:A}=r(this);h(C,A)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(p){const g=typeof p=="function"?f(this,p):null;this._nativeAudioWorkletNode.onprocessorerror=g;const y=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=y!==null&&y===g?p:y}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function uo(n,e,t,s,i){if(typeof n.copyFromChannel=="function")e[t].byteLength===0&&(e[t]=new Float32Array(128)),n.copyFromChannel(e[t],s,i);else{const r=n.getChannelData(s);if(e[t].byteLength===0)e[t]=r.slice(i,i+128);else{const o=new Float32Array(r.buffer,i*Float32Array.BYTES_PER_ELEMENT,128);e[t].set(o)}}}const Yh=(n,e,t,s,i)=>{typeof n.copyToChannel=="function"?e[t].byteLength!==0&&n.copyToChannel(e[t],s,i):e[t].byteLength!==0&&n.getChannelData(s).set(e[t],i)},ho=(n,e)=>{const t=[];for(let s=0;s{const t=Bt(qa,n),s=ke(e);return Bt(t,s)},Yg=async(n,e,t,s,i,r,o)=>{const a=e===null?Math.ceil(n.context.length/128)*128:e.length,c=s.channelCount*s.numberOfInputs,l=i.reduce((g,y)=>g+y,0),u=l===0?null:t.createBuffer(l,a,t.sampleRate);if(r===void 0)throw new Error("Missing the processor constructor.");const h=st(n),d=await Gg(t,n),f=ho(s.numberOfInputs,s.channelCount),m=ho(s.numberOfOutputs,i),p=Array.from(n.parameters.keys()).reduce((g,y)=>({...g,[y]:new Float32Array(128)}),{});for(let g=0;g0&&e!==null)for(let y=0;y{uo(e,p,y,c+w,g)});for(let y=0;yh.activeInputs[v].size===0?[]:S),w=o(g/t.sampleRate,t.sampleRate,()=>d.process(y,m,p));if(u!==null)for(let S=0,v=0;S(g,y,w)=>{const S=new WeakMap;let v=null;const _=async(T,x)=>{let k=u(T),C=null;const E=Je(k,x),O=Array.isArray(y.outputChannelCount)?y.outputChannelCount:Array.from(y.outputChannelCount);if(h===null){const A=O.reduce((N,U)=>N+U,0),R=i(x,{channelCount:Math.max(1,A),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,A)}),P=[];for(let N=0;N{const j=new d(B,Math.ceil(T.context.length/128)*128,x.sampleRate),z=[],Te=[];for(let me=0;me{const Ye=r(j,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:me.value});return await f(j,me,Ye.offset),Ye})),X=s(j,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,U+V)});for(let me=0;mem(T,j,me))),p(j)})(),x,y,O,w,l)}const A=await v,R=t(x,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[P,F,N]=C;A!==null&&(R.buffer=A,R.start(0)),R.connect(P);for(let U=0,V=0;Uclass extends m{constructor(_,T){super(_,T),this._nativeContext=_,this._audioWorklet=n===void 0?void 0:{addModule:(x,k)=>n(this,x,k)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new e(this)}createBiquadFilter(){return new i(this)}createBuffer(_,T,x){return new t({length:T,numberOfChannels:_,sampleRate:x})}createBufferSource(){return new s(this)}createChannelMerger(_=6){return new r(this,{numberOfInputs:_})}createChannelSplitter(_=6){return new o(this,{numberOfOutputs:_})}createConstantSource(){return new a(this)}createConvolver(){return new c(this)}createDelay(_=1){return new u(this,{maxDelayTime:_})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(_,T){return new f(this,{feedback:T,feedforward:_})}createOscillator(){return new p(this)}createPanner(){return new g(this)}createPeriodicWave(_,T,x={disableNormalization:!1}){return new y(this,{...x,imag:T,real:_})}createStereoPanner(){return new w(this)}createWaveShaper(){return new S(this)}decodeAudioData(_,T,x){return l(this._nativeContext,_).then(k=>(typeof T=="function"&&T(k),k),k=>{throw typeof x=="function"&&x(k),k})}},$g={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},Qg=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d={...$g,...u},f=i(h,d),m=o(h),p=m?t():null;super(l,!1,f,p),this._Q=e(this,m,f.Q,et,at),this._detune=e(this,m,f.detune,1200*Math.log2(et),-1200*Math.log2(et)),this._frequency=e(this,m,f.frequency,l.sampleRate/2,0),this._gain=e(this,m,f.gain,40*Math.log10(et),at),this._nativeBiquadFilterNode=f,a(this,1)}get detune(){return this._detune}get frequency(){return this._frequency}get gain(){return this._gain}get Q(){return this._Q}get type(){return this._nativeBiquadFilterNode.type}set type(l){this._nativeBiquadFilterNode.type=l}getFrequencyResponse(l,u,h){try{this._nativeBiquadFilterNode.getFrequencyResponse(l,u,h)}catch(d){throw d.code===11?s():d}if(l.length!==u.length||u.length!==h.length)throw s()}},Kg=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=Je(l,c);if(!u){const h={Q:l.Q.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,detune:l.detune.value,frequency:l.frequency.value,gain:l.gain.value,type:l.type};l=e(c,h)}return r.set(c,l),u?(await n(c,a.Q,l.Q),await n(c,a.detune,l.detune),await n(c,a.frequency,l.frequency),await n(c,a.gain,l.gain)):(await s(c,a.Q,l.Q),await s(c,a.detune,l.detune),await s(c,a.frequency,l.frequency),await s(c,a.gain,l.gain)),await i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},Jg=(n,e)=>(t,s)=>{const i=e.get(t);if(i!==void 0)return i;const r=n.get(t);if(r!==void 0)return r;try{const o=s();return o instanceof Promise?(n.set(t,o),o.catch(()=>!1).then(a=>(n.delete(t),e.set(t,a),a))):(e.set(t,o),o)}catch{return e.set(t,!1),!1}},e1={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},t1=(n,e,t,s,i)=>class extends n{constructor(o,a){const c=s(o),l={...e1,...a},u=t(c,l),h=i(c)?e():null;super(o,!1,u,h)}},s1=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!Je(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=n(o,l)}return s.set(o,a),await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},n1={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},i1=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=s(a),u=r({...n1,...c}),h=t(l,u),d=i(l)?e():null;super(a,!1,h,d)}},r1=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!Je(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=n(o,l)}return s.set(o,a),await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},o1=n=>(e,t,s)=>n(t,e,s),a1=n=>(e,t,s=0,i=0)=>{const r=e[s];if(r===void 0)throw n();return lo(t)?r.connect(t,0,i):r.connect(t,0)},c1=n=>(e,t)=>{const s=n(e,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),i=e.createBuffer(1,2,44100);return s.buffer=i,s.loop=!0,s.connect(t),s.start(),()=>{s.stop(),s.disconnect(t)}},l1={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},u1=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...l1,...l},d=s(u,h),f=r(u),m=f?t():null;super(c,!1,d,m),this._constantSourceNodeRenderer=m,this._nativeConstantSourceNode=d,this._offset=e(this,f,d.offset,et,at),this._onended=null}get offset(){return this._offset}get onended(){return this._onended}set onended(c){const l=typeof c=="function"?o(this,c):null;this._nativeConstantSourceNode.onended=l;const u=this._nativeConstantSourceNode.onended;this._onended=u!==null&&u===l?c:u}start(c=0){if(this._nativeConstantSourceNode.start(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.start=c),this.context.state!=="closed"){si(this);const l=()=>{this._nativeConstantSourceNode.removeEventListener("ended",l),ms(this)&&gr(this)};this._nativeConstantSourceNode.addEventListener("ended",l)}}stop(c=0){this._nativeConstantSourceNode.stop(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=c)}},h1=(n,e,t,s,i)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=t(l);const d=Je(h,u);if(!d){const f={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,offset:h.offset.value};h=e(u,f),o!==null&&h.start(o),a!==null&&h.stop(a)}return r.set(u,h),d?await n(u,l.offset,h.offset):await s(u,l.offset,h.offset),await i(l,u,h),h};return{set start(l){o=l},set stop(l){a=l},render(l,u){const h=r.get(u);return h!==void 0?Promise.resolve(h):c(l,u)}}},d1=n=>e=>(n[0]=e,n[0]),f1={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},p1=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=s(a),u={...f1,...c},h=t(l,u),f=i(l)?e():null;super(a,!1,h,f),this._isBufferNullified=!1,this._nativeConvolverNode=h,u.buffer!==null&&r(this,u.buffer.duration)}get buffer(){return this._isBufferNullified?null:this._nativeConvolverNode.buffer}set buffer(a){if(this._nativeConvolverNode.buffer=a,a===null&&this._nativeConvolverNode.buffer!==null){const c=this._nativeConvolverNode.context;this._nativeConvolverNode.buffer=c.createBuffer(1,1,c.sampleRate),this._isBufferNullified=!0,r(this,0)}else this._isBufferNullified=!1,r(this,this._nativeConvolverNode.buffer===null?0:this._nativeConvolverNode.buffer.duration)}get normalize(){return this._nativeConvolverNode.normalize}set normalize(a){this._nativeConvolverNode.normalize=a}},m1=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!Je(a,o)){const l={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=n(o,l)}return s.set(o,a),li(a)?await t(r,o,a.inputs[0]):await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},_1=(n,e)=>(t,s,i)=>{if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new e(t,s,i)}catch(r){throw r.name==="SyntaxError"?n():r}},g1=()=>new DOMException("","DataCloneError"),Ql=n=>{const{port1:e,port2:t}=new MessageChannel;return new Promise(s=>{const i=()=>{t.onmessage=null,e.close(),t.close(),s()};t.onmessage=()=>i();try{e.postMessage(n,[n])}catch{}finally{i()}})},v1=(n,e,t,s,i,r,o,a,c,l,u)=>(h,d)=>{const f=o(h)?h:r(h);if(i.has(d)){const m=t();return Promise.reject(m)}try{i.add(d)}catch{}return e(c,()=>c(f))?f.decodeAudioData(d).then(m=>(Ql(d).catch(()=>{}),e(a,()=>a(m))||u(m),n.add(m),m)):new Promise((m,p)=>{const g=async()=>{try{await Ql(d)}catch{}},y=w=>{p(w),g()};try{f.decodeAudioData(d,w=>{typeof w.copyFromChannel!="function"&&(l(w),bc(w)),n.add(w),g().then(()=>m(w))},w=>{y(w===null?s():w)})}catch(w){y(w)}})},y1=(n,e,t,s,i,r,o,a)=>(c,l)=>{const u=e.get(c);if(u===void 0)throw new Error("Missing the expected cycle count.");const h=r(c.context),d=a(h);if(u===l){if(e.delete(c),!d&&o(c)){const f=s(c),{outputs:m}=t(c);for(const p of m)if(yr(p)){const g=s(p[0]);n(f,g,p[1],p[2])}else{const g=i(p[0]);f.connect(g,p[1])}}}else e.set(c,u-l)},x1={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},T1=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...x1,...l},d=s(u,h),f=r(u),m=f?t(h.maxDelayTime):null;super(c,!1,d,m),this._delayTime=e(this,f,d.delayTime),o(this,h.maxDelayTime)}get delayTime(){return this._delayTime}},k1=(n,e,t,s,i)=>r=>{const o=new WeakMap,a=async(c,l)=>{let u=t(c);const h=Je(u,l);if(!h){const d={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:r};u=e(l,d)}return o.set(l,u),h?await n(l,c.delayTime,u.delayTime):await s(l,c.delayTime,u.delayTime),await i(c,l,u),u};return{render(c,l){const u=o.get(l);return u!==void 0?Promise.resolve(u):a(c,l)}}},w1=n=>(e,t,s,i)=>n(e[i],r=>r[0]===t&&r[1]===s),S1=n=>(e,t)=>{n(e).delete(t)},C1=n=>"delayTime"in n,b1=(n,e,t)=>function s(i,r){const o=oo(r)?r:t(n,r);if(C1(o))return[];if(i[0]===o)return[i];if(i.includes(o))return[];const{outputs:a}=e(o);return Array.from(a).map(c=>s([...i,o],c[0])).reduce((c,l)=>c.concat(l),[])},Lr=(n,e,t)=>{const s=e[t];if(s===void 0)throw n();return s},E1=n=>(e,t=void 0,s=void 0,i=0)=>t===void 0?e.forEach(r=>r.disconnect()):typeof t=="number"?Lr(n,e,t).disconnect():lo(t)?s===void 0?e.forEach(r=>r.disconnect(t)):i===void 0?Lr(n,e,s).disconnect(t,0):Lr(n,e,s).disconnect(t,0,i):s===void 0?e.forEach(r=>r.disconnect(t)):Lr(n,e,s).disconnect(t,0),O1={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},A1=(n,e,t,s,i,r,o,a)=>class extends n{constructor(l,u){const h=r(l),d={...O1,...u},f=s(h,d),m=o(h),p=m?t():null;super(l,!1,f,p),this._attack=e(this,m,f.attack),this._knee=e(this,m,f.knee),this._nativeDynamicsCompressorNode=f,this._ratio=e(this,m,f.ratio),this._release=e(this,m,f.release),this._threshold=e(this,m,f.threshold),a(this,.006)}get attack(){return this._attack}get channelCount(){return this._nativeDynamicsCompressorNode.channelCount}set channelCount(l){const u=this._nativeDynamicsCompressorNode.channelCount;if(this._nativeDynamicsCompressorNode.channelCount=l,l>2)throw this._nativeDynamicsCompressorNode.channelCount=u,i()}get channelCountMode(){return this._nativeDynamicsCompressorNode.channelCountMode}set channelCountMode(l){const u=this._nativeDynamicsCompressorNode.channelCountMode;if(this._nativeDynamicsCompressorNode.channelCountMode=l,l==="max")throw this._nativeDynamicsCompressorNode.channelCountMode=u,i()}get knee(){return this._knee}get ratio(){return this._ratio}get reduction(){return typeof this._nativeDynamicsCompressorNode.reduction.value=="number"?this._nativeDynamicsCompressorNode.reduction.value:this._nativeDynamicsCompressorNode.reduction}get release(){return this._release}get threshold(){return this._threshold}},M1=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=Je(l,c);if(!u){const h={attack:l.attack.value,channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,knee:l.knee.value,ratio:l.ratio.value,release:l.release.value,threshold:l.threshold.value};l=e(c,h)}return r.set(c,l),u?(await n(c,a.attack,l.attack),await n(c,a.knee,l.knee),await n(c,a.ratio,l.ratio),await n(c,a.release,l.release),await n(c,a.threshold,l.threshold)):(await s(c,a.attack,l.attack),await s(c,a.knee,l.knee),await s(c,a.ratio,l.ratio),await s(c,a.release,l.release),await s(c,a.threshold,l.threshold)),await i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},D1=()=>new DOMException("","EncodingError"),R1=n=>e=>new Promise((t,s)=>{if(n===null){s(new SyntaxError);return}const i=n.document.head;if(i===null)s(new SyntaxError);else{const r=n.document.createElement("script"),o=new Blob([e],{type:"application/javascript"}),a=URL.createObjectURL(o),c=n.onerror,l=()=>{n.onerror=c,URL.revokeObjectURL(a)};n.onerror=(u,h,d,f,m)=>{if(h===a||h===n.location.href&&d===1&&f===1)return l(),s(m),!1;if(c!==null)return c(u,h,d,f,m)},r.onerror=()=>{l(),s(new SyntaxError)},r.onload=()=>{l(),t()},r.src=a,r.type="module",i.appendChild(r)}}),P1=n=>class{constructor(t){this._nativeEventTarget=t,this._listeners=new WeakMap}addEventListener(t,s,i){if(s!==null){let r=this._listeners.get(s);r===void 0&&(r=n(this,s),typeof s=="function"&&this._listeners.set(s,r)),this._nativeEventTarget.addEventListener(t,r,i)}}dispatchEvent(t){return this._nativeEventTarget.dispatchEvent(t)}removeEventListener(t,s,i){const r=s===null?void 0:this._listeners.get(s);this._nativeEventTarget.removeEventListener(t,r===void 0?null:r,i)}},I1=n=>(e,t,s)=>{Object.defineProperties(n,{currentFrame:{configurable:!0,get(){return Math.round(e*t)}},currentTime:{configurable:!0,get(){return e}}});try{return s()}finally{n!==null&&(delete n.currentFrame,delete n.currentTime)}},N1=n=>async e=>{try{const t=await fetch(e);if(t.ok)return[await t.text(),t.url]}catch{}throw n()},F1={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},U1=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=i(a),u={...F1,...c},h=s(l,u),d=r(l),f=d?t():null;super(a,!1,h,f),this._gain=e(this,d,h.gain,et,at)}get gain(){return this._gain}},L1=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=Je(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=e(c,h)}return r.set(c,l),u?await n(c,a.gain,l.gain):await s(c,a.gain,l.gain),await i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},z1=(n,e)=>t=>e(n,t),B1=n=>e=>{const t=n(e);if(t.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return t.renderer},V1=n=>e=>{var t;return(t=n.get(e))!==null&&t!==void 0?t:0},j1=n=>e=>{const t=n(e);if(t.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return t.renderer},H1=n=>e=>n.get(e),We=()=>new DOMException("","InvalidStateError"),q1=n=>e=>{const t=n.get(e);if(t===void 0)throw We();return t},W1=(n,e)=>t=>{let s=n.get(t);if(s!==void 0)return s;if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new e(1,1,44100),n.set(t,s),s},G1=n=>e=>{const t=n.get(e);if(t===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return t},Uo=()=>new DOMException("","InvalidAccessError"),Y1=n=>{n.getFrequencyResponse=(e=>(t,s,i)=>{if(t.length!==s.length||s.length!==i.length)throw Uo();return e.call(n,t,s,i)})(n.getFrequencyResponse)},Z1={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},X1=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=s(a),u=i(l),h={...Z1,...c},d=e(l,u?null:a.baseLatency,h),f=u?t(h.feedback,h.feedforward):null;super(a,!1,d,f),Y1(d),this._nativeIIRFilterNode=d,r(this,1)}getFrequencyResponse(a,c,l){return this._nativeIIRFilterNode.getFrequencyResponse(a,c,l)}},Zh=(n,e,t,s,i,r,o,a,c,l,u)=>{const h=l.length;let d=a;for(let f=0;f{const i=t instanceof Float64Array?t:new Float64Array(t),r=s instanceof Float64Array?s:new Float64Array(s),o=i.length,a=r.length,c=Math.min(o,a);if(i[0]!==1){for(let m=0;m(r,o)=>{const a=new WeakMap;let c=null;const l=async(u,h)=>{let d=null,f=e(u);const m=Je(f,h);if(h.createIIRFilter===void 0?d=n(h,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):m||(f=h.createIIRFilter(o,r)),a.set(h,d===null?f:d),d!==null){if(c===null){if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");const g=new t(u.context.destination.channelCount,u.context.length,h.sampleRate);c=(async()=>{await s(u,g,g.destination);const y=await i(g);return $1(y,h,r,o)})()}const p=await c;return d.buffer=p,d.start(0),d}return await s(u,h,f),f};return{render(u,h){const d=a.get(h);return d!==void 0?Promise.resolve(d):l(u,h)}}},K1=(n,e,t,s,i,r)=>o=>(a,c)=>{const l=n.get(a);if(l===void 0){if(!o&&r(a)){const u=s(a),{outputs:h}=t(a);for(const d of h)if(yr(d)){const f=s(d[0]);e(u,f,d[1],d[2])}else{const f=i(d[0]);u.disconnect(f,d[1])}}n.set(a,c)}else n.set(a,l+c)},J1=(n,e)=>t=>{const s=n.get(t);return e(s)||e(t)},ev=(n,e)=>t=>n.has(t)||e(t),tv=(n,e)=>t=>n.has(t)||e(t),sv=(n,e)=>t=>{const s=n.get(t);return e(s)||e(t)},nv=n=>e=>n!==null&&e instanceof n,iv=n=>e=>n!==null&&typeof n.AudioNode=="function"&&e instanceof n.AudioNode,rv=n=>e=>n!==null&&typeof n.AudioParam=="function"&&e instanceof n.AudioParam,ov=(n,e)=>t=>n(t)||e(t),av=n=>e=>n!==null&&e instanceof n,cv=n=>n!==null&&n.isSecureContext,lv=(n,e,t,s)=>class extends n{constructor(r,o){const a=t(r),c=e(a,o);if(s(a))throw TypeError();super(r,!0,c,null),this._nativeMediaElementAudioSourceNode=c}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},uv={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},hv=(n,e,t,s)=>class extends n{constructor(r,o){const a=t(r);if(s(a))throw new TypeError;const c={...uv,...o},l=e(a,c);super(r,!1,l,null),this._nativeMediaStreamAudioDestinationNode=l}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},dv=(n,e,t,s)=>class extends n{constructor(r,o){const a=t(r),c=e(a,o);if(s(a))throw new TypeError;super(r,!0,c,null),this._nativeMediaStreamAudioSourceNode=c}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},fv=(n,e,t)=>class extends n{constructor(i,r){const o=t(i),a=e(o,r);super(i,!0,a,null)}},pv=(n,e,t,s,i,r)=>class extends t{constructor(a,c){super(a),this._nativeContext=a,No.set(this,a),s(a)&&i.set(a,new Set),this._destination=new n(this,c),this._listener=e(this,a),this._onstatechange=null}get currentTime(){return this._nativeContext.currentTime}get destination(){return this._destination}get listener(){return this._listener}get onstatechange(){return this._onstatechange}set onstatechange(a){const c=typeof a=="function"?r(this,a):null;this._nativeContext.onstatechange=c;const l=this._nativeContext.onstatechange;this._onstatechange=l!==null&&l===c?a:l}get sampleRate(){return this._nativeContext.sampleRate}get state(){return this._nativeContext.state}},Zi=n=>{const e=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const t=n.decodeAudioData(e.buffer,()=>{});return t===void 0?!1:(t.catch(()=>{}),!0)}catch{}return!1},mv=(n,e)=>(t,s,i)=>{const r=new Set;return t.connect=(o=>(a,c=0,l=0)=>{const u=r.size===0;if(e(a))return o.call(t,a,c,l),n(r,[a,c,l],h=>h[0]===a&&h[1]===c&&h[2]===l,!0),u&&s(),a;o.call(t,a,c),n(r,[a,c],h=>h[0]===a&&h[1]===c,!0),u&&s()})(t.connect),t.disconnect=(o=>(a,c,l)=>{const u=r.size>0;if(a===void 0)o.apply(t),r.clear();else if(typeof a=="number"){o.call(t,a);for(const d of r)d[1]===a&&r.delete(d)}else{e(a)?o.call(t,a,c,l):o.call(t,a,c);for(const d of r)d[0]===a&&(c===void 0||d[1]===c)&&(l===void 0||d[2]===l)&&r.delete(d)}const h=r.size===0;u&&h&&i()})(t.disconnect),t},we=(n,e,t)=>{const s=e[t];s!==void 0&&s!==n[t]&&(n[t]=s)},Be=(n,e)=>{we(n,e,"channelCount"),we(n,e,"channelCountMode"),we(n,e,"channelInterpretation")},Kl=n=>typeof n.getFloatTimeDomainData=="function",_v=n=>{n.getFloatTimeDomainData=e=>{const t=new Uint8Array(e.length);n.getByteTimeDomainData(t);const s=Math.max(t.length,n.fftSize);for(let i=0;i(t,s)=>{const i=t.createAnalyser();if(Be(i,s),!(s.maxDecibels>s.minDecibels))throw e();return we(i,s,"fftSize"),we(i,s,"maxDecibels"),we(i,s,"minDecibels"),we(i,s,"smoothingTimeConstant"),n(Kl,()=>Kl(i))||_v(i),i},vv=n=>n===null?null:n.hasOwnProperty("AudioBuffer")?n.AudioBuffer:null,Me=(n,e,t)=>{const s=e[t];s!==void 0&&s!==n[t].value&&(n[t].value=s)},yv=n=>{n.start=(e=>{let t=!1;return(s=0,i=0,r)=>{if(t)throw We();e.call(n,s,i,r),t=!0}})(n.start)},Ac=n=>{n.start=(e=>(t=0,s=0,i)=>{if(typeof i=="number"&&i<0||s<0||t<0)throw new RangeError("The parameters can't be negative.");e.call(n,t,s,i)})(n.start)},Mc=n=>{n.stop=(e=>(t=0)=>{if(t<0)throw new RangeError("The parameter can't be negative.");e.call(n,t)})(n.stop)},xv=(n,e,t,s,i,r,o,a,c,l,u)=>(h,d)=>{const f=h.createBufferSource();return Be(f,d),Me(f,d,"playbackRate"),we(f,d,"buffer"),we(f,d,"loop"),we(f,d,"loopEnd"),we(f,d,"loopStart"),e(t,()=>t(h))||yv(f),e(s,()=>s(h))||c(f),e(i,()=>i(h))||l(f,h),e(r,()=>r(h))||Ac(f),e(o,()=>o(h))||u(f,h),e(a,()=>a(h))||Mc(f),n(h,f),f},Tv=n=>n===null?null:n.hasOwnProperty("AudioContext")?n.AudioContext:n.hasOwnProperty("webkitAudioContext")?n.webkitAudioContext:null,kv=(n,e)=>(t,s,i)=>{const r=t.destination;if(r.channelCount!==s)try{r.channelCount=s}catch{}i&&r.channelCountMode!=="explicit"&&(r.channelCountMode="explicit"),r.maxChannelCount===0&&Object.defineProperty(r,"maxChannelCount",{value:s});const o=n(t,{channelCount:s,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,gain:1});return e(o,"channelCount",a=>()=>a.call(o),a=>c=>{a.call(o,c);try{r.channelCount=c}catch(l){if(c>r.maxChannelCount)throw l}}),e(o,"channelCountMode",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelCountMode=c}),e(o,"channelInterpretation",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelInterpretation=c}),Object.defineProperty(o,"maxChannelCount",{get:()=>r.maxChannelCount}),o.connect(r),o},wv=n=>n===null?null:n.hasOwnProperty("AudioWorkletNode")?n.AudioWorkletNode:null,Sv=n=>{const{port1:e}=new MessageChannel;try{e.postMessage(n)}finally{e.close()}},Cv=(n,e,t,s,i)=>(r,o,a,c,l,u)=>{if(a!==null)try{const h=new a(r,c,u),d=new Map;let f=null;if(Object.defineProperties(h,{channelCount:{get:()=>u.channelCount,set:()=>{throw n()}},channelCountMode:{get:()=>"explicit",set:()=>{throw n()}},onprocessorerror:{get:()=>f,set:m=>{typeof f=="function"&&h.removeEventListener("processorerror",f),f=typeof m=="function"?m:null,typeof f=="function"&&h.addEventListener("processorerror",f)}}}),h.addEventListener=(m=>(...p)=>{if(p[0]==="processorerror"){const g=typeof p[1]=="function"?p[1]:typeof p[1]=="object"&&p[1]!==null&&typeof p[1].handleEvent=="function"?p[1].handleEvent:null;if(g!==null){const y=d.get(p[1]);y!==void 0?p[1]=y:(p[1]=w=>{w.type==="error"?(Object.defineProperties(w,{type:{value:"processorerror"}}),g(w)):g(new ErrorEvent(p[0],{...w}))},d.set(g,p[1]))}}return m.call(h,"error",p[1],p[2]),m.call(h,...p)})(h.addEventListener),h.removeEventListener=(m=>(...p)=>{if(p[0]==="processorerror"){const g=d.get(p[1]);g!==void 0&&(d.delete(p[1]),p[1]=g)}return m.call(h,"error",p[1],p[2]),m.call(h,p[0],p[1],p[2])})(h.removeEventListener),u.numberOfOutputs!==0){const m=t(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return h.connect(m).connect(r.destination),i(h,()=>m.disconnect(),()=>m.connect(r.destination))}return h}catch(h){throw h.code===11?s():h}if(l===void 0)throw s();return Sv(u),e(r,o,l,u)},Xh=(n,e)=>n===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(n*e))))),bv=n=>new Promise((e,t)=>{const{port1:s,port2:i}=new MessageChannel;s.onmessage=({data:r})=>{s.close(),i.close(),e(r)},s.onmessageerror=({data:r})=>{s.close(),i.close(),t(r)},i.postMessage(n)}),Ev=async(n,e)=>{const t=await bv(e);return new n(t)},Ov=(n,e,t,s)=>{let i=qa.get(n);i===void 0&&(i=new WeakMap,qa.set(n,i));const r=Ev(t,s);return i.set(e,r),r},Av=(n,e,t,s,i,r,o,a,c,l,u,h,d)=>(f,m,p,g)=>{if(g.numberOfInputs===0&&g.numberOfOutputs===0)throw c();const y=Array.isArray(g.outputChannelCount)?g.outputChannelCount:Array.from(g.outputChannelCount);if(y.some(L=>L<1))throw c();if(y.length!==g.numberOfOutputs)throw e();if(g.channelCountMode!=="explicit")throw c();const w=g.channelCount*g.numberOfInputs,S=y.reduce((L,Y)=>L+Y,0),v=p.parameterDescriptors===void 0?0:p.parameterDescriptors.length;if(w+v>6||S>6)throw c();const _=new MessageChannel,T=[],x=[];for(let L=0;LL===void 0?0:L},maxValue:{get:()=>Y===void 0?et:Y},minValue:{get:()=>ze===void 0?at:ze}}),k.push(re)}const C=s(f,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,w+v)}),E=Xh(m,f.sampleRate),O=a(f,E,w+v,Math.max(1,S)),A=i(f,{channelCount:Math.max(1,S),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,S)}),R=[];for(let L=0;L{const ze=k[Y];return ze.connect(C,0,w+Y),ze.start(0),[L,ze.offset]}));C.connect(O);let F=g.channelInterpretation,N=null;const U=g.numberOfOutputs===0?[O]:R,V={get bufferSize(){return E},get channelCount(){return g.channelCount},set channelCount(L){throw t()},get channelCountMode(){return g.channelCountMode},set channelCountMode(L){throw t()},get channelInterpretation(){return F},set channelInterpretation(L){for(const Y of T)Y.channelInterpretation=L;F=L},get context(){return O.context},get inputs(){return T},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get onprocessorerror(){return N},set onprocessorerror(L){typeof N=="function"&&V.removeEventListener("processorerror",N),N=typeof L=="function"?L:null,typeof N=="function"&&V.addEventListener("processorerror",N)},get parameters(){return P},get port(){return _.port2},addEventListener(...L){return O.addEventListener(L[0],L[1],L[2])},connect:n.bind(null,U),disconnect:l.bind(null,U),dispatchEvent(...L){return O.dispatchEvent(L[0])},removeEventListener(...L){return O.removeEventListener(L[0],L[1],L[2])}},B=new Map;_.port1.addEventListener=(L=>(...Y)=>{if(Y[0]==="message"){const ze=typeof Y[1]=="function"?Y[1]:typeof Y[1]=="object"&&Y[1]!==null&&typeof Y[1].handleEvent=="function"?Y[1].handleEvent:null;if(ze!==null){const Se=B.get(Y[1]);Se!==void 0?Y[1]=Se:(Y[1]=re=>{u(f.currentTime,f.sampleRate,()=>ze(re))},B.set(ze,Y[1]))}}return L.call(_.port1,Y[0],Y[1],Y[2])})(_.port1.addEventListener),_.port1.removeEventListener=(L=>(...Y)=>{if(Y[0]==="message"){const ze=B.get(Y[1]);ze!==void 0&&(B.delete(Y[1]),Y[1]=ze)}return L.call(_.port1,Y[0],Y[1],Y[2])})(_.port1.removeEventListener);let q=null;Object.defineProperty(_.port1,"onmessage",{get:()=>q,set:L=>{typeof q=="function"&&_.port1.removeEventListener("message",q),q=typeof L=="function"?L:null,typeof q=="function"&&(_.port1.addEventListener("message",q),_.port1.start())}}),p.prototype.port=_.port1;let j=null;Ov(f,V,p,g).then(L=>j=L);const Te=ho(g.numberOfInputs,g.channelCount),ae=ho(g.numberOfOutputs,y),X=p.parameterDescriptors===void 0?[]:p.parameterDescriptors.reduce((L,{name:Y})=>({...L,[Y]:new Float32Array(128)}),{});let me=!0;const Ye=()=>{g.numberOfOutputs>0&&O.disconnect(A);for(let L=0,Y=0;L{if(j!==null){const ze=h(V);for(let Se=0;Se{uo(L,X,re,w+Oe,Se)});for(let re=0;re{if(ze[bs].size>0)return H.set(bs,E/128),St;const Xo=H.get(bs);return Xo===void 0?[]:(St.every(Zd=>Zd.every(Xd=>Xd===0))&&(Xo===1?H.delete(bs):H.set(bs,Xo-1)),St)});me=u(f.currentTime+Se/f.sampleRate,f.sampleRate,()=>j.process(re,ae,X));for(let St=0,bs=0;StO.connect(Ks).connect(f.destination),On=()=>{O.disconnect(Ks),Ks.disconnect()},Gd=()=>{if(me){On(),g.numberOfOutputs>0&&O.connect(A);for(let L=0,Y=0;L{me&&(En(),Ye()),Qs=!1};return En(),d(V,Gd,Yd)},$h=(n,e)=>{const t=n.createBiquadFilter();return Be(t,e),Me(t,e,"Q"),Me(t,e,"detune"),Me(t,e,"frequency"),Me(t,e,"gain"),we(t,e,"type"),t},Mv=(n,e)=>(t,s)=>{const i=t.createChannelMerger(s.numberOfInputs);return n!==null&&n.name==="webkitAudioContext"&&e(t,i),Be(i,s),i},Dv=n=>{const e=n.numberOfOutputs;Object.defineProperty(n,"channelCount",{get:()=>e,set:t=>{if(t!==e)throw We()}}),Object.defineProperty(n,"channelCountMode",{get:()=>"explicit",set:t=>{if(t!=="explicit")throw We()}}),Object.defineProperty(n,"channelInterpretation",{get:()=>"discrete",set:t=>{if(t!=="discrete")throw We()}})},xr=(n,e)=>{const t=n.createChannelSplitter(e.numberOfOutputs);return Be(t,e),Dv(t),t},Rv=(n,e,t,s,i)=>(r,o)=>{if(r.createConstantSource===void 0)return t(r,o);const a=r.createConstantSource();return Be(a,o),Me(a,o,"offset"),e(s,()=>s(r))||Ac(a),e(i,()=>i(r))||Mc(a),n(r,a),a},ui=(n,e)=>(n.connect=e.connect.bind(e),n.disconnect=e.disconnect.bind(e),n),Pv=(n,e,t,s)=>(i,{offset:r,...o})=>{const a=i.createBuffer(1,2,44100),c=e(i,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),l=t(i,{...o,gain:r}),u=a.getChannelData(0);u[0]=1,u[1]=1,c.buffer=a,c.loop=!0;const h={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(m){l.channelCount=m},get channelCountMode(){return l.channelCountMode},set channelCountMode(m){l.channelCountMode=m},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(m){l.channelInterpretation=m},get context(){return l.context},get inputs(){return[]},get numberOfInputs(){return c.numberOfInputs},get numberOfOutputs(){return l.numberOfOutputs},get offset(){return l.gain},get onended(){return c.onended},set onended(m){c.onended=m},addEventListener(...m){return c.addEventListener(m[0],m[1],m[2])},dispatchEvent(...m){return c.dispatchEvent(m[0])},removeEventListener(...m){return c.removeEventListener(m[0],m[1],m[2])},start(m=0){c.start.call(c,m)},stop(m=0){c.stop.call(c,m)}},d=()=>c.connect(l),f=()=>c.disconnect(l);return n(i,c),s(ui(h,l),d,f)},Iv=(n,e)=>(t,s)=>{const i=t.createConvolver();if(Be(i,s),s.disableNormalization===i.normalize&&(i.normalize=!s.disableNormalization),we(i,s,"buffer"),s.channelCount>2||(e(i,"channelCount",r=>()=>r.call(i),r=>o=>{if(o>2)throw n();return r.call(i,o)}),s.channelCountMode==="max"))throw n();return e(i,"channelCountMode",r=>()=>r.call(i),r=>o=>{if(o==="max")throw n();return r.call(i,o)}),i},Qh=(n,e)=>{const t=n.createDelay(e.maxDelayTime);return Be(t,e),Me(t,e,"delayTime"),t},Nv=n=>(e,t)=>{const s=e.createDynamicsCompressor();if(Be(s,t),t.channelCount>2||t.channelCountMode==="max")throw n();return Me(s,t,"attack"),Me(s,t,"knee"),Me(s,t,"ratio"),Me(s,t,"release"),Me(s,t,"threshold"),s},pt=(n,e)=>{const t=n.createGain();return Be(t,e),Me(t,e,"gain"),t},Fv=n=>(e,t,s)=>{if(e.createIIRFilter===void 0)return n(e,t,s);const i=e.createIIRFilter(s.feedforward,s.feedback);return Be(i,s),i};function Uv(n,e){const t=e[0]*e[0]+e[1]*e[1];return[(n[0]*e[0]+n[1]*e[1])/t,(n[1]*e[0]-n[0]*e[1])/t]}function Lv(n,e){return[n[0]*e[0]-n[1]*e[1],n[0]*e[1]+n[1]*e[0]]}function Jl(n,e){let t=[0,0];for(let s=n.length-1;s>=0;s-=1)t=Lv(t,e),t[0]+=n[s];return t}const zv=(n,e,t,s)=>(i,r,{channelCount:o,channelCountMode:a,channelInterpretation:c,feedback:l,feedforward:u})=>{const h=Xh(r,i.sampleRate),d=l instanceof Float64Array?l:new Float64Array(l),f=u instanceof Float64Array?u:new Float64Array(u),m=d.length,p=f.length,g=Math.min(m,p);if(m===0||m>20)throw s();if(d[0]===0)throw e();if(p===0||p>20)throw s();if(f[0]===0)throw e();if(d[0]!==1){for(let k=0;k{const C=k.inputBuffer,E=k.outputBuffer,O=C.numberOfChannels;for(let A=0;An.createMediaElementSource(e.mediaElement),Vv=(n,e)=>{const t=n.createMediaStreamDestination();return Be(t,e),t.numberOfOutputs===1&&Object.defineProperty(t,"numberOfOutputs",{get:()=>0}),t},jv=(n,{mediaStream:e})=>{const t=e.getAudioTracks();t.sort((r,o)=>r.ido.id?1:0);const s=t.slice(0,1),i=n.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(i,"mediaStream",{value:e}),i},Hv=(n,e)=>(t,{mediaStreamTrack:s})=>{if(typeof t.createMediaStreamTrackSource=="function")return t.createMediaStreamTrackSource(s);const i=new MediaStream([s]),r=t.createMediaStreamSource(i);if(s.kind!=="audio")throw n();if(e(t))throw new TypeError;return r},qv=n=>n===null?null:n.hasOwnProperty("OfflineAudioContext")?n.OfflineAudioContext:n.hasOwnProperty("webkitOfflineAudioContext")?n.webkitOfflineAudioContext:null,Wv=(n,e,t,s,i,r)=>(o,a)=>{const c=o.createOscillator();return Be(c,a),Me(c,a,"detune"),Me(c,a,"frequency"),a.periodicWave!==void 0?c.setPeriodicWave(a.periodicWave):we(c,a,"type"),e(t,()=>t(o))||Ac(c),e(s,()=>s(o))||r(c,o),e(i,()=>i(o))||Mc(c),n(o,c),c},Gv=n=>(e,t)=>{const s=e.createPanner();return s.orientationX===void 0?n(e,t):(Be(s,t),Me(s,t,"orientationX"),Me(s,t,"orientationY"),Me(s,t,"orientationZ"),Me(s,t,"positionX"),Me(s,t,"positionY"),Me(s,t,"positionZ"),we(s,t,"coneInnerAngle"),we(s,t,"coneOuterAngle"),we(s,t,"coneOuterGain"),we(s,t,"distanceModel"),we(s,t,"maxDistance"),we(s,t,"panningModel"),we(s,t,"refDistance"),we(s,t,"rolloffFactor"),s)},Yv=(n,e,t,s,i,r,o,a,c,l)=>(u,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:f,distanceModel:m,maxDistance:p,orientationX:g,orientationY:y,orientationZ:w,panningModel:S,positionX:v,positionY:_,positionZ:T,refDistance:x,rolloffFactor:k,...C})=>{const E=u.createPanner();if(C.channelCount>2||C.channelCountMode==="max")throw o();Be(E,C);const O={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},A=t(u,{...O,channelInterpretation:"speakers",numberOfInputs:6}),R=s(u,{...C,gain:1}),P=s(u,{...O,gain:1}),F=s(u,{...O,gain:0}),N=s(u,{...O,gain:0}),U=s(u,{...O,gain:0}),V=s(u,{...O,gain:0}),B=s(u,{...O,gain:0}),q=i(u,256,6,1),j=r(u,{...O,curve:new Float32Array([1,1]),oversample:"none"});let z=[g,y,w],Te=[v,_,T];const ae=new Float32Array(1);q.onaudioprocess=({inputBuffer:H})=>{const Qs=[c(H,ae,0),c(H,ae,1),c(H,ae,2)];Qs.some((En,On)=>En!==z[On])&&(E.setOrientation(...Qs),z=Qs);const Ks=[c(H,ae,3),c(H,ae,4),c(H,ae,5)];Ks.some((En,On)=>En!==Te[On])&&(E.setPosition(...Ks),Te=Ks)},Object.defineProperty(F.gain,"defaultValue",{get:()=>0}),Object.defineProperty(N.gain,"defaultValue",{get:()=>0}),Object.defineProperty(U.gain,"defaultValue",{get:()=>0}),Object.defineProperty(V.gain,"defaultValue",{get:()=>0}),Object.defineProperty(B.gain,"defaultValue",{get:()=>0});const X={get bufferSize(){},get channelCount(){return E.channelCount},set channelCount(H){if(H>2)throw o();R.channelCount=H,E.channelCount=H},get channelCountMode(){return E.channelCountMode},set channelCountMode(H){if(H==="max")throw o();R.channelCountMode=H,E.channelCountMode=H},get channelInterpretation(){return E.channelInterpretation},set channelInterpretation(H){R.channelInterpretation=H,E.channelInterpretation=H},get coneInnerAngle(){return E.coneInnerAngle},set coneInnerAngle(H){E.coneInnerAngle=H},get coneOuterAngle(){return E.coneOuterAngle},set coneOuterAngle(H){E.coneOuterAngle=H},get coneOuterGain(){return E.coneOuterGain},set coneOuterGain(H){if(H<0||H>1)throw e();E.coneOuterGain=H},get context(){return E.context},get distanceModel(){return E.distanceModel},set distanceModel(H){E.distanceModel=H},get inputs(){return[R]},get maxDistance(){return E.maxDistance},set maxDistance(H){if(H<0)throw new RangeError;E.maxDistance=H},get numberOfInputs(){return E.numberOfInputs},get numberOfOutputs(){return E.numberOfOutputs},get orientationX(){return P.gain},get orientationY(){return F.gain},get orientationZ(){return N.gain},get panningModel(){return E.panningModel},set panningModel(H){E.panningModel=H},get positionX(){return U.gain},get positionY(){return V.gain},get positionZ(){return B.gain},get refDistance(){return E.refDistance},set refDistance(H){if(H<0)throw new RangeError;E.refDistance=H},get rolloffFactor(){return E.rolloffFactor},set rolloffFactor(H){if(H<0)throw new RangeError;E.rolloffFactor=H},addEventListener(...H){return R.addEventListener(H[0],H[1],H[2])},dispatchEvent(...H){return R.dispatchEvent(H[0])},removeEventListener(...H){return R.removeEventListener(H[0],H[1],H[2])}};h!==X.coneInnerAngle&&(X.coneInnerAngle=h),d!==X.coneOuterAngle&&(X.coneOuterAngle=d),f!==X.coneOuterGain&&(X.coneOuterGain=f),m!==X.distanceModel&&(X.distanceModel=m),p!==X.maxDistance&&(X.maxDistance=p),g!==X.orientationX.value&&(X.orientationX.value=g),y!==X.orientationY.value&&(X.orientationY.value=y),w!==X.orientationZ.value&&(X.orientationZ.value=w),S!==X.panningModel&&(X.panningModel=S),v!==X.positionX.value&&(X.positionX.value=v),_!==X.positionY.value&&(X.positionY.value=_),T!==X.positionZ.value&&(X.positionZ.value=T),x!==X.refDistance&&(X.refDistance=x),k!==X.rolloffFactor&&(X.rolloffFactor=k),(z[0]!==1||z[1]!==0||z[2]!==0)&&E.setOrientation(...z),(Te[0]!==0||Te[1]!==0||Te[2]!==0)&&E.setPosition(...Te);const me=()=>{R.connect(E),n(R,j,0,0),j.connect(P).connect(A,0,0),j.connect(F).connect(A,0,1),j.connect(N).connect(A,0,2),j.connect(U).connect(A,0,3),j.connect(V).connect(A,0,4),j.connect(B).connect(A,0,5),A.connect(q).connect(u.destination)},Ye=()=>{R.disconnect(E),a(R,j,0,0),j.disconnect(P),P.disconnect(A),j.disconnect(F),F.disconnect(A),j.disconnect(N),N.disconnect(A),j.disconnect(U),U.disconnect(A),j.disconnect(V),V.disconnect(A),j.disconnect(B),B.disconnect(A),A.disconnect(q),q.disconnect(u.destination)};return l(ui(X,E),me,Ye)},Zv=n=>(e,{disableNormalization:t,imag:s,real:i})=>{const r=s instanceof Float32Array?s:new Float32Array(s),o=i instanceof Float32Array?i:new Float32Array(i),a=e.createPeriodicWave(o,r,{disableNormalization:t});if(Array.from(s).length<2)throw n();return a},Tr=(n,e,t,s)=>n.createScriptProcessor(e,t,s),Xv=(n,e)=>(t,s)=>{const i=s.channelCountMode;if(i==="clamped-max")throw e();if(t.createStereoPanner===void 0)return n(t,s);const r=t.createStereoPanner();return Be(r,s),Me(r,s,"pan"),Object.defineProperty(r,"channelCountMode",{get:()=>i,set:o=>{if(o!==i)throw e()}}),r},$v=(n,e,t,s,i,r)=>{const a=new Float32Array([1,1]),c=Math.PI/2,l={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...l,oversample:"none"},h=(m,p,g,y)=>{const w=new Float32Array(16385),S=new Float32Array(16385);for(let C=0;C<16385;C+=1){const E=C/16384*c;w[C]=Math.cos(E),S[C]=Math.sin(E)}const v=t(m,{...l,gain:0}),_=s(m,{...u,curve:w}),T=s(m,{...u,curve:a}),x=t(m,{...l,gain:0}),k=s(m,{...u,curve:S});return{connectGraph(){p.connect(v),p.connect(T.inputs===void 0?T:T.inputs[0]),p.connect(x),T.connect(g),g.connect(_.inputs===void 0?_:_.inputs[0]),g.connect(k.inputs===void 0?k:k.inputs[0]),_.connect(v.gain),k.connect(x.gain),v.connect(y,0,0),x.connect(y,0,1)},disconnectGraph(){p.disconnect(v),p.disconnect(T.inputs===void 0?T:T.inputs[0]),p.disconnect(x),T.disconnect(g),g.disconnect(_.inputs===void 0?_:_.inputs[0]),g.disconnect(k.inputs===void 0?k:k.inputs[0]),_.disconnect(v.gain),k.disconnect(x.gain),v.disconnect(y,0,0),x.disconnect(y,0,1)}}},d=(m,p,g,y)=>{const w=new Float32Array(16385),S=new Float32Array(16385),v=new Float32Array(16385),_=new Float32Array(16385),T=Math.floor(16385/2);for(let U=0;U<16385;U+=1)if(U>T){const V=(U-T)/(16384-T)*c;w[U]=Math.cos(V),S[U]=Math.sin(V),v[U]=0,_[U]=1}else{const V=U/(16384-T)*c;w[U]=1,S[U]=0,v[U]=Math.cos(V),_[U]=Math.sin(V)}const x=e(m,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),k=t(m,{...l,gain:0}),C=s(m,{...u,curve:w}),E=t(m,{...l,gain:0}),O=s(m,{...u,curve:S}),A=s(m,{...u,curve:a}),R=t(m,{...l,gain:0}),P=s(m,{...u,curve:v}),F=t(m,{...l,gain:0}),N=s(m,{...u,curve:_});return{connectGraph(){p.connect(x),p.connect(A.inputs===void 0?A:A.inputs[0]),x.connect(k,0),x.connect(E,0),x.connect(R,1),x.connect(F,1),A.connect(g),g.connect(C.inputs===void 0?C:C.inputs[0]),g.connect(O.inputs===void 0?O:O.inputs[0]),g.connect(P.inputs===void 0?P:P.inputs[0]),g.connect(N.inputs===void 0?N:N.inputs[0]),C.connect(k.gain),O.connect(E.gain),P.connect(R.gain),N.connect(F.gain),k.connect(y,0,0),R.connect(y,0,0),E.connect(y,0,1),F.connect(y,0,1)},disconnectGraph(){p.disconnect(x),p.disconnect(A.inputs===void 0?A:A.inputs[0]),x.disconnect(k,0),x.disconnect(E,0),x.disconnect(R,1),x.disconnect(F,1),A.disconnect(g),g.disconnect(C.inputs===void 0?C:C.inputs[0]),g.disconnect(O.inputs===void 0?O:O.inputs[0]),g.disconnect(P.inputs===void 0?P:P.inputs[0]),g.disconnect(N.inputs===void 0?N:N.inputs[0]),C.disconnect(k.gain),O.disconnect(E.gain),P.disconnect(R.gain),N.disconnect(F.gain),k.disconnect(y,0,0),R.disconnect(y,0,0),E.disconnect(y,0,1),F.disconnect(y,0,1)}}},f=(m,p,g,y,w)=>{if(p===1)return h(m,g,y,w);if(p===2)return d(m,g,y,w);throw i()};return(m,{channelCount:p,channelCountMode:g,pan:y,...w})=>{if(g==="max")throw i();const S=n(m,{...w,channelCount:1,channelCountMode:g,numberOfInputs:2}),v=t(m,{...w,channelCount:p,channelCountMode:g,gain:1}),_=t(m,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:y});let{connectGraph:T,disconnectGraph:x}=f(m,p,v,_,S);Object.defineProperty(_.gain,"defaultValue",{get:()=>0}),Object.defineProperty(_.gain,"maxValue",{get:()=>1}),Object.defineProperty(_.gain,"minValue",{get:()=>-1});const k={get bufferSize(){},get channelCount(){return v.channelCount},set channelCount(A){v.channelCount!==A&&(C&&x(),{connectGraph:T,disconnectGraph:x}=f(m,A,v,_,S),C&&T()),v.channelCount=A},get channelCountMode(){return v.channelCountMode},set channelCountMode(A){if(A==="clamped-max"||A==="max")throw i();v.channelCountMode=A},get channelInterpretation(){return v.channelInterpretation},set channelInterpretation(A){v.channelInterpretation=A},get context(){return v.context},get inputs(){return[v]},get numberOfInputs(){return v.numberOfInputs},get numberOfOutputs(){return v.numberOfOutputs},get pan(){return _.gain},addEventListener(...A){return v.addEventListener(A[0],A[1],A[2])},dispatchEvent(...A){return v.dispatchEvent(A[0])},removeEventListener(...A){return v.removeEventListener(A[0],A[1],A[2])}};let C=!1;const E=()=>{T(),C=!0},O=()=>{x(),C=!1};return r(ui(k,S),E,O)}},Qv=(n,e,t,s,i,r,o)=>(a,c)=>{const l=a.createWaveShaper();if(r!==null&&r.name==="webkitAudioContext"&&a.createGain().gain.automationRate===void 0)return t(a,c);Be(l,c);const u=c.curve===null||c.curve instanceof Float32Array?c.curve:new Float32Array(c.curve);if(u!==null&&u.length<2)throw e();we(l,{curve:u},"curve"),we(l,c,"oversample");let h=null,d=!1;return o(l,"curve",p=>()=>p.call(l),p=>g=>(p.call(l,g),d&&(s(g)&&h===null?h=n(a,l):!s(g)&&h!==null&&(h(),h=null)),g)),i(l,()=>{d=!0,s(l.curve)&&(h=n(a,l))},()=>{d=!1,h!==null&&(h(),h=null)})},Kv=(n,e,t,s,i)=>(r,{curve:o,oversample:a,...c})=>{const l=r.createWaveShaper(),u=r.createWaveShaper();Be(l,c),Be(u,c);const h=t(r,{...c,gain:1}),d=t(r,{...c,gain:-1}),f=t(r,{...c,gain:1}),m=t(r,{...c,gain:-1});let p=null,g=!1,y=null;const w={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(_){h.channelCount=_,d.channelCount=_,l.channelCount=_,f.channelCount=_,u.channelCount=_,m.channelCount=_},get channelCountMode(){return l.channelCountMode},set channelCountMode(_){h.channelCountMode=_,d.channelCountMode=_,l.channelCountMode=_,f.channelCountMode=_,u.channelCountMode=_,m.channelCountMode=_},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(_){h.channelInterpretation=_,d.channelInterpretation=_,l.channelInterpretation=_,f.channelInterpretation=_,u.channelInterpretation=_,m.channelInterpretation=_},get context(){return l.context},get curve(){return y},set curve(_){if(_!==null&&_.length<2)throw e();if(_===null)l.curve=_,u.curve=_;else{const T=_.length,x=new Float32Array(T+2-T%2),k=new Float32Array(T+2-T%2);x[0]=_[0],k[0]=-_[T-1];const C=Math.ceil((T+1)/2),E=(T+1)/2-1;for(let O=1;O{h.connect(l).connect(f),h.connect(d).connect(u).connect(m).connect(f),g=!0,s(y)&&(p=n(r,h))},v=()=>{h.disconnect(l),l.disconnect(f),h.disconnect(d),d.disconnect(u),u.disconnect(m),m.disconnect(f),g=!1,p!==null&&(p(),p=null)};return i(ui(w,f),S,v)},rt=()=>new DOMException("","NotSupportedError"),Jv={numberOfChannels:1},ey=(n,e,t,s,i)=>class extends n{constructor(o,a,c){let l;if(typeof o=="number"&&a!==void 0&&c!==void 0)l={length:a,numberOfChannels:o,sampleRate:c};else if(typeof o=="object")l=o;else throw new Error("The given parameters are not valid.");const{length:u,numberOfChannels:h,sampleRate:d}={...Jv,...l},f=s(h,u,d);e(Zi,()=>Zi(f))||f.addEventListener("statechange",(()=>{let m=0;const p=g=>{this._state==="running"&&(m>0?(f.removeEventListener("statechange",p),g.stopImmediatePropagation(),this._waitForThePromiseToSettle(g)):m+=1)};return p})()),super(f,h),this._length=u,this._nativeOfflineAudioContext=f,this._state=null}get length(){return this._nativeOfflineAudioContext.length===void 0?this._length:this._nativeOfflineAudioContext.length}get state(){return this._state===null?this._nativeOfflineAudioContext.state:this._state}startRendering(){return this._state==="running"?Promise.reject(t()):(this._state="running",i(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,jh(this)}))}_waitForThePromiseToSettle(o){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(o):setTimeout(()=>this._waitForThePromiseToSettle(o))}},ty={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},sy=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...ty,...l},d=t(u,h),f=r(u),m=f?s():null,p=c.sampleRate/2;super(c,!1,d,m),this._detune=e(this,f,d.detune,153600,-153600),this._frequency=e(this,f,d.frequency,p,-p),this._nativeOscillatorNode=d,this._onended=null,this._oscillatorNodeRenderer=m,this._oscillatorNodeRenderer!==null&&h.periodicWave!==void 0&&(this._oscillatorNodeRenderer.periodicWave=h.periodicWave)}get detune(){return this._detune}get frequency(){return this._frequency}get onended(){return this._onended}set onended(c){const l=typeof c=="function"?o(this,c):null;this._nativeOscillatorNode.onended=l;const u=this._nativeOscillatorNode.onended;this._onended=u!==null&&u===l?c:u}get type(){return this._nativeOscillatorNode.type}set type(c){this._nativeOscillatorNode.type=c,this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=null)}setPeriodicWave(c){this._nativeOscillatorNode.setPeriodicWave(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.periodicWave=c)}start(c=0){if(this._nativeOscillatorNode.start(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.start=c),this.context.state!=="closed"){si(this);const l=()=>{this._nativeOscillatorNode.removeEventListener("ended",l),ms(this)&&gr(this)};this._nativeOscillatorNode.addEventListener("ended",l)}}stop(c=0){this._nativeOscillatorNode.stop(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=c)}},ny=(n,e,t,s,i)=>()=>{const r=new WeakMap;let o=null,a=null,c=null;const l=async(u,h)=>{let d=t(u);const f=Je(d,h);if(!f){const m={channelCount:d.channelCount,channelCountMode:d.channelCountMode,channelInterpretation:d.channelInterpretation,detune:d.detune.value,frequency:d.frequency.value,periodicWave:o===null?void 0:o,type:d.type};d=e(h,m),a!==null&&d.start(a),c!==null&&d.stop(c)}return r.set(h,d),f?(await n(h,u.detune,d.detune),await n(h,u.frequency,d.frequency)):(await s(h,u.detune,d.detune),await s(h,u.frequency,d.frequency)),await i(u,h,d),d};return{set periodicWave(u){o=u},set start(u){a=u},set stop(u){c=u},render(u,h){const d=r.get(h);return d!==void 0?Promise.resolve(d):l(u,h)}}},iy={channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",coneInnerAngle:360,coneOuterAngle:360,coneOuterGain:0,distanceModel:"inverse",maxDistance:1e4,orientationX:1,orientationY:0,orientationZ:0,panningModel:"equalpower",positionX:0,positionY:0,positionZ:0,refDistance:1,rolloffFactor:1},ry=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...iy,...l},d=t(u,h),f=r(u),m=f?s():null;super(c,!1,d,m),this._nativePannerNode=d,this._orientationX=e(this,f,d.orientationX,et,at),this._orientationY=e(this,f,d.orientationY,et,at),this._orientationZ=e(this,f,d.orientationZ,et,at),this._positionX=e(this,f,d.positionX,et,at),this._positionY=e(this,f,d.positionY,et,at),this._positionZ=e(this,f,d.positionZ,et,at),o(this,1)}get coneInnerAngle(){return this._nativePannerNode.coneInnerAngle}set coneInnerAngle(c){this._nativePannerNode.coneInnerAngle=c}get coneOuterAngle(){return this._nativePannerNode.coneOuterAngle}set coneOuterAngle(c){this._nativePannerNode.coneOuterAngle=c}get coneOuterGain(){return this._nativePannerNode.coneOuterGain}set coneOuterGain(c){this._nativePannerNode.coneOuterGain=c}get distanceModel(){return this._nativePannerNode.distanceModel}set distanceModel(c){this._nativePannerNode.distanceModel=c}get maxDistance(){return this._nativePannerNode.maxDistance}set maxDistance(c){this._nativePannerNode.maxDistance=c}get orientationX(){return this._orientationX}get orientationY(){return this._orientationY}get orientationZ(){return this._orientationZ}get panningModel(){return this._nativePannerNode.panningModel}set panningModel(c){this._nativePannerNode.panningModel=c}get positionX(){return this._positionX}get positionY(){return this._positionY}get positionZ(){return this._positionZ}get refDistance(){return this._nativePannerNode.refDistance}set refDistance(c){this._nativePannerNode.refDistance=c}get rolloffFactor(){return this._nativePannerNode.rolloffFactor}set rolloffFactor(c){this._nativePannerNode.rolloffFactor=c}},oy=(n,e,t,s,i,r,o,a,c,l)=>()=>{const u=new WeakMap;let h=null;const d=async(f,m)=>{let p=null,g=r(f);const y={channelCount:g.channelCount,channelCountMode:g.channelCountMode,channelInterpretation:g.channelInterpretation},w={...y,coneInnerAngle:g.coneInnerAngle,coneOuterAngle:g.coneOuterAngle,coneOuterGain:g.coneOuterGain,distanceModel:g.distanceModel,maxDistance:g.maxDistance,panningModel:g.panningModel,refDistance:g.refDistance,rolloffFactor:g.rolloffFactor},S=Je(g,m);if("bufferSize"in g)p=s(m,{...y,gain:1});else if(!S){const v={...w,orientationX:g.orientationX.value,orientationY:g.orientationY.value,orientationZ:g.orientationZ.value,positionX:g.positionX.value,positionY:g.positionY.value,positionZ:g.positionZ.value};g=i(m,v)}if(u.set(m,p===null?g:p),p!==null){if(h===null){if(o===null)throw new Error("Missing the native OfflineAudioContext constructor.");const O=new o(6,f.context.length,m.sampleRate),A=e(O,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});A.connect(O.destination),h=(async()=>{const R=await Promise.all([f.orientationX,f.orientationY,f.orientationZ,f.positionX,f.positionY,f.positionZ].map(async(P,F)=>{const N=t(O,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:F===0?1:0});return await a(O,P,N.offset),N}));for(let P=0;P<6;P+=1)R[P].connect(A,0,P),R[P].start(0);return l(O)})()}const v=await h,_=s(m,{...y,gain:1});await c(f,m,_);const T=[];for(let O=0;OP!==x[F])||R.some((P,F)=>P!==k[F])){x=A,k=R;const P=O/m.sampleRate;C.gain.setValueAtTime(0,P),C=s(m,{...y,gain:0}),E=i(m,{...w,orientationX:x[0],orientationY:x[1],orientationZ:x[2],positionX:k[0],positionY:k[1],positionZ:k[2]}),C.gain.setValueAtTime(1,P),_.connect(C).connect(E.inputs[0]),E.connect(p)}}return p}return S?(await n(m,f.orientationX,g.orientationX),await n(m,f.orientationY,g.orientationY),await n(m,f.orientationZ,g.orientationZ),await n(m,f.positionX,g.positionX),await n(m,f.positionY,g.positionY),await n(m,f.positionZ,g.positionZ)):(await a(m,f.orientationX,g.orientationX),await a(m,f.orientationY,g.orientationY),await a(m,f.orientationZ,g.orientationZ),await a(m,f.positionX,g.positionX),await a(m,f.positionY,g.positionY),await a(m,f.positionZ,g.positionZ)),li(g)?await c(f,m,g.inputs[0]):await c(f,m,g),g};return{render(f,m){const p=u.get(m);return p!==void 0?Promise.resolve(p):d(f,m)}}},ay={disableNormalization:!1},cy=(n,e,t,s)=>class Kh{constructor(r,o){const a=e(r),c=s({...ay,...o}),l=n(a,c);return t.add(l),l}static[Symbol.hasInstance](r){return r!==null&&typeof r=="object"&&Object.getPrototypeOf(r)===Kh.prototype||t.has(r)}},ly=(n,e)=>(t,s,i)=>(n(s).replay(i),e(s,t,i)),uy=(n,e,t)=>async(s,i,r)=>{const o=n(s);await Promise.all(o.activeInputs.map((a,c)=>Array.from(a).map(async([l,u])=>{const d=await e(l).render(l,i),f=s.context.destination;!t(l)&&(s!==f||!t(s))&&d.connect(r,u,c)})).reduce((a,c)=>[...a,...c],[]))},hy=(n,e,t)=>async(s,i,r)=>{const o=e(s);await Promise.all(Array.from(o.activeInputs).map(async([a,c])=>{const u=await n(a).render(a,i);t(a)||u.connect(r,c)}))},dy=(n,e,t,s)=>i=>n(Zi,()=>Zi(i))?Promise.resolve(n(s,s)).then(r=>{if(!r){const o=t(i,512,0,1);i.oncomplete=()=>{o.onaudioprocess=null,o.disconnect()},o.onaudioprocess=()=>i.currentTime,o.connect(i.destination)}return i.startRendering()}):new Promise(r=>{const o=e(i,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});i.oncomplete=a=>{o.disconnect(),r(a.renderedBuffer)},o.connect(i.destination),i.startRendering()}),fy=n=>(e,t)=>{n.set(e,t)},py=n=>(e,t)=>n.set(e,t),my=(n,e,t,s,i,r,o,a)=>(c,l)=>t(c).render(c,l).then(()=>Promise.all(Array.from(s(l)).map(u=>t(u).render(u,l)))).then(()=>i(l)).then(u=>(typeof u.copyFromChannel!="function"?(o(u),bc(u)):e(r,()=>r(u))||a(u),n.add(u),u)),_y={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},gy=(n,e,t,s,i,r)=>class extends n{constructor(a,c){const l=i(a),u={..._y,...c},h=t(l,u),d=r(l),f=d?s():null;super(a,!1,h,f),this._pan=e(this,d,h.pan)}get pan(){return this._pan}},vy=(n,e,t,s,i)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=t(a);const u=Je(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=e(c,h)}return r.set(c,l),u?await n(c,a.pan,l.pan):await s(c,a.pan,l.pan),li(l)?await i(a,c,l.inputs[0]):await i(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},yy=n=>()=>{if(n===null)return!1;try{new n({length:1,sampleRate:44100})}catch{return!1}return!0},xy=(n,e)=>async()=>{if(n===null)return!0;if(e===null)return!1;const t=new Blob(['class A extends AudioWorkletProcessor{process(i){this.port.postMessage(i,[i[0][0].buffer])}}registerProcessor("a",A)'],{type:"application/javascript; charset=utf-8"}),s=new e(1,128,44100),i=URL.createObjectURL(t);let r=!1,o=!1;try{await s.audioWorklet.addModule(i);const a=new n(s,"a",{numberOfOutputs:0}),c=s.createOscillator();a.port.onmessage=()=>r=!0,a.onprocessorerror=()=>o=!0,c.connect(a),c.start(0),await s.startRendering(),await new Promise(l=>setTimeout(l))}catch{}finally{URL.revokeObjectURL(i)}return r&&!o},Ty=(n,e)=>()=>{if(e===null)return Promise.resolve(!1);const t=new e(1,1,44100),s=n(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(i=>{t.oncomplete=()=>{s.disconnect(),i(t.currentTime!==0)},t.startRendering()})},ky=()=>new DOMException("","UnknownError"),wy={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},Sy=(n,e,t,s,i,r,o)=>class extends n{constructor(c,l){const u=i(c),h={...wy,...l},d=t(u,h),m=r(u)?s():null;super(c,!0,d,m),this._isCurveNullified=!1,this._nativeWaveShaperNode=d,o(this,1)}get curve(){return this._isCurveNullified?null:this._nativeWaveShaperNode.curve}set curve(c){if(c===null)this._isCurveNullified=!0,this._nativeWaveShaperNode.curve=new Float32Array([0,0]);else{if(c.length<2)throw e();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=c}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(c){this._nativeWaveShaperNode.oversample=c}},Cy=(n,e,t)=>()=>{const s=new WeakMap,i=async(r,o)=>{let a=e(r);if(!Je(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=n(o,l)}return s.set(o,a),li(a)?await t(r,o,a.inputs[0]):await t(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):i(r,o)}}},by=()=>typeof window>"u"?null:window,Ey=(n,e)=>t=>{t.copyFromChannel=(s,i,r=0)=>{const o=n(r),a=n(i);if(a>=t.numberOfChannels)throw e();const c=t.length,l=t.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+o{const o=n(r),a=n(i);if(a>=t.numberOfChannels)throw e();const c=t.length,l=t.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+oe=>{e.copyFromChannel=(t=>(s,i,r=0)=>{const o=n(r),a=n(i);if(o(s,i,r=0)=>{const o=n(r),a=n(i);if(o(e,t)=>{const s=t.createBuffer(1,1,44100);e.buffer===null&&(e.buffer=s),n(e,"buffer",i=>()=>{const r=i.call(e);return r===s?null:r},i=>r=>i.call(e,r===null?s:r))},My=(n,e)=>(t,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw n()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw n()}});const i=t.createBufferSource();e(s,()=>{const a=s.numberOfInputs;for(let c=0;ci.disconnect(s))},Jh=(n,e,t)=>n.copyFromChannel===void 0?n.getChannelData(t)[0]:(n.copyFromChannel(e,t),e[0]),ed=n=>{if(n===null)return!1;const e=n.length;return e%2!==0?n[Math.floor(e/2)]!==0:n[e/2-1]+n[e/2]!==0},kr=(n,e,t,s)=>{let i=n;for(;!i.hasOwnProperty(e);)i=Object.getPrototypeOf(i);const{get:r,set:o}=Object.getOwnPropertyDescriptor(i,e);Object.defineProperty(n,e,{get:t(r),set:s(o)})},Dy=n=>({...n,outputChannelCount:n.outputChannelCount!==void 0?n.outputChannelCount:n.numberOfInputs===1&&n.numberOfOutputs===1?[n.channelCount]:Array.from({length:n.numberOfOutputs},()=>1)}),Ry=n=>({...n,channelCount:n.numberOfOutputs}),Py=n=>{const{imag:e,real:t}=n;return e===void 0?t===void 0?{...n,imag:[0,0],real:[0,0]}:{...n,imag:Array.from(t,()=>0),real:t}:t===void 0?{...n,imag:e,real:Array.from(e,()=>0)}:{...n,imag:e,real:t}},td=(n,e,t)=>{try{n.setValueAtTime(e,t)}catch(s){if(s.code!==9)throw s;td(n,e,t+1e-7)}},Iy=n=>{const e=n.createBufferSource();e.start();try{e.start()}catch{return!0}return!1},Ny=n=>{const e=n.createBufferSource(),t=n.createBuffer(1,1,44100);e.buffer=t;try{e.start(0,1)}catch{return!1}return!0},Fy=n=>{const e=n.createBufferSource();e.start();try{e.stop()}catch{return!1}return!0},Dc=n=>{const e=n.createOscillator();try{e.start(-1)}catch(t){return t instanceof RangeError}return!1},sd=n=>{const e=n.createBuffer(1,1,44100),t=n.createBufferSource();t.buffer=e,t.start(),t.stop();try{return t.stop(),!0}catch{return!1}},Rc=n=>{const e=n.createOscillator();try{e.stop(-1)}catch(t){return t instanceof RangeError}return!1},Uy=n=>{const{port1:e,port2:t}=new MessageChannel;try{e.postMessage(n)}finally{e.close(),t.close()}},Ly=n=>{n.start=(e=>(t=0,s=0,i)=>{const r=n.buffer,o=r===null?s:Math.min(r.duration,s);r!==null&&o>r.duration-.5/n.context.sampleRate?e.call(n,t,0,0):e.call(n,t,o,i)})(n.start)},nd=(n,e)=>{const t=e.createGain();n.connect(t);const s=(i=>()=>{i.call(n,t),n.removeEventListener("ended",s)})(n.disconnect);n.addEventListener("ended",s),ui(n,t),n.stop=(i=>{let r=!1;return(o=0)=>{if(r)try{i.call(n,o)}catch{t.gain.setValueAtTime(0,o)}else i.call(n,o),r=!0}})(n.stop)},hi=(n,e)=>t=>{const s={value:n};return Object.defineProperties(t,{currentTarget:s,target:s}),typeof e=="function"?e.call(n,t):e.handleEvent.call(n,t)},zy=rg(Sn),By=hg(Sn),Vy=w1(Fo),id=new WeakMap,jy=V1(id),Ht=Jg(new Map,new WeakMap),Kt=by(),rd=gv(Ht,ts),Pc=B1(st),Ze=uy(st,Pc,gn),Hy=_g(rd,ke,Ze),ye=q1(No),ws=qv(Kt),he=av(ws),od=new WeakMap,ad=P1(hi),wr=Tv(Kt),Ic=nv(wr),Nc=iv(Kt),cd=rv(Kt),Xi=wv(Kt),Ue=Vg(og(Nh),ug(zy,By,ao,Vy,co,st,jy,_r,ke,Sn,ms,gn,Gr),Ht,K1(ja,co,st,ke,Yi,ms),ts,Uo,rt,y1(ao,ja,st,ke,Yi,ye,ms,he),b1(od,st,Bt),ad,ye,Ic,Nc,cd,he,Xi),qy=mg(Ue,Hy,ts,rd,ye,he),Fc=new WeakSet,eu=vv(Kt),ld=d1(new Uint32Array(1)),Uc=Ey(ld,ts),Lc=Oy(ld),ud=vg(Fc,Ht,rt,eu,ws,yy(eu),Uc,Lc),Lo=dg(pt),hd=hy(Pc,vr,gn),ss=o1(hd),di=xv(Lo,Ht,Iy,Ny,Fy,Dc,sd,Rc,Ly,Ay(kr),nd),ns=ly(j1(vr),hd),Wy=Tg(ss,di,ke,ns,Ze),qt=jg(ag(Fh),od,Cc,Hg,J_,eg,tg,sg,ng,za,Ph,wr,td),Gy=xg(Ue,Wy,qt,We,di,ye,he,hi),Yy=Mg(Ue,Dg,ts,We,kv(pt,kr),ye,he,Ze),Zy=Kg(ss,$h,ke,ns,Ze),Cn=py(id),Xy=Qg(Ue,qt,Zy,Uo,$h,ye,he,Cn),Xs=mv(Sn,Nc),$y=My(We,Xs),$s=Mv(wr,$y),Qy=s1($s,ke,Ze),Ky=t1(Ue,Qy,$s,ye,he),Jy=r1(xr,ke,Ze),ex=i1(Ue,Jy,xr,ye,he,Ry),tx=Pv(Lo,di,pt,Xs),fi=Rv(Lo,Ht,tx,Dc,Rc),sx=h1(ss,fi,ke,ns,Ze),nx=u1(Ue,qt,sx,fi,ye,he,hi),dd=Iv(rt,kr),ix=m1(dd,ke,Ze),rx=p1(Ue,ix,dd,ye,he,Cn),ox=k1(ss,Qh,ke,ns,Ze),ax=T1(Ue,qt,ox,Qh,ye,he,Cn),fd=Nv(rt),cx=M1(ss,fd,ke,ns,Ze),lx=A1(Ue,qt,cx,fd,rt,ye,he,Cn),ux=L1(ss,pt,ke,ns,Ze),hx=U1(Ue,qt,ux,pt,ye,he),dx=zv(Uo,We,Tr,rt),zo=dy(Ht,pt,Tr,Ty(pt,ws)),fx=Q1(di,ke,ws,Ze,zo),px=Fv(dx),mx=X1(Ue,px,fx,ye,he,Cn),_x=Rg(qt,$s,fi,Tr,rt,Jh,he,kr),pd=new WeakMap,gx=pv(Yy,_x,ad,he,pd,hi),md=Wv(Lo,Ht,Dc,sd,Rc,nd),vx=ny(ss,md,ke,ns,Ze),yx=sy(Ue,qt,md,vx,ye,he,hi),_d=c1(di),xx=Kv(_d,We,pt,ed,Xs),Bo=Qv(_d,We,xx,ed,Xs,wr,kr),Tx=Yv(ao,We,$s,pt,Tr,Bo,rt,co,Jh,Xs),gd=Gv(Tx),kx=oy(ss,$s,fi,pt,gd,ke,ws,ns,Ze,zo),wx=ry(Ue,qt,gd,kx,ye,he,Cn),Sx=Zv(ts),Cx=cy(Sx,ye,new WeakSet,Py),bx=$v($s,xr,pt,Bo,rt,Xs),vd=Xv(bx,rt),Ex=vy(ss,vd,ke,ns,Ze),Ox=gy(Ue,qt,vd,Ex,ye,he),Ax=Cy(Bo,ke,Ze),Mx=Sy(Ue,We,Bo,Ax,ye,he,Cn),yd=cv(Kt),zc=I1(Kt),xd=new WeakMap,Dx=W1(xd,ws),Rx=yd?lg(Ht,rt,R1(Kt),zc,N1(ig),ye,Dx,he,Xi,new WeakMap,new WeakMap,xy(Xi,ws),Kt):void 0,Px=ov(Ic,he),Ix=v1(Fc,Ht,g1,D1,new WeakSet,ye,Px,ro,Zi,Uc,Lc),Td=Xg(Rx,qy,ud,Gy,Xy,Ky,ex,nx,rx,Ix,ax,lx,hx,mx,gx,yx,wx,Cx,Ox,Mx),Nx=lv(Ue,Bv,ye,he),Fx=hv(Ue,Vv,ye,he),Ux=dv(Ue,jv,ye,he),Lx=Hv(We,he),zx=fv(Ue,Lx,ye),Bx=Ag(Td,We,rt,ky,Nx,Fx,Ux,zx,wr),Bc=G1(pd),Vx=fg(Bc),kd=a1(ts),jx=S1(Bc),wd=E1(ts),Sd=new WeakMap,Hx=z1(Sd,Bt),qx=Av(kd,ts,We,$s,xr,fi,pt,Tr,rt,wd,zc,Hx,Xs),Wx=Cv(We,qx,pt,rt,Xs),Gx=Zg(ss,kd,di,$s,xr,fi,pt,jx,wd,zc,ke,Xi,ws,ns,Ze,zo),Yx=H1(xd),Zx=fy(Sd),tu=yd?Wg(Vx,Ue,qt,Gx,Wx,st,Yx,ye,he,Xi,Dy,Zx,Uy,hi):void 0,Xx=_1(rt,ws),$x=my(Fc,Ht,Pc,Bc,zo,ro,Uc,Lc),Qx=ey(Td,Ht,We,Xx,$x),Kx=J1(No,Ic),Jx=ev(Sc,Nc),eT=tv(Cc,cd),tT=sv(No,he);function xt(n){return typeof n>"u"}function te(n){return!xt(n)}function sT(n){return typeof n=="function"}function js(n){return typeof n=="number"}function fn(n){return Object.prototype.toString.call(n)==="[object Object]"&&n.constructor===Object}function nT(n){return typeof n=="boolean"}function zt(n){return Array.isArray(n)}function ys(n){return typeof n=="string"}function zr(n){return ys(n)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(n)}function Q(n,e){if(!n)throw new Error(e)}function Vt(n,e,t=1/0){if(!(e<=n&&n<=t))throw new RangeError(`Value must be within [${e}, ${t}], got: ${n}`)}function Cd(n){!n.isOffline&&n.state!=="running"&&Vc('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let bd=!1,su=!1;function nu(n){bd=n}function iT(n){xt(n)&&bd&&!su&&(su=!0,Vc("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let Ed=console;function rT(...n){Ed.log(...n)}function Vc(...n){Ed.warn(...n)}function oT(n){return new Bx(n)}function aT(n,e,t){return new Qx(n,e,t)}const pn=typeof self=="object"?self:null,cT=pn&&(pn.hasOwnProperty("AudioContext")||pn.hasOwnProperty("webkitAudioContext"));function lT(n,e,t){return Q(te(tu),"This node only works in a secure context (https or localhost)"),new tu(n,e,t)}class uT{constructor(e,t,s,i){this._callback=e,this._type=t,this._minimumUpdateInterval=Math.max(128/(i||44100),.001),this.updateInterval=s,this._createClock()}_createWorker(){const e=new Blob([` // the initial timeout time let timeoutTime = ${(this._updateInterval*1e3).toFixed(1)}; // onmessage callback @@ -319,12 +319,12 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu } // call tick initially tick(); - `],{type:"text/javascript"}),t=URL.createObjectURL(e),s=new Worker(t);s.onmessage=this._callback.bind(this),this._worker=s}_createTimeout(){this._timeout=setTimeout(()=>{this._createTimeout(),this._callback()},this._updateInterval*1e3)}_createClock(){if(this._type==="worker")try{this._createWorker()}catch{this._type="timeout",this._createClock()}else this._type==="timeout"&&this._createTimeout()}_disposeClock(){this._timeout&&clearTimeout(this._timeout),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(e){var t;this._updateInterval=Math.max(e,this._minimumUpdateInterval),this._type==="worker"&&((t=this._worker)===null||t===void 0||t.postMessage(this._updateInterval*1e3))}get type(){return this._type}set type(e){this._disposeClock(),this._type=e,this._createClock()}dispose(){this._disposeClock()}}function vn(n){return Jx(n)}function zs(n){return Kx(n)}function Yr(n){return eT(n)}function Un(n){return Qx(n)}function uT(n){return n instanceof ud}function hT(n,e){return n==="value"||vn(e)||zs(e)||uT(e)}function Gn(n,...e){if(!e.length)return n;const t=e.shift();if(fn(n)&&fn(t))for(const s in t)hT(s,t[s])?n[s]=t[s]:fn(t[s])?(n[s]||Object.assign(n,{[s]:{}}),Gn(n[s],t[s])):Object.assign(n,{[s]:t[s]});return Gn(n,...e)}function dT(n,e){return n.length===e.length&&n.every((t,s)=>e[s]===t)}function I(n,e,t=[],s){const i={},r=Array.from(e);if(fn(r[0])&&s&&!Reflect.has(r[0],s)&&(Object.keys(r[0]).some(a=>Reflect.has(n,a))||(Gn(i,{[s]:r[0]}),t.splice(t.indexOf(s),1),r.shift())),r.length===1&&fn(r[0]))Gn(i,r[0]);else for(let o=0;o{Reflect.has(n,t)&&delete n[t]}),n}/** + `],{type:"text/javascript"}),t=URL.createObjectURL(e),s=new Worker(t);s.onmessage=this._callback.bind(this),this._worker=s}_createTimeout(){this._timeout=setTimeout(()=>{this._createTimeout(),this._callback()},this._updateInterval*1e3)}_createClock(){if(this._type==="worker")try{this._createWorker()}catch{this._type="timeout",this._createClock()}else this._type==="timeout"&&this._createTimeout()}_disposeClock(){this._timeout&&clearTimeout(this._timeout),this._worker&&(this._worker.terminate(),this._worker.onmessage=null)}get updateInterval(){return this._updateInterval}set updateInterval(e){var t;this._updateInterval=Math.max(e,this._minimumUpdateInterval),this._type==="worker"&&((t=this._worker)===null||t===void 0||t.postMessage(this._updateInterval*1e3))}get type(){return this._type}set type(e){this._disposeClock(),this._type=e,this._createClock()}dispose(){this._disposeClock()}}function vn(n){return eT(n)}function zs(n){return Jx(n)}function Yr(n){return tT(n)}function Un(n){return Kx(n)}function hT(n){return n instanceof ud}function dT(n,e){return n==="value"||vn(e)||zs(e)||hT(e)}function Gn(n,...e){if(!e.length)return n;const t=e.shift();if(fn(n)&&fn(t))for(const s in t)dT(s,t[s])?n[s]=t[s]:fn(t[s])?(n[s]||Object.assign(n,{[s]:{}}),Gn(n[s],t[s])):Object.assign(n,{[s]:t[s]});return Gn(n,...e)}function fT(n,e){return n.length===e.length&&n.every((t,s)=>e[s]===t)}function I(n,e,t=[],s){const i={},r=Array.from(e);if(fn(r[0])&&s&&!Reflect.has(r[0],s)&&(Object.keys(r[0]).some(a=>Reflect.has(n,a))||(Gn(i,{[s]:r[0]}),t.splice(t.indexOf(s),1),r.shift())),r.length===1&&fn(r[0]))Gn(i,r[0]);else for(let o=0;o{Reflect.has(n,t)&&delete n[t]}),n}/** * Tone.js * @author Yotam Mann * @license http://opensource.org/licenses/MIT MIT License * @copyright 2014-2019 Yotam Mann - */class Ss{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...e){(this.debug||pn&&this.toString()===pn.TONE_DEBUG_CLASS)&&iT(this,...e)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}Ss.version=Rh;const jc=1e-6;function ni(n,e){return n>e+jc}function Ya(n,e){return ni(n,e)||Ft(n,e)}function fo(n,e){return n+jcthis.memory){const t=this.length-this.memory;this._timeline.splice(0,t)}return this}remove(e){const t=this._timeline.indexOf(e);return t!==-1&&this._timeline.splice(t,1),this}get(e,t="time"){const s=this._search(e,t);return s!==-1?this._timeline[s]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(e,t="time"){const s=this._search(e,t);return s+10&&this._timeline[t-1].time=0?this._timeline[s-1]:null}cancel(e){if(this._timeline.length>1){let t=this._search(e);if(t>=0)if(Ft(this._timeline[t].time,e)){for(let s=t;s>=0&&Ft(this._timeline[s].time,e);s--)t=s;this._timeline=this._timeline.slice(0,t)}else this._timeline=this._timeline.slice(0,t+1);else this._timeline=[]}else this._timeline.length===1&&Ya(this._timeline[0].time,e)&&(this._timeline=[]);return this}cancelBefore(e){const t=this._search(e);return t>=0&&(this._timeline=this._timeline.slice(t+1)),this}previousEvent(e){const t=this._timeline.indexOf(e);return t>0?this._timeline[t-1]:null}_search(e,t="time"){if(this._timeline.length===0)return-1;let s=0;const i=this._timeline.length;let r=i;if(i>0&&this._timeline[i-1][t]<=e)return i-1;for(;s=0&&this._timeline[s].time>=e;)s--;return this._iterate(t,s+1),this}forEachAtTime(e,t){const s=this._search(e);if(s!==-1&&Ft(this._timeline[s].time,e)){let i=s;for(let r=s;r>=0&&Ft(this._timeline[r].time,e);r--)i=r;this._iterate(r=>{t(r)},i,s)}return this}dispose(){return super.dispose(),this._timeline=[],this}}const Od=[];function Vo(n){Od.push(n)}function mT(n){Od.forEach(e=>e(n))}const Ad=[];function jo(n){Ad.push(n)}function _T(n){Ad.forEach(e=>e(n))}class Sr extends Ss{constructor(){super(...arguments),this.name="Emitter"}on(e,t){return e.split(/\W+/).forEach(i=>{xt(this._events)&&(this._events={}),this._events.hasOwnProperty(i)||(this._events[i]=[]),this._events[i].push(t)}),this}once(e,t){const s=(...i)=>{t(...i),this.off(e,s)};return this.on(e,s),this}off(e,t){return e.split(/\W+/).forEach(i=>{if(xt(this._events)&&(this._events={}),this._events.hasOwnProperty(i))if(xt(t))this._events[i]=[];else{const r=this._events[i];for(let o=r.length-1;o>=0;o--)r[o]===t&&r.splice(o,1)}}),this}emit(e,...t){if(this._events&&this._events.hasOwnProperty(e)){const s=this._events[e].slice(0);for(let i=0,r=s.length;i{const s=Object.getOwnPropertyDescriptor(Sr.prototype,t);Object.defineProperty(e.prototype,t,s)})}dispose(){return super.dispose(),this._events=void 0,this}}class Md extends Sr{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}class Cr extends Md{constructor(){var e,t;super(),this.name="Context",this._constants=new Map,this._timeouts=new Dt,this._timeoutIds=0,this._initialized=!1,this._closeStarted=!1,this.isOffline=!1,this._workletPromise=null;const s=I(Cr.getDefaults(),arguments,["context"]);s.context?(this._context=s.context,this._latencyHint=((e=arguments[0])===null||e===void 0?void 0:e.latencyHint)||""):(this._context=rT({latencyHint:s.latencyHint}),this._latencyHint=s.latencyHint),this._ticker=new lT(this.emit.bind(this,"tick"),s.clockSource,s.updateInterval,this._context.sampleRate),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this[!((t=arguments[0])===null||t===void 0)&&t.hasOwnProperty("updateInterval")?"_lookAhead":"lookAhead"]=s.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){return this._initialized||(mT(this),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(e,t,s){return this._context.createBuffer(e,t,s)}createChannelMerger(e){return this._context.createChannelMerger(e)}createChannelSplitter(e){return this._context.createChannelSplitter(e)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(e){return this._context.createDelay(e)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(e,t){return this._context.createIIRFilter(e,t)}createPanner(){return this._context.createPanner()}createPeriodicWave(e,t,s){return this._context.createPeriodicWave(e,t,s)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(e){return Q(Un(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamSource(e)}createMediaElementSource(e){return Q(Un(this._context),"Not available if OfflineAudioContext"),this._context.createMediaElementSource(e)}createMediaStreamDestination(){return Q(Un(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamDestination()}decodeAudioData(e){return this._context.decodeAudioData(e)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(e){Q(!this._initialized,"The listener cannot be set after initialization."),this._listener=e}get transport(){return this.initialize(),this._transport}set transport(e){Q(!this._initialized,"The transport cannot be set after initialization."),this._transport=e}get draw(){return this.initialize(),this._draw}set draw(e){Q(!this._initialized,"Draw cannot be set after initialization."),this._draw=e}get destination(){return this.initialize(),this._destination}set destination(e){Q(!this._initialized,"The destination cannot be set after initialization."),this._destination=e}createAudioWorkletNode(e,t){return cT(this.rawContext,e,t)}addAudioWorkletModule(e){return Fe(this,void 0,void 0,function*(){Q(te(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletPromise||(this._workletPromise=this.rawContext.audioWorklet.addModule(e)),yield this._workletPromise})}workletsAreReady(){return Fe(this,void 0,void 0,function*(){(yield this._workletPromise)?this._workletPromise:Promise.resolve()})}get updateInterval(){return this._ticker.updateInterval}set updateInterval(e){this._ticker.updateInterval=e}get clockSource(){return this._ticker.type}set clockSource(e){this._ticker.type=e}get lookAhead(){return this._lookAhead}set lookAhead(e){this._lookAhead=e,this.updateInterval=e?e/2:.01}get latencyHint(){return this._latencyHint}get rawContext(){return this._context}now(){return this._context.currentTime+this._lookAhead}immediate(){return this._context.currentTime}resume(){return Un(this._context)?this._context.resume():Promise.resolve()}close(){return Fe(this,void 0,void 0,function*(){Un(this._context)&&this.state!=="closed"&&!this._closeStarted&&(this._closeStarted=!0,yield this._context.close()),this._initialized&&_T(this)})}getConstant(e){if(this._constants.has(e))return this._constants.get(e);{const t=this._context.createBuffer(1,128,this._context.sampleRate),s=t.getChannelData(0);for(let r=0;rthis._constants[e].disconnect()),this.close(),this}_timeoutLoop(){const e=this.now();let t=this._timeouts.peek();for(;this._timeouts.length&&t&&t.time<=e;)t.callback(),this._timeouts.shift(),t=this._timeouts.peek()}setTimeout(e,t){this._timeoutIds++;const s=this.now();return this._timeouts.add({callback:e,id:this._timeoutIds,time:s+t}),this._timeoutIds}clearTimeout(e){return this._timeouts.forEach(t=>{t.id===e&&this._timeouts.remove(t)}),this}clearInterval(e){return this.clearTimeout(e)}setInterval(e,t){const s=++this._timeoutIds,i=()=>{const r=this.now();this._timeouts.add({callback:()=>{e(),i()},id:s,time:r+t})};return i(),s}}class gT extends Md{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(e,t,s){return{}}createChannelMerger(e){return{}}createChannelSplitter(e){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(e){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(e,t){return{}}createPanner(){return{}}createPeriodicWave(e,t,s){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(e){return{}}createMediaElementSource(e){return{}}createMediaStreamDestination(){return{}}decodeAudioData(e){return Promise.resolve({})}createAudioWorkletNode(e,t){return{}}get rawContext(){return{}}addAudioWorkletModule(e){return Fe(this,void 0,void 0,function*(){return Promise.resolve()})}resume(){return Promise.resolve()}setTimeout(e,t){return 0}clearTimeout(e){return this}setInterval(e,t){return 0}clearInterval(e){return this}getConstant(e){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(e){}get destination(){return{}}set destination(e){}now(){return 0}immediate(){return 0}}function xe(n,e){zt(e)?e.forEach(t=>xe(n,t)):Object.defineProperty(n,e,{enumerable:!0,writable:!1})}function Hc(n,e){zt(e)?e.forEach(t=>Hc(n,t)):Object.defineProperty(n,e,{writable:!0})}const ce=()=>{};class le extends Ss{constructor(){super(),this.name="ToneAudioBuffer",this.onload=ce;const e=I(le.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=e.reverse,this.onload=e.onload,ys(e.url)?this.load(e.url).catch(e.onerror):e.url&&this.set(e.url)}static getDefaults(){return{onerror:ce,onload:ce,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:Ut().sampleRate}set(e){return e instanceof le?e.loaded?this._buffer=e.get():e.onload=()=>{this.set(e),this.onload(this)}:this._buffer=e,this._reversed&&this._reverse(),this}get(){return this._buffer}load(e){return Fe(this,void 0,void 0,function*(){const t=le.load(e).then(s=>{this.set(s),this.onload(this)});le.downloads.push(t);try{yield t}finally{const s=le.downloads.indexOf(t);le.downloads.splice(s,1)}return this})}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(e){const t=zt(e)&&e[0].length>0,s=t?e.length:1,i=t?e[0].length:e.length,r=Ut(),o=r.createBuffer(s,i,r.sampleRate),a=!t&&s===1?[e]:e;for(let c=0;ci/s),this.fromArray(t)}return this}toArray(e){if(js(e))return this.getChannelData(e);if(this.numberOfChannels===1)return this.toArray(0);{const t=[];for(let s=0;s0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(e){this._reversed!==e&&(this._reversed=e,this._reverse())}static fromArray(e){return new le().fromArray(e)}static fromUrl(e){return Fe(this,void 0,void 0,function*(){return yield new le().load(e)})}static load(e){return Fe(this,void 0,void 0,function*(){const t=e.match(/\[([^\]\[]+\|.+)\]$/);if(t){const c=t[1].split("|");let l=c[0];for(const u of c)if(le.supportsType(u)){l=u;break}e=e.replace(t[0],l)}const s=le.baseUrl===""||le.baseUrl.endsWith("/")?le.baseUrl:le.baseUrl+"/",i=document.createElement("a");i.href=s+e,i.pathname=(i.pathname+i.hash).split("/").map(encodeURIComponent).join("/");const r=yield fetch(i.href);if(!r.ok)throw new Error(`could not load url: ${e}`);const o=yield r.arrayBuffer();return yield Ut().decodeAudioData(o)})}static supportsType(e){const t=e.split("."),s=t[t.length-1];return document.createElement("audio").canPlayType("audio/"+s)!==""}static loaded(){return Fe(this,void 0,void 0,function*(){for(yield Promise.resolve();le.downloads.length;)yield le.downloads[0]})}}le.baseUrl="";le.downloads=[];class Ho extends Cr{constructor(){super({clockSource:"offline",context:Yr(arguments[0])?arguments[0]:oT(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:Yr(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=Yr(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(e){return Fe(this,void 0,void 0,function*(){let t=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,t++;const s=Math.floor(this.sampleRate/128);e&&t%s===0&&(yield new Promise(i=>setTimeout(i,1)))}})}render(e=!0){return Fe(this,void 0,void 0,function*(){yield this.workletsAreReady(),yield this._renderClock(e);const t=yield this._context.startRendering();return new le(t)})}close(){return Promise.resolve()}}const Dd=new gT;let an=Dd;function Ut(){return an===Dd&&aT&&vT(new Cr),an}function vT(n,e=!1){e&&an.dispose(),Un(n)?an=new Cr(n):Yr(n)?an=new Ho(n):an=n}function yT(){return an.resume()}if(pn&&!pn.TONE_SILENCE_LOGGING){const e=` * Tone.js v${Rh} * `;console.log(`%c${e}`,"background: #000; color: #fff")}function xT(n){return Math.pow(10,n/20)}function TT(n){return 20*(Math.log(n)/Math.LN10)}function Rd(n){return Math.pow(2,n/12)}let qo=440;function kT(){return qo}function wT(n){qo=n}function Za(n){return Math.round(Pd(n))}function Pd(n){return 69+12*Math.log2(n/qo)}function ST(n){return qo*Math.pow(2,(n-69)/12)}class qc extends Ss{constructor(e,t,s){super(),this.defaultUnits="s",this._val=t,this._units=s,this.context=e,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:e=>this._frequencyToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:e=>this._ticksToUnits(parseInt(e,10)),regexp:/^(\d+)i$/i},m:{method:e=>this._beatsToUnits(parseInt(e,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(e,t)=>{const s=parseInt(e,10),i=t==="."?1.5:1;return s===1?this._beatsToUnits(this._getTimeSignature())*i:this._beatsToUnits(4/s)*i},regexp:/^(\d+)n(\.?)$/i},number:{method:e=>this._expressions[this.defaultUnits].method.call(this,e),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:e=>this._secondsToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:e=>parseInt(e,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:e=>{const t=parseInt(e,10);return this._beatsToUnits(8/(Math.floor(t)*3))},regexp:/^(\d+)t$/i},tr:{method:(e,t,s)=>{let i=0;return e&&e!=="0"&&(i+=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&t!=="0"&&(i+=this._beatsToUnits(parseFloat(t))),s&&s!=="0"&&(i+=this._beatsToUnits(parseFloat(s)/4)),i},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof qc&&this.fromType(this._val),xt(this._val))return this._noArg();if(ys(this._val)&&xt(this._units)){for(const e in this._expressions)if(this._expressions[e].regexp.test(this._val.trim())){this._units=e;break}}else if(fn(this._val)){let e=0;for(const t in this._val)if(te(this._val[t])){const s=this._val[t],i=new this.constructor(this.context,t).valueOf()*s;e+=i}return e}if(te(this._units)){const e=this._expressions[this._units],t=this._val.toString().trim().match(e.regexp);return t?e.method.apply(this,t.slice(1)):e.method.call(this,this._val)}else return ys(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(e){return 1/e}_beatsToUnits(e){return 60/this._getBpm()*e}_secondsToUnits(e){return e}_ticksToUnits(e){return e*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(e){switch(this._units=void 0,this.defaultUnits){case"s":this._val=e.toSeconds();break;case"i":this._val=e.toTicks();break;case"hz":this._val=e.toFrequency();break;case"midi":this._val=e.toMidi();break}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return this.toSeconds()*1e3}}class Lt extends qc{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:e=>this._now()+new this.constructor(this.context,e).valueOf(),regexp:/^\+(.+)/},quantize:{method:e=>{const t=new Lt(this.context,e).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(t))},regexp:/^@(.+)/}})}quantize(e,t=1){const s=new this.constructor(this.context,e).valueOf(),i=this.valueOf(),a=Math.round(i/s)*s-i;return i+a*t}toNotation(){const e=this.toSeconds(),t=["1m"];for(let r=1;r<9;r++){const o=Math.pow(2,r);t.push(o+"n."),t.push(o+"n"),t.push(o+"t")}t.push("0");let s=t[0],i=new Lt(this.context,t[0]).toSeconds();return t.forEach(r=>{const o=new Lt(this.context,r).toSeconds();Math.abs(o-e)3&&(i=parseFloat(parseFloat(r).toFixed(3))),[s,t,i].join(":")}toTicks(){const e=this._beatsToUnits(1);return this.valueOf()/e*this._getPPQ()}toSeconds(){return this.valueOf()}toMidi(){return Za(this.toFrequency())}_now(){return this.context.now()}}class Mt extends Lt{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return kT()}static set A4(e){wT(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(e){return this.defaultUnits==="midi"?e:Mt.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|##|x|bb|###|#x|x#|bbb)?)(-?[0-9]+)/i,method(e,t){const i=CT[e.toLowerCase()]+(parseInt(t,10)+1)*12;return this.defaultUnits==="midi"?i:Mt.mtof(i)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(e,t,s){let i=1;return e&&e!=="0"&&(i*=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&t!=="0"&&(i*=this._beatsToUnits(parseFloat(t))),s&&s!=="0"&&(i*=this._beatsToUnits(parseFloat(s)/4)),i}}})}transpose(e){return new Mt(this.context,this.valueOf()*Rd(e))}harmonize(e){return e.map(t=>this.transpose(t))}toMidi(){return Za(this.valueOf())}toNote(){const e=this.toFrequency(),t=Math.log2(e/Mt.A4);let s=Math.round(12*t)+57;const i=Math.floor(s/12);return i<0&&(s+=-12*i),bT[s%12]+i.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.floor(t*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(e){return e}_ticksToUnits(e){return 1/(e*60/(this._getBpm()*this._getPPQ()))}_beatsToUnits(e){return 1/super._beatsToUnits(e)}_secondsToUnits(e){return 1/e}static mtof(e){return ST(e)}static ftom(e){return Za(e)}}const CT={cbbb:-3,cbb:-2,cb:-1,c:0,"c#":1,cx:2,"c##":2,"c###":3,"cx#":3,"c#x":3,dbbb:-1,dbb:0,db:1,d:2,"d#":3,dx:4,"d##":4,"d###":5,"dx#":5,"d#x":5,ebbb:1,ebb:2,eb:3,e:4,"e#":5,ex:6,"e##":6,"e###":7,"ex#":7,"e#x":7,fbbb:2,fbb:3,fb:4,f:5,"f#":6,fx:7,"f##":7,"f###":8,"fx#":8,"f#x":8,gbbb:4,gbb:5,gb:6,g:7,"g#":8,gx:9,"g##":9,"g###":10,"gx#":10,"g#x":10,abbb:6,abb:7,ab:8,a:9,"a#":10,ax:11,"a##":11,"a###":12,"ax#":12,"a#x":12,bbbb:8,bbb:9,bb:10,b:11,"b#":12,bx:13,"b##":13,"b###":14,"bx#":14,"b#x":14},bT=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];class Li extends Lt{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}class dt extends Ss{constructor(){super();const e=I(dt.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=e.context}static getDefaults(){return{context:Ut()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(e){return nT(e),new Lt(this.context,e).toSeconds()}toFrequency(e){return new Mt(this.context,e).toFrequency()}toTicks(e){return new Li(this.context,e).toTicks()}_getPartialProperties(e){const t=this.get();return Object.keys(t).forEach(s=>{xt(e[s])&&delete t[s]}),t}get(){const e=fT(this);return Object.keys(e).forEach(t=>{if(Reflect.has(this,t)){const s=this[t];te(s)&&te(s.value)&&te(s.setValueAtTime)?e[t]=s.value:s instanceof dt?e[t]=s._getPartialProperties(e[t]):zt(s)||js(s)||ys(s)||sT(s)?e[t]=s:delete e[t]}}),e}set(e){return Object.keys(e).forEach(t=>{Reflect.has(this,t)&&te(this[t])&&(this[t]&&te(this[t].value)&&te(this[t].setValueAtTime)?this[t].value!==e[t]&&(this[t].value=e[t]):this[t]instanceof dt?this[t].set(e[t]):this[t]=e[t])}),this}}class Wc extends Dt{constructor(e="stopped"){super(),this.name="StateTimeline",this._initial=e,this.setStateAtTime(this._initial,0)}getValueAtTime(e){const t=this.get(e);return t!==null?t.state:this._initial}setStateAtTime(e,t,s){return Vt(t,0),this.add(Object.assign({},s,{state:e,time:t})),this}getLastState(e,t){const s=this._search(t);for(let i=s;i>=0;i--){const r=this._timeline[i];if(r.state===e)return r}}getNextState(e,t){const s=this._search(t);if(s!==-1)for(let i=s;i0,"timeConstant must be a number greater than 0");const r=this.toSeconds(t);return this._assertRange(i),Q(isFinite(i)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(e)}, ${JSON.stringify(t)}`),this._events.add({constant:s,time:r,type:"setTargetAtTime",value:i}),this.log(this.units,"setTargetAtTime",e,r,s),this._param.setTargetAtTime(i,r,s),this}setValueCurveAtTime(e,t,s,i=1){s=this.toSeconds(s),t=this.toSeconds(t);const r=this._fromType(e[0])*i;this.setValueAtTime(this._toType(r),t);const o=s/(e.length-1);for(let a=1;a{i.type==="cancelScheduledValues"?e.cancelScheduledValues(i.time):i.type==="setTargetAtTime"?e.setTargetAtTime(i.value,i.time,i.constant):e[i.type](i.value,i.time)}),this}setParam(e){Q(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const t=this.input;return t.disconnect(this._param),this.apply(e),this._param=e,t.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(e,t,s,i,r){return s+(t-s)*Math.exp(-(r-e)/i)}_linearInterpolate(e,t,s,i,r){return t+(i-t)*((r-e)/(s-e))}_exponentialInterpolate(e,t,s,i,r){return t*Math.pow(i/t,(r-e)/(s-e))}}class W extends dt{constructor(){super(...arguments),this._internalChannels=[]}get numberOfInputs(){return te(this.input)?vn(this.input)||this.input instanceof ue?1:this.input.numberOfInputs:0}get numberOfOutputs(){return te(this.output)?this.output.numberOfOutputs:0}_isAudioNode(e){return te(e)&&(e instanceof W||zs(e))}_getInternalNodes(){const e=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&e.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&e.push(this.output),e}_setChannelProperties(e){this._getInternalNodes().forEach(s=>{s.channelCount=e.channelCount,s.channelCountMode=e.channelCountMode,s.channelInterpretation=e.channelInterpretation})}_getChannelProperties(){const e=this._getInternalNodes();Q(e.length>0,"ToneAudioNode does not have any internal nodes");const t=e[0];return{channelCount:t.channelCount,channelCountMode:t.channelCountMode,channelInterpretation:t.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCount:e}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCountMode:e}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelInterpretation:e}))}connect(e,t=0,s=0){return Hs(this,e,t,s),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return Vc("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(e,t=0,s=0){return ET(this,e,t,s),this}chain(...e){return $i(this,...e),this}fan(...e){return e.forEach(t=>this.connect(t)),this}dispose(){return super.dispose(),te(this.input)&&(this.input instanceof W?this.input.dispose():zs(this.input)&&this.input.disconnect()),te(this.output)&&(this.output instanceof W?this.output.dispose():zs(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function $i(...n){const e=n.shift();n.reduce((t,s)=>(t instanceof W?t.connect(s):zs(t)&&Hs(t,s),s),e)}function Hs(n,e,t=0,s=0){for(Q(te(n),"Cannot connect from undefined node"),Q(te(e),"Cannot connect to undefined node"),(e instanceof W||zs(e))&&Q(e.numberOfInputs>0,"Cannot connect to node with no inputs"),Q(n.numberOfOutputs>0,"Cannot connect from node with no outputs");e instanceof W||e instanceof ue;)te(e.input)&&(e=e.input);for(;n instanceof W;)te(n.output)&&(n=n.output);vn(e)?n.connect(e,t):n.connect(e,t,s)}function ET(n,e,t=0,s=0){if(te(e))for(;e instanceof W;)e=e.input;for(;!zs(n);)te(n.output)&&(n=n.output);vn(e)?n.disconnect(e,t):zs(e)?n.disconnect(e,t,s):n.disconnect()}class pe extends W{constructor(){super(I(pe.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const e=I(pe.getDefaults(),arguments,["gain","units"]);this.gain=new ue({context:this.context,convert:e.convert,param:this._gainNode.gain,units:e.units,value:e.gain,minValue:e.minValue,maxValue:e.maxValue}),xe(this,"gain")}static getDefaults(){return Object.assign(W.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class ii extends W{constructor(e){super(e),this.onended=ce,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new pe({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(t){const s=this.toSeconds(t);return this._startTime!==-1&&s>=this._startTime&&(this._stopTime===-1||s<=this._stopTime)?"started":"stopped"},this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut,this._curve=e.curve,this.onended=e.onended}static getDefaults(){return Object.assign(W.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:ce})}_startGain(e,t=1){Q(this._startTime===-1,"Source cannot be started more than once");const s=this.toSeconds(this._fadeIn);return this._startTime=e+s,this._startTime=Math.max(this._startTime,this.context.currentTime),s>0?(this._gainNode.gain.setValueAtTime(0,e),this._curve==="linear"?this._gainNode.gain.linearRampToValueAtTime(t,e+s):this._gainNode.gain.exponentialApproachValueAtTime(t,e,s)):this._gainNode.gain.setValueAtTime(t,e),this}stop(e){return this.log("stop",e),this._stopGain(this.toSeconds(e)),this}_stopGain(e){Q(this._startTime!==-1,"'start' must be called before 'stop'"),this.cancelStop();const t=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(e)+t,this._stopTime=Math.max(this._stopTime,this.now()),t>0?this._curve==="linear"?this._gainNode.gain.linearRampTo(0,t,e):this._gainNode.gain.targetRampTo(0,t,e):(this._gainNode.gain.cancelAndHoldAtTime(e),this._gainNode.gain.setValueAtTime(0,e)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(()=>{const s=this._curve==="exponential"?t*2:0;this._stopSource(this.now()+s),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==ce&&(this.onended(this),this.onended=ce,!this.context.isOffline)){const e=()=>this.dispose();typeof window.requestIdleCallback<"u"?window.requestIdleCallback(e):setTimeout(e,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),Q(this._startTime!==-1,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.dispose(),this.onended=ce,this}}class po extends ii{constructor(){super(I(po.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const e=I(po.getDefaults(),arguments,["offset"]);Hs(this._source,this._gainNode),this.offset=new ue({context:this.context,convert:e.convert,param:this._source.offset,units:e.units,value:e.offset,minValue:e.minValue,maxValue:e.maxValue})}static getDefaults(){return Object.assign(ii.getDefaults(),{convert:!0,offset:1,units:"number"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._source.start(t),this}_stopSource(e){this._source.stop(e)}dispose(){return super.dispose(),this.state==="started"&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class ve extends W{constructor(){super(I(ve.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const e=I(ve.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new po({context:this.context,convert:e.convert,offset:e.value,units:e.units,minValue:e.minValue,maxValue:e.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(W.getDefaults(),{convert:!0,units:"number",value:0})}connect(e,t=0,s=0){return Gc(this,e,t,s),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(e,t){return this._param.setValueAtTime(e,t),this}getValueAtTime(e){return this._param.getValueAtTime(e)}setRampPoint(e){return this._param.setRampPoint(e),this}linearRampToValueAtTime(e,t){return this._param.linearRampToValueAtTime(e,t),this}exponentialRampToValueAtTime(e,t){return this._param.exponentialRampToValueAtTime(e,t),this}exponentialRampTo(e,t,s){return this._param.exponentialRampTo(e,t,s),this}linearRampTo(e,t,s){return this._param.linearRampTo(e,t,s),this}targetRampTo(e,t,s){return this._param.targetRampTo(e,t,s),this}exponentialApproachValueAtTime(e,t,s){return this._param.exponentialApproachValueAtTime(e,t,s),this}setTargetAtTime(e,t,s){return this._param.setTargetAtTime(e,t,s),this}setValueCurveAtTime(e,t,s,i){return this._param.setValueCurveAtTime(e,t,s,i),this}cancelScheduledValues(e){return this._param.cancelScheduledValues(e),this}cancelAndHoldAtTime(e){return this._param.cancelAndHoldAtTime(e),this}rampTo(e,t,s){return this._param.rampTo(e,t,s),this}get value(){return this._param.value}set value(e){this._param.value=e}get convert(){return this._param.convert}set convert(e){this._param.convert=e}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(e){this._param.overridden=e}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(e){return this._param.apply(e),this}}function Gc(n,e,t,s){(e instanceof ue||vn(e)||e instanceof ve&&e.override)&&(e.cancelScheduledValues(0),e.setValueAtTime(0,0),e instanceof ve&&(e.overridden=!0)),Hs(n,e,t,s)}class mo extends ue{constructor(){super(I(mo.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Dt(1/0),this._multiplier=1;const e=I(mo.getDefaults(),arguments,["value"]);this._multiplier=e.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(e.value)}),this.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(ue.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(e,t,s){t=this.toSeconds(t),this.setRampPoint(t);const i=this._fromType(e),r=this._events.get(t),o=Math.round(Math.max(1/s,1));for(let a=0;a<=o;a++){const c=s*a+t,l=this._exponentialApproach(r.time,r.value,i,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}setValueAtTime(e,t){const s=this.toSeconds(t);super.setValueAtTime(e,t);const i=this._events.get(s),r=this._events.previousEvent(i),o=this._getTicksUntilEvent(r,s);return i.ticks=Math.max(o,0),this}linearRampToValueAtTime(e,t){const s=this.toSeconds(t);super.linearRampToValueAtTime(e,t);const i=this._events.get(s),r=this._events.previousEvent(i),o=this._getTicksUntilEvent(r,s);return i.ticks=Math.max(o,0),this}exponentialRampToValueAtTime(e,t){t=this.toSeconds(t);const s=this._fromType(e),i=this._events.get(t),r=Math.round(Math.max((t-i.time)*10,1)),o=(t-i.time)/r;for(let a=0;a<=r;a++){const c=o*a+i.time,l=this._exponentialInterpolate(i.time,i.value,t,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}_getTicksUntilEvent(e,t){if(e===null)e={ticks:0,time:0,type:"setValueAtTime",value:0};else if(xt(e.ticks)){const o=this._events.previousEvent(e);e.ticks=this._getTicksUntilEvent(o,e.time)}const s=this._fromType(this.getValueAtTime(e.time));let i=this._fromType(this.getValueAtTime(t));const r=this._events.get(t);return r&&r.time===t&&r.type==="setValueAtTime"&&(i=this._fromType(this.getValueAtTime(t-this.sampleTime))),.5*(t-e.time)*(s+i)+e.ticks}getTicksAtTime(e){const t=this.toSeconds(e),s=this._events.get(t);return Math.max(this._getTicksUntilEvent(s,t),0)}getDurationOfTicks(e,t){const s=this.toSeconds(t),i=this.getTicksAtTime(t);return this.getTimeOfTick(i+e)-s}getTimeOfTick(e){const t=this._events.get(e,"ticks"),s=this._events.getAfter(e,"ticks");if(t&&t.ticks===e)return t.time;if(t&&s&&s.type==="linearRampToValueAtTime"&&t.value!==s.value){const i=this._fromType(this.getValueAtTime(t.time)),o=(this._fromType(this.getValueAtTime(s.time))-i)/(s.time-t.time),a=Math.sqrt(Math.pow(i,2)-2*o*(t.ticks-e)),c=(-i+a)/o,l=(-i-a)/o;return(c>0?c:l)+t.time}else return t?t.value===0?1/0:t.time+(e-t.ticks)/t.value:e/this._initialValue}ticksToTime(e,t){return this.getDurationOfTicks(e,t)}timeToTicks(e,t){const s=this.toSeconds(t),i=this.toSeconds(e),r=this.getTicksAtTime(s);return this.getTicksAtTime(s+i)-r}_fromType(e){return this.units==="bpm"&&this.multiplier?1/(60/e/this.multiplier):super._fromType(e)}_toType(e){return this.units==="bpm"&&this.multiplier?e/this.multiplier*60:super._toType(e)}get multiplier(){return this._multiplier}set multiplier(e){const t=this.value;this._multiplier=e,this.cancelScheduledValues(0),this.setValueAtTime(t,0)}}class _o extends ve{constructor(){super(I(_o.getDefaults(),arguments,["value"])),this.name="TickSignal";const e=I(_o.getDefaults(),arguments,["value"]);this.input=this._param=new mo({context:this.context,convert:e.convert,multiplier:e.multiplier,param:this._constantSource.offset,units:e.units,value:e.value})}static getDefaults(){return Object.assign(ve.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(e,t){return this._param.ticksToTime(e,t)}timeToTicks(e,t){return this._param.timeToTicks(e,t)}getTimeOfTick(e){return this._param.getTimeOfTick(e)}getDurationOfTicks(e,t){return this._param.getDurationOfTicks(e,t)}getTicksAtTime(e){return this._param.getTicksAtTime(e)}get multiplier(){return this._param.multiplier}set multiplier(e){this._param.multiplier=e}dispose(){return super.dispose(),this._param.dispose(),this}}class go extends dt{constructor(){super(I(go.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new Wc,this._tickOffset=new Dt,this._ticksAtTime=new Dt,this._secondsAtTime=new Dt;const e=I(go.getDefaults(),arguments,["frequency"]);this.frequency=new _o({context:this.context,units:e.units,value:e.frequency}),xe(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},dt.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(e,t){const s=this.toSeconds(e);return this._state.getValueAtTime(s)!=="started"&&(this._state.setStateAtTime("started",s),te(t)&&this.setTicksAtTime(t,s),this._ticksAtTime.cancel(s),this._secondsAtTime.cancel(s)),this}stop(e){const t=this.toSeconds(e);if(this._state.getValueAtTime(t)==="stopped"){const s=this._state.get(t);s&&s.time>0&&(this._tickOffset.cancel(s.time),this._state.cancel(s.time))}return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this.setTicksAtTime(0,t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}pause(e){const t=this.toSeconds(e);return this._state.getValueAtTime(t)==="started"&&(this._state.setStateAtTime("paused",t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t)),this}cancel(e){return e=this.toSeconds(e),this._state.cancel(e),this._tickOffset.cancel(e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}getTicksAtTime(e){const t=this.toSeconds(e),s=this._state.getLastState("stopped",t),i=this._ticksAtTime.get(t),r={state:"paused",time:t};this._state.add(r);let o=i||s,a=i?i.ticks:0,c=null;return this._state.forEachBetween(o.time,t+this.sampleTime,l=>{let u=o.time;const h=this._tickOffset.get(l.time);h&&h.time>=o.time&&(a=h.ticks,u=h.time),o.state==="started"&&l.state!=="started"&&(a+=this.frequency.getTicksAtTime(l.time)-this.frequency.getTicksAtTime(u),l.time!=r.time&&(c={state:l.state,time:l.time,ticks:a})),o=l}),this._state.remove(r),c&&this._ticksAtTime.add(c),a}get ticks(){return this.getTicksAtTime(this.now())}set ticks(e){this.setTicksAtTime(e,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(e){const t=this.now(),s=this.frequency.timeToTicks(e,t);this.setTicksAtTime(s,t)}getSecondsAtTime(e){e=this.toSeconds(e);const t=this._state.getLastState("stopped",e),s={state:"paused",time:e};this._state.add(s);const i=this._secondsAtTime.get(e);let r=i||t,o=i?i.seconds:0,a=null;return this._state.forEachBetween(r.time,e+this.sampleTime,c=>{let l=r.time;const u=this._tickOffset.get(c.time);u&&u.time>=r.time&&(o=u.seconds,l=u.time),r.state==="started"&&c.state!=="started"&&(o+=c.time-l,c.time!=s.time&&(a={state:c.state,time:c.time,seconds:o})),r=c}),this._state.remove(s),a&&this._secondsAtTime.add(a),o}setTicksAtTime(e,t){return t=this.toSeconds(t),this._tickOffset.cancel(t),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(e,t),ticks:e,time:t}),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}getStateAtTime(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)}getTimeOfTick(e,t=this.now()){const s=this._tickOffset.get(t),i=this._state.get(t),r=Math.max(s.time,i.time),o=this.frequency.getTicksAtTime(r)+e-s.ticks;return this.frequency.getTimeOfTick(o)}forEachTickBetween(e,t,s){let i=this._state.get(e);this._state.forEachBetween(e,t,o=>{i&&i.state==="started"&&o.state!=="started"&&this.forEachTickBetween(Math.max(i.time,e),o.time-this.sampleTime,s),i=o});let r=null;if(i&&i.state==="started"){const o=Math.max(i.time,e),a=this.frequency.getTicksAtTime(o),c=this.frequency.getTicksAtTime(i.time),l=a-c;let u=Math.ceil(l)-l;u=Ft(u,1)?0:u;let h=this.frequency.getTimeOfTick(a+u);for(;h{switch(s.state){case"started":const i=this._tickSource.getTicksAtTime(s.time);this.emit("start",s.time,i);break;case"stopped":s.time!==0&&this.emit("stop",s.time);break;case"paused":this.emit("pause",s.time);break}}),this._tickSource.forEachTickBetween(e,t,(s,i)=>{this.callback(s,i)}))}getStateAtTime(e){const t=this.toSeconds(e);return this._state.getValueAtTime(t)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}Sr.mixin(Qi);class Yc extends Ss{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const e=I(Yc.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=e.baseUrl,Object.keys(e.urls).forEach(t=>{this._loadingCount++;const s=e.urls[t];this.add(t,s,this._bufferLoaded.bind(this,e.onload),e.onerror)})}static getDefaults(){return{baseUrl:"",onerror:ce,onload:ce,urls:{}}}has(e){return this._buffers.has(e.toString())}get(e){return Q(this.has(e),`ToneAudioBuffers has no buffer named: ${e}`),this._buffers.get(e.toString())}_bufferLoaded(e){this._loadingCount--,this._loadingCount===0&&e&&e()}get loaded(){return Array.from(this._buffers).every(([e,t])=>t.loaded)}add(e,t,s=ce,i=ce){return ys(t)?(this.baseUrl&&t.trim().substring(0,11).toLowerCase()==="data:audio/"&&(this.baseUrl=""),this._buffers.set(e.toString(),new le(this.baseUrl+t,s,i))):this._buffers.set(e.toString(),new le(t,s,i)),this}dispose(){return super.dispose(),this._buffers.forEach(e=>e.dispose()),this._buffers.clear(),this}}class jn extends Li{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(e){return this._getPPQ()*e}_secondsToUnits(e){return Math.floor(e/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(e){return e}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}class OT extends dt{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Dt,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(e,t){return this._events.add({callback:e,time:this.toSeconds(t)}),this._events.length===1&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(e){return this._events.cancel(this.toSeconds(e)),this}_drawLoop(){const e=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=e;){const t=this._events.shift();t&&e-t.time<=this.expiration&&t.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}Vo(n=>{n.draw=new OT({context:n})});jo(n=>{n.draw.dispose()});class AT extends Ss{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(e){Q(te(e.time),"Events must have a time property"),Q(te(e.duration),"Events must have a duration parameter"),e.time=e.time.valueOf();let t=new MT(e.time,e.time+e.duration,e);for(this._root===null?this._root=t:this._root.insert(t),this._length++;t!==null;)t.updateHeight(),t.updateMax(),this._rebalance(t),t=t.parent;return this}remove(e){if(this._root!==null){const t=[];this._root.search(e.time,t);for(const s of t)if(s.event===e){this._removeNode(s),this._length--;break}}return this}get length(){return this._length}cancel(e){return this.forEachFrom(e,t=>this.remove(t)),this}_setRoot(e){this._root=e,this._root!==null&&(this._root.parent=null)}_replaceNodeInParent(e,t){e.parent!==null?(e.isLeftChild()?e.parent.left=t:e.parent.right=t,this._rebalance(e.parent)):this._setRoot(t)}_removeNode(e){if(e.left===null&&e.right===null)this._replaceNodeInParent(e,null);else if(e.right===null)this._replaceNodeInParent(e,e.left);else if(e.left===null)this._replaceNodeInParent(e,e.right);else{const t=e.getBalance();let s,i=null;if(t>0)if(e.left.right===null)s=e.left,s.right=e.right,i=s;else{for(s=e.left.right;s.right!==null;)s=s.right;s.parent&&(s.parent.right=s.left,i=s.parent,s.left=e.left,s.right=e.right)}else if(e.right.left===null)s=e.right,s.left=e.left,i=s;else{for(s=e.right.left;s.left!==null;)s=s.left;s.parent&&(s.parent.left=s.right,i=s.parent,s.left=e.left,s.right=e.right)}e.parent!==null?e.isLeftChild()?e.parent.left=s:e.parent.right=s:this._setRoot(s),i&&this._rebalance(i)}e.dispose()}_rotateLeft(e){const t=e.parent,s=e.isLeftChild(),i=e.right;i&&(e.right=i.left,i.left=e),t!==null?s?t.left=i:t.right=i:this._setRoot(i)}_rotateRight(e){const t=e.parent,s=e.isLeftChild(),i=e.left;i&&(e.left=i.right,i.right=e),t!==null?s?t.left=i:t.right=i:this._setRoot(i)}_rebalance(e){const t=e.getBalance();t>1&&e.left?e.left.getBalance()<0?this._rotateLeft(e.left):this._rotateRight(e):t<-1&&e.right&&(e.right.getBalance()>0?this._rotateRight(e.right):this._rotateLeft(e))}get(e){if(this._root!==null){const t=[];if(this._root.search(e,t),t.length>0){let s=t[0];for(let i=1;is.low&&(s=t[i]);return s.event}}return null}forEach(e){if(this._root!==null){const t=[];this._root.traverse(s=>t.push(s)),t.forEach(s=>{s.event&&e(s.event)})}return this}forEachAtTime(e,t){if(this._root!==null){const s=[];this._root.search(e,s),s.forEach(i=>{i.event&&t(i.event)})}return this}forEachFrom(e,t){if(this._root!==null){const s=[];this._root.searchAfter(e,s),s.forEach(i=>{i.event&&t(i.event)})}return this}dispose(){return super.dispose(),this._root!==null&&this._root.traverse(e=>e.dispose()),this._root=null,this}}class MT{constructor(e,t,s){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=s,this.low=e,this.high=t,this.max=this.high}insert(e){e.low<=this.low?this.left===null?this.left=e:this.left.insert(e):this.right===null?this.right=e:this.right.insert(e)}search(e,t){e>this.max||(this.left!==null&&this.left.search(e,t),this.low<=e&&this.high>e&&t.push(this),!(this.low>e)&&this.right!==null&&this.right.search(e,t))}searchAfter(e,t){this.low>=e&&(t.push(this),this.left!==null&&this.left.searchAfter(e,t)),this.right!==null&&this.right.searchAfter(e,t)}traverse(e){e(this),this.left!==null&&this.left.traverse(e),this.right!==null&&this.right.traverse(e)}updateHeight(){this.left!==null&&this.right!==null?this.height=Math.max(this.left.height,this.right.height)+1:this.right!==null?this.height=this.right.height+1:this.left!==null?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,this.left!==null&&(this.max=Math.max(this.max,this.left.max)),this.right!==null&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let e=0;return this.left!==null&&this.right!==null?e=this.left.height-this.right.height:this.left!==null?e=this.left.height+1:this.right!==null&&(e=-(this.right.height+1)),e}isLeftChild(){return this.parent!==null&&this.parent.left===this}get left(){return this._left}set left(e){this._left=e,e!==null&&(e.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(e){this._right=e,e!==null&&(e.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class qs extends W{constructor(){super(I(qs.getDefaults(),arguments,["volume"])),this.name="Volume";const e=I(qs.getDefaults(),arguments,["volume"]);this.input=this.output=new pe({context:this.context,gain:e.volume,units:"decibels"}),this.volume=this.output.gain,xe(this,"volume"),this._unmutedVolume=e.volume,this.mute=e.mute}static getDefaults(){return Object.assign(W.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(e){!this.mute&&e?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!e&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}let DT=class Xa extends W{constructor(){super(I(Xa.getDefaults(),arguments)),this.name="Destination",this.input=new qs({context:this.context}),this.output=new pe({context:this.context}),this.volume=this.input.volume;const e=I(Xa.getDefaults(),arguments);$i(this.input,this.output,this.context.rawContext.destination),this.mute=e.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(W.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(e){this.input.mute=e}chain(...e){return this.input.disconnect(),e.unshift(this.input),e.push(this.output),$i(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}};Vo(n=>{n.destination=new DT({context:n})});jo(n=>{n.destination.dispose()});class RT extends Ss{constructor(e){super(),this.name="TimelineValue",this._timeline=new Dt({memory:10}),this._initialValue=e}set(e,t){return this._timeline.add({value:e,time:t}),this}get(e){const t=this._timeline.get(e);return t?t.value:this._initialValue}}class xs extends W{constructor(){super(Object.assign(I(xs.getDefaults(),arguments,["context"])))}connect(e,t=0,s=0){return Gc(this,e,t,s),this}}class yn extends xs{constructor(){super(Object.assign(I(yn.getDefaults(),arguments,["mapping","length"]))),this.name="WaveShaper",this._shaper=this.context.createWaveShaper(),this.input=this._shaper,this.output=this._shaper;const e=I(yn.getDefaults(),arguments,["mapping","length"]);zt(e.mapping)||e.mapping instanceof Float32Array?this.curve=Float32Array.from(e.mapping):tT(e.mapping)&&this.setMap(e.mapping,e.length)}static getDefaults(){return Object.assign(ve.getDefaults(),{length:1024})}setMap(e,t=1024){const s=new Float32Array(t);for(let i=0,r=t;is.includes(e));Q(t,"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class Ki extends xs{constructor(){super(Object.assign(I(Ki.getDefaults(),arguments,["value"]))),this.name="Pow";const e=I(Ki.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new yn({context:this.context,mapping:this._expFunc(e.value),length:8192}),this._exponent=e.value}static getDefaults(){return Object.assign(xs.getDefaults(),{value:1})}_expFunc(e){return t=>Math.pow(Math.abs(t),e)}get value(){return this._exponent}set value(e){this._exponent=e,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class Ws{constructor(e,t){this.id=Ws._eventId++,this._remainderTime=0;const s=Object.assign(Ws.getDefaults(),t);this.transport=e,this.callback=s.callback,this._once=s.once,this.time=Math.floor(s.time),this._remainderTime=s.time-this.time}static getDefaults(){return{callback:ce,once:!1,time:0}}get floatTime(){return this.time+this._remainderTime}invoke(e){if(this.callback){const t=this.transport.bpm.getDurationOfTicks(1,e);this.callback(e+this._remainderTime*t),this._once&&this.transport.clear(this.id)}}dispose(){return this.callback=void 0,this}}Ws._eventId=0;class Zc extends Ws{constructor(e,t){super(e,t),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const s=Object.assign(Zc.getDefaults(),t);this.duration=s.duration,this._interval=s.interval,this._nextTick=s.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.transport.on("ticks",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},Ws.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(e){this._createEvents(e),super.invoke(e)}_createEvent(){return fo(this._nextTick,this.floatTime+this.duration)?this.transport.scheduleOnce(this.invoke.bind(this),new jn(this.context,this._nextTick).toSeconds()):-1}_createEvents(e){fo(this._nextTick+this._interval,this.floatTime+this.duration)&&(this._nextTick+=this._interval,this._currentId=this._nextId,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new jn(this.context,this._nextTick).toSeconds()))}_restart(e){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.floatTime;const t=this.transport.getTicksAtTime(e);ni(t,this.time)&&(this._nextTick=this.floatTime+Math.ceil((t-this.floatTime)/this._interval)*this._interval),this._currentId=this._createEvent(),this._nextTick+=this._interval,this._nextId=this._createEvent()}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this.transport.off("ticks",this._boundRestart),this}}class Ji extends dt{constructor(){super(I(Ji.getDefaults(),arguments)),this.name="Transport",this._loop=new RT(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Dt,this._repeatedEvents=new AT,this._syncedSignals=[],this._swingAmount=0;const e=I(Ji.getDefaults(),arguments);this._ppq=e.ppq,this._clock=new Qi({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=e.ppq,this.bpm.setValueAtTime(e.bpm,0),xe(this,"bpm"),this._timeSignature=e.timeSignature,this._swingTicks=e.ppq/2}static getDefaults(){return Object.assign(dt.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(e,t){if(this._loop.get(e)&&t>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),t=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._swingAmount>0&&t%this._ppq!==0&&t%(this._swingTicks*2)!==0){const s=t%(this._swingTicks*2)/(this._swingTicks*2),i=Math.sin(s*Math.PI)*this._swingAmount;e+=new jn(this.context,this._swingTicks*2/3).toSeconds()*i}nu(!0),this._timeline.forEachAtTime(t,s=>s.invoke(e)),nu(!1)}schedule(e,t){const s=new Ws(this,{callback:e,time:new Li(this.context,t).toTicks()});return this._addEvent(s,this._timeline)}scheduleRepeat(e,t,s,i=1/0){const r=new Zc(this,{callback:e,duration:new Lt(this.context,i).toTicks(),interval:new Lt(this.context,t).toTicks(),time:new Li(this.context,s).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(e,t){const s=new Ws(this,{callback:e,once:!0,time:new Li(this.context,t).toTicks()});return this._addEvent(s,this._timeline)}clear(e){if(this._scheduledEvents.hasOwnProperty(e)){const t=this._scheduledEvents[e.toString()];t.timeline.remove(t.event),t.event.dispose(),delete this._scheduledEvents[e.toString()]}return this}_addEvent(e,t){return this._scheduledEvents[e.id.toString()]={event:e,timeline:t},t.add(e),e.id}cancel(e=0){const t=this.toTicks(e);return this._timeline.forEachFrom(t,s=>this.clear(s.id)),this._repeatedEvents.forEachFrom(t,s=>this.clear(s.id)),this}_bindClockEvents(){this._clock.on("start",(e,t)=>{t=new jn(this.context,t).toSeconds(),this.emit("start",e,t)}),this._clock.on("stop",e=>{this.emit("stop",e)}),this._clock.on("pause",e=>{this.emit("pause",e)})}get state(){return this._clock.getStateAtTime(this.now())}start(e,t){this.context.resume();let s;return te(t)&&(s=this.toTicks(t)),this._clock.start(e,s),this}stop(e){return this._clock.stop(e),this}pause(e){return this._clock.pause(e),this}toggle(e){return e=this.toSeconds(e),this._clock.getStateAtTime(e)!=="started"?this.start(e):this.stop(e),this}get timeSignature(){return this._timeSignature}set timeSignature(e){zt(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}get loopStart(){return new Lt(this.context,this._loopStart,"i").toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new Lt(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e)}get loop(){return this._loop.get(this.now())}set loop(e){this._loop.set(e,this.now())}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get swing(){return this._swingAmount}set swing(e){this._swingAmount=e}get swingSubdivision(){return new jn(this.context,this._swingTicks).toNotation()}set swingSubdivision(e){this._swingTicks=this.toTicks(e)}get position(){const e=this.now(),t=this._clock.getTicksAtTime(e);return new jn(this.context,t).toBarsBeatsSixteenths()}set position(e){const t=this.toTicks(e);this.ticks=t}get seconds(){return this._clock.seconds}set seconds(e){const t=this.now(),s=this._clock.frequency.timeToTicks(e,t);this.ticks=s}get progress(){if(this.loop){const e=this.now();return(this._clock.getTicksAtTime(e)-this._loopStart)/(this._loopEnd-this._loopStart)}else return 0}get ticks(){return this._clock.ticks}set ticks(e){if(this._clock.ticks!==e){const t=this.now();if(this.state==="started"){const s=this._clock.getTicksAtTime(t),i=this._clock.frequency.getDurationOfTicks(Math.ceil(s)-s,t),r=t+i;this.emit("stop",r),this._clock.setTicksAtTime(e,r),this.emit("start",r,this._clock.getSecondsAtTime(r))}else this.emit("ticks",t),this._clock.setTicksAtTime(e,t)}}getTicksAtTime(e){return this._clock.getTicksAtTime(e)}getSecondsAtTime(e){return this._clock.getSecondsAtTime(e)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(e){this._clock.frequency.multiplier=e}nextSubdivision(e){if(e=this.toTicks(e),this.state!=="started")return 0;{const t=this.now(),s=this.getTicksAtTime(t),i=e-s%e;return this._clock.nextTickTime(i,t)}}syncSignal(e,t){const s=this.now();let i=this.bpm,r=1/(60/i.getValueAtTime(s)/this.PPQ),o=[];if(e.units==="time"){const c=.015625/r,l=new pe(c),u=new Ki(-1),h=new pe(c);i.chain(l,u,h),i=h,r=1/r,o=[l,u,h]}t||(e.getValueAtTime(s)!==0?t=e.getValueAtTime(s)/r:t=0);const a=new pe(t);return i.connect(a),a.connect(e._param),o.push(a),this._syncedSignals.push({initial:e.value,nodes:o,signal:e}),e.value=0,this}unsyncSignal(e){for(let t=this._syncedSignals.length-1;t>=0;t--){const s=this._syncedSignals[t];s.signal===e&&(s.nodes.forEach(i=>i.dispose()),s.signal.value=s.initial,this._syncedSignals.splice(t,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),Hc(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}Sr.mixin(Ji);Vo(n=>{n.transport=new Ji({context:n})});jo(n=>{n.transport.dispose()});class Ke extends W{constructor(e){super(e),this.input=void 0,this._state=new Wc("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=ce,this._syncedStop=ce,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new qs({context:this.context,mute:e.mute,volume:e.volume}),this.volume=this._volume.volume,xe(this,"volume"),this.onstop=e.onstop}static getDefaults(){return Object.assign(W.getDefaults(),{mute:!1,onstop:ce,volume:0})}get state(){return this._synced?this.context.transport.state==="started"?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}_clampToCurrentTime(e){return this._synced?e:Math.max(e,this.context.currentTime)}start(e,t,s){let i=xt(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(i=this._clampToCurrentTime(i),!this._synced&&this._state.getValueAtTime(i)==="started")Q(ni(i,this._state.get(i).time),"Start time must be strictly greater than previous start time"),this._state.cancel(i),this._state.setStateAtTime("started",i),this.log("restart",i),this.restart(i,t,s);else if(this.log("start",i),this._state.setStateAtTime("started",i),this._synced){const r=this._state.get(i);r&&(r.offset=this.toSeconds(Yn(t,0)),r.duration=s?this.toSeconds(s):void 0);const o=this.context.transport.schedule(a=>{this._start(a,t,s)},i);this._scheduled.push(o),this.context.transport.state==="started"&&this.context.transport.getSecondsAtTime(this.immediate())>i&&this._syncedStart(this.now(),this.context.transport.seconds)}else Cd(this.context),this._start(i,t,s);return this}stop(e){let t=xt(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(t=this._clampToCurrentTime(t),this._state.getValueAtTime(t)==="started"||te(this._state.getNextState("started",t))){if(this.log("stop",t),!this._synced)this._stop(t);else{const s=this.context.transport.schedule(this._stop.bind(this),t);this._scheduled.push(s)}this._state.cancel(t),this._state.setStateAtTime("stopped",t)}return this}restart(e,t,s){return e=this.toSeconds(e),this._state.getValueAtTime(e)==="started"&&(this._state.cancel(e),this._restart(e,t,s)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(e,t)=>{if(ni(t,0)){const s=this._state.get(t);if(s&&s.state==="started"&&s.time!==t){const i=t-this.toSeconds(s.time);let r;s.duration&&(r=this.toSeconds(s.duration)-i),this._start(e,this.toSeconds(s.offset)+i,r)}}},this._syncedStop=e=>{const t=this.context.transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));this._state.getValueAtTime(t)==="started"&&this._stop(e)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach(e=>this.context.transport.clear(e)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=ce,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class ri extends ii{constructor(){super(I(ri.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const e=I(ri.getDefaults(),arguments,["url","onload"]);Hs(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new ue({context:this.context,param:this._source.playbackRate,units:"positive",value:e.playbackRate}),this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this._buffer=new le(e.url,e.onload,e.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(ii.getDefaults(),{url:new le,loop:!1,loopEnd:0,loopStart:0,onload:ce,onerror:ce,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e}get curve(){return this._curve}set curve(e){this._curve=e}start(e,t,s,i=1){Q(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(e);this._startGain(r,i),this.loop?t=Yn(t,this.loopStart):t=Yn(t,0);let o=Math.max(this.toSeconds(t),0);if(this.loop){const a=this.toSeconds(this.loopEnd)||this.buffer.duration,c=this.toSeconds(this.loopStart),l=a-c;Ya(o,a)&&(o=(o-c)%l+c),Ft(o,this.buffer.duration)&&(o=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,fo(o,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,o)),te(s)){let a=this.toSeconds(s);a=Math.max(a,0),this.stop(r+a)}return this}_stopSource(e){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(e)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(e){this._source.loopStart=this.toSeconds(e)}get loopEnd(){return this._source.loopEnd}set loopEnd(e){this._source.loopEnd=this.toSeconds(e)}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._source.loop}set loop(e){this._source.loop=e,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class er extends Ke{constructor(){super(I(er.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const e=I(er.getDefaults(),arguments,["type"]);this._playbackRate=e.playbackRate,this.type=e.type,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(Ke.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(e){if(Q(e in iu,"Noise: invalid type: "+e),this._type!==e&&(this._type=e,this.state==="started")){const t=this.now();this._stop(t),this._start(t)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._source&&(this._source.playbackRate.value=e)}_start(e){const t=iu[this._type];this._source=new ri({url:t,context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,loop:!0,onended:()=>this.onstop(this),playbackRate:this._playbackRate}).connect(this.output),this._source.start(this.toSeconds(e),Math.random()*(t.duration-.001))}_stop(e){this._source&&(this._source.stop(this.toSeconds(e)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(e){this._stop(e),this._start(e)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const Nn=44100*5,ya=2,as={brown:null,pink:null,white:null},iu={get brown(){if(!as.brown){const n=[];for(let e=0;ethis.onstop(this)});this._oscillator=s,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(t)}_stop(e){const t=this.toSeconds(e);this._oscillator&&this._oscillator.stop(t)}_restart(e){const t=this.toSeconds(e);return this.log("restart",t),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(t),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if(this._type==="custom")return Ie._periodicWaveCache.find(t=>t.phase===this._phase&&dT(t.partials,this._partials));{const e=Ie._periodicWaveCache.find(t=>t.type===this._type&&t.phase===this._phase);return this._partialCount=e?e.partialCount:this._partialCount,e}}get type(){return this._type}set type(e){this._type=e;const t=["sine","square","sawtooth","triangle"].indexOf(e)!==-1;if(this._phase===0&&t)this._wave=void 0,this._partialCount=0,this._oscillator!==null&&(this._oscillator.type=e);else{const s=this._getCachedPeriodicWave();if(te(s)){const{partials:i,wave:r}=s;this._wave=r,this._partials=i,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave)}else{const[i,r]=this._getRealImaginary(e,this._phase),o=this.context.createPeriodicWave(i,r);this._wave=o,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave),Ie._periodicWaveCache.push({imag:r,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:i,type:this._type,wave:this._wave}),Ie._periodicWaveCache.length>100&&Ie._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(e){this.partialCount&&this._type!=="custom"&&e!=="custom"?this.type=e+this.partialCount:this.type=e}get partialCount(){return this._partialCount}set partialCount(e){Vt(e,0);let t=this._type;const s=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(s&&(t=s[1]),this._type!=="custom")e===0?this.type=t:this.type=t+e.toString();else{const i=new Float32Array(e);this._partials.forEach((r,o)=>i[o]=r),this._partials=Array.from(i),this.type=this._type}}_getRealImaginary(e,t){let i=2048;const r=new Float32Array(i),o=new Float32Array(i);let a=1;if(e==="custom"){if(a=this._partials.length+1,this._partialCount=this._partials.length,i=a,this._partials.length===0)return[r,o]}else{const c=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);c?(a=parseInt(c[2],10)+1,this._partialCount=parseInt(c[2],10),e=c[1],a=Math.max(a,2),i=a):this._partialCount=0,this._partials=[]}for(let c=1;c>1&1?-1:1):u=0,this._partials[c-1]=u;break;case"custom":u=this._partials[c-1];break;default:throw new TypeError("Oscillator: invalid type: "+e)}u!==0?(r[c]=-u*Math.sin(t*c),o[c]=u*Math.cos(t*c)):(r[c]=0,o[c]=0)}return[r,o]}_inverseFFT(e,t,s){let i=0;const r=e.length;for(let o=0;o(e+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Gs extends ve{constructor(){super(Object.assign(I(Gs.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const e=I(Gs.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new pe({context:this.context,minValue:e.minValue,maxValue:e.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(ve.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class tr extends Ke{constructor(){super(I(tr.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new PT({context:this.context}),this._modulationNode=new pe({context:this.context});const e=I(tr.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Ie({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new Ie({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new Gs({context:this.context,units:"positive",value:e.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),xe(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Ie.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){this._modulator.restart(e),this._carrier.restart(e)}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}class sr extends Ke{constructor(){super(I(sr.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new pe({context:this.context,gain:0});const e=I(sr.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Ie({context:this.context,detune:e.detune,frequency:0,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.detune=this._carrier.detune,this.frequency=new ve({context:this.context,units:"frequency",value:e.frequency}),this._modulator=new Ie({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new Gs({context:this.context,units:"positive",value:e.harmonicity}),this.modulationIndex=new Gs({context:this.context,units:"positive",value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),xe(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Ie.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){return this._modulator.restart(e),this._carrier.restart(e),this}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class oi extends Ke{constructor(){super(I(oi.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new pe({context:this.context,gain:0}),this._thresh=new yn({context:this.context,mapping:t=>t<=0?-1:1});const e=I(oi.getDefaults(),arguments,["frequency","width"]);this.width=new ve({context:this.context,units:"audioRange",value:e.width}),this._triangle=new Ie({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),xe(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(Ke.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(e){e=this.toSeconds(e),this._triangle.start(e),this._widthGate.gain.setValueAtTime(1,e)}_stop(e){e=this.toSeconds(e),this._triangle.stop(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(0,e)}_restart(e){this._triangle.restart(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(1,e)}get phase(){return this._triangle.phase}set phase(e){this._triangle.phase=e}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(e){this._triangle.type=e}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class nr extends Ke{constructor(){super(I(nr.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const e=I(nr.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new ve({context:this.context,units:"frequency",value:e.frequency}),this.detune=new ve({context:this.context,units:"cents",value:e.detune}),this._spread=e.spread,this._type=e.type,this._phase=e.phase,this._partials=e.partials,this._partialCount=e.partialCount,this.count=e.count,xe(this,["frequency","detune"])}static getDefaults(){return Object.assign(Ie.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(e){e=this.toSeconds(e),this._forEach(t=>t.start(e))}_stop(e){e=this.toSeconds(e),this._forEach(t=>t.stop(e))}_restart(e){this._forEach(t=>t.restart(e))}_forEach(e){for(let t=0;tt.type=e)}get spread(){return this._spread}set spread(e){if(this._spread=e,this._oscillators.length>1){const t=-e/2,s=e/(this._oscillators.length-1);this._forEach((i,r)=>i.detune.value=t+s*r)}}get count(){return this._oscillators.length}set count(e){if(Vt(e,1),this._oscillators.length!==e){this._forEach(t=>t.dispose()),this._oscillators=[];for(let t=0;tthis.onstop(this):ce});this.type==="custom"&&(s.partials=this._partials),this.frequency.connect(s.frequency),this.detune.connect(s.detune),s.detune.overridden=!1,s.connect(this.output),this._oscillators[t]=s}this.spread=this._spread,this.state==="started"&&this._forEach(t=>t.start())}}get phase(){return this._phase}set phase(e){this._phase=e,this._forEach((t,s)=>t.phase=this._phase+s/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(e){this._forEach(t=>t.baseType=e),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(e){this._partials=e,this._partialCount=this._partials.length,e.length&&(this._type="custom",this._forEach(t=>t.partials=e))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(e){this._partialCount=e,this._forEach(t=>t.partialCount=e),this._type=this._oscillators[0].type}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(e=>e.dispose()),this}}class ir extends Ke{constructor(){super(I(ir.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new Gs({context:this.context,value:2});const e=I(ir.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new oi({context:this.context,frequency:e.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new Ie({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),xe(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(Ke.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(e){e=this.toSeconds(e),this._modulator.start(e),this._pulse.start(e)}_stop(e){e=this.toSeconds(e),this._modulator.stop(e),this._pulse.stop(e)}_restart(e){this._modulator.restart(e),this._pulse.restart(e)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(e){this._modulator.phase=e}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const ru={am:tr,fat:nr,fm:sr,oscillator:Ie,pulse:oi,pwm:ir};class xn extends Ke{constructor(){super(I(xn.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const e=I(xn.getDefaults(),arguments,["frequency","type"]);this.frequency=new ve({context:this.context,units:"frequency",value:e.frequency}),this.detune=new ve({context:this.context,units:"cents",value:e.detune}),xe(this,["frequency","detune"]),this.set(e)}static getDefaults(){return Object.assign(Ie.getDefaults(),sr.getDefaults(),tr.getDefaults(),nr.getDefaults(),oi.getDefaults(),ir.getDefaults())}_start(e){this._oscillator.start(e)}_stop(e){this._oscillator.stop(e)}_restart(e){return this._oscillator.restart(e),this}get type(){let e="";return["am","fm","fat"].some(t=>this._sourceType===t)&&(e=this._sourceType),e+this._oscillator.type}set type(e){e.substr(0,2)==="fm"?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):e.substr(0,2)==="am"?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):e.substr(0,3)==="fat"?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(3)):e==="pwm"?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):e==="pulse"?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=e)}get partials(){return this._oscillator.partials}set partials(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partials=e)}get partialCount(){return this._oscillator.partialCount}set partialCount(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partialCount=e)}set(e){return Reflect.has(e,"type")&&e.type&&(this.type=e.type),super.set(e),this}_createNewOscillator(e){if(e!==this._sourceType){this._sourceType=e;const t=ru[e],s=this.now();if(this._oscillator){const i=this._oscillator;i.stop(s),this.context.setTimeout(()=>i.dispose(),this.blockTime)}this._oscillator=new t({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),this.state==="started"&&this._oscillator.start(s)}}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e}get sourceType(){return this._sourceType}set sourceType(e){let t="sine";this._oscillator.type!=="pwm"&&this._oscillator.type!=="pulse"&&(t=this._oscillator.type),e==="fm"?this.type="fm"+t:e==="am"?this.type="am"+t:e==="fat"?this.type="fat"+t:e==="oscillator"?this.type=t:e==="pulse"?this.type="pulse":e==="pwm"&&(this.type="pwm")}_getOscType(e,t){return e instanceof ru[t]}get baseType(){return this._oscillator.baseType}set baseType(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&e!=="pulse"&&e!=="pwm"&&(this._oscillator.baseType=e)}get width(){if(this._getOscType(this._oscillator,"pulse"))return this._oscillator.width}get count(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.count}set count(e){this._getOscType(this._oscillator,"fat")&&js(e)&&(this._oscillator.count=e)}get spread(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.spread}set spread(e){this._getOscType(this._oscillator,"fat")&&js(e)&&(this._oscillator.spread=e)}get modulationType(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.modulationType}set modulationType(e){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&ys(e)&&(this._oscillator.modulationType=e)}get modulationIndex(){if(this._getOscType(this._oscillator,"fm"))return this._oscillator.modulationIndex}get harmonicity(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.harmonicity}get modulationFrequency(){if(this._getOscType(this._oscillator,"pwm"))return this._oscillator.modulationFrequency}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class Xc extends ve{constructor(){super(Object.assign(I(Xc.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new pe({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,$i(this._constantSource,this._sum)}static getDefaults(){return Object.assign(ve.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class yo extends xs{constructor(){super(Object.assign(I(yo.getDefaults(),arguments,["min","max"]))),this.name="Scale";const e=I(yo.getDefaults(),arguments,["min","max"]);this._mult=this.input=new Gs({context:this.context,value:e.max-e.min}),this._add=this.output=new Xc({context:this.context,value:e.min}),this._min=e.min,this._max=e.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(xs.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(e){this._min=e,this._setRange()}get max(){return this._max}set max(e){this._max=e,this._setRange()}_setRange(){this._add.value=this._min,this._mult.value=this._max-this._min}dispose(){return super.dispose(),this._add.dispose(),this._mult.dispose(),this}}function Id(n,e=1/0){const t=new WeakMap;return function(s,i){Reflect.defineProperty(s,i,{configurable:!0,enumerable:!0,get:function(){return t.get(this)},set:function(r){Vt(r,n,e),t.set(this,r)}})}}function Cs(n,e=1/0){const t=new WeakMap;return function(s,i){Reflect.defineProperty(s,i,{configurable:!0,enumerable:!0,get:function(){return t.get(this)},set:function(r){Vt(this.toSeconds(r),n,e),t.set(this,r)}})}}class rr extends Ke{constructor(){super(I(rr.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const e=I(rr.getDefaults(),arguments,["url","onload"]);this._buffer=new le({onload:this._onload.bind(this,e.onload),onerror:e.onerror,reverse:e.reverse,url:e.url}),this.autostart=e.autostart,this._loop=e.loop,this._loopStart=e.loopStart,this._loopEnd=e.loopEnd,this._playbackRate=e.playbackRate,this.fadeIn=e.fadeIn,this.fadeOut=e.fadeOut}static getDefaults(){return Object.assign(Ke.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:ce,onerror:ce,playbackRate:1,reverse:!1})}load(e){return Fe(this,void 0,void 0,function*(){return yield this._buffer.load(e),this._onload(),this})}_onload(e=ce){e(),this.autostart&&this.start()}_onSourceEnd(e){this.onstop(this),this._activeSources.delete(e),this._activeSources.size===0&&!this._synced&&this._state.getValueAtTime(this.now())==="started"&&(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(e,t,s){return super.start(e,t,s),this}_start(e,t,s){this._loop?t=Yn(t,this._loopStart):t=Yn(t,0);const i=this.toSeconds(t),r=s;s=Yn(s,Math.max(this._buffer.duration-i,0));let o=this.toSeconds(s);o=o/this._playbackRate,e=this.toSeconds(e);const a=new ri({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);!this._loop&&!this._synced&&(this._state.cancel(e+o),this._state.setStateAtTime("stopped",e+o,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&xt(r)?a.start(e,i):a.start(e,i,o-this.toSeconds(this.fadeOut))}_stop(e){const t=this.toSeconds(e);this._activeSources.forEach(s=>s.stop(t))}restart(e,t,s){return super.restart(e,t,s),this}_restart(e,t,s){var i;(i=[...this._activeSources].pop())===null||i===void 0||i.stop(e),this._start(e,t,s)}seek(e,t){const s=this.toSeconds(t);if(this._state.getValueAtTime(s)==="started"){const i=this.toSeconds(e);this._stop(s),this._start(s,i)}return this}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this.buffer.loaded&&Vt(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(t=>{t.loopStart=e})}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this.buffer.loaded&&Vt(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(t=>{t.loopEnd=e})}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._loop}set loop(e){if(this._loop!==e&&(this._loop=e,this._activeSources.forEach(t=>{t.loop=e}),e)){const t=this._state.getNextState("stopped",this.now());t&&this._state.cancel(t.time)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e;const t=this.now(),s=this._state.getNextState("stopped",t);s&&s.implicitEnd&&(this._state.cancel(s.time),this._activeSources.forEach(i=>i.cancelStop())),this._activeSources.forEach(i=>{i.playbackRate.setValueAtTime(e,t)})}get reverse(){return this._buffer.reverse}set reverse(e){this._buffer.reverse=e}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(e=>e.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}}jt([Cs(0)],rr.prototype,"fadeIn",void 0);jt([Cs(0)],rr.prototype,"fadeOut",void 0);class IT extends xs{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new yn({context:this.context,mapping:e=>Math.abs(e)*2-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Pt extends W{constructor(){super(I(Pt.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new ve({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const e=I(Pt.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=e.attack,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this.attackCurve=e.attackCurve,this.releaseCurve=e.releaseCurve,this.decayCurve=e.decayCurve}static getDefaults(){return Object.assign(W.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(e,t){if(ys(e))return e;{let s;for(s in Br)if(Br[s][t]===e)return s;return e}}_setCurve(e,t,s){if(ys(s)&&Reflect.has(Br,s)){const i=Br[s];fn(i)?e!=="_decayCurve"&&(this[e]=i[t]):this[e]=i}else if(zt(s)&&e!=="_decayCurve")this[e]=s;else throw new Error("Envelope: invalid curve: "+s)}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(e){this._setCurve("_attackCurve","In",e)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(e){this._setCurve("_releaseCurve","Out",e)}get decayCurve(){return this._getCurve(this._decayCurve,"Out")}set decayCurve(e){this._setCurve("_decayCurve","Out",e)}triggerAttack(e,t=1){this.log("triggerAttack",e,t),e=this.toSeconds(e);let i=this.toSeconds(this.attack);const r=this.toSeconds(this.decay),o=this.getValueAtTime(e);if(o>0){const a=1/i;i=(1-o)/a}if(i0){const s=this.toSeconds(this.release);s{let e,t;const s=[];for(e=0;e<128;e++)s[e]=Math.sin(e/(128-1)*(Math.PI/2));const i=[],r=6.4;for(e=0;e<128-1;e++){t=e/(128-1);const d=Math.sin(t*(Math.PI*2)*r-Math.PI/2)+1;i[e]=d/10+t*.83}i[128-1]=1;const o=[],a=5;for(e=0;e<128;e++)o[e]=Math.ceil(e/(128-1)*a)/a;const c=[];for(e=0;e<128;e++)t=e/(128-1),c[e]=.5*(1-Math.cos(Math.PI*t));const l=[];for(e=0;e<128;e++){t=e/(128-1);const d=Math.pow(t,3)*4+.2,f=Math.cos(d*Math.PI*2*t);l[e]=Math.abs(f*(1-t))}function u(d){const f=new Array(d.length);for(let m=0;mthis._original_triggerRelease(t);const e=I(Tn.getDefaults(),arguments);this._volume=this.output=new qs({context:this.context,volume:e.volume}),this.volume=this._volume.volume,xe(this,"volume")}static getDefaults(){return Object.assign(W.getDefaults(),{volume:0})}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",0),this.context.transport.on("stop",this._syncedRelease),this.context.transport.on("pause",this._syncedRelease),this.context.transport.on("loopEnd",this._syncedRelease)),this}_syncState(){let e=!1;return this._synced||(this._synced=!0,e=!0),e}_syncMethod(e,t){const s=this["_original_"+e]=this[e];this[e]=(...i)=>{const r=i[t],o=this.context.transport.schedule(a=>{i[t]=a,s.apply(this,i)},r);this._scheduledEvents.push(o)}}unsync(){return this._scheduledEvents.forEach(e=>this.context.transport.clear(e)),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease,this.context.transport.off("stop",this._syncedRelease),this.context.transport.off("pause",this._syncedRelease),this.context.transport.off("loopEnd",this._syncedRelease)),this}triggerAttackRelease(e,t,s,i){const r=this.toSeconds(s),o=this.toSeconds(t);return this.triggerAttack(e,r,i),this.triggerRelease(r+o),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class Ts extends Tn{constructor(){super(I(Ts.getDefaults(),arguments));const e=I(Ts.getDefaults(),arguments);this.portamento=e.portamento,this.onsilence=e.onsilence}static getDefaults(){return Object.assign(Tn.getDefaults(),{detune:0,onsilence:ce,portamento:0})}triggerAttack(e,t,s=1){this.log("triggerAttack",e,t,s);const i=this.toSeconds(t);return this._triggerEnvelopeAttack(i,s),this.setNote(e,i),this}triggerRelease(e){this.log("triggerRelease",e);const t=this.toSeconds(e);return this._triggerEnvelopeRelease(t),this}setNote(e,t){const s=this.toSeconds(t),i=e instanceof Mt?e.toFrequency():e;if(this.portamento>0&&this.getLevelAtTime(s)>.05){const r=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(i,r,s)}else this.frequency.setValueAtTime(i,s);return this}}jt([Cs(0)],Ts.prototype,"portamento",void 0);class Wo extends Pt{constructor(){super(I(Wo.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new pe({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}}class or extends Ts{constructor(){super(I(or.getDefaults(),arguments)),this.name="Synth";const e=I(or.getDefaults(),arguments);this.oscillator=new xn(Object.assign({context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)},e.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Wo(Object.assign({context:this.context},e.envelope)),this.oscillator.chain(this.envelope,this.output),xe(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(Ts.getDefaults(),{envelope:Object.assign(Vn(Pt.getDefaults(),Object.keys(W.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(Vn(xn.getDefaults(),[...Object.keys(Ke.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(e,t){if(this.envelope.triggerAttack(e,t),this.oscillator.start(e),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),i=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+s+i)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class ar extends W{constructor(){super(I(ar.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const e=I(ar.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new ue({context:this.context,units:"number",value:e.Q,param:this._filter.Q}),this.frequency=new ue({context:this.context,units:"frequency",value:e.frequency,param:this._filter.frequency}),this.detune=new ue({context:this.context,units:"cents",value:e.detune,param:this._filter.detune}),this.gain=new ue({context:this.context,units:"decibels",convert:!1,value:e.gain,param:this._filter.gain}),this.type=e.type}static getDefaults(){return Object.assign(W.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(e){Q(["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(e)!==-1,`Invalid filter type: ${e}`),this._filter.type=e}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let o=0;os.type=e)}get rolloff(){return this._rolloff}set rolloff(e){const t=js(e)?e:parseInt(e,10),s=[-12,-24,-48,-96];let i=s.indexOf(t);Q(i!==-1,`rolloff can only be ${s.join(", ")}`),i+=1,this._rolloff=t,this.input.disconnect(),this._filters.forEach(r=>r.disconnect()),this._filters=new Array(i);for(let r=0;r1);return this._filters.forEach(()=>{t.getFrequencyResponse(e).forEach((r,o)=>s[o]*=r)}),t.dispose(),s}dispose(){return super.dispose(),this._filters.forEach(e=>{e.dispose()}),Hc(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class cr extends Pt{constructor(){super(I(cr.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const e=I(cr.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=e.octaves,this._baseFrequency=this.toFrequency(e.baseFrequency),this._exponent=this.input=new Ki({context:this.context,value:e.exponent}),this._scale=this.output=new yo({context:this.context,min:this._baseFrequency,max:this._baseFrequency*Math.pow(2,this._octaves)}),this._sig.chain(this._exponent,this._scale)}static getDefaults(){return Object.assign(Pt.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){const t=this.toFrequency(e);Vt(t,0),this._baseFrequency=t,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._scale.max=this._baseFrequency*Math.pow(2,e)}get exponent(){return this._exponent.value}set exponent(e){this._exponent.value=e}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class lr extends Ts{constructor(){super(I(lr.getDefaults(),arguments)),this.name="MonoSynth";const e=I(lr.getDefaults(),arguments);this.oscillator=new xn(Object.assign(e.oscillator,{context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new ai(Object.assign(e.filter,{context:this.context})),this.filterEnvelope=new cr(Object.assign(e.filterEnvelope,{context:this.context})),this.envelope=new Wo(Object.assign(e.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),xe(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(Ts.getDefaults(),{envelope:Object.assign(Vn(Pt.getDefaults(),Object.keys(W.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(Vn(ai.getDefaults(),Object.keys(W.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(Vn(cr.getDefaults(),Object.keys(W.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(Vn(xn.getDefaults(),Object.keys(Ke.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(e,t=1){if(this.envelope.triggerAttack(e,t),this.filterEnvelope.triggerAttack(e),this.oscillator.start(e),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),i=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+s+i)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.filterEnvelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class ur extends or{constructor(){super(I(ur.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const e=I(ur.getDefaults(),arguments);this.pitchDecay=e.pitchDecay,this.octaves=e.octaves,xe(this,["oscillator","envelope"])}static getDefaults(){return Gn(Ts.getDefaults(),or.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(e,t){const s=this.toSeconds(t),i=this.toFrequency(e instanceof Mt?e.toFrequency():e),r=i*this.octaves;return this.oscillator.frequency.setValueAtTime(r,s),this.oscillator.frequency.exponentialRampToValueAtTime(i,s+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}jt([Id(0)],ur.prototype,"octaves",void 0);jt([Cs(0)],ur.prototype,"pitchDecay",void 0);const Nd=new Set;function $c(n){Nd.add(n)}function Fd(n,e){const t=`registerProcessor("${n}", ${e})`;Nd.add(t)}const NT=` + */class Ss{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...e){(this.debug||pn&&this.toString()===pn.TONE_DEBUG_CLASS)&&rT(this,...e)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}Ss.version=Rh;const jc=1e-6;function ni(n,e){return n>e+jc}function Ya(n,e){return ni(n,e)||Ft(n,e)}function fo(n,e){return n+jcthis.memory){const t=this.length-this.memory;this._timeline.splice(0,t)}return this}remove(e){const t=this._timeline.indexOf(e);return t!==-1&&this._timeline.splice(t,1),this}get(e,t="time"){const s=this._search(e,t);return s!==-1?this._timeline[s]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(e,t="time"){const s=this._search(e,t);return s+10&&this._timeline[t-1].time=0?this._timeline[s-1]:null}cancel(e){if(this._timeline.length>1){let t=this._search(e);if(t>=0)if(Ft(this._timeline[t].time,e)){for(let s=t;s>=0&&Ft(this._timeline[s].time,e);s--)t=s;this._timeline=this._timeline.slice(0,t)}else this._timeline=this._timeline.slice(0,t+1);else this._timeline=[]}else this._timeline.length===1&&Ya(this._timeline[0].time,e)&&(this._timeline=[]);return this}cancelBefore(e){const t=this._search(e);return t>=0&&(this._timeline=this._timeline.slice(t+1)),this}previousEvent(e){const t=this._timeline.indexOf(e);return t>0?this._timeline[t-1]:null}_search(e,t="time"){if(this._timeline.length===0)return-1;let s=0;const i=this._timeline.length;let r=i;if(i>0&&this._timeline[i-1][t]<=e)return i-1;for(;s=0&&this._timeline[s].time>=e;)s--;return this._iterate(t,s+1),this}forEachAtTime(e,t){const s=this._search(e);if(s!==-1&&Ft(this._timeline[s].time,e)){let i=s;for(let r=s;r>=0&&Ft(this._timeline[r].time,e);r--)i=r;this._iterate(r=>{t(r)},i,s)}return this}dispose(){return super.dispose(),this._timeline=[],this}}const Od=[];function Vo(n){Od.push(n)}function _T(n){Od.forEach(e=>e(n))}const Ad=[];function jo(n){Ad.push(n)}function gT(n){Ad.forEach(e=>e(n))}class Sr extends Ss{constructor(){super(...arguments),this.name="Emitter"}on(e,t){return e.split(/\W+/).forEach(i=>{xt(this._events)&&(this._events={}),this._events.hasOwnProperty(i)||(this._events[i]=[]),this._events[i].push(t)}),this}once(e,t){const s=(...i)=>{t(...i),this.off(e,s)};return this.on(e,s),this}off(e,t){return e.split(/\W+/).forEach(i=>{if(xt(this._events)&&(this._events={}),this._events.hasOwnProperty(i))if(xt(t))this._events[i]=[];else{const r=this._events[i];for(let o=r.length-1;o>=0;o--)r[o]===t&&r.splice(o,1)}}),this}emit(e,...t){if(this._events&&this._events.hasOwnProperty(e)){const s=this._events[e].slice(0);for(let i=0,r=s.length;i{const s=Object.getOwnPropertyDescriptor(Sr.prototype,t);Object.defineProperty(e.prototype,t,s)})}dispose(){return super.dispose(),this._events=void 0,this}}class Md extends Sr{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}class Cr extends Md{constructor(){var e,t;super(),this.name="Context",this._constants=new Map,this._timeouts=new Dt,this._timeoutIds=0,this._initialized=!1,this._closeStarted=!1,this.isOffline=!1,this._workletPromise=null;const s=I(Cr.getDefaults(),arguments,["context"]);s.context?(this._context=s.context,this._latencyHint=((e=arguments[0])===null||e===void 0?void 0:e.latencyHint)||""):(this._context=oT({latencyHint:s.latencyHint}),this._latencyHint=s.latencyHint),this._ticker=new uT(this.emit.bind(this,"tick"),s.clockSource,s.updateInterval,this._context.sampleRate),this.on("tick",this._timeoutLoop.bind(this)),this._context.onstatechange=()=>{this.emit("statechange",this.state)},this[!((t=arguments[0])===null||t===void 0)&&t.hasOwnProperty("updateInterval")?"_lookAhead":"lookAhead"]=s.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){return this._initialized||(_T(this),this._initialized=!0),this}createAnalyser(){return this._context.createAnalyser()}createOscillator(){return this._context.createOscillator()}createBufferSource(){return this._context.createBufferSource()}createBiquadFilter(){return this._context.createBiquadFilter()}createBuffer(e,t,s){return this._context.createBuffer(e,t,s)}createChannelMerger(e){return this._context.createChannelMerger(e)}createChannelSplitter(e){return this._context.createChannelSplitter(e)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(e){return this._context.createDelay(e)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(e,t){return this._context.createIIRFilter(e,t)}createPanner(){return this._context.createPanner()}createPeriodicWave(e,t,s){return this._context.createPeriodicWave(e,t,s)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(e){return Q(Un(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamSource(e)}createMediaElementSource(e){return Q(Un(this._context),"Not available if OfflineAudioContext"),this._context.createMediaElementSource(e)}createMediaStreamDestination(){return Q(Un(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamDestination()}decodeAudioData(e){return this._context.decodeAudioData(e)}get currentTime(){return this._context.currentTime}get state(){return this._context.state}get sampleRate(){return this._context.sampleRate}get listener(){return this.initialize(),this._listener}set listener(e){Q(!this._initialized,"The listener cannot be set after initialization."),this._listener=e}get transport(){return this.initialize(),this._transport}set transport(e){Q(!this._initialized,"The transport cannot be set after initialization."),this._transport=e}get draw(){return this.initialize(),this._draw}set draw(e){Q(!this._initialized,"Draw cannot be set after initialization."),this._draw=e}get destination(){return this.initialize(),this._destination}set destination(e){Q(!this._initialized,"The destination cannot be set after initialization."),this._destination=e}createAudioWorkletNode(e,t){return lT(this.rawContext,e,t)}addAudioWorkletModule(e){return Fe(this,void 0,void 0,function*(){Q(te(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletPromise||(this._workletPromise=this.rawContext.audioWorklet.addModule(e)),yield this._workletPromise})}workletsAreReady(){return Fe(this,void 0,void 0,function*(){(yield this._workletPromise)?this._workletPromise:Promise.resolve()})}get updateInterval(){return this._ticker.updateInterval}set updateInterval(e){this._ticker.updateInterval=e}get clockSource(){return this._ticker.type}set clockSource(e){this._ticker.type=e}get lookAhead(){return this._lookAhead}set lookAhead(e){this._lookAhead=e,this.updateInterval=e?e/2:.01}get latencyHint(){return this._latencyHint}get rawContext(){return this._context}now(){return this._context.currentTime+this._lookAhead}immediate(){return this._context.currentTime}resume(){return Un(this._context)?this._context.resume():Promise.resolve()}close(){return Fe(this,void 0,void 0,function*(){Un(this._context)&&this.state!=="closed"&&!this._closeStarted&&(this._closeStarted=!0,yield this._context.close()),this._initialized&&gT(this)})}getConstant(e){if(this._constants.has(e))return this._constants.get(e);{const t=this._context.createBuffer(1,128,this._context.sampleRate),s=t.getChannelData(0);for(let r=0;rthis._constants[e].disconnect()),this.close(),this}_timeoutLoop(){const e=this.now();let t=this._timeouts.peek();for(;this._timeouts.length&&t&&t.time<=e;)t.callback(),this._timeouts.shift(),t=this._timeouts.peek()}setTimeout(e,t){this._timeoutIds++;const s=this.now();return this._timeouts.add({callback:e,id:this._timeoutIds,time:s+t}),this._timeoutIds}clearTimeout(e){return this._timeouts.forEach(t=>{t.id===e&&this._timeouts.remove(t)}),this}clearInterval(e){return this.clearTimeout(e)}setInterval(e,t){const s=++this._timeoutIds,i=()=>{const r=this.now();this._timeouts.add({callback:()=>{e(),i()},id:s,time:r+t})};return i(),s}}class vT extends Md{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(e,t,s){return{}}createChannelMerger(e){return{}}createChannelSplitter(e){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(e){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(e,t){return{}}createPanner(){return{}}createPeriodicWave(e,t,s){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(e){return{}}createMediaElementSource(e){return{}}createMediaStreamDestination(){return{}}decodeAudioData(e){return Promise.resolve({})}createAudioWorkletNode(e,t){return{}}get rawContext(){return{}}addAudioWorkletModule(e){return Fe(this,void 0,void 0,function*(){return Promise.resolve()})}resume(){return Promise.resolve()}setTimeout(e,t){return 0}clearTimeout(e){return this}setInterval(e,t){return 0}clearInterval(e){return this}getConstant(e){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(e){}get destination(){return{}}set destination(e){}now(){return 0}immediate(){return 0}}function xe(n,e){zt(e)?e.forEach(t=>xe(n,t)):Object.defineProperty(n,e,{enumerable:!0,writable:!1})}function Hc(n,e){zt(e)?e.forEach(t=>Hc(n,t)):Object.defineProperty(n,e,{writable:!0})}const ce=()=>{};class le extends Ss{constructor(){super(),this.name="ToneAudioBuffer",this.onload=ce;const e=I(le.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=e.reverse,this.onload=e.onload,ys(e.url)?this.load(e.url).catch(e.onerror):e.url&&this.set(e.url)}static getDefaults(){return{onerror:ce,onload:ce,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:Ut().sampleRate}set(e){return e instanceof le?e.loaded?this._buffer=e.get():e.onload=()=>{this.set(e),this.onload(this)}:this._buffer=e,this._reversed&&this._reverse(),this}get(){return this._buffer}load(e){return Fe(this,void 0,void 0,function*(){const t=le.load(e).then(s=>{this.set(s),this.onload(this)});le.downloads.push(t);try{yield t}finally{const s=le.downloads.indexOf(t);le.downloads.splice(s,1)}return this})}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(e){const t=zt(e)&&e[0].length>0,s=t?e.length:1,i=t?e[0].length:e.length,r=Ut(),o=r.createBuffer(s,i,r.sampleRate),a=!t&&s===1?[e]:e;for(let c=0;ci/s),this.fromArray(t)}return this}toArray(e){if(js(e))return this.getChannelData(e);if(this.numberOfChannels===1)return this.toArray(0);{const t=[];for(let s=0;s0}get duration(){return this._buffer?this._buffer.duration:0}get length(){return this._buffer?this._buffer.length:0}get numberOfChannels(){return this._buffer?this._buffer.numberOfChannels:0}get reverse(){return this._reversed}set reverse(e){this._reversed!==e&&(this._reversed=e,this._reverse())}static fromArray(e){return new le().fromArray(e)}static fromUrl(e){return Fe(this,void 0,void 0,function*(){return yield new le().load(e)})}static load(e){return Fe(this,void 0,void 0,function*(){const t=e.match(/\[([^\]\[]+\|.+)\]$/);if(t){const c=t[1].split("|");let l=c[0];for(const u of c)if(le.supportsType(u)){l=u;break}e=e.replace(t[0],l)}const s=le.baseUrl===""||le.baseUrl.endsWith("/")?le.baseUrl:le.baseUrl+"/",i=document.createElement("a");i.href=s+e,i.pathname=(i.pathname+i.hash).split("/").map(encodeURIComponent).join("/");const r=yield fetch(i.href);if(!r.ok)throw new Error(`could not load url: ${e}`);const o=yield r.arrayBuffer();return yield Ut().decodeAudioData(o)})}static supportsType(e){const t=e.split("."),s=t[t.length-1];return document.createElement("audio").canPlayType("audio/"+s)!==""}static loaded(){return Fe(this,void 0,void 0,function*(){for(yield Promise.resolve();le.downloads.length;)yield le.downloads[0]})}}le.baseUrl="";le.downloads=[];class Ho extends Cr{constructor(){super({clockSource:"offline",context:Yr(arguments[0])?arguments[0]:aT(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:Yr(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=Yr(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(e){return Fe(this,void 0,void 0,function*(){let t=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,t++;const s=Math.floor(this.sampleRate/128);e&&t%s===0&&(yield new Promise(i=>setTimeout(i,1)))}})}render(e=!0){return Fe(this,void 0,void 0,function*(){yield this.workletsAreReady(),yield this._renderClock(e);const t=yield this._context.startRendering();return new le(t)})}close(){return Promise.resolve()}}const Dd=new vT;let an=Dd;function Ut(){return an===Dd&&cT&&yT(new Cr),an}function yT(n,e=!1){e&&an.dispose(),Un(n)?an=new Cr(n):Yr(n)?an=new Ho(n):an=n}function xT(){return an.resume()}if(pn&&!pn.TONE_SILENCE_LOGGING){const e=` * Tone.js v${Rh} * `;console.log(`%c${e}`,"background: #000; color: #fff")}function TT(n){return Math.pow(10,n/20)}function kT(n){return 20*(Math.log(n)/Math.LN10)}function Rd(n){return Math.pow(2,n/12)}let qo=440;function wT(){return qo}function ST(n){qo=n}function Za(n){return Math.round(Pd(n))}function Pd(n){return 69+12*Math.log2(n/qo)}function CT(n){return qo*Math.pow(2,(n-69)/12)}class qc extends Ss{constructor(e,t,s){super(),this.defaultUnits="s",this._val=t,this._units=s,this.context=e,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:e=>this._frequencyToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:e=>this._ticksToUnits(parseInt(e,10)),regexp:/^(\d+)i$/i},m:{method:e=>this._beatsToUnits(parseInt(e,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(e,t)=>{const s=parseInt(e,10),i=t==="."?1.5:1;return s===1?this._beatsToUnits(this._getTimeSignature())*i:this._beatsToUnits(4/s)*i},regexp:/^(\d+)n(\.?)$/i},number:{method:e=>this._expressions[this.defaultUnits].method.call(this,e),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:e=>this._secondsToUnits(parseFloat(e)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:e=>parseInt(e,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:e=>{const t=parseInt(e,10);return this._beatsToUnits(8/(Math.floor(t)*3))},regexp:/^(\d+)t$/i},tr:{method:(e,t,s)=>{let i=0;return e&&e!=="0"&&(i+=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&t!=="0"&&(i+=this._beatsToUnits(parseFloat(t))),s&&s!=="0"&&(i+=this._beatsToUnits(parseFloat(s)/4)),i},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof qc&&this.fromType(this._val),xt(this._val))return this._noArg();if(ys(this._val)&&xt(this._units)){for(const e in this._expressions)if(this._expressions[e].regexp.test(this._val.trim())){this._units=e;break}}else if(fn(this._val)){let e=0;for(const t in this._val)if(te(this._val[t])){const s=this._val[t],i=new this.constructor(this.context,t).valueOf()*s;e+=i}return e}if(te(this._units)){const e=this._expressions[this._units],t=this._val.toString().trim().match(e.regexp);return t?e.method.apply(this,t.slice(1)):e.method.call(this,this._val)}else return ys(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(e){return 1/e}_beatsToUnits(e){return 60/this._getBpm()*e}_secondsToUnits(e){return e}_ticksToUnits(e){return e*this._beatsToUnits(1)/this._getPPQ()}_noArg(){return this._now()}_getBpm(){return this.context.transport.bpm.value}_getTimeSignature(){return this.context.transport.timeSignature}_getPPQ(){return this.context.transport.PPQ}fromType(e){switch(this._units=void 0,this.defaultUnits){case"s":this._val=e.toSeconds();break;case"i":this._val=e.toTicks();break;case"hz":this._val=e.toFrequency();break;case"midi":this._val=e.toMidi();break}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return this.toSeconds()*1e3}}class Lt extends qc{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:e=>this._now()+new this.constructor(this.context,e).valueOf(),regexp:/^\+(.+)/},quantize:{method:e=>{const t=new Lt(this.context,e).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(t))},regexp:/^@(.+)/}})}quantize(e,t=1){const s=new this.constructor(this.context,e).valueOf(),i=this.valueOf(),a=Math.round(i/s)*s-i;return i+a*t}toNotation(){const e=this.toSeconds(),t=["1m"];for(let r=1;r<9;r++){const o=Math.pow(2,r);t.push(o+"n."),t.push(o+"n"),t.push(o+"t")}t.push("0");let s=t[0],i=new Lt(this.context,t[0]).toSeconds();return t.forEach(r=>{const o=new Lt(this.context,r).toSeconds();Math.abs(o-e)3&&(i=parseFloat(parseFloat(r).toFixed(3))),[s,t,i].join(":")}toTicks(){const e=this._beatsToUnits(1);return this.valueOf()/e*this._getPPQ()}toSeconds(){return this.valueOf()}toMidi(){return Za(this.toFrequency())}_now(){return this.context.now()}}class Mt extends Lt{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return wT()}static set A4(e){ST(e)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(e){return this.defaultUnits==="midi"?e:Mt.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|##|x|bb|###|#x|x#|bbb)?)(-?[0-9]+)/i,method(e,t){const i=bT[e.toLowerCase()]+(parseInt(t,10)+1)*12;return this.defaultUnits==="midi"?i:Mt.mtof(i)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(e,t,s){let i=1;return e&&e!=="0"&&(i*=this._beatsToUnits(this._getTimeSignature()*parseFloat(e))),t&&t!=="0"&&(i*=this._beatsToUnits(parseFloat(t))),s&&s!=="0"&&(i*=this._beatsToUnits(parseFloat(s)/4)),i}}})}transpose(e){return new Mt(this.context,this.valueOf()*Rd(e))}harmonize(e){return e.map(t=>this.transpose(t))}toMidi(){return Za(this.valueOf())}toNote(){const e=this.toFrequency(),t=Math.log2(e/Mt.A4);let s=Math.round(12*t)+57;const i=Math.floor(s/12);return i<0&&(s+=-12*i),ET[s%12]+i.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const e=this._beatsToUnits(1),t=this.valueOf()/e;return Math.floor(t*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(e){return e}_ticksToUnits(e){return 1/(e*60/(this._getBpm()*this._getPPQ()))}_beatsToUnits(e){return 1/super._beatsToUnits(e)}_secondsToUnits(e){return 1/e}static mtof(e){return CT(e)}static ftom(e){return Za(e)}}const bT={cbbb:-3,cbb:-2,cb:-1,c:0,"c#":1,cx:2,"c##":2,"c###":3,"cx#":3,"c#x":3,dbbb:-1,dbb:0,db:1,d:2,"d#":3,dx:4,"d##":4,"d###":5,"dx#":5,"d#x":5,ebbb:1,ebb:2,eb:3,e:4,"e#":5,ex:6,"e##":6,"e###":7,"ex#":7,"e#x":7,fbbb:2,fbb:3,fb:4,f:5,"f#":6,fx:7,"f##":7,"f###":8,"fx#":8,"f#x":8,gbbb:4,gbb:5,gb:6,g:7,"g#":8,gx:9,"g##":9,"g###":10,"gx#":10,"g#x":10,abbb:6,abb:7,ab:8,a:9,"a#":10,ax:11,"a##":11,"a###":12,"ax#":12,"a#x":12,bbbb:8,bbb:9,bb:10,b:11,"b#":12,bx:13,"b##":13,"b###":14,"bx#":14,"b#x":14},ET=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];class Li extends Lt{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}class dt extends Ss{constructor(){super();const e=I(dt.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=e.context}static getDefaults(){return{context:Ut()}}now(){return this.context.currentTime+this.context.lookAhead}immediate(){return this.context.currentTime}get sampleTime(){return 1/this.context.sampleRate}get blockTime(){return 128/this.context.sampleRate}toSeconds(e){return iT(e),new Lt(this.context,e).toSeconds()}toFrequency(e){return new Mt(this.context,e).toFrequency()}toTicks(e){return new Li(this.context,e).toTicks()}_getPartialProperties(e){const t=this.get();return Object.keys(t).forEach(s=>{xt(e[s])&&delete t[s]}),t}get(){const e=pT(this);return Object.keys(e).forEach(t=>{if(Reflect.has(this,t)){const s=this[t];te(s)&&te(s.value)&&te(s.setValueAtTime)?e[t]=s.value:s instanceof dt?e[t]=s._getPartialProperties(e[t]):zt(s)||js(s)||ys(s)||nT(s)?e[t]=s:delete e[t]}}),e}set(e){return Object.keys(e).forEach(t=>{Reflect.has(this,t)&&te(this[t])&&(this[t]&&te(this[t].value)&&te(this[t].setValueAtTime)?this[t].value!==e[t]&&(this[t].value=e[t]):this[t]instanceof dt?this[t].set(e[t]):this[t]=e[t])}),this}}class Wc extends Dt{constructor(e="stopped"){super(),this.name="StateTimeline",this._initial=e,this.setStateAtTime(this._initial,0)}getValueAtTime(e){const t=this.get(e);return t!==null?t.state:this._initial}setStateAtTime(e,t,s){return Vt(t,0),this.add(Object.assign({},s,{state:e,time:t})),this}getLastState(e,t){const s=this._search(t);for(let i=s;i>=0;i--){const r=this._timeline[i];if(r.state===e)return r}}getNextState(e,t){const s=this._search(t);if(s!==-1)for(let i=s;i0,"timeConstant must be a number greater than 0");const r=this.toSeconds(t);return this._assertRange(i),Q(isFinite(i)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(e)}, ${JSON.stringify(t)}`),this._events.add({constant:s,time:r,type:"setTargetAtTime",value:i}),this.log(this.units,"setTargetAtTime",e,r,s),this._param.setTargetAtTime(i,r,s),this}setValueCurveAtTime(e,t,s,i=1){s=this.toSeconds(s),t=this.toSeconds(t);const r=this._fromType(e[0])*i;this.setValueAtTime(this._toType(r),t);const o=s/(e.length-1);for(let a=1;a{i.type==="cancelScheduledValues"?e.cancelScheduledValues(i.time):i.type==="setTargetAtTime"?e.setTargetAtTime(i.value,i.time,i.constant):e[i.type](i.value,i.time)}),this}setParam(e){Q(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const t=this.input;return t.disconnect(this._param),this.apply(e),this._param=e,t.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(e,t,s,i,r){return s+(t-s)*Math.exp(-(r-e)/i)}_linearInterpolate(e,t,s,i,r){return t+(i-t)*((r-e)/(s-e))}_exponentialInterpolate(e,t,s,i,r){return t*Math.pow(i/t,(r-e)/(s-e))}}class W extends dt{constructor(){super(...arguments),this._internalChannels=[]}get numberOfInputs(){return te(this.input)?vn(this.input)||this.input instanceof ue?1:this.input.numberOfInputs:0}get numberOfOutputs(){return te(this.output)?this.output.numberOfOutputs:0}_isAudioNode(e){return te(e)&&(e instanceof W||zs(e))}_getInternalNodes(){const e=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&e.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&e.push(this.output),e}_setChannelProperties(e){this._getInternalNodes().forEach(s=>{s.channelCount=e.channelCount,s.channelCountMode=e.channelCountMode,s.channelInterpretation=e.channelInterpretation})}_getChannelProperties(){const e=this._getInternalNodes();Q(e.length>0,"ToneAudioNode does not have any internal nodes");const t=e[0];return{channelCount:t.channelCount,channelCountMode:t.channelCountMode,channelInterpretation:t.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCount:e}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelCountMode:e}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(e){const t=this._getChannelProperties();this._setChannelProperties(Object.assign(t,{channelInterpretation:e}))}connect(e,t=0,s=0){return Hs(this,e,t,s),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return Vc("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(e,t=0,s=0){return OT(this,e,t,s),this}chain(...e){return $i(this,...e),this}fan(...e){return e.forEach(t=>this.connect(t)),this}dispose(){return super.dispose(),te(this.input)&&(this.input instanceof W?this.input.dispose():zs(this.input)&&this.input.disconnect()),te(this.output)&&(this.output instanceof W?this.output.dispose():zs(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function $i(...n){const e=n.shift();n.reduce((t,s)=>(t instanceof W?t.connect(s):zs(t)&&Hs(t,s),s),e)}function Hs(n,e,t=0,s=0){for(Q(te(n),"Cannot connect from undefined node"),Q(te(e),"Cannot connect to undefined node"),(e instanceof W||zs(e))&&Q(e.numberOfInputs>0,"Cannot connect to node with no inputs"),Q(n.numberOfOutputs>0,"Cannot connect from node with no outputs");e instanceof W||e instanceof ue;)te(e.input)&&(e=e.input);for(;n instanceof W;)te(n.output)&&(n=n.output);vn(e)?n.connect(e,t):n.connect(e,t,s)}function OT(n,e,t=0,s=0){if(te(e))for(;e instanceof W;)e=e.input;for(;!zs(n);)te(n.output)&&(n=n.output);vn(e)?n.disconnect(e,t):zs(e)?n.disconnect(e,t,s):n.disconnect()}class pe extends W{constructor(){super(I(pe.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const e=I(pe.getDefaults(),arguments,["gain","units"]);this.gain=new ue({context:this.context,convert:e.convert,param:this._gainNode.gain,units:e.units,value:e.gain,minValue:e.minValue,maxValue:e.maxValue}),xe(this,"gain")}static getDefaults(){return Object.assign(W.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class ii extends W{constructor(e){super(e),this.onended=ce,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new pe({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(t){const s=this.toSeconds(t);return this._startTime!==-1&&s>=this._startTime&&(this._stopTime===-1||s<=this._stopTime)?"started":"stopped"},this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut,this._curve=e.curve,this.onended=e.onended}static getDefaults(){return Object.assign(W.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:ce})}_startGain(e,t=1){Q(this._startTime===-1,"Source cannot be started more than once");const s=this.toSeconds(this._fadeIn);return this._startTime=e+s,this._startTime=Math.max(this._startTime,this.context.currentTime),s>0?(this._gainNode.gain.setValueAtTime(0,e),this._curve==="linear"?this._gainNode.gain.linearRampToValueAtTime(t,e+s):this._gainNode.gain.exponentialApproachValueAtTime(t,e,s)):this._gainNode.gain.setValueAtTime(t,e),this}stop(e){return this.log("stop",e),this._stopGain(this.toSeconds(e)),this}_stopGain(e){Q(this._startTime!==-1,"'start' must be called before 'stop'"),this.cancelStop();const t=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(e)+t,this._stopTime=Math.max(this._stopTime,this.now()),t>0?this._curve==="linear"?this._gainNode.gain.linearRampTo(0,t,e):this._gainNode.gain.targetRampTo(0,t,e):(this._gainNode.gain.cancelAndHoldAtTime(e),this._gainNode.gain.setValueAtTime(0,e)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(()=>{const s=this._curve==="exponential"?t*2:0;this._stopSource(this.now()+s),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==ce&&(this.onended(this),this.onended=ce,!this.context.isOffline)){const e=()=>this.dispose();typeof window.requestIdleCallback<"u"?window.requestIdleCallback(e):setTimeout(e,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),Q(this._startTime!==-1,"Source is not started"),this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this.context.clearTimeout(this._timeout),this._stopTime=-1,this}dispose(){return super.dispose(),this._gainNode.dispose(),this.onended=ce,this}}class po extends ii{constructor(){super(I(po.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const e=I(po.getDefaults(),arguments,["offset"]);Hs(this._source,this._gainNode),this.offset=new ue({context:this.context,convert:e.convert,param:this._source.offset,units:e.units,value:e.offset,minValue:e.minValue,maxValue:e.maxValue})}static getDefaults(){return Object.assign(ii.getDefaults(),{convert:!0,offset:1,units:"number"})}start(e){const t=this.toSeconds(e);return this.log("start",t),this._startGain(t),this._source.start(t),this}_stopSource(e){this._source.stop(e)}dispose(){return super.dispose(),this.state==="started"&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class ve extends W{constructor(){super(I(ve.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const e=I(ve.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new po({context:this.context,convert:e.convert,offset:e.value,units:e.units,minValue:e.minValue,maxValue:e.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(W.getDefaults(),{convert:!0,units:"number",value:0})}connect(e,t=0,s=0){return Gc(this,e,t,s),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(e,t){return this._param.setValueAtTime(e,t),this}getValueAtTime(e){return this._param.getValueAtTime(e)}setRampPoint(e){return this._param.setRampPoint(e),this}linearRampToValueAtTime(e,t){return this._param.linearRampToValueAtTime(e,t),this}exponentialRampToValueAtTime(e,t){return this._param.exponentialRampToValueAtTime(e,t),this}exponentialRampTo(e,t,s){return this._param.exponentialRampTo(e,t,s),this}linearRampTo(e,t,s){return this._param.linearRampTo(e,t,s),this}targetRampTo(e,t,s){return this._param.targetRampTo(e,t,s),this}exponentialApproachValueAtTime(e,t,s){return this._param.exponentialApproachValueAtTime(e,t,s),this}setTargetAtTime(e,t,s){return this._param.setTargetAtTime(e,t,s),this}setValueCurveAtTime(e,t,s,i){return this._param.setValueCurveAtTime(e,t,s,i),this}cancelScheduledValues(e){return this._param.cancelScheduledValues(e),this}cancelAndHoldAtTime(e){return this._param.cancelAndHoldAtTime(e),this}rampTo(e,t,s){return this._param.rampTo(e,t,s),this}get value(){return this._param.value}set value(e){this._param.value=e}get convert(){return this._param.convert}set convert(e){this._param.convert=e}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(e){this._param.overridden=e}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(e){return this._param.apply(e),this}}function Gc(n,e,t,s){(e instanceof ue||vn(e)||e instanceof ve&&e.override)&&(e.cancelScheduledValues(0),e.setValueAtTime(0,0),e instanceof ve&&(e.overridden=!0)),Hs(n,e,t,s)}class mo extends ue{constructor(){super(I(mo.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Dt(1/0),this._multiplier=1;const e=I(mo.getDefaults(),arguments,["value"]);this._multiplier=e.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(e.value)}),this.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(ue.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(e,t,s){t=this.toSeconds(t),this.setRampPoint(t);const i=this._fromType(e),r=this._events.get(t),o=Math.round(Math.max(1/s,1));for(let a=0;a<=o;a++){const c=s*a+t,l=this._exponentialApproach(r.time,r.value,i,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}setValueAtTime(e,t){const s=this.toSeconds(t);super.setValueAtTime(e,t);const i=this._events.get(s),r=this._events.previousEvent(i),o=this._getTicksUntilEvent(r,s);return i.ticks=Math.max(o,0),this}linearRampToValueAtTime(e,t){const s=this.toSeconds(t);super.linearRampToValueAtTime(e,t);const i=this._events.get(s),r=this._events.previousEvent(i),o=this._getTicksUntilEvent(r,s);return i.ticks=Math.max(o,0),this}exponentialRampToValueAtTime(e,t){t=this.toSeconds(t);const s=this._fromType(e),i=this._events.get(t),r=Math.round(Math.max((t-i.time)*10,1)),o=(t-i.time)/r;for(let a=0;a<=r;a++){const c=o*a+i.time,l=this._exponentialInterpolate(i.time,i.value,t,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}_getTicksUntilEvent(e,t){if(e===null)e={ticks:0,time:0,type:"setValueAtTime",value:0};else if(xt(e.ticks)){const o=this._events.previousEvent(e);e.ticks=this._getTicksUntilEvent(o,e.time)}const s=this._fromType(this.getValueAtTime(e.time));let i=this._fromType(this.getValueAtTime(t));const r=this._events.get(t);return r&&r.time===t&&r.type==="setValueAtTime"&&(i=this._fromType(this.getValueAtTime(t-this.sampleTime))),.5*(t-e.time)*(s+i)+e.ticks}getTicksAtTime(e){const t=this.toSeconds(e),s=this._events.get(t);return Math.max(this._getTicksUntilEvent(s,t),0)}getDurationOfTicks(e,t){const s=this.toSeconds(t),i=this.getTicksAtTime(t);return this.getTimeOfTick(i+e)-s}getTimeOfTick(e){const t=this._events.get(e,"ticks"),s=this._events.getAfter(e,"ticks");if(t&&t.ticks===e)return t.time;if(t&&s&&s.type==="linearRampToValueAtTime"&&t.value!==s.value){const i=this._fromType(this.getValueAtTime(t.time)),o=(this._fromType(this.getValueAtTime(s.time))-i)/(s.time-t.time),a=Math.sqrt(Math.pow(i,2)-2*o*(t.ticks-e)),c=(-i+a)/o,l=(-i-a)/o;return(c>0?c:l)+t.time}else return t?t.value===0?1/0:t.time+(e-t.ticks)/t.value:e/this._initialValue}ticksToTime(e,t){return this.getDurationOfTicks(e,t)}timeToTicks(e,t){const s=this.toSeconds(t),i=this.toSeconds(e),r=this.getTicksAtTime(s);return this.getTicksAtTime(s+i)-r}_fromType(e){return this.units==="bpm"&&this.multiplier?1/(60/e/this.multiplier):super._fromType(e)}_toType(e){return this.units==="bpm"&&this.multiplier?e/this.multiplier*60:super._toType(e)}get multiplier(){return this._multiplier}set multiplier(e){const t=this.value;this._multiplier=e,this.cancelScheduledValues(0),this.setValueAtTime(t,0)}}class _o extends ve{constructor(){super(I(_o.getDefaults(),arguments,["value"])),this.name="TickSignal";const e=I(_o.getDefaults(),arguments,["value"]);this.input=this._param=new mo({context:this.context,convert:e.convert,multiplier:e.multiplier,param:this._constantSource.offset,units:e.units,value:e.value})}static getDefaults(){return Object.assign(ve.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(e,t){return this._param.ticksToTime(e,t)}timeToTicks(e,t){return this._param.timeToTicks(e,t)}getTimeOfTick(e){return this._param.getTimeOfTick(e)}getDurationOfTicks(e,t){return this._param.getDurationOfTicks(e,t)}getTicksAtTime(e){return this._param.getTicksAtTime(e)}get multiplier(){return this._param.multiplier}set multiplier(e){this._param.multiplier=e}dispose(){return super.dispose(),this._param.dispose(),this}}class go extends dt{constructor(){super(I(go.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new Wc,this._tickOffset=new Dt,this._ticksAtTime=new Dt,this._secondsAtTime=new Dt;const e=I(go.getDefaults(),arguments,["frequency"]);this.frequency=new _o({context:this.context,units:e.units,value:e.frequency}),xe(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},dt.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(e,t){const s=this.toSeconds(e);return this._state.getValueAtTime(s)!=="started"&&(this._state.setStateAtTime("started",s),te(t)&&this.setTicksAtTime(t,s),this._ticksAtTime.cancel(s),this._secondsAtTime.cancel(s)),this}stop(e){const t=this.toSeconds(e);if(this._state.getValueAtTime(t)==="stopped"){const s=this._state.get(t);s&&s.time>0&&(this._tickOffset.cancel(s.time),this._state.cancel(s.time))}return this._state.cancel(t),this._state.setStateAtTime("stopped",t),this.setTicksAtTime(0,t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}pause(e){const t=this.toSeconds(e);return this._state.getValueAtTime(t)==="started"&&(this._state.setStateAtTime("paused",t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t)),this}cancel(e){return e=this.toSeconds(e),this._state.cancel(e),this._tickOffset.cancel(e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}getTicksAtTime(e){const t=this.toSeconds(e),s=this._state.getLastState("stopped",t),i=this._ticksAtTime.get(t),r={state:"paused",time:t};this._state.add(r);let o=i||s,a=i?i.ticks:0,c=null;return this._state.forEachBetween(o.time,t+this.sampleTime,l=>{let u=o.time;const h=this._tickOffset.get(l.time);h&&h.time>=o.time&&(a=h.ticks,u=h.time),o.state==="started"&&l.state!=="started"&&(a+=this.frequency.getTicksAtTime(l.time)-this.frequency.getTicksAtTime(u),l.time!=r.time&&(c={state:l.state,time:l.time,ticks:a})),o=l}),this._state.remove(r),c&&this._ticksAtTime.add(c),a}get ticks(){return this.getTicksAtTime(this.now())}set ticks(e){this.setTicksAtTime(e,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(e){const t=this.now(),s=this.frequency.timeToTicks(e,t);this.setTicksAtTime(s,t)}getSecondsAtTime(e){e=this.toSeconds(e);const t=this._state.getLastState("stopped",e),s={state:"paused",time:e};this._state.add(s);const i=this._secondsAtTime.get(e);let r=i||t,o=i?i.seconds:0,a=null;return this._state.forEachBetween(r.time,e+this.sampleTime,c=>{let l=r.time;const u=this._tickOffset.get(c.time);u&&u.time>=r.time&&(o=u.seconds,l=u.time),r.state==="started"&&c.state!=="started"&&(o+=c.time-l,c.time!=s.time&&(a={state:c.state,time:c.time,seconds:o})),r=c}),this._state.remove(s),a&&this._secondsAtTime.add(a),o}setTicksAtTime(e,t){return t=this.toSeconds(t),this._tickOffset.cancel(t),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(e,t),ticks:e,time:t}),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}getStateAtTime(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)}getTimeOfTick(e,t=this.now()){const s=this._tickOffset.get(t),i=this._state.get(t),r=Math.max(s.time,i.time),o=this.frequency.getTicksAtTime(r)+e-s.ticks;return this.frequency.getTimeOfTick(o)}forEachTickBetween(e,t,s){let i=this._state.get(e);this._state.forEachBetween(e,t,o=>{i&&i.state==="started"&&o.state!=="started"&&this.forEachTickBetween(Math.max(i.time,e),o.time-this.sampleTime,s),i=o});let r=null;if(i&&i.state==="started"){const o=Math.max(i.time,e),a=this.frequency.getTicksAtTime(o),c=this.frequency.getTicksAtTime(i.time),l=a-c;let u=Math.ceil(l)-l;u=Ft(u,1)?0:u;let h=this.frequency.getTimeOfTick(a+u);for(;h{switch(s.state){case"started":const i=this._tickSource.getTicksAtTime(s.time);this.emit("start",s.time,i);break;case"stopped":s.time!==0&&this.emit("stop",s.time);break;case"paused":this.emit("pause",s.time);break}}),this._tickSource.forEachTickBetween(e,t,(s,i)=>{this.callback(s,i)}))}getStateAtTime(e){const t=this.toSeconds(e);return this._state.getValueAtTime(t)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}Sr.mixin(Qi);class Yc extends Ss{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const e=I(Yc.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=e.baseUrl,Object.keys(e.urls).forEach(t=>{this._loadingCount++;const s=e.urls[t];this.add(t,s,this._bufferLoaded.bind(this,e.onload),e.onerror)})}static getDefaults(){return{baseUrl:"",onerror:ce,onload:ce,urls:{}}}has(e){return this._buffers.has(e.toString())}get(e){return Q(this.has(e),`ToneAudioBuffers has no buffer named: ${e}`),this._buffers.get(e.toString())}_bufferLoaded(e){this._loadingCount--,this._loadingCount===0&&e&&e()}get loaded(){return Array.from(this._buffers).every(([e,t])=>t.loaded)}add(e,t,s=ce,i=ce){return ys(t)?(this.baseUrl&&t.trim().substring(0,11).toLowerCase()==="data:audio/"&&(this.baseUrl=""),this._buffers.set(e.toString(),new le(this.baseUrl+t,s,i))):this._buffers.set(e.toString(),new le(t,s,i)),this}dispose(){return super.dispose(),this._buffers.forEach(e=>e.dispose()),this._buffers.clear(),this}}class jn extends Li{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(e){return this._getPPQ()*e}_secondsToUnits(e){return Math.floor(e/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(e){return e}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}class AT extends dt{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Dt,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(e,t){return this._events.add({callback:e,time:this.toSeconds(t)}),this._events.length===1&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(e){return this._events.cancel(this.toSeconds(e)),this}_drawLoop(){const e=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=e;){const t=this._events.shift();t&&e-t.time<=this.expiration&&t.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}Vo(n=>{n.draw=new AT({context:n})});jo(n=>{n.draw.dispose()});class MT extends Ss{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(e){Q(te(e.time),"Events must have a time property"),Q(te(e.duration),"Events must have a duration parameter"),e.time=e.time.valueOf();let t=new DT(e.time,e.time+e.duration,e);for(this._root===null?this._root=t:this._root.insert(t),this._length++;t!==null;)t.updateHeight(),t.updateMax(),this._rebalance(t),t=t.parent;return this}remove(e){if(this._root!==null){const t=[];this._root.search(e.time,t);for(const s of t)if(s.event===e){this._removeNode(s),this._length--;break}}return this}get length(){return this._length}cancel(e){return this.forEachFrom(e,t=>this.remove(t)),this}_setRoot(e){this._root=e,this._root!==null&&(this._root.parent=null)}_replaceNodeInParent(e,t){e.parent!==null?(e.isLeftChild()?e.parent.left=t:e.parent.right=t,this._rebalance(e.parent)):this._setRoot(t)}_removeNode(e){if(e.left===null&&e.right===null)this._replaceNodeInParent(e,null);else if(e.right===null)this._replaceNodeInParent(e,e.left);else if(e.left===null)this._replaceNodeInParent(e,e.right);else{const t=e.getBalance();let s,i=null;if(t>0)if(e.left.right===null)s=e.left,s.right=e.right,i=s;else{for(s=e.left.right;s.right!==null;)s=s.right;s.parent&&(s.parent.right=s.left,i=s.parent,s.left=e.left,s.right=e.right)}else if(e.right.left===null)s=e.right,s.left=e.left,i=s;else{for(s=e.right.left;s.left!==null;)s=s.left;s.parent&&(s.parent.left=s.right,i=s.parent,s.left=e.left,s.right=e.right)}e.parent!==null?e.isLeftChild()?e.parent.left=s:e.parent.right=s:this._setRoot(s),i&&this._rebalance(i)}e.dispose()}_rotateLeft(e){const t=e.parent,s=e.isLeftChild(),i=e.right;i&&(e.right=i.left,i.left=e),t!==null?s?t.left=i:t.right=i:this._setRoot(i)}_rotateRight(e){const t=e.parent,s=e.isLeftChild(),i=e.left;i&&(e.left=i.right,i.right=e),t!==null?s?t.left=i:t.right=i:this._setRoot(i)}_rebalance(e){const t=e.getBalance();t>1&&e.left?e.left.getBalance()<0?this._rotateLeft(e.left):this._rotateRight(e):t<-1&&e.right&&(e.right.getBalance()>0?this._rotateRight(e.right):this._rotateLeft(e))}get(e){if(this._root!==null){const t=[];if(this._root.search(e,t),t.length>0){let s=t[0];for(let i=1;is.low&&(s=t[i]);return s.event}}return null}forEach(e){if(this._root!==null){const t=[];this._root.traverse(s=>t.push(s)),t.forEach(s=>{s.event&&e(s.event)})}return this}forEachAtTime(e,t){if(this._root!==null){const s=[];this._root.search(e,s),s.forEach(i=>{i.event&&t(i.event)})}return this}forEachFrom(e,t){if(this._root!==null){const s=[];this._root.searchAfter(e,s),s.forEach(i=>{i.event&&t(i.event)})}return this}dispose(){return super.dispose(),this._root!==null&&this._root.traverse(e=>e.dispose()),this._root=null,this}}class DT{constructor(e,t,s){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=s,this.low=e,this.high=t,this.max=this.high}insert(e){e.low<=this.low?this.left===null?this.left=e:this.left.insert(e):this.right===null?this.right=e:this.right.insert(e)}search(e,t){e>this.max||(this.left!==null&&this.left.search(e,t),this.low<=e&&this.high>e&&t.push(this),!(this.low>e)&&this.right!==null&&this.right.search(e,t))}searchAfter(e,t){this.low>=e&&(t.push(this),this.left!==null&&this.left.searchAfter(e,t)),this.right!==null&&this.right.searchAfter(e,t)}traverse(e){e(this),this.left!==null&&this.left.traverse(e),this.right!==null&&this.right.traverse(e)}updateHeight(){this.left!==null&&this.right!==null?this.height=Math.max(this.left.height,this.right.height)+1:this.right!==null?this.height=this.right.height+1:this.left!==null?this.height=this.left.height+1:this.height=0}updateMax(){this.max=this.high,this.left!==null&&(this.max=Math.max(this.max,this.left.max)),this.right!==null&&(this.max=Math.max(this.max,this.right.max))}getBalance(){let e=0;return this.left!==null&&this.right!==null?e=this.left.height-this.right.height:this.left!==null?e=this.left.height+1:this.right!==null&&(e=-(this.right.height+1)),e}isLeftChild(){return this.parent!==null&&this.parent.left===this}get left(){return this._left}set left(e){this._left=e,e!==null&&(e.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(e){this._right=e,e!==null&&(e.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class qs extends W{constructor(){super(I(qs.getDefaults(),arguments,["volume"])),this.name="Volume";const e=I(qs.getDefaults(),arguments,["volume"]);this.input=this.output=new pe({context:this.context,gain:e.volume,units:"decibels"}),this.volume=this.output.gain,xe(this,"volume"),this._unmutedVolume=e.volume,this.mute=e.mute}static getDefaults(){return Object.assign(W.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(e){!this.mute&&e?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!e&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}let RT=class Xa extends W{constructor(){super(I(Xa.getDefaults(),arguments)),this.name="Destination",this.input=new qs({context:this.context}),this.output=new pe({context:this.context}),this.volume=this.input.volume;const e=I(Xa.getDefaults(),arguments);$i(this.input,this.output,this.context.rawContext.destination),this.mute=e.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(W.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(e){this.input.mute=e}chain(...e){return this.input.disconnect(),e.unshift(this.input),e.push(this.output),$i(...e),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}};Vo(n=>{n.destination=new RT({context:n})});jo(n=>{n.destination.dispose()});class PT extends Ss{constructor(e){super(),this.name="TimelineValue",this._timeline=new Dt({memory:10}),this._initialValue=e}set(e,t){return this._timeline.add({value:e,time:t}),this}get(e){const t=this._timeline.get(e);return t?t.value:this._initialValue}}class xs extends W{constructor(){super(Object.assign(I(xs.getDefaults(),arguments,["context"])))}connect(e,t=0,s=0){return Gc(this,e,t,s),this}}class yn extends xs{constructor(){super(Object.assign(I(yn.getDefaults(),arguments,["mapping","length"]))),this.name="WaveShaper",this._shaper=this.context.createWaveShaper(),this.input=this._shaper,this.output=this._shaper;const e=I(yn.getDefaults(),arguments,["mapping","length"]);zt(e.mapping)||e.mapping instanceof Float32Array?this.curve=Float32Array.from(e.mapping):sT(e.mapping)&&this.setMap(e.mapping,e.length)}static getDefaults(){return Object.assign(ve.getDefaults(),{length:1024})}setMap(e,t=1024){const s=new Float32Array(t);for(let i=0,r=t;is.includes(e));Q(t,"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=e}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class Ki extends xs{constructor(){super(Object.assign(I(Ki.getDefaults(),arguments,["value"]))),this.name="Pow";const e=I(Ki.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new yn({context:this.context,mapping:this._expFunc(e.value),length:8192}),this._exponent=e.value}static getDefaults(){return Object.assign(xs.getDefaults(),{value:1})}_expFunc(e){return t=>Math.pow(Math.abs(t),e)}get value(){return this._exponent}set value(e){this._exponent=e,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class Ws{constructor(e,t){this.id=Ws._eventId++,this._remainderTime=0;const s=Object.assign(Ws.getDefaults(),t);this.transport=e,this.callback=s.callback,this._once=s.once,this.time=Math.floor(s.time),this._remainderTime=s.time-this.time}static getDefaults(){return{callback:ce,once:!1,time:0}}get floatTime(){return this.time+this._remainderTime}invoke(e){if(this.callback){const t=this.transport.bpm.getDurationOfTicks(1,e);this.callback(e+this._remainderTime*t),this._once&&this.transport.clear(this.id)}}dispose(){return this.callback=void 0,this}}Ws._eventId=0;class Zc extends Ws{constructor(e,t){super(e,t),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const s=Object.assign(Zc.getDefaults(),t);this.duration=s.duration,this._interval=s.interval,this._nextTick=s.time,this.transport.on("start",this._boundRestart),this.transport.on("loopStart",this._boundRestart),this.transport.on("ticks",this._boundRestart),this.context=this.transport.context,this._restart()}static getDefaults(){return Object.assign({},Ws.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(e){this._createEvents(e),super.invoke(e)}_createEvent(){return fo(this._nextTick,this.floatTime+this.duration)?this.transport.scheduleOnce(this.invoke.bind(this),new jn(this.context,this._nextTick).toSeconds()):-1}_createEvents(e){fo(this._nextTick+this._interval,this.floatTime+this.duration)&&(this._nextTick+=this._interval,this._currentId=this._nextId,this._nextId=this.transport.scheduleOnce(this.invoke.bind(this),new jn(this.context,this._nextTick).toSeconds()))}_restart(e){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.floatTime;const t=this.transport.getTicksAtTime(e);ni(t,this.time)&&(this._nextTick=this.floatTime+Math.ceil((t-this.floatTime)/this._interval)*this._interval),this._currentId=this._createEvent(),this._nextTick+=this._interval,this._nextId=this._createEvent()}dispose(){return super.dispose(),this.transport.clear(this._currentId),this.transport.clear(this._nextId),this.transport.off("start",this._boundRestart),this.transport.off("loopStart",this._boundRestart),this.transport.off("ticks",this._boundRestart),this}}class Ji extends dt{constructor(){super(I(Ji.getDefaults(),arguments)),this.name="Transport",this._loop=new PT(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Dt,this._repeatedEvents=new MT,this._syncedSignals=[],this._swingAmount=0;const e=I(Ji.getDefaults(),arguments);this._ppq=e.ppq,this._clock=new Qi({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=e.ppq,this.bpm.setValueAtTime(e.bpm,0),xe(this,"bpm"),this._timeSignature=e.timeSignature,this._swingTicks=e.ppq/2}static getDefaults(){return Object.assign(dt.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(e,t){if(this._loop.get(e)&&t>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),t=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._swingAmount>0&&t%this._ppq!==0&&t%(this._swingTicks*2)!==0){const s=t%(this._swingTicks*2)/(this._swingTicks*2),i=Math.sin(s*Math.PI)*this._swingAmount;e+=new jn(this.context,this._swingTicks*2/3).toSeconds()*i}nu(!0),this._timeline.forEachAtTime(t,s=>s.invoke(e)),nu(!1)}schedule(e,t){const s=new Ws(this,{callback:e,time:new Li(this.context,t).toTicks()});return this._addEvent(s,this._timeline)}scheduleRepeat(e,t,s,i=1/0){const r=new Zc(this,{callback:e,duration:new Lt(this.context,i).toTicks(),interval:new Lt(this.context,t).toTicks(),time:new Li(this.context,s).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(e,t){const s=new Ws(this,{callback:e,once:!0,time:new Li(this.context,t).toTicks()});return this._addEvent(s,this._timeline)}clear(e){if(this._scheduledEvents.hasOwnProperty(e)){const t=this._scheduledEvents[e.toString()];t.timeline.remove(t.event),t.event.dispose(),delete this._scheduledEvents[e.toString()]}return this}_addEvent(e,t){return this._scheduledEvents[e.id.toString()]={event:e,timeline:t},t.add(e),e.id}cancel(e=0){const t=this.toTicks(e);return this._timeline.forEachFrom(t,s=>this.clear(s.id)),this._repeatedEvents.forEachFrom(t,s=>this.clear(s.id)),this}_bindClockEvents(){this._clock.on("start",(e,t)=>{t=new jn(this.context,t).toSeconds(),this.emit("start",e,t)}),this._clock.on("stop",e=>{this.emit("stop",e)}),this._clock.on("pause",e=>{this.emit("pause",e)})}get state(){return this._clock.getStateAtTime(this.now())}start(e,t){this.context.resume();let s;return te(t)&&(s=this.toTicks(t)),this._clock.start(e,s),this}stop(e){return this._clock.stop(e),this}pause(e){return this._clock.pause(e),this}toggle(e){return e=this.toSeconds(e),this._clock.getStateAtTime(e)!=="started"?this.start(e):this.stop(e),this}get timeSignature(){return this._timeSignature}set timeSignature(e){zt(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}get loopStart(){return new Lt(this.context,this._loopStart,"i").toSeconds()}set loopStart(e){this._loopStart=this.toTicks(e)}get loopEnd(){return new Lt(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(e){this._loopEnd=this.toTicks(e)}get loop(){return this._loop.get(this.now())}set loop(e){this._loop.set(e,this.now())}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get swing(){return this._swingAmount}set swing(e){this._swingAmount=e}get swingSubdivision(){return new jn(this.context,this._swingTicks).toNotation()}set swingSubdivision(e){this._swingTicks=this.toTicks(e)}get position(){const e=this.now(),t=this._clock.getTicksAtTime(e);return new jn(this.context,t).toBarsBeatsSixteenths()}set position(e){const t=this.toTicks(e);this.ticks=t}get seconds(){return this._clock.seconds}set seconds(e){const t=this.now(),s=this._clock.frequency.timeToTicks(e,t);this.ticks=s}get progress(){if(this.loop){const e=this.now();return(this._clock.getTicksAtTime(e)-this._loopStart)/(this._loopEnd-this._loopStart)}else return 0}get ticks(){return this._clock.ticks}set ticks(e){if(this._clock.ticks!==e){const t=this.now();if(this.state==="started"){const s=this._clock.getTicksAtTime(t),i=this._clock.frequency.getDurationOfTicks(Math.ceil(s)-s,t),r=t+i;this.emit("stop",r),this._clock.setTicksAtTime(e,r),this.emit("start",r,this._clock.getSecondsAtTime(r))}else this.emit("ticks",t),this._clock.setTicksAtTime(e,t)}}getTicksAtTime(e){return this._clock.getTicksAtTime(e)}getSecondsAtTime(e){return this._clock.getSecondsAtTime(e)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(e){this._clock.frequency.multiplier=e}nextSubdivision(e){if(e=this.toTicks(e),this.state!=="started")return 0;{const t=this.now(),s=this.getTicksAtTime(t),i=e-s%e;return this._clock.nextTickTime(i,t)}}syncSignal(e,t){const s=this.now();let i=this.bpm,r=1/(60/i.getValueAtTime(s)/this.PPQ),o=[];if(e.units==="time"){const c=.015625/r,l=new pe(c),u=new Ki(-1),h=new pe(c);i.chain(l,u,h),i=h,r=1/r,o=[l,u,h]}t||(e.getValueAtTime(s)!==0?t=e.getValueAtTime(s)/r:t=0);const a=new pe(t);return i.connect(a),a.connect(e._param),o.push(a),this._syncedSignals.push({initial:e.value,nodes:o,signal:e}),e.value=0,this}unsyncSignal(e){for(let t=this._syncedSignals.length-1;t>=0;t--){const s=this._syncedSignals[t];s.signal===e&&(s.nodes.forEach(i=>i.dispose()),s.signal.value=s.initial,this._syncedSignals.splice(t,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),Hc(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}Sr.mixin(Ji);Vo(n=>{n.transport=new Ji({context:n})});jo(n=>{n.transport.dispose()});class Ke extends W{constructor(e){super(e),this.input=void 0,this._state=new Wc("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=ce,this._syncedStop=ce,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new qs({context:this.context,mute:e.mute,volume:e.volume}),this.volume=this._volume.volume,xe(this,"volume"),this.onstop=e.onstop}static getDefaults(){return Object.assign(W.getDefaults(),{mute:!1,onstop:ce,volume:0})}get state(){return this._synced?this.context.transport.state==="started"?this._state.getValueAtTime(this.context.transport.seconds):"stopped":this._state.getValueAtTime(this.now())}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}_clampToCurrentTime(e){return this._synced?e:Math.max(e,this.context.currentTime)}start(e,t,s){let i=xt(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(i=this._clampToCurrentTime(i),!this._synced&&this._state.getValueAtTime(i)==="started")Q(ni(i,this._state.get(i).time),"Start time must be strictly greater than previous start time"),this._state.cancel(i),this._state.setStateAtTime("started",i),this.log("restart",i),this.restart(i,t,s);else if(this.log("start",i),this._state.setStateAtTime("started",i),this._synced){const r=this._state.get(i);r&&(r.offset=this.toSeconds(Yn(t,0)),r.duration=s?this.toSeconds(s):void 0);const o=this.context.transport.schedule(a=>{this._start(a,t,s)},i);this._scheduled.push(o),this.context.transport.state==="started"&&this.context.transport.getSecondsAtTime(this.immediate())>i&&this._syncedStart(this.now(),this.context.transport.seconds)}else Cd(this.context),this._start(i,t,s);return this}stop(e){let t=xt(e)&&this._synced?this.context.transport.seconds:this.toSeconds(e);if(t=this._clampToCurrentTime(t),this._state.getValueAtTime(t)==="started"||te(this._state.getNextState("started",t))){if(this.log("stop",t),!this._synced)this._stop(t);else{const s=this.context.transport.schedule(this._stop.bind(this),t);this._scheduled.push(s)}this._state.cancel(t),this._state.setStateAtTime("stopped",t)}return this}restart(e,t,s){return e=this.toSeconds(e),this._state.getValueAtTime(e)==="started"&&(this._state.cancel(e),this._restart(e,t,s)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(e,t)=>{if(ni(t,0)){const s=this._state.get(t);if(s&&s.state==="started"&&s.time!==t){const i=t-this.toSeconds(s.time);let r;s.duration&&(r=this.toSeconds(s.duration)-i),this._start(e,this.toSeconds(s.offset)+i,r)}}},this._syncedStop=e=>{const t=this.context.transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));this._state.getValueAtTime(t)==="started"&&this._stop(e)},this.context.transport.on("start",this._syncedStart),this.context.transport.on("loopStart",this._syncedStart),this.context.transport.on("stop",this._syncedStop),this.context.transport.on("pause",this._syncedStop),this.context.transport.on("loopEnd",this._syncedStop)),this}unsync(){return this._synced&&(this.context.transport.off("stop",this._syncedStop),this.context.transport.off("pause",this._syncedStop),this.context.transport.off("loopEnd",this._syncedStop),this.context.transport.off("start",this._syncedStart),this.context.transport.off("loopStart",this._syncedStart)),this._synced=!1,this._scheduled.forEach(e=>this.context.transport.clear(e)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=ce,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class ri extends ii{constructor(){super(I(ri.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const e=I(ri.getDefaults(),arguments,["url","onload"]);Hs(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new ue({context:this.context,param:this._source.playbackRate,units:"positive",value:e.playbackRate}),this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this._buffer=new le(e.url,e.onload,e.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(ii.getDefaults(),{url:new le,loop:!1,loopEnd:0,loopStart:0,onload:ce,onerror:ce,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e}get curve(){return this._curve}set curve(e){this._curve=e}start(e,t,s,i=1){Q(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(e);this._startGain(r,i),this.loop?t=Yn(t,this.loopStart):t=Yn(t,0);let o=Math.max(this.toSeconds(t),0);if(this.loop){const a=this.toSeconds(this.loopEnd)||this.buffer.duration,c=this.toSeconds(this.loopStart),l=a-c;Ya(o,a)&&(o=(o-c)%l+c),Ft(o,this.buffer.duration)&&(o=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,fo(o,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,o)),te(s)){let a=this.toSeconds(s);a=Math.max(a,0),this.stop(r+a)}return this}_stopSource(e){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(e)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(e){this._source.loopStart=this.toSeconds(e)}get loopEnd(){return this._source.loopEnd}set loopEnd(e){this._source.loopEnd=this.toSeconds(e)}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._source.loop}set loop(e){this._source.loop=e,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class er extends Ke{constructor(){super(I(er.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const e=I(er.getDefaults(),arguments,["type"]);this._playbackRate=e.playbackRate,this.type=e.type,this._fadeIn=e.fadeIn,this._fadeOut=e.fadeOut}static getDefaults(){return Object.assign(Ke.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(e){if(Q(e in iu,"Noise: invalid type: "+e),this._type!==e&&(this._type=e,this.state==="started")){const t=this.now();this._stop(t),this._start(t)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e,this._source&&(this._source.playbackRate.value=e)}_start(e){const t=iu[this._type];this._source=new ri({url:t,context:this.context,fadeIn:this._fadeIn,fadeOut:this._fadeOut,loop:!0,onended:()=>this.onstop(this),playbackRate:this._playbackRate}).connect(this.output),this._source.start(this.toSeconds(e),Math.random()*(t.duration-.001))}_stop(e){this._source&&(this._source.stop(this.toSeconds(e)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(e){this._fadeIn=e,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(e){this._fadeOut=e,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(e){this._stop(e),this._start(e)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const Nn=44100*5,ya=2,as={brown:null,pink:null,white:null},iu={get brown(){if(!as.brown){const n=[];for(let e=0;ethis.onstop(this)});this._oscillator=s,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.start(t)}_stop(e){const t=this.toSeconds(e);this._oscillator&&this._oscillator.stop(t)}_restart(e){const t=this.toSeconds(e);return this.log("restart",t),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(t),this}syncFrequency(){return this.context.transport.syncSignal(this.frequency),this}unsyncFrequency(){return this.context.transport.unsyncSignal(this.frequency),this}_getCachedPeriodicWave(){if(this._type==="custom")return Ie._periodicWaveCache.find(t=>t.phase===this._phase&&fT(t.partials,this._partials));{const e=Ie._periodicWaveCache.find(t=>t.type===this._type&&t.phase===this._phase);return this._partialCount=e?e.partialCount:this._partialCount,e}}get type(){return this._type}set type(e){this._type=e;const t=["sine","square","sawtooth","triangle"].indexOf(e)!==-1;if(this._phase===0&&t)this._wave=void 0,this._partialCount=0,this._oscillator!==null&&(this._oscillator.type=e);else{const s=this._getCachedPeriodicWave();if(te(s)){const{partials:i,wave:r}=s;this._wave=r,this._partials=i,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave)}else{const[i,r]=this._getRealImaginary(e,this._phase),o=this.context.createPeriodicWave(i,r);this._wave=o,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave),Ie._periodicWaveCache.push({imag:r,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:i,type:this._type,wave:this._wave}),Ie._periodicWaveCache.length>100&&Ie._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(e){this.partialCount&&this._type!=="custom"&&e!=="custom"?this.type=e+this.partialCount:this.type=e}get partialCount(){return this._partialCount}set partialCount(e){Vt(e,0);let t=this._type;const s=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(s&&(t=s[1]),this._type!=="custom")e===0?this.type=t:this.type=t+e.toString();else{const i=new Float32Array(e);this._partials.forEach((r,o)=>i[o]=r),this._partials=Array.from(i),this.type=this._type}}_getRealImaginary(e,t){let i=2048;const r=new Float32Array(i),o=new Float32Array(i);let a=1;if(e==="custom"){if(a=this._partials.length+1,this._partialCount=this._partials.length,i=a,this._partials.length===0)return[r,o]}else{const c=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);c?(a=parseInt(c[2],10)+1,this._partialCount=parseInt(c[2],10),e=c[1],a=Math.max(a,2),i=a):this._partialCount=0,this._partials=[]}for(let c=1;c>1&1?-1:1):u=0,this._partials[c-1]=u;break;case"custom":u=this._partials[c-1];break;default:throw new TypeError("Oscillator: invalid type: "+e)}u!==0?(r[c]=-u*Math.sin(t*c),o[c]=u*Math.cos(t*c)):(r[c]=0,o[c]=0)}return[r,o]}_inverseFFT(e,t,s){let i=0;const r=e.length;for(let o=0;o(e+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Gs extends ve{constructor(){super(Object.assign(I(Gs.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const e=I(Gs.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new pe({context:this.context,minValue:e.minValue,maxValue:e.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(e.value,0)}static getDefaults(){return Object.assign(ve.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class tr extends Ke{constructor(){super(I(tr.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new IT({context:this.context}),this._modulationNode=new pe({context:this.context});const e=I(tr.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Ie({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new Ie({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new Gs({context:this.context,units:"positive",value:e.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),xe(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Ie.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){this._modulator.restart(e),this._carrier.restart(e)}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this._modulationScale.dispose(),this}}class sr extends Ke{constructor(){super(I(sr.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new pe({context:this.context,gain:0});const e=I(sr.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Ie({context:this.context,detune:e.detune,frequency:0,onstop:()=>this.onstop(this),phase:e.phase,type:e.type}),this.detune=this._carrier.detune,this.frequency=new ve({context:this.context,units:"frequency",value:e.frequency}),this._modulator=new Ie({context:this.context,phase:e.phase,type:e.modulationType}),this.harmonicity=new Gs({context:this.context,units:"positive",value:e.harmonicity}),this.modulationIndex=new Gs({context:this.context,units:"positive",value:e.modulationIndex}),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),xe(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Ie.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(e){this._modulator.start(e),this._carrier.start(e)}_stop(e){this._modulator.stop(e),this._carrier.stop(e)}_restart(e){return this._modulator.restart(e),this._carrier.restart(e),this}get type(){return this._carrier.type}set type(e){this._carrier.type=e}get baseType(){return this._carrier.baseType}set baseType(e){this._carrier.baseType=e}get partialCount(){return this._carrier.partialCount}set partialCount(e){this._carrier.partialCount=e}get modulationType(){return this._modulator.type}set modulationType(e){this._modulator.type=e}get phase(){return this._carrier.phase}set phase(e){this._carrier.phase=e,this._modulator.phase=e}get partials(){return this._carrier.partials}set partials(e){this._carrier.partials=e}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class oi extends Ke{constructor(){super(I(oi.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new pe({context:this.context,gain:0}),this._thresh=new yn({context:this.context,mapping:t=>t<=0?-1:1});const e=I(oi.getDefaults(),arguments,["frequency","width"]);this.width=new ve({context:this.context,units:"audioRange",value:e.width}),this._triangle=new Ie({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase,type:"triangle"}),this.frequency=this._triangle.frequency,this.detune=this._triangle.detune,this._triangle.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),xe(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(Ke.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(e){e=this.toSeconds(e),this._triangle.start(e),this._widthGate.gain.setValueAtTime(1,e)}_stop(e){e=this.toSeconds(e),this._triangle.stop(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(0,e)}_restart(e){this._triangle.restart(e),this._widthGate.gain.cancelScheduledValues(e),this._widthGate.gain.setValueAtTime(1,e)}get phase(){return this._triangle.phase}set phase(e){this._triangle.phase=e}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(e){this._triangle.type=e}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class nr extends Ke{constructor(){super(I(nr.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const e=I(nr.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new ve({context:this.context,units:"frequency",value:e.frequency}),this.detune=new ve({context:this.context,units:"cents",value:e.detune}),this._spread=e.spread,this._type=e.type,this._phase=e.phase,this._partials=e.partials,this._partialCount=e.partialCount,this.count=e.count,xe(this,["frequency","detune"])}static getDefaults(){return Object.assign(Ie.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(e){e=this.toSeconds(e),this._forEach(t=>t.start(e))}_stop(e){e=this.toSeconds(e),this._forEach(t=>t.stop(e))}_restart(e){this._forEach(t=>t.restart(e))}_forEach(e){for(let t=0;tt.type=e)}get spread(){return this._spread}set spread(e){if(this._spread=e,this._oscillators.length>1){const t=-e/2,s=e/(this._oscillators.length-1);this._forEach((i,r)=>i.detune.value=t+s*r)}}get count(){return this._oscillators.length}set count(e){if(Vt(e,1),this._oscillators.length!==e){this._forEach(t=>t.dispose()),this._oscillators=[];for(let t=0;tthis.onstop(this):ce});this.type==="custom"&&(s.partials=this._partials),this.frequency.connect(s.frequency),this.detune.connect(s.detune),s.detune.overridden=!1,s.connect(this.output),this._oscillators[t]=s}this.spread=this._spread,this.state==="started"&&this._forEach(t=>t.start())}}get phase(){return this._phase}set phase(e){this._phase=e,this._forEach((t,s)=>t.phase=this._phase+s/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(e){this._forEach(t=>t.baseType=e),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(e){this._partials=e,this._partialCount=this._partials.length,e.length&&(this._type="custom",this._forEach(t=>t.partials=e))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(e){this._partialCount=e,this._forEach(t=>t.partialCount=e),this._type=this._oscillators[0].type}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(e=>e.dispose()),this}}class ir extends Ke{constructor(){super(I(ir.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new Gs({context:this.context,value:2});const e=I(ir.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new oi({context:this.context,frequency:e.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new Ie({context:this.context,detune:e.detune,frequency:e.frequency,onstop:()=>this.onstop(this),phase:e.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),xe(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(Ke.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(e){e=this.toSeconds(e),this._modulator.start(e),this._pulse.start(e)}_stop(e){e=this.toSeconds(e),this._modulator.stop(e),this._pulse.stop(e)}_restart(e){this._modulator.restart(e),this._pulse.restart(e)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(e){this._modulator.phase=e}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const ru={am:tr,fat:nr,fm:sr,oscillator:Ie,pulse:oi,pwm:ir};class xn extends Ke{constructor(){super(I(xn.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const e=I(xn.getDefaults(),arguments,["frequency","type"]);this.frequency=new ve({context:this.context,units:"frequency",value:e.frequency}),this.detune=new ve({context:this.context,units:"cents",value:e.detune}),xe(this,["frequency","detune"]),this.set(e)}static getDefaults(){return Object.assign(Ie.getDefaults(),sr.getDefaults(),tr.getDefaults(),nr.getDefaults(),oi.getDefaults(),ir.getDefaults())}_start(e){this._oscillator.start(e)}_stop(e){this._oscillator.stop(e)}_restart(e){return this._oscillator.restart(e),this}get type(){let e="";return["am","fm","fat"].some(t=>this._sourceType===t)&&(e=this._sourceType),e+this._oscillator.type}set type(e){e.substr(0,2)==="fm"?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):e.substr(0,2)==="am"?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(2)):e.substr(0,3)==="fat"?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=e.substr(3)):e==="pwm"?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):e==="pulse"?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=e)}get partials(){return this._oscillator.partials}set partials(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partials=e)}get partialCount(){return this._oscillator.partialCount}set partialCount(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partialCount=e)}set(e){return Reflect.has(e,"type")&&e.type&&(this.type=e.type),super.set(e),this}_createNewOscillator(e){if(e!==this._sourceType){this._sourceType=e;const t=ru[e],s=this.now();if(this._oscillator){const i=this._oscillator;i.stop(s),this.context.setTimeout(()=>i.dispose(),this.blockTime)}this._oscillator=new t({context:this.context}),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this._oscillator.onstop=()=>this.onstop(this),this.state==="started"&&this._oscillator.start(s)}}get phase(){return this._oscillator.phase}set phase(e){this._oscillator.phase=e}get sourceType(){return this._sourceType}set sourceType(e){let t="sine";this._oscillator.type!=="pwm"&&this._oscillator.type!=="pulse"&&(t=this._oscillator.type),e==="fm"?this.type="fm"+t:e==="am"?this.type="am"+t:e==="fat"?this.type="fat"+t:e==="oscillator"?this.type=t:e==="pulse"?this.type="pulse":e==="pwm"&&(this.type="pwm")}_getOscType(e,t){return e instanceof ru[t]}get baseType(){return this._oscillator.baseType}set baseType(e){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&e!=="pulse"&&e!=="pwm"&&(this._oscillator.baseType=e)}get width(){if(this._getOscType(this._oscillator,"pulse"))return this._oscillator.width}get count(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.count}set count(e){this._getOscType(this._oscillator,"fat")&&js(e)&&(this._oscillator.count=e)}get spread(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.spread}set spread(e){this._getOscType(this._oscillator,"fat")&&js(e)&&(this._oscillator.spread=e)}get modulationType(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.modulationType}set modulationType(e){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&ys(e)&&(this._oscillator.modulationType=e)}get modulationIndex(){if(this._getOscType(this._oscillator,"fm"))return this._oscillator.modulationIndex}get harmonicity(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.harmonicity}get modulationFrequency(){if(this._getOscType(this._oscillator,"pwm"))return this._oscillator.modulationFrequency}asArray(e=1024){return Fe(this,void 0,void 0,function*(){return bn(this,e)})}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class Xc extends ve{constructor(){super(Object.assign(I(Xc.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new pe({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,$i(this._constantSource,this._sum)}static getDefaults(){return Object.assign(ve.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class yo extends xs{constructor(){super(Object.assign(I(yo.getDefaults(),arguments,["min","max"]))),this.name="Scale";const e=I(yo.getDefaults(),arguments,["min","max"]);this._mult=this.input=new Gs({context:this.context,value:e.max-e.min}),this._add=this.output=new Xc({context:this.context,value:e.min}),this._min=e.min,this._max=e.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(xs.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(e){this._min=e,this._setRange()}get max(){return this._max}set max(e){this._max=e,this._setRange()}_setRange(){this._add.value=this._min,this._mult.value=this._max-this._min}dispose(){return super.dispose(),this._add.dispose(),this._mult.dispose(),this}}function Id(n,e=1/0){const t=new WeakMap;return function(s,i){Reflect.defineProperty(s,i,{configurable:!0,enumerable:!0,get:function(){return t.get(this)},set:function(r){Vt(r,n,e),t.set(this,r)}})}}function Cs(n,e=1/0){const t=new WeakMap;return function(s,i){Reflect.defineProperty(s,i,{configurable:!0,enumerable:!0,get:function(){return t.get(this)},set:function(r){Vt(this.toSeconds(r),n,e),t.set(this,r)}})}}class rr extends Ke{constructor(){super(I(rr.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const e=I(rr.getDefaults(),arguments,["url","onload"]);this._buffer=new le({onload:this._onload.bind(this,e.onload),onerror:e.onerror,reverse:e.reverse,url:e.url}),this.autostart=e.autostart,this._loop=e.loop,this._loopStart=e.loopStart,this._loopEnd=e.loopEnd,this._playbackRate=e.playbackRate,this.fadeIn=e.fadeIn,this.fadeOut=e.fadeOut}static getDefaults(){return Object.assign(Ke.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:ce,onerror:ce,playbackRate:1,reverse:!1})}load(e){return Fe(this,void 0,void 0,function*(){return yield this._buffer.load(e),this._onload(),this})}_onload(e=ce){e(),this.autostart&&this.start()}_onSourceEnd(e){this.onstop(this),this._activeSources.delete(e),this._activeSources.size===0&&!this._synced&&this._state.getValueAtTime(this.now())==="started"&&(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(e,t,s){return super.start(e,t,s),this}_start(e,t,s){this._loop?t=Yn(t,this._loopStart):t=Yn(t,0);const i=this.toSeconds(t),r=s;s=Yn(s,Math.max(this._buffer.duration-i,0));let o=this.toSeconds(s);o=o/this._playbackRate,e=this.toSeconds(e);const a=new ri({url:this._buffer,context:this.context,fadeIn:this.fadeIn,fadeOut:this.fadeOut,loop:this._loop,loopEnd:this._loopEnd,loopStart:this._loopStart,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate}).connect(this.output);!this._loop&&!this._synced&&(this._state.cancel(e+o),this._state.setStateAtTime("stopped",e+o,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&xt(r)?a.start(e,i):a.start(e,i,o-this.toSeconds(this.fadeOut))}_stop(e){const t=this.toSeconds(e);this._activeSources.forEach(s=>s.stop(t))}restart(e,t,s){return super.restart(e,t,s),this}_restart(e,t,s){var i;(i=[...this._activeSources].pop())===null||i===void 0||i.stop(e),this._start(e,t,s)}seek(e,t){const s=this.toSeconds(t);if(this._state.getValueAtTime(s)==="started"){const i=this.toSeconds(e);this._stop(s),this._start(s,i)}return this}setLoopPoints(e,t){return this.loopStart=e,this.loopEnd=t,this}get loopStart(){return this._loopStart}set loopStart(e){this._loopStart=e,this.buffer.loaded&&Vt(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(t=>{t.loopStart=e})}get loopEnd(){return this._loopEnd}set loopEnd(e){this._loopEnd=e,this.buffer.loaded&&Vt(this.toSeconds(e),0,this.buffer.duration),this._activeSources.forEach(t=>{t.loopEnd=e})}get buffer(){return this._buffer}set buffer(e){this._buffer.set(e)}get loop(){return this._loop}set loop(e){if(this._loop!==e&&(this._loop=e,this._activeSources.forEach(t=>{t.loop=e}),e)){const t=this._state.getNextState("stopped",this.now());t&&this._state.cancel(t.time)}}get playbackRate(){return this._playbackRate}set playbackRate(e){this._playbackRate=e;const t=this.now(),s=this._state.getNextState("stopped",t);s&&s.implicitEnd&&(this._state.cancel(s.time),this._activeSources.forEach(i=>i.cancelStop())),this._activeSources.forEach(i=>{i.playbackRate.setValueAtTime(e,t)})}get reverse(){return this._buffer.reverse}set reverse(e){this._buffer.reverse=e}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(e=>e.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}}jt([Cs(0)],rr.prototype,"fadeIn",void 0);jt([Cs(0)],rr.prototype,"fadeOut",void 0);class NT extends xs{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new yn({context:this.context,mapping:e=>Math.abs(e)*2-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Pt extends W{constructor(){super(I(Pt.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new ve({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const e=I(Pt.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=e.attack,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this.attackCurve=e.attackCurve,this.releaseCurve=e.releaseCurve,this.decayCurve=e.decayCurve}static getDefaults(){return Object.assign(W.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(e,t){if(ys(e))return e;{let s;for(s in Br)if(Br[s][t]===e)return s;return e}}_setCurve(e,t,s){if(ys(s)&&Reflect.has(Br,s)){const i=Br[s];fn(i)?e!=="_decayCurve"&&(this[e]=i[t]):this[e]=i}else if(zt(s)&&e!=="_decayCurve")this[e]=s;else throw new Error("Envelope: invalid curve: "+s)}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(e){this._setCurve("_attackCurve","In",e)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(e){this._setCurve("_releaseCurve","Out",e)}get decayCurve(){return this._getCurve(this._decayCurve,"Out")}set decayCurve(e){this._setCurve("_decayCurve","Out",e)}triggerAttack(e,t=1){this.log("triggerAttack",e,t),e=this.toSeconds(e);let i=this.toSeconds(this.attack);const r=this.toSeconds(this.decay),o=this.getValueAtTime(e);if(o>0){const a=1/i;i=(1-o)/a}if(i0){const s=this.toSeconds(this.release);s{let e,t;const s=[];for(e=0;e<128;e++)s[e]=Math.sin(e/(128-1)*(Math.PI/2));const i=[],r=6.4;for(e=0;e<128-1;e++){t=e/(128-1);const d=Math.sin(t*(Math.PI*2)*r-Math.PI/2)+1;i[e]=d/10+t*.83}i[128-1]=1;const o=[],a=5;for(e=0;e<128;e++)o[e]=Math.ceil(e/(128-1)*a)/a;const c=[];for(e=0;e<128;e++)t=e/(128-1),c[e]=.5*(1-Math.cos(Math.PI*t));const l=[];for(e=0;e<128;e++){t=e/(128-1);const d=Math.pow(t,3)*4+.2,f=Math.cos(d*Math.PI*2*t);l[e]=Math.abs(f*(1-t))}function u(d){const f=new Array(d.length);for(let m=0;mthis._original_triggerRelease(t);const e=I(Tn.getDefaults(),arguments);this._volume=this.output=new qs({context:this.context,volume:e.volume}),this.volume=this._volume.volume,xe(this,"volume")}static getDefaults(){return Object.assign(W.getDefaults(),{volume:0})}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",0),this.context.transport.on("stop",this._syncedRelease),this.context.transport.on("pause",this._syncedRelease),this.context.transport.on("loopEnd",this._syncedRelease)),this}_syncState(){let e=!1;return this._synced||(this._synced=!0,e=!0),e}_syncMethod(e,t){const s=this["_original_"+e]=this[e];this[e]=(...i)=>{const r=i[t],o=this.context.transport.schedule(a=>{i[t]=a,s.apply(this,i)},r);this._scheduledEvents.push(o)}}unsync(){return this._scheduledEvents.forEach(e=>this.context.transport.clear(e)),this._scheduledEvents=[],this._synced&&(this._synced=!1,this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease,this.context.transport.off("stop",this._syncedRelease),this.context.transport.off("pause",this._syncedRelease),this.context.transport.off("loopEnd",this._syncedRelease)),this}triggerAttackRelease(e,t,s,i){const r=this.toSeconds(s),o=this.toSeconds(t);return this.triggerAttack(e,r,i),this.triggerRelease(r+o),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class Ts extends Tn{constructor(){super(I(Ts.getDefaults(),arguments));const e=I(Ts.getDefaults(),arguments);this.portamento=e.portamento,this.onsilence=e.onsilence}static getDefaults(){return Object.assign(Tn.getDefaults(),{detune:0,onsilence:ce,portamento:0})}triggerAttack(e,t,s=1){this.log("triggerAttack",e,t,s);const i=this.toSeconds(t);return this._triggerEnvelopeAttack(i,s),this.setNote(e,i),this}triggerRelease(e){this.log("triggerRelease",e);const t=this.toSeconds(e);return this._triggerEnvelopeRelease(t),this}setNote(e,t){const s=this.toSeconds(t),i=e instanceof Mt?e.toFrequency():e;if(this.portamento>0&&this.getLevelAtTime(s)>.05){const r=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(i,r,s)}else this.frequency.setValueAtTime(i,s);return this}}jt([Cs(0)],Ts.prototype,"portamento",void 0);class Wo extends Pt{constructor(){super(I(Wo.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new pe({context:this.context,gain:0}),this.output=this._gainNode,this.input=this._gainNode,this._sig.connect(this._gainNode.gain),this.output=this._gainNode,this.input=this._gainNode}dispose(){return super.dispose(),this._gainNode.dispose(),this}}class or extends Ts{constructor(){super(I(or.getDefaults(),arguments)),this.name="Synth";const e=I(or.getDefaults(),arguments);this.oscillator=new xn(Object.assign({context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)},e.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Wo(Object.assign({context:this.context},e.envelope)),this.oscillator.chain(this.envelope,this.output),xe(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(Ts.getDefaults(),{envelope:Object.assign(Vn(Pt.getDefaults(),Object.keys(W.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(Vn(xn.getDefaults(),[...Object.keys(Ke.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(e,t){if(this.envelope.triggerAttack(e,t),this.oscillator.start(e),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),i=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+s+i)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class ar extends W{constructor(){super(I(ar.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const e=I(ar.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new ue({context:this.context,units:"number",value:e.Q,param:this._filter.Q}),this.frequency=new ue({context:this.context,units:"frequency",value:e.frequency,param:this._filter.frequency}),this.detune=new ue({context:this.context,units:"cents",value:e.detune,param:this._filter.detune}),this.gain=new ue({context:this.context,units:"decibels",convert:!1,value:e.gain,param:this._filter.gain}),this.type=e.type}static getDefaults(){return Object.assign(W.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(e){Q(["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(e)!==-1,`Invalid filter type: ${e}`),this._filter.type=e}getFrequencyResponse(e=128){const t=new Float32Array(e);for(let o=0;os.type=e)}get rolloff(){return this._rolloff}set rolloff(e){const t=js(e)?e:parseInt(e,10),s=[-12,-24,-48,-96];let i=s.indexOf(t);Q(i!==-1,`rolloff can only be ${s.join(", ")}`),i+=1,this._rolloff=t,this.input.disconnect(),this._filters.forEach(r=>r.disconnect()),this._filters=new Array(i);for(let r=0;r1);return this._filters.forEach(()=>{t.getFrequencyResponse(e).forEach((r,o)=>s[o]*=r)}),t.dispose(),s}dispose(){return super.dispose(),this._filters.forEach(e=>{e.dispose()}),Hc(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class cr extends Pt{constructor(){super(I(cr.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const e=I(cr.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=e.octaves,this._baseFrequency=this.toFrequency(e.baseFrequency),this._exponent=this.input=new Ki({context:this.context,value:e.exponent}),this._scale=this.output=new yo({context:this.context,min:this._baseFrequency,max:this._baseFrequency*Math.pow(2,this._octaves)}),this._sig.chain(this._exponent,this._scale)}static getDefaults(){return Object.assign(Pt.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(e){const t=this.toFrequency(e);Vt(t,0),this._baseFrequency=t,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(e){this._octaves=e,this._scale.max=this._baseFrequency*Math.pow(2,e)}get exponent(){return this._exponent.value}set exponent(e){this._exponent.value=e}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class lr extends Ts{constructor(){super(I(lr.getDefaults(),arguments)),this.name="MonoSynth";const e=I(lr.getDefaults(),arguments);this.oscillator=new xn(Object.assign(e.oscillator,{context:this.context,detune:e.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new ai(Object.assign(e.filter,{context:this.context})),this.filterEnvelope=new cr(Object.assign(e.filterEnvelope,{context:this.context})),this.envelope=new Wo(Object.assign(e.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),xe(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(Ts.getDefaults(),{envelope:Object.assign(Vn(Pt.getDefaults(),Object.keys(W.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(Vn(ai.getDefaults(),Object.keys(W.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(Vn(cr.getDefaults(),Object.keys(W.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(Vn(xn.getDefaults(),Object.keys(Ke.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(e,t=1){if(this.envelope.triggerAttack(e,t),this.filterEnvelope.triggerAttack(e),this.oscillator.start(e),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),i=this.toSeconds(this.envelope.decay);this.oscillator.stop(e+s+i)}}_triggerEnvelopeRelease(e){this.envelope.triggerRelease(e),this.filterEnvelope.triggerRelease(e),this.oscillator.stop(e+this.toSeconds(this.envelope.release))}getLevelAtTime(e){return e=this.toSeconds(e),this.envelope.getValueAtTime(e)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class ur extends or{constructor(){super(I(ur.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const e=I(ur.getDefaults(),arguments);this.pitchDecay=e.pitchDecay,this.octaves=e.octaves,xe(this,["oscillator","envelope"])}static getDefaults(){return Gn(Ts.getDefaults(),or.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(e,t){const s=this.toSeconds(t),i=this.toFrequency(e instanceof Mt?e.toFrequency():e),r=i*this.octaves;return this.oscillator.frequency.setValueAtTime(r,s),this.oscillator.frequency.exponentialRampToValueAtTime(i,s+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}jt([Id(0)],ur.prototype,"octaves",void 0);jt([Cs(0)],ur.prototype,"pitchDecay",void 0);const Nd=new Set;function $c(n){Nd.add(n)}function Fd(n,e){const t=`registerProcessor("${n}", ${e})`;Nd.add(t)}const FT=` /** * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. */ @@ -354,7 +354,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu }; } } -`;$c(NT);const FT=` +`;$c(FT);const UT=` /** * Abstract class for a single input/output processor. * has a 'generate' function which processes one sample at a time @@ -421,7 +421,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu return !this.disposed; } }; -`;$c(FT);const UT=` +`;$c(UT);const LT=` /** * A multichannel buffer for use within an AudioWorkletProcessor as a delay line */ @@ -465,7 +465,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu return this.buffer[channel][readHead]; } } -`;$c(UT);const LT="feedback-comb-filter",zT=` +`;$c(LT);const zT="feedback-comb-filter",BT=` class FeedbackCombFilterWorklet extends SingleIOProcessor { constructor(options) { @@ -495,7 +495,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu return delayedSample; } } -`;Fd(LT,zT);class hr extends Tn{constructor(){super(I(hr.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const e=I(hr.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),t={};Object.keys(e.urls).forEach(s=>{const i=parseInt(s,10);if(Q(zr(s)||js(i)&&isFinite(i),`url key is neither a note or midi pitch: ${s}`),zr(s)){const r=new Mt(this.context,s).toMidi();t[r]=e.urls[s]}else js(i)&&isFinite(i)&&(t[i]=e.urls[i])}),this._buffers=new Yc({urls:t,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.attack=e.attack,this.release=e.release,this.curve=e.curve,this._buffers.loaded&&Promise.resolve().then(e.onload)}static getDefaults(){return Object.assign(Tn.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:ce,onerror:ce,release:.1,urls:{}})}_findClosest(e){let s=0;for(;s<96;){if(this._buffers.has(e+s))return-s;if(this._buffers.has(e-s))return s;s++}throw new Error(`No available buffers for note: ${e}`)}triggerAttack(e,t,s=1){return this.log("triggerAttack",e,t,s),Array.isArray(e)||(e=[e]),e.forEach(i=>{const r=Pd(new Mt(this.context,i).toFrequency()),o=Math.round(r),a=r-o,c=this._findClosest(o),l=o-c,u=this._buffers.get(l),h=Rd(c+a),d=new ri({url:u,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:h}).connect(this.output);d.start(t,0,u.duration/h,s),zt(this._activeSources.get(o))||this._activeSources.set(o,[]),this._activeSources.get(o).push(d),d.onended=()=>{if(this._activeSources&&this._activeSources.has(o)){const f=this._activeSources.get(o),m=f.indexOf(d);m!==-1&&f.splice(m,1)}}}),this}triggerRelease(e,t){return this.log("triggerRelease",e,t),Array.isArray(e)||(e=[e]),e.forEach(s=>{const i=new Mt(this.context,s).toMidi();if(this._activeSources.has(i)&&this._activeSources.get(i).length){const r=this._activeSources.get(i);t=this.toSeconds(t),r.forEach(o=>{o.stop(t)}),this._activeSources.set(i,[])}}),this}releaseAll(e){const t=this.toSeconds(e);return this._activeSources.forEach(s=>{for(;s.length;)s.shift().stop(t)}),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(e,t,s,i=1){const r=this.toSeconds(s);return this.triggerAttack(e,r,i),zt(t)?(Q(zt(e),"notes must be an array when duration is array"),e.forEach((o,a)=>{const c=t[Math.min(a,t.length-1)];this.triggerRelease(o,r+this.toSeconds(c))})):this.triggerRelease(e,r+this.toSeconds(t)),this}add(e,t,s){if(Q(zr(e)||isFinite(e),`note must be a pitch or midi: ${e}`),zr(e)){const i=new Mt(this.context,e).toMidi();this._buffers.add(i,t,s)}else this._buffers.add(e,t,s);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(e=>{e.forEach(t=>t.dispose())}),this._activeSources.clear(),this}}jt([Cs(0)],hr.prototype,"attack",void 0);jt([Cs(0)],hr.prototype,"release",void 0);class xo extends W{constructor(){super(Object.assign(I(xo.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new IT({context:this.context}),this.a=new pe({context:this.context,gain:0}),this.b=new pe({context:this.context,gain:0}),this.output=new pe({context:this.context}),this._internalChannels=[this.a,this.b];const e=I(xo.getDefaults(),arguments,["fade"]);this.fade=new ve({context:this.context,units:"normalRange",value:e.fade}),xe(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",Hs(this._split,this.a.gain,0),Hs(this._split,this.b.gain,1),this.fade.chain(this._g2a,this._panner.pan),this.a.connect(this.output),this.b.connect(this.output)}static getDefaults(){return Object.assign(W.getDefaults(),{fade:.5})}dispose(){return super.dispose(),this.a.dispose(),this.b.dispose(),this.output.dispose(),this.fade.dispose(),this._g2a.dispose(),this._panner.disconnect(),this._split.disconnect(),this}}class ou extends W{constructor(e){super(e),this.name="Effect",this._dryWet=new xo({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new pe({context:this.context}),this.effectReturn=new pe({context:this.context}),this.input=new pe({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(e.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],xe(this,"wet")}static getDefaults(){return Object.assign(W.getDefaults(),{wet:1})}connectEffect(e){return this._internalChannels.push(e),this.effectSend.chain(e,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class To extends W{constructor(){super(Object.assign(I(To.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const e=I(To.getDefaults(),arguments,["pan"]);this.pan=new ue({context:this.context,param:this._panner.pan,value:e.pan,minValue:-1,maxValue:1}),this._panner.channelCount=e.channelCount,this._panner.channelCountMode="explicit",xe(this,"pan")}static getDefaults(){return Object.assign(W.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}const BT="bit-crusher",VT=` +`;Fd(zT,BT);class hr extends Tn{constructor(){super(I(hr.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const e=I(hr.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),t={};Object.keys(e.urls).forEach(s=>{const i=parseInt(s,10);if(Q(zr(s)||js(i)&&isFinite(i),`url key is neither a note or midi pitch: ${s}`),zr(s)){const r=new Mt(this.context,s).toMidi();t[r]=e.urls[s]}else js(i)&&isFinite(i)&&(t[i]=e.urls[i])}),this._buffers=new Yc({urls:t,onload:e.onload,baseUrl:e.baseUrl,onerror:e.onerror}),this.attack=e.attack,this.release=e.release,this.curve=e.curve,this._buffers.loaded&&Promise.resolve().then(e.onload)}static getDefaults(){return Object.assign(Tn.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:ce,onerror:ce,release:.1,urls:{}})}_findClosest(e){let s=0;for(;s<96;){if(this._buffers.has(e+s))return-s;if(this._buffers.has(e-s))return s;s++}throw new Error(`No available buffers for note: ${e}`)}triggerAttack(e,t,s=1){return this.log("triggerAttack",e,t,s),Array.isArray(e)||(e=[e]),e.forEach(i=>{const r=Pd(new Mt(this.context,i).toFrequency()),o=Math.round(r),a=r-o,c=this._findClosest(o),l=o-c,u=this._buffers.get(l),h=Rd(c+a),d=new ri({url:u,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:h}).connect(this.output);d.start(t,0,u.duration/h,s),zt(this._activeSources.get(o))||this._activeSources.set(o,[]),this._activeSources.get(o).push(d),d.onended=()=>{if(this._activeSources&&this._activeSources.has(o)){const f=this._activeSources.get(o),m=f.indexOf(d);m!==-1&&f.splice(m,1)}}}),this}triggerRelease(e,t){return this.log("triggerRelease",e,t),Array.isArray(e)||(e=[e]),e.forEach(s=>{const i=new Mt(this.context,s).toMidi();if(this._activeSources.has(i)&&this._activeSources.get(i).length){const r=this._activeSources.get(i);t=this.toSeconds(t),r.forEach(o=>{o.stop(t)}),this._activeSources.set(i,[])}}),this}releaseAll(e){const t=this.toSeconds(e);return this._activeSources.forEach(s=>{for(;s.length;)s.shift().stop(t)}),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(e,t,s,i=1){const r=this.toSeconds(s);return this.triggerAttack(e,r,i),zt(t)?(Q(zt(e),"notes must be an array when duration is array"),e.forEach((o,a)=>{const c=t[Math.min(a,t.length-1)];this.triggerRelease(o,r+this.toSeconds(c))})):this.triggerRelease(e,r+this.toSeconds(t)),this}add(e,t,s){if(Q(zr(e)||isFinite(e),`note must be a pitch or midi: ${e}`),zr(e)){const i=new Mt(this.context,e).toMidi();this._buffers.add(i,t,s)}else this._buffers.add(e,t,s);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(e=>{e.forEach(t=>t.dispose())}),this._activeSources.clear(),this}}jt([Cs(0)],hr.prototype,"attack",void 0);jt([Cs(0)],hr.prototype,"release",void 0);class xo extends W{constructor(){super(Object.assign(I(xo.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new NT({context:this.context}),this.a=new pe({context:this.context,gain:0}),this.b=new pe({context:this.context,gain:0}),this.output=new pe({context:this.context}),this._internalChannels=[this.a,this.b];const e=I(xo.getDefaults(),arguments,["fade"]);this.fade=new ve({context:this.context,units:"normalRange",value:e.fade}),xe(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",Hs(this._split,this.a.gain,0),Hs(this._split,this.b.gain,1),this.fade.chain(this._g2a,this._panner.pan),this.a.connect(this.output),this.b.connect(this.output)}static getDefaults(){return Object.assign(W.getDefaults(),{fade:.5})}dispose(){return super.dispose(),this.a.dispose(),this.b.dispose(),this.output.dispose(),this.fade.dispose(),this._g2a.dispose(),this._panner.disconnect(),this._split.disconnect(),this}}class ou extends W{constructor(e){super(e),this.name="Effect",this._dryWet=new xo({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new pe({context:this.context}),this.effectReturn=new pe({context:this.context}),this.input=new pe({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(e.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],xe(this,"wet")}static getDefaults(){return Object.assign(W.getDefaults(),{wet:1})}connectEffect(e){return this._internalChannels.push(e),this.effectSend.chain(e,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class To extends W{constructor(){super(Object.assign(I(To.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const e=I(To.getDefaults(),arguments,["pan"]);this.pan=new ue({context:this.context,param:this._panner.pan,value:e.pan,minValue:-1,maxValue:1}),this._panner.channelCount=e.channelCount,this._panner.channelCountMode="explicit",xe(this,"pan")}static getDefaults(){return Object.assign(W.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}const VT="bit-crusher",jT=` class BitCrusherWorklet extends SingleIOProcessor { static get parameterDescriptors() { @@ -514,7 +514,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu return val; } } -`;Fd(BT,VT);class ko extends W{constructor(){super(I(ko.getDefaults(),arguments,["channels"])),this.name="Merge";const e=I(ko.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(e.channels)}static getDefaults(){return Object.assign(W.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class wo extends ou{constructor(){super(I(wo.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const e=I(wo.getDefaults(),arguments,["decay"]);this._decay=e.decay,this._preDelay=e.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(ou.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(e){e=this.toSeconds(e),Vt(e,.001),this._decay=e,this.generate()}get preDelay(){return this._preDelay}set preDelay(e){e=this.toSeconds(e),Vt(e,0),this._preDelay=e,this.generate()}generate(){return Fe(this,void 0,void 0,function*(){const e=this.ready,t=new Ho(2,this._decay+this._preDelay,this.context.sampleRate),s=new er({context:t}),i=new er({context:t}),r=new ko({context:t});s.connect(r,0,0),i.connect(r,0,1);const o=new pe({context:t}).toDestination();r.connect(o),s.start(0),i.start(0),o.gain.setValueAtTime(0,0),o.gain.setValueAtTime(1,this._preDelay),o.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=t.render();return this.ready=a.then(ce),yield e,this._convolver.buffer=(yield a).get(),this})}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class Re extends W{constructor(){super(I(Re.getDefaults(),arguments,["solo"])),this.name="Solo";const e=I(Re.getDefaults(),arguments,["solo"]);this.input=this.output=new pe({context:this.context}),Re._allSolos.has(this.context)||Re._allSolos.set(this.context,new Set),Re._allSolos.get(this.context).add(this),this.solo=e.solo}static getDefaults(){return Object.assign(W.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(e){e?this._addSolo():this._removeSolo(),Re._allSolos.get(this.context).forEach(t=>t._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){Re._soloed.has(this.context)||Re._soloed.set(this.context,new Set),Re._soloed.get(this.context).add(this)}_removeSolo(){Re._soloed.has(this.context)&&Re._soloed.get(this.context).delete(this)}_isSoloed(){return Re._soloed.has(this.context)&&Re._soloed.get(this.context).has(this)}_noSolos(){return!Re._soloed.has(this.context)||Re._soloed.has(this.context)&&Re._soloed.get(this.context).size===0}_updateSolo(){this._isSoloed()?this.input.gain.value=1:this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),Re._allSolos.get(this.context).delete(this),this._removeSolo(),this}}Re._allSolos=new Map;Re._soloed=new Map;class So extends W{constructor(){super(I(So.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const e=I(So.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new To({context:this.context,pan:e.pan,channelCount:e.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new qs({context:this.context,volume:e.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=e.mute,xe(this,["pan","volume"])}static getDefaults(){return Object.assign(W.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class rn extends W{constructor(){super(I(rn.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const e=I(rn.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Re({solo:e.solo,context:this.context}),this._panVol=this.output=new So({context:this.context,pan:e.pan,volume:e.volume,mute:e.mute,channelCount:e.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),xe(this,["pan","volume"])}static getDefaults(){return Object.assign(W.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(e){this._solo.solo=e}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(e){this._panVol.mute=e}_getBus(e){return rn.buses.has(e)||rn.buses.set(e,new pe({context:this.context})),rn.buses.get(e)}send(e,t=0){const s=this._getBus(e),i=new pe({context:this.context,units:"decibels",gain:t});return this.connect(i),i.connect(s),i}receive(e){return this._getBus(e).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}rn.buses=new Map;class jT extends W{constructor(){super(...arguments),this.name="Listener",this.positionX=new ue({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new ue({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new ue({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new ue({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new ue({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new ue({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new ue({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new ue({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new ue({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(W.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}Vo(n=>{n.listener=new jT({context:n})});jo(n=>{n.listener.dispose()});Ut().transport;const Qc=Ut().destination;Ut().destination;Ut().listener;Ut().draw;Ut();const Kc=new ai(900,"highpass"),Ud=new qs(-6);Ud.chain(Kc,Qc);const HT=new wo(3).connect(Ud),Go=new lr({envelope:{attack:0,decay:.9,sustain:.2,release:.1}});Go.oscillator.type="triangle2";Go.volume.value=-6;Go.chain(Kc,Qc);const Yo=new lr({envelope:{attack:.4,decay:.9,sustain:.7,release:.6}}).connect(HT);Yo.oscillator.type="triangle";Yo.volume.value=-6;Yo.chain(Kc,Qc);function qT(){return Math.floor((Math.random()-.5)*20)}let au=!1;const WT=async(n=0)=>{au||(await yT(),au=!0);try{if(n>2e3)Yo.triggerAttackRelease(60,.3);else if(n>1e3){let e=310;e+=qT(),Go.triggerAttackRelease(e,.001)}}catch(e){console.warn(e)}},Vr=1800,GT=(n,e)=>n.clone().normalize().clone().negate().normalize().multiplyScalar(e).add(n);let Fn,Mi;const YT=4e3,ZT=2e3,XT=n=>{const e=Jt(),t=Fs(x=>x.isUserDragging),s=Fs(x=>x.isUserScrolling),i=Fs(x=>x.setUserMovedCamera),{data:r,graphStyle:o,showSelectionGraph:a,setNearbyNodeIds:c,cameraFocusTrigger:l}=nt(x=>x),{camera:u}=ge(),[h,d]=b.useState(!1),[f,m]=b.useState(!1),[p,g]=b.useState(Ll),y=b.useMemo(()=>{if(a)return new K(0,0,0);const x=r==null?void 0:r.nodes.find(C=>C.ref_id===(e==null?void 0:e.ref_id));let k=new K(2e3,2e3,3e3);if(x&&r){const C=r==null?void 0:r.nodes.filter(P=>{var F;return(F=x.children)==null?void 0:F.find(N=>N===P.id)}),E=new K(x.x,x.y,x.z);let O=new K(0,0,0);C.map(P=>(O=O.add(new K(P.x,P.y,P.z).normalize()),P));const A=x.scale?1-1/(x.scale+10):1,R=E.sub(O).multiplyScalar(.8*A);k=E.add(R)}return k},[a,e,r]),w=b.useMemo(()=>{if(a)return new K(0,0,0);const x=r==null?void 0:r.nodes.find(k=>k.ref_id===(e==null?void 0:e.ref_id));return new K((x==null?void 0:x.x)||0,(x==null?void 0:x.y)||0,(x==null?void 0:x.z)||0)},[a,e,r]);b.useEffect(()=>{var x;a&&((x=n.current)==null||x.setLookAt(ga.x,ga.y,ga.z,0,0,0,!1)),S()},[a]),b.useEffect(()=>{a?g(Z_):(e==null?void 0:e.node_type)==="topic"?g(Y_):g(Ll)},[e,g,a]),b.useEffect(()=>{v()},[l]),b.useEffect(()=>{(t||s)&&(d(!0),m(!0))},[t,s,d,m]),b.useEffect(()=>{if(e)if(!a&&o==="earth"&&(n!=null&&n.current)){const x=n.current.camera.position.distanceTo(new K),k=GT(w,-x/2);n.current.setLookAt(k.x,k.y,k.z,0,0,0,!0)}else Fn&&clearTimeout(Fn),Fn=setTimeout(()=>{m(!0),clearTimeout(Fn)},ZT),S();return()=>{Fn&&clearTimeout(Fn),Mi&&clearTimeout(Mi)}},[e]),wt(x=>{n.current&&(h||_(y,x.camera),f||T(w,x.camera))});const S=()=>{if(e){const x=u.position.distanceTo(y);WT(x)}v()},v=()=>{d(!1),m(!1),i(!1),Mi&&clearTimeout(Mi),Mi=setTimeout(()=>{d(!0),m(!0)},YT)},_=(x,k)=>{if(k.position.distanceTo(x){var C;(C=n==null?void 0:n.current)==null||C.setLookAt(k.position.x,k.position.y,k.position.z,x.x,x.y,x.z,!0)};return null},$T=1;let cs=null;const QT=(n,{enabled:e})=>{const t=Jt();XT(n);const s=Fs(u=>u.isUserDragging),{graphStyle:i,data:r,setNearbyNodeIds:o,graphRadius:a,disableCameraRotation:c}=nt(u=>u);b.useEffect(()=>{e||(cs==null||cs.kill(),cs=null)},[e]);const l=b.useCallback(()=>{cs==null||cs.kill();const u={value:-244},h=Tc.to(u,{duration:5,keyframes:{"0%":{value:10},"100%":{delay:2,ease:"Power4.easeIn",value:-200}},onComplete:()=>{cs=null},onInterrupt(){h.kill()},onUpdate:()=>{var f;const{value:d}=u;if(n.current){const m=kc((r==null?void 0:r.nodes)||[],n.current.camera);m&&o(m),(f=n.current)==null||f.dolly(d,!1)}}});h.play(),cs=h},[]);return b.useEffect(()=>{n.current&&a&&(i==="sphere"?(n.current.maxDistance=8e3,n.current.minDistance=200,n.current.setTarget(0,0,500,!0)):(n.current.maxDistance=n.current.getDistanceToFitSphere(a+200),n.current.minDistance=100))},[a,i,n]),b.useEffect(()=>{l()},[l,i]),b.useEffect(()=>{!t&&n.current&&n.current.setLookAt(ps.x,ps.y,ps.z,0,0,0,!0)},[t]),wt((u,h)=>{n.current&&(!c&&!s&&(n.current.azimuthAngle+=$T*h*Yf.DEG2RAD),n.current.update(h))}),null},KT=({disableAnimations:n})=>{const e=b.useRef(null),{graphStyle:t,data:s,setNearbyNodeIds:i,setDisableCameraRotation:r}=nt(d=>d),[o]=b.useState(.8),{camera:a}=ge(),[c,l,u,h]=Fs(d=>[d.isUserDragging,d.setIsUserDragging,d.isUserScrolling,d.isUserScrollingOnHtmlPanel]);return QT(e,{enabled:!n&&!u&&!c}),b.useEffect(()=>{e.current&&e.current.setLookAt(ps.x,ps.y,ps.z,0,0,0,!0)},[t]),b.useEffect(()=>{if(!c){const d=kc((s==null?void 0:s.nodes)||[],a);d&&i(d)}},[a,a.position,a.position.x,a.position.y,a.position.z,s==null?void 0:s.nodes,i,c]),b.useEffect(()=>{c&&r(!0)},[c,r]),M.jsx(kp,{ref:e,boundaryEnclosesCamera:!0,enabled:!h,makeDefault:!0,maxDistance:12e3,minDistance:100,onEnd:()=>l(!1),onStart:()=>l(!0),smoothTime:o})},Ld=b.memo(({linksPositions:n})=>{const e=kn(r=>r.dataInitial),{showSelectionGraph:t}=nt(r=>r),s=Jt(),i=b.useRef([]);return b.useEffect(()=>{i.current.forEach((r,o)=>{if(r){const a=s?0:.5,c=(s==null?void 0:s.ref_id)===(e==null?void 0:e.links[o].source)||(s==null?void 0:s.ref_id)===(e==null?void 0:e.links[o].target);Tc.fromTo(r.material,{linewidth:5},{linewidth:c?2:a,duration:1})}})},[e,s]),M.jsx("group",{name:"simulation-3d-group__connections",children:e==null?void 0:e.links.map((r,o)=>{var l,u,h,d,f,m;const a=new K(((l=n[o])==null?void 0:l.sx)||0,((u=n[o])==null?void 0:u.sy)||0,((h=n[o])==null?void 0:h.sz)||0),c=new K(((d=n[o])==null?void 0:d.tx)||0,((f=n[o])==null?void 0:f.ty)||0,((m=n[o])==null?void 0:m.tz)||0);return M.jsx(vf,{ref:p=>{i.current[o]=p},color:"rgba(136, 136, 136, 1)",isLine2:!0,lineWidth:1,opacity:1,points:[a,c],transparent:!0,visible:!t},r.ref_id)})})});Ld.displayName="Connections";const Zo={metalness:.9,roughness:0},JT={...Zo};new fr(JT);const zd=new Oo,Co=zd.load("noimage.jpeg"),cu=new fr({...Zo,map:Co}),Bd=.4,ek=new fr({...Zo,map:Co,transparent:!0,opacity:Bd}),jr={},tk=(n,e)=>{const[t,s]=b.useState(Co),[i,r]=b.useState(cu);return b.useEffect(()=>{const o=`${n}${e&&"-transparent"}`;if(jr[o]){s(jr[o].texture),r(jr[o].material);return}zd.load(n,a=>{const c=new fr({map:a,transparent:e,opacity:e?Bd:1,...Zo});jr[o]={texture:a,material:c},s(a),r(c)},void 0,()=>{s(Co),r(e?ek:cu)})},[n,e]),b.useEffect(()=>function(){t.dispose(),i.dispose()},[t,i]),i},Jc=b.memo(({node:n,hide:e,animated:t})=>{const s=b.useRef(null),[i]=b.useState(Ul),r=Jt(),{showSelectionGraph:o}=nt(u=>u),a=!!r&&n.ref_id===r.ref_id,c=tk(n.image_url||"noimage.jpeg",!1);wt((u,h)=>{t&&s.current&&a&&(s.current.rotation.y+=h*1,s.current.rotation.x-=h*.6)}),b.useEffect(()=>function(){i.dispose()},[i]);const l=b.useMemo(()=>o&&a?20:a?(n.scale||1)*1.2:n.scale,[n,a,o]);return M.jsx(Mp,{enabled:!!a,children:M.jsx("mesh",{ref:s,geometry:Ul,material:c,name:n.id,scale:l,userData:n,visible:!e})})});Jc.displayName="Cube";const sk=Ve(Ys)` +`;Fd(VT,jT);class ko extends W{constructor(){super(I(ko.getDefaults(),arguments,["channels"])),this.name="Merge";const e=I(ko.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(e.channels)}static getDefaults(){return Object.assign(W.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class wo extends ou{constructor(){super(I(wo.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const e=I(wo.getDefaults(),arguments,["decay"]);this._decay=e.decay,this._preDelay=e.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(ou.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(e){e=this.toSeconds(e),Vt(e,.001),this._decay=e,this.generate()}get preDelay(){return this._preDelay}set preDelay(e){e=this.toSeconds(e),Vt(e,0),this._preDelay=e,this.generate()}generate(){return Fe(this,void 0,void 0,function*(){const e=this.ready,t=new Ho(2,this._decay+this._preDelay,this.context.sampleRate),s=new er({context:t}),i=new er({context:t}),r=new ko({context:t});s.connect(r,0,0),i.connect(r,0,1);const o=new pe({context:t}).toDestination();r.connect(o),s.start(0),i.start(0),o.gain.setValueAtTime(0,0),o.gain.setValueAtTime(1,this._preDelay),o.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=t.render();return this.ready=a.then(ce),yield e,this._convolver.buffer=(yield a).get(),this})}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class Re extends W{constructor(){super(I(Re.getDefaults(),arguments,["solo"])),this.name="Solo";const e=I(Re.getDefaults(),arguments,["solo"]);this.input=this.output=new pe({context:this.context}),Re._allSolos.has(this.context)||Re._allSolos.set(this.context,new Set),Re._allSolos.get(this.context).add(this),this.solo=e.solo}static getDefaults(){return Object.assign(W.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(e){e?this._addSolo():this._removeSolo(),Re._allSolos.get(this.context).forEach(t=>t._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){Re._soloed.has(this.context)||Re._soloed.set(this.context,new Set),Re._soloed.get(this.context).add(this)}_removeSolo(){Re._soloed.has(this.context)&&Re._soloed.get(this.context).delete(this)}_isSoloed(){return Re._soloed.has(this.context)&&Re._soloed.get(this.context).has(this)}_noSolos(){return!Re._soloed.has(this.context)||Re._soloed.has(this.context)&&Re._soloed.get(this.context).size===0}_updateSolo(){this._isSoloed()?this.input.gain.value=1:this._noSolos()?this.input.gain.value=1:this.input.gain.value=0}dispose(){return super.dispose(),Re._allSolos.get(this.context).delete(this),this._removeSolo(),this}}Re._allSolos=new Map;Re._soloed=new Map;class So extends W{constructor(){super(I(So.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const e=I(So.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new To({context:this.context,pan:e.pan,channelCount:e.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new qs({context:this.context,volume:e.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=e.mute,xe(this,["pan","volume"])}static getDefaults(){return Object.assign(W.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(e){this._volume.mute=e}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class rn extends W{constructor(){super(I(rn.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const e=I(rn.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new Re({solo:e.solo,context:this.context}),this._panVol=this.output=new So({context:this.context,pan:e.pan,volume:e.volume,mute:e.mute,channelCount:e.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),xe(this,["pan","volume"])}static getDefaults(){return Object.assign(W.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(e){this._solo.solo=e}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(e){this._panVol.mute=e}_getBus(e){return rn.buses.has(e)||rn.buses.set(e,new pe({context:this.context})),rn.buses.get(e)}send(e,t=0){const s=this._getBus(e),i=new pe({context:this.context,units:"decibels",gain:t});return this.connect(i),i.connect(s),i}receive(e){return this._getBus(e).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}rn.buses=new Map;class HT extends W{constructor(){super(...arguments),this.name="Listener",this.positionX=new ue({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new ue({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new ue({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new ue({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new ue({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new ue({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new ue({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new ue({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new ue({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(W.getDefaults(),{positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:-1,upX:0,upY:1,upZ:0})}dispose(){return super.dispose(),this.positionX.dispose(),this.positionY.dispose(),this.positionZ.dispose(),this.forwardX.dispose(),this.forwardY.dispose(),this.forwardZ.dispose(),this.upX.dispose(),this.upY.dispose(),this.upZ.dispose(),this}}Vo(n=>{n.listener=new HT({context:n})});jo(n=>{n.listener.dispose()});Ut().transport;const Qc=Ut().destination;Ut().destination;Ut().listener;Ut().draw;Ut();const Kc=new ai(900,"highpass"),Ud=new qs(-6);Ud.chain(Kc,Qc);const qT=new wo(3).connect(Ud),Go=new lr({envelope:{attack:0,decay:.9,sustain:.2,release:.1}});Go.oscillator.type="triangle2";Go.volume.value=-6;Go.chain(Kc,Qc);const Yo=new lr({envelope:{attack:.4,decay:.9,sustain:.7,release:.6}}).connect(qT);Yo.oscillator.type="triangle";Yo.volume.value=-6;Yo.chain(Kc,Qc);function WT(){return Math.floor((Math.random()-.5)*20)}let au=!1;const GT=async(n=0)=>{au||(await xT(),au=!0);try{if(n>2e3)Yo.triggerAttackRelease(60,.3);else if(n>1e3){let e=310;e+=WT(),Go.triggerAttackRelease(e,.001)}}catch(e){console.warn(e)}},Vr=1800,YT=(n,e)=>n.clone().normalize().clone().negate().normalize().multiplyScalar(e).add(n);let Fn,Mi;const ZT=4e3,XT=2e3,$T=n=>{const e=Jt(),t=Fs(x=>x.isUserDragging),s=Fs(x=>x.isUserScrolling),i=Fs(x=>x.setUserMovedCamera),{data:r,graphStyle:o,showSelectionGraph:a,setNearbyNodeIds:c,cameraFocusTrigger:l}=nt(x=>x),{camera:u}=ge(),[h,d]=b.useState(!1),[f,m]=b.useState(!1),[p,g]=b.useState(Ll),y=b.useMemo(()=>{if(a)return new K(0,0,0);const x=r==null?void 0:r.nodes.find(C=>C.ref_id===(e==null?void 0:e.ref_id));let k=new K(2e3,2e3,3e3);if(x&&r){const C=r==null?void 0:r.nodes.filter(P=>{var F;return(F=x.children)==null?void 0:F.find(N=>N===P.id)}),E=new K(x.x,x.y,x.z);let O=new K(0,0,0);C.map(P=>(O=O.add(new K(P.x,P.y,P.z).normalize()),P));const A=x.scale?1-1/(x.scale+10):1,R=E.sub(O).multiplyScalar(.8*A);k=E.add(R)}return k},[a,e,r]),w=b.useMemo(()=>{if(a)return new K(0,0,0);const x=r==null?void 0:r.nodes.find(k=>k.ref_id===(e==null?void 0:e.ref_id));return new K((x==null?void 0:x.x)||0,(x==null?void 0:x.y)||0,(x==null?void 0:x.z)||0)},[a,e,r]);b.useEffect(()=>{var x;a&&((x=n.current)==null||x.setLookAt(ga.x,ga.y,ga.z,0,0,0,!1)),S()},[a]),b.useEffect(()=>{a?g(X_):(e==null?void 0:e.node_type)==="topic"?g(Z_):g(Ll)},[e,g,a]),b.useEffect(()=>{v()},[l]),b.useEffect(()=>{(t||s)&&(d(!0),m(!0))},[t,s,d,m]),b.useEffect(()=>{if(e)if(!a&&o==="earth"&&(n!=null&&n.current)){const x=n.current.camera.position.distanceTo(new K),k=YT(w,-x/2);n.current.setLookAt(k.x,k.y,k.z,0,0,0,!0)}else Fn&&clearTimeout(Fn),Fn=setTimeout(()=>{m(!0),clearTimeout(Fn)},XT),S();return()=>{Fn&&clearTimeout(Fn),Mi&&clearTimeout(Mi)}},[e]),wt(x=>{n.current&&(h||_(y,x.camera),f||T(w,x.camera))});const S=()=>{if(e){const x=u.position.distanceTo(y);GT(x)}v()},v=()=>{d(!1),m(!1),i(!1),Mi&&clearTimeout(Mi),Mi=setTimeout(()=>{d(!0),m(!0)},ZT)},_=(x,k)=>{if(k.position.distanceTo(x){var C;(C=n==null?void 0:n.current)==null||C.setLookAt(k.position.x,k.position.y,k.position.z,x.x,x.y,x.z,!0)};return null},QT=1;let cs=null;const KT=(n,{enabled:e})=>{const t=Jt();$T(n);const s=Fs(u=>u.isUserDragging),{graphStyle:i,data:r,setNearbyNodeIds:o,graphRadius:a,disableCameraRotation:c}=nt(u=>u);b.useEffect(()=>{e||(cs==null||cs.kill(),cs=null)},[e]);const l=b.useCallback(()=>{cs==null||cs.kill();const u={value:-244},h=Tc.to(u,{duration:5,keyframes:{"0%":{value:10},"100%":{delay:2,ease:"Power4.easeIn",value:-200}},onComplete:()=>{cs=null},onInterrupt(){h.kill()},onUpdate:()=>{var f;const{value:d}=u;if(n.current){const m=kc((r==null?void 0:r.nodes)||[],n.current.camera);m&&o(m),(f=n.current)==null||f.dolly(d,!1)}}});h.play(),cs=h},[]);return b.useEffect(()=>{n.current&&a&&(i==="sphere"?(n.current.maxDistance=8e3,n.current.minDistance=200,n.current.setTarget(0,0,500,!0)):(n.current.maxDistance=n.current.getDistanceToFitSphere(a+200),n.current.minDistance=100))},[a,i,n]),b.useEffect(()=>{l()},[l,i]),b.useEffect(()=>{!t&&n.current&&n.current.setLookAt(ps.x,ps.y,ps.z,0,0,0,!0)},[t]),wt((u,h)=>{n.current&&(!c&&!s&&(n.current.azimuthAngle+=QT*h*Yf.DEG2RAD),n.current.update(h))}),null},JT=({disableAnimations:n})=>{const e=b.useRef(null),{graphStyle:t,data:s,setNearbyNodeIds:i,setDisableCameraRotation:r}=nt(d=>d),[o]=b.useState(.8),{camera:a}=ge(),[c,l,u,h]=Fs(d=>[d.isUserDragging,d.setIsUserDragging,d.isUserScrolling,d.isUserScrollingOnHtmlPanel]);return KT(e,{enabled:!n&&!u&&!c}),b.useEffect(()=>{e.current&&e.current.setLookAt(ps.x,ps.y,ps.z,0,0,0,!0)},[t]),b.useEffect(()=>{if(!c){const d=kc((s==null?void 0:s.nodes)||[],a);d&&i(d)}},[a,a.position,a.position.x,a.position.y,a.position.z,s==null?void 0:s.nodes,i,c]),b.useEffect(()=>{c&&r(!0)},[c,r]),M.jsx(wp,{ref:e,boundaryEnclosesCamera:!0,enabled:!h,makeDefault:!0,maxDistance:12e3,minDistance:100,onEnd:()=>l(!1),onStart:()=>l(!0),smoothTime:o})},Ld=b.memo(({linksPositions:n})=>{const e=kn(r=>r.dataInitial),{showSelectionGraph:t}=nt(r=>r),s=Jt(),i=b.useRef([]);return b.useEffect(()=>{i.current.forEach((r,o)=>{if(r){const a=s?0:.5,c=(s==null?void 0:s.ref_id)===(e==null?void 0:e.links[o].source)||(s==null?void 0:s.ref_id)===(e==null?void 0:e.links[o].target);Tc.fromTo(r.material,{linewidth:5},{linewidth:c?2:a,duration:1})}})},[e,s]),M.jsx("group",{name:"simulation-3d-group__connections",children:e==null?void 0:e.links.map((r,o)=>{var l,u,h,d,f,m;const a=new K(((l=n[o])==null?void 0:l.sx)||0,((u=n[o])==null?void 0:u.sy)||0,((h=n[o])==null?void 0:h.sz)||0),c=new K(((d=n[o])==null?void 0:d.tx)||0,((f=n[o])==null?void 0:f.ty)||0,((m=n[o])==null?void 0:m.tz)||0);return M.jsx(vf,{ref:p=>{i.current[o]=p},color:"rgba(136, 136, 136, 1)",isLine2:!0,lineWidth:1,opacity:1,points:[a,c],transparent:!0,visible:!t},r.ref_id)})})});Ld.displayName="Connections";const Zo={metalness:.9,roughness:0},ek={...Zo};new fr(ek);const zd=new Oo,Co=zd.load("noimage.jpeg"),cu=new fr({...Zo,map:Co}),Bd=.4,tk=new fr({...Zo,map:Co,transparent:!0,opacity:Bd}),jr={},sk=(n,e)=>{const[t,s]=b.useState(Co),[i,r]=b.useState(cu);return b.useEffect(()=>{const o=`${n}${e&&"-transparent"}`;if(jr[o]){s(jr[o].texture),r(jr[o].material);return}zd.load(n,a=>{const c=new fr({map:a,transparent:e,opacity:e?Bd:1,...Zo});jr[o]={texture:a,material:c},s(a),r(c)},void 0,()=>{s(Co),r(e?tk:cu)})},[n,e]),b.useEffect(()=>function(){t.dispose(),i.dispose()},[t,i]),i},Jc=b.memo(({node:n,hide:e,animated:t})=>{const s=b.useRef(null),[i]=b.useState(Ul),r=Jt(),{showSelectionGraph:o}=nt(u=>u),a=!!r&&n.ref_id===r.ref_id,c=sk(n.image_url||"noimage.jpeg",!1);wt((u,h)=>{t&&s.current&&a&&(s.current.rotation.y+=h*1,s.current.rotation.x-=h*.6)}),b.useEffect(()=>function(){i.dispose()},[i]);const l=b.useMemo(()=>o&&a?20:a?(n.scale||1)*1.2:n.scale,[n,a,o]);return M.jsx(Dp,{enabled:!!a,children:M.jsx("mesh",{ref:s,geometry:Ul,material:c,name:n.id,scale:l,userData:n,visible:!e})})});Jc.displayName="Cube";const nk=Ve(Ys)` text-align: center; width: ${n=>n.type==="topic"?"auto":`${n.size}px`}; height: ${n=>n.type==="topic"?"auto":`${n.size}px`}; @@ -568,7 +568,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu top: -7px; left: -14px; } -`,nk=Ve(Ys)` +`,ik=Ve(Ys)` text-align: center; outline: 1px solid ${qe.white}; outline-offset: 0px; @@ -668,7 +668,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu font-weight: 500; border-radius: 6px; margin-right: 5px; -`;const ik=new K,rk=({position:n,userData:e,color:t})=>{const s=b.useRef(null),{selectedNode:i,setSelectedNode:r,showSelectionGraph:o,hoveredNode:a,setHoveredNode:c}=nt(tc(f=>f)),l=((e==null?void 0:e.node_type)||"")==="Topic"||!!e.name,u=((e==null?void 0:e.node_type)||"")==="Guest"||((e==null?void 0:e.node_type)||"")==="Person";wt(()=>{if(o&&s.current){const f=ik.set((e==null?void 0:e.x)||0,(e==null?void 0:e.y)||0,(e==null?void 0:e.z)||0);s.current.position.copy(f)}}),b.useEffect(()=>function(){s.current&&s.current.clear()},[s]);const h=b.useMemo(()=>(a==null?void 0:a.ref_id)===(e==null?void 0:e.ref_id),[a==null?void 0:a.ref_id,e==null?void 0:e.ref_id]),d=(i==null?void 0:i.ref_id)===(e==null?void 0:e.ref_id);return l||d&&o||!d?M.jsx("group",{ref:s,position:n,children:M.jsx(dr,{center:!0,sprite:!0,zIndexRange:[0,0],children:l?M.jsxs(nk,{direction:"column",onClick:f=>{f.stopPropagation(),e&&r(e)},onPointerOut:f=>{f.stopPropagation()},onPointerOver:f=>{f.stopPropagation()},children:[M.jsx("div",{className:"badge-wrapper",children:M.jsx(nl,{type:(e==null?void 0:e.node_type)||""})}),pu(e==null?void 0:e.name,20)]}):M.jsxs(sk,{className:Kd(e==null?void 0:e.node_type,{selected:d}),color:t,fontColor:qe.white,fontSize:l?64:20,onClick:f=>{f.stopPropagation(),e&&r(e)},onPointerOut:f=>{f.stopPropagation()},onPointerOver:f=>{f.stopPropagation()},scale:h?1.05:1,selected:!1,size:d?68:40,type:(e==null?void 0:e.node_type)||"",children:[!u&&!l?M.jsx("div",{className:"badge-wrapper",children:M.jsx(nl,{type:(e==null?void 0:e.node_type)||""})}):null,e!=null&&e.name?e==null?void 0:e.name:M.jsx(Xf,{rounded:u,size:d?60:52,src:(e==null?void 0:e.image_url)||"audio_default.svg",type:e==null?void 0:e.node_type})]})})}):null},Vd=b.memo(()=>{const{simulation:n,showSelectionGraph:e,selectedNode:t,selectionGraphData:s}=nt(tc(o=>o)),i=Eo(),r=b.useMemo(()=>{const o=(n==null?void 0:n.nodes())||[];return(e?s.nodes:o).filter(u=>i.includes((u==null?void 0:u.ref_id)||"")||(t==null?void 0:t.ref_id)===(u==null?void 0:u.ref_id)).slice(0,q_).map(u=>{const h=fu(u.node_type||"",!0),d=new K((u==null?void 0:u.x)||0,(u==null?void 0:u.y)||0,(u==null?void 0:u.z)||0),f=o.filter(m=>m.ref_id&&W_(m,u)).map(m=>(m==null?void 0:m.ref_id)||"")||[];return M.jsx(rk,{color:h,position:d,relativeIds:f,userData:u},`node-badge-${u.ref_id}`)})},[n,e,s.nodes,i,t==null?void 0:t.ref_id]);return M.jsx(b.Fragment,{children:r.length?r:null},"node-badges")});Vd.displayName="RelevanceBadges";const lu=Jd().stop(),mt={numDimensions:3,velocityDecay:.9,forceChargeStrength:-20,forceChargeMinDistance:10,forceChargeMaxDistance:8e3,forceLinkStrength:.04,forceCenterStrength:.85,disableCollide:!1,disableCenter:!1,disableLink:!1,disableCharge:!1,forceCollideRadiusMethod:n=>(n.edge_count||1)*6+200,forceLinkDistanceMethod:n=>{const e=n.source.node_type;let t=50;switch(e){case"topic":t=30;break;case"guest":t=30;break;case"clip":t=10;break;case"episode":t=15;break}return t*2/50}},ok=(n,e,{numDimensions:t=mt.numDimensions,velocityDecay:s=mt.velocityDecay,forceChargeStrength:i=mt.forceChargeStrength,forceChargeMinDistance:r=mt.forceChargeMinDistance,forceChargeMaxDistance:o=mt.forceChargeMaxDistance,forceLinkStrength:a=mt.forceLinkStrength,forceCenterStrength:c=mt.forceCenterStrength,forceLinkDistanceMethod:l=mt.forceLinkDistanceMethod,forceCollideRadiusMethod:u=mt.forceCollideRadiusMethod,disableCollide:h=mt.disableCollide,disableCenter:d=mt.disableCenter,disableLink:f=mt.disableLink,disableCharge:m=mt.disableCharge})=>(lu.alpha(1).stop().numDimensions(t).velocityDecay(s).force("collide",h?null:ef().radius(u).iterations(1)).force("center",d?null:tf().strength(c)).force("charge",m?null:sf().strength(i).distanceMin(r).distanceMax(o)).nodes(n).force("link",f?null:nf(e).id(p=>p.ref_id).distance(l).strength(a)).alpha(1).restart(),lu),ak=({link:n,animated:e})=>{const t=b.useRef(null),s=Jt(),[i,r]=b.useState(new K(0,0,0)),[o,a]=b.useState(new K(0,0,0)),[c,l]=b.useState(8947848),u=nt(h=>h.selectionGraphData);return b.useEffect(()=>{var f,m,p,g,y,w;const h=(s==null?void 0:s.ref_id)||"",d=s&&(h===n.target||h===n.source);!n.onlyVisibleOnSelect||d?(r(new K(((f=n.sourcePosition)==null?void 0:f.x)||0,((m=n.sourcePosition)==null?void 0:m.y)||0,((p=n.sourcePosition)==null?void 0:p.z)||0)),a(new K(((g=n.targetPosition)==null?void 0:g.x)||0,((y=n.targetPosition)==null?void 0:y.y)||0,((w=n.targetPosition)==null?void 0:w.z)||0))):(r(new K(0,0,0)),a(new K(0,0,0))),l(d?n.color||rf.children.segmentColor:s?5592405:8947848)},[s,n]),wt(()=>{if(e&&t.current){const h=u.nodes.find(f=>f.ref_id===n.source),d=u.nodes.find(f=>f.ref_id===n.target);t.current.start.set((h==null?void 0:h.x)||0,(h==null?void 0:h.y)||0,(h==null?void 0:h.z)||0),t.current.end.set((d==null?void 0:d.x)||0,(d==null?void 0:d.y)||0,(d==null?void 0:d.z)||0)}}),M.jsx(M.Fragment,{children:M.jsx(Cp,{ref:t,color:"0xFFFFFF",end:o,start:i})})},ck=({links:n,simulation:e})=>{const t=b.useRef(null);return b.useEffect(()=>function(){t.current&&t.current.clear()},[t]),wt(()=>{if(t.current){const s=e.nodes();t.current.children.forEach((r,o)=>{var u;const a=n[o],c=s.find(h=>a.source===h.ref_id),l=s.find(h=>a.target===h.ref_id);(u=r.position)==null||u.set((c.x+l.x)/2,(c.y+l.y)/2,(c.z+l.z)/2)})}}),n.length?M.jsx("group",{ref:t,children:n.map(s=>M.jsx("mesh",{children:M.jsx(dr,{center:!0,sprite:!0,children:M.jsxs(lk,{direction:"row",justify:"center",onClick:i=>{i.stopPropagation()},onPointerOut:i=>{i.stopPropagation()},onPointerOver:i=>{i.stopPropagation()},children:[M.jsx("span",{children:s.edge_type}),M.jsx(Ys,{className:"icon",onClick:()=>console.log(123),children:M.jsx($f,{})})]})})},s.ref_id))}):null},lk=Ve(Ys)` +`;const rk=new K,ok=({position:n,userData:e,color:t})=>{const s=b.useRef(null),{selectedNode:i,setSelectedNode:r,showSelectionGraph:o,hoveredNode:a,setHoveredNode:c}=nt(tc(f=>f)),l=((e==null?void 0:e.node_type)||"")==="Topic"||!!e.name,u=((e==null?void 0:e.node_type)||"")==="Guest"||((e==null?void 0:e.node_type)||"")==="Person";wt(()=>{if(o&&s.current){const f=rk.set((e==null?void 0:e.x)||0,(e==null?void 0:e.y)||0,(e==null?void 0:e.z)||0);s.current.position.copy(f)}}),b.useEffect(()=>function(){s.current&&s.current.clear()},[s]);const h=b.useMemo(()=>(a==null?void 0:a.ref_id)===(e==null?void 0:e.ref_id),[a==null?void 0:a.ref_id,e==null?void 0:e.ref_id]),d=(i==null?void 0:i.ref_id)===(e==null?void 0:e.ref_id);return l||d&&o||!d?M.jsx("group",{ref:s,position:n,children:M.jsx(dr,{center:!0,sprite:!0,zIndexRange:[0,0],children:l?M.jsxs(ik,{direction:"column",onClick:f=>{f.stopPropagation(),e&&r(e)},onPointerOut:f=>{f.stopPropagation()},onPointerOver:f=>{f.stopPropagation()},children:[M.jsx("div",{className:"badge-wrapper",children:M.jsx(nl,{type:(e==null?void 0:e.node_type)||""})}),pu(e==null?void 0:e.name,20)]}):M.jsxs(nk,{className:Kd(e==null?void 0:e.node_type,{selected:d}),color:t,fontColor:qe.white,fontSize:l?64:20,onClick:f=>{f.stopPropagation(),e&&r(e)},onPointerOut:f=>{f.stopPropagation()},onPointerOver:f=>{f.stopPropagation()},scale:h?1.05:1,selected:!1,size:d?68:40,type:(e==null?void 0:e.node_type)||"",children:[!u&&!l?M.jsx("div",{className:"badge-wrapper",children:M.jsx(nl,{type:(e==null?void 0:e.node_type)||""})}):null,e!=null&&e.name?e==null?void 0:e.name:M.jsx(Xf,{rounded:u,size:d?60:52,src:(e==null?void 0:e.image_url)||"audio_default.svg",type:e==null?void 0:e.node_type})]})})}):null},Vd=b.memo(()=>{const{simulation:n,showSelectionGraph:e,selectedNode:t,selectionGraphData:s}=nt(tc(o=>o)),i=Eo(),r=b.useMemo(()=>{const o=(n==null?void 0:n.nodes())||[];return(e?s.nodes:o).filter(u=>i.includes((u==null?void 0:u.ref_id)||"")||(t==null?void 0:t.ref_id)===(u==null?void 0:u.ref_id)).slice(0,W_).map(u=>{const h=fu(u.node_type||"",!0),d=new K((u==null?void 0:u.x)||0,(u==null?void 0:u.y)||0,(u==null?void 0:u.z)||0),f=o.filter(m=>m.ref_id&&G_(m,u)).map(m=>(m==null?void 0:m.ref_id)||"")||[];return M.jsx(ok,{color:h,position:d,relativeIds:f,userData:u},`node-badge-${u.ref_id}`)})},[n,e,s.nodes,i,t==null?void 0:t.ref_id]);return M.jsx(b.Fragment,{children:r.length?r:null},"node-badges")});Vd.displayName="RelevanceBadges";const lu=Jd().stop(),mt={numDimensions:3,velocityDecay:.9,forceChargeStrength:-20,forceChargeMinDistance:10,forceChargeMaxDistance:8e3,forceLinkStrength:.04,forceCenterStrength:.85,disableCollide:!1,disableCenter:!1,disableLink:!1,disableCharge:!1,forceCollideRadiusMethod:n=>(n.edge_count||1)*6+200,forceLinkDistanceMethod:n=>{const e=n.source.node_type;let t=50;switch(e){case"topic":t=30;break;case"guest":t=30;break;case"clip":t=10;break;case"episode":t=15;break}return t*2/50}},ak=(n,e,{numDimensions:t=mt.numDimensions,velocityDecay:s=mt.velocityDecay,forceChargeStrength:i=mt.forceChargeStrength,forceChargeMinDistance:r=mt.forceChargeMinDistance,forceChargeMaxDistance:o=mt.forceChargeMaxDistance,forceLinkStrength:a=mt.forceLinkStrength,forceCenterStrength:c=mt.forceCenterStrength,forceLinkDistanceMethod:l=mt.forceLinkDistanceMethod,forceCollideRadiusMethod:u=mt.forceCollideRadiusMethod,disableCollide:h=mt.disableCollide,disableCenter:d=mt.disableCenter,disableLink:f=mt.disableLink,disableCharge:m=mt.disableCharge})=>(lu.alpha(1).stop().numDimensions(t).velocityDecay(s).force("collide",h?null:ef().radius(u).iterations(1)).force("center",d?null:tf().strength(c)).force("charge",m?null:sf().strength(i).distanceMin(r).distanceMax(o)).nodes(n).force("link",f?null:nf(e).id(p=>p.ref_id).distance(l).strength(a)).alpha(1).restart(),lu),ck=({link:n,animated:e})=>{const t=b.useRef(null),s=Jt(),[i,r]=b.useState(new K(0,0,0)),[o,a]=b.useState(new K(0,0,0)),[c,l]=b.useState(8947848),u=nt(h=>h.selectionGraphData);return b.useEffect(()=>{var f,m,p,g,y,w;const h=(s==null?void 0:s.ref_id)||"",d=s&&(h===n.target||h===n.source);!n.onlyVisibleOnSelect||d?(r(new K(((f=n.sourcePosition)==null?void 0:f.x)||0,((m=n.sourcePosition)==null?void 0:m.y)||0,((p=n.sourcePosition)==null?void 0:p.z)||0)),a(new K(((g=n.targetPosition)==null?void 0:g.x)||0,((y=n.targetPosition)==null?void 0:y.y)||0,((w=n.targetPosition)==null?void 0:w.z)||0))):(r(new K(0,0,0)),a(new K(0,0,0))),l(d?n.color||rf.children.segmentColor:s?5592405:8947848)},[s,n]),wt(()=>{if(e&&t.current){const h=u.nodes.find(f=>f.ref_id===n.source),d=u.nodes.find(f=>f.ref_id===n.target);t.current.start.set((h==null?void 0:h.x)||0,(h==null?void 0:h.y)||0,(h==null?void 0:h.z)||0),t.current.end.set((d==null?void 0:d.x)||0,(d==null?void 0:d.y)||0,(d==null?void 0:d.z)||0)}}),M.jsx(M.Fragment,{children:M.jsx(bp,{ref:t,color:"0xFFFFFF",end:o,start:i})})},lk=({links:n,simulation:e})=>{const t=b.useRef(null);return b.useEffect(()=>function(){t.current&&t.current.clear()},[t]),wt(()=>{if(t.current){const s=e.nodes();t.current.children.forEach((r,o)=>{var u;const a=n[o],c=s.find(h=>a.source===h.ref_id),l=s.find(h=>a.target===h.ref_id);(u=r.position)==null||u.set((c.x+l.x)/2,(c.y+l.y)/2,(c.z+l.z)/2)})}}),n.length?M.jsx("group",{ref:t,children:n.map(s=>M.jsx("mesh",{children:M.jsx(dr,{center:!0,sprite:!0,children:M.jsxs(uk,{direction:"row",justify:"center",onClick:i=>{i.stopPropagation()},onPointerOut:i=>{i.stopPropagation()},onPointerOver:i=>{i.stopPropagation()},children:[M.jsx("span",{children:s.edge_type}),M.jsx(Ys,{className:"icon",onClick:()=>console.log(123),children:M.jsx($f,{})})]})})},s.ref_id))}):null},uk=Ve(Ys)` text-align: center; outline-offset: 0px; @@ -719,7 +719,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu top: -7px; left: -14px; } -`,uk=["#fff","#9747FF","#00887A","#0098A6","#0288D1","#33691E","#465A65","#512DA7","#5C6BC0","#5D4038","#662C00","#689F39","#6B1B00","#750000","#78909C","#7E57C2","#8C6E63","#AA47BC","#BF360C","#C2175B","#EC407A","#EF6C00","#F5511E","#FF9696","#FFC064","#FFCD29","#FFEA60"],el=b.memo(({node:n,hide:e})=>{const t=b.useRef(null),s=Jt(),r=Eo().includes((n==null?void 0:n.ref_id)||""),o=!!s&&(s==null?void 0:s.ref_id)===n.ref_id,a=nt(h=>h.showSelectionGraph),c=of();wt(({camera:h})=>{t!=null&&t.current&&t.current.quaternion.copy(h.quaternion)}),b.useMemo(()=>{let h=(n.edge_count||30)*4;return a&&o?h=40:!o&&r&&(h=0),h},[n.edge_count,o,r,a]);const l=b.useMemo(()=>s&&s.node_type==="Topic"&&!o?.2:1,[o,s]),u=uk[c.indexOf(n.node_type)]||qe.white;return M.jsx(M.Fragment,{children:M.jsx(yf,{ref:t,anchorX:"center",anchorY:"middle",color:u,fillOpacity:l,scale:20,userData:n,visible:!e,...xf,children:pu(n.name,10)})})});el.displayName="TextNode";const jd=b.memo(()=>{const[n,e]=b.useState(null),{dataInitial:t}=kn(l=>l),s=Jt(),i=b.useRef(null),r=Eo(),o=Tf(t==null?void 0:t.nodes.length),{selectionGraphData:a,setSelectionData:c}=nt(tc(l=>l));return b.useEffect(()=>{const l=structuredClone((t==null?void 0:t.nodes)||[]),u=structuredClone((t==null?void 0:t.links)||[]);if(o===l.length||!r.length)return;const h=l.filter(d=>d.ref_id===(s==null?void 0:s.ref_id)||r.includes((d==null?void 0:d.ref_id)||"")).map(d=>{const f=d.ref_id===(s==null?void 0:s.ref_id)?{fx:0,fy:0,fz:0}:{};return{...d,x:0,y:0,z:0,...f}});if(h){const d=u.filter(f=>h.some(m=>m.ref_id===f.target)&&h.some(m=>m.ref_id===f.source));c({nodes:h,links:d})}},[t,s,r,c,o]),b.useEffect(()=>{if(n||!a.nodes.length)return;const l=structuredClone(a.links),u=ok(a.nodes,l,{numDimensions:2,forceLinkStrength:.01,forceCenterStrength:.85,forceChargeStrength:-20,velocityDecay:.9});e(u)},[a,n]),b.useEffect(()=>()=>{c({nodes:[],links:[]})},[c]),wt(()=>{}),b.useEffect(()=>{n&&n.on("tick",()=>{i.current&&i.current.children.forEach((u,h)=>{const d=n.nodes()[h];d&&u.position.set(d.x,d.y,d.z)})})},[n]),M.jsxs(M.Fragment,{children:[M.jsx("group",{ref:i,name:"simulation-2d-group",children:a==null?void 0:a.nodes.map(l=>M.jsx("mesh",{children:l.name?M.jsx(el,{hide:!0,node:l},l.ref_id||l.id):M.jsx(Jc,{hide:!0,node:l},l.ref_id||l.id)},l.ref_id))}),M.jsx(wp,{fog:!0,lineWidth:.9,children:(a==null?void 0:a.links).map((l,u)=>M.jsx(ak,{animated:!0,link:l},u.toString()))},`selection-links-${a==null?void 0:a.links.length}`),n&&M.jsx(ck,{links:a.links,simulation:n})]})});jd.displayName="SelectionDataNodes";const Hd=b.memo(()=>{const n=Jt(),e=Eo(),{selectionGraphData:t,showSelectionGraph:s,setHoveredNode:i}=nt(d=>d),r=kn(d=>d.dataInitial),o=bo(d=>d.setTranscriptOpen),a=b.useCallback(d=>!!(s&&!t.nodes.find(f=>f.ref_id===d.ref_id)),[s,t]),c=b.useCallback(d=>{const f=d==null?void 0:d[0];f&&(o(!1),f.userData&&(a(f.userData)||nt.getState().setSelectedNode((f==null?void 0:f.userData)||null)))},[o,a]),l=b.useCallback(d=>{d.stopPropagation()},[i]),u=b.useCallback(d=>{var p;const m=d.intersections.map(g=>g.object)[0];if((p=m==null?void 0:m.userData)!=null&&p.ref_id){const g=m.userData;a(g)||(d.stopPropagation(),i(g))}},[i,a]),h=s&&!!n;return M.jsxs(gp,{filter:d=>d.filter(f=>{var m;return!!((m=f.userData)!=null&&m.ref_id)}),onChange:c,onPointerOut:l,onPointerOver:u,children:[!1,M.jsx(Vd,{}),M.jsx("group",{name:"simulation-3d-group__nodes",children:r==null?void 0:r.nodes.map(d=>{const f=!!n&&(e.includes(d.ref_id)||n.ref_id===d.ref_id);return M.jsx("mesh",{children:d.name?M.jsx(el,{hide:h||f,node:d},d.ref_id||d.id):M.jsx(Jc,{hide:h,node:d},d.ref_id||d.id)},d.ref_id)})}),h&&M.jsx(jd,{})]})});Hd.displayName="Cubes";const hk={earthRef:null},dk=hu(n=>({...hk,setEarthRef:e=>n({earthRef:e})})),fk=new K(0,0,0),pk=()=>{const n=b.useRef(null),e=b.useRef(null),{graphStyle:t,showSelectionGraph:s}=nt(a=>a),i=dk(a=>a.setEarthRef),r=cn("textures/earth/galaxy.png"),o=cn("textures/earth/clouds.png");return wt(({camera:a})=>{e.current&&e.current.position.copy(a.getWorldPosition(fk))}),b.useLayoutEffect(()=>{n.current&&i(n)},[i]),t!=="earth"||s?null:M.jsxs(M.Fragment,{children:[M.jsxs("mesh",{ref:n,userData:{type:"earth"},children:[M.jsx("sphereGeometry",{args:[Vr,200,200]}),M.jsx(mk,{})]}),M.jsxs("mesh",{children:[M.jsx("sphereGeometry",{args:[Vr+2,200,200]}),M.jsx("meshStandardMaterial",{alphaMap:o,map:o,transparent:!0})]}),M.jsxs("mesh",{children:[M.jsx("sphereGeometry",{args:[Vr*4,200,200]}),M.jsx("meshStandardMaterial",{map:r,opacity:.4,side:Ri,transparent:!0})]}),M.jsx("directionalLight",{ref:e,intensity:.9,position:[0,0,Vr*3]})]})},mk=()=>{const n=cn("textures/earth/earth.jpeg"),e=cn("textures/earth/bump.jpeg"),t=cn("textures/earth/water.png"),s=b.useMemo(()=>new fr({map:n,bumpMap:e,aoMap:e,roughnessMap:e,metalnessMap:t,toneMapped:!0,roughness:35,metalness:0}),[n,e,t]);return M.jsx("meshStandardMaterial",{...s})},_k="C",gk=256,vk=256,yk={g:"LottieFiles AE 0.1.20"},xk=[{ty:0,nm:"I",sr:1,st:0,op:26,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_0",ind:1},{ty:0,nm:"I",sr:1,st:26,op:52,ip:26,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_1",ind:2},{ty:0,nm:"I",sr:1,st:52,op:78,ip:52,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_2",ind:3},{ty:0,nm:"I",sr:1,st:78,op:108,ip:78,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_3",ind:4}],Tk="5.5.7",kk=60,wk=104,Sk=0,Ck=[{nm:"",id:"comp_0",layers:[{ty:4,nm:"I",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.656,.016],[0,20],[-34.641,0],[.016,-19.984]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,10],[17.321,30],[17.321,-10],[51.962,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,-9.984],[17.32,10],[17.32,-30],[-17.32,-50.016]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,30],[17.32,50],[17.305,10],[-17.32,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.321,10],[-51.962,30],[-51.962,-10],[-17.321,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[0,20],[-34.641,0],[0,-20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:1}]},{nm:"",id:"comp_1",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"S",sr:1,st:-20,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,-10.016],[-17.32,-30],[17.32,-50],[51.961,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[.015,-20],[0,20],[34.641,40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,-10.016],[-17.32,-30],[17.32,-50],[51.961,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:33,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.324,30],[-17.34,-9.984],[17.336,-30.016],[17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:35,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[.015,-20],[0,20],[34.641,40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.324,30],[-17.34,-9.984],[17.336,-30.016],[17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.305,30],[-17.336,-9.984],[17.336,-30.016],[17.32,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.016,-20.016],[-34.643,-40],[-34.641,.016],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:31,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,-10],[17.321,30],[-17.321,10],[-17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.305,50],[-51.961,30],[-17.321,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:10,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:34,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.305,30],[-17.336,-9.984],[17.336,-30.016],[17.32,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:11,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,-10],[17.321,30],[-17.321,10],[-17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.305,50],[-51.961,30],[-17.321,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:12,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.016,-20.016],[-34.643,-40],[-34.641,.016],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:13,parent:1}]},{nm:"",id:"comp_2",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"T",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-34.656,.031],[.047,-19.969],[34.652,.031],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[17.32,-9.984],[17.32,-50],[-17.32,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"F",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.321,30],[-51.962,10],[-51.962,-30],[-17.321,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"S",sr:1,st:0,op:30,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[17.32,-9.984],[17.32,-50],[-17.32,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"F",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,30],[17.321,10],[17.321,-30],[51.962,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"S",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,50],[17.32,30],[17.336,-10],[-17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"F",sr:1,st:0,op:30,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,30],[17.321,10],[17.321,-30],[51.962,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"T",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-34.656,0],[.015,-20],[34.656,0],[.012,20.062]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1}]},{nm:"",id:"comp_3",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"S",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-10],[-17.32,-30.016],[-51.961,-10],[-17.305,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"T",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.015,60.016],[-34.642,40],[-34.641,0],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[-17.32,-30],[17.32,-10],[17.32,30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.312,-10],[-17.313,10],[17.332,30],[51.977,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"F",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-29.984],[17.348,10],[-17.305,30],[-17.305,-9.984]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"F",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-30],[17.32,10],[-17.32,30],[-17.336,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-10],[-17.32,-30.016],[-51.961,-10],[-17.305,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"T",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[0,-20],[0,-60.016],[34.641,-40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"S",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[-17.32,-30],[17.32,-10],[17.32,30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.312,-10],[-17.313,10],[17.332,30],[51.977,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1},{ty:4,nm:"F",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-30],[17.32,10],[-17.32,30],[-17.336,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:10,parent:1}]}],bk={nm:_k,h:gk,w:vk,meta:yk,layers:xk,v:Tk,fr:kk,op:wk,ip:Sk,assets:Ck},Ek=({meshId:n})=>{const e=b.useRef(null);return b.useEffect(()=>{const t=document.getElementById(`lottie-animation-${n}`);return t&&(e.current=af.loadAnimation({container:t,animationData:bk,loop:!0,autoplay:!0})),()=>{e.current&&e.current.destroy()}},[n]),M.jsx("div",{id:`lottie-animation-${n}`,style:{width:"2em",height:"2em"}})},xa=()=>Math.floor(Math.random()*2001)-1e3,Ok=()=>M.jsx(M.Fragment,{children:["a","b","c"].map(n=>{const e=xa(),t=xa(),s=xa();return M.jsx("mesh",{position:[e,t,s],children:M.jsx(dr,{center:!0,sprite:!0,children:M.jsx(Ak,{children:M.jsx(Ek,{meshId:n})})})},n)})}),Ak=Ve.div` +`,hk=["#fff","#9747FF","#00887A","#0098A6","#0288D1","#33691E","#465A65","#512DA7","#5C6BC0","#5D4038","#662C00","#689F39","#6B1B00","#750000","#78909C","#7E57C2","#8C6E63","#AA47BC","#BF360C","#C2175B","#EC407A","#EF6C00","#F5511E","#FF9696","#FFC064","#FFCD29","#FFEA60"],el=b.memo(({node:n,hide:e})=>{const t=b.useRef(null),s=Jt(),r=Eo().includes((n==null?void 0:n.ref_id)||""),o=!!s&&(s==null?void 0:s.ref_id)===n.ref_id,a=nt(f=>f.showSelectionGraph),[c]=Qf(f=>[f.getPrimaryColorByType]),l=of();wt(({camera:f})=>{t!=null&&t.current&&t.current.quaternion.copy(f.quaternion)}),b.useMemo(()=>{let f=(n.edge_count||30)*4;return a&&o?f=40:!o&&r&&(f=0),f},[n.edge_count,o,r,a]);const u=b.useMemo(()=>s&&s.node_type==="Topic"&&!o?.2:1,[o,s]),d=c(n.node_type)??(hk[l.indexOf(n.node_type)]||qe.white);return M.jsx(M.Fragment,{children:M.jsx(yf,{ref:t,anchorX:"center",anchorY:"middle",color:d,fillOpacity:u,scale:20,userData:n,visible:!e,...xf,children:pu(n.name,10)})})});el.displayName="TextNode";const jd=b.memo(()=>{const[n,e]=b.useState(null),{dataInitial:t}=kn(l=>l),s=Jt(),i=b.useRef(null),r=Eo(),o=Tf(t==null?void 0:t.nodes.length),{selectionGraphData:a,setSelectionData:c}=nt(tc(l=>l));return b.useEffect(()=>{const l=structuredClone((t==null?void 0:t.nodes)||[]),u=structuredClone((t==null?void 0:t.links)||[]);if(o===l.length||!r.length)return;const h=l.filter(d=>d.ref_id===(s==null?void 0:s.ref_id)||r.includes((d==null?void 0:d.ref_id)||"")).map(d=>{const f=d.ref_id===(s==null?void 0:s.ref_id)?{fx:0,fy:0,fz:0}:{};return{...d,x:0,y:0,z:0,...f}});if(h){const d=u.filter(f=>h.some(m=>m.ref_id===f.target)&&h.some(m=>m.ref_id===f.source));c({nodes:h,links:d})}},[t,s,r,c,o]),b.useEffect(()=>{if(n||!a.nodes.length)return;const l=structuredClone(a.links),u=ak(a.nodes,l,{numDimensions:2,forceLinkStrength:.01,forceCenterStrength:.85,forceChargeStrength:-20,velocityDecay:.9});e(u)},[a,n]),b.useEffect(()=>()=>{c({nodes:[],links:[]})},[c]),wt(()=>{}),b.useEffect(()=>{n&&n.on("tick",()=>{i.current&&i.current.children.forEach((u,h)=>{const d=n.nodes()[h];d&&u.position.set(d.x,d.y,d.z)})})},[n]),M.jsxs(M.Fragment,{children:[M.jsx("group",{ref:i,name:"simulation-2d-group",children:a==null?void 0:a.nodes.map(l=>M.jsx("mesh",{children:l.name?M.jsx(el,{hide:!0,node:l},l.ref_id||l.id):M.jsx(Jc,{hide:!0,node:l},l.ref_id||l.id)},l.ref_id))}),M.jsx(Sp,{fog:!0,lineWidth:.9,children:(a==null?void 0:a.links).map((l,u)=>M.jsx(ck,{animated:!0,link:l},u.toString()))},`selection-links-${a==null?void 0:a.links.length}`),n&&M.jsx(lk,{links:a.links,simulation:n})]})});jd.displayName="SelectionDataNodes";const Hd=b.memo(()=>{const n=Jt(),e=Eo(),{selectionGraphData:t,showSelectionGraph:s,setHoveredNode:i}=nt(d=>d),r=kn(d=>d.dataInitial),o=bo(d=>d.setTranscriptOpen),a=b.useCallback(d=>!!(s&&!t.nodes.find(f=>f.ref_id===d.ref_id)),[s,t]),c=b.useCallback(d=>{const f=d==null?void 0:d[0];f&&(o(!1),f.userData&&(a(f.userData)||nt.getState().setSelectedNode((f==null?void 0:f.userData)||null)))},[o,a]),l=b.useCallback(d=>{d.stopPropagation()},[i]),u=b.useCallback(d=>{var p;const m=d.intersections.map(g=>g.object)[0];if((p=m==null?void 0:m.userData)!=null&&p.ref_id){const g=m.userData;a(g)||(d.stopPropagation(),i(g))}},[i,a]),h=s&&!!n;return M.jsxs(vp,{filter:d=>d.filter(f=>{var m;return!!((m=f.userData)!=null&&m.ref_id)}),onChange:c,onPointerOut:l,onPointerOver:u,children:[!1,M.jsx(Vd,{}),M.jsx("group",{name:"simulation-3d-group__nodes",children:r==null?void 0:r.nodes.map(d=>{const f=!!n&&(e.includes(d.ref_id)||n.ref_id===d.ref_id);return M.jsx("mesh",{children:d.name?M.jsx(el,{hide:h||f,node:d},d.ref_id||d.id):M.jsx(Jc,{hide:h,node:d},d.ref_id||d.id)},d.ref_id)})}),h&&M.jsx(jd,{})]})});Hd.displayName="Cubes";const dk={earthRef:null},fk=hu(n=>({...dk,setEarthRef:e=>n({earthRef:e})})),pk=new K(0,0,0),mk=()=>{const n=b.useRef(null),e=b.useRef(null),{graphStyle:t,showSelectionGraph:s}=nt(a=>a),i=fk(a=>a.setEarthRef),r=cn("textures/earth/galaxy.png"),o=cn("textures/earth/clouds.png");return wt(({camera:a})=>{e.current&&e.current.position.copy(a.getWorldPosition(pk))}),b.useLayoutEffect(()=>{n.current&&i(n)},[i]),t!=="earth"||s?null:M.jsxs(M.Fragment,{children:[M.jsxs("mesh",{ref:n,userData:{type:"earth"},children:[M.jsx("sphereGeometry",{args:[Vr,200,200]}),M.jsx(_k,{})]}),M.jsxs("mesh",{children:[M.jsx("sphereGeometry",{args:[Vr+2,200,200]}),M.jsx("meshStandardMaterial",{alphaMap:o,map:o,transparent:!0})]}),M.jsxs("mesh",{children:[M.jsx("sphereGeometry",{args:[Vr*4,200,200]}),M.jsx("meshStandardMaterial",{map:r,opacity:.4,side:Ri,transparent:!0})]}),M.jsx("directionalLight",{ref:e,intensity:.9,position:[0,0,Vr*3]})]})},_k=()=>{const n=cn("textures/earth/earth.jpeg"),e=cn("textures/earth/bump.jpeg"),t=cn("textures/earth/water.png"),s=b.useMemo(()=>new fr({map:n,bumpMap:e,aoMap:e,roughnessMap:e,metalnessMap:t,toneMapped:!0,roughness:35,metalness:0}),[n,e,t]);return M.jsx("meshStandardMaterial",{...s})},gk="C",vk=256,yk=256,xk={g:"LottieFiles AE 0.1.20"},Tk=[{ty:0,nm:"I",sr:1,st:0,op:26,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_0",ind:1},{ty:0,nm:"I",sr:1,st:26,op:52,ip:26,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_1",ind:2},{ty:0,nm:"I",sr:1,st:52,op:78,ip:52,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_2",ind:3},{ty:0,nm:"I",sr:1,st:78,op:108,ip:78,hasMask:!1,ao:0,ks:{a:{a:0,k:[128,128,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],w:256,h:256,refId:"comp_3",ind:4}],kk="5.5.7",wk=60,Sk=104,Ck=0,bk=[{nm:"",id:"comp_0",layers:[{ty:4,nm:"I",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.656,.016],[0,20],[-34.641,0],[.016,-19.984]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,10],[17.321,30],[17.321,-10],[51.962,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,-9.984],[17.32,10],[17.32,-30],[-17.32,-50.016]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,30],[17.32,50],[17.305,10],[-17.32,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.321,10],[-51.962,30],[-51.962,-10],[-17.321,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[0,20],[-34.641,0],[0,-20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:1}]},{nm:"",id:"comp_1",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"S",sr:1,st:-20,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,-10.016],[-17.32,-30],[17.32,-50],[51.961,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[.015,-20],[0,20],[34.641,40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,-10.016],[-17.32,-30],[17.32,-50],[51.961,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:33,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.324,30],[-17.34,-9.984],[17.336,-30.016],[17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:35,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[.015,-20],[0,20],[34.641,40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.324,30],[-17.34,-9.984],[17.336,-30.016],[17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.305,30],[-17.336,-9.984],[17.336,-30.016],[17.32,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.016,-20.016],[-34.643,-40],[-34.641,.016],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:31,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,-10],[17.321,30],[-17.321,10],[-17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.305,50],[-51.961,30],[-17.321,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:10,parent:1},{ty:4,nm:"F",sr:1,st:-20,op:34,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.305,30],[-17.336,-9.984],[17.336,-30.016],[17.32,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:11,parent:1},{ty:4,nm:"S",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,-10],[17.321,30],[-17.321,10],[-17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.305,50],[-51.961,30],[-17.321,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:12,parent:1},{ty:4,nm:"T",sr:1,st:-20,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.016,-20.016],[-34.643,-40],[-34.641,.016],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:13,parent:1}]},{nm:"",id:"comp_2",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"T",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-34.656,.031],[.047,-19.969],[34.652,.031],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[17.32,-9.984],[17.32,-50],[-17.32,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"F",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.321,30],[-51.962,10],[-51.962,-30],[-17.321,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"S",sr:1,st:0,op:30,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,30],[-17.32,10],[-17.32,-30],[17.32,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[17.32,-9.984],[17.32,-50],[-17.32,-30]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"F",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,30],[17.321,10],[17.321,-30],[51.962,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"S",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,50],[17.32,30],[17.336,-10],[-17.336,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"F",sr:1,st:0,op:30,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[51.962,30],[17.321,10],[17.321,-30],[51.962,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"T",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-34.656,0],[.015,-20],[34.656,0],[.012,20.062]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1}]},{nm:"",id:"comp_3",layers:[{ty:4,nm:"R",sr:1,st:0,op:30,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[128,128,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:0}},ef:[],shapes:[],ind:1},{ty:4,nm:"S",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-10],[-17.32,-30.016],[-51.961,-10],[-17.305,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:2,parent:1},{ty:4,nm:"T",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[.015,60.016],[-34.642,40],[-34.641,0],[0,20]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,30]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:3,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[-17.32,-30],[17.32,-10],[17.32,30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.312,-10],[-17.313,10],[17.332,30],[51.977,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:4,parent:1},{ty:4,nm:"F",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,10],[-17.321,30],[-17.321,-10],[17.321,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-29.984],[17.348,10],[-17.305,30],[-17.305,-9.984]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:5,parent:1},{ty:4,nm:"F",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-30],[17.32,10],[-17.32,30],[-17.336,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:6,parent:1},{ty:4,nm:"S",sr:1,st:0,op:13,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.321,30],[-17.321,10],[-17.321,-30],[17.321,-10]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-10],[-17.32,-30.016],[-51.961,-10],[-17.305,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[61.962,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:7,parent:1},{ty:4,nm:"T",sr:1,st:0,op:32,ip:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"T",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,20],[-34.641,0],[0,-20],[34.641,0]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[34.641,0],[0,-20],[0,-60.016],[34.641,-40]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[44.641,70]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:8,parent:1},{ty:4,nm:"S",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"S",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[-17.32,10],[-17.32,-30],[17.32,-10],[17.32,30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.312,-10],[-17.313,10],[17.332,30],[51.977,10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,60]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:9,parent:1},{ty:4,nm:"F",sr:1,st:0,op:32,ip:13,hasMask:!1,ao:0,ks:{a:{a:0,k:[44.641,50,0]},s:{a:0,k:[100,100,100]},sk:{a:0,k:0},p:{a:0,k:[0,0,0]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},ef:[],shapes:[{ty:"gr",nm:"F",it:[{ty:"sh",nm:"P",d:1,ks:{a:1,k:[{o:{x:.8,y:0},i:{x:.2,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.32,10],[-17.32,30],[-17.32,-10],[17.32,-30]]}],t:0},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[17.336,-30],[17.32,10],[-17.32,30],[-17.336,-10]]}],t:26}]}},{ty:"st",nm:"S",lc:1,lj:2,ml:1,o:{a:0,k:100},w:{a:0,k:4},c:{a:0,k:[1,1,1]}},{ty:"tr",a:{a:0,k:[0,0]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[27.32,40]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:10,parent:1}]}],Ek={nm:gk,h:vk,w:yk,meta:xk,layers:Tk,v:kk,fr:wk,op:Sk,ip:Ck,assets:bk},Ok=({meshId:n})=>{const e=b.useRef(null);return b.useEffect(()=>{const t=document.getElementById(`lottie-animation-${n}`);return t&&(e.current=af.loadAnimation({container:t,animationData:Ek,loop:!0,autoplay:!0})),()=>{e.current&&e.current.destroy()}},[n]),M.jsx("div",{id:`lottie-animation-${n}`,style:{width:"2em",height:"2em"}})},xa=()=>Math.floor(Math.random()*2001)-1e3,Ak=()=>M.jsx(M.Fragment,{children:["a","b","c"].map(n=>{const e=xa(),t=xa(),s=xa();return M.jsx("mesh",{position:[e,t,s],children:M.jsx(dr,{center:!0,sprite:!0,children:M.jsx(Mk,{children:M.jsx(Ok,{meshId:n})})})},n)})}),Mk=Ve.div` border: 2px solid white; border-radius: 50%; display: flex; @@ -727,7 +727,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu justify-content: center; color: white; font-size: 20px; -`;Object.values(kf).map(n=>n);const Mk=n=>M.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("g",{id:"Type=Edit, Size=20x20",children:M.jsx("path",{id:"icon","fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.9243 3.3359L9.06461 9.19559C8.97523 9.28497 8.9036 9.39048 8.85353 9.50654L7.99772 11.49C7.89015 11.7394 8.14272 11.9919 8.39203 11.8843L10.3755 11.0285C10.4916 10.9785 10.5971 10.9068 10.6865 10.8175L16.5462 4.95777C16.994 4.50991 16.994 3.78377 16.5462 3.3359C16.0983 2.88804 15.3722 2.88804 14.9243 3.3359ZM14.5297 10.7363C14.5297 10.3876 14.8127 10.1047 15.1615 10.1047C15.5116 10.1047 15.7933 10.3889 15.7933 10.7363L15.7222 14.1051C15.7222 15.1499 14.8954 16 13.8506 16H5.87166C4.85054 16 4 15.1499 4 14.0814V6.0806C4 5.05918 4.85054 4.2091 5.87166 4.2091L9.68606 4.20936C10.0362 4.20936 10.3178 4.49228 10.3178 4.841C10.3178 5.18972 10.0349 5.47264 9.68606 5.47264H5.89535C5.54735 5.47264 5.26357 5.75609 5.26357 6.10428V14.1051C5.26357 14.4533 5.54735 14.7367 5.89535 14.7367H13.898C14.246 14.7367 14.5297 14.4533 14.5297 14.1051V10.7363Z",fill:"currentColor"})})}),Di=n=>({close:{backgroundColor:"rgba(48, 51, 66, 1)",borderColor:"#fff",fontColor:"rgba(255, 255, 255, 1)"},focus:{backgroundColor:n?"rgba(255, 255, 255, 0.90);":"rgba(255, 255, 255, 0.90)",borderColor:n?"#FFDB58bb":"#fff",fontColor:"rgba(48, 51, 66, 1)"},menu:{backgroundColor:"#00000066",borderColor:n?"#ffffff66":"#5078f2",fontColor:n?"#ffffff66":"#fff"}}),Dk=new K,qd=b.memo(()=>{const n=b.useRef(null),e=bo(_=>_.setSidebarOpen),[t,s]=Zr.useState(null),{open:i}=$o("editNodeName"),{open:r}=$o("addEdgeToNode"),{open:o}=$o("mergeToNode"),[a]=du(_=>[_.isAdmin]),[c]=kn(_=>[_.addNewNode]),l=Jt(),{showSelectionGraph:u,selectionGraphData:h,setSelectedNode:d,setShowSelectionGraph:f}=nt(_=>_),m=Qf(),p=b.useCallback(async()=>{try{if(l!=null&&l.ref_id){const _=await cf(l==null?void 0:l.ref_id,h.nodes.length||0);_&&c(_)}}catch(_){console.log(_)}},[c,l==null?void 0:l.ref_id,h.nodes.length]);wt(()=>{g()});const g=b.useCallback(()=>{const _=u?h:m;if(n.current){const T=_==null?void 0:_.nodes.find(x=>x.ref_id===(l==null?void 0:l.ref_id));if(T){const x=Dk.set(T==null?void 0:T.x,T==null?void 0:T.y,T==null?void 0:T.z);n.current.position.copy(x)}}},[l,u,h,m]),y=b.useMemo(()=>{const _=a?[{key:"control-key-1",colors:Di(u).focus,icon:M.jsx(ep,{}),left:-80,className:"add",onClick:x=>{s(x.currentTarget)}},{key:"control-key-2",colors:Di(u).focus,icon:M.jsx(Mk,{}),left:-40,className:"edit",onClick:()=>{i()}}]:[],T=[{key:"control-key-4",colors:Di(u).focus,icon:M.jsx(tp,{}),left:0,className:"expand",onClick:()=>{const x=!u;f(x),x&&e(!0)}},{key:"control-key-5",colors:Di(!0).close,icon:M.jsx(lf,{}),left:40,className:"exit",onClick:()=>{p()}},{key:"control-key-6",colors:Di(!0).close,icon:M.jsx(sp,{}),left:40,className:"exit",onClick:()=>{f(!1),d(null)}}];return[..._,...T].map((x,k)=>({...x,left:-80+k*40}))},[a,u,i,f,e,p,d]);if(!l)return null;const w=()=>{s(null)},S=!!t,v=S?"simple-popover":void 0;return M.jsx("group",{ref:n,children:M.jsxs(dr,{center:!0,className:"control-panel",onClick:_=>_.stopPropagation(),onKeyDown:_=>_.stopPropagation(),onPointerDown:_=>_.stopPropagation(),onPointerOut:_=>_.stopPropagation(),onPointerOver:_=>_.stopPropagation(),onPointerUp:_=>_.stopPropagation(),sprite:!0,zIndexRange:[16777271,16777272],children:[y.map(_=>M.jsx(Rk,{backgroundColor:_.colors.backgroundColor,borderColor:_.colors.borderColor,className:_.className,fontColor:_.colors.fontColor,left:_.left,onClick:T=>{T.stopPropagation(),_.onClick(T)},children:_.icon},_.key)),M.jsxs(Pk,{anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:v,onClose:w,open:S,transformOrigin:{vertical:"top",horizontal:"right"},children:[M.jsxs(uu,{"data-testid":"merge",onClick:()=>{o(),w()},children:[M.jsx(Kf,{"data-testid":"MergeIcon"})," Merge"]}),M.jsxs(uu,{"data-testid":"add_edge",onClick:()=>{r(),w()},children:[M.jsx(Jf,{"data-testid":"AddCircleIcon"})," Add edge"]})]})]})})});qd.displayName="NodeControls";const Rk=Ve.div` +`;Object.values(kf).map(n=>n);const Dk=n=>M.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:M.jsx("g",{id:"Type=Edit, Size=20x20",children:M.jsx("path",{id:"icon","fill-rule":"evenodd","clip-rule":"evenodd",d:"M14.9243 3.3359L9.06461 9.19559C8.97523 9.28497 8.9036 9.39048 8.85353 9.50654L7.99772 11.49C7.89015 11.7394 8.14272 11.9919 8.39203 11.8843L10.3755 11.0285C10.4916 10.9785 10.5971 10.9068 10.6865 10.8175L16.5462 4.95777C16.994 4.50991 16.994 3.78377 16.5462 3.3359C16.0983 2.88804 15.3722 2.88804 14.9243 3.3359ZM14.5297 10.7363C14.5297 10.3876 14.8127 10.1047 15.1615 10.1047C15.5116 10.1047 15.7933 10.3889 15.7933 10.7363L15.7222 14.1051C15.7222 15.1499 14.8954 16 13.8506 16H5.87166C4.85054 16 4 15.1499 4 14.0814V6.0806C4 5.05918 4.85054 4.2091 5.87166 4.2091L9.68606 4.20936C10.0362 4.20936 10.3178 4.49228 10.3178 4.841C10.3178 5.18972 10.0349 5.47264 9.68606 5.47264H5.89535C5.54735 5.47264 5.26357 5.75609 5.26357 6.10428V14.1051C5.26357 14.4533 5.54735 14.7367 5.89535 14.7367H13.898C14.246 14.7367 14.5297 14.4533 14.5297 14.1051V10.7363Z",fill:"currentColor"})})}),Di=n=>({close:{backgroundColor:"rgba(48, 51, 66, 1)",borderColor:"#fff",fontColor:"rgba(255, 255, 255, 1)"},focus:{backgroundColor:n?"rgba(255, 255, 255, 0.90);":"rgba(255, 255, 255, 0.90)",borderColor:n?"#FFDB58bb":"#fff",fontColor:"rgba(48, 51, 66, 1)"},menu:{backgroundColor:"#00000066",borderColor:n?"#ffffff66":"#5078f2",fontColor:n?"#ffffff66":"#fff"}}),Rk=new K,qd=b.memo(()=>{const n=b.useRef(null),e=bo(_=>_.setSidebarOpen),[t,s]=Zr.useState(null),{open:i}=$o("editNodeName"),{open:r}=$o("addEdgeToNode"),{open:o}=$o("mergeToNode"),[a]=du(_=>[_.isAdmin]),[c]=kn(_=>[_.addNewNode]),l=Jt(),{showSelectionGraph:u,selectionGraphData:h,setSelectedNode:d,setShowSelectionGraph:f}=nt(_=>_),m=Kf(),p=b.useCallback(async()=>{try{if(l!=null&&l.ref_id){const _=await cf(l==null?void 0:l.ref_id,h.nodes.length||0);_&&c(_)}}catch(_){console.log(_)}},[c,l==null?void 0:l.ref_id,h.nodes.length]);wt(()=>{g()});const g=b.useCallback(()=>{const _=u?h:m;if(n.current){const T=_==null?void 0:_.nodes.find(x=>x.ref_id===(l==null?void 0:l.ref_id));if(T){const x=Rk.set(T==null?void 0:T.x,T==null?void 0:T.y,T==null?void 0:T.z);n.current.position.copy(x)}}},[l,u,h,m]),y=b.useMemo(()=>{const _=a?[{key:"control-key-1",colors:Di(u).focus,icon:M.jsx(tp,{}),left:-80,className:"add",onClick:x=>{s(x.currentTarget)}},{key:"control-key-2",colors:Di(u).focus,icon:M.jsx(Dk,{}),left:-40,className:"edit",onClick:()=>{i()}}]:[],T=[{key:"control-key-4",colors:Di(u).focus,icon:M.jsx(sp,{}),left:0,className:"expand",onClick:()=>{const x=!u;f(x),x&&e(!0)}},{key:"control-key-5",colors:Di(!0).close,icon:M.jsx(lf,{}),left:40,className:"exit",onClick:()=>{p()}},{key:"control-key-6",colors:Di(!0).close,icon:M.jsx(np,{}),left:40,className:"exit",onClick:()=>{f(!1),d(null)}}];return[..._,...T].map((x,k)=>({...x,left:-80+k*40}))},[a,u,i,f,e,p,d]);if(!l)return null;const w=()=>{s(null)},S=!!t,v=S?"simple-popover":void 0;return M.jsx("group",{ref:n,children:M.jsxs(dr,{center:!0,className:"control-panel",onClick:_=>_.stopPropagation(),onKeyDown:_=>_.stopPropagation(),onPointerDown:_=>_.stopPropagation(),onPointerOut:_=>_.stopPropagation(),onPointerOver:_=>_.stopPropagation(),onPointerUp:_=>_.stopPropagation(),sprite:!0,zIndexRange:[16777271,16777272],children:[y.map(_=>M.jsx(Pk,{backgroundColor:_.colors.backgroundColor,borderColor:_.colors.borderColor,className:_.className,fontColor:_.colors.fontColor,left:_.left,onClick:T=>{T.stopPropagation(),_.onClick(T)},children:_.icon},_.key)),M.jsxs(Ik,{anchorEl:t,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:v,onClose:w,open:S,transformOrigin:{vertical:"top",horizontal:"right"},children:[M.jsxs(uu,{"data-testid":"merge",onClick:()=>{o(),w()},children:[M.jsx(Jf,{"data-testid":"MergeIcon"})," Merge"]}),M.jsxs(uu,{"data-testid":"add_edge",onClick:()=>{r(),w()},children:[M.jsx(ep,{"data-testid":"AddCircleIcon"})," Add edge"]})]})]})})});qd.displayName="NodeControls";const Pk=Ve.div` position: fixed; top: -60px; left: ${n=>-7+n.left}px; @@ -758,7 +758,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu background: ${qe.BUTTON1_HOVER}; color: ${qe.GRAY3}; } -`,Pk=Ve(np)` +`,Ik=Ve(ip)` && { z-index: 9999; } @@ -772,7 +772,7 @@ outputColor=vec4(color,inputColor.a);}`,cm=class extends zi{constructor({blendFu font-size: 14px; font-weight: 500; } -`,Wd=b.memo(()=>M.jsx(M.Fragment,{children:M.jsx(qd,{})}));Wd.displayName="NodeDetailsPanel";const Ik=()=>{const{dataInitial:n,isLoadingNew:e,isFetching:t,dataNew:s,resetDataNew:i}=kn(d=>d),r=b.useRef(null),o=b.useRef([]),{setData:a,simulation:c,simulationCreate:l,simulationHelpers:u,graphStyle:h}=nt(d=>d);return b.useEffect(()=>{if(!s)return;const d=s.nodes||[],f=s.links||[],m=structuredClone(d),p=structuredClone(f);if(c){const g=uf.isEqual(s,n);u.addNodesAndLinks(m,p,g)}c||l(m,p),i()},[a,s,c,l,i,u,n]),b.useEffect(()=>{c&&u.setForces()},[h,u,c]),b.useEffect(()=>{c&&c.on("tick",()=>{if(r.current){const d=r.current.getObjectByName("simulation-3d-group__nodes"),f=r.current.getObjectByName("simulation-3d-group__connections");d.children.forEach((m,p)=>{const g=c.nodes()[p];g&&m.position.set(g.x,g.y,g.z)}),f.children.forEach((m,p)=>{const g=n==null?void 0:n.links[p],y=m;if(g){const w=c.nodes().find(O=>O.ref_id===g.source),S=c.nodes().find(O=>O.ref_id===g.target),{x:v,y:_,z:T}=w,{x,y:k,z:C}=S;o.current[p]={sx:v,sy:_,sz:T,tx:x,ty:k,tz:C},y.geometry.setPositions([v,_,T,x,k,C]);const{material:E}=y;E.color=new ds("white"),E.transparent=!0,E.opacity=.1}})}})},[n,c]),c?M.jsxs("group",{ref:r,children:[M.jsx(Hd,{}),M.jsx(pk,{}),!1,(e||t)&&M.jsx(Ok,{}),h!=="earth"&&M.jsx(Ld,{linksPositions:o.current}),M.jsx(Wd,{})]}):null},Nk=()=>M.jsx(dr,{children:M.jsx(dp,{})}),Fk=()=>{const{universeColor:n}=op("universe",{universeColor:qe.black}),e=Jt(),t=b.useMemo(()=>e!=null&&e.node_type?fu(e.node_type):H_,[e]);return M.jsxs(M.Fragment,{children:[M.jsx("color",{args:[n],attach:"background"}),M.jsx(Cf,{}),M.jsx(KT,{}),M.jsxs(Ap,{children:[M.jsxs(lm,{autoClear:!1,multisampling:8,children:[M.jsx(fm,{darkness:.7,eskil:!1,offset:.05}),M.jsx(hm,{luminanceThreshold:1,mipmapBlur:!0,resolutionX:Ee.AUTO_SIZE,resolutionY:Ee.AUTO_SIZE}),M.jsx(dm,{blendFunction:ee.SCREEN,blur:!0,edgeStrength:4,hiddenEdgeColor:t,visibleEdgeColor:t})]}),M.jsx(Ik,{})]})]})};let Ta=null;const Uk={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[ps.x,ps.y,ps.z]},Lk=()=>{const[n,e,t]=[Fs(a=>a.setIsUserScrollingOnHtmlPanel),Fs(a=>a.setIsUserScrolling),Fs(a=>a.setUserMovedCamera)],s=kn(a=>a.isFetching),i=bo(a=>a.universeQuestionIsOpen),r=b.useCallback(a=>{var u;const{target:c}=a,{offsetParent:l}=c;Ta&&clearTimeout(Ta),(u=l==null?void 0:l.classList)!=null&&u.contains("html-panel")&&l.clientHeight{e(!1),n(!1)},200)},[e,n,t]),o=b.useCallback(a=>hf(a,"threeState"),[]);return M.jsxs(zk,{children:[M.jsx(b.Suspense,{fallback:null,children:M.jsxs(wf,{camera:Uk,id:"universe-canvas",onCreated:o,onWheel:r,children:[df&&M.jsx(Sf,{position:"bottom-right"}),M.jsxs(b.Suspense,{fallback:M.jsx(Nk,{}),children:[M.jsx(bp,{}),M.jsx(Ep,{}),M.jsx(Op,{}),M.jsx(Fk,{})]})]})}),i&&M.jsx(gm,{}),s&&M.jsx(ip,{fullSize:!1}),M.jsx(rp,{})]})},zk=Ve(Ys)` +`,Wd=b.memo(()=>M.jsx(M.Fragment,{children:M.jsx(qd,{})}));Wd.displayName="NodeDetailsPanel";const Nk=()=>{const{dataInitial:n,isLoadingNew:e,isFetching:t,dataNew:s,resetDataNew:i}=kn(d=>d),r=b.useRef(null),o=b.useRef([]),{setData:a,simulation:c,simulationCreate:l,simulationHelpers:u,graphStyle:h}=nt(d=>d);return b.useEffect(()=>{if(!s)return;const d=s.nodes||[],f=s.links||[],m=structuredClone(d),p=structuredClone(f);if(c){const g=uf.isEqual(s,n);u.addNodesAndLinks(m,p,g)}c||l(m,p),i()},[a,s,c,l,i,u,n]),b.useEffect(()=>{c&&u.setForces()},[h,u,c]),b.useEffect(()=>{c&&c.on("tick",()=>{if(r.current){const d=r.current.getObjectByName("simulation-3d-group__nodes"),f=r.current.getObjectByName("simulation-3d-group__connections");d.children.forEach((m,p)=>{const g=c.nodes()[p];g&&m.position.set(g.x,g.y,g.z)}),f.children.forEach((m,p)=>{const g=n==null?void 0:n.links[p],y=m;if(g){const w=c.nodes().find(O=>O.ref_id===g.source),S=c.nodes().find(O=>O.ref_id===g.target),{x:v,y:_,z:T}=w,{x,y:k,z:C}=S;o.current[p]={sx:v,sy:_,sz:T,tx:x,ty:k,tz:C},y.geometry.setPositions([v,_,T,x,k,C]);const{material:E}=y;E.color=new ds("white"),E.transparent=!0,E.opacity=.1}})}})},[n,c]),c?M.jsxs("group",{ref:r,children:[M.jsx(Hd,{}),M.jsx(mk,{}),!1,(e||t)&&M.jsx(Ak,{}),h!=="earth"&&M.jsx(Ld,{linksPositions:o.current}),M.jsx(Wd,{})]}):null},Fk=()=>M.jsx(dr,{children:M.jsx(fp,{})}),Uk=()=>{const{universeColor:n}=ap("universe",{universeColor:qe.black}),e=Jt(),t=b.useMemo(()=>e!=null&&e.node_type?fu(e.node_type):q_,[e]);return M.jsxs(M.Fragment,{children:[M.jsx("color",{args:[n],attach:"background"}),M.jsx(Cf,{}),M.jsx(JT,{}),M.jsxs(Mp,{children:[M.jsxs(um,{autoClear:!1,multisampling:8,children:[M.jsx(pm,{darkness:.7,eskil:!1,offset:.05}),M.jsx(dm,{luminanceThreshold:1,mipmapBlur:!0,resolutionX:Ee.AUTO_SIZE,resolutionY:Ee.AUTO_SIZE}),M.jsx(fm,{blendFunction:ee.SCREEN,blur:!0,edgeStrength:4,hiddenEdgeColor:t,visibleEdgeColor:t})]}),M.jsx(Nk,{})]})]})};let Ta=null;const Lk={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[ps.x,ps.y,ps.z]},zk=()=>{const[n,e,t]=[Fs(a=>a.setIsUserScrollingOnHtmlPanel),Fs(a=>a.setIsUserScrolling),Fs(a=>a.setUserMovedCamera)],s=kn(a=>a.isFetching),i=bo(a=>a.universeQuestionIsOpen),r=b.useCallback(a=>{var u;const{target:c}=a,{offsetParent:l}=c;Ta&&clearTimeout(Ta),(u=l==null?void 0:l.classList)!=null&&u.contains("html-panel")&&l.clientHeight{e(!1),n(!1)},200)},[e,n,t]),o=b.useCallback(a=>hf(a,"threeState"),[]);return M.jsxs(Bk,{children:[M.jsx(b.Suspense,{fallback:null,children:M.jsxs(wf,{camera:Lk,id:"universe-canvas",onCreated:o,onWheel:r,children:[df&&M.jsx(Sf,{position:"bottom-right"}),M.jsxs(b.Suspense,{fallback:M.jsx(Fk,{}),children:[M.jsx(Ep,{}),M.jsx(Op,{}),M.jsx(Ap,{}),M.jsx(Uk,{})]})]})}),i&&M.jsx(vm,{}),s&&M.jsx(rp,{fullSize:!1}),M.jsx(op,{})]})},Bk=Ve(Ys)` flex: 1 1 100%; position: relative; -`,xw=b.memo(Lk);export{xw as Universe}; +`,Tw=b.memo(zk);export{Tw as Universe}; diff --git a/build/assets/index-49d7d2a6.js b/build/assets/index-3778665f.js similarity index 62% rename from build/assets/index-49d7d2a6.js rename to build/assets/index-3778665f.js index 0c771a48f..d4ef38f47 100644 --- a/build/assets/index-49d7d2a6.js +++ b/build/assets/index-3778665f.js @@ -1 +1 @@ -import{ad as e,j as s}from"./index-0cb90706.js";import{aF as a,aR as t}from"./index-7a7c9631.js";const u=()=>{const{close:o}=e("sourcesTable"),{visible:r}=e("addContent");return r?null:s.jsx(a,{background:"BG1",id:"sourcesTable",kind:"large",noWrap:!0,onClose:o,preventOutsideClose:!0,children:s.jsx(t,{})})};export{u as SourcesTableModal}; +import{ad as e,j as s}from"./index-ead79979.js";import{aG as a,aS as t}from"./index-74184c93.js";const u=()=>{const{close:o}=e("sourcesTable"),{visible:r}=e("addContent");return r?null:s.jsx(a,{background:"BG1",id:"sourcesTable",kind:"large",noWrap:!0,onClose:o,preventOutsideClose:!0,children:s.jsx(t,{})})};export{u as SourcesTableModal}; diff --git a/build/assets/index-185364ef.js b/build/assets/index-501382cf.js similarity index 80% rename from build/assets/index-185364ef.js rename to build/assets/index-501382cf.js index e4591dd94..d04f028a6 100644 --- a/build/assets/index-185364ef.js +++ b/build/assets/index-501382cf.js @@ -1,4 +1,4 @@ -import{j as e,Q as r,S as y,a5 as _,U as s,ad as g,a4 as G,a1 as k,ar as P,r as l,am as q,as as J,M as O}from"./index-0cb90706.js";import{b as Q,aJ as T,ae as Y,af as K,B as E,aE as X,aF as Z}from"./index-7a7c9631.js";import{S as ee}from"./Skeleton-b299e336.js";const F=/^https:\/\/\S+\.(png|jpe?g|svg)$/;function ae(o){return!!F.test(o)}const te=o=>e.jsxs("svg",{width:"1em",height:"1em",viewBox:"4 3 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M10 4.7002H6.1C5.21634 4.7002 4.5 5.41654 4.5 6.3002V13.9002C4.5 14.7838 5.21634 15.5002 6.1 15.5002H13.7C14.5837 15.5002 15.3 14.7839 15.3 13.9002V10.5002",stroke:"#909BAA","stroke-linecap":"round"}),e.jsx("path",{d:"M16 4L9 11",stroke:"#909BAA","stroke-width":"1.5","stroke-linecap":"round"})]}),ne=()=>{const{open:o}=g("changeNodeType"),{close:u}=g("editNodeName"),{changeNodeTypeFeatureFlag:c}=G(x=>({changeNodeTypeFeatureFlag:x.changeNodeTypeFeatureFlag})),t=k(),h=t==null?void 0:t.node_type,d=()=>{u(),o()};return e.jsxs(s,{children:[e.jsx(s,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsxs(s,{align:"center",direction:"row",children:[e.jsx(se,{children:"Edit Node"}),e.jsxs(oe,{children:[e.jsx(Q,{type:h}),c&&e.jsx(re,{onClick:d,children:e.jsx(te,{})})]})]})}),e.jsxs(s,{mb:18,children:[e.jsx(B,{style:{marginBottom:8},children:"Node Name"}),e.jsx(T,{id:"cy-topic",maxLength:50,name:"name",placeholder:"Node name",rules:{...P}})]}),e.jsxs(s,{mb:36,children:[e.jsx(B,{style:{marginBottom:8},children:"image_url"}),e.jsx(T,{id:"cy-image_url",maxLength:500,name:"image_url",placeholder:"image_url",rules:{pattern:{message:"Please enter a valid URL",value:F}}})]})]})},se=r(_)` +import{j as e,Q as r,S as y,a5 as _,U as s,ad as g,a4 as H,a1 as k,ar as P,r as l,am as q,as as K,M as O}from"./index-ead79979.js";import{b as Q,aK as T,af as Y,ag as J,B as F,aF as X,aG as Z}from"./index-74184c93.js";import{S as ee}from"./Skeleton-63ee525b.js";const I=/^https:\/\/\S+\.(png|jpe?g|svg)$/;function ae(o){return!!I.test(o)}const te=o=>e.jsxs("svg",{width:"1em",height:"1em",viewBox:"4 3 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M10 4.7002H6.1C5.21634 4.7002 4.5 5.41654 4.5 6.3002V13.9002C4.5 14.7838 5.21634 15.5002 6.1 15.5002H13.7C14.5837 15.5002 15.3 14.7839 15.3 13.9002V10.5002",stroke:"#909BAA","stroke-linecap":"round"}),e.jsx("path",{d:"M16 4L9 11",stroke:"#909BAA","stroke-width":"1.5","stroke-linecap":"round"})]}),ne=()=>{const{open:o}=g("changeNodeType"),{close:u}=g("editNodeName"),{changeNodeTypeFeatureFlag:c}=H(x=>({changeNodeTypeFeatureFlag:x.changeNodeTypeFeatureFlag})),t=k(),h=t==null?void 0:t.node_type,d=()=>{u(),o()};return e.jsxs(s,{children:[e.jsx(s,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsxs(s,{align:"center",direction:"row",children:[e.jsx(se,{children:"Edit Node"}),e.jsxs(oe,{children:[e.jsx(Q,{type:h}),c&&e.jsx(re,{onClick:d,children:e.jsx(te,{})})]})]})}),e.jsxs(s,{mb:18,children:[e.jsx(B,{style:{marginBottom:8},children:"Node Name"}),e.jsx(T,{id:"cy-topic",maxLength:50,name:"name",placeholder:"Node name",rules:{...P}})]}),e.jsxs(s,{mb:36,children:[e.jsx(B,{style:{marginBottom:8},children:"image_url"}),e.jsx(T,{id:"cy-image_url",maxLength:500,name:"image_url",placeholder:"image_url",rules:{pattern:{message:"Please enter a valid URL",value:I}}})]})]})},se=r(_)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -17,9 +17,9 @@ import{j as e,Q as r,S as y,a5 as _,U as s,ad as g,a4 as G,a1 as k,ar as P,r as `,re=r(s)` align-items: center; cursor: pointer; -`,ie=()=>{var b,C,S;const{close:o}=g("editNodeName"),u=Y({mode:"onChange"}),{watch:c,setValue:t,reset:h,getValues:d}=u,[x,N]=l.useState(!1),[j,w]=l.useState(!1),[n,I]=l.useState(),a=k(),{open:L}=g("removeNode");l.useEffect(()=>(n?t("name",n==null?void 0:n.name):a&&(t("name",a.name),t("image_url",(a==null?void 0:a.image_url)??"")),()=>{h()}),[n,t,h,a]),l.useEffect(()=>{(async()=>{if(!(!a||a.type!=="topic")){w(!0);try{const{data:i}=await q({search:a==null?void 0:a.name}),p=i.find(H=>H.name===a.name);I(p)}catch(i){console.log(i)}finally{w(!1)}}})()},[a]);const D=c("imageInputType"),R=c("name"),f=c("image_url");l.useEffect(()=>{t("imageInputType",ae(f))},[f,t]);const M=()=>{o()},m=n||a,A=async()=>{N(!0);const i={["name"]:R.trim(),image_url:f.trim()};try{await J((m==null?void 0:m.ref_id)||"",i);const{updateNode:p}=O.getState();p({...m,...i}),M()}catch(p){console.warn(p)}finally{N(!1)}},U=async()=>{L()},v=(C=(b=d())==null?void 0:b.name)==null?void 0:C.trim(),V=v&&(n==null?void 0:n.name.trim())!==v,z=d().image_url&&(a==null?void 0:a.image_url)!==((S=d())==null?void 0:S.image_url),W=x||j||!!f&&!D||!V&&!z;return e.jsx(le,{children:e.jsxs(K,{...u,children:[j?e.jsx(s,{my:24,children:e.jsx(ee,{})}):e.jsx(ne,{}),e.jsxs(s,{direction:"row",mb:6,children:[e.jsx(ce,{color:"secondary",disabled:j||!m,onClick:U,size:"large",style:{marginRight:20},variant:"contained",children:"Delete"}),e.jsxs(E,{color:"secondary",disabled:W,onClick:A,size:"large",style:{flex:1},variant:"contained",children:["Save Changes",x&&e.jsx(de,{children:e.jsx(X,{color:y.lightGray,size:12})})]})]})]})})},le=r(s)` +`,ie=()=>{var b,C,S;const{close:o}=g("editNodeName"),u=Y({mode:"onChange"}),{watch:c,setValue:t,reset:h,getValues:d}=u,[x,N]=l.useState(!1),[j,w]=l.useState(!1),[n,E]=l.useState(),a=k(),{open:L}=g("removeNode");l.useEffect(()=>(n?t("name",n==null?void 0:n.name):a&&(t("name",a.name),t("image_url",(a==null?void 0:a.image_url)??"")),()=>{h()}),[n,t,h,a]),l.useEffect(()=>{(async()=>{if(!(!a||a.type!=="topic")){w(!0);try{const{data:i}=await q({search:a==null?void 0:a.name}),p=i.find(G=>G.name===a.name);E(p)}catch(i){console.log(i)}finally{w(!1)}}})()},[a]);const D=c("imageInputType"),R=c("name"),f=c("image_url");l.useEffect(()=>{t("imageInputType",ae(f))},[f,t]);const M=()=>{o()},m=n||a,A=async()=>{N(!0);const i={["name"]:R.trim(),image_url:f.trim()};try{await K((m==null?void 0:m.ref_id)||"",i);const{updateNode:p}=O.getState();p({...m,...i}),M()}catch(p){console.warn(p)}finally{N(!1)}},U=async()=>{L()},v=(C=(b=d())==null?void 0:b.name)==null?void 0:C.trim(),V=v&&(n==null?void 0:n.name.trim())!==v,z=d().image_url&&(a==null?void 0:a.image_url)!==((S=d())==null?void 0:S.image_url),W=x||j||!!f&&!D||!V&&!z;return e.jsx(le,{children:e.jsxs(J,{...u,children:[j?e.jsx(s,{my:24,children:e.jsx(ee,{})}):e.jsx(ne,{}),e.jsxs(s,{direction:"row",mb:6,children:[e.jsx(ce,{color:"secondary",disabled:j||!m,onClick:U,size:"large",style:{marginRight:20},variant:"contained",children:"Delete"}),e.jsxs(F,{color:"secondary",disabled:W,onClick:A,size:"large",style:{flex:1},variant:"contained",children:["Save Changes",x&&e.jsx(de,{children:e.jsx(X,{color:y.lightGray,size:12})})]})]})]})})},le=r(s)` padding: 20px; -`,ce=r(E)` +`,ce=r(F)` && { color: ${y.primaryRed}; background-color: rgba(237, 116, 116, 0.1); diff --git a/build/assets/index-91c634b7.js b/build/assets/index-525470a0.js similarity index 82% rename from build/assets/index-91c634b7.js rename to build/assets/index-525470a0.js index fd039d3b9..a1351e2f1 100644 --- a/build/assets/index-91c634b7.js +++ b/build/assets/index-525470a0.js @@ -1,4 +1,4 @@ -import{ax as X,Q as y,S as b,U as t,a5 as T,N as G,r as f,j as e,by as Z,bz as ee,ar as L,bC as te,a4 as se,bD as ne,ad as $,M as oe,O as re,bA as I,bg as ae,ag as ie,ay as ce}from"./index-0cb90706.js";import{B as C,aE as V,aa as le,aM as de,ad as pe,aJ as F,aN as B,aO as xe,aP as ue,aQ as me,ae as he,aF as fe,af as ye}from"./index-7a7c9631.js";import{S as ge}from"./index-7623b989.js";import{p as je}from"./index-bbc7c996.js";import{c as we}from"./index-64f1c910.js";import"./three.module-a2e04964.js";const be=async(o,i,c="")=>await X.post(`/${o}`,JSON.stringify(i),{Authorization:c}),Se=async(o,i,c,u,d,r)=>{const x=o==="Create custom type"?"schema":"node",l={node_data:{...i,...o==="Image"&&{source_link:c}},node_type:o,name:u,pubkey:r};return be(x,l,d)},Ne=({onClick:o,loading:i,error:c})=>{const u=G(l=>l.budget),[d,r]=f.useState(10),x="node";return f.useEffect(()=>{(async()=>{try{const m=await ee(x);r(m.data.price)}catch(m){console.error("cannot fetch",m)}})()},[x]),e.jsxs(t,{children:[e.jsx(t,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(t,{align:"center",direction:"row",children:e.jsx(ke,{children:"Approve Cost"})})}),e.jsxs(t,{align:"center",direction:"row",justify:"space-between",mb:20,children:[e.jsxs(Te,{children:[e.jsx("div",{className:"title",children:"COST"}),e.jsxs("div",{className:"value","data-testid":"check-price",children:[d," sats"]})]}),e.jsxs(Ce,{children:[e.jsx("div",{className:"title",children:"BUDGET"}),e.jsxs("div",{className:"value",children:[Z(u)," sats"]})]})]}),e.jsx(t,{children:e.jsx(C,{color:"secondary","data-testid":"check-icon",disabled:i||!!c,onClick:o,size:"large",startIcon:i?e.jsx(R,{children:e.jsx(V,{color:b.lightGray,size:12})}):e.jsxs(R,{children:[" ",e.jsx(le,{})]}),type:"submit",variant:"contained",children:"Approve"})}),c?e.jsx(ze,{children:e.jsxs(ve,{children:[e.jsx(de,{className:"errorIcon"}),e.jsx("span",{children:c})]})}):null]})},Te=y(t).attrs({direction:"column",align:"space-between",justify:"flex-start"})` +import{ax as X,Q as y,S as b,U as t,a5 as T,N as q,r as f,j as e,by as Z,bz as ee,ar as L,bC as te,a4 as se,bD as ne,ad as $,M as oe,O as re,bA as I,bg as ae,ag as ie,ay as ce}from"./index-ead79979.js";import{B as C,aF as V,ab as le,aN as de,ae as pe,aK as F,aO as B,aP as xe,aQ as ue,aR as me,af as he,aG as fe,ag as ye}from"./index-74184c93.js";import{S as ge}from"./index-560f985a.js";import{p as je}from"./index-bbc7c996.js";import{c as we}from"./index-64f1c910.js";import"./three.module-a2e04964.js";const be=async(o,i,c="")=>await X.post(`/${o}`,JSON.stringify(i),{Authorization:c}),Se=async(o,i,c,u,d,r)=>{const x=o==="Create custom type"?"schema":"node",l={node_data:{...i,...o==="Image"&&{source_link:c}},node_type:o,name:u,pubkey:r};return be(x,l,d)},Ne=({onClick:o,loading:i,error:c})=>{const u=q(l=>l.budget),[d,r]=f.useState(10),x="node";return f.useEffect(()=>{(async()=>{try{const m=await ee(x);r(m.data.price)}catch(m){console.error("cannot fetch",m)}})()},[x]),e.jsxs(t,{children:[e.jsx(t,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(t,{align:"center",direction:"row",children:e.jsx(ke,{children:"Approve Cost"})})}),e.jsxs(t,{align:"center",direction:"row",justify:"space-between",mb:20,children:[e.jsxs(Te,{children:[e.jsx("div",{className:"title",children:"COST"}),e.jsxs("div",{className:"value","data-testid":"check-price",children:[d," sats"]})]}),e.jsxs(Ce,{children:[e.jsx("div",{className:"title",children:"BUDGET"}),e.jsxs("div",{className:"value",children:[Z(u)," sats"]})]})]}),e.jsx(t,{children:e.jsx(C,{color:"secondary","data-testid":"check-icon",disabled:i||!!c,onClick:o,size:"large",startIcon:i?e.jsx(R,{children:e.jsx(V,{color:b.lightGray,size:12})}):e.jsxs(R,{children:[" ",e.jsx(le,{})]}),type:"submit",variant:"contained",children:"Approve"})}),c?e.jsx(ze,{children:e.jsxs(ve,{children:[e.jsx(de,{className:"errorIcon"}),e.jsx("span",{children:c})]})}):null]})},Te=y(t).attrs({direction:"column",align:"space-between",justify:"flex-start"})` width: 141px; height: 61px; border: 1px solid ${b.GRAY7}; @@ -81,15 +81,15 @@ import{ax as X,Q as y,S as b,U as t,a5 as T,N as G,r as f,j as e,by as Z,bz as e width: 16px; height: 16px; } -`,Be=({type:o,onclose:i})=>e.jsxs(t,{children:[e.jsx(t,{mb:20,children:e.jsx(q,{children:"Comfirm New Type"})}),e.jsx(t,{mb:25,children:e.jsxs(q,{children:["Type: ",o]})}),e.jsxs(t,{direction:"row",children:[e.jsx(t,{grow:1,children:e.jsx(C,{color:"secondary",onClick:i,size:"large",variant:"contained",children:"Cancel"})}),e.jsx(t,{grow:1,ml:20,children:e.jsx(C,{color:"secondary",size:"large",type:"submit",variant:"contained",children:"Confirm"})})]})]}),q=y(T)` +`,Be=({type:o,onclose:i})=>e.jsxs(t,{children:[e.jsx(t,{mb:20,children:e.jsx(G,{children:"Comfirm New Type"})}),e.jsx(t,{mb:25,children:e.jsxs(G,{children:["Type: ",o]})}),e.jsxs(t,{direction:"row",children:[e.jsx(t,{grow:1,children:e.jsx(C,{color:"secondary",onClick:i,size:"large",variant:"contained",children:"Cancel"})}),e.jsx(t,{grow:1,ml:20,children:e.jsx(C,{color:"secondary",size:"large",type:"submit",variant:"contained",children:"Confirm"})})]})]}),G=y(T)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,Ie=({handleSelectType:o,skipToStep:i,nodeType:c})=>{const[u,d]=f.useState(!1),[r,x]=f.useState(),{watch:l,setValue:m,formState:{isValid:w}}=pe();f.useEffect(()=>{(async()=>{d(!0);const j=await te(c),E=je(j).filter(_=>_.key!=="node_key");x(E),d(!1)})()},[c,l]);const h=s=>s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," "),n=r?[...r].sort((s,j)=>s.required&&!j.required?-1:!s.required&&j.required?1:0):[],g=()=>{o(""),i("sourceType")},p=()=>{r==null||r.forEach(({key:s,required:j})=>{if(j){const S=l(s);typeof S=="string"&&m(s,S.trim(),{shouldValidate:!0})}}),w&&!u&&(r!=null&&r.every(s=>!s.required||l(s.key)))&&i("setBudget")};return e.jsxs(t,{children:[e.jsx(t,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(t,{align:"center",direction:"row",children:e.jsx(Ee,{children:"Set Attributes"})})}),e.jsx(_e,{children:u?e.jsx(t,{style:{margin:"auto"},children:e.jsx(V,{color:b.lightGray})}):e.jsx(t,{className:"input__wrapper",children:n==null?void 0:n.map(({key:s,required:j})=>e.jsxs(Ae,{children:[e.jsx(T,{children:h(s)}),e.jsx(F,{id:"item-name",maxLength:50,name:s,placeholder:j?"Required":"Optional",rules:{...j?{...L,pattern:{message:"No leading whitespace allowed",value:B}}:{}}})]},s))})}),e.jsxs(t,{direction:"row",children:[e.jsx(t,{grow:1,children:e.jsx(C,{color:"secondary",onClick:g,size:"large",variant:"contained",children:"Prev"})}),e.jsx(t,{grow:1,ml:20,children:e.jsx(C,{color:"secondary",disabled:!w||u||(r==null?void 0:r.some(s=>s.required&&!l(s.key))),onClick:p,size:"large",variant:"contained",children:"Next"})})]})]})},Ee=y(T)` +`,Ie=({handleSelectType:o,skipToStep:i,nodeType:c})=>{const[u,d]=f.useState(!1),[r,x]=f.useState(),{watch:l,setValue:m,formState:{isValid:w}}=pe();f.useEffect(()=>{(async()=>{d(!0);const j=await te(c),_=je(j).filter(A=>A.key!=="node_key");x(_),d(!1)})()},[c,l]);const h=s=>s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," "),n=r?[...r].sort((s,j)=>s.required&&!j.required?-1:!s.required&&j.required?1:0):[],g=()=>{o(""),i("sourceType")},p=()=>{r==null||r.forEach(({key:s,required:j})=>{if(j){const S=l(s);typeof S=="string"&&m(s,S.trim(),{shouldValidate:!0})}}),w&&!u&&(r!=null&&r.every(s=>!s.required||l(s.key)))&&i("setBudget")};return e.jsxs(t,{children:[e.jsx(t,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(t,{align:"center",direction:"row",children:e.jsx(_e,{children:"Set Attributes"})})}),e.jsx(Ae,{children:u?e.jsx(t,{style:{margin:"auto"},children:e.jsx(V,{color:b.lightGray})}):e.jsx(t,{className:"input__wrapper",children:n==null?void 0:n.map(({key:s,required:j})=>e.jsxs(Ee,{children:[e.jsx(T,{children:h(s)}),e.jsx(F,{id:"item-name",maxLength:50,name:s,placeholder:j?"Required":"Optional",rules:{...j?{...L,pattern:{message:"No leading whitespace allowed",value:B}}:{}}})]},s))})}),e.jsxs(t,{direction:"row",children:[e.jsx(t,{grow:1,children:e.jsx(C,{color:"secondary",onClick:g,size:"large",variant:"contained",children:"Prev"})}),e.jsx(t,{grow:1,ml:20,children:e.jsx(C,{color:"secondary",disabled:!w||u||(r==null?void 0:r.some(s=>s.required&&!l(s.key))),onClick:p,size:"large",variant:"contained",children:"Next"})})]})]})},_e=y(T)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,_e=y(t)` +`,Ae=y(t)` width: 100%; display: flex; justify-content: center; @@ -104,7 +104,7 @@ import{ax as X,Q as y,S as b,U as t,a5 as T,N as G,r as f,j as e,by as Z,bz as e padding-right: 20px; width: calc(100% + 20px); } -`,Ae=y(t)` +`,Ee=y(t)` display: flex; gap: 10px; @@ -120,4 +120,4 @@ import{ax as X,Q as y,S as b,U as t,a5 as T,N as G,r as f,j as e,by as Z,bz as e font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,Pe=async(o,i,c)=>{var h;const u=Object.entries(o).reduce((n,[g,p])=>(p!=null&&p!==""&&(n[g]=p),n),{}),{nodeType:d,typeName:r,sourceLink:x,...l}=u;let m="",w="";d!=="Create custom type"&&await ae(async()=>{const n=await ie.enable();w=n==null?void 0:n.pubkey,m=await ce()});try{const n=await Se(d,l,x,r,m,w);c(o,(h=n==null?void 0:n.data)==null?void 0:h.ref_id)}catch(n){let g=I;if(n.status===400){const p=await n.json();g=p.message||p.errorCode||(p==null?void 0:p.status)||I}else n instanceof Error&&(g=n.message);throw new Error(g)}},Ue=()=>{const[o,i]=f.useState("sourceType"),{close:c,visible:u}=$("addItem"),{open:d}=$("addType"),[r]=G(a=>[a.setBudget]),x=he({mode:"onChange"}),{watch:l,setValue:m,reset:w}=x,[h,n]=f.useState(!1),[g,p]=f.useState(""),[s]=oe(a=>[a.addNewNode]),[j]=re(a=>[a.setSelectedNode]);f.useEffect(()=>()=>{i("sourceType"),w()},[u,w]);const S=l("nodeType"),E=l("typeName"),_=l("sourceLink"),U=l("type");l("title");const M=()=>{c()},A=a=>{p(""),i(a)},J=(a,N)=>{const v=N||`new-id-${Math.random()}`,k=a.nodeType.toLocaleLowerCase(),H=Object.entries(a).reduce((D,[K,z])=>(z!=null&&z!==""&&(D[K]=z),D),{}),P={name:a.typeName??a.name,type:k,label:a.typeName??a.name,node_type:k,id:v,edge_count:0,ref_id:v,x:Math.random(),y:Math.random(),z:Math.random(),date:parseInt((new Date().getTime()/1e3).toFixed(0),10),weight:4,...a.source_link?{source_link:a.source_link}:{},properties:{...H}};s({nodes:[P],links:[]}),j(P)},W=x.handleSubmit(async a=>{p(""),n(!0);try{await Pe(a,r,J),ge("Item Added"),M()}catch(N){let v=I;if((N==null?void 0:N.status)===400){const k=await N.json();v=k.errorCode||(k==null?void 0:k.status)||I}else N instanceof Error&&(v=N.message);p(String(v))}finally{n(!1)}}),O=a=>{a==="Create custom type"?d():m("nodeType",a)},Y={sourceType:e.jsx(Me,{allowNextStep:!!S,onSelectType:O,selectedType:S,skipToStep:A}),source:e.jsx(Le,{name:E,skipToStep:A,sourceLink:_||"",type:S}),setBudget:e.jsx(Ne,{error:g,loading:h,onClick:()=>null}),createConfirmation:e.jsx(Be,{onclose:M,type:U}),setAttribues:e.jsx(Ie,{handleSelectType:O,nodeType:S,skipToStep:A})},Q="small";return e.jsx(fe,{id:"addItem",kind:Q,onClose:c,preventOutsideClose:!0,children:e.jsx(ye,{...x,children:e.jsx("form",{id:"add-node-form",onSubmit:W,children:Y[o]})})})};export{Ue as AddItemModal}; +`,Pe=async(o,i,c)=>{var h;const u=Object.entries(o).reduce((n,[g,p])=>(p!=null&&p!==""&&(n[g]=p),n),{}),{nodeType:d,typeName:r,sourceLink:x,...l}=u;let m="",w="";d!=="Create custom type"&&await ae(async()=>{const n=await ie.enable();w=n==null?void 0:n.pubkey,m=await ce()});try{const n=await Se(d,l,x,r,m,w);c(o,(h=n==null?void 0:n.data)==null?void 0:h.ref_id)}catch(n){let g=I;if(n.status===400){const p=await n.json();g=p.message||p.errorCode||(p==null?void 0:p.status)||I}else n instanceof Error&&(g=n.message);throw new Error(g)}},Ue=()=>{const[o,i]=f.useState("sourceType"),{close:c,visible:u}=$("addItem"),{open:d}=$("addType"),[r]=q(a=>[a.setBudget]),x=he({mode:"onChange"}),{watch:l,setValue:m,reset:w}=x,[h,n]=f.useState(!1),[g,p]=f.useState(""),[s]=oe(a=>[a.addNewNode]),[j]=re(a=>[a.setSelectedNode]);f.useEffect(()=>()=>{i("sourceType"),w()},[u,w]);const S=l("nodeType"),_=l("typeName"),A=l("sourceLink"),U=l("type");l("title");const M=()=>{c()},E=a=>{p(""),i(a)},W=(a,N)=>{const v=N||`new-id-${Math.random()}`,k=a.nodeType.toLocaleLowerCase(),Q=Object.entries(a).reduce((D,[H,z])=>(z!=null&&z!==""&&(D[H]=z),D),{}),P={name:a.typeName??a.name,type:k,label:a.typeName??a.name,node_type:k,id:v,edge_count:0,ref_id:v,x:Math.random(),y:Math.random(),z:Math.random(),date:parseInt((new Date().getTime()/1e3).toFixed(0),10),weight:4,...a.source_link?{source_link:a.source_link}:{},properties:{...Q}};s({nodes:[P],links:[]}),j(P)},Y=x.handleSubmit(async a=>{p(""),n(!0);try{await Pe(a,r,W),ge("Item Added"),M()}catch(N){let v=I;if((N==null?void 0:N.status)===400){const k=await N.json();v=k.errorCode||(k==null?void 0:k.status)||I}else N instanceof Error&&(v=N.message);p(String(v))}finally{n(!1)}}),O=a=>{a==="Create custom type"?d():m("nodeType",a)},J={sourceType:e.jsx(Me,{allowNextStep:!!S,onSelectType:O,selectedType:S,skipToStep:E}),source:e.jsx(Le,{name:_,skipToStep:E,sourceLink:A||"",type:S}),setBudget:e.jsx(Ne,{error:g,loading:h,onClick:()=>null}),createConfirmation:e.jsx(Be,{onclose:M,type:U}),setAttribues:e.jsx(Ie,{handleSelectType:O,nodeType:S,skipToStep:E})},K="small";return e.jsx(fe,{id:"addItem",kind:K,onClose:c,preventOutsideClose:!0,children:e.jsx(ye,{...x,children:e.jsx("form",{id:"add-node-form",onSubmit:Y,children:J[o]})})})};export{Ue as AddItemModal}; diff --git a/build/assets/index-7623b989.js b/build/assets/index-560f985a.js similarity index 70% rename from build/assets/index-7623b989.js rename to build/assets/index-560f985a.js index fec317592..debcd09e4 100644 --- a/build/assets/index-7623b989.js +++ b/build/assets/index-560f985a.js @@ -1,4 +1,4 @@ -import{Q as i,j as t,S as a}from"./index-0cb90706.js";import{b5 as e,b6 as n}from"./index-7a7c9631.js";const l=i.div` +import{Q as i,j as t,S as a}from"./index-ead79979.js";import{b6 as e,b7 as n}from"./index-74184c93.js";const l=i.div` display: Flex; justify-content: center; align-items: center; diff --git a/build/assets/index-cb90f054.js b/build/assets/index-59ea340d.js similarity index 99% rename from build/assets/index-cb90f054.js rename to build/assets/index-59ea340d.js index c42de5986..b872d47ee 100644 --- a/build/assets/index-cb90f054.js +++ b/build/assets/index-59ea340d.js @@ -1,4 +1,4 @@ -import{j as e,ad as s,a4 as d,N as w,au as k,a5 as o,Q as l,S as n,U as a}from"./index-0cb90706.js";import{A as f}from"./AddContentIcon-d2758ba1.js";import{C as H}from"./index-7a7c9631.js";const L=t=>e.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("mask",{id:"mask0_1259_27",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:e.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),e.jsx("g",{mask:"url(#mask0_1259_27)",children:e.jsx("path",{d:"M5.30773 20.5C4.81061 20.5 4.38506 20.3229 4.03106 19.9689C3.67704 19.6149 3.50003 19.1894 3.50003 18.6923V5.3077C3.50003 4.81058 3.67704 4.38503 4.03106 4.03103C4.38506 3.67701 4.81061 3.5 5.30773 3.5H18.6923C19.1894 3.5 19.615 3.67701 19.969 4.03103C20.323 4.38503 20.5 4.81058 20.5 5.3077V11.6327C20.2538 11.5275 20.0074 11.4384 19.7606 11.3654C19.5138 11.2923 19.2603 11.234 19 11.1904V5.3077C19 5.23077 18.968 5.16024 18.9039 5.09613C18.8397 5.03203 18.7692 4.99998 18.6923 4.99998H5.30773C5.2308 4.99998 5.16027 5.03203 5.09616 5.09613C5.03206 5.16024 5.00001 5.23077 5.00001 5.3077V18.6923C5.00001 18.7692 5.03206 18.8397 5.09616 18.9038C5.16027 18.9679 5.2308 19 5.30773 19H11.1654C11.2026 19.2769 11.2577 19.5387 11.3308 19.7855C11.4038 20.0323 11.4929 20.2705 11.5981 20.5H5.30773ZM5.00001 19V4.99998V11.1904V11.1154V19ZM7.25003 15.8849C7.25003 16.0975 7.32191 16.2756 7.46566 16.4192C7.60939 16.5628 7.78751 16.6346 8.00001 16.6346H11.2673C11.3109 16.3743 11.3757 16.1208 11.4616 15.874C11.5475 15.6272 11.641 15.3808 11.7423 15.1346H8.00001C7.78751 15.1346 7.60939 15.2065 7.46566 15.3503C7.32191 15.4941 7.25003 15.6723 7.25003 15.8849ZM7.25003 12.0003C7.25003 12.2129 7.32191 12.391 7.46566 12.5346C7.60939 12.6782 7.78751 12.75 8.00001 12.75H13.5904C14.0212 12.3846 14.4808 12.0785 14.9692 11.8317C15.4577 11.5849 15.9807 11.4096 16.5384 11.3058C16.4259 11.281 16.3009 11.2655 16.1634 11.2593C16.0259 11.2531 15.901 11.25 15.7885 11.25H8.00001C7.78751 11.25 7.60939 11.3219 7.46566 11.4657C7.32191 11.6095 7.25003 11.7877 7.25003 12.0003ZM7.25003 8.1157C7.25003 8.3283 7.32191 8.50639 7.46566 8.64998C7.60939 8.79356 7.78751 8.86535 8.00001 8.86535H16C16.2125 8.86535 16.3906 8.79344 16.5344 8.64963C16.6781 8.50583 16.75 8.32763 16.75 8.11503C16.75 7.90244 16.6781 7.72436 16.5344 7.58078C16.3906 7.43718 16.2125 7.36538 16 7.36538H8.00001C7.78751 7.36538 7.60939 7.43728 7.46566 7.5811C7.32191 7.72492 7.25003 7.90312 7.25003 8.1157ZM18 22.5576C16.7513 22.5576 15.6891 22.1198 14.8135 21.2442C13.9378 20.3685 13.5 19.3064 13.5 18.0577C13.5 16.809 13.9378 15.7468 14.8135 14.8712C15.6891 13.9955 16.7513 13.5577 18 13.5577C19.2487 13.5577 20.3109 13.9955 21.1865 14.8712C22.0622 15.7468 22.5 16.809 22.5 18.0577C22.5 19.3064 22.0622 20.3685 21.1865 21.2442C20.3109 22.1198 19.2487 22.5576 18 22.5576ZM17.5577 18.5V20.5577C17.5577 20.6756 17.6019 20.7788 17.6904 20.8673C17.7788 20.9557 17.8821 21 18 21C18.118 21 18.2212 20.9557 18.3096 20.8673C18.3981 20.7788 18.4423 20.6756 18.4423 20.5577V18.5H20.5C20.618 18.5 20.7212 18.4557 20.8096 18.3673C20.8981 18.2788 20.9423 18.1756 20.9423 18.0577C20.9423 17.9397 20.8981 17.8365 20.8096 17.748C20.7212 17.6596 20.618 17.6154 20.5 17.6154H18.4423V15.5577C18.4423 15.4397 18.3981 15.3365 18.3096 15.2481C18.2212 15.1596 18.118 15.1154 18 15.1154C17.8821 15.1154 17.7788 15.1596 17.6904 15.2481C17.6019 15.3365 17.5577 15.4397 17.5577 15.5577V17.6154H15.5C15.3821 17.6154 15.2788 17.6596 15.1904 17.748C15.1019 17.8365 15.0577 17.9397 15.0577 18.0577C15.0577 18.1756 15.1019 18.2788 15.1904 18.3673C15.2788 18.4557 15.3821 18.5 15.5 18.5H17.5577Z",fill:"currentColor"})})]}),M=t=>e.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 25 22",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.8553 2.95196L15.3555 5.30477C15.2095 5.44218 15.1081 5.62031 15.0647 5.81603L14.52 8.26717H7.41204C6.80549 8.26717 6.31378 8.75888 6.31378 9.36543C6.31378 9.97198 6.80549 10.4637 7.41204 10.4637H15.0998C15.1427 10.4637 15.185 10.4612 15.2266 10.4564C15.2442 10.4574 15.2619 10.4578 15.2798 10.4578H18.6054C18.8441 10.4578 19.0749 10.3724 19.2562 10.2171L21.3582 8.41535C21.5744 9.252 21.6894 10.1293 21.6894 11.0336C21.6894 16.7958 17.0182 21.467 11.256 21.467C9.70613 21.467 8.23523 21.1291 6.91291 20.5229L1.57616 21.8571C1.20996 21.9486 0.878268 21.6169 0.969816 21.2508L2.21945 16.2522C1.33102 14.7172 0.82251 12.9347 0.82251 11.0336C0.82251 5.27132 5.49373 0.600098 11.256 0.600098C13.7596 0.600098 16.0573 1.48194 17.8553 2.95196ZM7.41204 12.6603C6.80549 12.6603 6.31378 13.152 6.31378 13.7586C6.31378 14.3651 6.80549 14.8568 7.41204 14.8568H11.8051C12.4116 14.8568 12.9033 14.3651 12.9033 13.7586C12.9033 13.152 12.4116 12.6603 11.8051 12.6603H7.41204ZM22.1006 1.12041L16.3757 6.84529C16.3348 6.88621 16.3066 6.93809 16.2945 6.99468L15.9135 8.77616C15.868 8.98885 16.0569 9.17774 16.2696 9.13226L18.0511 8.75129C18.1077 8.73919 18.1596 8.71098 18.2005 8.67006L23.9254 2.94518C24.0425 2.82803 24.0425 2.63808 23.9254 2.52092L22.5249 1.12041C22.4077 1.00325 22.2178 1.00325 22.1006 1.12041Z",fill:"currentColor"})}),v=t=>e.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("mask",{id:"mask0_1259_29",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:e.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),e.jsx("g",{mask:"url(#mask0_1259_29)",children:e.jsx("path",{d:"M13.5096 21.5H10.4808C10.2564 21.5 10.0622 21.4246 9.8981 21.274C9.734 21.1233 9.63528 20.9358 9.60195 20.7115L9.31157 18.4538C9.04362 18.3641 8.76894 18.2384 8.48752 18.0769C8.2061 17.9153 7.9545 17.7422 7.7327 17.5576L5.64425 18.4384C5.43015 18.5217 5.21765 18.5301 5.00675 18.4634C4.79585 18.3967 4.63014 18.2647 4.50962 18.0673L3.00582 15.4481C2.8853 15.2506 2.84845 15.0397 2.89525 14.8154C2.94203 14.591 3.0558 14.4102 3.23657 14.2731L5.04427 12.9058C5.02119 12.757 5.00484 12.6077 4.99522 12.4577C4.9856 12.3077 4.9808 12.1583 4.9808 12.0096C4.9808 11.8673 4.9856 11.7227 4.99522 11.5759C5.00484 11.4291 5.02119 11.2686 5.04427 11.0942L3.23657 9.72688C3.0558 9.58971 2.94203 9.40894 2.89525 9.18458C2.84845 8.96023 2.8853 8.74934 3.00582 8.5519L4.50962 5.95195C4.61989 5.74425 4.78143 5.60963 4.99425 5.5481C5.20706 5.48657 5.42052 5.49747 5.63462 5.5808L7.72307 6.45195C7.9641 6.26092 8.22148 6.08623 8.4952 5.9279C8.76893 5.76955 9.03785 5.6423 9.30195 5.54615L9.60195 3.28848C9.63528 3.06411 9.734 2.87661 9.8981 2.72598C10.0622 2.57533 10.2564 2.5 10.4808 2.5H13.5096C13.7339 2.5 13.9298 2.57533 14.0971 2.72598C14.2644 2.87661 14.3647 3.06411 14.398 3.28848L14.6884 5.55578C14.9884 5.66474 15.2599 5.79198 15.5029 5.9375C15.7458 6.08302 15.991 6.2545 16.2384 6.45195L18.3654 5.5808C18.5795 5.49747 18.7904 5.48753 18.998 5.55098C19.2057 5.61444 19.3699 5.74489 19.4904 5.94233L20.9942 8.5519C21.1147 8.74934 21.1515 8.96023 21.1047 9.18458C21.058 9.40894 20.9442 9.58971 20.7634 9.72688L18.9173 11.123C18.9532 11.2846 18.9727 11.4355 18.9759 11.5759C18.9791 11.7163 18.9807 11.8577 18.9807 12C18.9807 12.1359 18.9775 12.274 18.9711 12.4144C18.9647 12.5548 18.9416 12.7154 18.9019 12.8962L20.7288 14.2731C20.916 14.4038 21.0314 14.583 21.0749 14.8106C21.1185 15.0381 21.0801 15.2506 20.9596 15.4481L19.4557 18.0519C19.3352 18.2493 19.167 18.3823 18.9509 18.4509C18.7349 18.5195 18.5198 18.5121 18.3057 18.4288L16.2384 17.548C15.991 17.7455 15.7384 17.9201 15.4807 18.0721C15.223 18.224 14.9589 18.348 14.6884 18.4442L14.398 20.7115C14.3647 20.9358 14.2644 21.1233 14.0971 21.274C13.9298 21.4246 13.7339 21.5 13.5096 21.5ZM12.0115 15C12.8436 15 13.5516 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.1679 14.7195 10.4599 14.1355 9.87595C13.5516 9.29198 12.8436 9 12.0115 9C11.1692 9 10.4587 9.29198 9.87982 9.87595C9.30099 10.4599 9.01157 11.1679 9.01157 12C9.01157 12.832 9.30099 13.54 9.87982 14.124C10.4587 14.708 11.1692 15 12.0115 15Z",fill:"currentColor"})})]}),y=t=>e.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("mask",{id:"mask0_1259_26",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:e.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),e.jsx("g",{mask:"url(#mask0_1259_26)",children:e.jsx("path",{d:"M10.0577 18.7499C9.84521 18.7499 9.66708 18.678 9.52333 18.5342C9.3796 18.3904 9.30773 18.2122 9.30773 17.9996C9.30773 17.787 9.3796 17.609 9.52333 17.4654C9.66708 17.3218 9.84521 17.25 10.0577 17.25H19.75C19.9625 17.25 20.1406 17.3219 20.2844 17.4657C20.4281 17.6095 20.5 17.7877 20.5 18.0003C20.5 18.2129 20.4281 18.391 20.2844 18.5346C20.1406 18.6782 19.9625 18.7499 19.75 18.7499H10.0577ZM10.0577 12.7499C9.84521 12.7499 9.66708 12.678 9.52333 12.5342C9.3796 12.3904 9.30773 12.2122 9.30773 11.9996C9.30773 11.787 9.3796 11.609 9.52333 11.4654C9.66708 11.3218 9.84521 11.25 10.0577 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2844 11.4657C20.4281 11.6095 20.5 11.7877 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2844 12.5346C20.1406 12.6782 19.9625 12.7499 19.75 12.7499H10.0577ZM10.0577 6.74995C9.84521 6.74995 9.66708 6.67805 9.52333 6.53425C9.3796 6.39043 9.30773 6.21223 9.30773 5.99965C9.30773 5.78705 9.3796 5.60896 9.52333 5.46537C9.66708 5.32179 9.84521 5.25 10.0577 5.25H19.75C19.9625 5.25 20.1406 5.3219 20.2844 5.4657C20.4281 5.60951 20.5 5.78771 20.5 6.0003C20.5 6.2129 20.4281 6.39099 20.2844 6.53457C20.1406 6.67816 19.9625 6.74995 19.75 6.74995H10.0577ZM5.16348 19.6634C4.70603 19.6634 4.31443 19.5005 3.98868 19.1748C3.66291 18.849 3.50003 18.4574 3.50003 18C3.50003 17.5425 3.66291 17.1509 3.98868 16.8252C4.31443 16.4994 4.70603 16.3365 5.16348 16.3365C5.62093 16.3365 6.01253 16.4994 6.33828 16.8252C6.66403 17.1509 6.82691 17.5425 6.82691 18C6.82691 18.4574 6.66403 18.849 6.33828 19.1748C6.01253 19.5005 5.62093 19.6634 5.16348 19.6634ZM5.16348 13.6634C4.70603 13.6634 4.31443 13.5005 3.98868 13.1748C3.66291 12.849 3.50003 12.4574 3.50003 12C3.50003 11.5425 3.66291 11.1509 3.98868 10.8252C4.31443 10.4994 4.70603 10.3365 5.16348 10.3365C5.62093 10.3365 6.01253 10.4994 6.33828 10.8252C6.66403 11.1509 6.82691 11.5425 6.82691 12C6.82691 12.4574 6.66403 12.849 6.33828 13.1748C6.01253 13.5005 5.62093 13.6634 5.16348 13.6634ZM5.16348 7.6634C4.70603 7.6634 4.31443 7.50052 3.98868 7.17477C3.66291 6.84902 3.50003 6.45742 3.50003 5.99997C3.50003 5.54252 3.66291 5.15092 3.98868 4.82517C4.31443 4.49942 4.70603 4.33655 5.16348 4.33655C5.62093 4.33655 6.01253 4.49942 6.33828 4.82517C6.66403 5.15092 6.82691 5.54252 6.82691 5.99997C6.82691 6.45742 6.66403 6.84902 6.33828 7.17477C6.01253 7.50052 5.62093 7.6634 5.16348 7.6634Z",fill:"currentColor"})})]}),_=()=>{const{open:t}=s("sourcesTable"),{open:h}=s("addItem"),{open:p}=s("addContent"),{open:x}=s("settings"),{open:u}=s("blueprintGraph"),{open:m}=s("feedback"),g=d(r=>r.customSchemaFeatureFlag),j=d(r=>r.userFeedbackFeatureFlag),[c]=w(r=>[r.isAdmin]),b=k();return e.jsxs(S,{children:[e.jsx(Z,{children:e.jsx("img",{alt:"Second brain",src:"logo.svg"})}),c?e.jsxs(C,{"data-testid":"add-item-modal",onClick:h,children:[e.jsx(i,{children:e.jsx(L,{})}),e.jsx(o,{children:"Add Item"})]}):null,e.jsxs(C,{"data-testid":"add-content-modal",onClick:p,children:[e.jsx(i,{children:e.jsx(f,{})}),e.jsx(o,{children:"Add Content"})]}),e.jsxs(C,{id:"cy-open-soure-table",onClick:t,children:[e.jsx(i,{children:e.jsx(y,{})}),e.jsx(o,{children:"Source Table"})]}),g&&c?e.jsxs(C,{id:"cy-open-soure-table",onClick:u,children:[e.jsx(i,{children:e.jsx(H,{})}),e.jsx(o,{children:"Blueprint"})]}):null,e.jsxs(C,{"data-testid":"settings-modal",onClick:x,children:[e.jsx(i,{children:e.jsx(v,{})}),e.jsx(o,{children:"Settings"})]}),j&&b?e.jsxs(F,{"data-testid":"feedback-modal",onClick:m,children:[e.jsx(i,{children:e.jsx(M,{})}),e.jsx(o,{children:"Send Feedback"})]}):null]})},S=l(a).attrs({align:"flex-start",direction:"column",justify:"flex-start"})` +import{j as e,ad as s,a4 as d,N as w,au as k,a5 as o,Q as l,S as n,U as a}from"./index-ead79979.js";import{A as f}from"./AddContentIcon-8ff66903.js";import{C as H}from"./index-74184c93.js";const L=t=>e.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("mask",{id:"mask0_1259_27",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:e.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),e.jsx("g",{mask:"url(#mask0_1259_27)",children:e.jsx("path",{d:"M5.30773 20.5C4.81061 20.5 4.38506 20.3229 4.03106 19.9689C3.67704 19.6149 3.50003 19.1894 3.50003 18.6923V5.3077C3.50003 4.81058 3.67704 4.38503 4.03106 4.03103C4.38506 3.67701 4.81061 3.5 5.30773 3.5H18.6923C19.1894 3.5 19.615 3.67701 19.969 4.03103C20.323 4.38503 20.5 4.81058 20.5 5.3077V11.6327C20.2538 11.5275 20.0074 11.4384 19.7606 11.3654C19.5138 11.2923 19.2603 11.234 19 11.1904V5.3077C19 5.23077 18.968 5.16024 18.9039 5.09613C18.8397 5.03203 18.7692 4.99998 18.6923 4.99998H5.30773C5.2308 4.99998 5.16027 5.03203 5.09616 5.09613C5.03206 5.16024 5.00001 5.23077 5.00001 5.3077V18.6923C5.00001 18.7692 5.03206 18.8397 5.09616 18.9038C5.16027 18.9679 5.2308 19 5.30773 19H11.1654C11.2026 19.2769 11.2577 19.5387 11.3308 19.7855C11.4038 20.0323 11.4929 20.2705 11.5981 20.5H5.30773ZM5.00001 19V4.99998V11.1904V11.1154V19ZM7.25003 15.8849C7.25003 16.0975 7.32191 16.2756 7.46566 16.4192C7.60939 16.5628 7.78751 16.6346 8.00001 16.6346H11.2673C11.3109 16.3743 11.3757 16.1208 11.4616 15.874C11.5475 15.6272 11.641 15.3808 11.7423 15.1346H8.00001C7.78751 15.1346 7.60939 15.2065 7.46566 15.3503C7.32191 15.4941 7.25003 15.6723 7.25003 15.8849ZM7.25003 12.0003C7.25003 12.2129 7.32191 12.391 7.46566 12.5346C7.60939 12.6782 7.78751 12.75 8.00001 12.75H13.5904C14.0212 12.3846 14.4808 12.0785 14.9692 11.8317C15.4577 11.5849 15.9807 11.4096 16.5384 11.3058C16.4259 11.281 16.3009 11.2655 16.1634 11.2593C16.0259 11.2531 15.901 11.25 15.7885 11.25H8.00001C7.78751 11.25 7.60939 11.3219 7.46566 11.4657C7.32191 11.6095 7.25003 11.7877 7.25003 12.0003ZM7.25003 8.1157C7.25003 8.3283 7.32191 8.50639 7.46566 8.64998C7.60939 8.79356 7.78751 8.86535 8.00001 8.86535H16C16.2125 8.86535 16.3906 8.79344 16.5344 8.64963C16.6781 8.50583 16.75 8.32763 16.75 8.11503C16.75 7.90244 16.6781 7.72436 16.5344 7.58078C16.3906 7.43718 16.2125 7.36538 16 7.36538H8.00001C7.78751 7.36538 7.60939 7.43728 7.46566 7.5811C7.32191 7.72492 7.25003 7.90312 7.25003 8.1157ZM18 22.5576C16.7513 22.5576 15.6891 22.1198 14.8135 21.2442C13.9378 20.3685 13.5 19.3064 13.5 18.0577C13.5 16.809 13.9378 15.7468 14.8135 14.8712C15.6891 13.9955 16.7513 13.5577 18 13.5577C19.2487 13.5577 20.3109 13.9955 21.1865 14.8712C22.0622 15.7468 22.5 16.809 22.5 18.0577C22.5 19.3064 22.0622 20.3685 21.1865 21.2442C20.3109 22.1198 19.2487 22.5576 18 22.5576ZM17.5577 18.5V20.5577C17.5577 20.6756 17.6019 20.7788 17.6904 20.8673C17.7788 20.9557 17.8821 21 18 21C18.118 21 18.2212 20.9557 18.3096 20.8673C18.3981 20.7788 18.4423 20.6756 18.4423 20.5577V18.5H20.5C20.618 18.5 20.7212 18.4557 20.8096 18.3673C20.8981 18.2788 20.9423 18.1756 20.9423 18.0577C20.9423 17.9397 20.8981 17.8365 20.8096 17.748C20.7212 17.6596 20.618 17.6154 20.5 17.6154H18.4423V15.5577C18.4423 15.4397 18.3981 15.3365 18.3096 15.2481C18.2212 15.1596 18.118 15.1154 18 15.1154C17.8821 15.1154 17.7788 15.1596 17.6904 15.2481C17.6019 15.3365 17.5577 15.4397 17.5577 15.5577V17.6154H15.5C15.3821 17.6154 15.2788 17.6596 15.1904 17.748C15.1019 17.8365 15.0577 17.9397 15.0577 18.0577C15.0577 18.1756 15.1019 18.2788 15.1904 18.3673C15.2788 18.4557 15.3821 18.5 15.5 18.5H17.5577Z",fill:"currentColor"})})]}),M=t=>e.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 25 22",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.8553 2.95196L15.3555 5.30477C15.2095 5.44218 15.1081 5.62031 15.0647 5.81603L14.52 8.26717H7.41204C6.80549 8.26717 6.31378 8.75888 6.31378 9.36543C6.31378 9.97198 6.80549 10.4637 7.41204 10.4637H15.0998C15.1427 10.4637 15.185 10.4612 15.2266 10.4564C15.2442 10.4574 15.2619 10.4578 15.2798 10.4578H18.6054C18.8441 10.4578 19.0749 10.3724 19.2562 10.2171L21.3582 8.41535C21.5744 9.252 21.6894 10.1293 21.6894 11.0336C21.6894 16.7958 17.0182 21.467 11.256 21.467C9.70613 21.467 8.23523 21.1291 6.91291 20.5229L1.57616 21.8571C1.20996 21.9486 0.878268 21.6169 0.969816 21.2508L2.21945 16.2522C1.33102 14.7172 0.82251 12.9347 0.82251 11.0336C0.82251 5.27132 5.49373 0.600098 11.256 0.600098C13.7596 0.600098 16.0573 1.48194 17.8553 2.95196ZM7.41204 12.6603C6.80549 12.6603 6.31378 13.152 6.31378 13.7586C6.31378 14.3651 6.80549 14.8568 7.41204 14.8568H11.8051C12.4116 14.8568 12.9033 14.3651 12.9033 13.7586C12.9033 13.152 12.4116 12.6603 11.8051 12.6603H7.41204ZM22.1006 1.12041L16.3757 6.84529C16.3348 6.88621 16.3066 6.93809 16.2945 6.99468L15.9135 8.77616C15.868 8.98885 16.0569 9.17774 16.2696 9.13226L18.0511 8.75129C18.1077 8.73919 18.1596 8.71098 18.2005 8.67006L23.9254 2.94518C24.0425 2.82803 24.0425 2.63808 23.9254 2.52092L22.5249 1.12041C22.4077 1.00325 22.2178 1.00325 22.1006 1.12041Z",fill:"currentColor"})}),v=t=>e.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("mask",{id:"mask0_1259_29",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:e.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),e.jsx("g",{mask:"url(#mask0_1259_29)",children:e.jsx("path",{d:"M13.5096 21.5H10.4808C10.2564 21.5 10.0622 21.4246 9.8981 21.274C9.734 21.1233 9.63528 20.9358 9.60195 20.7115L9.31157 18.4538C9.04362 18.3641 8.76894 18.2384 8.48752 18.0769C8.2061 17.9153 7.9545 17.7422 7.7327 17.5576L5.64425 18.4384C5.43015 18.5217 5.21765 18.5301 5.00675 18.4634C4.79585 18.3967 4.63014 18.2647 4.50962 18.0673L3.00582 15.4481C2.8853 15.2506 2.84845 15.0397 2.89525 14.8154C2.94203 14.591 3.0558 14.4102 3.23657 14.2731L5.04427 12.9058C5.02119 12.757 5.00484 12.6077 4.99522 12.4577C4.9856 12.3077 4.9808 12.1583 4.9808 12.0096C4.9808 11.8673 4.9856 11.7227 4.99522 11.5759C5.00484 11.4291 5.02119 11.2686 5.04427 11.0942L3.23657 9.72688C3.0558 9.58971 2.94203 9.40894 2.89525 9.18458C2.84845 8.96023 2.8853 8.74934 3.00582 8.5519L4.50962 5.95195C4.61989 5.74425 4.78143 5.60963 4.99425 5.5481C5.20706 5.48657 5.42052 5.49747 5.63462 5.5808L7.72307 6.45195C7.9641 6.26092 8.22148 6.08623 8.4952 5.9279C8.76893 5.76955 9.03785 5.6423 9.30195 5.54615L9.60195 3.28848C9.63528 3.06411 9.734 2.87661 9.8981 2.72598C10.0622 2.57533 10.2564 2.5 10.4808 2.5H13.5096C13.7339 2.5 13.9298 2.57533 14.0971 2.72598C14.2644 2.87661 14.3647 3.06411 14.398 3.28848L14.6884 5.55578C14.9884 5.66474 15.2599 5.79198 15.5029 5.9375C15.7458 6.08302 15.991 6.2545 16.2384 6.45195L18.3654 5.5808C18.5795 5.49747 18.7904 5.48753 18.998 5.55098C19.2057 5.61444 19.3699 5.74489 19.4904 5.94233L20.9942 8.5519C21.1147 8.74934 21.1515 8.96023 21.1047 9.18458C21.058 9.40894 20.9442 9.58971 20.7634 9.72688L18.9173 11.123C18.9532 11.2846 18.9727 11.4355 18.9759 11.5759C18.9791 11.7163 18.9807 11.8577 18.9807 12C18.9807 12.1359 18.9775 12.274 18.9711 12.4144C18.9647 12.5548 18.9416 12.7154 18.9019 12.8962L20.7288 14.2731C20.916 14.4038 21.0314 14.583 21.0749 14.8106C21.1185 15.0381 21.0801 15.2506 20.9596 15.4481L19.4557 18.0519C19.3352 18.2493 19.167 18.3823 18.9509 18.4509C18.7349 18.5195 18.5198 18.5121 18.3057 18.4288L16.2384 17.548C15.991 17.7455 15.7384 17.9201 15.4807 18.0721C15.223 18.224 14.9589 18.348 14.6884 18.4442L14.398 20.7115C14.3647 20.9358 14.2644 21.1233 14.0971 21.274C13.9298 21.4246 13.7339 21.5 13.5096 21.5ZM12.0115 15C12.8436 15 13.5516 14.708 14.1355 14.124C14.7195 13.54 15.0115 12.832 15.0115 12C15.0115 11.1679 14.7195 10.4599 14.1355 9.87595C13.5516 9.29198 12.8436 9 12.0115 9C11.1692 9 10.4587 9.29198 9.87982 9.87595C9.30099 10.4599 9.01157 11.1679 9.01157 12C9.01157 12.832 9.30099 13.54 9.87982 14.124C10.4587 14.708 11.1692 15 12.0115 15Z",fill:"currentColor"})})]}),y=t=>e.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("mask",{id:"mask0_1259_26",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:e.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),e.jsx("g",{mask:"url(#mask0_1259_26)",children:e.jsx("path",{d:"M10.0577 18.7499C9.84521 18.7499 9.66708 18.678 9.52333 18.5342C9.3796 18.3904 9.30773 18.2122 9.30773 17.9996C9.30773 17.787 9.3796 17.609 9.52333 17.4654C9.66708 17.3218 9.84521 17.25 10.0577 17.25H19.75C19.9625 17.25 20.1406 17.3219 20.2844 17.4657C20.4281 17.6095 20.5 17.7877 20.5 18.0003C20.5 18.2129 20.4281 18.391 20.2844 18.5346C20.1406 18.6782 19.9625 18.7499 19.75 18.7499H10.0577ZM10.0577 12.7499C9.84521 12.7499 9.66708 12.678 9.52333 12.5342C9.3796 12.3904 9.30773 12.2122 9.30773 11.9996C9.30773 11.787 9.3796 11.609 9.52333 11.4654C9.66708 11.3218 9.84521 11.25 10.0577 11.25H19.75C19.9625 11.25 20.1406 11.3219 20.2844 11.4657C20.4281 11.6095 20.5 11.7877 20.5 12.0003C20.5 12.2129 20.4281 12.391 20.2844 12.5346C20.1406 12.6782 19.9625 12.7499 19.75 12.7499H10.0577ZM10.0577 6.74995C9.84521 6.74995 9.66708 6.67805 9.52333 6.53425C9.3796 6.39043 9.30773 6.21223 9.30773 5.99965C9.30773 5.78705 9.3796 5.60896 9.52333 5.46537C9.66708 5.32179 9.84521 5.25 10.0577 5.25H19.75C19.9625 5.25 20.1406 5.3219 20.2844 5.4657C20.4281 5.60951 20.5 5.78771 20.5 6.0003C20.5 6.2129 20.4281 6.39099 20.2844 6.53457C20.1406 6.67816 19.9625 6.74995 19.75 6.74995H10.0577ZM5.16348 19.6634C4.70603 19.6634 4.31443 19.5005 3.98868 19.1748C3.66291 18.849 3.50003 18.4574 3.50003 18C3.50003 17.5425 3.66291 17.1509 3.98868 16.8252C4.31443 16.4994 4.70603 16.3365 5.16348 16.3365C5.62093 16.3365 6.01253 16.4994 6.33828 16.8252C6.66403 17.1509 6.82691 17.5425 6.82691 18C6.82691 18.4574 6.66403 18.849 6.33828 19.1748C6.01253 19.5005 5.62093 19.6634 5.16348 19.6634ZM5.16348 13.6634C4.70603 13.6634 4.31443 13.5005 3.98868 13.1748C3.66291 12.849 3.50003 12.4574 3.50003 12C3.50003 11.5425 3.66291 11.1509 3.98868 10.8252C4.31443 10.4994 4.70603 10.3365 5.16348 10.3365C5.62093 10.3365 6.01253 10.4994 6.33828 10.8252C6.66403 11.1509 6.82691 11.5425 6.82691 12C6.82691 12.4574 6.66403 12.849 6.33828 13.1748C6.01253 13.5005 5.62093 13.6634 5.16348 13.6634ZM5.16348 7.6634C4.70603 7.6634 4.31443 7.50052 3.98868 7.17477C3.66291 6.84902 3.50003 6.45742 3.50003 5.99997C3.50003 5.54252 3.66291 5.15092 3.98868 4.82517C4.31443 4.49942 4.70603 4.33655 5.16348 4.33655C5.62093 4.33655 6.01253 4.49942 6.33828 4.82517C6.66403 5.15092 6.82691 5.54252 6.82691 5.99997C6.82691 6.45742 6.66403 6.84902 6.33828 7.17477C6.01253 7.50052 5.62093 7.6634 5.16348 7.6634Z",fill:"currentColor"})})]}),_=()=>{const{open:t}=s("sourcesTable"),{open:h}=s("addItem"),{open:p}=s("addContent"),{open:x}=s("settings"),{open:u}=s("blueprintGraph"),{open:m}=s("feedback"),g=d(r=>r.customSchemaFeatureFlag),j=d(r=>r.userFeedbackFeatureFlag),[c]=w(r=>[r.isAdmin]),b=k();return e.jsxs(S,{children:[e.jsx(Z,{children:e.jsx("img",{alt:"Second brain",src:"logo.svg"})}),c?e.jsxs(C,{"data-testid":"add-item-modal",onClick:h,children:[e.jsx(i,{children:e.jsx(L,{})}),e.jsx(o,{children:"Add Item"})]}):null,e.jsxs(C,{"data-testid":"add-content-modal",onClick:p,children:[e.jsx(i,{children:e.jsx(f,{})}),e.jsx(o,{children:"Add Content"})]}),e.jsxs(C,{id:"cy-open-soure-table",onClick:t,children:[e.jsx(i,{children:e.jsx(y,{})}),e.jsx(o,{children:"Source Table"})]}),g&&c?e.jsxs(C,{id:"cy-open-soure-table",onClick:u,children:[e.jsx(i,{children:e.jsx(H,{})}),e.jsx(o,{children:"Blueprint"})]}):null,e.jsxs(C,{"data-testid":"settings-modal",onClick:x,children:[e.jsx(i,{children:e.jsx(v,{})}),e.jsx(o,{children:"Settings"})]}),j&&b?e.jsxs(F,{"data-testid":"feedback-modal",onClick:m,children:[e.jsx(i,{children:e.jsx(M,{})}),e.jsx(o,{children:"Send Feedback"})]}):null]})},S=l(a).attrs({align:"flex-start",direction:"column",justify:"flex-start"})` flex: 0 0 64px; z-index: 31; transition: opacity 1s; diff --git a/build/assets/index-e97f9fe0.js b/build/assets/index-7347cedb.js similarity index 92% rename from build/assets/index-e97f9fe0.js rename to build/assets/index-7347cedb.js index 31b4951e5..69487ec79 100644 --- a/build/assets/index-e97f9fe0.js +++ b/build/assets/index-7347cedb.js @@ -1,4 +1,4 @@ -import{Q as o,U as s,a5 as g,O as y,j as e,a3 as b,av as w,ar as S,S as x,r as v,N as T,ad as m}from"./index-0cb90706.js";import{aH as A,aI as f,ae as C,af as M,aJ as u,aE as $,aK as B,aL as G,aF as k}from"./index-7a7c9631.js";const D=({onClose:t})=>{const[i]=y(n=>[n.graphStyle]),r=()=>{localStorage.setItem("graphStyle",i),t()};return e.jsxs(z,{direction:"column",children:[e.jsx(F,{children:"Default graph view:"}),e.jsx(A,{}),e.jsx(s,{mt:308,children:e.jsx(f,{kind:"big",onClick:r,children:"Save Changes"})})]})},z=o(s)` +import{Q as o,U as s,a5 as g,O as y,j as e,a3 as b,av as w,ar as S,S as x,r as v,N as T,ad as m}from"./index-ead79979.js";import{aI as A,aJ as f,af as C,ag as M,aK as u,aF as G,aL as $,aM as B,aG as k}from"./index-74184c93.js";const D=({onClose:t})=>{const[i]=y(n=>[n.graphStyle]),r=()=>{localStorage.setItem("graphStyle",i),t()};return e.jsxs(z,{direction:"column",children:[e.jsx(F,{children:"Default graph view:"}),e.jsx(A,{}),e.jsx(s,{mt:308,children:e.jsx(f,{kind:"big",onClick:r,children:"Save Changes"})})]})},z=o(s)` display: flex; gap: 10px; padding: 36px; @@ -6,12 +6,12 @@ import{Q as o,U as s,a5 as g,O as y,j as e,a3 as b,av as w,ar as S,S as x,r as v font-family: Barlow; font-size: 13px; font-weight: 400; -`,L=({initialValues:t})=>{const i=C({defaultValues:t,mode:"onSubmit"}),{isSubmitting:r}=i.formState,n=b(d=>d.setAppMetaData),l=i.handleSubmit(async d=>{try{(await w(d)).status==="success"&&n(d)}catch(c){console.warn(c)}});return e.jsx(M,{...i,children:e.jsx(R,{id:"add-node-form",onSubmit:l,children:e.jsxs(e.Fragment,{children:[e.jsxs(s,{children:[e.jsx(s,{pt:20,children:e.jsx(u,{id:"cy-about-title-id",label:"Graph Title",maxLength:50,name:"title",placeholder:"Type graph title here...",rules:{...S}})}),e.jsx(s,{pt:20,children:e.jsx(u,{id:"cy-about-id",label:"Graph Description",maxLength:100,name:"description",placeholder:"Type graph description here..."})})]}),e.jsx(s,{mt:210,py:24,children:r?e.jsx(P,{children:e.jsx($,{color:x.white,size:20})}):e.jsx(f,{disabled:r,id:"add-node-submit-cta",kind:"big",type:"submit",children:"Save Changes"})})]})})})},P=o(s).attrs({align:"center",background:"primaryButton",borderRadius:8,justify:"center"})` +`,L=({initialValues:t})=>{const i=C({defaultValues:t,mode:"onSubmit"}),{isSubmitting:r}=i.formState,n=b(d=>d.setAppMetaData),l=i.handleSubmit(async d=>{try{(await w(d)).status==="success"&&n(d)}catch(c){console.warn(c)}});return e.jsx(M,{...i,children:e.jsx(R,{id:"add-node-form",onSubmit:l,children:e.jsxs(e.Fragment,{children:[e.jsxs(s,{children:[e.jsx(s,{pt:20,children:e.jsx(u,{id:"cy-about-title-id",label:"Graph Title",maxLength:50,name:"title",placeholder:"Type graph title here...",rules:{...S}})}),e.jsx(s,{pt:20,children:e.jsx(u,{id:"cy-about-id",label:"Graph Description",maxLength:100,name:"description",placeholder:"Type graph description here..."})})]}),e.jsx(s,{mt:210,py:24,children:r?e.jsx(P,{children:e.jsx(G,{color:x.white,size:20})}):e.jsx(f,{disabled:r,id:"add-node-submit-cta",kind:"big",type:"submit",children:"Save Changes"})})]})})})},P=o(s).attrs({align:"center",background:"primaryButton",borderRadius:8,justify:"center"})` padding: 16px 24px; opacity: 0.5; `,R=o.form` padding: 36px; -`,V=t=>{const{children:i,value:r,index:n,...l}=t;return r===n?e.jsx(O,{"aria-labelledby":`simple-tab-${n}`,hidden:r!==n,id:`simple-tabpanel-${n}`,role:"tabpanel",...l,children:i}):null};function I(t){return{id:`simple-tab-${t}`,"aria-controls":`simple-tabpanel-${t}`}}const W=({onClose:t})=>{const[i,r]=v.useState(0),[n]=T(a=>[a.isAdmin,a.setPubKey]),l=b(a=>a.appMetaData),d=()=>n?"Admin Settings":"Settings",c=({children:a})=>e.jsxs(H,{children:[e.jsx(s,{direction:"row",pt:3,children:e.jsx(q,{"data-testid":"setting-label",children:d()})}),a]}),j=(a,p)=>{r(p)},h=[...n?[{label:"General",component:L}]:[],{label:"Appearance",component:D}];return e.jsxs(U,{"data-testid":"settings-modal",direction:"column",children:[e.jsx(c,{children:e.jsx(E,{"aria-label":"settings tabs",onChange:j,value:i,children:h.map((a,p)=>e.jsx(K,{disableRipple:!0,label:a.label,...I(p)},a.label))})}),h.map((a,p)=>e.jsx(V,{index:p,value:i,children:l&&e.jsx(a.component,{initialValues:l,onClose:t})},a.label))]})},E=o(B)` +`,V=t=>{const{children:i,value:r,index:n,...l}=t;return r===n?e.jsx(O,{"aria-labelledby":`simple-tab-${n}`,hidden:r!==n,id:`simple-tabpanel-${n}`,role:"tabpanel",...l,children:i}):null};function I(t){return{id:`simple-tab-${t}`,"aria-controls":`simple-tabpanel-${t}`}}const W=({onClose:t})=>{const[i,r]=v.useState(0),[n]=T(a=>[a.isAdmin,a.setPubKey]),l=b(a=>a.appMetaData),d=()=>n?"Admin Settings":"Settings",c=({children:a})=>e.jsxs(H,{children:[e.jsx(s,{direction:"row",pt:3,children:e.jsx(q,{"data-testid":"setting-label",children:d()})}),a]}),j=(a,p)=>{r(p)},h=[...n?[{label:"General",component:L}]:[],{label:"Appearance",component:D}];return e.jsxs(U,{"data-testid":"settings-modal",direction:"column",children:[e.jsx(c,{children:e.jsx(E,{"aria-label":"settings tabs",onChange:j,value:i,children:h.map((a,p)=>e.jsx(K,{disableRipple:!0,label:a.label,...I(p)},a.label))})}),h.map((a,p)=>e.jsx(V,{index:p,value:i,children:l&&e.jsx(a.component,{initialValues:l,onClose:t})},a.label))]})},E=o($)` && { .MuiTabs-indicator { background: ${x.primaryBlue}; @@ -22,7 +22,7 @@ import{Q as o,U as s,a5 as g,O as y,j as e,a3 as b,av as w,ar as S,S as x,r as v border-radius: 9px 9px 0 0; background: rgb(22, 24, 30); padding: 40px 36px 0 0; -`,K=o(G)` +`,K=o(B)` && { min-width: 0; width: auto; diff --git a/build/assets/index-7a7c9631.js b/build/assets/index-74184c93.js similarity index 81% rename from build/assets/index-7a7c9631.js rename to build/assets/index-74184c93.js index 1248f1cbd..5572f742e 100644 --- a/build/assets/index-7a7c9631.js +++ b/build/assets/index-74184c93.js @@ -1,4 +1,4 @@ -import{r as y,$ as U2,j as m,G as oO,u as iO,_ as je,a as R,d as aO,i as sO,c as lO,b as cO,e as uO,h as xv,f as ad,g as fO,k as Wu,m as dO,l as wv,n as Ke,o as qe,p as Xe,s as be,q as ge,t as Ye,v as Te,R as E,w as gi,x as gt,y as al,z as ia,A as pO,B as hO,T as gO,C as G2,D as aa,E as Pr,F as mO,H as K2,I as vO,J as yO,K as bO,P as Ee,L as yt,M as Qo,N as sa,O as Vu,W as xO,Q as X,S as K,U as ee,V as wO,X as Ti,Y as xg,Z as SO,a0 as $O,a1 as q2,a2 as X2,a3 as Yr,a4 as wg,a5 as ze,a6 as CO,a7 as hn,a8 as OO,a9 as EO,aa as xp,ab as wp,ac as Sp,ad as Nr,ae as PO,af as Ir,ag as _O,ah as TO,ai as Y2,aj as Z2,ak as Sg,al as AO,am as kO,an as Q2,ao as jO,ap as J2,aq as IO,ar as MO,as as Hu,at as RO,au as DO,av as NO,aw as LO,ax as Sv,ay as BO,az as FO,aA as sl,aB as la,aC as Kn,aD as ew,aE as $g,aF as ca,aG as Ue,aH as zO,aI as tw,aJ as WO,aK as nw,aL as VO,aM as HO,aN as UO,aO as ll,aP as Cg,aQ as rw,aR as ow,aS as GO,aT as KO,aU as qO,aV as Uu,aW as XO,aX as YO,aY as ZO,aZ as QO,a_ as JO,a$ as eE,b0 as iw,b1 as tE,b2 as nE}from"./index-0cb90706.js";function rE(e){return e?String(e).replace(/[[]{2}/g,"").replace(/[\]]{2}/g,""):""}const oE=e=>{const[t,n,r]=e.split(":"),o=parseInt(t,10),i=parseInt(n,10),a=parseInt(r,10);return o*3600+i*60+a};function $v(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function cl(e,t=166){let n;function r(...o){const i=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(i,t)}return r.clear=()=>{clearTimeout(n)},r}function sd(e,t){var n,r;return y.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(r=e.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Jt(e){return e&&e.ownerDocument||document}function or(e){return Jt(e).defaultView||window}function yc(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const iE=typeof window<"u"?y.useLayoutEffect:y.useEffect,Sr=iE;let Cv=0;function aE(e){const[t,n]=y.useState(e),r=e||t;return y.useEffect(()=>{t==null&&(Cv+=1,n(`mui-${Cv}`))},[t]),r}const Ov=U2["useId".toString()];function Og(e){if(Ov!==void 0){const t=Ov();return e??t}return aE(e)}function Qa({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=y.useRef(e!==void 0),[i,a]=y.useState(t),s=o?e:i,l=y.useCallback(c=>{o||a(c)},[]);return[s,l]}function Sn(e){const t=y.useRef(e);return Sr(()=>{t.current=e}),y.useRef((...n)=>(0,t.current)(...n)).current}function It(...e){return y.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{yc(n,t)})},e)}let Gu=!0,$p=!1,Ev;const sE={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function lE(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&sE[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function cE(e){e.metaKey||e.altKey||e.ctrlKey||(Gu=!0)}function ld(){Gu=!1}function uE(){this.visibilityState==="hidden"&&$p&&(Gu=!0)}function fE(e){e.addEventListener("keydown",cE,!0),e.addEventListener("mousedown",ld,!0),e.addEventListener("pointerdown",ld,!0),e.addEventListener("touchstart",ld,!0),e.addEventListener("visibilitychange",uE,!0)}function dE(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return Gu||lE(t)}function pE(){const e=y.useCallback(o=>{o!=null&&fE(o.ownerDocument)},[]),t=y.useRef(!1);function n(){return t.current?($p=!0,window.clearTimeout(Ev),Ev=window.setTimeout(()=>{$p=!1},100),t.current=!1,!0):!1}function r(o){return dE(o)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}function aw(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}let ii;function sw(){if(ii)return ii;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),ii="reverse",e.scrollLeft>0?ii="default":(e.scrollLeft=1,e.scrollLeft===0&&(ii="negative")),document.body.removeChild(e),ii}function hE(e,t){const n=e.scrollLeft;if(t!=="rtl")return n;switch(sw()){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n;default:return n}}const gE=e=>{const t=y.useRef({});return y.useEffect(()=>{t.current=e}),t.current},mE=gE;function vE(e){return e==null||Object.keys(e).length===0}function yE(e){const{styles:t,defaultTheme:n={}}=e,r=typeof t=="function"?o=>t(vE(o)?n:o):t;return m.jsx(oO,{styles:r})}function bE({styles:e,themeId:t,defaultTheme:n={}}){const r=iO(n),o=typeof e=="function"?e(t&&r[t]||r):e;return m.jsx(yE,{styles:o})}const xE=["sx"],wE=e=>{var t,n;const r={systemProps:{},otherProps:{}},o=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:aO;return Object.keys(e).forEach(i=>{o[i]?r.systemProps[i]=e[i]:r.otherProps[i]=e[i]}),r};function lw(e){const{sx:t}=e,n=je(e,xE),{systemProps:r,otherProps:o}=wE(n);let i;return Array.isArray(t)?i=[r,...t]:typeof t=="function"?i=(...a)=>{const s=t(...a);return sO(s)?R({},r,s):r}:i=R({},r,t),R({},o,{sx:i})}function cw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;tt.root});function _E(e){return uO({props:e,name:"MuiStack",defaultTheme:EE})}function TE(e,t){const n=y.Children.toArray(e).filter(Boolean);return n.reduce((r,o,i)=>(r.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],kE=({ownerState:e,theme:t})=>{let n=R({display:"flex",flexDirection:"column"},xv({theme:t},ad({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r})));if(e.spacing){const r=fO(t),o=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),i=ad({values:e.direction,base:o}),a=ad({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,c,u)=>{if(!i[l]){const d=c>0?i[u[c-1]]:"column";i[l]=d}}),n=Wu(n,xv({theme:t},a,(l,c)=>e.useFlexGap?{gap:wv(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${AE(c?i[c]:e.direction)}`]:wv(r,l)}}))}return n=dO(t.breakpoints,n),n};function jE(e={}){const{createStyledComponent:t=PE,useThemeProps:n=_E,componentName:r="MuiStack"}=e,o=()=>Ke({root:["root"]},l=>qe(r,l),{}),i=t(kE);return y.forwardRef(function(l,c){const u=n(l),f=lw(u),{component:d="div",direction:p="column",spacing:h=0,divider:g,children:v,className:x,useFlexGap:w=!1}=f,$=je(f,OE),C={direction:p,spacing:h,useFlexGap:w},S=o();return m.jsx(i,R({as:d,ownerState:C,ref:c,className:SE(S.root,x)},$,{children:g?TE(v,g):v}))})}const IE=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},Pv=IE;function ME(e){return qe("MuiSvgIcon",e)}Xe("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const RE=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],DE=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${ge(t)}`,`fontSize${ge(n)}`]};return Ke(o,ME,r)},NE=be("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${ge(n.color)}`],t[`fontSize${ge(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,o,i,a,s,l,c,u,f,d,p,h;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((i=e.typography)==null||(a=i.pxToRem)==null?void 0:a.call(i,20))||"1.25rem",medium:((s=e.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,24))||"1.5rem",large:((c=e.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[t.fontSize],color:(f=(d=(e.vars||e).palette)==null||(d=d[t.color])==null?void 0:d.main)!=null?f:{action:(p=(e.vars||e).palette)==null||(p=p.action)==null?void 0:p.active,disabled:(h=(e.vars||e).palette)==null||(h=h.action)==null?void 0:h.disabled,inherit:void 0}[t.color]}}),uw=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24"}=r,p=je(r,RE),h=y.isValidElement(o)&&o.type==="svg",g=R({},r,{color:a,component:s,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:h}),v={};u||(v.viewBox=d);const x=DE(g);return m.jsxs(NE,R({as:s,className:Te(x.root,i),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},v,p,h&&o.props,{ownerState:g,children:[h?o.props.children:o,f?m.jsx("title",{children:f}):null]}))});uw.muiName="SvgIcon";const _v=uw;function ul(e,t){function n(r,o){return m.jsx(_v,R({"data-testid":`${t}Icon`,ref:o},r,{children:e}))}return n.muiName=_v.muiName,y.memo(y.forwardRef(n))}function Cp(e,t){return Cp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Cp(e,t)}function fw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Cp(e,t)}const Tv={disabled:!1},bc=E.createContext(null);var LE=function(t){return t.scrollTop},Ga="unmounted",ko="exited",jo="entering",hi="entered",Op="exiting",Zr=function(e){fw(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=o,s=a&&!a.isMounting?r.enter:r.appear,l;return i.appearStatus=null,r.in?s?(l=ko,i.appearStatus=jo):l=hi:r.unmountOnExit||r.mountOnEnter?l=Ga:l=ko,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Ga?{status:ko}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==jo&&a!==hi&&(i=jo):(a===jo||a===hi)&&(i=Op)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,a,s;return i=a=s=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,s=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:s}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===jo){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:gi.findDOMNode(this);a&&LE(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ko&&this.setState({status:Ga})},n.performEnter=function(o){var i=this,a=this.props.enter,s=this.context?this.context.isMounting:o,l=this.props.nodeRef?[s]:[gi.findDOMNode(this),s],c=l[0],u=l[1],f=this.getTimeouts(),d=s?f.appear:f.enter;if(!o&&!a||Tv.disabled){this.safeSetState({status:hi},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:jo},function(){i.props.onEntering(c,u),i.onTransitionEnd(d,function(){i.safeSetState({status:hi},function(){i.props.onEntered(c,u)})})})},n.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:gi.findDOMNode(this);if(!i||Tv.disabled){this.safeSetState({status:ko},function(){o.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:Op},function(){o.props.onExiting(s),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:ko},function(){o.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,i.nextCallback=null,o(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:gi.findDOMNode(this),s=o==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Ga)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=je(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return E.createElement(bc.Provider,{value:null},typeof a=="function"?a(o,s):E.cloneElement(E.Children.only(a),s))},t}(E.Component);Zr.contextType=bc;Zr.propTypes={};function ai(){}Zr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ai,onEntering:ai,onEntered:ai,onExit:ai,onExiting:ai,onExited:ai};Zr.UNMOUNTED=Ga;Zr.EXITED=ko;Zr.ENTERING=jo;Zr.ENTERED=hi;Zr.EXITING=Op;const Eg=Zr;function BE(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pg(e,t){var n=function(i){return t&&y.isValidElement(i)?t(i):i},r=Object.create(null);return e&&y.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function FE(e,t){e=e||{},t=t||{};function n(u){return u in t?t[u]:e[u]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var a,s={};for(var l in t){if(r[l])for(a=0;ae.scrollTop;function Ai(e,t){var n,r;const{timeout:o,easing:i,style:a={}}=e;return{duration:(n=a.transitionDuration)!=null?n:typeof o=="number"?o:o[t.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof i=="object"?i[t.mode]:i,delay:a.transitionDelay}}function GE(e){return qe("MuiPaper",e)}Xe("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const KE=["className","component","elevation","square","variant"],qE=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Ke(i,GE,o)},XE=be("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return R({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&R({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${gt("#fff",Pv(t.elevation))}, ${gt("#fff",Pv(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),YE=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiPaper"}),{className:o,component:i="div",elevation:a=1,square:s=!1,variant:l="elevation"}=r,c=je(r,KE),u=R({},r,{component:i,elevation:a,square:s,variant:l}),f=qE(u);return m.jsx(XE,R({as:i,ownerState:u,className:Te(f.root,o),ref:n},c))}),Ku=YE;function ZE(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:a,in:s,onExited:l,timeout:c}=e,[u,f]=y.useState(!1),d=Te(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:a,height:a,top:-(a/2)+i,left:-(a/2)+o},h=Te(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&f(!0),y.useEffect(()=>{if(!s&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,s,c]),m.jsx("span",{className:d,style:p,children:m.jsx("span",{className:h})})}const QE=Xe("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),In=QE,JE=["center","classes","className"];let qu=e=>e,Av,kv,jv,Iv;const Ep=550,e6=80,t6=al(Av||(Av=qu` +import{r as y,$ as U2,j as m,G as oO,u as iO,_ as je,a as R,d as aO,i as sO,c as lO,b as cO,e as uO,h as xv,f as sd,g as fO,k as Wu,m as dO,l as wv,n as Ke,o as qe,p as Xe,s as be,q as ge,t as Ye,v as Te,R as E,w as gi,x as gt,y as al,z as ia,A as pO,B as hO,T as gO,C as G2,D as aa,E as Pr,F as mO,H as K2,I as vO,J as yO,K as bO,P as Ee,L as yt,M as Qo,N as sa,O as Vu,W as xO,Q as X,S as K,U as ee,V as wO,X as Ti,Y as Hu,Z as SO,a0 as $O,a1 as q2,a2 as X2,a3 as Yr,a4 as wg,a5 as ze,a6 as CO,a7 as hn,a8 as OO,a9 as EO,aa as wp,ab as Sp,ac as $p,ad as Nr,ae as PO,af as Ir,ag as _O,ah as TO,ai as Y2,aj as Z2,ak as Sg,al as AO,am as kO,an as Q2,ao as jO,ap as J2,aq as IO,ar as MO,as as Uu,at as RO,au as DO,av as NO,aw as LO,ax as Sv,ay as BO,az as FO,aA as sl,aB as la,aC as Kn,aD as ew,aE as $g,aF as ca,aG as Ue,aH as zO,aI as tw,aJ as WO,aK as nw,aL as VO,aM as HO,aN as UO,aO as ll,aP as Cg,aQ as rw,aR as ow,aS as GO,aT as KO,aU as qO,aV as Gu,aW as XO,aX as YO,aY as ZO,aZ as QO,a_ as JO,a$ as eE,b0 as iw,b1 as tE,b2 as nE}from"./index-ead79979.js";function rE(e){return e?String(e).replace(/[[]{2}/g,"").replace(/[\]]{2}/g,""):""}const oE=e=>{const[t,n,r]=e.split(":"),o=parseInt(t,10),i=parseInt(n,10),a=parseInt(r,10);return o*3600+i*60+a};function $v(...e){return e.reduce((t,n)=>n==null?t:function(...o){t.apply(this,o),n.apply(this,o)},()=>{})}function cl(e,t=166){let n;function r(...o){const i=()=>{e.apply(this,o)};clearTimeout(n),n=setTimeout(i,t)}return r.clear=()=>{clearTimeout(n)},r}function ld(e,t){var n,r;return y.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(r=e.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}function Jt(e){return e&&e.ownerDocument||document}function or(e){return Jt(e).defaultView||window}function yc(e,t){typeof e=="function"?e(t):e&&(e.current=t)}const iE=typeof window<"u"?y.useLayoutEffect:y.useEffect,Sr=iE;let Cv=0;function aE(e){const[t,n]=y.useState(e),r=e||t;return y.useEffect(()=>{t==null&&(Cv+=1,n(`mui-${Cv}`))},[t]),r}const Ov=U2["useId".toString()];function Og(e){if(Ov!==void 0){const t=Ov();return e??t}return aE(e)}function Qa({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=y.useRef(e!==void 0),[i,a]=y.useState(t),s=o?e:i,l=y.useCallback(c=>{o||a(c)},[]);return[s,l]}function Sn(e){const t=y.useRef(e);return Sr(()=>{t.current=e}),y.useRef((...n)=>(0,t.current)(...n)).current}function It(...e){return y.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{yc(n,t)})},e)}let Ku=!0,Cp=!1,Ev;const sE={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function lE(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&sE[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function cE(e){e.metaKey||e.altKey||e.ctrlKey||(Ku=!0)}function cd(){Ku=!1}function uE(){this.visibilityState==="hidden"&&Cp&&(Ku=!0)}function fE(e){e.addEventListener("keydown",cE,!0),e.addEventListener("mousedown",cd,!0),e.addEventListener("pointerdown",cd,!0),e.addEventListener("touchstart",cd,!0),e.addEventListener("visibilitychange",uE,!0)}function dE(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch{}return Ku||lE(t)}function pE(){const e=y.useCallback(o=>{o!=null&&fE(o.ownerDocument)},[]),t=y.useRef(!1);function n(){return t.current?(Cp=!0,window.clearTimeout(Ev),Ev=window.setTimeout(()=>{Cp=!1},100),t.current=!1,!0):!1}function r(o){return dE(o)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}function aw(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}let ii;function sw(){if(ii)return ii;const e=document.createElement("div"),t=document.createElement("div");return t.style.width="10px",t.style.height="1px",e.appendChild(t),e.dir="rtl",e.style.fontSize="14px",e.style.width="4px",e.style.height="1px",e.style.position="absolute",e.style.top="-1000px",e.style.overflow="scroll",document.body.appendChild(e),ii="reverse",e.scrollLeft>0?ii="default":(e.scrollLeft=1,e.scrollLeft===0&&(ii="negative")),document.body.removeChild(e),ii}function hE(e,t){const n=e.scrollLeft;if(t!=="rtl")return n;switch(sw()){case"negative":return e.scrollWidth-e.clientWidth+n;case"reverse":return e.scrollWidth-e.clientWidth-n;default:return n}}const gE=e=>{const t=y.useRef({});return y.useEffect(()=>{t.current=e}),t.current},mE=gE;function vE(e){return e==null||Object.keys(e).length===0}function yE(e){const{styles:t,defaultTheme:n={}}=e,r=typeof t=="function"?o=>t(vE(o)?n:o):t;return m.jsx(oO,{styles:r})}function bE({styles:e,themeId:t,defaultTheme:n={}}){const r=iO(n),o=typeof e=="function"?e(t&&r[t]||r):e;return m.jsx(yE,{styles:o})}const xE=["sx"],wE=e=>{var t,n;const r={systemProps:{},otherProps:{}},o=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:aO;return Object.keys(e).forEach(i=>{o[i]?r.systemProps[i]=e[i]:r.otherProps[i]=e[i]}),r};function lw(e){const{sx:t}=e,n=je(e,xE),{systemProps:r,otherProps:o}=wE(n);let i;return Array.isArray(t)?i=[r,...t]:typeof t=="function"?i=(...a)=>{const s=t(...a);return sO(s)?R({},r,s):r}:i=R({},r,t),R({},o,{sx:i})}function cw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;tt.root});function _E(e){return uO({props:e,name:"MuiStack",defaultTheme:EE})}function TE(e,t){const n=y.Children.toArray(e).filter(Boolean);return n.reduce((r,o,i)=>(r.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],kE=({ownerState:e,theme:t})=>{let n=R({display:"flex",flexDirection:"column"},xv({theme:t},sd({values:e.direction,breakpoints:t.breakpoints.values}),r=>({flexDirection:r})));if(e.spacing){const r=fO(t),o=Object.keys(t.breakpoints.values).reduce((l,c)=>((typeof e.spacing=="object"&&e.spacing[c]!=null||typeof e.direction=="object"&&e.direction[c]!=null)&&(l[c]=!0),l),{}),i=sd({values:e.direction,base:o}),a=sd({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,c,u)=>{if(!i[l]){const d=c>0?i[u[c-1]]:"column";i[l]=d}}),n=Wu(n,xv({theme:t},a,(l,c)=>e.useFlexGap?{gap:wv(r,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${AE(c?i[c]:e.direction)}`]:wv(r,l)}}))}return n=dO(t.breakpoints,n),n};function jE(e={}){const{createStyledComponent:t=PE,useThemeProps:n=_E,componentName:r="MuiStack"}=e,o=()=>Ke({root:["root"]},l=>qe(r,l),{}),i=t(kE);return y.forwardRef(function(l,c){const u=n(l),f=lw(u),{component:d="div",direction:p="column",spacing:h=0,divider:g,children:v,className:x,useFlexGap:w=!1}=f,$=je(f,OE),C={direction:p,spacing:h,useFlexGap:w},S=o();return m.jsx(i,R({as:d,ownerState:C,ref:c,className:SE(S.root,x)},$,{children:g?TE(v,g):v}))})}const IE=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},Pv=IE;function ME(e){return qe("MuiSvgIcon",e)}Xe("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const RE=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],DE=e=>{const{color:t,fontSize:n,classes:r}=e,o={root:["root",t!=="inherit"&&`color${ge(t)}`,`fontSize${ge(n)}`]};return Ke(o,ME,r)},NE=be("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${ge(n.color)}`],t[`fontSize${ge(n.fontSize)}`]]}})(({theme:e,ownerState:t})=>{var n,r,o,i,a,s,l,c,u,f,d,p,h;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(n=e.transitions)==null||(r=n.create)==null?void 0:r.call(n,"fill",{duration:(o=e.transitions)==null||(o=o.duration)==null?void 0:o.shorter}),fontSize:{inherit:"inherit",small:((i=e.typography)==null||(a=i.pxToRem)==null?void 0:a.call(i,20))||"1.25rem",medium:((s=e.typography)==null||(l=s.pxToRem)==null?void 0:l.call(s,24))||"1.5rem",large:((c=e.typography)==null||(u=c.pxToRem)==null?void 0:u.call(c,35))||"2.1875rem"}[t.fontSize],color:(f=(d=(e.vars||e).palette)==null||(d=d[t.color])==null?void 0:d.main)!=null?f:{action:(p=(e.vars||e).palette)==null||(p=p.action)==null?void 0:p.active,disabled:(h=(e.vars||e).palette)==null||(h=h.action)==null?void 0:h.disabled,inherit:void 0}[t.color]}}),uw=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:u=!1,titleAccess:f,viewBox:d="0 0 24 24"}=r,p=je(r,RE),h=y.isValidElement(o)&&o.type==="svg",g=R({},r,{color:a,component:s,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:u,viewBox:d,hasSvgAsChild:h}),v={};u||(v.viewBox=d);const x=DE(g);return m.jsxs(NE,R({as:s,className:Te(x.root,i),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},v,p,h&&o.props,{ownerState:g,children:[h?o.props.children:o,f?m.jsx("title",{children:f}):null]}))});uw.muiName="SvgIcon";const _v=uw;function ul(e,t){function n(r,o){return m.jsx(_v,R({"data-testid":`${t}Icon`,ref:o},r,{children:e}))}return n.muiName=_v.muiName,y.memo(y.forwardRef(n))}function Op(e,t){return Op=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Op(e,t)}function fw(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Op(e,t)}const Tv={disabled:!1},bc=E.createContext(null);var LE=function(t){return t.scrollTop},Ga="unmounted",ko="exited",jo="entering",hi="entered",Ep="exiting",Zr=function(e){fw(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=o,s=a&&!a.isMounting?r.enter:r.appear,l;return i.appearStatus=null,r.in?s?(l=ko,i.appearStatus=jo):l=hi:r.unmountOnExit||r.mountOnEnter?l=Ga:l=ko,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Ga?{status:ko}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==jo&&a!==hi&&(i=jo):(a===jo||a===hi)&&(i=Ep)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,a,s;return i=a=s=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,s=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:s}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===jo){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:gi.findDOMNode(this);a&&LE(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ko&&this.setState({status:Ga})},n.performEnter=function(o){var i=this,a=this.props.enter,s=this.context?this.context.isMounting:o,l=this.props.nodeRef?[s]:[gi.findDOMNode(this),s],c=l[0],u=l[1],f=this.getTimeouts(),d=s?f.appear:f.enter;if(!o&&!a||Tv.disabled){this.safeSetState({status:hi},function(){i.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:jo},function(){i.props.onEntering(c,u),i.onTransitionEnd(d,function(){i.safeSetState({status:hi},function(){i.props.onEntered(c,u)})})})},n.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:gi.findDOMNode(this);if(!i||Tv.disabled){this.safeSetState({status:ko},function(){o.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:Ep},function(){o.props.onExiting(s),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:ko},function(){o.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,i.nextCallback=null,o(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:gi.findDOMNode(this),s=o==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Ga)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=je(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return E.createElement(bc.Provider,{value:null},typeof a=="function"?a(o,s):E.cloneElement(E.Children.only(a),s))},t}(E.Component);Zr.contextType=bc;Zr.propTypes={};function ai(){}Zr.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ai,onEntering:ai,onEntered:ai,onExit:ai,onExiting:ai,onExited:ai};Zr.UNMOUNTED=Ga;Zr.EXITED=ko;Zr.ENTERING=jo;Zr.ENTERED=hi;Zr.EXITING=Ep;const Eg=Zr;function BE(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Pg(e,t){var n=function(i){return t&&y.isValidElement(i)?t(i):i},r=Object.create(null);return e&&y.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function FE(e,t){e=e||{},t=t||{};function n(u){return u in t?t[u]:e[u]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var a,s={};for(var l in t){if(r[l])for(a=0;ae.scrollTop;function Ai(e,t){var n,r;const{timeout:o,easing:i,style:a={}}=e;return{duration:(n=a.transitionDuration)!=null?n:typeof o=="number"?o:o[t.mode]||0,easing:(r=a.transitionTimingFunction)!=null?r:typeof i=="object"?i[t.mode]:i,delay:a.transitionDelay}}function GE(e){return qe("MuiPaper",e)}Xe("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const KE=["className","component","elevation","square","variant"],qE=e=>{const{square:t,elevation:n,variant:r,classes:o}=e,i={root:["root",r,!t&&"rounded",r==="elevation"&&`elevation${n}`]};return Ke(i,GE,o)},XE=be("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],!n.square&&t.rounded,n.variant==="elevation"&&t[`elevation${n.elevation}`]]}})(({theme:e,ownerState:t})=>{var n;return R({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow")},!t.square&&{borderRadius:e.shape.borderRadius},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.divider}`},t.variant==="elevation"&&R({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${gt("#fff",Pv(t.elevation))}, ${gt("#fff",Pv(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),YE=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiPaper"}),{className:o,component:i="div",elevation:a=1,square:s=!1,variant:l="elevation"}=r,c=je(r,KE),u=R({},r,{component:i,elevation:a,square:s,variant:l}),f=qE(u);return m.jsx(XE,R({as:i,ownerState:u,className:Te(f.root,o),ref:n},c))}),qu=YE;function ZE(e){const{className:t,classes:n,pulsate:r=!1,rippleX:o,rippleY:i,rippleSize:a,in:s,onExited:l,timeout:c}=e,[u,f]=y.useState(!1),d=Te(t,n.ripple,n.rippleVisible,r&&n.ripplePulsate),p={width:a,height:a,top:-(a/2)+i,left:-(a/2)+o},h=Te(n.child,u&&n.childLeaving,r&&n.childPulsate);return!s&&!u&&f(!0),y.useEffect(()=>{if(!s&&l!=null){const g=setTimeout(l,c);return()=>{clearTimeout(g)}}},[l,s,c]),m.jsx("span",{className:d,style:p,children:m.jsx("span",{className:h})})}const QE=Xe("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),In=QE,JE=["center","classes","className"];let Xu=e=>e,Av,kv,jv,Iv;const Pp=550,e6=80,t6=al(Av||(Av=Xu` 0% { transform: scale(0); opacity: 0.1; @@ -8,7 +8,7 @@ import{r as y,$ as U2,j as m,G as oO,u as iO,_ as je,a as R,d as aO,i as sO,c as transform: scale(1); opacity: 0.3; } -`)),n6=al(kv||(kv=qu` +`)),n6=al(kv||(kv=Xu` 0% { opacity: 1; } @@ -16,7 +16,7 @@ import{r as y,$ as U2,j as m,G as oO,u as iO,_ as je,a as R,d as aO,i as sO,c as 100% { opacity: 0; } -`)),r6=al(jv||(jv=qu` +`)),r6=al(jv||(jv=Xu` 0% { transform: scale(1); } @@ -28,7 +28,7 @@ import{r as y,$ as U2,j as m,G as oO,u as iO,_ as je,a as R,d as aO,i as sO,c as 100% { transform: scale(1); } -`)),o6=be("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),i6=be(ZE,{name:"MuiTouchRipple",slot:"Ripple"})(Iv||(Iv=qu` +`)),o6=be("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),i6=be(ZE,{name:"MuiTouchRipple",slot:"Ripple"})(Iv||(Iv=Xu` opacity: 0; position: absolute; @@ -71,8 +71,8 @@ import{r as y,$ as U2,j as m,G as oO,u as iO,_ as je,a as R,d as aO,i as sO,c as animation-iteration-count: infinite; animation-delay: 200ms; } -`),In.rippleVisible,t6,Ep,({theme:e})=>e.transitions.easing.easeInOut,In.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,In.child,In.childLeaving,n6,Ep,({theme:e})=>e.transitions.easing.easeInOut,In.childPulsate,r6,({theme:e})=>e.transitions.easing.easeInOut),a6=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:a}=r,s=je(r,JE),[l,c]=y.useState([]),u=y.useRef(0),f=y.useRef(null);y.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=y.useRef(!1),p=y.useRef(0),h=y.useRef(null),g=y.useRef(null);y.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const v=y.useCallback(C=>{const{pulsate:S,rippleX:b,rippleY:O,rippleSize:P,cb:T}=C;c(k=>[...k,m.jsx(i6,{classes:{ripple:Te(i.ripple,In.ripple),rippleVisible:Te(i.rippleVisible,In.rippleVisible),ripplePulsate:Te(i.ripplePulsate,In.ripplePulsate),child:Te(i.child,In.child),childLeaving:Te(i.childLeaving,In.childLeaving),childPulsate:Te(i.childPulsate,In.childPulsate)},timeout:Ep,pulsate:S,rippleX:b,rippleY:O,rippleSize:P},u.current)]),u.current+=1,f.current=T},[i]),x=y.useCallback((C={},S={},b=()=>{})=>{const{pulsate:O=!1,center:P=o||S.pulsate,fakeElement:T=!1}=S;if((C==null?void 0:C.type)==="mousedown"&&d.current){d.current=!1;return}(C==null?void 0:C.type)==="touchstart"&&(d.current=!0);const k=T?null:g.current,_=k?k.getBoundingClientRect():{width:0,height:0,left:0,top:0};let A,I,j;if(P||C===void 0||C.clientX===0&&C.clientY===0||!C.clientX&&!C.touches)A=Math.round(_.width/2),I=Math.round(_.height/2);else{const{clientX:M,clientY:D}=C.touches&&C.touches.length>0?C.touches[0]:C;A=Math.round(M-_.left),I=Math.round(D-_.top)}if(P)j=Math.sqrt((2*_.width**2+_.height**2)/3),j%2===0&&(j+=1);else{const M=Math.max(Math.abs((k?k.clientWidth:0)-A),A)*2+2,D=Math.max(Math.abs((k?k.clientHeight:0)-I),I)*2+2;j=Math.sqrt(M**2+D**2)}C!=null&&C.touches?h.current===null&&(h.current=()=>{v({pulsate:O,rippleX:A,rippleY:I,rippleSize:j,cb:b})},p.current=setTimeout(()=>{h.current&&(h.current(),h.current=null)},e6)):v({pulsate:O,rippleX:A,rippleY:I,rippleSize:j,cb:b})},[o,v]),w=y.useCallback(()=>{x({},{pulsate:!0})},[x]),$=y.useCallback((C,S)=>{if(clearTimeout(p.current),(C==null?void 0:C.type)==="touchend"&&h.current){h.current(),h.current=null,p.current=setTimeout(()=>{$(C,S)});return}h.current=null,c(b=>b.length>0?b.slice(1):b),f.current=S},[]);return y.useImperativeHandle(n,()=>({pulsate:w,start:x,stop:$}),[w,x,$]),m.jsx(o6,R({className:Te(In.root,i.root,a),ref:g},s,{children:m.jsx(UE,{component:null,exit:!0,children:l})}))}),s6=a6;function l6(e){return qe("MuiButtonBase",e)}const c6=Xe("MuiButtonBase",["root","disabled","focusVisible"]),u6=c6,f6=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],d6=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,a=Ke({root:["root",t&&"disabled",n&&"focusVisible"]},l6,o);return n&&r&&(a.root+=` ${r}`),a},p6=be("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${u6.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),h6=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:a,className:s,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,LinkComponent:p="a",onBlur:h,onClick:g,onContextMenu:v,onDragLeave:x,onFocus:w,onFocusVisible:$,onKeyDown:C,onKeyUp:S,onMouseDown:b,onMouseLeave:O,onMouseUp:P,onTouchEnd:T,onTouchMove:k,onTouchStart:_,tabIndex:A=0,TouchRippleProps:I,touchRippleRef:j,type:M}=r,D=je(r,f6),L=y.useRef(null),B=y.useRef(null),F=It(B,j),{isFocusVisibleRef:Z,onFocus:ie,onBlur:te,ref:le}=pE(),[re,ae]=y.useState(!1);c&&re&&ae(!1),y.useImperativeHandle(o,()=>({focusVisible:()=>{ae(!0),L.current.focus()}}),[]);const[xe,Me]=y.useState(!1);y.useEffect(()=>{Me(!0)},[]);const we=xe&&!u&&!c;y.useEffect(()=>{re&&d&&!u&&xe&&B.current.pulsate()},[u,d,re,xe]);function Y(ne,Ze,St=f){return Sn($t=>(Ze&&Ze($t),!St&&B.current&&B.current[ne]($t),!0))}const ve=Y("start",b),ce=Y("stop",v),G=Y("stop",x),fe=Y("stop",P),de=Y("stop",ne=>{re&&ne.preventDefault(),O&&O(ne)}),pe=Y("start",_),se=Y("stop",T),Le=Y("stop",k),Ce=Y("stop",ne=>{te(ne),Z.current===!1&&ae(!1),h&&h(ne)},!1),Ge=Sn(ne=>{L.current||(L.current=ne.currentTarget),ie(ne),Z.current===!0&&(ae(!0),$&&$(ne)),w&&w(ne)}),N=()=>{const ne=L.current;return l&&l!=="button"&&!(ne.tagName==="A"&&ne.href)},z=y.useRef(!1),U=Sn(ne=>{d&&!z.current&&re&&B.current&&ne.key===" "&&(z.current=!0,B.current.stop(ne,()=>{B.current.start(ne)})),ne.target===ne.currentTarget&&N()&&ne.key===" "&&ne.preventDefault(),C&&C(ne),ne.target===ne.currentTarget&&N()&&ne.key==="Enter"&&!c&&(ne.preventDefault(),g&&g(ne))}),W=Sn(ne=>{d&&ne.key===" "&&B.current&&re&&!ne.defaultPrevented&&(z.current=!1,B.current.stop(ne,()=>{B.current.pulsate(ne)})),S&&S(ne),g&&ne.target===ne.currentTarget&&N()&&ne.key===" "&&!ne.defaultPrevented&&g(ne)});let V=l;V==="button"&&(D.href||D.to)&&(V=p);const q={};V==="button"?(q.type=M===void 0?"button":M,q.disabled=c):(!D.href&&!D.to&&(q.role="button"),c&&(q["aria-disabled"]=c));const ue=It(n,le,L),Ae=R({},r,{centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:A,focusVisible:re}),Se=d6(Ae);return m.jsxs(p6,R({as:V,className:Te(Se.root,s),ownerState:Ae,onBlur:Ce,onClick:g,onContextMenu:ce,onFocus:Ge,onKeyDown:U,onKeyUp:W,onMouseDown:ve,onMouseLeave:de,onMouseUp:fe,onDragLeave:G,onTouchEnd:se,onTouchMove:Le,onTouchStart:pe,ref:ue,tabIndex:c?-1:A,type:M},q,D,{children:[a,we?m.jsx(s6,R({ref:F,center:i},I)):null]}))}),ki=h6;function g6(e){return qe("MuiIconButton",e)}const m6=Xe("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),v6=m6,y6=["edge","children","className","color","disabled","disableFocusRipple","size"],b6=e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e,a={root:["root",n&&"disabled",r!=="default"&&`color${ge(r)}`,o&&`edge${ge(o)}`,`size${ge(i)}`]};return Ke(a,g6,t)},x6=be(ki,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${ge(n.color)}`],n.edge&&t[`edge${ge(n.edge)}`],t[`size${ge(n.size)}`]]}})(({theme:e,ownerState:t})=>R({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var n;const r=(n=(e.vars||e).palette)==null?void 0:n[t.color];return R({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&R({color:r==null?void 0:r.main},!t.disableRipple&&{"&:hover":R({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${v6.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),w6=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:a,color:s="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=r,f=je(r,y6),d=R({},r,{edge:o,color:s,disabled:l,disableFocusRipple:c,size:u}),p=b6(d);return m.jsx(x6,R({className:Te(p.root,a),centerRipple:!0,focusRipple:!c,disabled:l,ref:n,ownerState:d},f,{children:i}))}),yr=w6,S6=ul(m.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function $6(e){return qe("MuiTypography",e)}Xe("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const C6=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],O6=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:a}=e,s={root:["root",i,e.align!=="inherit"&&`align${ge(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Ke(s,$6,a)},E6=be("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${ge(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>R({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),Mv={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},P6={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},_6=e=>P6[e]||e,T6=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTypography"}),o=_6(r.color),i=lw(R({},r,{color:o})),{align:a="inherit",className:s,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:f=!1,variant:d="body1",variantMapping:p=Mv}=i,h=je(i,C6),g=R({},i,{align:a,color:o,className:s,component:l,gutterBottom:c,noWrap:u,paragraph:f,variant:d,variantMapping:p}),v=l||(f?"p":p[d]||Mv[d])||"span",x=O6(g);return m.jsx(E6,R({as:v,ref:n,ownerState:g,className:Te(x.root,s)},h))}),Rv=T6;function xc(e){return typeof e=="string"}function A6(e,t,n){return e===void 0||xc(e)?t:R({},t,{ownerState:R({},t.ownerState,n)})}const k6={disableDefaultClasses:!1},j6=y.createContext(k6);function I6(e){const{disableDefaultClasses:t}=y.useContext(j6);return n=>t?"":e(n)}function dw(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function M6(e,t,n){return typeof e=="function"?e(t,n):e}function pw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function R6(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const p=Dv(n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),h=R({},n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),g=R({},n,o,r);return p.length>0&&(g.className=p),Object.keys(h).length>0&&(g.style=h),{props:g,internalRef:void 0}}const a=dw(R({},o,r)),s=Nv(r),l=Nv(o),c=t(a),u=Dv(c==null?void 0:c.className,n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),f=R({},c==null?void 0:c.style,n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),d=R({},c,n,l,s);return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}const D6=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function ir(e){var t;const{elementType:n,externalSlotProps:r,ownerState:o,skipResolvingSlotProps:i=!1}=e,a=je(e,D6),s=i?{}:M6(r,o),{props:l,internalRef:c}=R6(R({},a,{externalSlotProps:s})),u=It(c,s==null?void 0:s.ref,(t=e.additionalProps)==null?void 0:t.ref);return A6(n,R({},l,{ref:u}),o)}const N6=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function L6(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function B6(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function F6(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||B6(e))}function z6(e){const t=[],n=[];return Array.from(e.querySelectorAll(N6)).forEach((r,o)=>{const i=L6(r);i===-1||!F6(r)||(i===0?t.push(r):n.push({documentOrder:o,tabIndex:i,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function W6(){return!0}function V6(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=z6,isEnabled:a=W6,open:s}=e,l=y.useRef(!1),c=y.useRef(null),u=y.useRef(null),f=y.useRef(null),d=y.useRef(null),p=y.useRef(!1),h=y.useRef(null),g=It(t.ref,h),v=y.useRef(null);y.useEffect(()=>{!s||!h.current||(p.current=!n)},[n,s]),y.useEffect(()=>{if(!s||!h.current)return;const $=Jt(h.current);return h.current.contains($.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[s]),y.useEffect(()=>{if(!s||!h.current)return;const $=Jt(h.current),C=O=>{v.current=O,!(r||!a()||O.key!=="Tab")&&$.activeElement===h.current&&O.shiftKey&&(l.current=!0,u.current&&u.current.focus())},S=()=>{const O=h.current;if(O===null)return;if(!$.hasFocus()||!a()||l.current){l.current=!1;return}if(O.contains($.activeElement)||r&&$.activeElement!==c.current&&$.activeElement!==u.current)return;if($.activeElement!==d.current)d.current=null;else if(d.current!==null)return;if(!p.current)return;let P=[];if(($.activeElement===c.current||$.activeElement===u.current)&&(P=i(h.current)),P.length>0){var T,k;const _=!!((T=v.current)!=null&&T.shiftKey&&((k=v.current)==null?void 0:k.key)==="Tab"),A=P[0],I=P[P.length-1];typeof A!="string"&&typeof I!="string"&&(_?I.focus():A.focus())}else O.focus()};$.addEventListener("focusin",S),$.addEventListener("keydown",C,!0);const b=setInterval(()=>{$.activeElement&&$.activeElement.tagName==="BODY"&&S()},50);return()=>{clearInterval(b),$.removeEventListener("focusin",S),$.removeEventListener("keydown",C,!0)}},[n,r,o,a,s,i]);const x=$=>{f.current===null&&(f.current=$.relatedTarget),p.current=!0,d.current=$.target;const C=t.props.onFocus;C&&C($)},w=$=>{f.current===null&&(f.current=$.relatedTarget),p.current=!0};return m.jsxs(y.Fragment,{children:[m.jsx("div",{tabIndex:s?0:-1,onFocus:w,ref:c,"data-testid":"sentinelStart"}),y.cloneElement(t,{ref:g,onFocus:x}),m.jsx("div",{tabIndex:s?0:-1,onFocus:w,ref:u,"data-testid":"sentinelEnd"})]})}var dn="top",Vn="bottom",Hn="right",pn="left",Ag="auto",fl=[dn,Vn,Hn,pn],ji="start",ps="end",H6="clippingParents",hw="viewport",_a="popper",U6="reference",Lv=fl.reduce(function(e,t){return e.concat([t+"-"+ji,t+"-"+ps])},[]),gw=[].concat(fl,[Ag]).reduce(function(e,t){return e.concat([t,t+"-"+ji,t+"-"+ps])},[]),G6="beforeRead",K6="read",q6="afterRead",X6="beforeMain",Y6="main",Z6="afterMain",Q6="beforeWrite",J6="write",e9="afterWrite",t9=[G6,K6,q6,X6,Y6,Z6,Q6,J6,e9];function $r(e){return e?(e.nodeName||"").toLowerCase():null}function En(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qo(e){var t=En(e).Element;return e instanceof t||e instanceof Element}function Fn(e){var t=En(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function kg(e){if(typeof ShadowRoot>"u")return!1;var t=En(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function n9(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!Fn(i)||!$r(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function r9(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,c){return l[c]="",l},{});!Fn(o)||!$r(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const o9={name:"applyStyles",enabled:!0,phase:"write",fn:n9,effect:r9,requires:["computeStyles"]};function br(e){return e.split("-")[0]}var Wo=Math.max,wc=Math.min,Ii=Math.round;function Pp(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function mw(){return!/^((?!chrome|android).)*safari/i.test(Pp())}function Mi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Fn(e)&&(o=e.offsetWidth>0&&Ii(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Ii(r.height)/e.offsetHeight||1);var a=qo(e)?En(e):window,s=a.visualViewport,l=!mw()&&n,c=(r.left+(l&&s?s.offsetLeft:0))/o,u=(r.top+(l&&s?s.offsetTop:0))/i,f=r.width/o,d=r.height/i;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function jg(e){var t=Mi(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function vw(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&kg(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function zr(e){return En(e).getComputedStyle(e)}function i9(e){return["table","td","th"].indexOf($r(e))>=0}function $o(e){return((qo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Xu(e){return $r(e)==="html"?e:e.assignedSlot||e.parentNode||(kg(e)?e.host:null)||$o(e)}function Bv(e){return!Fn(e)||zr(e).position==="fixed"?null:e.offsetParent}function a9(e){var t=/firefox/i.test(Pp()),n=/Trident/i.test(Pp());if(n&&Fn(e)){var r=zr(e);if(r.position==="fixed")return null}var o=Xu(e);for(kg(o)&&(o=o.host);Fn(o)&&["html","body"].indexOf($r(o))<0;){var i=zr(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function dl(e){for(var t=En(e),n=Bv(e);n&&i9(n)&&zr(n).position==="static";)n=Bv(n);return n&&($r(n)==="html"||$r(n)==="body"&&zr(n).position==="static")?t:n||a9(e)||t}function Ig(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ja(e,t,n){return Wo(e,wc(t,n))}function s9(e,t,n){var r=Ja(e,t,n);return r>n?n:r}function yw(){return{top:0,right:0,bottom:0,left:0}}function bw(e){return Object.assign({},yw(),e)}function xw(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var l9=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,bw(typeof t!="number"?t:xw(t,fl))};function c9(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=br(n.placement),l=Ig(s),c=[pn,Hn].indexOf(s)>=0,u=c?"height":"width";if(!(!i||!a)){var f=l9(o.padding,n),d=jg(i),p=l==="y"?dn:pn,h=l==="y"?Vn:Hn,g=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],v=a[l]-n.rects.reference[l],x=dl(i),w=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,$=g/2-v/2,C=f[p],S=w-d[u]-f[h],b=w/2-d[u]/2+$,O=Ja(C,b,S),P=l;n.modifiersData[r]=(t={},t[P]=O,t.centerOffset=O-b,t)}}function u9(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||vw(t.elements.popper,o)&&(t.elements.arrow=o))}const f9={name:"arrow",enabled:!0,phase:"main",fn:c9,effect:u9,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ri(e){return e.split("-")[1]}var d9={top:"auto",right:"auto",bottom:"auto",left:"auto"};function p9(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Ii(n*o)/o||0,y:Ii(r*o)/o||0}}function Fv(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,d=a.x,p=d===void 0?0:d,h=a.y,g=h===void 0?0:h,v=typeof u=="function"?u({x:p,y:g}):{x:p,y:g};p=v.x,g=v.y;var x=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),$=pn,C=dn,S=window;if(c){var b=dl(n),O="clientHeight",P="clientWidth";if(b===En(n)&&(b=$o(n),zr(b).position!=="static"&&s==="absolute"&&(O="scrollHeight",P="scrollWidth")),b=b,o===dn||(o===pn||o===Hn)&&i===ps){C=Vn;var T=f&&b===S&&S.visualViewport?S.visualViewport.height:b[O];g-=T-r.height,g*=l?1:-1}if(o===pn||(o===dn||o===Vn)&&i===ps){$=Hn;var k=f&&b===S&&S.visualViewport?S.visualViewport.width:b[P];p-=k-r.width,p*=l?1:-1}}var _=Object.assign({position:s},c&&d9),A=u===!0?p9({x:p,y:g},En(n)):{x:p,y:g};if(p=A.x,g=A.y,l){var I;return Object.assign({},_,(I={},I[C]=w?"0":"",I[$]=x?"0":"",I.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",I))}return Object.assign({},_,(t={},t[C]=w?g+"px":"",t[$]=x?p+"px":"",t.transform="",t))}function h9(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,l=s===void 0?!0:s,c={placement:br(t.placement),variation:Ri(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Fv(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Fv(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const g9={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:h9,data:{}};var Bl={passive:!0};function m9(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,s=a===void 0?!0:a,l=En(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,Bl)}),s&&l.addEventListener("resize",n.update,Bl),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Bl)}),s&&l.removeEventListener("resize",n.update,Bl)}}const v9={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:m9,data:{}};var y9={left:"right",right:"left",bottom:"top",top:"bottom"};function fc(e){return e.replace(/left|right|bottom|top/g,function(t){return y9[t]})}var b9={start:"end",end:"start"};function zv(e){return e.replace(/start|end/g,function(t){return b9[t]})}function Mg(e){var t=En(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Rg(e){return Mi($o(e)).left+Mg(e).scrollLeft}function x9(e,t){var n=En(e),r=$o(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var c=mw();(c||!c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+Rg(e),y:l}}function w9(e){var t,n=$o(e),r=Mg(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Wo(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Wo(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Rg(e),l=-r.scrollTop;return zr(o||n).direction==="rtl"&&(s+=Wo(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}function Dg(e){var t=zr(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function ww(e){return["html","body","#document"].indexOf($r(e))>=0?e.ownerDocument.body:Fn(e)&&Dg(e)?e:ww(Xu(e))}function es(e,t){var n;t===void 0&&(t=[]);var r=ww(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=En(r),a=o?[i].concat(i.visualViewport||[],Dg(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(es(Xu(a)))}function _p(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function S9(e,t){var n=Mi(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Wv(e,t,n){return t===hw?_p(x9(e,n)):qo(t)?S9(t,n):_p(w9($o(e)))}function $9(e){var t=es(Xu(e)),n=["absolute","fixed"].indexOf(zr(e).position)>=0,r=n&&Fn(e)?dl(e):e;return qo(r)?t.filter(function(o){return qo(o)&&vw(o,r)&&$r(o)!=="body"}):[]}function C9(e,t,n,r){var o=t==="clippingParents"?$9(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(l,c){var u=Wv(e,c,r);return l.top=Wo(u.top,l.top),l.right=wc(u.right,l.right),l.bottom=wc(u.bottom,l.bottom),l.left=Wo(u.left,l.left),l},Wv(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Sw(e){var t=e.reference,n=e.element,r=e.placement,o=r?br(r):null,i=r?Ri(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(o){case dn:l={x:a,y:t.y-n.height};break;case Vn:l={x:a,y:t.y+t.height};break;case Hn:l={x:t.x+t.width,y:s};break;case pn:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var c=o?Ig(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case ji:l[c]=l[c]-(t[u]/2-n[u]/2);break;case ps:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function hs(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,l=s===void 0?H6:s,c=n.rootBoundary,u=c===void 0?hw:c,f=n.elementContext,d=f===void 0?_a:f,p=n.altBoundary,h=p===void 0?!1:p,g=n.padding,v=g===void 0?0:g,x=bw(typeof v!="number"?v:xw(v,fl)),w=d===_a?U6:_a,$=e.rects.popper,C=e.elements[h?w:d],S=C9(qo(C)?C:C.contextElement||$o(e.elements.popper),l,u,a),b=Mi(e.elements.reference),O=Sw({reference:b,element:$,strategy:"absolute",placement:o}),P=_p(Object.assign({},$,O)),T=d===_a?P:b,k={top:S.top-T.top+x.top,bottom:T.bottom-S.bottom+x.bottom,left:S.left-T.left+x.left,right:T.right-S.right+x.right},_=e.modifiersData.offset;if(d===_a&&_){var A=_[o];Object.keys(k).forEach(function(I){var j=[Hn,Vn].indexOf(I)>=0?1:-1,M=[dn,Vn].indexOf(I)>=0?"y":"x";k[I]+=A[M]*j})}return k}function O9(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?gw:l,u=Ri(r),f=u?s?Lv:Lv.filter(function(h){return Ri(h)===u}):fl,d=f.filter(function(h){return c.indexOf(h)>=0});d.length===0&&(d=f);var p=d.reduce(function(h,g){return h[g]=hs(e,{placement:g,boundary:o,rootBoundary:i,padding:a})[br(g)],h},{});return Object.keys(p).sort(function(h,g){return p[h]-p[g]})}function E9(e){if(br(e)===Ag)return[];var t=fc(e);return[zv(e),t,zv(t)]}function P9(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,g=n.allowedAutoPlacements,v=t.options.placement,x=br(v),w=x===v,$=l||(w||!h?[fc(v)]:E9(v)),C=[v].concat($).reduce(function(re,ae){return re.concat(br(ae)===Ag?O9(t,{placement:ae,boundary:u,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:g}):ae)},[]),S=t.rects.reference,b=t.rects.popper,O=new Map,P=!0,T=C[0],k=0;k=0,M=j?"width":"height",D=hs(t,{placement:_,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),L=j?I?Hn:pn:I?Vn:dn;S[M]>b[M]&&(L=fc(L));var B=fc(L),F=[];if(i&&F.push(D[A]<=0),s&&F.push(D[L]<=0,D[B]<=0),F.every(function(re){return re})){T=_,P=!1;break}O.set(_,F)}if(P)for(var Z=h?3:1,ie=function(ae){var xe=C.find(function(Me){var we=O.get(Me);if(we)return we.slice(0,ae).every(function(Y){return Y})});if(xe)return T=xe,"break"},te=Z;te>0;te--){var le=ie(te);if(le==="break")break}t.placement!==T&&(t.modifiersData[r]._skip=!0,t.placement=T,t.reset=!0)}}const _9={name:"flip",enabled:!0,phase:"main",fn:P9,requiresIfExists:["offset"],data:{_skip:!1}};function Vv(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Hv(e){return[dn,Hn,Vn,pn].some(function(t){return e[t]>=0})}function T9(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=hs(t,{elementContext:"reference"}),s=hs(t,{altBoundary:!0}),l=Vv(a,r),c=Vv(s,o,i),u=Hv(l),f=Hv(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const A9={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:T9};function k9(e,t,n){var r=br(e),o=[pn,dn].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[pn,Hn].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function j9(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,a=gw.reduce(function(u,f){return u[f]=k9(f,t.rects,i),u},{}),s=a[t.placement],l=s.x,c=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const I9={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:j9};function M9(e){var t=e.state,n=e.name;t.modifiersData[n]=Sw({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const R9={name:"popperOffsets",enabled:!0,phase:"read",fn:M9,data:{}};function D9(e){return e==="x"?"y":"x"}function N9(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,g=h===void 0?0:h,v=hs(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),x=br(t.placement),w=Ri(t.placement),$=!w,C=Ig(x),S=D9(C),b=t.modifiersData.popperOffsets,O=t.rects.reference,P=t.rects.popper,T=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,k=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(b){if(i){var I,j=C==="y"?dn:pn,M=C==="y"?Vn:Hn,D=C==="y"?"height":"width",L=b[C],B=L+v[j],F=L-v[M],Z=p?-P[D]/2:0,ie=w===ji?O[D]:P[D],te=w===ji?-P[D]:-O[D],le=t.elements.arrow,re=p&&le?jg(le):{width:0,height:0},ae=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:yw(),xe=ae[j],Me=ae[M],we=Ja(0,O[D],re[D]),Y=$?O[D]/2-Z-we-xe-k.mainAxis:ie-we-xe-k.mainAxis,ve=$?-O[D]/2+Z+we+Me+k.mainAxis:te+we+Me+k.mainAxis,ce=t.elements.arrow&&dl(t.elements.arrow),G=ce?C==="y"?ce.clientTop||0:ce.clientLeft||0:0,fe=(I=_==null?void 0:_[C])!=null?I:0,de=L+Y-fe-G,pe=L+ve-fe,se=Ja(p?wc(B,de):B,L,p?Wo(F,pe):F);b[C]=se,A[C]=se-L}if(s){var Le,Ce=C==="x"?dn:pn,Ge=C==="x"?Vn:Hn,N=b[S],z=S==="y"?"height":"width",U=N+v[Ce],W=N-v[Ge],V=[dn,pn].indexOf(x)!==-1,q=(Le=_==null?void 0:_[S])!=null?Le:0,ue=V?U:N-O[z]-P[z]-q+k.altAxis,Ae=V?N+O[z]+P[z]-q-k.altAxis:W,Se=p&&V?s9(ue,N,Ae):Ja(p?ue:U,N,p?Ae:W);b[S]=Se,A[S]=Se-N}t.modifiersData[r]=A}}const L9={name:"preventOverflow",enabled:!0,phase:"main",fn:N9,requiresIfExists:["offset"]};function B9(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function F9(e){return e===En(e)||!Fn(e)?Mg(e):B9(e)}function z9(e){var t=e.getBoundingClientRect(),n=Ii(t.width)/e.offsetWidth||1,r=Ii(t.height)/e.offsetHeight||1;return n!==1||r!==1}function W9(e,t,n){n===void 0&&(n=!1);var r=Fn(t),o=Fn(t)&&z9(t),i=$o(t),a=Mi(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(($r(t)!=="body"||Dg(i))&&(s=F9(t)),Fn(t)?(l=Mi(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Rg(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function V9(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function H9(e){var t=V9(e);return t9.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function U9(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function G9(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Uv={placement:"bottom",modifiers:[],strategy:"absolute"};function Gv(){for(var e=arguments.length,t=new Array(e),n=0;n{i||s(Y9(o)||document.body)},[o,i]),Sr(()=>{if(a&&!i)return yc(n,a),()=>{yc(n,null)}},[n,a,i]),i){if(y.isValidElement(r)){const c={ref:l};return y.cloneElement(r,c)}return m.jsx(y.Fragment,{children:r})}return m.jsx(y.Fragment,{children:a&&ia.createPortal(r,a)})});function Z9(e){return qe("MuiPopper",e)}Xe("MuiPopper",["root"]);const Q9=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],J9=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function e4(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function Tp(e){return typeof e=="function"?e():e}function t4(e){return e.nodeType!==void 0}const n4=()=>Ke({root:["root"]},I6(Z9)),r4={},o4=y.forwardRef(function(t,n){var r;const{anchorEl:o,children:i,direction:a,disablePortal:s,modifiers:l,open:c,placement:u,popperOptions:f,popperRef:d,slotProps:p={},slots:h={},TransitionProps:g}=t,v=je(t,Q9),x=y.useRef(null),w=It(x,n),$=y.useRef(null),C=It($,d),S=y.useRef(C);Sr(()=>{S.current=C},[C]),y.useImperativeHandle(d,()=>$.current,[]);const b=e4(u,a),[O,P]=y.useState(b),[T,k]=y.useState(Tp(o));y.useEffect(()=>{$.current&&$.current.forceUpdate()}),y.useEffect(()=>{o&&k(Tp(o))},[o]),Sr(()=>{if(!T||!c)return;const M=B=>{P(B.placement)};let D=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:B})=>{M(B)}}];l!=null&&(D=D.concat(l)),f&&f.modifiers!=null&&(D=D.concat(f.modifiers));const L=X9(T,x.current,R({placement:b},f,{modifiers:D}));return S.current(L),()=>{L.destroy(),S.current(null)}},[T,s,l,c,f,b]);const _={placement:O};g!==null&&(_.TransitionProps=g);const A=n4(),I=(r=h.root)!=null?r:"div",j=ir({elementType:I,externalSlotProps:p.root,externalForwardedProps:v,additionalProps:{role:"tooltip",ref:w},ownerState:t,className:A.root});return m.jsx(I,R({},j,{children:typeof i=="function"?i(_):i}))}),i4=y.forwardRef(function(t,n){const{anchorEl:r,children:o,container:i,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=r4,popperRef:p,style:h,transition:g=!1,slotProps:v={},slots:x={}}=t,w=je(t,J9),[$,C]=y.useState(!0),S=()=>{C(!1)},b=()=>{C(!0)};if(!l&&!u&&(!g||$))return null;let O;if(i)O=i;else if(r){const k=Tp(r);O=k&&t4(k)?Jt(k).body:Jt(null).body}const P=!u&&l&&(!g||$)?"none":void 0,T=g?{in:u,onEnter:S,onExited:b}:void 0;return m.jsx($w,{disablePortal:s,container:O,children:m.jsx(o4,R({anchorEl:r,direction:a,disablePortal:s,modifiers:c,ref:n,open:g?!$:u,placement:f,popperOptions:d,popperRef:p,slotProps:v,slots:x},w,{style:R({position:"fixed",top:0,left:0,display:P},h),TransitionProps:T,children:o}))})});function a4(e){const t=Jt(e);return t.body===e?or(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function ts(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function Kv(e){return parseInt(or(e).getComputedStyle(e).paddingRight,10)||0}function s4(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function qv(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,a=>{const s=i.indexOf(a)===-1,l=!s4(a);s&&l&&ts(a,o)})}function cd(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function l4(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(a4(r)){const a=aw(Jt(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${Kv(r)+a}px`;const s=Jt(r).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${Kv(l)+a}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=Jt(r).body;else{const a=r.parentElement,s=or(r);i=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{n.forEach(({value:i,el:a,property:s})=>{i?a.style.setProperty(s,i):a.style.removeProperty(s)})}}function c4(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class u4{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&ts(t.modalRef,!1);const o=c4(n);qv(n,t.mount,t.modalRef,o,!0);const i=cd(this.containers,a=>a.container===n);return i!==-1?(this.containers[i].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=cd(this.containers,i=>i.modals.indexOf(t)!==-1),o=this.containers[r];o.restore||(o.restore=l4(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=cd(this.containers,a=>a.modals.indexOf(t)!==-1),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(r,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&ts(t.modalRef,n),qv(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const a=i.modals[i.modals.length-1];a.modalRef&&ts(a.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function f4(e){return typeof e=="function"?e():e}function d4(e){return e?e.props.hasOwnProperty("in"):!1}const p4=new u4;function h4(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:o=p4,closeAfterTransition:i=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:f}=e,d=y.useRef({}),p=y.useRef(null),h=y.useRef(null),g=It(h,f),[v,x]=y.useState(!u),w=d4(l);let $=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&($=!1);const C=()=>Jt(p.current),S=()=>(d.current.modalRef=h.current,d.current.mount=p.current,d.current),b=()=>{o.mount(S(),{disableScrollLock:r}),h.current&&(h.current.scrollTop=0)},O=Sn(()=>{const D=f4(t)||C().body;o.add(S(),D),h.current&&b()}),P=y.useCallback(()=>o.isTopModal(S()),[o]),T=Sn(D=>{p.current=D,D&&(u&&P()?b():h.current&&ts(h.current,$))}),k=y.useCallback(()=>{o.remove(S(),$)},[$,o]);y.useEffect(()=>()=>{k()},[k]),y.useEffect(()=>{u?O():(!w||!i)&&k()},[u,k,w,i,O]);const _=D=>L=>{var B;(B=D.onKeyDown)==null||B.call(D,L),!(L.key!=="Escape"||L.which===229||!P())&&(n||(L.stopPropagation(),c&&c(L,"escapeKeyDown")))},A=D=>L=>{var B;(B=D.onClick)==null||B.call(D,L),L.target===L.currentTarget&&c&&c(L,"backdropClick")};return{getRootProps:(D={})=>{const L=dw(e);delete L.onTransitionEnter,delete L.onTransitionExited;const B=R({},L,D);return R({role:"presentation"},B,{onKeyDown:_(B),ref:g})},getBackdropProps:(D={})=>{const L=D;return R({"aria-hidden":!0},L,{onClick:A(L),open:u})},getTransitionProps:()=>{const D=()=>{x(!1),a&&a()},L=()=>{x(!0),s&&s(),i&&k()};return{onEnter:$v(D,l==null?void 0:l.props.onEnter),onExited:$v(L,l==null?void 0:l.props.onExited)}},rootRef:g,portalRef:T,isTopModal:P,exited:v,hasTransition:w}}const g4=["top","right","bottom","left"],bo=Math.min,xn=Math.max,Sc=Math.round,Fl=Math.floor,xo=e=>({x:e,y:e}),m4={left:"right",right:"left",bottom:"top",top:"bottom"},v4={start:"end",end:"start"};function Ap(e,t,n){return xn(e,bo(t,n))}function Wr(e,t){return typeof e=="function"?e(t):e}function Vr(e){return e.split("-")[0]}function ua(e){return e.split("-")[1]}function Ng(e){return e==="x"?"y":"x"}function Lg(e){return e==="y"?"height":"width"}function fa(e){return["top","bottom"].includes(Vr(e))?"y":"x"}function Bg(e){return Ng(fa(e))}function y4(e,t,n){n===void 0&&(n=!1);const r=ua(e),o=Bg(e),i=Lg(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=$c(a)),[a,$c(a)]}function b4(e){const t=$c(e);return[kp(e),t,kp(t)]}function kp(e){return e.replace(/start|end/g,t=>v4[t])}function x4(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function w4(e,t,n,r){const o=ua(e);let i=x4(Vr(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(kp)))),i}function $c(e){return e.replace(/left|right|bottom|top/g,t=>m4[t])}function S4(e){return{top:0,right:0,bottom:0,left:0,...e}}function Cw(e){return typeof e!="number"?S4(e):{top:e,right:e,bottom:e,left:e}}function Cc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Xv(e,t,n){let{reference:r,floating:o}=e;const i=fa(t),a=Bg(t),s=Lg(a),l=Vr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(ua(t)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1);break}return p}const $4=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Xv(c,r,l),d=r,p={},h=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Wr(e,t)||{};if(c==null)return{};const f=Cw(u),d={x:n,y:r},p=Bg(o),h=Lg(p),g=await a.getDimensions(c),v=p==="y",x=v?"top":"left",w=v?"bottom":"right",$=v?"clientHeight":"clientWidth",C=i.reference[h]+i.reference[p]-d[p]-i.floating[h],S=d[p]-i.reference[p],b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let O=b?b[$]:0;(!O||!await(a.isElement==null?void 0:a.isElement(b)))&&(O=s.floating[$]||i.floating[h]);const P=C/2-S/2,T=O/2-g[h]/2-1,k=bo(f[x],T),_=bo(f[w],T),A=k,I=O-g[h]-_,j=O/2-g[h]/2+P,M=Ap(A,j,I),D=!l.arrow&&ua(o)!=null&&j!=M&&i.reference[h]/2-(jA<=0)){var T,k;const A=(((T=i.flip)==null?void 0:T.index)||0)+1,I=S[A];if(I)return{data:{index:A,overflows:P},reset:{placement:I}};let j=(k=P.filter(M=>M.overflows[0]<=0).sort((M,D)=>M.overflows[1]-D.overflows[1])[0])==null?void 0:k.placement;if(!j)switch(p){case"bestFit":{var _;const M=(_=P.map(D=>[D.placement,D.overflows.filter(L=>L>0).reduce((L,B)=>L+B,0)]).sort((D,L)=>D[1]-L[1])[0])==null?void 0:_[0];M&&(j=M);break}case"initialPlacement":j=s;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Zv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qv(e){return g4.some(t=>e[t]>=0)}const O4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Wr(e,t);switch(r){case"referenceHidden":{const i=await gs(t,{...o,elementContext:"reference"}),a=Zv(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Qv(a)}}}case"escaped":{const i=await gs(t,{...o,altBoundary:!0}),a=Zv(i,n.floating);return{data:{escapedOffsets:a,escaped:Qv(a)}}}default:return{}}}}};async function E4(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Vr(n),s=ua(n),l=fa(n)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,f=Wr(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}const P4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await E4(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},_4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...l}=Wr(e,t),c={x:n,y:r},u=await gs(t,l),f=fa(Vr(o)),d=Ng(f);let p=c[d],h=c[f];if(i){const v=d==="y"?"top":"left",x=d==="y"?"bottom":"right",w=p+u[v],$=p-u[x];p=Ap(w,p,$)}if(a){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=h+u[v],$=h-u[x];h=Ap(w,h,$)}const g=s.fn({...t,[d]:p,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r}}}}},T4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Wr(e,t),u={x:n,y:r},f=fa(o),d=Ng(f);let p=u[d],h=u[f];const g=Wr(s,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const $=d==="y"?"height":"width",C=i.reference[d]-i.floating[$]+v.mainAxis,S=i.reference[d]+i.reference[$]-v.mainAxis;pS&&(p=S)}if(c){var x,w;const $=d==="y"?"width":"height",C=["top","left"].includes(Vr(o)),S=i.reference[f]-i.floating[$]+(C&&((x=a.offset)==null?void 0:x[f])||0)+(C?0:v.crossAxis),b=i.reference[f]+i.reference[$]+(C?0:((w=a.offset)==null?void 0:w[f])||0)-(C?v.crossAxis:0);hb&&(h=b)}return{[d]:p,[f]:h}}}},A4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:a=()=>{},...s}=Wr(e,t),l=await gs(t,s),c=Vr(n),u=ua(n),f=fa(n)==="y",{width:d,height:p}=r.floating;let h,g;c==="top"||c==="bottom"?(h=c,g=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,h=u==="end"?"top":"bottom");const v=p-l[h],x=d-l[g],w=!t.middlewareData.shift;let $=v,C=x;if(f){const b=d-l.left-l.right;C=u||w?bo(x,b):b}else{const b=p-l.top-l.bottom;$=u||w?bo(v,b):b}if(w&&!u){const b=xn(l.left,0),O=xn(l.right,0),P=xn(l.top,0),T=xn(l.bottom,0);f?C=d-2*(b!==0||O!==0?b+O:xn(l.left,l.right)):$=p-2*(P!==0||T!==0?P+T:xn(l.top,l.bottom))}await a({...t,availableWidth:C,availableHeight:$});const S=await o.getDimensions(i.floating);return d!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function wo(e){return Ow(e)?(e.nodeName||"").toLowerCase():"#document"}function On(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qr(e){var t;return(t=(Ow(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ow(e){return e instanceof Node||e instanceof On(e).Node}function Hr(e){return e instanceof Element||e instanceof On(e).Element}function Cr(e){return e instanceof HTMLElement||e instanceof On(e).HTMLElement}function Jv(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof On(e).ShadowRoot}function pl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Un(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function k4(e){return["table","td","th"].includes(wo(e))}function Fg(e){const t=zg(),n=Un(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function j4(e){let t=Di(e);for(;Cr(t)&&!Yu(t);){if(Fg(t))return t;t=Di(t)}return null}function zg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Yu(e){return["html","body","#document"].includes(wo(e))}function Un(e){return On(e).getComputedStyle(e)}function Zu(e){return Hr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Di(e){if(wo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jv(e)&&e.host||Qr(e);return Jv(t)?t.host:t}function Ew(e){const t=Di(e);return Yu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cr(t)&&pl(t)?t:Ew(t)}function ms(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ew(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=On(o);return i?t.concat(a,a.visualViewport||[],pl(o)?o:[],a.frameElement&&n?ms(a.frameElement):[]):t.concat(o,ms(o,[],n))}function Pw(e){const t=Un(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Cr(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Sc(n)!==i||Sc(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Wg(e){return Hr(e)?e:e.contextElement}function Si(e){const t=Wg(e);if(!Cr(t))return xo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Pw(t);let a=(i?Sc(n.width):n.width)/r,s=(i?Sc(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const I4=xo(0);function _w(e){const t=On(e);return!zg()||!t.visualViewport?I4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function M4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==On(e)?!1:t}function Xo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Wg(e);let a=xo(1);t&&(r?Hr(r)&&(a=Si(r)):a=Si(e));const s=M4(i,n,r)?_w(i):xo(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){const d=On(i),p=r&&Hr(r)?On(r):r;let h=d.frameElement;for(;h&&r&&p!==d;){const g=Si(h),v=h.getBoundingClientRect(),x=Un(h),w=v.left+(h.clientLeft+parseFloat(x.paddingLeft))*g.x,$=v.top+(h.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,f*=g.y,l+=w,c+=$,h=On(h).frameElement}}return Cc({width:u,height:f,x:l,y:c})}function R4(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Cr(n),i=Qr(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s=xo(1);const l=xo(0);if((o||!o&&r!=="fixed")&&((wo(n)!=="body"||pl(i))&&(a=Zu(n)),Cr(n))){const c=Xo(n);s=Si(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}}function D4(e){return Array.from(e.getClientRects())}function Tw(e){return Xo(Qr(e)).left+Zu(e).scrollLeft}function N4(e){const t=Qr(e),n=Zu(e),r=e.ownerDocument.body,o=xn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Tw(e);const s=-n.scrollTop;return Un(r).direction==="rtl"&&(a+=xn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function L4(e,t){const n=On(e),r=Qr(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const c=zg();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function B4(e,t){const n=Xo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Cr(e)?Si(e):xo(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:a,height:s,x:l,y:c}}function e1(e,t,n){let r;if(t==="viewport")r=L4(e,n);else if(t==="document")r=N4(Qr(e));else if(Hr(t))r=B4(t,n);else{const o=_w(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Cc(r)}function Aw(e,t){const n=Di(e);return n===t||!Hr(n)||Yu(n)?!1:Un(n).position==="fixed"||Aw(n,t)}function F4(e,t){const n=t.get(e);if(n)return n;let r=ms(e,[],!1).filter(s=>Hr(s)&&wo(s)!=="body"),o=null;const i=Un(e).position==="fixed";let a=i?Di(e):e;for(;Hr(a)&&!Yu(a);){const s=Un(a),l=Fg(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||pl(a)&&!l&&Aw(e,a))?r=r.filter(u=>u!==a):o=s,a=Di(a)}return t.set(e,r),r}function z4(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?F4(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const f=e1(t,u,o);return c.top=xn(f.top,c.top),c.right=bo(f.right,c.right),c.bottom=bo(f.bottom,c.bottom),c.left=xn(f.left,c.left),c},e1(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function W4(e){return Pw(e)}function V4(e,t,n){const r=Cr(t),o=Qr(t),i=n==="fixed",a=Xo(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=xo(0);if(r||!r&&!i)if((wo(t)!=="body"||pl(o))&&(s=Zu(t)),r){const c=Xo(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=Tw(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function t1(e,t){return!Cr(e)||Un(e).position==="fixed"?null:t?t(e):e.offsetParent}function kw(e,t){const n=On(e);if(!Cr(e))return n;let r=t1(e,t);for(;r&&k4(r)&&Un(r).position==="static";)r=t1(r,t);return r&&(wo(r)==="html"||wo(r)==="body"&&Un(r).position==="static"&&!Fg(r))?n:r||j4(e)||n}const H4=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||kw,i=this.getDimensions;return{reference:V4(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function U4(e){return Un(e).direction==="rtl"}const G4={convertOffsetParentRelativeRectToViewportRelativeRect:R4,getDocumentElement:Qr,getClippingRect:z4,getOffsetParent:kw,getElementRects:H4,getClientRects:D4,getDimensions:W4,getScale:Si,isElement:Hr,isRTL:U4};function K4(e,t){let n=null,r;const o=Qr(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const p=Fl(u),h=Fl(o.clientWidth-(c+f)),g=Fl(o.clientHeight-(u+d)),v=Fl(c),w={rootMargin:-p+"px "+-h+"px "+-g+"px "+-v+"px",threshold:xn(0,bo(1,l))||1};let $=!0;function C(S){const b=S[0].intersectionRatio;if(b!==l){if(!$)return a();b?a(!1,b):r=setTimeout(()=>{a(!1,1e-7)},100)}$=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return a(!0),i}function q4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Wg(e),u=o||i?[...c?ms(c):[],...ms(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=c&&s?K4(c,n):null;let d=-1,p=null;a&&(p=new ResizeObserver(x=>{let[w]=x;w&&w.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let h,g=l?Xo(e):null;l&&v();function v(){const x=Xo(e);g&&(x.x!==g.x||x.y!==g.y||x.width!==g.width||x.height!==g.height)&&n(),g=x,h=requestAnimationFrame(v)}return n(),()=>{u.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const X4=(e,t,n)=>{const r=new Map,o={platform:G4,...n},i={...o.platform,_c:r};return $4(e,t,{...o,platform:i})},Y4=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Yv({element:r.current,padding:o}).fn(n):{}:r?Yv({element:r,padding:o}).fn(n):{}}}};var dc=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Oc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Oc(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Oc(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function jw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function n1(e,t){const n=jw(e);return Math.round(t*n)/n}function r1(e){const t=y.useRef(e);return dc(()=>{t.current=e}),t}function Z4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,f]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=y.useState(r);Oc(d,r)||p(r);const[h,g]=y.useState(null),[v,x]=y.useState(null),w=y.useCallback(D=>{D!=b.current&&(b.current=D,g(D))},[g]),$=y.useCallback(D=>{D!==O.current&&(O.current=D,x(D))},[x]),C=i||h,S=a||v,b=y.useRef(null),O=y.useRef(null),P=y.useRef(u),T=r1(l),k=r1(o),_=y.useCallback(()=>{if(!b.current||!O.current)return;const D={placement:t,strategy:n,middleware:d};k.current&&(D.platform=k.current),X4(b.current,O.current,D).then(L=>{const B={...L,isPositioned:!0};A.current&&!Oc(P.current,B)&&(P.current=B,ia.flushSync(()=>{f(B)}))})},[d,t,n,k]);dc(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(D=>({...D,isPositioned:!1})))},[c]);const A=y.useRef(!1);dc(()=>(A.current=!0,()=>{A.current=!1}),[]),dc(()=>{if(C&&(b.current=C),S&&(O.current=S),C&&S){if(T.current)return T.current(C,S,_);_()}},[C,S,_,T]);const I=y.useMemo(()=>({reference:b,floating:O,setReference:w,setFloating:$}),[w,$]),j=y.useMemo(()=>({reference:C,floating:S}),[C,S]),M=y.useMemo(()=>{const D={position:n,left:0,top:0};if(!j.floating)return D;const L=n1(j.floating,u.x),B=n1(j.floating,u.y);return s?{...D,transform:"translate("+L+"px, "+B+"px)",...jw(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:B}},[n,s,j.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:_,refs:I,elements:j,floatingStyles:M}),[u,_,I,j,M])}const Q4=["onChange","maxRows","minRows","style","value"];function zl(e){return parseInt(e,10)||0}const J4={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function o1(e){return e==null||Object.keys(e).length===0||e.outerHeightStyle===0&&!e.overflow}const eP=y.forwardRef(function(t,n){const{onChange:r,maxRows:o,minRows:i=1,style:a,value:s}=t,l=je(t,Q4),{current:c}=y.useRef(s!=null),u=y.useRef(null),f=It(n,u),d=y.useRef(null),p=y.useRef(0),[h,g]=y.useState({outerHeightStyle:0}),v=y.useCallback(()=>{const C=u.current,b=or(C).getComputedStyle(C);if(b.width==="0px")return{outerHeightStyle:0};const O=d.current;O.style.width=b.width,O.value=C.value||t.placeholder||"x",O.value.slice(-1)===` -`&&(O.value+=" ");const P=b.boxSizing,T=zl(b.paddingBottom)+zl(b.paddingTop),k=zl(b.borderBottomWidth)+zl(b.borderTopWidth),_=O.scrollHeight;O.value="x";const A=O.scrollHeight;let I=_;i&&(I=Math.max(Number(i)*A,I)),o&&(I=Math.min(Number(o)*A,I)),I=Math.max(I,A);const j=I+(P==="border-box"?T+k:0),M=Math.abs(I-_)<=1;return{outerHeightStyle:j,overflow:M}},[o,i,t.placeholder]),x=(C,S)=>{const{outerHeightStyle:b,overflow:O}=S;return p.current<20&&(b>0&&Math.abs((C.outerHeightStyle||0)-b)>1||C.overflow!==O)?(p.current+=1,{overflow:O,outerHeightStyle:b}):C},w=y.useCallback(()=>{const C=v();o1(C)||g(S=>x(S,C))},[v]);Sr(()=>{const C=()=>{const _=v();o1(_)||ia.flushSync(()=>{g(A=>x(A,_))})},S=()=>{p.current=0,C()};let b;const O=cl(S),P=u.current,T=or(P);T.addEventListener("resize",O);let k;return typeof ResizeObserver<"u"&&(k=new ResizeObserver(S),k.observe(P)),()=>{O.clear(),cancelAnimationFrame(b),T.removeEventListener("resize",O),k&&k.disconnect()}},[v]),Sr(()=>{w()}),y.useEffect(()=>{p.current=0},[s]);const $=C=>{p.current=0,c||w(),r&&r(C)};return m.jsxs(y.Fragment,{children:[m.jsx("textarea",R({value:s,onChange:$,ref:f,rows:i,style:R({height:h.outerHeightStyle,overflow:h.overflow?"hidden":void 0},a)},l)),m.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:d,tabIndex:-1,style:R({},J4.shadow,a,{paddingTop:0,paddingBottom:0})})]})});function i1(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function tP(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:a=!1}=e;return(s,{inputValue:l,getOptionLabel:c})=>{let u=a?l.trim():l;n&&(u=u.toLowerCase()),t&&(u=i1(u));const f=u?s.filter(d=>{let p=(i||c)(d);return n&&(p=p.toLowerCase()),t&&(p=i1(p)),o==="start"?p.indexOf(u)===0:p.indexOf(u)>-1}):s;return typeof r=="number"?f.slice(0,r):f}}function ud(e,t){for(let n=0;n{var t;return e.current!==null&&((t=e.current.parentElement)==null?void 0:t.contains(document.activeElement))};function oP(e){const{unstable_isActiveElementInListbox:t=rP,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:a=!1,clearOnBlur:s=!e.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:u=e.multiple?[]:null,disableClearable:f=!1,disableCloseOnSelect:d=!1,disabled:p,disabledItemsFocusable:h=!1,disableListWrap:g=!1,filterOptions:v=nP,filterSelectedOptions:x=!1,freeSolo:w=!1,getOptionDisabled:$,getOptionKey:C,getOptionLabel:S=Q=>{var H;return(H=Q.label)!=null?H:Q},groupBy:b,handleHomeEndKeys:O=!e.freeSolo,id:P,includeInputInList:T=!1,inputValue:k,isOptionEqualToValue:_=(Q,H)=>Q===H,multiple:A=!1,onChange:I,onClose:j,onHighlightChange:M,onInputChange:D,onOpen:L,open:B,openOnFocus:F=!1,options:Z,readOnly:ie=!1,selectOnFocus:te=!e.freeSolo,value:le}=e,re=Og(P);let ae=S;ae=Q=>{const H=S(Q);return typeof H!="string"?String(H):H};const xe=y.useRef(!1),Me=y.useRef(!0),we=y.useRef(null),Y=y.useRef(null),[ve,ce]=y.useState(null),[G,fe]=y.useState(-1),de=o?0:-1,pe=y.useRef(de),[se,Le]=Qa({controlled:le,default:u,name:c}),[Ce,Ge]=Qa({controlled:k,default:"",name:c,state:"inputValue"}),[N,z]=y.useState(!1),U=y.useCallback((Q,H)=>{if(!(A?se.length!(x&&(A?se:[se]).some(H=>H!==null&&_(Q,H)))),{inputValue:Ae&&q?"":Ce,getOptionLabel:ae}):[],Ze=mE({filteredOptions:ne,value:se,inputValue:Ce});y.useEffect(()=>{const Q=se!==Ze.value;N&&!Q||w&&!Q||U(null,se)},[se,U,N,Ze.value,w]);const St=W&&ne.length>0&&!ie,$t=Sn(Q=>{Q===-1?we.current.focus():ve.querySelector(`[data-tag-index="${Q}"]`).focus()});y.useEffect(()=>{A&&G>se.length-1&&(fe(-1),$t(-1))},[se,A,G,$t]);function Oe(Q,H){if(!Y.current||Q<0||Q>=ne.length)return-1;let ye=Q;for(;;){const ke=Y.current.querySelector(`[data-option-index="${ye}"]`),rt=h?!1:!ke||ke.disabled||ke.getAttribute("aria-disabled")==="true";if(ke&&ke.hasAttribute("tabindex")&&!rt)return ye;if(H==="next"?ye=(ye+1)%ne.length:ye=(ye-1+ne.length)%ne.length,ye===Q)return-1}}const Be=Sn(({event:Q,index:H,reason:ye="auto"})=>{if(pe.current=H,H===-1?we.current.removeAttribute("aria-activedescendant"):we.current.setAttribute("aria-activedescendant",`${re}-option-${H}`),M&&M(Q,H===-1?null:ne[H],ye),!Y.current)return;const ke=Y.current.querySelector(`[role="option"].${n}-focused`);ke&&(ke.classList.remove(`${n}-focused`),ke.classList.remove(`${n}-focusVisible`));let rt=Y.current;if(Y.current.getAttribute("role")!=="listbox"&&(rt=Y.current.parentElement.querySelector('[role="listbox"]')),!rt)return;if(H===-1){rt.scrollTop=0;return}const _t=Y.current.querySelector(`[data-option-index="${H}"]`);if(_t&&(_t.classList.add(`${n}-focused`),ye==="keyboard"&&_t.classList.add(`${n}-focusVisible`),rt.scrollHeight>rt.clientHeight&&ye!=="mouse"&&ye!=="touch")){const At=_t,fr=rt.clientHeight+rt.scrollTop,bv=At.offsetTop+At.offsetHeight;bv>fr?rt.scrollTop=bv-rt.clientHeight:At.offsetTop-At.offsetHeight*(b?1.3:0){if(!Se)return;const _t=Oe((()=>{const At=ne.length-1;if(H==="reset")return de;if(H==="start")return 0;if(H==="end")return At;const fr=pe.current+H;return fr<0?fr===-1&&T?-1:g&&pe.current!==-1||Math.abs(H)>1?0:At:fr>At?fr===At+1&&T?-1:g||Math.abs(H)>1?At:0:fr})(),ye);if(Be({index:_t,reason:ke,event:Q}),r&&H!=="reset")if(_t===-1)we.current.value=Ce;else{const At=ae(ne[_t]);we.current.value=At,At.toLowerCase().indexOf(Ce.toLowerCase())===0&&Ce.length>0&&we.current.setSelectionRange(Ce.length,At.length)}}),$e=()=>{const Q=(H,ye)=>{const ke=H?ae(H):"",rt=ye?ae(ye):"";return ke===rt};if(pe.current!==-1&&Ze.filteredOptions&&Ze.filteredOptions.length!==ne.length&&Ze.inputValue===Ce&&(A?se.length===Ze.value.length&&Ze.value.every((H,ye)=>ae(se[ye])===ae(H)):Q(Ze.value,se))){const H=Ze.filteredOptions[pe.current];if(H&&ne.some(ke=>ae(ke)===ae(H)))return!0}return!1},Fe=y.useCallback(()=>{if(!Se||$e())return;const Q=A?se[0]:se;if(ne.length===0||Q==null){oe({diff:"reset"});return}if(Y.current){if(Q!=null){const H=ne[pe.current];if(A&&H&&ud(se,ke=>_(H,ke))!==-1)return;const ye=ud(ne,ke=>_(ke,Q));ye===-1?oe({diff:"reset"}):Be({index:ye});return}if(pe.current>=ne.length-1){Be({index:ne.length-1});return}Be({index:pe.current})}},[ne.length,A?!1:se,x,oe,Be,Se,Ce,A]),Ve=Sn(Q=>{yc(Y,Q),Q&&Fe()});y.useEffect(()=>{Fe()},[Fe]);const et=Q=>{W||(V(!0),ue(!0),L&&L(Q))},pt=(Q,H)=>{W&&(V(!1),j&&j(Q,H))},Et=(Q,H,ye,ke)=>{if(A){if(se.length===H.length&&se.every((rt,_t)=>rt===H[_t]))return}else if(se===H)return;I&&I(Q,H,ye,ke),Le(H)},Tn=y.useRef(!1),Gt=(Q,H,ye="selectOption",ke="options")=>{let rt=ye,_t=H;if(A){_t=Array.isArray(se)?se.slice():[];const At=ud(_t,fr=>_(H,fr));At===-1?_t.push(H):ke!=="freeSolo"&&(_t.splice(At,1),rt="removeOption")}U(Q,_t),Et(Q,_t,rt,{option:H}),!d&&(!Q||!Q.ctrlKey&&!Q.metaKey)&&pt(Q,rt),(a===!0||a==="touch"&&Tn.current||a==="mouse"&&!Tn.current)&&we.current.blur()};function to(Q,H){if(Q===-1)return-1;let ye=Q;for(;;){if(H==="next"&&ye===se.length||H==="previous"&&ye===-1)return-1;const ke=ve.querySelector(`[data-tag-index="${ye}"]`);if(!ke||!ke.hasAttribute("tabindex")||ke.disabled||ke.getAttribute("aria-disabled")==="true")ye+=H==="next"?1:-1;else return ye}}const Dl=(Q,H)=>{if(!A)return;Ce===""&&pt(Q,"toggleInput");let ye=G;G===-1?Ce===""&&H==="previous"&&(ye=se.length-1):(ye+=H==="next"?1:-1,ye<0&&(ye=0),ye===se.length&&(ye=-1)),ye=to(ye,H),fe(ye),$t(ye)},Nl=Q=>{xe.current=!0,Ge(""),D&&D(Q,"","clear"),Et(Q,A?[]:null,"clear")},nd=Q=>H=>{if(Q.onKeyDown&&Q.onKeyDown(H),!H.defaultMuiPrevented&&(G!==-1&&["ArrowLeft","ArrowRight"].indexOf(H.key)===-1&&(fe(-1),$t(-1)),H.which!==229))switch(H.key){case"Home":Se&&O&&(H.preventDefault(),oe({diff:"start",direction:"next",reason:"keyboard",event:H}));break;case"End":Se&&O&&(H.preventDefault(),oe({diff:"end",direction:"previous",reason:"keyboard",event:H}));break;case"PageUp":H.preventDefault(),oe({diff:-a1,direction:"previous",reason:"keyboard",event:H}),et(H);break;case"PageDown":H.preventDefault(),oe({diff:a1,direction:"next",reason:"keyboard",event:H}),et(H);break;case"ArrowDown":H.preventDefault(),oe({diff:1,direction:"next",reason:"keyboard",event:H}),et(H);break;case"ArrowUp":H.preventDefault(),oe({diff:-1,direction:"previous",reason:"keyboard",event:H}),et(H);break;case"ArrowLeft":Dl(H,"previous");break;case"ArrowRight":Dl(H,"next");break;case"Enter":if(pe.current!==-1&&Se){const ye=ne[pe.current],ke=$?$(ye):!1;if(H.preventDefault(),ke)return;Gt(H,ye,"selectOption"),r&&we.current.setSelectionRange(we.current.value.length,we.current.value.length)}else w&&Ce!==""&&Ae===!1&&(A&&H.preventDefault(),Gt(H,Ce,"createOption","freeSolo"));break;case"Escape":Se?(H.preventDefault(),H.stopPropagation(),pt(H,"escape")):l&&(Ce!==""||A&&se.length>0)&&(H.preventDefault(),H.stopPropagation(),Nl(H));break;case"Backspace":if(A&&!ie&&Ce===""&&se.length>0){const ye=G===-1?se.length-1:G,ke=se.slice();ke.splice(ye,1),Et(H,ke,"removeOption",{option:se[ye]})}break;case"Delete":if(A&&!ie&&Ce===""&&se.length>0&&G!==-1){const ye=G,ke=se.slice();ke.splice(ye,1),Et(H,ke,"removeOption",{option:se[ye]})}break}},vv=Q=>{z(!0),F&&!xe.current&&et(Q)},ri=Q=>{if(t(Y)){we.current.focus();return}z(!1),Me.current=!0,xe.current=!1,i&&pe.current!==-1&&Se?Gt(Q,ne[pe.current],"blur"):i&&w&&Ce!==""?Gt(Q,Ce,"blur","freeSolo"):s&&U(Q,se),pt(Q,"blur")},Kt=Q=>{const H=Q.target.value;Ce!==H&&(Ge(H),ue(!1),D&&D(Q,H,"input")),H===""?!f&&!A&&Et(Q,null,"clear"):et(Q)},Dt=Q=>{const H=Number(Q.currentTarget.getAttribute("data-option-index"));pe.current!==H&&Be({event:Q,index:H,reason:"mouse"})},Yn=Q=>{Be({event:Q,index:Number(Q.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Tn.current=!0},yv=Q=>{const H=Number(Q.currentTarget.getAttribute("data-option-index"));Gt(Q,ne[H],"selectOption"),Tn.current=!1},rd=Q=>H=>{const ye=se.slice();ye.splice(Q,1),Et(H,ye,"removeOption",{option:se[Q]})},od=Q=>{W?pt(Q,"toggleInput"):et(Q)},id=Q=>{Q.currentTarget.contains(Q.target)&&Q.target.getAttribute("id")!==re&&Q.preventDefault()},Ll=Q=>{Q.currentTarget.contains(Q.target)&&(we.current.focus(),te&&Me.current&&we.current.selectionEnd-we.current.selectionStart===0&&we.current.select(),Me.current=!1)},Pa=Q=>{!p&&(Ce===""||!W)&&od(Q)};let _o=w&&Ce.length>0;_o=_o||(A?se.length>0:se!==null);let oi=ne;return b&&(oi=ne.reduce((Q,H,ye)=>{const ke=b(H);return Q.length>0&&Q[Q.length-1].group===ke?Q[Q.length-1].options.push(H):Q.push({key:ye,index:ye,group:ke,options:[H]}),Q},[])),p&&N&&ri(),{getRootProps:(Q={})=>R({"aria-owns":St?`${re}-listbox`:null},Q,{onKeyDown:nd(Q),onMouseDown:id,onClick:Ll}),getInputLabelProps:()=>({id:`${re}-label`,htmlFor:re}),getInputProps:()=>({id:re,value:Ce,onBlur:ri,onFocus:vv,onChange:Kt,onMouseDown:Pa,"aria-activedescendant":Se?"":null,"aria-autocomplete":r?"both":"list","aria-controls":St?`${re}-listbox`:void 0,"aria-expanded":St,autoComplete:"off",ref:we,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:p}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Nl}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:od}),getTagProps:({index:Q})=>R({key:Q,"data-tag-index":Q,tabIndex:-1},!ie&&{onDelete:rd(Q)}),getListboxProps:()=>({role:"listbox",id:`${re}-listbox`,"aria-labelledby":`${re}-label`,ref:Ve,onMouseDown:Q=>{Q.preventDefault()}}),getOptionProps:({index:Q,option:H})=>{var ye;const ke=(A?se:[se]).some(_t=>_t!=null&&_(H,_t)),rt=$?$(H):!1;return{key:(ye=C==null?void 0:C(H))!=null?ye:ae(H),tabIndex:-1,role:"option",id:`${re}-option-${Q}`,onMouseMove:Dt,onClick:yv,onTouchStart:Yn,"data-option-index":Q,"aria-disabled":rt,"aria-selected":ke}},id:re,inputValue:Ce,value:se,dirty:_o,expanded:Se&&ve,popupOpen:Se,focused:N||G!==-1,anchorEl:ve,setAnchorEl:ce,focusedTag:G,groupedOptions:oi}}const iP=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],aP=be(i4,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),sP=y.forwardRef(function(t,n){var r;const o=pO(),i=Ye({props:t,name:"MuiPopper"}),{anchorEl:a,component:s,components:l,componentsProps:c,container:u,disablePortal:f,keepMounted:d,modifiers:p,open:h,placement:g,popperOptions:v,popperRef:x,transition:w,slots:$,slotProps:C}=i,S=je(i,iP),b=(r=$==null?void 0:$.root)!=null?r:l==null?void 0:l.Root,O=R({anchorEl:a,container:u,disablePortal:f,keepMounted:d,modifiers:p,open:h,placement:g,popperOptions:v,popperRef:x,transition:w},S);return m.jsx(aP,R({as:s,direction:o==null?void 0:o.direction,slots:{root:b},slotProps:C??c},O,{ref:n}))}),Vg=sP;function lP(e){return qe("MuiListSubheader",e)}Xe("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const cP=["className","color","component","disableGutters","disableSticky","inset"],uP=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:i}=e,a={root:["root",n!=="default"&&`color${ge(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Ke(a,lP,t)},fP=be("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${ge(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(({theme:e,ownerState:t})=>R({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},t.color==="primary"&&{color:(e.vars||e).palette.primary.main},t.color==="inherit"&&{color:"inherit"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.inset&&{paddingLeft:72},!t.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper})),Iw=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiListSubheader"}),{className:o,color:i="default",component:a="li",disableGutters:s=!1,disableSticky:l=!1,inset:c=!1}=r,u=je(r,cP),f=R({},r,{color:i,component:a,disableGutters:s,disableSticky:l,inset:c}),d=uP(f);return m.jsx(fP,R({as:a,className:Te(d.root,o),ref:n,ownerState:f},u))});Iw.muiSkipListHighlight=!0;const dP=Iw,pP=ul(m.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function hP(e){return qe("MuiChip",e)}const gP=Xe("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),tt=gP,mP=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],vP=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:a,clickable:s,variant:l}=e,c={root:["root",l,n&&"disabled",`size${ge(r)}`,`color${ge(o)}`,s&&"clickable",s&&`clickableColor${ge(o)}`,a&&"deletable",a&&`deletableColor${ge(o)}`,`${l}${ge(o)}`],label:["label",`label${ge(r)}`],avatar:["avatar",`avatar${ge(r)}`,`avatarColor${ge(o)}`],icon:["icon",`icon${ge(r)}`,`iconColor${ge(i)}`],deleteIcon:["deleteIcon",`deleteIcon${ge(r)}`,`deleteIconColor${ge(o)}`,`deleteIcon${ge(l)}Color${ge(o)}`]};return Ke(c,hP,t)},yP=be("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:a,size:s,variant:l}=n;return[{[`& .${tt.avatar}`]:t.avatar},{[`& .${tt.avatar}`]:t[`avatar${ge(s)}`]},{[`& .${tt.avatar}`]:t[`avatarColor${ge(r)}`]},{[`& .${tt.icon}`]:t.icon},{[`& .${tt.icon}`]:t[`icon${ge(s)}`]},{[`& .${tt.icon}`]:t[`iconColor${ge(o)}`]},{[`& .${tt.deleteIcon}`]:t.deleteIcon},{[`& .${tt.deleteIcon}`]:t[`deleteIcon${ge(s)}`]},{[`& .${tt.deleteIcon}`]:t[`deleteIconColor${ge(r)}`]},{[`& .${tt.deleteIcon}`]:t[`deleteIcon${ge(l)}Color${ge(r)}`]},t.root,t[`size${ge(s)}`],t[`color${ge(r)}`],i&&t.clickable,i&&r!=="default"&&t[`clickableColor${ge(r)})`],a&&t.deletable,a&&r!=="default"&&t[`deletableColor${ge(r)}`],t[l],t[`${l}${ge(r)}`]]}})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return R({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${tt.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${tt.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:n,fontSize:e.typography.pxToRem(12)},[`& .${tt.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${tt.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${tt.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${tt.icon}`]:R({marginLeft:5,marginRight:-6},t.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},t.iconColor===t.color&&R({color:e.vars?e.vars.palette.Chip.defaultIconColor:n},t.color!=="default"&&{color:"inherit"})),[`& .${tt.deleteIcon}`]:R({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:gt(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:gt(e.palette.text.primary,.4)}},t.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},t.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[t.color].contrastTextChannel} / 0.7)`:gt(e.palette[t.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].contrastText}})},t.size==="small"&&{height:24},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.onDelete&&{[`&.${tt.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:gt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},t.onDelete&&t.color!=="default"&&{[`&.${tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}})},({theme:e,ownerState:t})=>R({},t.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:gt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${tt.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:gt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},t.clickable&&t.color!=="default"&&{[`&:hover, &.${tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}}),({theme:e,ownerState:t})=>R({},t.variant==="outlined"&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${tt.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${tt.avatar}`]:{marginLeft:4},[`& .${tt.avatarSmall}`]:{marginLeft:2},[`& .${tt.icon}`]:{marginLeft:4},[`& .${tt.iconSmall}`]:{marginLeft:2},[`& .${tt.deleteIcon}`]:{marginRight:5},[`& .${tt.deleteIconSmall}`]:{marginRight:3}},t.variant==="outlined"&&t.color!=="default"&&{color:(e.vars||e).palette[t.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:gt(e.palette[t.color].main,.7)}`,[`&.${tt.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(e.palette[t.color].main,e.palette.action.hoverOpacity)},[`&.${tt.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:gt(e.palette[t.color].main,e.palette.action.focusOpacity)},[`& .${tt.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:gt(e.palette[t.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].main}}})),bP=be("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${ge(r)}`]]}})(({ownerState:e})=>R({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},e.variant==="outlined"&&{paddingLeft:11,paddingRight:11},e.size==="small"&&{paddingLeft:8,paddingRight:8},e.size==="small"&&e.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function s1(e){return e.key==="Backspace"||e.key==="Delete"}const xP=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:a,color:s="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:p,onDelete:h,onKeyDown:g,onKeyUp:v,size:x="medium",variant:w="filled",tabIndex:$,skipFocusWhenDisabled:C=!1}=r,S=je(r,mP),b=y.useRef(null),O=It(b,n),P=F=>{F.stopPropagation(),h&&h(F)},T=F=>{F.currentTarget===F.target&&s1(F)&&F.preventDefault(),g&&g(F)},k=F=>{F.currentTarget===F.target&&(h&&s1(F)?h(F):F.key==="Escape"&&b.current&&b.current.blur()),v&&v(F)},_=a!==!1&&p?!0:a,A=_||h?ki:l||"div",I=R({},r,{component:A,disabled:u,size:x,color:s,iconColor:y.isValidElement(f)&&f.props.color||s,onDelete:!!h,clickable:_,variant:w}),j=vP(I),M=A===ki?R({component:l||"div",focusVisibleClassName:j.focusVisible},h&&{disableRipple:!0}):{};let D=null;h&&(D=c&&y.isValidElement(c)?y.cloneElement(c,{className:Te(c.props.className,j.deleteIcon),onClick:P}):m.jsx(pP,{className:Te(j.deleteIcon),onClick:P}));let L=null;o&&y.isValidElement(o)&&(L=y.cloneElement(o,{className:Te(j.avatar,o.props.className)}));let B=null;return f&&y.isValidElement(f)&&(B=y.cloneElement(f,{className:Te(j.icon,f.props.className)})),m.jsxs(yP,R({as:A,className:Te(j.root,i),disabled:_&&u?!0:void 0,onClick:p,onKeyDown:T,onKeyUp:k,ref:O,tabIndex:C&&u?-1:$,ownerState:I},M,S,{children:[L||B,m.jsx(bP,{className:Te(j.label),ownerState:I,children:d}),D]}))}),wP=xP;function da({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const SP=y.createContext(void 0),Hg=SP;function pa(){return y.useContext(Hg)}function $P(e){return m.jsx(bE,R({},e,{defaultTheme:hO,themeId:gO}))}function l1(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Ec(e,t=!1){return e&&(l1(e.value)&&e.value!==""||t&&l1(e.defaultValue)&&e.defaultValue!=="")}function CP(e){return e.startAdornment}function OP(e){return qe("MuiInputBase",e)}const EP=Xe("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),yn=EP,PP=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],Qu=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${ge(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},Ju=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},_P=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:i,focused:a,formControl:s,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:p,type:h}=e,g={root:["root",`color${ge(n)}`,r&&"disabled",o&&"error",l&&"fullWidth",a&&"focused",s&&"formControl",d&&d!=="medium"&&`size${ge(d)}`,u&&"multiline",p&&"adornedStart",i&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",h==="search"&&"inputTypeSearch",u&&"inputMultiline",d==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",p&&"inputAdornedStart",i&&"inputAdornedEnd",f&&"readOnly"]};return Ke(g,OP,t)},ef=be("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Qu})(({theme:e,ownerState:t})=>R({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${yn.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&R({padding:"4px 0 5px"},t.size==="small"&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),tf=be("input",{name:"MuiInputBase",slot:"Input",overridesResolver:Ju})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light",r=R({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),o={opacity:"0 !important"},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return R({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${yn.formControl} &`]:{"&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&:-ms-input-placeholder":o,"&::-ms-input-placeholder":o,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus:-ms-input-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${yn.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},t.size==="small"&&{paddingTop:1},t.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},t.type==="search"&&{MozAppearance:"textfield"})}),TP=m.jsx($P,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),AP=y.forwardRef(function(t,n){var r;const o=Ye({props:t,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:a,autoFocus:s,className:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:p,endAdornment:h,fullWidth:g=!1,id:v,inputComponent:x="input",inputProps:w={},inputRef:$,maxRows:C,minRows:S,multiline:b=!1,name:O,onBlur:P,onChange:T,onClick:k,onFocus:_,onKeyDown:A,onKeyUp:I,placeholder:j,readOnly:M,renderSuffix:D,rows:L,slotProps:B={},slots:F={},startAdornment:Z,type:ie="text",value:te}=o,le=je(o,PP),re=w.value!=null?w.value:te,{current:ae}=y.useRef(re!=null),xe=y.useRef(),Me=y.useCallback(Se=>{},[]),we=It(xe,$,w.ref,Me),[Y,ve]=y.useState(!1),ce=pa(),G=da({props:o,muiFormControl:ce,states:["color","disabled","error","hiddenLabel","size","required","filled"]});G.focused=ce?ce.focused:Y,y.useEffect(()=>{!ce&&d&&Y&&(ve(!1),P&&P())},[ce,d,Y,P]);const fe=ce&&ce.onFilled,de=ce&&ce.onEmpty,pe=y.useCallback(Se=>{Ec(Se)?fe&&fe():de&&de()},[fe,de]);Sr(()=>{ae&&pe({value:re})},[re,pe,ae]);const se=Se=>{if(G.disabled){Se.stopPropagation();return}_&&_(Se),w.onFocus&&w.onFocus(Se),ce&&ce.onFocus?ce.onFocus(Se):ve(!0)},Le=Se=>{P&&P(Se),w.onBlur&&w.onBlur(Se),ce&&ce.onBlur?ce.onBlur(Se):ve(!1)},Ce=(Se,...ne)=>{if(!ae){const Ze=Se.target||xe.current;if(Ze==null)throw new Error(G2(1));pe({value:Ze.value})}w.onChange&&w.onChange(Se,...ne),T&&T(Se,...ne)};y.useEffect(()=>{pe(xe.current)},[]);const Ge=Se=>{xe.current&&Se.currentTarget===Se.target&&xe.current.focus(),k&&k(Se)};let N=x,z=w;b&&N==="input"&&(L?z=R({type:void 0,minRows:L,maxRows:L},z):z=R({type:void 0,maxRows:C,minRows:S},z),N=eP);const U=Se=>{pe(Se.animationName==="mui-auto-fill-cancel"?xe.current:{value:"x"})};y.useEffect(()=>{ce&&ce.setAdornedStart(!!Z)},[ce,Z]);const W=R({},o,{color:G.color||"primary",disabled:G.disabled,endAdornment:h,error:G.error,focused:G.focused,formControl:ce,fullWidth:g,hiddenLabel:G.hiddenLabel,multiline:b,size:G.size,startAdornment:Z,type:ie}),V=_P(W),q=F.root||c.Root||ef,ue=B.root||u.root||{},Ae=F.input||c.Input||tf;return z=R({},z,(r=B.input)!=null?r:u.input),m.jsxs(y.Fragment,{children:[!p&&TP,m.jsxs(q,R({},ue,!xc(q)&&{ownerState:R({},W,ue.ownerState)},{ref:n,onClick:Ge},le,{className:Te(V.root,ue.className,l,M&&"MuiInputBase-readOnly"),children:[Z,m.jsx(Hg.Provider,{value:null,children:m.jsx(Ae,R({ownerState:W,"aria-invalid":G.error,"aria-describedby":i,autoComplete:a,autoFocus:s,defaultValue:f,disabled:G.disabled,id:v,onAnimationStart:U,name:O,placeholder:j,readOnly:M,required:G.required,rows:L,value:re,onKeyDown:A,onKeyUp:I,type:ie},z,!xc(Ae)&&{as:N,ownerState:R({},W,z.ownerState)},{ref:we,className:Te(V.input,z.className,M&&"MuiInputBase-readOnly"),onBlur:Le,onChange:Ce,onFocus:se}))}),h,D?D(R({},G,{startAdornment:Z})):null]}))]})}),nf=AP;function kP(e){return qe("MuiInput",e)}const jP=R({},yn,Xe("MuiInput",["root","underline","input"])),uo=jP;function IP(e){return qe("MuiOutlinedInput",e)}const MP=R({},yn,Xe("MuiOutlinedInput",["root","notchedOutline","input"])),hr=MP;function RP(e){return qe("MuiFilledInput",e)}const DP=R({},yn,Xe("MuiFilledInput",["root","underline","input"])),bn=DP,Mw=ul(m.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function NP(e){return qe("MuiAutocomplete",e)}const LP=Xe("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),He=LP;var c1,u1;const BP=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],FP=["ref"],zP=["key"],WP=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:a,hasPopupIcon:s,inputFocused:l,popupOpen:c,size:u}=e,f={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",a&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${ge(u)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",c&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Ke(f,NP,t)},VP=be("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:a,size:s}=n;return[{[`& .${He.tag}`]:t.tag},{[`& .${He.tag}`]:t[`tagSize${ge(s)}`]},{[`& .${He.inputRoot}`]:t.inputRoot},{[`& .${He.input}`]:t.input},{[`& .${He.input}`]:a&&t.inputFocused},t.root,r&&t.fullWidth,i&&t.hasPopupIcon,o&&t.hasClearIcon]}})(({ownerState:e})=>R({[`&.${He.focused} .${He.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${He.clearIndicator}`]:{visibility:"visible"}}},e.fullWidth&&{width:"100%"},{[`& .${He.tag}`]:R({margin:3,maxWidth:"calc(100% - 6px)"},e.size==="small"&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${He.inputRoot}`]:{flexWrap:"wrap",[`.${He.hasPopupIcon}&, .${He.hasClearIcon}&`]:{paddingRight:26+4},[`.${He.hasPopupIcon}.${He.hasClearIcon}&`]:{paddingRight:52+4},[`& .${He.input}`]:{width:0,minWidth:30}},[`& .${uo.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${uo.root}.${yn.sizeSmall}`]:{[`& .${uo.input}`]:{padding:"2px 4px 3px 0"}},[`& .${hr.root}`]:{padding:9,[`.${He.hasPopupIcon}&, .${He.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${He.hasPopupIcon}.${He.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${He.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${He.endAdornment}`]:{right:9}},[`& .${hr.root}.${yn.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${He.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${bn.root}`]:{paddingTop:19,paddingLeft:8,[`.${He.hasPopupIcon}&, .${He.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${He.hasPopupIcon}.${He.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${bn.input}`]:{padding:"7px 4px"},[`& .${He.endAdornment}`]:{right:9}},[`& .${bn.root}.${yn.sizeSmall}`]:{paddingBottom:1,[`& .${bn.input}`]:{padding:"2.5px 4px"}},[`& .${yn.hiddenLabel}`]:{paddingTop:8},[`& .${bn.root}.${yn.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${He.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${bn.root}.${yn.hiddenLabel}.${yn.sizeSmall}`]:{[`& .${He.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${He.input}`]:R({flexGrow:1,textOverflow:"ellipsis",opacity:0},e.inputFocused&&{opacity:1})})),HP=be("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),UP=be(yr,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),GP=be(yr,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:e},t)=>R({},t.popupIndicator,e.popupOpen&&t.popupIndicatorOpen)})(({ownerState:e})=>R({padding:2,marginRight:-2},e.popupOpen&&{transform:"rotate(180deg)"})),KP=be(Vg,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${He.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(({theme:e,ownerState:t})=>R({zIndex:(e.vars||e).zIndex.modal},t.disablePortal&&{position:"absolute"})),qP=be(Ku,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>R({},e.typography.body1,{overflow:"auto"})),XP=be("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),YP=be("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),ZP=be("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${He.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${He.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${He.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:gt(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${He.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:gt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${He.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:gt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}})),QP=be(dP,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8})),JP=be("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${He.option}`]:{paddingLeft:24}}),e8=y.forwardRef(function(t,n){var r,o,i,a;const s=Ye({props:t,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:c=!1,autoSelect:u=!1,blurOnSelect:f=!1,ChipProps:d,className:p,clearIcon:h=c1||(c1=m.jsx(S6,{fontSize:"small"})),clearOnBlur:g=!s.freeSolo,clearOnEscape:v=!1,clearText:x="Clear",closeText:w="Close",componentsProps:$={},defaultValue:C=s.multiple?[]:null,disableClearable:S=!1,disableCloseOnSelect:b=!1,disabled:O=!1,disabledItemsFocusable:P=!1,disableListWrap:T=!1,disablePortal:k=!1,filterSelectedOptions:_=!1,forcePopupIcon:A="auto",freeSolo:I=!1,fullWidth:j=!1,getLimitTagsText:M=H=>`+${H}`,getOptionLabel:D,groupBy:L,handleHomeEndKeys:B=!s.freeSolo,includeInputInList:F=!1,limitTags:Z=-1,ListboxComponent:ie="ul",ListboxProps:te,loading:le=!1,loadingText:re="Loading…",multiple:ae=!1,noOptionsText:xe="No options",openOnFocus:Me=!1,openText:we="Open",PaperComponent:Y=Ku,PopperComponent:ve=Vg,popupIcon:ce=u1||(u1=m.jsx(Mw,{})),readOnly:G=!1,renderGroup:fe,renderInput:de,renderOption:pe,renderTags:se,selectOnFocus:Le=!s.freeSolo,size:Ce="medium",slotProps:Ge={}}=s,N=je(s,BP),{getRootProps:z,getInputProps:U,getInputLabelProps:W,getPopupIndicatorProps:V,getClearProps:q,getTagProps:ue,getListboxProps:Ae,getOptionProps:Se,value:ne,dirty:Ze,expanded:St,id:$t,popupOpen:Oe,focused:Be,focusedTag:oe,anchorEl:$e,setAnchorEl:Fe,inputValue:Ve,groupedOptions:et}=oP(R({},s,{componentName:"Autocomplete"})),pt=!S&&!O&&Ze&&!G,Et=(!I||A===!0)&&A!==!1,{onMouseDown:Tn}=U(),{ref:Gt}=te??{},to=Ae(),{ref:Dl}=to,Nl=je(to,FP),nd=It(Dl,Gt),ri=D||(H=>{var ye;return(ye=H.label)!=null?ye:H}),Kt=R({},s,{disablePortal:k,expanded:St,focused:Be,fullWidth:j,getOptionLabel:ri,hasClearIcon:pt,hasPopupIcon:Et,inputFocused:oe===-1,popupOpen:Oe,size:Ce}),Dt=WP(Kt);let Yn;if(ae&&ne.length>0){const H=ye=>R({className:Dt.tag,disabled:O},ue(ye));se?Yn=se(ne,H,Kt):Yn=ne.map((ye,ke)=>m.jsx(wP,R({label:ri(ye),size:Ce},H({index:ke}),d)))}if(Z>-1&&Array.isArray(Yn)){const H=Yn.length-Z;!Be&&H>0&&(Yn=Yn.splice(0,Z),Yn.push(m.jsx("span",{className:Dt.tag,children:M(H)},Yn.length)))}const rd=fe||(H=>m.jsxs("li",{children:[m.jsx(QP,{className:Dt.groupLabel,ownerState:Kt,component:"div",children:H.group}),m.jsx(JP,{className:Dt.groupUl,ownerState:Kt,children:H.children})]},H.key)),id=pe||((H,ye)=>{const{key:ke}=H,rt=je(H,zP);return m.jsx("li",R({},rt,{children:ri(ye)}),ke)}),Ll=(H,ye)=>{const ke=Se({option:H,index:ye});return id(R({},ke,{className:Dt.option}),H,{selected:ke["aria-selected"],index:ye,inputValue:Ve},Kt)},Pa=(r=Ge.clearIndicator)!=null?r:$.clearIndicator,_o=(o=Ge.paper)!=null?o:$.paper,oi=(i=Ge.popper)!=null?i:$.popper,Q=(a=Ge.popupIndicator)!=null?a:$.popupIndicator;return m.jsxs(y.Fragment,{children:[m.jsx(VP,R({ref:n,className:Te(Dt.root,p),ownerState:Kt},z(N),{children:de({id:$t,disabled:O,fullWidth:!0,size:Ce==="small"?"small":void 0,InputLabelProps:W(),InputProps:R({ref:Fe,className:Dt.inputRoot,startAdornment:Yn,onClick:H=>{H.target===H.currentTarget&&Tn(H)}},(pt||Et)&&{endAdornment:m.jsxs(HP,{className:Dt.endAdornment,ownerState:Kt,children:[pt?m.jsx(UP,R({},q(),{"aria-label":x,title:x,ownerState:Kt},Pa,{className:Te(Dt.clearIndicator,Pa==null?void 0:Pa.className),children:h})):null,Et?m.jsx(GP,R({},V(),{disabled:O,"aria-label":Oe?w:we,title:Oe?w:we,ownerState:Kt},Q,{className:Te(Dt.popupIndicator,Q==null?void 0:Q.className),children:ce})):null]})}),inputProps:R({className:Dt.input,disabled:O,readOnly:G},U())})})),$e?m.jsx(KP,R({as:ve,disablePortal:k,style:{width:$e?$e.clientWidth:null},ownerState:Kt,role:"presentation",anchorEl:$e,open:Oe},oi,{className:Te(Dt.popper,oi==null?void 0:oi.className),children:m.jsxs(qP,R({ownerState:Kt,as:Y},_o,{className:Te(Dt.paper,_o==null?void 0:_o.className),children:[le&&et.length===0?m.jsx(XP,{className:Dt.loading,ownerState:Kt,children:re}):null,et.length===0&&!I&&!le?m.jsx(YP,{className:Dt.noOptions,ownerState:Kt,role:"presentation",onMouseDown:H=>{H.preventDefault()},children:xe}):null,et.length>0?m.jsx(ZP,R({as:ie,className:Dt.listbox,ownerState:Kt},Nl,te,{ref:nd,children:et.map((H,ye)=>L?rd({key:H.key,group:H.group,children:H.options.map((ke,rt)=>Ll(ke,H.index+rt))}):Ll(H,ye))})):null]}))})):null]})}),t8=e8,n8=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],r8={entering:{opacity:1},entered:{opacity:1}},o8=y.forwardRef(function(t,n){const r=aa(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:a=!0,children:s,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:p,onExited:h,onExiting:g,style:v,timeout:x=o,TransitionComponent:w=Eg}=t,$=je(t,n8),C=y.useRef(null),S=It(C,s.ref,n),b=j=>M=>{if(j){const D=C.current;M===void 0?j(D):j(D,M)}},O=b(d),P=b((j,M)=>{Tg(j);const D=Ai({style:v,timeout:x,easing:l},{mode:"enter"});j.style.webkitTransition=r.transitions.create("opacity",D),j.style.transition=r.transitions.create("opacity",D),u&&u(j,M)}),T=b(f),k=b(g),_=b(j=>{const M=Ai({style:v,timeout:x,easing:l},{mode:"exit"});j.style.webkitTransition=r.transitions.create("opacity",M),j.style.transition=r.transitions.create("opacity",M),p&&p(j)}),A=b(h),I=j=>{i&&i(C.current,j)};return m.jsx(w,R({appear:a,in:c,nodeRef:C,onEnter:P,onEntered:T,onEntering:O,onExit:_,onExited:A,onExiting:k,addEndListener:I,timeout:x},$,{children:(j,M)=>y.cloneElement(s,R({style:R({opacity:0,visibility:j==="exited"&&!c?"hidden":void 0},r8[j],v,s.props.style),ref:S},M))}))}),i8=o8;function a8(e){return qe("MuiBackdrop",e)}Xe("MuiBackdrop",["root","invisible"]);const s8=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],l8=e=>{const{classes:t,invisible:n}=e;return Ke({root:["root",n&&"invisible"]},a8,t)},c8=be("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>R({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),u8=y.forwardRef(function(t,n){var r,o,i;const a=Ye({props:t,name:"MuiBackdrop"}),{children:s,className:l,component:c="div",components:u={},componentsProps:f={},invisible:d=!1,open:p,slotProps:h={},slots:g={},TransitionComponent:v=i8,transitionDuration:x}=a,w=je(a,s8),$=R({},a,{component:c,invisible:d}),C=l8($),S=(r=h.root)!=null?r:f.root;return m.jsx(v,R({in:p,timeout:x},w,{children:m.jsx(c8,R({"aria-hidden":!0},S,{as:(o=(i=g.root)!=null?i:u.Root)!=null?o:c,className:Te(C.root,l,S==null?void 0:S.className),ownerState:R({},$,S==null?void 0:S.ownerState),classes:C,ref:n,children:s}))}))}),f8=u8;function d8(e){return qe("MuiButton",e)}const p8=Xe("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Wl=p8,h8=y.createContext({}),g8=h8,m8=y.createContext(void 0),v8=m8,y8=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],b8=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,classes:a}=e,s={root:["root",i,`${i}${ge(t)}`,`size${ge(o)}`,`${i}Size${ge(o)}`,t==="inherit"&&"colorInherit",n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${ge(o)}`],endIcon:["endIcon",`iconSize${ge(o)}`]},l=Ke(s,d8,a);return R({},a,l)},Rw=e=>R({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),x8=be(ki,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ge(n.color)}`],t[`size${ge(n.size)}`],t[`${n.variant}Size${ge(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const o=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],i=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return R({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":R({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":R({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Wl.focusVisible}`]:R({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Wl.disabled}`]:R({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${gt(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(r=e.palette).getContrastText)==null?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:o,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Wl.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Wl.disabled}`]:{boxShadow:"none"}}),w8=be("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${ge(n.size)}`]]}})(({ownerState:e})=>R({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},Rw(e))),S8=be("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${ge(n.size)}`]]}})(({ownerState:e})=>R({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},Rw(e))),$8=y.forwardRef(function(t,n){const r=y.useContext(g8),o=y.useContext(v8),i=mO(r,t),a=Ye({props:i,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:p=!1,endIcon:h,focusVisibleClassName:g,fullWidth:v=!1,size:x="medium",startIcon:w,type:$,variant:C="text"}=a,S=je(a,y8),b=R({},a,{color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:p,fullWidth:v,size:x,type:$,variant:C}),O=b8(b),P=w&&m.jsx(w8,{className:O.startIcon,ownerState:b,children:w}),T=h&&m.jsx(S8,{className:O.endIcon,ownerState:b,children:h}),k=o||"";return m.jsxs(x8,R({ownerState:b,className:Te(r.className,O.root,u,k),component:c,disabled:f,focusRipple:!p,focusVisibleClassName:Te(O.focusVisible,g),ref:n,type:$},S,{classes:O,children:[P,s,T]}))}),_r=$8;function C8(e){return qe("MuiCircularProgress",e)}Xe("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const O8=["className","color","disableShrink","size","style","thickness","value","variant"];let rf=e=>e,f1,d1,p1,h1;const no=44,E8=al(f1||(f1=rf` +`),In.rippleVisible,t6,Pp,({theme:e})=>e.transitions.easing.easeInOut,In.ripplePulsate,({theme:e})=>e.transitions.duration.shorter,In.child,In.childLeaving,n6,Pp,({theme:e})=>e.transitions.easing.easeInOut,In.childPulsate,r6,({theme:e})=>e.transitions.easing.easeInOut),a6=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:a}=r,s=je(r,JE),[l,c]=y.useState([]),u=y.useRef(0),f=y.useRef(null);y.useEffect(()=>{f.current&&(f.current(),f.current=null)},[l]);const d=y.useRef(!1),p=y.useRef(0),h=y.useRef(null),g=y.useRef(null);y.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const v=y.useCallback(C=>{const{pulsate:S,rippleX:b,rippleY:O,rippleSize:P,cb:T}=C;c(k=>[...k,m.jsx(i6,{classes:{ripple:Te(i.ripple,In.ripple),rippleVisible:Te(i.rippleVisible,In.rippleVisible),ripplePulsate:Te(i.ripplePulsate,In.ripplePulsate),child:Te(i.child,In.child),childLeaving:Te(i.childLeaving,In.childLeaving),childPulsate:Te(i.childPulsate,In.childPulsate)},timeout:Pp,pulsate:S,rippleX:b,rippleY:O,rippleSize:P},u.current)]),u.current+=1,f.current=T},[i]),x=y.useCallback((C={},S={},b=()=>{})=>{const{pulsate:O=!1,center:P=o||S.pulsate,fakeElement:T=!1}=S;if((C==null?void 0:C.type)==="mousedown"&&d.current){d.current=!1;return}(C==null?void 0:C.type)==="touchstart"&&(d.current=!0);const k=T?null:g.current,_=k?k.getBoundingClientRect():{width:0,height:0,left:0,top:0};let A,I,j;if(P||C===void 0||C.clientX===0&&C.clientY===0||!C.clientX&&!C.touches)A=Math.round(_.width/2),I=Math.round(_.height/2);else{const{clientX:M,clientY:D}=C.touches&&C.touches.length>0?C.touches[0]:C;A=Math.round(M-_.left),I=Math.round(D-_.top)}if(P)j=Math.sqrt((2*_.width**2+_.height**2)/3),j%2===0&&(j+=1);else{const M=Math.max(Math.abs((k?k.clientWidth:0)-A),A)*2+2,D=Math.max(Math.abs((k?k.clientHeight:0)-I),I)*2+2;j=Math.sqrt(M**2+D**2)}C!=null&&C.touches?h.current===null&&(h.current=()=>{v({pulsate:O,rippleX:A,rippleY:I,rippleSize:j,cb:b})},p.current=setTimeout(()=>{h.current&&(h.current(),h.current=null)},e6)):v({pulsate:O,rippleX:A,rippleY:I,rippleSize:j,cb:b})},[o,v]),w=y.useCallback(()=>{x({},{pulsate:!0})},[x]),$=y.useCallback((C,S)=>{if(clearTimeout(p.current),(C==null?void 0:C.type)==="touchend"&&h.current){h.current(),h.current=null,p.current=setTimeout(()=>{$(C,S)});return}h.current=null,c(b=>b.length>0?b.slice(1):b),f.current=S},[]);return y.useImperativeHandle(n,()=>({pulsate:w,start:x,stop:$}),[w,x,$]),m.jsx(o6,R({className:Te(In.root,i.root,a),ref:g},s,{children:m.jsx(UE,{component:null,exit:!0,children:l})}))}),s6=a6;function l6(e){return qe("MuiButtonBase",e)}const c6=Xe("MuiButtonBase",["root","disabled","focusVisible"]),u6=c6,f6=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],d6=e=>{const{disabled:t,focusVisible:n,focusVisibleClassName:r,classes:o}=e,a=Ke({root:["root",t&&"disabled",n&&"focusVisible"]},l6,o);return n&&r&&(a.root+=` ${r}`),a},p6=be("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${u6.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),h6=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:a,className:s,component:l="button",disabled:c=!1,disableRipple:u=!1,disableTouchRipple:f=!1,focusRipple:d=!1,LinkComponent:p="a",onBlur:h,onClick:g,onContextMenu:v,onDragLeave:x,onFocus:w,onFocusVisible:$,onKeyDown:C,onKeyUp:S,onMouseDown:b,onMouseLeave:O,onMouseUp:P,onTouchEnd:T,onTouchMove:k,onTouchStart:_,tabIndex:A=0,TouchRippleProps:I,touchRippleRef:j,type:M}=r,D=je(r,f6),L=y.useRef(null),B=y.useRef(null),F=It(B,j),{isFocusVisibleRef:Z,onFocus:ie,onBlur:te,ref:le}=pE(),[re,ae]=y.useState(!1);c&&re&&ae(!1),y.useImperativeHandle(o,()=>({focusVisible:()=>{ae(!0),L.current.focus()}}),[]);const[xe,Me]=y.useState(!1);y.useEffect(()=>{Me(!0)},[]);const we=xe&&!u&&!c;y.useEffect(()=>{re&&d&&!u&&xe&&B.current.pulsate()},[u,d,re,xe]);function Y(ne,Ze,St=f){return Sn($t=>(Ze&&Ze($t),!St&&B.current&&B.current[ne]($t),!0))}const ve=Y("start",b),ce=Y("stop",v),G=Y("stop",x),fe=Y("stop",P),de=Y("stop",ne=>{re&&ne.preventDefault(),O&&O(ne)}),pe=Y("start",_),se=Y("stop",T),Le=Y("stop",k),Ce=Y("stop",ne=>{te(ne),Z.current===!1&&ae(!1),h&&h(ne)},!1),Ge=Sn(ne=>{L.current||(L.current=ne.currentTarget),ie(ne),Z.current===!0&&(ae(!0),$&&$(ne)),w&&w(ne)}),N=()=>{const ne=L.current;return l&&l!=="button"&&!(ne.tagName==="A"&&ne.href)},z=y.useRef(!1),U=Sn(ne=>{d&&!z.current&&re&&B.current&&ne.key===" "&&(z.current=!0,B.current.stop(ne,()=>{B.current.start(ne)})),ne.target===ne.currentTarget&&N()&&ne.key===" "&&ne.preventDefault(),C&&C(ne),ne.target===ne.currentTarget&&N()&&ne.key==="Enter"&&!c&&(ne.preventDefault(),g&&g(ne))}),W=Sn(ne=>{d&&ne.key===" "&&B.current&&re&&!ne.defaultPrevented&&(z.current=!1,B.current.stop(ne,()=>{B.current.pulsate(ne)})),S&&S(ne),g&&ne.target===ne.currentTarget&&N()&&ne.key===" "&&!ne.defaultPrevented&&g(ne)});let V=l;V==="button"&&(D.href||D.to)&&(V=p);const q={};V==="button"?(q.type=M===void 0?"button":M,q.disabled=c):(!D.href&&!D.to&&(q.role="button"),c&&(q["aria-disabled"]=c));const ue=It(n,le,L),Ae=R({},r,{centerRipple:i,component:l,disabled:c,disableRipple:u,disableTouchRipple:f,focusRipple:d,tabIndex:A,focusVisible:re}),Se=d6(Ae);return m.jsxs(p6,R({as:V,className:Te(Se.root,s),ownerState:Ae,onBlur:Ce,onClick:g,onContextMenu:ce,onFocus:Ge,onKeyDown:U,onKeyUp:W,onMouseDown:ve,onMouseLeave:de,onMouseUp:fe,onDragLeave:G,onTouchEnd:se,onTouchMove:Le,onTouchStart:pe,ref:ue,tabIndex:c?-1:A,type:M},q,D,{children:[a,we?m.jsx(s6,R({ref:F,center:i},I)):null]}))}),ki=h6;function g6(e){return qe("MuiIconButton",e)}const m6=Xe("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),v6=m6,y6=["edge","children","className","color","disabled","disableFocusRipple","size"],b6=e=>{const{classes:t,disabled:n,color:r,edge:o,size:i}=e,a={root:["root",n&&"disabled",r!=="default"&&`color${ge(r)}`,o&&`edge${ge(o)}`,`size${ge(i)}`]};return Ke(a,g6,t)},x6=be(ki,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${ge(n.color)}`],n.edge&&t[`edge${ge(n.edge)}`],t[`size${ge(n.size)}`]]}})(({theme:e,ownerState:t})=>R({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",overflow:"visible",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest})},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.activeChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(e.palette.action.active,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12}),({theme:e,ownerState:t})=>{var n;const r=(n=(e.vars||e).palette)==null?void 0:n[t.color];return R({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&R({color:r==null?void 0:r.main},!t.disableRipple&&{"&:hover":R({},r&&{backgroundColor:e.vars?`rgba(${r.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(r.main,e.palette.action.hoverOpacity)},{"@media (hover: none)":{backgroundColor:"transparent"}})}),t.size==="small"&&{padding:5,fontSize:e.typography.pxToRem(18)},t.size==="large"&&{padding:12,fontSize:e.typography.pxToRem(28)},{[`&.${v6.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),w6=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:a,color:s="default",disabled:l=!1,disableFocusRipple:c=!1,size:u="medium"}=r,f=je(r,y6),d=R({},r,{edge:o,color:s,disabled:l,disableFocusRipple:c,size:u}),p=b6(d);return m.jsx(x6,R({className:Te(p.root,a),centerRipple:!0,focusRipple:!c,disabled:l,ref:n,ownerState:d},f,{children:i}))}),yr=w6,S6=ul(m.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");function $6(e){return qe("MuiTypography",e)}Xe("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const C6=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],O6=e=>{const{align:t,gutterBottom:n,noWrap:r,paragraph:o,variant:i,classes:a}=e,s={root:["root",i,e.align!=="inherit"&&`align${ge(t)}`,n&&"gutterBottom",r&&"noWrap",o&&"paragraph"]};return Ke(s,$6,a)},E6=be("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.variant&&t[n.variant],n.align!=="inherit"&&t[`align${ge(n.align)}`],n.noWrap&&t.noWrap,n.gutterBottom&&t.gutterBottom,n.paragraph&&t.paragraph]}})(({theme:e,ownerState:t})=>R({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&e.typography[t.variant],t.align!=="inherit"&&{textAlign:t.align},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.paragraph&&{marginBottom:16})),Mv={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},P6={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},_6=e=>P6[e]||e,T6=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTypography"}),o=_6(r.color),i=lw(R({},r,{color:o})),{align:a="inherit",className:s,component:l,gutterBottom:c=!1,noWrap:u=!1,paragraph:f=!1,variant:d="body1",variantMapping:p=Mv}=i,h=je(i,C6),g=R({},i,{align:a,color:o,className:s,component:l,gutterBottom:c,noWrap:u,paragraph:f,variant:d,variantMapping:p}),v=l||(f?"p":p[d]||Mv[d])||"span",x=O6(g);return m.jsx(E6,R({as:v,ref:n,ownerState:g,className:Te(x.root,s)},h))}),Rv=T6;function xc(e){return typeof e=="string"}function A6(e,t,n){return e===void 0||xc(e)?t:R({},t,{ownerState:R({},t.ownerState,n)})}const k6={disableDefaultClasses:!1},j6=y.createContext(k6);function I6(e){const{disableDefaultClasses:t}=y.useContext(j6);return n=>t?"":e(n)}function dw(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function M6(e,t,n){return typeof e=="function"?e(t,n):e}function pw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function R6(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const p=Dv(n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),h=R({},n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),g=R({},n,o,r);return p.length>0&&(g.className=p),Object.keys(h).length>0&&(g.style=h),{props:g,internalRef:void 0}}const a=dw(R({},o,r)),s=Nv(r),l=Nv(o),c=t(a),u=Dv(c==null?void 0:c.className,n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),f=R({},c==null?void 0:c.style,n==null?void 0:n.style,o==null?void 0:o.style,r==null?void 0:r.style),d=R({},c,n,l,s);return u.length>0&&(d.className=u),Object.keys(f).length>0&&(d.style=f),{props:d,internalRef:c.ref}}const D6=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function ir(e){var t;const{elementType:n,externalSlotProps:r,ownerState:o,skipResolvingSlotProps:i=!1}=e,a=je(e,D6),s=i?{}:M6(r,o),{props:l,internalRef:c}=R6(R({},a,{externalSlotProps:s})),u=It(c,s==null?void 0:s.ref,(t=e.additionalProps)==null?void 0:t.ref);return A6(n,R({},l,{ref:u}),o)}const N6=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function L6(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function B6(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=r=>e.ownerDocument.querySelector(`input[type="radio"]${r}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function F6(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||B6(e))}function z6(e){const t=[],n=[];return Array.from(e.querySelectorAll(N6)).forEach((r,o)=>{const i=L6(r);i===-1||!F6(r)||(i===0?t.push(r):n.push({documentOrder:o,tabIndex:i,node:r}))}),n.sort((r,o)=>r.tabIndex===o.tabIndex?r.documentOrder-o.documentOrder:r.tabIndex-o.tabIndex).map(r=>r.node).concat(t)}function W6(){return!0}function V6(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:r=!1,disableRestoreFocus:o=!1,getTabbable:i=z6,isEnabled:a=W6,open:s}=e,l=y.useRef(!1),c=y.useRef(null),u=y.useRef(null),f=y.useRef(null),d=y.useRef(null),p=y.useRef(!1),h=y.useRef(null),g=It(t.ref,h),v=y.useRef(null);y.useEffect(()=>{!s||!h.current||(p.current=!n)},[n,s]),y.useEffect(()=>{if(!s||!h.current)return;const $=Jt(h.current);return h.current.contains($.activeElement)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[s]),y.useEffect(()=>{if(!s||!h.current)return;const $=Jt(h.current),C=O=>{v.current=O,!(r||!a()||O.key!=="Tab")&&$.activeElement===h.current&&O.shiftKey&&(l.current=!0,u.current&&u.current.focus())},S=()=>{const O=h.current;if(O===null)return;if(!$.hasFocus()||!a()||l.current){l.current=!1;return}if(O.contains($.activeElement)||r&&$.activeElement!==c.current&&$.activeElement!==u.current)return;if($.activeElement!==d.current)d.current=null;else if(d.current!==null)return;if(!p.current)return;let P=[];if(($.activeElement===c.current||$.activeElement===u.current)&&(P=i(h.current)),P.length>0){var T,k;const _=!!((T=v.current)!=null&&T.shiftKey&&((k=v.current)==null?void 0:k.key)==="Tab"),A=P[0],I=P[P.length-1];typeof A!="string"&&typeof I!="string"&&(_?I.focus():A.focus())}else O.focus()};$.addEventListener("focusin",S),$.addEventListener("keydown",C,!0);const b=setInterval(()=>{$.activeElement&&$.activeElement.tagName==="BODY"&&S()},50);return()=>{clearInterval(b),$.removeEventListener("focusin",S),$.removeEventListener("keydown",C,!0)}},[n,r,o,a,s,i]);const x=$=>{f.current===null&&(f.current=$.relatedTarget),p.current=!0,d.current=$.target;const C=t.props.onFocus;C&&C($)},w=$=>{f.current===null&&(f.current=$.relatedTarget),p.current=!0};return m.jsxs(y.Fragment,{children:[m.jsx("div",{tabIndex:s?0:-1,onFocus:w,ref:c,"data-testid":"sentinelStart"}),y.cloneElement(t,{ref:g,onFocus:x}),m.jsx("div",{tabIndex:s?0:-1,onFocus:w,ref:u,"data-testid":"sentinelEnd"})]})}var dn="top",Vn="bottom",Hn="right",pn="left",Ag="auto",fl=[dn,Vn,Hn,pn],ji="start",ps="end",H6="clippingParents",hw="viewport",_a="popper",U6="reference",Lv=fl.reduce(function(e,t){return e.concat([t+"-"+ji,t+"-"+ps])},[]),gw=[].concat(fl,[Ag]).reduce(function(e,t){return e.concat([t,t+"-"+ji,t+"-"+ps])},[]),G6="beforeRead",K6="read",q6="afterRead",X6="beforeMain",Y6="main",Z6="afterMain",Q6="beforeWrite",J6="write",e9="afterWrite",t9=[G6,K6,q6,X6,Y6,Z6,Q6,J6,e9];function $r(e){return e?(e.nodeName||"").toLowerCase():null}function En(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function qo(e){var t=En(e).Element;return e instanceof t||e instanceof Element}function Fn(e){var t=En(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function kg(e){if(typeof ShadowRoot>"u")return!1;var t=En(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function n9(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},o=t.attributes[n]||{},i=t.elements[n];!Fn(i)||!$r(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function r9(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var o=t.elements[r],i=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,c){return l[c]="",l},{});!Fn(o)||!$r(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const o9={name:"applyStyles",enabled:!0,phase:"write",fn:n9,effect:r9,requires:["computeStyles"]};function br(e){return e.split("-")[0]}var Wo=Math.max,wc=Math.min,Ii=Math.round;function _p(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function mw(){return!/^((?!chrome|android).)*safari/i.test(_p())}function Mi(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),o=1,i=1;t&&Fn(e)&&(o=e.offsetWidth>0&&Ii(r.width)/e.offsetWidth||1,i=e.offsetHeight>0&&Ii(r.height)/e.offsetHeight||1);var a=qo(e)?En(e):window,s=a.visualViewport,l=!mw()&&n,c=(r.left+(l&&s?s.offsetLeft:0))/o,u=(r.top+(l&&s?s.offsetTop:0))/i,f=r.width/o,d=r.height/i;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c,x:c,y:u}}function jg(e){var t=Mi(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function vw(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&kg(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function zr(e){return En(e).getComputedStyle(e)}function i9(e){return["table","td","th"].indexOf($r(e))>=0}function $o(e){return((qo(e)?e.ownerDocument:e.document)||window.document).documentElement}function Yu(e){return $r(e)==="html"?e:e.assignedSlot||e.parentNode||(kg(e)?e.host:null)||$o(e)}function Bv(e){return!Fn(e)||zr(e).position==="fixed"?null:e.offsetParent}function a9(e){var t=/firefox/i.test(_p()),n=/Trident/i.test(_p());if(n&&Fn(e)){var r=zr(e);if(r.position==="fixed")return null}var o=Yu(e);for(kg(o)&&(o=o.host);Fn(o)&&["html","body"].indexOf($r(o))<0;){var i=zr(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function dl(e){for(var t=En(e),n=Bv(e);n&&i9(n)&&zr(n).position==="static";)n=Bv(n);return n&&($r(n)==="html"||$r(n)==="body"&&zr(n).position==="static")?t:n||a9(e)||t}function Ig(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ja(e,t,n){return Wo(e,wc(t,n))}function s9(e,t,n){var r=Ja(e,t,n);return r>n?n:r}function yw(){return{top:0,right:0,bottom:0,left:0}}function bw(e){return Object.assign({},yw(),e)}function xw(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var l9=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,bw(typeof t!="number"?t:xw(t,fl))};function c9(e){var t,n=e.state,r=e.name,o=e.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=br(n.placement),l=Ig(s),c=[pn,Hn].indexOf(s)>=0,u=c?"height":"width";if(!(!i||!a)){var f=l9(o.padding,n),d=jg(i),p=l==="y"?dn:pn,h=l==="y"?Vn:Hn,g=n.rects.reference[u]+n.rects.reference[l]-a[l]-n.rects.popper[u],v=a[l]-n.rects.reference[l],x=dl(i),w=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0,$=g/2-v/2,C=f[p],S=w-d[u]-f[h],b=w/2-d[u]/2+$,O=Ja(C,b,S),P=l;n.modifiersData[r]=(t={},t[P]=O,t.centerOffset=O-b,t)}}function u9(e){var t=e.state,n=e.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||vw(t.elements.popper,o)&&(t.elements.arrow=o))}const f9={name:"arrow",enabled:!0,phase:"main",fn:c9,effect:u9,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ri(e){return e.split("-")[1]}var d9={top:"auto",right:"auto",bottom:"auto",left:"auto"};function p9(e,t){var n=e.x,r=e.y,o=t.devicePixelRatio||1;return{x:Ii(n*o)/o||0,y:Ii(r*o)/o||0}}function Fv(e){var t,n=e.popper,r=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,d=a.x,p=d===void 0?0:d,h=a.y,g=h===void 0?0:h,v=typeof u=="function"?u({x:p,y:g}):{x:p,y:g};p=v.x,g=v.y;var x=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),$=pn,C=dn,S=window;if(c){var b=dl(n),O="clientHeight",P="clientWidth";if(b===En(n)&&(b=$o(n),zr(b).position!=="static"&&s==="absolute"&&(O="scrollHeight",P="scrollWidth")),b=b,o===dn||(o===pn||o===Hn)&&i===ps){C=Vn;var T=f&&b===S&&S.visualViewport?S.visualViewport.height:b[O];g-=T-r.height,g*=l?1:-1}if(o===pn||(o===dn||o===Vn)&&i===ps){$=Hn;var k=f&&b===S&&S.visualViewport?S.visualViewport.width:b[P];p-=k-r.width,p*=l?1:-1}}var _=Object.assign({position:s},c&&d9),A=u===!0?p9({x:p,y:g},En(n)):{x:p,y:g};if(p=A.x,g=A.y,l){var I;return Object.assign({},_,(I={},I[C]=w?"0":"",I[$]=x?"0":"",I.transform=(S.devicePixelRatio||1)<=1?"translate("+p+"px, "+g+"px)":"translate3d("+p+"px, "+g+"px, 0)",I))}return Object.assign({},_,(t={},t[C]=w?g+"px":"",t[$]=x?p+"px":"",t.transform="",t))}function h9(e){var t=e.state,n=e.options,r=n.gpuAcceleration,o=r===void 0?!0:r,i=n.adaptive,a=i===void 0?!0:i,s=n.roundOffsets,l=s===void 0?!0:s,c={placement:br(t.placement),variation:Ri(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Fv(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Fv(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const g9={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:h9,data:{}};var Bl={passive:!0};function m9(e){var t=e.state,n=e.instance,r=e.options,o=r.scroll,i=o===void 0?!0:o,a=r.resize,s=a===void 0?!0:a,l=En(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,Bl)}),s&&l.addEventListener("resize",n.update,Bl),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,Bl)}),s&&l.removeEventListener("resize",n.update,Bl)}}const v9={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:m9,data:{}};var y9={left:"right",right:"left",bottom:"top",top:"bottom"};function fc(e){return e.replace(/left|right|bottom|top/g,function(t){return y9[t]})}var b9={start:"end",end:"start"};function zv(e){return e.replace(/start|end/g,function(t){return b9[t]})}function Mg(e){var t=En(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Rg(e){return Mi($o(e)).left+Mg(e).scrollLeft}function x9(e,t){var n=En(e),r=$o(e),o=n.visualViewport,i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var c=mw();(c||!c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+Rg(e),y:l}}function w9(e){var t,n=$o(e),r=Mg(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=Wo(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=Wo(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Rg(e),l=-r.scrollTop;return zr(o||n).direction==="rtl"&&(s+=Wo(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}function Dg(e){var t=zr(e),n=t.overflow,r=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+o+r)}function ww(e){return["html","body","#document"].indexOf($r(e))>=0?e.ownerDocument.body:Fn(e)&&Dg(e)?e:ww(Yu(e))}function es(e,t){var n;t===void 0&&(t=[]);var r=ww(e),o=r===((n=e.ownerDocument)==null?void 0:n.body),i=En(r),a=o?[i].concat(i.visualViewport||[],Dg(r)?r:[]):r,s=t.concat(a);return o?s:s.concat(es(Yu(a)))}function Tp(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function S9(e,t){var n=Mi(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Wv(e,t,n){return t===hw?Tp(x9(e,n)):qo(t)?S9(t,n):Tp(w9($o(e)))}function $9(e){var t=es(Yu(e)),n=["absolute","fixed"].indexOf(zr(e).position)>=0,r=n&&Fn(e)?dl(e):e;return qo(r)?t.filter(function(o){return qo(o)&&vw(o,r)&&$r(o)!=="body"}):[]}function C9(e,t,n,r){var o=t==="clippingParents"?$9(e):[].concat(t),i=[].concat(o,[n]),a=i[0],s=i.reduce(function(l,c){var u=Wv(e,c,r);return l.top=Wo(u.top,l.top),l.right=wc(u.right,l.right),l.bottom=wc(u.bottom,l.bottom),l.left=Wo(u.left,l.left),l},Wv(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function Sw(e){var t=e.reference,n=e.element,r=e.placement,o=r?br(r):null,i=r?Ri(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(o){case dn:l={x:a,y:t.y-n.height};break;case Vn:l={x:a,y:t.y+t.height};break;case Hn:l={x:t.x+t.width,y:s};break;case pn:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var c=o?Ig(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case ji:l[c]=l[c]-(t[u]/2-n[u]/2);break;case ps:l[c]=l[c]+(t[u]/2-n[u]/2);break}}return l}function hs(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=r===void 0?e.placement:r,i=n.strategy,a=i===void 0?e.strategy:i,s=n.boundary,l=s===void 0?H6:s,c=n.rootBoundary,u=c===void 0?hw:c,f=n.elementContext,d=f===void 0?_a:f,p=n.altBoundary,h=p===void 0?!1:p,g=n.padding,v=g===void 0?0:g,x=bw(typeof v!="number"?v:xw(v,fl)),w=d===_a?U6:_a,$=e.rects.popper,C=e.elements[h?w:d],S=C9(qo(C)?C:C.contextElement||$o(e.elements.popper),l,u,a),b=Mi(e.elements.reference),O=Sw({reference:b,element:$,strategy:"absolute",placement:o}),P=Tp(Object.assign({},$,O)),T=d===_a?P:b,k={top:S.top-T.top+x.top,bottom:T.bottom-S.bottom+x.bottom,left:S.left-T.left+x.left,right:T.right-S.right+x.right},_=e.modifiersData.offset;if(d===_a&&_){var A=_[o];Object.keys(k).forEach(function(I){var j=[Hn,Vn].indexOf(I)>=0?1:-1,M=[dn,Vn].indexOf(I)>=0?"y":"x";k[I]+=A[M]*j})}return k}function O9(e,t){t===void 0&&(t={});var n=t,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=l===void 0?gw:l,u=Ri(r),f=u?s?Lv:Lv.filter(function(h){return Ri(h)===u}):fl,d=f.filter(function(h){return c.indexOf(h)>=0});d.length===0&&(d=f);var p=d.reduce(function(h,g){return h[g]=hs(e,{placement:g,boundary:o,rootBoundary:i,padding:a})[br(g)],h},{});return Object.keys(p).sort(function(h,g){return p[h]-p[g]})}function E9(e){if(br(e)===Ag)return[];var t=fc(e);return[zv(e),t,zv(t)]}function P9(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,p=n.flipVariations,h=p===void 0?!0:p,g=n.allowedAutoPlacements,v=t.options.placement,x=br(v),w=x===v,$=l||(w||!h?[fc(v)]:E9(v)),C=[v].concat($).reduce(function(re,ae){return re.concat(br(ae)===Ag?O9(t,{placement:ae,boundary:u,rootBoundary:f,padding:c,flipVariations:h,allowedAutoPlacements:g}):ae)},[]),S=t.rects.reference,b=t.rects.popper,O=new Map,P=!0,T=C[0],k=0;k=0,M=j?"width":"height",D=hs(t,{placement:_,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),L=j?I?Hn:pn:I?Vn:dn;S[M]>b[M]&&(L=fc(L));var B=fc(L),F=[];if(i&&F.push(D[A]<=0),s&&F.push(D[L]<=0,D[B]<=0),F.every(function(re){return re})){T=_,P=!1;break}O.set(_,F)}if(P)for(var Z=h?3:1,ie=function(ae){var xe=C.find(function(Me){var we=O.get(Me);if(we)return we.slice(0,ae).every(function(Y){return Y})});if(xe)return T=xe,"break"},te=Z;te>0;te--){var le=ie(te);if(le==="break")break}t.placement!==T&&(t.modifiersData[r]._skip=!0,t.placement=T,t.reset=!0)}}const _9={name:"flip",enabled:!0,phase:"main",fn:P9,requiresIfExists:["offset"],data:{_skip:!1}};function Vv(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Hv(e){return[dn,Hn,Vn,pn].some(function(t){return e[t]>=0})}function T9(e){var t=e.state,n=e.name,r=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=hs(t,{elementContext:"reference"}),s=hs(t,{altBoundary:!0}),l=Vv(a,r),c=Vv(s,o,i),u=Hv(l),f=Hv(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}const A9={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:T9};function k9(e,t,n){var r=br(e),o=[pn,dn].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[pn,Hn].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function j9(e){var t=e.state,n=e.options,r=e.name,o=n.offset,i=o===void 0?[0,0]:o,a=gw.reduce(function(u,f){return u[f]=k9(f,t.rects,i),u},{}),s=a[t.placement],l=s.x,c=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[r]=a}const I9={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:j9};function M9(e){var t=e.state,n=e.name;t.modifiersData[n]=Sw({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const R9={name:"popperOffsets",enabled:!0,phase:"read",fn:M9,data:{}};function D9(e){return e==="x"?"y":"x"}function N9(e){var t=e.state,n=e.options,r=e.name,o=n.mainAxis,i=o===void 0?!0:o,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,p=d===void 0?!0:d,h=n.tetherOffset,g=h===void 0?0:h,v=hs(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),x=br(t.placement),w=Ri(t.placement),$=!w,C=Ig(x),S=D9(C),b=t.modifiersData.popperOffsets,O=t.rects.reference,P=t.rects.popper,T=typeof g=="function"?g(Object.assign({},t.rects,{placement:t.placement})):g,k=typeof T=="number"?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),_=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,A={x:0,y:0};if(b){if(i){var I,j=C==="y"?dn:pn,M=C==="y"?Vn:Hn,D=C==="y"?"height":"width",L=b[C],B=L+v[j],F=L-v[M],Z=p?-P[D]/2:0,ie=w===ji?O[D]:P[D],te=w===ji?-P[D]:-O[D],le=t.elements.arrow,re=p&&le?jg(le):{width:0,height:0},ae=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:yw(),xe=ae[j],Me=ae[M],we=Ja(0,O[D],re[D]),Y=$?O[D]/2-Z-we-xe-k.mainAxis:ie-we-xe-k.mainAxis,ve=$?-O[D]/2+Z+we+Me+k.mainAxis:te+we+Me+k.mainAxis,ce=t.elements.arrow&&dl(t.elements.arrow),G=ce?C==="y"?ce.clientTop||0:ce.clientLeft||0:0,fe=(I=_==null?void 0:_[C])!=null?I:0,de=L+Y-fe-G,pe=L+ve-fe,se=Ja(p?wc(B,de):B,L,p?Wo(F,pe):F);b[C]=se,A[C]=se-L}if(s){var Le,Ce=C==="x"?dn:pn,Ge=C==="x"?Vn:Hn,N=b[S],z=S==="y"?"height":"width",U=N+v[Ce],W=N-v[Ge],V=[dn,pn].indexOf(x)!==-1,q=(Le=_==null?void 0:_[S])!=null?Le:0,ue=V?U:N-O[z]-P[z]-q+k.altAxis,Ae=V?N+O[z]+P[z]-q-k.altAxis:W,Se=p&&V?s9(ue,N,Ae):Ja(p?ue:U,N,p?Ae:W);b[S]=Se,A[S]=Se-N}t.modifiersData[r]=A}}const L9={name:"preventOverflow",enabled:!0,phase:"main",fn:N9,requiresIfExists:["offset"]};function B9(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function F9(e){return e===En(e)||!Fn(e)?Mg(e):B9(e)}function z9(e){var t=e.getBoundingClientRect(),n=Ii(t.width)/e.offsetWidth||1,r=Ii(t.height)/e.offsetHeight||1;return n!==1||r!==1}function W9(e,t,n){n===void 0&&(n=!1);var r=Fn(t),o=Fn(t)&&z9(t),i=$o(t),a=Mi(e,o,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&(($r(t)!=="body"||Dg(i))&&(s=F9(t)),Fn(t)?(l=Mi(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=Rg(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function V9(e){var t=new Map,n=new Set,r=[];e.forEach(function(i){t.set(i.name,i)});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&o(l)}}),r.push(i)}return e.forEach(function(i){n.has(i.name)||o(i)}),r}function H9(e){var t=V9(e);return t9.reduce(function(n,r){return n.concat(t.filter(function(o){return o.phase===r}))},[])}function U9(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function G9(e){var t=e.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var Uv={placement:"bottom",modifiers:[],strategy:"absolute"};function Gv(){for(var e=arguments.length,t=new Array(e),n=0;n{i||s(Y9(o)||document.body)},[o,i]),Sr(()=>{if(a&&!i)return yc(n,a),()=>{yc(n,null)}},[n,a,i]),i){if(y.isValidElement(r)){const c={ref:l};return y.cloneElement(r,c)}return m.jsx(y.Fragment,{children:r})}return m.jsx(y.Fragment,{children:a&&ia.createPortal(r,a)})});function Z9(e){return qe("MuiPopper",e)}Xe("MuiPopper",["root"]);const Q9=["anchorEl","children","direction","disablePortal","modifiers","open","placement","popperOptions","popperRef","slotProps","slots","TransitionProps","ownerState"],J9=["anchorEl","children","container","direction","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","style","transition","slotProps","slots"];function e4(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function Ap(e){return typeof e=="function"?e():e}function t4(e){return e.nodeType!==void 0}const n4=()=>Ke({root:["root"]},I6(Z9)),r4={},o4=y.forwardRef(function(t,n){var r;const{anchorEl:o,children:i,direction:a,disablePortal:s,modifiers:l,open:c,placement:u,popperOptions:f,popperRef:d,slotProps:p={},slots:h={},TransitionProps:g}=t,v=je(t,Q9),x=y.useRef(null),w=It(x,n),$=y.useRef(null),C=It($,d),S=y.useRef(C);Sr(()=>{S.current=C},[C]),y.useImperativeHandle(d,()=>$.current,[]);const b=e4(u,a),[O,P]=y.useState(b),[T,k]=y.useState(Ap(o));y.useEffect(()=>{$.current&&$.current.forceUpdate()}),y.useEffect(()=>{o&&k(Ap(o))},[o]),Sr(()=>{if(!T||!c)return;const M=B=>{P(B.placement)};let D=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:B})=>{M(B)}}];l!=null&&(D=D.concat(l)),f&&f.modifiers!=null&&(D=D.concat(f.modifiers));const L=X9(T,x.current,R({placement:b},f,{modifiers:D}));return S.current(L),()=>{L.destroy(),S.current(null)}},[T,s,l,c,f,b]);const _={placement:O};g!==null&&(_.TransitionProps=g);const A=n4(),I=(r=h.root)!=null?r:"div",j=ir({elementType:I,externalSlotProps:p.root,externalForwardedProps:v,additionalProps:{role:"tooltip",ref:w},ownerState:t,className:A.root});return m.jsx(I,R({},j,{children:typeof i=="function"?i(_):i}))}),i4=y.forwardRef(function(t,n){const{anchorEl:r,children:o,container:i,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:c,open:u,placement:f="bottom",popperOptions:d=r4,popperRef:p,style:h,transition:g=!1,slotProps:v={},slots:x={}}=t,w=je(t,J9),[$,C]=y.useState(!0),S=()=>{C(!1)},b=()=>{C(!0)};if(!l&&!u&&(!g||$))return null;let O;if(i)O=i;else if(r){const k=Ap(r);O=k&&t4(k)?Jt(k).body:Jt(null).body}const P=!u&&l&&(!g||$)?"none":void 0,T=g?{in:u,onEnter:S,onExited:b}:void 0;return m.jsx($w,{disablePortal:s,container:O,children:m.jsx(o4,R({anchorEl:r,direction:a,disablePortal:s,modifiers:c,ref:n,open:g?!$:u,placement:f,popperOptions:d,popperRef:p,slotProps:v,slots:x},w,{style:R({position:"fixed",top:0,left:0,display:P},h),TransitionProps:T,children:o}))})});function a4(e){const t=Jt(e);return t.body===e?or(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function ts(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function Kv(e){return parseInt(or(e).getComputedStyle(e).paddingRight,10)||0}function s4(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,r=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||r}function qv(e,t,n,r,o){const i=[t,n,...r];[].forEach.call(e.children,a=>{const s=i.indexOf(a)===-1,l=!s4(a);s&&l&&ts(a,o)})}function ud(e,t){let n=-1;return e.some((r,o)=>t(r)?(n=o,!0):!1),n}function l4(e,t){const n=[],r=e.container;if(!t.disableScrollLock){if(a4(r)){const a=aw(Jt(r));n.push({value:r.style.paddingRight,property:"padding-right",el:r}),r.style.paddingRight=`${Kv(r)+a}px`;const s=Jt(r).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${Kv(l)+a}px`})}let i;if(r.parentNode instanceof DocumentFragment)i=Jt(r).body;else{const a=r.parentElement,s=or(r);i=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a:r}n.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{n.forEach(({value:i,el:a,property:s})=>{i?a.style.setProperty(s,i):a.style.removeProperty(s)})}}function c4(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class u4{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let r=this.modals.indexOf(t);if(r!==-1)return r;r=this.modals.length,this.modals.push(t),t.modalRef&&ts(t.modalRef,!1);const o=c4(n);qv(n,t.mount,t.modalRef,o,!0);const i=ud(this.containers,a=>a.container===n);return i!==-1?(this.containers[i].modals.push(t),r):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:o}),r)}mount(t,n){const r=ud(this.containers,i=>i.modals.indexOf(t)!==-1),o=this.containers[r];o.restore||(o.restore=l4(o,n))}remove(t,n=!0){const r=this.modals.indexOf(t);if(r===-1)return r;const o=ud(this.containers,a=>a.modals.indexOf(t)!==-1),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(r,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&ts(t.modalRef,n),qv(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const a=i.modals[i.modals.length-1];a.modalRef&&ts(a.modalRef,!1)}return r}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function f4(e){return typeof e=="function"?e():e}function d4(e){return e?e.props.hasOwnProperty("in"):!1}const p4=new u4;function h4(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:r=!1,manager:o=p4,closeAfterTransition:i=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:c,open:u,rootRef:f}=e,d=y.useRef({}),p=y.useRef(null),h=y.useRef(null),g=It(h,f),[v,x]=y.useState(!u),w=d4(l);let $=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&($=!1);const C=()=>Jt(p.current),S=()=>(d.current.modalRef=h.current,d.current.mount=p.current,d.current),b=()=>{o.mount(S(),{disableScrollLock:r}),h.current&&(h.current.scrollTop=0)},O=Sn(()=>{const D=f4(t)||C().body;o.add(S(),D),h.current&&b()}),P=y.useCallback(()=>o.isTopModal(S()),[o]),T=Sn(D=>{p.current=D,D&&(u&&P()?b():h.current&&ts(h.current,$))}),k=y.useCallback(()=>{o.remove(S(),$)},[$,o]);y.useEffect(()=>()=>{k()},[k]),y.useEffect(()=>{u?O():(!w||!i)&&k()},[u,k,w,i,O]);const _=D=>L=>{var B;(B=D.onKeyDown)==null||B.call(D,L),!(L.key!=="Escape"||L.which===229||!P())&&(n||(L.stopPropagation(),c&&c(L,"escapeKeyDown")))},A=D=>L=>{var B;(B=D.onClick)==null||B.call(D,L),L.target===L.currentTarget&&c&&c(L,"backdropClick")};return{getRootProps:(D={})=>{const L=dw(e);delete L.onTransitionEnter,delete L.onTransitionExited;const B=R({},L,D);return R({role:"presentation"},B,{onKeyDown:_(B),ref:g})},getBackdropProps:(D={})=>{const L=D;return R({"aria-hidden":!0},L,{onClick:A(L),open:u})},getTransitionProps:()=>{const D=()=>{x(!1),a&&a()},L=()=>{x(!0),s&&s(),i&&k()};return{onEnter:$v(D,l==null?void 0:l.props.onEnter),onExited:$v(L,l==null?void 0:l.props.onExited)}},rootRef:g,portalRef:T,isTopModal:P,exited:v,hasTransition:w}}const g4=["top","right","bottom","left"],bo=Math.min,xn=Math.max,Sc=Math.round,Fl=Math.floor,xo=e=>({x:e,y:e}),m4={left:"right",right:"left",bottom:"top",top:"bottom"},v4={start:"end",end:"start"};function kp(e,t,n){return xn(e,bo(t,n))}function Wr(e,t){return typeof e=="function"?e(t):e}function Vr(e){return e.split("-")[0]}function ua(e){return e.split("-")[1]}function Ng(e){return e==="x"?"y":"x"}function Lg(e){return e==="y"?"height":"width"}function fa(e){return["top","bottom"].includes(Vr(e))?"y":"x"}function Bg(e){return Ng(fa(e))}function y4(e,t,n){n===void 0&&(n=!1);const r=ua(e),o=Bg(e),i=Lg(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=$c(a)),[a,$c(a)]}function b4(e){const t=$c(e);return[jp(e),t,jp(t)]}function jp(e){return e.replace(/start|end/g,t=>v4[t])}function x4(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function w4(e,t,n,r){const o=ua(e);let i=x4(Vr(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(jp)))),i}function $c(e){return e.replace(/left|right|bottom|top/g,t=>m4[t])}function S4(e){return{top:0,right:0,bottom:0,left:0,...e}}function Cw(e){return typeof e!="number"?S4(e):{top:e,right:e,bottom:e,left:e}}function Cc(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Xv(e,t,n){let{reference:r,floating:o}=e;const i=fa(t),a=Bg(t),s=Lg(a),l=Vr(t),c=i==="y",u=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(ua(t)){case"start":p[a]-=d*(n&&c?-1:1);break;case"end":p[a]+=d*(n&&c?-1:1);break}return p}const $4=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:f}=Xv(c,r,l),d=r,p={},h=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Wr(e,t)||{};if(c==null)return{};const f=Cw(u),d={x:n,y:r},p=Bg(o),h=Lg(p),g=await a.getDimensions(c),v=p==="y",x=v?"top":"left",w=v?"bottom":"right",$=v?"clientHeight":"clientWidth",C=i.reference[h]+i.reference[p]-d[p]-i.floating[h],S=d[p]-i.reference[p],b=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let O=b?b[$]:0;(!O||!await(a.isElement==null?void 0:a.isElement(b)))&&(O=s.floating[$]||i.floating[h]);const P=C/2-S/2,T=O/2-g[h]/2-1,k=bo(f[x],T),_=bo(f[w],T),A=k,I=O-g[h]-_,j=O/2-g[h]/2+P,M=kp(A,j,I),D=!l.arrow&&ua(o)!=null&&j!=M&&i.reference[h]/2-(jA<=0)){var T,k;const A=(((T=i.flip)==null?void 0:T.index)||0)+1,I=S[A];if(I)return{data:{index:A,overflows:P},reset:{placement:I}};let j=(k=P.filter(M=>M.overflows[0]<=0).sort((M,D)=>M.overflows[1]-D.overflows[1])[0])==null?void 0:k.placement;if(!j)switch(p){case"bestFit":{var _;const M=(_=P.map(D=>[D.placement,D.overflows.filter(L=>L>0).reduce((L,B)=>L+B,0)]).sort((D,L)=>D[1]-L[1])[0])==null?void 0:_[0];M&&(j=M);break}case"initialPlacement":j=s;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function Zv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qv(e){return g4.some(t=>e[t]>=0)}const O4=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Wr(e,t);switch(r){case"referenceHidden":{const i=await gs(t,{...o,elementContext:"reference"}),a=Zv(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Qv(a)}}}case"escaped":{const i=await gs(t,{...o,altBoundary:!0}),a=Zv(i,n.floating);return{data:{escapedOffsets:a,escaped:Qv(a)}}}default:return{}}}}};async function E4(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Vr(n),s=ua(n),l=fa(n)==="y",c=["left","top"].includes(a)?-1:1,u=i&&l?-1:1,f=Wr(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:h}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof h=="number"&&(p=s==="end"?h*-1:h),l?{x:p*u,y:d*c}:{x:d*c,y:p*u}}const P4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await E4(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(r=s.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},_4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:v=>{let{x,y:w}=v;return{x,y:w}}},...l}=Wr(e,t),c={x:n,y:r},u=await gs(t,l),f=fa(Vr(o)),d=Ng(f);let p=c[d],h=c[f];if(i){const v=d==="y"?"top":"left",x=d==="y"?"bottom":"right",w=p+u[v],$=p-u[x];p=kp(w,p,$)}if(a){const v=f==="y"?"top":"left",x=f==="y"?"bottom":"right",w=h+u[v],$=h-u[x];h=kp(w,h,$)}const g=s.fn({...t,[d]:p,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r}}}}},T4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Wr(e,t),u={x:n,y:r},f=fa(o),d=Ng(f);let p=u[d],h=u[f];const g=Wr(s,t),v=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const $=d==="y"?"height":"width",C=i.reference[d]-i.floating[$]+v.mainAxis,S=i.reference[d]+i.reference[$]-v.mainAxis;pS&&(p=S)}if(c){var x,w;const $=d==="y"?"width":"height",C=["top","left"].includes(Vr(o)),S=i.reference[f]-i.floating[$]+(C&&((x=a.offset)==null?void 0:x[f])||0)+(C?0:v.crossAxis),b=i.reference[f]+i.reference[$]+(C?0:((w=a.offset)==null?void 0:w[f])||0)-(C?v.crossAxis:0);hb&&(h=b)}return{[d]:p,[f]:h}}}},A4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:a=()=>{},...s}=Wr(e,t),l=await gs(t,s),c=Vr(n),u=ua(n),f=fa(n)==="y",{width:d,height:p}=r.floating;let h,g;c==="top"||c==="bottom"?(h=c,g=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(g=c,h=u==="end"?"top":"bottom");const v=p-l[h],x=d-l[g],w=!t.middlewareData.shift;let $=v,C=x;if(f){const b=d-l.left-l.right;C=u||w?bo(x,b):b}else{const b=p-l.top-l.bottom;$=u||w?bo(v,b):b}if(w&&!u){const b=xn(l.left,0),O=xn(l.right,0),P=xn(l.top,0),T=xn(l.bottom,0);f?C=d-2*(b!==0||O!==0?b+O:xn(l.left,l.right)):$=p-2*(P!==0||T!==0?P+T:xn(l.top,l.bottom))}await a({...t,availableWidth:C,availableHeight:$});const S=await o.getDimensions(i.floating);return d!==S.width||p!==S.height?{reset:{rects:!0}}:{}}}};function wo(e){return Ow(e)?(e.nodeName||"").toLowerCase():"#document"}function On(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qr(e){var t;return(t=(Ow(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ow(e){return e instanceof Node||e instanceof On(e).Node}function Hr(e){return e instanceof Element||e instanceof On(e).Element}function Cr(e){return e instanceof HTMLElement||e instanceof On(e).HTMLElement}function Jv(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof On(e).ShadowRoot}function pl(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Un(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function k4(e){return["table","td","th"].includes(wo(e))}function Fg(e){const t=zg(),n=Un(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function j4(e){let t=Di(e);for(;Cr(t)&&!Zu(t);){if(Fg(t))return t;t=Di(t)}return null}function zg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zu(e){return["html","body","#document"].includes(wo(e))}function Un(e){return On(e).getComputedStyle(e)}function Qu(e){return Hr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Di(e){if(wo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jv(e)&&e.host||Qr(e);return Jv(t)?t.host:t}function Ew(e){const t=Di(e);return Zu(t)?e.ownerDocument?e.ownerDocument.body:e.body:Cr(t)&&pl(t)?t:Ew(t)}function ms(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ew(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=On(o);return i?t.concat(a,a.visualViewport||[],pl(o)?o:[],a.frameElement&&n?ms(a.frameElement):[]):t.concat(o,ms(o,[],n))}function Pw(e){const t=Un(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Cr(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=Sc(n)!==i||Sc(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function Wg(e){return Hr(e)?e:e.contextElement}function Si(e){const t=Wg(e);if(!Cr(t))return xo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Pw(t);let a=(i?Sc(n.width):n.width)/r,s=(i?Sc(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const I4=xo(0);function _w(e){const t=On(e);return!zg()||!t.visualViewport?I4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function M4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==On(e)?!1:t}function Xo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Wg(e);let a=xo(1);t&&(r?Hr(r)&&(a=Si(r)):a=Si(e));const s=M4(i,n,r)?_w(i):xo(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,f=o.height/a.y;if(i){const d=On(i),p=r&&Hr(r)?On(r):r;let h=d.frameElement;for(;h&&r&&p!==d;){const g=Si(h),v=h.getBoundingClientRect(),x=Un(h),w=v.left+(h.clientLeft+parseFloat(x.paddingLeft))*g.x,$=v.top+(h.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,c*=g.y,u*=g.x,f*=g.y,l+=w,c+=$,h=On(h).frameElement}}return Cc({width:u,height:f,x:l,y:c})}function R4(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Cr(n),i=Qr(n);if(n===i)return t;let a={scrollLeft:0,scrollTop:0},s=xo(1);const l=xo(0);if((o||!o&&r!=="fixed")&&((wo(n)!=="body"||pl(i))&&(a=Qu(n)),Cr(n))){const c=Xo(n);s=Si(n),l.x=c.x+n.clientLeft,l.y=c.y+n.clientTop}return{width:t.width*s.x,height:t.height*s.y,x:t.x*s.x-a.scrollLeft*s.x+l.x,y:t.y*s.y-a.scrollTop*s.y+l.y}}function D4(e){return Array.from(e.getClientRects())}function Tw(e){return Xo(Qr(e)).left+Qu(e).scrollLeft}function N4(e){const t=Qr(e),n=Qu(e),r=e.ownerDocument.body,o=xn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=xn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+Tw(e);const s=-n.scrollTop;return Un(r).direction==="rtl"&&(a+=xn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}function L4(e,t){const n=On(e),r=Qr(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const c=zg();(!c||c&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}function B4(e,t){const n=Xo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Cr(e)?Si(e):xo(1),a=e.clientWidth*i.x,s=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:a,height:s,x:l,y:c}}function e1(e,t,n){let r;if(t==="viewport")r=L4(e,n);else if(t==="document")r=N4(Qr(e));else if(Hr(t))r=B4(t,n);else{const o=_w(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Cc(r)}function Aw(e,t){const n=Di(e);return n===t||!Hr(n)||Zu(n)?!1:Un(n).position==="fixed"||Aw(n,t)}function F4(e,t){const n=t.get(e);if(n)return n;let r=ms(e,[],!1).filter(s=>Hr(s)&&wo(s)!=="body"),o=null;const i=Un(e).position==="fixed";let a=i?Di(e):e;for(;Hr(a)&&!Zu(a);){const s=Un(a),l=Fg(a);!l&&s.position==="fixed"&&(o=null),(i?!l&&!o:!l&&s.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||pl(a)&&!l&&Aw(e,a))?r=r.filter(u=>u!==a):o=s,a=Di(a)}return t.set(e,r),r}function z4(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?F4(t,this._c):[].concat(n),r],s=a[0],l=a.reduce((c,u)=>{const f=e1(t,u,o);return c.top=xn(f.top,c.top),c.right=bo(f.right,c.right),c.bottom=bo(f.bottom,c.bottom),c.left=xn(f.left,c.left),c},e1(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function W4(e){return Pw(e)}function V4(e,t,n){const r=Cr(t),o=Qr(t),i=n==="fixed",a=Xo(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=xo(0);if(r||!r&&!i)if((wo(t)!=="body"||pl(o))&&(s=Qu(t)),r){const c=Xo(t,!0,i,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=Tw(o));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function t1(e,t){return!Cr(e)||Un(e).position==="fixed"?null:t?t(e):e.offsetParent}function kw(e,t){const n=On(e);if(!Cr(e))return n;let r=t1(e,t);for(;r&&k4(r)&&Un(r).position==="static";)r=t1(r,t);return r&&(wo(r)==="html"||wo(r)==="body"&&Un(r).position==="static"&&!Fg(r))?n:r||j4(e)||n}const H4=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||kw,i=this.getDimensions;return{reference:V4(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function U4(e){return Un(e).direction==="rtl"}const G4={convertOffsetParentRelativeRectToViewportRelativeRect:R4,getDocumentElement:Qr,getClippingRect:z4,getOffsetParent:kw,getElementRects:H4,getClientRects:D4,getDimensions:W4,getScale:Si,isElement:Hr,isRTL:U4};function K4(e,t){let n=null,r;const o=Qr(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const{left:c,top:u,width:f,height:d}=e.getBoundingClientRect();if(s||t(),!f||!d)return;const p=Fl(u),h=Fl(o.clientWidth-(c+f)),g=Fl(o.clientHeight-(u+d)),v=Fl(c),w={rootMargin:-p+"px "+-h+"px "+-g+"px "+-v+"px",threshold:xn(0,bo(1,l))||1};let $=!0;function C(S){const b=S[0].intersectionRatio;if(b!==l){if(!$)return a();b?a(!1,b):r=setTimeout(()=>{a(!1,1e-7)},100)}$=!1}try{n=new IntersectionObserver(C,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,w)}n.observe(e)}return a(!0),i}function q4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Wg(e),u=o||i?[...c?ms(c):[],...ms(t)]:[];u.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),i&&x.addEventListener("resize",n)});const f=c&&s?K4(c,n):null;let d=-1,p=null;a&&(p=new ResizeObserver(x=>{let[w]=x;w&&w.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{p&&p.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let h,g=l?Xo(e):null;l&&v();function v(){const x=Xo(e);g&&(x.x!==g.x||x.y!==g.y||x.width!==g.width||x.height!==g.height)&&n(),g=x,h=requestAnimationFrame(v)}return n(),()=>{u.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f&&f(),p&&p.disconnect(),p=null,l&&cancelAnimationFrame(h)}}const X4=(e,t,n)=>{const r=new Map,o={platform:G4,...n},i={...o.platform,_c:r};return $4(e,t,{...o,platform:i})},Y4=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Yv({element:r.current,padding:o}).fn(n):{}:r?Yv({element:r,padding:o}).fn(n):{}}}};var dc=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Oc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Oc(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Oc(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function jw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function n1(e,t){const n=jw(e);return Math.round(t*n)/n}function r1(e){const t=y.useRef(e);return dc(()=>{t.current=e}),t}function Z4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,f]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,p]=y.useState(r);Oc(d,r)||p(r);const[h,g]=y.useState(null),[v,x]=y.useState(null),w=y.useCallback(D=>{D!=b.current&&(b.current=D,g(D))},[g]),$=y.useCallback(D=>{D!==O.current&&(O.current=D,x(D))},[x]),C=i||h,S=a||v,b=y.useRef(null),O=y.useRef(null),P=y.useRef(u),T=r1(l),k=r1(o),_=y.useCallback(()=>{if(!b.current||!O.current)return;const D={placement:t,strategy:n,middleware:d};k.current&&(D.platform=k.current),X4(b.current,O.current,D).then(L=>{const B={...L,isPositioned:!0};A.current&&!Oc(P.current,B)&&(P.current=B,ia.flushSync(()=>{f(B)}))})},[d,t,n,k]);dc(()=>{c===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(D=>({...D,isPositioned:!1})))},[c]);const A=y.useRef(!1);dc(()=>(A.current=!0,()=>{A.current=!1}),[]),dc(()=>{if(C&&(b.current=C),S&&(O.current=S),C&&S){if(T.current)return T.current(C,S,_);_()}},[C,S,_,T]);const I=y.useMemo(()=>({reference:b,floating:O,setReference:w,setFloating:$}),[w,$]),j=y.useMemo(()=>({reference:C,floating:S}),[C,S]),M=y.useMemo(()=>{const D={position:n,left:0,top:0};if(!j.floating)return D;const L=n1(j.floating,u.x),B=n1(j.floating,u.y);return s?{...D,transform:"translate("+L+"px, "+B+"px)",...jw(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:B}},[n,s,j.floating,u.x,u.y]);return y.useMemo(()=>({...u,update:_,refs:I,elements:j,floatingStyles:M}),[u,_,I,j,M])}const Q4=["onChange","maxRows","minRows","style","value"];function zl(e){return parseInt(e,10)||0}const J4={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function o1(e){return e==null||Object.keys(e).length===0||e.outerHeightStyle===0&&!e.overflow}const eP=y.forwardRef(function(t,n){const{onChange:r,maxRows:o,minRows:i=1,style:a,value:s}=t,l=je(t,Q4),{current:c}=y.useRef(s!=null),u=y.useRef(null),f=It(n,u),d=y.useRef(null),p=y.useRef(0),[h,g]=y.useState({outerHeightStyle:0}),v=y.useCallback(()=>{const C=u.current,b=or(C).getComputedStyle(C);if(b.width==="0px")return{outerHeightStyle:0};const O=d.current;O.style.width=b.width,O.value=C.value||t.placeholder||"x",O.value.slice(-1)===` +`&&(O.value+=" ");const P=b.boxSizing,T=zl(b.paddingBottom)+zl(b.paddingTop),k=zl(b.borderBottomWidth)+zl(b.borderTopWidth),_=O.scrollHeight;O.value="x";const A=O.scrollHeight;let I=_;i&&(I=Math.max(Number(i)*A,I)),o&&(I=Math.min(Number(o)*A,I)),I=Math.max(I,A);const j=I+(P==="border-box"?T+k:0),M=Math.abs(I-_)<=1;return{outerHeightStyle:j,overflow:M}},[o,i,t.placeholder]),x=(C,S)=>{const{outerHeightStyle:b,overflow:O}=S;return p.current<20&&(b>0&&Math.abs((C.outerHeightStyle||0)-b)>1||C.overflow!==O)?(p.current+=1,{overflow:O,outerHeightStyle:b}):C},w=y.useCallback(()=>{const C=v();o1(C)||g(S=>x(S,C))},[v]);Sr(()=>{const C=()=>{const _=v();o1(_)||ia.flushSync(()=>{g(A=>x(A,_))})},S=()=>{p.current=0,C()};let b;const O=cl(S),P=u.current,T=or(P);T.addEventListener("resize",O);let k;return typeof ResizeObserver<"u"&&(k=new ResizeObserver(S),k.observe(P)),()=>{O.clear(),cancelAnimationFrame(b),T.removeEventListener("resize",O),k&&k.disconnect()}},[v]),Sr(()=>{w()}),y.useEffect(()=>{p.current=0},[s]);const $=C=>{p.current=0,c||w(),r&&r(C)};return m.jsxs(y.Fragment,{children:[m.jsx("textarea",R({value:s,onChange:$,ref:f,rows:i,style:R({height:h.outerHeightStyle,overflow:h.overflow?"hidden":void 0},a)},l)),m.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:d,tabIndex:-1,style:R({},J4.shadow,a,{paddingTop:0,paddingBottom:0})})]})});function i1(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function tP(e={}){const{ignoreAccents:t=!0,ignoreCase:n=!0,limit:r,matchFrom:o="any",stringify:i,trim:a=!1}=e;return(s,{inputValue:l,getOptionLabel:c})=>{let u=a?l.trim():l;n&&(u=u.toLowerCase()),t&&(u=i1(u));const f=u?s.filter(d=>{let p=(i||c)(d);return n&&(p=p.toLowerCase()),t&&(p=i1(p)),o==="start"?p.indexOf(u)===0:p.indexOf(u)>-1}):s;return typeof r=="number"?f.slice(0,r):f}}function fd(e,t){for(let n=0;n{var t;return e.current!==null&&((t=e.current.parentElement)==null?void 0:t.contains(document.activeElement))};function oP(e){const{unstable_isActiveElementInListbox:t=rP,unstable_classNamePrefix:n="Mui",autoComplete:r=!1,autoHighlight:o=!1,autoSelect:i=!1,blurOnSelect:a=!1,clearOnBlur:s=!e.freeSolo,clearOnEscape:l=!1,componentName:c="useAutocomplete",defaultValue:u=e.multiple?[]:null,disableClearable:f=!1,disableCloseOnSelect:d=!1,disabled:p,disabledItemsFocusable:h=!1,disableListWrap:g=!1,filterOptions:v=nP,filterSelectedOptions:x=!1,freeSolo:w=!1,getOptionDisabled:$,getOptionKey:C,getOptionLabel:S=Q=>{var H;return(H=Q.label)!=null?H:Q},groupBy:b,handleHomeEndKeys:O=!e.freeSolo,id:P,includeInputInList:T=!1,inputValue:k,isOptionEqualToValue:_=(Q,H)=>Q===H,multiple:A=!1,onChange:I,onClose:j,onHighlightChange:M,onInputChange:D,onOpen:L,open:B,openOnFocus:F=!1,options:Z,readOnly:ie=!1,selectOnFocus:te=!e.freeSolo,value:le}=e,re=Og(P);let ae=S;ae=Q=>{const H=S(Q);return typeof H!="string"?String(H):H};const xe=y.useRef(!1),Me=y.useRef(!0),we=y.useRef(null),Y=y.useRef(null),[ve,ce]=y.useState(null),[G,fe]=y.useState(-1),de=o?0:-1,pe=y.useRef(de),[se,Le]=Qa({controlled:le,default:u,name:c}),[Ce,Ge]=Qa({controlled:k,default:"",name:c,state:"inputValue"}),[N,z]=y.useState(!1),U=y.useCallback((Q,H)=>{if(!(A?se.length!(x&&(A?se:[se]).some(H=>H!==null&&_(Q,H)))),{inputValue:Ae&&q?"":Ce,getOptionLabel:ae}):[],Ze=mE({filteredOptions:ne,value:se,inputValue:Ce});y.useEffect(()=>{const Q=se!==Ze.value;N&&!Q||w&&!Q||U(null,se)},[se,U,N,Ze.value,w]);const St=W&&ne.length>0&&!ie,$t=Sn(Q=>{Q===-1?we.current.focus():ve.querySelector(`[data-tag-index="${Q}"]`).focus()});y.useEffect(()=>{A&&G>se.length-1&&(fe(-1),$t(-1))},[se,A,G,$t]);function Oe(Q,H){if(!Y.current||Q<0||Q>=ne.length)return-1;let ye=Q;for(;;){const ke=Y.current.querySelector(`[data-option-index="${ye}"]`),rt=h?!1:!ke||ke.disabled||ke.getAttribute("aria-disabled")==="true";if(ke&&ke.hasAttribute("tabindex")&&!rt)return ye;if(H==="next"?ye=(ye+1)%ne.length:ye=(ye-1+ne.length)%ne.length,ye===Q)return-1}}const Be=Sn(({event:Q,index:H,reason:ye="auto"})=>{if(pe.current=H,H===-1?we.current.removeAttribute("aria-activedescendant"):we.current.setAttribute("aria-activedescendant",`${re}-option-${H}`),M&&M(Q,H===-1?null:ne[H],ye),!Y.current)return;const ke=Y.current.querySelector(`[role="option"].${n}-focused`);ke&&(ke.classList.remove(`${n}-focused`),ke.classList.remove(`${n}-focusVisible`));let rt=Y.current;if(Y.current.getAttribute("role")!=="listbox"&&(rt=Y.current.parentElement.querySelector('[role="listbox"]')),!rt)return;if(H===-1){rt.scrollTop=0;return}const _t=Y.current.querySelector(`[data-option-index="${H}"]`);if(_t&&(_t.classList.add(`${n}-focused`),ye==="keyboard"&&_t.classList.add(`${n}-focusVisible`),rt.scrollHeight>rt.clientHeight&&ye!=="mouse"&&ye!=="touch")){const At=_t,fr=rt.clientHeight+rt.scrollTop,bv=At.offsetTop+At.offsetHeight;bv>fr?rt.scrollTop=bv-rt.clientHeight:At.offsetTop-At.offsetHeight*(b?1.3:0){if(!Se)return;const _t=Oe((()=>{const At=ne.length-1;if(H==="reset")return de;if(H==="start")return 0;if(H==="end")return At;const fr=pe.current+H;return fr<0?fr===-1&&T?-1:g&&pe.current!==-1||Math.abs(H)>1?0:At:fr>At?fr===At+1&&T?-1:g||Math.abs(H)>1?At:0:fr})(),ye);if(Be({index:_t,reason:ke,event:Q}),r&&H!=="reset")if(_t===-1)we.current.value=Ce;else{const At=ae(ne[_t]);we.current.value=At,At.toLowerCase().indexOf(Ce.toLowerCase())===0&&Ce.length>0&&we.current.setSelectionRange(Ce.length,At.length)}}),$e=()=>{const Q=(H,ye)=>{const ke=H?ae(H):"",rt=ye?ae(ye):"";return ke===rt};if(pe.current!==-1&&Ze.filteredOptions&&Ze.filteredOptions.length!==ne.length&&Ze.inputValue===Ce&&(A?se.length===Ze.value.length&&Ze.value.every((H,ye)=>ae(se[ye])===ae(H)):Q(Ze.value,se))){const H=Ze.filteredOptions[pe.current];if(H&&ne.some(ke=>ae(ke)===ae(H)))return!0}return!1},Fe=y.useCallback(()=>{if(!Se||$e())return;const Q=A?se[0]:se;if(ne.length===0||Q==null){oe({diff:"reset"});return}if(Y.current){if(Q!=null){const H=ne[pe.current];if(A&&H&&fd(se,ke=>_(H,ke))!==-1)return;const ye=fd(ne,ke=>_(ke,Q));ye===-1?oe({diff:"reset"}):Be({index:ye});return}if(pe.current>=ne.length-1){Be({index:ne.length-1});return}Be({index:pe.current})}},[ne.length,A?!1:se,x,oe,Be,Se,Ce,A]),Ve=Sn(Q=>{yc(Y,Q),Q&&Fe()});y.useEffect(()=>{Fe()},[Fe]);const et=Q=>{W||(V(!0),ue(!0),L&&L(Q))},pt=(Q,H)=>{W&&(V(!1),j&&j(Q,H))},Et=(Q,H,ye,ke)=>{if(A){if(se.length===H.length&&se.every((rt,_t)=>rt===H[_t]))return}else if(se===H)return;I&&I(Q,H,ye,ke),Le(H)},Tn=y.useRef(!1),Gt=(Q,H,ye="selectOption",ke="options")=>{let rt=ye,_t=H;if(A){_t=Array.isArray(se)?se.slice():[];const At=fd(_t,fr=>_(H,fr));At===-1?_t.push(H):ke!=="freeSolo"&&(_t.splice(At,1),rt="removeOption")}U(Q,_t),Et(Q,_t,rt,{option:H}),!d&&(!Q||!Q.ctrlKey&&!Q.metaKey)&&pt(Q,rt),(a===!0||a==="touch"&&Tn.current||a==="mouse"&&!Tn.current)&&we.current.blur()};function to(Q,H){if(Q===-1)return-1;let ye=Q;for(;;){if(H==="next"&&ye===se.length||H==="previous"&&ye===-1)return-1;const ke=ve.querySelector(`[data-tag-index="${ye}"]`);if(!ke||!ke.hasAttribute("tabindex")||ke.disabled||ke.getAttribute("aria-disabled")==="true")ye+=H==="next"?1:-1;else return ye}}const Dl=(Q,H)=>{if(!A)return;Ce===""&&pt(Q,"toggleInput");let ye=G;G===-1?Ce===""&&H==="previous"&&(ye=se.length-1):(ye+=H==="next"?1:-1,ye<0&&(ye=0),ye===se.length&&(ye=-1)),ye=to(ye,H),fe(ye),$t(ye)},Nl=Q=>{xe.current=!0,Ge(""),D&&D(Q,"","clear"),Et(Q,A?[]:null,"clear")},rd=Q=>H=>{if(Q.onKeyDown&&Q.onKeyDown(H),!H.defaultMuiPrevented&&(G!==-1&&["ArrowLeft","ArrowRight"].indexOf(H.key)===-1&&(fe(-1),$t(-1)),H.which!==229))switch(H.key){case"Home":Se&&O&&(H.preventDefault(),oe({diff:"start",direction:"next",reason:"keyboard",event:H}));break;case"End":Se&&O&&(H.preventDefault(),oe({diff:"end",direction:"previous",reason:"keyboard",event:H}));break;case"PageUp":H.preventDefault(),oe({diff:-a1,direction:"previous",reason:"keyboard",event:H}),et(H);break;case"PageDown":H.preventDefault(),oe({diff:a1,direction:"next",reason:"keyboard",event:H}),et(H);break;case"ArrowDown":H.preventDefault(),oe({diff:1,direction:"next",reason:"keyboard",event:H}),et(H);break;case"ArrowUp":H.preventDefault(),oe({diff:-1,direction:"previous",reason:"keyboard",event:H}),et(H);break;case"ArrowLeft":Dl(H,"previous");break;case"ArrowRight":Dl(H,"next");break;case"Enter":if(pe.current!==-1&&Se){const ye=ne[pe.current],ke=$?$(ye):!1;if(H.preventDefault(),ke)return;Gt(H,ye,"selectOption"),r&&we.current.setSelectionRange(we.current.value.length,we.current.value.length)}else w&&Ce!==""&&Ae===!1&&(A&&H.preventDefault(),Gt(H,Ce,"createOption","freeSolo"));break;case"Escape":Se?(H.preventDefault(),H.stopPropagation(),pt(H,"escape")):l&&(Ce!==""||A&&se.length>0)&&(H.preventDefault(),H.stopPropagation(),Nl(H));break;case"Backspace":if(A&&!ie&&Ce===""&&se.length>0){const ye=G===-1?se.length-1:G,ke=se.slice();ke.splice(ye,1),Et(H,ke,"removeOption",{option:se[ye]})}break;case"Delete":if(A&&!ie&&Ce===""&&se.length>0&&G!==-1){const ye=G,ke=se.slice();ke.splice(ye,1),Et(H,ke,"removeOption",{option:se[ye]})}break}},vv=Q=>{z(!0),F&&!xe.current&&et(Q)},ri=Q=>{if(t(Y)){we.current.focus();return}z(!1),Me.current=!0,xe.current=!1,i&&pe.current!==-1&&Se?Gt(Q,ne[pe.current],"blur"):i&&w&&Ce!==""?Gt(Q,Ce,"blur","freeSolo"):s&&U(Q,se),pt(Q,"blur")},Kt=Q=>{const H=Q.target.value;Ce!==H&&(Ge(H),ue(!1),D&&D(Q,H,"input")),H===""?!f&&!A&&Et(Q,null,"clear"):et(Q)},Dt=Q=>{const H=Number(Q.currentTarget.getAttribute("data-option-index"));pe.current!==H&&Be({event:Q,index:H,reason:"mouse"})},Yn=Q=>{Be({event:Q,index:Number(Q.currentTarget.getAttribute("data-option-index")),reason:"touch"}),Tn.current=!0},yv=Q=>{const H=Number(Q.currentTarget.getAttribute("data-option-index"));Gt(Q,ne[H],"selectOption"),Tn.current=!1},od=Q=>H=>{const ye=se.slice();ye.splice(Q,1),Et(H,ye,"removeOption",{option:se[Q]})},id=Q=>{W?pt(Q,"toggleInput"):et(Q)},ad=Q=>{Q.currentTarget.contains(Q.target)&&Q.target.getAttribute("id")!==re&&Q.preventDefault()},Ll=Q=>{Q.currentTarget.contains(Q.target)&&(we.current.focus(),te&&Me.current&&we.current.selectionEnd-we.current.selectionStart===0&&we.current.select(),Me.current=!1)},Pa=Q=>{!p&&(Ce===""||!W)&&id(Q)};let _o=w&&Ce.length>0;_o=_o||(A?se.length>0:se!==null);let oi=ne;return b&&(oi=ne.reduce((Q,H,ye)=>{const ke=b(H);return Q.length>0&&Q[Q.length-1].group===ke?Q[Q.length-1].options.push(H):Q.push({key:ye,index:ye,group:ke,options:[H]}),Q},[])),p&&N&&ri(),{getRootProps:(Q={})=>R({"aria-owns":St?`${re}-listbox`:null},Q,{onKeyDown:rd(Q),onMouseDown:ad,onClick:Ll}),getInputLabelProps:()=>({id:`${re}-label`,htmlFor:re}),getInputProps:()=>({id:re,value:Ce,onBlur:ri,onFocus:vv,onChange:Kt,onMouseDown:Pa,"aria-activedescendant":Se?"":null,"aria-autocomplete":r?"both":"list","aria-controls":St?`${re}-listbox`:void 0,"aria-expanded":St,autoComplete:"off",ref:we,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:p}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:Nl}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:id}),getTagProps:({index:Q})=>R({key:Q,"data-tag-index":Q,tabIndex:-1},!ie&&{onDelete:od(Q)}),getListboxProps:()=>({role:"listbox",id:`${re}-listbox`,"aria-labelledby":`${re}-label`,ref:Ve,onMouseDown:Q=>{Q.preventDefault()}}),getOptionProps:({index:Q,option:H})=>{var ye;const ke=(A?se:[se]).some(_t=>_t!=null&&_(H,_t)),rt=$?$(H):!1;return{key:(ye=C==null?void 0:C(H))!=null?ye:ae(H),tabIndex:-1,role:"option",id:`${re}-option-${Q}`,onMouseMove:Dt,onClick:yv,onTouchStart:Yn,"data-option-index":Q,"aria-disabled":rt,"aria-selected":ke}},id:re,inputValue:Ce,value:se,dirty:_o,expanded:Se&&ve,popupOpen:Se,focused:N||G!==-1,anchorEl:ve,setAnchorEl:ce,focusedTag:G,groupedOptions:oi}}const iP=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],aP=be(i4,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),sP=y.forwardRef(function(t,n){var r;const o=pO(),i=Ye({props:t,name:"MuiPopper"}),{anchorEl:a,component:s,components:l,componentsProps:c,container:u,disablePortal:f,keepMounted:d,modifiers:p,open:h,placement:g,popperOptions:v,popperRef:x,transition:w,slots:$,slotProps:C}=i,S=je(i,iP),b=(r=$==null?void 0:$.root)!=null?r:l==null?void 0:l.Root,O=R({anchorEl:a,container:u,disablePortal:f,keepMounted:d,modifiers:p,open:h,placement:g,popperOptions:v,popperRef:x,transition:w},S);return m.jsx(aP,R({as:s,direction:o==null?void 0:o.direction,slots:{root:b},slotProps:C??c},O,{ref:n}))}),Vg=sP;function lP(e){return qe("MuiListSubheader",e)}Xe("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const cP=["className","color","component","disableGutters","disableSticky","inset"],uP=e=>{const{classes:t,color:n,disableGutters:r,inset:o,disableSticky:i}=e,a={root:["root",n!=="default"&&`color${ge(n)}`,!r&&"gutters",o&&"inset",!i&&"sticky"]};return Ke(a,lP,t)},fP=be("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${ge(n.color)}`],!n.disableGutters&&t.gutters,n.inset&&t.inset,!n.disableSticky&&t.sticky]}})(({theme:e,ownerState:t})=>R({boxSizing:"border-box",lineHeight:"48px",listStyle:"none",color:(e.vars||e).palette.text.secondary,fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(14)},t.color==="primary"&&{color:(e.vars||e).palette.primary.main},t.color==="inherit"&&{color:"inherit"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.inset&&{paddingLeft:72},!t.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper})),Iw=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiListSubheader"}),{className:o,color:i="default",component:a="li",disableGutters:s=!1,disableSticky:l=!1,inset:c=!1}=r,u=je(r,cP),f=R({},r,{color:i,component:a,disableGutters:s,disableSticky:l,inset:c}),d=uP(f);return m.jsx(fP,R({as:a,className:Te(d.root,o),ref:n,ownerState:f},u))});Iw.muiSkipListHighlight=!0;const dP=Iw,pP=ul(m.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}),"Cancel");function hP(e){return qe("MuiChip",e)}const gP=Xe("MuiChip",["root","sizeSmall","sizeMedium","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),tt=gP,mP=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],vP=e=>{const{classes:t,disabled:n,size:r,color:o,iconColor:i,onDelete:a,clickable:s,variant:l}=e,c={root:["root",l,n&&"disabled",`size${ge(r)}`,`color${ge(o)}`,s&&"clickable",s&&`clickableColor${ge(o)}`,a&&"deletable",a&&`deletableColor${ge(o)}`,`${l}${ge(o)}`],label:["label",`label${ge(r)}`],avatar:["avatar",`avatar${ge(r)}`,`avatarColor${ge(o)}`],icon:["icon",`icon${ge(r)}`,`iconColor${ge(i)}`],deleteIcon:["deleteIcon",`deleteIcon${ge(r)}`,`deleteIconColor${ge(o)}`,`deleteIcon${ge(l)}Color${ge(o)}`]};return Ke(c,hP,t)},yP=be("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{color:r,iconColor:o,clickable:i,onDelete:a,size:s,variant:l}=n;return[{[`& .${tt.avatar}`]:t.avatar},{[`& .${tt.avatar}`]:t[`avatar${ge(s)}`]},{[`& .${tt.avatar}`]:t[`avatarColor${ge(r)}`]},{[`& .${tt.icon}`]:t.icon},{[`& .${tt.icon}`]:t[`icon${ge(s)}`]},{[`& .${tt.icon}`]:t[`iconColor${ge(o)}`]},{[`& .${tt.deleteIcon}`]:t.deleteIcon},{[`& .${tt.deleteIcon}`]:t[`deleteIcon${ge(s)}`]},{[`& .${tt.deleteIcon}`]:t[`deleteIconColor${ge(r)}`]},{[`& .${tt.deleteIcon}`]:t[`deleteIcon${ge(l)}Color${ge(r)}`]},t.root,t[`size${ge(s)}`],t[`color${ge(r)}`],i&&t.clickable,i&&r!=="default"&&t[`clickableColor${ge(r)})`],a&&t.deletable,a&&r!=="default"&&t[`deletableColor${ge(r)}`],t[l],t[`${l}${ge(r)}`]]}})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return R({maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${tt.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${tt.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:n,fontSize:e.typography.pxToRem(12)},[`& .${tt.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${tt.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${tt.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${tt.icon}`]:R({marginLeft:5,marginRight:-6},t.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},t.iconColor===t.color&&R({color:e.vars?e.vars.palette.Chip.defaultIconColor:n},t.color!=="default"&&{color:"inherit"})),[`& .${tt.deleteIcon}`]:R({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:gt(e.palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.4)`:gt(e.palette.text.primary,.4)}},t.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},t.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[t.color].contrastTextChannel} / 0.7)`:gt(e.palette[t.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].contrastText}})},t.size==="small"&&{height:24},t.color!=="default"&&{backgroundColor:(e.vars||e).palette[t.color].main,color:(e.vars||e).palette[t.color].contrastText},t.onDelete&&{[`&.${tt.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:gt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},t.onDelete&&t.color!=="default"&&{[`&.${tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}})},({theme:e,ownerState:t})=>R({},t.clickable&&{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:gt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${tt.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:gt(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},t.clickable&&t.color!=="default"&&{[`&:hover, &.${tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette[t.color].dark}}),({theme:e,ownerState:t})=>R({},t.variant==="outlined"&&{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${tt.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${tt.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${tt.avatar}`]:{marginLeft:4},[`& .${tt.avatarSmall}`]:{marginLeft:2},[`& .${tt.icon}`]:{marginLeft:4},[`& .${tt.iconSmall}`]:{marginLeft:2},[`& .${tt.deleteIcon}`]:{marginRight:5},[`& .${tt.deleteIconSmall}`]:{marginRight:3}},t.variant==="outlined"&&t.color!=="default"&&{color:(e.vars||e).palette[t.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:gt(e.palette[t.color].main,.7)}`,[`&.${tt.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(e.palette[t.color].main,e.palette.action.hoverOpacity)},[`&.${tt.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:gt(e.palette[t.color].main,e.palette.action.focusOpacity)},[`& .${tt.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.7)`:gt(e.palette[t.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[t.color].main}}})),bP=be("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:n}=e,{size:r}=n;return[t.label,t[`label${ge(r)}`]]}})(({ownerState:e})=>R({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap"},e.variant==="outlined"&&{paddingLeft:11,paddingRight:11},e.size==="small"&&{paddingLeft:8,paddingRight:8},e.size==="small"&&e.variant==="outlined"&&{paddingLeft:7,paddingRight:7}));function s1(e){return e.key==="Backspace"||e.key==="Delete"}const xP=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:a,color:s="default",component:l,deleteIcon:c,disabled:u=!1,icon:f,label:d,onClick:p,onDelete:h,onKeyDown:g,onKeyUp:v,size:x="medium",variant:w="filled",tabIndex:$,skipFocusWhenDisabled:C=!1}=r,S=je(r,mP),b=y.useRef(null),O=It(b,n),P=F=>{F.stopPropagation(),h&&h(F)},T=F=>{F.currentTarget===F.target&&s1(F)&&F.preventDefault(),g&&g(F)},k=F=>{F.currentTarget===F.target&&(h&&s1(F)?h(F):F.key==="Escape"&&b.current&&b.current.blur()),v&&v(F)},_=a!==!1&&p?!0:a,A=_||h?ki:l||"div",I=R({},r,{component:A,disabled:u,size:x,color:s,iconColor:y.isValidElement(f)&&f.props.color||s,onDelete:!!h,clickable:_,variant:w}),j=vP(I),M=A===ki?R({component:l||"div",focusVisibleClassName:j.focusVisible},h&&{disableRipple:!0}):{};let D=null;h&&(D=c&&y.isValidElement(c)?y.cloneElement(c,{className:Te(c.props.className,j.deleteIcon),onClick:P}):m.jsx(pP,{className:Te(j.deleteIcon),onClick:P}));let L=null;o&&y.isValidElement(o)&&(L=y.cloneElement(o,{className:Te(j.avatar,o.props.className)}));let B=null;return f&&y.isValidElement(f)&&(B=y.cloneElement(f,{className:Te(j.icon,f.props.className)})),m.jsxs(yP,R({as:A,className:Te(j.root,i),disabled:_&&u?!0:void 0,onClick:p,onKeyDown:T,onKeyUp:k,ref:O,tabIndex:C&&u?-1:$,ownerState:I},M,S,{children:[L||B,m.jsx(bP,{className:Te(j.label),ownerState:I,children:d}),D]}))}),wP=xP;function da({props:e,states:t,muiFormControl:n}){return t.reduce((r,o)=>(r[o]=e[o],n&&typeof e[o]>"u"&&(r[o]=n[o]),r),{})}const SP=y.createContext(void 0),Hg=SP;function pa(){return y.useContext(Hg)}function $P(e){return m.jsx(bE,R({},e,{defaultTheme:hO,themeId:gO}))}function l1(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Ec(e,t=!1){return e&&(l1(e.value)&&e.value!==""||t&&l1(e.defaultValue)&&e.defaultValue!=="")}function CP(e){return e.startAdornment}function OP(e){return qe("MuiInputBase",e)}const EP=Xe("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),yn=EP,PP=["aria-describedby","autoComplete","autoFocus","className","color","components","componentsProps","defaultValue","disabled","disableInjectingGlobalStyles","endAdornment","error","fullWidth","id","inputComponent","inputProps","inputRef","margin","maxRows","minRows","multiline","name","onBlur","onChange","onClick","onFocus","onKeyDown","onKeyUp","placeholder","readOnly","renderSuffix","rows","size","slotProps","slots","startAdornment","type","value"],Ju=(e,t)=>{const{ownerState:n}=e;return[t.root,n.formControl&&t.formControl,n.startAdornment&&t.adornedStart,n.endAdornment&&t.adornedEnd,n.error&&t.error,n.size==="small"&&t.sizeSmall,n.multiline&&t.multiline,n.color&&t[`color${ge(n.color)}`],n.fullWidth&&t.fullWidth,n.hiddenLabel&&t.hiddenLabel]},ef=(e,t)=>{const{ownerState:n}=e;return[t.input,n.size==="small"&&t.inputSizeSmall,n.multiline&&t.inputMultiline,n.type==="search"&&t.inputTypeSearch,n.startAdornment&&t.inputAdornedStart,n.endAdornment&&t.inputAdornedEnd,n.hiddenLabel&&t.inputHiddenLabel]},_P=e=>{const{classes:t,color:n,disabled:r,error:o,endAdornment:i,focused:a,formControl:s,fullWidth:l,hiddenLabel:c,multiline:u,readOnly:f,size:d,startAdornment:p,type:h}=e,g={root:["root",`color${ge(n)}`,r&&"disabled",o&&"error",l&&"fullWidth",a&&"focused",s&&"formControl",d&&d!=="medium"&&`size${ge(d)}`,u&&"multiline",p&&"adornedStart",i&&"adornedEnd",c&&"hiddenLabel",f&&"readOnly"],input:["input",r&&"disabled",h==="search"&&"inputTypeSearch",u&&"inputMultiline",d==="small"&&"inputSizeSmall",c&&"inputHiddenLabel",p&&"inputAdornedStart",i&&"inputAdornedEnd",f&&"readOnly"]};return Ke(g,OP,t)},tf=be("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Ju})(({theme:e,ownerState:t})=>R({},e.typography.body1,{color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${yn.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},t.multiline&&R({padding:"4px 0 5px"},t.size==="small"&&{paddingTop:1}),t.fullWidth&&{width:"100%"})),nf=be("input",{name:"MuiInputBase",slot:"Input",overridesResolver:ef})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light",r=R({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),o={opacity:"0 !important"},i=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:n?.42:.5};return R({font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%",animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&:-ms-input-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${yn.formControl} &`]:{"&::-webkit-input-placeholder":o,"&::-moz-placeholder":o,"&:-ms-input-placeholder":o,"&::-ms-input-placeholder":o,"&:focus::-webkit-input-placeholder":i,"&:focus::-moz-placeholder":i,"&:focus:-ms-input-placeholder":i,"&:focus::-ms-input-placeholder":i},[`&.${yn.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},t.size==="small"&&{paddingTop:1},t.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},t.type==="search"&&{MozAppearance:"textfield"})}),TP=m.jsx($P,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),AP=y.forwardRef(function(t,n){var r;const o=Ye({props:t,name:"MuiInputBase"}),{"aria-describedby":i,autoComplete:a,autoFocus:s,className:l,components:c={},componentsProps:u={},defaultValue:f,disabled:d,disableInjectingGlobalStyles:p,endAdornment:h,fullWidth:g=!1,id:v,inputComponent:x="input",inputProps:w={},inputRef:$,maxRows:C,minRows:S,multiline:b=!1,name:O,onBlur:P,onChange:T,onClick:k,onFocus:_,onKeyDown:A,onKeyUp:I,placeholder:j,readOnly:M,renderSuffix:D,rows:L,slotProps:B={},slots:F={},startAdornment:Z,type:ie="text",value:te}=o,le=je(o,PP),re=w.value!=null?w.value:te,{current:ae}=y.useRef(re!=null),xe=y.useRef(),Me=y.useCallback(Se=>{},[]),we=It(xe,$,w.ref,Me),[Y,ve]=y.useState(!1),ce=pa(),G=da({props:o,muiFormControl:ce,states:["color","disabled","error","hiddenLabel","size","required","filled"]});G.focused=ce?ce.focused:Y,y.useEffect(()=>{!ce&&d&&Y&&(ve(!1),P&&P())},[ce,d,Y,P]);const fe=ce&&ce.onFilled,de=ce&&ce.onEmpty,pe=y.useCallback(Se=>{Ec(Se)?fe&&fe():de&&de()},[fe,de]);Sr(()=>{ae&&pe({value:re})},[re,pe,ae]);const se=Se=>{if(G.disabled){Se.stopPropagation();return}_&&_(Se),w.onFocus&&w.onFocus(Se),ce&&ce.onFocus?ce.onFocus(Se):ve(!0)},Le=Se=>{P&&P(Se),w.onBlur&&w.onBlur(Se),ce&&ce.onBlur?ce.onBlur(Se):ve(!1)},Ce=(Se,...ne)=>{if(!ae){const Ze=Se.target||xe.current;if(Ze==null)throw new Error(G2(1));pe({value:Ze.value})}w.onChange&&w.onChange(Se,...ne),T&&T(Se,...ne)};y.useEffect(()=>{pe(xe.current)},[]);const Ge=Se=>{xe.current&&Se.currentTarget===Se.target&&xe.current.focus(),k&&k(Se)};let N=x,z=w;b&&N==="input"&&(L?z=R({type:void 0,minRows:L,maxRows:L},z):z=R({type:void 0,maxRows:C,minRows:S},z),N=eP);const U=Se=>{pe(Se.animationName==="mui-auto-fill-cancel"?xe.current:{value:"x"})};y.useEffect(()=>{ce&&ce.setAdornedStart(!!Z)},[ce,Z]);const W=R({},o,{color:G.color||"primary",disabled:G.disabled,endAdornment:h,error:G.error,focused:G.focused,formControl:ce,fullWidth:g,hiddenLabel:G.hiddenLabel,multiline:b,size:G.size,startAdornment:Z,type:ie}),V=_P(W),q=F.root||c.Root||tf,ue=B.root||u.root||{},Ae=F.input||c.Input||nf;return z=R({},z,(r=B.input)!=null?r:u.input),m.jsxs(y.Fragment,{children:[!p&&TP,m.jsxs(q,R({},ue,!xc(q)&&{ownerState:R({},W,ue.ownerState)},{ref:n,onClick:Ge},le,{className:Te(V.root,ue.className,l,M&&"MuiInputBase-readOnly"),children:[Z,m.jsx(Hg.Provider,{value:null,children:m.jsx(Ae,R({ownerState:W,"aria-invalid":G.error,"aria-describedby":i,autoComplete:a,autoFocus:s,defaultValue:f,disabled:G.disabled,id:v,onAnimationStart:U,name:O,placeholder:j,readOnly:M,required:G.required,rows:L,value:re,onKeyDown:A,onKeyUp:I,type:ie},z,!xc(Ae)&&{as:N,ownerState:R({},W,z.ownerState)},{ref:we,className:Te(V.input,z.className,M&&"MuiInputBase-readOnly"),onBlur:Le,onChange:Ce,onFocus:se}))}),h,D?D(R({},G,{startAdornment:Z})):null]}))]})}),rf=AP;function kP(e){return qe("MuiInput",e)}const jP=R({},yn,Xe("MuiInput",["root","underline","input"])),uo=jP;function IP(e){return qe("MuiOutlinedInput",e)}const MP=R({},yn,Xe("MuiOutlinedInput",["root","notchedOutline","input"])),hr=MP;function RP(e){return qe("MuiFilledInput",e)}const DP=R({},yn,Xe("MuiFilledInput",["root","underline","input"])),bn=DP,Mw=ul(m.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function NP(e){return qe("MuiAutocomplete",e)}const LP=Xe("MuiAutocomplete",["root","expanded","fullWidth","focused","focusVisible","tag","tagSizeSmall","tagSizeMedium","hasPopupIcon","hasClearIcon","inputRoot","input","inputFocused","endAdornment","clearIndicator","popupIndicator","popupIndicatorOpen","popper","popperDisablePortal","paper","listbox","loading","noOptions","option","groupLabel","groupUl"]),He=LP;var c1,u1;const BP=["autoComplete","autoHighlight","autoSelect","blurOnSelect","ChipProps","className","clearIcon","clearOnBlur","clearOnEscape","clearText","closeText","componentsProps","defaultValue","disableClearable","disableCloseOnSelect","disabled","disabledItemsFocusable","disableListWrap","disablePortal","filterOptions","filterSelectedOptions","forcePopupIcon","freeSolo","fullWidth","getLimitTagsText","getOptionDisabled","getOptionKey","getOptionLabel","isOptionEqualToValue","groupBy","handleHomeEndKeys","id","includeInputInList","inputValue","limitTags","ListboxComponent","ListboxProps","loading","loadingText","multiple","noOptionsText","onChange","onClose","onHighlightChange","onInputChange","onOpen","open","openOnFocus","openText","options","PaperComponent","PopperComponent","popupIcon","readOnly","renderGroup","renderInput","renderOption","renderTags","selectOnFocus","size","slotProps","value"],FP=["ref"],zP=["key"],WP=e=>{const{classes:t,disablePortal:n,expanded:r,focused:o,fullWidth:i,hasClearIcon:a,hasPopupIcon:s,inputFocused:l,popupOpen:c,size:u}=e,f={root:["root",r&&"expanded",o&&"focused",i&&"fullWidth",a&&"hasClearIcon",s&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",l&&"inputFocused"],tag:["tag",`tagSize${ge(u)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",c&&"popupIndicatorOpen"],popper:["popper",n&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Ke(f,NP,t)},VP=be("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e,{fullWidth:r,hasClearIcon:o,hasPopupIcon:i,inputFocused:a,size:s}=n;return[{[`& .${He.tag}`]:t.tag},{[`& .${He.tag}`]:t[`tagSize${ge(s)}`]},{[`& .${He.inputRoot}`]:t.inputRoot},{[`& .${He.input}`]:t.input},{[`& .${He.input}`]:a&&t.inputFocused},t.root,r&&t.fullWidth,i&&t.hasPopupIcon,o&&t.hasClearIcon]}})(({ownerState:e})=>R({[`&.${He.focused} .${He.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${He.clearIndicator}`]:{visibility:"visible"}}},e.fullWidth&&{width:"100%"},{[`& .${He.tag}`]:R({margin:3,maxWidth:"calc(100% - 6px)"},e.size==="small"&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${He.inputRoot}`]:{flexWrap:"wrap",[`.${He.hasPopupIcon}&, .${He.hasClearIcon}&`]:{paddingRight:26+4},[`.${He.hasPopupIcon}.${He.hasClearIcon}&`]:{paddingRight:52+4},[`& .${He.input}`]:{width:0,minWidth:30}},[`& .${uo.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${uo.root}.${yn.sizeSmall}`]:{[`& .${uo.input}`]:{padding:"2px 4px 3px 0"}},[`& .${hr.root}`]:{padding:9,[`.${He.hasPopupIcon}&, .${He.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${He.hasPopupIcon}.${He.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${He.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${He.endAdornment}`]:{right:9}},[`& .${hr.root}.${yn.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${He.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${bn.root}`]:{paddingTop:19,paddingLeft:8,[`.${He.hasPopupIcon}&, .${He.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${He.hasPopupIcon}.${He.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${bn.input}`]:{padding:"7px 4px"},[`& .${He.endAdornment}`]:{right:9}},[`& .${bn.root}.${yn.sizeSmall}`]:{paddingBottom:1,[`& .${bn.input}`]:{padding:"2.5px 4px"}},[`& .${yn.hiddenLabel}`]:{paddingTop:8},[`& .${bn.root}.${yn.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${He.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${bn.root}.${yn.hiddenLabel}.${yn.sizeSmall}`]:{[`& .${He.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${He.input}`]:R({flexGrow:1,textOverflow:"ellipsis",opacity:0},e.inputFocused&&{opacity:1})})),HP=be("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,t)=>t.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),UP=be(yr,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,t)=>t.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),GP=be(yr,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:e},t)=>R({},t.popupIndicator,e.popupOpen&&t.popupIndicatorOpen)})(({ownerState:e})=>R({padding:2,marginRight:-2},e.popupOpen&&{transform:"rotate(180deg)"})),KP=be(Vg,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${He.option}`]:t.option},t.popper,n.disablePortal&&t.popperDisablePortal]}})(({theme:e,ownerState:t})=>R({zIndex:(e.vars||e).zIndex.modal},t.disablePortal&&{position:"absolute"})),qP=be(qu,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,t)=>t.paper})(({theme:e})=>R({},e.typography.body1,{overflow:"auto"})),XP=be("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,t)=>t.loading})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),YP=be("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,t)=>t.noOptions})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),ZP=be("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,t)=>t.listbox})(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${He.option}`]:{minHeight:48,display:"flex",overflow:"hidden",justifyContent:"flex-start",alignItems:"center",cursor:"pointer",paddingTop:6,boxSizing:"border-box",outline:"0",WebkitTapHighlightColor:"transparent",paddingBottom:6,paddingLeft:16,paddingRight:16,[e.breakpoints.up("sm")]:{minHeight:"auto"},[`&.${He.focused}`]:{backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},'&[aria-disabled="true"]':{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`&.${He.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},'&[aria-selected="true"]':{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:gt(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${He.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:gt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${He.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:gt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}})),QP=be(dP,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,t)=>t.groupLabel})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8})),JP=be("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,t)=>t.groupUl})({padding:0,[`& .${He.option}`]:{paddingLeft:24}}),e8=y.forwardRef(function(t,n){var r,o,i,a;const s=Ye({props:t,name:"MuiAutocomplete"}),{autoComplete:l=!1,autoHighlight:c=!1,autoSelect:u=!1,blurOnSelect:f=!1,ChipProps:d,className:p,clearIcon:h=c1||(c1=m.jsx(S6,{fontSize:"small"})),clearOnBlur:g=!s.freeSolo,clearOnEscape:v=!1,clearText:x="Clear",closeText:w="Close",componentsProps:$={},defaultValue:C=s.multiple?[]:null,disableClearable:S=!1,disableCloseOnSelect:b=!1,disabled:O=!1,disabledItemsFocusable:P=!1,disableListWrap:T=!1,disablePortal:k=!1,filterSelectedOptions:_=!1,forcePopupIcon:A="auto",freeSolo:I=!1,fullWidth:j=!1,getLimitTagsText:M=H=>`+${H}`,getOptionLabel:D,groupBy:L,handleHomeEndKeys:B=!s.freeSolo,includeInputInList:F=!1,limitTags:Z=-1,ListboxComponent:ie="ul",ListboxProps:te,loading:le=!1,loadingText:re="Loading…",multiple:ae=!1,noOptionsText:xe="No options",openOnFocus:Me=!1,openText:we="Open",PaperComponent:Y=qu,PopperComponent:ve=Vg,popupIcon:ce=u1||(u1=m.jsx(Mw,{})),readOnly:G=!1,renderGroup:fe,renderInput:de,renderOption:pe,renderTags:se,selectOnFocus:Le=!s.freeSolo,size:Ce="medium",slotProps:Ge={}}=s,N=je(s,BP),{getRootProps:z,getInputProps:U,getInputLabelProps:W,getPopupIndicatorProps:V,getClearProps:q,getTagProps:ue,getListboxProps:Ae,getOptionProps:Se,value:ne,dirty:Ze,expanded:St,id:$t,popupOpen:Oe,focused:Be,focusedTag:oe,anchorEl:$e,setAnchorEl:Fe,inputValue:Ve,groupedOptions:et}=oP(R({},s,{componentName:"Autocomplete"})),pt=!S&&!O&&Ze&&!G,Et=(!I||A===!0)&&A!==!1,{onMouseDown:Tn}=U(),{ref:Gt}=te??{},to=Ae(),{ref:Dl}=to,Nl=je(to,FP),rd=It(Dl,Gt),ri=D||(H=>{var ye;return(ye=H.label)!=null?ye:H}),Kt=R({},s,{disablePortal:k,expanded:St,focused:Be,fullWidth:j,getOptionLabel:ri,hasClearIcon:pt,hasPopupIcon:Et,inputFocused:oe===-1,popupOpen:Oe,size:Ce}),Dt=WP(Kt);let Yn;if(ae&&ne.length>0){const H=ye=>R({className:Dt.tag,disabled:O},ue(ye));se?Yn=se(ne,H,Kt):Yn=ne.map((ye,ke)=>m.jsx(wP,R({label:ri(ye),size:Ce},H({index:ke}),d)))}if(Z>-1&&Array.isArray(Yn)){const H=Yn.length-Z;!Be&&H>0&&(Yn=Yn.splice(0,Z),Yn.push(m.jsx("span",{className:Dt.tag,children:M(H)},Yn.length)))}const od=fe||(H=>m.jsxs("li",{children:[m.jsx(QP,{className:Dt.groupLabel,ownerState:Kt,component:"div",children:H.group}),m.jsx(JP,{className:Dt.groupUl,ownerState:Kt,children:H.children})]},H.key)),ad=pe||((H,ye)=>{const{key:ke}=H,rt=je(H,zP);return m.jsx("li",R({},rt,{children:ri(ye)}),ke)}),Ll=(H,ye)=>{const ke=Se({option:H,index:ye});return ad(R({},ke,{className:Dt.option}),H,{selected:ke["aria-selected"],index:ye,inputValue:Ve},Kt)},Pa=(r=Ge.clearIndicator)!=null?r:$.clearIndicator,_o=(o=Ge.paper)!=null?o:$.paper,oi=(i=Ge.popper)!=null?i:$.popper,Q=(a=Ge.popupIndicator)!=null?a:$.popupIndicator;return m.jsxs(y.Fragment,{children:[m.jsx(VP,R({ref:n,className:Te(Dt.root,p),ownerState:Kt},z(N),{children:de({id:$t,disabled:O,fullWidth:!0,size:Ce==="small"?"small":void 0,InputLabelProps:W(),InputProps:R({ref:Fe,className:Dt.inputRoot,startAdornment:Yn,onClick:H=>{H.target===H.currentTarget&&Tn(H)}},(pt||Et)&&{endAdornment:m.jsxs(HP,{className:Dt.endAdornment,ownerState:Kt,children:[pt?m.jsx(UP,R({},q(),{"aria-label":x,title:x,ownerState:Kt},Pa,{className:Te(Dt.clearIndicator,Pa==null?void 0:Pa.className),children:h})):null,Et?m.jsx(GP,R({},V(),{disabled:O,"aria-label":Oe?w:we,title:Oe?w:we,ownerState:Kt},Q,{className:Te(Dt.popupIndicator,Q==null?void 0:Q.className),children:ce})):null]})}),inputProps:R({className:Dt.input,disabled:O,readOnly:G},U())})})),$e?m.jsx(KP,R({as:ve,disablePortal:k,style:{width:$e?$e.clientWidth:null},ownerState:Kt,role:"presentation",anchorEl:$e,open:Oe},oi,{className:Te(Dt.popper,oi==null?void 0:oi.className),children:m.jsxs(qP,R({ownerState:Kt,as:Y},_o,{className:Te(Dt.paper,_o==null?void 0:_o.className),children:[le&&et.length===0?m.jsx(XP,{className:Dt.loading,ownerState:Kt,children:re}):null,et.length===0&&!I&&!le?m.jsx(YP,{className:Dt.noOptions,ownerState:Kt,role:"presentation",onMouseDown:H=>{H.preventDefault()},children:xe}):null,et.length>0?m.jsx(ZP,R({as:ie,className:Dt.listbox,ownerState:Kt},Nl,te,{ref:rd,children:et.map((H,ye)=>L?od({key:H.key,group:H.group,children:H.options.map((ke,rt)=>Ll(ke,H.index+rt))}):Ll(H,ye))})):null]}))})):null]})}),t8=e8,n8=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],r8={entering:{opacity:1},entered:{opacity:1}},o8=y.forwardRef(function(t,n){const r=aa(),o={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:i,appear:a=!0,children:s,easing:l,in:c,onEnter:u,onEntered:f,onEntering:d,onExit:p,onExited:h,onExiting:g,style:v,timeout:x=o,TransitionComponent:w=Eg}=t,$=je(t,n8),C=y.useRef(null),S=It(C,s.ref,n),b=j=>M=>{if(j){const D=C.current;M===void 0?j(D):j(D,M)}},O=b(d),P=b((j,M)=>{Tg(j);const D=Ai({style:v,timeout:x,easing:l},{mode:"enter"});j.style.webkitTransition=r.transitions.create("opacity",D),j.style.transition=r.transitions.create("opacity",D),u&&u(j,M)}),T=b(f),k=b(g),_=b(j=>{const M=Ai({style:v,timeout:x,easing:l},{mode:"exit"});j.style.webkitTransition=r.transitions.create("opacity",M),j.style.transition=r.transitions.create("opacity",M),p&&p(j)}),A=b(h),I=j=>{i&&i(C.current,j)};return m.jsx(w,R({appear:a,in:c,nodeRef:C,onEnter:P,onEntered:T,onEntering:O,onExit:_,onExited:A,onExiting:k,addEndListener:I,timeout:x},$,{children:(j,M)=>y.cloneElement(s,R({style:R({opacity:0,visibility:j==="exited"&&!c?"hidden":void 0},r8[j],v,s.props.style),ref:S},M))}))}),i8=o8;function a8(e){return qe("MuiBackdrop",e)}Xe("MuiBackdrop",["root","invisible"]);const s8=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],l8=e=>{const{classes:t,invisible:n}=e;return Ke({root:["root",n&&"invisible"]},a8,t)},c8=be("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>R({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent"},e.invisible&&{backgroundColor:"transparent"})),u8=y.forwardRef(function(t,n){var r,o,i;const a=Ye({props:t,name:"MuiBackdrop"}),{children:s,className:l,component:c="div",components:u={},componentsProps:f={},invisible:d=!1,open:p,slotProps:h={},slots:g={},TransitionComponent:v=i8,transitionDuration:x}=a,w=je(a,s8),$=R({},a,{component:c,invisible:d}),C=l8($),S=(r=h.root)!=null?r:f.root;return m.jsx(v,R({in:p,timeout:x},w,{children:m.jsx(c8,R({"aria-hidden":!0},S,{as:(o=(i=g.root)!=null?i:u.Root)!=null?o:c,className:Te(C.root,l,S==null?void 0:S.className),ownerState:R({},$,S==null?void 0:S.ownerState),classes:C,ref:n,children:s}))}))}),f8=u8;function d8(e){return qe("MuiButton",e)}const p8=Xe("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]),Wl=p8,h8=y.createContext({}),g8=h8,m8=y.createContext(void 0),v8=m8,y8=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],b8=e=>{const{color:t,disableElevation:n,fullWidth:r,size:o,variant:i,classes:a}=e,s={root:["root",i,`${i}${ge(t)}`,`size${ge(o)}`,`${i}Size${ge(o)}`,t==="inherit"&&"colorInherit",n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["startIcon",`iconSize${ge(o)}`],endIcon:["endIcon",`iconSize${ge(o)}`]},l=Ke(s,d8,a);return R({},a,l)},Rw=e=>R({},e.size==="small"&&{"& > *:nth-of-type(1)":{fontSize:18}},e.size==="medium"&&{"& > *:nth-of-type(1)":{fontSize:20}},e.size==="large"&&{"& > *:nth-of-type(1)":{fontSize:22}}),x8=be(ki,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`${n.variant}${ge(n.color)}`],t[`size${ge(n.size)}`],t[`${n.variant}Size${ge(n.size)}`],n.color==="inherit"&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(({theme:e,ownerState:t})=>{var n,r;const o=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],i=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return R({},e.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":R({textDecoration:"none",backgroundColor:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(e.palette.text.primary,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="text"&&t.color!=="inherit"&&{backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="outlined"&&t.color!=="inherit"&&{border:`1px solid ${(e.vars||e).palette[t.color].main}`,backgroundColor:e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:gt(e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},t.variant==="contained"&&{backgroundColor:e.vars?e.vars.palette.Button.inheritContainedHoverBg:i,boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2],backgroundColor:(e.vars||e).palette.grey[300]}},t.variant==="contained"&&t.color!=="inherit"&&{backgroundColor:(e.vars||e).palette[t.color].dark,"@media (hover: none)":{backgroundColor:(e.vars||e).palette[t.color].main}}),"&:active":R({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[8]}),[`&.${Wl.focusVisible}`]:R({},t.variant==="contained"&&{boxShadow:(e.vars||e).shadows[6]}),[`&.${Wl.disabled}`]:R({color:(e.vars||e).palette.action.disabled},t.variant==="outlined"&&{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`},t.variant==="contained"&&{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground})},t.variant==="text"&&{padding:"6px 8px"},t.variant==="text"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main},t.variant==="outlined"&&{padding:"5px 15px",border:"1px solid currentColor"},t.variant==="outlined"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].main,border:e.vars?`1px solid rgba(${e.vars.palette[t.color].mainChannel} / 0.5)`:`1px solid ${gt(e.palette[t.color].main,.5)}`},t.variant==="contained"&&{color:e.vars?e.vars.palette.text.primary:(n=(r=e.palette).getContrastText)==null?void 0:n.call(r,e.palette.grey[300]),backgroundColor:e.vars?e.vars.palette.Button.inheritContainedBg:o,boxShadow:(e.vars||e).shadows[2]},t.variant==="contained"&&t.color!=="inherit"&&{color:(e.vars||e).palette[t.color].contrastText,backgroundColor:(e.vars||e).palette[t.color].main},t.color==="inherit"&&{color:"inherit",borderColor:"currentColor"},t.size==="small"&&t.variant==="text"&&{padding:"4px 5px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="text"&&{padding:"8px 11px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="outlined"&&{padding:"3px 9px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="outlined"&&{padding:"7px 21px",fontSize:e.typography.pxToRem(15)},t.size==="small"&&t.variant==="contained"&&{padding:"4px 10px",fontSize:e.typography.pxToRem(13)},t.size==="large"&&t.variant==="contained"&&{padding:"8px 22px",fontSize:e.typography.pxToRem(15)},t.fullWidth&&{width:"100%"})},({ownerState:e})=>e.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Wl.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Wl.disabled}`]:{boxShadow:"none"}}),w8=be("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.startIcon,t[`iconSize${ge(n.size)}`]]}})(({ownerState:e})=>R({display:"inherit",marginRight:8,marginLeft:-4},e.size==="small"&&{marginLeft:-2},Rw(e))),S8=be("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.endIcon,t[`iconSize${ge(n.size)}`]]}})(({ownerState:e})=>R({display:"inherit",marginRight:-4,marginLeft:8},e.size==="small"&&{marginRight:-2},Rw(e))),$8=y.forwardRef(function(t,n){const r=y.useContext(g8),o=y.useContext(v8),i=mO(r,t),a=Ye({props:i,name:"MuiButton"}),{children:s,color:l="primary",component:c="button",className:u,disabled:f=!1,disableElevation:d=!1,disableFocusRipple:p=!1,endIcon:h,focusVisibleClassName:g,fullWidth:v=!1,size:x="medium",startIcon:w,type:$,variant:C="text"}=a,S=je(a,y8),b=R({},a,{color:l,component:c,disabled:f,disableElevation:d,disableFocusRipple:p,fullWidth:v,size:x,type:$,variant:C}),O=b8(b),P=w&&m.jsx(w8,{className:O.startIcon,ownerState:b,children:w}),T=h&&m.jsx(S8,{className:O.endIcon,ownerState:b,children:h}),k=o||"";return m.jsxs(x8,R({ownerState:b,className:Te(r.className,O.root,u,k),component:c,disabled:f,focusRipple:!p,focusVisibleClassName:Te(O.focusVisible,g),ref:n,type:$},S,{classes:O,children:[P,s,T]}))}),_r=$8;function C8(e){return qe("MuiCircularProgress",e)}Xe("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const O8=["className","color","disableShrink","size","style","thickness","value","variant"];let of=e=>e,f1,d1,p1,h1;const no=44,E8=al(f1||(f1=of` 0% { transform: rotate(0deg); } @@ -80,7 +80,7 @@ import{r as y,$ as U2,j as m,G as oO,u as iO,_ as je,a as R,d as aO,i as sO,c as 100% { transform: rotate(360deg); } -`)),P8=al(d1||(d1=rf` +`)),P8=al(d1||(d1=of` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; @@ -95,15 +95,15 @@ import{r as y,$ as U2,j as m,G as oO,u as iO,_ as je,a as R,d as aO,i as sO,c as stroke-dasharray: 100px, 200px; stroke-dashoffset: -125px; } -`)),_8=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,i={root:["root",n,`color${ge(r)}`],svg:["svg"],circle:["circle",`circle${ge(n)}`,o&&"circleDisableShrink"]};return Ke(i,C8,t)},T8=be("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${ge(n.color)}`]]}})(({ownerState:e,theme:t})=>R({display:"inline-block"},e.variant==="determinate"&&{transition:t.transitions.create("transform")},e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&K2(p1||(p1=rf` +`)),_8=e=>{const{classes:t,variant:n,color:r,disableShrink:o}=e,i={root:["root",n,`color${ge(r)}`],svg:["svg"],circle:["circle",`circle${ge(n)}`,o&&"circleDisableShrink"]};return Ke(i,C8,t)},T8=be("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`color${ge(n.color)}`]]}})(({ownerState:e,theme:t})=>R({display:"inline-block"},e.variant==="determinate"&&{transition:t.transitions.create("transform")},e.color!=="inherit"&&{color:(t.vars||t).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&K2(p1||(p1=of` animation: ${0} 1.4s linear infinite; - `),E8)),A8=be("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),k8=be("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${ge(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>R({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&K2(h1||(h1=rf` + `),E8)),A8=be("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({display:"block"}),k8=be("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.circle,t[`circle${ge(n.variant)}`],n.disableShrink&&t.circleDisableShrink]}})(({ownerState:e,theme:t})=>R({stroke:"currentColor"},e.variant==="determinate"&&{transition:t.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&K2(h1||(h1=of` animation: ${0} 1.4s ease-in-out infinite; - `),P8)),j8=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiCircularProgress"}),{className:o,color:i="primary",disableShrink:a=!1,size:s=40,style:l,thickness:c=3.6,value:u=0,variant:f="indeterminate"}=r,d=je(r,O8),p=R({},r,{color:i,disableShrink:a,size:s,thickness:c,value:u,variant:f}),h=_8(p),g={},v={},x={};if(f==="determinate"){const w=2*Math.PI*((no-c)/2);g.strokeDasharray=w.toFixed(3),x["aria-valuenow"]=Math.round(u),g.strokeDashoffset=`${((100-u)/100*w).toFixed(3)}px`,v.transform="rotate(-90deg)"}return m.jsx(T8,R({className:Te(h.root,o),style:R({width:s,height:s},v,l),ownerState:p,ref:n,role:"progressbar"},x,d,{children:m.jsx(A8,{className:h.svg,ownerState:p,viewBox:`${no/2} ${no/2} ${no} ${no}`,children:m.jsx(k8,{className:h.circle,style:g,ownerState:p,cx:no,cy:no,r:(no-c)/2,fill:"none",strokeWidth:c})})}))}),I8=j8;function M8(e){return qe("MuiModal",e)}Xe("MuiModal",["root","hidden","backdrop"]);const R8=["BackdropComponent","BackdropProps","classes","className","closeAfterTransition","children","container","component","components","componentsProps","disableAutoFocus","disableEnforceFocus","disableEscapeKeyDown","disablePortal","disableRestoreFocus","disableScrollLock","hideBackdrop","keepMounted","onBackdropClick","onClose","onTransitionEnter","onTransitionExited","open","slotProps","slots","theme"],D8=e=>{const{open:t,exited:n,classes:r}=e;return Ke({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},M8,r)},N8=be("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>R({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),L8=be(f8,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),B8=y.forwardRef(function(t,n){var r,o,i,a,s,l;const c=Ye({name:"MuiModal",props:t}),{BackdropComponent:u=L8,BackdropProps:f,className:d,closeAfterTransition:p=!1,children:h,container:g,component:v,components:x={},componentsProps:w={},disableAutoFocus:$=!1,disableEnforceFocus:C=!1,disableEscapeKeyDown:S=!1,disablePortal:b=!1,disableRestoreFocus:O=!1,disableScrollLock:P=!1,hideBackdrop:T=!1,keepMounted:k=!1,onBackdropClick:_,open:A,slotProps:I,slots:j}=c,M=je(c,R8),D=R({},c,{closeAfterTransition:p,disableAutoFocus:$,disableEnforceFocus:C,disableEscapeKeyDown:S,disablePortal:b,disableRestoreFocus:O,disableScrollLock:P,hideBackdrop:T,keepMounted:k}),{getRootProps:L,getBackdropProps:B,getTransitionProps:F,portalRef:Z,isTopModal:ie,exited:te,hasTransition:le}=h4(R({},D,{rootRef:n})),re=R({},D,{exited:te}),ae=D8(re),xe={};if(h.props.tabIndex===void 0&&(xe.tabIndex="-1"),le){const{onEnter:fe,onExited:de}=F();xe.onEnter=fe,xe.onExited=de}const Me=(r=(o=j==null?void 0:j.root)!=null?o:x.Root)!=null?r:N8,we=(i=(a=j==null?void 0:j.backdrop)!=null?a:x.Backdrop)!=null?i:u,Y=(s=I==null?void 0:I.root)!=null?s:w.root,ve=(l=I==null?void 0:I.backdrop)!=null?l:w.backdrop,ce=ir({elementType:Me,externalSlotProps:Y,externalForwardedProps:M,getSlotProps:L,additionalProps:{ref:n,as:v},ownerState:re,className:Te(d,Y==null?void 0:Y.className,ae==null?void 0:ae.root,!re.open&&re.exited&&(ae==null?void 0:ae.hidden))}),G=ir({elementType:we,externalSlotProps:ve,additionalProps:f,getSlotProps:fe=>B(R({},fe,{onClick:de=>{_&&_(de),fe!=null&&fe.onClick&&fe.onClick(de)}})),className:Te(ve==null?void 0:ve.className,f==null?void 0:f.className,ae==null?void 0:ae.backdrop),ownerState:re});return!k&&!A&&(!le||te)?null:m.jsx($w,{ref:Z,container:g,disablePortal:b,children:m.jsxs(Me,R({},ce,{children:[!T&&u?m.jsx(we,R({},G)):null,m.jsx(V6,{disableEnforceFocus:C,disableAutoFocus:$,disableRestoreFocus:O,isEnabled:ie,open:A,children:y.cloneElement(h,xe)})]}))})}),F8=B8,z8=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function W8(e,t,n){const r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),i=or(t);let a;if(t.fakeTransform)a=t.fakeTransform;else{const c=i.getComputedStyle(t);a=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let s=0,l=0;if(a&&a!=="none"&&typeof a=="string"){const c=a.split("(")[1].split(")")[0].split(",");s=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?o?`translateX(${o.right+s-r.left}px)`:`translateX(${i.innerWidth+s-r.left}px)`:e==="right"?o?`translateX(-${r.right-o.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:e==="up"?o?`translateY(${o.bottom+l-r.top}px)`:`translateY(${i.innerHeight+l-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function V8(e){return typeof e=="function"?e():e}function Vl(e,t,n){const r=V8(n),o=W8(e,t,r);o&&(t.style.webkitTransform=o,t.style.transform=o)}const H8=y.forwardRef(function(t,n){const r=aa(),o={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:s=!0,children:l,container:c,direction:u="down",easing:f=o,in:d,onEnter:p,onEntered:h,onEntering:g,onExit:v,onExited:x,onExiting:w,style:$,timeout:C=i,TransitionComponent:S=Eg}=t,b=je(t,z8),O=y.useRef(null),P=It(l.ref,O,n),T=B=>F=>{B&&(F===void 0?B(O.current):B(O.current,F))},k=T((B,F)=>{Vl(u,B,c),Tg(B),p&&p(B,F)}),_=T((B,F)=>{const Z=Ai({timeout:C,style:$,easing:f},{mode:"enter"});B.style.webkitTransition=r.transitions.create("-webkit-transform",R({},Z)),B.style.transition=r.transitions.create("transform",R({},Z)),B.style.webkitTransform="none",B.style.transform="none",g&&g(B,F)}),A=T(h),I=T(w),j=T(B=>{const F=Ai({timeout:C,style:$,easing:f},{mode:"exit"});B.style.webkitTransition=r.transitions.create("-webkit-transform",F),B.style.transition=r.transitions.create("transform",F),Vl(u,B,c),v&&v(B)}),M=T(B=>{B.style.webkitTransition="",B.style.transition="",x&&x(B)}),D=B=>{a&&a(O.current,B)},L=y.useCallback(()=>{O.current&&Vl(u,O.current,c)},[u,c]);return y.useEffect(()=>{if(d||u==="down"||u==="right")return;const B=cl(()=>{O.current&&Vl(u,O.current,c)}),F=or(O.current);return F.addEventListener("resize",B),()=>{B.clear(),F.removeEventListener("resize",B)}},[u,d,c]),y.useEffect(()=>{d||L()},[d,L]),m.jsx(S,R({nodeRef:O,onEnter:k,onEntered:A,onEntering:_,onExit:j,onExited:M,onExiting:I,addEndListener:D,appear:s,in:d,timeout:C},b,{children:(B,F)=>y.cloneElement(l,R({ref:P,style:R({visibility:B==="exited"&&!d?"hidden":void 0},$,l.props.style)},F))}))}),U8=H8,G8=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],K8=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},RP,t);return R({},t,o)},q8=be(ef,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Qu(e,t),!n.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{var n;const r=e.palette.mode==="light",o=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",i=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",s=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return R({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i}},[`&.${bn.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i},[`&.${bn.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:s}},!t.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(n=(e.vars||e).palette[t.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${bn.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${bn.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:o}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${bn.disabled}, .${bn.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${bn.disabled}:before`]:{borderBottomStyle:"dotted"}},t.startAdornment&&{paddingLeft:12},t.endAdornment&&{paddingRight:12},t.multiline&&R({padding:"25px 12px 8px"},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9}))}),X8=be(tf,{name:"MuiFilledInput",slot:"Input",overridesResolver:Ju})(({theme:e,ownerState:t})=>R({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9},t.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),Dw=y.forwardRef(function(t,n){var r,o,i,a;const s=Ye({props:t,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:f="input",multiline:d=!1,slotProps:p,slots:h={},type:g="text"}=s,v=je(s,G8),x=R({},s,{fullWidth:u,inputComponent:f,multiline:d,type:g}),w=K8(s),$={root:{ownerState:x},input:{ownerState:x}},C=p??c?Wu($,p??c):$,S=(r=(o=h.root)!=null?o:l.Root)!=null?r:q8,b=(i=(a=h.input)!=null?a:l.Input)!=null?i:X8;return m.jsx(nf,R({slots:{root:S,input:b},componentsProps:C,fullWidth:u,inputComponent:f,multiline:d,ref:n,type:g},v,{classes:w}))});Dw.muiName="Input";const Nw=Dw;function Y8(e){return qe("MuiFormControl",e)}Xe("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Z8=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Q8=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${ge(n)}`,r&&"fullWidth"]};return Ke(o,Y8,t)},J8=be("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>R({},t.root,t[`margin${ge(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>R({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),e7=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiFormControl"}),{children:o,className:i,color:a="primary",component:s="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:p="none",required:h=!1,size:g="medium",variant:v="outlined"}=r,x=je(r,Z8),w=R({},r,{color:a,component:s,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:p,required:h,size:g,variant:v}),$=Q8(w),[C,S]=y.useState(()=>{let I=!1;return o&&y.Children.forEach(o,j=>{if(!sd(j,["Input","Select"]))return;const M=sd(j,["Select"])?j.props.input:j;M&&CP(M.props)&&(I=!0)}),I}),[b,O]=y.useState(()=>{let I=!1;return o&&y.Children.forEach(o,j=>{sd(j,["Input","Select"])&&(Ec(j.props,!0)||Ec(j.props.inputProps,!0))&&(I=!0)}),I}),[P,T]=y.useState(!1);l&&P&&T(!1);const k=u!==void 0&&!l?u:P;let _;const A=y.useMemo(()=>({adornedStart:C,setAdornedStart:S,color:a,disabled:l,error:c,filled:b,focused:k,fullWidth:f,hiddenLabel:d,size:g,onBlur:()=>{T(!1)},onEmpty:()=>{O(!1)},onFilled:()=>{O(!0)},onFocus:()=>{T(!0)},registerEffect:_,required:h,variant:v}),[C,a,l,c,b,k,f,d,_,h,g,v]);return m.jsx(Hg.Provider,{value:A,children:m.jsx(J8,R({as:s,ownerState:w,className:Te($.root,i),ref:n},x,{children:o}))})}),t7=e7,n7=jE({createStyledComponent:be("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Ye({props:e,name:"MuiStack"})}),Lw=n7;function r7(e){return qe("MuiFormHelperText",e)}const o7=Xe("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),g1=o7;var m1;const i7=["children","className","component","disabled","error","filled","focused","margin","required","variant"],a7=e=>{const{classes:t,contained:n,size:r,disabled:o,error:i,filled:a,focused:s,required:l}=e,c={root:["root",o&&"disabled",i&&"error",r&&`size${ge(r)}`,n&&"contained",s&&"focused",a&&"filled",l&&"required"]};return Ke(c,r7,t)},s7=be("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${ge(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(({theme:e,ownerState:t})=>R({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${g1.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${g1.error}`]:{color:(e.vars||e).palette.error.main}},t.size==="small"&&{marginTop:4},t.contained&&{marginLeft:14,marginRight:14})),l7=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiFormHelperText"}),{children:o,className:i,component:a="p"}=r,s=je(r,i7),l=pa(),c=da({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=R({},r,{component:a,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=a7(u);return m.jsx(s7,R({as:a,ownerState:u,className:Te(f.root,i),ref:n},s,{children:o===" "?m1||(m1=m.jsx("span",{className:"notranslate",children:"​"})):o}))}),c7=l7;function u7(e){return qe("MuiFormLabel",e)}const f7=Xe("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ns=f7,d7=["children","className","color","component","disabled","error","filled","focused","required"],p7=e=>{const{classes:t,color:n,focused:r,disabled:o,error:i,filled:a,required:s}=e,l={root:["root",`color${ge(n)}`,o&&"disabled",i&&"error",a&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",i&&"error"]};return Ke(l,u7,t)},h7=be("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},t)=>R({},t.root,e.color==="secondary"&&t.colorSecondary,e.filled&&t.filled)})(({theme:e,ownerState:t})=>R({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${ns.focused}`]:{color:(e.vars||e).palette[t.color].main},[`&.${ns.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ns.error}`]:{color:(e.vars||e).palette.error.main}})),g7=be("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${ns.error}`]:{color:(e.vars||e).palette.error.main}})),m7=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiFormLabel"}),{children:o,className:i,component:a="label"}=r,s=je(r,d7),l=pa(),c=da({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=R({},r,{color:c.color||"primary",component:a,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=p7(u);return m.jsxs(h7,R({as:a,ownerState:u,className:Te(f.root,i),ref:n},s,{children:[o,c.required&&m.jsxs(g7,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),v7=m7,y7=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function jp(e){return`scale(${e}, ${e**2})`}const b7={entering:{opacity:1,transform:jp(1)},entered:{opacity:1,transform:"none"}},fd=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Bw=y.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:i,easing:a,in:s,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:p,style:h,timeout:g="auto",TransitionComponent:v=Eg}=t,x=je(t,y7),w=y.useRef(),$=y.useRef(),C=aa(),S=y.useRef(null),b=It(S,i.ref,n),O=M=>D=>{if(M){const L=S.current;D===void 0?M(L):M(L,D)}},P=O(u),T=O((M,D)=>{Tg(M);const{duration:L,delay:B,easing:F}=Ai({style:h,timeout:g,easing:a},{mode:"enter"});let Z;g==="auto"?(Z=C.transitions.getAutoHeightDuration(M.clientHeight),$.current=Z):Z=L,M.style.transition=[C.transitions.create("opacity",{duration:Z,delay:B}),C.transitions.create("transform",{duration:fd?Z:Z*.666,delay:B,easing:F})].join(","),l&&l(M,D)}),k=O(c),_=O(p),A=O(M=>{const{duration:D,delay:L,easing:B}=Ai({style:h,timeout:g,easing:a},{mode:"exit"});let F;g==="auto"?(F=C.transitions.getAutoHeightDuration(M.clientHeight),$.current=F):F=D,M.style.transition=[C.transitions.create("opacity",{duration:F,delay:L}),C.transitions.create("transform",{duration:fd?F:F*.666,delay:fd?L:L||F*.333,easing:B})].join(","),M.style.opacity=0,M.style.transform=jp(.75),f&&f(M)}),I=O(d),j=M=>{g==="auto"&&(w.current=setTimeout(M,$.current||0)),r&&r(S.current,M)};return y.useEffect(()=>()=>{clearTimeout(w.current)},[]),m.jsx(v,R({appear:o,in:s,nodeRef:S,onEnter:T,onEntered:k,onEntering:P,onExit:A,onExited:I,onExiting:_,addEndListener:j,timeout:g==="auto"?null:g},x,{children:(M,D)=>y.cloneElement(i,R({style:R({opacity:0,transform:jp(.75),visibility:M==="exited"&&!s?"hidden":void 0},b7[M],h,i.props.style),ref:b},D))}))});Bw.muiSupportAuto=!0;const x7=Bw,w7=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],S7=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},kP,t);return R({},t,o)},$7=be(ef,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Qu(e,t),!n.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{let r=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(r=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),R({position:"relative"},t.formControl&&{"label + &":{marginTop:16}},!t.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(e.vars||e).palette[t.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${uo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${uo.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${uo.disabled}, .${uo.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${uo.disabled}:before`]:{borderBottomStyle:"dotted"}})}),C7=be(tf,{name:"MuiInput",slot:"Input",overridesResolver:Ju})({}),Fw=y.forwardRef(function(t,n){var r,o,i,a;const s=Ye({props:t,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:f=!1,inputComponent:d="input",multiline:p=!1,slotProps:h,slots:g={},type:v="text"}=s,x=je(s,w7),w=S7(s),C={root:{ownerState:{disableUnderline:l}}},S=h??u?Wu(h??u,C):C,b=(r=(o=g.root)!=null?o:c.Root)!=null?r:$7,O=(i=(a=g.input)!=null?a:c.Input)!=null?i:C7;return m.jsx(nf,R({slots:{root:b,input:O},slotProps:S,fullWidth:f,inputComponent:d,multiline:p,ref:n,type:v},x,{classes:w}))});Fw.muiName="Input";const zw=Fw;function O7(e){return qe("MuiInputLabel",e)}Xe("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const E7=["disableAnimation","margin","shrink","variant","className"],P7=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:i,variant:a,required:s}=e,l={root:["root",n&&"formControl",!i&&"animated",o&&"shrink",r&&r!=="normal"&&`size${ge(r)}`,a],asterisk:[s&&"asterisk"]},c=Ke(l,O7,t);return R({},t,c)},_7=be(v7,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${ns.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(({theme:e,ownerState:t})=>R({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},t.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},t.size==="small"&&{transform:"translate(0, 17px) scale(1)"},t.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!t.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},t.variant==="filled"&&R({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},t.shrink&&R({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},t.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),t.variant==="outlined"&&R({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},t.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),T7=y.forwardRef(function(t,n){const r=Ye({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,shrink:i,className:a}=r,s=je(r,E7),l=pa();let c=i;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=da({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),f=R({},r,{disableAnimation:o,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),d=P7(f);return m.jsx(_7,R({"data-shrink":c,ownerState:f,ref:n,className:Te(d.root,a)},s,{classes:d}))}),A7=T7,k7=y.createContext({}),j7=k7;function I7(e){return qe("MuiList",e)}Xe("MuiList",["root","padding","dense","subheader"]);const M7=["children","className","component","dense","disablePadding","subheader"],R7=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Ke({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},I7,t)},D7=be("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})(({ownerState:e})=>R({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),N7=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiList"}),{children:o,className:i,component:a="ul",dense:s=!1,disablePadding:l=!1,subheader:c}=r,u=je(r,M7),f=y.useMemo(()=>({dense:s}),[s]),d=R({},r,{component:a,dense:s,disablePadding:l}),p=R7(d);return m.jsx(j7.Provider,{value:f,children:m.jsxs(D7,R({as:a,className:Te(p.root,i),ref:n,ownerState:d},u,{children:[c,o]}))})}),L7=N7,B7=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function dd(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function v1(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function Ww(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.indexOf(t.keys.join(""))===0}function Ta(e,t,n,r,o,i){let a=!1,s=o(e,t,t?n:!1);for(;s;){if(s===e.firstChild){if(a)return!1;a=!0}const l=r?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!Ww(s,i)||l)s=o(e,s,n);else return s.focus(),!0}return!1}const F7=y.forwardRef(function(t,n){const{actions:r,autoFocus:o=!1,autoFocusItem:i=!1,children:a,className:s,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu"}=t,d=je(t,B7),p=y.useRef(null),h=y.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Sr(()=>{o&&p.current.focus()},[o]),y.useImperativeHandle(r,()=>({adjustStyleForScrollbar:($,C)=>{const S=!p.current.style.width;if($.clientHeight{const C=p.current,S=$.key,b=Jt(C).activeElement;if(S==="ArrowDown")$.preventDefault(),Ta(C,b,c,l,dd);else if(S==="ArrowUp")$.preventDefault(),Ta(C,b,c,l,v1);else if(S==="Home")$.preventDefault(),Ta(C,null,c,l,dd);else if(S==="End")$.preventDefault(),Ta(C,null,c,l,v1);else if(S.length===1){const O=h.current,P=S.toLowerCase(),T=performance.now();O.keys.length>0&&(T-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&P!==O.keys[0]&&(O.repeating=!1)),O.lastTime=T,O.keys.push(P);const k=b&&!O.repeating&&Ww(b,O);O.previousKeyMatched&&(k||Ta(C,b,!1,l,dd,O))?$.preventDefault():O.previousKeyMatched=!1}u&&u($)},v=It(p,n);let x=-1;y.Children.forEach(a,($,C)=>{if(!y.isValidElement($)){x===C&&(x+=1,x>=a.length&&(x=-1));return}$.props.disabled||(f==="selectedMenu"&&$.props.selected||x===-1)&&(x=C),x===C&&($.props.disabled||$.props.muiSkipListHighlight||$.type.muiSkipListHighlight)&&(x+=1,x>=a.length&&(x=-1))});const w=y.Children.map(a,($,C)=>{if(C===x){const S={};return i&&(S.autoFocus=!0),$.props.tabIndex===void 0&&f==="selectedMenu"&&(S.tabIndex=0),y.cloneElement($,S)}return $});return m.jsx(L7,R({role:"menu",ref:v,className:s,onKeyDown:g,tabIndex:o?0:-1},d,{children:w}))}),z7=F7;function W7(e){return qe("MuiPopover",e)}Xe("MuiPopover",["root","paper"]);const V7=["onEntering"],H7=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],U7=["slotProps"];function y1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function b1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function x1(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function pd(e){return typeof e=="function"?e():e}const G7=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"]},W7,t)},K7=be(F8,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Vw=be(Ku,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),q7=y.forwardRef(function(t,n){var r,o,i;const a=Ye({props:t,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:f="anchorEl",children:d,className:p,container:h,elevation:g=8,marginThreshold:v=16,open:x,PaperProps:w={},slots:$,slotProps:C,transformOrigin:S={vertical:"top",horizontal:"left"},TransitionComponent:b=x7,transitionDuration:O="auto",TransitionProps:{onEntering:P}={},disableScrollLock:T=!1}=a,k=je(a.TransitionProps,V7),_=je(a,H7),A=(r=C==null?void 0:C.paper)!=null?r:w,I=y.useRef(),j=It(I,A.ref),M=R({},a,{anchorOrigin:c,anchorReference:f,elevation:g,marginThreshold:v,externalPaperSlotProps:A,transformOrigin:S,TransitionComponent:b,transitionDuration:O,TransitionProps:k}),D=G7(M),L=y.useCallback(()=>{if(f==="anchorPosition")return u;const fe=pd(l),pe=(fe&&fe.nodeType===1?fe:Jt(I.current).body).getBoundingClientRect();return{top:pe.top+y1(pe,c.vertical),left:pe.left+b1(pe,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),B=y.useCallback(fe=>({vertical:y1(fe,S.vertical),horizontal:b1(fe,S.horizontal)}),[S.horizontal,S.vertical]),F=y.useCallback(fe=>{const de={width:fe.offsetWidth,height:fe.offsetHeight},pe=B(de);if(f==="none")return{top:null,left:null,transformOrigin:x1(pe)};const se=L();let Le=se.top-pe.vertical,Ce=se.left-pe.horizontal;const Ge=Le+de.height,N=Ce+de.width,z=or(pd(l)),U=z.innerHeight-v,W=z.innerWidth-v;if(v!==null&&LeU){const V=Ge-U;Le-=V,pe.vertical+=V}if(v!==null&&CeW){const V=N-W;Ce-=V,pe.horizontal+=V}return{top:`${Math.round(Le)}px`,left:`${Math.round(Ce)}px`,transformOrigin:x1(pe)}},[l,f,L,B,v]),[Z,ie]=y.useState(x),te=y.useCallback(()=>{const fe=I.current;if(!fe)return;const de=F(fe);de.top!==null&&(fe.style.top=de.top),de.left!==null&&(fe.style.left=de.left),fe.style.transformOrigin=de.transformOrigin,ie(!0)},[F]);y.useEffect(()=>(T&&window.addEventListener("scroll",te),()=>window.removeEventListener("scroll",te)),[l,T,te]);const le=(fe,de)=>{P&&P(fe,de),te()},re=()=>{ie(!1)};y.useEffect(()=>{x&&te()}),y.useImperativeHandle(s,()=>x?{updatePosition:()=>{te()}}:null,[x,te]),y.useEffect(()=>{if(!x)return;const fe=cl(()=>{te()}),de=or(l);return de.addEventListener("resize",fe),()=>{fe.clear(),de.removeEventListener("resize",fe)}},[l,x,te]);let ae=O;O==="auto"&&!b.muiSupportAuto&&(ae=void 0);const xe=h||(l?Jt(pd(l)).body:void 0),Me=(o=$==null?void 0:$.root)!=null?o:K7,we=(i=$==null?void 0:$.paper)!=null?i:Vw,Y=ir({elementType:we,externalSlotProps:R({},A,{style:Z?A.style:R({},A.style,{opacity:0})}),additionalProps:{elevation:g,ref:j},ownerState:M,className:Te(D.paper,A==null?void 0:A.className)}),ve=ir({elementType:Me,externalSlotProps:(C==null?void 0:C.root)||{},externalForwardedProps:_,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:xe,open:x},ownerState:M,className:Te(D.root,p)}),{slotProps:ce}=ve,G=je(ve,U7);return m.jsx(Me,R({},G,!xc(Me)&&{slotProps:ce,disableScrollLock:T},{children:m.jsx(b,R({appear:!0,in:x,onEntering:le,onExited:re,timeout:ae},k,{children:m.jsx(we,R({},Y,{children:d}))}))}))}),of=q7;function X7(e){return qe("MuiMenu",e)}Xe("MuiMenu",["root","paper","list"]);const Y7=["onEntering"],Z7=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Q7={vertical:"top",horizontal:"right"},J7={vertical:"top",horizontal:"left"},e_=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"],list:["list"]},X7,t)},t_=be(of,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),n_=be(Vw,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),r_=be(z7,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),o_=y.forwardRef(function(t,n){var r,o;const i=Ye({props:t,name:"MuiMenu"}),{autoFocus:a=!0,children:s,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:f,open:d,PaperProps:p={},PopoverClasses:h,transitionDuration:g="auto",TransitionProps:{onEntering:v}={},variant:x="selectedMenu",slots:w={},slotProps:$={}}=i,C=je(i.TransitionProps,Y7),S=je(i,Z7),b=aa(),O=b.direction==="rtl",P=R({},i,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:u,onEntering:v,PaperProps:p,transitionDuration:g,TransitionProps:C,variant:x}),T=e_(P),k=a&&!c&&d,_=y.useRef(null),A=(F,Z)=>{_.current&&_.current.adjustStyleForScrollbar(F,b),v&&v(F,Z)},I=F=>{F.key==="Tab"&&(F.preventDefault(),f&&f(F,"tabKeyDown"))};let j=-1;y.Children.map(s,(F,Z)=>{y.isValidElement(F)&&(F.props.disabled||(x==="selectedMenu"&&F.props.selected||j===-1)&&(j=Z))});const M=(r=w.paper)!=null?r:n_,D=(o=$.paper)!=null?o:p,L=ir({elementType:w.root,externalSlotProps:$.root,ownerState:P,className:[T.root,l]}),B=ir({elementType:M,externalSlotProps:D,ownerState:P,className:T.paper});return m.jsx(t_,R({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:O?"right":"left"},transformOrigin:O?Q7:J7,slots:{paper:M,root:w.root},slotProps:{root:L,paper:B},open:d,ref:n,transitionDuration:g,TransitionProps:R({onEntering:A},C),ownerState:P},S,{classes:h,children:m.jsx(r_,R({onKeyDown:I,actions:_,autoFocus:a&&(j===-1||c),autoFocusItem:k,variant:x},u,{className:Te(T.list,u.className),children:s}))}))}),i_=o_;function a_(e){return qe("MuiNativeSelect",e)}const s_=Xe("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Ug=s_,l_=["className","disabled","error","IconComponent","inputRef","variant"],c_=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:a}=e,s={select:["select",n,r&&"disabled",o&&"multiple",a&&"error"],icon:["icon",`icon${ge(n)}`,i&&"iconOpen",r&&"disabled"]};return Ke(s,a_,t)},Hw=({ownerState:e,theme:t})=>R({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":R({},t.vars?{backgroundColor:`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:t.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Ug.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}),u_=be("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Pr,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${Ug.multiple}`]:t.multiple}]}})(Hw),Uw=({ownerState:e,theme:t})=>R({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${Ug.disabled}`]:{color:(t.vars||t).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),f_=be("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${ge(n.variant)}`],n.open&&t.iconOpen]}})(Uw),d_=y.forwardRef(function(t,n){const{className:r,disabled:o,error:i,IconComponent:a,inputRef:s,variant:l="standard"}=t,c=je(t,l_),u=R({},t,{disabled:o,variant:l,error:i}),f=c_(u);return m.jsxs(y.Fragment,{children:[m.jsx(u_,R({ownerState:u,className:Te(f.select,r),disabled:o,ref:s||n},c)),t.multiple?null:m.jsx(f_,{as:a,ownerState:u,className:f.icon})]})}),p_=d_;var w1;const h_=["children","classes","className","label","notched"],g_=be("fieldset",{shouldForwardProp:Pr})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),m_=be("legend",{shouldForwardProp:Pr})(({ownerState:e,theme:t})=>R({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})},e.withLabel&&R({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})})));function v_(e){const{className:t,label:n,notched:r}=e,o=je(e,h_),i=n!=null&&n!=="",a=R({},e,{notched:r,withLabel:i});return m.jsx(g_,R({"aria-hidden":!0,className:t,ownerState:a},o,{children:m.jsx(m_,{ownerState:a,children:i?m.jsx("span",{children:n}):w1||(w1=m.jsx("span",{className:"notranslate",children:"​"}))})}))}const y_=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],b_=e=>{const{classes:t}=e,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},IP,t);return R({},t,r)},x_=be(ef,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Qu})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return R({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${hr.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${hr.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${hr.focused} .${hr.notchedOutline}`]:{borderColor:(e.vars||e).palette[t.color].main,borderWidth:2},[`&.${hr.error} .${hr.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${hr.disabled} .${hr.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},t.startAdornment&&{paddingLeft:14},t.endAdornment&&{paddingRight:14},t.multiline&&R({padding:"16.5px 14px"},t.size==="small"&&{padding:"8.5px 14px"}))}),w_=be(v_,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),S_=be(tf,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:Ju})(({theme:e,ownerState:t})=>R({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{padding:"8.5px 14px"},t.multiline&&{padding:0},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0})),Gw=y.forwardRef(function(t,n){var r,o,i,a,s;const l=Ye({props:t,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:f="input",label:d,multiline:p=!1,notched:h,slots:g={},type:v="text"}=l,x=je(l,y_),w=b_(l),$=pa(),C=da({props:l,muiFormControl:$,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),S=R({},l,{color:C.color||"primary",disabled:C.disabled,error:C.error,focused:C.focused,formControl:$,fullWidth:u,hiddenLabel:C.hiddenLabel,multiline:p,size:C.size,type:v}),b=(r=(o=g.root)!=null?o:c.Root)!=null?r:x_,O=(i=(a=g.input)!=null?a:c.Input)!=null?i:S_;return m.jsx(nf,R({slots:{root:b,input:O},renderSuffix:P=>m.jsx(w_,{ownerState:S,className:w.notchedOutline,label:d!=null&&d!==""&&C.required?s||(s=m.jsxs(y.Fragment,{children:[d," ","*"]})):d,notched:typeof h<"u"?h:!!(P.startAdornment||P.filled||P.focused)}),fullWidth:u,inputComponent:f,multiline:p,ref:n,type:v},x,{classes:R({},w,{notchedOutline:null})}))});Gw.muiName="Input";const Kw=Gw;function $_(e){return qe("MuiSelect",e)}const C_=Xe("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Aa=C_;var S1;const O_=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],E_=be("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${Aa.select}`]:t.select},{[`&.${Aa.select}`]:t[n.variant]},{[`&.${Aa.error}`]:t.error},{[`&.${Aa.multiple}`]:t.multiple}]}})(Hw,{[`&.${Aa.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),P_=be("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${ge(n.variant)}`],n.open&&t.iconOpen]}})(Uw),__=be("input",{shouldForwardProp:e=>vO(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function $1(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function T_(e){return e==null||typeof e=="string"&&!e.trim()}const A_=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:a}=e,s={select:["select",n,r&&"disabled",o&&"multiple",a&&"error"],icon:["icon",`icon${ge(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ke(s,$_,t)},k_=y.forwardRef(function(t,n){var r;const{"aria-describedby":o,"aria-label":i,autoFocus:a,autoWidth:s,children:l,className:c,defaultOpen:u,defaultValue:f,disabled:d,displayEmpty:p,error:h=!1,IconComponent:g,inputRef:v,labelId:x,MenuProps:w={},multiple:$,name:C,onBlur:S,onChange:b,onClose:O,onFocus:P,onOpen:T,open:k,readOnly:_,renderValue:A,SelectDisplayProps:I={},tabIndex:j,value:M,variant:D="standard"}=t,L=je(t,O_),[B,F]=Qa({controlled:M,default:f,name:"Select"}),[Z,ie]=Qa({controlled:k,default:u,name:"Select"}),te=y.useRef(null),le=y.useRef(null),[re,ae]=y.useState(null),{current:xe}=y.useRef(k!=null),[Me,we]=y.useState(),Y=It(n,v),ve=y.useCallback(Oe=>{le.current=Oe,Oe&&ae(Oe)},[]),ce=re==null?void 0:re.parentNode;y.useImperativeHandle(Y,()=>({focus:()=>{le.current.focus()},node:te.current,value:B}),[B]),y.useEffect(()=>{u&&Z&&re&&!xe&&(we(s?null:ce.clientWidth),le.current.focus())},[re,s]),y.useEffect(()=>{a&&le.current.focus()},[a]),y.useEffect(()=>{if(!x)return;const Oe=Jt(le.current).getElementById(x);if(Oe){const Be=()=>{getSelection().isCollapsed&&le.current.focus()};return Oe.addEventListener("click",Be),()=>{Oe.removeEventListener("click",Be)}}},[x]);const G=(Oe,Be)=>{Oe?T&&T(Be):O&&O(Be),xe||(we(s?null:ce.clientWidth),ie(Oe))},fe=Oe=>{Oe.button===0&&(Oe.preventDefault(),le.current.focus(),G(!0,Oe))},de=Oe=>{G(!1,Oe)},pe=y.Children.toArray(l),se=Oe=>{const Be=pe.find(oe=>oe.props.value===Oe.target.value);Be!==void 0&&(F(Be.props.value),b&&b(Oe,Be))},Le=Oe=>Be=>{let oe;if(Be.currentTarget.hasAttribute("tabindex")){if($){oe=Array.isArray(B)?B.slice():[];const $e=B.indexOf(Oe.props.value);$e===-1?oe.push(Oe.props.value):oe.splice($e,1)}else oe=Oe.props.value;if(Oe.props.onClick&&Oe.props.onClick(Be),B!==oe&&(F(oe),b)){const $e=Be.nativeEvent||Be,Fe=new $e.constructor($e.type,$e);Object.defineProperty(Fe,"target",{writable:!0,value:{value:oe,name:C}}),b(Fe,Oe)}$||G(!1,Be)}},Ce=Oe=>{_||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Oe.key)!==-1&&(Oe.preventDefault(),G(!0,Oe))},Ge=re!==null&&Z,N=Oe=>{!Ge&&S&&(Object.defineProperty(Oe,"target",{writable:!0,value:{value:B,name:C}}),S(Oe))};delete L["aria-invalid"];let z,U;const W=[];let V=!1;(Ec({value:B})||p)&&(A?z=A(B):V=!0);const q=pe.map(Oe=>{if(!y.isValidElement(Oe))return null;let Be;if($){if(!Array.isArray(B))throw new Error(G2(2));Be=B.some(oe=>$1(oe,Oe.props.value)),Be&&V&&W.push(Oe.props.children)}else Be=$1(B,Oe.props.value),Be&&V&&(U=Oe.props.children);return y.cloneElement(Oe,{"aria-selected":Be?"true":"false",onClick:Le(Oe),onKeyUp:oe=>{oe.key===" "&&oe.preventDefault(),Oe.props.onKeyUp&&Oe.props.onKeyUp(oe)},role:"option",selected:Be,value:void 0,"data-value":Oe.props.value})});V&&($?W.length===0?z=null:z=W.reduce((Oe,Be,oe)=>(Oe.push(Be),oe{const{classes:t}=e;return t},Gg={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Pr(e)&&e!=="variant",slot:"Root"},D_=be(zw,Gg)(""),N_=be(Kw,Gg)(""),L_=be(Nw,Gg)(""),qw=y.forwardRef(function(t,n){const r=Ye({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:i,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=Mw,id:f,input:d,inputProps:p,label:h,labelId:g,MenuProps:v,multiple:x=!1,native:w=!1,onClose:$,onOpen:C,open:S,renderValue:b,SelectDisplayProps:O,variant:P="outlined"}=r,T=je(r,I_),k=w?p_:j_,_=pa(),A=da({props:r,muiFormControl:_,states:["variant","error"]}),I=A.variant||P,j=R({},r,{variant:I,classes:a}),M=R_(j),D=je(M,M_),L=d||{standard:m.jsx(D_,{ownerState:j}),outlined:m.jsx(N_,{label:h,ownerState:j}),filled:m.jsx(L_,{ownerState:j})}[I],B=It(n,L.ref);return m.jsx(y.Fragment,{children:y.cloneElement(L,R({inputComponent:k,inputProps:R({children:i,error:A.error,IconComponent:u,variant:I,type:void 0,multiple:x},w?{id:f}:{autoWidth:o,defaultOpen:l,displayEmpty:c,labelId:g,MenuProps:v,onClose:$,onOpen:C,open:S,renderValue:b,SelectDisplayProps:R({id:f},O)},p,{classes:p?Wu(D,p.classes):D},d?d.props.inputProps:{})},x&&w&&I==="outlined"?{notched:!0}:{},{ref:B,className:Te(L.props.className,s,M.root)},!d&&{variant:I},T))})});qw.muiName="Select";const B_=qw;function F_(e){return qe("MuiTab",e)}const z_=Xe("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),To=z_,W_=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],V_=e=>{const{classes:t,textColor:n,fullWidth:r,wrapped:o,icon:i,label:a,selected:s,disabled:l}=e,c={root:["root",i&&a&&"labelIcon",`textColor${ge(n)}`,r&&"fullWidth",o&&"wrapped",s&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return Ke(c,F_,t)},H_=be(ki,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${ge(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped]}})(({theme:e,ownerState:t})=>R({},e.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},t.label&&{flexDirection:t.iconPosition==="top"||t.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},t.icon&&t.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${To.iconWrapper}`]:R({},t.iconPosition==="top"&&{marginBottom:6},t.iconPosition==="bottom"&&{marginTop:6},t.iconPosition==="start"&&{marginRight:e.spacing(1)},t.iconPosition==="end"&&{marginLeft:e.spacing(1)})},t.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${To.selected}`]:{opacity:1},[`&.${To.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.textColor==="primary"&&{color:(e.vars||e).palette.text.secondary,[`&.${To.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${To.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.textColor==="secondary"&&{color:(e.vars||e).palette.text.secondary,[`&.${To.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${To.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},t.wrapped&&{fontSize:e.typography.pxToRem(12)})),U_=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTab"}),{className:o,disabled:i=!1,disableFocusRipple:a=!1,fullWidth:s,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:p,onFocus:h,selected:g,selectionFollowsFocus:v,textColor:x="inherit",value:w,wrapped:$=!1}=r,C=je(r,W_),S=R({},r,{disabled:i,disableFocusRipple:a,selected:g,icon:!!l,iconPosition:c,label:!!f,fullWidth:s,textColor:x,wrapped:$}),b=V_(S),O=l&&f&&y.isValidElement(l)?y.cloneElement(l,{className:Te(b.iconWrapper,l.props.className)}):l,P=k=>{!g&&d&&d(k,w),p&&p(k)},T=k=>{v&&!g&&d&&d(k,w),h&&h(k)};return m.jsxs(H_,R({focusRipple:!a,className:Te(b.root,o),ref:n,role:"tab","aria-selected":g,disabled:i,onClick:P,onFocus:T,ownerState:S,tabIndex:g?0:-1},C,{children:[c==="top"||c==="start"?m.jsxs(y.Fragment,{children:[O,f]}):m.jsxs(y.Fragment,{children:[f,O]}),u]}))}),G_=U_,K_=y.createContext(),Xw=K_;function q_(e){return qe("MuiTable",e)}Xe("MuiTable",["root","stickyHeader"]);const X_=["className","component","padding","size","stickyHeader"],Y_=e=>{const{classes:t,stickyHeader:n}=e;return Ke({root:["root",n&&"stickyHeader"]},q_,t)},Z_=be("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>R({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":R({},e.typography.body2,{padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},t.stickyHeader&&{borderCollapse:"separate"})),C1="table",Q_=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTable"}),{className:o,component:i=C1,padding:a="normal",size:s="medium",stickyHeader:l=!1}=r,c=je(r,X_),u=R({},r,{component:i,padding:a,size:s,stickyHeader:l}),f=Y_(u),d=y.useMemo(()=>({padding:a,size:s,stickyHeader:l}),[a,s,l]);return m.jsx(Xw.Provider,{value:d,children:m.jsx(Z_,R({as:i,role:i===C1?null:"table",ref:n,className:Te(f.root,o),ownerState:u},c))})}),af=Q_,J_=y.createContext(),sf=J_;function eT(e){return qe("MuiTableBody",e)}Xe("MuiTableBody",["root"]);const tT=["className","component"],nT=e=>{const{classes:t}=e;return Ke({root:["root"]},eT,t)},rT=be("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),oT={variant:"body"},O1="tbody",iT=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTableBody"}),{className:o,component:i=O1}=r,a=je(r,tT),s=R({},r,{component:i}),l=nT(s);return m.jsx(sf.Provider,{value:oT,children:m.jsx(rT,R({className:Te(l.root,o),as:i,ref:n,role:i===O1?null:"rowgroup",ownerState:s},a))})}),aT=iT;function sT(e){return qe("MuiTableCell",e)}const lT=Xe("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),cT=lT,uT=["align","className","component","padding","scope","size","sortDirection","variant"],fT=e=>{const{classes:t,variant:n,align:r,padding:o,size:i,stickyHeader:a}=e,s={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${ge(r)}`,o!=="normal"&&`padding${ge(o)}`,`size${ge(i)}`]};return Ke(s,sT,t)},dT=be("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${ge(n.size)}`],n.padding!=="normal"&&t[`padding${ge(n.padding)}`],n.align!=="inherit"&&t[`align${ge(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>R({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid - ${e.palette.mode==="light"?yO(gt(e.palette.divider,1),.88):bO(gt(e.palette.divider,1),.68)}`,textAlign:"left",padding:16},t.variant==="head"&&{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},t.variant==="body"&&{color:(e.vars||e).palette.text.primary},t.variant==="footer"&&{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},t.size==="small"&&{padding:"6px 16px",[`&.${cT.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},t.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},t.padding==="none"&&{padding:0},t.align==="left"&&{textAlign:"left"},t.align==="center"&&{textAlign:"center"},t.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},t.align==="justify"&&{textAlign:"justify"},t.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default})),pT=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTableCell"}),{align:o="inherit",className:i,component:a,padding:s,scope:l,size:c,sortDirection:u,variant:f}=r,d=je(r,uT),p=y.useContext(Xw),h=y.useContext(sf),g=h&&h.variant==="head";let v;a?v=a:v=g?"th":"td";let x=l;v==="td"?x=void 0:!x&&g&&(x="col");const w=f||h&&h.variant,$=R({},r,{align:o,component:v,padding:s||(p&&p.padding?p.padding:"normal"),size:c||(p&&p.size?p.size:"medium"),sortDirection:u,stickyHeader:w==="head"&&p&&p.stickyHeader,variant:w}),C=fT($);let S=null;return u&&(S=u==="asc"?"ascending":"descending"),m.jsx(dT,R({as:v,ref:n,className:Te(C.root,i),"aria-sort":S,scope:x,ownerState:$},d))}),hT=pT;function gT(e){return qe("MuiTableHead",e)}Xe("MuiTableHead",["root"]);const mT=["className","component"],vT=e=>{const{classes:t}=e;return Ke({root:["root"]},gT,t)},yT=be("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),bT={variant:"head"},E1="thead",xT=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTableHead"}),{className:o,component:i=E1}=r,a=je(r,mT),s=R({},r,{component:i}),l=vT(s);return m.jsx(sf.Provider,{value:bT,children:m.jsx(yT,R({as:i,className:Te(l.root,o),ref:n,role:i===E1?null:"rowgroup",ownerState:s},a))})}),Yw=xT,wT=ul(m.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),ST=ul(m.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function $T(e){return qe("MuiTableRow",e)}const CT=Xe("MuiTableRow",["root","selected","hover","head","footer"]),P1=CT,OT=["className","component","hover","selected"],ET=e=>{const{classes:t,selected:n,hover:r,head:o,footer:i}=e;return Ke({root:["root",n&&"selected",r&&"hover",o&&"head",i&&"footer"]},$T,t)},PT=be("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${P1.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${P1.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:gt(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:gt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}})),_1="tr",_T=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTableRow"}),{className:o,component:i=_1,hover:a=!1,selected:s=!1}=r,l=je(r,OT),c=y.useContext(sf),u=R({},r,{component:i,hover:a,selected:s,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),f=ET(u);return m.jsx(PT,R({as:i,ref:n,className:Te(f.root,o),role:i===_1?null:"row",ownerState:u},l))}),Ni=_T;function TT(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function AT(e,t,n,r={},o=()=>{}){const{ease:i=TT,duration:a=300}=r;let s=null;const l=t[e];let c=!1;const u=()=>{c=!0},f=d=>{if(c){o(new Error("Animation cancelled"));return}s===null&&(s=d);const p=Math.min(1,(d-s)/a);if(t[e]=i(p)*(n-l)+l,p>=1){requestAnimationFrame(()=>{o(null)});return}requestAnimationFrame(f)};return l===n?(o(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const kT=["onChange"],jT={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function IT(e){const{onChange:t}=e,n=je(e,kT),r=y.useRef(),o=y.useRef(null),i=()=>{r.current=o.current.offsetHeight-o.current.clientHeight};return Sr(()=>{const a=cl(()=>{const l=r.current;i(),l!==r.current&&t(r.current)}),s=or(o.current);return s.addEventListener("resize",a),()=>{a.clear(),s.removeEventListener("resize",a)}},[t]),y.useEffect(()=>{i(),t(r.current)},[t]),m.jsx("div",R({style:jT,ref:o},n))}function MT(e){return qe("MuiTabScrollButton",e)}const RT=Xe("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),DT=RT,NT=["className","slots","slotProps","direction","orientation","disabled"],LT=e=>{const{classes:t,orientation:n,disabled:r}=e;return Ke({root:["root",n,r&&"disabled"]},MT,t)},BT=be(ki,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})(({ownerState:e})=>R({width:40,flexShrink:0,opacity:.8,[`&.${DT.disabled}`]:{opacity:0}},e.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${e.isRtl?-90:90}deg)`}})),FT=y.forwardRef(function(t,n){var r,o;const i=Ye({props:t,name:"MuiTabScrollButton"}),{className:a,slots:s={},slotProps:l={},direction:c}=i,u=je(i,NT),d=aa().direction==="rtl",p=R({isRtl:d},i),h=LT(p),g=(r=s.StartScrollButtonIcon)!=null?r:wT,v=(o=s.EndScrollButtonIcon)!=null?o:ST,x=ir({elementType:g,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:p}),w=ir({elementType:v,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:p});return m.jsx(BT,R({component:"div",className:Te(h.root,a),ref:n,role:null,ownerState:p,tabIndex:null},u,{children:c==="left"?m.jsx(g,R({},x)):m.jsx(v,R({},w))}))}),zT=FT;function WT(e){return qe("MuiTabs",e)}const VT=Xe("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),hd=VT,HT=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],T1=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,A1=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,Hl=(e,t,n)=>{let r=!1,o=n(e,t);for(;o;){if(o===e.firstChild){if(r)return;r=!0}const i=o.disabled||o.getAttribute("aria-disabled")==="true";if(!o.hasAttribute("tabindex")||i)o=n(e,o);else{o.focus();return}}},UT=e=>{const{vertical:t,fixed:n,hideScrollbar:r,scrollableX:o,scrollableY:i,centered:a,scrollButtonsHideMobile:s,classes:l}=e;return Ke({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",o&&"scrollableX",i&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},WT,l)},GT=be("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${hd.scrollButtons}`]:t.scrollButtons},{[`& .${hd.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(({ownerState:e,theme:t})=>R({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},e.vertical&&{flexDirection:"column"},e.scrollButtonsHideMobile&&{[`& .${hd.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}})),KT=be("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})(({ownerState:e})=>R({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},e.fixed&&{overflowX:"hidden",width:"100%"},e.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},e.scrollableX&&{overflowX:"auto",overflowY:"hidden"},e.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),qT=be("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})(({ownerState:e})=>R({display:"flex"},e.vertical&&{flexDirection:"column"},e.centered&&{justifyContent:"center"})),XT=be("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(({ownerState:e,theme:t})=>R({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create()},e.indicatorColor==="primary"&&{backgroundColor:(t.vars||t).palette.primary.main},e.indicatorColor==="secondary"&&{backgroundColor:(t.vars||t).palette.secondary.main},e.vertical&&{height:"100%",width:2,right:0})),YT=be(IT)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),k1={},ZT=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTabs"}),o=aa(),i=o.direction==="rtl",{"aria-label":a,"aria-labelledby":s,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:p=!1,indicatorColor:h="primary",onChange:g,orientation:v="horizontal",ScrollButtonComponent:x=zT,scrollButtons:w="auto",selectionFollowsFocus:$,slots:C={},slotProps:S={},TabIndicatorProps:b={},TabScrollButtonProps:O={},textColor:P="primary",value:T,variant:k="standard",visibleScrollbar:_=!1}=r,A=je(r,HT),I=k==="scrollable",j=v==="vertical",M=j?"scrollTop":"scrollLeft",D=j?"top":"left",L=j?"bottom":"right",B=j?"clientHeight":"clientWidth",F=j?"height":"width",Z=R({},r,{component:d,allowScrollButtonsMobile:p,indicatorColor:h,orientation:v,vertical:j,scrollButtons:w,textColor:P,variant:k,visibleScrollbar:_,fixed:!I,hideScrollbar:I&&!_,scrollableX:I&&!j,scrollableY:I&&j,centered:c&&!I,scrollButtonsHideMobile:!p}),ie=UT(Z),te=ir({elementType:C.StartScrollButtonIcon,externalSlotProps:S.startScrollButtonIcon,ownerState:Z}),le=ir({elementType:C.EndScrollButtonIcon,externalSlotProps:S.endScrollButtonIcon,ownerState:Z}),[re,ae]=y.useState(!1),[xe,Me]=y.useState(k1),[we,Y]=y.useState(!1),[ve,ce]=y.useState(!1),[G,fe]=y.useState(!1),[de,pe]=y.useState({overflow:"hidden",scrollbarWidth:0}),se=new Map,Le=y.useRef(null),Ce=y.useRef(null),Ge=()=>{const oe=Le.current;let $e;if(oe){const Ve=oe.getBoundingClientRect();$e={clientWidth:oe.clientWidth,scrollLeft:oe.scrollLeft,scrollTop:oe.scrollTop,scrollLeftNormalized:hE(oe,o.direction),scrollWidth:oe.scrollWidth,top:Ve.top,bottom:Ve.bottom,left:Ve.left,right:Ve.right}}let Fe;if(oe&&T!==!1){const Ve=Ce.current.children;if(Ve.length>0){const et=Ve[se.get(T)];Fe=et?et.getBoundingClientRect():null}}return{tabsMeta:$e,tabMeta:Fe}},N=Sn(()=>{const{tabsMeta:oe,tabMeta:$e}=Ge();let Fe=0,Ve;if(j)Ve="top",$e&&oe&&(Fe=$e.top-oe.top+oe.scrollTop);else if(Ve=i?"right":"left",$e&&oe){const pt=i?oe.scrollLeftNormalized+oe.clientWidth-oe.scrollWidth:oe.scrollLeft;Fe=(i?-1:1)*($e[Ve]-oe[Ve]+pt)}const et={[Ve]:Fe,[F]:$e?$e[F]:0};if(isNaN(xe[Ve])||isNaN(xe[F]))Me(et);else{const pt=Math.abs(xe[Ve]-et[Ve]),Et=Math.abs(xe[F]-et[F]);(pt>=1||Et>=1)&&Me(et)}}),z=(oe,{animation:$e=!0}={})=>{$e?AT(M,Le.current,oe,{duration:o.transitions.duration.standard}):Le.current[M]=oe},U=oe=>{let $e=Le.current[M];j?$e+=oe:($e+=oe*(i?-1:1),$e*=i&&sw()==="reverse"?-1:1),z($e)},W=()=>{const oe=Le.current[B];let $e=0;const Fe=Array.from(Ce.current.children);for(let Ve=0;Veoe){Ve===0&&($e=oe);break}$e+=et[B]}return $e},V=()=>{U(-1*W())},q=()=>{U(W())},ue=y.useCallback(oe=>{pe({overflow:null,scrollbarWidth:oe})},[]),Ae=()=>{const oe={};oe.scrollbarSizeListener=I?m.jsx(YT,{onChange:ue,className:Te(ie.scrollableX,ie.hideScrollbar)}):null;const Fe=I&&(w==="auto"&&(we||ve)||w===!0);return oe.scrollButtonStart=Fe?m.jsx(x,R({slots:{StartScrollButtonIcon:C.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:te},orientation:v,direction:i?"right":"left",onClick:V,disabled:!we},O,{className:Te(ie.scrollButtons,O.className)})):null,oe.scrollButtonEnd=Fe?m.jsx(x,R({slots:{EndScrollButtonIcon:C.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:le},orientation:v,direction:i?"left":"right",onClick:q,disabled:!ve},O,{className:Te(ie.scrollButtons,O.className)})):null,oe},Se=Sn(oe=>{const{tabsMeta:$e,tabMeta:Fe}=Ge();if(!(!Fe||!$e)){if(Fe[D]<$e[D]){const Ve=$e[M]+(Fe[D]-$e[D]);z(Ve,{animation:oe})}else if(Fe[L]>$e[L]){const Ve=$e[M]+(Fe[L]-$e[L]);z(Ve,{animation:oe})}}}),ne=Sn(()=>{I&&w!==!1&&fe(!G)});y.useEffect(()=>{const oe=cl(()=>{Le.current&&N()});let $e;const Fe=pt=>{pt.forEach(Et=>{Et.removedNodes.forEach(Tn=>{var Gt;(Gt=$e)==null||Gt.unobserve(Tn)}),Et.addedNodes.forEach(Tn=>{var Gt;(Gt=$e)==null||Gt.observe(Tn)})}),oe(),ne()},Ve=or(Le.current);Ve.addEventListener("resize",oe);let et;return typeof ResizeObserver<"u"&&($e=new ResizeObserver(oe),Array.from(Ce.current.children).forEach(pt=>{$e.observe(pt)})),typeof MutationObserver<"u"&&(et=new MutationObserver(Fe),et.observe(Ce.current,{childList:!0})),()=>{var pt,Et;oe.clear(),Ve.removeEventListener("resize",oe),(pt=et)==null||pt.disconnect(),(Et=$e)==null||Et.disconnect()}},[N,ne]),y.useEffect(()=>{const oe=Array.from(Ce.current.children),$e=oe.length;if(typeof IntersectionObserver<"u"&&$e>0&&I&&w!==!1){const Fe=oe[0],Ve=oe[$e-1],et={root:Le.current,threshold:.99},pt=to=>{Y(!to[0].isIntersecting)},Et=new IntersectionObserver(pt,et);Et.observe(Fe);const Tn=to=>{ce(!to[0].isIntersecting)},Gt=new IntersectionObserver(Tn,et);return Gt.observe(Ve),()=>{Et.disconnect(),Gt.disconnect()}}},[I,w,G,u==null?void 0:u.length]),y.useEffect(()=>{ae(!0)},[]),y.useEffect(()=>{N()}),y.useEffect(()=>{Se(k1!==xe)},[Se,xe]),y.useImperativeHandle(l,()=>({updateIndicator:N,updateScrollButtons:ne}),[N,ne]);const Ze=m.jsx(XT,R({},b,{className:Te(ie.indicator,b.className),ownerState:Z,style:R({},xe,b.style)}));let St=0;const $t=y.Children.map(u,oe=>{if(!y.isValidElement(oe))return null;const $e=oe.props.value===void 0?St:oe.props.value;se.set($e,St);const Fe=$e===T;return St+=1,y.cloneElement(oe,R({fullWidth:k==="fullWidth",indicator:Fe&&!re&&Ze,selected:Fe,selectionFollowsFocus:$,onChange:g,textColor:P,value:$e},St===1&&T===!1&&!oe.props.tabIndex?{tabIndex:0}:{}))}),Oe=oe=>{const $e=Ce.current,Fe=Jt($e).activeElement;if(Fe.getAttribute("role")!=="tab")return;let et=v==="horizontal"?"ArrowLeft":"ArrowUp",pt=v==="horizontal"?"ArrowRight":"ArrowDown";switch(v==="horizontal"&&i&&(et="ArrowRight",pt="ArrowLeft"),oe.key){case et:oe.preventDefault(),Hl($e,Fe,A1);break;case pt:oe.preventDefault(),Hl($e,Fe,T1);break;case"Home":oe.preventDefault(),Hl($e,null,T1);break;case"End":oe.preventDefault(),Hl($e,null,A1);break}},Be=Ae();return m.jsxs(GT,R({className:Te(ie.root,f),ownerState:Z,ref:n,as:d},A,{children:[Be.scrollButtonStart,Be.scrollbarSizeListener,m.jsxs(KT,{className:ie.scroller,ownerState:Z,style:{overflow:de.overflow,[j?`margin${i?"Left":"Right"}`:"marginBottom"]:_?void 0:-de.scrollbarWidth},ref:Le,children:[m.jsx(qT,{"aria-label":a,"aria-labelledby":s,"aria-orientation":v==="vertical"?"vertical":null,className:ie.flexContainer,ownerState:Z,onKeyDown:Oe,ref:Ce,role:"tablist",children:$t}),re&&Ze]}),Be.scrollButtonEnd]}))}),QT=ZT;function JT(e){return qe("MuiTextField",e)}Xe("MuiTextField",["root"]);const eA=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],tA={standard:zw,filled:Nw,outlined:Kw},nA=e=>{const{classes:t}=e;return Ke({root:["root"]},JT,t)},rA=be(t7,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),oA=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:a,className:s,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:p=!1,helperText:h,id:g,InputLabelProps:v,inputProps:x,InputProps:w,inputRef:$,label:C,maxRows:S,minRows:b,multiline:O=!1,name:P,onBlur:T,onChange:k,onFocus:_,placeholder:A,required:I=!1,rows:j,select:M=!1,SelectProps:D,type:L,value:B,variant:F="outlined"}=r,Z=je(r,eA),ie=R({},r,{autoFocus:i,color:l,disabled:u,error:f,fullWidth:p,multiline:O,required:I,select:M,variant:F}),te=nA(ie),le={};F==="outlined"&&(v&&typeof v.shrink<"u"&&(le.notched=v.shrink),le.label=C),M&&((!D||!D.native)&&(le.id=void 0),le["aria-describedby"]=void 0);const re=Og(g),ae=h&&re?`${re}-helper-text`:void 0,xe=C&&re?`${re}-label`:void 0,Me=tA[F],we=m.jsx(Me,R({"aria-describedby":ae,autoComplete:o,autoFocus:i,defaultValue:c,fullWidth:p,multiline:O,name:P,rows:j,maxRows:S,minRows:b,type:L,value:B,id:re,inputRef:$,onBlur:T,onChange:k,onFocus:_,placeholder:A,inputProps:x},le,w));return m.jsxs(rA,R({className:Te(te.root,s),disabled:u,error:f,fullWidth:p,ref:n,required:I,color:l,variant:F,ownerState:ie},Z,{children:[C!=null&&C!==""&&m.jsx(A7,R({htmlFor:re,id:xe},v,{children:C})),M?m.jsx(B_,R({"aria-describedby":ae,id:re,labelId:xe,value:B,input:we},D,{children:a})):we,h&&m.jsx(c7,R({id:ae},d,{children:h}))]}))}),Kg=oA;function Ip(e){const t=new Date(Number(e)*1e3),n=t.getFullYear(),r=(1+t.getMonth()).toString().padStart(2,"0");return`${t.getDate().toString().padStart(2,"0")}/${r}/${n}`}function iA(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Zw(...e){return t=>e.forEach(n=>iA(n,t))}function ha(...e){return y.useCallback(Zw(...e),e)}const Qw=y.forwardRef((e,t)=>{const{children:n,...r}=e,o=y.Children.toArray(n),i=o.find(aA);if(i){const a=i.props.children,s=o.map(l=>l===i?y.Children.count(a)>1?y.Children.only(null):y.isValidElement(a)?a.props.children:null:l);return y.createElement(Mp,R({},r,{ref:t}),y.isValidElement(a)?y.cloneElement(a,void 0,s):null)}return y.createElement(Mp,R({},r,{ref:t}),n)});Qw.displayName="Slot";const Mp=y.forwardRef((e,t)=>{const{children:n,...r}=e;return y.isValidElement(n)?y.cloneElement(n,{...sA(r,n.props),ref:t?Zw(t,n.ref):n.ref}):y.Children.count(n)>1?y.Children.only(null):null});Mp.displayName="SlotClone";const Jw=({children:e})=>y.createElement(y.Fragment,null,e);function aA(e){return y.isValidElement(e)&&e.type===Jw}function sA(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const lA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Jo=lA.reduce((e,t)=>{const n=y.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Qw:t;return y.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),y.createElement(s,R({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function cA(e,t){e&&ia.flushSync(()=>e.dispatchEvent(t))}const uA=y.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?gi.createPortal(y.createElement(Jo.div,R({},o,{ref:t})),r):null}),fA=uA;var j1=Object.prototype.hasOwnProperty;function vs(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&vs(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(j1.call(e,n)&&++r&&!j1.call(t,n)||!(n in t)||!vs(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function hl(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r0;)a[s]=arguments[s+4];e.call(this,a),e.captureStackTrace&&e.captureStackTrace(this,t),this.rule=n,this.value=r,this.cause=o,this.target=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Or=function(t,n){t===void 0&&(t=[]),n===void 0&&(n=[]),this.chain=t,this.nextRuleModifiers=n};Or.prototype._applyRule=function(t,n){var r=this;return function(){for(var o=[],i=arguments.length;i--;)o[i]=arguments[i];return r.chain.push(new lf(n,t.apply(r,o),o,r.nextRuleModifiers)),r.nextRuleModifiers=[],r}};Or.prototype._applyModifier=function(t,n){return this.nextRuleModifiers.push(new dA(n,t.simple,t.async)),this};Or.prototype._clone=function(){return new Or(this.chain.slice(),this.nextRuleModifiers.slice())};Or.prototype.test=function(t){return this.chain.every(function(n){return n._test(t)})};Or.prototype.testAll=function(t){var n=[];return this.chain.forEach(function(r){try{r._check(t)}catch(o){n.push(new qg(r,t,o))}}),n};Or.prototype.check=function(t){this.chain.forEach(function(n){try{n._check(t)}catch(r){throw new qg(n,t,r)}})};Or.prototype.testAsync=function(t){var n=this;return new Promise(function(r,o){n3(t,n.chain.slice(),r,o)})};function n3(e,t,n,r){if(t.length){var o=t.shift();o._testAsync(e).then(function(){n3(e,t,n,r)},function(i){r(new qg(o,e,i))})}else n(e)}var I1=function(e,t){return t&&typeof e=="string"&&e.trim().length===0?!0:e==null};function pA(e,t){return t===void 0&&(t=!1),{simple:function(n){return I1(n,t)||e.check(n)===void 0},async:function(n){return I1(n,t)||e.testAsync(n)}}}function un(){return typeof Proxy<"u"?r3(new Or):Rp(new Or)}var ys={};un.extend=function(e){Object.assign(ys,e)};un.clearCustomRules=function(){ys={}};function r3(e){return new Proxy(e,{get:function(n,r){if(r in n)return n[r];var o=r3(e._clone());if(r in Pc)return o._applyModifier(Pc[r],r);if(r in ys)return o._applyRule(ys[r],r);if(r in Dp)return o._applyRule(Dp[r],r)}})}function Rp(e){var t=function(o,i){return Object.keys(o).forEach(function(a){i[a]=function(){for(var s=[],l=arguments.length;l--;)s[l]=arguments[l];var c=Rp(i._clone()),u=c._applyRule(o[a],a).apply(void 0,s);return u}}),i},n=t(Dp,e),r=t(ys,n);return Object.keys(Pc).forEach(function(o){Object.defineProperty(r,o,{get:function(){var i=Rp(r._clone());return i._applyModifier(Pc[o],o)}})}),r}var Pc={not:{simple:function(e){return function(t){return!e(t)}},async:function(e){return function(t){return Promise.resolve(e(t)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(e){return function(t){return Ul(t).some(function(n){try{return e(n)}catch{return!1}})}},async:function(e){return function(t){return Promise.all(Ul(t).map(function(n){try{return e(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(e){return function(t){return t!==!1&&Ul(t).every(e)}},async:function(e){return function(t){return Promise.all(Ul(t).map(e)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(e,t){return function(n){return M1(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&e(n):e(n)}},async:function(e,t){return function(n){return Promise.resolve(e(n)).then(function(r){return M1(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&r:r}).catch(function(){return!1})}}}};function M1(e){return e&&e.name==="schema"&&e.args.length>0&&typeof e.args[0]=="object"}function Ul(e){return typeof e=="string"?e.split(""):e}var Dp={equal:function(e){return function(t){return t==e}},exact:function(e){return function(t){return t===e}},number:function(e){return e===void 0&&(e=!0),function(t){return typeof t=="number"&&(e||isFinite(t))}},integer:function(){return function(e){var t=Number.isInteger||hA;return t(e)}},numeric:function(){return function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},string:function(){return si("string")},boolean:function(){return si("boolean")},undefined:function(){return si("undefined")},null:function(){return si("null")},array:function(){return si("array")},object:function(){return si("object")},instanceOf:function(e){return function(t){return t instanceof e}},pattern:function(e){return function(t){return e.test(t)}},lowercase:function(){return function(e){return typeof e=="boolean"||e===e.toLowerCase()&&e.trim()!==""}},uppercase:function(){return function(e){return e===e.toUpperCase()&&e.trim()!==""}},vowel:function(){return function(e){return/^[aeiou]+$/i.test(e)}},consonant:function(){return function(e){return/^(?=[^aeiou])([a-z]+)$/i.test(e)}},first:function(e){return function(t){return t[0]==e}},last:function(e){return function(t){return t[t.length-1]==e}},empty:function(){return function(e){return e.length===0}},length:function(e,t){return function(n){return n.length>=e&&n.length<=(t||e)}},minLength:function(e){return function(t){return t.length>=e}},maxLength:function(e){return function(t){return t.length<=e}},negative:function(){return function(e){return e<0}},positive:function(){return function(e){return e>=0}},between:function(e,t){return function(n){return n>=e&&n<=t}},range:function(e,t){return function(n){return n>=e&&n<=t}},lessThan:function(e){return function(t){return te}},greaterThanOrEqual:function(e){return function(t){return t>=e}},even:function(){return function(e){return e%2===0}},odd:function(){return function(e){return e%2!==0}},includes:function(e){return function(t){return~t.indexOf(e)}},schema:function(e){return gA(e)},passesAnyOf:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(n){return e.some(function(r){return r.test(n)})}},optional:pA};function si(e){return function(t){return Array.isArray(t)&&e==="array"||t===null&&e==="null"||typeof t===e}}function hA(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function gA(e){return{simple:function(t){var n=[];if(Object.keys(e).forEach(function(r){var o=e[r];try{o.check((t||{})[r])}catch(i){i.target=r,n.push(i)}}),n.length>0)throw n;return!0},async:function(t){var n=[],r=Object.keys(e).map(function(o){var i=e[o];return i.testAsync((t||{})[o]).catch(function(a){a.target=o,n.push(a)})});return Promise.all(r).then(function(){if(n.length>0)throw n;return!0})}}}var it="colors",tn="sizes",_e="space",mA={gap:_e,gridGap:_e,columnGap:_e,gridColumnGap:_e,rowGap:_e,gridRowGap:_e,inset:_e,insetBlock:_e,insetBlockEnd:_e,insetBlockStart:_e,insetInline:_e,insetInlineEnd:_e,insetInlineStart:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,marginBlock:_e,marginBlockEnd:_e,marginBlockStart:_e,marginInline:_e,marginInlineEnd:_e,marginInlineStart:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,paddingBlock:_e,paddingBlockEnd:_e,paddingBlockStart:_e,paddingInline:_e,paddingInlineEnd:_e,paddingInlineStart:_e,top:_e,right:_e,bottom:_e,left:_e,scrollMargin:_e,scrollMarginTop:_e,scrollMarginRight:_e,scrollMarginBottom:_e,scrollMarginLeft:_e,scrollMarginX:_e,scrollMarginY:_e,scrollMarginBlock:_e,scrollMarginBlockEnd:_e,scrollMarginBlockStart:_e,scrollMarginInline:_e,scrollMarginInlineEnd:_e,scrollMarginInlineStart:_e,scrollPadding:_e,scrollPaddingTop:_e,scrollPaddingRight:_e,scrollPaddingBottom:_e,scrollPaddingLeft:_e,scrollPaddingX:_e,scrollPaddingY:_e,scrollPaddingBlock:_e,scrollPaddingBlockEnd:_e,scrollPaddingBlockStart:_e,scrollPaddingInline:_e,scrollPaddingInlineEnd:_e,scrollPaddingInlineStart:_e,fontSize:"fontSizes",background:it,backgroundColor:it,backgroundImage:it,borderImage:it,border:it,borderBlock:it,borderBlockEnd:it,borderBlockStart:it,borderBottom:it,borderBottomColor:it,borderColor:it,borderInline:it,borderInlineEnd:it,borderInlineStart:it,borderLeft:it,borderLeftColor:it,borderRight:it,borderRightColor:it,borderTop:it,borderTopColor:it,caretColor:it,color:it,columnRuleColor:it,fill:it,outline:it,outlineColor:it,stroke:it,textDecorationColor:it,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:tn,minBlockSize:tn,maxBlockSize:tn,inlineSize:tn,minInlineSize:tn,maxInlineSize:tn,width:tn,minWidth:tn,maxWidth:tn,height:tn,minHeight:tn,maxHeight:tn,flexBasis:tn,gridTemplateColumns:tn,gridTemplateRows:tn,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},vA=(e,t)=>typeof t=="function"?{"()":Function.prototype.toString.call(t)}:t,ga=()=>{const e=Object.create(null);return(t,n,...r)=>{const o=(i=>JSON.stringify(i,vA))(t);return o in e?e[o]:e[o]=n(t,...r)}},Vo=Symbol.for("sxs.internal"),Xg=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),R1=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:yA}=Object.prototype,Np=e=>e.includes("-")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase()),bA=/\s+(?![^()]*\))/,li=e=>t=>e(...typeof t=="string"?String(t).split(bA):[t]),D1={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:li((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e})),marginInline:li((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e})),maxSize:li((e,t)=>({maxBlockSize:e,maxInlineSize:t||e})),minSize:li((e,t)=>({minBlockSize:e,minInlineSize:t||e})),paddingBlock:li((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e})),paddingInline:li((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e}))},gd=/([\d.]+)([^]*)/,xA=(e,t)=>e.length?e.reduce((n,r)=>(n.push(...t.map(o=>o.includes("&")?o.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(o)?`:is(${r})`:r):r+" "+o)),n),[]):t,wA=(e,t)=>e in SA&&typeof t=="string"?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,r,o,i)=>r+(o==="stretch"?`-moz-available${i};${Np(e)}:${r}-webkit-fill-available`:`-moz-fit-content${i};${Np(e)}:${r}fit-content`)+i):String(t),SA={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Ur=e=>e?e+"-":"",o3=(e,t,n)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(r,o,i,a,s)=>a=="$"==!!i?r:(o||a=="--"?"calc(":"")+"var(--"+(a==="$"?Ur(t)+(s.includes("$")?"":Ur(n))+s.replace(/\$/g,"-"):s)+")"+(o||a=="--"?"*"+(o||"")+(i||"1")+")":"")),$A=/\s*,\s*(?![^()]*\))/,CA=Object.prototype.toString,mi=(e,t,n,r,o)=>{let i,a,s;const l=(c,u,f)=>{let d,p;const h=g=>{for(d in g){const w=d.charCodeAt(0)===64,$=w&&Array.isArray(g[d])?g[d]:[g[d]];for(p of $){const C=/[A-Z]/.test(x=d)?x:x.replace(/-[^]/g,b=>b[1].toUpperCase()),S=typeof p=="object"&&p&&p.toString===CA&&(!r.utils[C]||!u.length);if(C in r.utils&&!S){const b=r.utils[C];if(b!==a){a=b,h(b(p)),a=null;continue}}else if(C in D1){const b=D1[C];if(b!==s){s=b,h(b(p)),s=null;continue}}if(w&&(v=d.slice(1)in r.media?"@media "+r.media[d.slice(1)]:d,d=v.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(b,O,P,T,k,_)=>{const A=gd.test(O),I=.0625*(A?-1:1),[j,M]=A?[T,O]:[O,T];return"("+(P[0]==="="?"":P[0]===">"===A?"max-":"min-")+j+":"+(P[0]!=="="&&P.length===1?M.replace(gd,(D,L,B)=>Number(L)+I*(P===">"?1:-1)+B):M)+(k?") and ("+(k[0]===">"?"min-":"max-")+j+":"+(k.length===1?_.replace(gd,(D,L,B)=>Number(L)+I*(k===">"?-1:1)+B):_):"")+")"})),S){const b=w?f.concat(d):[...f],O=w?[...u]:xA(u,d.split($A));i!==void 0&&o(N1(...i)),i=void 0,l(p,O,b)}else i===void 0&&(i=[[],u,f]),d=w||d.charCodeAt(0)!==36?d:`--${Ur(r.prefix)}${d.slice(1).replace(/\$/g,"-")}`,p=S?p:typeof p=="number"?p&&C in OA?String(p)+"px":String(p):o3(wA(C,p??""),r.prefix,r.themeMap[C]),i[0].push(`${w?`${d} `:`${Np(d)}:`}${p}`)}}var v,x};h(c),i!==void 0&&o(N1(...i)),i=void 0};l(e,t,n)},N1=(e,t,n)=>`${n.map(r=>`${r}{`).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,OA={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},L1=e=>String.fromCharCode(e+(e>25?39:97)),Ho=e=>(t=>{let n,r="";for(n=Math.abs(t);n>52;n=n/52|0)r=L1(n%52)+r;return L1(n%52)+r})(((t,n)=>{let r=n.length;for(;r;)t=33*t^n.charCodeAt(--r);return t})(5381,JSON.stringify(e))>>>0),Ka=["themed","global","styled","onevar","resonevar","allvar","inline"],EA=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch{return!1}},PA=e=>{let t;const n=()=>{const{cssRules:o}=t.sheet;return[].map.call(o,(i,a)=>{const{cssText:s}=i;let l="";if(s.startsWith("--sxs"))return"";if(o[a-1]&&(l=o[a-1].cssText).startsWith("--sxs")){if(!i.cssRules.length)return"";for(const c in t.rules)if(t.rules[c].group===i)return`--sxs{--sxs:${[...t.rules[c].cache].join(" ")}}${s}`;return i.cssRules.length?`${l}${s}`:""}return s}).join("")},r=()=>{if(t){const{rules:s,sheet:l}=t;if(!l.deleteRule){for(;Object(Object(l.cssRules)[0]).type===3;)l.cssRules.splice(0,1);l.cssRules=[]}for(const c in s)delete s[c]}const o=Object(e).styleSheets||[];for(const s of o)if(EA(s)){for(let l=0,c=s.cssRules;c[l];++l){const u=Object(c[l]);if(u.type!==1)continue;const f=Object(c[l+1]);if(f.type!==4)continue;++l;const{cssText:d}=u;if(!d.startsWith("--sxs"))continue;const p=d.slice(14,-3).trim().split(/\s+/),h=Ka[p[0]];h&&(t||(t={sheet:s,reset:r,rules:{},toString:n}),t.rules[h]={group:f,index:l,cache:new Set(p)})}if(t)break}if(!t){const s=(l,c)=>({type:c,cssRules:[],insertRule(u,f){this.cssRules.splice(f,0,s(u,{import:3,undefined:1}[(u.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return l==="@media{}"?`@media{${[].map.call(this.cssRules,u=>u.cssText).join("")}}`:l}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:s("","text/css"),rules:{},reset:r,toString:n}}const{sheet:i,rules:a}=t;for(let s=Ka.length-1;s>=0;--s){const l=Ka[s];if(!a[l]){const c=Ka[s+1],u=a[c]?a[c].index:i.cssRules.length;i.insertRule("@media{}",u),i.insertRule(`--sxs{--sxs:${s}}`,u),a[l]={group:i.cssRules[u+1],index:u,cache:new Set([s])}}_A(a[l])}};return r(),t},_A=e=>{const t=e.group;let n=t.cssRules.length;e.apply=r=>{try{t.insertRule(r,n),++n}catch{}}},ka=Symbol(),TA=ga(),B1=(e,t)=>TA(e,()=>(...n)=>{let r={type:null,composers:new Set};for(const o of n)if(o!=null)if(o[Vo]){r.type==null&&(r.type=o[Vo].type);for(const i of o[Vo].composers)r.composers.add(i)}else o.constructor!==Object||o.$$typeof?r.type==null&&(r.type=o):r.composers.add(AA(o,e));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),kA(e,r,t)}),AA=({variants:e,compoundVariants:t,defaultVariants:n,...r},o)=>{const i=`${Ur(o.prefix)}c-${Ho(r)}`,a=[],s=[],l=Object.create(null),c=[];for(const d in n)l[d]=String(n[d]);if(typeof e=="object"&&e)for(const d in e){u=l,f=d,yA.call(u,f)||(l[d]="undefined");const p=e[d];for(const h in p){const g={[d]:String(h)};String(h)==="undefined"&&c.push(d);const v=p[h],x=[g,v,!R1(v)];a.push(x)}}var u,f;if(typeof t=="object"&&t)for(const d of t){let{css:p,...h}=d;p=typeof p=="object"&&p||{};for(const v in h)h[v]=String(h[v]);const g=[h,p,!R1(p)];s.push(g)}return[i,r,a,s,l,c]},kA=(e,t,n)=>{const[r,o,i,a]=jA(t.composers),s=typeof t.type=="function"||t.type.$$typeof?(f=>{function d(){for(let p=0;pd.rules[p]={apply:h=>d[ka].push([p,h])}),d})(n):null,l=(s||n).rules,c=`.${r}${o.length>1?`:where(.${o.slice(1).join(".")})`:""}`,u=f=>{f=typeof f=="object"&&f||IA;const{css:d,...p}=f,h={};for(const x in i)if(delete p[x],x in f){let w=f[x];typeof w=="object"&&w?h[x]={"@initial":i[x],...w}:(w=String(w),h[x]=w!=="undefined"||a.has(x)?w:i[x])}else h[x]=i[x];const g=new Set([...o]);for(const[x,w,$,C]of t.composers){n.rules.styled.cache.has(x)||(n.rules.styled.cache.add(x),mi(w,[`.${x}`],[],e,O=>{l.styled.apply(O)}));const S=F1($,h,e.media),b=F1(C,h,e.media,!0);for(const O of S)if(O!==void 0)for(const[P,T,k]of O){const _=`${x}-${Ho(T)}-${P}`;g.add(_);const A=(k?n.rules.resonevar:n.rules.onevar).cache,I=k?l.resonevar:l.onevar;A.has(_)||(A.add(_),mi(T,[`.${_}`],[],e,j=>{I.apply(j)}))}for(const O of b)if(O!==void 0)for(const[P,T]of O){const k=`${x}-${Ho(T)}-${P}`;g.add(k),n.rules.allvar.cache.has(k)||(n.rules.allvar.cache.add(k),mi(T,[`.${k}`],[],e,_=>{l.allvar.apply(_)}))}}if(typeof d=="object"&&d){const x=`${r}-i${Ho(d)}-css`;g.add(x),n.rules.inline.cache.has(x)||(n.rules.inline.cache.add(x),mi(d,[`.${x}`],[],e,w=>{l.inline.apply(w)}))}for(const x of String(f.className||"").trim().split(/\s+/))x&&g.add(x);const v=p.className=[...g].join(" ");return{type:t.type,className:v,selector:c,props:p,toString:()=>v,deferredInjector:s}};return Xg(u,{className:r,selector:c,[Vo]:t,toString:()=>(n.rules.styled.cache.has(r)||u(),r)})},jA=e=>{let t="";const n=[],r={},o=[];for(const[i,,,,a,s]of e){t===""&&(t=i),n.push(i),o.push(...s);for(const l in a){const c=a[l];(r[l]===void 0||c!=="undefined"||s.includes(c))&&(r[l]=c)}}return[t,n,r,new Set(o)]},F1=(e,t,n,r)=>{const o=[];e:for(let[i,a,s]of e){if(s)continue;let l,c=0,u=!1;for(l in i){const f=i[l];let d=t[l];if(d!==f){if(typeof d!="object"||!d)continue e;{let p,h,g=0;for(const v in d){if(f===String(d[v])){if(v!=="@initial"){const x=v.slice(1);(h=h||[]).push(x in n?n[x]:v.replace(/^@media ?/,"")),u=!0}c+=g,p=!0}++g}if(h&&h.length&&(a={["@media "+h.join(", ")]:a}),!p)continue e}}}(o[c]=o[c]||[]).push([r?"cv":`${l}-${i[l]}`,a,u])}return o},IA={},MA=ga(),RA=(e,t)=>MA(e,()=>(...n)=>{const r=()=>{for(let o of n){o=typeof o=="object"&&o||{};let i=Ho(o);if(!t.rules.global.cache.has(i)){if(t.rules.global.cache.add(i),"@import"in o){let a=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let s of[].concat(o["@import"]))s=s.includes('"')||s.includes("'")?s:`"${s}"`,t.sheet.insertRule(`@import ${s};`,a++);delete o["@import"]}mi(o,[],[],e,a=>{t.rules.global.apply(a)})}}return""};return Xg(r,{toString:r})}),DA=ga(),NA=(e,t)=>DA(e,()=>n=>{const r=`${Ur(e.prefix)}k-${Ho(n)}`,o=()=>{if(!t.rules.global.cache.has(r)){t.rules.global.cache.add(r);const i=[];mi(n,[],[],e,s=>i.push(s));const a=`@keyframes ${r}{${i.join("")}}`;t.rules.global.apply(a)}return r};return Xg(o,{get name(){return o()},toString:o})}),LA=class{constructor(e,t,n,r){this.token=e==null?"":String(e),this.value=t==null?"":String(t),this.scale=n==null?"":String(n),this.prefix=r==null?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Ur(this.prefix)+Ur(this.scale)+this.token}toString(){return this.computedValue}},BA=ga(),FA=(e,t)=>BA(e,()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const o=`.${n=(n=typeof n=="string"?n:"")||`${Ur(e.prefix)}t-${Ho(r)}`}`,i={},a=[];for(const l in r){i[l]={};for(const c in r[l]){const u=`--${Ur(e.prefix)}${l}-${c}`,f=o3(String(r[l][c]),e.prefix,l);i[l][c]=new LA(c,f,l,e.prefix),a.push(`${u}:${f}`)}}const s=()=>{if(a.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);const l=`${r===e.theme?":root,":""}.${n}{${a.join(";")}}`;t.rules.themed.apply(l)}return n};return{...i,get className(){return s()},selector:o,toString:s}}),zA=ga(),z1,WA=ga(),i3=e=>{const t=(n=>{let r=!1;const o=zA(n,i=>{r=!0;const a="prefix"in(i=typeof i=="object"&&i||{})?String(i.prefix):"",s=typeof i.media=="object"&&i.media||{},l=typeof i.root=="object"?i.root||null:globalThis.document||null,c=typeof i.theme=="object"&&i.theme||{},u={prefix:a,media:s,theme:c,themeMap:typeof i.themeMap=="object"&&i.themeMap||{...mA},utils:typeof i.utils=="object"&&i.utils||{}},f=PA(l),d={css:B1(u,f),globalCss:RA(u,f),keyframes:NA(u,f),createTheme:FA(u,f),reset(){f.reset(),d.theme.toString()},theme:{},sheet:f,config:u,prefix:a,getCssText:f.toString,toString:f.toString};return String(d.theme=d.createTheme(c)),d});return r||o.reset(),o})(e);return t.styled=(({config:n,sheet:r})=>WA(n,()=>{const o=B1(n,r);return(...i)=>{const a=o(...i),s=a[Vo].type,l=E.forwardRef((c,u)=>{const f=c&&c.as||s,{props:d,deferredInjector:p}=a(c);return delete d.as,d.ref=u,p?E.createElement(E.Fragment,null,E.createElement(f,d),E.createElement(p,null)):E.createElement(f,d)});return l.className=a.className,l.displayName=`Styled.${s.displayName||s.name||s}`,l.selector=a.selector,l.toString=()=>a.selector,l[Vo]=a[Vo],l}}))(t),t},VA=()=>z1||(z1=i3()),aue=(...e)=>VA().styled(...e);function HA(e,t,n){return Math.max(t,Math.min(e,n))}const Qt={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function W1(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function V1(e,t,n,r=.15){return r===0?HA(e,t,n):en?+W1(e-n,n-t,r)+n:e}function UA(e,[t,n],[r,o]){const[[i,a],[s,l]]=e;return[V1(t,i,a,r),V1(n,s,l,o)]}function GA(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KA(e){var t=GA(e,"string");return typeof t=="symbol"?t:String(t)}function cn(e,t,n){return t=KA(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function tk(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function l3(e){return cf(e)?tk(e)[0]:e}function nk(e){return ek(e).map(t=>t.identifier)}function md(e){const t=l3(e);return cf(e)?t.identifier:t.pointerId}function G1(e){const t=l3(e);return[t.clientX,t.clientY]}function rk(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}function _c(e,...t){return typeof e=="function"?e(...t):e}function ok(){}function ik(...e){return e.length===0?ok:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function K1(e,t){return Object.assign({},t,e||{})}const ak=32;class sk{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:o}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=o,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?_c(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:o}=this;n.args=this.args;let i=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,rk(t)),o.down=o.pressed=o.buttons%2===1||o.touches>0,i=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const b=n._delta.map(Math.abs);Qt.addTo(n._distance,b)}this.axisIntent&&this.axisIntent(t);const[a,s]=n._movement,[l,c]=r.threshold,{_step:u,values:f}=n;if(r.hasCustomTransform?(u[0]===!1&&(u[0]=Math.abs(a)>=l&&f[0]),u[1]===!1&&(u[1]=Math.abs(s)>=c&&f[1])):(u[0]===!1&&(u[0]=Math.abs(a)>=l&&Math.sign(a)*l),u[1]===!1&&(u[1]=Math.abs(s)>=c&&Math.sign(s)*c)),n.intentional=u[0]!==!1||u[1]!==!1,!n.intentional)return;const d=[0,0];if(r.hasCustomTransform){const[b,O]=f;d[0]=u[0]!==!1?b-u[0]:0,d[1]=u[1]!==!1?O-u[1]:0}else d[0]=u[0]!==!1?a-u[0]:0,d[1]=u[1]!==!1?s-u[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(d);const p=n.offset,h=n._active&&!n._blocked||n.active;h&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=_c(r.bounds,n)),this.setup&&this.setup()),n.movement=d,this.computeOffset()));const[g,v]=n.offset,[[x,w],[$,C]]=n._bounds;n.overflow=[gw?1:0,v<$?-1:v>C?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const S=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=UA(n._bounds,n.offset,S),n.delta=Qt.sub(n.offset,p),this.computeMovement(),h&&(!n.last||i>ak)){n.delta=Qt.sub(n.offset,p);const b=n.delta.map(Math.abs);Qt.addTo(n.distance,b),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&i>0&&(n.velocity=[b[0]/i,b[1]/i],n.timeDelta=i)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const o=this.handler(wt(wt(wt({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function lk([e,t],n){const r=Math.abs(e),o=Math.abs(t);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class ck extends sk{constructor(...t){super(...t),cn(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=Qt.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=Qt.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const o=typeof r.axisThreshold=="object"?r.axisThreshold[s3(t)]:r.axisThreshold;n.axis=lk(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const uk=e=>e,q1=.15,c3={enabled(e=!0){return e},eventOptions(e,t,n){return wt(wt({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[q1,q1];case!1:return[0,0];default:return Qt.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return Qt.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||uk},threshold(e){return Qt.toVector(e,0)}},fk=0,gl=wt(wt({},c3),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=fk){return e},bounds(e={}){if(typeof e=="function")return i=>gl.bounds(e(i));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),X1={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class dk extends ck{constructor(...t){super(...t),cn(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=gl.bounds(o)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const o=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=md(t),r._pointerActive=!0,this.computeValues(G1(t)),this.computeInitial(),n.preventScrollAxis&&s3(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const o=md(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const i=G1(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=Qt.sub(i,n._values),this.computeValues(i)),Qt.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=md(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[i,a]=n._distance;if(n.tap=i<=r.tapsThreshold&&a<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[s,l]=n._delta,[c,u]=n._movement,[f,d]=r.swipe.velocity,[p,h]=r.swipe.distance,g=r.swipe.duration;if(n.elapsedTimef&&Math.abs(c)>p&&(n.swipe[0]=Math.sign(s)),x>d&&Math.abs(u)>h&&(n.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,pk(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=X1[t.key];if(n){const r=this.state,o=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,Qt.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in X1&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function pk(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const ml=typeof window<"u"&&window.document&&window.document.createElement;function u3(){return ml&&"ontouchstart"in window}function hk(){return u3()||ml&&window.navigator.maxTouchPoints>1}function gk(){return ml&&"onpointerdown"in window}function mk(){return ml&&"exitPointerLock"in window.document}function vk(){try{return"constructor"in GestureEvent}catch{return!1}}const Mn={isBrowser:ml,gesture:vk(),touch:u3(),touchscreen:hk(),pointer:gk(),pointerLock:mk()},yk=250,bk=180,xk=.5,wk=50,Sk=250,$k=10,Y1={mouse:0,touch:0,pen:8},Ck=wt(wt({},gl),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Mn.pointerLock,Mn.touch&&n?"touch":this.pointerLock?"mouse":Mn.pointer&&!o?"pointer":Mn.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?yk:void 0,!(!Mn.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const i=Qt.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=xk,distance:t=wk,duration:n=Sk}={}){return{velocity:this.transform(Qt.toVector(e)),distance:this.transform(Qt.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return bk;case!1:return 0;default:return e}},axisThreshold(e){return e?wt(wt({},Y1),e):Y1},keyboardDisplacement(e=$k){return e}});wt(wt({},c3),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Mn.touch&&Mn.gesture)return"gesture";if(Mn.touch&&r)return"touch";if(Mn.touchscreen){if(Mn.pointer)return"pointer";if(Mn.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=a=>{const s=K1(_c(n,a),{min:-1/0,max:1/0});return[s.min,s.max]},i=a=>{const s=K1(_c(r,a),{min:-1/0,max:1/0});return[s.min,s.max]};return typeof n!="function"&&typeof r!="function"?[o(),i()]:a=>[o(a),i(a)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",Qt.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});wt(wt({},gl),{},{mouseOnly:(e=!0)=>e});wt(wt({},gl),{},{mouseOnly:(e=!0)=>e});const f3=new Map,Lp=new Map;function Ok(e){f3.set(e.key,e.engine),Lp.set(e.key,e.resolver)}const Ek={key:"drag",engine:dk,resolver:Ck};function Pk(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function _k(e,t){if(e==null)return{};var n=Pk(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const Tk={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Mn.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},Ak=["target","eventOptions","window","enabled","transform"];function pc(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=pc(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function kk(e,t,n={}){const r=e,{target:o,eventOptions:i,window:a,enabled:s,transform:l}=r,c=_k(r,Ak);if(n.shared=pc({target:o,eventOptions:i,window:a,enabled:s,transform:l},Tk),t){const u=Lp.get(t);n[t]=pc(wt({shared:n.shared},c),u)}else for(const u in c){const f=Lp.get(u);f&&(n[u]=pc(wt({shared:n.shared},c[u]),f))}return n}class d3{constructor(t,n){cn(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,i){const a=this._listeners,s=JA(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=wt(wt({},l),i);t.addEventListener(s,o,c);const u=()=>{t.removeEventListener(s,o,c),a.delete(u)};return a.add(u),u}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class jk{constructor(){cn(this,"_timeouts",new Map)}add(t,n,r=140,...o){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...o))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}let Ik=class{constructor(t){cn(this,"gestures",new Set),cn(this,"_targetEventStore",new d3(this)),cn(this,"gestureEventStores",{}),cn(this,"gestureTimeoutStores",{}),cn(this,"handlers",{}),cn(this,"config",{}),cn(this,"pointerIds",new Set),cn(this,"touchIds",new Set),cn(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Mk(this,t)}setEventIds(t){if(cf(t))return this.touchIds=new Set(nk(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=kk(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let o;if(!(n.target&&(o=n.target(),!o))){if(n.enabled){for(const a of this.gestures){const s=this.config[a],l=Z1(r,s.eventOptions,!!o);if(s.enabled){const c=f3.get(a);new c(this,t,a).bind(l)}}const i=Z1(r,n.eventOptions,!!o);for(const a in this.nativeHandlers)i(a,"",s=>this.nativeHandlers[a](wt(wt({},this.state.shared),{},{event:s,args:t})),void 0,!0)}for(const i in r)r[i]=ik(...r[i]);if(!o)return r;for(const i in r){const{device:a,capture:s,passive:l}=QA(i);this._targetEventStore.add(o,a,"",r[i],{capture:s,passive:l})}}}};function ci(e,t){e.gestures.add(t),e.gestureEventStores[t]=new d3(e,t),e.gestureTimeoutStores[t]=new jk}function Mk(e,t){t.drag&&ci(e,"drag"),t.wheel&&ci(e,"wheel"),t.scroll&&ci(e,"scroll"),t.move&&ci(e,"move"),t.pinch&&ci(e,"pinch"),t.hover&&ci(e,"hover")}const Z1=(e,t,n)=>(r,o,i,a={},s=!1)=>{var l,c;const u=(l=a.capture)!==null&&l!==void 0?l:t.capture,f=(c=a.passive)!==null&&c!==void 0?c:t.passive;let d=s?r:YA(r,o,u);n&&f&&(d+="Passive"),e[d]=e[d]||[],e[d].push(i)};function Rk(e,t={},n,r){const o=E.useMemo(()=>new Ik(e),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),E.useEffect(o.effect.bind(o)),E.useEffect(()=>o.clean.bind(o),[]),t.target===void 0)return o.bind.bind(o)}function Dk(e,t){return Ok(Ek),Rk({drag:e},t||{},"drag")}function kr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function p3(e,t=[]){let n=[];function r(i,a){const s=y.createContext(a),l=n.length;n=[...n,a];function c(f){const{scope:d,children:p,...h}=f,g=(d==null?void 0:d[e][l])||s,v=y.useMemo(()=>h,Object.values(h));return y.createElement(g.Provider,{value:v},p)}function u(f,d){const p=(d==null?void 0:d[e][l])||s,h=y.useContext(p);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>y.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,Nk(o,...t)]}function Nk(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...s,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function ma(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Lk(e,t=globalThis==null?void 0:globalThis.document){const n=ma(e);y.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Bp="dismissableLayer.update",Bk="dismissableLayer.pointerDownOutside",Fk="dismissableLayer.focusOutside";let Q1;const zk=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wk=y.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=y.useContext(zk),[f,d]=y.useState(null),p=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=y.useState({}),g=ha(t,P=>d(P)),v=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(x),$=f?v.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=$>=w,b=Vk(P=>{const T=P.target,k=[...u.branches].some(_=>_.contains(T));!S||k||(i==null||i(P),s==null||s(P),P.defaultPrevented||l==null||l())},p),O=Hk(P=>{const T=P.target;[...u.branches].some(_=>_.contains(T))||(a==null||a(P),s==null||s(P),P.defaultPrevented||l==null||l())},p);return Lk(P=>{$===u.layers.size-1&&(o==null||o(P),!P.defaultPrevented&&l&&(P.preventDefault(),l()))},p),y.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Q1=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),J1(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Q1)}},[f,p,r,u]),y.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),J1())},[f,u]),y.useEffect(()=>{const P=()=>h({});return document.addEventListener(Bp,P),()=>document.removeEventListener(Bp,P)},[]),y.createElement(Jo.div,R({},c,{ref:g,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:kr(e.onFocusCapture,O.onFocusCapture),onBlurCapture:kr(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:kr(e.onPointerDownCapture,b.onPointerDownCapture)}))});function Vk(e,t=globalThis==null?void 0:globalThis.document){const n=ma(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let c=function(){h3(Bk,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Hk(e,t=globalThis==null?void 0:globalThis.document){const n=ma(e),r=y.useRef(!1);return y.useEffect(()=>{const o=i=>{i.target&&!r.current&&h3(Fk,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function J1(){const e=new CustomEvent(Bp);document.dispatchEvent(e)}function h3(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?cA(o,i):o.dispatchEvent(i)}const Li=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},Uk=U2["useId".toString()]||(()=>{});let Gk=0;function Kk(e){const[t,n]=y.useState(Uk());return Li(()=>{e||n(r=>r??String(Gk++))},[e]),e||(t?`radix-${t}`:"")}const qk=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return y.createElement(Jo.svg,R({},i,{ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:y.createElement("polygon",{points:"0,0 30,0 15,10"}))}),Xk=qk;function Yk(e){const[t,n]=y.useState(void 0);return Li(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const g3="Popper",[m3,v3]=p3(g3),[Zk,y3]=m3(g3),Qk=e=>{const{__scopePopper:t,children:n}=e,[r,o]=y.useState(null);return y.createElement(Zk,{scope:t,anchor:r,onAnchorChange:o},n)},Jk="PopperAnchor",ej=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=y3(Jk,n),a=y.useRef(null),s=ha(t,a);return y.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:y.createElement(Jo.div,R({},o,{ref:s}))}),b3="PopperContent",[tj,nj]=m3(b3),rj=y.forwardRef((e,t)=>{var n,r,o,i,a,s,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:p="center",alignOffset:h=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:w=0,sticky:$="partial",hideWhenDetached:C=!1,updatePositionStrategy:S="optimized",onPlaced:b,...O}=e,P=y3(b3,u),[T,k]=y.useState(null),_=ha(t,pe=>k(pe)),[A,I]=y.useState(null),j=Yk(A),M=(n=j==null?void 0:j.width)!==null&&n!==void 0?n:0,D=(r=j==null?void 0:j.height)!==null&&r!==void 0?r:0,L=f+(p!=="center"?"-"+p:""),B=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},F=Array.isArray(x)?x:[x],Z=F.length>0,ie={padding:B,boundary:F.filter(sj),altBoundary:Z},{refs:te,floatingStyles:le,placement:re,isPositioned:ae,middlewareData:xe}=Z4({strategy:"fixed",placement:L,whileElementsMounted:(...pe)=>q4(...pe,{animationFrame:S==="always"}),elements:{reference:P.anchor},middleware:[P4({mainAxis:d+D,alignmentAxis:h}),v&&_4({mainAxis:!0,crossAxis:!1,limiter:$==="partial"?T4():void 0,...ie}),v&&C4({...ie}),A4({...ie,apply:({elements:pe,rects:se,availableWidth:Le,availableHeight:Ce})=>{const{width:Ge,height:N}=se.reference,z=pe.floating.style;z.setProperty("--radix-popper-available-width",`${Le}px`),z.setProperty("--radix-popper-available-height",`${Ce}px`),z.setProperty("--radix-popper-anchor-width",`${Ge}px`),z.setProperty("--radix-popper-anchor-height",`${N}px`)}}),A&&Y4({element:A,padding:g}),lj({arrowWidth:M,arrowHeight:D}),C&&O4({strategy:"referenceHidden",...ie})]}),[Me,we]=x3(re),Y=ma(b);Li(()=>{ae&&(Y==null||Y())},[ae,Y]);const ve=(o=xe.arrow)===null||o===void 0?void 0:o.x,ce=(i=xe.arrow)===null||i===void 0?void 0:i.y,G=((a=xe.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[fe,de]=y.useState();return Li(()=>{T&&de(window.getComputedStyle(T).zIndex)},[T]),y.createElement("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:ae?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(s=xe.transformOrigin)===null||s===void 0?void 0:s.x,(l=xe.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},y.createElement(tj,{scope:u,placedSide:Me,onArrowChange:I,arrowX:ve,arrowY:ce,shouldHideArrow:G},y.createElement(Jo.div,R({"data-side":Me,"data-align":we},O,{ref:_,style:{...O.style,animation:ae?void 0:"none",opacity:(c=xe.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))}),oj="PopperArrow",ij={top:"bottom",right:"left",bottom:"top",left:"right"},aj=y.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=nj(oj,r),a=ij[i.placedSide];return y.createElement("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},y.createElement(Xk,R({},o,{ref:n,style:{...o.style,display:"block"}})))});function sj(e){return e!==null}const lj=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,d=f?0:e.arrowWidth,p=f?0:e.arrowHeight,[h,g]=x3(s),v={start:"0%",center:"50%",end:"100%"}[g],x=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+d/2,w=((i=(a=c.arrow)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0)+p/2;let $="",C="";return h==="bottom"?($=f?v:`${x}px`,C=`${-p}px`):h==="top"?($=f?v:`${x}px`,C=`${l.floating.height+p}px`):h==="right"?($=`${-p}px`,C=f?v:`${w}px`):h==="left"&&($=`${l.floating.width+p}px`,C=f?v:`${w}px`),{data:{x:$,y:C}}}});function x3(e){const[t,n="center"]=e.split("-");return[t,n]}const cj=Qk,uj=ej,fj=rj,dj=aj;function pj(e,t){return y.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const w3=e=>{const{present:t,children:n}=e,r=hj(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=ha(r.ref,o.ref);return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:i}):null};w3.displayName="Presence";function hj(e){const[t,n]=y.useState(),r=y.useRef({}),o=y.useRef(e),i=y.useRef("none"),a=e?"mounted":"unmounted",[s,l]=pj(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=Gl(r.current);i.current=s==="mounted"?c:"none"},[s]),Li(()=>{const c=r.current,u=o.current;if(u!==e){const d=i.current,p=Gl(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&d!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Li(()=>{if(t){const c=f=>{const p=Gl(r.current).includes(f.animationName);f.target===t&&p&&ia.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=Gl(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Gl(e){return(e==null?void 0:e.animationName)||"none"}function gj({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=mj({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=ma(n),l=y.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&s(f)}else o(c)},[i,e,o,s]);return[a,l]}function mj({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,o=y.useRef(r),i=ma(t);return y.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const vj=y.forwardRef((e,t)=>y.createElement(Jo.span,R({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),yj=vj,[uf,lue]=p3("Tooltip",[v3]),ff=v3(),bj="TooltipProvider",Fp="tooltip.open",[cue,Yg]=uf(bj),Zg="Tooltip",[xj,df]=uf(Zg),wj=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=Yg(Zg,e.__scopeTooltip),c=ff(t),[u,f]=y.useState(null),d=Kk(),p=y.useRef(0),h=a??l.disableHoverableContent,g=s??l.delayDuration,v=y.useRef(!1),[x=!1,w]=gj({prop:r,defaultProp:o,onChange:O=>{O?(l.onOpen(),document.dispatchEvent(new CustomEvent(Fp))):l.onClose(),i==null||i(O)}}),$=y.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),C=y.useCallback(()=>{window.clearTimeout(p.current),v.current=!1,w(!0)},[w]),S=y.useCallback(()=>{window.clearTimeout(p.current),w(!1)},[w]),b=y.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,w(!0)},g)},[g,w]);return y.useEffect(()=>()=>window.clearTimeout(p.current),[]),y.createElement(cj,c,y.createElement(xj,{scope:t,contentId:d,open:x,stateAttribute:$,trigger:u,onTriggerChange:f,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?b():C()},[l.isOpenDelayed,b,C]),onTriggerLeave:y.useCallback(()=>{h?S():window.clearTimeout(p.current)},[S,h]),onOpen:C,onClose:S,disableHoverableContent:h},n))},e0="TooltipTrigger",Sj=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=df(e0,n),i=Yg(e0,n),a=ff(n),s=y.useRef(null),l=ha(t,s,o.onTriggerChange),c=y.useRef(!1),u=y.useRef(!1),f=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),y.createElement(uj,R({asChild:!0},a),y.createElement(Jo.button,R({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:kr(e.onPointerMove,d=>{d.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:kr(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:kr(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:kr(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:kr(e.onBlur,o.onClose),onClick:kr(e.onClick,o.onClose)})))}),$j="TooltipPortal",[uue,Cj]=uf($j,{forceMount:void 0}),bs="TooltipContent",Oj=y.forwardRef((e,t)=>{const n=Cj(bs,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=df(bs,e.__scopeTooltip);return y.createElement(w3,{present:r||a.open},a.disableHoverableContent?y.createElement(S3,R({side:o},i,{ref:t})):y.createElement(Ej,R({side:o},i,{ref:t})))}),Ej=y.forwardRef((e,t)=>{const n=df(bs,e.__scopeTooltip),r=Yg(bs,e.__scopeTooltip),o=y.useRef(null),i=ha(t,o),[a,s]=y.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,d=y.useCallback(()=>{s(null),f(!1)},[f]),p=y.useCallback((h,g)=>{const v=h.currentTarget,x={x:h.clientX,y:h.clientY},w=kj(x,v.getBoundingClientRect()),$=jj(x,w),C=Ij(g.getBoundingClientRect()),S=Rj([...$,...C]);s(S),f(!0)},[f]);return y.useEffect(()=>()=>d(),[d]),y.useEffect(()=>{if(l&&u){const h=v=>p(v,u),g=v=>p(v,l);return l.addEventListener("pointerleave",h),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",g)}}},[l,u,p,d]),y.useEffect(()=>{if(a){const h=g=>{const v=g.target,x={x:g.clientX,y:g.clientY},w=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),$=!Mj(x,a);w?d():$&&(d(),c())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[l,u,a,c,d]),y.createElement(S3,R({},e,{ref:i}))}),[Pj,_j]=uf(Zg,{isInside:!1}),S3=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=df(bs,n),c=ff(n),{onClose:u}=l;return y.useEffect(()=>(document.addEventListener(Fp,u),()=>document.removeEventListener(Fp,u)),[u]),y.useEffect(()=>{if(l.trigger){const f=d=>{const p=d.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),y.createElement(Wk,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:u},y.createElement(fj,R({"data-state":l.stateAttribute},c,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),y.createElement(Jw,null,r),y.createElement(Pj,{scope:n,isInside:!0},y.createElement(yj,{id:l.contentId,role:"tooltip"},o||r))))}),Tj="TooltipArrow",Aj=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ff(n);return _j(Tj,n).isInside?null:y.createElement(dj,R({},o,r,{ref:t}))});function kj(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function jj(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ij(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Mj(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;ir!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function Rj(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),Dj(t)}function Dj(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const Nj=wj,Lj=Sj,Bj=Oj,Fj=Aj;function zj(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function st(e,t){if(e==null)return{};var n=zj(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}let xt;(function(e){e[e.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",e[e.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",e[e.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",e[e.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",e[e.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",e[e.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",e[e.THEME_ERROR=6]="THEME_ERROR",e[e.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",e[e.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",e[e.EMPTY_KEY=9]="EMPTY_KEY"})(xt||(xt={}));const Wj={[xt.UNSUPPORTED_INPUT]:(e,t)=>[`An input with type \`${e}\` input was found at path \`${t}\` but it's not supported yet.`],[xt.NO_COMPONENT_FOR_TYPE]:(e,t)=>[`Type \`${e}\` found at path \`${t}\` can't be displayed in panel because no component supports it yet.`],[xt.UNKNOWN_INPUT]:(e,t)=>[`input at path \`${e}\` is not recognized.`,t],[xt.DUPLICATE_KEYS]:(e,t,n)=>[`Key \`${e}\` of path \`${t}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[xt.ALREADY_REGISTERED_TYPE]:e=>[`Type ${e} has already been registered. You can't register a component with the same type.`],[xt.CLIPBOARD_ERROR]:e=>["Error copying the value",e],[xt.THEME_ERROR]:(e,t)=>[`Error accessing the theme \`${e}.${t}\` value.`],[xt.PATH_DOESNT_EXIST]:e=>[`Error getting the value at path \`${e}\`. There is probably an error in your \`render\` function.`],[xt.PATH_DOESNT_EXIST]:e=>[`Error accessing the value at path \`${e}\``],[xt.INPUT_TYPE_OVERRIDE]:(e,t,n)=>[`Input at path \`${e}\` already exists with type: \`${t}\`. Its type cannot be overridden with type \`${n}\`.`],[xt.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function $3(e,t,...n){const[r,...o]=Wj[t](...n);console[e]("LEVA: "+r,...o)}const jr=$3.bind(null,"warn"),Vj=$3.bind(null,"log"),Hj=["value"],Uj=["schema"],Gj=["value"],C3=[],Yo={};function t0(e){let{value:t}=e,n=st(e,Hj);for(let r of C3){const o=r(t,n);if(o)return o}}function Jr(e,t){let{schema:n}=t,r=st(t,Uj);if(e in Yo){jr(xt.ALREADY_REGISTERED_TYPE,e);return}C3.push((o,i)=>n(o,i)&&e),Yo[e]=r}function vd(e,t,n,r){const{normalize:o}=Yo[e];if(o)return o(t,n,r);if(typeof t!="object"||!("value"in t))return{value:t};const{value:i}=t,a=st(t,Gj);return{value:i,settings:a}}function Kj(e,t,n,r,o,i){const{sanitize:a}=Yo[e];return a?a(t,n,r,o,i):t}function n0(e,t,n){const{format:r}=Yo[e];return r?r(t,n):t}function qj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ne(e){for(var t=1;te>n?n:e{if(e===""||typeof e=="number")return e;try{const t=io(e);if(!isNaN(t))return t}catch{}return parseFloat(e)},Yj=Math.log(10);function o0(e){let t=Math.abs(+String(e).replace(".",""));if(t===0)return .01;for(;t!==0&&t%10===0;)t/=10;const n=Math.floor(Math.log(t)/Yj)+1,r=Math.floor(Math.log10(Math.abs(e))),o=Math.pow(10,r-n);return Math.max(o,.001)}const Tc=(e,t,n)=>n===t?0:(So(e,t,n)-t)/(n-t),Ac=(e,t,n)=>e*(n-t)+t,Zj=()=>"_"+Math.random().toString(36).substr(2,9),i0=/\(([0-9+\-*/^ .]+)\)/,a0=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,s0=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,l0=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,c0=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,u0=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function io(e){if(isNaN(Number(e)))if(i0.test(e)){const t=e.replace(i0,(n,r)=>String(io(r)));return io(t)}else if(a0.test(e)){const t=e.replace(a0,(n,r,o)=>String(Math.pow(Number(r),Number(o))));return io(t)}else if(s0.test(e)){const t=e.replace(s0,(n,r,o)=>String(Number(r)*Number(o)));return io(t)}else if(l0.test(e)){const t=e.replace(l0,(n,r,o)=>{if(o!=0)return String(Number(r)/Number(o));throw new Error("Division by zero")});return io(t)}else if(c0.test(e)){const t=e.replace(c0,(n,r,o)=>String(Number(r)+Number(o)));return io(t)}else if(u0.test(e)){const t=e.replace(u0,(n,r,o)=>String(Number(r)-Number(o)));return io(t)}else return Number(e);return Number(e)}function Qj(e,t){return t.reduce((n,r)=>(e&&e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}function Jj(e,t){const n=Ne({},e);return t.forEach(r=>r in e&&delete n[r]),n}function eI(e,t){return e.reduce((n,r,o)=>Object.assign(n,{[t[o]]:r}),{})}function O3(e){return Object.prototype.toString.call(e)==="[object Object]"}const tI=e=>O3(e)&&Object.keys(e).length===0;let rr;(function(e){e.BUTTON="BUTTON",e.BUTTON_GROUP="BUTTON_GROUP",e.MONITOR="MONITOR",e.FOLDER="FOLDER"})(rr||(rr={}));let ar;(function(e){e.SELECT="SELECT",e.IMAGE="IMAGE",e.NUMBER="NUMBER",e.COLOR="COLOR",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.INTERVAL="INTERVAL",e.VECTOR3D="VECTOR3D",e.VECTOR2D="VECTOR2D"})(ar||(ar={}));const nI=["type","__customInput"],rI=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],oI=["type"];function E3(e,t,n={},r){var o,i;if(typeof e!="object"||Array.isArray(e))return{type:r,input:e,options:Ne({key:t,label:t,optional:!1,disabled:!1,order:0},n)};if("__customInput"in e){const{type:S,__customInput:b}=e,O=st(e,nI);return E3(b,t,O,S)}const{render:a,label:s,optional:l,order:c=0,disabled:u,hint:f,onChange:d,onEditStart:p,onEditEnd:h,transient:g}=e,v=st(e,rI),x=Ne({render:a,key:t,label:s??t,hint:f,transient:g??!!d,onEditStart:p,onEditEnd:h,disabled:u,optional:l,order:c},n);let{type:w}=v,$=st(v,oI);if(w=r??w,w in rr)return{type:w,input:$,options:x};let C;return r&&O3($)&&"value"in $?C=$.value:C=tI($)?void 0:$,{type:w,input:C,options:Ne(Ne({},x),{},{onChange:d,optional:(o=x.optional)!==null&&o!==void 0?o:!1,disabled:(i=x.disabled)!==null&&i!==void 0?i:!1})}}function iI(e,t,n,r){const o=E3(e,t),{type:i,input:a,options:s}=o;if(i)return i in rr?o:{type:i,input:vd(i,a,n,r),options:s};let l=t0(a);return l?{type:l,input:vd(l,a,n,r),options:s}:(l=t0({value:a}),l?{type:l,input:vd(l,{value:a},n,r),options:s}:!1)}function f0(e,t,n,r,o){const{value:i,type:a,settings:s}=e;e.value=P3({type:a,value:i,settings:s},t,n,r),e.fromPanel=o}const aI=function(t,n,r){this.type="LEVA_ERROR",this.message="LEVA: "+t,this.previousValue=n,this.error=r};function P3({type:e,value:t,settings:n},r,o,i){const a=e!=="SELECT"&&typeof r=="function"?r(t):r;let s;try{s=Kj(e,a,n,t,o,i)}catch(l){throw new aI(`The value \`${r}\` did not result in a correct value.`,t,l)}return vs(s,t)?t:s}const _3=(e,t,n=!1)=>{let r=0;return function(){const o=arguments,i=n&&!r,a=()=>e.apply(this,o);window.clearTimeout(r),r=window.setTimeout(a,t),i&&a()}},T3=e=>e.shiftKey?5:e.altKey?1/5:1;function sI(e,t){const n=console.error;console.error=()=>{},gi.render(e,t),console.error=n}const lI=["value"],cI=["min","max"],uI=e=>{if(typeof e=="number")return!0;if(typeof e=="string"){const t=parseFloat(e);return isNaN(t)?!1:e.substring((""+t).length).trim().length<4}return!1},A3=(e,{min:t=-1/0,max:n=1/0,suffix:r})=>{const o=parseFloat(e);if(e===""||isNaN(o))throw Error("Invalid number");const i=So(o,t,n);return r?i+r:i},fI=(e,{pad:t=0,suffix:n})=>{const r=parseFloat(e).toFixed(t);return n?r+n:r},k3=e=>{let{value:t}=e,n=st(e,lI);const{min:r=-1/0,max:o=1/0}=n,i=st(n,cI);let a=parseFloat(t);const s=typeof t=="string"?t.substring((""+a).length):void 0;a=So(a,r,o);let l=n.step;l||(Number.isFinite(r)?Number.isFinite(o)?l=+(Math.abs(o-r)/100).toPrecision(1):l=+(Math.abs(a-r)/100).toPrecision(1):Number.isFinite(o)&&(l=+(Math.abs(o-a)/100).toPrecision(1)));const c=l?o0(l)*10:o0(a);l=l||c/10;const u=Math.round(So(Math.log10(1/c),0,2));return{value:s?a+s:a,settings:Ne({initialValue:a,step:l,pad:u,min:r,max:o,suffix:s},i)}},j3=(e,{step:t,initialValue:n})=>{const r=Math.round((e-n)/t);return n+r*t};var I3=Object.freeze({__proto__:null,schema:uI,sanitize:A3,format:fI,normalize:k3,sanitizeStep:j3});function Ot(){return Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function Kl(e,t){const[n,r]=e.split(" "),o={};return n!=="none"&&(o.boxShadow=`${t.inset?"inset ":""}0 0 0 $borderWidths${[t.key]} $colors${n!=="default"&&n||t.borderColor}`),r&&(o.backgroundColor=r),o}const ja={$inputStyle:()=>e=>Kl(e,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>e=>Kl(e,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>e=>Kl(e,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>e=>Kl(e,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:De,css:fue,createTheme:pI,globalCss:hI,keyframes:due}=i3({prefix:"leva",theme:N3(),utils:Ne(Ne({},ja),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:e=>({"&:focus":ja.$focusStyle()(e)}),$focusWithin:e=>({"&:focus-within":ja.$focusStyle()(e)}),$hover:e=>({"&:hover":ja.$hoverStyle()(e)}),$active:e=>({"&:active":ja.$activeStyle()(e)})})}),gI=hI({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function mI(e){const t=N3();if(!e)return{theme:t,className:""};Object.keys(e).forEach(r=>{Object.assign(t[r],e[r])});const n=pI(t);return{theme:t,className:n.className}}function Lr(e,t){const{theme:n}=y.useContext(Qg);if(!(e in n)||!(t in n[e]))return jr(xt.THEME_ERROR,e,t),"";let r=t;for(;;){let o=n[e][r];if(typeof o=="string"&&o.charAt(0)==="$")r=o.substr(1);else return o}}const L3=De("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),B3=De("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${L3}`]:{paddingLeft:0}}),vI=De(B3,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),yI=De("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),bI=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],xI=["onUpdate"];function Jg(e){let{innerLabel:t,value:n,onUpdate:r,onChange:o,onKeyDown:i,type:a,id:s,inputType:l="text",rows:c=0}=e,u=st(e,bI);const{id:f,emitOnEditStart:d,emitOnEditEnd:p,disabled:h}=en(),g=s||f,v=y.useRef(null),x=c>0,w=x?"textarea":"input",$=y.useCallback(b=>O=>{const P=O.currentTarget.value;b(P)},[]);E.useEffect(()=>{const b=v.current,O=$(P=>{r(P),p()});return b==null||b.addEventListener("blur",O),()=>b==null?void 0:b.removeEventListener("blur",O)},[$,r,p]);const C=y.useCallback(b=>{b.key==="Enter"&&$(r)(b)},[$,r]),S=Object.assign({as:w},x?{rows:c}:{},u);return E.createElement(yI,{textArea:x},t&&typeof t=="string"?E.createElement(B3,null,t):t,E.createElement(L3,Ot({levaType:a,ref:v,id:g,type:l,autoComplete:"off",spellCheck:"false",value:n,onChange:$(o),onFocus:()=>d(),onKeyPress:C,onKeyDown:i,disabled:h},S)))}function wI(e){let{onUpdate:t}=e,n=st(e,xI);const r=y.useCallback(i=>t(Xj(i)),[t]),o=y.useCallback(i=>{const a=i.key==="ArrowUp"?1:i.key==="ArrowDown"?-1:0;if(a){i.preventDefault();const s=i.altKey?.1:i.shiftKey?10:1;t(l=>parseFloat(l)+a*s)}},[t]);return E.createElement(Jg,Ot({},n,{onUpdate:r,onKeyDown:o,type:"number"}))}const kc=De("div",{}),zp=De("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),SI=De("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${zp}::after`]:{opacity:.6},[`${kc}:hover > & + ${zp}::after`]:{opacity:.6},[`${kc}:hover > & > svg`]:{opacity:1}}),F3=De("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${kc}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),z3=De("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${F3} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),W3=De(z3,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),$I=De("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),CI=De("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),Wp=De("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),OI=De("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${Wp}`]:{pointerEvents:"auto"}}}}}),V3=De("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),EI=De("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),PI=De(Fj,{fill:"$toolTipBackground"});function em({children:e}){const{className:t}=y.useContext(Qg);return E.createElement(fA,{className:t},e)}const _I=["align"];function TI(){const{id:e,disable:t,disabled:n}=en();return E.createElement(E.Fragment,null,E.createElement(CI,{id:e+"__disable",type:"checkbox",checked:!n,onChange:()=>t(!n)}),E.createElement("label",{htmlFor:e+"__disable"}))}function AI(e){const{id:t,optional:n,hint:r}=en(),o=e.htmlFor||(t?{htmlFor:t}:null),i=!r&&typeof e.children=="string"?{title:e.children}:null;return E.createElement(E.Fragment,null,n&&E.createElement(TI,null),r!==void 0?E.createElement(Nj,null,E.createElement(Lj,{asChild:!0},E.createElement(Wp,Ot({},o,e))),E.createElement(Bj,{side:"top",sideOffset:2},E.createElement(EI,null,r,E.createElement(PI,null)))):E.createElement(Wp,Ot({},o,i,e)))}function lr(e){let{align:t}=e,n=st(e,_I);const{value:r,label:o,key:i,disabled:a}=en(),{hideCopyButton:s}=dI(),l=!s&&i!==void 0,[c,u]=y.useState(!1),f=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[i]:r??""})),u(!0)}catch{jr(xt.CLIPBOARD_ERROR,{[i]:r})}};return E.createElement($I,{align:t,onPointerLeave:()=>u(!1)},E.createElement(AI,n),l&&!a&&E.createElement("div",{title:`Click to copy ${typeof o=="string"?o:i} value`},c?E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},E.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),E.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):E.createElement("svg",{onClick:f,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},E.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),E.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const kI=["toggled"],jI=De("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function tm(e){let{toggled:t}=e,n=st(e,kI);return E.createElement(jI,Ot({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${t?0:-90}deg)`}},n),E.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const II=["input"];function qn(e){let{input:t}=e,n=st(e,II);return t?E.createElement(W3,n):E.createElement(z3,n)}function H3({value:e,type:t,settings:n,setValue:r}){const[o,i]=y.useState(n0(t,e,n)),a=y.useRef(e),s=y.useRef(n);s.current=n;const l=y.useCallback(u=>i(n0(t,u,s.current)),[t]),c=y.useCallback(u=>{try{r(u)}catch(f){const{type:d,previousValue:p}=f;if(d!=="LEVA_ERROR")throw f;l(p)}},[l,r]);return y.useEffect(()=>{vs(e,a.current)||l(e),a.current=e},[e,l]),{displayValue:o,onChange:i,onUpdate:c}}function yl(e,t){const{emitOnEditStart:n,emitOnEditEnd:r}=en();return Dk(o=>{o.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const i=e(o);return o.last&&(document.body.classList.remove("leva__panel__dragged"),r==null||r()),i},t)}function MI(e){const t=y.useRef(null),n=y.useRef(null),r=y.useRef(!1);return y.useEffect(()=>{const o=_3(()=>{t.current.width=t.current.offsetWidth*window.devicePixelRatio,t.current.height=t.current.offsetHeight*window.devicePixelRatio,e(t.current,n.current)},250);return window.addEventListener("resize",o),r.current||(o(),r.current=!0),()=>window.removeEventListener("resize",o)},[e]),y.useEffect(()=>{n.current=t.current.getContext("2d")},[]),[t,n]}function U3(){const e=y.useRef(null),t=y.useRef({x:0,y:0}),n=y.useCallback(r=>{Object.assign(t.current,r),e.current&&(e.current.style.transform=`translate3d(${t.current.x}px, ${t.current.y}px, 0)`)},[]);return[e,n]}const RI=["__refCount"],yd=(e,t)=>{if(!e[t])return null;const n=e[t];return st(n,RI)};function DI(e){const t=vl(),[n,r]=y.useState(yd(t.getData(),e)),o=y.useCallback(c=>t.setValueAtPath(e,c,!0),[e,t]),i=y.useCallback(c=>t.setSettingsAtPath(e,c),[e,t]),a=y.useCallback(c=>t.disableInputAtPath(e,c),[e,t]),s=y.useCallback(()=>t.emitOnEditStart(e),[e,t]),l=y.useCallback(()=>t.emitOnEditEnd(e),[e,t]);return y.useEffect(()=>{r(yd(t.getData(),e));const c=t.useStore.subscribe(u=>yd(u.data,e),r,{equalityFn:hl});return()=>c()},[t,e]),[n,{set:o,setSettings:i,disable:a,storeId:t.storeId,emitOnEditStart:s,emitOnEditEnd:l}]}const NI=De("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),G3=De("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),Vp=De("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),K3=De("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),q3=De("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function LI({value:e,min:t,max:n,onDrag:r,step:o,initialValue:i}){const a=y.useRef(null),s=y.useRef(null),l=y.useRef(0),c=Lr("sizes","scrubberWidth"),u=yl(({event:d,first:p,xy:[h],movement:[g],memo:v})=>{if(p){const{width:w,left:$}=a.current.getBoundingClientRect();l.current=w-parseFloat(c),v=(d==null?void 0:d.target)===s.current?e:Ac((h-$)/w,t,n)}const x=v+Ac(g/l.current,0,n-t);return r(j3(x,{step:o,initialValue:i})),v}),f=Tc(e,t,n);return E.createElement(K3,Ot({ref:a},u()),E.createElement(G3,null,E.createElement(q3,{style:{left:0,right:`${(1-f)*100}%`}})),E.createElement(Vp,{ref:s,style:{left:`calc(${f} * (100% - ${c}))`}}))}const BI=E.memo(({label:e,onUpdate:t,step:n,innerLabelTrim:r})=>{const[o,i]=y.useState(!1),a=yl(({active:s,delta:[l],event:c,memo:u=0})=>(i(s),u+=l/2,Math.abs(u)>=1&&(t(f=>parseFloat(f)+Math.floor(u)*n*T3(c)),u=0),u));return E.createElement(vI,Ot({dragging:o,title:e.length>1?e:""},a()),e.slice(0,r))});function X3({label:e,id:t,displayValue:n,onUpdate:r,onChange:o,settings:i,innerLabelTrim:a=1}){const s=a>0&&E.createElement(BI,{label:e,step:i.step,onUpdate:r,innerLabelTrim:a});return E.createElement(wI,{id:t,value:String(n),onUpdate:r,onChange:o,innerLabel:s})}function FI(){const e=en(),{label:t,value:n,onUpdate:r,settings:o,id:i}=e,{min:a,max:s}=o,l=s!==1/0&&a!==-1/0;return E.createElement(qn,{input:!0},E.createElement(lr,null,t),E.createElement(NI,{hasRange:l},l&&E.createElement(LI,Ot({value:parseFloat(n),onDrag:r},o)),E.createElement(X3,Ot({},e,{id:i,label:"value",innerLabelTrim:l?0:1}))))}const{sanitizeStep:zI}=I3,WI=st(I3,["sanitizeStep"]);var VI=Ne({component:FI},WI);const HI=(e,t)=>un().schema({options:un().passesAnyOf(un().object(),un().array())}).test(t),UI=(e,{values:t})=>{if(t.indexOf(e)<0)throw Error("Selected value doesn't match Select options");return e},GI=(e,{values:t})=>t.indexOf(e),KI=e=>{let{value:t,options:n}=e,r,o;return Array.isArray(n)?(o=n,r=n.map(i=>String(i))):(o=Object.values(n),r=Object.keys(n)),"value"in e?o.includes(t)||(r.unshift(String(t)),o.unshift(t)):t=o[0],Object.values(n).includes(t)||(n[String(t)]=t),{value:t,settings:{keys:r,values:o}}};var qI=Object.freeze({__proto__:null,schema:HI,sanitize:UI,format:GI,normalize:KI});const XI=De("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),Hp=De("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),YI=De("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${Hp}:focus + &`]:{$focusStyle:""},[`${Hp}:hover + &`]:{$hoverStyle:""}});function ZI({displayValue:e,value:t,onUpdate:n,id:r,settings:o,disabled:i}){const{keys:a,values:s}=o,l=y.useRef();return t===s[e]&&(l.current=a[e]),E.createElement(XI,null,E.createElement(Hp,{id:r,value:e,onChange:c=>n(s[Number(c.currentTarget.value)]),disabled:i},a.map((c,u)=>E.createElement("option",{key:c,value:u},c))),E.createElement(YI,null,l.current),E.createElement(tm,{toggled:!0}))}function QI(){const{label:e,value:t,displayValue:n,onUpdate:r,id:o,disabled:i,settings:a}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(ZI,{id:o,value:t,displayValue:n,onUpdate:r,settings:a,disabled:i}))}var JI=Ne({component:QI},qI);const eM=e=>un().string().test(e),tM=e=>{if(typeof e!="string")throw Error("Invalid string");return e},nM=({value:e,editable:t=!0,rows:n=!1})=>({value:e,settings:{editable:t,rows:typeof n=="number"?n:n?5:0}});var rM=Object.freeze({__proto__:null,schema:eM,sanitize:tM,normalize:nM});const oM=["displayValue","onUpdate","onChange","editable"],iM=De("div",{whiteSpace:"pre-wrap"});function aM(e){let{displayValue:t,onUpdate:n,onChange:r,editable:o=!0}=e,i=st(e,oM);return o?E.createElement(Jg,Ot({value:t,onUpdate:n,onChange:r},i)):E.createElement(iM,null,t)}function sM(){const{label:e,settings:t,displayValue:n,onUpdate:r,onChange:o}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(aM,Ot({displayValue:n,onUpdate:r,onChange:o},t)))}var lM=Ne({component:sM},rM);const cM=e=>un().boolean().test(e),uM=e=>{if(typeof e!="boolean")throw Error("Invalid boolean");return e};var fM=Object.freeze({__proto__:null,schema:cM,sanitize:uM});const dM=De("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function pM({value:e,onUpdate:t,id:n,disabled:r}){return E.createElement(dM,null,E.createElement("input",{id:n,type:"checkbox",checked:e,onChange:o=>t(o.currentTarget.checked),disabled:r}),E.createElement("label",{htmlFor:n},E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function hM(){const{label:e,value:t,onUpdate:n,disabled:r,id:o}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(pM,{value:t,onUpdate:n,id:o,disabled:r}))}var gM=Ne({component:hM},fM);const mM=["locked"];function vM({value:e,id:t,valueKey:n,settings:r,onUpdate:o,innerLabelTrim:i}){const a=y.useRef(e[n]);a.current=e[n];const s=y.useCallback(c=>o({[n]:P3({type:"NUMBER",value:a.current,settings:r},c)}),[o,r,n]),l=H3({type:"NUMBER",value:e[n],settings:r,setValue:s});return E.createElement(X3,{id:t,label:n,value:e[n],displayValue:l.displayValue,onUpdate:l.onUpdate,onChange:l.onChange,settings:r,innerLabelTrim:i})}const yM=De("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function bM(e){let{locked:t}=e,n=st(e,mM);return E.createElement("svg",Ot({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),t?E.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):E.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function nm({value:e,onUpdate:t,settings:n,innerLabelTrim:r}){const{id:o,setSettings:i}=en(),{lock:a,locked:s}=n;return E.createElement(yM,{withLock:a},a&&E.createElement(bM,{locked:s,onClick:()=>i({locked:!s})}),Object.keys(e).map((l,c)=>E.createElement(vM,{id:c===0?o:`${o}.${l}`,key:l,valueKey:l,value:e,settings:n[l],onUpdate:t,innerLabelTrim:r})))}const Y3=(e,t)=>{const n={};let r=0,o=1/0;Object.entries(e).forEach(([i,a])=>{n[i]=k3(Ne({value:a},t[i])).settings,r=Math.max(r,n[i].step),o=Math.min(o,n[i].pad)});for(let i in n){const{step:a,min:s,max:l}=t[i]||{};!isFinite(a)&&(!isFinite(s)||!isFinite(l))&&(n[i].step=r,n[i].pad=o)}return n},xM=["lock"],wM=["value"];function SM(e){const t=un().array().length(e).every.number(),n=r=>{if(!r||typeof r!="object")return!1;const o=Object.values(r);return o.length===e&&o.every(i=>isFinite(i))};return r=>t.test(r)||n(r)}function $M(e){return Array.isArray(e)?"array":"object"}function rs(e,t,n){return $M(e)===t?e:t==="array"?Object.values(e):eI(e,n)}const CM=(e,t,n)=>{const r=rs(e,"object",t.keys);for(let a in r)r[a]=A3(r[a],t[a]);const o=Object.keys(r);let i={};if(o.length===t.keys.length)i=r;else{const a=rs(n,"object",t.keys);if(o.length===1&&t.locked){const s=o[0],l=r[s],c=a[s],u=c!==0?l/c:1;for(let f in a)f===s?i[s]=l:i[f]=a[f]*u}else i=Ne(Ne({},a),r)}return rs(i,t.format,t.keys)},OM=(e,t)=>rs(e,"object",t.keys),EM=e=>!!e&&("step"in e||"min"in e||"max"in e);function PM(e,t,n=[]){const{lock:r=!1}=t,o=st(t,xM),i=Array.isArray(e)?"array":"object",a=i==="object"?Object.keys(e):n,s=rs(e,"object",a),l=EM(o)?a.reduce((u,f)=>Object.assign(u,{[f]:o}),{}):o,c=Y3(s,l);return{value:i==="array"?e:s,settings:Ne(Ne({},c),{},{format:i,keys:a,lock:r,locked:!1})}}function Z3(e){return{schema:SM(e.length),normalize:t=>{let{value:n}=t,r=st(t,wM);return PM(n,r,e)},format:(t,n)=>OM(t,n),sanitize:(t,n,r)=>CM(t,n,r)}}var _M={grad:.9,turn:360,rad:360/(2*Math.PI)},Tr=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Ft=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Ln=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},Q3=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},d0=function(e){return{r:Ln(e.r,0,255),g:Ln(e.g,0,255),b:Ln(e.b,0,255),a:Ln(e.a)}},bd=function(e){return{r:Ft(e.r),g:Ft(e.g),b:Ft(e.b),a:Ft(e.a,3)}},TM=/^#([0-9a-f]{3,8})$/i,ql=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},J3=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:60*(s<0?s+6:s),s:i?a/i*100:0,v:i/255*100,a:o}},eS=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,s,a,a,l,r][c],g:255*[l,r,r,s,a,a][c],b:255*[a,a,l,r,r,s][c],a:o}},p0=function(e){return{h:Q3(e.h),s:Ln(e.s,0,100),l:Ln(e.l,0,100),a:Ln(e.a)}},h0=function(e){return{h:Ft(e.h),s:Ft(e.s),l:Ft(e.l),a:Ft(e.a,3)}},g0=function(e){return eS((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},os=function(e){return{h:(t=J3(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},AM=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,kM=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jM=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,IM=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Up={string:[[function(e){var t=TM.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Ft(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Ft(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=jM.exec(e)||IM.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:d0({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=AM.exec(e)||kM.exec(e);if(!t)return null;var n,r,o=p0({h:(n=t[1],r=t[2],r===void 0&&(r="deg"),Number(n)*(_M[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return g0(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=o===void 0?1:o;return Tr(t)&&Tr(n)&&Tr(r)?d0({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=o===void 0?1:o;if(!Tr(t)||!Tr(n)||!Tr(r))return null;var a=p0({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return g0(a)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=o===void 0?1:o;if(!Tr(t)||!Tr(n)||!Tr(r))return null;var a=function(s){return{h:Q3(s.h),s:Ln(s.s,0,100),v:Ln(s.v,0,100),a:Ln(s.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return eS(a)},"hsv"]]},m0=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=bd(this.rgba),n=t.r,r=t.g,o=t.b,a=(i=t.a)<1?ql(Ft(255*i)):"","#"+ql(n)+ql(r)+ql(o)+a;var t,n,r,o,i,a},e.prototype.toRgb=function(){return bd(this.rgba)},e.prototype.toRgbString=function(){return t=bd(this.rgba),n=t.r,r=t.g,o=t.b,(i=t.a)<1?"rgba("+n+", "+r+", "+o+", "+i+")":"rgb("+n+", "+r+", "+o+")";var t,n,r,o,i},e.prototype.toHsl=function(){return h0(os(this.rgba))},e.prototype.toHslString=function(){return t=h0(os(this.rgba)),n=t.h,r=t.s,o=t.l,(i=t.a)<1?"hsla("+n+", "+r+"%, "+o+"%, "+i+")":"hsl("+n+", "+r+"%, "+o+"%)";var t,n,r,o,i},e.prototype.toHsv=function(){return t=J3(this.rgba),{h:Ft(t.h),s:Ft(t.s),v:Ft(t.v),a:Ft(t.a,3)};var t},e.prototype.invert=function(){return rn({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),rn(xd(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),rn(xd(this.rgba,-t))},e.prototype.grayscale=function(){return rn(xd(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),rn(v0(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),rn(v0(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?rn({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):Ft(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=os(this.rgba);return typeof t=="number"?rn({h:t,s:n.s,l:n.l,a:n.a}):Ft(n.h)},e.prototype.isEqual=function(t){return this.toHex()===rn(t).toHex()},e}(),rn=function(e){return e instanceof Gp?e:new Gp(e)},y0=[],RM=function(e){e.forEach(function(t){y0.indexOf(t)<0&&(t(Gp,Up),y0.push(t))})};function DM(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,l,c=r[this.toHex()];if(c)return c;if(a!=null&&a.closest){var u=this.toRgb(),f=1/0,d="black";if(!i.length)for(var p in n)i[p]=new e(n[p]).toRgb();for(var h in n){var g=(s=u,l=i[h],Math.pow(s.r-l.r,2)+Math.pow(s.g-l.g,2)+Math.pow(s.b-l.b,2));g=0||(o[n]=e[n]);return o}function Kp(e){var t=y.useRef(e),n=y.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Bi=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:v.buttons>0)&&o.current?i(b0(o.current,v,s.current)):g(!1)},h=function(){return g(!1)};function g(v){var x=l.current,w=qp(o.current),$=v?w.addEventListener:w.removeEventListener;$(x?"touchmove":"mousemove",p),$(x?"touchend":"mouseup",h)}return[function(v){var x=v.nativeEvent,w=o.current;if(w&&(x0(x),!function(C,S){return S&&!is(C)}(x,l.current)&&w)){if(is(x)){l.current=!0;var $=x.changedTouches||[];$.length&&(s.current=$[0].identifier)}w.focus(),i(b0(w,x,s.current)),g(!0)}},function(v){var x=v.which||v.keyCode;x<37||x>40||(v.preventDefault(),a({left:x===39?.05:x===37?-.05:0,top:x===40?.05:x===38?-.05:0}))},g]},[a,i]),u=c[0],f=c[1],d=c[2];return y.useEffect(function(){return d},[d]),E.createElement("div",va({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:f,tabIndex:0,role:"slider"}))}),bl=function(e){return e.filter(Boolean).join(" ")},im=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,i=bl(["react-colorful__pointer",e.className]);return E.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},E.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},sn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},nS=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:sn(e.h),s:sn(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:sn(o/2),a:sn(r,2)}},Xp=function(e){var t=nS(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Sd=function(e){var t=nS(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},rS=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:sn(255*[r,s,a,a,l,r][c]),g:sn(255*[l,r,r,s,a,a][c]),b:sn(255*[a,a,l,r,r,s][c]),a:sn(o,2)}},oS=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:sn(60*(s<0?s+6:s)),s:sn(i?a/i*100:0),v:sn(i/255*100),a:o}},iS=E.memo(function(e){var t=e.hue,n=e.onChange,r=bl(["react-colorful__hue",e.className]);return E.createElement("div",{className:r},E.createElement(om,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Bi(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":sn(t),"aria-valuemax":"360","aria-valuemin":"0"},E.createElement(im,{className:"react-colorful__hue-pointer",left:t/360,color:Xp({h:t,s:100,v:100,a:1})})))}),aS=E.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Xp({h:t.h,s:100,v:100,a:1})};return E.createElement("div",{className:"react-colorful__saturation",style:r},E.createElement(om,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Bi(t.s+100*o.left,0,100),v:Bi(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+sn(t.s)+"%, Brightness "+sn(t.v)+"%"},E.createElement(im,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Xp(t)})))}),am=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function sS(e,t,n){var r=Kp(n),o=y.useState(function(){return e.toHsva(t)}),i=o[0],a=o[1],s=y.useRef({color:t,hsva:i});y.useEffect(function(){if(!e.equal(t,s.current.color)){var c=e.toHsva(t);s.current={hsva:c,color:t},a(c)}},[t,e]),y.useEffect(function(){var c;am(i,s.current.hsva)||e.equal(c=e.fromHsva(i),s.current.color)||(s.current={hsva:i,color:c},r(c))},[i,e,r]);var l=y.useCallback(function(c){a(function(u){return Object.assign({},u,c)})},[]);return[i,l]}var NM=typeof window<"u"?y.useLayoutEffect:y.useEffect,LM=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},w0=new Map,lS=function(e){NM(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!w0.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,w0.set(t,n);var r=LM();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},BM=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,i=e.onChange,a=rm(e,["className","colorModel","color","onChange"]),s=y.useRef(null);lS(s);var l=sS(n,o,i),c=l[0],u=l[1],f=bl(["react-colorful",t]);return E.createElement("div",va({},a,{ref:s,className:f}),E.createElement(aS,{hsva:c,onChange:u}),E.createElement(iS,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},FM=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+Sd(Object.assign({},n,{a:0}))+", "+Sd(Object.assign({},n,{a:1}))+")"},i=bl(["react-colorful__alpha",t]),a=sn(100*n.a);return E.createElement("div",{className:i},E.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),E.createElement(om,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:Bi(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},E.createElement(im,{className:"react-colorful__alpha-pointer",left:n.a,color:Sd(n)})))},zM=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,i=e.onChange,a=rm(e,["className","colorModel","color","onChange"]),s=y.useRef(null);lS(s);var l=sS(n,o,i),c=l[0],u=l[1],f=bl(["react-colorful",t]);return E.createElement("div",va({},a,{ref:s,className:f}),E.createElement(aS,{hsva:c,onChange:u}),E.createElement(iS,{hue:c.h,onChange:u}),E.createElement(FM,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},WM={defaultColor:{r:0,g:0,b:0,a:1},toHsva:oS,fromHsva:rS,equal:am},VM=function(e){return E.createElement(zM,va({},e,{colorModel:WM}))},HM={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return oS({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(t=rS(e)).r,g:t.g,b:t.b};var t},equal:am},UM=function(e){return E.createElement(BM,va({},e,{colorModel:HM}))};function pue(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(t,n,i):a(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i}function ya(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?i(u.value):o(u.value).then(s,l)}c((r=r.apply(e,t||[])).next())})}function ba(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i}function KM(){for(var e=[],t=0;t0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function XM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=qM.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var YM=[".DS_Store","Thumbs.db"];function ZM(e){return ya(this,void 0,void 0,function(){return ba(this,function(t){return jc(e)&&QM(e)?[2,nR(e.dataTransfer,e.type)]:JM(e)?[2,eR(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,tR(e)]:[2,[]]})})}function QM(e){return jc(e.dataTransfer)}function JM(e){return jc(e)&&jc(e.target)}function jc(e){return typeof e=="object"&&e!==null}function eR(e){return Yp(e.target.files).map(function(t){return xl(t)})}function tR(e){return ya(this,void 0,void 0,function(){var t;return ba(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return xl(r)})]}})})}function nR(e,t){return ya(this,void 0,void 0,function(){var n,r;return ba(this,function(o){switch(o.label){case 0:return e===null?[2,[]]:e.items?(n=Yp(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(rR))]):[3,2];case 1:return r=o.sent(),[2,S0(cS(r))];case 2:return[2,S0(Yp(e.files).map(function(i){return xl(i)}))]}})})}function S0(e){return e.filter(function(t){return YM.indexOf(t.name)===-1})}function Yp(e){if(e===null)return[];for(var t=[],n=0;n{const{open:t,exited:n,classes:r}=e;return Ke({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},M8,r)},N8=be("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.open&&n.exited&&t.hidden]}})(({theme:e,ownerState:t})=>R({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),L8=be(f8,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),B8=y.forwardRef(function(t,n){var r,o,i,a,s,l;const c=Ye({name:"MuiModal",props:t}),{BackdropComponent:u=L8,BackdropProps:f,className:d,closeAfterTransition:p=!1,children:h,container:g,component:v,components:x={},componentsProps:w={},disableAutoFocus:$=!1,disableEnforceFocus:C=!1,disableEscapeKeyDown:S=!1,disablePortal:b=!1,disableRestoreFocus:O=!1,disableScrollLock:P=!1,hideBackdrop:T=!1,keepMounted:k=!1,onBackdropClick:_,open:A,slotProps:I,slots:j}=c,M=je(c,R8),D=R({},c,{closeAfterTransition:p,disableAutoFocus:$,disableEnforceFocus:C,disableEscapeKeyDown:S,disablePortal:b,disableRestoreFocus:O,disableScrollLock:P,hideBackdrop:T,keepMounted:k}),{getRootProps:L,getBackdropProps:B,getTransitionProps:F,portalRef:Z,isTopModal:ie,exited:te,hasTransition:le}=h4(R({},D,{rootRef:n})),re=R({},D,{exited:te}),ae=D8(re),xe={};if(h.props.tabIndex===void 0&&(xe.tabIndex="-1"),le){const{onEnter:fe,onExited:de}=F();xe.onEnter=fe,xe.onExited=de}const Me=(r=(o=j==null?void 0:j.root)!=null?o:x.Root)!=null?r:N8,we=(i=(a=j==null?void 0:j.backdrop)!=null?a:x.Backdrop)!=null?i:u,Y=(s=I==null?void 0:I.root)!=null?s:w.root,ve=(l=I==null?void 0:I.backdrop)!=null?l:w.backdrop,ce=ir({elementType:Me,externalSlotProps:Y,externalForwardedProps:M,getSlotProps:L,additionalProps:{ref:n,as:v},ownerState:re,className:Te(d,Y==null?void 0:Y.className,ae==null?void 0:ae.root,!re.open&&re.exited&&(ae==null?void 0:ae.hidden))}),G=ir({elementType:we,externalSlotProps:ve,additionalProps:f,getSlotProps:fe=>B(R({},fe,{onClick:de=>{_&&_(de),fe!=null&&fe.onClick&&fe.onClick(de)}})),className:Te(ve==null?void 0:ve.className,f==null?void 0:f.className,ae==null?void 0:ae.backdrop),ownerState:re});return!k&&!A&&(!le||te)?null:m.jsx($w,{ref:Z,container:g,disablePortal:b,children:m.jsxs(Me,R({},ce,{children:[!T&&u?m.jsx(we,R({},G)):null,m.jsx(V6,{disableEnforceFocus:C,disableAutoFocus:$,disableRestoreFocus:O,isEnabled:ie,open:A,children:y.cloneElement(h,xe)})]}))})}),F8=B8,z8=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function W8(e,t,n){const r=t.getBoundingClientRect(),o=n&&n.getBoundingClientRect(),i=or(t);let a;if(t.fakeTransform)a=t.fakeTransform;else{const c=i.getComputedStyle(t);a=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let s=0,l=0;if(a&&a!=="none"&&typeof a=="string"){const c=a.split("(")[1].split(")")[0].split(",");s=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?o?`translateX(${o.right+s-r.left}px)`:`translateX(${i.innerWidth+s-r.left}px)`:e==="right"?o?`translateX(-${r.right-o.left-s}px)`:`translateX(-${r.left+r.width-s}px)`:e==="up"?o?`translateY(${o.bottom+l-r.top}px)`:`translateY(${i.innerHeight+l-r.top}px)`:o?`translateY(-${r.top-o.top+r.height-l}px)`:`translateY(-${r.top+r.height-l}px)`}function V8(e){return typeof e=="function"?e():e}function Vl(e,t,n){const r=V8(n),o=W8(e,t,r);o&&(t.style.webkitTransform=o,t.style.transform=o)}const H8=y.forwardRef(function(t,n){const r=aa(),o={enter:r.transitions.easing.easeOut,exit:r.transitions.easing.sharp},i={enter:r.transitions.duration.enteringScreen,exit:r.transitions.duration.leavingScreen},{addEndListener:a,appear:s=!0,children:l,container:c,direction:u="down",easing:f=o,in:d,onEnter:p,onEntered:h,onEntering:g,onExit:v,onExited:x,onExiting:w,style:$,timeout:C=i,TransitionComponent:S=Eg}=t,b=je(t,z8),O=y.useRef(null),P=It(l.ref,O,n),T=B=>F=>{B&&(F===void 0?B(O.current):B(O.current,F))},k=T((B,F)=>{Vl(u,B,c),Tg(B),p&&p(B,F)}),_=T((B,F)=>{const Z=Ai({timeout:C,style:$,easing:f},{mode:"enter"});B.style.webkitTransition=r.transitions.create("-webkit-transform",R({},Z)),B.style.transition=r.transitions.create("transform",R({},Z)),B.style.webkitTransform="none",B.style.transform="none",g&&g(B,F)}),A=T(h),I=T(w),j=T(B=>{const F=Ai({timeout:C,style:$,easing:f},{mode:"exit"});B.style.webkitTransition=r.transitions.create("-webkit-transform",F),B.style.transition=r.transitions.create("transform",F),Vl(u,B,c),v&&v(B)}),M=T(B=>{B.style.webkitTransition="",B.style.transition="",x&&x(B)}),D=B=>{a&&a(O.current,B)},L=y.useCallback(()=>{O.current&&Vl(u,O.current,c)},[u,c]);return y.useEffect(()=>{if(d||u==="down"||u==="right")return;const B=cl(()=>{O.current&&Vl(u,O.current,c)}),F=or(O.current);return F.addEventListener("resize",B),()=>{B.clear(),F.removeEventListener("resize",B)}},[u,d,c]),y.useEffect(()=>{d||L()},[d,L]),m.jsx(S,R({nodeRef:O,onEnter:k,onEntered:A,onEntering:_,onExit:j,onExited:M,onExiting:I,addEndListener:D,appear:s,in:d,timeout:C},b,{children:(B,F)=>y.cloneElement(l,R({ref:P,style:R({visibility:B==="exited"&&!d?"hidden":void 0},$,l.props.style)},F))}))}),U8=H8,G8=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],K8=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},RP,t);return R({},t,o)},q8=be(tf,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Ju(e,t),!n.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{var n;const r=e.palette.mode==="light",o=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",i=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",a=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",s=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return R({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:a,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i}},[`&.${bn.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:i},[`&.${bn.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:s}},!t.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(n=(e.vars||e).palette[t.color||"primary"])==null?void 0:n.main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${bn.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${bn.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`:o}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${bn.disabled}, .${bn.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${bn.disabled}:before`]:{borderBottomStyle:"dotted"}},t.startAdornment&&{paddingLeft:12},t.endAdornment&&{paddingRight:12},t.multiline&&R({padding:"25px 12px 8px"},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9}))}),X8=be(nf,{name:"MuiFilledInput",slot:"Input",overridesResolver:ef})(({theme:e,ownerState:t})=>R({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{paddingTop:21,paddingBottom:4},t.hiddenLabel&&{paddingTop:16,paddingBottom:17},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0},t.hiddenLabel&&t.size==="small"&&{paddingTop:8,paddingBottom:9},t.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),Dw=y.forwardRef(function(t,n){var r,o,i,a;const s=Ye({props:t,name:"MuiFilledInput"}),{components:l={},componentsProps:c,fullWidth:u=!1,inputComponent:f="input",multiline:d=!1,slotProps:p,slots:h={},type:g="text"}=s,v=je(s,G8),x=R({},s,{fullWidth:u,inputComponent:f,multiline:d,type:g}),w=K8(s),$={root:{ownerState:x},input:{ownerState:x}},C=p??c?Wu($,p??c):$,S=(r=(o=h.root)!=null?o:l.Root)!=null?r:q8,b=(i=(a=h.input)!=null?a:l.Input)!=null?i:X8;return m.jsx(rf,R({slots:{root:S,input:b},componentsProps:C,fullWidth:u,inputComponent:f,multiline:d,ref:n,type:g},v,{classes:w}))});Dw.muiName="Input";const Nw=Dw;function Y8(e){return qe("MuiFormControl",e)}Xe("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Z8=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Q8=e=>{const{classes:t,margin:n,fullWidth:r}=e,o={root:["root",n!=="none"&&`margin${ge(n)}`,r&&"fullWidth"]};return Ke(o,Y8,t)},J8=be("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>R({},t.root,t[`margin${ge(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>R({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top"},e.margin==="normal"&&{marginTop:16,marginBottom:8},e.margin==="dense"&&{marginTop:8,marginBottom:4},e.fullWidth&&{width:"100%"})),e7=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiFormControl"}),{children:o,className:i,color:a="primary",component:s="div",disabled:l=!1,error:c=!1,focused:u,fullWidth:f=!1,hiddenLabel:d=!1,margin:p="none",required:h=!1,size:g="medium",variant:v="outlined"}=r,x=je(r,Z8),w=R({},r,{color:a,component:s,disabled:l,error:c,fullWidth:f,hiddenLabel:d,margin:p,required:h,size:g,variant:v}),$=Q8(w),[C,S]=y.useState(()=>{let I=!1;return o&&y.Children.forEach(o,j=>{if(!ld(j,["Input","Select"]))return;const M=ld(j,["Select"])?j.props.input:j;M&&CP(M.props)&&(I=!0)}),I}),[b,O]=y.useState(()=>{let I=!1;return o&&y.Children.forEach(o,j=>{ld(j,["Input","Select"])&&(Ec(j.props,!0)||Ec(j.props.inputProps,!0))&&(I=!0)}),I}),[P,T]=y.useState(!1);l&&P&&T(!1);const k=u!==void 0&&!l?u:P;let _;const A=y.useMemo(()=>({adornedStart:C,setAdornedStart:S,color:a,disabled:l,error:c,filled:b,focused:k,fullWidth:f,hiddenLabel:d,size:g,onBlur:()=>{T(!1)},onEmpty:()=>{O(!1)},onFilled:()=>{O(!0)},onFocus:()=>{T(!0)},registerEffect:_,required:h,variant:v}),[C,a,l,c,b,k,f,d,_,h,g,v]);return m.jsx(Hg.Provider,{value:A,children:m.jsx(J8,R({as:s,ownerState:w,className:Te($.root,i),ref:n},x,{children:o}))})}),t7=e7,n7=jE({createStyledComponent:be("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Ye({props:e,name:"MuiStack"})}),Lw=n7;function r7(e){return qe("MuiFormHelperText",e)}const o7=Xe("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),g1=o7;var m1;const i7=["children","className","component","disabled","error","filled","focused","margin","required","variant"],a7=e=>{const{classes:t,contained:n,size:r,disabled:o,error:i,filled:a,focused:s,required:l}=e,c={root:["root",o&&"disabled",i&&"error",r&&`size${ge(r)}`,n&&"contained",s&&"focused",a&&"filled",l&&"required"]};return Ke(c,r7,t)},s7=be("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.size&&t[`size${ge(n.size)}`],n.contained&&t.contained,n.filled&&t.filled]}})(({theme:e,ownerState:t})=>R({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${g1.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${g1.error}`]:{color:(e.vars||e).palette.error.main}},t.size==="small"&&{marginTop:4},t.contained&&{marginLeft:14,marginRight:14})),l7=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiFormHelperText"}),{children:o,className:i,component:a="p"}=r,s=je(r,i7),l=pa(),c=da({props:r,muiFormControl:l,states:["variant","size","disabled","error","filled","focused","required"]}),u=R({},r,{component:a,contained:c.variant==="filled"||c.variant==="outlined",variant:c.variant,size:c.size,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=a7(u);return m.jsx(s7,R({as:a,ownerState:u,className:Te(f.root,i),ref:n},s,{children:o===" "?m1||(m1=m.jsx("span",{className:"notranslate",children:"​"})):o}))}),c7=l7;function u7(e){return qe("MuiFormLabel",e)}const f7=Xe("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),ns=f7,d7=["children","className","color","component","disabled","error","filled","focused","required"],p7=e=>{const{classes:t,color:n,focused:r,disabled:o,error:i,filled:a,required:s}=e,l={root:["root",`color${ge(n)}`,o&&"disabled",i&&"error",a&&"filled",r&&"focused",s&&"required"],asterisk:["asterisk",i&&"error"]};return Ke(l,u7,t)},h7=be("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},t)=>R({},t.root,e.color==="secondary"&&t.colorSecondary,e.filled&&t.filled)})(({theme:e,ownerState:t})=>R({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${ns.focused}`]:{color:(e.vars||e).palette[t.color].main},[`&.${ns.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ns.error}`]:{color:(e.vars||e).palette.error.main}})),g7=be("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})(({theme:e})=>({[`&.${ns.error}`]:{color:(e.vars||e).palette.error.main}})),m7=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiFormLabel"}),{children:o,className:i,component:a="label"}=r,s=je(r,d7),l=pa(),c=da({props:r,muiFormControl:l,states:["color","required","focused","disabled","error","filled"]}),u=R({},r,{color:c.color||"primary",component:a,disabled:c.disabled,error:c.error,filled:c.filled,focused:c.focused,required:c.required}),f=p7(u);return m.jsxs(h7,R({as:a,ownerState:u,className:Te(f.root,i),ref:n},s,{children:[o,c.required&&m.jsxs(g7,{ownerState:u,"aria-hidden":!0,className:f.asterisk,children:[" ","*"]})]}))}),v7=m7,y7=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function Ip(e){return`scale(${e}, ${e**2})`}const b7={entering:{opacity:1,transform:Ip(1)},entered:{opacity:1,transform:"none"}},dd=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Bw=y.forwardRef(function(t,n){const{addEndListener:r,appear:o=!0,children:i,easing:a,in:s,onEnter:l,onEntered:c,onEntering:u,onExit:f,onExited:d,onExiting:p,style:h,timeout:g="auto",TransitionComponent:v=Eg}=t,x=je(t,y7),w=y.useRef(),$=y.useRef(),C=aa(),S=y.useRef(null),b=It(S,i.ref,n),O=M=>D=>{if(M){const L=S.current;D===void 0?M(L):M(L,D)}},P=O(u),T=O((M,D)=>{Tg(M);const{duration:L,delay:B,easing:F}=Ai({style:h,timeout:g,easing:a},{mode:"enter"});let Z;g==="auto"?(Z=C.transitions.getAutoHeightDuration(M.clientHeight),$.current=Z):Z=L,M.style.transition=[C.transitions.create("opacity",{duration:Z,delay:B}),C.transitions.create("transform",{duration:dd?Z:Z*.666,delay:B,easing:F})].join(","),l&&l(M,D)}),k=O(c),_=O(p),A=O(M=>{const{duration:D,delay:L,easing:B}=Ai({style:h,timeout:g,easing:a},{mode:"exit"});let F;g==="auto"?(F=C.transitions.getAutoHeightDuration(M.clientHeight),$.current=F):F=D,M.style.transition=[C.transitions.create("opacity",{duration:F,delay:L}),C.transitions.create("transform",{duration:dd?F:F*.666,delay:dd?L:L||F*.333,easing:B})].join(","),M.style.opacity=0,M.style.transform=Ip(.75),f&&f(M)}),I=O(d),j=M=>{g==="auto"&&(w.current=setTimeout(M,$.current||0)),r&&r(S.current,M)};return y.useEffect(()=>()=>{clearTimeout(w.current)},[]),m.jsx(v,R({appear:o,in:s,nodeRef:S,onEnter:T,onEntered:k,onEntering:P,onExit:A,onExited:I,onExiting:_,addEndListener:j,timeout:g==="auto"?null:g},x,{children:(M,D)=>y.cloneElement(i,R({style:R({opacity:0,transform:Ip(.75),visibility:M==="exited"&&!s?"hidden":void 0},b7[M],h,i.props.style),ref:b},D))}))});Bw.muiSupportAuto=!0;const x7=Bw,w7=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],S7=e=>{const{classes:t,disableUnderline:n}=e,o=Ke({root:["root",!n&&"underline"],input:["input"]},kP,t);return R({},t,o)},$7=be(tf,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[...Ju(e,t),!n.disableUnderline&&t.underline]}})(({theme:e,ownerState:t})=>{let r=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(r=`rgba(${e.vars.palette.common.onBackgroundChannel} / ${e.vars.opacity.inputUnderline})`),R({position:"relative"},t.formControl&&{"label + &":{marginTop:16}},!t.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(e.vars||e).palette[t.color].main}`,left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${uo.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${uo.error}`]:{"&:before, &:after":{borderBottomColor:(e.vars||e).palette.error.main}},"&:before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${uo.disabled}, .${uo.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${uo.disabled}:before`]:{borderBottomStyle:"dotted"}})}),C7=be(nf,{name:"MuiInput",slot:"Input",overridesResolver:ef})({}),Fw=y.forwardRef(function(t,n){var r,o,i,a;const s=Ye({props:t,name:"MuiInput"}),{disableUnderline:l,components:c={},componentsProps:u,fullWidth:f=!1,inputComponent:d="input",multiline:p=!1,slotProps:h,slots:g={},type:v="text"}=s,x=je(s,w7),w=S7(s),C={root:{ownerState:{disableUnderline:l}}},S=h??u?Wu(h??u,C):C,b=(r=(o=g.root)!=null?o:c.Root)!=null?r:$7,O=(i=(a=g.input)!=null?a:c.Input)!=null?i:C7;return m.jsx(rf,R({slots:{root:b,input:O},slotProps:S,fullWidth:f,inputComponent:d,multiline:p,ref:n,type:v},x,{classes:w}))});Fw.muiName="Input";const zw=Fw;function O7(e){return qe("MuiInputLabel",e)}Xe("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const E7=["disableAnimation","margin","shrink","variant","className"],P7=e=>{const{classes:t,formControl:n,size:r,shrink:o,disableAnimation:i,variant:a,required:s}=e,l={root:["root",n&&"formControl",!i&&"animated",o&&"shrink",r&&r!=="normal"&&`size${ge(r)}`,a],asterisk:[s&&"asterisk"]},c=Ke(l,O7,t);return R({},t,c)},_7=be(v7,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${ns.asterisk}`]:t.asterisk},t.root,n.formControl&&t.formControl,n.size==="small"&&t.sizeSmall,n.shrink&&t.shrink,!n.disableAnimation&&t.animated,n.focused&&t.focused,t[n.variant]]}})(({theme:e,ownerState:t})=>R({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},t.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},t.size==="small"&&{transform:"translate(0, 17px) scale(1)"},t.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!t.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},t.variant==="filled"&&R({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},t.shrink&&R({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},t.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),t.variant==="outlined"&&R({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},t.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},t.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),T7=y.forwardRef(function(t,n){const r=Ye({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,shrink:i,className:a}=r,s=je(r,E7),l=pa();let c=i;typeof c>"u"&&l&&(c=l.filled||l.focused||l.adornedStart);const u=da({props:r,muiFormControl:l,states:["size","variant","required","focused"]}),f=R({},r,{disableAnimation:o,formControl:l,shrink:c,size:u.size,variant:u.variant,required:u.required,focused:u.focused}),d=P7(f);return m.jsx(_7,R({"data-shrink":c,ownerState:f,ref:n,className:Te(d.root,a)},s,{classes:d}))}),A7=T7,k7=y.createContext({}),j7=k7;function I7(e){return qe("MuiList",e)}Xe("MuiList",["root","padding","dense","subheader"]);const M7=["children","className","component","dense","disablePadding","subheader"],R7=e=>{const{classes:t,disablePadding:n,dense:r,subheader:o}=e;return Ke({root:["root",!n&&"padding",r&&"dense",o&&"subheader"]},I7,t)},D7=be("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,!n.disablePadding&&t.padding,n.dense&&t.dense,n.subheader&&t.subheader]}})(({ownerState:e})=>R({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),N7=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiList"}),{children:o,className:i,component:a="ul",dense:s=!1,disablePadding:l=!1,subheader:c}=r,u=je(r,M7),f=y.useMemo(()=>({dense:s}),[s]),d=R({},r,{component:a,dense:s,disablePadding:l}),p=R7(d);return m.jsx(j7.Provider,{value:f,children:m.jsxs(D7,R({as:a,className:Te(p.root,i),ref:n,ownerState:d},u,{children:[c,o]}))})}),L7=N7,B7=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function pd(e,t,n){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:n?null:e.firstChild}function v1(e,t,n){return e===t?n?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:n?null:e.lastChild}function Ww(e,t){if(t===void 0)return!0;let n=e.innerText;return n===void 0&&(n=e.textContent),n=n.trim().toLowerCase(),n.length===0?!1:t.repeating?n[0]===t.keys[0]:n.indexOf(t.keys.join(""))===0}function Ta(e,t,n,r,o,i){let a=!1,s=o(e,t,t?n:!1);for(;s;){if(s===e.firstChild){if(a)return!1;a=!0}const l=r?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!Ww(s,i)||l)s=o(e,s,n);else return s.focus(),!0}return!1}const F7=y.forwardRef(function(t,n){const{actions:r,autoFocus:o=!1,autoFocusItem:i=!1,children:a,className:s,disabledItemsFocusable:l=!1,disableListWrap:c=!1,onKeyDown:u,variant:f="selectedMenu"}=t,d=je(t,B7),p=y.useRef(null),h=y.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});Sr(()=>{o&&p.current.focus()},[o]),y.useImperativeHandle(r,()=>({adjustStyleForScrollbar:($,C)=>{const S=!p.current.style.width;if($.clientHeight{const C=p.current,S=$.key,b=Jt(C).activeElement;if(S==="ArrowDown")$.preventDefault(),Ta(C,b,c,l,pd);else if(S==="ArrowUp")$.preventDefault(),Ta(C,b,c,l,v1);else if(S==="Home")$.preventDefault(),Ta(C,null,c,l,pd);else if(S==="End")$.preventDefault(),Ta(C,null,c,l,v1);else if(S.length===1){const O=h.current,P=S.toLowerCase(),T=performance.now();O.keys.length>0&&(T-O.lastTime>500?(O.keys=[],O.repeating=!0,O.previousKeyMatched=!0):O.repeating&&P!==O.keys[0]&&(O.repeating=!1)),O.lastTime=T,O.keys.push(P);const k=b&&!O.repeating&&Ww(b,O);O.previousKeyMatched&&(k||Ta(C,b,!1,l,pd,O))?$.preventDefault():O.previousKeyMatched=!1}u&&u($)},v=It(p,n);let x=-1;y.Children.forEach(a,($,C)=>{if(!y.isValidElement($)){x===C&&(x+=1,x>=a.length&&(x=-1));return}$.props.disabled||(f==="selectedMenu"&&$.props.selected||x===-1)&&(x=C),x===C&&($.props.disabled||$.props.muiSkipListHighlight||$.type.muiSkipListHighlight)&&(x+=1,x>=a.length&&(x=-1))});const w=y.Children.map(a,($,C)=>{if(C===x){const S={};return i&&(S.autoFocus=!0),$.props.tabIndex===void 0&&f==="selectedMenu"&&(S.tabIndex=0),y.cloneElement($,S)}return $});return m.jsx(L7,R({role:"menu",ref:v,className:s,onKeyDown:g,tabIndex:o?0:-1},d,{children:w}))}),z7=F7;function W7(e){return qe("MuiPopover",e)}Xe("MuiPopover",["root","paper"]);const V7=["onEntering"],H7=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],U7=["slotProps"];function y1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function b1(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function x1(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function hd(e){return typeof e=="function"?e():e}const G7=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"]},W7,t)},K7=be(F8,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),Vw=be(qu,{name:"MuiPopover",slot:"Paper",overridesResolver:(e,t)=>t.paper})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),q7=y.forwardRef(function(t,n){var r,o,i;const a=Ye({props:t,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:c={vertical:"top",horizontal:"left"},anchorPosition:u,anchorReference:f="anchorEl",children:d,className:p,container:h,elevation:g=8,marginThreshold:v=16,open:x,PaperProps:w={},slots:$,slotProps:C,transformOrigin:S={vertical:"top",horizontal:"left"},TransitionComponent:b=x7,transitionDuration:O="auto",TransitionProps:{onEntering:P}={},disableScrollLock:T=!1}=a,k=je(a.TransitionProps,V7),_=je(a,H7),A=(r=C==null?void 0:C.paper)!=null?r:w,I=y.useRef(),j=It(I,A.ref),M=R({},a,{anchorOrigin:c,anchorReference:f,elevation:g,marginThreshold:v,externalPaperSlotProps:A,transformOrigin:S,TransitionComponent:b,transitionDuration:O,TransitionProps:k}),D=G7(M),L=y.useCallback(()=>{if(f==="anchorPosition")return u;const fe=hd(l),pe=(fe&&fe.nodeType===1?fe:Jt(I.current).body).getBoundingClientRect();return{top:pe.top+y1(pe,c.vertical),left:pe.left+b1(pe,c.horizontal)}},[l,c.horizontal,c.vertical,u,f]),B=y.useCallback(fe=>({vertical:y1(fe,S.vertical),horizontal:b1(fe,S.horizontal)}),[S.horizontal,S.vertical]),F=y.useCallback(fe=>{const de={width:fe.offsetWidth,height:fe.offsetHeight},pe=B(de);if(f==="none")return{top:null,left:null,transformOrigin:x1(pe)};const se=L();let Le=se.top-pe.vertical,Ce=se.left-pe.horizontal;const Ge=Le+de.height,N=Ce+de.width,z=or(hd(l)),U=z.innerHeight-v,W=z.innerWidth-v;if(v!==null&&LeU){const V=Ge-U;Le-=V,pe.vertical+=V}if(v!==null&&CeW){const V=N-W;Ce-=V,pe.horizontal+=V}return{top:`${Math.round(Le)}px`,left:`${Math.round(Ce)}px`,transformOrigin:x1(pe)}},[l,f,L,B,v]),[Z,ie]=y.useState(x),te=y.useCallback(()=>{const fe=I.current;if(!fe)return;const de=F(fe);de.top!==null&&(fe.style.top=de.top),de.left!==null&&(fe.style.left=de.left),fe.style.transformOrigin=de.transformOrigin,ie(!0)},[F]);y.useEffect(()=>(T&&window.addEventListener("scroll",te),()=>window.removeEventListener("scroll",te)),[l,T,te]);const le=(fe,de)=>{P&&P(fe,de),te()},re=()=>{ie(!1)};y.useEffect(()=>{x&&te()}),y.useImperativeHandle(s,()=>x?{updatePosition:()=>{te()}}:null,[x,te]),y.useEffect(()=>{if(!x)return;const fe=cl(()=>{te()}),de=or(l);return de.addEventListener("resize",fe),()=>{fe.clear(),de.removeEventListener("resize",fe)}},[l,x,te]);let ae=O;O==="auto"&&!b.muiSupportAuto&&(ae=void 0);const xe=h||(l?Jt(hd(l)).body:void 0),Me=(o=$==null?void 0:$.root)!=null?o:K7,we=(i=$==null?void 0:$.paper)!=null?i:Vw,Y=ir({elementType:we,externalSlotProps:R({},A,{style:Z?A.style:R({},A.style,{opacity:0})}),additionalProps:{elevation:g,ref:j},ownerState:M,className:Te(D.paper,A==null?void 0:A.className)}),ve=ir({elementType:Me,externalSlotProps:(C==null?void 0:C.root)||{},externalForwardedProps:_,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:xe,open:x},ownerState:M,className:Te(D.root,p)}),{slotProps:ce}=ve,G=je(ve,U7);return m.jsx(Me,R({},G,!xc(Me)&&{slotProps:ce,disableScrollLock:T},{children:m.jsx(b,R({appear:!0,in:x,onEntering:le,onExited:re,timeout:ae},k,{children:m.jsx(we,R({},Y,{children:d}))}))}))}),af=q7;function X7(e){return qe("MuiMenu",e)}Xe("MuiMenu",["root","paper","list"]);const Y7=["onEntering"],Z7=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Q7={vertical:"top",horizontal:"right"},J7={vertical:"top",horizontal:"left"},e_=e=>{const{classes:t}=e;return Ke({root:["root"],paper:["paper"],list:["list"]},X7,t)},t_=be(af,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,t)=>t.root})({}),n_=be(Vw,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,t)=>t.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),r_=be(z7,{name:"MuiMenu",slot:"List",overridesResolver:(e,t)=>t.list})({outline:0}),o_=y.forwardRef(function(t,n){var r,o;const i=Ye({props:t,name:"MuiMenu"}),{autoFocus:a=!0,children:s,className:l,disableAutoFocusItem:c=!1,MenuListProps:u={},onClose:f,open:d,PaperProps:p={},PopoverClasses:h,transitionDuration:g="auto",TransitionProps:{onEntering:v}={},variant:x="selectedMenu",slots:w={},slotProps:$={}}=i,C=je(i.TransitionProps,Y7),S=je(i,Z7),b=aa(),O=b.direction==="rtl",P=R({},i,{autoFocus:a,disableAutoFocusItem:c,MenuListProps:u,onEntering:v,PaperProps:p,transitionDuration:g,TransitionProps:C,variant:x}),T=e_(P),k=a&&!c&&d,_=y.useRef(null),A=(F,Z)=>{_.current&&_.current.adjustStyleForScrollbar(F,b),v&&v(F,Z)},I=F=>{F.key==="Tab"&&(F.preventDefault(),f&&f(F,"tabKeyDown"))};let j=-1;y.Children.map(s,(F,Z)=>{y.isValidElement(F)&&(F.props.disabled||(x==="selectedMenu"&&F.props.selected||j===-1)&&(j=Z))});const M=(r=w.paper)!=null?r:n_,D=(o=$.paper)!=null?o:p,L=ir({elementType:w.root,externalSlotProps:$.root,ownerState:P,className:[T.root,l]}),B=ir({elementType:M,externalSlotProps:D,ownerState:P,className:T.paper});return m.jsx(t_,R({onClose:f,anchorOrigin:{vertical:"bottom",horizontal:O?"right":"left"},transformOrigin:O?Q7:J7,slots:{paper:M,root:w.root},slotProps:{root:L,paper:B},open:d,ref:n,transitionDuration:g,TransitionProps:R({onEntering:A},C),ownerState:P},S,{classes:h,children:m.jsx(r_,R({onKeyDown:I,actions:_,autoFocus:a&&(j===-1||c),autoFocusItem:k,variant:x},u,{className:Te(T.list,u.className),children:s}))}))}),i_=o_;function a_(e){return qe("MuiNativeSelect",e)}const s_=Xe("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Ug=s_,l_=["className","disabled","error","IconComponent","inputRef","variant"],c_=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:a}=e,s={select:["select",n,r&&"disabled",o&&"multiple",a&&"error"],icon:["icon",`icon${ge(n)}`,i&&"iconOpen",r&&"disabled"]};return Ke(s,a_,t)},Hw=({ownerState:e,theme:t})=>R({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":R({},t.vars?{backgroundColor:`rgba(${t.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:t.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Ug.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(t.vars||t).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(t.vars||t).shape.borderRadius,"&:focus":{borderRadius:(t.vars||t).shape.borderRadius},"&&&":{paddingRight:32}}),u_=be("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Pr,overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.select,t[n.variant],n.error&&t.error,{[`&.${Ug.multiple}`]:t.multiple}]}})(Hw),Uw=({ownerState:e,theme:t})=>R({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(t.vars||t).palette.action.active,[`&.${Ug.disabled}`]:{color:(t.vars||t).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),f_=be("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${ge(n.variant)}`],n.open&&t.iconOpen]}})(Uw),d_=y.forwardRef(function(t,n){const{className:r,disabled:o,error:i,IconComponent:a,inputRef:s,variant:l="standard"}=t,c=je(t,l_),u=R({},t,{disabled:o,variant:l,error:i}),f=c_(u);return m.jsxs(y.Fragment,{children:[m.jsx(u_,R({ownerState:u,className:Te(f.select,r),disabled:o,ref:s||n},c)),t.multiple?null:m.jsx(f_,{as:a,ownerState:u,className:f.icon})]})}),p_=d_;var w1;const h_=["children","classes","className","label","notched"],g_=be("fieldset",{shouldForwardProp:Pr})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),m_=be("legend",{shouldForwardProp:Pr})(({ownerState:e,theme:t})=>R({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:t.transitions.create("width",{duration:150,easing:t.transitions.easing.easeOut})},e.withLabel&&R({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:t.transitions.create("max-width",{duration:50,easing:t.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:t.transitions.create("max-width",{duration:100,easing:t.transitions.easing.easeOut,delay:50})})));function v_(e){const{className:t,label:n,notched:r}=e,o=je(e,h_),i=n!=null&&n!=="",a=R({},e,{notched:r,withLabel:i});return m.jsx(g_,R({"aria-hidden":!0,className:t,ownerState:a},o,{children:m.jsx(m_,{ownerState:a,children:i?m.jsx("span",{children:n}):w1||(w1=m.jsx("span",{className:"notranslate",children:"​"}))})}))}const y_=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],b_=e=>{const{classes:t}=e,r=Ke({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},IP,t);return R({},t,r)},x_=be(tf,{shouldForwardProp:e=>Pr(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Ju})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return R({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${hr.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${hr.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:n}},[`&.${hr.focused} .${hr.notchedOutline}`]:{borderColor:(e.vars||e).palette[t.color].main,borderWidth:2},[`&.${hr.error} .${hr.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${hr.disabled} .${hr.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},t.startAdornment&&{paddingLeft:14},t.endAdornment&&{paddingRight:14},t.multiline&&R({padding:"16.5px 14px"},t.size==="small"&&{padding:"8.5px 14px"}))}),w_=be(v_,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,t)=>t.notchedOutline})(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}}),S_=be(nf,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:ef})(({theme:e,ownerState:t})=>R({padding:"16.5px 14px"},!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},t.size==="small"&&{padding:"8.5px 14px"},t.multiline&&{padding:0},t.startAdornment&&{paddingLeft:0},t.endAdornment&&{paddingRight:0})),Gw=y.forwardRef(function(t,n){var r,o,i,a,s;const l=Ye({props:t,name:"MuiOutlinedInput"}),{components:c={},fullWidth:u=!1,inputComponent:f="input",label:d,multiline:p=!1,notched:h,slots:g={},type:v="text"}=l,x=je(l,y_),w=b_(l),$=pa(),C=da({props:l,muiFormControl:$,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),S=R({},l,{color:C.color||"primary",disabled:C.disabled,error:C.error,focused:C.focused,formControl:$,fullWidth:u,hiddenLabel:C.hiddenLabel,multiline:p,size:C.size,type:v}),b=(r=(o=g.root)!=null?o:c.Root)!=null?r:x_,O=(i=(a=g.input)!=null?a:c.Input)!=null?i:S_;return m.jsx(rf,R({slots:{root:b,input:O},renderSuffix:P=>m.jsx(w_,{ownerState:S,className:w.notchedOutline,label:d!=null&&d!==""&&C.required?s||(s=m.jsxs(y.Fragment,{children:[d," ","*"]})):d,notched:typeof h<"u"?h:!!(P.startAdornment||P.filled||P.focused)}),fullWidth:u,inputComponent:f,multiline:p,ref:n,type:v},x,{classes:R({},w,{notchedOutline:null})}))});Gw.muiName="Input";const Kw=Gw;function $_(e){return qe("MuiSelect",e)}const C_=Xe("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Aa=C_;var S1;const O_=["aria-describedby","aria-label","autoFocus","autoWidth","children","className","defaultOpen","defaultValue","disabled","displayEmpty","error","IconComponent","inputRef","labelId","MenuProps","multiple","name","onBlur","onChange","onClose","onFocus","onOpen","open","readOnly","renderValue","SelectDisplayProps","tabIndex","type","value","variant"],E_=be("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`&.${Aa.select}`]:t.select},{[`&.${Aa.select}`]:t[n.variant]},{[`&.${Aa.error}`]:t.error},{[`&.${Aa.multiple}`]:t.multiple}]}})(Hw,{[`&.${Aa.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),P_=be("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.icon,n.variant&&t[`icon${ge(n.variant)}`],n.open&&t.iconOpen]}})(Uw),__=be("input",{shouldForwardProp:e=>vO(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,t)=>t.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function $1(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function T_(e){return e==null||typeof e=="string"&&!e.trim()}const A_=e=>{const{classes:t,variant:n,disabled:r,multiple:o,open:i,error:a}=e,s={select:["select",n,r&&"disabled",o&&"multiple",a&&"error"],icon:["icon",`icon${ge(n)}`,i&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ke(s,$_,t)},k_=y.forwardRef(function(t,n){var r;const{"aria-describedby":o,"aria-label":i,autoFocus:a,autoWidth:s,children:l,className:c,defaultOpen:u,defaultValue:f,disabled:d,displayEmpty:p,error:h=!1,IconComponent:g,inputRef:v,labelId:x,MenuProps:w={},multiple:$,name:C,onBlur:S,onChange:b,onClose:O,onFocus:P,onOpen:T,open:k,readOnly:_,renderValue:A,SelectDisplayProps:I={},tabIndex:j,value:M,variant:D="standard"}=t,L=je(t,O_),[B,F]=Qa({controlled:M,default:f,name:"Select"}),[Z,ie]=Qa({controlled:k,default:u,name:"Select"}),te=y.useRef(null),le=y.useRef(null),[re,ae]=y.useState(null),{current:xe}=y.useRef(k!=null),[Me,we]=y.useState(),Y=It(n,v),ve=y.useCallback(Oe=>{le.current=Oe,Oe&&ae(Oe)},[]),ce=re==null?void 0:re.parentNode;y.useImperativeHandle(Y,()=>({focus:()=>{le.current.focus()},node:te.current,value:B}),[B]),y.useEffect(()=>{u&&Z&&re&&!xe&&(we(s?null:ce.clientWidth),le.current.focus())},[re,s]),y.useEffect(()=>{a&&le.current.focus()},[a]),y.useEffect(()=>{if(!x)return;const Oe=Jt(le.current).getElementById(x);if(Oe){const Be=()=>{getSelection().isCollapsed&&le.current.focus()};return Oe.addEventListener("click",Be),()=>{Oe.removeEventListener("click",Be)}}},[x]);const G=(Oe,Be)=>{Oe?T&&T(Be):O&&O(Be),xe||(we(s?null:ce.clientWidth),ie(Oe))},fe=Oe=>{Oe.button===0&&(Oe.preventDefault(),le.current.focus(),G(!0,Oe))},de=Oe=>{G(!1,Oe)},pe=y.Children.toArray(l),se=Oe=>{const Be=pe.find(oe=>oe.props.value===Oe.target.value);Be!==void 0&&(F(Be.props.value),b&&b(Oe,Be))},Le=Oe=>Be=>{let oe;if(Be.currentTarget.hasAttribute("tabindex")){if($){oe=Array.isArray(B)?B.slice():[];const $e=B.indexOf(Oe.props.value);$e===-1?oe.push(Oe.props.value):oe.splice($e,1)}else oe=Oe.props.value;if(Oe.props.onClick&&Oe.props.onClick(Be),B!==oe&&(F(oe),b)){const $e=Be.nativeEvent||Be,Fe=new $e.constructor($e.type,$e);Object.defineProperty(Fe,"target",{writable:!0,value:{value:oe,name:C}}),b(Fe,Oe)}$||G(!1,Be)}},Ce=Oe=>{_||[" ","ArrowUp","ArrowDown","Enter"].indexOf(Oe.key)!==-1&&(Oe.preventDefault(),G(!0,Oe))},Ge=re!==null&&Z,N=Oe=>{!Ge&&S&&(Object.defineProperty(Oe,"target",{writable:!0,value:{value:B,name:C}}),S(Oe))};delete L["aria-invalid"];let z,U;const W=[];let V=!1;(Ec({value:B})||p)&&(A?z=A(B):V=!0);const q=pe.map(Oe=>{if(!y.isValidElement(Oe))return null;let Be;if($){if(!Array.isArray(B))throw new Error(G2(2));Be=B.some(oe=>$1(oe,Oe.props.value)),Be&&V&&W.push(Oe.props.children)}else Be=$1(B,Oe.props.value),Be&&V&&(U=Oe.props.children);return y.cloneElement(Oe,{"aria-selected":Be?"true":"false",onClick:Le(Oe),onKeyUp:oe=>{oe.key===" "&&oe.preventDefault(),Oe.props.onKeyUp&&Oe.props.onKeyUp(oe)},role:"option",selected:Be,value:void 0,"data-value":Oe.props.value})});V&&($?W.length===0?z=null:z=W.reduce((Oe,Be,oe)=>(Oe.push(Be),oe{const{classes:t}=e;return t},Gg={name:"MuiSelect",overridesResolver:(e,t)=>t.root,shouldForwardProp:e=>Pr(e)&&e!=="variant",slot:"Root"},D_=be(zw,Gg)(""),N_=be(Kw,Gg)(""),L_=be(Nw,Gg)(""),qw=y.forwardRef(function(t,n){const r=Ye({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:i,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:c=!1,IconComponent:u=Mw,id:f,input:d,inputProps:p,label:h,labelId:g,MenuProps:v,multiple:x=!1,native:w=!1,onClose:$,onOpen:C,open:S,renderValue:b,SelectDisplayProps:O,variant:P="outlined"}=r,T=je(r,I_),k=w?p_:j_,_=pa(),A=da({props:r,muiFormControl:_,states:["variant","error"]}),I=A.variant||P,j=R({},r,{variant:I,classes:a}),M=R_(j),D=je(M,M_),L=d||{standard:m.jsx(D_,{ownerState:j}),outlined:m.jsx(N_,{label:h,ownerState:j}),filled:m.jsx(L_,{ownerState:j})}[I],B=It(n,L.ref);return m.jsx(y.Fragment,{children:y.cloneElement(L,R({inputComponent:k,inputProps:R({children:i,error:A.error,IconComponent:u,variant:I,type:void 0,multiple:x},w?{id:f}:{autoWidth:o,defaultOpen:l,displayEmpty:c,labelId:g,MenuProps:v,onClose:$,onOpen:C,open:S,renderValue:b,SelectDisplayProps:R({id:f},O)},p,{classes:p?Wu(D,p.classes):D},d?d.props.inputProps:{})},x&&w&&I==="outlined"?{notched:!0}:{},{ref:B,className:Te(L.props.className,s,M.root)},!d&&{variant:I},T))})});qw.muiName="Select";const B_=qw;function F_(e){return qe("MuiTab",e)}const z_=Xe("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),To=z_,W_=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],V_=e=>{const{classes:t,textColor:n,fullWidth:r,wrapped:o,icon:i,label:a,selected:s,disabled:l}=e,c={root:["root",i&&a&&"labelIcon",`textColor${ge(n)}`,r&&"fullWidth",o&&"wrapped",s&&"selected",l&&"disabled"],iconWrapper:["iconWrapper"]};return Ke(c,F_,t)},H_=be(ki,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.label&&n.icon&&t.labelIcon,t[`textColor${ge(n.textColor)}`],n.fullWidth&&t.fullWidth,n.wrapped&&t.wrapped]}})(({theme:e,ownerState:t})=>R({},e.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},t.label&&{flexDirection:t.iconPosition==="top"||t.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},t.icon&&t.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${To.iconWrapper}`]:R({},t.iconPosition==="top"&&{marginBottom:6},t.iconPosition==="bottom"&&{marginTop:6},t.iconPosition==="start"&&{marginRight:e.spacing(1)},t.iconPosition==="end"&&{marginLeft:e.spacing(1)})},t.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${To.selected}`]:{opacity:1},[`&.${To.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}},t.textColor==="primary"&&{color:(e.vars||e).palette.text.secondary,[`&.${To.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${To.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.textColor==="secondary"&&{color:(e.vars||e).palette.text.secondary,[`&.${To.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${To.disabled}`]:{color:(e.vars||e).palette.text.disabled}},t.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},t.wrapped&&{fontSize:e.typography.pxToRem(12)})),U_=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTab"}),{className:o,disabled:i=!1,disableFocusRipple:a=!1,fullWidth:s,icon:l,iconPosition:c="top",indicator:u,label:f,onChange:d,onClick:p,onFocus:h,selected:g,selectionFollowsFocus:v,textColor:x="inherit",value:w,wrapped:$=!1}=r,C=je(r,W_),S=R({},r,{disabled:i,disableFocusRipple:a,selected:g,icon:!!l,iconPosition:c,label:!!f,fullWidth:s,textColor:x,wrapped:$}),b=V_(S),O=l&&f&&y.isValidElement(l)?y.cloneElement(l,{className:Te(b.iconWrapper,l.props.className)}):l,P=k=>{!g&&d&&d(k,w),p&&p(k)},T=k=>{v&&!g&&d&&d(k,w),h&&h(k)};return m.jsxs(H_,R({focusRipple:!a,className:Te(b.root,o),ref:n,role:"tab","aria-selected":g,disabled:i,onClick:P,onFocus:T,ownerState:S,tabIndex:g?0:-1},C,{children:[c==="top"||c==="start"?m.jsxs(y.Fragment,{children:[O,f]}):m.jsxs(y.Fragment,{children:[f,O]}),u]}))}),G_=U_,K_=y.createContext(),Xw=K_;function q_(e){return qe("MuiTable",e)}Xe("MuiTable",["root","stickyHeader"]);const X_=["className","component","padding","size","stickyHeader"],Y_=e=>{const{classes:t,stickyHeader:n}=e;return Ke({root:["root",n&&"stickyHeader"]},q_,t)},Z_=be("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>R({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":R({},e.typography.body2,{padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},t.stickyHeader&&{borderCollapse:"separate"})),C1="table",Q_=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTable"}),{className:o,component:i=C1,padding:a="normal",size:s="medium",stickyHeader:l=!1}=r,c=je(r,X_),u=R({},r,{component:i,padding:a,size:s,stickyHeader:l}),f=Y_(u),d=y.useMemo(()=>({padding:a,size:s,stickyHeader:l}),[a,s,l]);return m.jsx(Xw.Provider,{value:d,children:m.jsx(Z_,R({as:i,role:i===C1?null:"table",ref:n,className:Te(f.root,o),ownerState:u},c))})}),sf=Q_,J_=y.createContext(),lf=J_;function eT(e){return qe("MuiTableBody",e)}Xe("MuiTableBody",["root"]);const tT=["className","component"],nT=e=>{const{classes:t}=e;return Ke({root:["root"]},eT,t)},rT=be("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-row-group"}),oT={variant:"body"},O1="tbody",iT=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTableBody"}),{className:o,component:i=O1}=r,a=je(r,tT),s=R({},r,{component:i}),l=nT(s);return m.jsx(lf.Provider,{value:oT,children:m.jsx(rT,R({className:Te(l.root,o),as:i,ref:n,role:i===O1?null:"rowgroup",ownerState:s},a))})}),aT=iT;function sT(e){return qe("MuiTableCell",e)}const lT=Xe("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),cT=lT,uT=["align","className","component","padding","scope","size","sortDirection","variant"],fT=e=>{const{classes:t,variant:n,align:r,padding:o,size:i,stickyHeader:a}=e,s={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${ge(r)}`,o!=="normal"&&`padding${ge(o)}`,`size${ge(i)}`]};return Ke(s,sT,t)},dT=be("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[n.variant],t[`size${ge(n.size)}`],n.padding!=="normal"&&t[`padding${ge(n.padding)}`],n.align!=="inherit"&&t[`align${ge(n.align)}`],n.stickyHeader&&t.stickyHeader]}})(({theme:e,ownerState:t})=>R({},e.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid + ${e.palette.mode==="light"?yO(gt(e.palette.divider,1),.88):bO(gt(e.palette.divider,1),.68)}`,textAlign:"left",padding:16},t.variant==="head"&&{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium},t.variant==="body"&&{color:(e.vars||e).palette.text.primary},t.variant==="footer"&&{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)},t.size==="small"&&{padding:"6px 16px",[`&.${cT.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},t.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},t.padding==="none"&&{padding:0},t.align==="left"&&{textAlign:"left"},t.align==="center"&&{textAlign:"center"},t.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},t.align==="justify"&&{textAlign:"justify"},t.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default})),pT=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTableCell"}),{align:o="inherit",className:i,component:a,padding:s,scope:l,size:c,sortDirection:u,variant:f}=r,d=je(r,uT),p=y.useContext(Xw),h=y.useContext(lf),g=h&&h.variant==="head";let v;a?v=a:v=g?"th":"td";let x=l;v==="td"?x=void 0:!x&&g&&(x="col");const w=f||h&&h.variant,$=R({},r,{align:o,component:v,padding:s||(p&&p.padding?p.padding:"normal"),size:c||(p&&p.size?p.size:"medium"),sortDirection:u,stickyHeader:w==="head"&&p&&p.stickyHeader,variant:w}),C=fT($);let S=null;return u&&(S=u==="asc"?"ascending":"descending"),m.jsx(dT,R({as:v,ref:n,className:Te(C.root,i),"aria-sort":S,scope:x,ownerState:$},d))}),hT=pT;function gT(e){return qe("MuiTableHead",e)}Xe("MuiTableHead",["root"]);const mT=["className","component"],vT=e=>{const{classes:t}=e;return Ke({root:["root"]},gT,t)},yT=be("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(e,t)=>t.root})({display:"table-header-group"}),bT={variant:"head"},E1="thead",xT=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTableHead"}),{className:o,component:i=E1}=r,a=je(r,mT),s=R({},r,{component:i}),l=vT(s);return m.jsx(lf.Provider,{value:bT,children:m.jsx(yT,R({as:i,className:Te(l.root,o),ref:n,role:i===E1?null:"rowgroup",ownerState:s},a))})}),Yw=xT,wT=ul(m.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),ST=ul(m.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function $T(e){return qe("MuiTableRow",e)}const CT=Xe("MuiTableRow",["root","selected","hover","head","footer"]),P1=CT,OT=["className","component","hover","selected"],ET=e=>{const{classes:t,selected:n,hover:r,head:o,footer:i}=e;return Ke({root:["root",n&&"selected",r&&"hover",o&&"head",i&&"footer"]},$T,t)},PT=be("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.head&&t.head,n.footer&&t.footer]}})(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${P1.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${P1.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:gt(e.palette.primary.main,e.palette.action.selectedOpacity),"&:hover":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:gt(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)}}})),_1="tr",_T=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTableRow"}),{className:o,component:i=_1,hover:a=!1,selected:s=!1}=r,l=je(r,OT),c=y.useContext(lf),u=R({},r,{component:i,hover:a,selected:s,head:c&&c.variant==="head",footer:c&&c.variant==="footer"}),f=ET(u);return m.jsx(PT,R({as:i,ref:n,className:Te(f.root,o),role:i===_1?null:"row",ownerState:u},l))}),Ni=_T;function TT(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function AT(e,t,n,r={},o=()=>{}){const{ease:i=TT,duration:a=300}=r;let s=null;const l=t[e];let c=!1;const u=()=>{c=!0},f=d=>{if(c){o(new Error("Animation cancelled"));return}s===null&&(s=d);const p=Math.min(1,(d-s)/a);if(t[e]=i(p)*(n-l)+l,p>=1){requestAnimationFrame(()=>{o(null)});return}requestAnimationFrame(f)};return l===n?(o(new Error("Element already at target position")),u):(requestAnimationFrame(f),u)}const kT=["onChange"],jT={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function IT(e){const{onChange:t}=e,n=je(e,kT),r=y.useRef(),o=y.useRef(null),i=()=>{r.current=o.current.offsetHeight-o.current.clientHeight};return Sr(()=>{const a=cl(()=>{const l=r.current;i(),l!==r.current&&t(r.current)}),s=or(o.current);return s.addEventListener("resize",a),()=>{a.clear(),s.removeEventListener("resize",a)}},[t]),y.useEffect(()=>{i(),t(r.current)},[t]),m.jsx("div",R({style:jT,ref:o},n))}function MT(e){return qe("MuiTabScrollButton",e)}const RT=Xe("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),DT=RT,NT=["className","slots","slotProps","direction","orientation","disabled"],LT=e=>{const{classes:t,orientation:n,disabled:r}=e;return Ke({root:["root",n,r&&"disabled"]},MT,t)},BT=be(ki,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.orientation&&t[n.orientation]]}})(({ownerState:e})=>R({width:40,flexShrink:0,opacity:.8,[`&.${DT.disabled}`]:{opacity:0}},e.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${e.isRtl?-90:90}deg)`}})),FT=y.forwardRef(function(t,n){var r,o;const i=Ye({props:t,name:"MuiTabScrollButton"}),{className:a,slots:s={},slotProps:l={},direction:c}=i,u=je(i,NT),d=aa().direction==="rtl",p=R({isRtl:d},i),h=LT(p),g=(r=s.StartScrollButtonIcon)!=null?r:wT,v=(o=s.EndScrollButtonIcon)!=null?o:ST,x=ir({elementType:g,externalSlotProps:l.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:p}),w=ir({elementType:v,externalSlotProps:l.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:p});return m.jsx(BT,R({component:"div",className:Te(h.root,a),ref:n,role:null,ownerState:p,tabIndex:null},u,{children:c==="left"?m.jsx(g,R({},x)):m.jsx(v,R({},w))}))}),zT=FT;function WT(e){return qe("MuiTabs",e)}const VT=Xe("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),gd=VT,HT=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],T1=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,A1=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,Hl=(e,t,n)=>{let r=!1,o=n(e,t);for(;o;){if(o===e.firstChild){if(r)return;r=!0}const i=o.disabled||o.getAttribute("aria-disabled")==="true";if(!o.hasAttribute("tabindex")||i)o=n(e,o);else{o.focus();return}}},UT=e=>{const{vertical:t,fixed:n,hideScrollbar:r,scrollableX:o,scrollableY:i,centered:a,scrollButtonsHideMobile:s,classes:l}=e;return Ke({root:["root",t&&"vertical"],scroller:["scroller",n&&"fixed",r&&"hideScrollbar",o&&"scrollableX",i&&"scrollableY"],flexContainer:["flexContainer",t&&"flexContainerVertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[r&&"hideScrollbar"]},WT,l)},GT=be("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[{[`& .${gd.scrollButtons}`]:t.scrollButtons},{[`& .${gd.scrollButtons}`]:n.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,n.vertical&&t.vertical]}})(({ownerState:e,theme:t})=>R({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},e.vertical&&{flexDirection:"column"},e.scrollButtonsHideMobile&&{[`& .${gd.scrollButtons}`]:{[t.breakpoints.down("sm")]:{display:"none"}}})),KT=be("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.scroller,n.fixed&&t.fixed,n.hideScrollbar&&t.hideScrollbar,n.scrollableX&&t.scrollableX,n.scrollableY&&t.scrollableY]}})(({ownerState:e})=>R({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},e.fixed&&{overflowX:"hidden",width:"100%"},e.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},e.scrollableX&&{overflowX:"auto",overflowY:"hidden"},e.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),qT=be("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.flexContainer,n.vertical&&t.flexContainerVertical,n.centered&&t.centered]}})(({ownerState:e})=>R({display:"flex"},e.vertical&&{flexDirection:"column"},e.centered&&{justifyContent:"center"})),XT=be("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})(({ownerState:e,theme:t})=>R({position:"absolute",height:2,bottom:0,width:"100%",transition:t.transitions.create()},e.indicatorColor==="primary"&&{backgroundColor:(t.vars||t).palette.primary.main},e.indicatorColor==="secondary"&&{backgroundColor:(t.vars||t).palette.secondary.main},e.vertical&&{height:"100%",width:2,right:0})),YT=be(IT)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),k1={},ZT=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTabs"}),o=aa(),i=o.direction==="rtl",{"aria-label":a,"aria-labelledby":s,action:l,centered:c=!1,children:u,className:f,component:d="div",allowScrollButtonsMobile:p=!1,indicatorColor:h="primary",onChange:g,orientation:v="horizontal",ScrollButtonComponent:x=zT,scrollButtons:w="auto",selectionFollowsFocus:$,slots:C={},slotProps:S={},TabIndicatorProps:b={},TabScrollButtonProps:O={},textColor:P="primary",value:T,variant:k="standard",visibleScrollbar:_=!1}=r,A=je(r,HT),I=k==="scrollable",j=v==="vertical",M=j?"scrollTop":"scrollLeft",D=j?"top":"left",L=j?"bottom":"right",B=j?"clientHeight":"clientWidth",F=j?"height":"width",Z=R({},r,{component:d,allowScrollButtonsMobile:p,indicatorColor:h,orientation:v,vertical:j,scrollButtons:w,textColor:P,variant:k,visibleScrollbar:_,fixed:!I,hideScrollbar:I&&!_,scrollableX:I&&!j,scrollableY:I&&j,centered:c&&!I,scrollButtonsHideMobile:!p}),ie=UT(Z),te=ir({elementType:C.StartScrollButtonIcon,externalSlotProps:S.startScrollButtonIcon,ownerState:Z}),le=ir({elementType:C.EndScrollButtonIcon,externalSlotProps:S.endScrollButtonIcon,ownerState:Z}),[re,ae]=y.useState(!1),[xe,Me]=y.useState(k1),[we,Y]=y.useState(!1),[ve,ce]=y.useState(!1),[G,fe]=y.useState(!1),[de,pe]=y.useState({overflow:"hidden",scrollbarWidth:0}),se=new Map,Le=y.useRef(null),Ce=y.useRef(null),Ge=()=>{const oe=Le.current;let $e;if(oe){const Ve=oe.getBoundingClientRect();$e={clientWidth:oe.clientWidth,scrollLeft:oe.scrollLeft,scrollTop:oe.scrollTop,scrollLeftNormalized:hE(oe,o.direction),scrollWidth:oe.scrollWidth,top:Ve.top,bottom:Ve.bottom,left:Ve.left,right:Ve.right}}let Fe;if(oe&&T!==!1){const Ve=Ce.current.children;if(Ve.length>0){const et=Ve[se.get(T)];Fe=et?et.getBoundingClientRect():null}}return{tabsMeta:$e,tabMeta:Fe}},N=Sn(()=>{const{tabsMeta:oe,tabMeta:$e}=Ge();let Fe=0,Ve;if(j)Ve="top",$e&&oe&&(Fe=$e.top-oe.top+oe.scrollTop);else if(Ve=i?"right":"left",$e&&oe){const pt=i?oe.scrollLeftNormalized+oe.clientWidth-oe.scrollWidth:oe.scrollLeft;Fe=(i?-1:1)*($e[Ve]-oe[Ve]+pt)}const et={[Ve]:Fe,[F]:$e?$e[F]:0};if(isNaN(xe[Ve])||isNaN(xe[F]))Me(et);else{const pt=Math.abs(xe[Ve]-et[Ve]),Et=Math.abs(xe[F]-et[F]);(pt>=1||Et>=1)&&Me(et)}}),z=(oe,{animation:$e=!0}={})=>{$e?AT(M,Le.current,oe,{duration:o.transitions.duration.standard}):Le.current[M]=oe},U=oe=>{let $e=Le.current[M];j?$e+=oe:($e+=oe*(i?-1:1),$e*=i&&sw()==="reverse"?-1:1),z($e)},W=()=>{const oe=Le.current[B];let $e=0;const Fe=Array.from(Ce.current.children);for(let Ve=0;Veoe){Ve===0&&($e=oe);break}$e+=et[B]}return $e},V=()=>{U(-1*W())},q=()=>{U(W())},ue=y.useCallback(oe=>{pe({overflow:null,scrollbarWidth:oe})},[]),Ae=()=>{const oe={};oe.scrollbarSizeListener=I?m.jsx(YT,{onChange:ue,className:Te(ie.scrollableX,ie.hideScrollbar)}):null;const Fe=I&&(w==="auto"&&(we||ve)||w===!0);return oe.scrollButtonStart=Fe?m.jsx(x,R({slots:{StartScrollButtonIcon:C.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:te},orientation:v,direction:i?"right":"left",onClick:V,disabled:!we},O,{className:Te(ie.scrollButtons,O.className)})):null,oe.scrollButtonEnd=Fe?m.jsx(x,R({slots:{EndScrollButtonIcon:C.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:le},orientation:v,direction:i?"left":"right",onClick:q,disabled:!ve},O,{className:Te(ie.scrollButtons,O.className)})):null,oe},Se=Sn(oe=>{const{tabsMeta:$e,tabMeta:Fe}=Ge();if(!(!Fe||!$e)){if(Fe[D]<$e[D]){const Ve=$e[M]+(Fe[D]-$e[D]);z(Ve,{animation:oe})}else if(Fe[L]>$e[L]){const Ve=$e[M]+(Fe[L]-$e[L]);z(Ve,{animation:oe})}}}),ne=Sn(()=>{I&&w!==!1&&fe(!G)});y.useEffect(()=>{const oe=cl(()=>{Le.current&&N()});let $e;const Fe=pt=>{pt.forEach(Et=>{Et.removedNodes.forEach(Tn=>{var Gt;(Gt=$e)==null||Gt.unobserve(Tn)}),Et.addedNodes.forEach(Tn=>{var Gt;(Gt=$e)==null||Gt.observe(Tn)})}),oe(),ne()},Ve=or(Le.current);Ve.addEventListener("resize",oe);let et;return typeof ResizeObserver<"u"&&($e=new ResizeObserver(oe),Array.from(Ce.current.children).forEach(pt=>{$e.observe(pt)})),typeof MutationObserver<"u"&&(et=new MutationObserver(Fe),et.observe(Ce.current,{childList:!0})),()=>{var pt,Et;oe.clear(),Ve.removeEventListener("resize",oe),(pt=et)==null||pt.disconnect(),(Et=$e)==null||Et.disconnect()}},[N,ne]),y.useEffect(()=>{const oe=Array.from(Ce.current.children),$e=oe.length;if(typeof IntersectionObserver<"u"&&$e>0&&I&&w!==!1){const Fe=oe[0],Ve=oe[$e-1],et={root:Le.current,threshold:.99},pt=to=>{Y(!to[0].isIntersecting)},Et=new IntersectionObserver(pt,et);Et.observe(Fe);const Tn=to=>{ce(!to[0].isIntersecting)},Gt=new IntersectionObserver(Tn,et);return Gt.observe(Ve),()=>{Et.disconnect(),Gt.disconnect()}}},[I,w,G,u==null?void 0:u.length]),y.useEffect(()=>{ae(!0)},[]),y.useEffect(()=>{N()}),y.useEffect(()=>{Se(k1!==xe)},[Se,xe]),y.useImperativeHandle(l,()=>({updateIndicator:N,updateScrollButtons:ne}),[N,ne]);const Ze=m.jsx(XT,R({},b,{className:Te(ie.indicator,b.className),ownerState:Z,style:R({},xe,b.style)}));let St=0;const $t=y.Children.map(u,oe=>{if(!y.isValidElement(oe))return null;const $e=oe.props.value===void 0?St:oe.props.value;se.set($e,St);const Fe=$e===T;return St+=1,y.cloneElement(oe,R({fullWidth:k==="fullWidth",indicator:Fe&&!re&&Ze,selected:Fe,selectionFollowsFocus:$,onChange:g,textColor:P,value:$e},St===1&&T===!1&&!oe.props.tabIndex?{tabIndex:0}:{}))}),Oe=oe=>{const $e=Ce.current,Fe=Jt($e).activeElement;if(Fe.getAttribute("role")!=="tab")return;let et=v==="horizontal"?"ArrowLeft":"ArrowUp",pt=v==="horizontal"?"ArrowRight":"ArrowDown";switch(v==="horizontal"&&i&&(et="ArrowRight",pt="ArrowLeft"),oe.key){case et:oe.preventDefault(),Hl($e,Fe,A1);break;case pt:oe.preventDefault(),Hl($e,Fe,T1);break;case"Home":oe.preventDefault(),Hl($e,null,T1);break;case"End":oe.preventDefault(),Hl($e,null,A1);break}},Be=Ae();return m.jsxs(GT,R({className:Te(ie.root,f),ownerState:Z,ref:n,as:d},A,{children:[Be.scrollButtonStart,Be.scrollbarSizeListener,m.jsxs(KT,{className:ie.scroller,ownerState:Z,style:{overflow:de.overflow,[j?`margin${i?"Left":"Right"}`:"marginBottom"]:_?void 0:-de.scrollbarWidth},ref:Le,children:[m.jsx(qT,{"aria-label":a,"aria-labelledby":s,"aria-orientation":v==="vertical"?"vertical":null,className:ie.flexContainer,ownerState:Z,onKeyDown:Oe,ref:Ce,role:"tablist",children:$t}),re&&Ze]}),Be.scrollButtonEnd]}))}),QT=ZT;function JT(e){return qe("MuiTextField",e)}Xe("MuiTextField",["root"]);const eA=["autoComplete","autoFocus","children","className","color","defaultValue","disabled","error","FormHelperTextProps","fullWidth","helperText","id","InputLabelProps","inputProps","InputProps","inputRef","label","maxRows","minRows","multiline","name","onBlur","onChange","onFocus","placeholder","required","rows","select","SelectProps","type","value","variant"],tA={standard:zw,filled:Nw,outlined:Kw},nA=e=>{const{classes:t}=e;return Ke({root:["root"]},JT,t)},rA=be(t7,{name:"MuiTextField",slot:"Root",overridesResolver:(e,t)=>t.root})({}),oA=y.forwardRef(function(t,n){const r=Ye({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:a,className:s,color:l="primary",defaultValue:c,disabled:u=!1,error:f=!1,FormHelperTextProps:d,fullWidth:p=!1,helperText:h,id:g,InputLabelProps:v,inputProps:x,InputProps:w,inputRef:$,label:C,maxRows:S,minRows:b,multiline:O=!1,name:P,onBlur:T,onChange:k,onFocus:_,placeholder:A,required:I=!1,rows:j,select:M=!1,SelectProps:D,type:L,value:B,variant:F="outlined"}=r,Z=je(r,eA),ie=R({},r,{autoFocus:i,color:l,disabled:u,error:f,fullWidth:p,multiline:O,required:I,select:M,variant:F}),te=nA(ie),le={};F==="outlined"&&(v&&typeof v.shrink<"u"&&(le.notched=v.shrink),le.label=C),M&&((!D||!D.native)&&(le.id=void 0),le["aria-describedby"]=void 0);const re=Og(g),ae=h&&re?`${re}-helper-text`:void 0,xe=C&&re?`${re}-label`:void 0,Me=tA[F],we=m.jsx(Me,R({"aria-describedby":ae,autoComplete:o,autoFocus:i,defaultValue:c,fullWidth:p,multiline:O,name:P,rows:j,maxRows:S,minRows:b,type:L,value:B,id:re,inputRef:$,onBlur:T,onChange:k,onFocus:_,placeholder:A,inputProps:x},le,w));return m.jsxs(rA,R({className:Te(te.root,s),disabled:u,error:f,fullWidth:p,ref:n,required:I,color:l,variant:F,ownerState:ie},Z,{children:[C!=null&&C!==""&&m.jsx(A7,R({htmlFor:re,id:xe},v,{children:C})),M?m.jsx(B_,R({"aria-describedby":ae,id:re,labelId:xe,value:B,input:we},D,{children:a})):we,h&&m.jsx(c7,R({id:ae},d,{children:h}))]}))}),Kg=oA;function Mp(e){const t=new Date(Number(e)*1e3),n=t.getFullYear(),r=(1+t.getMonth()).toString().padStart(2,"0");return`${t.getDate().toString().padStart(2,"0")}/${r}/${n}`}function iA(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Zw(...e){return t=>e.forEach(n=>iA(n,t))}function ha(...e){return y.useCallback(Zw(...e),e)}const Qw=y.forwardRef((e,t)=>{const{children:n,...r}=e,o=y.Children.toArray(n),i=o.find(aA);if(i){const a=i.props.children,s=o.map(l=>l===i?y.Children.count(a)>1?y.Children.only(null):y.isValidElement(a)?a.props.children:null:l);return y.createElement(Rp,R({},r,{ref:t}),y.isValidElement(a)?y.cloneElement(a,void 0,s):null)}return y.createElement(Rp,R({},r,{ref:t}),n)});Qw.displayName="Slot";const Rp=y.forwardRef((e,t)=>{const{children:n,...r}=e;return y.isValidElement(n)?y.cloneElement(n,{...sA(r,n.props),ref:t?Zw(t,n.ref):n.ref}):y.Children.count(n)>1?y.Children.only(null):null});Rp.displayName="SlotClone";const Jw=({children:e})=>y.createElement(y.Fragment,null,e);function aA(e){return y.isValidElement(e)&&e.type===Jw}function sA(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...s)=>{i(...s),o(...s)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}const lA=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Jo=lA.reduce((e,t)=>{const n=y.forwardRef((r,o)=>{const{asChild:i,...a}=r,s=i?Qw:t;return y.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),y.createElement(s,R({},a,{ref:o}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function cA(e,t){e&&ia.flushSync(()=>e.dispatchEvent(t))}const uA=y.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?gi.createPortal(y.createElement(Jo.div,R({},o,{ref:t})),r):null}),fA=uA;var j1=Object.prototype.hasOwnProperty;function vs(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&vs(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(j1.call(e,n)&&++r&&!j1.call(t,n)||!(n in t)||!vs(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function hl(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r0;)a[s]=arguments[s+4];e.call(this,a),e.captureStackTrace&&e.captureStackTrace(this,t),this.rule=n,this.value=r,this.cause=o,this.target=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Or=function(t,n){t===void 0&&(t=[]),n===void 0&&(n=[]),this.chain=t,this.nextRuleModifiers=n};Or.prototype._applyRule=function(t,n){var r=this;return function(){for(var o=[],i=arguments.length;i--;)o[i]=arguments[i];return r.chain.push(new cf(n,t.apply(r,o),o,r.nextRuleModifiers)),r.nextRuleModifiers=[],r}};Or.prototype._applyModifier=function(t,n){return this.nextRuleModifiers.push(new dA(n,t.simple,t.async)),this};Or.prototype._clone=function(){return new Or(this.chain.slice(),this.nextRuleModifiers.slice())};Or.prototype.test=function(t){return this.chain.every(function(n){return n._test(t)})};Or.prototype.testAll=function(t){var n=[];return this.chain.forEach(function(r){try{r._check(t)}catch(o){n.push(new qg(r,t,o))}}),n};Or.prototype.check=function(t){this.chain.forEach(function(n){try{n._check(t)}catch(r){throw new qg(n,t,r)}})};Or.prototype.testAsync=function(t){var n=this;return new Promise(function(r,o){n3(t,n.chain.slice(),r,o)})};function n3(e,t,n,r){if(t.length){var o=t.shift();o._testAsync(e).then(function(){n3(e,t,n,r)},function(i){r(new qg(o,e,i))})}else n(e)}var I1=function(e,t){return t&&typeof e=="string"&&e.trim().length===0?!0:e==null};function pA(e,t){return t===void 0&&(t=!1),{simple:function(n){return I1(n,t)||e.check(n)===void 0},async:function(n){return I1(n,t)||e.testAsync(n)}}}function un(){return typeof Proxy<"u"?r3(new Or):Dp(new Or)}var ys={};un.extend=function(e){Object.assign(ys,e)};un.clearCustomRules=function(){ys={}};function r3(e){return new Proxy(e,{get:function(n,r){if(r in n)return n[r];var o=r3(e._clone());if(r in Pc)return o._applyModifier(Pc[r],r);if(r in ys)return o._applyRule(ys[r],r);if(r in Np)return o._applyRule(Np[r],r)}})}function Dp(e){var t=function(o,i){return Object.keys(o).forEach(function(a){i[a]=function(){for(var s=[],l=arguments.length;l--;)s[l]=arguments[l];var c=Dp(i._clone()),u=c._applyRule(o[a],a).apply(void 0,s);return u}}),i},n=t(Np,e),r=t(ys,n);return Object.keys(Pc).forEach(function(o){Object.defineProperty(r,o,{get:function(){var i=Dp(r._clone());return i._applyModifier(Pc[o],o)}})}),r}var Pc={not:{simple:function(e){return function(t){return!e(t)}},async:function(e){return function(t){return Promise.resolve(e(t)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(e){return function(t){return Ul(t).some(function(n){try{return e(n)}catch{return!1}})}},async:function(e){return function(t){return Promise.all(Ul(t).map(function(n){try{return e(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(e){return function(t){return t!==!1&&Ul(t).every(e)}},async:function(e){return function(t){return Promise.all(Ul(t).map(e)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(e,t){return function(n){return M1(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&e(n):e(n)}},async:function(e,t){return function(n){return Promise.resolve(e(n)).then(function(r){return M1(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&r:r}).catch(function(){return!1})}}}};function M1(e){return e&&e.name==="schema"&&e.args.length>0&&typeof e.args[0]=="object"}function Ul(e){return typeof e=="string"?e.split(""):e}var Np={equal:function(e){return function(t){return t==e}},exact:function(e){return function(t){return t===e}},number:function(e){return e===void 0&&(e=!0),function(t){return typeof t=="number"&&(e||isFinite(t))}},integer:function(){return function(e){var t=Number.isInteger||hA;return t(e)}},numeric:function(){return function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},string:function(){return si("string")},boolean:function(){return si("boolean")},undefined:function(){return si("undefined")},null:function(){return si("null")},array:function(){return si("array")},object:function(){return si("object")},instanceOf:function(e){return function(t){return t instanceof e}},pattern:function(e){return function(t){return e.test(t)}},lowercase:function(){return function(e){return typeof e=="boolean"||e===e.toLowerCase()&&e.trim()!==""}},uppercase:function(){return function(e){return e===e.toUpperCase()&&e.trim()!==""}},vowel:function(){return function(e){return/^[aeiou]+$/i.test(e)}},consonant:function(){return function(e){return/^(?=[^aeiou])([a-z]+)$/i.test(e)}},first:function(e){return function(t){return t[0]==e}},last:function(e){return function(t){return t[t.length-1]==e}},empty:function(){return function(e){return e.length===0}},length:function(e,t){return function(n){return n.length>=e&&n.length<=(t||e)}},minLength:function(e){return function(t){return t.length>=e}},maxLength:function(e){return function(t){return t.length<=e}},negative:function(){return function(e){return e<0}},positive:function(){return function(e){return e>=0}},between:function(e,t){return function(n){return n>=e&&n<=t}},range:function(e,t){return function(n){return n>=e&&n<=t}},lessThan:function(e){return function(t){return te}},greaterThanOrEqual:function(e){return function(t){return t>=e}},even:function(){return function(e){return e%2===0}},odd:function(){return function(e){return e%2!==0}},includes:function(e){return function(t){return~t.indexOf(e)}},schema:function(e){return gA(e)},passesAnyOf:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(n){return e.some(function(r){return r.test(n)})}},optional:pA};function si(e){return function(t){return Array.isArray(t)&&e==="array"||t===null&&e==="null"||typeof t===e}}function hA(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function gA(e){return{simple:function(t){var n=[];if(Object.keys(e).forEach(function(r){var o=e[r];try{o.check((t||{})[r])}catch(i){i.target=r,n.push(i)}}),n.length>0)throw n;return!0},async:function(t){var n=[],r=Object.keys(e).map(function(o){var i=e[o];return i.testAsync((t||{})[o]).catch(function(a){a.target=o,n.push(a)})});return Promise.all(r).then(function(){if(n.length>0)throw n;return!0})}}}var it="colors",tn="sizes",_e="space",mA={gap:_e,gridGap:_e,columnGap:_e,gridColumnGap:_e,rowGap:_e,gridRowGap:_e,inset:_e,insetBlock:_e,insetBlockEnd:_e,insetBlockStart:_e,insetInline:_e,insetInlineEnd:_e,insetInlineStart:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,marginBlock:_e,marginBlockEnd:_e,marginBlockStart:_e,marginInline:_e,marginInlineEnd:_e,marginInlineStart:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,paddingBlock:_e,paddingBlockEnd:_e,paddingBlockStart:_e,paddingInline:_e,paddingInlineEnd:_e,paddingInlineStart:_e,top:_e,right:_e,bottom:_e,left:_e,scrollMargin:_e,scrollMarginTop:_e,scrollMarginRight:_e,scrollMarginBottom:_e,scrollMarginLeft:_e,scrollMarginX:_e,scrollMarginY:_e,scrollMarginBlock:_e,scrollMarginBlockEnd:_e,scrollMarginBlockStart:_e,scrollMarginInline:_e,scrollMarginInlineEnd:_e,scrollMarginInlineStart:_e,scrollPadding:_e,scrollPaddingTop:_e,scrollPaddingRight:_e,scrollPaddingBottom:_e,scrollPaddingLeft:_e,scrollPaddingX:_e,scrollPaddingY:_e,scrollPaddingBlock:_e,scrollPaddingBlockEnd:_e,scrollPaddingBlockStart:_e,scrollPaddingInline:_e,scrollPaddingInlineEnd:_e,scrollPaddingInlineStart:_e,fontSize:"fontSizes",background:it,backgroundColor:it,backgroundImage:it,borderImage:it,border:it,borderBlock:it,borderBlockEnd:it,borderBlockStart:it,borderBottom:it,borderBottomColor:it,borderColor:it,borderInline:it,borderInlineEnd:it,borderInlineStart:it,borderLeft:it,borderLeftColor:it,borderRight:it,borderRightColor:it,borderTop:it,borderTopColor:it,caretColor:it,color:it,columnRuleColor:it,fill:it,outline:it,outlineColor:it,stroke:it,textDecorationColor:it,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:tn,minBlockSize:tn,maxBlockSize:tn,inlineSize:tn,minInlineSize:tn,maxInlineSize:tn,width:tn,minWidth:tn,maxWidth:tn,height:tn,minHeight:tn,maxHeight:tn,flexBasis:tn,gridTemplateColumns:tn,gridTemplateRows:tn,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},vA=(e,t)=>typeof t=="function"?{"()":Function.prototype.toString.call(t)}:t,ga=()=>{const e=Object.create(null);return(t,n,...r)=>{const o=(i=>JSON.stringify(i,vA))(t);return o in e?e[o]:e[o]=n(t,...r)}},Vo=Symbol.for("sxs.internal"),Xg=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),R1=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:yA}=Object.prototype,Lp=e=>e.includes("-")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase()),bA=/\s+(?![^()]*\))/,li=e=>t=>e(...typeof t=="string"?String(t).split(bA):[t]),D1={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:li((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e})),marginInline:li((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e})),maxSize:li((e,t)=>({maxBlockSize:e,maxInlineSize:t||e})),minSize:li((e,t)=>({minBlockSize:e,minInlineSize:t||e})),paddingBlock:li((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e})),paddingInline:li((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e}))},md=/([\d.]+)([^]*)/,xA=(e,t)=>e.length?e.reduce((n,r)=>(n.push(...t.map(o=>o.includes("&")?o.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(o)?`:is(${r})`:r):r+" "+o)),n),[]):t,wA=(e,t)=>e in SA&&typeof t=="string"?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,r,o,i)=>r+(o==="stretch"?`-moz-available${i};${Lp(e)}:${r}-webkit-fill-available`:`-moz-fit-content${i};${Lp(e)}:${r}fit-content`)+i):String(t),SA={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Ur=e=>e?e+"-":"",o3=(e,t,n)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(r,o,i,a,s)=>a=="$"==!!i?r:(o||a=="--"?"calc(":"")+"var(--"+(a==="$"?Ur(t)+(s.includes("$")?"":Ur(n))+s.replace(/\$/g,"-"):s)+")"+(o||a=="--"?"*"+(o||"")+(i||"1")+")":"")),$A=/\s*,\s*(?![^()]*\))/,CA=Object.prototype.toString,mi=(e,t,n,r,o)=>{let i,a,s;const l=(c,u,f)=>{let d,p;const h=g=>{for(d in g){const w=d.charCodeAt(0)===64,$=w&&Array.isArray(g[d])?g[d]:[g[d]];for(p of $){const C=/[A-Z]/.test(x=d)?x:x.replace(/-[^]/g,b=>b[1].toUpperCase()),S=typeof p=="object"&&p&&p.toString===CA&&(!r.utils[C]||!u.length);if(C in r.utils&&!S){const b=r.utils[C];if(b!==a){a=b,h(b(p)),a=null;continue}}else if(C in D1){const b=D1[C];if(b!==s){s=b,h(b(p)),s=null;continue}}if(w&&(v=d.slice(1)in r.media?"@media "+r.media[d.slice(1)]:d,d=v.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(b,O,P,T,k,_)=>{const A=md.test(O),I=.0625*(A?-1:1),[j,M]=A?[T,O]:[O,T];return"("+(P[0]==="="?"":P[0]===">"===A?"max-":"min-")+j+":"+(P[0]!=="="&&P.length===1?M.replace(md,(D,L,B)=>Number(L)+I*(P===">"?1:-1)+B):M)+(k?") and ("+(k[0]===">"?"min-":"max-")+j+":"+(k.length===1?_.replace(md,(D,L,B)=>Number(L)+I*(k===">"?-1:1)+B):_):"")+")"})),S){const b=w?f.concat(d):[...f],O=w?[...u]:xA(u,d.split($A));i!==void 0&&o(N1(...i)),i=void 0,l(p,O,b)}else i===void 0&&(i=[[],u,f]),d=w||d.charCodeAt(0)!==36?d:`--${Ur(r.prefix)}${d.slice(1).replace(/\$/g,"-")}`,p=S?p:typeof p=="number"?p&&C in OA?String(p)+"px":String(p):o3(wA(C,p??""),r.prefix,r.themeMap[C]),i[0].push(`${w?`${d} `:`${Lp(d)}:`}${p}`)}}var v,x};h(c),i!==void 0&&o(N1(...i)),i=void 0};l(e,t,n)},N1=(e,t,n)=>`${n.map(r=>`${r}{`).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,OA={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},L1=e=>String.fromCharCode(e+(e>25?39:97)),Ho=e=>(t=>{let n,r="";for(n=Math.abs(t);n>52;n=n/52|0)r=L1(n%52)+r;return L1(n%52)+r})(((t,n)=>{let r=n.length;for(;r;)t=33*t^n.charCodeAt(--r);return t})(5381,JSON.stringify(e))>>>0),Ka=["themed","global","styled","onevar","resonevar","allvar","inline"],EA=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch{return!1}},PA=e=>{let t;const n=()=>{const{cssRules:o}=t.sheet;return[].map.call(o,(i,a)=>{const{cssText:s}=i;let l="";if(s.startsWith("--sxs"))return"";if(o[a-1]&&(l=o[a-1].cssText).startsWith("--sxs")){if(!i.cssRules.length)return"";for(const c in t.rules)if(t.rules[c].group===i)return`--sxs{--sxs:${[...t.rules[c].cache].join(" ")}}${s}`;return i.cssRules.length?`${l}${s}`:""}return s}).join("")},r=()=>{if(t){const{rules:s,sheet:l}=t;if(!l.deleteRule){for(;Object(Object(l.cssRules)[0]).type===3;)l.cssRules.splice(0,1);l.cssRules=[]}for(const c in s)delete s[c]}const o=Object(e).styleSheets||[];for(const s of o)if(EA(s)){for(let l=0,c=s.cssRules;c[l];++l){const u=Object(c[l]);if(u.type!==1)continue;const f=Object(c[l+1]);if(f.type!==4)continue;++l;const{cssText:d}=u;if(!d.startsWith("--sxs"))continue;const p=d.slice(14,-3).trim().split(/\s+/),h=Ka[p[0]];h&&(t||(t={sheet:s,reset:r,rules:{},toString:n}),t.rules[h]={group:f,index:l,cache:new Set(p)})}if(t)break}if(!t){const s=(l,c)=>({type:c,cssRules:[],insertRule(u,f){this.cssRules.splice(f,0,s(u,{import:3,undefined:1}[(u.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return l==="@media{}"?`@media{${[].map.call(this.cssRules,u=>u.cssText).join("")}}`:l}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:s("","text/css"),rules:{},reset:r,toString:n}}const{sheet:i,rules:a}=t;for(let s=Ka.length-1;s>=0;--s){const l=Ka[s];if(!a[l]){const c=Ka[s+1],u=a[c]?a[c].index:i.cssRules.length;i.insertRule("@media{}",u),i.insertRule(`--sxs{--sxs:${s}}`,u),a[l]={group:i.cssRules[u+1],index:u,cache:new Set([s])}}_A(a[l])}};return r(),t},_A=e=>{const t=e.group;let n=t.cssRules.length;e.apply=r=>{try{t.insertRule(r,n),++n}catch{}}},ka=Symbol(),TA=ga(),B1=(e,t)=>TA(e,()=>(...n)=>{let r={type:null,composers:new Set};for(const o of n)if(o!=null)if(o[Vo]){r.type==null&&(r.type=o[Vo].type);for(const i of o[Vo].composers)r.composers.add(i)}else o.constructor!==Object||o.$$typeof?r.type==null&&(r.type=o):r.composers.add(AA(o,e));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),kA(e,r,t)}),AA=({variants:e,compoundVariants:t,defaultVariants:n,...r},o)=>{const i=`${Ur(o.prefix)}c-${Ho(r)}`,a=[],s=[],l=Object.create(null),c=[];for(const d in n)l[d]=String(n[d]);if(typeof e=="object"&&e)for(const d in e){u=l,f=d,yA.call(u,f)||(l[d]="undefined");const p=e[d];for(const h in p){const g={[d]:String(h)};String(h)==="undefined"&&c.push(d);const v=p[h],x=[g,v,!R1(v)];a.push(x)}}var u,f;if(typeof t=="object"&&t)for(const d of t){let{css:p,...h}=d;p=typeof p=="object"&&p||{};for(const v in h)h[v]=String(h[v]);const g=[h,p,!R1(p)];s.push(g)}return[i,r,a,s,l,c]},kA=(e,t,n)=>{const[r,o,i,a]=jA(t.composers),s=typeof t.type=="function"||t.type.$$typeof?(f=>{function d(){for(let p=0;pd.rules[p]={apply:h=>d[ka].push([p,h])}),d})(n):null,l=(s||n).rules,c=`.${r}${o.length>1?`:where(.${o.slice(1).join(".")})`:""}`,u=f=>{f=typeof f=="object"&&f||IA;const{css:d,...p}=f,h={};for(const x in i)if(delete p[x],x in f){let w=f[x];typeof w=="object"&&w?h[x]={"@initial":i[x],...w}:(w=String(w),h[x]=w!=="undefined"||a.has(x)?w:i[x])}else h[x]=i[x];const g=new Set([...o]);for(const[x,w,$,C]of t.composers){n.rules.styled.cache.has(x)||(n.rules.styled.cache.add(x),mi(w,[`.${x}`],[],e,O=>{l.styled.apply(O)}));const S=F1($,h,e.media),b=F1(C,h,e.media,!0);for(const O of S)if(O!==void 0)for(const[P,T,k]of O){const _=`${x}-${Ho(T)}-${P}`;g.add(_);const A=(k?n.rules.resonevar:n.rules.onevar).cache,I=k?l.resonevar:l.onevar;A.has(_)||(A.add(_),mi(T,[`.${_}`],[],e,j=>{I.apply(j)}))}for(const O of b)if(O!==void 0)for(const[P,T]of O){const k=`${x}-${Ho(T)}-${P}`;g.add(k),n.rules.allvar.cache.has(k)||(n.rules.allvar.cache.add(k),mi(T,[`.${k}`],[],e,_=>{l.allvar.apply(_)}))}}if(typeof d=="object"&&d){const x=`${r}-i${Ho(d)}-css`;g.add(x),n.rules.inline.cache.has(x)||(n.rules.inline.cache.add(x),mi(d,[`.${x}`],[],e,w=>{l.inline.apply(w)}))}for(const x of String(f.className||"").trim().split(/\s+/))x&&g.add(x);const v=p.className=[...g].join(" ");return{type:t.type,className:v,selector:c,props:p,toString:()=>v,deferredInjector:s}};return Xg(u,{className:r,selector:c,[Vo]:t,toString:()=>(n.rules.styled.cache.has(r)||u(),r)})},jA=e=>{let t="";const n=[],r={},o=[];for(const[i,,,,a,s]of e){t===""&&(t=i),n.push(i),o.push(...s);for(const l in a){const c=a[l];(r[l]===void 0||c!=="undefined"||s.includes(c))&&(r[l]=c)}}return[t,n,r,new Set(o)]},F1=(e,t,n,r)=>{const o=[];e:for(let[i,a,s]of e){if(s)continue;let l,c=0,u=!1;for(l in i){const f=i[l];let d=t[l];if(d!==f){if(typeof d!="object"||!d)continue e;{let p,h,g=0;for(const v in d){if(f===String(d[v])){if(v!=="@initial"){const x=v.slice(1);(h=h||[]).push(x in n?n[x]:v.replace(/^@media ?/,"")),u=!0}c+=g,p=!0}++g}if(h&&h.length&&(a={["@media "+h.join(", ")]:a}),!p)continue e}}}(o[c]=o[c]||[]).push([r?"cv":`${l}-${i[l]}`,a,u])}return o},IA={},MA=ga(),RA=(e,t)=>MA(e,()=>(...n)=>{const r=()=>{for(let o of n){o=typeof o=="object"&&o||{};let i=Ho(o);if(!t.rules.global.cache.has(i)){if(t.rules.global.cache.add(i),"@import"in o){let a=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let s of[].concat(o["@import"]))s=s.includes('"')||s.includes("'")?s:`"${s}"`,t.sheet.insertRule(`@import ${s};`,a++);delete o["@import"]}mi(o,[],[],e,a=>{t.rules.global.apply(a)})}}return""};return Xg(r,{toString:r})}),DA=ga(),NA=(e,t)=>DA(e,()=>n=>{const r=`${Ur(e.prefix)}k-${Ho(n)}`,o=()=>{if(!t.rules.global.cache.has(r)){t.rules.global.cache.add(r);const i=[];mi(n,[],[],e,s=>i.push(s));const a=`@keyframes ${r}{${i.join("")}}`;t.rules.global.apply(a)}return r};return Xg(o,{get name(){return o()},toString:o})}),LA=class{constructor(e,t,n,r){this.token=e==null?"":String(e),this.value=t==null?"":String(t),this.scale=n==null?"":String(n),this.prefix=r==null?"":String(r)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Ur(this.prefix)+Ur(this.scale)+this.token}toString(){return this.computedValue}},BA=ga(),FA=(e,t)=>BA(e,()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const o=`.${n=(n=typeof n=="string"?n:"")||`${Ur(e.prefix)}t-${Ho(r)}`}`,i={},a=[];for(const l in r){i[l]={};for(const c in r[l]){const u=`--${Ur(e.prefix)}${l}-${c}`,f=o3(String(r[l][c]),e.prefix,l);i[l][c]=new LA(c,f,l,e.prefix),a.push(`${u}:${f}`)}}const s=()=>{if(a.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);const l=`${r===e.theme?":root,":""}.${n}{${a.join(";")}}`;t.rules.themed.apply(l)}return n};return{...i,get className(){return s()},selector:o,toString:s}}),zA=ga(),z1,WA=ga(),i3=e=>{const t=(n=>{let r=!1;const o=zA(n,i=>{r=!0;const a="prefix"in(i=typeof i=="object"&&i||{})?String(i.prefix):"",s=typeof i.media=="object"&&i.media||{},l=typeof i.root=="object"?i.root||null:globalThis.document||null,c=typeof i.theme=="object"&&i.theme||{},u={prefix:a,media:s,theme:c,themeMap:typeof i.themeMap=="object"&&i.themeMap||{...mA},utils:typeof i.utils=="object"&&i.utils||{}},f=PA(l),d={css:B1(u,f),globalCss:RA(u,f),keyframes:NA(u,f),createTheme:FA(u,f),reset(){f.reset(),d.theme.toString()},theme:{},sheet:f,config:u,prefix:a,getCssText:f.toString,toString:f.toString};return String(d.theme=d.createTheme(c)),d});return r||o.reset(),o})(e);return t.styled=(({config:n,sheet:r})=>WA(n,()=>{const o=B1(n,r);return(...i)=>{const a=o(...i),s=a[Vo].type,l=E.forwardRef((c,u)=>{const f=c&&c.as||s,{props:d,deferredInjector:p}=a(c);return delete d.as,d.ref=u,p?E.createElement(E.Fragment,null,E.createElement(f,d),E.createElement(p,null)):E.createElement(f,d)});return l.className=a.className,l.displayName=`Styled.${s.displayName||s.name||s}`,l.selector=a.selector,l.toString=()=>a.selector,l[Vo]=a[Vo],l}}))(t),t},VA=()=>z1||(z1=i3()),lue=(...e)=>VA().styled(...e);function HA(e,t,n){return Math.max(t,Math.min(e,n))}const Qt={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function W1(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function V1(e,t,n,r=.15){return r===0?HA(e,t,n):en?+W1(e-n,n-t,r)+n:e}function UA(e,[t,n],[r,o]){const[[i,a],[s,l]]=e;return[V1(t,i,a,r),V1(n,s,l,o)]}function GA(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function KA(e){var t=GA(e,"string");return typeof t=="symbol"?t:String(t)}function cn(e,t,n){return t=KA(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function tk(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function l3(e){return uf(e)?tk(e)[0]:e}function nk(e){return ek(e).map(t=>t.identifier)}function vd(e){const t=l3(e);return uf(e)?t.identifier:t.pointerId}function G1(e){const t=l3(e);return[t.clientX,t.clientY]}function rk(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}function _c(e,...t){return typeof e=="function"?e(...t):e}function ok(){}function ik(...e){return e.length===0?ok:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function K1(e,t){return Object.assign({},t,e||{})}const ak=32;class sk{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:o}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=o,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?_c(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:o}=this;n.args=this.args;let i=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,rk(t)),o.down=o.pressed=o.buttons%2===1||o.touches>0,i=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const b=n._delta.map(Math.abs);Qt.addTo(n._distance,b)}this.axisIntent&&this.axisIntent(t);const[a,s]=n._movement,[l,c]=r.threshold,{_step:u,values:f}=n;if(r.hasCustomTransform?(u[0]===!1&&(u[0]=Math.abs(a)>=l&&f[0]),u[1]===!1&&(u[1]=Math.abs(s)>=c&&f[1])):(u[0]===!1&&(u[0]=Math.abs(a)>=l&&Math.sign(a)*l),u[1]===!1&&(u[1]=Math.abs(s)>=c&&Math.sign(s)*c)),n.intentional=u[0]!==!1||u[1]!==!1,!n.intentional)return;const d=[0,0];if(r.hasCustomTransform){const[b,O]=f;d[0]=u[0]!==!1?b-u[0]:0,d[1]=u[1]!==!1?O-u[1]:0}else d[0]=u[0]!==!1?a-u[0]:0,d[1]=u[1]!==!1?s-u[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(d);const p=n.offset,h=n._active&&!n._blocked||n.active;h&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=_c(r.bounds,n)),this.setup&&this.setup()),n.movement=d,this.computeOffset()));const[g,v]=n.offset,[[x,w],[$,C]]=n._bounds;n.overflow=[gw?1:0,v<$?-1:v>C?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const S=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=UA(n._bounds,n.offset,S),n.delta=Qt.sub(n.offset,p),this.computeMovement(),h&&(!n.last||i>ak)){n.delta=Qt.sub(n.offset,p);const b=n.delta.map(Math.abs);Qt.addTo(n.distance,b),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&i>0&&(n.velocity=[b[0]/i,b[1]/i],n.timeDelta=i)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const o=this.handler(wt(wt(wt({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function lk([e,t],n){const r=Math.abs(e),o=Math.abs(t);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class ck extends sk{constructor(...t){super(...t),cn(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=Qt.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=Qt.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const o=typeof r.axisThreshold=="object"?r.axisThreshold[s3(t)]:r.axisThreshold;n.axis=lk(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const uk=e=>e,q1=.15,c3={enabled(e=!0){return e},eventOptions(e,t,n){return wt(wt({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[q1,q1];case!1:return[0,0];default:return Qt.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return Qt.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||uk},threshold(e){return Qt.toVector(e,0)}},fk=0,gl=wt(wt({},c3),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=fk){return e},bounds(e={}){if(typeof e=="function")return i=>gl.bounds(e(i));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),X1={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class dk extends ck{constructor(...t){super(...t),cn(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=gl.bounds(o)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const o=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=vd(t),r._pointerActive=!0,this.computeValues(G1(t)),this.computeInitial(),n.preventScrollAxis&&s3(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const o=vd(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const i=G1(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=Qt.sub(i,n._values),this.computeValues(i)),Qt.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=vd(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[i,a]=n._distance;if(n.tap=i<=r.tapsThreshold&&a<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[s,l]=n._delta,[c,u]=n._movement,[f,d]=r.swipe.velocity,[p,h]=r.swipe.distance,g=r.swipe.duration;if(n.elapsedTimef&&Math.abs(c)>p&&(n.swipe[0]=Math.sign(s)),x>d&&Math.abs(u)>h&&(n.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,pk(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=X1[t.key];if(n){const r=this.state,o=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,Qt.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in X1&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function pk(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const ml=typeof window<"u"&&window.document&&window.document.createElement;function u3(){return ml&&"ontouchstart"in window}function hk(){return u3()||ml&&window.navigator.maxTouchPoints>1}function gk(){return ml&&"onpointerdown"in window}function mk(){return ml&&"exitPointerLock"in window.document}function vk(){try{return"constructor"in GestureEvent}catch{return!1}}const Mn={isBrowser:ml,gesture:vk(),touch:u3(),touchscreen:hk(),pointer:gk(),pointerLock:mk()},yk=250,bk=180,xk=.5,wk=50,Sk=250,$k=10,Y1={mouse:0,touch:0,pen:8},Ck=wt(wt({},gl),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&Mn.pointerLock,Mn.touch&&n?"touch":this.pointerLock?"mouse":Mn.pointer&&!o?"pointer":Mn.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?yk:void 0,!(!Mn.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const i=Qt.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=xk,distance:t=wk,duration:n=Sk}={}){return{velocity:this.transform(Qt.toVector(e)),distance:this.transform(Qt.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return bk;case!1:return 0;default:return e}},axisThreshold(e){return e?wt(wt({},Y1),e):Y1},keyboardDisplacement(e=$k){return e}});wt(wt({},c3),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!Mn.touch&&Mn.gesture)return"gesture";if(Mn.touch&&r)return"touch";if(Mn.touchscreen){if(Mn.pointer)return"pointer";if(Mn.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=a=>{const s=K1(_c(n,a),{min:-1/0,max:1/0});return[s.min,s.max]},i=a=>{const s=K1(_c(r,a),{min:-1/0,max:1/0});return[s.min,s.max]};return typeof n!="function"&&typeof r!="function"?[o(),i()]:a=>[o(a),i(a)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",Qt.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});wt(wt({},gl),{},{mouseOnly:(e=!0)=>e});wt(wt({},gl),{},{mouseOnly:(e=!0)=>e});const f3=new Map,Bp=new Map;function Ok(e){f3.set(e.key,e.engine),Bp.set(e.key,e.resolver)}const Ek={key:"drag",engine:dk,resolver:Ck};function Pk(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function _k(e,t){if(e==null)return{};var n=Pk(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const Tk={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=Mn.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},Ak=["target","eventOptions","window","enabled","transform"];function pc(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=pc(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function kk(e,t,n={}){const r=e,{target:o,eventOptions:i,window:a,enabled:s,transform:l}=r,c=_k(r,Ak);if(n.shared=pc({target:o,eventOptions:i,window:a,enabled:s,transform:l},Tk),t){const u=Bp.get(t);n[t]=pc(wt({shared:n.shared},c),u)}else for(const u in c){const f=Bp.get(u);f&&(n[u]=pc(wt({shared:n.shared},c[u]),f))}return n}class d3{constructor(t,n){cn(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,i){const a=this._listeners,s=JA(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=wt(wt({},l),i);t.addEventListener(s,o,c);const u=()=>{t.removeEventListener(s,o,c),a.delete(u)};return a.add(u),u}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class jk{constructor(){cn(this,"_timeouts",new Map)}add(t,n,r=140,...o){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...o))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}let Ik=class{constructor(t){cn(this,"gestures",new Set),cn(this,"_targetEventStore",new d3(this)),cn(this,"gestureEventStores",{}),cn(this,"gestureTimeoutStores",{}),cn(this,"handlers",{}),cn(this,"config",{}),cn(this,"pointerIds",new Set),cn(this,"touchIds",new Set),cn(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Mk(this,t)}setEventIds(t){if(uf(t))return this.touchIds=new Set(nk(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=kk(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let o;if(!(n.target&&(o=n.target(),!o))){if(n.enabled){for(const a of this.gestures){const s=this.config[a],l=Z1(r,s.eventOptions,!!o);if(s.enabled){const c=f3.get(a);new c(this,t,a).bind(l)}}const i=Z1(r,n.eventOptions,!!o);for(const a in this.nativeHandlers)i(a,"",s=>this.nativeHandlers[a](wt(wt({},this.state.shared),{},{event:s,args:t})),void 0,!0)}for(const i in r)r[i]=ik(...r[i]);if(!o)return r;for(const i in r){const{device:a,capture:s,passive:l}=QA(i);this._targetEventStore.add(o,a,"",r[i],{capture:s,passive:l})}}}};function ci(e,t){e.gestures.add(t),e.gestureEventStores[t]=new d3(e,t),e.gestureTimeoutStores[t]=new jk}function Mk(e,t){t.drag&&ci(e,"drag"),t.wheel&&ci(e,"wheel"),t.scroll&&ci(e,"scroll"),t.move&&ci(e,"move"),t.pinch&&ci(e,"pinch"),t.hover&&ci(e,"hover")}const Z1=(e,t,n)=>(r,o,i,a={},s=!1)=>{var l,c;const u=(l=a.capture)!==null&&l!==void 0?l:t.capture,f=(c=a.passive)!==null&&c!==void 0?c:t.passive;let d=s?r:YA(r,o,u);n&&f&&(d+="Passive"),e[d]=e[d]||[],e[d].push(i)};function Rk(e,t={},n,r){const o=E.useMemo(()=>new Ik(e),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),E.useEffect(o.effect.bind(o)),E.useEffect(()=>o.clean.bind(o),[]),t.target===void 0)return o.bind.bind(o)}function Dk(e,t){return Ok(Ek),Rk({drag:e},t||{},"drag")}function kr(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function p3(e,t=[]){let n=[];function r(i,a){const s=y.createContext(a),l=n.length;n=[...n,a];function c(f){const{scope:d,children:p,...h}=f,g=(d==null?void 0:d[e][l])||s,v=y.useMemo(()=>h,Object.values(h));return y.createElement(g.Provider,{value:v},p)}function u(f,d){const p=(d==null?void 0:d[e][l])||s,h=y.useContext(p);if(h)return h;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${i}\``)}return c.displayName=i+"Provider",[c,u]}const o=()=>{const i=n.map(a=>y.createContext(a));return function(s){const l=(s==null?void 0:s[e])||i;return y.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return o.scopeName=e,[r,Nk(o,...t)]}function Nk(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const a=r.reduce((s,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...s,...f}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function ma(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)===null||r===void 0?void 0:r.call(t,...n)},[])}function Lk(e,t=globalThis==null?void 0:globalThis.document){const n=ma(e);y.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r),()=>t.removeEventListener("keydown",r)},[n,t])}const Fp="dismissableLayer.update",Bk="dismissableLayer.pointerDownOutside",Fk="dismissableLayer.focusOutside";let Q1;const zk=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Wk=y.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=e,u=y.useContext(zk),[f,d]=y.useState(null),p=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,h]=y.useState({}),g=ha(t,P=>d(P)),v=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(x),$=f?v.indexOf(f):-1,C=u.layersWithOutsidePointerEventsDisabled.size>0,S=$>=w,b=Vk(P=>{const T=P.target,k=[...u.branches].some(_=>_.contains(T));!S||k||(i==null||i(P),s==null||s(P),P.defaultPrevented||l==null||l())},p),O=Hk(P=>{const T=P.target;[...u.branches].some(_=>_.contains(T))||(a==null||a(P),s==null||s(P),P.defaultPrevented||l==null||l())},p);return Lk(P=>{$===u.layers.size-1&&(o==null||o(P),!P.defaultPrevented&&l&&(P.preventDefault(),l()))},p),y.useEffect(()=>{if(f)return r&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Q1=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(f)),u.layers.add(f),J1(),()=>{r&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Q1)}},[f,p,r,u]),y.useEffect(()=>()=>{f&&(u.layers.delete(f),u.layersWithOutsidePointerEventsDisabled.delete(f),J1())},[f,u]),y.useEffect(()=>{const P=()=>h({});return document.addEventListener(Fp,P),()=>document.removeEventListener(Fp,P)},[]),y.createElement(Jo.div,R({},c,{ref:g,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:kr(e.onFocusCapture,O.onFocusCapture),onBlurCapture:kr(e.onBlurCapture,O.onBlurCapture),onPointerDownCapture:kr(e.onPointerDownCapture,b.onPointerDownCapture)}))});function Vk(e,t=globalThis==null?void 0:globalThis.document){const n=ma(e),r=y.useRef(!1),o=y.useRef(()=>{});return y.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let c=function(){h3(Bk,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=c,t.addEventListener("click",o.current,{once:!0})):c()}else t.removeEventListener("click",o.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Hk(e,t=globalThis==null?void 0:globalThis.document){const n=ma(e),r=y.useRef(!1);return y.useEffect(()=>{const o=i=>{i.target&&!r.current&&h3(Fk,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function J1(){const e=new CustomEvent(Fp);document.dispatchEvent(e)}function h3(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?cA(o,i):o.dispatchEvent(i)}const Li=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},Uk=U2["useId".toString()]||(()=>{});let Gk=0;function Kk(e){const[t,n]=y.useState(Uk());return Li(()=>{e||n(r=>r??String(Gk++))},[e]),e||(t?`radix-${t}`:"")}const qk=y.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return y.createElement(Jo.svg,R({},i,{ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:y.createElement("polygon",{points:"0,0 30,0 15,10"}))}),Xk=qk;function Yk(e){const[t,n]=y.useState(void 0);return Li(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let a,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;a=c.inlineSize,s=c.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const g3="Popper",[m3,v3]=p3(g3),[Zk,y3]=m3(g3),Qk=e=>{const{__scopePopper:t,children:n}=e,[r,o]=y.useState(null);return y.createElement(Zk,{scope:t,anchor:r,onAnchorChange:o},n)},Jk="PopperAnchor",ej=y.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=y3(Jk,n),a=y.useRef(null),s=ha(t,a);return y.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:y.createElement(Jo.div,R({},o,{ref:s}))}),b3="PopperContent",[tj,nj]=m3(b3),rj=y.forwardRef((e,t)=>{var n,r,o,i,a,s,l,c;const{__scopePopper:u,side:f="bottom",sideOffset:d=0,align:p="center",alignOffset:h=0,arrowPadding:g=0,avoidCollisions:v=!0,collisionBoundary:x=[],collisionPadding:w=0,sticky:$="partial",hideWhenDetached:C=!1,updatePositionStrategy:S="optimized",onPlaced:b,...O}=e,P=y3(b3,u),[T,k]=y.useState(null),_=ha(t,pe=>k(pe)),[A,I]=y.useState(null),j=Yk(A),M=(n=j==null?void 0:j.width)!==null&&n!==void 0?n:0,D=(r=j==null?void 0:j.height)!==null&&r!==void 0?r:0,L=f+(p!=="center"?"-"+p:""),B=typeof w=="number"?w:{top:0,right:0,bottom:0,left:0,...w},F=Array.isArray(x)?x:[x],Z=F.length>0,ie={padding:B,boundary:F.filter(sj),altBoundary:Z},{refs:te,floatingStyles:le,placement:re,isPositioned:ae,middlewareData:xe}=Z4({strategy:"fixed",placement:L,whileElementsMounted:(...pe)=>q4(...pe,{animationFrame:S==="always"}),elements:{reference:P.anchor},middleware:[P4({mainAxis:d+D,alignmentAxis:h}),v&&_4({mainAxis:!0,crossAxis:!1,limiter:$==="partial"?T4():void 0,...ie}),v&&C4({...ie}),A4({...ie,apply:({elements:pe,rects:se,availableWidth:Le,availableHeight:Ce})=>{const{width:Ge,height:N}=se.reference,z=pe.floating.style;z.setProperty("--radix-popper-available-width",`${Le}px`),z.setProperty("--radix-popper-available-height",`${Ce}px`),z.setProperty("--radix-popper-anchor-width",`${Ge}px`),z.setProperty("--radix-popper-anchor-height",`${N}px`)}}),A&&Y4({element:A,padding:g}),lj({arrowWidth:M,arrowHeight:D}),C&&O4({strategy:"referenceHidden",...ie})]}),[Me,we]=x3(re),Y=ma(b);Li(()=>{ae&&(Y==null||Y())},[ae,Y]);const ve=(o=xe.arrow)===null||o===void 0?void 0:o.x,ce=(i=xe.arrow)===null||i===void 0?void 0:i.y,G=((a=xe.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[fe,de]=y.useState();return Li(()=>{T&&de(window.getComputedStyle(T).zIndex)},[T]),y.createElement("div",{ref:te.setFloating,"data-radix-popper-content-wrapper":"",style:{...le,transform:ae?le.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:fe,"--radix-popper-transform-origin":[(s=xe.transformOrigin)===null||s===void 0?void 0:s.x,(l=xe.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},y.createElement(tj,{scope:u,placedSide:Me,onArrowChange:I,arrowX:ve,arrowY:ce,shouldHideArrow:G},y.createElement(Jo.div,R({"data-side":Me,"data-align":we},O,{ref:_,style:{...O.style,animation:ae?void 0:"none",opacity:(c=xe.hide)!==null&&c!==void 0&&c.referenceHidden?0:void 0}}))))}),oj="PopperArrow",ij={top:"bottom",right:"left",bottom:"top",left:"right"},aj=y.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=nj(oj,r),a=ij[i.placedSide];return y.createElement("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},y.createElement(Xk,R({},o,{ref:n,style:{...o.style,display:"block"}})))});function sj(e){return e!==null}const lj=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,a;const{placement:s,rects:l,middlewareData:c}=t,f=((n=c.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,d=f?0:e.arrowWidth,p=f?0:e.arrowHeight,[h,g]=x3(s),v={start:"0%",center:"50%",end:"100%"}[g],x=((r=(o=c.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+d/2,w=((i=(a=c.arrow)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0)+p/2;let $="",C="";return h==="bottom"?($=f?v:`${x}px`,C=`${-p}px`):h==="top"?($=f?v:`${x}px`,C=`${l.floating.height+p}px`):h==="right"?($=`${-p}px`,C=f?v:`${w}px`):h==="left"&&($=`${l.floating.width+p}px`,C=f?v:`${w}px`),{data:{x:$,y:C}}}});function x3(e){const[t,n="center"]=e.split("-");return[t,n]}const cj=Qk,uj=ej,fj=rj,dj=aj;function pj(e,t){return y.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const w3=e=>{const{present:t,children:n}=e,r=hj(t),o=typeof n=="function"?n({present:r.isPresent}):y.Children.only(n),i=ha(r.ref,o.ref);return typeof n=="function"||r.isPresent?y.cloneElement(o,{ref:i}):null};w3.displayName="Presence";function hj(e){const[t,n]=y.useState(),r=y.useRef({}),o=y.useRef(e),i=y.useRef("none"),a=e?"mounted":"unmounted",[s,l]=pj(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const c=Gl(r.current);i.current=s==="mounted"?c:"none"},[s]),Li(()=>{const c=r.current,u=o.current;if(u!==e){const d=i.current,p=Gl(c);e?l("MOUNT"):p==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(u&&d!==p?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Li(()=>{if(t){const c=f=>{const p=Gl(r.current).includes(f.animationName);f.target===t&&p&&ia.flushSync(()=>l("ANIMATION_END"))},u=f=>{f.target===t&&(i.current=Gl(r.current))};return t.addEventListener("animationstart",u),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{t.removeEventListener("animationstart",u),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:y.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function Gl(e){return(e==null?void 0:e.animationName)||"none"}function gj({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=mj({defaultProp:t,onChange:n}),i=e!==void 0,a=i?e:r,s=ma(n),l=y.useCallback(c=>{if(i){const f=typeof c=="function"?c(e):c;f!==e&&s(f)}else o(c)},[i,e,o,s]);return[a,l]}function mj({defaultProp:e,onChange:t}){const n=y.useState(e),[r]=n,o=y.useRef(r),i=ma(t);return y.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const vj=y.forwardRef((e,t)=>y.createElement(Jo.span,R({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),yj=vj,[ff,uue]=p3("Tooltip",[v3]),df=v3(),bj="TooltipProvider",zp="tooltip.open",[fue,Yg]=ff(bj),Zg="Tooltip",[xj,pf]=ff(Zg),wj=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:s}=e,l=Yg(Zg,e.__scopeTooltip),c=df(t),[u,f]=y.useState(null),d=Kk(),p=y.useRef(0),h=a??l.disableHoverableContent,g=s??l.delayDuration,v=y.useRef(!1),[x=!1,w]=gj({prop:r,defaultProp:o,onChange:O=>{O?(l.onOpen(),document.dispatchEvent(new CustomEvent(zp))):l.onClose(),i==null||i(O)}}),$=y.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),C=y.useCallback(()=>{window.clearTimeout(p.current),v.current=!1,w(!0)},[w]),S=y.useCallback(()=>{window.clearTimeout(p.current),w(!1)},[w]),b=y.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,w(!0)},g)},[g,w]);return y.useEffect(()=>()=>window.clearTimeout(p.current),[]),y.createElement(cj,c,y.createElement(xj,{scope:t,contentId:d,open:x,stateAttribute:$,trigger:u,onTriggerChange:f,onTriggerEnter:y.useCallback(()=>{l.isOpenDelayed?b():C()},[l.isOpenDelayed,b,C]),onTriggerLeave:y.useCallback(()=>{h?S():window.clearTimeout(p.current)},[S,h]),onOpen:C,onClose:S,disableHoverableContent:h},n))},e0="TooltipTrigger",Sj=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=pf(e0,n),i=Yg(e0,n),a=df(n),s=y.useRef(null),l=ha(t,s,o.onTriggerChange),c=y.useRef(!1),u=y.useRef(!1),f=y.useCallback(()=>c.current=!1,[]);return y.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),y.createElement(uj,R({asChild:!0},a),y.createElement(Jo.button,R({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:l,onPointerMove:kr(e.onPointerMove,d=>{d.pointerType!=="touch"&&!u.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),u.current=!0)}),onPointerLeave:kr(e.onPointerLeave,()=>{o.onTriggerLeave(),u.current=!1}),onPointerDown:kr(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:kr(e.onFocus,()=>{c.current||o.onOpen()}),onBlur:kr(e.onBlur,o.onClose),onClick:kr(e.onClick,o.onClose)})))}),$j="TooltipPortal",[due,Cj]=ff($j,{forceMount:void 0}),bs="TooltipContent",Oj=y.forwardRef((e,t)=>{const n=Cj(bs,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,a=pf(bs,e.__scopeTooltip);return y.createElement(w3,{present:r||a.open},a.disableHoverableContent?y.createElement(S3,R({side:o},i,{ref:t})):y.createElement(Ej,R({side:o},i,{ref:t})))}),Ej=y.forwardRef((e,t)=>{const n=pf(bs,e.__scopeTooltip),r=Yg(bs,e.__scopeTooltip),o=y.useRef(null),i=ha(t,o),[a,s]=y.useState(null),{trigger:l,onClose:c}=n,u=o.current,{onPointerInTransitChange:f}=r,d=y.useCallback(()=>{s(null),f(!1)},[f]),p=y.useCallback((h,g)=>{const v=h.currentTarget,x={x:h.clientX,y:h.clientY},w=kj(x,v.getBoundingClientRect()),$=jj(x,w),C=Ij(g.getBoundingClientRect()),S=Rj([...$,...C]);s(S),f(!0)},[f]);return y.useEffect(()=>()=>d(),[d]),y.useEffect(()=>{if(l&&u){const h=v=>p(v,u),g=v=>p(v,l);return l.addEventListener("pointerleave",h),u.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",h),u.removeEventListener("pointerleave",g)}}},[l,u,p,d]),y.useEffect(()=>{if(a){const h=g=>{const v=g.target,x={x:g.clientX,y:g.clientY},w=(l==null?void 0:l.contains(v))||(u==null?void 0:u.contains(v)),$=!Mj(x,a);w?d():$&&(d(),c())};return document.addEventListener("pointermove",h),()=>document.removeEventListener("pointermove",h)}},[l,u,a,c,d]),y.createElement(S3,R({},e,{ref:i}))}),[Pj,_j]=ff(Zg,{isInside:!1}),S3=y.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:a,...s}=e,l=pf(bs,n),c=df(n),{onClose:u}=l;return y.useEffect(()=>(document.addEventListener(zp,u),()=>document.removeEventListener(zp,u)),[u]),y.useEffect(()=>{if(l.trigger){const f=d=>{const p=d.target;p!=null&&p.contains(l.trigger)&&u()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,u]),y.createElement(Wk,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:u},y.createElement(fj,R({"data-state":l.stateAttribute},c,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),y.createElement(Jw,null,r),y.createElement(Pj,{scope:n,isInside:!0},y.createElement(yj,{id:l.contentId,role:"tooltip"},o||r))))}),Tj="TooltipArrow",Aj=y.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=df(n);return _j(Tj,n).isInside?null:y.createElement(dj,R({},o,r,{ref:t}))});function kj(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function jj(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function Ij(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function Mj(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,a=t.length-1;ir!=u>r&&n<(c-s)*(r-l)/(u-l)+s&&(o=!o)}return o}function Rj(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),Dj(t)}function Dj(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],a=t[t.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(o.y-a.y)>=(i.y-a.y)*(o.x-a.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}const Nj=wj,Lj=Sj,Bj=Oj,Fj=Aj;function zj(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function st(e,t){if(e==null)return{};var n=zj(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}let xt;(function(e){e[e.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",e[e.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",e[e.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",e[e.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",e[e.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",e[e.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",e[e.THEME_ERROR=6]="THEME_ERROR",e[e.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",e[e.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",e[e.EMPTY_KEY=9]="EMPTY_KEY"})(xt||(xt={}));const Wj={[xt.UNSUPPORTED_INPUT]:(e,t)=>[`An input with type \`${e}\` input was found at path \`${t}\` but it's not supported yet.`],[xt.NO_COMPONENT_FOR_TYPE]:(e,t)=>[`Type \`${e}\` found at path \`${t}\` can't be displayed in panel because no component supports it yet.`],[xt.UNKNOWN_INPUT]:(e,t)=>[`input at path \`${e}\` is not recognized.`,t],[xt.DUPLICATE_KEYS]:(e,t,n)=>[`Key \`${e}\` of path \`${t}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[xt.ALREADY_REGISTERED_TYPE]:e=>[`Type ${e} has already been registered. You can't register a component with the same type.`],[xt.CLIPBOARD_ERROR]:e=>["Error copying the value",e],[xt.THEME_ERROR]:(e,t)=>[`Error accessing the theme \`${e}.${t}\` value.`],[xt.PATH_DOESNT_EXIST]:e=>[`Error getting the value at path \`${e}\`. There is probably an error in your \`render\` function.`],[xt.PATH_DOESNT_EXIST]:e=>[`Error accessing the value at path \`${e}\``],[xt.INPUT_TYPE_OVERRIDE]:(e,t,n)=>[`Input at path \`${e}\` already exists with type: \`${t}\`. Its type cannot be overridden with type \`${n}\`.`],[xt.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function $3(e,t,...n){const[r,...o]=Wj[t](...n);console[e]("LEVA: "+r,...o)}const jr=$3.bind(null,"warn"),Vj=$3.bind(null,"log"),Hj=["value"],Uj=["schema"],Gj=["value"],C3=[],Yo={};function t0(e){let{value:t}=e,n=st(e,Hj);for(let r of C3){const o=r(t,n);if(o)return o}}function Jr(e,t){let{schema:n}=t,r=st(t,Uj);if(e in Yo){jr(xt.ALREADY_REGISTERED_TYPE,e);return}C3.push((o,i)=>n(o,i)&&e),Yo[e]=r}function yd(e,t,n,r){const{normalize:o}=Yo[e];if(o)return o(t,n,r);if(typeof t!="object"||!("value"in t))return{value:t};const{value:i}=t,a=st(t,Gj);return{value:i,settings:a}}function Kj(e,t,n,r,o,i){const{sanitize:a}=Yo[e];return a?a(t,n,r,o,i):t}function n0(e,t,n){const{format:r}=Yo[e];return r?r(t,n):t}function qj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function r0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ne(e){for(var t=1;te>n?n:e{if(e===""||typeof e=="number")return e;try{const t=io(e);if(!isNaN(t))return t}catch{}return parseFloat(e)},Yj=Math.log(10);function o0(e){let t=Math.abs(+String(e).replace(".",""));if(t===0)return .01;for(;t!==0&&t%10===0;)t/=10;const n=Math.floor(Math.log(t)/Yj)+1,r=Math.floor(Math.log10(Math.abs(e))),o=Math.pow(10,r-n);return Math.max(o,.001)}const Tc=(e,t,n)=>n===t?0:(So(e,t,n)-t)/(n-t),Ac=(e,t,n)=>e*(n-t)+t,Zj=()=>"_"+Math.random().toString(36).substr(2,9),i0=/\(([0-9+\-*/^ .]+)\)/,a0=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,s0=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,l0=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,c0=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,u0=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function io(e){if(isNaN(Number(e)))if(i0.test(e)){const t=e.replace(i0,(n,r)=>String(io(r)));return io(t)}else if(a0.test(e)){const t=e.replace(a0,(n,r,o)=>String(Math.pow(Number(r),Number(o))));return io(t)}else if(s0.test(e)){const t=e.replace(s0,(n,r,o)=>String(Number(r)*Number(o)));return io(t)}else if(l0.test(e)){const t=e.replace(l0,(n,r,o)=>{if(o!=0)return String(Number(r)/Number(o));throw new Error("Division by zero")});return io(t)}else if(c0.test(e)){const t=e.replace(c0,(n,r,o)=>String(Number(r)+Number(o)));return io(t)}else if(u0.test(e)){const t=e.replace(u0,(n,r,o)=>String(Number(r)-Number(o)));return io(t)}else return Number(e);return Number(e)}function Qj(e,t){return t.reduce((n,r)=>(e&&e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}function Jj(e,t){const n=Ne({},e);return t.forEach(r=>r in e&&delete n[r]),n}function eI(e,t){return e.reduce((n,r,o)=>Object.assign(n,{[t[o]]:r}),{})}function O3(e){return Object.prototype.toString.call(e)==="[object Object]"}const tI=e=>O3(e)&&Object.keys(e).length===0;let rr;(function(e){e.BUTTON="BUTTON",e.BUTTON_GROUP="BUTTON_GROUP",e.MONITOR="MONITOR",e.FOLDER="FOLDER"})(rr||(rr={}));let ar;(function(e){e.SELECT="SELECT",e.IMAGE="IMAGE",e.NUMBER="NUMBER",e.COLOR="COLOR",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.INTERVAL="INTERVAL",e.VECTOR3D="VECTOR3D",e.VECTOR2D="VECTOR2D"})(ar||(ar={}));const nI=["type","__customInput"],rI=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],oI=["type"];function E3(e,t,n={},r){var o,i;if(typeof e!="object"||Array.isArray(e))return{type:r,input:e,options:Ne({key:t,label:t,optional:!1,disabled:!1,order:0},n)};if("__customInput"in e){const{type:S,__customInput:b}=e,O=st(e,nI);return E3(b,t,O,S)}const{render:a,label:s,optional:l,order:c=0,disabled:u,hint:f,onChange:d,onEditStart:p,onEditEnd:h,transient:g}=e,v=st(e,rI),x=Ne({render:a,key:t,label:s??t,hint:f,transient:g??!!d,onEditStart:p,onEditEnd:h,disabled:u,optional:l,order:c},n);let{type:w}=v,$=st(v,oI);if(w=r??w,w in rr)return{type:w,input:$,options:x};let C;return r&&O3($)&&"value"in $?C=$.value:C=tI($)?void 0:$,{type:w,input:C,options:Ne(Ne({},x),{},{onChange:d,optional:(o=x.optional)!==null&&o!==void 0?o:!1,disabled:(i=x.disabled)!==null&&i!==void 0?i:!1})}}function iI(e,t,n,r){const o=E3(e,t),{type:i,input:a,options:s}=o;if(i)return i in rr?o:{type:i,input:yd(i,a,n,r),options:s};let l=t0(a);return l?{type:l,input:yd(l,a,n,r),options:s}:(l=t0({value:a}),l?{type:l,input:yd(l,{value:a},n,r),options:s}:!1)}function f0(e,t,n,r,o){const{value:i,type:a,settings:s}=e;e.value=P3({type:a,value:i,settings:s},t,n,r),e.fromPanel=o}const aI=function(t,n,r){this.type="LEVA_ERROR",this.message="LEVA: "+t,this.previousValue=n,this.error=r};function P3({type:e,value:t,settings:n},r,o,i){const a=e!=="SELECT"&&typeof r=="function"?r(t):r;let s;try{s=Kj(e,a,n,t,o,i)}catch(l){throw new aI(`The value \`${r}\` did not result in a correct value.`,t,l)}return vs(s,t)?t:s}const _3=(e,t,n=!1)=>{let r=0;return function(){const o=arguments,i=n&&!r,a=()=>e.apply(this,o);window.clearTimeout(r),r=window.setTimeout(a,t),i&&a()}},T3=e=>e.shiftKey?5:e.altKey?1/5:1;function sI(e,t){const n=console.error;console.error=()=>{},gi.render(e,t),console.error=n}const lI=["value"],cI=["min","max"],uI=e=>{if(typeof e=="number")return!0;if(typeof e=="string"){const t=parseFloat(e);return isNaN(t)?!1:e.substring((""+t).length).trim().length<4}return!1},A3=(e,{min:t=-1/0,max:n=1/0,suffix:r})=>{const o=parseFloat(e);if(e===""||isNaN(o))throw Error("Invalid number");const i=So(o,t,n);return r?i+r:i},fI=(e,{pad:t=0,suffix:n})=>{const r=parseFloat(e).toFixed(t);return n?r+n:r},k3=e=>{let{value:t}=e,n=st(e,lI);const{min:r=-1/0,max:o=1/0}=n,i=st(n,cI);let a=parseFloat(t);const s=typeof t=="string"?t.substring((""+a).length):void 0;a=So(a,r,o);let l=n.step;l||(Number.isFinite(r)?Number.isFinite(o)?l=+(Math.abs(o-r)/100).toPrecision(1):l=+(Math.abs(a-r)/100).toPrecision(1):Number.isFinite(o)&&(l=+(Math.abs(o-a)/100).toPrecision(1)));const c=l?o0(l)*10:o0(a);l=l||c/10;const u=Math.round(So(Math.log10(1/c),0,2));return{value:s?a+s:a,settings:Ne({initialValue:a,step:l,pad:u,min:r,max:o,suffix:s},i)}},j3=(e,{step:t,initialValue:n})=>{const r=Math.round((e-n)/t);return n+r*t};var I3=Object.freeze({__proto__:null,schema:uI,sanitize:A3,format:fI,normalize:k3,sanitizeStep:j3});function Ot(){return Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function Kl(e,t){const[n,r]=e.split(" "),o={};return n!=="none"&&(o.boxShadow=`${t.inset?"inset ":""}0 0 0 $borderWidths${[t.key]} $colors${n!=="default"&&n||t.borderColor}`),r&&(o.backgroundColor=r),o}const ja={$inputStyle:()=>e=>Kl(e,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>e=>Kl(e,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>e=>Kl(e,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>e=>Kl(e,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:De,css:pue,createTheme:pI,globalCss:hI,keyframes:hue}=i3({prefix:"leva",theme:N3(),utils:Ne(Ne({},ja),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:e=>({"&:focus":ja.$focusStyle()(e)}),$focusWithin:e=>({"&:focus-within":ja.$focusStyle()(e)}),$hover:e=>({"&:hover":ja.$hoverStyle()(e)}),$active:e=>({"&:active":ja.$activeStyle()(e)})})}),gI=hI({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function mI(e){const t=N3();if(!e)return{theme:t,className:""};Object.keys(e).forEach(r=>{Object.assign(t[r],e[r])});const n=pI(t);return{theme:t,className:n.className}}function Lr(e,t){const{theme:n}=y.useContext(Qg);if(!(e in n)||!(t in n[e]))return jr(xt.THEME_ERROR,e,t),"";let r=t;for(;;){let o=n[e][r];if(typeof o=="string"&&o.charAt(0)==="$")r=o.substr(1);else return o}}const L3=De("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),B3=De("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${L3}`]:{paddingLeft:0}}),vI=De(B3,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),yI=De("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),bI=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],xI=["onUpdate"];function Jg(e){let{innerLabel:t,value:n,onUpdate:r,onChange:o,onKeyDown:i,type:a,id:s,inputType:l="text",rows:c=0}=e,u=st(e,bI);const{id:f,emitOnEditStart:d,emitOnEditEnd:p,disabled:h}=en(),g=s||f,v=y.useRef(null),x=c>0,w=x?"textarea":"input",$=y.useCallback(b=>O=>{const P=O.currentTarget.value;b(P)},[]);E.useEffect(()=>{const b=v.current,O=$(P=>{r(P),p()});return b==null||b.addEventListener("blur",O),()=>b==null?void 0:b.removeEventListener("blur",O)},[$,r,p]);const C=y.useCallback(b=>{b.key==="Enter"&&$(r)(b)},[$,r]),S=Object.assign({as:w},x?{rows:c}:{},u);return E.createElement(yI,{textArea:x},t&&typeof t=="string"?E.createElement(B3,null,t):t,E.createElement(L3,Ot({levaType:a,ref:v,id:g,type:l,autoComplete:"off",spellCheck:"false",value:n,onChange:$(o),onFocus:()=>d(),onKeyPress:C,onKeyDown:i,disabled:h},S)))}function wI(e){let{onUpdate:t}=e,n=st(e,xI);const r=y.useCallback(i=>t(Xj(i)),[t]),o=y.useCallback(i=>{const a=i.key==="ArrowUp"?1:i.key==="ArrowDown"?-1:0;if(a){i.preventDefault();const s=i.altKey?.1:i.shiftKey?10:1;t(l=>parseFloat(l)+a*s)}},[t]);return E.createElement(Jg,Ot({},n,{onUpdate:r,onKeyDown:o,type:"number"}))}const kc=De("div",{}),Wp=De("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),SI=De("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${Wp}::after`]:{opacity:.6},[`${kc}:hover > & + ${Wp}::after`]:{opacity:.6},[`${kc}:hover > & > svg`]:{opacity:1}}),F3=De("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${kc}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),z3=De("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${F3} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),W3=De(z3,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),$I=De("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),CI=De("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),Vp=De("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),OI=De("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${Vp}`]:{pointerEvents:"auto"}}}}}),V3=De("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),EI=De("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),PI=De(Fj,{fill:"$toolTipBackground"});function em({children:e}){const{className:t}=y.useContext(Qg);return E.createElement(fA,{className:t},e)}const _I=["align"];function TI(){const{id:e,disable:t,disabled:n}=en();return E.createElement(E.Fragment,null,E.createElement(CI,{id:e+"__disable",type:"checkbox",checked:!n,onChange:()=>t(!n)}),E.createElement("label",{htmlFor:e+"__disable"}))}function AI(e){const{id:t,optional:n,hint:r}=en(),o=e.htmlFor||(t?{htmlFor:t}:null),i=!r&&typeof e.children=="string"?{title:e.children}:null;return E.createElement(E.Fragment,null,n&&E.createElement(TI,null),r!==void 0?E.createElement(Nj,null,E.createElement(Lj,{asChild:!0},E.createElement(Vp,Ot({},o,e))),E.createElement(Bj,{side:"top",sideOffset:2},E.createElement(EI,null,r,E.createElement(PI,null)))):E.createElement(Vp,Ot({},o,i,e)))}function lr(e){let{align:t}=e,n=st(e,_I);const{value:r,label:o,key:i,disabled:a}=en(),{hideCopyButton:s}=dI(),l=!s&&i!==void 0,[c,u]=y.useState(!1),f=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[i]:r??""})),u(!0)}catch{jr(xt.CLIPBOARD_ERROR,{[i]:r})}};return E.createElement($I,{align:t,onPointerLeave:()=>u(!1)},E.createElement(AI,n),l&&!a&&E.createElement("div",{title:`Click to copy ${typeof o=="string"?o:i} value`},c?E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},E.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),E.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):E.createElement("svg",{onClick:f,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},E.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),E.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const kI=["toggled"],jI=De("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function tm(e){let{toggled:t}=e,n=st(e,kI);return E.createElement(jI,Ot({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${t?0:-90}deg)`}},n),E.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const II=["input"];function qn(e){let{input:t}=e,n=st(e,II);return t?E.createElement(W3,n):E.createElement(z3,n)}function H3({value:e,type:t,settings:n,setValue:r}){const[o,i]=y.useState(n0(t,e,n)),a=y.useRef(e),s=y.useRef(n);s.current=n;const l=y.useCallback(u=>i(n0(t,u,s.current)),[t]),c=y.useCallback(u=>{try{r(u)}catch(f){const{type:d,previousValue:p}=f;if(d!=="LEVA_ERROR")throw f;l(p)}},[l,r]);return y.useEffect(()=>{vs(e,a.current)||l(e),a.current=e},[e,l]),{displayValue:o,onChange:i,onUpdate:c}}function yl(e,t){const{emitOnEditStart:n,emitOnEditEnd:r}=en();return Dk(o=>{o.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const i=e(o);return o.last&&(document.body.classList.remove("leva__panel__dragged"),r==null||r()),i},t)}function MI(e){const t=y.useRef(null),n=y.useRef(null),r=y.useRef(!1);return y.useEffect(()=>{const o=_3(()=>{t.current.width=t.current.offsetWidth*window.devicePixelRatio,t.current.height=t.current.offsetHeight*window.devicePixelRatio,e(t.current,n.current)},250);return window.addEventListener("resize",o),r.current||(o(),r.current=!0),()=>window.removeEventListener("resize",o)},[e]),y.useEffect(()=>{n.current=t.current.getContext("2d")},[]),[t,n]}function U3(){const e=y.useRef(null),t=y.useRef({x:0,y:0}),n=y.useCallback(r=>{Object.assign(t.current,r),e.current&&(e.current.style.transform=`translate3d(${t.current.x}px, ${t.current.y}px, 0)`)},[]);return[e,n]}const RI=["__refCount"],bd=(e,t)=>{if(!e[t])return null;const n=e[t];return st(n,RI)};function DI(e){const t=vl(),[n,r]=y.useState(bd(t.getData(),e)),o=y.useCallback(c=>t.setValueAtPath(e,c,!0),[e,t]),i=y.useCallback(c=>t.setSettingsAtPath(e,c),[e,t]),a=y.useCallback(c=>t.disableInputAtPath(e,c),[e,t]),s=y.useCallback(()=>t.emitOnEditStart(e),[e,t]),l=y.useCallback(()=>t.emitOnEditEnd(e),[e,t]);return y.useEffect(()=>{r(bd(t.getData(),e));const c=t.useStore.subscribe(u=>bd(u.data,e),r,{equalityFn:hl});return()=>c()},[t,e]),[n,{set:o,setSettings:i,disable:a,storeId:t.storeId,emitOnEditStart:s,emitOnEditEnd:l}]}const NI=De("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),G3=De("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),Hp=De("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),K3=De("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),q3=De("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function LI({value:e,min:t,max:n,onDrag:r,step:o,initialValue:i}){const a=y.useRef(null),s=y.useRef(null),l=y.useRef(0),c=Lr("sizes","scrubberWidth"),u=yl(({event:d,first:p,xy:[h],movement:[g],memo:v})=>{if(p){const{width:w,left:$}=a.current.getBoundingClientRect();l.current=w-parseFloat(c),v=(d==null?void 0:d.target)===s.current?e:Ac((h-$)/w,t,n)}const x=v+Ac(g/l.current,0,n-t);return r(j3(x,{step:o,initialValue:i})),v}),f=Tc(e,t,n);return E.createElement(K3,Ot({ref:a},u()),E.createElement(G3,null,E.createElement(q3,{style:{left:0,right:`${(1-f)*100}%`}})),E.createElement(Hp,{ref:s,style:{left:`calc(${f} * (100% - ${c}))`}}))}const BI=E.memo(({label:e,onUpdate:t,step:n,innerLabelTrim:r})=>{const[o,i]=y.useState(!1),a=yl(({active:s,delta:[l],event:c,memo:u=0})=>(i(s),u+=l/2,Math.abs(u)>=1&&(t(f=>parseFloat(f)+Math.floor(u)*n*T3(c)),u=0),u));return E.createElement(vI,Ot({dragging:o,title:e.length>1?e:""},a()),e.slice(0,r))});function X3({label:e,id:t,displayValue:n,onUpdate:r,onChange:o,settings:i,innerLabelTrim:a=1}){const s=a>0&&E.createElement(BI,{label:e,step:i.step,onUpdate:r,innerLabelTrim:a});return E.createElement(wI,{id:t,value:String(n),onUpdate:r,onChange:o,innerLabel:s})}function FI(){const e=en(),{label:t,value:n,onUpdate:r,settings:o,id:i}=e,{min:a,max:s}=o,l=s!==1/0&&a!==-1/0;return E.createElement(qn,{input:!0},E.createElement(lr,null,t),E.createElement(NI,{hasRange:l},l&&E.createElement(LI,Ot({value:parseFloat(n),onDrag:r},o)),E.createElement(X3,Ot({},e,{id:i,label:"value",innerLabelTrim:l?0:1}))))}const{sanitizeStep:zI}=I3,WI=st(I3,["sanitizeStep"]);var VI=Ne({component:FI},WI);const HI=(e,t)=>un().schema({options:un().passesAnyOf(un().object(),un().array())}).test(t),UI=(e,{values:t})=>{if(t.indexOf(e)<0)throw Error("Selected value doesn't match Select options");return e},GI=(e,{values:t})=>t.indexOf(e),KI=e=>{let{value:t,options:n}=e,r,o;return Array.isArray(n)?(o=n,r=n.map(i=>String(i))):(o=Object.values(n),r=Object.keys(n)),"value"in e?o.includes(t)||(r.unshift(String(t)),o.unshift(t)):t=o[0],Object.values(n).includes(t)||(n[String(t)]=t),{value:t,settings:{keys:r,values:o}}};var qI=Object.freeze({__proto__:null,schema:HI,sanitize:UI,format:GI,normalize:KI});const XI=De("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),Up=De("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),YI=De("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${Up}:focus + &`]:{$focusStyle:""},[`${Up}:hover + &`]:{$hoverStyle:""}});function ZI({displayValue:e,value:t,onUpdate:n,id:r,settings:o,disabled:i}){const{keys:a,values:s}=o,l=y.useRef();return t===s[e]&&(l.current=a[e]),E.createElement(XI,null,E.createElement(Up,{id:r,value:e,onChange:c=>n(s[Number(c.currentTarget.value)]),disabled:i},a.map((c,u)=>E.createElement("option",{key:c,value:u},c))),E.createElement(YI,null,l.current),E.createElement(tm,{toggled:!0}))}function QI(){const{label:e,value:t,displayValue:n,onUpdate:r,id:o,disabled:i,settings:a}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(ZI,{id:o,value:t,displayValue:n,onUpdate:r,settings:a,disabled:i}))}var JI=Ne({component:QI},qI);const eM=e=>un().string().test(e),tM=e=>{if(typeof e!="string")throw Error("Invalid string");return e},nM=({value:e,editable:t=!0,rows:n=!1})=>({value:e,settings:{editable:t,rows:typeof n=="number"?n:n?5:0}});var rM=Object.freeze({__proto__:null,schema:eM,sanitize:tM,normalize:nM});const oM=["displayValue","onUpdate","onChange","editable"],iM=De("div",{whiteSpace:"pre-wrap"});function aM(e){let{displayValue:t,onUpdate:n,onChange:r,editable:o=!0}=e,i=st(e,oM);return o?E.createElement(Jg,Ot({value:t,onUpdate:n,onChange:r},i)):E.createElement(iM,null,t)}function sM(){const{label:e,settings:t,displayValue:n,onUpdate:r,onChange:o}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(aM,Ot({displayValue:n,onUpdate:r,onChange:o},t)))}var lM=Ne({component:sM},rM);const cM=e=>un().boolean().test(e),uM=e=>{if(typeof e!="boolean")throw Error("Invalid boolean");return e};var fM=Object.freeze({__proto__:null,schema:cM,sanitize:uM});const dM=De("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function pM({value:e,onUpdate:t,id:n,disabled:r}){return E.createElement(dM,null,E.createElement("input",{id:n,type:"checkbox",checked:e,onChange:o=>t(o.currentTarget.checked),disabled:r}),E.createElement("label",{htmlFor:n},E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},E.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function hM(){const{label:e,value:t,onUpdate:n,disabled:r,id:o}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(pM,{value:t,onUpdate:n,id:o,disabled:r}))}var gM=Ne({component:hM},fM);const mM=["locked"];function vM({value:e,id:t,valueKey:n,settings:r,onUpdate:o,innerLabelTrim:i}){const a=y.useRef(e[n]);a.current=e[n];const s=y.useCallback(c=>o({[n]:P3({type:"NUMBER",value:a.current,settings:r},c)}),[o,r,n]),l=H3({type:"NUMBER",value:e[n],settings:r,setValue:s});return E.createElement(X3,{id:t,label:n,value:e[n],displayValue:l.displayValue,onUpdate:l.onUpdate,onChange:l.onChange,settings:r,innerLabelTrim:i})}const yM=De("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function bM(e){let{locked:t}=e,n=st(e,mM);return E.createElement("svg",Ot({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),t?E.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):E.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function nm({value:e,onUpdate:t,settings:n,innerLabelTrim:r}){const{id:o,setSettings:i}=en(),{lock:a,locked:s}=n;return E.createElement(yM,{withLock:a},a&&E.createElement(bM,{locked:s,onClick:()=>i({locked:!s})}),Object.keys(e).map((l,c)=>E.createElement(vM,{id:c===0?o:`${o}.${l}`,key:l,valueKey:l,value:e,settings:n[l],onUpdate:t,innerLabelTrim:r})))}const Y3=(e,t)=>{const n={};let r=0,o=1/0;Object.entries(e).forEach(([i,a])=>{n[i]=k3(Ne({value:a},t[i])).settings,r=Math.max(r,n[i].step),o=Math.min(o,n[i].pad)});for(let i in n){const{step:a,min:s,max:l}=t[i]||{};!isFinite(a)&&(!isFinite(s)||!isFinite(l))&&(n[i].step=r,n[i].pad=o)}return n},xM=["lock"],wM=["value"];function SM(e){const t=un().array().length(e).every.number(),n=r=>{if(!r||typeof r!="object")return!1;const o=Object.values(r);return o.length===e&&o.every(i=>isFinite(i))};return r=>t.test(r)||n(r)}function $M(e){return Array.isArray(e)?"array":"object"}function rs(e,t,n){return $M(e)===t?e:t==="array"?Object.values(e):eI(e,n)}const CM=(e,t,n)=>{const r=rs(e,"object",t.keys);for(let a in r)r[a]=A3(r[a],t[a]);const o=Object.keys(r);let i={};if(o.length===t.keys.length)i=r;else{const a=rs(n,"object",t.keys);if(o.length===1&&t.locked){const s=o[0],l=r[s],c=a[s],u=c!==0?l/c:1;for(let f in a)f===s?i[s]=l:i[f]=a[f]*u}else i=Ne(Ne({},a),r)}return rs(i,t.format,t.keys)},OM=(e,t)=>rs(e,"object",t.keys),EM=e=>!!e&&("step"in e||"min"in e||"max"in e);function PM(e,t,n=[]){const{lock:r=!1}=t,o=st(t,xM),i=Array.isArray(e)?"array":"object",a=i==="object"?Object.keys(e):n,s=rs(e,"object",a),l=EM(o)?a.reduce((u,f)=>Object.assign(u,{[f]:o}),{}):o,c=Y3(s,l);return{value:i==="array"?e:s,settings:Ne(Ne({},c),{},{format:i,keys:a,lock:r,locked:!1})}}function Z3(e){return{schema:SM(e.length),normalize:t=>{let{value:n}=t,r=st(t,wM);return PM(n,r,e)},format:(t,n)=>OM(t,n),sanitize:(t,n,r)=>CM(t,n,r)}}var _M={grad:.9,turn:360,rad:360/(2*Math.PI)},Tr=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},Ft=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Ln=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},Q3=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},d0=function(e){return{r:Ln(e.r,0,255),g:Ln(e.g,0,255),b:Ln(e.b,0,255),a:Ln(e.a)}},xd=function(e){return{r:Ft(e.r),g:Ft(e.g),b:Ft(e.b),a:Ft(e.a,3)}},TM=/^#([0-9a-f]{3,8})$/i,ql=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},J3=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:60*(s<0?s+6:s),s:i?a/i*100:0,v:i/255*100,a:o}},eS=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,s,a,a,l,r][c],g:255*[l,r,r,s,a,a][c],b:255*[a,a,l,r,r,s][c],a:o}},p0=function(e){return{h:Q3(e.h),s:Ln(e.s,0,100),l:Ln(e.l,0,100),a:Ln(e.a)}},h0=function(e){return{h:Ft(e.h),s:Ft(e.s),l:Ft(e.l),a:Ft(e.a,3)}},g0=function(e){return eS((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},os=function(e){return{h:(t=J3(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},AM=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,kM=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,jM=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,IM=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Gp={string:[[function(e){var t=TM.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:e.length===4?Ft(parseInt(e[3]+e[3],16)/255,2):1}:e.length===6||e.length===8?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:e.length===8?Ft(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=jM.exec(e)||IM.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:d0({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=AM.exec(e)||kM.exec(e);if(!t)return null;var n,r,o=p0({h:(n=t[1],r=t[2],r===void 0&&(r="deg"),Number(n)*(_M[r]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return g0(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=o===void 0?1:o;return Tr(t)&&Tr(n)&&Tr(r)?d0({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=o===void 0?1:o;if(!Tr(t)||!Tr(n)||!Tr(r))return null;var a=p0({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return g0(a)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=o===void 0?1:o;if(!Tr(t)||!Tr(n)||!Tr(r))return null;var a=function(s){return{h:Q3(s.h),s:Ln(s.s,0,100),v:Ln(s.v,0,100),a:Ln(s.a)}}({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return eS(a)},"hsv"]]},m0=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=xd(this.rgba),n=t.r,r=t.g,o=t.b,a=(i=t.a)<1?ql(Ft(255*i)):"","#"+ql(n)+ql(r)+ql(o)+a;var t,n,r,o,i,a},e.prototype.toRgb=function(){return xd(this.rgba)},e.prototype.toRgbString=function(){return t=xd(this.rgba),n=t.r,r=t.g,o=t.b,(i=t.a)<1?"rgba("+n+", "+r+", "+o+", "+i+")":"rgb("+n+", "+r+", "+o+")";var t,n,r,o,i},e.prototype.toHsl=function(){return h0(os(this.rgba))},e.prototype.toHslString=function(){return t=h0(os(this.rgba)),n=t.h,r=t.s,o=t.l,(i=t.a)<1?"hsla("+n+", "+r+"%, "+o+"%, "+i+")":"hsl("+n+", "+r+"%, "+o+"%)";var t,n,r,o,i},e.prototype.toHsv=function(){return t=J3(this.rgba),{h:Ft(t.h),s:Ft(t.s),v:Ft(t.v),a:Ft(t.a,3)};var t},e.prototype.invert=function(){return rn({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),rn(wd(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),rn(wd(this.rgba,-t))},e.prototype.grayscale=function(){return rn(wd(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),rn(v0(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),rn(v0(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},e.prototype.alpha=function(t){return typeof t=="number"?rn({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):Ft(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=os(this.rgba);return typeof t=="number"?rn({h:t,s:n.s,l:n.l,a:n.a}):Ft(n.h)},e.prototype.isEqual=function(t){return this.toHex()===rn(t).toHex()},e}(),rn=function(e){return e instanceof Kp?e:new Kp(e)},y0=[],RM=function(e){e.forEach(function(t){y0.indexOf(t)<0&&(t(Kp,Gp),y0.push(t))})};function DM(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,l,c=r[this.toHex()];if(c)return c;if(a!=null&&a.closest){var u=this.toRgb(),f=1/0,d="black";if(!i.length)for(var p in n)i[p]=new e(n[p]).toRgb();for(var h in n){var g=(s=u,l=i[h],Math.pow(s.r-l.r,2)+Math.pow(s.g-l.g,2)+Math.pow(s.b-l.b,2));g=0||(o[n]=e[n]);return o}function qp(e){var t=y.useRef(e),n=y.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Bi=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:v.buttons>0)&&o.current?i(b0(o.current,v,s.current)):g(!1)},h=function(){return g(!1)};function g(v){var x=l.current,w=Xp(o.current),$=v?w.addEventListener:w.removeEventListener;$(x?"touchmove":"mousemove",p),$(x?"touchend":"mouseup",h)}return[function(v){var x=v.nativeEvent,w=o.current;if(w&&(x0(x),!function(C,S){return S&&!is(C)}(x,l.current)&&w)){if(is(x)){l.current=!0;var $=x.changedTouches||[];$.length&&(s.current=$[0].identifier)}w.focus(),i(b0(w,x,s.current)),g(!0)}},function(v){var x=v.which||v.keyCode;x<37||x>40||(v.preventDefault(),a({left:x===39?.05:x===37?-.05:0,top:x===40?.05:x===38?-.05:0}))},g]},[a,i]),u=c[0],f=c[1],d=c[2];return y.useEffect(function(){return d},[d]),E.createElement("div",va({},r,{onTouchStart:u,onMouseDown:u,className:"react-colorful__interactive",ref:o,onKeyDown:f,tabIndex:0,role:"slider"}))}),bl=function(e){return e.filter(Boolean).join(" ")},im=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,i=bl(["react-colorful__pointer",e.className]);return E.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},E.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},sn=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},nS=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:sn(e.h),s:sn(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:sn(o/2),a:sn(r,2)}},Yp=function(e){var t=nS(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},$d=function(e){var t=nS(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},rS=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),a=r*(1-n),s=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:sn(255*[r,s,a,a,l,r][c]),g:sn(255*[l,r,r,s,a,a][c]),b:sn(255*[a,a,l,r,r,s][c]),a:sn(o,2)}},oS=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),a=i-Math.min(t,n,r),s=a?i===t?(n-r)/a:i===n?2+(r-t)/a:4+(t-n)/a:0;return{h:sn(60*(s<0?s+6:s)),s:sn(i?a/i*100:0),v:sn(i/255*100),a:o}},iS=E.memo(function(e){var t=e.hue,n=e.onChange,r=bl(["react-colorful__hue",e.className]);return E.createElement("div",{className:r},E.createElement(om,{onMove:function(o){n({h:360*o.left})},onKey:function(o){n({h:Bi(t+360*o.left,0,360)})},"aria-label":"Hue","aria-valuenow":sn(t),"aria-valuemax":"360","aria-valuemin":"0"},E.createElement(im,{className:"react-colorful__hue-pointer",left:t/360,color:Yp({h:t,s:100,v:100,a:1})})))}),aS=E.memo(function(e){var t=e.hsva,n=e.onChange,r={backgroundColor:Yp({h:t.h,s:100,v:100,a:1})};return E.createElement("div",{className:"react-colorful__saturation",style:r},E.createElement(om,{onMove:function(o){n({s:100*o.left,v:100-100*o.top})},onKey:function(o){n({s:Bi(t.s+100*o.left,0,100),v:Bi(t.v-100*o.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+sn(t.s)+"%, Brightness "+sn(t.v)+"%"},E.createElement(im,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:Yp(t)})))}),am=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function sS(e,t,n){var r=qp(n),o=y.useState(function(){return e.toHsva(t)}),i=o[0],a=o[1],s=y.useRef({color:t,hsva:i});y.useEffect(function(){if(!e.equal(t,s.current.color)){var c=e.toHsva(t);s.current={hsva:c,color:t},a(c)}},[t,e]),y.useEffect(function(){var c;am(i,s.current.hsva)||e.equal(c=e.fromHsva(i),s.current.color)||(s.current={hsva:i,color:c},r(c))},[i,e,r]);var l=y.useCallback(function(c){a(function(u){return Object.assign({},u,c)})},[]);return[i,l]}var NM=typeof window<"u"?y.useLayoutEffect:y.useEffect,LM=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},w0=new Map,lS=function(e){NM(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!w0.has(t)){var n=t.createElement("style");n.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`,w0.set(t,n);var r=LM();r&&n.setAttribute("nonce",r),t.head.appendChild(n)}},[])},BM=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,i=e.onChange,a=rm(e,["className","colorModel","color","onChange"]),s=y.useRef(null);lS(s);var l=sS(n,o,i),c=l[0],u=l[1],f=bl(["react-colorful",t]);return E.createElement("div",va({},a,{ref:s,className:f}),E.createElement(aS,{hsva:c,onChange:u}),E.createElement(iS,{hue:c.h,onChange:u,className:"react-colorful__last-control"}))},FM=function(e){var t=e.className,n=e.hsva,r=e.onChange,o={backgroundImage:"linear-gradient(90deg, "+$d(Object.assign({},n,{a:0}))+", "+$d(Object.assign({},n,{a:1}))+")"},i=bl(["react-colorful__alpha",t]),a=sn(100*n.a);return E.createElement("div",{className:i},E.createElement("div",{className:"react-colorful__alpha-gradient",style:o}),E.createElement(om,{onMove:function(s){r({a:s.left})},onKey:function(s){r({a:Bi(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},E.createElement(im,{className:"react-colorful__alpha-pointer",left:n.a,color:$d(n)})))},zM=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,i=e.onChange,a=rm(e,["className","colorModel","color","onChange"]),s=y.useRef(null);lS(s);var l=sS(n,o,i),c=l[0],u=l[1],f=bl(["react-colorful",t]);return E.createElement("div",va({},a,{ref:s,className:f}),E.createElement(aS,{hsva:c,onChange:u}),E.createElement(iS,{hue:c.h,onChange:u}),E.createElement(FM,{hsva:c,onChange:u,className:"react-colorful__last-control"}))},WM={defaultColor:{r:0,g:0,b:0,a:1},toHsva:oS,fromHsva:rS,equal:am},VM=function(e){return E.createElement(zM,va({},e,{colorModel:WM}))},HM={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return oS({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(t=rS(e)).r,g:t.g,b:t.b};var t},equal:am},UM=function(e){return E.createElement(BM,va({},e,{colorModel:HM}))};function gue(e,t,n,r){var o=arguments.length,i=o<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(i=(o<3?a(i):o>3?a(t,n,i):a(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i}function ya(e,t,n,r){function o(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function s(u){try{c(r.next(u))}catch(f){a(f)}}function l(u){try{c(r.throw(u))}catch(f){a(f)}}function c(u){u.done?i(u.value):o(u.value).then(s,l)}c((r=r.apply(e,t||[])).next())})}function ba(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]0)&&!(o=r.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return i}function KM(){for(var e=[],t=0;t0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function XM(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=qM.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var YM=[".DS_Store","Thumbs.db"];function ZM(e){return ya(this,void 0,void 0,function(){return ba(this,function(t){return jc(e)&&QM(e)?[2,nR(e.dataTransfer,e.type)]:JM(e)?[2,eR(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,tR(e)]:[2,[]]})})}function QM(e){return jc(e.dataTransfer)}function JM(e){return jc(e)&&jc(e.target)}function jc(e){return typeof e=="object"&&e!==null}function eR(e){return Zp(e.target.files).map(function(t){return xl(t)})}function tR(e){return ya(this,void 0,void 0,function(){var t;return ba(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return xl(r)})]}})})}function nR(e,t){return ya(this,void 0,void 0,function(){var n,r;return ba(this,function(o){switch(o.label){case 0:return e===null?[2,[]]:e.items?(n=Zp(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(rR))]):[3,2];case 1:return r=o.sent(),[2,S0(cS(r))];case 2:return[2,S0(Zp(e.files).map(function(i){return xl(i)}))]}})})}function S0(e){return e.filter(function(t){return YM.indexOf(t.name)===-1})}function Zp(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,_0(n)];if(e.sizen)return[!1,_0(n)]}return[!0,null]}function Ia(e){return e!=null}function vR(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,a=e.maxFiles;return!i&&t.length>1||i&&a>=1&&t.length>a?!1:t.every(function(s){var l=dS(s,n),c=E0(l,1),u=c[0],f=pS(s,r,o),d=E0(f,1),p=d[0];return u&&p})}function Ic(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Xl(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function A0(e){e.preventDefault()}function yR(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function bR(e){return e.indexOf("Edge/")!==-1}function xR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return yR(e)||bR(e)}function dr(){for(var e=arguments.length,t=new Array(e),n=0;n1?o-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DR(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var sm=y.forwardRef(function(e,t){var n=e.children,r=Mc(e,OR),o=mS(r),i=o.open,a=Mc(o,ER);return y.useImperativeHandle(t,function(){return{open:i}},[i]),E.createElement(y.Fragment,null,n(bt(bt({},a),{},{open:i})))});sm.displayName="Dropzone";var gS={disabled:!1,getFilesFromEvent:ZM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};sm.defaultProps=gS;sm.propTypes={children:Ee.func,accept:Ee.oneOfType([Ee.string,Ee.arrayOf(Ee.string)]),multiple:Ee.bool,preventDropOnDocument:Ee.bool,noClick:Ee.bool,noKeyboard:Ee.bool,noDrag:Ee.bool,noDragEventsBubbling:Ee.bool,minSize:Ee.number,maxSize:Ee.number,maxFiles:Ee.number,disabled:Ee.bool,getFilesFromEvent:Ee.func,onFileDialogCancel:Ee.func,onFileDialogOpen:Ee.func,useFsAccessApi:Ee.bool,onDragEnter:Ee.func,onDragLeave:Ee.func,onDragOver:Ee.func,onDrop:Ee.func,onDropAccepted:Ee.func,onDropRejected:Ee.func,validator:Ee.func};var Jp={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function mS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=bt(bt({},gS),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,c=t.onDragEnter,u=t.onDragLeave,f=t.onDragOver,d=t.onDrop,p=t.onDropAccepted,h=t.onDropRejected,g=t.onFileDialogCancel,v=t.onFileDialogOpen,x=t.useFsAccessApi,w=t.preventDropOnDocument,$=t.noClick,C=t.noKeyboard,S=t.noDrag,b=t.noDragEventsBubbling,O=t.validator,P=y.useMemo(function(){return typeof v=="function"?v:j0},[v]),T=y.useMemo(function(){return typeof g=="function"?g:j0},[g]),k=y.useRef(null),_=y.useRef(null),A=y.useReducer(NR,Jp),I=$d(A,2),j=I[0],M=I[1],D=j.isFocused,L=j.isFileDialogActive,B=j.draggedFiles,F=y.useRef(typeof window<"u"&&window.isSecureContext&&x&&wR()),Z=function(){!F.current&&L&&setTimeout(function(){if(_.current){var V=_.current.files;V.length||(M({type:"closeDialog"}),T())}},300)};y.useEffect(function(){return window.addEventListener("focus",Z,!1),function(){window.removeEventListener("focus",Z,!1)}},[_,L,T,F]);var ie=y.useRef([]),te=function(V){k.current&&k.current.contains(V.target)||(V.preventDefault(),ie.current=[])};y.useEffect(function(){return w&&(document.addEventListener("dragover",A0,!1),document.addEventListener("drop",te,!1)),function(){w&&(document.removeEventListener("dragover",A0),document.removeEventListener("drop",te))}},[k,w]);var le=y.useCallback(function(W){W.preventDefault(),W.persist(),se(W),ie.current=[].concat(TR(ie.current),[W.target]),Xl(W)&&Promise.resolve(o(W)).then(function(V){Ic(W)&&!b||(M({draggedFiles:V,isDragActive:!0,type:"setDraggedFiles"}),c&&c(W))})},[o,c,b]),re=y.useCallback(function(W){W.preventDefault(),W.persist(),se(W);var V=Xl(W);if(V&&W.dataTransfer)try{W.dataTransfer.dropEffect="copy"}catch{}return V&&f&&f(W),!1},[f,b]),ae=y.useCallback(function(W){W.preventDefault(),W.persist(),se(W);var V=ie.current.filter(function(ue){return k.current&&k.current.contains(ue)}),q=V.indexOf(W.target);q!==-1&&V.splice(q,1),ie.current=V,!(V.length>0)&&(M({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),Xl(W)&&u&&u(W))},[k,u,b]),xe=y.useCallback(function(W,V){var q=[],ue=[];W.forEach(function(Ae){var Se=dS(Ae,n),ne=$d(Se,2),Ze=ne[0],St=ne[1],$t=pS(Ae,a,i),Oe=$d($t,2),Be=Oe[0],oe=Oe[1],$e=O?O(Ae):null;if(Ze&&Be&&!$e)q.push(Ae);else{var Fe=[St,oe];$e&&(Fe=Fe.concat($e)),ue.push({file:Ae,errors:Fe.filter(function(Ve){return Ve})})}}),(!s&&q.length>1||s&&l>=1&&q.length>l)&&(q.forEach(function(Ae){ue.push({file:Ae,errors:[mR]})}),q.splice(0)),M({acceptedFiles:q,fileRejections:ue,type:"setFiles"}),d&&d(q,ue,V),ue.length>0&&h&&h(ue,V),q.length>0&&p&&p(q,V)},[M,s,n,a,i,l,d,p,h,O]),Me=y.useCallback(function(W){W.preventDefault(),W.persist(),se(W),ie.current=[],Xl(W)&&Promise.resolve(o(W)).then(function(V){Ic(W)&&!b||xe(V,W)}),M({type:"reset"})},[o,xe,b]),we=y.useCallback(function(){if(F.current){M({type:"openDialog"}),P();var W={multiple:s,types:SR(n)};window.showOpenFilePicker(W).then(function(V){return o(V)}).then(function(V){xe(V,null),M({type:"closeDialog"})}).catch(function(V){$R(V)?(T(V),M({type:"closeDialog"})):CR(V)&&(F.current=!1,_.current&&(_.current.value=null,_.current.click()))});return}_.current&&(M({type:"openDialog"}),P(),_.current.value=null,_.current.click())},[M,P,T,x,xe,n,s]),Y=y.useCallback(function(W){!k.current||!k.current.isEqualNode(W.target)||(W.key===" "||W.key==="Enter"||W.keyCode===32||W.keyCode===13)&&(W.preventDefault(),we())},[k,we]),ve=y.useCallback(function(){M({type:"focus"})},[]),ce=y.useCallback(function(){M({type:"blur"})},[]),G=y.useCallback(function(){$||(xR()?setTimeout(we,0):we())},[$,we]),fe=function(V){return r?null:V},de=function(V){return C?null:fe(V)},pe=function(V){return S?null:fe(V)},se=function(V){b&&V.stopPropagation()},Le=y.useMemo(function(){return function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=W.refKey,q=V===void 0?"ref":V,ue=W.role,Ae=W.onKeyDown,Se=W.onFocus,ne=W.onBlur,Ze=W.onClick,St=W.onDragEnter,$t=W.onDragOver,Oe=W.onDragLeave,Be=W.onDrop,oe=Mc(W,PR);return bt(bt(Qp({onKeyDown:de(dr(Ae,Y)),onFocus:de(dr(Se,ve)),onBlur:de(dr(ne,ce)),onClick:fe(dr(Ze,G)),onDragEnter:pe(dr(St,le)),onDragOver:pe(dr($t,re)),onDragLeave:pe(dr(Oe,ae)),onDrop:pe(dr(Be,Me)),role:typeof ue=="string"&&ue!==""?ue:"button"},q,k),!r&&!C?{tabIndex:0}:{}),oe)}},[k,Y,ve,ce,G,le,re,ae,Me,C,S,r]),Ce=y.useCallback(function(W){W.stopPropagation()},[]),Ge=y.useMemo(function(){return function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=W.refKey,q=V===void 0?"ref":V,ue=W.onChange,Ae=W.onClick,Se=Mc(W,_R),ne=Qp({accept:n,multiple:s,type:"file",style:{display:"none"},onChange:fe(dr(ue,Me)),onClick:fe(dr(Ae,Ce)),tabIndex:-1},q,_);return bt(bt({},ne),Se)}},[_,n,s,Me,r]),N=B.length,z=N>0&&vR({files:B,accept:n,minSize:a,maxSize:i,multiple:s,maxFiles:l}),U=N>0&&!z;return bt(bt({},j),{},{isDragAccept:z,isDragReject:U,isFocused:D&&!r,getRootProps:Le,getInputProps:Ge,rootRef:k,inputRef:_,open:fe(we)})}function NR(e,t){switch(t.type){case"focus":return bt(bt({},e),{},{isFocused:!0});case"blur":return bt(bt({},e),{},{isFocused:!1});case"openDialog":return bt(bt({},Jp),{},{isFileDialogActive:!0});case"closeDialog":return bt(bt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return bt(bt({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return bt(bt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return bt({},Jp);default:return e}}function j0(){}function LR(e){let t;const n=new Set,r=(c,u)=>{const f=typeof c=="function"?c(t):c;if(f!==t){const d=t;t=u?f:Object.assign({},t,f),n.forEach(p=>p(t,d))}},o=()=>t,i=(c,u=o,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(t);function p(){const h=u(t);if(!f(d,h)){const g=d;c(d=h,g)}}return n.add(p),()=>n.delete(p)},l={setState:r,getState:o,subscribe:(c,u,f)=>u||f?i(c,u,f):(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return t=e(r,o,l),l}const BR=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),I0=BR?y.useEffect:y.useLayoutEffect;function FR(e){const t=typeof e=="function"?LR(e):e,n=(r=t.getState,o=Object.is)=>{const[,i]=y.useReducer(v=>v+1,0),a=t.getState(),s=y.useRef(a),l=y.useRef(r),c=y.useRef(o),u=y.useRef(!1),f=y.useRef();f.current===void 0&&(f.current=r(a));let d,p=!1;(s.current!==a||l.current!==r||c.current!==o||u.current)&&(d=r(a),p=!o(f.current,d)),I0(()=>{p&&(f.current=d),s.current=a,l.current=r,c.current=o,u.current=!1});const h=y.useRef(a);I0(()=>{const v=()=>{try{const w=t.getState(),$=l.current(w);c.current(f.current,$)||(s.current=w,f.current=$,i())}catch{u.current=!0,i()}},x=t.subscribe(v);return t.getState()!==h.current&&v(),x},[]);const g=p?d:f.current;return y.useDebugValue(g),g};return Object.assign(n,t),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[n,t];return{next(){const o=r.length<=0;return{value:r.shift(),done:o}}}},n}const zR=e=>(t,n,r)=>{const o=r.subscribe;return r.subscribe=(a,s,l)=>{let c=a;if(s){const u=(l==null?void 0:l.equalityFn)||Object.is;let f=a(r.getState());c=d=>{const p=a(d);if(!u(f,p)){const h=f;s(f=p,h)}},l!=null&&l.fireImmediately&&s(f,f)}return o(c)},e(t,n,r)};/*! +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kR(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function jR(e){if(Array.isArray(e))return Qp(e)}function Cd(e,t){return RR(e)||MR(e,t)||hS(e,t)||IR()}function IR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hS(e,t){if(e){if(typeof e=="string")return Qp(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qp(e,t)}}function Qp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function DR(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var sm=y.forwardRef(function(e,t){var n=e.children,r=Mc(e,OR),o=mS(r),i=o.open,a=Mc(o,ER);return y.useImperativeHandle(t,function(){return{open:i}},[i]),E.createElement(y.Fragment,null,n(bt(bt({},a),{},{open:i})))});sm.displayName="Dropzone";var gS={disabled:!1,getFilesFromEvent:ZM,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};sm.defaultProps=gS;sm.propTypes={children:Ee.func,accept:Ee.oneOfType([Ee.string,Ee.arrayOf(Ee.string)]),multiple:Ee.bool,preventDropOnDocument:Ee.bool,noClick:Ee.bool,noKeyboard:Ee.bool,noDrag:Ee.bool,noDragEventsBubbling:Ee.bool,minSize:Ee.number,maxSize:Ee.number,maxFiles:Ee.number,disabled:Ee.bool,getFilesFromEvent:Ee.func,onFileDialogCancel:Ee.func,onFileDialogOpen:Ee.func,useFsAccessApi:Ee.bool,onDragEnter:Ee.func,onDragLeave:Ee.func,onDragOver:Ee.func,onDrop:Ee.func,onDropAccepted:Ee.func,onDropRejected:Ee.func,validator:Ee.func};var eh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function mS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=bt(bt({},gS),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,c=t.onDragEnter,u=t.onDragLeave,f=t.onDragOver,d=t.onDrop,p=t.onDropAccepted,h=t.onDropRejected,g=t.onFileDialogCancel,v=t.onFileDialogOpen,x=t.useFsAccessApi,w=t.preventDropOnDocument,$=t.noClick,C=t.noKeyboard,S=t.noDrag,b=t.noDragEventsBubbling,O=t.validator,P=y.useMemo(function(){return typeof v=="function"?v:j0},[v]),T=y.useMemo(function(){return typeof g=="function"?g:j0},[g]),k=y.useRef(null),_=y.useRef(null),A=y.useReducer(NR,eh),I=Cd(A,2),j=I[0],M=I[1],D=j.isFocused,L=j.isFileDialogActive,B=j.draggedFiles,F=y.useRef(typeof window<"u"&&window.isSecureContext&&x&&wR()),Z=function(){!F.current&&L&&setTimeout(function(){if(_.current){var V=_.current.files;V.length||(M({type:"closeDialog"}),T())}},300)};y.useEffect(function(){return window.addEventListener("focus",Z,!1),function(){window.removeEventListener("focus",Z,!1)}},[_,L,T,F]);var ie=y.useRef([]),te=function(V){k.current&&k.current.contains(V.target)||(V.preventDefault(),ie.current=[])};y.useEffect(function(){return w&&(document.addEventListener("dragover",A0,!1),document.addEventListener("drop",te,!1)),function(){w&&(document.removeEventListener("dragover",A0),document.removeEventListener("drop",te))}},[k,w]);var le=y.useCallback(function(W){W.preventDefault(),W.persist(),se(W),ie.current=[].concat(TR(ie.current),[W.target]),Xl(W)&&Promise.resolve(o(W)).then(function(V){Ic(W)&&!b||(M({draggedFiles:V,isDragActive:!0,type:"setDraggedFiles"}),c&&c(W))})},[o,c,b]),re=y.useCallback(function(W){W.preventDefault(),W.persist(),se(W);var V=Xl(W);if(V&&W.dataTransfer)try{W.dataTransfer.dropEffect="copy"}catch{}return V&&f&&f(W),!1},[f,b]),ae=y.useCallback(function(W){W.preventDefault(),W.persist(),se(W);var V=ie.current.filter(function(ue){return k.current&&k.current.contains(ue)}),q=V.indexOf(W.target);q!==-1&&V.splice(q,1),ie.current=V,!(V.length>0)&&(M({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),Xl(W)&&u&&u(W))},[k,u,b]),xe=y.useCallback(function(W,V){var q=[],ue=[];W.forEach(function(Ae){var Se=dS(Ae,n),ne=Cd(Se,2),Ze=ne[0],St=ne[1],$t=pS(Ae,a,i),Oe=Cd($t,2),Be=Oe[0],oe=Oe[1],$e=O?O(Ae):null;if(Ze&&Be&&!$e)q.push(Ae);else{var Fe=[St,oe];$e&&(Fe=Fe.concat($e)),ue.push({file:Ae,errors:Fe.filter(function(Ve){return Ve})})}}),(!s&&q.length>1||s&&l>=1&&q.length>l)&&(q.forEach(function(Ae){ue.push({file:Ae,errors:[mR]})}),q.splice(0)),M({acceptedFiles:q,fileRejections:ue,type:"setFiles"}),d&&d(q,ue,V),ue.length>0&&h&&h(ue,V),q.length>0&&p&&p(q,V)},[M,s,n,a,i,l,d,p,h,O]),Me=y.useCallback(function(W){W.preventDefault(),W.persist(),se(W),ie.current=[],Xl(W)&&Promise.resolve(o(W)).then(function(V){Ic(W)&&!b||xe(V,W)}),M({type:"reset"})},[o,xe,b]),we=y.useCallback(function(){if(F.current){M({type:"openDialog"}),P();var W={multiple:s,types:SR(n)};window.showOpenFilePicker(W).then(function(V){return o(V)}).then(function(V){xe(V,null),M({type:"closeDialog"})}).catch(function(V){$R(V)?(T(V),M({type:"closeDialog"})):CR(V)&&(F.current=!1,_.current&&(_.current.value=null,_.current.click()))});return}_.current&&(M({type:"openDialog"}),P(),_.current.value=null,_.current.click())},[M,P,T,x,xe,n,s]),Y=y.useCallback(function(W){!k.current||!k.current.isEqualNode(W.target)||(W.key===" "||W.key==="Enter"||W.keyCode===32||W.keyCode===13)&&(W.preventDefault(),we())},[k,we]),ve=y.useCallback(function(){M({type:"focus"})},[]),ce=y.useCallback(function(){M({type:"blur"})},[]),G=y.useCallback(function(){$||(xR()?setTimeout(we,0):we())},[$,we]),fe=function(V){return r?null:V},de=function(V){return C?null:fe(V)},pe=function(V){return S?null:fe(V)},se=function(V){b&&V.stopPropagation()},Le=y.useMemo(function(){return function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=W.refKey,q=V===void 0?"ref":V,ue=W.role,Ae=W.onKeyDown,Se=W.onFocus,ne=W.onBlur,Ze=W.onClick,St=W.onDragEnter,$t=W.onDragOver,Oe=W.onDragLeave,Be=W.onDrop,oe=Mc(W,PR);return bt(bt(Jp({onKeyDown:de(dr(Ae,Y)),onFocus:de(dr(Se,ve)),onBlur:de(dr(ne,ce)),onClick:fe(dr(Ze,G)),onDragEnter:pe(dr(St,le)),onDragOver:pe(dr($t,re)),onDragLeave:pe(dr(Oe,ae)),onDrop:pe(dr(Be,Me)),role:typeof ue=="string"&&ue!==""?ue:"button"},q,k),!r&&!C?{tabIndex:0}:{}),oe)}},[k,Y,ve,ce,G,le,re,ae,Me,C,S,r]),Ce=y.useCallback(function(W){W.stopPropagation()},[]),Ge=y.useMemo(function(){return function(){var W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=W.refKey,q=V===void 0?"ref":V,ue=W.onChange,Ae=W.onClick,Se=Mc(W,_R),ne=Jp({accept:n,multiple:s,type:"file",style:{display:"none"},onChange:fe(dr(ue,Me)),onClick:fe(dr(Ae,Ce)),tabIndex:-1},q,_);return bt(bt({},ne),Se)}},[_,n,s,Me,r]),N=B.length,z=N>0&&vR({files:B,accept:n,minSize:a,maxSize:i,multiple:s,maxFiles:l}),U=N>0&&!z;return bt(bt({},j),{},{isDragAccept:z,isDragReject:U,isFocused:D&&!r,getRootProps:Le,getInputProps:Ge,rootRef:k,inputRef:_,open:fe(we)})}function NR(e,t){switch(t.type){case"focus":return bt(bt({},e),{},{isFocused:!0});case"blur":return bt(bt({},e),{},{isFocused:!1});case"openDialog":return bt(bt({},eh),{},{isFileDialogActive:!0});case"closeDialog":return bt(bt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return bt(bt({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return bt(bt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return bt({},eh);default:return e}}function j0(){}function LR(e){let t;const n=new Set,r=(c,u)=>{const f=typeof c=="function"?c(t):c;if(f!==t){const d=t;t=u?f:Object.assign({},t,f),n.forEach(p=>p(t,d))}},o=()=>t,i=(c,u=o,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(t);function p(){const h=u(t);if(!f(d,h)){const g=d;c(d=h,g)}}return n.add(p),()=>n.delete(p)},l={setState:r,getState:o,subscribe:(c,u,f)=>u||f?i(c,u,f):(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return t=e(r,o,l),l}const BR=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),I0=BR?y.useEffect:y.useLayoutEffect;function FR(e){const t=typeof e=="function"?LR(e):e,n=(r=t.getState,o=Object.is)=>{const[,i]=y.useReducer(v=>v+1,0),a=t.getState(),s=y.useRef(a),l=y.useRef(r),c=y.useRef(o),u=y.useRef(!1),f=y.useRef();f.current===void 0&&(f.current=r(a));let d,p=!1;(s.current!==a||l.current!==r||c.current!==o||u.current)&&(d=r(a),p=!o(f.current,d)),I0(()=>{p&&(f.current=d),s.current=a,l.current=r,c.current=o,u.current=!1});const h=y.useRef(a);I0(()=>{const v=()=>{try{const w=t.getState(),$=l.current(w);c.current(f.current,$)||(s.current=w,f.current=$,i())}catch{u.current=!0,i()}},x=t.subscribe(v);return t.getState()!==h.current&&v(),x},[]);const g=p?d:f.current;return y.useDebugValue(g),g};return Object.assign(n,t),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[n,t];return{next(){const o=r.length<=0;return{value:r.shift(),done:o}}}},n}const zR=e=>(t,n,r)=>{const o=r.subscribe;return r.subscribe=(a,s,l)=>{let c=a;if(s){const u=(l==null?void 0:l.equalityFn)||Object.is;let f=a(r.getState());c=d=>{const p=a(d);if(!u(f,p)){const h=f;s(f=p,h)}},l!=null&&l.fireImmediately&&s(f,f)}return o(c)},e(t,n,r)};/*! * isobject * * Copyright (c) 2014-2017, Jon Schlinkert. @@ -123,7 +123,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. - */var UR=function(t,n,r){for(var o in t)if(n.call(r,t[o],o,t)===!1)break},GR=lm,KR=UR;function yS(e,t){for(var n=arguments.length,r=0;++r * * Copyright (c) 2014-2015, Jon Schlinkert. @@ -138,7 +138,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * Copyright (c) 2015-2017, Jon Schlinkert. * Released under the MIT License. - */var sD=nD,lD=function(e,t,n){if(typeof e!="string")throw new TypeError("expected a string");typeof t=="function"&&(n=t,t=null),typeof t=="string"&&(t={sep:t});var r=sD({sep:"."},t),o=r.quotes||['"',"'","`"],i;r.brackets===!0?i={"<":">","(":")","[":"]","{":"}"}:r.brackets&&(i=r.brackets);var a=[],s=[],l=[""],c=r.sep,u=e.length,f=-1,d;function p(){if(i&&s.length)return i[s[s.length-1]]}for(;++f","(":")","[":"]","{":"}"}:r.brackets&&(i=r.brackets);var a=[],s=[],l=[""],c=r.sep,u=e.length,f=-1,d;function p(){if(i&&s.length)return i[s[s.length-1]]}for(;++f * * Copyright (c) 2015, Jon Schlinkert. @@ -153,7 +153,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * Copyright (c) 2014-2015, 2017, Jon Schlinkert. * Released under the MIT License. - */var mD=lD,vD=dD,N0=vS,L0=gD,yD=function(e,t,n){if(!L0(e)||(Array.isArray(t)&&(t=[].concat.apply([],t).join(".")),typeof t!="string"))return e;for(var r=mD(t,{sep:".",brackets:!0}).filter(bD),o=r.length,i=-1,a=e;++ie.filter(Boolean).join(".");function $D(e){const t=e.split(".");return[t.pop(),t.join(".")||void 0]}function CD(e,t){return Object.entries(Qj(e,t)).reduce((n,[,{value:r,disabled:o,key:i}])=>(n[i]=o?void 0:r,n),{})}function OD(e,t){const n=y.useRef();return(t?vs:hl)(e,n.current)||(n.current=e),n.current}function bS(e,t){return y.useMemo(e,OD(t,!0))}function ED(e){const t=y.useRef(null),n=y.useRef(null),r=y.useRef(!0);return y.useLayoutEffect(()=>{e||(t.current.style.height="0px",t.current.style.overflow="hidden")},[]),y.useEffect(()=>{if(r.current){r.current=!1;return}let o;const i=t.current,a=()=>{e&&(i.style.removeProperty("height"),i.style.removeProperty("overflow"),n.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};i.addEventListener("transitionend",a,{once:!0});const{height:s}=n.current.getBoundingClientRect();return i.style.height=s+"px",e||(i.style.overflow="hidden",o=window.setTimeout(()=>i.style.height="0px",50)),()=>{i.removeEventListener("transitionend",a),clearTimeout(o)}},[e]),{wrapperRef:t,contentRef:n}}const PD=e=>{const[t,n]=y.useState(e.getVisiblePaths());return y.useEffect(()=>{n(e.getVisiblePaths());const r=e.useStore.subscribe(e.getVisiblePaths,n,{equalityFn:hl});return()=>r()},[e]),t};function _D(e,t,n){return e.useStore(o=>{const i=Ne(Ne({},n),o.data);return CD(i,t)},hl)}function xS(e=3){const t=y.useRef(null),n=y.useRef(null),[r,o]=y.useState(!1),i=y.useCallback(()=>o(!0),[]),a=y.useCallback(()=>o(!1),[]);return y.useLayoutEffect(()=>{if(r){const{bottom:s,top:l,left:c}=t.current.getBoundingClientRect(),{height:u}=n.current.getBoundingClientRect(),f=s+u>window.innerHeight-40?"up":"down";n.current.style.position="fixed",n.current.style.zIndex="10000",n.current.style.left=c+"px",f==="down"?n.current.style.top=s+e+"px":n.current.style.bottom=window.innerHeight-l+e+"px"}},[e,r]),{popinRef:t,wrapperRef:n,shown:r,show:i,hide:a}}RM([DM]);const TD={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};un.extend({color:()=>e=>rn(e).isValid()});const AD=e=>un().color().test(e);function wS(e,{format:t,hasAlpha:n,isString:r}){const o=TD[t]+(r&&t!=="hex"?"String":""),i=e[o]();return typeof i=="object"&&!n?Jj(i,["a"]):i}const SS=(e,t)=>{const n=rn(e);if(!n.isValid())throw Error("Invalid color");return wS(n,t)},kD=(e,t)=>wS(rn(e),Ne(Ne({},t),{},{isString:!0,format:"hex"})),jD=({value:e})=>{const t=MM(e),n=t==="name"?"hex":t,r=typeof e=="object"?"a"in e:t==="hex"&&e.length===8||/^(rgba)|(hsla)|(hsva)/.test(e),o={format:n,hasAlpha:r,isString:typeof e=="string"};return{value:SS(e,o),settings:o}};var ID=Object.freeze({__proto__:null,schema:AD,sanitize:SS,format:kD,normalize:jD});const MD=De("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:`url('data:image/svg+xml;charset=utf-8,')`,$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),RD=De("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),DD=De("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function z0(e,t){return t!=="rgb"?rn(e).toRgb():e}function ND({value:e,displayValue:t,settings:n,onUpdate:r}){const{emitOnEditStart:o,emitOnEditEnd:i}=en(),{format:a,hasAlpha:s}=n,{popinRef:l,wrapperRef:c,shown:u,show:f,hide:d}=xS(),p=y.useRef(0),[h,g]=y.useState(()=>z0(e,a)),v=s?VM:UM,x=()=>{g(z0(e,a)),f(),o()},w=()=>{d(),i(),window.clearTimeout(p.current)},$=()=>{p.current=window.setTimeout(w,500)};return y.useEffect(()=>()=>window.clearTimeout(p.current),[]),E.createElement(E.Fragment,null,E.createElement(MD,{ref:l,active:u,onClick:()=>x(),style:{color:t}}),u&&E.createElement(em,null,E.createElement(V3,{onPointerUp:w}),E.createElement(DD,{ref:c,onMouseEnter:()=>window.clearTimeout(p.current),onMouseLeave:C=>C.buttons===0&&$()},E.createElement(v,{color:h,onChange:r}))))}function LD(){const{value:e,displayValue:t,label:n,onChange:r,onUpdate:o,settings:i}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,n),E.createElement(RD,null,E.createElement(ND,{value:e,displayValue:t,onChange:r,onUpdate:o,settings:i}),E.createElement(Jg,{value:t,onChange:r,onUpdate:o})))}var BD=Ne({component:LD},ID);function FD(){const{label:e,displayValue:t,onUpdate:n,settings:r}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(nm,{value:t,settings:r,onUpdate:n}))}var zD=Ne({component:FD},Z3(["x","y","z"]));const WD=De("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),VD=De("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function HD({value:e,settings:t,onUpdate:n}){const r=y.useRef(),o=y.useRef(0),i=y.useRef(0),a=y.useRef(1),[s,l]=y.useState(!1),[c,u]=y.useState(!1),[f,d]=U3(),p=y.useRef(null),h=y.useRef(null);y.useLayoutEffect(()=>{if(s){const{top:A,left:I,width:j,height:M}=p.current.getBoundingClientRect();h.current.style.left=I+j/2+"px",h.current.style.top=A+M/2+"px"}},[s]);const{keys:[g,v],joystick:x}=t,w=x==="invertY"?1:-1,{[g]:{step:$},[v]:{step:C}}=t,S=Lr("sizes","joystickWidth"),b=Lr("sizes","joystickHeight"),O=parseFloat(S)*.8/2,P=parseFloat(b)*.8/2,T=y.useCallback(()=>{r.current||(u(!0),o.current&&d({x:o.current*O}),i.current&&d({y:i.current*-P}),r.current=window.setInterval(()=>{n(A=>{const I=$*o.current*a.current,j=w*C*i.current*a.current;return Array.isArray(A)?{[g]:A[0]+I,[v]:A[1]+j}:{[g]:A[g]+I,[v]:A[v]+j}})},16))},[O,P,n,d,$,C,g,v,w]),k=y.useCallback(()=>{window.clearTimeout(r.current),r.current=void 0,u(!1)},[]);y.useEffect(()=>{function A(I){a.current=T3(I)}return window.addEventListener("keydown",A),window.addEventListener("keyup",A),()=>{window.clearTimeout(r.current),window.removeEventListener("keydown",A),window.removeEventListener("keyup",A)}},[]);const _=yl(({first:A,active:I,delta:[j,M],movement:[D,L]})=>{A&&l(!0);const B=So(D,-O,O),F=So(L,-P,P);o.current=Math.abs(D)>Math.abs(B)?Math.sign(D-B):0,i.current=Math.abs(L)>Math.abs(F)?Math.sign(F-L):0;let Z=e[g],ie=e[v];I?(o.current||(Z+=j*$*a.current,d({x:B})),i.current||(ie-=w*M*C*a.current,d({y:F})),o.current||i.current?T():k(),n({[g]:Z,[v]:ie})):(l(!1),o.current=0,i.current=0,d({x:0,y:0}),k())});return E.createElement(WD,Ot({ref:p},_()),s&&E.createElement(em,null,E.createElement(VD,{ref:h,isOutOfBounds:c},E.createElement("div",null),E.createElement("span",{ref:f}))))}const UD=De("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});function GD(){const{label:e,displayValue:t,onUpdate:n,settings:r}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(UD,{withJoystick:!!r.joystick},r.joystick&&E.createElement(HD,{value:t,settings:r,onUpdate:n}),E.createElement(nm,{value:t,settings:r,onUpdate:n})))}const KD=["joystick"],$S=Z3(["x","y"]),qD=e=>{let{joystick:t=!0}=e,n=st(e,KD);const{value:r,settings:o}=$S.normalize(n);return{value:r,settings:Ne(Ne({},o),{},{joystick:t})}};var XD=Ne(Ne({component:GD},$S),{},{normalize:qD});const YD=e=>{if(e!==void 0){if(e instanceof File)try{return URL.createObjectURL(e)}catch{return}if(typeof e=="string"&&e.indexOf("blob:")===0)return e;throw Error("Invalid image format [undefined | blob | File].")}},ZD=(e,t)=>typeof t=="object"&&"image"in t,QD=({image:e})=>({value:e});var JD=Object.freeze({__proto__:null,sanitize:YD,schema:ZD,normalize:QD});const eN=De("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),tN=De("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),nN=De("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),rN=De("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),oN=De("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),iN=De("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});function aN(){const{label:e,value:t,onUpdate:n,disabled:r}=en(),{popinRef:o,wrapperRef:i,shown:a,show:s,hide:l}=xS(),c=y.useCallback(h=>{h.length&&n(h[0])},[n]),u=y.useCallback(h=>{h.stopPropagation(),n(void 0)},[n]),{getRootProps:f,getInputProps:d,isDragAccept:p}=mS({maxFiles:1,accept:"image/*",onDrop:c,disabled:r});return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(eN,null,E.createElement(nN,{ref:o,hasImage:!!t,onPointerDown:()=>!!t&&s(),onPointerUp:l,style:{backgroundImage:t?`url(${t})`:"none"}}),a&&!!t&&E.createElement(em,null,E.createElement(V3,{onPointerUp:l,style:{cursor:"pointer"}}),E.createElement(rN,{ref:i,style:{backgroundImage:`url(${t})`}})),E.createElement(tN,f({isDragAccept:p}),E.createElement("input",d()),E.createElement(oN,null,p?"drop image":"click or drop")),E.createElement(iN,{onClick:u,disabled:!t})))}var sN=Ne({component:aN},JD);const W0=un().number(),lN=(e,t)=>un().array().length(2).every.number().test(e)&&un().schema({min:W0,max:W0}).test(t),Rc=e=>({min:e[0],max:e[1]}),CS=(e,{bounds:[t,n]},r)=>{const o=Array.isArray(e)?Rc(e):e,i={min:r[0],max:r[1]},{min:a,max:s}=Ne(Ne({},i),o);return[So(Number(a),t,Math.max(t,s)),So(Number(s),Math.min(n,a),n)]},cN=({value:e,min:t,max:n})=>{const r={min:t,max:n},o=Y3(Rc(e),{min:r,max:r}),i=[t,n],a=Ne(Ne({},o),{},{bounds:i});return{value:CS(Rc(e),a,e),settings:a}};var uN=Object.freeze({__proto__:null,schema:lN,format:Rc,sanitize:CS,normalize:cN});const fN=["value","bounds","onDrag"],dN=["bounds"],pN=De("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function hN(e){let{value:t,bounds:[n,r],onDrag:o}=e,i=st(e,fN);const a=y.useRef(null),s=y.useRef(null),l=y.useRef(null),c=y.useRef(0),u=Lr("sizes","scrubberWidth"),f=yl(({event:h,first:g,xy:[v],movement:[x],memo:w={}})=>{if(g){const{width:C,left:S}=a.current.getBoundingClientRect();c.current=C-parseFloat(u);const b=(h==null?void 0:h.target)===s.current||(h==null?void 0:h.target)===l.current;w.pos=Ac((v-S)/C,n,r);const O=Math.abs(w.pos-t.min)-Math.abs(w.pos-t.max);w.key=O<0||O===0&&w.pos<=t.min?"min":"max",b&&(w.pos=t[w.key])}const $=w.pos+Ac(x/c.current,0,r-n);return o({[w.key]:zI($,i[w.key])}),w}),d=`calc(${Tc(t.min,n,r)} * (100% - ${u} - 8px) + 4px)`,p=`calc(${1-Tc(t.max,n,r)} * (100% - ${u} - 8px) + 4px)`;return E.createElement(K3,Ot({ref:a},f()),E.createElement(G3,null,E.createElement(q3,{style:{left:d,right:p}})),E.createElement(Vp,{position:"left",ref:s,style:{left:d}}),E.createElement(Vp,{position:"right",ref:l,style:{right:p}}))}function gN(){const{label:e,displayValue:t,onUpdate:n,settings:r}=en(),o=st(r,dN);return E.createElement(E.Fragment,null,E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(pN,null,E.createElement(hN,Ot({value:t},r,{onDrag:n})),E.createElement(nm,{value:t,settings:o,onUpdate:n,innerLabelTrim:0}))))}var mN=Ne({component:gN},uN);const vN=()=>{const e=new Map;return{on:(t,n)=>{let r=e.get(t);r===void 0&&(r=new Set,e.set(t,r)),r.add(n)},off:(t,n)=>{const r=e.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.delete(t))},emit:(t,...n)=>{const r=e.get(t);if(r!==void 0)for(const o of r)o(...n)}}},yN=["type","value"],bN=["onChange","transient","onEditStart","onEditEnd"],xN=function(){const t=FR(zR(()=>({data:{}}))),n=vN();this.storeId=Zj(),this.useStore=t;const r={},o=new Set;this.getVisiblePaths=()=>{const a=this.getData(),s=Object.keys(a),l=[];Object.entries(r).forEach(([u,f])=>{f.render&&s.some(d=>d.indexOf(u)===0)&&!f.render(this.get)&&l.push(u+".")});const c=[];return o.forEach(u=>{u in a&&a[u].__refCount>0&&l.every(f=>u.indexOf(f)===-1)&&(!a[u].render||a[u].render(this.get))&&c.push(u)}),c},this.setOrderedPaths=a=>{a.forEach(s=>o.add(s))},this.orderPaths=a=>(this.setOrderedPaths(a),a),this.disposePaths=a=>{t.setState(s=>{const l=s.data;return a.forEach(c=>{if(c in l){const u=l[c];u.__refCount--,u.__refCount===0&&u.type in rr&&delete l[c]}}),{data:l}})},this.dispose=()=>{t.setState(()=>({data:{}}))},this.getFolderSettings=a=>r[a]||{},this.getData=()=>t.getState().data,this.addData=(a,s)=>{t.setState(l=>{const c=l.data;return Object.entries(a).forEach(([u,f])=>{let d=c[u];if(d){const{type:p,value:h}=f,g=st(f,yN);p!==d.type?jr(xt.INPUT_TYPE_OVERRIDE,p):((d.__refCount===0||s)&&Object.assign(d,g),d.__refCount++)}else c[u]=Ne(Ne({},f),{},{__refCount:1})}),{data:c}})},this.setValueAtPath=(a,s,l)=>{t.setState(c=>{const u=c.data;return f0(u[a],s,a,this,l),{data:u}})},this.setSettingsAtPath=(a,s)=>{t.setState(l=>{const c=l.data;return c[a].settings=Ne(Ne({},c[a].settings),s),{data:c}})},this.disableInputAtPath=(a,s)=>{t.setState(l=>{const c=l.data;return c[a].disabled=s,{data:c}})},this.set=(a,s)=>{t.setState(l=>{const c=l.data;return Object.entries(a).forEach(([u,f])=>{try{f0(c[u],f,void 0,void 0,s)}catch{}}),{data:c}})},this.getInput=a=>{try{return this.getData()[a]}catch{jr(xt.PATH_DOESNT_EXIST,a)}},this.get=a=>{var s;return(s=this.getInput(a))===null||s===void 0?void 0:s.value},this.emitOnEditStart=a=>{n.emit(`onEditStart:${a}`,this.get(a),a,Ne(Ne({},this.getInput(a)),{},{get:this.get}))},this.emitOnEditEnd=a=>{n.emit(`onEditEnd:${a}`,this.get(a),a,Ne(Ne({},this.getInput(a)),{},{get:this.get}))},this.subscribeToEditStart=(a,s)=>{const l=`onEditStart:${a}`;return n.on(l,s),()=>n.off(l,s)},this.subscribeToEditEnd=(a,s)=>{const l=`onEditEnd:${a}`;return n.on(l,s),()=>n.off(l,s)};const i=(a,s,l)=>{const c={};return Object.entries(a).forEach(([u,f])=>{if(u==="")return jr(xt.EMPTY_KEY);let d=cm(s,u);if(f.type===rr.FOLDER){const p=i(f.schema,d,l);Object.assign(c,p),d in r||(r[d]=f.settings)}else if(u in l)jr(xt.DUPLICATE_KEYS,u,d,l[u].path);else{const p=iI(f,u,d,c);if(p){const{type:h,options:g,input:v}=p,{onChange:x,transient:w,onEditStart:$,onEditEnd:C}=g,S=st(g,bN);c[d]=Ne(Ne(Ne({type:h},S),v),{},{fromPanel:!0}),l[u]={path:d,onChange:x,transient:w,onEditStart:$,onEditEnd:C}}else jr(xt.UNKNOWN_INPUT,d,f)}}),c};this.getDataFromSchema=a=>{const s={};return[i(a,"",s),s]}},OS=new xN,wN={collapsed:!1};function SN(e,t){return{type:rr.FOLDER,schema:e,settings:Ne(Ne({},wN),t)}}const V0=e=>"__levaInput"in e,$N=(e,t)=>{const n={},r=t?t.toLowerCase():null;return e.forEach(o=>{const[i,a]=$D(o);(!r||i.toLowerCase().indexOf(r)>-1)&&SD(n,a,{[i]:{__levaInput:!0,path:o}})}),n},CN=["type","label","path","valueKey","value","settings","setValue","disabled"];function ON(e){let{type:t,label:n,path:r,valueKey:o,value:i,settings:a,setValue:s,disabled:l}=e,c=st(e,CN);const{displayValue:u,onChange:f,onUpdate:d}=H3({type:t,value:i,settings:a,setValue:s}),p=Yo[t].component;return p?E.createElement(M3.Provider,{value:Ne({key:o,path:r,id:""+r,label:n,displayValue:u,value:i,onChange:f,onUpdate:d,settings:a,setValue:s,disabled:l},c)},E.createElement(OI,{disabled:l},E.createElement(p,null))):(jr(xt.NO_COMPONENT_FOR_TYPE,t,r),null)}const EN=De("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});function PN({onClick:e,settings:t,label:n}){const r=vl();return E.createElement(qn,null,E.createElement(EN,{disabled:t.disabled,onClick:()=>e(r.get)},n))}const _N=De("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),TN=De("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),AN=({label:e,opts:t})=>{let n=typeof e=="string"&&e.trim()===""?null:e,r=t;return typeof t.opts=="object"&&(r.label!==void 0&&(n=t.label),r=t.opts),{label:n,opts:r}};function kN(e){const{label:t,opts:n}=AN(e),r=vl();return E.createElement(qn,{input:!!t},t&&E.createElement(lr,null,t),E.createElement(_N,null,Object.entries(n).map(([o,i])=>E.createElement(TN,{key:o,onClick:()=>i(r.get)},o))))}const jN=De("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),ES=100;function IN(e,t){e.push(t),e.length>ES&&e.shift()}const MN=y.forwardRef(function({initialValue:e},t){const n=Lr("colors","highlight3"),r=Lr("colors","elevation2"),o=Lr("colors","highlight1"),[i,a]=y.useMemo(()=>[rn(o).alpha(.4).toRgbString(),rn(o).alpha(.1).toRgbString()],[o]),s=y.useRef([e]),l=y.useRef(e),c=y.useRef(e),u=y.useRef(),f=y.useCallback((h,g)=>{if(!h)return;const{width:v,height:x}=h,w=new Path2D,$=v/ES,C=x*.05;for(let O=0;O({frame:h=>{(l.current===void 0||hc.current)&&(c.current=h),IN(s.current,h),u.current=requestAnimationFrame(()=>f(d.current,p.current))}}),[d,p,f]),y.useEffect(()=>()=>cancelAnimationFrame(u.current),[]),E.createElement(jN,{ref:d})}),H0=e=>Number.isFinite(e)?e.toPrecision(2):e.toString(),RN=y.forwardRef(function({initialValue:e},t){const[n,r]=y.useState(H0(e));return y.useImperativeHandle(t,()=>({frame:o=>r(H0(o))}),[]),E.createElement("div",null,n)});function U0(e){return typeof e=="function"?e():e.current}function DN({label:e,objectOrFn:t,settings:n}){const r=y.useRef(),o=y.useRef(U0(t));return y.useEffect(()=>{const i=window.setInterval(()=>{var a;document.hidden||(a=r.current)===null||a===void 0||a.frame(U0(t))},n.interval);return()=>window.clearInterval(i)},[t,n.interval]),E.createElement(qn,{input:!0},E.createElement(lr,{align:"top"},e),n.graph?E.createElement(MN,{ref:r,initialValue:o.current}):E.createElement(RN,{ref:r,initialValue:o.current}))}const NN=["type","label","key"],LN={[rr.BUTTON]:PN,[rr.BUTTON_GROUP]:kN,[rr.MONITOR]:DN},BN=E.memo(({path:e})=>{const[t,{set:n,setSettings:r,disable:o,storeId:i,emitOnEditStart:a,emitOnEditEnd:s}]=DI(e);if(!t)return null;const{type:l,label:c,key:u}=t,f=st(t,NN);if(l in rr){const d=LN[l];return E.createElement(d,Ot({label:c,path:e},f))}return l in Yo?E.createElement(ON,Ot({key:i+e,type:l,label:c,storeId:i,path:e,valueKey:u,setValue:n,setSettings:r,disable:o,emitOnEditStart:a,emitOnEditEnd:s},f)):(Vj(xt.UNSUPPORTED_INPUT,l,e),null)});function FN({toggle:e,toggled:t,name:n}){return E.createElement(SI,{onClick:()=>e()},E.createElement(tm,{toggled:t}),E.createElement("div",null,n))}const zN=({name:e,path:t,tree:n})=>{const r=vl(),o=cm(t,e),{collapsed:i,color:a}=r.getFolderSettings(o),[s,l]=y.useState(!i),c=y.useRef(null),u=Lr("colors","folderWidgetColor"),f=Lr("colors","folderTextColor");return y.useLayoutEffect(()=>{c.current.style.setProperty("--leva-colors-folderWidgetColor",a||u),c.current.style.setProperty("--leva-colors-folderTextColor",a||f)},[a,u,f]),E.createElement(kc,{ref:c},E.createElement(FN,{name:e,toggled:s,toggle:()=>l(d=>!d)}),E.createElement(PS,{parent:o,tree:n,toggled:s}))},PS=E.memo(({isRoot:e=!1,fill:t=!1,flat:n=!1,parent:r,tree:o,toggled:i})=>{const{wrapperRef:a,contentRef:s}=ED(i),l=vl(),c=([f,d])=>{var p;return(V0(d)?(p=l.getInput(d.path))===null||p===void 0?void 0:p.order:l.getFolderSettings(cm(r,f)).order)||0},u=Object.entries(o).sort((f,d)=>c(f)-c(d));return E.createElement(zp,{ref:a,isRoot:e,fill:t,flat:n},E.createElement(F3,{ref:s,isRoot:e,toggled:i},u.map(([f,d])=>V0(d)?E.createElement(BN,{key:d.path,valueKey:d.valueKey,path:d.path}):E.createElement(zN,{key:f,name:f,path:r,tree:d}))))}),WN=De("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${W3}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),_S=40,Dc=De("i",{$flexCenter:"",width:_S,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),VN=De("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),HN=De("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${Dc}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),UN=De("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),GN=De("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:_S}}}}),KN=E.forwardRef(({setFilter:e,toggle:t},n)=>{const[r,o]=y.useState(""),i=y.useMemo(()=>_3(e,250),[e]),a=()=>{e(""),o("")},s=l=>{const c=l.currentTarget.value;t(!0),o(c)};return y.useEffect(()=>{i(r)},[r,i]),E.createElement(E.Fragment,null,E.createElement(UN,{ref:n,value:r,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:l=>l.stopPropagation(),onChange:s}),E.createElement(Dc,{onClick:()=>a(),style:{visibility:r?"visible":"hidden"}},E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function qN({setFilter:e,onDrag:t,onDragStart:n,onDragEnd:r,toggle:o,toggled:i,title:a,drag:s,filterEnabled:l,from:c}){const[u,f]=y.useState(!1),d=y.useRef(null);y.useEffect(()=>{var h,g;u?(h=d.current)===null||h===void 0||h.focus():(g=d.current)===null||g===void 0||g.blur()},[u]);const p=yl(({offset:[h,g],first:v,last:x})=>{t({x:h,y:g}),v&&n({x:h,y:g}),x&&r({x:h,y:g})},{filterTaps:!0,from:({offset:[h,g]})=>[(c==null?void 0:c.x)||h,(c==null?void 0:c.y)||g]});return y.useEffect(()=>{const h=g=>{g.key==="L"&&g.shiftKey&&g.metaKey&&f(v=>!v)};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[]),E.createElement(E.Fragment,null,E.createElement(VN,{mode:s?"drag":void 0},E.createElement(Dc,{active:!i,onClick:()=>o()},E.createElement(tm,{toggled:i,width:12,height:8})),E.createElement(GN,Ot({},s?p():{},{drag:s,filterEnabled:l}),a===void 0&&s?E.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},E.createElement("circle",{cx:"2",cy:"2",r:"2"}),E.createElement("circle",{cx:"14",cy:"2",r:"2"}),E.createElement("circle",{cx:"26",cy:"2",r:"2"}),E.createElement("circle",{cx:"2",cy:"12",r:"2"}),E.createElement("circle",{cx:"14",cy:"12",r:"2"}),E.createElement("circle",{cx:"26",cy:"12",r:"2"})):a),l&&E.createElement(Dc,{active:u,onClick:()=>f(h=>!h)},E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"},E.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),E.createElement(HN,{toggled:u},E.createElement(KN,{ref:d,setFilter:e,toggle:o})))}const XN=["store","hidden","theme","collapsed"];function YN(e){let{store:t,hidden:n=!1,theme:r,collapsed:o=!1}=e,i=st(e,XN);const a=bS(()=>mI(r),[r]),[s,l]=y.useState(!o),c=typeof o=="object"?!o.collapsed:s,u=y.useMemo(()=>typeof o=="object"?f=>{typeof f=="function"?o.onChange(!f(!o.collapsed)):o.onChange(!f)}:l,[o]);return!t||n?null:E.createElement(Qg.Provider,{value:a},E.createElement(ZN,Ot({store:t},i,{toggled:c,setToggle:u,rootClass:a.className})))}const ZN=E.memo(({store:e,rootClass:t,fill:n=!1,flat:r=!1,neverHide:o=!1,oneLineLabels:i=!1,titleBar:a={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:s=!1,toggled:l,setToggle:c})=>{var u,f;const d=PD(e),[p,h]=y.useState(""),g=y.useMemo(()=>$N(d,p),[d,p]),[v,x]=U3(),w=o||d.length>0,$=typeof a=="object"&&a.title||void 0,C=typeof a=="object"&&(u=a.drag)!==null&&u!==void 0?u:!0,S=typeof a=="object"&&(f=a.filter)!==null&&f!==void 0?f:!0,b=typeof a=="object"&&a.position||void 0,O=typeof a=="object"&&a.onDrag||void 0,P=typeof a=="object"&&a.onDragStart||void 0,T=typeof a=="object"&&a.onDragEnd||void 0;return E.useEffect(()=>{x({x:b==null?void 0:b.x,y:b==null?void 0:b.y})},[b,x]),gI(),E.createElement(D3.Provider,{value:{hideCopyButton:s}},E.createElement(WN,{ref:v,className:t,fill:n,flat:r,oneLineLabels:i,hideTitleBar:!a,style:{display:w?"block":"none"}},a&&E.createElement(qN,{onDrag:k=>{x(k),O==null||O(k)},onDragStart:k=>P==null?void 0:P(k),onDragEnd:k=>T==null?void 0:T(k),setFilter:h,toggle:k=>c(_=>k??!_),toggled:l,title:$,drag:C,filterEnabled:S,from:b}),w&&E.createElement(R3.Provider,{value:e},E.createElement(PS,{isRoot:!0,fill:n,flat:r,tree:g,toggled:l}))))}),QN=["isRoot"];let Nc=!1,No=null;function TS(e){let{isRoot:t=!1}=e,n=st(e,QN);return y.useEffect(()=>(Nc=!0,!t&&No&&(No.remove(),No=null),()=>{t||(Nc=!1)}),[t]),E.createElement(YN,Ot({store:OS},n))}function JN(e){y.useEffect(()=>{e&&!Nc&&(No||(No=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(No),sI(E.createElement(TS,{isRoot:!0}),No))),Nc=!0)},[e])}function eL(e,t,n,r,o){let i,a,s,l,c;return typeof e=="string"?(a=e,i=t,Array.isArray(n)?c=n:n&&("store"in n?(l=n,c=r):(s=n,Array.isArray(r)?c=r:(l=r,c=o)))):(i=e,Array.isArray(t)?c=t:(l=t,c=n)),{schema:i,folderName:a,folderSettings:s,hookSettings:l,deps:c||[]}}function hue(e,t,n,r,o){const{folderName:i,schema:a,folderSettings:s,hookSettings:l,deps:c}=eL(e,t,n,r,o),u=typeof a=="function",f=y.useRef(!1),d=y.useRef(!0),p=bS(()=>{f.current=!0;const _=typeof a=="function"?a():a;return i?{[i]:SN(_,s)}:_},c),h=!(l!=null&&l.store);JN(h);const[g]=y.useState(()=>(l==null?void 0:l.store)||OS),[v,x]=y.useMemo(()=>g.getDataFromSchema(p),[g,p]),[w,$,C,S,b]=y.useMemo(()=>{const _=[],A=[],I={},j={},M={};return Object.values(x).forEach(({path:D,onChange:L,onEditStart:B,onEditEnd:F,transient:Z})=>{_.push(D),L?(I[D]=L,Z||A.push(D)):A.push(D),B&&(j[D]=B),F&&(M[D]=F)}),[_,A,I,j,M]},[x]),O=y.useMemo(()=>g.orderPaths(w),[w,g]),P=_D(g,$,v),T=y.useCallback(_=>{const A=Object.entries(_).reduce((I,[j,M])=>Object.assign(I,{[x[j].path]:M}),{});g.set(A,!1)},[g,x]),k=y.useCallback(_=>g.get(x[_].path),[g,x]);return y.useEffect(()=>{const _=!d.current&&f.current;return g.addData(v,_),d.current=!1,f.current=!1,()=>g.disposePaths(O)},[g,O,v]),y.useEffect(()=>{const _=[];return Object.entries(C).forEach(([A,I])=>{I(g.get(A),A,Ne({initial:!0,get:g.get},g.getInput(A)));const j=g.useStore.subscribe(M=>{const D=M.data[A];return[D.disabled?void 0:D.value,D]},([M,D])=>I(M,A,Ne({initial:!1,get:g.get},D)),{equalityFn:hl});_.push(j)}),()=>_.forEach(A=>A())},[g,C]),y.useEffect(()=>{const _=[];return Object.entries(S).forEach(([A,I])=>_.push(g.subscribeToEditStart(A,I))),Object.entries(b).forEach(([A,I])=>_.push(g.subscribeToEditEnd(A,I))),()=>_.forEach(A=>A())},[S,b,g]),u?[P,T,k]:P}Jr(ar.SELECT,JI);Jr(ar.IMAGE,sN);Jr(ar.NUMBER,VI);Jr(ar.COLOR,BD);Jr(ar.STRING,lM);Jr(ar.BOOLEAN,gM);Jr(ar.INTERVAL,mN);Jr(ar.VECTOR3D,zD);Jr(ar.VECTOR2D,XD);var wl=e=>e.type==="checkbox",vi=e=>e instanceof Date,on=e=>e==null;const AS=e=>typeof e=="object";var Mt=e=>!on(e)&&!Array.isArray(e)&&AS(e)&&!vi(e),kS=e=>Mt(e)&&e.target?wl(e.target)?e.target.checked:e.target.value:e,tL=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,jS=(e,t)=>e.has(tL(t)),nL=e=>{const t=e.constructor&&e.constructor.prototype;return Mt(t)&&t.hasOwnProperty("isPrototypeOf")},um=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Yt(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(um&&(e instanceof Blob||e instanceof FileList))&&(n||Mt(e)))if(t=n?[]:{},!n&&!nL(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Yt(e[r]));else return e;return t}var xa=e=>Array.isArray(e)?e.filter(Boolean):[],dt=e=>e===void 0,he=(e,t,n)=>{if(!t||!Mt(e))return n;const r=xa(t.split(/[,[\].]+?/)).reduce((o,i)=>on(o)?o:o[i],e);return dt(r)||r===e?dt(e[t])?n:e[t]:r},Rn=e=>typeof e=="boolean";const Lc={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Nn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ar={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},IS=E.createContext(null),Sl=()=>E.useContext(IS),$l=e=>{const{children:t,...n}=e;return E.createElement(IS.Provider,{value:n},t)};var MS=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Nn.all&&(t._proxyFormState[a]=!r||Nn.all),n&&(n[a]=!0),e[a]}});return o},vn=e=>Mt(e)&&!Object.keys(e).length,RS=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return vn(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!r||Nn.all))},$n=e=>Array.isArray(e)?e:[e],DS=(e,t,n)=>!e||!t||e===t||$n(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function pf(e){const t=E.useRef(e);t.current=e,E.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function rL(e){const t=Sl(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[a,s]=E.useState(n._formState),l=E.useRef(!0),c=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=E.useRef(o);return u.current=o,pf({disabled:r,next:f=>l.current&&DS(u.current,f.name,i)&&RS(f,c.current,n._updateFormState)&&s({...n._formState,...f}),subject:n._subjects.state}),E.useEffect(()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),MS(a,n,c.current,!1)}var mr=e=>typeof e=="string",NS=(e,t,n,r,o)=>mr(e)?(r&&t.watch.add(e),he(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),he(n,i))):(r&&(t.watchAll=!0),n);function oL(e){const t=Sl(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:a}=e||{},s=E.useRef(r);s.current=r,pf({disabled:i,subject:n._subjects.values,next:u=>{DS(s.current,u.name,a)&&c(Yt(NS(s.current,n._names,u.values||n._formValues,!1,o)))}});const[l,c]=E.useState(n._getWatch(r,o));return E.useEffect(()=>n._removeUnmounted()),l}var fm=e=>/^\w*$/.test(e),LS=e=>xa(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ct=(e,t,n)=>{let r=-1;const o=fm(t)?[t]:LS(t),i=o.length,a=i-1;for(;++r{const u=o._options.shouldUnregister||i,f=(d,p)=>{const h=he(o._fields,d);h&&(h._f.mount=p)};if(f(n,!0),u){const d=Yt(he(o._options.defaultValues,n));ct(o._defaultValues,n,d),dt(he(o._formValues,n))&&ct(o._formValues,n,d)}return()=>{(a?u&&!o._state.action:u)?o.unregister(n):f(n,!1)}},[n,o,a,i]),E.useEffect(()=>{he(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n,value:he(o._fields,n)._f.value})},[r,n,o]),{field:{name:n,value:s,...Rn(r)||Rn(l.disabled)?{disabled:l.disabled||r}:{},onChange:E.useCallback(u=>c.current.onChange({target:{value:kS(u),name:n},type:Lc.CHANGE}),[n]),onBlur:E.useCallback(()=>c.current.onBlur({target:{value:he(o._formValues,n),name:n},type:Lc.BLUR}),[n,o]),ref:u=>{const f=he(o._fields,n);f&&u&&(f._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:d=>u.setCustomValidity(d),reportValidity:()=>u.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!he(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!he(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!he(l.touchedFields,n)},error:{enumerable:!0,get:()=>he(l.errors,n)}})}}const aL=e=>e.render(iL(e));var sL=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},ro=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Od=(e,t,n={})=>n.shouldFocus||dt(n.shouldFocus)?n.focusName||`${e}.${dt(n.focusIndex)?t:n.focusIndex}.`:"",nh=e=>({isOnSubmit:!e||e===Nn.onSubmit,isOnBlur:e===Nn.onBlur,isOnChange:e===Nn.onChange,isOnAll:e===Nn.all,isOnTouch:e===Nn.onTouched}),rh=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ci=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=he(e,o);if(i){const{_f:a,...s}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!r)break;if(a.ref&&t(a.ref,a.name)&&!r)break;Ci(s,t)}else Mt(s)&&Ci(s,t)}}};var BS=(e,t,n)=>{const r=xa(he(e,n));return ct(r,"root",t[n]),ct(e,n,r),e},dm=e=>e.type==="file",fo=e=>typeof e=="function",Bc=e=>{if(!um)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},hc=e=>mr(e),pm=e=>e.type==="radio",Fc=e=>e instanceof RegExp;const G0={value:!1,isValid:!1},K0={value:!0,isValid:!0};var FS=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!dt(e[0].attributes.value)?dt(e[0].value)||e[0].value===""?K0:{value:e[0].value,isValid:!0}:K0:G0}return G0};const q0={isValid:!1,value:null};var zS=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,q0):q0;function X0(e,t,n="validate"){if(hc(e)||Array.isArray(e)&&e.every(hc)||Rn(e)&&!e)return{type:n,message:hc(e)?e:"",ref:t}}var ui=e=>Mt(e)&&!Fc(e)?e:{value:e,message:""},oh=async(e,t,n,r,o)=>{const{ref:i,refs:a,required:s,maxLength:l,minLength:c,min:u,max:f,pattern:d,validate:p,name:h,valueAsNumber:g,mount:v,disabled:x}=e._f,w=he(t,h);if(!v||x)return{};const $=a?a[0]:i,C=A=>{r&&$.reportValidity&&($.setCustomValidity(Rn(A)?"":A||""),$.reportValidity())},S={},b=pm(i),O=wl(i),P=b||O,T=(g||dm(i))&&dt(i.value)&&dt(w)||Bc(i)&&i.value===""||w===""||Array.isArray(w)&&!w.length,k=sL.bind(null,h,n,S),_=(A,I,j,M=Ar.maxLength,D=Ar.minLength)=>{const L=A?I:j;S[h]={type:A?M:D,message:L,ref:i,...k(A?M:D,L)}};if(o?!Array.isArray(w)||!w.length:s&&(!P&&(T||on(w))||Rn(w)&&!w||O&&!FS(a).isValid||b&&!zS(a).isValid)){const{value:A,message:I}=hc(s)?{value:!!s,message:s}:ui(s);if(A&&(S[h]={type:Ar.required,message:I,ref:$,...k(Ar.required,I)},!n))return C(I),S}if(!T&&(!on(u)||!on(f))){let A,I;const j=ui(f),M=ui(u);if(!on(w)&&!isNaN(w)){const D=i.valueAsNumber||w&&+w;on(j.value)||(A=D>j.value),on(M.value)||(I=Dnew Date(new Date().toDateString()+" "+Z),B=i.type=="time",F=i.type=="week";mr(j.value)&&w&&(A=B?L(w)>L(j.value):F?w>j.value:D>new Date(j.value)),mr(M.value)&&w&&(I=B?L(w)+A.value,M=!on(I.value)&&w.length<+I.value;if((j||M)&&(_(j,A.message,I.message),!n))return C(S[h].message),S}if(d&&!T&&mr(w)){const{value:A,message:I}=ui(d);if(Fc(A)&&!w.match(A)&&(S[h]={type:Ar.pattern,message:I,ref:i,...k(Ar.pattern,I)},!n))return C(I),S}if(p){if(fo(p)){const A=await p(w,t),I=X0(A,$);if(I&&(S[h]={...I,...k(Ar.validate,I.message)},!n))return C(I.message),S}else if(Mt(p)){let A={};for(const I in p){if(!vn(A)&&!n)break;const j=X0(await p[I](w,t),$,I);j&&(A={...j,...k(I,j.message)},C(j.message),n&&(S[h]=A))}if(!vn(A)&&(S[h]={ref:$,...A},!n))return S}}return C(!0),S},Ed=(e,t)=>[...e,...$n(t)],Pd=e=>Array.isArray(e)?e.map(()=>{}):void 0;function _d(e,t,n){return[...e.slice(0,t),...$n(n),...e.slice(t)]}var Td=(e,t,n)=>Array.isArray(e)?(dt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Ad=(e,t)=>[...$n(t),...$n(e)];function lL(e,t){let n=0;const r=[...e];for(const o of t)r.splice(o-n,1),n++;return xa(r).length?r:[]}var kd=(e,t)=>dt(t)?[]:lL(e,$n(t).sort((n,r)=>n-r)),jd=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function cL(e,t){const n=t.slice(0,-1).length;let r=0;for(;r(e[t]=n,e);function gue(e){const t=Sl(),{control:n=t.control,name:r,keyName:o="id",shouldUnregister:i}=e,[a,s]=E.useState(n._getFieldArray(r)),l=E.useRef(n._getFieldArray(r).map(ro)),c=E.useRef(a),u=E.useRef(r),f=E.useRef(!1);u.current=r,c.current=a,n._names.array.add(r),e.rules&&n.register(r,e.rules),pf({next:({values:S,name:b})=>{if(b===u.current||!b){const O=he(S,u.current);Array.isArray(O)&&(s(O),l.current=O.map(ro))}},subject:n._subjects.array});const d=E.useCallback(S=>{f.current=!0,n._updateFieldArray(r,S)},[n,r]),p=(S,b)=>{const O=$n(Yt(S)),P=Ed(n._getFieldArray(r),O);n._names.focus=Od(r,P.length-1,b),l.current=Ed(l.current,O.map(ro)),d(P),s(P),n._updateFieldArray(r,P,Ed,{argA:Pd(S)})},h=(S,b)=>{const O=$n(Yt(S)),P=Ad(n._getFieldArray(r),O);n._names.focus=Od(r,0,b),l.current=Ad(l.current,O.map(ro)),d(P),s(P),n._updateFieldArray(r,P,Ad,{argA:Pd(S)})},g=S=>{const b=kd(n._getFieldArray(r),S);l.current=kd(l.current,S),d(b),s(b),n._updateFieldArray(r,b,kd,{argA:S})},v=(S,b,O)=>{const P=$n(Yt(b)),T=_d(n._getFieldArray(r),S,P);n._names.focus=Od(r,S,O),l.current=_d(l.current,S,P.map(ro)),d(T),s(T),n._updateFieldArray(r,T,_d,{argA:S,argB:Pd(b)})},x=(S,b)=>{const O=n._getFieldArray(r);jd(O,S,b),jd(l.current,S,b),d(O),s(O),n._updateFieldArray(r,O,jd,{argA:S,argB:b},!1)},w=(S,b)=>{const O=n._getFieldArray(r);Td(O,S,b),Td(l.current,S,b),d(O),s(O),n._updateFieldArray(r,O,Td,{argA:S,argB:b},!1)},$=(S,b)=>{const O=Yt(b),P=Y0(n._getFieldArray(r),S,O);l.current=[...P].map((T,k)=>!T||k===S?ro():l.current[k]),d(P),s([...P]),n._updateFieldArray(r,P,Y0,{argA:S,argB:O},!0,!1)},C=S=>{const b=$n(Yt(S));l.current=b.map(ro),d([...b]),s([...b]),n._updateFieldArray(r,[...b],O=>O,{},!0,!1)};return E.useEffect(()=>{if(n._state.action=!1,rh(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!nh(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(S=>{const b=he(S.errors,r),O=he(n._formState.errors,r);(O?!b&&O.type||b&&(O.type!==b.type||O.message!==b.message):b&&b.type)&&(b?ct(n._formState.errors,r,b):Nt(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const S=he(n._fields,r);S&&S._f&&oh(S,n._formValues,n._options.criteriaMode===Nn.all,n._options.shouldUseNativeValidation,!0).then(b=>!vn(b)&&n._subjects.state.next({errors:BS(n._formState.errors,b,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&Ci(n._fields,(S,b)=>{if(n._names.focus&&b.startsWith(n._names.focus)&&S.focus)return S.focus(),1}),n._names.focus="",n._updateValid(),f.current=!1},[a,r,n]),E.useEffect(()=>(!he(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||i)&&n.unregister(r)}),[r,n,o,i]),{swap:E.useCallback(x,[d,r,n]),move:E.useCallback(w,[d,r,n]),prepend:E.useCallback(h,[d,r,n]),append:E.useCallback(p,[d,r,n]),remove:E.useCallback(g,[d,r,n]),insert:E.useCallback(v,[d,r,n]),update:E.useCallback($,[d,r,n]),replace:E.useCallback(C,[d,r,n]),fields:E.useMemo(()=>a.map((S,b)=>({...S,[o]:l.current[b]||ro()})),[a,o])}}var Id=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}},zc=e=>on(e)||!AS(e);function Lo(e,t){if(zc(e)||zc(t))return e===t;if(vi(e)&&vi(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=t[o];if(vi(i)&&vi(a)||Mt(i)&&Mt(a)||Array.isArray(i)&&Array.isArray(a)?!Lo(i,a):i!==a)return!1}}return!0}var WS=e=>e.type==="select-multiple",fL=e=>pm(e)||wl(e),Md=e=>Bc(e)&&e.isConnected,VS=e=>{for(const t in e)if(fo(e[t]))return!0;return!1};function Wc(e,t={}){const n=Array.isArray(e);if(Mt(e)||n)for(const r in e)Array.isArray(e[r])||Mt(e[r])&&!VS(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Wc(e[r],t[r])):on(e[r])||(t[r]=!0);return t}function HS(e,t,n){const r=Array.isArray(e);if(Mt(e)||r)for(const o in e)Array.isArray(e[o])||Mt(e[o])&&!VS(e[o])?dt(t)||zc(n[o])?n[o]=Array.isArray(e[o])?Wc(e[o],[]):{...Wc(e[o])}:HS(e[o],on(t)?{}:t[o],n[o]):n[o]=!Lo(e[o],t[o]);return n}var Rd=(e,t)=>HS(e,t,Wc(t)),US=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>dt(e)?e:t?e===""?NaN:e&&+e:n&&mr(e)?new Date(e):r?r(e):e;function Dd(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return dm(t)?t.files:pm(t)?zS(e.refs).value:WS(t)?[...t.selectedOptions].map(({value:n})=>n):wl(t)?FS(e.refs).value:US(dt(t.value)?e.ref.value:t.value,e)}var dL=(e,t,n,r)=>{const o={};for(const i of e){const a=he(t,i);a&&ct(o,i,a._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Ma=e=>dt(e)?e:Fc(e)?e.source:Mt(e)?Fc(e.value)?e.value.source:e.value:e,pL=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Z0(e,t,n){const r=he(e,n);if(r||fm(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=he(t,i),s=he(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(s&&s.type)return{name:i,error:s};o.pop()}return{name:n}}var hL=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,gL=(e,t)=>!xa(he(e,t)).length&&Nt(e,t);const mL={mode:Nn.onSubmit,reValidateMode:Nn.onChange,shouldFocusError:!0};function vL(e={},t){let n={...mL,...e},r={submitCount:0,isDirty:!1,isLoading:fo(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:n.errors||{},disabled:!1},o={},i=Mt(n.defaultValues)||Mt(n.values)?Yt(n.defaultValues||n.values)||{}:{},a=n.shouldUnregister?{}:Yt(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const f={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:Id(),array:Id(),state:Id()},p=e.resetOptions&&e.resetOptions.keepDirtyValues,h=nh(n.mode),g=nh(n.reValidateMode),v=n.criteriaMode===Nn.all,x=N=>z=>{clearTimeout(u),u=setTimeout(N,z)},w=async N=>{if(f.isValid||N){const z=n.resolver?vn((await k()).errors):await A(o,!0);z!==r.isValid&&d.state.next({isValid:z})}},$=N=>f.isValidating&&d.state.next({isValidating:N}),C=(N,z=[],U,W,V=!0,q=!0)=>{if(W&&U){if(s.action=!0,q&&Array.isArray(he(o,N))){const ue=U(he(o,N),W.argA,W.argB);V&&ct(o,N,ue)}if(q&&Array.isArray(he(r.errors,N))){const ue=U(he(r.errors,N),W.argA,W.argB);V&&ct(r.errors,N,ue),gL(r.errors,N)}if(f.touchedFields&&q&&Array.isArray(he(r.touchedFields,N))){const ue=U(he(r.touchedFields,N),W.argA,W.argB);V&&ct(r.touchedFields,N,ue)}f.dirtyFields&&(r.dirtyFields=Rd(i,a)),d.state.next({name:N,isDirty:j(N,z),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ct(a,N,z)},S=(N,z)=>{ct(r.errors,N,z),d.state.next({errors:r.errors})},b=N=>{r.errors=N,d.state.next({errors:r.errors,isValid:!1})},O=(N,z,U,W)=>{const V=he(o,N);if(V){const q=he(a,N,dt(U)?he(i,N):U);dt(q)||W&&W.defaultChecked||z?ct(a,N,z?q:Dd(V._f)):L(N,q),s.mount&&w()}},P=(N,z,U,W,V)=>{let q=!1,ue=!1;const Ae={name:N},Se=!!(he(o,N)&&he(o,N)._f.disabled);if(!U||W){f.isDirty&&(ue=r.isDirty,r.isDirty=Ae.isDirty=j(),q=ue!==Ae.isDirty);const ne=Se||Lo(he(i,N),z);ue=!!(!Se&&he(r.dirtyFields,N)),ne||Se?Nt(r.dirtyFields,N):ct(r.dirtyFields,N,!0),Ae.dirtyFields=r.dirtyFields,q=q||f.dirtyFields&&ue!==!ne}if(U){const ne=he(r.touchedFields,N);ne||(ct(r.touchedFields,N,U),Ae.touchedFields=r.touchedFields,q=q||f.touchedFields&&ne!==U)}return q&&V&&d.state.next(Ae),q?Ae:{}},T=(N,z,U,W)=>{const V=he(r.errors,N),q=f.isValid&&Rn(z)&&r.isValid!==z;if(e.delayError&&U?(c=x(()=>S(N,U)),c(e.delayError)):(clearTimeout(u),c=null,U?ct(r.errors,N,U):Nt(r.errors,N)),(U?!Lo(V,U):V)||!vn(W)||q){const ue={...W,...q&&Rn(z)?{isValid:z}:{},errors:r.errors,name:N};r={...r,...ue},d.state.next(ue)}$(!1)},k=async N=>n.resolver(a,n.context,dL(N||l.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),_=async N=>{const{errors:z}=await k(N);if(N)for(const U of N){const W=he(z,U);W?ct(r.errors,U,W):Nt(r.errors,U)}else r.errors=z;return z},A=async(N,z,U={valid:!0})=>{for(const W in N){const V=N[W];if(V){const{_f:q,...ue}=V;if(q){const Ae=l.array.has(q.name),Se=await oh(V,a,v,n.shouldUseNativeValidation&&!z,Ae);if(Se[q.name]&&(U.valid=!1,z))break;!z&&(he(Se,q.name)?Ae?BS(r.errors,Se,q.name):ct(r.errors,q.name,Se[q.name]):Nt(r.errors,q.name))}ue&&await A(ue,z,U)}}return U.valid},I=()=>{for(const N of l.unMount){const z=he(o,N);z&&(z._f.refs?z._f.refs.every(U=>!Md(U)):!Md(z._f.ref))&&we(N)}l.unMount=new Set},j=(N,z)=>(N&&z&&ct(a,N,z),!Lo(le(),i)),M=(N,z,U)=>NS(N,l,{...s.mount?a:dt(z)?i:mr(N)?{[N]:z}:z},U,z),D=N=>xa(he(s.mount?a:i,N,e.shouldUnregister?he(i,N,[]):[])),L=(N,z,U={})=>{const W=he(o,N);let V=z;if(W){const q=W._f;q&&(!q.disabled&&ct(a,N,US(z,q)),V=Bc(q.ref)&&on(z)?"":z,WS(q.ref)?[...q.ref.options].forEach(ue=>ue.selected=V.includes(ue.value)):q.refs?wl(q.ref)?q.refs.length>1?q.refs.forEach(ue=>(!ue.defaultChecked||!ue.disabled)&&(ue.checked=Array.isArray(V)?!!V.find(Ae=>Ae===ue.value):V===ue.value)):q.refs[0]&&(q.refs[0].checked=!!V):q.refs.forEach(ue=>ue.checked=ue.value===V):dm(q.ref)?q.ref.value="":(q.ref.value=V,q.ref.type||d.values.next({name:N,values:{...a}})))}(U.shouldDirty||U.shouldTouch)&&P(N,V,U.shouldTouch,U.shouldDirty,!0),U.shouldValidate&&te(N)},B=(N,z,U)=>{for(const W in z){const V=z[W],q=`${N}.${W}`,ue=he(o,q);(l.array.has(N)||!zc(V)||ue&&!ue._f)&&!vi(V)?B(q,V,U):L(q,V,U)}},F=(N,z,U={})=>{const W=he(o,N),V=l.array.has(N),q=Yt(z);ct(a,N,q),V?(d.array.next({name:N,values:{...a}}),(f.isDirty||f.dirtyFields)&&U.shouldDirty&&d.state.next({name:N,dirtyFields:Rd(i,a),isDirty:j(N,q)})):W&&!W._f&&!on(q)?B(N,q,U):L(N,q,U),rh(N,l)&&d.state.next({...r}),d.values.next({name:N,values:{...a}}),!s.mount&&t()},Z=async N=>{const z=N.target;let U=z.name,W=!0;const V=he(o,U),q=()=>z.type?Dd(V._f):kS(N),ue=Ae=>{W=Number.isNaN(Ae)||Ae===he(a,U,Ae)};if(V){let Ae,Se;const ne=q(),Ze=N.type===Lc.BLUR||N.type===Lc.FOCUS_OUT,St=!pL(V._f)&&!n.resolver&&!he(r.errors,U)&&!V._f.deps||hL(Ze,he(r.touchedFields,U),r.isSubmitted,g,h),$t=rh(U,l,Ze);ct(a,U,ne),Ze?(V._f.onBlur&&V._f.onBlur(N),c&&c(0)):V._f.onChange&&V._f.onChange(N);const Oe=P(U,ne,Ze,!1),Be=!vn(Oe)||$t;if(!Ze&&d.values.next({name:U,type:N.type,values:{...a}}),St)return f.isValid&&w(),Be&&d.state.next({name:U,...$t?{}:Oe});if(!Ze&&$t&&d.state.next({...r}),$(!0),n.resolver){const{errors:oe}=await k([U]);if(ue(ne),W){const $e=Z0(r.errors,o,U),Fe=Z0(oe,o,$e.name||U);Ae=Fe.error,U=Fe.name,Se=vn(oe)}}else Ae=(await oh(V,a,v,n.shouldUseNativeValidation))[U],ue(ne),W&&(Ae?Se=!1:f.isValid&&(Se=await A(o,!0)));W&&(V._f.deps&&te(V._f.deps),T(U,Se,Ae,Oe))}},ie=(N,z)=>{if(he(r.errors,z)&&N.focus)return N.focus(),1},te=async(N,z={})=>{let U,W;const V=$n(N);if($(!0),n.resolver){const q=await _(dt(N)?N:V);U=vn(q),W=N?!V.some(ue=>he(q,ue)):U}else N?(W=(await Promise.all(V.map(async q=>{const ue=he(o,q);return await A(ue&&ue._f?{[q]:ue}:ue)}))).every(Boolean),!(!W&&!r.isValid)&&w()):W=U=await A(o);return d.state.next({...!mr(N)||f.isValid&&U!==r.isValid?{}:{name:N},...n.resolver||!N?{isValid:U}:{},errors:r.errors,isValidating:!1}),z.shouldFocus&&!W&&Ci(o,ie,N?V:l.mount),W},le=N=>{const z={...i,...s.mount?a:{}};return dt(N)?z:mr(N)?he(z,N):N.map(U=>he(z,U))},re=(N,z)=>({invalid:!!he((z||r).errors,N),isDirty:!!he((z||r).dirtyFields,N),isTouched:!!he((z||r).touchedFields,N),error:he((z||r).errors,N)}),ae=N=>{N&&$n(N).forEach(z=>Nt(r.errors,z)),d.state.next({errors:N?r.errors:{}})},xe=(N,z,U)=>{const W=(he(o,N,{_f:{}})._f||{}).ref;ct(r.errors,N,{...z,ref:W}),d.state.next({name:N,errors:r.errors,isValid:!1}),U&&U.shouldFocus&&W&&W.focus&&W.focus()},Me=(N,z)=>fo(N)?d.values.subscribe({next:U=>N(M(void 0,z),U)}):M(N,z,!0),we=(N,z={})=>{for(const U of N?$n(N):l.mount)l.mount.delete(U),l.array.delete(U),z.keepValue||(Nt(o,U),Nt(a,U)),!z.keepError&&Nt(r.errors,U),!z.keepDirty&&Nt(r.dirtyFields,U),!z.keepTouched&&Nt(r.touchedFields,U),!n.shouldUnregister&&!z.keepDefaultValue&&Nt(i,U);d.values.next({values:{...a}}),d.state.next({...r,...z.keepDirty?{isDirty:j()}:{}}),!z.keepIsValid&&w()},Y=({disabled:N,name:z,field:U,fields:W,value:V})=>{if(Rn(N)){const q=N?void 0:dt(V)?Dd(U?U._f:he(W,z)._f):V;ct(a,z,q),P(z,q,!1,!1,!0)}},ve=(N,z={})=>{let U=he(o,N);const W=Rn(z.disabled);return ct(o,N,{...U||{},_f:{...U&&U._f?U._f:{ref:{name:N}},name:N,mount:!0,...z}}),l.mount.add(N),U?Y({field:U,disabled:z.disabled,name:N,value:z.value}):O(N,!0,z.value),{...W?{disabled:z.disabled}:{},...n.progressive?{required:!!z.required,min:Ma(z.min),max:Ma(z.max),minLength:Ma(z.minLength),maxLength:Ma(z.maxLength),pattern:Ma(z.pattern)}:{},name:N,onChange:Z,onBlur:Z,ref:V=>{if(V){ve(N,z),U=he(o,N);const q=dt(V.value)&&V.querySelectorAll&&V.querySelectorAll("input,select,textarea")[0]||V,ue=fL(q),Ae=U._f.refs||[];if(ue?Ae.find(Se=>Se===q):q===U._f.ref)return;ct(o,N,{_f:{...U._f,...ue?{refs:[...Ae.filter(Md),q,...Array.isArray(he(i,N))?[{}]:[]],ref:{type:q.type,name:N}}:{ref:q}}}),O(N,!1,void 0,q)}else U=he(o,N,{}),U._f&&(U._f.mount=!1),(n.shouldUnregister||z.shouldUnregister)&&!(jS(l.array,N)&&s.action)&&l.unMount.add(N)}}},ce=()=>n.shouldFocusError&&Ci(o,ie,l.mount),G=N=>{Rn(N)&&(d.state.next({disabled:N}),Ci(o,(z,U)=>{let W=N;const V=he(o,U);V&&Rn(V._f.disabled)&&(W||(W=V._f.disabled)),z.disabled=W},0,!1))},fe=(N,z)=>async U=>{U&&(U.preventDefault&&U.preventDefault(),U.persist&&U.persist());let W=Yt(a);if(d.state.next({isSubmitting:!0}),n.resolver){const{errors:V,values:q}=await k();r.errors=V,W=q}else await A(o);Nt(r.errors,"root"),vn(r.errors)?(d.state.next({errors:{}}),await N(W,U)):(z&&await z({...r.errors},U),ce(),setTimeout(ce)),d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:vn(r.errors),submitCount:r.submitCount+1,errors:r.errors})},de=(N,z={})=>{he(o,N)&&(dt(z.defaultValue)?F(N,he(i,N)):(F(N,z.defaultValue),ct(i,N,z.defaultValue)),z.keepTouched||Nt(r.touchedFields,N),z.keepDirty||(Nt(r.dirtyFields,N),r.isDirty=z.defaultValue?j(N,he(i,N)):j()),z.keepError||(Nt(r.errors,N),f.isValid&&w()),d.state.next({...r}))},pe=(N,z={})=>{const U=N?Yt(N):i,W=Yt(U),V=N&&!vn(N)?W:i;if(z.keepDefaultValues||(i=U),!z.keepValues){if(z.keepDirtyValues||p)for(const q of l.mount)he(r.dirtyFields,q)?ct(V,q,he(a,q)):F(q,he(V,q));else{if(um&&dt(N))for(const q of l.mount){const ue=he(o,q);if(ue&&ue._f){const Ae=Array.isArray(ue._f.refs)?ue._f.refs[0]:ue._f.ref;if(Bc(Ae)){const Se=Ae.closest("form");if(Se){Se.reset();break}}}}o={}}a=e.shouldUnregister?z.keepDefaultValues?Yt(i):{}:Yt(V),d.array.next({values:{...V}}),d.values.next({values:{...V}})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!s.mount&&t(),s.mount=!f.isValid||!!z.keepIsValid,s.watch=!!e.shouldUnregister,d.state.next({submitCount:z.keepSubmitCount?r.submitCount:0,isDirty:z.keepDirty?r.isDirty:!!(z.keepDefaultValues&&!Lo(N,i)),isSubmitted:z.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:z.keepDirtyValues?r.dirtyFields:z.keepDefaultValues&&N?Rd(i,N):{},touchedFields:z.keepTouched?r.touchedFields:{},errors:z.keepErrors?r.errors:{},isSubmitSuccessful:z.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},se=(N,z)=>pe(fo(N)?N(a):N,z);return{control:{register:ve,unregister:we,getFieldState:re,handleSubmit:fe,setError:xe,_executeSchema:k,_getWatch:M,_getDirty:j,_updateValid:w,_removeUnmounted:I,_updateFieldArray:C,_updateDisabledField:Y,_getFieldArray:D,_reset:pe,_resetDefaultValues:()=>fo(n.defaultValues)&&n.defaultValues().then(N=>{se(N,n.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:N=>{r={...r,...N}},_disableForm:G,_subjects:d,_proxyFormState:f,_setErrors:b,get _fields(){return o},get _formValues(){return a},get _state(){return s},set _state(N){s=N},get _defaultValues(){return i},get _names(){return l},set _names(N){l=N},get _formState(){return r},set _formState(N){r=N},get _options(){return n},set _options(N){n={...n,...N}}},trigger:te,register:ve,handleSubmit:fe,watch:Me,setValue:F,getValues:le,reset:se,resetField:de,clearErrors:ae,unregister:we,setError:xe,setFocus:(N,z={})=>{const U=he(o,N),W=U&&U._f;if(W){const V=W.refs?W.refs[0]:W.ref;V.focus&&(V.focus(),z.shouldSelect&&V.select())}},getFieldState:re}}function Cl(e={}){const t=E.useRef(),n=E.useRef(),[r,o]=E.useState({isDirty:!1,isValidating:!1,isLoading:fo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:e.errors||{},disabled:!1,defaultValues:fo(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...vL(e,()=>o(a=>({...a}))),formState:r});const i=t.current.control;return i._options=e,pf({subject:i._subjects.state,next:a=>{RS(a,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),E.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),E.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),E.useEffect(()=>{e.values&&!Lo(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,o(a=>({...a}))):i._resetDefaultValues()},[e.values,i]),E.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),E.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=MS(r,i),t.current}const yL=({children:e})=>{const[t,n]=Qo(o=>[o.fetchData,o.setAbortRequests]),[r]=sa(o=>[o.setBudget]);return y.useEffect(()=>{t(r,n)},[t,r,n]),m.jsx(m.Fragment,{children:e})},mue=()=>{const{simulation:e,simulationHelpers:t}=Vu(n=>n);return{nodes:(e==null?void 0:e.nodes())||[],links:t.getLinks()}},bL=xO` + */var mD=lD,vD=dD,N0=vS,L0=gD,yD=function(e,t,n){if(!L0(e)||(Array.isArray(t)&&(t=[].concat.apply([],t).join(".")),typeof t!="string"))return e;for(var r=mD(t,{sep:".",brackets:!0}).filter(bD),o=r.length,i=-1,a=e;++ie.filter(Boolean).join(".");function $D(e){const t=e.split(".");return[t.pop(),t.join(".")||void 0]}function CD(e,t){return Object.entries(Qj(e,t)).reduce((n,[,{value:r,disabled:o,key:i}])=>(n[i]=o?void 0:r,n),{})}function OD(e,t){const n=y.useRef();return(t?vs:hl)(e,n.current)||(n.current=e),n.current}function bS(e,t){return y.useMemo(e,OD(t,!0))}function ED(e){const t=y.useRef(null),n=y.useRef(null),r=y.useRef(!0);return y.useLayoutEffect(()=>{e||(t.current.style.height="0px",t.current.style.overflow="hidden")},[]),y.useEffect(()=>{if(r.current){r.current=!1;return}let o;const i=t.current,a=()=>{e&&(i.style.removeProperty("height"),i.style.removeProperty("overflow"),n.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};i.addEventListener("transitionend",a,{once:!0});const{height:s}=n.current.getBoundingClientRect();return i.style.height=s+"px",e||(i.style.overflow="hidden",o=window.setTimeout(()=>i.style.height="0px",50)),()=>{i.removeEventListener("transitionend",a),clearTimeout(o)}},[e]),{wrapperRef:t,contentRef:n}}const PD=e=>{const[t,n]=y.useState(e.getVisiblePaths());return y.useEffect(()=>{n(e.getVisiblePaths());const r=e.useStore.subscribe(e.getVisiblePaths,n,{equalityFn:hl});return()=>r()},[e]),t};function _D(e,t,n){return e.useStore(o=>{const i=Ne(Ne({},n),o.data);return CD(i,t)},hl)}function xS(e=3){const t=y.useRef(null),n=y.useRef(null),[r,o]=y.useState(!1),i=y.useCallback(()=>o(!0),[]),a=y.useCallback(()=>o(!1),[]);return y.useLayoutEffect(()=>{if(r){const{bottom:s,top:l,left:c}=t.current.getBoundingClientRect(),{height:u}=n.current.getBoundingClientRect(),f=s+u>window.innerHeight-40?"up":"down";n.current.style.position="fixed",n.current.style.zIndex="10000",n.current.style.left=c+"px",f==="down"?n.current.style.top=s+e+"px":n.current.style.bottom=window.innerHeight-l+e+"px"}},[e,r]),{popinRef:t,wrapperRef:n,shown:r,show:i,hide:a}}RM([DM]);const TD={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};un.extend({color:()=>e=>rn(e).isValid()});const AD=e=>un().color().test(e);function wS(e,{format:t,hasAlpha:n,isString:r}){const o=TD[t]+(r&&t!=="hex"?"String":""),i=e[o]();return typeof i=="object"&&!n?Jj(i,["a"]):i}const SS=(e,t)=>{const n=rn(e);if(!n.isValid())throw Error("Invalid color");return wS(n,t)},kD=(e,t)=>wS(rn(e),Ne(Ne({},t),{},{isString:!0,format:"hex"})),jD=({value:e})=>{const t=MM(e),n=t==="name"?"hex":t,r=typeof e=="object"?"a"in e:t==="hex"&&e.length===8||/^(rgba)|(hsla)|(hsva)/.test(e),o={format:n,hasAlpha:r,isString:typeof e=="string"};return{value:SS(e,o),settings:o}};var ID=Object.freeze({__proto__:null,schema:AD,sanitize:SS,format:kD,normalize:jD});const MD=De("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:`url('data:image/svg+xml;charset=utf-8,')`,$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),RD=De("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),DD=De("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function z0(e,t){return t!=="rgb"?rn(e).toRgb():e}function ND({value:e,displayValue:t,settings:n,onUpdate:r}){const{emitOnEditStart:o,emitOnEditEnd:i}=en(),{format:a,hasAlpha:s}=n,{popinRef:l,wrapperRef:c,shown:u,show:f,hide:d}=xS(),p=y.useRef(0),[h,g]=y.useState(()=>z0(e,a)),v=s?VM:UM,x=()=>{g(z0(e,a)),f(),o()},w=()=>{d(),i(),window.clearTimeout(p.current)},$=()=>{p.current=window.setTimeout(w,500)};return y.useEffect(()=>()=>window.clearTimeout(p.current),[]),E.createElement(E.Fragment,null,E.createElement(MD,{ref:l,active:u,onClick:()=>x(),style:{color:t}}),u&&E.createElement(em,null,E.createElement(V3,{onPointerUp:w}),E.createElement(DD,{ref:c,onMouseEnter:()=>window.clearTimeout(p.current),onMouseLeave:C=>C.buttons===0&&$()},E.createElement(v,{color:h,onChange:r}))))}function LD(){const{value:e,displayValue:t,label:n,onChange:r,onUpdate:o,settings:i}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,n),E.createElement(RD,null,E.createElement(ND,{value:e,displayValue:t,onChange:r,onUpdate:o,settings:i}),E.createElement(Jg,{value:t,onChange:r,onUpdate:o})))}var BD=Ne({component:LD},ID);function FD(){const{label:e,displayValue:t,onUpdate:n,settings:r}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(nm,{value:t,settings:r,onUpdate:n}))}var zD=Ne({component:FD},Z3(["x","y","z"]));const WD=De("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),VD=De("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function HD({value:e,settings:t,onUpdate:n}){const r=y.useRef(),o=y.useRef(0),i=y.useRef(0),a=y.useRef(1),[s,l]=y.useState(!1),[c,u]=y.useState(!1),[f,d]=U3(),p=y.useRef(null),h=y.useRef(null);y.useLayoutEffect(()=>{if(s){const{top:A,left:I,width:j,height:M}=p.current.getBoundingClientRect();h.current.style.left=I+j/2+"px",h.current.style.top=A+M/2+"px"}},[s]);const{keys:[g,v],joystick:x}=t,w=x==="invertY"?1:-1,{[g]:{step:$},[v]:{step:C}}=t,S=Lr("sizes","joystickWidth"),b=Lr("sizes","joystickHeight"),O=parseFloat(S)*.8/2,P=parseFloat(b)*.8/2,T=y.useCallback(()=>{r.current||(u(!0),o.current&&d({x:o.current*O}),i.current&&d({y:i.current*-P}),r.current=window.setInterval(()=>{n(A=>{const I=$*o.current*a.current,j=w*C*i.current*a.current;return Array.isArray(A)?{[g]:A[0]+I,[v]:A[1]+j}:{[g]:A[g]+I,[v]:A[v]+j}})},16))},[O,P,n,d,$,C,g,v,w]),k=y.useCallback(()=>{window.clearTimeout(r.current),r.current=void 0,u(!1)},[]);y.useEffect(()=>{function A(I){a.current=T3(I)}return window.addEventListener("keydown",A),window.addEventListener("keyup",A),()=>{window.clearTimeout(r.current),window.removeEventListener("keydown",A),window.removeEventListener("keyup",A)}},[]);const _=yl(({first:A,active:I,delta:[j,M],movement:[D,L]})=>{A&&l(!0);const B=So(D,-O,O),F=So(L,-P,P);o.current=Math.abs(D)>Math.abs(B)?Math.sign(D-B):0,i.current=Math.abs(L)>Math.abs(F)?Math.sign(F-L):0;let Z=e[g],ie=e[v];I?(o.current||(Z+=j*$*a.current,d({x:B})),i.current||(ie-=w*M*C*a.current,d({y:F})),o.current||i.current?T():k(),n({[g]:Z,[v]:ie})):(l(!1),o.current=0,i.current=0,d({x:0,y:0}),k())});return E.createElement(WD,Ot({ref:p},_()),s&&E.createElement(em,null,E.createElement(VD,{ref:h,isOutOfBounds:c},E.createElement("div",null),E.createElement("span",{ref:f}))))}const UD=De("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});function GD(){const{label:e,displayValue:t,onUpdate:n,settings:r}=en();return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(UD,{withJoystick:!!r.joystick},r.joystick&&E.createElement(HD,{value:t,settings:r,onUpdate:n}),E.createElement(nm,{value:t,settings:r,onUpdate:n})))}const KD=["joystick"],$S=Z3(["x","y"]),qD=e=>{let{joystick:t=!0}=e,n=st(e,KD);const{value:r,settings:o}=$S.normalize(n);return{value:r,settings:Ne(Ne({},o),{},{joystick:t})}};var XD=Ne(Ne({component:GD},$S),{},{normalize:qD});const YD=e=>{if(e!==void 0){if(e instanceof File)try{return URL.createObjectURL(e)}catch{return}if(typeof e=="string"&&e.indexOf("blob:")===0)return e;throw Error("Invalid image format [undefined | blob | File].")}},ZD=(e,t)=>typeof t=="object"&&"image"in t,QD=({image:e})=>({value:e});var JD=Object.freeze({__proto__:null,sanitize:YD,schema:ZD,normalize:QD});const eN=De("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),tN=De("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),nN=De("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),rN=De("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),oN=De("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),iN=De("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});function aN(){const{label:e,value:t,onUpdate:n,disabled:r}=en(),{popinRef:o,wrapperRef:i,shown:a,show:s,hide:l}=xS(),c=y.useCallback(h=>{h.length&&n(h[0])},[n]),u=y.useCallback(h=>{h.stopPropagation(),n(void 0)},[n]),{getRootProps:f,getInputProps:d,isDragAccept:p}=mS({maxFiles:1,accept:"image/*",onDrop:c,disabled:r});return E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(eN,null,E.createElement(nN,{ref:o,hasImage:!!t,onPointerDown:()=>!!t&&s(),onPointerUp:l,style:{backgroundImage:t?`url(${t})`:"none"}}),a&&!!t&&E.createElement(em,null,E.createElement(V3,{onPointerUp:l,style:{cursor:"pointer"}}),E.createElement(rN,{ref:i,style:{backgroundImage:`url(${t})`}})),E.createElement(tN,f({isDragAccept:p}),E.createElement("input",d()),E.createElement(oN,null,p?"drop image":"click or drop")),E.createElement(iN,{onClick:u,disabled:!t})))}var sN=Ne({component:aN},JD);const W0=un().number(),lN=(e,t)=>un().array().length(2).every.number().test(e)&&un().schema({min:W0,max:W0}).test(t),Rc=e=>({min:e[0],max:e[1]}),CS=(e,{bounds:[t,n]},r)=>{const o=Array.isArray(e)?Rc(e):e,i={min:r[0],max:r[1]},{min:a,max:s}=Ne(Ne({},i),o);return[So(Number(a),t,Math.max(t,s)),So(Number(s),Math.min(n,a),n)]},cN=({value:e,min:t,max:n})=>{const r={min:t,max:n},o=Y3(Rc(e),{min:r,max:r}),i=[t,n],a=Ne(Ne({},o),{},{bounds:i});return{value:CS(Rc(e),a,e),settings:a}};var uN=Object.freeze({__proto__:null,schema:lN,format:Rc,sanitize:CS,normalize:cN});const fN=["value","bounds","onDrag"],dN=["bounds"],pN=De("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function hN(e){let{value:t,bounds:[n,r],onDrag:o}=e,i=st(e,fN);const a=y.useRef(null),s=y.useRef(null),l=y.useRef(null),c=y.useRef(0),u=Lr("sizes","scrubberWidth"),f=yl(({event:h,first:g,xy:[v],movement:[x],memo:w={}})=>{if(g){const{width:C,left:S}=a.current.getBoundingClientRect();c.current=C-parseFloat(u);const b=(h==null?void 0:h.target)===s.current||(h==null?void 0:h.target)===l.current;w.pos=Ac((v-S)/C,n,r);const O=Math.abs(w.pos-t.min)-Math.abs(w.pos-t.max);w.key=O<0||O===0&&w.pos<=t.min?"min":"max",b&&(w.pos=t[w.key])}const $=w.pos+Ac(x/c.current,0,r-n);return o({[w.key]:zI($,i[w.key])}),w}),d=`calc(${Tc(t.min,n,r)} * (100% - ${u} - 8px) + 4px)`,p=`calc(${1-Tc(t.max,n,r)} * (100% - ${u} - 8px) + 4px)`;return E.createElement(K3,Ot({ref:a},f()),E.createElement(G3,null,E.createElement(q3,{style:{left:d,right:p}})),E.createElement(Hp,{position:"left",ref:s,style:{left:d}}),E.createElement(Hp,{position:"right",ref:l,style:{right:p}}))}function gN(){const{label:e,displayValue:t,onUpdate:n,settings:r}=en(),o=st(r,dN);return E.createElement(E.Fragment,null,E.createElement(qn,{input:!0},E.createElement(lr,null,e),E.createElement(pN,null,E.createElement(hN,Ot({value:t},r,{onDrag:n})),E.createElement(nm,{value:t,settings:o,onUpdate:n,innerLabelTrim:0}))))}var mN=Ne({component:gN},uN);const vN=()=>{const e=new Map;return{on:(t,n)=>{let r=e.get(t);r===void 0&&(r=new Set,e.set(t,r)),r.add(n)},off:(t,n)=>{const r=e.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.delete(t))},emit:(t,...n)=>{const r=e.get(t);if(r!==void 0)for(const o of r)o(...n)}}},yN=["type","value"],bN=["onChange","transient","onEditStart","onEditEnd"],xN=function(){const t=FR(zR(()=>({data:{}}))),n=vN();this.storeId=Zj(),this.useStore=t;const r={},o=new Set;this.getVisiblePaths=()=>{const a=this.getData(),s=Object.keys(a),l=[];Object.entries(r).forEach(([u,f])=>{f.render&&s.some(d=>d.indexOf(u)===0)&&!f.render(this.get)&&l.push(u+".")});const c=[];return o.forEach(u=>{u in a&&a[u].__refCount>0&&l.every(f=>u.indexOf(f)===-1)&&(!a[u].render||a[u].render(this.get))&&c.push(u)}),c},this.setOrderedPaths=a=>{a.forEach(s=>o.add(s))},this.orderPaths=a=>(this.setOrderedPaths(a),a),this.disposePaths=a=>{t.setState(s=>{const l=s.data;return a.forEach(c=>{if(c in l){const u=l[c];u.__refCount--,u.__refCount===0&&u.type in rr&&delete l[c]}}),{data:l}})},this.dispose=()=>{t.setState(()=>({data:{}}))},this.getFolderSettings=a=>r[a]||{},this.getData=()=>t.getState().data,this.addData=(a,s)=>{t.setState(l=>{const c=l.data;return Object.entries(a).forEach(([u,f])=>{let d=c[u];if(d){const{type:p,value:h}=f,g=st(f,yN);p!==d.type?jr(xt.INPUT_TYPE_OVERRIDE,p):((d.__refCount===0||s)&&Object.assign(d,g),d.__refCount++)}else c[u]=Ne(Ne({},f),{},{__refCount:1})}),{data:c}})},this.setValueAtPath=(a,s,l)=>{t.setState(c=>{const u=c.data;return f0(u[a],s,a,this,l),{data:u}})},this.setSettingsAtPath=(a,s)=>{t.setState(l=>{const c=l.data;return c[a].settings=Ne(Ne({},c[a].settings),s),{data:c}})},this.disableInputAtPath=(a,s)=>{t.setState(l=>{const c=l.data;return c[a].disabled=s,{data:c}})},this.set=(a,s)=>{t.setState(l=>{const c=l.data;return Object.entries(a).forEach(([u,f])=>{try{f0(c[u],f,void 0,void 0,s)}catch{}}),{data:c}})},this.getInput=a=>{try{return this.getData()[a]}catch{jr(xt.PATH_DOESNT_EXIST,a)}},this.get=a=>{var s;return(s=this.getInput(a))===null||s===void 0?void 0:s.value},this.emitOnEditStart=a=>{n.emit(`onEditStart:${a}`,this.get(a),a,Ne(Ne({},this.getInput(a)),{},{get:this.get}))},this.emitOnEditEnd=a=>{n.emit(`onEditEnd:${a}`,this.get(a),a,Ne(Ne({},this.getInput(a)),{},{get:this.get}))},this.subscribeToEditStart=(a,s)=>{const l=`onEditStart:${a}`;return n.on(l,s),()=>n.off(l,s)},this.subscribeToEditEnd=(a,s)=>{const l=`onEditEnd:${a}`;return n.on(l,s),()=>n.off(l,s)};const i=(a,s,l)=>{const c={};return Object.entries(a).forEach(([u,f])=>{if(u==="")return jr(xt.EMPTY_KEY);let d=cm(s,u);if(f.type===rr.FOLDER){const p=i(f.schema,d,l);Object.assign(c,p),d in r||(r[d]=f.settings)}else if(u in l)jr(xt.DUPLICATE_KEYS,u,d,l[u].path);else{const p=iI(f,u,d,c);if(p){const{type:h,options:g,input:v}=p,{onChange:x,transient:w,onEditStart:$,onEditEnd:C}=g,S=st(g,bN);c[d]=Ne(Ne(Ne({type:h},S),v),{},{fromPanel:!0}),l[u]={path:d,onChange:x,transient:w,onEditStart:$,onEditEnd:C}}else jr(xt.UNKNOWN_INPUT,d,f)}}),c};this.getDataFromSchema=a=>{const s={};return[i(a,"",s),s]}},OS=new xN,wN={collapsed:!1};function SN(e,t){return{type:rr.FOLDER,schema:e,settings:Ne(Ne({},wN),t)}}const V0=e=>"__levaInput"in e,$N=(e,t)=>{const n={},r=t?t.toLowerCase():null;return e.forEach(o=>{const[i,a]=$D(o);(!r||i.toLowerCase().indexOf(r)>-1)&&SD(n,a,{[i]:{__levaInput:!0,path:o}})}),n},CN=["type","label","path","valueKey","value","settings","setValue","disabled"];function ON(e){let{type:t,label:n,path:r,valueKey:o,value:i,settings:a,setValue:s,disabled:l}=e,c=st(e,CN);const{displayValue:u,onChange:f,onUpdate:d}=H3({type:t,value:i,settings:a,setValue:s}),p=Yo[t].component;return p?E.createElement(M3.Provider,{value:Ne({key:o,path:r,id:""+r,label:n,displayValue:u,value:i,onChange:f,onUpdate:d,settings:a,setValue:s,disabled:l},c)},E.createElement(OI,{disabled:l},E.createElement(p,null))):(jr(xt.NO_COMPONENT_FOR_TYPE,t,r),null)}const EN=De("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});function PN({onClick:e,settings:t,label:n}){const r=vl();return E.createElement(qn,null,E.createElement(EN,{disabled:t.disabled,onClick:()=>e(r.get)},n))}const _N=De("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),TN=De("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),AN=({label:e,opts:t})=>{let n=typeof e=="string"&&e.trim()===""?null:e,r=t;return typeof t.opts=="object"&&(r.label!==void 0&&(n=t.label),r=t.opts),{label:n,opts:r}};function kN(e){const{label:t,opts:n}=AN(e),r=vl();return E.createElement(qn,{input:!!t},t&&E.createElement(lr,null,t),E.createElement(_N,null,Object.entries(n).map(([o,i])=>E.createElement(TN,{key:o,onClick:()=>i(r.get)},o))))}const jN=De("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),ES=100;function IN(e,t){e.push(t),e.length>ES&&e.shift()}const MN=y.forwardRef(function({initialValue:e},t){const n=Lr("colors","highlight3"),r=Lr("colors","elevation2"),o=Lr("colors","highlight1"),[i,a]=y.useMemo(()=>[rn(o).alpha(.4).toRgbString(),rn(o).alpha(.1).toRgbString()],[o]),s=y.useRef([e]),l=y.useRef(e),c=y.useRef(e),u=y.useRef(),f=y.useCallback((h,g)=>{if(!h)return;const{width:v,height:x}=h,w=new Path2D,$=v/ES,C=x*.05;for(let O=0;O({frame:h=>{(l.current===void 0||hc.current)&&(c.current=h),IN(s.current,h),u.current=requestAnimationFrame(()=>f(d.current,p.current))}}),[d,p,f]),y.useEffect(()=>()=>cancelAnimationFrame(u.current),[]),E.createElement(jN,{ref:d})}),H0=e=>Number.isFinite(e)?e.toPrecision(2):e.toString(),RN=y.forwardRef(function({initialValue:e},t){const[n,r]=y.useState(H0(e));return y.useImperativeHandle(t,()=>({frame:o=>r(H0(o))}),[]),E.createElement("div",null,n)});function U0(e){return typeof e=="function"?e():e.current}function DN({label:e,objectOrFn:t,settings:n}){const r=y.useRef(),o=y.useRef(U0(t));return y.useEffect(()=>{const i=window.setInterval(()=>{var a;document.hidden||(a=r.current)===null||a===void 0||a.frame(U0(t))},n.interval);return()=>window.clearInterval(i)},[t,n.interval]),E.createElement(qn,{input:!0},E.createElement(lr,{align:"top"},e),n.graph?E.createElement(MN,{ref:r,initialValue:o.current}):E.createElement(RN,{ref:r,initialValue:o.current}))}const NN=["type","label","key"],LN={[rr.BUTTON]:PN,[rr.BUTTON_GROUP]:kN,[rr.MONITOR]:DN},BN=E.memo(({path:e})=>{const[t,{set:n,setSettings:r,disable:o,storeId:i,emitOnEditStart:a,emitOnEditEnd:s}]=DI(e);if(!t)return null;const{type:l,label:c,key:u}=t,f=st(t,NN);if(l in rr){const d=LN[l];return E.createElement(d,Ot({label:c,path:e},f))}return l in Yo?E.createElement(ON,Ot({key:i+e,type:l,label:c,storeId:i,path:e,valueKey:u,setValue:n,setSettings:r,disable:o,emitOnEditStart:a,emitOnEditEnd:s},f)):(Vj(xt.UNSUPPORTED_INPUT,l,e),null)});function FN({toggle:e,toggled:t,name:n}){return E.createElement(SI,{onClick:()=>e()},E.createElement(tm,{toggled:t}),E.createElement("div",null,n))}const zN=({name:e,path:t,tree:n})=>{const r=vl(),o=cm(t,e),{collapsed:i,color:a}=r.getFolderSettings(o),[s,l]=y.useState(!i),c=y.useRef(null),u=Lr("colors","folderWidgetColor"),f=Lr("colors","folderTextColor");return y.useLayoutEffect(()=>{c.current.style.setProperty("--leva-colors-folderWidgetColor",a||u),c.current.style.setProperty("--leva-colors-folderTextColor",a||f)},[a,u,f]),E.createElement(kc,{ref:c},E.createElement(FN,{name:e,toggled:s,toggle:()=>l(d=>!d)}),E.createElement(PS,{parent:o,tree:n,toggled:s}))},PS=E.memo(({isRoot:e=!1,fill:t=!1,flat:n=!1,parent:r,tree:o,toggled:i})=>{const{wrapperRef:a,contentRef:s}=ED(i),l=vl(),c=([f,d])=>{var p;return(V0(d)?(p=l.getInput(d.path))===null||p===void 0?void 0:p.order:l.getFolderSettings(cm(r,f)).order)||0},u=Object.entries(o).sort((f,d)=>c(f)-c(d));return E.createElement(Wp,{ref:a,isRoot:e,fill:t,flat:n},E.createElement(F3,{ref:s,isRoot:e,toggled:i},u.map(([f,d])=>V0(d)?E.createElement(BN,{key:d.path,valueKey:d.valueKey,path:d.path}):E.createElement(zN,{key:f,name:f,path:r,tree:d}))))}),WN=De("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${W3}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),_S=40,Dc=De("i",{$flexCenter:"",width:_S,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),VN=De("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),HN=De("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${Dc}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),UN=De("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),GN=De("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:_S}}}}),KN=E.forwardRef(({setFilter:e,toggle:t},n)=>{const[r,o]=y.useState(""),i=y.useMemo(()=>_3(e,250),[e]),a=()=>{e(""),o("")},s=l=>{const c=l.currentTarget.value;t(!0),o(c)};return y.useEffect(()=>{i(r)},[r,i]),E.createElement(E.Fragment,null,E.createElement(UN,{ref:n,value:r,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:l=>l.stopPropagation(),onChange:s}),E.createElement(Dc,{onClick:()=>a(),style:{visibility:r?"visible":"hidden"}},E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function qN({setFilter:e,onDrag:t,onDragStart:n,onDragEnd:r,toggle:o,toggled:i,title:a,drag:s,filterEnabled:l,from:c}){const[u,f]=y.useState(!1),d=y.useRef(null);y.useEffect(()=>{var h,g;u?(h=d.current)===null||h===void 0||h.focus():(g=d.current)===null||g===void 0||g.blur()},[u]);const p=yl(({offset:[h,g],first:v,last:x})=>{t({x:h,y:g}),v&&n({x:h,y:g}),x&&r({x:h,y:g})},{filterTaps:!0,from:({offset:[h,g]})=>[(c==null?void 0:c.x)||h,(c==null?void 0:c.y)||g]});return y.useEffect(()=>{const h=g=>{g.key==="L"&&g.shiftKey&&g.metaKey&&f(v=>!v)};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[]),E.createElement(E.Fragment,null,E.createElement(VN,{mode:s?"drag":void 0},E.createElement(Dc,{active:!i,onClick:()=>o()},E.createElement(tm,{toggled:i,width:12,height:8})),E.createElement(GN,Ot({},s?p():{},{drag:s,filterEnabled:l}),a===void 0&&s?E.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},E.createElement("circle",{cx:"2",cy:"2",r:"2"}),E.createElement("circle",{cx:"14",cy:"2",r:"2"}),E.createElement("circle",{cx:"26",cy:"2",r:"2"}),E.createElement("circle",{cx:"2",cy:"12",r:"2"}),E.createElement("circle",{cx:"14",cy:"12",r:"2"}),E.createElement("circle",{cx:"26",cy:"12",r:"2"})):a),l&&E.createElement(Dc,{active:u,onClick:()=>f(h=>!h)},E.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"},E.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),E.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),E.createElement(HN,{toggled:u},E.createElement(KN,{ref:d,setFilter:e,toggle:o})))}const XN=["store","hidden","theme","collapsed"];function YN(e){let{store:t,hidden:n=!1,theme:r,collapsed:o=!1}=e,i=st(e,XN);const a=bS(()=>mI(r),[r]),[s,l]=y.useState(!o),c=typeof o=="object"?!o.collapsed:s,u=y.useMemo(()=>typeof o=="object"?f=>{typeof f=="function"?o.onChange(!f(!o.collapsed)):o.onChange(!f)}:l,[o]);return!t||n?null:E.createElement(Qg.Provider,{value:a},E.createElement(ZN,Ot({store:t},i,{toggled:c,setToggle:u,rootClass:a.className})))}const ZN=E.memo(({store:e,rootClass:t,fill:n=!1,flat:r=!1,neverHide:o=!1,oneLineLabels:i=!1,titleBar:a={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:s=!1,toggled:l,setToggle:c})=>{var u,f;const d=PD(e),[p,h]=y.useState(""),g=y.useMemo(()=>$N(d,p),[d,p]),[v,x]=U3(),w=o||d.length>0,$=typeof a=="object"&&a.title||void 0,C=typeof a=="object"&&(u=a.drag)!==null&&u!==void 0?u:!0,S=typeof a=="object"&&(f=a.filter)!==null&&f!==void 0?f:!0,b=typeof a=="object"&&a.position||void 0,O=typeof a=="object"&&a.onDrag||void 0,P=typeof a=="object"&&a.onDragStart||void 0,T=typeof a=="object"&&a.onDragEnd||void 0;return E.useEffect(()=>{x({x:b==null?void 0:b.x,y:b==null?void 0:b.y})},[b,x]),gI(),E.createElement(D3.Provider,{value:{hideCopyButton:s}},E.createElement(WN,{ref:v,className:t,fill:n,flat:r,oneLineLabels:i,hideTitleBar:!a,style:{display:w?"block":"none"}},a&&E.createElement(qN,{onDrag:k=>{x(k),O==null||O(k)},onDragStart:k=>P==null?void 0:P(k),onDragEnd:k=>T==null?void 0:T(k),setFilter:h,toggle:k=>c(_=>k??!_),toggled:l,title:$,drag:C,filterEnabled:S,from:b}),w&&E.createElement(R3.Provider,{value:e},E.createElement(PS,{isRoot:!0,fill:n,flat:r,tree:g,toggled:l}))))}),QN=["isRoot"];let Nc=!1,No=null;function TS(e){let{isRoot:t=!1}=e,n=st(e,QN);return y.useEffect(()=>(Nc=!0,!t&&No&&(No.remove(),No=null),()=>{t||(Nc=!1)}),[t]),E.createElement(YN,Ot({store:OS},n))}function JN(e){y.useEffect(()=>{e&&!Nc&&(No||(No=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(No),sI(E.createElement(TS,{isRoot:!0}),No))),Nc=!0)},[e])}function eL(e,t,n,r,o){let i,a,s,l,c;return typeof e=="string"?(a=e,i=t,Array.isArray(n)?c=n:n&&("store"in n?(l=n,c=r):(s=n,Array.isArray(r)?c=r:(l=r,c=o)))):(i=e,Array.isArray(t)?c=t:(l=t,c=n)),{schema:i,folderName:a,folderSettings:s,hookSettings:l,deps:c||[]}}function mue(e,t,n,r,o){const{folderName:i,schema:a,folderSettings:s,hookSettings:l,deps:c}=eL(e,t,n,r,o),u=typeof a=="function",f=y.useRef(!1),d=y.useRef(!0),p=bS(()=>{f.current=!0;const _=typeof a=="function"?a():a;return i?{[i]:SN(_,s)}:_},c),h=!(l!=null&&l.store);JN(h);const[g]=y.useState(()=>(l==null?void 0:l.store)||OS),[v,x]=y.useMemo(()=>g.getDataFromSchema(p),[g,p]),[w,$,C,S,b]=y.useMemo(()=>{const _=[],A=[],I={},j={},M={};return Object.values(x).forEach(({path:D,onChange:L,onEditStart:B,onEditEnd:F,transient:Z})=>{_.push(D),L?(I[D]=L,Z||A.push(D)):A.push(D),B&&(j[D]=B),F&&(M[D]=F)}),[_,A,I,j,M]},[x]),O=y.useMemo(()=>g.orderPaths(w),[w,g]),P=_D(g,$,v),T=y.useCallback(_=>{const A=Object.entries(_).reduce((I,[j,M])=>Object.assign(I,{[x[j].path]:M}),{});g.set(A,!1)},[g,x]),k=y.useCallback(_=>g.get(x[_].path),[g,x]);return y.useEffect(()=>{const _=!d.current&&f.current;return g.addData(v,_),d.current=!1,f.current=!1,()=>g.disposePaths(O)},[g,O,v]),y.useEffect(()=>{const _=[];return Object.entries(C).forEach(([A,I])=>{I(g.get(A),A,Ne({initial:!0,get:g.get},g.getInput(A)));const j=g.useStore.subscribe(M=>{const D=M.data[A];return[D.disabled?void 0:D.value,D]},([M,D])=>I(M,A,Ne({initial:!1,get:g.get},D)),{equalityFn:hl});_.push(j)}),()=>_.forEach(A=>A())},[g,C]),y.useEffect(()=>{const _=[];return Object.entries(S).forEach(([A,I])=>_.push(g.subscribeToEditStart(A,I))),Object.entries(b).forEach(([A,I])=>_.push(g.subscribeToEditEnd(A,I))),()=>_.forEach(A=>A())},[S,b,g]),u?[P,T,k]:P}Jr(ar.SELECT,JI);Jr(ar.IMAGE,sN);Jr(ar.NUMBER,VI);Jr(ar.COLOR,BD);Jr(ar.STRING,lM);Jr(ar.BOOLEAN,gM);Jr(ar.INTERVAL,mN);Jr(ar.VECTOR3D,zD);Jr(ar.VECTOR2D,XD);var wl=e=>e.type==="checkbox",vi=e=>e instanceof Date,on=e=>e==null;const AS=e=>typeof e=="object";var Mt=e=>!on(e)&&!Array.isArray(e)&&AS(e)&&!vi(e),kS=e=>Mt(e)&&e.target?wl(e.target)?e.target.checked:e.target.value:e,tL=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,jS=(e,t)=>e.has(tL(t)),nL=e=>{const t=e.constructor&&e.constructor.prototype;return Mt(t)&&t.hasOwnProperty("isPrototypeOf")},um=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Yt(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(um&&(e instanceof Blob||e instanceof FileList))&&(n||Mt(e)))if(t=n?[]:{},!n&&!nL(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=Yt(e[r]));else return e;return t}var xa=e=>Array.isArray(e)?e.filter(Boolean):[],dt=e=>e===void 0,he=(e,t,n)=>{if(!t||!Mt(e))return n;const r=xa(t.split(/[,[\].]+?/)).reduce((o,i)=>on(o)?o:o[i],e);return dt(r)||r===e?dt(e[t])?n:e[t]:r},Rn=e=>typeof e=="boolean";const Lc={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Nn={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Ar={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},IS=E.createContext(null),Sl=()=>E.useContext(IS),$l=e=>{const{children:t,...n}=e;return E.createElement(IS.Provider,{value:n},t)};var MS=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const i in e)Object.defineProperty(o,i,{get:()=>{const a=i;return t._proxyFormState[a]!==Nn.all&&(t._proxyFormState[a]=!r||Nn.all),n&&(n[a]=!0),e[a]}});return o},vn=e=>Mt(e)&&!Object.keys(e).length,RS=(e,t,n,r)=>{n(e);const{name:o,...i}=e;return vn(i)||Object.keys(i).length>=Object.keys(t).length||Object.keys(i).find(a=>t[a]===(!r||Nn.all))},$n=e=>Array.isArray(e)?e:[e],DS=(e,t,n)=>!e||!t||e===t||$n(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function hf(e){const t=E.useRef(e);t.current=e,E.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function rL(e){const t=Sl(),{control:n=t.control,disabled:r,name:o,exact:i}=e||{},[a,s]=E.useState(n._formState),l=E.useRef(!0),c=E.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=E.useRef(o);return u.current=o,hf({disabled:r,next:f=>l.current&&DS(u.current,f.name,i)&&RS(f,c.current,n._updateFormState)&&s({...n._formState,...f}),subject:n._subjects.state}),E.useEffect(()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),MS(a,n,c.current,!1)}var mr=e=>typeof e=="string",NS=(e,t,n,r,o)=>mr(e)?(r&&t.watch.add(e),he(n,e,o)):Array.isArray(e)?e.map(i=>(r&&t.watch.add(i),he(n,i))):(r&&(t.watchAll=!0),n);function oL(e){const t=Sl(),{control:n=t.control,name:r,defaultValue:o,disabled:i,exact:a}=e||{},s=E.useRef(r);s.current=r,hf({disabled:i,subject:n._subjects.values,next:u=>{DS(s.current,u.name,a)&&c(Yt(NS(s.current,n._names,u.values||n._formValues,!1,o)))}});const[l,c]=E.useState(n._getWatch(r,o));return E.useEffect(()=>n._removeUnmounted()),l}var fm=e=>/^\w*$/.test(e),LS=e=>xa(e.replace(/["|']|\]/g,"").split(/\.|\[/)),ct=(e,t,n)=>{let r=-1;const o=fm(t)?[t]:LS(t),i=o.length,a=i-1;for(;++r{const u=o._options.shouldUnregister||i,f=(d,p)=>{const h=he(o._fields,d);h&&(h._f.mount=p)};if(f(n,!0),u){const d=Yt(he(o._options.defaultValues,n));ct(o._defaultValues,n,d),dt(he(o._formValues,n))&&ct(o._formValues,n,d)}return()=>{(a?u&&!o._state.action:u)?o.unregister(n):f(n,!1)}},[n,o,a,i]),E.useEffect(()=>{he(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n,value:he(o._fields,n)._f.value})},[r,n,o]),{field:{name:n,value:s,...Rn(r)||Rn(l.disabled)?{disabled:l.disabled||r}:{},onChange:E.useCallback(u=>c.current.onChange({target:{value:kS(u),name:n},type:Lc.CHANGE}),[n]),onBlur:E.useCallback(()=>c.current.onBlur({target:{value:he(o._formValues,n),name:n},type:Lc.BLUR}),[n,o]),ref:u=>{const f=he(o._fields,n);f&&u&&(f._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:d=>u.setCustomValidity(d),reportValidity:()=>u.reportValidity()})}},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!he(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!he(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!he(l.touchedFields,n)},error:{enumerable:!0,get:()=>he(l.errors,n)}})}}const aL=e=>e.render(iL(e));var sL=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},ro=()=>{const e=typeof performance>"u"?Date.now():performance.now()*1e3;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(Math.random()*16+e)%16|0;return(t=="x"?n:n&3|8).toString(16)})},Ed=(e,t,n={})=>n.shouldFocus||dt(n.shouldFocus)?n.focusName||`${e}.${dt(n.focusIndex)?t:n.focusIndex}.`:"",rh=e=>({isOnSubmit:!e||e===Nn.onSubmit,isOnBlur:e===Nn.onBlur,isOnChange:e===Nn.onChange,isOnAll:e===Nn.all,isOnTouch:e===Nn.onTouched}),oh=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const Ci=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const i=he(e,o);if(i){const{_f:a,...s}=i;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],o)&&!r)break;if(a.ref&&t(a.ref,a.name)&&!r)break;Ci(s,t)}else Mt(s)&&Ci(s,t)}}};var BS=(e,t,n)=>{const r=xa(he(e,n));return ct(r,"root",t[n]),ct(e,n,r),e},dm=e=>e.type==="file",fo=e=>typeof e=="function",Bc=e=>{if(!um)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},hc=e=>mr(e),pm=e=>e.type==="radio",Fc=e=>e instanceof RegExp;const G0={value:!1,isValid:!1},K0={value:!0,isValid:!0};var FS=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!dt(e[0].attributes.value)?dt(e[0].value)||e[0].value===""?K0:{value:e[0].value,isValid:!0}:K0:G0}return G0};const q0={isValid:!1,value:null};var zS=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,q0):q0;function X0(e,t,n="validate"){if(hc(e)||Array.isArray(e)&&e.every(hc)||Rn(e)&&!e)return{type:n,message:hc(e)?e:"",ref:t}}var ui=e=>Mt(e)&&!Fc(e)?e:{value:e,message:""},ih=async(e,t,n,r,o)=>{const{ref:i,refs:a,required:s,maxLength:l,minLength:c,min:u,max:f,pattern:d,validate:p,name:h,valueAsNumber:g,mount:v,disabled:x}=e._f,w=he(t,h);if(!v||x)return{};const $=a?a[0]:i,C=A=>{r&&$.reportValidity&&($.setCustomValidity(Rn(A)?"":A||""),$.reportValidity())},S={},b=pm(i),O=wl(i),P=b||O,T=(g||dm(i))&&dt(i.value)&&dt(w)||Bc(i)&&i.value===""||w===""||Array.isArray(w)&&!w.length,k=sL.bind(null,h,n,S),_=(A,I,j,M=Ar.maxLength,D=Ar.minLength)=>{const L=A?I:j;S[h]={type:A?M:D,message:L,ref:i,...k(A?M:D,L)}};if(o?!Array.isArray(w)||!w.length:s&&(!P&&(T||on(w))||Rn(w)&&!w||O&&!FS(a).isValid||b&&!zS(a).isValid)){const{value:A,message:I}=hc(s)?{value:!!s,message:s}:ui(s);if(A&&(S[h]={type:Ar.required,message:I,ref:$,...k(Ar.required,I)},!n))return C(I),S}if(!T&&(!on(u)||!on(f))){let A,I;const j=ui(f),M=ui(u);if(!on(w)&&!isNaN(w)){const D=i.valueAsNumber||w&&+w;on(j.value)||(A=D>j.value),on(M.value)||(I=Dnew Date(new Date().toDateString()+" "+Z),B=i.type=="time",F=i.type=="week";mr(j.value)&&w&&(A=B?L(w)>L(j.value):F?w>j.value:D>new Date(j.value)),mr(M.value)&&w&&(I=B?L(w)+A.value,M=!on(I.value)&&w.length<+I.value;if((j||M)&&(_(j,A.message,I.message),!n))return C(S[h].message),S}if(d&&!T&&mr(w)){const{value:A,message:I}=ui(d);if(Fc(A)&&!w.match(A)&&(S[h]={type:Ar.pattern,message:I,ref:i,...k(Ar.pattern,I)},!n))return C(I),S}if(p){if(fo(p)){const A=await p(w,t),I=X0(A,$);if(I&&(S[h]={...I,...k(Ar.validate,I.message)},!n))return C(I.message),S}else if(Mt(p)){let A={};for(const I in p){if(!vn(A)&&!n)break;const j=X0(await p[I](w,t),$,I);j&&(A={...j,...k(I,j.message)},C(j.message),n&&(S[h]=A))}if(!vn(A)&&(S[h]={ref:$,...A},!n))return S}}return C(!0),S},Pd=(e,t)=>[...e,...$n(t)],_d=e=>Array.isArray(e)?e.map(()=>{}):void 0;function Td(e,t,n){return[...e.slice(0,t),...$n(n),...e.slice(t)]}var Ad=(e,t,n)=>Array.isArray(e)?(dt(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],kd=(e,t)=>[...$n(t),...$n(e)];function lL(e,t){let n=0;const r=[...e];for(const o of t)r.splice(o-n,1),n++;return xa(r).length?r:[]}var jd=(e,t)=>dt(t)?[]:lL(e,$n(t).sort((n,r)=>n-r)),Id=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function cL(e,t){const n=t.slice(0,-1).length;let r=0;for(;r(e[t]=n,e);function vue(e){const t=Sl(),{control:n=t.control,name:r,keyName:o="id",shouldUnregister:i}=e,[a,s]=E.useState(n._getFieldArray(r)),l=E.useRef(n._getFieldArray(r).map(ro)),c=E.useRef(a),u=E.useRef(r),f=E.useRef(!1);u.current=r,c.current=a,n._names.array.add(r),e.rules&&n.register(r,e.rules),hf({next:({values:S,name:b})=>{if(b===u.current||!b){const O=he(S,u.current);Array.isArray(O)&&(s(O),l.current=O.map(ro))}},subject:n._subjects.array});const d=E.useCallback(S=>{f.current=!0,n._updateFieldArray(r,S)},[n,r]),p=(S,b)=>{const O=$n(Yt(S)),P=Pd(n._getFieldArray(r),O);n._names.focus=Ed(r,P.length-1,b),l.current=Pd(l.current,O.map(ro)),d(P),s(P),n._updateFieldArray(r,P,Pd,{argA:_d(S)})},h=(S,b)=>{const O=$n(Yt(S)),P=kd(n._getFieldArray(r),O);n._names.focus=Ed(r,0,b),l.current=kd(l.current,O.map(ro)),d(P),s(P),n._updateFieldArray(r,P,kd,{argA:_d(S)})},g=S=>{const b=jd(n._getFieldArray(r),S);l.current=jd(l.current,S),d(b),s(b),n._updateFieldArray(r,b,jd,{argA:S})},v=(S,b,O)=>{const P=$n(Yt(b)),T=Td(n._getFieldArray(r),S,P);n._names.focus=Ed(r,S,O),l.current=Td(l.current,S,P.map(ro)),d(T),s(T),n._updateFieldArray(r,T,Td,{argA:S,argB:_d(b)})},x=(S,b)=>{const O=n._getFieldArray(r);Id(O,S,b),Id(l.current,S,b),d(O),s(O),n._updateFieldArray(r,O,Id,{argA:S,argB:b},!1)},w=(S,b)=>{const O=n._getFieldArray(r);Ad(O,S,b),Ad(l.current,S,b),d(O),s(O),n._updateFieldArray(r,O,Ad,{argA:S,argB:b},!1)},$=(S,b)=>{const O=Yt(b),P=Y0(n._getFieldArray(r),S,O);l.current=[...P].map((T,k)=>!T||k===S?ro():l.current[k]),d(P),s([...P]),n._updateFieldArray(r,P,Y0,{argA:S,argB:O},!0,!1)},C=S=>{const b=$n(Yt(S));l.current=b.map(ro),d([...b]),s([...b]),n._updateFieldArray(r,[...b],O=>O,{},!0,!1)};return E.useEffect(()=>{if(n._state.action=!1,oh(r,n._names)&&n._subjects.state.next({...n._formState}),f.current&&(!rh(n._options.mode).isOnSubmit||n._formState.isSubmitted))if(n._options.resolver)n._executeSchema([r]).then(S=>{const b=he(S.errors,r),O=he(n._formState.errors,r);(O?!b&&O.type||b&&(O.type!==b.type||O.message!==b.message):b&&b.type)&&(b?ct(n._formState.errors,r,b):Nt(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{const S=he(n._fields,r);S&&S._f&&ih(S,n._formValues,n._options.criteriaMode===Nn.all,n._options.shouldUseNativeValidation,!0).then(b=>!vn(b)&&n._subjects.state.next({errors:BS(n._formState.errors,b,r)}))}n._subjects.values.next({name:r,values:{...n._formValues}}),n._names.focus&&Ci(n._fields,(S,b)=>{if(n._names.focus&&b.startsWith(n._names.focus)&&S.focus)return S.focus(),1}),n._names.focus="",n._updateValid(),f.current=!1},[a,r,n]),E.useEffect(()=>(!he(n._formValues,r)&&n._updateFieldArray(r),()=>{(n._options.shouldUnregister||i)&&n.unregister(r)}),[r,n,o,i]),{swap:E.useCallback(x,[d,r,n]),move:E.useCallback(w,[d,r,n]),prepend:E.useCallback(h,[d,r,n]),append:E.useCallback(p,[d,r,n]),remove:E.useCallback(g,[d,r,n]),insert:E.useCallback(v,[d,r,n]),update:E.useCallback($,[d,r,n]),replace:E.useCallback(C,[d,r,n]),fields:E.useMemo(()=>a.map((S,b)=>({...S,[o]:l.current[b]||ro()})),[a,o])}}var Md=()=>{let e=[];return{get observers(){return e},next:o=>{for(const i of e)i.next&&i.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(i=>i!==o)}}),unsubscribe:()=>{e=[]}}},zc=e=>on(e)||!AS(e);function Lo(e,t){if(zc(e)||zc(t))return e===t;if(vi(e)&&vi(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=t[o];if(vi(i)&&vi(a)||Mt(i)&&Mt(a)||Array.isArray(i)&&Array.isArray(a)?!Lo(i,a):i!==a)return!1}}return!0}var WS=e=>e.type==="select-multiple",fL=e=>pm(e)||wl(e),Rd=e=>Bc(e)&&e.isConnected,VS=e=>{for(const t in e)if(fo(e[t]))return!0;return!1};function Wc(e,t={}){const n=Array.isArray(e);if(Mt(e)||n)for(const r in e)Array.isArray(e[r])||Mt(e[r])&&!VS(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Wc(e[r],t[r])):on(e[r])||(t[r]=!0);return t}function HS(e,t,n){const r=Array.isArray(e);if(Mt(e)||r)for(const o in e)Array.isArray(e[o])||Mt(e[o])&&!VS(e[o])?dt(t)||zc(n[o])?n[o]=Array.isArray(e[o])?Wc(e[o],[]):{...Wc(e[o])}:HS(e[o],on(t)?{}:t[o],n[o]):n[o]=!Lo(e[o],t[o]);return n}var Dd=(e,t)=>HS(e,t,Wc(t)),US=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>dt(e)?e:t?e===""?NaN:e&&+e:n&&mr(e)?new Date(e):r?r(e):e;function Nd(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return dm(t)?t.files:pm(t)?zS(e.refs).value:WS(t)?[...t.selectedOptions].map(({value:n})=>n):wl(t)?FS(e.refs).value:US(dt(t.value)?e.ref.value:t.value,e)}var dL=(e,t,n,r)=>{const o={};for(const i of e){const a=he(t,i);a&&ct(o,i,a._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Ma=e=>dt(e)?e:Fc(e)?e.source:Mt(e)?Fc(e.value)?e.value.source:e.value:e,pL=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Z0(e,t,n){const r=he(e,n);if(r||fm(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const i=o.join("."),a=he(t,i),s=he(e,i);if(a&&!Array.isArray(a)&&n!==i)return{name:n};if(s&&s.type)return{name:i,error:s};o.pop()}return{name:n}}var hL=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,gL=(e,t)=>!xa(he(e,t)).length&&Nt(e,t);const mL={mode:Nn.onSubmit,reValidateMode:Nn.onChange,shouldFocusError:!0};function vL(e={},t){let n={...mL,...e},r={submitCount:0,isDirty:!1,isLoading:fo(n.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},errors:n.errors||{},disabled:!1},o={},i=Mt(n.defaultValues)||Mt(n.values)?Yt(n.defaultValues||n.values)||{}:{},a=n.shouldUnregister?{}:Yt(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,unMount:new Set,array:new Set,watch:new Set},c,u=0;const f={isDirty:!1,dirtyFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:Md(),array:Md(),state:Md()},p=e.resetOptions&&e.resetOptions.keepDirtyValues,h=rh(n.mode),g=rh(n.reValidateMode),v=n.criteriaMode===Nn.all,x=N=>z=>{clearTimeout(u),u=setTimeout(N,z)},w=async N=>{if(f.isValid||N){const z=n.resolver?vn((await k()).errors):await A(o,!0);z!==r.isValid&&d.state.next({isValid:z})}},$=N=>f.isValidating&&d.state.next({isValidating:N}),C=(N,z=[],U,W,V=!0,q=!0)=>{if(W&&U){if(s.action=!0,q&&Array.isArray(he(o,N))){const ue=U(he(o,N),W.argA,W.argB);V&&ct(o,N,ue)}if(q&&Array.isArray(he(r.errors,N))){const ue=U(he(r.errors,N),W.argA,W.argB);V&&ct(r.errors,N,ue),gL(r.errors,N)}if(f.touchedFields&&q&&Array.isArray(he(r.touchedFields,N))){const ue=U(he(r.touchedFields,N),W.argA,W.argB);V&&ct(r.touchedFields,N,ue)}f.dirtyFields&&(r.dirtyFields=Dd(i,a)),d.state.next({name:N,isDirty:j(N,z),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ct(a,N,z)},S=(N,z)=>{ct(r.errors,N,z),d.state.next({errors:r.errors})},b=N=>{r.errors=N,d.state.next({errors:r.errors,isValid:!1})},O=(N,z,U,W)=>{const V=he(o,N);if(V){const q=he(a,N,dt(U)?he(i,N):U);dt(q)||W&&W.defaultChecked||z?ct(a,N,z?q:Nd(V._f)):L(N,q),s.mount&&w()}},P=(N,z,U,W,V)=>{let q=!1,ue=!1;const Ae={name:N},Se=!!(he(o,N)&&he(o,N)._f.disabled);if(!U||W){f.isDirty&&(ue=r.isDirty,r.isDirty=Ae.isDirty=j(),q=ue!==Ae.isDirty);const ne=Se||Lo(he(i,N),z);ue=!!(!Se&&he(r.dirtyFields,N)),ne||Se?Nt(r.dirtyFields,N):ct(r.dirtyFields,N,!0),Ae.dirtyFields=r.dirtyFields,q=q||f.dirtyFields&&ue!==!ne}if(U){const ne=he(r.touchedFields,N);ne||(ct(r.touchedFields,N,U),Ae.touchedFields=r.touchedFields,q=q||f.touchedFields&&ne!==U)}return q&&V&&d.state.next(Ae),q?Ae:{}},T=(N,z,U,W)=>{const V=he(r.errors,N),q=f.isValid&&Rn(z)&&r.isValid!==z;if(e.delayError&&U?(c=x(()=>S(N,U)),c(e.delayError)):(clearTimeout(u),c=null,U?ct(r.errors,N,U):Nt(r.errors,N)),(U?!Lo(V,U):V)||!vn(W)||q){const ue={...W,...q&&Rn(z)?{isValid:z}:{},errors:r.errors,name:N};r={...r,...ue},d.state.next(ue)}$(!1)},k=async N=>n.resolver(a,n.context,dL(N||l.mount,o,n.criteriaMode,n.shouldUseNativeValidation)),_=async N=>{const{errors:z}=await k(N);if(N)for(const U of N){const W=he(z,U);W?ct(r.errors,U,W):Nt(r.errors,U)}else r.errors=z;return z},A=async(N,z,U={valid:!0})=>{for(const W in N){const V=N[W];if(V){const{_f:q,...ue}=V;if(q){const Ae=l.array.has(q.name),Se=await ih(V,a,v,n.shouldUseNativeValidation&&!z,Ae);if(Se[q.name]&&(U.valid=!1,z))break;!z&&(he(Se,q.name)?Ae?BS(r.errors,Se,q.name):ct(r.errors,q.name,Se[q.name]):Nt(r.errors,q.name))}ue&&await A(ue,z,U)}}return U.valid},I=()=>{for(const N of l.unMount){const z=he(o,N);z&&(z._f.refs?z._f.refs.every(U=>!Rd(U)):!Rd(z._f.ref))&&we(N)}l.unMount=new Set},j=(N,z)=>(N&&z&&ct(a,N,z),!Lo(le(),i)),M=(N,z,U)=>NS(N,l,{...s.mount?a:dt(z)?i:mr(N)?{[N]:z}:z},U,z),D=N=>xa(he(s.mount?a:i,N,e.shouldUnregister?he(i,N,[]):[])),L=(N,z,U={})=>{const W=he(o,N);let V=z;if(W){const q=W._f;q&&(!q.disabled&&ct(a,N,US(z,q)),V=Bc(q.ref)&&on(z)?"":z,WS(q.ref)?[...q.ref.options].forEach(ue=>ue.selected=V.includes(ue.value)):q.refs?wl(q.ref)?q.refs.length>1?q.refs.forEach(ue=>(!ue.defaultChecked||!ue.disabled)&&(ue.checked=Array.isArray(V)?!!V.find(Ae=>Ae===ue.value):V===ue.value)):q.refs[0]&&(q.refs[0].checked=!!V):q.refs.forEach(ue=>ue.checked=ue.value===V):dm(q.ref)?q.ref.value="":(q.ref.value=V,q.ref.type||d.values.next({name:N,values:{...a}})))}(U.shouldDirty||U.shouldTouch)&&P(N,V,U.shouldTouch,U.shouldDirty,!0),U.shouldValidate&&te(N)},B=(N,z,U)=>{for(const W in z){const V=z[W],q=`${N}.${W}`,ue=he(o,q);(l.array.has(N)||!zc(V)||ue&&!ue._f)&&!vi(V)?B(q,V,U):L(q,V,U)}},F=(N,z,U={})=>{const W=he(o,N),V=l.array.has(N),q=Yt(z);ct(a,N,q),V?(d.array.next({name:N,values:{...a}}),(f.isDirty||f.dirtyFields)&&U.shouldDirty&&d.state.next({name:N,dirtyFields:Dd(i,a),isDirty:j(N,q)})):W&&!W._f&&!on(q)?B(N,q,U):L(N,q,U),oh(N,l)&&d.state.next({...r}),d.values.next({name:N,values:{...a}}),!s.mount&&t()},Z=async N=>{const z=N.target;let U=z.name,W=!0;const V=he(o,U),q=()=>z.type?Nd(V._f):kS(N),ue=Ae=>{W=Number.isNaN(Ae)||Ae===he(a,U,Ae)};if(V){let Ae,Se;const ne=q(),Ze=N.type===Lc.BLUR||N.type===Lc.FOCUS_OUT,St=!pL(V._f)&&!n.resolver&&!he(r.errors,U)&&!V._f.deps||hL(Ze,he(r.touchedFields,U),r.isSubmitted,g,h),$t=oh(U,l,Ze);ct(a,U,ne),Ze?(V._f.onBlur&&V._f.onBlur(N),c&&c(0)):V._f.onChange&&V._f.onChange(N);const Oe=P(U,ne,Ze,!1),Be=!vn(Oe)||$t;if(!Ze&&d.values.next({name:U,type:N.type,values:{...a}}),St)return f.isValid&&w(),Be&&d.state.next({name:U,...$t?{}:Oe});if(!Ze&&$t&&d.state.next({...r}),$(!0),n.resolver){const{errors:oe}=await k([U]);if(ue(ne),W){const $e=Z0(r.errors,o,U),Fe=Z0(oe,o,$e.name||U);Ae=Fe.error,U=Fe.name,Se=vn(oe)}}else Ae=(await ih(V,a,v,n.shouldUseNativeValidation))[U],ue(ne),W&&(Ae?Se=!1:f.isValid&&(Se=await A(o,!0)));W&&(V._f.deps&&te(V._f.deps),T(U,Se,Ae,Oe))}},ie=(N,z)=>{if(he(r.errors,z)&&N.focus)return N.focus(),1},te=async(N,z={})=>{let U,W;const V=$n(N);if($(!0),n.resolver){const q=await _(dt(N)?N:V);U=vn(q),W=N?!V.some(ue=>he(q,ue)):U}else N?(W=(await Promise.all(V.map(async q=>{const ue=he(o,q);return await A(ue&&ue._f?{[q]:ue}:ue)}))).every(Boolean),!(!W&&!r.isValid)&&w()):W=U=await A(o);return d.state.next({...!mr(N)||f.isValid&&U!==r.isValid?{}:{name:N},...n.resolver||!N?{isValid:U}:{},errors:r.errors,isValidating:!1}),z.shouldFocus&&!W&&Ci(o,ie,N?V:l.mount),W},le=N=>{const z={...i,...s.mount?a:{}};return dt(N)?z:mr(N)?he(z,N):N.map(U=>he(z,U))},re=(N,z)=>({invalid:!!he((z||r).errors,N),isDirty:!!he((z||r).dirtyFields,N),isTouched:!!he((z||r).touchedFields,N),error:he((z||r).errors,N)}),ae=N=>{N&&$n(N).forEach(z=>Nt(r.errors,z)),d.state.next({errors:N?r.errors:{}})},xe=(N,z,U)=>{const W=(he(o,N,{_f:{}})._f||{}).ref;ct(r.errors,N,{...z,ref:W}),d.state.next({name:N,errors:r.errors,isValid:!1}),U&&U.shouldFocus&&W&&W.focus&&W.focus()},Me=(N,z)=>fo(N)?d.values.subscribe({next:U=>N(M(void 0,z),U)}):M(N,z,!0),we=(N,z={})=>{for(const U of N?$n(N):l.mount)l.mount.delete(U),l.array.delete(U),z.keepValue||(Nt(o,U),Nt(a,U)),!z.keepError&&Nt(r.errors,U),!z.keepDirty&&Nt(r.dirtyFields,U),!z.keepTouched&&Nt(r.touchedFields,U),!n.shouldUnregister&&!z.keepDefaultValue&&Nt(i,U);d.values.next({values:{...a}}),d.state.next({...r,...z.keepDirty?{isDirty:j()}:{}}),!z.keepIsValid&&w()},Y=({disabled:N,name:z,field:U,fields:W,value:V})=>{if(Rn(N)){const q=N?void 0:dt(V)?Nd(U?U._f:he(W,z)._f):V;ct(a,z,q),P(z,q,!1,!1,!0)}},ve=(N,z={})=>{let U=he(o,N);const W=Rn(z.disabled);return ct(o,N,{...U||{},_f:{...U&&U._f?U._f:{ref:{name:N}},name:N,mount:!0,...z}}),l.mount.add(N),U?Y({field:U,disabled:z.disabled,name:N,value:z.value}):O(N,!0,z.value),{...W?{disabled:z.disabled}:{},...n.progressive?{required:!!z.required,min:Ma(z.min),max:Ma(z.max),minLength:Ma(z.minLength),maxLength:Ma(z.maxLength),pattern:Ma(z.pattern)}:{},name:N,onChange:Z,onBlur:Z,ref:V=>{if(V){ve(N,z),U=he(o,N);const q=dt(V.value)&&V.querySelectorAll&&V.querySelectorAll("input,select,textarea")[0]||V,ue=fL(q),Ae=U._f.refs||[];if(ue?Ae.find(Se=>Se===q):q===U._f.ref)return;ct(o,N,{_f:{...U._f,...ue?{refs:[...Ae.filter(Rd),q,...Array.isArray(he(i,N))?[{}]:[]],ref:{type:q.type,name:N}}:{ref:q}}}),O(N,!1,void 0,q)}else U=he(o,N,{}),U._f&&(U._f.mount=!1),(n.shouldUnregister||z.shouldUnregister)&&!(jS(l.array,N)&&s.action)&&l.unMount.add(N)}}},ce=()=>n.shouldFocusError&&Ci(o,ie,l.mount),G=N=>{Rn(N)&&(d.state.next({disabled:N}),Ci(o,(z,U)=>{let W=N;const V=he(o,U);V&&Rn(V._f.disabled)&&(W||(W=V._f.disabled)),z.disabled=W},0,!1))},fe=(N,z)=>async U=>{U&&(U.preventDefault&&U.preventDefault(),U.persist&&U.persist());let W=Yt(a);if(d.state.next({isSubmitting:!0}),n.resolver){const{errors:V,values:q}=await k();r.errors=V,W=q}else await A(o);Nt(r.errors,"root"),vn(r.errors)?(d.state.next({errors:{}}),await N(W,U)):(z&&await z({...r.errors},U),ce(),setTimeout(ce)),d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:vn(r.errors),submitCount:r.submitCount+1,errors:r.errors})},de=(N,z={})=>{he(o,N)&&(dt(z.defaultValue)?F(N,he(i,N)):(F(N,z.defaultValue),ct(i,N,z.defaultValue)),z.keepTouched||Nt(r.touchedFields,N),z.keepDirty||(Nt(r.dirtyFields,N),r.isDirty=z.defaultValue?j(N,he(i,N)):j()),z.keepError||(Nt(r.errors,N),f.isValid&&w()),d.state.next({...r}))},pe=(N,z={})=>{const U=N?Yt(N):i,W=Yt(U),V=N&&!vn(N)?W:i;if(z.keepDefaultValues||(i=U),!z.keepValues){if(z.keepDirtyValues||p)for(const q of l.mount)he(r.dirtyFields,q)?ct(V,q,he(a,q)):F(q,he(V,q));else{if(um&&dt(N))for(const q of l.mount){const ue=he(o,q);if(ue&&ue._f){const Ae=Array.isArray(ue._f.refs)?ue._f.refs[0]:ue._f.ref;if(Bc(Ae)){const Se=Ae.closest("form");if(Se){Se.reset();break}}}}o={}}a=e.shouldUnregister?z.keepDefaultValues?Yt(i):{}:Yt(V),d.array.next({values:{...V}}),d.values.next({values:{...V}})}l={mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},!s.mount&&t(),s.mount=!f.isValid||!!z.keepIsValid,s.watch=!!e.shouldUnregister,d.state.next({submitCount:z.keepSubmitCount?r.submitCount:0,isDirty:z.keepDirty?r.isDirty:!!(z.keepDefaultValues&&!Lo(N,i)),isSubmitted:z.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:z.keepDirtyValues?r.dirtyFields:z.keepDefaultValues&&N?Dd(i,N):{},touchedFields:z.keepTouched?r.touchedFields:{},errors:z.keepErrors?r.errors:{},isSubmitSuccessful:z.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1})},se=(N,z)=>pe(fo(N)?N(a):N,z);return{control:{register:ve,unregister:we,getFieldState:re,handleSubmit:fe,setError:xe,_executeSchema:k,_getWatch:M,_getDirty:j,_updateValid:w,_removeUnmounted:I,_updateFieldArray:C,_updateDisabledField:Y,_getFieldArray:D,_reset:pe,_resetDefaultValues:()=>fo(n.defaultValues)&&n.defaultValues().then(N=>{se(N,n.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:N=>{r={...r,...N}},_disableForm:G,_subjects:d,_proxyFormState:f,_setErrors:b,get _fields(){return o},get _formValues(){return a},get _state(){return s},set _state(N){s=N},get _defaultValues(){return i},get _names(){return l},set _names(N){l=N},get _formState(){return r},set _formState(N){r=N},get _options(){return n},set _options(N){n={...n,...N}}},trigger:te,register:ve,handleSubmit:fe,watch:Me,setValue:F,getValues:le,reset:se,resetField:de,clearErrors:ae,unregister:we,setError:xe,setFocus:(N,z={})=>{const U=he(o,N),W=U&&U._f;if(W){const V=W.refs?W.refs[0]:W.ref;V.focus&&(V.focus(),z.shouldSelect&&V.select())}},getFieldState:re}}function Cl(e={}){const t=E.useRef(),n=E.useRef(),[r,o]=E.useState({isDirty:!1,isValidating:!1,isLoading:fo(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},errors:e.errors||{},disabled:!1,defaultValues:fo(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...vL(e,()=>o(a=>({...a}))),formState:r});const i=t.current.control;return i._options=e,hf({subject:i._subjects.state,next:a=>{RS(a,i._proxyFormState,i._updateFormState,!0)&&o({...i._formState})}}),E.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),E.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==r.isDirty&&i._subjects.state.next({isDirty:a})}},[i,r.isDirty]),E.useEffect(()=>{e.values&&!Lo(e.values,n.current)?(i._reset(e.values,i._options.resetOptions),n.current=e.values,o(a=>({...a}))):i._resetDefaultValues()},[e.values,i]),E.useEffect(()=>{e.errors&&i._setErrors(e.errors)},[e.errors,i]),E.useEffect(()=>{i._state.mount||(i._updateValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),t.current.formState=MS(r,i),t.current}const yL=({children:e})=>{const[t,n]=Qo(o=>[o.fetchData,o.setAbortRequests]),[r]=sa(o=>[o.setBudget]);return y.useEffect(()=>{t(r,n)},[t,r,n]),m.jsx(m.Fragment,{children:e})},yue=()=>{const{simulation:e,simulationHelpers:t}=Vu(n=>n);return{nodes:(e==null?void 0:e.nodes())||[],links:t.getLinks()}},bL=xO` html { box-sizing: border-box; } @@ -252,7 +252,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho width: ${({size:e=45})=>e}px; height: ${({size:e=45})=>e}px; border-radius: ${({rounded:e})=>e?"50%":"2px"}; -`,Ra={isPlaying:!1,miniPlayerIsVisible:!1,hasError:!1,isSeeking:!1,playingTime:0,playingNode:null,duration:0,volume:.5},DL=xg()(SO((e,t)=>({...Ra,setIsSeeking:n=>e({isSeeking:n}),setIsPlaying:n=>e({isPlaying:n}),setMiniPlayerIsVisible:n=>{e(n?{miniPlayerIsVisible:n}:{miniPlayerIsVisible:n,isPlaying:!1})},setHasError:n=>e({hasError:n}),setPlayingTime:n=>e({playingTime:n}),setDuration:n=>e({duration:n}),setVolume:n=>e({volume:n}),setPlayingNodeLink:n=>{const{playingNode:r}=t();r&&e({playingNode:{...r,link:n}})},setPlayingNode:n=>{n||e({...Ra});const r=t().playingNode;(r==null?void 0:r.ref_id)!==(n==null?void 0:n.ref_id)&&e({...Ra,miniPlayerIsVisible:!0,playingNode:n})},resetPlayer:()=>e({duration:Ra.duration,hasError:Ra.hasError})}))),NL=()=>{const e=y.useRef(null),[t,n]=y.useState(0),r=q2(),o=X2(),[i,a]=Yr($=>[$.sidebarIsOpen,$.setSidebarOpen]),[s,l,c,u,f,d]=DL($=>[$.isPlaying,$.setIsPlaying,$.playingTime,$.playingNode,$.miniPlayerIsVisible,$.setMiniPlayerIsVisible]),[p,h]=u!=null&&u.timestamp?u.timestamp.split("-").map($=>oE($)):[0,0],g=(c-p)/(h-p)*100;y.useEffect(()=>{var S,b;const $=((S=e.current)==null?void 0:S.offsetWidth)||0,C=((b=e.current)==null?void 0:b.scrollWidth)||0;n(C-$)},[]);const v=$=>{d(!1),$.stopPropagation()},x=()=>{o(u),a(!0)},w=i&&(r==null?void 0:r.ref_id)!==(u==null?void 0:u.ref_id)||u&&!i;return f&&u&&w?m.jsxs(LL,{onClick:x,children:[m.jsxs(BL,{children:[m.jsx(GS,{src:u.image_url||"",type:u.node_type}),m.jsxs(FL,{children:[m.jsxs(UL,{ref:e,children:[m.jsx(HL,{className:"title",scrollValue:t,children:u.episode_title}),m.jsx("div",{className:"subtitle",children:u.show_title})]}),m.jsx(WL,{"data-testid":"play-pause-button",onClick:$=>{l(!s),$.stopPropagation()},size:"small",children:s?m.jsx(IL,{"data-testid":"pause-icon"}):m.jsx(ML,{"data-testid":"play-icon"})})]}),m.jsx(zL,{onClick:$=>v($),children:m.jsx(ei,{})})]}),m.jsx(VL,{value:g,variant:"determinate"})]}):null},LL=X(ee).attrs({direction:"column",align:"stretch",justify:"space-between"})` +`,Ra={isPlaying:!1,miniPlayerIsVisible:!1,hasError:!1,isSeeking:!1,playingTime:0,playingNode:null,duration:0,volume:.5},DL=Hu()(SO((e,t)=>({...Ra,setIsSeeking:n=>e({isSeeking:n}),setIsPlaying:n=>e({isPlaying:n}),setMiniPlayerIsVisible:n=>{e(n?{miniPlayerIsVisible:n}:{miniPlayerIsVisible:n,isPlaying:!1})},setHasError:n=>e({hasError:n}),setPlayingTime:n=>e({playingTime:n}),setDuration:n=>e({duration:n}),setVolume:n=>e({volume:n}),setPlayingNodeLink:n=>{const{playingNode:r}=t();r&&e({playingNode:{...r,link:n}})},setPlayingNode:n=>{n||e({...Ra});const r=t().playingNode;(r==null?void 0:r.ref_id)!==(n==null?void 0:n.ref_id)&&e({...Ra,miniPlayerIsVisible:!0,playingNode:n})},resetPlayer:()=>e({duration:Ra.duration,hasError:Ra.hasError})}))),NL=()=>{const e=y.useRef(null),[t,n]=y.useState(0),r=q2(),o=X2(),[i,a]=Yr($=>[$.sidebarIsOpen,$.setSidebarOpen]),[s,l,c,u,f,d]=DL($=>[$.isPlaying,$.setIsPlaying,$.playingTime,$.playingNode,$.miniPlayerIsVisible,$.setMiniPlayerIsVisible]),[p,h]=u!=null&&u.timestamp?u.timestamp.split("-").map($=>oE($)):[0,0],g=(c-p)/(h-p)*100;y.useEffect(()=>{var S,b;const $=((S=e.current)==null?void 0:S.offsetWidth)||0,C=((b=e.current)==null?void 0:b.scrollWidth)||0;n(C-$)},[]);const v=$=>{d(!1),$.stopPropagation()},x=()=>{o(u),a(!0)},w=i&&(r==null?void 0:r.ref_id)!==(u==null?void 0:u.ref_id)||u&&!i;return f&&u&&w?m.jsxs(LL,{onClick:x,children:[m.jsxs(BL,{children:[m.jsx(GS,{src:u.image_url||"",type:u.node_type}),m.jsxs(FL,{children:[m.jsxs(UL,{ref:e,children:[m.jsx(HL,{className:"title",scrollValue:t,children:u.episode_title}),m.jsx("div",{className:"subtitle",children:u.show_title})]}),m.jsx(WL,{"data-testid":"play-pause-button",onClick:$=>{l(!s),$.stopPropagation()},size:"small",children:s?m.jsx(IL,{"data-testid":"pause-icon"}):m.jsx(ML,{"data-testid":"play-icon"})})]}),m.jsx(zL,{onClick:$=>v($),children:m.jsx(ei,{})})]}),m.jsx(VL,{value:g,variant:"determinate"})]}):null},LL=X(ee).attrs({direction:"column",align:"stretch",justify:"space-between"})` padding: 8px; background: ${K.BG1}; border-radius: 6px; @@ -370,7 +370,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho 95% {transform: translateX(0rem) scale(1)}`),"propogate-4"),Io("PropagateLoader","25% {transform: translateX(".concat(qt[0],`rem) scale(0.75)} 50% {transform: translateX(`).concat(qt[1],`rem) scale(0.6)} 75% {transform: translateX(`).concat(qt[2],`rem) scale(0.5)} - 95% {transform: translateX(0rem) scale(1)}`),"propogate-5")];function sB(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,o=r===void 0?"#000000":r,i=e.speedMultiplier,a=i===void 0?1:i,s=e.cssOverride,l=s===void 0?{}:s,c=e.size,u=c===void 0?15:c,f=iB(e,["loading","color","speedMultiplier","cssOverride","size"]),d=qS(u),p=d.value,h=d.unit,g=Hc({display:"inherit",position:"relative"},l),v=function(x){return{position:"absolute",fontSize:"".concat(p/3).concat(h),width:"".concat(p).concat(h),height:"".concat(p).concat(h),background:o,borderRadius:"50%",animation:"".concat(aB[x]," ").concat(1.5/a,"s infinite"),animationFillMode:"forwards"}};return n?y.createElement("span",Hc({style:g},f),y.createElement("span",{style:v(0)}),y.createElement("span",{style:v(1)}),y.createElement("span",{style:v(2)}),y.createElement("span",{style:v(3)}),y.createElement("span",{style:v(4)}),y.createElement("span",{style:v(5)})):null}const vue=({fullSize:e=!0})=>{const t=Yr(n=>n.sidebarIsOpen);return m.jsx(lB,{align:"center",className:Ti({"sidebar-is-open":t&&!e}),justify:"center",children:m.jsx(Ut,{color:K.SECONDARY_BLUE,size:64})})},lB=X(ee)` + 95% {transform: translateX(0rem) scale(1)}`),"propogate-5")];function sB(e){var t=e.loading,n=t===void 0?!0:t,r=e.color,o=r===void 0?"#000000":r,i=e.speedMultiplier,a=i===void 0?1:i,s=e.cssOverride,l=s===void 0?{}:s,c=e.size,u=c===void 0?15:c,f=iB(e,["loading","color","speedMultiplier","cssOverride","size"]),d=qS(u),p=d.value,h=d.unit,g=Hc({display:"inherit",position:"relative"},l),v=function(x){return{position:"absolute",fontSize:"".concat(p/3).concat(h),width:"".concat(p).concat(h),height:"".concat(p).concat(h),background:o,borderRadius:"50%",animation:"".concat(aB[x]," ").concat(1.5/a,"s infinite"),animationFillMode:"forwards"}};return n?y.createElement("span",Hc({style:g},f),y.createElement("span",{style:v(0)}),y.createElement("span",{style:v(1)}),y.createElement("span",{style:v(2)}),y.createElement("span",{style:v(3)}),y.createElement("span",{style:v(4)}),y.createElement("span",{style:v(5)})):null}const bue=({fullSize:e=!0})=>{const t=Yr(n=>n.sidebarIsOpen);return m.jsx(lB,{align:"center",className:Ti({"sidebar-is-open":t&&!e}),justify:"center",children:m.jsx(Ut,{color:K.SECONDARY_BLUE,size:64})})},lB=X(ee)` position: absolute; left: 0; right: 0; @@ -378,7 +378,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho top: 0; background-color: ${K.black}; z-index: 1; -`,cB=()=>{const e=y.useContext(CO);return e==null?void 0:e.socket},uB={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,hasInstagraphInProgress:!1,teachMeAnswer:null,instgraphAnswser:null},fB=xg(e=>({...uB,setAskedQuestion:t=>e(n=>({askedQuestions:[...n.askedQuestions||[],t],hasQuestionInProgress:!0})),setAskedQuestionAnswer:t=>e(n=>({askedQuestionsAnswers:[...n.askedQuestionsAnswers||[],t],hasQuestionInProgress:!1})),setHasQuestionInProgress:t=>e({hasQuestionInProgress:t}),setHasTeachingInProgress:t=>e({hasTeachingInProgress:t}),setHasInstagraphInProgress:t=>e({hasInstagraphInProgress:t}),setTeachMeAnswer:t=>e({hasTeachingInProgress:!1,teachMeAnswer:t}),setInstagraphAnswer:t=>{var n,r,o,i;(n=t==null?void 0:t.instagraph)!=null&&n.edges&&((r=t==null?void 0:t.instagraph)!=null&&r.nodes)&&e({hasInstagraphInProgress:!1,instgraphAnswser:{edges:(o=t==null?void 0:t.instagraph)==null?void 0:o.edges,nodes:(i=t==null?void 0:t.instagraph)==null?void 0:i.nodes}})}})),dB="0.1.106",pB=y.lazy(()=>hn(()=>import("./index-e97f9fe0.js"),["assets/index-e97f9fe0.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]).then(({SettingsModal:e})=>({default:e}))),hB=y.lazy(()=>hn(()=>import("./index-1d3b431c.js"),["assets/index-1d3b431c.js","assets/index-0cb90706.js","assets/index-a2878e02.css","assets/index-7623b989.js"]).then(({AddContentModal:e})=>({default:e}))),gB=y.lazy(()=>hn(()=>import("./index-91c634b7.js"),["assets/index-91c634b7.js","assets/index-0cb90706.js","assets/index-a2878e02.css","assets/index-7623b989.js","assets/index-bbc7c996.js","assets/three.module-a2e04964.js","assets/index-64f1c910.js"]).then(({AddItemModal:e})=>({default:e}))),mB=y.lazy(()=>hn(()=>import("./index-49d7d2a6.js"),["assets/index-49d7d2a6.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]).then(({SourcesTableModal:e})=>({default:e}))),vB=y.lazy(()=>hn(()=>import("./index-185364ef.js"),["assets/index-185364ef.js","assets/index-0cb90706.js","assets/index-a2878e02.css","assets/Skeleton-b299e336.js"]).then(({EditNodeNameModal:e})=>({default:e}))),yB=y.lazy(()=>hn(()=>import("./index-aeca93f0.js"),["assets/index-aeca93f0.js","assets/index-0cb90706.js","assets/index-a2878e02.css","assets/Skeleton-b299e336.js"]).then(({RemoveNodeModal:e})=>({default:e}))),bB=y.lazy(()=>hn(()=>import("./index-e28518b6.js"),["assets/index-e28518b6.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]).then(({AddNodeEdgeModal:e})=>({default:e}))),xB=y.lazy(()=>hn(()=>import("./index-7c6a1cbf.js"),["assets/index-7c6a1cbf.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]).then(({MergeNodeModal:e})=>({default:e}))),wB=y.lazy(()=>hn(()=>import("./index-2a64d990.js"),["assets/index-2a64d990.js","assets/index-0cb90706.js","assets/index-a2878e02.css","assets/index-bbc7c996.js","assets/three.module-a2e04964.js","assets/index-64f1c910.js"]).then(({ChangeNodeTypeModal:e})=>({default:e}))),SB=y.lazy(()=>hn(()=>import("./index-63f7725b.js"),["assets/index-63f7725b.js","assets/index-0cb90706.js","assets/index-a2878e02.css","assets/index-bbc7c996.js","assets/three.module-a2e04964.js","assets/index-fc41172c.js","assets/AddContentIcon-d2758ba1.js"]).then(({BlueprintModal:e})=>({default:e}))),$B=y.lazy(()=>hn(()=>import("./index-0021498a.js"),["assets/index-0021498a.js","assets/index-0cb90706.js","assets/index-a2878e02.css","assets/index-7623b989.js"]).then(({UserFeedBackModal:e})=>({default:e}))),CB=()=>m.jsxs(m.Fragment,{children:[m.jsx(gB,{}),m.jsx(hB,{}),m.jsx(pB,{}),m.jsx(vB,{}),m.jsx(yB,{}),m.jsx(mB,{}),m.jsx(bB,{}),m.jsx(wB,{}),m.jsx(SB,{}),m.jsx(xB,{}),m.jsx($B,{})]}),OB=()=>{const e=Yr(t=>t.appMetaData);return e?m.jsxs(EB,{children:[m.jsxs(PB,{children:[m.jsx(m.Fragment,{children:e.title&&m.jsx(ze,{className:"title",color:"white",children:e.title})}),m.jsx(ze,{className:"subtitle",children:"Second Brain"})]}),m.jsx(EO,{})]}):null},EB=X(ee).attrs({align:"center",direction:"row",grow:1,justify:"flex-start"})` +`,cB=()=>{const e=y.useContext(CO);return e==null?void 0:e.socket},uB={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,hasInstagraphInProgress:!1,teachMeAnswer:null,instgraphAnswser:null},fB=Hu(e=>({...uB,setAskedQuestion:t=>e(n=>({askedQuestions:[...n.askedQuestions||[],t],hasQuestionInProgress:!0})),setAskedQuestionAnswer:t=>e(n=>({askedQuestionsAnswers:[...n.askedQuestionsAnswers||[],t],hasQuestionInProgress:!1})),setHasQuestionInProgress:t=>e({hasQuestionInProgress:t}),setHasTeachingInProgress:t=>e({hasTeachingInProgress:t}),setHasInstagraphInProgress:t=>e({hasInstagraphInProgress:t}),setTeachMeAnswer:t=>e({hasTeachingInProgress:!1,teachMeAnswer:t}),setInstagraphAnswer:t=>{var n,r,o,i;(n=t==null?void 0:t.instagraph)!=null&&n.edges&&((r=t==null?void 0:t.instagraph)!=null&&r.nodes)&&e({hasInstagraphInProgress:!1,instgraphAnswser:{edges:(o=t==null?void 0:t.instagraph)==null?void 0:o.edges,nodes:(i=t==null?void 0:t.instagraph)==null?void 0:i.nodes}})}})),dB="0.1.106",pB=y.lazy(()=>hn(()=>import("./index-7347cedb.js"),["assets/index-7347cedb.js","assets/index-ead79979.js","assets/index-a2878e02.css"]).then(({SettingsModal:e})=>({default:e}))),hB=y.lazy(()=>hn(()=>import("./index-b3368bcf.js"),["assets/index-b3368bcf.js","assets/index-ead79979.js","assets/index-a2878e02.css","assets/index-560f985a.js"]).then(({AddContentModal:e})=>({default:e}))),gB=y.lazy(()=>hn(()=>import("./index-525470a0.js"),["assets/index-525470a0.js","assets/index-ead79979.js","assets/index-a2878e02.css","assets/index-560f985a.js","assets/index-bbc7c996.js","assets/three.module-a2e04964.js","assets/index-64f1c910.js"]).then(({AddItemModal:e})=>({default:e}))),mB=y.lazy(()=>hn(()=>import("./index-3778665f.js"),["assets/index-3778665f.js","assets/index-ead79979.js","assets/index-a2878e02.css"]).then(({SourcesTableModal:e})=>({default:e}))),vB=y.lazy(()=>hn(()=>import("./index-501382cf.js"),["assets/index-501382cf.js","assets/index-ead79979.js","assets/index-a2878e02.css","assets/Skeleton-63ee525b.js"]).then(({EditNodeNameModal:e})=>({default:e}))),yB=y.lazy(()=>hn(()=>import("./index-07fdb50a.js"),["assets/index-07fdb50a.js","assets/index-ead79979.js","assets/index-a2878e02.css","assets/Skeleton-63ee525b.js"]).then(({RemoveNodeModal:e})=>({default:e}))),bB=y.lazy(()=>hn(()=>import("./index-ff0f2b2f.js"),["assets/index-ff0f2b2f.js","assets/index-ead79979.js","assets/index-a2878e02.css"]).then(({AddNodeEdgeModal:e})=>({default:e}))),xB=y.lazy(()=>hn(()=>import("./index-0c8a47fb.js"),["assets/index-0c8a47fb.js","assets/index-ead79979.js","assets/index-a2878e02.css"]).then(({MergeNodeModal:e})=>({default:e}))),wB=y.lazy(()=>hn(()=>import("./index-c77aff98.js"),["assets/index-c77aff98.js","assets/index-ead79979.js","assets/index-a2878e02.css","assets/index-bbc7c996.js","assets/three.module-a2e04964.js","assets/index-64f1c910.js"]).then(({ChangeNodeTypeModal:e})=>({default:e}))),SB=y.lazy(()=>hn(()=>import("./index-81df59d9.js"),["assets/index-81df59d9.js","assets/index-ead79979.js","assets/index-a2878e02.css","assets/index-bbc7c996.js","assets/three.module-a2e04964.js","assets/index-8d2e6a42.js","assets/AddContentIcon-8ff66903.js"]).then(({BlueprintModal:e})=>({default:e}))),$B=y.lazy(()=>hn(()=>import("./index-f091e27d.js"),["assets/index-f091e27d.js","assets/index-ead79979.js","assets/index-a2878e02.css","assets/index-560f985a.js"]).then(({UserFeedBackModal:e})=>({default:e}))),CB=()=>m.jsxs(m.Fragment,{children:[m.jsx(gB,{}),m.jsx(hB,{}),m.jsx(pB,{}),m.jsx(vB,{}),m.jsx(yB,{}),m.jsx(mB,{}),m.jsx(bB,{}),m.jsx(wB,{}),m.jsx(SB,{}),m.jsx(xB,{}),m.jsx($B,{})]}),OB=()=>{const e=Yr(t=>t.appMetaData);return e?m.jsxs(EB,{children:[m.jsxs(PB,{children:[m.jsx(m.Fragment,{children:e.title&&m.jsx(ze,{className:"title",color:"white",children:e.title})}),m.jsx(ze,{className:"subtitle",children:"Second Brain"})]}),m.jsx(EO,{})]}):null},EB=X(ee).attrs({align:"center",direction:"row",grow:1,justify:"flex-start"})` height: 64px; position: absolute; top: 0px; @@ -413,7 +413,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho line-height: 16px; letter-spacing: 0.22px; } -`,_B=620,TB=()=>{const e=`(max-width: ${_B}px)`,[t,n]=y.useState(()=>window.matchMedia(e).matches);return y.useEffect(()=>{const r=window.matchMedia(e);n(r.matches);const o=()=>{n(r.matches)};return window.addEventListener("resize",o),()=>r.removeEventListener("change",o)},[e]),t},AB=()=>{const[e,t]=y.useState(!0),n=TB();y.useEffect(()=>{t(!0)},[n]);const r=()=>{t(!1)};return n&&e?m.jsxs(kB,{align:"center",direction:"column",justify:"center",onClick:r,children:[m.jsx("img",{alt:"screen",src:"jamboard_kiosk.png"}),m.jsxs(ee,{align:"center",direction:"column",justify:"center",children:[m.jsx(Nd,{children:"Second Brain is currently"}),m.jsx(Nd,{style:{fontWeight:600},children:"optimized for Desktop."}),m.jsx(Nd,{children:"Mobile support coming soon."})]}),m.jsx(_r,{color:"secondary",onClick:r,variant:"contained",children:"Got It"})]}):null},kB=X(ee)` +`,_B=620,TB=()=>{const e=`(max-width: ${_B}px)`,[t,n]=y.useState(()=>window.matchMedia(e).matches);return y.useEffect(()=>{const r=window.matchMedia(e);n(r.matches);const o=()=>{n(r.matches)};return window.addEventListener("resize",o),()=>r.removeEventListener("change",o)},[e]),t},AB=()=>{const[e,t]=y.useState(!0),n=TB();y.useEffect(()=>{t(!0)},[n]);const r=()=>{t(!1)};return n&&e?m.jsxs(kB,{align:"center",direction:"column",justify:"center",onClick:r,children:[m.jsx("img",{alt:"screen",src:"jamboard_kiosk.png"}),m.jsxs(ee,{align:"center",direction:"column",justify:"center",children:[m.jsx(Ld,{children:"Second Brain is currently"}),m.jsx(Ld,{style:{fontWeight:600},children:"optimized for Desktop."}),m.jsx(Ld,{children:"Mobile support coming soon."})]}),m.jsx(_r,{color:"secondary",onClick:r,variant:"contained",children:"Got It"})]}):null},kB=X(ee)` height: 100vh; width: 100vw; background: rgba(0, 0, 0, 0.75); @@ -423,7 +423,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho top: 0; left: 0; right: 0; -`,Nd=X(ze)` +`,Ld=X(ze)` color: #fff; text-align: center; font-family: Barlow; @@ -432,7 +432,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho font-weight: 400; line-height: 24px; margin: 1px; -`,jB={},IB=y.createContext(jB),MB=()=>{const[e,t]=y.useState(!1),n=y.useMemo(()=>({isShow:e,setIsShow:t}),[e]);return m.jsx(IB.Provider,{value:n})};var XS={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},J0=E.createContext&&E.createContext(XS),go=globalThis&&globalThis.__assign||function(){return go=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const[e,t]=y.useState(!1),n=y.useMemo(()=>({isShow:e,setIsShow:t}),[e]);return m.jsx(IB.Provider,{value:n})};var XS={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},J0=E.createContext&&E.createContext(XS),go=globalThis&&globalThis.__assign||function(){return go=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{var t,n,r,o,i,a,s,l,c;return m.jsxs(hf,{children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:(t=e==null?void 0:e.properties)!=null&&t.date_added_to_graph?Ip((n=e==null?void 0:e.properties)==null?void 0:n.date_added_to_graph):Ip((r=e==null?void 0:e.properties)==null?void 0:r.date)}),m.jsx(Re,{children:e==null?void 0:e.node_type}),m.jsx(Re,{children:(e==null?void 0:e.node_type)==="Tweet"?m.jsx(ty,{href:`${ey}${(o=e==null?void 0:e.properties)==null?void 0:o.tweet_id}${ey.includes("?")?"&":"?"}open=system`,target:"_blank",children:(i=e==null?void 0:e.properties)==null?void 0:i.tweet_id}):m.jsx(ty,{href:`${(a=e==null?void 0:e.properties)==null?void 0:a.source_link}${((s=e==null?void 0:e.properties)==null?void 0:s.source_link).includes("?")?"&":"?"}open=system`,target:"_blank",children:(l=e==null?void 0:e.properties)==null?void 0:l.source_link})}),m.jsx(Re,{children:(c=e==null?void 0:e.properties)!=null&&c.status?UB(e.properties.status):"Processing"})]})},ty=X.a` +`;function UB(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}const GB=({node:e})=>{var t,n,r,o,i,a,s,l,c;return m.jsxs(gf,{children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:(t=e==null?void 0:e.properties)!=null&&t.date_added_to_graph?Mp((n=e==null?void 0:e.properties)==null?void 0:n.date_added_to_graph):Mp((r=e==null?void 0:e.properties)==null?void 0:r.date)}),m.jsx(Re,{children:e==null?void 0:e.node_type}),m.jsx(Re,{children:(e==null?void 0:e.node_type)==="Tweet"?m.jsx(ty,{href:`${ey}${(o=e==null?void 0:e.properties)==null?void 0:o.tweet_id}${ey.includes("?")?"&":"?"}open=system`,target:"_blank",children:(i=e==null?void 0:e.properties)==null?void 0:i.tweet_id}):m.jsx(ty,{href:`${(a=e==null?void 0:e.properties)==null?void 0:a.source_link}${((s=e==null?void 0:e.properties)==null?void 0:s.source_link).includes("?")?"&":"?"}open=system`,target:"_blank",children:(l=e==null?void 0:e.properties)==null?void 0:l.source_link})}),m.jsx(Re,{children:(c=e==null?void 0:e.properties)!=null&&c.status?UB(e.properties.status):"Processing"})]})},ty=X.a` color: ${K.white}; text-decoration: underline; &:visited { color: ${K.white}; } -`,KB=y.memo(GB),qB=e=>m.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 21 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("mask",{id:"mask0_3553_6463",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"21",height:"20",children:m.jsx("rect",{x:"0.5",width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{children:m.jsx("path",{d:"M9.87516 10.625H5.7085C5.53141 10.625 5.38298 10.5651 5.26318 10.4453C5.14339 10.3254 5.0835 10.1769 5.0835 9.99975C5.0835 9.82258 5.14339 9.67417 5.26318 9.55452C5.38298 9.43487 5.53141 9.37504 5.7085 9.37504H9.87516V5.20837C9.87516 5.03129 9.93508 4.88285 10.0549 4.76306C10.1748 4.64327 10.3233 4.58337 10.5004 4.58337C10.6776 4.58337 10.826 4.64327 10.9456 4.76306C11.0653 4.88285 11.1251 5.03129 11.1251 5.20837V9.37504H15.2918C15.4689 9.37504 15.6173 9.43496 15.7371 9.55479C15.8569 9.67464 15.9168 9.82314 15.9168 10.0003C15.9168 10.1775 15.8569 10.3259 15.7371 10.4455C15.6173 10.5652 15.4689 10.625 15.2918 10.625H11.1251V14.7917C11.1251 14.9688 11.0652 15.1172 10.9454 15.237C10.8255 15.3568 10.677 15.4167 10.4999 15.4167C10.3227 15.4167 10.1743 15.3568 10.0546 15.237C9.93499 15.1172 9.87516 14.9688 9.87516 14.7917V10.625Z",fill:"currentColor"})})]}),XB=({nodes:e})=>{const{open:t}=Nr("addContent"),n=async()=>{t()};return!e||(e==null?void 0:e.length)===0?m.jsx(m.Fragment,{children:m.jsxs(YB,{children:[m.jsx(ZB,{align:"center",direction:"row",justify:"space-between",children:m.jsx(ze,{className:"subtitle",children:"Contribute to the graph by adding content."})}),m.jsx(ee,{children:m.jsx(_r,{color:"secondary",onClick:n,size:"medium",startIcon:m.jsx(qB,{}),type:"submit",variant:"contained",children:"Add Content"})})]})}):m.jsxs(af,{component:"table",children:[m.jsx(gf,{children:m.jsxs(Ni,{component:"tr",children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:"Date"}),m.jsx(Re,{children:"Type"}),m.jsx(Re,{children:"Source"}),m.jsx(Re,{children:"Status"})]})}),m.jsx("tbody",{children:e==null?void 0:e.map(r=>m.jsx(KB,{node:r},r==null?void 0:r.ref_id))})]})},YB=be(ee)` +`,KB=y.memo(GB),qB=e=>m.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 21 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("mask",{id:"mask0_3553_6463",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"21",height:"20",children:m.jsx("rect",{x:"0.5",width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{children:m.jsx("path",{d:"M9.87516 10.625H5.7085C5.53141 10.625 5.38298 10.5651 5.26318 10.4453C5.14339 10.3254 5.0835 10.1769 5.0835 9.99975C5.0835 9.82258 5.14339 9.67417 5.26318 9.55452C5.38298 9.43487 5.53141 9.37504 5.7085 9.37504H9.87516V5.20837C9.87516 5.03129 9.93508 4.88285 10.0549 4.76306C10.1748 4.64327 10.3233 4.58337 10.5004 4.58337C10.6776 4.58337 10.826 4.64327 10.9456 4.76306C11.0653 4.88285 11.1251 5.03129 11.1251 5.20837V9.37504H15.2918C15.4689 9.37504 15.6173 9.43496 15.7371 9.55479C15.8569 9.67464 15.9168 9.82314 15.9168 10.0003C15.9168 10.1775 15.8569 10.3259 15.7371 10.4455C15.6173 10.5652 15.4689 10.625 15.2918 10.625H11.1251V14.7917C11.1251 14.9688 11.0652 15.1172 10.9454 15.237C10.8255 15.3568 10.677 15.4167 10.4999 15.4167C10.3227 15.4167 10.1743 15.3568 10.0546 15.237C9.93499 15.1172 9.87516 14.9688 9.87516 14.7917V10.625Z",fill:"currentColor"})})]}),XB=({nodes:e})=>{const{open:t}=Nr("addContent"),n=async()=>{t()};return!e||(e==null?void 0:e.length)===0?m.jsx(m.Fragment,{children:m.jsxs(YB,{children:[m.jsx(ZB,{align:"center",direction:"row",justify:"space-between",children:m.jsx(ze,{className:"subtitle",children:"Contribute to the graph by adding content."})}),m.jsx(ee,{children:m.jsx(_r,{color:"secondary",onClick:n,size:"medium",startIcon:m.jsx(qB,{}),type:"submit",variant:"contained",children:"Add Content"})})]})}):m.jsxs(sf,{component:"table",children:[m.jsx(mf,{children:m.jsxs(Ni,{component:"tr",children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:"Date"}),m.jsx(Re,{children:"Type"}),m.jsx(Re,{children:"Source"}),m.jsx(Re,{children:"Status"})]})}),m.jsx("tbody",{children:e==null?void 0:e.map(r=>m.jsx(KB,{node:r},r==null?void 0:r.ref_id))})]})},YB=be(ee)` display: flex; align-items: center; justify-content: center; @@ -565,7 +565,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho font-weight: 400; line-height: normal; } -`,QB=()=>{const[e,t]=y.useState([]),[n,r]=y.useState(!0),[o,i]=y.useState(10),[a,s]=y.useState(!0),l={only_content:"true",sort_by:"date",limit:o.toString()},c=async()=>{r(!0);try{const f=await PO(l);t(f.nodes),r(!1)}catch(f){console.error("Error fetching data:",f),r(!1)}};y.useEffect(()=>{c()},[o]);const u=()=>{i(o+10),c()};return m.jsxs(JB,{direction:"column",justify:"flex-end",children:[m.jsx(mf,{align:"center",direction:"row",justify:"space-between",children:m.jsx(ze,{className:"title",children:"Content I've added to the graph"})}),m.jsxs(eF,{align:"center",justify:n?"center":"flex-start",children:[n?m.jsx(Ut,{color:K.white}):m.jsx(m.Fragment,{children:m.jsx(XB,{nodes:e})}),!n&&e.length>0&&(a?m.jsx(_r,{onClick:u,size:"medium",children:"Load More"}):m.jsx(tF,{children:"No new nodes available"}))]})]})},JB=X(ee)` +`,QB=()=>{const[e,t]=y.useState([]),[n,r]=y.useState(!0),[o,i]=y.useState(10),[a,s]=y.useState(!0),l={only_content:"true",sort_by:"date",limit:o.toString()},c=async()=>{r(!0);try{const f=await PO(l);t(f.nodes),r(!1)}catch(f){console.error("Error fetching data:",f),r(!1)}};y.useEffect(()=>{c()},[o]);const u=()=>{i(o+10),c()};return m.jsxs(JB,{direction:"column",justify:"flex-end",children:[m.jsx(vf,{align:"center",direction:"row",justify:"space-between",children:m.jsx(ze,{className:"title",children:"Content I've added to the graph"})}),m.jsxs(eF,{align:"center",justify:n?"center":"flex-start",children:[n?m.jsx(Ut,{color:K.white}):m.jsx(m.Fragment,{children:m.jsx(XB,{nodes:e})}),!n&&e.length>0&&(a?m.jsx(_r,{onClick:u,size:"medium",children:"Load More"}):m.jsx(tF,{children:"No new nodes available"}))]})]})},JB=X(ee)` flex: 1; .title { @@ -647,7 +647,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho font-size: 16px; font-weight: 500; } -`,aF=X(of)` +`,aF=X(af)` && { z-index: 9999; } @@ -657,7 +657,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho gap: 12px; align-items: center; margin-top: 16px; -`,ih=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsxs("g",{id:"filter_alt_off",children:[m.jsx("mask",{id:"mask0_1543_23288",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:m.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{mask:"url(#mask0_1543_23288)",children:m.jsx("path",{id:"filter_alt_off_2",d:"M14.8 11.9748L6.82503 3.9998H19C19.4167 3.9998 19.7167 4.18314 19.9 4.5498C20.0834 4.91647 20.05 5.26647 19.8 5.5998L14.8 11.9748ZM19.775 22.5998L14 16.8248V18.9998C14 19.2831 13.9042 19.5206 13.7125 19.7123C13.5209 19.904 13.2834 19.9998 13 19.9998H11C10.7167 19.9998 10.4792 19.904 10.2875 19.7123C10.0959 19.5206 10 19.2831 10 18.9998V12.8248L1.40002 4.2248L2.80002 2.7998L21.2 21.1998L19.775 22.5998Z",fill:"currentColor"})})]})}),lF=({data:e})=>{const t=Qo(a=>a.setQueuedSources),[n,r]=y.useState(""),o=async a=>{if(e!=null&&e.length)try{const s=await _O.enable();await TO(a,s.pubkey),t(e.filter(l=>l.ref_id!==a))}catch(s){console.warn(s)}},i=async a=>{if(!(!a||!(e!=null&&e.length))){r(a);try{await Y2(a),t(e==null?void 0:e.filter(s=>s.ref_id!==a))}catch(s){console.warn(s)}finally{r("")}}};return e!=null&&e.length?m.jsxs(af,{component:"table",children:[m.jsx(gf,{children:m.jsxs(Ni,{component:"tr",children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:"Type"}),m.jsx(Re,{children:"Source"}),m.jsx(Re,{}),m.jsx(Re,{className:"empty"})]})}),(e==null?void 0:e.length)&&m.jsx("tbody",{children:e==null?void 0:e.map(a=>m.jsxs(hf,{children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:Fi[a.source_type]}),m.jsx(Re,{width:"268px",children:a.source_type==="twitter_handle"?m.jsxs(ry,{href:`${n$}/${a.source}?open=system`,target:"_blank",children:["@",a.source]}):m.jsx(ry,{href:`${a.source}?open=system`,target:"_blank",children:a.source})}),m.jsx(Re,{className:"cell-center",children:m.jsxs(ee,{direction:"row",justify:"space-between",children:[m.jsx("div",{className:"approve-wrapper",children:m.jsx(ny,{className:"centered",onClick:()=>o(a.ref_id),children:m.jsx(NB,{color:K.primaryGreen,fontSize:24})})}),m.jsx("div",{className:"delete-wrapper",children:n===a.ref_id?m.jsx(Ut,{color:K.white,size:16}):m.jsx(o$,{message:"Are you sure ?",onConfirm:()=>i(a.ref_id),children:m.jsx(ny,{className:"centered",children:m.jsx(BB,{color:K.primaryRed,fontSize:24})})})})]})}),m.jsx(Re,{className:"empty"})]},a.source))})]}):m.jsxs(ee,{children:[m.jsx(ze,{children:"There is not any results for selected filters"}),m.jsx(ih,{})]})},ny=X(ee)` +`,ah=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsxs("g",{id:"filter_alt_off",children:[m.jsx("mask",{id:"mask0_1543_23288",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:m.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{mask:"url(#mask0_1543_23288)",children:m.jsx("path",{id:"filter_alt_off_2",d:"M14.8 11.9748L6.82503 3.9998H19C19.4167 3.9998 19.7167 4.18314 19.9 4.5498C20.0834 4.91647 20.05 5.26647 19.8 5.5998L14.8 11.9748ZM19.775 22.5998L14 16.8248V18.9998C14 19.2831 13.9042 19.5206 13.7125 19.7123C13.5209 19.904 13.2834 19.9998 13 19.9998H11C10.7167 19.9998 10.4792 19.904 10.2875 19.7123C10.0959 19.5206 10 19.2831 10 18.9998V12.8248L1.40002 4.2248L2.80002 2.7998L21.2 21.1998L19.775 22.5998Z",fill:"currentColor"})})]})}),lF=({data:e})=>{const t=Qo(a=>a.setQueuedSources),[n,r]=y.useState(""),o=async a=>{if(e!=null&&e.length)try{const s=await _O.enable();await TO(a,s.pubkey),t(e.filter(l=>l.ref_id!==a))}catch(s){console.warn(s)}},i=async a=>{if(!(!a||!(e!=null&&e.length))){r(a);try{await Y2(a),t(e==null?void 0:e.filter(s=>s.ref_id!==a))}catch(s){console.warn(s)}finally{r("")}}};return e!=null&&e.length?m.jsxs(sf,{component:"table",children:[m.jsx(mf,{children:m.jsxs(Ni,{component:"tr",children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:"Type"}),m.jsx(Re,{children:"Source"}),m.jsx(Re,{}),m.jsx(Re,{className:"empty"})]})}),(e==null?void 0:e.length)&&m.jsx("tbody",{children:e==null?void 0:e.map(a=>m.jsxs(gf,{children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:Fi[a.source_type]}),m.jsx(Re,{width:"268px",children:a.source_type==="twitter_handle"?m.jsxs(ry,{href:`${n$}/${a.source}?open=system`,target:"_blank",children:["@",a.source]}):m.jsx(ry,{href:`${a.source}?open=system`,target:"_blank",children:a.source})}),m.jsx(Re,{className:"cell-center",children:m.jsxs(ee,{direction:"row",justify:"space-between",children:[m.jsx("div",{className:"approve-wrapper",children:m.jsx(ny,{className:"centered",onClick:()=>o(a.ref_id),children:m.jsx(NB,{color:K.primaryGreen,fontSize:24})})}),m.jsx("div",{className:"delete-wrapper",children:n===a.ref_id?m.jsx(Ut,{color:K.white,size:16}):m.jsx(o$,{message:"Are you sure ?",onConfirm:()=>i(a.ref_id),children:m.jsx(ny,{className:"centered",children:m.jsx(BB,{color:K.primaryRed,fontSize:24})})})})]})}),m.jsx(Re,{className:"empty"})]},a.source))})]}):m.jsxs(ee,{children:[m.jsx(ze,{children:"There is not any results for selected filters"}),m.jsx(ah,{})]})},ny=X(ee)` width: 20px; height: 20px; border-radius: 50%; @@ -680,7 +680,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho &:hover { cursor: pointer; } -`,cF=()=>{const[e,t]=y.useState(!0),[n,r]=y.useState(""),[o,i]=Qo(l=>[l.queuedSources,l.setQueuedSources]);y.useEffect(()=>{(async()=>{t(!0);try{const c=await Z2({approved:"False"});i(c.data)}catch(c){console.warn(c)}finally{t(!1)}})()},[i]);const a=l=>{r(n===l||!l?"":l)},s=o==null?void 0:o.filter(l=>!n||l.source_type===n);return m.jsxs(uF,{align:"stretch",direction:"column",justify:"flex-end",children:[m.jsxs(mf,{align:"flex-start",justify:"space-between",children:[m.jsx(ze,{className:"title",children:"Queued Sources"}),m.jsx(ze,{className:"subtitle",children:"This is a queue of pending sources waiting for approval or denial from graph users. If you think a source will provide good content for the graph, you can pay to approve it. Think of this as an investment: you pay to add it to the source table, and if the content is popular you will earn from it. If content is not relevant to the graph, you should deny it."})]}),m.jsxs(ee,{className:"filters",direction:"row",pb:16,px:36,children:[m.jsx(Uc,{className:Ti({selected:!n}),onClick:()=>a(""),size:"small",children:"All"}),Object.keys(Fi).map(l=>m.jsx(Uc,{className:Ti({selected:l===n}),onClick:()=>a(l),size:"small",children:Fi[l]},l))]}),m.jsx(fF,{align:"center",justify:e?"center":"flex-start",children:e?m.jsx(Ut,{color:K.white}):m.jsx(lF,{data:s})})]})},uF=X(ee)` +`,cF=()=>{const[e,t]=y.useState(!0),[n,r]=y.useState(""),[o,i]=Qo(l=>[l.queuedSources,l.setQueuedSources]);y.useEffect(()=>{(async()=>{t(!0);try{const c=await Z2({approved:"False"});i(c.data)}catch(c){console.warn(c)}finally{t(!1)}})()},[i]);const a=l=>{r(n===l||!l?"":l)},s=o==null?void 0:o.filter(l=>!n||l.source_type===n);return m.jsxs(uF,{align:"stretch",direction:"column",justify:"flex-end",children:[m.jsxs(vf,{align:"flex-start",justify:"space-between",children:[m.jsx(ze,{className:"title",children:"Queued Sources"}),m.jsx(ze,{className:"subtitle",children:"This is a queue of pending sources waiting for approval or denial from graph users. If you think a source will provide good content for the graph, you can pay to approve it. Think of this as an investment: you pay to add it to the source table, and if the content is popular you will earn from it. If content is not relevant to the graph, you should deny it."})]}),m.jsxs(ee,{className:"filters",direction:"row",pb:16,px:36,children:[m.jsx(Uc,{className:Ti({selected:!n}),onClick:()=>a(""),size:"small",children:"All"}),Object.keys(Fi).map(l=>m.jsx(Uc,{className:Ti({selected:l===n}),onClick:()=>a(l),size:"small",children:Fi[l]},l))]}),m.jsx(fF,{align:"center",justify:e?"center":"flex-start",children:e?m.jsx(Ut,{color:K.white}):m.jsx(lF,{data:s})})]})},uF=X(ee)` flex: 1; .title { @@ -711,15 +711,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho overflow: auto; flex: 1; width: 100%; -`,i$=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("g",{id:"Property 1=Normal",children:m.jsx("path",{id:"search",d:"M15.5192 20.6153C13.8115 20.6153 12.3654 20.023 11.1808 18.8384C9.99618 17.6538 9.40387 16.2077 9.40387 14.5C9.40387 12.7923 9.99618 11.3462 11.1808 10.1615C12.3654 8.97694 13.8115 8.38464 15.5192 8.38464C17.2269 8.38464 18.6731 8.97694 19.8577 10.1615C21.0423 11.3462 21.6346 12.7923 21.6346 14.5C21.6346 15.2141 21.5147 15.8961 21.275 16.5461C21.0352 17.1961 20.7153 17.7615 20.3153 18.2423L23.0692 20.9961C23.2077 21.1346 23.2785 21.3087 23.2817 21.5183C23.2849 21.7279 23.2141 21.9051 23.0692 22.05C22.9243 22.1948 22.7487 22.2673 22.5423 22.2673C22.3359 22.2673 22.1603 22.1948 22.0154 22.05L19.2615 19.2961C18.7615 19.7089 18.1865 20.032 17.5365 20.2653C16.8865 20.4987 16.2141 20.6153 15.5192 20.6153ZM15.5192 19.1154C16.8077 19.1154 17.899 18.6683 18.7933 17.774C19.6875 16.8798 20.1346 15.7885 20.1346 14.5C20.1346 13.2115 19.6875 12.1202 18.7933 11.2259C17.899 10.3317 16.8077 9.88459 15.5192 9.88459C14.2308 9.88459 13.1394 10.3317 12.2452 11.2259C11.351 12.1202 10.9038 13.2115 10.9038 14.5C10.9038 15.7885 11.351 16.8798 12.2452 17.774C13.1394 18.6683 14.2308 19.1154 15.5192 19.1154Z",fill:"currentColor"})})}),a$=({onSearch:e,placeholder:t,activeIcon:n,defaultIcon:r,loadingIcon:o,loading:i,...a})=>{const[s,l]=y.useState(""),c=()=>{l(""),e("")},u=y.useCallback(h=>{e(h)},[e]),f=y.useMemo(()=>Sg.debounce(u,300),[u]),d=h=>{const g=h.target.value.trim(),{value:v}=h.target;l(v),g?f(g):c()},p=()=>i?m.jsx(oy,{children:m.jsx(Ld,{type:"button",children:o})}):m.jsx(oy,{children:s?m.jsx(Ld,{onClick:c,type:"button",children:n}):m.jsx(Ld,{type:"button",children:r})});return m.jsxs(dF,{children:[m.jsx(pF,{autoComplete:"off",autoCorrect:"off",inputProps:{"aria-label":"search"},onChange:d,placeholder:t,value:s,...a}),p()]})},oy=X(ee)` +`,i$=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("g",{id:"Property 1=Normal",children:m.jsx("path",{id:"search",d:"M15.5192 20.6153C13.8115 20.6153 12.3654 20.023 11.1808 18.8384C9.99618 17.6538 9.40387 16.2077 9.40387 14.5C9.40387 12.7923 9.99618 11.3462 11.1808 10.1615C12.3654 8.97694 13.8115 8.38464 15.5192 8.38464C17.2269 8.38464 18.6731 8.97694 19.8577 10.1615C21.0423 11.3462 21.6346 12.7923 21.6346 14.5C21.6346 15.2141 21.5147 15.8961 21.275 16.5461C21.0352 17.1961 20.7153 17.7615 20.3153 18.2423L23.0692 20.9961C23.2077 21.1346 23.2785 21.3087 23.2817 21.5183C23.2849 21.7279 23.2141 21.9051 23.0692 22.05C22.9243 22.1948 22.7487 22.2673 22.5423 22.2673C22.3359 22.2673 22.1603 22.1948 22.0154 22.05L19.2615 19.2961C18.7615 19.7089 18.1865 20.032 17.5365 20.2653C16.8865 20.4987 16.2141 20.6153 15.5192 20.6153ZM15.5192 19.1154C16.8077 19.1154 17.899 18.6683 18.7933 17.774C19.6875 16.8798 20.1346 15.7885 20.1346 14.5C20.1346 13.2115 19.6875 12.1202 18.7933 11.2259C17.899 10.3317 16.8077 9.88459 15.5192 9.88459C14.2308 9.88459 13.1394 10.3317 12.2452 11.2259C11.351 12.1202 10.9038 13.2115 10.9038 14.5C10.9038 15.7885 11.351 16.8798 12.2452 17.774C13.1394 18.6683 14.2308 19.1154 15.5192 19.1154Z",fill:"currentColor"})})}),a$=({onSearch:e,placeholder:t,activeIcon:n,defaultIcon:r,loadingIcon:o,loading:i,...a})=>{const[s,l]=y.useState(""),c=()=>{l(""),e("")},u=y.useCallback(h=>{e(h)},[e]),f=y.useMemo(()=>Sg.debounce(u,300),[u]),d=h=>{const g=h.target.value.trim(),{value:v}=h.target;l(v),g?f(g):c()},p=()=>i?m.jsx(oy,{children:m.jsx(Bd,{type:"button",children:o})}):m.jsx(oy,{children:s?m.jsx(Bd,{onClick:c,type:"button",children:n}):m.jsx(Bd,{type:"button",children:r})});return m.jsxs(dF,{children:[m.jsx(pF,{autoComplete:"off",autoCorrect:"off",inputProps:{"aria-label":"search"},onChange:d,placeholder:t,value:s,...a}),p()]})},oy=X(ee)` top: -50%; right: -3%; z-index: 3; position: absolute; transform: translate(-50%, 50%); -`,Ld=X(yr)` +`,Bd=X(yr)` font-size: 24px; -`,dF=X(Ku)` +`,dF=X(qu)` && { width: 100%; height: 40px; @@ -730,7 +730,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho box-sizing: border-box; padding-top: 0px; } -`,pF=X(nf)` +`,pF=X(rf)` -webkit-autofill, -webkit-autocomplete, -webkit-contacts-auto-fill, @@ -812,7 +812,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho -webkit-text-fill-color: ${({placeholderTextColor:e})=>K[e]}; color: ${({placeholderTextColor:e})=>K[e]}; } -`;gm.displayName="WebTextInput";const mm=y.forwardRef(({autoComplete:e=gr.autoComplete,autoFocus:t,className:n,colorName:r=gr.colorName,defaultValue:o,disabled:i=gr.disabled,id:a,maxLength:s=gr.maxLength,name:l,onBlur:c,onChange:u,onFocus:f,onKeyDown:d,placeholder:p=gr.placeholder,placeholderTextColor:h=gr.placeholderTextColor,textAlign:g=gr.textAlign,type:v=gr.type,value:x},w)=>{const $=y.useCallback(C=>{u&&u(C.target.value)},[u]);return m.jsx(gm,{ref:w,autoComplete:e,autoFocus:t,className:n,colorName:r,defaultValue:o,disabled:i,id:a,maxLength:s,name:l,onBlur:c,onChange:$,onFocus:f,onKeyDown:d,placeholder:p,placeholderTextColor:h,textAlign:g,type:v,value:x})});mm.displayName="BaseTextInput";const hF=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 21 21",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M13.8 9.97481L5.82503 1.9998H18C18.4167 1.9998 18.7167 2.18314 18.9 2.5498C19.0834 2.91647 19.05 3.26647 18.8 3.5998L13.8 9.97481ZM18.775 20.5998L13 14.8248V16.9998C13 17.2831 12.9042 17.5206 12.7125 17.7123C12.5209 17.904 12.2834 17.9998 12 17.9998H10C9.71669 17.9998 9.47919 17.904 9.28753 17.7123C9.09586 17.5206 9.00002 17.2831 9.00002 16.9998V10.8248L0.400024 2.2248L1.80002 0.799805L20.2 19.1998L18.775 20.5998Z",fill:"currentColor"})}),gF=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsxs("g",{id:"delete",children:[m.jsx("mask",{id:"mask0_2401_3378",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:m.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{children:m.jsx("path",{id:"delete_2",d:"M6.08975 17.0834C5.67415 17.0834 5.31919 16.9362 5.02485 16.6419C4.73051 16.3475 4.58333 15.9926 4.58333 15.577V5.00009H4.375C4.19765 5.00009 4.04915 4.94026 3.9295 4.82061C3.80983 4.70095 3.75 4.55245 3.75 4.37511C3.75 4.19776 3.80983 4.04926 3.9295 3.92961C4.04915 3.80994 4.19765 3.75011 4.375 3.75011H7.49998C7.49998 3.54605 7.57183 3.37218 7.71552 3.22848C7.85922 3.08479 8.03309 3.01294 8.23715 3.01294H11.7628C11.9669 3.01294 12.1407 3.08479 12.2844 3.22848C12.4281 3.37218 12.5 3.54605 12.5 3.75011H15.625C15.8023 3.75011 15.9508 3.80994 16.0705 3.92961C16.1901 4.04926 16.25 4.19776 16.25 4.37511C16.25 4.55245 16.1901 4.70095 16.0705 4.82061C15.9508 4.94026 15.8023 5.00009 15.625 5.00009H15.4166V15.577C15.4166 15.9926 15.2695 16.3475 14.9751 16.6419C14.6808 16.9362 14.3258 17.0834 13.9102 17.0834H6.08975ZM14.1666 5.00009H5.83331V15.577C5.83331 15.6518 5.85735 15.7132 5.90544 15.7613C5.95352 15.8094 6.01496 15.8334 6.08975 15.8334H13.9102C13.985 15.8334 14.0464 15.8094 14.0945 15.7613C14.1426 15.7132 14.1666 15.6518 14.1666 15.577V5.00009ZM7.83654 14.1668H9.08652V6.66675H7.83654V14.1668ZM10.9134 14.1668H12.1634V6.66675H10.9134V14.1668Z",fill:"currentColor"})})]})}),mF=({data:e,canEdit:t=!1})=>{const n=Qo(s=>s.setSources),[r,o]=y.useState(""),i=async(s,l)=>{if(e!=null&&e.length)try{await AO(s,l);const c=e==null?void 0:e.findIndex(f=>f.ref_id===s),u=[...e];u[c]={...u[c],source:l.source},n(u)}catch(c){console.warn(c)}},a=async s=>{if(!(!s||!(e!=null&&e.length))){o(s);try{await Y2(s),n(e==null?void 0:e.filter(l=>l.ref_id!==s))}catch(l){console.warn(l)}finally{o("")}}};return e!=null&&e.length?m.jsxs(af,{"aria-label":"a dense table",component:"table",id:"sources-table",size:"small",children:[m.jsx(gf,{children:m.jsxs(Ni,{component:"tr",children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:"Type"}),m.jsx(Re,{align:"left",children:"Source"}),t&&m.jsx(Re,{align:"left"}),m.jsx(Re,{className:"empty"})]})}),m.jsx(aT,{component:"tbody",children:e==null?void 0:e.map(s=>m.jsxs(hf,{children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{align:"left",children:Fi[s.source_type]}),m.jsx(Re,{align:"left",children:m.jsx(vF,{condition:t,wrapper:l=>m.jsx(yF,{id:s.ref_id,onSave:c=>i(s.ref_id,{source:c,source_type:s.source_type}),value:s.source,children:l}),children:s.source_type===wp||s.source_type===Sp||s.source_type===xp?m.jsxs(m.Fragment,{children:[s.source_type===wp&&m.jsxs(Bd,{href:`${n$}/${s.source}`,target:"_blank",children:["@",s.source]}),s.source_type===Sp&&m.jsx(Bd,{href:`${s.source}${s.source.includes("?")?"&":"?"}open=system`,target:"_blank",children:s.source}),s.source_type===xp&&m.jsx(Bd,{href:s.source,target:"_blank",children:s.source})]}):m.jsx("div",{children:s.source})})}),t&&m.jsx(Re,{align:"left",children:m.jsx("div",{className:"delete-wrapper",id:`delete-${s.source}`,children:r===s.ref_id?m.jsx(s$,{"data-testid":`delete-loader-${s.ref_id}`,children:m.jsx(Ut,{color:K.white,size:16})}):m.jsx(o$,{"data-testid":`delete-icon-${s.ref_id}`,message:"Are you sure?",onConfirm:()=>a(s.ref_id),children:m.jsx(Oi,{className:"centered","data-testid":`delete-icon-${s.ref_id}`,children:m.jsx(gF,{})})})})}),m.jsx(Re,{className:"empty"})]},s.source))})]}):m.jsxs(xF,{children:[m.jsx(hF,{}),m.jsx(ze,{className:"text",children:"There is not any results for selected filters"})]})};function vF({condition:e,wrapper:t,children:n}){return e?t(n):n}const yF=({value:e,onSave:t,id:n,children:r})=>{const[o,i]=y.useState(!1),[a,s]=y.useState(e),[l,c]=y.useState(!1),u=async()=>{if(n){c(!0);try{await t(a),i(!1)}catch(f){console.warn(f)}finally{c(!1)}}};return m.jsx("div",{children:o?m.jsxs(bF,{align:"center",direction:"row",children:[m.jsx(mm,{className:"editable-cell__input",name:"cell-input",onChange:f=>s(f),value:a}),m.jsx(Oi,{align:"center",justify:"center",children:l?m.jsx(s$,{"data-testid":`edit-loader-${n}`,children:m.jsx(Ut,{color:K.white,size:12})}):m.jsx(FB,{"data-testid":`check-icon-${n}`,onClick:u})}),m.jsx(Oi,{align:"center",className:"secondary",justify:"center",onClick:()=>i(!1),children:m.jsx(ZS,{})})]}):m.jsxs(wF,{direction:"row",children:[r,m.jsx(Oi,{onClick:()=>i(!0),children:m.jsx(zB,{"data-testid":`edit-icon-${n}`,size:20})})]})})},bF=X(ee)` +`;gm.displayName="WebTextInput";const mm=y.forwardRef(({autoComplete:e=gr.autoComplete,autoFocus:t,className:n,colorName:r=gr.colorName,defaultValue:o,disabled:i=gr.disabled,id:a,maxLength:s=gr.maxLength,name:l,onBlur:c,onChange:u,onFocus:f,onKeyDown:d,placeholder:p=gr.placeholder,placeholderTextColor:h=gr.placeholderTextColor,textAlign:g=gr.textAlign,type:v=gr.type,value:x},w)=>{const $=y.useCallback(C=>{u&&u(C.target.value)},[u]);return m.jsx(gm,{ref:w,autoComplete:e,autoFocus:t,className:n,colorName:r,defaultValue:o,disabled:i,id:a,maxLength:s,name:l,onBlur:c,onChange:$,onFocus:f,onKeyDown:d,placeholder:p,placeholderTextColor:h,textAlign:g,type:v,value:x})});mm.displayName="BaseTextInput";const hF=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 21 21",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M13.8 9.97481L5.82503 1.9998H18C18.4167 1.9998 18.7167 2.18314 18.9 2.5498C19.0834 2.91647 19.05 3.26647 18.8 3.5998L13.8 9.97481ZM18.775 20.5998L13 14.8248V16.9998C13 17.2831 12.9042 17.5206 12.7125 17.7123C12.5209 17.904 12.2834 17.9998 12 17.9998H10C9.71669 17.9998 9.47919 17.904 9.28753 17.7123C9.09586 17.5206 9.00002 17.2831 9.00002 16.9998V10.8248L0.400024 2.2248L1.80002 0.799805L20.2 19.1998L18.775 20.5998Z",fill:"currentColor"})}),gF=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsxs("g",{id:"delete",children:[m.jsx("mask",{id:"mask0_2401_3378",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:m.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{children:m.jsx("path",{id:"delete_2",d:"M6.08975 17.0834C5.67415 17.0834 5.31919 16.9362 5.02485 16.6419C4.73051 16.3475 4.58333 15.9926 4.58333 15.577V5.00009H4.375C4.19765 5.00009 4.04915 4.94026 3.9295 4.82061C3.80983 4.70095 3.75 4.55245 3.75 4.37511C3.75 4.19776 3.80983 4.04926 3.9295 3.92961C4.04915 3.80994 4.19765 3.75011 4.375 3.75011H7.49998C7.49998 3.54605 7.57183 3.37218 7.71552 3.22848C7.85922 3.08479 8.03309 3.01294 8.23715 3.01294H11.7628C11.9669 3.01294 12.1407 3.08479 12.2844 3.22848C12.4281 3.37218 12.5 3.54605 12.5 3.75011H15.625C15.8023 3.75011 15.9508 3.80994 16.0705 3.92961C16.1901 4.04926 16.25 4.19776 16.25 4.37511C16.25 4.55245 16.1901 4.70095 16.0705 4.82061C15.9508 4.94026 15.8023 5.00009 15.625 5.00009H15.4166V15.577C15.4166 15.9926 15.2695 16.3475 14.9751 16.6419C14.6808 16.9362 14.3258 17.0834 13.9102 17.0834H6.08975ZM14.1666 5.00009H5.83331V15.577C5.83331 15.6518 5.85735 15.7132 5.90544 15.7613C5.95352 15.8094 6.01496 15.8334 6.08975 15.8334H13.9102C13.985 15.8334 14.0464 15.8094 14.0945 15.7613C14.1426 15.7132 14.1666 15.6518 14.1666 15.577V5.00009ZM7.83654 14.1668H9.08652V6.66675H7.83654V14.1668ZM10.9134 14.1668H12.1634V6.66675H10.9134V14.1668Z",fill:"currentColor"})})]})}),mF=({data:e,canEdit:t=!1})=>{const n=Qo(s=>s.setSources),[r,o]=y.useState(""),i=async(s,l)=>{if(e!=null&&e.length)try{await AO(s,l);const c=e==null?void 0:e.findIndex(f=>f.ref_id===s),u=[...e];u[c]={...u[c],source:l.source},n(u)}catch(c){console.warn(c)}},a=async s=>{if(!(!s||!(e!=null&&e.length))){o(s);try{await Y2(s),n(e==null?void 0:e.filter(l=>l.ref_id!==s))}catch(l){console.warn(l)}finally{o("")}}};return e!=null&&e.length?m.jsxs(sf,{"aria-label":"a dense table",component:"table",id:"sources-table",size:"small",children:[m.jsx(mf,{children:m.jsxs(Ni,{component:"tr",children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:"Type"}),m.jsx(Re,{align:"left",children:"Source"}),t&&m.jsx(Re,{align:"left"}),m.jsx(Re,{className:"empty"})]})}),m.jsx(aT,{component:"tbody",children:e==null?void 0:e.map(s=>m.jsxs(gf,{children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{align:"left",children:Fi[s.source_type]}),m.jsx(Re,{align:"left",children:m.jsx(vF,{condition:t,wrapper:l=>m.jsx(yF,{id:s.ref_id,onSave:c=>i(s.ref_id,{source:c,source_type:s.source_type}),value:s.source,children:l}),children:s.source_type===Sp||s.source_type===$p||s.source_type===wp?m.jsxs(m.Fragment,{children:[s.source_type===Sp&&m.jsxs(Fd,{href:`${n$}/${s.source}`,target:"_blank",children:["@",s.source]}),s.source_type===$p&&m.jsx(Fd,{href:`${s.source}${s.source.includes("?")?"&":"?"}open=system`,target:"_blank",children:s.source}),s.source_type===wp&&m.jsx(Fd,{href:s.source,target:"_blank",children:s.source})]}):m.jsx("div",{children:s.source})})}),t&&m.jsx(Re,{align:"left",children:m.jsx("div",{className:"delete-wrapper",id:`delete-${s.source}`,children:r===s.ref_id?m.jsx(s$,{"data-testid":`delete-loader-${s.ref_id}`,children:m.jsx(Ut,{color:K.white,size:16})}):m.jsx(o$,{"data-testid":`delete-icon-${s.ref_id}`,message:"Are you sure?",onConfirm:()=>a(s.ref_id),children:m.jsx(Oi,{className:"centered","data-testid":`delete-icon-${s.ref_id}`,children:m.jsx(gF,{})})})})}),m.jsx(Re,{className:"empty"})]},s.source))})]}):m.jsxs(xF,{children:[m.jsx(hF,{}),m.jsx(ze,{className:"text",children:"There is not any results for selected filters"})]})};function vF({condition:e,wrapper:t,children:n}){return e?t(n):n}const yF=({value:e,onSave:t,id:n,children:r})=>{const[o,i]=y.useState(!1),[a,s]=y.useState(e),[l,c]=y.useState(!1),u=async()=>{if(n){c(!0);try{await t(a),i(!1)}catch(f){console.warn(f)}finally{c(!1)}}};return m.jsx("div",{children:o?m.jsxs(bF,{align:"center",direction:"row",children:[m.jsx(mm,{className:"editable-cell__input",name:"cell-input",onChange:f=>s(f),value:a}),m.jsx(Oi,{align:"center",justify:"center",children:l?m.jsx(s$,{"data-testid":`edit-loader-${n}`,children:m.jsx(Ut,{color:K.white,size:12})}):m.jsx(FB,{"data-testid":`check-icon-${n}`,onClick:u})}),m.jsx(Oi,{align:"center",className:"secondary",justify:"center",onClick:()=>i(!1),children:m.jsx(ZS,{})})]}):m.jsxs(wF,{direction:"row",children:[r,m.jsx(Oi,{onClick:()=>i(!0),children:m.jsx(zB,{"data-testid":`edit-icon-${n}`,size:20})})]})})},bF=X(ee)` display: flex; width: 250px; border: 2px solid ${K.lightBlue300}; @@ -877,7 +877,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho visibility: visible; } } -`,Bd=X.a` +`,Fd=X.a` color: ${K.white}; text-decoration: underline; max-width: 400px; @@ -892,7 +892,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho display: flex; justify-content: center; align-items: center; -`,SF=()=>{const[e,t]=y.useState(!0),[n,r]=y.useState(""),[o,i]=Qo(f=>[f.sources,f.setSources]),[a]=sa(f=>[f.isAdmin]),[s,l]=y.useState("");y.useEffect(()=>{(async()=>{t(!0);try{const d=await Z2();i(d.data)}catch(d){console.warn(d)}finally{t(!1)}})()},[i]);const c=f=>{r(n===f||!f?"":f)},u=y.useMemo(()=>o==null?void 0:o.filter(f=>(!n||f.source_type===n)&&(f.source.toLowerCase().startsWith(s.toLowerCase())||f.source.toLowerCase().includes(s.toLowerCase())||`@${f.source.toLowerCase()}`.startsWith(s.toLowerCase())||`@${f.source.toLowerCase()}`.includes(s.toLowerCase()))),[s,n,o]);return m.jsxs($F,{align:"stretch",direction:"column",justify:"flex-end",children:[m.jsx(mf,{align:"center",direction:"row",justify:"space-between",children:m.jsx(ze,{className:"title",children:"Sources for this Graph"})}),m.jsx(OF,{children:m.jsx(a$,{activeIcon:m.jsx(ei,{}),defaultIcon:m.jsx(i$,{}),loading:e,loadingIcon:m.jsx(Ut,{color:K.lightGray,size:24}),onSearch:l,placeholder:"Find Source"})}),m.jsxs(ee,{className:"filters",direction:"row",pb:16,px:36,children:[m.jsx(Uc,{className:Ti({selected:!n}),onClick:()=>c(""),size:"small",children:"All"}),Object.keys(Fi).map(f=>m.jsx(Uc,{className:Ti({selected:f===n}),onClick:()=>c(f),size:"small",children:Fi[f]},f))]}),m.jsx(CF,{align:"center",justify:e?"center":"flex-start",children:e?m.jsx(Ut,{color:K.white}):m.jsx(mF,{canEdit:a,data:u})})]})},$F=X(ee)` +`,SF=()=>{const[e,t]=y.useState(!0),[n,r]=y.useState(""),[o,i]=Qo(f=>[f.sources,f.setSources]),[a]=sa(f=>[f.isAdmin]),[s,l]=y.useState("");y.useEffect(()=>{(async()=>{t(!0);try{const d=await Z2();i(d.data)}catch(d){console.warn(d)}finally{t(!1)}})()},[i]);const c=f=>{r(n===f||!f?"":f)},u=y.useMemo(()=>o==null?void 0:o.filter(f=>(!n||f.source_type===n)&&(f.source.toLowerCase().startsWith(s.toLowerCase())||f.source.toLowerCase().includes(s.toLowerCase())||`@${f.source.toLowerCase()}`.startsWith(s.toLowerCase())||`@${f.source.toLowerCase()}`.includes(s.toLowerCase()))),[s,n,o]);return m.jsxs($F,{align:"stretch",direction:"column",justify:"flex-end",children:[m.jsx(vf,{align:"center",direction:"row",justify:"space-between",children:m.jsx(ze,{className:"title",children:"Sources for this Graph"})}),m.jsx(OF,{children:m.jsx(a$,{activeIcon:m.jsx(ei,{}),defaultIcon:m.jsx(i$,{}),loading:e,loadingIcon:m.jsx(Ut,{color:K.lightGray,size:24}),onSearch:l,placeholder:"Find Source"})}),m.jsxs(ee,{className:"filters",direction:"row",pb:16,px:36,children:[m.jsx(Uc,{className:Ti({selected:!n}),onClick:()=>c(""),size:"small",children:"All"}),Object.keys(Fi).map(f=>m.jsx(Uc,{className:Ti({selected:f===n}),onClick:()=>c(f),size:"small",children:Fi[f]},f))]}),m.jsx(CF,{align:"center",justify:e?"center":"flex-start",children:e?m.jsx(Ut,{color:K.white}):m.jsx(mF,{canEdit:a,data:u})})]})},$F=X(ee)` flex: 1; .title { font-size: 20px; @@ -914,7 +914,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho width: 100%; `,OF=X(ee)` margin: 0 0 16px 36px; -`,iy={data:null,ids:[],loading:!1,total:0,filters:{is_muted:!1,sortBy:t$,page:0,pageSize:50}};let Fd=null;const sr=xg((e,t)=>({...iy,setTopics:async()=>{e({loading:!0}),Fd&&Fd.abort();const n=new AbortController,{signal:r}=n;Fd=n;const{data:o,ids:i,filters:a}=t(),s=EF(a);a.page===0&&e({data:null,ids:[],total:0});try{const l=await kO(s,r),c=a.page===0?{}:{...o||{}},u=a.page===0?[]:[...i];l.data.forEach(f=>{c[f.ref_id]=f,u.push(f.ref_id)}),e({data:c,ids:u,total:l.totalCount}),e({loading:!1})}catch(l){console.log(l)}},setFilters:n=>e({filters:{...t().filters,page:0,...n}}),terminate:()=>e(iy)})),EF=e=>({muted:e.is_muted?"True":"False",skip:String(e.page*e.pageSize),limit:String(e.pageSize),sort_by:e.sortBy,...e.search?{search:e.search}:{node_type:"Topic"}}),PF=Q2` +`,iy={data:null,ids:[],loading:!1,total:0,filters:{is_muted:!1,sortBy:t$,page:0,pageSize:50}};let zd=null;const sr=Hu((e,t)=>({...iy,setTopics:async()=>{e({loading:!0}),zd&&zd.abort();const n=new AbortController,{signal:r}=n;zd=n;const{data:o,ids:i,filters:a}=t(),s=EF(a);a.page===0&&e({data:null,ids:[],total:0});try{const l=await kO(s,r),c=a.page===0?{}:{...o||{}},u=a.page===0?[]:[...i];l.data.forEach(f=>{c[f.ref_id]=f,u.push(f.ref_id)}),e({data:c,ids:u,total:l.totalCount}),e({loading:!1})}catch(l){console.log(l)}},setFilters:n=>e({filters:{...t().filters,page:0,...n}}),terminate:()=>e(iy)})),EF=e=>({muted:e.is_muted?"True":"False",skip:String(e.page*e.pageSize),limit:String(e.pageSize),sort_by:e.sortBy,...e.search?{search:e.search}:{node_type:"Topic"}}),PF=Q2` 0% { transform: scale(0.8); } @@ -987,7 +987,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho color: ${K.GRAY6}; cursor: pointer; z-index: 1; -`,vm=({background:e="modalBg",children:t,id:n,hideBg:r,kind:o,preventOutsideClose:i,noWrap:a=!1,onClose:s})=>{const{visible:l,close:c}=Nr(n);return y.useEffect(()=>{const u=f=>{f.keyCode===27&&c()};return l&&document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[l,c]),l?m.jsx(m.Fragment,{children:m.jsx(kF,{align:"center","data-testid":"modal-overlay",hideBg:r,justify:"center",onClick:u=>{i||(u.stopPropagation(),c())},children:m.jsxs(TF,{background:e,borderRadius:9,id:n,kind:o,onClick:u=>{u.stopPropagation()},px:a?0:20,py:a?0:20,children:[s&&m.jsx(jF,{"data-testid":"close-modal",onClick:s,children:m.jsx(ei,{})}),t]})})}):null},l$=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 6 10",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M6 5L6.90043e-08 9.33013L4.47556e-07 0.669872L6 5Z",fill:"currentColor"})}),c$=e=>m.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("path",{d:"M4.5 6.04386L7.83333 2.83398V13.6673",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),m.jsx("path",{d:"M15.5 13.9581L12.1667 17.168L12.1667 6.33463",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),u$=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 10",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("circle",{cx:"5",cy:"5",r:"4.5",fill:"currentColor",stroke:"#6B7A8D"})}),IF=({type:e})=>{let t;switch(e.toLowerCase()){case"video":case"twitter_space":case"podcast":case"clip":t={iconStart:"video_badge.svg",color:K.CLIP};break;case"show":t={iconStart:"show_badge.svg",color:K.SHOW};break;case"tweet":t={iconStart:"twitter_badge.svg",color:K.TWEET};break;case"episode":t={iconStart:"audio_badge.svg",color:K.EPISODE};break;case"document":t={iconStart:"notes_badge.svg",color:K.TEXT};break;case"organization":t={iconStart:"organization_badge.svg",color:K.ORGANIZATION};break;case"person":case"guest":case"host":t={iconStart:"person_badge.svg",color:K.PERSON};break;case"event":t={iconStart:"event_badge.svg",color:K.EVENT};break;case"topic":t={iconStart:"topic_badge.svg",color:K.TOPIC};break;default:t={iconStart:"thing_badge.svg",color:K.THING};break}return m.jsx(MF,{...t,label:e})},MF=({iconStart:e,color:t,label:n})=>m.jsxs(RF,{color:t,label:n,children:[m.jsx("img",{alt:n,className:"badge__img",src:e}),m.jsx("div",{className:"badge__label",children:n})]}),RF=X(ee).attrs({direction:"row"})` +`,vm=({background:e="modalBg",children:t,id:n,hideBg:r,kind:o,preventOutsideClose:i,noWrap:a=!1,onClose:s})=>{const{visible:l,close:c}=Nr(n);return y.useEffect(()=>{const u=f=>{f.keyCode===27&&c()};return l&&document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[l,c]),l?m.jsx(m.Fragment,{children:m.jsx(kF,{align:"center","data-testid":"modal-overlay",hideBg:r,justify:"center",onClick:u=>{i||(u.stopPropagation(),c())},children:m.jsxs(TF,{background:e,borderRadius:9,id:n,kind:o,onClick:u=>{u.stopPropagation()},px:a?0:20,py:a?0:20,children:[s&&m.jsx(jF,{"data-testid":"close-modal",onClick:s,children:m.jsx(ei,{})}),t]})})}):null},l$=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 6 10",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M6 5L6.90043e-08 9.33013L4.47556e-07 0.669872L6 5Z",fill:"currentColor"})}),c$=e=>m.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("path",{d:"M4.5 6.04386L7.83333 2.83398V13.6673",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),m.jsx("path",{d:"M15.5 13.9581L12.1667 17.168L12.1667 6.33463",stroke:"white","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})]}),u$=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 10",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("circle",{cx:"5",cy:"5",r:"4.5",fill:"currentColor",stroke:"#6B7A8D"})}),IF={schemas:[],links:[]},MF=Hu((e,t)=>({...IF,setSchemas:n=>{e({schemas:n.map(r=>{var o;return{...r,ref_id:((o=r==null?void 0:r.attributes)==null?void 0:o.ref_id)||""}})})},setSchemaLinks:n=>{e({links:n})},getPrimaryColorByType:n=>{const r=t().schemas.find(o=>o.type===n);return r?r.primary_color:void 0}})),RF=({type:e})=>{let t;const[n]=MF(i=>[i.getPrimaryColorByType]),r=e.toLowerCase(),o=n(e);switch(r){case"video":case"twitter_space":case"podcast":case"clip":t={iconStart:"video_badge.svg",color:o??K.CLIP};break;case"show":t={iconStart:"show_badge.svg",color:o??K.SHOW};break;case"tweet":t={iconStart:"twitter_badge.svg",color:o??K.TWEET};break;case"episode":t={iconStart:"audio_badge.svg",color:o??K.EPISODE};break;case"document":t={iconStart:"notes_badge.svg",color:o??K.TEXT};break;case"organization":t={iconStart:"organization_badge.svg",color:o??K.ORGANIZATION};break;case"person":case"guest":case"host":t={iconStart:"person_badge.svg",color:o??K.PERSON};break;case"event":t={iconStart:"event_badge.svg",color:o??K.EVENT};break;case"topic":t={iconStart:"topic_badge.svg",color:o??K.TOPIC};break;default:t={iconStart:"thing_badge.svg",color:o??K.THING};break}return m.jsx(DF,{...t,label:e})},DF=({iconStart:e,color:t,label:n})=>m.jsxs(NF,{color:t,label:n,children:[m.jsx("img",{alt:n,className:"badge__img",src:e}),m.jsx("div",{className:"badge__label",children:n})]}),NF=X(ee).attrs({direction:"row"})` cursor: pointer; background: ${({color:e})=>e}; border-radius: 3px; @@ -1015,7 +1015,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho letter-spacing: 0.48px; padding: 0 4px; } -`,DF={options:[],getOptionLabel:e=>e.label,handleInputChange:e=>e},ym=({options:e,onSelect:t,selectedValue:n=null,handleInputChange:r,isLoading:o=!1,autoFocus:i=!1,disabled:a=!1,dataTestId:s,dataId:l})=>{const c=y.useRef(null),[u,f]=y.useState(!1);y.useEffect(()=>{i&&c.current&&(c.current.focus(),f(!0))},[i]);const d=(p,h)=>{t(h)};return m.jsx(Lw,{flexGrow:1,spacing:1,children:m.jsx(t8,{...DF,autoFocus:!0,autoHighlight:!0,blurOnSelect:!0,"data-testid":l,disableClearable:!0,disabled:a,disablePortal:!0,id:"blur-on-select",ListboxProps:{sx:{backgroundColor:K.DROPDOWN_BG,"&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{backgroundClip:"padding-box",backgroundColor:K.SCROLL_BAR,borderRadius:"6px"}},ref:c},loading:o,onChange:d,onClose:()=>f(!1),onInputChange:(p,h)=>r==null?void 0:r(h),onOpen:()=>f(!0),open:u,options:e??[],PopperComponent:({children:p,...h})=>m.jsx(Vg,{...h,placement:"bottom-start",children:p}),renderInput:p=>m.jsx(NF,{inputRef:c,...p,"data-testid":s,InputProps:{...p.InputProps,disableUnderline:!0,endAdornment:m.jsx(m.Fragment,{children:o?m.jsx(I8,{color:"inherit",size:20}):p.InputProps.endAdornment})},size:"medium",variant:"standard"}),renderOption:(p,h)=>m.jsx("li",{...p,children:m.jsxs(ee,{align:"center","data-testid":h.label,direction:"row",grow:1,justify:"space-between",onClick:h==null?void 0:h.action,shrink:1,style:{fontSize:"14px",wordBreak:"break-word"},children:[m.jsx("div",{className:"option",children:h.label!==""?h.label:"Not Selected"}),(h==null?void 0:h.type)&&m.jsx(IF,{type:h.type})]})}),sx:{"&.MuiAutocomplete-option:hover":{backgroundColor:K.DROPDOWN_HOVER},"&.MuiAutocomplete-option[aria-selected='true']":{backgroundColor:K.DROPDOWN_SELECTED}},value:n||void 0})})},NF=X(Kg)` +`,LF={options:[],getOptionLabel:e=>e.label,handleInputChange:e=>e},ym=({options:e,onSelect:t,selectedValue:n=null,handleInputChange:r,isLoading:o=!1,autoFocus:i=!1,disabled:a=!1,dataTestId:s,dataId:l})=>{const c=y.useRef(null),[u,f]=y.useState(!1);y.useEffect(()=>{i&&c.current&&(c.current.focus(),f(!0))},[i]);const d=(p,h)=>{t(h)};return m.jsx(Lw,{flexGrow:1,spacing:1,children:m.jsx(t8,{...LF,autoFocus:!0,autoHighlight:!0,blurOnSelect:!0,"data-testid":l,disableClearable:!0,disabled:a,disablePortal:!0,id:"blur-on-select",ListboxProps:{sx:{backgroundColor:K.DROPDOWN_BG,"&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{backgroundClip:"padding-box",backgroundColor:K.SCROLL_BAR,borderRadius:"6px"}},ref:c},loading:o,onChange:d,onClose:()=>f(!1),onInputChange:(p,h)=>r==null?void 0:r(h),onOpen:()=>f(!0),open:u,options:e??[],PopperComponent:({children:p,...h})=>m.jsx(Vg,{...h,placement:"bottom-start",children:p}),renderInput:p=>m.jsx(BF,{inputRef:c,...p,"data-testid":s,InputProps:{...p.InputProps,disableUnderline:!0,endAdornment:m.jsx(m.Fragment,{children:o?m.jsx(I8,{color:"inherit",size:20}):p.InputProps.endAdornment})},size:"medium",variant:"standard"}),renderOption:(p,h)=>m.jsx("li",{...p,children:m.jsxs(ee,{align:"center","data-testid":h.label,direction:"row",grow:1,justify:"space-between",onClick:h==null?void 0:h.action,shrink:1,style:{fontSize:"14px",wordBreak:"break-word"},children:[m.jsx("div",{className:"option",children:h.label!==""?h.label:"Not Selected"}),(h==null?void 0:h.type)&&m.jsx(RF,{type:h.type})]})}),sx:{"&.MuiAutocomplete-option:hover":{backgroundColor:K.DROPDOWN_HOVER},"&.MuiAutocomplete-option[aria-selected='true']":{backgroundColor:K.DROPDOWN_SELECTED}},value:n||void 0})})},BF=X(Kg)` && { z-index: 2; width: 100%; @@ -1058,11 +1058,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho padding: 0; } } -`,LF=({selectedType:e,setSelectedType:t})=>{const[n,r]=y.useState([]);y.useEffect(()=>{(async()=>{try{const{data:s}=await jO();r(s.edge_types)}catch(s){console.warn(s)}})()},[r]);const o=a=>({label:a,value:a}),i=a=>{t((a==null?void 0:a.value)||"")};return m.jsx(ym,{onSelect:i,options:n.map(o),selectedValue:e?o(e):null})},Cue={label:"Not Selected",value:"Not Selected"},Oue={label:"No Parent",value:"No Parent"},Eue=[{label:"number",value:"int"},{label:"string",value:"string"}],f$=[{label:"Corporation",value:"Corporation"},{label:"Event",value:"Event"},{label:"Image",value:"Image"},{label:"Organization",value:"Organization"},{label:"Person",value:"Person"},{label:"Place",value:"Place"},{label:"Project",value:"Project"},{label:"Software",value:"Software"},{label:"Topic",value:"Topic"}],Pue=/^[^\s].*$/,BF=({onSelect:e,selectedValue:t,topicId:n})=>{const[r,o]=y.useState([]),[i,a]=y.useState(!1),s=y.useMemo(()=>{const d=async p=>{const h={is_muted:"False",sort_by:hm,search:p,skip:"0",limit:"1000"};a(!0);try{const v=(await J2(h.search)).data.filter(x=>(x==null?void 0:x.ref_id)!==n);o(v)}catch{o([])}finally{a(!1)}};return Sg.debounce(d,300)},[n]),l=d=>{if(!d){o([]);return}d.length>2&&s(d)},c=d=>{const p=d?r.find(h=>h.ref_id===d.value):null;e(p||null)},u=d=>({label:d.search_value,value:d.ref_id,type:d.node_type}),f=d=>d.map(u);return t?m.jsxs(ee,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[m.jsx("span",{children:t.search_value}),m.jsx(r$,{onClick:()=>e(null),size:"medium",children:m.jsx(ei,{})})]}):m.jsx(ym,{handleInputChange:l,isLoading:i,onSelect:c,options:f(r)||f$,selectedValue:t?u(t):null})},FF=({from:e,onSelect:t,selectedType:n,setSelectedType:r,isSwapped:o,setIsSwapped:i,selectedToNode:a})=>m.jsxs(ee,{mb:20,children:[m.jsx(ee,{align:"center",direction:"row",justify:"space-between",mb:18,children:m.jsx(ee,{align:"center",direction:"row",children:m.jsx(zF,{children:"Add edge"})})}),m.jsxs(HF,{swap:o,children:[m.jsx(ee,{children:m.jsx(UF,{disabled:!0,label:o?"To":"From",swap:o,value:e==null?void 0:e.name})}),m.jsxs(ee,{my:16,children:[m.jsx(VF,{children:"Type"}),m.jsx(LF,{selectedType:n,setSelectedType:r})]}),m.jsx(ee,{children:m.jsxs(GF,{children:[m.jsx(KF,{children:o?"From":"To"}),m.jsx(BF,{onSelect:t,selectedValue:a,topicId:e==null?void 0:e.ref_id})]})}),m.jsxs(WF,{children:[m.jsx(qF,{children:m.jsx(u$,{})}),m.jsx(XF,{onClick:i,children:m.jsx(c$,{})}),m.jsx(YF,{children:m.jsx(l$,{})})]})]})]}),zF=X(ze)` +`,FF=({selectedType:e,setSelectedType:t})=>{const[n,r]=y.useState([]);y.useEffect(()=>{(async()=>{try{const{data:s}=await jO();r(s.edge_types)}catch(s){console.warn(s)}})()},[r]);const o=a=>({label:a,value:a}),i=a=>{t((a==null?void 0:a.value)||"")};return m.jsx(ym,{onSelect:i,options:n.map(o),selectedValue:e?o(e):null})},Eue={label:"Not Selected",value:"Not Selected"},Pue={label:"No Parent",value:"No Parent"},_ue=[{label:"number",value:"int"},{label:"string",value:"string"}],f$=[{label:"Corporation",value:"Corporation"},{label:"Event",value:"Event"},{label:"Image",value:"Image"},{label:"Organization",value:"Organization"},{label:"Person",value:"Person"},{label:"Place",value:"Place"},{label:"Project",value:"Project"},{label:"Software",value:"Software"},{label:"Topic",value:"Topic"}],Tue=/^[^\s].*$/,zF=({onSelect:e,selectedValue:t,topicId:n})=>{const[r,o]=y.useState([]),[i,a]=y.useState(!1),s=y.useMemo(()=>{const d=async p=>{const h={is_muted:"False",sort_by:hm,search:p,skip:"0",limit:"1000"};a(!0);try{const v=(await J2(h.search)).data.filter(x=>(x==null?void 0:x.ref_id)!==n);o(v)}catch{o([])}finally{a(!1)}};return Sg.debounce(d,300)},[n]),l=d=>{if(!d){o([]);return}d.length>2&&s(d)},c=d=>{const p=d?r.find(h=>h.ref_id===d.value):null;e(p||null)},u=d=>({label:d.search_value,value:d.ref_id,type:d.node_type}),f=d=>d.map(u);return t?m.jsxs(ee,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[m.jsx("span",{children:t.search_value}),m.jsx(r$,{onClick:()=>e(null),size:"medium",children:m.jsx(ei,{})})]}):m.jsx(ym,{handleInputChange:l,isLoading:i,onSelect:c,options:f(r)||f$,selectedValue:t?u(t):null})},WF=({from:e,onSelect:t,selectedType:n,setSelectedType:r,isSwapped:o,setIsSwapped:i,selectedToNode:a})=>m.jsxs(ee,{mb:20,children:[m.jsx(ee,{align:"center",direction:"row",justify:"space-between",mb:18,children:m.jsx(ee,{align:"center",direction:"row",children:m.jsx(VF,{children:"Add edge"})})}),m.jsxs(GF,{swap:o,children:[m.jsx(ee,{children:m.jsx(KF,{disabled:!0,label:o?"To":"From",swap:o,value:e==null?void 0:e.name})}),m.jsxs(ee,{my:16,children:[m.jsx(UF,{children:"Type"}),m.jsx(FF,{selectedType:n,setSelectedType:r})]}),m.jsx(ee,{children:m.jsxs(qF,{children:[m.jsx(XF,{children:o?"From":"To"}),m.jsx(zF,{onSelect:t,selectedValue:a,topicId:e==null?void 0:e.ref_id})]})}),m.jsxs(HF,{children:[m.jsx(YF,{children:m.jsx(u$,{})}),m.jsx(ZF,{onClick:i,children:m.jsx(c$,{})}),m.jsx(QF,{children:m.jsx(l$,{})})]})]})]}),VF=X(ze)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,WF=X.div` +`,HF=X.div` position: absolute; top: 26px; bottom: 26px; @@ -1072,7 +1072,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho border-top: 1.5px solid #6b7a8d4d; border-bottom: 1.5px solid #6b7a8d4d; border-radius: 12px 0 0 12px; -`,VF=X.label` +`,UF=X.label` color: #bac1c6; font-size: 13px; font-weight: 400; @@ -1080,7 +1080,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho letter-spacing: 0.01em; text-align: left; margin-bottom: 6px; -`,HF=X.div` +`,GF=X.div` position: relative; color: white; font-family: 'Barlow'; @@ -1088,7 +1088,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho flex-direction: ${e=>e.swap?"column-reverse":"column"}; margin-bottom: 10px; padding-left: 38px; -`,UF=X(Kg)` +`,KF=X(Kg)` position: relative; width: 100%; padding: 16px; @@ -1097,7 +1097,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho border: 1px solid #6b7a8d4d; opacity: 0px; display: flex; -`,GF=X.div` +`,qF=X.div` position: relative; width: 100%; padding: 15px; @@ -1107,7 +1107,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho opacity: 0px; display: flex; align-items: center; -`,KF=X.label` +`,XF=X.label` color: #bac1c6; background-color: #23252f; font-size: 13px; @@ -1118,13 +1118,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho position: absolute; left: 15px; top: -10px; -`,qF=X.div` +`,YF=X.div` position: absolute; top: 0; right: 0; transform: translateY(-50%) translateX(50%); color: #23252f; -`,XF=X.div` +`,ZF=X.div` position: absolute; color: transparent; top: 50%; @@ -1138,24 +1138,24 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho justify-content: center; align-items: center; border-radius: 8px; -`,YF=X.div` +`,QF=X.div` position: absolute; bottom: 0; right: 0; transform: translateY(10px) translateX(3px); color: #6b7a8d; line-height: 1; -`,ZF=({topic:e,onClose:t})=>{const{close:n}=Nr("addEdge"),[r]=sr(v=>[v.data]),o=Cl({mode:"onChange"}),[i,a]=y.useState(!1),[s,l]=y.useState(!1),[c,u]=y.useState(""),[f,d]=y.useState(null),p=()=>{t(),n()},h=async()=>{if(!(!f||!r)){l(!0);try{await IO({from:e.ref_id,to:f==null?void 0:f.ref_id,relationship:c});const{ref_id:v}=e,{ref_id:x}=f;if(r){const w={...r};w[v]={...w[v],edgeList:[...w[v].edgeList,c]},w[x]&&(w[x]={...w[x],edgeList:[...w[x].edgeList,c]}),sr.setState({data:w})}p()}catch(v){console.warn(v)}finally{l(!1)}}},g=s||!f||!c;return m.jsx(vm,{id:"addEdge",kind:"small",onClose:p,preventOutsideClose:!0,children:m.jsxs($l,{...o,children:[m.jsx(FF,{from:e,isSwapped:i,onSelect:d,selectedToNode:f,selectedType:c,setIsSwapped:()=>a(!i),setSelectedType:u}),m.jsxs(QF,{color:"secondary",disabled:g,onClick:h,size:"large",variant:"contained",children:["Confirm",s&&m.jsx(JF,{children:m.jsx(Ut,{color:K.lightGray,size:12})})]})]})})},QF=X(_r)` +`,JF=({topic:e,onClose:t})=>{const{close:n}=Nr("addEdge"),[r]=sr(v=>[v.data]),o=Cl({mode:"onChange"}),[i,a]=y.useState(!1),[s,l]=y.useState(!1),[c,u]=y.useState(""),[f,d]=y.useState(null),p=()=>{t(),n()},h=async()=>{if(!(!f||!r)){l(!0);try{await IO({from:e.ref_id,to:f==null?void 0:f.ref_id,relationship:c});const{ref_id:v}=e,{ref_id:x}=f;if(r){const w={...r};w[v]={...w[v],edgeList:[...w[v].edgeList,c]},w[x]&&(w[x]={...w[x],edgeList:[...w[x].edgeList,c]}),sr.setState({data:w})}p()}catch(v){console.warn(v)}finally{l(!1)}}},g=s||!f||!c;return m.jsx(vm,{id:"addEdge",kind:"small",onClose:p,preventOutsideClose:!0,children:m.jsxs($l,{...o,children:[m.jsx(WF,{from:e,isSwapped:i,onSelect:d,selectedToNode:f,selectedType:c,setIsSwapped:()=>a(!i),setSelectedType:u}),m.jsxs(ez,{color:"secondary",disabled:g,onClick:h,size:"large",variant:"contained",children:["Confirm",s&&m.jsx(tz,{children:m.jsx(Ut,{color:K.lightGray,size:12})})]})]})})},ez=X(_r)` width: 293px !important; margin: 0 0 10px auto !important; -`,JF=X.span` +`,tz=X.span` margin-top: 2px; -`;var d$={exports:{}},p$={exports:{}},ez=function(e,t,n,r,o,i,a,s){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,s],u=0;l=new Error(t.replace(/%s/g,function(){return c[u++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},tz=ez;function h$(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Ct=y,Kc=h$(Ct),nz=ia,ay=h$(tz);function qa(){return(qa=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function m$(e){return requestAnimationFrame(e)}function sy(e){cancelAnimationFrame(e)}function yi(e){var t=e.ownerDocument;return t.hasFocus()&&t.activeElement===e}function v$(e){return e==null?void 0:e.ownerDocument}function oz(e){var t=function(n){var r;return(r=v$(n))==null?void 0:r.defaultView}(e);return!!t&&e instanceof t.HTMLElement}function bm(e){return Ct.useCallback(function(){var t=e.current,n=typeof window<"u"&&oz(t);if(!t||!n)return null;if(t.nodeName!=="INPUT"&&(t=t.querySelector("input")),!t)throw new Error("react-input-mask: inputComponent doesn't contain input node");return t},[e])}function iz(e,t){var n,r,o,i,a=Ct.useRef({start:null,end:null}),s=bm(e),l=Ct.useCallback(function(){return function(g){var v=g.selectionStart,x=g.selectionEnd;return{start:v,end:x,length:x-v}}(s())},[s]),c=Ct.useCallback(function(){return a.current},[]),u=Ct.useCallback(function(g){var v=s();v&&yi(v)&&(function(x,w,$){$===void 0&&($=w),x.setSelectionRange(w,$)}(v,g.start,g.end),a.current=l())},[s,l]),f=Ct.useCallback(function(){a.current=l()},[l]),d=(n=f,r=Ct.useRef(null),o=Ct.useCallback(function(){r.current===null&&function g(){n(),r.current=m$(g)}()},[n]),i=Ct.useCallback(function(){sy(r.current),r.current=null},[]),Ct.useEffect(function(){r.current&&(i(),o())},[o,i]),Ct.useEffect(sy,[]),[o,i]),p=d[0],h=d[1];return Ct.useLayoutEffect(function(){if(t){var g=s();return g.addEventListener("focus",p),g.addEventListener("blur",h),yi(g)&&p(),function(){g.removeEventListener("focus",p),g.removeEventListener("blur",h),h()}}}),{getSelection:l,getLastSelection:c,setSelection:u}}function az(e,t){var n=Ct.useRef(),r=iz(n,t),o=r.getSelection,i=r.getLastSelection,a=r.setSelection,s=function(f,d){var p=bm(f),h=Ct.useRef(d);return{getValue:Ct.useCallback(function(){return p().value},[p]),getLastValue:Ct.useCallback(function(){return h.current},[]),setValue:Ct.useCallback(function(g){h.current=g;var v=p();v&&(v.value=g)},[p])}}(n,e),l=s.getValue,c=s.getLastValue,u=s.setValue;return{inputRef:n,getInputState:function(){return{value:l(),selection:o()}},getLastInputState:function(){return{value:c(),selection:i()}},setInputState:function(f){var d=f.value,p=f.selection;u(d),a(p)}}}var sz=["disabled","onBlur","onChange","onFocus","onMouseDown","readOnly","value"],ly={9:/[0-9]/,a:/[A-Za-z]/,"*":/[A-Za-z0-9]/},lz=function(e){var t=this;this.isCharacterAllowedAtPosition=function(n,r){var o=t.maskOptions.maskPlaceholder;return!!t.isCharacterFillingPosition(n,r)||!!o&&o[r]===n},this.isCharacterFillingPosition=function(n,r){var o=t.maskOptions.mask;if(!n||r>=o.length)return!1;if(!t.isPositionEditable(r))return o[r]===n;var i=o[r];return new RegExp(i).test(n)},this.isPositionEditable=function(n){var r=t.maskOptions,o=r.mask,i=r.permanents;return n=0;i--)if(o(r[i],i))return i;return-1}(n.split(""),function(r,o){return t.isPositionEditable(o)&&t.isCharacterFillingPosition(r,o)})+1},this.getStringFillingLengthAtPosition=function(n,r){return n.split("").reduce(function(o,i){return t.insertCharacterAtPosition(o,i,o.length)},function(o,i){i===void 0&&(i=1);for(var a="",s=0;s=0;r--)if(t.isPositionEditable(r))return r;return null},this.getRightEditablePosition=function(n){for(var r=t.maskOptions.mask,o=n;o=i&&!d?"":f=i?u:d?s?s[f]:"":l[f]}).join("");return t.formatValue(c)},this.insertCharacterAtPosition=function(n,r,o){var i=t.maskOptions,a=i.mask,s=i.maskPlaceholder;if(o>=a.length)return n;var l=t.isCharacterAllowedAtPosition(r,o),c=t.isPositionEditable(o),u=t.getRightEditablePosition(o),f=s&&u?r===s[u]:null,d=n.slice(0,o);return!l&&c||(n=d+(l?r:a[o])),l||c||f||(n=t.insertCharacterAtPosition(n,r,o+1)),n},this.insertStringAtPosition=function(n,r,o){var i=t.maskOptions,a=i.mask,s=i.maskPlaceholder;if(!r||o>=a.length)return n;var l=r.split(""),c=t.isValueFilled(n)||!!s,u=n.slice(o);return n=l.reduce(function(f,d){return t.insertCharacterAtPosition(f,d,f.length)},n.slice(0,o)),c?n+=u.slice(n.length-o):t.isValueFilled(n)?n+=a.slice(n.length).join(""):n=u.split("").filter(function(f,d){return t.isPositionEditable(o+d)}).reduce(function(f,d){var p=t.getRightEditablePosition(f.length);return p===null?f:(t.isPositionEditable(f.length)||(f+=a.slice(f.length,p).join("")),t.insertCharacterAtPosition(f,d,f.length))},n),n},this.processChange=function(n,r){var o=t.maskOptions,i=o.mask,a=o.prefix,s=o.lastEditablePosition,l=n.value,c=n.selection,u=r.value,f=r.selection,d=l,p="",h=0,g=0,v=Math.min(f.start,c.start);return c.end>f.start?(p=d.slice(f.start,c.end),g=(h=t.getStringFillingLengthAtPosition(p,v))?f.length:0):d.length=i.length?v=i.length:v=a.length&&vm.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsxs("g",{id:"info",children:[m.jsx("mask",{id:"mask0_2682_970",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:m.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{mask:"url(#mask0_2682_970)",children:m.jsx("path",{id:"info_2",d:"M7.99992 11.3334C8.18881 11.3334 8.34714 11.2695 8.47492 11.1417C8.6027 11.0139 8.66658 10.8556 8.66658 10.6667V8.00004C8.66658 7.81115 8.6027 7.65282 8.47492 7.52504C8.34714 7.39726 8.18881 7.33337 7.99992 7.33337C7.81103 7.33337 7.6527 7.39726 7.52492 7.52504C7.39714 7.65282 7.33325 7.81115 7.33325 8.00004V10.6667C7.33325 10.8556 7.39714 11.0139 7.52492 11.1417C7.6527 11.2695 7.81103 11.3334 7.99992 11.3334ZM7.99992 6.00004C8.18881 6.00004 8.34714 5.93615 8.47492 5.80837C8.6027 5.6806 8.66658 5.52226 8.66658 5.33337C8.66658 5.14448 8.6027 4.98615 8.47492 4.85837C8.34714 4.7306 8.18881 4.66671 7.99992 4.66671C7.81103 4.66671 7.6527 4.7306 7.52492 4.85837C7.39714 4.98615 7.33325 5.14448 7.33325 5.33337C7.33325 5.52226 7.39714 5.6806 7.52492 5.80837C7.6527 5.93615 7.81103 6.00004 7.99992 6.00004ZM7.99992 14.6667C7.0777 14.6667 6.21103 14.4917 5.39992 14.1417C4.58881 13.7917 3.88325 13.3167 3.28325 12.7167C2.68325 12.1167 2.20825 11.4112 1.85825 10.6C1.50825 9.78893 1.33325 8.92226 1.33325 8.00004C1.33325 7.07782 1.50825 6.21115 1.85825 5.40004C2.20825 4.58893 2.68325 3.88337 3.28325 3.28337C3.88325 2.68337 4.58881 2.20837 5.39992 1.85837C6.21103 1.50837 7.0777 1.33337 7.99992 1.33337C8.92214 1.33337 9.78881 1.50837 10.5999 1.85837C11.411 2.20837 12.1166 2.68337 12.7166 3.28337C13.3166 3.88337 13.7916 4.58893 14.1416 5.40004C14.4916 6.21115 14.6666 7.07782 14.6666 8.00004C14.6666 8.92226 14.4916 9.78893 14.1416 10.6C13.7916 11.4112 13.3166 12.1167 12.7166 12.7167C12.1166 13.3167 11.411 13.7917 10.5999 14.1417C9.78881 14.4917 8.92214 14.6667 7.99992 14.6667ZM7.99992 13.3334C9.48881 13.3334 10.7499 12.8167 11.7833 11.7834C12.8166 10.75 13.3333 9.48893 13.3333 8.00004C13.3333 6.51115 12.8166 5.25004 11.7833 4.21671C10.7499 3.18337 9.48881 2.66671 7.99992 2.66671C6.51103 2.66671 5.24992 3.18337 4.21659 4.21671C3.18325 5.25004 2.66659 6.51115 2.66659 8.00004C2.66659 9.48893 3.18325 10.75 4.21659 11.7834C5.24992 12.8167 6.51103 13.3334 7.99992 13.3334Z",fill:"currentColor"})})]})}),hz=e=>e.hasError?K.primaryRed:e.hasContent||e.isFocused||e.isHovered?K.primaryBlue:"transparent",gz=X(ee)` +`;var d$={exports:{}},p$={exports:{}},nz=function(e,t,n,r,o,i,a,s){if(!e){var l;if(t===void 0)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,s],u=0;l=new Error(t.replace(/%s/g,function(){return c[u++]})),l.name="Invariant Violation"}throw l.framesToPop=1,l}},rz=nz;function h$(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Ct=y,Kc=h$(Ct),oz=ia,ay=h$(rz);function qa(){return(qa=Object.assign||function(e){for(var t=1;t=0||(o[n]=e[n]);return o}function m$(e){return requestAnimationFrame(e)}function sy(e){cancelAnimationFrame(e)}function yi(e){var t=e.ownerDocument;return t.hasFocus()&&t.activeElement===e}function v$(e){return e==null?void 0:e.ownerDocument}function az(e){var t=function(n){var r;return(r=v$(n))==null?void 0:r.defaultView}(e);return!!t&&e instanceof t.HTMLElement}function bm(e){return Ct.useCallback(function(){var t=e.current,n=typeof window<"u"&&az(t);if(!t||!n)return null;if(t.nodeName!=="INPUT"&&(t=t.querySelector("input")),!t)throw new Error("react-input-mask: inputComponent doesn't contain input node");return t},[e])}function sz(e,t){var n,r,o,i,a=Ct.useRef({start:null,end:null}),s=bm(e),l=Ct.useCallback(function(){return function(g){var v=g.selectionStart,x=g.selectionEnd;return{start:v,end:x,length:x-v}}(s())},[s]),c=Ct.useCallback(function(){return a.current},[]),u=Ct.useCallback(function(g){var v=s();v&&yi(v)&&(function(x,w,$){$===void 0&&($=w),x.setSelectionRange(w,$)}(v,g.start,g.end),a.current=l())},[s,l]),f=Ct.useCallback(function(){a.current=l()},[l]),d=(n=f,r=Ct.useRef(null),o=Ct.useCallback(function(){r.current===null&&function g(){n(),r.current=m$(g)}()},[n]),i=Ct.useCallback(function(){sy(r.current),r.current=null},[]),Ct.useEffect(function(){r.current&&(i(),o())},[o,i]),Ct.useEffect(sy,[]),[o,i]),p=d[0],h=d[1];return Ct.useLayoutEffect(function(){if(t){var g=s();return g.addEventListener("focus",p),g.addEventListener("blur",h),yi(g)&&p(),function(){g.removeEventListener("focus",p),g.removeEventListener("blur",h),h()}}}),{getSelection:l,getLastSelection:c,setSelection:u}}function lz(e,t){var n=Ct.useRef(),r=sz(n,t),o=r.getSelection,i=r.getLastSelection,a=r.setSelection,s=function(f,d){var p=bm(f),h=Ct.useRef(d);return{getValue:Ct.useCallback(function(){return p().value},[p]),getLastValue:Ct.useCallback(function(){return h.current},[]),setValue:Ct.useCallback(function(g){h.current=g;var v=p();v&&(v.value=g)},[p])}}(n,e),l=s.getValue,c=s.getLastValue,u=s.setValue;return{inputRef:n,getInputState:function(){return{value:l(),selection:o()}},getLastInputState:function(){return{value:c(),selection:i()}},setInputState:function(f){var d=f.value,p=f.selection;u(d),a(p)}}}var cz=["disabled","onBlur","onChange","onFocus","onMouseDown","readOnly","value"],ly={9:/[0-9]/,a:/[A-Za-z]/,"*":/[A-Za-z0-9]/},uz=function(e){var t=this;this.isCharacterAllowedAtPosition=function(n,r){var o=t.maskOptions.maskPlaceholder;return!!t.isCharacterFillingPosition(n,r)||!!o&&o[r]===n},this.isCharacterFillingPosition=function(n,r){var o=t.maskOptions.mask;if(!n||r>=o.length)return!1;if(!t.isPositionEditable(r))return o[r]===n;var i=o[r];return new RegExp(i).test(n)},this.isPositionEditable=function(n){var r=t.maskOptions,o=r.mask,i=r.permanents;return n=0;i--)if(o(r[i],i))return i;return-1}(n.split(""),function(r,o){return t.isPositionEditable(o)&&t.isCharacterFillingPosition(r,o)})+1},this.getStringFillingLengthAtPosition=function(n,r){return n.split("").reduce(function(o,i){return t.insertCharacterAtPosition(o,i,o.length)},function(o,i){i===void 0&&(i=1);for(var a="",s=0;s=0;r--)if(t.isPositionEditable(r))return r;return null},this.getRightEditablePosition=function(n){for(var r=t.maskOptions.mask,o=n;o=i&&!d?"":f=i?u:d?s?s[f]:"":l[f]}).join("");return t.formatValue(c)},this.insertCharacterAtPosition=function(n,r,o){var i=t.maskOptions,a=i.mask,s=i.maskPlaceholder;if(o>=a.length)return n;var l=t.isCharacterAllowedAtPosition(r,o),c=t.isPositionEditable(o),u=t.getRightEditablePosition(o),f=s&&u?r===s[u]:null,d=n.slice(0,o);return!l&&c||(n=d+(l?r:a[o])),l||c||f||(n=t.insertCharacterAtPosition(n,r,o+1)),n},this.insertStringAtPosition=function(n,r,o){var i=t.maskOptions,a=i.mask,s=i.maskPlaceholder;if(!r||o>=a.length)return n;var l=r.split(""),c=t.isValueFilled(n)||!!s,u=n.slice(o);return n=l.reduce(function(f,d){return t.insertCharacterAtPosition(f,d,f.length)},n.slice(0,o)),c?n+=u.slice(n.length-o):t.isValueFilled(n)?n+=a.slice(n.length).join(""):n=u.split("").filter(function(f,d){return t.isPositionEditable(o+d)}).reduce(function(f,d){var p=t.getRightEditablePosition(f.length);return p===null?f:(t.isPositionEditable(f.length)||(f+=a.slice(f.length,p).join("")),t.insertCharacterAtPosition(f,d,f.length))},n),n},this.processChange=function(n,r){var o=t.maskOptions,i=o.mask,a=o.prefix,s=o.lastEditablePosition,l=n.value,c=n.selection,u=r.value,f=r.selection,d=l,p="",h=0,g=0,v=Math.min(f.start,c.start);return c.end>f.start?(p=d.slice(f.start,c.end),g=(h=t.getStringFillingLengthAtPosition(p,v))?f.length:0):d.length=i.length?v=i.length:v=a.length&&vm.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsxs("g",{id:"info",children:[m.jsx("mask",{id:"mask0_2682_970",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:m.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{mask:"url(#mask0_2682_970)",children:m.jsx("path",{id:"info_2",d:"M7.99992 11.3334C8.18881 11.3334 8.34714 11.2695 8.47492 11.1417C8.6027 11.0139 8.66658 10.8556 8.66658 10.6667V8.00004C8.66658 7.81115 8.6027 7.65282 8.47492 7.52504C8.34714 7.39726 8.18881 7.33337 7.99992 7.33337C7.81103 7.33337 7.6527 7.39726 7.52492 7.52504C7.39714 7.65282 7.33325 7.81115 7.33325 8.00004V10.6667C7.33325 10.8556 7.39714 11.0139 7.52492 11.1417C7.6527 11.2695 7.81103 11.3334 7.99992 11.3334ZM7.99992 6.00004C8.18881 6.00004 8.34714 5.93615 8.47492 5.80837C8.6027 5.6806 8.66658 5.52226 8.66658 5.33337C8.66658 5.14448 8.6027 4.98615 8.47492 4.85837C8.34714 4.7306 8.18881 4.66671 7.99992 4.66671C7.81103 4.66671 7.6527 4.7306 7.52492 4.85837C7.39714 4.98615 7.33325 5.14448 7.33325 5.33337C7.33325 5.52226 7.39714 5.6806 7.52492 5.80837C7.6527 5.93615 7.81103 6.00004 7.99992 6.00004ZM7.99992 14.6667C7.0777 14.6667 6.21103 14.4917 5.39992 14.1417C4.58881 13.7917 3.88325 13.3167 3.28325 12.7167C2.68325 12.1167 2.20825 11.4112 1.85825 10.6C1.50825 9.78893 1.33325 8.92226 1.33325 8.00004C1.33325 7.07782 1.50825 6.21115 1.85825 5.40004C2.20825 4.58893 2.68325 3.88337 3.28325 3.28337C3.88325 2.68337 4.58881 2.20837 5.39992 1.85837C6.21103 1.50837 7.0777 1.33337 7.99992 1.33337C8.92214 1.33337 9.78881 1.50837 10.5999 1.85837C11.411 2.20837 12.1166 2.68337 12.7166 3.28337C13.3166 3.88337 13.7916 4.58893 14.1416 5.40004C14.4916 6.21115 14.6666 7.07782 14.6666 8.00004C14.6666 8.92226 14.4916 9.78893 14.1416 10.6C13.7916 11.4112 13.3166 12.1167 12.7166 12.7167C12.1166 13.3167 11.411 13.7917 10.5999 14.1417C9.78881 14.4917 8.92214 14.6667 7.99992 14.6667ZM7.99992 13.3334C9.48881 13.3334 10.7499 12.8167 11.7833 11.7834C12.8166 10.75 13.3333 9.48893 13.3333 8.00004C13.3333 6.51115 12.8166 5.25004 11.7833 4.21671C10.7499 3.18337 9.48881 2.66671 7.99992 2.66671C6.51103 2.66671 5.24992 3.18337 4.21659 4.21671C3.18325 5.25004 2.66659 6.51115 2.66659 8.00004C2.66659 9.48893 3.18325 10.75 4.21659 11.7834C5.24992 12.8167 6.51103 13.3334 7.99992 13.3334Z",fill:"currentColor"})})]})}),mz=e=>e.hasError?K.primaryRed:e.hasContent||e.isFocused||e.isHovered?K.primaryBlue:"transparent",vz=X(ee)` background: ${K.inputBg2}; border-radius: 8px; - border: 1px solid ${hz}; + border: 1px solid ${mz}; padding: 12px 8px; -`,mz=X(ee)` +`,yz=X(ee)` cursor: default; margin: 0 0 6px 6px; position: relative; @@ -1189,12 +1189,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho &:focus .tooltip { visibility: visible; } -`,vz=X.label` +`,bz=X.label` color: ${K.lightGray}; font-size: 12px; font-weight: 600; margin-bottom: 6px; -`,yz=X.textarea` +`,xz=X.textarea` width: 100%; height: 100px; border: none; @@ -1211,19 +1211,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho line-height: 20px; letter-spacing: 0.01em; text-align: left; -`,Xa=({id:e,label:t,mask:n="",message:r,name:o,rules:i,showMask:a=!1,maskPlaceholder:s=null,isTextArea:l=!1,placeholder:c="",maxLength:u,...f})=>{const{register:d,control:p,formState:{errors:h},getValues:g}=Sl()||{},v=he(h,o),x=g(o),[w,$]=y.useState(!1),[C,S]=y.useState(!1);return y.useEffect(()=>{const b=document.getElementById(e);b&&b.focus()},[e]),m.jsxs(ee,{shrink:1,children:[m.jsxs(ee,{align:"center",direction:"row",children:[t&&m.jsx(vz,{htmlFor:e,children:t}),r&&m.jsxs(mz,{name:o,role:"tooltip",children:[m.jsx(pz,{}),m.jsx("div",{className:"tooltip",children:r})]})]}),m.jsx(gz,{hasContent:!!x,hasError:!!v,isFocused:w,isHovered:C,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:m.jsx(aL,{control:p,...d(o),render:({field:{onBlur:b,onChange:O,value:P,ref:T}})=>{const{disabled:k=gr.disabled,textAlign:_=gr.textAlign}=f;return l?m.jsx(yz,{ref:T,disabled:k,id:e,maxLength:u,onBlur:()=>{$(!1),b()},onChange:O,onFocus:()=>$(!0),placeholder:c,value:P||""}):n?m.jsx(dz,{alwaysShowMask:a,disabled:!1,inputRef:T,mask:n,...d(o),maskPlaceholder:s,onBlur:b,onChange:O,value:P,children:m.jsx(gm,{colorName:"white",disabled:k,...d(o),id:e,onBlur:()=>$(!1),onFocus:()=>$(!0),placeholderTextColor:"inputPlaceholder",textAlign:_})}):m.jsx(mm,{...f,colorName:"white",id:e,...d(o),onBlur:()=>{$(!1),b()},onChange:O,onFocus:()=>$(!0),placeholder:c,placeholderTextColor:"inputPlaceholder",value:P||""})},rules:i})}),v&&m.jsx(ee,{pl:4,pt:8,shrink:1,tabIndex:0,children:m.jsx(ze,{color:"primaryRed",kind:"regularBold",children:m.jsxs(ee,{align:"center",direction:"row",shrink:1,children:[m.jsx(LB,{fontSize:18}),m.jsx(ee,{pl:4,shrink:1,children:v.message})]})})})]})},bz=()=>m.jsxs(ee,{children:[m.jsx(ee,{align:"center",direction:"row",justify:"space-between",mb:18,children:m.jsx(ee,{align:"center",direction:"row",children:m.jsx(xz,{children:"Edit topic"})})}),m.jsx(ee,{mb:12,children:m.jsx(Xa,{id:"cy-topic",maxLength:50,name:"name",placeholder:"Add your topic",rules:{...MO}})})]}),xz=X(ze)` +`,Xa=({id:e,label:t,mask:n="",message:r,name:o,rules:i,showMask:a=!1,maskPlaceholder:s=null,isTextArea:l=!1,placeholder:c="",maxLength:u,...f})=>{const{register:d,control:p,formState:{errors:h},getValues:g}=Sl()||{},v=he(h,o),x=g(o),[w,$]=y.useState(!1),[C,S]=y.useState(!1);return y.useEffect(()=>{const b=document.getElementById(e);b&&b.focus()},[e]),m.jsxs(ee,{shrink:1,children:[m.jsxs(ee,{align:"center",direction:"row",children:[t&&m.jsx(bz,{htmlFor:e,children:t}),r&&m.jsxs(yz,{name:o,role:"tooltip",children:[m.jsx(gz,{}),m.jsx("div",{className:"tooltip",children:r})]})]}),m.jsx(vz,{hasContent:!!x,hasError:!!v,isFocused:w,isHovered:C,onMouseEnter:()=>S(!0),onMouseLeave:()=>S(!1),children:m.jsx(aL,{control:p,...d(o),render:({field:{onBlur:b,onChange:O,value:P,ref:T}})=>{const{disabled:k=gr.disabled,textAlign:_=gr.textAlign}=f;return l?m.jsx(xz,{ref:T,disabled:k,id:e,maxLength:u,onBlur:()=>{$(!1),b()},onChange:O,onFocus:()=>$(!0),placeholder:c,value:P||""}):n?m.jsx(hz,{alwaysShowMask:a,disabled:!1,inputRef:T,mask:n,...d(o),maskPlaceholder:s,onBlur:b,onChange:O,value:P,children:m.jsx(gm,{colorName:"white",disabled:k,...d(o),id:e,onBlur:()=>$(!1),onFocus:()=>$(!0),placeholderTextColor:"inputPlaceholder",textAlign:_})}):m.jsx(mm,{...f,colorName:"white",id:e,...d(o),onBlur:()=>{$(!1),b()},onChange:O,onFocus:()=>$(!0),placeholder:c,placeholderTextColor:"inputPlaceholder",value:P||""})},rules:i})}),v&&m.jsx(ee,{pl:4,pt:8,shrink:1,tabIndex:0,children:m.jsx(ze,{color:"primaryRed",kind:"regularBold",children:m.jsxs(ee,{align:"center",direction:"row",shrink:1,children:[m.jsx(LB,{fontSize:18}),m.jsx(ee,{pl:4,shrink:1,children:v.message})]})})})]})},wz=()=>m.jsxs(ee,{children:[m.jsx(ee,{align:"center",direction:"row",justify:"space-between",mb:18,children:m.jsx(ee,{align:"center",direction:"row",children:m.jsx(Sz,{children:"Edit topic"})})}),m.jsx(ee,{mb:12,children:m.jsx(Xa,{id:"cy-topic",maxLength:50,name:"name",placeholder:"Add your topic",rules:{...MO}})})]}),Sz=X(ze)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,wz=({topic:e,onClose:t})=>{const{close:n}=Nr("editTopic"),[r]=sr(v=>[v.data]),o=Cl({mode:"onChange"}),{watch:i,setValue:a,reset:s,getValues:l}=o,[c,u]=y.useState(!1);y.useEffect(()=>(e&&a("name",e==null?void 0:e.name),()=>{s()}),[e,a,s]);const f=i("name"),d=f==null?void 0:f.trim(),p=()=>{t(),n()},h=async()=>{u(!0);try{if(await Hu((e==null?void 0:e.ref_id)||"",{name:d}),r){const v={...r};v[e==null?void 0:e.ref_id].name=d,sr.setState({data:v})}p()}catch(v){console.warn(v)}finally{u(!1)}},g=l().name&&(e==null?void 0:e.name)!==l().name;return m.jsx(vm,{id:"editTopic",kind:"regular",onClose:p,preventOutsideClose:!0,children:m.jsxs($l,{...o,children:[m.jsx(bz,{}),m.jsxs(_r,{color:"secondary",disabled:c||!d||!g,onClick:h,size:"large",variant:"contained",children:["Save Changes",c&&m.jsx(Sz,{children:m.jsx(Ut,{color:K.lightGray,size:12})})]})]})})},Sz=X.span` +`,$z=({topic:e,onClose:t})=>{const{close:n}=Nr("editTopic"),[r]=sr(v=>[v.data]),o=Cl({mode:"onChange"}),{watch:i,setValue:a,reset:s,getValues:l}=o,[c,u]=y.useState(!1);y.useEffect(()=>(e&&a("name",e==null?void 0:e.name),()=>{s()}),[e,a,s]);const f=i("name"),d=f==null?void 0:f.trim(),p=()=>{t(),n()},h=async()=>{u(!0);try{if(await Uu((e==null?void 0:e.ref_id)||"",{name:d}),r){const v={...r};v[e==null?void 0:e.ref_id].name=d,sr.setState({data:v})}p()}catch(v){console.warn(v)}finally{u(!1)}},g=l().name&&(e==null?void 0:e.name)!==l().name;return m.jsx(vm,{id:"editTopic",kind:"regular",onClose:p,preventOutsideClose:!0,children:m.jsxs($l,{...o,children:[m.jsx(wz,{}),m.jsxs(_r,{color:"secondary",disabled:c||!d||!g,onClick:h,size:"large",variant:"contained",children:["Save Changes",c&&m.jsx(Cz,{children:m.jsx(Ut,{color:K.lightGray,size:12})})]})]})})},Cz=X.span` margin-top: 2px; -`,$z=({topicId:e,onSelect:t,selectedValue:n,dataId:r})=>{const[o,i]=y.useState([]),[a,s]=y.useState(!1),l=y.useMemo(()=>{const p=async h=>{const g={is_muted:"False",sort_by:hm,search:h,skip:"0",limit:"1000"};s(!0);try{const x=(await J2(g.search)).data.filter(w=>(w==null?void 0:w.ref_id)!==e);i(x)}catch{i([])}finally{s(!1)}};return Sg.debounce(p,300)},[e]),c=p=>{if(!p){i([]);return}p.length>2&&l(p)},u=p=>{const h=p?o.find(g=>g.ref_id===p.value):null;t(h||null)},f=p=>({label:p.search_value,value:p.ref_id,type:p.node_type}),d=p=>p.map(f);return n?m.jsxs(ee,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[m.jsx("span",{children:n.search_value}),m.jsx(r$,{onClick:()=>t(null),size:"medium",children:m.jsx(ei,{})})]}):m.jsx(ym,{dataId:r,handleInputChange:c,isLoading:a,onSelect:u,options:d(o)||f$,selectedValue:n?f(n):null})},Cz=({from:e,onSelect:t,selectedToNode:n,isSwapped:r,setIsSwapped:o})=>{var s;const i=e==null?void 0:e.map(l=>l.name).join(", "),a=e&&e.length===1?e[0].name:`${i==null?void 0:i.substring(0,25)} ...`;return m.jsxs(ee,{mb:20,children:[m.jsx(ee,{align:"center",direction:"row",justify:"space-between",mb:18,children:m.jsx(ee,{align:"center",direction:"row",children:m.jsx(Oz,{children:"Merge topic"})})}),m.jsxs(_z,{swap:r,children:[m.jsx(Ez,{children:m.jsx(Tz,{disabled:!0,label:r?"To":"From",swap:r,value:a})}),m.jsxs(ee,{my:16,children:[m.jsx(kz,{children:"Type"}),m.jsx(ze,{children:"IS ALIAS"})]}),m.jsx(ee,{children:m.jsxs(Az,{children:[m.jsx(jz,{children:r?"From":"To"}),m.jsx($z,{dataId:"to-node",onSelect:t,selectedValue:n,topicId:(s=e[e.length-1])==null?void 0:s.ref_id})]})}),m.jsxs(Pz,{children:[m.jsx(Iz,{children:m.jsx(u$,{})}),m.jsx(Mz,{"data-testid":"swap-icon",disabled:(e==null?void 0:e.length)!==1,onClick:(e==null?void 0:e.length)===1?o:void 0,children:m.jsx(c$,{})}),m.jsx(Rz,{children:m.jsx(l$,{})})]})]})]})},Oz=X(ze)` +`,Oz=({topicId:e,onSelect:t,selectedValue:n,dataId:r})=>{const[o,i]=y.useState([]),[a,s]=y.useState(!1),l=y.useMemo(()=>{const p=async h=>{const g={is_muted:"False",sort_by:hm,search:h,skip:"0",limit:"1000"};s(!0);try{const x=(await J2(g.search)).data.filter(w=>(w==null?void 0:w.ref_id)!==e);i(x)}catch{i([])}finally{s(!1)}};return Sg.debounce(p,300)},[e]),c=p=>{if(!p){i([]);return}p.length>2&&l(p)},u=p=>{const h=p?o.find(g=>g.ref_id===p.value):null;t(h||null)},f=p=>({label:p.search_value,value:p.ref_id,type:p.node_type}),d=p=>p.map(f);return n?m.jsxs(ee,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[m.jsx("span",{children:n.search_value}),m.jsx(r$,{onClick:()=>t(null),size:"medium",children:m.jsx(ei,{})})]}):m.jsx(ym,{dataId:r,handleInputChange:c,isLoading:a,onSelect:u,options:d(o)||f$,selectedValue:n?f(n):null})},Ez=({from:e,onSelect:t,selectedToNode:n,isSwapped:r,setIsSwapped:o})=>{var s;const i=e==null?void 0:e.map(l=>l.name).join(", "),a=e&&e.length===1?e[0].name:`${i==null?void 0:i.substring(0,25)} ...`;return m.jsxs(ee,{mb:20,children:[m.jsx(ee,{align:"center",direction:"row",justify:"space-between",mb:18,children:m.jsx(ee,{align:"center",direction:"row",children:m.jsx(Pz,{children:"Merge topic"})})}),m.jsxs(Az,{swap:r,children:[m.jsx(_z,{children:m.jsx(kz,{disabled:!0,label:r?"To":"From",swap:r,value:a})}),m.jsxs(ee,{my:16,children:[m.jsx(Iz,{children:"Type"}),m.jsx(ze,{children:"IS ALIAS"})]}),m.jsx(ee,{children:m.jsxs(jz,{children:[m.jsx(Mz,{children:r?"From":"To"}),m.jsx(Oz,{dataId:"to-node",onSelect:t,selectedValue:n,topicId:(s=e[e.length-1])==null?void 0:s.ref_id})]})}),m.jsxs(Tz,{children:[m.jsx(Rz,{children:m.jsx(u$,{})}),m.jsx(Dz,{"data-testid":"swap-icon",disabled:(e==null?void 0:e.length)!==1,onClick:(e==null?void 0:e.length)===1?o:void 0,children:m.jsx(c$,{})}),m.jsx(Nz,{children:m.jsx(l$,{})})]})]})]})},Pz=X(ze)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,Ez=X(ee)` +`,_z=X(ee)` flex: 1 1 100%; -`,Pz=X.div` +`,Tz=X.div` position: absolute; top: 26px; bottom: 26px; @@ -1233,7 +1233,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho border-top: 1.5px solid #6b7a8d4d; border-bottom: 1.5px solid #6b7a8d4d; border-radius: 12px 0 0 12px; -`,_z=X.div` +`,Az=X.div` position: relative; color: white; font-family: 'Barlow'; @@ -1241,7 +1241,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho flex-direction: ${e=>e.swap?"column-reverse":"column"}; margin-bottom: 10px; padding-left: 38px; -`,Tz=X(Kg)` +`,kz=X(Kg)` position: relative; width: 100%; padding: 16px; @@ -1250,7 +1250,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho border: 1px solid #6b7a8d4d; opacity: 0px; display: flex; -`,Az=X.div` +`,jz=X.div` position: relative; width: 100%; padding: 15px; @@ -1260,7 +1260,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho opacity: 0px; display: flex; align-items: center; -`,kz=X.label` +`,Iz=X.label` color: #bac1c6; font-size: 13px; font-weight: 400; @@ -1268,7 +1268,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho letter-spacing: 0.01em; text-align: left; margin-bottom: 6px; -`,jz=X.label` +`,Mz=X.label` color: #bac1c6; background-color: #23252f; font-size: 13px; @@ -1279,13 +1279,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho position: absolute; left: 15px; top: -10px; -`,Iz=X.div` +`,Rz=X.div` position: absolute; top: 0; right: 0; transform: translateY(-50%) translateX(50%); color: #23252f; -`,Mz=X.div` +`,Dz=X.div` position: absolute; color: transparent; top: 50%; @@ -1299,26 +1299,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho justify-content: center; align-items: center; border-radius: 8px; -`,Rz=X.div` +`,Nz=X.div` position: absolute; bottom: 0; right: 0; transform: translateY(10px) translateX(3px); color: #6b7a8d; line-height: 1; -`,Dz=({onClose:e,multiTopics:t})=>{const{close:n}=Nr("mergeTopic"),r=Cl({mode:"onChange"}),{setValue:o,reset:i}=r,[a,s]=y.useState(!1),[l,c]=y.useState(!1),[u,f]=y.useState(null);y.useEffect(()=>{if(t&&t.length>0){const h=t.map(g=>g.name).join(", ");o("name",h)}return()=>{i()}},[t,o,i]);const d=()=>{e(),n()},p=async()=>{s(!0);const h=t==null?void 0:t.map(g=>g.ref_id).filter(g=>!!g);try{h.length&&u&&(await RO({from:h,to:u==null?void 0:u.ref_id}),sr.setState(g=>({ids:g.ids.filter(v=>!h.includes(v)),total:g.total-h.length})),d())}catch(g){console.warn(g)}finally{s(!1)}};return m.jsx(vm,{id:"mergeTopic",kind:"small",onClose:d,preventOutsideClose:!0,children:m.jsxs($l,{...r,children:[m.jsx(Cz,{from:t,isSwapped:l,onSelect:f,selectedToNode:u,setIsSwapped:()=>c(!l)}),m.jsxs(Nz,{color:"secondary","data-testid":"merge-topics-button",disabled:a||!u,onClick:p,size:"large",variant:"contained",children:["Merge topics",a&&m.jsx(Lz,{children:m.jsx(Ut,{color:K.lightGray,size:12})})]})]})})},Nz=X(_r)` +`,Lz=({onClose:e,multiTopics:t})=>{const{close:n}=Nr("mergeTopic"),r=Cl({mode:"onChange"}),{setValue:o,reset:i}=r,[a,s]=y.useState(!1),[l,c]=y.useState(!1),[u,f]=y.useState(null);y.useEffect(()=>{if(t&&t.length>0){const h=t.map(g=>g.name).join(", ");o("name",h)}return()=>{i()}},[t,o,i]);const d=()=>{e(),n()},p=async()=>{s(!0);const h=t==null?void 0:t.map(g=>g.ref_id).filter(g=>!!g);try{h.length&&u&&(await RO({from:h,to:u==null?void 0:u.ref_id}),sr.setState(g=>({ids:g.ids.filter(v=>!h.includes(v)),total:g.total-h.length})),d())}catch(g){console.warn(g)}finally{s(!1)}};return m.jsx(vm,{id:"mergeTopic",kind:"small",onClose:d,preventOutsideClose:!0,children:m.jsxs($l,{...r,children:[m.jsx(Ez,{from:t,isSwapped:l,onSelect:f,selectedToNode:u,setIsSwapped:()=>c(!l)}),m.jsxs(Bz,{color:"secondary","data-testid":"merge-topics-button",disabled:a||!u,onClick:p,size:"large",variant:"contained",children:["Merge topics",a&&m.jsx(Fz,{children:m.jsx(Ut,{color:K.lightGray,size:12})})]})]})})},Bz=X(_r)` width: 293px !important; margin: 0 0 10px auto !important; -`,Lz=X.span` +`,Fz=X.span` margin-top: 2px; -`,Bz=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M7.37516 8.625V11.3334C7.37516 11.5104 7.43508 11.6589 7.55491 11.7786C7.67476 11.8984 7.82326 11.9583 8.00041 11.9583C8.17758 11.9583 8.32599 11.8984 8.44564 11.7786C8.5653 11.6589 8.62512 11.5104 8.62512 11.3334V8.625H11.3335C11.5106 8.625 11.659 8.56508 11.7788 8.44525C11.8986 8.3254 11.9585 8.1769 11.9585 7.99975C11.9585 7.82258 11.8986 7.67417 11.7788 7.55452C11.659 7.43487 11.5106 7.37504 11.3335 7.37504H8.62512V4.66669C8.62512 4.4896 8.56521 4.34117 8.44537 4.22137C8.32553 4.1016 8.17702 4.04171 7.99987 4.04171C7.82271 4.04171 7.6743 4.1016 7.55464 4.22137C7.43499 4.34117 7.37516 4.4896 7.37516 4.66669V7.37504H4.66681C4.48973 7.37504 4.3413 7.43496 4.22152 7.55479C4.10173 7.67464 4.04183 7.82314 4.04183 8.00029C4.04183 8.17746 4.10173 8.32587 4.22152 8.44552C4.3413 8.56517 4.48973 8.625 4.66681 8.625H7.37516ZM8.00154 15.9167C6.90659 15.9167 5.8774 15.7089 4.91395 15.2933C3.9505 14.8778 3.11243 14.3138 2.39975 13.6015C1.68705 12.8891 1.12284 12.0514 0.7071 11.0884C0.291364 10.1253 0.0834961 9.09636 0.0834961 8.00142C0.0834961 6.90647 0.291274 5.87728 0.70683 4.91383C1.12239 3.95037 1.68634 3.11231 2.3987 2.39963C3.11108 1.68693 3.94878 1.12272 4.91181 0.706979C5.87482 0.291243 6.9038 0.083374 7.99875 0.083374C9.09369 0.083374 10.1229 0.291153 11.0863 0.706708C12.0498 1.12226 12.8879 1.68622 13.6005 2.39858C14.3132 3.11096 14.8774 3.94866 15.2932 4.91169C15.7089 5.8747 15.9168 6.90368 15.9168 7.99863C15.9168 9.09357 15.709 10.1228 15.2935 11.0862C14.8779 12.0497 14.3139 12.8877 13.6016 13.6004C12.8892 14.3131 12.0515 14.8773 11.0885 15.2931C10.1255 15.7088 9.09648 15.9167 8.00154 15.9167ZM8.00014 14.6667C9.86125 14.6667 11.4376 14.0209 12.7293 12.7292C14.021 11.4375 14.6668 9.86113 14.6668 8.00002C14.6668 6.13891 14.021 4.56252 12.7293 3.27085C11.4376 1.97919 9.86125 1.33335 8.00014 1.33335C6.13903 1.33335 4.56264 1.97919 3.27098 3.27085C1.97931 4.56252 1.33348 6.13891 1.33348 8.00002C1.33348 9.86113 1.97931 11.4375 3.27098 12.7292C4.56264 14.0209 6.13903 14.6667 8.00014 14.6667Z",fill:"currentColor"})}),y$=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 7",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M3.08467 5.34482L8.02842 0.401074C8.14508 0.284408 8.28363 0.226074 8.44404 0.226074C8.60446 0.226074 8.743 0.284408 8.85967 0.401074C8.97633 0.517741 9.03467 0.656283 9.03467 0.816699C9.03467 0.977116 8.97633 1.11566 8.85967 1.23232L3.493 6.59899C3.37633 6.71566 3.24022 6.77399 3.08467 6.77399C2.92911 6.77399 2.793 6.71566 2.67633 6.59899L0.168 4.09066C0.0513333 3.97399 -0.00456944 3.83545 0.000291667 3.67503C0.00515278 3.51462 0.0659167 3.37607 0.182583 3.25941C0.29925 3.14274 0.437792 3.08441 0.598208 3.08441C0.758625 3.08441 0.897167 3.14274 1.01383 3.25941L3.08467 5.34482Z",fill:"currentColor"})}),Fz=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.1765 0.310088L4.72809 5.70971C4.63832 5.79868 4.56637 5.90372 4.51607 6.01926L3.74627 7.78746C3.63822 8.03565 3.89191 8.28707 4.14234 8.17999L5.92651 7.41707C6.04309 7.36722 6.14907 7.29592 6.23885 7.20695L11.6872 1.80733C12.1044 1.39388 12.1044 0.723539 11.6872 0.310088C11.27 -0.103363 10.5936 -0.103363 10.1765 0.310088ZM9.80835 7.14088C9.80835 6.81895 10.072 6.55777 10.3969 6.55777C10.723 6.55777 10.9854 6.82017 10.9854 7.14088L10.9191 10.2508C10.9191 11.2153 10.1489 12.0001 9.17571 12.0001H1.74343C0.79227 12.0001 0 11.2153 0 10.2289V2.84292C0 1.89999 0.79227 1.11523 1.74343 1.11523L5.29651 1.11548C5.62264 1.11548 5.88501 1.37666 5.88501 1.69858C5.88501 2.0205 5.62141 2.28168 5.29651 2.28168H1.7655C1.44134 2.28168 1.177 2.54335 1.177 2.86479V10.2508C1.177 10.5722 1.44134 10.8339 1.7655 10.8339H9.21985C9.54402 10.8339 9.80835 10.5722 9.80835 10.2508V7.14088Z",fill:"currentColor"})}),cy=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M1.33317 15.5L0.166504 14.3333L4.18734 10.2917C4.50678 9.97222 4.74984 9.61111 4.9165 9.20833C5.08317 8.80556 5.1665 8.38194 5.1665 7.9375L5.1665 3.6875L3.83317 5L2.6665 3.83333L5.99984 0.5L9.33317 3.83333L8.1665 5L6.83317 3.6875L6.83317 7.9375C6.83317 8.38194 6.9165 8.80556 7.08317 9.20833C7.24984 9.61111 7.49289 9.97222 7.81234 10.2917L11.8332 14.3333L10.6665 15.5L5.99984 10.8333L1.33317 15.5Z",fill:"currentColor"})}),Wd=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 12 8",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M0.333496 7.66704V6.66706H3.91681V7.66704H0.333496ZM0.333496 4.50037V3.50041H7.7886V4.50037H0.333496ZM0.333496 1.33372V0.33374H11.6668V1.33372H0.333496Z",fill:"currentColor"})}),uy=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M14.0716 15L10.8994 11.7764C10.437 11.9597 9.96181 12.0919 9.47381 12.1732C8.98581 12.2545 8.49002 12.2952 7.98643 12.2952C6.33597 12.2952 4.82448 11.8457 3.45194 10.9466C2.07941 10.0476 0.991584 8.86271 0.188459 7.39193C0.123124 7.27666 0.0753836 7.15933 0.045238 7.03994C0.0150793 6.92055 0 6.7991 0 6.67559C0 6.55208 0.0163338 6.42935 0.0490013 6.30739C0.0816688 6.18543 0.13067 6.06938 0.196005 5.95925C0.508607 5.42714 0.84081 4.91226 1.19261 4.41462C1.54443 3.91699 1.95353 3.47673 2.41992 3.09386L0.24877 0.846015L1.07501 0L14.8978 14.154L14.0716 15ZM7.98643 9.94854C8.16032 9.94854 8.32642 9.93799 8.48473 9.91689C8.64305 9.89579 8.7976 9.84973 8.94838 9.77871L4.95591 5.69059C4.89158 5.84498 4.84786 6.00324 4.82475 6.16535C4.80162 6.32745 4.79005 6.49753 4.79005 6.67559C4.79005 7.58645 5.10039 8.35966 5.72108 8.99521C6.34176 9.63076 7.09688 9.94854 7.98643 9.94854ZM13.4384 10.3561L10.9792 7.85816C11.0456 7.66673 11.0961 7.47375 11.1308 7.27922C11.1655 7.0847 11.1828 6.88349 11.1828 6.67559C11.1828 5.76473 10.8725 4.99152 10.2518 4.35597C9.63109 3.72042 8.87598 3.40264 7.98643 3.40264C7.78339 3.40264 7.58689 3.42168 7.39692 3.45976C7.20694 3.49784 7.02099 3.56011 6.83907 3.64657L4.87751 1.64575C5.37606 1.44402 5.88441 1.29529 6.40257 1.19957C6.92071 1.10385 7.44867 1.05599 7.98643 1.05599C9.64191 1.05599 11.1604 1.50756 12.542 2.41072C13.9236 3.31387 15.0134 4.50598 15.8115 5.98705C15.8718 6.08894 15.9183 6.19829 15.951 6.31511C15.9837 6.43192 16 6.55208 16 6.67559C16 6.7991 15.9857 6.91926 15.957 7.03607C15.9284 7.15289 15.8839 7.26225 15.8236 7.36414C15.52 7.94669 15.1738 8.49038 14.7848 8.99521C14.3958 9.50005 13.947 9.95369 13.4384 10.3561ZM10.0912 6.95657L7.73162 4.54816C8.06131 4.48126 8.38246 4.50545 8.69506 4.62072C9.00767 4.736 9.27754 4.9156 9.5047 5.15952C9.7369 5.40036 9.90451 5.67723 10.0075 5.99012C10.1106 6.30301 10.1385 6.62516 10.0912 6.95657Z",fill:"currentColor"})}),fy=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 13",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M9.00204 9.98073C9.94628 9.98073 10.7483 9.65024 11.408 8.98927C12.0677 8.32829 12.3976 7.52567 12.3976 6.58142C12.3976 5.63718 12.0671 4.8352 11.4061 4.17548C10.7451 3.51576 9.9425 3.1859 8.99825 3.1859C8.05401 3.1859 7.25203 3.51638 6.59231 4.17735C5.93259 4.83834 5.60273 5.64096 5.60273 6.58521C5.60273 7.52944 5.93321 8.33142 6.59419 8.99115C7.25517 9.65087 8.05779 9.98073 9.00204 9.98073ZM9.00014 8.83331C8.37514 8.83331 7.84389 8.61456 7.40639 8.17706C6.96889 7.73956 6.75014 7.20831 6.75014 6.58331C6.75014 5.95831 6.96889 5.42706 7.40639 4.98956C7.84389 4.55206 8.37514 4.33331 9.00014 4.33331C9.62514 4.33331 10.1564 4.55206 10.5939 4.98956C11.0314 5.42706 11.2501 5.95831 11.2501 6.58331C11.2501 7.20831 11.0314 7.73956 10.5939 8.17706C10.1564 8.61456 9.62514 8.83331 9.00014 8.83331ZM9.00129 12.4166C7.08494 12.4166 5.33884 11.888 3.76298 10.8309C2.18713 9.77374 1.02688 8.35788 0.282227 6.58331C1.02688 4.80874 2.18675 3.39288 3.76185 2.33573C5.33694 1.27858 7.08265 0.75 8.999 0.75C10.9153 0.75 12.6614 1.27858 14.2373 2.33573C15.8132 3.39288 16.9734 4.80874 17.7181 6.58331C16.9734 8.35788 15.8135 9.77374 14.2384 10.8309C12.6634 11.888 10.9176 12.4166 9.00129 12.4166Z",fill:"currentColor"})}),zz=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsxs("g",{opacity:"0.4",children:[m.jsx("mask",{id:"mask0_5162_13105",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:m.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{mask:"url(#mask0_5162_13105)",children:m.jsx("path",{d:"M19.7615 21.8691L15.7154 17.8537C15.1256 18.0819 14.5195 18.2467 13.8971 18.348C13.2747 18.4493 12.6423 18.4999 12 18.4999C9.89486 18.4999 7.96698 17.94 6.21635 16.8201C4.46572 15.7002 3.07822 14.2243 2.05385 12.3922C1.97052 12.2486 1.90963 12.1025 1.87118 11.9538C1.83271 11.8051 1.81348 11.6538 1.81348 11.4999C1.81348 11.3461 1.83431 11.1932 1.87598 11.0413C1.91764 10.8894 1.98014 10.7448 2.06348 10.6076C2.46219 9.9448 2.88591 9.30345 3.33463 8.68357C3.78336 8.0637 4.30516 7.51531 4.90003 7.0384L2.13078 4.2384L3.18463 3.18457L20.8153 20.8153L19.7615 21.8691ZM12 15.5768C12.2218 15.5768 12.4336 15.5637 12.6356 15.5374C12.8375 15.5111 13.0346 15.4537 13.2269 15.3653L8.13463 10.273C8.05258 10.4653 7.99681 10.6624 7.96733 10.8643C7.93783 11.0663 7.92308 11.2781 7.92308 11.4999C7.92308 12.6345 8.31891 13.5977 9.11058 14.3893C9.90224 15.181 10.8654 15.5768 12 15.5768ZM18.9538 16.0845L15.8173 12.973C15.9019 12.7345 15.9663 12.4941 16.0105 12.2518C16.0548 12.0095 16.0769 11.7589 16.0769 11.4999C16.0769 10.3653 15.681 9.40219 14.8894 8.61052C14.0977 7.81885 13.1346 7.42302 12 7.42302C11.741 7.42302 11.4904 7.44674 11.2481 7.49417C11.0058 7.5416 10.7686 7.61917 10.5366 7.72687L8.03463 5.23457C8.67051 4.98329 9.3189 4.79803 9.9798 4.6788C10.6407 4.55956 11.3141 4.49995 12 4.49995C14.1115 4.49995 16.0484 5.06245 17.8105 6.18745C19.5727 7.31245 20.9628 8.79738 21.9807 10.6422C22.0576 10.7692 22.1169 10.9054 22.1586 11.0509C22.2003 11.1964 22.2211 11.3461 22.2211 11.4999C22.2211 11.6538 22.2028 11.8034 22.1663 11.9489C22.1297 12.0945 22.073 12.2307 21.9961 12.3576C21.6089 13.0832 21.1673 13.7605 20.6711 14.3893C20.175 15.0182 19.6025 15.5832 18.9538 16.0845ZM14.6846 11.8499L11.675 8.84992C12.0955 8.76659 12.5051 8.79671 12.9038 8.9403C13.3025 9.0839 13.6468 9.30761 13.9365 9.61145C14.2327 9.91145 14.4465 10.2563 14.5779 10.6461C14.7093 11.0358 14.7449 11.4371 14.6846 11.8499Z",fill:"currentColor"})})]})}),Wz=e=>m.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("mask",{id:"mask0_5162_13106",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:m.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{mask:"url(#mask0_5162_13106)",children:m.jsx("path",{d:"M12.0023 15.5769C13.1354 15.5769 14.0978 15.1803 14.8895 14.3871C15.6811 13.5939 16.077 12.6308 16.077 11.4977C16.077 10.3646 15.6804 9.40224 14.8872 8.61058C14.094 7.81891 13.1309 7.42308 11.9978 7.42308C10.8647 7.42308 9.90234 7.81966 9.11067 8.61282C8.31901 9.40601 7.92317 10.3692 7.92317 11.5023C7.92317 12.6353 8.31976 13.5977 9.11293 14.3894C9.90611 15.181 10.8692 15.5769 12.0023 15.5769ZM12.0001 14.2C11.2501 14.2 10.6126 13.9375 10.0876 13.4125C9.56258 12.8875 9.30007 12.25 9.30007 11.5C9.30007 10.75 9.56258 10.1125 10.0876 9.58748C10.6126 9.06248 11.2501 8.79998 12.0001 8.79998C12.7501 8.79998 13.3876 9.06248 13.9126 9.58748C14.4376 10.1125 14.7001 10.75 14.7001 11.5C14.7001 12.25 14.4376 12.8875 13.9126 13.4125C13.3876 13.9375 12.7501 14.2 12.0001 14.2ZM12.0014 18.5C9.70183 18.5 7.60651 17.8657 5.71547 16.5971C3.82446 15.3285 2.43216 13.6295 1.53857 11.5C2.43216 9.37049 3.82401 7.67146 5.71412 6.40288C7.60422 5.13429 9.69908 4.5 11.9987 4.5C14.2983 4.5 16.3936 5.13429 18.2847 6.40288C20.1757 7.67146 21.568 9.37049 22.4616 11.5C21.568 13.6295 20.1761 15.3285 18.286 16.5971C16.3959 17.8657 14.3011 18.5 12.0014 18.5Z",fill:"currentColor"})})]}),Vz=e=>m.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 22 22",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("mask",{id:"mask0_5577_416",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"22",height:"22",children:m.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{mask:"url(#mask0_5577_416)",children:m.jsx("path",{d:"M11 17.6634C10.6219 17.6634 10.2982 17.5287 10.0289 17.2595C9.75964 16.9902 9.625 16.6665 9.625 16.2884C9.625 15.9103 9.75964 15.5866 10.0289 15.3173C10.2982 15.0481 10.6219 14.9134 11 14.9134C11.3781 14.9134 11.7018 15.0481 11.971 15.3173C12.2403 15.5866 12.375 15.9103 12.375 16.2884C12.375 16.6665 12.2403 16.9902 11.971 17.2595C11.7018 17.5287 11.3781 17.6634 11 17.6634ZM11 12.3749C10.6219 12.3749 10.2982 12.2403 10.0289 11.971C9.75964 11.7018 9.625 11.3781 9.625 11C9.625 10.6218 9.75964 10.2982 10.0289 10.0289C10.2982 9.75962 10.6219 9.62498 11 9.62498C11.3781 9.62498 11.7018 9.75962 11.971 10.0289C12.2403 10.2982 12.375 10.6218 12.375 11C12.375 11.3781 12.2403 11.7018 11.971 11.971C11.7018 12.2403 11.3781 12.3749 11 12.3749ZM11 7.08648C10.6219 7.08648 10.2982 6.95184 10.0289 6.68257C9.75964 6.41332 9.625 6.08963 9.625 5.7115C9.625 5.33339 9.75964 5.0097 10.0289 4.74043C10.2982 4.47118 10.6219 4.33655 11 4.33655C11.3781 4.33655 11.7018 4.47118 11.971 4.74043C12.2403 5.0097 12.375 5.33339 12.375 5.7115C12.375 6.08963 12.2403 6.41332 11.971 6.68257C11.7018 6.95184 11.3781 7.08648 11 7.08648Z",fill:"currentColor"})})]}),Hz=({topic:e,onClick:t,onSearch:n,checkedStates:r,setCheckedStates:o,isMuteDisabled:i})=>{const[a,s]=sr(P=>[P.ids,P.total]),[l,c]=y.useState(!1),[u,f]=y.useState(!1),d=Ip(e.date_added_to_graph),p=async(P,T)=>{c(!0);try{await Hu(P,{is_muted:T}),sr.setState({ids:a.filter(k=>k!==P),total:s-1})}catch(k){console.warn(k)}},h=P=>{o(T=>({...T,[P]:!T[P]}))},g=(P,T)=>{var k;(k=window.getSelection())!=null&&k.toString()?P.preventDefault():n(T.name)},v=e.edgeList.slice(0,1),x=e.edgeList.length-v.length,[w,$]=E.useState(null),C=P=>{$(P.currentTarget),f(!0)},S=()=>{f(!1)},b=!!w&&u,O=r[e.ref_id]?"visible":"";return m.jsxs(hf,{className:r[e.ref_id]?"checked":"",children:[m.jsx(Re,{children:m.jsx(Kz,{className:`checkbox-section ${O}`,"data-testid":"topic-check-box",onClick:()=>h(e.ref_id),children:m.jsx(qz,{checked:r[e.ref_id],children:m.jsx(Xz,{children:r[e.ref_id]&&m.jsx(y$,{})})})})}),m.jsx(Re,{onClick:P=>g(P,e),children:m.jsx(Gz,{children:e.name})}),m.jsx(Re,{children:e.node_type}),m.jsx(Re,{children:m.jsx(Yz,{children:e.edgeCount})}),m.jsxs(Re,{children:[m.jsx(of,{anchorEl:w,anchorOrigin:{vertical:"top",horizontal:"center"},disableRestoreFocus:!0,id:"mouse-over-popover",onClose:S,onMouseEnter:()=>f(!0),onMouseLeave:S,open:b,sx:{pointerEvents:"auto","& .MuiPaper-root":{backgroundColor:"rgba(0, 0, 0, 0.9)",borderRadius:"4px",width:"160px",maxHeight:"200px",overflowY:"scroll"}},transformOrigin:{vertical:"bottom",horizontal:"center"},children:m.jsx(Rv,{sx:{p:1.5,fontSize:"13px",fontWeight:400,lineHeight:"1.8",wordWrap:"break-word"},children:e.edgeList.join(", ")})}),v.join(", "),x>0&&m.jsx(Rv,{"aria-haspopup":"true","aria-owns":b?"mouse-over-popover":void 0,component:"span",onMouseEnter:C,onMouseLeave:S,sx:{cursor:"pointer"},children:",..."})]}),m.jsx(Re,{children:m.jsx("span",{children:d})}),m.jsx(Re,{className:"cell-center",children:m.jsx(ee,{direction:"row",justify:"space-between",children:m.jsx("div",{className:"approve-wrapper",children:l?m.jsx(Uz,{children:m.jsx(Ut,{color:K.white,size:16})}):m.jsxs(ee,{direction:"row",children:[e.is_muted?m.jsx(yr,{className:"centered",disabled:i,onClick:()=>p(e.ref_id,!1),children:m.jsx(Wz,{})}):m.jsx(yr,{className:"centered",disabled:i,onClick:()=>p(e.ref_id,!0),children:m.jsx(zz,{})}),m.jsx(yr,{disabled:i,onClick:P=>t(P,e.ref_id),children:m.jsx(Vz,{"data-testid":"ThreeDotsIcons"})})]})})})})]},e.name)},Uz=X.span` +`,zz=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M7.37516 8.625V11.3334C7.37516 11.5104 7.43508 11.6589 7.55491 11.7786C7.67476 11.8984 7.82326 11.9583 8.00041 11.9583C8.17758 11.9583 8.32599 11.8984 8.44564 11.7786C8.5653 11.6589 8.62512 11.5104 8.62512 11.3334V8.625H11.3335C11.5106 8.625 11.659 8.56508 11.7788 8.44525C11.8986 8.3254 11.9585 8.1769 11.9585 7.99975C11.9585 7.82258 11.8986 7.67417 11.7788 7.55452C11.659 7.43487 11.5106 7.37504 11.3335 7.37504H8.62512V4.66669C8.62512 4.4896 8.56521 4.34117 8.44537 4.22137C8.32553 4.1016 8.17702 4.04171 7.99987 4.04171C7.82271 4.04171 7.6743 4.1016 7.55464 4.22137C7.43499 4.34117 7.37516 4.4896 7.37516 4.66669V7.37504H4.66681C4.48973 7.37504 4.3413 7.43496 4.22152 7.55479C4.10173 7.67464 4.04183 7.82314 4.04183 8.00029C4.04183 8.17746 4.10173 8.32587 4.22152 8.44552C4.3413 8.56517 4.48973 8.625 4.66681 8.625H7.37516ZM8.00154 15.9167C6.90659 15.9167 5.8774 15.7089 4.91395 15.2933C3.9505 14.8778 3.11243 14.3138 2.39975 13.6015C1.68705 12.8891 1.12284 12.0514 0.7071 11.0884C0.291364 10.1253 0.0834961 9.09636 0.0834961 8.00142C0.0834961 6.90647 0.291274 5.87728 0.70683 4.91383C1.12239 3.95037 1.68634 3.11231 2.3987 2.39963C3.11108 1.68693 3.94878 1.12272 4.91181 0.706979C5.87482 0.291243 6.9038 0.083374 7.99875 0.083374C9.09369 0.083374 10.1229 0.291153 11.0863 0.706708C12.0498 1.12226 12.8879 1.68622 13.6005 2.39858C14.3132 3.11096 14.8774 3.94866 15.2932 4.91169C15.7089 5.8747 15.9168 6.90368 15.9168 7.99863C15.9168 9.09357 15.709 10.1228 15.2935 11.0862C14.8779 12.0497 14.3139 12.8877 13.6016 13.6004C12.8892 14.3131 12.0515 14.8773 11.0885 15.2931C10.1255 15.7088 9.09648 15.9167 8.00154 15.9167ZM8.00014 14.6667C9.86125 14.6667 11.4376 14.0209 12.7293 12.7292C14.021 11.4375 14.6668 9.86113 14.6668 8.00002C14.6668 6.13891 14.021 4.56252 12.7293 3.27085C11.4376 1.97919 9.86125 1.33335 8.00014 1.33335C6.13903 1.33335 4.56264 1.97919 3.27098 3.27085C1.97931 4.56252 1.33348 6.13891 1.33348 8.00002C1.33348 9.86113 1.97931 11.4375 3.27098 12.7292C4.56264 14.0209 6.13903 14.6667 8.00014 14.6667Z",fill:"currentColor"})}),y$=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 10 7",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M3.08467 5.34482L8.02842 0.401074C8.14508 0.284408 8.28363 0.226074 8.44404 0.226074C8.60446 0.226074 8.743 0.284408 8.85967 0.401074C8.97633 0.517741 9.03467 0.656283 9.03467 0.816699C9.03467 0.977116 8.97633 1.11566 8.85967 1.23232L3.493 6.59899C3.37633 6.71566 3.24022 6.77399 3.08467 6.77399C2.92911 6.77399 2.793 6.71566 2.67633 6.59899L0.168 4.09066C0.0513333 3.97399 -0.00456944 3.83545 0.000291667 3.67503C0.00515278 3.51462 0.0659167 3.37607 0.182583 3.25941C0.29925 3.14274 0.437792 3.08441 0.598208 3.08441C0.758625 3.08441 0.897167 3.14274 1.01383 3.25941L3.08467 5.34482Z",fill:"currentColor"})}),Wz=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M10.1765 0.310088L4.72809 5.70971C4.63832 5.79868 4.56637 5.90372 4.51607 6.01926L3.74627 7.78746C3.63822 8.03565 3.89191 8.28707 4.14234 8.17999L5.92651 7.41707C6.04309 7.36722 6.14907 7.29592 6.23885 7.20695L11.6872 1.80733C12.1044 1.39388 12.1044 0.723539 11.6872 0.310088C11.27 -0.103363 10.5936 -0.103363 10.1765 0.310088ZM9.80835 7.14088C9.80835 6.81895 10.072 6.55777 10.3969 6.55777C10.723 6.55777 10.9854 6.82017 10.9854 7.14088L10.9191 10.2508C10.9191 11.2153 10.1489 12.0001 9.17571 12.0001H1.74343C0.79227 12.0001 0 11.2153 0 10.2289V2.84292C0 1.89999 0.79227 1.11523 1.74343 1.11523L5.29651 1.11548C5.62264 1.11548 5.88501 1.37666 5.88501 1.69858C5.88501 2.0205 5.62141 2.28168 5.29651 2.28168H1.7655C1.44134 2.28168 1.177 2.54335 1.177 2.86479V10.2508C1.177 10.5722 1.44134 10.8339 1.7655 10.8339H9.21985C9.54402 10.8339 9.80835 10.5722 9.80835 10.2508V7.14088Z",fill:"currentColor"})}),cy=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 12 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M1.33317 15.5L0.166504 14.3333L4.18734 10.2917C4.50678 9.97222 4.74984 9.61111 4.9165 9.20833C5.08317 8.80556 5.1665 8.38194 5.1665 7.9375L5.1665 3.6875L3.83317 5L2.6665 3.83333L5.99984 0.5L9.33317 3.83333L8.1665 5L6.83317 3.6875L6.83317 7.9375C6.83317 8.38194 6.9165 8.80556 7.08317 9.20833C7.24984 9.61111 7.49289 9.97222 7.81234 10.2917L11.8332 14.3333L10.6665 15.5L5.99984 10.8333L1.33317 15.5Z",fill:"currentColor"})}),Vd=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 12 8",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M0.333496 7.66704V6.66706H3.91681V7.66704H0.333496ZM0.333496 4.50037V3.50041H7.7886V4.50037H0.333496ZM0.333496 1.33372V0.33374H11.6668V1.33372H0.333496Z",fill:"currentColor"})}),uy=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 15",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M14.0716 15L10.8994 11.7764C10.437 11.9597 9.96181 12.0919 9.47381 12.1732C8.98581 12.2545 8.49002 12.2952 7.98643 12.2952C6.33597 12.2952 4.82448 11.8457 3.45194 10.9466C2.07941 10.0476 0.991584 8.86271 0.188459 7.39193C0.123124 7.27666 0.0753836 7.15933 0.045238 7.03994C0.0150793 6.92055 0 6.7991 0 6.67559C0 6.55208 0.0163338 6.42935 0.0490013 6.30739C0.0816688 6.18543 0.13067 6.06938 0.196005 5.95925C0.508607 5.42714 0.84081 4.91226 1.19261 4.41462C1.54443 3.91699 1.95353 3.47673 2.41992 3.09386L0.24877 0.846015L1.07501 0L14.8978 14.154L14.0716 15ZM7.98643 9.94854C8.16032 9.94854 8.32642 9.93799 8.48473 9.91689C8.64305 9.89579 8.7976 9.84973 8.94838 9.77871L4.95591 5.69059C4.89158 5.84498 4.84786 6.00324 4.82475 6.16535C4.80162 6.32745 4.79005 6.49753 4.79005 6.67559C4.79005 7.58645 5.10039 8.35966 5.72108 8.99521C6.34176 9.63076 7.09688 9.94854 7.98643 9.94854ZM13.4384 10.3561L10.9792 7.85816C11.0456 7.66673 11.0961 7.47375 11.1308 7.27922C11.1655 7.0847 11.1828 6.88349 11.1828 6.67559C11.1828 5.76473 10.8725 4.99152 10.2518 4.35597C9.63109 3.72042 8.87598 3.40264 7.98643 3.40264C7.78339 3.40264 7.58689 3.42168 7.39692 3.45976C7.20694 3.49784 7.02099 3.56011 6.83907 3.64657L4.87751 1.64575C5.37606 1.44402 5.88441 1.29529 6.40257 1.19957C6.92071 1.10385 7.44867 1.05599 7.98643 1.05599C9.64191 1.05599 11.1604 1.50756 12.542 2.41072C13.9236 3.31387 15.0134 4.50598 15.8115 5.98705C15.8718 6.08894 15.9183 6.19829 15.951 6.31511C15.9837 6.43192 16 6.55208 16 6.67559C16 6.7991 15.9857 6.91926 15.957 7.03607C15.9284 7.15289 15.8839 7.26225 15.8236 7.36414C15.52 7.94669 15.1738 8.49038 14.7848 8.99521C14.3958 9.50005 13.947 9.95369 13.4384 10.3561ZM10.0912 6.95657L7.73162 4.54816C8.06131 4.48126 8.38246 4.50545 8.69506 4.62072C9.00767 4.736 9.27754 4.9156 9.5047 5.15952C9.7369 5.40036 9.90451 5.67723 10.0075 5.99012C10.1106 6.30301 10.1385 6.62516 10.0912 6.95657Z",fill:"currentColor"})}),fy=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 13",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M9.00204 9.98073C9.94628 9.98073 10.7483 9.65024 11.408 8.98927C12.0677 8.32829 12.3976 7.52567 12.3976 6.58142C12.3976 5.63718 12.0671 4.8352 11.4061 4.17548C10.7451 3.51576 9.9425 3.1859 8.99825 3.1859C8.05401 3.1859 7.25203 3.51638 6.59231 4.17735C5.93259 4.83834 5.60273 5.64096 5.60273 6.58521C5.60273 7.52944 5.93321 8.33142 6.59419 8.99115C7.25517 9.65087 8.05779 9.98073 9.00204 9.98073ZM9.00014 8.83331C8.37514 8.83331 7.84389 8.61456 7.40639 8.17706C6.96889 7.73956 6.75014 7.20831 6.75014 6.58331C6.75014 5.95831 6.96889 5.42706 7.40639 4.98956C7.84389 4.55206 8.37514 4.33331 9.00014 4.33331C9.62514 4.33331 10.1564 4.55206 10.5939 4.98956C11.0314 5.42706 11.2501 5.95831 11.2501 6.58331C11.2501 7.20831 11.0314 7.73956 10.5939 8.17706C10.1564 8.61456 9.62514 8.83331 9.00014 8.83331ZM9.00129 12.4166C7.08494 12.4166 5.33884 11.888 3.76298 10.8309C2.18713 9.77374 1.02688 8.35788 0.282227 6.58331C1.02688 4.80874 2.18675 3.39288 3.76185 2.33573C5.33694 1.27858 7.08265 0.75 8.999 0.75C10.9153 0.75 12.6614 1.27858 14.2373 2.33573C15.8132 3.39288 16.9734 4.80874 17.7181 6.58331C16.9734 8.35788 15.8135 9.77374 14.2384 10.8309C12.6634 11.888 10.9176 12.4166 9.00129 12.4166Z",fill:"currentColor"})}),Vz=e=>m.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:m.jsxs("g",{opacity:"0.4",children:[m.jsx("mask",{id:"mask0_5162_13105",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:m.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{mask:"url(#mask0_5162_13105)",children:m.jsx("path",{d:"M19.7615 21.8691L15.7154 17.8537C15.1256 18.0819 14.5195 18.2467 13.8971 18.348C13.2747 18.4493 12.6423 18.4999 12 18.4999C9.89486 18.4999 7.96698 17.94 6.21635 16.8201C4.46572 15.7002 3.07822 14.2243 2.05385 12.3922C1.97052 12.2486 1.90963 12.1025 1.87118 11.9538C1.83271 11.8051 1.81348 11.6538 1.81348 11.4999C1.81348 11.3461 1.83431 11.1932 1.87598 11.0413C1.91764 10.8894 1.98014 10.7448 2.06348 10.6076C2.46219 9.9448 2.88591 9.30345 3.33463 8.68357C3.78336 8.0637 4.30516 7.51531 4.90003 7.0384L2.13078 4.2384L3.18463 3.18457L20.8153 20.8153L19.7615 21.8691ZM12 15.5768C12.2218 15.5768 12.4336 15.5637 12.6356 15.5374C12.8375 15.5111 13.0346 15.4537 13.2269 15.3653L8.13463 10.273C8.05258 10.4653 7.99681 10.6624 7.96733 10.8643C7.93783 11.0663 7.92308 11.2781 7.92308 11.4999C7.92308 12.6345 8.31891 13.5977 9.11058 14.3893C9.90224 15.181 10.8654 15.5768 12 15.5768ZM18.9538 16.0845L15.8173 12.973C15.9019 12.7345 15.9663 12.4941 16.0105 12.2518C16.0548 12.0095 16.0769 11.7589 16.0769 11.4999C16.0769 10.3653 15.681 9.40219 14.8894 8.61052C14.0977 7.81885 13.1346 7.42302 12 7.42302C11.741 7.42302 11.4904 7.44674 11.2481 7.49417C11.0058 7.5416 10.7686 7.61917 10.5366 7.72687L8.03463 5.23457C8.67051 4.98329 9.3189 4.79803 9.9798 4.6788C10.6407 4.55956 11.3141 4.49995 12 4.49995C14.1115 4.49995 16.0484 5.06245 17.8105 6.18745C19.5727 7.31245 20.9628 8.79738 21.9807 10.6422C22.0576 10.7692 22.1169 10.9054 22.1586 11.0509C22.2003 11.1964 22.2211 11.3461 22.2211 11.4999C22.2211 11.6538 22.2028 11.8034 22.1663 11.9489C22.1297 12.0945 22.073 12.2307 21.9961 12.3576C21.6089 13.0832 21.1673 13.7605 20.6711 14.3893C20.175 15.0182 19.6025 15.5832 18.9538 16.0845ZM14.6846 11.8499L11.675 8.84992C12.0955 8.76659 12.5051 8.79671 12.9038 8.9403C13.3025 9.0839 13.6468 9.30761 13.9365 9.61145C14.2327 9.91145 14.4465 10.2563 14.5779 10.6461C14.7093 11.0358 14.7449 11.4371 14.6846 11.8499Z",fill:"currentColor"})})]})}),Hz=e=>m.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("mask",{id:"mask0_5162_13106",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:m.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{mask:"url(#mask0_5162_13106)",children:m.jsx("path",{d:"M12.0023 15.5769C13.1354 15.5769 14.0978 15.1803 14.8895 14.3871C15.6811 13.5939 16.077 12.6308 16.077 11.4977C16.077 10.3646 15.6804 9.40224 14.8872 8.61058C14.094 7.81891 13.1309 7.42308 11.9978 7.42308C10.8647 7.42308 9.90234 7.81966 9.11067 8.61282C8.31901 9.40601 7.92317 10.3692 7.92317 11.5023C7.92317 12.6353 8.31976 13.5977 9.11293 14.3894C9.90611 15.181 10.8692 15.5769 12.0023 15.5769ZM12.0001 14.2C11.2501 14.2 10.6126 13.9375 10.0876 13.4125C9.56258 12.8875 9.30007 12.25 9.30007 11.5C9.30007 10.75 9.56258 10.1125 10.0876 9.58748C10.6126 9.06248 11.2501 8.79998 12.0001 8.79998C12.7501 8.79998 13.3876 9.06248 13.9126 9.58748C14.4376 10.1125 14.7001 10.75 14.7001 11.5C14.7001 12.25 14.4376 12.8875 13.9126 13.4125C13.3876 13.9375 12.7501 14.2 12.0001 14.2ZM12.0014 18.5C9.70183 18.5 7.60651 17.8657 5.71547 16.5971C3.82446 15.3285 2.43216 13.6295 1.53857 11.5C2.43216 9.37049 3.82401 7.67146 5.71412 6.40288C7.60422 5.13429 9.69908 4.5 11.9987 4.5C14.2983 4.5 16.3936 5.13429 18.2847 6.40288C20.1757 7.67146 21.568 9.37049 22.4616 11.5C21.568 13.6295 20.1761 15.3285 18.286 16.5971C16.3959 17.8657 14.3011 18.5 12.0014 18.5Z",fill:"currentColor"})})]}),Uz=e=>m.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 22 22",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("mask",{id:"mask0_5577_416",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"22",height:"22",children:m.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),m.jsx("g",{mask:"url(#mask0_5577_416)",children:m.jsx("path",{d:"M11 17.6634C10.6219 17.6634 10.2982 17.5287 10.0289 17.2595C9.75964 16.9902 9.625 16.6665 9.625 16.2884C9.625 15.9103 9.75964 15.5866 10.0289 15.3173C10.2982 15.0481 10.6219 14.9134 11 14.9134C11.3781 14.9134 11.7018 15.0481 11.971 15.3173C12.2403 15.5866 12.375 15.9103 12.375 16.2884C12.375 16.6665 12.2403 16.9902 11.971 17.2595C11.7018 17.5287 11.3781 17.6634 11 17.6634ZM11 12.3749C10.6219 12.3749 10.2982 12.2403 10.0289 11.971C9.75964 11.7018 9.625 11.3781 9.625 11C9.625 10.6218 9.75964 10.2982 10.0289 10.0289C10.2982 9.75962 10.6219 9.62498 11 9.62498C11.3781 9.62498 11.7018 9.75962 11.971 10.0289C12.2403 10.2982 12.375 10.6218 12.375 11C12.375 11.3781 12.2403 11.7018 11.971 11.971C11.7018 12.2403 11.3781 12.3749 11 12.3749ZM11 7.08648C10.6219 7.08648 10.2982 6.95184 10.0289 6.68257C9.75964 6.41332 9.625 6.08963 9.625 5.7115C9.625 5.33339 9.75964 5.0097 10.0289 4.74043C10.2982 4.47118 10.6219 4.33655 11 4.33655C11.3781 4.33655 11.7018 4.47118 11.971 4.74043C12.2403 5.0097 12.375 5.33339 12.375 5.7115C12.375 6.08963 12.2403 6.41332 11.971 6.68257C11.7018 6.95184 11.3781 7.08648 11 7.08648Z",fill:"currentColor"})})]}),Gz=({topic:e,onClick:t,onSearch:n,checkedStates:r,setCheckedStates:o,isMuteDisabled:i})=>{const[a,s]=sr(P=>[P.ids,P.total]),[l,c]=y.useState(!1),[u,f]=y.useState(!1),d=Mp(e.date_added_to_graph),p=async(P,T)=>{c(!0);try{await Uu(P,{is_muted:T}),sr.setState({ids:a.filter(k=>k!==P),total:s-1})}catch(k){console.warn(k)}},h=P=>{o(T=>({...T,[P]:!T[P]}))},g=(P,T)=>{var k;(k=window.getSelection())!=null&&k.toString()?P.preventDefault():n(T.name)},v=e.edgeList.slice(0,1),x=e.edgeList.length-v.length,[w,$]=E.useState(null),C=P=>{$(P.currentTarget),f(!0)},S=()=>{f(!1)},b=!!w&&u,O=r[e.ref_id]?"visible":"";return m.jsxs(gf,{className:r[e.ref_id]?"checked":"",children:[m.jsx(Re,{children:m.jsx(Xz,{className:`checkbox-section ${O}`,"data-testid":"topic-check-box",onClick:()=>h(e.ref_id),children:m.jsx(Yz,{checked:r[e.ref_id],children:m.jsx(Zz,{children:r[e.ref_id]&&m.jsx(y$,{})})})})}),m.jsx(Re,{onClick:P=>g(P,e),children:m.jsx(qz,{children:e.name})}),m.jsx(Re,{children:e.node_type}),m.jsx(Re,{children:m.jsx(Qz,{children:e.edgeCount})}),m.jsxs(Re,{children:[m.jsx(af,{anchorEl:w,anchorOrigin:{vertical:"top",horizontal:"center"},disableRestoreFocus:!0,id:"mouse-over-popover",onClose:S,onMouseEnter:()=>f(!0),onMouseLeave:S,open:b,sx:{pointerEvents:"auto","& .MuiPaper-root":{backgroundColor:"rgba(0, 0, 0, 0.9)",borderRadius:"4px",width:"160px",maxHeight:"200px",overflowY:"scroll"}},transformOrigin:{vertical:"bottom",horizontal:"center"},children:m.jsx(Rv,{sx:{p:1.5,fontSize:"13px",fontWeight:400,lineHeight:"1.8",wordWrap:"break-word"},children:e.edgeList.join(", ")})}),v.join(", "),x>0&&m.jsx(Rv,{"aria-haspopup":"true","aria-owns":b?"mouse-over-popover":void 0,component:"span",onMouseEnter:C,onMouseLeave:S,sx:{cursor:"pointer"},children:",..."})]}),m.jsx(Re,{children:m.jsx("span",{children:d})}),m.jsx(Re,{className:"cell-center",children:m.jsx(ee,{direction:"row",justify:"space-between",children:m.jsx("div",{className:"approve-wrapper",children:l?m.jsx(Kz,{children:m.jsx(Ut,{color:K.white,size:16})}):m.jsxs(ee,{direction:"row",children:[e.is_muted?m.jsx(yr,{className:"centered",disabled:i,onClick:()=>p(e.ref_id,!1),children:m.jsx(Hz,{})}):m.jsx(yr,{className:"centered",disabled:i,onClick:()=>p(e.ref_id,!0),children:m.jsx(Vz,{})}),m.jsx(yr,{disabled:i,onClick:P=>t(P,e.ref_id),children:m.jsx(Uz,{"data-testid":"ThreeDotsIcons"})})]})})})})]},e.name)},Kz=X.span` margin-left: 12px; -`,Gz=X.span` +`,qz=X.span` cursor: pointer; :hover { text-decoration: underline; } -`,Kz=X.td` +`,Xz=X.td` visibility: hidden; cursor: pointer; display: flex; @@ -1327,7 +1327,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho &.visible { visibility: visible; } -`,qz=X.div` +`,Yz=X.div` width: 14px; height: 14px; border-radius: 4px; @@ -1337,21 +1337,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho justify-content: center; align-items: center; margin-left: 12px; -`,Xz=X.div` +`,Zz=X.div` display: flex; align-items: center; justify-content: center; border-radius: 2px; background-color: transparent; -`,Yz=X.span` +`,Qz=X.span` display: flex; align-items: center; justify-content: center; -`,Zz=y.memo(Hz),Qz=({setShowMuteUnmute:e,showMuted:t,onTopicEdit:n,onChangeFilter:r,checkedStates:o,setCheckedStates:i})=>{const{close:a}=Nr("sourcesTable"),[s,l]=y.useState(!1),[c,u]=E.useState(null),[f,d]=E.useState(""),p=Object.values(o).filter(_=>_).length,[h,g]=Yr(_=>[_.setSearchFormValue,_.setCurrentSearch]),[v,x,w]=sr(_=>[_.data,_.ids,_.total]),$=y.useCallback((_,A)=>{u(_.currentTarget),d(A)},[]),C=()=>{u(null)},S=_=>{h(_),g(_),a()},b=_=>{n(f,_),C()},O=_=>{r(_)},P=!!c,T=P?"simple-popover":void 0,k=async()=>{l(!0);try{const _=Object.keys(o).map(async I=>{if(o[I])try{return await Hu(I,{is_muted:!t}),I}catch(M){return console.error("Error updating node data:",M),null}return null}),A=await Promise.all(_);sr.setState({ids:x.filter(I=>!A.includes(I)),total:w-A.length}),i({}),l(!1)}catch(_){console.error("Error:",_),l(!1)}};return v?m.jsx(m.Fragment,{children:Object.keys(v).length?m.jsx(aW,{align:"center",justify:s?"center":"flex-start",children:s?m.jsx(Ut,{color:K.white}):m.jsxs(m.Fragment,{children:[m.jsxs(af,{component:"table",children:[p>0?m.jsx(WB,{children:m.jsxs(Ni,{component:"tr",children:[m.jsx(Re,{children:m.jsx(yr,{onClick:()=>i({}),children:m.jsx(ei,{})})}),m.jsx(Re,{colSpan:12,children:m.jsxs(iW,{children:[m.jsxs(oW,{children:[m.jsx(rW,{children:p}),"selected"]}),m.jsx(Re,{className:"empty"}),m.jsx(dy,{onClick:k,role:"button",children:t?m.jsxs(m.Fragment,{children:[m.jsx(fy,{})," Unmute ALL"]}):m.jsxs(m.Fragment,{children:[m.jsx(uy,{})," Mute ALL"]})}),m.jsx(Re,{className:"empty"}),m.jsxs(dy,{onClick:()=>b("mergeTopic"),children:[m.jsx(cy,{})," Merge"]})]})}),m.jsx(Re,{className:"empty"})]})}):m.jsx(gf,{children:m.jsxs(Ni,{component:"tr",children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:m.jsxs(Vd,{onClick:()=>O(hm),children:["Name ",m.jsx(Wd,{})]})}),m.jsx(Re,{children:"Type"}),m.jsx(Re,{children:m.jsxs(Vd,{onClick:()=>O(HB),children:["Count ",m.jsx(Wd,{})]})}),m.jsx(Re,{children:"Edge list"}),m.jsx(Re,{children:m.jsxs(Vd,{onClick:()=>O(t$),children:["Date ",m.jsx(Wd,{})]})}),m.jsx(Re,{children:m.jsx(ee,{px:8,children:m.jsxs(Jz,{onClick:e,children:[m.jsx(eW,{checked:t,children:m.jsx(tW,{children:t&&m.jsx(y$,{})})}),"Muted"]})})})]})}),v&&m.jsx("tbody",{children:x==null?void 0:x.map(_=>m.jsx(Zz,{checkedStates:o,isMuteDisabled:Object.values(o).filter(A=>A).length>1,onClick:$,onSearch:S,setCheckedStates:i,topic:v[_]},_))})]}),f?m.jsxs(nW,{anchorEl:c,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:T,onClose:C,open:P,transformOrigin:{vertical:"top",horizontal:"right"},children:[t?m.jsxs(Da,{"data-testid":"unmute",onClick:()=>b("unMute"),children:[" ",m.jsx(fy,{"data-testid":""})," Unmute"]}):m.jsxs(Da,{"data-testid":"mute",onClick:()=>b("mute"),children:[" ",m.jsx(uy,{"data-testid":"VisibilityOff"})," Mute"]}),m.jsxs(Da,{"data-testid":"rename",onClick:()=>b("editTopic"),children:[m.jsx(Fz,{"data-testid":"EditTopicIcon"})," Rename"]}),m.jsxs(Da,{"data-testid":"merge",onClick:()=>b("mergeTopic"),children:[m.jsx(cy,{"data-testid":"MergeIcon"})," Merge"]}),m.jsxs(Da,{"data-testid":"add_edge",onClick:()=>b("addEdge"),children:[m.jsx(Bz,{"data-testid":"AddCircleIcon"})," Add edge"]})]}):null]})}):m.jsxs(ee,{children:[m.jsx(ze,{children:"There is not any results for selected filters"}),m.jsx(ih,{})]})}):m.jsxs(ee,{children:[m.jsx(ze,{children:"There is not any results for selected filters"}),m.jsx(ih,{})]})},Jz=X.td` +`,Jz=y.memo(Gz),eW=({setShowMuteUnmute:e,showMuted:t,onTopicEdit:n,onChangeFilter:r,checkedStates:o,setCheckedStates:i})=>{const{close:a}=Nr("sourcesTable"),[s,l]=y.useState(!1),[c,u]=E.useState(null),[f,d]=E.useState(""),p=Object.values(o).filter(_=>_).length,[h,g]=Yr(_=>[_.setSearchFormValue,_.setCurrentSearch]),[v,x,w]=sr(_=>[_.data,_.ids,_.total]),$=y.useCallback((_,A)=>{u(_.currentTarget),d(A)},[]),C=()=>{u(null)},S=_=>{h(_),g(_),a()},b=_=>{n(f,_),C()},O=_=>{r(_)},P=!!c,T=P?"simple-popover":void 0,k=async()=>{l(!0);try{const _=Object.keys(o).map(async I=>{if(o[I])try{return await Uu(I,{is_muted:!t}),I}catch(M){return console.error("Error updating node data:",M),null}return null}),A=await Promise.all(_);sr.setState({ids:x.filter(I=>!A.includes(I)),total:w-A.length}),i({}),l(!1)}catch(_){console.error("Error:",_),l(!1)}};return v?m.jsx(m.Fragment,{children:Object.keys(v).length?m.jsx(lW,{align:"center",justify:s?"center":"flex-start",children:s?m.jsx(Ut,{color:K.white}):m.jsxs(m.Fragment,{children:[m.jsxs(sf,{component:"table",children:[p>0?m.jsx(WB,{children:m.jsxs(Ni,{component:"tr",children:[m.jsx(Re,{children:m.jsx(yr,{onClick:()=>i({}),children:m.jsx(ei,{})})}),m.jsx(Re,{colSpan:12,children:m.jsxs(sW,{children:[m.jsxs(aW,{children:[m.jsx(iW,{children:p}),"selected"]}),m.jsx(Re,{className:"empty"}),m.jsx(dy,{onClick:k,role:"button",children:t?m.jsxs(m.Fragment,{children:[m.jsx(fy,{})," Unmute ALL"]}):m.jsxs(m.Fragment,{children:[m.jsx(uy,{})," Mute ALL"]})}),m.jsx(Re,{className:"empty"}),m.jsxs(dy,{onClick:()=>b("mergeTopic"),children:[m.jsx(cy,{})," Merge"]})]})}),m.jsx(Re,{className:"empty"})]})}):m.jsx(mf,{children:m.jsxs(Ni,{component:"tr",children:[m.jsx(Re,{className:"empty"}),m.jsx(Re,{children:m.jsxs(Hd,{onClick:()=>O(hm),children:["Name ",m.jsx(Vd,{})]})}),m.jsx(Re,{children:"Type"}),m.jsx(Re,{children:m.jsxs(Hd,{onClick:()=>O(HB),children:["Count ",m.jsx(Vd,{})]})}),m.jsx(Re,{children:"Edge list"}),m.jsx(Re,{children:m.jsxs(Hd,{onClick:()=>O(t$),children:["Date ",m.jsx(Vd,{})]})}),m.jsx(Re,{children:m.jsx(ee,{px:8,children:m.jsxs(tW,{onClick:e,children:[m.jsx(nW,{checked:t,children:m.jsx(rW,{children:t&&m.jsx(y$,{})})}),"Muted"]})})})]})}),v&&m.jsx("tbody",{children:x==null?void 0:x.map(_=>m.jsx(Jz,{checkedStates:o,isMuteDisabled:Object.values(o).filter(A=>A).length>1,onClick:$,onSearch:S,setCheckedStates:i,topic:v[_]},_))})]}),f?m.jsxs(oW,{anchorEl:c,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:T,onClose:C,open:P,transformOrigin:{vertical:"top",horizontal:"right"},children:[t?m.jsxs(Da,{"data-testid":"unmute",onClick:()=>b("unMute"),children:[" ",m.jsx(fy,{"data-testid":""})," Unmute"]}):m.jsxs(Da,{"data-testid":"mute",onClick:()=>b("mute"),children:[" ",m.jsx(uy,{"data-testid":"VisibilityOff"})," Mute"]}),m.jsxs(Da,{"data-testid":"rename",onClick:()=>b("editTopic"),children:[m.jsx(Wz,{"data-testid":"EditTopicIcon"})," Rename"]}),m.jsxs(Da,{"data-testid":"merge",onClick:()=>b("mergeTopic"),children:[m.jsx(cy,{"data-testid":"MergeIcon"})," Merge"]}),m.jsxs(Da,{"data-testid":"add_edge",onClick:()=>b("addEdge"),children:[m.jsx(zz,{"data-testid":"AddCircleIcon"})," Add edge"]})]}):null]})}):m.jsxs(ee,{children:[m.jsx(ze,{children:"There is not any results for selected filters"}),m.jsx(ah,{})]})}):m.jsxs(ee,{children:[m.jsx(ze,{children:"There is not any results for selected filters"}),m.jsx(ah,{})]})},tW=X.td` cursor: pointer; display: flex; align-items: center; -`,eW=X.div` +`,nW=X.div` width: 14px; height: 14px; border-radius: 4px; @@ -1361,13 +1361,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho justify-content: center; align-items: center; margin-right: 8px; -`,tW=X.div` +`,rW=X.div` display: flex; align-items: center; justify-content: center; border-radius: 2px; background-color: transparent; -`,Vd=X.span` +`,Hd=X.span` cursor: pointer; display: flex; gap: 4px; @@ -1385,7 +1385,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho background: ${K.BUTTON1_HOVER}; color: ${K.GRAY3}; } -`,nW=X(of)` +`,oW=X(af)` && { z-index: 9999; } @@ -1399,7 +1399,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho font-size: 14px; font-weight: 500; } -`,rW=X.span` +`,iW=X.span` font-family: Barlow; font-size: 13px; font-weight: 500; @@ -1418,21 +1418,21 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho padding: 1px 8px; border-radius: 4px; } -`,oW=X.div` +`,aW=X.div` display: flex; align-items: center; gap: 2px; -`,iW=X.span` +`,sW=X.span` display: flex; align-items: center; gap: 27px; -`,aW=X(ee)` +`,lW=X(ee)` min-height: 0; overflow: auto; flex: 1; width: 100%; position: relative; -`,sW=()=>{const[e,t,n,r,o,i,a,s]=sr(T=>[T.data,T.ids,T.total,T.setTopics,T.filters,T.setFilters,T.terminate,T.loading]),{open:l}=Nr("editTopic"),{open:c}=Nr("mergeTopic"),{open:u}=Nr("addEdge"),[f,d]=y.useState(null),[p,h]=y.useState([]),[g,v]=y.useState({}),x={editTopic:l,mergeTopic:c,addEdge:u},w=y.useRef([]);y.useEffect(()=>{t.length&&(w.current=t)},[t]),y.useEffect(()=>{(async()=>{try{await r()}catch{console.error("err")}})()},[r,o]);const $=async()=>{i({page:o.page+1})};y.useEffect(()=>()=>{a()},[a]);const C=T=>{i({sortBy:T})},S=()=>{d(null),h([])},b=async(T,k)=>{try{await Hu(T,{is_muted:k==="mute"}),sr.setState({ids:t.filter(_=>_!==T),total:n-1})}catch(_){console.warn(_)}},O=async(T,k)=>{if(e)if(k==="mergeTopic")if(Object.values(g).filter(_=>_).length>0){const _=Object.entries(g).filter(([,A])=>A).map(([A])=>e[A]);h(_),c()}else h([e[T]]),d(e[T]),c();else["mute","unMute"].includes(k)&&await b(T,k),typeof x[k]=="function"&&x[k](),d(e[T])},P=T=>{i({...o,search:T})};return m.jsxs(m.Fragment,{children:[m.jsxs(lW,{direction:"column",justify:"flex-end",children:[m.jsx(mf,{align:"flex-start",direction:"row",justify:"space-between",children:m.jsx(ze,{className:"title",children:"Topics"})}),m.jsx(uW,{"data-testid":"topic-search-container",children:m.jsx(a$,{activeIcon:m.jsx(ei,{}),defaultIcon:m.jsx(i$,{}),loading:s,loadingIcon:m.jsx(Ut,{color:K.lightGray,size:24}),onSearch:P,placeholder:"Search ..."})}),m.jsx(cW,{align:"center",justify:s&&!e?"center":"flex-start",children:s&&!e?m.jsx(Ut,{color:K.white}):m.jsxs(m.Fragment,{children:[m.jsx(Qz,{checkedStates:g,onChangeFilter:C,onTopicEdit:O,setCheckedStates:v,setShowMuteUnmute:()=>i({is_muted:!o.is_muted}),showMuted:o.is_muted}),n>t.length?m.jsxs(_r,{className:"load-more",disabled:s,onClick:$,children:["Load more",s&&m.jsx(Ut,{color:K.lightGray,size:10})]}):null]})})]}),p.length>0&&m.jsx(Dz,{multiTopics:p,onClose:S}),f&&m.jsx(wz,{onClose:S,topic:f}),f&&m.jsx(ZF,{onClose:S,topic:f})]})},lW=X(ee)` +`,cW=()=>{const[e,t,n,r,o,i,a,s]=sr(T=>[T.data,T.ids,T.total,T.setTopics,T.filters,T.setFilters,T.terminate,T.loading]),{open:l}=Nr("editTopic"),{open:c}=Nr("mergeTopic"),{open:u}=Nr("addEdge"),[f,d]=y.useState(null),[p,h]=y.useState([]),[g,v]=y.useState({}),x={editTopic:l,mergeTopic:c,addEdge:u},w=y.useRef([]);y.useEffect(()=>{t.length&&(w.current=t)},[t]),y.useEffect(()=>{(async()=>{try{await r()}catch{console.error("err")}})()},[r,o]);const $=async()=>{i({page:o.page+1})};y.useEffect(()=>()=>{a()},[a]);const C=T=>{i({sortBy:T})},S=()=>{d(null),h([])},b=async(T,k)=>{try{await Uu(T,{is_muted:k==="mute"}),sr.setState({ids:t.filter(_=>_!==T),total:n-1})}catch(_){console.warn(_)}},O=async(T,k)=>{if(e)if(k==="mergeTopic")if(Object.values(g).filter(_=>_).length>0){const _=Object.entries(g).filter(([,A])=>A).map(([A])=>e[A]);h(_),c()}else h([e[T]]),d(e[T]),c();else["mute","unMute"].includes(k)&&await b(T,k),typeof x[k]=="function"&&x[k](),d(e[T])},P=T=>{i({...o,search:T})};return m.jsxs(m.Fragment,{children:[m.jsxs(uW,{direction:"column",justify:"flex-end",children:[m.jsx(vf,{align:"flex-start",direction:"row",justify:"space-between",children:m.jsx(ze,{className:"title",children:"Topics"})}),m.jsx(dW,{"data-testid":"topic-search-container",children:m.jsx(a$,{activeIcon:m.jsx(ei,{}),defaultIcon:m.jsx(i$,{}),loading:s,loadingIcon:m.jsx(Ut,{color:K.lightGray,size:24}),onSearch:P,placeholder:"Search ..."})}),m.jsx(fW,{align:"center",justify:s&&!e?"center":"flex-start",children:s&&!e?m.jsx(Ut,{color:K.white}):m.jsxs(m.Fragment,{children:[m.jsx(eW,{checkedStates:g,onChangeFilter:C,onTopicEdit:O,setCheckedStates:v,setShowMuteUnmute:()=>i({is_muted:!o.is_muted}),showMuted:o.is_muted}),n>t.length?m.jsxs(_r,{className:"load-more",disabled:s,onClick:$,children:["Load more",s&&m.jsx(Ut,{color:K.lightGray,size:10})]}):null]})})]}),p.length>0&&m.jsx(Lz,{multiTopics:p,onClose:S}),f&&m.jsx($z,{onClose:S,topic:f}),f&&m.jsx(JF,{onClose:S,topic:f})]})},uW=X(ee)` flex: 1; .title { @@ -1462,14 +1462,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho margin: 8px auto; align-self: center; } -`,cW=X(ee)` +`,fW=X(ee)` min-height: 0; overflow: auto; flex: 1; width: 100%; -`,uW=X(ee)` +`,dW=X(ee)` margin: 0 0 16px 36px; -`,fW=[{label:e$,component:QB},{label:VB,component:SF},{label:QS,component:cF},{label:JS,component:sW}],dW=e=>{const{children:t,value:n,index:r,...o}=e;return n===r?m.jsx(vW,{"aria-labelledby":`simple-tab-${r}`,hidden:n!==r,id:`simple-tabpanel-${r}`,role:"tabpanel",...o,children:t}):null};function pW(e){return{id:`simple-tab-${e}`,"aria-controls":`simple-tabpanel-${e}`}}const hW=()=>{const[e,t]=y.useState(0),[n]=sa(s=>[s.isAdmin]),[r]=wg(s=>[s.queuedSourcesFeatureFlag]),o=DO(),i=(s,l)=>{t(l)},a=fW.filter(({label:s})=>s===JS?n||!0:s===QS?n&&r:s===e$?o:!0);return m.jsxs(yW,{"data-testid":"sources-table",direction:"column",children:[m.jsx(gW,{"aria-label":"sources tabs",onChange:i,value:e,children:a.map((s,l)=>m.jsx(mW,{color:K.white,disableRipple:!0,label:s.label,...pW(l)},s.label))}),a.map((s,l)=>m.jsx(dW,{index:l,value:e,children:m.jsx(s.component,{})},s.label))]})},gW=X(QT)` +`,pW=[{label:e$,component:QB},{label:VB,component:SF},{label:QS,component:cF},{label:JS,component:cW}],hW=e=>{const{children:t,value:n,index:r,...o}=e;return n===r?m.jsx(bW,{"aria-labelledby":`simple-tab-${r}`,hidden:n!==r,id:`simple-tabpanel-${r}`,role:"tabpanel",...o,children:t}):null};function gW(e){return{id:`simple-tab-${e}`,"aria-controls":`simple-tabpanel-${e}`}}const mW=()=>{const[e,t]=y.useState(0),[n]=sa(s=>[s.isAdmin]),[r]=wg(s=>[s.queuedSourcesFeatureFlag]),o=DO(),i=(s,l)=>{t(l)},a=pW.filter(({label:s})=>s===JS?n||!0:s===QS?n&&r:s===e$?o:!0);return m.jsxs(xW,{"data-testid":"sources-table",direction:"column",children:[m.jsx(vW,{"aria-label":"sources tabs",onChange:i,value:e,children:a.map((s,l)=>m.jsx(yW,{color:K.white,disableRipple:!0,label:s.label,...gW(l)},s.label))}),a.map((s,l)=>m.jsx(hW,{index:l,value:e,children:m.jsx(s.component,{})},s.label))]})},vW=X(QT)` && { background: rgba(0, 0, 0, 0.2); border-radius: 9px 9px 0 0; @@ -1477,7 +1477,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho background: ${K.primaryBlue}; } } -`,mW=X(G_)` +`,yW=X(G_)` && { padding: 30px 0 24px; color: ${K.GRAY6}; @@ -1491,7 +1491,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho color: ${K.white}; } } -`,vW=X(ee)` +`,bW=X(ee)` display: flex; flex: 1; min-height: 572px; @@ -1516,7 +1516,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho min-height: 250px; max-height: 250px; } -`,yW=X(ee)` +`,xW=X(ee)` min-height: 0; flex: 1; overflow: hidden; @@ -1524,10 +1524,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho @media (max-width: 768px) { padding: 3px; } -`,Zl={required:{message:"The field is required",value:!0}},bW=({initialValues:e})=>{const t=Cl({defaultValues:e,mode:"onSubmit"}),{isSubmitting:n}=t.formState,r=t.handleSubmit(async o=>{try{await NO(o)}catch(i){console.warn(i)}});return m.jsx($l,{...t,children:m.jsx("form",{id:"add-node-form",onSubmit:r,children:m.jsxs(m.Fragment,{children:[m.jsxs(ee,{children:[m.jsx(ee,{pt:12,children:m.jsx(Xa,{id:"cy-about-title-id",label:"Graph Title",maxLength:50,name:"title",placeholder:"Type graph title here...",rules:{...Zl}})}),m.jsx(ee,{pt:12,children:m.jsx(Xa,{id:"cy-about-id",label:"Graph Description",maxLength:50,name:"description",placeholder:"Type graph description here...",rules:{...Zl}})}),m.jsx(ee,{pt:12,children:m.jsx(Xa,{id:"cy-about-mission_statement-id",label:"Mission Statement",maxLength:50,name:"mission_statement",placeholder:"Type mission statement here...",rules:{...Zl}})}),m.jsx(ee,{pt:12,children:m.jsx(Xa,{id:"cy-about-search_term-id",label:"Search Term",maxLength:50,name:"search_term",placeholder:"Type search term here...",rules:{...Zl}})})]}),m.jsx(ee,{pt:8,children:n?m.jsx(xW,{children:m.jsx(Ut,{color:K.white,size:20})}):m.jsx(Gc,{disabled:n,id:"add-node-submit-cta",kind:"big",type:"submit",children:"Save changes"})})]})})})},xW=X(ee).attrs({align:"center",background:"primaryButton",borderRadius:8,justify:"center"})` +`,Zl={required:{message:"The field is required",value:!0}},wW=({initialValues:e})=>{const t=Cl({defaultValues:e,mode:"onSubmit"}),{isSubmitting:n}=t.formState,r=t.handleSubmit(async o=>{try{await NO(o)}catch(i){console.warn(i)}});return m.jsx($l,{...t,children:m.jsx("form",{id:"add-node-form",onSubmit:r,children:m.jsxs(m.Fragment,{children:[m.jsxs(ee,{children:[m.jsx(ee,{pt:12,children:m.jsx(Xa,{id:"cy-about-title-id",label:"Graph Title",maxLength:50,name:"title",placeholder:"Type graph title here...",rules:{...Zl}})}),m.jsx(ee,{pt:12,children:m.jsx(Xa,{id:"cy-about-id",label:"Graph Description",maxLength:50,name:"description",placeholder:"Type graph description here...",rules:{...Zl}})}),m.jsx(ee,{pt:12,children:m.jsx(Xa,{id:"cy-about-mission_statement-id",label:"Mission Statement",maxLength:50,name:"mission_statement",placeholder:"Type mission statement here...",rules:{...Zl}})}),m.jsx(ee,{pt:12,children:m.jsx(Xa,{id:"cy-about-search_term-id",label:"Search Term",maxLength:50,name:"search_term",placeholder:"Type search term here...",rules:{...Zl}})})]}),m.jsx(ee,{pt:8,children:n?m.jsx(SW,{children:m.jsx(Ut,{color:K.white,size:20})}):m.jsx(Gc,{disabled:n,id:"add-node-submit-cta",kind:"big",type:"submit",children:"Save changes"})})]})})})},SW=X(ee).attrs({align:"center",background:"primaryButton",borderRadius:8,justify:"center"})` padding: 16px 24px; opacity: 0.5; -`,wW=({initialValues:e})=>m.jsxs(m.Fragment,{children:[e.title&&m.jsxs(ee,{pt:12,children:[m.jsx(ze,{kind:"regular",children:"Graph Title"}),m.jsx(ee,{pt:12,children:m.jsx(ze,{className:"value",kind:"medium",children:e.title})})]}),e.description&&m.jsxs(ee,{pt:12,children:[m.jsx(ze,{kind:"regular",children:"Graph Description"}),m.jsx(ee,{pt:12,children:m.jsx(ze,{className:"value",kind:"medium",children:e.description})})]}),e.mission_statement&&m.jsxs(ee,{pt:12,children:[m.jsx(ze,{kind:"regular",children:"Mission Statement"}),m.jsx(ee,{pt:12,children:m.jsx(ze,{className:"value",kind:"medium",children:e.mission_statement})})]})]}),SW=()=>{const[e]=sa(n=>[n.isAdmin]),t=Yr(n=>n.appMetaData);return t?m.jsxs($W,{align:"stretch",direction:"column",justify:"flex-end",children:[m.jsx(OW,{align:"center",direction:"row",justify:"space-between",children:m.jsx(ze,{className:"title",children:"About"})}),m.jsx(CW,{align:"stretch",justify:"flex-start",children:e?m.jsx(bW,{initialValues:t}):m.jsx(wW,{initialValues:t})})]}):null},$W=X(ee)` +`,$W=({initialValues:e})=>m.jsxs(m.Fragment,{children:[e.title&&m.jsxs(ee,{pt:12,children:[m.jsx(ze,{kind:"regular",children:"Graph Title"}),m.jsx(ee,{pt:12,children:m.jsx(ze,{className:"value",kind:"medium",children:e.title})})]}),e.description&&m.jsxs(ee,{pt:12,children:[m.jsx(ze,{kind:"regular",children:"Graph Description"}),m.jsx(ee,{pt:12,children:m.jsx(ze,{className:"value",kind:"medium",children:e.description})})]}),e.mission_statement&&m.jsxs(ee,{pt:12,children:[m.jsx(ze,{kind:"regular",children:"Mission Statement"}),m.jsx(ee,{pt:12,children:m.jsx(ze,{className:"value",kind:"medium",children:e.mission_statement})})]})]}),CW=()=>{const[e]=sa(n=>[n.isAdmin]),t=Yr(n=>n.appMetaData);return t?m.jsxs(OW,{align:"stretch",direction:"column",justify:"flex-end",children:[m.jsx(PW,{align:"center",direction:"row",justify:"space-between",children:m.jsx(ze,{className:"title",children:"About"})}),m.jsx(EW,{align:"stretch",justify:"flex-start",children:e?m.jsx(wW,{initialValues:t}):m.jsx($W,{initialValues:t})})]}):null},OW=X(ee)` border-radius: 8px; box-shadow: 0px 5px 6px rgb(0 0 0 / 50%); padding: 16px; @@ -1541,52 +1541,52 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .value { color: ${K.lightBlue400}; } -`,CW=X(ee)` +`,EW=X(ee)` min-height: 0; overflow: auto; flex: 1; width: 100%; -`,OW=X(ee)` +`,PW=X(ee)` margin-bottom: 16px; ${ze} { margin-bottom: 0; } -`,b$=async(e,t)=>{const n=t&&new URLSearchParams(t),r=n?`/sentiments?${n.toString()}`:"/sentiments";if(LO)return await Sv.get(r);const o=await BO();try{return await Sv.get(r,{Authorization:o})}catch(i){if(i.status===402)return await FO(e),b$(e,t);throw i}};function x$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t{const n=t&&new URLSearchParams(t),r=n?`/sentiments?${n.toString()}`:"/sentiments";if(LO)return await Sv.get(r);const o=await BO();try{return await Sv.get(r,{Authorization:o})}catch(i){if(i.status===402)return await FO(e),b$(e,t);throw i}};function x$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t0?1:-1},ah=function(t){return Ol(t)&&t.indexOf("%")===t.length-1},me=function(t){return kV(t)&&!El(t)},jt=function(t){return me(t)||Ol(t)},RV=0,Pl=function(t){var n=++RV;return"".concat(t||"").concat(n)},zi=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!me(t)&&!Ol(t))return r;var i;if(ah(t)){var a=t.indexOf("%");i=n*parseFloat(t.slice(0,a))/100}else i=+t;return El(i)&&(i=r),o&&i>n&&(i=n),i},ao=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},DV=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function WV(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function lh(e){"@babel/helpers - typeof";return lh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lh(e)}var yy={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},mo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},by=null,Ud=null,_m=function e(t){if(t===by&&Array.isArray(Ud))return Ud;var n=[];return y.Children.forEach(t,function(r){Je(r)||(EV.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Ud=n,by=t,n};function Wn(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(o){return mo(o)}):r=[mo(t)],_m(e).forEach(function(o){var i=zn(o,"type.displayName")||zn(o,"type.name");r.indexOf(i)!==-1&&n.push(o)}),n}function Mr(e,t){var n=Wn(e,t);return n&&n[0]}var xy=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,o=n.height;return!(!me(r)||r<=0||!me(o)||o<=0)},VV=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],HV=function(t){return t&&t.type&&Ol(t.type)&&VV.indexOf(t.type)>=0},UV=function(t){return t&&lh(t)==="object"&&"cx"in t&&"cy"in t&&"r"in t},GV=function(t,n,r,o){var i,a=(i=Hd==null?void 0:Hd[o])!==null&&i!==void 0?i:[];return!Ue(t)&&(o&&a.includes(n)||LV.includes(n))||r&&Pm.includes(n)},Qe=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var o=t;if(y.isValidElement(t)&&(o=t.props),!ca(o))return null;var i={};return Object.keys(o).forEach(function(a){var s;GV((s=o)===null||s===void 0?void 0:s[a],a,n,r)&&(i[a]=o[a])}),i},T$=function e(t,n){if(t===n)return!0;var r=y.Children.count(t);if(r!==y.Children.count(n))return!1;if(r===0)return!0;if(r===1)return wy(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ZV(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function uh(e){var t=e.children,n=e.width,r=e.height,o=e.viewBox,i=e.className,a=e.style,s=e.title,l=e.desc,c=YV(e,XV),u=o||{width:n,height:r,x:0,y:0},f=lt("recharts-surface",i);return E.createElement("svg",ch({},Qe(c,!0,"svg"),{className:f,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),E.createElement("title",null,s),E.createElement("desc",null,l),t)}var QV=["children","className"];function fh(){return fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eH(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Pt=E.forwardRef(function(e,t){var n=e.children,r=e.className,o=JV(e,QV),i=lt("recharts-layer",r);return E.createElement("g",fh({className:i},Qe(o,!0),{ref:t}),n)}),_f=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;io?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r=r?e:rH(e,t,n)}var iH=oH,aH="\\ud800-\\udfff",sH="\\u0300-\\u036f",lH="\\ufe20-\\ufe2f",cH="\\u20d0-\\u20ff",uH=sH+lH+cH,fH="\\ufe0e\\ufe0f",dH="\\u200d",pH=RegExp("["+dH+aH+uH+fH+"]");function hH(e){return pH.test(e)}var A$=hH;function gH(e){return e.split("")}var mH=gH,k$="\\ud800-\\udfff",vH="\\u0300-\\u036f",yH="\\ufe20-\\ufe2f",bH="\\u20d0-\\u20ff",xH=vH+yH+bH,wH="\\ufe0e\\ufe0f",SH="["+k$+"]",dh="["+xH+"]",ph="\\ud83c[\\udffb-\\udfff]",$H="(?:"+dh+"|"+ph+")",j$="[^"+k$+"]",I$="(?:\\ud83c[\\udde6-\\uddff]){2}",M$="[\\ud800-\\udbff][\\udc00-\\udfff]",CH="\\u200d",R$=$H+"?",D$="["+wH+"]?",OH="(?:"+CH+"(?:"+[j$,I$,M$].join("|")+")"+D$+R$+")*",EH=D$+R$+OH,PH="(?:"+[j$+dh+"?",dh,I$,M$,SH].join("|")+")",_H=RegExp(ph+"(?="+ph+")|"+PH+EH,"g");function TH(e){return e.match(_H)||[]}var AH=TH,kH=mH,jH=A$,IH=AH;function MH(e){return jH(e)?IH(e):kH(e)}var RH=MH,DH=iH,NH=A$,LH=RH,BH=$$;function FH(e){return function(t){t=BH(t);var n=NH(t)?LH(t):void 0,r=n?n[0]:t.charAt(0),o=n?DH(n,1).join(""):t.slice(1);return r[e]()+o}}var zH=FH,WH=zH,VH=WH("toUpperCase"),HH=VH;const Tf=yt(HH);function ft(e){return function(){return e}}const N$=Math.cos,Zc=Math.sin,ur=Math.sqrt,Qc=Math.PI,Af=2*Qc,hh=Math.PI,gh=2*hh,Mo=1e-6,UH=gh-Mo;function L$(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return L$;const n=10**t;return function(r){this._+=r[0];for(let o=1,i=r.length;oMo)if(!(Math.abs(f*l-c*u)>Mo)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,h=o-s,g=l*l+c*c,v=p*p+h*h,x=Math.sqrt(g),w=Math.sqrt(d),$=i*Math.tan((hh-Math.acos((g+d-v)/(2*x*w)))/2),C=$/w,S=$/x;Math.abs(C-1)>Mo&&this._append`L${t+C*u},${n+C*f}`,this._append`A${i},${i},0,0,${+(f*p>u*h)},${this._x1=t+S*l},${this._y1=n+S*c}`}}arc(t,n,r,o,i,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(o),l=r*Math.sin(o),c=t+s,u=n+l,f=1^a,d=a?o-i:i-o;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Mo||Math.abs(this._y1-u)>Mo)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%gh+gh),d>UH?this._append`A${r},${r},0,1,${f},${t-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>Mo&&this._append`A${r},${r},0,${+(d>=hh)},${f},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+o}h${-r}Z`}toString(){return this._}}function Tm(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new KH(t)}function Am(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function B$(e){this._context=e}B$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function kf(e){return new B$(e)}function F$(e){return e[0]}function z$(e){return e[1]}function W$(e,t){var n=ft(!0),r=null,o=kf,i=null,a=Tm(s);e=typeof e=="function"?e:e===void 0?F$:ft(e),t=typeof t=="function"?t:t===void 0?z$:ft(t);function s(l){var c,u=(l=Am(l)).length,f,d=!1,p;for(r==null&&(i=o(p=a())),c=0;c<=u;++c)!(c=p;--h)s.point($[h],C[h]);s.lineEnd(),s.areaEnd()}x&&($[d]=+e(v,d,f),C[d]=+t(v,d,f),s.point(r?+r(v,d,f):$[d],n?+n(v,d,f):C[d]))}if(w)return s=null,w+""||null}function u(){return W$().defined(o).curve(a).context(i)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:ft(+f),r=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ft(+f),c):e},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ft(+f),c):r},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:ft(+f),n=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ft(+f),c):t},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ft(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(f){return arguments.length?(o=typeof f=="function"?f:ft(!!f),c):o},c.curve=function(f){return arguments.length?(a=f,i!=null&&(s=a(i)),c):a},c.context=function(f){return arguments.length?(f==null?i=s=null:s=a(i=f),c):i},c}class V${constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function qH(e){return new V$(e,!0)}function XH(e){return new V$(e,!1)}const km={draw(e,t){const n=ur(t/Qc);e.moveTo(n,0),e.arc(0,0,n,0,Af)}},YH={draw(e,t){const n=ur(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},H$=ur(1/3),ZH=H$*2,QH={draw(e,t){const n=ur(t/ZH),r=n*H$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},JH={draw(e,t){const n=ur(t),r=-n/2;e.rect(r,r,n,n)}},eU=.8908130915292852,U$=Zc(Qc/10)/Zc(7*Qc/10),tU=Zc(Af/10)*U$,nU=-N$(Af/10)*U$,rU={draw(e,t){const n=ur(t*eU),r=tU*n,o=nU*n;e.moveTo(0,-n),e.lineTo(r,o);for(let i=1;i<5;++i){const a=Af*i/5,s=N$(a),l=Zc(a);e.lineTo(l*n,-s*n),e.lineTo(s*r-l*o,l*r+s*o)}e.closePath()}},Gd=ur(3),oU={draw(e,t){const n=-ur(t/(Gd*3));e.moveTo(0,n*2),e.lineTo(-Gd*n,-n),e.lineTo(Gd*n,-n),e.closePath()}},An=-.5,kn=ur(3)/2,mh=1/ur(12),iU=(mh/2+1)*3,aU={draw(e,t){const n=ur(t/iU),r=n/2,o=n*mh,i=r,a=n*mh+n,s=-i,l=a;e.moveTo(r,o),e.lineTo(i,a),e.lineTo(s,l),e.lineTo(An*r-kn*o,kn*r+An*o),e.lineTo(An*i-kn*a,kn*i+An*a),e.lineTo(An*s-kn*l,kn*s+An*l),e.lineTo(An*r+kn*o,An*o-kn*r),e.lineTo(An*i+kn*a,An*a-kn*i),e.lineTo(An*s+kn*l,An*l-kn*s),e.closePath()}};function sU(e,t){let n=null,r=Tm(o);e=typeof e=="function"?e:ft(e||km),t=typeof t=="function"?t:ft(t===void 0?64:+t);function o(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return o.type=function(i){return arguments.length?(e=typeof i=="function"?i:ft(i),o):e},o.size=function(i){return arguments.length?(t=typeof i=="function"?i:ft(+i),o):t},o.context=function(i){return arguments.length?(n=i??null,o):n},o}function Jc(){}function eu(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function G$(e){this._context=e}G$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:eu(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:eu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lU(e){return new G$(e)}function K$(e){this._context=e}K$.prototype={areaStart:Jc,areaEnd:Jc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:eu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function cU(e){return new K$(e)}function q$(e){this._context=e}q$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:eu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uU(e){return new q$(e)}function X$(e){this._context=e}X$.prototype={areaStart:Jc,areaEnd:Jc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function fU(e){return new X$(e)}function $y(e){return e<0?-1:1}function Cy(e,t,n){var r=e._x1-e._x0,o=t-e._x1,i=(e._y1-e._y0)/(r||o<0&&-0),a=(n-e._y1)/(o||r<0&&-0),s=(i*o+a*r)/(r+o);return($y(i)+$y(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(s))||0}function Oy(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Kd(e,t,n){var r=e._x0,o=e._y0,i=e._x1,a=e._y1,s=(i-r)/3;e._context.bezierCurveTo(r+s,o+s*t,i-s,a-s*n,i,a)}function tu(e){this._context=e}tu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Kd(this,this._t0,Oy(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,Kd(this,Oy(this,n=Cy(this,e,t)),n);break;default:Kd(this,this._t0,n=Cy(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Y$(e){this._context=new Z$(e)}(Y$.prototype=Object.create(tu.prototype)).point=function(e,t){tu.prototype.point.call(this,t,e)};function Z$(e){this._context=e}Z$.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,o,i){this._context.bezierCurveTo(t,e,r,n,i,o)}};function dU(e){return new tu(e)}function pU(e){return new Y$(e)}function Q$(e){this._context=e}Q$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Ey(e),o=Ey(t),i=0,a=1;a=0;--t)o[t]=(a[t]-o[t+1])/i[t];for(i[n-1]=(e[n]+o[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function gU(e){return new jf(e,.5)}function mU(e){return new jf(e,0)}function vU(e){return new jf(e,1)}function Wi(e,t){if((a=e.length)>1)for(var n=1,r,o,i=e[t[0]],a,s=i.length;n=0;)n[t]=t;return n}function yU(e,t){return e[t]}function bU(e){const t=[];return t.key=e,t}function xU(){var e=ft([]),t=vh,n=Wi,r=yU;function o(i){var a=Array.from(e.apply(this,arguments),bU),s,l=a.length,c=-1,u;for(const f of i)for(s=0,++c;s0){for(var n,r,o=0,i=e[0].length,a;o0){for(var n=0,r=e[t[0]],o,i=r.length;n0)||!((i=(o=e[t[0]]).length)>0))){for(var n=0,r=1,o,i,a;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TU(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var J$={symbolCircle:km,symbolCross:YH,symbolDiamond:QH,symbolSquare:JH,symbolStar:rU,symbolTriangle:oU,symbolWye:aU},AU=Math.PI/180,kU=function(t){var n="symbol".concat(Tf(t));return J$[n]||km},jU=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var o=18*AU;return 1.25*t*t*(Math.tan(o)-Math.tan(o*2)*Math.pow(Math.tan(o),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},IU=function(t,n){J$["symbol".concat(Tf(t))]=n},jm=function(t){var n=t.type,r=n===void 0?"circle":n,o=t.size,i=o===void 0?64:o,a=t.sizeType,s=a===void 0?"area":a,l=_U(t,CU),c=_y(_y({},l),{},{type:r,size:i,sizeType:s}),u=function(){var v=kU(r),x=sU().type(v).size(jU(i,s,r));return x()},f=c.className,d=c.cx,p=c.cy,h=Qe(c,!0);return d===+d&&p===+p&&i===+i?E.createElement("path",yh({},h,{className:lt("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(p,")"),d:u()})):null};jm.registerSymbol=IU;function Vi(e){"@babel/helpers - typeof";return Vi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vi(e)}function bh(){return bh=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function nu(e){return nu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},nu(e)}function ws(e,t,n){return t=eC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eC(e){var t=WU(e,"string");return Vi(t)==="symbol"?t:String(t)}function WU(e,t){if(Vi(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Vi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jn=32,Im=function(e){NU(n,e);var t=LU(n);function n(){return RU(this,n),t.apply(this,arguments)}return DU(n,[{key:"renderIcon",value:function(o){var i=this.props.inactiveColor,a=jn/2,s=jn/6,l=jn/3,c=o.inactive?i:o.color;if(o.type==="plainline")return E.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:o.payload.strokeDasharray,x1:0,y1:a,x2:jn,y2:a,className:"recharts-legend-icon"});if(o.type==="line")return E.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,` + */var zt=typeof Symbol=="function"&&Symbol.for,Cm=zt?Symbol.for("react.element"):60103,Om=zt?Symbol.for("react.portal"):60106,bf=zt?Symbol.for("react.fragment"):60107,xf=zt?Symbol.for("react.strict_mode"):60108,wf=zt?Symbol.for("react.profiler"):60114,Sf=zt?Symbol.for("react.provider"):60109,$f=zt?Symbol.for("react.context"):60110,Em=zt?Symbol.for("react.async_mode"):60111,Cf=zt?Symbol.for("react.concurrent_mode"):60111,Of=zt?Symbol.for("react.forward_ref"):60112,Ef=zt?Symbol.for("react.suspense"):60113,$V=zt?Symbol.for("react.suspense_list"):60120,Pf=zt?Symbol.for("react.memo"):60115,_f=zt?Symbol.for("react.lazy"):60116,CV=zt?Symbol.for("react.block"):60121,OV=zt?Symbol.for("react.fundamental"):60117,EV=zt?Symbol.for("react.responder"):60118,PV=zt?Symbol.for("react.scope"):60119;function _n(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Cm:switch(e=e.type,e){case Em:case Cf:case bf:case wf:case xf:case Ef:return e;default:switch(e=e&&e.$$typeof,e){case $f:case Of:case _f:case Pf:case Sf:return e;default:return t}}case Om:return t}}}function P$(e){return _n(e)===Cf}ot.AsyncMode=Em;ot.ConcurrentMode=Cf;ot.ContextConsumer=$f;ot.ContextProvider=Sf;ot.Element=Cm;ot.ForwardRef=Of;ot.Fragment=bf;ot.Lazy=_f;ot.Memo=Pf;ot.Portal=Om;ot.Profiler=wf;ot.StrictMode=xf;ot.Suspense=Ef;ot.isAsyncMode=function(e){return P$(e)||_n(e)===Em};ot.isConcurrentMode=P$;ot.isContextConsumer=function(e){return _n(e)===$f};ot.isContextProvider=function(e){return _n(e)===Sf};ot.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Cm};ot.isForwardRef=function(e){return _n(e)===Of};ot.isFragment=function(e){return _n(e)===bf};ot.isLazy=function(e){return _n(e)===_f};ot.isMemo=function(e){return _n(e)===Pf};ot.isPortal=function(e){return _n(e)===Om};ot.isProfiler=function(e){return _n(e)===wf};ot.isStrictMode=function(e){return _n(e)===xf};ot.isSuspense=function(e){return _n(e)===Ef};ot.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===bf||e===Cf||e===wf||e===xf||e===Ef||e===$V||typeof e=="object"&&e!==null&&(e.$$typeof===_f||e.$$typeof===Pf||e.$$typeof===Sf||e.$$typeof===$f||e.$$typeof===Of||e.$$typeof===OV||e.$$typeof===EV||e.$$typeof===PV||e.$$typeof===CV)};ot.typeOf=_n;E$.exports=ot;var _V=E$.exports,TV=sl,AV=la,kV="[object Number]";function jV(e){return typeof e=="number"||AV(e)&&TV(e)==kV}var _$=jV;const IV=yt(_$);var MV=_$;function RV(e){return MV(e)&&e!=+e}var DV=RV;const El=yt(DV);var nr=function(t){return t===0?0:t>0?1:-1},sh=function(t){return Ol(t)&&t.indexOf("%")===t.length-1},me=function(t){return IV(t)&&!El(t)},jt=function(t){return me(t)||Ol(t)},NV=0,Pl=function(t){var n=++NV;return"".concat(t||"").concat(n)},zi=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!me(t)&&!Ol(t))return r;var i;if(sh(t)){var a=t.indexOf("%");i=n*parseFloat(t.slice(0,a))/100}else i=+t;return El(i)&&(i=r),o&&i>n&&(i=n),i},ao=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},LV=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HV(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function ch(e){"@babel/helpers - typeof";return ch=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ch(e)}var yy={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart"},mo=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},by=null,Gd=null,_m=function e(t){if(t===by&&Array.isArray(Gd))return Gd;var n=[];return y.Children.forEach(t,function(r){Je(r)||(_V.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),Gd=n,by=t,n};function Wn(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(o){return mo(o)}):r=[mo(t)],_m(e).forEach(function(o){var i=zn(o,"type.displayName")||zn(o,"type.name");r.indexOf(i)!==-1&&n.push(o)}),n}function Mr(e,t){var n=Wn(e,t);return n&&n[0]}var xy=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,o=n.height;return!(!me(r)||r<=0||!me(o)||o<=0)},UV=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],GV=function(t){return t&&t.type&&Ol(t.type)&&UV.indexOf(t.type)>=0},KV=function(t){return t&&ch(t)==="object"&&"cx"in t&&"cy"in t&&"r"in t},qV=function(t,n,r,o){var i,a=(i=Ud==null?void 0:Ud[o])!==null&&i!==void 0?i:[];return!Ue(t)&&(o&&a.includes(n)||FV.includes(n))||r&&Pm.includes(n)},Qe=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var o=t;if(y.isValidElement(t)&&(o=t.props),!ca(o))return null;var i={};return Object.keys(o).forEach(function(a){var s;qV((s=o)===null||s===void 0?void 0:s[a],a,n,r)&&(i[a]=o[a])}),i},T$=function e(t,n){if(t===n)return!0;var r=y.Children.count(t);if(r!==y.Children.count(n))return!1;if(r===0)return!0;if(r===1)return wy(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JV(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function fh(e){var t=e.children,n=e.width,r=e.height,o=e.viewBox,i=e.className,a=e.style,s=e.title,l=e.desc,c=QV(e,ZV),u=o||{width:n,height:r,x:0,y:0},f=lt("recharts-surface",i);return E.createElement("svg",uh({},Qe(c,!0,"svg"),{className:f,width:n,height:r,style:a,viewBox:"".concat(u.x," ").concat(u.y," ").concat(u.width," ").concat(u.height)}),E.createElement("title",null,s),E.createElement("desc",null,l),t)}var eH=["children","className"];function dh(){return dh=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nH(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Pt=E.forwardRef(function(e,t){var n=e.children,r=e.className,o=tH(e,eH),i=lt("recharts-layer",r);return E.createElement("g",dh({className:i},Qe(o,!0),{ref:t}),n)}),Tf=function(t,n){for(var r=arguments.length,o=new Array(r>2?r-2:0),i=2;io?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r=r?e:iH(e,t,n)}var sH=aH,lH="\\ud800-\\udfff",cH="\\u0300-\\u036f",uH="\\ufe20-\\ufe2f",fH="\\u20d0-\\u20ff",dH=cH+uH+fH,pH="\\ufe0e\\ufe0f",hH="\\u200d",gH=RegExp("["+hH+lH+dH+pH+"]");function mH(e){return gH.test(e)}var A$=mH;function vH(e){return e.split("")}var yH=vH,k$="\\ud800-\\udfff",bH="\\u0300-\\u036f",xH="\\ufe20-\\ufe2f",wH="\\u20d0-\\u20ff",SH=bH+xH+wH,$H="\\ufe0e\\ufe0f",CH="["+k$+"]",ph="["+SH+"]",hh="\\ud83c[\\udffb-\\udfff]",OH="(?:"+ph+"|"+hh+")",j$="[^"+k$+"]",I$="(?:\\ud83c[\\udde6-\\uddff]){2}",M$="[\\ud800-\\udbff][\\udc00-\\udfff]",EH="\\u200d",R$=OH+"?",D$="["+$H+"]?",PH="(?:"+EH+"(?:"+[j$,I$,M$].join("|")+")"+D$+R$+")*",_H=D$+R$+PH,TH="(?:"+[j$+ph+"?",ph,I$,M$,CH].join("|")+")",AH=RegExp(hh+"(?="+hh+")|"+TH+_H,"g");function kH(e){return e.match(AH)||[]}var jH=kH,IH=yH,MH=A$,RH=jH;function DH(e){return MH(e)?RH(e):IH(e)}var NH=DH,LH=sH,BH=A$,FH=NH,zH=$$;function WH(e){return function(t){t=zH(t);var n=BH(t)?FH(t):void 0,r=n?n[0]:t.charAt(0),o=n?LH(n,1).join(""):t.slice(1);return r[e]()+o}}var VH=WH,HH=VH,UH=HH("toUpperCase"),GH=UH;const Af=yt(GH);function ft(e){return function(){return e}}const N$=Math.cos,Zc=Math.sin,ur=Math.sqrt,Qc=Math.PI,kf=2*Qc,gh=Math.PI,mh=2*gh,Mo=1e-6,KH=mh-Mo;function L$(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return L$;const n=10**t;return function(r){this._+=r[0];for(let o=1,i=r.length;oMo)if(!(Math.abs(f*l-c*u)>Mo)||!i)this._append`L${this._x1=t},${this._y1=n}`;else{let p=r-a,h=o-s,g=l*l+c*c,v=p*p+h*h,x=Math.sqrt(g),w=Math.sqrt(d),$=i*Math.tan((gh-Math.acos((g+d-v)/(2*x*w)))/2),C=$/w,S=$/x;Math.abs(C-1)>Mo&&this._append`L${t+C*u},${n+C*f}`,this._append`A${i},${i},0,0,${+(f*p>u*h)},${this._x1=t+S*l},${this._y1=n+S*c}`}}arc(t,n,r,o,i,a){if(t=+t,n=+n,r=+r,a=!!a,r<0)throw new Error(`negative radius: ${r}`);let s=r*Math.cos(o),l=r*Math.sin(o),c=t+s,u=n+l,f=1^a,d=a?o-i:i-o;this._x1===null?this._append`M${c},${u}`:(Math.abs(this._x1-c)>Mo||Math.abs(this._y1-u)>Mo)&&this._append`L${c},${u}`,r&&(d<0&&(d=d%mh+mh),d>KH?this._append`A${r},${r},0,1,${f},${t-s},${n-l}A${r},${r},0,1,${f},${this._x1=c},${this._y1=u}`:d>Mo&&this._append`A${r},${r},0,${+(d>=gh)},${f},${this._x1=t+r*Math.cos(i)},${this._y1=n+r*Math.sin(i)}`)}rect(t,n,r,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+o}h${-r}Z`}toString(){return this._}}function Tm(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new XH(t)}function Am(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function B$(e){this._context=e}B$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function jf(e){return new B$(e)}function F$(e){return e[0]}function z$(e){return e[1]}function W$(e,t){var n=ft(!0),r=null,o=jf,i=null,a=Tm(s);e=typeof e=="function"?e:e===void 0?F$:ft(e),t=typeof t=="function"?t:t===void 0?z$:ft(t);function s(l){var c,u=(l=Am(l)).length,f,d=!1,p;for(r==null&&(i=o(p=a())),c=0;c<=u;++c)!(c=p;--h)s.point($[h],C[h]);s.lineEnd(),s.areaEnd()}x&&($[d]=+e(v,d,f),C[d]=+t(v,d,f),s.point(r?+r(v,d,f):$[d],n?+n(v,d,f):C[d]))}if(w)return s=null,w+""||null}function u(){return W$().defined(o).curve(a).context(i)}return c.x=function(f){return arguments.length?(e=typeof f=="function"?f:ft(+f),r=null,c):e},c.x0=function(f){return arguments.length?(e=typeof f=="function"?f:ft(+f),c):e},c.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:ft(+f),c):r},c.y=function(f){return arguments.length?(t=typeof f=="function"?f:ft(+f),n=null,c):t},c.y0=function(f){return arguments.length?(t=typeof f=="function"?f:ft(+f),c):t},c.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:ft(+f),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(f){return arguments.length?(o=typeof f=="function"?f:ft(!!f),c):o},c.curve=function(f){return arguments.length?(a=f,i!=null&&(s=a(i)),c):a},c.context=function(f){return arguments.length?(f==null?i=s=null:s=a(i=f),c):i},c}class V${constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function YH(e){return new V$(e,!0)}function ZH(e){return new V$(e,!1)}const km={draw(e,t){const n=ur(t/Qc);e.moveTo(n,0),e.arc(0,0,n,0,kf)}},QH={draw(e,t){const n=ur(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},H$=ur(1/3),JH=H$*2,eU={draw(e,t){const n=ur(t/JH),r=n*H$;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},tU={draw(e,t){const n=ur(t),r=-n/2;e.rect(r,r,n,n)}},nU=.8908130915292852,U$=Zc(Qc/10)/Zc(7*Qc/10),rU=Zc(kf/10)*U$,oU=-N$(kf/10)*U$,iU={draw(e,t){const n=ur(t*nU),r=rU*n,o=oU*n;e.moveTo(0,-n),e.lineTo(r,o);for(let i=1;i<5;++i){const a=kf*i/5,s=N$(a),l=Zc(a);e.lineTo(l*n,-s*n),e.lineTo(s*r-l*o,l*r+s*o)}e.closePath()}},Kd=ur(3),aU={draw(e,t){const n=-ur(t/(Kd*3));e.moveTo(0,n*2),e.lineTo(-Kd*n,-n),e.lineTo(Kd*n,-n),e.closePath()}},An=-.5,kn=ur(3)/2,vh=1/ur(12),sU=(vh/2+1)*3,lU={draw(e,t){const n=ur(t/sU),r=n/2,o=n*vh,i=r,a=n*vh+n,s=-i,l=a;e.moveTo(r,o),e.lineTo(i,a),e.lineTo(s,l),e.lineTo(An*r-kn*o,kn*r+An*o),e.lineTo(An*i-kn*a,kn*i+An*a),e.lineTo(An*s-kn*l,kn*s+An*l),e.lineTo(An*r+kn*o,An*o-kn*r),e.lineTo(An*i+kn*a,An*a-kn*i),e.lineTo(An*s+kn*l,An*l-kn*s),e.closePath()}};function cU(e,t){let n=null,r=Tm(o);e=typeof e=="function"?e:ft(e||km),t=typeof t=="function"?t:ft(t===void 0?64:+t);function o(){let i;if(n||(n=i=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),i)return n=null,i+""||null}return o.type=function(i){return arguments.length?(e=typeof i=="function"?i:ft(i),o):e},o.size=function(i){return arguments.length?(t=typeof i=="function"?i:ft(+i),o):t},o.context=function(i){return arguments.length?(n=i??null,o):n},o}function Jc(){}function eu(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function G$(e){this._context=e}G$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:eu(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:eu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function uU(e){return new G$(e)}function K$(e){this._context=e}K$.prototype={areaStart:Jc,areaEnd:Jc,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:eu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function fU(e){return new K$(e)}function q$(e){this._context=e}q$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:eu(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function dU(e){return new q$(e)}function X$(e){this._context=e}X$.prototype={areaStart:Jc,areaEnd:Jc,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function pU(e){return new X$(e)}function $y(e){return e<0?-1:1}function Cy(e,t,n){var r=e._x1-e._x0,o=t-e._x1,i=(e._y1-e._y0)/(r||o<0&&-0),a=(n-e._y1)/(o||r<0&&-0),s=(i*o+a*r)/(r+o);return($y(i)+$y(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(s))||0}function Oy(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function qd(e,t,n){var r=e._x0,o=e._y0,i=e._x1,a=e._y1,s=(i-r)/3;e._context.bezierCurveTo(r+s,o+s*t,i-s,a-s*n,i,a)}function tu(e){this._context=e}tu.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:qd(this,this._t0,Oy(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,qd(this,Oy(this,n=Cy(this,e,t)),n);break;default:qd(this,this._t0,n=Cy(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Y$(e){this._context=new Z$(e)}(Y$.prototype=Object.create(tu.prototype)).point=function(e,t){tu.prototype.point.call(this,t,e)};function Z$(e){this._context=e}Z$.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,o,i){this._context.bezierCurveTo(t,e,r,n,i,o)}};function hU(e){return new tu(e)}function gU(e){return new Y$(e)}function Q$(e){this._context=e}Q$.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=Ey(e),o=Ey(t),i=0,a=1;a=0;--t)o[t]=(a[t]-o[t+1])/i[t];for(i[n-1]=(e[n]+o[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function vU(e){return new If(e,.5)}function yU(e){return new If(e,0)}function bU(e){return new If(e,1)}function Wi(e,t){if((a=e.length)>1)for(var n=1,r,o,i=e[t[0]],a,s=i.length;n=0;)n[t]=t;return n}function xU(e,t){return e[t]}function wU(e){const t=[];return t.key=e,t}function SU(){var e=ft([]),t=yh,n=Wi,r=xU;function o(i){var a=Array.from(e.apply(this,arguments),wU),s,l=a.length,c=-1,u;for(const f of i)for(s=0,++c;s0){for(var n,r,o=0,i=e[0].length,a;o0){for(var n=0,r=e[t[0]],o,i=r.length;n0)||!((i=(o=e[t[0]]).length)>0))){for(var n=0,r=1,o,i,a;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kU(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var J$={symbolCircle:km,symbolCross:QH,symbolDiamond:eU,symbolSquare:tU,symbolStar:iU,symbolTriangle:aU,symbolWye:lU},jU=Math.PI/180,IU=function(t){var n="symbol".concat(Af(t));return J$[n]||km},MU=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var o=18*jU;return 1.25*t*t*(Math.tan(o)-Math.tan(o*2)*Math.pow(Math.tan(o),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},RU=function(t,n){J$["symbol".concat(Af(t))]=n},jm=function(t){var n=t.type,r=n===void 0?"circle":n,o=t.size,i=o===void 0?64:o,a=t.sizeType,s=a===void 0?"area":a,l=AU(t,EU),c=_y(_y({},l),{},{type:r,size:i,sizeType:s}),u=function(){var v=IU(r),x=cU().type(v).size(MU(i,s,r));return x()},f=c.className,d=c.cx,p=c.cy,h=Qe(c,!0);return d===+d&&p===+p&&i===+i?E.createElement("path",bh({},h,{className:lt("recharts-symbols",f),transform:"translate(".concat(d,", ").concat(p,")"),d:u()})):null};jm.registerSymbol=RU;function Vi(e){"@babel/helpers - typeof";return Vi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vi(e)}function xh(){return xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function nu(e){return nu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},nu(e)}function ws(e,t,n){return t=eC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eC(e){var t=HU(e,"string");return Vi(t)==="symbol"?t:String(t)}function HU(e,t){if(Vi(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Vi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jn=32,Im=function(e){BU(n,e);var t=FU(n);function n(){return NU(this,n),t.apply(this,arguments)}return LU(n,[{key:"renderIcon",value:function(o){var i=this.props.inactiveColor,a=jn/2,s=jn/6,l=jn/3,c=o.inactive?i:o.color;if(o.type==="plainline")return E.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:o.payload.strokeDasharray,x1:0,y1:a,x2:jn,y2:a,className:"recharts-legend-icon"});if(o.type==="line")return E.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(a,"h").concat(l,` A`).concat(s,",").concat(s,",0,1,1,").concat(2*l,",").concat(a,` H`).concat(jn,"M").concat(2*l,",").concat(a,` - A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(o.type==="rect")return E.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(jn/8,"h").concat(jn,"v").concat(jn*3/4,"h").concat(-jn,"z"),className:"recharts-legend-icon"});if(E.isValidElement(o.legendIcon)){var u=MU({},o);return delete u.legendIcon,E.cloneElement(o.legendIcon,u)}return E.createElement(jm,{fill:c,cx:a,cy:a,size:jn,sizeType:"diameter",type:o.type})}},{key:"renderItems",value:function(){var o=this,i=this.props,a=i.payload,s=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,f={x:0,y:0,width:jn,height:jn},d={display:l==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(h,g){var v,x=h.formatter||c,w=lt((v={"recharts-legend-item":!0},ws(v,"legend-item-".concat(g),!0),ws(v,"inactive",h.inactive),v));if(h.type==="none")return null;var $=Ue(h.value)?null:h.value;_f(!Ue(h.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var C=h.inactive?u:h.color;return E.createElement("li",bh({className:w,style:d,key:"legend-item-".concat(g)},Yc(o.props,h,g)),E.createElement(uh,{width:s,height:s,viewBox:f,style:p},o.renderIcon(h)),E.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},x?x($,h,g):$))})}},{key:"render",value:function(){var o=this.props,i=o.payload,a=o.layout,s=o.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return E.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}]),n}(y.PureComponent);ws(Im,"displayName","Legend");ws(Im,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var VU="__lodash_hash_undefined__";function HU(e){return this.__data__.set(e,VU),this}var UU=HU;function GU(e){return this.__data__.has(e)}var KU=GU,qU=ew,XU=UU,YU=KU;function ru(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new qU;++ts))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var f=-1,d=!0,p=n&rG?new JU:void 0;for(i.set(e,t),i.set(t,e);++f-1}var aq=iq;function sq(e,t,n){for(var r=-1,o=e==null?0:e.length;++r=Sq){var c=t?null:xq(e);if(c)return wq(c);a=!1,o=bq,l=new mq}else l=t?[]:s;e:for(;++r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ou(e){return ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ou(e)}function If(e,t,n){return t=fC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fC(e){var t=Dq(e,"string");return Hi(t)==="symbol"?t:String(t)}function Dq(e,t){if(Hi(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Nq(e,t){if(e==null)return{};var n=Lq(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Lq(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Bq(e){return e.value}function Fq(e,t){if(E.isValidElement(e))return E.cloneElement(e,t);if(typeof e=="function")return E.createElement(e,t);t.ref;var n=Nq(t,Tq);return E.createElement(Im,n)}var Uy=1,Ss=function(e){jq(n,e);var t=Iq(n);function n(){var r;Aq(this,n);for(var o=arguments.length,i=new Array(o),a=0;aUy||Math.abs(i.height-this.lastBoundingBox.height)>Uy)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,o&&o(i))}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,o&&o(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ao({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(o){var i=this.props,a=i.layout,s=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,f=i.chartHeight,d,p;if(!o||(o.left===void 0||o.left===null)&&(o.right===void 0||o.right===null))if(s==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();d={left:((u||0)-h.width)/2}}else d=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!o||(o.top===void 0||o.top===null)&&(o.bottom===void 0||o.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();p={top:((f||0)-g.height)/2}}else p=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ao(Ao({},d),p)}},{key:"render",value:function(){var o=this,i=this.props,a=i.content,s=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,d=Ao(Ao({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return E.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(h){o.wrapperNode=h}},Fq(a,Ao(Ao({},this.props),{},{payload:cC(f,u,Bq)})))}}],[{key:"getWithHeight",value:function(o,i){var a=o.props.layout;return a==="vertical"&&me(o.props.height)?{height:o.props.height}:a==="horizontal"?{width:o.props.width||i}:null}}]),n}(y.PureComponent);If(Ss,"displayName","Legend");If(Ss,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Gy=$g,zq=rw,Wq=Kn,Ky=Gy?Gy.isConcatSpreadable:void 0;function Vq(e){return Wq(e)||zq(e)||!!(Ky&&e&&e[Ky])}var Hq=Vq,Uq=qO,Gq=Hq;function dC(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=Gq),o||(o=[]);++i0&&n(s)?t>1?dC(s,t-1,n,r,o):Uq(o,s):r||(o[o.length]=s)}return o}var pC=dC;function Kq(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++o];if(n(i[l],l,i)===!1)break}return t}}var qq=Kq,Xq=qq,Yq=Xq(),Zq=Yq,Qq=Zq,Jq=Cg;function eX(e,t){return e&&Qq(e,t,Jq)}var hC=eX,tX=Uu;function nX(e,t){return function(n,r){if(n==null)return n;if(!tX(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Object(n);(t?i--:++it||i&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!o)return 1;if(!r&&!i&&!c&&e=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return e.index-t.index}var mX=gX,Zd=Sm,vX=$m,yX=Co,bX=gC,xX=fX,wX=XO,SX=mX,$X=Sa,CX=Kn;function OX(e,t,n){t.length?t=Zd(t,function(i){return CX(i)?function(a){return vX(a,i.length===1?i[0]:i)}:i}):t=[$X];var r=-1;t=Zd(t,wX(yX));var o=bX(e,function(i,a,s){var l=Zd(t,function(c){return c(i)});return{criteria:l,index:++r,value:i}});return xX(o,function(i,a){return SX(i,a,n)})}var EX=OX;function PX(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var _X=PX,TX=_X,Xy=Math.max;function AX(e,t,n){return t=Xy(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Xy(r.length-t,0),a=Array(i);++o0){if(++t>=LX)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var WX=zX,VX=NX,HX=WX,UX=HX(VX),GX=UX,KX=Sa,qX=kX,XX=GX;function YX(e,t){return XX(qX(e,t,KX),e+"")}var ZX=YX,QX=tw,JX=Uu,eY=ow,tY=ll;function nY(e,t,n){if(!tY(n))return!1;var r=typeof t;return(r=="number"?JX(n)&&eY(t,n.length):r=="string"&&t in n)?QX(n[t],e):!1}var Mf=nY,rY=pC,oY=EX,iY=ZX,Zy=Mf,aY=iY(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Zy(e,t[0],t[1])?t=[]:n>2&&Zy(t[0],t[1],t[2])&&(t=[t[0]]),oY(e,rY(t,1),[])}),sY=aY;const Nm=yt(sY);function $s(e){"@babel/helpers - typeof";return $s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$s(e)}function lY(e,t){return dY(e)||fY(e,t)||uY(e,t)||cY()}function cY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uY(e,t){if(e){if(typeof e=="string")return Qy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qy(e,t)}}function Qy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function SY(e,t){return $a(e.getTime(),t.getTime())}function ob(e,t,n){if(e.size!==t.size)return!1;for(var r={},o=e.entries(),i=0,a,s;(a=o.next())&&!a.done;){for(var l=t.entries(),c=!1,u=0;(s=l.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,g=h[0],v=h[1];!c&&!r[u]&&(c=n.equals(d,g,i,u,e,t,n)&&n.equals(p,v,d,g,e,t,n))&&(r[u]=!0),u++}if(!c)return!1;i++}return!0}function $Y(e,t,n){var r=rb(e),o=r.length;if(rb(t).length!==o)return!1;for(var i;o-- >0;)if(i=r[o],i===vC&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!mC(t,i)||!n.equals(e[i],t[i],i,i,e,t,n))return!1;return!0}function Na(e,t,n){var r=tb(e),o=r.length;if(tb(t).length!==o)return!1;for(var i,a,s;o-- >0;)if(i=r[o],i===vC&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!mC(t,i)||!n.equals(e[i],t[i],i,i,e,t,n)||(a=nb(e,i),s=nb(t,i),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function CY(e,t){return $a(e.valueOf(),t.valueOf())}function OY(e,t){return e.source===t.source&&e.flags===t.flags}function ib(e,t,n){if(e.size!==t.size)return!1;for(var r={},o=e.values(),i,a;(i=o.next())&&!i.done;){for(var s=t.values(),l=!1,c=0;(a=s.next())&&!a.done;)!l&&!r[c]&&(l=n.equals(i.value,a.value,i.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function EY(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var PY="[object Arguments]",_Y="[object Boolean]",TY="[object Date]",AY="[object Map]",kY="[object Number]",jY="[object Object]",IY="[object RegExp]",MY="[object Set]",RY="[object String]",DY=Array.isArray,ab=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,sb=Object.assign,NY=Object.prototype.toString.call.bind(Object.prototype.toString);function LY(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,o=e.areObjectsEqual,i=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,l=e.areTypedArraysEqual;return function(u,f,d){if(u===f)return!0;if(u==null||f==null||typeof u!="object"||typeof f!="object")return u!==u&&f!==f;var p=u.constructor;if(p!==f.constructor)return!1;if(p===Object)return o(u,f,d);if(DY(u))return t(u,f,d);if(ab!=null&&ab(u))return l(u,f,d);if(p===Date)return n(u,f,d);if(p===RegExp)return a(u,f,d);if(p===Map)return r(u,f,d);if(p===Set)return s(u,f,d);var h=NY(u);return h===TY?n(u,f,d):h===IY?a(u,f,d):h===AY?r(u,f,d):h===MY?s(u,f,d):h===jY?typeof u.then!="function"&&typeof f.then!="function"&&o(u,f,d):h===PY?o(u,f,d):h===_Y||h===kY||h===RY?i(u,f,d):!1}}function BY(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,o={areArraysEqual:r?Na:wY,areDatesEqual:SY,areMapsEqual:r?eb(ob,Na):ob,areObjectsEqual:r?Na:$Y,arePrimitiveWrappersEqual:CY,areRegExpsEqual:OY,areSetsEqual:r?eb(ib,Na):ib,areTypedArraysEqual:r?Na:EY};if(n&&(o=sb({},o,n(o))),t){var i=ec(o.areArraysEqual),a=ec(o.areMapsEqual),s=ec(o.areObjectsEqual),l=ec(o.areSetsEqual);o=sb({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return o}function FY(e){return function(t,n,r,o,i,a,s){return e(t,n,s)}}function zY(e){var t=e.circular,n=e.comparator,r=e.createState,o=e.equals,i=e.strict;if(r)return function(l,c){var u=r(),f=u.cache,d=f===void 0?t?new WeakMap:void 0:f,p=u.meta;return n(l,c,{cache:d,equals:o,meta:p,strict:i})};if(t)return function(l,c){return n(l,c,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(l,c){return n(l,c,a)}}var WY=Oo();Oo({strict:!0});Oo({circular:!0});Oo({circular:!0,strict:!0});Oo({createInternalComparator:function(){return $a}});Oo({strict:!0,createInternalComparator:function(){return $a}});Oo({circular:!0,createInternalComparator:function(){return $a}});Oo({circular:!0,createInternalComparator:function(){return $a},strict:!0});function Oo(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,o=e.createState,i=e.strict,a=i===void 0?!1:i,s=BY(e),l=LY(s),c=r?r(l):FY(l);return zY({circular:n,comparator:l,createState:o,equals:c,strict:a})}function VY(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function lb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function o(i){n<0&&(n=i),i-n>t?(e(i),n=-1):VY(o)};requestAnimationFrame(r)}function Sh(e){"@babel/helpers - typeof";return Sh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sh(e)}function HY(e){return qY(e)||KY(e)||GY(e)||UY()}function UY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GY(e,t){if(e){if(typeof e=="string")return cb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cb(e,t)}}function cb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:x<0?0:x},g=function(x){for(var w=x>1?1:x,$=w,C=0;C<8;++C){var S=f($)-w,b=p($);if(Math.abs(S-w)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,o=t.damping,i=o===void 0?8:o,a=t.dt,s=a===void 0?17:a,l=function(u,f,d){var p=-(u-f)*r,h=d*i,g=d+(p-h)*s/1e3,v=d*s/1e3+u;return Math.abs(v-f)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function TZ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Jd(e){return IZ(e)||jZ(e)||kZ(e)||AZ()}function AZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kZ(e,t){if(e){if(typeof e=="string")return Ph(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ph(e,t)}}function jZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function IZ(e){if(Array.isArray(e))return Ph(e)}function Ph(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function lu(e){return lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lu(e)}var Gr=function(e){NZ(n,e);var t=LZ(n);function n(r,o){var i;MZ(this,n),i=t.call(this,r,o);var a=i.props,s=a.isActive,l=a.attributeName,c=a.from,u=a.to,f=a.steps,d=a.children,p=a.duration;if(i.handleStyleChange=i.handleStyleChange.bind(Ah(i)),i.changeStyle=i.changeStyle.bind(Ah(i)),!s||p<=0)return i.state={style:{}},typeof d=="function"&&(i.state={style:u}),Th(i);if(f&&f.length)i.state={style:f[0].style};else if(c){if(typeof d=="function")return i.state={style:c},Th(i);i.state={style:l?Ya({},l,c):c}}else i.state={style:{}};return i}return RZ(n,[{key:"componentDidMount",value:function(){var o=this.props,i=o.isActive,a=o.canBegin;this.mounted=!0,!(!i||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(o){var i=this.props,a=i.isActive,s=i.canBegin,l=i.attributeName,c=i.shouldReAnimate,u=i.to,f=i.from,d=this.state.style;if(s){if(!a){var p={style:l?Ya({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(p);return}if(!(WY(o.to,u)&&o.canBegin&&o.isActive)){var h=!o.canBegin||!o.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=h||c?f:o.to;if(this.state&&d){var v={style:l?Ya({},l,g):g};(l&&[l]!==g||!l&&d!==g)&&this.setState(v)}this.runAnimation(Zn(Zn({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var o=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),o&&o()}},{key:"handleStyleChange",value:function(o){this.changeStyle(o)}},{key:"changeStyle",value:function(o){this.mounted&&this.setState({style:o})}},{key:"runJSAnimation",value:function(o){var i=this,a=o.from,s=o.to,l=o.duration,c=o.easing,u=o.begin,f=o.onAnimationEnd,d=o.onAnimationStart,p=EZ(a,s,gZ(c),l,this.changeStyle),h=function(){i.stopJSAnimation=p()};this.manager.start([d,u,h,l,f])}},{key:"runStepAnimation",value:function(o){var i=this,a=o.steps,s=o.begin,l=o.onAnimationStart,c=a[0],u=c.style,f=c.duration,d=f===void 0?0:f,p=function(g,v,x){if(x===0)return g;var w=v.duration,$=v.easing,C=$===void 0?"ease":$,S=v.style,b=v.properties,O=v.onAnimationEnd,P=x>0?a[x-1]:v,T=b||Object.keys(S);if(typeof C=="function"||C==="spring")return[].concat(Jd(g),[i.runJSAnimation.bind(i,{from:P.style,to:S,duration:w,easing:C}),w]);var k=fb(T,w,C),_=Zn(Zn(Zn({},P.style),S),{},{transition:k});return[].concat(Jd(g),[_,w,O]).filter(nZ)};return this.manager.start([l].concat(Jd(a.reduce(p,[u,Math.max(d,s)])),[o.onAnimationEnd]))}},{key:"runAnimation",value:function(o){this.manager||(this.manager=XY());var i=o.begin,a=o.duration,s=o.attributeName,l=o.to,c=o.easing,u=o.onAnimationStart,f=o.onAnimationEnd,d=o.steps,p=o.children,h=this.manager;if(this.unSubscribe=h.subscribe(this.handleStyleChange),typeof c=="function"||typeof p=="function"||c==="spring"){this.runJSAnimation(o);return}if(d.length>1){this.runStepAnimation(o);return}var g=s?Ya({},s,l):l,v=fb(Object.keys(g),a,c);h.start([u,i,Zn(Zn({},g),{},{transition:v}),a,f])}},{key:"render",value:function(){var o=this.props,i=o.children;o.begin;var a=o.duration;o.attributeName,o.easing;var s=o.isActive;o.steps,o.from,o.to,o.canBegin,o.onAnimationEnd,o.shouldReAnimate,o.onAnimationReStart;var l=_Z(o,PZ),c=y.Children.count(i),u=Lm(this.state.style);if(typeof i=="function")return i(u);if(!s||c===0||a<=0)return i;var f=function(p){var h=p.props,g=h.style,v=g===void 0?{}:g,x=h.className,w=y.cloneElement(p,Zn(Zn({},l),{},{style:Zn(Zn({},v),u),className:x}));return w};return c===1?f(y.Children.only(i)):E.createElement("div",null,y.Children.map(i,function(d){return f(d)}))}}]),n}(y.PureComponent);Gr.displayName="Animate";Gr.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Gr.propTypes={from:Ee.oneOfType([Ee.object,Ee.string]),to:Ee.oneOfType([Ee.object,Ee.string]),attributeName:Ee.string,duration:Ee.number,begin:Ee.number,easing:Ee.oneOfType([Ee.string,Ee.func]),steps:Ee.arrayOf(Ee.shape({duration:Ee.number.isRequired,style:Ee.object.isRequired,easing:Ee.oneOfType([Ee.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ee.func]),properties:Ee.arrayOf("string"),onAnimationEnd:Ee.func})),children:Ee.oneOfType([Ee.node,Ee.func]),isActive:Ee.bool,canBegin:Ee.bool,onAnimationEnd:Ee.func,shouldReAnimate:Ee.bool,onAnimationStart:Ee.func,onAnimationReStart:Ee.func};Number.isFinite===void 0&&(Number.isFinite=function(e){return typeof e=="number"&&isFinite(e)});Ee.object,Ee.object,Ee.object,Ee.element;Ee.object,Ee.object,Ee.object,Ee.oneOfType([Ee.array,Ee.element]),Ee.any;function Es(e){"@babel/helpers - typeof";return Es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Es(e)}function tc(e,t,n){return t=FZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function FZ(e){var t=zZ(e,"string");return Es(t)==="symbol"?t:String(t)}function zZ(e,t){if(Es(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Es(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var La="recharts-tooltip-wrapper",WZ={visibility:"hidden"};function VZ(e){var t,n=e.coordinate,r=e.translateX,o=e.translateY;return lt(La,(t={},tc(t,"".concat(La,"-right"),me(r)&&n&&me(n.x)&&r>=n.x),tc(t,"".concat(La,"-left"),me(r)&&n&&me(n.x)&&r=n.y),tc(t,"".concat(La,"-top"),me(o)&&n&&me(n.y)&&og?Math.max(u,l[r]):Math.max(f,l[r])}function HZ(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return Lm({transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")})}function UZ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,o=e.position,i=e.reverseDirection,a=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,c,u,f;return a.height>0&&a.width>0&&n?(u=yb({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:o,reverseDirection:i,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),f=yb({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:o,reverseDirection:i,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=HZ({translateX:u,translateY:f,useTranslate3d:s})):c=WZ,{cssProperties:c,cssClasses:VZ({translateX:u,translateY:f,coordinate:n})}}function Ki(e){"@babel/helpers - typeof";return Ki=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ki(e)}function bb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function ep(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cu(e){return cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cu(e)}function mc(e,t,n){return t=$C(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $C(e){var t=QZ(e,"string");return Ki(t)==="symbol"?t:String(t)}function QZ(e,t){if(Ki(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ki(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wb=1,JZ=function(e){qZ(n,e);var t=XZ(n);function n(){var r;GZ(this,n);for(var o=arguments.length,i=new Array(o),a=0;awb||Math.abs(o.height-this.lastBoundingBox.height)>wb)&&(this.lastBoundingBox.width=o.width,this.lastBoundingBox.height=o.height)}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var o,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((o=this.props.coordinate)===null||o===void 0?void 0:o.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var o=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,f=i.coordinate,d=i.hasPayload,p=i.isAnimationActive,h=i.offset,g=i.position,v=i.reverseDirection,x=i.useTranslate3d,w=i.viewBox,$=i.wrapperStyle,C=UZ({allowEscapeViewBox:s,coordinate:f,offsetTopLeft:h,position:g,reverseDirection:v,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:x,viewBox:w}),S=C.cssClasses,b=C.cssProperties,O=ep(ep(ep({},p&&a&&Lm({transition:"transform ".concat(l,"ms ").concat(c)})),b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&d?"visible":"hidden",position:"absolute",top:0,left:0},$);return E.createElement("div",{tabIndex:-1,role:"dialog",className:S,style:O,ref:function(T){o.wrapperNode=T}},u)}}]),n}(y.PureComponent),eQ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Br={isSsr:eQ(),get:function(t){return Br[t]},set:function(t,n){if(typeof t=="string")Br[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(o){Br[o]=t[o]})}}};function qi(e){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qi(e)}function Sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function $b(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function uu(e){return uu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},uu(e)}function Bm(e,t,n){return t=CC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CC(e){var t=lQ(e,"string");return qi(t)==="symbol"?t:String(t)}function lQ(e,t){if(qi(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(qi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cQ(e){return e.dataKey}function uQ(e,t){return E.isValidElement(e)?E.cloneElement(e,t):typeof e=="function"?E.createElement(e,t):E.createElement(vY,t)}var Bo=function(e){rQ(n,e);var t=oQ(n);function n(){return tQ(this,n),t.apply(this,arguments)}return nQ(n,[{key:"render",value:function(){var o=this.props,i=o.active,a=o.allowEscapeViewBox,s=o.animationDuration,l=o.animationEasing,c=o.content,u=o.coordinate,f=o.filterNull,d=o.isAnimationActive,p=o.offset,h=o.payload,g=o.payloadUniqBy,v=o.position,x=o.reverseDirection,w=o.useTranslate3d,$=o.viewBox,C=o.wrapperStyle,S=h??[];f&&S.length&&(S=cC(h.filter(function(O){return O.value!=null}),g,cQ));var b=S.length>0;return E.createElement(JZ,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:d,active:i,coordinate:u,hasPayload:b,offset:p,position:v,reverseDirection:x,useTranslate3d:w,viewBox:$,wrapperStyle:C},uQ(c,$b($b({},this.props),{},{payload:S})))}}]),n}(y.PureComponent);Bm(Bo,"displayName","Tooltip");Bm(Bo,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Br.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var fQ=ZO,dQ=function(){return fQ.Date.now()},pQ=dQ,hQ=/\s/;function gQ(e){for(var t=e.length;t--&&hQ.test(e.charAt(t)););return t}var mQ=gQ,vQ=mQ,yQ=/^\s+/;function bQ(e){return e&&e.slice(0,vQ(e)+1).replace(yQ,"")}var xQ=bQ,wQ=xQ,Ob=ll,SQ=wa,Eb=0/0,$Q=/^[-+]0x[0-9a-f]+$/i,CQ=/^0b[01]+$/i,OQ=/^0o[0-7]+$/i,EQ=parseInt;function PQ(e){if(typeof e=="number")return e;if(SQ(e))return Eb;if(Ob(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ob(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=wQ(e);var n=CQ.test(e);return n||OQ.test(e)?EQ(e.slice(2),n?2:8):$Q.test(e)?Eb:+e}var OC=PQ,_Q=ll,tp=pQ,Pb=OC,TQ="Expected a function",AQ=Math.max,kQ=Math.min;function jQ(e,t,n){var r,o,i,a,s,l,c=0,u=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(TQ);t=Pb(t)||0,_Q(n)&&(u=!!n.leading,f="maxWait"in n,i=f?AQ(Pb(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function p(b){var O=r,P=o;return r=o=void 0,c=b,a=e.apply(P,O),a}function h(b){return c=b,s=setTimeout(x,t),u?p(b):a}function g(b){var O=b-l,P=b-c,T=t-O;return f?kQ(T,i-P):T}function v(b){var O=b-l,P=b-c;return l===void 0||O>=t||O<0||f&&P>=i}function x(){var b=tp();if(v(b))return w(b);s=setTimeout(x,g(b))}function w(b){return s=void 0,d&&r?p(b):(r=o=void 0,a)}function $(){s!==void 0&&clearTimeout(s),c=0,r=l=o=s=void 0}function C(){return s===void 0?a:w(tp())}function S(){var b=tp(),O=v(b);if(r=arguments,o=this,l=b,O){if(s===void 0)return h(l);if(f)return clearTimeout(s),s=setTimeout(x,t),p(l)}return s===void 0&&(s=setTimeout(x,t)),a}return S.cancel=$,S.flush=C,S}var IQ=jQ,MQ=IQ,RQ=ll,DQ="Expected a function";function NQ(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(DQ);return RQ(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),MQ(e,t,{leading:r,maxWait:t,trailing:o})}var LQ=NQ;const BQ=yt(LQ);var EC=function(t){return null};EC.displayName="Cell";function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function _b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Ih(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Br.isSsr)return{width:0,height:0};var r=UQ(n),o=JSON.stringify({text:t,copyStyle:r});if(fi.widthCache[o])return fi.widthCache[o];try{var i=document.getElementById(Tb);i||(i=document.createElement("span"),i.setAttribute("id",Tb),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var a=Ih(Ih({},HQ),r);Object.assign(i.style,a),i.textContent="".concat(t);var s=i.getBoundingClientRect(),l={width:s.width,height:s.height};return fi.widthCache[o]=l,++fi.cacheCount>VQ&&(fi.cacheCount=0,fi.widthCache={}),l}catch{return{width:0,height:0}}},GQ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function _s(e){"@babel/helpers - typeof";return _s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_s(e)}function fu(e,t){return YQ(e)||XQ(e,t)||qQ(e,t)||KQ()}function KQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qQ(e,t){if(e){if(typeof e=="string")return Ab(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ab(e,t)}}function Ab(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function uJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Db(e,t){return hJ(e)||pJ(e,t)||dJ(e,t)||fJ()}function fJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dJ(e,t){if(e){if(typeof e=="string")return Nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nb(e,t)}}function Nb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return M.reduce(function(D,L){var B=L.word,F=L.width,Z=D[D.length-1];if(Z&&(o==null||i||Z.width+F+rL.width?D:L})};if(!u)return p;for(var g="…",v=function(M){var D=f.slice(0,M),L=AC({breakAll:c,style:l,children:D+g}).wordsWithComputedWidth,B=d(L),F=B.length>a||h(B).width>Number(o);return[F,B]},x=0,w=f.length-1,$=0,C;x<=w&&$<=f.length-1;){var S=Math.floor((x+w)/2),b=S-1,O=v(b),P=Db(O,2),T=P[0],k=P[1],_=v(S),A=Db(_,1),I=A[0];if(!T&&!I&&(x=S+1),T&&I&&(w=S-1),!T&&I){C=k;break}$++}return C||p},Lb=function(t){var n=Je(t)?[]:t.toString().split(TC);return[{words:n}]},mJ=function(t){var n=t.width,r=t.scaleToFit,o=t.children,i=t.style,a=t.breakAll,s=t.maxLines;if((n||r)&&!Br.isSsr){var l,c,u=AC({breakAll:a,children:o,style:i});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return Lb(o);return gJ({breakAll:a,children:o,maxLines:s,style:i},l,c,n,r)}return Lb(o)},Bb="#808080",du=function(t){var n=t.x,r=n===void 0?0:n,o=t.y,i=o===void 0?0:o,a=t.lineHeight,s=a===void 0?"1em":a,l=t.capHeight,c=l===void 0?"0.71em":l,u=t.scaleToFit,f=u===void 0?!1:u,d=t.textAnchor,p=d===void 0?"start":d,h=t.verticalAnchor,g=h===void 0?"end":h,v=t.fill,x=v===void 0?Bb:v,w=Rb(t,lJ),$=y.useMemo(function(){return mJ({breakAll:w.breakAll,children:w.children,maxLines:w.maxLines,scaleToFit:f,style:w.style,width:w.width})},[w.breakAll,w.children,w.maxLines,f,w.style,w.width]),C=w.dx,S=w.dy,b=w.angle,O=w.className,P=w.breakAll,T=Rb(w,cJ);if(!jt(r)||!jt(i))return null;var k=r+(me(C)?C:0),_=i+(me(S)?S:0),A;switch(g){case"start":A=np("calc(".concat(c,")"));break;case"middle":A=np("calc(".concat(($.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:A=np("calc(".concat($.length-1," * -").concat(s,")"));break}var I=[];if(f){var j=$[0].width,M=w.width;I.push("scale(".concat((me(M)?M/j:1)/j,")"))}return b&&I.push("rotate(".concat(b,", ").concat(k,", ").concat(_,")")),I.length&&(T.transform=I.join(" ")),E.createElement("text",Mh({},Qe(T,!0),{x:k,y:_,className:lt("recharts-text",O),textAnchor:p,fill:x.includes("url")?Bb:x}),$.map(function(D,L){var B=D.words.join(P?"":" ");return E.createElement("tspan",{x:k,dy:L===0?A:s,key:B},B)}))};function vo(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function vJ(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Fm(e){let t,n,r;e.length!==2?(t=vo,n=(s,l)=>vo(e(s),l),r=(s,l)=>e(s)-l):(t=e===vo||e===vJ?e:yJ,n=e,r=e);function o(s,l,c=0,u=s.length){if(c>>1;n(s[f],l)<0?c=f+1:u=f}while(c>>1;n(s[f],l)<=0?c=f+1:u=f}while(cc&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:o,center:a,right:i}}function yJ(){return 0}function kC(e){return e===null?NaN:+e}function*bJ(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const xJ=Fm(vo),wJ=xJ.right;Fm(kC).center;const _l=wJ;class Fb extends Map{constructor(t,n=CJ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,o]of t)this.set(r,o)}get(t){return super.get(zb(this,t))}has(t){return super.has(zb(this,t))}set(t,n){return super.set(SJ(this,t),n)}delete(t){return super.delete($J(this,t))}}function zb({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function SJ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function $J({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function CJ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function OJ(e=vo){if(e===vo)return jC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function jC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const EJ=Math.sqrt(50),PJ=Math.sqrt(10),_J=Math.sqrt(2);function pu(e,t,n){const r=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),a=i>=EJ?10:i>=PJ?5:i>=_J?2:1;let s,l,c;return o<0?(c=Math.pow(10,-o)/a,s=Math.round(e*c),l=Math.round(t*c),s/ct&&--l,c=-c):(c=Math.pow(10,o)*a,s=Math.round(e/c),l=Math.round(t/c),s*ct&&--l),l0))return[];if(e===t)return[e];const r=t=o))return[];const s=i-o+1,l=new Array(s);if(r)if(a<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(n=o)&&(n=o)}return n}function Vb(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function IC(e,t,n=0,r=1/0,o){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(o=o===void 0?jC:OJ(o);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(t-c*f/l+d)),h=Math.min(r,Math.floor(t+(l-c)*f/l+d));IC(e,t,p,h,o)}const i=e[t];let a=n,s=r;for(Ba(e,n,t),o(e[r],i)>0&&Ba(e,n,r);a0;)--s}o(e[n],i)===0?Ba(e,n,s):(++s,Ba(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Ba(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function TJ(e,t,n){if(e=Float64Array.from(bJ(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Vb(e);if(t>=1)return Wb(e);var r,o=(r-1)*t,i=Math.floor(o),a=Wb(IC(e,i).subarray(0,i+1)),s=Vb(e.subarray(i+1));return a+(s-a)*(o-i)}}function AJ(e,t,n=kC){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,i=Math.floor(o),a=+n(e[i],i,e),s=+n(e[i+1],i+1,e);return a+(s-a)*(o-i)}}function kJ(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=IJ.exec(e))?new fn(t[1],t[2],t[3],1):(t=MJ.exec(e))?new fn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=RJ.exec(e))?rc(t[1],t[2],t[3],t[4]):(t=DJ.exec(e))?rc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=NJ.exec(e))?Yb(t[1],t[2]/100,t[3]/100,1):(t=LJ.exec(e))?Yb(t[1],t[2]/100,t[3]/100,t[4]):Hb.hasOwnProperty(e)?Kb(Hb[e]):e==="transparent"?new fn(NaN,NaN,NaN,0):null}function Kb(e){return new fn(e>>16&255,e>>8&255,e&255,1)}function rc(e,t,n,r){return r<=0&&(e=t=n=NaN),new fn(e,t,n,r)}function zJ(e){return e instanceof Tl||(e=js(e)),e?(e=e.rgb(),new fn(e.r,e.g,e.b,e.opacity)):new fn}function Bh(e,t,n,r){return arguments.length===1?zJ(e):new fn(e,t,n,r??1)}function fn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Wm(fn,Bh,RC(Tl,{brighter(e){return e=e==null?hu:Math.pow(hu,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?As:Math.pow(As,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fn(Uo(this.r),Uo(this.g),Uo(this.b),gu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qb,formatHex:qb,formatHex8:WJ,formatRgb:Xb,toString:Xb}));function qb(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}`}function WJ(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}${Fo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xb(){const e=gu(this.opacity);return`${e===1?"rgb(":"rgba("}${Uo(this.r)}, ${Uo(this.g)}, ${Uo(this.b)}${e===1?")":`, ${e})`}`}function gu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fo(e){return e=Uo(e),(e<16?"0":"")+e.toString(16)}function Yb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tr(e,t,n,r)}function DC(e){if(e instanceof tr)return new tr(e.h,e.s,e.l,e.opacity);if(e instanceof Tl||(e=js(e)),!e)return new tr;if(e instanceof tr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(t===i?a=(n-r)/s+(n0&&l<1?0:a,new tr(a,s,l,e.opacity)}function VJ(e,t,n,r){return arguments.length===1?DC(e):new tr(e,t,n,r??1)}function tr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Wm(tr,VJ,RC(Tl,{brighter(e){return e=e==null?hu:Math.pow(hu,e),new tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?As:Math.pow(As,e),new tr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new fn(rp(e>=240?e-240:e+120,o,r),rp(e,o,r),rp(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new tr(Zb(this.h),oc(this.s),oc(this.l),gu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=gu(this.opacity);return`${e===1?"hsl(":"hsla("}${Zb(this.h)}, ${oc(this.s)*100}%, ${oc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Zb(e){return e=(e||0)%360,e<0?e+360:e}function oc(e){return Math.max(0,Math.min(1,e||0))}function rp(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Vm=e=>()=>e;function HJ(e,t){return function(n){return e+n*t}}function UJ(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function GJ(e){return(e=+e)==1?NC:function(t,n){return n-t?UJ(t,n,e):Vm(isNaN(t)?n:t)}}function NC(e,t){var n=t-e;return n?HJ(e,n):Vm(isNaN(e)?t:e)}const Qb=function e(t){var n=GJ(t);function r(o,i){var a=n((o=Bh(o)).r,(i=Bh(i)).r),s=n(o.g,i.g),l=n(o.b,i.b),c=NC(o.opacity,i.opacity);return function(u){return o.r=a(u),o.g=s(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r}(1);function KJ(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;on&&(i=t.slice(n,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:mu(r,o)})),n=op.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function oee(e,t,n){var r=e[0],o=e[1],i=t[0],a=t[1];return o2?iee:oee,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?i:(l||(l=s(e.map(r),t,n)))(r(a(d)))}return f.invert=function(d){return a(o((c||(c=s(t,e.map(r),mu)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,vu),u()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=Hm,u()},f.clamp=function(d){return arguments.length?(a=d?!0:ln,u()):a!==ln},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(i=d,f):i},function(d,p){return r=d,o=p,u()}}function Um(){return Rf()(ln,ln)}function aee(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function yu(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Xi(e){return e=yu(Math.abs(e)),e?e[1]:NaN}function see(e,t){return function(n,r){for(var o=n.length,i=[],a=0,s=e[0],l=0;o>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(n.substring(o-=s,o+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return i.reverse().join(t)}}function lee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var cee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Is(e){if(!(t=cee.exec(e)))throw new Error("invalid format: "+e);var t;return new Gm({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Is.prototype=Gm.prototype;function Gm(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Gm.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function uee(e){e:for(var t=e.length,n=1,r=-1,o;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(o+1):e}var LC;function fee(e,t){var n=yu(e,t);if(!n)return e+"";var r=n[0],o=n[1],i=o-(LC=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+yu(e,Math.max(0,t+i-1))[0]}function ex(e,t){var n=yu(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}const tx={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:aee,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ex(e*100,t),r:ex,s:fee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function nx(e){return e}var rx=Array.prototype.map,ox=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function dee(e){var t=e.grouping===void 0||e.thousands===void 0?nx:see(rx.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",o=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?nx:lee(rx.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f){f=Is(f);var d=f.fill,p=f.align,h=f.sign,g=f.symbol,v=f.zero,x=f.width,w=f.comma,$=f.precision,C=f.trim,S=f.type;S==="n"?(w=!0,S="g"):tx[S]||($===void 0&&($=12),C=!0,S="g"),(v||d==="0"&&p==="=")&&(v=!0,d="0",p="=");var b=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",O=g==="$"?r:/[%p]/.test(S)?a:"",P=tx[S],T=/[defgprs%]/.test(S);$=$===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,$)):Math.max(0,Math.min(20,$));function k(_){var A=b,I=O,j,M,D;if(S==="c")I=P(_)+I,_="";else{_=+_;var L=_<0||1/_<0;if(_=isNaN(_)?l:P(Math.abs(_),$),C&&(_=uee(_)),L&&+_==0&&h!=="+"&&(L=!1),A=(L?h==="("?h:s:h==="-"||h==="("?"":h)+A,I=(S==="s"?ox[8+LC/3]:"")+I+(L&&h==="("?")":""),T){for(j=-1,M=_.length;++jD||D>57){I=(D===46?o+_.slice(j+1):_.slice(j))+I,_=_.slice(0,j);break}}}w&&!v&&(_=t(_,1/0));var B=A.length+_.length+I.length,F=B>1)+A+_+I+F.slice(B);break;default:_=F+A+_+I;break}return i(_)}return k.toString=function(){return f+""},k}function u(f,d){var p=c((f=Is(f),f.type="f",f)),h=Math.max(-8,Math.min(8,Math.floor(Xi(d)/3)))*3,g=Math.pow(10,-h),v=ox[8+h/3];return function(x){return p(g*x)+v}}return{format:c,formatPrefix:u}}var ic,Km,BC;pee({thousands:",",grouping:[3],currency:["$",""]});function pee(e){return ic=dee(e),Km=ic.format,BC=ic.formatPrefix,ic}function hee(e){return Math.max(0,-Xi(Math.abs(e)))}function gee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xi(t)/3)))*3-Xi(Math.abs(e)))}function mee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xi(t)-Xi(e))+1}function FC(e,t,n,r){var o=Nh(e,t,n),i;switch(r=Is(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=gee(o,a))&&(r.precision=i),BC(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=mee(o,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=hee(o))&&(r.precision=i-(r.type==="%")*2);break}}return Km(r)}function Eo(e){var t=e.domain;return e.ticks=function(n){var r=t();return Rh(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var o=t();return FC(o[0],o[o.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),o=0,i=r.length-1,a=r[o],s=r[i],l,c,u=10;for(s0;){if(c=Dh(a,s,n),c===l)return r[o]=a,r[i]=s,t(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return e},e}function bu(){var e=Um();return e.copy=function(){return Al(e,bu())},Xn.apply(e,arguments),Eo(e)}function zC(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,vu),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return zC(e).unknown(t)},e=arguments.length?Array.from(e,vu):[0,1],Eo(n)}function WC(e,t){e=e.slice();var n=0,r=e.length-1,o=e[n],i=e[r],a;return iMath.pow(e,t)}function wee(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function sx(e){return(t,n)=>-e(-t,n)}function qm(e){const t=e(ix,ax),n=t.domain;let r=10,o,i;function a(){return o=wee(r),i=xee(r),n()[0]<0?(o=sx(o),i=sx(i),e(vee,yee)):e(ix,ax),t}return t.base=function(s){return arguments.length?(r=+s,a()):r},t.domain=function(s){return arguments.length?(n(s),a()):n()},t.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;d<=p;++d)for(h=1;hu)break;x.push(g)}}else for(;d<=p;++d)for(h=r-1;h>=1;--h)if(g=d>0?h/i(-d):h*i(d),!(gu)break;x.push(g)}x.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Is(l)).precision==null&&(l.trim=!0),l=Km(l)),s===1/0)return l;const c=Math.max(1,r*s/t.ticks().length);return u=>{let f=u/i(Math.round(o(u)));return f*rn(WC(n(),{floor:s=>i(Math.floor(o(s))),ceil:s=>i(Math.ceil(o(s)))})),t}function VC(){const e=qm(Rf()).domain([1,10]);return e.copy=()=>Al(e,VC()).base(e.base()),Xn.apply(e,arguments),e}function lx(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function cx(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Xm(e){var t=1,n=e(lx(t),cx(t));return n.constant=function(r){return arguments.length?e(lx(t=+r),cx(t)):t},Eo(n)}function HC(){var e=Xm(Rf());return e.copy=function(){return Al(e,HC()).constant(e.constant())},Xn.apply(e,arguments)}function ux(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function See(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function $ee(e){return e<0?-e*e:e*e}function Ym(e){var t=e(ln,ln),n=1;function r(){return n===1?e(ln,ln):n===.5?e(See,$ee):e(ux(n),ux(1/n))}return t.exponent=function(o){return arguments.length?(n=+o,r()):n},Eo(t)}function Zm(){var e=Ym(Rf());return e.copy=function(){return Al(e,Zm()).exponent(e.exponent())},Xn.apply(e,arguments),e}function Cee(){return Zm.apply(null,arguments).exponent(.5)}function fx(e){return Math.sign(e)*e*e}function Oee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function UC(){var e=Um(),t=[0,1],n=!1,r;function o(i){var a=Oee(e(i));return isNaN(a)?r:n?Math.round(a):a}return o.invert=function(i){return e.invert(fx(i))},o.domain=function(i){return arguments.length?(e.domain(i),o):e.domain()},o.range=function(i){return arguments.length?(e.range((t=Array.from(i,vu)).map(fx)),o):t.slice()},o.rangeRound=function(i){return o.range(i).round(!0)},o.round=function(i){return arguments.length?(n=!!i,o):n},o.clamp=function(i){return arguments.length?(e.clamp(i),o):e.clamp()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.copy=function(){return UC(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Xn.apply(o,arguments),Eo(o)}function GC(){var e=[],t=[],n=[],r;function o(){var a=0,s=Math.max(1,t.length);for(n=new Array(s-1);++a0?n[s-1]:e[0],s=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(i=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return KC().domain([e,t]).range(o).unknown(i)},Xn.apply(Eo(a),arguments)}function qC(){var e=[.5],t=[0,1],n,r=1;function o(i){return i!=null&&i<=i?t[_l(e,i,0,r)]:n}return o.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),o):e.slice()},o.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),o):t.slice()},o.invertExtent=function(i){var a=t.indexOf(i);return[e[a-1],e[a]]},o.unknown=function(i){return arguments.length?(n=i,o):n},o.copy=function(){return qC().domain(e).range(t).unknown(n)},Xn.apply(o,arguments)}const ip=new Date,ap=new Date;function Rt(e,t,n,r){function o(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(e(i=new Date(+i)),i),o.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),o.round=i=>{const a=o(i),s=o.ceil(i);return i-a(t(i=new Date(+i),a==null?1:Math.floor(a)),i),o.range=(i,a,s)=>{const l=[];if(i=o.ceil(i),s=s==null?1:Math.floor(s),!(i0))return l;let c;do l.push(c=new Date(+i)),t(i,s),e(i);while(cRt(a=>{if(a>=a)for(;e(a),!i(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!i(a););else for(;--s>=0;)for(;t(a,1),!i(a););}),n&&(o.count=(i,a)=>(ip.setTime(+i),ap.setTime(+a),e(ip),e(ap),Math.floor(n(ip,ap))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(r?a=>r(a)%i===0:a=>o.count(0,a)%i===0):o)),o}const xu=Rt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);xu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Rt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):xu);xu.range;const Rr=1e3,Bn=Rr*60,Dr=Bn*60,Kr=Dr*24,Qm=Kr*7,dx=Kr*30,sp=Kr*365,zo=Rt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Rr)},(e,t)=>(t-e)/Rr,e=>e.getUTCSeconds());zo.range;const Jm=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rr)},(e,t)=>{e.setTime(+e+t*Bn)},(e,t)=>(t-e)/Bn,e=>e.getMinutes());Jm.range;const ev=Rt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Bn)},(e,t)=>(t-e)/Bn,e=>e.getUTCMinutes());ev.range;const tv=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rr-e.getMinutes()*Bn)},(e,t)=>{e.setTime(+e+t*Dr)},(e,t)=>(t-e)/Dr,e=>e.getHours());tv.range;const nv=Rt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Dr)},(e,t)=>(t-e)/Dr,e=>e.getUTCHours());nv.range;const kl=Rt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Bn)/Kr,e=>e.getDate()-1);kl.range;const Df=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Kr,e=>e.getUTCDate()-1);Df.range;const XC=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Kr,e=>Math.floor(e/Kr));XC.range;function ti(e){return Rt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Bn)/Qm)}const Nf=ti(0),wu=ti(1),Eee=ti(2),Pee=ti(3),Yi=ti(4),_ee=ti(5),Tee=ti(6);Nf.range;wu.range;Eee.range;Pee.range;Yi.range;_ee.range;Tee.range;function ni(e){return Rt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Qm)}const Lf=ni(0),Su=ni(1),Aee=ni(2),kee=ni(3),Zi=ni(4),jee=ni(5),Iee=ni(6);Lf.range;Su.range;Aee.range;kee.range;Zi.range;jee.range;Iee.range;const rv=Rt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());rv.range;const ov=Rt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ov.range;const qr=Rt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());qr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});qr.range;const Xr=Rt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Xr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Xr.range;function YC(e,t,n,r,o,i){const a=[[zo,1,Rr],[zo,5,5*Rr],[zo,15,15*Rr],[zo,30,30*Rr],[i,1,Bn],[i,5,5*Bn],[i,15,15*Bn],[i,30,30*Bn],[o,1,Dr],[o,3,3*Dr],[o,6,6*Dr],[o,12,12*Dr],[r,1,Kr],[r,2,2*Kr],[n,1,Qm],[t,1,dx],[t,3,3*dx],[e,1,sp]];function s(c,u,f){const d=uv).right(a,d);if(p===a.length)return e.every(Nh(c/sp,u/sp,f));if(p===0)return xu.every(Math.max(Nh(c,u,f),1));const[h,g]=a[d/a[p-1][2]53)return null;"w"in G||(G.w=1),"Z"in G?(de=cp(Fa(G.y,0,1)),pe=de.getUTCDay(),de=pe>4||pe===0?Su.ceil(de):Su(de),de=Df.offset(de,(G.V-1)*7),G.y=de.getUTCFullYear(),G.m=de.getUTCMonth(),G.d=de.getUTCDate()+(G.w+6)%7):(de=lp(Fa(G.y,0,1)),pe=de.getDay(),de=pe>4||pe===0?wu.ceil(de):wu(de),de=kl.offset(de,(G.V-1)*7),G.y=de.getFullYear(),G.m=de.getMonth(),G.d=de.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),pe="Z"in G?cp(Fa(G.y,0,1)).getUTCDay():lp(Fa(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(pe+5)%7:G.w+G.U*7-(pe+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,cp(G)):lp(G)}}function P(Y,ve,ce,G){for(var fe=0,de=ve.length,pe=ce.length,se,Le;fe=pe)return-1;if(se=ve.charCodeAt(fe++),se===37){if(se=ve.charAt(fe++),Le=S[se in px?ve.charAt(fe++):se],!Le||(G=Le(Y,ce,G))<0)return-1}else if(se!=ce.charCodeAt(G++))return-1}return G}function T(Y,ve,ce){var G=c.exec(ve.slice(ce));return G?(Y.p=u.get(G[0].toLowerCase()),ce+G[0].length):-1}function k(Y,ve,ce){var G=p.exec(ve.slice(ce));return G?(Y.w=h.get(G[0].toLowerCase()),ce+G[0].length):-1}function _(Y,ve,ce){var G=f.exec(ve.slice(ce));return G?(Y.w=d.get(G[0].toLowerCase()),ce+G[0].length):-1}function A(Y,ve,ce){var G=x.exec(ve.slice(ce));return G?(Y.m=w.get(G[0].toLowerCase()),ce+G[0].length):-1}function I(Y,ve,ce){var G=g.exec(ve.slice(ce));return G?(Y.m=v.get(G[0].toLowerCase()),ce+G[0].length):-1}function j(Y,ve,ce){return P(Y,t,ve,ce)}function M(Y,ve,ce){return P(Y,n,ve,ce)}function D(Y,ve,ce){return P(Y,r,ve,ce)}function L(Y){return a[Y.getDay()]}function B(Y){return i[Y.getDay()]}function F(Y){return l[Y.getMonth()]}function Z(Y){return s[Y.getMonth()]}function ie(Y){return o[+(Y.getHours()>=12)]}function te(Y){return 1+~~(Y.getMonth()/3)}function le(Y){return a[Y.getUTCDay()]}function re(Y){return i[Y.getUTCDay()]}function ae(Y){return l[Y.getUTCMonth()]}function xe(Y){return s[Y.getUTCMonth()]}function Me(Y){return o[+(Y.getUTCHours()>=12)]}function we(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var ve=b(Y+="",$);return ve.toString=function(){return Y},ve},parse:function(Y){var ve=O(Y+="",!1);return ve.toString=function(){return Y},ve},utcFormat:function(Y){var ve=b(Y+="",C);return ve.toString=function(){return Y},ve},utcParse:function(Y){var ve=O(Y+="",!0);return ve.toString=function(){return Y},ve}}}var px={"-":"",_:" ",0:"0"},Wt=/^\s*\d+/,Bee=/^%/,Fee=/[\\^$*+?|[\]().{}]/g;function nt(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",i=o.length;return r+(i[t.toLowerCase(),n]))}function Wee(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Vee(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Hee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Uee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Gee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function hx(e,t,n){var r=Wt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function gx(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Kee(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function qee(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Xee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function mx(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Yee(e,t,n){var r=Wt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function vx(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Zee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Qee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Jee(e,t,n){var r=Wt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function ete(e,t,n){var r=Wt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function tte(e,t,n){var r=Bee.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function nte(e,t,n){var r=Wt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function rte(e,t,n){var r=Wt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function yx(e,t){return nt(e.getDate(),t,2)}function ote(e,t){return nt(e.getHours(),t,2)}function ite(e,t){return nt(e.getHours()%12||12,t,2)}function ate(e,t){return nt(1+kl.count(qr(e),e),t,3)}function ZC(e,t){return nt(e.getMilliseconds(),t,3)}function ste(e,t){return ZC(e,t)+"000"}function lte(e,t){return nt(e.getMonth()+1,t,2)}function cte(e,t){return nt(e.getMinutes(),t,2)}function ute(e,t){return nt(e.getSeconds(),t,2)}function fte(e){var t=e.getDay();return t===0?7:t}function dte(e,t){return nt(Nf.count(qr(e)-1,e),t,2)}function QC(e){var t=e.getDay();return t>=4||t===0?Yi(e):Yi.ceil(e)}function pte(e,t){return e=QC(e),nt(Yi.count(qr(e),e)+(qr(e).getDay()===4),t,2)}function hte(e){return e.getDay()}function gte(e,t){return nt(wu.count(qr(e)-1,e),t,2)}function mte(e,t){return nt(e.getFullYear()%100,t,2)}function vte(e,t){return e=QC(e),nt(e.getFullYear()%100,t,2)}function yte(e,t){return nt(e.getFullYear()%1e4,t,4)}function bte(e,t){var n=e.getDay();return e=n>=4||n===0?Yi(e):Yi.ceil(e),nt(e.getFullYear()%1e4,t,4)}function xte(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+nt(t/60|0,"0",2)+nt(t%60,"0",2)}function bx(e,t){return nt(e.getUTCDate(),t,2)}function wte(e,t){return nt(e.getUTCHours(),t,2)}function Ste(e,t){return nt(e.getUTCHours()%12||12,t,2)}function $te(e,t){return nt(1+Df.count(Xr(e),e),t,3)}function JC(e,t){return nt(e.getUTCMilliseconds(),t,3)}function Cte(e,t){return JC(e,t)+"000"}function Ote(e,t){return nt(e.getUTCMonth()+1,t,2)}function Ete(e,t){return nt(e.getUTCMinutes(),t,2)}function Pte(e,t){return nt(e.getUTCSeconds(),t,2)}function _te(e){var t=e.getUTCDay();return t===0?7:t}function Tte(e,t){return nt(Lf.count(Xr(e)-1,e),t,2)}function e5(e){var t=e.getUTCDay();return t>=4||t===0?Zi(e):Zi.ceil(e)}function Ate(e,t){return e=e5(e),nt(Zi.count(Xr(e),e)+(Xr(e).getUTCDay()===4),t,2)}function kte(e){return e.getUTCDay()}function jte(e,t){return nt(Su.count(Xr(e)-1,e),t,2)}function Ite(e,t){return nt(e.getUTCFullYear()%100,t,2)}function Mte(e,t){return e=e5(e),nt(e.getUTCFullYear()%100,t,2)}function Rte(e,t){return nt(e.getUTCFullYear()%1e4,t,4)}function Dte(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Zi(e):Zi.ceil(e),nt(e.getUTCFullYear()%1e4,t,4)}function Nte(){return"+0000"}function xx(){return"%"}function wx(e){return+e}function Sx(e){return Math.floor(+e/1e3)}var di,t5,n5;Lte({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Lte(e){return di=Lee(e),t5=di.format,di.parse,n5=di.utcFormat,di.utcParse,di}function Bte(e){return new Date(e)}function Fte(e){return e instanceof Date?+e:+new Date(+e)}function iv(e,t,n,r,o,i,a,s,l,c){var u=Um(),f=u.invert,d=u.domain,p=c(".%L"),h=c(":%S"),g=c("%I:%M"),v=c("%I %p"),x=c("%a %d"),w=c("%b %d"),$=c("%B"),C=c("%Y");function S(b){return(l(b)t(o/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(o,i)=>TJ(e,i/r))},n.copy=function(){return a5(t).domain(e)},eo.apply(n,arguments)}function Ff(){var e=0,t=.5,n=1,r=1,o,i,a,s,l,c=ln,u,f=!1,d;function p(g){return isNaN(g=+g)?d:(g=.5+((g=+u(g))-i)*(r*gt}var qte=Kte,Xte=u5,Yte=qte,Zte=Sa;function Qte(e){return e&&e.length?Xte(e,Zte,Yte):void 0}var Jte=Qte;const zf=yt(Jte);function ene(e,t){return ee.e^i.s<0?1:-1;for(r=i.d.length,o=e.d.length,t=0,n=re.d[t]^i.s<0?1:-1;return r===o?0:r>o^i.s<0?1:-1};Pe.decimalPlaces=Pe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*mt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Pe.dividedBy=Pe.div=function(e){return Fr(this,new this.constructor(e))};Pe.dividedToIntegerBy=Pe.idiv=function(e){var t=this,n=t.constructor;return ut(Fr(t,new n(e),0,1),n.precision)};Pe.equals=Pe.eq=function(e){return!this.cmp(e)};Pe.exponent=function(){return Tt(this)};Pe.greaterThan=Pe.gt=function(e){return this.cmp(e)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(e){return this.cmp(e)>=0};Pe.isInteger=Pe.isint=function(){return this.e>this.d.length-2};Pe.isNegative=Pe.isneg=function(){return this.s<0};Pe.isPositive=Pe.ispos=function(){return this.s>0};Pe.isZero=function(){return this.s===0};Pe.lessThan=Pe.lt=function(e){return this.cmp(e)<0};Pe.lessThanOrEqualTo=Pe.lte=function(e){return this.cmp(e)<1};Pe.logarithm=Pe.log=function(e){var t,n=this,r=n.constructor,o=r.precision,i=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(wn))throw Error(Gn+"NaN");if(n.s<1)throw Error(Gn+(n.s?"NaN":"-Infinity"));return n.eq(wn)?new r(0):(vt=!1,t=Fr(Ms(n,i),Ms(e,i),i),vt=!0,ut(t,o))};Pe.minus=Pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?h5(t,e):d5(t,(e.s=-e.s,e))};Pe.modulo=Pe.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(Gn+"NaN");return n.s?(vt=!1,t=Fr(n,e,0,1).times(e),vt=!0,n.minus(t)):ut(new r(n),o)};Pe.naturalExponential=Pe.exp=function(){return p5(this)};Pe.naturalLogarithm=Pe.ln=function(){return Ms(this)};Pe.negated=Pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Pe.plus=Pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?d5(t,e):h5(t,(e.s=-e.s,e))};Pe.precision=Pe.sd=function(e){var t,n,r,o=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Go+e);if(t=Tt(o)+1,r=o.d.length-1,n=r*mt+1,r=o.d[r],r){for(;r%10==0;r/=10)n--;for(r=o.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Pe.squareRoot=Pe.sqrt=function(){var e,t,n,r,o,i,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Gn+"NaN")}for(e=Tt(s),vt=!1,o=Math.sqrt(+s),o==0||o==1/0?(t=vr(s.d),(t.length+e)%2==0&&(t+="0"),o=Math.sqrt(t),e=Ea((e+1)/2)-(e<0||e%2),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new l(t)):r=new l(o.toString()),n=l.precision,o=a=n+3;;)if(i=r,r=i.plus(Fr(s,i,a+2)).times(.5),vr(i.d).slice(0,a)===(t=vr(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),o==a&&t=="4999"){if(ut(i,n+1,0),i.times(i).eq(s)){r=i;break}}else if(t!="9999")break;a+=4}return vt=!0,ut(r,n)};Pe.times=Pe.mul=function(e){var t,n,r,o,i,a,s,l,c,u=this,f=u.constructor,d=u.d,p=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,n=u.e+e.e,l=d.length,c=p.length,l=0;){for(t=0,o=l+r;o>r;)s=i[o]+p[r]*d[o-r-1]+t,i[o--]=s%Bt|0,t=s/Bt|0;i[o]=(i[o]+t)%Bt|0}for(;!i[--a];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,vt?ut(e,f.precision):e};Pe.toDecimalPlaces=Pe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Er(e,0,Oa),t===void 0?t=r.rounding:Er(t,0,8),ut(n,e+Tt(n)+1,t))};Pe.toExponential=function(e,t){var n,r=this,o=r.constructor;return e===void 0?n=Zo(r,!0):(Er(e,0,Oa),t===void 0?t=o.rounding:Er(t,0,8),r=ut(new o(r),e+1,t),n=Zo(r,!0,e+1)),n};Pe.toFixed=function(e,t){var n,r,o=this,i=o.constructor;return e===void 0?Zo(o):(Er(e,0,Oa),t===void 0?t=i.rounding:Er(t,0,8),r=ut(new i(o),e+Tt(o)+1,t),n=Zo(r.abs(),!1,e+Tt(r)+1),o.isneg()&&!o.isZero()?"-"+n:n)};Pe.toInteger=Pe.toint=function(){var e=this,t=e.constructor;return ut(new t(e),Tt(e)+1,t.rounding)};Pe.toNumber=function(){return+this};Pe.toPower=Pe.pow=function(e){var t,n,r,o,i,a,s=this,l=s.constructor,c=12,u=+(e=new l(e));if(!e.s)return new l(wn);if(s=new l(s),!s.s){if(e.s<1)throw Error(Gn+"Infinity");return s}if(s.eq(wn))return s;if(r=l.precision,e.eq(wn))return ut(s,r);if(t=e.e,n=e.d.length-1,a=t>=n,i=s.s,a){if((n=u<0?-u:u)<=f5){for(o=new l(wn),t=Math.ceil(r/mt+4),vt=!1;n%2&&(o=o.times(s),Ox(o.d,t)),n=Ea(n/2),n!==0;)s=s.times(s),Ox(s.d,t);return vt=!0,e.s<0?new l(wn).div(o):ut(o,r)}}else if(i<0)throw Error(Gn+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,vt=!1,o=e.times(Ms(s,r+c)),vt=!0,o=p5(o),o.s=i,o};Pe.toPrecision=function(e,t){var n,r,o=this,i=o.constructor;return e===void 0?(n=Tt(o),r=Zo(o,n<=i.toExpNeg||n>=i.toExpPos)):(Er(e,1,Oa),t===void 0?t=i.rounding:Er(t,0,8),o=ut(new i(o),e,t),n=Tt(o),r=Zo(o,e<=n||n<=i.toExpNeg,e)),r};Pe.toSignificantDigits=Pe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Er(e,1,Oa),t===void 0?t=r.rounding:Er(t,0,8)),ut(new r(n),e,t)};Pe.toString=Pe.valueOf=Pe.val=Pe.toJSON=Pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Tt(e),n=e.constructor;return Zo(e,t<=n.toExpNeg||t>=n.toExpPos)};function d5(e,t){var n,r,o,i,a,s,l,c,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),vt?ut(t,f):t;if(l=e.d,c=t.d,a=e.e,o=t.e,l=l.slice(),i=a-o,i){for(i<0?(r=l,i=-i,s=c.length):(r=c,o=a,s=l.length),a=Math.ceil(f/mt),s=a>s?a+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=c.length,s-i<0&&(i=s,r=c,c=l,l=r),n=0;i;)n=(l[--i]=l[i]+c[i]+n)/Bt|0,l[i]%=Bt;for(n&&(l.unshift(n),++o),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=o,vt?ut(t,f):t}function Er(e,t,n){if(e!==~~e||en)throw Error(Go+e)}function vr(e){var t,n,r,o=e.length-1,i="",a=e[0];if(o>0){for(i+=a,t=1;ta?1:-1;else for(s=l=0;so[s]?1:-1;break}return l}function n(r,o,i){for(var a=0;i--;)r[i]-=a,a=r[i]1;)r.shift()}return function(r,o,i,a){var s,l,c,u,f,d,p,h,g,v,x,w,$,C,S,b,O,P,T=r.constructor,k=r.s==o.s?1:-1,_=r.d,A=o.d;if(!r.s)return new T(r);if(!o.s)throw Error(Gn+"Division by zero");for(l=r.e-o.e,O=A.length,S=_.length,p=new T(k),h=p.d=[],c=0;A[c]==(_[c]||0);)++c;if(A[c]>(_[c]||0)&&--l,i==null?w=i=T.precision:a?w=i+(Tt(r)-Tt(o))+1:w=i,w<0)return new T(0);if(w=w/mt+2|0,c=0,O==1)for(u=0,A=A[0],w++;(c1&&(A=e(A,u),_=e(_,u),O=A.length,S=_.length),C=O,g=_.slice(0,O),v=g.length;v=Bt/2&&++b;do u=0,s=t(A,g,O,v),s<0?(x=g[0],O!=v&&(x=x*Bt+(g[1]||0)),u=x/b|0,u>1?(u>=Bt&&(u=Bt-1),f=e(A,u),d=f.length,v=g.length,s=t(f,g,d,v),s==1&&(u--,n(f,O16)throw Error(lv+Tt(e));if(!e.s)return new u(wn);for(t==null?(vt=!1,s=f):s=t,a=new u(.03125);e.abs().gte(.1);)e=e.times(a),c+=5;for(r=Math.log(Ro(2,c))/Math.LN10*2+5|0,s+=r,n=o=i=new u(wn),u.precision=s;;){if(o=ut(o.times(e),s),n=n.times(++l),a=i.plus(Fr(o,n,s)),vr(a.d).slice(0,s)===vr(i.d).slice(0,s)){for(;c--;)i=ut(i.times(i),s);return u.precision=f,t==null?(vt=!0,ut(i,f)):i}i=a}}function Tt(e){for(var t=e.e*mt,n=e.d[0];n>=10;n/=10)t++;return t}function up(e,t,n){if(t>e.LN10.sd())throw vt=!0,n&&(e.precision=n),Error(Gn+"LN10 precision limit exceeded");return ut(new e(e.LN10),t)}function co(e){for(var t="";e--;)t+="0";return t}function Ms(e,t){var n,r,o,i,a,s,l,c,u,f=1,d=10,p=e,h=p.d,g=p.constructor,v=g.precision;if(p.s<1)throw Error(Gn+(p.s?"NaN":"-Infinity"));if(p.eq(wn))return new g(0);if(t==null?(vt=!1,c=v):c=t,p.eq(10))return t==null&&(vt=!0),up(g,c);if(c+=d,g.precision=c,n=vr(h),r=n.charAt(0),i=Tt(p),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=vr(p.d),r=n.charAt(0),f++;i=Tt(p),r>1?(p=new g("0."+n),i++):p=new g(r+"."+n.slice(1))}else return l=up(g,c+2,v).times(i+""),p=Ms(new g(r+"."+n.slice(1)),c-d).plus(l),g.precision=v,t==null?(vt=!0,ut(p,v)):p;for(s=a=p=Fr(p.minus(wn),p.plus(wn),c),u=ut(p.times(p),c),o=3;;){if(a=ut(a.times(u),c),l=s.plus(Fr(a,new g(o),c)),vr(l.d).slice(0,c)===vr(s.d).slice(0,c))return s=s.times(2),i!==0&&(s=s.plus(up(g,c+2,v).times(i+""))),s=Fr(s,new g(f),c),g.precision=v,t==null?(vt=!0,ut(s,v)):s;s=l,o+=2}}function Cx(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(o=t.length;t.charCodeAt(o-1)===48;)--o;if(t=t.slice(r,o),t){if(o-=r,n=n-r-1,e.e=Ea(n/mt),e.d=[],r=(n+1)%mt,n<0&&(r+=mt),r$u||e.e<-$u))throw Error(lv+n)}else e.s=0,e.e=0,e.d=[0];return e}function ut(e,t,n){var r,o,i,a,s,l,c,u,f=e.d;for(a=1,i=f[0];i>=10;i/=10)a++;if(r=t-a,r<0)r+=mt,o=t,c=f[u=0];else{if(u=Math.ceil((r+1)/mt),i=f.length,u>=i)return e;for(c=i=f[u],a=1;i>=10;i/=10)a++;r%=mt,o=r-mt+a}if(n!==void 0&&(i=Ro(10,a-o-1),s=c/i%10|0,l=t<0||f[u+1]!==void 0||c%i,l=n<4?(s||l)&&(n==0||n==(e.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?o>0?c/Ro(10,a-o):0:f[u-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return l?(i=Tt(e),f.length=1,t=t-i-1,f[0]=Ro(10,(mt-t%mt)%mt),e.e=Ea(-t/mt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=u,i=1,u--):(f.length=u+1,i=Ro(10,mt-r),f[u]=o>0?(c/Ro(10,a-o)%Ro(10,o)|0)*i:0),l)for(;;)if(u==0){(f[0]+=i)==Bt&&(f[0]=1,++e.e);break}else{if(f[u]+=i,f[u]!=Bt)break;f[u--]=0,i=1}for(r=f.length;f[--r]===0;)f.pop();if(vt&&(e.e>$u||e.e<-$u))throw Error(lv+Tt(e));return e}function h5(e,t){var n,r,o,i,a,s,l,c,u,f,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),vt?ut(t,p):t;if(l=e.d,f=t.d,r=t.e,c=e.e,l=l.slice(),a=c-r,a){for(u=a<0,u?(n=l,a=-a,s=f.length):(n=f,r=c,s=l.length),o=Math.max(Math.ceil(p/mt),s)+2,a>o&&(a=o,n.length=1),n.reverse(),o=a;o--;)n.push(0);n.reverse()}else{for(o=l.length,s=f.length,u=o0;--o)l[s++]=0;for(o=f.length;o>a;){if(l[--o]0?i=i.charAt(0)+"."+i.slice(1)+co(r):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(o<0?"e":"e+")+o):o<0?(i="0."+co(-o-1)+i,n&&(r=n-a)>0&&(i+=co(r))):o>=a?(i+=co(o+1-a),n&&(r=n-o-1)>0&&(i=i+"."+co(r))):((r=o+1)0&&(o+1===a&&(i+="."),i+=co(r))),e.s<0?"-"+i:i}function Ox(e,t){if(e.length>t)return e.length=t,!0}function g5(e){var t,n,r;function o(i){var a=this;if(!(a instanceof o))return new o(i);if(a.constructor=o,i instanceof o){a.s=i.s,a.e=i.e,a.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Go+i);if(i>0)a.s=1;else if(i<0)i=-i,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(i===~~i&&i<1e7){a.e=0,a.d=[i];return}return Cx(a,i.toString())}else if(typeof i!="string")throw Error(Go+i);if(i.charCodeAt(0)===45?(i=i.slice(1),a.s=-1):a.s=1,Sne.test(i))Cx(a,i);else throw Error(Go+i)}if(o.prototype=Pe,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=g5,o.config=o.set=$ne,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(Go+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Go+n+": "+r);return this}var cv=g5(wne);wn=new cv(1);const at=cv;function Cne(e){return _ne(e)||Pne(e)||Ene(e)||One()}function One(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ene(e,t){if(e){if(typeof e=="string")return Wh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Wh(e,t)}}function Pne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function _ne(e){if(Array.isArray(e))return Wh(e)}function Wh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,o):e(t-a,Ex(function(){for(var s=arguments.length,l=new Array(s),c=0;ce.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(o)throw i}}return n}}function Vne(e){if(Array.isArray(e))return e}function x5(e){var t=Rs(e,2),n=t[0],r=t[1],o=n,i=r;return n>r&&(o=r,i=n),[o,i]}function w5(e,t,n){if(e.lte(0))return new at(0);var r=Uf.getDigitCount(e.toNumber()),o=new at(10).pow(r),i=e.div(o),a=r!==1?.05:.1,s=new at(Math.ceil(i.div(a).toNumber())).add(n).mul(a),l=s.mul(o);return t?l:new at(Math.ceil(l))}function Hne(e,t,n){var r=1,o=new at(e);if(!o.isint()&&n){var i=Math.abs(e);i<1?(r=new at(10).pow(Uf.getDigitCount(e)-1),o=new at(Math.floor(o.div(r).toNumber())).mul(r)):i>1&&(o=new at(Math.floor(e)))}else e===0?o=new at(Math.floor((t-1)/2)):n||(o=new at(Math.floor(e)));var a=Math.floor((t-1)/2),s=jne(kne(function(l){return o.add(new at(l-a).mul(r)).toNumber()}),Vh);return s(0,t)}function S5(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new at(0),tickMin:new at(0),tickMax:new at(0)};var i=w5(new at(t).sub(e).div(n-1),r,o),a;e<=0&&t>=0?a=new at(0):(a=new at(e).add(t).div(2),a=a.sub(new at(a).mod(i)));var s=Math.ceil(a.sub(e).div(i).toNumber()),l=Math.ceil(new at(t).sub(a).div(i).toNumber()),c=s+l+1;return c>n?S5(e,t,n,r,o+1):(c0?l+(n-c):l,s=t>0?s:s+(n-c)),{step:i,tickMin:a.sub(new at(s).mul(i)),tickMax:a.add(new at(l).mul(i))})}function Une(e){var t=Rs(e,2),n=t[0],r=t[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(o,2),s=x5([n,r]),l=Rs(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(Uh(Vh(0,o-1).map(function(){return 1/0}))):[].concat(Uh(Vh(0,o-1).map(function(){return-1/0})),[u]);return n>r?Hh(f):f}if(c===u)return Hne(c,o,i);var d=S5(c,u,a,i),p=d.step,h=d.tickMin,g=d.tickMax,v=Uf.rangeStep(h,g.add(new at(.1).mul(p)),p);return n>r?Hh(v):v}function Gne(e,t){var n=Rs(e,2),r=n[0],o=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=x5([r,o]),s=Rs(a,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,o];if(l===c)return[l];var u=Math.max(t,2),f=w5(new at(c).sub(l).div(u-1),i,0),d=[].concat(Uh(Uf.rangeStep(new at(l),new at(c).sub(new at(.99).mul(f)),f)),[c]);return r>o?Hh(d):d}var Kne=y5(Une),qne=y5(Gne),Xne=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Cu(){return Cu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nre(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function jl(e){var t=e.offset,n=e.layout,r=e.width,o=e.dataKey,i=e.data,a=e.dataPointFormatter,s=e.xAxis,l=e.yAxis,c=tre(e,Xne),u=Qe(c),f=i.map(function(d){var p=a(d,o),h=p.x,g=p.y,v=p.value,x=p.errorVal;if(!x)return null;var w=[],$,C;if(Array.isArray(x)){var S=Yne(x,2);$=S[0],C=S[1]}else $=C=x;if(n==="vertical"){var b=s.scale,O=g+t,P=O+r,T=O-r,k=b(v-$),_=b(v+C);w.push({x1:_,y1:P,x2:_,y2:T}),w.push({x1:k,y1:O,x2:_,y2:O}),w.push({x1:k,y1:P,x2:k,y2:T})}else if(n==="horizontal"){var A=l.scale,I=h+t,j=I-r,M=I+r,D=A(v-$),L=A(v+C);w.push({x1:j,y1:L,x2:M,y2:L}),w.push({x1:I,y1:D,x2:I,y2:L}),w.push({x1:j,y1:D,x2:M,y2:D})}return E.createElement(Pt,Cu({className:"recharts-errorBar",key:"bar-".concat(w.map(function(B){return"".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))},u),w.map(function(B){return E.createElement("line",Cu({},B,{key:"line-".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))}))});return E.createElement(Pt,{className:"recharts-errorBars"},f)}jl.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};jl.displayName="ErrorBar";function Ds(e){"@babel/helpers - typeof";return Ds=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ds(e)}function _x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function fp(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var l=i.range,c=0;c0?o[c-1].coordinate:o[s-1].coordinate,f=o[c].coordinate,d=c>=s-1?o[0].coordinate:o[c+1].coordinate,p=void 0;if(nr(f-u)!==nr(d-f)){var h=[];if(nr(d-f)===nr(l[1]-l[0])){p=d;var g=f+l[1]-l[0];h[0]=Math.min(g,(g+u)/2),h[1]=Math.max(g,(g+u)/2)}else{p=u;var v=d+l[1]-l[0];h[0]=Math.min(f,(v+f)/2),h[1]=Math.max(f,(v+f)/2)}var x=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>x[0]&&t<=x[1]||t>=h[0]&&t<=h[1]){a=o[c].index;break}}else{var w=Math.min(u,d),$=Math.max(u,d);if(t>(w+f)/2&&t<=($+f)/2){a=o[c].index;break}}}else for(var C=0;C0&&C(r[C].coordinate+r[C-1].coordinate)/2&&t<=(r[C].coordinate+r[C+1].coordinate)/2||C===s-1&&t>(r[C].coordinate+r[C-1].coordinate)/2){a=r[C].index;break}return a},uv=function(t){var n=t,r=n.type.displayName,o=t.props,i=o.stroke,a=o.fill,s;switch(r){case"Line":s=i;break;case"Area":case"Radar":s=i&&i!=="none"?i:a;break;default:s=a;break}return s},pre=function(t){var n=t.barSize,r=t.stackGroups,o=r===void 0?{}:r;if(!o)return{};for(var i={},a=Object.keys(o),s=0,l=a.length;s=0});if(v&&v.length){var x=v[0].props.barSize,w=v[0].props[g];i[w]||(i[w]=[]),i[w].push({item:v[0],stackList:v.slice(1),barSize:Je(x)?n:x})}}return i},hre=function(t){var n=t.barGap,r=t.barCategoryGap,o=t.bandSize,i=t.sizeList,a=i===void 0?[]:i,s=t.maxBarSize,l=a.length;if(l<1)return null;var c=zi(n,o,0,!0),u,f=[];if(a[0].barSize===+a[0].barSize){var d=!1,p=o/l,h=a.reduce(function(C,S){return C+S.barSize||0},0);h+=(l-1)*c,h>=o&&(h-=(l-1)*c,c=0),h>=o&&p>0&&(d=!0,p*=.9,h=l*p);var g=(o-h)/2>>0,v={offset:g-c,size:0};u=a.reduce(function(C,S){var b={item:S.item,position:{offset:v.offset+v.size+c,size:d?p:S.barSize}},O=[].concat(Ax(C),[b]);return v=O[O.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(P){O.push({item:P,position:v})}),O},f)}else{var x=zi(r,o,0,!0);o-2*x-(l-1)*c<=0&&(c=0);var w=(o-2*x-(l-1)*c)/l;w>1&&(w>>=0);var $=s===+s?Math.min(w,s):w;u=a.reduce(function(C,S,b){var O=[].concat(Ax(C),[{item:S.item,position:{offset:x+(w+c)*b+(w-$)/2,size:$}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(P){O.push({item:P,position:O[O.length-1].position})}),O},f)}return u},gre=function(t,n,r,o){var i=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=$5({children:i,legendWidth:l});if(c){var u=o||{},f=u.width,d=u.height,p=c.align,h=c.verticalAlign,g=c.layout;if((g==="vertical"||g==="horizontal"&&h==="middle")&&p!=="center"&&me(t[p]))return Dn(Dn({},t),{},_i({},p,t[p]+(f||0)));if((g==="horizontal"||g==="vertical"&&p==="center")&&h!=="middle"&&me(t[h]))return Dn(Dn({},t),{},_i({},h,t[h]+(d||0)))}return t},mre=function(t,n,r){return Je(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},C5=function(t,n,r,o,i){var a=n.props.children,s=Wn(a,jl).filter(function(c){return mre(o,i,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return t.reduce(function(c,u){var f=Pn(u,r,0),d=Array.isArray(f)?[Wf(f),zf(f)]:[f,f],p=l.reduce(function(h,g){var v=Pn(u,g,0),x=d[0]-Math.abs(Array.isArray(v)?v[0]:v),w=d[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(x,h[0]),Math.max(w,h[1])]},[1/0,-1/0]);return[Math.min(p[0],c[0]),Math.max(p[1],c[1])]},[1/0,-1/0])}return null},vre=function(t,n,r,o,i){var a=n.map(function(s){return C5(t,s,r,i,o)}).filter(function(s){return!Je(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},O5=function(t,n,r,o,i){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&C5(t,l,c,o)||cs(t,c,r,i)});if(r==="number")return a.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,c){for(var u=0,f=c.length;u=2?nr(s[0]-s[1])*2*c:c,n&&(t.ticks||t.niceTicks)){var u=(t.ticks||t.niceTicks).map(function(f){var d=i?i.indexOf(f):f;return{coordinate:o(d)+c,value:f,offset:c}});return u.filter(function(f){return!El(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,d){return{coordinate:o(f)+c,value:f,index:d,offset:c}}):o.ticks&&!r?o.ticks(t.tickCount).map(function(f){return{coordinate:o(f)+c,value:f,offset:c}}):o.domain().map(function(f,d){return{coordinate:o(f)+c,value:i?i[f]:f,index:d,offset:c}})},dp=new WeakMap,ac=function(t,n){if(typeof n!="function")return t;dp.has(t)||dp.set(t,new WeakMap);var r=dp.get(t);if(r.has(n))return r.get(n);var o=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,o),o},yre=function(t,n,r){var o=t.scale,i=t.type,a=t.layout,s=t.axisType;if(o==="auto")return a==="radial"&&s==="radiusAxis"?{scale:Ts(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:bu(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ls(),realScaleType:"point"}:i==="category"?{scale:Ts(),realScaleType:"band"}:{scale:bu(),realScaleType:"linear"};if(Ol(o)){var l="scale".concat(Tf(o));return{scale:($x[l]||ls)(),realScaleType:$x[l]?l:"point"}}return Ue(o)?{scale:o}:{scale:ls(),realScaleType:"point"}},jx=1e-4,bre=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,o=t.range(),i=Math.min(o[0],o[1])-jx,a=Math.max(o[0],o[1])+jx,s=t(n[0]),l=t(n[r-1]);(sa||la)&&t.domain([n[0],n[r-1]])}},xre=function(t,n){if(!t)return null;for(var r=0,o=t.length;ro)&&(i[1]=o),i[0]>o&&(i[0]=o),i[1]=0?(t[s][r][0]=i,t[s][r][1]=i+l,i=t[s][r][1]):(t[s][r][0]=a,t[s][r][1]=a+l,a=t[s][r][1])}},$re=function(t){var n=t.length;if(!(n<=0))for(var r=0,o=t[0].length;r=0?(t[a][r][0]=i,t[a][r][1]=i+s,i=t[a][r][1]):(t[a][r][0]=0,t[a][r][1]=0)}},Cre={sign:Sre,expand:wU,none:Wi,silhouette:SU,wiggle:$U,positive:$re},Ore=function(t,n,r){var o=n.map(function(s){return s.props.dataKey}),i=Cre[r],a=xU().keys(o).value(function(s,l){return+Pn(s,l,0)}).order(vh).offset(i);return a(t)},Ere=function(t,n,r,o,i,a){if(!t)return null;var s=a?n.reverse():n,l={},c=s.reduce(function(f,d){var p=d.props,h=p.stackId,g=p.hide;if(g)return f;var v=d.props[r],x=f[v]||{hasStack:!1,stackGroups:{}};if(jt(h)){var w=x.stackGroups[h]||{numericAxisId:r,cateAxisId:o,items:[]};w.items.push(d),x.hasStack=!0,x.stackGroups[h]=w}else x.stackGroups[Pl("_stackId_")]={numericAxisId:r,cateAxisId:o,items:[d]};return Dn(Dn({},f),{},_i({},v,x))},l),u={};return Object.keys(c).reduce(function(f,d){var p=c[d];if(p.hasStack){var h={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(g,v){var x=p.stackGroups[v];return Dn(Dn({},g),{},_i({},v,{numericAxisId:r,cateAxisId:o,items:x.items,stackedData:Ore(t,x.items,i)}))},h)}return Dn(Dn({},f),{},_i({},d,p))},u)},Pre=function(t,n){var r=n.realScaleType,o=n.type,i=n.tickCount,a=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(i&&o==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=t.domain();if(!c.length)return null;var u=Kne(c,i,s);return t.domain([Wf(u),zf(u)]),{niceTicks:u}}if(i&&o==="number"){var f=t.domain(),d=qne(f,i,s);return{niceTicks:d}}return null},Ix=function(t){var n=t.axis,r=t.ticks,o=t.bandSize,i=t.entry,a=t.index,s=t.dataKey;if(n.type==="category"){if(!n.allowDuplicatedCategory&&n.dataKey&&!Je(i[n.dataKey])){var l=qc(r,"value",i[n.dataKey]);if(l)return l.coordinate+o/2}return r[a]?r[a].coordinate+o/2:null}var c=Pn(i,Je(s)?n.dataKey:s);return Je(c)?null:n.scale(c)},Mx=function(t){var n=t.axis,r=t.ticks,o=t.offset,i=t.bandSize,a=t.entry,s=t.index;if(n.type==="category")return r[s]?r[s].coordinate+o:null;var l=Pn(a,n.dataKey,n.domain[s]);return Je(l)?null:n.scale(l)-i/2+o},_re=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var o=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return o<=0&&i>=0?0:i<0?i:o}return r[0]},Tre=function(t,n){var r=t.props.stackId;if(jt(r)){var o=n[r];if(o){var i=o.items.indexOf(t);return i>=0?o.stackedData[i]:null}}return null},Are=function(t){return t.reduce(function(n,r){return[Wf(r.concat([n[0]]).filter(me)),zf(r.concat([n[1]]).filter(me))]},[1/0,-1/0])},P5=function(t,n,r){return Object.keys(t).reduce(function(o,i){var a=t[i],s=a.stackedData,l=s.reduce(function(c,u){var f=Are(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],o[0]),Math.max(l[1],o[1])]},[1/0,-1/0]).map(function(o){return o===1/0||o===-1/0?0:o})},Rx=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Dx=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,qh=function(t,n,r){if(Ue(t))return t(n,r);if(!Array.isArray(t))return n;var o=[];if(me(t[0]))o[0]=r?t[0]:Math.min(t[0],n[0]);else if(Rx.test(t[0])){var i=+Rx.exec(t[0])[1];o[0]=n[0]-i}else Ue(t[0])?o[0]=t[0](n[0]):o[0]=n[0];if(me(t[1]))o[1]=r?t[1]:Math.max(t[1],n[1]);else if(Dx.test(t[1])){var a=+Dx.exec(t[1])[1];o[1]=n[1]+a}else Ue(t[1])?o[1]=t[1](n[1]):o[1]=n[1];return o},Ou=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var o=t.scale.bandwidth();if(!r||o>0)return o}if(t&&n&&n.length>=2){for(var i=Nm(n,function(f){return f.coordinate}),a=1/0,s=1,l=i.length;sa&&(c=2*Math.PI-c),{radius:s,angle:Mre(c),angleInRadian:c}},Nre=function(t){var n=t.startAngle,r=t.endAngle,o=Math.floor(n/360),i=Math.floor(r/360),a=Math.min(o,i);return{startAngle:n-a*360,endAngle:r-a*360}},Lre=function(t,n){var r=n.startAngle,o=n.endAngle,i=Math.floor(r/360),a=Math.floor(o/360),s=Math.min(i,a);return t+s*360},Fx=function(t,n){var r=t.x,o=t.y,i=Dre({x:r,y:o},n),a=i.radius,s=i.angle,l=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=Nre(n),f=u.startAngle,d=u.endAngle,p=s,h;if(f<=d){for(;p>d;)p-=360;for(;p=f&&p<=d}else{for(;p>f;)p-=360;for(;p=d&&p<=f}return h?Bx(Bx({},n),{},{radius:a,angle:Lre(p,n)}):null};function Bs(e){"@babel/helpers - typeof";return Bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bs(e)}var Bre=["offset"];function Fre(e){return Hre(e)||Vre(e)||Wre(e)||zre()}function zre(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wre(e,t){if(e){if(typeof e=="string")return Xh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xh(e,t)}}function Vre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hre(e){if(Array.isArray(e))return Xh(e)}function Xh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Gre(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function zx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function kt(e){for(var t=1;t=0?1:-1,$,C;o==="insideStart"?($=p+w*a,C=g):o==="insideEnd"?($=h-w*a,C=!g):o==="end"&&($=h+w*a,C=g),C=x<=0?C:!C;var S=Ht(c,u,v,$),b=Ht(c,u,v,$+(C?1:-1)*359),O="M".concat(S.x,",").concat(S.y,` + A`).concat(s,",").concat(s,",0,1,1,").concat(l,",").concat(a),className:"recharts-legend-icon"});if(o.type==="rect")return E.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(jn/8,"h").concat(jn,"v").concat(jn*3/4,"h").concat(-jn,"z"),className:"recharts-legend-icon"});if(E.isValidElement(o.legendIcon)){var u=DU({},o);return delete u.legendIcon,E.cloneElement(o.legendIcon,u)}return E.createElement(jm,{fill:c,cx:a,cy:a,size:jn,sizeType:"diameter",type:o.type})}},{key:"renderItems",value:function(){var o=this,i=this.props,a=i.payload,s=i.iconSize,l=i.layout,c=i.formatter,u=i.inactiveColor,f={x:0,y:0,width:jn,height:jn},d={display:l==="horizontal"?"inline-block":"block",marginRight:10},p={display:"inline-block",verticalAlign:"middle",marginRight:4};return a.map(function(h,g){var v,x=h.formatter||c,w=lt((v={"recharts-legend-item":!0},ws(v,"legend-item-".concat(g),!0),ws(v,"inactive",h.inactive),v));if(h.type==="none")return null;var $=Ue(h.value)?null:h.value;Tf(!Ue(h.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: `);var C=h.inactive?u:h.color;return E.createElement("li",xh({className:w,style:d,key:"legend-item-".concat(g)},Yc(o.props,h,g)),E.createElement(fh,{width:s,height:s,viewBox:f,style:p},o.renderIcon(h)),E.createElement("span",{className:"recharts-legend-item-text",style:{color:C}},x?x($,h,g):$))})}},{key:"render",value:function(){var o=this.props,i=o.payload,a=o.layout,s=o.align;if(!i||!i.length)return null;var l={padding:0,margin:0,textAlign:a==="horizontal"?s:"left"};return E.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}]),n}(y.PureComponent);ws(Im,"displayName","Legend");ws(Im,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var UU="__lodash_hash_undefined__";function GU(e){return this.__data__.set(e,UU),this}var KU=GU;function qU(e){return this.__data__.has(e)}var XU=qU,YU=ew,ZU=KU,QU=XU;function ru(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new YU;++ts))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var f=-1,d=!0,p=n&iG?new tG:void 0;for(i.set(e,t),i.set(t,e);++f-1}var lq=sq;function cq(e,t,n){for(var r=-1,o=e==null?0:e.length;++r=Cq){var c=t?null:Sq(e);if(c)return $q(c);a=!1,o=wq,l=new yq}else l=t?[]:s;e:for(;++r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ou(e){return ou=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ou(e)}function Mf(e,t,n){return t=fC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function fC(e){var t=Lq(e,"string");return Hi(t)==="symbol"?t:String(t)}function Lq(e,t){if(Hi(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Hi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bq(e,t){if(e==null)return{};var n=Fq(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Fq(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function zq(e){return e.value}function Wq(e,t){if(E.isValidElement(e))return E.cloneElement(e,t);if(typeof e=="function")return E.createElement(e,t);t.ref;var n=Bq(t,kq);return E.createElement(Im,n)}var Uy=1,Ss=function(e){Mq(n,e);var t=Rq(n);function n(){var r;jq(this,n);for(var o=arguments.length,i=new Array(o),a=0;aUy||Math.abs(i.height-this.lastBoundingBox.height)>Uy)&&(this.lastBoundingBox.width=i.width,this.lastBoundingBox.height=i.height,o&&o(i))}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,o&&o(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Ao({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(o){var i=this.props,a=i.layout,s=i.align,l=i.verticalAlign,c=i.margin,u=i.chartWidth,f=i.chartHeight,d,p;if(!o||(o.left===void 0||o.left===null)&&(o.right===void 0||o.right===null))if(s==="center"&&a==="vertical"){var h=this.getBBoxSnapshot();d={left:((u||0)-h.width)/2}}else d=s==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!o||(o.top===void 0||o.top===null)&&(o.bottom===void 0||o.bottom===null))if(l==="middle"){var g=this.getBBoxSnapshot();p={top:((f||0)-g.height)/2}}else p=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return Ao(Ao({},d),p)}},{key:"render",value:function(){var o=this,i=this.props,a=i.content,s=i.width,l=i.height,c=i.wrapperStyle,u=i.payloadUniqBy,f=i.payload,d=Ao(Ao({position:"absolute",width:s||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return E.createElement("div",{className:"recharts-legend-wrapper",style:d,ref:function(h){o.wrapperNode=h}},Wq(a,Ao(Ao({},this.props),{},{payload:cC(f,u,zq)})))}}],[{key:"getWithHeight",value:function(o,i){var a=o.props.layout;return a==="vertical"&&me(o.props.height)?{height:o.props.height}:a==="horizontal"?{width:o.props.width||i}:null}}]),n}(y.PureComponent);Mf(Ss,"displayName","Legend");Mf(Ss,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Gy=$g,Vq=rw,Hq=Kn,Ky=Gy?Gy.isConcatSpreadable:void 0;function Uq(e){return Hq(e)||Vq(e)||!!(Ky&&e&&e[Ky])}var Gq=Uq,Kq=qO,qq=Gq;function dC(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=qq),o||(o=[]);++i0&&n(s)?t>1?dC(s,t-1,n,r,o):Kq(o,s):r||(o[o.length]=s)}return o}var pC=dC;function Xq(e){return function(t,n,r){for(var o=-1,i=Object(t),a=r(t),s=a.length;s--;){var l=a[e?s:++o];if(n(i[l],l,i)===!1)break}return t}}var Yq=Xq,Zq=Yq,Qq=Zq(),Jq=Qq,eX=Jq,tX=Cg;function nX(e,t){return e&&eX(e,t,tX)}var hC=nX,rX=Gu;function oX(e,t){return function(n,r){if(n==null)return n;if(!rX(n))return e(n,r);for(var o=n.length,i=t?o:-1,a=Object(n);(t?i--:++it||i&&a&&l&&!s&&!c||r&&a&&l||!n&&l||!o)return 1;if(!r&&!i&&!c&&e=s)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return e.index-t.index}var yX=vX,Qd=Sm,bX=$m,xX=Co,wX=gC,SX=pX,$X=XO,CX=yX,OX=Sa,EX=Kn;function PX(e,t,n){t.length?t=Qd(t,function(i){return EX(i)?function(a){return bX(a,i.length===1?i[0]:i)}:i}):t=[OX];var r=-1;t=Qd(t,$X(xX));var o=wX(e,function(i,a,s){var l=Qd(t,function(c){return c(i)});return{criteria:l,index:++r,value:i}});return SX(o,function(i,a){return CX(i,a,n)})}var _X=PX;function TX(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var AX=TX,kX=AX,Xy=Math.max;function jX(e,t,n){return t=Xy(t===void 0?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Xy(r.length-t,0),a=Array(i);++o0){if(++t>=FX)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var HX=VX,UX=BX,GX=HX,KX=GX(UX),qX=KX,XX=Sa,YX=IX,ZX=qX;function QX(e,t){return ZX(YX(e,t,XX),e+"")}var JX=QX,eY=tw,tY=Gu,nY=ow,rY=ll;function oY(e,t,n){if(!rY(n))return!1;var r=typeof t;return(r=="number"?tY(n)&&nY(t,n.length):r=="string"&&t in n)?eY(n[t],e):!1}var Rf=oY,iY=pC,aY=_X,sY=JX,Zy=Rf,lY=sY(function(e,t){if(e==null)return[];var n=t.length;return n>1&&Zy(e,t[0],t[1])?t=[]:n>2&&Zy(t[0],t[1],t[2])&&(t=[t[0]]),aY(e,iY(t,1),[])}),cY=lY;const Nm=yt(cY);function $s(e){"@babel/helpers - typeof";return $s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$s(e)}function uY(e,t){return hY(e)||pY(e,t)||dY(e,t)||fY()}function fY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dY(e,t){if(e){if(typeof e=="string")return Qy(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Qy(e,t)}}function Qy(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function CY(e,t){return $a(e.getTime(),t.getTime())}function ob(e,t,n){if(e.size!==t.size)return!1;for(var r={},o=e.entries(),i=0,a,s;(a=o.next())&&!a.done;){for(var l=t.entries(),c=!1,u=0;(s=l.next())&&!s.done;){var f=a.value,d=f[0],p=f[1],h=s.value,g=h[0],v=h[1];!c&&!r[u]&&(c=n.equals(d,g,i,u,e,t,n)&&n.equals(p,v,d,g,e,t,n))&&(r[u]=!0),u++}if(!c)return!1;i++}return!0}function OY(e,t,n){var r=rb(e),o=r.length;if(rb(t).length!==o)return!1;for(var i;o-- >0;)if(i=r[o],i===vC&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!mC(t,i)||!n.equals(e[i],t[i],i,i,e,t,n))return!1;return!0}function Na(e,t,n){var r=tb(e),o=r.length;if(tb(t).length!==o)return!1;for(var i,a,s;o-- >0;)if(i=r[o],i===vC&&(e.$$typeof||t.$$typeof)&&e.$$typeof!==t.$$typeof||!mC(t,i)||!n.equals(e[i],t[i],i,i,e,t,n)||(a=nb(e,i),s=nb(t,i),(a||s)&&(!a||!s||a.configurable!==s.configurable||a.enumerable!==s.enumerable||a.writable!==s.writable)))return!1;return!0}function EY(e,t){return $a(e.valueOf(),t.valueOf())}function PY(e,t){return e.source===t.source&&e.flags===t.flags}function ib(e,t,n){if(e.size!==t.size)return!1;for(var r={},o=e.values(),i,a;(i=o.next())&&!i.done;){for(var s=t.values(),l=!1,c=0;(a=s.next())&&!a.done;)!l&&!r[c]&&(l=n.equals(i.value,a.value,i.value,a.value,e,t,n))&&(r[c]=!0),c++;if(!l)return!1}return!0}function _Y(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}var TY="[object Arguments]",AY="[object Boolean]",kY="[object Date]",jY="[object Map]",IY="[object Number]",MY="[object Object]",RY="[object RegExp]",DY="[object Set]",NY="[object String]",LY=Array.isArray,ab=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,sb=Object.assign,BY=Object.prototype.toString.call.bind(Object.prototype.toString);function FY(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,o=e.areObjectsEqual,i=e.arePrimitiveWrappersEqual,a=e.areRegExpsEqual,s=e.areSetsEqual,l=e.areTypedArraysEqual;return function(u,f,d){if(u===f)return!0;if(u==null||f==null||typeof u!="object"||typeof f!="object")return u!==u&&f!==f;var p=u.constructor;if(p!==f.constructor)return!1;if(p===Object)return o(u,f,d);if(LY(u))return t(u,f,d);if(ab!=null&&ab(u))return l(u,f,d);if(p===Date)return n(u,f,d);if(p===RegExp)return a(u,f,d);if(p===Map)return r(u,f,d);if(p===Set)return s(u,f,d);var h=BY(u);return h===kY?n(u,f,d):h===RY?a(u,f,d):h===jY?r(u,f,d):h===DY?s(u,f,d):h===MY?typeof u.then!="function"&&typeof f.then!="function"&&o(u,f,d):h===TY?o(u,f,d):h===AY||h===IY||h===NY?i(u,f,d):!1}}function zY(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,o={areArraysEqual:r?Na:$Y,areDatesEqual:CY,areMapsEqual:r?eb(ob,Na):ob,areObjectsEqual:r?Na:OY,arePrimitiveWrappersEqual:EY,areRegExpsEqual:PY,areSetsEqual:r?eb(ib,Na):ib,areTypedArraysEqual:r?Na:_Y};if(n&&(o=sb({},o,n(o))),t){var i=ec(o.areArraysEqual),a=ec(o.areMapsEqual),s=ec(o.areObjectsEqual),l=ec(o.areSetsEqual);o=sb({},o,{areArraysEqual:i,areMapsEqual:a,areObjectsEqual:s,areSetsEqual:l})}return o}function WY(e){return function(t,n,r,o,i,a,s){return e(t,n,s)}}function VY(e){var t=e.circular,n=e.comparator,r=e.createState,o=e.equals,i=e.strict;if(r)return function(l,c){var u=r(),f=u.cache,d=f===void 0?t?new WeakMap:void 0:f,p=u.meta;return n(l,c,{cache:d,equals:o,meta:p,strict:i})};if(t)return function(l,c){return n(l,c,{cache:new WeakMap,equals:o,meta:void 0,strict:i})};var a={cache:void 0,equals:o,meta:void 0,strict:i};return function(l,c){return n(l,c,a)}}var HY=Oo();Oo({strict:!0});Oo({circular:!0});Oo({circular:!0,strict:!0});Oo({createInternalComparator:function(){return $a}});Oo({strict:!0,createInternalComparator:function(){return $a}});Oo({circular:!0,createInternalComparator:function(){return $a}});Oo({circular:!0,createInternalComparator:function(){return $a},strict:!0});function Oo(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,o=e.createState,i=e.strict,a=i===void 0?!1:i,s=zY(e),l=FY(s),c=r?r(l):WY(l);return VY({circular:n,comparator:l,createState:o,equals:c,strict:a})}function UY(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function lb(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function o(i){n<0&&(n=i),i-n>t?(e(i),n=-1):UY(o)};requestAnimationFrame(r)}function $h(e){"@babel/helpers - typeof";return $h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$h(e)}function GY(e){return YY(e)||XY(e)||qY(e)||KY()}function KY(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qY(e,t){if(e){if(typeof e=="string")return cb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return cb(e,t)}}function cb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:x<0?0:x},g=function(x){for(var w=x>1?1:x,$=w,C=0;C<8;++C){var S=f($)-w,b=p($);if(Math.abs(S-w)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,o=t.damping,i=o===void 0?8:o,a=t.dt,s=a===void 0?17:a,l=function(u,f,d){var p=-(u-f)*r,h=d*i,g=d+(p-h)*s/1e3,v=d*s/1e3+u;return Math.abs(v-f)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function kZ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function ep(e){return RZ(e)||MZ(e)||IZ(e)||jZ()}function jZ(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IZ(e,t){if(e){if(typeof e=="string")return _h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _h(e,t)}}function MZ(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function RZ(e){if(Array.isArray(e))return _h(e)}function _h(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function lu(e){return lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},lu(e)}var Gr=function(e){BZ(n,e);var t=FZ(n);function n(r,o){var i;DZ(this,n),i=t.call(this,r,o);var a=i.props,s=a.isActive,l=a.attributeName,c=a.from,u=a.to,f=a.steps,d=a.children,p=a.duration;if(i.handleStyleChange=i.handleStyleChange.bind(kh(i)),i.changeStyle=i.changeStyle.bind(kh(i)),!s||p<=0)return i.state={style:{}},typeof d=="function"&&(i.state={style:u}),Ah(i);if(f&&f.length)i.state={style:f[0].style};else if(c){if(typeof d=="function")return i.state={style:c},Ah(i);i.state={style:l?Ya({},l,c):c}}else i.state={style:{}};return i}return NZ(n,[{key:"componentDidMount",value:function(){var o=this.props,i=o.isActive,a=o.canBegin;this.mounted=!0,!(!i||!a)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(o){var i=this.props,a=i.isActive,s=i.canBegin,l=i.attributeName,c=i.shouldReAnimate,u=i.to,f=i.from,d=this.state.style;if(s){if(!a){var p={style:l?Ya({},l,u):u};this.state&&d&&(l&&d[l]!==u||!l&&d!==u)&&this.setState(p);return}if(!(HY(o.to,u)&&o.canBegin&&o.isActive)){var h=!o.canBegin||!o.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var g=h||c?f:o.to;if(this.state&&d){var v={style:l?Ya({},l,g):g};(l&&[l]!==g||!l&&d!==g)&&this.setState(v)}this.runAnimation(Zn(Zn({},this.props),{},{from:g,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var o=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),o&&o()}},{key:"handleStyleChange",value:function(o){this.changeStyle(o)}},{key:"changeStyle",value:function(o){this.mounted&&this.setState({style:o})}},{key:"runJSAnimation",value:function(o){var i=this,a=o.from,s=o.to,l=o.duration,c=o.easing,u=o.begin,f=o.onAnimationEnd,d=o.onAnimationStart,p=_Z(a,s,vZ(c),l,this.changeStyle),h=function(){i.stopJSAnimation=p()};this.manager.start([d,u,h,l,f])}},{key:"runStepAnimation",value:function(o){var i=this,a=o.steps,s=o.begin,l=o.onAnimationStart,c=a[0],u=c.style,f=c.duration,d=f===void 0?0:f,p=function(g,v,x){if(x===0)return g;var w=v.duration,$=v.easing,C=$===void 0?"ease":$,S=v.style,b=v.properties,O=v.onAnimationEnd,P=x>0?a[x-1]:v,T=b||Object.keys(S);if(typeof C=="function"||C==="spring")return[].concat(ep(g),[i.runJSAnimation.bind(i,{from:P.style,to:S,duration:w,easing:C}),w]);var k=fb(T,w,C),_=Zn(Zn(Zn({},P.style),S),{},{transition:k});return[].concat(ep(g),[_,w,O]).filter(oZ)};return this.manager.start([l].concat(ep(a.reduce(p,[u,Math.max(d,s)])),[o.onAnimationEnd]))}},{key:"runAnimation",value:function(o){this.manager||(this.manager=ZY());var i=o.begin,a=o.duration,s=o.attributeName,l=o.to,c=o.easing,u=o.onAnimationStart,f=o.onAnimationEnd,d=o.steps,p=o.children,h=this.manager;if(this.unSubscribe=h.subscribe(this.handleStyleChange),typeof c=="function"||typeof p=="function"||c==="spring"){this.runJSAnimation(o);return}if(d.length>1){this.runStepAnimation(o);return}var g=s?Ya({},s,l):l,v=fb(Object.keys(g),a,c);h.start([u,i,Zn(Zn({},g),{},{transition:v}),a,f])}},{key:"render",value:function(){var o=this.props,i=o.children;o.begin;var a=o.duration;o.attributeName,o.easing;var s=o.isActive;o.steps,o.from,o.to,o.canBegin,o.onAnimationEnd,o.shouldReAnimate,o.onAnimationReStart;var l=AZ(o,TZ),c=y.Children.count(i),u=Lm(this.state.style);if(typeof i=="function")return i(u);if(!s||c===0||a<=0)return i;var f=function(p){var h=p.props,g=h.style,v=g===void 0?{}:g,x=h.className,w=y.cloneElement(p,Zn(Zn({},l),{},{style:Zn(Zn({},v),u),className:x}));return w};return c===1?f(y.Children.only(i)):E.createElement("div",null,y.Children.map(i,function(d){return f(d)}))}}]),n}(y.PureComponent);Gr.displayName="Animate";Gr.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};Gr.propTypes={from:Ee.oneOfType([Ee.object,Ee.string]),to:Ee.oneOfType([Ee.object,Ee.string]),attributeName:Ee.string,duration:Ee.number,begin:Ee.number,easing:Ee.oneOfType([Ee.string,Ee.func]),steps:Ee.arrayOf(Ee.shape({duration:Ee.number.isRequired,style:Ee.object.isRequired,easing:Ee.oneOfType([Ee.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Ee.func]),properties:Ee.arrayOf("string"),onAnimationEnd:Ee.func})),children:Ee.oneOfType([Ee.node,Ee.func]),isActive:Ee.bool,canBegin:Ee.bool,onAnimationEnd:Ee.func,shouldReAnimate:Ee.bool,onAnimationStart:Ee.func,onAnimationReStart:Ee.func};Number.isFinite===void 0&&(Number.isFinite=function(e){return typeof e=="number"&&isFinite(e)});Ee.object,Ee.object,Ee.object,Ee.element;Ee.object,Ee.object,Ee.object,Ee.oneOfType([Ee.array,Ee.element]),Ee.any;function Es(e){"@babel/helpers - typeof";return Es=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Es(e)}function tc(e,t,n){return t=WZ(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function WZ(e){var t=VZ(e,"string");return Es(t)==="symbol"?t:String(t)}function VZ(e,t){if(Es(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Es(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var La="recharts-tooltip-wrapper",HZ={visibility:"hidden"};function UZ(e){var t,n=e.coordinate,r=e.translateX,o=e.translateY;return lt(La,(t={},tc(t,"".concat(La,"-right"),me(r)&&n&&me(n.x)&&r>=n.x),tc(t,"".concat(La,"-left"),me(r)&&n&&me(n.x)&&r=n.y),tc(t,"".concat(La,"-top"),me(o)&&n&&me(n.y)&&og?Math.max(u,l[r]):Math.max(f,l[r])}function GZ(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return Lm({transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")})}function KZ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,o=e.position,i=e.reverseDirection,a=e.tooltipBox,s=e.useTranslate3d,l=e.viewBox,c,u,f;return a.height>0&&a.width>0&&n?(u=yb({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:o,reverseDirection:i,tooltipDimension:a.width,viewBox:l,viewBoxDimension:l.width}),f=yb({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:o,reverseDirection:i,tooltipDimension:a.height,viewBox:l,viewBoxDimension:l.height}),c=GZ({translateX:u,translateY:f,useTranslate3d:s})):c=HZ,{cssProperties:c,cssClasses:UZ({translateX:u,translateY:f,coordinate:n})}}function Ki(e){"@babel/helpers - typeof";return Ki=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ki(e)}function bb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function tp(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function cu(e){return cu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},cu(e)}function mc(e,t,n){return t=$C(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $C(e){var t=eQ(e,"string");return Ki(t)==="symbol"?t:String(t)}function eQ(e,t){if(Ki(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ki(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var wb=1,tQ=function(e){YZ(n,e);var t=ZZ(n);function n(){var r;qZ(this,n);for(var o=arguments.length,i=new Array(o),a=0;awb||Math.abs(o.height-this.lastBoundingBox.height)>wb)&&(this.lastBoundingBox.width=o.width,this.lastBoundingBox.height=o.height)}else(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1)}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var o,i;this.props.active&&this.updateBBox(),this.state.dismissed&&(((o=this.props.coordinate)===null||o===void 0?void 0:o.x)!==this.state.dismissedAtCoordinate.x||((i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var o=this,i=this.props,a=i.active,s=i.allowEscapeViewBox,l=i.animationDuration,c=i.animationEasing,u=i.children,f=i.coordinate,d=i.hasPayload,p=i.isAnimationActive,h=i.offset,g=i.position,v=i.reverseDirection,x=i.useTranslate3d,w=i.viewBox,$=i.wrapperStyle,C=KZ({allowEscapeViewBox:s,coordinate:f,offsetTopLeft:h,position:g,reverseDirection:v,tooltipBox:{height:this.lastBoundingBox.height,width:this.lastBoundingBox.width},useTranslate3d:x,viewBox:w}),S=C.cssClasses,b=C.cssProperties,O=tp(tp(tp({},p&&a&&Lm({transition:"transform ".concat(l,"ms ").concat(c)})),b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&a&&d?"visible":"hidden",position:"absolute",top:0,left:0},$);return E.createElement("div",{tabIndex:-1,role:"dialog",className:S,style:O,ref:function(T){o.wrapperNode=T}},u)}}]),n}(y.PureComponent),nQ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Br={isSsr:nQ(),get:function(t){return Br[t]},set:function(t,n){if(typeof t=="string")Br[t]=n;else{var r=Object.keys(t);r&&r.length&&r.forEach(function(o){Br[o]=t[o]})}}};function qi(e){"@babel/helpers - typeof";return qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qi(e)}function Sb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function $b(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function uu(e){return uu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},uu(e)}function Bm(e,t,n){return t=CC(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function CC(e){var t=uQ(e,"string");return qi(t)==="symbol"?t:String(t)}function uQ(e,t){if(qi(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(qi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fQ(e){return e.dataKey}function dQ(e,t){return E.isValidElement(e)?E.cloneElement(e,t):typeof e=="function"?E.createElement(e,t):E.createElement(bY,t)}var Bo=function(e){iQ(n,e);var t=aQ(n);function n(){return rQ(this,n),t.apply(this,arguments)}return oQ(n,[{key:"render",value:function(){var o=this.props,i=o.active,a=o.allowEscapeViewBox,s=o.animationDuration,l=o.animationEasing,c=o.content,u=o.coordinate,f=o.filterNull,d=o.isAnimationActive,p=o.offset,h=o.payload,g=o.payloadUniqBy,v=o.position,x=o.reverseDirection,w=o.useTranslate3d,$=o.viewBox,C=o.wrapperStyle,S=h??[];f&&S.length&&(S=cC(h.filter(function(O){return O.value!=null}),g,fQ));var b=S.length>0;return E.createElement(tQ,{allowEscapeViewBox:a,animationDuration:s,animationEasing:l,isAnimationActive:d,active:i,coordinate:u,hasPayload:b,offset:p,position:v,reverseDirection:x,useTranslate3d:w,viewBox:$,wrapperStyle:C},dQ(c,$b($b({},this.props),{},{payload:S})))}}]),n}(y.PureComponent);Bm(Bo,"displayName","Tooltip");Bm(Bo,"defaultProps",{allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Br.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var pQ=ZO,hQ=function(){return pQ.Date.now()},gQ=hQ,mQ=/\s/;function vQ(e){for(var t=e.length;t--&&mQ.test(e.charAt(t)););return t}var yQ=vQ,bQ=yQ,xQ=/^\s+/;function wQ(e){return e&&e.slice(0,bQ(e)+1).replace(xQ,"")}var SQ=wQ,$Q=SQ,Ob=ll,CQ=wa,Eb=0/0,OQ=/^[-+]0x[0-9a-f]+$/i,EQ=/^0b[01]+$/i,PQ=/^0o[0-7]+$/i,_Q=parseInt;function TQ(e){if(typeof e=="number")return e;if(CQ(e))return Eb;if(Ob(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Ob(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=$Q(e);var n=EQ.test(e);return n||PQ.test(e)?_Q(e.slice(2),n?2:8):OQ.test(e)?Eb:+e}var OC=TQ,AQ=ll,np=gQ,Pb=OC,kQ="Expected a function",jQ=Math.max,IQ=Math.min;function MQ(e,t,n){var r,o,i,a,s,l,c=0,u=!1,f=!1,d=!0;if(typeof e!="function")throw new TypeError(kQ);t=Pb(t)||0,AQ(n)&&(u=!!n.leading,f="maxWait"in n,i=f?jQ(Pb(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d);function p(b){var O=r,P=o;return r=o=void 0,c=b,a=e.apply(P,O),a}function h(b){return c=b,s=setTimeout(x,t),u?p(b):a}function g(b){var O=b-l,P=b-c,T=t-O;return f?IQ(T,i-P):T}function v(b){var O=b-l,P=b-c;return l===void 0||O>=t||O<0||f&&P>=i}function x(){var b=np();if(v(b))return w(b);s=setTimeout(x,g(b))}function w(b){return s=void 0,d&&r?p(b):(r=o=void 0,a)}function $(){s!==void 0&&clearTimeout(s),c=0,r=l=o=s=void 0}function C(){return s===void 0?a:w(np())}function S(){var b=np(),O=v(b);if(r=arguments,o=this,l=b,O){if(s===void 0)return h(l);if(f)return clearTimeout(s),s=setTimeout(x,t),p(l)}return s===void 0&&(s=setTimeout(x,t)),a}return S.cancel=$,S.flush=C,S}var RQ=MQ,DQ=RQ,NQ=ll,LQ="Expected a function";function BQ(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(LQ);return NQ(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),DQ(e,t,{leading:r,maxWait:t,trailing:o})}var FQ=BQ;const zQ=yt(FQ);var EC=function(t){return null};EC.displayName="Cell";function Ps(e){"@babel/helpers - typeof";return Ps=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ps(e)}function _b(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Mh(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Br.isSsr)return{width:0,height:0};var r=KQ(n),o=JSON.stringify({text:t,copyStyle:r});if(fi.widthCache[o])return fi.widthCache[o];try{var i=document.getElementById(Tb);i||(i=document.createElement("span"),i.setAttribute("id",Tb),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var a=Mh(Mh({},GQ),r);Object.assign(i.style,a),i.textContent="".concat(t);var s=i.getBoundingClientRect(),l={width:s.width,height:s.height};return fi.widthCache[o]=l,++fi.cacheCount>UQ&&(fi.cacheCount=0,fi.widthCache={}),l}catch{return{width:0,height:0}}},qQ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function _s(e){"@babel/helpers - typeof";return _s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_s(e)}function fu(e,t){return QQ(e)||ZQ(e,t)||YQ(e,t)||XQ()}function XQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function YQ(e,t){if(e){if(typeof e=="string")return Ab(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ab(e,t)}}function Ab(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dJ(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Db(e,t){return mJ(e)||gJ(e,t)||hJ(e,t)||pJ()}function pJ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hJ(e,t){if(e){if(typeof e=="string")return Nb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Nb(e,t)}}function Nb(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return M.reduce(function(D,L){var B=L.word,F=L.width,Z=D[D.length-1];if(Z&&(o==null||i||Z.width+F+rL.width?D:L})};if(!u)return p;for(var g="…",v=function(M){var D=f.slice(0,M),L=AC({breakAll:c,style:l,children:D+g}).wordsWithComputedWidth,B=d(L),F=B.length>a||h(B).width>Number(o);return[F,B]},x=0,w=f.length-1,$=0,C;x<=w&&$<=f.length-1;){var S=Math.floor((x+w)/2),b=S-1,O=v(b),P=Db(O,2),T=P[0],k=P[1],_=v(S),A=Db(_,1),I=A[0];if(!T&&!I&&(x=S+1),T&&I&&(w=S-1),!T&&I){C=k;break}$++}return C||p},Lb=function(t){var n=Je(t)?[]:t.toString().split(TC);return[{words:n}]},yJ=function(t){var n=t.width,r=t.scaleToFit,o=t.children,i=t.style,a=t.breakAll,s=t.maxLines;if((n||r)&&!Br.isSsr){var l,c,u=AC({breakAll:a,children:o,style:i});if(u){var f=u.wordsWithComputedWidth,d=u.spaceWidth;l=f,c=d}else return Lb(o);return vJ({breakAll:a,children:o,maxLines:s,style:i},l,c,n,r)}return Lb(o)},Bb="#808080",du=function(t){var n=t.x,r=n===void 0?0:n,o=t.y,i=o===void 0?0:o,a=t.lineHeight,s=a===void 0?"1em":a,l=t.capHeight,c=l===void 0?"0.71em":l,u=t.scaleToFit,f=u===void 0?!1:u,d=t.textAnchor,p=d===void 0?"start":d,h=t.verticalAnchor,g=h===void 0?"end":h,v=t.fill,x=v===void 0?Bb:v,w=Rb(t,uJ),$=y.useMemo(function(){return yJ({breakAll:w.breakAll,children:w.children,maxLines:w.maxLines,scaleToFit:f,style:w.style,width:w.width})},[w.breakAll,w.children,w.maxLines,f,w.style,w.width]),C=w.dx,S=w.dy,b=w.angle,O=w.className,P=w.breakAll,T=Rb(w,fJ);if(!jt(r)||!jt(i))return null;var k=r+(me(C)?C:0),_=i+(me(S)?S:0),A;switch(g){case"start":A=rp("calc(".concat(c,")"));break;case"middle":A=rp("calc(".concat(($.length-1)/2," * -").concat(s," + (").concat(c," / 2))"));break;default:A=rp("calc(".concat($.length-1," * -").concat(s,")"));break}var I=[];if(f){var j=$[0].width,M=w.width;I.push("scale(".concat((me(M)?M/j:1)/j,")"))}return b&&I.push("rotate(".concat(b,", ").concat(k,", ").concat(_,")")),I.length&&(T.transform=I.join(" ")),E.createElement("text",Rh({},Qe(T,!0),{x:k,y:_,className:lt("recharts-text",O),textAnchor:p,fill:x.includes("url")?Bb:x}),$.map(function(D,L){var B=D.words.join(P?"":" ");return E.createElement("tspan",{x:k,dy:L===0?A:s,key:B},B)}))};function vo(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function bJ(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Fm(e){let t,n,r;e.length!==2?(t=vo,n=(s,l)=>vo(e(s),l),r=(s,l)=>e(s)-l):(t=e===vo||e===bJ?e:xJ,n=e,r=e);function o(s,l,c=0,u=s.length){if(c>>1;n(s[f],l)<0?c=f+1:u=f}while(c>>1;n(s[f],l)<=0?c=f+1:u=f}while(cc&&r(s[f-1],l)>-r(s[f],l)?f-1:f}return{left:o,center:a,right:i}}function xJ(){return 0}function kC(e){return e===null?NaN:+e}function*wJ(e,t){if(t===void 0)for(let n of e)n!=null&&(n=+n)>=n&&(yield n);else{let n=-1;for(let r of e)(r=t(r,++n,e))!=null&&(r=+r)>=r&&(yield r)}}const SJ=Fm(vo),$J=SJ.right;Fm(kC).center;const _l=$J;class Fb extends Map{constructor(t,n=EJ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,o]of t)this.set(r,o)}get(t){return super.get(zb(this,t))}has(t){return super.has(zb(this,t))}set(t,n){return super.set(CJ(this,t),n)}delete(t){return super.delete(OJ(this,t))}}function zb({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function CJ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function OJ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function EJ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function PJ(e=vo){if(e===vo)return jC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function jC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const _J=Math.sqrt(50),TJ=Math.sqrt(10),AJ=Math.sqrt(2);function pu(e,t,n){const r=(t-e)/Math.max(0,n),o=Math.floor(Math.log10(r)),i=r/Math.pow(10,o),a=i>=_J?10:i>=TJ?5:i>=AJ?2:1;let s,l,c;return o<0?(c=Math.pow(10,-o)/a,s=Math.round(e*c),l=Math.round(t*c),s/ct&&--l,c=-c):(c=Math.pow(10,o)*a,s=Math.round(e/c),l=Math.round(t/c),s*ct&&--l),l0))return[];if(e===t)return[e];const r=t=o))return[];const s=i-o+1,l=new Array(s);if(r)if(a<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(n=o)&&(n=o)}return n}function Vb(e,t){let n;if(t===void 0)for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);else{let r=-1;for(let o of e)(o=t(o,++r,e))!=null&&(n>o||n===void 0&&o>=o)&&(n=o)}return n}function IC(e,t,n=0,r=1/0,o){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(o=o===void 0?jC:PJ(o);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,u=Math.log(l),f=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*f*(l-f)/l)*(c-l/2<0?-1:1),p=Math.max(n,Math.floor(t-c*f/l+d)),h=Math.min(r,Math.floor(t+(l-c)*f/l+d));IC(e,t,p,h,o)}const i=e[t];let a=n,s=r;for(Ba(e,n,t),o(e[r],i)>0&&Ba(e,n,r);a0;)--s}o(e[n],i)===0?Ba(e,n,s):(++s,Ba(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function Ba(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function kJ(e,t,n){if(e=Float64Array.from(wJ(e,n)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return Vb(e);if(t>=1)return Wb(e);var r,o=(r-1)*t,i=Math.floor(o),a=Wb(IC(e,i).subarray(0,i+1)),s=Vb(e.subarray(i+1));return a+(s-a)*(o-i)}}function jJ(e,t,n=kC){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,o=(r-1)*t,i=Math.floor(o),a=+n(e[i],i,e),s=+n(e[i+1],i+1,e);return a+(s-a)*(o-i)}}function IJ(e,t,n){e=+e,t=+t,n=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+n;for(var r=-1,o=Math.max(0,Math.ceil((t-e)/n))|0,i=new Array(o);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?rc(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?rc(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=RJ.exec(e))?new fn(t[1],t[2],t[3],1):(t=DJ.exec(e))?new fn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=NJ.exec(e))?rc(t[1],t[2],t[3],t[4]):(t=LJ.exec(e))?rc(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=BJ.exec(e))?Yb(t[1],t[2]/100,t[3]/100,1):(t=FJ.exec(e))?Yb(t[1],t[2]/100,t[3]/100,t[4]):Hb.hasOwnProperty(e)?Kb(Hb[e]):e==="transparent"?new fn(NaN,NaN,NaN,0):null}function Kb(e){return new fn(e>>16&255,e>>8&255,e&255,1)}function rc(e,t,n,r){return r<=0&&(e=t=n=NaN),new fn(e,t,n,r)}function VJ(e){return e instanceof Tl||(e=js(e)),e?(e=e.rgb(),new fn(e.r,e.g,e.b,e.opacity)):new fn}function Fh(e,t,n,r){return arguments.length===1?VJ(e):new fn(e,t,n,r??1)}function fn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Wm(fn,Fh,RC(Tl,{brighter(e){return e=e==null?hu:Math.pow(hu,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?As:Math.pow(As,e),new fn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new fn(Uo(this.r),Uo(this.g),Uo(this.b),gu(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:qb,formatHex:qb,formatHex8:HJ,formatRgb:Xb,toString:Xb}));function qb(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}`}function HJ(){return`#${Fo(this.r)}${Fo(this.g)}${Fo(this.b)}${Fo((isNaN(this.opacity)?1:this.opacity)*255)}`}function Xb(){const e=gu(this.opacity);return`${e===1?"rgb(":"rgba("}${Uo(this.r)}, ${Uo(this.g)}, ${Uo(this.b)}${e===1?")":`, ${e})`}`}function gu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Uo(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Fo(e){return e=Uo(e),(e<16?"0":"")+e.toString(16)}function Yb(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new tr(e,t,n,r)}function DC(e){if(e instanceof tr)return new tr(e.h,e.s,e.l,e.opacity);if(e instanceof Tl||(e=js(e)),!e)return new tr;if(e instanceof tr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(t===i?a=(n-r)/s+(n0&&l<1?0:a,new tr(a,s,l,e.opacity)}function UJ(e,t,n,r){return arguments.length===1?DC(e):new tr(e,t,n,r??1)}function tr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Wm(tr,UJ,RC(Tl,{brighter(e){return e=e==null?hu:Math.pow(hu,e),new tr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?As:Math.pow(As,e),new tr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new fn(op(e>=240?e-240:e+120,o,r),op(e,o,r),op(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new tr(Zb(this.h),oc(this.s),oc(this.l),gu(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=gu(this.opacity);return`${e===1?"hsl(":"hsla("}${Zb(this.h)}, ${oc(this.s)*100}%, ${oc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Zb(e){return e=(e||0)%360,e<0?e+360:e}function oc(e){return Math.max(0,Math.min(1,e||0))}function op(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Vm=e=>()=>e;function GJ(e,t){return function(n){return e+n*t}}function KJ(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function qJ(e){return(e=+e)==1?NC:function(t,n){return n-t?KJ(t,n,e):Vm(isNaN(t)?n:t)}}function NC(e,t){var n=t-e;return n?GJ(e,n):Vm(isNaN(e)?t:e)}const Qb=function e(t){var n=qJ(t);function r(o,i){var a=n((o=Fh(o)).r,(i=Fh(i)).r),s=n(o.g,i.g),l=n(o.b,i.b),c=NC(o.opacity,i.opacity);return function(u){return o.r=a(u),o.g=s(u),o.b=l(u),o.opacity=c(u),o+""}}return r.gamma=e,r}(1);function XJ(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;on&&(i=t.slice(n,i),s[a]?s[a]+=i:s[++a]=i),(r=r[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:mu(r,o)})),n=ip.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function aee(e,t,n){var r=e[0],o=e[1],i=t[0],a=t[1];return o2?see:aee,l=c=null,f}function f(d){return d==null||isNaN(d=+d)?i:(l||(l=s(e.map(r),t,n)))(r(a(d)))}return f.invert=function(d){return a(o((c||(c=s(t,e.map(r),mu)))(d)))},f.domain=function(d){return arguments.length?(e=Array.from(d,vu),u()):e.slice()},f.range=function(d){return arguments.length?(t=Array.from(d),u()):t.slice()},f.rangeRound=function(d){return t=Array.from(d),n=Hm,u()},f.clamp=function(d){return arguments.length?(a=d?!0:ln,u()):a!==ln},f.interpolate=function(d){return arguments.length?(n=d,u()):n},f.unknown=function(d){return arguments.length?(i=d,f):i},function(d,p){return r=d,o=p,u()}}function Um(){return Df()(ln,ln)}function lee(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function yu(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Xi(e){return e=yu(Math.abs(e)),e?e[1]:NaN}function cee(e,t){return function(n,r){for(var o=n.length,i=[],a=0,s=e[0],l=0;o>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),i.push(n.substring(o-=s,o+s)),!((l+=s+1)>r));)s=e[a=(a+1)%e.length];return i.reverse().join(t)}}function uee(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var fee=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Is(e){if(!(t=fee.exec(e)))throw new Error("invalid format: "+e);var t;return new Gm({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Is.prototype=Gm.prototype;function Gm(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}Gm.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function dee(e){e:for(var t=e.length,n=1,r=-1,o;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(o+1):e}var LC;function pee(e,t){var n=yu(e,t);if(!n)return e+"";var r=n[0],o=n[1],i=o-(LC=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,a=r.length;return i===a?r:i>a?r+new Array(i-a+1).join("0"):i>0?r.slice(0,i)+"."+r.slice(i):"0."+new Array(1-i).join("0")+yu(e,Math.max(0,t+i-1))[0]}function ex(e,t){var n=yu(e,t);if(!n)return e+"";var r=n[0],o=n[1];return o<0?"0."+new Array(-o).join("0")+r:r.length>o+1?r.slice(0,o+1)+"."+r.slice(o+1):r+new Array(o-r.length+2).join("0")}const tx={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:lee,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>ex(e*100,t),r:ex,s:pee,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function nx(e){return e}var rx=Array.prototype.map,ox=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function hee(e){var t=e.grouping===void 0||e.thousands===void 0?nx:cee(rx.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",o=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?nx:uee(rx.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"−":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function c(f){f=Is(f);var d=f.fill,p=f.align,h=f.sign,g=f.symbol,v=f.zero,x=f.width,w=f.comma,$=f.precision,C=f.trim,S=f.type;S==="n"?(w=!0,S="g"):tx[S]||($===void 0&&($=12),C=!0,S="g"),(v||d==="0"&&p==="=")&&(v=!0,d="0",p="=");var b=g==="$"?n:g==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",O=g==="$"?r:/[%p]/.test(S)?a:"",P=tx[S],T=/[defgprs%]/.test(S);$=$===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,$)):Math.max(0,Math.min(20,$));function k(_){var A=b,I=O,j,M,D;if(S==="c")I=P(_)+I,_="";else{_=+_;var L=_<0||1/_<0;if(_=isNaN(_)?l:P(Math.abs(_),$),C&&(_=dee(_)),L&&+_==0&&h!=="+"&&(L=!1),A=(L?h==="("?h:s:h==="-"||h==="("?"":h)+A,I=(S==="s"?ox[8+LC/3]:"")+I+(L&&h==="("?")":""),T){for(j=-1,M=_.length;++jD||D>57){I=(D===46?o+_.slice(j+1):_.slice(j))+I,_=_.slice(0,j);break}}}w&&!v&&(_=t(_,1/0));var B=A.length+_.length+I.length,F=B>1)+A+_+I+F.slice(B);break;default:_=F+A+_+I;break}return i(_)}return k.toString=function(){return f+""},k}function u(f,d){var p=c((f=Is(f),f.type="f",f)),h=Math.max(-8,Math.min(8,Math.floor(Xi(d)/3)))*3,g=Math.pow(10,-h),v=ox[8+h/3];return function(x){return p(g*x)+v}}return{format:c,formatPrefix:u}}var ic,Km,BC;gee({thousands:",",grouping:[3],currency:["$",""]});function gee(e){return ic=hee(e),Km=ic.format,BC=ic.formatPrefix,ic}function mee(e){return Math.max(0,-Xi(Math.abs(e)))}function vee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xi(t)/3)))*3-Xi(Math.abs(e)))}function yee(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Xi(t)-Xi(e))+1}function FC(e,t,n,r){var o=Lh(e,t,n),i;switch(r=Is(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(i=vee(o,a))&&(r.precision=i),BC(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(i=yee(o,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=i-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(i=mee(o))&&(r.precision=i-(r.type==="%")*2);break}}return Km(r)}function Eo(e){var t=e.domain;return e.ticks=function(n){var r=t();return Dh(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var o=t();return FC(o[0],o[o.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),o=0,i=r.length-1,a=r[o],s=r[i],l,c,u=10;for(s0;){if(c=Nh(a,s,n),c===l)return r[o]=a,r[i]=s,t(r);if(c>0)a=Math.floor(a/c)*c,s=Math.ceil(s/c)*c;else if(c<0)a=Math.ceil(a*c)/c,s=Math.floor(s*c)/c;else break;l=c}return e},e}function bu(){var e=Um();return e.copy=function(){return Al(e,bu())},Xn.apply(e,arguments),Eo(e)}function zC(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,vu),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return zC(e).unknown(t)},e=arguments.length?Array.from(e,vu):[0,1],Eo(n)}function WC(e,t){e=e.slice();var n=0,r=e.length-1,o=e[n],i=e[r],a;return iMath.pow(e,t)}function $ee(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function sx(e){return(t,n)=>-e(-t,n)}function qm(e){const t=e(ix,ax),n=t.domain;let r=10,o,i;function a(){return o=$ee(r),i=See(r),n()[0]<0?(o=sx(o),i=sx(i),e(bee,xee)):e(ix,ax),t}return t.base=function(s){return arguments.length?(r=+s,a()):r},t.domain=function(s){return arguments.length?(n(s),a()):n()},t.ticks=s=>{const l=n();let c=l[0],u=l[l.length-1];const f=u0){for(;d<=p;++d)for(h=1;hu)break;x.push(g)}}else for(;d<=p;++d)for(h=r-1;h>=1;--h)if(g=d>0?h/i(-d):h*i(d),!(gu)break;x.push(g)}x.length*2{if(s==null&&(s=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Is(l)).precision==null&&(l.trim=!0),l=Km(l)),s===1/0)return l;const c=Math.max(1,r*s/t.ticks().length);return u=>{let f=u/i(Math.round(o(u)));return f*rn(WC(n(),{floor:s=>i(Math.floor(o(s))),ceil:s=>i(Math.ceil(o(s)))})),t}function VC(){const e=qm(Df()).domain([1,10]);return e.copy=()=>Al(e,VC()).base(e.base()),Xn.apply(e,arguments),e}function lx(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function cx(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Xm(e){var t=1,n=e(lx(t),cx(t));return n.constant=function(r){return arguments.length?e(lx(t=+r),cx(t)):t},Eo(n)}function HC(){var e=Xm(Df());return e.copy=function(){return Al(e,HC()).constant(e.constant())},Xn.apply(e,arguments)}function ux(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function Cee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function Oee(e){return e<0?-e*e:e*e}function Ym(e){var t=e(ln,ln),n=1;function r(){return n===1?e(ln,ln):n===.5?e(Cee,Oee):e(ux(n),ux(1/n))}return t.exponent=function(o){return arguments.length?(n=+o,r()):n},Eo(t)}function Zm(){var e=Ym(Df());return e.copy=function(){return Al(e,Zm()).exponent(e.exponent())},Xn.apply(e,arguments),e}function Eee(){return Zm.apply(null,arguments).exponent(.5)}function fx(e){return Math.sign(e)*e*e}function Pee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function UC(){var e=Um(),t=[0,1],n=!1,r;function o(i){var a=Pee(e(i));return isNaN(a)?r:n?Math.round(a):a}return o.invert=function(i){return e.invert(fx(i))},o.domain=function(i){return arguments.length?(e.domain(i),o):e.domain()},o.range=function(i){return arguments.length?(e.range((t=Array.from(i,vu)).map(fx)),o):t.slice()},o.rangeRound=function(i){return o.range(i).round(!0)},o.round=function(i){return arguments.length?(n=!!i,o):n},o.clamp=function(i){return arguments.length?(e.clamp(i),o):e.clamp()},o.unknown=function(i){return arguments.length?(r=i,o):r},o.copy=function(){return UC(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Xn.apply(o,arguments),Eo(o)}function GC(){var e=[],t=[],n=[],r;function o(){var a=0,s=Math.max(1,t.length);for(n=new Array(s-1);++a0?n[s-1]:e[0],s=n?[r[n-1],t]:[r[c-1],r[c]]},a.unknown=function(l){return arguments.length&&(i=l),a},a.thresholds=function(){return r.slice()},a.copy=function(){return KC().domain([e,t]).range(o).unknown(i)},Xn.apply(Eo(a),arguments)}function qC(){var e=[.5],t=[0,1],n,r=1;function o(i){return i!=null&&i<=i?t[_l(e,i,0,r)]:n}return o.domain=function(i){return arguments.length?(e=Array.from(i),r=Math.min(e.length,t.length-1),o):e.slice()},o.range=function(i){return arguments.length?(t=Array.from(i),r=Math.min(e.length,t.length-1),o):t.slice()},o.invertExtent=function(i){var a=t.indexOf(i);return[e[a-1],e[a]]},o.unknown=function(i){return arguments.length?(n=i,o):n},o.copy=function(){return qC().domain(e).range(t).unknown(n)},Xn.apply(o,arguments)}const ap=new Date,sp=new Date;function Rt(e,t,n,r){function o(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(e(i=new Date(+i)),i),o.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),o.round=i=>{const a=o(i),s=o.ceil(i);return i-a(t(i=new Date(+i),a==null?1:Math.floor(a)),i),o.range=(i,a,s)=>{const l=[];if(i=o.ceil(i),s=s==null?1:Math.floor(s),!(i0))return l;let c;do l.push(c=new Date(+i)),t(i,s),e(i);while(cRt(a=>{if(a>=a)for(;e(a),!i(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!i(a););else for(;--s>=0;)for(;t(a,1),!i(a););}),n&&(o.count=(i,a)=>(ap.setTime(+i),sp.setTime(+a),e(ap),e(sp),Math.floor(n(ap,sp))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(r?a=>r(a)%i===0:a=>o.count(0,a)%i===0):o)),o}const xu=Rt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);xu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Rt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):xu);xu.range;const Rr=1e3,Bn=Rr*60,Dr=Bn*60,Kr=Dr*24,Qm=Kr*7,dx=Kr*30,lp=Kr*365,zo=Rt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Rr)},(e,t)=>(t-e)/Rr,e=>e.getUTCSeconds());zo.range;const Jm=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rr)},(e,t)=>{e.setTime(+e+t*Bn)},(e,t)=>(t-e)/Bn,e=>e.getMinutes());Jm.range;const ev=Rt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Bn)},(e,t)=>(t-e)/Bn,e=>e.getUTCMinutes());ev.range;const tv=Rt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Rr-e.getMinutes()*Bn)},(e,t)=>{e.setTime(+e+t*Dr)},(e,t)=>(t-e)/Dr,e=>e.getHours());tv.range;const nv=Rt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Dr)},(e,t)=>(t-e)/Dr,e=>e.getUTCHours());nv.range;const kl=Rt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Bn)/Kr,e=>e.getDate()-1);kl.range;const Nf=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Kr,e=>e.getUTCDate()-1);Nf.range;const XC=Rt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Kr,e=>Math.floor(e/Kr));XC.range;function ti(e){return Rt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Bn)/Qm)}const Lf=ti(0),wu=ti(1),_ee=ti(2),Tee=ti(3),Yi=ti(4),Aee=ti(5),kee=ti(6);Lf.range;wu.range;_ee.range;Tee.range;Yi.range;Aee.range;kee.range;function ni(e){return Rt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/Qm)}const Bf=ni(0),Su=ni(1),jee=ni(2),Iee=ni(3),Zi=ni(4),Mee=ni(5),Ree=ni(6);Bf.range;Su.range;jee.range;Iee.range;Zi.range;Mee.range;Ree.range;const rv=Rt(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());rv.range;const ov=Rt(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());ov.range;const qr=Rt(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());qr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});qr.range;const Xr=Rt(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Xr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rt(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Xr.range;function YC(e,t,n,r,o,i){const a=[[zo,1,Rr],[zo,5,5*Rr],[zo,15,15*Rr],[zo,30,30*Rr],[i,1,Bn],[i,5,5*Bn],[i,15,15*Bn],[i,30,30*Bn],[o,1,Dr],[o,3,3*Dr],[o,6,6*Dr],[o,12,12*Dr],[r,1,Kr],[r,2,2*Kr],[n,1,Qm],[t,1,dx],[t,3,3*dx],[e,1,lp]];function s(c,u,f){const d=uv).right(a,d);if(p===a.length)return e.every(Lh(c/lp,u/lp,f));if(p===0)return xu.every(Math.max(Lh(c,u,f),1));const[h,g]=a[d/a[p-1][2]53)return null;"w"in G||(G.w=1),"Z"in G?(de=up(Fa(G.y,0,1)),pe=de.getUTCDay(),de=pe>4||pe===0?Su.ceil(de):Su(de),de=Nf.offset(de,(G.V-1)*7),G.y=de.getUTCFullYear(),G.m=de.getUTCMonth(),G.d=de.getUTCDate()+(G.w+6)%7):(de=cp(Fa(G.y,0,1)),pe=de.getDay(),de=pe>4||pe===0?wu.ceil(de):wu(de),de=kl.offset(de,(G.V-1)*7),G.y=de.getFullYear(),G.m=de.getMonth(),G.d=de.getDate()+(G.w+6)%7)}else("W"in G||"U"in G)&&("w"in G||(G.w="u"in G?G.u%7:"W"in G?1:0),pe="Z"in G?up(Fa(G.y,0,1)).getUTCDay():cp(Fa(G.y,0,1)).getDay(),G.m=0,G.d="W"in G?(G.w+6)%7+G.W*7-(pe+5)%7:G.w+G.U*7-(pe+6)%7);return"Z"in G?(G.H+=G.Z/100|0,G.M+=G.Z%100,up(G)):cp(G)}}function P(Y,ve,ce,G){for(var fe=0,de=ve.length,pe=ce.length,se,Le;fe=pe)return-1;if(se=ve.charCodeAt(fe++),se===37){if(se=ve.charAt(fe++),Le=S[se in px?ve.charAt(fe++):se],!Le||(G=Le(Y,ce,G))<0)return-1}else if(se!=ce.charCodeAt(G++))return-1}return G}function T(Y,ve,ce){var G=c.exec(ve.slice(ce));return G?(Y.p=u.get(G[0].toLowerCase()),ce+G[0].length):-1}function k(Y,ve,ce){var G=p.exec(ve.slice(ce));return G?(Y.w=h.get(G[0].toLowerCase()),ce+G[0].length):-1}function _(Y,ve,ce){var G=f.exec(ve.slice(ce));return G?(Y.w=d.get(G[0].toLowerCase()),ce+G[0].length):-1}function A(Y,ve,ce){var G=x.exec(ve.slice(ce));return G?(Y.m=w.get(G[0].toLowerCase()),ce+G[0].length):-1}function I(Y,ve,ce){var G=g.exec(ve.slice(ce));return G?(Y.m=v.get(G[0].toLowerCase()),ce+G[0].length):-1}function j(Y,ve,ce){return P(Y,t,ve,ce)}function M(Y,ve,ce){return P(Y,n,ve,ce)}function D(Y,ve,ce){return P(Y,r,ve,ce)}function L(Y){return a[Y.getDay()]}function B(Y){return i[Y.getDay()]}function F(Y){return l[Y.getMonth()]}function Z(Y){return s[Y.getMonth()]}function ie(Y){return o[+(Y.getHours()>=12)]}function te(Y){return 1+~~(Y.getMonth()/3)}function le(Y){return a[Y.getUTCDay()]}function re(Y){return i[Y.getUTCDay()]}function ae(Y){return l[Y.getUTCMonth()]}function xe(Y){return s[Y.getUTCMonth()]}function Me(Y){return o[+(Y.getUTCHours()>=12)]}function we(Y){return 1+~~(Y.getUTCMonth()/3)}return{format:function(Y){var ve=b(Y+="",$);return ve.toString=function(){return Y},ve},parse:function(Y){var ve=O(Y+="",!1);return ve.toString=function(){return Y},ve},utcFormat:function(Y){var ve=b(Y+="",C);return ve.toString=function(){return Y},ve},utcParse:function(Y){var ve=O(Y+="",!0);return ve.toString=function(){return Y},ve}}}var px={"-":"",_:" ",0:"0"},Wt=/^\s*\d+/,zee=/^%/,Wee=/[\\^$*+?|[\]().{}]/g;function nt(e,t,n){var r=e<0?"-":"",o=(r?-e:e)+"",i=o.length;return r+(i[t.toLowerCase(),n]))}function Hee(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Uee(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Gee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Kee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function qee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function hx(e,t,n){var r=Wt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function gx(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Xee(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Yee(e,t,n){var r=Wt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Zee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function mx(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Qee(e,t,n){var r=Wt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function vx(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Jee(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function ete(e,t,n){var r=Wt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function tte(e,t,n){var r=Wt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function nte(e,t,n){var r=Wt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function rte(e,t,n){var r=zee.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function ote(e,t,n){var r=Wt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function ite(e,t,n){var r=Wt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function yx(e,t){return nt(e.getDate(),t,2)}function ate(e,t){return nt(e.getHours(),t,2)}function ste(e,t){return nt(e.getHours()%12||12,t,2)}function lte(e,t){return nt(1+kl.count(qr(e),e),t,3)}function ZC(e,t){return nt(e.getMilliseconds(),t,3)}function cte(e,t){return ZC(e,t)+"000"}function ute(e,t){return nt(e.getMonth()+1,t,2)}function fte(e,t){return nt(e.getMinutes(),t,2)}function dte(e,t){return nt(e.getSeconds(),t,2)}function pte(e){var t=e.getDay();return t===0?7:t}function hte(e,t){return nt(Lf.count(qr(e)-1,e),t,2)}function QC(e){var t=e.getDay();return t>=4||t===0?Yi(e):Yi.ceil(e)}function gte(e,t){return e=QC(e),nt(Yi.count(qr(e),e)+(qr(e).getDay()===4),t,2)}function mte(e){return e.getDay()}function vte(e,t){return nt(wu.count(qr(e)-1,e),t,2)}function yte(e,t){return nt(e.getFullYear()%100,t,2)}function bte(e,t){return e=QC(e),nt(e.getFullYear()%100,t,2)}function xte(e,t){return nt(e.getFullYear()%1e4,t,4)}function wte(e,t){var n=e.getDay();return e=n>=4||n===0?Yi(e):Yi.ceil(e),nt(e.getFullYear()%1e4,t,4)}function Ste(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+nt(t/60|0,"0",2)+nt(t%60,"0",2)}function bx(e,t){return nt(e.getUTCDate(),t,2)}function $te(e,t){return nt(e.getUTCHours(),t,2)}function Cte(e,t){return nt(e.getUTCHours()%12||12,t,2)}function Ote(e,t){return nt(1+Nf.count(Xr(e),e),t,3)}function JC(e,t){return nt(e.getUTCMilliseconds(),t,3)}function Ete(e,t){return JC(e,t)+"000"}function Pte(e,t){return nt(e.getUTCMonth()+1,t,2)}function _te(e,t){return nt(e.getUTCMinutes(),t,2)}function Tte(e,t){return nt(e.getUTCSeconds(),t,2)}function Ate(e){var t=e.getUTCDay();return t===0?7:t}function kte(e,t){return nt(Bf.count(Xr(e)-1,e),t,2)}function e5(e){var t=e.getUTCDay();return t>=4||t===0?Zi(e):Zi.ceil(e)}function jte(e,t){return e=e5(e),nt(Zi.count(Xr(e),e)+(Xr(e).getUTCDay()===4),t,2)}function Ite(e){return e.getUTCDay()}function Mte(e,t){return nt(Su.count(Xr(e)-1,e),t,2)}function Rte(e,t){return nt(e.getUTCFullYear()%100,t,2)}function Dte(e,t){return e=e5(e),nt(e.getUTCFullYear()%100,t,2)}function Nte(e,t){return nt(e.getUTCFullYear()%1e4,t,4)}function Lte(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Zi(e):Zi.ceil(e),nt(e.getUTCFullYear()%1e4,t,4)}function Bte(){return"+0000"}function xx(){return"%"}function wx(e){return+e}function Sx(e){return Math.floor(+e/1e3)}var di,t5,n5;Fte({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Fte(e){return di=Fee(e),t5=di.format,di.parse,n5=di.utcFormat,di.utcParse,di}function zte(e){return new Date(e)}function Wte(e){return e instanceof Date?+e:+new Date(+e)}function iv(e,t,n,r,o,i,a,s,l,c){var u=Um(),f=u.invert,d=u.domain,p=c(".%L"),h=c(":%S"),g=c("%I:%M"),v=c("%I %p"),x=c("%a %d"),w=c("%b %d"),$=c("%B"),C=c("%Y");function S(b){return(l(b)t(o/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(o,i)=>kJ(e,i/r))},n.copy=function(){return a5(t).domain(e)},eo.apply(n,arguments)}function zf(){var e=0,t=.5,n=1,r=1,o,i,a,s,l,c=ln,u,f=!1,d;function p(g){return isNaN(g=+g)?d:(g=.5+((g=+u(g))-i)*(r*gt}var Yte=Xte,Zte=u5,Qte=Yte,Jte=Sa;function ene(e){return e&&e.length?Zte(e,Jte,Qte):void 0}var tne=ene;const Wf=yt(tne);function nne(e,t){return ee.e^i.s<0?1:-1;for(r=i.d.length,o=e.d.length,t=0,n=re.d[t]^i.s<0?1:-1;return r===o?0:r>o^i.s<0?1:-1};Pe.decimalPlaces=Pe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*mt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Pe.dividedBy=Pe.div=function(e){return Fr(this,new this.constructor(e))};Pe.dividedToIntegerBy=Pe.idiv=function(e){var t=this,n=t.constructor;return ut(Fr(t,new n(e),0,1),n.precision)};Pe.equals=Pe.eq=function(e){return!this.cmp(e)};Pe.exponent=function(){return Tt(this)};Pe.greaterThan=Pe.gt=function(e){return this.cmp(e)>0};Pe.greaterThanOrEqualTo=Pe.gte=function(e){return this.cmp(e)>=0};Pe.isInteger=Pe.isint=function(){return this.e>this.d.length-2};Pe.isNegative=Pe.isneg=function(){return this.s<0};Pe.isPositive=Pe.ispos=function(){return this.s>0};Pe.isZero=function(){return this.s===0};Pe.lessThan=Pe.lt=function(e){return this.cmp(e)<0};Pe.lessThanOrEqualTo=Pe.lte=function(e){return this.cmp(e)<1};Pe.logarithm=Pe.log=function(e){var t,n=this,r=n.constructor,o=r.precision,i=o+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(wn))throw Error(Gn+"NaN");if(n.s<1)throw Error(Gn+(n.s?"NaN":"-Infinity"));return n.eq(wn)?new r(0):(vt=!1,t=Fr(Ms(n,i),Ms(e,i),i),vt=!0,ut(t,o))};Pe.minus=Pe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?h5(t,e):d5(t,(e.s=-e.s,e))};Pe.modulo=Pe.mod=function(e){var t,n=this,r=n.constructor,o=r.precision;if(e=new r(e),!e.s)throw Error(Gn+"NaN");return n.s?(vt=!1,t=Fr(n,e,0,1).times(e),vt=!0,n.minus(t)):ut(new r(n),o)};Pe.naturalExponential=Pe.exp=function(){return p5(this)};Pe.naturalLogarithm=Pe.ln=function(){return Ms(this)};Pe.negated=Pe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Pe.plus=Pe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?d5(t,e):h5(t,(e.s=-e.s,e))};Pe.precision=Pe.sd=function(e){var t,n,r,o=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Go+e);if(t=Tt(o)+1,r=o.d.length-1,n=r*mt+1,r=o.d[r],r){for(;r%10==0;r/=10)n--;for(r=o.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Pe.squareRoot=Pe.sqrt=function(){var e,t,n,r,o,i,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(Gn+"NaN")}for(e=Tt(s),vt=!1,o=Math.sqrt(+s),o==0||o==1/0?(t=vr(s.d),(t.length+e)%2==0&&(t+="0"),o=Math.sqrt(t),e=Ea((e+1)/2)-(e<0||e%2),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new l(t)):r=new l(o.toString()),n=l.precision,o=a=n+3;;)if(i=r,r=i.plus(Fr(s,i,a+2)).times(.5),vr(i.d).slice(0,a)===(t=vr(r.d)).slice(0,a)){if(t=t.slice(a-3,a+1),o==a&&t=="4999"){if(ut(i,n+1,0),i.times(i).eq(s)){r=i;break}}else if(t!="9999")break;a+=4}return vt=!0,ut(r,n)};Pe.times=Pe.mul=function(e){var t,n,r,o,i,a,s,l,c,u=this,f=u.constructor,d=u.d,p=(e=new f(e)).d;if(!u.s||!e.s)return new f(0);for(e.s*=u.s,n=u.e+e.e,l=d.length,c=p.length,l=0;){for(t=0,o=l+r;o>r;)s=i[o]+p[r]*d[o-r-1]+t,i[o--]=s%Bt|0,t=s/Bt|0;i[o]=(i[o]+t)%Bt|0}for(;!i[--a];)i.pop();return t?++n:i.shift(),e.d=i,e.e=n,vt?ut(e,f.precision):e};Pe.toDecimalPlaces=Pe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Er(e,0,Oa),t===void 0?t=r.rounding:Er(t,0,8),ut(n,e+Tt(n)+1,t))};Pe.toExponential=function(e,t){var n,r=this,o=r.constructor;return e===void 0?n=Zo(r,!0):(Er(e,0,Oa),t===void 0?t=o.rounding:Er(t,0,8),r=ut(new o(r),e+1,t),n=Zo(r,!0,e+1)),n};Pe.toFixed=function(e,t){var n,r,o=this,i=o.constructor;return e===void 0?Zo(o):(Er(e,0,Oa),t===void 0?t=i.rounding:Er(t,0,8),r=ut(new i(o),e+Tt(o)+1,t),n=Zo(r.abs(),!1,e+Tt(r)+1),o.isneg()&&!o.isZero()?"-"+n:n)};Pe.toInteger=Pe.toint=function(){var e=this,t=e.constructor;return ut(new t(e),Tt(e)+1,t.rounding)};Pe.toNumber=function(){return+this};Pe.toPower=Pe.pow=function(e){var t,n,r,o,i,a,s=this,l=s.constructor,c=12,u=+(e=new l(e));if(!e.s)return new l(wn);if(s=new l(s),!s.s){if(e.s<1)throw Error(Gn+"Infinity");return s}if(s.eq(wn))return s;if(r=l.precision,e.eq(wn))return ut(s,r);if(t=e.e,n=e.d.length-1,a=t>=n,i=s.s,a){if((n=u<0?-u:u)<=f5){for(o=new l(wn),t=Math.ceil(r/mt+4),vt=!1;n%2&&(o=o.times(s),Ox(o.d,t)),n=Ea(n/2),n!==0;)s=s.times(s),Ox(s.d,t);return vt=!0,e.s<0?new l(wn).div(o):ut(o,r)}}else if(i<0)throw Error(Gn+"NaN");return i=i<0&&e.d[Math.max(t,n)]&1?-1:1,s.s=1,vt=!1,o=e.times(Ms(s,r+c)),vt=!0,o=p5(o),o.s=i,o};Pe.toPrecision=function(e,t){var n,r,o=this,i=o.constructor;return e===void 0?(n=Tt(o),r=Zo(o,n<=i.toExpNeg||n>=i.toExpPos)):(Er(e,1,Oa),t===void 0?t=i.rounding:Er(t,0,8),o=ut(new i(o),e,t),n=Tt(o),r=Zo(o,e<=n||n<=i.toExpNeg,e)),r};Pe.toSignificantDigits=Pe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Er(e,1,Oa),t===void 0?t=r.rounding:Er(t,0,8)),ut(new r(n),e,t)};Pe.toString=Pe.valueOf=Pe.val=Pe.toJSON=Pe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Tt(e),n=e.constructor;return Zo(e,t<=n.toExpNeg||t>=n.toExpPos)};function d5(e,t){var n,r,o,i,a,s,l,c,u=e.constructor,f=u.precision;if(!e.s||!t.s)return t.s||(t=new u(e)),vt?ut(t,f):t;if(l=e.d,c=t.d,a=e.e,o=t.e,l=l.slice(),i=a-o,i){for(i<0?(r=l,i=-i,s=c.length):(r=c,o=a,s=l.length),a=Math.ceil(f/mt),s=a>s?a+1:s+1,i>s&&(i=s,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for(s=l.length,i=c.length,s-i<0&&(i=s,r=c,c=l,l=r),n=0;i;)n=(l[--i]=l[i]+c[i]+n)/Bt|0,l[i]%=Bt;for(n&&(l.unshift(n),++o),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=o,vt?ut(t,f):t}function Er(e,t,n){if(e!==~~e||en)throw Error(Go+e)}function vr(e){var t,n,r,o=e.length-1,i="",a=e[0];if(o>0){for(i+=a,t=1;ta?1:-1;else for(s=l=0;so[s]?1:-1;break}return l}function n(r,o,i){for(var a=0;i--;)r[i]-=a,a=r[i]1;)r.shift()}return function(r,o,i,a){var s,l,c,u,f,d,p,h,g,v,x,w,$,C,S,b,O,P,T=r.constructor,k=r.s==o.s?1:-1,_=r.d,A=o.d;if(!r.s)return new T(r);if(!o.s)throw Error(Gn+"Division by zero");for(l=r.e-o.e,O=A.length,S=_.length,p=new T(k),h=p.d=[],c=0;A[c]==(_[c]||0);)++c;if(A[c]>(_[c]||0)&&--l,i==null?w=i=T.precision:a?w=i+(Tt(r)-Tt(o))+1:w=i,w<0)return new T(0);if(w=w/mt+2|0,c=0,O==1)for(u=0,A=A[0],w++;(c1&&(A=e(A,u),_=e(_,u),O=A.length,S=_.length),C=O,g=_.slice(0,O),v=g.length;v=Bt/2&&++b;do u=0,s=t(A,g,O,v),s<0?(x=g[0],O!=v&&(x=x*Bt+(g[1]||0)),u=x/b|0,u>1?(u>=Bt&&(u=Bt-1),f=e(A,u),d=f.length,v=g.length,s=t(f,g,d,v),s==1&&(u--,n(f,O16)throw Error(lv+Tt(e));if(!e.s)return new u(wn);for(t==null?(vt=!1,s=f):s=t,a=new u(.03125);e.abs().gte(.1);)e=e.times(a),c+=5;for(r=Math.log(Ro(2,c))/Math.LN10*2+5|0,s+=r,n=o=i=new u(wn),u.precision=s;;){if(o=ut(o.times(e),s),n=n.times(++l),a=i.plus(Fr(o,n,s)),vr(a.d).slice(0,s)===vr(i.d).slice(0,s)){for(;c--;)i=ut(i.times(i),s);return u.precision=f,t==null?(vt=!0,ut(i,f)):i}i=a}}function Tt(e){for(var t=e.e*mt,n=e.d[0];n>=10;n/=10)t++;return t}function fp(e,t,n){if(t>e.LN10.sd())throw vt=!0,n&&(e.precision=n),Error(Gn+"LN10 precision limit exceeded");return ut(new e(e.LN10),t)}function co(e){for(var t="";e--;)t+="0";return t}function Ms(e,t){var n,r,o,i,a,s,l,c,u,f=1,d=10,p=e,h=p.d,g=p.constructor,v=g.precision;if(p.s<1)throw Error(Gn+(p.s?"NaN":"-Infinity"));if(p.eq(wn))return new g(0);if(t==null?(vt=!1,c=v):c=t,p.eq(10))return t==null&&(vt=!0),fp(g,c);if(c+=d,g.precision=c,n=vr(h),r=n.charAt(0),i=Tt(p),Math.abs(i)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)p=p.times(e),n=vr(p.d),r=n.charAt(0),f++;i=Tt(p),r>1?(p=new g("0."+n),i++):p=new g(r+"."+n.slice(1))}else return l=fp(g,c+2,v).times(i+""),p=Ms(new g(r+"."+n.slice(1)),c-d).plus(l),g.precision=v,t==null?(vt=!0,ut(p,v)):p;for(s=a=p=Fr(p.minus(wn),p.plus(wn),c),u=ut(p.times(p),c),o=3;;){if(a=ut(a.times(u),c),l=s.plus(Fr(a,new g(o),c)),vr(l.d).slice(0,c)===vr(s.d).slice(0,c))return s=s.times(2),i!==0&&(s=s.plus(fp(g,c+2,v).times(i+""))),s=Fr(s,new g(f),c),g.precision=v,t==null?(vt=!0,ut(s,v)):s;s=l,o+=2}}function Cx(e,t){var n,r,o;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(o=t.length;t.charCodeAt(o-1)===48;)--o;if(t=t.slice(r,o),t){if(o-=r,n=n-r-1,e.e=Ea(n/mt),e.d=[],r=(n+1)%mt,n<0&&(r+=mt),r$u||e.e<-$u))throw Error(lv+n)}else e.s=0,e.e=0,e.d=[0];return e}function ut(e,t,n){var r,o,i,a,s,l,c,u,f=e.d;for(a=1,i=f[0];i>=10;i/=10)a++;if(r=t-a,r<0)r+=mt,o=t,c=f[u=0];else{if(u=Math.ceil((r+1)/mt),i=f.length,u>=i)return e;for(c=i=f[u],a=1;i>=10;i/=10)a++;r%=mt,o=r-mt+a}if(n!==void 0&&(i=Ro(10,a-o-1),s=c/i%10|0,l=t<0||f[u+1]!==void 0||c%i,l=n<4?(s||l)&&(n==0||n==(e.s<0?3:2)):s>5||s==5&&(n==4||l||n==6&&(r>0?o>0?c/Ro(10,a-o):0:f[u-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return l?(i=Tt(e),f.length=1,t=t-i-1,f[0]=Ro(10,(mt-t%mt)%mt),e.e=Ea(-t/mt)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=u,i=1,u--):(f.length=u+1,i=Ro(10,mt-r),f[u]=o>0?(c/Ro(10,a-o)%Ro(10,o)|0)*i:0),l)for(;;)if(u==0){(f[0]+=i)==Bt&&(f[0]=1,++e.e);break}else{if(f[u]+=i,f[u]!=Bt)break;f[u--]=0,i=1}for(r=f.length;f[--r]===0;)f.pop();if(vt&&(e.e>$u||e.e<-$u))throw Error(lv+Tt(e));return e}function h5(e,t){var n,r,o,i,a,s,l,c,u,f,d=e.constructor,p=d.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new d(e),vt?ut(t,p):t;if(l=e.d,f=t.d,r=t.e,c=e.e,l=l.slice(),a=c-r,a){for(u=a<0,u?(n=l,a=-a,s=f.length):(n=f,r=c,s=l.length),o=Math.max(Math.ceil(p/mt),s)+2,a>o&&(a=o,n.length=1),n.reverse(),o=a;o--;)n.push(0);n.reverse()}else{for(o=l.length,s=f.length,u=o0;--o)l[s++]=0;for(o=f.length;o>a;){if(l[--o]0?i=i.charAt(0)+"."+i.slice(1)+co(r):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(o<0?"e":"e+")+o):o<0?(i="0."+co(-o-1)+i,n&&(r=n-a)>0&&(i+=co(r))):o>=a?(i+=co(o+1-a),n&&(r=n-o-1)>0&&(i=i+"."+co(r))):((r=o+1)0&&(o+1===a&&(i+="."),i+=co(r))),e.s<0?"-"+i:i}function Ox(e,t){if(e.length>t)return e.length=t,!0}function g5(e){var t,n,r;function o(i){var a=this;if(!(a instanceof o))return new o(i);if(a.constructor=o,i instanceof o){a.s=i.s,a.e=i.e,a.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Go+i);if(i>0)a.s=1;else if(i<0)i=-i,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(i===~~i&&i<1e7){a.e=0,a.d=[i];return}return Cx(a,i.toString())}else if(typeof i!="string")throw Error(Go+i);if(i.charCodeAt(0)===45?(i=i.slice(1),a.s=-1):a.s=1,Cne.test(i))Cx(a,i);else throw Error(Go+i)}if(o.prototype=Pe,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=g5,o.config=o.set=One,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=o[t+1]&&r<=o[t+2])this[n]=r;else throw Error(Go+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Go+n+": "+r);return this}var cv=g5($ne);wn=new cv(1);const at=cv;function Ene(e){return Ane(e)||Tne(e)||_ne(e)||Pne()}function Pne(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _ne(e,t){if(e){if(typeof e=="string")return Vh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vh(e,t)}}function Tne(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Ane(e){if(Array.isArray(e))return Vh(e)}function Vh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,o):e(t-a,Ex(function(){for(var s=arguments.length,l=new Array(s),c=0;ce.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,o=!1,i=void 0;try{for(var a=e[Symbol.iterator](),s;!(r=(s=a.next()).done)&&(n.push(s.value),!(t&&n.length===t));r=!0);}catch(l){o=!0,i=l}finally{try{!r&&a.return!=null&&a.return()}finally{if(o)throw i}}return n}}function Une(e){if(Array.isArray(e))return e}function x5(e){var t=Rs(e,2),n=t[0],r=t[1],o=n,i=r;return n>r&&(o=r,i=n),[o,i]}function w5(e,t,n){if(e.lte(0))return new at(0);var r=Gf.getDigitCount(e.toNumber()),o=new at(10).pow(r),i=e.div(o),a=r!==1?.05:.1,s=new at(Math.ceil(i.div(a).toNumber())).add(n).mul(a),l=s.mul(o);return t?l:new at(Math.ceil(l))}function Gne(e,t,n){var r=1,o=new at(e);if(!o.isint()&&n){var i=Math.abs(e);i<1?(r=new at(10).pow(Gf.getDigitCount(e)-1),o=new at(Math.floor(o.div(r).toNumber())).mul(r)):i>1&&(o=new at(Math.floor(e)))}else e===0?o=new at(Math.floor((t-1)/2)):n||(o=new at(Math.floor(e)));var a=Math.floor((t-1)/2),s=Mne(Ine(function(l){return o.add(new at(l-a).mul(r)).toNumber()}),Hh);return s(0,t)}function S5(e,t,n,r){var o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new at(0),tickMin:new at(0),tickMax:new at(0)};var i=w5(new at(t).sub(e).div(n-1),r,o),a;e<=0&&t>=0?a=new at(0):(a=new at(e).add(t).div(2),a=a.sub(new at(a).mod(i)));var s=Math.ceil(a.sub(e).div(i).toNumber()),l=Math.ceil(new at(t).sub(a).div(i).toNumber()),c=s+l+1;return c>n?S5(e,t,n,r,o+1):(c0?l+(n-c):l,s=t>0?s:s+(n-c)),{step:i,tickMin:a.sub(new at(s).mul(i)),tickMax:a.add(new at(l).mul(i))})}function Kne(e){var t=Rs(e,2),n=t[0],r=t[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(o,2),s=x5([n,r]),l=Rs(s,2),c=l[0],u=l[1];if(c===-1/0||u===1/0){var f=u===1/0?[c].concat(Gh(Hh(0,o-1).map(function(){return 1/0}))):[].concat(Gh(Hh(0,o-1).map(function(){return-1/0})),[u]);return n>r?Uh(f):f}if(c===u)return Gne(c,o,i);var d=S5(c,u,a,i),p=d.step,h=d.tickMin,g=d.tickMax,v=Gf.rangeStep(h,g.add(new at(.1).mul(p)),p);return n>r?Uh(v):v}function qne(e,t){var n=Rs(e,2),r=n[0],o=n[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=x5([r,o]),s=Rs(a,2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[r,o];if(l===c)return[l];var u=Math.max(t,2),f=w5(new at(c).sub(l).div(u-1),i,0),d=[].concat(Gh(Gf.rangeStep(new at(l),new at(c).sub(new at(.99).mul(f)),f)),[c]);return r>o?Uh(d):d}var Xne=y5(Kne),Yne=y5(qne),Zne=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Cu(){return Cu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ore(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function jl(e){var t=e.offset,n=e.layout,r=e.width,o=e.dataKey,i=e.data,a=e.dataPointFormatter,s=e.xAxis,l=e.yAxis,c=rre(e,Zne),u=Qe(c),f=i.map(function(d){var p=a(d,o),h=p.x,g=p.y,v=p.value,x=p.errorVal;if(!x)return null;var w=[],$,C;if(Array.isArray(x)){var S=Qne(x,2);$=S[0],C=S[1]}else $=C=x;if(n==="vertical"){var b=s.scale,O=g+t,P=O+r,T=O-r,k=b(v-$),_=b(v+C);w.push({x1:_,y1:P,x2:_,y2:T}),w.push({x1:k,y1:O,x2:_,y2:O}),w.push({x1:k,y1:P,x2:k,y2:T})}else if(n==="horizontal"){var A=l.scale,I=h+t,j=I-r,M=I+r,D=A(v-$),L=A(v+C);w.push({x1:j,y1:L,x2:M,y2:L}),w.push({x1:I,y1:D,x2:I,y2:L}),w.push({x1:j,y1:D,x2:M,y2:D})}return E.createElement(Pt,Cu({className:"recharts-errorBar",key:"bar-".concat(w.map(function(B){return"".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))},u),w.map(function(B){return E.createElement("line",Cu({},B,{key:"line-".concat(B.x1,"-").concat(B.x2,"-").concat(B.y1,"-").concat(B.y2)}))}))});return E.createElement(Pt,{className:"recharts-errorBars"},f)}jl.defaultProps={stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"};jl.displayName="ErrorBar";function Ds(e){"@babel/helpers - typeof";return Ds=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ds(e)}function _x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function dp(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],o=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,a=-1,s=(n=r==null?void 0:r.length)!==null&&n!==void 0?n:0;if(s<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var l=i.range,c=0;c0?o[c-1].coordinate:o[s-1].coordinate,f=o[c].coordinate,d=c>=s-1?o[0].coordinate:o[c+1].coordinate,p=void 0;if(nr(f-u)!==nr(d-f)){var h=[];if(nr(d-f)===nr(l[1]-l[0])){p=d;var g=f+l[1]-l[0];h[0]=Math.min(g,(g+u)/2),h[1]=Math.max(g,(g+u)/2)}else{p=u;var v=d+l[1]-l[0];h[0]=Math.min(f,(v+f)/2),h[1]=Math.max(f,(v+f)/2)}var x=[Math.min(f,(p+f)/2),Math.max(f,(p+f)/2)];if(t>x[0]&&t<=x[1]||t>=h[0]&&t<=h[1]){a=o[c].index;break}}else{var w=Math.min(u,d),$=Math.max(u,d);if(t>(w+f)/2&&t<=($+f)/2){a=o[c].index;break}}}else for(var C=0;C0&&C(r[C].coordinate+r[C-1].coordinate)/2&&t<=(r[C].coordinate+r[C+1].coordinate)/2||C===s-1&&t>(r[C].coordinate+r[C-1].coordinate)/2){a=r[C].index;break}return a},uv=function(t){var n=t,r=n.type.displayName,o=t.props,i=o.stroke,a=o.fill,s;switch(r){case"Line":s=i;break;case"Area":case"Radar":s=i&&i!=="none"?i:a;break;default:s=a;break}return s},gre=function(t){var n=t.barSize,r=t.stackGroups,o=r===void 0?{}:r;if(!o)return{};for(var i={},a=Object.keys(o),s=0,l=a.length;s=0});if(v&&v.length){var x=v[0].props.barSize,w=v[0].props[g];i[w]||(i[w]=[]),i[w].push({item:v[0],stackList:v.slice(1),barSize:Je(x)?n:x})}}return i},mre=function(t){var n=t.barGap,r=t.barCategoryGap,o=t.bandSize,i=t.sizeList,a=i===void 0?[]:i,s=t.maxBarSize,l=a.length;if(l<1)return null;var c=zi(n,o,0,!0),u,f=[];if(a[0].barSize===+a[0].barSize){var d=!1,p=o/l,h=a.reduce(function(C,S){return C+S.barSize||0},0);h+=(l-1)*c,h>=o&&(h-=(l-1)*c,c=0),h>=o&&p>0&&(d=!0,p*=.9,h=l*p);var g=(o-h)/2>>0,v={offset:g-c,size:0};u=a.reduce(function(C,S){var b={item:S.item,position:{offset:v.offset+v.size+c,size:d?p:S.barSize}},O=[].concat(Ax(C),[b]);return v=O[O.length-1].position,S.stackList&&S.stackList.length&&S.stackList.forEach(function(P){O.push({item:P,position:v})}),O},f)}else{var x=zi(r,o,0,!0);o-2*x-(l-1)*c<=0&&(c=0);var w=(o-2*x-(l-1)*c)/l;w>1&&(w>>=0);var $=s===+s?Math.min(w,s):w;u=a.reduce(function(C,S,b){var O=[].concat(Ax(C),[{item:S.item,position:{offset:x+(w+c)*b+(w-$)/2,size:$}}]);return S.stackList&&S.stackList.length&&S.stackList.forEach(function(P){O.push({item:P,position:O[O.length-1].position})}),O},f)}return u},vre=function(t,n,r,o){var i=r.children,a=r.width,s=r.margin,l=a-(s.left||0)-(s.right||0),c=$5({children:i,legendWidth:l});if(c){var u=o||{},f=u.width,d=u.height,p=c.align,h=c.verticalAlign,g=c.layout;if((g==="vertical"||g==="horizontal"&&h==="middle")&&p!=="center"&&me(t[p]))return Dn(Dn({},t),{},_i({},p,t[p]+(f||0)));if((g==="horizontal"||g==="vertical"&&p==="center")&&h!=="middle"&&me(t[h]))return Dn(Dn({},t),{},_i({},h,t[h]+(d||0)))}return t},yre=function(t,n,r){return Je(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},C5=function(t,n,r,o,i){var a=n.props.children,s=Wn(a,jl).filter(function(c){return yre(o,i,c.props.direction)});if(s&&s.length){var l=s.map(function(c){return c.props.dataKey});return t.reduce(function(c,u){var f=Pn(u,r,0),d=Array.isArray(f)?[Vf(f),Wf(f)]:[f,f],p=l.reduce(function(h,g){var v=Pn(u,g,0),x=d[0]-Math.abs(Array.isArray(v)?v[0]:v),w=d[1]+Math.abs(Array.isArray(v)?v[1]:v);return[Math.min(x,h[0]),Math.max(w,h[1])]},[1/0,-1/0]);return[Math.min(p[0],c[0]),Math.max(p[1],c[1])]},[1/0,-1/0])}return null},bre=function(t,n,r,o,i){var a=n.map(function(s){return C5(t,s,r,i,o)}).filter(function(s){return!Je(s)});return a&&a.length?a.reduce(function(s,l){return[Math.min(s[0],l[0]),Math.max(s[1],l[1])]},[1/0,-1/0]):null},O5=function(t,n,r,o,i){var a=n.map(function(l){var c=l.props.dataKey;return r==="number"&&c&&C5(t,l,c,o)||cs(t,c,r,i)});if(r==="number")return a.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]);var s={};return a.reduce(function(l,c){for(var u=0,f=c.length;u=2?nr(s[0]-s[1])*2*c:c,n&&(t.ticks||t.niceTicks)){var u=(t.ticks||t.niceTicks).map(function(f){var d=i?i.indexOf(f):f;return{coordinate:o(d)+c,value:f,offset:c}});return u.filter(function(f){return!El(f.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(f,d){return{coordinate:o(f)+c,value:f,index:d,offset:c}}):o.ticks&&!r?o.ticks(t.tickCount).map(function(f){return{coordinate:o(f)+c,value:f,offset:c}}):o.domain().map(function(f,d){return{coordinate:o(f)+c,value:i?i[f]:f,index:d,offset:c}})},pp=new WeakMap,ac=function(t,n){if(typeof n!="function")return t;pp.has(t)||pp.set(t,new WeakMap);var r=pp.get(t);if(r.has(n))return r.get(n);var o=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,o),o},xre=function(t,n,r){var o=t.scale,i=t.type,a=t.layout,s=t.axisType;if(o==="auto")return a==="radial"&&s==="radiusAxis"?{scale:Ts(),realScaleType:"band"}:a==="radial"&&s==="angleAxis"?{scale:bu(),realScaleType:"linear"}:i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:ls(),realScaleType:"point"}:i==="category"?{scale:Ts(),realScaleType:"band"}:{scale:bu(),realScaleType:"linear"};if(Ol(o)){var l="scale".concat(Af(o));return{scale:($x[l]||ls)(),realScaleType:$x[l]?l:"point"}}return Ue(o)?{scale:o}:{scale:ls(),realScaleType:"point"}},jx=1e-4,wre=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,o=t.range(),i=Math.min(o[0],o[1])-jx,a=Math.max(o[0],o[1])+jx,s=t(n[0]),l=t(n[r-1]);(sa||la)&&t.domain([n[0],n[r-1]])}},Sre=function(t,n){if(!t)return null;for(var r=0,o=t.length;ro)&&(i[1]=o),i[0]>o&&(i[0]=o),i[1]=0?(t[s][r][0]=i,t[s][r][1]=i+l,i=t[s][r][1]):(t[s][r][0]=a,t[s][r][1]=a+l,a=t[s][r][1])}},Ore=function(t){var n=t.length;if(!(n<=0))for(var r=0,o=t[0].length;r=0?(t[a][r][0]=i,t[a][r][1]=i+s,i=t[a][r][1]):(t[a][r][0]=0,t[a][r][1]=0)}},Ere={sign:Cre,expand:$U,none:Wi,silhouette:CU,wiggle:OU,positive:Ore},Pre=function(t,n,r){var o=n.map(function(s){return s.props.dataKey}),i=Ere[r],a=SU().keys(o).value(function(s,l){return+Pn(s,l,0)}).order(yh).offset(i);return a(t)},_re=function(t,n,r,o,i,a){if(!t)return null;var s=a?n.reverse():n,l={},c=s.reduce(function(f,d){var p=d.props,h=p.stackId,g=p.hide;if(g)return f;var v=d.props[r],x=f[v]||{hasStack:!1,stackGroups:{}};if(jt(h)){var w=x.stackGroups[h]||{numericAxisId:r,cateAxisId:o,items:[]};w.items.push(d),x.hasStack=!0,x.stackGroups[h]=w}else x.stackGroups[Pl("_stackId_")]={numericAxisId:r,cateAxisId:o,items:[d]};return Dn(Dn({},f),{},_i({},v,x))},l),u={};return Object.keys(c).reduce(function(f,d){var p=c[d];if(p.hasStack){var h={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(g,v){var x=p.stackGroups[v];return Dn(Dn({},g),{},_i({},v,{numericAxisId:r,cateAxisId:o,items:x.items,stackedData:Pre(t,x.items,i)}))},h)}return Dn(Dn({},f),{},_i({},d,p))},u)},Tre=function(t,n){var r=n.realScaleType,o=n.type,i=n.tickCount,a=n.originalDomain,s=n.allowDecimals,l=r||n.scale;if(l!=="auto"&&l!=="linear")return null;if(i&&o==="number"&&a&&(a[0]==="auto"||a[1]==="auto")){var c=t.domain();if(!c.length)return null;var u=Xne(c,i,s);return t.domain([Vf(u),Wf(u)]),{niceTicks:u}}if(i&&o==="number"){var f=t.domain(),d=Yne(f,i,s);return{niceTicks:d}}return null},Ix=function(t){var n=t.axis,r=t.ticks,o=t.bandSize,i=t.entry,a=t.index,s=t.dataKey;if(n.type==="category"){if(!n.allowDuplicatedCategory&&n.dataKey&&!Je(i[n.dataKey])){var l=qc(r,"value",i[n.dataKey]);if(l)return l.coordinate+o/2}return r[a]?r[a].coordinate+o/2:null}var c=Pn(i,Je(s)?n.dataKey:s);return Je(c)?null:n.scale(c)},Mx=function(t){var n=t.axis,r=t.ticks,o=t.offset,i=t.bandSize,a=t.entry,s=t.index;if(n.type==="category")return r[s]?r[s].coordinate+o:null;var l=Pn(a,n.dataKey,n.domain[s]);return Je(l)?null:n.scale(l)-i/2+o},Are=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var o=Math.min(r[0],r[1]),i=Math.max(r[0],r[1]);return o<=0&&i>=0?0:i<0?i:o}return r[0]},kre=function(t,n){var r=t.props.stackId;if(jt(r)){var o=n[r];if(o){var i=o.items.indexOf(t);return i>=0?o.stackedData[i]:null}}return null},jre=function(t){return t.reduce(function(n,r){return[Vf(r.concat([n[0]]).filter(me)),Wf(r.concat([n[1]]).filter(me))]},[1/0,-1/0])},P5=function(t,n,r){return Object.keys(t).reduce(function(o,i){var a=t[i],s=a.stackedData,l=s.reduce(function(c,u){var f=jre(u.slice(n,r+1));return[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],o[0]),Math.max(l[1],o[1])]},[1/0,-1/0]).map(function(o){return o===1/0||o===-1/0?0:o})},Rx=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Dx=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Xh=function(t,n,r){if(Ue(t))return t(n,r);if(!Array.isArray(t))return n;var o=[];if(me(t[0]))o[0]=r?t[0]:Math.min(t[0],n[0]);else if(Rx.test(t[0])){var i=+Rx.exec(t[0])[1];o[0]=n[0]-i}else Ue(t[0])?o[0]=t[0](n[0]):o[0]=n[0];if(me(t[1]))o[1]=r?t[1]:Math.max(t[1],n[1]);else if(Dx.test(t[1])){var a=+Dx.exec(t[1])[1];o[1]=n[1]+a}else Ue(t[1])?o[1]=t[1](n[1]):o[1]=n[1];return o},Ou=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var o=t.scale.bandwidth();if(!r||o>0)return o}if(t&&n&&n.length>=2){for(var i=Nm(n,function(f){return f.coordinate}),a=1/0,s=1,l=i.length;sa&&(c=2*Math.PI-c),{radius:s,angle:Dre(c),angleInRadian:c}},Bre=function(t){var n=t.startAngle,r=t.endAngle,o=Math.floor(n/360),i=Math.floor(r/360),a=Math.min(o,i);return{startAngle:n-a*360,endAngle:r-a*360}},Fre=function(t,n){var r=n.startAngle,o=n.endAngle,i=Math.floor(r/360),a=Math.floor(o/360),s=Math.min(i,a);return t+s*360},Fx=function(t,n){var r=t.x,o=t.y,i=Lre({x:r,y:o},n),a=i.radius,s=i.angle,l=n.innerRadius,c=n.outerRadius;if(ac)return!1;if(a===0)return!0;var u=Bre(n),f=u.startAngle,d=u.endAngle,p=s,h;if(f<=d){for(;p>d;)p-=360;for(;p=f&&p<=d}else{for(;p>f;)p-=360;for(;p=d&&p<=f}return h?Bx(Bx({},n),{},{radius:a,angle:Fre(p,n)}):null};function Bs(e){"@babel/helpers - typeof";return Bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bs(e)}var zre=["offset"];function Wre(e){return Gre(e)||Ure(e)||Hre(e)||Vre()}function Vre(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hre(e,t){if(e){if(typeof e=="string")return Yh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yh(e,t)}}function Ure(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Gre(e){if(Array.isArray(e))return Yh(e)}function Yh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qre(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function zx(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function kt(e){for(var t=1;t=0?1:-1,$,C;o==="insideStart"?($=p+w*a,C=g):o==="insideEnd"?($=h-w*a,C=!g):o==="end"&&($=h+w*a,C=g),C=x<=0?C:!C;var S=Ht(c,u,v,$),b=Ht(c,u,v,$+(C?1:-1)*359),O="M".concat(S.x,",").concat(S.y,` A`).concat(v,",").concat(v,",0,1,").concat(C?0:1,`, - `).concat(b.x,",").concat(b.y),P=Je(t.id)?Pl("recharts-radial-line-"):t.id;return E.createElement("text",Fs({},r,{dominantBaseline:"central",className:lt("recharts-radial-bar-label",s)}),E.createElement("defs",null,E.createElement("path",{id:P,d:O})),E.createElement("textPath",{xlinkHref:"#".concat(P)},n))},Jre=function(t){var n=t.viewBox,r=t.offset,o=t.position,i=n,a=i.cx,s=i.cy,l=i.innerRadius,c=i.outerRadius,u=i.startAngle,f=i.endAngle,d=(u+f)/2;if(o==="outside"){var p=Ht(a,s,c+r,d),h=p.x,g=p.y;return{x:h,y:g,textAnchor:h>=a?"start":"end",verticalAnchor:"middle"}}if(o==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(o==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(o==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var v=(l+c)/2,x=Ht(a,s,v,d),w=x.x,$=x.y;return{x:w,y:$,textAnchor:"middle",verticalAnchor:"middle"}},eoe=function(t){var n=t.viewBox,r=t.parentViewBox,o=t.offset,i=t.position,a=n,s=a.x,l=a.y,c=a.width,u=a.height,f=u>=0?1:-1,d=f*o,p=f>0?"end":"start",h=f>0?"start":"end",g=c>=0?1:-1,v=g*o,x=g>0?"end":"start",w=g>0?"start":"end";if(i==="top"){var $={x:s+c/2,y:l-f*o,textAnchor:"middle",verticalAnchor:p};return kt(kt({},$),r?{height:Math.max(l-r.y,0),width:c}:{})}if(i==="bottom"){var C={x:s+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:h};return kt(kt({},C),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(i==="left"){var S={x:s-v,y:l+u/2,textAnchor:x,verticalAnchor:"middle"};return kt(kt({},S),r?{width:Math.max(S.x-r.x,0),height:u}:{})}if(i==="right"){var b={x:s+c+v,y:l+u/2,textAnchor:w,verticalAnchor:"middle"};return kt(kt({},b),r?{width:Math.max(r.x+r.width-b.x,0),height:u}:{})}var O=r?{width:c,height:u}:{};return i==="insideLeft"?kt({x:s+v,y:l+u/2,textAnchor:w,verticalAnchor:"middle"},O):i==="insideRight"?kt({x:s+c-v,y:l+u/2,textAnchor:x,verticalAnchor:"middle"},O):i==="insideTop"?kt({x:s+c/2,y:l+d,textAnchor:"middle",verticalAnchor:h},O):i==="insideBottom"?kt({x:s+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:p},O):i==="insideTopLeft"?kt({x:s+v,y:l+d,textAnchor:w,verticalAnchor:h},O):i==="insideTopRight"?kt({x:s+c-v,y:l+d,textAnchor:x,verticalAnchor:h},O):i==="insideBottomLeft"?kt({x:s+v,y:l+u-d,textAnchor:w,verticalAnchor:p},O):i==="insideBottomRight"?kt({x:s+c-v,y:l+u-d,textAnchor:x,verticalAnchor:p},O):ca(i)&&(me(i.x)||ah(i.x))&&(me(i.y)||ah(i.y))?kt({x:s+zi(i.x,c),y:l+zi(i.y,u),textAnchor:"end",verticalAnchor:"end"},O):kt({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},O)},toe=function(t){return"cx"in t&&me(t.cx)};function Zt(e){var t=e.offset,n=t===void 0?5:t,r=Ure(e,Bre),o=kt({offset:n},r),i=o.viewBox,a=o.position,s=o.value,l=o.children,c=o.content,u=o.className,f=u===void 0?"":u,d=o.textBreakAll;if(!i||Je(s)&&Je(l)&&!y.isValidElement(c)&&!Ue(c))return null;if(y.isValidElement(c))return y.cloneElement(c,o);var p;if(Ue(c)){if(p=y.createElement(c,o),y.isValidElement(p))return p}else p=Yre(o);var h=toe(i),g=Qe(o,!0);if(h&&(a==="insideStart"||a==="insideEnd"||a==="end"))return Qre(o,p,g);var v=h?Jre(o):eoe(o);return E.createElement(du,Fs({className:lt("recharts-label",f)},g,v,{breakAll:d}),p)}Zt.displayName="Label";var T5=function(t){var n=t.cx,r=t.cy,o=t.angle,i=t.startAngle,a=t.endAngle,s=t.r,l=t.radius,c=t.innerRadius,u=t.outerRadius,f=t.x,d=t.y,p=t.top,h=t.left,g=t.width,v=t.height,x=t.clockWise,w=t.labelViewBox;if(w)return w;if(me(g)&&me(v)){if(me(f)&&me(d))return{x:f,y:d,width:g,height:v};if(me(p)&&me(h))return{x:p,y:h,width:g,height:v}}return me(f)&&me(d)?{x:f,y:d,width:0,height:0}:me(n)&&me(r)?{cx:n,cy:r,startAngle:i||o||0,endAngle:a||o||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:x}:t.viewBox?t.viewBox:{}},noe=function(t,n){return t?t===!0?E.createElement(Zt,{key:"label-implicit",viewBox:n}):jt(t)?E.createElement(Zt,{key:"label-implicit",viewBox:n,value:t}):y.isValidElement(t)?t.type===Zt?y.cloneElement(t,{key:"label-implicit",viewBox:n}):E.createElement(Zt,{key:"label-implicit",content:t,viewBox:n}):Ue(t)?E.createElement(Zt,{key:"label-implicit",content:t,viewBox:n}):ca(t)?E.createElement(Zt,Fs({viewBox:n},t,{key:"label-implicit"})):null:null},roe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var o=t.children,i=T5(t),a=Wn(o,Zt).map(function(l,c){return y.cloneElement(l,{viewBox:n||i,key:"label-".concat(c)})});if(!r)return a;var s=noe(t.label,n||i);return[s].concat(Fre(a))};Zt.parseViewBox=T5;Zt.renderCallByParent=roe;function ooe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var ioe=ooe;const aoe=yt(ioe);function zs(e){"@babel/helpers - typeof";return zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zs(e)}var soe=["valueAccessor"],loe=["data","dataKey","clockWise","id","textBreakAll"];function coe(e){return poe(e)||doe(e)||foe(e)||uoe()}function uoe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function foe(e,t){if(e){if(typeof e=="string")return Yh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yh(e,t)}}function doe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function poe(e){if(Array.isArray(e))return Yh(e)}function Yh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function voe(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var yoe=function(t){return Array.isArray(t.value)?aoe(t.value):t.value};function yo(e){var t=e.valueAccessor,n=t===void 0?yoe:t,r=Hx(e,soe),o=r.data,i=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=Hx(r,loe);return!o||!o.length?null:E.createElement(Pt,{className:"recharts-label-list"},o.map(function(u,f){var d=Je(i)?n(u,f):Pn(u&&u.payload,i),p=Je(s)?{}:{id:"".concat(s,"-").concat(f)};return E.createElement(Zt,Pu({},Qe(u,!0),c,p,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Zt.parseViewBox(Je(a)?u:Vx(Vx({},u),{},{clockWise:a})),key:"label-".concat(f),index:f}))}))}yo.displayName="LabelList";function boe(e,t){return e?e===!0?E.createElement(yo,{key:"labelList-implicit",data:t}):E.isValidElement(e)||Ue(e)?E.createElement(yo,{key:"labelList-implicit",data:t,content:e}):ca(e)?E.createElement(yo,Pu({data:t},e,{key:"labelList-implicit"})):null:null}function xoe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,o=Wn(r,yo).map(function(a,s){return y.cloneElement(a,{data:t,key:"labelList-".concat(s)})});if(!n)return o;var i=boe(e.label,t);return[i].concat(coe(o))}yo.renderCallByParent=xoe;function Ws(e){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(e)}function Zh(){return Zh=Object.assign?Object.assign.bind():function(e){for(var t=1;t=a?"start":"end",verticalAnchor:"middle"}}if(o==="center")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(o==="centerTop")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"start"};if(o==="centerBottom")return{x:a,y:s,textAnchor:"middle",verticalAnchor:"end"};var v=(l+c)/2,x=Ht(a,s,v,d),w=x.x,$=x.y;return{x:w,y:$,textAnchor:"middle",verticalAnchor:"middle"}},noe=function(t){var n=t.viewBox,r=t.parentViewBox,o=t.offset,i=t.position,a=n,s=a.x,l=a.y,c=a.width,u=a.height,f=u>=0?1:-1,d=f*o,p=f>0?"end":"start",h=f>0?"start":"end",g=c>=0?1:-1,v=g*o,x=g>0?"end":"start",w=g>0?"start":"end";if(i==="top"){var $={x:s+c/2,y:l-f*o,textAnchor:"middle",verticalAnchor:p};return kt(kt({},$),r?{height:Math.max(l-r.y,0),width:c}:{})}if(i==="bottom"){var C={x:s+c/2,y:l+u+d,textAnchor:"middle",verticalAnchor:h};return kt(kt({},C),r?{height:Math.max(r.y+r.height-(l+u),0),width:c}:{})}if(i==="left"){var S={x:s-v,y:l+u/2,textAnchor:x,verticalAnchor:"middle"};return kt(kt({},S),r?{width:Math.max(S.x-r.x,0),height:u}:{})}if(i==="right"){var b={x:s+c+v,y:l+u/2,textAnchor:w,verticalAnchor:"middle"};return kt(kt({},b),r?{width:Math.max(r.x+r.width-b.x,0),height:u}:{})}var O=r?{width:c,height:u}:{};return i==="insideLeft"?kt({x:s+v,y:l+u/2,textAnchor:w,verticalAnchor:"middle"},O):i==="insideRight"?kt({x:s+c-v,y:l+u/2,textAnchor:x,verticalAnchor:"middle"},O):i==="insideTop"?kt({x:s+c/2,y:l+d,textAnchor:"middle",verticalAnchor:h},O):i==="insideBottom"?kt({x:s+c/2,y:l+u-d,textAnchor:"middle",verticalAnchor:p},O):i==="insideTopLeft"?kt({x:s+v,y:l+d,textAnchor:w,verticalAnchor:h},O):i==="insideTopRight"?kt({x:s+c-v,y:l+d,textAnchor:x,verticalAnchor:h},O):i==="insideBottomLeft"?kt({x:s+v,y:l+u-d,textAnchor:w,verticalAnchor:p},O):i==="insideBottomRight"?kt({x:s+c-v,y:l+u-d,textAnchor:x,verticalAnchor:p},O):ca(i)&&(me(i.x)||sh(i.x))&&(me(i.y)||sh(i.y))?kt({x:s+zi(i.x,c),y:l+zi(i.y,u),textAnchor:"end",verticalAnchor:"end"},O):kt({x:s+c/2,y:l+u/2,textAnchor:"middle",verticalAnchor:"middle"},O)},roe=function(t){return"cx"in t&&me(t.cx)};function Zt(e){var t=e.offset,n=t===void 0?5:t,r=Kre(e,zre),o=kt({offset:n},r),i=o.viewBox,a=o.position,s=o.value,l=o.children,c=o.content,u=o.className,f=u===void 0?"":u,d=o.textBreakAll;if(!i||Je(s)&&Je(l)&&!y.isValidElement(c)&&!Ue(c))return null;if(y.isValidElement(c))return y.cloneElement(c,o);var p;if(Ue(c)){if(p=y.createElement(c,o),y.isValidElement(p))return p}else p=Qre(o);var h=roe(i),g=Qe(o,!0);if(h&&(a==="insideStart"||a==="insideEnd"||a==="end"))return eoe(o,p,g);var v=h?toe(o):noe(o);return E.createElement(du,Fs({className:lt("recharts-label",f)},g,v,{breakAll:d}),p)}Zt.displayName="Label";var T5=function(t){var n=t.cx,r=t.cy,o=t.angle,i=t.startAngle,a=t.endAngle,s=t.r,l=t.radius,c=t.innerRadius,u=t.outerRadius,f=t.x,d=t.y,p=t.top,h=t.left,g=t.width,v=t.height,x=t.clockWise,w=t.labelViewBox;if(w)return w;if(me(g)&&me(v)){if(me(f)&&me(d))return{x:f,y:d,width:g,height:v};if(me(p)&&me(h))return{x:p,y:h,width:g,height:v}}return me(f)&&me(d)?{x:f,y:d,width:0,height:0}:me(n)&&me(r)?{cx:n,cy:r,startAngle:i||o||0,endAngle:a||o||0,innerRadius:c||0,outerRadius:u||l||s||0,clockWise:x}:t.viewBox?t.viewBox:{}},ooe=function(t,n){return t?t===!0?E.createElement(Zt,{key:"label-implicit",viewBox:n}):jt(t)?E.createElement(Zt,{key:"label-implicit",viewBox:n,value:t}):y.isValidElement(t)?t.type===Zt?y.cloneElement(t,{key:"label-implicit",viewBox:n}):E.createElement(Zt,{key:"label-implicit",content:t,viewBox:n}):Ue(t)?E.createElement(Zt,{key:"label-implicit",content:t,viewBox:n}):ca(t)?E.createElement(Zt,Fs({viewBox:n},t,{key:"label-implicit"})):null:null},ioe=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var o=t.children,i=T5(t),a=Wn(o,Zt).map(function(l,c){return y.cloneElement(l,{viewBox:n||i,key:"label-".concat(c)})});if(!r)return a;var s=ooe(t.label,n||i);return[s].concat(Wre(a))};Zt.parseViewBox=T5;Zt.renderCallByParent=ioe;function aoe(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var soe=aoe;const loe=yt(soe);function zs(e){"@babel/helpers - typeof";return zs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zs(e)}var coe=["valueAccessor"],uoe=["data","dataKey","clockWise","id","textBreakAll"];function foe(e){return goe(e)||hoe(e)||poe(e)||doe()}function doe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function poe(e,t){if(e){if(typeof e=="string")return Zh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Zh(e,t)}}function hoe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function goe(e){if(Array.isArray(e))return Zh(e)}function Zh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function boe(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var xoe=function(t){return Array.isArray(t.value)?loe(t.value):t.value};function yo(e){var t=e.valueAccessor,n=t===void 0?xoe:t,r=Hx(e,coe),o=r.data,i=r.dataKey,a=r.clockWise,s=r.id,l=r.textBreakAll,c=Hx(r,uoe);return!o||!o.length?null:E.createElement(Pt,{className:"recharts-label-list"},o.map(function(u,f){var d=Je(i)?n(u,f):Pn(u&&u.payload,i),p=Je(s)?{}:{id:"".concat(s,"-").concat(f)};return E.createElement(Zt,Pu({},Qe(u,!0),c,p,{parentViewBox:u.parentViewBox,value:d,textBreakAll:l,viewBox:Zt.parseViewBox(Je(a)?u:Vx(Vx({},u),{},{clockWise:a})),key:"label-".concat(f),index:f}))}))}yo.displayName="LabelList";function woe(e,t){return e?e===!0?E.createElement(yo,{key:"labelList-implicit",data:t}):E.isValidElement(e)||Ue(e)?E.createElement(yo,{key:"labelList-implicit",data:t,content:e}):ca(e)?E.createElement(yo,Pu({data:t},e,{key:"labelList-implicit"})):null:null}function Soe(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,o=Wn(r,yo).map(function(a,s){return y.cloneElement(a,{data:t,key:"labelList-".concat(s)})});if(!n)return o;var i=woe(e.label,t);return[i].concat(foe(o))}yo.renderCallByParent=Soe;function Ws(e){"@babel/helpers - typeof";return Ws=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ws(e)}function Qh(){return Qh=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(a>c),`, `).concat(f.x,",").concat(f.y,` `);if(o>0){var p=Ht(n,r,o,a),h=Ht(n,r,o,c);d+="L ".concat(h.x,",").concat(h.y,` A `).concat(o,",").concat(o,`,0, `).concat(+(Math.abs(l)>180),",").concat(+(a<=c),`, - `).concat(p.x,",").concat(p.y," Z")}else d+="L ".concat(n,",").concat(r," Z");return d},Ooe=function(t){var n=t.cx,r=t.cy,o=t.innerRadius,i=t.outerRadius,a=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,u=t.endAngle,f=nr(u-c),d=sc({cx:n,cy:r,radius:i,angle:c,sign:f,cornerRadius:a,cornerIsExternal:l}),p=d.circleTangency,h=d.lineTangency,g=d.theta,v=sc({cx:n,cy:r,radius:i,angle:u,sign:-f,cornerRadius:a,cornerIsExternal:l}),x=v.circleTangency,w=v.lineTangency,$=v.theta,C=l?Math.abs(c-u):Math.abs(c-u)-g-$;if(C<0)return s?"M ".concat(h.x,",").concat(h.y,` + `).concat(p.x,",").concat(p.y," Z")}else d+="L ".concat(n,",").concat(r," Z");return d},Poe=function(t){var n=t.cx,r=t.cy,o=t.innerRadius,i=t.outerRadius,a=t.cornerRadius,s=t.forceCornerRadius,l=t.cornerIsExternal,c=t.startAngle,u=t.endAngle,f=nr(u-c),d=sc({cx:n,cy:r,radius:i,angle:c,sign:f,cornerRadius:a,cornerIsExternal:l}),p=d.circleTangency,h=d.lineTangency,g=d.theta,v=sc({cx:n,cy:r,radius:i,angle:u,sign:-f,cornerRadius:a,cornerIsExternal:l}),x=v.circleTangency,w=v.lineTangency,$=v.theta,C=l?Math.abs(c-u):Math.abs(c-u)-g-$;if(C<0)return s?"M ".concat(h.x,",").concat(h.y,` a`).concat(a,",").concat(a,",0,0,1,").concat(a*2,`,0 a`).concat(a,",").concat(a,",0,0,1,").concat(-a*2,`,0 `):A5({cx:n,cy:r,innerRadius:o,outerRadius:i,startAngle:c,endAngle:u});var S="M ".concat(h.x,",").concat(h.y,` @@ -1596,8 +1596,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `);if(o>0){var b=sc({cx:n,cy:r,radius:o,angle:c,sign:f,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),O=b.circleTangency,P=b.lineTangency,T=b.theta,k=sc({cx:n,cy:r,radius:o,angle:u,sign:-f,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),_=k.circleTangency,A=k.lineTangency,I=k.theta,j=l?Math.abs(c-u):Math.abs(c-u)-T-I;if(j<0&&a===0)return"".concat(S,"L").concat(n,",").concat(r,"Z");S+="L".concat(A.x,",").concat(A.y,` A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(_.x,",").concat(_.y,` A`).concat(o,",").concat(o,",0,").concat(+(j>180),",").concat(+(f>0),",").concat(O.x,",").concat(O.y,` - A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},Eoe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},k5=function(t){var n=Gx(Gx({},Eoe),t),r=n.cx,o=n.cy,i=n.innerRadius,a=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,d=n.className;if(a0&&Math.abs(u-f)<360?v=Ooe({cx:r,cy:o,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,h/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):v=A5({cx:r,cy:o,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f}),E.createElement("path",Zh({},Qe(n,!0),{className:p,d:v,role:"img"}))};function Vs(e){"@babel/helpers - typeof";return Vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vs(e)}function Qh(){return Qh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,l=r>=0?1:-1,c=o>=0&&r>=0||o<0&&r<0?1:0,u;if(a>0&&i instanceof Array){for(var f=[0,0,0,0],d=0,p=4;da?a:i[d];u="M".concat(t,",").concat(n+s*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(t+l*f[0],",").concat(n)),u+="L ".concat(t+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, + A`).concat(a,",").concat(a,",0,0,").concat(+(f<0),",").concat(P.x,",").concat(P.y,"Z")}else S+="L".concat(n,",").concat(r,"Z");return S},_oe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},k5=function(t){var n=Gx(Gx({},_oe),t),r=n.cx,o=n.cy,i=n.innerRadius,a=n.outerRadius,s=n.cornerRadius,l=n.forceCornerRadius,c=n.cornerIsExternal,u=n.startAngle,f=n.endAngle,d=n.className;if(a0&&Math.abs(u-f)<360?v=Poe({cx:r,cy:o,innerRadius:i,outerRadius:a,cornerRadius:Math.min(g,h/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:f}):v=A5({cx:r,cy:o,innerRadius:i,outerRadius:a,startAngle:u,endAngle:f}),E.createElement("path",Qh({},Qe(n,!0),{className:p,d:v,role:"img"}))};function Vs(e){"@babel/helpers - typeof";return Vs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vs(e)}function Jh(){return Jh=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,l=r>=0?1:-1,c=o>=0&&r>=0||o<0&&r<0?1:0,u;if(a>0&&i instanceof Array){for(var f=[0,0,0,0],d=0,p=4;da?a:i[d];u="M".concat(t,",").concat(n+s*f[0]),f[0]>0&&(u+="A ".concat(f[0],",").concat(f[0],",0,0,").concat(c,",").concat(t+l*f[0],",").concat(n)),u+="L ".concat(t+r-l*f[1],",").concat(n),f[1]>0&&(u+="A ".concat(f[1],",").concat(f[1],",0,0,").concat(c,`, `).concat(t+r,",").concat(n+s*f[1])),u+="L ".concat(t+r,",").concat(n+o-s*f[2]),f[2]>0&&(u+="A ".concat(f[2],",").concat(f[2],",0,0,").concat(c,`, `).concat(t+r-l*f[2],",").concat(n+o)),u+="L ".concat(t+l*f[3],",").concat(n+o),f[3]>0&&(u+="A ".concat(f[3],",").concat(f[3],",0,0,").concat(c,`, `).concat(t,",").concat(n+o-s*f[3])),u+="Z"}else if(a>0&&i===+i&&i>0){var h=Math.min(a,i);u="M ".concat(t,",").concat(n+s*h,` @@ -1607,13 +1607,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho L `).concat(t+r,",").concat(n+o-s*h,` A `).concat(h,",").concat(h,",0,0,").concat(c,",").concat(t+r-l*h,",").concat(n+o,` L `).concat(t+l*h,",").concat(n+o,` - A `).concat(h,",").concat(h,",0,0,").concat(c,",").concat(t,",").concat(n+o-s*h," Z")}else u="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(o," h ").concat(-r," Z");return u},Foe=function(t,n){if(!t||!n)return!1;var r=t.x,o=t.y,i=n.x,a=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(i,i+s),u=Math.max(i,i+s),f=Math.min(a,a+l),d=Math.max(a,a+l);return r>=c&&r<=u&&o>=f&&o<=d}return!1},zoe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},fv=function(t){var n=Qx(Qx({},zoe),t),r=y.useRef(),o=y.useState(-1),i=joe(o,2),a=i[0],s=i[1];y.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var C=r.current.getTotalLength();C&&s(C)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,p=n.className,h=n.animationEasing,g=n.animationDuration,v=n.animationBegin,x=n.isAnimationActive,w=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var $=lt("recharts-rectangle",p);return w?E.createElement(Gr,{canBegin:a>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:g,animationEasing:h,isActive:w},function(C){var S=C.width,b=C.height,O=C.x,P=C.y;return E.createElement(Gr,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:g,isActive:x,easing:h},E.createElement("path",_u({},Qe(n,!0),{className:$,d:Jx(O,P,S,b,d),ref:r})))}):E.createElement("path",_u({},Qe(n,!0),{className:$,d:Jx(l,c,u,f,d)}))};function eg(){return eg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qoe(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Xoe=function(t,n,r,o,i,a){return"M".concat(t,",").concat(i,"v").concat(o,"M").concat(a,",").concat(n,"h").concat(r)},Yoe=function(t){var n=t.x,r=n===void 0?0:n,o=t.y,i=o===void 0?0:o,a=t.top,s=a===void 0?0:a,l=t.left,c=l===void 0?0:l,u=t.width,f=u===void 0?0:u,d=t.height,p=d===void 0?0:d,h=t.className,g=Koe(t,Woe),v=Voe({x:r,y:i,top:s,left:c,width:f,height:p},g);return!me(r)||!me(i)||!me(f)||!me(p)||!me(s)||!me(c)?null:E.createElement("path",tg({},Qe(v,!0),{className:lt("recharts-cross",h),d:Xoe(r,i,f,p,s,c)}))},Zoe=sl,Qoe=QO,Joe=la,eie="[object Object]",tie=Function.prototype,nie=Object.prototype,j5=tie.toString,rie=nie.hasOwnProperty,oie=j5.call(Object);function iie(e){if(!Joe(e)||Zoe(e)!=eie)return!1;var t=Qoe(e);if(t===null)return!0;var n=rie.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&j5.call(n)==oie}var aie=iie;const sie=yt(aie);var lie=sl,cie=la,uie="[object Boolean]";function fie(e){return e===!0||e===!1||cie(e)&&lie(e)==uie}var die=fie;const pie=yt(die);function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(e)}function Tu(){return Tu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:d,x:l,y:c},duration:g,animationEasing:h,isActive:x},function($){var C=$.upperWidth,S=$.lowerWidth,b=$.height,O=$.x,P=$.y;return E.createElement(Gr,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:g,easing:h},E.createElement("path",Tu({},Qe(n,!0),{className:w,d:o2(O,P,C,S,b),ref:r})))}):E.createElement("g",null,E.createElement("path",Tu({},Qe(n,!0),{className:w,d:o2(l,c,u,f,d)})))},Cie=["option","shapeType","propTransformer","activeClassName","isActive"];function Ks(e){"@babel/helpers - typeof";return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ks(e)}function Oie(e,t){if(e==null)return{};var n=Eie(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Eie(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function i2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Au(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Iu(e){return Iu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Iu(e)}function mn(e,t,n){return t=R5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R5(e){var t=fae(e,"string");return Qi(t)==="symbol"?t:String(t)}function fae(e,t){if(Qi(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var dae=function(t){var n=t.data,r=t.startIndex,o=t.endIndex,i=t.x,a=t.width,s=t.travellerWidth;if(!n||!n.length)return{};var l=n.length,c=ls().domain(ku(0,l)).range([i,i+a-s]),u=c.domain().map(function(f){return c(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:c(r),endX:c(o),scale:c,scaleValues:u}},d2=function(t){return t.changedTouches&&!!t.changedTouches.length},Ys=function(e){sae(n,e);var t=lae(n);function n(r){var o;return iae(this,n),o=t.call(this,r),mn(pr(o),"handleDrag",function(i){o.leaveTimer&&(clearTimeout(o.leaveTimer),o.leaveTimer=null),o.state.isTravellerMoving?o.handleTravellerMove(i):o.state.isSlideMoving&&o.handleSlideDrag(i)}),mn(pr(o),"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&o.handleDrag(i.changedTouches[0])}),mn(pr(o),"handleDragEnd",function(){o.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=o.props,a=i.endIndex,s=i.onDragEnd,l=i.startIndex;s==null||s({endIndex:a,startIndex:l})}),o.detachDragEndListener()}),mn(pr(o),"handleLeaveWrapper",function(){(o.state.isTravellerMoving||o.state.isSlideMoving)&&(o.leaveTimer=window.setTimeout(o.handleDragEnd,o.props.leaveTimeOut))}),mn(pr(o),"handleEnterSlideOrTraveller",function(){o.setState({isTextActive:!0})}),mn(pr(o),"handleLeaveSlideOrTraveller",function(){o.setState({isTextActive:!1})}),mn(pr(o),"handleSlideDragStart",function(i){var a=d2(i)?i.changedTouches[0]:i;o.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),o.attachDragEndListener()}),o.travellerDragStartHandlers={startX:o.handleTravellerDragStart.bind(pr(o),"startX"),endX:o.handleTravellerDragStart.bind(pr(o),"endX")},o.state={},o}return aae(n,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(o){var i=o.startX,a=o.endX,s=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,f=u.length-1,d=Math.min(i,a),p=Math.max(i,a),h=n.getIndexInRange(s,d),g=n.getIndexInRange(s,p);return{startIndex:h-h%c,endIndex:g===f?f:g-g%c}}},{key:"getTextOfTick",value:function(o){var i=this.props,a=i.data,s=i.tickFormatter,l=i.dataKey,c=Pn(a[o],l,o);return Ue(s)?s(c,o):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(o){var i=this.state,a=i.slideMoveStartX,s=i.startX,l=i.endX,c=this.props,u=c.x,f=c.width,d=c.travellerWidth,p=c.startIndex,h=c.endIndex,g=c.onChange,v=o.pageX-a;v>0?v=Math.min(v,u+f-d-l,u+f-d-s):v<0&&(v=Math.max(v,u-s,u-l));var x=this.getIndex({startX:s+v,endX:l+v});(x.startIndex!==p||x.endIndex!==h)&&g&&g(x),this.setState({startX:s+v,endX:l+v,slideMoveStartX:o.pageX})}},{key:"handleTravellerDragStart",value:function(o,i){var a=d2(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:o,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(o){var i,a=this.state,s=a.brushMoveStartX,l=a.movingTravellerId,c=a.endX,u=a.startX,f=this.state[l],d=this.props,p=d.x,h=d.width,g=d.travellerWidth,v=d.onChange,x=d.gap,w=d.data,$={startX:this.state.startX,endX:this.state.endX},C=o.pageX-s;C>0?C=Math.min(C,p+h-g-f):C<0&&(C=Math.max(C,p-f)),$[l]=f+C;var S=this.getIndex($),b=S.startIndex,O=S.endIndex,P=function(){var k=w.length-1;return l==="startX"&&(c>u?b%x===0:O%x===0)||cu?O%x===0:b%x===0)||c>u&&O===k};this.setState((i={},mn(i,l,f+C),mn(i,"brushMoveStartX",o.pageX),i),function(){v&&P()&&v(S)})}},{key:"handleTravellerMoveKeyboard",value:function(o,i){var a=this,s=this.state,l=s.scaleValues,c=s.startX,u=s.endX,f=this.state[i],d=l.indexOf(f);if(d!==-1){var p=d+o;if(!(p===-1||p>=l.length)){var h=l[p];i==="startX"&&h>=u||i==="endX"&&h<=c||this.setState(mn({},i,h),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var o=this.props,i=o.x,a=o.y,s=o.width,l=o.height,c=o.fill,u=o.stroke;return E.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:s,height:l})}},{key:"renderPanorama",value:function(){var o=this.props,i=o.x,a=o.y,s=o.width,l=o.height,c=o.data,u=o.children,f=o.padding,d=y.Children.only(u);return d?E.cloneElement(d,{x:i,y:a,width:s,height:l,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(o,i){var a=this,s=this.props,l=s.y,c=s.travellerWidth,u=s.height,f=s.traveller,d=s.ariaLabel,p=s.data,h=s.startIndex,g=s.endIndex,v=Math.max(o,this.props.x),x=hp(hp({},Qe(this.props)),{},{x:v,y:l,width:c,height:u}),w=d||"Min value: ".concat(p[h].name,", Max value: ").concat(p[g].name);return E.createElement(Pt,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":o,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(C){["ArrowLeft","ArrowRight"].includes(C.key)&&(C.preventDefault(),C.stopPropagation(),a.handleTravellerMoveKeyboard(C.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},n.renderTraveller(f,x))}},{key:"renderSlide",value:function(o,i){var a=this.props,s=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,f=Math.min(o,i)+u,d=Math.max(Math.abs(i-o)-u,0);return E.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:s,width:d,height:l})}},{key:"renderText",value:function(){var o=this.props,i=o.startIndex,a=o.endIndex,s=o.y,l=o.height,c=o.travellerWidth,u=o.stroke,f=this.state,d=f.startX,p=f.endX,h=5,g={pointerEvents:"none",fill:u};return E.createElement(Pt,{className:"recharts-brush-texts"},E.createElement(du,ju({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,p)-h,y:s+l/2},g),this.getTextOfTick(i)),E.createElement(du,ju({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,p)+c+h,y:s+l/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var o=this.props,i=o.data,a=o.className,s=o.children,l=o.x,c=o.y,u=o.width,f=o.height,d=o.alwaysShowText,p=this.state,h=p.startX,g=p.endX,v=p.isTextActive,x=p.isSlideMoving,w=p.isTravellerMoving,$=p.isTravellerFocused;if(!i||!i.length||!me(l)||!me(c)||!me(u)||!me(f)||u<=0||f<=0)return null;var C=lt("recharts-brush",a),S=E.Children.count(s)===1,b=oae("userSelect","none");return E.createElement(Pt,{className:C,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(h,g),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(g,"endX"),(v||x||w||$||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(o){var i=o.x,a=o.y,s=o.width,l=o.height,c=o.stroke,u=Math.floor(a+l/2)-1;return E.createElement(E.Fragment,null,E.createElement("rect",{x:i,y:a,width:s,height:l,fill:c,stroke:"none"}),E.createElement("line",{x1:i+1,y1:u,x2:i+s-1,y2:u,fill:"none",stroke:"#fff"}),E.createElement("line",{x1:i+1,y1:u+2,x2:i+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(o,i){var a;return E.isValidElement(o)?a=E.cloneElement(o,i):Ue(o)?a=o(i):a=n.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(o,i){var a=o.data,s=o.width,l=o.x,c=o.travellerWidth,u=o.updateId,f=o.startIndex,d=o.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return hp({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s},a&&a.length?dae({data:a,width:s,x:l,travellerWidth:c,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+s-c]);var p=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s,startX:i.scale(o.startIndex),endX:i.scale(o.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(o,i){for(var a=o.length,s=0,l=a-1;l-s>1;){var c=Math.floor((s+l)/2);o[c]>i?l=c:s=c}return i>=o[l]?l:s}}]),n}(y.PureComponent);mn(Ys,"displayName","Brush");mn(Ys,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var pae=Dm;function hae(e,t){var n;return pae(e,function(r,o,i){return n=t(r,o,i),!n}),!!n}var gae=hae,mae=nC,vae=Co,yae=gae,bae=Kn,xae=Mf;function wae(e,t,n){var r=bae(e)?mae:yae;return n&&xae(e,t,n)&&(t=void 0),r(e,vae(t))}var Sae=wae;const $ae=yt(Sae);var wr=function(t,n){var r=t.alwaysShow,o=t.ifOverflow;return r&&(o="extendDomain"),o===n},Cae=JO,Oae=hC,Eae=Co;function Pae(e,t){var n={};return t=Eae(t),Oae(e,function(r,o,i){Cae(n,o,t(r,o,i))}),n}var _ae=Pae;const Tae=yt(_ae);function Aae(e,t){for(var n=-1,r=e==null?0:e.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Kae(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function qae(e,t){var n=e.x,r=e.y,o=Gae(e,Wae),i="".concat(n),a=parseInt(i,10),s="".concat(r),l=parseInt(s,10),c="".concat(t.height||o.height),u=parseInt(c,10),f="".concat(t.width||o.width),d=parseInt(f,10);return Ua(Ua(Ua(Ua(Ua({},t),o),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:d,name:t.name,radius:t.radius})}function h2(e){return E.createElement(Iie,rg({shapeType:"rectangle",propTransformer:qae,activeClassName:"recharts-active-bar"},e))}var Xae=["value","background"];function Ji(e){"@babel/helpers - typeof";return Ji=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ji(e)}function Yae(e,t){if(e==null)return{};var n=Zae(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Zae(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Mu(){return Mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ru(e){return Ru=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ru(e)}function po(e,t,n){return t=N5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N5(e){var t=ose(e,"string");return Ji(t)==="symbol"?t:String(t)}function ose(e,t){if(Ji(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ji(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xf=function(e){ese(n,e);var t=tse(n);function n(){var r;Qae(this,n);for(var o=arguments.length,i=new Array(o),a=0;a0&&Math.abs(j)0&&Math.abs(I)0&&(I=Math.min((re||0)-(j[ae-1]||0),I))});var M=I/A,D=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(O=M*D/2),g.padding==="no-gap"){var L=zi(t.barCategoryGap,M*D),B=M*D/2;O=B-L-(B-L)/D*L}}o==="xAxis"?P=[r.left+($.left||0)+(O||0),r.left+r.width-($.right||0)-(O||0)]:o==="yAxis"?P=l==="horizontal"?[r.top+r.height-($.bottom||0),r.top+($.top||0)]:[r.top+($.top||0)+(O||0),r.top+r.height-($.bottom||0)-(O||0)]:P=g.range,S&&(P=[P[1],P[0]]);var F=yre(g,i,d),Z=F.scale,ie=F.realScaleType;Z.domain(x).range(P),bre(Z);var te=Pre(Z,Qn(Qn({},g),{},{realScaleType:ie}));o==="xAxis"?(_=v==="top"&&!C||v==="bottom"&&C,T=r.left,k=f[b]-_*g.height):o==="yAxis"&&(_=v==="left"&&!C||v==="right"&&C,T=f[b]-_*g.width,k=r.top);var le=Qn(Qn(Qn({},g),te),{},{realScaleType:ie,x:T,y:k,scale:Z,width:o==="xAxis"?r.width:g.width,height:o==="yAxis"?r.height:g.height});return le.bandSize=Ou(le,te),!g.hide&&o==="xAxis"?f[b]+=(_?-1:1)*le.height:g.hide||(f[b]+=(_?-1:1)*le.width),Qn(Qn({},p),{},Yf({},h,le))},{})},B5=function(t,n){var r=t.x,o=t.y,i=n.x,a=n.y;return{x:Math.min(r,i),y:Math.min(o,a),width:Math.abs(i-r),height:Math.abs(a-o)}},cse=function(t){var n=t.x1,r=t.y1,o=t.x2,i=t.y2;return B5({x:n,y:r},{x:o,y:i})},F5=function(){function e(t){ise(this,e),this.scale=t}return ase(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(o){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),o=r[0],i=r[r.length-1];return o<=i?n>=o&&n<=i:n>=i&&n<=o}}],[{key:"create",value:function(n){return new e(n)}}]),e}();Yf(F5,"EPS",1e-4);var dv=function(t){var n=Object.keys(t).reduce(function(r,o){return Qn(Qn({},r),{},Yf({},o,F5.create(t[o])))},{});return Qn(Qn({},n),{},{apply:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.bandAware,s=i.position;return Tae(o,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(o){return D5(o,function(i,a){return n[a].isInRange(i)})}})};function use(e){return(e%180+180)%180}var fse=function(t){var n=t.width,r=t.height,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=use(o),a=i*Math.PI/180,s=Math.atan(r/n),l=a>s&&ae.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*o)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-o)<=0}function jse(e,t){return z5(e,t+1)}function Ise(e,t,n,r,o){for(var i=(r||[]).slice(),a=t.start,s=t.end,l=0,c=1,u=a,f=function(){var h=r==null?void 0:r[l];if(h===void 0)return{v:z5(r,c)};var g=l,v,x=function(){return v===void 0&&(v=n(h,g)),v},w=h.coordinate,$=l===0||Du(e,w,x,u,s);$||(l=0,u=a,c+=1),$&&(u=w+e*(x()/2+o),l+=c)},d;c<=i.length;)if(d=f(),d)return d.v;return[]}function nl(e){"@babel/helpers - typeof";return nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nl(e)}function E2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t0?p.coordinate-v*e:p.coordinate})}else i[d]=p=Xt(Xt({},p),{},{tickCoord:p.coordinate});var x=Du(e,p.tickCoord,g,s,l);x&&(l=p.tickCoord-e*(g()/2+o),i[d]=Xt(Xt({},p),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return i}function Lse(e,t,n,r,o,i){var a=(r||[]).slice(),s=a.length,l=t.start,c=t.end;if(i){var u=r[s-1],f=n(u,s-1),d=e*(u.coordinate+e*f/2-c);a[s-1]=u=Xt(Xt({},u),{},{tickCoord:d>0?u.coordinate-d*e:u.coordinate});var p=Du(e,u.tickCoord,function(){return f},l,c);p&&(c=u.tickCoord-e*(f/2+o),a[s-1]=Xt(Xt({},u),{},{isShow:!0}))}for(var h=i?s-1:s,g=function(w){var $=a[w],C,S=function(){return C===void 0&&(C=n($,w)),C};if(w===0){var b=e*($.coordinate-e*S()/2-l);a[w]=$=Xt(Xt({},$),{},{tickCoord:b<0?$.coordinate-b*e:$.coordinate})}else a[w]=$=Xt(Xt({},$),{},{tickCoord:$.coordinate});var O=Du(e,$.tickCoord,S,l,c);O&&(l=$.tickCoord+e*(S()/2+o),a[w]=Xt(Xt({},$),{},{isShow:!0}))},v=0;v=2?nr(o[1].coordinate-o[0].coordinate):1,x=kse(i,v,p);return l==="equidistantPreserveStart"?Ise(v,x,g,o,a):(l==="preserveStart"||l==="preserveStartEnd"?d=Lse(v,x,g,o,a,l==="preserveStartEnd"):d=Nse(v,x,g,o,a),d.filter(function(w){return w.isShow}))}var Bse=["viewBox"],Fse=["viewBox"],zse=["ticks"];function ea(e){"@babel/helpers - typeof";return ea=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ea(e)}function xi(){return xi=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Wse(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Vse(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _2(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Nu(e){return Nu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nu(e)}function hv(e,t,n){return t=W5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W5(e){var t=Yse(e,"string");return ea(t)==="symbol"?t:String(t)}function Yse(e,t){if(ea(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ea(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var us=function(e){Use(n,e);var t=Gse(n);function n(r){var o;return Vse(this,n),o=t.call(this,r),o.state={fontSize:"",letterSpacing:""},o}return Hse(n,[{key:"shouldComponentUpdate",value:function(o,i){var a=o.viewBox,s=gp(o,Bse),l=this.props,c=l.viewBox,u=gp(l,Fse);return!Ei(a,c)||!Ei(s,u)||!Ei(i,this.state)}},{key:"componentDidMount",value:function(){var o=this.layerReference;if(o){var i=o.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(o){var i=this.props,a=i.x,s=i.y,l=i.width,c=i.height,u=i.orientation,f=i.tickSize,d=i.mirror,p=i.tickMargin,h,g,v,x,w,$,C=d?-1:1,S=o.tickSize||f,b=me(o.tickCoord)?o.tickCoord:o.coordinate;switch(u){case"top":h=g=o.coordinate,x=s+ +!d*c,v=x-C*S,$=v-C*p,w=b;break;case"left":v=x=o.coordinate,g=a+ +!d*l,h=g-C*S,w=h-C*p,$=b;break;case"right":v=x=o.coordinate,g=a+ +d*l,h=g+C*S,w=h+C*p,$=b;break;default:h=g=o.coordinate,x=s+ +d*c,v=x+C*S,$=v+C*p,w=b;break}return{line:{x1:h,y1:v,x2:g,y2:x},tick:{x:w,y:$}}}},{key:"getTickTextAnchor",value:function(){var o=this.props,i=o.orientation,a=o.mirror,s;switch(i){case"left":s=a?"start":"end";break;case"right":s=a?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var o=this.props,i=o.orientation,a=o.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=a?"start":"end";break;default:s=a?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var o=this.props,i=o.x,a=o.y,s=o.width,l=o.height,c=o.orientation,u=o.mirror,f=o.axisLine,d=nn(nn(nn({},Qe(this.props)),Qe(f)),{},{fill:"none"});if(c==="top"||c==="bottom"){var p=+(c==="top"&&!u||c==="bottom"&&u);d=nn(nn({},d),{},{x1:i,y1:a+p*l,x2:i+s,y2:a+p*l})}else{var h=+(c==="left"&&!u||c==="right"&&u);d=nn(nn({},d),{},{x1:i+h*s,y1:a,x2:i+h*s,y2:a+l})}return E.createElement("line",xi({},d,{className:lt("recharts-cartesian-axis-line",zn(f,"className"))}))}},{key:"renderTicks",value:function(o,i,a){var s=this,l=this.props,c=l.tickLine,u=l.stroke,f=l.tick,d=l.tickFormatter,p=l.unit,h=lg(nn(nn({},this.props),{},{ticks:o}),i,a),g=this.getTickTextAnchor(),v=this.getTickVerticalAnchor(),x=Qe(this.props),w=Qe(f),$=nn(nn({},x),{},{fill:"none"},Qe(c)),C=h.map(function(S,b){var O=s.getTickLineCoord(S),P=O.line,T=O.tick,k=nn(nn(nn(nn({textAnchor:g,verticalAnchor:v},x),{},{stroke:"none",fill:u},w),T),{},{index:b,payload:S,visibleTicksCount:h.length,tickFormatter:d});return E.createElement(Pt,xi({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},Yc(s.props,S,b)),c&&E.createElement("line",xi({},$,P,{className:lt("recharts-cartesian-axis-tick-line",zn(c,"className"))})),f&&n.renderTickItem(f,k,"".concat(Ue(d)?d(S.value,b):S.value).concat(p||"")))});return E.createElement("g",{className:"recharts-cartesian-axis-ticks"},C)}},{key:"render",value:function(){var o=this,i=this.props,a=i.axisLine,s=i.width,l=i.height,c=i.ticksGenerator,u=i.className,f=i.hide;if(f)return null;var d=this.props,p=d.ticks,h=gp(d,zse),g=p;return Ue(c)&&(g=p&&p.length>0?c(this.props):c(h)),s<=0||l<=0||!g||!g.length?null:E.createElement(Pt,{className:lt("recharts-cartesian-axis",u),ref:function(x){o.layerReference=x}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Zt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(o,i,a){var s;return E.isValidElement(o)?s=E.cloneElement(o,i):Ue(o)?s=o(i):s=E.createElement(du,xi({},i,{className:"recharts-cartesian-axis-tick-value"}),a),s}}]),n}(y.Component);hv(us,"displayName","CartesianAxis");hv(us,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Zse=["x1","y1","x2","y2","key"],Qse=["offset"];function ta(e){"@babel/helpers - typeof";return ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ta(e)}function ug(){return ug=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jse(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function A2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function oo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lu(e){return Lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lu(e)}function gv(e,t,n){return t=V5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V5(e){var t=sle(e,"string");return ta(t)==="symbol"?t:String(t)}function sle(e,t){if(ta(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ta(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mv=function(e){nle(n,e);var t=rle(n);function n(){return ele(this,n),t.apply(this,arguments)}return tle(n,[{key:"renderHorizontal",value:function(o){var i=this,a=this.props,s=a.x,l=a.width,c=a.horizontal;if(!o||!o.length)return null;var u=o.map(function(f,d){var p=oo(oo({},i.props),{},{x1:s,y1:f,x2:s+l,y2:f,key:"line-".concat(d),index:d});return n.renderLineItem(c,p)});return E.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}},{key:"renderVertical",value:function(o){var i=this,a=this.props,s=a.y,l=a.height,c=a.vertical;if(!o||!o.length)return null;var u=o.map(function(f,d){var p=oo(oo({},i.props),{},{x1:f,y1:s,x2:f,y2:s+l,key:"line-".concat(d),index:d});return n.renderLineItem(c,p)});return E.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}},{key:"renderVerticalStripes",value:function(o){var i=this.props.verticalFill;if(!i||!i.length)return null;var a=this.props,s=a.fillOpacity,l=a.x,c=a.y,u=a.width,f=a.height,d=o.map(function(h){return Math.round(h+l-l)}).sort(function(h,g){return h-g});l!==d[0]&&d.unshift(0);var p=d.map(function(h,g){var v=!d[g+1],x=v?l+u-h:d[g+1]-h;if(x<=0)return null;var w=g%i.length;return E.createElement("rect",{key:"react-".concat(g),x:h,y:c,width:x,height:f,stroke:"none",fill:i[w],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}},{key:"renderHorizontalStripes",value:function(o){var i=this.props.horizontalFill;if(!i||!i.length)return null;var a=this.props,s=a.fillOpacity,l=a.x,c=a.y,u=a.width,f=a.height,d=o.map(function(h){return Math.round(h+c-c)}).sort(function(h,g){return h-g});c!==d[0]&&d.unshift(0);var p=d.map(function(h,g){var v=!d[g+1],x=v?c+f-h:d[g+1]-h;if(x<=0)return null;var w=g%i.length;return E.createElement("rect",{key:"react-".concat(g),y:h,x:l,height:x,width:u,stroke:"none",fill:i[w],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}},{key:"renderBackground",value:function(){var o=this.props.fill;if(!o||o==="none")return null;var i=this.props,a=i.fillOpacity,s=i.x,l=i.y,c=i.width,u=i.height;return E.createElement("rect",{x:s,y:l,width:c,height:u,stroke:"none",fill:o,fillOpacity:a,className:"recharts-cartesian-grid-bg"})}},{key:"render",value:function(){var o=this.props,i=o.x,a=o.y,s=o.width,l=o.height,c=o.horizontal,u=o.vertical,f=o.horizontalCoordinatesGenerator,d=o.verticalCoordinatesGenerator,p=o.xAxis,h=o.yAxis,g=o.offset,v=o.chartWidth,x=o.chartHeight,w=o.syncWithTicks,$=o.horizontalValues,C=o.verticalValues;if(!me(s)||s<=0||!me(l)||l<=0||!me(i)||i!==+i||!me(a)||a!==+a)return null;var S=this.props,b=S.horizontalPoints,O=S.verticalPoints;if((!b||!b.length)&&Ue(f)){var P=$&&$.length;b=f({yAxis:h?oo(oo({},h),{},{ticks:P?$:h.ticks}):void 0,width:v,height:x,offset:g},P?!0:w)}if((!O||!O.length)&&Ue(d)){var T=C&&C.length;O=d({xAxis:p?oo(oo({},p),{},{ticks:T?C:p.ticks}):void 0,width:v,height:x,offset:g},T?!0:w)}return E.createElement("g",{className:"recharts-cartesian-grid"},this.renderBackground(),c&&this.renderHorizontal(b),u&&this.renderVertical(O),c&&this.renderHorizontalStripes(b),u&&this.renderVerticalStripes(O))}}],[{key:"renderLineItem",value:function(o,i){var a;if(E.isValidElement(o))a=E.cloneElement(o,i);else if(Ue(o))a=o(i);else{var s=i.x1,l=i.y1,c=i.x2,u=i.y2,f=i.key,d=T2(i,Zse),p=Qe(d);p.offset;var h=T2(p,Qse);a=E.createElement("line",ug({},h,{x1:s,y1:l,x2:c,y2:u,fill:"none",key:f}))}return a}}]),n}(y.PureComponent);gv(mv,"displayName","CartesianGrid");gv(mv,"defaultProps",{horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]});var lle=["type","layout","connectNulls","ref"];function na(e){"@babel/helpers - typeof";return na=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},na(e)}function cle(e,t){if(e==null)return{};var n=ule(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function ule(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function fs(){return fs=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bu(e){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bu(e)}function Jn(e,t,n){return t=H5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H5(e){var t=wle(e,"string");return na(t)==="symbol"?t:String(t)}function wle(e,t){if(na(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(na(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Rl=function(e){vle(n,e);var t=yle(n);function n(){var r;gle(this,n);for(var o=arguments.length,i=new Array(o),a=0;ad){h=[].concat(pi(c.slice(0,g)),[d-v]);break}var x=h.length%2===0?[0,p]:[p];return[].concat(pi(n.repeat(c,f)),pi(h),x).map(function(w){return"".concat(w,"px")}).join(", ")}),Jn(lo(r),"id",Pl("recharts-line-")),Jn(lo(r),"pathRef",function(s){r.mainCurve=s}),Jn(lo(r),"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Jn(lo(r),"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return mle(n,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var o=this.getTotalLength();this.setState({totalLength:o})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var o=this.getTotalLength();o!==this.state.totalLength&&this.setState({totalLength:o})}}},{key:"getTotalLength",value:function(){var o=this.mainCurve;try{return o&&o.getTotalLength&&o.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(o,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,f=a.children,d=Wn(f,jl);if(!d)return null;var p=function(v,x){return{x:v.x,y:v.y,value:v.value,errorVal:Pn(v.payload,x)}},h={clipPath:o?"url(#clipPath-".concat(i,")"):null};return E.createElement(Pt,h,d.map(function(g){return E.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,dataPointFormatter:p})}))}},{key:"renderDots",value:function(o,i,a){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,f=l.dataKey,d=Qe(this.props),p=Qe(c,!0),h=u.map(function(v,x){var w=gn(gn(gn({key:"dot-".concat(x),r:3},d),p),{},{value:v.value,dataKey:f,cx:v.x,cy:v.y,index:x,payload:v.payload});return n.renderDotItem(c,w)}),g={clipPath:o?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return E.createElement(Pt,fs({className:"recharts-line-dots",key:"dots"},g),h)}},{key:"renderCurveStatically",value:function(o,i,a,s){var l=this.props,c=l.type,u=l.layout,f=l.connectNulls;l.ref;var d=cle(l,lle),p=gn(gn(gn({},Qe(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:o},s),{},{type:c,layout:u,connectNulls:f});return E.createElement(Jh,fs({},p,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(o,i){var a=this,s=this.props,l=s.points,c=s.strokeDasharray,u=s.isAnimationActive,f=s.animationBegin,d=s.animationDuration,p=s.animationEasing,h=s.animationId,g=s.animateNewValues,v=s.width,x=s.height,w=this.state,$=w.prevPoints,C=w.totalLength;return E.createElement(Gr,{begin:f,duration:d,isActive:u,easing:p,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var b=S.t;if($){var O=$.length/l.length,P=l.map(function(I,j){var M=Math.floor(j*O);if($[M]){var D=$[M],L=er(D.x,I.x),B=er(D.y,I.y);return gn(gn({},I),{},{x:L(b),y:B(b)})}if(g){var F=er(v*2,I.x),Z=er(x/2,I.y);return gn(gn({},I),{},{x:F(b),y:Z(b)})}return gn(gn({},I),{},{x:I.x,y:I.y})});return a.renderCurveStatically(P,o,i)}var T=er(0,C),k=T(b),_;if(c){var A="".concat(c).split(/[,\s]+/gim).map(function(I){return parseFloat(I)});_=a.getStrokeDasharray(k,C,A)}else _=a.generateSimpleStrokeDasharray(C,k);return a.renderCurveStatically(l,o,i,{strokeDasharray:_})})}},{key:"renderCurve",value:function(o,i){var a=this.props,s=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,f=c.totalLength;return l&&s&&s.length&&(!u&&f>0||!Vf(u,s))?this.renderCurveWithAnimation(o,i):this.renderCurveStatically(s,o,i)}},{key:"render",value:function(){var o,i=this.props,a=i.hide,s=i.dot,l=i.points,c=i.className,u=i.xAxis,f=i.yAxis,d=i.top,p=i.left,h=i.width,g=i.height,v=i.isAnimationActive,x=i.id;if(a||!l||!l.length)return null;var w=this.state.isAnimationFinished,$=l.length===1,C=lt("recharts-line",c),S=u&&u.allowDataOverflow,b=f&&f.allowDataOverflow,O=S||b,P=Je(x)?this.id:x,T=(o=Qe(s))!==null&&o!==void 0?o:{r:3,strokeWidth:2},k=T.r,_=k===void 0?3:k,A=T.strokeWidth,I=A===void 0?2:A,j=UV(s)?s:{},M=j.clipDot,D=M===void 0?!0:M,L=_*2+I;return E.createElement(Pt,{className:C},S||b?E.createElement("defs",null,E.createElement("clipPath",{id:"clipPath-".concat(P)},E.createElement("rect",{x:S?p:p-h/2,y:b?d:d-g/2,width:S?h:h*2,height:b?g:g*2})),!D&&E.createElement("clipPath",{id:"clipPath-dots-".concat(P)},E.createElement("rect",{x:p-L/2,y:d-L/2,width:h+L,height:g+L}))):null,!$&&this.renderCurve(O,P),this.renderErrorBar(O,P),($||s)&&this.renderDots(O,D,P),(!v||w)&&yo.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(o,i){return o.animationId!==i.prevAnimationId?{prevAnimationId:o.animationId,curPoints:o.points,prevPoints:i.curPoints}:o.points!==i.curPoints?{curPoints:o.points}:null}},{key:"repeat",value:function(o,i){for(var a=o.length%2!==0?[].concat(pi(o),[0]):o,s=[],l=0;l-1?o[i?t[a]:a]:void 0}}var Ele=Ole,Ple=I5;function _le(e){var t=Ple(e),n=t%1;return t===t?n?t-n:t:0}var Tle=_le,Ale=lC,kle=Co,jle=Tle,Ile=Math.max;function Mle(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var o=n==null?0:jle(n);return o<0&&(o=Ile(r+o,0)),Ale(e,kle(t),o)}var Rle=Mle,Dle=Ele,Nle=Rle,Lle=Dle(Nle),Ble=Lle;const Fle=yt(Ble);var zle="Invariant failed";function Wle(e,t){if(!e)throw new Error(zle)}function U5(e){var t=e.cx,n=e.cy,r=e.radius,o=e.startAngle,i=e.endAngle,a=Ht(t,n,r,o),s=Ht(t,n,r,i);return{points:[a,s],cx:t,cy:n,radius:r,startAngle:o,endAngle:i}}function M2(e){return Gle(e)||Ule(e)||Hle(e)||Vle()}function Vle(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hle(e,t){if(e){if(typeof e=="string")return hg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hg(e,t)}}function Ule(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Gle(e){if(Array.isArray(e))return hg(e)}function hg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sce(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function lce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L2(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Fu(e){return Fu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Fu(e)}function oa(e){return mce(e)||gce(e)||q5(e)||hce()}function hce(){throw new TypeError(`Invalid attempt to spread non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q5(e,t){if(e){if(typeof e=="string")return vg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vg(e,t)}}function gce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function mce(e){if(Array.isArray(e))return vg(e)}function vg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?a:t&&t.length&&me(o)&&me(i)?t.slice(o,i+1):[]};function Z5(e){return e==="number"?[0,"auto"]:void 0}var Q5=function(t,n,r,o){var i=t.graphicalItems,a=t.tooltipAxis,s=Jf(n,t);return r<0||!i||!i.length||r>=s.length?null:i.reduce(function(l,c){var u,f=c.props.hide;if(f)return l;var d=(u=c.props.data)!==null&&u!==void 0?u:n;d&&t.dataStartIndex+t.dataEndIndex!==0&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(a.dataKey&&!a.allowDuplicatedCategory){var h=d===void 0?s:d;p=qc(h,a.dataKey,o)}else p=d&&d[r]||s[r];return p?[].concat(oa(l),[_5(c,p)]):l},[])},F2=function(t,n,r,o){var i=o||{x:t.chartX,y:t.chartY},a=xce(i,r),s=t.orderedTooltipTicks,l=t.tooltipAxis,c=t.tooltipTicks,u=dre(a,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=Q5(t,n,u,f),p=wce(r,s,u,i);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:p}}return null},Sce=function(t,n){var r=n.axes,o=n.graphicalItems,i=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.layout,f=t.children,d=t.stackOffset,p=E5(u,i);return r.reduce(function(h,g){var v,x=g.props,w=x.type,$=x.dataKey,C=x.allowDataOverflow,S=x.allowDuplicatedCategory,b=x.scale,O=x.ticks,P=x.includeHidden,T=g.props[a];if(h[T])return h;var k=Jf(t.data,{graphicalItems:o.filter(function(te){return te.props[a]===T}),dataStartIndex:l,dataEndIndex:c}),_=k.length,A,I,j;Jle(g.props.domain,C,w)&&(A=qh(g.props.domain,null,C),p&&(w==="number"||b!=="auto")&&(j=cs(k,$,"category")));var M=Z5(w);if(!A||A.length===0){var D,L=(D=g.props.domain)!==null&&D!==void 0?D:M;if($){if(A=cs(k,$,w),w==="category"&&p){var B=DV(A);S&&B?(I=A,A=ku(0,_)):S||(A=Nx(L,A,g).reduce(function(te,le){return te.indexOf(le)>=0?te:[].concat(oa(te),[le])},[]))}else if(w==="category")S?A=A.filter(function(te){return te!==""&&!Je(te)}):A=Nx(L,A,g).reduce(function(te,le){return te.indexOf(le)>=0||le===""||Je(le)?te:[].concat(oa(te),[le])},[]);else if(w==="number"){var F=vre(k,o.filter(function(te){return te.props[a]===T&&(P||!te.props.hide)}),$,i,u);F&&(A=F)}p&&(w==="number"||b!=="auto")&&(j=cs(k,$,"category"))}else p?A=ku(0,_):s&&s[T]&&s[T].hasStack&&w==="number"?A=d==="expand"?[0,1]:P5(s[T].stackGroups,l,c):A=O5(k,o.filter(function(te){return te.props[a]===T&&(P||!te.props.hide)}),w,u,!0);if(w==="number")A=gg(f,A,T,i,O),L&&(A=qh(L,A,C));else if(w==="category"&&L){var Z=L,ie=A.every(function(te){return Z.indexOf(te)>=0});ie&&(A=Z)}}return J(J({},h),{},Ie({},T,J(J({},g.props),{},{axisType:i,domain:A,categoricalDomain:j,duplicateDomain:I,originalDomain:(v=g.props.domain)!==null&&v!==void 0?v:M,isCategorical:p,layout:u})))},{})},$ce=function(t,n){var r=n.graphicalItems,o=n.Axis,i=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.layout,f=t.children,d=Jf(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),p=d.length,h=E5(u,i),g=-1;return r.reduce(function(v,x){var w=x.props[a],$=Z5("number");if(!v[w]){g++;var C;return h?C=ku(0,p):s&&s[w]&&s[w].hasStack?(C=P5(s[w].stackGroups,l,c),C=gg(f,C,w,i)):(C=qh($,O5(d,r.filter(function(S){return S.props[a]===w&&!S.props.hide}),"number",u),o.defaultProps.allowDataOverflow),C=gg(f,C,w,i)),J(J({},v),{},Ie({},w,J(J({axisType:i},o.defaultProps),{},{hide:!0,orientation:zn(yce,"".concat(i,".").concat(g%2),null),domain:C,originalDomain:$,isCategorical:h,layout:u})))}return v},{})},Cce=function(t,n){var r=n.axisType,o=r===void 0?"xAxis":r,i=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.children,f="".concat(o,"Id"),d=Wn(u,i),p={};return d&&d.length?p=Sce(t,{axes:d,graphicalItems:a,axisType:o,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(p=$ce(t,{Axis:i,graphicalItems:a,axisType:o,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),p},Oce=function(t){var n=ao(t),r=so(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Nm(r,function(o){return o.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Ou(n,r)}},z2=function(t){var n=t.children,r=t.defaultShowTooltip,o=Mr(n,Ys),i=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),o&&o.props&&(o.props.startIndex>=0&&(i=o.props.startIndex),o.props.endIndex>=0&&(a=o.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},Ece=function(t){return!t||!t.length?!1:t.some(function(n){var r=mo(n&&n.type);return r&&r.indexOf("Bar")>=0})},W2=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Pce=function(t,n){var r=t.props,o=t.graphicalItems,i=t.xAxisMap,a=i===void 0?{}:i,s=t.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,f=r.children,d=r.margin||{},p=Mr(f,Ys),h=Mr(f,Ss),g=Object.keys(l).reduce(function(S,b){var O=l[b],P=O.orientation;return!O.mirror&&!O.hide?J(J({},S),{},Ie({},P,S[P]+O.width)):S},{left:d.left||0,right:d.right||0}),v=Object.keys(a).reduce(function(S,b){var O=a[b],P=O.orientation;return!O.mirror&&!O.hide?J(J({},S),{},Ie({},P,zn(S,"".concat(P))+O.height)):S},{top:d.top||0,bottom:d.bottom||0}),x=J(J({},v),g),w=x.bottom;p&&(x.bottom+=p.props.height||Ys.defaultProps.height),h&&n&&(x=gre(x,o,r,n));var $=c-x.left-x.right,C=u-x.top-x.bottom;return J(J({brushBottom:w},x),{},{width:Math.max($,0),height:Math.max(C,0)})},_ce=function(t){var n,r=t.chartName,o=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,p=function(v,x){var w=x.graphicalItems,$=x.stackGroups,C=x.offset,S=x.updateId,b=x.dataStartIndex,O=x.dataEndIndex,P=v.barSize,T=v.layout,k=v.barGap,_=v.barCategoryGap,A=v.maxBarSize,I=W2(T),j=I.numericAxisName,M=I.cateAxisName,D=Ece(w),L=D&&pre({barSize:P,stackGroups:$}),B=[];return w.forEach(function(F,Z){var ie=Jf(v.data,{graphicalItems:[F],dataStartIndex:b,dataEndIndex:O}),te=F.props,le=te.dataKey,re=te.maxBarSize,ae=F.props["".concat(j,"Id")],xe=F.props["".concat(M,"Id")],Me={},we=c.reduce(function(z,U){var W,V=x["".concat(U.axisType,"Map")],q=F.props["".concat(U.axisType,"Id")];V&&V[q]||U.axisType==="zAxis"||Wle(!1);var ue=V[q];return J(J({},z),{},(W={},Ie(W,U.axisType,ue),Ie(W,"".concat(U.axisType,"Ticks"),so(ue)),W))},Me),Y=we[M],ve=we["".concat(M,"Ticks")],ce=$&&$[ae]&&$[ae].hasStack&&Tre(F,$[ae].stackGroups),G=mo(F.type).indexOf("Bar")>=0,fe=Ou(Y,ve),de=[];if(G){var pe,se,Le=Je(re)?A:re,Ce=(pe=(se=Ou(Y,ve,!0))!==null&&se!==void 0?se:Le)!==null&&pe!==void 0?pe:0;de=hre({barGap:k,barCategoryGap:_,bandSize:Ce!==fe?Ce:fe,sizeList:L[xe],maxBarSize:Le}),Ce!==fe&&(de=de.map(function(z){return J(J({},z),{},{position:J(J({},z.position),{},{offset:z.position.offset-Ce/2})})}))}var Ge=F&&F.type&&F.type.getComposedData;if(Ge){var N;B.push({props:J(J({},Ge(J(J({},we),{},{displayedData:ie,props:v,dataKey:le,item:F,bandSize:fe,barPosition:de,offset:C,stackedData:ce,layout:T,dataStartIndex:b,dataEndIndex:O}))),{},(N={key:F.key||"item-".concat(Z)},Ie(N,j,we[j]),Ie(N,M,we[M]),Ie(N,"animationId",S),N)),childIndex:qV(F,v.children),item:F})}}),B},h=function(v,x){var w=v.props,$=v.dataStartIndex,C=v.dataEndIndex,S=v.updateId;if(!xy({props:w}))return null;var b=w.children,O=w.layout,P=w.stackOffset,T=w.data,k=w.reverseStackOrder,_=W2(O),A=_.numericAxisName,I=_.cateAxisName,j=Wn(b,o),M=Ere(T,j,"".concat(A,"Id"),"".concat(I,"Id"),P,k),D=c.reduce(function(ie,te){var le="".concat(te.axisType,"Map");return J(J({},ie),{},Ie({},le,Cce(w,J(J({},te),{},{graphicalItems:j,stackGroups:te.axisType===A&&M,dataStartIndex:$,dataEndIndex:C}))))},{}),L=Pce(J(J({},D),{},{props:w,graphicalItems:j}),x==null?void 0:x.legendBBox);Object.keys(D).forEach(function(ie){D[ie]=f(w,D[ie],L,ie.replace("Map",""),r)});var B=D["".concat(I,"Map")],F=Oce(B),Z=p(w,J(J({},D),{},{dataStartIndex:$,dataEndIndex:C,updateId:S,graphicalItems:j,stackGroups:M,offset:L}));return J(J({formattedGraphicalItems:Z,graphicalItems:j,offset:L,stackGroups:M},F),D)};return n=function(g){uce(x,g);var v=fce(x);function x(w){var $,C,S;return lce(this,x),S=v.call(this,w),Ie(We(S),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ie(We(S),"accessibilityManager",new Qle),Ie(We(S),"handleLegendBBoxUpdate",function(b){if(b){var O=S.state,P=O.dataStartIndex,T=O.dataEndIndex,k=O.updateId;S.setState(J({legendBBox:b},h({props:S.props,dataStartIndex:P,dataEndIndex:T,updateId:k},J(J({},S.state),{},{legendBBox:b}))))}}),Ie(We(S),"handleReceiveSyncEvent",function(b,O,P){if(S.props.syncId===b){if(P===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(O)}}),Ie(We(S),"handleBrushChange",function(b){var O=b.startIndex,P=b.endIndex;if(O!==S.state.dataStartIndex||P!==S.state.dataEndIndex){var T=S.state.updateId;S.setState(function(){return J({dataStartIndex:O,dataEndIndex:P},h({props:S.props,dataStartIndex:O,dataEndIndex:P,updateId:T},S.state))}),S.triggerSyncEvent({dataStartIndex:O,dataEndIndex:P})}}),Ie(We(S),"handleMouseEnter",function(b){var O=S.getMouseInfo(b);if(O){var P=J(J({},O),{},{isTooltipActive:!0});S.setState(P),S.triggerSyncEvent(P);var T=S.props.onMouseEnter;Ue(T)&&T(P,b)}}),Ie(We(S),"triggeredAfterMouseMove",function(b){var O=S.getMouseInfo(b),P=O?J(J({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(P),S.triggerSyncEvent(P);var T=S.props.onMouseMove;Ue(T)&&T(P,b)}),Ie(We(S),"handleItemMouseEnter",function(b){S.setState(function(){return{isTooltipActive:!0,activeItem:b,activePayload:b.tooltipPayload,activeCoordinate:b.tooltipPosition||{x:b.cx,y:b.cy}}})}),Ie(We(S),"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Ie(We(S),"handleMouseMove",function(b){b.persist(),S.throttleTriggeredAfterMouseMove(b)}),Ie(We(S),"handleMouseLeave",function(b){var O={isTooltipActive:!1};S.setState(O),S.triggerSyncEvent(O);var P=S.props.onMouseLeave;Ue(P)&&P(O,b)}),Ie(We(S),"handleOuterEvent",function(b){var O=KV(b),P=zn(S.props,"".concat(O));if(O&&Ue(P)){var T,k;/.*touch.*/i.test(O)?k=S.getMouseInfo(b.changedTouches[0]):k=S.getMouseInfo(b),P((T=k)!==null&&T!==void 0?T:{},b)}}),Ie(We(S),"handleClick",function(b){var O=S.getMouseInfo(b);if(O){var P=J(J({},O),{},{isTooltipActive:!0});S.setState(P),S.triggerSyncEvent(P);var T=S.props.onClick;Ue(T)&&T(P,b)}}),Ie(We(S),"handleMouseDown",function(b){var O=S.props.onMouseDown;if(Ue(O)){var P=S.getMouseInfo(b);O(P,b)}}),Ie(We(S),"handleMouseUp",function(b){var O=S.props.onMouseUp;if(Ue(O)){var P=S.getMouseInfo(b);O(P,b)}}),Ie(We(S),"handleTouchMove",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(b.changedTouches[0])}),Ie(We(S),"handleTouchStart",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&S.handleMouseDown(b.changedTouches[0])}),Ie(We(S),"handleTouchEnd",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&S.handleMouseUp(b.changedTouches[0])}),Ie(We(S),"triggerSyncEvent",function(b){S.props.syncId!==void 0&&mp.emit(vp,S.props.syncId,b,S.eventEmitterSymbol)}),Ie(We(S),"applySyncEvent",function(b){var O=S.props,P=O.layout,T=O.syncMethod,k=S.state.updateId,_=b.dataStartIndex,A=b.dataEndIndex;if(b.dataStartIndex!==void 0||b.dataEndIndex!==void 0)S.setState(J({dataStartIndex:_,dataEndIndex:A},h({props:S.props,dataStartIndex:_,dataEndIndex:A,updateId:k},S.state)));else if(b.activeTooltipIndex!==void 0){var I=b.chartX,j=b.chartY,M=b.activeTooltipIndex,D=S.state,L=D.offset,B=D.tooltipTicks;if(!L)return;if(typeof T=="function")M=T(B,b);else if(T==="value"){M=-1;for(var F=0;F=0){var ce,G;if(I.dataKey&&!I.allowDuplicatedCategory){var fe=typeof I.dataKey=="function"?ve:"payload.".concat(I.dataKey.toString());ce=qc(F,fe,M),G=Z&&ie&&qc(ie,fe,M)}else ce=F==null?void 0:F[j],G=Z&&ie&&ie[j];if(xe||ae){var de=b.props.activeIndex!==void 0?b.props.activeIndex:j;return[y.cloneElement(b,J(J(J({},T.props),we),{},{activeIndex:de})),null,null]}if(!Je(ce))return[Y].concat(oa(S.renderActivePoints({item:T,activePoint:ce,basePoint:G,childIndex:j,isRange:Z})))}else{var pe,se=(pe=S.getItemByXY(S.state.activeCoordinate))!==null&&pe!==void 0?pe:{graphicalItem:Y},Le=se.graphicalItem,Ce=Le.item,Ge=Ce===void 0?b:Ce,N=Le.childIndex,z=J(J(J({},T.props),we),{},{activeIndex:N});return[y.cloneElement(Ge,z),null,null]}return Z?[Y,null,null]:[Y,null]}),Ie(We(S),"renderCustomized",function(b,O,P){return y.cloneElement(b,J(J({key:"recharts-customized-".concat(P)},S.props),S.state))}),Ie(We(S),"renderMap",{CartesianGrid:{handler:S.renderGrid,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:S.renderReferenceElement},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:S.renderXAxis},YAxis:{handler:S.renderYAxis},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat(($=w.id)!==null&&$!==void 0?$:Pl("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=BQ(S.triggeredAfterMouseMove,(C=w.throttleDelay)!==null&&C!==void 0?C:1e3/60),S.state={},S}return cce(x,[{key:"componentDidMount",value:function(){var $,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:($=this.props.margin.left)!==null&&$!==void 0?$:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout})}},{key:"getSnapshotBeforeUpdate",value:function($,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==$.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==$.margin){var S,b;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0}})}return null}},{key:"componentDidUpdate",value:function(){}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var $=Mr(this.props.children,Bo);if($&&typeof $.props.shared=="boolean"){var C=$.props.shared?"axis":"item";return l.indexOf(C)>=0?C:a}return a}},{key:"getMouseInfo",value:function($){if(!this.container)return null;var C=this.container,S=C.getBoundingClientRect(),b=GQ(S),O={chartX:Math.round($.pageX-b.left),chartY:Math.round($.pageY-b.top)},P=S.width/C.offsetWidth||1,T=this.inRange(O.chartX,O.chartY,P);if(!T)return null;var k=this.state,_=k.xAxisMap,A=k.yAxisMap,I=this.getTooltipEventType();if(I!=="axis"&&_&&A){var j=ao(_).scale,M=ao(A).scale,D=j&&j.invert?j.invert(O.chartX):null,L=M&&M.invert?M.invert(O.chartY):null;return J(J({},O),{},{xValue:D,yValue:L})}var B=F2(this.state,this.props.data,this.props.layout,T);return B?J(J({},O),B):null}},{key:"inRange",value:function($,C){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,b=this.props.layout,O=$/S,P=C/S;if(b==="horizontal"||b==="vertical"){var T=this.state.offset,k=O>=T.left&&O<=T.left+T.width&&P>=T.top&&P<=T.top+T.height;return k?{x:O,y:P}:null}var _=this.state,A=_.angleAxisMap,I=_.radiusAxisMap;if(A&&I){var j=ao(A);return Fx({x:O,y:P},j)}return null}},{key:"parseEventsOfWrapper",value:function(){var $=this.props.children,C=this.getTooltipEventType(),S=Mr($,Bo),b={};S&&C==="axis"&&(S.props.trigger==="click"?b={onClick:this.handleClick}:b={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var O=Xc(this.props,this.handleOuterEvent);return J(J({},O),b)}},{key:"addListener",value:function(){mp.on(vp,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){mp.removeListener(vp,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function($,C,S){for(var b=this.state.formattedGraphicalItems,O=0,P=b.length;Om.jsx(Gf,{cx:e,cy:t,fill:K.blueTextAccent,r:2}),kce=({data:e,width:t=500,height:n=300})=>m.jsx(m.Fragment,{children:(e==null?void 0:e.length)&&m.jsxs(Tce,{data:e,height:n,id:"cy-sentiment-chart",margin:{bottom:5,left:-20,right:30,top:5},width:t,children:[m.jsx(mv,{stroke:K.lightBlue300,strokeDasharray:"5 5"}),m.jsx(Zf,{dataKey:"date",interval:Math.floor(e.length/3),stroke:K.blueTextAccent}),m.jsx(Qf,{domain:[0,10],stroke:K.blueTextAccent}),m.jsx(Bo,{}),m.jsx(Rl,{dataKey:"score",dot:m.jsx(Ace,{}),stroke:"#8884d8",type:"monotone"})]})}),jce=()=>{const[e,t]=y.useState(void 0),[n]=sa(a=>[a.setBudget]),[r,o]=y.useState(!1),i=async()=>{o(!0),b$(n).then(async a=>{t(a==null?void 0:a.data.filter(s=>s.date).map(s=>({date:eE.unix(Number(String(s.date).split(".")[0])).format("MM/DD/YY"),score:s.sentiment_score}))),await iw(n)}).catch().finally(()=>{o(!1)})};return m.jsxs(Ice,{align:"flex-start",direction:"column",id:"cy-sentiment-chart-wrapper",justify:"flex-end",children:[m.jsx(ze,{className:"title",children:"Sentiment chart"}),r&&m.jsx(Lw,{alignItems:"center",component:"div",flexGrow:1,p:4,spacing:2,width:"100%",children:m.jsx(sB,{color:K.white})}),!(e!=null&&e.length)&&m.jsx(Mce,{className:"button",id:"cy-get-sentiments-btn",onClick:i,children:"Get top 100 sentiments"}),m.jsx(kce,{data:e})]})},Ice=X(ee)` + A `).concat(h,",").concat(h,",0,0,").concat(c,",").concat(t,",").concat(n+o-s*h," Z")}else u="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(o," h ").concat(-r," Z");return u},Woe=function(t,n){if(!t||!n)return!1;var r=t.x,o=t.y,i=n.x,a=n.y,s=n.width,l=n.height;if(Math.abs(s)>0&&Math.abs(l)>0){var c=Math.min(i,i+s),u=Math.max(i,i+s),f=Math.min(a,a+l),d=Math.max(a,a+l);return r>=c&&r<=u&&o>=f&&o<=d}return!1},Voe={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},fv=function(t){var n=Qx(Qx({},Voe),t),r=y.useRef(),o=y.useState(-1),i=Moe(o,2),a=i[0],s=i[1];y.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var C=r.current.getTotalLength();C&&s(C)}catch{}},[]);var l=n.x,c=n.y,u=n.width,f=n.height,d=n.radius,p=n.className,h=n.animationEasing,g=n.animationDuration,v=n.animationBegin,x=n.isAnimationActive,w=n.isUpdateAnimationActive;if(l!==+l||c!==+c||u!==+u||f!==+f||u===0||f===0)return null;var $=lt("recharts-rectangle",p);return w?E.createElement(Gr,{canBegin:a>0,from:{width:u,height:f,x:l,y:c},to:{width:u,height:f,x:l,y:c},duration:g,animationEasing:h,isActive:w},function(C){var S=C.width,b=C.height,O=C.x,P=C.y;return E.createElement(Gr,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:g,isActive:x,easing:h},E.createElement("path",_u({},Qe(n,!0),{className:$,d:Jx(O,P,S,b,d),ref:r})))}):E.createElement("path",_u({},Qe(n,!0),{className:$,d:Jx(l,c,u,f,d)}))};function tg(){return tg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Yoe(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var Zoe=function(t,n,r,o,i,a){return"M".concat(t,",").concat(i,"v").concat(o,"M").concat(a,",").concat(n,"h").concat(r)},Qoe=function(t){var n=t.x,r=n===void 0?0:n,o=t.y,i=o===void 0?0:o,a=t.top,s=a===void 0?0:a,l=t.left,c=l===void 0?0:l,u=t.width,f=u===void 0?0:u,d=t.height,p=d===void 0?0:d,h=t.className,g=Xoe(t,Hoe),v=Uoe({x:r,y:i,top:s,left:c,width:f,height:p},g);return!me(r)||!me(i)||!me(f)||!me(p)||!me(s)||!me(c)?null:E.createElement("path",ng({},Qe(v,!0),{className:lt("recharts-cross",h),d:Zoe(r,i,f,p,s,c)}))},Joe=sl,eie=QO,tie=la,nie="[object Object]",rie=Function.prototype,oie=Object.prototype,j5=rie.toString,iie=oie.hasOwnProperty,aie=j5.call(Object);function sie(e){if(!tie(e)||Joe(e)!=nie)return!1;var t=eie(e);if(t===null)return!0;var n=iie.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&j5.call(n)==aie}var lie=sie;const cie=yt(lie);var uie=sl,fie=la,die="[object Boolean]";function pie(e){return e===!0||e===!1||fie(e)&&uie(e)==die}var hie=pie;const gie=yt(hie);function Gs(e){"@babel/helpers - typeof";return Gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gs(e)}function Tu(){return Tu=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:d,x:l,y:c},to:{upperWidth:u,lowerWidth:f,height:d,x:l,y:c},duration:g,animationEasing:h,isActive:x},function($){var C=$.upperWidth,S=$.lowerWidth,b=$.height,O=$.x,P=$.y;return E.createElement(Gr,{canBegin:a>0,from:"0px ".concat(a===-1?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:v,duration:g,easing:h},E.createElement("path",Tu({},Qe(n,!0),{className:w,d:o2(O,P,C,S,b),ref:r})))}):E.createElement("g",null,E.createElement("path",Tu({},Qe(n,!0),{className:w,d:o2(l,c,u,f,d)})))},Eie=["option","shapeType","propTransformer","activeClassName","isActive"];function Ks(e){"@babel/helpers - typeof";return Ks=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ks(e)}function Pie(e,t){if(e==null)return{};var n=_ie(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function _ie(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function i2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Au(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Iu(e){return Iu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Iu(e)}function mn(e,t,n){return t=R5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function R5(e){var t=pae(e,"string");return Qi(t)==="symbol"?t:String(t)}function pae(e,t){if(Qi(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Qi(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hae=function(t){var n=t.data,r=t.startIndex,o=t.endIndex,i=t.x,a=t.width,s=t.travellerWidth;if(!n||!n.length)return{};var l=n.length,c=ls().domain(ku(0,l)).range([i,i+a-s]),u=c.domain().map(function(f){return c(f)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:c(r),endX:c(o),scale:c,scaleValues:u}},d2=function(t){return t.changedTouches&&!!t.changedTouches.length},Ys=function(e){cae(n,e);var t=uae(n);function n(r){var o;return sae(this,n),o=t.call(this,r),mn(pr(o),"handleDrag",function(i){o.leaveTimer&&(clearTimeout(o.leaveTimer),o.leaveTimer=null),o.state.isTravellerMoving?o.handleTravellerMove(i):o.state.isSlideMoving&&o.handleSlideDrag(i)}),mn(pr(o),"handleTouchMove",function(i){i.changedTouches!=null&&i.changedTouches.length>0&&o.handleDrag(i.changedTouches[0])}),mn(pr(o),"handleDragEnd",function(){o.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var i=o.props,a=i.endIndex,s=i.onDragEnd,l=i.startIndex;s==null||s({endIndex:a,startIndex:l})}),o.detachDragEndListener()}),mn(pr(o),"handleLeaveWrapper",function(){(o.state.isTravellerMoving||o.state.isSlideMoving)&&(o.leaveTimer=window.setTimeout(o.handleDragEnd,o.props.leaveTimeOut))}),mn(pr(o),"handleEnterSlideOrTraveller",function(){o.setState({isTextActive:!0})}),mn(pr(o),"handleLeaveSlideOrTraveller",function(){o.setState({isTextActive:!1})}),mn(pr(o),"handleSlideDragStart",function(i){var a=d2(i)?i.changedTouches[0]:i;o.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:a.pageX}),o.attachDragEndListener()}),o.travellerDragStartHandlers={startX:o.handleTravellerDragStart.bind(pr(o),"startX"),endX:o.handleTravellerDragStart.bind(pr(o),"endX")},o.state={},o}return lae(n,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(o){var i=o.startX,a=o.endX,s=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,f=u.length-1,d=Math.min(i,a),p=Math.max(i,a),h=n.getIndexInRange(s,d),g=n.getIndexInRange(s,p);return{startIndex:h-h%c,endIndex:g===f?f:g-g%c}}},{key:"getTextOfTick",value:function(o){var i=this.props,a=i.data,s=i.tickFormatter,l=i.dataKey,c=Pn(a[o],l,o);return Ue(s)?s(c,o):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(o){var i=this.state,a=i.slideMoveStartX,s=i.startX,l=i.endX,c=this.props,u=c.x,f=c.width,d=c.travellerWidth,p=c.startIndex,h=c.endIndex,g=c.onChange,v=o.pageX-a;v>0?v=Math.min(v,u+f-d-l,u+f-d-s):v<0&&(v=Math.max(v,u-s,u-l));var x=this.getIndex({startX:s+v,endX:l+v});(x.startIndex!==p||x.endIndex!==h)&&g&&g(x),this.setState({startX:s+v,endX:l+v,slideMoveStartX:o.pageX})}},{key:"handleTravellerDragStart",value:function(o,i){var a=d2(i)?i.changedTouches[0]:i;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:o,brushMoveStartX:a.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(o){var i,a=this.state,s=a.brushMoveStartX,l=a.movingTravellerId,c=a.endX,u=a.startX,f=this.state[l],d=this.props,p=d.x,h=d.width,g=d.travellerWidth,v=d.onChange,x=d.gap,w=d.data,$={startX:this.state.startX,endX:this.state.endX},C=o.pageX-s;C>0?C=Math.min(C,p+h-g-f):C<0&&(C=Math.max(C,p-f)),$[l]=f+C;var S=this.getIndex($),b=S.startIndex,O=S.endIndex,P=function(){var k=w.length-1;return l==="startX"&&(c>u?b%x===0:O%x===0)||cu?O%x===0:b%x===0)||c>u&&O===k};this.setState((i={},mn(i,l,f+C),mn(i,"brushMoveStartX",o.pageX),i),function(){v&&P()&&v(S)})}},{key:"handleTravellerMoveKeyboard",value:function(o,i){var a=this,s=this.state,l=s.scaleValues,c=s.startX,u=s.endX,f=this.state[i],d=l.indexOf(f);if(d!==-1){var p=d+o;if(!(p===-1||p>=l.length)){var h=l[p];i==="startX"&&h>=u||i==="endX"&&h<=c||this.setState(mn({},i,h),function(){a.props.onChange(a.getIndex({startX:a.state.startX,endX:a.state.endX}))})}}}},{key:"renderBackground",value:function(){var o=this.props,i=o.x,a=o.y,s=o.width,l=o.height,c=o.fill,u=o.stroke;return E.createElement("rect",{stroke:u,fill:c,x:i,y:a,width:s,height:l})}},{key:"renderPanorama",value:function(){var o=this.props,i=o.x,a=o.y,s=o.width,l=o.height,c=o.data,u=o.children,f=o.padding,d=y.Children.only(u);return d?E.cloneElement(d,{x:i,y:a,width:s,height:l,margin:f,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(o,i){var a=this,s=this.props,l=s.y,c=s.travellerWidth,u=s.height,f=s.traveller,d=s.ariaLabel,p=s.data,h=s.startIndex,g=s.endIndex,v=Math.max(o,this.props.x),x=gp(gp({},Qe(this.props)),{},{x:v,y:l,width:c,height:u}),w=d||"Min value: ".concat(p[h].name,", Max value: ").concat(p[g].name);return E.createElement(Pt,{tabIndex:0,role:"slider","aria-label":w,"aria-valuenow":o,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[i],onTouchStart:this.travellerDragStartHandlers[i],onKeyDown:function(C){["ArrowLeft","ArrowRight"].includes(C.key)&&(C.preventDefault(),C.stopPropagation(),a.handleTravellerMoveKeyboard(C.key==="ArrowRight"?1:-1,i))},onFocus:function(){a.setState({isTravellerFocused:!0})},onBlur:function(){a.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},n.renderTraveller(f,x))}},{key:"renderSlide",value:function(o,i){var a=this.props,s=a.y,l=a.height,c=a.stroke,u=a.travellerWidth,f=Math.min(o,i)+u,d=Math.max(Math.abs(i-o)-u,0);return E.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:f,y:s,width:d,height:l})}},{key:"renderText",value:function(){var o=this.props,i=o.startIndex,a=o.endIndex,s=o.y,l=o.height,c=o.travellerWidth,u=o.stroke,f=this.state,d=f.startX,p=f.endX,h=5,g={pointerEvents:"none",fill:u};return E.createElement(Pt,{className:"recharts-brush-texts"},E.createElement(du,ju({textAnchor:"end",verticalAnchor:"middle",x:Math.min(d,p)-h,y:s+l/2},g),this.getTextOfTick(i)),E.createElement(du,ju({textAnchor:"start",verticalAnchor:"middle",x:Math.max(d,p)+c+h,y:s+l/2},g),this.getTextOfTick(a)))}},{key:"render",value:function(){var o=this.props,i=o.data,a=o.className,s=o.children,l=o.x,c=o.y,u=o.width,f=o.height,d=o.alwaysShowText,p=this.state,h=p.startX,g=p.endX,v=p.isTextActive,x=p.isSlideMoving,w=p.isTravellerMoving,$=p.isTravellerFocused;if(!i||!i.length||!me(l)||!me(c)||!me(u)||!me(f)||u<=0||f<=0)return null;var C=lt("recharts-brush",a),S=E.Children.count(s)===1,b=aae("userSelect","none");return E.createElement(Pt,{className:C,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),S&&this.renderPanorama(),this.renderSlide(h,g),this.renderTravellerLayer(h,"startX"),this.renderTravellerLayer(g,"endX"),(v||x||w||$||d)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(o){var i=o.x,a=o.y,s=o.width,l=o.height,c=o.stroke,u=Math.floor(a+l/2)-1;return E.createElement(E.Fragment,null,E.createElement("rect",{x:i,y:a,width:s,height:l,fill:c,stroke:"none"}),E.createElement("line",{x1:i+1,y1:u,x2:i+s-1,y2:u,fill:"none",stroke:"#fff"}),E.createElement("line",{x1:i+1,y1:u+2,x2:i+s-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(o,i){var a;return E.isValidElement(o)?a=E.cloneElement(o,i):Ue(o)?a=o(i):a=n.renderDefaultTraveller(i),a}},{key:"getDerivedStateFromProps",value:function(o,i){var a=o.data,s=o.width,l=o.x,c=o.travellerWidth,u=o.updateId,f=o.startIndex,d=o.endIndex;if(a!==i.prevData||u!==i.prevUpdateId)return gp({prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s},a&&a.length?hae({data:a,width:s,x:l,travellerWidth:c,startIndex:f,endIndex:d}):{scale:null,scaleValues:null});if(i.scale&&(s!==i.prevWidth||l!==i.prevX||c!==i.prevTravellerWidth)){i.scale.range([l,l+s-c]);var p=i.scale.domain().map(function(h){return i.scale(h)});return{prevData:a,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:s,startX:i.scale(o.startIndex),endX:i.scale(o.endIndex),scaleValues:p}}return null}},{key:"getIndexInRange",value:function(o,i){for(var a=o.length,s=0,l=a-1;l-s>1;){var c=Math.floor((s+l)/2);o[c]>i?l=c:s=c}return i>=o[l]?l:s}}]),n}(y.PureComponent);mn(Ys,"displayName","Brush");mn(Ys,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var gae=Dm;function mae(e,t){var n;return gae(e,function(r,o,i){return n=t(r,o,i),!n}),!!n}var vae=mae,yae=nC,bae=Co,xae=vae,wae=Kn,Sae=Rf;function $ae(e,t,n){var r=wae(e)?yae:xae;return n&&Sae(e,t,n)&&(t=void 0),r(e,bae(t))}var Cae=$ae;const Oae=yt(Cae);var wr=function(t,n){var r=t.alwaysShow,o=t.ifOverflow;return r&&(o="extendDomain"),o===n},Eae=JO,Pae=hC,_ae=Co;function Tae(e,t){var n={};return t=_ae(t),Pae(e,function(r,o,i){Eae(n,o,t(r,o,i))}),n}var Aae=Tae;const kae=yt(Aae);function jae(e,t){for(var n=-1,r=e==null?0:e.length;++n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Xae(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Yae(e,t){var n=e.x,r=e.y,o=qae(e,Hae),i="".concat(n),a=parseInt(i,10),s="".concat(r),l=parseInt(s,10),c="".concat(t.height||o.height),u=parseInt(c,10),f="".concat(t.width||o.width),d=parseInt(f,10);return Ua(Ua(Ua(Ua(Ua({},t),o),a?{x:a}:{}),l?{y:l}:{}),{},{height:u,width:d,name:t.name,radius:t.radius})}function h2(e){return E.createElement(Rie,og({shapeType:"rectangle",propTransformer:Yae,activeClassName:"recharts-active-bar"},e))}var Zae=["value","background"];function Ji(e){"@babel/helpers - typeof";return Ji=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ji(e)}function Qae(e,t){if(e==null)return{};var n=Jae(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Jae(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Mu(){return Mu=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Ru(e){return Ru=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Ru(e)}function po(e,t,n){return t=N5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N5(e){var t=ase(e,"string");return Ji(t)==="symbol"?t:String(t)}function ase(e,t){if(Ji(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Ji(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Yf=function(e){nse(n,e);var t=rse(n);function n(){var r;ese(this,n);for(var o=arguments.length,i=new Array(o),a=0;a0&&Math.abs(j)0&&Math.abs(I)0&&(I=Math.min((re||0)-(j[ae-1]||0),I))});var M=I/A,D=g.layout==="vertical"?r.height:r.width;if(g.padding==="gap"&&(O=M*D/2),g.padding==="no-gap"){var L=zi(t.barCategoryGap,M*D),B=M*D/2;O=B-L-(B-L)/D*L}}o==="xAxis"?P=[r.left+($.left||0)+(O||0),r.left+r.width-($.right||0)-(O||0)]:o==="yAxis"?P=l==="horizontal"?[r.top+r.height-($.bottom||0),r.top+($.top||0)]:[r.top+($.top||0)+(O||0),r.top+r.height-($.bottom||0)-(O||0)]:P=g.range,S&&(P=[P[1],P[0]]);var F=xre(g,i,d),Z=F.scale,ie=F.realScaleType;Z.domain(x).range(P),wre(Z);var te=Tre(Z,Qn(Qn({},g),{},{realScaleType:ie}));o==="xAxis"?(_=v==="top"&&!C||v==="bottom"&&C,T=r.left,k=f[b]-_*g.height):o==="yAxis"&&(_=v==="left"&&!C||v==="right"&&C,T=f[b]-_*g.width,k=r.top);var le=Qn(Qn(Qn({},g),te),{},{realScaleType:ie,x:T,y:k,scale:Z,width:o==="xAxis"?r.width:g.width,height:o==="yAxis"?r.height:g.height});return le.bandSize=Ou(le,te),!g.hide&&o==="xAxis"?f[b]+=(_?-1:1)*le.height:g.hide||(f[b]+=(_?-1:1)*le.width),Qn(Qn({},p),{},Zf({},h,le))},{})},B5=function(t,n){var r=t.x,o=t.y,i=n.x,a=n.y;return{x:Math.min(r,i),y:Math.min(o,a),width:Math.abs(i-r),height:Math.abs(a-o)}},fse=function(t){var n=t.x1,r=t.y1,o=t.x2,i=t.y2;return B5({x:n,y:r},{x:o,y:i})},F5=function(){function e(t){sse(this,e),this.scale=t}return lse(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=r.bandAware,i=r.position;if(n!==void 0){if(i)switch(i){case"start":return this.scale(n);case"middle":{var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+a}case"end":{var s=this.bandwidth?this.bandwidth():0;return this.scale(n)+s}default:return this.scale(n)}if(o){var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),o=r[0],i=r[r.length-1];return o<=i?n>=o&&n<=i:n>=i&&n<=o}}],[{key:"create",value:function(n){return new e(n)}}]),e}();Zf(F5,"EPS",1e-4);var dv=function(t){var n=Object.keys(t).reduce(function(r,o){return Qn(Qn({},r),{},Zf({},o,F5.create(t[o])))},{});return Qn(Qn({},n),{},{apply:function(o){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=i.bandAware,s=i.position;return kae(o,function(l,c){return n[c].apply(l,{bandAware:a,position:s})})},isInRange:function(o){return D5(o,function(i,a){return n[a].isInRange(i)})}})};function dse(e){return(e%180+180)%180}var pse=function(t){var n=t.width,r=t.height,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=dse(o),a=i*Math.PI/180,s=Math.atan(r/n),l=a>s&&ae.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*o)return!1;var i=n();return e*(t-e*i/2-r)>=0&&e*(t+e*i/2-o)<=0}function Mse(e,t){return z5(e,t+1)}function Rse(e,t,n,r,o){for(var i=(r||[]).slice(),a=t.start,s=t.end,l=0,c=1,u=a,f=function(){var h=r==null?void 0:r[l];if(h===void 0)return{v:z5(r,c)};var g=l,v,x=function(){return v===void 0&&(v=n(h,g)),v},w=h.coordinate,$=l===0||Du(e,w,x,u,s);$||(l=0,u=a,c+=1),$&&(u=w+e*(x()/2+o),l+=c)},d;c<=i.length;)if(d=f(),d)return d.v;return[]}function nl(e){"@babel/helpers - typeof";return nl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nl(e)}function E2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Xt(e){for(var t=1;t0?p.coordinate-v*e:p.coordinate})}else i[d]=p=Xt(Xt({},p),{},{tickCoord:p.coordinate});var x=Du(e,p.tickCoord,g,s,l);x&&(l=p.tickCoord-e*(g()/2+o),i[d]=Xt(Xt({},p),{},{isShow:!0}))},u=a-1;u>=0;u--)c(u);return i}function Fse(e,t,n,r,o,i){var a=(r||[]).slice(),s=a.length,l=t.start,c=t.end;if(i){var u=r[s-1],f=n(u,s-1),d=e*(u.coordinate+e*f/2-c);a[s-1]=u=Xt(Xt({},u),{},{tickCoord:d>0?u.coordinate-d*e:u.coordinate});var p=Du(e,u.tickCoord,function(){return f},l,c);p&&(c=u.tickCoord-e*(f/2+o),a[s-1]=Xt(Xt({},u),{},{isShow:!0}))}for(var h=i?s-1:s,g=function(w){var $=a[w],C,S=function(){return C===void 0&&(C=n($,w)),C};if(w===0){var b=e*($.coordinate-e*S()/2-l);a[w]=$=Xt(Xt({},$),{},{tickCoord:b<0?$.coordinate-b*e:$.coordinate})}else a[w]=$=Xt(Xt({},$),{},{tickCoord:$.coordinate});var O=Du(e,$.tickCoord,S,l,c);O&&(l=$.tickCoord+e*(S()/2+o),a[w]=Xt(Xt({},$),{},{isShow:!0}))},v=0;v=2?nr(o[1].coordinate-o[0].coordinate):1,x=Ise(i,v,p);return l==="equidistantPreserveStart"?Rse(v,x,g,o,a):(l==="preserveStart"||l==="preserveStartEnd"?d=Fse(v,x,g,o,a,l==="preserveStartEnd"):d=Bse(v,x,g,o,a),d.filter(function(w){return w.isShow}))}var zse=["viewBox"],Wse=["viewBox"],Vse=["ticks"];function ea(e){"@babel/helpers - typeof";return ea=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ea(e)}function xi(){return xi=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Hse(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function Use(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _2(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Nu(e){return Nu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Nu(e)}function hv(e,t,n){return t=W5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function W5(e){var t=Qse(e,"string");return ea(t)==="symbol"?t:String(t)}function Qse(e,t){if(ea(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ea(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var us=function(e){Kse(n,e);var t=qse(n);function n(r){var o;return Use(this,n),o=t.call(this,r),o.state={fontSize:"",letterSpacing:""},o}return Gse(n,[{key:"shouldComponentUpdate",value:function(o,i){var a=o.viewBox,s=mp(o,zse),l=this.props,c=l.viewBox,u=mp(l,Wse);return!Ei(a,c)||!Ei(s,u)||!Ei(i,this.state)}},{key:"componentDidMount",value:function(){var o=this.layerReference;if(o){var i=o.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];i&&this.setState({fontSize:window.getComputedStyle(i).fontSize,letterSpacing:window.getComputedStyle(i).letterSpacing})}}},{key:"getTickLineCoord",value:function(o){var i=this.props,a=i.x,s=i.y,l=i.width,c=i.height,u=i.orientation,f=i.tickSize,d=i.mirror,p=i.tickMargin,h,g,v,x,w,$,C=d?-1:1,S=o.tickSize||f,b=me(o.tickCoord)?o.tickCoord:o.coordinate;switch(u){case"top":h=g=o.coordinate,x=s+ +!d*c,v=x-C*S,$=v-C*p,w=b;break;case"left":v=x=o.coordinate,g=a+ +!d*l,h=g-C*S,w=h-C*p,$=b;break;case"right":v=x=o.coordinate,g=a+ +d*l,h=g+C*S,w=h+C*p,$=b;break;default:h=g=o.coordinate,x=s+ +d*c,v=x+C*S,$=v+C*p,w=b;break}return{line:{x1:h,y1:v,x2:g,y2:x},tick:{x:w,y:$}}}},{key:"getTickTextAnchor",value:function(){var o=this.props,i=o.orientation,a=o.mirror,s;switch(i){case"left":s=a?"start":"end";break;case"right":s=a?"end":"start";break;default:s="middle";break}return s}},{key:"getTickVerticalAnchor",value:function(){var o=this.props,i=o.orientation,a=o.mirror,s="end";switch(i){case"left":case"right":s="middle";break;case"top":s=a?"start":"end";break;default:s=a?"end":"start";break}return s}},{key:"renderAxisLine",value:function(){var o=this.props,i=o.x,a=o.y,s=o.width,l=o.height,c=o.orientation,u=o.mirror,f=o.axisLine,d=nn(nn(nn({},Qe(this.props)),Qe(f)),{},{fill:"none"});if(c==="top"||c==="bottom"){var p=+(c==="top"&&!u||c==="bottom"&&u);d=nn(nn({},d),{},{x1:i,y1:a+p*l,x2:i+s,y2:a+p*l})}else{var h=+(c==="left"&&!u||c==="right"&&u);d=nn(nn({},d),{},{x1:i+h*s,y1:a,x2:i+h*s,y2:a+l})}return E.createElement("line",xi({},d,{className:lt("recharts-cartesian-axis-line",zn(f,"className"))}))}},{key:"renderTicks",value:function(o,i,a){var s=this,l=this.props,c=l.tickLine,u=l.stroke,f=l.tick,d=l.tickFormatter,p=l.unit,h=cg(nn(nn({},this.props),{},{ticks:o}),i,a),g=this.getTickTextAnchor(),v=this.getTickVerticalAnchor(),x=Qe(this.props),w=Qe(f),$=nn(nn({},x),{},{fill:"none"},Qe(c)),C=h.map(function(S,b){var O=s.getTickLineCoord(S),P=O.line,T=O.tick,k=nn(nn(nn(nn({textAnchor:g,verticalAnchor:v},x),{},{stroke:"none",fill:u},w),T),{},{index:b,payload:S,visibleTicksCount:h.length,tickFormatter:d});return E.createElement(Pt,xi({className:"recharts-cartesian-axis-tick",key:"tick-".concat(S.value,"-").concat(S.coordinate,"-").concat(S.tickCoord)},Yc(s.props,S,b)),c&&E.createElement("line",xi({},$,P,{className:lt("recharts-cartesian-axis-tick-line",zn(c,"className"))})),f&&n.renderTickItem(f,k,"".concat(Ue(d)?d(S.value,b):S.value).concat(p||"")))});return E.createElement("g",{className:"recharts-cartesian-axis-ticks"},C)}},{key:"render",value:function(){var o=this,i=this.props,a=i.axisLine,s=i.width,l=i.height,c=i.ticksGenerator,u=i.className,f=i.hide;if(f)return null;var d=this.props,p=d.ticks,h=mp(d,Vse),g=p;return Ue(c)&&(g=p&&p.length>0?c(this.props):c(h)),s<=0||l<=0||!g||!g.length?null:E.createElement(Pt,{className:lt("recharts-cartesian-axis",u),ref:function(x){o.layerReference=x}},a&&this.renderAxisLine(),this.renderTicks(g,this.state.fontSize,this.state.letterSpacing),Zt.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(o,i,a){var s;return E.isValidElement(o)?s=E.cloneElement(o,i):Ue(o)?s=o(i):s=E.createElement(du,xi({},i,{className:"recharts-cartesian-axis-tick-value"}),a),s}}]),n}(y.Component);hv(us,"displayName","CartesianAxis");hv(us,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Jse=["x1","y1","x2","y2","key"],ele=["offset"];function ta(e){"@babel/helpers - typeof";return ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ta(e)}function fg(){return fg=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tle(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function A2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function oo(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Lu(e){return Lu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Lu(e)}function gv(e,t,n){return t=V5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V5(e){var t=cle(e,"string");return ta(t)==="symbol"?t:String(t)}function cle(e,t){if(ta(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(ta(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mv=function(e){ole(n,e);var t=ile(n);function n(){return nle(this,n),t.apply(this,arguments)}return rle(n,[{key:"renderHorizontal",value:function(o){var i=this,a=this.props,s=a.x,l=a.width,c=a.horizontal;if(!o||!o.length)return null;var u=o.map(function(f,d){var p=oo(oo({},i.props),{},{x1:s,y1:f,x2:s+l,y2:f,key:"line-".concat(d),index:d});return n.renderLineItem(c,p)});return E.createElement("g",{className:"recharts-cartesian-grid-horizontal"},u)}},{key:"renderVertical",value:function(o){var i=this,a=this.props,s=a.y,l=a.height,c=a.vertical;if(!o||!o.length)return null;var u=o.map(function(f,d){var p=oo(oo({},i.props),{},{x1:f,y1:s,x2:f,y2:s+l,key:"line-".concat(d),index:d});return n.renderLineItem(c,p)});return E.createElement("g",{className:"recharts-cartesian-grid-vertical"},u)}},{key:"renderVerticalStripes",value:function(o){var i=this.props.verticalFill;if(!i||!i.length)return null;var a=this.props,s=a.fillOpacity,l=a.x,c=a.y,u=a.width,f=a.height,d=o.map(function(h){return Math.round(h+l-l)}).sort(function(h,g){return h-g});l!==d[0]&&d.unshift(0);var p=d.map(function(h,g){var v=!d[g+1],x=v?l+u-h:d[g+1]-h;if(x<=0)return null;var w=g%i.length;return E.createElement("rect",{key:"react-".concat(g),x:h,y:c,width:x,height:f,stroke:"none",fill:i[w],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},p)}},{key:"renderHorizontalStripes",value:function(o){var i=this.props.horizontalFill;if(!i||!i.length)return null;var a=this.props,s=a.fillOpacity,l=a.x,c=a.y,u=a.width,f=a.height,d=o.map(function(h){return Math.round(h+c-c)}).sort(function(h,g){return h-g});c!==d[0]&&d.unshift(0);var p=d.map(function(h,g){var v=!d[g+1],x=v?c+f-h:d[g+1]-h;if(x<=0)return null;var w=g%i.length;return E.createElement("rect",{key:"react-".concat(g),y:h,x:l,height:x,width:u,stroke:"none",fill:i[w],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return E.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},p)}},{key:"renderBackground",value:function(){var o=this.props.fill;if(!o||o==="none")return null;var i=this.props,a=i.fillOpacity,s=i.x,l=i.y,c=i.width,u=i.height;return E.createElement("rect",{x:s,y:l,width:c,height:u,stroke:"none",fill:o,fillOpacity:a,className:"recharts-cartesian-grid-bg"})}},{key:"render",value:function(){var o=this.props,i=o.x,a=o.y,s=o.width,l=o.height,c=o.horizontal,u=o.vertical,f=o.horizontalCoordinatesGenerator,d=o.verticalCoordinatesGenerator,p=o.xAxis,h=o.yAxis,g=o.offset,v=o.chartWidth,x=o.chartHeight,w=o.syncWithTicks,$=o.horizontalValues,C=o.verticalValues;if(!me(s)||s<=0||!me(l)||l<=0||!me(i)||i!==+i||!me(a)||a!==+a)return null;var S=this.props,b=S.horizontalPoints,O=S.verticalPoints;if((!b||!b.length)&&Ue(f)){var P=$&&$.length;b=f({yAxis:h?oo(oo({},h),{},{ticks:P?$:h.ticks}):void 0,width:v,height:x,offset:g},P?!0:w)}if((!O||!O.length)&&Ue(d)){var T=C&&C.length;O=d({xAxis:p?oo(oo({},p),{},{ticks:T?C:p.ticks}):void 0,width:v,height:x,offset:g},T?!0:w)}return E.createElement("g",{className:"recharts-cartesian-grid"},this.renderBackground(),c&&this.renderHorizontal(b),u&&this.renderVertical(O),c&&this.renderHorizontalStripes(b),u&&this.renderVerticalStripes(O))}}],[{key:"renderLineItem",value:function(o,i){var a;if(E.isValidElement(o))a=E.cloneElement(o,i);else if(Ue(o))a=o(i);else{var s=i.x1,l=i.y1,c=i.x2,u=i.y2,f=i.key,d=T2(i,Jse),p=Qe(d);p.offset;var h=T2(p,ele);a=E.createElement("line",fg({},h,{x1:s,y1:l,x2:c,y2:u,fill:"none",key:f}))}return a}}]),n}(y.PureComponent);gv(mv,"displayName","CartesianGrid");gv(mv,"defaultProps",{horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]});var ule=["type","layout","connectNulls","ref"];function na(e){"@babel/helpers - typeof";return na=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},na(e)}function fle(e,t){if(e==null)return{};var n=dle(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dle(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function fs(){return fs=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bu(e){return Bu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Bu(e)}function Jn(e,t,n){return t=H5(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function H5(e){var t=$le(e,"string");return na(t)==="symbol"?t:String(t)}function $le(e,t){if(na(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(na(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Rl=function(e){ble(n,e);var t=xle(n);function n(){var r;vle(this,n);for(var o=arguments.length,i=new Array(o),a=0;ad){h=[].concat(pi(c.slice(0,g)),[d-v]);break}var x=h.length%2===0?[0,p]:[p];return[].concat(pi(n.repeat(c,f)),pi(h),x).map(function(w){return"".concat(w,"px")}).join(", ")}),Jn(lo(r),"id",Pl("recharts-line-")),Jn(lo(r),"pathRef",function(s){r.mainCurve=s}),Jn(lo(r),"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),Jn(lo(r),"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return yle(n,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var o=this.getTotalLength();this.setState({totalLength:o})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var o=this.getTotalLength();o!==this.state.totalLength&&this.setState({totalLength:o})}}},{key:"getTotalLength",value:function(){var o=this.mainCurve;try{return o&&o.getTotalLength&&o.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(o,i){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,s=a.points,l=a.xAxis,c=a.yAxis,u=a.layout,f=a.children,d=Wn(f,jl);if(!d)return null;var p=function(v,x){return{x:v.x,y:v.y,value:v.value,errorVal:Pn(v.payload,x)}},h={clipPath:o?"url(#clipPath-".concat(i,")"):null};return E.createElement(Pt,h,d.map(function(g){return E.cloneElement(g,{key:"bar-".concat(g.props.dataKey),data:s,xAxis:l,yAxis:c,layout:u,dataPointFormatter:p})}))}},{key:"renderDots",value:function(o,i,a){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,f=l.dataKey,d=Qe(this.props),p=Qe(c,!0),h=u.map(function(v,x){var w=gn(gn(gn({key:"dot-".concat(x),r:3},d),p),{},{value:v.value,dataKey:f,cx:v.x,cy:v.y,index:x,payload:v.payload});return n.renderDotItem(c,w)}),g={clipPath:o?"url(#clipPath-".concat(i?"":"dots-").concat(a,")"):null};return E.createElement(Pt,fs({className:"recharts-line-dots",key:"dots"},g),h)}},{key:"renderCurveStatically",value:function(o,i,a,s){var l=this.props,c=l.type,u=l.layout,f=l.connectNulls;l.ref;var d=fle(l,ule),p=gn(gn(gn({},Qe(d,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:i?"url(#clipPath-".concat(a,")"):null,points:o},s),{},{type:c,layout:u,connectNulls:f});return E.createElement(eg,fs({},p,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(o,i){var a=this,s=this.props,l=s.points,c=s.strokeDasharray,u=s.isAnimationActive,f=s.animationBegin,d=s.animationDuration,p=s.animationEasing,h=s.animationId,g=s.animateNewValues,v=s.width,x=s.height,w=this.state,$=w.prevPoints,C=w.totalLength;return E.createElement(Gr,{begin:f,duration:d,isActive:u,easing:p,from:{t:0},to:{t:1},key:"line-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(S){var b=S.t;if($){var O=$.length/l.length,P=l.map(function(I,j){var M=Math.floor(j*O);if($[M]){var D=$[M],L=er(D.x,I.x),B=er(D.y,I.y);return gn(gn({},I),{},{x:L(b),y:B(b)})}if(g){var F=er(v*2,I.x),Z=er(x/2,I.y);return gn(gn({},I),{},{x:F(b),y:Z(b)})}return gn(gn({},I),{},{x:I.x,y:I.y})});return a.renderCurveStatically(P,o,i)}var T=er(0,C),k=T(b),_;if(c){var A="".concat(c).split(/[,\s]+/gim).map(function(I){return parseFloat(I)});_=a.getStrokeDasharray(k,C,A)}else _=a.generateSimpleStrokeDasharray(C,k);return a.renderCurveStatically(l,o,i,{strokeDasharray:_})})}},{key:"renderCurve",value:function(o,i){var a=this.props,s=a.points,l=a.isAnimationActive,c=this.state,u=c.prevPoints,f=c.totalLength;return l&&s&&s.length&&(!u&&f>0||!Hf(u,s))?this.renderCurveWithAnimation(o,i):this.renderCurveStatically(s,o,i)}},{key:"render",value:function(){var o,i=this.props,a=i.hide,s=i.dot,l=i.points,c=i.className,u=i.xAxis,f=i.yAxis,d=i.top,p=i.left,h=i.width,g=i.height,v=i.isAnimationActive,x=i.id;if(a||!l||!l.length)return null;var w=this.state.isAnimationFinished,$=l.length===1,C=lt("recharts-line",c),S=u&&u.allowDataOverflow,b=f&&f.allowDataOverflow,O=S||b,P=Je(x)?this.id:x,T=(o=Qe(s))!==null&&o!==void 0?o:{r:3,strokeWidth:2},k=T.r,_=k===void 0?3:k,A=T.strokeWidth,I=A===void 0?2:A,j=KV(s)?s:{},M=j.clipDot,D=M===void 0?!0:M,L=_*2+I;return E.createElement(Pt,{className:C},S||b?E.createElement("defs",null,E.createElement("clipPath",{id:"clipPath-".concat(P)},E.createElement("rect",{x:S?p:p-h/2,y:b?d:d-g/2,width:S?h:h*2,height:b?g:g*2})),!D&&E.createElement("clipPath",{id:"clipPath-dots-".concat(P)},E.createElement("rect",{x:p-L/2,y:d-L/2,width:h+L,height:g+L}))):null,!$&&this.renderCurve(O,P),this.renderErrorBar(O,P),($||s)&&this.renderDots(O,D,P),(!v||w)&&yo.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(o,i){return o.animationId!==i.prevAnimationId?{prevAnimationId:o.animationId,curPoints:o.points,prevPoints:i.curPoints}:o.points!==i.curPoints?{curPoints:o.points}:null}},{key:"repeat",value:function(o,i){for(var a=o.length%2!==0?[].concat(pi(o),[0]):o,s=[],l=0;l-1?o[i?t[a]:a]:void 0}}var _le=Ple,Tle=I5;function Ale(e){var t=Tle(e),n=t%1;return t===t?n?t-n:t:0}var kle=Ale,jle=lC,Ile=Co,Mle=kle,Rle=Math.max;function Dle(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var o=n==null?0:Mle(n);return o<0&&(o=Rle(r+o,0)),jle(e,Ile(t),o)}var Nle=Dle,Lle=_le,Ble=Nle,Fle=Lle(Ble),zle=Fle;const Wle=yt(zle);var Vle="Invariant failed";function Hle(e,t){if(!e)throw new Error(Vle)}function U5(e){var t=e.cx,n=e.cy,r=e.radius,o=e.startAngle,i=e.endAngle,a=Ht(t,n,r,o),s=Ht(t,n,r,i);return{points:[a,s],cx:t,cy:n,radius:r,startAngle:o,endAngle:i}}function M2(e){return qle(e)||Kle(e)||Gle(e)||Ule()}function Ule(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Gle(e,t){if(e){if(typeof e=="string")return gg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return gg(e,t)}}function Kle(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function qle(e){if(Array.isArray(e))return gg(e)}function gg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function cce(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}function uce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function L2(e,t){for(var n=0;n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Fu(e){return Fu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Fu(e)}function oa(e){return yce(e)||vce(e)||q5(e)||mce()}function mce(){throw new TypeError(`Invalid attempt to spread non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function q5(e,t){if(e){if(typeof e=="string")return yg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return yg(e,t)}}function vce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function yce(e){if(Array.isArray(e))return yg(e)}function yg(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?a:t&&t.length&&me(o)&&me(i)?t.slice(o,i+1):[]};function Z5(e){return e==="number"?[0,"auto"]:void 0}var Q5=function(t,n,r,o){var i=t.graphicalItems,a=t.tooltipAxis,s=ed(n,t);return r<0||!i||!i.length||r>=s.length?null:i.reduce(function(l,c){var u,f=c.props.hide;if(f)return l;var d=(u=c.props.data)!==null&&u!==void 0?u:n;d&&t.dataStartIndex+t.dataEndIndex!==0&&(d=d.slice(t.dataStartIndex,t.dataEndIndex+1));var p;if(a.dataKey&&!a.allowDuplicatedCategory){var h=d===void 0?s:d;p=qc(h,a.dataKey,o)}else p=d&&d[r]||s[r];return p?[].concat(oa(l),[_5(c,p)]):l},[])},F2=function(t,n,r,o){var i=o||{x:t.chartX,y:t.chartY},a=Sce(i,r),s=t.orderedTooltipTicks,l=t.tooltipAxis,c=t.tooltipTicks,u=hre(a,s,c,l);if(u>=0&&c){var f=c[u]&&c[u].value,d=Q5(t,n,u,f),p=$ce(r,s,u,i);return{activeTooltipIndex:u,activeLabel:f,activePayload:d,activeCoordinate:p}}return null},Cce=function(t,n){var r=n.axes,o=n.graphicalItems,i=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.layout,f=t.children,d=t.stackOffset,p=E5(u,i);return r.reduce(function(h,g){var v,x=g.props,w=x.type,$=x.dataKey,C=x.allowDataOverflow,S=x.allowDuplicatedCategory,b=x.scale,O=x.ticks,P=x.includeHidden,T=g.props[a];if(h[T])return h;var k=ed(t.data,{graphicalItems:o.filter(function(te){return te.props[a]===T}),dataStartIndex:l,dataEndIndex:c}),_=k.length,A,I,j;tce(g.props.domain,C,w)&&(A=Xh(g.props.domain,null,C),p&&(w==="number"||b!=="auto")&&(j=cs(k,$,"category")));var M=Z5(w);if(!A||A.length===0){var D,L=(D=g.props.domain)!==null&&D!==void 0?D:M;if($){if(A=cs(k,$,w),w==="category"&&p){var B=LV(A);S&&B?(I=A,A=ku(0,_)):S||(A=Nx(L,A,g).reduce(function(te,le){return te.indexOf(le)>=0?te:[].concat(oa(te),[le])},[]))}else if(w==="category")S?A=A.filter(function(te){return te!==""&&!Je(te)}):A=Nx(L,A,g).reduce(function(te,le){return te.indexOf(le)>=0||le===""||Je(le)?te:[].concat(oa(te),[le])},[]);else if(w==="number"){var F=bre(k,o.filter(function(te){return te.props[a]===T&&(P||!te.props.hide)}),$,i,u);F&&(A=F)}p&&(w==="number"||b!=="auto")&&(j=cs(k,$,"category"))}else p?A=ku(0,_):s&&s[T]&&s[T].hasStack&&w==="number"?A=d==="expand"?[0,1]:P5(s[T].stackGroups,l,c):A=O5(k,o.filter(function(te){return te.props[a]===T&&(P||!te.props.hide)}),w,u,!0);if(w==="number")A=mg(f,A,T,i,O),L&&(A=Xh(L,A,C));else if(w==="category"&&L){var Z=L,ie=A.every(function(te){return Z.indexOf(te)>=0});ie&&(A=Z)}}return J(J({},h),{},Ie({},T,J(J({},g.props),{},{axisType:i,domain:A,categoricalDomain:j,duplicateDomain:I,originalDomain:(v=g.props.domain)!==null&&v!==void 0?v:M,isCategorical:p,layout:u})))},{})},Oce=function(t,n){var r=n.graphicalItems,o=n.Axis,i=n.axisType,a=n.axisIdKey,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.layout,f=t.children,d=ed(t.data,{graphicalItems:r,dataStartIndex:l,dataEndIndex:c}),p=d.length,h=E5(u,i),g=-1;return r.reduce(function(v,x){var w=x.props[a],$=Z5("number");if(!v[w]){g++;var C;return h?C=ku(0,p):s&&s[w]&&s[w].hasStack?(C=P5(s[w].stackGroups,l,c),C=mg(f,C,w,i)):(C=Xh($,O5(d,r.filter(function(S){return S.props[a]===w&&!S.props.hide}),"number",u),o.defaultProps.allowDataOverflow),C=mg(f,C,w,i)),J(J({},v),{},Ie({},w,J(J({axisType:i},o.defaultProps),{},{hide:!0,orientation:zn(xce,"".concat(i,".").concat(g%2),null),domain:C,originalDomain:$,isCategorical:h,layout:u})))}return v},{})},Ece=function(t,n){var r=n.axisType,o=r===void 0?"xAxis":r,i=n.AxisComp,a=n.graphicalItems,s=n.stackGroups,l=n.dataStartIndex,c=n.dataEndIndex,u=t.children,f="".concat(o,"Id"),d=Wn(u,i),p={};return d&&d.length?p=Cce(t,{axes:d,graphicalItems:a,axisType:o,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c}):a&&a.length&&(p=Oce(t,{Axis:i,graphicalItems:a,axisType:o,axisIdKey:f,stackGroups:s,dataStartIndex:l,dataEndIndex:c})),p},Pce=function(t){var n=ao(t),r=so(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:Nm(r,function(o){return o.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Ou(n,r)}},z2=function(t){var n=t.children,r=t.defaultShowTooltip,o=Mr(n,Ys),i=0,a=0;return t.data&&t.data.length!==0&&(a=t.data.length-1),o&&o.props&&(o.props.startIndex>=0&&(i=o.props.startIndex),o.props.endIndex>=0&&(a=o.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:a,activeTooltipIndex:-1,isTooltipActive:!!r}},_ce=function(t){return!t||!t.length?!1:t.some(function(n){var r=mo(n&&n.type);return r&&r.indexOf("Bar")>=0})},W2=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Tce=function(t,n){var r=t.props,o=t.graphicalItems,i=t.xAxisMap,a=i===void 0?{}:i,s=t.yAxisMap,l=s===void 0?{}:s,c=r.width,u=r.height,f=r.children,d=r.margin||{},p=Mr(f,Ys),h=Mr(f,Ss),g=Object.keys(l).reduce(function(S,b){var O=l[b],P=O.orientation;return!O.mirror&&!O.hide?J(J({},S),{},Ie({},P,S[P]+O.width)):S},{left:d.left||0,right:d.right||0}),v=Object.keys(a).reduce(function(S,b){var O=a[b],P=O.orientation;return!O.mirror&&!O.hide?J(J({},S),{},Ie({},P,zn(S,"".concat(P))+O.height)):S},{top:d.top||0,bottom:d.bottom||0}),x=J(J({},v),g),w=x.bottom;p&&(x.bottom+=p.props.height||Ys.defaultProps.height),h&&n&&(x=vre(x,o,r,n));var $=c-x.left-x.right,C=u-x.top-x.bottom;return J(J({brushBottom:w},x),{},{width:Math.max($,0),height:Math.max(C,0)})},Ace=function(t){var n,r=t.chartName,o=t.GraphicalChild,i=t.defaultTooltipEventType,a=i===void 0?"axis":i,s=t.validateTooltipEventTypes,l=s===void 0?["axis"]:s,c=t.axisComponents,u=t.legendContent,f=t.formatAxisMap,d=t.defaultProps,p=function(v,x){var w=x.graphicalItems,$=x.stackGroups,C=x.offset,S=x.updateId,b=x.dataStartIndex,O=x.dataEndIndex,P=v.barSize,T=v.layout,k=v.barGap,_=v.barCategoryGap,A=v.maxBarSize,I=W2(T),j=I.numericAxisName,M=I.cateAxisName,D=_ce(w),L=D&&gre({barSize:P,stackGroups:$}),B=[];return w.forEach(function(F,Z){var ie=ed(v.data,{graphicalItems:[F],dataStartIndex:b,dataEndIndex:O}),te=F.props,le=te.dataKey,re=te.maxBarSize,ae=F.props["".concat(j,"Id")],xe=F.props["".concat(M,"Id")],Me={},we=c.reduce(function(z,U){var W,V=x["".concat(U.axisType,"Map")],q=F.props["".concat(U.axisType,"Id")];V&&V[q]||U.axisType==="zAxis"||Hle(!1);var ue=V[q];return J(J({},z),{},(W={},Ie(W,U.axisType,ue),Ie(W,"".concat(U.axisType,"Ticks"),so(ue)),W))},Me),Y=we[M],ve=we["".concat(M,"Ticks")],ce=$&&$[ae]&&$[ae].hasStack&&kre(F,$[ae].stackGroups),G=mo(F.type).indexOf("Bar")>=0,fe=Ou(Y,ve),de=[];if(G){var pe,se,Le=Je(re)?A:re,Ce=(pe=(se=Ou(Y,ve,!0))!==null&&se!==void 0?se:Le)!==null&&pe!==void 0?pe:0;de=mre({barGap:k,barCategoryGap:_,bandSize:Ce!==fe?Ce:fe,sizeList:L[xe],maxBarSize:Le}),Ce!==fe&&(de=de.map(function(z){return J(J({},z),{},{position:J(J({},z.position),{},{offset:z.position.offset-Ce/2})})}))}var Ge=F&&F.type&&F.type.getComposedData;if(Ge){var N;B.push({props:J(J({},Ge(J(J({},we),{},{displayedData:ie,props:v,dataKey:le,item:F,bandSize:fe,barPosition:de,offset:C,stackedData:ce,layout:T,dataStartIndex:b,dataEndIndex:O}))),{},(N={key:F.key||"item-".concat(Z)},Ie(N,j,we[j]),Ie(N,M,we[M]),Ie(N,"animationId",S),N)),childIndex:YV(F,v.children),item:F})}}),B},h=function(v,x){var w=v.props,$=v.dataStartIndex,C=v.dataEndIndex,S=v.updateId;if(!xy({props:w}))return null;var b=w.children,O=w.layout,P=w.stackOffset,T=w.data,k=w.reverseStackOrder,_=W2(O),A=_.numericAxisName,I=_.cateAxisName,j=Wn(b,o),M=_re(T,j,"".concat(A,"Id"),"".concat(I,"Id"),P,k),D=c.reduce(function(ie,te){var le="".concat(te.axisType,"Map");return J(J({},ie),{},Ie({},le,Ece(w,J(J({},te),{},{graphicalItems:j,stackGroups:te.axisType===A&&M,dataStartIndex:$,dataEndIndex:C}))))},{}),L=Tce(J(J({},D),{},{props:w,graphicalItems:j}),x==null?void 0:x.legendBBox);Object.keys(D).forEach(function(ie){D[ie]=f(w,D[ie],L,ie.replace("Map",""),r)});var B=D["".concat(I,"Map")],F=Pce(B),Z=p(w,J(J({},D),{},{dataStartIndex:$,dataEndIndex:C,updateId:S,graphicalItems:j,stackGroups:M,offset:L}));return J(J({formattedGraphicalItems:Z,graphicalItems:j,offset:L,stackGroups:M},F),D)};return n=function(g){dce(x,g);var v=pce(x);function x(w){var $,C,S;return uce(this,x),S=v.call(this,w),Ie(We(S),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ie(We(S),"accessibilityManager",new ece),Ie(We(S),"handleLegendBBoxUpdate",function(b){if(b){var O=S.state,P=O.dataStartIndex,T=O.dataEndIndex,k=O.updateId;S.setState(J({legendBBox:b},h({props:S.props,dataStartIndex:P,dataEndIndex:T,updateId:k},J(J({},S.state),{},{legendBBox:b}))))}}),Ie(We(S),"handleReceiveSyncEvent",function(b,O,P){if(S.props.syncId===b){if(P===S.eventEmitterSymbol&&typeof S.props.syncMethod!="function")return;S.applySyncEvent(O)}}),Ie(We(S),"handleBrushChange",function(b){var O=b.startIndex,P=b.endIndex;if(O!==S.state.dataStartIndex||P!==S.state.dataEndIndex){var T=S.state.updateId;S.setState(function(){return J({dataStartIndex:O,dataEndIndex:P},h({props:S.props,dataStartIndex:O,dataEndIndex:P,updateId:T},S.state))}),S.triggerSyncEvent({dataStartIndex:O,dataEndIndex:P})}}),Ie(We(S),"handleMouseEnter",function(b){var O=S.getMouseInfo(b);if(O){var P=J(J({},O),{},{isTooltipActive:!0});S.setState(P),S.triggerSyncEvent(P);var T=S.props.onMouseEnter;Ue(T)&&T(P,b)}}),Ie(We(S),"triggeredAfterMouseMove",function(b){var O=S.getMouseInfo(b),P=O?J(J({},O),{},{isTooltipActive:!0}):{isTooltipActive:!1};S.setState(P),S.triggerSyncEvent(P);var T=S.props.onMouseMove;Ue(T)&&T(P,b)}),Ie(We(S),"handleItemMouseEnter",function(b){S.setState(function(){return{isTooltipActive:!0,activeItem:b,activePayload:b.tooltipPayload,activeCoordinate:b.tooltipPosition||{x:b.cx,y:b.cy}}})}),Ie(We(S),"handleItemMouseLeave",function(){S.setState(function(){return{isTooltipActive:!1}})}),Ie(We(S),"handleMouseMove",function(b){b.persist(),S.throttleTriggeredAfterMouseMove(b)}),Ie(We(S),"handleMouseLeave",function(b){var O={isTooltipActive:!1};S.setState(O),S.triggerSyncEvent(O);var P=S.props.onMouseLeave;Ue(P)&&P(O,b)}),Ie(We(S),"handleOuterEvent",function(b){var O=XV(b),P=zn(S.props,"".concat(O));if(O&&Ue(P)){var T,k;/.*touch.*/i.test(O)?k=S.getMouseInfo(b.changedTouches[0]):k=S.getMouseInfo(b),P((T=k)!==null&&T!==void 0?T:{},b)}}),Ie(We(S),"handleClick",function(b){var O=S.getMouseInfo(b);if(O){var P=J(J({},O),{},{isTooltipActive:!0});S.setState(P),S.triggerSyncEvent(P);var T=S.props.onClick;Ue(T)&&T(P,b)}}),Ie(We(S),"handleMouseDown",function(b){var O=S.props.onMouseDown;if(Ue(O)){var P=S.getMouseInfo(b);O(P,b)}}),Ie(We(S),"handleMouseUp",function(b){var O=S.props.onMouseUp;if(Ue(O)){var P=S.getMouseInfo(b);O(P,b)}}),Ie(We(S),"handleTouchMove",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&S.throttleTriggeredAfterMouseMove(b.changedTouches[0])}),Ie(We(S),"handleTouchStart",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&S.handleMouseDown(b.changedTouches[0])}),Ie(We(S),"handleTouchEnd",function(b){b.changedTouches!=null&&b.changedTouches.length>0&&S.handleMouseUp(b.changedTouches[0])}),Ie(We(S),"triggerSyncEvent",function(b){S.props.syncId!==void 0&&vp.emit(yp,S.props.syncId,b,S.eventEmitterSymbol)}),Ie(We(S),"applySyncEvent",function(b){var O=S.props,P=O.layout,T=O.syncMethod,k=S.state.updateId,_=b.dataStartIndex,A=b.dataEndIndex;if(b.dataStartIndex!==void 0||b.dataEndIndex!==void 0)S.setState(J({dataStartIndex:_,dataEndIndex:A},h({props:S.props,dataStartIndex:_,dataEndIndex:A,updateId:k},S.state)));else if(b.activeTooltipIndex!==void 0){var I=b.chartX,j=b.chartY,M=b.activeTooltipIndex,D=S.state,L=D.offset,B=D.tooltipTicks;if(!L)return;if(typeof T=="function")M=T(B,b);else if(T==="value"){M=-1;for(var F=0;F=0){var ce,G;if(I.dataKey&&!I.allowDuplicatedCategory){var fe=typeof I.dataKey=="function"?ve:"payload.".concat(I.dataKey.toString());ce=qc(F,fe,M),G=Z&&ie&&qc(ie,fe,M)}else ce=F==null?void 0:F[j],G=Z&&ie&&ie[j];if(xe||ae){var de=b.props.activeIndex!==void 0?b.props.activeIndex:j;return[y.cloneElement(b,J(J(J({},T.props),we),{},{activeIndex:de})),null,null]}if(!Je(ce))return[Y].concat(oa(S.renderActivePoints({item:T,activePoint:ce,basePoint:G,childIndex:j,isRange:Z})))}else{var pe,se=(pe=S.getItemByXY(S.state.activeCoordinate))!==null&&pe!==void 0?pe:{graphicalItem:Y},Le=se.graphicalItem,Ce=Le.item,Ge=Ce===void 0?b:Ce,N=Le.childIndex,z=J(J(J({},T.props),we),{},{activeIndex:N});return[y.cloneElement(Ge,z),null,null]}return Z?[Y,null,null]:[Y,null]}),Ie(We(S),"renderCustomized",function(b,O,P){return y.cloneElement(b,J(J({key:"recharts-customized-".concat(P)},S.props),S.state))}),Ie(We(S),"renderMap",{CartesianGrid:{handler:S.renderGrid,once:!0},ReferenceArea:{handler:S.renderReferenceElement},ReferenceLine:{handler:S.renderReferenceElement},ReferenceDot:{handler:S.renderReferenceElement},XAxis:{handler:S.renderXAxis},YAxis:{handler:S.renderYAxis},Brush:{handler:S.renderBrush,once:!0},Bar:{handler:S.renderGraphicChild},Line:{handler:S.renderGraphicChild},Area:{handler:S.renderGraphicChild},Radar:{handler:S.renderGraphicChild},RadialBar:{handler:S.renderGraphicChild},Scatter:{handler:S.renderGraphicChild},Pie:{handler:S.renderGraphicChild},Funnel:{handler:S.renderGraphicChild},Tooltip:{handler:S.renderCursor,once:!0},PolarGrid:{handler:S.renderPolarGrid,once:!0},PolarAngleAxis:{handler:S.renderPolarAxis},PolarRadiusAxis:{handler:S.renderPolarAxis},Customized:{handler:S.renderCustomized}}),S.clipPathId="".concat(($=w.id)!==null&&$!==void 0?$:Pl("recharts"),"-clip"),S.throttleTriggeredAfterMouseMove=zQ(S.triggeredAfterMouseMove,(C=w.throttleDelay)!==null&&C!==void 0?C:1e3/60),S.state={},S}return fce(x,[{key:"componentDidMount",value:function(){var $,C;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:($=this.props.margin.left)!==null&&$!==void 0?$:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout})}},{key:"getSnapshotBeforeUpdate",value:function($,C){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==C.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==$.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==$.margin){var S,b;this.accessibilityManager.setDetails({offset:{left:(S=this.props.margin.left)!==null&&S!==void 0?S:0,top:(b=this.props.margin.top)!==null&&b!==void 0?b:0}})}return null}},{key:"componentDidUpdate",value:function(){}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var $=Mr(this.props.children,Bo);if($&&typeof $.props.shared=="boolean"){var C=$.props.shared?"axis":"item";return l.indexOf(C)>=0?C:a}return a}},{key:"getMouseInfo",value:function($){if(!this.container)return null;var C=this.container,S=C.getBoundingClientRect(),b=qQ(S),O={chartX:Math.round($.pageX-b.left),chartY:Math.round($.pageY-b.top)},P=S.width/C.offsetWidth||1,T=this.inRange(O.chartX,O.chartY,P);if(!T)return null;var k=this.state,_=k.xAxisMap,A=k.yAxisMap,I=this.getTooltipEventType();if(I!=="axis"&&_&&A){var j=ao(_).scale,M=ao(A).scale,D=j&&j.invert?j.invert(O.chartX):null,L=M&&M.invert?M.invert(O.chartY):null;return J(J({},O),{},{xValue:D,yValue:L})}var B=F2(this.state,this.props.data,this.props.layout,T);return B?J(J({},O),B):null}},{key:"inRange",value:function($,C){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,b=this.props.layout,O=$/S,P=C/S;if(b==="horizontal"||b==="vertical"){var T=this.state.offset,k=O>=T.left&&O<=T.left+T.width&&P>=T.top&&P<=T.top+T.height;return k?{x:O,y:P}:null}var _=this.state,A=_.angleAxisMap,I=_.radiusAxisMap;if(A&&I){var j=ao(A);return Fx({x:O,y:P},j)}return null}},{key:"parseEventsOfWrapper",value:function(){var $=this.props.children,C=this.getTooltipEventType(),S=Mr($,Bo),b={};S&&C==="axis"&&(S.props.trigger==="click"?b={onClick:this.handleClick}:b={onMouseEnter:this.handleMouseEnter,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd});var O=Xc(this.props,this.handleOuterEvent);return J(J({},O),b)}},{key:"addListener",value:function(){vp.on(yp,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){vp.removeListener(yp,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function($,C,S){for(var b=this.state.formattedGraphicalItems,O=0,P=b.length;Om.jsx(Kf,{cx:e,cy:t,fill:K.blueTextAccent,r:2}),Ice=({data:e,width:t=500,height:n=300})=>m.jsx(m.Fragment,{children:(e==null?void 0:e.length)&&m.jsxs(kce,{data:e,height:n,id:"cy-sentiment-chart",margin:{bottom:5,left:-20,right:30,top:5},width:t,children:[m.jsx(mv,{stroke:K.lightBlue300,strokeDasharray:"5 5"}),m.jsx(Qf,{dataKey:"date",interval:Math.floor(e.length/3),stroke:K.blueTextAccent}),m.jsx(Jf,{domain:[0,10],stroke:K.blueTextAccent}),m.jsx(Bo,{}),m.jsx(Rl,{dataKey:"score",dot:m.jsx(jce,{}),stroke:"#8884d8",type:"monotone"})]})}),Mce=()=>{const[e,t]=y.useState(void 0),[n]=sa(a=>[a.setBudget]),[r,o]=y.useState(!1),i=async()=>{o(!0),b$(n).then(async a=>{t(a==null?void 0:a.data.filter(s=>s.date).map(s=>({date:eE.unix(Number(String(s.date).split(".")[0])).format("MM/DD/YY"),score:s.sentiment_score}))),await iw(n)}).catch().finally(()=>{o(!1)})};return m.jsxs(Rce,{align:"flex-start",direction:"column",id:"cy-sentiment-chart-wrapper",justify:"flex-end",children:[m.jsx(ze,{className:"title",children:"Sentiment chart"}),r&&m.jsx(Lw,{alignItems:"center",component:"div",flexGrow:1,p:4,spacing:2,width:"100%",children:m.jsx(sB,{color:K.white})}),!(e!=null&&e.length)&&m.jsx(Dce,{className:"button",id:"cy-get-sentiments-btn",onClick:i,children:"Get top 100 sentiments"}),m.jsx(Ice,{data:e})]})},Rce=X(ee)` border-radius: 8px; box-shadow: 0px 5px 6px rgb(0 0 0 / 50%); padding: 16px; @@ -1622,9 +1622,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho margin-bottom: 16px; font-size: 20px; } -`,Mce=X(Gc)` +`,Dce=X(Gc)` height: 48px; -`,Rce=600,Dce={about:m.jsx(SW,{}),sentiment:m.jsx(jce,{}),sources:m.jsx(hW,{}),"":null},Nce=()=>{const[e,t]=Yr(n=>[n.secondarySidebarActiveTab,n.setSecondarySidebarActiveTab]);return m.jsx(U8,{direction:"left",in:!!e,mountOnEnter:!0,unmountOnExit:!0,children:m.jsxs(Lce,{id:"secondary-sidebar-wrapper",children:[m.jsx(Bce,{id:"cy-close-secondary-sidebar",onClick:()=>t(""),children:m.jsx(ZS,{})}),Dce[e]]})})},Lce=X(ee)(({theme:e})=>({background:K.BG1,height:"100vh",padding:"16px 20px",width:"100%",zIndex:30,display:"flex",[e.breakpoints.up("sm")]:{width:Rce}})),Bce=X(ee).attrs({align:"center",justify:"center",p:5})` +`,Nce=600,Lce={about:m.jsx(CW,{}),sentiment:m.jsx(Mce,{}),sources:m.jsx(mW,{}),"":null},Bce=()=>{const[e,t]=Yr(n=>[n.secondarySidebarActiveTab,n.setSecondarySidebarActiveTab]);return m.jsx(U8,{direction:"left",in:!!e,mountOnEnter:!0,unmountOnExit:!0,children:m.jsxs(Fce,{id:"secondary-sidebar-wrapper",children:[m.jsx(zce,{id:"cy-close-secondary-sidebar",onClick:()=>t(""),children:m.jsx(ZS,{})}),Lce[e]]})})},Fce=X(ee)(({theme:e})=>({background:K.BG1,height:"100vh",padding:"16px 20px",width:"100%",zIndex:30,display:"flex",[e.breakpoints.up("sm")]:{width:Nce}})),zce=X(ee).attrs({align:"center",justify:"center",p:5})` background-color: ${K.inputBg1}; border-radius: 50%; color: ${K.mainBottomIcons}; @@ -1636,7 +1636,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho &:hover { background-color: ${K.gray200}; } -`;function J5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ttypeof e=="number"&&!isNaN(e),Ko=e=>typeof e=="string",Cn=e=>typeof e=="function",vc=e=>Ko(e)||Cn(e)?e:null,yg=e=>y.isValidElement(e)||Ko(e)||Cn(e)||ol(e);function Fce(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function ed(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(a){let{children:s,position:l,preventExitTransition:c,done:u,nodeRef:f,isIn:d,playToast:p}=a;const h=r?`${t}--${l}`:t,g=r?`${n}--${l}`:n,v=y.useRef(0);return y.useLayoutEffect(()=>{const x=f.current,w=h.split(" "),$=C=>{C.target===f.current&&(p(),x.removeEventListener("animationend",$),x.removeEventListener("animationcancel",$),v.current===0&&C.type!=="animationcancel"&&x.classList.remove(...w))};x.classList.add(...w),x.addEventListener("animationend",$),x.addEventListener("animationcancel",$)},[]),y.useEffect(()=>{const x=f.current,w=()=>{x.removeEventListener("animationend",w),o?Fce(x,u,i):u()};d||(c?w():(v.current=1,x.className+=` ${g}`,x.addEventListener("animationend",w)))},[d]),E.createElement(E.Fragment,null,s)}}function V2(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const an=new Map;let il=[];const bg=new Set,zce=e=>bg.forEach(t=>t(e)),eO=()=>an.size>0;function tO(e,t){var n;if(t)return!((n=an.get(t))==null||!n.isToastActive(e));let r=!1;return an.forEach(o=>{o.isToastActive(e)&&(r=!0)}),r}function nO(e,t){yg(e)&&(eO()||il.push({content:e,options:t}),an.forEach(n=>{n.buildToast(e,t)}))}function H2(e,t){an.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function Wce(e){const{subscribe:t,getSnapshot:n,setProps:r}=y.useRef(function(i){const a=i.containerId||1;return{subscribe(s){const l=function(u,f,d){let p=1,h=0,g=[],v=[],x=[],w=f;const $=new Map,C=new Set,S=()=>{x=Array.from($.values()),C.forEach(P=>P())},b=P=>{v=P==null?[]:v.filter(T=>T!==P),S()},O=P=>{const{toastId:T,onOpen:k,updateId:_,children:A}=P.props,I=_==null;P.staleId&&$.delete(P.staleId),$.set(T,P),v=[...v,P.props.toastId].filter(j=>j!==P.staleId),S(),d(V2(P,I?"added":"updated")),I&&Cn(k)&&k(y.isValidElement(A)&&A.props)};return{id:u,props:w,observe:P=>(C.add(P),()=>C.delete(P)),toggle:(P,T)=>{$.forEach(k=>{T!=null&&T!==k.props.toastId||Cn(k.toggle)&&k.toggle(P)})},removeToast:b,toasts:$,clearQueue:()=>{h-=g.length,g=[]},buildToast:(P,T)=>{if((te=>{let{containerId:le,toastId:re,updateId:ae}=te;const xe=le?le!==u:u!==1,Me=$.has(re)&&ae==null;return xe||Me})(T))return;const{toastId:k,updateId:_,data:A,staleId:I,delay:j}=T,M=()=>{b(k)},D=_==null;D&&h++;const L={...w,style:w.toastStyle,key:p++,...Object.fromEntries(Object.entries(T).filter(te=>{let[le,re]=te;return re!=null})),toastId:k,updateId:_,data:A,closeToast:M,isIn:!1,className:vc(T.className||w.toastClassName),bodyClassName:vc(T.bodyClassName||w.bodyClassName),progressClassName:vc(T.progressClassName||w.progressClassName),autoClose:!T.isLoading&&(B=T.autoClose,F=w.autoClose,B===!1||ol(B)&&B>0?B:F),deleteToast(){const te=$.get(k),{onClose:le,children:re}=te.props;Cn(le)&&le(y.isValidElement(re)&&re.props),d(V2(te,"removed")),$.delete(k),h--,h<0&&(h=0),g.length>0?O(g.shift()):S()}};var B,F;L.closeButton=w.closeButton,T.closeButton===!1||yg(T.closeButton)?L.closeButton=T.closeButton:T.closeButton===!0&&(L.closeButton=!yg(w.closeButton)||w.closeButton);let Z=P;y.isValidElement(P)&&!Ko(P.type)?Z=y.cloneElement(P,{closeToast:M,toastProps:L,data:A}):Cn(P)&&(Z=P({closeToast:M,toastProps:L,data:A}));const ie={content:Z,props:L,staleId:I};w.limit&&w.limit>0&&h>w.limit&&D?g.push(ie):ol(j)?setTimeout(()=>{O(ie)},j):O(ie)},setProps(P){w=P},setToggle:(P,T)=>{$.get(P).toggle=T},isToastActive:P=>v.some(T=>T===P),getSnapshot:()=>w.newestOnTop?x.reverse():x}}(a,i,zce);an.set(a,l);const c=l.observe(s);return il.forEach(u=>nO(u.content,u.options)),il=[],()=>{c(),an.delete(a)}},setProps(s){var l;(l=an.get(a))==null||l.setProps(s)},getSnapshot(){var s;return(s=an.get(a))==null?void 0:s.getSnapshot()}}}(e)).current;r(e);const o=y.useSyncExternalStore(t,n,n);return{getToastToRender:function(i){if(!o)return[];const a=new Map;return o.forEach(s=>{const{position:l}=s.props;a.has(l)||a.set(l,[]),a.get(l).push(s)}),Array.from(a,s=>i(s[0],s[1]))},isToastActive:tO,count:o==null?void 0:o.length}}function Vce(e){const[t,n]=y.useState(!1),[r,o]=y.useState(!1),i=y.useRef(null),a=y.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:s,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:f}=e;var d,p;function h(){n(!0)}function g(){n(!1)}function v($){const C=i.current;a.canDrag&&C&&(a.didMove=!0,t&&g(),a.delta=e.draggableDirection==="x"?$.clientX-a.start:$.clientY-a.start,a.start!==$.clientX&&(a.canCloseOnClick=!1),C.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,C.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function x(){document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",x);const $=i.current;if(a.canDrag&&a.didMove&&$){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();$.style.transition="transform 0.2s, opacity 0.2s",$.style.removeProperty("transform"),$.style.removeProperty("opacity")}}(p=an.get((d={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||p.setToggle(d.id,d.fn),y.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||g(),window.addEventListener("focus",h),window.addEventListener("blur",g),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",g)}},[e.pauseOnFocusLoss]);const w={onPointerDown:function($){if(e.draggable===!0||e.draggable===$.pointerType){a.didMove=!1,document.addEventListener("pointermove",v),document.addEventListener("pointerup",x);const C=i.current;a.canCloseOnClick=!0,a.canDrag=!0,C.style.transition="none",e.draggableDirection==="x"?(a.start=$.clientX,a.removalDistance=C.offsetWidth*(e.draggablePercent/100)):(a.start=$.clientY,a.removalDistance=C.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function($){const{top:C,bottom:S,left:b,right:O}=i.current.getBoundingClientRect();$.nativeEvent.type!=="touchend"&&e.pauseOnHover&&$.clientX>=b&&$.clientX<=O&&$.clientY>=C&&$.clientY<=S?g():h()}};return s&&l&&(w.onMouseEnter=g,e.stacked||(w.onMouseLeave=h)),f&&(w.onClick=$=>{u&&u($),a.canCloseOnClick&&c()}),{playToast:h,pauseToast:g,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:w}}function Hce(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:s,controlledProgress:l,progress:c,rtl:u,isIn:f,theme:d}=e;const p=i||l&&c===0,h={...s,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};l&&(h.transform=`scaleX(${c})`);const g=ho("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":u}),v=Cn(a)?a({rtl:u,type:o,defaultClassName:g}):ho(g,a),x={[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{f&&r()}};return E.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},E.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${d} Toastify__progress-bar--${o}`}),E.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:v,style:h,...x}))}let Uce=1;const rO=()=>""+Uce++;function Gce(e){return e&&(Ko(e.toastId)||ol(e.toastId))?e.toastId:rO()}function ds(e,t){return nO(e,t),t.toastId}function zu(e,t){return{...t,type:t&&t.type||e,toastId:Gce(t)}}function cc(e){return(t,n)=>ds(t,zu(e,n))}function ht(e,t){return ds(e,zu("default",t))}ht.loading=(e,t)=>ds(e,zu("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ht.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=Ko(o)?ht.loading(o,n):ht.loading(o.render,{...n,...o}));const s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,f,d)=>{if(f==null)return void ht.dismiss(r);const p={type:u,...s,...n,data:d},h=Ko(f)?{render:f}:f;return r?ht.update(r,{...p,...h}):ht(h.render,{...p,...h}),d},c=Cn(e)?e():e;return c.then(u=>l("success",a,u)).catch(u=>l("error",i,u)),c},ht.success=cc("success"),ht.info=cc("info"),ht.error=cc("error"),ht.warning=cc("warning"),ht.warn=ht.warning,ht.dark=(e,t)=>ds(e,zu("default",{theme:"dark",...t})),ht.dismiss=function(e){(function(t){var n;if(eO()){if(t==null||Ko(n=t)||ol(n))an.forEach(o=>{o.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){var r;(r=an.get(t.containerId))!=null&&r.removeToast(t.id)||an.forEach(o=>{o.removeToast(t.id)})}}else il=il.filter(o=>t!=null&&o.options.toastId!==t)})(e)},ht.clearWaitingQueue=function(e){e===void 0&&(e={}),an.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},ht.isActive=tO,ht.update=function(e,t){t===void 0&&(t={});const n=((r,o)=>{var i;let{containerId:a}=o;return(i=an.get(a||1))==null?void 0:i.toasts.get(r)})(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:rO()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,ds(a,i)}},ht.done=e=>{ht.update(e,{progress:1})},ht.onChange=function(e){return bg.add(e),()=>{bg.delete(e)}},ht.play=e=>H2(!0,e),ht.pause=e=>H2(!1,e);const Kce=typeof window<"u"?y.useLayoutEffect:y.useEffect,uc=e=>{let{theme:t,type:n,isLoading:r,...o}=e;return E.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...o})},bp={info:function(e){return E.createElement(uc,{...e},E.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return E.createElement(uc,{...e},E.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return E.createElement(uc,{...e},E.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return E.createElement(uc,{...e},E.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return E.createElement("div",{className:"Toastify__spinner"})}},qce=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o,playToast:i}=Vce(e),{closeButton:a,children:s,autoClose:l,onClick:c,type:u,hideProgressBar:f,closeToast:d,transition:p,position:h,className:g,style:v,bodyClassName:x,bodyStyle:w,progressClassName:$,progressStyle:C,updateId:S,role:b,progress:O,rtl:P,toastId:T,deleteToast:k,isIn:_,isLoading:A,closeOnClick:I,theme:j}=e,M=ho("Toastify__toast",`Toastify__toast-theme--${j}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":P},{"Toastify__toast--close-on-click":I}),D=Cn(g)?g({rtl:P,position:h,type:u,defaultClassName:M}):ho(M,g),L=function(ie){let{theme:te,type:le,isLoading:re,icon:ae}=ie,xe=null;const Me={theme:te,type:le};return ae===!1||(Cn(ae)?xe=ae({...Me,isLoading:re}):y.isValidElement(ae)?xe=y.cloneElement(ae,Me):re?xe=bp.spinner():(we=>we in bp)(le)&&(xe=bp[le](Me))),xe}(e),B=!!O||!l,F={closeToast:d,type:u,theme:j};let Z=null;return a===!1||(Z=Cn(a)?a(F):y.isValidElement(a)?y.cloneElement(a,F):function(ie){let{closeToast:te,theme:le,ariaLabel:re="close"}=ie;return E.createElement("button",{className:`Toastify__close-button Toastify__close-button--${le}`,type:"button",onClick:ae=>{ae.stopPropagation(),te(ae)},"aria-label":re},E.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},E.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(F)),E.createElement(p,{isIn:_,done:k,position:h,preventExitTransition:n,nodeRef:r,playToast:i},E.createElement("div",{id:T,onClick:c,"data-in":_,className:D,...o,style:v,ref:r},E.createElement("div",{..._&&{role:b},className:Cn(x)?x({type:u}):ho("Toastify__toast-body",x),style:w},L!=null&&E.createElement("div",{className:ho("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!A})},L),E.createElement("div",null,s)),Z,E.createElement(Hce,{...S&&!B?{key:`pb-${S}`}:{},rtl:P,theme:j,delay:l,isRunning:t,isIn:_,closeToast:d,hide:f,type:u,style:C,className:$,controlledProgress:B,progress:O||0})))},td=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},Xce=ed(td("bounce",!0));ed(td("slide",!0));ed(td("zoom"));ed(td("flip"));const Yce={position:"top-right",transition:Xce,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function Zce(e){let t={...Yce,...e};const n=e.stacked,[r,o]=y.useState(!0),i=y.useRef(null),{getToastToRender:a,isToastActive:s,count:l}=Wce(t),{className:c,style:u,rtl:f,containerId:d}=t;function p(g){const v=ho("Toastify__toast-container",`Toastify__toast-container--${g}`,{"Toastify__toast-container--rtl":f});return Cn(c)?c({position:g,rtl:f,defaultClassName:v}):ho(v,vc(c))}function h(){n&&(o(!0),ht.play())}return Kce(()=>{if(n){var g;const v=i.current.querySelectorAll('[data-in="true"]'),x=12,w=(g=t.position)==null?void 0:g.includes("top");let $=0,C=0;Array.from(v).reverse().forEach((S,b)=>{const O=S;O.classList.add("Toastify__toast--stacked"),b>0&&(O.dataset.collapsed=`${r}`),O.dataset.pos||(O.dataset.pos=w?"top":"bot");const P=$*(r?.2:1)+(r?0:x*b);O.style.setProperty("--y",`${w?P:-1*P}px`),O.style.setProperty("--g",`${x}`),O.style.setProperty("--s",""+(1-(r?C:0))),$+=O.offsetHeight,C+=.025})}},[r,l,n]),E.createElement("div",{ref:i,className:"Toastify",id:d,onMouseEnter:()=>{n&&(o(!1),ht.pause())},onMouseLeave:h},a((g,v)=>{const x=v.length?{...u}:{...u,pointerEvents:"none"};return E.createElement("div",{className:p(g),style:x,key:`container-${g}`},v.map(w=>{let{content:$,props:C}=w;return E.createElement(qce,{...C,stacked:n,collapseAll:h,isIn:s(C.toastId,C.containerId),style:C.style,key:`toast-${C.key}`},$)}))}))}const Qce=X(Zce)` +`;function J5(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ttypeof e=="number"&&!isNaN(e),Ko=e=>typeof e=="string",Cn=e=>typeof e=="function",vc=e=>Ko(e)||Cn(e)?e:null,bg=e=>y.isValidElement(e)||Ko(e)||Cn(e)||ol(e);function Wce(e,t,n){n===void 0&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame(()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame(()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)})})}function td(e){let{enter:t,exit:n,appendPosition:r=!1,collapse:o=!0,collapseDuration:i=300}=e;return function(a){let{children:s,position:l,preventExitTransition:c,done:u,nodeRef:f,isIn:d,playToast:p}=a;const h=r?`${t}--${l}`:t,g=r?`${n}--${l}`:n,v=y.useRef(0);return y.useLayoutEffect(()=>{const x=f.current,w=h.split(" "),$=C=>{C.target===f.current&&(p(),x.removeEventListener("animationend",$),x.removeEventListener("animationcancel",$),v.current===0&&C.type!=="animationcancel"&&x.classList.remove(...w))};x.classList.add(...w),x.addEventListener("animationend",$),x.addEventListener("animationcancel",$)},[]),y.useEffect(()=>{const x=f.current,w=()=>{x.removeEventListener("animationend",w),o?Wce(x,u,i):u()};d||(c?w():(v.current=1,x.className+=` ${g}`,x.addEventListener("animationend",w)))},[d]),E.createElement(E.Fragment,null,s)}}function V2(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const an=new Map;let il=[];const xg=new Set,Vce=e=>xg.forEach(t=>t(e)),eO=()=>an.size>0;function tO(e,t){var n;if(t)return!((n=an.get(t))==null||!n.isToastActive(e));let r=!1;return an.forEach(o=>{o.isToastActive(e)&&(r=!0)}),r}function nO(e,t){bg(e)&&(eO()||il.push({content:e,options:t}),an.forEach(n=>{n.buildToast(e,t)}))}function H2(e,t){an.forEach(n=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===n.id&&n.toggle(e,t==null?void 0:t.id):n.toggle(e,t==null?void 0:t.id)})}function Hce(e){const{subscribe:t,getSnapshot:n,setProps:r}=y.useRef(function(i){const a=i.containerId||1;return{subscribe(s){const l=function(u,f,d){let p=1,h=0,g=[],v=[],x=[],w=f;const $=new Map,C=new Set,S=()=>{x=Array.from($.values()),C.forEach(P=>P())},b=P=>{v=P==null?[]:v.filter(T=>T!==P),S()},O=P=>{const{toastId:T,onOpen:k,updateId:_,children:A}=P.props,I=_==null;P.staleId&&$.delete(P.staleId),$.set(T,P),v=[...v,P.props.toastId].filter(j=>j!==P.staleId),S(),d(V2(P,I?"added":"updated")),I&&Cn(k)&&k(y.isValidElement(A)&&A.props)};return{id:u,props:w,observe:P=>(C.add(P),()=>C.delete(P)),toggle:(P,T)=>{$.forEach(k=>{T!=null&&T!==k.props.toastId||Cn(k.toggle)&&k.toggle(P)})},removeToast:b,toasts:$,clearQueue:()=>{h-=g.length,g=[]},buildToast:(P,T)=>{if((te=>{let{containerId:le,toastId:re,updateId:ae}=te;const xe=le?le!==u:u!==1,Me=$.has(re)&&ae==null;return xe||Me})(T))return;const{toastId:k,updateId:_,data:A,staleId:I,delay:j}=T,M=()=>{b(k)},D=_==null;D&&h++;const L={...w,style:w.toastStyle,key:p++,...Object.fromEntries(Object.entries(T).filter(te=>{let[le,re]=te;return re!=null})),toastId:k,updateId:_,data:A,closeToast:M,isIn:!1,className:vc(T.className||w.toastClassName),bodyClassName:vc(T.bodyClassName||w.bodyClassName),progressClassName:vc(T.progressClassName||w.progressClassName),autoClose:!T.isLoading&&(B=T.autoClose,F=w.autoClose,B===!1||ol(B)&&B>0?B:F),deleteToast(){const te=$.get(k),{onClose:le,children:re}=te.props;Cn(le)&&le(y.isValidElement(re)&&re.props),d(V2(te,"removed")),$.delete(k),h--,h<0&&(h=0),g.length>0?O(g.shift()):S()}};var B,F;L.closeButton=w.closeButton,T.closeButton===!1||bg(T.closeButton)?L.closeButton=T.closeButton:T.closeButton===!0&&(L.closeButton=!bg(w.closeButton)||w.closeButton);let Z=P;y.isValidElement(P)&&!Ko(P.type)?Z=y.cloneElement(P,{closeToast:M,toastProps:L,data:A}):Cn(P)&&(Z=P({closeToast:M,toastProps:L,data:A}));const ie={content:Z,props:L,staleId:I};w.limit&&w.limit>0&&h>w.limit&&D?g.push(ie):ol(j)?setTimeout(()=>{O(ie)},j):O(ie)},setProps(P){w=P},setToggle:(P,T)=>{$.get(P).toggle=T},isToastActive:P=>v.some(T=>T===P),getSnapshot:()=>w.newestOnTop?x.reverse():x}}(a,i,Vce);an.set(a,l);const c=l.observe(s);return il.forEach(u=>nO(u.content,u.options)),il=[],()=>{c(),an.delete(a)}},setProps(s){var l;(l=an.get(a))==null||l.setProps(s)},getSnapshot(){var s;return(s=an.get(a))==null?void 0:s.getSnapshot()}}}(e)).current;r(e);const o=y.useSyncExternalStore(t,n,n);return{getToastToRender:function(i){if(!o)return[];const a=new Map;return o.forEach(s=>{const{position:l}=s.props;a.has(l)||a.set(l,[]),a.get(l).push(s)}),Array.from(a,s=>i(s[0],s[1]))},isToastActive:tO,count:o==null?void 0:o.length}}function Uce(e){const[t,n]=y.useState(!1),[r,o]=y.useState(!1),i=y.useRef(null),a=y.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:s,pauseOnHover:l,closeToast:c,onClick:u,closeOnClick:f}=e;var d,p;function h(){n(!0)}function g(){n(!1)}function v($){const C=i.current;a.canDrag&&C&&(a.didMove=!0,t&&g(),a.delta=e.draggableDirection==="x"?$.clientX-a.start:$.clientY-a.start,a.start!==$.clientX&&(a.canCloseOnClick=!1),C.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,C.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function x(){document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",x);const $=i.current;if(a.canDrag&&a.didMove&&$){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();$.style.transition="transform 0.2s, opacity 0.2s",$.style.removeProperty("transform"),$.style.removeProperty("opacity")}}(p=an.get((d={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||p.setToggle(d.id,d.fn),y.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||g(),window.addEventListener("focus",h),window.addEventListener("blur",g),()=>{window.removeEventListener("focus",h),window.removeEventListener("blur",g)}},[e.pauseOnFocusLoss]);const w={onPointerDown:function($){if(e.draggable===!0||e.draggable===$.pointerType){a.didMove=!1,document.addEventListener("pointermove",v),document.addEventListener("pointerup",x);const C=i.current;a.canCloseOnClick=!0,a.canDrag=!0,C.style.transition="none",e.draggableDirection==="x"?(a.start=$.clientX,a.removalDistance=C.offsetWidth*(e.draggablePercent/100)):(a.start=$.clientY,a.removalDistance=C.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function($){const{top:C,bottom:S,left:b,right:O}=i.current.getBoundingClientRect();$.nativeEvent.type!=="touchend"&&e.pauseOnHover&&$.clientX>=b&&$.clientX<=O&&$.clientY>=C&&$.clientY<=S?g():h()}};return s&&l&&(w.onMouseEnter=g,e.stacked||(w.onMouseLeave=h)),f&&(w.onClick=$=>{u&&u($),a.canCloseOnClick&&c()}),{playToast:h,pauseToast:g,isRunning:t,preventExitTransition:r,toastRef:i,eventHandlers:w}}function Gce(e){let{delay:t,isRunning:n,closeToast:r,type:o="default",hide:i,className:a,style:s,controlledProgress:l,progress:c,rtl:u,isIn:f,theme:d}=e;const p=i||l&&c===0,h={...s,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};l&&(h.transform=`scaleX(${c})`);const g=ho("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${o}`,{"Toastify__progress-bar--rtl":u}),v=Cn(a)?a({rtl:u,type:o,defaultClassName:g}):ho(g,a),x={[l&&c>=1?"onTransitionEnd":"onAnimationEnd"]:l&&c<1?null:()=>{f&&r()}};return E.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},E.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${d} Toastify__progress-bar--${o}`}),E.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:v,style:h,...x}))}let Kce=1;const rO=()=>""+Kce++;function qce(e){return e&&(Ko(e.toastId)||ol(e.toastId))?e.toastId:rO()}function ds(e,t){return nO(e,t),t.toastId}function zu(e,t){return{...t,type:t&&t.type||e,toastId:qce(t)}}function cc(e){return(t,n)=>ds(t,zu(e,n))}function ht(e,t){return ds(e,zu("default",t))}ht.loading=(e,t)=>ds(e,zu("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),ht.promise=function(e,t,n){let r,{pending:o,error:i,success:a}=t;o&&(r=Ko(o)?ht.loading(o,n):ht.loading(o.render,{...n,...o}));const s={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(u,f,d)=>{if(f==null)return void ht.dismiss(r);const p={type:u,...s,...n,data:d},h=Ko(f)?{render:f}:f;return r?ht.update(r,{...p,...h}):ht(h.render,{...p,...h}),d},c=Cn(e)?e():e;return c.then(u=>l("success",a,u)).catch(u=>l("error",i,u)),c},ht.success=cc("success"),ht.info=cc("info"),ht.error=cc("error"),ht.warning=cc("warning"),ht.warn=ht.warning,ht.dark=(e,t)=>ds(e,zu("default",{theme:"dark",...t})),ht.dismiss=function(e){(function(t){var n;if(eO()){if(t==null||Ko(n=t)||ol(n))an.forEach(o=>{o.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){var r;(r=an.get(t.containerId))!=null&&r.removeToast(t.id)||an.forEach(o=>{o.removeToast(t.id)})}}else il=il.filter(o=>t!=null&&o.options.toastId!==t)})(e)},ht.clearWaitingQueue=function(e){e===void 0&&(e={}),an.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},ht.isActive=tO,ht.update=function(e,t){t===void 0&&(t={});const n=((r,o)=>{var i;let{containerId:a}=o;return(i=an.get(a||1))==null?void 0:i.toasts.get(r)})(e,t);if(n){const{props:r,content:o}=n,i={delay:100,...r,...t,toastId:t.toastId||e,updateId:rO()};i.toastId!==e&&(i.staleId=e);const a=i.render||o;delete i.render,ds(a,i)}},ht.done=e=>{ht.update(e,{progress:1})},ht.onChange=function(e){return xg.add(e),()=>{xg.delete(e)}},ht.play=e=>H2(!0,e),ht.pause=e=>H2(!1,e);const Xce=typeof window<"u"?y.useLayoutEffect:y.useEffect,uc=e=>{let{theme:t,type:n,isLoading:r,...o}=e;return E.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...o})},xp={info:function(e){return E.createElement(uc,{...e},E.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return E.createElement(uc,{...e},E.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return E.createElement(uc,{...e},E.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return E.createElement(uc,{...e},E.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return E.createElement("div",{className:"Toastify__spinner"})}},Yce=e=>{const{isRunning:t,preventExitTransition:n,toastRef:r,eventHandlers:o,playToast:i}=Uce(e),{closeButton:a,children:s,autoClose:l,onClick:c,type:u,hideProgressBar:f,closeToast:d,transition:p,position:h,className:g,style:v,bodyClassName:x,bodyStyle:w,progressClassName:$,progressStyle:C,updateId:S,role:b,progress:O,rtl:P,toastId:T,deleteToast:k,isIn:_,isLoading:A,closeOnClick:I,theme:j}=e,M=ho("Toastify__toast",`Toastify__toast-theme--${j}`,`Toastify__toast--${u}`,{"Toastify__toast--rtl":P},{"Toastify__toast--close-on-click":I}),D=Cn(g)?g({rtl:P,position:h,type:u,defaultClassName:M}):ho(M,g),L=function(ie){let{theme:te,type:le,isLoading:re,icon:ae}=ie,xe=null;const Me={theme:te,type:le};return ae===!1||(Cn(ae)?xe=ae({...Me,isLoading:re}):y.isValidElement(ae)?xe=y.cloneElement(ae,Me):re?xe=xp.spinner():(we=>we in xp)(le)&&(xe=xp[le](Me))),xe}(e),B=!!O||!l,F={closeToast:d,type:u,theme:j};let Z=null;return a===!1||(Z=Cn(a)?a(F):y.isValidElement(a)?y.cloneElement(a,F):function(ie){let{closeToast:te,theme:le,ariaLabel:re="close"}=ie;return E.createElement("button",{className:`Toastify__close-button Toastify__close-button--${le}`,type:"button",onClick:ae=>{ae.stopPropagation(),te(ae)},"aria-label":re},E.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},E.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(F)),E.createElement(p,{isIn:_,done:k,position:h,preventExitTransition:n,nodeRef:r,playToast:i},E.createElement("div",{id:T,onClick:c,"data-in":_,className:D,...o,style:v,ref:r},E.createElement("div",{..._&&{role:b},className:Cn(x)?x({type:u}):ho("Toastify__toast-body",x),style:w},L!=null&&E.createElement("div",{className:ho("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!A})},L),E.createElement("div",null,s)),Z,E.createElement(Gce,{...S&&!B?{key:`pb-${S}`}:{},rtl:P,theme:j,delay:l,isRunning:t,isIn:_,closeToast:d,hide:f,type:u,style:C,className:$,controlledProgress:B,progress:O||0})))},nd=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},Zce=td(nd("bounce",!0));td(nd("slide",!0));td(nd("zoom"));td(nd("flip"));const Qce={position:"top-right",transition:Zce,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function Jce(e){let t={...Qce,...e};const n=e.stacked,[r,o]=y.useState(!0),i=y.useRef(null),{getToastToRender:a,isToastActive:s,count:l}=Hce(t),{className:c,style:u,rtl:f,containerId:d}=t;function p(g){const v=ho("Toastify__toast-container",`Toastify__toast-container--${g}`,{"Toastify__toast-container--rtl":f});return Cn(c)?c({position:g,rtl:f,defaultClassName:v}):ho(v,vc(c))}function h(){n&&(o(!0),ht.play())}return Xce(()=>{if(n){var g;const v=i.current.querySelectorAll('[data-in="true"]'),x=12,w=(g=t.position)==null?void 0:g.includes("top");let $=0,C=0;Array.from(v).reverse().forEach((S,b)=>{const O=S;O.classList.add("Toastify__toast--stacked"),b>0&&(O.dataset.collapsed=`${r}`),O.dataset.pos||(O.dataset.pos=w?"top":"bot");const P=$*(r?.2:1)+(r?0:x*b);O.style.setProperty("--y",`${w?P:-1*P}px`),O.style.setProperty("--g",`${x}`),O.style.setProperty("--s",""+(1-(r?C:0))),$+=O.offsetHeight,C+=.025})}},[r,l,n]),E.createElement("div",{ref:i,className:"Toastify",id:d,onMouseEnter:()=>{n&&(o(!1),ht.pause())},onMouseLeave:h},a((g,v)=>{const x=v.length?{...u}:{...u,pointerEvents:"none"};return E.createElement("div",{className:p(g),style:x,key:`container-${g}`},v.map(w=>{let{content:$,props:C}=w;return E.createElement(Yce,{...C,stacked:n,collapseAll:h,isIn:s(C.toastId,C.containerId),style:C.style,key:`toast-${C.key}`},$)}))}))}const eue=X(Jce)` .Toastify__toast { background-color: #49c998ff; width: fit-content; @@ -1665,15 +1665,15 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho top: 60px; right: 48px; } -`,Jce=X(ee)` +`,tue=X(ee)` height: 100%; width: 100%; background-color: ${K.black}; -`,eue=X(ee)` +`,nue=X(ee)` position: absolute; bottom: 8px; left: 8px; color: ${K.white}; font-size: 12px; opacity: 0.5; -`,tue=y.lazy(()=>hn(()=>import("./index-cb90f054.js"),["assets/index-cb90f054.js","assets/index-0cb90706.js","assets/index-a2878e02.css","assets/AddContentIcon-d2758ba1.js"]).then(({MainToolbar:e})=>({default:e}))),nue=y.lazy(()=>hn(()=>import("./index-9e4e320f.js"),["assets/index-9e4e320f.js","assets/index-0cb90706.js","assets/index-a2878e02.css","assets/index-fc41172c.js","assets/three.module-a2e04964.js"]).then(({Universe:e})=>({default:e}))),rue=y.lazy(()=>hn(()=>import("./index-cf45412f.js").then(e=>e.i),["assets/index-cf45412f.js","assets/index-0cb90706.js","assets/index-a2878e02.css","assets/Skeleton-b299e336.js","assets/index-6125620a.css"]).then(({SideBar:e})=>({default:e}))),oue=()=>{const[e,t]=sa(_=>[_.setBudget,_.setNodeCount]),{setSidebarOpen:n,currentSearch:r,setCurrentSearch:o,setRelevanceSelected:i,setTranscriptOpen:a}=Yr(_=>_),s=fB(_=>_.setTeachMeAnswer),{fetchData:l,setCategoryFilter:c,setAbortRequests:u,addNewNode:f,filters:d}=Qo(_=>_),{setAiSummaryAnswer:p,getKeyExist:h}=tE(_=>_),g=X2(),[v,x]=wg(_=>[_.realtimeGraphFeatureFlag,_.chatInterfaceFeatureFlag]),w=cB(),$=Cl({mode:"onChange"}),C=$.handleSubmit(({search:_})=>{a(!1),g(null),i(!1),o(_),s(""),c(null)}),S=y.useCallback(async()=>{await l(e,u),n(!0),r?await iw(e):g(null)},[l,e,r,n,g,u]);y.useEffect(()=>{S()},[r,S,d]);const b=y.useCallback(()=>{t("INCREMENT")},[t]),O=y.useCallback(_=>{console.log(_),_.question&&h(_.question)&&p(_.question,{answer:_.answer,answerLoading:!1})},[p,h]),P=y.useCallback(_=>{_.question&&h(_.question)&&p(_.question,{questions:_.relevant_questions.map(A=>A.question),questionsLoading:!1})},[p,h]),T=y.useCallback(_=>{_.question&&h(_.question)&&p(_.question,{sources:_.sources.map(A=>A.ref_id),sourcesLoading:!1})},[p,h]),k=y.useCallback(_=>{f(_)},[f]);return y.useEffect(()=>(w&&(w.connect(),w.on("connect_error",_=>{console.error("Socket connection error:",_)}),w.on("newnode",b),x&&w.on("askquestionhook",O),x&&w.on("relevantquestionshook",P),x&&w.on("answersourceshook",T),v&&w.on("new_node_created",k)),()=>{w&&w.off()}),[w,b,k,v,O,x,P,T]),m.jsxs(m.Fragment,{children:[m.jsx(bL,{}),m.jsx(AB,{}),m.jsx(TS,{hidden:!nE}),m.jsx(y.Suspense,{fallback:m.jsx("div",{children:"Loading..."}),children:m.jsxs(Jce,{direction:"row",children:[m.jsx(yL,{children:m.jsxs($l,{...$,children:[m.jsx(tue,{}),m.jsx(rue,{onSubmit:C}),m.jsx(nue,{}),!1,m.jsx(eB,{}),m.jsx(Nce,{}),m.jsx(OB,{}),m.jsxs(eue,{children:["v",dB]}),m.jsx(KS,{})]})}),m.jsx(CB,{}),m.jsx(Qce,{}),m.jsx(MB,{})]})})]})},Tue=Object.freeze(Object.defineProperty({__proto__:null,App:oue},Symbol.toStringTag,{value:"Module"}));export{Je as $,GS as A,_r as B,PL as C,gF as D,EV as E,mo as F,lt as G,mu as H,jm as I,Pl as J,Qe as K,j7 as L,cy as M,Pt as N,eB as O,qB as P,Yc as Q,Gr as R,Iie as S,eP as T,er as U,Vf as V,Wn as W,Pn as X,_ue as Y,Jh as Z,ya as _,pue as a,lw as a$,yo as a0,Br as a1,Ix as a2,jl as a3,EC as a4,_ce as a5,Zf as a6,Qf as a7,lse as a8,t7 as a9,U8 as aA,DL as aB,IL as aC,ML as aD,Ut as aE,vm as aF,EL as aG,kL as aH,Gc as aI,Xa as aJ,QT as aK,G_ as aL,LB as aM,Pue as aN,ym as aO,f$ as aP,Cue as aQ,hW as aR,r$ as aS,hm as aT,Kg as aU,u$ as aV,c$ as aW,l$ as aX,sr as aY,$ue as aZ,pa as a_,y$ as aa,ei as ab,Vg as ac,Sl as ad,Cl as ae,$l as af,i$ as ag,rE as ah,js as ai,Qb as aj,eee as ak,A7 as al,B_ as am,cB as an,fB as ao,Kw as ap,sB as aq,wue as ar,mv as as,Bo as at,Gf as au,xue as av,bue as aw,Sue as ax,yr as ay,pz as az,IF as b,gue as b0,Eue as b1,Oue as b2,Dk as b3,aue as b4,ht as b5,NB as b6,Tue as b7,mue as c,Bz as d,yue as e,ZS as f,of as g,vue as h,hue as i,Qa as j,pE as k,It as l,Sr as m,Sn as n,Jt as o,dw as p,ki as q,xc as r,ir as s,Io as t,OL as u,oE as v,Q0 as w,BQ as x,_f as y,ah as z}; +`,rue=y.lazy(()=>hn(()=>import("./index-59ea340d.js"),["assets/index-59ea340d.js","assets/index-ead79979.js","assets/index-a2878e02.css","assets/AddContentIcon-8ff66903.js"]).then(({MainToolbar:e})=>({default:e}))),oue=y.lazy(()=>hn(()=>import("./index-0dc61e70.js"),["assets/index-0dc61e70.js","assets/index-ead79979.js","assets/index-a2878e02.css","assets/index-8d2e6a42.js","assets/three.module-a2e04964.js"]).then(({Universe:e})=>({default:e}))),iue=y.lazy(()=>hn(()=>import("./index-b0542bac.js").then(e=>e.i),["assets/index-b0542bac.js","assets/index-ead79979.js","assets/index-a2878e02.css","assets/Skeleton-63ee525b.js","assets/index-6125620a.css"]).then(({SideBar:e})=>({default:e}))),aue=()=>{const[e,t]=sa(_=>[_.setBudget,_.setNodeCount]),{setSidebarOpen:n,currentSearch:r,setCurrentSearch:o,setRelevanceSelected:i,setTranscriptOpen:a}=Yr(_=>_),s=fB(_=>_.setTeachMeAnswer),{fetchData:l,setCategoryFilter:c,setAbortRequests:u,addNewNode:f,filters:d}=Qo(_=>_),{setAiSummaryAnswer:p,getKeyExist:h}=tE(_=>_),g=X2(),[v,x]=wg(_=>[_.realtimeGraphFeatureFlag,_.chatInterfaceFeatureFlag]),w=cB(),$=Cl({mode:"onChange"}),C=$.handleSubmit(({search:_})=>{a(!1),g(null),i(!1),o(_),s(""),c(null)}),S=y.useCallback(async()=>{await l(e,u),n(!0),r?await iw(e):g(null)},[l,e,r,n,g,u]);y.useEffect(()=>{S()},[r,S,d]);const b=y.useCallback(()=>{t("INCREMENT")},[t]),O=y.useCallback(_=>{console.log(_),_.question&&h(_.question)&&p(_.question,{answer:_.answer,answerLoading:!1})},[p,h]),P=y.useCallback(_=>{_.question&&h(_.question)&&p(_.question,{questions:_.relevant_questions.map(A=>A.question),questionsLoading:!1})},[p,h]),T=y.useCallback(_=>{_.question&&h(_.question)&&p(_.question,{sources:_.sources.map(A=>A.ref_id),sourcesLoading:!1})},[p,h]),k=y.useCallback(_=>{f(_)},[f]);return y.useEffect(()=>(w&&(w.connect(),w.on("connect_error",_=>{console.error("Socket connection error:",_)}),w.on("newnode",b),x&&w.on("askquestionhook",O),x&&w.on("relevantquestionshook",P),x&&w.on("answersourceshook",T),v&&w.on("new_node_created",k)),()=>{w&&w.off()}),[w,b,k,v,O,x,P,T]),m.jsxs(m.Fragment,{children:[m.jsx(bL,{}),m.jsx(AB,{}),m.jsx(TS,{hidden:!nE}),m.jsx(y.Suspense,{fallback:m.jsx("div",{children:"Loading..."}),children:m.jsxs(tue,{direction:"row",children:[m.jsx(yL,{children:m.jsxs($l,{...$,children:[m.jsx(rue,{}),m.jsx(iue,{onSubmit:C}),m.jsx(oue,{}),!1,m.jsx(eB,{}),m.jsx(Bce,{}),m.jsx(OB,{}),m.jsxs(nue,{children:["v",dB]}),m.jsx(KS,{})]})}),m.jsx(CB,{}),m.jsx(eue,{}),m.jsx(MB,{})]})})]})},kue=Object.freeze(Object.defineProperty({__proto__:null,App:aue},Symbol.toStringTag,{value:"Module"}));export{eg as $,GS as A,_r as B,PL as C,gF as D,sh as E,_V as F,mo as G,lt as H,mu as I,jm as J,Pl as K,j7 as L,cy as M,Qe as N,eB as O,qB as P,Pt as Q,Yc as R,Rie as S,eP as T,Gr as U,er as V,Hf as W,Wn as X,Pn as Y,Aue as Z,ya as _,gue as a,pa as a$,Je as a0,yo as a1,Br as a2,Ix as a3,jl as a4,EC as a5,Ace as a6,Qf as a7,Jf as a8,use as a9,gz as aA,U8 as aB,DL as aC,IL as aD,ML as aE,Ut as aF,vm as aG,EL as aH,kL as aI,Gc as aJ,Xa as aK,QT as aL,G_ as aM,LB as aN,Tue as aO,ym as aP,f$ as aQ,Eue as aR,mW as aS,r$ as aT,hm as aU,Kg as aV,u$ as aW,c$ as aX,l$ as aY,sr as aZ,Oue as a_,t7 as aa,y$ as ab,ei as ac,Vg as ad,Sl as ae,Cl as af,$l as ag,i$ as ah,rE as ai,js as aj,Qb as ak,nee as al,A7 as am,B_ as an,cB as ao,fB as ap,Kw as aq,sB as ar,$ue as as,mv as at,Bo as au,Kf as av,Sue as aw,wue as ax,Cue as ay,yr as az,RF as b,lw as b0,vue as b1,_ue as b2,Pue as b3,Dk as b4,lue as b5,ht as b6,NB as b7,kue as b8,MF as c,yue as d,zz as e,xue as f,ZS as g,af as h,bue as i,mue as j,Qa as k,pE as l,It as m,Sr as n,Sn as o,Jt as p,dw as q,ki as r,xc as s,ir as t,OL as u,oE as v,Io as w,Q0 as x,zQ as y,Tf as z}; diff --git a/build/assets/index-63f7725b.js b/build/assets/index-81df59d9.js similarity index 50% rename from build/assets/index-63f7725b.js rename to build/assets/index-81df59d9.js index 32eb6ffb0..5f60ea333 100644 --- a/build/assets/index-63f7725b.js +++ b/build/assets/index-81df59d9.js @@ -1,16 +1,16 @@ -import{o as nt,p as st,s as pe,a as U,E as ao,r as x,_ as rt,j as s,v as it,q as de,n as at,t as Lt,D as co,f as Fe,h as ct,x as xt,J as lo,K as uo,Y as po,Q as F,U as v,S as V,ar as Re,bC as Wt,a5 as q,ad as Yt,ax as Be,bA as ge,bD as Ut,b9 as bt,b8 as yt,b7 as wt,b6 as jt,b5 as fo,b2 as ho,bG as mo,bH as go,bI as xo,bt as vt}from"./index-0cb90706.js";import{q as bo,j as yo,a_ as wo,a$ as jo,b0 as vo,ad as Eo,aE as ue,aJ as De,aO as Ve,b1 as Et,ay as Po,D as Co,B as Ce,P as To,b2 as Gt,ae as lt,ab as Ht,af as Kt,b3 as Oo,aP as So,aF as Ao}from"./index-7a7c9631.js";import{p as Xt,c as Mo,g as ko}from"./index-bbc7c996.js";import{g as _o,m as $o,u as ne,b as Le,t as ot,T as Zt,i as qt,H as Io,j as Pt,C as No,P as zo,k as Ro}from"./index-fc41172c.js";import{X as Bo,Y as Do,E as Vo,V as $,Z as he,_ as me,$ as Ct,P as Ie,a0 as Ne,a1 as Tt,a as ee,a2 as Fo,G as Lo,C as Wo}from"./three.module-a2e04964.js";import{A as Ot}from"./AddContentIcon-d2758ba1.js";function Yo(t){return nt("PrivateSwitchBase",t)}st("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Uo=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Go=t=>{const{classes:o,checked:n,disabled:e,edge:a}=t,c={root:["root",n&&"checked",e&&"disabled",a&&`edge${de(a)}`],input:["input"]};return at(c,Yo,o)},Ho=pe(bo)(({ownerState:t})=>U({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),Ko=pe("input",{shouldForwardProp:ao})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Xo=x.forwardRef(function(o,n){const{autoFocus:e,checked:a,checkedIcon:c,className:d,defaultChecked:i,disabled:l,disableFocusRipple:j=!1,edge:u=!1,icon:f,id:h,inputProps:b,inputRef:m,name:S,onBlur:T,onChange:y,onFocus:E,readOnly:_,required:M=!1,tabIndex:w,type:g,value:P}=o,k=rt(o,Uo),[R,A]=yo({controlled:a,default:!!i,name:"SwitchBase",state:"checked"}),D=wo(),oe=H=>{E&&E(H),D&&D.onFocus&&D.onFocus(H)},N=H=>{T&&T(H),D&&D.onBlur&&D.onBlur(H)},X=H=>{if(H.nativeEvent.defaultPrevented)return;const G=H.target.checked;A(G),y&&y(H,G)};let L=l;D&&typeof L>"u"&&(L=D.disabled);const Q=g==="checkbox"||g==="radio",J=U({},o,{checked:R,disabled:L,disableFocusRipple:j,edge:u}),Z=Go(J);return s.jsxs(Ho,U({component:"span",className:it(Z.root,d),centerRipple:!0,focusRipple:!j,disabled:L,tabIndex:null,role:void 0,onFocus:oe,onBlur:N,ownerState:J,ref:n},k,{children:[s.jsx(Ko,U({autoFocus:e,checked:a,defaultChecked:i,className:Z.input,disabled:L,id:Q?h:void 0,name:S,onChange:X,readOnly:_,ref:m,required:M,ownerState:J,tabIndex:w,type:g},g==="checkbox"&&P===void 0?{}:{value:P},b)),R?c:f]}))}),Zo=Xo,qo=x.createContext(),St=qo;function Qo(t){return nt("MuiGrid",t)}const Jo=[0,1,2,3,4,5,6,7,8,9,10],en=["column-reverse","column","row-reverse","row"],tn=["nowrap","wrap-reverse","wrap"],Ee=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],on=st("MuiGrid",["root","container","item","zeroMinWidth",...Jo.map(t=>`spacing-xs-${t}`),...en.map(t=>`direction-xs-${t}`),...tn.map(t=>`wrap-xs-${t}`),...Ee.map(t=>`grid-xs-${t}`),...Ee.map(t=>`grid-sm-${t}`),...Ee.map(t=>`grid-md-${t}`),...Ee.map(t=>`grid-lg-${t}`),...Ee.map(t=>`grid-xl-${t}`)]),Pe=on,nn=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function xe(t){const o=parseFloat(t);return`${o}${String(t).replace(String(o),"")||"px"}`}function sn({theme:t,ownerState:o}){let n;return t.breakpoints.keys.reduce((e,a)=>{let c={};if(o[a]&&(n=o[a]),!n)return e;if(n===!0)c={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")c={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const d=Fe({values:o.columns,breakpoints:t.breakpoints.values}),i=typeof d=="object"?d[a]:d;if(i==null)return e;const l=`${Math.round(n/i*1e8)/1e6}%`;let j={};if(o.container&&o.item&&o.columnSpacing!==0){const u=t.spacing(o.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${xe(u)})`;j={flexBasis:f,maxWidth:f}}}c=U({flexBasis:l,flexGrow:0,maxWidth:l},j)}return t.breakpoints.values[a]===0?Object.assign(e,c):e[t.breakpoints.up(a)]=c,e},{})}function rn({theme:t,ownerState:o}){const n=Fe({values:o.direction,breakpoints:t.breakpoints.values});return ct({theme:t},n,e=>{const a={flexDirection:e};return e.indexOf("column")===0&&(a[`& > .${Pe.item}`]={maxWidth:"none"}),a})}function Qt({breakpoints:t,values:o}){let n="";Object.keys(o).forEach(a=>{n===""&&o[a]!==0&&(n=a)});const e=Object.keys(t).sort((a,c)=>t[a]-t[c]);return e.slice(0,e.indexOf(n))}function an({theme:t,ownerState:o}){const{container:n,rowSpacing:e}=o;let a={};if(n&&e!==0){const c=Fe({values:e,breakpoints:t.breakpoints.values});let d;typeof c=="object"&&(d=Qt({breakpoints:t.breakpoints.values,values:c})),a=ct({theme:t},c,(i,l)=>{var j;const u=t.spacing(i);return u!=="0px"?{marginTop:`-${xe(u)}`,[`& > .${Pe.item}`]:{paddingTop:xe(u)}}:(j=d)!=null&&j.includes(l)?{}:{marginTop:0,[`& > .${Pe.item}`]:{paddingTop:0}}})}return a}function cn({theme:t,ownerState:o}){const{container:n,columnSpacing:e}=o;let a={};if(n&&e!==0){const c=Fe({values:e,breakpoints:t.breakpoints.values});let d;typeof c=="object"&&(d=Qt({breakpoints:t.breakpoints.values,values:c})),a=ct({theme:t},c,(i,l)=>{var j;const u=t.spacing(i);return u!=="0px"?{width:`calc(100% + ${xe(u)})`,marginLeft:`-${xe(u)}`,[`& > .${Pe.item}`]:{paddingLeft:xe(u)}}:(j=d)!=null&&j.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${Pe.item}`]:{paddingLeft:0}}})}return a}function ln(t,o,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const e=[];return o.forEach(a=>{const c=t[a];Number(c)>0&&e.push(n[`spacing-${a}-${String(c)}`])}),e}const dn=pe("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:n}=t,{container:e,direction:a,item:c,spacing:d,wrap:i,zeroMinWidth:l,breakpoints:j}=n;let u=[];e&&(u=ln(d,j,o));const f=[];return j.forEach(h=>{const b=n[h];b&&f.push(o[`grid-${h}-${String(b)}`])}),[o.root,e&&o.container,c&&o.item,l&&o.zeroMinWidth,...u,a!=="row"&&o[`direction-xs-${String(a)}`],i!=="wrap"&&o[`wrap-xs-${String(i)}`],...f]}})(({ownerState:t})=>U({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),rn,an,cn,sn);function un(t,o){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return o.forEach(e=>{const a=t[e];if(Number(a)>0){const c=`spacing-${e}-${String(a)}`;n.push(c)}}),n}const pn=t=>{const{classes:o,container:n,direction:e,item:a,spacing:c,wrap:d,zeroMinWidth:i,breakpoints:l}=t;let j=[];n&&(j=un(c,l));const u=[];l.forEach(h=>{const b=t[h];b&&u.push(`grid-${h}-${String(b)}`)});const f={root:["root",n&&"container",a&&"item",i&&"zeroMinWidth",...j,e!=="row"&&`direction-xs-${String(e)}`,d!=="wrap"&&`wrap-xs-${String(d)}`,...u]};return at(f,Qo,o)},fn=x.forwardRef(function(o,n){const e=Lt({props:o,name:"MuiGrid"}),{breakpoints:a}=co(),c=jo(e),{className:d,columns:i,columnSpacing:l,component:j="div",container:u=!1,direction:f="row",item:h=!1,rowSpacing:b,spacing:m=0,wrap:S="wrap",zeroMinWidth:T=!1}=c,y=rt(c,nn),E=b||m,_=l||m,M=x.useContext(St),w=u?i||12:M,g={},P=U({},y);a.keys.forEach(A=>{y[A]!=null&&(g[A]=y[A],delete P[A])});const k=U({},c,{columns:w,container:u,direction:f,item:h,rowSpacing:E,columnSpacing:_,wrap:S,zeroMinWidth:T,spacing:m},g,{breakpoints:a.keys}),R=pn(k);return s.jsx(St.Provider,{value:w,children:s.jsx(dn,U({ownerState:k,className:it(R.root,d),as:j,ref:n},P))})}),ce=fn;function hn(t){return nt("MuiSwitch",t)}const mn=st("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),K=mn,gn=["className","color","edge","size","sx"],xn=t=>{const{classes:o,edge:n,size:e,color:a,checked:c,disabled:d}=t,i={root:["root",n&&`edge${de(n)}`,`size${de(e)}`],switchBase:["switchBase",`color${de(a)}`,c&&"checked",d&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=at(i,hn,o);return U({},o,l)},bn=pe("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:n}=t;return[o.root,n.edge&&o[`edge${de(n.edge)}`],o[`size${de(n.size)}`]]}})(({ownerState:t})=>U({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},t.edge==="start"&&{marginLeft:-8},t.edge==="end"&&{marginRight:-8},t.size==="small"&&{width:40,height:24,padding:7,[`& .${K.thumb}`]:{width:16,height:16},[`& .${K.switchBase}`]:{padding:4,[`&.${K.checked}`]:{transform:"translateX(16px)"}}})),yn=pe(Zo,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,o)=>{const{ownerState:n}=t;return[o.switchBase,{[`& .${K.input}`]:o.input},n.color!=="default"&&o[`color${de(n.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${K.checked}`]:{transform:"translateX(20px)"},[`&.${K.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${K.checked} + .${K.track}`]:{opacity:.5},[`&.${K.disabled} + .${K.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${K.input}`]:{left:"-100%",width:"300%"}}),({theme:t,ownerState:o})=>U({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:xt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},o.color!=="default"&&{[`&.${K.checked}`]:{color:(t.vars||t).palette[o.color].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[o.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:xt(t.palette[o.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${K.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${o.color}DisabledColor`]:`${t.palette.mode==="light"?lo(t.palette[o.color].main,.62):uo(t.palette[o.color].main,.55)}`}},[`&.${K.checked} + .${K.track}`]:{backgroundColor:(t.vars||t).palette[o.color].main}})),wn=pe("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,o)=>o.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),jn=pe("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,o)=>o.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),vn=x.forwardRef(function(o,n){const e=Lt({props:o,name:"MuiSwitch"}),{className:a,color:c="primary",edge:d=!1,size:i="medium",sx:l}=e,j=rt(e,gn),u=U({},e,{color:c,edge:d,size:i}),f=xn(u),h=s.jsx(jn,{className:f.thumb,ownerState:u});return s.jsxs(bn,{className:it(f.root,a),sx:l,ownerState:u,children:[s.jsx(yn,U({type:"checkbox",icon:h,checkedIcon:h,ref:n,ownerState:u},j,{classes:U({},f,{root:f.switchBase})})),s.jsx(wn,{className:f.track,ownerState:u})]})}),En=vn,Pn={schemas:[],links:[]},Jt=po(t=>({...Pn,setSchemas:o=>{t({schemas:o.map(n=>{var e;return{...n,ref_id:((e=n==null?void 0:n.attributes)==null?void 0:e.ref_id)||""}})})},setSchemaLinks:o=>{t({links:o})}})),Cn=/^[a-z0-9_]+$/,Tn=({parentParam:t,onDelete:o})=>{const[n,e]=x.useState(!1),[a,c]=x.useState([]),{fields:d,append:i,replace:l,remove:j}=vo({name:"attributes"}),{setValue:u,watch:f}=Eo();return x.useEffect(()=>{const h=async()=>{try{let b=[{required:!1,type:"string",key:""}];if(t!==Gt.value.toLowerCase()){e(!0);const m=await Wt(t);b=Xt(m)}b=b.filter(m=>m.key!=="node_key"),l(b),c(b)}catch(b){console.warn(b)}finally{e(!1)}};a.length===0&&h()},[t,u,l,a.length]),s.jsxs(s.Fragment,{children:[n?s.jsx(v,{align:"center",children:s.jsx(ue,{color:V.SECONDARY_BLUE,size:"30"})}):s.jsx(On,{py:8,children:s.jsx(ce,{container:!0,spacing:2,children:d.map((h,b)=>{const m=f(`attributes[${b}].type`),S=f(`attributes[${b}].required`),T=h.isNew||!1,y=["name"].includes(f(`attributes[${b}].key`));return s.jsxs(x.Fragment,{children:[s.jsx(ce,{item:!0,xs:5,children:s.jsx(De,{autoComplete:"off",className:"text-input",disabled:!T,id:"cy-item-name",maxLength:50,name:`attributes.${b}.key`,placeholder:"Enter value",rules:{...Re,pattern:{message:"Please avoid special characters, spaces and uppercase",value:Cn}}})}),s.jsx(ce,{item:!0,xs:4,children:s.jsx(Ve,{disabled:y,onSelect:E=>u(`attributes[${b}].type`,E==null?void 0:E.value),options:Et,selectedValue:Et.find(E=>E.value===m)})}),s.jsxs(ce,{item:!0,xs:3,children:[s.jsx(En,{checked:S,disabled:y,name:`attributes.${b}.required`,onChange:E=>u(`attributes[${b}].required`,E.target.checked),size:"small"}),!y&&s.jsx(Po,{onClick:()=>{j(b),h.key!==void 0&&o&&o(h.key)},children:s.jsx(Co,{})})]})]},h.id)})})}),s.jsx(v,{align:"flex-start",py:12,children:s.jsx(Ce,{onClick:()=>i({key:"",type:"string",required:!0,isNew:!0}),size:"medium",startIcon:s.jsx(To,{}),variant:"contained",children:"Add Attribute"})})]})},On=F(v)` +import{o as nt,p as st,s as pe,a as Y,E as ao,r as x,_ as rt,j as n,v as it,q as de,n as at,t as Lt,D as co,f as Fe,h as ct,x as xt,J as lo,K as uo,Q as F,U as v,S as V,ar as Re,bC as Wt,a5 as q,ad as Ut,ax as Be,bA as ge,bD as Yt,b9 as bt,b8 as yt,b7 as wt,b6 as jt,b5 as po,b2 as fo,bG as ho,bH as mo,bI as go,bt as vt}from"./index-ead79979.js";import{r as xo,k as bo,a$ as yo,b0 as wo,b1 as jo,ae as vo,aF as ue,aK as De,aP as Ve,b2 as Et,az as Eo,D as Po,B as Ce,P as Co,b3 as Gt,af as lt,ac as Ht,ag as Kt,b4 as To,c as Xt,aQ as Oo,aG as Ao}from"./index-74184c93.js";import{p as Zt,c as Mo,g as So}from"./index-bbc7c996.js";import{g as ko,m as _o,u as ne,b as Le,t as ot,T as qt,i as Qt,H as $o,j as Pt,C as Io,P as No,k as zo}from"./index-8d2e6a42.js";import{X as Ro,Y as Bo,E as Do,V as $,Z as he,_ as me,$ as Ct,P as Ie,a0 as Ne,a1 as Tt,a as ee,a2 as Vo,G as Fo,C as Lo}from"./three.module-a2e04964.js";import{A as Ot}from"./AddContentIcon-8ff66903.js";function Wo(t){return nt("PrivateSwitchBase",t)}st("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Uo=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],Yo=t=>{const{classes:o,checked:s,disabled:e,edge:a}=t,c={root:["root",s&&"checked",e&&"disabled",a&&`edge${de(a)}`],input:["input"]};return at(c,Wo,o)},Go=pe(xo)(({ownerState:t})=>Y({padding:9,borderRadius:"50%"},t.edge==="start"&&{marginLeft:t.size==="small"?-3:-12},t.edge==="end"&&{marginRight:t.size==="small"?-3:-12})),Ho=pe("input",{shouldForwardProp:ao})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Ko=x.forwardRef(function(o,s){const{autoFocus:e,checked:a,checkedIcon:c,className:d,defaultChecked:i,disabled:l,disableFocusRipple:j=!1,edge:u=!1,icon:f,id:h,inputProps:b,inputRef:m,name:A,onBlur:T,onChange:y,onFocus:E,readOnly:_,required:S=!1,tabIndex:w,type:g,value:P}=o,k=rt(o,Uo),[R,M]=bo({controlled:a,default:!!i,name:"SwitchBase",state:"checked"}),D=yo(),oe=H=>{E&&E(H),D&&D.onFocus&&D.onFocus(H)},N=H=>{T&&T(H),D&&D.onBlur&&D.onBlur(H)},X=H=>{if(H.nativeEvent.defaultPrevented)return;const G=H.target.checked;M(G),y&&y(H,G)};let L=l;D&&typeof L>"u"&&(L=D.disabled);const Q=g==="checkbox"||g==="radio",J=Y({},o,{checked:R,disabled:L,disableFocusRipple:j,edge:u}),Z=Yo(J);return n.jsxs(Go,Y({component:"span",className:it(Z.root,d),centerRipple:!0,focusRipple:!j,disabled:L,tabIndex:null,role:void 0,onFocus:oe,onBlur:N,ownerState:J,ref:s},k,{children:[n.jsx(Ho,Y({autoFocus:e,checked:a,defaultChecked:i,className:Z.input,disabled:L,id:Q?h:void 0,name:A,onChange:X,readOnly:_,ref:m,required:S,ownerState:J,tabIndex:w,type:g},g==="checkbox"&&P===void 0?{}:{value:P},b)),R?c:f]}))}),Xo=Ko,Zo=x.createContext(),At=Zo;function qo(t){return nt("MuiGrid",t)}const Qo=[0,1,2,3,4,5,6,7,8,9,10],Jo=["column-reverse","column","row-reverse","row"],en=["nowrap","wrap-reverse","wrap"],Ee=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],tn=st("MuiGrid",["root","container","item","zeroMinWidth",...Qo.map(t=>`spacing-xs-${t}`),...Jo.map(t=>`direction-xs-${t}`),...en.map(t=>`wrap-xs-${t}`),...Ee.map(t=>`grid-xs-${t}`),...Ee.map(t=>`grid-sm-${t}`),...Ee.map(t=>`grid-md-${t}`),...Ee.map(t=>`grid-lg-${t}`),...Ee.map(t=>`grid-xl-${t}`)]),Pe=tn,on=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function xe(t){const o=parseFloat(t);return`${o}${String(t).replace(String(o),"")||"px"}`}function nn({theme:t,ownerState:o}){let s;return t.breakpoints.keys.reduce((e,a)=>{let c={};if(o[a]&&(s=o[a]),!s)return e;if(s===!0)c={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(s==="auto")c={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const d=Fe({values:o.columns,breakpoints:t.breakpoints.values}),i=typeof d=="object"?d[a]:d;if(i==null)return e;const l=`${Math.round(s/i*1e8)/1e6}%`;let j={};if(o.container&&o.item&&o.columnSpacing!==0){const u=t.spacing(o.columnSpacing);if(u!=="0px"){const f=`calc(${l} + ${xe(u)})`;j={flexBasis:f,maxWidth:f}}}c=Y({flexBasis:l,flexGrow:0,maxWidth:l},j)}return t.breakpoints.values[a]===0?Object.assign(e,c):e[t.breakpoints.up(a)]=c,e},{})}function sn({theme:t,ownerState:o}){const s=Fe({values:o.direction,breakpoints:t.breakpoints.values});return ct({theme:t},s,e=>{const a={flexDirection:e};return e.indexOf("column")===0&&(a[`& > .${Pe.item}`]={maxWidth:"none"}),a})}function Jt({breakpoints:t,values:o}){let s="";Object.keys(o).forEach(a=>{s===""&&o[a]!==0&&(s=a)});const e=Object.keys(t).sort((a,c)=>t[a]-t[c]);return e.slice(0,e.indexOf(s))}function rn({theme:t,ownerState:o}){const{container:s,rowSpacing:e}=o;let a={};if(s&&e!==0){const c=Fe({values:e,breakpoints:t.breakpoints.values});let d;typeof c=="object"&&(d=Jt({breakpoints:t.breakpoints.values,values:c})),a=ct({theme:t},c,(i,l)=>{var j;const u=t.spacing(i);return u!=="0px"?{marginTop:`-${xe(u)}`,[`& > .${Pe.item}`]:{paddingTop:xe(u)}}:(j=d)!=null&&j.includes(l)?{}:{marginTop:0,[`& > .${Pe.item}`]:{paddingTop:0}}})}return a}function an({theme:t,ownerState:o}){const{container:s,columnSpacing:e}=o;let a={};if(s&&e!==0){const c=Fe({values:e,breakpoints:t.breakpoints.values});let d;typeof c=="object"&&(d=Jt({breakpoints:t.breakpoints.values,values:c})),a=ct({theme:t},c,(i,l)=>{var j;const u=t.spacing(i);return u!=="0px"?{width:`calc(100% + ${xe(u)})`,marginLeft:`-${xe(u)}`,[`& > .${Pe.item}`]:{paddingLeft:xe(u)}}:(j=d)!=null&&j.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${Pe.item}`]:{paddingLeft:0}}})}return a}function cn(t,o,s={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[s[`spacing-xs-${String(t)}`]];const e=[];return o.forEach(a=>{const c=t[a];Number(c)>0&&e.push(s[`spacing-${a}-${String(c)}`])}),e}const ln=pe("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:s}=t,{container:e,direction:a,item:c,spacing:d,wrap:i,zeroMinWidth:l,breakpoints:j}=s;let u=[];e&&(u=cn(d,j,o));const f=[];return j.forEach(h=>{const b=s[h];b&&f.push(o[`grid-${h}-${String(b)}`])}),[o.root,e&&o.container,c&&o.item,l&&o.zeroMinWidth,...u,a!=="row"&&o[`direction-xs-${String(a)}`],i!=="wrap"&&o[`wrap-xs-${String(i)}`],...f]}})(({ownerState:t})=>Y({boxSizing:"border-box"},t.container&&{display:"flex",flexWrap:"wrap",width:"100%"},t.item&&{margin:0},t.zeroMinWidth&&{minWidth:0},t.wrap!=="wrap"&&{flexWrap:t.wrap}),sn,rn,an,nn);function dn(t,o){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const s=[];return o.forEach(e=>{const a=t[e];if(Number(a)>0){const c=`spacing-${e}-${String(a)}`;s.push(c)}}),s}const un=t=>{const{classes:o,container:s,direction:e,item:a,spacing:c,wrap:d,zeroMinWidth:i,breakpoints:l}=t;let j=[];s&&(j=dn(c,l));const u=[];l.forEach(h=>{const b=t[h];b&&u.push(`grid-${h}-${String(b)}`)});const f={root:["root",s&&"container",a&&"item",i&&"zeroMinWidth",...j,e!=="row"&&`direction-xs-${String(e)}`,d!=="wrap"&&`wrap-xs-${String(d)}`,...u]};return at(f,qo,o)},pn=x.forwardRef(function(o,s){const e=Lt({props:o,name:"MuiGrid"}),{breakpoints:a}=co(),c=wo(e),{className:d,columns:i,columnSpacing:l,component:j="div",container:u=!1,direction:f="row",item:h=!1,rowSpacing:b,spacing:m=0,wrap:A="wrap",zeroMinWidth:T=!1}=c,y=rt(c,on),E=b||m,_=l||m,S=x.useContext(At),w=u?i||12:S,g={},P=Y({},y);a.keys.forEach(M=>{y[M]!=null&&(g[M]=y[M],delete P[M])});const k=Y({},c,{columns:w,container:u,direction:f,item:h,rowSpacing:E,columnSpacing:_,wrap:A,zeroMinWidth:T,spacing:m},g,{breakpoints:a.keys}),R=un(k);return n.jsx(At.Provider,{value:w,children:n.jsx(ln,Y({ownerState:k,className:it(R.root,d),as:j,ref:s},P))})}),ce=pn;function fn(t){return nt("MuiSwitch",t)}const hn=st("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),K=hn,mn=["className","color","edge","size","sx"],gn=t=>{const{classes:o,edge:s,size:e,color:a,checked:c,disabled:d}=t,i={root:["root",s&&`edge${de(s)}`,`size${de(e)}`],switchBase:["switchBase",`color${de(a)}`,c&&"checked",d&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=at(i,fn,o);return Y({},o,l)},xn=pe("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,o)=>{const{ownerState:s}=t;return[o.root,s.edge&&o[`edge${de(s.edge)}`],o[`size${de(s.size)}`]]}})(({ownerState:t})=>Y({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"}},t.edge==="start"&&{marginLeft:-8},t.edge==="end"&&{marginRight:-8},t.size==="small"&&{width:40,height:24,padding:7,[`& .${K.thumb}`]:{width:16,height:16},[`& .${K.switchBase}`]:{padding:4,[`&.${K.checked}`]:{transform:"translateX(16px)"}}})),bn=pe(Xo,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,o)=>{const{ownerState:s}=t;return[o.switchBase,{[`& .${K.input}`]:o.input},s.color!=="default"&&o[`color${de(s.color)}`]]}})(({theme:t})=>({position:"absolute",top:0,left:0,zIndex:1,color:t.vars?t.vars.palette.Switch.defaultColor:`${t.palette.mode==="light"?t.palette.common.white:t.palette.grey[300]}`,transition:t.transitions.create(["left","transform"],{duration:t.transitions.duration.shortest}),[`&.${K.checked}`]:{transform:"translateX(20px)"},[`&.${K.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${K.checked} + .${K.track}`]:{opacity:.5},[`&.${K.disabled} + .${K.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${K.input}`]:{left:"-100%",width:"300%"}}),({theme:t,ownerState:o})=>Y({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:xt(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},o.color!=="default"&&{[`&.${K.checked}`]:{color:(t.vars||t).palette[o.color].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[o.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:xt(t.palette[o.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${K.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${o.color}DisabledColor`]:`${t.palette.mode==="light"?lo(t.palette[o.color].main,.62):uo(t.palette[o.color].main,.55)}`}},[`&.${K.checked} + .${K.track}`]:{backgroundColor:(t.vars||t).palette[o.color].main}})),yn=pe("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,o)=>o.track})(({theme:t})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:t.transitions.create(["opacity","background-color"],{duration:t.transitions.duration.shortest}),backgroundColor:t.vars?t.vars.palette.common.onBackground:`${t.palette.mode==="light"?t.palette.common.black:t.palette.common.white}`,opacity:t.vars?t.vars.opacity.switchTrack:`${t.palette.mode==="light"?.38:.3}`})),wn=pe("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,o)=>o.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),jn=x.forwardRef(function(o,s){const e=Lt({props:o,name:"MuiSwitch"}),{className:a,color:c="primary",edge:d=!1,size:i="medium",sx:l}=e,j=rt(e,mn),u=Y({},e,{color:c,edge:d,size:i}),f=gn(u),h=n.jsx(wn,{className:f.thumb,ownerState:u});return n.jsxs(xn,{className:it(f.root,a),sx:l,ownerState:u,children:[n.jsx(bn,Y({type:"checkbox",icon:h,checkedIcon:h,ref:s,ownerState:u},j,{classes:Y({},f,{root:f.switchBase})})),n.jsx(yn,{className:f.track,ownerState:u})]})}),vn=jn,En=/^[a-z0-9_]+$/,Pn=({parentParam:t,onDelete:o})=>{const[s,e]=x.useState(!1),[a,c]=x.useState([]),{fields:d,append:i,replace:l,remove:j}=jo({name:"attributes"}),{setValue:u,watch:f}=vo();return x.useEffect(()=>{const h=async()=>{try{let b=[{required:!1,type:"string",key:""}];if(t!==Gt.value.toLowerCase()){e(!0);const m=await Wt(t);b=Zt(m)}b=b.filter(m=>m.key!=="node_key"),l(b),c(b)}catch(b){console.warn(b)}finally{e(!1)}};a.length===0&&h()},[t,u,l,a.length]),n.jsxs(n.Fragment,{children:[s?n.jsx(v,{align:"center",children:n.jsx(ue,{color:V.SECONDARY_BLUE,size:"30"})}):n.jsx(Cn,{py:8,children:n.jsx(ce,{container:!0,spacing:2,children:d.map((h,b)=>{const m=f(`attributes[${b}].type`),A=f(`attributes[${b}].required`),T=h.isNew||!1,y=["name"].includes(f(`attributes[${b}].key`));return n.jsxs(x.Fragment,{children:[n.jsx(ce,{item:!0,xs:5,children:n.jsx(De,{autoComplete:"off",className:"text-input",disabled:!T,id:"cy-item-name",maxLength:50,name:`attributes.${b}.key`,placeholder:"Enter value",rules:{...Re,pattern:{message:"Please avoid special characters, spaces and uppercase",value:En}}})}),n.jsx(ce,{item:!0,xs:4,children:n.jsx(Ve,{disabled:y,onSelect:E=>u(`attributes[${b}].type`,E==null?void 0:E.value),options:Et,selectedValue:Et.find(E=>E.value===m)})}),n.jsxs(ce,{item:!0,xs:3,children:[n.jsx(vn,{checked:A,disabled:y,name:`attributes.${b}.required`,onChange:E=>u(`attributes[${b}].required`,E.target.checked),size:"small"}),!y&&n.jsx(Eo,{onClick:()=>{j(b),h.key!==void 0&&o&&o(h.key)},children:n.jsx(Po,{})})]})]},h.id)})})}),n.jsx(v,{align:"flex-start",py:12,children:n.jsx(Ce,{onClick:()=>i({key:"",type:"string",required:!0,isNew:!0}),size:"medium",startIcon:n.jsx(Co,{}),variant:"contained",children:"Add Attribute"})})]})},Cn=F(v)` overflow-y: auto; width: calc(100% + 20px); max-height: calc(80vh - 300px); -`,Sn=({parent:t,onDelete:o})=>{const n=t;return s.jsxs(v,{children:[s.jsx(v,{direction:"row",mb:10,children:s.jsxs(ce,{container:!0,spacing:2,children:[s.jsx(ce,{item:!0,xs:5,children:s.jsx(Je,{style:{marginRight:180},children:"Attributes"})}),s.jsx(ce,{item:!0,xs:4,children:s.jsx(Je,{style:{marginRight:130},children:"Type"})}),s.jsx(ce,{item:!0,xs:3,children:s.jsx(Je,{children:"Required"})})]})}),n&&s.jsx(Tn,{onDelete:o,parentParam:n},n)]})},Je=F(q)` +`,Tn=({parent:t,onDelete:o})=>{const s=t;return n.jsxs(v,{children:[n.jsx(v,{direction:"row",mb:10,children:n.jsxs(ce,{container:!0,spacing:2,children:[n.jsx(ce,{item:!0,xs:5,children:n.jsx(Je,{style:{marginRight:180},children:"Attributes"})}),n.jsx(ce,{item:!0,xs:4,children:n.jsx(Je,{style:{marginRight:130},children:"Type"})}),n.jsx(ce,{item:!0,xs:3,children:n.jsx(Je,{children:"Required"})})]})}),s&&n.jsx(Pn,{onDelete:o,parentParam:s},s)]})},Je=F(q)` font-size: 15px; color: gray; -`,An={type:"",parent:""},Mn=(t,o)=>t.length!==o.length?!0:t.some((n,e)=>{const a=o[e];return n.required!==a.required||n.type!==a.type||n.key!==a.key}),kn=async(t,o=!1,n)=>{try{const{attributes:e,...a}=t,c={...a,attributes:Mo(e),...n.reduce((i,l)=>({...i,[l]:"delete"}),{})};let d;if(o?d=await Be.put("/schema",JSON.stringify(c),{}):d=await Be.post("/schema",JSON.stringify({...c,node_key:"name"}),{}),d.status!=="success")throw new Error("error");return d==null?void 0:d.ref_id}catch(e){let a=ge;if(e.status===400){const c=await e.json();a=c.errorCode||(c==null?void 0:c.status)||ge}else e instanceof Error&&(a=e.message);throw new Error(a)}},_n=t=>t.charAt(0).toUpperCase()+t.slice(1),At=async(t,o)=>{try{const c=((await Ut()).schemas||[]).filter(d=>!d.is_deleted&&d.type&&(!o||o(d))).map(d=>d.type==="thing"?{label:"No Parent",value:d.type}:{label:_n(d.type),value:d.type});t(c)}catch(n){console.warn(n)}},$n=({graphLoading:t,onSchemaCreate:o,selectedSchema:n,onDelete:e,setSelectedSchemaId:a,setGraphLoading:c,setIsCreateNew:d,onSchemaUpdate:i})=>{var ke,we;const{close:l,visible:j}=Yt("addType"),u=lt({mode:"onChange",defaultValues:n?{type:n.type,parent:n.parent}:An}),{watch:f,setValue:h,reset:b,getValues:m}=u,[S,T]=x.useState(!1),[y,E]=x.useState(!1),[_,M]=x.useState(!1),[w,g]=x.useState(null),[P,k]=x.useState(!1),[R,A]=x.useState(null),[D,oe]=x.useState(""),[N,X]=x.useState(null),[L,Q]=x.useState([]),[J,Z]=x.useState([]);x.useEffect(()=>()=>{b()},[j,b]);const H=()=>{d(!1),a("")};x.useEffect(()=>{n||(M(!0),At(g).finally(()=>M(!1)))},[n]),x.useEffect(()=>{(async()=>{if(n){h("type",n==null?void 0:n.type),h("parent",n.parent);let B=[{required:!1,type:"string",key:""}];if(n.type!==Gt.value.toLowerCase()){const W=await Wt(n.type);B=W?Xt(W):B}B=B.filter(W=>W.key!=="node_key"),Z(B),await At(A,W=>W.type!==n.type)}})()},[n,h]);const G=f("parent"),le=f("type"),be=I=>Array.isArray(I)&&I.every(B=>typeof B=="object"&&"key"in B),ye=f("attributes"),We=be(ye)?ye:[],Te=()=>{l()},Ye=I=>{Q(B=>[...B,I])},Ue=async()=>{if(n!=null&&n.type){E(!0),c(!0);try{await Be.delete(`/schema/${n.ref_id}`),e(n.type),l()}catch(I){let B=ge;if((I==null?void 0:I.status)===400){const W=await I.json();B=W.errorCode||(W==null?void 0:W.status)||ge}else I instanceof Error&&(B=I.message);X(B)}finally{E(!1),c(!1),d(!1)}}},Oe=u.handleSubmit(async I=>{if(!G){k(!0);return}T(!0);try{if(n&&I.type!==(n==null?void 0:n.type)||n&&m().parent!==(n==null?void 0:n.parent)){const W=m().parent??(n==null?void 0:n.parent);c(!0),await Be.put(`/schema/${n==null?void 0:n.ref_id}`,JSON.stringify({type:I.type,parent:W})),await i()}const B=await kn({...I,...n?{ref_id:n==null?void 0:n.ref_id}:{}},!!n,L);o({type:I.type,parent:G||"",ref_id:(n==null?void 0:n.ref_id)||B||"new"}),Te()}catch(B){let W=ge;if((B==null?void 0:B.status)===400){const fe=await B.json();W=fe.errorCode||(fe==null?void 0:fe.status)||ge}else B instanceof Error&&(W=B.message);oe(W)}finally{T(!1),c(!1),d(!1)}}),Ge=Mn(We,J),He=(le==null?void 0:le.trim())!==((ke=n==null?void 0:n.type)==null?void 0:ke.trim())||G!==((we=n==null?void 0:n.parent)==null?void 0:we.trim())||Ge,Se=!!le.trim(),Ae=n?S||!He||!Se||P:S||P,Me=()=>w==null?void 0:w.find(I=>I.value===G),Ke=()=>{const I=R==null?void 0:R.find(B=>B.value===G);if(I)return I;if(G)return{label:G,value:G}};return s.jsxs(v,{children:[s.jsx(v,{direction:"row",justify:"flex-end",children:s.jsx(zn,{"data-testid":"close-sidebar-sub-view",onClick:H,children:s.jsx(Ht,{})})}),s.jsx(v,{children:s.jsx(Kt,{...u,children:s.jsxs("form",{id:"add-type-form",onSubmit:Oe,children:[s.jsx(v,{children:n?s.jsxs(s.Fragment,{children:[s.jsxs(v,{mb:12,children:[s.jsx(v,{mb:12,children:s.jsx(q,{children:"Name"})}),s.jsx(v,{mb:12,children:s.jsx(De,{defaultValue:n==null?void 0:n.type,id:"cy-item-name",maxLength:250,name:"type",placeholder:"Enter type name",rules:{...Re},value:G})})]}),s.jsxs(v,{mb:12,children:[s.jsx(v,{mb:12,children:s.jsx(q,{children:"Parent"})}),s.jsx(Ve,{isLoading:_||t,onSelect:I=>{h("parent",(I==null?void 0:I.value)||""),k(!1)},options:R||[],selectedValue:Ke()}),D&&s.jsx(et,{children:D})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs(v,{mb:12,children:[s.jsx(v,{mb:12,children:s.jsx(q,{children:"Select Parent"})}),s.jsx(Ve,{isLoading:_,onSelect:I=>{h("parent",(I==null?void 0:I.value)||""),k(!1)},options:w,selectedValue:Me()}),P&&s.jsx(et,{children:"A parent type must be selected"})]}),s.jsxs(v,{children:[s.jsx(v,{mb:12,children:s.jsx(q,{children:"Type name"})}),s.jsx(v,{mb:12,children:s.jsx(De,{id:"cy-item-name",maxLength:250,name:"type",placeholder:"Enter type name",rules:{...Re},value:G})})]})]})}),s.jsx(Sn,{onDelete:Ye,parent:n?n.type:G}),s.jsxs(v,{direction:"row",justify:"space-between",mt:20,children:[n&&s.jsxs(v,{direction:"column",children:[s.jsxs(Nn,{color:"secondary",disabled:y,onClick:Ue,size:"large",style:{marginRight:20},variant:"contained",children:["Delete",y&&s.jsxs(Mt,{children:[s.jsx(ue,{color:V.lightGray,size:12})," "]})]}),N&&s.jsx(et,{children:N})]}),s.jsxs(In,{color:"secondary",disabled:Ae,onClick:Oe,size:"large",variant:"contained",children:["Confirm",S&&s.jsxs(Mt,{children:[s.jsx(ue,{color:V.lightGray,size:12})," "]})]})]})]})})})]})},In=F(Ce)` +`,On={type:"",parent:""},An=(t,o)=>t.length!==o.length?!0:t.some((s,e)=>{const a=o[e];return s.required!==a.required||s.type!==a.type||s.key!==a.key}),Mn=async(t,o=!1,s)=>{try{const{attributes:e,...a}=t,c={...a,attributes:Mo(e),...s.reduce((i,l)=>({...i,[l]:"delete"}),{})};let d;if(o?d=await Be.put("/schema",JSON.stringify(c),{}):d=await Be.post("/schema",JSON.stringify({...c,node_key:"name"}),{}),d.status!=="success")throw new Error("error");return d==null?void 0:d.ref_id}catch(e){let a=ge;if(e.status===400){const c=await e.json();a=c.errorCode||(c==null?void 0:c.status)||ge}else e instanceof Error&&(a=e.message);throw new Error(a)}},Sn=t=>t.charAt(0).toUpperCase()+t.slice(1),Mt=async(t,o)=>{try{const c=((await Yt()).schemas||[]).filter(d=>!d.is_deleted&&d.type&&(!o||o(d))).map(d=>d.type==="thing"?{label:"No Parent",value:d.type}:{label:Sn(d.type),value:d.type});t(c)}catch(s){console.warn(s)}},kn=({graphLoading:t,onSchemaCreate:o,selectedSchema:s,onDelete:e,setSelectedSchemaId:a,setGraphLoading:c,setIsCreateNew:d,onSchemaUpdate:i})=>{var ke,we;const{close:l,visible:j}=Ut("addType"),u=lt({mode:"onChange",defaultValues:s?{type:s.type,parent:s.parent}:On}),{watch:f,setValue:h,reset:b,getValues:m}=u,[A,T]=x.useState(!1),[y,E]=x.useState(!1),[_,S]=x.useState(!1),[w,g]=x.useState(null),[P,k]=x.useState(!1),[R,M]=x.useState(null),[D,oe]=x.useState(""),[N,X]=x.useState(null),[L,Q]=x.useState([]),[J,Z]=x.useState([]);x.useEffect(()=>()=>{b()},[j,b]);const H=()=>{d(!1),a("")};x.useEffect(()=>{s||(S(!0),Mt(g).finally(()=>S(!1)))},[s]),x.useEffect(()=>{(async()=>{if(s){h("type",s==null?void 0:s.type),h("parent",s.parent);let B=[{required:!1,type:"string",key:""}];if(s.type!==Gt.value.toLowerCase()){const W=await Wt(s.type);B=W?Zt(W):B}B=B.filter(W=>W.key!=="node_key"),Z(B),await Mt(M,W=>W.type!==s.type)}})()},[s,h]);const G=f("parent"),le=f("type"),be=I=>Array.isArray(I)&&I.every(B=>typeof B=="object"&&"key"in B),ye=f("attributes"),We=be(ye)?ye:[],Te=()=>{l()},Ue=I=>{Q(B=>[...B,I])},Ye=async()=>{if(s!=null&&s.type){E(!0),c(!0);try{await Be.delete(`/schema/${s.ref_id}`),e(s.type),l()}catch(I){let B=ge;if((I==null?void 0:I.status)===400){const W=await I.json();B=W.errorCode||(W==null?void 0:W.status)||ge}else I instanceof Error&&(B=I.message);X(B)}finally{E(!1),c(!1),d(!1)}}},Oe=u.handleSubmit(async I=>{if(!G){k(!0);return}T(!0);try{if(s&&I.type!==(s==null?void 0:s.type)||s&&m().parent!==(s==null?void 0:s.parent)){const W=m().parent??(s==null?void 0:s.parent);c(!0),await Be.put(`/schema/${s==null?void 0:s.ref_id}`,JSON.stringify({type:I.type,parent:W})),await i()}const B=await Mn({...I,...s?{ref_id:s==null?void 0:s.ref_id}:{}},!!s,L);o({type:I.type,parent:G||"",ref_id:(s==null?void 0:s.ref_id)||B||"new"}),Te()}catch(B){let W=ge;if((B==null?void 0:B.status)===400){const fe=await B.json();W=fe.errorCode||(fe==null?void 0:fe.status)||ge}else B instanceof Error&&(W=B.message);oe(W)}finally{T(!1),c(!1),d(!1)}}),Ge=An(We,J),He=(le==null?void 0:le.trim())!==((ke=s==null?void 0:s.type)==null?void 0:ke.trim())||G!==((we=s==null?void 0:s.parent)==null?void 0:we.trim())||Ge,Ae=!!le.trim(),Me=s?A||!He||!Ae||P:A||P,Se=()=>w==null?void 0:w.find(I=>I.value===G),Ke=()=>{const I=R==null?void 0:R.find(B=>B.value===G);if(I)return I;if(G)return{label:G,value:G}};return n.jsxs(v,{children:[n.jsx(v,{direction:"row",justify:"flex-end",children:n.jsx(In,{"data-testid":"close-sidebar-sub-view",onClick:H,children:n.jsx(Ht,{})})}),n.jsx(v,{children:n.jsx(Kt,{...u,children:n.jsxs("form",{id:"add-type-form",onSubmit:Oe,children:[n.jsx(v,{children:s?n.jsxs(n.Fragment,{children:[n.jsxs(v,{mb:12,children:[n.jsx(v,{mb:12,children:n.jsx(q,{children:"Name"})}),n.jsx(v,{mb:12,children:n.jsx(De,{defaultValue:s==null?void 0:s.type,id:"cy-item-name",maxLength:250,name:"type",placeholder:"Enter type name",rules:{...Re},value:G})})]}),n.jsxs(v,{mb:12,children:[n.jsx(v,{mb:12,children:n.jsx(q,{children:"Parent"})}),n.jsx(Ve,{isLoading:_||t,onSelect:I=>{h("parent",(I==null?void 0:I.value)||""),k(!1)},options:R||[],selectedValue:Ke()}),D&&n.jsx(et,{children:D})]})]}):n.jsxs(n.Fragment,{children:[n.jsxs(v,{mb:12,children:[n.jsx(v,{mb:12,children:n.jsx(q,{children:"Select Parent"})}),n.jsx(Ve,{isLoading:_,onSelect:I=>{h("parent",(I==null?void 0:I.value)||""),k(!1)},options:w,selectedValue:Se()}),P&&n.jsx(et,{children:"A parent type must be selected"})]}),n.jsxs(v,{children:[n.jsx(v,{mb:12,children:n.jsx(q,{children:"Type name"})}),n.jsx(v,{mb:12,children:n.jsx(De,{id:"cy-item-name",maxLength:250,name:"type",placeholder:"Enter type name",rules:{...Re},value:G})})]})]})}),n.jsx(Tn,{onDelete:Ue,parent:s?s.type:G}),n.jsxs(v,{direction:"row",justify:"space-between",mt:20,children:[s&&n.jsxs(v,{direction:"column",children:[n.jsxs($n,{color:"secondary",disabled:y,onClick:Ye,size:"large",style:{marginRight:20},variant:"contained",children:["Delete",y&&n.jsxs(St,{children:[n.jsx(ue,{color:V.lightGray,size:12})," "]})]}),N&&n.jsx(et,{children:N})]}),n.jsxs(_n,{color:"secondary",disabled:Me,onClick:Oe,size:"large",variant:"contained",children:["Confirm",A&&n.jsxs(St,{children:[n.jsx(ue,{color:V.lightGray,size:12})," "]})]})]})]})})})]})},_n=F(Ce)` width: 100% !important; margin: 0 auto !important; -`,Mt=F.span` +`,St=F.span` margin-top: 2px; -`,Nn=F(Ce)` +`,$n=F(Ce)` && { color: ${V.primaryRed}; background-color: rgba(237, 116, 116, 0.1); @@ -22,7 +22,7 @@ import{o as nt,p as st,s as pe,a as U,E as ao,r as x,_ as rt,j as s,v as it,q as background-color: rgba(237, 116, 116, 0.2); } } -`,zn=F(v)` +`,In=F(v)` font-size: 32px; color: ${V.white}; cursor: pointer; @@ -33,7 +33,7 @@ import{o as nt,p as st,s as pe,a as U,E as ao,r as x,_ as rt,j as s,v as it,q as line-height: 0.2px; margin-top: 12px; padding-top: 20px; -`;var Rn=Object.defineProperty,Bn=(t,o,n)=>o in t?Rn(t,o,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[o]=n,C=(t,o,n)=>(Bn(t,typeof o!="symbol"?o+"":o,n),n);const ze=new Bo,kt=new Do,Dn=Math.cos(70*(Math.PI/180)),_t=(t,o)=>(t%o+o)%o;let Vn=class extends Vo{constructor(o,n){super(),C(this,"object"),C(this,"domElement"),C(this,"enabled",!0),C(this,"target",new $),C(this,"minDistance",0),C(this,"maxDistance",1/0),C(this,"minZoom",0),C(this,"maxZoom",1/0),C(this,"minPolarAngle",0),C(this,"maxPolarAngle",Math.PI),C(this,"minAzimuthAngle",-1/0),C(this,"maxAzimuthAngle",1/0),C(this,"enableDamping",!1),C(this,"dampingFactor",.05),C(this,"enableZoom",!0),C(this,"zoomSpeed",1),C(this,"enableRotate",!0),C(this,"rotateSpeed",1),C(this,"enablePan",!0),C(this,"panSpeed",1),C(this,"screenSpacePanning",!0),C(this,"keyPanSpeed",7),C(this,"zoomToCursor",!1),C(this,"autoRotate",!1),C(this,"autoRotateSpeed",2),C(this,"reverseOrbit",!1),C(this,"reverseHorizontalOrbit",!1),C(this,"reverseVerticalOrbit",!1),C(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),C(this,"mouseButtons",{LEFT:he.ROTATE,MIDDLE:he.DOLLY,RIGHT:he.PAN}),C(this,"touches",{ONE:me.ROTATE,TWO:me.DOLLY_PAN}),C(this,"target0"),C(this,"position0"),C(this,"zoom0"),C(this,"_domElementKeyEvents",null),C(this,"getPolarAngle"),C(this,"getAzimuthalAngle"),C(this,"setPolarAngle"),C(this,"setAzimuthalAngle"),C(this,"getDistance"),C(this,"listenToKeyEvents"),C(this,"stopListenToKeyEvents"),C(this,"saveState"),C(this,"reset"),C(this,"update"),C(this,"connect"),C(this,"dispose"),this.object=o,this.domElement=n,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>u.phi,this.getAzimuthalAngle=()=>u.theta,this.setPolarAngle=r=>{let p=_t(r,2*Math.PI),O=u.phi;O<0&&(O+=2*Math.PI),p<0&&(p+=2*Math.PI);let z=Math.abs(p-O);2*Math.PI-z{let p=_t(r,2*Math.PI),O=u.theta;O<0&&(O+=2*Math.PI),p<0&&(p+=2*Math.PI);let z=Math.abs(p-O);2*Math.PI-ze.object.position.distanceTo(e.target),this.listenToKeyEvents=r=>{r.addEventListener("keydown",qe),this._domElementKeyEvents=r},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",qe),this._domElementKeyEvents=null},this.saveState=()=>{e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=()=>{e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(a),e.update(),l=i.NONE},this.update=(()=>{const r=new $,p=new $(0,1,0),O=new Ct().setFromUnitVectors(o.up,p),z=O.clone().invert(),Y=new $,se=new Ct,ae=2*Math.PI;return function(){const gt=e.object.position;O.setFromUnitVectors(o.up,p),z.copy(O).invert(),r.copy(gt).sub(e.target),r.applyQuaternion(O),u.setFromVector3(r),e.autoRotate&&l===i.NONE&&X(oe()),e.enableDamping?(u.theta+=f.theta*e.dampingFactor,u.phi+=f.phi*e.dampingFactor):(u.theta+=f.theta,u.phi+=f.phi);let re=e.minAzimuthAngle,ie=e.maxAzimuthAngle;isFinite(re)&&isFinite(ie)&&(re<-Math.PI?re+=ae:re>Math.PI&&(re-=ae),ie<-Math.PI?ie+=ae:ie>Math.PI&&(ie-=ae),re<=ie?u.theta=Math.max(re,Math.min(ie,u.theta)):u.theta=u.theta>(re+ie)/2?Math.max(re,u.theta):Math.min(ie,u.theta)),u.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,u.phi)),u.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(b,e.dampingFactor):e.target.add(b),e.zoomToCursor&&R||e.object.isOrthographicCamera?u.radius=be(u.radius):u.radius=be(u.radius*h),r.setFromSpherical(u),r.applyQuaternion(z),gt.copy(e.target).add(r),e.object.matrixAutoUpdate||e.object.updateMatrix(),e.object.lookAt(e.target),e.enableDamping===!0?(f.theta*=1-e.dampingFactor,f.phi*=1-e.dampingFactor,b.multiplyScalar(1-e.dampingFactor)):(f.set(0,0,0),b.set(0,0,0));let _e=!1;if(e.zoomToCursor&&R){let je=null;if(e.object instanceof Ie&&e.object.isPerspectiveCamera){const ve=r.length();je=be(ve*h);const $e=ve-je;e.object.position.addScaledVector(P,$e),e.object.updateMatrixWorld()}else if(e.object.isOrthographicCamera){const ve=new $(k.x,k.y,0);ve.unproject(e.object),e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/h)),e.object.updateProjectionMatrix(),_e=!0;const $e=new $(k.x,k.y,0);$e.unproject(e.object),e.object.position.sub($e).add(ve),e.object.updateMatrixWorld(),je=r.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;je!==null&&(e.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(je).add(e.object.position):(ze.origin.copy(e.object.position),ze.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(ze.direction))j||8*(1-se.dot(e.object.quaternion))>j?(e.dispatchEvent(a),Y.copy(e.object.position),se.copy(e.object.quaternion),_e=!1,!0):!1}})(),this.connect=r=>{r===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),e.domElement=r,e.domElement.style.touchAction="none",e.domElement.addEventListener("contextmenu",ft),e.domElement.addEventListener("pointerdown",dt),e.domElement.addEventListener("pointercancel",ut),e.domElement.addEventListener("wheel",pt)},this.dispose=()=>{var r,p,O,z,Y,se;(r=e.domElement)==null||r.removeEventListener("contextmenu",ft),(p=e.domElement)==null||p.removeEventListener("pointerdown",dt),(O=e.domElement)==null||O.removeEventListener("pointercancel",ut),(z=e.domElement)==null||z.removeEventListener("wheel",pt),(Y=e.domElement)==null||Y.ownerDocument.removeEventListener("pointermove",Xe),(se=e.domElement)==null||se.ownerDocument.removeEventListener("pointerup",Ze),e._domElementKeyEvents!==null&&e._domElementKeyEvents.removeEventListener("keydown",qe)};const e=this,a={type:"change"},c={type:"start"},d={type:"end"},i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=i.NONE;const j=1e-6,u=new Tt,f=new Tt;let h=1;const b=new $,m=new ee,S=new ee,T=new ee,y=new ee,E=new ee,_=new ee,M=new ee,w=new ee,g=new ee,P=new $,k=new ee;let R=!1;const A=[],D={};function oe(){return 2*Math.PI/60/60*e.autoRotateSpeed}function N(){return Math.pow(.95,e.zoomSpeed)}function X(r){e.reverseOrbit||e.reverseHorizontalOrbit?f.theta+=r:f.theta-=r}function L(r){e.reverseOrbit||e.reverseVerticalOrbit?f.phi+=r:f.phi-=r}const Q=(()=>{const r=new $;return function(O,z){r.setFromMatrixColumn(z,0),r.multiplyScalar(-O),b.add(r)}})(),J=(()=>{const r=new $;return function(O,z){e.screenSpacePanning===!0?r.setFromMatrixColumn(z,1):(r.setFromMatrixColumn(z,0),r.crossVectors(e.object.up,r)),r.multiplyScalar(O),b.add(r)}})(),Z=(()=>{const r=new $;return function(O,z){const Y=e.domElement;if(Y&&e.object instanceof Ie&&e.object.isPerspectiveCamera){const se=e.object.position;r.copy(se).sub(e.target);let ae=r.length();ae*=Math.tan(e.object.fov/2*Math.PI/180),Q(2*O*ae/Y.clientHeight,e.object.matrix),J(2*z*ae/Y.clientHeight,e.object.matrix)}else Y&&e.object instanceof Ne&&e.object.isOrthographicCamera?(Q(O*(e.object.right-e.object.left)/e.object.zoom/Y.clientWidth,e.object.matrix),J(z*(e.object.top-e.object.bottom)/e.object.zoom/Y.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}})();function H(r){e.object instanceof Ie&&e.object.isPerspectiveCamera||e.object instanceof Ne&&e.object.isOrthographicCamera?h/=r:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function G(r){e.object instanceof Ie&&e.object.isPerspectiveCamera||e.object instanceof Ne&&e.object.isOrthographicCamera?h*=r:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function le(r){if(!e.zoomToCursor||!e.domElement)return;R=!0;const p=e.domElement.getBoundingClientRect(),O=r.clientX-p.left,z=r.clientY-p.top,Y=p.width,se=p.height;k.x=O/Y*2-1,k.y=-(z/se)*2+1,P.set(k.x,k.y,1).unproject(e.object).sub(e.object.position).normalize()}function be(r){return Math.max(e.minDistance,Math.min(e.maxDistance,r))}function ye(r){m.set(r.clientX,r.clientY)}function We(r){le(r),M.set(r.clientX,r.clientY)}function Te(r){y.set(r.clientX,r.clientY)}function Ye(r){S.set(r.clientX,r.clientY),T.subVectors(S,m).multiplyScalar(e.rotateSpeed);const p=e.domElement;p&&(X(2*Math.PI*T.x/p.clientHeight),L(2*Math.PI*T.y/p.clientHeight)),m.copy(S),e.update()}function Ue(r){w.set(r.clientX,r.clientY),g.subVectors(w,M),g.y>0?H(N()):g.y<0&&G(N()),M.copy(w),e.update()}function Oe(r){E.set(r.clientX,r.clientY),_.subVectors(E,y).multiplyScalar(e.panSpeed),Z(_.x,_.y),y.copy(E),e.update()}function Ge(r){le(r),r.deltaY<0?G(N()):r.deltaY>0&&H(N()),e.update()}function He(r){let p=!1;switch(r.code){case e.keys.UP:Z(0,e.keyPanSpeed),p=!0;break;case e.keys.BOTTOM:Z(0,-e.keyPanSpeed),p=!0;break;case e.keys.LEFT:Z(e.keyPanSpeed,0),p=!0;break;case e.keys.RIGHT:Z(-e.keyPanSpeed,0),p=!0;break}p&&(r.preventDefault(),e.update())}function Se(){if(A.length==1)m.set(A[0].pageX,A[0].pageY);else{const r=.5*(A[0].pageX+A[1].pageX),p=.5*(A[0].pageY+A[1].pageY);m.set(r,p)}}function Ae(){if(A.length==1)y.set(A[0].pageX,A[0].pageY);else{const r=.5*(A[0].pageX+A[1].pageX),p=.5*(A[0].pageY+A[1].pageY);y.set(r,p)}}function Me(){const r=A[0].pageX-A[1].pageX,p=A[0].pageY-A[1].pageY,O=Math.sqrt(r*r+p*p);M.set(0,O)}function Ke(){e.enableZoom&&Me(),e.enablePan&&Ae()}function ke(){e.enableZoom&&Me(),e.enableRotate&&Se()}function we(r){if(A.length==1)S.set(r.pageX,r.pageY);else{const O=Qe(r),z=.5*(r.pageX+O.x),Y=.5*(r.pageY+O.y);S.set(z,Y)}T.subVectors(S,m).multiplyScalar(e.rotateSpeed);const p=e.domElement;p&&(X(2*Math.PI*T.x/p.clientHeight),L(2*Math.PI*T.y/p.clientHeight)),m.copy(S)}function I(r){if(A.length==1)E.set(r.pageX,r.pageY);else{const p=Qe(r),O=.5*(r.pageX+p.x),z=.5*(r.pageY+p.y);E.set(O,z)}_.subVectors(E,y).multiplyScalar(e.panSpeed),Z(_.x,_.y),y.copy(E)}function B(r){const p=Qe(r),O=r.pageX-p.x,z=r.pageY-p.y,Y=Math.sqrt(O*O+z*z);w.set(0,Y),g.set(0,Math.pow(w.y/M.y,e.zoomSpeed)),H(g.y),M.copy(w)}function W(r){e.enableZoom&&B(r),e.enablePan&&I(r)}function fe(r){e.enableZoom&&B(r),e.enableRotate&&we(r)}function dt(r){var p,O;e.enabled!==!1&&(A.length===0&&((p=e.domElement)==null||p.ownerDocument.addEventListener("pointermove",Xe),(O=e.domElement)==null||O.ownerDocument.addEventListener("pointerup",Ze)),io(r),r.pointerType==="touch"?so(r):oo(r))}function Xe(r){e.enabled!==!1&&(r.pointerType==="touch"?ro(r):no(r))}function Ze(r){var p,O,z;ht(r),A.length===0&&((p=e.domElement)==null||p.releasePointerCapture(r.pointerId),(O=e.domElement)==null||O.ownerDocument.removeEventListener("pointermove",Xe),(z=e.domElement)==null||z.ownerDocument.removeEventListener("pointerup",Ze)),e.dispatchEvent(d),l=i.NONE}function ut(r){ht(r)}function oo(r){let p;switch(r.button){case 0:p=e.mouseButtons.LEFT;break;case 1:p=e.mouseButtons.MIDDLE;break;case 2:p=e.mouseButtons.RIGHT;break;default:p=-1}switch(p){case he.DOLLY:if(e.enableZoom===!1)return;We(r),l=i.DOLLY;break;case he.ROTATE:if(r.ctrlKey||r.metaKey||r.shiftKey){if(e.enablePan===!1)return;Te(r),l=i.PAN}else{if(e.enableRotate===!1)return;ye(r),l=i.ROTATE}break;case he.PAN:if(r.ctrlKey||r.metaKey||r.shiftKey){if(e.enableRotate===!1)return;ye(r),l=i.ROTATE}else{if(e.enablePan===!1)return;Te(r),l=i.PAN}break;default:l=i.NONE}l!==i.NONE&&e.dispatchEvent(c)}function no(r){if(e.enabled!==!1)switch(l){case i.ROTATE:if(e.enableRotate===!1)return;Ye(r);break;case i.DOLLY:if(e.enableZoom===!1)return;Ue(r);break;case i.PAN:if(e.enablePan===!1)return;Oe(r);break}}function pt(r){e.enabled===!1||e.enableZoom===!1||l!==i.NONE&&l!==i.ROTATE||(r.preventDefault(),e.dispatchEvent(c),Ge(r),e.dispatchEvent(d))}function qe(r){e.enabled===!1||e.enablePan===!1||He(r)}function so(r){switch(mt(r),A.length){case 1:switch(e.touches.ONE){case me.ROTATE:if(e.enableRotate===!1)return;Se(),l=i.TOUCH_ROTATE;break;case me.PAN:if(e.enablePan===!1)return;Ae(),l=i.TOUCH_PAN;break;default:l=i.NONE}break;case 2:switch(e.touches.TWO){case me.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;Ke(),l=i.TOUCH_DOLLY_PAN;break;case me.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;ke(),l=i.TOUCH_DOLLY_ROTATE;break;default:l=i.NONE}break;default:l=i.NONE}l!==i.NONE&&e.dispatchEvent(c)}function ro(r){switch(mt(r),l){case i.TOUCH_ROTATE:if(e.enableRotate===!1)return;we(r),e.update();break;case i.TOUCH_PAN:if(e.enablePan===!1)return;I(r),e.update();break;case i.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;W(r),e.update();break;case i.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;fe(r),e.update();break;default:l=i.NONE}}function ft(r){e.enabled!==!1&&r.preventDefault()}function io(r){A.push(r)}function ht(r){delete D[r.pointerId];for(let p=0;pnew Fo(void 0,void 0,void 0)),j=x.useCallback((f,h,b,m=20)=>(f instanceof $?l.v0.copy(f):l.v0.set(...f),h instanceof $?l.v2.copy(h):l.v2.set(...h),b instanceof $?l.v1.copy(b):l.v1.copy(l.v0.clone().add(l.v2.clone().sub(l.v0)).add(Fn.set(0,l.v0.y-l.v2.y,0))),l.getPoints(m)),[]);x.useLayoutEffect(()=>{i.current.setPoints=(f,h,b)=>{const m=j(f,h,b);i.current.geometry&&i.current.geometry.setPositions(m.map(S=>S.toArray()).flat())}},[]);const u=x.useMemo(()=>j(o,n,e,a),[o,n,e,a]);return x.createElement(_o,U({ref:$o([i,d]),points:u},c))}),Ln=x.forwardRef(({makeDefault:t,camera:o,regress:n,domElement:e,enableDamping:a=!0,onChange:c,onStart:d,onEnd:i,...l},j)=>{const u=ne(w=>w.invalidate),f=ne(w=>w.camera),h=ne(w=>w.gl),b=ne(w=>w.events),m=ne(w=>w.setEvents),S=ne(w=>w.set),T=ne(w=>w.get),y=ne(w=>w.performance),E=o||f,_=e||b.connected||h.domElement,M=x.useMemo(()=>new Vn(E),[E]);return Le(()=>{M.enabled&&M.update()},-1),x.useEffect(()=>(M.connect(_),()=>void M.dispose()),[_,n,M,u]),x.useEffect(()=>{const w=k=>{u(),n&&y.regress(),c&&c(k)},g=k=>{d&&d(k)},P=k=>{i&&i(k)};return M.addEventListener("change",w),M.addEventListener("start",g),M.addEventListener("end",P),()=>{M.removeEventListener("start",g),M.removeEventListener("end",P),M.removeEventListener("change",w)}},[c,d,i,M,u,m]),x.useEffect(()=>{if(t){const w=T().controls;return S({controls:M}),()=>S({controls:w})}},[t,M]),x.createElement("primitive",U({ref:j,object:M,enableDamping:a},l))});function Wn(t){const o=t+"Geometry";return x.forwardRef(({args:n,children:e,...a},c)=>x.createElement("mesh",U({ref:c},a),x.createElement(o,{attach:"geometry",args:n}),e))}const Yn=Wn("circle"),te=10,Un=2,Gn=2,It=10,Hn=10,Nt=(t,o,n)=>{const c=new $().subVectors(o,t).normalize().multiplyScalar(n);return new $().addVectors(t,c)},Kn=(t,o,n,e)=>{const a=new $().lerpVectors(t,o,.5),c=new $().subVectors(o,t).normalize(),d=new $(-c.y,c.x,c.z).normalize(),i=(n-e/2)*Hn;return new $().addVectors(a,d.multiplyScalar(i))},eo=({links:t,nodes:o,onEdgeClick:n})=>{const e=x.useRef(null),{camera:a}=ne(),c=new $,d=new $,i=new $,l=new $,j=new $,u=new $,f=new $,h=new $;Le(()=>{e.current&&o&&e.current.children.forEach((m,S)=>{var R,A,D,oe;const T=t[S];if(!T)return;const y=o.find(N=>N.ref_id===T.target),E=o.find(N=>N.ref_id===T.source);c.set((E==null?void 0:E.x)||0,(E==null?void 0:E.y)||0,(E==null?void 0:E.z)||0),d.set((y==null?void 0:y.x)||0,(y==null?void 0:y.y)||0,(y==null?void 0:y.z)||0);const _=m.children[0],M=m.children[1],w=m.children[2],g=m.children[3],P=t.filter(N=>N.source===T.source&&N.target===T.target||N.source===T.target&&N.target===T.source).length,k=t.filter((N,X)=>X1?i.copy(Kn(h,f,k,P)):i.lerpVectors(h,f,.5);const N=30;l.subVectors(f,h).normalize().multiplyScalar(N/2),j.subVectors(i,l),u.addVectors(i,l);const X=new $().addVectors(h,j).multiplyScalar(.5),L=new $().addVectors(u,f).multiplyScalar(.5);(D=_.setPoints)==null||D.call(_,h,j,X),(oe=M.setPoints)==null||oe.call(M,u,f,L),w.position.set(f.x,f.y,f.z),w.lookAt(h),w.rotateX(-Math.PI/2),g.position.set(i.x,i.y,i.z),g.lookAt(a.position);let Q=Math.atan2(f.y-h.y,f.x-h.x);(Q>Math.PI/2||Q<-Math.PI/2)&&(Q+=Math.PI),g.rotation.set(0,0,Q);const J=h.distanceTo(f),Z=J{if(m==="CHILD_OF"||S==="string"||T==="string")return;const E=o==null?void 0:o.find(g=>g.ref_id===S),_=o==null?void 0:o.find(g=>g.ref_id===T),M=(E==null?void 0:E.type)||"",w=(_==null?void 0:_.type)||"";n(y,m,M,w)};return s.jsx("group",{ref:e,children:t.map(m=>s.jsxs("group",{children:[s.jsx($t,{color:"white",end:[0,0,0],lineWidth:1,start:[0,0,0]}),s.jsx($t,{color:"white",end:[0,0,0],lineWidth:1,start:[0,0,0]}),s.jsxs("mesh",{position:new $(0,0,0),children:[s.jsx("coneGeometry",{args:[Un,Gn,32]}),s.jsx("meshBasicMaterial",{color:"white"})]}),s.jsx(Zt,{anchorX:"center",anchorY:"middle",color:"white",...qt,lineHeight:1,maxWidth:20,onClick:()=>b(m.edge_type,m.source,m.target,m.ref_id),rotation:[0,0,0],textAlign:"center",children:ot(m.edge_type,It)})]},m.ref_id))})};eo.displayName="Lines";const Xn=["#ff13c9","#5af0ff","#3233ff","#c2f0c2","#ff6666","#99ccff","#ffb3b3"],Zn=F.div` +`;var Nn=Object.defineProperty,zn=(t,o,s)=>o in t?Nn(t,o,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[o]=s,C=(t,o,s)=>(zn(t,typeof o!="symbol"?o+"":o,s),s);const ze=new Ro,kt=new Bo,Rn=Math.cos(70*(Math.PI/180)),_t=(t,o)=>(t%o+o)%o;let Bn=class extends Do{constructor(o,s){super(),C(this,"object"),C(this,"domElement"),C(this,"enabled",!0),C(this,"target",new $),C(this,"minDistance",0),C(this,"maxDistance",1/0),C(this,"minZoom",0),C(this,"maxZoom",1/0),C(this,"minPolarAngle",0),C(this,"maxPolarAngle",Math.PI),C(this,"minAzimuthAngle",-1/0),C(this,"maxAzimuthAngle",1/0),C(this,"enableDamping",!1),C(this,"dampingFactor",.05),C(this,"enableZoom",!0),C(this,"zoomSpeed",1),C(this,"enableRotate",!0),C(this,"rotateSpeed",1),C(this,"enablePan",!0),C(this,"panSpeed",1),C(this,"screenSpacePanning",!0),C(this,"keyPanSpeed",7),C(this,"zoomToCursor",!1),C(this,"autoRotate",!1),C(this,"autoRotateSpeed",2),C(this,"reverseOrbit",!1),C(this,"reverseHorizontalOrbit",!1),C(this,"reverseVerticalOrbit",!1),C(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),C(this,"mouseButtons",{LEFT:he.ROTATE,MIDDLE:he.DOLLY,RIGHT:he.PAN}),C(this,"touches",{ONE:me.ROTATE,TWO:me.DOLLY_PAN}),C(this,"target0"),C(this,"position0"),C(this,"zoom0"),C(this,"_domElementKeyEvents",null),C(this,"getPolarAngle"),C(this,"getAzimuthalAngle"),C(this,"setPolarAngle"),C(this,"setAzimuthalAngle"),C(this,"getDistance"),C(this,"listenToKeyEvents"),C(this,"stopListenToKeyEvents"),C(this,"saveState"),C(this,"reset"),C(this,"update"),C(this,"connect"),C(this,"dispose"),this.object=o,this.domElement=s,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>u.phi,this.getAzimuthalAngle=()=>u.theta,this.setPolarAngle=r=>{let p=_t(r,2*Math.PI),O=u.phi;O<0&&(O+=2*Math.PI),p<0&&(p+=2*Math.PI);let z=Math.abs(p-O);2*Math.PI-z{let p=_t(r,2*Math.PI),O=u.theta;O<0&&(O+=2*Math.PI),p<0&&(p+=2*Math.PI);let z=Math.abs(p-O);2*Math.PI-ze.object.position.distanceTo(e.target),this.listenToKeyEvents=r=>{r.addEventListener("keydown",qe),this._domElementKeyEvents=r},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",qe),this._domElementKeyEvents=null},this.saveState=()=>{e.target0.copy(e.target),e.position0.copy(e.object.position),e.zoom0=e.object.zoom},this.reset=()=>{e.target.copy(e.target0),e.object.position.copy(e.position0),e.object.zoom=e.zoom0,e.object.updateProjectionMatrix(),e.dispatchEvent(a),e.update(),l=i.NONE},this.update=(()=>{const r=new $,p=new $(0,1,0),O=new Ct().setFromUnitVectors(o.up,p),z=O.clone().invert(),U=new $,se=new Ct,ae=2*Math.PI;return function(){const gt=e.object.position;O.setFromUnitVectors(o.up,p),z.copy(O).invert(),r.copy(gt).sub(e.target),r.applyQuaternion(O),u.setFromVector3(r),e.autoRotate&&l===i.NONE&&X(oe()),e.enableDamping?(u.theta+=f.theta*e.dampingFactor,u.phi+=f.phi*e.dampingFactor):(u.theta+=f.theta,u.phi+=f.phi);let re=e.minAzimuthAngle,ie=e.maxAzimuthAngle;isFinite(re)&&isFinite(ie)&&(re<-Math.PI?re+=ae:re>Math.PI&&(re-=ae),ie<-Math.PI?ie+=ae:ie>Math.PI&&(ie-=ae),re<=ie?u.theta=Math.max(re,Math.min(ie,u.theta)):u.theta=u.theta>(re+ie)/2?Math.max(re,u.theta):Math.min(ie,u.theta)),u.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,u.phi)),u.makeSafe(),e.enableDamping===!0?e.target.addScaledVector(b,e.dampingFactor):e.target.add(b),e.zoomToCursor&&R||e.object.isOrthographicCamera?u.radius=be(u.radius):u.radius=be(u.radius*h),r.setFromSpherical(u),r.applyQuaternion(z),gt.copy(e.target).add(r),e.object.matrixAutoUpdate||e.object.updateMatrix(),e.object.lookAt(e.target),e.enableDamping===!0?(f.theta*=1-e.dampingFactor,f.phi*=1-e.dampingFactor,b.multiplyScalar(1-e.dampingFactor)):(f.set(0,0,0),b.set(0,0,0));let _e=!1;if(e.zoomToCursor&&R){let je=null;if(e.object instanceof Ie&&e.object.isPerspectiveCamera){const ve=r.length();je=be(ve*h);const $e=ve-je;e.object.position.addScaledVector(P,$e),e.object.updateMatrixWorld()}else if(e.object.isOrthographicCamera){const ve=new $(k.x,k.y,0);ve.unproject(e.object),e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom/h)),e.object.updateProjectionMatrix(),_e=!0;const $e=new $(k.x,k.y,0);$e.unproject(e.object),e.object.position.sub($e).add(ve),e.object.updateMatrixWorld(),je=r.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),e.zoomToCursor=!1;je!==null&&(e.screenSpacePanning?e.target.set(0,0,-1).transformDirection(e.object.matrix).multiplyScalar(je).add(e.object.position):(ze.origin.copy(e.object.position),ze.direction.set(0,0,-1).transformDirection(e.object.matrix),Math.abs(e.object.up.dot(ze.direction))j||8*(1-se.dot(e.object.quaternion))>j?(e.dispatchEvent(a),U.copy(e.object.position),se.copy(e.object.quaternion),_e=!1,!0):!1}})(),this.connect=r=>{r===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),e.domElement=r,e.domElement.style.touchAction="none",e.domElement.addEventListener("contextmenu",ft),e.domElement.addEventListener("pointerdown",dt),e.domElement.addEventListener("pointercancel",ut),e.domElement.addEventListener("wheel",pt)},this.dispose=()=>{var r,p,O,z,U,se;(r=e.domElement)==null||r.removeEventListener("contextmenu",ft),(p=e.domElement)==null||p.removeEventListener("pointerdown",dt),(O=e.domElement)==null||O.removeEventListener("pointercancel",ut),(z=e.domElement)==null||z.removeEventListener("wheel",pt),(U=e.domElement)==null||U.ownerDocument.removeEventListener("pointermove",Xe),(se=e.domElement)==null||se.ownerDocument.removeEventListener("pointerup",Ze),e._domElementKeyEvents!==null&&e._domElementKeyEvents.removeEventListener("keydown",qe)};const e=this,a={type:"change"},c={type:"start"},d={type:"end"},i={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let l=i.NONE;const j=1e-6,u=new Tt,f=new Tt;let h=1;const b=new $,m=new ee,A=new ee,T=new ee,y=new ee,E=new ee,_=new ee,S=new ee,w=new ee,g=new ee,P=new $,k=new ee;let R=!1;const M=[],D={};function oe(){return 2*Math.PI/60/60*e.autoRotateSpeed}function N(){return Math.pow(.95,e.zoomSpeed)}function X(r){e.reverseOrbit||e.reverseHorizontalOrbit?f.theta+=r:f.theta-=r}function L(r){e.reverseOrbit||e.reverseVerticalOrbit?f.phi+=r:f.phi-=r}const Q=(()=>{const r=new $;return function(O,z){r.setFromMatrixColumn(z,0),r.multiplyScalar(-O),b.add(r)}})(),J=(()=>{const r=new $;return function(O,z){e.screenSpacePanning===!0?r.setFromMatrixColumn(z,1):(r.setFromMatrixColumn(z,0),r.crossVectors(e.object.up,r)),r.multiplyScalar(O),b.add(r)}})(),Z=(()=>{const r=new $;return function(O,z){const U=e.domElement;if(U&&e.object instanceof Ie&&e.object.isPerspectiveCamera){const se=e.object.position;r.copy(se).sub(e.target);let ae=r.length();ae*=Math.tan(e.object.fov/2*Math.PI/180),Q(2*O*ae/U.clientHeight,e.object.matrix),J(2*z*ae/U.clientHeight,e.object.matrix)}else U&&e.object instanceof Ne&&e.object.isOrthographicCamera?(Q(O*(e.object.right-e.object.left)/e.object.zoom/U.clientWidth,e.object.matrix),J(z*(e.object.top-e.object.bottom)/e.object.zoom/U.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),e.enablePan=!1)}})();function H(r){e.object instanceof Ie&&e.object.isPerspectiveCamera||e.object instanceof Ne&&e.object.isOrthographicCamera?h/=r:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function G(r){e.object instanceof Ie&&e.object.isPerspectiveCamera||e.object instanceof Ne&&e.object.isOrthographicCamera?h*=r:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)}function le(r){if(!e.zoomToCursor||!e.domElement)return;R=!0;const p=e.domElement.getBoundingClientRect(),O=r.clientX-p.left,z=r.clientY-p.top,U=p.width,se=p.height;k.x=O/U*2-1,k.y=-(z/se)*2+1,P.set(k.x,k.y,1).unproject(e.object).sub(e.object.position).normalize()}function be(r){return Math.max(e.minDistance,Math.min(e.maxDistance,r))}function ye(r){m.set(r.clientX,r.clientY)}function We(r){le(r),S.set(r.clientX,r.clientY)}function Te(r){y.set(r.clientX,r.clientY)}function Ue(r){A.set(r.clientX,r.clientY),T.subVectors(A,m).multiplyScalar(e.rotateSpeed);const p=e.domElement;p&&(X(2*Math.PI*T.x/p.clientHeight),L(2*Math.PI*T.y/p.clientHeight)),m.copy(A),e.update()}function Ye(r){w.set(r.clientX,r.clientY),g.subVectors(w,S),g.y>0?H(N()):g.y<0&&G(N()),S.copy(w),e.update()}function Oe(r){E.set(r.clientX,r.clientY),_.subVectors(E,y).multiplyScalar(e.panSpeed),Z(_.x,_.y),y.copy(E),e.update()}function Ge(r){le(r),r.deltaY<0?G(N()):r.deltaY>0&&H(N()),e.update()}function He(r){let p=!1;switch(r.code){case e.keys.UP:Z(0,e.keyPanSpeed),p=!0;break;case e.keys.BOTTOM:Z(0,-e.keyPanSpeed),p=!0;break;case e.keys.LEFT:Z(e.keyPanSpeed,0),p=!0;break;case e.keys.RIGHT:Z(-e.keyPanSpeed,0),p=!0;break}p&&(r.preventDefault(),e.update())}function Ae(){if(M.length==1)m.set(M[0].pageX,M[0].pageY);else{const r=.5*(M[0].pageX+M[1].pageX),p=.5*(M[0].pageY+M[1].pageY);m.set(r,p)}}function Me(){if(M.length==1)y.set(M[0].pageX,M[0].pageY);else{const r=.5*(M[0].pageX+M[1].pageX),p=.5*(M[0].pageY+M[1].pageY);y.set(r,p)}}function Se(){const r=M[0].pageX-M[1].pageX,p=M[0].pageY-M[1].pageY,O=Math.sqrt(r*r+p*p);S.set(0,O)}function Ke(){e.enableZoom&&Se(),e.enablePan&&Me()}function ke(){e.enableZoom&&Se(),e.enableRotate&&Ae()}function we(r){if(M.length==1)A.set(r.pageX,r.pageY);else{const O=Qe(r),z=.5*(r.pageX+O.x),U=.5*(r.pageY+O.y);A.set(z,U)}T.subVectors(A,m).multiplyScalar(e.rotateSpeed);const p=e.domElement;p&&(X(2*Math.PI*T.x/p.clientHeight),L(2*Math.PI*T.y/p.clientHeight)),m.copy(A)}function I(r){if(M.length==1)E.set(r.pageX,r.pageY);else{const p=Qe(r),O=.5*(r.pageX+p.x),z=.5*(r.pageY+p.y);E.set(O,z)}_.subVectors(E,y).multiplyScalar(e.panSpeed),Z(_.x,_.y),y.copy(E)}function B(r){const p=Qe(r),O=r.pageX-p.x,z=r.pageY-p.y,U=Math.sqrt(O*O+z*z);w.set(0,U),g.set(0,Math.pow(w.y/S.y,e.zoomSpeed)),H(g.y),S.copy(w)}function W(r){e.enableZoom&&B(r),e.enablePan&&I(r)}function fe(r){e.enableZoom&&B(r),e.enableRotate&&we(r)}function dt(r){var p,O;e.enabled!==!1&&(M.length===0&&((p=e.domElement)==null||p.ownerDocument.addEventListener("pointermove",Xe),(O=e.domElement)==null||O.ownerDocument.addEventListener("pointerup",Ze)),io(r),r.pointerType==="touch"?so(r):oo(r))}function Xe(r){e.enabled!==!1&&(r.pointerType==="touch"?ro(r):no(r))}function Ze(r){var p,O,z;ht(r),M.length===0&&((p=e.domElement)==null||p.releasePointerCapture(r.pointerId),(O=e.domElement)==null||O.ownerDocument.removeEventListener("pointermove",Xe),(z=e.domElement)==null||z.ownerDocument.removeEventListener("pointerup",Ze)),e.dispatchEvent(d),l=i.NONE}function ut(r){ht(r)}function oo(r){let p;switch(r.button){case 0:p=e.mouseButtons.LEFT;break;case 1:p=e.mouseButtons.MIDDLE;break;case 2:p=e.mouseButtons.RIGHT;break;default:p=-1}switch(p){case he.DOLLY:if(e.enableZoom===!1)return;We(r),l=i.DOLLY;break;case he.ROTATE:if(r.ctrlKey||r.metaKey||r.shiftKey){if(e.enablePan===!1)return;Te(r),l=i.PAN}else{if(e.enableRotate===!1)return;ye(r),l=i.ROTATE}break;case he.PAN:if(r.ctrlKey||r.metaKey||r.shiftKey){if(e.enableRotate===!1)return;ye(r),l=i.ROTATE}else{if(e.enablePan===!1)return;Te(r),l=i.PAN}break;default:l=i.NONE}l!==i.NONE&&e.dispatchEvent(c)}function no(r){if(e.enabled!==!1)switch(l){case i.ROTATE:if(e.enableRotate===!1)return;Ue(r);break;case i.DOLLY:if(e.enableZoom===!1)return;Ye(r);break;case i.PAN:if(e.enablePan===!1)return;Oe(r);break}}function pt(r){e.enabled===!1||e.enableZoom===!1||l!==i.NONE&&l!==i.ROTATE||(r.preventDefault(),e.dispatchEvent(c),Ge(r),e.dispatchEvent(d))}function qe(r){e.enabled===!1||e.enablePan===!1||He(r)}function so(r){switch(mt(r),M.length){case 1:switch(e.touches.ONE){case me.ROTATE:if(e.enableRotate===!1)return;Ae(),l=i.TOUCH_ROTATE;break;case me.PAN:if(e.enablePan===!1)return;Me(),l=i.TOUCH_PAN;break;default:l=i.NONE}break;case 2:switch(e.touches.TWO){case me.DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;Ke(),l=i.TOUCH_DOLLY_PAN;break;case me.DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;ke(),l=i.TOUCH_DOLLY_ROTATE;break;default:l=i.NONE}break;default:l=i.NONE}l!==i.NONE&&e.dispatchEvent(c)}function ro(r){switch(mt(r),l){case i.TOUCH_ROTATE:if(e.enableRotate===!1)return;we(r),e.update();break;case i.TOUCH_PAN:if(e.enablePan===!1)return;I(r),e.update();break;case i.TOUCH_DOLLY_PAN:if(e.enableZoom===!1&&e.enablePan===!1)return;W(r),e.update();break;case i.TOUCH_DOLLY_ROTATE:if(e.enableZoom===!1&&e.enableRotate===!1)return;fe(r),e.update();break;default:l=i.NONE}}function ft(r){e.enabled!==!1&&r.preventDefault()}function io(r){M.push(r)}function ht(r){delete D[r.pointerId];for(let p=0;pnew Vo(void 0,void 0,void 0)),j=x.useCallback((f,h,b,m=20)=>(f instanceof $?l.v0.copy(f):l.v0.set(...f),h instanceof $?l.v2.copy(h):l.v2.set(...h),b instanceof $?l.v1.copy(b):l.v1.copy(l.v0.clone().add(l.v2.clone().sub(l.v0)).add(Dn.set(0,l.v0.y-l.v2.y,0))),l.getPoints(m)),[]);x.useLayoutEffect(()=>{i.current.setPoints=(f,h,b)=>{const m=j(f,h,b);i.current.geometry&&i.current.geometry.setPositions(m.map(A=>A.toArray()).flat())}},[]);const u=x.useMemo(()=>j(o,s,e,a),[o,s,e,a]);return x.createElement(ko,Y({ref:_o([i,d]),points:u},c))}),Vn=x.forwardRef(({makeDefault:t,camera:o,regress:s,domElement:e,enableDamping:a=!0,onChange:c,onStart:d,onEnd:i,...l},j)=>{const u=ne(w=>w.invalidate),f=ne(w=>w.camera),h=ne(w=>w.gl),b=ne(w=>w.events),m=ne(w=>w.setEvents),A=ne(w=>w.set),T=ne(w=>w.get),y=ne(w=>w.performance),E=o||f,_=e||b.connected||h.domElement,S=x.useMemo(()=>new Bn(E),[E]);return Le(()=>{S.enabled&&S.update()},-1),x.useEffect(()=>(S.connect(_),()=>void S.dispose()),[_,s,S,u]),x.useEffect(()=>{const w=k=>{u(),s&&y.regress(),c&&c(k)},g=k=>{d&&d(k)},P=k=>{i&&i(k)};return S.addEventListener("change",w),S.addEventListener("start",g),S.addEventListener("end",P),()=>{S.removeEventListener("start",g),S.removeEventListener("end",P),S.removeEventListener("change",w)}},[c,d,i,S,u,m]),x.useEffect(()=>{if(t){const w=T().controls;return A({controls:S}),()=>A({controls:w})}},[t,S]),x.createElement("primitive",Y({ref:j,object:S,enableDamping:a},l))});function Fn(t){const o=t+"Geometry";return x.forwardRef(({args:s,children:e,...a},c)=>x.createElement("mesh",Y({ref:c},a),x.createElement(o,{attach:"geometry",args:s}),e))}const Ln=Fn("circle"),te=10,Wn=2,Un=2,It=10,Yn=10,Nt=(t,o,s)=>{const c=new $().subVectors(o,t).normalize().multiplyScalar(s);return new $().addVectors(t,c)},Gn=(t,o,s,e)=>{const a=new $().lerpVectors(t,o,.5),c=new $().subVectors(o,t).normalize(),d=new $(-c.y,c.x,c.z).normalize(),i=(s-e/2)*Yn;return new $().addVectors(a,d.multiplyScalar(i))},eo=({links:t,nodes:o,onEdgeClick:s})=>{const e=x.useRef(null),{camera:a}=ne(),c=new $,d=new $,i=new $,l=new $,j=new $,u=new $,f=new $,h=new $;Le(()=>{e.current&&o&&e.current.children.forEach((m,A)=>{var R,M,D,oe;const T=t[A];if(!T)return;const y=o.find(N=>N.ref_id===T.target),E=o.find(N=>N.ref_id===T.source);c.set((E==null?void 0:E.x)||0,(E==null?void 0:E.y)||0,(E==null?void 0:E.z)||0),d.set((y==null?void 0:y.x)||0,(y==null?void 0:y.y)||0,(y==null?void 0:y.z)||0);const _=m.children[0],S=m.children[1],w=m.children[2],g=m.children[3],P=t.filter(N=>N.source===T.source&&N.target===T.target||N.source===T.target&&N.target===T.source).length,k=t.filter((N,X)=>X1?i.copy(Gn(h,f,k,P)):i.lerpVectors(h,f,.5);const N=30;l.subVectors(f,h).normalize().multiplyScalar(N/2),j.subVectors(i,l),u.addVectors(i,l);const X=new $().addVectors(h,j).multiplyScalar(.5),L=new $().addVectors(u,f).multiplyScalar(.5);(D=_.setPoints)==null||D.call(_,h,j,X),(oe=S.setPoints)==null||oe.call(S,u,f,L),w.position.set(f.x,f.y,f.z),w.lookAt(h),w.rotateX(-Math.PI/2),g.position.set(i.x,i.y,i.z),g.lookAt(a.position);let Q=Math.atan2(f.y-h.y,f.x-h.x);(Q>Math.PI/2||Q<-Math.PI/2)&&(Q+=Math.PI),g.rotation.set(0,0,Q);const J=h.distanceTo(f),Z=J{if(m==="CHILD_OF"||A==="string"||T==="string")return;const E=o==null?void 0:o.find(g=>g.ref_id===A),_=o==null?void 0:o.find(g=>g.ref_id===T),S=(E==null?void 0:E.type)||"",w=(_==null?void 0:_.type)||"";s(y,m,S,w)};return n.jsx("group",{ref:e,children:t.map(m=>n.jsxs("group",{children:[n.jsx($t,{color:"white",end:[0,0,0],lineWidth:1,start:[0,0,0]}),n.jsx($t,{color:"white",end:[0,0,0],lineWidth:1,start:[0,0,0]}),n.jsxs("mesh",{position:new $(0,0,0),children:[n.jsx("coneGeometry",{args:[Wn,Un,32]}),n.jsx("meshBasicMaterial",{color:"white"})]}),n.jsx(qt,{anchorX:"center",anchorY:"middle",color:"white",...Qt,lineHeight:1,maxWidth:20,onClick:()=>b(m.edge_type,m.source,m.target,m.ref_id),rotation:[0,0,0],textAlign:"center",children:ot(m.edge_type,It)})]},m.ref_id))})};eo.displayName="Lines";const Hn=["#ff13c9","#5af0ff","#3233ff","#c2f0c2","#ff6666","#99ccff","#ffb3b3"],Kn=F.div` color: white; background: rgba(0, 0, 0, 1); padding: 2px 5px; @@ -45,9 +45,9 @@ import{o as nt,p as st,s as pe,a as U,E as ao,r as x,_ as rt,j as s,v as it,q as font-size: 12px; font-style: normal; font-weight: 400; -`,qn=F(Io)` +`,Xn=F($o)` position: absolute; -`;new Lo(2,2,2);const to=x.memo(({node:t,setSelectedNode:o,onSimulationUpdate:n,isSelected:e})=>{var S;const a=x.useRef(null),[c,d]=x.useState(!1);console.log(e);const{size:i,camera:l}=ne(),j=Oo(T=>{if(t.type==="Thing")return;const{xy:[y,E],down:_,dragging:M,first:w,elapsedTime:g}=T;if(!(!M||w||g<100)&&_&&a.current){n();const P=(y-i.left)/window.innerWidth*i.width,k=(E-i.top)/window.innerHeight*i.height,D=new $(P/i.width*2-1,-k/i.height*2+1,0).unproject(l).multiply(new $(1,1,0)).clone();t.fx=D.x,t.fy=D.y}});Le(()=>{a.current&&a.current.position.set(t.x||0,t.y||0,0)});const u=Xn[(S=t==null?void 0:t.children)==null?void 0:S.length]||"red",f=T=>{T.stopPropagation(),t.type!=="Thing"&&o()},h=ot(t.type||"",te),b=()=>{d(!0)},m=()=>{d(!1)};return s.jsxs("mesh",{ref:a,onClick:f,...j(),onPointerOut:m,onPointerOver:b,position:new $(t.x,t.y,0),children:[s.jsx(Yn,{args:[te,30,20],children:s.jsx("meshStandardMaterial",{attach:"material",color:u})}),s.jsx(Zt,{...qt,clipRect:[-te,-te,te,te],color:"#000",fontSize:2,maxWidth:te*2,textAlign:"left",children:h}),c&&s.jsx(qn,{position:[0,5,0],zIndexRange:[100,0],children:s.jsx(Zn,{children:t.type})})]})});to.displayName="Node";const Qn=({simulation:t,setSelectedSchemaId:o,selectedId:n,setIsAddEdgeNode:e})=>{const[a]=Jt(d=>[d.schemas]),c=()=>{t&&(t.alpha(.05),t.restart())};return s.jsx(s.Fragment,{children:a.map((d,i)=>{const l=t.nodes()[i];return l?s.jsx(to,{isSelected:l.ref_id===n,node:l,onSimulationUpdate:c,setSelectedNode:()=>{e(!1),o(l.ref_id)}},l.ref_id):null})})},Jn=({schemasWithPositions:t,filteredLinks:o,setSelectedSchemaId:n,selectedSchemaId:e,setIsAddEdgeNode:a,onEdgeClick:c})=>{const[d,i]=x.useState(null),l=Pt(t),j=Pt(o);return x.useEffect(()=>{if(!t.length||!o.length)return;const u=structuredClone(t),f=structuredClone(o);if(d){l&&l.length!==t.length&&j&&j.length!==o.length&&(d.nodes(u).force("link",bt(f).id(b=>b.ref_id).distance(100)).force("charge",yt()).force("center",wt()).force("collide",jt(te+5)).alpha(.5).restart(),i({...d}));return}const h=fo(u).force("link",bt(f).id(b=>b.ref_id).distance(120)).force("charge",yt().strength(-100)).force("center",wt()).force("collide",jt(te+5));i(h)},[t,d,o,l,j]),Le(()=>{}),d?s.jsxs(s.Fragment,{children:[s.jsx(eo,{links:o,nodes:d.nodes(),onEdgeClick:c}),s.jsx(Qn,{selectedId:e,setIsAddEdgeNode:a,setSelectedSchemaId:n,simulation:d})]}):null},tt=new Wo(0),es=({selectedSchemaId:t,links:o,schemasWithPositions:n,setSelectedSchemaId:e,setIsAddEdgeNode:a,onEdgeClick:c})=>s.jsxs(No,{camera:{zoom:1,position:[0,0,200]},id:"schema-canvas",linear:!0,orthographic:!0,children:[s.jsx("color",{args:[tt.r,tt.g,tt.b],attach:"background"}),ho&&s.jsx(zo,{position:"right-bottom"}),s.jsx(ts,{}),s.jsx(Ro,{}),s.jsx(Jn,{filteredLinks:o,onEdgeClick:c,schemasWithPositions:n,selectedSchemaId:t,setIsAddEdgeNode:a,setSelectedSchemaId:e})]}),ts=()=>{x.useEffect(()=>{const n=a=>{["Meta","Alt"].includes(a.key)&&(document.body.style.cursor="grab")},e=a=>{["Meta","Alt"].includes(a.key)&&(document.body.style.cursor="default")};return window.addEventListener("keydown",n,!1),window.addEventListener("keyup",e,!1),()=>{window.removeEventListener("keydown",n,!1),window.removeEventListener("keyup",e,!1)}},[]);const t=()=>{document.body.style.cursor="grabbing"},o=()=>{document.body.style.cursor="default"};return s.jsx(Ln,{dampingFactor:1,enableDamping:!0,enablePan:!0,enableRotate:!1,enableZoom:!0,maxZoom:20,minZoom:1,onEnd:o,onStart:t,zoomSpeed:1.5,zoomToCursor:!0})},os=({onCreateNew:t,onAddEdgeNode:o})=>s.jsxs(ns,{children:[s.jsx(ss,{children:"BLUEPRINT"}),s.jsxs(zt,{"data-testid":"add-schema-type",onClick:t,children:[s.jsx(Rt,{children:s.jsx(Ot,{})}),s.jsx(q,{children:"Add Type"})]}),s.jsxs(zt,{"data-testid":"add-edge",onClick:o,children:[s.jsx(Rt,{children:s.jsx(Ot,{})}),s.jsx(q,{children:"Add Edge"})]})]}),ns=F(v).attrs({align:"flex-start",direction:"column",justify:"flex-start"})` +`;new Fo(2,2,2);const to=x.memo(({node:t,setSelectedNode:o,onSimulationUpdate:s,isSelected:e})=>{var A;const a=x.useRef(null),[c,d]=x.useState(!1);console.log(e);const{size:i,camera:l}=ne(),j=To(T=>{if(t.type==="Thing")return;const{xy:[y,E],down:_,dragging:S,first:w,elapsedTime:g}=T;if(!(!S||w||g<100)&&_&&a.current){s();const P=(y-i.left)/window.innerWidth*i.width,k=(E-i.top)/window.innerHeight*i.height,D=new $(P/i.width*2-1,-k/i.height*2+1,0).unproject(l).multiply(new $(1,1,0)).clone();t.fx=D.x,t.fy=D.y}});Le(()=>{a.current&&a.current.position.set(t.x||0,t.y||0,0)});const u=Hn[(A=t==null?void 0:t.children)==null?void 0:A.length]||"red",f=T=>{T.stopPropagation(),t.type!=="Thing"&&o()},h=ot(t.type||"",te),b=()=>{d(!0)},m=()=>{d(!1)};return n.jsxs("mesh",{ref:a,onClick:f,...j(),onPointerOut:m,onPointerOver:b,position:new $(t.x,t.y,0),children:[n.jsx(Ln,{args:[te,30,20],children:n.jsx("meshStandardMaterial",{attach:"material",color:u})}),n.jsx(qt,{...Qt,clipRect:[-te,-te,te,te],color:"#000",fontSize:2,maxWidth:te*2,textAlign:"left",children:h}),c&&n.jsx(Xn,{position:[0,5,0],zIndexRange:[100,0],children:n.jsx(Kn,{children:t.type})})]})});to.displayName="Node";const Zn=({simulation:t,setSelectedSchemaId:o,selectedId:s,setIsAddEdgeNode:e})=>{const[a]=Xt(d=>[d.schemas]),c=()=>{t&&(t.alpha(.05),t.restart())};return n.jsx(n.Fragment,{children:a.map((d,i)=>{const l=t.nodes()[i];return l?n.jsx(to,{isSelected:l.ref_id===s,node:l,onSimulationUpdate:c,setSelectedNode:()=>{e(!1),o(l.ref_id)}},l.ref_id):null})})},qn=({schemasWithPositions:t,filteredLinks:o,setSelectedSchemaId:s,selectedSchemaId:e,setIsAddEdgeNode:a,onEdgeClick:c})=>{const[d,i]=x.useState(null),l=Pt(t),j=Pt(o);return x.useEffect(()=>{if(!t.length||!o.length)return;const u=structuredClone(t),f=structuredClone(o);if(d){l&&l.length!==t.length&&j&&j.length!==o.length&&(d.nodes(u).force("link",bt(f).id(b=>b.ref_id).distance(100)).force("charge",yt()).force("center",wt()).force("collide",jt(te+5)).alpha(.5).restart(),i({...d}));return}const h=po(u).force("link",bt(f).id(b=>b.ref_id).distance(120)).force("charge",yt().strength(-100)).force("center",wt()).force("collide",jt(te+5));i(h)},[t,d,o,l,j]),Le(()=>{}),d?n.jsxs(n.Fragment,{children:[n.jsx(eo,{links:o,nodes:d.nodes(),onEdgeClick:c}),n.jsx(Zn,{selectedId:e,setIsAddEdgeNode:a,setSelectedSchemaId:s,simulation:d})]}):null},tt=new Lo(0),Qn=({selectedSchemaId:t,links:o,schemasWithPositions:s,setSelectedSchemaId:e,setIsAddEdgeNode:a,onEdgeClick:c})=>n.jsxs(Io,{camera:{zoom:1,position:[0,0,200]},id:"schema-canvas",linear:!0,orthographic:!0,children:[n.jsx("color",{args:[tt.r,tt.g,tt.b],attach:"background"}),fo&&n.jsx(No,{position:"right-bottom"}),n.jsx(Jn,{}),n.jsx(zo,{}),n.jsx(qn,{filteredLinks:o,onEdgeClick:c,schemasWithPositions:s,selectedSchemaId:t,setIsAddEdgeNode:a,setSelectedSchemaId:e})]}),Jn=()=>{x.useEffect(()=>{const s=a=>{["Meta","Alt"].includes(a.key)&&(document.body.style.cursor="grab")},e=a=>{["Meta","Alt"].includes(a.key)&&(document.body.style.cursor="default")};return window.addEventListener("keydown",s,!1),window.addEventListener("keyup",e,!1),()=>{window.removeEventListener("keydown",s,!1),window.removeEventListener("keyup",e,!1)}},[]);const t=()=>{document.body.style.cursor="grabbing"},o=()=>{document.body.style.cursor="default"};return n.jsx(Vn,{dampingFactor:1,enableDamping:!0,enablePan:!0,enableRotate:!1,enableZoom:!0,maxZoom:20,minZoom:1,onEnd:o,onStart:t,zoomSpeed:1.5,zoomToCursor:!0})},es=({onCreateNew:t,onAddEdgeNode:o})=>n.jsxs(ts,{children:[n.jsx(os,{children:"BLUEPRINT"}),n.jsxs(zt,{"data-testid":"add-schema-type",onClick:t,children:[n.jsx(Rt,{children:n.jsx(Ot,{})}),n.jsx(q,{children:"Add Type"})]}),n.jsxs(zt,{"data-testid":"add-edge",onClick:o,children:[n.jsx(Rt,{children:n.jsx(Ot,{})}),n.jsx(q,{children:"Add Edge"})]})]}),ts=F(v).attrs({align:"flex-start",direction:"column",justify:"flex-start"})` flex: 1 1 auto; z-index: 31; transition: opacity 1s; @@ -142,7 +142,7 @@ import{o as nt,p as st,s as pe,a as U,E as ao,r as x,_ as rt,j as s,v as it,q as justify-content: center; border: none; } -`,ss=F(v)` +`,os=F(v)` background: blue; align-items: center; justify-content: center; @@ -157,15 +157,15 @@ import{o as nt,p as st,s as pe,a as U,E as ao,r as x,_ as rt,j as s,v as it,q as justify-content: center; align-items: center; font-size: 24px; -`,rs={type:"",parent:""},Bt=({onSelect:t,dataTestId:o,edgeLink:n})=>{const e=lt({mode:"onChange",defaultValues:rs}),{watch:a,setValue:c}=e,[d,i]=x.useState([]),[l,j]=x.useState(!1),u=m=>{c("parent",(m==null?void 0:m.value)||""),t(m==null?void 0:m.value)},f=m=>m.charAt(0).toUpperCase()+m.slice(1);x.useEffect(()=>{(async()=>{j(!0);try{const T=(await Ut()).schemas.filter(y=>!y.is_deleted&&y.type).map(y=>(y==null?void 0:y.type)==="thing"?{label:"No Parent",value:y.type}:{label:f(y.type),value:y.type});i(T),n&&c("parent",n)}catch(S){console.warn(S)}finally{j(!1)}})()},[n,c]);const h=a("parent"),b=()=>{const m=d==null?void 0:d.find(S=>S.value===h);if(m)return m;if(n)return{label:n,value:n}};return s.jsx(Ve,{dataTestId:o,disabled:!!n,isLoading:l,onSelect:u,options:d||So,selectedValue:b()})},is=({selectedType:t,setSelectedFromNode:o,setSelectedToNode:n,edgeLinkData:e})=>s.jsxs(v,{children:[s.jsx(v,{align:"center",direction:"row",justify:"space-between",mb:35,children:s.jsx(v,{align:"center",direction:"row",children:s.jsx(as,{children:e!=null&&e.refId?"Edit Edge":"Add Edge"})})}),s.jsxs(v,{mb:25,children:[s.jsx(v,{mb:12,children:s.jsx(q,{children:"Source"})}),s.jsx(Bt,{dataTestId:"from_node",edgeLink:e==null?void 0:e.source,onSelect:o})]}),s.jsxs(v,{mb:10,children:[s.jsx(v,{mb:12,children:s.jsx(q,{children:"Edge Name"})}),s.jsx(v,{mb:12,children:s.jsx(De,{id:"cy-item-name",maxLength:250,name:"type",placeholder:"Enter type name",rules:{...Re},value:t})})]}),s.jsxs(v,{mb:25,children:[s.jsx(v,{mb:12,children:s.jsx(q,{children:"Destination"})}),s.jsx(Bt,{dataTestId:"to_node",edgeLink:e==null?void 0:e.target,onSelect:n})]})]}),as=F(q)` +`,ns={type:"",parent:""},Bt=({onSelect:t,dataTestId:o,edgeLink:s})=>{const e=lt({mode:"onChange",defaultValues:ns}),{watch:a,setValue:c}=e,[d,i]=x.useState([]),[l,j]=x.useState(!1),u=m=>{c("parent",(m==null?void 0:m.value)||""),t(m==null?void 0:m.value)},f=m=>m.charAt(0).toUpperCase()+m.slice(1);x.useEffect(()=>{(async()=>{j(!0);try{const T=(await Yt()).schemas.filter(y=>!y.is_deleted&&y.type).map(y=>(y==null?void 0:y.type)==="thing"?{label:"No Parent",value:y.type}:{label:f(y.type),value:y.type});i(T),s&&c("parent",s)}catch(A){console.warn(A)}finally{j(!1)}})()},[s,c]);const h=a("parent"),b=()=>{const m=d==null?void 0:d.find(A=>A.value===h);if(m)return m;if(s)return{label:s,value:s}};return n.jsx(Ve,{dataTestId:o,disabled:!!s,isLoading:l,onSelect:u,options:d||Oo,selectedValue:b()})},ss=({selectedType:t,setSelectedFromNode:o,setSelectedToNode:s,edgeLinkData:e})=>n.jsxs(v,{children:[n.jsx(v,{align:"center",direction:"row",justify:"space-between",mb:35,children:n.jsx(v,{align:"center",direction:"row",children:n.jsx(rs,{children:e!=null&&e.refId?"Edit Edge":"Add Edge"})})}),n.jsxs(v,{mb:25,children:[n.jsx(v,{mb:12,children:n.jsx(q,{children:"Source"})}),n.jsx(Bt,{dataTestId:"from_node",edgeLink:e==null?void 0:e.source,onSelect:o})]}),n.jsxs(v,{mb:10,children:[n.jsx(v,{mb:12,children:n.jsx(q,{children:"Edge Name"})}),n.jsx(v,{mb:12,children:n.jsx(De,{id:"cy-item-name",maxLength:250,name:"type",placeholder:"Enter type name",rules:{...Re},value:t})})]}),n.jsxs(v,{mb:25,children:[n.jsx(v,{mb:12,children:n.jsx(q,{children:"Destination"})}),n.jsx(Bt,{dataTestId:"to_node",edgeLink:e==null?void 0:e.target,onSelect:s})]})]}),rs=F(q)` font-size: 22px; font-weight: 600; -`,cs=({onCancel:t,edgeLinkData:o,setGraphLoading:n})=>{var g,P,k;const e=lt({mode:"onChange"}),{setValue:a,getValues:c}=e,[d,i]=x.useState(!1),[l,j]=x.useState(!1),[u,f]=x.useState(""),[h,b]=x.useState(""),[m,S]=x.useState(""),T=e.watch("type");x.useEffect(()=>{a("type",o==null?void 0:o.edgeType)},[o==null?void 0:o.edgeType,a]),x.useEffect(()=>{f(T)},[T]);const y=e.handleSubmit(async R=>{i(!0),n(!0);const A={source:h,target:m,edge_type:R.type},D={ref_id:o==null?void 0:o.refId,edge_type:R.type};try{o!=null&&o.refId?await mo(D):(!m||!h)&&await go(A)}catch(oe){console.warn("API Error:",oe)}finally{i(!1),n(!1),b(""),S(""),t()}}),E=(P=(g=c())==null?void 0:g.type)==null?void 0:P.trim(),_=E&&((k=o==null?void 0:o.edgeType)==null?void 0:k.trim())!==E,M=o!=null&&o.refId?d||!_:d||!m||!h||!u,w=async()=>{j(!0),n(!0);try{o!=null&&o.refId&&await xo(o==null?void 0:o.refId)}catch(R){console.warn("API Error:",R)}finally{j(!1),n(!1),b(""),S(""),t()}};return s.jsx(Kt,{...e,children:s.jsxs("form",{id:"add-type-form",onSubmit:y,children:[s.jsx(is,{edgeLinkData:o,selectedType:u,setSelectedFromNode:b,setSelectedToNode:S}),s.jsxs(v,{direction:"row",justify:"space-between",mt:20,children:[(o==null?void 0:o.refId)&&s.jsx(v,{direction:"column",children:s.jsxs(ds,{color:"secondary",disabled:l,onClick:w,size:"large",style:{marginRight:20},variant:"contained",children:["Delete",l&&s.jsxs(Dt,{children:[s.jsx(ue,{color:V.lightGray,size:12})," "]})]})}),s.jsxs(ls,{color:"secondary",disabled:M,onClick:y,size:"large",variant:"contained",children:["Confirm",d&&s.jsxs(Dt,{children:[s.jsx(ue,{color:V.lightGray,size:12})," "]})]})]})]})})},ls=F(Ce)` +`,is=({onCancel:t,edgeLinkData:o,setGraphLoading:s})=>{var g,P,k;const e=lt({mode:"onChange"}),{setValue:a,getValues:c}=e,[d,i]=x.useState(!1),[l,j]=x.useState(!1),[u,f]=x.useState(""),[h,b]=x.useState(""),[m,A]=x.useState(""),T=e.watch("type");x.useEffect(()=>{a("type",o==null?void 0:o.edgeType)},[o==null?void 0:o.edgeType,a]),x.useEffect(()=>{f(T)},[T]);const y=e.handleSubmit(async R=>{i(!0),s(!0);const M={source:h,target:m,edge_type:R.type},D={ref_id:o==null?void 0:o.refId,edge_type:R.type};try{o!=null&&o.refId?await ho(D):(!m||!h)&&await mo(M)}catch(oe){console.warn("API Error:",oe)}finally{i(!1),s(!1),b(""),A(""),t()}}),E=(P=(g=c())==null?void 0:g.type)==null?void 0:P.trim(),_=E&&((k=o==null?void 0:o.edgeType)==null?void 0:k.trim())!==E,S=o!=null&&o.refId?d||!_:d||!m||!h||!u,w=async()=>{j(!0),s(!0);try{o!=null&&o.refId&&await go(o==null?void 0:o.refId)}catch(R){console.warn("API Error:",R)}finally{j(!1),s(!1),b(""),A(""),t()}};return n.jsx(Kt,{...e,children:n.jsxs("form",{id:"add-type-form",onSubmit:y,children:[n.jsx(ss,{edgeLinkData:o,selectedType:u,setSelectedFromNode:b,setSelectedToNode:A}),n.jsxs(v,{direction:"row",justify:"space-between",mt:20,children:[(o==null?void 0:o.refId)&&n.jsx(v,{direction:"column",children:n.jsxs(cs,{color:"secondary",disabled:l,onClick:w,size:"large",style:{marginRight:20},variant:"contained",children:["Delete",l&&n.jsxs(Dt,{children:[n.jsx(ue,{color:V.lightGray,size:12})," "]})]})}),n.jsxs(as,{color:"secondary",disabled:S,onClick:y,size:"large",variant:"contained",children:["Confirm",d&&n.jsxs(Dt,{children:[n.jsx(ue,{color:V.lightGray,size:12})," "]})]})]})]})})},as=F(Ce)` width: 293px !important; margin: 0 0 10px auto !important; `,Dt=F.span` margin-top: 2px; -`,ds=F(Ce)` +`,cs=F(Ce)` && { color: ${V.primaryRed}; background-color: rgba(237, 116, 116, 0.1); @@ -177,11 +177,11 @@ import{o as nt,p as st,s as pe,a as U,E as ao,r as x,_ as rt,j as s,v as it,q as background-color: rgba(237, 116, 116, 0.2); } } -`,us=({setIsAddEdgeNode:t,edgeData:o,setGraphLoading:n})=>{const e=()=>{t(!1)};return s.jsxs(v,{children:[s.jsx(v,{direction:"row",justify:"flex-end",children:s.jsx(ps,{"data-testid":"close-sidebar-sub-view",onClick:e,children:s.jsx(Ht,{})})}),s.jsx(cs,{edgeLinkData:o,onCancel:e,setGraphLoading:n})]})},ps=F(v)` +`,ls=({setIsAddEdgeNode:t,edgeData:o,setGraphLoading:s})=>{const e=()=>{t(!1)};return n.jsxs(v,{children:[n.jsx(v,{direction:"row",justify:"flex-end",children:n.jsx(ds,{"data-testid":"close-sidebar-sub-view",onClick:e,children:n.jsx(Ht,{})})}),n.jsx(is,{edgeLinkData:o,onCancel:e,setGraphLoading:s})]})},ds=F(v)` font-size: 32px; color: ${V.white}; cursor: pointer; -`,fs=()=>{const[t,o]=x.useState(""),[n,e]=x.useState(!1),[a,c]=x.useState(!1),[d,i]=x.useState(!1),[l,j]=x.useState({refId:"",edgeType:"",source:"",target:""}),[u,f]=x.useState(!1),[h,b,m,S]=Jt(g=>[g.schemas,g.links,g.setSchemas,g.setSchemaLinks]);x.useEffect(()=>{(async()=>{c(!0);try{const P=await vt(),k=P.schemas.filter(R=>R.ref_id&&!R.is_deleted);m(k.length>0?k:P.schemas),S(P.edges.length>0?P.edges:[]),c(!1)}catch(P){console.error("Error fetching data:",P),c(!1)}})()},[m,S]);const T=g=>{if(h.some(k=>k.ref_id===g.ref_id))m(h.map(k=>k.ref_id===g.ref_id?{...g,children:[]}:k));else{m([...h,{...g,children:[]}]);const k=h.find(R=>g.parent===R.type);S([...b,{ref_id:`new-link-${b.length}`,edge_type:"CHILD_OF",source:g.ref_id||"new",target:(k==null?void 0:k.ref_id)||"new"}])}},y=async()=>{const g=await vt();m(g.schemas.filter(P=>P.ref_id&&!P.is_deleted&&P.ref_id)),S(g.edges)},E=g=>{m(h.filter(P=>P.type!==g))},_=h.map(g=>({...g,children:h.filter(P=>P.parent===g.type).map(P=>P.ref_id||"")})),M=b.filter(g=>_.some(P=>P.ref_id===g.source)&&_.some(P=>P.ref_id===g.target)),w=h.find(g=>g.ref_id===t)||null;return a?s.jsx(v,{align:"center",basis:"100%",grow:1,justify:"center",shrink:1,children:s.jsx(ue,{color:V.white})}):s.jsx(s.Fragment,{children:s.jsxs(v,{align:"stretch",direction:"row",grow:1,children:[s.jsx(v,{ml:-20,my:-20,children:s.jsx(os,{onAddEdgeNode:()=>{i(!0),e(!1),o(""),j({refId:"",edgeType:"",source:"",target:""})},onCreateNew:()=>{i(!1),e(!0),o("")}})}),s.jsx(v,{children:w||n?s.jsx(Vt,{children:s.jsx(Ft,{children:s.jsx($n,{graphLoading:u,onDelete:E,onSchemaCreate:T,onSchemaUpdate:y,selectedSchema:w,setGraphLoading:f,setIsCreateNew:e,setSelectedSchemaId:o})})}):null}),s.jsx(v,{children:d?s.jsx(Vt,{children:s.jsx(Ft,{children:s.jsx(us,{edgeData:l,setGraphLoading:f,setIsAddEdgeNode:i})})}):null}),s.jsx(hs,{direction:"row",grow:1,children:s.jsx(ms,{children:u?s.jsx(v,{align:"center",basis:"100%",grow:1,justify:"center",shrink:1,children:s.jsx(ue,{color:V.white})}):s.jsx(es,{links:M,onEdgeClick:(g,P,k,R)=>{j({refId:g,edgeType:P,source:k,target:R}),i(!0),e(!1),o("")},schemasWithPositions:_,selectedSchemaId:t,setIsAddEdgeNode:i,setSelectedSchemaId:o})})})]})})},hs=F(v)` +`,us=()=>{const[t,o]=x.useState(""),[s,e]=x.useState(!1),[a,c]=x.useState(!1),[d,i]=x.useState(!1),[l,j]=x.useState({refId:"",edgeType:"",source:"",target:""}),[u,f]=x.useState(!1),[h,b,m,A]=Xt(g=>[g.schemas,g.links,g.setSchemas,g.setSchemaLinks]);x.useEffect(()=>{(async()=>{c(!0);try{const P=await vt(),k=P.schemas.filter(R=>R.ref_id&&!R.is_deleted);m(k.length>0?k:P.schemas),A(P.edges.length>0?P.edges:[]),c(!1)}catch(P){console.error("Error fetching data:",P),c(!1)}})()},[m,A]);const T=g=>{if(h.some(k=>k.ref_id===g.ref_id))m(h.map(k=>k.ref_id===g.ref_id?{...g,children:[]}:k));else{m([...h,{...g,children:[]}]);const k=h.find(R=>g.parent===R.type);A([...b,{ref_id:`new-link-${b.length}`,edge_type:"CHILD_OF",source:g.ref_id||"new",target:(k==null?void 0:k.ref_id)||"new"}])}},y=async()=>{const g=await vt();m(g.schemas.filter(P=>P.ref_id&&!P.is_deleted&&P.ref_id)),A(g.edges)},E=g=>{m(h.filter(P=>P.type!==g))},_=h.map(g=>({...g,children:h.filter(P=>P.parent===g.type).map(P=>P.ref_id||"")})),S=b.filter(g=>_.some(P=>P.ref_id===g.source)&&_.some(P=>P.ref_id===g.target)),w=h.find(g=>g.ref_id===t)||null;return a?n.jsx(v,{align:"center",basis:"100%",grow:1,justify:"center",shrink:1,children:n.jsx(ue,{color:V.white})}):n.jsx(n.Fragment,{children:n.jsxs(v,{align:"stretch",direction:"row",grow:1,children:[n.jsx(v,{ml:-20,my:-20,children:n.jsx(es,{onAddEdgeNode:()=>{i(!0),e(!1),o(""),j({refId:"",edgeType:"",source:"",target:""})},onCreateNew:()=>{i(!1),e(!0),o("")}})}),n.jsx(v,{children:w||s?n.jsx(Vt,{children:n.jsx(Ft,{children:n.jsx(kn,{graphLoading:u,onDelete:E,onSchemaCreate:T,onSchemaUpdate:y,selectedSchema:w,setGraphLoading:f,setIsCreateNew:e,setSelectedSchemaId:o})})}):null}),n.jsx(v,{children:d?n.jsx(Vt,{children:n.jsx(Ft,{children:n.jsx(ls,{edgeData:l,setGraphLoading:f,setIsAddEdgeNode:i})})}):null}),n.jsx(ps,{direction:"row",grow:1,children:n.jsx(fs,{children:u?n.jsx(v,{align:"center",basis:"100%",grow:1,justify:"center",shrink:1,children:n.jsx(ue,{color:V.white})}):n.jsx(Qn,{links:S,onEdgeClick:(g,P,k,R)=>{j({refId:g,edgeType:P,source:k,target:R}),i(!0),e(!1),o("")},schemasWithPositions:_,selectedSchemaId:t,setIsAddEdgeNode:i,setSelectedSchemaId:o})})})]})})},ps=F(v)` flex: 1 1 auto; justify-content: center; position: relative; @@ -226,6 +226,6 @@ import{o as nt,p as st,s as pe,a as U,E as ao,r as x,_ as rt,j as s,v as it,q as height: 100%; overflow-y: auto; padding: 16px; -`,ms=F(v)` +`,fs=F(v)` flex: 1 1 100%; -`,gs=()=>{const{close:t}=Yt("blueprintGraph"),o=()=>{t()};return s.jsx(Ao,{background:"black",id:"blueprintGraph",kind:"full",onClose:o,preventOutsideClose:!0,children:s.jsx(fs,{})})},Cs=x.memo(gs);export{Cs as BlueprintModal}; +`,hs=()=>{const{close:t}=Ut("blueprintGraph"),o=()=>{t()};return n.jsx(Ao,{background:"black",id:"blueprintGraph",kind:"full",onClose:o,preventOutsideClose:!0,children:n.jsx(us,{})})},Es=x.memo(hs);export{Es as BlueprintModal}; diff --git a/build/assets/index-fc41172c.js b/build/assets/index-8d2e6a42.js similarity index 99% rename from build/assets/index-fc41172c.js rename to build/assets/index-8d2e6a42.js index b73fd3b91..91ffeef3c 100644 --- a/build/assets/index-fc41172c.js +++ b/build/assets/index-8d2e6a42.js @@ -1,4 +1,4 @@ -import{r as P,L as Cc,a as yi,bJ as _c,bK as ed,j as L,R as td,O as nd,S as Ki,bL as rd,bM as id,bN as od}from"./index-0cb90706.js";import{a3 as fl,u as Vl,a4 as ad,U as ld,z as Ec,t as sd,C as io,a5 as ud,a0 as Zl,P as Ql,q as da,a6 as dl,a7 as cd,a8 as fd,a9 as dd,y as hd,aa as pd,ab as vd,ac as md,V as st,a as Nr,ad as gd,b as yd,k as Xl,ae as pa,af as Tc,K as Ul,ag as Rl,ah as pi,ai as xd,aj as Yl,S as wd,ak as Fl,al as Fu,p as Sd,am as Cd,r as oo,x as xi,an as Mc,O as kc,s as _d,o as Ed,ao as Td,ap as Md,l as kd,L as Au,j as Pd,aq as Ld,ar as Ud,as as Rd,at as Jl,au as Du,av as Ir,aw as Fd,ax as hl}from"./three.module-a2e04964.js";import{b4 as _t,i as Ad}from"./index-7a7c9631.js";var Pc={exports:{}},Gr={};/** +import{r as P,L as Cc,a as yi,bJ as _c,bK as ed,j as L,R as td,O as nd,S as Ki,bL as rd,bM as id,bN as od}from"./index-ead79979.js";import{a3 as fl,u as Vl,a4 as ad,U as ld,z as Ec,t as sd,C as io,a5 as ud,a0 as Zl,P as Ql,q as da,a6 as dl,a7 as cd,a8 as fd,a9 as dd,y as hd,aa as pd,ab as vd,ac as md,V as st,a as Nr,ad as gd,b as yd,k as Xl,ae as pa,af as Tc,K as Ul,ag as Rl,ah as pi,ai as xd,aj as Yl,S as wd,ak as Fl,al as Fu,p as Sd,am as Cd,r as oo,x as xi,an as Mc,O as kc,s as _d,o as Ed,ao as Td,ap as Md,l as kd,L as Au,j as Pd,aq as Ld,ar as Ud,as as Rd,at as Jl,au as Du,av as Ir,aw as Fd,ax as hl}from"./three.module-a2e04964.js";import{b5 as _t,j as Ad}from"./index-74184c93.js";var Pc={exports:{}},Gr={};/** * @license React * react-reconciler-constants.production.min.js * diff --git a/build/assets/index-cf45412f.js b/build/assets/index-b0542bac.js similarity index 73% rename from build/assets/index-cf45412f.js rename to build/assets/index-b0542bac.js index daf024fa1..735ac44a8 100644 --- a/build/assets/index-cf45412f.js +++ b/build/assets/index-b0542bac.js @@ -1,9 +1,9 @@ -import{ax as pa,ag as Zn,ak as Ls,bg as Tm,r as j,a as Ee,p as hi,o as Fu,s as zn,E as Om,x as mr,t as Hu,_ as Yu,j as u,v as Dn,n as Vu,q as On,J as Am,K as Dm,I as Uu,D as Wu,bh as Im,R as ee,aG as Nm,Q as Y,S as N,M as zt,X as In,U as z,af as Gu,N as So,a5 as Fe,a$ as si,bi as mt,bj as Lm,L as ma,a3 as vt,a2 as pi,bk as Zu,bl as Rm,bm as $m,bn as ga,bo as zm,bp as Bm,ay as Fm,az as Hm,b0 as Ym,a1 as _t,bq as Yl,bc as Vm,a7 as Ot,br as Um,bs as Wm,O as Gm,ad as Rs,b1 as Zm,a4 as qm,bt as Xm}from"./index-0cb90706.js";import{v as Kn,j as Km,k as Qm,l as $s,m as qu,n as as,o as to,p as ls,q as Jm,L as Vl,r as no,s as En,t as eg,w as cs,x as tg,y as us,z as Li,E as Ul,F as ng,G as Xu,H as Wn,S as Wl,I as rg,J as ig,K as ds,N as Hr,Q as og,R as sg,U as Ri,V as ag,W as Ku,X as ro,Y as lg,Z as cg,$ as hr,a0 as ug,a1 as dg,a2 as Gl,a3 as fg,a4 as hg,a5 as pg,a6 as Qu,a7 as Ju,a8 as mg,a9 as ed,aa as td,g as gg,P as ya,ab as nd,ac as yg,B as Pt,ad as xa,ae as xg,af as wg,ag as rd,A as Gt,b as Mr,ah as _r,ai as Zl,aj as ql,ak as bg,T as vg,al as _g,am as Sg,an as kg,ao as id,ap as Cg,aq as od,ar as Eg,as as Pg,at as Mg,au as jg,av as Tg,f as Og,aw as Ag,ax as Dg,ay as sd,az as Ig,aA as wa,c as ad,aB as ko,aC as Co,aD as ba,aE as va,aF as Ng,aG as Lg}from"./index-7a7c9631.js";import{S as ld}from"./Skeleton-b299e336.js";const Xl="023d8eb306f0027b902fbdc81d33b49b6558b3434d374626f8c324979c92d47c21",Rg=async e=>{let t=await Zn.enable(!0);if(t||console.warn("Sphinx enable failed, means no pubkey and no budget (including budget of 0)"),t=await Zn.keysend(Xl,e),!(t!=null&&t.success)){if(t=await Zn.topup(),t||(t=await Zn.authorize()),!(t!=null&&t.budget)||(t==null?void 0:t.budget){const n=await Rg(t),r={amount:t,refid:e};return await pa.post("/boost",JSON.stringify(r)),n},zg=e=>{const[t,n]=e.split("-")||["",""];return parseInt(n,10)!==0?`${t} - ${n}`:t},cd=(e,t)=>{if(!t)return null;const n=e.filter(o=>o.show_title&&o.link&&o.show_title===t.show_title&&o.episode_title===t.episode_title),r=Ls.groupBy(n,o=>o.timestamp),i=Ls.values(r).reduce((o,a)=>(a[0]&&o.push(a[0]),o),[]);return i.sort((o,a)=>{var p,y;const[l]=((p=o.timestamp)==null?void 0:p.split("-"))||[""],[d]=((y=a.timestamp)==null?void 0:y.split("-"))||[""],f=Kn(l),h=Kn(d);return f-h}),i},Bg=async e=>{await Tm(async()=>{try{await Zn.saveGraphData({metaData:{date:Math.floor(new Date().getTime()/1e3),...e},type:"second_brain_consumed_content"})}catch(t){console.warn(t)}})},Fg=e=>{const t=/((http|https):\/\/[^\s]+)/g,n=/@(\w+)/g;let r=e.replace(/\\/g,"");return r=r.replace(/'/g,"’"),r=r.replace(/\n/g,"
"),r=r.replace(t,'$1'),r=r.replace(n,'@$1'),r},Hg={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},Yg=Hg;function Vg(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const Ug=2;function ud(e,t){return e-t}function Yr(e,t,n){return e==null?t:Math.min(Math.max(t,e),n)}function Kl(e,t){var n;const{index:r}=(n=e.reduce((i,o,a)=>{const l=Math.abs(t-o);return i===null||l({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},Xg=e=>e;let Fi;function fs(){return Fi===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Fi=CSS.supports("touch-action","none"):Fi=!0),Fi}function Kg(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:a=!1,max:l=100,min:d=0,name:f,onChange:h,onChangeCommitted:p,orientation:y="horizontal",rootRef:g,scale:w=Xg,step:_=1,tabIndex:S,value:k}=e,C=j.useRef(),[P,O]=j.useState(-1),[R,T]=j.useState(-1),[V,U]=j.useState(!1),W=j.useRef(0),[q,$]=Km({controlled:k,default:n??d,name:"Slider"}),H=h&&((D,Z,te)=>{const se=D.nativeEvent||D,re=new se.constructor(se.type,se);Object.defineProperty(re,"target",{writable:!0,value:{value:Z,name:f}}),h(re,Z,te)}),B=Array.isArray(q);let M=B?q.slice().sort(ud):[q];M=M.map(D=>Yr(D,d,l));const L=a===!0&&_!==null?[...Array(Math.floor((l-d)/_)+1)].map((D,Z)=>({value:d+_*Z})):a||[],A=L.map(D=>D.value),{isFocusVisibleRef:G,onBlur:X,onFocus:F,ref:v}=Qm(),[Q,ne]=j.useState(-1),E=j.useRef(),ae=$s(v,E),J=$s(g,ae),le=D=>Z=>{var te;const se=Number(Z.currentTarget.getAttribute("data-index"));F(Z),G.current===!0&&ne(se),T(se),D==null||(te=D.onFocus)==null||te.call(D,Z)},pe=D=>Z=>{var te;X(Z),G.current===!1&&ne(-1),T(-1),D==null||(te=D.onBlur)==null||te.call(D,Z)};qu(()=>{if(r&&E.current.contains(document.activeElement)){var D;(D=document.activeElement)==null||D.blur()}},[r]),r&&P!==-1&&O(-1),r&&Q!==-1&&ne(-1);const me=D=>Z=>{var te;(te=D.onChange)==null||te.call(D,Z);const se=Number(Z.currentTarget.getAttribute("data-index")),re=M[se],ye=A.indexOf(re);let fe=Z.target.valueAsNumber;if(L&&_==null){const _e=A[A.length-1];fe>_e?fe=_e:fe{const{current:te}=E,{width:se,height:re,bottom:ye,left:fe}=te.getBoundingClientRect();let _e;ke.indexOf("vertical")===0?_e=(ye-D.y)/re:_e=(D.x-fe)/se,ke.indexOf("-reverse")!==-1&&(_e=1-_e);let je;if(je=Wg(_e,d,l),_)je=Zg(je,_,d);else{const Ae=Kl(A,je);je=A[Ae]}je=Yr(je,d,l);let Ve=0;if(B){Z?Ve=ve.current:Ve=Kl(M,je),i&&(je=Yr(je,M[Ve-1]||-1/0,M[Ve+1]||1/0));const Ae=je;je=Ql({values:M,newValue:je,index:Ve}),i&&Z||(Ve=je.indexOf(Ae),ve.current=Ve)}return{newValue:je,activeIndex:Ve}},Je=as(D=>{const Z=$i(D,C);if(!Z)return;if(W.current+=1,D.type==="mousemove"&&D.buttons===0){He(D);return}const{newValue:te,activeIndex:se}=Be({finger:Z,move:!0});zi({sliderRef:E,activeIndex:se,setActive:O}),$(te),!V&&W.current>Ug&&U(!0),H&&!Bi(te,q)&&H(D,te,se)}),He=as(D=>{const Z=$i(D,C);if(U(!1),!Z)return;const{newValue:te}=Be({finger:Z,move:!0});O(-1),D.type==="touchend"&&T(-1),p&&p(D,te),C.current=void 0,ge()}),we=as(D=>{if(r)return;fs()||D.preventDefault();const Z=D.changedTouches[0];Z!=null&&(C.current=Z.identifier);const te=$i(D,C);if(te!==!1){const{newValue:re,activeIndex:ye}=Be({finger:te});zi({sliderRef:E,activeIndex:ye,setActive:O}),$(re),H&&!Bi(re,q)&&H(D,re,ye)}W.current=0;const se=to(E.current);se.addEventListener("touchmove",Je),se.addEventListener("touchend",He)}),ge=j.useCallback(()=>{const D=to(E.current);D.removeEventListener("mousemove",Je),D.removeEventListener("mouseup",He),D.removeEventListener("touchmove",Je),D.removeEventListener("touchend",He)},[He,Je]);j.useEffect(()=>{const{current:D}=E;return D.addEventListener("touchstart",we,{passive:fs()}),()=>{D.removeEventListener("touchstart",we,{passive:fs()}),ge()}},[ge,we]),j.useEffect(()=>{r&&ge()},[r,ge]);const Ye=D=>Z=>{var te;if((te=D.onMouseDown)==null||te.call(D,Z),r||Z.defaultPrevented||Z.button!==0)return;Z.preventDefault();const se=$i(Z,C);if(se!==!1){const{newValue:ye,activeIndex:fe}=Be({finger:se});zi({sliderRef:E,activeIndex:fe,setActive:O}),$(ye),H&&!Bi(ye,q)&&H(Z,ye,fe)}W.current=0;const re=to(E.current);re.addEventListener("mousemove",Je),re.addEventListener("mouseup",He)},Ze=uo(B?M[0]:d,d,l),ue=uo(M[M.length-1],d,l)-Ze,dt=(D={})=>{const Z=ls(D),te={onMouseDown:Ye(Z||{})},se=Ee({},Z,te);return Ee({},D,{ref:J},se)},Ne=D=>Z=>{var te;(te=D.onMouseOver)==null||te.call(D,Z);const se=Number(Z.currentTarget.getAttribute("data-index"));T(se)},Le=D=>Z=>{var te;(te=D.onMouseLeave)==null||te.call(D,Z),T(-1)};return{active:P,axis:ke,axisProps:qg,dragging:V,focusedThumbIndex:Q,getHiddenInputProps:(D={})=>{var Z;const te=ls(D),se={onChange:me(te||{}),onFocus:le(te||{}),onBlur:pe(te||{})},re=Ee({},te,se);return Ee({tabIndex:S,"aria-labelledby":t,"aria-orientation":y,"aria-valuemax":w(l),"aria-valuemin":w(d),name:f,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":(Z=e.step)!=null?Z:void 0,disabled:r},D,re,{style:Ee({},Yg,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:dt,getThumbProps:(D={})=>{const Z=ls(D),te={onMouseOver:Ne(Z||{}),onMouseLeave:Le(Z||{})};return Ee({},D,Z,te)},marks:L,open:R,range:B,rootRef:J,trackLeap:ue,trackOffset:Ze,values:M,getThumbStyle:D=>({pointerEvents:P!==-1&&P!==D?"none":void 0})}}const Qg=hi("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),Jl=Qg,Jg=hi("MuiListItemIcon",["root","alignItemsFlexStart"]),ec=Jg,ey=hi("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),tc=ey;function ty(e){return Fu("MuiMenuItem",e)}const ny=hi("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Vr=ny,ry=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],iy=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},oy=e=>{const{disabled:t,dense:n,divider:r,disableGutters:i,selected:o,classes:a}=e,d=Vu({root:["root",n&&"dense",t&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},ty,a);return Ee({},a,d)},sy=zn(Jm,{shouldForwardProp:e=>Om(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:iy})(({theme:e,ownerState:t})=>Ee({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Vr.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:mr(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Vr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:mr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Vr.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:mr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:mr(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Vr.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Vr.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${Jl.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${Jl.inset}`]:{marginLeft:52},[`& .${tc.root}`]:{marginTop:0,marginBottom:0},[`& .${tc.inset}`]:{paddingLeft:36},[`& .${ec.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&Ee({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${ec.root} svg`]:{fontSize:"1.25rem"}}))),ay=j.forwardRef(function(t,n){const r=Hu({props:t,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:a=!1,divider:l=!1,disableGutters:d=!1,focusVisibleClassName:f,role:h="menuitem",tabIndex:p,className:y}=r,g=Yu(r,ry),w=j.useContext(Vl),_=j.useMemo(()=>({dense:a||w.dense||!1,disableGutters:d}),[w.dense,a,d]),S=j.useRef(null);qu(()=>{i&&S.current&&S.current.focus()},[i]);const k=Ee({},r,{dense:_.dense,divider:l,disableGutters:d}),C=oy(r),P=$s(S,n);let O;return r.disabled||(O=p!==void 0?p:-1),u.jsx(Vl.Provider,{value:_,children:u.jsx(sy,Ee({ref:P,role:h,tabIndex:O,component:o,focusVisibleClassName:Dn(C.focusVisible,f),className:Dn(C.root,y)},g,{ownerState:k,classes:C}))})}),ly=ay,cy=e=>!e||!no(e),uy=cy;function dy(e){return Fu("MuiSlider",e)}const fy=hi("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),Wt=fy,hy=e=>{const{open:t}=e;return{offset:Dn(t&&Wt.valueLabelOpen),circle:Wt.valueLabelCircle,label:Wt.valueLabelLabel}};function py(e){const{children:t,className:n,value:r}=e,i=hy(e);return t?j.cloneElement(t,{className:Dn(t.props.className)},u.jsxs(j.Fragment,{children:[t.props.children,u.jsx("span",{className:Dn(i.offset,n),"aria-hidden":!0,children:u.jsx("span",{className:i.circle,children:u.jsx("span",{className:i.label,children:r})})})]})):null}const my=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function nc(e){return e}const gy=zn("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${On(n.color)}`],n.size!=="medium"&&t[`size${On(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(({theme:e,ownerState:t})=>Ee({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:(e.vars||e).palette[t.color].main,WebkitTapHighlightColor:"transparent"},t.orientation==="horizontal"&&Ee({height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}},t.size==="small"&&{height:2},t.marked&&{marginBottom:20}),t.orientation==="vertical"&&Ee({height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}},t.size==="small"&&{width:2},t.marked&&{marginRight:44}),{"@media print":{colorAdjust:"exact"},[`&.${Wt.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Wt.dragging}`]:{[`& .${Wt.thumb}, & .${Wt.track}`]:{transition:"none"}}})),yy=zn("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})(({ownerState:e})=>Ee({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38},e.orientation==="horizontal"&&{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"},e.orientation==="vertical"&&{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"},e.track==="inverted"&&{opacity:1})),xy=zn("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?Am(e.palette[t.color].main,.62):Dm(e.palette[t.color].main,.5);return Ee({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest})},t.size==="small"&&{border:"none"},t.orientation==="horizontal"&&{height:"inherit",top:"50%",transform:"translateY(-50%)"},t.orientation==="vertical"&&{width:"inherit",left:"50%",transform:"translateX(-50%)"},t.track===!1&&{display:"none"},t.track==="inverted"&&{backgroundColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:n,borderColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:n})}),wy=zn("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${On(n.color)}`],n.size!=="medium"&&t[`thumbSize${On(n.size)}`]]}})(({theme:e,ownerState:t})=>Ee({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest})},t.size==="small"&&{width:12,height:12},t.orientation==="horizontal"&&{top:"50%",transform:"translate(-50%, -50%)"},t.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 50%)"},{"&:before":Ee({position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},t.size==="small"&&{boxShadow:"none"}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&:hover, &.${Wt.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:mr(e.palette[t.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Wt.active}`]:{boxShadow:`0px 0px 0px 14px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:mr(e.palette[t.color].main,.16)}`},[`&.${Wt.disabled}`]:{"&:hover":{boxShadow:"none"}}})),by=zn(py,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(({theme:e,ownerState:t})=>Ee({[`&.${Wt.valueLabelOpen}`]:{transform:`${t.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(1)`},zIndex:1,whiteSpace:"nowrap"},e.typography.body2,{fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),transform:`${t.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(0)`,position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem"},t.orientation==="horizontal"&&{top:"-10px",transformOrigin:"bottom center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"}},t.orientation==="vertical"&&{right:t.size==="small"?"20px":"30px",top:"50%",transformOrigin:"right center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"}},t.size==="small"&&{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"})),vy=zn("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Uu(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(({theme:e,ownerState:t,markActive:n})=>Ee({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},t.orientation==="horizontal"&&{top:"50%",transform:"translate(-1px, -50%)"},t.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 1px)"},n&&{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8})),_y=zn("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Uu(e)&&e!=="markLabelActive",overridesResolver:(e,t)=>t.markLabel})(({theme:e,ownerState:t,markLabelActive:n})=>Ee({},e.typography.body2,{color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap"},t.orientation==="horizontal"&&{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}},t.orientation==="vertical"&&{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}},n&&{color:(e.vars||e).palette.text.primary})),Sy=e=>{const{disabled:t,dragging:n,marked:r,orientation:i,track:o,classes:a,color:l,size:d}=e,f={root:["root",t&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",l&&`color${On(l)}`,d&&`size${On(d)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",d&&`thumbSize${On(d)}`,l&&`thumbColor${On(l)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Vu(f,dy,a)},ky=({children:e})=>e,Cy=j.forwardRef(function(t,n){var r,i,o,a,l,d,f,h,p,y,g,w,_,S,k,C,P,O,R,T,V,U,W,q;const $=Hu({props:t,name:"MuiSlider"}),B=Wu().direction==="rtl",{"aria-label":M,"aria-valuetext":L,"aria-labelledby":A,component:G="span",components:X={},componentsProps:F={},color:v="primary",classes:Q,className:ne,disableSwap:E=!1,disabled:ae=!1,getAriaLabel:J,getAriaValueText:le,marks:pe=!1,max:me=100,min:ve=0,orientation:ke="horizontal",size:Be="medium",step:Je=1,scale:He=nc,slotProps:we,slots:ge,track:Ye="normal",valueLabelDisplay:Ze="off",valueLabelFormat:ue=nc}=$,dt=Yu($,my),Ne=Ee({},$,{isRtl:B,max:me,min:ve,classes:Q,disabled:ae,disableSwap:E,orientation:ke,marks:pe,color:v,size:Be,step:Je,scale:He,track:Ye,valueLabelDisplay:Ze,valueLabelFormat:ue}),{axisProps:Le,getRootProps:Xe,getHiddenInputProps:ft,getThumbProps:ht,open:D,active:Z,axis:te,focusedThumbIndex:se,range:re,dragging:ye,marks:fe,values:_e,trackOffset:je,trackLeap:Ve,getThumbStyle:Ae}=Kg(Ee({},Ne,{rootRef:n}));Ne.marked=fe.length>0&&fe.some(Pe=>Pe.label),Ne.dragging=ye,Ne.focusedThumbIndex=se;const be=Sy(Ne),tt=(r=(i=ge==null?void 0:ge.root)!=null?i:X.Root)!=null?r:gy,qt=(o=(a=ge==null?void 0:ge.rail)!=null?a:X.Rail)!=null?o:yy,jt=(l=(d=ge==null?void 0:ge.track)!=null?d:X.Track)!=null?l:xy,De=(f=(h=ge==null?void 0:ge.thumb)!=null?h:X.Thumb)!=null?f:wy,bn=(p=(y=ge==null?void 0:ge.valueLabel)!=null?y:X.ValueLabel)!=null?p:by,St=(g=(w=ge==null?void 0:ge.mark)!=null?w:X.Mark)!=null?g:vy,Xt=(_=(S=ge==null?void 0:ge.markLabel)!=null?S:X.MarkLabel)!=null?_:_y,vn=(k=(C=ge==null?void 0:ge.input)!=null?C:X.Input)!=null?k:"input",Kt=(P=we==null?void 0:we.root)!=null?P:F.root,Qt=(O=we==null?void 0:we.rail)!=null?O:F.rail,Jt=(R=we==null?void 0:we.track)!=null?R:F.track,Fn=(T=we==null?void 0:we.thumb)!=null?T:F.thumb,en=(V=we==null?void 0:we.valueLabel)!=null?V:F.valueLabel,Or=(U=we==null?void 0:we.mark)!=null?U:F.mark,an=(W=we==null?void 0:we.markLabel)!=null?W:F.markLabel,_n=(q=we==null?void 0:we.input)!=null?q:F.input,ce=En({elementType:tt,getSlotProps:Xe,externalSlotProps:Kt,externalForwardedProps:dt,additionalProps:Ee({},uy(tt)&&{as:G}),ownerState:Ee({},Ne,Kt==null?void 0:Kt.ownerState),className:[be.root,ne]}),Ar=En({elementType:qt,externalSlotProps:Qt,ownerState:Ne,className:be.rail}),Dr=En({elementType:jt,externalSlotProps:Jt,additionalProps:{style:Ee({},Le[te].offset(je),Le[te].leap(Ve))},ownerState:Ee({},Ne,Jt==null?void 0:Jt.ownerState),className:be.track}),ot=En({elementType:De,getSlotProps:ht,externalSlotProps:Fn,ownerState:Ee({},Ne,Fn==null?void 0:Fn.ownerState),className:be.thumb}),Hn=En({elementType:bn,externalSlotProps:en,ownerState:Ee({},Ne,en==null?void 0:en.ownerState),className:be.valueLabel}),Te=En({elementType:St,externalSlotProps:Or,ownerState:Ne,className:be.mark}),Ht=En({elementType:Xt,externalSlotProps:an,ownerState:Ne,className:be.markLabel}),Ir=En({elementType:vn,getSlotProps:ft,externalSlotProps:_n,ownerState:Ne});return u.jsxs(tt,Ee({},ce,{children:[u.jsx(qt,Ee({},Ar)),u.jsx(jt,Ee({},Dr)),fe.filter(Pe=>Pe.value>=ve&&Pe.value<=me).map((Pe,$e)=>{const pt=uo(Pe.value,ve,me),Ue=Le[te].offset(pt);let Ke;return Ye===!1?Ke=_e.indexOf(Pe.value)!==-1:Ke=Ye==="normal"&&(re?Pe.value>=_e[0]&&Pe.value<=_e[_e.length-1]:Pe.value<=_e[0])||Ye==="inverted"&&(re?Pe.value<=_e[0]||Pe.value>=_e[_e.length-1]:Pe.value>=_e[0]),u.jsxs(j.Fragment,{children:[u.jsx(St,Ee({"data-index":$e},Te,!no(St)&&{markActive:Ke},{style:Ee({},Ue,Te.style),className:Dn(Te.className,Ke&&be.markActive)})),Pe.label!=null?u.jsx(Xt,Ee({"aria-hidden":!0,"data-index":$e},Ht,!no(Xt)&&{markLabelActive:Ke},{style:Ee({},Ue,Ht.style),className:Dn(be.markLabel,Ht.className,Ke&&be.markLabelActive),children:Pe.label})):null]},$e)}),_e.map((Pe,$e)=>{const pt=uo(Pe,ve,me),Ue=Le[te].offset(pt),Ke=Ze==="off"?ky:bn;return u.jsx(Ke,Ee({},!no(Ke)&&{valueLabelFormat:ue,valueLabelDisplay:Ze,value:typeof ue=="function"?ue(He(Pe),$e):ue,index:$e,open:D===$e||Z===$e||Ze==="on",disabled:ae},Hn,{children:u.jsx(De,Ee({"data-index":$e},ot,{className:Dn(be.thumb,ot.className,Z===$e&&be.active,se===$e&&be.focusVisible),style:Ee({},Ue,Ae($e),ot.style),children:u.jsx(vn,Ee({"data-index":$e,"aria-label":J?J($e):M,"aria-valuenow":He(Pe),"aria-labelledby":A,"aria-valuetext":le?le(He(Pe),$e):L,value:_e[$e]},Ir))}))}),$e)})]}))}),dd=Cy,Ey=(e,t="down")=>{const n=Wu(),[r,i]=j.useState(!1),o=n.breakpoints[t](e).split("@media")[1].trim();return j.useEffect(()=>{const a=()=>{const{matches:l}=window.matchMedia(o);i(l)};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[o]),r};function rc(e,t,n){var r=new Im;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}const Py=e=>e.filter(t=>t.tldr).length>=2&&e.some(t=>t.audio_EN);function My(e){return e.tldr_topic??e.name}var fo=globalThis&&globalThis.__assign||function(){return fo=Object.assign||function(e){for(var t,n=1,r=arguments.length;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(B=tg(B,_,{trailing:!0,leading:!1}));var M=new ResizeObserver(B),L=R.current.getBoundingClientRect(),A=L.width,G=L.height;return $(A,G),M.observe(R.current),function(){M.disconnect()}},[$,_]);var H=j.useMemo(function(){var B=W.containerWidth,M=W.containerHeight;if(B<0||M<0)return null;us(Li(a)||Li(d),`The width(%s) and height(%s) are both fixed numbers, - maybe you don't need to use a ResponsiveContainer.`,a,d),us(!n||n>0,"The aspect(%s) must be greater than zero.",n);var L=Li(a)?B:a,A=Li(d)?M:d;n&&n>0&&(L?A=L/n:A&&(L=A*n),y&&A>y&&(A=y)),us(L>0||A>0,`The width(%s) and height(%s) of chart should be greater than 0, +import{ax as pa,ag as Zn,ak as Ls,bg as Tm,r as j,a as Ee,p as hi,o as Fu,s as zn,E as Om,x as mr,t as Hu,_ as Yu,j as u,v as Dn,n as Vu,q as On,J as Am,K as Dm,I as Uu,D as Wu,bh as Im,R as ee,aG as Nm,Q as Y,S as N,M as zt,X as In,U as z,af as Gu,N as So,a5 as Fe,a$ as si,bi as mt,bj as Lm,L as ma,a3 as vt,a2 as pi,bk as Zu,bl as Rm,bm as $m,bn as ga,bo as zm,bp as Bm,ay as Fm,az as Hm,b0 as Ym,a1 as _t,bq as Yl,bc as Vm,a7 as Ot,br as Um,bs as Wm,O as Gm,ad as Rs,b1 as Zm,a4 as qm,bt as Xm}from"./index-ead79979.js";import{v as Kn,k as Km,l as Qm,m as $s,n as qu,o as as,p as to,q as ls,r as Jm,L as Vl,s as no,t as En,w as eg,x as cs,y as tg,z as us,E as Li,F as Ul,G as ng,H as Xu,I as Wn,S as Wl,J as rg,K as ig,N as ds,Q as Hr,R as og,U as sg,V as Ri,W as ag,X as Ku,Y as ro,Z as lg,$ as cg,a0 as hr,a1 as ug,a2 as dg,a3 as Gl,a4 as fg,a5 as hg,a6 as pg,a7 as Qu,a8 as Ju,a9 as mg,aa as ed,ab as td,h as gg,P as ya,ac as nd,ad as yg,B as Pt,ae as xa,af as xg,ag as wg,ah as rd,A as Gt,b as Mr,ai as _r,aj as Zl,ak as ql,al as bg,T as vg,am as _g,an as Sg,ao as kg,ap as id,aq as Cg,ar as od,as as Eg,at as Pg,au as Mg,av as jg,aw as Tg,g as Og,ax as Ag,ay as Dg,az as sd,aA as Ig,aB as wa,d as ad,aC as ko,aD as Co,aE as ba,aF as va,aG as Ng,aH as Lg,c as Rg}from"./index-74184c93.js";import{S as ld}from"./Skeleton-63ee525b.js";const Xl="023d8eb306f0027b902fbdc81d33b49b6558b3434d374626f8c324979c92d47c21",$g=async e=>{let t=await Zn.enable(!0);if(t||console.warn("Sphinx enable failed, means no pubkey and no budget (including budget of 0)"),t=await Zn.keysend(Xl,e),!(t!=null&&t.success)){if(t=await Zn.topup(),t||(t=await Zn.authorize()),!(t!=null&&t.budget)||(t==null?void 0:t.budget){const n=await $g(t),r={amount:t,refid:e};return await pa.post("/boost",JSON.stringify(r)),n},Bg=e=>{const[t,n]=e.split("-")||["",""];return parseInt(n,10)!==0?`${t} - ${n}`:t},cd=(e,t)=>{if(!t)return null;const n=e.filter(o=>o.show_title&&o.link&&o.show_title===t.show_title&&o.episode_title===t.episode_title),r=Ls.groupBy(n,o=>o.timestamp),i=Ls.values(r).reduce((o,a)=>(a[0]&&o.push(a[0]),o),[]);return i.sort((o,a)=>{var p,y;const[l]=((p=o.timestamp)==null?void 0:p.split("-"))||[""],[d]=((y=a.timestamp)==null?void 0:y.split("-"))||[""],f=Kn(l),h=Kn(d);return f-h}),i},Fg=async e=>{await Tm(async()=>{try{await Zn.saveGraphData({metaData:{date:Math.floor(new Date().getTime()/1e3),...e},type:"second_brain_consumed_content"})}catch(t){console.warn(t)}})},Hg=e=>{const t=/((http|https):\/\/[^\s]+)/g,n=/@(\w+)/g;let r=e.replace(/\\/g,"");return r=r.replace(/'/g,"’"),r=r.replace(/\n/g,"
"),r=r.replace(t,'$1'),r=r.replace(n,'@$1'),r},Yg={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},Vg=Yg;function Ug(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}const Wg=2;function ud(e,t){return e-t}function Yr(e,t,n){return e==null?t:Math.min(Math.max(t,e),n)}function Kl(e,t){var n;const{index:r}=(n=e.reduce((i,o,a)=>{const l=Math.abs(t-o);return i===null||l({left:`${e}%`}),leap:e=>({width:`${e}%`})},"horizontal-reverse":{offset:e=>({right:`${e}%`}),leap:e=>({width:`${e}%`})},vertical:{offset:e=>({bottom:`${e}%`}),leap:e=>({height:`${e}%`})}},Kg=e=>e;let Fi;function fs(){return Fi===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?Fi=CSS.supports("touch-action","none"):Fi=!0),Fi}function Qg(e){const{"aria-labelledby":t,defaultValue:n,disabled:r=!1,disableSwap:i=!1,isRtl:o=!1,marks:a=!1,max:l=100,min:d=0,name:f,onChange:h,onChangeCommitted:p,orientation:y="horizontal",rootRef:g,scale:w=Kg,step:_=1,tabIndex:S,value:k}=e,C=j.useRef(),[M,O]=j.useState(-1),[L,T]=j.useState(-1),[V,U]=j.useState(!1),W=j.useRef(0),[q,$]=Km({controlled:k,default:n??d,name:"Slider"}),H=h&&((D,Z,te)=>{const se=D.nativeEvent||D,re=new se.constructor(se.type,se);Object.defineProperty(re,"target",{writable:!0,value:{value:Z,name:f}}),h(re,Z,te)}),B=Array.isArray(q);let P=B?q.slice().sort(ud):[q];P=P.map(D=>Yr(D,d,l));const R=a===!0&&_!==null?[...Array(Math.floor((l-d)/_)+1)].map((D,Z)=>({value:d+_*Z})):a||[],A=R.map(D=>D.value),{isFocusVisibleRef:G,onBlur:X,onFocus:F,ref:v}=Qm(),[Q,ne]=j.useState(-1),E=j.useRef(),ae=$s(v,E),J=$s(g,ae),le=D=>Z=>{var te;const se=Number(Z.currentTarget.getAttribute("data-index"));F(Z),G.current===!0&&ne(se),T(se),D==null||(te=D.onFocus)==null||te.call(D,Z)},pe=D=>Z=>{var te;X(Z),G.current===!1&&ne(-1),T(-1),D==null||(te=D.onBlur)==null||te.call(D,Z)};qu(()=>{if(r&&E.current.contains(document.activeElement)){var D;(D=document.activeElement)==null||D.blur()}},[r]),r&&M!==-1&&O(-1),r&&Q!==-1&&ne(-1);const me=D=>Z=>{var te;(te=D.onChange)==null||te.call(D,Z);const se=Number(Z.currentTarget.getAttribute("data-index")),re=P[se],ye=A.indexOf(re);let fe=Z.target.valueAsNumber;if(R&&_==null){const _e=A[A.length-1];fe>_e?fe=_e:fe{const{current:te}=E,{width:se,height:re,bottom:ye,left:fe}=te.getBoundingClientRect();let _e;ke.indexOf("vertical")===0?_e=(ye-D.y)/re:_e=(D.x-fe)/se,ke.indexOf("-reverse")!==-1&&(_e=1-_e);let je;if(je=Gg(_e,d,l),_)je=qg(je,_,d);else{const Ae=Kl(A,je);je=A[Ae]}je=Yr(je,d,l);let Ve=0;if(B){Z?Ve=ve.current:Ve=Kl(P,je),i&&(je=Yr(je,P[Ve-1]||-1/0,P[Ve+1]||1/0));const Ae=je;je=Ql({values:P,newValue:je,index:Ve}),i&&Z||(Ve=je.indexOf(Ae),ve.current=Ve)}return{newValue:je,activeIndex:Ve}},Je=as(D=>{const Z=$i(D,C);if(!Z)return;if(W.current+=1,D.type==="mousemove"&&D.buttons===0){He(D);return}const{newValue:te,activeIndex:se}=Be({finger:Z,move:!0});zi({sliderRef:E,activeIndex:se,setActive:O}),$(te),!V&&W.current>Wg&&U(!0),H&&!Bi(te,q)&&H(D,te,se)}),He=as(D=>{const Z=$i(D,C);if(U(!1),!Z)return;const{newValue:te}=Be({finger:Z,move:!0});O(-1),D.type==="touchend"&&T(-1),p&&p(D,te),C.current=void 0,ge()}),we=as(D=>{if(r)return;fs()||D.preventDefault();const Z=D.changedTouches[0];Z!=null&&(C.current=Z.identifier);const te=$i(D,C);if(te!==!1){const{newValue:re,activeIndex:ye}=Be({finger:te});zi({sliderRef:E,activeIndex:ye,setActive:O}),$(re),H&&!Bi(re,q)&&H(D,re,ye)}W.current=0;const se=to(E.current);se.addEventListener("touchmove",Je),se.addEventListener("touchend",He)}),ge=j.useCallback(()=>{const D=to(E.current);D.removeEventListener("mousemove",Je),D.removeEventListener("mouseup",He),D.removeEventListener("touchmove",Je),D.removeEventListener("touchend",He)},[He,Je]);j.useEffect(()=>{const{current:D}=E;return D.addEventListener("touchstart",we,{passive:fs()}),()=>{D.removeEventListener("touchstart",we,{passive:fs()}),ge()}},[ge,we]),j.useEffect(()=>{r&&ge()},[r,ge]);const Ye=D=>Z=>{var te;if((te=D.onMouseDown)==null||te.call(D,Z),r||Z.defaultPrevented||Z.button!==0)return;Z.preventDefault();const se=$i(Z,C);if(se!==!1){const{newValue:ye,activeIndex:fe}=Be({finger:se});zi({sliderRef:E,activeIndex:fe,setActive:O}),$(ye),H&&!Bi(ye,q)&&H(Z,ye,fe)}W.current=0;const re=to(E.current);re.addEventListener("mousemove",Je),re.addEventListener("mouseup",He)},Ze=uo(B?P[0]:d,d,l),ue=uo(P[P.length-1],d,l)-Ze,dt=(D={})=>{const Z=ls(D),te={onMouseDown:Ye(Z||{})},se=Ee({},Z,te);return Ee({},D,{ref:J},se)},Ne=D=>Z=>{var te;(te=D.onMouseOver)==null||te.call(D,Z);const se=Number(Z.currentTarget.getAttribute("data-index"));T(se)},Le=D=>Z=>{var te;(te=D.onMouseLeave)==null||te.call(D,Z),T(-1)};return{active:M,axis:ke,axisProps:Xg,dragging:V,focusedThumbIndex:Q,getHiddenInputProps:(D={})=>{var Z;const te=ls(D),se={onChange:me(te||{}),onFocus:le(te||{}),onBlur:pe(te||{})},re=Ee({},te,se);return Ee({tabIndex:S,"aria-labelledby":t,"aria-orientation":y,"aria-valuemax":w(l),"aria-valuemin":w(d),name:f,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":(Z=e.step)!=null?Z:void 0,disabled:r},D,re,{style:Ee({},Vg,{direction:o?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:dt,getThumbProps:(D={})=>{const Z=ls(D),te={onMouseOver:Ne(Z||{}),onMouseLeave:Le(Z||{})};return Ee({},D,Z,te)},marks:R,open:L,range:B,rootRef:J,trackLeap:ue,trackOffset:Ze,values:P,getThumbStyle:D=>({pointerEvents:M!==-1&&M!==D?"none":void 0})}}const Jg=hi("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),Jl=Jg,ey=hi("MuiListItemIcon",["root","alignItemsFlexStart"]),ec=ey,ty=hi("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]),tc=ty;function ny(e){return Fu("MuiMenuItem",e)}const ry=hi("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),Vr=ry,iy=["autoFocus","component","dense","divider","disableGutters","focusVisibleClassName","role","tabIndex","className"],oy=(e,t)=>{const{ownerState:n}=e;return[t.root,n.dense&&t.dense,n.divider&&t.divider,!n.disableGutters&&t.gutters]},sy=e=>{const{disabled:t,dense:n,divider:r,disableGutters:i,selected:o,classes:a}=e,d=Vu({root:["root",n&&"dense",t&&"disabled",!i&&"gutters",r&&"divider",o&&"selected"]},ny,a);return Ee({},a,d)},ay=zn(Jm,{shouldForwardProp:e=>Om(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:oy})(({theme:e,ownerState:t})=>Ee({},e.typography.body1,{display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap"},!t.disableGutters&&{paddingLeft:16,paddingRight:16},t.divider&&{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"},{"&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${Vr.selected}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:mr(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${Vr.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:mr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},[`&.${Vr.selected}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:mr(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})`:mr(e.palette.primary.main,e.palette.action.selectedOpacity)}},[`&.${Vr.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${Vr.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${Jl.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${Jl.inset}`]:{marginLeft:52},[`& .${tc.root}`]:{marginTop:0,marginBottom:0},[`& .${tc.inset}`]:{paddingLeft:36},[`& .${ec.root}`]:{minWidth:36}},!t.dense&&{[e.breakpoints.up("sm")]:{minHeight:"auto"}},t.dense&&Ee({minHeight:32,paddingTop:4,paddingBottom:4},e.typography.body2,{[`& .${ec.root} svg`]:{fontSize:"1.25rem"}}))),ly=j.forwardRef(function(t,n){const r=Hu({props:t,name:"MuiMenuItem"}),{autoFocus:i=!1,component:o="li",dense:a=!1,divider:l=!1,disableGutters:d=!1,focusVisibleClassName:f,role:h="menuitem",tabIndex:p,className:y}=r,g=Yu(r,iy),w=j.useContext(Vl),_=j.useMemo(()=>({dense:a||w.dense||!1,disableGutters:d}),[w.dense,a,d]),S=j.useRef(null);qu(()=>{i&&S.current&&S.current.focus()},[i]);const k=Ee({},r,{dense:_.dense,divider:l,disableGutters:d}),C=sy(r),M=$s(S,n);let O;return r.disabled||(O=p!==void 0?p:-1),u.jsx(Vl.Provider,{value:_,children:u.jsx(ay,Ee({ref:M,role:h,tabIndex:O,component:o,focusVisibleClassName:Dn(C.focusVisible,f),className:Dn(C.root,y)},g,{ownerState:k,classes:C}))})}),cy=ly,uy=e=>!e||!no(e),dy=uy;function fy(e){return Fu("MuiSlider",e)}const hy=hi("MuiSlider",["root","active","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","disabled","dragging","focusVisible","mark","markActive","marked","markLabel","markLabelActive","rail","sizeSmall","thumb","thumbColorPrimary","thumbColorSecondary","thumbColorError","thumbColorSuccess","thumbColorInfo","thumbColorWarning","track","trackInverted","trackFalse","thumbSizeSmall","valueLabel","valueLabelOpen","valueLabelCircle","valueLabelLabel","vertical"]),Wt=hy,py=e=>{const{open:t}=e;return{offset:Dn(t&&Wt.valueLabelOpen),circle:Wt.valueLabelCircle,label:Wt.valueLabelLabel}};function my(e){const{children:t,className:n,value:r}=e,i=py(e);return t?j.cloneElement(t,{className:Dn(t.props.className)},u.jsxs(j.Fragment,{children:[t.props.children,u.jsx("span",{className:Dn(i.offset,n),"aria-hidden":!0,children:u.jsx("span",{className:i.circle,children:u.jsx("span",{className:i.label,children:r})})})]})):null}const gy=["aria-label","aria-valuetext","aria-labelledby","component","components","componentsProps","color","classes","className","disableSwap","disabled","getAriaLabel","getAriaValueText","marks","max","min","name","onChange","onChangeCommitted","orientation","size","step","scale","slotProps","slots","tabIndex","track","value","valueLabelDisplay","valueLabelFormat"];function nc(e){return e}const yy=zn("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,t[`color${On(n.color)}`],n.size!=="medium"&&t[`size${On(n.size)}`],n.marked&&t.marked,n.orientation==="vertical"&&t.vertical,n.track==="inverted"&&t.trackInverted,n.track===!1&&t.trackFalse]}})(({theme:e,ownerState:t})=>Ee({borderRadius:12,boxSizing:"content-box",display:"inline-block",position:"relative",cursor:"pointer",touchAction:"none",color:(e.vars||e).palette[t.color].main,WebkitTapHighlightColor:"transparent"},t.orientation==="horizontal"&&Ee({height:4,width:"100%",padding:"13px 0","@media (pointer: coarse)":{padding:"20px 0"}},t.size==="small"&&{height:2},t.marked&&{marginBottom:20}),t.orientation==="vertical"&&Ee({height:"100%",width:4,padding:"0 13px","@media (pointer: coarse)":{padding:"0 20px"}},t.size==="small"&&{width:2},t.marked&&{marginRight:44}),{"@media print":{colorAdjust:"exact"},[`&.${Wt.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Wt.dragging}`]:{[`& .${Wt.thumb}, & .${Wt.track}`]:{transition:"none"}}})),xy=zn("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})(({ownerState:e})=>Ee({display:"block",position:"absolute",borderRadius:"inherit",backgroundColor:"currentColor",opacity:.38},e.orientation==="horizontal"&&{width:"100%",height:"inherit",top:"50%",transform:"translateY(-50%)"},e.orientation==="vertical"&&{height:"100%",width:"inherit",left:"50%",transform:"translateX(-50%)"},e.track==="inverted"&&{opacity:1})),wy=zn("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e,ownerState:t})=>{const n=e.palette.mode==="light"?Am(e.palette[t.color].main,.62):Dm(e.palette[t.color].main,.5);return Ee({display:"block",position:"absolute",borderRadius:"inherit",border:"1px solid currentColor",backgroundColor:"currentColor",transition:e.transitions.create(["left","width","bottom","height"],{duration:e.transitions.duration.shortest})},t.size==="small"&&{border:"none"},t.orientation==="horizontal"&&{height:"inherit",top:"50%",transform:"translateY(-50%)"},t.orientation==="vertical"&&{width:"inherit",left:"50%",transform:"translateX(-50%)"},t.track===!1&&{display:"none"},t.track==="inverted"&&{backgroundColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:n,borderColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:n})}),by=zn("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.thumb,t[`thumbColor${On(n.color)}`],n.size!=="medium"&&t[`thumbSize${On(n.size)}`]]}})(({theme:e,ownerState:t})=>Ee({position:"absolute",width:20,height:20,boxSizing:"border-box",borderRadius:"50%",outline:0,backgroundColor:"currentColor",display:"flex",alignItems:"center",justifyContent:"center",transition:e.transitions.create(["box-shadow","left","bottom"],{duration:e.transitions.duration.shortest})},t.size==="small"&&{width:12,height:12},t.orientation==="horizontal"&&{top:"50%",transform:"translate(-50%, -50%)"},t.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 50%)"},{"&:before":Ee({position:"absolute",content:'""',borderRadius:"inherit",width:"100%",height:"100%",boxShadow:(e.vars||e).shadows[2]},t.size==="small"&&{boxShadow:"none"}),"&::after":{position:"absolute",content:'""',borderRadius:"50%",width:42,height:42,top:"50%",left:"50%",transform:"translate(-50%, -50%)"},[`&:hover, &.${Wt.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:mr(e.palette[t.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Wt.active}`]:{boxShadow:`0px 0px 0px 14px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:mr(e.palette[t.color].main,.16)}`},[`&.${Wt.disabled}`]:{"&:hover":{boxShadow:"none"}}})),vy=zn(my,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(({theme:e,ownerState:t})=>Ee({[`&.${Wt.valueLabelOpen}`]:{transform:`${t.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(1)`},zIndex:1,whiteSpace:"nowrap"},e.typography.body2,{fontWeight:500,transition:e.transitions.create(["transform"],{duration:e.transitions.duration.shortest}),transform:`${t.orientation==="vertical"?"translateY(-50%)":"translateY(-100%)"} scale(0)`,position:"absolute",backgroundColor:(e.vars||e).palette.grey[600],borderRadius:2,color:(e.vars||e).palette.common.white,display:"flex",alignItems:"center",justifyContent:"center",padding:"0.25rem 0.75rem"},t.orientation==="horizontal"&&{top:"-10px",transformOrigin:"bottom center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, 50%) rotate(45deg)",backgroundColor:"inherit",bottom:0,left:"50%"}},t.orientation==="vertical"&&{right:t.size==="small"?"20px":"30px",top:"50%",transformOrigin:"right center","&:before":{position:"absolute",content:'""',width:8,height:8,transform:"translate(-50%, -50%) rotate(45deg)",backgroundColor:"inherit",right:-8,top:"50%"}},t.size==="small"&&{fontSize:e.typography.pxToRem(12),padding:"0.25rem 0.5rem"})),_y=zn("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>Uu(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:n}=e;return[t.mark,n&&t.markActive]}})(({theme:e,ownerState:t,markActive:n})=>Ee({position:"absolute",width:2,height:2,borderRadius:1,backgroundColor:"currentColor"},t.orientation==="horizontal"&&{top:"50%",transform:"translate(-1px, -50%)"},t.orientation==="vertical"&&{left:"50%",transform:"translate(-50%, 1px)"},n&&{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8})),Sy=zn("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>Uu(e)&&e!=="markLabelActive",overridesResolver:(e,t)=>t.markLabel})(({theme:e,ownerState:t,markLabelActive:n})=>Ee({},e.typography.body2,{color:(e.vars||e).palette.text.secondary,position:"absolute",whiteSpace:"nowrap"},t.orientation==="horizontal"&&{top:30,transform:"translateX(-50%)","@media (pointer: coarse)":{top:40}},t.orientation==="vertical"&&{left:36,transform:"translateY(50%)","@media (pointer: coarse)":{left:44}},n&&{color:(e.vars||e).palette.text.primary})),ky=e=>{const{disabled:t,dragging:n,marked:r,orientation:i,track:o,classes:a,color:l,size:d}=e,f={root:["root",t&&"disabled",n&&"dragging",r&&"marked",i==="vertical"&&"vertical",o==="inverted"&&"trackInverted",o===!1&&"trackFalse",l&&`color${On(l)}`,d&&`size${On(d)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",d&&`thumbSize${On(d)}`,l&&`thumbColor${On(l)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return Vu(f,fy,a)},Cy=({children:e})=>e,Ey=j.forwardRef(function(t,n){var r,i,o,a,l,d,f,h,p,y,g,w,_,S,k,C,M,O,L,T,V,U,W,q;const $=Hu({props:t,name:"MuiSlider"}),B=Wu().direction==="rtl",{"aria-label":P,"aria-valuetext":R,"aria-labelledby":A,component:G="span",components:X={},componentsProps:F={},color:v="primary",classes:Q,className:ne,disableSwap:E=!1,disabled:ae=!1,getAriaLabel:J,getAriaValueText:le,marks:pe=!1,max:me=100,min:ve=0,orientation:ke="horizontal",size:Be="medium",step:Je=1,scale:He=nc,slotProps:we,slots:ge,track:Ye="normal",valueLabelDisplay:Ze="off",valueLabelFormat:ue=nc}=$,dt=Yu($,gy),Ne=Ee({},$,{isRtl:B,max:me,min:ve,classes:Q,disabled:ae,disableSwap:E,orientation:ke,marks:pe,color:v,size:Be,step:Je,scale:He,track:Ye,valueLabelDisplay:Ze,valueLabelFormat:ue}),{axisProps:Le,getRootProps:Xe,getHiddenInputProps:ft,getThumbProps:ht,open:D,active:Z,axis:te,focusedThumbIndex:se,range:re,dragging:ye,marks:fe,values:_e,trackOffset:je,trackLeap:Ve,getThumbStyle:Ae}=Qg(Ee({},Ne,{rootRef:n}));Ne.marked=fe.length>0&&fe.some(Pe=>Pe.label),Ne.dragging=ye,Ne.focusedThumbIndex=se;const be=ky(Ne),tt=(r=(i=ge==null?void 0:ge.root)!=null?i:X.Root)!=null?r:yy,qt=(o=(a=ge==null?void 0:ge.rail)!=null?a:X.Rail)!=null?o:xy,jt=(l=(d=ge==null?void 0:ge.track)!=null?d:X.Track)!=null?l:wy,De=(f=(h=ge==null?void 0:ge.thumb)!=null?h:X.Thumb)!=null?f:by,bn=(p=(y=ge==null?void 0:ge.valueLabel)!=null?y:X.ValueLabel)!=null?p:vy,St=(g=(w=ge==null?void 0:ge.mark)!=null?w:X.Mark)!=null?g:_y,Xt=(_=(S=ge==null?void 0:ge.markLabel)!=null?S:X.MarkLabel)!=null?_:Sy,vn=(k=(C=ge==null?void 0:ge.input)!=null?C:X.Input)!=null?k:"input",Kt=(M=we==null?void 0:we.root)!=null?M:F.root,Qt=(O=we==null?void 0:we.rail)!=null?O:F.rail,Jt=(L=we==null?void 0:we.track)!=null?L:F.track,Fn=(T=we==null?void 0:we.thumb)!=null?T:F.thumb,en=(V=we==null?void 0:we.valueLabel)!=null?V:F.valueLabel,Or=(U=we==null?void 0:we.mark)!=null?U:F.mark,an=(W=we==null?void 0:we.markLabel)!=null?W:F.markLabel,_n=(q=we==null?void 0:we.input)!=null?q:F.input,ce=En({elementType:tt,getSlotProps:Xe,externalSlotProps:Kt,externalForwardedProps:dt,additionalProps:Ee({},dy(tt)&&{as:G}),ownerState:Ee({},Ne,Kt==null?void 0:Kt.ownerState),className:[be.root,ne]}),Ar=En({elementType:qt,externalSlotProps:Qt,ownerState:Ne,className:be.rail}),Dr=En({elementType:jt,externalSlotProps:Jt,additionalProps:{style:Ee({},Le[te].offset(je),Le[te].leap(Ve))},ownerState:Ee({},Ne,Jt==null?void 0:Jt.ownerState),className:be.track}),ot=En({elementType:De,getSlotProps:ht,externalSlotProps:Fn,ownerState:Ee({},Ne,Fn==null?void 0:Fn.ownerState),className:be.thumb}),Hn=En({elementType:bn,externalSlotProps:en,ownerState:Ee({},Ne,en==null?void 0:en.ownerState),className:be.valueLabel}),Te=En({elementType:St,externalSlotProps:Or,ownerState:Ne,className:be.mark}),Ht=En({elementType:Xt,externalSlotProps:an,ownerState:Ne,className:be.markLabel}),Ir=En({elementType:vn,getSlotProps:ft,externalSlotProps:_n,ownerState:Ne});return u.jsxs(tt,Ee({},ce,{children:[u.jsx(qt,Ee({},Ar)),u.jsx(jt,Ee({},Dr)),fe.filter(Pe=>Pe.value>=ve&&Pe.value<=me).map((Pe,$e)=>{const pt=uo(Pe.value,ve,me),Ue=Le[te].offset(pt);let Ke;return Ye===!1?Ke=_e.indexOf(Pe.value)!==-1:Ke=Ye==="normal"&&(re?Pe.value>=_e[0]&&Pe.value<=_e[_e.length-1]:Pe.value<=_e[0])||Ye==="inverted"&&(re?Pe.value<=_e[0]||Pe.value>=_e[_e.length-1]:Pe.value>=_e[0]),u.jsxs(j.Fragment,{children:[u.jsx(St,Ee({"data-index":$e},Te,!no(St)&&{markActive:Ke},{style:Ee({},Ue,Te.style),className:Dn(Te.className,Ke&&be.markActive)})),Pe.label!=null?u.jsx(Xt,Ee({"aria-hidden":!0,"data-index":$e},Ht,!no(Xt)&&{markLabelActive:Ke},{style:Ee({},Ue,Ht.style),className:Dn(be.markLabel,Ht.className,Ke&&be.markLabelActive),children:Pe.label})):null]},$e)}),_e.map((Pe,$e)=>{const pt=uo(Pe,ve,me),Ue=Le[te].offset(pt),Ke=Ze==="off"?Cy:bn;return u.jsx(Ke,Ee({},!no(Ke)&&{valueLabelFormat:ue,valueLabelDisplay:Ze,value:typeof ue=="function"?ue(He(Pe),$e):ue,index:$e,open:D===$e||Z===$e||Ze==="on",disabled:ae},Hn,{children:u.jsx(De,Ee({"data-index":$e},ot,{className:Dn(be.thumb,ot.className,Z===$e&&be.active,se===$e&&be.focusVisible),style:Ee({},Ue,Ae($e),ot.style),children:u.jsx(vn,Ee({"data-index":$e,"aria-label":J?J($e):P,"aria-valuenow":He(Pe),"aria-labelledby":A,"aria-valuetext":le?le(He(Pe),$e):R,value:_e[$e]},Ir))}))}),$e)})]}))}),dd=Ey,Py=(e,t="down")=>{const n=Wu(),[r,i]=j.useState(!1),o=n.breakpoints[t](e).split("@media")[1].trim();return j.useEffect(()=>{const a=()=>{const{matches:l}=window.matchMedia(o);i(l)};return a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[o]),r};function rc(e,t,n){var r=new Im;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}const My=e=>e.filter(t=>t.tldr).length>=2&&e.some(t=>t.audio_EN);function jy(e){return e.tldr_topic??e.name}var fo=globalThis&&globalThis.__assign||function(){return fo=Object.assign||function(e){for(var t,n=1,r=arguments.length;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(B=tg(B,_,{trailing:!0,leading:!1}));var P=new ResizeObserver(B),R=L.current.getBoundingClientRect(),A=R.width,G=R.height;return $(A,G),P.observe(L.current),function(){P.disconnect()}},[$,_]);var H=j.useMemo(function(){var B=W.containerWidth,P=W.containerHeight;if(B<0||P<0)return null;us(Li(a)||Li(d),`The width(%s) and height(%s) are both fixed numbers, + maybe you don't need to use a ResponsiveContainer.`,a,d),us(!n||n>0,"The aspect(%s) must be greater than zero.",n);var R=Li(a)?B:a,A=Li(d)?P:d;n&&n>0&&(R?A=R/n:A&&(R=A*n),y&&A>y&&(A=y)),us(R>0||A>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,L,A,a,d,h,p,n);var G=!Array.isArray(g)&&Ul.isElement(g)&&ng(g.type).endsWith("Chart");return ee.Children.map(g,function(X){return Ul.isElement(X)?j.cloneElement(X,Hi({width:L,height:A},G?{style:Hi({height:"100%",width:"100%",maxHeight:A,maxWidth:L},X.props.style)}:{})):X})},[n,g,d,y,p,h,W,a]);return ee.createElement("div",{id:S?"".concat(S):void 0,className:Xu("recharts-responsive-container",k),style:Hi(Hi({},O),{},{width:a,height:d,minWidth:h,minHeight:p,maxHeight:y}),ref:R},H)}),sc=180/Math.PI,zs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fd(e,t,n,r,i,o){var a,l,d;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(d=e*n+t*r)&&(n-=e*d,r-=t*d),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,d/=l),e*r180?h+=360:h-f>180&&(f+=360),y.push({i:p.push(i(p)+"rotate(",null,r)-2,x:Wn(f,h)})):h&&p.push(i(p)+"rotate("+h+r)}function l(f,h,p,y){f!==h?y.push({i:p.push(i(p)+"skewX(",null,r)-2,x:Wn(f,h)}):h&&p.push(i(p)+"skewX("+h+r)}function d(f,h,p,y,g,w){if(f!==p||h!==y){var _=g.push(i(g)+"scale(",null,",",null,")");w.push({i:_-4,x:Wn(f,p)},{i:_-2,x:Wn(h,y)})}else(p!==1||y!==1)&&g.push(i(g)+"scale("+p+","+y+")")}return function(f,h){var p=[],y=[];return f=e(f),h=e(h),o(f.translateX,f.translateY,h.translateX,h.translateY,p,y),a(f.rotate,h.rotate,p,y),l(f.skewX,h.skewX,p,y),d(f.scaleX,f.scaleY,h.scaleX,h.scaleY,p,y),f=h=null,function(g){for(var w=-1,_=y.length,S;++w<_;)p[(S=y[w]).i]=S.x(g);return p.join("")}}}var Yy=hd(Fy,"px, ","px)","deg)"),Vy=hd(Hy,", ",")",")"),Uy=1e-12;function ac(e){return((e=Math.exp(e))+1/e)/2}function Wy(e){return((e=Math.exp(e))-1/e)/2}function Gy(e){return((e=Math.exp(2*e))-1)/(e+1)}const Zy=function e(t,n,r){function i(o,a){var l=o[0],d=o[1],f=o[2],h=a[0],p=a[1],y=a[2],g=h-l,w=p-d,_=g*g+w*w,S,k;if(_=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ky(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function Qy(e){var t=e.option,n=e.isActive,r=Xy(e,qy);return typeof t=="string"?ee.createElement(Wl,ni({option:ee.createElement(rg,ni({type:t},r)),isActive:n,shapeType:"symbols"},r)):ee.createElement(Wl,ni({option:t,isActive:n,shapeType:"symbols"},r))}function Sr(e){"@babel/helpers - typeof";return Sr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sr(e)}function ri(){return ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ho(e){return ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ho(e)}function An(e,t,n){return t=pd(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pd(e){var t=ox(e,"string");return Sr(t)==="symbol"?t:String(t)}function ox(e,t){if(Sr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Sr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mi=function(e){tx(n,e);var t=nx(n);function n(){var r;Jy(this,n);for(var i=arguments.length,o=new Array(i),a=0;au.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("mask",{id:"mask0_2337_2483",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"14",height:"14",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_2337_2483)",children:u.jsx("path",{d:"M7.00001 8.72074C6.92223 8.72074 6.84931 8.70858 6.78126 8.68428C6.7132 8.65997 6.65001 8.61865 6.59167 8.56032L3.90834 5.87699C3.8014 5.77004 3.74792 5.63393 3.74792 5.46865C3.74792 5.30337 3.8014 5.16726 3.90834 5.06032C4.01529 4.95337 4.1514 4.8999 4.31667 4.8999C4.48195 4.8999 4.61806 4.95337 4.72501 5.06032L7.00001 7.33532L9.27501 5.06032C9.38195 4.95337 9.51806 4.8999 9.68334 4.8999C9.84862 4.8999 9.98473 4.95337 10.0917 5.06032C10.1986 5.16726 10.2521 5.30337 10.2521 5.46865C10.2521 5.63393 10.1986 5.77004 10.0917 5.87699L7.40834 8.56032C7.35001 8.61865 7.28681 8.65997 7.21876 8.68428C7.1507 8.70858 7.07779 8.72074 7.00001 8.72074Z",fill:"currentColor"})})]}),md=e=>u.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("mask",{id:"mask0_2337_2442",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"14",height:"14",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_2337_2442)",children:u.jsx("path",{d:"M7.00001 6.28532L4.72501 8.56032C4.61806 8.66726 4.48195 8.72074 4.31667 8.72074C4.1514 8.72074 4.01529 8.66726 3.90834 8.56032C3.8014 8.45337 3.74792 8.31726 3.74792 8.15199C3.74792 7.98671 3.8014 7.8506 3.90834 7.74365L6.59167 5.06032C6.65001 5.00199 6.7132 4.96067 6.78126 4.93636C6.84931 4.91206 6.92223 4.8999 7.00001 4.8999C7.07779 4.8999 7.1507 4.91206 7.21876 4.93636C7.28681 4.96067 7.35001 5.00199 7.40834 5.06032L10.0917 7.74365C10.1986 7.8506 10.2521 7.98671 10.2521 8.15199C10.2521 8.31726 10.1986 8.45337 10.0917 8.56032C9.98473 8.66726 9.84862 8.72074 9.68334 8.72074C9.51806 8.72074 9.38195 8.66726 9.27501 8.56032L7.00001 6.28532Z",fill:"currentColor"})})]}),ax=()=>{var p;const[e,t]=j.useState(null),{sidebarFilter:n,setSidebarFilter:r,sidebarFilterCounts:i}=zt(y=>y),o=n==="undefined"?"":n.toLowerCase(),a=((p=i.find(y=>y.name===o))==null?void 0:p.count)||0,l=y=>y?y.charAt(0).toUpperCase()+y.slice(1):"",d=y=>{a>=1&&t(y.currentTarget)},f=()=>{t(null)},h=y=>{r(y),f()};return u.jsxs("div",{children:[u.jsxs(lx,{onClick:d,children:[u.jsx("div",{className:"text",children:"Show"}),u.jsx("div",{className:"value","data-testid":"value",children:`${l(o)} (${a})`}),a>=1&&u.jsx("div",{className:"icon",children:e?u.jsx(md,{}):u.jsx(_a,{})})]}),u.jsx(ux,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"left"},anchorPosition:{top:62,left:0},onClose:f,open:!!e,transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx(ed,{children:i.filter(({name:y})=>y).map(({name:y,count:g})=>u.jsxs(cx,{className:In({active:y===n}),onClick:w=>{w.preventDefault(),h(y)},children:[u.jsx("span",{className:"icon",children:y===n?u.jsx(td,{}):null}),u.jsx("span",{children:`${l(y)} (${g})`})]},y))})})]})},lx=Y(z).attrs({direction:"row",align:"center"})` + height and width.`,R,A,a,d,h,p,n);var G=!Array.isArray(g)&&Ul.isElement(g)&&ng(g.type).endsWith("Chart");return ee.Children.map(g,function(X){return Ul.isElement(X)?j.cloneElement(X,Hi({width:R,height:A},G?{style:Hi({height:"100%",width:"100%",maxHeight:A,maxWidth:R},X.props.style)}:{})):X})},[n,g,d,y,p,h,W,a]);return ee.createElement("div",{id:S?"".concat(S):void 0,className:Xu("recharts-responsive-container",k),style:Hi(Hi({},O),{},{width:a,height:d,minWidth:h,minHeight:p,maxHeight:y}),ref:L},H)}),sc=180/Math.PI,zs={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function fd(e,t,n,r,i,o){var a,l,d;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(d=e*n+t*r)&&(n-=e*d,r-=t*d),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,d/=l),e*r180?h+=360:h-f>180&&(f+=360),y.push({i:p.push(i(p)+"rotate(",null,r)-2,x:Wn(f,h)})):h&&p.push(i(p)+"rotate("+h+r)}function l(f,h,p,y){f!==h?y.push({i:p.push(i(p)+"skewX(",null,r)-2,x:Wn(f,h)}):h&&p.push(i(p)+"skewX("+h+r)}function d(f,h,p,y,g,w){if(f!==p||h!==y){var _=g.push(i(g)+"scale(",null,",",null,")");w.push({i:_-4,x:Wn(f,p)},{i:_-2,x:Wn(h,y)})}else(p!==1||y!==1)&&g.push(i(g)+"scale("+p+","+y+")")}return function(f,h){var p=[],y=[];return f=e(f),h=e(h),o(f.translateX,f.translateY,h.translateX,h.translateY,p,y),a(f.rotate,h.rotate,p,y),l(f.skewX,h.skewX,p,y),d(f.scaleX,f.scaleY,h.scaleX,h.scaleY,p,y),f=h=null,function(g){for(var w=-1,_=y.length,S;++w<_;)p[(S=y[w]).i]=S.x(g);return p.join("")}}}var Vy=hd(Hy,"px, ","px)","deg)"),Uy=hd(Yy,", ",")",")"),Wy=1e-12;function ac(e){return((e=Math.exp(e))+1/e)/2}function Gy(e){return((e=Math.exp(e))-1/e)/2}function Zy(e){return((e=Math.exp(2*e))-1)/(e+1)}const qy=function e(t,n,r){function i(o,a){var l=o[0],d=o[1],f=o[2],h=a[0],p=a[1],y=a[2],g=h-l,w=p-d,_=g*g+w*w,S,k;if(_=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Qy(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o=0)&&(n[i]=e[i]);return n}function Jy(e){var t=e.option,n=e.isActive,r=Ky(e,Xy);return typeof t=="string"?ee.createElement(Wl,ni({option:ee.createElement(rg,ni({type:t},r)),isActive:n,shapeType:"symbols"},r)):ee.createElement(Wl,ni({option:t,isActive:n,shapeType:"symbols"},r))}function Sr(e){"@babel/helpers - typeof";return Sr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Sr(e)}function ri(){return ri=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ho(e){return ho=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},ho(e)}function An(e,t,n){return t=pd(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function pd(e){var t=sx(e,"string");return Sr(t)==="symbol"?t:String(t)}function sx(e,t){if(Sr(e)!=="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(Sr(r)!=="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var mi=function(e){nx(n,e);var t=rx(n);function n(){var r;ex(this,n);for(var i=arguments.length,o=new Array(i),a=0;au.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("mask",{id:"mask0_2337_2483",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"14",height:"14",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_2337_2483)",children:u.jsx("path",{d:"M7.00001 8.72074C6.92223 8.72074 6.84931 8.70858 6.78126 8.68428C6.7132 8.65997 6.65001 8.61865 6.59167 8.56032L3.90834 5.87699C3.8014 5.77004 3.74792 5.63393 3.74792 5.46865C3.74792 5.30337 3.8014 5.16726 3.90834 5.06032C4.01529 4.95337 4.1514 4.8999 4.31667 4.8999C4.48195 4.8999 4.61806 4.95337 4.72501 5.06032L7.00001 7.33532L9.27501 5.06032C9.38195 4.95337 9.51806 4.8999 9.68334 4.8999C9.84862 4.8999 9.98473 4.95337 10.0917 5.06032C10.1986 5.16726 10.2521 5.30337 10.2521 5.46865C10.2521 5.63393 10.1986 5.77004 10.0917 5.87699L7.40834 8.56032C7.35001 8.61865 7.28681 8.65997 7.21876 8.68428C7.1507 8.70858 7.07779 8.72074 7.00001 8.72074Z",fill:"currentColor"})})]}),md=e=>u.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("mask",{id:"mask0_2337_2442",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"14",height:"14",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_2337_2442)",children:u.jsx("path",{d:"M7.00001 6.28532L4.72501 8.56032C4.61806 8.66726 4.48195 8.72074 4.31667 8.72074C4.1514 8.72074 4.01529 8.66726 3.90834 8.56032C3.8014 8.45337 3.74792 8.31726 3.74792 8.15199C3.74792 7.98671 3.8014 7.8506 3.90834 7.74365L6.59167 5.06032C6.65001 5.00199 6.7132 4.96067 6.78126 4.93636C6.84931 4.91206 6.92223 4.8999 7.00001 4.8999C7.07779 4.8999 7.1507 4.91206 7.21876 4.93636C7.28681 4.96067 7.35001 5.00199 7.40834 5.06032L10.0917 7.74365C10.1986 7.8506 10.2521 7.98671 10.2521 8.15199C10.2521 8.31726 10.1986 8.45337 10.0917 8.56032C9.98473 8.66726 9.84862 8.72074 9.68334 8.72074C9.51806 8.72074 9.38195 8.66726 9.27501 8.56032L7.00001 6.28532Z",fill:"currentColor"})})]}),lx=()=>{var p;const[e,t]=j.useState(null),{sidebarFilter:n,setSidebarFilter:r,sidebarFilterCounts:i}=zt(y=>y),o=n==="undefined"?"":n.toLowerCase(),a=((p=i.find(y=>y.name===o))==null?void 0:p.count)||0,l=y=>y?y.charAt(0).toUpperCase()+y.slice(1):"",d=y=>{a>=1&&t(y.currentTarget)},f=()=>{t(null)},h=y=>{r(y),f()};return u.jsxs("div",{children:[u.jsxs(cx,{onClick:d,children:[u.jsx("div",{className:"text",children:"Show"}),u.jsx("div",{className:"value","data-testid":"value",children:`${l(o)} (${a})`}),a>=1&&u.jsx("div",{className:"icon",children:e?u.jsx(md,{}):u.jsx(_a,{})})]}),u.jsx(dx,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"left"},anchorPosition:{top:62,left:0},onClose:f,open:!!e,transformOrigin:{vertical:"top",horizontal:"left"},children:u.jsx(ed,{children:i.filter(({name:y})=>y).map(({name:y,count:g})=>u.jsxs(ux,{className:In({active:y===n}),onClick:w=>{w.preventDefault(),h(y)},children:[u.jsx("span",{className:"icon",children:y===n?u.jsx(td,{}):null}),u.jsx("span",{children:`${l(y)} (${g})`})]},y))})})]})},cx=Y(z).attrs({direction:"row",align:"center"})` cursor: pointer; flex-grow: 1; color: ${N.GRAY6}; @@ -20,7 +20,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .value { margin: 0 8px 0 4px; } -`,cx=Y(z).attrs({direction:"row",align:"center"})` +`,ux=Y(z).attrs({direction:"row",align:"center"})` font-family: Barlow; font-size: 13px; font-style: normal; @@ -40,7 +40,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho width: 9px; font-size: 10px; } -`,ux=Y(gg)` +`,dx=Y(gg)` .MuiPaper-root { background: ${N.BUTTON1}; min-width: 149px; @@ -49,7 +49,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.2); border-radius: 6px; } -`,dx=({showAllSchemas:e,setShowAllSchemas:t,setSelectedTypes:n,handleApply:r,selectedTypes:i,schemaAll:o,anchorEl:a})=>{const l=h=>{n(p=>p.includes(h)?p.filter(y=>y!==h):[...p,h])},d=async()=>{n([])},f=()=>{t(!0)};return u.jsxs(fx,{anchorEl:a,disablePortal:!0,modifiers:[{name:"offset",options:{offset:[0,10]}}],open:!!a,placement:"bottom-end",children:[u.jsxs(hx,{children:[u.jsx("div",{children:"Type"}),u.jsxs(px,{children:[u.jsx(mx,{children:i.length}),u.jsx(gx,{children:"Selected"})]})]}),u.jsxs(yx,{children:[u.jsx(vx,{children:(e?o:o.slice(0,4)).map(h=>u.jsx(_x,{isSelected:i.includes(h.type),onClick:()=>l(h==null?void 0:h.type),children:h.type},h.type))}),!e&&o.length>4&&u.jsx(Sx,{onClick:f,children:u.jsxs(bx,{children:[u.jsx(ya,{})," View More"]})})]}),u.jsx(wx,{}),u.jsx(xx,{children:u.jsxs(z,{direction:"row",mb:6,children:[u.jsxs(kx,{color:"secondary",onClick:d,size:"large",style:{marginRight:20},variant:"contained",children:[u.jsx(Cx,{children:u.jsx(nd,{})}),"Clear"]}),u.jsx(Ex,{color:"secondary",onClick:r,size:"large",variant:"contained",children:"Show Results"})]})})]})},fx=Y(yg)` +`,fx=({showAllSchemas:e,setShowAllSchemas:t,setSelectedTypes:n,handleApply:r,selectedTypes:i,schemaAll:o,anchorEl:a})=>{const l=h=>{n(p=>p.includes(h)?p.filter(y=>y!==h):[...p,h])},d=async()=>{n([])},f=()=>{t(!0)};return u.jsxs(hx,{anchorEl:a,disablePortal:!0,modifiers:[{name:"offset",options:{offset:[0,10]}}],open:!!a,placement:"bottom-end",children:[u.jsxs(px,{children:[u.jsx("div",{children:"Type"}),u.jsxs(mx,{children:[u.jsx(gx,{children:i.length}),u.jsx(yx,{children:"Selected"})]})]}),u.jsxs(xx,{children:[u.jsx(_x,{children:(e?o:o.slice(0,4)).map(h=>u.jsx(Sx,{isSelected:i.includes(h.type),onClick:()=>l(h==null?void 0:h.type),children:h.type},h.type))}),!e&&o.length>4&&u.jsx(kx,{onClick:f,children:u.jsxs(vx,{children:[u.jsx(ya,{})," View More"]})})]}),u.jsx(bx,{}),u.jsx(wx,{children:u.jsxs(z,{direction:"row",mb:6,children:[u.jsxs(Cx,{color:"secondary",onClick:d,size:"large",style:{marginRight:20},variant:"contained",children:[u.jsx(Ex,{children:u.jsx(nd,{})}),"Clear"]}),u.jsx(Px,{color:"secondary",onClick:r,size:"large",variant:"contained",children:"Show Results"})]})})]})},hx=Y(yg)` &&.MuiPopper-root { background: ${N.BG2}; padding: 16px; @@ -61,7 +61,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho border: 1px solid ${N.black}; z-index: 100; } -`,hx=Y.div` +`,px=Y.div` display: flex; justify-content: space-between; align-items: center; @@ -69,28 +69,28 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho font-family: Barlow; font-size: 18px; font-weight: 500; -`,px=Y.div` +`,mx=Y.div` font-size: 13px; display: flex; align-items: center; -`,mx=Y.span` - color: ${N.white}; `,gx=Y.span` + color: ${N.white}; +`,yx=Y.span` color: ${N.GRAY3}; margin-left: 4px; -`,yx=Y.div` +`,xx=Y.div` padding: 13px 0; position: relative; -`,xx=Y.div` +`,wx=Y.div` display: flex; justify-content: space-between; align-items: center; padding-top: 8px; -`,wx=Y.div` +`,bx=Y.div` border: 1px solid ${N.black}; width: calc(100% + 32px); margin: 13px -16px; -`,bx=Y.span` +`,vx=Y.span` display: flex; justify-content: space-between; align-items: center; @@ -102,14 +102,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho fill: none; margin-top: 2px; } -`,vx=Y(z).attrs({align:"center",direction:"row",grow:1,justify:"flex-start"})` +`,_x=Y(z).attrs({align:"center",direction:"row",grow:1,justify:"flex-start"})` flex-wrap: wrap; gap: 10px; max-height: 400px; overflow-y: auto; padding-right: 10px; margin-right: calc(0px - 16px); -`,_x=Y(z).attrs({align:"center",direction:"row",justify:"flex-start"})` +`,Sx=Y(z).attrs({align:"center",direction:"row",justify:"flex-start"})` color: ${({isSelected:e})=>e?N.black:N.white}; background: ${({isSelected:e})=>e?N.white:N.BUTTON1_PRESS}; padding: 6px 10px 6px 8px; @@ -131,7 +131,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho background: ${N.white}; color: ${N.black}; } -`,Sx=Y.button` +`,kx=Y.button` background: transparent; color: ${N.white}; border: none; @@ -150,7 +150,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho &:active { background: ${N.BUTTON1_PRESS}; } -`,kx=Y(Pt)` +`,Cx=Y(Pt)` && { color: ${N.white}; background-color: ${N.BUTTON1}; @@ -162,7 +162,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho background-color: ${N.BUTTON1}; } } -`,Cx=Y.span` +`,Ex=Y.span` svg { width: 32px; height: 32px; @@ -170,12 +170,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho fill: none; margin-top: 2px; } -`,Ex=Y(Pt)` +`,Px=Y(Pt)` && { flex: 1; padding: 2px 55px; } -`,gd=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"keyboard_arrow_left",children:[u.jsx("mask",{id:"mask0_1428_267",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"18",height:"18",children:u.jsx("path",{id:"Bounding box",d:"M0 0H18V18H0V0Z",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1428_267)",children:u.jsx("path",{id:"keyboard_arrow_left_2",d:"M8.10001 8.99998L11.025 11.925C11.1625 12.0625 11.2313 12.2375 11.2313 12.45C11.2313 12.6625 11.1625 12.8375 11.025 12.975C10.8875 13.1125 10.7125 13.1812 10.5 13.1812C10.2875 13.1812 10.1125 13.1125 9.97501 12.975L6.52501 9.52498C6.45001 9.44998 6.39688 9.36873 6.36563 9.28123C6.33438 9.19373 6.31876 9.09998 6.31876 8.99998C6.31876 8.89998 6.33438 8.80623 6.36563 8.71873C6.39688 8.63123 6.45001 8.54998 6.52501 8.47498L9.97501 5.02498C10.1125 4.88748 10.2875 4.81873 10.5 4.81873C10.7125 4.81873 10.8875 4.88748 11.025 5.02498C11.1625 5.16248 11.2313 5.33748 11.2313 5.54998C11.2313 5.76248 11.1625 5.93748 11.025 6.07498L8.10001 8.99998Z",fill:"currentColor"})})]})}),Px=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M5.99995 7.22422L1.71245 11.5117C1.55203 11.6721 1.34787 11.7523 1.09995 11.7523C0.852035 11.7523 0.647868 11.6721 0.487451 11.5117C0.327035 11.3513 0.246826 11.1471 0.246826 10.8992C0.246826 10.6513 0.327035 10.4471 0.487451 10.2867L4.77495 5.99922L0.487451 1.71172C0.327035 1.5513 0.246826 1.34714 0.246826 1.09922C0.246826 0.851302 0.327035 0.647135 0.487451 0.486719C0.647868 0.326302 0.852035 0.246094 1.09995 0.246094C1.34787 0.246094 1.55203 0.326302 1.71245 0.486719L5.99995 4.77422L10.2875 0.486719C10.4479 0.326302 10.652 0.246094 10.9 0.246094C11.1479 0.246094 11.352 0.326302 11.5125 0.486719C11.6729 0.647135 11.7531 0.851302 11.7531 1.09922C11.7531 1.34714 11.6729 1.5513 11.5125 1.71172L7.22495 5.99922L11.5125 10.2867C11.6729 10.4471 11.7531 10.6513 11.7531 10.8992C11.7531 11.1471 11.6729 11.3513 11.5125 11.5117C11.352 11.6721 11.1479 11.7523 10.9 11.7523C10.652 11.7523 10.4479 11.6721 10.2875 11.5117L5.99995 7.22422Z",fill:"currentColor"})}),Mx=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M7.38474 15.5C7.13341 15.5 6.92316 15.4153 6.75399 15.246C6.58466 15.0768 6.49999 14.8666 6.49999 14.6152V8.827L0.901988 1.7155C0.709655 1.459 0.681738 1.19233 0.818238 0.9155C0.954905 0.6385 1.18541 0.5 1.50974 0.5H14.4902C14.8146 0.5 15.0451 0.6385 15.1817 0.9155C15.3182 1.19233 15.2903 1.459 15.098 1.7155L9.49999 8.827V14.6152C9.49999 14.8666 9.41532 15.0768 9.24599 15.246C9.07682 15.4153 8.86657 15.5 8.61524 15.5H7.38474Z",fill:"currentColor"})}),jx=Y.input.attrs(()=>({autoCorrect:"off",autoComplete:"off"}))` +`,gd=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"keyboard_arrow_left",children:[u.jsx("mask",{id:"mask0_1428_267",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"18",height:"18",children:u.jsx("path",{id:"Bounding box",d:"M0 0H18V18H0V0Z",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1428_267)",children:u.jsx("path",{id:"keyboard_arrow_left_2",d:"M8.10001 8.99998L11.025 11.925C11.1625 12.0625 11.2313 12.2375 11.2313 12.45C11.2313 12.6625 11.1625 12.8375 11.025 12.975C10.8875 13.1125 10.7125 13.1812 10.5 13.1812C10.2875 13.1812 10.1125 13.1125 9.97501 12.975L6.52501 9.52498C6.45001 9.44998 6.39688 9.36873 6.36563 9.28123C6.33438 9.19373 6.31876 9.09998 6.31876 8.99998C6.31876 8.89998 6.33438 8.80623 6.36563 8.71873C6.39688 8.63123 6.45001 8.54998 6.52501 8.47498L9.97501 5.02498C10.1125 4.88748 10.2875 4.81873 10.5 4.81873C10.7125 4.81873 10.8875 4.88748 11.025 5.02498C11.1625 5.16248 11.2313 5.33748 11.2313 5.54998C11.2313 5.76248 11.1625 5.93748 11.025 6.07498L8.10001 8.99998Z",fill:"currentColor"})})]})}),Mx=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M5.99995 7.22422L1.71245 11.5117C1.55203 11.6721 1.34787 11.7523 1.09995 11.7523C0.852035 11.7523 0.647868 11.6721 0.487451 11.5117C0.327035 11.3513 0.246826 11.1471 0.246826 10.8992C0.246826 10.6513 0.327035 10.4471 0.487451 10.2867L4.77495 5.99922L0.487451 1.71172C0.327035 1.5513 0.246826 1.34714 0.246826 1.09922C0.246826 0.851302 0.327035 0.647135 0.487451 0.486719C0.647868 0.326302 0.852035 0.246094 1.09995 0.246094C1.34787 0.246094 1.55203 0.326302 1.71245 0.486719L5.99995 4.77422L10.2875 0.486719C10.4479 0.326302 10.652 0.246094 10.9 0.246094C11.1479 0.246094 11.352 0.326302 11.5125 0.486719C11.6729 0.647135 11.7531 0.851302 11.7531 1.09922C11.7531 1.34714 11.6729 1.5513 11.5125 1.71172L7.22495 5.99922L11.5125 10.2867C11.6729 10.4471 11.7531 10.6513 11.7531 10.8992C11.7531 11.1471 11.6729 11.3513 11.5125 11.5117C11.352 11.6721 11.1479 11.7523 10.9 11.7523C10.652 11.7523 10.4479 11.6721 10.2875 11.5117L5.99995 7.22422Z",fill:"currentColor"})}),jx=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M7.38474 15.5C7.13341 15.5 6.92316 15.4153 6.75399 15.246C6.58466 15.0768 6.49999 14.8666 6.49999 14.6152V8.827L0.901988 1.7155C0.709655 1.459 0.681738 1.19233 0.818238 0.9155C0.954905 0.6385 1.18541 0.5 1.50974 0.5H14.4902C14.8146 0.5 15.0451 0.6385 15.1817 0.9155C15.3182 1.19233 15.2903 1.459 15.098 1.7155L9.49999 8.827V14.6152C9.49999 14.8666 9.41532 15.0768 9.24599 15.246C9.07682 15.4153 8.86657 15.5 8.61524 15.5H7.38474Z",fill:"currentColor"})}),Tx=Y.input.attrs(()=>({autoCorrect:"off",autoComplete:"off"}))` pointer-events: auto; height: 48px; padding: 0 40px 0 18px; @@ -218,7 +218,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho background-position-x: 95%; background-repeat: no-repeat; `} -`,yd=({loading:e,onSubmit:t,placeholder:n="Search"})=>{const{register:r,watch:i}=xa(),o=i("search");return u.jsx(jx,{...r("search"),disabled:e,id:"main-search",loading:e,onKeyPress:a=>{if(a.key==="Enter"){if(o.trim()==="")return;t==null||t()}},placeholder:n,type:"text"})},hs=[["Searching","Podcast Index"],["Finding","Transcripts"],["Loading","Audio Clips"],["Loading","Video Clips"],["Preparing","Results"]],Tx=()=>{const[e,t]=j.useState(0);return j.useEffect(()=>{if(e===hs.length-1)return;const n=setTimeout(()=>t(r=>(r+1)%hs.length),2e3);return()=>clearTimeout(n)},[e]),u.jsx(Ox,{direction:"column",children:hs.map((n,r)=>u.jsxs(z,{className:In("raw-wrapper",{show:e===r}),direction:"row",children:[u.jsx("div",{className:In("action"),children:n[0]}),u.jsx("div",{className:In("entity"),children:n[1]}),u.jsx("div",{children:u.jsx(Oy,{color:N.SECONDARY_BLUE,size:2})})]},n[1]))})},Ox=Y(z)` +`,yd=({loading:e,onSubmit:t,placeholder:n="Search"})=>{const{register:r,watch:i}=xa(),o=i("search");return u.jsx(Tx,{...r("search"),disabled:e,id:"main-search",loading:e,onKeyPress:a=>{if(a.key==="Enter"){if(o.trim()==="")return;t==null||t()}},placeholder:n,type:"text"})},hs=[["Searching","Podcast Index"],["Finding","Transcripts"],["Loading","Audio Clips"],["Loading","Video Clips"],["Preparing","Results"]],Ox=()=>{const[e,t]=j.useState(0);return j.useEffect(()=>{if(e===hs.length-1)return;const n=setTimeout(()=>t(r=>(r+1)%hs.length),2e3);return()=>clearTimeout(n)},[e]),u.jsx(Ax,{direction:"column",children:hs.map((n,r)=>u.jsxs(z,{className:In("raw-wrapper",{show:e===r}),direction:"row",children:[u.jsx("div",{className:In("action"),children:n[0]}),u.jsx("div",{className:In("entity"),children:n[1]}),u.jsx("div",{children:u.jsx(Ay,{color:N.SECONDARY_BLUE,size:2})})]},n[1]))})},Ax=Y(z)` overflow: hidden; height: 20px; position: relative; @@ -240,14 +240,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho .entity { color: ${N.SECONDARY_BLUE}; } -`,Ax=()=>{const e=xg({mode:"onChange"}),{fetchData:t,setAbortRequests:n}=zt(a=>a),{setBudget:r}=So(a=>a),{reset:i}=e,o=e.handleSubmit(({search:a})=>{t(r,n,a),i({search:""})});return u.jsx(Dx,{children:u.jsx(wg,{...e,children:u.jsxs(Ix,{children:[u.jsx(yd,{onSubmit:o,placeholder:"Ask follow-up"}),u.jsx(Nx,{"data-testid":"search-ai_action_icon",onClick:()=>{o()},children:u.jsx(rd,{})})]})})})},Dx=Y(z)` +`,Dx=()=>{const e=xg({mode:"onChange"}),{fetchData:t,setAbortRequests:n}=zt(a=>a),{setBudget:r}=So(a=>a),{reset:i}=e,o=e.handleSubmit(({search:a})=>{t(r,n,a),i({search:""})});return u.jsx(Ix,{children:u.jsx(wg,{...e,children:u.jsxs(Nx,{children:[u.jsx(yd,{onSubmit:o,placeholder:"Ask follow-up"}),u.jsx(Lx,{"data-testid":"search-ai_action_icon",onClick:()=>{o()},children:u.jsx(rd,{})})]})})})},Ix=Y(z)` position: sticky; bottom: 0; padding: 12px; border-top: 1px solid ${N.black}; -`,Ix=Y(z).attrs({direction:"row",justify:"center",align:"center"})` +`,Nx=Y(z).attrs({direction:"row",justify:"center",align:"center"})` flex-grow: 1; -`,Nx=Y(z).attrs({align:"center",justify:"center",p:5})` +`,Lx=Y(z).attrs({align:"center",justify:"center",p:5})` font-size: 32px; color: ${N.mainBottomIcons}; cursor: pointer; @@ -258,7 +258,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho &:hover { /* background-color: ${N.gray200}; */ } -`,Lx=Y(z).attrs({direction:"column"})` +`,Rx=Y(z).attrs({direction:"column"})` padding: 24px; cursor: pointer; border-top: 1px solid #101317; @@ -286,7 +286,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho && { background: rgba(0, 0, 0, 0.15); } -`,Fs=({count:e=7})=>u.jsx(u.Fragment,{children:Array(e).fill(null).map((t,n)=>u.jsx(Lx,{children:u.jsxs(z,{direction:"row",children:[u.jsx(z,{align:"center",pr:16,children:u.jsx(Vi,{animation:"wave",height:64,variant:"rectangular",width:64})}),u.jsxs(z,{grow:1,shrink:1,children:[u.jsx(Vi,{height:10,variant:"rectangular",width:56}),u.jsx(Vi,{className:"title",height:10,variant:"rectangular",width:262}),u.jsx(Vi,{height:10,variant:"rectangular",width:149})]})]})},n))});Y(z)` +`,Fs=({count:e=7})=>u.jsx(u.Fragment,{children:Array(e).fill(null).map((t,n)=>u.jsx(Rx,{children:u.jsxs(z,{direction:"row",children:[u.jsx(z,{align:"center",pr:16,children:u.jsx(Vi,{animation:"wave",height:64,variant:"rectangular",width:64})}),u.jsxs(z,{grow:1,shrink:1,children:[u.jsx(Vi,{height:10,variant:"rectangular",width:56}),u.jsx(Vi,{className:"title",height:10,variant:"rectangular",width:262}),u.jsx(Vi,{height:10,variant:"rectangular",width:149})]})]})},n))});Y(z)` font-family: Barlow; font-size: 13px; font-style: normal; @@ -299,7 +299,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho -webkit-box-orient: vertical; overflow: hidden; white-space: normal; -`;const Rx=Y(Fe)` +`;const $x=Y(Fe)` overflow: hidden; color: ${N.GRAY6}; text-overflow: ellipsis; @@ -310,7 +310,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho line-height: 18px; margin-right: 8px; flex-shrink: 0; -`;Y(Rx)` +`;Y($x)` display: flex; flex-direction: row; align-items: center; @@ -328,7 +328,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho height: 4px; background: ${N.GRAY6}; } -`;const $x=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M7.28729 0.918723C7.41428 0.105284 8.58572 0.105284 8.71271 0.918723L8.76054 1.22508C9.2444 4.32436 11.6757 6.75568 14.775 7.23954L15.0814 7.28737C15.8948 7.41436 15.8948 8.5858 15.0814 8.71279L14.775 8.76062C11.6757 9.24448 9.2444 11.6758 8.76054 14.7751L8.71271 15.0814C8.58572 15.8949 7.41428 15.8949 7.28729 15.0814L7.23946 14.7751C6.7556 11.6758 4.32428 9.24448 1.225 8.76062L0.918643 8.71279C0.105204 8.5858 0.105204 7.41436 0.918642 7.28737L1.225 7.23954C4.32428 6.75568 6.7556 4.32436 7.23946 1.22508L7.28729 0.918723Z",fill:"currentColor"})}),zx=Y(z).attrs({direction:"column"})` +`;const zx=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M7.28729 0.918723C7.41428 0.105284 8.58572 0.105284 8.71271 0.918723L8.76054 1.22508C9.2444 4.32436 11.6757 6.75568 14.775 7.23954L15.0814 7.28737C15.8948 7.41436 15.8948 8.5858 15.0814 8.71279L14.775 8.76062C11.6757 9.24448 9.2444 11.6758 8.76054 14.7751L8.71271 15.0814C8.58572 15.8949 7.41428 15.8949 7.28729 15.0814L7.23946 14.7751C6.7556 11.6758 4.32428 9.24448 1.225 8.76062L0.918643 8.71279C0.105204 8.5858 0.105204 7.41436 0.918642 7.28737L1.225 7.23954C4.32428 6.75568 6.7556 4.32436 7.23946 1.22508L7.28729 0.918723Z",fill:"currentColor"})}),Bx=Y(z).attrs({direction:"column"})` padding: 24px; cursor: pointer; border-top: 1px solid #101317; @@ -345,19 +345,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho background: #353a46; border-radius: 0.5rem; } -`,Bx=Y(z)` +`,Fx=Y(z)` gap: 1.1875rem; margin-top: 1rem; -`,Fx=Y.span` +`,Hx=Y.span` display: inline-flex; align-items: center; justify-content: center; color: white; margin-right: 0.5rem; -`,Hx=Y(Fe)` +`,Yx=Y(Fe)` font-weight: 600; font-size: 0.9375rem; -`,Wr=8,Ui=332,Yx=()=>u.jsx(u.Fragment,{children:u.jsx(zx,{children:u.jsxs(z,{direction:"column",children:[u.jsxs(z,{direction:"row",children:[u.jsx(Fx,{children:u.jsx($x,{})}),u.jsx(Hx,{children:"Answer"})]}),u.jsxs(Bx,{grow:1,shrink:1,children:[u.jsx(Ur,{height:Wr,variant:"rectangular",width:Ui}),u.jsx(Ur,{height:Wr,variant:"rectangular",width:Ui}),u.jsx(Ur,{height:Wr,variant:"rectangular",width:Ui}),u.jsx(Ur,{height:Wr,variant:"rectangular",width:Ui}),u.jsx(Ur,{height:Wr,variant:"rectangular",width:180})]})]})})}),Vx=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"stacks",children:[u.jsx("mask",{id:"mask0_8417_33308",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_8417_33308)",children:u.jsx("path",{id:"stacks_2",d:"M11.9998 13.1877C11.8717 13.1877 11.7477 13.1701 11.6278 13.135C11.5078 13.0996 11.3857 13.0531 11.2613 12.9955L3.38833 8.91472C3.2435 8.82755 3.13675 8.7218 3.06808 8.59747C2.99958 8.47297 2.96533 8.3383 2.96533 8.19347C2.96533 8.04864 2.99958 7.91405 3.06808 7.78972C3.13675 7.66539 3.2435 7.55964 3.38833 7.47247L11.2613 3.39172C11.3857 3.33389 11.5078 3.28739 11.6278 3.25222C11.7477 3.21689 11.8717 3.19922 11.9998 3.19922C12.128 3.19922 12.252 3.21689 12.3718 3.25222C12.4918 3.28739 12.614 3.33389 12.7383 3.39172L20.6306 7.47247C20.7754 7.55964 20.8822 7.66539 20.9508 7.78972C21.0193 7.91405 21.0536 8.04864 21.0536 8.19347C21.0536 8.3383 21.0193 8.47297 20.9508 8.59747C20.8822 8.7218 20.7754 8.82755 20.6306 8.91472L12.7383 12.9955C12.614 13.0531 12.4918 13.0996 12.3718 13.135C12.252 13.1701 12.128 13.1877 11.9998 13.1877ZM11.9998 12.2455L19.9211 8.19347L11.9998 4.14172L4.09783 8.19347L11.9998 12.2455ZM11.9998 16.0532L20.1576 11.855C20.2038 11.8255 20.3172 11.8223 20.4978 11.8455C20.6145 11.8711 20.7046 11.9253 20.7681 12.008C20.8316 12.0906 20.8633 12.1903 20.8633 12.307C20.8633 12.4006 20.8441 12.484 20.8056 12.557C20.7671 12.6301 20.7011 12.6911 20.6076 12.7397L12.7383 16.8032C12.614 16.8609 12.4918 16.9073 12.3718 16.9425C12.252 16.9778 12.128 16.9955 11.9998 16.9955C11.8717 16.9955 11.7477 16.9778 11.6278 16.9425C11.5078 16.9073 11.3857 16.8609 11.2613 16.8032L3.41133 12.7397C3.31783 12.6911 3.24858 12.6301 3.20358 12.557C3.15875 12.484 3.13633 12.4006 3.13633 12.307C3.13633 12.1903 3.17125 12.0906 3.24108 12.008C3.31108 11.9253 3.40442 11.8711 3.52108 11.8455C3.57875 11.8198 3.63542 11.8066 3.69108 11.806C3.74692 11.8053 3.80367 11.8216 3.86133 11.855L11.9998 16.0532ZM11.9998 19.8607L20.1576 15.6627C20.2038 15.6332 20.3172 15.6301 20.4978 15.6532C20.6145 15.6789 20.7046 15.7331 20.7681 15.8157C20.8316 15.8984 20.8633 15.9981 20.8633 16.1147C20.8633 16.2082 20.8441 16.2916 20.8056 16.3647C20.7671 16.4377 20.7011 16.4986 20.6076 16.5475L12.7383 20.6107C12.614 20.6686 12.4918 20.7151 12.3718 20.7502C12.252 20.7856 12.128 20.8032 11.9998 20.8032C11.8717 20.8032 11.7477 20.7856 11.6278 20.7502C11.5078 20.7151 11.3857 20.6686 11.2613 20.6107L3.41133 16.5475C3.31783 16.4986 3.24858 16.4377 3.20358 16.3647C3.15875 16.2916 3.13633 16.2082 3.13633 16.1147C3.13633 15.9981 3.17125 15.8984 3.24108 15.8157C3.31108 15.7331 3.40442 15.6789 3.52108 15.6532C3.57875 15.6276 3.63542 15.6144 3.69108 15.6137C3.74692 15.6131 3.80367 15.6294 3.86133 15.6627L11.9998 19.8607Z",fill:"currentColor"})})]})}),Ux=({questions:e})=>{const{fetchData:t,setAbortRequests:n}=zt(o=>o),[r]=So(o=>[o.setBudget]),i=o=>{o&&t(r,n,o)};return e!=null&&e.length?u.jsxs(qx,{children:[u.jsxs(Gx,{className:"heading",direction:"row",children:[u.jsx("div",{className:"heading__icon",children:u.jsx(Vx,{})}),u.jsx("span",{children:"More on this"})]}),u.jsx(z,{children:e.map(o=>u.jsxs(Zx,{align:"center",direction:"row",justify:"space-between",children:[u.jsx("span",{children:o}),u.jsx(z,{className:"icon",onClick:()=>i(o),children:u.jsx(ya,{})})]},o))})]}):null},Wx=j.memo(Ux),Gx=Y(z)` +`,Wr=8,Ui=332,Vx=()=>u.jsx(u.Fragment,{children:u.jsx(Bx,{children:u.jsxs(z,{direction:"column",children:[u.jsxs(z,{direction:"row",children:[u.jsx(Hx,{children:u.jsx(zx,{})}),u.jsx(Yx,{children:"Answer"})]}),u.jsxs(Fx,{grow:1,shrink:1,children:[u.jsx(Ur,{height:Wr,variant:"rectangular",width:Ui}),u.jsx(Ur,{height:Wr,variant:"rectangular",width:Ui}),u.jsx(Ur,{height:Wr,variant:"rectangular",width:Ui}),u.jsx(Ur,{height:Wr,variant:"rectangular",width:Ui}),u.jsx(Ur,{height:Wr,variant:"rectangular",width:180})]})]})})}),Ux=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"stacks",children:[u.jsx("mask",{id:"mask0_8417_33308",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_8417_33308)",children:u.jsx("path",{id:"stacks_2",d:"M11.9998 13.1877C11.8717 13.1877 11.7477 13.1701 11.6278 13.135C11.5078 13.0996 11.3857 13.0531 11.2613 12.9955L3.38833 8.91472C3.2435 8.82755 3.13675 8.7218 3.06808 8.59747C2.99958 8.47297 2.96533 8.3383 2.96533 8.19347C2.96533 8.04864 2.99958 7.91405 3.06808 7.78972C3.13675 7.66539 3.2435 7.55964 3.38833 7.47247L11.2613 3.39172C11.3857 3.33389 11.5078 3.28739 11.6278 3.25222C11.7477 3.21689 11.8717 3.19922 11.9998 3.19922C12.128 3.19922 12.252 3.21689 12.3718 3.25222C12.4918 3.28739 12.614 3.33389 12.7383 3.39172L20.6306 7.47247C20.7754 7.55964 20.8822 7.66539 20.9508 7.78972C21.0193 7.91405 21.0536 8.04864 21.0536 8.19347C21.0536 8.3383 21.0193 8.47297 20.9508 8.59747C20.8822 8.7218 20.7754 8.82755 20.6306 8.91472L12.7383 12.9955C12.614 13.0531 12.4918 13.0996 12.3718 13.135C12.252 13.1701 12.128 13.1877 11.9998 13.1877ZM11.9998 12.2455L19.9211 8.19347L11.9998 4.14172L4.09783 8.19347L11.9998 12.2455ZM11.9998 16.0532L20.1576 11.855C20.2038 11.8255 20.3172 11.8223 20.4978 11.8455C20.6145 11.8711 20.7046 11.9253 20.7681 12.008C20.8316 12.0906 20.8633 12.1903 20.8633 12.307C20.8633 12.4006 20.8441 12.484 20.8056 12.557C20.7671 12.6301 20.7011 12.6911 20.6076 12.7397L12.7383 16.8032C12.614 16.8609 12.4918 16.9073 12.3718 16.9425C12.252 16.9778 12.128 16.9955 11.9998 16.9955C11.8717 16.9955 11.7477 16.9778 11.6278 16.9425C11.5078 16.9073 11.3857 16.8609 11.2613 16.8032L3.41133 12.7397C3.31783 12.6911 3.24858 12.6301 3.20358 12.557C3.15875 12.484 3.13633 12.4006 3.13633 12.307C3.13633 12.1903 3.17125 12.0906 3.24108 12.008C3.31108 11.9253 3.40442 11.8711 3.52108 11.8455C3.57875 11.8198 3.63542 11.8066 3.69108 11.806C3.74692 11.8053 3.80367 11.8216 3.86133 11.855L11.9998 16.0532ZM11.9998 19.8607L20.1576 15.6627C20.2038 15.6332 20.3172 15.6301 20.4978 15.6532C20.6145 15.6789 20.7046 15.7331 20.7681 15.8157C20.8316 15.8984 20.8633 15.9981 20.8633 16.1147C20.8633 16.2082 20.8441 16.2916 20.8056 16.3647C20.7671 16.4377 20.7011 16.4986 20.6076 16.5475L12.7383 20.6107C12.614 20.6686 12.4918 20.7151 12.3718 20.7502C12.252 20.7856 12.128 20.8032 11.9998 20.8032C11.8717 20.8032 11.7477 20.7856 11.6278 20.7502C11.5078 20.7151 11.3857 20.6686 11.2613 20.6107L3.41133 16.5475C3.31783 16.4986 3.24858 16.4377 3.20358 16.3647C3.15875 16.2916 3.13633 16.2082 3.13633 16.1147C3.13633 15.9981 3.17125 15.8984 3.24108 15.8157C3.31108 15.7331 3.40442 15.6789 3.52108 15.6532C3.57875 15.6276 3.63542 15.6144 3.69108 15.6137C3.74692 15.6131 3.80367 15.6294 3.86133 15.6627L11.9998 19.8607Z",fill:"currentColor"})})]})}),Wx=({questions:e})=>{const{fetchData:t,setAbortRequests:n}=zt(o=>o),[r]=So(o=>[o.setBudget]),i=o=>{o&&t(r,n,o)};return e!=null&&e.length?u.jsxs(Xx,{children:[u.jsxs(Zx,{className:"heading",direction:"row",children:[u.jsx("div",{className:"heading__icon",children:u.jsx(Ux,{})}),u.jsx("span",{children:"More on this"})]}),u.jsx(z,{children:e.map(o=>u.jsxs(qx,{align:"center",direction:"row",justify:"space-between",children:[u.jsx("span",{children:o}),u.jsx(z,{className:"icon",onClick:()=>i(o),children:u.jsx(ya,{})})]},o))})]}):null},Gx=j.memo(Wx),Zx=Y(z)` &.heading { font-weight: 600; color: ${N.white}; @@ -374,7 +374,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho margin-left: 16px; } } -`,Zx=Y(z)` +`,qx=Y(z)` color: ${N.GRAY3}; padding: 12px 0; border-bottom: 1px solid ${N.black}; @@ -383,10 +383,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho color: ${N.GRAY7}; cursor: pointer; } -`,qx=Y(z)` +`,Xx=Y(z)` padding: 24px; border-top: 1px solid ${N.black}; -`,xd=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 9 9",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{id:"Icon","fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.97172 5.26825L8.23268 0.525927C8.24606 0.301673 8.05202 0.110397 7.81782 0.116993L3.00677 0.374226C2.66551 0.394014 2.51161 0.796353 2.7525 1.0338L7.30259 5.51889C7.54348 5.75633 7.95165 5.60463 7.97172 5.26825ZM5.56945 5.5915L2.67881 2.74215L1.79555 3.61278L4.6862 6.46213L5.56945 5.5915ZM1.14615 6.44238L0.0353953 5.34749L0.918648 4.47686L3.80929 7.32621L2.92604 8.19685L1.81528 7.10196L0.918648 7.98578C0.731292 8.17046 0.436874 8.17046 0.249518 7.98578C0.0621611 7.8011 0.0621611 7.51089 0.249517 7.32621L1.14615 6.44238Z",fill:"currentColor"})}),Sa=({amt:e})=>u.jsxs(Xx,{align:"center",direction:"row",justify:"flex-start",children:[u.jsx("div",{className:"icon",children:u.jsx(xd,{})}),u.jsx("div",{className:"value","data-testid":"boost-amt",children:e}),u.jsx("div",{className:"text",children:"sat"})]}),Xx=Y(z)` +`,xd=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 9 9",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{id:"Icon","fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.97172 5.26825L8.23268 0.525927C8.24606 0.301673 8.05202 0.110397 7.81782 0.116993L3.00677 0.374226C2.66551 0.394014 2.51161 0.796353 2.7525 1.0338L7.30259 5.51889C7.54348 5.75633 7.95165 5.60463 7.97172 5.26825ZM5.56945 5.5915L2.67881 2.74215L1.79555 3.61278L4.6862 6.46213L5.56945 5.5915ZM1.14615 6.44238L0.0353953 5.34749L0.918648 4.47686L3.80929 7.32621L2.92604 8.19685L1.81528 7.10196L0.918648 7.98578C0.731292 8.17046 0.436874 8.17046 0.249518 7.98578C0.0621611 7.8011 0.0621611 7.51089 0.249517 7.32621L1.14615 6.44238Z",fill:"currentColor"})}),Sa=({amt:e})=>u.jsxs(Kx,{align:"center",direction:"row",justify:"flex-start",children:[u.jsx("div",{className:"icon",children:u.jsx(xd,{})}),u.jsx("div",{className:"value","data-testid":"boost-amt",children:e}),u.jsx("div",{className:"text",children:"sat"})]}),Kx=Y(z)` font-size: 13px; font-style: normal; font-weight: 500; @@ -407,13 +407,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho margin: 0 4px 0 8px; color: ${N.white}; } -`,Kx=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M4.24488 9.94873L3.51732 12.8382C3.48633 12.976 3.4201 13.0844 3.31861 13.1635C3.21711 13.2425 3.09318 13.2821 2.94682 13.2821C2.75237 13.2821 2.59319 13.2046 2.46928 13.0497C2.34535 12.8948 2.31009 12.7244 2.36351 12.5385L3.01094 9.94873H0.635943C0.427609 9.94873 0.260144 9.86913 0.133547 9.70995C0.00694957 9.55077 -0.0296407 9.37129 0.023776 9.1715C0.0600955 9.02514 0.134609 8.90975 0.247318 8.82535C0.360026 8.74096 0.489568 8.69877 0.635943 8.69877H3.32344L4.1728 5.30131H1.7978C1.58946 5.30131 1.422 5.22172 1.2954 5.06254C1.1688 4.90336 1.13221 4.72388 1.18563 4.5241C1.22195 4.37773 1.29646 4.26234 1.40917 4.17795C1.52188 4.09355 1.65142 4.05135 1.7978 4.05135H4.4853L5.21286 1.16191C5.24383 1.02409 5.31007 0.915657 5.41157 0.836601C5.51305 0.757546 5.63698 0.718018 5.78336 0.718018C5.97779 0.718018 6.13697 0.795469 6.2609 0.950372C6.38483 1.10529 6.42009 1.27569 6.36667 1.46158L5.71923 4.05135H9.16476L9.89232 1.16191C9.9233 1.02409 9.98954 0.915657 10.091 0.836601C10.1925 0.757546 10.3165 0.718018 10.4628 0.718018C10.6573 0.718018 10.8164 0.795469 10.9404 0.950372C11.0643 1.10529 11.0995 1.27569 11.0461 1.46158L10.3987 4.05135H12.7737C12.982 4.05135 13.1495 4.13094 13.2761 4.29012C13.4027 4.4493 13.4393 4.62879 13.3859 4.82858C13.3495 4.97494 13.275 5.09032 13.1623 5.17473C13.0496 5.25911 12.9201 5.30131 12.7737 5.30131H10.0862L9.23684 8.69877H11.6118C11.8202 8.69877 11.9876 8.77836 12.1142 8.93754C12.2408 9.09672 12.2774 9.2762 12.224 9.47598C12.1877 9.62235 12.1132 9.73773 12.0005 9.82212C11.8878 9.90652 11.7582 9.94873 11.6118 9.94873H8.92434L8.19678 12.8382C8.1658 12.976 8.09957 13.0844 7.99807 13.1635C7.89658 13.2425 7.77265 13.2821 7.62628 13.2821C7.43185 13.2821 7.27267 13.2046 7.14874 13.0497C7.0248 12.8948 6.98955 12.7244 7.04296 12.5385L7.6904 9.94873H4.24488ZM4.55738 8.69877H8.0029L8.85226 5.30131H5.40673L4.55738 8.69877Z",fill:"currentColor"})}),Rn=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("g",{id:"Icons 20x20",children:u.jsx("path",{id:"Union","fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.5661 2.056C17.7371 2.12703 17.873 2.26296 17.9441 2.434C17.9799 2.51816 17.999 2.60853 18.0001 2.7V6.9C18.0001 7.08565 17.9263 7.2637 17.795 7.39497C17.6638 7.52625 17.4857 7.6 17.3001 7.6C17.1144 7.6 16.9364 7.52625 16.8051 7.39497C16.6738 7.2637 16.6001 7.08565 16.6001 6.9V4.387L10.0971 10.897C10.032 10.9626 9.95456 11.0147 9.86926 11.0502C9.78396 11.0858 9.69246 11.1041 9.60006 11.1041C9.50765 11.1041 9.41615 11.0858 9.33085 11.0502C9.24555 11.0147 9.16813 10.9626 9.10306 10.897C9.03745 10.8319 8.98537 10.7545 8.94983 10.6692C8.91429 10.5839 8.896 10.4924 8.896 10.4C8.896 10.3076 8.91429 10.2161 8.94983 10.1308C8.98537 10.0455 9.03745 9.96807 9.10306 9.903L15.6131 3.4H13.1001C12.9144 3.4 12.7364 3.32625 12.6051 3.19497C12.4738 3.0637 12.4001 2.88565 12.4001 2.7C12.4001 2.51435 12.4738 2.3363 12.6051 2.20503C12.7364 2.07375 12.9144 2 13.1001 2H17.3001C17.3915 2.00111 17.4819 2.02013 17.5661 2.056ZM14.705 9.20463C14.8363 9.07336 15.0143 8.99961 15.2 8.99961C15.3857 8.99961 15.5637 9.07336 15.695 9.20463C15.8263 9.33591 15.9 9.51396 15.9 9.69961V13.8996C15.9 14.4566 15.6788 14.9907 15.2849 15.3845C14.8911 15.7784 14.357 15.9996 13.8 15.9996H6.1C5.54305 15.9996 5.0089 15.7784 4.61508 15.3845C4.22125 14.9907 4 14.4566 4 13.8996V6.19961C4 5.64265 4.22125 5.10851 4.61508 4.71469C5.0089 4.32086 5.54305 4.09961 6.1 4.09961H10.3C10.4857 4.09961 10.6637 4.17336 10.795 4.30463C10.9263 4.43591 11 4.61396 11 4.79961C11 4.98526 10.9263 5.16331 10.795 5.29458C10.6637 5.42586 10.4857 5.49961 10.3 5.49961H6.1C5.91435 5.49961 5.7363 5.57336 5.60503 5.70463C5.47375 5.83591 5.4 6.01396 5.4 6.19961V13.8996C5.4 14.0853 5.47375 14.2633 5.60503 14.3946C5.7363 14.5259 5.91435 14.5996 6.1 14.5996H13.8C13.9857 14.5996 14.1637 14.5259 14.295 14.3946C14.4263 14.2633 14.5 14.0853 14.5 13.8996V9.69961C14.5 9.51396 14.5737 9.33591 14.705 9.20463Z",fill:"currentColor"})})});function gn(e,t){const n=t!=null?String(t).trim():"";if(!n)return e;const r=new RegExp(`(${n})`,"gi"),i=e.split(r);return u.jsx(u.Fragment,{children:i.map((o,a)=>r.test(o)?u.jsx(Qx,{children:o},a):o)})}const Qx=Y.span` +`,Qx=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M4.24488 9.94873L3.51732 12.8382C3.48633 12.976 3.4201 13.0844 3.31861 13.1635C3.21711 13.2425 3.09318 13.2821 2.94682 13.2821C2.75237 13.2821 2.59319 13.2046 2.46928 13.0497C2.34535 12.8948 2.31009 12.7244 2.36351 12.5385L3.01094 9.94873H0.635943C0.427609 9.94873 0.260144 9.86913 0.133547 9.70995C0.00694957 9.55077 -0.0296407 9.37129 0.023776 9.1715C0.0600955 9.02514 0.134609 8.90975 0.247318 8.82535C0.360026 8.74096 0.489568 8.69877 0.635943 8.69877H3.32344L4.1728 5.30131H1.7978C1.58946 5.30131 1.422 5.22172 1.2954 5.06254C1.1688 4.90336 1.13221 4.72388 1.18563 4.5241C1.22195 4.37773 1.29646 4.26234 1.40917 4.17795C1.52188 4.09355 1.65142 4.05135 1.7978 4.05135H4.4853L5.21286 1.16191C5.24383 1.02409 5.31007 0.915657 5.41157 0.836601C5.51305 0.757546 5.63698 0.718018 5.78336 0.718018C5.97779 0.718018 6.13697 0.795469 6.2609 0.950372C6.38483 1.10529 6.42009 1.27569 6.36667 1.46158L5.71923 4.05135H9.16476L9.89232 1.16191C9.9233 1.02409 9.98954 0.915657 10.091 0.836601C10.1925 0.757546 10.3165 0.718018 10.4628 0.718018C10.6573 0.718018 10.8164 0.795469 10.9404 0.950372C11.0643 1.10529 11.0995 1.27569 11.0461 1.46158L10.3987 4.05135H12.7737C12.982 4.05135 13.1495 4.13094 13.2761 4.29012C13.4027 4.4493 13.4393 4.62879 13.3859 4.82858C13.3495 4.97494 13.275 5.09032 13.1623 5.17473C13.0496 5.25911 12.9201 5.30131 12.7737 5.30131H10.0862L9.23684 8.69877H11.6118C11.8202 8.69877 11.9876 8.77836 12.1142 8.93754C12.2408 9.09672 12.2774 9.2762 12.224 9.47598C12.1877 9.62235 12.1132 9.73773 12.0005 9.82212C11.8878 9.90652 11.7582 9.94873 11.6118 9.94873H8.92434L8.19678 12.8382C8.1658 12.976 8.09957 13.0844 7.99807 13.1635C7.89658 13.2425 7.77265 13.2821 7.62628 13.2821C7.43185 13.2821 7.27267 13.2046 7.14874 13.0497C7.0248 12.8948 6.98955 12.7244 7.04296 12.5385L7.6904 9.94873H4.24488ZM4.55738 8.69877H8.0029L8.85226 5.30131H5.40673L4.55738 8.69877Z",fill:"currentColor"})}),Rn=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("g",{id:"Icons 20x20",children:u.jsx("path",{id:"Union","fill-rule":"evenodd","clip-rule":"evenodd",d:"M17.5661 2.056C17.7371 2.12703 17.873 2.26296 17.9441 2.434C17.9799 2.51816 17.999 2.60853 18.0001 2.7V6.9C18.0001 7.08565 17.9263 7.2637 17.795 7.39497C17.6638 7.52625 17.4857 7.6 17.3001 7.6C17.1144 7.6 16.9364 7.52625 16.8051 7.39497C16.6738 7.2637 16.6001 7.08565 16.6001 6.9V4.387L10.0971 10.897C10.032 10.9626 9.95456 11.0147 9.86926 11.0502C9.78396 11.0858 9.69246 11.1041 9.60006 11.1041C9.50765 11.1041 9.41615 11.0858 9.33085 11.0502C9.24555 11.0147 9.16813 10.9626 9.10306 10.897C9.03745 10.8319 8.98537 10.7545 8.94983 10.6692C8.91429 10.5839 8.896 10.4924 8.896 10.4C8.896 10.3076 8.91429 10.2161 8.94983 10.1308C8.98537 10.0455 9.03745 9.96807 9.10306 9.903L15.6131 3.4H13.1001C12.9144 3.4 12.7364 3.32625 12.6051 3.19497C12.4738 3.0637 12.4001 2.88565 12.4001 2.7C12.4001 2.51435 12.4738 2.3363 12.6051 2.20503C12.7364 2.07375 12.9144 2 13.1001 2H17.3001C17.3915 2.00111 17.4819 2.02013 17.5661 2.056ZM14.705 9.20463C14.8363 9.07336 15.0143 8.99961 15.2 8.99961C15.3857 8.99961 15.5637 9.07336 15.695 9.20463C15.8263 9.33591 15.9 9.51396 15.9 9.69961V13.8996C15.9 14.4566 15.6788 14.9907 15.2849 15.3845C14.8911 15.7784 14.357 15.9996 13.8 15.9996H6.1C5.54305 15.9996 5.0089 15.7784 4.61508 15.3845C4.22125 14.9907 4 14.4566 4 13.8996V6.19961C4 5.64265 4.22125 5.10851 4.61508 4.71469C5.0089 4.32086 5.54305 4.09961 6.1 4.09961H10.3C10.4857 4.09961 10.6637 4.17336 10.795 4.30463C10.9263 4.43591 11 4.61396 11 4.79961C11 4.98526 10.9263 5.16331 10.795 5.29458C10.6637 5.42586 10.4857 5.49961 10.3 5.49961H6.1C5.91435 5.49961 5.7363 5.57336 5.60503 5.70463C5.47375 5.83591 5.4 6.01396 5.4 6.19961V13.8996C5.4 14.0853 5.47375 14.2633 5.60503 14.3946C5.7363 14.5259 5.91435 14.5996 6.1 14.5996H13.8C13.9857 14.5996 14.1637 14.5259 14.295 14.3946C14.4263 14.2633 14.5 14.0853 14.5 13.8996V9.69961C14.5 9.51396 14.5737 9.33591 14.705 9.20463Z",fill:"currentColor"})})});function gn(e,t){const n=t!=null?String(t).trim():"";if(!n)return e;const r=new RegExp(`(${n})`,"gi"),i=e.split(r);return u.jsx(u.Fragment,{children:i.map((o,a)=>r.test(o)?u.jsx(Jx,{children:o},a):o)})}const Jx=Y.span` background-color: rgba(0, 123, 255, 0.4); padding: 2; margin: 0; border-radius: 3px; color: inherit; -`,Jx=({imageUrl:e,name:t,sourceLink:n,date:r})=>u.jsxs(z,{grow:1,shrink:1,children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsxs(z,{align:"center",direction:"row",children:[e&&u.jsx(e2,{children:u.jsx(Gt,{rounded:!0,size:64,src:e||"",type:"image"})}),t&&u.jsx(t2,{children:t})]}),n&&u.jsx(Qn,{href:`${n}${n!=null&&n.includes("?")?"&":"?"}open=system`,onClick:i=>i.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),u.jsx(z,{align:"center",direction:"row",justify:"flex-start",ml:6,mt:9,children:!!r&&u.jsx($n,{children:si.unix(r).fromNow()})})]}),e2=Y(z)` +`,e2=({imageUrl:e,name:t,sourceLink:n,date:r})=>u.jsxs(z,{grow:1,shrink:1,children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsxs(z,{align:"center",direction:"row",children:[e&&u.jsx(t2,{children:u.jsx(Gt,{rounded:!0,size:64,src:e||"",type:"image"})}),t&&u.jsx(n2,{children:t})]}),n&&u.jsx(Qn,{href:`${n}${n!=null&&n.includes("?")?"&":"?"}open=system`,onClick:i=>i.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),u.jsx(z,{align:"center",direction:"row",justify:"flex-start",ml:6,mt:9,children:!!r&&u.jsx($n,{children:si.unix(r).fromNow()})})]}),t2=Y(z)` img { width: 64px; height: 64px; @@ -421,18 +421,18 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho object-fit: cover; } margin-right: 16px; -`,t2=Y(z)` +`,n2=Y(z)` color: ${N.white}; font-family: Barlow; font-size: 13px; font-style: normal; font-weight: 600; line-height: 17px; -`,wd=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M7.00261 14C6.03462 14 5.12456 13.8163 4.27241 13.449C3.42026 13.0816 2.67901 12.583 2.04865 11.9533C1.4183 11.3235 0.919269 10.5829 0.551561 9.73159C0.183854 8.88024 0 7.97058 0 7.00261C0 6.03462 0.183679 5.12456 0.551036 4.27241C0.918407 3.42026 1.41698 2.67901 2.04674 2.04865C2.67651 1.4183 3.41706 0.919269 4.26841 0.551562C5.11976 0.183854 6.02942 0 6.99739 0C7.96538 0 8.87544 0.183679 9.72759 0.551036C10.5797 0.918406 11.321 1.41697 11.9514 2.04674C12.5817 2.67651 13.0807 3.41706 13.4484 4.26841C13.8161 5.11976 14 6.02942 14 6.99739C14 7.96538 13.8163 8.87544 13.449 9.72759C13.0816 10.5797 12.583 11.321 11.9533 11.9514C11.3235 12.5817 10.5829 13.0807 9.73159 13.4484C8.88024 13.8161 7.97058 14 7.00261 14ZM6.22222 13.1833V11.6667C5.79444 11.6667 5.42824 11.5144 5.12361 11.2097C4.81898 10.9051 4.66667 10.5389 4.66667 10.1111V9.33333L0.933333 5.6C0.894445 5.83333 0.858796 6.06667 0.826389 6.3C0.793981 6.53333 0.777778 6.76667 0.777778 7C0.777778 8.56852 1.29306 9.94259 2.32361 11.1222C3.35417 12.3019 4.6537 12.9889 6.22222 13.1833ZM11.5889 11.2C11.8481 10.9148 12.0815 10.6069 12.2889 10.2764C12.4963 9.94583 12.6681 9.60231 12.8042 9.24583C12.9403 8.88935 13.044 8.52315 13.1153 8.14722C13.1866 7.7713 13.2222 7.38889 13.2222 7C13.2222 5.72211 12.8715 4.55506 12.17 3.49885C11.4685 2.44264 10.5229 1.68121 9.33333 1.21454V1.55556C9.33333 1.98333 9.18102 2.34954 8.87639 2.65417C8.57176 2.9588 8.20556 3.11111 7.77778 3.11111H6.22222V4.66667C6.22222 4.88704 6.14769 5.07176 5.99861 5.22083C5.84954 5.36991 5.66481 5.44444 5.44444 5.44444H3.88889V7H8.55556C8.77593 7 8.96065 7.07454 9.10972 7.22361C9.2588 7.37269 9.33333 7.55741 9.33333 7.77778V10.1111H10.1111C10.4481 10.1111 10.7528 10.2116 11.025 10.4125C11.2972 10.6134 11.4852 10.8759 11.5889 11.2Z",fill:"currentColor"})});var bd={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(mt,function(){var n;function r(){return n.apply(null,arguments)}function i(s){n=s}function o(s){return s instanceof Array||Object.prototype.toString.call(s)==="[object Array]"}function a(s){return s!=null&&Object.prototype.toString.call(s)==="[object Object]"}function l(s,c){return Object.prototype.hasOwnProperty.call(s,c)}function d(s){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(s).length===0;var c;for(c in s)if(l(s,c))return!1;return!0}function f(s){return s===void 0}function h(s){return typeof s=="number"||Object.prototype.toString.call(s)==="[object Number]"}function p(s){return s instanceof Date||Object.prototype.toString.call(s)==="[object Date]"}function y(s,c){var m=[],x,b=s.length;for(x=0;x>>0,x;for(x=0;x0)for(m=0;mu.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M7.00261 14C6.03462 14 5.12456 13.8163 4.27241 13.449C3.42026 13.0816 2.67901 12.583 2.04865 11.9533C1.4183 11.3235 0.919269 10.5829 0.551561 9.73159C0.183854 8.88024 0 7.97058 0 7.00261C0 6.03462 0.183679 5.12456 0.551036 4.27241C0.918407 3.42026 1.41698 2.67901 2.04674 2.04865C2.67651 1.4183 3.41706 0.919269 4.26841 0.551562C5.11976 0.183854 6.02942 0 6.99739 0C7.96538 0 8.87544 0.183679 9.72759 0.551036C10.5797 0.918406 11.321 1.41697 11.9514 2.04674C12.5817 2.67651 13.0807 3.41706 13.4484 4.26841C13.8161 5.11976 14 6.02942 14 6.99739C14 7.96538 13.8163 8.87544 13.449 9.72759C13.0816 10.5797 12.583 11.321 11.9533 11.9514C11.3235 12.5817 10.5829 13.0807 9.73159 13.4484C8.88024 13.8161 7.97058 14 7.00261 14ZM6.22222 13.1833V11.6667C5.79444 11.6667 5.42824 11.5144 5.12361 11.2097C4.81898 10.9051 4.66667 10.5389 4.66667 10.1111V9.33333L0.933333 5.6C0.894445 5.83333 0.858796 6.06667 0.826389 6.3C0.793981 6.53333 0.777778 6.76667 0.777778 7C0.777778 8.56852 1.29306 9.94259 2.32361 11.1222C3.35417 12.3019 4.6537 12.9889 6.22222 13.1833ZM11.5889 11.2C11.8481 10.9148 12.0815 10.6069 12.2889 10.2764C12.4963 9.94583 12.6681 9.60231 12.8042 9.24583C12.9403 8.88935 13.044 8.52315 13.1153 8.14722C13.1866 7.7713 13.2222 7.38889 13.2222 7C13.2222 5.72211 12.8715 4.55506 12.17 3.49885C11.4685 2.44264 10.5229 1.68121 9.33333 1.21454V1.55556C9.33333 1.98333 9.18102 2.34954 8.87639 2.65417C8.57176 2.9588 8.20556 3.11111 7.77778 3.11111H6.22222V4.66667C6.22222 4.88704 6.14769 5.07176 5.99861 5.22083C5.84954 5.36991 5.66481 5.44444 5.44444 5.44444H3.88889V7H8.55556C8.77593 7 8.96065 7.07454 9.10972 7.22361C9.2588 7.37269 9.33333 7.55741 9.33333 7.77778V10.1111H10.1111C10.4481 10.1111 10.7528 10.2116 11.025 10.4125C11.2972 10.6134 11.4852 10.8759 11.5889 11.2Z",fill:"currentColor"})});var bd={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(mt,function(){var n;function r(){return n.apply(null,arguments)}function i(s){n=s}function o(s){return s instanceof Array||Object.prototype.toString.call(s)==="[object Array]"}function a(s){return s!=null&&Object.prototype.toString.call(s)==="[object Object]"}function l(s,c){return Object.prototype.hasOwnProperty.call(s,c)}function d(s){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(s).length===0;var c;for(c in s)if(l(s,c))return!1;return!0}function f(s){return s===void 0}function h(s){return typeof s=="number"||Object.prototype.toString.call(s)==="[object Number]"}function p(s){return s instanceof Date||Object.prototype.toString.call(s)==="[object Date]"}function y(s,c){var m=[],x,b=s.length;for(x=0;x>>0,x;for(x=0;x0)for(m=0;m=0;return(I?m?"+":"":"-")+Math.pow(10,Math.max(0,b)).toString().substr(1)+x}var Q=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},ae={};function J(s,c,m,x){var b=x;typeof x=="string"&&(b=function(){return this[x]()}),s&&(ae[s]=b),c&&(ae[c[0]]=function(){return v(b.apply(this,arguments),c[1],c[2])}),m&&(ae[m]=function(){return this.localeData().ordinal(b.apply(this,arguments),s)})}function le(s){return s.match(/\[[\s\S]/)?s.replace(/^\[|\]$/g,""):s.replace(/\\/g,"")}function pe(s){var c=s.match(Q),m,x;for(m=0,x=c.length;m=0&&ne.test(s);)s=s.replace(ne,x),ne.lastIndex=0,m-=1;return s}var ke={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Be(s){var c=this._longDateFormat[s],m=this._longDateFormat[s.toUpperCase()];return c||!m?c:(this._longDateFormat[s]=m.match(Q).map(function(x){return x==="MMMM"||x==="MM"||x==="DD"||x==="dddd"?x.slice(1):x}).join(""),this._longDateFormat[s])}var Je="Invalid date";function He(){return this._invalidDate}var we="%d",ge=/\d{1,2}/;function Ye(s){return this._ordinal.replace("%d",s)}var Ze={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ue(s,c,m,x){var b=this._relativeTime[m];return B(b)?b(s,c,m,x):b.replace(/%d/i,s)}function dt(s,c){var m=this._relativeTime[s>0?"future":"past"];return B(m)?m(c):m.replace(/%s/i,c)}var Ne={};function Le(s,c){var m=s.toLowerCase();Ne[m]=Ne[m+"s"]=Ne[c]=s}function Xe(s){return typeof s=="string"?Ne[s]||Ne[s.toLowerCase()]:void 0}function ft(s){var c={},m,x;for(x in s)l(s,x)&&(m=Xe(x),m&&(c[m]=s[x]));return c}var ht={};function D(s,c){ht[s]=c}function Z(s){var c=[],m;for(m in s)l(s,m)&&c.push({unit:m,priority:ht[m]});return c.sort(function(x,b){return x.priority-b.priority}),c}function te(s){return s%4===0&&s%100!==0||s%400===0}function se(s){return s<0?Math.ceil(s)||0:Math.floor(s)}function re(s){var c=+s,m=0;return c!==0&&isFinite(c)&&(m=se(c)),m}function ye(s,c){return function(m){return m!=null?(_e(this,s,m),r.updateOffset(this,c),this):fe(this,s)}}function fe(s,c){return s.isValid()?s._d["get"+(s._isUTC?"UTC":"")+c]():NaN}function _e(s,c,m){s.isValid()&&!isNaN(m)&&(c==="FullYear"&&te(s.year())&&s.month()===1&&s.date()===29?(m=re(m),s._d["set"+(s._isUTC?"UTC":"")+c](m,s.month(),Yn(m,s.month()))):s._d["set"+(s._isUTC?"UTC":"")+c](m))}function je(s){return s=Xe(s),B(this[s])?this[s]():this}function Ve(s,c){if(typeof s=="object"){s=ft(s);var m=Z(s),x,b=m.length;for(x=0;x68?1900:2e3)};var dl=ye("FullYear",!0);function p1(){return te(this.year())}function m1(s,c,m,x,b,I,K){var de;return s<100&&s>=0?(de=new Date(s+400,c,m,x,b,I,K),isFinite(de.getFullYear())&&de.setFullYear(s)):de=new Date(s,c,m,x,b,I,K),de}function Rr(s){var c,m;return s<100&&s>=0?(m=Array.prototype.slice.call(arguments),m[0]=s+400,c=new Date(Date.UTC.apply(null,m)),isFinite(c.getUTCFullYear())&&c.setUTCFullYear(s)):c=new Date(Date.UTC.apply(null,arguments)),c}function Ci(s,c,m){var x=7+c-m,b=(7+Rr(s,0,x).getUTCDay()-c)%7;return-b+x-1}function fl(s,c,m,x,b){var I=(7+m-x)%7,K=Ci(s,x,b),de=1+7*(c-1)+I+K,Ce,ze;return de<=0?(Ce=s-1,ze=Lr(Ce)+de):de>Lr(s)?(Ce=s+1,ze=de-Lr(s)):(Ce=s,ze=de),{year:Ce,dayOfYear:ze}}function $r(s,c,m){var x=Ci(s.year(),c,m),b=Math.floor((s.dayOfYear()-x-1)/7)+1,I,K;return b<1?(K=s.year()-1,I=b+cn(K,c,m)):b>cn(s.year(),c,m)?(I=b-cn(s.year(),c,m),K=s.year()+1):(K=s.year(),I=b),{week:I,year:K}}function cn(s,c,m){var x=Ci(s,c,m),b=Ci(s+1,c,m);return(Lr(s)-x+b)/7}J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),Le("week","w"),Le("isoWeek","W"),D("week",5),D("isoWeek",5),ce("w",De),ce("ww",De,be),ce("W",De),ce("WW",De,be),Ht(["w","ww","W","WW"],function(s,c,m,x){c[x.substr(0,1)]=re(s)});function g1(s){return $r(s,this._week.dow,this._week.doy).week}var y1={dow:0,doy:6};function x1(){return this._week.dow}function w1(){return this._week.doy}function b1(s){var c=this.localeData().week(this);return s==null?c:this.add((s-c)*7,"d")}function v1(s){var c=$r(this,1,4).week;return s==null?c:this.add((s-c)*7,"d")}J("d",0,"do","day"),J("dd",0,0,function(s){return this.localeData().weekdaysMin(this,s)}),J("ddd",0,0,function(s){return this.localeData().weekdaysShort(this,s)}),J("dddd",0,0,function(s){return this.localeData().weekdays(this,s)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),Le("day","d"),Le("weekday","e"),Le("isoWeekday","E"),D("day",11),D("weekday",11),D("isoWeekday",11),ce("d",De),ce("e",De),ce("E",De),ce("dd",function(s,c){return c.weekdaysMinRegex(s)}),ce("ddd",function(s,c){return c.weekdaysShortRegex(s)}),ce("dddd",function(s,c){return c.weekdaysRegex(s)}),Ht(["dd","ddd","dddd"],function(s,c,m,x){var b=m._locale.weekdaysParse(s,x,m._strict);b!=null?c.d=b:S(m).invalidWeekday=s}),Ht(["d","e","E"],function(s,c,m,x){c[x]=re(s)});function _1(s,c){return typeof s!="string"?s:isNaN(s)?(s=c.weekdaysParse(s),typeof s=="number"?s:null):parseInt(s,10)}function S1(s,c){return typeof s=="string"?c.weekdaysParse(s)%7||7:isNaN(s)?null:s}function Vo(s,c){return s.slice(c,7).concat(s.slice(0,c))}var k1="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),hl="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),C1="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),E1=an,P1=an,M1=an;function j1(s,c){var m=o(this._weekdays)?this._weekdays:this._weekdays[s&&s!==!0&&this._weekdays.isFormat.test(c)?"format":"standalone"];return s===!0?Vo(m,this._week.dow):s?m[s.day()]:m}function T1(s){return s===!0?Vo(this._weekdaysShort,this._week.dow):s?this._weekdaysShort[s.day()]:this._weekdaysShort}function O1(s){return s===!0?Vo(this._weekdaysMin,this._week.dow):s?this._weekdaysMin[s.day()]:this._weekdaysMin}function A1(s,c,m){var x,b,I,K=s.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],x=0;x<7;++x)I=w([2e3,1]).day(x),this._minWeekdaysParse[x]=this.weekdaysMin(I,"").toLocaleLowerCase(),this._shortWeekdaysParse[x]=this.weekdaysShort(I,"").toLocaleLowerCase(),this._weekdaysParse[x]=this.weekdays(I,"").toLocaleLowerCase();return m?c==="dddd"?(b=et.call(this._weekdaysParse,K),b!==-1?b:null):c==="ddd"?(b=et.call(this._shortWeekdaysParse,K),b!==-1?b:null):(b=et.call(this._minWeekdaysParse,K),b!==-1?b:null):c==="dddd"?(b=et.call(this._weekdaysParse,K),b!==-1||(b=et.call(this._shortWeekdaysParse,K),b!==-1)?b:(b=et.call(this._minWeekdaysParse,K),b!==-1?b:null)):c==="ddd"?(b=et.call(this._shortWeekdaysParse,K),b!==-1||(b=et.call(this._weekdaysParse,K),b!==-1)?b:(b=et.call(this._minWeekdaysParse,K),b!==-1?b:null)):(b=et.call(this._minWeekdaysParse,K),b!==-1||(b=et.call(this._weekdaysParse,K),b!==-1)?b:(b=et.call(this._shortWeekdaysParse,K),b!==-1?b:null))}function D1(s,c,m){var x,b,I;if(this._weekdaysParseExact)return A1.call(this,s,c,m);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),x=0;x<7;x++){if(b=w([2e3,1]).day(x),m&&!this._fullWeekdaysParse[x]&&(this._fullWeekdaysParse[x]=new RegExp("^"+this.weekdays(b,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[x]=new RegExp("^"+this.weekdaysShort(b,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[x]=new RegExp("^"+this.weekdaysMin(b,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[x]||(I="^"+this.weekdays(b,"")+"|^"+this.weekdaysShort(b,"")+"|^"+this.weekdaysMin(b,""),this._weekdaysParse[x]=new RegExp(I.replace(".",""),"i")),m&&c==="dddd"&&this._fullWeekdaysParse[x].test(s))return x;if(m&&c==="ddd"&&this._shortWeekdaysParse[x].test(s))return x;if(m&&c==="dd"&&this._minWeekdaysParse[x].test(s))return x;if(!m&&this._weekdaysParse[x].test(s))return x}}function I1(s){if(!this.isValid())return s!=null?this:NaN;var c=this._isUTC?this._d.getUTCDay():this._d.getDay();return s!=null?(s=_1(s,this.localeData()),this.add(s-c,"d")):c}function N1(s){if(!this.isValid())return s!=null?this:NaN;var c=(this.day()+7-this.localeData()._week.dow)%7;return s==null?c:this.add(s-c,"d")}function L1(s){if(!this.isValid())return s!=null?this:NaN;if(s!=null){var c=S1(s,this.localeData());return this.day(this.day()%7?c:c-7)}else return this.day()||7}function R1(s){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Uo.call(this),s?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=E1),this._weekdaysStrictRegex&&s?this._weekdaysStrictRegex:this._weekdaysRegex)}function $1(s){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Uo.call(this),s?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=P1),this._weekdaysShortStrictRegex&&s?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function z1(s){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Uo.call(this),s?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=M1),this._weekdaysMinStrictRegex&&s?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Uo(){function s(yt,pn){return pn.length-yt.length}var c=[],m=[],x=[],b=[],I,K,de,Ce,ze;for(I=0;I<7;I++)K=w([2e3,1]).day(I),de=ot(this.weekdaysMin(K,"")),Ce=ot(this.weekdaysShort(K,"")),ze=ot(this.weekdays(K,"")),c.push(de),m.push(Ce),x.push(ze),b.push(de),b.push(Ce),b.push(ze);c.sort(s),m.sort(s),x.sort(s),b.sort(s),this._weekdaysRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+x.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+m.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+c.join("|")+")","i")}function Wo(){return this.hours()%12||12}function B1(){return this.hours()||24}J("H",["HH",2],0,"hour"),J("h",["hh",2],0,Wo),J("k",["kk",2],0,B1),J("hmm",0,0,function(){return""+Wo.apply(this)+v(this.minutes(),2)}),J("hmmss",0,0,function(){return""+Wo.apply(this)+v(this.minutes(),2)+v(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+v(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+v(this.minutes(),2)+v(this.seconds(),2)});function pl(s,c){J(s,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),c)})}pl("a",!0),pl("A",!1),Le("hour","h"),D("hour",13);function ml(s,c){return c._meridiemParse}ce("a",ml),ce("A",ml),ce("H",De),ce("h",De),ce("k",De),ce("HH",De,be),ce("hh",De,be),ce("kk",De,be),ce("hmm",bn),ce("hmmss",St),ce("Hmm",bn),ce("Hmmss",St),Te(["H","HH"],Ue),Te(["k","kk"],function(s,c,m){var x=re(s);c[Ue]=x===24?0:x}),Te(["a","A"],function(s,c,m){m._isPm=m._locale.isPM(s),m._meridiem=s}),Te(["h","hh"],function(s,c,m){c[Ue]=re(s),S(m).bigHour=!0}),Te("hmm",function(s,c,m){var x=s.length-2;c[Ue]=re(s.substr(0,x)),c[Ke]=re(s.substr(x)),S(m).bigHour=!0}),Te("hmmss",function(s,c,m){var x=s.length-4,b=s.length-2;c[Ue]=re(s.substr(0,x)),c[Ke]=re(s.substr(x,2)),c[Yt]=re(s.substr(b)),S(m).bigHour=!0}),Te("Hmm",function(s,c,m){var x=s.length-2;c[Ue]=re(s.substr(0,x)),c[Ke]=re(s.substr(x))}),Te("Hmmss",function(s,c,m){var x=s.length-4,b=s.length-2;c[Ue]=re(s.substr(0,x)),c[Ke]=re(s.substr(x,2)),c[Yt]=re(s.substr(b))});function F1(s){return(s+"").toLowerCase().charAt(0)==="p"}var H1=/[ap]\.?m?\.?/i,Y1=ye("Hours",!0);function V1(s,c,m){return s>11?m?"pm":"PM":m?"am":"AM"}var gl={calendar:X,longDateFormat:ke,invalidDate:Je,ordinal:we,dayOfMonthOrdinalParse:ge,relativeTime:Ze,months:Yo,monthsShort:Si,week:y1,weekdays:k1,weekdaysMin:C1,weekdaysShort:hl,meridiemParse:H1},Qe={},zr={},Br;function U1(s,c){var m,x=Math.min(s.length,c.length);for(m=0;m0;){if(b=Ei(I.slice(0,m).join("-")),b)return b;if(x&&x.length>=m&&U1(I,x)>=m-1)break;m--}c++}return Br}function G1(s){return s.match("^[^/\\\\]*$")!=null}function Ei(s){var c=null,m;if(Qe[s]===void 0&&e&&e.exports&&G1(s))try{c=Br._abbr,m=Lm,m("./locale/"+s),Sn(c)}catch{Qe[s]=null}return Qe[s]}function Sn(s,c){var m;return s&&(f(c)?m=un(s):m=Go(s,c),m?Br=m:typeof console<"u"&&console.warn&&console.warn("Locale "+s+" not found. Did you forget to load it?")),Br._abbr}function Go(s,c){if(c!==null){var m,x=gl;if(c.abbr=s,Qe[s]!=null)H("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),x=Qe[s]._config;else if(c.parentLocale!=null)if(Qe[c.parentLocale]!=null)x=Qe[c.parentLocale]._config;else if(m=Ei(c.parentLocale),m!=null)x=m._config;else return zr[c.parentLocale]||(zr[c.parentLocale]=[]),zr[c.parentLocale].push({name:s,config:c}),null;return Qe[s]=new A(L(x,c)),zr[s]&&zr[s].forEach(function(b){Go(b.name,b.config)}),Sn(s),Qe[s]}else return delete Qe[s],null}function Z1(s,c){if(c!=null){var m,x,b=gl;Qe[s]!=null&&Qe[s].parentLocale!=null?Qe[s].set(L(Qe[s]._config,c)):(x=Ei(s),x!=null&&(b=x._config),c=L(b,c),x==null&&(c.abbr=s),m=new A(c),m.parentLocale=Qe[s],Qe[s]=m),Sn(s)}else Qe[s]!=null&&(Qe[s].parentLocale!=null?(Qe[s]=Qe[s].parentLocale,s===Sn()&&Sn(s)):Qe[s]!=null&&delete Qe[s]);return Qe[s]}function un(s){var c;if(s&&s._locale&&s._locale._abbr&&(s=s._locale._abbr),!s)return Br;if(!o(s)){if(c=Ei(s),c)return c;s=[s]}return W1(s)}function q1(){return G(Qe)}function Zo(s){var c,m=s._a;return m&&S(s).overflow===-2&&(c=m[$e]<0||m[$e]>11?$e:m[pt]<1||m[pt]>Yn(m[Pe],m[$e])?pt:m[Ue]<0||m[Ue]>24||m[Ue]===24&&(m[Ke]!==0||m[Yt]!==0||m[ln]!==0)?Ue:m[Ke]<0||m[Ke]>59?Ke:m[Yt]<0||m[Yt]>59?Yt:m[ln]<0||m[ln]>999?ln:-1,S(s)._overflowDayOfYear&&(cpt)&&(c=pt),S(s)._overflowWeeks&&c===-1&&(c=Bo),S(s)._overflowWeekday&&c===-1&&(c=Fo),S(s).overflow=c),s}var X1=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,K1=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Q1=/Z|[+-]\d\d(?::?\d\d)?/,Pi=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],qo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],J1=/^\/?Date\((-?\d+)/i,ep=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,tp={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function xl(s){var c,m,x=s._i,b=X1.exec(x)||K1.exec(x),I,K,de,Ce,ze=Pi.length,yt=qo.length;if(b){for(S(s).iso=!0,c=0,m=ze;cLr(K)||s._dayOfYear===0)&&(S(s)._overflowDayOfYear=!0),m=Rr(K,0,s._dayOfYear),s._a[$e]=m.getUTCMonth(),s._a[pt]=m.getUTCDate()),c=0;c<3&&s._a[c]==null;++c)s._a[c]=x[c]=b[c];for(;c<7;c++)s._a[c]=x[c]=s._a[c]==null?c===2?1:0:s._a[c];s._a[Ue]===24&&s._a[Ke]===0&&s._a[Yt]===0&&s._a[ln]===0&&(s._nextDay=!0,s._a[Ue]=0),s._d=(s._useUTC?Rr:m1).apply(null,x),I=s._useUTC?s._d.getUTCDay():s._d.getDay(),s._tzm!=null&&s._d.setUTCMinutes(s._d.getUTCMinutes()-s._tzm),s._nextDay&&(s._a[Ue]=24),s._w&&typeof s._w.d<"u"&&s._w.d!==I&&(S(s).weekdayMismatch=!0)}}function cp(s){var c,m,x,b,I,K,de,Ce,ze;c=s._w,c.GG!=null||c.W!=null||c.E!=null?(I=1,K=4,m=tr(c.GG,s._a[Pe],$r(qe(),1,4).year),x=tr(c.W,1),b=tr(c.E,1),(b<1||b>7)&&(Ce=!0)):(I=s._locale._week.dow,K=s._locale._week.doy,ze=$r(qe(),I,K),m=tr(c.gg,s._a[Pe],ze.year),x=tr(c.w,ze.week),c.d!=null?(b=c.d,(b<0||b>6)&&(Ce=!0)):c.e!=null?(b=c.e+I,(c.e<0||c.e>6)&&(Ce=!0)):b=I),x<1||x>cn(m,I,K)?S(s)._overflowWeeks=!0:Ce!=null?S(s)._overflowWeekday=!0:(de=fl(m,x,b,I,K),s._a[Pe]=de.year,s._dayOfYear=de.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Ko(s){if(s._f===r.ISO_8601){xl(s);return}if(s._f===r.RFC_2822){wl(s);return}s._a=[],S(s).empty=!0;var c=""+s._i,m,x,b,I,K,de=c.length,Ce=0,ze,yt;for(b=ve(s._f,s._locale).match(Q)||[],yt=b.length,m=0;m0&&S(s).unusedInput.push(K),c=c.slice(c.indexOf(x)+x.length),Ce+=x.length),ae[I]?(x?S(s).empty=!1:S(s).unusedTokens.push(I),Ir(I,x,s)):s._strict&&!x&&S(s).unusedTokens.push(I);S(s).charsLeftOver=de-Ce,c.length>0&&S(s).unusedInput.push(c),s._a[Ue]<=12&&S(s).bigHour===!0&&s._a[Ue]>0&&(S(s).bigHour=void 0),S(s).parsedDateParts=s._a.slice(0),S(s).meridiem=s._meridiem,s._a[Ue]=up(s._locale,s._a[Ue],s._meridiem),ze=S(s).era,ze!==null&&(s._a[Pe]=s._locale.erasConvertYear(ze,s._a[Pe])),Xo(s),Zo(s)}function up(s,c,m){var x;return m==null?c:s.meridiemHour!=null?s.meridiemHour(c,m):(s.isPM!=null&&(x=s.isPM(m),x&&c<12&&(c+=12),!x&&c===12&&(c=0)),c)}function dp(s){var c,m,x,b,I,K,de=!1,Ce=s._f.length;if(Ce===0){S(s).invalidFormat=!0,s._d=new Date(NaN);return}for(b=0;bthis?this:s:P()});function _l(s,c){var m,x;if(c.length===1&&o(c[0])&&(c=c[0]),!c.length)return qe();for(m=c[0],x=1;xthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ap(){if(!f(this._isDSTShifted))return this._isDSTShifted;var s={},c;return T(s,this),s=bl(s),s._a?(c=s._isUTC?w(s._a):qe(s._a),this._isDSTShifted=this.isValid()&&Sp(s._a,c.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Dp(){return this.isValid()?!this._isUTC:!1}function Ip(){return this.isValid()?this._isUTC:!1}function kl(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Np=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Lp=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Vt(s,c){var m=s,x=null,b,I,K;return ji(s)?m={ms:s._milliseconds,d:s._days,M:s._months}:h(s)||!isNaN(+s)?(m={},c?m[c]=+s:m.milliseconds=+s):(x=Np.exec(s))?(b=x[1]==="-"?-1:1,m={y:0,d:re(x[pt])*b,h:re(x[Ue])*b,m:re(x[Ke])*b,s:re(x[Yt])*b,ms:re(Qo(x[ln]*1e3))*b}):(x=Lp.exec(s))?(b=x[1]==="-"?-1:1,m={y:Vn(x[2],b),M:Vn(x[3],b),w:Vn(x[4],b),d:Vn(x[5],b),h:Vn(x[6],b),m:Vn(x[7],b),s:Vn(x[8],b)}):m==null?m={}:typeof m=="object"&&("from"in m||"to"in m)&&(K=Rp(qe(m.from),qe(m.to)),m={},m.ms=K.milliseconds,m.M=K.months),I=new Mi(m),ji(s)&&l(s,"_locale")&&(I._locale=s._locale),ji(s)&&l(s,"_isValid")&&(I._isValid=s._isValid),I}Vt.fn=Mi.prototype,Vt.invalid=_p;function Vn(s,c){var m=s&&parseFloat(s.replace(",","."));return(isNaN(m)?0:m)*c}function Cl(s,c){var m={};return m.months=c.month()-s.month()+(c.year()-s.year())*12,s.clone().add(m.months,"M").isAfter(c)&&--m.months,m.milliseconds=+c-+s.clone().add(m.months,"M"),m}function Rp(s,c){var m;return s.isValid()&&c.isValid()?(c=es(c,s),s.isBefore(c)?m=Cl(s,c):(m=Cl(c,s),m.milliseconds=-m.milliseconds,m.months=-m.months),m):{milliseconds:0,months:0}}function El(s,c){return function(m,x){var b,I;return x!==null&&!isNaN(+x)&&(H(c,"moment()."+c+"(period, number) is deprecated. Please use moment()."+c+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),I=m,m=x,x=I),b=Vt(m,x),Pl(this,b,s),this}}function Pl(s,c,m,x){var b=c._milliseconds,I=Qo(c._days),K=Qo(c._months);s.isValid()&&(x=x??!0,K&&ll(s,fe(s,"Month")+K*m),I&&_e(s,"Date",fe(s,"Date")+I*m),b&&s._d.setTime(s._d.valueOf()+b*m),x&&r.updateOffset(s,I||K))}var $p=El(1,"add"),zp=El(-1,"subtract");function Ml(s){return typeof s=="string"||s instanceof String}function Bp(s){return U(s)||p(s)||Ml(s)||h(s)||Hp(s)||Fp(s)||s===null||s===void 0}function Fp(s){var c=a(s)&&!d(s),m=!1,x=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],b,I,K=x.length;for(b=0;bm.valueOf():m.valueOf()9999?me(m,c?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):B(Date.prototype.toISOString)?c?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",me(m,"Z")):me(m,c?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function n0(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var s="moment",c="",m,x,b,I;return this.isLocal()||(s=this.utcOffset()===0?"moment.utc":"moment.parseZone",c="Z"),m="["+s+'("]',x=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",b="-MM-DD[T]HH:mm:ss.SSS",I=c+'[")]',this.format(m+x+b+I)}function r0(s){s||(s=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var c=me(this,s);return this.localeData().postformat(c)}function i0(s,c){return this.isValid()&&(U(s)&&s.isValid()||qe(s).isValid())?Vt({to:this,from:s}).locale(this.locale()).humanize(!c):this.localeData().invalidDate()}function o0(s){return this.from(qe(),s)}function s0(s,c){return this.isValid()&&(U(s)&&s.isValid()||qe(s).isValid())?Vt({from:this,to:s}).locale(this.locale()).humanize(!c):this.localeData().invalidDate()}function a0(s){return this.to(qe(),s)}function jl(s){var c;return s===void 0?this._locale._abbr:(c=un(s),c!=null&&(this._locale=c),this)}var Tl=q("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(s){return s===void 0?this.localeData():this.locale(s)});function Ol(){return this._locale}var Oi=1e3,nr=60*Oi,Ai=60*nr,Al=(365*400+97)*24*Ai;function rr(s,c){return(s%c+c)%c}function Dl(s,c,m){return s<100&&s>=0?new Date(s+400,c,m)-Al:new Date(s,c,m).valueOf()}function Il(s,c,m){return s<100&&s>=0?Date.UTC(s+400,c,m)-Al:Date.UTC(s,c,m)}function l0(s){var c,m;if(s=Xe(s),s===void 0||s==="millisecond"||!this.isValid())return this;switch(m=this._isUTC?Il:Dl,s){case"year":c=m(this.year(),0,1);break;case"quarter":c=m(this.year(),this.month()-this.month()%3,1);break;case"month":c=m(this.year(),this.month(),1);break;case"week":c=m(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":c=m(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":c=m(this.year(),this.month(),this.date());break;case"hour":c=this._d.valueOf(),c-=rr(c+(this._isUTC?0:this.utcOffset()*nr),Ai);break;case"minute":c=this._d.valueOf(),c-=rr(c,nr);break;case"second":c=this._d.valueOf(),c-=rr(c,Oi);break}return this._d.setTime(c),r.updateOffset(this,!0),this}function c0(s){var c,m;if(s=Xe(s),s===void 0||s==="millisecond"||!this.isValid())return this;switch(m=this._isUTC?Il:Dl,s){case"year":c=m(this.year()+1,0,1)-1;break;case"quarter":c=m(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":c=m(this.year(),this.month()+1,1)-1;break;case"week":c=m(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":c=m(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":c=m(this.year(),this.month(),this.date()+1)-1;break;case"hour":c=this._d.valueOf(),c+=Ai-rr(c+(this._isUTC?0:this.utcOffset()*nr),Ai)-1;break;case"minute":c=this._d.valueOf(),c+=nr-rr(c,nr)-1;break;case"second":c=this._d.valueOf(),c+=Oi-rr(c,Oi)-1;break}return this._d.setTime(c),r.updateOffset(this,!0),this}function u0(){return this._d.valueOf()-(this._offset||0)*6e4}function d0(){return Math.floor(this.valueOf()/1e3)}function f0(){return new Date(this.valueOf())}function h0(){var s=this;return[s.year(),s.month(),s.date(),s.hour(),s.minute(),s.second(),s.millisecond()]}function p0(){var s=this;return{years:s.year(),months:s.month(),date:s.date(),hours:s.hours(),minutes:s.minutes(),seconds:s.seconds(),milliseconds:s.milliseconds()}}function m0(){return this.isValid()?this.toISOString():null}function g0(){return C(this)}function y0(){return g({},S(this))}function x0(){return S(this).overflow}function w0(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}J("N",0,0,"eraAbbr"),J("NN",0,0,"eraAbbr"),J("NNN",0,0,"eraAbbr"),J("NNNN",0,0,"eraName"),J("NNNNN",0,0,"eraNarrow"),J("y",["y",1],"yo","eraYear"),J("y",["yy",2],0,"eraYear"),J("y",["yyy",3],0,"eraYear"),J("y",["yyyy",4],0,"eraYear"),ce("N",ns),ce("NN",ns),ce("NNN",ns),ce("NNNN",T0),ce("NNNNN",O0),Te(["N","NN","NNN","NNNN","NNNNN"],function(s,c,m,x){var b=m._locale.erasParse(s,x,m._strict);b?S(m).era=b:S(m).invalidEra=s}),ce("y",Qt),ce("yy",Qt),ce("yyy",Qt),ce("yyyy",Qt),ce("yo",A0),Te(["y","yy","yyy","yyyy"],Pe),Te(["yo"],function(s,c,m,x){var b;m._locale._eraYearOrdinalRegex&&(b=s.match(m._locale._eraYearOrdinalRegex)),m._locale.eraYearOrdinalParse?c[Pe]=m._locale.eraYearOrdinalParse(s,b):c[Pe]=parseInt(s,10)});function b0(s,c){var m,x,b,I=this._eras||un("en")._eras;for(m=0,x=I.length;m=0)return I[x]}function _0(s,c){var m=s.since<=s.until?1:-1;return c===void 0?r(s.since).year():r(s.since).year()+(c-s.offset)*m}function S0(){var s,c,m,x=this.localeData().eras();for(s=0,c=x.length;sI&&(c=I),z0.call(this,s,c,m,x,b))}function z0(s,c,m,x,b){var I=fl(s,c,m,x,b),K=Rr(I.year,0,I.dayOfYear);return this.year(K.getUTCFullYear()),this.month(K.getUTCMonth()),this.date(K.getUTCDate()),this}J("Q",0,"Qo","quarter"),Le("quarter","Q"),D("quarter",7),ce("Q",Ae),Te("Q",function(s,c){c[$e]=(re(s)-1)*3});function B0(s){return s==null?Math.ceil((this.month()+1)/3):this.month((s-1)*3+this.month()%3)}J("D",["DD",2],"Do","date"),Le("date","D"),D("date",9),ce("D",De),ce("DD",De,be),ce("Do",function(s,c){return s?c._dayOfMonthOrdinalParse||c._ordinalParse:c._dayOfMonthOrdinalParseLenient}),Te(["D","DD"],pt),Te("Do",function(s,c){c[pt]=re(s.match(De)[0])});var Ll=ye("Date",!0);J("DDD",["DDDD",3],"DDDo","dayOfYear"),Le("dayOfYear","DDD"),D("dayOfYear",4),ce("DDD",Xt),ce("DDDD",tt),Te(["DDD","DDDD"],function(s,c,m){m._dayOfYear=re(s)});function F0(s){var c=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return s==null?c:this.add(s-c,"d")}J("m",["mm",2],0,"minute"),Le("minute","m"),D("minute",14),ce("m",De),ce("mm",De,be),Te(["m","mm"],Ke);var H0=ye("Minutes",!1);J("s",["ss",2],0,"second"),Le("second","s"),D("second",15),ce("s",De),ce("ss",De,be),Te(["s","ss"],Yt);var Y0=ye("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return this.millisecond()*10}),J(0,["SSSSS",5],0,function(){return this.millisecond()*100}),J(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),J(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),J(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),J(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Le("millisecond","ms"),D("millisecond",16),ce("S",Xt,Ae),ce("SS",Xt,be),ce("SSS",Xt,tt);var kn,Rl;for(kn="SSSS";kn.length<=9;kn+="S")ce(kn,Qt);function V0(s,c){c[ln]=re(("0."+s)*1e3)}for(kn="S";kn.length<=9;kn+="S")Te(kn,V0);Rl=ye("Milliseconds",!1),J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");function U0(){return this._isUTC?"UTC":""}function W0(){return this._isUTC?"Coordinated Universal Time":""}var ie=V.prototype;ie.add=$p,ie.calendar=Up,ie.clone=Wp,ie.diff=Jp,ie.endOf=c0,ie.format=r0,ie.from=i0,ie.fromNow=o0,ie.to=s0,ie.toNow=a0,ie.get=je,ie.invalidAt=x0,ie.isAfter=Gp,ie.isBefore=Zp,ie.isBetween=qp,ie.isSame=Xp,ie.isSameOrAfter=Kp,ie.isSameOrBefore=Qp,ie.isValid=g0,ie.lang=Tl,ie.locale=jl,ie.localeData=Ol,ie.max=gp,ie.min=mp,ie.parsingFlags=y0,ie.set=Ve,ie.startOf=l0,ie.subtract=zp,ie.toArray=h0,ie.toObject=p0,ie.toDate=f0,ie.toISOString=t0,ie.inspect=n0,typeof Symbol<"u"&&Symbol.for!=null&&(ie[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ie.toJSON=m0,ie.toString=e0,ie.unix=d0,ie.valueOf=u0,ie.creationData=w0,ie.eraName=S0,ie.eraNarrow=k0,ie.eraAbbr=C0,ie.eraYear=E0,ie.year=dl,ie.isLeapYear=p1,ie.weekYear=D0,ie.isoWeekYear=I0,ie.quarter=ie.quarters=B0,ie.month=cl,ie.daysInMonth=d1,ie.week=ie.weeks=b1,ie.isoWeek=ie.isoWeeks=v1,ie.weeksInYear=R0,ie.weeksInWeekYear=$0,ie.isoWeeksInYear=N0,ie.isoWeeksInISOWeekYear=L0,ie.date=Ll,ie.day=ie.days=I1,ie.weekday=N1,ie.isoWeekday=L1,ie.dayOfYear=F0,ie.hour=ie.hours=Y1,ie.minute=ie.minutes=H0,ie.second=ie.seconds=Y0,ie.millisecond=ie.milliseconds=Rl,ie.utcOffset=Cp,ie.utc=Pp,ie.local=Mp,ie.parseZone=jp,ie.hasAlignedHourOffset=Tp,ie.isDST=Op,ie.isLocal=Dp,ie.isUtcOffset=Ip,ie.isUtc=kl,ie.isUTC=kl,ie.zoneAbbr=U0,ie.zoneName=W0,ie.dates=q("dates accessor is deprecated. Use date instead.",Ll),ie.months=q("months accessor is deprecated. Use month instead",cl),ie.years=q("years accessor is deprecated. Use year instead",dl),ie.zone=q("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ep),ie.isDSTShifted=q("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ap);function G0(s){return qe(s*1e3)}function Z0(){return qe.apply(null,arguments).parseZone()}function $l(s){return s}var Ie=A.prototype;Ie.calendar=F,Ie.longDateFormat=Be,Ie.invalidDate=He,Ie.ordinal=Ye,Ie.preparse=$l,Ie.postformat=$l,Ie.relativeTime=ue,Ie.pastFuture=dt,Ie.set=M,Ie.eras=b0,Ie.erasParse=v0,Ie.erasConvertYear=_0,Ie.erasAbbrRegex=M0,Ie.erasNameRegex=P0,Ie.erasNarrowRegex=j0,Ie.months=a1,Ie.monthsShort=l1,Ie.monthsParse=u1,Ie.monthsRegex=h1,Ie.monthsShortRegex=f1,Ie.week=g1,Ie.firstDayOfYear=w1,Ie.firstDayOfWeek=x1,Ie.weekdays=j1,Ie.weekdaysMin=O1,Ie.weekdaysShort=T1,Ie.weekdaysParse=D1,Ie.weekdaysRegex=R1,Ie.weekdaysShortRegex=$1,Ie.weekdaysMinRegex=z1,Ie.isPM=F1,Ie.meridiem=V1;function Ii(s,c,m,x){var b=un(),I=w().set(x,c);return b[m](I,s)}function zl(s,c,m){if(h(s)&&(c=s,s=void 0),s=s||"",c!=null)return Ii(s,c,m,"month");var x,b=[];for(x=0;x<12;x++)b[x]=Ii(s,x,m,"month");return b}function is(s,c,m,x){typeof s=="boolean"?(h(c)&&(m=c,c=void 0),c=c||""):(c=s,m=c,s=!1,h(c)&&(m=c,c=void 0),c=c||"");var b=un(),I=s?b._week.dow:0,K,de=[];if(m!=null)return Ii(c,(m+I)%7,x,"day");for(K=0;K<7;K++)de[K]=Ii(c,(K+I)%7,x,"day");return de}function q0(s,c){return zl(s,c,"months")}function X0(s,c){return zl(s,c,"monthsShort")}function K0(s,c,m){return is(s,c,m,"weekdays")}function Q0(s,c,m){return is(s,c,m,"weekdaysShort")}function J0(s,c,m){return is(s,c,m,"weekdaysMin")}Sn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(s){var c=s%10,m=re(s%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th";return s+m}}),r.lang=q("moment.lang is deprecated. Use moment.locale instead.",Sn),r.langData=q("moment.langData is deprecated. Use moment.localeData instead.",un);var dn=Math.abs;function em(){var s=this._data;return this._milliseconds=dn(this._milliseconds),this._days=dn(this._days),this._months=dn(this._months),s.milliseconds=dn(s.milliseconds),s.seconds=dn(s.seconds),s.minutes=dn(s.minutes),s.hours=dn(s.hours),s.months=dn(s.months),s.years=dn(s.years),this}function Bl(s,c,m,x){var b=Vt(c,m);return s._milliseconds+=x*b._milliseconds,s._days+=x*b._days,s._months+=x*b._months,s._bubble()}function tm(s,c){return Bl(this,s,c,1)}function nm(s,c){return Bl(this,s,c,-1)}function Fl(s){return s<0?Math.floor(s):Math.ceil(s)}function rm(){var s=this._milliseconds,c=this._days,m=this._months,x=this._data,b,I,K,de,Ce;return s>=0&&c>=0&&m>=0||s<=0&&c<=0&&m<=0||(s+=Fl(os(m)+c)*864e5,c=0,m=0),x.milliseconds=s%1e3,b=se(s/1e3),x.seconds=b%60,I=se(b/60),x.minutes=I%60,K=se(I/60),x.hours=K%24,c+=se(K/24),Ce=se(Hl(c)),m+=Ce,c-=Fl(os(Ce)),de=se(m/12),m%=12,x.days=c,x.months=m,x.years=de,this}function Hl(s){return s*4800/146097}function os(s){return s*146097/4800}function im(s){if(!this.isValid())return NaN;var c,m,x=this._milliseconds;if(s=Xe(s),s==="month"||s==="quarter"||s==="year")switch(c=this._days+x/864e5,m=this._months+Hl(c),s){case"month":return m;case"quarter":return m/3;case"year":return m/12}else switch(c=this._days+Math.round(os(this._months)),s){case"week":return c/7+x/6048e5;case"day":return c+x/864e5;case"hour":return c*24+x/36e5;case"minute":return c*1440+x/6e4;case"second":return c*86400+x/1e3;case"millisecond":return Math.floor(c*864e5)+x;default:throw new Error("Unknown unit "+s)}}function om(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+re(this._months/12)*31536e6:NaN}function fn(s){return function(){return this.as(s)}}var sm=fn("ms"),am=fn("s"),lm=fn("m"),cm=fn("h"),um=fn("d"),dm=fn("w"),fm=fn("M"),hm=fn("Q"),pm=fn("y");function mm(){return Vt(this)}function gm(s){return s=Xe(s),this.isValid()?this[s+"s"]():NaN}function Un(s){return function(){return this.isValid()?this._data[s]:NaN}}var ym=Un("milliseconds"),xm=Un("seconds"),wm=Un("minutes"),bm=Un("hours"),vm=Un("days"),_m=Un("months"),Sm=Un("years");function km(){return se(this.days()/7)}var hn=Math.round,ir={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Cm(s,c,m,x,b){return b.relativeTime(c||1,!!m,s,x)}function Em(s,c,m,x){var b=Vt(s).abs(),I=hn(b.as("s")),K=hn(b.as("m")),de=hn(b.as("h")),Ce=hn(b.as("d")),ze=hn(b.as("M")),yt=hn(b.as("w")),pn=hn(b.as("y")),Cn=I<=m.ss&&["s",I]||I0,Cn[4]=x,Cm.apply(null,Cn)}function Pm(s){return s===void 0?hn:typeof s=="function"?(hn=s,!0):!1}function Mm(s,c){return ir[s]===void 0?!1:c===void 0?ir[s]:(ir[s]=c,s==="s"&&(ir.ss=c-1),!0)}function jm(s,c){if(!this.isValid())return this.localeData().invalidDate();var m=!1,x=ir,b,I;return typeof s=="object"&&(c=s,s=!1),typeof s=="boolean"&&(m=s),typeof c=="object"&&(x=Object.assign({},ir,c),c.s!=null&&c.ss==null&&(x.ss=c.s-1)),b=this.localeData(),I=Em(this,!m,x,b),m&&(I=b.pastFuture(+this,I)),b.postformat(I)}var ss=Math.abs;function or(s){return(s>0)-(s<0)||+s}function Ni(){if(!this.isValid())return this.localeData().invalidDate();var s=ss(this._milliseconds)/1e3,c=ss(this._days),m=ss(this._months),x,b,I,K,de=this.asSeconds(),Ce,ze,yt,pn;return de?(x=se(s/60),b=se(x/60),s%=60,x%=60,I=se(m/12),m%=12,K=s?s.toFixed(3).replace(/\.?0+$/,""):"",Ce=de<0?"-":"",ze=or(this._months)!==or(de)?"-":"",yt=or(this._days)!==or(de)?"-":"",pn=or(this._milliseconds)!==or(de)?"-":"",Ce+"P"+(I?ze+I+"Y":"")+(m?ze+m+"M":"")+(c?yt+c+"D":"")+(b||x||s?"T":"")+(b?pn+b+"H":"")+(x?pn+x+"M":"")+(s?pn+K+"S":"")):"P0D"}var Oe=Mi.prototype;Oe.isValid=vp,Oe.abs=em,Oe.add=tm,Oe.subtract=nm,Oe.as=im,Oe.asMilliseconds=sm,Oe.asSeconds=am,Oe.asMinutes=lm,Oe.asHours=cm,Oe.asDays=um,Oe.asWeeks=dm,Oe.asMonths=fm,Oe.asQuarters=hm,Oe.asYears=pm,Oe.valueOf=om,Oe._bubble=rm,Oe.clone=mm,Oe.get=gm,Oe.milliseconds=ym,Oe.seconds=xm,Oe.minutes=wm,Oe.hours=bm,Oe.days=vm,Oe.weeks=km,Oe.months=_m,Oe.years=Sm,Oe.humanize=jm,Oe.toISOString=Ni,Oe.toString=Ni,Oe.toJSON=Ni,Oe.locale=jl,Oe.localeData=Ol,Oe.toIsoString=q("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ni),Oe.lang=Tl,J("X",0,0,"unix"),J("x",0,0,"valueOf"),ce("x",Jt),ce("X",Or),Te("X",function(s,c,m){m._d=new Date(parseFloat(s)*1e3)}),Te("x",function(s,c,m){m._d=new Date(re(s))});//! moment.js -return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.unix=G0,r.months=q0,r.isDate=p,r.locale=Sn,r.invalid=P,r.duration=Vt,r.isMoment=U,r.weekdays=K0,r.parseZone=Z0,r.localeData=un,r.isDuration=ji,r.monthsShort=X0,r.weekdaysMin=J0,r.defineLocale=Go,r.updateLocale=Z1,r.locales=q1,r.weekdaysShort=Q0,r.normalizeUnits=Xe,r.relativeTimeRounding=Pm,r.relativeTimeThreshold=Mm,r.calendarFormat=Vp,r.prototype=ie,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})})(bd);var n2=bd.exports;const vd=ma(n2),r2=({text:e,type:t,sourceLink:n,date:r})=>u.jsxs(z,{direction:"column",children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsx(z,{align:"center",direction:"row",children:u.jsx(Mr,{type:t})}),n&&u.jsx(Qn,{href:`${n}${n!=null&&n.includes("?")?"&":"?"}open=system`,onClick:i=>i.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),u.jsx(Hs,{"data-testid":"episode-description",children:e}),u.jsxs(z,{align:"center",direction:"row",justify:"flex-start",children:[u.jsx(z,{align:"center",direction:"row",justify:"flex-start",children:!!r&&u.jsx($n,{children:vd.unix(r).fromNow()})}),n&&u.jsxs(Qn,{href:n,onClick:i=>i.stopPropagation(),target:"_blank",children:[u.jsx(wd,{}),u.jsx(i2,{children:n})]})]})]}),i2=Y(Fe)` +`+new Error().stack),m=!1}return c.apply(this,arguments)},c)}var $={};function H(s,c){r.deprecationHandler!=null&&r.deprecationHandler(s,c),$[s]||(W(c),$[s]=!0)}r.suppressDeprecationWarnings=!1,r.deprecationHandler=null;function B(s){return typeof Function<"u"&&s instanceof Function||Object.prototype.toString.call(s)==="[object Function]"}function P(s){var c,m;for(m in s)l(s,m)&&(c=s[m],B(c)?this[m]=c:this["_"+m]=c);this._config=s,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function R(s,c){var m=g({},s),x;for(x in c)l(c,x)&&(a(s[x])&&a(c[x])?(m[x]={},g(m[x],s[x]),g(m[x],c[x])):c[x]!=null?m[x]=c[x]:delete m[x]);for(x in s)l(s,x)&&!l(c,x)&&a(s[x])&&(m[x]=g({},m[x]));return m}function A(s){s!=null&&this.set(s)}var G;Object.keys?G=Object.keys:G=function(s){var c,m=[];for(c in s)l(s,c)&&m.push(c);return m};var X={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function F(s,c,m){var x=this._calendar[s]||this._calendar.sameElse;return B(x)?x.call(c,m):x}function v(s,c,m){var x=""+Math.abs(s),b=c-x.length,I=s>=0;return(I?m?"+":"":"-")+Math.pow(10,Math.max(0,b)).toString().substr(1)+x}var Q=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ne=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,E={},ae={};function J(s,c,m,x){var b=x;typeof x=="string"&&(b=function(){return this[x]()}),s&&(ae[s]=b),c&&(ae[c[0]]=function(){return v(b.apply(this,arguments),c[1],c[2])}),m&&(ae[m]=function(){return this.localeData().ordinal(b.apply(this,arguments),s)})}function le(s){return s.match(/\[[\s\S]/)?s.replace(/^\[|\]$/g,""):s.replace(/\\/g,"")}function pe(s){var c=s.match(Q),m,x;for(m=0,x=c.length;m=0&&ne.test(s);)s=s.replace(ne,x),ne.lastIndex=0,m-=1;return s}var ke={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function Be(s){var c=this._longDateFormat[s],m=this._longDateFormat[s.toUpperCase()];return c||!m?c:(this._longDateFormat[s]=m.match(Q).map(function(x){return x==="MMMM"||x==="MM"||x==="DD"||x==="dddd"?x.slice(1):x}).join(""),this._longDateFormat[s])}var Je="Invalid date";function He(){return this._invalidDate}var we="%d",ge=/\d{1,2}/;function Ye(s){return this._ordinal.replace("%d",s)}var Ze={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function ue(s,c,m,x){var b=this._relativeTime[m];return B(b)?b(s,c,m,x):b.replace(/%d/i,s)}function dt(s,c){var m=this._relativeTime[s>0?"future":"past"];return B(m)?m(c):m.replace(/%s/i,c)}var Ne={};function Le(s,c){var m=s.toLowerCase();Ne[m]=Ne[m+"s"]=Ne[c]=s}function Xe(s){return typeof s=="string"?Ne[s]||Ne[s.toLowerCase()]:void 0}function ft(s){var c={},m,x;for(x in s)l(s,x)&&(m=Xe(x),m&&(c[m]=s[x]));return c}var ht={};function D(s,c){ht[s]=c}function Z(s){var c=[],m;for(m in s)l(s,m)&&c.push({unit:m,priority:ht[m]});return c.sort(function(x,b){return x.priority-b.priority}),c}function te(s){return s%4===0&&s%100!==0||s%400===0}function se(s){return s<0?Math.ceil(s)||0:Math.floor(s)}function re(s){var c=+s,m=0;return c!==0&&isFinite(c)&&(m=se(c)),m}function ye(s,c){return function(m){return m!=null?(_e(this,s,m),r.updateOffset(this,c),this):fe(this,s)}}function fe(s,c){return s.isValid()?s._d["get"+(s._isUTC?"UTC":"")+c]():NaN}function _e(s,c,m){s.isValid()&&!isNaN(m)&&(c==="FullYear"&&te(s.year())&&s.month()===1&&s.date()===29?(m=re(m),s._d["set"+(s._isUTC?"UTC":"")+c](m,s.month(),Yn(m,s.month()))):s._d["set"+(s._isUTC?"UTC":"")+c](m))}function je(s){return s=Xe(s),B(this[s])?this[s]():this}function Ve(s,c){if(typeof s=="object"){s=ft(s);var m=Z(s),x,b=m.length;for(x=0;x68?1900:2e3)};var dl=ye("FullYear",!0);function p1(){return te(this.year())}function m1(s,c,m,x,b,I,K){var de;return s<100&&s>=0?(de=new Date(s+400,c,m,x,b,I,K),isFinite(de.getFullYear())&&de.setFullYear(s)):de=new Date(s,c,m,x,b,I,K),de}function Rr(s){var c,m;return s<100&&s>=0?(m=Array.prototype.slice.call(arguments),m[0]=s+400,c=new Date(Date.UTC.apply(null,m)),isFinite(c.getUTCFullYear())&&c.setUTCFullYear(s)):c=new Date(Date.UTC.apply(null,arguments)),c}function Ci(s,c,m){var x=7+c-m,b=(7+Rr(s,0,x).getUTCDay()-c)%7;return-b+x-1}function fl(s,c,m,x,b){var I=(7+m-x)%7,K=Ci(s,x,b),de=1+7*(c-1)+I+K,Ce,ze;return de<=0?(Ce=s-1,ze=Lr(Ce)+de):de>Lr(s)?(Ce=s+1,ze=de-Lr(s)):(Ce=s,ze=de),{year:Ce,dayOfYear:ze}}function $r(s,c,m){var x=Ci(s.year(),c,m),b=Math.floor((s.dayOfYear()-x-1)/7)+1,I,K;return b<1?(K=s.year()-1,I=b+cn(K,c,m)):b>cn(s.year(),c,m)?(I=b-cn(s.year(),c,m),K=s.year()+1):(K=s.year(),I=b),{week:I,year:K}}function cn(s,c,m){var x=Ci(s,c,m),b=Ci(s+1,c,m);return(Lr(s)-x+b)/7}J("w",["ww",2],"wo","week"),J("W",["WW",2],"Wo","isoWeek"),Le("week","w"),Le("isoWeek","W"),D("week",5),D("isoWeek",5),ce("w",De),ce("ww",De,be),ce("W",De),ce("WW",De,be),Ht(["w","ww","W","WW"],function(s,c,m,x){c[x.substr(0,1)]=re(s)});function g1(s){return $r(s,this._week.dow,this._week.doy).week}var y1={dow:0,doy:6};function x1(){return this._week.dow}function w1(){return this._week.doy}function b1(s){var c=this.localeData().week(this);return s==null?c:this.add((s-c)*7,"d")}function v1(s){var c=$r(this,1,4).week;return s==null?c:this.add((s-c)*7,"d")}J("d",0,"do","day"),J("dd",0,0,function(s){return this.localeData().weekdaysMin(this,s)}),J("ddd",0,0,function(s){return this.localeData().weekdaysShort(this,s)}),J("dddd",0,0,function(s){return this.localeData().weekdays(this,s)}),J("e",0,0,"weekday"),J("E",0,0,"isoWeekday"),Le("day","d"),Le("weekday","e"),Le("isoWeekday","E"),D("day",11),D("weekday",11),D("isoWeekday",11),ce("d",De),ce("e",De),ce("E",De),ce("dd",function(s,c){return c.weekdaysMinRegex(s)}),ce("ddd",function(s,c){return c.weekdaysShortRegex(s)}),ce("dddd",function(s,c){return c.weekdaysRegex(s)}),Ht(["dd","ddd","dddd"],function(s,c,m,x){var b=m._locale.weekdaysParse(s,x,m._strict);b!=null?c.d=b:S(m).invalidWeekday=s}),Ht(["d","e","E"],function(s,c,m,x){c[x]=re(s)});function _1(s,c){return typeof s!="string"?s:isNaN(s)?(s=c.weekdaysParse(s),typeof s=="number"?s:null):parseInt(s,10)}function S1(s,c){return typeof s=="string"?c.weekdaysParse(s)%7||7:isNaN(s)?null:s}function Vo(s,c){return s.slice(c,7).concat(s.slice(0,c))}var k1="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),hl="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),C1="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),E1=an,P1=an,M1=an;function j1(s,c){var m=o(this._weekdays)?this._weekdays:this._weekdays[s&&s!==!0&&this._weekdays.isFormat.test(c)?"format":"standalone"];return s===!0?Vo(m,this._week.dow):s?m[s.day()]:m}function T1(s){return s===!0?Vo(this._weekdaysShort,this._week.dow):s?this._weekdaysShort[s.day()]:this._weekdaysShort}function O1(s){return s===!0?Vo(this._weekdaysMin,this._week.dow):s?this._weekdaysMin[s.day()]:this._weekdaysMin}function A1(s,c,m){var x,b,I,K=s.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],x=0;x<7;++x)I=w([2e3,1]).day(x),this._minWeekdaysParse[x]=this.weekdaysMin(I,"").toLocaleLowerCase(),this._shortWeekdaysParse[x]=this.weekdaysShort(I,"").toLocaleLowerCase(),this._weekdaysParse[x]=this.weekdays(I,"").toLocaleLowerCase();return m?c==="dddd"?(b=et.call(this._weekdaysParse,K),b!==-1?b:null):c==="ddd"?(b=et.call(this._shortWeekdaysParse,K),b!==-1?b:null):(b=et.call(this._minWeekdaysParse,K),b!==-1?b:null):c==="dddd"?(b=et.call(this._weekdaysParse,K),b!==-1||(b=et.call(this._shortWeekdaysParse,K),b!==-1)?b:(b=et.call(this._minWeekdaysParse,K),b!==-1?b:null)):c==="ddd"?(b=et.call(this._shortWeekdaysParse,K),b!==-1||(b=et.call(this._weekdaysParse,K),b!==-1)?b:(b=et.call(this._minWeekdaysParse,K),b!==-1?b:null)):(b=et.call(this._minWeekdaysParse,K),b!==-1||(b=et.call(this._weekdaysParse,K),b!==-1)?b:(b=et.call(this._shortWeekdaysParse,K),b!==-1?b:null))}function D1(s,c,m){var x,b,I;if(this._weekdaysParseExact)return A1.call(this,s,c,m);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),x=0;x<7;x++){if(b=w([2e3,1]).day(x),m&&!this._fullWeekdaysParse[x]&&(this._fullWeekdaysParse[x]=new RegExp("^"+this.weekdays(b,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[x]=new RegExp("^"+this.weekdaysShort(b,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[x]=new RegExp("^"+this.weekdaysMin(b,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[x]||(I="^"+this.weekdays(b,"")+"|^"+this.weekdaysShort(b,"")+"|^"+this.weekdaysMin(b,""),this._weekdaysParse[x]=new RegExp(I.replace(".",""),"i")),m&&c==="dddd"&&this._fullWeekdaysParse[x].test(s))return x;if(m&&c==="ddd"&&this._shortWeekdaysParse[x].test(s))return x;if(m&&c==="dd"&&this._minWeekdaysParse[x].test(s))return x;if(!m&&this._weekdaysParse[x].test(s))return x}}function I1(s){if(!this.isValid())return s!=null?this:NaN;var c=this._isUTC?this._d.getUTCDay():this._d.getDay();return s!=null?(s=_1(s,this.localeData()),this.add(s-c,"d")):c}function N1(s){if(!this.isValid())return s!=null?this:NaN;var c=(this.day()+7-this.localeData()._week.dow)%7;return s==null?c:this.add(s-c,"d")}function L1(s){if(!this.isValid())return s!=null?this:NaN;if(s!=null){var c=S1(s,this.localeData());return this.day(this.day()%7?c:c-7)}else return this.day()||7}function R1(s){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Uo.call(this),s?this._weekdaysStrictRegex:this._weekdaysRegex):(l(this,"_weekdaysRegex")||(this._weekdaysRegex=E1),this._weekdaysStrictRegex&&s?this._weekdaysStrictRegex:this._weekdaysRegex)}function $1(s){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Uo.call(this),s?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(l(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=P1),this._weekdaysShortStrictRegex&&s?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function z1(s){return this._weekdaysParseExact?(l(this,"_weekdaysRegex")||Uo.call(this),s?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(l(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=M1),this._weekdaysMinStrictRegex&&s?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Uo(){function s(yt,pn){return pn.length-yt.length}var c=[],m=[],x=[],b=[],I,K,de,Ce,ze;for(I=0;I<7;I++)K=w([2e3,1]).day(I),de=ot(this.weekdaysMin(K,"")),Ce=ot(this.weekdaysShort(K,"")),ze=ot(this.weekdays(K,"")),c.push(de),m.push(Ce),x.push(ze),b.push(de),b.push(Ce),b.push(ze);c.sort(s),m.sort(s),x.sort(s),b.sort(s),this._weekdaysRegex=new RegExp("^("+b.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+x.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+m.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+c.join("|")+")","i")}function Wo(){return this.hours()%12||12}function B1(){return this.hours()||24}J("H",["HH",2],0,"hour"),J("h",["hh",2],0,Wo),J("k",["kk",2],0,B1),J("hmm",0,0,function(){return""+Wo.apply(this)+v(this.minutes(),2)}),J("hmmss",0,0,function(){return""+Wo.apply(this)+v(this.minutes(),2)+v(this.seconds(),2)}),J("Hmm",0,0,function(){return""+this.hours()+v(this.minutes(),2)}),J("Hmmss",0,0,function(){return""+this.hours()+v(this.minutes(),2)+v(this.seconds(),2)});function pl(s,c){J(s,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),c)})}pl("a",!0),pl("A",!1),Le("hour","h"),D("hour",13);function ml(s,c){return c._meridiemParse}ce("a",ml),ce("A",ml),ce("H",De),ce("h",De),ce("k",De),ce("HH",De,be),ce("hh",De,be),ce("kk",De,be),ce("hmm",bn),ce("hmmss",St),ce("Hmm",bn),ce("Hmmss",St),Te(["H","HH"],Ue),Te(["k","kk"],function(s,c,m){var x=re(s);c[Ue]=x===24?0:x}),Te(["a","A"],function(s,c,m){m._isPm=m._locale.isPM(s),m._meridiem=s}),Te(["h","hh"],function(s,c,m){c[Ue]=re(s),S(m).bigHour=!0}),Te("hmm",function(s,c,m){var x=s.length-2;c[Ue]=re(s.substr(0,x)),c[Ke]=re(s.substr(x)),S(m).bigHour=!0}),Te("hmmss",function(s,c,m){var x=s.length-4,b=s.length-2;c[Ue]=re(s.substr(0,x)),c[Ke]=re(s.substr(x,2)),c[Yt]=re(s.substr(b)),S(m).bigHour=!0}),Te("Hmm",function(s,c,m){var x=s.length-2;c[Ue]=re(s.substr(0,x)),c[Ke]=re(s.substr(x))}),Te("Hmmss",function(s,c,m){var x=s.length-4,b=s.length-2;c[Ue]=re(s.substr(0,x)),c[Ke]=re(s.substr(x,2)),c[Yt]=re(s.substr(b))});function F1(s){return(s+"").toLowerCase().charAt(0)==="p"}var H1=/[ap]\.?m?\.?/i,Y1=ye("Hours",!0);function V1(s,c,m){return s>11?m?"pm":"PM":m?"am":"AM"}var gl={calendar:X,longDateFormat:ke,invalidDate:Je,ordinal:we,dayOfMonthOrdinalParse:ge,relativeTime:Ze,months:Yo,monthsShort:Si,week:y1,weekdays:k1,weekdaysMin:C1,weekdaysShort:hl,meridiemParse:H1},Qe={},zr={},Br;function U1(s,c){var m,x=Math.min(s.length,c.length);for(m=0;m0;){if(b=Ei(I.slice(0,m).join("-")),b)return b;if(x&&x.length>=m&&U1(I,x)>=m-1)break;m--}c++}return Br}function G1(s){return s.match("^[^/\\\\]*$")!=null}function Ei(s){var c=null,m;if(Qe[s]===void 0&&e&&e.exports&&G1(s))try{c=Br._abbr,m=Lm,m("./locale/"+s),Sn(c)}catch{Qe[s]=null}return Qe[s]}function Sn(s,c){var m;return s&&(f(c)?m=un(s):m=Go(s,c),m?Br=m:typeof console<"u"&&console.warn&&console.warn("Locale "+s+" not found. Did you forget to load it?")),Br._abbr}function Go(s,c){if(c!==null){var m,x=gl;if(c.abbr=s,Qe[s]!=null)H("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),x=Qe[s]._config;else if(c.parentLocale!=null)if(Qe[c.parentLocale]!=null)x=Qe[c.parentLocale]._config;else if(m=Ei(c.parentLocale),m!=null)x=m._config;else return zr[c.parentLocale]||(zr[c.parentLocale]=[]),zr[c.parentLocale].push({name:s,config:c}),null;return Qe[s]=new A(R(x,c)),zr[s]&&zr[s].forEach(function(b){Go(b.name,b.config)}),Sn(s),Qe[s]}else return delete Qe[s],null}function Z1(s,c){if(c!=null){var m,x,b=gl;Qe[s]!=null&&Qe[s].parentLocale!=null?Qe[s].set(R(Qe[s]._config,c)):(x=Ei(s),x!=null&&(b=x._config),c=R(b,c),x==null&&(c.abbr=s),m=new A(c),m.parentLocale=Qe[s],Qe[s]=m),Sn(s)}else Qe[s]!=null&&(Qe[s].parentLocale!=null?(Qe[s]=Qe[s].parentLocale,s===Sn()&&Sn(s)):Qe[s]!=null&&delete Qe[s]);return Qe[s]}function un(s){var c;if(s&&s._locale&&s._locale._abbr&&(s=s._locale._abbr),!s)return Br;if(!o(s)){if(c=Ei(s),c)return c;s=[s]}return W1(s)}function q1(){return G(Qe)}function Zo(s){var c,m=s._a;return m&&S(s).overflow===-2&&(c=m[$e]<0||m[$e]>11?$e:m[pt]<1||m[pt]>Yn(m[Pe],m[$e])?pt:m[Ue]<0||m[Ue]>24||m[Ue]===24&&(m[Ke]!==0||m[Yt]!==0||m[ln]!==0)?Ue:m[Ke]<0||m[Ke]>59?Ke:m[Yt]<0||m[Yt]>59?Yt:m[ln]<0||m[ln]>999?ln:-1,S(s)._overflowDayOfYear&&(cpt)&&(c=pt),S(s)._overflowWeeks&&c===-1&&(c=Bo),S(s)._overflowWeekday&&c===-1&&(c=Fo),S(s).overflow=c),s}var X1=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,K1=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Q1=/Z|[+-]\d\d(?::?\d\d)?/,Pi=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],qo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],J1=/^\/?Date\((-?\d+)/i,ep=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,tp={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function xl(s){var c,m,x=s._i,b=X1.exec(x)||K1.exec(x),I,K,de,Ce,ze=Pi.length,yt=qo.length;if(b){for(S(s).iso=!0,c=0,m=ze;cLr(K)||s._dayOfYear===0)&&(S(s)._overflowDayOfYear=!0),m=Rr(K,0,s._dayOfYear),s._a[$e]=m.getUTCMonth(),s._a[pt]=m.getUTCDate()),c=0;c<3&&s._a[c]==null;++c)s._a[c]=x[c]=b[c];for(;c<7;c++)s._a[c]=x[c]=s._a[c]==null?c===2?1:0:s._a[c];s._a[Ue]===24&&s._a[Ke]===0&&s._a[Yt]===0&&s._a[ln]===0&&(s._nextDay=!0,s._a[Ue]=0),s._d=(s._useUTC?Rr:m1).apply(null,x),I=s._useUTC?s._d.getUTCDay():s._d.getDay(),s._tzm!=null&&s._d.setUTCMinutes(s._d.getUTCMinutes()-s._tzm),s._nextDay&&(s._a[Ue]=24),s._w&&typeof s._w.d<"u"&&s._w.d!==I&&(S(s).weekdayMismatch=!0)}}function cp(s){var c,m,x,b,I,K,de,Ce,ze;c=s._w,c.GG!=null||c.W!=null||c.E!=null?(I=1,K=4,m=tr(c.GG,s._a[Pe],$r(qe(),1,4).year),x=tr(c.W,1),b=tr(c.E,1),(b<1||b>7)&&(Ce=!0)):(I=s._locale._week.dow,K=s._locale._week.doy,ze=$r(qe(),I,K),m=tr(c.gg,s._a[Pe],ze.year),x=tr(c.w,ze.week),c.d!=null?(b=c.d,(b<0||b>6)&&(Ce=!0)):c.e!=null?(b=c.e+I,(c.e<0||c.e>6)&&(Ce=!0)):b=I),x<1||x>cn(m,I,K)?S(s)._overflowWeeks=!0:Ce!=null?S(s)._overflowWeekday=!0:(de=fl(m,x,b,I,K),s._a[Pe]=de.year,s._dayOfYear=de.dayOfYear)}r.ISO_8601=function(){},r.RFC_2822=function(){};function Ko(s){if(s._f===r.ISO_8601){xl(s);return}if(s._f===r.RFC_2822){wl(s);return}s._a=[],S(s).empty=!0;var c=""+s._i,m,x,b,I,K,de=c.length,Ce=0,ze,yt;for(b=ve(s._f,s._locale).match(Q)||[],yt=b.length,m=0;m0&&S(s).unusedInput.push(K),c=c.slice(c.indexOf(x)+x.length),Ce+=x.length),ae[I]?(x?S(s).empty=!1:S(s).unusedTokens.push(I),Ir(I,x,s)):s._strict&&!x&&S(s).unusedTokens.push(I);S(s).charsLeftOver=de-Ce,c.length>0&&S(s).unusedInput.push(c),s._a[Ue]<=12&&S(s).bigHour===!0&&s._a[Ue]>0&&(S(s).bigHour=void 0),S(s).parsedDateParts=s._a.slice(0),S(s).meridiem=s._meridiem,s._a[Ue]=up(s._locale,s._a[Ue],s._meridiem),ze=S(s).era,ze!==null&&(s._a[Pe]=s._locale.erasConvertYear(ze,s._a[Pe])),Xo(s),Zo(s)}function up(s,c,m){var x;return m==null?c:s.meridiemHour!=null?s.meridiemHour(c,m):(s.isPM!=null&&(x=s.isPM(m),x&&c<12&&(c+=12),!x&&c===12&&(c=0)),c)}function dp(s){var c,m,x,b,I,K,de=!1,Ce=s._f.length;if(Ce===0){S(s).invalidFormat=!0,s._d=new Date(NaN);return}for(b=0;bthis?this:s:M()});function _l(s,c){var m,x;if(c.length===1&&o(c[0])&&(c=c[0]),!c.length)return qe();for(m=c[0],x=1;xthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ap(){if(!f(this._isDSTShifted))return this._isDSTShifted;var s={},c;return T(s,this),s=bl(s),s._a?(c=s._isUTC?w(s._a):qe(s._a),this._isDSTShifted=this.isValid()&&Sp(s._a,c.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Dp(){return this.isValid()?!this._isUTC:!1}function Ip(){return this.isValid()?this._isUTC:!1}function kl(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Np=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,Lp=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Vt(s,c){var m=s,x=null,b,I,K;return ji(s)?m={ms:s._milliseconds,d:s._days,M:s._months}:h(s)||!isNaN(+s)?(m={},c?m[c]=+s:m.milliseconds=+s):(x=Np.exec(s))?(b=x[1]==="-"?-1:1,m={y:0,d:re(x[pt])*b,h:re(x[Ue])*b,m:re(x[Ke])*b,s:re(x[Yt])*b,ms:re(Qo(x[ln]*1e3))*b}):(x=Lp.exec(s))?(b=x[1]==="-"?-1:1,m={y:Vn(x[2],b),M:Vn(x[3],b),w:Vn(x[4],b),d:Vn(x[5],b),h:Vn(x[6],b),m:Vn(x[7],b),s:Vn(x[8],b)}):m==null?m={}:typeof m=="object"&&("from"in m||"to"in m)&&(K=Rp(qe(m.from),qe(m.to)),m={},m.ms=K.milliseconds,m.M=K.months),I=new Mi(m),ji(s)&&l(s,"_locale")&&(I._locale=s._locale),ji(s)&&l(s,"_isValid")&&(I._isValid=s._isValid),I}Vt.fn=Mi.prototype,Vt.invalid=_p;function Vn(s,c){var m=s&&parseFloat(s.replace(",","."));return(isNaN(m)?0:m)*c}function Cl(s,c){var m={};return m.months=c.month()-s.month()+(c.year()-s.year())*12,s.clone().add(m.months,"M").isAfter(c)&&--m.months,m.milliseconds=+c-+s.clone().add(m.months,"M"),m}function Rp(s,c){var m;return s.isValid()&&c.isValid()?(c=es(c,s),s.isBefore(c)?m=Cl(s,c):(m=Cl(c,s),m.milliseconds=-m.milliseconds,m.months=-m.months),m):{milliseconds:0,months:0}}function El(s,c){return function(m,x){var b,I;return x!==null&&!isNaN(+x)&&(H(c,"moment()."+c+"(period, number) is deprecated. Please use moment()."+c+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),I=m,m=x,x=I),b=Vt(m,x),Pl(this,b,s),this}}function Pl(s,c,m,x){var b=c._milliseconds,I=Qo(c._days),K=Qo(c._months);s.isValid()&&(x=x??!0,K&&ll(s,fe(s,"Month")+K*m),I&&_e(s,"Date",fe(s,"Date")+I*m),b&&s._d.setTime(s._d.valueOf()+b*m),x&&r.updateOffset(s,I||K))}var $p=El(1,"add"),zp=El(-1,"subtract");function Ml(s){return typeof s=="string"||s instanceof String}function Bp(s){return U(s)||p(s)||Ml(s)||h(s)||Hp(s)||Fp(s)||s===null||s===void 0}function Fp(s){var c=a(s)&&!d(s),m=!1,x=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],b,I,K=x.length;for(b=0;bm.valueOf():m.valueOf()9999?me(m,c?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):B(Date.prototype.toISOString)?c?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",me(m,"Z")):me(m,c?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function n0(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var s="moment",c="",m,x,b,I;return this.isLocal()||(s=this.utcOffset()===0?"moment.utc":"moment.parseZone",c="Z"),m="["+s+'("]',x=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",b="-MM-DD[T]HH:mm:ss.SSS",I=c+'[")]',this.format(m+x+b+I)}function r0(s){s||(s=this.isUtc()?r.defaultFormatUtc:r.defaultFormat);var c=me(this,s);return this.localeData().postformat(c)}function i0(s,c){return this.isValid()&&(U(s)&&s.isValid()||qe(s).isValid())?Vt({to:this,from:s}).locale(this.locale()).humanize(!c):this.localeData().invalidDate()}function o0(s){return this.from(qe(),s)}function s0(s,c){return this.isValid()&&(U(s)&&s.isValid()||qe(s).isValid())?Vt({from:this,to:s}).locale(this.locale()).humanize(!c):this.localeData().invalidDate()}function a0(s){return this.to(qe(),s)}function jl(s){var c;return s===void 0?this._locale._abbr:(c=un(s),c!=null&&(this._locale=c),this)}var Tl=q("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(s){return s===void 0?this.localeData():this.locale(s)});function Ol(){return this._locale}var Oi=1e3,nr=60*Oi,Ai=60*nr,Al=(365*400+97)*24*Ai;function rr(s,c){return(s%c+c)%c}function Dl(s,c,m){return s<100&&s>=0?new Date(s+400,c,m)-Al:new Date(s,c,m).valueOf()}function Il(s,c,m){return s<100&&s>=0?Date.UTC(s+400,c,m)-Al:Date.UTC(s,c,m)}function l0(s){var c,m;if(s=Xe(s),s===void 0||s==="millisecond"||!this.isValid())return this;switch(m=this._isUTC?Il:Dl,s){case"year":c=m(this.year(),0,1);break;case"quarter":c=m(this.year(),this.month()-this.month()%3,1);break;case"month":c=m(this.year(),this.month(),1);break;case"week":c=m(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":c=m(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":c=m(this.year(),this.month(),this.date());break;case"hour":c=this._d.valueOf(),c-=rr(c+(this._isUTC?0:this.utcOffset()*nr),Ai);break;case"minute":c=this._d.valueOf(),c-=rr(c,nr);break;case"second":c=this._d.valueOf(),c-=rr(c,Oi);break}return this._d.setTime(c),r.updateOffset(this,!0),this}function c0(s){var c,m;if(s=Xe(s),s===void 0||s==="millisecond"||!this.isValid())return this;switch(m=this._isUTC?Il:Dl,s){case"year":c=m(this.year()+1,0,1)-1;break;case"quarter":c=m(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":c=m(this.year(),this.month()+1,1)-1;break;case"week":c=m(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":c=m(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":c=m(this.year(),this.month(),this.date()+1)-1;break;case"hour":c=this._d.valueOf(),c+=Ai-rr(c+(this._isUTC?0:this.utcOffset()*nr),Ai)-1;break;case"minute":c=this._d.valueOf(),c+=nr-rr(c,nr)-1;break;case"second":c=this._d.valueOf(),c+=Oi-rr(c,Oi)-1;break}return this._d.setTime(c),r.updateOffset(this,!0),this}function u0(){return this._d.valueOf()-(this._offset||0)*6e4}function d0(){return Math.floor(this.valueOf()/1e3)}function f0(){return new Date(this.valueOf())}function h0(){var s=this;return[s.year(),s.month(),s.date(),s.hour(),s.minute(),s.second(),s.millisecond()]}function p0(){var s=this;return{years:s.year(),months:s.month(),date:s.date(),hours:s.hours(),minutes:s.minutes(),seconds:s.seconds(),milliseconds:s.milliseconds()}}function m0(){return this.isValid()?this.toISOString():null}function g0(){return C(this)}function y0(){return g({},S(this))}function x0(){return S(this).overflow}function w0(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}J("N",0,0,"eraAbbr"),J("NN",0,0,"eraAbbr"),J("NNN",0,0,"eraAbbr"),J("NNNN",0,0,"eraName"),J("NNNNN",0,0,"eraNarrow"),J("y",["y",1],"yo","eraYear"),J("y",["yy",2],0,"eraYear"),J("y",["yyy",3],0,"eraYear"),J("y",["yyyy",4],0,"eraYear"),ce("N",ns),ce("NN",ns),ce("NNN",ns),ce("NNNN",T0),ce("NNNNN",O0),Te(["N","NN","NNN","NNNN","NNNNN"],function(s,c,m,x){var b=m._locale.erasParse(s,x,m._strict);b?S(m).era=b:S(m).invalidEra=s}),ce("y",Qt),ce("yy",Qt),ce("yyy",Qt),ce("yyyy",Qt),ce("yo",A0),Te(["y","yy","yyy","yyyy"],Pe),Te(["yo"],function(s,c,m,x){var b;m._locale._eraYearOrdinalRegex&&(b=s.match(m._locale._eraYearOrdinalRegex)),m._locale.eraYearOrdinalParse?c[Pe]=m._locale.eraYearOrdinalParse(s,b):c[Pe]=parseInt(s,10)});function b0(s,c){var m,x,b,I=this._eras||un("en")._eras;for(m=0,x=I.length;m=0)return I[x]}function _0(s,c){var m=s.since<=s.until?1:-1;return c===void 0?r(s.since).year():r(s.since).year()+(c-s.offset)*m}function S0(){var s,c,m,x=this.localeData().eras();for(s=0,c=x.length;sI&&(c=I),z0.call(this,s,c,m,x,b))}function z0(s,c,m,x,b){var I=fl(s,c,m,x,b),K=Rr(I.year,0,I.dayOfYear);return this.year(K.getUTCFullYear()),this.month(K.getUTCMonth()),this.date(K.getUTCDate()),this}J("Q",0,"Qo","quarter"),Le("quarter","Q"),D("quarter",7),ce("Q",Ae),Te("Q",function(s,c){c[$e]=(re(s)-1)*3});function B0(s){return s==null?Math.ceil((this.month()+1)/3):this.month((s-1)*3+this.month()%3)}J("D",["DD",2],"Do","date"),Le("date","D"),D("date",9),ce("D",De),ce("DD",De,be),ce("Do",function(s,c){return s?c._dayOfMonthOrdinalParse||c._ordinalParse:c._dayOfMonthOrdinalParseLenient}),Te(["D","DD"],pt),Te("Do",function(s,c){c[pt]=re(s.match(De)[0])});var Ll=ye("Date",!0);J("DDD",["DDDD",3],"DDDo","dayOfYear"),Le("dayOfYear","DDD"),D("dayOfYear",4),ce("DDD",Xt),ce("DDDD",tt),Te(["DDD","DDDD"],function(s,c,m){m._dayOfYear=re(s)});function F0(s){var c=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return s==null?c:this.add(s-c,"d")}J("m",["mm",2],0,"minute"),Le("minute","m"),D("minute",14),ce("m",De),ce("mm",De,be),Te(["m","mm"],Ke);var H0=ye("Minutes",!1);J("s",["ss",2],0,"second"),Le("second","s"),D("second",15),ce("s",De),ce("ss",De,be),Te(["s","ss"],Yt);var Y0=ye("Seconds",!1);J("S",0,0,function(){return~~(this.millisecond()/100)}),J(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),J(0,["SSS",3],0,"millisecond"),J(0,["SSSS",4],0,function(){return this.millisecond()*10}),J(0,["SSSSS",5],0,function(){return this.millisecond()*100}),J(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),J(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),J(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),J(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Le("millisecond","ms"),D("millisecond",16),ce("S",Xt,Ae),ce("SS",Xt,be),ce("SSS",Xt,tt);var kn,Rl;for(kn="SSSS";kn.length<=9;kn+="S")ce(kn,Qt);function V0(s,c){c[ln]=re(("0."+s)*1e3)}for(kn="S";kn.length<=9;kn+="S")Te(kn,V0);Rl=ye("Milliseconds",!1),J("z",0,0,"zoneAbbr"),J("zz",0,0,"zoneName");function U0(){return this._isUTC?"UTC":""}function W0(){return this._isUTC?"Coordinated Universal Time":""}var ie=V.prototype;ie.add=$p,ie.calendar=Up,ie.clone=Wp,ie.diff=Jp,ie.endOf=c0,ie.format=r0,ie.from=i0,ie.fromNow=o0,ie.to=s0,ie.toNow=a0,ie.get=je,ie.invalidAt=x0,ie.isAfter=Gp,ie.isBefore=Zp,ie.isBetween=qp,ie.isSame=Xp,ie.isSameOrAfter=Kp,ie.isSameOrBefore=Qp,ie.isValid=g0,ie.lang=Tl,ie.locale=jl,ie.localeData=Ol,ie.max=gp,ie.min=mp,ie.parsingFlags=y0,ie.set=Ve,ie.startOf=l0,ie.subtract=zp,ie.toArray=h0,ie.toObject=p0,ie.toDate=f0,ie.toISOString=t0,ie.inspect=n0,typeof Symbol<"u"&&Symbol.for!=null&&(ie[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ie.toJSON=m0,ie.toString=e0,ie.unix=d0,ie.valueOf=u0,ie.creationData=w0,ie.eraName=S0,ie.eraNarrow=k0,ie.eraAbbr=C0,ie.eraYear=E0,ie.year=dl,ie.isLeapYear=p1,ie.weekYear=D0,ie.isoWeekYear=I0,ie.quarter=ie.quarters=B0,ie.month=cl,ie.daysInMonth=d1,ie.week=ie.weeks=b1,ie.isoWeek=ie.isoWeeks=v1,ie.weeksInYear=R0,ie.weeksInWeekYear=$0,ie.isoWeeksInYear=N0,ie.isoWeeksInISOWeekYear=L0,ie.date=Ll,ie.day=ie.days=I1,ie.weekday=N1,ie.isoWeekday=L1,ie.dayOfYear=F0,ie.hour=ie.hours=Y1,ie.minute=ie.minutes=H0,ie.second=ie.seconds=Y0,ie.millisecond=ie.milliseconds=Rl,ie.utcOffset=Cp,ie.utc=Pp,ie.local=Mp,ie.parseZone=jp,ie.hasAlignedHourOffset=Tp,ie.isDST=Op,ie.isLocal=Dp,ie.isUtcOffset=Ip,ie.isUtc=kl,ie.isUTC=kl,ie.zoneAbbr=U0,ie.zoneName=W0,ie.dates=q("dates accessor is deprecated. Use date instead.",Ll),ie.months=q("months accessor is deprecated. Use month instead",cl),ie.years=q("years accessor is deprecated. Use year instead",dl),ie.zone=q("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Ep),ie.isDSTShifted=q("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Ap);function G0(s){return qe(s*1e3)}function Z0(){return qe.apply(null,arguments).parseZone()}function $l(s){return s}var Ie=A.prototype;Ie.calendar=F,Ie.longDateFormat=Be,Ie.invalidDate=He,Ie.ordinal=Ye,Ie.preparse=$l,Ie.postformat=$l,Ie.relativeTime=ue,Ie.pastFuture=dt,Ie.set=P,Ie.eras=b0,Ie.erasParse=v0,Ie.erasConvertYear=_0,Ie.erasAbbrRegex=M0,Ie.erasNameRegex=P0,Ie.erasNarrowRegex=j0,Ie.months=a1,Ie.monthsShort=l1,Ie.monthsParse=u1,Ie.monthsRegex=h1,Ie.monthsShortRegex=f1,Ie.week=g1,Ie.firstDayOfYear=w1,Ie.firstDayOfWeek=x1,Ie.weekdays=j1,Ie.weekdaysMin=O1,Ie.weekdaysShort=T1,Ie.weekdaysParse=D1,Ie.weekdaysRegex=R1,Ie.weekdaysShortRegex=$1,Ie.weekdaysMinRegex=z1,Ie.isPM=F1,Ie.meridiem=V1;function Ii(s,c,m,x){var b=un(),I=w().set(x,c);return b[m](I,s)}function zl(s,c,m){if(h(s)&&(c=s,s=void 0),s=s||"",c!=null)return Ii(s,c,m,"month");var x,b=[];for(x=0;x<12;x++)b[x]=Ii(s,x,m,"month");return b}function is(s,c,m,x){typeof s=="boolean"?(h(c)&&(m=c,c=void 0),c=c||""):(c=s,m=c,s=!1,h(c)&&(m=c,c=void 0),c=c||"");var b=un(),I=s?b._week.dow:0,K,de=[];if(m!=null)return Ii(c,(m+I)%7,x,"day");for(K=0;K<7;K++)de[K]=Ii(c,(K+I)%7,x,"day");return de}function q0(s,c){return zl(s,c,"months")}function X0(s,c){return zl(s,c,"monthsShort")}function K0(s,c,m){return is(s,c,m,"weekdays")}function Q0(s,c,m){return is(s,c,m,"weekdaysShort")}function J0(s,c,m){return is(s,c,m,"weekdaysMin")}Sn("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(s){var c=s%10,m=re(s%100/10)===1?"th":c===1?"st":c===2?"nd":c===3?"rd":"th";return s+m}}),r.lang=q("moment.lang is deprecated. Use moment.locale instead.",Sn),r.langData=q("moment.langData is deprecated. Use moment.localeData instead.",un);var dn=Math.abs;function em(){var s=this._data;return this._milliseconds=dn(this._milliseconds),this._days=dn(this._days),this._months=dn(this._months),s.milliseconds=dn(s.milliseconds),s.seconds=dn(s.seconds),s.minutes=dn(s.minutes),s.hours=dn(s.hours),s.months=dn(s.months),s.years=dn(s.years),this}function Bl(s,c,m,x){var b=Vt(c,m);return s._milliseconds+=x*b._milliseconds,s._days+=x*b._days,s._months+=x*b._months,s._bubble()}function tm(s,c){return Bl(this,s,c,1)}function nm(s,c){return Bl(this,s,c,-1)}function Fl(s){return s<0?Math.floor(s):Math.ceil(s)}function rm(){var s=this._milliseconds,c=this._days,m=this._months,x=this._data,b,I,K,de,Ce;return s>=0&&c>=0&&m>=0||s<=0&&c<=0&&m<=0||(s+=Fl(os(m)+c)*864e5,c=0,m=0),x.milliseconds=s%1e3,b=se(s/1e3),x.seconds=b%60,I=se(b/60),x.minutes=I%60,K=se(I/60),x.hours=K%24,c+=se(K/24),Ce=se(Hl(c)),m+=Ce,c-=Fl(os(Ce)),de=se(m/12),m%=12,x.days=c,x.months=m,x.years=de,this}function Hl(s){return s*4800/146097}function os(s){return s*146097/4800}function im(s){if(!this.isValid())return NaN;var c,m,x=this._milliseconds;if(s=Xe(s),s==="month"||s==="quarter"||s==="year")switch(c=this._days+x/864e5,m=this._months+Hl(c),s){case"month":return m;case"quarter":return m/3;case"year":return m/12}else switch(c=this._days+Math.round(os(this._months)),s){case"week":return c/7+x/6048e5;case"day":return c+x/864e5;case"hour":return c*24+x/36e5;case"minute":return c*1440+x/6e4;case"second":return c*86400+x/1e3;case"millisecond":return Math.floor(c*864e5)+x;default:throw new Error("Unknown unit "+s)}}function om(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+re(this._months/12)*31536e6:NaN}function fn(s){return function(){return this.as(s)}}var sm=fn("ms"),am=fn("s"),lm=fn("m"),cm=fn("h"),um=fn("d"),dm=fn("w"),fm=fn("M"),hm=fn("Q"),pm=fn("y");function mm(){return Vt(this)}function gm(s){return s=Xe(s),this.isValid()?this[s+"s"]():NaN}function Un(s){return function(){return this.isValid()?this._data[s]:NaN}}var ym=Un("milliseconds"),xm=Un("seconds"),wm=Un("minutes"),bm=Un("hours"),vm=Un("days"),_m=Un("months"),Sm=Un("years");function km(){return se(this.days()/7)}var hn=Math.round,ir={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function Cm(s,c,m,x,b){return b.relativeTime(c||1,!!m,s,x)}function Em(s,c,m,x){var b=Vt(s).abs(),I=hn(b.as("s")),K=hn(b.as("m")),de=hn(b.as("h")),Ce=hn(b.as("d")),ze=hn(b.as("M")),yt=hn(b.as("w")),pn=hn(b.as("y")),Cn=I<=m.ss&&["s",I]||I0,Cn[4]=x,Cm.apply(null,Cn)}function Pm(s){return s===void 0?hn:typeof s=="function"?(hn=s,!0):!1}function Mm(s,c){return ir[s]===void 0?!1:c===void 0?ir[s]:(ir[s]=c,s==="s"&&(ir.ss=c-1),!0)}function jm(s,c){if(!this.isValid())return this.localeData().invalidDate();var m=!1,x=ir,b,I;return typeof s=="object"&&(c=s,s=!1),typeof s=="boolean"&&(m=s),typeof c=="object"&&(x=Object.assign({},ir,c),c.s!=null&&c.ss==null&&(x.ss=c.s-1)),b=this.localeData(),I=Em(this,!m,x,b),m&&(I=b.pastFuture(+this,I)),b.postformat(I)}var ss=Math.abs;function or(s){return(s>0)-(s<0)||+s}function Ni(){if(!this.isValid())return this.localeData().invalidDate();var s=ss(this._milliseconds)/1e3,c=ss(this._days),m=ss(this._months),x,b,I,K,de=this.asSeconds(),Ce,ze,yt,pn;return de?(x=se(s/60),b=se(x/60),s%=60,x%=60,I=se(m/12),m%=12,K=s?s.toFixed(3).replace(/\.?0+$/,""):"",Ce=de<0?"-":"",ze=or(this._months)!==or(de)?"-":"",yt=or(this._days)!==or(de)?"-":"",pn=or(this._milliseconds)!==or(de)?"-":"",Ce+"P"+(I?ze+I+"Y":"")+(m?ze+m+"M":"")+(c?yt+c+"D":"")+(b||x||s?"T":"")+(b?pn+b+"H":"")+(x?pn+x+"M":"")+(s?pn+K+"S":"")):"P0D"}var Oe=Mi.prototype;Oe.isValid=vp,Oe.abs=em,Oe.add=tm,Oe.subtract=nm,Oe.as=im,Oe.asMilliseconds=sm,Oe.asSeconds=am,Oe.asMinutes=lm,Oe.asHours=cm,Oe.asDays=um,Oe.asWeeks=dm,Oe.asMonths=fm,Oe.asQuarters=hm,Oe.asYears=pm,Oe.valueOf=om,Oe._bubble=rm,Oe.clone=mm,Oe.get=gm,Oe.milliseconds=ym,Oe.seconds=xm,Oe.minutes=wm,Oe.hours=bm,Oe.days=vm,Oe.weeks=km,Oe.months=_m,Oe.years=Sm,Oe.humanize=jm,Oe.toISOString=Ni,Oe.toString=Ni,Oe.toJSON=Ni,Oe.locale=jl,Oe.localeData=Ol,Oe.toIsoString=q("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Ni),Oe.lang=Tl,J("X",0,0,"unix"),J("x",0,0,"valueOf"),ce("x",Jt),ce("X",Or),Te("X",function(s,c,m){m._d=new Date(parseFloat(s)*1e3)}),Te("x",function(s,c,m){m._d=new Date(re(s))});//! moment.js +return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.unix=G0,r.months=q0,r.isDate=p,r.locale=Sn,r.invalid=M,r.duration=Vt,r.isMoment=U,r.weekdays=K0,r.parseZone=Z0,r.localeData=un,r.isDuration=ji,r.monthsShort=X0,r.weekdaysMin=J0,r.defineLocale=Go,r.updateLocale=Z1,r.locales=q1,r.weekdaysShort=Q0,r.normalizeUnits=Xe,r.relativeTimeRounding=Pm,r.relativeTimeThreshold=Mm,r.calendarFormat=Vp,r.prototype=ie,r.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},r})})(bd);var r2=bd.exports;const vd=ma(r2),i2=({text:e,type:t,sourceLink:n,date:r})=>u.jsxs(z,{direction:"column",children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsx(z,{align:"center",direction:"row",children:u.jsx(Mr,{type:t})}),n&&u.jsx(Qn,{href:`${n}${n!=null&&n.includes("?")?"&":"?"}open=system`,onClick:i=>i.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),u.jsx(Hs,{"data-testid":"episode-description",children:e}),u.jsxs(z,{align:"center",direction:"row",justify:"flex-start",children:[u.jsx(z,{align:"center",direction:"row",justify:"flex-start",children:!!r&&u.jsx($n,{children:vd.unix(r).fromNow()})}),n&&u.jsxs(Qn,{href:n,onClick:i=>i.stopPropagation(),target:"_blank",children:[u.jsx(wd,{}),u.jsx(o2,{children:n})]})]})]}),o2=Y(Fe)` max-width: 150px; overflow: hidden; text-overflow: ellipsis; @@ -442,7 +442,7 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni font-size: 12px; font-weight: 400; line-height: 18px; -`,o2=({title:e,imageUrl:t,name:n,sourceLink:r,date:i})=>u.jsxs(z,{grow:1,shrink:1,children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsxs(z,{align:"center",direction:"row",children:[u.jsx(s2,{children:u.jsx(Gt,{rounded:!0,size:64,src:t||"",type:"person"})}),(e||n)&&u.jsx(a2,{children:e||n})]}),!r&&u.jsx(Qn,{href:`${r}${r!=null&&r.includes("?")?"&":"?"}open=system`,onClick:o=>o.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),u.jsx(z,{align:"center",direction:"row",justify:"flex-start",ml:6,mt:9,children:!!i&&u.jsx($n,{children:vd.unix(i).fromNow()})})]}),s2=Y(z)` +`,s2=({title:e,imageUrl:t,name:n,sourceLink:r,date:i})=>u.jsxs(z,{grow:1,shrink:1,children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsxs(z,{align:"center",direction:"row",children:[u.jsx(a2,{children:u.jsx(Gt,{rounded:!0,size:64,src:t||"",type:"person"})}),(e||n)&&u.jsx(l2,{children:e||n})]}),!r&&u.jsx(Qn,{href:`${r}${r!=null&&r.includes("?")?"&":"?"}open=system`,onClick:o=>o.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),u.jsx(z,{align:"center",direction:"row",justify:"flex-start",ml:6,mt:9,children:!!i&&u.jsx($n,{children:vd.unix(i).fromNow()})})]}),a2=Y(z)` img { width: 64px; height: 64px; @@ -450,14 +450,14 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni object-fit: cover; } margin-right: 16px; -`,a2=Y(z)` +`,l2=Y(z)` color: ${N.white}; font-family: Barlow; font-size: 13px; font-style: normal; font-weight: 600; line-height: 17px; -`,l2=({text:e,imageUrl:t,date:n,twitterHandle:r,name:i,verified:o,sourceLink:a})=>u.jsxs(z,{direction:"column",children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsxs(z,{align:"center",direction:"row",pr:16,children:[u.jsx(c2,{children:u.jsx(Gt,{rounded:!0,size:27,src:t||"",type:"person"})}),u.jsxs(z,{children:[u.jsxs(u2,{align:"center",direction:"row",children:[i,o&&u.jsx("div",{className:"verification",children:u.jsx("img",{alt:"verified",src:"verified_twitter.svg"})})]}),r&&u.jsxs(d2,{children:["@",r]})]})]}),a&&u.jsx(Qn,{href:`${a}${a!=null&&a.includes("?")?"&":"?"}open=system`,onClick:l=>l.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),u.jsxs(z,{grow:1,shrink:1,children:[u.jsx(f2,{"data-testid":"episode-description",children:e}),u.jsx(z,{"data-testid":"date-text",direction:"row",justify:"flex-start",children:!!n&&u.jsx($n,{children:si.unix(n).fromNow()})})]})]}),c2=Y(z)` +`,c2=({text:e,imageUrl:t,date:n,twitterHandle:r,name:i,verified:o,sourceLink:a})=>u.jsxs(z,{direction:"column",children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsxs(z,{align:"center",direction:"row",pr:16,children:[u.jsx(u2,{children:u.jsx(Gt,{rounded:!0,size:27,src:t||"",type:"person"})}),u.jsxs(z,{children:[u.jsxs(d2,{align:"center",direction:"row",children:[i,o&&u.jsx("div",{className:"verification",children:u.jsx("img",{alt:"verified",src:"verified_twitter.svg"})})]}),r&&u.jsxs(f2,{children:["@",r]})]})]}),a&&u.jsx(Qn,{href:`${a}${a!=null&&a.includes("?")?"&":"?"}open=system`,onClick:l=>l.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),u.jsxs(z,{grow:1,shrink:1,children:[u.jsx(h2,{"data-testid":"episode-description",children:e}),u.jsx(z,{"data-testid":"date-text",direction:"row",justify:"flex-start",children:!!n&&u.jsx($n,{children:si.unix(n).fromNow()})})]})]}),u2=Y(z)` img { width: 64px; height: 64px; @@ -465,7 +465,7 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni object-fit: cover; } margin-right: 16px; -`,u2=Y(z)` +`,d2=Y(z)` color: ${N.white}; font-family: Barlow; font-size: 12px; @@ -476,7 +476,7 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni .verification { margin-left: 4px; } -`,d2=Y(z)` +`,f2=Y(z)` color: ${N.GRAY7}; font-family: Barlow; font-size: 11px; @@ -484,7 +484,7 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni font-weight: 400; line-height: normal; letter-spacing: 0.2px; -`,f2=Y(z)` +`,h2=Y(z)` color: ${N.white}; font-family: Barlow; font-size: 13px; @@ -498,7 +498,7 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni -webkit-box-orient: vertical; overflow: hidden; white-space: normal; -`,h2=Y(z).attrs({direction:"column"})` +`,p2=Y(z).attrs({direction:"column"})` padding: 24px; cursor: pointer; border-top: 1px solid #101317; @@ -518,7 +518,7 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni .player-controls { margin-left: 4px; } -`,ka=({boostCount:e,date:t,episodeTitle:n,isSelectedView:r=!1,imageUrl:i,showTitle:o,type:a,text:l,name:d,sourceLink:f,verified:h=!1,twitterHandle:p,className:y="episode-wrapper",onClick:g})=>{const w=vt(T=>T.currentSearch),S=gn(String(a==="show"?o:n),w),k=gn(String(l),w),C=gn(String(d),w),O=gn(String(a==="show"?"":o),w),R=["Tweet","person","guest","topic","document"];return a?u.jsx(h2,{className:y,onClick:g,children:R.includes(a)?u.jsxs(u.Fragment,{children:[a==="topic"&&u.jsx(p2,{children:u.jsxs(z,{grow:1,shrink:1,children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsxs(z,{align:"center",direction:"row",pr:16,children:[u.jsx(Kx,{}),u.jsx("p",{children:O})]}),f&&u.jsx(Qn,{href:`${f}${f!=null&&f.includes("?")?"&":"?"}open=system`,onClick:T=>T.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),u.jsx(z,{align:"center",direction:"row",justify:"flex-start",mt:9,children:!!t&&u.jsx($n,{children:si.unix(t).fromNow()})})]})}),["person","guest"].includes(a)&&u.jsx(o2,{date:t,imageUrl:i,name:C||"",sourceLink:f||"",title:o||""}),["image"].includes(a)&&u.jsx(Jx,{date:t,imageUrl:f,name:C||"",sourceLink:f||""}),a==="Tweet"&&u.jsx(l2,{date:t,imageUrl:i,name:C||"",sourceLink:f||"",text:k||"",twitterHandle:p,verified:h}),a==="document"&&u.jsx(r2,{date:t,sourceLink:f||"",text:k||"",type:a})]}):u.jsxs(z,{align:"center",direction:"row",justify:"center",children:[!r&&i&&u.jsx(z,{align:"center",pr:16,children:u.jsx(Gt,{size:80,src:i,type:a||""})}),u.jsxs(z,{grow:1,shrink:1,children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsx(z,{align:"center",direction:"row",children:a&&u.jsx(Mr,{type:a})}),f&&u.jsx(Qn,{href:`${f}${f!=null&&f.includes("?")?"&":"?"}open=system`,onClick:T=>T.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),C&&u.jsx(Hs,{"data-testid":"episode-name",children:C}),u.jsx(Hs,{"data-testid":"episode-description",children:S}),u.jsxs(z,{align:"center",direction:"row",justify:"flex-start",children:[!!t&&u.jsx($n,{children:si.unix(t).fromNow()}),!!O&&u.jsx(m2,{children:O}),!r&&e>0&&u.jsx(z,{style:{marginLeft:"auto"},children:u.jsx(Sa,{amt:e})})]})]})]})}):null},Hs=Y(z)` +`,ka=({boostCount:e,date:t,episodeTitle:n,isSelectedView:r=!1,imageUrl:i,showTitle:o,type:a,text:l,name:d,sourceLink:f,verified:h=!1,twitterHandle:p,className:y="episode-wrapper",onClick:g})=>{const w=vt(T=>T.currentSearch),S=gn(String(a==="show"?o:n),w),k=gn(String(l),w),C=gn(String(d),w),O=gn(String(a==="show"?"":o),w),L=["Tweet","person","guest","topic","document"];return a?u.jsx(p2,{className:y,onClick:g,children:L.includes(a)?u.jsxs(u.Fragment,{children:[a==="topic"&&u.jsx(m2,{children:u.jsxs(z,{grow:1,shrink:1,children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsxs(z,{align:"center",direction:"row",pr:16,children:[u.jsx(Qx,{}),u.jsx("p",{children:O})]}),f&&u.jsx(Qn,{href:`${f}${f!=null&&f.includes("?")?"&":"?"}open=system`,onClick:T=>T.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),u.jsx(z,{align:"center",direction:"row",justify:"flex-start",mt:9,children:!!t&&u.jsx($n,{children:si.unix(t).fromNow()})})]})}),["person","guest"].includes(a)&&u.jsx(s2,{date:t,imageUrl:i,name:C||"",sourceLink:f||"",title:o||""}),["image"].includes(a)&&u.jsx(e2,{date:t,imageUrl:f,name:C||"",sourceLink:f||""}),a==="Tweet"&&u.jsx(c2,{date:t,imageUrl:i,name:C||"",sourceLink:f||"",text:k||"",twitterHandle:p,verified:h}),a==="document"&&u.jsx(i2,{date:t,sourceLink:f||"",text:k||"",type:a})]}):u.jsxs(z,{align:"center",direction:"row",justify:"center",children:[!r&&i&&u.jsx(z,{align:"center",pr:16,children:u.jsx(Gt,{size:80,src:i,type:a||""})}),u.jsxs(z,{grow:1,shrink:1,children:[u.jsxs(z,{align:"center",direction:"row",justify:"space-between",children:[u.jsx(z,{align:"center",direction:"row",children:a&&u.jsx(Mr,{type:a})}),f&&u.jsx(Qn,{href:`${f}${f!=null&&f.includes("?")?"&":"?"}open=system`,onClick:T=>T.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),C&&u.jsx(Hs,{"data-testid":"episode-name",children:C}),u.jsx(Hs,{"data-testid":"episode-description",children:S}),u.jsxs(z,{align:"center",direction:"row",justify:"flex-start",children:[!!t&&u.jsx($n,{children:si.unix(t).fromNow()}),!!O&&u.jsx(g2,{children:O}),!r&&e>0&&u.jsx(z,{style:{marginLeft:"auto"},children:u.jsx(Sa,{amt:e})})]})]})]})}):null},Hs=Y(z)` font-family: Barlow; font-size: 13px; font-style: normal; @@ -544,7 +544,7 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni margin-right: 8px; flex-shrink: 0; letter-spacing: 0.2pt; -`,p2=Y.div` +`,m2=Y.div` display: flex; flex-direction: row; align-items: center; @@ -572,7 +572,7 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni line-height: 24px; margin: 0; } -`,m2=Y($n)` +`,g2=Y($n)` align-items: center; flex-shrink: 1; overflow: hidden; @@ -613,13 +613,13 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni display: flex; gap: 5px; align-items: center; -`,g2=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("g",{id:"Menu icons",children:u.jsx("path",{id:"Subtract",d:"M9.56745 16.1438C9.44134 16.1438 9.31606 16.1269 9.19162 16.0931C9.06718 16.0595 8.95315 16.0133 8.84954 15.9546C8.2587 15.602 7.64141 15.3367 6.99766 15.159C6.35405 14.981 5.68822 14.8921 5.00016 14.8921C4.49169 14.8921 3.99225 14.9484 3.50183 15.061C3.01141 15.1738 2.53863 15.3397 2.0835 15.5588C1.78655 15.6954 1.50398 15.6751 1.23579 15.4977C0.967593 15.3205 0.833496 15.0695 0.833496 14.7446V5.71272C0.833496 5.53313 0.881066 5.36723 0.976204 5.21501C1.0712 5.06279 1.20315 4.95195 1.37204 4.88251C1.93607 4.60792 2.52391 4.40202 3.13558 4.2648C3.74725 4.12744 4.36877 4.05876 5.00016 4.05876C5.811 4.05876 6.60051 4.17362 7.3687 4.40334C8.1369 4.63306 8.87516 4.95626 9.5835 5.37292V14.9433C10.2866 14.4989 11.0283 14.1709 11.8087 13.9594C12.5891 13.7479 13.3752 13.6421 14.1668 13.6421C14.6454 13.6421 15.0816 13.6717 15.4754 13.731C15.869 13.7904 16.3249 13.9006 16.8431 14.0619C16.9018 14.078 16.9566 14.0794 17.0075 14.066C17.0581 14.0526 17.0835 14.0085 17.0835 13.9338V4.5748C17.2277 4.61758 17.3684 4.66515 17.5058 4.71751C17.643 4.76987 17.7768 4.83556 17.9072 4.91459C18.0493 4.98404 18.1559 5.08549 18.2268 5.21897C18.2979 5.35258 18.3335 5.49577 18.3335 5.64855V14.7285C18.3335 15.0534 18.1954 15.3031 17.9191 15.4777C17.643 15.6524 17.3484 15.6741 17.0354 15.5427C16.5856 15.329 16.1196 15.1671 15.6372 15.0571C15.1549 14.9471 14.6647 14.8921 14.1668 14.8921C13.4735 14.8921 12.7996 14.981 12.1452 15.159C11.4909 15.3367 10.8683 15.602 10.2775 15.9546C10.1738 16.0133 10.0611 16.0595 9.93933 16.0931C9.81752 16.1269 9.69357 16.1438 9.56745 16.1438ZM11.8895 12.2319C11.7613 12.3462 11.6227 12.3692 11.4737 12.3008C11.3247 12.2324 11.2502 12.1132 11.2502 11.9433V5.46751C11.2502 5.41723 11.2606 5.36778 11.2814 5.31917C11.3022 5.27056 11.3309 5.22813 11.3672 5.19188L14.7645 1.79438C14.8927 1.66619 15.0335 1.63549 15.1868 1.7023C15.3402 1.76897 15.4168 1.89153 15.4168 2.07001V8.8873C15.4168 8.95133 15.4043 9.00633 15.3791 9.0523C15.354 9.09827 15.3233 9.13945 15.287 9.17584L11.8895 12.2319Z",fill:"currentColor"})})}),_d=Y(z)` +`,y2=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("g",{id:"Menu icons",children:u.jsx("path",{id:"Subtract",d:"M9.56745 16.1438C9.44134 16.1438 9.31606 16.1269 9.19162 16.0931C9.06718 16.0595 8.95315 16.0133 8.84954 15.9546C8.2587 15.602 7.64141 15.3367 6.99766 15.159C6.35405 14.981 5.68822 14.8921 5.00016 14.8921C4.49169 14.8921 3.99225 14.9484 3.50183 15.061C3.01141 15.1738 2.53863 15.3397 2.0835 15.5588C1.78655 15.6954 1.50398 15.6751 1.23579 15.4977C0.967593 15.3205 0.833496 15.0695 0.833496 14.7446V5.71272C0.833496 5.53313 0.881066 5.36723 0.976204 5.21501C1.0712 5.06279 1.20315 4.95195 1.37204 4.88251C1.93607 4.60792 2.52391 4.40202 3.13558 4.2648C3.74725 4.12744 4.36877 4.05876 5.00016 4.05876C5.811 4.05876 6.60051 4.17362 7.3687 4.40334C8.1369 4.63306 8.87516 4.95626 9.5835 5.37292V14.9433C10.2866 14.4989 11.0283 14.1709 11.8087 13.9594C12.5891 13.7479 13.3752 13.6421 14.1668 13.6421C14.6454 13.6421 15.0816 13.6717 15.4754 13.731C15.869 13.7904 16.3249 13.9006 16.8431 14.0619C16.9018 14.078 16.9566 14.0794 17.0075 14.066C17.0581 14.0526 17.0835 14.0085 17.0835 13.9338V4.5748C17.2277 4.61758 17.3684 4.66515 17.5058 4.71751C17.643 4.76987 17.7768 4.83556 17.9072 4.91459C18.0493 4.98404 18.1559 5.08549 18.2268 5.21897C18.2979 5.35258 18.3335 5.49577 18.3335 5.64855V14.7285C18.3335 15.0534 18.1954 15.3031 17.9191 15.4777C17.643 15.6524 17.3484 15.6741 17.0354 15.5427C16.5856 15.329 16.1196 15.1671 15.6372 15.0571C15.1549 14.9471 14.6647 14.8921 14.1668 14.8921C13.4735 14.8921 12.7996 14.981 12.1452 15.159C11.4909 15.3367 10.8683 15.602 10.2775 15.9546C10.1738 16.0133 10.0611 16.0595 9.93933 16.0931C9.81752 16.1269 9.69357 16.1438 9.56745 16.1438ZM11.8895 12.2319C11.7613 12.3462 11.6227 12.3692 11.4737 12.3008C11.3247 12.2324 11.2502 12.1132 11.2502 11.9433V5.46751C11.2502 5.41723 11.2606 5.36778 11.2814 5.31917C11.3022 5.27056 11.3309 5.22813 11.3672 5.19188L14.7645 1.79438C14.8927 1.66619 15.0335 1.63549 15.1868 1.7023C15.3402 1.76897 15.4168 1.89153 15.4168 2.07001V8.8873C15.4168 8.95133 15.4043 9.00633 15.3791 9.0523C15.354 9.09827 15.3233 9.13945 15.287 9.17584L11.8895 12.2319Z",fill:"currentColor"})})}),_d=Y(z)` overflow-y: auto; overflow-x: hidden; background: ${N.body}; -`,Ca=e=>{const{properties:t,ref_id:n}=e;return{boost:(t==null?void 0:t.boost)||0,children:[],x:0,y:0,z:0,edge_count:e.edge_count||0,hidden:!1,colors:[],date:t==null?void 0:t.date,description:"",episode_title:(t==null?void 0:t.episode_title)||"",hosts:[],guests:[],id:"",image_url:t==null?void 0:t.image_url,sender_pic:"",sender_alias:"",message_content:"",keyword:!1,label:"",source_link:(t==null?void 0:t.source_link)||"",link:(t==null?void 0:t.link)||"",name:e.name,node_type:e.node_type,ref_id:n,scale:1,show_title:(t==null?void 0:t.show_title)||"",text:t==null?void 0:t.text,timestamp:"",topics:[],type:(t==null?void 0:t.type)||"",weight:0,tweet_id:t==null?void 0:t.tweet_id,posted_by:void 0,twitter_handle:t==null?void 0:t.twitter_handle,profile_picture:"",verified:t==null?void 0:t.verified,unique_id:"",properties:{},media_url:""}},y2=({sourceIds:e})=>{const t=j.useRef(null),[n,r]=j.useState(!1),{dataInitial:i}=zt(h=>h),o=pi(),a=j.useCallback(h=>{o(h)},[o]),l=()=>r(!n),d=(i==null?void 0:i.nodes.filter(h=>e.includes(h.ref_id)))||[],f=n?d:[...d].slice(0,3);return u.jsxs(v2,{children:[u.jsxs(b2,{className:"heading",direction:"row",children:[u.jsx("div",{className:"heading__icon",children:u.jsx(g2,{})}),u.jsx("span",{children:"Sources"}),u.jsx("span",{className:"heading__count",children:e.length})]}),u.jsxs(_d,{ref:t,id:"search-result-list",shrink:1,children:[f.map((h,p)=>{const y=Ca(h),{image_url:g,date:w,boost:_,type:S,episode_title:k,show_title:C,node_type:P,text:O,source_link:R,link:T,name:V,verified:U=!1,twitter_handle:W}=y||{};return u.jsx(ka,{boostCount:_||0,date:w||0,episodeTitle:_r(k),imageUrl:g||"",link:T,name:V||"",onClick:()=>{a(h)},showTitle:_r(C),sourceLink:R,text:O||"",twitterHandle:W,type:P||S,verified:U},p.toString())}),u.jsx(w2,{align:"center",background:"BG1",direction:"row",justify:"flex-end",children:d.length>3?u.jsx(Pt,{endIcon:n?u.jsx(_a,{}):u.jsx(md,{}),onClick:l,size:"medium",children:n?"Hide":"Show all"}):null})]})]})},x2=j.memo(y2),w2=Y(z)` +`,Ca=e=>{const{properties:t,ref_id:n}=e;return{boost:(t==null?void 0:t.boost)||0,children:[],x:0,y:0,z:0,edge_count:e.edge_count||0,hidden:!1,colors:[],date:t==null?void 0:t.date,description:"",episode_title:(t==null?void 0:t.episode_title)||"",hosts:[],guests:[],id:"",image_url:t==null?void 0:t.image_url,sender_pic:"",sender_alias:"",message_content:"",keyword:!1,label:"",source_link:(t==null?void 0:t.source_link)||"",link:(t==null?void 0:t.link)||"",name:e.name,node_type:e.node_type,ref_id:n,scale:1,show_title:(t==null?void 0:t.show_title)||"",text:t==null?void 0:t.text,timestamp:"",topics:[],type:(t==null?void 0:t.type)||"",weight:0,tweet_id:t==null?void 0:t.tweet_id,posted_by:void 0,twitter_handle:t==null?void 0:t.twitter_handle,profile_picture:"",verified:t==null?void 0:t.verified,unique_id:"",properties:{},media_url:""}},x2=({sourceIds:e})=>{const t=j.useRef(null),[n,r]=j.useState(!1),{dataInitial:i}=zt(h=>h),o=pi(),a=j.useCallback(h=>{o(h)},[o]),l=()=>r(!n),d=(i==null?void 0:i.nodes.filter(h=>e.includes(h.ref_id)))||[],f=n?d:[...d].slice(0,3);return u.jsxs(_2,{children:[u.jsxs(v2,{className:"heading",direction:"row",children:[u.jsx("div",{className:"heading__icon",children:u.jsx(y2,{})}),u.jsx("span",{children:"Sources"}),u.jsx("span",{className:"heading__count",children:e.length})]}),u.jsxs(_d,{ref:t,id:"search-result-list",shrink:1,children:[f.map((h,p)=>{const y=Ca(h),{image_url:g,date:w,boost:_,type:S,episode_title:k,show_title:C,node_type:M,text:O,source_link:L,link:T,name:V,verified:U=!1,twitter_handle:W}=y||{};return u.jsx(ka,{boostCount:_||0,date:w||0,episodeTitle:_r(k),imageUrl:g||"",link:T,name:V||"",onClick:()=>{a(h)},showTitle:_r(C),sourceLink:L,text:O||"",twitterHandle:W,type:M||S,verified:U},p.toString())}),u.jsx(b2,{align:"center",background:"BG1",direction:"row",justify:"flex-end",children:d.length>3?u.jsx(Pt,{endIcon:n?u.jsx(_a,{}):u.jsx(md,{}),onClick:l,size:"medium",children:n?"Hide":"Show all"}):null})]})]})},w2=j.memo(x2),b2=Y(z)` flex: 0 0 86px; -`,b2=Y(z)` +`,v2=Y(z)` &.heading { font-weight: 600; color: ${N.white}; @@ -636,24 +636,24 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni margin-left: 16px; } } -`,v2=Y(z)` +`,_2=Y(z)` padding: 24px; border-top: 1px solid ${N.black}; -`,_2=Y(z).attrs({direction:"column"})` +`,S2=Y(z).attrs({direction:"column"})` padding: 1.5rem; border-top: 1px solid #101317; background: ${N.BG1}; gap: 1rem; -`,S2=Y(Fe)` +`,k2=Y(Fe)` font-size: 20px; font-weight: 600; -`,k2=Y(Fe)` +`,C2=Y(Fe)` font-size: 14px; font-weight: 400; line-height: 19.6px; -`,C2=({question:e,response:t})=>{const[n,r]=j.useState("");return j.useEffect(()=>{const{answer:i}=t;let o;if(i&&n.length{r(i.slice(0,n.length+1))},10),()=>clearTimeout(o)},[t,n]),u.jsxs(u.Fragment,{children:[t.answerLoading?u.jsx(Yx,{}):u.jsxs(_2,{children:[u.jsx(S2,{children:e}),u.jsx(k2,{children:n})]}),t.sourcesLoading?u.jsx(Fs,{count:1}):u.jsx(x2,{sourceIds:t.sources||[]}),t.questionsLoading?u.jsx(Fs,{count:1}):u.jsx(Wx,{questions:t.questions||[]})]})},E2=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"browse_gallery",children:[u.jsx("mask",{id:"mask0_1360_27257",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1360_27257)",children:u.jsx("path",{id:"browse_gallery_2",d:"M11.8 15.8442L12.8442 14.8L9.74998 11.7026V7.25003H8.25003V12.2942L11.8 15.8442ZM18 19.9615V18.3C19.2333 17.7167 20.2083 16.8583 20.925 15.725C21.6417 14.5917 22 13.35 22 12C22 10.65 21.6417 9.40834 20.925 8.27501C20.2083 7.14167 19.2333 6.28334 18 5.70001V4.03851C19.6628 4.67184 20.9952 5.71318 21.9971 7.16253C22.999 8.61188 23.5 10.2244 23.5 12C23.5 13.7756 22.999 15.3881 21.9971 16.8375C20.9952 18.2868 19.6628 19.3282 18 19.9615ZM9.00055 20.5C7.8207 20.5 6.71539 20.2769 5.68463 19.8307C4.65386 19.3846 3.75514 18.7782 2.98848 18.0115C2.22181 17.2449 1.61541 16.3463 1.16927 15.3159C0.723092 14.2855 0.5 13.1804 0.5 12.0006C0.5 10.8207 0.723083 9.7154 1.16925 8.68463C1.6154 7.65386 2.2218 6.75515 2.98845 5.98848C3.75512 5.22183 4.65365 4.61543 5.68405 4.16928C6.71445 3.72311 7.81957 3.50003 8.99942 3.50003C10.1793 3.50003 11.2846 3.72311 12.3154 4.16928C13.3461 4.61543 14.2448 5.22183 15.0115 5.98848C15.7782 6.75515 16.3846 7.65368 16.8307 8.68408C17.2769 9.71448 17.5 10.8196 17.5 11.9995C17.5 13.1793 17.2769 14.2846 16.8307 15.3154C16.3846 16.3461 15.7782 17.2449 15.0115 18.0115C14.2448 18.7782 13.3463 19.3846 12.3159 19.8307C11.2855 20.2769 10.1804 20.5 9.00055 20.5ZM9 19C10.95 19 12.6042 18.3208 13.9625 16.9625C15.3208 15.6042 16 13.95 16 12C16 10.05 15.3208 8.39584 13.9625 7.03751C12.6042 5.67917 10.95 5.00001 9 5.00001C7.05 5.00001 5.39583 5.67917 4.0375 7.03751C2.67917 8.39584 2 10.05 2 12C2 13.95 2.67917 15.6042 4.0375 16.9625C5.39583 18.3208 7.05 19 9 19Z",fill:"currentColor"})})]})}),P2=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",children:[u.jsx("mask",{id:"mask0_2638_2680",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_2638_2680)",children:u.jsx("path",{d:"M9.99732 16C9.90858 16 9.82421 15.985 9.74419 15.9551C9.66418 15.9252 9.5909 15.8765 9.52435 15.8091L6.18835 12.4277C6.06278 12.3004 6 12.1406 6 11.9483C6 11.7559 6.06278 11.5961 6.18835 11.4689C6.32145 11.3315 6.48099 11.2648 6.66697 11.2686C6.85295 11.2724 7.00873 11.3392 7.13429 11.4689L9.32114 13.674V4.68539C9.32114 4.49306 9.3864 4.33074 9.51692 4.19845C9.64744 4.06615 9.80758 4 9.99732 4C10.1871 4 10.3472 4.06615 10.4777 4.19845C10.6082 4.33074 10.6735 4.49306 10.6735 4.68539V13.674L12.849 11.4689C12.9845 11.3315 13.1447 11.2629 13.3294 11.2629C13.5143 11.2629 13.6744 11.3315 13.8099 11.4689C13.9378 11.6062 14.0012 11.7685 14 11.9558C13.9988 12.1431 13.9354 12.3004 13.8099 12.4277L10.4738 15.8091C10.4073 15.8765 10.3334 15.9252 10.2522 15.9551C10.171 15.985 10.0861 16 9.99732 16Z",fill:"currentColor"})})]}),M2=({isSearchResult:e})=>{const t=j.useRef(null),n=e?80:100,{setSelectedTimestamp:r,nextPage:i}=zt(R=>R),o=pi(),{currentSearch:a,setSidebarOpen:l,setRelevanceSelected:d}=vt(R=>R),[f,h]=j.useState(0),[p,y]=j.useState(0),g=Zu(),_=f*n+n,S=g&&g.length>0?g.length-1>_:!1,k=Ey("sm","down"),C=j.useCallback(R=>{Bg(R),r(R),d(!0),o(R),k&&l(!1)},[o,d,l,r,k]),P=()=>{i(),S&&(h(f+1),y(R=>R+1))},O=j.useMemo(()=>{if(g){const R=[...g].sort((T,V)=>(V.date||0)-(T.date||0));return a&&R.sort((T,V)=>{const U=T.node_type==="topic"&&T.name.toLowerCase()===a.toLowerCase()?1:0;return(V.node_type==="topic"&&V.name.toLowerCase()===a.toLowerCase()?1:0)-U}),R.slice(0,_)}return[]},[g,a,_]);return u.jsx(u.Fragment,{children:u.jsxs(_d,{ref:t,id:"search-result-list",shrink:1,children:[(O??[]).map((R,T)=>{const V=Ca(R),{image_url:U,date:W,boost:q,type:$,episode_title:H,show_title:B,node_type:M,text:L,source_link:A,link:G,name:X,verified:F=!1,twitter_handle:v}=V||{};return u.jsx(ka,{boostCount:q||0,date:W||0,episodeTitle:_r(H),imageUrl:U||"",link:G,name:X||"",onClick:()=>{C(R)},showTitle:_r(B),sourceLink:A,text:L||"",twitterHandle:v,type:M||$,verified:F},T.toString())}),u.jsx(T2,{align:"center",background:"BG1",direction:"row",justify:"center",children:S||u.jsx(Pt,{onClick:P,size:"medium",children:"Load More"},p)})]})})},j2=j.memo(M2),T2=Y(z)` +`,E2=({question:e,response:t})=>{const[n,r]=j.useState("");return j.useEffect(()=>{const{answer:i}=t;let o;if(i&&n.length{r(i.slice(0,n.length+1))},10),()=>clearTimeout(o)},[t,n]),u.jsxs(u.Fragment,{children:[t.answerLoading?u.jsx(Vx,{}):u.jsxs(S2,{children:[u.jsx(k2,{children:e}),u.jsx(C2,{children:n})]}),t.sourcesLoading?u.jsx(Fs,{count:1}):u.jsx(w2,{sourceIds:t.sources||[]}),t.questionsLoading?u.jsx(Fs,{count:1}):u.jsx(Gx,{questions:t.questions||[]})]})},P2=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"browse_gallery",children:[u.jsx("mask",{id:"mask0_1360_27257",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1360_27257)",children:u.jsx("path",{id:"browse_gallery_2",d:"M11.8 15.8442L12.8442 14.8L9.74998 11.7026V7.25003H8.25003V12.2942L11.8 15.8442ZM18 19.9615V18.3C19.2333 17.7167 20.2083 16.8583 20.925 15.725C21.6417 14.5917 22 13.35 22 12C22 10.65 21.6417 9.40834 20.925 8.27501C20.2083 7.14167 19.2333 6.28334 18 5.70001V4.03851C19.6628 4.67184 20.9952 5.71318 21.9971 7.16253C22.999 8.61188 23.5 10.2244 23.5 12C23.5 13.7756 22.999 15.3881 21.9971 16.8375C20.9952 18.2868 19.6628 19.3282 18 19.9615ZM9.00055 20.5C7.8207 20.5 6.71539 20.2769 5.68463 19.8307C4.65386 19.3846 3.75514 18.7782 2.98848 18.0115C2.22181 17.2449 1.61541 16.3463 1.16927 15.3159C0.723092 14.2855 0.5 13.1804 0.5 12.0006C0.5 10.8207 0.723083 9.7154 1.16925 8.68463C1.6154 7.65386 2.2218 6.75515 2.98845 5.98848C3.75512 5.22183 4.65365 4.61543 5.68405 4.16928C6.71445 3.72311 7.81957 3.50003 8.99942 3.50003C10.1793 3.50003 11.2846 3.72311 12.3154 4.16928C13.3461 4.61543 14.2448 5.22183 15.0115 5.98848C15.7782 6.75515 16.3846 7.65368 16.8307 8.68408C17.2769 9.71448 17.5 10.8196 17.5 11.9995C17.5 13.1793 17.2769 14.2846 16.8307 15.3154C16.3846 16.3461 15.7782 17.2449 15.0115 18.0115C14.2448 18.7782 13.3463 19.3846 12.3159 19.8307C11.2855 20.2769 10.1804 20.5 9.00055 20.5ZM9 19C10.95 19 12.6042 18.3208 13.9625 16.9625C15.3208 15.6042 16 13.95 16 12C16 10.05 15.3208 8.39584 13.9625 7.03751C12.6042 5.67917 10.95 5.00001 9 5.00001C7.05 5.00001 5.39583 5.67917 4.0375 7.03751C2.67917 8.39584 2 10.05 2 12C2 13.95 2.67917 15.6042 4.0375 16.9625C5.39583 18.3208 7.05 19 9 19Z",fill:"currentColor"})})]})}),M2=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",children:[u.jsx("mask",{id:"mask0_2638_2680",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_2638_2680)",children:u.jsx("path",{d:"M9.99732 16C9.90858 16 9.82421 15.985 9.74419 15.9551C9.66418 15.9252 9.5909 15.8765 9.52435 15.8091L6.18835 12.4277C6.06278 12.3004 6 12.1406 6 11.9483C6 11.7559 6.06278 11.5961 6.18835 11.4689C6.32145 11.3315 6.48099 11.2648 6.66697 11.2686C6.85295 11.2724 7.00873 11.3392 7.13429 11.4689L9.32114 13.674V4.68539C9.32114 4.49306 9.3864 4.33074 9.51692 4.19845C9.64744 4.06615 9.80758 4 9.99732 4C10.1871 4 10.3472 4.06615 10.4777 4.19845C10.6082 4.33074 10.6735 4.49306 10.6735 4.68539V13.674L12.849 11.4689C12.9845 11.3315 13.1447 11.2629 13.3294 11.2629C13.5143 11.2629 13.6744 11.3315 13.8099 11.4689C13.9378 11.6062 14.0012 11.7685 14 11.9558C13.9988 12.1431 13.9354 12.3004 13.8099 12.4277L10.4738 15.8091C10.4073 15.8765 10.3334 15.9252 10.2522 15.9551C10.171 15.985 10.0861 16 9.99732 16Z",fill:"currentColor"})})]}),j2=({isSearchResult:e})=>{const t=j.useRef(null),n=e?80:100,{setSelectedTimestamp:r,nextPage:i}=zt(L=>L),o=pi(),{currentSearch:a,setSidebarOpen:l,setRelevanceSelected:d}=vt(L=>L),[f,h]=j.useState(0),[p,y]=j.useState(0),g=Zu(),_=f*n+n,S=g&&g.length>0?g.length-1>_:!1,k=Py("sm","down"),C=j.useCallback(L=>{Fg(L),r(L),d(!0),o(L),k&&l(!1)},[o,d,l,r,k]),M=()=>{i(),S&&(h(f+1),y(L=>L+1))},O=j.useMemo(()=>{if(g){const L=[...g].sort((T,V)=>(V.date||0)-(T.date||0));return a&&L.sort((T,V)=>{const U=T.node_type==="topic"&&T.name.toLowerCase()===a.toLowerCase()?1:0;return(V.node_type==="topic"&&V.name.toLowerCase()===a.toLowerCase()?1:0)-U}),L.slice(0,_)}return[]},[g,a,_]);return u.jsx(u.Fragment,{children:u.jsxs(_d,{ref:t,id:"search-result-list",shrink:1,children:[(O??[]).map((L,T)=>{const V=Ca(L),{image_url:U,date:W,boost:q,type:$,episode_title:H,show_title:B,node_type:P,text:R,source_link:A,link:G,name:X,verified:F=!1,twitter_handle:v}=V||{};return u.jsx(ka,{boostCount:q||0,date:W||0,episodeTitle:_r(H),imageUrl:U||"",link:G,name:X||"",onClick:()=>{C(L)},showTitle:_r(B),sourceLink:A,text:R||"",twitterHandle:v,type:P||$,verified:F},T.toString())}),u.jsx(O2,{align:"center",background:"BG1",direction:"row",justify:"center",children:S||u.jsx(Pt,{onClick:M,size:"medium",children:"Load More"},p)})]})})},T2=j.memo(j2),O2=Y(z)` flex: 0 0 86px; -`,O2=({isSearchResult:e})=>{const{nodeCount:t,setNodeCount:n,setBudget:r}=So(l=>l),{fetchData:i,setAbortRequests:o}=zt(l=>l),a=async()=>{t<1||(await i(r,o,"",{skip_cache:"true"}),n("CLEAR"))};return u.jsxs(I2,{children:[!e&&u.jsxs("div",{className:"heading-container",children:[u.jsxs("div",{className:"heading",children:[u.jsx("span",{className:"heading__title",children:"Latest"}),u.jsx("span",{className:"heading__icon",children:u.jsx(E2,{})})]}),t?u.jsx("div",{className:"button_container",children:u.jsx(A2,{className:"button","data-testid":"see_latest_button",onClick:a,startIcon:u.jsx(P2,{}),children:`See Latest (${t})`})}):null]}),u.jsx(j2,{isSearchResult:e})]})},A2=Y(Pt)` +`,A2=({isSearchResult:e})=>{const{nodeCount:t,setNodeCount:n,setBudget:r}=So(l=>l),{fetchData:i,setAbortRequests:o}=zt(l=>l),a=async()=>{t<1||(await i(r,o,"",{skip_cache:"true"}),n("CLEAR"))};return u.jsxs(N2,{children:[!e&&u.jsxs("div",{className:"heading-container",children:[u.jsxs("div",{className:"heading",children:[u.jsx("span",{className:"heading__title",children:"Latest"}),u.jsx("span",{className:"heading__icon",children:u.jsx(P2,{})})]}),t?u.jsx("div",{className:"button_container",children:u.jsx(D2,{className:"button","data-testid":"see_latest_button",onClick:a,startIcon:u.jsx(M2,{}),children:`See Latest (${t})`})}):null]}),u.jsx(T2,{isSearchResult:e})]})},D2=Y(Pt)` && { width: 100%; margin-top: 1.2rem; @@ -662,7 +662,7 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni color: ${N.GRAY6}; } } -`,D2=j.memo(O2),I2=Y(z)` +`,I2=j.memo(A2),N2=Y(z)` .heading-container { display: flex; flex-direction: column; @@ -716,20 +716,20 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni } } } -`,N2=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"cancel",children:[u.jsx("mask",{id:"mask0_1264_3381",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"32",height:"32",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1264_3381)",children:u.jsx("path",{id:"cancel_2",d:"M16 17.4051L20.0975 21.5025C20.2821 21.6872 20.5141 21.7816 20.7936 21.7859C21.0731 21.7902 21.3094 21.6957 21.5025 21.5025C21.6957 21.3094 21.7923 21.0752 21.7923 20.8C21.7923 20.5248 21.6957 20.2906 21.5025 20.0975L17.4051 16L21.5025 11.9025C21.6872 11.7179 21.7816 11.4859 21.7859 11.2064C21.7902 10.9269 21.6957 10.6906 21.5025 10.4975C21.3094 10.3043 21.0752 10.2077 20.8 10.2077C20.5248 10.2077 20.2906 10.3043 20.0975 10.4975L16 14.5949L11.9025 10.4975C11.7179 10.3129 11.4859 10.2184 11.2064 10.2141C10.9269 10.2099 10.6906 10.3043 10.4975 10.4975C10.3043 10.6906 10.2077 10.9248 10.2077 11.2C10.2077 11.4752 10.3043 11.7094 10.4975 11.9025L14.5949 16L10.4975 20.0975C10.3129 20.2821 10.2184 20.5141 10.2141 20.7936C10.2099 21.0731 10.3043 21.3094 10.4975 21.5025C10.6906 21.6957 10.9248 21.7923 11.2 21.7923C11.4752 21.7923 11.7094 21.6957 11.9025 21.5025L16 17.4051ZM16.0022 28.6666C14.2503 28.6666 12.6036 28.3342 11.0621 27.6693C9.52057 27.0044 8.17966 26.1021 7.03937 24.9623C5.89906 23.8225 4.99632 22.4822 4.33114 20.9413C3.66596 19.4005 3.33337 17.7542 3.33337 16.0022C3.33337 14.2503 3.66582 12.6036 4.33071 11.0621C4.9956 9.52057 5.89793 8.17967 7.03771 7.03938C8.17751 5.89907 9.51783 4.99632 11.0587 4.33114C12.5995 3.66596 14.2459 3.33337 15.9978 3.33337C17.7497 3.33337 19.3964 3.66582 20.9379 4.33071C22.4794 4.9956 23.8204 5.89793 24.9606 7.03771C26.101 8.17751 27.0037 9.51783 27.6689 11.0587C28.3341 12.5995 28.6666 14.2459 28.6666 15.9978C28.6666 17.7497 28.3342 19.3964 27.6693 20.9379C27.0044 22.4794 26.1021 23.8204 24.9623 24.9606C23.8225 26.101 22.4822 27.0037 20.9413 27.6689C19.4005 28.3341 17.7542 28.6666 16.0022 28.6666Z",fill:"currentColor"})})]})});function Bt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{const n=$m(e),r=(i,o=t)=>Sd(n,i,o);return Object.assign(r,n),r},$2=(e,t)=>e?uc(e,t):uc;function Mt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),dc.hasOwnProperty(t)?{space:dc[t],local:e}:e}function z2(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ys&&t.documentElement.namespaceURI===Ys?t.createElement(e):t.createElementNS(n,e)}}function B2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function kd(e){var t=Po(e);return(t.local?B2:z2)(t)}function F2(){}function Ea(e){return e==null?F2:function(){return this.querySelector(e)}}function H2(e){typeof e!="function"&&(e=Ea(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=P&&(P=C+1);!(R=S[P])&&++P=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function h3(e){e||(e=p3);function t(p,y){return p&&y?e(p.__data__,y.__data__):!p-!y}for(var n=this._groups,r=n.length,i=new Array(r),o=0;ot?1:e>=t?0:NaN}function m3(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function g3(){return Array.from(this)}function y3(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?M3:typeof t=="function"?T3:j3)(e,t,n??"")):kr(this.node(),e)}function kr(e,t){return e.style.getPropertyValue(t)||jd(e).getComputedStyle(e,null).getPropertyValue(t)}function A3(e){return function(){delete this[e]}}function D3(e,t){return function(){this[e]=t}}function I3(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function N3(e,t){return arguments.length>1?this.each((t==null?A3:typeof t=="function"?I3:D3)(e,t)):this.node()[e]}function Td(e){return e.trim().split(/^|\s+/)}function Pa(e){return e.classList||new Od(e)}function Od(e){this._node=e,this._names=Td(e.getAttribute("class")||"")}Od.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ad(e,t){for(var n=Pa(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function c5(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n()=>e;function Vs(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:l,dx:d,dy:f,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:h}})}Vs.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function w5(e){return!e.ctrlKey&&!e.button}function b5(){return this.parentNode}function v5(e,t){return t??{x:e.x,y:e.y}}function _5(){return navigator.maxTouchPoints||"ontouchstart"in this}function S5(){var e=w5,t=b5,n=v5,r=_5,i={},o=ga("start","drag","end"),a=0,l,d,f,h,p=0;function y(O){O.on("mousedown.drag",g).filter(r).on("touchstart.drag",S).on("touchmove.drag",k,x5).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(O,R){if(!(h||!e.call(this,O,R))){var T=P(this,t.call(this,O,R),O,R,"mouse");T&&(Ut(O.view).on("mousemove.drag",w,li).on("mouseup.drag",_,li),Ld(O.view),ps(O),f=!1,l=O.clientX,d=O.clientY,T("start",O))}}function w(O){if(yr(O),!f){var R=O.clientX-l,T=O.clientY-d;f=R*R+T*T>p}i.mouse("drag",O)}function _(O){Ut(O.view).on("mousemove.drag mouseup.drag",null),Rd(O.view,f),yr(O),i.mouse("end",O)}function S(O,R){if(e.call(this,O,R)){var T=O.changedTouches,V=t.call(this,O,R),U=T.length,W,q;for(W=0;W$d)throw new Error("too late; already scheduled");return n}function sn(e,t){var n=Zt(e,t);if(n.state>io)throw new Error("too late; already running");return n}function Zt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function E5(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zm(o,0,n.time);function o(f){n.state=fc,n.timer.restart(a,n.delay,n.time),n.delay<=f&&a(f-n.delay)}function a(f){var h,p,y,g;if(n.state!==fc)return d();for(h in r)if(g=r[h],g.name===n.name){if(g.state===io)return rc(a);g.state===hc?(g.state=oo,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[h]):+hUs&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function n6(e,t,n){var r,i,o=t6(t)?Ma:sn;return function(){var a=o(this,e),l=a.on;l!==r&&(i=(r=l).copy()).on(t,n),a.on=i}}function r6(e,t){var n=this._id;return arguments.length<2?Zt(this.node(),n).on.on(e):this.each(n6(n,e,t))}function i6(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function o6(){return this.on("end.remove",i6(this._id))}function s6(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ea(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a()=>e;function O6(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function yn(e,t,n){this.k=e,this.x=t,this.y=n}yn.prototype={constructor:yn,scale:function(e){return e===1?this:new yn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new yn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Nn=new yn(1,0,0);yn.prototype;function ms(e){e.stopImmediatePropagation()}function Gr(e){e.preventDefault(),e.stopImmediatePropagation()}function A6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function D6(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function pc(){return this.__zoom||Nn}function I6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function N6(){return navigator.maxTouchPoints||"ontouchstart"in this}function L6(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function R6(){var e=A6,t=D6,n=L6,r=I6,i=N6,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,d=Zy,f=ga("start","zoom","end"),h,p,y,g=500,w=150,_=0,S=10;function k(M){M.property("__zoom",pc).on("wheel.zoom",U,{passive:!1}).on("mousedown.zoom",W).on("dblclick.zoom",q).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(M,L,A,G){var X=M.selection?M.selection():M;X.property("__zoom",pc),M!==X?R(M,L,A,G):X.interrupt().each(function(){T(this,arguments).event(G).start().zoom(null,typeof L=="function"?L.apply(this,arguments):L).end()})},k.scaleBy=function(M,L,A,G){k.scaleTo(M,function(){var X=this.__zoom.k,F=typeof L=="function"?L.apply(this,arguments):L;return X*F},A,G)},k.scaleTo=function(M,L,A,G){k.transform(M,function(){var X=t.apply(this,arguments),F=this.__zoom,v=A==null?O(X):typeof A=="function"?A.apply(this,arguments):A,Q=F.invert(v),ne=typeof L=="function"?L.apply(this,arguments):L;return n(P(C(F,ne),v,Q),X,a)},A,G)},k.translateBy=function(M,L,A,G){k.transform(M,function(){return n(this.__zoom.translate(typeof L=="function"?L.apply(this,arguments):L,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),a)},null,G)},k.translateTo=function(M,L,A,G,X){k.transform(M,function(){var F=t.apply(this,arguments),v=this.__zoom,Q=G==null?O(F):typeof G=="function"?G.apply(this,arguments):G;return n(Nn.translate(Q[0],Q[1]).scale(v.k).translate(typeof L=="function"?-L.apply(this,arguments):-L,typeof A=="function"?-A.apply(this,arguments):-A),F,a)},G,X)};function C(M,L){return L=Math.max(o[0],Math.min(o[1],L)),L===M.k?M:new yn(L,M.x,M.y)}function P(M,L,A){var G=L[0]-A[0]*M.k,X=L[1]-A[1]*M.k;return G===M.x&&X===M.y?M:new yn(M.k,G,X)}function O(M){return[(+M[0][0]+ +M[1][0])/2,(+M[0][1]+ +M[1][1])/2]}function R(M,L,A,G){M.on("start.zoom",function(){T(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(G).end()}).tween("zoom",function(){var X=this,F=arguments,v=T(X,F).event(G),Q=t.apply(X,F),ne=A==null?O(Q):typeof A=="function"?A.apply(X,F):A,E=Math.max(Q[1][0]-Q[0][0],Q[1][1]-Q[0][1]),ae=X.__zoom,J=typeof L=="function"?L.apply(X,F):L,le=d(ae.invert(ne).concat(E/ae.k),J.invert(ne).concat(E/J.k));return function(pe){if(pe===1)pe=J;else{var me=le(pe),ve=E/me[2];pe=new yn(ve,ne[0]-me[0]*ve,ne[1]-me[1]*ve)}v.zoom(null,pe)}})}function T(M,L,A){return!A&&M.__zooming||new V(M,L)}function V(M,L){this.that=M,this.args=L,this.active=0,this.sourceEvent=null,this.extent=t.apply(M,L),this.taps=0}V.prototype={event:function(M){return M&&(this.sourceEvent=M),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(M,L){return this.mouse&&M!=="mouse"&&(this.mouse[1]=L.invert(this.mouse[0])),this.touch0&&M!=="touch"&&(this.touch0[1]=L.invert(this.touch0[0])),this.touch1&&M!=="touch"&&(this.touch1[1]=L.invert(this.touch1[0])),this.that.__zoom=L,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(M){var L=Ut(this.that).datum();f.call(M,this.that,new O6(M,{sourceEvent:this.sourceEvent,target:k,type:M,transform:this.that.__zoom,dispatch:f}),L)}};function U(M,...L){if(!e.apply(this,arguments))return;var A=T(this,L).event(M),G=this.__zoom,X=Math.max(o[0],Math.min(o[1],G.k*Math.pow(2,r.apply(this,arguments)))),F=nn(M);if(A.wheel)(A.mouse[0][0]!==F[0]||A.mouse[0][1]!==F[1])&&(A.mouse[1]=G.invert(A.mouse[0]=F)),clearTimeout(A.wheel);else{if(G.k===X)return;A.mouse=[F,G.invert(F)],so(this),A.start()}Gr(M),A.wheel=setTimeout(v,w),A.zoom("mouse",n(P(C(G,X),A.mouse[0],A.mouse[1]),A.extent,a));function v(){A.wheel=null,A.end()}}function W(M,...L){if(y||!e.apply(this,arguments))return;var A=M.currentTarget,G=T(this,L,!0).event(M),X=Ut(M.view).on("mousemove.zoom",ne,!0).on("mouseup.zoom",E,!0),F=nn(M,A),v=M.clientX,Q=M.clientY;Ld(M.view),ms(M),G.mouse=[F,this.__zoom.invert(F)],so(this),G.start();function ne(ae){if(Gr(ae),!G.moved){var J=ae.clientX-v,le=ae.clientY-Q;G.moved=J*J+le*le>_}G.event(ae).zoom("mouse",n(P(G.that.__zoom,G.mouse[0]=nn(ae,A),G.mouse[1]),G.extent,a))}function E(ae){X.on("mousemove.zoom mouseup.zoom",null),Rd(ae.view,G.moved),Gr(ae),G.event(ae).end()}}function q(M,...L){if(e.apply(this,arguments)){var A=this.__zoom,G=nn(M.changedTouches?M.changedTouches[0]:M,this),X=A.invert(G),F=A.k*(M.shiftKey?.5:2),v=n(P(C(A,F),G,X),t.apply(this,L),a);Gr(M),l>0?Ut(this).transition().duration(l).call(R,v,G,M):Ut(this).call(k.transform,v,G,M)}}function $(M,...L){if(e.apply(this,arguments)){var A=M.touches,G=A.length,X=T(this,L,M.changedTouches.length===G).event(M),F,v,Q,ne;for(ms(M),v=0;v"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},Hd=wn.error001();function it(e,t){const n=j.useContext(jo);if(n===null)throw new Error(Hd);return Sd(n,e,t)}const ut=()=>{const e=j.useContext(jo);if(e===null)throw new Error(Hd);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},z6=e=>e.userSelectionActive?"none":"all";function B6({position:e,children:t,className:n,style:r,...i}){const o=it(z6),a=`${e}`.split("-");return ee.createElement("div",{className:Bt(["react-flow__panel",n,...a]),style:{...r,pointerEvents:o},...i},t)}function F6({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:ee.createElement(B6,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ee.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const H6=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:d,className:f,...h})=>{const p=j.useRef(null),[y,g]=j.useState({x:0,y:0,width:0,height:0}),w=Bt(["react-flow__edge-textwrapper",f]);return j.useEffect(()=>{if(p.current){const _=p.current.getBBox();g({x:_.x,y:_.y,width:_.width,height:_.height})}},[n]),typeof n>"u"||!n?null:ee.createElement("g",{transform:`translate(${e-y.width/2} ${t-y.height/2})`,className:w,visibility:y.width?"visible":"hidden",...h},i&&ee.createElement("rect",{width:y.width+2*a[0],x:-a[0],y:-a[1],height:y.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),ee.createElement("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:p,style:r},n),d)};var Y6=j.memo(H6);const Ta=e=>({width:e.offsetWidth,height:e.offsetHeight}),Cr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Oa=(e={x:0,y:0},t)=>({x:Cr(e.x,t[0][0],t[1][0]),y:Cr(e.y,t[0][1],t[1][1])}),mc=(e,t,n)=>en?-Cr(Math.abs(e-n),1,50)/50:0,Yd=(e,t)=>{const n=mc(e.x,35,t.width-35)*20,r=mc(e.y,35,t.height-35)*20;return[n,r]},Vd=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},V6=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Aa=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),U6=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),gc=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Gs=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},W6=e=>$t(e.width)&&$t(e.height)&&$t(e.x)&&$t(e.y),$t=e=>!isNaN(e)&&isFinite(e),lt=Symbol.for("internals"),Ud=["Enter"," ","Escape"],G6=(e,t)=>{},Z6=e=>"nativeEvent"in e;function Zs(e){var i,o;const t=Z6(e)?e.nativeEvent:e,n=((o=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const Wd=e=>"clientX"in e,Ln=(e,t)=>{var o,a;const n=Wd(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},mo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},yi=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:y,interactionWidth:g=20})=>ee.createElement(ee.Fragment,null,ee.createElement("path",{id:e,style:h,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:p,markerStart:y}),g&&ee.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}),i&&$t(n)&&$t(r)?ee.createElement(Y6,{x:n,y:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f}):null);yi.displayName="BaseEdge";function Zr(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function Gd({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n{const[S,k,C]=qd({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return ee.createElement(yi,{path:S,labelX:k,labelY:C,label:a,labelStyle:l,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:g,markerStart:w,interactionWidth:_})});Da.displayName="SimpleBezierEdge";const xc={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}},q6=({source:e,sourcePosition:t=he.Bottom,target:n})=>t===he.Left||t===he.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function X6({source:e,sourcePosition:t=he.Bottom,target:n,targetPosition:r=he.Top,center:i,offset:o}){const a=xc[t],l=xc[r],d={x:e.x+a.x*o,y:e.y+a.y*o},f={x:n.x+l.x*o,y:n.y+l.y*o},h=q6({source:d,sourcePosition:t,target:f}),p=h.x!==0?"x":"y",y=h[p];let g=[],w,_;const S={x:0,y:0},k={x:0,y:0},[C,P,O,R]=Gd({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[p]*l[p]===-1){w=i.x||C,_=i.y||P;const V=[{x:w,y:d.y},{x:w,y:f.y}],U=[{x:d.x,y:_},{x:f.x,y:_}];a[p]===y?g=p==="x"?V:U:g=p==="x"?U:V}else{const V=[{x:d.x,y:f.y}],U=[{x:f.x,y:d.y}];if(p==="x"?g=a.x===y?U:V:g=a.y===y?V:U,t===r){const B=Math.abs(e[p]-n[p]);if(B<=o){const M=Math.min(o-1,o-B);a[p]===y?S[p]=(d[p]>e[p]?-1:1)*M:k[p]=(f[p]>n[p]?-1:1)*M}}if(t!==r){const B=p==="x"?"y":"x",M=a[p]===l[B],L=d[B]>f[B],A=d[B]=H?(w=(W.x+q.x)/2,_=g[0].y):(w=g[0].x,_=(W.y+q.y)/2)}return[[e,{x:d.x+S.x,y:d.y+S.y},...g,{x:f.x+k.x,y:f.y+k.y},n],w,_,O,R]}function K6(e,t,n,r){const i=Math.min(wc(e,t)/2,wc(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){const f=e.x{let P="";return C>0&&C{const[k,C,P]=qs({sourceX:e,sourceY:t,sourcePosition:p,targetX:n,targetY:r,targetPosition:y,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset});return ee.createElement(yi,{path:k,labelX:C,labelY:P,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:w,interactionWidth:S})});To.displayName="SmoothStepEdge";const Ia=j.memo(e=>{var t;return ee.createElement(To,{...e,pathOptions:j.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});Ia.displayName="StepEdge";function Q6({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,a,l]=Gd({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,a,l]}const Na=j.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:y,interactionWidth:g})=>{const[w,_,S]=Q6({sourceX:e,sourceY:t,targetX:n,targetY:r});return ee.createElement(yi,{path:w,labelX:_,labelY:S,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:y,interactionWidth:g})});Na.displayName="StraightEdge";function Zi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function bc({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case he.Left:return[t-Zi(t-r,o),n];case he.Right:return[t+Zi(r-t,o),n];case he.Top:return[t,n-Zi(n-i,o)];case he.Bottom:return[t,n+Zi(i-n,o)]}}function Xd({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:i,targetPosition:o=he.Top,curvature:a=.25}){const[l,d]=bc({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[f,h]=bc({pos:o,x1:r,y1:i,x2:e,y2:t,c:a}),[p,y,g,w]=Zd({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:d,targetControlX:f,targetControlY:h});return[`M${e},${t} C${l},${d} ${f},${h} ${r},${i}`,p,y,g,w]}const yo=j.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=he.Bottom,targetPosition:o=he.Top,label:a,labelStyle:l,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:g,markerStart:w,pathOptions:_,interactionWidth:S})=>{const[k,C,P]=Xd({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:_==null?void 0:_.curvature});return ee.createElement(yi,{path:k,labelX:C,labelY:P,label:a,labelStyle:l,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:g,markerStart:w,interactionWidth:S})});yo.displayName="BezierEdge";const La=j.createContext(null),J6=La.Provider;La.Consumer;const ew=()=>j.useContext(La),tw=e=>"id"in e&&"source"in e&&"target"in e,nw=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Xs=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,rw=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),iw=(e,t)=>{if(!e.source||!e.target)return t;let n;return tw(e)?n={...e}:n={...e,id:nw(e)},rw(n,t)?t:t.concat(n)},Ks=({x:e,y:t},[n,r,i],o,[a,l])=>{const d={x:(e-n)/i,y:(t-r)/i};return o?{x:a*Math.round(d.x/a),y:l*Math.round(d.y/l)}:d},Kd=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),xr=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],i={x:e.position.x-n,y:e.position.y-r};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:i}},Ra=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:o,y:a}=xr(i,t).positionAbsolute;return V6(r,Aa({x:o,y:a,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return U6(n)},Qd=(e,t,[n,r,i]=[0,0,1],o=!1,a=!1,l=[0,0])=>{const d={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},f=[];return e.forEach(h=>{const{width:p,height:y,selectable:g=!0,hidden:w=!1}=h;if(a&&!g||w)return!1;const{positionAbsolute:_}=xr(h,l),S={x:_.x,y:_.y,width:p||0,height:y||0},k=Gs(d,S),C=typeof p>"u"||typeof y>"u"||p===null||y===null,P=o&&k>0,O=(p||0)*(y||0);(C||P||k>=O||h.dragging)&&f.push(h)}),f},Jd=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},ef=(e,t,n,r,i,o=.1)=>{const a=t/(e.width*(1+o)),l=n/(e.height*(1+o)),d=Math.min(a,l),f=Cr(d,r,i),h=e.x+e.width/2,p=e.y+e.height/2,y=t/2-h*f,g=n/2-p*f;return{x:y,y:g,zoom:f}},Gn=(e,t=0)=>e.transition().duration(t);function vc(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var a,l;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((a=e.positionAbsolute)==null?void 0:a.x)??0)+o.x+o.width/2,y:(((l=e.positionAbsolute)==null?void 0:l.y)??0)+o.y+o.height/2}),i},[])}function ow(e,t,n,r,i,o){const{x:a,y:l}=Ln(e),f=t.elementsFromPoint(a,l).find(w=>w.classList.contains("react-flow__handle"));if(f){const w=f.getAttribute("data-nodeid");if(w){const _=$a(void 0,f),S=f.getAttribute("data-handleid"),k=o({nodeId:w,id:S,type:_});if(k){const C=i.find(P=>P.nodeId===w&&P.type===_&&P.id===S);return{handle:{id:S,type:_,nodeId:w,x:(C==null?void 0:C.x)||n.x,y:(C==null?void 0:C.y)||n.y},validHandleResult:k}}}}let h=[],p=1/0;if(i.forEach(w=>{const _=Math.sqrt((w.x-n.x)**2+(w.y-n.y)**2);if(_<=r){const S=o(w);_<=p&&(_w.isValid),g=h.some(({handle:w})=>w.type==="target");return h.find(({handle:w,validHandleResult:_})=>g?w.type==="target":y?_.isValid:!0)||h[0]}const sw={source:null,target:null,sourceHandle:null,targetHandle:null},tf=()=>({handleDomNode:null,isValid:!1,connection:sw,endHandle:null});function nf(e,t,n,r,i,o,a){const l=i==="target",d=a.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),f={...tf(),handleDomNode:d};if(d){const h=$a(void 0,d),p=d.getAttribute("data-nodeid"),y=d.getAttribute("data-handleid"),g=d.classList.contains("connectable"),w=d.classList.contains("connectableend"),_={source:l?p:n,sourceHandle:l?y:r,target:l?n:p,targetHandle:l?r:y};f.connection=_,g&&w&&(t===Jn.Strict?l&&h==="source"||!l&&h==="target":p!==n||y!==r)&&(f.endHandle={nodeId:p,handleId:y,type:h},f.isValid=o(_))}return f}function aw({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[lt]){const{handleBounds:a}=o[lt];let l=[],d=[];a&&(l=vc(o,a,"source",`${t}-${n}-${r}`),d=vc(o,a,"target",`${t}-${n}-${r}`)),i.push(...l,...d)}return i},[])}function $a(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function gs(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function lw(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function rf({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:a,isValidConnection:l,edgeUpdaterType:d,onEdgeUpdateEnd:f}){const h=Vd(e.target),{connectionMode:p,domNode:y,autoPanOnConnect:g,connectionRadius:w,onConnectStart:_,panBy:S,getNodes:k,cancelConnection:C}=o();let P=0,O;const{x:R,y:T}=Ln(e),V=h==null?void 0:h.elementFromPoint(R,T),U=$a(d,V),W=y==null?void 0:y.getBoundingClientRect();if(!W||!U)return;let q,$=Ln(e,W),H=!1,B=null,M=!1,L=null;const A=aw({nodes:k(),nodeId:n,handleId:t,handleType:U}),G=()=>{if(!g)return;const[v,Q]=Yd($,W);S({x:v,y:Q}),P=requestAnimationFrame(G)};a({connectionPosition:$,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:U,connectionStartHandle:{nodeId:n,handleId:t,type:U},connectionEndHandle:null}),_==null||_(e,{nodeId:n,handleId:t,handleType:U});function X(v){const{transform:Q}=o();$=Ln(v,W);const{handle:ne,validHandleResult:E}=ow(v,h,Ks($,Q,!1,[1,1]),w,A,ae=>nf(ae,p,n,t,i?"target":"source",l,h));if(O=ne,H||(G(),H=!0),L=E.handleDomNode,B=E.connection,M=E.isValid,a({connectionPosition:O&&M?Kd({x:O.x,y:O.y},Q):$,connectionStatus:lw(!!O,M),connectionEndHandle:E.endHandle}),!O&&!M&&!L)return gs(q);B.source!==B.target&&L&&(gs(q),q=L,L.classList.add("connecting","react-flow__handle-connecting"),L.classList.toggle("valid",M),L.classList.toggle("react-flow__handle-valid",M))}function F(v){var Q,ne;(O||L)&&B&&M&&(r==null||r(B)),(ne=(Q=o()).onConnectEnd)==null||ne.call(Q,v),d&&(f==null||f(v)),gs(q),C(),cancelAnimationFrame(P),H=!1,M=!1,B=null,L=null,h.removeEventListener("mousemove",X),h.removeEventListener("mouseup",F),h.removeEventListener("touchmove",X),h.removeEventListener("touchend",F)}h.addEventListener("mousemove",X),h.addEventListener("mouseup",F),h.addEventListener("touchmove",X),h.addEventListener("touchend",F)}const _c=()=>!0,cw=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),uw=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:a}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===n}},of=j.forwardRef(({type:e="source",position:t=he.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:a,onConnect:l,children:d,className:f,onMouseDown:h,onTouchStart:p,...y},g)=>{var W,q;const w=a||null,_=e==="target",S=ut(),k=ew(),{connectOnClick:C,noPanClassName:P}=it(cw,Mt),{connecting:O,clickConnecting:R}=it(uw(k,w,e),Mt);k||(q=(W=S.getState()).onError)==null||q.call(W,"010",wn.error010());const T=$=>{const{defaultEdgeOptions:H,onConnect:B,hasDefaultEdges:M}=S.getState(),L={...H,...$};if(M){const{edges:A,setEdges:G}=S.getState();G(iw(L,A))}B==null||B(L),l==null||l(L)},V=$=>{if(!k)return;const H=Wd($);i&&(H&&$.button===0||!H)&&rf({event:$,handleId:w,nodeId:k,onConnect:T,isTarget:_,getState:S.getState,setState:S.setState,isValidConnection:n||S.getState().isValidConnection||_c}),H?h==null||h($):p==null||p($)},U=$=>{const{onClickConnectStart:H,onClickConnectEnd:B,connectionClickStartHandle:M,connectionMode:L,isValidConnection:A}=S.getState();if(!k||!M&&!i)return;if(!M){H==null||H($,{nodeId:k,handleId:w,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:k,type:e,handleId:w}});return}const G=Vd($.target),X=n||A||_c,{connection:F,isValid:v}=nf({nodeId:k,id:w,type:e},L,M.nodeId,M.handleId||null,M.type,X,G);v&&T(F),B==null||B($),S.setState({connectionClickStartHandle:null})};return ee.createElement("div",{"data-handleid":w,"data-nodeid":k,"data-handlepos":t,"data-id":`${k}-${w}-${e}`,className:Bt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",P,f,{source:!_,target:_,connectable:r,connectablestart:i,connectableend:o,connecting:R,connectionindicator:r&&(i&&!O||o&&O)}]),onMouseDown:V,onTouchStart:V,onClick:C?U:void 0,ref:g,...y},d)});of.displayName="Handle";var xo=j.memo(of);const sf=({data:e,isConnectable:t,targetPosition:n=he.Top,sourcePosition:r=he.Bottom})=>ee.createElement(ee.Fragment,null,ee.createElement(xo,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,ee.createElement(xo,{type:"source",position:r,isConnectable:t}));sf.displayName="DefaultNode";var Qs=j.memo(sf);const af=({data:e,isConnectable:t,sourcePosition:n=he.Bottom})=>ee.createElement(ee.Fragment,null,e==null?void 0:e.label,ee.createElement(xo,{type:"source",position:n,isConnectable:t}));af.displayName="InputNode";var lf=j.memo(af);const cf=({data:e,isConnectable:t,targetPosition:n=he.Top})=>ee.createElement(ee.Fragment,null,ee.createElement(xo,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);cf.displayName="OutputNode";var uf=j.memo(cf);const za=()=>null;za.displayName="GroupNode";const dw=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),qi=e=>e.id;function fw(e,t){return Mt(e.selectedNodes.map(qi),t.selectedNodes.map(qi))&&Mt(e.selectedEdges.map(qi),t.selectedEdges.map(qi))}const df=j.memo(({onSelectionChange:e})=>{const t=ut(),{selectedNodes:n,selectedEdges:r}=it(dw,fw);return j.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChange.forEach(o=>o(i))},[n,r,e]),null});df.displayName="SelectionListener";const hw=e=>!!e.onSelectionChange;function pw({onSelectionChange:e}){const t=it(hw);return e||t?ee.createElement(df,{onSelectionChange:e}):null}const mw=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function sr(e,t){j.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Me(e,t,n){j.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const gw=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:a,onClickConnectStart:l,onClickConnectEnd:d,nodesDraggable:f,nodesConnectable:h,nodesFocusable:p,edgesFocusable:y,edgesUpdatable:g,elevateNodesOnSelect:w,minZoom:_,maxZoom:S,nodeExtent:k,onNodesChange:C,onEdgesChange:P,elementsSelectable:O,connectionMode:R,snapGrid:T,snapToGrid:V,translateExtent:U,connectOnClick:W,defaultEdgeOptions:q,fitView:$,fitViewOptions:H,onNodesDelete:B,onEdgesDelete:M,onNodeDrag:L,onNodeDragStart:A,onNodeDragStop:G,onSelectionDrag:X,onSelectionDragStart:F,onSelectionDragStop:v,noPanClassName:Q,nodeOrigin:ne,rfId:E,autoPanOnConnect:ae,autoPanOnNodeDrag:J,onError:le,connectionRadius:pe,isValidConnection:me,nodeDragThreshold:ve})=>{const{setNodes:ke,setEdges:Be,setDefaultNodesAndEdges:Je,setMinZoom:He,setMaxZoom:we,setTranslateExtent:ge,setNodeExtent:Ye,reset:Ze}=it(mw,Mt),ue=ut();return j.useEffect(()=>{const dt=r==null?void 0:r.map(Ne=>({...Ne,...q}));return Je(n,dt),()=>{Ze()}},[]),Me("defaultEdgeOptions",q,ue.setState),Me("connectionMode",R,ue.setState),Me("onConnect",i,ue.setState),Me("onConnectStart",o,ue.setState),Me("onConnectEnd",a,ue.setState),Me("onClickConnectStart",l,ue.setState),Me("onClickConnectEnd",d,ue.setState),Me("nodesDraggable",f,ue.setState),Me("nodesConnectable",h,ue.setState),Me("nodesFocusable",p,ue.setState),Me("edgesFocusable",y,ue.setState),Me("edgesUpdatable",g,ue.setState),Me("elementsSelectable",O,ue.setState),Me("elevateNodesOnSelect",w,ue.setState),Me("snapToGrid",V,ue.setState),Me("snapGrid",T,ue.setState),Me("onNodesChange",C,ue.setState),Me("onEdgesChange",P,ue.setState),Me("connectOnClick",W,ue.setState),Me("fitViewOnInit",$,ue.setState),Me("fitViewOnInitOptions",H,ue.setState),Me("onNodesDelete",B,ue.setState),Me("onEdgesDelete",M,ue.setState),Me("onNodeDrag",L,ue.setState),Me("onNodeDragStart",A,ue.setState),Me("onNodeDragStop",G,ue.setState),Me("onSelectionDrag",X,ue.setState),Me("onSelectionDragStart",F,ue.setState),Me("onSelectionDragStop",v,ue.setState),Me("noPanClassName",Q,ue.setState),Me("nodeOrigin",ne,ue.setState),Me("rfId",E,ue.setState),Me("autoPanOnConnect",ae,ue.setState),Me("autoPanOnNodeDrag",J,ue.setState),Me("onError",le,ue.setState),Me("connectionRadius",pe,ue.setState),Me("isValidConnection",me,ue.setState),Me("nodeDragThreshold",ve,ue.setState),sr(e,ke),sr(t,Be),sr(_,He),sr(S,we),sr(U,ge),sr(k,Ye),null},Sc={display:"none"},yw={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ff="react-flow__node-desc",hf="react-flow__edge-desc",xw="react-flow__aria-live",ww=e=>e.ariaLiveMessage;function bw({rfId:e}){const t=it(ww);return ee.createElement("div",{id:`${xw}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:yw},t)}function vw({rfId:e,disableKeyboardA11y:t}){return ee.createElement(ee.Fragment,null,ee.createElement("div",{id:`${ff}-${e}`,style:Sc},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ee.createElement("div",{id:`${hf}-${e}`,style:Sc},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&ee.createElement(bw,{rfId:e}))}var ui=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=j.useState(!1),i=j.useRef(!1),o=j.useRef(new Set([])),[a,l]=j.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.split("+")),h=f.reduce((p,y)=>p.concat(...y),[]);return[f,h]}return[[],[]]},[e]);return j.useEffect(()=>{const d=typeof document<"u"?document:null,f=(t==null?void 0:t.target)||d;if(e!==null){const h=g=>{if(i.current=g.ctrlKey||g.metaKey||g.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&Zs(g))return!1;const _=Cc(g.code,l);o.current.add(g[_]),kc(a,o.current,!1)&&(g.preventDefault(),r(!0))},p=g=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&Zs(g))return!1;const _=Cc(g.code,l);kc(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(g[_]),g.key==="Meta"&&o.current.clear(),i.current=!1},y=()=>{o.current.clear(),r(!1)};return f==null||f.addEventListener("keydown",h),f==null||f.addEventListener("keyup",p),window.addEventListener("blur",y),()=>{f==null||f.removeEventListener("keydown",h),f==null||f.removeEventListener("keyup",p),window.removeEventListener("blur",y)}}},[e,r]),n};function kc(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Cc(e,t){return t.includes(e)?"code":"key"}function pf(e,t,n,r){var a,l;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=xr(i,r);return pf(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((a=i[lt])==null?void 0:a.z)??0)>(n.z??0)?((l=i[lt])==null?void 0:l.z)??0:n.z??0},r)}function mf(e,t,n){e.forEach(r=>{var i;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:o,y:a,z:l}=pf(r,e,{...r.position,z:((i=r[lt])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:a},r[lt].z=l,n!=null&&n[r.id]&&(r[lt].isParent=!0)}})}function ys(e,t,n,r){const i=new Map,o={},a=r?1e3:0;return e.forEach(l=>{var p;const d=($t(l.zIndex)?l.zIndex:0)+(l.selected?a:0),f=t.get(l.id),h={width:f==null?void 0:f.width,height:f==null?void 0:f.height,...l,positionAbsolute:{x:l.position.x,y:l.position.y}};l.parentNode&&(h.parentNode=l.parentNode,o[l.parentNode]=!0),Object.defineProperty(h,lt,{enumerable:!1,value:{handleBounds:(p=f==null?void 0:f[lt])==null?void 0:p.handleBounds,z:d}}),i.set(l.id,h)}),mf(i,n,o),i}function gf(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:a,d3Zoom:l,d3Selection:d,fitViewOnInitDone:f,fitViewOnInit:h,nodeOrigin:p}=e(),y=t.initial&&!f&&h;if(l&&d&&(y||!t.initial)){const w=n().filter(S=>{var C;const k=t.includeHiddenNodes?S.width&&S.height:!S.hidden;return(C=t.nodes)!=null&&C.length?k&&t.nodes.some(P=>P.id===S.id):k}),_=w.every(S=>S.width&&S.height);if(w.length>0&&_){const S=Ra(w,p),{x:k,y:C,zoom:P}=ef(S,r,i,t.minZoom??o,t.maxZoom??a,t.padding??.1),O=Nn.translate(k,C).scale(P);return typeof t.duration=="number"&&t.duration>0?l.transform(Gn(d,t.duration),O):l.transform(d,O),!0}}return!1}function _w(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[lt]:r[lt],selected:n.selected})}),new Map(t)}function Sw(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function Xi({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:a,onEdgesChange:l,hasDefaultNodes:d,hasDefaultEdges:f}=n();e!=null&&e.length&&(d&&r({nodeInternals:_w(e,i)}),a==null||a(e)),t!=null&&t.length&&(f&&r({edges:Sw(t,o)}),l==null||l(t))}const ar=()=>{},kw={zoomIn:ar,zoomOut:ar,zoomTo:ar,getZoom:()=>1,setViewport:ar,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ar,fitBounds:ar,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Cw=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Ew=()=>{const e=ut(),{d3Zoom:t,d3Selection:n}=it(Cw,Mt);return j.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(Gn(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Gn(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(Gn(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[a,l,d]=e.getState().transform,f=Nn.translate(i.x??a,i.y??l).scale(i.zoom??d);t.transform(Gn(n,o==null?void 0:o.duration),f)},getViewport:()=>{const[i,o,a]=e.getState().transform;return{x:i,y:o,zoom:a}},fitView:i=>gf(e.getState,i),setCenter:(i,o,a)=>{const{width:l,height:d,maxZoom:f}=e.getState(),h=typeof(a==null?void 0:a.zoom)<"u"?a.zoom:f,p=l/2-i*h,y=d/2-o*h,g=Nn.translate(p,y).scale(h);t.transform(Gn(n,a==null?void 0:a.duration),g)},fitBounds:(i,o)=>{const{width:a,height:l,minZoom:d,maxZoom:f}=e.getState(),{x:h,y:p,zoom:y}=ef(i,a,l,d,f,(o==null?void 0:o.padding)??.1),g=Nn.translate(h,p).scale(y);t.transform(Gn(n,o==null?void 0:o.duration),g)},project:i=>{const{transform:o,snapToGrid:a,snapGrid:l}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Ks(i,o,a,l)},screenToFlowPosition:i=>{const{transform:o,snapToGrid:a,snapGrid:l,domNode:d}=e.getState();if(!d)return i;const{x:f,y:h}=d.getBoundingClientRect(),p={x:i.x-f,y:i.y-h};return Ks(p,o,a,l)},flowToScreenPosition:i=>{const{transform:o,domNode:a}=e.getState();if(!a)return i;const{x:l,y:d}=a.getBoundingClientRect(),f=Kd(i,o);return{x:f.x+l,y:f.y+d}},viewportInitialized:!0}:kw,[t,n])};function yf(){const e=Ew(),t=ut(),n=j.useCallback(()=>t.getState().getNodes().map(_=>({..._})),[]),r=j.useCallback(_=>t.getState().nodeInternals.get(_),[]),i=j.useCallback(()=>{const{edges:_=[]}=t.getState();return _.map(S=>({...S}))},[]),o=j.useCallback(_=>{const{edges:S=[]}=t.getState();return S.find(k=>k.id===_)},[]),a=j.useCallback(_=>{const{getNodes:S,setNodes:k,hasDefaultNodes:C,onNodesChange:P}=t.getState(),O=S(),R=typeof _=="function"?_(O):_;if(C)k(R);else if(P){const T=R.length===0?O.map(V=>({type:"remove",id:V.id})):R.map(V=>({item:V,type:"reset"}));P(T)}},[]),l=j.useCallback(_=>{const{edges:S=[],setEdges:k,hasDefaultEdges:C,onEdgesChange:P}=t.getState(),O=typeof _=="function"?_(S):_;if(C)k(O);else if(P){const R=O.length===0?S.map(T=>({type:"remove",id:T.id})):O.map(T=>({item:T,type:"reset"}));P(R)}},[]),d=j.useCallback(_=>{const S=Array.isArray(_)?_:[_],{getNodes:k,setNodes:C,hasDefaultNodes:P,onNodesChange:O}=t.getState();if(P){const T=[...k(),...S];C(T)}else if(O){const R=S.map(T=>({item:T,type:"add"}));O(R)}},[]),f=j.useCallback(_=>{const S=Array.isArray(_)?_:[_],{edges:k=[],setEdges:C,hasDefaultEdges:P,onEdgesChange:O}=t.getState();if(P)C([...k,...S]);else if(O){const R=S.map(T=>({item:T,type:"add"}));O(R)}},[]),h=j.useCallback(()=>{const{getNodes:_,edges:S=[],transform:k}=t.getState(),[C,P,O]=k;return{nodes:_().map(R=>({...R})),edges:S.map(R=>({...R})),viewport:{x:C,y:P,zoom:O}}},[]),p=j.useCallback(({nodes:_,edges:S})=>{const{nodeInternals:k,getNodes:C,edges:P,hasDefaultNodes:O,hasDefaultEdges:R,onNodesDelete:T,onEdgesDelete:V,onNodesChange:U,onEdgesChange:W}=t.getState(),q=(_||[]).map(L=>L.id),$=(S||[]).map(L=>L.id),H=C().reduce((L,A)=>{const G=!q.includes(A.id)&&A.parentNode&&L.find(F=>F.id===A.parentNode);return(typeof A.deletable=="boolean"?A.deletable:!0)&&(q.includes(A.id)||G)&&L.push(A),L},[]),B=P.filter(L=>typeof L.deletable=="boolean"?L.deletable:!0),M=B.filter(L=>$.includes(L.id));if(H||M){const L=Jd(H,B),A=[...M,...L],G=A.reduce((X,F)=>(X.includes(F.id)||X.push(F.id),X),[]);if((R||O)&&(R&&t.setState({edges:P.filter(X=>!G.includes(X.id))}),O&&(H.forEach(X=>{k.delete(X.id)}),t.setState({nodeInternals:new Map(k)}))),G.length>0&&(V==null||V(A),W&&W(G.map(X=>({id:X,type:"remove"})))),H.length>0&&(T==null||T(H),U)){const X=H.map(F=>({id:F.id,type:"remove"}));U(X)}}},[]),y=j.useCallback(_=>{const S=W6(_),k=S?null:t.getState().nodeInternals.get(_.id);return[S?_:gc(k),k,S]},[]),g=j.useCallback((_,S=!0,k)=>{const[C,P,O]=y(_);return C?(k||t.getState().getNodes()).filter(R=>{if(!O&&(R.id===P.id||!R.positionAbsolute))return!1;const T=gc(R),V=Gs(T,C);return S&&V>0||V>=C.width*C.height}):[]},[]),w=j.useCallback((_,S,k=!0)=>{const[C]=y(_);if(!C)return!1;const P=Gs(C,S);return k&&P>0||P>=C.width*C.height},[]);return j.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:a,setEdges:l,addNodes:d,addEdges:f,toObject:h,deleteElements:p,getIntersectingNodes:g,isNodeIntersecting:w}),[e,n,r,i,o,a,l,d,f,h,p,g,w])}const Pw={actInsideInputWithModifier:!1};var Mw=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=ut(),{deleteElements:r}=yf(),i=ui(e,Pw),o=ui(t);j.useEffect(()=>{if(i){const{edges:a,getNodes:l}=n.getState(),d=l().filter(h=>h.selected),f=a.filter(h=>h.selected);r({nodes:d,edges:f}),n.setState({nodesSelectionActive:!1})}},[i]),j.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function jw(e){const t=ut();j.useEffect(()=>{let n;const r=()=>{var o,a;if(!e.current)return;const i=Ta(e.current);(i.height===0||i.width===0)&&((a=(o=t.getState()).onError)==null||a.call(o,"004",wn.error004())),t.setState({width:i.width||500,height:i.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const Ba={position:"absolute",width:"100%",height:"100%",top:0,left:0},Tw=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ki=e=>({x:e.x,y:e.y,zoom:e.k}),lr=(e,t)=>e.target.closest(`.${t}`),Ec=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Pc=e=>{const t=e.ctrlKey&&mo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Ow=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Aw=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:a=!1,panOnScrollSpeed:l=.5,panOnScrollMode:d=Xn.Free,zoomOnDoubleClick:f=!0,elementsSelectable:h,panOnDrag:p=!0,defaultViewport:y,translateExtent:g,minZoom:w,maxZoom:_,zoomActivationKeyCode:S,preventScrolling:k=!0,children:C,noWheelClassName:P,noPanClassName:O})=>{const R=j.useRef(),T=ut(),V=j.useRef(!1),U=j.useRef(!1),W=j.useRef(null),q=j.useRef({x:0,y:0,zoom:0}),{d3Zoom:$,d3Selection:H,d3ZoomHandler:B,userSelectionActive:M}=it(Ow,Mt),L=ui(S),A=j.useRef(0),G=j.useRef(!1),X=j.useRef();return jw(W),j.useEffect(()=>{if(W.current){const F=W.current.getBoundingClientRect(),v=R6().scaleExtent([w,_]).translateExtent(g),Q=Ut(W.current).call(v),ne=Nn.translate(y.x,y.y).scale(Cr(y.zoom,w,_)),E=[[0,0],[F.width,F.height]],ae=v.constrain()(ne,E,g);v.transform(Q,ae),v.wheelDelta(Pc),T.setState({d3Zoom:v,d3Selection:Q,d3ZoomHandler:Q.on("wheel.zoom"),transform:[ae.x,ae.y,ae.k],domNode:W.current.closest(".react-flow")})}},[]),j.useEffect(()=>{H&&$&&(a&&!L&&!M?H.on("wheel.zoom",F=>{if(lr(F,P))return!1;F.preventDefault(),F.stopImmediatePropagation();const v=H.property("__zoom").k||1,Q=mo();if(F.ctrlKey&&o&&Q){const ve=nn(F),ke=Pc(F),Be=v*Math.pow(2,ke);$.scaleTo(H,Be,ve,F);return}const ne=F.deltaMode===1?20:1;let E=d===Xn.Vertical?0:F.deltaX*ne,ae=d===Xn.Horizontal?0:F.deltaY*ne;!Q&&F.shiftKey&&d!==Xn.Vertical&&(E=F.deltaY*ne,ae=0),$.translateBy(H,-(E/v)*l,-(ae/v)*l,{internal:!0});const J=Ki(H.property("__zoom")),{onViewportChangeStart:le,onViewportChange:pe,onViewportChangeEnd:me}=T.getState();clearTimeout(X.current),G.current||(G.current=!0,t==null||t(F,J),le==null||le(J)),G.current&&(e==null||e(F,J),pe==null||pe(J),X.current=setTimeout(()=>{n==null||n(F,J),me==null||me(J),G.current=!1},150))},{passive:!1}):typeof B<"u"&&H.on("wheel.zoom",function(F,v){if(!k||lr(F,P))return null;F.preventDefault(),B.call(this,F,v)},{passive:!1}))},[M,a,d,H,$,B,L,o,k,P,t,e,n]),j.useEffect(()=>{$&&$.on("start",F=>{var ne,E;if(!F.sourceEvent||F.sourceEvent.internal)return null;A.current=(ne=F.sourceEvent)==null?void 0:ne.button;const{onViewportChangeStart:v}=T.getState(),Q=Ki(F.transform);V.current=!0,q.current=Q,((E=F.sourceEvent)==null?void 0:E.type)==="mousedown"&&T.setState({paneDragging:!0}),v==null||v(Q),t==null||t(F.sourceEvent,Q)})},[$,t]),j.useEffect(()=>{$&&(M&&!V.current?$.on("zoom",null):M||$.on("zoom",F=>{var Q;const{onViewportChange:v}=T.getState();if(T.setState({transform:[F.transform.x,F.transform.y,F.transform.k]}),U.current=!!(r&&Ec(p,A.current??0)),(e||v)&&!((Q=F.sourceEvent)!=null&&Q.internal)){const ne=Ki(F.transform);v==null||v(ne),e==null||e(F.sourceEvent,ne)}}))},[M,$,e,p,r]),j.useEffect(()=>{$&&$.on("end",F=>{if(!F.sourceEvent||F.sourceEvent.internal)return null;const{onViewportChangeEnd:v}=T.getState();if(V.current=!1,T.setState({paneDragging:!1}),r&&Ec(p,A.current??0)&&!U.current&&r(F.sourceEvent),U.current=!1,(n||v)&&Tw(q.current,F.transform)){const Q=Ki(F.transform);q.current=Q,clearTimeout(R.current),R.current=setTimeout(()=>{v==null||v(Q),n==null||n(F.sourceEvent,Q)},a?150:0)}})},[$,a,p,n,r]),j.useEffect(()=>{$&&$.filter(F=>{const v=L||i,Q=o&&F.ctrlKey;if((p===!0||Array.isArray(p)&&p.includes(1))&&F.button===1&&F.type==="mousedown"&&(lr(F,"react-flow__node")||lr(F,"react-flow__edge")))return!0;if(!p&&!v&&!a&&!f&&!o||M||!f&&F.type==="dblclick"||lr(F,P)&&F.type==="wheel"||lr(F,O)&&(F.type!=="wheel"||a&&F.type==="wheel"&&!L)||!o&&F.ctrlKey&&F.type==="wheel"||!v&&!a&&!Q&&F.type==="wheel"||!p&&(F.type==="mousedown"||F.type==="touchstart")||Array.isArray(p)&&!p.includes(F.button)&&(F.type==="mousedown"||F.type==="touchstart"))return!1;const ne=Array.isArray(p)&&p.includes(F.button)||!F.button||F.button<=1;return(!F.ctrlKey||F.type==="wheel")&&ne})},[M,$,i,o,a,f,p,h,L]),ee.createElement("div",{className:"react-flow__renderer",ref:W,style:Ba},C)},Dw=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Iw(){const{userSelectionActive:e,userSelectionRect:t}=it(Dw,Mt);return e&&t?ee.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Mc(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,i=t.position.y+t.height-n.height;if(r>0||i>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),i>0&&(n.style.height+=i),t.position.x<0){const o=Math.abs(t.position.x);n.position.x=n.position.x-o,n.style.width+=o,t.position.x=0}if(t.position.y<0){const o=Math.abs(t.position.y);n.position.y=n.position.y-o,n.style.height+=o,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function Nw(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,i)=>{const o=e.filter(l=>l.id===i.id);if(o.length===0)return r.push(i),r;const a={...i};for(const l of o)if(l)switch(l.type){case"select":{a.selected=l.selected;break}case"position":{typeof l.position<"u"&&(a.position=l.position),typeof l.positionAbsolute<"u"&&(a.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&Mc(r,a);break}case"dimensions":{typeof l.dimensions<"u"&&(a.width=l.dimensions.width,a.height=l.dimensions.height),typeof l.updateStyle<"u"&&(a.style={...a.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(a.resizing=l.resizing),a.expandParent&&Mc(r,a);break}case"remove":return r}return r.push(a),r},n)}function Lw(e,t){return Nw(e,t)}const jn=(e,t)=>({id:e,type:"select",selected:t});function gr(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(jn(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(jn(r.id,!1))),n},[])}const xs=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},Rw=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),xf=j.memo(({isSelecting:e,selectionMode:t=ci.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:a,onPaneScroll:l,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:h,children:p})=>{const y=j.useRef(null),g=ut(),w=j.useRef(0),_=j.useRef(0),S=j.useRef(),{userSelectionActive:k,elementsSelectable:C,dragging:P}=it(Rw,Mt),O=()=>{g.setState({userSelectionActive:!1,userSelectionRect:null}),w.current=0,_.current=0},R=B=>{o==null||o(B),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},T=B=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){B.preventDefault();return}a==null||a(B)},V=l?B=>l(B):void 0,U=B=>{const{resetSelectedElements:M,domNode:L}=g.getState();if(S.current=L==null?void 0:L.getBoundingClientRect(),!C||!e||B.button!==0||B.target!==y.current||!S.current)return;const{x:A,y:G}=Ln(B,S.current);M(),g.setState({userSelectionRect:{width:0,height:0,startX:A,startY:G,x:A,y:G}}),r==null||r(B)},W=B=>{const{userSelectionRect:M,nodeInternals:L,edges:A,transform:G,onNodesChange:X,onEdgesChange:F,nodeOrigin:v,getNodes:Q}=g.getState();if(!e||!S.current||!M)return;g.setState({userSelectionActive:!0,nodesSelectionActive:!1});const ne=Ln(B,S.current),E=M.startX??0,ae=M.startY??0,J={...M,x:ne.xke.id),ve=pe.map(ke=>ke.id);if(w.current!==ve.length){w.current=ve.length;const ke=gr(le,ve);ke.length&&(X==null||X(ke))}if(_.current!==me.length){_.current=me.length;const ke=gr(A,me);ke.length&&(F==null||F(ke))}g.setState({userSelectionRect:J})},q=B=>{if(B.button!==0)return;const{userSelectionRect:M}=g.getState();!k&&M&&B.target===y.current&&(R==null||R(B)),g.setState({nodesSelectionActive:w.current>0}),O(),i==null||i(B)},$=B=>{k&&(g.setState({nodesSelectionActive:w.current>0}),i==null||i(B)),O()},H=C&&(e||k);return ee.createElement("div",{className:Bt(["react-flow__pane",{dragging:P,selection:e}]),onClick:H?void 0:xs(R,y),onContextMenu:xs(T,y),onWheel:xs(V,y),onMouseEnter:H?void 0:d,onMouseDown:H?U:void 0,onMouseMove:H?W:f,onMouseUp:H?q:void 0,onMouseLeave:H?$:h,ref:y,style:Ba},p,ee.createElement(Iw,null))});xf.displayName="Pane";function wf(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:wf(n,t):!1}function jc(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function $w(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!wf(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,a;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((a=i.positionAbsolute)==null?void 0:a.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode,width:i.width,height:i.height,expandParent:i.expandParent}})}function zw(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function bf(e,t,n,r,i=[0,0],o){const a=zw(e,e.extent||r);let l=a;if(e.extent==="parent"&&!e.expandParent)if(e.parentNode&&e.width&&e.height){const h=n.get(e.parentNode),{x:p,y}=xr(h,i).positionAbsolute;l=h&&$t(p)&&$t(y)&&$t(h.width)&&$t(h.height)?[[p+e.width*i[0],y+e.height*i[1]],[p+h.width-e.width+e.width*i[0],y+h.height-e.height+e.height*i[1]]]:l}else o==null||o("005",wn.error005()),l=a;else if(e.extent&&e.parentNode&&e.extent!=="parent"){const h=n.get(e.parentNode),{x:p,y}=xr(h,i).positionAbsolute;l=[[e.extent[0][0]+p,e.extent[0][1]+y],[e.extent[1][0]+p,e.extent[1][1]+y]]}let d={x:0,y:0};if(e.parentNode){const h=n.get(e.parentNode);d=xr(h,i).positionAbsolute}const f=l&&l!=="parent"?Oa(t,l):t;return{position:{x:f.x-d.x,y:f.y-d.y},positionAbsolute:f}}function ws({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(i=>({...n.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?r.find(i=>i.id===e):r[0],r]}const Tc=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),a=t.getBoundingClientRect(),l={x:a.width*r[0],y:a.height*r[1]};return o.map(d=>{const f=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),position:d.getAttribute("data-handlepos"),x:(f.left-a.left-l.x)/n,y:(f.top-a.top-l.y)/n,...Ta(d)}})};function qr(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function Js({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:a,nodeInternals:l,onError:d}=t.getState(),f=l.get(e);if(!f){d==null||d("012",wn.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&a)&&(o({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):i([e])}function Bw(){const e=ut();return j.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=e.getState(),a=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,d={x:(a-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:o?i[0]*Math.round(d.x/i[0]):d.x,ySnapped:o?i[1]*Math.round(d.y/i[1]):d.y,...d}},[])}function bs(e){return(t,n,r)=>e==null?void 0:e(t,r)}function vf({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:a}){const l=ut(),[d,f]=j.useState(!1),h=j.useRef([]),p=j.useRef({x:null,y:null}),y=j.useRef(0),g=j.useRef(null),w=j.useRef({x:0,y:0}),_=j.useRef(null),S=j.useRef(!1),k=j.useRef(!1),C=Bw();return j.useEffect(()=>{if(e!=null&&e.current){const P=Ut(e.current),O=({x:V,y:U})=>{const{nodeInternals:W,onNodeDrag:q,onSelectionDrag:$,updateNodePositions:H,nodeExtent:B,snapGrid:M,snapToGrid:L,nodeOrigin:A,onError:G}=l.getState();p.current={x:V,y:U};let X=!1,F={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&B){const Q=Ra(h.current,A);F=Aa(Q)}if(h.current=h.current.map(Q=>{const ne={x:V-Q.distance.x,y:U-Q.distance.y};L&&(ne.x=M[0]*Math.round(ne.x/M[0]),ne.y=M[1]*Math.round(ne.y/M[1]));const E=[[B[0][0],B[0][1]],[B[1][0],B[1][1]]];h.current.length>1&&B&&!Q.extent&&(E[0][0]=Q.positionAbsolute.x-F.x+B[0][0],E[1][0]=Q.positionAbsolute.x+(Q.width??0)-F.x2+B[1][0],E[0][1]=Q.positionAbsolute.y-F.y+B[0][1],E[1][1]=Q.positionAbsolute.y+(Q.height??0)-F.y2+B[1][1]);const ae=bf(Q,ne,W,E,A,G);return X=X||Q.position.x!==ae.position.x||Q.position.y!==ae.position.y,Q.position=ae.position,Q.positionAbsolute=ae.positionAbsolute,Q}),!X)return;H(h.current,!0,!0),f(!0);const v=i?q:bs($);if(v&&_.current){const[Q,ne]=ws({nodeId:i,dragItems:h.current,nodeInternals:W});v(_.current,Q,ne)}},R=()=>{if(!g.current)return;const[V,U]=Yd(w.current,g.current);if(V!==0||U!==0){const{transform:W,panBy:q}=l.getState();p.current.x=(p.current.x??0)-V/W[2],p.current.y=(p.current.y??0)-U/W[2],q({x:V,y:U})&&O(p.current)}y.current=requestAnimationFrame(R)},T=V=>{var A;const{nodeInternals:U,multiSelectionActive:W,nodesDraggable:q,unselectNodesAndEdges:$,onNodeDragStart:H,onSelectionDragStart:B}=l.getState();k.current=!0;const M=i?H:bs(B);(!a||!o)&&!W&&i&&((A=U.get(i))!=null&&A.selected||$()),i&&o&&a&&Js({id:i,store:l,nodeRef:e});const L=C(V);if(p.current=L,h.current=$w(U,q,L,i),M&&h.current){const[G,X]=ws({nodeId:i,dragItems:h.current,nodeInternals:U});M(V.sourceEvent,G,X)}};if(t)P.on(".drag",null);else{const V=S5().on("start",U=>{const{domNode:W,nodeDragThreshold:q}=l.getState();q===0&&T(U);const $=C(U);p.current=$,g.current=(W==null?void 0:W.getBoundingClientRect())||null,w.current=Ln(U.sourceEvent,g.current)}).on("drag",U=>{var H,B;const W=C(U),{autoPanOnNodeDrag:q,nodeDragThreshold:$}=l.getState();if(!S.current&&k.current&&q&&(S.current=!0,R()),!k.current){const M=W.xSnapped-(((H=p==null?void 0:p.current)==null?void 0:H.x)??0),L=W.ySnapped-(((B=p==null?void 0:p.current)==null?void 0:B.y)??0);Math.sqrt(M*M+L*L)>$&&T(U)}(p.current.x!==W.xSnapped||p.current.y!==W.ySnapped)&&h.current&&k.current&&(_.current=U.sourceEvent,w.current=Ln(U.sourceEvent,g.current),O(W))}).on("end",U=>{if(k.current&&(f(!1),S.current=!1,k.current=!1,cancelAnimationFrame(y.current),h.current)){const{updateNodePositions:W,nodeInternals:q,onNodeDragStop:$,onSelectionDragStop:H}=l.getState(),B=i?$:bs(H);if(W(h.current,!1,!1),B){const[M,L]=ws({nodeId:i,dragItems:h.current,nodeInternals:q});B(U.sourceEvent,M,L)}}}).filter(U=>{const W=U.target;return!U.button&&(!n||!jc(W,`.${n}`,e))&&(!r||jc(W,r,e))});return P.call(V),()=>{P.on(".drag",null)}}}},[e,t,n,r,o,l,i,a,C]),d}function _f(){const e=ut();return j.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:a,snapToGrid:l,snapGrid:d,onError:f,nodesDraggable:h}=e.getState(),p=a().filter(C=>C.selected&&(C.draggable||h&&typeof C.draggable>"u")),y=l?d[0]:5,g=l?d[1]:5,w=n.isShiftPressed?4:1,_=n.x*y*w,S=n.y*g*w,k=p.map(C=>{if(C.positionAbsolute){const P={x:C.positionAbsolute.x+_,y:C.positionAbsolute.y+S};l&&(P.x=d[0]*Math.round(P.x/d[0]),P.y=d[1]*Math.round(P.y/d[1]));const{positionAbsolute:O,position:R}=bf(C,P,r,i,void 0,f);C.position=R,C.positionAbsolute=O}return C});o(k,!0,!1)},[])}const wr={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Xr=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:a,xPosOrigin:l,yPosOrigin:d,selected:f,onClick:h,onMouseEnter:p,onMouseMove:y,onMouseLeave:g,onContextMenu:w,onDoubleClick:_,style:S,className:k,isDraggable:C,isSelectable:P,isConnectable:O,isFocusable:R,selectNodesOnDrag:T,sourcePosition:V,targetPosition:U,hidden:W,resizeObserver:q,dragHandle:$,zIndex:H,isParent:B,noDragClassName:M,noPanClassName:L,initialized:A,disableKeyboardA11y:G,ariaLabel:X,rfId:F})=>{const v=ut(),Q=j.useRef(null),ne=j.useRef(V),E=j.useRef(U),ae=j.useRef(r),J=P||C||h||p||y||g,le=_f(),pe=qr(n,v.getState,p),me=qr(n,v.getState,y),ve=qr(n,v.getState,g),ke=qr(n,v.getState,w),Be=qr(n,v.getState,_),Je=ge=>{const{nodeDragThreshold:Ye}=v.getState();if(P&&(!T||!C||Ye>0)&&Js({id:n,store:v,nodeRef:Q}),h){const Ze=v.getState().nodeInternals.get(n);Ze&&h(ge,{...Ze})}},He=ge=>{if(!Zs(ge))if(Ud.includes(ge.key)&&P){const Ye=ge.key==="Escape";Js({id:n,store:v,unselect:Ye,nodeRef:Q})}else!G&&C&&f&&Object.prototype.hasOwnProperty.call(wr,ge.key)&&(v.setState({ariaLiveMessage:`Moved selected node ${ge.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~a}`}),le({x:wr[ge.key].x,y:wr[ge.key].y,isShiftPressed:ge.shiftKey}))};j.useEffect(()=>{if(Q.current&&!W){const ge=Q.current;return q==null||q.observe(ge),()=>q==null?void 0:q.unobserve(ge)}},[W]),j.useEffect(()=>{const ge=ae.current!==r,Ye=ne.current!==V,Ze=E.current!==U;Q.current&&(ge||Ye||Ze)&&(ge&&(ae.current=r),Ye&&(ne.current=V),Ze&&(E.current=U),v.getState().updateNodeDimensions([{id:n,nodeElement:Q.current,forceUpdate:!0}]))},[n,r,V,U]);const we=vf({nodeRef:Q,disabled:W||!C,noDragClassName:M,handleSelector:$,nodeId:n,isSelectable:P,selectNodesOnDrag:T});return W?null:ee.createElement("div",{className:Bt(["react-flow__node",`react-flow__node-${r}`,{[L]:C},k,{selected:f,selectable:P,parent:B,dragging:we}]),ref:Q,style:{zIndex:H,transform:`translate(${l}px,${d}px)`,pointerEvents:J?"all":"none",visibility:A?"visible":"hidden",...S},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:pe,onMouseMove:me,onMouseLeave:ve,onContextMenu:ke,onClick:Je,onDoubleClick:Be,onKeyDown:R?He:void 0,tabIndex:R?0:void 0,role:R?"button":void 0,"aria-describedby":G?void 0:`${ff}-${F}`,"aria-label":X},ee.createElement(J6,{value:n},ee.createElement(e,{id:n,data:i,type:r,xPos:o,yPos:a,selected:f,isConnectable:O,sourcePosition:V,targetPosition:U,dragging:we,dragHandle:$,zIndex:H})))};return t.displayName="NodeWrapper",j.memo(t)};const Fw=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Ra(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function Hw({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ut(),{width:i,height:o,x:a,y:l,transformString:d,userSelectionActive:f}=it(Fw,Mt),h=_f(),p=j.useRef(null);if(j.useEffect(()=>{var w;n||(w=p.current)==null||w.focus({preventScroll:!0})},[n]),vf({nodeRef:p}),f||!i||!o)return null;const y=e?w=>{const _=r.getState().getNodes().filter(S=>S.selected);e(w,_)}:void 0,g=w=>{Object.prototype.hasOwnProperty.call(wr,w.key)&&h({x:wr[w.key].x,y:wr[w.key].y,isShiftPressed:w.shiftKey})};return ee.createElement("div",{className:Bt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:d}},ee.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:o,top:l,left:a}}))}var Yw=j.memo(Hw);const Vw=e=>e.nodesSelectionActive,Sf=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,deleteKeyCode:l,onMove:d,onMoveStart:f,onMoveEnd:h,selectionKeyCode:p,selectionOnDrag:y,selectionMode:g,onSelectionStart:w,onSelectionEnd:_,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:C,elementsSelectable:P,zoomOnScroll:O,zoomOnPinch:R,panOnScroll:T,panOnScrollSpeed:V,panOnScrollMode:U,zoomOnDoubleClick:W,panOnDrag:q,defaultViewport:$,translateExtent:H,minZoom:B,maxZoom:M,preventScrolling:L,onSelectionContextMenu:A,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:F})=>{const v=it(Vw),Q=ui(p),ne=ui(k),E=ne||q,ae=ne||T,J=Q||y&&E!==!0;return Mw({deleteKeyCode:l,multiSelectionKeyCode:S}),ee.createElement(Aw,{onMove:d,onMoveStart:f,onMoveEnd:h,onPaneContextMenu:o,elementsSelectable:P,zoomOnScroll:O,zoomOnPinch:R,panOnScroll:ae,panOnScrollSpeed:V,panOnScrollMode:U,zoomOnDoubleClick:W,panOnDrag:!Q&&E,defaultViewport:$,translateExtent:H,minZoom:B,maxZoom:M,zoomActivationKeyCode:C,preventScrolling:L,noWheelClassName:G,noPanClassName:X},ee.createElement(xf,{onSelectionStart:w,onSelectionEnd:_,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:E,isSelecting:!!J,selectionMode:g},e,v&&ee.createElement(Yw,{onSelectionContextMenu:A,noPanClassName:X,disableKeyboardA11y:F})))};Sf.displayName="FlowRenderer";var Uw=j.memo(Sf);function Ww(e){return it(j.useCallback(n=>e?Qd(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function Gw(e){const t={input:Xr(e.input||lf),default:Xr(e.default||Qs),output:Xr(e.output||uf),group:Xr(e.group||za)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=Xr(e[o]||Qs),i),n);return{...t,...r}}const Zw=({x:e,y:t,width:n,height:r,origin:i})=>!n||!r?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-n*i[0],y:t-r*i[1]},qw=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),kf=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:a}=it(qw,Mt),l=Ww(e.onlyRenderVisibleElements),d=j.useRef(),f=j.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(p=>{const y=p.map(g=>({id:g.target.getAttribute("data-id"),nodeElement:g.target,forceUpdate:!0}));o(y)});return d.current=h,h},[]);return j.useEffect(()=>()=>{var h;(h=d==null?void 0:d.current)==null||h.disconnect()},[]),ee.createElement("div",{className:"react-flow__nodes",style:Ba},l.map(h=>{var R,T;let p=h.type||"default";e.nodeTypes[p]||(a==null||a("003",wn.error003(p)),p="default");const y=e.nodeTypes[p]||e.nodeTypes.default,g=!!(h.draggable||t&&typeof h.draggable>"u"),w=!!(h.selectable||i&&typeof h.selectable>"u"),_=!!(h.connectable||n&&typeof h.connectable>"u"),S=!!(h.focusable||r&&typeof h.focusable>"u"),k=e.nodeExtent?Oa(h.positionAbsolute,e.nodeExtent):h.positionAbsolute,C=(k==null?void 0:k.x)??0,P=(k==null?void 0:k.y)??0,O=Zw({x:C,y:P,width:h.width??0,height:h.height??0,origin:e.nodeOrigin});return ee.createElement(y,{key:h.id,id:h.id,className:h.className,style:h.style,type:p,data:h.data,sourcePosition:h.sourcePosition||he.Bottom,targetPosition:h.targetPosition||he.Top,hidden:h.hidden,xPos:C,yPos:P,xPosOrigin:O.x,yPosOrigin:O.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!h.selected,isDraggable:g,isSelectable:w,isConnectable:_,isFocusable:S,resizeObserver:f,dragHandle:h.dragHandle,zIndex:((R=h[lt])==null?void 0:R.z)??0,isParent:!!((T=h[lt])!=null&&T.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!h.width&&!!h.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:h.ariaLabel})}))};kf.displayName="NodeRenderer";var Xw=j.memo(kf);const Kw=(e,t,n)=>n===he.Left?e-t:n===he.Right?e+t:e,Qw=(e,t,n)=>n===he.Top?e-t:n===he.Bottom?e+t:e,Oc="react-flow__edgeupdater",Ac=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:a,type:l})=>ee.createElement("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:a,className:Bt([Oc,`${Oc}-${l}`]),cx:Kw(t,r,e),cy:Qw(n,r,e),r,stroke:"transparent",fill:"transparent"}),Jw=()=>!0;var cr=e=>{const t=({id:n,className:r,type:i,data:o,onClick:a,onEdgeDoubleClick:l,selected:d,animated:f,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:w,labelBgBorderRadius:_,style:S,source:k,target:C,sourceX:P,sourceY:O,targetX:R,targetY:T,sourcePosition:V,targetPosition:U,elementsSelectable:W,hidden:q,sourceHandleId:$,targetHandleId:H,onContextMenu:B,onMouseEnter:M,onMouseMove:L,onMouseLeave:A,edgeUpdaterRadius:G,onEdgeUpdate:X,onEdgeUpdateStart:F,onEdgeUpdateEnd:v,markerEnd:Q,markerStart:ne,rfId:E,ariaLabel:ae,isFocusable:J,isUpdatable:le,pathOptions:pe,interactionWidth:me})=>{const ve=j.useRef(null),[ke,Be]=j.useState(!1),[Je,He]=j.useState(!1),we=ut(),ge=j.useMemo(()=>`url(#${Xs(ne,E)})`,[ne,E]),Ye=j.useMemo(()=>`url(#${Xs(Q,E)})`,[Q,E]);if(q)return null;const Ze=ye=>{var be;const{edges:fe,addSelectedEdges:_e,unselectNodesAndEdges:je,multiSelectionActive:Ve}=we.getState(),Ae=fe.find(tt=>tt.id===n);Ae&&(W&&(we.setState({nodesSelectionActive:!1}),Ae.selected&&Ve?(je({nodes:[],edges:[Ae]}),(be=ve.current)==null||be.blur()):_e([n])),a&&a(ye,Ae))},ue=Zr(n,we.getState,l),dt=Zr(n,we.getState,B),Ne=Zr(n,we.getState,M),Le=Zr(n,we.getState,L),Xe=Zr(n,we.getState,A),ft=(ye,fe)=>{if(ye.button!==0)return;const{edges:_e,isValidConnection:je}=we.getState(),Ve=fe?C:k,Ae=(fe?H:$)||null,be=fe?"target":"source",tt=je||Jw,qt=fe,jt=_e.find(St=>St.id===n);He(!0),F==null||F(ye,jt,be);const De=St=>{He(!1),v==null||v(St,jt,be)};rf({event:ye,handleId:Ae,nodeId:Ve,onConnect:St=>X==null?void 0:X(jt,St),isTarget:qt,getState:we.getState,setState:we.setState,isValidConnection:tt,edgeUpdaterType:be,onEdgeUpdateEnd:De})},ht=ye=>ft(ye,!0),D=ye=>ft(ye,!1),Z=()=>Be(!0),te=()=>Be(!1),se=!W&&!a,re=ye=>{var fe;if(Ud.includes(ye.key)&&W){const{unselectNodesAndEdges:_e,addSelectedEdges:je,edges:Ve}=we.getState();ye.key==="Escape"?((fe=ve.current)==null||fe.blur(),_e({edges:[Ve.find(be=>be.id===n)]})):je([n])}};return ee.createElement("g",{className:Bt(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:d,animated:f,inactive:se,updating:ke}]),onClick:Ze,onDoubleClick:ue,onContextMenu:dt,onMouseEnter:Ne,onMouseMove:Le,onMouseLeave:Xe,onKeyDown:J?re:void 0,tabIndex:J?0:void 0,role:J?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":ae===null?void 0:ae||`Edge from ${k} to ${C}`,"aria-describedby":J?`${hf}-${E}`:void 0,ref:ve},!Je&&ee.createElement(e,{id:n,source:k,target:C,selected:d,animated:f,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:w,labelBgBorderRadius:_,data:o,style:S,sourceX:P,sourceY:O,targetX:R,targetY:T,sourcePosition:V,targetPosition:U,sourceHandleId:$,targetHandleId:H,markerStart:ge,markerEnd:Ye,pathOptions:pe,interactionWidth:me}),le&&ee.createElement(ee.Fragment,null,(le==="source"||le===!0)&&ee.createElement(Ac,{position:V,centerX:P,centerY:O,radius:G,onMouseDown:ht,onMouseEnter:Z,onMouseOut:te,type:"source"}),(le==="target"||le===!0)&&ee.createElement(Ac,{position:U,centerX:R,centerY:T,radius:G,onMouseDown:D,onMouseEnter:Z,onMouseOut:te,type:"target"})))};return t.displayName="EdgeWrapper",j.memo(t)};function e4(e){const t={default:cr(e.default||yo),straight:cr(e.bezier||Na),step:cr(e.step||Ia),smoothstep:cr(e.step||To),simplebezier:cr(e.simplebezier||Da)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=cr(e[o]||yo),i),n);return{...t,...r}}function Dc(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,a=(n==null?void 0:n.height)||t.height;switch(e){case he.Top:return{x:r+o/2,y:i};case he.Right:return{x:r+o,y:i+a/2};case he.Bottom:return{x:r+o/2,y:i+a};case he.Left:return{x:r,y:i+a/2}}}function Ic(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const t4=(e,t,n,r,i,o)=>{const a=Dc(n,e,t),l=Dc(o,r,i);return{sourceX:a.x,sourceY:a.y,targetX:l.x,targetY:l.y}};function n4({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:a,height:l,transform:d}){const f={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+o)};f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const h=Aa({x:(0-d[0])/d[2],y:(0-d[1])/d[2],width:a/d[2],height:l/d[2]}),p=Math.max(0,Math.min(h.x2,f.x2)-Math.max(h.x,f.x)),y=Math.max(0,Math.min(h.y2,f.y2)-Math.max(h.y,f.y));return Math.ceil(p*y)>0}function Nc(e){var r,i,o,a,l;const t=((r=e==null?void 0:e[lt])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.x)||0,y:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const r4=[{level:0,isMaxLevel:!0,edges:[]}];function i4(e,t,n=!1){let r=-1;const i=e.reduce((a,l)=>{var h,p;const d=$t(l.zIndex);let f=d?l.zIndex:0;if(n){const y=t.get(l.target),g=t.get(l.source),w=l.selected||(y==null?void 0:y.selected)||(g==null?void 0:g.selected),_=Math.max(((h=g==null?void 0:g[lt])==null?void 0:h.z)||0,((p=y==null?void 0:y[lt])==null?void 0:p.z)||0,1e3);f=(d?l.zIndex:0)+(w?_:0)}return a[f]?a[f].push(l):a[f]=[l],r=f>r?f:r,a},{}),o=Object.entries(i).map(([a,l])=>{const d=+a;return{edges:l,level:d,isMaxLevel:d===r}});return o.length===0?r4:o}function o4(e,t,n){const r=it(j.useCallback(i=>e?i.edges.filter(o=>{const a=t.get(o.source),l=t.get(o.target);return(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&n4({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:l.width,targetHeight:l.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return i4(r,t,n)}const s4=({color:e="none",strokeWidth:t=1})=>ee.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),a4=({color:e="none",strokeWidth:t=1})=>ee.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Lc={[go.Arrow]:s4,[go.ArrowClosed]:a4};function l4(e){const t=ut();return j.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(Lc,e)?Lc[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",wn.error009(e)),null)},[e])}const c4=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const d=l4(t);return d?ee.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0"},ee.createElement(d,{color:n,strokeWidth:a})):null},u4=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const l=Xs(a,t);r.includes(l)||(i.push({id:l,color:a.color||e,...a}),r.push(l))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},Cf=({defaultColor:e,rfId:t})=>{const n=it(j.useCallback(u4({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,a)=>o.id!==i[a].id)));return ee.createElement("defs",null,n.map(r=>ee.createElement(c4,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};Cf.displayName="MarkerDefinitions";var d4=j.memo(Cf);const f4=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Ef=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeUpdate:a,onEdgeContextMenu:l,onEdgeMouseEnter:d,onEdgeMouseMove:f,onEdgeMouseLeave:h,onEdgeClick:p,edgeUpdaterRadius:y,onEdgeDoubleClick:g,onEdgeUpdateStart:w,onEdgeUpdateEnd:_,children:S})=>{const{edgesFocusable:k,edgesUpdatable:C,elementsSelectable:P,width:O,height:R,connectionMode:T,nodeInternals:V,onError:U}=it(f4,Mt),W=o4(t,V,n);return O?ee.createElement(ee.Fragment,null,W.map(({level:q,edges:$,isMaxLevel:H})=>ee.createElement("svg",{key:q,style:{zIndex:q},width:O,height:R,className:"react-flow__edges react-flow__container"},H&&ee.createElement(d4,{defaultColor:e,rfId:r}),ee.createElement("g",null,$.map(B=>{const[M,L,A]=Nc(V.get(B.source)),[G,X,F]=Nc(V.get(B.target));if(!A||!F)return null;let v=B.type||"default";i[v]||(U==null||U("011",wn.error011(v)),v="default");const Q=i[v]||i.default,ne=T===Jn.Strict?X.target:(X.target??[]).concat(X.source??[]),E=Ic(L.source,B.sourceHandle),ae=Ic(ne,B.targetHandle),J=(E==null?void 0:E.position)||he.Bottom,le=(ae==null?void 0:ae.position)||he.Top,pe=!!(B.focusable||k&&typeof B.focusable>"u"),me=typeof a<"u"&&(B.updatable||C&&typeof B.updatable>"u");if(!E||!ae)return U==null||U("008",wn.error008(E,B)),null;const{sourceX:ve,sourceY:ke,targetX:Be,targetY:Je}=t4(M,E,J,G,ae,le);return ee.createElement(Q,{key:B.id,id:B.id,className:Bt([B.className,o]),type:v,data:B.data,selected:!!B.selected,animated:!!B.animated,hidden:!!B.hidden,label:B.label,labelStyle:B.labelStyle,labelShowBg:B.labelShowBg,labelBgStyle:B.labelBgStyle,labelBgPadding:B.labelBgPadding,labelBgBorderRadius:B.labelBgBorderRadius,style:B.style,source:B.source,target:B.target,sourceHandleId:B.sourceHandle,targetHandleId:B.targetHandle,markerEnd:B.markerEnd,markerStart:B.markerStart,sourceX:ve,sourceY:ke,targetX:Be,targetY:Je,sourcePosition:J,targetPosition:le,elementsSelectable:P,onEdgeUpdate:a,onContextMenu:l,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onClick:p,edgeUpdaterRadius:y,onEdgeDoubleClick:g,onEdgeUpdateStart:w,onEdgeUpdateEnd:_,rfId:r,ariaLabel:B.ariaLabel,isFocusable:pe,isUpdatable:me,pathOptions:"pathOptions"in B?B.pathOptions:void 0,interactionWidth:B.interactionWidth})})))),S):null};Ef.displayName="EdgeRenderer";var h4=j.memo(Ef);const p4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function m4({children:e}){const t=it(p4);return ee.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function g4(e){const t=yf(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const y4={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top},Pf=({nodeId:e,handleType:t,style:n,type:r=Tn.Bezier,CustomComponent:i,connectionStatus:o})=>{var T,V,U;const{fromNode:a,handleId:l,toX:d,toY:f,connectionMode:h}=it(j.useCallback(W=>({fromNode:W.nodeInternals.get(e),handleId:W.connectionHandleId,toX:(W.connectionPosition.x-W.transform[0])/W.transform[2],toY:(W.connectionPosition.y-W.transform[1])/W.transform[2],connectionMode:W.connectionMode}),[e]),Mt),p=(T=a==null?void 0:a[lt])==null?void 0:T.handleBounds;let y=p==null?void 0:p[t];if(h===Jn.Loose&&(y=y||(p==null?void 0:p[t==="source"?"target":"source"])),!a||!y)return null;const g=l?y.find(W=>W.id===l):y[0],w=g?g.x+g.width/2:(a.width??0)/2,_=g?g.y+g.height/2:a.height??0,S=(((V=a.positionAbsolute)==null?void 0:V.x)??0)+w,k=(((U=a.positionAbsolute)==null?void 0:U.y)??0)+_,C=g==null?void 0:g.position,P=C?y4[C]:null;if(!C||!P)return null;if(i)return ee.createElement(i,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:g,fromX:S,fromY:k,toX:d,toY:f,fromPosition:C,toPosition:P,connectionStatus:o});let O="";const R={sourceX:S,sourceY:k,sourcePosition:C,targetX:d,targetY:f,targetPosition:P};return r===Tn.Bezier?[O]=Xd(R):r===Tn.Step?[O]=qs({...R,borderRadius:0}):r===Tn.SmoothStep?[O]=qs(R):r===Tn.SimpleBezier?[O]=qd(R):O=`M${S},${k} ${d},${f}`,ee.createElement("path",{d:O,fill:"none",className:"react-flow__connection-path",style:n})};Pf.displayName="ConnectionLine";const x4=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function w4({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:a,width:l,height:d,connectionStatus:f}=it(x4,Mt);return!(i&&o&&l&&a)?null:ee.createElement("svg",{style:e,width:l,height:d,className:"react-flow__edges react-flow__connectionline react-flow__container"},ee.createElement("g",{className:Bt(["react-flow__connection",f])},ee.createElement(Pf,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:f})))}function Rc(e,t){return j.useRef(null),ut(),j.useMemo(()=>t(e),[e])}const Mf=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:a,onEdgeClick:l,onNodeDoubleClick:d,onEdgeDoubleClick:f,onNodeMouseEnter:h,onNodeMouseMove:p,onNodeMouseLeave:y,onNodeContextMenu:g,onSelectionContextMenu:w,onSelectionStart:_,onSelectionEnd:S,connectionLineType:k,connectionLineStyle:C,connectionLineComponent:P,connectionLineContainerStyle:O,selectionKeyCode:R,selectionOnDrag:T,selectionMode:V,multiSelectionKeyCode:U,panActivationKeyCode:W,zoomActivationKeyCode:q,deleteKeyCode:$,onlyRenderVisibleElements:H,elementsSelectable:B,selectNodesOnDrag:M,defaultViewport:L,translateExtent:A,minZoom:G,maxZoom:X,preventScrolling:F,defaultMarkerColor:v,zoomOnScroll:Q,zoomOnPinch:ne,panOnScroll:E,panOnScrollSpeed:ae,panOnScrollMode:J,zoomOnDoubleClick:le,panOnDrag:pe,onPaneClick:me,onPaneMouseEnter:ve,onPaneMouseMove:ke,onPaneMouseLeave:Be,onPaneScroll:Je,onPaneContextMenu:He,onEdgeUpdate:we,onEdgeContextMenu:ge,onEdgeMouseEnter:Ye,onEdgeMouseMove:Ze,onEdgeMouseLeave:ue,edgeUpdaterRadius:dt,onEdgeUpdateStart:Ne,onEdgeUpdateEnd:Le,noDragClassName:Xe,noWheelClassName:ft,noPanClassName:ht,elevateEdgesOnSelect:D,disableKeyboardA11y:Z,nodeOrigin:te,nodeExtent:se,rfId:re})=>{const ye=Rc(e,Gw),fe=Rc(t,e4);return g4(o),ee.createElement(Uw,{onPaneClick:me,onPaneMouseEnter:ve,onPaneMouseMove:ke,onPaneMouseLeave:Be,onPaneContextMenu:He,onPaneScroll:Je,deleteKeyCode:$,selectionKeyCode:R,selectionOnDrag:T,selectionMode:V,onSelectionStart:_,onSelectionEnd:S,multiSelectionKeyCode:U,panActivationKeyCode:W,zoomActivationKeyCode:q,elementsSelectable:B,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:Q,zoomOnPinch:ne,zoomOnDoubleClick:le,panOnScroll:E,panOnScrollSpeed:ae,panOnScrollMode:J,panOnDrag:pe,defaultViewport:L,translateExtent:A,minZoom:G,maxZoom:X,onSelectionContextMenu:w,preventScrolling:F,noDragClassName:Xe,noWheelClassName:ft,noPanClassName:ht,disableKeyboardA11y:Z},ee.createElement(m4,null,ee.createElement(h4,{edgeTypes:fe,onEdgeClick:l,onEdgeDoubleClick:f,onEdgeUpdate:we,onlyRenderVisibleElements:H,onEdgeContextMenu:ge,onEdgeMouseEnter:Ye,onEdgeMouseMove:Ze,onEdgeMouseLeave:ue,onEdgeUpdateStart:Ne,onEdgeUpdateEnd:Le,edgeUpdaterRadius:dt,defaultMarkerColor:v,noPanClassName:ht,elevateEdgesOnSelect:!!D,disableKeyboardA11y:Z,rfId:re},ee.createElement(w4,{style:C,type:k,component:P,containerStyle:O})),ee.createElement("div",{className:"react-flow__edgelabel-renderer"}),ee.createElement(Xw,{nodeTypes:ye,onNodeClick:a,onNodeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:p,onNodeMouseLeave:y,onNodeContextMenu:g,selectNodesOnDrag:M,onlyRenderVisibleElements:H,noPanClassName:ht,noDragClassName:Xe,disableKeyboardA11y:Z,nodeOrigin:te,nodeExtent:se,rfId:re})))};Mf.displayName="GraphView";var b4=j.memo(Mf);const ea=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Pn={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:ea,nodeExtent:ea,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Jn.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:G6,isValidConnection:void 0},v4=()=>$2((e,t)=>({...Pn,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:ys(n,r,i,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",o=typeof r<"u",a=i?ys(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:a,fitViewOnInitOptions:l,domNode:d,nodeOrigin:f}=t(),h=d==null?void 0:d.querySelector(".react-flow__viewport");if(!h)return;const p=window.getComputedStyle(h),{m22:y}=new window.DOMMatrixReadOnly(p.transform),g=n.reduce((_,S)=>{const k=i.get(S.id);if(k){const C=Ta(S.nodeElement);!!(C.width&&C.height&&(k.width!==C.width||k.height!==C.height||S.forceUpdate))&&(i.set(k.id,{...k,[lt]:{...k[lt],handleBounds:{source:Tc(".source",S.nodeElement,y,f),target:Tc(".target",S.nodeElement,y,f)}},...C}),_.push({id:k.id,type:"dimensions",dimensions:C}))}return _},[]);mf(i,f);const w=a||o&&!a&&gf(t,{initial:!0,...l});e({nodeInternals:new Map(i),fitViewOnInitDone:w}),(g==null?void 0:g.length)>0&&(r==null||r(g))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:o}=t(),a=n.map(l=>{const d={id:l.id,type:"position",dragging:i};return r&&(d.positionAbsolute=l.positionAbsolute,d.position=l.position),d});o(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:a,getNodes:l,elevateNodesOnSelect:d}=t();if(n!=null&&n.length){if(o){const f=Lw(n,l()),h=ys(f,i,a,d);e({nodeInternals:h})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,l=null;r?a=n.map(d=>jn(d,!0)):(a=gr(o(),n),l=gr(i,[])),Xi({changedNodes:a,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,l=null;r?a=n.map(d=>jn(d,!0)):(a=gr(i,n),l=gr(o(),[])),Xi({changedNodes:l,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),a=n||o(),l=r||i,d=a.map(h=>(h.selected=!1,jn(h.id,!1))),f=l.map(h=>jn(h.id,!1));Xi({changedNodes:d,changedEdges:f,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(l=>l.selected).map(l=>jn(l.id,!1)),a=n.filter(l=>l.selected).map(l=>jn(l.id,!1));Xi({changedNodes:o,changedEdges:a,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=Oa(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:a,d3Selection:l,translateExtent:d}=t();if(!a||!l||!n.x&&!n.y)return!1;const f=Nn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),h=[[0,0],[i,o]],p=a==null?void 0:a.constrain()(f,h,d);return a.transform(l,p),r[0]!==p.x||r[1]!==p.y||r[2]!==p.k},cancelConnection:()=>e({connectionNodeId:Pn.connectionNodeId,connectionHandleId:Pn.connectionHandleId,connectionHandleType:Pn.connectionHandleType,connectionStatus:Pn.connectionStatus,connectionStartHandle:Pn.connectionStartHandle,connectionEndHandle:Pn.connectionEndHandle}),reset:()=>e({...Pn})}),Object.is),jf=({children:e})=>{const t=j.useRef(null);return t.current||(t.current=v4()),ee.createElement($6,{value:t.current},e)};jf.displayName="ReactFlowProvider";const Tf=({children:e})=>j.useContext(jo)?ee.createElement(ee.Fragment,null,e):ee.createElement(jf,null,e);Tf.displayName="ReactFlowWrapper";const _4={input:lf,default:Qs,output:uf,group:za},S4={default:yo,straight:Na,step:Ia,smoothstep:To,simplebezier:Da},k4=[0,0],C4=[15,15],E4={x:0,y:0,zoom:1},P4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Of=j.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=_4,edgeTypes:a=S4,onNodeClick:l,onEdgeClick:d,onInit:f,onMove:h,onMoveStart:p,onMoveEnd:y,onConnect:g,onConnectStart:w,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:C,onNodeMouseMove:P,onNodeMouseLeave:O,onNodeContextMenu:R,onNodeDoubleClick:T,onNodeDragStart:V,onNodeDrag:U,onNodeDragStop:W,onNodesDelete:q,onEdgesDelete:$,onSelectionChange:H,onSelectionDragStart:B,onSelectionDrag:M,onSelectionDragStop:L,onSelectionContextMenu:A,onSelectionStart:G,onSelectionEnd:X,connectionMode:F=Jn.Strict,connectionLineType:v=Tn.Bezier,connectionLineStyle:Q,connectionLineComponent:ne,connectionLineContainerStyle:E,deleteKeyCode:ae="Backspace",selectionKeyCode:J="Shift",selectionOnDrag:le=!1,selectionMode:pe=ci.Full,panActivationKeyCode:me="Space",multiSelectionKeyCode:ve=mo()?"Meta":"Control",zoomActivationKeyCode:ke=mo()?"Meta":"Control",snapToGrid:Be=!1,snapGrid:Je=C4,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:we=!0,nodesDraggable:ge,nodesConnectable:Ye,nodesFocusable:Ze,nodeOrigin:ue=k4,edgesFocusable:dt,edgesUpdatable:Ne,elementsSelectable:Le,defaultViewport:Xe=E4,minZoom:ft=.5,maxZoom:ht=2,translateExtent:D=ea,preventScrolling:Z=!0,nodeExtent:te,defaultMarkerColor:se="#b1b1b7",zoomOnScroll:re=!0,zoomOnPinch:ye=!0,panOnScroll:fe=!1,panOnScrollSpeed:_e=.5,panOnScrollMode:je=Xn.Free,zoomOnDoubleClick:Ve=!0,panOnDrag:Ae=!0,onPaneClick:be,onPaneMouseEnter:tt,onPaneMouseMove:qt,onPaneMouseLeave:jt,onPaneScroll:De,onPaneContextMenu:bn,children:St,onEdgeUpdate:Xt,onEdgeContextMenu:vn,onEdgeDoubleClick:Kt,onEdgeMouseEnter:Qt,onEdgeMouseMove:Jt,onEdgeMouseLeave:Fn,onEdgeUpdateStart:en,onEdgeUpdateEnd:Or,edgeUpdaterRadius:an=10,onNodesChange:_n,onEdgesChange:ce,noDragClassName:Ar="nodrag",noWheelClassName:Dr="nowheel",noPanClassName:ot="nopan",fitView:Hn=!1,fitViewOptions:Te,connectOnClick:Ht=!0,attributionPosition:Ir,proOptions:Pe,defaultEdgeOptions:$e,elevateNodesOnSelect:pt=!0,elevateEdgesOnSelect:Ue=!1,disableKeyboardA11y:Ke=!1,autoPanOnConnect:Yt=!0,autoPanOnNodeDrag:ln=!0,connectionRadius:Bo=20,isValidConnection:Fo,onError:Ho,style:et,id:Yn,nodeDragThreshold:Yo,...Si},ki)=>{const Nr=Yn||"1";return ee.createElement("div",{...Si,style:{...et,...P4},ref:ki,className:Bt(["react-flow",i]),"data-testid":"rf__wrapper",id:Yn},ee.createElement(Tf,null,ee.createElement(b4,{onInit:f,onMove:h,onMoveStart:p,onMoveEnd:y,onNodeClick:l,onEdgeClick:d,onNodeMouseEnter:C,onNodeMouseMove:P,onNodeMouseLeave:O,onNodeContextMenu:R,onNodeDoubleClick:T,nodeTypes:o,edgeTypes:a,connectionLineType:v,connectionLineStyle:Q,connectionLineComponent:ne,connectionLineContainerStyle:E,selectionKeyCode:J,selectionOnDrag:le,selectionMode:pe,deleteKeyCode:ae,multiSelectionKeyCode:ve,panActivationKeyCode:me,zoomActivationKeyCode:ke,onlyRenderVisibleElements:He,selectNodesOnDrag:we,defaultViewport:Xe,translateExtent:D,minZoom:ft,maxZoom:ht,preventScrolling:Z,zoomOnScroll:re,zoomOnPinch:ye,zoomOnDoubleClick:Ve,panOnScroll:fe,panOnScrollSpeed:_e,panOnScrollMode:je,panOnDrag:Ae,onPaneClick:be,onPaneMouseEnter:tt,onPaneMouseMove:qt,onPaneMouseLeave:jt,onPaneScroll:De,onPaneContextMenu:bn,onSelectionContextMenu:A,onSelectionStart:G,onSelectionEnd:X,onEdgeUpdate:Xt,onEdgeContextMenu:vn,onEdgeDoubleClick:Kt,onEdgeMouseEnter:Qt,onEdgeMouseMove:Jt,onEdgeMouseLeave:Fn,onEdgeUpdateStart:en,onEdgeUpdateEnd:Or,edgeUpdaterRadius:an,defaultMarkerColor:se,noDragClassName:Ar,noWheelClassName:Dr,noPanClassName:ot,elevateEdgesOnSelect:Ue,rfId:Nr,disableKeyboardA11y:Ke,nodeOrigin:ue,nodeExtent:te}),ee.createElement(gw,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:w,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:ge,nodesConnectable:Ye,nodesFocusable:Ze,edgesFocusable:dt,edgesUpdatable:Ne,elementsSelectable:Le,elevateNodesOnSelect:pt,minZoom:ft,maxZoom:ht,nodeExtent:te,onNodesChange:_n,onEdgesChange:ce,snapToGrid:Be,snapGrid:Je,connectionMode:F,translateExtent:D,connectOnClick:Ht,defaultEdgeOptions:$e,fitView:Hn,fitViewOptions:Te,onNodesDelete:q,onEdgesDelete:$,onNodeDragStart:V,onNodeDrag:U,onNodeDragStop:W,onSelectionDrag:M,onSelectionDragStart:B,onSelectionDragStop:L,noPanClassName:ot,nodeOrigin:ue,rfId:Nr,autoPanOnConnect:Yt,autoPanOnNodeDrag:ln,onError:Ho,connectionRadius:Bo,isValidConnection:Fo,nodeDragThreshold:Yo}),ee.createElement(pw,{onSelectionChange:H}),St,ee.createElement(F6,{proOptions:Pe,position:Ir}),ee.createElement(vw,{rfId:Nr,disableKeyboardA11y:Ke})))});Of.displayName="ReactFlow";const Af=async(e,t)=>{const n=await Fm();try{await pa.post("/ask_question",JSON.stringify(e),{Authorization:n})}catch(r){if(r.status===402){await Hm(t),await Af(e,t);return}throw r}},M4=48,j4=8,T4={PaperProps:{style:{maxHeight:M4*4.5+j4,width:250}}},O4=["Beginner","Intermediate","Advanced","Expert"],A4=()=>{const e=zt(C=>C.dataInitial),[t,n]=j.useState(""),[r,i]=j.useState("Beginner"),o=vt(C=>C.currentSearch),a=kg(),[l]=So(C=>[C.setBudget]),[d,f,h,p,y]=id(C=>[C.askedQuestions,C.askedQuestionsAnswers,C.setAskedQuestion,C.setAskedQuestionAnswer,C.hasQuestionInProgress]),g=j.useCallback(C=>{p(C.answer)},[p]);j.useEffect(()=>{a&&g&&a.on("askquestionhook",g)},[g,a]);const w=async()=>{t&&(h(t),n(""));try{const C=e==null?void 0:e.nodes.filter(R=>R.text),P=C==null?void 0:C.slice(0,5),O=(P!=null&&P.length?P.map(R=>R.text).join(" "):"").substring(0,2500).replace(/[?&=+/#]/g,R=>`\\${R}`);o&&(await Zn.enable(),await Af({expertise_level:r,question_text:t,search_term:o,transcripts:O},l),await Ym(l))}catch(C){console.error(C)}},_=r&&t.trim()&&!y,S=C=>{i(C.target.value)},k=async C=>{if(y){C.preventDefault();return}C.keyCode===13&&C.shiftKey===!1&&_&&(C.preventDefault(),w())};return u.jsxs(D4,{children:[u.jsx(z,{children:u.jsx(z,{children:u.jsxs(ed,{component:"div",children:[u.jsx(N4,{id:"select-label",size:"small",children:"Expertise level"}),u.jsx(L4,{id:"demo-multiple-name",input:u.jsx(Cg,{label:"Expertise level"}),labelId:"select-label",MenuProps:T4,onChange:S,size:"small",value:r,children:O4.map(C=>u.jsx(ly,{component:"li",value:C,children:C},C))})]})})}),u.jsx(z4,{children:d==null?void 0:d.map((C,P)=>u.jsxs(z,{className:"response",py:12,children:[u.jsx(Fe,{kind:"medium",children:C}),u.jsx(z,{py:12,children:(f==null?void 0:f[P])!==void 0?u.jsx(Fe,{color:"unreadMsgText",children:f[P]}):u.jsxs(z,{align:"center",py:12,children:[u.jsx(z,{align:"center",py:12,children:u.jsx(od,{color:N.white})}),u.jsx(z,{align:"center",py:12,children:u.jsx(Fe,{children:"Generating response"})})]})})]},C))}),u.jsxs(R4,{onKeyDown:k,py:12,tabIndex:-1,children:[u.jsx(I4,{disabled:y,onChange:C=>n(C.target.value),placeholder:"Enter your question",value:t}),u.jsx($4,{children:u.jsx(Eg,{color:_?N.white:N.gray300,size:"18"})})]})]})},D4=Y.div` +`,L2=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"cancel",children:[u.jsx("mask",{id:"mask0_1264_3381",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"32",height:"32",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1264_3381)",children:u.jsx("path",{id:"cancel_2",d:"M16 17.4051L20.0975 21.5025C20.2821 21.6872 20.5141 21.7816 20.7936 21.7859C21.0731 21.7902 21.3094 21.6957 21.5025 21.5025C21.6957 21.3094 21.7923 21.0752 21.7923 20.8C21.7923 20.5248 21.6957 20.2906 21.5025 20.0975L17.4051 16L21.5025 11.9025C21.6872 11.7179 21.7816 11.4859 21.7859 11.2064C21.7902 10.9269 21.6957 10.6906 21.5025 10.4975C21.3094 10.3043 21.0752 10.2077 20.8 10.2077C20.5248 10.2077 20.2906 10.3043 20.0975 10.4975L16 14.5949L11.9025 10.4975C11.7179 10.3129 11.4859 10.2184 11.2064 10.2141C10.9269 10.2099 10.6906 10.3043 10.4975 10.4975C10.3043 10.6906 10.2077 10.9248 10.2077 11.2C10.2077 11.4752 10.3043 11.7094 10.4975 11.9025L14.5949 16L10.4975 20.0975C10.3129 20.2821 10.2184 20.5141 10.2141 20.7936C10.2099 21.0731 10.3043 21.3094 10.4975 21.5025C10.6906 21.6957 10.9248 21.7923 11.2 21.7923C11.4752 21.7923 11.7094 21.6957 11.9025 21.5025L16 17.4051ZM16.0022 28.6666C14.2503 28.6666 12.6036 28.3342 11.0621 27.6693C9.52057 27.0044 8.17966 26.1021 7.03937 24.9623C5.89906 23.8225 4.99632 22.4822 4.33114 20.9413C3.66596 19.4005 3.33337 17.7542 3.33337 16.0022C3.33337 14.2503 3.66582 12.6036 4.33071 11.0621C4.9956 9.52057 5.89793 8.17967 7.03771 7.03938C8.17751 5.89907 9.51783 4.99632 11.0587 4.33114C12.5995 3.66596 14.2459 3.33337 15.9978 3.33337C17.7497 3.33337 19.3964 3.66582 20.9379 4.33071C22.4794 4.9956 23.8204 5.89793 24.9606 7.03771C26.101 8.17751 27.0037 9.51783 27.6689 11.0587C28.3341 12.5995 28.6666 14.2459 28.6666 15.9978C28.6666 17.7497 28.3342 19.3964 27.6693 20.9379C27.0044 22.4794 26.1021 23.8204 24.9623 24.9606C23.8225 26.101 22.4822 27.0037 20.9413 27.6689C19.4005 28.3341 17.7542 28.6666 16.0022 28.6666Z",fill:"currentColor"})})]})});function Bt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{const n=$m(e),r=(i,o=t)=>Sd(n,i,o);return Object.assign(r,n),r},z2=(e,t)=>e?uc(e,t):uc;function Mt(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,i]of e)if(!Object.is(i,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),dc.hasOwnProperty(t)?{space:dc[t],local:e}:e}function B2(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Ys&&t.documentElement.namespaceURI===Ys?t.createElement(e):t.createElementNS(n,e)}}function F2(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function kd(e){var t=Po(e);return(t.local?F2:B2)(t)}function H2(){}function Ea(e){return e==null?H2:function(){return this.querySelector(e)}}function Y2(e){typeof e!="function"&&(e=Ea(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=M&&(M=C+1);!(L=S[M])&&++M=0;)(a=r[i])&&(o&&a.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(a,o),o=a);return this}function p3(e){e||(e=m3);function t(p,y){return p&&y?e(p.__data__,y.__data__):!p-!y}for(var n=this._groups,r=n.length,i=new Array(r),o=0;ot?1:e>=t?0:NaN}function g3(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function y3(){return Array.from(this)}function x3(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?j3:typeof t=="function"?O3:T3)(e,t,n??"")):kr(this.node(),e)}function kr(e,t){return e.style.getPropertyValue(t)||jd(e).getComputedStyle(e,null).getPropertyValue(t)}function D3(e){return function(){delete this[e]}}function I3(e,t){return function(){this[e]=t}}function N3(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function L3(e,t){return arguments.length>1?this.each((t==null?D3:typeof t=="function"?N3:I3)(e,t)):this.node()[e]}function Td(e){return e.trim().split(/^|\s+/)}function Pa(e){return e.classList||new Od(e)}function Od(e){this._node=e,this._names=Td(e.getAttribute("class")||"")}Od.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Ad(e,t){for(var n=Pa(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function u5(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,o;n()=>e;function Vs(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:o,x:a,y:l,dx:d,dy:f,dispatch:h}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:d,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:h}})}Vs.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function b5(e){return!e.ctrlKey&&!e.button}function v5(){return this.parentNode}function _5(e,t){return t??{x:e.x,y:e.y}}function S5(){return navigator.maxTouchPoints||"ontouchstart"in this}function k5(){var e=b5,t=v5,n=_5,r=S5,i={},o=ga("start","drag","end"),a=0,l,d,f,h,p=0;function y(O){O.on("mousedown.drag",g).filter(r).on("touchstart.drag",S).on("touchmove.drag",k,w5).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(O,L){if(!(h||!e.call(this,O,L))){var T=M(this,t.call(this,O,L),O,L,"mouse");T&&(Ut(O.view).on("mousemove.drag",w,li).on("mouseup.drag",_,li),Ld(O.view),ps(O),f=!1,l=O.clientX,d=O.clientY,T("start",O))}}function w(O){if(yr(O),!f){var L=O.clientX-l,T=O.clientY-d;f=L*L+T*T>p}i.mouse("drag",O)}function _(O){Ut(O.view).on("mousemove.drag mouseup.drag",null),Rd(O.view,f),yr(O),i.mouse("end",O)}function S(O,L){if(e.call(this,O,L)){var T=O.changedTouches,V=t.call(this,O,L),U=T.length,W,q;for(W=0;W$d)throw new Error("too late; already scheduled");return n}function sn(e,t){var n=Zt(e,t);if(n.state>io)throw new Error("too late; already running");return n}function Zt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function P5(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=zm(o,0,n.time);function o(f){n.state=fc,n.timer.restart(a,n.delay,n.time),n.delay<=f&&a(f-n.delay)}function a(f){var h,p,y,g;if(n.state!==fc)return d();for(h in r)if(g=r[h],g.name===n.name){if(g.state===io)return rc(a);g.state===hc?(g.state=oo,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[h]):+hUs&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function r6(e,t,n){var r,i,o=n6(t)?Ma:sn;return function(){var a=o(this,e),l=a.on;l!==r&&(i=(r=l).copy()).on(t,n),a.on=i}}function i6(e,t){var n=this._id;return arguments.length<2?Zt(this.node(),n).on.on(e):this.each(r6(n,e,t))}function o6(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function s6(){return this.on("end.remove",o6(this._id))}function a6(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ea(e));for(var r=this._groups,i=r.length,o=new Array(i),a=0;a()=>e;function A6(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function yn(e,t,n){this.k=e,this.x=t,this.y=n}yn.prototype={constructor:yn,scale:function(e){return e===1?this:new yn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new yn(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Nn=new yn(1,0,0);yn.prototype;function ms(e){e.stopImmediatePropagation()}function Gr(e){e.preventDefault(),e.stopImmediatePropagation()}function D6(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function I6(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function pc(){return this.__zoom||Nn}function N6(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function L6(){return navigator.maxTouchPoints||"ontouchstart"in this}function R6(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),a>o?(o+a)/2:Math.min(0,o)||Math.max(0,a))}function $6(){var e=D6,t=I6,n=R6,r=N6,i=L6,o=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],l=250,d=qy,f=ga("start","zoom","end"),h,p,y,g=500,w=150,_=0,S=10;function k(P){P.property("__zoom",pc).on("wheel.zoom",U,{passive:!1}).on("mousedown.zoom",W).on("dblclick.zoom",q).filter(i).on("touchstart.zoom",$).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",B).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}k.transform=function(P,R,A,G){var X=P.selection?P.selection():P;X.property("__zoom",pc),P!==X?L(P,R,A,G):X.interrupt().each(function(){T(this,arguments).event(G).start().zoom(null,typeof R=="function"?R.apply(this,arguments):R).end()})},k.scaleBy=function(P,R,A,G){k.scaleTo(P,function(){var X=this.__zoom.k,F=typeof R=="function"?R.apply(this,arguments):R;return X*F},A,G)},k.scaleTo=function(P,R,A,G){k.transform(P,function(){var X=t.apply(this,arguments),F=this.__zoom,v=A==null?O(X):typeof A=="function"?A.apply(this,arguments):A,Q=F.invert(v),ne=typeof R=="function"?R.apply(this,arguments):R;return n(M(C(F,ne),v,Q),X,a)},A,G)},k.translateBy=function(P,R,A,G){k.transform(P,function(){return n(this.__zoom.translate(typeof R=="function"?R.apply(this,arguments):R,typeof A=="function"?A.apply(this,arguments):A),t.apply(this,arguments),a)},null,G)},k.translateTo=function(P,R,A,G,X){k.transform(P,function(){var F=t.apply(this,arguments),v=this.__zoom,Q=G==null?O(F):typeof G=="function"?G.apply(this,arguments):G;return n(Nn.translate(Q[0],Q[1]).scale(v.k).translate(typeof R=="function"?-R.apply(this,arguments):-R,typeof A=="function"?-A.apply(this,arguments):-A),F,a)},G,X)};function C(P,R){return R=Math.max(o[0],Math.min(o[1],R)),R===P.k?P:new yn(R,P.x,P.y)}function M(P,R,A){var G=R[0]-A[0]*P.k,X=R[1]-A[1]*P.k;return G===P.x&&X===P.y?P:new yn(P.k,G,X)}function O(P){return[(+P[0][0]+ +P[1][0])/2,(+P[0][1]+ +P[1][1])/2]}function L(P,R,A,G){P.on("start.zoom",function(){T(this,arguments).event(G).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(G).end()}).tween("zoom",function(){var X=this,F=arguments,v=T(X,F).event(G),Q=t.apply(X,F),ne=A==null?O(Q):typeof A=="function"?A.apply(X,F):A,E=Math.max(Q[1][0]-Q[0][0],Q[1][1]-Q[0][1]),ae=X.__zoom,J=typeof R=="function"?R.apply(X,F):R,le=d(ae.invert(ne).concat(E/ae.k),J.invert(ne).concat(E/J.k));return function(pe){if(pe===1)pe=J;else{var me=le(pe),ve=E/me[2];pe=new yn(ve,ne[0]-me[0]*ve,ne[1]-me[1]*ve)}v.zoom(null,pe)}})}function T(P,R,A){return!A&&P.__zooming||new V(P,R)}function V(P,R){this.that=P,this.args=R,this.active=0,this.sourceEvent=null,this.extent=t.apply(P,R),this.taps=0}V.prototype={event:function(P){return P&&(this.sourceEvent=P),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(P,R){return this.mouse&&P!=="mouse"&&(this.mouse[1]=R.invert(this.mouse[0])),this.touch0&&P!=="touch"&&(this.touch0[1]=R.invert(this.touch0[0])),this.touch1&&P!=="touch"&&(this.touch1[1]=R.invert(this.touch1[0])),this.that.__zoom=R,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(P){var R=Ut(this.that).datum();f.call(P,this.that,new A6(P,{sourceEvent:this.sourceEvent,target:k,type:P,transform:this.that.__zoom,dispatch:f}),R)}};function U(P,...R){if(!e.apply(this,arguments))return;var A=T(this,R).event(P),G=this.__zoom,X=Math.max(o[0],Math.min(o[1],G.k*Math.pow(2,r.apply(this,arguments)))),F=nn(P);if(A.wheel)(A.mouse[0][0]!==F[0]||A.mouse[0][1]!==F[1])&&(A.mouse[1]=G.invert(A.mouse[0]=F)),clearTimeout(A.wheel);else{if(G.k===X)return;A.mouse=[F,G.invert(F)],so(this),A.start()}Gr(P),A.wheel=setTimeout(v,w),A.zoom("mouse",n(M(C(G,X),A.mouse[0],A.mouse[1]),A.extent,a));function v(){A.wheel=null,A.end()}}function W(P,...R){if(y||!e.apply(this,arguments))return;var A=P.currentTarget,G=T(this,R,!0).event(P),X=Ut(P.view).on("mousemove.zoom",ne,!0).on("mouseup.zoom",E,!0),F=nn(P,A),v=P.clientX,Q=P.clientY;Ld(P.view),ms(P),G.mouse=[F,this.__zoom.invert(F)],so(this),G.start();function ne(ae){if(Gr(ae),!G.moved){var J=ae.clientX-v,le=ae.clientY-Q;G.moved=J*J+le*le>_}G.event(ae).zoom("mouse",n(M(G.that.__zoom,G.mouse[0]=nn(ae,A),G.mouse[1]),G.extent,a))}function E(ae){X.on("mousemove.zoom mouseup.zoom",null),Rd(ae.view,G.moved),Gr(ae),G.event(ae).end()}}function q(P,...R){if(e.apply(this,arguments)){var A=this.__zoom,G=nn(P.changedTouches?P.changedTouches[0]:P,this),X=A.invert(G),F=A.k*(P.shiftKey?.5:2),v=n(M(C(A,F),G,X),t.apply(this,R),a);Gr(P),l>0?Ut(this).transition().duration(l).call(L,v,G,P):Ut(this).call(k.transform,v,G,P)}}function $(P,...R){if(e.apply(this,arguments)){var A=P.touches,G=A.length,X=T(this,R,P.changedTouches.length===G).event(P),F,v,Q,ne;for(ms(P),v=0;v"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`},Hd=wn.error001();function it(e,t){const n=j.useContext(jo);if(n===null)throw new Error(Hd);return Sd(n,e,t)}const ut=()=>{const e=j.useContext(jo);if(e===null)throw new Error(Hd);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},B6=e=>e.userSelectionActive?"none":"all";function F6({position:e,children:t,className:n,style:r,...i}){const o=it(B6),a=`${e}`.split("-");return ee.createElement("div",{className:Bt(["react-flow__panel",n,...a]),style:{...r,pointerEvents:o},...i},t)}function H6({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:ee.createElement(F6,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},ee.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}const Y6=({x:e,y:t,label:n,labelStyle:r={},labelShowBg:i=!0,labelBgStyle:o={},labelBgPadding:a=[2,4],labelBgBorderRadius:l=2,children:d,className:f,...h})=>{const p=j.useRef(null),[y,g]=j.useState({x:0,y:0,width:0,height:0}),w=Bt(["react-flow__edge-textwrapper",f]);return j.useEffect(()=>{if(p.current){const _=p.current.getBBox();g({x:_.x,y:_.y,width:_.width,height:_.height})}},[n]),typeof n>"u"||!n?null:ee.createElement("g",{transform:`translate(${e-y.width/2} ${t-y.height/2})`,className:w,visibility:y.width?"visible":"hidden",...h},i&&ee.createElement("rect",{width:y.width+2*a[0],x:-a[0],y:-a[1],height:y.height+2*a[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),ee.createElement("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:p,style:r},n),d)};var V6=j.memo(Y6);const Ta=e=>({width:e.offsetWidth,height:e.offsetHeight}),Cr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Oa=(e={x:0,y:0},t)=>({x:Cr(e.x,t[0][0],t[1][0]),y:Cr(e.y,t[0][1],t[1][1])}),mc=(e,t,n)=>en?-Cr(Math.abs(e-n),1,50)/50:0,Yd=(e,t)=>{const n=mc(e.x,35,t.width-35)*20,r=mc(e.y,35,t.height-35)*20;return[n,r]},Vd=e=>{var t;return((t=e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},U6=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Aa=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),W6=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),gc=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),Gs=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},G6=e=>$t(e.width)&&$t(e.height)&&$t(e.x)&&$t(e.y),$t=e=>!isNaN(e)&&isFinite(e),lt=Symbol.for("internals"),Ud=["Enter"," ","Escape"],Z6=(e,t)=>{},q6=e=>"nativeEvent"in e;function Zs(e){var i,o;const t=q6(e)?e.nativeEvent:e,n=((o=(i=t.composedPath)==null?void 0:i.call(t))==null?void 0:o[0])||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n==null?void 0:n.nodeName)||(n==null?void 0:n.hasAttribute("contenteditable"))||!!(n!=null&&n.closest(".nokey"))}const Wd=e=>"clientX"in e,Ln=(e,t)=>{var o,a;const n=Wd(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,i=n?e.clientY:(a=e.touches)==null?void 0:a[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:i-((t==null?void 0:t.top)??0)}},mo=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0},yi=({id:e,path:t,labelX:n,labelY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:y,interactionWidth:g=20})=>ee.createElement(ee.Fragment,null,ee.createElement("path",{id:e,style:h,d:t,fill:"none",className:"react-flow__edge-path",markerEnd:p,markerStart:y}),g&&ee.createElement("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}),i&&$t(n)&&$t(r)?ee.createElement(V6,{x:n,y:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f}):null);yi.displayName="BaseEdge";function Zr(e,t,n){return n===void 0?n:r=>{const i=t().edges.find(o=>o.id===e);i&&n(r,{...i})}}function Gd({sourceX:e,sourceY:t,targetX:n,targetY:r}){const i=Math.abs(n-e)/2,o=n{const[S,k,C]=qd({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o});return ee.createElement(yi,{path:S,labelX:k,labelY:C,label:a,labelStyle:l,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:g,markerStart:w,interactionWidth:_})});Da.displayName="SimpleBezierEdge";const xc={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}},X6=({source:e,sourcePosition:t=he.Bottom,target:n})=>t===he.Left||t===he.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function K6({source:e,sourcePosition:t=he.Bottom,target:n,targetPosition:r=he.Top,center:i,offset:o}){const a=xc[t],l=xc[r],d={x:e.x+a.x*o,y:e.y+a.y*o},f={x:n.x+l.x*o,y:n.y+l.y*o},h=X6({source:d,sourcePosition:t,target:f}),p=h.x!==0?"x":"y",y=h[p];let g=[],w,_;const S={x:0,y:0},k={x:0,y:0},[C,M,O,L]=Gd({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[p]*l[p]===-1){w=i.x||C,_=i.y||M;const V=[{x:w,y:d.y},{x:w,y:f.y}],U=[{x:d.x,y:_},{x:f.x,y:_}];a[p]===y?g=p==="x"?V:U:g=p==="x"?U:V}else{const V=[{x:d.x,y:f.y}],U=[{x:f.x,y:d.y}];if(p==="x"?g=a.x===y?U:V:g=a.y===y?V:U,t===r){const B=Math.abs(e[p]-n[p]);if(B<=o){const P=Math.min(o-1,o-B);a[p]===y?S[p]=(d[p]>e[p]?-1:1)*P:k[p]=(f[p]>n[p]?-1:1)*P}}if(t!==r){const B=p==="x"?"y":"x",P=a[p]===l[B],R=d[B]>f[B],A=d[B]=H?(w=(W.x+q.x)/2,_=g[0].y):(w=g[0].x,_=(W.y+q.y)/2)}return[[e,{x:d.x+S.x,y:d.y+S.y},...g,{x:f.x+k.x,y:f.y+k.y},n],w,_,O,L]}function Q6(e,t,n,r){const i=Math.min(wc(e,t)/2,wc(t,n)/2,r),{x:o,y:a}=t;if(e.x===o&&o===n.x||e.y===a&&a===n.y)return`L${o} ${a}`;if(e.y===a){const f=e.x{let M="";return C>0&&C{const[k,C,M]=qs({sourceX:e,sourceY:t,sourcePosition:p,targetX:n,targetY:r,targetPosition:y,borderRadius:_==null?void 0:_.borderRadius,offset:_==null?void 0:_.offset});return ee.createElement(yi,{path:k,labelX:C,labelY:M,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:g,markerStart:w,interactionWidth:S})});To.displayName="SmoothStepEdge";const Ia=j.memo(e=>{var t;return ee.createElement(To,{...e,pathOptions:j.useMemo(()=>{var n;return{borderRadius:0,offset:(n=e.pathOptions)==null?void 0:n.offset}},[(t=e.pathOptions)==null?void 0:t.offset])})});Ia.displayName="StepEdge";function J6({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[i,o,a,l]=Gd({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,o,a,l]}const Na=j.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:y,interactionWidth:g})=>{const[w,_,S]=J6({sourceX:e,sourceY:t,targetX:n,targetY:r});return ee.createElement(yi,{path:w,labelX:_,labelY:S,label:i,labelStyle:o,labelShowBg:a,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f,style:h,markerEnd:p,markerStart:y,interactionWidth:g})});Na.displayName="StraightEdge";function Zi(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function bc({pos:e,x1:t,y1:n,x2:r,y2:i,c:o}){switch(e){case he.Left:return[t-Zi(t-r,o),n];case he.Right:return[t+Zi(r-t,o),n];case he.Top:return[t,n-Zi(n-i,o)];case he.Bottom:return[t,n+Zi(i-n,o)]}}function Xd({sourceX:e,sourceY:t,sourcePosition:n=he.Bottom,targetX:r,targetY:i,targetPosition:o=he.Top,curvature:a=.25}){const[l,d]=bc({pos:n,x1:e,y1:t,x2:r,y2:i,c:a}),[f,h]=bc({pos:o,x1:r,y1:i,x2:e,y2:t,c:a}),[p,y,g,w]=Zd({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:l,sourceControlY:d,targetControlX:f,targetControlY:h});return[`M${e},${t} C${l},${d} ${f},${h} ${r},${i}`,p,y,g,w]}const yo=j.memo(({sourceX:e,sourceY:t,targetX:n,targetY:r,sourcePosition:i=he.Bottom,targetPosition:o=he.Top,label:a,labelStyle:l,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:g,markerStart:w,pathOptions:_,interactionWidth:S})=>{const[k,C,M]=Xd({sourceX:e,sourceY:t,sourcePosition:i,targetX:n,targetY:r,targetPosition:o,curvature:_==null?void 0:_.curvature});return ee.createElement(yi,{path:k,labelX:C,labelY:M,label:a,labelStyle:l,labelShowBg:d,labelBgStyle:f,labelBgPadding:h,labelBgBorderRadius:p,style:y,markerEnd:g,markerStart:w,interactionWidth:S})});yo.displayName="BezierEdge";const La=j.createContext(null),ew=La.Provider;La.Consumer;const tw=()=>j.useContext(La),nw=e=>"id"in e&&"source"in e&&"target"in e,rw=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Xs=(e,t)=>typeof e>"u"?"":typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`,iw=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),ow=(e,t)=>{if(!e.source||!e.target)return t;let n;return nw(e)?n={...e}:n={...e,id:rw(e)},iw(n,t)?t:t.concat(n)},Ks=({x:e,y:t},[n,r,i],o,[a,l])=>{const d={x:(e-n)/i,y:(t-r)/i};return o?{x:a*Math.round(d.x/a),y:l*Math.round(d.y/l)}:d},Kd=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r}),xr=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],i={x:e.position.x-n,y:e.position.y-r};return{...i,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:i}},Ra=(e,t=[0,0])=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,i)=>{const{x:o,y:a}=xr(i,t).positionAbsolute;return U6(r,Aa({x:o,y:a,width:i.width||0,height:i.height||0}))},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return W6(n)},Qd=(e,t,[n,r,i]=[0,0,1],o=!1,a=!1,l=[0,0])=>{const d={x:(t.x-n)/i,y:(t.y-r)/i,width:t.width/i,height:t.height/i},f=[];return e.forEach(h=>{const{width:p,height:y,selectable:g=!0,hidden:w=!1}=h;if(a&&!g||w)return!1;const{positionAbsolute:_}=xr(h,l),S={x:_.x,y:_.y,width:p||0,height:y||0},k=Gs(d,S),C=typeof p>"u"||typeof y>"u"||p===null||y===null,M=o&&k>0,O=(p||0)*(y||0);(C||M||k>=O||h.dragging)&&f.push(h)}),f},Jd=(e,t)=>{const n=e.map(r=>r.id);return t.filter(r=>n.includes(r.source)||n.includes(r.target))},ef=(e,t,n,r,i,o=.1)=>{const a=t/(e.width*(1+o)),l=n/(e.height*(1+o)),d=Math.min(a,l),f=Cr(d,r,i),h=e.x+e.width/2,p=e.y+e.height/2,y=t/2-h*f,g=n/2-p*f;return{x:y,y:g,zoom:f}},Gn=(e,t=0)=>e.transition().duration(t);function vc(e,t,n,r){return(t[n]||[]).reduce((i,o)=>{var a,l;return`${e.id}-${o.id}-${n}`!==r&&i.push({id:o.id||null,type:n,nodeId:e.id,x:(((a=e.positionAbsolute)==null?void 0:a.x)??0)+o.x+o.width/2,y:(((l=e.positionAbsolute)==null?void 0:l.y)??0)+o.y+o.height/2}),i},[])}function sw(e,t,n,r,i,o){const{x:a,y:l}=Ln(e),f=t.elementsFromPoint(a,l).find(w=>w.classList.contains("react-flow__handle"));if(f){const w=f.getAttribute("data-nodeid");if(w){const _=$a(void 0,f),S=f.getAttribute("data-handleid"),k=o({nodeId:w,id:S,type:_});if(k){const C=i.find(M=>M.nodeId===w&&M.type===_&&M.id===S);return{handle:{id:S,type:_,nodeId:w,x:(C==null?void 0:C.x)||n.x,y:(C==null?void 0:C.y)||n.y},validHandleResult:k}}}}let h=[],p=1/0;if(i.forEach(w=>{const _=Math.sqrt((w.x-n.x)**2+(w.y-n.y)**2);if(_<=r){const S=o(w);_<=p&&(_w.isValid),g=h.some(({handle:w})=>w.type==="target");return h.find(({handle:w,validHandleResult:_})=>g?w.type==="target":y?_.isValid:!0)||h[0]}const aw={source:null,target:null,sourceHandle:null,targetHandle:null},tf=()=>({handleDomNode:null,isValid:!1,connection:aw,endHandle:null});function nf(e,t,n,r,i,o,a){const l=i==="target",d=a.querySelector(`.react-flow__handle[data-id="${e==null?void 0:e.nodeId}-${e==null?void 0:e.id}-${e==null?void 0:e.type}"]`),f={...tf(),handleDomNode:d};if(d){const h=$a(void 0,d),p=d.getAttribute("data-nodeid"),y=d.getAttribute("data-handleid"),g=d.classList.contains("connectable"),w=d.classList.contains("connectableend"),_={source:l?p:n,sourceHandle:l?y:r,target:l?n:p,targetHandle:l?r:y};f.connection=_,g&&w&&(t===Jn.Strict?l&&h==="source"||!l&&h==="target":p!==n||y!==r)&&(f.endHandle={nodeId:p,handleId:y,type:h},f.isValid=o(_))}return f}function lw({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((i,o)=>{if(o[lt]){const{handleBounds:a}=o[lt];let l=[],d=[];a&&(l=vc(o,a,"source",`${t}-${n}-${r}`),d=vc(o,a,"target",`${t}-${n}-${r}`)),i.push(...l,...d)}return i},[])}function $a(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function gs(e){e==null||e.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function cw(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function rf({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:i,getState:o,setState:a,isValidConnection:l,edgeUpdaterType:d,onEdgeUpdateEnd:f}){const h=Vd(e.target),{connectionMode:p,domNode:y,autoPanOnConnect:g,connectionRadius:w,onConnectStart:_,panBy:S,getNodes:k,cancelConnection:C}=o();let M=0,O;const{x:L,y:T}=Ln(e),V=h==null?void 0:h.elementFromPoint(L,T),U=$a(d,V),W=y==null?void 0:y.getBoundingClientRect();if(!W||!U)return;let q,$=Ln(e,W),H=!1,B=null,P=!1,R=null;const A=lw({nodes:k(),nodeId:n,handleId:t,handleType:U}),G=()=>{if(!g)return;const[v,Q]=Yd($,W);S({x:v,y:Q}),M=requestAnimationFrame(G)};a({connectionPosition:$,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:U,connectionStartHandle:{nodeId:n,handleId:t,type:U},connectionEndHandle:null}),_==null||_(e,{nodeId:n,handleId:t,handleType:U});function X(v){const{transform:Q}=o();$=Ln(v,W);const{handle:ne,validHandleResult:E}=sw(v,h,Ks($,Q,!1,[1,1]),w,A,ae=>nf(ae,p,n,t,i?"target":"source",l,h));if(O=ne,H||(G(),H=!0),R=E.handleDomNode,B=E.connection,P=E.isValid,a({connectionPosition:O&&P?Kd({x:O.x,y:O.y},Q):$,connectionStatus:cw(!!O,P),connectionEndHandle:E.endHandle}),!O&&!P&&!R)return gs(q);B.source!==B.target&&R&&(gs(q),q=R,R.classList.add("connecting","react-flow__handle-connecting"),R.classList.toggle("valid",P),R.classList.toggle("react-flow__handle-valid",P))}function F(v){var Q,ne;(O||R)&&B&&P&&(r==null||r(B)),(ne=(Q=o()).onConnectEnd)==null||ne.call(Q,v),d&&(f==null||f(v)),gs(q),C(),cancelAnimationFrame(M),H=!1,P=!1,B=null,R=null,h.removeEventListener("mousemove",X),h.removeEventListener("mouseup",F),h.removeEventListener("touchmove",X),h.removeEventListener("touchend",F)}h.addEventListener("mousemove",X),h.addEventListener("mouseup",F),h.addEventListener("touchmove",X),h.addEventListener("touchend",F)}const _c=()=>!0,uw=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),dw=(e,t,n)=>r=>{const{connectionStartHandle:i,connectionEndHandle:o,connectionClickStartHandle:a}=r;return{connecting:(i==null?void 0:i.nodeId)===e&&(i==null?void 0:i.handleId)===t&&(i==null?void 0:i.type)===n||(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.handleId)===t&&(o==null?void 0:o.type)===n,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.handleId)===t&&(a==null?void 0:a.type)===n}},of=j.forwardRef(({type:e="source",position:t=he.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:o=!0,id:a,onConnect:l,children:d,className:f,onMouseDown:h,onTouchStart:p,...y},g)=>{var W,q;const w=a||null,_=e==="target",S=ut(),k=tw(),{connectOnClick:C,noPanClassName:M}=it(uw,Mt),{connecting:O,clickConnecting:L}=it(dw(k,w,e),Mt);k||(q=(W=S.getState()).onError)==null||q.call(W,"010",wn.error010());const T=$=>{const{defaultEdgeOptions:H,onConnect:B,hasDefaultEdges:P}=S.getState(),R={...H,...$};if(P){const{edges:A,setEdges:G}=S.getState();G(ow(R,A))}B==null||B(R),l==null||l(R)},V=$=>{if(!k)return;const H=Wd($);i&&(H&&$.button===0||!H)&&rf({event:$,handleId:w,nodeId:k,onConnect:T,isTarget:_,getState:S.getState,setState:S.setState,isValidConnection:n||S.getState().isValidConnection||_c}),H?h==null||h($):p==null||p($)},U=$=>{const{onClickConnectStart:H,onClickConnectEnd:B,connectionClickStartHandle:P,connectionMode:R,isValidConnection:A}=S.getState();if(!k||!P&&!i)return;if(!P){H==null||H($,{nodeId:k,handleId:w,handleType:e}),S.setState({connectionClickStartHandle:{nodeId:k,type:e,handleId:w}});return}const G=Vd($.target),X=n||A||_c,{connection:F,isValid:v}=nf({nodeId:k,id:w,type:e},R,P.nodeId,P.handleId||null,P.type,X,G);v&&T(F),B==null||B($),S.setState({connectionClickStartHandle:null})};return ee.createElement("div",{"data-handleid":w,"data-nodeid":k,"data-handlepos":t,"data-id":`${k}-${w}-${e}`,className:Bt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",M,f,{source:!_,target:_,connectable:r,connectablestart:i,connectableend:o,connecting:L,connectionindicator:r&&(i&&!O||o&&O)}]),onMouseDown:V,onTouchStart:V,onClick:C?U:void 0,ref:g,...y},d)});of.displayName="Handle";var xo=j.memo(of);const sf=({data:e,isConnectable:t,targetPosition:n=he.Top,sourcePosition:r=he.Bottom})=>ee.createElement(ee.Fragment,null,ee.createElement(xo,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,ee.createElement(xo,{type:"source",position:r,isConnectable:t}));sf.displayName="DefaultNode";var Qs=j.memo(sf);const af=({data:e,isConnectable:t,sourcePosition:n=he.Bottom})=>ee.createElement(ee.Fragment,null,e==null?void 0:e.label,ee.createElement(xo,{type:"source",position:n,isConnectable:t}));af.displayName="InputNode";var lf=j.memo(af);const cf=({data:e,isConnectable:t,targetPosition:n=he.Top})=>ee.createElement(ee.Fragment,null,ee.createElement(xo,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label);cf.displayName="OutputNode";var uf=j.memo(cf);const za=()=>null;za.displayName="GroupNode";const fw=e=>({selectedNodes:e.getNodes().filter(t=>t.selected),selectedEdges:e.edges.filter(t=>t.selected)}),qi=e=>e.id;function hw(e,t){return Mt(e.selectedNodes.map(qi),t.selectedNodes.map(qi))&&Mt(e.selectedEdges.map(qi),t.selectedEdges.map(qi))}const df=j.memo(({onSelectionChange:e})=>{const t=ut(),{selectedNodes:n,selectedEdges:r}=it(fw,hw);return j.useEffect(()=>{const i={nodes:n,edges:r};e==null||e(i),t.getState().onSelectionChange.forEach(o=>o(i))},[n,r,e]),null});df.displayName="SelectionListener";const pw=e=>!!e.onSelectionChange;function mw({onSelectionChange:e}){const t=it(pw);return e||t?ee.createElement(df,{onSelectionChange:e}):null}const gw=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function sr(e,t){j.useEffect(()=>{typeof e<"u"&&t(e)},[e])}function Me(e,t,n){j.useEffect(()=>{typeof t<"u"&&n({[e]:t})},[t])}const yw=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:i,onConnectStart:o,onConnectEnd:a,onClickConnectStart:l,onClickConnectEnd:d,nodesDraggable:f,nodesConnectable:h,nodesFocusable:p,edgesFocusable:y,edgesUpdatable:g,elevateNodesOnSelect:w,minZoom:_,maxZoom:S,nodeExtent:k,onNodesChange:C,onEdgesChange:M,elementsSelectable:O,connectionMode:L,snapGrid:T,snapToGrid:V,translateExtent:U,connectOnClick:W,defaultEdgeOptions:q,fitView:$,fitViewOptions:H,onNodesDelete:B,onEdgesDelete:P,onNodeDrag:R,onNodeDragStart:A,onNodeDragStop:G,onSelectionDrag:X,onSelectionDragStart:F,onSelectionDragStop:v,noPanClassName:Q,nodeOrigin:ne,rfId:E,autoPanOnConnect:ae,autoPanOnNodeDrag:J,onError:le,connectionRadius:pe,isValidConnection:me,nodeDragThreshold:ve})=>{const{setNodes:ke,setEdges:Be,setDefaultNodesAndEdges:Je,setMinZoom:He,setMaxZoom:we,setTranslateExtent:ge,setNodeExtent:Ye,reset:Ze}=it(gw,Mt),ue=ut();return j.useEffect(()=>{const dt=r==null?void 0:r.map(Ne=>({...Ne,...q}));return Je(n,dt),()=>{Ze()}},[]),Me("defaultEdgeOptions",q,ue.setState),Me("connectionMode",L,ue.setState),Me("onConnect",i,ue.setState),Me("onConnectStart",o,ue.setState),Me("onConnectEnd",a,ue.setState),Me("onClickConnectStart",l,ue.setState),Me("onClickConnectEnd",d,ue.setState),Me("nodesDraggable",f,ue.setState),Me("nodesConnectable",h,ue.setState),Me("nodesFocusable",p,ue.setState),Me("edgesFocusable",y,ue.setState),Me("edgesUpdatable",g,ue.setState),Me("elementsSelectable",O,ue.setState),Me("elevateNodesOnSelect",w,ue.setState),Me("snapToGrid",V,ue.setState),Me("snapGrid",T,ue.setState),Me("onNodesChange",C,ue.setState),Me("onEdgesChange",M,ue.setState),Me("connectOnClick",W,ue.setState),Me("fitViewOnInit",$,ue.setState),Me("fitViewOnInitOptions",H,ue.setState),Me("onNodesDelete",B,ue.setState),Me("onEdgesDelete",P,ue.setState),Me("onNodeDrag",R,ue.setState),Me("onNodeDragStart",A,ue.setState),Me("onNodeDragStop",G,ue.setState),Me("onSelectionDrag",X,ue.setState),Me("onSelectionDragStart",F,ue.setState),Me("onSelectionDragStop",v,ue.setState),Me("noPanClassName",Q,ue.setState),Me("nodeOrigin",ne,ue.setState),Me("rfId",E,ue.setState),Me("autoPanOnConnect",ae,ue.setState),Me("autoPanOnNodeDrag",J,ue.setState),Me("onError",le,ue.setState),Me("connectionRadius",pe,ue.setState),Me("isValidConnection",me,ue.setState),Me("nodeDragThreshold",ve,ue.setState),sr(e,ke),sr(t,Be),sr(_,He),sr(S,we),sr(U,ge),sr(k,Ye),null},Sc={display:"none"},xw={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ff="react-flow__node-desc",hf="react-flow__edge-desc",ww="react-flow__aria-live",bw=e=>e.ariaLiveMessage;function vw({rfId:e}){const t=it(bw);return ee.createElement("div",{id:`${ww}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:xw},t)}function _w({rfId:e,disableKeyboardA11y:t}){return ee.createElement(ee.Fragment,null,ee.createElement("div",{id:`${ff}-${e}`,style:Sc},"Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),ee.createElement("div",{id:`${hf}-${e}`,style:Sc},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!t&&ee.createElement(vw,{rfId:e}))}var ui=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=j.useState(!1),i=j.useRef(!1),o=j.useRef(new Set([])),[a,l]=j.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(p=>typeof p=="string").map(p=>p.split("+")),h=f.reduce((p,y)=>p.concat(...y),[]);return[f,h]}return[[],[]]},[e]);return j.useEffect(()=>{const d=typeof document<"u"?document:null,f=(t==null?void 0:t.target)||d;if(e!==null){const h=g=>{if(i.current=g.ctrlKey||g.metaKey||g.shiftKey,(!i.current||i.current&&!t.actInsideInputWithModifier)&&Zs(g))return!1;const _=Cc(g.code,l);o.current.add(g[_]),kc(a,o.current,!1)&&(g.preventDefault(),r(!0))},p=g=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&Zs(g))return!1;const _=Cc(g.code,l);kc(a,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(g[_]),g.key==="Meta"&&o.current.clear(),i.current=!1},y=()=>{o.current.clear(),r(!1)};return f==null||f.addEventListener("keydown",h),f==null||f.addEventListener("keyup",p),window.addEventListener("blur",y),()=>{f==null||f.removeEventListener("keydown",h),f==null||f.removeEventListener("keyup",p),window.removeEventListener("blur",y)}}},[e,r]),n};function kc(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(i=>t.has(i)))}function Cc(e,t){return t.includes(e)?"code":"key"}function pf(e,t,n,r){var a,l;if(!e.parentNode)return n;const i=t.get(e.parentNode),o=xr(i,r);return pf(i,t,{x:(n.x??0)+o.x,y:(n.y??0)+o.y,z:(((a=i[lt])==null?void 0:a.z)??0)>(n.z??0)?((l=i[lt])==null?void 0:l.z)??0:n.z??0},r)}function mf(e,t,n){e.forEach(r=>{var i;if(r.parentNode&&!e.has(r.parentNode))throw new Error(`Parent node ${r.parentNode} not found`);if(r.parentNode||n!=null&&n[r.id]){const{x:o,y:a,z:l}=pf(r,e,{...r.position,z:((i=r[lt])==null?void 0:i.z)??0},t);r.positionAbsolute={x:o,y:a},r[lt].z=l,n!=null&&n[r.id]&&(r[lt].isParent=!0)}})}function ys(e,t,n,r){const i=new Map,o={},a=r?1e3:0;return e.forEach(l=>{var p;const d=($t(l.zIndex)?l.zIndex:0)+(l.selected?a:0),f=t.get(l.id),h={width:f==null?void 0:f.width,height:f==null?void 0:f.height,...l,positionAbsolute:{x:l.position.x,y:l.position.y}};l.parentNode&&(h.parentNode=l.parentNode,o[l.parentNode]=!0),Object.defineProperty(h,lt,{enumerable:!1,value:{handleBounds:(p=f==null?void 0:f[lt])==null?void 0:p.handleBounds,z:d}}),i.set(l.id,h)}),mf(i,n,o),i}function gf(e,t={}){const{getNodes:n,width:r,height:i,minZoom:o,maxZoom:a,d3Zoom:l,d3Selection:d,fitViewOnInitDone:f,fitViewOnInit:h,nodeOrigin:p}=e(),y=t.initial&&!f&&h;if(l&&d&&(y||!t.initial)){const w=n().filter(S=>{var C;const k=t.includeHiddenNodes?S.width&&S.height:!S.hidden;return(C=t.nodes)!=null&&C.length?k&&t.nodes.some(M=>M.id===S.id):k}),_=w.every(S=>S.width&&S.height);if(w.length>0&&_){const S=Ra(w,p),{x:k,y:C,zoom:M}=ef(S,r,i,t.minZoom??o,t.maxZoom??a,t.padding??.1),O=Nn.translate(k,C).scale(M);return typeof t.duration=="number"&&t.duration>0?l.transform(Gn(d,t.duration),O):l.transform(d,O),!0}}return!1}function Sw(e,t){return e.forEach(n=>{const r=t.get(n.id);r&&t.set(r.id,{...r,[lt]:r[lt],selected:n.selected})}),new Map(t)}function kw(e,t){return t.map(n=>{const r=e.find(i=>i.id===n.id);return r&&(n.selected=r.selected),n})}function Xi({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:i,edges:o,onNodesChange:a,onEdgesChange:l,hasDefaultNodes:d,hasDefaultEdges:f}=n();e!=null&&e.length&&(d&&r({nodeInternals:Sw(e,i)}),a==null||a(e)),t!=null&&t.length&&(f&&r({edges:kw(t,o)}),l==null||l(t))}const ar=()=>{},Cw={zoomIn:ar,zoomOut:ar,zoomTo:ar,getZoom:()=>1,setViewport:ar,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:ar,fitBounds:ar,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Ew=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection}),Pw=()=>{const e=ut(),{d3Zoom:t,d3Selection:n}=it(Ew,Mt);return j.useMemo(()=>n&&t?{zoomIn:i=>t.scaleBy(Gn(n,i==null?void 0:i.duration),1.2),zoomOut:i=>t.scaleBy(Gn(n,i==null?void 0:i.duration),1/1.2),zoomTo:(i,o)=>t.scaleTo(Gn(n,o==null?void 0:o.duration),i),getZoom:()=>e.getState().transform[2],setViewport:(i,o)=>{const[a,l,d]=e.getState().transform,f=Nn.translate(i.x??a,i.y??l).scale(i.zoom??d);t.transform(Gn(n,o==null?void 0:o.duration),f)},getViewport:()=>{const[i,o,a]=e.getState().transform;return{x:i,y:o,zoom:a}},fitView:i=>gf(e.getState,i),setCenter:(i,o,a)=>{const{width:l,height:d,maxZoom:f}=e.getState(),h=typeof(a==null?void 0:a.zoom)<"u"?a.zoom:f,p=l/2-i*h,y=d/2-o*h,g=Nn.translate(p,y).scale(h);t.transform(Gn(n,a==null?void 0:a.duration),g)},fitBounds:(i,o)=>{const{width:a,height:l,minZoom:d,maxZoom:f}=e.getState(),{x:h,y:p,zoom:y}=ef(i,a,l,d,f,(o==null?void 0:o.padding)??.1),g=Nn.translate(h,p).scale(y);t.transform(Gn(n,o==null?void 0:o.duration),g)},project:i=>{const{transform:o,snapToGrid:a,snapGrid:l}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Ks(i,o,a,l)},screenToFlowPosition:i=>{const{transform:o,snapToGrid:a,snapGrid:l,domNode:d}=e.getState();if(!d)return i;const{x:f,y:h}=d.getBoundingClientRect(),p={x:i.x-f,y:i.y-h};return Ks(p,o,a,l)},flowToScreenPosition:i=>{const{transform:o,domNode:a}=e.getState();if(!a)return i;const{x:l,y:d}=a.getBoundingClientRect(),f=Kd(i,o);return{x:f.x+l,y:f.y+d}},viewportInitialized:!0}:Cw,[t,n])};function yf(){const e=Pw(),t=ut(),n=j.useCallback(()=>t.getState().getNodes().map(_=>({..._})),[]),r=j.useCallback(_=>t.getState().nodeInternals.get(_),[]),i=j.useCallback(()=>{const{edges:_=[]}=t.getState();return _.map(S=>({...S}))},[]),o=j.useCallback(_=>{const{edges:S=[]}=t.getState();return S.find(k=>k.id===_)},[]),a=j.useCallback(_=>{const{getNodes:S,setNodes:k,hasDefaultNodes:C,onNodesChange:M}=t.getState(),O=S(),L=typeof _=="function"?_(O):_;if(C)k(L);else if(M){const T=L.length===0?O.map(V=>({type:"remove",id:V.id})):L.map(V=>({item:V,type:"reset"}));M(T)}},[]),l=j.useCallback(_=>{const{edges:S=[],setEdges:k,hasDefaultEdges:C,onEdgesChange:M}=t.getState(),O=typeof _=="function"?_(S):_;if(C)k(O);else if(M){const L=O.length===0?S.map(T=>({type:"remove",id:T.id})):O.map(T=>({item:T,type:"reset"}));M(L)}},[]),d=j.useCallback(_=>{const S=Array.isArray(_)?_:[_],{getNodes:k,setNodes:C,hasDefaultNodes:M,onNodesChange:O}=t.getState();if(M){const T=[...k(),...S];C(T)}else if(O){const L=S.map(T=>({item:T,type:"add"}));O(L)}},[]),f=j.useCallback(_=>{const S=Array.isArray(_)?_:[_],{edges:k=[],setEdges:C,hasDefaultEdges:M,onEdgesChange:O}=t.getState();if(M)C([...k,...S]);else if(O){const L=S.map(T=>({item:T,type:"add"}));O(L)}},[]),h=j.useCallback(()=>{const{getNodes:_,edges:S=[],transform:k}=t.getState(),[C,M,O]=k;return{nodes:_().map(L=>({...L})),edges:S.map(L=>({...L})),viewport:{x:C,y:M,zoom:O}}},[]),p=j.useCallback(({nodes:_,edges:S})=>{const{nodeInternals:k,getNodes:C,edges:M,hasDefaultNodes:O,hasDefaultEdges:L,onNodesDelete:T,onEdgesDelete:V,onNodesChange:U,onEdgesChange:W}=t.getState(),q=(_||[]).map(R=>R.id),$=(S||[]).map(R=>R.id),H=C().reduce((R,A)=>{const G=!q.includes(A.id)&&A.parentNode&&R.find(F=>F.id===A.parentNode);return(typeof A.deletable=="boolean"?A.deletable:!0)&&(q.includes(A.id)||G)&&R.push(A),R},[]),B=M.filter(R=>typeof R.deletable=="boolean"?R.deletable:!0),P=B.filter(R=>$.includes(R.id));if(H||P){const R=Jd(H,B),A=[...P,...R],G=A.reduce((X,F)=>(X.includes(F.id)||X.push(F.id),X),[]);if((L||O)&&(L&&t.setState({edges:M.filter(X=>!G.includes(X.id))}),O&&(H.forEach(X=>{k.delete(X.id)}),t.setState({nodeInternals:new Map(k)}))),G.length>0&&(V==null||V(A),W&&W(G.map(X=>({id:X,type:"remove"})))),H.length>0&&(T==null||T(H),U)){const X=H.map(F=>({id:F.id,type:"remove"}));U(X)}}},[]),y=j.useCallback(_=>{const S=G6(_),k=S?null:t.getState().nodeInternals.get(_.id);return[S?_:gc(k),k,S]},[]),g=j.useCallback((_,S=!0,k)=>{const[C,M,O]=y(_);return C?(k||t.getState().getNodes()).filter(L=>{if(!O&&(L.id===M.id||!L.positionAbsolute))return!1;const T=gc(L),V=Gs(T,C);return S&&V>0||V>=C.width*C.height}):[]},[]),w=j.useCallback((_,S,k=!0)=>{const[C]=y(_);if(!C)return!1;const M=Gs(C,S);return k&&M>0||M>=C.width*C.height},[]);return j.useMemo(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:o,setNodes:a,setEdges:l,addNodes:d,addEdges:f,toObject:h,deleteElements:p,getIntersectingNodes:g,isNodeIntersecting:w}),[e,n,r,i,o,a,l,d,f,h,p,g,w])}const Mw={actInsideInputWithModifier:!1};var jw=({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=ut(),{deleteElements:r}=yf(),i=ui(e,Mw),o=ui(t);j.useEffect(()=>{if(i){const{edges:a,getNodes:l}=n.getState(),d=l().filter(h=>h.selected),f=a.filter(h=>h.selected);r({nodes:d,edges:f}),n.setState({nodesSelectionActive:!1})}},[i]),j.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])};function Tw(e){const t=ut();j.useEffect(()=>{let n;const r=()=>{var o,a;if(!e.current)return;const i=Ta(e.current);(i.height===0||i.width===0)&&((a=(o=t.getState()).onError)==null||a.call(o,"004",wn.error004())),t.setState({width:i.width||500,height:i.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}const Ba={position:"absolute",width:"100%",height:"100%",top:0,left:0},Ow=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ki=e=>({x:e.x,y:e.y,zoom:e.k}),lr=(e,t)=>e.target.closest(`.${t}`),Ec=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Pc=e=>{const t=e.ctrlKey&&mo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t},Aw=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Dw=({onMove:e,onMoveStart:t,onMoveEnd:n,onPaneContextMenu:r,zoomOnScroll:i=!0,zoomOnPinch:o=!0,panOnScroll:a=!1,panOnScrollSpeed:l=.5,panOnScrollMode:d=Xn.Free,zoomOnDoubleClick:f=!0,elementsSelectable:h,panOnDrag:p=!0,defaultViewport:y,translateExtent:g,minZoom:w,maxZoom:_,zoomActivationKeyCode:S,preventScrolling:k=!0,children:C,noWheelClassName:M,noPanClassName:O})=>{const L=j.useRef(),T=ut(),V=j.useRef(!1),U=j.useRef(!1),W=j.useRef(null),q=j.useRef({x:0,y:0,zoom:0}),{d3Zoom:$,d3Selection:H,d3ZoomHandler:B,userSelectionActive:P}=it(Aw,Mt),R=ui(S),A=j.useRef(0),G=j.useRef(!1),X=j.useRef();return Tw(W),j.useEffect(()=>{if(W.current){const F=W.current.getBoundingClientRect(),v=$6().scaleExtent([w,_]).translateExtent(g),Q=Ut(W.current).call(v),ne=Nn.translate(y.x,y.y).scale(Cr(y.zoom,w,_)),E=[[0,0],[F.width,F.height]],ae=v.constrain()(ne,E,g);v.transform(Q,ae),v.wheelDelta(Pc),T.setState({d3Zoom:v,d3Selection:Q,d3ZoomHandler:Q.on("wheel.zoom"),transform:[ae.x,ae.y,ae.k],domNode:W.current.closest(".react-flow")})}},[]),j.useEffect(()=>{H&&$&&(a&&!R&&!P?H.on("wheel.zoom",F=>{if(lr(F,M))return!1;F.preventDefault(),F.stopImmediatePropagation();const v=H.property("__zoom").k||1,Q=mo();if(F.ctrlKey&&o&&Q){const ve=nn(F),ke=Pc(F),Be=v*Math.pow(2,ke);$.scaleTo(H,Be,ve,F);return}const ne=F.deltaMode===1?20:1;let E=d===Xn.Vertical?0:F.deltaX*ne,ae=d===Xn.Horizontal?0:F.deltaY*ne;!Q&&F.shiftKey&&d!==Xn.Vertical&&(E=F.deltaY*ne,ae=0),$.translateBy(H,-(E/v)*l,-(ae/v)*l,{internal:!0});const J=Ki(H.property("__zoom")),{onViewportChangeStart:le,onViewportChange:pe,onViewportChangeEnd:me}=T.getState();clearTimeout(X.current),G.current||(G.current=!0,t==null||t(F,J),le==null||le(J)),G.current&&(e==null||e(F,J),pe==null||pe(J),X.current=setTimeout(()=>{n==null||n(F,J),me==null||me(J),G.current=!1},150))},{passive:!1}):typeof B<"u"&&H.on("wheel.zoom",function(F,v){if(!k||lr(F,M))return null;F.preventDefault(),B.call(this,F,v)},{passive:!1}))},[P,a,d,H,$,B,R,o,k,M,t,e,n]),j.useEffect(()=>{$&&$.on("start",F=>{var ne,E;if(!F.sourceEvent||F.sourceEvent.internal)return null;A.current=(ne=F.sourceEvent)==null?void 0:ne.button;const{onViewportChangeStart:v}=T.getState(),Q=Ki(F.transform);V.current=!0,q.current=Q,((E=F.sourceEvent)==null?void 0:E.type)==="mousedown"&&T.setState({paneDragging:!0}),v==null||v(Q),t==null||t(F.sourceEvent,Q)})},[$,t]),j.useEffect(()=>{$&&(P&&!V.current?$.on("zoom",null):P||$.on("zoom",F=>{var Q;const{onViewportChange:v}=T.getState();if(T.setState({transform:[F.transform.x,F.transform.y,F.transform.k]}),U.current=!!(r&&Ec(p,A.current??0)),(e||v)&&!((Q=F.sourceEvent)!=null&&Q.internal)){const ne=Ki(F.transform);v==null||v(ne),e==null||e(F.sourceEvent,ne)}}))},[P,$,e,p,r]),j.useEffect(()=>{$&&$.on("end",F=>{if(!F.sourceEvent||F.sourceEvent.internal)return null;const{onViewportChangeEnd:v}=T.getState();if(V.current=!1,T.setState({paneDragging:!1}),r&&Ec(p,A.current??0)&&!U.current&&r(F.sourceEvent),U.current=!1,(n||v)&&Ow(q.current,F.transform)){const Q=Ki(F.transform);q.current=Q,clearTimeout(L.current),L.current=setTimeout(()=>{v==null||v(Q),n==null||n(F.sourceEvent,Q)},a?150:0)}})},[$,a,p,n,r]),j.useEffect(()=>{$&&$.filter(F=>{const v=R||i,Q=o&&F.ctrlKey;if((p===!0||Array.isArray(p)&&p.includes(1))&&F.button===1&&F.type==="mousedown"&&(lr(F,"react-flow__node")||lr(F,"react-flow__edge")))return!0;if(!p&&!v&&!a&&!f&&!o||P||!f&&F.type==="dblclick"||lr(F,M)&&F.type==="wheel"||lr(F,O)&&(F.type!=="wheel"||a&&F.type==="wheel"&&!R)||!o&&F.ctrlKey&&F.type==="wheel"||!v&&!a&&!Q&&F.type==="wheel"||!p&&(F.type==="mousedown"||F.type==="touchstart")||Array.isArray(p)&&!p.includes(F.button)&&(F.type==="mousedown"||F.type==="touchstart"))return!1;const ne=Array.isArray(p)&&p.includes(F.button)||!F.button||F.button<=1;return(!F.ctrlKey||F.type==="wheel")&&ne})},[P,$,i,o,a,f,p,h,R]),ee.createElement("div",{className:"react-flow__renderer",ref:W,style:Ba},C)},Iw=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Nw(){const{userSelectionActive:e,userSelectionRect:t}=it(Iw,Mt);return e&&t?ee.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}function Mc(e,t){const n=e.find(r=>r.id===t.parentNode);if(n){const r=t.position.x+t.width-n.width,i=t.position.y+t.height-n.height;if(r>0||i>0||t.position.x<0||t.position.y<0){if(n.style={...n.style},n.style.width=n.style.width??n.width,n.style.height=n.style.height??n.height,r>0&&(n.style.width+=r),i>0&&(n.style.height+=i),t.position.x<0){const o=Math.abs(t.position.x);n.position.x=n.position.x-o,n.style.width+=o,t.position.x=0}if(t.position.y<0){const o=Math.abs(t.position.y);n.position.y=n.position.y-o,n.style.height+=o,t.position.y=0}n.width=n.style.width,n.height=n.style.height}}}function Lw(e,t){if(e.some(r=>r.type==="reset"))return e.filter(r=>r.type==="reset").map(r=>r.item);const n=e.filter(r=>r.type==="add").map(r=>r.item);return t.reduce((r,i)=>{const o=e.filter(l=>l.id===i.id);if(o.length===0)return r.push(i),r;const a={...i};for(const l of o)if(l)switch(l.type){case"select":{a.selected=l.selected;break}case"position":{typeof l.position<"u"&&(a.position=l.position),typeof l.positionAbsolute<"u"&&(a.positionAbsolute=l.positionAbsolute),typeof l.dragging<"u"&&(a.dragging=l.dragging),a.expandParent&&Mc(r,a);break}case"dimensions":{typeof l.dimensions<"u"&&(a.width=l.dimensions.width,a.height=l.dimensions.height),typeof l.updateStyle<"u"&&(a.style={...a.style||{},...l.dimensions}),typeof l.resizing=="boolean"&&(a.resizing=l.resizing),a.expandParent&&Mc(r,a);break}case"remove":return r}return r.push(a),r},n)}function Rw(e,t){return Lw(e,t)}const jn=(e,t)=>({id:e,type:"select",selected:t});function gr(e,t){return e.reduce((n,r)=>{const i=t.includes(r.id);return!r.selected&&i?(r.selected=!0,n.push(jn(r.id,!0))):r.selected&&!i&&(r.selected=!1,n.push(jn(r.id,!1))),n},[])}const xs=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},$w=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),xf=j.memo(({isSelecting:e,selectionMode:t=ci.Full,panOnDrag:n,onSelectionStart:r,onSelectionEnd:i,onPaneClick:o,onPaneContextMenu:a,onPaneScroll:l,onPaneMouseEnter:d,onPaneMouseMove:f,onPaneMouseLeave:h,children:p})=>{const y=j.useRef(null),g=ut(),w=j.useRef(0),_=j.useRef(0),S=j.useRef(),{userSelectionActive:k,elementsSelectable:C,dragging:M}=it($w,Mt),O=()=>{g.setState({userSelectionActive:!1,userSelectionRect:null}),w.current=0,_.current=0},L=B=>{o==null||o(B),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1})},T=B=>{if(Array.isArray(n)&&(n!=null&&n.includes(2))){B.preventDefault();return}a==null||a(B)},V=l?B=>l(B):void 0,U=B=>{const{resetSelectedElements:P,domNode:R}=g.getState();if(S.current=R==null?void 0:R.getBoundingClientRect(),!C||!e||B.button!==0||B.target!==y.current||!S.current)return;const{x:A,y:G}=Ln(B,S.current);P(),g.setState({userSelectionRect:{width:0,height:0,startX:A,startY:G,x:A,y:G}}),r==null||r(B)},W=B=>{const{userSelectionRect:P,nodeInternals:R,edges:A,transform:G,onNodesChange:X,onEdgesChange:F,nodeOrigin:v,getNodes:Q}=g.getState();if(!e||!S.current||!P)return;g.setState({userSelectionActive:!0,nodesSelectionActive:!1});const ne=Ln(B,S.current),E=P.startX??0,ae=P.startY??0,J={...P,x:ne.xke.id),ve=pe.map(ke=>ke.id);if(w.current!==ve.length){w.current=ve.length;const ke=gr(le,ve);ke.length&&(X==null||X(ke))}if(_.current!==me.length){_.current=me.length;const ke=gr(A,me);ke.length&&(F==null||F(ke))}g.setState({userSelectionRect:J})},q=B=>{if(B.button!==0)return;const{userSelectionRect:P}=g.getState();!k&&P&&B.target===y.current&&(L==null||L(B)),g.setState({nodesSelectionActive:w.current>0}),O(),i==null||i(B)},$=B=>{k&&(g.setState({nodesSelectionActive:w.current>0}),i==null||i(B)),O()},H=C&&(e||k);return ee.createElement("div",{className:Bt(["react-flow__pane",{dragging:M,selection:e}]),onClick:H?void 0:xs(L,y),onContextMenu:xs(T,y),onWheel:xs(V,y),onMouseEnter:H?void 0:d,onMouseDown:H?U:void 0,onMouseMove:H?W:f,onMouseUp:H?q:void 0,onMouseLeave:H?$:h,ref:y,style:Ba},p,ee.createElement(Nw,null))});xf.displayName="Pane";function wf(e,t){if(!e.parentNode)return!1;const n=t.get(e.parentNode);return n?n.selected?!0:wf(n,t):!1}function jc(e,t,n){let r=e;do{if(r!=null&&r.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function zw(e,t,n,r){return Array.from(e.values()).filter(i=>(i.selected||i.id===r)&&(!i.parentNode||!wf(i,e))&&(i.draggable||t&&typeof i.draggable>"u")).map(i=>{var o,a;return{id:i.id,position:i.position||{x:0,y:0},positionAbsolute:i.positionAbsolute||{x:0,y:0},distance:{x:n.x-(((o=i.positionAbsolute)==null?void 0:o.x)??0),y:n.y-(((a=i.positionAbsolute)==null?void 0:a.y)??0)},delta:{x:0,y:0},extent:i.extent,parentNode:i.parentNode,width:i.width,height:i.height,expandParent:i.expandParent}})}function Bw(e,t){return!t||t==="parent"?t:[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]}function bf(e,t,n,r,i=[0,0],o){const a=Bw(e,e.extent||r);let l=a;if(e.extent==="parent"&&!e.expandParent)if(e.parentNode&&e.width&&e.height){const h=n.get(e.parentNode),{x:p,y}=xr(h,i).positionAbsolute;l=h&&$t(p)&&$t(y)&&$t(h.width)&&$t(h.height)?[[p+e.width*i[0],y+e.height*i[1]],[p+h.width-e.width+e.width*i[0],y+h.height-e.height+e.height*i[1]]]:l}else o==null||o("005",wn.error005()),l=a;else if(e.extent&&e.parentNode&&e.extent!=="parent"){const h=n.get(e.parentNode),{x:p,y}=xr(h,i).positionAbsolute;l=[[e.extent[0][0]+p,e.extent[0][1]+y],[e.extent[1][0]+p,e.extent[1][1]+y]]}let d={x:0,y:0};if(e.parentNode){const h=n.get(e.parentNode);d=xr(h,i).positionAbsolute}const f=l&&l!=="parent"?Oa(t,l):t;return{position:{x:f.x-d.x,y:f.y-d.y},positionAbsolute:f}}function ws({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(i=>({...n.get(i.id),position:i.position,positionAbsolute:i.positionAbsolute}));return[e?r.find(i=>i.id===e):r[0],r]}const Tc=(e,t,n,r)=>{const i=t.querySelectorAll(e);if(!i||!i.length)return null;const o=Array.from(i),a=t.getBoundingClientRect(),l={x:a.width*r[0],y:a.height*r[1]};return o.map(d=>{const f=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),position:d.getAttribute("data-handlepos"),x:(f.left-a.left-l.x)/n,y:(f.top-a.top-l.y)/n,...Ta(d)}})};function qr(e,t,n){return n===void 0?n:r=>{const i=t().nodeInternals.get(e);i&&n(r,{...i})}}function Js({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:i,unselectNodesAndEdges:o,multiSelectionActive:a,nodeInternals:l,onError:d}=t.getState(),f=l.get(e);if(!f){d==null||d("012",wn.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&a)&&(o({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var h;return(h=r==null?void 0:r.current)==null?void 0:h.blur()})):i([e])}function Fw(){const e=ut();return j.useCallback(({sourceEvent:n})=>{const{transform:r,snapGrid:i,snapToGrid:o}=e.getState(),a=n.touches?n.touches[0].clientX:n.clientX,l=n.touches?n.touches[0].clientY:n.clientY,d={x:(a-r[0])/r[2],y:(l-r[1])/r[2]};return{xSnapped:o?i[0]*Math.round(d.x/i[0]):d.x,ySnapped:o?i[1]*Math.round(d.y/i[1]):d.y,...d}},[])}function bs(e){return(t,n,r)=>e==null?void 0:e(t,r)}function vf({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:o,selectNodesOnDrag:a}){const l=ut(),[d,f]=j.useState(!1),h=j.useRef([]),p=j.useRef({x:null,y:null}),y=j.useRef(0),g=j.useRef(null),w=j.useRef({x:0,y:0}),_=j.useRef(null),S=j.useRef(!1),k=j.useRef(!1),C=Fw();return j.useEffect(()=>{if(e!=null&&e.current){const M=Ut(e.current),O=({x:V,y:U})=>{const{nodeInternals:W,onNodeDrag:q,onSelectionDrag:$,updateNodePositions:H,nodeExtent:B,snapGrid:P,snapToGrid:R,nodeOrigin:A,onError:G}=l.getState();p.current={x:V,y:U};let X=!1,F={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&B){const Q=Ra(h.current,A);F=Aa(Q)}if(h.current=h.current.map(Q=>{const ne={x:V-Q.distance.x,y:U-Q.distance.y};R&&(ne.x=P[0]*Math.round(ne.x/P[0]),ne.y=P[1]*Math.round(ne.y/P[1]));const E=[[B[0][0],B[0][1]],[B[1][0],B[1][1]]];h.current.length>1&&B&&!Q.extent&&(E[0][0]=Q.positionAbsolute.x-F.x+B[0][0],E[1][0]=Q.positionAbsolute.x+(Q.width??0)-F.x2+B[1][0],E[0][1]=Q.positionAbsolute.y-F.y+B[0][1],E[1][1]=Q.positionAbsolute.y+(Q.height??0)-F.y2+B[1][1]);const ae=bf(Q,ne,W,E,A,G);return X=X||Q.position.x!==ae.position.x||Q.position.y!==ae.position.y,Q.position=ae.position,Q.positionAbsolute=ae.positionAbsolute,Q}),!X)return;H(h.current,!0,!0),f(!0);const v=i?q:bs($);if(v&&_.current){const[Q,ne]=ws({nodeId:i,dragItems:h.current,nodeInternals:W});v(_.current,Q,ne)}},L=()=>{if(!g.current)return;const[V,U]=Yd(w.current,g.current);if(V!==0||U!==0){const{transform:W,panBy:q}=l.getState();p.current.x=(p.current.x??0)-V/W[2],p.current.y=(p.current.y??0)-U/W[2],q({x:V,y:U})&&O(p.current)}y.current=requestAnimationFrame(L)},T=V=>{var A;const{nodeInternals:U,multiSelectionActive:W,nodesDraggable:q,unselectNodesAndEdges:$,onNodeDragStart:H,onSelectionDragStart:B}=l.getState();k.current=!0;const P=i?H:bs(B);(!a||!o)&&!W&&i&&((A=U.get(i))!=null&&A.selected||$()),i&&o&&a&&Js({id:i,store:l,nodeRef:e});const R=C(V);if(p.current=R,h.current=zw(U,q,R,i),P&&h.current){const[G,X]=ws({nodeId:i,dragItems:h.current,nodeInternals:U});P(V.sourceEvent,G,X)}};if(t)M.on(".drag",null);else{const V=k5().on("start",U=>{const{domNode:W,nodeDragThreshold:q}=l.getState();q===0&&T(U);const $=C(U);p.current=$,g.current=(W==null?void 0:W.getBoundingClientRect())||null,w.current=Ln(U.sourceEvent,g.current)}).on("drag",U=>{var H,B;const W=C(U),{autoPanOnNodeDrag:q,nodeDragThreshold:$}=l.getState();if(!S.current&&k.current&&q&&(S.current=!0,L()),!k.current){const P=W.xSnapped-(((H=p==null?void 0:p.current)==null?void 0:H.x)??0),R=W.ySnapped-(((B=p==null?void 0:p.current)==null?void 0:B.y)??0);Math.sqrt(P*P+R*R)>$&&T(U)}(p.current.x!==W.xSnapped||p.current.y!==W.ySnapped)&&h.current&&k.current&&(_.current=U.sourceEvent,w.current=Ln(U.sourceEvent,g.current),O(W))}).on("end",U=>{if(k.current&&(f(!1),S.current=!1,k.current=!1,cancelAnimationFrame(y.current),h.current)){const{updateNodePositions:W,nodeInternals:q,onNodeDragStop:$,onSelectionDragStop:H}=l.getState(),B=i?$:bs(H);if(W(h.current,!1,!1),B){const[P,R]=ws({nodeId:i,dragItems:h.current,nodeInternals:q});B(U.sourceEvent,P,R)}}}).filter(U=>{const W=U.target;return!U.button&&(!n||!jc(W,`.${n}`,e))&&(!r||jc(W,r,e))});return M.call(V),()=>{M.on(".drag",null)}}}},[e,t,n,r,o,l,i,a,C]),d}function _f(){const e=ut();return j.useCallback(n=>{const{nodeInternals:r,nodeExtent:i,updateNodePositions:o,getNodes:a,snapToGrid:l,snapGrid:d,onError:f,nodesDraggable:h}=e.getState(),p=a().filter(C=>C.selected&&(C.draggable||h&&typeof C.draggable>"u")),y=l?d[0]:5,g=l?d[1]:5,w=n.isShiftPressed?4:1,_=n.x*y*w,S=n.y*g*w,k=p.map(C=>{if(C.positionAbsolute){const M={x:C.positionAbsolute.x+_,y:C.positionAbsolute.y+S};l&&(M.x=d[0]*Math.round(M.x/d[0]),M.y=d[1]*Math.round(M.y/d[1]));const{positionAbsolute:O,position:L}=bf(C,M,r,i,void 0,f);C.position=L,C.positionAbsolute=O}return C});o(k,!0,!1)},[])}const wr={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var Xr=e=>{const t=({id:n,type:r,data:i,xPos:o,yPos:a,xPosOrigin:l,yPosOrigin:d,selected:f,onClick:h,onMouseEnter:p,onMouseMove:y,onMouseLeave:g,onContextMenu:w,onDoubleClick:_,style:S,className:k,isDraggable:C,isSelectable:M,isConnectable:O,isFocusable:L,selectNodesOnDrag:T,sourcePosition:V,targetPosition:U,hidden:W,resizeObserver:q,dragHandle:$,zIndex:H,isParent:B,noDragClassName:P,noPanClassName:R,initialized:A,disableKeyboardA11y:G,ariaLabel:X,rfId:F})=>{const v=ut(),Q=j.useRef(null),ne=j.useRef(V),E=j.useRef(U),ae=j.useRef(r),J=M||C||h||p||y||g,le=_f(),pe=qr(n,v.getState,p),me=qr(n,v.getState,y),ve=qr(n,v.getState,g),ke=qr(n,v.getState,w),Be=qr(n,v.getState,_),Je=ge=>{const{nodeDragThreshold:Ye}=v.getState();if(M&&(!T||!C||Ye>0)&&Js({id:n,store:v,nodeRef:Q}),h){const Ze=v.getState().nodeInternals.get(n);Ze&&h(ge,{...Ze})}},He=ge=>{if(!Zs(ge))if(Ud.includes(ge.key)&&M){const Ye=ge.key==="Escape";Js({id:n,store:v,unselect:Ye,nodeRef:Q})}else!G&&C&&f&&Object.prototype.hasOwnProperty.call(wr,ge.key)&&(v.setState({ariaLiveMessage:`Moved selected node ${ge.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~o}, y: ${~~a}`}),le({x:wr[ge.key].x,y:wr[ge.key].y,isShiftPressed:ge.shiftKey}))};j.useEffect(()=>{if(Q.current&&!W){const ge=Q.current;return q==null||q.observe(ge),()=>q==null?void 0:q.unobserve(ge)}},[W]),j.useEffect(()=>{const ge=ae.current!==r,Ye=ne.current!==V,Ze=E.current!==U;Q.current&&(ge||Ye||Ze)&&(ge&&(ae.current=r),Ye&&(ne.current=V),Ze&&(E.current=U),v.getState().updateNodeDimensions([{id:n,nodeElement:Q.current,forceUpdate:!0}]))},[n,r,V,U]);const we=vf({nodeRef:Q,disabled:W||!C,noDragClassName:P,handleSelector:$,nodeId:n,isSelectable:M,selectNodesOnDrag:T});return W?null:ee.createElement("div",{className:Bt(["react-flow__node",`react-flow__node-${r}`,{[R]:C},k,{selected:f,selectable:M,parent:B,dragging:we}]),ref:Q,style:{zIndex:H,transform:`translate(${l}px,${d}px)`,pointerEvents:J?"all":"none",visibility:A?"visible":"hidden",...S},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:pe,onMouseMove:me,onMouseLeave:ve,onContextMenu:ke,onClick:Je,onDoubleClick:Be,onKeyDown:L?He:void 0,tabIndex:L?0:void 0,role:L?"button":void 0,"aria-describedby":G?void 0:`${ff}-${F}`,"aria-label":X},ee.createElement(ew,{value:n},ee.createElement(e,{id:n,data:i,type:r,xPos:o,yPos:a,selected:f,isConnectable:O,sourcePosition:V,targetPosition:U,dragging:we,dragHandle:$,zIndex:H})))};return t.displayName="NodeWrapper",j.memo(t)};const Hw=e=>{const t=e.getNodes().filter(n=>n.selected);return{...Ra(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};function Yw({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=ut(),{width:i,height:o,x:a,y:l,transformString:d,userSelectionActive:f}=it(Hw,Mt),h=_f(),p=j.useRef(null);if(j.useEffect(()=>{var w;n||(w=p.current)==null||w.focus({preventScroll:!0})},[n]),vf({nodeRef:p}),f||!i||!o)return null;const y=e?w=>{const _=r.getState().getNodes().filter(S=>S.selected);e(w,_)}:void 0,g=w=>{Object.prototype.hasOwnProperty.call(wr,w.key)&&h({x:wr[w.key].x,y:wr[w.key].y,isShiftPressed:w.shiftKey})};return ee.createElement("div",{className:Bt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:d}},ee.createElement("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:i,height:o,top:l,left:a}}))}var Vw=j.memo(Yw);const Uw=e=>e.nodesSelectionActive,Sf=({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,deleteKeyCode:l,onMove:d,onMoveStart:f,onMoveEnd:h,selectionKeyCode:p,selectionOnDrag:y,selectionMode:g,onSelectionStart:w,onSelectionEnd:_,multiSelectionKeyCode:S,panActivationKeyCode:k,zoomActivationKeyCode:C,elementsSelectable:M,zoomOnScroll:O,zoomOnPinch:L,panOnScroll:T,panOnScrollSpeed:V,panOnScrollMode:U,zoomOnDoubleClick:W,panOnDrag:q,defaultViewport:$,translateExtent:H,minZoom:B,maxZoom:P,preventScrolling:R,onSelectionContextMenu:A,noWheelClassName:G,noPanClassName:X,disableKeyboardA11y:F})=>{const v=it(Uw),Q=ui(p),ne=ui(k),E=ne||q,ae=ne||T,J=Q||y&&E!==!0;return jw({deleteKeyCode:l,multiSelectionKeyCode:S}),ee.createElement(Dw,{onMove:d,onMoveStart:f,onMoveEnd:h,onPaneContextMenu:o,elementsSelectable:M,zoomOnScroll:O,zoomOnPinch:L,panOnScroll:ae,panOnScrollSpeed:V,panOnScrollMode:U,zoomOnDoubleClick:W,panOnDrag:!Q&&E,defaultViewport:$,translateExtent:H,minZoom:B,maxZoom:P,zoomActivationKeyCode:C,preventScrolling:R,noWheelClassName:G,noPanClassName:X},ee.createElement(xf,{onSelectionStart:w,onSelectionEnd:_,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:o,onPaneScroll:a,panOnDrag:E,isSelecting:!!J,selectionMode:g},e,v&&ee.createElement(Vw,{onSelectionContextMenu:A,noPanClassName:X,disableKeyboardA11y:F})))};Sf.displayName="FlowRenderer";var Ww=j.memo(Sf);function Gw(e){return it(j.useCallback(n=>e?Qd(n.nodeInternals,{x:0,y:0,width:n.width,height:n.height},n.transform,!0):n.getNodes(),[e]))}function Zw(e){const t={input:Xr(e.input||lf),default:Xr(e.default||Qs),output:Xr(e.output||uf),group:Xr(e.group||za)},n={},r=Object.keys(e).filter(i=>!["input","default","output","group"].includes(i)).reduce((i,o)=>(i[o]=Xr(e[o]||Qs),i),n);return{...t,...r}}const qw=({x:e,y:t,width:n,height:r,origin:i})=>!n||!r?{x:e,y:t}:i[0]<0||i[1]<0||i[0]>1||i[1]>1?{x:e,y:t}:{x:e-n*i[0],y:t-r*i[1]},Xw=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),kf=e=>{const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:i,updateNodeDimensions:o,onError:a}=it(Xw,Mt),l=Gw(e.onlyRenderVisibleElements),d=j.useRef(),f=j.useMemo(()=>{if(typeof ResizeObserver>"u")return null;const h=new ResizeObserver(p=>{const y=p.map(g=>({id:g.target.getAttribute("data-id"),nodeElement:g.target,forceUpdate:!0}));o(y)});return d.current=h,h},[]);return j.useEffect(()=>()=>{var h;(h=d==null?void 0:d.current)==null||h.disconnect()},[]),ee.createElement("div",{className:"react-flow__nodes",style:Ba},l.map(h=>{var L,T;let p=h.type||"default";e.nodeTypes[p]||(a==null||a("003",wn.error003(p)),p="default");const y=e.nodeTypes[p]||e.nodeTypes.default,g=!!(h.draggable||t&&typeof h.draggable>"u"),w=!!(h.selectable||i&&typeof h.selectable>"u"),_=!!(h.connectable||n&&typeof h.connectable>"u"),S=!!(h.focusable||r&&typeof h.focusable>"u"),k=e.nodeExtent?Oa(h.positionAbsolute,e.nodeExtent):h.positionAbsolute,C=(k==null?void 0:k.x)??0,M=(k==null?void 0:k.y)??0,O=qw({x:C,y:M,width:h.width??0,height:h.height??0,origin:e.nodeOrigin});return ee.createElement(y,{key:h.id,id:h.id,className:h.className,style:h.style,type:p,data:h.data,sourcePosition:h.sourcePosition||he.Bottom,targetPosition:h.targetPosition||he.Top,hidden:h.hidden,xPos:C,yPos:M,xPosOrigin:O.x,yPosOrigin:O.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!h.selected,isDraggable:g,isSelectable:w,isConnectable:_,isFocusable:S,resizeObserver:f,dragHandle:h.dragHandle,zIndex:((L=h[lt])==null?void 0:L.z)??0,isParent:!!((T=h[lt])!=null&&T.isParent),noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!h.width&&!!h.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:h.ariaLabel})}))};kf.displayName="NodeRenderer";var Kw=j.memo(kf);const Qw=(e,t,n)=>n===he.Left?e-t:n===he.Right?e+t:e,Jw=(e,t,n)=>n===he.Top?e-t:n===he.Bottom?e+t:e,Oc="react-flow__edgeupdater",Ac=({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:o,onMouseOut:a,type:l})=>ee.createElement("circle",{onMouseDown:i,onMouseEnter:o,onMouseOut:a,className:Bt([Oc,`${Oc}-${l}`]),cx:Qw(t,r,e),cy:Jw(n,r,e),r,stroke:"transparent",fill:"transparent"}),e4=()=>!0;var cr=e=>{const t=({id:n,className:r,type:i,data:o,onClick:a,onEdgeDoubleClick:l,selected:d,animated:f,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:w,labelBgBorderRadius:_,style:S,source:k,target:C,sourceX:M,sourceY:O,targetX:L,targetY:T,sourcePosition:V,targetPosition:U,elementsSelectable:W,hidden:q,sourceHandleId:$,targetHandleId:H,onContextMenu:B,onMouseEnter:P,onMouseMove:R,onMouseLeave:A,edgeUpdaterRadius:G,onEdgeUpdate:X,onEdgeUpdateStart:F,onEdgeUpdateEnd:v,markerEnd:Q,markerStart:ne,rfId:E,ariaLabel:ae,isFocusable:J,isUpdatable:le,pathOptions:pe,interactionWidth:me})=>{const ve=j.useRef(null),[ke,Be]=j.useState(!1),[Je,He]=j.useState(!1),we=ut(),ge=j.useMemo(()=>`url(#${Xs(ne,E)})`,[ne,E]),Ye=j.useMemo(()=>`url(#${Xs(Q,E)})`,[Q,E]);if(q)return null;const Ze=ye=>{var be;const{edges:fe,addSelectedEdges:_e,unselectNodesAndEdges:je,multiSelectionActive:Ve}=we.getState(),Ae=fe.find(tt=>tt.id===n);Ae&&(W&&(we.setState({nodesSelectionActive:!1}),Ae.selected&&Ve?(je({nodes:[],edges:[Ae]}),(be=ve.current)==null||be.blur()):_e([n])),a&&a(ye,Ae))},ue=Zr(n,we.getState,l),dt=Zr(n,we.getState,B),Ne=Zr(n,we.getState,P),Le=Zr(n,we.getState,R),Xe=Zr(n,we.getState,A),ft=(ye,fe)=>{if(ye.button!==0)return;const{edges:_e,isValidConnection:je}=we.getState(),Ve=fe?C:k,Ae=(fe?H:$)||null,be=fe?"target":"source",tt=je||e4,qt=fe,jt=_e.find(St=>St.id===n);He(!0),F==null||F(ye,jt,be);const De=St=>{He(!1),v==null||v(St,jt,be)};rf({event:ye,handleId:Ae,nodeId:Ve,onConnect:St=>X==null?void 0:X(jt,St),isTarget:qt,getState:we.getState,setState:we.setState,isValidConnection:tt,edgeUpdaterType:be,onEdgeUpdateEnd:De})},ht=ye=>ft(ye,!0),D=ye=>ft(ye,!1),Z=()=>Be(!0),te=()=>Be(!1),se=!W&&!a,re=ye=>{var fe;if(Ud.includes(ye.key)&&W){const{unselectNodesAndEdges:_e,addSelectedEdges:je,edges:Ve}=we.getState();ye.key==="Escape"?((fe=ve.current)==null||fe.blur(),_e({edges:[Ve.find(be=>be.id===n)]})):je([n])}};return ee.createElement("g",{className:Bt(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:d,animated:f,inactive:se,updating:ke}]),onClick:Ze,onDoubleClick:ue,onContextMenu:dt,onMouseEnter:Ne,onMouseMove:Le,onMouseLeave:Xe,onKeyDown:J?re:void 0,tabIndex:J?0:void 0,role:J?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":ae===null?void 0:ae||`Edge from ${k} to ${C}`,"aria-describedby":J?`${hf}-${E}`:void 0,ref:ve},!Je&&ee.createElement(e,{id:n,source:k,target:C,selected:d,animated:f,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:w,labelBgBorderRadius:_,data:o,style:S,sourceX:M,sourceY:O,targetX:L,targetY:T,sourcePosition:V,targetPosition:U,sourceHandleId:$,targetHandleId:H,markerStart:ge,markerEnd:Ye,pathOptions:pe,interactionWidth:me}),le&&ee.createElement(ee.Fragment,null,(le==="source"||le===!0)&&ee.createElement(Ac,{position:V,centerX:M,centerY:O,radius:G,onMouseDown:ht,onMouseEnter:Z,onMouseOut:te,type:"source"}),(le==="target"||le===!0)&&ee.createElement(Ac,{position:U,centerX:L,centerY:T,radius:G,onMouseDown:D,onMouseEnter:Z,onMouseOut:te,type:"target"})))};return t.displayName="EdgeWrapper",j.memo(t)};function t4(e){const t={default:cr(e.default||yo),straight:cr(e.bezier||Na),step:cr(e.step||Ia),smoothstep:cr(e.step||To),simplebezier:cr(e.simplebezier||Da)},n={},r=Object.keys(e).filter(i=>!["default","bezier"].includes(i)).reduce((i,o)=>(i[o]=cr(e[o]||yo),i),n);return{...t,...r}}function Dc(e,t,n=null){const r=((n==null?void 0:n.x)||0)+t.x,i=((n==null?void 0:n.y)||0)+t.y,o=(n==null?void 0:n.width)||t.width,a=(n==null?void 0:n.height)||t.height;switch(e){case he.Top:return{x:r+o/2,y:i};case he.Right:return{x:r+o,y:i+a/2};case he.Bottom:return{x:r+o/2,y:i+a};case he.Left:return{x:r,y:i+a/2}}}function Ic(e,t){return e?e.length===1||!t?e[0]:t&&e.find(n=>n.id===t)||null:null}const n4=(e,t,n,r,i,o)=>{const a=Dc(n,e,t),l=Dc(o,r,i);return{sourceX:a.x,sourceY:a.y,targetX:l.x,targetY:l.y}};function r4({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:i,targetHeight:o,width:a,height:l,transform:d}){const f={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+i),y2:Math.max(e.y+r,t.y+o)};f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const h=Aa({x:(0-d[0])/d[2],y:(0-d[1])/d[2],width:a/d[2],height:l/d[2]}),p=Math.max(0,Math.min(h.x2,f.x2)-Math.max(h.x,f.x)),y=Math.max(0,Math.min(h.y2,f.y2)-Math.max(h.y,f.y));return Math.ceil(p*y)>0}function Nc(e){var r,i,o,a,l;const t=((r=e==null?void 0:e[lt])==null?void 0:r.handleBounds)||null,n=t&&(e==null?void 0:e.width)&&(e==null?void 0:e.height)&&typeof((i=e==null?void 0:e.positionAbsolute)==null?void 0:i.x)<"u"&&typeof((o=e==null?void 0:e.positionAbsolute)==null?void 0:o.y)<"u";return[{x:((a=e==null?void 0:e.positionAbsolute)==null?void 0:a.x)||0,y:((l=e==null?void 0:e.positionAbsolute)==null?void 0:l.y)||0,width:(e==null?void 0:e.width)||0,height:(e==null?void 0:e.height)||0},t,!!n]}const i4=[{level:0,isMaxLevel:!0,edges:[]}];function o4(e,t,n=!1){let r=-1;const i=e.reduce((a,l)=>{var h,p;const d=$t(l.zIndex);let f=d?l.zIndex:0;if(n){const y=t.get(l.target),g=t.get(l.source),w=l.selected||(y==null?void 0:y.selected)||(g==null?void 0:g.selected),_=Math.max(((h=g==null?void 0:g[lt])==null?void 0:h.z)||0,((p=y==null?void 0:y[lt])==null?void 0:p.z)||0,1e3);f=(d?l.zIndex:0)+(w?_:0)}return a[f]?a[f].push(l):a[f]=[l],r=f>r?f:r,a},{}),o=Object.entries(i).map(([a,l])=>{const d=+a;return{edges:l,level:d,isMaxLevel:d===r}});return o.length===0?i4:o}function s4(e,t,n){const r=it(j.useCallback(i=>e?i.edges.filter(o=>{const a=t.get(o.source),l=t.get(o.target);return(a==null?void 0:a.width)&&(a==null?void 0:a.height)&&(l==null?void 0:l.width)&&(l==null?void 0:l.height)&&r4({sourcePos:a.positionAbsolute||{x:0,y:0},targetPos:l.positionAbsolute||{x:0,y:0},sourceWidth:a.width,sourceHeight:a.height,targetWidth:l.width,targetHeight:l.height,width:i.width,height:i.height,transform:i.transform})}):i.edges,[e,t]));return o4(r,t,n)}const a4=({color:e="none",strokeWidth:t=1})=>ee.createElement("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),l4=({color:e="none",strokeWidth:t=1})=>ee.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),Lc={[go.Arrow]:a4,[go.ArrowClosed]:l4};function c4(e){const t=ut();return j.useMemo(()=>{var i,o;return Object.prototype.hasOwnProperty.call(Lc,e)?Lc[e]:((o=(i=t.getState()).onError)==null||o.call(i,"009",wn.error009(e)),null)},[e])}const u4=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:o="strokeWidth",strokeWidth:a,orient:l="auto-start-reverse"})=>{const d=c4(t);return d?ee.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0"},ee.createElement(d,{color:n,strokeWidth:a})):null},d4=({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((i,o)=>([o.markerStart,o.markerEnd].forEach(a=>{if(a&&typeof a=="object"){const l=Xs(a,t);r.includes(l)||(i.push({id:l,color:a.color||e,...a}),r.push(l))}}),i),[]).sort((i,o)=>i.id.localeCompare(o.id))},Cf=({defaultColor:e,rfId:t})=>{const n=it(j.useCallback(d4({defaultColor:e,rfId:t}),[e,t]),(r,i)=>!(r.length!==i.length||r.some((o,a)=>o.id!==i[a].id)));return ee.createElement("defs",null,n.map(r=>ee.createElement(u4,{id:r.id,key:r.id,type:r.type,color:r.color,width:r.width,height:r.height,markerUnits:r.markerUnits,strokeWidth:r.strokeWidth,orient:r.orient})))};Cf.displayName="MarkerDefinitions";var f4=j.memo(Cf);const h4=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Ef=({defaultMarkerColor:e,onlyRenderVisibleElements:t,elevateEdgesOnSelect:n,rfId:r,edgeTypes:i,noPanClassName:o,onEdgeUpdate:a,onEdgeContextMenu:l,onEdgeMouseEnter:d,onEdgeMouseMove:f,onEdgeMouseLeave:h,onEdgeClick:p,edgeUpdaterRadius:y,onEdgeDoubleClick:g,onEdgeUpdateStart:w,onEdgeUpdateEnd:_,children:S})=>{const{edgesFocusable:k,edgesUpdatable:C,elementsSelectable:M,width:O,height:L,connectionMode:T,nodeInternals:V,onError:U}=it(h4,Mt),W=s4(t,V,n);return O?ee.createElement(ee.Fragment,null,W.map(({level:q,edges:$,isMaxLevel:H})=>ee.createElement("svg",{key:q,style:{zIndex:q},width:O,height:L,className:"react-flow__edges react-flow__container"},H&&ee.createElement(f4,{defaultColor:e,rfId:r}),ee.createElement("g",null,$.map(B=>{const[P,R,A]=Nc(V.get(B.source)),[G,X,F]=Nc(V.get(B.target));if(!A||!F)return null;let v=B.type||"default";i[v]||(U==null||U("011",wn.error011(v)),v="default");const Q=i[v]||i.default,ne=T===Jn.Strict?X.target:(X.target??[]).concat(X.source??[]),E=Ic(R.source,B.sourceHandle),ae=Ic(ne,B.targetHandle),J=(E==null?void 0:E.position)||he.Bottom,le=(ae==null?void 0:ae.position)||he.Top,pe=!!(B.focusable||k&&typeof B.focusable>"u"),me=typeof a<"u"&&(B.updatable||C&&typeof B.updatable>"u");if(!E||!ae)return U==null||U("008",wn.error008(E,B)),null;const{sourceX:ve,sourceY:ke,targetX:Be,targetY:Je}=n4(P,E,J,G,ae,le);return ee.createElement(Q,{key:B.id,id:B.id,className:Bt([B.className,o]),type:v,data:B.data,selected:!!B.selected,animated:!!B.animated,hidden:!!B.hidden,label:B.label,labelStyle:B.labelStyle,labelShowBg:B.labelShowBg,labelBgStyle:B.labelBgStyle,labelBgPadding:B.labelBgPadding,labelBgBorderRadius:B.labelBgBorderRadius,style:B.style,source:B.source,target:B.target,sourceHandleId:B.sourceHandle,targetHandleId:B.targetHandle,markerEnd:B.markerEnd,markerStart:B.markerStart,sourceX:ve,sourceY:ke,targetX:Be,targetY:Je,sourcePosition:J,targetPosition:le,elementsSelectable:M,onEdgeUpdate:a,onContextMenu:l,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onClick:p,edgeUpdaterRadius:y,onEdgeDoubleClick:g,onEdgeUpdateStart:w,onEdgeUpdateEnd:_,rfId:r,ariaLabel:B.ariaLabel,isFocusable:pe,isUpdatable:me,pathOptions:"pathOptions"in B?B.pathOptions:void 0,interactionWidth:B.interactionWidth})})))),S):null};Ef.displayName="EdgeRenderer";var p4=j.memo(Ef);const m4=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function g4({children:e}){const t=it(m4);return ee.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:t}},e)}function y4(e){const t=yf(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const x4={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top},Pf=({nodeId:e,handleType:t,style:n,type:r=Tn.Bezier,CustomComponent:i,connectionStatus:o})=>{var T,V,U;const{fromNode:a,handleId:l,toX:d,toY:f,connectionMode:h}=it(j.useCallback(W=>({fromNode:W.nodeInternals.get(e),handleId:W.connectionHandleId,toX:(W.connectionPosition.x-W.transform[0])/W.transform[2],toY:(W.connectionPosition.y-W.transform[1])/W.transform[2],connectionMode:W.connectionMode}),[e]),Mt),p=(T=a==null?void 0:a[lt])==null?void 0:T.handleBounds;let y=p==null?void 0:p[t];if(h===Jn.Loose&&(y=y||(p==null?void 0:p[t==="source"?"target":"source"])),!a||!y)return null;const g=l?y.find(W=>W.id===l):y[0],w=g?g.x+g.width/2:(a.width??0)/2,_=g?g.y+g.height/2:a.height??0,S=(((V=a.positionAbsolute)==null?void 0:V.x)??0)+w,k=(((U=a.positionAbsolute)==null?void 0:U.y)??0)+_,C=g==null?void 0:g.position,M=C?x4[C]:null;if(!C||!M)return null;if(i)return ee.createElement(i,{connectionLineType:r,connectionLineStyle:n,fromNode:a,fromHandle:g,fromX:S,fromY:k,toX:d,toY:f,fromPosition:C,toPosition:M,connectionStatus:o});let O="";const L={sourceX:S,sourceY:k,sourcePosition:C,targetX:d,targetY:f,targetPosition:M};return r===Tn.Bezier?[O]=Xd(L):r===Tn.Step?[O]=qs({...L,borderRadius:0}):r===Tn.SmoothStep?[O]=qs(L):r===Tn.SimpleBezier?[O]=qd(L):O=`M${S},${k} ${d},${f}`,ee.createElement("path",{d:O,fill:"none",className:"react-flow__connection-path",style:n})};Pf.displayName="ConnectionLine";const w4=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function b4({containerStyle:e,style:t,type:n,component:r}){const{nodeId:i,handleType:o,nodesConnectable:a,width:l,height:d,connectionStatus:f}=it(w4,Mt);return!(i&&o&&l&&a)?null:ee.createElement("svg",{style:e,width:l,height:d,className:"react-flow__edges react-flow__connectionline react-flow__container"},ee.createElement("g",{className:Bt(["react-flow__connection",f])},ee.createElement(Pf,{nodeId:i,handleType:o,style:t,type:n,CustomComponent:r,connectionStatus:f})))}function Rc(e,t){return j.useRef(null),ut(),j.useMemo(()=>t(e),[e])}const Mf=({nodeTypes:e,edgeTypes:t,onMove:n,onMoveStart:r,onMoveEnd:i,onInit:o,onNodeClick:a,onEdgeClick:l,onNodeDoubleClick:d,onEdgeDoubleClick:f,onNodeMouseEnter:h,onNodeMouseMove:p,onNodeMouseLeave:y,onNodeContextMenu:g,onSelectionContextMenu:w,onSelectionStart:_,onSelectionEnd:S,connectionLineType:k,connectionLineStyle:C,connectionLineComponent:M,connectionLineContainerStyle:O,selectionKeyCode:L,selectionOnDrag:T,selectionMode:V,multiSelectionKeyCode:U,panActivationKeyCode:W,zoomActivationKeyCode:q,deleteKeyCode:$,onlyRenderVisibleElements:H,elementsSelectable:B,selectNodesOnDrag:P,defaultViewport:R,translateExtent:A,minZoom:G,maxZoom:X,preventScrolling:F,defaultMarkerColor:v,zoomOnScroll:Q,zoomOnPinch:ne,panOnScroll:E,panOnScrollSpeed:ae,panOnScrollMode:J,zoomOnDoubleClick:le,panOnDrag:pe,onPaneClick:me,onPaneMouseEnter:ve,onPaneMouseMove:ke,onPaneMouseLeave:Be,onPaneScroll:Je,onPaneContextMenu:He,onEdgeUpdate:we,onEdgeContextMenu:ge,onEdgeMouseEnter:Ye,onEdgeMouseMove:Ze,onEdgeMouseLeave:ue,edgeUpdaterRadius:dt,onEdgeUpdateStart:Ne,onEdgeUpdateEnd:Le,noDragClassName:Xe,noWheelClassName:ft,noPanClassName:ht,elevateEdgesOnSelect:D,disableKeyboardA11y:Z,nodeOrigin:te,nodeExtent:se,rfId:re})=>{const ye=Rc(e,Zw),fe=Rc(t,t4);return y4(o),ee.createElement(Ww,{onPaneClick:me,onPaneMouseEnter:ve,onPaneMouseMove:ke,onPaneMouseLeave:Be,onPaneContextMenu:He,onPaneScroll:Je,deleteKeyCode:$,selectionKeyCode:L,selectionOnDrag:T,selectionMode:V,onSelectionStart:_,onSelectionEnd:S,multiSelectionKeyCode:U,panActivationKeyCode:W,zoomActivationKeyCode:q,elementsSelectable:B,onMove:n,onMoveStart:r,onMoveEnd:i,zoomOnScroll:Q,zoomOnPinch:ne,zoomOnDoubleClick:le,panOnScroll:E,panOnScrollSpeed:ae,panOnScrollMode:J,panOnDrag:pe,defaultViewport:R,translateExtent:A,minZoom:G,maxZoom:X,onSelectionContextMenu:w,preventScrolling:F,noDragClassName:Xe,noWheelClassName:ft,noPanClassName:ht,disableKeyboardA11y:Z},ee.createElement(g4,null,ee.createElement(p4,{edgeTypes:fe,onEdgeClick:l,onEdgeDoubleClick:f,onEdgeUpdate:we,onlyRenderVisibleElements:H,onEdgeContextMenu:ge,onEdgeMouseEnter:Ye,onEdgeMouseMove:Ze,onEdgeMouseLeave:ue,onEdgeUpdateStart:Ne,onEdgeUpdateEnd:Le,edgeUpdaterRadius:dt,defaultMarkerColor:v,noPanClassName:ht,elevateEdgesOnSelect:!!D,disableKeyboardA11y:Z,rfId:re},ee.createElement(b4,{style:C,type:k,component:M,containerStyle:O})),ee.createElement("div",{className:"react-flow__edgelabel-renderer"}),ee.createElement(Kw,{nodeTypes:ye,onNodeClick:a,onNodeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:p,onNodeMouseLeave:y,onNodeContextMenu:g,selectNodesOnDrag:P,onlyRenderVisibleElements:H,noPanClassName:ht,noDragClassName:Xe,disableKeyboardA11y:Z,nodeOrigin:te,nodeExtent:se,rfId:re})))};Mf.displayName="GraphView";var v4=j.memo(Mf);const ea=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Pn={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:ea,nodeExtent:ea,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:Jn.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Z6,isValidConnection:void 0},_4=()=>z2((e,t)=>({...Pn,setNodes:n=>{const{nodeInternals:r,nodeOrigin:i,elevateNodesOnSelect:o}=t();e({nodeInternals:ys(n,r,i,o)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(i=>({...r,...i}))})},setDefaultNodesAndEdges:(n,r)=>{const i=typeof n<"u",o=typeof r<"u",a=i?ys(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:o?r:[],hasDefaultNodes:i,hasDefaultEdges:o})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:i,fitViewOnInit:o,fitViewOnInitDone:a,fitViewOnInitOptions:l,domNode:d,nodeOrigin:f}=t(),h=d==null?void 0:d.querySelector(".react-flow__viewport");if(!h)return;const p=window.getComputedStyle(h),{m22:y}=new window.DOMMatrixReadOnly(p.transform),g=n.reduce((_,S)=>{const k=i.get(S.id);if(k){const C=Ta(S.nodeElement);!!(C.width&&C.height&&(k.width!==C.width||k.height!==C.height||S.forceUpdate))&&(i.set(k.id,{...k,[lt]:{...k[lt],handleBounds:{source:Tc(".source",S.nodeElement,y,f),target:Tc(".target",S.nodeElement,y,f)}},...C}),_.push({id:k.id,type:"dimensions",dimensions:C}))}return _},[]);mf(i,f);const w=a||o&&!a&&gf(t,{initial:!0,...l});e({nodeInternals:new Map(i),fitViewOnInitDone:w}),(g==null?void 0:g.length)>0&&(r==null||r(g))},updateNodePositions:(n,r=!0,i=!1)=>{const{triggerNodeChanges:o}=t(),a=n.map(l=>{const d={id:l.id,type:"position",dragging:i};return r&&(d.positionAbsolute=l.positionAbsolute,d.position=l.position),d});o(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:i,hasDefaultNodes:o,nodeOrigin:a,getNodes:l,elevateNodesOnSelect:d}=t();if(n!=null&&n.length){if(o){const f=Rw(n,l()),h=ys(f,i,a,d);e({nodeInternals:h})}r==null||r(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,l=null;r?a=n.map(d=>jn(d,!0)):(a=gr(o(),n),l=gr(i,[])),Xi({changedNodes:a,changedEdges:l,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:i,getNodes:o}=t();let a,l=null;r?a=n.map(d=>jn(d,!0)):(a=gr(i,n),l=gr(o(),[])),Xi({changedNodes:l,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:i,getNodes:o}=t(),a=n||o(),l=r||i,d=a.map(h=>(h.selected=!1,jn(h.id,!1))),f=l.map(h=>jn(h.id,!1));Xi({changedNodes:d,changedEdges:f,get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:i}=t();r==null||r.scaleExtent([n,i]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:i}=t();r==null||r.scaleExtent([i,n]),e({maxZoom:n})},setTranslateExtent:n=>{var r;(r=t().d3Zoom)==null||r.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t(),o=r().filter(l=>l.selected).map(l=>jn(l.id,!1)),a=n.filter(l=>l.selected).map(l=>jn(l.id,!1));Xi({changedNodes:o,changedEdges:a,get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(i=>{i.positionAbsolute=Oa(i.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:n=>{const{transform:r,width:i,height:o,d3Zoom:a,d3Selection:l,translateExtent:d}=t();if(!a||!l||!n.x&&!n.y)return!1;const f=Nn.translate(r[0]+n.x,r[1]+n.y).scale(r[2]),h=[[0,0],[i,o]],p=a==null?void 0:a.constrain()(f,h,d);return a.transform(l,p),r[0]!==p.x||r[1]!==p.y||r[2]!==p.k},cancelConnection:()=>e({connectionNodeId:Pn.connectionNodeId,connectionHandleId:Pn.connectionHandleId,connectionHandleType:Pn.connectionHandleType,connectionStatus:Pn.connectionStatus,connectionStartHandle:Pn.connectionStartHandle,connectionEndHandle:Pn.connectionEndHandle}),reset:()=>e({...Pn})}),Object.is),jf=({children:e})=>{const t=j.useRef(null);return t.current||(t.current=_4()),ee.createElement(z6,{value:t.current},e)};jf.displayName="ReactFlowProvider";const Tf=({children:e})=>j.useContext(jo)?ee.createElement(ee.Fragment,null,e):ee.createElement(jf,null,e);Tf.displayName="ReactFlowWrapper";const S4={input:lf,default:Qs,output:uf,group:za},k4={default:yo,straight:Na,step:Ia,smoothstep:To,simplebezier:Da},C4=[0,0],E4=[15,15],P4={x:0,y:0,zoom:1},M4={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},Of=j.forwardRef(({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:o=S4,edgeTypes:a=k4,onNodeClick:l,onEdgeClick:d,onInit:f,onMove:h,onMoveStart:p,onMoveEnd:y,onConnect:g,onConnectStart:w,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:k,onNodeMouseEnter:C,onNodeMouseMove:M,onNodeMouseLeave:O,onNodeContextMenu:L,onNodeDoubleClick:T,onNodeDragStart:V,onNodeDrag:U,onNodeDragStop:W,onNodesDelete:q,onEdgesDelete:$,onSelectionChange:H,onSelectionDragStart:B,onSelectionDrag:P,onSelectionDragStop:R,onSelectionContextMenu:A,onSelectionStart:G,onSelectionEnd:X,connectionMode:F=Jn.Strict,connectionLineType:v=Tn.Bezier,connectionLineStyle:Q,connectionLineComponent:ne,connectionLineContainerStyle:E,deleteKeyCode:ae="Backspace",selectionKeyCode:J="Shift",selectionOnDrag:le=!1,selectionMode:pe=ci.Full,panActivationKeyCode:me="Space",multiSelectionKeyCode:ve=mo()?"Meta":"Control",zoomActivationKeyCode:ke=mo()?"Meta":"Control",snapToGrid:Be=!1,snapGrid:Je=E4,onlyRenderVisibleElements:He=!1,selectNodesOnDrag:we=!0,nodesDraggable:ge,nodesConnectable:Ye,nodesFocusable:Ze,nodeOrigin:ue=C4,edgesFocusable:dt,edgesUpdatable:Ne,elementsSelectable:Le,defaultViewport:Xe=P4,minZoom:ft=.5,maxZoom:ht=2,translateExtent:D=ea,preventScrolling:Z=!0,nodeExtent:te,defaultMarkerColor:se="#b1b1b7",zoomOnScroll:re=!0,zoomOnPinch:ye=!0,panOnScroll:fe=!1,panOnScrollSpeed:_e=.5,panOnScrollMode:je=Xn.Free,zoomOnDoubleClick:Ve=!0,panOnDrag:Ae=!0,onPaneClick:be,onPaneMouseEnter:tt,onPaneMouseMove:qt,onPaneMouseLeave:jt,onPaneScroll:De,onPaneContextMenu:bn,children:St,onEdgeUpdate:Xt,onEdgeContextMenu:vn,onEdgeDoubleClick:Kt,onEdgeMouseEnter:Qt,onEdgeMouseMove:Jt,onEdgeMouseLeave:Fn,onEdgeUpdateStart:en,onEdgeUpdateEnd:Or,edgeUpdaterRadius:an=10,onNodesChange:_n,onEdgesChange:ce,noDragClassName:Ar="nodrag",noWheelClassName:Dr="nowheel",noPanClassName:ot="nopan",fitView:Hn=!1,fitViewOptions:Te,connectOnClick:Ht=!0,attributionPosition:Ir,proOptions:Pe,defaultEdgeOptions:$e,elevateNodesOnSelect:pt=!0,elevateEdgesOnSelect:Ue=!1,disableKeyboardA11y:Ke=!1,autoPanOnConnect:Yt=!0,autoPanOnNodeDrag:ln=!0,connectionRadius:Bo=20,isValidConnection:Fo,onError:Ho,style:et,id:Yn,nodeDragThreshold:Yo,...Si},ki)=>{const Nr=Yn||"1";return ee.createElement("div",{...Si,style:{...et,...M4},ref:ki,className:Bt(["react-flow",i]),"data-testid":"rf__wrapper",id:Yn},ee.createElement(Tf,null,ee.createElement(v4,{onInit:f,onMove:h,onMoveStart:p,onMoveEnd:y,onNodeClick:l,onEdgeClick:d,onNodeMouseEnter:C,onNodeMouseMove:M,onNodeMouseLeave:O,onNodeContextMenu:L,onNodeDoubleClick:T,nodeTypes:o,edgeTypes:a,connectionLineType:v,connectionLineStyle:Q,connectionLineComponent:ne,connectionLineContainerStyle:E,selectionKeyCode:J,selectionOnDrag:le,selectionMode:pe,deleteKeyCode:ae,multiSelectionKeyCode:ve,panActivationKeyCode:me,zoomActivationKeyCode:ke,onlyRenderVisibleElements:He,selectNodesOnDrag:we,defaultViewport:Xe,translateExtent:D,minZoom:ft,maxZoom:ht,preventScrolling:Z,zoomOnScroll:re,zoomOnPinch:ye,zoomOnDoubleClick:Ve,panOnScroll:fe,panOnScrollSpeed:_e,panOnScrollMode:je,panOnDrag:Ae,onPaneClick:be,onPaneMouseEnter:tt,onPaneMouseMove:qt,onPaneMouseLeave:jt,onPaneScroll:De,onPaneContextMenu:bn,onSelectionContextMenu:A,onSelectionStart:G,onSelectionEnd:X,onEdgeUpdate:Xt,onEdgeContextMenu:vn,onEdgeDoubleClick:Kt,onEdgeMouseEnter:Qt,onEdgeMouseMove:Jt,onEdgeMouseLeave:Fn,onEdgeUpdateStart:en,onEdgeUpdateEnd:Or,edgeUpdaterRadius:an,defaultMarkerColor:se,noDragClassName:Ar,noWheelClassName:Dr,noPanClassName:ot,elevateEdgesOnSelect:Ue,rfId:Nr,disableKeyboardA11y:Ke,nodeOrigin:ue,nodeExtent:te}),ee.createElement(yw,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:w,onConnectEnd:_,onClickConnectStart:S,onClickConnectEnd:k,nodesDraggable:ge,nodesConnectable:Ye,nodesFocusable:Ze,edgesFocusable:dt,edgesUpdatable:Ne,elementsSelectable:Le,elevateNodesOnSelect:pt,minZoom:ft,maxZoom:ht,nodeExtent:te,onNodesChange:_n,onEdgesChange:ce,snapToGrid:Be,snapGrid:Je,connectionMode:F,translateExtent:D,connectOnClick:Ht,defaultEdgeOptions:$e,fitView:Hn,fitViewOptions:Te,onNodesDelete:q,onEdgesDelete:$,onNodeDragStart:V,onNodeDrag:U,onNodeDragStop:W,onSelectionDrag:P,onSelectionDragStart:B,onSelectionDragStop:R,noPanClassName:ot,nodeOrigin:ue,rfId:Nr,autoPanOnConnect:Yt,autoPanOnNodeDrag:ln,onError:Ho,connectionRadius:Bo,isValidConnection:Fo,nodeDragThreshold:Yo}),ee.createElement(mw,{onSelectionChange:H}),St,ee.createElement(H6,{proOptions:Pe,position:Ir}),ee.createElement(_w,{rfId:Nr,disableKeyboardA11y:Ke})))});Of.displayName="ReactFlow";const Af=async(e,t)=>{const n=await Fm();try{await pa.post("/ask_question",JSON.stringify(e),{Authorization:n})}catch(r){if(r.status===402){await Hm(t),await Af(e,t);return}throw r}},j4=48,T4=8,O4={PaperProps:{style:{maxHeight:j4*4.5+T4,width:250}}},A4=["Beginner","Intermediate","Advanced","Expert"],D4=()=>{const e=zt(C=>C.dataInitial),[t,n]=j.useState(""),[r,i]=j.useState("Beginner"),o=vt(C=>C.currentSearch),a=kg(),[l]=So(C=>[C.setBudget]),[d,f,h,p,y]=id(C=>[C.askedQuestions,C.askedQuestionsAnswers,C.setAskedQuestion,C.setAskedQuestionAnswer,C.hasQuestionInProgress]),g=j.useCallback(C=>{p(C.answer)},[p]);j.useEffect(()=>{a&&g&&a.on("askquestionhook",g)},[g,a]);const w=async()=>{t&&(h(t),n(""));try{const C=e==null?void 0:e.nodes.filter(L=>L.text),M=C==null?void 0:C.slice(0,5),O=(M!=null&&M.length?M.map(L=>L.text).join(" "):"").substring(0,2500).replace(/[?&=+/#]/g,L=>`\\${L}`);o&&(await Zn.enable(),await Af({expertise_level:r,question_text:t,search_term:o,transcripts:O},l),await Ym(l))}catch(C){console.error(C)}},_=r&&t.trim()&&!y,S=C=>{i(C.target.value)},k=async C=>{if(y){C.preventDefault();return}C.keyCode===13&&C.shiftKey===!1&&_&&(C.preventDefault(),w())};return u.jsxs(I4,{children:[u.jsx(z,{children:u.jsx(z,{children:u.jsxs(ed,{component:"div",children:[u.jsx(L4,{id:"select-label",size:"small",children:"Expertise level"}),u.jsx(R4,{id:"demo-multiple-name",input:u.jsx(Cg,{label:"Expertise level"}),labelId:"select-label",MenuProps:O4,onChange:S,size:"small",value:r,children:A4.map(C=>u.jsx(cy,{component:"li",value:C,children:C},C))})]})})}),u.jsx(B4,{children:d==null?void 0:d.map((C,M)=>u.jsxs(z,{className:"response",py:12,children:[u.jsx(Fe,{kind:"medium",children:C}),u.jsx(z,{py:12,children:(f==null?void 0:f[M])!==void 0?u.jsx(Fe,{color:"unreadMsgText",children:f[M]}):u.jsxs(z,{align:"center",py:12,children:[u.jsx(z,{align:"center",py:12,children:u.jsx(od,{color:N.white})}),u.jsx(z,{align:"center",py:12,children:u.jsx(Fe,{children:"Generating response"})})]})})]},C))}),u.jsxs($4,{onKeyDown:k,py:12,tabIndex:-1,children:[u.jsx(N4,{disabled:y,onChange:C=>n(C.target.value),placeholder:"Enter your question",value:t}),u.jsx(z4,{children:u.jsx(Eg,{color:_?N.white:N.gray300,size:"18"})})]})]})},I4=Y.div` margin-top: 20px; -`,I4=Y(vg)` +`,N4=Y(vg)` background: ${N.inputBg1}; max-width: 100%; color: ${N.secondaryText4}; padding: 16px 8px; border: none; outline: none; -`,N4=Y(_g)` +`,L4=Y(_g)` &.MuiFormLabel-root.MuiInputLabel-root { color: ${N.secondaryText4}; } -`,L4=Y(Sg)` +`,R4=Y(Sg)` .MuiInputBase-root { color: blue; } @@ -746,31 +746,31 @@ return r.version="2.29.4",i(qe),r.fn=ie,r.min=yp,r.max=xp,r.now=wp,r.utc=w,r.uni .MuiSelect-select { color: ${N.white}; } -`,R4=Y(z)` - position: relative; `,$4=Y(z)` + position: relative; +`,z4=Y(z)` position: absolute; bottom: 20px; right: 20px; transform: rotate(-45deg); -`,z4=Y(z)` +`,B4=Y(z)` flex-shrink: 1; overflow: auto; .response { border-bottom: 1px solid ${N.divider2}; } -`;const $c=({text:e})=>u.jsxs(z,{align:"center",justify:"center",py:12,children:[u.jsx(z,{align:"center",py:12,children:u.jsx(od,{color:N.white})}),u.jsx(z,{align:"center",py:12,children:u.jsx(Fe,{children:e})})]}),B4=()=>{const[e,t,n,r]=id(o=>[o.teachMeAnswer,o.hasTeachingInProgress,o.instgraphAnswser,o.hasInstagraphInProgress]),i=!r&&!!(n!=null&&n.edges)&&!!(n!=null&&n.nodes);return u.jsxs(u.Fragment,{children:[i?u.jsx(Of,{edges:n==null?void 0:n.edges,nodes:n==null?void 0:n.nodes}):u.jsx($c,{text:"Generating instagraph"}),t?u.jsx($c,{text:"Generating tutorial"}):u.jsxs(u.Fragment,{children:[u.jsx(F4,{children:u.jsx(Fe,{children:e})}),u.jsx(A4,{})]})]})};Y(Pt)``;const F4=Y(z)` +`;const $c=({text:e})=>u.jsxs(z,{align:"center",justify:"center",py:12,children:[u.jsx(z,{align:"center",py:12,children:u.jsx(od,{color:N.white})}),u.jsx(z,{align:"center",py:12,children:u.jsx(Fe,{children:e})})]}),F4=()=>{const[e,t,n,r]=id(o=>[o.teachMeAnswer,o.hasTeachingInProgress,o.instgraphAnswser,o.hasInstagraphInProgress]),i=!r&&!!(n!=null&&n.edges)&&!!(n!=null&&n.nodes);return u.jsxs(u.Fragment,{children:[i?u.jsx(Of,{edges:n==null?void 0:n.edges,nodes:n==null?void 0:n.nodes}):u.jsx($c,{text:"Generating instagraph"}),t?u.jsx($c,{text:"Generating tutorial"}):u.jsxs(u.Fragment,{children:[u.jsx(H4,{children:u.jsx(Fe,{children:e})}),u.jsx(D4,{})]})]})};Y(Pt)``;const H4=Y(z)` padding-left: 10px; padding-right: 10px; -`,H4=({cx:e,cy:t})=>u.jsx(jg,{cx:e,cy:t,fill:N.blueTextAccent,r:2}),Y4=()=>{const e=_t(),t=[...(e==null?void 0:e.data)||[]].sort((i,o)=>(i.year||0)-(o.year||0)),n=t.map(i=>i.year).filter(i=>i),r=t.map(i=>i.rate).filter(i=>i);return u.jsx(V4,{direction:"column",px:24,py:16,children:u.jsx(By,{height:"100%",width:"100%",children:u.jsxs(sx,{margin:{bottom:20,left:20,right:20,top:20},children:[u.jsx(Pg,{stroke:"#f5f5f5"}),u.jsx(Qu,{dataKey:"year",domain:[Math.min(...n),Math.max(...n)],label:{fill:N.white,fontSize:"12px",offset:-10,position:"insideBottom",value:e.x_axis_name},name:"X",tick:{fill:N.white,fontSize:"8px"},type:"number"}),u.jsx(Ju,{color:"#000",dataKey:"rate",domain:[Math.min(...r),Math.max(...r)],label:{angle:-90,fill:N.white,fontSize:"12px",offset:0,position:"insideLeft",value:e.y_axis_name},name:"Y",tick:{fill:N.white,fontSize:"8px"},type:"number"}),u.jsx(Mg,{cursor:{strokeDasharray:"3 3"}}),u.jsx(mi,{data:t,fill:N.blueTextAccent,line:!0,name:"A scatter",shape:u.jsx(H4,{})})]})})})},V4=Y(z)` +`,Y4=({cx:e,cy:t})=>u.jsx(jg,{cx:e,cy:t,fill:N.blueTextAccent,r:2}),V4=()=>{const e=_t(),t=[...(e==null?void 0:e.data)||[]].sort((i,o)=>(i.year||0)-(o.year||0)),n=t.map(i=>i.year).filter(i=>i),r=t.map(i=>i.rate).filter(i=>i);return u.jsx(U4,{direction:"column",px:24,py:16,children:u.jsx(Fy,{height:"100%",width:"100%",children:u.jsxs(ax,{margin:{bottom:20,left:20,right:20,top:20},children:[u.jsx(Pg,{stroke:"#f5f5f5"}),u.jsx(Qu,{dataKey:"year",domain:[Math.min(...n),Math.max(...n)],label:{fill:N.white,fontSize:"12px",offset:-10,position:"insideBottom",value:e.x_axis_name},name:"X",tick:{fill:N.white,fontSize:"8px"},type:"number"}),u.jsx(Ju,{color:"#000",dataKey:"rate",domain:[Math.min(...r),Math.max(...r)],label:{angle:-90,fill:N.white,fontSize:"12px",offset:0,position:"insideLeft",value:e.y_axis_name},name:"Y",tick:{fill:N.white,fontSize:"8px"},type:"number"}),u.jsx(Mg,{cursor:{strokeDasharray:"3 3"}}),u.jsx(mi,{data:t,fill:N.blueTextAccent,line:!0,name:"A scatter",shape:u.jsx(Y4,{})})]})})})},U4=Y(z)` width: 100%; height: 100%; -`;var Df={},Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.cssValue=Er.parseLengthAndUnit=void 0;var U4={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function If(e){if(typeof e=="number")return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();n.includes(".")?t=parseFloat(n):t=parseInt(n,10);var r=(e.match(/[^0-9]*$/)||"").toString();return U4[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}Er.parseLengthAndUnit=If;function W4(e){var t=If(e);return"".concat(t.value).concat(t.unit)}Er.cssValue=W4;var Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});Oo.createAnimation=void 0;var G4=function(e,t,n){var r="react-spinners-".concat(e,"-").concat(n);if(typeof window>"u"||!window.document)return r;var i=document.createElement("style");document.head.appendChild(i);var o=i.sheet,a=` +`;var Df={},Er={};Object.defineProperty(Er,"__esModule",{value:!0});Er.cssValue=Er.parseLengthAndUnit=void 0;var W4={cm:!0,mm:!0,in:!0,px:!0,pt:!0,pc:!0,em:!0,ex:!0,ch:!0,rem:!0,vw:!0,vh:!0,vmin:!0,vmax:!0,"%":!0};function If(e){if(typeof e=="number")return{value:e,unit:"px"};var t,n=(e.match(/^[0-9.]*/)||"").toString();n.includes(".")?t=parseFloat(n):t=parseInt(n,10);var r=(e.match(/[^0-9]*$/)||"").toString();return W4[r]?{value:t,unit:r}:(console.warn("React Spinners: ".concat(e," is not a valid css value. Defaulting to ").concat(t,"px.")),{value:t,unit:"px"})}Er.parseLengthAndUnit=If;function G4(e){var t=If(e);return"".concat(t.value).concat(t.unit)}Er.cssValue=G4;var Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});Oo.createAnimation=void 0;var Z4=function(e,t,n){var r="react-spinners-".concat(e,"-").concat(n);if(typeof window>"u"||!window.document)return r;var i=document.createElement("style");document.head.appendChild(i);var o=i.sheet,a=` @keyframes `.concat(r,` { `).concat(t,` } - `);return o&&o.insertRule(a,0),r};Oo.createAnimation=G4;var wo=mt&&mt.__assign||function(){return wo=Object.assign||function(e){for(var t,n=1,r=arguments.length;ne&&Gu` background: ${({selected:e})=>e?N.gray300:N.gray200}; } } -`,Nf=({count:e=0,updateCount:t,content:n,readOnly:r,refId:i})=>{const[o,a]=j.useState(!1);j.useEffect(()=>{a(!1)},[i]);let{image_url:l}=n||{};l&&(l=l.replace(".jpg","_l.jpg"));const d=5;async function f(){if(!(o||!i)){a(!0);try{await $g(i,d),t&&t(e+d)}catch(h){console.log(h)}a(!1)}}return r?e?u.jsx(Bc,{className:"booster__pill",style:{padding:"1px 8px 1px 3px",width:"fit-content"},children:u.jsxs(z,{align:"center",direction:"row",justify:"center",children:[u.jsx(Tg,{fontSize:12}),u.jsx("div",{style:{fontSize:10},children:e||0})]})}):null:u.jsx("div",{children:u.jsx(Bc,{"data-testid":"booster-pill",disabled:o,onClick:async()=>{o||await f()},style:{padding:"4px 8px",borderWidth:0,backgroundColor:"#303342",height:"25px",width:"fit-content"},children:o?u.jsx(n9,{color:"#fff",loading:!0,size:10}):u.jsxs(z,{align:"center","data-testid":"loader",direction:"row",justify:"space-around",children:[u.jsx(xd,{style:{color:N.white}}),u.jsx("div",{style:{marginLeft:8,marginRight:8},children:"Boost"})]})})})},Fa=Y(z)` +`,Nf=({count:e=0,updateCount:t,content:n,readOnly:r,refId:i})=>{const[o,a]=j.useState(!1);j.useEffect(()=>{a(!1)},[i]);let{image_url:l}=n||{};l&&(l=l.replace(".jpg","_l.jpg"));const d=5;async function f(){if(!(o||!i)){a(!0);try{await zg(i,d),t&&t(e+d)}catch(h){console.log(h)}a(!1)}}return r?e?u.jsx(Bc,{className:"booster__pill",style:{padding:"1px 8px 1px 3px",width:"fit-content"},children:u.jsxs(z,{align:"center",direction:"row",justify:"center",children:[u.jsx(Tg,{fontSize:12}),u.jsx("div",{style:{fontSize:10},children:e||0})]})}):null:u.jsx("div",{children:u.jsx(Bc,{"data-testid":"booster-pill",disabled:o,onClick:async()=>{o||await f()},style:{padding:"4px 8px",borderWidth:0,backgroundColor:"#303342",height:"25px",width:"fit-content"},children:o?u.jsx(r9,{color:"#fff",loading:!0,size:10}):u.jsxs(z,{align:"center","data-testid":"loader",direction:"row",justify:"space-around",children:[u.jsx(xd,{style:{color:N.white}}),u.jsx("div",{style:{marginLeft:8,marginRight:8},children:"Boost"})]})})})},Fa=Y(z)` background: ${N.divider2}; height: 1px; margin: auto 22px; -`,Lf=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"notes",children:[u.jsx("mask",{id:"mask0_1473_73722",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1473_73722)",children:u.jsx("path",{id:"notes_2",d:"M2.83337 11.7564C2.69171 11.7564 2.57296 11.7085 2.47712 11.6126C2.38129 11.5167 2.33337 11.3979 2.33337 11.2562C2.33337 11.1144 2.38129 10.9957 2.47712 10.9C2.57296 10.8043 2.69171 10.7564 2.83337 10.7564H9.16668C9.30834 10.7564 9.42709 10.8043 9.52293 10.9002C9.61876 10.9961 9.66668 11.1149 9.66668 11.2566C9.66668 11.3983 9.61876 11.5171 9.52293 11.6128C9.42709 11.7085 9.30834 11.7564 9.16668 11.7564H2.83337ZM2.83337 8.49997C2.69171 8.49997 2.57296 8.45204 2.47712 8.35617C2.38129 8.2603 2.33337 8.1415 2.33337 7.99977C2.33337 7.85804 2.38129 7.73931 2.47712 7.64359C2.57296 7.54787 2.69171 7.50001 2.83337 7.50001H13.1667C13.3083 7.50001 13.4271 7.54794 13.5229 7.64381C13.6188 7.73969 13.6667 7.85849 13.6667 8.00021C13.6667 8.14194 13.6188 8.26067 13.5229 8.35639C13.4271 8.45211 13.3083 8.49997 13.1667 8.49997H2.83337ZM2.83337 5.24357C2.69171 5.24357 2.57296 5.19564 2.47712 5.09976C2.38129 5.00389 2.33337 4.88509 2.33337 4.74336C2.33337 4.60164 2.38129 4.48291 2.47712 4.38719C2.57296 4.29146 2.69171 4.24359 2.83337 4.24359H13.1667C13.3083 4.24359 13.4271 4.29153 13.5229 4.38741C13.6188 4.48329 13.6667 4.60209 13.6667 4.74381C13.6667 4.88554 13.6188 5.00427 13.5229 5.09999C13.4271 5.19571 13.3083 5.24357 13.1667 5.24357H2.83337Z",fill:"currentColor"})})]})}),r9=({stateless:e,node:t,searchTerm:n})=>u.jsxs(z,{grow:1,shrink:1,children:[u.jsx(o9,{children:e&&u.jsxs(i9,{children:[u.jsx("div",{className:"icon",children:u.jsx(Lf,{})}),u.jsx("div",{className:"title",children:"Description"})]})}),u.jsx(Fe,{children:t!=null&&t.description?gn(t.description,n):"..."})]}),i9=Y(z).attrs({direction:"row",align:"center"})` +`,Lf=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"notes",children:[u.jsx("mask",{id:"mask0_1473_73722",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"16",height:"16",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1473_73722)",children:u.jsx("path",{id:"notes_2",d:"M2.83337 11.7564C2.69171 11.7564 2.57296 11.7085 2.47712 11.6126C2.38129 11.5167 2.33337 11.3979 2.33337 11.2562C2.33337 11.1144 2.38129 10.9957 2.47712 10.9C2.57296 10.8043 2.69171 10.7564 2.83337 10.7564H9.16668C9.30834 10.7564 9.42709 10.8043 9.52293 10.9002C9.61876 10.9961 9.66668 11.1149 9.66668 11.2566C9.66668 11.3983 9.61876 11.5171 9.52293 11.6128C9.42709 11.7085 9.30834 11.7564 9.16668 11.7564H2.83337ZM2.83337 8.49997C2.69171 8.49997 2.57296 8.45204 2.47712 8.35617C2.38129 8.2603 2.33337 8.1415 2.33337 7.99977C2.33337 7.85804 2.38129 7.73931 2.47712 7.64359C2.57296 7.54787 2.69171 7.50001 2.83337 7.50001H13.1667C13.3083 7.50001 13.4271 7.54794 13.5229 7.64381C13.6188 7.73969 13.6667 7.85849 13.6667 8.00021C13.6667 8.14194 13.6188 8.26067 13.5229 8.35639C13.4271 8.45211 13.3083 8.49997 13.1667 8.49997H2.83337ZM2.83337 5.24357C2.69171 5.24357 2.57296 5.19564 2.47712 5.09976C2.38129 5.00389 2.33337 4.88509 2.33337 4.74336C2.33337 4.60164 2.38129 4.48291 2.47712 4.38719C2.57296 4.29146 2.69171 4.24359 2.83337 4.24359H13.1667C13.3083 4.24359 13.4271 4.29153 13.5229 4.38741C13.6188 4.48329 13.6667 4.60209 13.6667 4.74381C13.6667 4.88554 13.6188 5.00427 13.5229 5.09999C13.4271 5.19571 13.3083 5.24357 13.1667 5.24357H2.83337Z",fill:"currentColor"})})]})}),i9=({stateless:e,node:t,searchTerm:n})=>u.jsxs(z,{grow:1,shrink:1,children:[u.jsx(s9,{children:e&&u.jsxs(o9,{children:[u.jsx("div",{className:"icon",children:u.jsx(Lf,{})}),u.jsx("div",{className:"title",children:"Description"})]})}),u.jsx(Fe,{children:t!=null&&t.description?gn(t.description,n):"..."})]}),o9=Y(z).attrs({direction:"row",align:"center"})` .icon { font-size: 16px; color: ${N.GRAY3}; @@ -816,9 +816,9 @@ ${({disabled:e})=>e&&Gu` letter-spacing: 1pt; text-transform: uppercase; } -`,o9=Y(z).attrs({direction:"row",align:"center",justify:"space-between"})` +`,s9=Y(z).attrs({direction:"row",align:"center",justify:"space-between"})` margin-bottom: 18px; -`,s9=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"content_copy",children:[u.jsx("mask",{id:"mask0_1489_75628",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"14",height:"14",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1489_75628)",children:u.jsx("path",{id:"content_copy_2",d:"M5.28363 10.2083C4.98897 10.2083 4.73956 10.1063 4.5354 9.9021C4.33124 9.69793 4.22915 9.44852 4.22915 9.15385V2.51287C4.22915 2.21821 4.33124 1.96879 4.5354 1.76462C4.73956 1.56046 4.98897 1.45837 5.28363 1.45837H10.1746C10.4693 1.45837 10.7187 1.56046 10.9229 1.76462C11.127 1.96879 11.2291 2.21821 11.2291 2.51287V9.15385C11.2291 9.44852 11.127 9.69793 10.9229 9.9021C10.7187 10.1063 10.4693 10.2083 10.1746 10.2083H5.28363ZM5.28363 9.33336H10.1746C10.2195 9.33336 10.2606 9.31466 10.298 9.27727C10.3354 9.23987 10.3541 9.19873 10.3541 9.15385V2.51287C10.3541 2.46799 10.3354 2.42685 10.298 2.38945C10.2606 2.35206 10.2195 2.33336 10.1746 2.33336H5.28363C5.23875 2.33336 5.19762 2.35206 5.16023 2.38945C5.12282 2.42685 5.10412 2.46799 5.10412 2.51287V9.15385C5.10412 9.19873 5.12282 9.23987 5.16023 9.27727C5.19762 9.31466 5.23875 9.33336 5.28363 9.33336ZM3.24198 12.25C2.94733 12.25 2.69792 12.1479 2.49375 11.9437C2.28958 11.7396 2.1875 11.4902 2.1875 11.1955V3.67953H3.06249V11.1955C3.06249 11.2404 3.08118 11.2815 3.11857 11.3189C3.15597 11.3563 3.19711 11.375 3.24198 11.375H9.00796V12.25H3.24198Z",fill:"currentColor"})})]})}),a9=Y.span` +`,a9=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"content_copy",children:[u.jsx("mask",{id:"mask0_1489_75628",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"14",height:"14",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1489_75628)",children:u.jsx("path",{id:"content_copy_2",d:"M5.28363 10.2083C4.98897 10.2083 4.73956 10.1063 4.5354 9.9021C4.33124 9.69793 4.22915 9.44852 4.22915 9.15385V2.51287C4.22915 2.21821 4.33124 1.96879 4.5354 1.76462C4.73956 1.56046 4.98897 1.45837 5.28363 1.45837H10.1746C10.4693 1.45837 10.7187 1.56046 10.9229 1.76462C11.127 1.96879 11.2291 2.21821 11.2291 2.51287V9.15385C11.2291 9.44852 11.127 9.69793 10.9229 9.9021C10.7187 10.1063 10.4693 10.2083 10.1746 10.2083H5.28363ZM5.28363 9.33336H10.1746C10.2195 9.33336 10.2606 9.31466 10.298 9.27727C10.3354 9.23987 10.3541 9.19873 10.3541 9.15385V2.51287C10.3541 2.46799 10.3354 2.42685 10.298 2.38945C10.2606 2.35206 10.2195 2.33336 10.1746 2.33336H5.28363C5.23875 2.33336 5.19762 2.35206 5.16023 2.38945C5.12282 2.42685 5.10412 2.46799 5.10412 2.51287V9.15385C5.10412 9.19873 5.12282 9.23987 5.16023 9.27727C5.19762 9.31466 5.23875 9.33336 5.28363 9.33336ZM3.24198 12.25C2.94733 12.25 2.69792 12.1479 2.49375 11.9437C2.28958 11.7396 2.1875 11.4902 2.1875 11.1955V3.67953H3.06249V11.1955C3.06249 11.2404 3.08118 11.2815 3.11857 11.3189C3.15597 11.3563 3.19711 11.375 3.24198 11.375H9.00796V12.25H3.24198Z",fill:"currentColor"})})]})}),l9=Y.span` color: ${N.white}; cursor: pointer; text-transform: uppercase; @@ -829,7 +829,7 @@ ${({disabled:e})=>e&&Gu` &:hover { color: ${N.GRAY3}; } -`,l9=({stateless:e,node:t})=>{var w;const[n,r]=vt(_=>[_.transcriptIsOpen,_.setTranscriptOpen]),[i,o]=j.useState(!1),[a,l]=j.useState(""),[d,f]=j.useState(!1);if(!e&&!n)return null;const h=async()=>{try{const _=await Yl(t==null?void 0:t.ref_id);l(_.data.text)}catch(_){console.error("Error fetching full transcript",_)}},p=async()=>{if(a===""){const _=await Yl(t==null?void 0:t.ref_id);g(_.data.text)}else g(a);setTimeout(()=>{o(!1)},2e3)},y=async()=>{d?f(!1):(await h(),f(!0))},g=_=>{_!==void 0&&(navigator.clipboard.writeText(_),o(!0))};return u.jsxs(z,{grow:1,shrink:1,children:[u.jsxs(u9,{children:[e&&u.jsxs(c9,{children:[u.jsx("div",{className:"icon",children:u.jsx(Lf,{})}),u.jsx("div",{className:"title",children:"Transcript"})]}),t!=null&&t.text?u.jsx(u.Fragment,{children:i?u.jsxs(h9,{align:"center",direction:"row",justify:"flex-start",children:[u.jsx("div",{className:"icon",children:u.jsx(td,{})}),u.jsx("div",{className:"text",children:"Copied"})]}):u.jsx(Pt,{endIcon:u.jsx(s9,{}),onPointerDown:()=>p(),size:"small",variant:"outlined",children:"Copy"})}):u.jsx("div",{}),!e&&u.jsx(d9,{onClick:()=>{r(!1)},children:u.jsx(Og,{fontSize:35})})]}),u.jsxs(f9,{children:[d?a:`${(w=t==null?void 0:t.text)==null?void 0:w.substring(0,100)}`,u.jsxs(a9,{onClick:y,children:["... ",d?"show less":"more"]})]})]})},c9=Y(z).attrs({direction:"row",align:"center"})` +`,c9=({stateless:e,node:t})=>{var w;const[n,r]=vt(_=>[_.transcriptIsOpen,_.setTranscriptOpen]),[i,o]=j.useState(!1),[a,l]=j.useState(""),[d,f]=j.useState(!1);if(!e&&!n)return null;const h=async()=>{try{const _=await Yl(t==null?void 0:t.ref_id);l(_.data.text)}catch(_){console.error("Error fetching full transcript",_)}},p=async()=>{if(a===""){const _=await Yl(t==null?void 0:t.ref_id);g(_.data.text)}else g(a);setTimeout(()=>{o(!1)},2e3)},y=async()=>{d?f(!1):(await h(),f(!0))},g=_=>{_!==void 0&&(navigator.clipboard.writeText(_),o(!0))};return u.jsxs(z,{grow:1,shrink:1,children:[u.jsxs(d9,{children:[e&&u.jsxs(u9,{children:[u.jsx("div",{className:"icon",children:u.jsx(Lf,{})}),u.jsx("div",{className:"title",children:"Transcript"})]}),t!=null&&t.text?u.jsx(u.Fragment,{children:i?u.jsxs(p9,{align:"center",direction:"row",justify:"flex-start",children:[u.jsx("div",{className:"icon",children:u.jsx(td,{})}),u.jsx("div",{className:"text",children:"Copied"})]}):u.jsx(Pt,{endIcon:u.jsx(a9,{}),onPointerDown:()=>p(),size:"small",variant:"outlined",children:"Copy"})}):u.jsx("div",{}),!e&&u.jsx(f9,{onClick:()=>{r(!1)},children:u.jsx(Og,{fontSize:35})})]}),u.jsxs(h9,{children:[d?a:`${(w=t==null?void 0:t.text)==null?void 0:w.substring(0,100)}`,u.jsxs(l9,{onClick:y,children:["... ",d?"show less":"more"]})]})]})},u9=Y(z).attrs({direction:"row",align:"center"})` .icon { font-size: 16px; color: ${N.GRAY3}; @@ -846,15 +846,15 @@ ${({disabled:e})=>e&&Gu` letter-spacing: 1pt; text-transform: uppercase; } -`,u9=Y(z).attrs({direction:"row",align:"center",justify:"space-between"})` +`,d9=Y(z).attrs({direction:"row",align:"center",justify:"space-between"})` margin-bottom: 18px; -`,d9=Y(z).attrs({})` +`,f9=Y(z).attrs({})` color: ${N.mainBottomIcons}; cursor: pointer; &:hover { color: ${N.lightBlue500}; } -`,f9=Y(z)` +`,h9=Y(z)` color: ${N.white}; whitespace: nowrap; font-family: Barlow; @@ -863,7 +863,7 @@ ${({disabled:e})=>e&&Gu` font-style: normal; font-weight: 300; line-height: 22px; -`,h9=Y(z)` +`,p9=Y(z)` color: ${N.SECONDARY_BLUE}; font-family: Barlow; font-size: 13px; @@ -877,20 +877,20 @@ ${({disabled:e})=>e&&Gu` .icon { font-size: 12px; } -`,Rf=({node:e})=>{const t=_t(),n=vt(_=>_.currentSearch),{link:r,image_url:i,date:o,boost:a,node_type:l,type:d,id:f,show_title:h,episode_title:p,ref_id:y}=e||t||{},[g,w]=j.useState(a||0);return j.useEffect(()=>{w(a??0)},[a]),!e&&!t?null:u.jsx("div",{style:{overflow:"auto",flex:1,width:"100%"},children:u.jsxs(p9,{children:[u.jsx(g9,{boostCount:g||0,date:o||0,episodeTitle:_r(p),imageUrl:i,isSelectedView:!0,link:r,onClick:()=>null,showTitle:h,type:l||d}),u.jsx(vs,{}),u.jsxs(m9,{children:[u.jsx(Sa,{amt:g}),u.jsx(Nf,{content:e||t,count:g,refId:y,updateCount:w})]}),u.jsx(vs,{}),u.jsx(Fc,{children:u.jsx(r9,{node:e||t,searchTerm:n,stateless:!0})}),((t==null?void 0:t.text)||(e==null?void 0:e.text))&&u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx(Fc,{children:u.jsx(l9,{node:e||t,stateless:!0},f)})]})]})})},p9=Y(z)` +`,Rf=({node:e})=>{const t=_t(),n=vt(_=>_.currentSearch),{link:r,image_url:i,date:o,boost:a,node_type:l,type:d,id:f,show_title:h,episode_title:p,ref_id:y}=e||t||{},[g,w]=j.useState(a||0);return j.useEffect(()=>{w(a??0)},[a]),!e&&!t?null:u.jsx("div",{style:{overflow:"auto",flex:1,width:"100%"},children:u.jsxs(m9,{children:[u.jsx(y9,{boostCount:g||0,date:o||0,episodeTitle:_r(p),imageUrl:i,isSelectedView:!0,link:r,onClick:()=>null,showTitle:h,type:l||d}),u.jsx(vs,{}),u.jsxs(g9,{children:[u.jsx(Sa,{amt:g}),u.jsx(Nf,{content:e||t,count:g,refId:y,updateCount:w})]}),u.jsx(vs,{}),u.jsx(Fc,{children:u.jsx(i9,{node:e||t,searchTerm:n,stateless:!0})}),((t==null?void 0:t.text)||(e==null?void 0:e.text))&&u.jsxs(u.Fragment,{children:[u.jsx(vs,{}),u.jsx(Fc,{children:u.jsx(c9,{node:e||t,stateless:!0},f)})]})]})})},m9=Y(z)` flex: 1; min-height: 100%; flex-direction: column; border-bottom: 1px solid #101317; box-shadow: 0px 5px 6px rgba(0, 0, 0, 0.5); z-index: -1; -`,m9=Y(z)` +`,g9=Y(z)` flex-direction: row; justify-content: space-between; padding: 18px 18px 18px; `,Fc=Y(z)` padding: 18px 18px 18px; -`,g9=Y(ka)` +`,y9=Y(ka)` & { border-top: none; padding-bottom: 18px; @@ -899,7 +899,7 @@ ${({disabled:e})=>e&&Gu` `,vs=Y(Fa)` margin: auto 0px 2px 0px; opacity: 75%; -`,y9=Y(z)` +`,x9=Y(z)` flex-direction: column; border-bottom: 1px solid #101317; z-index: 0; @@ -921,7 +921,7 @@ ${({disabled:e})=>e&&Gu` margin-left: 8px; } } -`,x9=({selectedNodeShow:e})=>{const t=_t(),n=pi(),{type:r}=t||{},i=vt(o=>o.currentSearch);return u.jsxs(y9,{p:20,children:[u.jsx(z,{align:"flex-start",children:r&&u.jsx(Mr,{type:r})}),u.jsx(z,{direction:"row",mb:22,mt:22,children:u.jsx(z,{grow:1,shrink:1,children:u.jsx(Fe,{className:"episode-title",kind:"heading",children:gn((t==null?void 0:t.episode_title)||"Unknown",i)})})}),e?u.jsxs(z,{className:"show",direction:"row",onClick:()=>n(e),children:[u.jsx(Gt,{size:16,src:(e==null?void 0:e.image_url)||"",type:"show"}),u.jsx(Fe,{className:"show__title",color:"mainBottomIcons",kind:"regular",children:e==null?void 0:e.show_title})]}):null]})},w9=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"schedule",children:[u.jsx("mask",{id:"mask0_4051_4016",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_4051_4016)",children:u.jsx("path",{id:"schedule_2",d:"M12.75 11.6961V7.74995C12.75 7.53747 12.6781 7.35935 12.5343 7.2156C12.3904 7.07185 12.2122 6.99998 11.9997 6.99998C11.7871 6.99998 11.609 7.07185 11.4654 7.2156C11.3218 7.35935 11.25 7.53747 11.25 7.74995V11.9269C11.25 12.0446 11.2718 12.1587 11.3154 12.269C11.359 12.3794 11.4276 12.4814 11.5212 12.575L14.9462 16C15.0846 16.1384 15.2587 16.2093 15.4683 16.2125C15.6779 16.2157 15.8551 16.1448 16 16C16.1448 15.8551 16.2173 15.6795 16.2173 15.4731C16.2173 15.2667 16.1448 15.091 16 14.9462L12.75 11.6961ZM12.0016 21.5C10.6877 21.5 9.45268 21.2506 8.29655 20.752C7.1404 20.2533 6.13472 19.5765 5.2795 18.7217C4.42427 17.8669 3.74721 16.8616 3.24833 15.706C2.74944 14.5504 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45268 3.248 8.29655C3.74667 7.1404 4.42342 6.13472 5.27825 5.2795C6.1331 4.42427 7.13834 3.74721 8.29398 3.24833C9.44959 2.74944 10.6844 2.5 11.9983 2.5C13.3122 2.5 14.5473 2.74933 15.7034 3.248C16.8596 3.74667 17.8652 4.42342 18.7205 5.27825C19.5757 6.1331 20.2527 7.13834 20.7516 8.29398C21.2505 9.44959 21.5 10.6844 21.5 11.9983C21.5 13.3122 21.2506 14.5473 20.752 15.7034C20.2533 16.8596 19.5765 17.8652 18.7217 18.7205C17.8669 19.5757 16.8616 20.2527 15.706 20.7516C14.5504 21.2505 13.3156 21.5 12.0016 21.5Z",fill:"currentColor"})})]})}),b9="Flow 1",v9=0,_9=12,S9=15,k9={g:"LottieFiles Figma v45"},C9=[{ty:4,nm:"Rectangle 4497",sr:1,st:0,op:60,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1.5,6],t:58},{s:[1.5,6],t:59}]},s:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100,100],t:58},{s:[100,100],t:59}]},sk:{a:0,k:0},p:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,6],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,6],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,6],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,6],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,9],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,9],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[13.5,6],t:58},{s:[13.5,6],t:59}]},r:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[0],t:58},{s:[0],t:59}]},sa:{a:0,k:0},o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}},shapes:[{ty:"sh",bm:0,hd:!1,nm:"",d:1,ks:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:58},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:59}]}},{ty:"fl",bm:0,hd:!1,nm:"",c:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1,1,1],t:58},{s:[1,1,1],t:59}]},r:1,o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}}],ind:1},{ty:4,nm:"Rectangle 4497",sr:1,st:0,op:60,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,5],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,5],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1.5,3],t:58},{s:[1.5,3],t:59}]},s:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100,100],t:58},{s:[100,100],t:59}]},sk:{a:0,k:0},p:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,9],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,9],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,6],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,6],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,7],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,7],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[7.5,9],t:58},{s:[7.5,9],t:59}]},r:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[0],t:58},{s:[0],t:59}]},sa:{a:0,k:0},o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}},shapes:[{ty:"sh",bm:0,hd:!1,nm:"",d:1,ks:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,10],[0,10]]}],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,10],[0,10]]}],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:58},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:59}]}},{ty:"fl",bm:0,hd:!1,nm:"",c:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1,1,1],t:58},{s:[1,1,1],t:59}]},r:1,o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}}],ind:2},{ty:4,nm:"Rectangle 4497",sr:1,st:0,op:60,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1.5,6],t:58},{s:[1.5,6],t:59}]},s:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100,100],t:58},{s:[100,100],t:59}]},sk:{a:0,k:0},p:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,9],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,9],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1.5,6],t:58},{s:[1.5,6],t:59}]},r:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[0],t:58},{s:[0],t:59}]},sa:{a:0,k:0},o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}},shapes:[{ty:"sh",bm:0,hd:!1,nm:"",d:1,ks:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:58},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:59}]}},{ty:"fl",bm:0,hd:!1,nm:"",c:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1,1,1],t:58},{s:[1,1,1],t:59}]},r:1,o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}}],ind:3}],E9="5.7.0",P9=60,M9=57.6,j9=0,T9=[],O9={nm:b9,ddd:v9,h:_9,w:S9,meta:k9,layers:C9,v:E9,fr:P9,op:M9,ip:j9,assets:T9},A9=()=>{const e=j.useRef(null);return j.useEffect(()=>{const t=document.getElementById("lottie-timestamp-equalizer");return t&&(e.current=Vm.loadAnimation({container:t,animationData:O9,loop:!0,autoplay:!0})),()=>{e.current&&e.current.destroy()}},[]),u.jsx("div",{id:"lottie-timestamp-equalizer",style:{width:"18px",height:"18px"}})},D9=Y(z).attrs(()=>({direction:"row"}))` +`,w9=({selectedNodeShow:e})=>{const t=_t(),n=pi(),{type:r}=t||{},i=vt(o=>o.currentSearch);return u.jsxs(x9,{p:20,children:[u.jsx(z,{align:"flex-start",children:r&&u.jsx(Mr,{type:r})}),u.jsx(z,{direction:"row",mb:22,mt:22,children:u.jsx(z,{grow:1,shrink:1,children:u.jsx(Fe,{className:"episode-title",kind:"heading",children:gn((t==null?void 0:t.episode_title)||"Unknown",i)})})}),e?u.jsxs(z,{className:"show",direction:"row",onClick:()=>n(e),children:[u.jsx(Gt,{size:16,src:(e==null?void 0:e.image_url)||"",type:"show"}),u.jsx(Fe,{className:"show__title",color:"mainBottomIcons",kind:"regular",children:e==null?void 0:e.show_title})]}):null]})},b9=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"schedule",children:[u.jsx("mask",{id:"mask0_4051_4016",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_4051_4016)",children:u.jsx("path",{id:"schedule_2",d:"M12.75 11.6961V7.74995C12.75 7.53747 12.6781 7.35935 12.5343 7.2156C12.3904 7.07185 12.2122 6.99998 11.9997 6.99998C11.7871 6.99998 11.609 7.07185 11.4654 7.2156C11.3218 7.35935 11.25 7.53747 11.25 7.74995V11.9269C11.25 12.0446 11.2718 12.1587 11.3154 12.269C11.359 12.3794 11.4276 12.4814 11.5212 12.575L14.9462 16C15.0846 16.1384 15.2587 16.2093 15.4683 16.2125C15.6779 16.2157 15.8551 16.1448 16 16C16.1448 15.8551 16.2173 15.6795 16.2173 15.4731C16.2173 15.2667 16.1448 15.091 16 14.9462L12.75 11.6961ZM12.0016 21.5C10.6877 21.5 9.45268 21.2506 8.29655 20.752C7.1404 20.2533 6.13472 19.5765 5.2795 18.7217C4.42427 17.8669 3.74721 16.8616 3.24833 15.706C2.74944 14.5504 2.5 13.3156 2.5 12.0017C2.5 10.6877 2.74933 9.45268 3.248 8.29655C3.74667 7.1404 4.42342 6.13472 5.27825 5.2795C6.1331 4.42427 7.13834 3.74721 8.29398 3.24833C9.44959 2.74944 10.6844 2.5 11.9983 2.5C13.3122 2.5 14.5473 2.74933 15.7034 3.248C16.8596 3.74667 17.8652 4.42342 18.7205 5.27825C19.5757 6.1331 20.2527 7.13834 20.7516 8.29398C21.2505 9.44959 21.5 10.6844 21.5 11.9983C21.5 13.3122 21.2506 14.5473 20.752 15.7034C20.2533 16.8596 19.5765 17.8652 18.7217 18.7205C17.8669 19.5757 16.8616 20.2527 15.706 20.7516C14.5504 21.2505 13.3156 21.5 12.0016 21.5Z",fill:"currentColor"})})]})}),v9="Flow 1",_9=0,S9=12,k9=15,C9={g:"LottieFiles Figma v45"},E9=[{ty:4,nm:"Rectangle 4497",sr:1,st:0,op:60,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1.5,6],t:58},{s:[1.5,6],t:59}]},s:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100,100],t:58},{s:[100,100],t:59}]},sk:{a:0,k:0},p:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,6],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,6],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,6],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,6],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,9],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[13.5,9],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[13.5,6],t:58},{s:[13.5,6],t:59}]},r:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[0],t:58},{s:[0],t:59}]},sa:{a:0,k:0},o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}},shapes:[{ty:"sh",bm:0,hd:!1,nm:"",d:1,ks:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:58},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:59}]}},{ty:"fl",bm:0,hd:!1,nm:"",c:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1,1,1],t:58},{s:[1,1,1],t:59}]},r:1,o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}}],ind:1},{ty:4,nm:"Rectangle 4497",sr:1,st:0,op:60,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,5],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,5],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1.5,3],t:58},{s:[1.5,3],t:59}]},s:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100,100],t:58},{s:[100,100],t:59}]},sk:{a:0,k:0},p:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,9],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,9],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,6],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,6],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,7],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[7.5,7],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[7.5,9],t:58},{s:[7.5,9],t:59}]},r:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[0],t:58},{s:[0],t:59}]},sa:{a:0,k:0},o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}},shapes:[{ty:"sh",bm:0,hd:!1,nm:"",d:1,ks:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,10],[0,10]]}],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,10],[0,10]]}],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:58},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:59}]}},{ty:"fl",bm:0,hd:!1,nm:"",c:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1,1,1],t:58},{s:[1,1,1],t:59}]},r:1,o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}}],ind:2},{ty:4,nm:"Rectangle 4497",sr:1,st:0,op:60,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,3],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1.5,6],t:58},{s:[1.5,6],t:59}]},s:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100,100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100,100],t:58},{s:[100,100],t:59}]},sk:{a:0,k:0},p:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,9],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,9],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1.5,6],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1.5,6],t:58},{s:[1.5,6],t:59}]},r:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[0],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[0],t:58},{s:[0],t:59}]},sa:{a:0,k:0},o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}},shapes:[{ty:"sh",bm:0,hd:!1,nm:"",d:1,ks:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,6],[0,6]]}],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:58},{s:[{c:!0,i:[[0,0],[0,0],[0,0],[0,0]],o:[[0,0],[0,0],[0,0],[0,0]],v:[[0,0],[3,0],[3,12],[0,12]]}],t:59}]}},{ty:"fl",bm:0,hd:!1,nm:"",c:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[1,1,1],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[1,1,1],t:58},{s:[1,1,1],t:59}]},r:1,o:{a:1,k:[{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:0},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:1},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:19},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:20},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:38},{o:{x:0,y:0},i:{x:.58,y:1},s:[100],t:40},{o:{x:0,y:0},i:{x:1,y:1},s:[100],t:58},{s:[100],t:59}]}}],ind:3}],P9="5.7.0",M9=60,j9=57.6,T9=0,O9=[],A9={nm:v9,ddd:_9,h:S9,w:k9,meta:C9,layers:E9,v:P9,fr:M9,op:j9,ip:T9,assets:O9},D9=()=>{const e=j.useRef(null);return j.useEffect(()=>{const t=document.getElementById("lottie-timestamp-equalizer");return t&&(e.current=Vm.loadAnimation({container:t,animationData:A9,loop:!0,autoplay:!0})),()=>{e.current&&e.current.destroy()}},[]),u.jsx("div",{id:"lottie-timestamp-equalizer",style:{width:"18px",height:"18px"}})},I9=Y(z).attrs(()=>({direction:"row"}))` cursor: pointer; color: ${N.primaryText1}; border-top: 1px solid ${N.black}; @@ -945,7 +945,7 @@ ${({disabled:e})=>e&&Gu` color: ${N.white}; } } -`,I9=({onClick:e,timestamp:t,isSelected:n,setOpenClip:r})=>{const i=n?"blueTextAccent":"placeholderText";return n?(Ag,N[i]):(Dg,N[i]),u.jsxs(D9,{align:"center","data-testid":"wrapper",direction:"row",isSelected:n,justify:"flex-start",onClick:e,px:20,py:20,children:[u.jsxs("div",{children:[u.jsx(sd,{className:"play-pause",children:n?u.jsx(A9,{}):u.jsx(w9,{})}),!1]}),u.jsxs(N9,{align:"flex-start",direction:"column",justify:"center",children:[t.timestamp&&u.jsx("span",{className:"timestamp",children:zg(t.timestamp)}),u.jsx("span",{className:"title",children:_r(t.show_title)})]}),u.jsx("div",{className:"info",children:u.jsx(z,{"data-testid":"info-icon-wrapper",onClick:()=>r(t),pt:4,children:u.jsx(Ig,{})})})]})},N9=Y(z)` +`,N9=({onClick:e,timestamp:t,isSelected:n,setOpenClip:r})=>{const i=n?"blueTextAccent":"placeholderText";return n?(Ag,N[i]):(Dg,N[i]),u.jsxs(I9,{align:"center","data-testid":"wrapper",direction:"row",isSelected:n,justify:"flex-start",onClick:e,px:20,py:20,children:[u.jsxs("div",{children:[u.jsx(sd,{className:"play-pause",children:n?u.jsx(D9,{}):u.jsx(b9,{})}),!1]}),u.jsxs(L9,{align:"flex-start",direction:"column",justify:"center",children:[t.timestamp&&u.jsx("span",{className:"timestamp",children:Bg(t.timestamp)}),u.jsx("span",{className:"title",children:_r(t.show_title)})]}),u.jsx("div",{className:"info",children:u.jsx(z,{"data-testid":"info-icon-wrapper",onClick:()=>r(t),pt:4,children:u.jsx(Ig,{})})})]})},L9=Y(z)` font-size: 13px; color: ${N.white}; font-family: 'Barlow'; @@ -960,7 +960,7 @@ ${({disabled:e})=>e&&Gu` .timestamp { color: ${N.GRAY6}; } -`,L9=Y(z)` +`,R9=Y(z)` overflow: scroll; &::-webkit-scrollbar { @@ -972,7 +972,7 @@ ${({disabled:e})=>e&&Gu` width: 1px; height: 4px; } -`,R9=()=>{const e=_t(),t=ad(),[n,r]=j.useState(null),[i,o]=j.useState(null),[a,l,d,f,h]=ko(w=>[w.playingNode,w.setPlayingNodeLink,w.setPlayingTime,w.setIsSeeking,w.playingTime]),p=j.useMemo(()=>cd((t==null?void 0:t.nodes)||[],e),[t==null?void 0:t.nodes,e]),y=j.useMemo(()=>t==null?void 0:t.nodes.find(w=>w.node_type==="show"&&w.show_title===(e==null?void 0:e.show_title)),[t==null?void 0:t.nodes,e]),g=j.useCallback(w=>{var S;const _=Kn(((S=w==null?void 0:w.timestamp)==null?void 0:S.split("-")[0])||"00:00:01");(a&&w.link&&(a==null?void 0:a.link)!==w.link||(!a||(a==null?void 0:a.link)!==w.link)&&w.link!==void 0)&&(l(w.link),d(0),f(!0)),d(_),f(!0),o(w)},[a,l,f,o,d]);return j.useEffect(()=>{p!=null&&p.length&&!p.some(w=>w.ref_id===(i==null?void 0:i.ref_id))&&g(p[0])},[p,i,g]),j.useEffect(()=>{if(p!=null&&p.length){const w=p.find(_=>{if(!_.timestamp)return!1;const S=Kn(_.timestamp.split("-")[0]);return Math.abs(S-h)<1});w&&w.ref_id!==(i==null?void 0:i.ref_id)&&o(w)}},[h,p,i]),e?u.jsx("div",{style:{overflow:"auto",flex:1,width:"100%"},children:u.jsxs(z9,{children:[n&&u.jsx(B9,{className:"slide-me",direction:"up",in:!!n,children:u.jsxs($9,{children:[u.jsx(z,{className:"close-info",onClick:()=>r(null),children:u.jsx(_a,{})}),n&&u.jsx(Rf,{node:n})]})}),u.jsx(x9,{selectedNodeShow:y}),!!(p!=null&&p.length)&&u.jsx(L9,{children:u.jsx(z,{pb:20,children:p==null?void 0:p.map((w,_)=>u.jsx(I9,{isSelected:(i==null?void 0:i.ref_id)===w.ref_id,onClick:()=>g(w),setOpenClip:r,timestamp:w},`${w.episode_title}_${_}`))})})]})}):null},$9=Y(z)` +`,$9=()=>{const e=_t(),t=ad(),[n,r]=j.useState(null),[i,o]=j.useState(null),[a,l,d,f,h]=ko(w=>[w.playingNode,w.setPlayingNodeLink,w.setPlayingTime,w.setIsSeeking,w.playingTime]),p=j.useMemo(()=>cd((t==null?void 0:t.nodes)||[],e),[t==null?void 0:t.nodes,e]),y=j.useMemo(()=>t==null?void 0:t.nodes.find(w=>w.node_type==="show"&&w.show_title===(e==null?void 0:e.show_title)),[t==null?void 0:t.nodes,e]),g=j.useCallback(w=>{var S;const _=Kn(((S=w==null?void 0:w.timestamp)==null?void 0:S.split("-")[0])||"00:00:01");(a&&w.link&&(a==null?void 0:a.link)!==w.link||(!a||(a==null?void 0:a.link)!==w.link)&&w.link!==void 0)&&(l(w.link),d(0),f(!0)),d(_),f(!0),o(w)},[a,l,f,o,d]);return j.useEffect(()=>{p!=null&&p.length&&!p.some(w=>w.ref_id===(i==null?void 0:i.ref_id))&&g(p[0])},[p,i,g]),j.useEffect(()=>{if(p!=null&&p.length){const w=p.find(_=>{if(!_.timestamp)return!1;const S=Kn(_.timestamp.split("-")[0]);return Math.abs(S-h)<1});w&&w.ref_id!==(i==null?void 0:i.ref_id)&&o(w)}},[h,p,i]),e?u.jsx("div",{style:{overflow:"auto",flex:1,width:"100%"},children:u.jsxs(B9,{children:[n&&u.jsx(F9,{className:"slide-me",direction:"up",in:!!n,children:u.jsxs(z9,{children:[u.jsx(z,{className:"close-info",onClick:()=>r(null),children:u.jsx(_a,{})}),n&&u.jsx(Rf,{node:n})]})}),u.jsx(w9,{selectedNodeShow:y}),!!(p!=null&&p.length)&&u.jsx(R9,{children:u.jsx(z,{pb:20,children:p==null?void 0:p.map((w,_)=>u.jsx(N9,{isSelected:(i==null?void 0:i.ref_id)===w.ref_id,onClick:()=>g(w),setOpenClip:r,timestamp:w},`${w.episode_title}_${_}`))})})]})}):null},z9=Y(z)` border-radius: 20px; overflow: hidden; height: 100%; @@ -985,14 +985,14 @@ ${({disabled:e})=>e&&Gu` font-size: 20px; cursor: pointer; } -`,z9=Y(z)` +`,B9=Y(z)` position: relative; flex: 1; min-height: 100%; flex-direction: column; border-bottom: 1px solid #101317; box-shadow: 0px 5px 6px rgba(0, 0, 0, 0.5); -`,B9=Y(wa)` +`,F9=Y(wa)` && { position: sticky; left: 0; @@ -1004,7 +1004,7 @@ ${({disabled:e})=>e&&Gu` background: ${N.BG1}; z-index: 1; } -`,F9=()=>{const e=_t(),t=e==null?void 0:e.name;return u.jsxs(z,{direction:"column",px:24,py:16,children:[u.jsx(Gt,{"data-testid":"person-image",size:80,src:(e==null?void 0:e.source_link)||"",type:"image"}),u.jsx(z,{py:20,children:u.jsx(Fe,{color:"primaryText1",kind:"bigHeading",children:t})})]})},H9=()=>{const{sender_pic:e,sender_alias:t,date:n,message_content:r}=_t()||{};return u.jsxs(z,{direction:"row",children:[u.jsx(U9,{src:e}),u.jsxs(Y9,{children:[u.jsxs(z,{align:"flex-end",className:"info",direction:"row",children:[t&&u.jsx("span",{className:"info__name",children:t}),n&&u.jsx("span",{className:"info__date",children:n})]}),r&&u.jsx(V9,{dangerouslySetInnerHTML:{__html:Fg(r)}})]})]})},Y9=Y(z)` +`,H9=()=>{const e=_t(),t=e==null?void 0:e.name;return u.jsxs(z,{direction:"column",px:24,py:16,children:[u.jsx(Gt,{"data-testid":"person-image",size:80,src:(e==null?void 0:e.source_link)||"",type:"image"}),u.jsx(z,{py:20,children:u.jsx(Fe,{color:"primaryText1",kind:"bigHeading",children:t})})]})},Y9=()=>{const{sender_pic:e,sender_alias:t,date:n,message_content:r}=_t()||{};return u.jsxs(z,{direction:"row",children:[u.jsx(W9,{src:e}),u.jsxs(V9,{children:[u.jsxs(z,{align:"flex-end",className:"info",direction:"row",children:[t&&u.jsx("span",{className:"info__name",children:t}),n&&u.jsx("span",{className:"info__date",children:n})]}),r&&u.jsx(U9,{dangerouslySetInnerHTML:{__html:Hg(r)}})]})]})},V9=Y(z)` color: ${N.black}; border-radius: 8px; font-size: 20px; @@ -1021,7 +1021,7 @@ ${({disabled:e})=>e&&Gu` color: ${N.green400}; font-size: 16px; } -`,V9=Y.div` +`,U9=Y.div` background: ${N.white}; border-radius: 8px; padding: 16px; @@ -1052,12 +1052,12 @@ ${({disabled:e})=>e&&Gu` color: ${N.blueTextAccent}; text-decoration: none; } -`,U9=Y.img` +`,W9=Y.img` width: 40px; height: 40px; border-radius: 50%; background: green; -`,W9=()=>{const e=_t(),t=(e==null?void 0:e.name)||(e==null?void 0:e.label);return u.jsxs(z,{direction:"row",px:24,py:16,children:[u.jsx(Gt,{"data-testid":"person-image",size:80,src:(e==null?void 0:e.image_url)||"person_placeholder_img.png",type:"person"}),u.jsx(z,{p:20,children:u.jsx(Fe,{color:"primaryText1",kind:"bigHeading",children:t})})]})},G9=e=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 16",fill:"none",children:u.jsx("g",{children:u.jsx("path",{d:"M3.54126 13.2369C3.36418 13.2369 3.21574 13.177 3.09595 13.0572C2.97616 12.9373 2.91626 12.7888 2.91626 12.6117C2.91626 12.4345 2.97616 12.2861 3.09595 12.1665C3.21574 12.0468 3.36418 11.987 3.54126 11.987H8.54926C8.72634 11.987 8.87478 12.0469 8.99457 12.1667C9.11436 12.2866 9.17426 12.4351 9.17426 12.6122C9.17426 12.7894 9.11436 12.9378 8.99457 13.0575C8.87478 13.1771 8.72634 13.2369 8.54926 13.2369H3.54126ZM3.54126 9.9036C3.36418 9.9036 3.21574 9.84369 3.09595 9.72385C2.97616 9.60401 2.91626 9.45551 2.91626 9.27835C2.91626 9.10119 2.97616 8.95278 3.09595 8.83312C3.21574 8.71347 3.36418 8.65365 3.54126 8.65365H11.8586C12.0356 8.65365 12.1841 8.71356 12.3039 8.8334C12.4237 8.95324 12.4836 9.10174 12.4836 9.2789C12.4836 9.45606 12.4237 9.60447 12.3039 9.72413C12.1841 9.84378 12.0356 9.9036 11.8586 9.9036H3.54126ZM3.54126 6.57027C3.36418 6.57027 3.21574 6.51035 3.09595 6.39052C2.97616 6.27067 2.91626 6.12217 2.91626 5.94502C2.91626 5.76785 2.97616 5.61944 3.09595 5.49979C3.21574 5.38014 3.36418 5.32031 3.54126 5.32031H11.8586C12.0356 5.32031 12.1841 5.38023 12.3039 5.50006C12.4237 5.61991 12.4836 5.76841 12.4836 5.94556C12.4836 6.12273 12.4237 6.27114 12.3039 6.39079C12.1841 6.51044 12.0356 6.57027 11.8586 6.57027H3.54126ZM14.0989 16.6936C14.0348 16.73 13.9721 16.7495 13.9106 16.7521C13.8492 16.7548 13.7864 16.7423 13.7223 16.7145C13.6582 16.6867 13.608 16.6456 13.5717 16.5911C13.5354 16.5366 13.5172 16.4704 13.5172 16.3924V11.9726C13.5172 11.8956 13.5354 11.8283 13.5717 11.7706C13.608 11.7129 13.6582 11.6702 13.7223 11.6424C13.7864 11.6147 13.8492 11.6021 13.9106 11.6048C13.9721 11.6074 14.0348 11.6269 14.0989 11.6633L17.4434 13.8604C17.507 13.8984 17.5514 13.9459 17.5768 14.0029C17.6022 14.06 17.6149 14.1202 17.6149 14.1836C17.6149 14.2469 17.6022 14.3069 17.5768 14.3634C17.5514 14.4198 17.507 14.4669 17.4434 14.5046L14.0989 16.6936Z",fill:"#909BAA"})})}),Z9=({node:e,onClick:t})=>{var i,o;const n=Kn(e.timestamp||""),r=Math.ceil(n/60);return u.jsx(q9,{onClick:t,p:20,children:u.jsxs("div",{children:[u.jsxs(z,{align:"flex-start",direction:"row",justify:"flex-start",children:[u.jsx(z,{align:"center",children:u.jsx(Gt,{size:64,src:(e==null?void 0:e.image_url)||"",type:(e==null?void 0:e.node_type)||"episode"})}),u.jsxs("div",{className:"content",children:[u.jsxs(z,{align:"center",direction:"row",children:[u.jsx(Mr,{type:"episode"}),r>0&&u.jsxs("div",{className:"subtitle",children:[r," ",r===1?"min":"mins"]})]}),u.jsx(Fe,{className:"title",color:"primaryText1",kind:"regular",children:e.episode_title})]})]}),u.jsxs(z,{align:"center",direction:"row",justify:"flex-end",children:[u.jsxs(Fe,{className:"clipText",color:"mainBottomIcons",kind:"regular",children:[((i=e==null?void 0:e.children)==null?void 0:i.length)||0," ",((o=e==null?void 0:e.children)==null?void 0:o.length)===1?"Clip":"Clips"]}),u.jsx(G9,{style:{color:N.white}})]})]})})},q9=Y(z).attrs({})` +`,G9=()=>{const e=_t(),t=(e==null?void 0:e.name)||(e==null?void 0:e.label);return u.jsxs(z,{direction:"row",px:24,py:16,children:[u.jsx(Gt,{"data-testid":"person-image",size:80,src:(e==null?void 0:e.image_url)||"person_placeholder_img.png",type:"person"}),u.jsx(z,{p:20,children:u.jsx(Fe,{color:"primaryText1",kind:"bigHeading",children:t})})]})},Z9=e=>u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 16",fill:"none",children:u.jsx("g",{children:u.jsx("path",{d:"M3.54126 13.2369C3.36418 13.2369 3.21574 13.177 3.09595 13.0572C2.97616 12.9373 2.91626 12.7888 2.91626 12.6117C2.91626 12.4345 2.97616 12.2861 3.09595 12.1665C3.21574 12.0468 3.36418 11.987 3.54126 11.987H8.54926C8.72634 11.987 8.87478 12.0469 8.99457 12.1667C9.11436 12.2866 9.17426 12.4351 9.17426 12.6122C9.17426 12.7894 9.11436 12.9378 8.99457 13.0575C8.87478 13.1771 8.72634 13.2369 8.54926 13.2369H3.54126ZM3.54126 9.9036C3.36418 9.9036 3.21574 9.84369 3.09595 9.72385C2.97616 9.60401 2.91626 9.45551 2.91626 9.27835C2.91626 9.10119 2.97616 8.95278 3.09595 8.83312C3.21574 8.71347 3.36418 8.65365 3.54126 8.65365H11.8586C12.0356 8.65365 12.1841 8.71356 12.3039 8.8334C12.4237 8.95324 12.4836 9.10174 12.4836 9.2789C12.4836 9.45606 12.4237 9.60447 12.3039 9.72413C12.1841 9.84378 12.0356 9.9036 11.8586 9.9036H3.54126ZM3.54126 6.57027C3.36418 6.57027 3.21574 6.51035 3.09595 6.39052C2.97616 6.27067 2.91626 6.12217 2.91626 5.94502C2.91626 5.76785 2.97616 5.61944 3.09595 5.49979C3.21574 5.38014 3.36418 5.32031 3.54126 5.32031H11.8586C12.0356 5.32031 12.1841 5.38023 12.3039 5.50006C12.4237 5.61991 12.4836 5.76841 12.4836 5.94556C12.4836 6.12273 12.4237 6.27114 12.3039 6.39079C12.1841 6.51044 12.0356 6.57027 11.8586 6.57027H3.54126ZM14.0989 16.6936C14.0348 16.73 13.9721 16.7495 13.9106 16.7521C13.8492 16.7548 13.7864 16.7423 13.7223 16.7145C13.6582 16.6867 13.608 16.6456 13.5717 16.5911C13.5354 16.5366 13.5172 16.4704 13.5172 16.3924V11.9726C13.5172 11.8956 13.5354 11.8283 13.5717 11.7706C13.608 11.7129 13.6582 11.6702 13.7223 11.6424C13.7864 11.6147 13.8492 11.6021 13.9106 11.6048C13.9721 11.6074 14.0348 11.6269 14.0989 11.6633L17.4434 13.8604C17.507 13.8984 17.5514 13.9459 17.5768 14.0029C17.6022 14.06 17.6149 14.1202 17.6149 14.1836C17.6149 14.2469 17.6022 14.3069 17.5768 14.3634C17.5514 14.4198 17.507 14.4669 17.4434 14.5046L14.0989 16.6936Z",fill:"#909BAA"})})}),q9=({node:e,onClick:t})=>{var i,o;const n=Kn(e.timestamp||""),r=Math.ceil(n/60);return u.jsx(X9,{onClick:t,p:20,children:u.jsxs("div",{children:[u.jsxs(z,{align:"flex-start",direction:"row",justify:"flex-start",children:[u.jsx(z,{align:"center",children:u.jsx(Gt,{size:64,src:(e==null?void 0:e.image_url)||"",type:(e==null?void 0:e.node_type)||"episode"})}),u.jsxs("div",{className:"content",children:[u.jsxs(z,{align:"center",direction:"row",children:[u.jsx(Mr,{type:"episode"}),r>0&&u.jsxs("div",{className:"subtitle",children:[r," ",r===1?"min":"mins"]})]}),u.jsx(Fe,{className:"title",color:"primaryText1",kind:"regular",children:e.episode_title})]})]}),u.jsxs(z,{align:"center",direction:"row",justify:"flex-end",children:[u.jsxs(Fe,{className:"clipText",color:"mainBottomIcons",kind:"regular",children:[((i=e==null?void 0:e.children)==null?void 0:i.length)||0," ",((o=e==null?void 0:e.children)==null?void 0:o.length)===1?"Clip":"Clips"]}),u.jsx(Z9,{style:{color:N.white}})]})]})})},X9=Y(z).attrs({})` direction: row; cursor: pointer; color: ${N.primaryText1}; @@ -1082,7 +1082,7 @@ ${({disabled:e})=>e&&Gu` font-size: 12px; margin-right: 6px; } -`,X9=Y(z)` +`,K9=Y(z)` flex: 1; min-height: 100%; flex-direction: column; @@ -1100,13 +1100,13 @@ ${({disabled:e})=>e&&Gu` text-overflow: ellipsis; white-space: nowrap; } -`,K9=Y(z)` +`,Q9=Y(z)` flex-direction: column; border-bottom: 1px solid #101317; z-index: 0; padding: 42px 20px; background-color: #1c1e26; -`,Q9=Y(Fe)` +`,J9=Y(Fe)` font-size: 20px; font-weight: 700; max-width: 250px; @@ -1118,10 +1118,10 @@ ${({disabled:e})=>e&&Gu` display: -webkit-box; -webkit-line-clamp: 2; margin-bottom: 26px; -`,J9=Y.div` +`,e8=Y.div` max-height: calc(100vh - 340px); overflow-y: auto; -`,e8=()=>{const e=_t(),t=pi(),n=ad(),[r,i]=j.useState([]),o=j.useMemo(()=>{var d;const a=new Set,l={};if((d=e==null?void 0:e.children)!=null&&d.length){e.children.forEach((h,p)=>{var w,_,S,k;const y=cd((n==null?void 0:n.nodes)||[],e)||[],g=n==null?void 0:n.nodes.find(C=>C.ref_id===h);if(g){g.timestamp=(w=y[0])==null?void 0:w.timestamp;const C=(k=(S=(_=y[p])==null?void 0:_.hosts)==null?void 0:S[0])==null?void 0:k.name;C&&a.add(C),l[h]=g,l[h]=g}});const f=Array.from(a);i(f)}return Object.values(l).filter(f=>f.node_type==="episode").sort((f,h)=>(h.weight||0)-(f.weight||0))},[n==null?void 0:n.nodes,e]);return u.jsxs(X9,{children:[u.jsx(K9,{children:u.jsxs(z,{direction:"row",children:[u.jsx(z,{pr:24,children:u.jsx(Gt,{size:80,src:(e==null?void 0:e.image_url)||"audio_default.svg",type:"show"})}),u.jsx(z,{direction:"column",children:u.jsxs(z,{direction:"column",grow:1,justify:"space-between",children:[u.jsxs(z,{align:"center",direction:"row",justify:"flex-start",children:[u.jsx(Mr,{type:"show"})," ",u.jsxs("div",{className:"subtitle",children:["by ",r.join(", ")||(e==null?void 0:e.show_title)]})]}),u.jsx(Q9,{kind:"bigHeading",children:(e==null?void 0:e.show_title)||"Unknown"})]})})]})}),u.jsxs(z,{direction:"column",children:[u.jsx(z,{p:24,children:u.jsx(Fe,{className:"relatedHeader",kind:"medium",children:"Related Episodes"})}),u.jsx(J9,{children:o.map(a=>u.jsx(Z9,{node:a,onClick:()=>t(a)},a.ref_id))})]})]})},t8=()=>{const e=_t();return u.jsx(z,{align:"center",justify:"center",children:u.jsx(Fe,{color:"primaryText1",kind:"hugeHeading",children:e==null?void 0:e.label})})},n8=()=>{const e=_t(),t=e?Ca(e):null,{date:n,boost:r,text:i,name:o,verified:a,image_url:l,twitter_handle:d,ref_id:f}=t||{},h=(t==null?void 0:t.tweet_id)||"",[p,y]=j.useState(r||0),g=vt(w=>w.currentSearch);return t&&u.jsxs(u.Fragment,{children:[u.jsxs(z,{direction:"column",p:24,children:[u.jsxs(z,{align:"center",direction:"row",pr:16,children:[u.jsx(r8,{children:u.jsx(Gt,{rounded:!0,size:58,src:l||"",type:"person"})}),u.jsxs(z,{children:[u.jsxs(i8,{align:"center",direction:"row",children:[o,a&&u.jsx("div",{className:"verification",children:u.jsx("img",{alt:"verified",src:"verified_twitter.svg"})})]}),d&&u.jsxs(o8,{children:["@",d]})]})]}),u.jsxs(z,{grow:1,shrink:1,children:[u.jsx(s8,{"data-testid":"episode-description",children:gn(i||"",g)}),u.jsx(z,{direction:"row",justify:"flex-start",children:!!n&&u.jsx($n,{children:si.unix(n).format("ll")})})]}),u.jsx(z,{align:"stretch",mt:22,children:u.jsx("a",{href:`https://twitter.com/${d}/status/${h}?open=system`,rel:"noopener noreferrer",target:"_blank",children:u.jsx(l8,{endIcon:u.jsx(Rn,{}),children:"View Tweet"})})})]}),u.jsx(a8,{}),u.jsxs(z,{direction:"row",justify:"space-between",pt:14,px:24,children:[u.jsx(Sa,{amt:p}),u.jsx(Nf,{content:t,count:p,refId:f,updateCount:y})]})]})},r8=Y(z)` +`,t8=()=>{const e=_t(),t=pi(),n=ad(),[r,i]=j.useState([]),o=j.useMemo(()=>{var d;const a=new Set,l={};if((d=e==null?void 0:e.children)!=null&&d.length){e.children.forEach((h,p)=>{var w,_,S,k;const y=cd((n==null?void 0:n.nodes)||[],e)||[],g=n==null?void 0:n.nodes.find(C=>C.ref_id===h);if(g){g.timestamp=(w=y[0])==null?void 0:w.timestamp;const C=(k=(S=(_=y[p])==null?void 0:_.hosts)==null?void 0:S[0])==null?void 0:k.name;C&&a.add(C),l[h]=g,l[h]=g}});const f=Array.from(a);i(f)}return Object.values(l).filter(f=>f.node_type==="episode").sort((f,h)=>(h.weight||0)-(f.weight||0))},[n==null?void 0:n.nodes,e]);return u.jsxs(K9,{children:[u.jsx(Q9,{children:u.jsxs(z,{direction:"row",children:[u.jsx(z,{pr:24,children:u.jsx(Gt,{size:80,src:(e==null?void 0:e.image_url)||"audio_default.svg",type:"show"})}),u.jsx(z,{direction:"column",children:u.jsxs(z,{direction:"column",grow:1,justify:"space-between",children:[u.jsxs(z,{align:"center",direction:"row",justify:"flex-start",children:[u.jsx(Mr,{type:"show"})," ",u.jsxs("div",{className:"subtitle",children:["by ",r.join(", ")||(e==null?void 0:e.show_title)]})]}),u.jsx(J9,{kind:"bigHeading",children:(e==null?void 0:e.show_title)||"Unknown"})]})})]})}),u.jsxs(z,{direction:"column",children:[u.jsx(z,{p:24,children:u.jsx(Fe,{className:"relatedHeader",kind:"medium",children:"Related Episodes"})}),u.jsx(e8,{children:o.map(a=>u.jsx(q9,{node:a,onClick:()=>t(a)},a.ref_id))})]})]})},n8=()=>{const e=_t();return u.jsx(z,{align:"center",justify:"center",children:u.jsx(Fe,{color:"primaryText1",kind:"hugeHeading",children:e==null?void 0:e.label})})},r8=()=>{const e=_t(),t=e?Ca(e):null,{date:n,boost:r,text:i,name:o,verified:a,image_url:l,twitter_handle:d,ref_id:f}=t||{},h=(t==null?void 0:t.tweet_id)||"",[p,y]=j.useState(r||0),g=vt(w=>w.currentSearch);return t&&u.jsxs(u.Fragment,{children:[u.jsxs(z,{direction:"column",p:24,children:[u.jsxs(z,{align:"center",direction:"row",pr:16,children:[u.jsx(i8,{children:u.jsx(Gt,{rounded:!0,size:58,src:l||"",type:"person"})}),u.jsxs(z,{children:[u.jsxs(o8,{align:"center",direction:"row",children:[o,a&&u.jsx("div",{className:"verification",children:u.jsx("img",{alt:"verified",src:"verified_twitter.svg"})})]}),d&&u.jsxs(s8,{children:["@",d]})]})]}),u.jsxs(z,{grow:1,shrink:1,children:[u.jsx(a8,{"data-testid":"episode-description",children:gn(i||"",g)}),u.jsx(z,{direction:"row",justify:"flex-start",children:!!n&&u.jsx($n,{children:si.unix(n).format("ll")})})]}),u.jsx(z,{align:"stretch",mt:22,children:u.jsx("a",{href:`https://twitter.com/${d}/status/${h}?open=system`,rel:"noopener noreferrer",target:"_blank",children:u.jsx(c8,{endIcon:u.jsx(Rn,{}),children:"View Tweet"})})})]}),u.jsx(l8,{}),u.jsxs(z,{direction:"row",justify:"space-between",pt:14,px:24,children:[u.jsx(Sa,{amt:p}),u.jsx(Nf,{content:t,count:p,refId:f,updateCount:y})]})]})},i8=Y(z)` img { width: 64px; height: 64px; @@ -1129,7 +1129,7 @@ ${({disabled:e})=>e&&Gu` object-fit: cover; } margin-right: 16px; -`,i8=Y(z)` +`,o8=Y(z)` color: ${N.white}; font-family: Barlow; font-size: 14px; @@ -1140,14 +1140,14 @@ ${({disabled:e})=>e&&Gu` .verification { margin-left: 4px; } -`,o8=Y(z)` +`,s8=Y(z)` color: ${N.GRAY7}; font-family: Barlow; font-size: 14px; font-style: normal; font-weight: 400; line-height: normal; -`,s8=Y(z)` +`,a8=Y(z)` color: ${N.white}; font-family: Barlow; font-size: 17px; @@ -1161,19 +1161,19 @@ ${({disabled:e})=>e&&Gu` -webkit-box-orient: vertical; overflow: hidden; white-space: normal; -`,a8=Y(Fa)` +`,l8=Y(Fa)` margin: 0 0 6px 0; opacity: 75%; -`,l8=Y(Pt)` +`,c8=Y(Pt)` width: 100%; -`,c8=()=>{var r;const e=_t();if(!e)return null;const t=!!e.image_url,n=e.properties||{};return u.jsxs(g8,{children:[t?u.jsx(h8,{children:u.jsx("img",{alt:"img_a11y",onError:i=>{i.currentTarget.src="generic_placeholder_img.png",i.currentTarget.className="default-img"},src:(r=e.properties)==null?void 0:r.image_url})}):null,u.jsxs(d8,{grow:1,justify:"flex-start",pt:t?0:8,shrink:1,children:[u.jsx(z,{ml:24,mt:20,style:{width:"fit-content"},children:u.jsx(Mr,{type:e.node_type||""})}),u.jsx(f8,{children:Object.entries(n).filter(([i])=>i!=="media_url"&&i!=="link").map(([i,o])=>u.jsx(u8,{label:i,value:o},i))})]})]})},u8=({label:e,value:t})=>{const n=t.length>140,r=vt(i=>i.currentSearch);return u.jsxs(u.Fragment,{children:[u.jsxs(p8,{className:In("node-detail",{"node-detail__long":n}),children:[u.jsx(Fe,{className:"node-detail__label",children:e}),u.jsx(Fe,{className:"node-detail__value",children:gn(String(t),r)})]}),u.jsx(m8,{})]})},d8=Y(z)` +`,u8=()=>{var r;const e=_t();if(!e)return null;const t=!!e.image_url,n=e.properties||{};return u.jsxs(y8,{children:[t?u.jsx(p8,{children:u.jsx("img",{alt:"img_a11y",onError:i=>{i.currentTarget.src="generic_placeholder_img.png",i.currentTarget.className="default-img"},src:(r=e.properties)==null?void 0:r.image_url})}):null,u.jsxs(f8,{grow:1,justify:"flex-start",pt:t?0:8,shrink:1,children:[u.jsx(z,{ml:24,mt:20,style:{width:"fit-content"},children:u.jsx(Mr,{type:e.node_type||""})}),u.jsx(h8,{children:Object.entries(n).filter(([i])=>i!=="media_url"&&i!=="link").map(([i,o])=>u.jsx(d8,{label:i,value:o},i))})]})]})},d8=({label:e,value:t})=>{const n=t.length>140,r=vt(i=>i.currentSearch);return u.jsxs(u.Fragment,{children:[u.jsxs(m8,{className:In("node-detail",{"node-detail__long":n}),children:[u.jsx(Fe,{className:"node-detail__label",children:e}),u.jsx(Fe,{className:"node-detail__value",children:gn(String(t),r)})]}),u.jsx(g8,{})]})},f8=Y(z)` overflow: auto; width: 100%; flex-grow: 1; padding-top: 16px; -`,f8=Y(z)` - padding: 4px 24px; `,h8=Y(z)` + padding: 4px 24px; +`,p8=Y(z)` width: 100%; height: 240px; padding-top: 20px; @@ -1194,7 +1194,7 @@ ${({disabled:e})=>e&&Gu` height: 100px; border-radius: 2px; } -`,p8=Y(z)` +`,m8=Y(z)` width: 100%; display: flex; flex-direction: row; @@ -1220,13 +1220,13 @@ ${({disabled:e})=>e&&Gu` flex-direction: column; } } -`,m8=Y(Fa)` +`,g8=Y(Fa)` margin: auto 0px 2px 0px; opacity: 0.75; -`,g8=Y(z)` +`,y8=Y(z)` flex-direction: column; height: 100%; -`,y8=()=>{var l,d;const[e,t]=j.useState(!1),n=_t(),r=!!(n!=null&&n.source_link),i=j.useRef(null),o=vt(f=>f.currentSearch),a=f=>{f.stopPropagation(),f.currentTarget.blur(),t(!e)};return j.useEffect(()=>{var f,h;e?(f=i.current)==null||f.play():(h=i.current)==null||h.pause()},[e]),u.jsxs(z,{align:"flex-start",basis:"100%",direction:"column",grow:1,justify:"center",pt:r?62:0,shrink:1,children:[r&&u.jsxs(x8,{children:[u.jsx(wd,{color:N.GRAY6}),u.jsx(v8,{children:n==null?void 0:n.source_link}),u.jsx(w8,{href:`${n==null?void 0:n.source_link}?open=system`,onClick:f=>f.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),(l=n==null?void 0:n.audio)!=null&&l.length?u.jsxs(z,{justify:"flex-start",p:12,children:[u.jsx(Pt,{onClick:f=>a(f),startIcon:e?u.jsx(Co,{}):u.jsx(ba,{}),children:e?"Pause":"Play"}),u.jsx(_8,{ref:i,src:((d=n.audio[0])==null?void 0:d.link)||"",children:u.jsx("track",{kind:"captions"})})]}):null,u.jsx(b8,{grow:1,justify:"flex-start",p:12,shrink:1,children:u.jsx(Fe,{color:"primaryText1",kind:"regular",children:gn((n==null?void 0:n.text)||"",o)})})]})},x8=Y(z)` +`,x8=()=>{var l,d;const[e,t]=j.useState(!1),n=_t(),r=!!(n!=null&&n.source_link),i=j.useRef(null),o=vt(f=>f.currentSearch),a=f=>{f.stopPropagation(),f.currentTarget.blur(),t(!e)};return j.useEffect(()=>{var f,h;e?(f=i.current)==null||f.play():(h=i.current)==null||h.pause()},[e]),u.jsxs(z,{align:"flex-start",basis:"100%",direction:"column",grow:1,justify:"center",pt:r?62:0,shrink:1,children:[r&&u.jsxs(w8,{children:[u.jsx(wd,{color:N.GRAY6}),u.jsx(_8,{children:n==null?void 0:n.source_link}),u.jsx(b8,{href:`${n==null?void 0:n.source_link}?open=system`,onClick:f=>f.stopPropagation(),target:"_blank",children:u.jsx(Rn,{})})]}),(l=n==null?void 0:n.audio)!=null&&l.length?u.jsxs(z,{justify:"flex-start",p:12,children:[u.jsx(Pt,{onClick:f=>a(f),startIcon:e?u.jsx(Co,{}):u.jsx(ba,{}),children:e?"Pause":"Play"}),u.jsx(S8,{ref:i,src:((d=n.audio[0])==null?void 0:d.link)||"",children:u.jsx("track",{kind:"captions"})})]}):null,u.jsx(v8,{grow:1,justify:"flex-start",p:12,shrink:1,children:u.jsx(Fe,{color:"primaryText1",kind:"regular",children:gn((n==null?void 0:n.text)||"",o)})})]})},w8=Y(z)` top: 0px; position: absolute; border-radius: 16px 16px 0px 0px; @@ -1247,24 +1247,24 @@ ${({disabled:e})=>e&&Gu` line-height: 19px; color: ${N.GRAY6}; } -`,w8=Y.a` +`,b8=Y.a` color: ${N.GRAY6}; font-size: 16px; height: 16px; display: flex; gap: 5px; align-items: center; -`,b8=Y(z)` +`,v8=Y(z)` overflow: auto; -`,v8=Y(Fe)` +`,_8=Y(Fe)` max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; -`,_8=Y.audio` +`,S8=Y.audio` height: 0; width: 0; -`,S8=()=>{const e=_t(),{showTeachMe:t}=zt(r=>r),{setPlayingNode:n}=ko(r=>r);if(j.useEffect(()=>{var i,o;if(!e)return;(e.media_url||e.link||((i=e.properties)==null?void 0:i.link)||((o=e.properties)==null?void 0:o.media_url))&&n(e)},[n,e]),t)return u.jsx(B4,{});switch(e==null?void 0:e.node_type){case"guest":case"person":return u.jsx(W9,{});case"data_series":return u.jsx(Y4,{});case"tribe_message":return u.jsx(H9,{});case"Tweet":return u.jsx(n8,{});case"topic":return u.jsx(t8,{});case"show":return u.jsx(e8,{});case"video":case"podcast":case"clip":case"twitter_space":return u.jsx(Rf,{});case"document":return u.jsx(y8,{});case"episode":return u.jsx(R9,{},e.ref_id);case"image":return u.jsx(F9,{});default:return u.jsx(c8,{})}},k8=j.memo(S8);var C8=function(t,n,r){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},o.type=n.type||"text/javascript",o.charset=n.charset||"utf8",o.async="async"in n?!!n.async:!0,o.src=t,n.attrs&&E8(o,n.attrs),n.text&&(o.text=""+n.text);var a="onload"in o?Hc:P8;a(o,r),o.onload||Hc(o,r),i.appendChild(o)};function E8(e,t){for(var n in t)e.setAttribute(n,t[n])}function Hc(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function P8(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var M8=function(t){return j8(t)&&!T8(t)};function j8(e){return!!e&&typeof e=="object"}function T8(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||D8(e)}var O8=typeof Symbol=="function"&&Symbol.for,A8=O8?Symbol.for("react.element"):60103;function D8(e){return e.$$typeof===A8}function I8(e){return Array.isArray(e)?[]:{}}function di(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Pr(I8(e),e,t):e}function N8(e,t,n){return e.concat(t).map(function(r){return di(r,n)})}function L8(e,t){if(!t.customMerge)return Pr;var n=t.customMerge(e);return typeof n=="function"?n:Pr}function R8(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Yc(e){return Object.keys(e).concat(R8(e))}function $f(e,t){try{return t in e}catch{return!1}}function $8(e,t){return $f(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function z8(e,t,n){var r={};return n.isMergeableObject(e)&&Yc(e).forEach(function(i){r[i]=di(e[i],n)}),Yc(t).forEach(function(i){$8(e,i)||($f(e,i)&&n.isMergeableObject(t[i])?r[i]=L8(i,n)(e[i],t[i],n):r[i]=di(t[i],n))}),r}function Pr(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||N8,n.isMergeableObject=n.isMergeableObject||M8,n.cloneUnlessOtherwiseSpecified=di;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):z8(e,t,n):di(t,n)}Pr.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Pr(r,i,n)},{})};var B8=Pr,zf=B8,F8=Object.create,Ao=Object.defineProperty,H8=Object.getOwnPropertyDescriptor,Y8=Object.getOwnPropertyNames,V8=Object.getPrototypeOf,U8=Object.prototype.hasOwnProperty,W8=(e,t)=>{for(var n in t)Ao(e,n,{get:t[n],enumerable:!0})},Bf=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Y8(t))!U8.call(e,i)&&i!==n&&Ao(e,i,{get:()=>t[i],enumerable:!(r=H8(t,i))||r.enumerable});return e},Ha=(e,t,n)=>(n=e!=null?F8(V8(e)):{},Bf(t||!e||!e.__esModule?Ao(n,"default",{value:e,enumerable:!0}):n,e)),G8=e=>Bf(Ao({},"__esModule",{value:!0}),e),Ff={};W8(Ff,{callPlayer:()=>cb,getConfig:()=>ab,getSDK:()=>sb,isBlobUrl:()=>db,isMediaStream:()=>ub,lazy:()=>K8,omit:()=>lb,parseEndTime:()=>rb,parseStartTime:()=>nb,queryString:()=>ob,randomString:()=>ib,supportsWebKitPresentationMode:()=>fb});var Do=G8(Ff),Z8=Ha(j),q8=Ha(C8),X8=Ha(zf);const K8=e=>Z8.default.lazy(async()=>{const t=await e();return typeof t.default=="function"?t:t.default}),Q8=/[?&#](?:start|t)=([0-9hms]+)/,J8=/[?&#]end=([0-9hms]+)/,ta=/(\d+)(h|m|s)/g,eb=/^\d+$/;function Hf(e,t){if(e instanceof Array)return;const n=e.match(t);if(n){const r=n[1];if(r.match(ta))return tb(r);if(eb.test(r))return parseInt(r)}}function tb(e){let t=0,n=ta.exec(e);for(;n!==null;){const[,r,i]=n;i==="h"&&(t+=parseInt(r,10)*60*60),i==="m"&&(t+=parseInt(r,10)*60),i==="s"&&(t+=parseInt(r,10)),n=ta.exec(e)}return t}function nb(e){return Hf(e,Q8)}function rb(e){return Hf(e,J8)}function ib(){return Math.random().toString(36).substr(2,5)}function ob(e){return Object.keys(e).map(t=>`${t}=${e[t]}`).join("&")}function _s(e){return window[e]?window[e]:window.exports&&window.exports[e]?window.exports[e]:window.module&&window.module.exports&&window.module.exports[e]?window.module.exports[e]:null}const ur={},sb=function(t,n,r=null,i=()=>!0,o=q8.default){const a=_s(n);return a&&i(a)?Promise.resolve(a):new Promise((l,d)=>{if(ur[t]){ur[t].push({resolve:l,reject:d});return}ur[t]=[{resolve:l,reject:d}];const f=h=>{ur[t].forEach(p=>p.resolve(h))};if(r){const h=window[r];window[r]=function(){h&&h(),f(_s(n))}}o(t,h=>{h?(ur[t].forEach(p=>p.reject(h)),ur[t]=null):r||f(_s(n))})})};function ab(e,t){return(0,X8.default)(t.config,e.config)}function lb(e,...t){const n=[].concat(...t),r={},i=Object.keys(e);for(const o of i)n.indexOf(o)===-1&&(r[o]=e[o]);return r}function cb(e,...t){if(!this.player||!this.player[e]){let n=`ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `;return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}return this.player[e](...t)}function ub(e){return typeof window<"u"&&typeof window.MediaStream<"u"&&e instanceof window.MediaStream}function db(e){return/^blob:/.test(e)}function fb(e=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var Ya=Object.defineProperty,hb=Object.getOwnPropertyDescriptor,pb=Object.getOwnPropertyNames,mb=Object.prototype.hasOwnProperty,gb=(e,t)=>{for(var n in t)Ya(e,n,{get:t[n],enumerable:!0})},yb=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of pb(t))!mb.call(e,i)&&i!==n&&Ya(e,i,{get:()=>t[i],enumerable:!(r=hb(t,i))||r.enumerable});return e},xb=e=>yb(Ya({},"__esModule",{value:!0}),e),Yf={};gb(Yf,{AUDIO_EXTENSIONS:()=>Va,DASH_EXTENSIONS:()=>nh,FLV_EXTENSIONS:()=>rh,HLS_EXTENSIONS:()=>Wa,MATCH_URL_DAILYMOTION:()=>Qf,MATCH_URL_FACEBOOK:()=>Wf,MATCH_URL_FACEBOOK_WATCH:()=>Gf,MATCH_URL_KALTURA:()=>th,MATCH_URL_MIXCLOUD:()=>Jf,MATCH_URL_SOUNDCLOUD:()=>Vf,MATCH_URL_STREAMABLE:()=>Zf,MATCH_URL_TWITCH_CHANNEL:()=>Kf,MATCH_URL_TWITCH_VIDEO:()=>Xf,MATCH_URL_VIDYARD:()=>eh,MATCH_URL_VIMEO:()=>Uf,MATCH_URL_WISTIA:()=>qf,MATCH_URL_YOUTUBE:()=>na,VIDEO_EXTENSIONS:()=>Ua,canPlay:()=>bb});var wb=xb(Yf),Vc=Do;const na=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,Vf=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,Uf=/vimeo\.com\/(?!progressive_redirect).+/,Wf=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,Gf=/^https?:\/\/fb\.watch\/.+$/,Zf=/streamable\.com\/([a-z0-9]+)$/,qf=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,Xf=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,Kf=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,Qf=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,Jf=/mixcloud\.com\/([^/]+\/[^/]+)/,eh=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,th=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,Va=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,Ua=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,Wa=/\.(m3u8)($|\?)/i,nh=/\.(mpd)($|\?)/i,rh=/\.(flv)($|\?)/i,ra=e=>{if(e instanceof Array){for(const t of e)if(typeof t=="string"&&ra(t)||ra(t.src))return!0;return!1}return(0,Vc.isMediaStream)(e)||(0,Vc.isBlobUrl)(e)?!0:Va.test(e)||Ua.test(e)||Wa.test(e)||nh.test(e)||rh.test(e)},bb={youtube:e=>e instanceof Array?e.every(t=>na.test(t)):na.test(e),soundcloud:e=>Vf.test(e)&&!Va.test(e),vimeo:e=>Uf.test(e)&&!Ua.test(e)&&!Wa.test(e),facebook:e=>Wf.test(e)||Gf.test(e),streamable:e=>Zf.test(e),wistia:e=>qf.test(e),twitch:e=>Xf.test(e)||Kf.test(e),dailymotion:e=>Qf.test(e),mixcloud:e=>Jf.test(e),vidyard:e=>eh.test(e),kaltura:e=>th.test(e),file:ra};var Ga=Object.defineProperty,vb=Object.getOwnPropertyDescriptor,_b=Object.getOwnPropertyNames,Sb=Object.prototype.hasOwnProperty,kb=(e,t)=>{for(var n in t)Ga(e,n,{get:t[n],enumerable:!0})},Cb=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of _b(t))!Sb.call(e,i)&&i!==n&&Ga(e,i,{get:()=>t[i],enumerable:!(r=vb(t,i))||r.enumerable});return e},Eb=e=>Cb(Ga({},"__esModule",{value:!0}),e),ih={};kb(ih,{default:()=>Mb});var Pb=Eb(ih),Tt=Do,kt=wb,Mb=[{key:"youtube",name:"YouTube",canPlay:kt.canPlay.youtube,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./YouTube-78286ba8.js").then(e=>e.Y),["assets/YouTube-78286ba8.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"soundcloud",name:"SoundCloud",canPlay:kt.canPlay.soundcloud,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./SoundCloud-3bf40c11.js").then(e=>e.S),["assets/SoundCloud-3bf40c11.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"vimeo",name:"Vimeo",canPlay:kt.canPlay.vimeo,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Vimeo-2cd6f914.js").then(e=>e.V),["assets/Vimeo-2cd6f914.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"facebook",name:"Facebook",canPlay:kt.canPlay.facebook,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Facebook-dc95d236.js").then(e=>e.F),["assets/Facebook-dc95d236.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"streamable",name:"Streamable",canPlay:kt.canPlay.streamable,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Streamable-6e26f005.js").then(e=>e.S),["assets/Streamable-6e26f005.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"wistia",name:"Wistia",canPlay:kt.canPlay.wistia,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Wistia-3c8f1ab9.js").then(e=>e.W),["assets/Wistia-3c8f1ab9.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"twitch",name:"Twitch",canPlay:kt.canPlay.twitch,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Twitch-70bf2796.js").then(e=>e.T),["assets/Twitch-70bf2796.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"dailymotion",name:"DailyMotion",canPlay:kt.canPlay.dailymotion,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./DailyMotion-5a12792b.js").then(e=>e.D),["assets/DailyMotion-5a12792b.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"mixcloud",name:"Mixcloud",canPlay:kt.canPlay.mixcloud,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Mixcloud-c4cbc003.js").then(e=>e.M),["assets/Mixcloud-c4cbc003.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"vidyard",name:"Vidyard",canPlay:kt.canPlay.vidyard,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Vidyard-f0355643.js").then(e=>e.V),["assets/Vidyard-f0355643.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"kaltura",name:"Kaltura",canPlay:kt.canPlay.kaltura,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Kaltura-fe5cbead.js").then(e=>e.K),["assets/Kaltura-fe5cbead.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))},{key:"file",name:"FilePlayer",canPlay:kt.canPlay.file,canEnablePIP:e=>kt.canPlay.file(e)&&(document.pictureInPictureEnabled||(0,Tt.supportsWebKitPresentationMode)())&&!kt.AUDIO_EXTENSIONS.test(e),lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./FilePlayer-ec53d639.js").then(e=>e.F),["assets/FilePlayer-ec53d639.js","assets/index-0cb90706.js","assets/index-a2878e02.css"]))}],Uc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function jb(e,t){return!!(e===t||Uc(e)&&Uc(t))}function Tb(e,t){if(e.length!==t.length)return!1;for(var n=0;n{for(var n in t)Io(e,n,{get:t[n],enumerable:!0})},sh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Bb(t))!Hb.call(e,i)&&i!==n&&Io(e,i,{get:()=>t[i],enumerable:!(r=zb(t,i))||r.enumerable});return e},Vb=(e,t,n)=>(n=e!=null?$b(Fb(e)):{},sh(t||!e||!e.__esModule?Io(n,"default",{value:e,enumerable:!0}):n,e)),Ub=e=>sh(Io({},"__esModule",{value:!0}),e),ah={};Yb(ah,{defaultProps:()=>Zb,propTypes:()=>Gb});var lh=Ub(ah),Wb=Vb(Wm);const{string:xt,bool:wt,number:dr,array:Ss,oneOfType:Kr,shape:Nt,object:bt,func:at,node:Wc}=Wb.default,Gb={url:Kr([xt,Ss,bt]),playing:wt,loop:wt,controls:wt,volume:dr,muted:wt,playbackRate:dr,width:Kr([xt,dr]),height:Kr([xt,dr]),style:bt,progressInterval:dr,playsinline:wt,pip:wt,stopOnUnmount:wt,light:Kr([wt,xt,bt]),playIcon:Wc,previewTabIndex:dr,fallback:Wc,oEmbedUrl:xt,wrapper:Kr([xt,at,Nt({render:at.isRequired})]),config:Nt({soundcloud:Nt({options:bt}),youtube:Nt({playerVars:bt,embedOptions:bt,onUnstarted:at}),facebook:Nt({appId:xt,version:xt,playerId:xt,attributes:bt}),dailymotion:Nt({params:bt}),vimeo:Nt({playerOptions:bt,title:xt}),file:Nt({attributes:bt,tracks:Ss,forceVideo:wt,forceAudio:wt,forceHLS:wt,forceSafariHLS:wt,forceDisableHls:wt,forceDASH:wt,forceFLV:wt,hlsOptions:bt,hlsVersion:xt,dashVersion:xt,flvVersion:xt}),wistia:Nt({options:bt,playerId:xt,customControls:Ss}),mixcloud:Nt({options:bt}),twitch:Nt({options:bt,playerId:xt}),vidyard:Nt({options:bt})}),onReady:at,onStart:at,onPlay:at,onPause:at,onBuffer:at,onBufferEnd:at,onEnded:at,onError:at,onDuration:at,onSeek:at,onPlaybackRateChange:at,onPlaybackQualityChange:at,onProgress:at,onClickPreview:at,onEnablePIP:at,onDisablePIP:at},ct=()=>{},Zb={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:ct},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:ct,onStart:ct,onPlay:ct,onPause:ct,onBuffer:ct,onBufferEnd:ct,onEnded:ct,onError:ct,onDuration:ct,onSeek:ct,onPlaybackRateChange:ct,onPlaybackQualityChange:ct,onProgress:ct,onClickPreview:ct,onEnablePIP:ct,onDisablePIP:ct};var qb=Object.create,xi=Object.defineProperty,Xb=Object.getOwnPropertyDescriptor,Kb=Object.getOwnPropertyNames,Qb=Object.getPrototypeOf,Jb=Object.prototype.hasOwnProperty,e7=(e,t,n)=>t in e?xi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,t7=(e,t)=>{for(var n in t)xi(e,n,{get:t[n],enumerable:!0})},ch=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Kb(t))!Jb.call(e,i)&&i!==n&&xi(e,i,{get:()=>t[i],enumerable:!(r=Xb(t,i))||r.enumerable});return e},uh=(e,t,n)=>(n=e!=null?qb(Qb(e)):{},ch(t||!e||!e.__esModule?xi(n,"default",{value:e,enumerable:!0}):n,e)),n7=e=>ch(xi({},"__esModule",{value:!0}),e),rt=(e,t,n)=>(e7(e,typeof t!="symbol"?t+"":t,n),n),dh={};t7(dh,{default:()=>No});var r7=n7(dh),Gc=uh(j),i7=uh(oh),fh=lh,o7=Do;const s7=5e3;class No extends Gc.Component{constructor(){super(...arguments),rt(this,"mounted",!1),rt(this,"isReady",!1),rt(this,"isPlaying",!1),rt(this,"isLoading",!0),rt(this,"loadOnReady",null),rt(this,"startOnPlay",!0),rt(this,"seekOnPlay",null),rt(this,"onDurationCalled",!1),rt(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),rt(this,"getInternalPlayer",t=>this.player?this.player[t]:null),rt(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,n=this.getSecondsLoaded(),r=this.getDuration();if(r){const i={playedSeconds:t,played:t/r};n!==null&&(i.loadedSeconds=n,i.loaded=n/r),(i.playedSeconds!==this.prevPlayed||i.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(i),this.prevPlayed=i.playedSeconds,this.prevLoaded=i.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),rt(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:n,volume:r,muted:i}=this.props;t(),!i&&r!==null&&this.player.setVolume(r),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):n&&this.player.play(),this.handleDurationCheck()}),rt(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:n,playbackRate:r}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&r!==1&&this.player.setPlaybackRate(r),t(),this.startOnPlay=!1),n(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),rt(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),rt(this,"handleEnded",()=>{const{activePlayer:t,loop:n,onEnded:r}=this.props;t.loopOnEnded&&n&&this.seekTo(0),n||(this.isPlaying=!1,r())}),rt(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),rt(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const t=this.getDuration();t?this.onDurationCalled||(this.props.onDuration(t),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),rt(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(t){if(!this.player)return;const{url:n,playing:r,volume:i,muted:o,playbackRate:a,pip:l,loop:d,activePlayer:f,disableDeferredLoading:h}=this.props;if(!(0,i7.default)(t.url,n)){if(this.isLoading&&!f.forceLoad&&!h&&!(0,o7.isMediaStream)(n)){console.warn(`ReactPlayer: the attempt to load ${n} is being deferred until the player has loaded`),this.loadOnReady=n;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(n,this.isReady)}!t.playing&&r&&!this.isPlaying&&this.player.play(),t.playing&&!r&&this.isPlaying&&this.player.pause(),!t.pip&&l&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!l&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==i&&i!==null&&this.player.setVolume(i),t.muted!==o&&(o?this.player.mute():(this.player.unmute(),i!==null&&setTimeout(()=>this.player.setVolume(i)))),t.playbackRate!==a&&this.player.setPlaybackRate&&this.player.setPlaybackRate(a),t.loop!==d&&this.player.setLoop&&this.player.setLoop(d)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(t,n,r){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},s7));return}if(n?n==="fraction":t>0&&t<1){const o=this.player.getDuration();if(!o){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(o*t,r);return}this.player.seekTo(t,r)}render(){const t=this.props.activePlayer;return t?Gc.default.createElement(t,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}rt(No,"displayName","Player");rt(No,"propTypes",fh.propTypes);rt(No,"defaultProps",fh.defaultProps);var a7=Object.create,wi=Object.defineProperty,l7=Object.getOwnPropertyDescriptor,c7=Object.getOwnPropertyNames,u7=Object.getPrototypeOf,d7=Object.prototype.hasOwnProperty,f7=(e,t,n)=>t in e?wi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,h7=(e,t)=>{for(var n in t)wi(e,n,{get:t[n],enumerable:!0})},hh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of c7(t))!d7.call(e,i)&&i!==n&&wi(e,i,{get:()=>t[i],enumerable:!(r=l7(t,i))||r.enumerable});return e},bi=(e,t,n)=>(n=e!=null?a7(u7(e)):{},hh(t||!e||!e.__esModule?wi(n,"default",{value:e,enumerable:!0}):n,e)),p7=e=>hh(wi({},"__esModule",{value:!0}),e),nt=(e,t,n)=>(f7(e,typeof t!="symbol"?t+"":t,n),n),ph={};h7(ph,{createReactPlayer:()=>S7});var m7=p7(ph),pr=bi(j),g7=bi(zf),ks=bi(Db),Zc=bi(oh),ti=lh,mh=Do,y7=bi(r7);const x7=(0,mh.lazy)(()=>Ot(()=>import("./Preview-ba421c6e.js").then(e=>e.P),["assets/Preview-ba421c6e.js","assets/index-0cb90706.js","assets/index-a2878e02.css"])),w7=typeof window<"u"&&window.document,b7=typeof mt<"u"&&mt.window&&mt.window.document,v7=Object.keys(ti.propTypes),_7=w7||b7?pr.Suspense:()=>null,Qr=[],S7=(e,t)=>{var n;return n=class extends pr.Component{constructor(){super(...arguments),nt(this,"state",{showPreview:!!this.props.light}),nt(this,"references",{wrapper:r=>{this.wrapper=r},player:r=>{this.player=r}}),nt(this,"handleClickPreview",r=>{this.setState({showPreview:!1}),this.props.onClickPreview(r)}),nt(this,"showPreview",()=>{this.setState({showPreview:!0})}),nt(this,"getDuration",()=>this.player?this.player.getDuration():null),nt(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),nt(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),nt(this,"getInternalPlayer",(r="player")=>this.player?this.player.getInternalPlayer(r):null),nt(this,"seekTo",(r,i,o)=>{if(!this.player)return null;this.player.seekTo(r,i,o)}),nt(this,"handleReady",()=>{this.props.onReady(this)}),nt(this,"getActivePlayer",(0,ks.default)(r=>{for(const i of[...Qr,...e])if(i.canPlay(r))return i;return t||null})),nt(this,"getConfig",(0,ks.default)((r,i)=>{const{config:o}=this.props;return g7.default.all([ti.defaultProps.config,ti.defaultProps.config[i]||{},o,o[i]||{}])})),nt(this,"getAttributes",(0,ks.default)(r=>(0,mh.omit)(this.props,v7))),nt(this,"renderActivePlayer",r=>{if(!r)return null;const i=this.getActivePlayer(r);if(!i)return null;const o=this.getConfig(r,i.key);return pr.default.createElement(y7.default,{...this.props,key:i.key,ref:this.references.player,config:o,activePlayer:i.lazyPlayer||i,onReady:this.handleReady})})}shouldComponentUpdate(r,i){return!(0,Zc.default)(this.props,r)||!(0,Zc.default)(this.state,i)}componentDidUpdate(r){const{light:i}=this.props;!r.light&&i&&this.setState({showPreview:!0}),r.light&&!i&&this.setState({showPreview:!1})}renderPreview(r){if(!r)return null;const{light:i,playIcon:o,previewTabIndex:a,oEmbedUrl:l}=this.props;return pr.default.createElement(x7,{url:r,light:i,playIcon:o,previewTabIndex:a,oEmbedUrl:l,onClick:this.handleClickPreview})}render(){const{url:r,style:i,width:o,height:a,fallback:l,wrapper:d}=this.props,{showPreview:f}=this.state,h=this.getAttributes(r),p=typeof d=="string"?this.references.wrapper:void 0;return pr.default.createElement(d,{ref:p,style:{...i,width:o,height:a},...h},pr.default.createElement(_7,{fallback:l},f?this.renderPreview(r):this.renderActivePlayer(r)))}},nt(n,"displayName","ReactPlayer"),nt(n,"propTypes",ti.propTypes),nt(n,"defaultProps",ti.defaultProps),nt(n,"addCustomPlayer",r=>{Qr.push(r)}),nt(n,"removeCustomPlayers",()=>{Qr.length=0}),nt(n,"canPlay",r=>{for(const i of[...Qr,...e])if(i.canPlay(r))return!0;return!1}),nt(n,"canEnablePIP",r=>{for(const i of[...Qr,...e])if(i.canEnablePIP&&i.canEnablePIP(r))return!0;return!1}),n};var k7=Object.create,Lo=Object.defineProperty,C7=Object.getOwnPropertyDescriptor,E7=Object.getOwnPropertyNames,P7=Object.getPrototypeOf,M7=Object.prototype.hasOwnProperty,j7=(e,t)=>{for(var n in t)Lo(e,n,{get:t[n],enumerable:!0})},gh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of E7(t))!M7.call(e,i)&&i!==n&&Lo(e,i,{get:()=>t[i],enumerable:!(r=C7(t,i))||r.enumerable});return e},T7=(e,t,n)=>(n=e!=null?k7(P7(e)):{},gh(t||!e||!e.__esModule?Lo(n,"default",{value:e,enumerable:!0}):n,e)),O7=e=>gh(Lo({},"__esModule",{value:!0}),e),yh={};j7(yh,{default:()=>N7});var A7=O7(yh),ia=T7(Pb),D7=m7;const I7=ia.default[ia.default.length-1];var N7=(0,D7.createReactPlayer)(ia.default,I7);const L7=ma(A7),R7=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",children:[u.jsx("mask",{id:"mask0_4160_9271",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"32",height:"32",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_4160_9271)",children:u.jsx("path",{d:"M11 25V21H7V19H13V25H11ZM19 25V19H25V21H21V25H19ZM7 13V11H11V7H13V13H7ZM19 13V7H21V11H25V13H19Z",fill:"currentColor"})})]}),$7=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 22 22",fill:"currentColor",children:[u.jsx("mask",{id:"mask0_3130_18463",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"22",height:"22",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_3130_18463)",children:u.jsx("path",{d:"M4.58301 17.4166V12.8333H5.95798V16.0416H9.16634V17.4166H4.58301ZM4.58301 9.16658V4.58325H9.16634V5.95823H5.95798V9.16658H4.58301ZM12.833 17.4166V16.0416H16.0414V12.8333H17.4163V17.4166H12.833ZM16.0414 9.16658V5.95823H12.833V4.58325H17.4163V9.16658H16.0414Z",fill:"currentColor"})})]}),z7=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"volume_up",children:[u.jsx("mask",{id:"mask0_1483_75386",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1483_75386)",children:u.jsx("path",{id:"volume_up_2",d:"M14.0384 20.1095V18.5595C15.4807 18.1005 16.6425 17.2672 17.5239 16.0595C18.4053 14.8518 18.8461 13.4903 18.8461 11.9749C18.8461 10.4595 18.4053 9.09799 17.5239 7.89031C16.6425 6.68261 15.4807 5.84927 14.0384 5.39031V3.84033C15.8999 4.33905 17.4165 5.33841 18.5883 6.83841C19.7601 8.33839 20.346 10.0506 20.346 11.9749C20.346 13.8993 19.7601 15.6114 18.5883 17.1114C17.4165 18.6114 15.8999 19.6108 14.0384 20.1095ZM3.65381 14.4999V9.49993H7.36531L11.6537 5.21153V18.7883L7.36531 14.4999H3.65381ZM14.0384 15.6537V8.29608C14.7127 8.66275 15.2339 9.17909 15.6018 9.84511C15.9698 10.5111 16.1537 11.2294 16.1537 11.9999C16.1537 12.7602 15.9682 13.4675 15.597 14.122C15.2259 14.7765 14.7063 15.2871 14.0384 15.6537Z",fill:"currentColor"})})]})}),B7=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"volume_mute",children:[u.jsx("mask",{id:"mask0_1483_75386",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsxs("g",{mask:"url(#mask0_1483_75386)",children:[u.jsx("path",{id:"volume_up_2",d:"M14.0384 20.1095V18.5595C15.4807 18.1005 16.6425 17.2672 17.5239 16.0595C18.4053 14.8518 18.8461 13.4903 18.8461 11.9749C18.8461 10.4595 18.4053 9.09799 17.5239 7.89031C16.6425 6.68261 15.4807 5.84927 14.0384 5.39031V3.84033C15.8999 4.33905 17.4165 5.33841 18.5883 6.83841C19.7601 8.33839 20.346 10.0506 20.346 11.9749C20.346 13.8993 19.7601 15.6114 18.5883 17.1114C17.4165 18.6114 15.8999 19.6108 14.0384 20.1095ZM3.65381 14.4999V9.49993H7.36531L11.6537 5.21153V18.7883L7.36531 14.4999H3.65381ZM14.0384 15.6537V8.29608C14.7127 8.66275 15.2339 9.17909 15.6018 9.84511C15.9698 10.5111 16.1537 11.2294 16.1537 11.9999C16.1537 12.7602 15.9682 13.4675 15.597 14.122C15.2259 14.7765 14.7063 15.2871 14.0384 15.6537Z",fill:"currentColor"}),u.jsx("path",{id:"mute_line",d:"M6 21L21 4",stroke:"#808080","stroke-width":"2","stroke-linecap":"round"})]})]})}),qc=e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60),i=t>0?`${t}:`:"",o=t>0?n.toString().padStart(2,"0"):n.toString(),a=r.toString().padStart(2,"0");return`${i}${o}:${a}`},F7=({isPlaying:e,isFullScreen:t,setIsPlaying:n,playingTime:r,duration:i,handleProgressChange:o,handleVolumeChange:a,onFullScreenClick:l,showToolbar:d})=>{const[f,h]=j.useState(.5),[p,y]=j.useState(!1),[g,w]=j.useState(.5),_=(k,C)=>{const P=Array.isArray(C)?C[0]:C;h(P),a(k,P),p&&y(!1)},S=()=>{p?(h(g),a(new Event("input"),g)):(w(f),h(0),a(new Event("input"),0)),y(!p)};return u.jsxs(z,{children:[(!d||t)&&u.jsx(Z7,{"aria-label":"Small","data-testid":"progress-bar",isFullScreen:t,max:i,onChange:o,size:"small",value:r}),u.jsxs(H7,{align:"center",direction:"row",showToolbar:d||t,children:[u.jsx(U7,{onClick:n,size:"small",children:e?u.jsx(Co,{}):u.jsx(ba,{})}),u.jsxs(q7,{direction:"row",children:[u.jsx("span",{children:qc(r)}),u.jsx("span",{className:"separator",children:"/"}),u.jsx("span",{className:"duration",children:qc(i)})]}),u.jsxs(W7,{direction:"row",px:9,children:[u.jsx(dd,{className:"volume-slider",max:1,min:0,onChange:_,size:"small",step:.1,value:f}),u.jsx(Y7,{onClick:S,children:p?u.jsx(V7,{children:u.jsx(B7,{})}):u.jsx(z7,{})})]}),u.jsx(G7,{"data-testid":"fullscreen-button",onClick:l,children:t?u.jsx(R7,{}):u.jsx($7,{})})]})]})},H7=Y(z)` +`,k8=()=>{const e=_t(),{showTeachMe:t}=zt(r=>r),{setPlayingNode:n}=ko(r=>r);if(j.useEffect(()=>{var i,o;if(!e)return;(e.media_url||e.link||((i=e.properties)==null?void 0:i.link)||((o=e.properties)==null?void 0:o.media_url))&&n(e)},[n,e]),t)return u.jsx(F4,{});switch(e==null?void 0:e.node_type){case"guest":case"person":return u.jsx(G9,{});case"data_series":return u.jsx(V4,{});case"tribe_message":return u.jsx(Y9,{});case"Tweet":return u.jsx(r8,{});case"topic":return u.jsx(n8,{});case"show":return u.jsx(t8,{});case"video":case"podcast":case"clip":case"twitter_space":return u.jsx(Rf,{});case"document":return u.jsx(x8,{});case"episode":return u.jsx($9,{},e.ref_id);case"image":return u.jsx(H9,{});default:return u.jsx(u8,{})}},C8=j.memo(k8);var E8=function(t,n,r){var i=document.head||document.getElementsByTagName("head")[0],o=document.createElement("script");typeof n=="function"&&(r=n,n={}),n=n||{},r=r||function(){},o.type=n.type||"text/javascript",o.charset=n.charset||"utf8",o.async="async"in n?!!n.async:!0,o.src=t,n.attrs&&P8(o,n.attrs),n.text&&(o.text=""+n.text);var a="onload"in o?Hc:M8;a(o,r),o.onload||Hc(o,r),i.appendChild(o)};function P8(e,t){for(var n in t)e.setAttribute(n,t[n])}function Hc(e,t){e.onload=function(){this.onerror=this.onload=null,t(null,e)},e.onerror=function(){this.onerror=this.onload=null,t(new Error("Failed to load "+this.src),e)}}function M8(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var j8=function(t){return T8(t)&&!O8(t)};function T8(e){return!!e&&typeof e=="object"}function O8(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||I8(e)}var A8=typeof Symbol=="function"&&Symbol.for,D8=A8?Symbol.for("react.element"):60103;function I8(e){return e.$$typeof===D8}function N8(e){return Array.isArray(e)?[]:{}}function di(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Pr(N8(e),e,t):e}function L8(e,t,n){return e.concat(t).map(function(r){return di(r,n)})}function R8(e,t){if(!t.customMerge)return Pr;var n=t.customMerge(e);return typeof n=="function"?n:Pr}function $8(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function Yc(e){return Object.keys(e).concat($8(e))}function $f(e,t){try{return t in e}catch{return!1}}function z8(e,t){return $f(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function B8(e,t,n){var r={};return n.isMergeableObject(e)&&Yc(e).forEach(function(i){r[i]=di(e[i],n)}),Yc(t).forEach(function(i){z8(e,i)||($f(e,i)&&n.isMergeableObject(t[i])?r[i]=R8(i,n)(e[i],t[i],n):r[i]=di(t[i],n))}),r}function Pr(e,t,n){n=n||{},n.arrayMerge=n.arrayMerge||L8,n.isMergeableObject=n.isMergeableObject||j8,n.cloneUnlessOtherwiseSpecified=di;var r=Array.isArray(t),i=Array.isArray(e),o=r===i;return o?r?n.arrayMerge(e,t,n):B8(e,t,n):di(t,n)}Pr.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(r,i){return Pr(r,i,n)},{})};var F8=Pr,zf=F8,H8=Object.create,Ao=Object.defineProperty,Y8=Object.getOwnPropertyDescriptor,V8=Object.getOwnPropertyNames,U8=Object.getPrototypeOf,W8=Object.prototype.hasOwnProperty,G8=(e,t)=>{for(var n in t)Ao(e,n,{get:t[n],enumerable:!0})},Bf=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of V8(t))!W8.call(e,i)&&i!==n&&Ao(e,i,{get:()=>t[i],enumerable:!(r=Y8(t,i))||r.enumerable});return e},Ha=(e,t,n)=>(n=e!=null?H8(U8(e)):{},Bf(t||!e||!e.__esModule?Ao(n,"default",{value:e,enumerable:!0}):n,e)),Z8=e=>Bf(Ao({},"__esModule",{value:!0}),e),Ff={};G8(Ff,{callPlayer:()=>ub,getConfig:()=>lb,getSDK:()=>ab,isBlobUrl:()=>fb,isMediaStream:()=>db,lazy:()=>Q8,omit:()=>cb,parseEndTime:()=>ib,parseStartTime:()=>rb,queryString:()=>sb,randomString:()=>ob,supportsWebKitPresentationMode:()=>hb});var Do=Z8(Ff),q8=Ha(j),X8=Ha(E8),K8=Ha(zf);const Q8=e=>q8.default.lazy(async()=>{const t=await e();return typeof t.default=="function"?t:t.default}),J8=/[?&#](?:start|t)=([0-9hms]+)/,eb=/[?&#]end=([0-9hms]+)/,ta=/(\d+)(h|m|s)/g,tb=/^\d+$/;function Hf(e,t){if(e instanceof Array)return;const n=e.match(t);if(n){const r=n[1];if(r.match(ta))return nb(r);if(tb.test(r))return parseInt(r)}}function nb(e){let t=0,n=ta.exec(e);for(;n!==null;){const[,r,i]=n;i==="h"&&(t+=parseInt(r,10)*60*60),i==="m"&&(t+=parseInt(r,10)*60),i==="s"&&(t+=parseInt(r,10)),n=ta.exec(e)}return t}function rb(e){return Hf(e,J8)}function ib(e){return Hf(e,eb)}function ob(){return Math.random().toString(36).substr(2,5)}function sb(e){return Object.keys(e).map(t=>`${t}=${e[t]}`).join("&")}function _s(e){return window[e]?window[e]:window.exports&&window.exports[e]?window.exports[e]:window.module&&window.module.exports&&window.module.exports[e]?window.module.exports[e]:null}const ur={},ab=function(t,n,r=null,i=()=>!0,o=X8.default){const a=_s(n);return a&&i(a)?Promise.resolve(a):new Promise((l,d)=>{if(ur[t]){ur[t].push({resolve:l,reject:d});return}ur[t]=[{resolve:l,reject:d}];const f=h=>{ur[t].forEach(p=>p.resolve(h))};if(r){const h=window[r];window[r]=function(){h&&h(),f(_s(n))}}o(t,h=>{h?(ur[t].forEach(p=>p.reject(h)),ur[t]=null):r||f(_s(n))})})};function lb(e,t){return(0,K8.default)(t.config,e.config)}function cb(e,...t){const n=[].concat(...t),r={},i=Object.keys(e);for(const o of i)n.indexOf(o)===-1&&(r[o]=e[o]);return r}function ub(e,...t){if(!this.player||!this.player[e]){let n=`ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `;return this.player?this.player[e]||(n+="The method was not available"):n+="The player was not available",console.warn(n,"font-weight: bold",""),null}return this.player[e](...t)}function db(e){return typeof window<"u"&&typeof window.MediaStream<"u"&&e instanceof window.MediaStream}function fb(e){return/^blob:/.test(e)}function hb(e=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var Ya=Object.defineProperty,pb=Object.getOwnPropertyDescriptor,mb=Object.getOwnPropertyNames,gb=Object.prototype.hasOwnProperty,yb=(e,t)=>{for(var n in t)Ya(e,n,{get:t[n],enumerable:!0})},xb=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of mb(t))!gb.call(e,i)&&i!==n&&Ya(e,i,{get:()=>t[i],enumerable:!(r=pb(t,i))||r.enumerable});return e},wb=e=>xb(Ya({},"__esModule",{value:!0}),e),Yf={};yb(Yf,{AUDIO_EXTENSIONS:()=>Va,DASH_EXTENSIONS:()=>nh,FLV_EXTENSIONS:()=>rh,HLS_EXTENSIONS:()=>Wa,MATCH_URL_DAILYMOTION:()=>Qf,MATCH_URL_FACEBOOK:()=>Wf,MATCH_URL_FACEBOOK_WATCH:()=>Gf,MATCH_URL_KALTURA:()=>th,MATCH_URL_MIXCLOUD:()=>Jf,MATCH_URL_SOUNDCLOUD:()=>Vf,MATCH_URL_STREAMABLE:()=>Zf,MATCH_URL_TWITCH_CHANNEL:()=>Kf,MATCH_URL_TWITCH_VIDEO:()=>Xf,MATCH_URL_VIDYARD:()=>eh,MATCH_URL_VIMEO:()=>Uf,MATCH_URL_WISTIA:()=>qf,MATCH_URL_YOUTUBE:()=>na,VIDEO_EXTENSIONS:()=>Ua,canPlay:()=>vb});var bb=wb(Yf),Vc=Do;const na=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,Vf=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,Uf=/vimeo\.com\/(?!progressive_redirect).+/,Wf=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,Gf=/^https?:\/\/fb\.watch\/.+$/,Zf=/streamable\.com\/([a-z0-9]+)$/,qf=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,Xf=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,Kf=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,Qf=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,Jf=/mixcloud\.com\/([^/]+\/[^/]+)/,eh=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,th=/^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/,Va=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,Ua=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,Wa=/\.(m3u8)($|\?)/i,nh=/\.(mpd)($|\?)/i,rh=/\.(flv)($|\?)/i,ra=e=>{if(e instanceof Array){for(const t of e)if(typeof t=="string"&&ra(t)||ra(t.src))return!0;return!1}return(0,Vc.isMediaStream)(e)||(0,Vc.isBlobUrl)(e)?!0:Va.test(e)||Ua.test(e)||Wa.test(e)||nh.test(e)||rh.test(e)},vb={youtube:e=>e instanceof Array?e.every(t=>na.test(t)):na.test(e),soundcloud:e=>Vf.test(e)&&!Va.test(e),vimeo:e=>Uf.test(e)&&!Ua.test(e)&&!Wa.test(e),facebook:e=>Wf.test(e)||Gf.test(e),streamable:e=>Zf.test(e),wistia:e=>qf.test(e),twitch:e=>Xf.test(e)||Kf.test(e),dailymotion:e=>Qf.test(e),mixcloud:e=>Jf.test(e),vidyard:e=>eh.test(e),kaltura:e=>th.test(e),file:ra};var Ga=Object.defineProperty,_b=Object.getOwnPropertyDescriptor,Sb=Object.getOwnPropertyNames,kb=Object.prototype.hasOwnProperty,Cb=(e,t)=>{for(var n in t)Ga(e,n,{get:t[n],enumerable:!0})},Eb=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Sb(t))!kb.call(e,i)&&i!==n&&Ga(e,i,{get:()=>t[i],enumerable:!(r=_b(t,i))||r.enumerable});return e},Pb=e=>Eb(Ga({},"__esModule",{value:!0}),e),ih={};Cb(ih,{default:()=>jb});var Mb=Pb(ih),Tt=Do,kt=bb,jb=[{key:"youtube",name:"YouTube",canPlay:kt.canPlay.youtube,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./YouTube-90bf904b.js").then(e=>e.Y),["assets/YouTube-90bf904b.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"soundcloud",name:"SoundCloud",canPlay:kt.canPlay.soundcloud,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./SoundCloud-9d20082d.js").then(e=>e.S),["assets/SoundCloud-9d20082d.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"vimeo",name:"Vimeo",canPlay:kt.canPlay.vimeo,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Vimeo-bc107f3b.js").then(e=>e.V),["assets/Vimeo-bc107f3b.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"facebook",name:"Facebook",canPlay:kt.canPlay.facebook,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Facebook-9feea0b9.js").then(e=>e.F),["assets/Facebook-9feea0b9.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"streamable",name:"Streamable",canPlay:kt.canPlay.streamable,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Streamable-5b03b8b7.js").then(e=>e.S),["assets/Streamable-5b03b8b7.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"wistia",name:"Wistia",canPlay:kt.canPlay.wistia,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Wistia-25e10489.js").then(e=>e.W),["assets/Wistia-25e10489.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"twitch",name:"Twitch",canPlay:kt.canPlay.twitch,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Twitch-6cf2c593.js").then(e=>e.T),["assets/Twitch-6cf2c593.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"dailymotion",name:"DailyMotion",canPlay:kt.canPlay.dailymotion,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./DailyMotion-4594d2ab.js").then(e=>e.D),["assets/DailyMotion-4594d2ab.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"mixcloud",name:"Mixcloud",canPlay:kt.canPlay.mixcloud,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Mixcloud-a525a3b3.js").then(e=>e.M),["assets/Mixcloud-a525a3b3.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"vidyard",name:"Vidyard",canPlay:kt.canPlay.vidyard,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Vidyard-e01910ab.js").then(e=>e.V),["assets/Vidyard-e01910ab.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"kaltura",name:"Kaltura",canPlay:kt.canPlay.kaltura,lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./Kaltura-cb2185ba.js").then(e=>e.K),["assets/Kaltura-cb2185ba.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))},{key:"file",name:"FilePlayer",canPlay:kt.canPlay.file,canEnablePIP:e=>kt.canPlay.file(e)&&(document.pictureInPictureEnabled||(0,Tt.supportsWebKitPresentationMode)())&&!kt.AUDIO_EXTENSIONS.test(e),lazyPlayer:(0,Tt.lazy)(()=>Ot(()=>import("./FilePlayer-e8e2f43e.js").then(e=>e.F),["assets/FilePlayer-e8e2f43e.js","assets/index-ead79979.js","assets/index-a2878e02.css"]))}],Uc=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function Tb(e,t){return!!(e===t||Uc(e)&&Uc(t))}function Ob(e,t){if(e.length!==t.length)return!1;for(var n=0;n{for(var n in t)Io(e,n,{get:t[n],enumerable:!0})},sh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Fb(t))!Yb.call(e,i)&&i!==n&&Io(e,i,{get:()=>t[i],enumerable:!(r=Bb(t,i))||r.enumerable});return e},Ub=(e,t,n)=>(n=e!=null?zb(Hb(e)):{},sh(t||!e||!e.__esModule?Io(n,"default",{value:e,enumerable:!0}):n,e)),Wb=e=>sh(Io({},"__esModule",{value:!0}),e),ah={};Vb(ah,{defaultProps:()=>qb,propTypes:()=>Zb});var lh=Wb(ah),Gb=Ub(Wm);const{string:xt,bool:wt,number:dr,array:Ss,oneOfType:Kr,shape:Nt,object:bt,func:at,node:Wc}=Gb.default,Zb={url:Kr([xt,Ss,bt]),playing:wt,loop:wt,controls:wt,volume:dr,muted:wt,playbackRate:dr,width:Kr([xt,dr]),height:Kr([xt,dr]),style:bt,progressInterval:dr,playsinline:wt,pip:wt,stopOnUnmount:wt,light:Kr([wt,xt,bt]),playIcon:Wc,previewTabIndex:dr,fallback:Wc,oEmbedUrl:xt,wrapper:Kr([xt,at,Nt({render:at.isRequired})]),config:Nt({soundcloud:Nt({options:bt}),youtube:Nt({playerVars:bt,embedOptions:bt,onUnstarted:at}),facebook:Nt({appId:xt,version:xt,playerId:xt,attributes:bt}),dailymotion:Nt({params:bt}),vimeo:Nt({playerOptions:bt,title:xt}),file:Nt({attributes:bt,tracks:Ss,forceVideo:wt,forceAudio:wt,forceHLS:wt,forceSafariHLS:wt,forceDisableHls:wt,forceDASH:wt,forceFLV:wt,hlsOptions:bt,hlsVersion:xt,dashVersion:xt,flvVersion:xt}),wistia:Nt({options:bt,playerId:xt,customControls:Ss}),mixcloud:Nt({options:bt}),twitch:Nt({options:bt,playerId:xt}),vidyard:Nt({options:bt})}),onReady:at,onStart:at,onPlay:at,onPause:at,onBuffer:at,onBufferEnd:at,onEnded:at,onError:at,onDuration:at,onSeek:at,onPlaybackRateChange:at,onPlaybackQualityChange:at,onProgress:at,onClickPreview:at,onEnablePIP:at,onDisablePIP:at},ct=()=>{},qb={playing:!1,loop:!1,controls:!1,volume:null,muted:!1,playbackRate:1,width:"640px",height:"360px",style:{},progressInterval:1e3,playsinline:!1,pip:!1,stopOnUnmount:!0,light:!1,fallback:null,wrapper:"div",previewTabIndex:0,oEmbedUrl:"https://noembed.com/embed?url={url}",config:{soundcloud:{options:{visual:!0,buying:!1,liking:!1,download:!1,sharing:!1,show_comments:!1,show_playcount:!1}},youtube:{playerVars:{playsinline:1,showinfo:0,rel:0,iv_load_policy:3,modestbranding:1},embedOptions:{},onUnstarted:ct},facebook:{appId:"1309697205772819",version:"v3.3",playerId:null,attributes:{}},dailymotion:{params:{api:1,"endscreen-enable":!1}},vimeo:{playerOptions:{autopause:!1,byline:!1,portrait:!1,title:!1},title:null},file:{attributes:{},tracks:[],forceVideo:!1,forceAudio:!1,forceHLS:!1,forceDASH:!1,forceFLV:!1,hlsOptions:{},hlsVersion:"1.1.4",dashVersion:"3.1.3",flvVersion:"1.5.0",forceDisableHls:!1},wistia:{options:{},playerId:null,customControls:null},mixcloud:{options:{hide_cover:1}},twitch:{options:{},playerId:null},vidyard:{options:{}}},onReady:ct,onStart:ct,onPlay:ct,onPause:ct,onBuffer:ct,onBufferEnd:ct,onEnded:ct,onError:ct,onDuration:ct,onSeek:ct,onPlaybackRateChange:ct,onPlaybackQualityChange:ct,onProgress:ct,onClickPreview:ct,onEnablePIP:ct,onDisablePIP:ct};var Xb=Object.create,xi=Object.defineProperty,Kb=Object.getOwnPropertyDescriptor,Qb=Object.getOwnPropertyNames,Jb=Object.getPrototypeOf,e7=Object.prototype.hasOwnProperty,t7=(e,t,n)=>t in e?xi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,n7=(e,t)=>{for(var n in t)xi(e,n,{get:t[n],enumerable:!0})},ch=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Qb(t))!e7.call(e,i)&&i!==n&&xi(e,i,{get:()=>t[i],enumerable:!(r=Kb(t,i))||r.enumerable});return e},uh=(e,t,n)=>(n=e!=null?Xb(Jb(e)):{},ch(t||!e||!e.__esModule?xi(n,"default",{value:e,enumerable:!0}):n,e)),r7=e=>ch(xi({},"__esModule",{value:!0}),e),rt=(e,t,n)=>(t7(e,typeof t!="symbol"?t+"":t,n),n),dh={};n7(dh,{default:()=>No});var i7=r7(dh),Gc=uh(j),o7=uh(oh),fh=lh,s7=Do;const a7=5e3;class No extends Gc.Component{constructor(){super(...arguments),rt(this,"mounted",!1),rt(this,"isReady",!1),rt(this,"isPlaying",!1),rt(this,"isLoading",!0),rt(this,"loadOnReady",null),rt(this,"startOnPlay",!0),rt(this,"seekOnPlay",null),rt(this,"onDurationCalled",!1),rt(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),rt(this,"getInternalPlayer",t=>this.player?this.player[t]:null),rt(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,n=this.getSecondsLoaded(),r=this.getDuration();if(r){const i={playedSeconds:t,played:t/r};n!==null&&(i.loadedSeconds=n,i.loaded=n/r),(i.playedSeconds!==this.prevPlayed||i.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(i),this.prevPlayed=i.playedSeconds,this.prevLoaded=i.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),rt(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:n,volume:r,muted:i}=this.props;t(),!i&&r!==null&&this.player.setVolume(r),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):n&&this.player.play(),this.handleDurationCheck()}),rt(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:n,playbackRate:r}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&r!==1&&this.player.setPlaybackRate(r),t(),this.startOnPlay=!1),n(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),rt(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),rt(this,"handleEnded",()=>{const{activePlayer:t,loop:n,onEnded:r}=this.props;t.loopOnEnded&&n&&this.seekTo(0),n||(this.isPlaying=!1,r())}),rt(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),rt(this,"handleDurationCheck",()=>{clearTimeout(this.durationCheckTimeout);const t=this.getDuration();t?this.onDurationCalled||(this.props.onDuration(t),this.onDurationCalled=!0):this.durationCheckTimeout=setTimeout(this.handleDurationCheck,100)}),rt(this,"handleLoaded",()=>{this.isLoading=!1})}componentDidMount(){this.mounted=!0}componentWillUnmount(){clearTimeout(this.progressTimeout),clearTimeout(this.durationCheckTimeout),this.isReady&&this.props.stopOnUnmount&&(this.player.stop(),this.player.disablePIP&&this.player.disablePIP()),this.mounted=!1}componentDidUpdate(t){if(!this.player)return;const{url:n,playing:r,volume:i,muted:o,playbackRate:a,pip:l,loop:d,activePlayer:f,disableDeferredLoading:h}=this.props;if(!(0,o7.default)(t.url,n)){if(this.isLoading&&!f.forceLoad&&!h&&!(0,s7.isMediaStream)(n)){console.warn(`ReactPlayer: the attempt to load ${n} is being deferred until the player has loaded`),this.loadOnReady=n;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(n,this.isReady)}!t.playing&&r&&!this.isPlaying&&this.player.play(),t.playing&&!r&&this.isPlaying&&this.player.pause(),!t.pip&&l&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!l&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==i&&i!==null&&this.player.setVolume(i),t.muted!==o&&(o?this.player.mute():(this.player.unmute(),i!==null&&setTimeout(()=>this.player.setVolume(i)))),t.playbackRate!==a&&this.player.setPlaybackRate&&this.player.setPlaybackRate(a),t.loop!==d&&this.player.setLoop&&this.player.setLoop(d)}getDuration(){return this.isReady?this.player.getDuration():null}getCurrentTime(){return this.isReady?this.player.getCurrentTime():null}getSecondsLoaded(){return this.isReady?this.player.getSecondsLoaded():null}seekTo(t,n,r){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},a7));return}if(n?n==="fraction":t>0&&t<1){const o=this.player.getDuration();if(!o){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(o*t,r);return}this.player.seekTo(t,r)}render(){const t=this.props.activePlayer;return t?Gc.default.createElement(t,{...this.props,onMount:this.handlePlayerMount,onReady:this.handleReady,onPlay:this.handlePlay,onPause:this.handlePause,onEnded:this.handleEnded,onLoaded:this.handleLoaded,onError:this.handleError}):null}}rt(No,"displayName","Player");rt(No,"propTypes",fh.propTypes);rt(No,"defaultProps",fh.defaultProps);var l7=Object.create,wi=Object.defineProperty,c7=Object.getOwnPropertyDescriptor,u7=Object.getOwnPropertyNames,d7=Object.getPrototypeOf,f7=Object.prototype.hasOwnProperty,h7=(e,t,n)=>t in e?wi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,p7=(e,t)=>{for(var n in t)wi(e,n,{get:t[n],enumerable:!0})},hh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of u7(t))!f7.call(e,i)&&i!==n&&wi(e,i,{get:()=>t[i],enumerable:!(r=c7(t,i))||r.enumerable});return e},bi=(e,t,n)=>(n=e!=null?l7(d7(e)):{},hh(t||!e||!e.__esModule?wi(n,"default",{value:e,enumerable:!0}):n,e)),m7=e=>hh(wi({},"__esModule",{value:!0}),e),nt=(e,t,n)=>(h7(e,typeof t!="symbol"?t+"":t,n),n),ph={};p7(ph,{createReactPlayer:()=>k7});var g7=m7(ph),pr=bi(j),y7=bi(zf),ks=bi(Ib),Zc=bi(oh),ti=lh,mh=Do,x7=bi(i7);const w7=(0,mh.lazy)(()=>Ot(()=>import("./Preview-24af5c04.js").then(e=>e.P),["assets/Preview-24af5c04.js","assets/index-ead79979.js","assets/index-a2878e02.css"])),b7=typeof window<"u"&&window.document,v7=typeof mt<"u"&&mt.window&&mt.window.document,_7=Object.keys(ti.propTypes),S7=b7||v7?pr.Suspense:()=>null,Qr=[],k7=(e,t)=>{var n;return n=class extends pr.Component{constructor(){super(...arguments),nt(this,"state",{showPreview:!!this.props.light}),nt(this,"references",{wrapper:r=>{this.wrapper=r},player:r=>{this.player=r}}),nt(this,"handleClickPreview",r=>{this.setState({showPreview:!1}),this.props.onClickPreview(r)}),nt(this,"showPreview",()=>{this.setState({showPreview:!0})}),nt(this,"getDuration",()=>this.player?this.player.getDuration():null),nt(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),nt(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),nt(this,"getInternalPlayer",(r="player")=>this.player?this.player.getInternalPlayer(r):null),nt(this,"seekTo",(r,i,o)=>{if(!this.player)return null;this.player.seekTo(r,i,o)}),nt(this,"handleReady",()=>{this.props.onReady(this)}),nt(this,"getActivePlayer",(0,ks.default)(r=>{for(const i of[...Qr,...e])if(i.canPlay(r))return i;return t||null})),nt(this,"getConfig",(0,ks.default)((r,i)=>{const{config:o}=this.props;return y7.default.all([ti.defaultProps.config,ti.defaultProps.config[i]||{},o,o[i]||{}])})),nt(this,"getAttributes",(0,ks.default)(r=>(0,mh.omit)(this.props,_7))),nt(this,"renderActivePlayer",r=>{if(!r)return null;const i=this.getActivePlayer(r);if(!i)return null;const o=this.getConfig(r,i.key);return pr.default.createElement(x7.default,{...this.props,key:i.key,ref:this.references.player,config:o,activePlayer:i.lazyPlayer||i,onReady:this.handleReady})})}shouldComponentUpdate(r,i){return!(0,Zc.default)(this.props,r)||!(0,Zc.default)(this.state,i)}componentDidUpdate(r){const{light:i}=this.props;!r.light&&i&&this.setState({showPreview:!0}),r.light&&!i&&this.setState({showPreview:!1})}renderPreview(r){if(!r)return null;const{light:i,playIcon:o,previewTabIndex:a,oEmbedUrl:l}=this.props;return pr.default.createElement(w7,{url:r,light:i,playIcon:o,previewTabIndex:a,oEmbedUrl:l,onClick:this.handleClickPreview})}render(){const{url:r,style:i,width:o,height:a,fallback:l,wrapper:d}=this.props,{showPreview:f}=this.state,h=this.getAttributes(r),p=typeof d=="string"?this.references.wrapper:void 0;return pr.default.createElement(d,{ref:p,style:{...i,width:o,height:a},...h},pr.default.createElement(S7,{fallback:l},f?this.renderPreview(r):this.renderActivePlayer(r)))}},nt(n,"displayName","ReactPlayer"),nt(n,"propTypes",ti.propTypes),nt(n,"defaultProps",ti.defaultProps),nt(n,"addCustomPlayer",r=>{Qr.push(r)}),nt(n,"removeCustomPlayers",()=>{Qr.length=0}),nt(n,"canPlay",r=>{for(const i of[...Qr,...e])if(i.canPlay(r))return!0;return!1}),nt(n,"canEnablePIP",r=>{for(const i of[...Qr,...e])if(i.canEnablePIP&&i.canEnablePIP(r))return!0;return!1}),n};var C7=Object.create,Lo=Object.defineProperty,E7=Object.getOwnPropertyDescriptor,P7=Object.getOwnPropertyNames,M7=Object.getPrototypeOf,j7=Object.prototype.hasOwnProperty,T7=(e,t)=>{for(var n in t)Lo(e,n,{get:t[n],enumerable:!0})},gh=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of P7(t))!j7.call(e,i)&&i!==n&&Lo(e,i,{get:()=>t[i],enumerable:!(r=E7(t,i))||r.enumerable});return e},O7=(e,t,n)=>(n=e!=null?C7(M7(e)):{},gh(t||!e||!e.__esModule?Lo(n,"default",{value:e,enumerable:!0}):n,e)),A7=e=>gh(Lo({},"__esModule",{value:!0}),e),yh={};T7(yh,{default:()=>L7});var D7=A7(yh),ia=O7(Mb),I7=g7;const N7=ia.default[ia.default.length-1];var L7=(0,I7.createReactPlayer)(ia.default,N7);const R7=ma(D7),$7=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 32 32",fill:"currentColor",children:[u.jsx("mask",{id:"mask0_4160_9271",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"32",height:"32",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_4160_9271)",children:u.jsx("path",{d:"M11 25V21H7V19H13V25H11ZM19 25V19H25V21H21V25H19ZM7 13V11H11V7H13V13H7ZM19 13V7H21V11H25V13H19Z",fill:"currentColor"})})]}),z7=e=>u.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 22 22",fill:"currentColor",children:[u.jsx("mask",{id:"mask0_3130_18463",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"22",height:"22",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_3130_18463)",children:u.jsx("path",{d:"M4.58301 17.4166V12.8333H5.95798V16.0416H9.16634V17.4166H4.58301ZM4.58301 9.16658V4.58325H9.16634V5.95823H5.95798V9.16658H4.58301ZM12.833 17.4166V16.0416H16.0414V12.8333H17.4163V17.4166H12.833ZM16.0414 9.16658V5.95823H12.833V4.58325H17.4163V9.16658H16.0414Z",fill:"currentColor"})})]}),B7=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"volume_up",children:[u.jsx("mask",{id:"mask0_1483_75386",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1483_75386)",children:u.jsx("path",{id:"volume_up_2",d:"M14.0384 20.1095V18.5595C15.4807 18.1005 16.6425 17.2672 17.5239 16.0595C18.4053 14.8518 18.8461 13.4903 18.8461 11.9749C18.8461 10.4595 18.4053 9.09799 17.5239 7.89031C16.6425 6.68261 15.4807 5.84927 14.0384 5.39031V3.84033C15.8999 4.33905 17.4165 5.33841 18.5883 6.83841C19.7601 8.33839 20.346 10.0506 20.346 11.9749C20.346 13.8993 19.7601 15.6114 18.5883 17.1114C17.4165 18.6114 15.8999 19.6108 14.0384 20.1095ZM3.65381 14.4999V9.49993H7.36531L11.6537 5.21153V18.7883L7.36531 14.4999H3.65381ZM14.0384 15.6537V8.29608C14.7127 8.66275 15.2339 9.17909 15.6018 9.84511C15.9698 10.5111 16.1537 11.2294 16.1537 11.9999C16.1537 12.7602 15.9682 13.4675 15.597 14.122C15.2259 14.7765 14.7063 15.2871 14.0384 15.6537Z",fill:"currentColor"})})]})}),F7=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"volume_mute",children:[u.jsx("mask",{id:"mask0_1483_75386",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsxs("g",{mask:"url(#mask0_1483_75386)",children:[u.jsx("path",{id:"volume_up_2",d:"M14.0384 20.1095V18.5595C15.4807 18.1005 16.6425 17.2672 17.5239 16.0595C18.4053 14.8518 18.8461 13.4903 18.8461 11.9749C18.8461 10.4595 18.4053 9.09799 17.5239 7.89031C16.6425 6.68261 15.4807 5.84927 14.0384 5.39031V3.84033C15.8999 4.33905 17.4165 5.33841 18.5883 6.83841C19.7601 8.33839 20.346 10.0506 20.346 11.9749C20.346 13.8993 19.7601 15.6114 18.5883 17.1114C17.4165 18.6114 15.8999 19.6108 14.0384 20.1095ZM3.65381 14.4999V9.49993H7.36531L11.6537 5.21153V18.7883L7.36531 14.4999H3.65381ZM14.0384 15.6537V8.29608C14.7127 8.66275 15.2339 9.17909 15.6018 9.84511C15.9698 10.5111 16.1537 11.2294 16.1537 11.9999C16.1537 12.7602 15.9682 13.4675 15.597 14.122C15.2259 14.7765 14.7063 15.2871 14.0384 15.6537Z",fill:"currentColor"}),u.jsx("path",{id:"mute_line",d:"M6 21L21 4",stroke:"#808080","stroke-width":"2","stroke-linecap":"round"})]})]})}),qc=e=>{const t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60),i=t>0?`${t}:`:"",o=t>0?n.toString().padStart(2,"0"):n.toString(),a=r.toString().padStart(2,"0");return`${i}${o}:${a}`},H7=({isPlaying:e,isFullScreen:t,setIsPlaying:n,playingTime:r,duration:i,handleProgressChange:o,handleVolumeChange:a,onFullScreenClick:l,showToolbar:d})=>{const[f,h]=j.useState(.5),[p,y]=j.useState(!1),[g,w]=j.useState(.5),_=(k,C)=>{const M=Array.isArray(C)?C[0]:C;h(M),a(k,M),p&&y(!1)},S=()=>{p?(h(g),a(new Event("input"),g)):(w(f),h(0),a(new Event("input"),0)),y(!p)};return u.jsxs(z,{children:[(!d||t)&&u.jsx(q7,{"aria-label":"Small","data-testid":"progress-bar",isFullScreen:t,max:i,onChange:o,size:"small",value:r}),u.jsxs(Y7,{align:"center",direction:"row",showToolbar:d||t,children:[u.jsx(W7,{onClick:n,size:"small",children:e?u.jsx(Co,{}):u.jsx(ba,{})}),u.jsxs(X7,{direction:"row",children:[u.jsx("span",{children:qc(r)}),u.jsx("span",{className:"separator",children:"/"}),u.jsx("span",{className:"duration",children:qc(i)})]}),u.jsxs(G7,{direction:"row",px:9,children:[u.jsx(dd,{className:"volume-slider",max:1,min:0,onChange:_,size:"small",step:.1,value:f}),u.jsx(V7,{onClick:S,children:p?u.jsx(U7,{children:u.jsx(F7,{})}):u.jsx(B7,{})})]}),u.jsx(Z7,{"data-testid":"fullscreen-button",onClick:l,children:t?u.jsx($7,{}):u.jsx(z7,{})})]})]})},Y7=Y(z)` height: 60px; padding: 12px 16px; ${e=>e.showToolbar&&` @@ -1279,15 +1279,15 @@ ${({disabled:e})=>e&&Gu` &.error-wrapper { color: ${N.primaryRed}; } -`,Y7=Y.span``,V7=Y.span` +`,V7=Y.span``,U7=Y.span` color: gray; -`,U7=Y(sd)` +`,W7=Y(sd)` && { font-size: 36px; padding: 2px; margin-left: 8px; } -`,W7=Y(z)` +`,G7=Y(z)` height: 28px; font-size: 26px; border-radius: 200px; @@ -1324,12 +1324,12 @@ ${({disabled:e})=>e&&Gu` display: block; } } -`,G7=Y(z)` +`,Z7=Y(z)` cursor: pointer; padding: 8px; font-size: 32px; color: #d9d9d9; -`,Z7=Y(dd)` +`,q7=Y(dd)` && { z-index: 20; color: ${N.white}; @@ -1354,7 +1354,7 @@ ${({disabled:e})=>e&&Gu` } } } -`,q7=Y(z)` +`,X7=Y(z)` color: ${N.white}; font-size: 13px; margin-left: 16px; @@ -1368,7 +1368,7 @@ ${({disabled:e})=>e&&Gu` .duration { color: ${N.GRAY6}; } -`,X7=({hidden:e})=>{var E,ae;const t=j.useRef(null),n=j.useRef(null),[r,i]=j.useState(!1),[o,a]=j.useState(!1),[l,d]=j.useState(!1),[f,h]=j.useState("ready"),[p,y]=j.useState(!1),{isPlaying:g,playingTime:w,duration:_,setIsPlaying:S,setPlayingTime:k,setDuration:C,playingNode:P,volume:O,setVolume:R,setHasError:T,resetPlayer:V,isSeeking:U,setIsSeeking:W}=ko(J=>J),q=(P==null?void 0:P.media_url)||(P==null?void 0:P.link)||((E=P==null?void 0:P.properties)==null?void 0:E.link)||((ae=P==null?void 0:P.properties)==null?void 0:ae.media_url),$=(q==null?void 0:q.includes("youtube"))||(q==null?void 0:q.includes("youtu.be"));j.useEffect(()=>()=>V(),[V]),j.useEffect(()=>{P&&!p&&(k(0),C(0),y(!1))},[P,k,C,y,p]),j.useEffect(()=>{U&&t.current&&(t.current.seekTo(w,"seconds"),W(!1))},[w,U,W]);const H=()=>{S(!g)},B=()=>{S(!0)},M=()=>{S(!1)},L=(J,le)=>{const pe=Array.isArray(le)?le[0]:le;k(pe),t.current&&!U&&t.current.seekTo(pe,"seconds")},A=(J,le)=>{const pe=Array.isArray(le)?le[0]:le;R(pe)},G=()=>{T(!0),h("error")},X=J=>{if(!U){const le=J.playedSeconds;k(le)}},F=()=>{if(t.current){h("ready");const J=t.current.getDuration();if(C(J),!U&&(w===0||Math.abs(w-Kn("00:00:00"))<1)&&(P==null?void 0:P.type)==="youtube"&&P!=null&&P.timestamp){const[le]=P.timestamp.split("-"),pe=Kn(le);t.current.seekTo(pe,"seconds"),k(pe)}}},v=()=>{n.current&&(document.fullscreenElement?(document.exitFullscreen(),setTimeout(()=>a(!1),300)):n.current.requestFullscreen().then(()=>{document.addEventListener("fullscreenchange",Q)}))},Q=()=>{a(!!document.fullscreenElement),document.removeEventListener("fullscreenchange",Q)};j.useEffect(()=>()=>{document.removeEventListener("fullscreenchange",Q)}),j.useEffect(()=>{const J=le=>{if(o){const pe=window.screen.height,me=le.clientY,ve=pe-me;d(ve<=50)}};return document.addEventListener("mousemove",J),()=>{document.removeEventListener("mousemove",J)}},[o,l]),j.useEffect(()=>{const J=le=>{o&&le.key==="Escape"?(le.preventDefault(),le.stopPropagation()):r&&le.key===" "&&(le.preventDefault(),H())};return document.addEventListener("fullscreenchange",Q),document.addEventListener("keydown",J),()=>{document.removeEventListener("fullscreenchange",Q),document.removeEventListener("keydown",J)}});const ne=()=>{H()};return q?u.jsxs(K7,{ref:n,hidden:e,onBlur:()=>i(!1),onFocus:()=>i(!0),tabIndex:0,children:[u.jsx(Q7,{isFullScreen:o,children:u.jsx(Gt,{size:120,src:(P==null?void 0:P.image_url)||"",type:"clip"})}),u.jsx(tv,{onClick:ne,children:u.jsx(L7,{ref:t,controls:!1,height:o?window.screen.height:"200px",onBuffer:()=>h("buffering"),onBufferEnd:()=>h("ready"),onError:G,onPause:M,onPlay:B,onProgress:X,onReady:F,playing:g,url:q||"",volume:O,width:"100%"})}),f==="error"?u.jsx(ev,{className:"error-wrapper",children:"Error happened, please try later"}):null,f==="ready"?u.jsx(F7,{duration:_,handleProgressChange:L,handleVolumeChange:A,isFullScreen:o,isPlaying:g,onFullScreenClick:v,playingTime:w,setIsPlaying:H,showToolbar:l&&o}):null,f==="buffering"&&!$?u.jsx(J7,{isFullScreen:o,children:u.jsx(va,{color:N.lightGray})}):null]}):null},K7=Y(z)` +`,K7=({hidden:e})=>{var E,ae;const t=j.useRef(null),n=j.useRef(null),[r,i]=j.useState(!1),[o,a]=j.useState(!1),[l,d]=j.useState(!1),[f,h]=j.useState("ready"),[p,y]=j.useState(!1),{isPlaying:g,playingTime:w,duration:_,setIsPlaying:S,setPlayingTime:k,setDuration:C,playingNode:M,volume:O,setVolume:L,setHasError:T,resetPlayer:V,isSeeking:U,setIsSeeking:W}=ko(J=>J),q=(M==null?void 0:M.media_url)||(M==null?void 0:M.link)||((E=M==null?void 0:M.properties)==null?void 0:E.link)||((ae=M==null?void 0:M.properties)==null?void 0:ae.media_url),$=(q==null?void 0:q.includes("youtube"))||(q==null?void 0:q.includes("youtu.be"));j.useEffect(()=>()=>V(),[V]),j.useEffect(()=>{M&&!p&&(k(0),C(0),y(!1))},[M,k,C,y,p]),j.useEffect(()=>{U&&t.current&&(t.current.seekTo(w,"seconds"),W(!1))},[w,U,W]);const H=()=>{S(!g)},B=()=>{S(!0)},P=()=>{S(!1)},R=(J,le)=>{const pe=Array.isArray(le)?le[0]:le;k(pe),t.current&&!U&&t.current.seekTo(pe,"seconds")},A=(J,le)=>{const pe=Array.isArray(le)?le[0]:le;L(pe)},G=()=>{T(!0),h("error")},X=J=>{if(!U){const le=J.playedSeconds;k(le)}},F=()=>{if(t.current){h("ready");const J=t.current.getDuration();if(C(J),!U&&(w===0||Math.abs(w-Kn("00:00:00"))<1)&&(M==null?void 0:M.type)==="youtube"&&M!=null&&M.timestamp){const[le]=M.timestamp.split("-"),pe=Kn(le);t.current.seekTo(pe,"seconds"),k(pe)}}},v=()=>{n.current&&(document.fullscreenElement?(document.exitFullscreen(),setTimeout(()=>a(!1),300)):n.current.requestFullscreen().then(()=>{document.addEventListener("fullscreenchange",Q)}))},Q=()=>{a(!!document.fullscreenElement),document.removeEventListener("fullscreenchange",Q)};j.useEffect(()=>()=>{document.removeEventListener("fullscreenchange",Q)}),j.useEffect(()=>{const J=le=>{if(o){const pe=window.screen.height,me=le.clientY,ve=pe-me;d(ve<=50)}};return document.addEventListener("mousemove",J),()=>{document.removeEventListener("mousemove",J)}},[o,l]),j.useEffect(()=>{const J=le=>{o&&le.key==="Escape"?(le.preventDefault(),le.stopPropagation()):r&&le.key===" "&&(le.preventDefault(),H())};return document.addEventListener("fullscreenchange",Q),document.addEventListener("keydown",J),()=>{document.removeEventListener("fullscreenchange",Q),document.removeEventListener("keydown",J)}});const ne=()=>{H()};return q?u.jsxs(Q7,{ref:n,hidden:e,onBlur:()=>i(!1),onFocus:()=>i(!0),tabIndex:0,children:[u.jsx(J7,{isFullScreen:o,children:u.jsx(Gt,{size:120,src:(M==null?void 0:M.image_url)||"",type:"clip"})}),u.jsx(nv,{onClick:ne,children:u.jsx(R7,{ref:t,controls:!1,height:o?window.screen.height:"200px",onBuffer:()=>h("buffering"),onBufferEnd:()=>h("ready"),onError:G,onPause:P,onPlay:B,onProgress:X,onReady:F,playing:g,url:q||"",volume:O,width:"100%"})}),f==="error"?u.jsx(tv,{className:"error-wrapper",children:"Error happened, please try later"}):null,f==="ready"?u.jsx(H7,{duration:_,handleProgressChange:R,handleVolumeChange:A,isFullScreen:o,isPlaying:g,onFullScreenClick:v,playingTime:w,setIsPlaying:H,showToolbar:l&&o}):null,f==="buffering"&&!$?u.jsx(ev,{isFullScreen:o,children:u.jsx(va,{color:N.lightGray})}):null]}):null},Q7=Y(z)` border-bottom: 1px solid rgba(0, 0, 0, 0.25); background: rgba(0, 0, 0, 0.2); position: relative; @@ -1379,26 +1379,26 @@ ${({disabled:e})=>e&&Gu` &:focus { outline: none; } -`,Q7=Y(z)` +`,J7=Y(z)` position: absolute; top: ${e=>e.isFullScreen?"38%":"18%"}; left: 50%; transform: translateX(-50%); z-index: -1; -`,J7=Y(z)` +`,ev=Y(z)` position: absolute; top: ${e=>e.isFullScreen?"43%":"39%"}; left: 50%; transform: translateX(-50%); z-index: 1; -`,ev=Y(z)` +`,tv=Y(z)` height: 60px; padding: 12px 16px; color: ${N.primaryRed}; -`,tv=Y.div` +`,nv=Y.div` width: 100%; cursor: pointer; -`,nv=j.memo(X7),rv=({open:e})=>{const{setTeachMe:t,showTeachMe:n}=zt(l=>l),{setSelectedNode:r}=Gm(l=>l),i=_t(),{setSidebarOpen:o}=vt(l=>l),{playingNode:a}=ko(l=>l);return u.jsx(wa,{"data-testid":"sidebar-sub-view",direction:"right",in:e,style:{width:n?"700px":"",position:e?"relative":"absolute"},children:u.jsxs(iv,{children:[u.jsx(nv,{hidden:(i==null?void 0:i.ref_id)!==(a==null?void 0:a.ref_id)},a==null?void 0:a.ref_id),u.jsx(sv,{children:u.jsx(k8,{})}),u.jsx(ov,{"data-testid":"close-sidebar-sub-view",onClick:()=>{r(null),t(!1)},children:u.jsx(N2,{})}),u.jsx(av,{onClick:()=>{o(!1)},children:u.jsx(gd,{})})]})})},iv=Y(z)(({theme:e})=>({position:"relative",background:N.BG1,width:"100%",margin:"64px auto 20px 10px",borderRadius:"16px",zIndex:29,[e.breakpoints.up("sm")]:{width:"390px"}})),ov=Y(z)` +`,rv=j.memo(K7),iv=({open:e})=>{const{setTeachMe:t,showTeachMe:n}=zt(l=>l),{setSelectedNode:r}=Gm(l=>l),i=_t(),{setSidebarOpen:o}=vt(l=>l),{playingNode:a}=ko(l=>l);return u.jsx(wa,{"data-testid":"sidebar-sub-view",direction:"right",in:e,style:{width:n?"700px":"",position:e?"relative":"absolute"},children:u.jsxs(ov,{children:[u.jsx(rv,{hidden:(i==null?void 0:i.ref_id)!==(a==null?void 0:a.ref_id)},a==null?void 0:a.ref_id),u.jsx(av,{children:u.jsx(C8,{})}),u.jsx(sv,{"data-testid":"close-sidebar-sub-view",onClick:()=>{r(null),t(!1)},children:u.jsx(L2,{})}),u.jsx(lv,{onClick:()=>{o(!1)},children:u.jsx(gd,{})})]})})},ov=Y(z)(({theme:e})=>({position:"relative",background:N.BG1,width:"100%",margin:"64px auto 20px 10px",borderRadius:"16px",zIndex:29,[e.breakpoints.up("sm")]:{width:"390px"}})),sv=Y(z)` font-size: 32px; color: ${N.white}; cursor: pointer; @@ -1412,40 +1412,40 @@ ${({disabled:e})=>e&&Gu` &:active { } -`,sv=Y(z)` +`,av=Y(z)` flex: 1 1 100%; border-radius: 16px; overflow: hidden; -`,av=Y(z).attrs({align:"center",justify:"center",p:8})(({theme:e})=>({backgroundColor:N.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",right:"0px",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:N.white,[e.breakpoints.up("sm")]:{left:"100%"},"&:hover":{backgroundColor:N.BG1_HOVER},"&:active":{backgroundColor:N.BG1_PRESS,color:N.GRAY6}})),lv=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"chevron_right",children:[u.jsx("mask",{id:"mask0_1247_21809",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"18",height:"18",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1247_21809)",children:u.jsx("path",{id:"chevron_right_2",d:"M9.44998 8.99998L6.52498 6.07498C6.38748 5.93748 6.31873 5.76248 6.31873 5.54998C6.31873 5.33748 6.38748 5.16248 6.52498 5.02498C6.66248 4.88748 6.83748 4.81873 7.04998 4.81873C7.26248 4.81873 7.43748 4.88748 7.57498 5.02498L11.025 8.47498C11.1 8.54997 11.1531 8.63123 11.1844 8.71873C11.2156 8.80623 11.2312 8.89998 11.2312 8.99998C11.2312 9.09998 11.2156 9.19373 11.1844 9.28123C11.1531 9.36873 11.1 9.44998 11.025 9.52497L7.57498 12.975C7.43748 13.1125 7.26248 13.1812 7.04998 13.1812C6.83748 13.1812 6.66248 13.1125 6.52498 12.975C6.38748 12.8375 6.31873 12.6625 6.31873 12.45C6.31873 12.2375 6.38748 12.0625 6.52498 11.925L9.44998 8.99998Z",fill:"currentColor"})})]})}),cv=()=>{const e=vt(t=>t.setSidebarOpen);return u.jsx(uv,{onClick:()=>{e(!0)},children:u.jsx(lv,{})})},uv=Y(z).attrs({align:"center",justify:"center",p:8})(({theme:e})=>({backgroundColor:N.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:N.white,[e.breakpoints.up("sm")]:{left:"64px"},"&:hover":{backgroundColor:N.BG1_HOVER},"&:active":{backgroundColor:N.BG1_PRESS,color:N.GRAY6}})),dv=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M4.24488 9.94873L3.51732 12.8382C3.48633 12.976 3.4201 13.0844 3.31861 13.1635C3.21711 13.2425 3.09318 13.2821 2.94682 13.2821C2.75237 13.2821 2.59319 13.2046 2.46928 13.0497C2.34535 12.8948 2.31009 12.7244 2.36351 12.5385L3.01094 9.94873H0.635943C0.427609 9.94873 0.260144 9.86913 0.133547 9.70995C0.00694957 9.55077 -0.0296407 9.37129 0.023776 9.1715C0.0600955 9.02514 0.134609 8.90975 0.247318 8.82535C0.360026 8.74096 0.489568 8.69877 0.635943 8.69877H3.32344L4.1728 5.30131H1.7978C1.58946 5.30131 1.422 5.22172 1.2954 5.06254C1.1688 4.90336 1.13221 4.72388 1.18563 4.5241C1.22195 4.37773 1.29646 4.26234 1.40917 4.17795C1.52188 4.09355 1.65142 4.05135 1.7978 4.05135H4.4853L5.21286 1.16191C5.24383 1.02409 5.31007 0.915657 5.41157 0.836601C5.51305 0.757546 5.63698 0.718018 5.78336 0.718018C5.97779 0.718018 6.13697 0.795469 6.2609 0.950372C6.38483 1.10529 6.42009 1.27569 6.36667 1.46158L5.71923 4.05135H9.16476L9.89232 1.16191C9.9233 1.02409 9.98954 0.915657 10.091 0.836601C10.1925 0.757546 10.3165 0.718018 10.4628 0.718018C10.6573 0.718018 10.8164 0.795469 10.9404 0.950372C11.0643 1.10529 11.0995 1.27569 11.0461 1.46158L10.3987 4.05135H12.7737C12.982 4.05135 13.1495 4.13094 13.2761 4.29012C13.4027 4.4493 13.4393 4.62879 13.3859 4.82858C13.3495 4.97494 13.275 5.09032 13.1623 5.17473C13.0496 5.25911 12.9201 5.30131 12.7737 5.30131H10.0862L9.23684 8.69877H11.6118C11.8202 8.69877 11.9876 8.77836 12.1142 8.93754C12.2408 9.09672 12.2774 9.2762 12.224 9.47598C12.1877 9.62235 12.1132 9.73773 12.0005 9.82212C11.8878 9.90652 11.7582 9.94873 11.6118 9.94873H8.92434L8.19678 12.8382C8.1658 12.976 8.09957 13.0844 7.99807 13.1635C7.89658 13.2425 7.77265 13.2821 7.62628 13.2821C7.43185 13.2821 7.27267 13.2046 7.14874 13.0497C7.0248 12.8948 6.98955 12.7244 7.04296 12.5385L7.6904 9.94873H4.24488ZM4.55738 8.69877H8.0029L8.85226 5.30131H5.40673L4.55738 8.69877Z",fill:"currentColor"})}),fv=e=>u.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("mask",{id:"mask0_5099_7163",maskUnits:"userSpaceOnUse",x:"2",y:"2",width:"16",height:"16",children:u.jsx("rect",{x:"2",y:"2",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_5099_7163)",children:u.jsx("path",{d:"M10 16.6667C9.16667 16.6667 8.38611 16.5083 7.65833 16.1917C6.93056 15.875 6.29722 15.4472 5.75833 14.9083C5.21944 14.3695 4.79167 13.7361 4.475 13.0083C4.15833 12.2806 4 11.5 4 10.6667C4 10.4778 4.06389 10.3195 4.19167 10.1917C4.31944 10.0639 4.47778 10 4.66667 10C4.85556 10 5.01389 10.0639 5.14167 10.1917C5.26944 10.3195 5.33333 10.4778 5.33333 10.6667C5.33333 11.9667 5.78611 13.0695 6.69167 13.975C7.59722 14.8806 8.7 15.3333 10 15.3333C11.3 15.3333 12.4028 14.8806 13.3083 13.975C14.2139 13.0695 14.6667 11.9667 14.6667 10.6667C14.6667 9.36667 14.2139 8.2639 13.3083 7.35834C12.4028 6.45279 11.3 6.00001 10 6.00001H9.9L10.4667 6.56667C10.6 6.70001 10.6639 6.85556 10.6583 7.03334C10.6528 7.21112 10.5889 7.36667 10.4667 7.50001C10.3333 7.63334 10.175 7.70279 9.99167 7.70834C9.80833 7.7139 9.65 7.65001 9.51667 7.51667L7.8 5.80001C7.66667 5.66667 7.6 5.51112 7.6 5.33334C7.6 5.15556 7.66667 5.00001 7.8 4.86667L9.51667 3.15001C9.65 3.01667 9.80833 2.95279 9.99167 2.95834C10.175 2.9639 10.3333 3.03334 10.4667 3.16667C10.5889 3.30001 10.6528 3.45556 10.6583 3.63334C10.6639 3.81112 10.6 3.96667 10.4667 4.10001L9.9 4.66667H10C10.8333 4.66667 11.6139 4.82501 12.3417 5.14167C13.0694 5.45834 13.7028 5.88612 14.2417 6.42501C14.7806 6.9639 15.2083 7.59723 15.525 8.32501C15.8417 9.05279 16 9.83334 16 10.6667C16 11.5 15.8417 12.2806 15.525 13.0083C15.2083 13.7361 14.7806 14.3695 14.2417 14.9083C13.7028 15.4472 13.0694 15.875 12.3417 16.1917C11.6139 16.5083 10.8333 16.6667 10 16.6667Z",fill:"currentColor"})})]}),hv=e=>u.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("mask",{id:"mask0_1259_28",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1259_28)",children:u.jsx("path",{d:"M3 20.75L2.91345 19.4327L4.74998 17.6058V20.75H3ZM7.25003 20.75V15.1058L8.74998 13.6058V20.75H7.25003ZM11.25 20.75V13.6058L12.75 15.1308V20.75H11.25ZM15.25 20.75V15.1308L16.75 13.6308V20.75H15.25ZM19.25 20.75V11.1058L20.75 9.60583V20.75H19.25ZM3.25003 15.2192V13.1058L10 6.35581L14 10.3558L20.75 3.60583V5.71924L14 12.4692L10 8.46921L3.25003 15.2192Z",fill:"currentColor"})})]}),pv=async()=>{const e="/get_trends";return await pa.get(e)};function mv(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const gv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xv={};function Xc(e,t){return((t||xv).jsx?yv:gv).test(e)}const wv=/[ \t\n\f\r]/g;function bv(e){return typeof e=="object"?e.type==="text"?Kc(e.value):!1:Kc(e)}function Kc(e){return e.replace(wv,"")===""}class vi{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}vi.prototype.property={};vi.prototype.normal={};vi.prototype.space=null;function xh(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&Cv.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Jc,jv);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Jc.test(o)){let a=o.replace(Ev,Mv);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Za}return new i(r,t)}function Mv(e){return"-"+e.toLowerCase()}function jv(e){return e.charAt(1).toUpperCase()}const Tv={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Ov=xh([vh,bh,kh,Ch,Sv],"html"),qa=xh([vh,bh,kh,Ch,kv],"svg");function Av(e){return e.join(" ").trim()}var Eh={},eu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Dv=/\n/g,Iv=/^\s*/,Nv=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Lv=/^:\s*/,Rv=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,$v=/^[;\s]*/,zv=/^\s+|\s+$/g,Bv=` -`,tu="/",nu="*",qn="",Fv="comment",Hv="declaration",Yv=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var _=w.match(Dv);_&&(n+=_.length);var S=w.lastIndexOf(Bv);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(_){return _.position=new a(w),f(),_}}function a(w){this.start=w,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function l(w){var _=new Error(t.source+":"+n+":"+r+": "+w);if(_.reason=w,_.filename=t.source,_.line=n,_.column=r,_.source=e,!t.silent)throw _}function d(w){var _=w.exec(e);if(_){var S=_[0];return i(S),e=e.slice(S.length),_}}function f(){d(Iv)}function h(w){var _;for(w=w||[];_=p();)_!==!1&&w.push(_);return w}function p(){var w=o();if(!(tu!=e.charAt(0)||nu!=e.charAt(1))){for(var _=2;qn!=e.charAt(_)&&(nu!=e.charAt(_)||tu!=e.charAt(_+1));)++_;if(_+=2,qn===e.charAt(_-1))return l("End of comment missing");var S=e.slice(2,_-2);return r+=2,i(S),e=e.slice(_),r+=2,w({type:Fv,comment:S})}}function y(){var w=o(),_=d(Nv);if(_){if(p(),!d(Lv))return l("property missing ':'");var S=d(Rv),k=w({type:Hv,property:ru(_[0].replace(eu,qn)),value:S?ru(S[0].replace(eu,qn)):qn});return d($v),k}}function g(){var w=[];h(w);for(var _;_=y();)_!==!1&&(w.push(_),h(w));return w}return f(),g()};function ru(e){return e?e.replace(zv,qn):qn}var Vv=mt&&mt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Eh,"__esModule",{value:!0});var Uv=Vv(Yv);function Wv(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Uv.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var a=o.property,l=o.value;i?t(a,l,o):l&&(n=n||{},n[a]=l)}}),n}var iu=Eh.default=Wv;const Gv=iu.default||iu,Ph=Mh("end"),Xa=Mh("start");function Mh(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Zv(e){const t=Xa(e),n=Ph(e);if(t&&n)return{start:t,end:n}}function ii(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ou(e.position):"start"in e||"end"in e?ou(e):"line"in e||"column"in e?aa(e):""}function aa(e){return su(e&&e.line)+":"+su(e&&e.column)}function ou(e){return aa(e&&e.start)+"-"+aa(e&&e.end)}function su(e){return e&&typeof e=="number"?e:1}class gt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=l?l.line:void 0,this.name=ii(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}gt.prototype.file="";gt.prototype.name="";gt.prototype.reason="";gt.prototype.message="";gt.prototype.stack="";gt.prototype.column=void 0;gt.prototype.line=void 0;gt.prototype.ancestors=void 0;gt.prototype.cause=void 0;gt.prototype.fatal=void 0;gt.prototype.place=void 0;gt.prototype.ruleId=void 0;gt.prototype.source=void 0;const Ka={}.hasOwnProperty,qv=new Map,Xv=/[A-Z]/g,Kv=/-([a-z])/g,Qv=new Set(["table","tbody","thead","tfoot","tr"]),Jv=new Set(["td","th"]),jh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function e_(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=l_(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=a_(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qa:Ov,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Th(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Th(e,t,n){if(t.type==="element")return t_(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return n_(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return i_(e,t,n);if(t.type==="mdxjsEsm")return r_(e,t);if(t.type==="root")return o_(e,t,n);if(t.type==="text")return s_(e,t)}function t_(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qa,e.schema=i),e.ancestors.push(t);const o=Ah(e,t.tagName,!1),a=c_(e,t);let l=Ja(e,t);return Qv.has(t.tagName)&&(l=l.filter(function(d){return typeof d=="string"?!bv(d):!0})),Oh(e,a,o,t),Qa(a,l),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function n_(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}fi(e,t.position)}function r_(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fi(e,t.position)}function i_(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qa,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Ah(e,t.name,!0),a=u_(e,t),l=Ja(e,t);return Oh(e,a,o,t),Qa(a,l),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function o_(e,t,n){const r={};return Qa(r,Ja(e,t)),e.create(t,e.Fragment,r,n)}function s_(e,t){return t.value}function Oh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qa(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function a_(e,t,n){return r;function r(i,o,a,l){const f=Array.isArray(a.children)?n:t;return l?f(o,a,l):f(o,a)}}function l_(e,t){return n;function n(r,i,o,a){const l=Array.isArray(o.children),d=Xa(r);return t(i,o,a,l,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function c_(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Ka.call(t.properties,i)){const o=d_(e,i,t.properties[i]);if(o){const[a,l]=o;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&Jv.has(t.tagName)?r=l:n[a]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function u_(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else fi(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else fi(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Ja(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:qv;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(on(e,e.length,0,t),e):t}const cu={}.hasOwnProperty;function b_(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function vr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const S_=Bn(/\p{P}/u),rn=Bn(/[A-Za-z]/),Dt=Bn(/[\dA-Za-z]/),k_=Bn(/[#-'*+\--9=?A-Z^-~]/);function la(e){return e!==null&&(e<32||e===127)}const ca=Bn(/\d/),C_=Bn(/[\dA-Fa-f]/),Nh=Bn(/[!-/:-@[-`{-~]/);function xe(e){return e!==null&&e<-2}function Et(e){return e!==null&&(e<0||e===32)}function Re(e){return e===-2||e===-1||e===32}function E_(e){return Nh(e)||S_(e)}const P_=Bn(/\s/);function Bn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Tr(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(a=String.fromCharCode(o,l),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ge(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(d){return Re(d)?(e.enter(n),l(d)):t(d)}function l(d){return Re(d)&&o++a))return;const V=t.events.length;let U=V,W,q;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(W){q=t.events[U][1].end;break}W=!0}for(k(r),T=V;TP;){const R=n[O];t.containerState=R[1],R[0].exit.call(t,e)}n.length=P}function C(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function A_(e,t,n){return Ge(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function du(e){if(e===null||Et(e)||P_(e))return 1;if(E_(e))return 2}function tl(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p=Object.assign({},e[r][1].end),y=Object.assign({},e[n][1].start);fu(p,-d),fu(y,d),a={type:d>1?"strongSequence":"emphasisSequence",start:p,end:Object.assign({},e[r][1].end)},l={type:d>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:y},o={type:d>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:d>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},l.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},l.end),f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Rt(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Rt(f,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),f=Rt(f,tl(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Rt(f,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,f=Rt(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,on(e,r-1,n-r+3,f),n=r+f.length-h-2;break}}for(n=-1;++n0&&Re(T)?Ge(e,C,"linePrefix",o+1)(T):C(T)}function C(T){return T===null||xe(T)?e.check(hu,_,O)(T):(e.enter("codeFlowValue"),P(T))}function P(T){return T===null||xe(T)?(e.exit("codeFlowValue"),C(T)):(e.consume(T),P)}function O(T){return e.exit("codeFenced"),t(T)}function R(T,V,U){let W=0;return q;function q(L){return T.enter("lineEnding"),T.consume(L),T.exit("lineEnding"),$}function $(L){return T.enter("codeFencedFence"),Re(L)?Ge(T,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(L):H(L)}function H(L){return L===l?(T.enter("codeFencedFenceSequence"),B(L)):U(L)}function B(L){return L===l?(W++,T.consume(L),B):W>=a?(T.exit("codeFencedFenceSequence"),Re(L)?Ge(T,M,"whitespace")(L):M(L)):U(L)}function M(L){return L===null||xe(L)?(T.exit("codeFencedFence"),V(L)):U(L)}}}function V_(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ps={name:"codeIndented",tokenize:W_},U_={tokenize:G_,partial:!0};function W_(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Ge(e,o,"linePrefix",4+1)(f)}function o(f){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?d(f):xe(f)?e.attempt(U_,a,d)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||xe(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),l)}function d(f){return e.exit("codeIndented"),t(f)}}function G_(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):xe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Ge(e,o,"linePrefix",4+1)(a)}function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):xe(a)?i(a):n(a)}}const Z_={name:"codeText",tokenize:K_,resolve:q_,previous:X_};function q_(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Bh(e,t,n,r,i,o,a,l,d){const f=d||Number.POSITIVE_INFINITY;let h=0;return p;function p(k){return k===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(k),e.exit(o),y):k===null||k===32||k===41||la(k)?n(k):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),_(k))}function y(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===62?(e.exit("chunkString"),e.exit(l),y(k)):k===null||k===60||xe(k)?n(k):(e.consume(k),k===92?w:g)}function w(k){return k===60||k===62||k===92?(e.consume(k),g):g(k)}function _(k){return!h&&(k===null||k===41||Et(k))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(k)):h999||g===null||g===91||g===93&&!d||g===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):xe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===null||g===91||g===93||xe(g)||l++>999?(e.exit("chunkString"),h(g)):(e.consume(g),d||(d=!Re(g)),g===92?y:p)}function y(g){return g===91||g===92||g===93?(e.consume(g),l++,p):p(g)}}function Hh(e,t,n,r,i,o){let a;return l;function l(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),a=y===40?41:y,d):n(y)}function d(y){return y===a?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(o),f(y))}function f(y){return y===a?(e.exit(o),d(a)):y===null?n(y):xe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Ge(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===a||y===null||xe(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?p:h)}function p(y){return y===a||y===92?(e.consume(y),h):h(y)}}function oi(e,t){let n;return r;function r(i){return xe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Re(i)?Ge(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const iS={name:"definition",tokenize:sS},oS={tokenize:aS,partial:!0};function sS(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),a(g)}function a(g){return Fh.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function l(g){return i=vr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),d):n(g)}function d(g){return Et(g)?oi(e,f)(g):f(g)}function f(g){return Bh(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function h(g){return e.attempt(oS,p,p)(g)}function p(g){return Re(g)?Ge(e,y,"whitespace")(g):y(g)}function y(g){return g===null||xe(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function aS(e,t,n){return r;function r(l){return Et(l)?oi(e,i)(l):n(l)}function i(l){return Hh(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return Re(l)?Ge(e,a,"whitespace")(l):a(l)}function a(l){return l===null||xe(l)?t(l):n(l)}}const lS={name:"hardBreakEscape",tokenize:cS};function cS(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return xe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const uS={name:"headingAtx",tokenize:fS,resolve:dS};function dS(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},on(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function fS(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||Et(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),d(h)):h===null||xe(h)?(e.exit("atxHeading"),t(h)):Re(h)?Ge(e,l,"whitespace")(h):(e.enter("atxHeadingText"),f(h))}function d(h){return h===35?(e.consume(h),d):(e.exit("atxHeadingSequence"),l(h))}function f(h){return h===null||h===35||Et(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),f)}}const hS=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mu=["pre","script","style","textarea"],pS={name:"htmlFlow",tokenize:xS,resolveTo:yS,concrete:!0},mS={tokenize:bS,partial:!0},gS={tokenize:wS,partial:!0};function yS(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function xS(e,t,n){const r=this;let i,o,a,l,d;return f;function f(E){return h(E)}function h(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),p}function p(E){return E===33?(e.consume(E),y):E===47?(e.consume(E),o=!0,_):E===63?(e.consume(E),i=3,r.interrupt?t:v):rn(E)?(e.consume(E),a=String.fromCharCode(E),S):n(E)}function y(E){return E===45?(e.consume(E),i=2,g):E===91?(e.consume(E),i=5,l=0,w):rn(E)?(e.consume(E),i=4,r.interrupt?t:v):n(E)}function g(E){return E===45?(e.consume(E),r.interrupt?t:v):n(E)}function w(E){const ae="CDATA[";return E===ae.charCodeAt(l++)?(e.consume(E),l===ae.length?r.interrupt?t:H:w):n(E)}function _(E){return rn(E)?(e.consume(E),a=String.fromCharCode(E),S):n(E)}function S(E){if(E===null||E===47||E===62||Et(E)){const ae=E===47,J=a.toLowerCase();return!ae&&!o&&mu.includes(J)?(i=1,r.interrupt?t(E):H(E)):hS.includes(a.toLowerCase())?(i=6,ae?(e.consume(E),k):r.interrupt?t(E):H(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):o?C(E):P(E))}return E===45||Dt(E)?(e.consume(E),a+=String.fromCharCode(E),S):n(E)}function k(E){return E===62?(e.consume(E),r.interrupt?t:H):n(E)}function C(E){return Re(E)?(e.consume(E),C):q(E)}function P(E){return E===47?(e.consume(E),q):E===58||E===95||rn(E)?(e.consume(E),O):Re(E)?(e.consume(E),P):q(E)}function O(E){return E===45||E===46||E===58||E===95||Dt(E)?(e.consume(E),O):R(E)}function R(E){return E===61?(e.consume(E),T):Re(E)?(e.consume(E),R):P(E)}function T(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),d=E,V):Re(E)?(e.consume(E),T):U(E)}function V(E){return E===d?(e.consume(E),d=null,W):E===null||xe(E)?n(E):(e.consume(E),V)}function U(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Et(E)?R(E):(e.consume(E),U)}function W(E){return E===47||E===62||Re(E)?P(E):n(E)}function q(E){return E===62?(e.consume(E),$):n(E)}function $(E){return E===null||xe(E)?H(E):Re(E)?(e.consume(E),$):n(E)}function H(E){return E===45&&i===2?(e.consume(E),A):E===60&&i===1?(e.consume(E),G):E===62&&i===4?(e.consume(E),Q):E===63&&i===3?(e.consume(E),v):E===93&&i===5?(e.consume(E),F):xe(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(mS,ne,B)(E)):E===null||xe(E)?(e.exit("htmlFlowData"),B(E)):(e.consume(E),H)}function B(E){return e.check(gS,M,ne)(E)}function M(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),L}function L(E){return E===null||xe(E)?B(E):(e.enter("htmlFlowData"),H(E))}function A(E){return E===45?(e.consume(E),v):H(E)}function G(E){return E===47?(e.consume(E),a="",X):H(E)}function X(E){if(E===62){const ae=a.toLowerCase();return mu.includes(ae)?(e.consume(E),Q):H(E)}return rn(E)&&a.length<8?(e.consume(E),a+=String.fromCharCode(E),X):H(E)}function F(E){return E===93?(e.consume(E),v):H(E)}function v(E){return E===62?(e.consume(E),Q):E===45&&i===2?(e.consume(E),v):H(E)}function Q(E){return E===null||xe(E)?(e.exit("htmlFlowData"),ne(E)):(e.consume(E),Q)}function ne(E){return e.exit("htmlFlow"),t(E)}}function wS(e,t,n){const r=this;return i;function i(a){return xe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function bS(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ro,t,n)}}const vS={name:"htmlText",tokenize:_S};function _S(e,t,n){const r=this;let i,o,a;return l;function l(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),d}function d(v){return v===33?(e.consume(v),f):v===47?(e.consume(v),R):v===63?(e.consume(v),P):rn(v)?(e.consume(v),U):n(v)}function f(v){return v===45?(e.consume(v),h):v===91?(e.consume(v),o=0,w):rn(v)?(e.consume(v),C):n(v)}function h(v){return v===45?(e.consume(v),g):n(v)}function p(v){return v===null?n(v):v===45?(e.consume(v),y):xe(v)?(a=p,G(v)):(e.consume(v),p)}function y(v){return v===45?(e.consume(v),g):p(v)}function g(v){return v===62?A(v):v===45?y(v):p(v)}function w(v){const Q="CDATA[";return v===Q.charCodeAt(o++)?(e.consume(v),o===Q.length?_:w):n(v)}function _(v){return v===null?n(v):v===93?(e.consume(v),S):xe(v)?(a=_,G(v)):(e.consume(v),_)}function S(v){return v===93?(e.consume(v),k):_(v)}function k(v){return v===62?A(v):v===93?(e.consume(v),k):_(v)}function C(v){return v===null||v===62?A(v):xe(v)?(a=C,G(v)):(e.consume(v),C)}function P(v){return v===null?n(v):v===63?(e.consume(v),O):xe(v)?(a=P,G(v)):(e.consume(v),P)}function O(v){return v===62?A(v):P(v)}function R(v){return rn(v)?(e.consume(v),T):n(v)}function T(v){return v===45||Dt(v)?(e.consume(v),T):V(v)}function V(v){return xe(v)?(a=V,G(v)):Re(v)?(e.consume(v),V):A(v)}function U(v){return v===45||Dt(v)?(e.consume(v),U):v===47||v===62||Et(v)?W(v):n(v)}function W(v){return v===47?(e.consume(v),A):v===58||v===95||rn(v)?(e.consume(v),q):xe(v)?(a=W,G(v)):Re(v)?(e.consume(v),W):A(v)}function q(v){return v===45||v===46||v===58||v===95||Dt(v)?(e.consume(v),q):$(v)}function $(v){return v===61?(e.consume(v),H):xe(v)?(a=$,G(v)):Re(v)?(e.consume(v),$):W(v)}function H(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(e.consume(v),i=v,B):xe(v)?(a=H,G(v)):Re(v)?(e.consume(v),H):(e.consume(v),M)}function B(v){return v===i?(e.consume(v),i=void 0,L):v===null?n(v):xe(v)?(a=B,G(v)):(e.consume(v),B)}function M(v){return v===null||v===34||v===39||v===60||v===61||v===96?n(v):v===47||v===62||Et(v)?W(v):(e.consume(v),M)}function L(v){return v===47||v===62||Et(v)?W(v):n(v)}function A(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):n(v)}function G(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),X}function X(v){return Re(v)?Ge(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):F(v)}function F(v){return e.enter("htmlTextData"),a(v)}}const nl={name:"labelEnd",tokenize:MS,resolveTo:PS,resolveAll:ES},SS={tokenize:jS},kS={tokenize:TS},CS={tokenize:OS};function ES(e){let t=-1;for(;++t=3&&(f===null||xe(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Re(f)?Ge(e,l,"whitespace")(f):l(f))}}const Ct={name:"list",tokenize:BS,continuation:{tokenize:FS},exit:YS},$S={tokenize:VS,partial:!0},zS={tokenize:HS,partial:!0};function BS(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:ca(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(lo,n,f)(g):f(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(g)}return n(g)}function d(g){return ca(g)&&++a<10?(e.consume(g),d):(!r.interrupt||a<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),f(g)):n(g)}function f(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(Ro,r.interrupt?n:h,e.attempt($S,y,p))}function h(g){return r.containerState.initialBlankLine=!0,o++,y(g)}function p(g){return Re(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),y):n(g)}function y(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function FS(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ro,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ge(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!Re(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(zS,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ge(e,e.attempt(Ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function HS(e,t,n){const r=this;return Ge(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function YS(e){e.exit(this.containerState.type)}function VS(e,t,n){const r=this;return Ge(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const a=r.events[r.events.length-1];return!Re(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const gu={name:"setextUnderline",tokenize:WS,resolveTo:US};function US(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=a,e.push(["exit",a,t]),e}function WS(e,t,n){const r=this;let i;return o;function o(f){let h=r.events.length,p;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){p=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=f,a(f)):n(f)}function a(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===i?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),Re(f)?Ge(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||xe(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const GS={tokenize:ZS};function ZS(e){const t=this,n=e.attempt(Ro,r,e.attempt(this.parser.constructs.flowInitial,i,Ge(e,e.attempt(this.parser.constructs.flow,i,e.attempt(J_,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const qS={resolveAll:Vh()},XS=Yh("string"),KS=Yh("text");function Yh(e){return{tokenize:t,resolveAll:Vh(e==="text"?QS:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,l);return a;function a(h){return f(h)?o(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),d}function d(h){return f(h)?(n.exit("data"),o(h)):(n.consume(h),d)}function f(h){if(h===null)return!0;const p=i[h];let y=-1;if(p)for(;++y-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function tk(e,t){let n=-1;const r=[];let i;for(;++n({backgroundColor:N.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",right:"0px",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:N.white,[e.breakpoints.up("sm")]:{left:"100%"},"&:hover":{backgroundColor:N.BG1_HOVER},"&:active":{backgroundColor:N.BG1_PRESS,color:N.GRAY6}})),cv=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 18 18",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"chevron_right",children:[u.jsx("mask",{id:"mask0_1247_21809",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"18",height:"18",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1247_21809)",children:u.jsx("path",{id:"chevron_right_2",d:"M9.44998 8.99998L6.52498 6.07498C6.38748 5.93748 6.31873 5.76248 6.31873 5.54998C6.31873 5.33748 6.38748 5.16248 6.52498 5.02498C6.66248 4.88748 6.83748 4.81873 7.04998 4.81873C7.26248 4.81873 7.43748 4.88748 7.57498 5.02498L11.025 8.47498C11.1 8.54997 11.1531 8.63123 11.1844 8.71873C11.2156 8.80623 11.2312 8.89998 11.2312 8.99998C11.2312 9.09998 11.2156 9.19373 11.1844 9.28123C11.1531 9.36873 11.1 9.44998 11.025 9.52497L7.57498 12.975C7.43748 13.1125 7.26248 13.1812 7.04998 13.1812C6.83748 13.1812 6.66248 13.1125 6.52498 12.975C6.38748 12.8375 6.31873 12.6625 6.31873 12.45C6.31873 12.2375 6.38748 12.0625 6.52498 11.925L9.44998 8.99998Z",fill:"currentColor"})})]})}),uv=()=>{const e=vt(t=>t.setSidebarOpen);return u.jsx(dv,{onClick:()=>{e(!0)},children:u.jsx(cv,{})})},dv=Y(z).attrs({align:"center",justify:"center",p:8})(({theme:e})=>({backgroundColor:N.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:N.white,[e.breakpoints.up("sm")]:{left:"64px"},"&:hover":{backgroundColor:N.BG1_HOVER},"&:active":{backgroundColor:N.BG1_PRESS,color:N.GRAY6}})),fv=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 14 14",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsx("path",{d:"M4.24488 9.94873L3.51732 12.8382C3.48633 12.976 3.4201 13.0844 3.31861 13.1635C3.21711 13.2425 3.09318 13.2821 2.94682 13.2821C2.75237 13.2821 2.59319 13.2046 2.46928 13.0497C2.34535 12.8948 2.31009 12.7244 2.36351 12.5385L3.01094 9.94873H0.635943C0.427609 9.94873 0.260144 9.86913 0.133547 9.70995C0.00694957 9.55077 -0.0296407 9.37129 0.023776 9.1715C0.0600955 9.02514 0.134609 8.90975 0.247318 8.82535C0.360026 8.74096 0.489568 8.69877 0.635943 8.69877H3.32344L4.1728 5.30131H1.7978C1.58946 5.30131 1.422 5.22172 1.2954 5.06254C1.1688 4.90336 1.13221 4.72388 1.18563 4.5241C1.22195 4.37773 1.29646 4.26234 1.40917 4.17795C1.52188 4.09355 1.65142 4.05135 1.7978 4.05135H4.4853L5.21286 1.16191C5.24383 1.02409 5.31007 0.915657 5.41157 0.836601C5.51305 0.757546 5.63698 0.718018 5.78336 0.718018C5.97779 0.718018 6.13697 0.795469 6.2609 0.950372C6.38483 1.10529 6.42009 1.27569 6.36667 1.46158L5.71923 4.05135H9.16476L9.89232 1.16191C9.9233 1.02409 9.98954 0.915657 10.091 0.836601C10.1925 0.757546 10.3165 0.718018 10.4628 0.718018C10.6573 0.718018 10.8164 0.795469 10.9404 0.950372C11.0643 1.10529 11.0995 1.27569 11.0461 1.46158L10.3987 4.05135H12.7737C12.982 4.05135 13.1495 4.13094 13.2761 4.29012C13.4027 4.4493 13.4393 4.62879 13.3859 4.82858C13.3495 4.97494 13.275 5.09032 13.1623 5.17473C13.0496 5.25911 12.9201 5.30131 12.7737 5.30131H10.0862L9.23684 8.69877H11.6118C11.8202 8.69877 11.9876 8.77836 12.1142 8.93754C12.2408 9.09672 12.2774 9.2762 12.224 9.47598C12.1877 9.62235 12.1132 9.73773 12.0005 9.82212C11.8878 9.90652 11.7582 9.94873 11.6118 9.94873H8.92434L8.19678 12.8382C8.1658 12.976 8.09957 13.0844 7.99807 13.1635C7.89658 13.2425 7.77265 13.2821 7.62628 13.2821C7.43185 13.2821 7.27267 13.2046 7.14874 13.0497C7.0248 12.8948 6.98955 12.7244 7.04296 12.5385L7.6904 9.94873H4.24488ZM4.55738 8.69877H8.0029L8.85226 5.30131H5.40673L4.55738 8.69877Z",fill:"currentColor"})}),hv=e=>u.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("mask",{id:"mask0_5099_7163",maskUnits:"userSpaceOnUse",x:"2",y:"2",width:"16",height:"16",children:u.jsx("rect",{x:"2",y:"2",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_5099_7163)",children:u.jsx("path",{d:"M10 16.6667C9.16667 16.6667 8.38611 16.5083 7.65833 16.1917C6.93056 15.875 6.29722 15.4472 5.75833 14.9083C5.21944 14.3695 4.79167 13.7361 4.475 13.0083C4.15833 12.2806 4 11.5 4 10.6667C4 10.4778 4.06389 10.3195 4.19167 10.1917C4.31944 10.0639 4.47778 10 4.66667 10C4.85556 10 5.01389 10.0639 5.14167 10.1917C5.26944 10.3195 5.33333 10.4778 5.33333 10.6667C5.33333 11.9667 5.78611 13.0695 6.69167 13.975C7.59722 14.8806 8.7 15.3333 10 15.3333C11.3 15.3333 12.4028 14.8806 13.3083 13.975C14.2139 13.0695 14.6667 11.9667 14.6667 10.6667C14.6667 9.36667 14.2139 8.2639 13.3083 7.35834C12.4028 6.45279 11.3 6.00001 10 6.00001H9.9L10.4667 6.56667C10.6 6.70001 10.6639 6.85556 10.6583 7.03334C10.6528 7.21112 10.5889 7.36667 10.4667 7.50001C10.3333 7.63334 10.175 7.70279 9.99167 7.70834C9.80833 7.7139 9.65 7.65001 9.51667 7.51667L7.8 5.80001C7.66667 5.66667 7.6 5.51112 7.6 5.33334C7.6 5.15556 7.66667 5.00001 7.8 4.86667L9.51667 3.15001C9.65 3.01667 9.80833 2.95279 9.99167 2.95834C10.175 2.9639 10.3333 3.03334 10.4667 3.16667C10.5889 3.30001 10.6528 3.45556 10.6583 3.63334C10.6639 3.81112 10.6 3.96667 10.4667 4.10001L9.9 4.66667H10C10.8333 4.66667 11.6139 4.82501 12.3417 5.14167C13.0694 5.45834 13.7028 5.88612 14.2417 6.42501C14.7806 6.9639 15.2083 7.59723 15.525 8.32501C15.8417 9.05279 16 9.83334 16 10.6667C16 11.5 15.8417 12.2806 15.525 13.0083C15.2083 13.7361 14.7806 14.3695 14.2417 14.9083C13.7028 15.4472 13.0694 15.875 12.3417 16.1917C11.6139 16.5083 10.8333 16.6667 10 16.6667Z",fill:"currentColor"})})]}),pv=e=>u.jsxs("svg",{width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[u.jsx("mask",{id:"mask0_1259_28",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24",children:u.jsx("rect",{width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_1259_28)",children:u.jsx("path",{d:"M3 20.75L2.91345 19.4327L4.74998 17.6058V20.75H3ZM7.25003 20.75V15.1058L8.74998 13.6058V20.75H7.25003ZM11.25 20.75V13.6058L12.75 15.1308V20.75H11.25ZM15.25 20.75V15.1308L16.75 13.6308V20.75H15.25ZM19.25 20.75V11.1058L20.75 9.60583V20.75H19.25ZM3.25003 15.2192V13.1058L10 6.35581L14 10.3558L20.75 3.60583V5.71924L14 12.4692L10 8.46921L3.25003 15.2192Z",fill:"currentColor"})})]}),mv=async()=>{const e="/get_trends";return await pa.get(e)};function gv(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const yv=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xv=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wv={};function Xc(e,t){return((t||wv).jsx?xv:yv).test(e)}const bv=/[ \t\n\f\r]/g;function vv(e){return typeof e=="object"?e.type==="text"?Kc(e.value):!1:Kc(e)}function Kc(e){return e.replace(bv,"")===""}class vi{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}vi.prototype.property={};vi.prototype.normal={};vi.prototype.space=null;function xh(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&Ev.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Jc,Tv);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Jc.test(o)){let a=o.replace(Pv,jv);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=Za}return new i(r,t)}function jv(e){return"-"+e.toLowerCase()}function Tv(e){return e.charAt(1).toUpperCase()}const Ov={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Av=xh([vh,bh,kh,Ch,kv],"html"),qa=xh([vh,bh,kh,Ch,Cv],"svg");function Dv(e){return e.join(" ").trim()}var Eh={},eu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Iv=/\n/g,Nv=/^\s*/,Lv=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Rv=/^:\s*/,$v=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,zv=/^[;\s]*/,Bv=/^\s+|\s+$/g,Fv=` +`,tu="/",nu="*",qn="",Hv="comment",Yv="declaration",Vv=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(w){var _=w.match(Iv);_&&(n+=_.length);var S=w.lastIndexOf(Fv);r=~S?w.length-S:r+w.length}function o(){var w={line:n,column:r};return function(_){return _.position=new a(w),f(),_}}function a(w){this.start=w,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function l(w){var _=new Error(t.source+":"+n+":"+r+": "+w);if(_.reason=w,_.filename=t.source,_.line=n,_.column=r,_.source=e,!t.silent)throw _}function d(w){var _=w.exec(e);if(_){var S=_[0];return i(S),e=e.slice(S.length),_}}function f(){d(Nv)}function h(w){var _;for(w=w||[];_=p();)_!==!1&&w.push(_);return w}function p(){var w=o();if(!(tu!=e.charAt(0)||nu!=e.charAt(1))){for(var _=2;qn!=e.charAt(_)&&(nu!=e.charAt(_)||tu!=e.charAt(_+1));)++_;if(_+=2,qn===e.charAt(_-1))return l("End of comment missing");var S=e.slice(2,_-2);return r+=2,i(S),e=e.slice(_),r+=2,w({type:Hv,comment:S})}}function y(){var w=o(),_=d(Lv);if(_){if(p(),!d(Rv))return l("property missing ':'");var S=d($v),k=w({type:Yv,property:ru(_[0].replace(eu,qn)),value:S?ru(S[0].replace(eu,qn)):qn});return d(zv),k}}function g(){var w=[];h(w);for(var _;_=y();)_!==!1&&(w.push(_),h(w));return w}return f(),g()};function ru(e){return e?e.replace(Bv,qn):qn}var Uv=mt&&mt.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Eh,"__esModule",{value:!0});var Wv=Uv(Vv);function Gv(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,Wv.default)(e),i=typeof t=="function";return r.forEach(function(o){if(o.type==="declaration"){var a=o.property,l=o.value;i?t(a,l,o):l&&(n=n||{},n[a]=l)}}),n}var iu=Eh.default=Gv;const Zv=iu.default||iu,Ph=Mh("end"),Xa=Mh("start");function Mh(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function qv(e){const t=Xa(e),n=Ph(e);if(t&&n)return{start:t,end:n}}function ii(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?ou(e.position):"start"in e||"end"in e?ou(e):"line"in e||"column"in e?aa(e):""}function aa(e){return su(e&&e.line)+":"+su(e&&e.column)}function ou(e){return aa(e&&e.start)+"-"+aa(e&&e.end)}function su(e){return e&&typeof e=="number"?e:1}class gt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(a=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const l=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=l?l.line:void 0,this.name=ii(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual,this.expected,this.note,this.url}}gt.prototype.file="";gt.prototype.name="";gt.prototype.reason="";gt.prototype.message="";gt.prototype.stack="";gt.prototype.column=void 0;gt.prototype.line=void 0;gt.prototype.ancestors=void 0;gt.prototype.cause=void 0;gt.prototype.fatal=void 0;gt.prototype.place=void 0;gt.prototype.ruleId=void 0;gt.prototype.source=void 0;const Ka={}.hasOwnProperty,Xv=new Map,Kv=/[A-Z]/g,Qv=/-([a-z])/g,Jv=new Set(["table","tbody","thead","tfoot","tr"]),e_=new Set(["td","th"]),jh="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function t_(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=c_(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=l_(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?qa:Av,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Th(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Th(e,t,n){if(t.type==="element")return n_(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return r_(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return o_(e,t,n);if(t.type==="mdxjsEsm")return i_(e,t);if(t.type==="root")return s_(e,t,n);if(t.type==="text")return a_(e,t)}function n_(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=qa,e.schema=i),e.ancestors.push(t);const o=Ah(e,t.tagName,!1),a=u_(e,t);let l=Ja(e,t);return Jv.has(t.tagName)&&(l=l.filter(function(d){return typeof d=="string"?!vv(d):!0})),Oh(e,a,o,t),Qa(a,l),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function r_(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}fi(e,t.position)}function i_(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);fi(e,t.position)}function o_(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=qa,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Ah(e,t.name,!0),a=d_(e,t),l=Ja(e,t);return Oh(e,a,o,t),Qa(a,l),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function s_(e,t,n){const r={};return Qa(r,Ja(e,t)),e.create(t,e.Fragment,r,n)}function a_(e,t){return t.value}function Oh(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qa(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function l_(e,t,n){return r;function r(i,o,a,l){const f=Array.isArray(a.children)?n:t;return l?f(o,a,l):f(o,a)}}function c_(e,t){return n;function n(r,i,o,a){const l=Array.isArray(o.children),d=Xa(r);return t(i,o,a,l,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function u_(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Ka.call(t.properties,i)){const o=f_(e,i,t.properties[i]);if(o){const[a,l]=o;e.tableCellAlignToStyle&&a==="align"&&typeof l=="string"&&e_.has(t.tagName)?r=l:n[a]=l}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function d_(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const l=a.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else fi(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,o=e.evaluater.evaluateExpression(l.expression)}else fi(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function Ja(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:Xv;for(;++ri?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o0?(on(e,e.length,0,t),e):t}const cu={}.hasOwnProperty;function v_(e){const t={};let n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function vr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const k_=Bn(/\p{P}/u),rn=Bn(/[A-Za-z]/),Dt=Bn(/[\dA-Za-z]/),C_=Bn(/[#-'*+\--9=?A-Z^-~]/);function la(e){return e!==null&&(e<32||e===127)}const ca=Bn(/\d/),E_=Bn(/[\dA-Fa-f]/),Nh=Bn(/[!-/:-@[-`{-~]/);function xe(e){return e!==null&&e<-2}function Et(e){return e!==null&&(e<0||e===32)}function Re(e){return e===-2||e===-1||e===32}function P_(e){return Nh(e)||k_(e)}const M_=Bn(/\s/);function Bn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Tr(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&o<57344){const l=e.charCodeAt(n+1);o<56320&&l>56319&&l<57344?(a=String.fromCharCode(o,l),i=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+i+1,a=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Ge(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(d){return Re(d)?(e.enter(n),l(d)):t(d)}function l(d){return Re(d)&&o++a))return;const V=t.events.length;let U=V,W,q;for(;U--;)if(t.events[U][0]==="exit"&&t.events[U][1].type==="chunkFlow"){if(W){q=t.events[U][1].end;break}W=!0}for(k(r),T=V;TM;){const L=n[O];t.containerState=L[1],L[0].exit.call(t,e)}n.length=M}function C(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function D_(e,t,n){return Ge(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function du(e){if(e===null||Et(e)||M_(e))return 1;if(P_(e))return 2}function tl(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p=Object.assign({},e[r][1].end),y=Object.assign({},e[n][1].start);fu(p,-d),fu(y,d),a={type:d>1?"strongSequence":"emphasisSequence",start:p,end:Object.assign({},e[r][1].end)},l={type:d>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[n][1].start),end:y},o={type:d>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},i={type:d>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},l.end)},e[r][1].end=Object.assign({},a.start),e[n][1].start=Object.assign({},l.end),f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=Rt(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=Rt(f,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",o,t]]),f=Rt(f,tl(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=Rt(f,[["exit",o,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,f=Rt(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,on(e,r-1,n-r+3,f),n=r+f.length-h-2;break}}for(n=-1;++n0&&Re(T)?Ge(e,C,"linePrefix",o+1)(T):C(T)}function C(T){return T===null||xe(T)?e.check(hu,_,O)(T):(e.enter("codeFlowValue"),M(T))}function M(T){return T===null||xe(T)?(e.exit("codeFlowValue"),C(T)):(e.consume(T),M)}function O(T){return e.exit("codeFenced"),t(T)}function L(T,V,U){let W=0;return q;function q(R){return T.enter("lineEnding"),T.consume(R),T.exit("lineEnding"),$}function $(R){return T.enter("codeFencedFence"),Re(R)?Ge(T,H,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(R):H(R)}function H(R){return R===l?(T.enter("codeFencedFenceSequence"),B(R)):U(R)}function B(R){return R===l?(W++,T.consume(R),B):W>=a?(T.exit("codeFencedFenceSequence"),Re(R)?Ge(T,P,"whitespace")(R):P(R)):U(R)}function P(R){return R===null||xe(R)?(T.exit("codeFencedFence"),V(R)):U(R)}}}function U_(e,t,n){const r=this;return i;function i(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Ps={name:"codeIndented",tokenize:G_},W_={tokenize:Z_,partial:!0};function G_(e,t,n){const r=this;return i;function i(f){return e.enter("codeIndented"),Ge(e,o,"linePrefix",4+1)(f)}function o(f){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?d(f):xe(f)?e.attempt(W_,a,d)(f):(e.enter("codeFlowValue"),l(f))}function l(f){return f===null||xe(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),l)}function d(f){return e.exit("codeIndented"),t(f)}}function Z_(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):xe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Ge(e,o,"linePrefix",4+1)(a)}function o(a){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(a):xe(a)?i(a):n(a)}}const q_={name:"codeText",tokenize:Q_,resolve:X_,previous:K_};function X_(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function Bh(e,t,n,r,i,o,a,l,d){const f=d||Number.POSITIVE_INFINITY;let h=0;return p;function p(k){return k===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(k),e.exit(o),y):k===null||k===32||k===41||la(k)?n(k):(e.enter(r),e.enter(a),e.enter(l),e.enter("chunkString",{contentType:"string"}),_(k))}function y(k){return k===62?(e.enter(o),e.consume(k),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),g(k))}function g(k){return k===62?(e.exit("chunkString"),e.exit(l),y(k)):k===null||k===60||xe(k)?n(k):(e.consume(k),k===92?w:g)}function w(k){return k===60||k===62||k===92?(e.consume(k),g):g(k)}function _(k){return!h&&(k===null||k===41||Et(k))?(e.exit("chunkString"),e.exit(l),e.exit(a),e.exit(r),t(k)):h999||g===null||g===91||g===93&&!d||g===94&&!l&&"_hiddenFootnoteSupport"in a.parser.constructs?n(g):g===93?(e.exit(o),e.enter(i),e.consume(g),e.exit(i),e.exit(r),t):xe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),p(g))}function p(g){return g===null||g===91||g===93||xe(g)||l++>999?(e.exit("chunkString"),h(g)):(e.consume(g),d||(d=!Re(g)),g===92?y:p)}function y(g){return g===91||g===92||g===93?(e.consume(g),l++,p):p(g)}}function Hh(e,t,n,r,i,o){let a;return l;function l(y){return y===34||y===39||y===40?(e.enter(r),e.enter(i),e.consume(y),e.exit(i),a=y===40?41:y,d):n(y)}function d(y){return y===a?(e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):(e.enter(o),f(y))}function f(y){return y===a?(e.exit(o),d(a)):y===null?n(y):xe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Ge(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===a||y===null||xe(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?p:h)}function p(y){return y===a||y===92?(e.consume(y),h):h(y)}}function oi(e,t){let n;return r;function r(i){return xe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Re(i)?Ge(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const oS={name:"definition",tokenize:aS},sS={tokenize:lS,partial:!0};function aS(e,t,n){const r=this;let i;return o;function o(g){return e.enter("definition"),a(g)}function a(g){return Fh.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function l(g){return i=vr(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),d):n(g)}function d(g){return Et(g)?oi(e,f)(g):f(g)}function f(g){return Bh(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function h(g){return e.attempt(sS,p,p)(g)}function p(g){return Re(g)?Ge(e,y,"whitespace")(g):y(g)}function y(g){return g===null||xe(g)?(e.exit("definition"),r.parser.defined.push(i),t(g)):n(g)}}function lS(e,t,n){return r;function r(l){return Et(l)?oi(e,i)(l):n(l)}function i(l){return Hh(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function o(l){return Re(l)?Ge(e,a,"whitespace")(l):a(l)}function a(l){return l===null||xe(l)?t(l):n(l)}}const cS={name:"hardBreakEscape",tokenize:uS};function uS(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return xe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const dS={name:"headingAtx",tokenize:hS,resolve:fS};function fS(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},on(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function hS(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),o(h)}function o(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||Et(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),d(h)):h===null||xe(h)?(e.exit("atxHeading"),t(h)):Re(h)?Ge(e,l,"whitespace")(h):(e.enter("atxHeadingText"),f(h))}function d(h){return h===35?(e.consume(h),d):(e.exit("atxHeadingSequence"),l(h))}function f(h){return h===null||h===35||Et(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),f)}}const pS=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],mu=["pre","script","style","textarea"],mS={name:"htmlFlow",tokenize:wS,resolveTo:xS,concrete:!0},gS={tokenize:vS,partial:!0},yS={tokenize:bS,partial:!0};function xS(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function wS(e,t,n){const r=this;let i,o,a,l,d;return f;function f(E){return h(E)}function h(E){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(E),p}function p(E){return E===33?(e.consume(E),y):E===47?(e.consume(E),o=!0,_):E===63?(e.consume(E),i=3,r.interrupt?t:v):rn(E)?(e.consume(E),a=String.fromCharCode(E),S):n(E)}function y(E){return E===45?(e.consume(E),i=2,g):E===91?(e.consume(E),i=5,l=0,w):rn(E)?(e.consume(E),i=4,r.interrupt?t:v):n(E)}function g(E){return E===45?(e.consume(E),r.interrupt?t:v):n(E)}function w(E){const ae="CDATA[";return E===ae.charCodeAt(l++)?(e.consume(E),l===ae.length?r.interrupt?t:H:w):n(E)}function _(E){return rn(E)?(e.consume(E),a=String.fromCharCode(E),S):n(E)}function S(E){if(E===null||E===47||E===62||Et(E)){const ae=E===47,J=a.toLowerCase();return!ae&&!o&&mu.includes(J)?(i=1,r.interrupt?t(E):H(E)):pS.includes(a.toLowerCase())?(i=6,ae?(e.consume(E),k):r.interrupt?t(E):H(E)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(E):o?C(E):M(E))}return E===45||Dt(E)?(e.consume(E),a+=String.fromCharCode(E),S):n(E)}function k(E){return E===62?(e.consume(E),r.interrupt?t:H):n(E)}function C(E){return Re(E)?(e.consume(E),C):q(E)}function M(E){return E===47?(e.consume(E),q):E===58||E===95||rn(E)?(e.consume(E),O):Re(E)?(e.consume(E),M):q(E)}function O(E){return E===45||E===46||E===58||E===95||Dt(E)?(e.consume(E),O):L(E)}function L(E){return E===61?(e.consume(E),T):Re(E)?(e.consume(E),L):M(E)}function T(E){return E===null||E===60||E===61||E===62||E===96?n(E):E===34||E===39?(e.consume(E),d=E,V):Re(E)?(e.consume(E),T):U(E)}function V(E){return E===d?(e.consume(E),d=null,W):E===null||xe(E)?n(E):(e.consume(E),V)}function U(E){return E===null||E===34||E===39||E===47||E===60||E===61||E===62||E===96||Et(E)?L(E):(e.consume(E),U)}function W(E){return E===47||E===62||Re(E)?M(E):n(E)}function q(E){return E===62?(e.consume(E),$):n(E)}function $(E){return E===null||xe(E)?H(E):Re(E)?(e.consume(E),$):n(E)}function H(E){return E===45&&i===2?(e.consume(E),A):E===60&&i===1?(e.consume(E),G):E===62&&i===4?(e.consume(E),Q):E===63&&i===3?(e.consume(E),v):E===93&&i===5?(e.consume(E),F):xe(E)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(gS,ne,B)(E)):E===null||xe(E)?(e.exit("htmlFlowData"),B(E)):(e.consume(E),H)}function B(E){return e.check(yS,P,ne)(E)}function P(E){return e.enter("lineEnding"),e.consume(E),e.exit("lineEnding"),R}function R(E){return E===null||xe(E)?B(E):(e.enter("htmlFlowData"),H(E))}function A(E){return E===45?(e.consume(E),v):H(E)}function G(E){return E===47?(e.consume(E),a="",X):H(E)}function X(E){if(E===62){const ae=a.toLowerCase();return mu.includes(ae)?(e.consume(E),Q):H(E)}return rn(E)&&a.length<8?(e.consume(E),a+=String.fromCharCode(E),X):H(E)}function F(E){return E===93?(e.consume(E),v):H(E)}function v(E){return E===62?(e.consume(E),Q):E===45&&i===2?(e.consume(E),v):H(E)}function Q(E){return E===null||xe(E)?(e.exit("htmlFlowData"),ne(E)):(e.consume(E),Q)}function ne(E){return e.exit("htmlFlow"),t(E)}}function bS(e,t,n){const r=this;return i;function i(a){return xe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function vS(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ro,t,n)}}const _S={name:"htmlText",tokenize:SS};function SS(e,t,n){const r=this;let i,o,a;return l;function l(v){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(v),d}function d(v){return v===33?(e.consume(v),f):v===47?(e.consume(v),L):v===63?(e.consume(v),M):rn(v)?(e.consume(v),U):n(v)}function f(v){return v===45?(e.consume(v),h):v===91?(e.consume(v),o=0,w):rn(v)?(e.consume(v),C):n(v)}function h(v){return v===45?(e.consume(v),g):n(v)}function p(v){return v===null?n(v):v===45?(e.consume(v),y):xe(v)?(a=p,G(v)):(e.consume(v),p)}function y(v){return v===45?(e.consume(v),g):p(v)}function g(v){return v===62?A(v):v===45?y(v):p(v)}function w(v){const Q="CDATA[";return v===Q.charCodeAt(o++)?(e.consume(v),o===Q.length?_:w):n(v)}function _(v){return v===null?n(v):v===93?(e.consume(v),S):xe(v)?(a=_,G(v)):(e.consume(v),_)}function S(v){return v===93?(e.consume(v),k):_(v)}function k(v){return v===62?A(v):v===93?(e.consume(v),k):_(v)}function C(v){return v===null||v===62?A(v):xe(v)?(a=C,G(v)):(e.consume(v),C)}function M(v){return v===null?n(v):v===63?(e.consume(v),O):xe(v)?(a=M,G(v)):(e.consume(v),M)}function O(v){return v===62?A(v):M(v)}function L(v){return rn(v)?(e.consume(v),T):n(v)}function T(v){return v===45||Dt(v)?(e.consume(v),T):V(v)}function V(v){return xe(v)?(a=V,G(v)):Re(v)?(e.consume(v),V):A(v)}function U(v){return v===45||Dt(v)?(e.consume(v),U):v===47||v===62||Et(v)?W(v):n(v)}function W(v){return v===47?(e.consume(v),A):v===58||v===95||rn(v)?(e.consume(v),q):xe(v)?(a=W,G(v)):Re(v)?(e.consume(v),W):A(v)}function q(v){return v===45||v===46||v===58||v===95||Dt(v)?(e.consume(v),q):$(v)}function $(v){return v===61?(e.consume(v),H):xe(v)?(a=$,G(v)):Re(v)?(e.consume(v),$):W(v)}function H(v){return v===null||v===60||v===61||v===62||v===96?n(v):v===34||v===39?(e.consume(v),i=v,B):xe(v)?(a=H,G(v)):Re(v)?(e.consume(v),H):(e.consume(v),P)}function B(v){return v===i?(e.consume(v),i=void 0,R):v===null?n(v):xe(v)?(a=B,G(v)):(e.consume(v),B)}function P(v){return v===null||v===34||v===39||v===60||v===61||v===96?n(v):v===47||v===62||Et(v)?W(v):(e.consume(v),P)}function R(v){return v===47||v===62||Et(v)?W(v):n(v)}function A(v){return v===62?(e.consume(v),e.exit("htmlTextData"),e.exit("htmlText"),t):n(v)}function G(v){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),X}function X(v){return Re(v)?Ge(e,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(v):F(v)}function F(v){return e.enter("htmlTextData"),a(v)}}const nl={name:"labelEnd",tokenize:jS,resolveTo:MS,resolveAll:PS},kS={tokenize:TS},CS={tokenize:OS},ES={tokenize:AS};function PS(e){let t=-1;for(;++t=3&&(f===null||xe(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===i?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Re(f)?Ge(e,l,"whitespace")(f):l(f))}}const Ct={name:"list",tokenize:FS,continuation:{tokenize:HS},exit:VS},zS={tokenize:US,partial:!0},BS={tokenize:YS,partial:!0};function FS(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,a=0;return l;function l(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:ca(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(lo,n,f)(g):f(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(g)}return n(g)}function d(g){return ca(g)&&++a<10?(e.consume(g),d):(!r.interrupt||a<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),f(g)):n(g)}function f(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(Ro,r.interrupt?n:h,e.attempt(zS,y,p))}function h(g){return r.containerState.initialBlankLine=!0,o++,y(g)}function p(g){return Re(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),y):n(g)}function y(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function HS(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ro,i,o);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ge(e,t,"listItemIndent",r.containerState.size+1)(l)}function o(l){return r.containerState.furtherBlankLines||!Re(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(BS,t,a)(l))}function a(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ge(e,e.attempt(Ct,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function YS(e,t,n){const r=this;return Ge(e,i,"listItemIndent",r.containerState.size+1);function i(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function VS(e){e.exit(this.containerState.type)}function US(e,t,n){const r=this;return Ge(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(o){const a=r.events[r.events.length-1];return!Re(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const gu={name:"setextUnderline",tokenize:GS,resolveTo:WS};function WS(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:Object.assign({},e[i][1].start),end:Object.assign({},e[e.length-1][1].end)};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end=Object.assign({},e[o][1].end)):e[r][1]=a,e.push(["exit",a,t]),e}function GS(e,t,n){const r=this;let i;return o;function o(f){let h=r.events.length,p;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){p=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=f,a(f)):n(f)}function a(f){return e.enter("setextHeadingLineSequence"),l(f)}function l(f){return f===i?(e.consume(f),l):(e.exit("setextHeadingLineSequence"),Re(f)?Ge(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||xe(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const ZS={tokenize:qS};function qS(e){const t=this,n=e.attempt(Ro,r,e.attempt(this.parser.constructs.flowInitial,i,Ge(e,e.attempt(this.parser.constructs.flow,i,e.attempt(eS,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const XS={resolveAll:Vh()},KS=Yh("string"),QS=Yh("text");function Yh(e){return{tokenize:t,resolveAll:Vh(e==="text"?JS:void 0)};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,a,l);return a;function a(h){return f(h)?o(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),d}function d(h){return f(h)?(n.exit("data"),o(h)):(n.consume(h),d)}function f(h){if(h===null)return!0;const p=i[h];let y=-1;if(p)for(;++y-1){const l=a[0];typeof l=="string"?a[0]=l.slice(r):a.shift()}o>0&&a.push(e[i].slice(0,o))}return a}function nk(e,t){let n=-1;const r=[];let i;for(;++n0){const ye=te.tokenStack[te.tokenStack.length-1];(ye[1]||xu).call(te,void 0,ye[0])}for(Z.position={start:Mn(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:Mn(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},re=-1;++re1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function Mk(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function jk(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Gh(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Tk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gh(e,t);const i={src:Tr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Ok(e,t){const n={src:Tr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Ak(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Dk(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gh(e,t);const i={href:Tr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Ik(e,t){const n={href:Tr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Nk(e,t,n){const r=e.all(t),i=n?Lk(n):Zh(t),o={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let p;h&&h.type==="element"&&h.tagName==="p"?p=h:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l0){const ye=te.tokenStack[te.tokenStack.length-1];(ye[1]||xu).call(te,void 0,ye[0])}for(Z.position={start:Mn(D.length>0?D[0][1].start:{line:1,column:1,offset:0}),end:Mn(D.length>0?D[D.length-2][1].end:{line:1,column:1,offset:0})},re=-1;++re1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function jk(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Tk(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Gh(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),o=i[0];o&&o.type==="text"?o.value="["+o.value:i.unshift({type:"text",value:"["});const a=i[i.length-1];return a&&a.type==="text"?a.value+=r:i.push({type:"text",value:r}),i}function Ok(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gh(e,t);const i={src:Tr(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,o),e.applyData(t,o)}function Ak(e,t){const n={src:Tr(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function Dk(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function Ik(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Gh(e,t);const i={href:Tr(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const o={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function Nk(e,t){const n={href:Tr(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Lk(e,t,n){const r=e.all(t),i=n?Rk(n):Zh(t),o={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let p;h&&h.type==="element"&&h.tagName==="p"?p=h:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let l=-1;for(;++l1}function Rk(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Xa(t.children[1]),d=Ph(t.children[t.children.length-1]);l&&d&&(a.position={start:l,end:d}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Hk(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let d=-1;const f=[];for(;++d0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(vu(t.slice(i),i>0,!1)),o.join("")}function vu(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===wu||o===bu;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===wu||o===bu;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Uk(e,t){const n={type:"text",value:Vk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Wk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Gk={blockquote:_k,break:Sk,code:kk,delete:Ck,emphasis:Ek,footnoteReference:Pk,heading:Mk,html:jk,imageReference:Tk,image:Ok,inlineCode:Ak,linkReference:Dk,link:Ik,listItem:Nk,list:Rk,paragraph:$k,root:zk,strong:Bk,table:Fk,tableCell:Yk,tableRow:Hk,text:Uk,thematicBreak:Wk,toml:Qi,yaml:Qi,definition:Qi,footnoteDefinition:Qi};function Qi(){}const qh=-1,$o=0,bo=1,vo=2,rl=3,il=4,ol=5,sl=6,Xh=7,Kh=8,_u=typeof self=="object"?self:globalThis,Zk=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case $o:case qh:return n(a,i);case bo:{const l=n([],i);for(const d of a)l.push(r(d));return l}case vo:{const l=n({},i);for(const[d,f]of a)l[r(d)]=r(f);return l}case rl:return n(new Date(a),i);case il:{const{source:l,flags:d}=a;return n(new RegExp(l,d),i)}case ol:{const l=n(new Map,i);for(const[d,f]of a)l.set(r(d),r(f));return l}case sl:{const l=n(new Set,i);for(const d of a)l.add(r(d));return l}case Xh:{const{name:l,message:d}=a;return n(new _u[l](d),i)}case Kh:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new _u[o](a),i)};return r},Su=e=>Zk(new Map,e)(0),fr="",{toString:qk}={},{keys:Xk}=Object,Jr=e=>{const t=typeof e;if(t!=="object"||!e)return[$o,t];const n=qk.call(e).slice(8,-1);switch(n){case"Array":return[bo,fr];case"Object":return[vo,fr];case"Date":return[rl,fr];case"RegExp":return[il,fr];case"Map":return[ol,fr];case"Set":return[sl,fr]}return n.includes("Array")?[bo,n]:n.includes("Error")?[Xh,n]:[vo,n]},Ji=([e,t])=>e===$o&&(t==="function"||t==="symbol"),Kk=(e,t,n,r)=>{const i=(a,l)=>{const d=r.push(a)-1;return n.set(l,d),d},o=a=>{if(n.has(a))return n.get(a);let[l,d]=Jr(a);switch(l){case $o:{let h=a;switch(d){case"bigint":l=Kh,h=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);h=null;break;case"undefined":return i([qh],a)}return i([l,h],a)}case bo:{if(d)return i([d,[...a]],a);const h=[],p=i([l,h],a);for(const y of a)h.push(o(y));return p}case vo:{if(d)switch(d){case"BigInt":return i([d,a.toString()],a);case"Boolean":case"Number":case"String":return i([d,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const h=[],p=i([l,h],a);for(const y of Xk(a))(e||!Ji(Jr(a[y])))&&h.push([o(y),o(a[y])]);return p}case rl:return i([l,a.toISOString()],a);case il:{const{source:h,flags:p}=a;return i([l,{source:h,flags:p}],a)}case ol:{const h=[],p=i([l,h],a);for(const[y,g]of a)(e||!(Ji(Jr(y))||Ji(Jr(g))))&&h.push([o(y),o(g)]);return p}case sl:{const h=[],p=i([l,h],a);for(const y of a)(e||!Ji(Jr(y)))&&h.push(o(y));return p}}const{message:f}=a;return i([l,{name:d,message:f}],a)};return o},ku=(e,{json:t,lossy:n}={})=>{const r=[];return Kk(!(t||n),!!t,new Map,r)(e),r},_o=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Su(ku(e,t)):structuredClone(e):(e,t)=>Su(ku(e,t));function Qk(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Jk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function eC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Qk,r=e.options.footnoteBackLabel||Jk,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let d=-1;for(;++d0&&w.push({type:"text",value:" "});let C=typeof n=="string"?n:n(d,g);typeof C=="string"&&(C={type:"text",value:C}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,g),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const C=S.children[S.children.length-1];C&&C.type==="text"?C.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else h.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(h,!0)};e.patch(f,k),l.push(k)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{..._o(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` +`});const f={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,f),e.applyData(t,f)}function Rk(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r1}function $k(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Xa(t.children[1]),d=Ph(t.children[t.children.length-1]);l&&d&&(a.position={start:l,end:d}),i.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,o),e.applyData(t,o)}function Yk(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,l=a?a.length:t.children.length;let d=-1;const f=[];for(;++d0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return o.push(vu(t.slice(i),i>0,!1)),o.join("")}function vu(e,t,n){let r=0,i=e.length;if(t){let o=e.codePointAt(r);for(;o===wu||o===bu;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(i-1);for(;o===wu||o===bu;)i--,o=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Wk(e,t){const n={type:"text",value:Uk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Gk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Zk={blockquote:Sk,break:kk,code:Ck,delete:Ek,emphasis:Pk,footnoteReference:Mk,heading:jk,html:Tk,imageReference:Ok,image:Ak,inlineCode:Dk,linkReference:Ik,link:Nk,listItem:Lk,list:$k,paragraph:zk,root:Bk,strong:Fk,table:Hk,tableCell:Vk,tableRow:Yk,text:Wk,thematicBreak:Gk,toml:Qi,yaml:Qi,definition:Qi,footnoteDefinition:Qi};function Qi(){}const qh=-1,$o=0,bo=1,vo=2,rl=3,il=4,ol=5,sl=6,Xh=7,Kh=8,_u=typeof self=="object"?self:globalThis,qk=(e,t)=>{const n=(i,o)=>(e.set(o,i),i),r=i=>{if(e.has(i))return e.get(i);const[o,a]=t[i];switch(o){case $o:case qh:return n(a,i);case bo:{const l=n([],i);for(const d of a)l.push(r(d));return l}case vo:{const l=n({},i);for(const[d,f]of a)l[r(d)]=r(f);return l}case rl:return n(new Date(a),i);case il:{const{source:l,flags:d}=a;return n(new RegExp(l,d),i)}case ol:{const l=n(new Map,i);for(const[d,f]of a)l.set(r(d),r(f));return l}case sl:{const l=n(new Set,i);for(const d of a)l.add(r(d));return l}case Xh:{const{name:l,message:d}=a;return n(new _u[l](d),i)}case Kh:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new _u[o](a),i)};return r},Su=e=>qk(new Map,e)(0),fr="",{toString:Xk}={},{keys:Kk}=Object,Jr=e=>{const t=typeof e;if(t!=="object"||!e)return[$o,t];const n=Xk.call(e).slice(8,-1);switch(n){case"Array":return[bo,fr];case"Object":return[vo,fr];case"Date":return[rl,fr];case"RegExp":return[il,fr];case"Map":return[ol,fr];case"Set":return[sl,fr]}return n.includes("Array")?[bo,n]:n.includes("Error")?[Xh,n]:[vo,n]},Ji=([e,t])=>e===$o&&(t==="function"||t==="symbol"),Qk=(e,t,n,r)=>{const i=(a,l)=>{const d=r.push(a)-1;return n.set(l,d),d},o=a=>{if(n.has(a))return n.get(a);let[l,d]=Jr(a);switch(l){case $o:{let h=a;switch(d){case"bigint":l=Kh,h=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);h=null;break;case"undefined":return i([qh],a)}return i([l,h],a)}case bo:{if(d)return i([d,[...a]],a);const h=[],p=i([l,h],a);for(const y of a)h.push(o(y));return p}case vo:{if(d)switch(d){case"BigInt":return i([d,a.toString()],a);case"Boolean":case"Number":case"String":return i([d,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const h=[],p=i([l,h],a);for(const y of Kk(a))(e||!Ji(Jr(a[y])))&&h.push([o(y),o(a[y])]);return p}case rl:return i([l,a.toISOString()],a);case il:{const{source:h,flags:p}=a;return i([l,{source:h,flags:p}],a)}case ol:{const h=[],p=i([l,h],a);for(const[y,g]of a)(e||!(Ji(Jr(y))||Ji(Jr(g))))&&h.push([o(y),o(g)]);return p}case sl:{const h=[],p=i([l,h],a);for(const y of a)(e||!Ji(Jr(y)))&&h.push(o(y));return p}}const{message:f}=a;return i([l,{name:d,message:f}],a)};return o},ku=(e,{json:t,lossy:n}={})=>{const r=[];return Qk(!(t||n),!!t,new Map,r)(e),r},_o=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Su(ku(e,t)):structuredClone(e):(e,t)=>Su(ku(e,t));function Jk(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function eC(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function tC(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Jk,r=e.options.footnoteBackLabel||eC,i=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let d=-1;for(;++d0&&w.push({type:"text",value:" "});let C=typeof n=="string"?n:n(d,g);typeof C=="string"&&(C={type:"text",value:C}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,g),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const S=h[h.length-1];if(S&&S.type==="element"&&S.tagName==="p"){const C=S.children[S.children.length-1];C&&C.type==="text"?C.value+=" ":S.children.push({type:"text",value:" "}),S.children.push(...w)}else h.push(...w);const k={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(h,!0)};e.patch(f,k),l.push(k)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{..._o(a),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:` `},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:` -`}]}}const Qh=function(e){if(e==null)return iC;if(typeof e=="function")return zo(e);if(typeof e=="object")return Array.isArray(e)?tC(e):nC(e);if(typeof e=="string")return rC(e);throw new Error("Expected function, string, or object as test")};function tC(e){const t=[];let n=-1;for(;++n":""))+")"})}return y;function y(){let g=Jh,w,_,S;if((!t||o(d,f,h[h.length-1]||void 0))&&(g=cC(n(d,h)),g[0]===Cu))return g;if("children"in d&&d.children){const k=d;if(k.children&&g[0]!==aC)for(_=(r?k.children.length:-1)+a,S=h.concat(k);_>-1&&_":""))+")"})}return y;function y(){let g=Jh,w,_,S;if((!t||o(d,f,h[h.length-1]||void 0))&&(g=uC(n(d,h)),g[0]===Cu))return g;if("children"in d&&d.children){const k=d;if(k.children&&g[0]!==lC)for(_=(r?k.children.length:-1)+a,S=h.concat(k);_>-1&&_0&&n.push({type:"text",value:` -`}),n}function Eu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Pu(e,t){const n=dC(e,t),r=n.one(e,void 0),i=eC(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` -`},i),o}function gC(e,t){return e&&"run"in e?async function(n,r){const i=Pu(n,t);await e.run(i,r)}:function(n){return Pu(n,t||e)}}function Mu(e){if(e)throw e}var co=Object.prototype.hasOwnProperty,t1=Object.prototype.toString,ju=Object.defineProperty,Tu=Object.getOwnPropertyDescriptor,Ou=function(t){return typeof Array.isArray=="function"?Array.isArray(t):t1.call(t)==="[object Array]"},Au=function(t){if(!t||t1.call(t)!=="[object Object]")return!1;var n=co.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&co.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||co.call(t,i)},Du=function(t,n){ju&&n.name==="__proto__"?ju(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Iu=function(t,n){if(n==="__proto__")if(co.call(t,n)){if(Tu)return Tu(t,n).value}else return;return t[n]},yC=function e(){var t,n,r,i,o,a,l=arguments[0],d=1,f=arguments.length,h=!1;for(typeof l=="boolean"&&(h=l,l=arguments[1]||{},d=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});da.length;let d;l&&a.push(i);try{d=e.apply(this,a)}catch(f){const h=f;if(l&&n)throw h;return i(h)}l||(d instanceof Promise?d.then(o,i):d instanceof Error?i(d):o(d))}function i(a,...l){n||(n=!0,t(a,...l))}function o(a){i(null,a)}}const tn={basename:bC,dirname:vC,extname:_C,join:SC,sep:"/"};function bC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');_i(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function vC(e){if(_i(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function _C(e){_i(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function SC(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function CC(e,t){let n="",r=0,i=-1,o=0,a=-1,l,d;for(;++a<=e.length;){if(a2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else l===46&&o>-1?o++:o=-1}return n}function _i(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const EC={cwd:PC};function PC(){return"/"}function ha(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function MC(e){if(typeof e=="string")e=new URL(e);else if(!ha(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return jC(e)}function jC(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[g,...w]=h;const _=r[y][1];fa(_)&&fa(g)&&(g=js(!0,_,g)),r[y]=[f,g,...w]}}}}const DC=new al().freeze();function Ds(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Is(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ns(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Lu(e){if(!fa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ru(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function eo(e){return IC(e)?e:new n1(e)}function IC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function NC(e){return typeof e=="string"||LC(e)}function LC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const RC="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$u=[],zu={allowDangerousHtml:!0},$C=/^(https?|ircs?|mailto|xmpp)$/i,zC=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function BC(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,l=e.rehypePlugins||$u,d=e.remarkPlugins||$u,f=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...zu}:zu,h=e.skipHtml,p=e.unwrapDisallowed,y=e.urlTransform||FC,g=DC().use(vk).use(d).use(gC,f).use(l),w=new n1;typeof r=="string"&&(w.value=r);for(const C of zC)Object.hasOwn(e,C.from)&&(""+C.from+(C.to?"use `"+C.to+"` instead":"remove it")+RC+C.id,void 0);const _=g.parse(w);let S=g.runSync(_,w);return i&&(S={type:"element",tagName:"div",properties:{className:i},children:S.type==="root"?S.children:[S]}),e1(S,k),e_(S,{Fragment:u.Fragment,components:o,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function k(C,P,O){if(C.type==="raw"&&O&&typeof P=="number")return h?O.children.splice(P,1):O.children[P]={type:"text",value:C.value},P;if(C.type==="element"){let R;for(R in Es)if(Object.hasOwn(Es,R)&&Object.hasOwn(C.properties,R)){const T=C.properties[R],V=Es[R];(V===null||V.includes(C.tagName))&&(C.properties[R]=y(String(T||""),R,C))}}if(C.type==="element"){let R=t?!t.includes(C.tagName):a?a.includes(C.tagName):!1;if(!R&&n&&typeof P=="number"&&(R=!n(C,P,O)),R&&O&&typeof P=="number")return p&&C.children?O.children.splice(P,1,...C.children):O.children.splice(P,1),P}}}function FC(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||$C.test(e.slice(0,t))?e:""}const HC=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"brand_awareness",children:[u.jsx("mask",{id:"mask0_3696_4540",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_3696_4540)",children:u.jsx("path",{id:"brand_awareness_2",d:"M15.577 10.625H13.8142C13.6368 10.625 13.4883 10.5652 13.3687 10.4455C13.249 10.3259 13.1892 10.1774 13.1892 10C13.1892 9.82269 13.249 9.67419 13.3687 9.55454C13.4883 9.43489 13.6368 9.37506 13.8142 9.37506H15.577C15.7543 9.37506 15.9028 9.43489 16.0225 9.55454C16.1421 9.67419 16.202 9.82269 16.202 10C16.202 10.1774 16.1421 10.3259 16.0225 10.4455C15.9028 10.5652 15.7543 10.625 15.577 10.625ZM12.1106 13.9279C12.2175 13.7816 12.354 13.6972 12.5201 13.6747C12.6862 13.6523 12.8425 13.6945 12.9888 13.8013L14.3943 14.8574C14.5406 14.9642 14.625 15.1007 14.6475 15.2669C14.6699 15.433 14.6277 15.5892 14.5209 15.7356C14.4141 15.882 14.2776 15.9664 14.1114 15.9888C13.9453 16.0112 13.7891 15.969 13.6427 15.8622L12.2372 14.8061C12.0909 14.6993 12.0065 14.5628 11.9841 14.3967C11.9616 14.2305 12.0038 14.0743 12.1106 13.9279ZM14.3622 5.1106L12.9568 6.16671C12.8104 6.27354 12.6542 6.31574 12.488 6.29331C12.3219 6.27087 12.1854 6.18646 12.0786 6.0401C11.9718 5.89374 11.9296 5.7375 11.952 5.57137C11.9744 5.40525 12.0588 5.26876 12.2052 5.16192L13.6106 4.10583C13.757 3.999 13.9133 3.9568 14.0794 3.97923C14.2455 4.00166 14.382 4.08606 14.4888 4.23244C14.5957 4.3788 14.6379 4.53504 14.6154 4.70116C14.593 4.86729 14.5086 5.00377 14.3622 5.1106ZM6.05778 12.0834H3.71805C3.5033 12.0834 3.32408 12.0115 3.18039 11.8678C3.03669 11.7241 2.96484 11.5449 2.96484 11.3301V8.66994C2.96484 8.4552 3.03669 8.27599 3.18039 8.13229C3.32408 7.98858 3.5033 7.91673 3.71805 7.91673H6.05778L8.55134 5.42317C8.75114 5.22339 8.9811 5.17771 9.24124 5.28614C9.50138 5.39459 9.63145 5.5909 9.63145 5.87508V14.125C9.63145 14.4092 9.50138 14.6055 9.24124 14.7139C8.9811 14.8224 8.75114 14.7767 8.55134 14.5769L6.05778 12.0834Z",fill:"currentColor"})})]})}),YC=({trend:e,onClose:t,selectTrending:n})=>{var w,_;const[r,i]=j.useState(!1),{close:o}=Rs("briefDescription"),{currentPlayingAudio:a,setCurrentPlayingAudio:l}=vt(S=>S),d=j.useRef(null),f=()=>n(e.name),h=j.useCallback(()=>{t(),o()},[t,o]),p=()=>{d.current&&(r?d.current.pause():d.current.play(),i(!r))},y=()=>{var k,C,P;const S=!((k=a==null?void 0:a.current)!=null&&k.paused);S&&((C=a==null?void 0:a.current)==null||C.pause(),l(null)),(((P=a==null?void 0:a.current)==null?void 0:P.src)!==e.audio_EN||!S)&&p()};j.useEffect(()=>{const S=d.current,k=()=>{i(!1),l(null)};return S&&S.addEventListener("ended",k),()=>{S&&S.removeEventListener("ended",k)}},[l]);const g=((w=a==null?void 0:a.current)==null?void 0:w.src)===e.audio_EN&&!((_=a==null?void 0:a.current)!=null&&_.paused)||r;return u.jsxs(Ng,{"data-testid":"brief-description-modal",id:"briefDescription",kind:"regular",noWrap:!0,onClose:h,preventOutsideClose:!0,children:[e.audio_EN?u.jsxs(u.Fragment,{children:[u.jsxs(ZC,{children:[u.jsx(Bu,{className:In("default",{play:g}),onClick:y,size:"small",startIcon:g?u.jsx(Co,{}):u.jsx(HC,{}),children:g?"Pause":"Listen"}),u.jsx(Bu,{className:"default",onClick:f,size:"small",startIcon:u.jsx(Lg,{}),children:"Learn More"})]}),u.jsx(GC,{ref:d,src:e.audio_EN,children:u.jsx("track",{kind:"captions"})})]}):null,u.jsxs(z,{mt:75,children:[u.jsx(WC,{children:e.tldr_topic??e.name}),u.jsx(VC,{children:u.jsx(z,{children:u.jsx(UC,{children:e.tldr&&u.jsx(BC,{children:e.tldr})})})})]})]})},VC=Y.div` +`}),n}function Eu(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Pu(e,t){const n=fC(e,t),r=n.one(e,void 0),i=tC(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&o.children.push({type:"text",value:` +`},i),o}function yC(e,t){return e&&"run"in e?async function(n,r){const i=Pu(n,t);await e.run(i,r)}:function(n){return Pu(n,t||e)}}function Mu(e){if(e)throw e}var co=Object.prototype.hasOwnProperty,t1=Object.prototype.toString,ju=Object.defineProperty,Tu=Object.getOwnPropertyDescriptor,Ou=function(t){return typeof Array.isArray=="function"?Array.isArray(t):t1.call(t)==="[object Array]"},Au=function(t){if(!t||t1.call(t)!=="[object Object]")return!1;var n=co.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&co.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||co.call(t,i)},Du=function(t,n){ju&&n.name==="__proto__"?ju(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Iu=function(t,n){if(n==="__proto__")if(co.call(t,n)){if(Tu)return Tu(t,n).value}else return;return t[n]},xC=function e(){var t,n,r,i,o,a,l=arguments[0],d=1,f=arguments.length,h=!1;for(typeof l=="boolean"&&(h=l,l=arguments[1]||{},d=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});da.length;let d;l&&a.push(i);try{d=e.apply(this,a)}catch(f){const h=f;if(l&&n)throw h;return i(h)}l||(d instanceof Promise?d.then(o,i):d instanceof Error?i(d):o(d))}function i(a,...l){n||(n=!0,t(a,...l))}function o(a){i(null,a)}}const tn={basename:vC,dirname:_C,extname:SC,join:kC,sep:"/"};function vC(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');_i(e);let n=0,r=-1,i=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else r<0&&(o=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(o){n=i+1;break}}else a<0&&(o=!0,a=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function _C(e){if(_i(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function SC(e){_i(e);let t=e.length,n=-1,r=0,i=-1,o=0,a;for(;t--;){const l=e.codePointAt(t);if(l===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),l===46?i<0?i=t:o!==1&&(o=1):i>-1&&(o=-1)}return i<0||n<0||o===0||o===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function kC(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function EC(e,t){let n="",r=0,i=-1,o=0,a=-1,l,d;for(;++a<=e.length;){if(a2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),i=a,o=0;continue}}else if(n.length>0){n="",r=0,i=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),r=a-i-1;i=a,o=0}else l===46&&o>-1?o++:o=-1}return n}function _i(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const PC={cwd:MC};function MC(){return"/"}function ha(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function jC(e){if(typeof e=="string")e=new URL(e);else if(!ha(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return TC(e)}function TC(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n0){let[g,...w]=h;const _=r[y][1];fa(_)&&fa(g)&&(g=js(!0,_,g)),r[y]=[f,g,...w]}}}}const IC=new al().freeze();function Ds(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Is(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Ns(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Lu(e){if(!fa(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Ru(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function eo(e){return NC(e)?e:new n1(e)}function NC(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function LC(e){return typeof e=="string"||RC(e)}function RC(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $C="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",$u=[],zu={allowDangerousHtml:!0},zC=/^(https?|ircs?|mailto|xmpp)$/i,BC=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function FC(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,o=e.components,a=e.disallowedElements,l=e.rehypePlugins||$u,d=e.remarkPlugins||$u,f=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...zu}:zu,h=e.skipHtml,p=e.unwrapDisallowed,y=e.urlTransform||HC,g=IC().use(_k).use(d).use(yC,f).use(l),w=new n1;typeof r=="string"&&(w.value=r);for(const C of BC)Object.hasOwn(e,C.from)&&(""+C.from+(C.to?"use `"+C.to+"` instead":"remove it")+$C+C.id,void 0);const _=g.parse(w);let S=g.runSync(_,w);return i&&(S={type:"element",tagName:"div",properties:{className:i},children:S.type==="root"?S.children:[S]}),e1(S,k),t_(S,{Fragment:u.Fragment,components:o,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function k(C,M,O){if(C.type==="raw"&&O&&typeof M=="number")return h?O.children.splice(M,1):O.children[M]={type:"text",value:C.value},M;if(C.type==="element"){let L;for(L in Es)if(Object.hasOwn(Es,L)&&Object.hasOwn(C.properties,L)){const T=C.properties[L],V=Es[L];(V===null||V.includes(C.tagName))&&(C.properties[L]=y(String(T||""),L,C))}}if(C.type==="element"){let L=t?!t.includes(C.tagName):a?a.includes(C.tagName):!1;if(!L&&n&&typeof M=="number"&&(L=!n(C,M,O)),L&&O&&typeof M=="number")return p&&C.children?O.children.splice(M,1,...C.children):O.children.splice(M,1),M}}}function HC(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t<0||i>-1&&t>i||n>-1&&t>n||r>-1&&t>r||zC.test(e.slice(0,t))?e:""}const YC=e=>u.jsx("svg",{width:"1em",height:"1em",viewBox:"0 0 20 20",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:u.jsxs("g",{id:"brand_awareness",children:[u.jsx("mask",{id:"mask0_3696_4540",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"20",height:"20",children:u.jsx("rect",{id:"Bounding box",width:"1em",height:"1em",fill:"currentColor"})}),u.jsx("g",{mask:"url(#mask0_3696_4540)",children:u.jsx("path",{id:"brand_awareness_2",d:"M15.577 10.625H13.8142C13.6368 10.625 13.4883 10.5652 13.3687 10.4455C13.249 10.3259 13.1892 10.1774 13.1892 10C13.1892 9.82269 13.249 9.67419 13.3687 9.55454C13.4883 9.43489 13.6368 9.37506 13.8142 9.37506H15.577C15.7543 9.37506 15.9028 9.43489 16.0225 9.55454C16.1421 9.67419 16.202 9.82269 16.202 10C16.202 10.1774 16.1421 10.3259 16.0225 10.4455C15.9028 10.5652 15.7543 10.625 15.577 10.625ZM12.1106 13.9279C12.2175 13.7816 12.354 13.6972 12.5201 13.6747C12.6862 13.6523 12.8425 13.6945 12.9888 13.8013L14.3943 14.8574C14.5406 14.9642 14.625 15.1007 14.6475 15.2669C14.6699 15.433 14.6277 15.5892 14.5209 15.7356C14.4141 15.882 14.2776 15.9664 14.1114 15.9888C13.9453 16.0112 13.7891 15.969 13.6427 15.8622L12.2372 14.8061C12.0909 14.6993 12.0065 14.5628 11.9841 14.3967C11.9616 14.2305 12.0038 14.0743 12.1106 13.9279ZM14.3622 5.1106L12.9568 6.16671C12.8104 6.27354 12.6542 6.31574 12.488 6.29331C12.3219 6.27087 12.1854 6.18646 12.0786 6.0401C11.9718 5.89374 11.9296 5.7375 11.952 5.57137C11.9744 5.40525 12.0588 5.26876 12.2052 5.16192L13.6106 4.10583C13.757 3.999 13.9133 3.9568 14.0794 3.97923C14.2455 4.00166 14.382 4.08606 14.4888 4.23244C14.5957 4.3788 14.6379 4.53504 14.6154 4.70116C14.593 4.86729 14.5086 5.00377 14.3622 5.1106ZM6.05778 12.0834H3.71805C3.5033 12.0834 3.32408 12.0115 3.18039 11.8678C3.03669 11.7241 2.96484 11.5449 2.96484 11.3301V8.66994C2.96484 8.4552 3.03669 8.27599 3.18039 8.13229C3.32408 7.98858 3.5033 7.91673 3.71805 7.91673H6.05778L8.55134 5.42317C8.75114 5.22339 8.9811 5.17771 9.24124 5.28614C9.50138 5.39459 9.63145 5.5909 9.63145 5.87508V14.125C9.63145 14.4092 9.50138 14.6055 9.24124 14.7139C8.9811 14.8224 8.75114 14.7767 8.55134 14.5769L6.05778 12.0834Z",fill:"currentColor"})})]})}),VC=({trend:e,onClose:t,selectTrending:n})=>{var w,_;const[r,i]=j.useState(!1),{close:o}=Rs("briefDescription"),{currentPlayingAudio:a,setCurrentPlayingAudio:l}=vt(S=>S),d=j.useRef(null),f=()=>n(e.name),h=j.useCallback(()=>{t(),o()},[t,o]),p=()=>{d.current&&(r?d.current.pause():d.current.play(),i(!r))},y=()=>{var k,C,M;const S=!((k=a==null?void 0:a.current)!=null&&k.paused);S&&((C=a==null?void 0:a.current)==null||C.pause(),l(null)),(((M=a==null?void 0:a.current)==null?void 0:M.src)!==e.audio_EN||!S)&&p()};j.useEffect(()=>{const S=d.current,k=()=>{i(!1),l(null)};return S&&S.addEventListener("ended",k),()=>{S&&S.removeEventListener("ended",k)}},[l]);const g=((w=a==null?void 0:a.current)==null?void 0:w.src)===e.audio_EN&&!((_=a==null?void 0:a.current)!=null&&_.paused)||r;return u.jsxs(Ng,{"data-testid":"brief-description-modal",id:"briefDescription",kind:"regular",noWrap:!0,onClose:h,preventOutsideClose:!0,children:[e.audio_EN?u.jsxs(u.Fragment,{children:[u.jsxs(qC,{children:[u.jsx(Bu,{className:In("default",{play:g}),onClick:y,size:"small",startIcon:g?u.jsx(Co,{}):u.jsx(YC,{}),children:g?"Pause":"Listen"}),u.jsx(Bu,{className:"default",onClick:f,size:"small",startIcon:u.jsx(Lg,{}),children:"Learn More"})]}),u.jsx(ZC,{ref:d,src:e.audio_EN,children:u.jsx("track",{kind:"captions"})})]}):null,u.jsxs(z,{mt:75,children:[u.jsx(GC,{children:e.tldr_topic??e.name}),u.jsx(UC,{children:u.jsx(z,{children:u.jsx(WC,{children:e.tldr&&u.jsx(FC,{children:e.tldr})})})})]})]})},UC=Y.div` max-height: 310px; overflow-y: auto; margin: 8px 0; padding: 0 20px; -`,UC=Y(Fe)` +`,WC=Y(Fe)` font-size: 18px; font-weight: 400; font-family: 'Barlow'; * { all: revert; } -`,WC=Y(Fe)` +`,GC=Y(Fe)` font-weight: 600; font-size: 20px; padding: 0 20px; -`,GC=Y.audio` +`,ZC=Y.audio` display: none; `,Bu=Y(Pt)` && { @@ -1466,7 +1466,7 @@ ${({disabled:e})=>e&&Gu` } } } -`,ZC=Y(z)` +`,qC=Y(z)` top: 0px; position: absolute; border-radius: 16px 16px 0px 0px; @@ -1478,7 +1478,7 @@ ${({disabled:e})=>e&&Gu` align-items: center; background-color: ${N.BG3}; gap: 10px; -`,qC=["Drivechain","Ordinals","L402","Nostr","AI"],XC=({onSubmit:e})=>{var q;const{open:t}=Rs("addContent"),[n,r]=j.useState(!1),[i,o]=j.useState(!1),[a,l]=j.useState(null),d=j.useRef(null),[f,h]=j.useState(0),[p,y]=j.useState(!1),{currentPlayingAudio:g,setCurrentPlayingAudio:w}=vt($=>$),{open:_}=Rs("briefDescription"),{trendingTopics:S,setTrendingTopics:k}=zt($=>$),{setValue:C}=xa(),P=j.useCallback(async()=>{r(!0),o(!1),h(0),y(!1),w(null);try{const $=await pv();if($.length&&Array.isArray($)){const H=new Map($.map(M=>[M.name,M])),B=Array.from(H.values());k(B)}}catch{k(qC.map(H=>({name:H,count:0})))}finally{r(!1)}},[w,k]);j.useEffect(()=>{S.length||P()},[P,S.length]),j.useEffect(()=>{const $=setTimeout(()=>{o(!0)},5e3);return()=>clearTimeout($)},[o,n]);const O=$=>{C("search",$),e==null||e()},R=($,H)=>{$.stopPropagation(),$.currentTarget.blur(),H!=null&&H.tldr&&(l(H),_())},T=()=>{l(null)},V=$=>{$.stopPropagation(),$.currentTarget.blur(),y(!p),w(d)};j.useEffect(()=>{var $,H;p?($=d.current)==null||$.play():(H=d.current)==null||H.pause()},[f,p]),j.useEffect(()=>{g||y(!1)},[g]);const U=()=>{h($=>{var B,M;let H=($+1)%S.length;for(;H!==$&&!((B=S[H])!=null&&B.audio_EN);)H=(H+1)%S.length;return H===$?(y(!1),H):((M=d.current)==null||M.load(),H===0&&(y(!1),h(0)),H)}),w(d)},W=n?"Loading":"No new trending topics in the last 24 hours";return u.jsxs(QC,{"data-testid":"trending-component",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"heading-container",children:[u.jsxs("div",{className:"heading",children:[u.jsx("span",{className:"heading__title",children:"Trending Topics"}),u.jsx("span",{className:"heading__icon",children:n?u.jsx(va,{color:N.white,size:16}):u.jsx(u.Fragment,{children:i?u.jsx(eE,{onClick:P,size:"small",startIcon:u.jsx(fv,{})}):u.jsx(hv,{})})})]}),Py(S)?u.jsxs("div",{children:[u.jsx(Pt,{onClick:$=>V($),startIcon:p?u.jsx(Co,{}):u.jsx(ba,{}),children:p?"Pause":"Play All"}),u.jsx(rE,{ref:d,onEnded:U,src:(q=S[f])==null?void 0:q.audio_EN,children:u.jsx("track",{kind:"captions"})})]}):null]}),S.length===0?u.jsxs("div",{className:"trending-empty",children:[u.jsx(JC,{children:W}),u.jsx(Pt,{color:"secondary",disabled:n,onClick:t,size:"medium",startIcon:u.jsx(ya,{}),sx:{alignSelf:"flex-end",m:"0 36px 16px 0"},variant:"contained",children:"Add Content"})]}):u.jsx("ul",{className:"list",children:S.map(($,H)=>u.jsxs(z,{align:"center",className:"list-item",direction:"row",justify:"space-between",onClick:()=>O($.name),children:[u.jsxs(KC,{children:[u.jsx(nE,{children:u.jsx(dv,{})}),u.jsx("span",{className:"tldr",children:My($)})]}),$.tldr&&u.jsx(tE,{className:In({isPlaying:f===H&&p}),onClick:B=>R(B,$),children:"TLDR"})]},$.name))})]}),a&&u.jsx(YC,{onClose:T,selectTrending:O,trend:a})]})},KC=Y.div` +`,XC=["Drivechain","Ordinals","L402","Nostr","AI"],KC=({onSubmit:e})=>{var q;const{open:t}=Rs("addContent"),[n,r]=j.useState(!1),[i,o]=j.useState(!1),[a,l]=j.useState(null),d=j.useRef(null),[f,h]=j.useState(0),[p,y]=j.useState(!1),{currentPlayingAudio:g,setCurrentPlayingAudio:w}=vt($=>$),{open:_}=Rs("briefDescription"),{trendingTopics:S,setTrendingTopics:k}=zt($=>$),{setValue:C}=xa(),M=j.useCallback(async()=>{r(!0),o(!1),h(0),y(!1),w(null);try{const $=await mv();if($.length&&Array.isArray($)){const H=new Map($.map(P=>[P.name,P])),B=Array.from(H.values());k(B)}}catch{k(XC.map(H=>({name:H,count:0})))}finally{r(!1)}},[w,k]);j.useEffect(()=>{S.length||M()},[M,S.length]),j.useEffect(()=>{const $=setTimeout(()=>{o(!0)},5e3);return()=>clearTimeout($)},[o,n]);const O=$=>{C("search",$),e==null||e()},L=($,H)=>{$.stopPropagation(),$.currentTarget.blur(),H!=null&&H.tldr&&(l(H),_())},T=()=>{l(null)},V=$=>{$.stopPropagation(),$.currentTarget.blur(),y(!p),w(d)};j.useEffect(()=>{var $,H;p?($=d.current)==null||$.play():(H=d.current)==null||H.pause()},[f,p]),j.useEffect(()=>{g||y(!1)},[g]);const U=()=>{h($=>{var B,P;let H=($+1)%S.length;for(;H!==$&&!((B=S[H])!=null&&B.audio_EN);)H=(H+1)%S.length;return H===$?(y(!1),H):((P=d.current)==null||P.load(),H===0&&(y(!1),h(0)),H)}),w(d)},W=n?"Loading":"No new trending topics in the last 24 hours";return u.jsxs(JC,{"data-testid":"trending-component",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"heading-container",children:[u.jsxs("div",{className:"heading",children:[u.jsx("span",{className:"heading__title",children:"Trending Topics"}),u.jsx("span",{className:"heading__icon",children:n?u.jsx(va,{color:N.white,size:16}):u.jsx(u.Fragment,{children:i?u.jsx(tE,{onClick:M,size:"small",startIcon:u.jsx(hv,{})}):u.jsx(pv,{})})})]}),My(S)?u.jsxs("div",{children:[u.jsx(Pt,{onClick:$=>V($),startIcon:p?u.jsx(Co,{}):u.jsx(ba,{}),children:p?"Pause":"Play All"}),u.jsx(iE,{ref:d,onEnded:U,src:(q=S[f])==null?void 0:q.audio_EN,children:u.jsx("track",{kind:"captions"})})]}):null]}),S.length===0?u.jsxs("div",{className:"trending-empty",children:[u.jsx(eE,{children:W}),u.jsx(Pt,{color:"secondary",disabled:n,onClick:t,size:"medium",startIcon:u.jsx(ya,{}),sx:{alignSelf:"flex-end",m:"0 36px 16px 0"},variant:"contained",children:"Add Content"})]}):u.jsx("ul",{className:"list",children:S.map(($,H)=>u.jsxs(z,{align:"center",className:"list-item",direction:"row",justify:"space-between",onClick:()=>O($.name),children:[u.jsxs(QC,{children:[u.jsx(rE,{children:u.jsx(fv,{})}),u.jsx("span",{className:"tldr",children:jy($)})]}),$.tldr&&u.jsx(nE,{className:In({isPlaying:f===H&&p}),onClick:B=>L(B,$),children:"TLDR"})]},$.name))})]}),a&&u.jsx(VC,{onClose:T,selectTrending:O,trend:a})]})},QC=Y.div` display: flex; align-items: center; width: 300px; @@ -1492,7 +1492,7 @@ ${({disabled:e})=>e&&Gu` -webkit-box-orient: vertical; letter-spacing: 0.3pt; } -`,QC=Y(z)` +`,JC=Y(z)` .heading-container { display: flex; flex-direction: row; @@ -1547,10 +1547,10 @@ ${({disabled:e})=>e&&Gu` } } } -`,JC=Y.p` +`,eE=Y.p` color: ${N.GRAY6}; margin-bottom: 20px; -`,eE=Y(Pt)` +`,tE=Y(Pt)` && { min-width: 28px; width: 28px; @@ -1563,7 +1563,7 @@ ${({disabled:e})=>e&&Gu` align-items: center; } } -`,tE=Y(Pt)` +`,nE=Y(Pt)` && { &.isPlaying { font-weight: 700; @@ -1571,17 +1571,17 @@ ${({disabled:e})=>e&&Gu` background-color: ${N.white}; } } -`,nE=Y.span` +`,rE=Y.span` justify-content: center; align-items: center; color: ${N.GRAY6}; margin-right: 4px; -`,rE=Y.audio` +`,iE=Y.audio` height: 0; width: 0; -`,r1=390,iE=j.forwardRef(({onSubmit:e,subViewOpen:t},n)=>{const{isFetching:r,setSidebarFilter:i,setFilters:o}=zt(A=>A),{aiSummaryAnswers:a}=Zm(A=>A),l=pi(),d=Zu(),{setSidebarOpen:f,currentSearch:h,clearSearch:p,searchFormValue:y}=vt(A=>A),[g]=qm(A=>[A.trendingTopicsFeatureFlag]),{setValue:w,watch:_}=xa(),S=j.useRef(null),[k,C]=j.useState(!1),[P,O]=j.useState(!1),[R,T]=j.useState(null),[V,U]=j.useState([]),[W,q]=j.useState([]),[$,H]=j.useState(!1);j.useEffect(()=>{w("search",y)},[w,y]),j.useEffect(()=>{const A=S.current;if(!A)return;const G=()=>{C((A==null?void 0:A.scrollTop)>0)};A.addEventListener("scroll",G)},[]);const B=_("search");j.useEffect(()=>{(async()=>{try{const G=await Xm();U(G.schemas.filter(X=>!X.is_deleted))}catch(G){console.error("Error fetching schema:",G)}})()},[]);const M=A=>{T(P?null:A.currentTarget),O(G=>!G),H(!1)},L=()=>{o({node_type:W})};return u.jsxs(sE,{ref:n,id:"sidebar-wrapper",children:[u.jsx(fE,{}),u.jsxs(o1,{className:In({"has-shadow":k}),children:[u.jsxs(pE,{children:[u.jsxs(aE,{children:[u.jsx(yd,{onSubmit:e}),u.jsx(cE,{"data-testid":"search_action_icon",onClick:()=>{if(h){w("search",""),p(),i("all"),l(null);return}B.trim()!==""&&(e==null||e())},children:r?u.jsx(va,{color:N.SECONDARY_BLUE,"data-testid":"loader",size:"20"}):u.jsx(u.Fragment,{children:h!=null&&h.trim()?u.jsx(nd,{}):u.jsx(rd,{})})})]}),u.jsx(mE,{"data-testid":"search_filter_icon",isFilterOpen:P,onClick:M,children:P?u.jsx(Px,{}):u.jsx(Mx,{})}),u.jsx(dx,{anchorEl:R,handleApply:L,schemaAll:V,selectedTypes:W,setSelectedTypes:q,setShowAllSchemas:H,showAllSchemas:$})]}),h&&u.jsx(lE,{children:r?u.jsx(Tx,{}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"left",children:[u.jsx("span",{className:"count",children:d.length}),u.jsx("span",{className:"label",children:" results"})]}),u.jsx("div",{className:"right",style:{alignItems:"center"},children:u.jsx(ax,{})})]})})]}),!t&&u.jsx(uE,{onClick:()=>{f(!1)},children:u.jsx(gd,{})}),u.jsxs(dE,{ref:S,children:[!h&&g&&u.jsx(hE,{children:u.jsx(XC,{onSubmit:e})}),u.jsxs(z,{children:[Object.keys(a).map(A=>u.jsx(C2,{question:A,response:a[A]},A)),r?u.jsx(Fs,{}):u.jsx(D2,{isSearchResult:!!h})]})]}),Ls.isEmpty(a)?null:u.jsx(Ax,{})]})}),oE=["topic","person","guest","event","organization","place","project","software"],i1=({onSubmit:e})=>{const{sidebarIsOpen:t}=vt(o=>o),n=_t(),r=!!n&&t&&!oE.includes(n.node_type),{showTeachMe:i}=zt(o=>o);return u.jsxs(u.Fragment,{children:[u.jsx(wa,{direction:"right",in:t,mountOnEnter:!0,unmountOnExit:!0,children:u.jsx(iE,{onSubmit:e,subViewOpen:r})}),u.jsx(rv,{open:r||!!i}),!t&&u.jsx(cv,{})]})},sE=Y(z)(({theme:e})=>({position:"relative",background:N.BG1,height:"100vh",width:"100%",zIndex:30,[e.breakpoints.up("sm")]:{width:r1}})),o1=Y(z).attrs({direction:"column",justify:"center",align:"stretch"})(({theme:e})=>({padding:e.spacing(3.75,2),[e.breakpoints.up("sm")]:{padding:"12px"},"&.has-shadow":{borderBottom:"1px solid rgba(0, 0, 0, 0.25)",background:N.BG1,boxShadow:"0px 1px 6px 0px rgba(0, 0, 0, 0.20)"}})),aE=Y(z).attrs({direction:"row",justify:"center",align:"center"})` +`,r1=390,oE=j.forwardRef(({onSubmit:e,subViewOpen:t},n)=>{const{isFetching:r,setSidebarFilter:i,setFilters:o}=zt(A=>A),[a,l]=Rg(A=>[A.schemas,A.setSchemas]),{aiSummaryAnswers:d}=Zm(A=>A),f=pi(),h=Zu(),{setSidebarOpen:p,currentSearch:y,clearSearch:g,searchFormValue:w}=vt(A=>A),[_]=qm(A=>[A.trendingTopicsFeatureFlag]),{setValue:S,watch:k}=xa(),C=j.useRef(null),[M,O]=j.useState(!1),[L,T]=j.useState(!1),[V,U]=j.useState(null),[W,q]=j.useState([]),[$,H]=j.useState(!1);j.useEffect(()=>{S("search",w)},[S,w]),j.useEffect(()=>{const A=C.current;if(!A)return;const G=()=>{O((A==null?void 0:A.scrollTop)>0)};A.addEventListener("scroll",G)},[]);const B=k("search");j.useEffect(()=>{(async()=>{try{const G=await Xm();l(G.schemas.filter(X=>!X.is_deleted))}catch(G){console.error("Error fetching schema:",G)}})()},[l]);const P=A=>{U(L?null:A.currentTarget),T(G=>!G),H(!1)},R=()=>{o({node_type:W})};return u.jsxs(aE,{ref:n,id:"sidebar-wrapper",children:[u.jsx(hE,{}),u.jsxs(o1,{className:In({"has-shadow":M}),children:[u.jsxs(mE,{children:[u.jsxs(lE,{children:[u.jsx(yd,{onSubmit:e}),u.jsx(uE,{"data-testid":"search_action_icon",onClick:()=>{if(y){S("search",""),g(),i("all"),f(null);return}B.trim()!==""&&(e==null||e())},children:r?u.jsx(va,{color:N.SECONDARY_BLUE,"data-testid":"loader",size:"20"}):u.jsx(u.Fragment,{children:y!=null&&y.trim()?u.jsx(nd,{}):u.jsx(rd,{})})})]}),u.jsx(gE,{"data-testid":"search_filter_icon",isFilterOpen:L,onClick:P,children:L?u.jsx(Mx,{}):u.jsx(jx,{})}),u.jsx(fx,{anchorEl:V,handleApply:R,schemaAll:a,selectedTypes:W,setSelectedTypes:q,setShowAllSchemas:H,showAllSchemas:$})]}),y&&u.jsx(cE,{children:r?u.jsx(Ox,{}):u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"left",children:[u.jsx("span",{className:"count",children:h.length}),u.jsx("span",{className:"label",children:" results"})]}),u.jsx("div",{className:"right",style:{alignItems:"center"},children:u.jsx(lx,{})})]})})]}),!t&&u.jsx(dE,{onClick:()=>{p(!1)},children:u.jsx(gd,{})}),u.jsxs(fE,{ref:C,children:[!y&&_&&u.jsx(pE,{children:u.jsx(KC,{onSubmit:e})}),u.jsxs(z,{children:[Object.keys(d).map(A=>u.jsx(E2,{question:A,response:d[A]},A)),r?u.jsx(Fs,{}):u.jsx(I2,{isSearchResult:!!y})]})]}),Ls.isEmpty(d)?null:u.jsx(Dx,{})]})}),sE=["topic","person","guest","event","organization","place","project","software"],i1=({onSubmit:e})=>{const{sidebarIsOpen:t}=vt(o=>o),n=_t(),r=!!n&&t&&!sE.includes(n.node_type),{showTeachMe:i}=zt(o=>o);return u.jsxs(u.Fragment,{children:[u.jsx(wa,{direction:"right",in:t,mountOnEnter:!0,unmountOnExit:!0,children:u.jsx(oE,{onSubmit:e,subViewOpen:r})}),u.jsx(iv,{open:r||!!i}),!t&&u.jsx(uv,{})]})},aE=Y(z)(({theme:e})=>({position:"relative",background:N.BG1,height:"100vh",width:"100%",zIndex:30,[e.breakpoints.up("sm")]:{width:r1}})),o1=Y(z).attrs({direction:"column",justify:"center",align:"stretch"})(({theme:e})=>({padding:e.spacing(3.75,2),[e.breakpoints.up("sm")]:{padding:"12px"},"&.has-shadow":{borderBottom:"1px solid rgba(0, 0, 0, 0.25)",background:N.BG1,boxShadow:"0px 1px 6px 0px rgba(0, 0, 0, 0.20)"}})),lE=Y(z).attrs({direction:"row",justify:"center",align:"center"})` flex-grow: 1; -`,lE=Y(z).attrs({direction:"row",justify:"space-between",align:"center"})` +`,cE=Y(z).attrs({direction:"row",justify:"space-between",align:"center"})` flex-grow: 1; color: ${N.GRAY6}; font-family: Barlow; @@ -1598,7 +1598,7 @@ ${({disabled:e})=>e&&Gu` .right { display: flex; } -`,cE=Y(z).attrs({align:"center",justify:"center",p:5})` +`,uE=Y(z).attrs({align:"center",justify:"center",p:5})` font-size: 32px; color: ${N.mainBottomIcons}; cursor: pointer; @@ -1613,19 +1613,19 @@ ${({disabled:e})=>e&&Gu` ${o1} input:focus + & { color: ${N.primaryBlue}; } -`,uE=Y(z).attrs({align:"center",justify:"center",p:8})(({theme:e})=>({backgroundColor:N.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",right:"0px",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:N.white,[e.breakpoints.up("sm")]:{left:"100%"},"&:hover":{backgroundColor:N.BG1_HOVER},"&:active":{backgroundColor:N.BG1_PRESS,color:N.GRAY6}})),dE=Y(z)(()=>({overflow:"auto",flex:1,width:"100%"})),fE=Y(z)` +`,dE=Y(z).attrs({align:"center",justify:"center",p:8})(({theme:e})=>({backgroundColor:N.BG1_NORMAL,cursor:"pointer",transitionDuration:"0.2s",position:"absolute",right:"0px",top:"50%",zIndex:1,width:"24px",height:"48px",transform:"translateY(-50%)",borderRadius:"0px 6px 6px 0px",boxShadow:"2px 0px 6px 0px rgba(0, 0, 0, 0.25) inset",color:N.white,[e.breakpoints.up("sm")]:{left:"100%"},"&:hover":{backgroundColor:N.BG1_HOVER},"&:active":{backgroundColor:N.BG1_PRESS,color:N.GRAY6}})),fE=Y(z)(()=>({overflow:"auto",flex:1,width:"100%"})),hE=Y(z)` height: 64px; background: ${N.BG2}; -`,hE=Y(z)` +`,pE=Y(z)` padding: 0; margin-bottom: 36px; margin-top: 20px; -`,pE=Y(z)` +`,mE=Y(z)` align-items: center; justify-content: space-between; flex-direction: row; gap: 10px; -`,mE=Y.div` +`,gE=Y.div` display: flex; align-items: center; justify-content: center; @@ -1646,4 +1646,4 @@ ${({disabled:e})=>e&&Gu` color: ${({isFilterOpen:e})=>e?N.black:N.GRAY7}; fill: none; } -`;i1.displayName="Sidebar";const wE=Object.freeze(Object.defineProperty({__proto__:null,MENU_WIDTH:r1,SideBar:i1},Symbol.toStringTag,{value:"Module"}));export{wE as i,wb as p,Do as u}; +`;i1.displayName="Sidebar";const bE=Object.freeze(Object.defineProperty({__proto__:null,MENU_WIDTH:r1,SideBar:i1},Symbol.toStringTag,{value:"Module"}));export{bE as i,bb as p,Do as u}; diff --git a/build/assets/index-1d3b431c.js b/build/assets/index-b3368bcf.js similarity index 77% rename from build/assets/index-1d3b431c.js rename to build/assets/index-b3368bcf.js index 980618a67..46f838d32 100644 --- a/build/assets/index-1d3b431c.js +++ b/build/assets/index-b3368bcf.js @@ -1,4 +1,4 @@ -import{bu as C,ac as v,ab as b,bv as I,aa as E,bw as U,bx as D,Q as x,S as l,N as G,r as p,j as e,U as n,by as K,a5 as y,bz as Q,ar as X,ad as ee,bA as f,aw as te,ag as se,bB as ne,ay as oe,ax as re,az as ie,b0 as ae}from"./index-0cb90706.js";import{B as w,aE as ce,aa as le,aM as de,aJ as B,ae as ue,aF as xe,af as ge}from"./index-7a7c9631.js";import{S as pe}from"./index-7623b989.js";const R=/\b(?:twitter\.com|x\.com)\/(?:@)?([\w_]+)(?:$|\?[^/]*$)/,he=/(https?:\/\/)?(www\.)?youtube\.com\/watch\?v=([A-Za-z0-9_-]+)/,fe=/(https?:\/\/)?(www\.)?youtube\.com\/live\/([A-Za-z0-9_-]+)/,we=/(https?:\/\/)?(www\.)?youtu\.be\/([A-Za-z0-9_-]+)/,me=/https:\/\/twitter\.com\/i\/spaces\/([A-Za-z0-9_-]+)/,be=/https:\/\/(twitter\.com|x\.com)\/[^/]+\/status\/(\d+)/,ye=/(https?:\/\/)?([A-Za-z0-9_-]+)\.mp3/,je=/(https?:\/\/)?(.*\.)?.+\/(feed|rss|rss.xml|.*.rss|.*\?(feed|format)=rss)$/,Se=/https?:\/\/(www\.)?youtube\.com\/(user\/)?(@)?([\w-]+)/,ve=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/,Ee=/https:\/\/twitter\.com\/i\/broadcasts\/([A-Za-z0-9_-]+)/;function _e(t){return[fe,Ee,he,we,me,ye].some(r=>r.test(t))?C:Se.test(t)?v:R.test(t)?b:be.test(t)?I:je.test(t)?E:ve.test(t)?U:D}const $e=(t,s="")=>{const a=(s===b?R:/@(\w+)/).exec(t);return a?a[1]:null},A=t=>!!t&&[b,v,E].includes(t),ze=({onClick:t,loading:s,type:r,error:a})=>{const o=G(u=>u.budget),[g,d]=p.useState(10),i=A(r)?"radar":"add_node";return p.useEffect(()=>{(async()=>{try{const c=await Q(i);d(c.data.price)}catch(c){console.error("cannot fetch",c)}})()},[i]),e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(Ce,{children:"Approve Cost"})})}),e.jsxs(n,{align:"center",direction:"row",justify:"space-between",mb:20,children:[e.jsxs(ke,{children:[e.jsx("div",{className:"title",children:"COST"}),e.jsxs("div",{className:"value","data-testid":"check-price",children:[g," sats"]})]}),e.jsxs(Be,{children:[e.jsx("div",{className:"title",children:"BUDGET"}),e.jsxs("div",{className:"value",children:[K(o)," sats"]})]})]}),e.jsx(n,{children:e.jsx(w,{color:"secondary","data-testid":"check-icon",disabled:s||!!a,onClick:t,size:"large",startIcon:s?e.jsx(P,{children:e.jsx(ce,{color:l.lightGray,size:12})}):e.jsxs(P,{children:[" ",e.jsx(le,{})]}),type:"submit",variant:"contained",children:"Approve"})}),a?e.jsx(Ae,{children:e.jsxs(Re,{children:[e.jsx(de,{className:"errorIcon"}),e.jsx("span",{children:a})]})}):null]})},ke=x(n).attrs({direction:"column",align:"space-between",justify:"flex-start"})` +import{bu as C,ac as v,ab as b,bv as I,aa as _,bw as U,bx as G,Q as x,S as l,N as D,r as p,j as e,U as n,by as J,a5 as y,bz as Q,ar as X,ad as ee,bA as f,aw as te,ag as se,bB as ne,ay as oe,ax as re,az as ie,b0 as ae}from"./index-ead79979.js";import{B as w,aF as ce,ab as le,aN as de,aK as B,af as ue,aG as xe,ag as ge}from"./index-74184c93.js";import{S as pe}from"./index-560f985a.js";const R=/\b(?:twitter\.com|x\.com)\/(?:@)?([\w_]+)(?:$|\?[^/]*$)/,he=/(https?:\/\/)?(www\.)?youtube\.com\/watch\?v=([A-Za-z0-9_-]+)/,fe=/(https?:\/\/)?(www\.)?youtube\.com\/live\/([A-Za-z0-9_-]+)/,we=/(https?:\/\/)?(www\.)?youtu\.be\/([A-Za-z0-9_-]+)/,me=/https:\/\/twitter\.com\/i\/spaces\/([A-Za-z0-9_-]+)/,be=/https:\/\/(twitter\.com|x\.com)\/[^/]+\/status\/(\d+)/,ye=/(https?:\/\/)?([A-Za-z0-9_-]+)\.mp3/,je=/(https?:\/\/)?(.*\.)?.+\/(feed|rss|rss.xml|.*.rss|.*\?(feed|format)=rss)$/,Se=/https?:\/\/(www\.)?youtube\.com\/(user\/)?(@)?([\w-]+)/,ve=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/,_e=/https:\/\/twitter\.com\/i\/broadcasts\/([A-Za-z0-9_-]+)/;function Ee(t){return[fe,_e,he,we,me,ye].some(r=>r.test(t))?C:Se.test(t)?v:R.test(t)?b:be.test(t)?I:je.test(t)?_:ve.test(t)?U:G}const $e=(t,s="")=>{const a=(s===b?R:/@(\w+)/).exec(t);return a?a[1]:null},N=t=>!!t&&[b,v,_].includes(t),ze=({onClick:t,loading:s,type:r,error:a})=>{const o=D(u=>u.budget),[g,d]=p.useState(10),i=N(r)?"radar":"add_node";return p.useEffect(()=>{(async()=>{try{const c=await Q(i);d(c.data.price)}catch(c){console.error("cannot fetch",c)}})()},[i]),e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(Ce,{children:"Approve Cost"})})}),e.jsxs(n,{align:"center",direction:"row",justify:"space-between",mb:20,children:[e.jsxs(ke,{children:[e.jsx("div",{className:"title",children:"COST"}),e.jsxs("div",{className:"value","data-testid":"check-price",children:[g," sats"]})]}),e.jsxs(Be,{children:[e.jsx("div",{className:"title",children:"BUDGET"}),e.jsxs("div",{className:"value",children:[J(o)," sats"]})]})]}),e.jsx(n,{children:e.jsx(w,{color:"secondary","data-testid":"check-icon",disabled:s||!!a,onClick:t,size:"large",startIcon:s?e.jsx(P,{children:e.jsx(ce,{color:l.lightGray,size:12})}):e.jsxs(P,{children:[" ",e.jsx(le,{})]}),type:"submit",variant:"contained",children:"Approve"})}),a?e.jsx(Ne,{children:e.jsxs(Re,{children:[e.jsx(de,{className:"errorIcon"}),e.jsx("span",{children:a})]})}):null]})},ke=x(n).attrs({direction:"column",align:"space-between",justify:"flex-start"})` width: 141px; height: 61px; border: 1px solid ${l.GRAY7}; @@ -65,7 +65,7 @@ import{bu as C,ac as v,ab as b,bv as I,aa as E,bw as U,bx as D,Q as x,S as l,N a font-family: Barlow; line-height: 18px; } -`,Ae=x(n)` +`,Ne=x(n)` display: flex; align-items: center; color: ${l.primaryRed}; @@ -81,11 +81,11 @@ import{bu as C,ac as v,ab as b,bv as I,aa as E,bw as U,bx as D,Q as x,S as l,N a width: 16px; height: 16px; } -`,Ne=t=>{const s=Number(t);return s<-90||s>90?"Latitude must be between -90 and 90.":!s&&s!==0?"Latitude is required.":!0},Le=t=>t<-180||t>180?"Longitude must be between -180 and 180.":!t&&t!==0?"Longitude is required.":!0,Te=/^(-?\d{1,2}(\.\d+)?|90(\.0+)?)$/,Pe=/^(-?\d{1,3}(\.\d+)?|180(\.0+)?)$/,Ie=({latitude:t,longitude:s,onNextStep:r,form:a})=>{const o=()=>{const{errors:d}=a.formState;Object.keys(d).length||r()},g=()=>{a.setValue("latitude",""),a.setValue("longitude",""),r()};return e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(Ue,{children:"Add Location"})})}),e.jsxs(n,{direction:"row",mb:20,children:[e.jsx(n,{basis:"100px",grow:1,children:e.jsx(B,{id:"add-node-latitude",label:"Latitude",message:"Enter latitude coordinates",name:"latitude",placeholder:"-90 to 90",rules:{pattern:{message:"Incorrect longitude format",value:Te},validate:{latitude:Ne}}})}),e.jsx(n,{basis:"100px",grow:1,ml:20,children:e.jsx(B,{id:"add-node-location-longitude",label:"Longitude",message:"Enter longitude coordinates",name:"longitude",placeholder:"-180 to 180",rules:{pattern:{message:"Incorrect longitude format",value:Pe},validate:{longitude:Le}}})})]}),e.jsxs(n,{direction:"row",children:[e.jsx(n,{grow:1,children:e.jsx(De,{color:"secondary","data-testid":"skip-location-btn",disabled:!1,onClick:g,size:"large",variant:"contained",children:"Skip"})}),e.jsx(n,{grow:1,ml:20,children:e.jsx(w,{color:"secondary",disabled:!t||!s,onClick:o,size:"large",variant:"contained",children:"Next"})})]})]})},Ue=x(y)` +`,Ae=t=>{const s=Number(t);return s<-90||s>90?"Latitude must be between -90 and 90.":!s&&s!==0?"Latitude is required.":!0},Le=t=>t<-180||t>180?"Longitude must be between -180 and 180.":!t&&t!==0?"Longitude is required.":!0,Te=/^(-?\d{1,2}(\.\d+)?|90(\.0+)?)$/,Pe=/^(-?\d{1,3}(\.\d+)?|180(\.0+)?)$/,Ie=({latitude:t,longitude:s,onNextStep:r,form:a})=>{const o=()=>{const{errors:d}=a.formState;Object.keys(d).length||r()},g=()=>{a.setValue("latitude",""),a.setValue("longitude",""),r()};return e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(Ue,{children:"Add Location"})})}),e.jsxs(n,{direction:"row",mb:20,children:[e.jsx(n,{basis:"100px",grow:1,children:e.jsx(B,{id:"add-node-latitude",label:"Latitude",message:"Enter latitude coordinates",name:"latitude",placeholder:"-90 to 90",rules:{pattern:{message:"Incorrect longitude format",value:Te},validate:{latitude:Ae}}})}),e.jsx(n,{basis:"100px",grow:1,ml:20,children:e.jsx(B,{id:"add-node-location-longitude",label:"Longitude",message:"Enter longitude coordinates",name:"longitude",placeholder:"-180 to 180",rules:{pattern:{message:"Incorrect longitude format",value:Pe},validate:{longitude:Le}}})})]}),e.jsxs(n,{direction:"row",children:[e.jsx(n,{grow:1,children:e.jsx(Ge,{color:"secondary","data-testid":"skip-location-btn",disabled:!1,onClick:g,size:"large",variant:"contained",children:"Skip"})}),e.jsx(n,{grow:1,ml:20,children:e.jsx(w,{color:"secondary",disabled:!t||!s,onClick:o,size:"large",variant:"contained",children:"Next"})})]})]})},Ue=x(y)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,De=x(w)` +`,Ge=x(w)` && { background: ${l.white}; color: ${l.BG2}; @@ -97,11 +97,11 @@ import{bu as C,ac as v,ab as b,bv as I,aa as E,bw as U,bx as D,Q as x,S as l,N a color: ${l.BG2}; } } -`,Ge=/^(https?:\/\/)/g,Oe=/(www\.)?/g,Ze=/[\w-]+(\.[\w-]+)*/g,Me=/(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,61})[a-zA-Z0-9](?:\.[a-zA-Z]{2,})/g,Fe=/(\/[^\s?]*)?/g,Ve=/(\?[^\s]*)?/g,O=new RegExp(`${Ge.source}${Oe.source}${Ze.source}${Me.source}?${Fe.source}${Ve.source}$`,"i"),Z=t=>O.test(t),We=({type:t,onNextStep:s,allowNextStep:r})=>e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(Ye,{children:"Add Content"})})}),e.jsx(n,{mb:12,children:e.jsx(B,{id:"cy-youtube-channel-id",maxLength:250,name:"source",placeholder:"Paste your url here...",rules:{...X,...t!==C?{pattern:{message:"Please enter a valid URL",value:O},validate:{source:Z}}:{}}})}),e.jsx(n,{children:e.jsx(w,{color:"secondary","data-testid":"add-content-btn",disabled:!r,onClick:s,size:"large",variant:"contained",children:"Next"})})]}),Ye=x(y)` +`,De=/^(https?:\/\/)/g,Oe=/(www\.)?/g,Ze=/[\w-]+(\.[\w-]+)*/g,Fe=/(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,61})[a-zA-Z0-9](?:\.[a-zA-Z]{2,})/g,Me=/(\/[^\s?]*)?/g,Ve=/(\?[^\s]*)?/g,O=new RegExp(`${De.source}${Oe.source}${Ze.source}${Fe.source}?${Me.source}${Ve.source}$`,"i"),Z=t=>O.test(t),We=({type:t,onNextStep:s,allowNextStep:r})=>e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(Ye,{children:"Add Content"})})}),e.jsx(n,{mb:12,children:e.jsx(B,{id:"cy-youtube-channel-id",maxLength:250,name:"source",placeholder:"Paste your url here...",rules:{...X,...t!==C?{pattern:{message:"Please enter a valid URL",value:O},validate:{source:Z}}:{}}})}),e.jsx(n,{children:e.jsx(w,{color:"secondary","data-testid":"add-content-btn",disabled:!r,onClick:s,size:"large",variant:"contained",children:"Next"})})]}),Ye=x(y)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,k={[b]:{label:"Twitter handle",img:"twitter_default.svg"},[v]:{label:"Youtube channel",img:"youtube_default.svg"},[E]:{label:"RSS Feed",img:"rss_feed.svg"}},qe=({onNextStep:t,onPrevStep:s,type:r,value:a})=>e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(Je,{children:"Source Type"})})}),e.jsxs(n,{mb:20,children:[e.jsxs(Qe,{children:[e.jsx("img",{alt:k[r].label,className:"badge__img",src:k[r].img}),e.jsx(Ke,{children:k[r].label})]}),e.jsx(He,{children:$e(a,r)??a})]}),e.jsxs(n,{direction:"row",children:[e.jsx(n,{grow:1,children:e.jsx(Xe,{color:"secondary",disabled:!1,onClick:()=>s(),size:"large",variant:"contained",children:"Cancel"})}),e.jsx(n,{grow:1,ml:20,children:e.jsx(w,{color:"secondary","data-testid":"source_next_btn",onClick:()=>t(),size:"large",variant:"contained",children:"Next"})})]})]}),He=x(n)` +`,k={[b]:{label:"Twitter handle",img:"twitter_default.svg"},[v]:{label:"Youtube channel",img:"youtube_default.svg"},[_]:{label:"RSS Feed",img:"rss_feed.svg"}},qe=({onNextStep:t,onPrevStep:s,type:r,value:a})=>e.jsxs(n,{children:[e.jsx(n,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(n,{align:"center",direction:"row",children:e.jsx(Ke,{children:"Source Type"})})}),e.jsxs(n,{mb:20,children:[e.jsxs(Qe,{children:[e.jsx("img",{alt:k[r].label,className:"badge__img",src:k[r].img}),e.jsx(Je,{children:k[r].label})]}),e.jsx(He,{children:$e(a,r)??a})]}),e.jsxs(n,{direction:"row",children:[e.jsx(n,{grow:1,children:e.jsx(Xe,{color:"secondary",disabled:!1,onClick:()=>s(),size:"large",variant:"contained",children:"Cancel"})}),e.jsx(n,{grow:1,ml:20,children:e.jsx(w,{color:"secondary","data-testid":"source_next_btn",onClick:()=>t(),size:"large",variant:"contained",children:"Next"})})]})]}),He=x(n)` font-family: Barlow; font-size: 14px; font-weight: 400; @@ -114,14 +114,14 @@ import{bu as C,ac as v,ab as b,bv as I,aa as E,bw as U,bx as D,Q as x,S as l,N a overflow: hidden; text-overflow: ellipsis; word-wrap: break-word; -`,Je=x(y)` +`,Ke=x(y)` font-family: Barlow; font-size: 14px; font-weight: 500; line-height: 17px; letter-spacing: 0px; text-align: left; -`,Ke=x(y)` +`,Je=x(y)` font-family: Barlow; font-size: 20px; font-weight: 600; @@ -146,4 +146,4 @@ import{bu as C,ac as v,ab as b,bv as I,aa as E,bw as U,bx as D,Q as x,S as l,N a color: ${l.BG2}; } } -`,M=async(t,s,r)=>{const a=A(s)?"radar":"add_node",o={};if(s===C)o.media_url=t.source,o.content_type="audio_video";else if(s===I){if(/(?:https?:\/\/)?(?:www\.)?(twitter|x)\.com\/\w+\/status\/(\d+)/s.test(t.source)){const u=/\/status\/(\d+)/,c=t.source.match(u);if(c!=null&&c[1]){const[,j]=c;o.tweet_id=j}}else o.tweet_id=t.source;o.content_type="tweet"}else if(s===U)o.content_type="webpage",o.web_page=t.source;else if(s===D)o.content_type="document",o.text=t.source;else if(s===b){const[,i]=(t.source||"").match(R)||[];if(i)o.source=i,o.source_type=s;else return}else(s===v||s===E)&&(o.source=t.source,o.source_type=s);t.latitude&&t.longitude&&(o.latitude=t.latitude,o.longitude=t.longitude);let g="",d;te?d=await ne.enable():d=await se.enable(),o.pubkey=d==null?void 0:d.pubkey,g=await oe();try{const i=await re.post(`/${a}`,JSON.stringify(o),{Authorization:g});if(i.error){const{message:u}=i.error;throw new Error(u)}}catch(i){if(i.status===402)await ie(r),await ae(r),await M(t,s,r);else{let u=f;if(i.status===400)try{const c=await i.json();u=c.message||c.status||(c==null?void 0:c.errorCode)||f}catch{u=f}else i instanceof Error&&(u=i.message||f);throw new Error(u)}}},nt=()=>{const[t,s]=p.useState(0),{close:r,visible:a}=ee("addContent"),[o]=G($=>[$.setBudget]),g=ue({mode:"onChange"}),{watch:d,setValue:i,reset:u}=g,[c,j]=p.useState(!1),[F,N]=p.useState("");p.useEffect(()=>()=>{N(""),s(0),u()},[a,u]);const m=d("inputType"),L=d("source"),V=d("longitude"),W=d("latitude"),T=d("source"),Y=Z(L);p.useEffect(()=>{i("inputType",_e(T))},[T,i]);const q=()=>{r()},_=()=>{s(t+1)},H=()=>{s(t-1)},J=g.handleSubmit(async $=>{j(!0);try{await M($,m,o),pe("Content Added"),q()}catch(h){let z=f;if((h==null?void 0:h.status)===400){const S=await h.json();z=S.errorCode||(S==null?void 0:S.status)||f}else h instanceof Error&&(z=h.message);N(String(z))}finally{j(!1)}});return e.jsx(xe,{id:"addContent",kind:"small",onClose:r,preventOutsideClose:!0,children:e.jsx(ge,{...g,children:e.jsxs("form",{id:"add-node-form",onSubmit:J,children:[t===0&&e.jsx(We,{allowNextStep:Y,onNextStep:_,type:m}),t===1&&e.jsx(e.Fragment,{children:A(m)?e.jsx(qe,{onNextStep:_,onPrevStep:H,type:m,value:L}):e.jsx(Ie,{form:g,latitude:W,longitude:V,onNextStep:_})}),t===2&&e.jsx(ze,{error:F,loading:c,onClick:()=>null,type:m})]})})})};export{nt as AddContentModal}; +`,F=async(t,s,r)=>{const a=N(s)?"radar":"add_node",o={};if(s===C)o.media_url=t.source,o.content_type="audio_video";else if(s===I){if(/(?:https?:\/\/)?(?:www\.)?(twitter|x)\.com\/\w+\/status\/(\d+)/s.test(t.source)){const u=/\/status\/(\d+)/,c=t.source.match(u);if(c!=null&&c[1]){const[,j]=c;o.tweet_id=j}}else o.tweet_id=t.source;o.content_type="tweet"}else if(s===U)o.content_type="webpage",o.web_page=t.source;else if(s===G)o.content_type="document",o.text=t.source;else if(s===b){const[,i]=(t.source||"").match(R)||[];if(i)o.source=i,o.source_type=s;else return}else(s===v||s===_)&&(o.source=t.source,o.source_type=s);t.latitude&&t.longitude&&(o.latitude=t.latitude,o.longitude=t.longitude);let g="",d;te?d=await ne.enable():d=await se.enable(),o.pubkey=d==null?void 0:d.pubkey,g=await oe();try{const i=await re.post(`/${a}`,JSON.stringify(o),{Authorization:g});if(i.error){const{message:u}=i.error;throw new Error(u)}}catch(i){if(i.status===402)await ie(r),await ae(r),await F(t,s,r);else{let u=f;if(i.status===400)try{const c=await i.json();u=c.message||c.status||(c==null?void 0:c.errorCode)||f}catch{u=f}else i instanceof Error&&(u=i.message||f);throw new Error(u)}}},nt=()=>{const[t,s]=p.useState(0),{close:r,visible:a}=ee("addContent"),[o]=D($=>[$.setBudget]),g=ue({mode:"onChange"}),{watch:d,setValue:i,reset:u}=g,[c,j]=p.useState(!1),[M,A]=p.useState("");p.useEffect(()=>()=>{A(""),s(0),u()},[a,u]);const m=d("inputType"),L=d("source"),V=d("longitude"),W=d("latitude"),T=d("source"),Y=Z(L);p.useEffect(()=>{i("inputType",Ee(T))},[T,i]);const q=()=>{r()},E=()=>{s(t+1)},H=()=>{s(t-1)},K=g.handleSubmit(async $=>{j(!0);try{await F($,m,o),pe("Content Added"),q()}catch(h){let z=f;if((h==null?void 0:h.status)===400){const S=await h.json();z=S.errorCode||(S==null?void 0:S.status)||f}else h instanceof Error&&(z=h.message);A(String(z))}finally{j(!1)}});return e.jsx(xe,{id:"addContent",kind:"small",onClose:r,preventOutsideClose:!0,children:e.jsx(ge,{...g,children:e.jsxs("form",{id:"add-node-form",onSubmit:K,children:[t===0&&e.jsx(We,{allowNextStep:Y,onNextStep:E,type:m}),t===1&&e.jsx(e.Fragment,{children:N(m)?e.jsx(qe,{onNextStep:E,onPrevStep:H,type:m,value:L}):e.jsx(Ie,{form:g,latitude:W,longitude:V,onNextStep:E})}),t===2&&e.jsx(ze,{error:M,loading:c,onClick:()=>null,type:m})]})})})};export{nt as AddContentModal}; diff --git a/build/assets/index-2a64d990.js b/build/assets/index-c77aff98.js similarity index 86% rename from build/assets/index-2a64d990.js rename to build/assets/index-c77aff98.js index a7c1f223b..ea48dc4e7 100644 --- a/build/assets/index-2a64d990.js +++ b/build/assets/index-c77aff98.js @@ -1,4 +1,4 @@ -import{Q as v,S as q,a5 as P,U as r,r as u,j as e,ar as H,bC as U,a4 as J,a1 as $,bD as Q,ad as R,bA as z,am as K,bF as X}from"./index-0cb90706.js";import{ad as V,aE as G,aJ as Z,B as _,aO as W,ae as N,aF as ee,af as te}from"./index-7a7c9631.js";import{p as Y}from"./index-bbc7c996.js";import{c as ne}from"./index-64f1c910.js";import"./three.module-a2e04964.js";const re=({handleSelectType:i,skipToStep:x,nodeType:d,selectedValues:n})=>{const[h,w]=u.useState(!1),[f,C]=u.useState(),{watch:j,formState:{isValid:t}}=V();u.useEffect(()=>{(async()=>{w(!0);const b=await U(d),m=Y(b);C(m),w(!1)})()},[d,j]);const a=o=>o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),c=(f?[...f].sort((o,b)=>o.required&&!b.required?-1:!o.required&&b.required?1:0):[]).filter(o=>!!(o.required&&!Object.values(n).includes(o.key))),S=()=>{i(""),x("sourceType")};return e.jsxs(r,{children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(oe,{children:"Required Properties"})})}),e.jsx(ae,{children:h?e.jsx(r,{style:{margin:"auto"},children:e.jsx(G,{color:q.SECONDARY_BLUE})}):e.jsx(r,{className:"input__wrapper",children:c==null?void 0:c.map(({key:o,required:b})=>e.jsx(e.Fragment,{children:e.jsxs(se,{children:[e.jsx(P,{children:a(o)}),e.jsx(Z,{id:"item-name",maxLength:50,name:o,placeholder:b?"Required":"Optional",rules:{...b?H:{}}})]})}))})}),e.jsxs(r,{direction:"row",children:[e.jsx(r,{grow:1,children:e.jsx(_,{color:"secondary",onClick:S,size:"large",variant:"contained",children:"Prev"})}),e.jsx(r,{grow:1,ml:20,children:e.jsx(_,{color:"secondary",disabled:!t||h||(c==null?void 0:c.some(o=>o.required&&!j(o.key))),onClick:()=>x("createConfirmation"),size:"large",variant:"contained",children:"Next"})})]})]})},oe=v(P)` +import{Q as v,S as q,a5 as P,U as r,r as u,j as e,ar as H,bC as U,a4 as J,a1 as $,bD as K,ad as R,bA as O,am as Q,bF as X}from"./index-ead79979.js";import{ae as G,aF as V,aK as Z,B as _,aP as W,af as N,aG as ee,ag as te}from"./index-74184c93.js";import{p as Y}from"./index-bbc7c996.js";import{c as ne}from"./index-64f1c910.js";import"./three.module-a2e04964.js";const re=({handleSelectType:i,skipToStep:x,nodeType:d,selectedValues:n})=>{const[h,w]=u.useState(!1),[f,C]=u.useState(),{watch:j,formState:{isValid:t}}=G();u.useEffect(()=>{(async()=>{w(!0);const b=await U(d),m=Y(b);C(m),w(!1)})()},[d,j]);const a=o=>o.charAt(0).toUpperCase()+o.slice(1).replace(/_/g," "),c=(f?[...f].sort((o,b)=>o.required&&!b.required?-1:!o.required&&b.required?1:0):[]).filter(o=>!!(o.required&&!Object.values(n).includes(o.key))),S=()=>{i(""),x("sourceType")};return e.jsxs(r,{children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(oe,{children:"Required Properties"})})}),e.jsx(ae,{children:h?e.jsx(r,{style:{margin:"auto"},children:e.jsx(V,{color:q.SECONDARY_BLUE})}):e.jsx(r,{className:"input__wrapper",children:c==null?void 0:c.map(({key:o,required:b})=>e.jsx(e.Fragment,{children:e.jsxs(se,{children:[e.jsx(P,{children:a(o)}),e.jsx(Z,{id:"item-name",maxLength:50,name:o,placeholder:b?"Required":"Optional",rules:{...b?H:{}}})]})}))})}),e.jsxs(r,{direction:"row",children:[e.jsx(r,{grow:1,children:e.jsx(_,{color:"secondary",onClick:S,size:"large",variant:"contained",children:"Prev"})}),e.jsx(r,{grow:1,ml:20,children:e.jsx(_,{color:"secondary",disabled:!t||h||(c==null?void 0:c.some(o=>o.required&&!j(o.key))),onClick:()=>x("createConfirmation"),size:"large",variant:"contained",children:"Next"})})]})]})},oe=v(P)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -29,7 +29,7 @@ import{Q as v,S as q,a5 as P,U as r,r as u,j as e,ar as H,bC as U,a4 as J,a1 as font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,B=i=>i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),I=i=>i?[...i].sort((x,d)=>Number(d.required)-Number(x.required)):[],ce=({handleSelectType:i,skipToStep:x,selectedNodeType:d,nodeType:n,selectedValues:h,setSelectedValues:w})=>{const[f,C]=u.useState(!1),[j,t]=u.useState(),[a,s]=u.useState(),{watch:c}=V();u.useEffect(()=>{const l=async(p,y)=>{C(!0);const g=await U(p),O=Y(g);y(O),C(!1)};n&&l(n,t),d&&l(d,s)},[n,d,c]);const S=u.useMemo(()=>I(j),[j]),o=u.useMemo(()=>I(a),[a]),b=()=>{i(""),x("sourceType")};u.useEffect(()=>{if(j&&a){const l=a.reduce((p,y)=>{const g=j.find(O=>O.key===y.key);return p[y.key]=g?y.key:"none",p},{});w(l)}},[j,a,w]);const m=(l,p)=>{w(y=>({...y,[l]:p}))},A=()=>{const l=S.every(({key:p,required:y})=>!y||y&&h[p]&&h[p]!=="none");x(l?"createConfirmation":"requiredProperties")},F=u.useMemo(()=>o.map(({key:l})=>{const p=h[l]||"none",y=S.filter(g=>!Object.values(h).includes(g.key)||g.key===p).map(g=>({label:B(g.key),value:g.key}));return y.unshift({label:"None",value:"none"}),{key:l,autoCompleteOptions:y,selectedValue:p}}),[o,S,h]);return e.jsxs(r,{children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(le,{children:"Map Properties"})})}),e.jsx(pe,{children:f?e.jsx(r,{style:{margin:"auto"},children:e.jsx(G,{color:q.lightGray})}):e.jsxs(de,{children:[e.jsxs(ue,{children:[e.jsx(k,{children:B(d)}),o.map(({key:l})=>e.jsx(xe,{children:e.jsx(P,{children:B(l)})},l))]}),e.jsxs(he,{children:[e.jsx(k,{children:B(n)}),F.map(({key:l,autoCompleteOptions:p,selectedValue:y})=>e.jsx(r,{children:e.jsx(W,{isLoading:f,onSelect:g=>m(l,g?g.value:"none"),options:p,selectedValue:p.find(g=>g.value===y)})},l))]})]})}),e.jsxs(r,{direction:"row",children:[e.jsx(r,{grow:1,children:e.jsx(_,{color:"secondary",onClick:b,size:"large",variant:"contained",children:"Prev"})}),e.jsx(r,{grow:1,ml:20,children:e.jsx(_,{color:"secondary",disabled:f,onClick:A,size:"large",variant:"contained",children:"Next"})})]})]})},le=v(P)` +`,B=i=>i.charAt(0).toUpperCase()+i.slice(1).replace(/_/g," "),I=i=>i?[...i].sort((x,d)=>Number(d.required)-Number(x.required)):[],ce=({handleSelectType:i,skipToStep:x,selectedNodeType:d,nodeType:n,selectedValues:h,setSelectedValues:w})=>{const[f,C]=u.useState(!1),[j,t]=u.useState(),[a,s]=u.useState(),{watch:c}=G();u.useEffect(()=>{const l=async(p,y)=>{C(!0);const g=await U(p),z=Y(g);y(z),C(!1)};n&&l(n,t),d&&l(d,s)},[n,d,c]);const S=u.useMemo(()=>I(j),[j]),o=u.useMemo(()=>I(a),[a]),b=()=>{i(""),x("sourceType")};u.useEffect(()=>{if(j&&a){const l=a.reduce((p,y)=>{const g=j.find(z=>z.key===y.key);return p[y.key]=g?y.key:"none",p},{});w(l)}},[j,a,w]);const m=(l,p)=>{w(y=>({...y,[l]:p}))},A=()=>{const l=S.every(({key:p,required:y})=>!y||y&&h[p]&&h[p]!=="none");x(l?"createConfirmation":"requiredProperties")},F=u.useMemo(()=>o.map(({key:l})=>{const p=h[l]||"none",y=S.filter(g=>!Object.values(h).includes(g.key)||g.key===p).map(g=>({label:B(g.key),value:g.key}));return y.unshift({label:"None",value:"none"}),{key:l,autoCompleteOptions:y,selectedValue:p}}),[o,S,h]);return e.jsxs(r,{children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(le,{children:"Map Properties"})})}),e.jsx(pe,{children:f?e.jsx(r,{style:{margin:"auto"},children:e.jsx(V,{color:q.lightGray})}):e.jsxs(de,{children:[e.jsxs(ue,{children:[e.jsx(k,{children:B(d)}),o.map(({key:l})=>e.jsx(xe,{children:e.jsx(P,{children:B(l)})},l))]}),e.jsxs(he,{children:[e.jsx(k,{children:B(n)}),F.map(({key:l,autoCompleteOptions:p,selectedValue:y})=>e.jsx(r,{children:e.jsx(W,{isLoading:f,onSelect:g=>m(l,g?g.value:"none"),options:p,selectedValue:p.find(g=>g.value===y)})},l))]})]})}),e.jsxs(r,{direction:"row",children:[e.jsx(r,{grow:1,children:e.jsx(_,{color:"secondary",onClick:b,size:"large",variant:"contained",children:"Prev"})}),e.jsx(r,{grow:1,ml:20,children:e.jsx(_,{color:"secondary",disabled:f,onClick:A,size:"large",variant:"contained",children:"Next"})})]})]})},le=v(P)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -70,8 +70,8 @@ import{Q as v,S as q,a5 as P,U as r,r as u,j as e,ar as H,bC as U,a4 as J,a1 as font-family: 'Barlow'; color: white; margin-bottom: 15px; -`,fe={label:"Not Selected",value:"Not Selected"},me=[{label:"Corporation",value:"Corporation"},{label:"Event",value:"Event"},{label:"Image",value:"Image"},{label:"Organization",value:"Organization"},{label:"Person",value:"Person"},{label:"Place",value:"Place"},{label:"Project",value:"Project"},{label:"Software",value:"Software"},{label:"Topic",value:"Topic"}],ye=({skipToStep:i,allowNextStep:x,onSelectType:d,selectedType:n})=>{const[h]=J(s=>[s.customSchemaFeatureFlag]),[w,f]=u.useState(null),[C,j]=u.useState(!1),t=$();u.useEffect(()=>{(async()=>{var c;if(h){j(!0);try{const S=await Q(),o=["about","schema",(c=t==null?void 0:t.node_type)==null?void 0:c.toLowerCase()],b=S.schemas.filter(m=>m.ref_id&&!o.includes(m.type.toLowerCase())&&!m.is_deleted).map(m=>({label:ne(m.type),value:m.type,action:()=>i("mapProperties")}));f(b)}catch(S){console.warn(S)}finally{j(!1)}}else f([...me,fe])})()},[t==null?void 0:t.node_type,n,h,i]);const a=s=>{d((s==null?void 0:s.label)||"")};return e.jsxs(r,{children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(ge,{children:"Select Type"})})}),e.jsx(r,{direction:"row",mb:20,children:e.jsx(W,{autoFocus:!0,isLoading:C,onSelect:a,options:w})}),e.jsx(r,{children:e.jsx(_,{color:"secondary",disabled:!x,onClick:()=>i("mapProperties"),size:"large",type:"button",variant:"contained",children:"Next"})})]})},ge=v(P)` +`,fe={label:"Not Selected",value:"Not Selected"},me=[{label:"Corporation",value:"Corporation"},{label:"Event",value:"Event"},{label:"Image",value:"Image"},{label:"Organization",value:"Organization"},{label:"Person",value:"Person"},{label:"Place",value:"Place"},{label:"Project",value:"Project"},{label:"Software",value:"Software"},{label:"Topic",value:"Topic"}],ye=({skipToStep:i,allowNextStep:x,onSelectType:d,selectedType:n})=>{const[h]=J(s=>[s.customSchemaFeatureFlag]),[w,f]=u.useState(null),[C,j]=u.useState(!1),t=$();u.useEffect(()=>{(async()=>{var c;if(h){j(!0);try{const S=await K(),o=["about","schema",(c=t==null?void 0:t.node_type)==null?void 0:c.toLowerCase()],b=S.schemas.filter(m=>m.ref_id&&!o.includes(m.type.toLowerCase())&&!m.is_deleted).map(m=>({label:ne(m.type),value:m.type,action:()=>i("mapProperties")}));f(b)}catch(S){console.warn(S)}finally{j(!1)}}else f([...me,fe])})()},[t==null?void 0:t.node_type,n,h,i]);const a=s=>{d((s==null?void 0:s.label)||"")};return e.jsxs(r,{children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:20,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(ge,{children:"Select Type"})})}),e.jsx(r,{direction:"row",mb:20,children:e.jsx(W,{autoFocus:!0,isLoading:C,onSelect:a,options:w})}),e.jsx(r,{children:e.jsx(_,{color:"secondary",disabled:!x,onClick:()=>i("mapProperties"),size:"large",type:"button",variant:"contained",children:"Next"})})]})},ge=v(P)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,je=async(i,x,d,n)=>{const h={},w=[];Object.entries(d).forEach(([t,a])=>{a!=="none"&&(h[a]=t),t!==a&&w.push(t)});const f={};Object.keys(n||{}).forEach(t=>{const a=n==null?void 0:n[t];Object.entries(h).forEach(([s,c])=>{c===t&&(f[h[s]]=a)})}),Object.keys(i).forEach(t=>{t!=="nodeType"&&(f[t]=i[t])});const C=n?n.node_type.charAt(0).toUpperCase()+n.node_type.slice(1):void 0,j={node_type:x,properties:f,properties_to_be_deleted:w,type_to_be_deleted:C?[C]:[]};try{let t=n==null?void 0:n.ref_id;if((n==null?void 0:n.type)==="topic"){const{data:s}=await K({search:n==null?void 0:n.name}),c=s.find(S=>S.name===n.name);t=c==null?void 0:c.ref_id}const a=t||(n==null?void 0:n.ref_id);a&&await X(a,j)}catch(t){console.log(t);let a=z;if(t.status===400)try{const s=await t.json();a=s.message||s.errorCode||(s==null?void 0:s.status)||z}catch{a=z}else t instanceof Error&&(a=t.message);throw new Error(a)}},_e=()=>{const[i,x]=u.useState("sourceType"),{close:d,visible:n}=R("changeNodeType"),{open:h}=R("editNodeName"),{open:w}=R("addType"),f=N({mode:"onChange"}),{watch:C,setValue:j,reset:t}=f,[a,s]=u.useState(""),[c,S]=u.useState({});u.useEffect(()=>()=>{x("sourceType"),t()},[n,t]);const o=$(),b=o!=null&&o.node_type?o.node_type.charAt(0).toUpperCase()+o.node_type.slice(1):"",m=C("nodeType");C("title");const A=()=>{d()},F=T=>{x(T)},l=f.handleSubmit(async T=>{try{await je(T,m,c,o),A()}catch(E){let L=z;if(A(),(E==null?void 0:E.status)===400){const M=await E.json();L=M.errorCode||(M==null?void 0:M.status)||z}else E instanceof Error&&(L=E.message);s(String(L))}}),p=T=>{T==="Create custom type"?w():j("nodeType",T)},y={sourceType:e.jsx(ye,{allowNextStep:!!m,onSelectType:p,selectedType:m,skipToStep:F}),requiredProperties:e.jsx(re,{handleSelectType:p,nodeType:m,selectedValues:c,skipToStep:F}),createConfirmation:e.jsx(ie,{nodeType:m,onclose:A,selectedNodeType:b}),mapProperties:e.jsx(ce,{handleSelectType:p,nodeType:m,selectedNodeType:b,selectedValues:c,setSelectedValues:S,skipToStep:F})},g=i==="mapProperties"?"regular":"small",O=()=>{d(),h()};return e.jsx(ee,{id:"changeNodeType",kind:g,onClose:O,preventOutsideClose:!0,children:e.jsx(te,{...f,children:e.jsx("form",{id:"add-node-form",onSubmit:l,children:y[i]})})})};export{_e as ChangeNodeTypeModal}; +`,je=async(i,x,d,n)=>{const h={},w=[];Object.entries(d).forEach(([t,a])=>{a!=="none"&&(h[a]=t),t!==a&&w.push(t)});const f={};Object.keys(n||{}).forEach(t=>{const a=n==null?void 0:n[t];Object.entries(h).forEach(([s,c])=>{c===t&&(f[h[s]]=a)})}),Object.keys(i).forEach(t=>{t!=="nodeType"&&(f[t]=i[t])});const C=n?n.node_type.charAt(0).toUpperCase()+n.node_type.slice(1):void 0,j={node_type:x,properties:f,properties_to_be_deleted:w,type_to_be_deleted:C?[C]:[]};try{let t=n==null?void 0:n.ref_id;if((n==null?void 0:n.type)==="topic"){const{data:s}=await Q({search:n==null?void 0:n.name}),c=s.find(S=>S.name===n.name);t=c==null?void 0:c.ref_id}const a=t||(n==null?void 0:n.ref_id);a&&await X(a,j)}catch(t){console.log(t);let a=O;if(t.status===400)try{const s=await t.json();a=s.message||s.errorCode||(s==null?void 0:s.status)||O}catch{a=O}else t instanceof Error&&(a=t.message);throw new Error(a)}},_e=()=>{const[i,x]=u.useState("sourceType"),{close:d,visible:n}=R("changeNodeType"),{open:h}=R("editNodeName"),{open:w}=R("addType"),f=N({mode:"onChange"}),{watch:C,setValue:j,reset:t}=f,[a,s]=u.useState(""),[c,S]=u.useState({});u.useEffect(()=>()=>{x("sourceType"),t()},[n,t]);const o=$(),b=o!=null&&o.node_type?o.node_type.charAt(0).toUpperCase()+o.node_type.slice(1):"",m=C("nodeType");C("title");const A=()=>{d()},F=T=>{x(T)},l=f.handleSubmit(async T=>{try{await je(T,m,c,o),A()}catch(E){let L=O;if(A(),(E==null?void 0:E.status)===400){const M=await E.json();L=M.errorCode||(M==null?void 0:M.status)||O}else E instanceof Error&&(L=E.message);s(String(L))}}),p=T=>{T==="Create custom type"?w():j("nodeType",T)},y={sourceType:e.jsx(ye,{allowNextStep:!!m,onSelectType:p,selectedType:m,skipToStep:F}),requiredProperties:e.jsx(re,{handleSelectType:p,nodeType:m,selectedValues:c,skipToStep:F}),createConfirmation:e.jsx(ie,{nodeType:m,onclose:A,selectedNodeType:b}),mapProperties:e.jsx(ce,{handleSelectType:p,nodeType:m,selectedNodeType:b,selectedValues:c,setSelectedValues:S,skipToStep:F})},g=i==="mapProperties"?"regular":"small",z=()=>{d(),h()};return e.jsx(ee,{id:"changeNodeType",kind:g,onClose:z,preventOutsideClose:!0,children:e.jsx(te,{...f,children:e.jsx("form",{id:"add-node-form",onSubmit:l,children:y[i]})})})};export{_e as ChangeNodeTypeModal}; diff --git a/build/assets/index-0cb90706.js b/build/assets/index-ead79979.js similarity index 90% rename from build/assets/index-0cb90706.js rename to build/assets/index-ead79979.js index 5a43ab425..18ef6e7d8 100644 --- a/build/assets/index-0cb90706.js +++ b/build/assets/index-ead79979.js @@ -590,7 +590,7 @@ PROCEED WITH CAUTION! font-weight: 500; line-height: normal; } -`;var dist={},_extends={},_global={exports:{}},global$5=_global.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=global$5);var _globalExports=_global.exports,_core={exports:{}},core$4=_core.exports={version:"2.6.12"};typeof __e=="number"&&(__e=core$4);var _coreExports=_core.exports,_aFunction=function(o){if(typeof o!="function")throw TypeError(o+" is not a function!");return o},aFunction=_aFunction,_ctx=function(o,et,tt){if(aFunction(o),et===void 0)return o;switch(tt){case 1:return function(rt){return o.call(et,rt)};case 2:return function(rt,it){return o.call(et,rt,it)};case 3:return function(rt,it,nt){return o.call(et,rt,it,nt)}}return function(){return o.apply(et,arguments)}},_objectDp={},_isObject=function(o){return typeof o=="object"?o!==null:typeof o=="function"},isObject$3=_isObject,_anObject=function(o){if(!isObject$3(o))throw TypeError(o+" is not an object!");return o},_fails=function(o){try{return!!o()}catch{return!0}},_descriptors=!_fails(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),_domCreate,hasRequired_domCreate;function require_domCreate(){if(hasRequired_domCreate)return _domCreate;hasRequired_domCreate=1;var o=_isObject,et=_globalExports.document,tt=o(et)&&o(et.createElement);return _domCreate=function(rt){return tt?et.createElement(rt):{}},_domCreate}var _ie8DomDefine=!_descriptors&&!_fails(function(){return Object.defineProperty(require_domCreate()("div"),"a",{get:function(){return 7}}).a!=7}),isObject$2=_isObject,_toPrimitive=function(o,et){if(!isObject$2(o))return o;var tt,rt;if(et&&typeof(tt=o.toString)=="function"&&!isObject$2(rt=tt.call(o))||typeof(tt=o.valueOf)=="function"&&!isObject$2(rt=tt.call(o))||!et&&typeof(tt=o.toString)=="function"&&!isObject$2(rt=tt.call(o)))return rt;throw TypeError("Can't convert object to primitive value")},anObject$3=_anObject,IE8_DOM_DEFINE$1=_ie8DomDefine,toPrimitive$2=_toPrimitive,dP$3=Object.defineProperty;_objectDp.f=_descriptors?Object.defineProperty:function o(et,tt,rt){if(anObject$3(et),tt=toPrimitive$2(tt,!0),anObject$3(rt),IE8_DOM_DEFINE$1)try{return dP$3(et,tt,rt)}catch{}if("get"in rt||"set"in rt)throw TypeError("Accessors not supported!");return"value"in rt&&(et[tt]=rt.value),et};var _propertyDesc=function(o,et){return{enumerable:!(o&1),configurable:!(o&2),writable:!(o&4),value:et}},dP$2=_objectDp,createDesc$2=_propertyDesc,_hide=_descriptors?function(o,et,tt){return dP$2.f(o,et,createDesc$2(1,tt))}:function(o,et,tt){return o[et]=tt,o},hasOwnProperty={}.hasOwnProperty,_has=function(o,et){return hasOwnProperty.call(o,et)},global$4=_globalExports,core$3=_coreExports,ctx=_ctx,hide$2=_hide,has$6=_has,PROTOTYPE$2="prototype",$export$7=function(o,et,tt){var rt=o&$export$7.F,it=o&$export$7.G,nt=o&$export$7.S,at=o&$export$7.P,st=o&$export$7.B,ot=o&$export$7.W,lt=it?core$3:core$3[et]||(core$3[et]={}),dt=lt[PROTOTYPE$2],vt=it?global$4:nt?global$4[et]:(global$4[et]||{})[PROTOTYPE$2],yt,kt,ht;it&&(tt=et);for(yt in tt)kt=!rt&&vt&&vt[yt]!==void 0,!(kt&&has$6(lt,yt))&&(ht=kt?vt[yt]:tt[yt],lt[yt]=it&&typeof vt[yt]!="function"?tt[yt]:st&&kt?ctx(ht,global$4):ot&&vt[yt]==ht?function(mt){var Et=function(pt,bt,St){if(this instanceof mt){switch(arguments.length){case 0:return new mt;case 1:return new mt(pt);case 2:return new mt(pt,bt)}return new mt(pt,bt,St)}return mt.apply(this,arguments)};return Et[PROTOTYPE$2]=mt[PROTOTYPE$2],Et}(ht):at&&typeof ht=="function"?ctx(Function.call,ht):ht,at&&((lt.virtual||(lt.virtual={}))[yt]=ht,o&$export$7.R&&dt&&!dt[yt]&&hide$2(dt,yt,ht)))};$export$7.F=1;$export$7.G=2;$export$7.S=4;$export$7.P=8;$export$7.B=16;$export$7.W=32;$export$7.U=64;$export$7.R=128;var _export=$export$7,toString$1={}.toString,_cof=function(o){return toString$1.call(o).slice(8,-1)},cof$1=_cof,_iobject=Object("z").propertyIsEnumerable(0)?Object:function(o){return cof$1(o)=="String"?o.split(""):Object(o)},_defined=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o},IObject=_iobject,defined$2=_defined,_toIobject=function(o){return IObject(defined$2(o))},ceil=Math.ceil,floor=Math.floor,_toInteger=function(o){return isNaN(o=+o)?0:(o>0?floor:ceil)(o)},toInteger$2=_toInteger,min$1=Math.min,_toLength=function(o){return o>0?min$1(toInteger$2(o),9007199254740991):0},toInteger$1=_toInteger,max=Math.max,min=Math.min,_toAbsoluteIndex=function(o,et){return o=toInteger$1(o),o<0?max(o+et,0):min(o,et)},toIObject$5=_toIobject,toLength=_toLength,toAbsoluteIndex=_toAbsoluteIndex,_arrayIncludes=function(o){return function(et,tt,rt){var it=toIObject$5(et),nt=toLength(it.length),at=toAbsoluteIndex(rt,nt),st;if(o&&tt!=tt){for(;nt>at;)if(st=it[at++],st!=st)return!0}else for(;nt>at;at++)if((o||at in it)&&it[at]===tt)return o||at||0;return!o&&-1}},_shared={exports:{}},_library=!0,core$2=_coreExports,global$3=_globalExports,SHARED="__core-js_shared__",store$1=global$3[SHARED]||(global$3[SHARED]={});(_shared.exports=function(o,et){return store$1[o]||(store$1[o]=et!==void 0?et:{})})("versions",[]).push({version:core$2.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var _sharedExports=_shared.exports,id$1=0,px=Math.random(),_uid=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++id$1+px).toString(36))},shared$1=_sharedExports("keys"),uid$2=_uid,_sharedKey=function(o){return shared$1[o]||(shared$1[o]=uid$2(o))},has$5=_has,toIObject$4=_toIobject,arrayIndexOf=_arrayIncludes(!1),IE_PROTO$2=_sharedKey("IE_PROTO"),_objectKeysInternal=function(o,et){var tt=toIObject$4(o),rt=0,it=[],nt;for(nt in tt)nt!=IE_PROTO$2&&has$5(tt,nt)&&it.push(nt);for(;et.length>rt;)has$5(tt,nt=et[rt++])&&(~arrayIndexOf(it,nt)||it.push(nt));return it},_enumBugKeys="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),$keys$2=_objectKeysInternal,enumBugKeys$1=_enumBugKeys,_objectKeys=Object.keys||function o(et){return $keys$2(et,enumBugKeys$1)},_objectGops={};_objectGops.f=Object.getOwnPropertySymbols;var _objectPie={};_objectPie.f={}.propertyIsEnumerable;var defined$1=_defined,_toObject=function(o){return Object(defined$1(o))},_objectAssign,hasRequired_objectAssign;function require_objectAssign(){if(hasRequired_objectAssign)return _objectAssign;hasRequired_objectAssign=1;var o=_descriptors,et=_objectKeys,tt=_objectGops,rt=_objectPie,it=_toObject,nt=_iobject,at=Object.assign;return _objectAssign=!at||_fails(function(){var st={},ot={},lt=Symbol(),dt="abcdefghijklmnopqrst";return st[lt]=7,dt.split("").forEach(function(vt){ot[vt]=vt}),at({},st)[lt]!=7||Object.keys(at({},ot)).join("")!=dt})?function(ot,lt){for(var dt=it(ot),vt=arguments.length,yt=1,kt=tt.f,ht=rt.f;vt>yt;)for(var mt=nt(arguments[yt++]),Et=kt?et(mt).concat(kt(mt)):et(mt),pt=Et.length,bt=0,St;pt>bt;)St=Et[bt++],(!o||ht.call(mt,St))&&(dt[St]=mt[St]);return dt}:at,_objectAssign}var $export$6=_export;$export$6($export$6.S+$export$6.F,"Object",{assign:require_objectAssign()});var assign$1=_coreExports.Object.assign,assign={default:assign$1,__esModule:!0};_extends.__esModule=!0;var _assign=assign,_assign2=_interopRequireDefault$5(_assign);function _interopRequireDefault$5(o){return o&&o.__esModule?o:{default:o}}_extends.default=_assign2.default||function(o){for(var et=1;et=nt?o?"":void 0:(at=rt.charCodeAt(it),at<55296||at>56319||it+1===nt||(st=rt.charCodeAt(it+1))<56320||st>57343?o?rt.charAt(it):at:o?rt.slice(it,it+2):(at-55296<<10)+(st-56320)+65536)}},_redefine=_hide,_iterators={},dP$1=_objectDp,anObject$2=_anObject,getKeys$1=_objectKeys,_objectDps=_descriptors?Object.defineProperties:function o(et,tt){anObject$2(et);for(var rt=getKeys$1(tt),it=rt.length,nt=0,at;it>nt;)dP$1.f(et,at=rt[nt++],tt[at]);return et},_html,hasRequired_html;function require_html(){if(hasRequired_html)return _html;hasRequired_html=1;var o=_globalExports.document;return _html=o&&o.documentElement,_html}var anObject$1=_anObject,dPs=_objectDps,enumBugKeys=_enumBugKeys,IE_PROTO=_sharedKey("IE_PROTO"),Empty=function(){},PROTOTYPE$1="prototype",createDict=function(){var o=require_domCreate()("iframe"),et=enumBugKeys.length,tt="<",rt=">",it;for(o.style.display="none",require_html().appendChild(o),o.src="javascript:",it=o.contentWindow.document,it.open(),it.write(tt+"script"+rt+"document.F=Object"+tt+"/script"+rt),it.close(),createDict=it.F;et--;)delete createDict[PROTOTYPE$1][enumBugKeys[et]];return createDict()},_objectCreate=Object.create||function o(et,tt){var rt;return et!==null?(Empty[PROTOTYPE$1]=anObject$1(et),rt=new Empty,Empty[PROTOTYPE$1]=null,rt[IE_PROTO]=et):rt=createDict(),tt===void 0?rt:dPs(rt,tt)},_wks={exports:{}},store=_sharedExports("wks"),uid$1=_uid,Symbol$1=_globalExports.Symbol,USE_SYMBOL=typeof Symbol$1=="function",$exports=_wks.exports=function(o){return store[o]||(store[o]=USE_SYMBOL&&Symbol$1[o]||(USE_SYMBOL?Symbol$1:uid$1)("Symbol."+o))};$exports.store=store;var _wksExports=_wks.exports,def=_objectDp.f,has$3=_has,TAG=_wksExports("toStringTag"),_setToStringTag=function(o,et,tt){o&&!has$3(o=tt?o:o.prototype,TAG)&&def(o,TAG,{configurable:!0,value:et})},create$2=_objectCreate,descriptor=_propertyDesc,setToStringTag$2=_setToStringTag,IteratorPrototype={};_hide(IteratorPrototype,_wksExports("iterator"),function(){return this});var _iterCreate=function(o,et,tt){o.prototype=create$2(IteratorPrototype,{next:descriptor(1,tt)}),setToStringTag$2(o,et+" Iterator")},$export$3=_export,redefine$1=_redefine,hide$1=_hide,Iterators$2=_iterators,$iterCreate=_iterCreate,setToStringTag$1=_setToStringTag,getPrototypeOf=_objectGpo,ITERATOR=_wksExports("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this},_iterDefine=function(o,et,tt,rt,it,nt,at){$iterCreate(tt,et,rt);var st=function(St){if(!BUGGY&&St in vt)return vt[St];switch(St){case KEYS:return function(){return new tt(this,St)};case VALUES:return function(){return new tt(this,St)}}return function(){return new tt(this,St)}},ot=et+" Iterator",lt=it==VALUES,dt=!1,vt=o.prototype,yt=vt[ITERATOR]||vt[FF_ITERATOR]||it&&vt[it],kt=yt||st(it),ht=it?lt?st("entries"):kt:void 0,mt=et=="Array"&&vt.entries||yt,Et,pt,bt;if(mt&&(bt=getPrototypeOf(mt.call(new o)),bt!==Object.prototype&&bt.next&&setToStringTag$1(bt,ot,!0)),lt&&yt&&yt.name!==VALUES&&(dt=!0,kt=function(){return yt.call(this)}),at&&(BUGGY||dt||!vt[ITERATOR])&&hide$1(vt,ITERATOR,kt),Iterators$2[et]=kt,Iterators$2[ot]=returnThis,it)if(Et={values:lt?kt:st(VALUES),keys:nt?kt:st(KEYS),entries:ht},at)for(pt in Et)pt in vt||redefine$1(vt,pt,Et[pt]);else $export$3($export$3.P+$export$3.F*(BUGGY||dt),et,Et);return Et},$at=_stringAt(!0);_iterDefine(String,"String",function(o){this._t=String(o),this._i=0},function(){var o=this._t,et=this._i,tt;return et>=o.length?{value:void 0,done:!0}:(tt=$at(o,et),this._i+=tt.length,{value:tt,done:!1})});var _iterStep=function(o,et){return{value:et,done:!!o}},step=_iterStep,Iterators$1=_iterators,toIObject$3=_toIobject;_iterDefine(Array,"Array",function(o,et){this._t=toIObject$3(o),this._i=0,this._k=et},function(){var o=this._t,et=this._k,tt=this._i++;return!o||tt>=o.length?(this._t=void 0,step(1)):et=="keys"?step(0,tt):et=="values"?step(0,o[tt]):step(0,[tt,o[tt]])},"values");Iterators$1.Arguments=Iterators$1.Array;var global$2=_globalExports,hide=_hide,Iterators=_iterators,TO_STRING_TAG=_wksExports("toStringTag"),DOMIterables="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(",");for(var i=0;int;)it.call(o,at=rt[nt++])&&et.push(at);return et},cof=_cof,_isArray=Array.isArray||function o(et){return cof(et)=="Array"},_objectGopnExt={},_objectGopn={},$keys$1=_objectKeysInternal,hiddenKeys=_enumBugKeys.concat("length","prototype");_objectGopn.f=Object.getOwnPropertyNames||function o(et){return $keys$1(et,hiddenKeys)};var toIObject$2=_toIobject,gOPN$1=_objectGopn.f,toString={}.toString,windowNames=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(o){try{return gOPN$1(o)}catch{return windowNames.slice()}};_objectGopnExt.f=function o(et){return windowNames&&toString.call(et)=="[object Window]"?getWindowNames(et):gOPN$1(toIObject$2(et))};var _objectGopd={},pIE=_objectPie,createDesc$1=_propertyDesc,toIObject$1=_toIobject,toPrimitive$1=_toPrimitive,has$1=_has,IE8_DOM_DEFINE=_ie8DomDefine,gOPD$1=Object.getOwnPropertyDescriptor;_objectGopd.f=_descriptors?gOPD$1:function o(et,tt){if(et=toIObject$1(et),tt=toPrimitive$1(tt,!0),IE8_DOM_DEFINE)try{return gOPD$1(et,tt)}catch{}if(has$1(et,tt))return createDesc$1(!pIE.f.call(et,tt),et[tt])};var global$1=_globalExports,has=_has,DESCRIPTORS=_descriptors,$export$2=_export,redefine=_redefine,META=_metaExports.KEY,$fails=_fails,shared=_sharedExports,setToStringTag=_setToStringTag,uid=_uid,wks=_wksExports,wksExt=_wksExt,wksDefine=_wksDefine,enumKeys=_enumKeys,isArray=_isArray,anObject=_anObject,isObject=_isObject,toObject=_toObject,toIObject=_toIobject,toPrimitive=_toPrimitive,createDesc=_propertyDesc,_create$1=_objectCreate,gOPNExt=_objectGopnExt,$GOPD=_objectGopd,$GOPS=_objectGops,$DP=_objectDp,$keys=_objectKeys,gOPD=$GOPD.f,dP=$DP.f,gOPN=gOPNExt.f,$Symbol=global$1.Symbol,$JSON=global$1.JSON,_stringify=$JSON&&$JSON.stringify,PROTOTYPE="prototype",HIDDEN=wks("_hidden"),TO_PRIMITIVE=wks("toPrimitive"),isEnum={}.propertyIsEnumerable,SymbolRegistry=shared("symbol-registry"),AllSymbols=shared("symbols"),OPSymbols=shared("op-symbols"),ObjectProto=Object[PROTOTYPE],USE_NATIVE=typeof $Symbol=="function"&&!!$GOPS.f,QObject=global$1.QObject,setter=!QObject||!QObject[PROTOTYPE]||!QObject[PROTOTYPE].findChild,setSymbolDesc=DESCRIPTORS&&$fails(function(){return _create$1(dP({},"a",{get:function(){return dP(this,"a",{value:7}).a}})).a!=7})?function(o,et,tt){var rt=gOPD(ObjectProto,et);rt&&delete ObjectProto[et],dP(o,et,tt),rt&&o!==ObjectProto&&dP(ObjectProto,et,rt)}:dP,wrap=function(o){var et=AllSymbols[o]=_create$1($Symbol[PROTOTYPE]);return et._k=o,et},isSymbol=USE_NATIVE&&typeof $Symbol.iterator=="symbol"?function(o){return typeof o=="symbol"}:function(o){return o instanceof $Symbol},$defineProperty=function o(et,tt,rt){return et===ObjectProto&&$defineProperty(OPSymbols,tt,rt),anObject(et),tt=toPrimitive(tt,!0),anObject(rt),has(AllSymbols,tt)?(rt.enumerable?(has(et,HIDDEN)&&et[HIDDEN][tt]&&(et[HIDDEN][tt]=!1),rt=_create$1(rt,{enumerable:createDesc(0,!1)})):(has(et,HIDDEN)||dP(et,HIDDEN,createDesc(1,{})),et[HIDDEN][tt]=!0),setSymbolDesc(et,tt,rt)):dP(et,tt,rt)},$defineProperties=function o(et,tt){anObject(et);for(var rt=enumKeys(tt=toIObject(tt)),it=0,nt=rt.length,at;nt>it;)$defineProperty(et,at=rt[it++],tt[at]);return et},$create=function o(et,tt){return tt===void 0?_create$1(et):$defineProperties(_create$1(et),tt)},$propertyIsEnumerable=function o(et){var tt=isEnum.call(this,et=toPrimitive(et,!0));return this===ObjectProto&&has(AllSymbols,et)&&!has(OPSymbols,et)?!1:tt||!has(this,et)||!has(AllSymbols,et)||has(this,HIDDEN)&&this[HIDDEN][et]?tt:!0},$getOwnPropertyDescriptor=function o(et,tt){if(et=toIObject(et),tt=toPrimitive(tt,!0),!(et===ObjectProto&&has(AllSymbols,tt)&&!has(OPSymbols,tt))){var rt=gOPD(et,tt);return rt&&has(AllSymbols,tt)&&!(has(et,HIDDEN)&&et[HIDDEN][tt])&&(rt.enumerable=!0),rt}},$getOwnPropertyNames=function o(et){for(var tt=gOPN(toIObject(et)),rt=[],it=0,nt;tt.length>it;)!has(AllSymbols,nt=tt[it++])&&nt!=HIDDEN&&nt!=META&&rt.push(nt);return rt},$getOwnPropertySymbols=function o(et){for(var tt=et===ObjectProto,rt=gOPN(tt?OPSymbols:toIObject(et)),it=[],nt=0,at;rt.length>nt;)has(AllSymbols,at=rt[nt++])&&(!tt||has(ObjectProto,at))&&it.push(AllSymbols[at]);return it};USE_NATIVE||($Symbol=function(){if(this instanceof $Symbol)throw TypeError("Symbol is not a constructor!");var et=uid(arguments.length>0?arguments[0]:void 0),tt=function(rt){this===ObjectProto&&tt.call(OPSymbols,rt),has(this,HIDDEN)&&has(this[HIDDEN],et)&&(this[HIDDEN][et]=!1),setSymbolDesc(this,et,createDesc(1,rt))};return DESCRIPTORS&&setter&&setSymbolDesc(ObjectProto,et,{configurable:!0,set:tt}),wrap(et)},redefine($Symbol[PROTOTYPE],"toString",function(){return this._k}),$GOPD.f=$getOwnPropertyDescriptor,$DP.f=$defineProperty,_objectGopn.f=gOPNExt.f=$getOwnPropertyNames,_objectPie.f=$propertyIsEnumerable,$GOPS.f=$getOwnPropertySymbols,DESCRIPTORS&&!_library&&redefine(ObjectProto,"propertyIsEnumerable",$propertyIsEnumerable),wksExt.f=function(o){return wrap(wks(o))});$export$2($export$2.G+$export$2.W+$export$2.F*!USE_NATIVE,{Symbol:$Symbol});for(var es6Symbols="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),j=0;es6Symbols.length>j;)wks(es6Symbols[j++]);for(var wellKnownSymbols=$keys(wks.store),k=0;wellKnownSymbols.length>k;)wksDefine(wellKnownSymbols[k++]);$export$2($export$2.S+$export$2.F*!USE_NATIVE,"Symbol",{for:function(o){return has(SymbolRegistry,o+="")?SymbolRegistry[o]:SymbolRegistry[o]=$Symbol(o)},keyFor:function o(et){if(!isSymbol(et))throw TypeError(et+" is not a symbol!");for(var tt in SymbolRegistry)if(SymbolRegistry[tt]===et)return tt},useSetter:function(){setter=!0},useSimple:function(){setter=!1}});$export$2($export$2.S+$export$2.F*!USE_NATIVE,"Object",{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor,getOwnPropertyNames:$getOwnPropertyNames,getOwnPropertySymbols:$getOwnPropertySymbols});var FAILS_ON_PRIMITIVES=$fails(function(){$GOPS.f(1)});$export$2($export$2.S+$export$2.F*FAILS_ON_PRIMITIVES,"Object",{getOwnPropertySymbols:function o(et){return $GOPS.f(toObject(et))}});$JSON&&$export$2($export$2.S+$export$2.F*(!USE_NATIVE||$fails(function(){var o=$Symbol();return _stringify([o])!="[null]"||_stringify({a:o})!="{}"||_stringify(Object(o))!="{}"})),"JSON",{stringify:function o(et){for(var tt=[et],rt=1,it,nt;arguments.length>rt;)tt.push(arguments[rt++]);if(nt=it=tt[1],!(!isObject(it)&&et===void 0||isSymbol(et)))return isArray(it)||(it=function(at,st){if(typeof nt=="function"&&(st=nt.call(this,at,st)),!isSymbol(st))return st}),tt[1]=it,_stringify.apply($JSON,tt)}});$Symbol[PROTOTYPE][TO_PRIMITIVE]||_hide($Symbol[PROTOTYPE],TO_PRIMITIVE,$Symbol[PROTOTYPE].valueOf);setToStringTag($Symbol,"Symbol");setToStringTag(Math,"Math",!0);setToStringTag(global$1.JSON,"JSON",!0);_wksDefine("asyncIterator");_wksDefine("observable");var symbol$1=_coreExports.Symbol,symbol={default:symbol$1,__esModule:!0};_typeof$1.__esModule=!0;var _iterator=iterator,_iterator2=_interopRequireDefault$3(_iterator),_symbol=symbol,_symbol2=_interopRequireDefault$3(_symbol),_typeof=typeof _symbol2.default=="function"&&typeof _iterator2.default=="symbol"?function(o){return typeof o}:function(o){return o&&typeof _symbol2.default=="function"&&o.constructor===_symbol2.default&&o!==_symbol2.default.prototype?"symbol":typeof o};function _interopRequireDefault$3(o){return o&&o.__esModule?o:{default:o}}_typeof$1.default=typeof _symbol2.default=="function"&&_typeof(_iterator2.default)==="symbol"?function(o){return typeof o>"u"?"undefined":_typeof(o)}:function(o){return o&&typeof _symbol2.default=="function"&&o.constructor===_symbol2.default&&o!==_symbol2.default.prototype?"symbol":typeof o>"u"?"undefined":_typeof(o)};possibleConstructorReturn.__esModule=!0;var _typeof2$1=_typeof$1,_typeof3$1=_interopRequireDefault$2(_typeof2$1);function _interopRequireDefault$2(o){return o&&o.__esModule?o:{default:o}}possibleConstructorReturn.default=function(o,et){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return et&&((typeof et>"u"?"undefined":(0,_typeof3$1.default)(et))==="object"||typeof et=="function")?et:o};var inherits={},_setProto,hasRequired_setProto;function require_setProto(){if(hasRequired_setProto)return _setProto;hasRequired_setProto=1;var o=_isObject,et=_anObject,tt=function(rt,it){if(et(rt),!o(it)&&it!==null)throw TypeError(it+": can't set as prototype!")};return _setProto={set:Object.setPrototypeOf||("__proto__"in{}?function(rt,it,nt){try{nt=_ctx(Function.call,_objectGopd.f(Object.prototype,"__proto__").set,2),nt(rt,[]),it=!(rt instanceof Array)}catch{it=!0}return function(st,ot){return tt(st,ot),it?st.__proto__=ot:nt(st,ot),st}}({},!1):void 0),check:tt},_setProto}var $export$1=_export;$export$1($export$1.S,"Object",{setPrototypeOf:require_setProto().set});var setPrototypeOf$1=_coreExports.Object.setPrototypeOf,setPrototypeOf={default:setPrototypeOf$1,__esModule:!0},$export=_export;$export($export.S,"Object",{create:_objectCreate});var $Object=_coreExports.Object,create$1=function o(et,tt){return $Object.create(et,tt)},create={default:create$1,__esModule:!0};inherits.__esModule=!0;var _setPrototypeOf=setPrototypeOf,_setPrototypeOf2=_interopRequireDefault$1(_setPrototypeOf),_create=create,_create2=_interopRequireDefault$1(_create),_typeof2=_typeof$1,_typeof3=_interopRequireDefault$1(_typeof2);function _interopRequireDefault$1(o){return o&&o.__esModule?o:{default:o}}inherits.default=function(o,et){if(typeof et!="function"&&et!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof et>"u"?"undefined":(0,_typeof3.default)(et)));o.prototype=(0,_create2.default)(et&&et.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),et&&(_setPrototypeOf2.default?(0,_setPrototypeOf2.default)(o,et):o.__proto__=et)};Object.defineProperty(dist,"__esModule",{value:!0});var _extends2=_extends,_extends3=_interopRequireDefault(_extends2),_getPrototypeOf=getPrototypeOf$1,_getPrototypeOf2=_interopRequireDefault(_getPrototypeOf),_classCallCheck2=classCallCheck,_classCallCheck3=_interopRequireDefault(_classCallCheck2),_createClass2=createClass,_createClass3=_interopRequireDefault(_createClass2),_possibleConstructorReturn2=possibleConstructorReturn,_possibleConstructorReturn3=_interopRequireDefault(_possibleConstructorReturn2),_inherits2=inherits,_inherits3=_interopRequireDefault(_inherits2),_react=reactExports,_react2=_interopRequireDefault(_react),_propTypes=propTypesExports,_propTypes2=_interopRequireDefault(_propTypes),_lottieWeb=lottieExports,_lottieWeb2=_interopRequireDefault(_lottieWeb);function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}var Lottie=function(o){(0,_inherits3.default)(et,o);function et(){var tt,rt,it,nt;(0,_classCallCheck3.default)(this,et);for(var at=arguments.length,st=Array(at),ot=0;otjsxRuntimeExports.jsx(Flex,{style:{width:"167px",height:"167px",opacity:.5},children:jsxRuntimeExports.jsx(_default,{height:167,options:{loop:!0,autoplay:!0,animationData:preloadData,rendererSettings:{preserveAspectRatio:"xMidYMid slice"}},width:167})}),Splash=reactExports.memo(({children:o})=>{const[et,tt]=reactExports.useState(initialMessageData),[rt,it]=reactExports.useState(0),[nt,at]=reactExports.useState(!0),{appMetaData:st,setAppMetaData:ot}=useAppStore(kt=>kt),{stats:lt,setStats:dt,isFetching:vt}=useDataStore(kt=>kt),yt=reactExports.useCallback(async()=>{try{if(!st){const kt=await getAboutData();ot(kt)}if(!lt){const kt=await getStats(),ht=formatStatsResponse(kt);dt(ht);const mt=formatSplashMessage(kt);tt(mt)}}catch{at(!1),it(100)}},[st,ot,dt,lt]);return reactExports.useEffect(()=>{yt();let kt,ht;return!vt&&et&&st&&(it(mt=>mt||50),ht=setInterval(()=>{it(mt=>mt>=100?100:mt+Math.floor(Math.random()*4))},100),kt=setTimeout(()=>at(!1),5e3)),()=>{clearTimeout(kt),clearInterval(ht)}},[st,yt,vt,et,lt]),nt&&(!et.some(({value:kt})=>!!kt)||!st)?null:jsxRuntimeExports.jsx(SplashWrapper,{children:nt?jsxRuntimeExports.jsxs(Wrappper,{align:"center",direction:"row",justify:"center",children:[jsxRuntimeExports.jsx(SphereAnimation,{}),jsxRuntimeExports.jsxs(Flex,{style:{color:colors.white},children:[jsxRuntimeExports.jsxs(TitleWrapper,{children:[jsxRuntimeExports.jsx(Text,{className:"title",children:st==null?void 0:st.title}),jsxRuntimeExports.jsx(Text,{className:"subtitle",children:"Second Brain"})]}),jsxRuntimeExports.jsx(LinearProgress$1,{color:"inherit",sx:{my:1.75,height:"2px"},value:rt,variant:"determinate"}),jsxRuntimeExports.jsx(AnimatedTextContent,{message:et})]})]}):o})}),TitleWrapper=styled$3.div` +`;var dist={},_extends={},_global={exports:{}},global$5=_global.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=global$5);var _globalExports=_global.exports,_core={exports:{}},core$4=_core.exports={version:"2.6.12"};typeof __e=="number"&&(__e=core$4);var _coreExports=_core.exports,_aFunction=function(o){if(typeof o!="function")throw TypeError(o+" is not a function!");return o},aFunction=_aFunction,_ctx=function(o,et,tt){if(aFunction(o),et===void 0)return o;switch(tt){case 1:return function(rt){return o.call(et,rt)};case 2:return function(rt,it){return o.call(et,rt,it)};case 3:return function(rt,it,nt){return o.call(et,rt,it,nt)}}return function(){return o.apply(et,arguments)}},_objectDp={},_isObject=function(o){return typeof o=="object"?o!==null:typeof o=="function"},isObject$3=_isObject,_anObject=function(o){if(!isObject$3(o))throw TypeError(o+" is not an object!");return o},_fails=function(o){try{return!!o()}catch{return!0}},_descriptors,hasRequired_descriptors;function require_descriptors(){return hasRequired_descriptors||(hasRequired_descriptors=1,_descriptors=!_fails(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})),_descriptors}var _domCreate,hasRequired_domCreate;function require_domCreate(){if(hasRequired_domCreate)return _domCreate;hasRequired_domCreate=1;var o=_isObject,et=_globalExports.document,tt=o(et)&&o(et.createElement);return _domCreate=function(rt){return tt?et.createElement(rt):{}},_domCreate}var _ie8DomDefine,hasRequired_ie8DomDefine;function require_ie8DomDefine(){return hasRequired_ie8DomDefine||(hasRequired_ie8DomDefine=1,_ie8DomDefine=!require_descriptors()&&!_fails(function(){return Object.defineProperty(require_domCreate()("div"),"a",{get:function(){return 7}}).a!=7})),_ie8DomDefine}var isObject$2=_isObject,_toPrimitive=function(o,et){if(!isObject$2(o))return o;var tt,rt;if(et&&typeof(tt=o.toString)=="function"&&!isObject$2(rt=tt.call(o))||typeof(tt=o.valueOf)=="function"&&!isObject$2(rt=tt.call(o))||!et&&typeof(tt=o.toString)=="function"&&!isObject$2(rt=tt.call(o)))return rt;throw TypeError("Can't convert object to primitive value")},hasRequired_objectDp;function require_objectDp(){if(hasRequired_objectDp)return _objectDp;hasRequired_objectDp=1;var o=_anObject,et=require_ie8DomDefine(),tt=_toPrimitive,rt=Object.defineProperty;return _objectDp.f=require_descriptors()?Object.defineProperty:function(nt,at,st){if(o(nt),at=tt(at,!0),o(st),et)try{return rt(nt,at,st)}catch{}if("get"in st||"set"in st)throw TypeError("Accessors not supported!");return"value"in st&&(nt[at]=st.value),nt},_objectDp}var _propertyDesc=function(o,et){return{enumerable:!(o&1),configurable:!(o&2),writable:!(o&4),value:et}},dP$2=require_objectDp(),createDesc$2=_propertyDesc,_hide=require_descriptors()?function(o,et,tt){return dP$2.f(o,et,createDesc$2(1,tt))}:function(o,et,tt){return o[et]=tt,o},hasOwnProperty={}.hasOwnProperty,_has=function(o,et){return hasOwnProperty.call(o,et)},global$4=_globalExports,core$3=_coreExports,ctx=_ctx,hide$2=_hide,has$6=_has,PROTOTYPE$2="prototype",$export$7=function(o,et,tt){var rt=o&$export$7.F,it=o&$export$7.G,nt=o&$export$7.S,at=o&$export$7.P,st=o&$export$7.B,ot=o&$export$7.W,lt=it?core$3:core$3[et]||(core$3[et]={}),dt=lt[PROTOTYPE$2],vt=it?global$4:nt?global$4[et]:(global$4[et]||{})[PROTOTYPE$2],yt,kt,ht;it&&(tt=et);for(yt in tt)kt=!rt&&vt&&vt[yt]!==void 0,!(kt&&has$6(lt,yt))&&(ht=kt?vt[yt]:tt[yt],lt[yt]=it&&typeof vt[yt]!="function"?tt[yt]:st&&kt?ctx(ht,global$4):ot&&vt[yt]==ht?function(mt){var Et=function(pt,bt,St){if(this instanceof mt){switch(arguments.length){case 0:return new mt;case 1:return new mt(pt);case 2:return new mt(pt,bt)}return new mt(pt,bt,St)}return mt.apply(this,arguments)};return Et[PROTOTYPE$2]=mt[PROTOTYPE$2],Et}(ht):at&&typeof ht=="function"?ctx(Function.call,ht):ht,at&&((lt.virtual||(lt.virtual={}))[yt]=ht,o&$export$7.R&&dt&&!dt[yt]&&hide$2(dt,yt,ht)))};$export$7.F=1;$export$7.G=2;$export$7.S=4;$export$7.P=8;$export$7.B=16;$export$7.W=32;$export$7.U=64;$export$7.R=128;var _export=$export$7,toString$1={}.toString,_cof=function(o){return toString$1.call(o).slice(8,-1)},_iobject,hasRequired_iobject;function require_iobject(){if(hasRequired_iobject)return _iobject;hasRequired_iobject=1;var o=_cof;return _iobject=Object("z").propertyIsEnumerable(0)?Object:function(et){return o(et)=="String"?et.split(""):Object(et)},_iobject}var _defined=function(o){if(o==null)throw TypeError("Can't call method on "+o);return o},IObject=require_iobject(),defined$2=_defined,_toIobject=function(o){return IObject(defined$2(o))},ceil=Math.ceil,floor=Math.floor,_toInteger=function(o){return isNaN(o=+o)?0:(o>0?floor:ceil)(o)},toInteger$2=_toInteger,min$1=Math.min,_toLength=function(o){return o>0?min$1(toInteger$2(o),9007199254740991):0},toInteger$1=_toInteger,max=Math.max,min=Math.min,_toAbsoluteIndex=function(o,et){return o=toInteger$1(o),o<0?max(o+et,0):min(o,et)},toIObject$5=_toIobject,toLength=_toLength,toAbsoluteIndex=_toAbsoluteIndex,_arrayIncludes=function(o){return function(et,tt,rt){var it=toIObject$5(et),nt=toLength(it.length),at=toAbsoluteIndex(rt,nt),st;if(o&&tt!=tt){for(;nt>at;)if(st=it[at++],st!=st)return!0}else for(;nt>at;at++)if((o||at in it)&&it[at]===tt)return o||at||0;return!o&&-1}},_shared={exports:{}},_library=!0,core$2=_coreExports,global$3=_globalExports,SHARED="__core-js_shared__",store$1=global$3[SHARED]||(global$3[SHARED]={});(_shared.exports=function(o,et){return store$1[o]||(store$1[o]=et!==void 0?et:{})})("versions",[]).push({version:core$2.version,mode:"pure",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"});var _sharedExports=_shared.exports,id$1=0,px=Math.random(),_uid=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++id$1+px).toString(36))},shared$1=_sharedExports("keys"),uid$2=_uid,_sharedKey=function(o){return shared$1[o]||(shared$1[o]=uid$2(o))},has$5=_has,toIObject$4=_toIobject,arrayIndexOf=_arrayIncludes(!1),IE_PROTO$2=_sharedKey("IE_PROTO"),_objectKeysInternal=function(o,et){var tt=toIObject$4(o),rt=0,it=[],nt;for(nt in tt)nt!=IE_PROTO$2&&has$5(tt,nt)&&it.push(nt);for(;et.length>rt;)has$5(tt,nt=et[rt++])&&(~arrayIndexOf(it,nt)||it.push(nt));return it},_enumBugKeys="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),$keys$2=_objectKeysInternal,enumBugKeys$1=_enumBugKeys,_objectKeys=Object.keys||function o(et){return $keys$2(et,enumBugKeys$1)},_objectGops={};_objectGops.f=Object.getOwnPropertySymbols;var _objectPie={},hasRequired_objectPie;function require_objectPie(){return hasRequired_objectPie||(hasRequired_objectPie=1,_objectPie.f={}.propertyIsEnumerable),_objectPie}var defined$1=_defined,_toObject=function(o){return Object(defined$1(o))},_objectAssign,hasRequired_objectAssign;function require_objectAssign(){if(hasRequired_objectAssign)return _objectAssign;hasRequired_objectAssign=1;var o=require_descriptors(),et=_objectKeys,tt=_objectGops,rt=require_objectPie(),it=_toObject,nt=require_iobject(),at=Object.assign;return _objectAssign=!at||_fails(function(){var st={},ot={},lt=Symbol(),dt="abcdefghijklmnopqrst";return st[lt]=7,dt.split("").forEach(function(vt){ot[vt]=vt}),at({},st)[lt]!=7||Object.keys(at({},ot)).join("")!=dt})?function(ot,lt){for(var dt=it(ot),vt=arguments.length,yt=1,kt=tt.f,ht=rt.f;vt>yt;)for(var mt=nt(arguments[yt++]),Et=kt?et(mt).concat(kt(mt)):et(mt),pt=Et.length,bt=0,St;pt>bt;)St=Et[bt++],(!o||ht.call(mt,St))&&(dt[St]=mt[St]);return dt}:at,_objectAssign}var $export$6=_export;$export$6($export$6.S+$export$6.F,"Object",{assign:require_objectAssign()});var assign$1=_coreExports.Object.assign,assign={default:assign$1,__esModule:!0};_extends.__esModule=!0;var _assign=assign,_assign2=_interopRequireDefault$5(_assign);function _interopRequireDefault$5(o){return o&&o.__esModule?o:{default:o}}_extends.default=_assign2.default||function(o){for(var et=1;et=nt?o?"":void 0:(at=rt.charCodeAt(it),at<55296||at>56319||it+1===nt||(st=rt.charCodeAt(it+1))<56320||st>57343?o?rt.charAt(it):at:o?rt.slice(it,it+2):(at-55296<<10)+(st-56320)+65536)}},_redefine=_hide,_iterators={},dP$1=require_objectDp(),anObject$2=_anObject,getKeys$1=_objectKeys,_objectDps=require_descriptors()?Object.defineProperties:function o(et,tt){anObject$2(et);for(var rt=getKeys$1(tt),it=rt.length,nt=0,at;it>nt;)dP$1.f(et,at=rt[nt++],tt[at]);return et},_html,hasRequired_html;function require_html(){if(hasRequired_html)return _html;hasRequired_html=1;var o=_globalExports.document;return _html=o&&o.documentElement,_html}var anObject$1=_anObject,dPs=_objectDps,enumBugKeys=_enumBugKeys,IE_PROTO=_sharedKey("IE_PROTO"),Empty=function(){},PROTOTYPE$1="prototype",createDict=function(){var o=require_domCreate()("iframe"),et=enumBugKeys.length,tt="<",rt=">",it;for(o.style.display="none",require_html().appendChild(o),o.src="javascript:",it=o.contentWindow.document,it.open(),it.write(tt+"script"+rt+"document.F=Object"+tt+"/script"+rt),it.close(),createDict=it.F;et--;)delete createDict[PROTOTYPE$1][enumBugKeys[et]];return createDict()},_objectCreate=Object.create||function o(et,tt){var rt;return et!==null?(Empty[PROTOTYPE$1]=anObject$1(et),rt=new Empty,Empty[PROTOTYPE$1]=null,rt[IE_PROTO]=et):rt=createDict(),tt===void 0?rt:dPs(rt,tt)},_wks={exports:{}},store=_sharedExports("wks"),uid$1=_uid,Symbol$1=_globalExports.Symbol,USE_SYMBOL=typeof Symbol$1=="function",$exports=_wks.exports=function(o){return store[o]||(store[o]=USE_SYMBOL&&Symbol$1[o]||(USE_SYMBOL?Symbol$1:uid$1)("Symbol."+o))};$exports.store=store;var _wksExports=_wks.exports,def=require_objectDp().f,has$3=_has,TAG=_wksExports("toStringTag"),_setToStringTag=function(o,et,tt){o&&!has$3(o=tt?o:o.prototype,TAG)&&def(o,TAG,{configurable:!0,value:et})},create$2=_objectCreate,descriptor=_propertyDesc,setToStringTag$2=_setToStringTag,IteratorPrototype={};_hide(IteratorPrototype,_wksExports("iterator"),function(){return this});var _iterCreate=function(o,et,tt){o.prototype=create$2(IteratorPrototype,{next:descriptor(1,tt)}),setToStringTag$2(o,et+" Iterator")},$export$3=_export,redefine$1=_redefine,hide$1=_hide,Iterators$2=_iterators,$iterCreate=_iterCreate,setToStringTag$1=_setToStringTag,getPrototypeOf=_objectGpo,ITERATOR=_wksExports("iterator"),BUGGY=!([].keys&&"next"in[].keys()),FF_ITERATOR="@@iterator",KEYS="keys",VALUES="values",returnThis=function(){return this},_iterDefine=function(o,et,tt,rt,it,nt,at){$iterCreate(tt,et,rt);var st=function(St){if(!BUGGY&&St in vt)return vt[St];switch(St){case KEYS:return function(){return new tt(this,St)};case VALUES:return function(){return new tt(this,St)}}return function(){return new tt(this,St)}},ot=et+" Iterator",lt=it==VALUES,dt=!1,vt=o.prototype,yt=vt[ITERATOR]||vt[FF_ITERATOR]||it&&vt[it],kt=yt||st(it),ht=it?lt?st("entries"):kt:void 0,mt=et=="Array"&&vt.entries||yt,Et,pt,bt;if(mt&&(bt=getPrototypeOf(mt.call(new o)),bt!==Object.prototype&&bt.next&&setToStringTag$1(bt,ot,!0)),lt&&yt&&yt.name!==VALUES&&(dt=!0,kt=function(){return yt.call(this)}),at&&(BUGGY||dt||!vt[ITERATOR])&&hide$1(vt,ITERATOR,kt),Iterators$2[et]=kt,Iterators$2[ot]=returnThis,it)if(Et={values:lt?kt:st(VALUES),keys:nt?kt:st(KEYS),entries:ht},at)for(pt in Et)pt in vt||redefine$1(vt,pt,Et[pt]);else $export$3($export$3.P+$export$3.F*(BUGGY||dt),et,Et);return Et},$at=_stringAt(!0);_iterDefine(String,"String",function(o){this._t=String(o),this._i=0},function(){var o=this._t,et=this._i,tt;return et>=o.length?{value:void 0,done:!0}:(tt=$at(o,et),this._i+=tt.length,{value:tt,done:!1})});var _iterStep=function(o,et){return{value:et,done:!!o}},step=_iterStep,Iterators$1=_iterators,toIObject$3=_toIobject;_iterDefine(Array,"Array",function(o,et){this._t=toIObject$3(o),this._i=0,this._k=et},function(){var o=this._t,et=this._k,tt=this._i++;return!o||tt>=o.length?(this._t=void 0,step(1)):et=="keys"?step(0,tt):et=="values"?step(0,o[tt]):step(0,[tt,o[tt]])},"values");Iterators$1.Arguments=Iterators$1.Array;var global$2=_globalExports,hide=_hide,Iterators=_iterators,TO_STRING_TAG=_wksExports("toStringTag"),DOMIterables="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(",");for(var i=0;int;)it.call(o,at=rt[nt++])&&et.push(at);return et},cof=_cof,_isArray=Array.isArray||function o(et){return cof(et)=="Array"},_objectGopnExt={},_objectGopn={},$keys$1=_objectKeysInternal,hiddenKeys=_enumBugKeys.concat("length","prototype");_objectGopn.f=Object.getOwnPropertyNames||function o(et){return $keys$1(et,hiddenKeys)};var toIObject$2=_toIobject,gOPN$1=_objectGopn.f,toString={}.toString,windowNames=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],getWindowNames=function(o){try{return gOPN$1(o)}catch{return windowNames.slice()}};_objectGopnExt.f=function o(et){return windowNames&&toString.call(et)=="[object Window]"?getWindowNames(et):gOPN$1(toIObject$2(et))};var _objectGopd={},pIE=require_objectPie(),createDesc$1=_propertyDesc,toIObject$1=_toIobject,toPrimitive$1=_toPrimitive,has$1=_has,IE8_DOM_DEFINE=require_ie8DomDefine(),gOPD$1=Object.getOwnPropertyDescriptor;_objectGopd.f=require_descriptors()?gOPD$1:function o(et,tt){if(et=toIObject$1(et),tt=toPrimitive$1(tt,!0),IE8_DOM_DEFINE)try{return gOPD$1(et,tt)}catch{}if(has$1(et,tt))return createDesc$1(!pIE.f.call(et,tt),et[tt])};var global$1=_globalExports,has=_has,DESCRIPTORS=require_descriptors(),$export$2=_export,redefine=_redefine,META=_metaExports.KEY,$fails=_fails,shared=_sharedExports,setToStringTag=_setToStringTag,uid=_uid,wks=_wksExports,wksExt=_wksExt,wksDefine=_wksDefine,enumKeys=_enumKeys,isArray=_isArray,anObject=_anObject,isObject=_isObject,toObject=_toObject,toIObject=_toIobject,toPrimitive=_toPrimitive,createDesc=_propertyDesc,_create$1=_objectCreate,gOPNExt=_objectGopnExt,$GOPD=_objectGopd,$GOPS=_objectGops,$DP=require_objectDp(),$keys=_objectKeys,gOPD=$GOPD.f,dP=$DP.f,gOPN=gOPNExt.f,$Symbol=global$1.Symbol,$JSON=global$1.JSON,_stringify=$JSON&&$JSON.stringify,PROTOTYPE="prototype",HIDDEN=wks("_hidden"),TO_PRIMITIVE=wks("toPrimitive"),isEnum={}.propertyIsEnumerable,SymbolRegistry=shared("symbol-registry"),AllSymbols=shared("symbols"),OPSymbols=shared("op-symbols"),ObjectProto=Object[PROTOTYPE],USE_NATIVE=typeof $Symbol=="function"&&!!$GOPS.f,QObject=global$1.QObject,setter=!QObject||!QObject[PROTOTYPE]||!QObject[PROTOTYPE].findChild,setSymbolDesc=DESCRIPTORS&&$fails(function(){return _create$1(dP({},"a",{get:function(){return dP(this,"a",{value:7}).a}})).a!=7})?function(o,et,tt){var rt=gOPD(ObjectProto,et);rt&&delete ObjectProto[et],dP(o,et,tt),rt&&o!==ObjectProto&&dP(ObjectProto,et,rt)}:dP,wrap=function(o){var et=AllSymbols[o]=_create$1($Symbol[PROTOTYPE]);return et._k=o,et},isSymbol=USE_NATIVE&&typeof $Symbol.iterator=="symbol"?function(o){return typeof o=="symbol"}:function(o){return o instanceof $Symbol},$defineProperty=function o(et,tt,rt){return et===ObjectProto&&$defineProperty(OPSymbols,tt,rt),anObject(et),tt=toPrimitive(tt,!0),anObject(rt),has(AllSymbols,tt)?(rt.enumerable?(has(et,HIDDEN)&&et[HIDDEN][tt]&&(et[HIDDEN][tt]=!1),rt=_create$1(rt,{enumerable:createDesc(0,!1)})):(has(et,HIDDEN)||dP(et,HIDDEN,createDesc(1,{})),et[HIDDEN][tt]=!0),setSymbolDesc(et,tt,rt)):dP(et,tt,rt)},$defineProperties=function o(et,tt){anObject(et);for(var rt=enumKeys(tt=toIObject(tt)),it=0,nt=rt.length,at;nt>it;)$defineProperty(et,at=rt[it++],tt[at]);return et},$create=function o(et,tt){return tt===void 0?_create$1(et):$defineProperties(_create$1(et),tt)},$propertyIsEnumerable=function o(et){var tt=isEnum.call(this,et=toPrimitive(et,!0));return this===ObjectProto&&has(AllSymbols,et)&&!has(OPSymbols,et)?!1:tt||!has(this,et)||!has(AllSymbols,et)||has(this,HIDDEN)&&this[HIDDEN][et]?tt:!0},$getOwnPropertyDescriptor=function o(et,tt){if(et=toIObject(et),tt=toPrimitive(tt,!0),!(et===ObjectProto&&has(AllSymbols,tt)&&!has(OPSymbols,tt))){var rt=gOPD(et,tt);return rt&&has(AllSymbols,tt)&&!(has(et,HIDDEN)&&et[HIDDEN][tt])&&(rt.enumerable=!0),rt}},$getOwnPropertyNames=function o(et){for(var tt=gOPN(toIObject(et)),rt=[],it=0,nt;tt.length>it;)!has(AllSymbols,nt=tt[it++])&&nt!=HIDDEN&&nt!=META&&rt.push(nt);return rt},$getOwnPropertySymbols=function o(et){for(var tt=et===ObjectProto,rt=gOPN(tt?OPSymbols:toIObject(et)),it=[],nt=0,at;rt.length>nt;)has(AllSymbols,at=rt[nt++])&&(!tt||has(ObjectProto,at))&&it.push(AllSymbols[at]);return it};USE_NATIVE||($Symbol=function(){if(this instanceof $Symbol)throw TypeError("Symbol is not a constructor!");var et=uid(arguments.length>0?arguments[0]:void 0),tt=function(rt){this===ObjectProto&&tt.call(OPSymbols,rt),has(this,HIDDEN)&&has(this[HIDDEN],et)&&(this[HIDDEN][et]=!1),setSymbolDesc(this,et,createDesc(1,rt))};return DESCRIPTORS&&setter&&setSymbolDesc(ObjectProto,et,{configurable:!0,set:tt}),wrap(et)},redefine($Symbol[PROTOTYPE],"toString",function(){return this._k}),$GOPD.f=$getOwnPropertyDescriptor,$DP.f=$defineProperty,_objectGopn.f=gOPNExt.f=$getOwnPropertyNames,require_objectPie().f=$propertyIsEnumerable,$GOPS.f=$getOwnPropertySymbols,DESCRIPTORS&&!_library&&redefine(ObjectProto,"propertyIsEnumerable",$propertyIsEnumerable),wksExt.f=function(o){return wrap(wks(o))});$export$2($export$2.G+$export$2.W+$export$2.F*!USE_NATIVE,{Symbol:$Symbol});for(var es6Symbols="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),j=0;es6Symbols.length>j;)wks(es6Symbols[j++]);for(var wellKnownSymbols=$keys(wks.store),k=0;wellKnownSymbols.length>k;)wksDefine(wellKnownSymbols[k++]);$export$2($export$2.S+$export$2.F*!USE_NATIVE,"Symbol",{for:function(o){return has(SymbolRegistry,o+="")?SymbolRegistry[o]:SymbolRegistry[o]=$Symbol(o)},keyFor:function o(et){if(!isSymbol(et))throw TypeError(et+" is not a symbol!");for(var tt in SymbolRegistry)if(SymbolRegistry[tt]===et)return tt},useSetter:function(){setter=!0},useSimple:function(){setter=!1}});$export$2($export$2.S+$export$2.F*!USE_NATIVE,"Object",{create:$create,defineProperty:$defineProperty,defineProperties:$defineProperties,getOwnPropertyDescriptor:$getOwnPropertyDescriptor,getOwnPropertyNames:$getOwnPropertyNames,getOwnPropertySymbols:$getOwnPropertySymbols});var FAILS_ON_PRIMITIVES=$fails(function(){$GOPS.f(1)});$export$2($export$2.S+$export$2.F*FAILS_ON_PRIMITIVES,"Object",{getOwnPropertySymbols:function o(et){return $GOPS.f(toObject(et))}});$JSON&&$export$2($export$2.S+$export$2.F*(!USE_NATIVE||$fails(function(){var o=$Symbol();return _stringify([o])!="[null]"||_stringify({a:o})!="{}"||_stringify(Object(o))!="{}"})),"JSON",{stringify:function o(et){for(var tt=[et],rt=1,it,nt;arguments.length>rt;)tt.push(arguments[rt++]);if(nt=it=tt[1],!(!isObject(it)&&et===void 0||isSymbol(et)))return isArray(it)||(it=function(at,st){if(typeof nt=="function"&&(st=nt.call(this,at,st)),!isSymbol(st))return st}),tt[1]=it,_stringify.apply($JSON,tt)}});$Symbol[PROTOTYPE][TO_PRIMITIVE]||_hide($Symbol[PROTOTYPE],TO_PRIMITIVE,$Symbol[PROTOTYPE].valueOf);setToStringTag($Symbol,"Symbol");setToStringTag(Math,"Math",!0);setToStringTag(global$1.JSON,"JSON",!0);_wksDefine("asyncIterator");_wksDefine("observable");var symbol$1=_coreExports.Symbol,symbol={default:symbol$1,__esModule:!0};_typeof$1.__esModule=!0;var _iterator=iterator,_iterator2=_interopRequireDefault$3(_iterator),_symbol=symbol,_symbol2=_interopRequireDefault$3(_symbol),_typeof=typeof _symbol2.default=="function"&&typeof _iterator2.default=="symbol"?function(o){return typeof o}:function(o){return o&&typeof _symbol2.default=="function"&&o.constructor===_symbol2.default&&o!==_symbol2.default.prototype?"symbol":typeof o};function _interopRequireDefault$3(o){return o&&o.__esModule?o:{default:o}}_typeof$1.default=typeof _symbol2.default=="function"&&_typeof(_iterator2.default)==="symbol"?function(o){return typeof o>"u"?"undefined":_typeof(o)}:function(o){return o&&typeof _symbol2.default=="function"&&o.constructor===_symbol2.default&&o!==_symbol2.default.prototype?"symbol":typeof o>"u"?"undefined":_typeof(o)};possibleConstructorReturn.__esModule=!0;var _typeof2$1=_typeof$1,_typeof3$1=_interopRequireDefault$2(_typeof2$1);function _interopRequireDefault$2(o){return o&&o.__esModule?o:{default:o}}possibleConstructorReturn.default=function(o,et){if(!o)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return et&&((typeof et>"u"?"undefined":(0,_typeof3$1.default)(et))==="object"||typeof et=="function")?et:o};var inherits={},_setProto,hasRequired_setProto;function require_setProto(){if(hasRequired_setProto)return _setProto;hasRequired_setProto=1;var o=_isObject,et=_anObject,tt=function(rt,it){if(et(rt),!o(it)&&it!==null)throw TypeError(it+": can't set as prototype!")};return _setProto={set:Object.setPrototypeOf||("__proto__"in{}?function(rt,it,nt){try{nt=_ctx(Function.call,_objectGopd.f(Object.prototype,"__proto__").set,2),nt(rt,[]),it=!(rt instanceof Array)}catch{it=!0}return function(st,ot){return tt(st,ot),it?st.__proto__=ot:nt(st,ot),st}}({},!1):void 0),check:tt},_setProto}var $export$1=_export;$export$1($export$1.S,"Object",{setPrototypeOf:require_setProto().set});var setPrototypeOf$1=_coreExports.Object.setPrototypeOf,setPrototypeOf={default:setPrototypeOf$1,__esModule:!0},$export=_export;$export($export.S,"Object",{create:_objectCreate});var $Object=_coreExports.Object,create$1=function o(et,tt){return $Object.create(et,tt)},create={default:create$1,__esModule:!0};inherits.__esModule=!0;var _setPrototypeOf=setPrototypeOf,_setPrototypeOf2=_interopRequireDefault$1(_setPrototypeOf),_create=create,_create2=_interopRequireDefault$1(_create),_typeof2=_typeof$1,_typeof3=_interopRequireDefault$1(_typeof2);function _interopRequireDefault$1(o){return o&&o.__esModule?o:{default:o}}inherits.default=function(o,et){if(typeof et!="function"&&et!==null)throw new TypeError("Super expression must either be null or a function, not "+(typeof et>"u"?"undefined":(0,_typeof3.default)(et)));o.prototype=(0,_create2.default)(et&&et.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),et&&(_setPrototypeOf2.default?(0,_setPrototypeOf2.default)(o,et):o.__proto__=et)};Object.defineProperty(dist,"__esModule",{value:!0});var _extends2=_extends,_extends3=_interopRequireDefault(_extends2),_getPrototypeOf=getPrototypeOf$1,_getPrototypeOf2=_interopRequireDefault(_getPrototypeOf),_classCallCheck2=classCallCheck,_classCallCheck3=_interopRequireDefault(_classCallCheck2),_createClass2=createClass,_createClass3=_interopRequireDefault(_createClass2),_possibleConstructorReturn2=possibleConstructorReturn,_possibleConstructorReturn3=_interopRequireDefault(_possibleConstructorReturn2),_inherits2=inherits,_inherits3=_interopRequireDefault(_inherits2),_react=reactExports,_react2=_interopRequireDefault(_react),_propTypes=propTypesExports,_propTypes2=_interopRequireDefault(_propTypes),_lottieWeb=lottieExports,_lottieWeb2=_interopRequireDefault(_lottieWeb);function _interopRequireDefault(o){return o&&o.__esModule?o:{default:o}}var Lottie=function(o){(0,_inherits3.default)(et,o);function et(){var tt,rt,it,nt;(0,_classCallCheck3.default)(this,et);for(var at=arguments.length,st=Array(at),ot=0;otjsxRuntimeExports.jsx(Flex,{style:{width:"167px",height:"167px",opacity:.5},children:jsxRuntimeExports.jsx(_default,{height:167,options:{loop:!0,autoplay:!0,animationData:preloadData,rendererSettings:{preserveAspectRatio:"xMidYMid slice"}},width:167})}),Splash=reactExports.memo(({children:o})=>{const[et,tt]=reactExports.useState(initialMessageData),[rt,it]=reactExports.useState(0),[nt,at]=reactExports.useState(!0),{appMetaData:st,setAppMetaData:ot}=useAppStore(kt=>kt),{stats:lt,setStats:dt,isFetching:vt}=useDataStore(kt=>kt),yt=reactExports.useCallback(async()=>{try{if(!st){const kt=await getAboutData();ot(kt)}if(!lt){const kt=await getStats(),ht=formatStatsResponse(kt);dt(ht);const mt=formatSplashMessage(kt);tt(mt)}}catch{at(!1),it(100)}},[st,ot,dt,lt]);return reactExports.useEffect(()=>{yt();let kt,ht;return!vt&&et&&st&&(it(mt=>mt||50),ht=setInterval(()=>{it(mt=>mt>=100?100:mt+Math.floor(Math.random()*4))},100),kt=setTimeout(()=>at(!1),5e3)),()=>{clearTimeout(kt),clearInterval(ht)}},[st,yt,vt,et,lt]),nt&&(!et.some(({value:kt})=>!!kt)||!st)?null:jsxRuntimeExports.jsx(SplashWrapper,{children:nt?jsxRuntimeExports.jsxs(Wrappper,{align:"center",direction:"row",justify:"center",children:[jsxRuntimeExports.jsx(SphereAnimation,{}),jsxRuntimeExports.jsxs(Flex,{style:{color:colors.white},children:[jsxRuntimeExports.jsxs(TitleWrapper,{children:[jsxRuntimeExports.jsx(Text,{className:"title",children:st==null?void 0:st.title}),jsxRuntimeExports.jsx(Text,{className:"subtitle",children:"Second Brain"})]}),jsxRuntimeExports.jsx(LinearProgress$1,{color:"inherit",sx:{my:1.75,height:"2px"},value:rt,variant:"determinate"}),jsxRuntimeExports.jsx(AnimatedTextContent,{message:et})]})]}):o})}),TitleWrapper=styled$3.div` display: flex; flex-direction: column; @@ -633,4 +633,4 @@ PROCEED WITH CAUTION! align-items: center; width: 100%; height: 100%; -`,LazyApp=reactExports.lazy(()=>__vitePreload(()=>import("./index-7a7c9631.js").then(o=>o.b7),["assets/index-7a7c9631.js","assets/index-b60658ac.css"]).then(({App:o})=>({default:o}))),AppContainer=()=>{const o=jsxRuntimeExports.jsx(LazyApp,{});return jsxRuntimeExports.jsxs(AppProviders,{children:[jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("div",{children:"Loading..."}),children:jsxRuntimeExports.jsx(AuthGuard,{children:o})}),jsxRuntimeExports.jsx(E2ETests,{})]})},index="",root=client$1.createRoot(document.getElementById("root"));root.render(isE2E?jsxRuntimeExports.jsx(AppContainer,{}):jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(AppContainer,{})}));reportWebVitals();overrideConsole();export{$2AODx$react as $,useTheme$3 as A,defaultTheme$1 as B,formatMuiErrorMessage as C,useTheme as D,rootShouldForwardProp as E,resolveProps as F,Global as G,css as H,slotShouldForwardProp as I,lighten as J,darken as K,getDefaultExportFromCjs as L,useDataStore as M,useUserStore as N,useGraphStore as O,PropTypes as P,styled$3 as Q,React as R,colors as S,THEME_ID as T,Flex as U,graphStyles as V,We as W,clsx as X,create$3 as Y,devtools as Z,_objectWithoutPropertiesLoose as _,_extends$1 as a,hooks as a$,LinearProgress$1 as a0,useSelectedNode as a1,useUpdateSelectedNode as a2,useAppStore as a3,useFeatureFlagStore as a4,Text as a5,SocketContext as a6,__vitePreload as a7,media as a8,Stats as a9,_baseGetTag as aA,isObjectLike_1 as aB,isArray_1 as aC,_MapCache as aD,_Symbol as aE,isObject$b as aF,isFunction$3 as aG,_Uint8Array as aH,eq_1 as aI,_getAllKeys as aJ,_Stack as aK,_getTag as aL,isBufferExports as aM,isTypedArray_1 as aN,isObject_1 as aO,keys_1 as aP,isArguments_1 as aQ,_isIndex as aR,isLength_1 as aS,_Set as aT,_arrayPush as aU,isArrayLike_1 as aV,_baseUnary as aW,_defineProperty$1 as aX,_root as aY,_getPrototype as aZ,_baseAssignValue as a_,RSS as aa,TWITTER_HANDLE as ab,YOUTUBE_CHANNEL as ac,useModal as ad,getNodeContent as ae,Ce as af,distExports$1 as ag,approveRadarData as ah,deleteRadarData as ai,getRadarData as aj,lodashExports as ak,putRadarData as al,getTopicsData as am,Ue as an,getEdgeTypes as ao,getEdges as ap,postEdgeType as aq,requiredRule as ar,putNodeData as as,postMergeTopics as at,isSphinx as au,postAboutData as av,isE2E as aw,api$1 as ax,getLSat as ay,payLsat as az,createTheme$1 as b,updateBudget as b0,useAiSummaryStore as b1,isDevelopment as b2,getAboutData as b3,useSelectedNodeRelativeIds as b4,forceSimulation as b5,forceCollide as b6,forceCenter as b7,forceManyBody as b8,forceLink as b9,NODE_ADD_ERROR as bA,sphinxBridge as bB,getNodeType as bC,getNodeSchemaTypes as bD,deleteNode as bE,changeNodeType as bF,updateEdgeType as bG,postBluePrintType as bH,deleteEdgeType as bI,createRoot as bJ,react as bK,GRAPH_GROUND_COLOR as bL,GRAPH_LIGHT_INTENSITY as bM,GRAPH_FOG_COLOR as bN,NODE_RELATIVE_HIGHLIGHT_COLORS as ba,useNodeTypes as bb,lottie as bc,fetchNodeEdges as bd,NodesIcon as be,addToGlobalForE2e as bf,executeIfProd as bg,Timer as bh,commonjsGlobal as bi,commonjsRequire as bj,useFilteredNodes as bk,useSyncExternalStoreExports as bl,createStore as bm,dispatch as bn,timer as bo,now as bp,getFullTranscript as bq,getAugmentedNamespace as br,propTypesExports as bs,getSchemaAll as bt,LINK as bu,TWITTER_SOURCE as bv,WEB_PAGE as bw,DOCUMENT as bx,formatBudget as by,getPriceData as bz,createStyled as c,defaultSxConfig$1 as d,useThemeProps$1 as e,resolveBreakpointValues as f,createUnarySpacing as g,handleBreakpoints as h,isPlainObject as i,jsxRuntimeExports as j,deepmerge as k,getValue as l,mergeBreakpointsInOrder as m,composeClasses as n,generateUtilityClass as o,generateUtilityClasses as p,capitalize as q,reactExports as r,styled$1 as s,useThemeProps as t,useTheme$2 as u,clsx$1 as v,ReactDOM as w,alpha as x,keyframes as y,reactDomExports as z}; +`,LazyApp=reactExports.lazy(()=>__vitePreload(()=>import("./index-74184c93.js").then(o=>o.b8),["assets/index-74184c93.js","assets/index-b60658ac.css"]).then(({App:o})=>({default:o}))),AppContainer=()=>{const o=jsxRuntimeExports.jsx(LazyApp,{});return jsxRuntimeExports.jsxs(AppProviders,{children:[jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("div",{children:"Loading..."}),children:jsxRuntimeExports.jsx(AuthGuard,{children:o})}),jsxRuntimeExports.jsx(E2ETests,{})]})},index="",root=client$1.createRoot(document.getElementById("root"));root.render(isE2E?jsxRuntimeExports.jsx(AppContainer,{}):jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(AppContainer,{})}));reportWebVitals();overrideConsole();export{$2AODx$react as $,useTheme$3 as A,defaultTheme$1 as B,formatMuiErrorMessage as C,useTheme as D,rootShouldForwardProp as E,resolveProps as F,Global as G,css as H,slotShouldForwardProp as I,lighten as J,darken as K,getDefaultExportFromCjs as L,useDataStore as M,useUserStore as N,useGraphStore as O,PropTypes as P,styled$3 as Q,React as R,colors as S,THEME_ID as T,Flex as U,graphStyles as V,We as W,clsx as X,create$3 as Y,devtools as Z,_objectWithoutPropertiesLoose as _,_extends$1 as a,hooks as a$,LinearProgress$1 as a0,useSelectedNode as a1,useUpdateSelectedNode as a2,useAppStore as a3,useFeatureFlagStore as a4,Text as a5,SocketContext as a6,__vitePreload as a7,media as a8,Stats as a9,_baseGetTag as aA,isObjectLike_1 as aB,isArray_1 as aC,_MapCache as aD,_Symbol as aE,isObject$b as aF,isFunction$3 as aG,_Uint8Array as aH,eq_1 as aI,_getAllKeys as aJ,_Stack as aK,_getTag as aL,isBufferExports as aM,isTypedArray_1 as aN,isObject_1 as aO,keys_1 as aP,isArguments_1 as aQ,_isIndex as aR,isLength_1 as aS,_Set as aT,_arrayPush as aU,isArrayLike_1 as aV,_baseUnary as aW,_defineProperty$1 as aX,_root as aY,_getPrototype as aZ,_baseAssignValue as a_,RSS as aa,TWITTER_HANDLE as ab,YOUTUBE_CHANNEL as ac,useModal as ad,getNodeContent as ae,Ce as af,distExports$1 as ag,approveRadarData as ah,deleteRadarData as ai,getRadarData as aj,lodashExports as ak,putRadarData as al,getTopicsData as am,Ue as an,getEdgeTypes as ao,getEdges as ap,postEdgeType as aq,requiredRule as ar,putNodeData as as,postMergeTopics as at,isSphinx as au,postAboutData as av,isE2E as aw,api$1 as ax,getLSat as ay,payLsat as az,createTheme$1 as b,updateBudget as b0,useAiSummaryStore as b1,isDevelopment as b2,getAboutData as b3,useSelectedNodeRelativeIds as b4,forceSimulation as b5,forceCollide as b6,forceCenter as b7,forceManyBody as b8,forceLink as b9,NODE_ADD_ERROR as bA,sphinxBridge as bB,getNodeType as bC,getNodeSchemaTypes as bD,deleteNode as bE,changeNodeType as bF,updateEdgeType as bG,postBluePrintType as bH,deleteEdgeType as bI,createRoot as bJ,react as bK,GRAPH_GROUND_COLOR as bL,GRAPH_LIGHT_INTENSITY as bM,GRAPH_FOG_COLOR as bN,NODE_RELATIVE_HIGHLIGHT_COLORS as ba,useNodeTypes as bb,lottie as bc,fetchNodeEdges as bd,NodesIcon as be,addToGlobalForE2e as bf,executeIfProd as bg,Timer as bh,commonjsGlobal as bi,commonjsRequire as bj,useFilteredNodes as bk,useSyncExternalStoreExports as bl,createStore as bm,dispatch as bn,timer as bo,now as bp,getFullTranscript as bq,getAugmentedNamespace as br,propTypesExports as bs,getSchemaAll as bt,LINK as bu,TWITTER_SOURCE as bv,WEB_PAGE as bw,DOCUMENT as bx,formatBudget as by,getPriceData as bz,createStyled as c,defaultSxConfig$1 as d,useThemeProps$1 as e,resolveBreakpointValues as f,createUnarySpacing as g,handleBreakpoints as h,isPlainObject as i,jsxRuntimeExports as j,deepmerge as k,getValue as l,mergeBreakpointsInOrder as m,composeClasses as n,generateUtilityClass as o,generateUtilityClasses as p,capitalize as q,reactExports as r,styled$1 as s,useThemeProps as t,useTheme$2 as u,clsx$1 as v,ReactDOM as w,alpha as x,keyframes as y,reactDomExports as z}; diff --git a/build/assets/index-0021498a.js b/build/assets/index-f091e27d.js similarity index 91% rename from build/assets/index-0021498a.js rename to build/assets/index-f091e27d.js index 80b65655d..479e43f88 100644 --- a/build/assets/index-0021498a.js +++ b/build/assets/index-f091e27d.js @@ -1,4 +1,4 @@ -import{Q as n,j as e,U as r,ar as b,a5 as a,S as i,ad as w,r as m,ax as j}from"./index-0cb90706.js";import{aJ as C,B as S,ae as y,aF as k,af as v}from"./index-7a7c9631.js";import{S as F}from"./index-7623b989.js";const B=({allowNextStep:t})=>e.jsxs(r,{p:12,children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:25,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(E,{children:"Feedback"})})}),e.jsx(r,{mb:30,children:e.jsx(C,{id:"feedback-message",isTextArea:!0,maxLength:500,name:"message",placeholder:"Leave your feedback here ...",rules:b})}),e.jsx(r,{children:e.jsx(S,{color:"secondary","data-testid":"submit-feedback-btn",disabled:!t,size:"large",type:"submit",variant:"contained",children:"Submit"})})]}),E=n(a)` +import{Q as n,j as e,U as r,ar as b,a5 as a,S as i,ad as w,r as m,ax as j}from"./index-ead79979.js";import{aK as C,B as S,af as y,aG as k,ag as v}from"./index-74184c93.js";import{S as F}from"./index-560f985a.js";const B=({allowNextStep:t})=>e.jsxs(r,{p:12,children:[e.jsx(r,{align:"center",direction:"row",justify:"space-between",mb:25,children:e.jsx(r,{align:"center",direction:"row",children:e.jsx(E,{children:"Feedback"})})}),e.jsx(r,{mb:30,children:e.jsx(C,{id:"feedback-message",isTextArea:!0,maxLength:500,name:"message",placeholder:"Leave your feedback here ...",rules:b})}),e.jsx(r,{children:e.jsx(S,{color:"secondary","data-testid":"submit-feedback-btn",disabled:!t,size:"large",type:"submit",variant:"contained",children:"Submit"})})]}),E=n(a)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -31,4 +31,4 @@ import{Q as n,j as e,U as r,ar as b,a5 as a,S as i,ad as w,r as m,ax as j}from". font-weight: 400; color: ${i.GRAY6}; padding-top: 10px; -`,$=async t=>{try{const s=await j.post("/prediction/feedback",JSON.stringify(t));if(s.error){const{message:o}=s.error;throw new Error(o)}}catch(s){throw new Error(s.message||"Error submitting feedback")}},U=()=>{const{close:t,visible:s}=w("feedback"),o=y({mode:"onChange"}),{watch:x,reset:c}=o,[h,l]=m.useState(!1);m.useEffect(()=>()=>{l(!1),c()},[s,c]);const d=x("message"),u=!!d&&d.trim().length>0,f=o.handleSubmit(async p=>{try{await $(p),F("Feedback Submitted"),l(!0)}catch(g){console.error(g.message)}});return e.jsx(k,{id:"feedback",kind:"small",onClose:t,preventOutsideClose:!0,children:e.jsx(v,{...o,children:e.jsx("form",{id:"feedback-form",onSubmit:f,children:h?e.jsx(T,{}):e.jsx(B,{allowNextStep:u})})})})};export{U as UserFeedBackModal}; +`,$=async t=>{try{const s=await j.post("/prediction/feedback",JSON.stringify(t));if(s.error){const{message:o}=s.error;throw new Error(o)}}catch(s){throw new Error(s.message||"Error submitting feedback")}},R=()=>{const{close:t,visible:s}=w("feedback"),o=y({mode:"onChange"}),{watch:x,reset:c}=o,[h,l]=m.useState(!1);m.useEffect(()=>()=>{l(!1),c()},[s,c]);const d=x("message"),u=!!d&&d.trim().length>0,f=o.handleSubmit(async p=>{try{await $(p),F("Feedback Submitted"),l(!0)}catch(g){console.error(g.message)}});return e.jsx(k,{id:"feedback",kind:"small",onClose:t,preventOutsideClose:!0,children:e.jsx(v,{...o,children:e.jsx("form",{id:"feedback-form",onSubmit:f,children:h?e.jsx(T,{}):e.jsx(B,{allowNextStep:u})})})})};export{R as UserFeedBackModal}; diff --git a/build/assets/index-e28518b6.js b/build/assets/index-ff0f2b2f.js similarity index 85% rename from build/assets/index-e28518b6.js rename to build/assets/index-ff0f2b2f.js index a96d1f55a..73db7d7ce 100644 --- a/build/assets/index-e28518b6.js +++ b/build/assets/index-ff0f2b2f.js @@ -1,4 +1,4 @@ -import{r,j as e,ao as B,ak as O,U as u,ap as E,Q as l,a5 as F,ad as I,a1 as z,S as _,aq as A}from"./index-0cb90706.js";import{aO as L,aS as N,ab as D,aP as M,aT as P,aU as X,aV as Y,aW as G,aX as H,ae as R,af as U,aE as T,B as W,aF as q}from"./index-7a7c9631.js";const Q=({selectedType:t,setSelectedType:c})=>{const[p,d]=r.useState([]);r.useEffect(()=>{(async()=>{try{const{data:x}=await B();d(x.edge_types)}catch(x){console.warn(x)}})()},[d]);const a=o=>({label:o,value:o}),h=o=>{c((o==null?void 0:o.value)||"")};return e.jsx(L,{onSelect:h,options:p.map(a),selectedValue:t?a(t):null})},V=({onSelect:t,selectedValue:c,topicId:p})=>{const[d,a]=r.useState([]),[h,o]=r.useState(!1),x=r.useMemo(()=>{const s=async m=>{const i={is_muted:"False",sort_by:P,search:m,skip:"0",limit:"1000"};o(!0);try{const w=(await E(i.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==p);a(w)}catch{a([])}finally{o(!1)}};return O.debounce(s,300)},[p]),b=s=>{if(!s){a([]);return}s.length>2&&x(s)},j=s=>{const m=s?d.find(i=>i.ref_id===s.value):null;t(m||null)},n=s=>({label:s.search_value,value:s.ref_id,type:s.node_type}),v=s=>s.map(n);return c?e.jsxs(u,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:c.search_value}),e.jsx(N,{onClick:()=>t(null),size:"medium",children:e.jsx(D,{})})]}):e.jsx(L,{handleInputChange:b,isLoading:h,onSelect:j,options:v(d)||M,selectedValue:c?n(c):null})},$=({from:t,onSelect:c,selectedType:p,setSelectedType:d,selectedToNode:a,setIsSwapped:h,isSwapped:o})=>{const x=()=>{h()},b=t&&("search_value"in t?t.search_value:t.name);return e.jsxs(u,{mb:20,children:[e.jsx(u,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(u,{align:"center",direction:"row",children:e.jsx(K,{children:"Add Edge"})})}),e.jsxs(Z,{swap:o,children:[e.jsx(u,{children:e.jsx(ee,{disabled:!0,label:o?"To":"From",swap:o,value:b})}),e.jsxs(u,{my:16,children:[e.jsx(oe,{children:"Type"}),e.jsx(Q,{selectedType:p,setSelectedType:d})]}),e.jsx(u,{children:e.jsxs(te,{children:[e.jsx(se,{children:o?"From":"To"}),e.jsx(V,{onSelect:c,selectedValue:a,topicId:t==null?void 0:t.ref_id})]})}),e.jsxs(J,{children:[e.jsx(ne,{children:e.jsx(Y,{})}),e.jsx(ae,{onClick:x,children:e.jsx(G,{})}),e.jsx(ie,{children:e.jsx(H,{})})]})]})]})},J=l.div` +import{r,j as e,ao as B,ak as F,U as u,ap as E,Q as l,a5 as O,ad as I,a1 as z,S as _,aq as A}from"./index-ead79979.js";import{aP as L,aT as N,ac as D,aQ as M,aU as Y,aV as P,aW as X,aX as G,aY as H,af as Q,ag as R,aF as T,B as U,aG as W}from"./index-74184c93.js";const q=({selectedType:t,setSelectedType:c})=>{const[p,d]=r.useState([]);r.useEffect(()=>{(async()=>{try{const{data:x}=await B();d(x.edge_types)}catch(x){console.warn(x)}})()},[d]);const a=o=>({label:o,value:o}),h=o=>{c((o==null?void 0:o.value)||"")};return e.jsx(L,{onSelect:h,options:p.map(a),selectedValue:t?a(t):null})},V=({onSelect:t,selectedValue:c,topicId:p})=>{const[d,a]=r.useState([]),[h,o]=r.useState(!1),x=r.useMemo(()=>{const s=async m=>{const i={is_muted:"False",sort_by:Y,search:m,skip:"0",limit:"1000"};o(!0);try{const w=(await E(i.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==p);a(w)}catch{a([])}finally{o(!1)}};return F.debounce(s,300)},[p]),b=s=>{if(!s){a([]);return}s.length>2&&x(s)},j=s=>{const m=s?d.find(i=>i.ref_id===s.value):null;t(m||null)},n=s=>({label:s.search_value,value:s.ref_id,type:s.node_type}),v=s=>s.map(n);return c?e.jsxs(u,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:c.search_value}),e.jsx(N,{onClick:()=>t(null),size:"medium",children:e.jsx(D,{})})]}):e.jsx(L,{handleInputChange:b,isLoading:h,onSelect:j,options:v(d)||M,selectedValue:c?n(c):null})},$=({from:t,onSelect:c,selectedType:p,setSelectedType:d,selectedToNode:a,setIsSwapped:h,isSwapped:o})=>{const x=()=>{h()},b=t&&("search_value"in t?t.search_value:t.name);return e.jsxs(u,{mb:20,children:[e.jsx(u,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(u,{align:"center",direction:"row",children:e.jsx(K,{children:"Add Edge"})})}),e.jsxs(Z,{swap:o,children:[e.jsx(u,{children:e.jsx(ee,{disabled:!0,label:o?"To":"From",swap:o,value:b})}),e.jsxs(u,{my:16,children:[e.jsx(oe,{children:"Type"}),e.jsx(q,{selectedType:p,setSelectedType:d})]}),e.jsx(u,{children:e.jsxs(te,{children:[e.jsx(se,{children:o?"From":"To"}),e.jsx(V,{onSelect:c,selectedValue:a,topicId:t==null?void 0:t.ref_id})]})}),e.jsxs(J,{children:[e.jsx(ne,{children:e.jsx(X,{})}),e.jsx(ae,{onClick:x,children:e.jsx(G,{})}),e.jsx(ie,{children:e.jsx(H,{})})]})]})]})},J=l.div` position: absolute; top: 26px; bottom: 26px; @@ -8,7 +8,7 @@ import{r,j as e,ao as B,ak as O,U as u,ap as E,Q as l,a5 as F,ad as I,a1 as z,S border-top: 1.5px solid #6b7a8d4d; border-bottom: 1.5px solid #6b7a8d4d; border-radius: 12px 0 0 12px; -`,K=l(F)` +`,K=l(O)` font-size: 22px; font-weight: 600; `,Z=l.div` @@ -19,7 +19,7 @@ import{r,j as e,ao as B,ak as O,U as u,ap as E,Q as l,a5 as F,ad as I,a1 as z,S flex-direction: ${t=>t.swap?"column-reverse":"column"}; margin-bottom: 10px; padding-left: 38px; -`,ee=l(X)` +`,ee=l(P)` position: relative; width: 100%; padding: 16px; @@ -84,9 +84,9 @@ import{r,j as e,ao as B,ak as O,U as u,ap as E,Q as l,a5 as F,ad as I,a1 as z,S transform: translateY(10px) translateX(3px); color: #6b7a8d; line-height: 1; -`,re=()=>{const{close:t}=I("addEdgeToNode"),c=R({mode:"onChange"}),[p,d]=r.useState(!1),[a,h]=r.useState(""),[o,x]=r.useState(!1),[b,j]=r.useState(!1),[n,v]=r.useState(null),[s,m]=r.useState(),i=z();r.useEffect(()=>{(async()=>{if(i){j(!0);try{if(i.type==="topic"){const{data:f}=await E(i==null?void 0:i.name,{exact_match:"true",node_type:"topic"}),C=f.find(k=>k.node_type==="topic");m(C)}}catch(f){console.log(f)}finally{j(!1)}}})()},[i]);const S=()=>{t()},w=async()=>{const g=s||i;if(!(!n||!(g!=null&&g.ref_id))){d(!0);try{await A({relationship:a,...o?{to:g.ref_id,from:n==null?void 0:n.ref_id}:{from:g.ref_id,to:n==null?void 0:n.ref_id}});const{ref_id:f}=g,{ref_id:C}=n;console.log(f,C),S()}catch(f){console.warn(f)}finally{d(!1)}}},y=p||!n||!a;return e.jsxs(U,{...c,children:[b?e.jsx(u,{align:"center",my:24,children:e.jsx(T,{color:_.lightGray,size:24})}):e.jsx($,{from:s??i,isSwapped:o,onSelect:v,selectedToNode:n,selectedType:a,setIsSwapped:()=>x(!o),setSelectedType:h}),e.jsxs(le,{color:"secondary",disabled:y,onClick:w,size:"large",variant:"contained",children:["Confirm",p&&e.jsx(ce,{children:e.jsx(T,{color:_.lightGray,size:12})})]})]})},le=l(W)` +`,re=()=>{const{close:t}=I("addEdgeToNode"),c=Q({mode:"onChange"}),[p,d]=r.useState(!1),[a,h]=r.useState(""),[o,x]=r.useState(!1),[b,j]=r.useState(!1),[n,v]=r.useState(null),[s,m]=r.useState(),i=z();r.useEffect(()=>{(async()=>{if(i){j(!0);try{if(i.type==="topic"){const{data:f}=await E(i==null?void 0:i.name,{exact_match:"true",node_type:"topic"}),C=f.find(k=>k.node_type==="topic");m(C)}}catch(f){console.log(f)}finally{j(!1)}}})()},[i]);const S=()=>{t()},w=async()=>{const g=s||i;if(!(!n||!(g!=null&&g.ref_id))){d(!0);try{await A({relationship:a,...o?{to:g.ref_id,from:n==null?void 0:n.ref_id}:{from:g.ref_id,to:n==null?void 0:n.ref_id}});const{ref_id:f}=g,{ref_id:C}=n;console.log(f,C),S()}catch(f){console.warn(f)}finally{d(!1)}}},y=p||!n||!a;return e.jsxs(R,{...c,children:[b?e.jsx(u,{align:"center",my:24,children:e.jsx(T,{color:_.lightGray,size:24})}):e.jsx($,{from:s??i,isSwapped:o,onSelect:v,selectedToNode:n,selectedType:a,setIsSwapped:()=>x(!o),setSelectedType:h}),e.jsxs(le,{color:"secondary",disabled:y,onClick:w,size:"large",variant:"contained",children:["Confirm",p&&e.jsx(ce,{children:e.jsx(T,{color:_.lightGray,size:12})})]})]})},le=l(U)` width: 293px !important; margin: 0 0 10px auto !important; `,ce=l.span` margin-top: 2px; -`,xe=()=>{const{close:t}=I("addEdgeToNode");return e.jsx(q,{id:"addEdgeToNode",kind:"small",onClose:t,preventOutsideClose:!0,children:e.jsx(re,{})})};export{xe as AddNodeEdgeModal}; +`,xe=()=>{const{close:t}=I("addEdgeToNode");return e.jsx(W,{id:"addEdgeToNode",kind:"small",onClose:t,preventOutsideClose:!0,children:e.jsx(re,{})})};export{xe as AddNodeEdgeModal}; diff --git a/build/index.html b/build/index.html index 7710c26c8..fd6a3e65c 100644 --- a/build/index.html +++ b/build/index.html @@ -22,7 +22,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> Second Brain - +