diff --git a/build/assets/ClipLoader-049391dc.js b/build/assets/ClipLoader-601f6378.js similarity index 97% rename from build/assets/ClipLoader-049391dc.js rename to build/assets/ClipLoader-601f6378.js index f38df6513..cf192255e 100644 --- a/build/assets/ClipLoader-049391dc.js +++ b/build/assets/ClipLoader-601f6378.js @@ -1,4 +1,4 @@ -import{r as m}from"./index-16ff4e55.js";var g={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 h(e){if(typeof e=="number")return{value:e,unit:"px"};var t,a=(e.match(/^[0-9.]*/)||"").toString();a.includes(".")?t=parseFloat(a):t=parseInt(a,10);var r=(e.match(/[^0-9]*$/)||"").toString();return g[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"})}function d(e){var t=h(e);return"".concat(t.value).concat(t.unit)}var b=function(e,t,a){var r="react-spinners-".concat(e,"-").concat(a);if(typeof window>"u"||!window.document)return r;var n=document.createElement("style");document.head.appendChild(n);var o=n.sheet,l=` +import{r as m}from"./index-4c5f8236.js";var g={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 h(e){if(typeof e=="number")return{value:e,unit:"px"};var t,a=(e.match(/^[0-9.]*/)||"").toString();a.includes(".")?t=parseFloat(a):t=parseInt(a,10);var r=(e.match(/[^0-9]*$/)||"").toString();return g[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"})}function d(e){var t=h(e);return"".concat(t.value).concat(t.unit)}var b=function(e,t,a){var r="react-spinners-".concat(e,"-").concat(a);if(typeof window>"u"||!window.document)return r;var n=document.createElement("style");document.head.appendChild(n);var o=n.sheet,l=` @keyframes `.concat(r,` { `).concat(t,` } diff --git a/build/assets/DailyMotion-6b6860ce.js b/build/assets/DailyMotion-376cd37a.js similarity index 95% rename from build/assets/DailyMotion-6b6860ce.js rename to build/assets/DailyMotion-376cd37a.js index fa6f7abdb..990d7aa15 100644 --- a/build/assets/DailyMotion-6b6860ce.js +++ b/build/assets/DailyMotion-376cd37a.js @@ -1 +1 @@ -import{g as P,r as v}from"./index-16ff4e55.js";import{u as D,p as O}from"./index-e4c394ce.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,A=(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},L=(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={};A(d,{default:()=>p});var _=C(d),c=L(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 g=u.player;this.player=new g(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:m=>a(m)}})},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{g as P,r as v}from"./index-4c5f8236.js";import{u as D,p as O}from"./index-ad04f3f7.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,A=(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},L=(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={};A(d,{default:()=>p});var _=C(d),c=L(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 g=u.player;this.player=new g(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:m=>a(m)}})},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-8697f027.js b/build/assets/Facebook-7bdcad75.js similarity index 96% rename from build/assets/Facebook-8697f027.js rename to build/assets/Facebook-7bdcad75.js index c990cf4b6..6ceb13060 100644 --- a/build/assets/Facebook-8697f027.js +++ b/build/assets/Facebook-7bdcad75.js @@ -1 +1 @@ -import{g as _,r as g}from"./index-16ff4e55.js";import{u as P,p as m}from"./index-e4c394ce.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(g),n=P,x=m;const c="https://connect.facebook.net/en_US/sdk.js",f="FB",y="fbAsyncInit",L="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${L}${(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",x.canPlay.facebook);o(l,"loopOnEnded",!0);const M=_(d),N=v({__proto__:null,default:M},[d]);export{N as F}; +import{g as _,r as g}from"./index-4c5f8236.js";import{u as P,p as m}from"./index-ad04f3f7.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(g),n=P,x=m;const c="https://connect.facebook.net/en_US/sdk.js",f="FB",y="fbAsyncInit",L="facebook-player-";class l extends u.Component{constructor(){super(...arguments),o(this,"callPlayer",n.callPlayer),o(this,"playerID",this.props.config.playerId||`${L}${(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",x.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-a119adbc.js b/build/assets/FilePlayer-ed376b11.js similarity index 98% rename from build/assets/FilePlayer-a119adbc.js rename to build/assets/FilePlayer-ed376b11.js index 42fc57846..dfca952a4 100644 --- a/build/assets/FilePlayer-a119adbc.js +++ b/build/assets/FilePlayer-ed376b11.js @@ -1 +1 @@ -import{g as b,r as _}from"./index-16ff4e55.js";import{u as O,p as A}from"./index-e4c394ce.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{g as b,r as _}from"./index-4c5f8236.js";import{u as O,p as A}from"./index-ad04f3f7.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-452db45d.js b/build/assets/Kaltura-b5386189.js similarity index 95% rename from build/assets/Kaltura-452db45d.js rename to build/assets/Kaltura-b5386189.js index eb417388b..176f0801c 100644 --- a/build/assets/Kaltura-452db45d.js +++ b/build/assets/Kaltura-b5386189.js @@ -1 +1 @@ -import{g as y,r as f}from"./index-16ff4e55.js";import{u as _,p as m}from"./index-e4c394ce.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{g as y,r as f}from"./index-4c5f8236.js";import{u as _,p as m}from"./index-ad04f3f7.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-dcdddb72.js b/build/assets/Mixcloud-ab7f960a.js similarity index 95% rename from build/assets/Mixcloud-dcdddb72.js rename to build/assets/Mixcloud-ab7f960a.js index 2592346d2..c41aa3a69 100644 --- a/build/assets/Mixcloud-dcdddb72.js +++ b/build/assets/Mixcloud-ab7f960a.js @@ -1 +1 @@ -import{g as _,r as f}from"./index-16ff4e55.js";import{u as m,p as g}from"./index-e4c394ce.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 E="https://widget.mixcloud.com/media/js/widgetApi.js",L="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)(E,L).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{g as _,r as f}from"./index-4c5f8236.js";import{u as m,p as g}from"./index-ad04f3f7.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 E="https://widget.mixcloud.com/media/js/widgetApi.js",L="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)(E,L).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-bd12f694.js b/build/assets/Preview-8a240280.js similarity index 97% rename from build/assets/Preview-bd12f694.js rename to build/assets/Preview-8a240280.js index 9016a534d..487317af0 100644 --- a/build/assets/Preview-bd12f694.js +++ b/build/assets/Preview-8a240280.js @@ -1 +1 @@ -import{g as y,r as b}from"./index-16ff4e55.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{g as y,r as b}from"./index-4c5f8236.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-96227392.js b/build/assets/Skeleton-7bdfc65c.js similarity index 97% rename from build/assets/Skeleton-96227392.js rename to build/assets/Skeleton-7bdfc65c.js index 71073dd6e..c1b549df0 100644 --- a/build/assets/Skeleton-96227392.js +++ b/build/assets/Skeleton-7bdfc65c.js @@ -1,4 +1,4 @@ -import{c as x,d as y,bu as b,s as R,e as o,f as S,bv as u,r as _,u as $,a as U,j as M,h as j,i as A}from"./index-16ff4e55.js";function X(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function N(t){return parseFloat(t)}function B(t){return x("MuiSkeleton",t)}y("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{c as x,d as y,bu as b,s as R,e as o,f as S,bv as u,r as _,u as $,a as U,j as M,h as j,i as A}from"./index-4c5f8236.js";function X(t){return String(t).match(/[\d.\-+]*\s*(.*)/)[1]||""}function N(t){return parseFloat(t)}function B(t){return x("MuiSkeleton",t)}y("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-b4a66154.js b/build/assets/SoundCloud-df6d74b5.js similarity index 95% rename from build/assets/SoundCloud-b4a66154.js rename to build/assets/SoundCloud-df6d74b5.js index 148bcfa09..70a94ba52 100644 --- a/build/assets/SoundCloud-b4a66154.js +++ b/build/assets/SoundCloud-df6d74b5.js @@ -1 +1 @@ -import{g as P,r as g}from"./index-16ff4e55.js";import{u as b,p as v}from"./index-e4c394ce.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{g as P,r as g}from"./index-4c5f8236.js";import{u as b,p as v}from"./index-ad04f3f7.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/Stack-25a86e54.js b/build/assets/Stack-7f131eb3.js similarity index 91% rename from build/assets/Stack-25a86e54.js rename to build/assets/Stack-7f131eb3.js index e586a234a..54022cbd0 100644 --- a/build/assets/Stack-25a86e54.js +++ b/build/assets/Stack-7f131eb3.js @@ -1 +1 @@ -import{r as E,$ as Mt,a as ae,e as T,c2 as Ft,c3 as Wt,c4 as Vt,c5 as Lt,c6 as Nt,by as Ke,bx as Ae,c7 as Ht,c1 as It,c8 as Ut,j as K,c9 as Qe,i as je,c as Te,d as ht,l as et,m as tt,s as Be,ca as qt,u as Me,k as gt,h as zt}from"./index-16ff4e55.js";import{y as rt,aZ as Xt,U as Yt}from"./index-04a82be1.js";function Se(e,t){var r,o;return E.isValidElement(e)&&t.indexOf((r=e.type.muiName)!=null?r:(o=e.type)==null||(o=o._payload)==null||(o=o.value)==null?void 0:o.muiName)!==-1}let ot=0;function Gt(e){const[t,r]=E.useState(e),o=e||t;return E.useEffect(()=>{t==null&&(ot+=1,r(`mui-${ot}`))},[t]),o}const nt=Mt["useId".toString()];function Ho(e){if(nt!==void 0){const t=nt();return e??t}return Gt(e)}function Io({controlled:e,default:t,name:r,state:o="value"}){const{current:n}=E.useRef(e!==void 0),[a,c]=E.useState(t),s=n?e:a,i=E.useCallback(f=>{n||c(f)},[]);return[s,i]}const _t=["sx"],Zt=e=>{var t,r;const o={systemProps:{},otherProps:{}},n=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:Ft;return Object.keys(e).forEach(a=>{n[a]?o.systemProps[a]=e[a]:o.otherProps[a]=e[a]}),o};function Jt(e){const{sx:t}=e,r=ae(e,_t),{systemProps:o,otherProps:n}=Zt(r);let a;return Array.isArray(t)?a=[o,...t]:typeof t=="function"?a=(...c)=>{const s=t(...c);return Wt(s)?T({},o,s):o}:a=T({},o,t),T({},n,{sx:a})}function yt(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;tt.root});function nr(e){return Nt({props:e,name:"MuiStack",defaultTheme:rr})}function ar(e,t){const r=E.Children.toArray(e).filter(Boolean);return r.reduce((o,n,a)=>(o.push(n),a({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],sr=({ownerState:e,theme:t})=>{let r=T({display:"flex",flexDirection:"column"},Ke({theme:t},Ae({values:e.direction,breakpoints:t.breakpoints.values}),o=>({flexDirection:o})));if(e.spacing){const o=Ht(t),n=Object.keys(t.breakpoints.values).reduce((i,f)=>((typeof e.spacing=="object"&&e.spacing[f]!=null||typeof e.direction=="object"&&e.direction[f]!=null)&&(i[f]=!0),i),{}),a=Ae({values:e.direction,base:n}),c=Ae({values:e.spacing,base:n});typeof a=="object"&&Object.keys(a).forEach((i,f,l)=>{if(!a[i]){const h=f>0?a[l[f-1]]:"column";a[i]=h}}),r=It(r,Ke({theme:t},c,(i,f)=>e.useFlexGap?{gap:Qe(o,i)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${ir(f?a[f]:e.direction)}`]:Qe(o,i)}}))}return r=Ut(t.breakpoints,r),r};function lr(e={}){const{createStyledComponent:t=or,useThemeProps:r=nr,componentName:o="MuiStack"}=e,n=()=>je({root:["root"]},i=>Te(o,i),{}),a=t(sr);return E.forwardRef(function(i,f){const l=r(i),v=Jt(l),{component:h="div",direction:p="column",spacing:x=0,divider:d,children:m,className:w,useFlexGap:O=!1}=v,b=ae(v,tr),u={direction:p,spacing:x,useFlexGap:O},g=n();return K.jsx(a,T({as:h,ownerState:u,ref:f,className:Kt(g.root,w)},b,{children:d?ar(m,d):m}))})}const cr={disableDefaultClasses:!1},fr=E.createContext(cr);function ur(e){const{disableDefaultClasses:t}=E.useContext(fr);return r=>t?"":e(r)}var M="top",N="bottom",H="right",F="left",Fe="auto",de=[M,N,H,F],te="start",ue="end",pr="clippingParents",bt="viewport",le="popper",dr="reference",at=de.reduce(function(e,t){return e.concat([t+"-"+te,t+"-"+ue])},[]),xt=[].concat(de,[Fe]).reduce(function(e,t){return e.concat([t,t+"-"+te,t+"-"+ue])},[]),vr="beforeRead",mr="read",hr="afterRead",gr="beforeMain",yr="main",br="afterMain",xr="beforeWrite",wr="write",Pr="afterWrite",Or=[vr,mr,hr,gr,yr,br,xr,wr,Pr];function U(e){return e?(e.nodeName||"").toLowerCase():null}function W(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Q(e){var t=W(e).Element;return e instanceof t||e instanceof Element}function L(e){var t=W(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function We(e){if(typeof ShadowRoot>"u")return!1;var t=W(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Er(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var o=t.styles[r]||{},n=t.attributes[r]||{},a=t.elements[r];!L(a)||!U(a)||(Object.assign(a.style,o),Object.keys(n).forEach(function(c){var s=n[c];s===!1?a.removeAttribute(c):a.setAttribute(c,s===!0?"":s)}))})}function Cr(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(o){var n=t.elements[o],a=t.attributes[o]||{},c=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:r[o]),s=c.reduce(function(i,f){return i[f]="",i},{});!L(n)||!U(n)||(Object.assign(n.style,s),Object.keys(a).forEach(function(i){n.removeAttribute(i)}))})}}const Rr={name:"applyStyles",enabled:!0,phase:"write",fn:Er,effect:Cr,requires:["computeStyles"]};function I(e){return e.split("-")[0]}var J=Math.max,we=Math.min,re=Math.round;function $e(){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 wt(){return!/^((?!chrome|android).)*safari/i.test($e())}function oe(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var o=e.getBoundingClientRect(),n=1,a=1;t&&L(e)&&(n=e.offsetWidth>0&&re(o.width)/e.offsetWidth||1,a=e.offsetHeight>0&&re(o.height)/e.offsetHeight||1);var c=Q(e)?W(e):window,s=c.visualViewport,i=!wt()&&r,f=(o.left+(i&&s?s.offsetLeft:0))/n,l=(o.top+(i&&s?s.offsetTop:0))/a,v=o.width/n,h=o.height/a;return{width:v,height:h,top:l,right:f+v,bottom:l+h,left:f,x:f,y:l}}function Ve(e){var t=oe(e),r=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:o}}function Pt(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&We(r)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function q(e){return W(e).getComputedStyle(e)}function Ar(e){return["table","td","th"].indexOf(U(e))>=0}function Y(e){return((Q(e)?e.ownerDocument:e.document)||window.document).documentElement}function Pe(e){return U(e)==="html"?e:e.assignedSlot||e.parentNode||(We(e)?e.host:null)||Y(e)}function it(e){return!L(e)||q(e).position==="fixed"?null:e.offsetParent}function Sr(e){var t=/firefox/i.test($e()),r=/Trident/i.test($e());if(r&&L(e)){var o=q(e);if(o.position==="fixed")return null}var n=Pe(e);for(We(n)&&(n=n.host);L(n)&&["html","body"].indexOf(U(n))<0;){var a=q(n);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return n;n=n.parentNode}return null}function ve(e){for(var t=W(e),r=it(e);r&&Ar(r)&&q(r).position==="static";)r=it(r);return r&&(U(r)==="html"||U(r)==="body"&&q(r).position==="static")?t:r||Sr(e)||t}function Le(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ce(e,t,r){return J(e,we(t,r))}function $r(e,t,r){var o=ce(e,t,r);return o>r?r:o}function Ot(){return{top:0,right:0,bottom:0,left:0}}function Et(e){return Object.assign({},Ot(),e)}function Ct(e,t){return t.reduce(function(r,o){return r[o]=e,r},{})}var kr=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Et(typeof t!="number"?t:Ct(t,de))};function Dr(e){var t,r=e.state,o=e.name,n=e.options,a=r.elements.arrow,c=r.modifiersData.popperOffsets,s=I(r.placement),i=Le(s),f=[F,H].indexOf(s)>=0,l=f?"height":"width";if(!(!a||!c)){var v=kr(n.padding,r),h=Ve(a),p=i==="y"?M:F,x=i==="y"?N:H,d=r.rects.reference[l]+r.rects.reference[i]-c[i]-r.rects.popper[l],m=c[i]-r.rects.reference[i],w=ve(a),O=w?i==="y"?w.clientHeight||0:w.clientWidth||0:0,b=d/2-m/2,u=v[p],g=O-h[l]-v[x],y=O/2-h[l]/2+b,P=ce(u,y,g),A=i;r.modifiersData[o]=(t={},t[A]=P,t.centerOffset=P-y,t)}}function jr(e){var t=e.state,r=e.options,o=r.element,n=o===void 0?"[data-popper-arrow]":o;n!=null&&(typeof n=="string"&&(n=t.elements.popper.querySelector(n),!n)||Pt(t.elements.popper,n)&&(t.elements.arrow=n))}const Tr={name:"arrow",enabled:!0,phase:"main",fn:Dr,effect:jr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ne(e){return e.split("-")[1]}var Br={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mr(e,t){var r=e.x,o=e.y,n=t.devicePixelRatio||1;return{x:re(r*n)/n||0,y:re(o*n)/n||0}}function st(e){var t,r=e.popper,o=e.popperRect,n=e.placement,a=e.variation,c=e.offsets,s=e.position,i=e.gpuAcceleration,f=e.adaptive,l=e.roundOffsets,v=e.isFixed,h=c.x,p=h===void 0?0:h,x=c.y,d=x===void 0?0:x,m=typeof l=="function"?l({x:p,y:d}):{x:p,y:d};p=m.x,d=m.y;var w=c.hasOwnProperty("x"),O=c.hasOwnProperty("y"),b=F,u=M,g=window;if(f){var y=ve(r),P="clientHeight",A="clientWidth";if(y===W(r)&&(y=Y(r),q(y).position!=="static"&&s==="absolute"&&(P="scrollHeight",A="scrollWidth")),y=y,n===M||(n===F||n===H)&&a===ue){u=N;var C=v&&y===g&&g.visualViewport?g.visualViewport.height:y[P];d-=C-o.height,d*=i?1:-1}if(n===F||(n===M||n===N)&&a===ue){b=H;var R=v&&y===g&&g.visualViewport?g.visualViewport.width:y[A];p-=R-o.width,p*=i?1:-1}}var $=Object.assign({position:s},f&&Br),j=l===!0?Mr({x:p,y:d},W(r)):{x:p,y:d};if(p=j.x,d=j.y,i){var S;return Object.assign({},$,(S={},S[u]=O?"0":"",S[b]=w?"0":"",S.transform=(g.devicePixelRatio||1)<=1?"translate("+p+"px, "+d+"px)":"translate3d("+p+"px, "+d+"px, 0)",S))}return Object.assign({},$,(t={},t[u]=O?d+"px":"",t[b]=w?p+"px":"",t.transform="",t))}function Fr(e){var t=e.state,r=e.options,o=r.gpuAcceleration,n=o===void 0?!0:o,a=r.adaptive,c=a===void 0?!0:a,s=r.roundOffsets,i=s===void 0?!0:s,f={placement:I(t.placement),variation:ne(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,st(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:i})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,st(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Wr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Fr,data:{}};var be={passive:!0};function Vr(e){var t=e.state,r=e.instance,o=e.options,n=o.scroll,a=n===void 0?!0:n,c=o.resize,s=c===void 0?!0:c,i=W(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&f.forEach(function(l){l.addEventListener("scroll",r.update,be)}),s&&i.addEventListener("resize",r.update,be),function(){a&&f.forEach(function(l){l.removeEventListener("scroll",r.update,be)}),s&&i.removeEventListener("resize",r.update,be)}}const Lr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Vr,data:{}};var Nr={left:"right",right:"left",bottom:"top",top:"bottom"};function xe(e){return e.replace(/left|right|bottom|top/g,function(t){return Nr[t]})}var Hr={start:"end",end:"start"};function lt(e){return e.replace(/start|end/g,function(t){return Hr[t]})}function Ne(e){var t=W(e),r=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:r,scrollTop:o}}function He(e){return oe(Y(e)).left+Ne(e).scrollLeft}function Ir(e,t){var r=W(e),o=Y(e),n=r.visualViewport,a=o.clientWidth,c=o.clientHeight,s=0,i=0;if(n){a=n.width,c=n.height;var f=wt();(f||!f&&t==="fixed")&&(s=n.offsetLeft,i=n.offsetTop)}return{width:a,height:c,x:s+He(e),y:i}}function Ur(e){var t,r=Y(e),o=Ne(e),n=(t=e.ownerDocument)==null?void 0:t.body,a=J(r.scrollWidth,r.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),c=J(r.scrollHeight,r.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-o.scrollLeft+He(e),i=-o.scrollTop;return q(n||r).direction==="rtl"&&(s+=J(r.clientWidth,n?n.clientWidth:0)-a),{width:a,height:c,x:s,y:i}}function Ie(e){var t=q(e),r=t.overflow,o=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+n+o)}function Rt(e){return["html","body","#document"].indexOf(U(e))>=0?e.ownerDocument.body:L(e)&&Ie(e)?e:Rt(Pe(e))}function fe(e,t){var r;t===void 0&&(t=[]);var o=Rt(e),n=o===((r=e.ownerDocument)==null?void 0:r.body),a=W(o),c=n?[a].concat(a.visualViewport||[],Ie(o)?o:[]):o,s=t.concat(c);return n?s:s.concat(fe(Pe(c)))}function ke(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function qr(e,t){var r=oe(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function ct(e,t,r){return t===bt?ke(Ir(e,r)):Q(t)?qr(t,r):ke(Ur(Y(e)))}function zr(e){var t=fe(Pe(e)),r=["absolute","fixed"].indexOf(q(e).position)>=0,o=r&&L(e)?ve(e):e;return Q(o)?t.filter(function(n){return Q(n)&&Pt(n,o)&&U(n)!=="body"}):[]}function Xr(e,t,r,o){var n=t==="clippingParents"?zr(e):[].concat(t),a=[].concat(n,[r]),c=a[0],s=a.reduce(function(i,f){var l=ct(e,f,o);return i.top=J(l.top,i.top),i.right=we(l.right,i.right),i.bottom=we(l.bottom,i.bottom),i.left=J(l.left,i.left),i},ct(e,c,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function At(e){var t=e.reference,r=e.element,o=e.placement,n=o?I(o):null,a=o?ne(o):null,c=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,i;switch(n){case M:i={x:c,y:t.y-r.height};break;case N:i={x:c,y:t.y+t.height};break;case H:i={x:t.x+t.width,y:s};break;case F:i={x:t.x-r.width,y:s};break;default:i={x:t.x,y:t.y}}var f=n?Le(n):null;if(f!=null){var l=f==="y"?"height":"width";switch(a){case te:i[f]=i[f]-(t[l]/2-r[l]/2);break;case ue:i[f]=i[f]+(t[l]/2-r[l]/2);break}}return i}function pe(e,t){t===void 0&&(t={});var r=t,o=r.placement,n=o===void 0?e.placement:o,a=r.strategy,c=a===void 0?e.strategy:a,s=r.boundary,i=s===void 0?pr:s,f=r.rootBoundary,l=f===void 0?bt:f,v=r.elementContext,h=v===void 0?le:v,p=r.altBoundary,x=p===void 0?!1:p,d=r.padding,m=d===void 0?0:d,w=Et(typeof m!="number"?m:Ct(m,de)),O=h===le?dr:le,b=e.rects.popper,u=e.elements[x?O:h],g=Xr(Q(u)?u:u.contextElement||Y(e.elements.popper),i,l,c),y=oe(e.elements.reference),P=At({reference:y,element:b,strategy:"absolute",placement:n}),A=ke(Object.assign({},b,P)),C=h===le?A:y,R={top:g.top-C.top+w.top,bottom:C.bottom-g.bottom+w.bottom,left:g.left-C.left+w.left,right:C.right-g.right+w.right},$=e.modifiersData.offset;if(h===le&&$){var j=$[n];Object.keys(R).forEach(function(S){var D=[H,N].indexOf(S)>=0?1:-1,V=[M,N].indexOf(S)>=0?"y":"x";R[S]+=j[V]*D})}return R}function Yr(e,t){t===void 0&&(t={});var r=t,o=r.placement,n=r.boundary,a=r.rootBoundary,c=r.padding,s=r.flipVariations,i=r.allowedAutoPlacements,f=i===void 0?xt:i,l=ne(o),v=l?s?at:at.filter(function(x){return ne(x)===l}):de,h=v.filter(function(x){return f.indexOf(x)>=0});h.length===0&&(h=v);var p=h.reduce(function(x,d){return x[d]=pe(e,{placement:d,boundary:n,rootBoundary:a,padding:c})[I(d)],x},{});return Object.keys(p).sort(function(x,d){return p[x]-p[d]})}function Gr(e){if(I(e)===Fe)return[];var t=xe(e);return[lt(e),t,lt(t)]}function _r(e){var t=e.state,r=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var n=r.mainAxis,a=n===void 0?!0:n,c=r.altAxis,s=c===void 0?!0:c,i=r.fallbackPlacements,f=r.padding,l=r.boundary,v=r.rootBoundary,h=r.altBoundary,p=r.flipVariations,x=p===void 0?!0:p,d=r.allowedAutoPlacements,m=t.options.placement,w=I(m),O=w===m,b=i||(O||!x?[xe(m)]:Gr(m)),u=[m].concat(b).reduce(function(ee,X){return ee.concat(I(X)===Fe?Yr(t,{placement:X,boundary:l,rootBoundary:v,padding:f,flipVariations:x,allowedAutoPlacements:d}):X)},[]),g=t.rects.reference,y=t.rects.popper,P=new Map,A=!0,C=u[0],R=0;R=0,V=D?"width":"height",k=pe(t,{placement:$,boundary:l,rootBoundary:v,altBoundary:h,padding:f}),B=D?S?H:F:S?N:M;g[V]>y[V]&&(B=xe(B));var z=xe(B),G=[];if(a&&G.push(k[j]<=0),s&&G.push(k[B]<=0,k[z]<=0),G.every(function(ee){return ee})){C=$,A=!1;break}P.set($,G)}if(A)for(var me=x?3:1,Oe=function(X){var se=u.find(function(ge){var _=P.get(ge);if(_)return _.slice(0,X).every(function(Ee){return Ee})});if(se)return C=se,"break"},ie=me;ie>0;ie--){var he=Oe(ie);if(he==="break")break}t.placement!==C&&(t.modifiersData[o]._skip=!0,t.placement=C,t.reset=!0)}}const Zr={name:"flip",enabled:!0,phase:"main",fn:_r,requiresIfExists:["offset"],data:{_skip:!1}};function ft(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function ut(e){return[M,H,N,F].some(function(t){return e[t]>=0})}function Jr(e){var t=e.state,r=e.name,o=t.rects.reference,n=t.rects.popper,a=t.modifiersData.preventOverflow,c=pe(t,{elementContext:"reference"}),s=pe(t,{altBoundary:!0}),i=ft(c,o),f=ft(s,n,a),l=ut(i),v=ut(f);t.modifiersData[r]={referenceClippingOffsets:i,popperEscapeOffsets:f,isReferenceHidden:l,hasPopperEscaped:v},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":v})}const Kr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Jr};function Qr(e,t,r){var o=I(e),n=[F,M].indexOf(o)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,c=a[0],s=a[1];return c=c||0,s=(s||0)*n,[F,H].indexOf(o)>=0?{x:s,y:c}:{x:c,y:s}}function eo(e){var t=e.state,r=e.options,o=e.name,n=r.offset,a=n===void 0?[0,0]:n,c=xt.reduce(function(l,v){return l[v]=Qr(v,t.rects,a),l},{}),s=c[t.placement],i=s.x,f=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=f),t.modifiersData[o]=c}const to={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:eo};function ro(e){var t=e.state,r=e.name;t.modifiersData[r]=At({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const oo={name:"popperOffsets",enabled:!0,phase:"read",fn:ro,data:{}};function no(e){return e==="x"?"y":"x"}function ao(e){var t=e.state,r=e.options,o=e.name,n=r.mainAxis,a=n===void 0?!0:n,c=r.altAxis,s=c===void 0?!1:c,i=r.boundary,f=r.rootBoundary,l=r.altBoundary,v=r.padding,h=r.tether,p=h===void 0?!0:h,x=r.tetherOffset,d=x===void 0?0:x,m=pe(t,{boundary:i,rootBoundary:f,padding:v,altBoundary:l}),w=I(t.placement),O=ne(t.placement),b=!O,u=Le(w),g=no(u),y=t.modifiersData.popperOffsets,P=t.rects.reference,A=t.rects.popper,C=typeof d=="function"?d(Object.assign({},t.rects,{placement:t.placement})):d,R=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(y){if(a){var S,D=u==="y"?M:F,V=u==="y"?N:H,k=u==="y"?"height":"width",B=y[u],z=B+m[D],G=B-m[V],me=p?-A[k]/2:0,Oe=O===te?P[k]:A[k],ie=O===te?-A[k]:-P[k],he=t.elements.arrow,ee=p&&he?Ve(he):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ot(),se=X[D],ge=X[V],_=ce(0,P[k],ee[k]),Ee=b?P[k]/2-me-_-se-R.mainAxis:Oe-_-se-R.mainAxis,$t=b?-P[k]/2+me+_+ge+R.mainAxis:ie+_+ge+R.mainAxis,Ce=t.elements.arrow&&ve(t.elements.arrow),kt=Ce?u==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,Ue=(S=$==null?void 0:$[u])!=null?S:0,Dt=B+Ee-Ue-kt,jt=B+$t-Ue,qe=ce(p?we(z,Dt):z,B,p?J(G,jt):G);y[u]=qe,j[u]=qe-B}if(s){var ze,Tt=u==="x"?M:F,Bt=u==="x"?N:H,Z=y[g],ye=g==="y"?"height":"width",Xe=Z+m[Tt],Ye=Z-m[Bt],Re=[M,F].indexOf(w)!==-1,Ge=(ze=$==null?void 0:$[g])!=null?ze:0,_e=Re?Xe:Z-P[ye]-A[ye]-Ge+R.altAxis,Ze=Re?Z+P[ye]+A[ye]-Ge-R.altAxis:Ye,Je=p&&Re?$r(_e,Z,Ze):ce(p?_e:Xe,Z,p?Ze:Ye);y[g]=Je,j[g]=Je-Z}t.modifiersData[o]=j}}const io={name:"preventOverflow",enabled:!0,phase:"main",fn:ao,requiresIfExists:["offset"]};function so(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function lo(e){return e===W(e)||!L(e)?Ne(e):so(e)}function co(e){var t=e.getBoundingClientRect(),r=re(t.width)/e.offsetWidth||1,o=re(t.height)/e.offsetHeight||1;return r!==1||o!==1}function fo(e,t,r){r===void 0&&(r=!1);var o=L(t),n=L(t)&&co(t),a=Y(t),c=oe(e,n,r),s={scrollLeft:0,scrollTop:0},i={x:0,y:0};return(o||!o&&!r)&&((U(t)!=="body"||Ie(a))&&(s=lo(t)),L(t)?(i=oe(t,!0),i.x+=t.clientLeft,i.y+=t.clientTop):a&&(i.x=He(a))),{x:c.left+s.scrollLeft-i.x,y:c.top+s.scrollTop-i.y,width:c.width,height:c.height}}function uo(e){var t=new Map,r=new Set,o=[];e.forEach(function(a){t.set(a.name,a)});function n(a){r.add(a.name);var c=[].concat(a.requires||[],a.requiresIfExists||[]);c.forEach(function(s){if(!r.has(s)){var i=t.get(s);i&&n(i)}}),o.push(a)}return e.forEach(function(a){r.has(a.name)||n(a)}),o}function po(e){var t=uo(e);return Or.reduce(function(r,o){return r.concat(t.filter(function(n){return n.phase===o}))},[])}function vo(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function mo(e){var t=e.reduce(function(r,o){var n=r[o.name];return r[o.name]=n?Object.assign({},n,o,{options:Object.assign({},n.options,o.options),data:Object.assign({},n.data,o.data)}):o,r},{});return Object.keys(t).map(function(r){return t[r]})}var pt={placement:"bottom",modifiers:[],strategy:"absolute"};function dt(){for(var e=arguments.length,t=new Array(e),r=0;rje({root:["root"]},ur(bo)),Co={},Ro=E.forwardRef(function(t,r){var o;const{anchorEl:n,children:a,direction:c,disablePortal:s,modifiers:i,open:f,placement:l,popperOptions:v,popperRef:h,slotProps:p={},slots:x={},TransitionProps:d}=t,m=ae(t,xo),w=E.useRef(null),O=et(w,r),b=E.useRef(null),u=et(b,h),g=E.useRef(u);tt(()=>{g.current=u},[u]),E.useImperativeHandle(h,()=>b.current,[]);const y=Po(l,c),[P,A]=E.useState(y),[C,R]=E.useState(De(n));E.useEffect(()=>{b.current&&b.current.forceUpdate()}),E.useEffect(()=>{n&&R(De(n))},[n]),tt(()=>{if(!C||!f)return;const V=z=>{A(z.placement)};let k=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:z})=>{V(z)}}];i!=null&&(k=k.concat(i)),v&&v.modifiers!=null&&(k=k.concat(v.modifiers));const B=yo(C,w.current,T({placement:y},v,{modifiers:k}));return g.current(B),()=>{B.destroy(),g.current(null)}},[C,s,i,f,v,y]);const $={placement:P};d!==null&&($.TransitionProps=d);const j=Eo(),S=(o=x.root)!=null?o:"div",D=Yt({elementType:S,externalSlotProps:p.root,externalForwardedProps:m,additionalProps:{role:"tooltip",ref:O},ownerState:t,className:j.root});return K.jsx(S,T({},D,{children:typeof a=="function"?a($):a}))}),Ao=E.forwardRef(function(t,r){const{anchorEl:o,children:n,container:a,direction:c="ltr",disablePortal:s=!1,keepMounted:i=!1,modifiers:f,open:l,placement:v="bottom",popperOptions:h=Co,popperRef:p,style:x,transition:d=!1,slotProps:m={},slots:w={}}=t,O=ae(t,wo),[b,u]=E.useState(!0),g=()=>{u(!1)},y=()=>{u(!0)};if(!i&&!l&&(!d||b))return null;let P;if(a)P=a;else if(o){const R=De(o);P=R&&Oo(R)?rt(R).body:rt(null).body}const A=!l&&i&&(!d||b)?"none":void 0,C=d?{in:l,onEnter:g,onExited:y}:void 0;return K.jsx(Xt,{disablePortal:s,container:P,children:K.jsx(Ro,T({anchorEl:o,direction:c,disablePortal:s,modifiers:f,ref:r,open:d?!b:l,placement:v,popperOptions:h,popperRef:p,slotProps:m,slots:w},O,{style:T({position:"fixed",top:0,left:0,display:A},x),TransitionProps:C,children:n}))})}),So=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],$o=Be(Ao,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),ko=E.forwardRef(function(t,r){var o;const n=qt(),a=Me({props:t,name:"MuiPopper"}),{anchorEl:c,component:s,components:i,componentsProps:f,container:l,disablePortal:v,keepMounted:h,modifiers:p,open:x,placement:d,popperOptions:m,popperRef:w,transition:O,slots:b,slotProps:u}=a,g=ae(a,So),y=(o=b==null?void 0:b.root)!=null?o:i==null?void 0:i.Root,P=T({anchorEl:c,container:l,disablePortal:v,keepMounted:h,modifiers:p,open:x,placement:d,popperOptions:m,popperRef:w,transition:O},g);return K.jsx($o,T({as:s,direction:n==null?void 0:n.direction,slots:{root:y},slotProps:u??f},P,{ref:r}))}),Uo=ko;function qo({props:e,states:t,muiFormControl:r}){return t.reduce((o,n)=>(o[n]=e[n],r&&typeof e[n]>"u"&&(o[n]=r[n]),o),{})}const Do=E.createContext(void 0),St=Do;function zo(){return E.useContext(St)}function vt(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function mt(e,t=!1){return e&&(vt(e.value)&&e.value!==""||t&&vt(e.defaultValue)&&e.defaultValue!=="")}function jo(e){return e.startAdornment}function To(e){return Te("MuiFormControl",e)}ht("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Bo=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Mo=e=>{const{classes:t,margin:r,fullWidth:o}=e,n={root:["root",r!=="none"&&`margin${gt(r)}`,o&&"fullWidth"]};return je(n,To,t)},Fo=Be("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>T({},t.root,t[`margin${gt(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>T({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%"})),Wo=E.forwardRef(function(t,r){const o=Me({props:t,name:"MuiFormControl"}),{children:n,className:a,color:c="primary",component:s="div",disabled:i=!1,error:f=!1,focused:l,fullWidth:v=!1,hiddenLabel:h=!1,margin:p="none",required:x=!1,size:d="medium",variant:m="outlined"}=o,w=ae(o,Bo),O=T({},o,{color:c,component:s,disabled:i,error:f,fullWidth:v,hiddenLabel:h,margin:p,required:x,size:d,variant:m}),b=Mo(O),[u,g]=E.useState(()=>{let S=!1;return n&&E.Children.forEach(n,D=>{if(!Se(D,["Input","Select"]))return;const V=Se(D,["Select"])?D.props.input:D;V&&jo(V.props)&&(S=!0)}),S}),[y,P]=E.useState(()=>{let S=!1;return n&&E.Children.forEach(n,D=>{Se(D,["Input","Select"])&&(mt(D.props,!0)||mt(D.props.inputProps,!0))&&(S=!0)}),S}),[A,C]=E.useState(!1);i&&A&&C(!1);const R=l!==void 0&&!i?l:A;let $;const j=E.useMemo(()=>({adornedStart:u,setAdornedStart:g,color:c,disabled:i,error:f,filled:y,focused:R,fullWidth:v,hiddenLabel:h,size:d,onBlur:()=>{C(!1)},onEmpty:()=>{P(!1)},onFilled:()=>{P(!0)},onFocus:()=>{C(!0)},registerEffect:$,required:x,variant:m}),[u,c,i,f,y,R,v,h,$,x,d,m]);return K.jsx(St.Provider,{value:j,children:K.jsx(Fo,T({as:s,ownerState:O,className:zt(b.root,a),ref:r},w,{children:n}))})}),Xo=Wo,Vo=lr({createStyledComponent:Be("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Me({props:e,name:"MuiStack"})}),Yo=Vo;export{Xo as F,Uo as P,Yo as S,Ho as a,zo as b,St as c,Jt as e,qo as f,mt as i,Io as u}; +import{r as E,$ as Mt,a as ae,e as T,c2 as Ft,c3 as Wt,c4 as Lt,c5 as Vt,c6 as Nt,by as Ke,bx as Ae,c7 as Ht,c1 as It,c8 as Ut,j as K,c9 as Qe,i as je,c as Te,d as ht,l as et,m as tt,s as Be,ca as qt,u as Me,k as gt,h as zt}from"./index-4c5f8236.js";import{w as rt,aZ as Xt,L as Yt}from"./index-a4caf8d5.js";function Se(e,t){var r,o;return E.isValidElement(e)&&t.indexOf((r=e.type.muiName)!=null?r:(o=e.type)==null||(o=o._payload)==null||(o=o.value)==null?void 0:o.muiName)!==-1}let ot=0;function Gt(e){const[t,r]=E.useState(e),o=e||t;return E.useEffect(()=>{t==null&&(ot+=1,r(`mui-${ot}`))},[t]),o}const nt=Mt["useId".toString()];function Ho(e){if(nt!==void 0){const t=nt();return e??t}return Gt(e)}function Io({controlled:e,default:t,name:r,state:o="value"}){const{current:n}=E.useRef(e!==void 0),[a,c]=E.useState(t),s=n?e:a,i=E.useCallback(f=>{n||c(f)},[]);return[s,i]}const _t=["sx"],Zt=e=>{var t,r;const o={systemProps:{},otherProps:{}},n=(t=e==null||(r=e.theme)==null?void 0:r.unstable_sxConfig)!=null?t:Ft;return Object.keys(e).forEach(a=>{n[a]?o.systemProps[a]=e[a]:o.otherProps[a]=e[a]}),o};function Jt(e){const{sx:t}=e,r=ae(e,_t),{systemProps:o,otherProps:n}=Zt(r);let a;return Array.isArray(t)?a=[o,...t]:typeof t=="function"?a=(...c)=>{const s=t(...c);return Wt(s)?T({},o,s):o}:a=T({},o,t),T({},n,{sx:a})}function yt(e){var t,r,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;tt.root});function nr(e){return Nt({props:e,name:"MuiStack",defaultTheme:rr})}function ar(e,t){const r=E.Children.toArray(e).filter(Boolean);return r.reduce((o,n,a)=>(o.push(n),a({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],sr=({ownerState:e,theme:t})=>{let r=T({display:"flex",flexDirection:"column"},Ke({theme:t},Ae({values:e.direction,breakpoints:t.breakpoints.values}),o=>({flexDirection:o})));if(e.spacing){const o=Ht(t),n=Object.keys(t.breakpoints.values).reduce((i,f)=>((typeof e.spacing=="object"&&e.spacing[f]!=null||typeof e.direction=="object"&&e.direction[f]!=null)&&(i[f]=!0),i),{}),a=Ae({values:e.direction,base:n}),c=Ae({values:e.spacing,base:n});typeof a=="object"&&Object.keys(a).forEach((i,f,l)=>{if(!a[i]){const h=f>0?a[l[f-1]]:"column";a[i]=h}}),r=It(r,Ke({theme:t},c,(i,f)=>e.useFlexGap?{gap:Qe(o,i)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${ir(f?a[f]:e.direction)}`]:Qe(o,i)}}))}return r=Ut(t.breakpoints,r),r};function lr(e={}){const{createStyledComponent:t=or,useThemeProps:r=nr,componentName:o="MuiStack"}=e,n=()=>je({root:["root"]},i=>Te(o,i),{}),a=t(sr);return E.forwardRef(function(i,f){const l=r(i),v=Jt(l),{component:h="div",direction:p="column",spacing:x=0,divider:d,children:m,className:w,useFlexGap:O=!1}=v,b=ae(v,tr),u={direction:p,spacing:x,useFlexGap:O},g=n();return K.jsx(a,T({as:h,ownerState:u,ref:f,className:Kt(g.root,w)},b,{children:d?ar(m,d):m}))})}const cr={disableDefaultClasses:!1},fr=E.createContext(cr);function ur(e){const{disableDefaultClasses:t}=E.useContext(fr);return r=>t?"":e(r)}var M="top",N="bottom",H="right",F="left",Fe="auto",de=[M,N,H,F],te="start",ue="end",pr="clippingParents",bt="viewport",le="popper",dr="reference",at=de.reduce(function(e,t){return e.concat([t+"-"+te,t+"-"+ue])},[]),xt=[].concat(de,[Fe]).reduce(function(e,t){return e.concat([t,t+"-"+te,t+"-"+ue])},[]),vr="beforeRead",mr="read",hr="afterRead",gr="beforeMain",yr="main",br="afterMain",xr="beforeWrite",wr="write",Pr="afterWrite",Or=[vr,mr,hr,gr,yr,br,xr,wr,Pr];function U(e){return e?(e.nodeName||"").toLowerCase():null}function W(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Q(e){var t=W(e).Element;return e instanceof t||e instanceof Element}function V(e){var t=W(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function We(e){if(typeof ShadowRoot>"u")return!1;var t=W(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Er(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var o=t.styles[r]||{},n=t.attributes[r]||{},a=t.elements[r];!V(a)||!U(a)||(Object.assign(a.style,o),Object.keys(n).forEach(function(c){var s=n[c];s===!1?a.removeAttribute(c):a.setAttribute(c,s===!0?"":s)}))})}function Cr(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(o){var n=t.elements[o],a=t.attributes[o]||{},c=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:r[o]),s=c.reduce(function(i,f){return i[f]="",i},{});!V(n)||!U(n)||(Object.assign(n.style,s),Object.keys(a).forEach(function(i){n.removeAttribute(i)}))})}}const Rr={name:"applyStyles",enabled:!0,phase:"write",fn:Er,effect:Cr,requires:["computeStyles"]};function I(e){return e.split("-")[0]}var J=Math.max,we=Math.min,re=Math.round;function $e(){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 wt(){return!/^((?!chrome|android).)*safari/i.test($e())}function oe(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var o=e.getBoundingClientRect(),n=1,a=1;t&&V(e)&&(n=e.offsetWidth>0&&re(o.width)/e.offsetWidth||1,a=e.offsetHeight>0&&re(o.height)/e.offsetHeight||1);var c=Q(e)?W(e):window,s=c.visualViewport,i=!wt()&&r,f=(o.left+(i&&s?s.offsetLeft:0))/n,l=(o.top+(i&&s?s.offsetTop:0))/a,v=o.width/n,h=o.height/a;return{width:v,height:h,top:l,right:f+v,bottom:l+h,left:f,x:f,y:l}}function Le(e){var t=oe(e),r=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:o}}function Pt(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&We(r)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function q(e){return W(e).getComputedStyle(e)}function Ar(e){return["table","td","th"].indexOf(U(e))>=0}function Y(e){return((Q(e)?e.ownerDocument:e.document)||window.document).documentElement}function Pe(e){return U(e)==="html"?e:e.assignedSlot||e.parentNode||(We(e)?e.host:null)||Y(e)}function it(e){return!V(e)||q(e).position==="fixed"?null:e.offsetParent}function Sr(e){var t=/firefox/i.test($e()),r=/Trident/i.test($e());if(r&&V(e)){var o=q(e);if(o.position==="fixed")return null}var n=Pe(e);for(We(n)&&(n=n.host);V(n)&&["html","body"].indexOf(U(n))<0;){var a=q(n);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return n;n=n.parentNode}return null}function ve(e){for(var t=W(e),r=it(e);r&&Ar(r)&&q(r).position==="static";)r=it(r);return r&&(U(r)==="html"||U(r)==="body"&&q(r).position==="static")?t:r||Sr(e)||t}function Ve(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function ce(e,t,r){return J(e,we(t,r))}function $r(e,t,r){var o=ce(e,t,r);return o>r?r:o}function Ot(){return{top:0,right:0,bottom:0,left:0}}function Et(e){return Object.assign({},Ot(),e)}function Ct(e,t){return t.reduce(function(r,o){return r[o]=e,r},{})}var kr=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,Et(typeof t!="number"?t:Ct(t,de))};function Dr(e){var t,r=e.state,o=e.name,n=e.options,a=r.elements.arrow,c=r.modifiersData.popperOffsets,s=I(r.placement),i=Ve(s),f=[F,H].indexOf(s)>=0,l=f?"height":"width";if(!(!a||!c)){var v=kr(n.padding,r),h=Le(a),p=i==="y"?M:F,x=i==="y"?N:H,d=r.rects.reference[l]+r.rects.reference[i]-c[i]-r.rects.popper[l],m=c[i]-r.rects.reference[i],w=ve(a),O=w?i==="y"?w.clientHeight||0:w.clientWidth||0:0,b=d/2-m/2,u=v[p],g=O-h[l]-v[x],y=O/2-h[l]/2+b,P=ce(u,y,g),A=i;r.modifiersData[o]=(t={},t[A]=P,t.centerOffset=P-y,t)}}function jr(e){var t=e.state,r=e.options,o=r.element,n=o===void 0?"[data-popper-arrow]":o;n!=null&&(typeof n=="string"&&(n=t.elements.popper.querySelector(n),!n)||Pt(t.elements.popper,n)&&(t.elements.arrow=n))}const Tr={name:"arrow",enabled:!0,phase:"main",fn:Dr,effect:jr,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ne(e){return e.split("-")[1]}var Br={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Mr(e,t){var r=e.x,o=e.y,n=t.devicePixelRatio||1;return{x:re(r*n)/n||0,y:re(o*n)/n||0}}function st(e){var t,r=e.popper,o=e.popperRect,n=e.placement,a=e.variation,c=e.offsets,s=e.position,i=e.gpuAcceleration,f=e.adaptive,l=e.roundOffsets,v=e.isFixed,h=c.x,p=h===void 0?0:h,x=c.y,d=x===void 0?0:x,m=typeof l=="function"?l({x:p,y:d}):{x:p,y:d};p=m.x,d=m.y;var w=c.hasOwnProperty("x"),O=c.hasOwnProperty("y"),b=F,u=M,g=window;if(f){var y=ve(r),P="clientHeight",A="clientWidth";if(y===W(r)&&(y=Y(r),q(y).position!=="static"&&s==="absolute"&&(P="scrollHeight",A="scrollWidth")),y=y,n===M||(n===F||n===H)&&a===ue){u=N;var C=v&&y===g&&g.visualViewport?g.visualViewport.height:y[P];d-=C-o.height,d*=i?1:-1}if(n===F||(n===M||n===N)&&a===ue){b=H;var R=v&&y===g&&g.visualViewport?g.visualViewport.width:y[A];p-=R-o.width,p*=i?1:-1}}var $=Object.assign({position:s},f&&Br),j=l===!0?Mr({x:p,y:d},W(r)):{x:p,y:d};if(p=j.x,d=j.y,i){var S;return Object.assign({},$,(S={},S[u]=O?"0":"",S[b]=w?"0":"",S.transform=(g.devicePixelRatio||1)<=1?"translate("+p+"px, "+d+"px)":"translate3d("+p+"px, "+d+"px, 0)",S))}return Object.assign({},$,(t={},t[u]=O?d+"px":"",t[b]=w?p+"px":"",t.transform="",t))}function Fr(e){var t=e.state,r=e.options,o=r.gpuAcceleration,n=o===void 0?!0:o,a=r.adaptive,c=a===void 0?!0:a,s=r.roundOffsets,i=s===void 0?!0:s,f={placement:I(t.placement),variation:ne(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:n,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,st(Object.assign({},f,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:c,roundOffsets:i})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,st(Object.assign({},f,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:i})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const Wr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Fr,data:{}};var be={passive:!0};function Lr(e){var t=e.state,r=e.instance,o=e.options,n=o.scroll,a=n===void 0?!0:n,c=o.resize,s=c===void 0?!0:c,i=W(t.elements.popper),f=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&f.forEach(function(l){l.addEventListener("scroll",r.update,be)}),s&&i.addEventListener("resize",r.update,be),function(){a&&f.forEach(function(l){l.removeEventListener("scroll",r.update,be)}),s&&i.removeEventListener("resize",r.update,be)}}const Vr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Lr,data:{}};var Nr={left:"right",right:"left",bottom:"top",top:"bottom"};function xe(e){return e.replace(/left|right|bottom|top/g,function(t){return Nr[t]})}var Hr={start:"end",end:"start"};function lt(e){return e.replace(/start|end/g,function(t){return Hr[t]})}function Ne(e){var t=W(e),r=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:r,scrollTop:o}}function He(e){return oe(Y(e)).left+Ne(e).scrollLeft}function Ir(e,t){var r=W(e),o=Y(e),n=r.visualViewport,a=o.clientWidth,c=o.clientHeight,s=0,i=0;if(n){a=n.width,c=n.height;var f=wt();(f||!f&&t==="fixed")&&(s=n.offsetLeft,i=n.offsetTop)}return{width:a,height:c,x:s+He(e),y:i}}function Ur(e){var t,r=Y(e),o=Ne(e),n=(t=e.ownerDocument)==null?void 0:t.body,a=J(r.scrollWidth,r.clientWidth,n?n.scrollWidth:0,n?n.clientWidth:0),c=J(r.scrollHeight,r.clientHeight,n?n.scrollHeight:0,n?n.clientHeight:0),s=-o.scrollLeft+He(e),i=-o.scrollTop;return q(n||r).direction==="rtl"&&(s+=J(r.clientWidth,n?n.clientWidth:0)-a),{width:a,height:c,x:s,y:i}}function Ie(e){var t=q(e),r=t.overflow,o=t.overflowX,n=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+n+o)}function Rt(e){return["html","body","#document"].indexOf(U(e))>=0?e.ownerDocument.body:V(e)&&Ie(e)?e:Rt(Pe(e))}function fe(e,t){var r;t===void 0&&(t=[]);var o=Rt(e),n=o===((r=e.ownerDocument)==null?void 0:r.body),a=W(o),c=n?[a].concat(a.visualViewport||[],Ie(o)?o:[]):o,s=t.concat(c);return n?s:s.concat(fe(Pe(c)))}function ke(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function qr(e,t){var r=oe(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function ct(e,t,r){return t===bt?ke(Ir(e,r)):Q(t)?qr(t,r):ke(Ur(Y(e)))}function zr(e){var t=fe(Pe(e)),r=["absolute","fixed"].indexOf(q(e).position)>=0,o=r&&V(e)?ve(e):e;return Q(o)?t.filter(function(n){return Q(n)&&Pt(n,o)&&U(n)!=="body"}):[]}function Xr(e,t,r,o){var n=t==="clippingParents"?zr(e):[].concat(t),a=[].concat(n,[r]),c=a[0],s=a.reduce(function(i,f){var l=ct(e,f,o);return i.top=J(l.top,i.top),i.right=we(l.right,i.right),i.bottom=we(l.bottom,i.bottom),i.left=J(l.left,i.left),i},ct(e,c,o));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function At(e){var t=e.reference,r=e.element,o=e.placement,n=o?I(o):null,a=o?ne(o):null,c=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,i;switch(n){case M:i={x:c,y:t.y-r.height};break;case N:i={x:c,y:t.y+t.height};break;case H:i={x:t.x+t.width,y:s};break;case F:i={x:t.x-r.width,y:s};break;default:i={x:t.x,y:t.y}}var f=n?Ve(n):null;if(f!=null){var l=f==="y"?"height":"width";switch(a){case te:i[f]=i[f]-(t[l]/2-r[l]/2);break;case ue:i[f]=i[f]+(t[l]/2-r[l]/2);break}}return i}function pe(e,t){t===void 0&&(t={});var r=t,o=r.placement,n=o===void 0?e.placement:o,a=r.strategy,c=a===void 0?e.strategy:a,s=r.boundary,i=s===void 0?pr:s,f=r.rootBoundary,l=f===void 0?bt:f,v=r.elementContext,h=v===void 0?le:v,p=r.altBoundary,x=p===void 0?!1:p,d=r.padding,m=d===void 0?0:d,w=Et(typeof m!="number"?m:Ct(m,de)),O=h===le?dr:le,b=e.rects.popper,u=e.elements[x?O:h],g=Xr(Q(u)?u:u.contextElement||Y(e.elements.popper),i,l,c),y=oe(e.elements.reference),P=At({reference:y,element:b,strategy:"absolute",placement:n}),A=ke(Object.assign({},b,P)),C=h===le?A:y,R={top:g.top-C.top+w.top,bottom:C.bottom-g.bottom+w.bottom,left:g.left-C.left+w.left,right:C.right-g.right+w.right},$=e.modifiersData.offset;if(h===le&&$){var j=$[n];Object.keys(R).forEach(function(S){var D=[H,N].indexOf(S)>=0?1:-1,L=[M,N].indexOf(S)>=0?"y":"x";R[S]+=j[L]*D})}return R}function Yr(e,t){t===void 0&&(t={});var r=t,o=r.placement,n=r.boundary,a=r.rootBoundary,c=r.padding,s=r.flipVariations,i=r.allowedAutoPlacements,f=i===void 0?xt:i,l=ne(o),v=l?s?at:at.filter(function(x){return ne(x)===l}):de,h=v.filter(function(x){return f.indexOf(x)>=0});h.length===0&&(h=v);var p=h.reduce(function(x,d){return x[d]=pe(e,{placement:d,boundary:n,rootBoundary:a,padding:c})[I(d)],x},{});return Object.keys(p).sort(function(x,d){return p[x]-p[d]})}function Gr(e){if(I(e)===Fe)return[];var t=xe(e);return[lt(e),t,lt(t)]}function _r(e){var t=e.state,r=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var n=r.mainAxis,a=n===void 0?!0:n,c=r.altAxis,s=c===void 0?!0:c,i=r.fallbackPlacements,f=r.padding,l=r.boundary,v=r.rootBoundary,h=r.altBoundary,p=r.flipVariations,x=p===void 0?!0:p,d=r.allowedAutoPlacements,m=t.options.placement,w=I(m),O=w===m,b=i||(O||!x?[xe(m)]:Gr(m)),u=[m].concat(b).reduce(function(ee,X){return ee.concat(I(X)===Fe?Yr(t,{placement:X,boundary:l,rootBoundary:v,padding:f,flipVariations:x,allowedAutoPlacements:d}):X)},[]),g=t.rects.reference,y=t.rects.popper,P=new Map,A=!0,C=u[0],R=0;R=0,L=D?"width":"height",k=pe(t,{placement:$,boundary:l,rootBoundary:v,altBoundary:h,padding:f}),B=D?S?H:F:S?N:M;g[L]>y[L]&&(B=xe(B));var z=xe(B),G=[];if(a&&G.push(k[j]<=0),s&&G.push(k[B]<=0,k[z]<=0),G.every(function(ee){return ee})){C=$,A=!1;break}P.set($,G)}if(A)for(var me=x?3:1,Oe=function(X){var se=u.find(function(ge){var _=P.get(ge);if(_)return _.slice(0,X).every(function(Ee){return Ee})});if(se)return C=se,"break"},ie=me;ie>0;ie--){var he=Oe(ie);if(he==="break")break}t.placement!==C&&(t.modifiersData[o]._skip=!0,t.placement=C,t.reset=!0)}}const Zr={name:"flip",enabled:!0,phase:"main",fn:_r,requiresIfExists:["offset"],data:{_skip:!1}};function ft(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function ut(e){return[M,H,N,F].some(function(t){return e[t]>=0})}function Jr(e){var t=e.state,r=e.name,o=t.rects.reference,n=t.rects.popper,a=t.modifiersData.preventOverflow,c=pe(t,{elementContext:"reference"}),s=pe(t,{altBoundary:!0}),i=ft(c,o),f=ft(s,n,a),l=ut(i),v=ut(f);t.modifiersData[r]={referenceClippingOffsets:i,popperEscapeOffsets:f,isReferenceHidden:l,hasPopperEscaped:v},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":l,"data-popper-escaped":v})}const Kr={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Jr};function Qr(e,t,r){var o=I(e),n=[F,M].indexOf(o)>=0?-1:1,a=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,c=a[0],s=a[1];return c=c||0,s=(s||0)*n,[F,H].indexOf(o)>=0?{x:s,y:c}:{x:c,y:s}}function eo(e){var t=e.state,r=e.options,o=e.name,n=r.offset,a=n===void 0?[0,0]:n,c=xt.reduce(function(l,v){return l[v]=Qr(v,t.rects,a),l},{}),s=c[t.placement],i=s.x,f=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=i,t.modifiersData.popperOffsets.y+=f),t.modifiersData[o]=c}const to={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:eo};function ro(e){var t=e.state,r=e.name;t.modifiersData[r]=At({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const oo={name:"popperOffsets",enabled:!0,phase:"read",fn:ro,data:{}};function no(e){return e==="x"?"y":"x"}function ao(e){var t=e.state,r=e.options,o=e.name,n=r.mainAxis,a=n===void 0?!0:n,c=r.altAxis,s=c===void 0?!1:c,i=r.boundary,f=r.rootBoundary,l=r.altBoundary,v=r.padding,h=r.tether,p=h===void 0?!0:h,x=r.tetherOffset,d=x===void 0?0:x,m=pe(t,{boundary:i,rootBoundary:f,padding:v,altBoundary:l}),w=I(t.placement),O=ne(t.placement),b=!O,u=Ve(w),g=no(u),y=t.modifiersData.popperOffsets,P=t.rects.reference,A=t.rects.popper,C=typeof d=="function"?d(Object.assign({},t.rects,{placement:t.placement})):d,R=typeof C=="number"?{mainAxis:C,altAxis:C}:Object.assign({mainAxis:0,altAxis:0},C),$=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,j={x:0,y:0};if(y){if(a){var S,D=u==="y"?M:F,L=u==="y"?N:H,k=u==="y"?"height":"width",B=y[u],z=B+m[D],G=B-m[L],me=p?-A[k]/2:0,Oe=O===te?P[k]:A[k],ie=O===te?-A[k]:-P[k],he=t.elements.arrow,ee=p&&he?Le(he):{width:0,height:0},X=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Ot(),se=X[D],ge=X[L],_=ce(0,P[k],ee[k]),Ee=b?P[k]/2-me-_-se-R.mainAxis:Oe-_-se-R.mainAxis,$t=b?-P[k]/2+me+_+ge+R.mainAxis:ie+_+ge+R.mainAxis,Ce=t.elements.arrow&&ve(t.elements.arrow),kt=Ce?u==="y"?Ce.clientTop||0:Ce.clientLeft||0:0,Ue=(S=$==null?void 0:$[u])!=null?S:0,Dt=B+Ee-Ue-kt,jt=B+$t-Ue,qe=ce(p?we(z,Dt):z,B,p?J(G,jt):G);y[u]=qe,j[u]=qe-B}if(s){var ze,Tt=u==="x"?M:F,Bt=u==="x"?N:H,Z=y[g],ye=g==="y"?"height":"width",Xe=Z+m[Tt],Ye=Z-m[Bt],Re=[M,F].indexOf(w)!==-1,Ge=(ze=$==null?void 0:$[g])!=null?ze:0,_e=Re?Xe:Z-P[ye]-A[ye]-Ge+R.altAxis,Ze=Re?Z+P[ye]+A[ye]-Ge-R.altAxis:Ye,Je=p&&Re?$r(_e,Z,Ze):ce(p?_e:Xe,Z,p?Ze:Ye);y[g]=Je,j[g]=Je-Z}t.modifiersData[o]=j}}const io={name:"preventOverflow",enabled:!0,phase:"main",fn:ao,requiresIfExists:["offset"]};function so(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function lo(e){return e===W(e)||!V(e)?Ne(e):so(e)}function co(e){var t=e.getBoundingClientRect(),r=re(t.width)/e.offsetWidth||1,o=re(t.height)/e.offsetHeight||1;return r!==1||o!==1}function fo(e,t,r){r===void 0&&(r=!1);var o=V(t),n=V(t)&&co(t),a=Y(t),c=oe(e,n,r),s={scrollLeft:0,scrollTop:0},i={x:0,y:0};return(o||!o&&!r)&&((U(t)!=="body"||Ie(a))&&(s=lo(t)),V(t)?(i=oe(t,!0),i.x+=t.clientLeft,i.y+=t.clientTop):a&&(i.x=He(a))),{x:c.left+s.scrollLeft-i.x,y:c.top+s.scrollTop-i.y,width:c.width,height:c.height}}function uo(e){var t=new Map,r=new Set,o=[];e.forEach(function(a){t.set(a.name,a)});function n(a){r.add(a.name);var c=[].concat(a.requires||[],a.requiresIfExists||[]);c.forEach(function(s){if(!r.has(s)){var i=t.get(s);i&&n(i)}}),o.push(a)}return e.forEach(function(a){r.has(a.name)||n(a)}),o}function po(e){var t=uo(e);return Or.reduce(function(r,o){return r.concat(t.filter(function(n){return n.phase===o}))},[])}function vo(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function mo(e){var t=e.reduce(function(r,o){var n=r[o.name];return r[o.name]=n?Object.assign({},n,o,{options:Object.assign({},n.options,o.options),data:Object.assign({},n.data,o.data)}):o,r},{});return Object.keys(t).map(function(r){return t[r]})}var pt={placement:"bottom",modifiers:[],strategy:"absolute"};function dt(){for(var e=arguments.length,t=new Array(e),r=0;rje({root:["root"]},ur(bo)),Co={},Ro=E.forwardRef(function(t,r){var o;const{anchorEl:n,children:a,direction:c,disablePortal:s,modifiers:i,open:f,placement:l,popperOptions:v,popperRef:h,slotProps:p={},slots:x={},TransitionProps:d}=t,m=ae(t,xo),w=E.useRef(null),O=et(w,r),b=E.useRef(null),u=et(b,h),g=E.useRef(u);tt(()=>{g.current=u},[u]),E.useImperativeHandle(h,()=>b.current,[]);const y=Po(l,c),[P,A]=E.useState(y),[C,R]=E.useState(De(n));E.useEffect(()=>{b.current&&b.current.forceUpdate()}),E.useEffect(()=>{n&&R(De(n))},[n]),tt(()=>{if(!C||!f)return;const L=z=>{A(z.placement)};let k=[{name:"preventOverflow",options:{altBoundary:s}},{name:"flip",options:{altBoundary:s}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:z})=>{L(z)}}];i!=null&&(k=k.concat(i)),v&&v.modifiers!=null&&(k=k.concat(v.modifiers));const B=yo(C,w.current,T({placement:y},v,{modifiers:k}));return g.current(B),()=>{B.destroy(),g.current(null)}},[C,s,i,f,v,y]);const $={placement:P};d!==null&&($.TransitionProps=d);const j=Eo(),S=(o=x.root)!=null?o:"div",D=Yt({elementType:S,externalSlotProps:p.root,externalForwardedProps:m,additionalProps:{role:"tooltip",ref:O},ownerState:t,className:j.root});return K.jsx(S,T({},D,{children:typeof a=="function"?a($):a}))}),Ao=E.forwardRef(function(t,r){const{anchorEl:o,children:n,container:a,direction:c="ltr",disablePortal:s=!1,keepMounted:i=!1,modifiers:f,open:l,placement:v="bottom",popperOptions:h=Co,popperRef:p,style:x,transition:d=!1,slotProps:m={},slots:w={}}=t,O=ae(t,wo),[b,u]=E.useState(!0),g=()=>{u(!1)},y=()=>{u(!0)};if(!i&&!l&&(!d||b))return null;let P;if(a)P=a;else if(o){const R=De(o);P=R&&Oo(R)?rt(R).body:rt(null).body}const A=!l&&i&&(!d||b)?"none":void 0,C=d?{in:l,onEnter:g,onExited:y}:void 0;return K.jsx(Xt,{disablePortal:s,container:P,children:K.jsx(Ro,T({anchorEl:o,direction:c,disablePortal:s,modifiers:f,ref:r,open:d?!b:l,placement:v,popperOptions:h,popperRef:p,slotProps:m,slots:w},O,{style:T({position:"fixed",top:0,left:0,display:A},x),TransitionProps:C,children:n}))})}),So=["anchorEl","component","components","componentsProps","container","disablePortal","keepMounted","modifiers","open","placement","popperOptions","popperRef","transition","slots","slotProps"],$o=Be(Ao,{name:"MuiPopper",slot:"Root",overridesResolver:(e,t)=>t.root})({}),ko=E.forwardRef(function(t,r){var o;const n=qt(),a=Me({props:t,name:"MuiPopper"}),{anchorEl:c,component:s,components:i,componentsProps:f,container:l,disablePortal:v,keepMounted:h,modifiers:p,open:x,placement:d,popperOptions:m,popperRef:w,transition:O,slots:b,slotProps:u}=a,g=ae(a,So),y=(o=b==null?void 0:b.root)!=null?o:i==null?void 0:i.Root,P=T({anchorEl:c,container:l,disablePortal:v,keepMounted:h,modifiers:p,open:x,placement:d,popperOptions:m,popperRef:w,transition:O},g);return K.jsx($o,T({as:s,direction:n==null?void 0:n.direction,slots:{root:y},slotProps:u??f},P,{ref:r}))}),Uo=ko;function qo({props:e,states:t,muiFormControl:r}){return t.reduce((o,n)=>(o[n]=e[n],r&&typeof e[n]>"u"&&(o[n]=r[n]),o),{})}const Do=E.createContext(void 0),St=Do;function zo(){return E.useContext(St)}function vt(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function mt(e,t=!1){return e&&(vt(e.value)&&e.value!==""||t&&vt(e.defaultValue)&&e.defaultValue!=="")}function jo(e){return e.startAdornment}function To(e){return Te("MuiFormControl",e)}ht("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const Bo=["children","className","color","component","disabled","error","focused","fullWidth","hiddenLabel","margin","required","size","variant"],Mo=e=>{const{classes:t,margin:r,fullWidth:o}=e,n={root:["root",r!=="none"&&`margin${gt(r)}`,o&&"fullWidth"]};return je(n,To,t)},Fo=Be("div",{name:"MuiFormControl",slot:"Root",overridesResolver:({ownerState:e},t)=>T({},t.root,t[`margin${gt(e.margin)}`],e.fullWidth&&t.fullWidth)})(({ownerState:e})=>T({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%"})),Wo=E.forwardRef(function(t,r){const o=Me({props:t,name:"MuiFormControl"}),{children:n,className:a,color:c="primary",component:s="div",disabled:i=!1,error:f=!1,focused:l,fullWidth:v=!1,hiddenLabel:h=!1,margin:p="none",required:x=!1,size:d="medium",variant:m="outlined"}=o,w=ae(o,Bo),O=T({},o,{color:c,component:s,disabled:i,error:f,fullWidth:v,hiddenLabel:h,margin:p,required:x,size:d,variant:m}),b=Mo(O),[u,g]=E.useState(()=>{let S=!1;return n&&E.Children.forEach(n,D=>{if(!Se(D,["Input","Select"]))return;const L=Se(D,["Select"])?D.props.input:D;L&&jo(L.props)&&(S=!0)}),S}),[y,P]=E.useState(()=>{let S=!1;return n&&E.Children.forEach(n,D=>{Se(D,["Input","Select"])&&(mt(D.props,!0)||mt(D.props.inputProps,!0))&&(S=!0)}),S}),[A,C]=E.useState(!1);i&&A&&C(!1);const R=l!==void 0&&!i?l:A;let $;const j=E.useMemo(()=>({adornedStart:u,setAdornedStart:g,color:c,disabled:i,error:f,filled:y,focused:R,fullWidth:v,hiddenLabel:h,size:d,onBlur:()=>{C(!1)},onEmpty:()=>{P(!1)},onFilled:()=>{P(!0)},onFocus:()=>{C(!0)},registerEffect:$,required:x,variant:m}),[u,c,i,f,y,R,v,h,$,x,d,m]);return K.jsx(St.Provider,{value:j,children:K.jsx(Fo,T({as:s,ownerState:O,className:zt(b.root,a),ref:r},w,{children:n}))})}),Xo=Wo,Lo=lr({createStyledComponent:Be("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,t)=>t.root}),useThemeProps:e=>Me({props:e,name:"MuiStack"})}),Yo=Lo;export{Xo as F,Uo as P,Yo as S,Ho as a,zo as b,St as c,Jt as e,qo as f,mt as i,Io as u}; diff --git a/build/assets/Streamable-82eee799.js b/build/assets/Streamable-eda3098a.js similarity index 95% rename from build/assets/Streamable-82eee799.js rename to build/assets/Streamable-eda3098a.js index ef16816ac..2743258a0 100644 --- a/build/assets/Streamable-82eee799.js +++ b/build/assets/Streamable-eda3098a.js @@ -1 +1 @@ -import{g as m,r as f}from"./index-16ff4e55.js";import{u as _,p as b}from"./index-e4c394ce.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,j=Object.prototype.hasOwnProperty,L=(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))!j.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)=>(L(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{g as m,r as f}from"./index-4c5f8236.js";import{u as _,p as b}from"./index-ad04f3f7.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,j=Object.prototype.hasOwnProperty,L=(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))!j.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)=>(L(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/Tabs-0da0e37b.js b/build/assets/Tabs-02e36f7f.js similarity index 98% rename from build/assets/Tabs-0da0e37b.js rename to build/assets/Tabs-02e36f7f.js index 35d3a95e2..2fe29466e 100644 --- a/build/assets/Tabs-0da0e37b.js +++ b/build/assets/Tabs-02e36f7f.js @@ -1 +1 @@ -import{d as ft,c as pt,s as O,B as Pt,k as Lt,e as b,r as c,u as ht,a as rt,h as L,j as S,i as St,m as Zt,q as Nt,p as ut}from"./index-16ff4e55.js";import{J as $t,B as kt,U as lt,y as te}from"./index-04a82be1.js";import{c as Ft}from"./createSvgIcon-e167cb2e.js";let U;function At(){if(U)return U;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),U="reverse",t.scrollLeft>0?U="default":(t.scrollLeft=1,t.scrollLeft===0&&(U="negative")),document.body.removeChild(t),U}function ee(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch(At()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function oe(t){return pt("MuiTab",t)}const le=ft("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),A=le,re=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ne=t=>{const{classes:e,textColor:r,fullWidth:a,wrapped:n,icon:d,label:h,selected:p,disabled:u}=t,m={root:["root",d&&h&&"labelIcon",`textColor${Lt(r)}`,a&&"fullWidth",n&&"wrapped",p&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return St(m,oe,e)},se=O(Pt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Lt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>b({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${A.iconWrapper}`]:b({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${A.selected}`]:{opacity:1},[`&.${A.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),ae=c.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTab"}),{className:n,disabled:d=!1,disableFocusRipple:h=!1,fullWidth:p,icon:u,iconPosition:m="top",indicator:w,label:T,onChange:y,onClick:x,onFocus:j,selected:I,selectionFollowsFocus:g,textColor:H="inherit",value:B,wrapped:nt=!1}=a,D=rt(a,re),Y=b({},a,{disabled:d,disableFocusRipple:h,selected:I,icon:!!u,iconPosition:m,label:!!T,fullWidth:p,textColor:H,wrapped:nt}),X=ne(Y),N=u&&T&&c.isValidElement(u)?c.cloneElement(u,{className:L(X.iconWrapper,u.props.className)}):u,J=R=>{!I&&y&&y(R,B),x&&x(R)},_=R=>{g&&!I&&y&&y(R,B),j&&j(R)};return S.jsxs(se,b({focusRipple:!h,className:L(X.root,n),ref:r,role:"tab","aria-selected":I,disabled:d,onClick:J,onFocus:_,ownerState:Y,tabIndex:I?0:-1},D,{children:[m==="top"||m==="start"?S.jsxs(c.Fragment,{children:[N,T]}):S.jsxs(c.Fragment,{children:[T,N]}),w]}))}),ke=ae,ie=Ft(S.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),ce=Ft(S.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function de(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function ue(t,e,r,a={},n=()=>{}){const{ease:d=de,duration:h=300}=a;let p=null;const u=e[t];let m=!1;const w=()=>{m=!0},T=y=>{if(m){n(new Error("Animation cancelled"));return}p===null&&(p=y);const x=Math.min(1,(y-p)/h);if(e[t]=d(x)*(r-u)+u,x>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(T)};return u===r?(n(new Error("Element already at target position")),w):(requestAnimationFrame(T),w)}const be=["onChange"],fe={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function pe(t){const{onChange:e}=t,r=rt(t,be),a=c.useRef(),n=c.useRef(null),d=()=>{a.current=n.current.offsetHeight-n.current.clientHeight};return Zt(()=>{const h=$t(()=>{const u=a.current;d(),u!==a.current&&e(a.current)}),p=kt(n.current);return p.addEventListener("resize",h),()=>{h.clear(),p.removeEventListener("resize",h)}},[e]),c.useEffect(()=>{d(),e(a.current)},[e]),S.jsx("div",b({style:fe,ref:n},r))}function he(t){return pt("MuiTabScrollButton",t)}const Se=ft("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ve=Se,me=["className","slots","slotProps","direction","orientation","disabled"],xe=t=>{const{classes:e,orientation:r,disabled:a}=t;return St({root:["root",r,a&&"disabled"]},he,e)},ge=O(Pt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>b({width:40,flexShrink:0,opacity:.8,[`&.${ve.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),ye=c.forwardRef(function(e,r){var a,n;const d=ht({props:e,name:"MuiTabScrollButton"}),{className:h,slots:p={},slotProps:u={},direction:m}=d,w=rt(d,me),y=Nt().direction==="rtl",x=b({isRtl:y},d),j=xe(x),I=(a=p.StartScrollButtonIcon)!=null?a:ie,g=(n=p.EndScrollButtonIcon)!=null?n:ce,H=lt({elementType:I,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:x}),B=lt({elementType:g,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:x});return S.jsx(ge,b({component:"div",className:L(j.root,h),ref:r,role:null,ownerState:x,tabIndex:null},w,{children:m==="left"?S.jsx(I,b({},H)):S.jsx(g,b({},B))}))}),Be=ye;function Ce(t){return pt("MuiTabs",t)}const we=ft("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),bt=we,Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Rt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,zt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let a=!1,n=r(t,e);for(;n;){if(n===t.firstChild){if(a)return;a=!0}const d=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||d)n=r(t,n);else{n.focus();return}}},Ie=t=>{const{vertical:e,fixed:r,hideScrollbar:a,scrollableX:n,scrollableY:d,centered:h,scrollButtonsHideMobile:p,classes:u}=t;return St({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",a&&"hideScrollbar",n&&"scrollableX",d&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",h&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",p&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},Ce,u)},Ee=O("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>b({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Me=O("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>b({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),Re=O("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>b({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),ze=O("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>b({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),We=O(pe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Wt={},Pe=c.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTabs"}),n=Nt(),d=n.direction==="rtl",{"aria-label":h,"aria-labelledby":p,action:u,centered:m=!1,children:w,className:T,component:y="div",allowScrollButtonsMobile:x=!1,indicatorColor:j="primary",onChange:I,orientation:g="horizontal",ScrollButtonComponent:H=Be,scrollButtons:B="auto",selectionFollowsFocus:nt,slots:D={},slotProps:Y={},TabIndicatorProps:X={},TabScrollButtonProps:N={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:st=!1}=a,Ot=rt(a,Te),E=R==="scrollable",C=g==="vertical",K=C?"scrollTop":"scrollLeft",Q=C?"top":"left",Z=C?"bottom":"right",at=C?"clientHeight":"clientWidth",V=C?"height":"width",$=b({},a,{component:y,allowScrollButtonsMobile:x,indicatorColor:j,orientation:g,vertical:C,scrollButtons:B,textColor:J,variant:R,visibleScrollbar:st,fixed:!E,hideScrollbar:E&&!st,scrollableX:E&&!C,scrollableY:E&&C,centered:m&&!E,scrollButtonsHideMobile:!x}),W=Ie($),jt=lt({elementType:D.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:$}),Ht=lt({elementType:D.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:$}),[vt,Dt]=c.useState(!1),[k,mt]=c.useState(Wt),[xt,Xt]=c.useState(!1),[gt,_t]=c.useState(!1),[yt,Ut]=c.useState(!1),[Bt,Yt]=c.useState({overflow:"hidden",scrollbarWidth:0}),Ct=new Map,z=c.useRef(null),F=c.useRef(null),wt=()=>{const o=z.current;let l;if(o){const s=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ee(o,n.direction),scrollWidth:o.scrollWidth,top:s.top,bottom:s.bottom,left:s.left,right:s.right}}let i;if(o&&_!==!1){const s=F.current.children;if(s.length>0){const f=s[Ct.get(_)];i=f?f.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:i}},q=ut(()=>{const{tabsMeta:o,tabMeta:l}=wt();let i=0,s;if(C)s="top",l&&o&&(i=l.top-o.top+o.scrollTop);else if(s=d?"right":"left",l&&o){const v=d?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;i=(d?-1:1)*(l[s]-o[s]+v)}const f={[s]:i,[V]:l?l[V]:0};if(isNaN(k[s])||isNaN(k[V]))mt(f);else{const v=Math.abs(k[s]-f[s]),M=Math.abs(k[V]-f[V]);(v>=1||M>=1)&&mt(f)}}),it=(o,{animation:l=!0}={})=>{l?ue(K,z.current,o,{duration:n.transitions.duration.standard}):z.current[K]=o},Tt=o=>{let l=z.current[K];C?l+=o:(l+=o*(d?-1:1),l*=d&&At()==="reverse"?-1:1),it(l)},It=()=>{const o=z.current[at];let l=0;const i=Array.from(F.current.children);for(let s=0;so){s===0&&(l=o);break}l+=f[at]}return l},Kt=()=>{Tt(-1*It())},Vt=()=>{Tt(It())},qt=c.useCallback(o=>{Yt({overflow:null,scrollbarWidth:o})},[]),Gt=()=>{const o={};o.scrollbarSizeListener=E?S.jsx(We,{onChange:qt,className:L(W.scrollableX,W.hideScrollbar)}):null;const i=E&&(B==="auto"&&(xt||gt)||B===!0);return o.scrollButtonStart=i?S.jsx(H,b({slots:{StartScrollButtonIcon:D.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:jt},orientation:g,direction:d?"right":"left",onClick:Kt,disabled:!xt},N,{className:L(W.scrollButtons,N.className)})):null,o.scrollButtonEnd=i?S.jsx(H,b({slots:{EndScrollButtonIcon:D.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ht},orientation:g,direction:d?"left":"right",onClick:Vt,disabled:!gt},N,{className:L(W.scrollButtons,N.className)})):null,o},Et=ut(o=>{const{tabsMeta:l,tabMeta:i}=wt();if(!(!i||!l)){if(i[Q]l[Z]){const s=l[K]+(i[Z]-l[Z]);it(s,{animation:o})}}}),tt=ut(()=>{E&&B!==!1&&Ut(!yt)});c.useEffect(()=>{const o=$t(()=>{z.current&&q()});let l;const i=v=>{v.forEach(M=>{M.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),M.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},s=kt(z.current);s.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from(F.current.children).forEach(v=>{l.observe(v)})),typeof MutationObserver<"u"&&(f=new MutationObserver(i),f.observe(F.current,{childList:!0})),()=>{var v,M;o.clear(),s.removeEventListener("resize",o),(v=f)==null||v.disconnect(),(M=l)==null||M.disconnect()}},[q,tt]),c.useEffect(()=>{const o=Array.from(F.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&E&&B!==!1){const i=o[0],s=o[l-1],f={root:z.current,threshold:.99},v=dt=>{Xt(!dt[0].isIntersecting)},M=new IntersectionObserver(v,f);M.observe(i);const G=dt=>{_t(!dt[0].isIntersecting)},P=new IntersectionObserver(G,f);return P.observe(s),()=>{M.disconnect(),P.disconnect()}}},[E,B,yt,w==null?void 0:w.length]),c.useEffect(()=>{Dt(!0)},[]),c.useEffect(()=>{q()}),c.useEffect(()=>{Et(Wt!==k)},[Et,k]),c.useImperativeHandle(u,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const Mt=S.jsx(ze,b({},X,{className:L(W.indicator,X.className),ownerState:$,style:b({},k,X.style)}));let et=0;const Jt=c.Children.map(w,o=>{if(!c.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;Ct.set(l,et);const i=l===_;return et+=1,c.cloneElement(o,b({fullWidth:R==="fullWidth",indicator:i&&!vt&&Mt,selected:i,selectionFollowsFocus:nt,onChange:I,textColor:J,value:l},et===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Qt=o=>{const l=F.current,i=te(l).activeElement;if(i.getAttribute("role")!=="tab")return;let f=g==="horizontal"?"ArrowLeft":"ArrowUp",v=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&d&&(f="ArrowRight",v="ArrowLeft"),o.key){case f:o.preventDefault(),ot(l,i,zt);break;case v:o.preventDefault(),ot(l,i,Rt);break;case"Home":o.preventDefault(),ot(l,null,Rt);break;case"End":o.preventDefault(),ot(l,null,zt);break}},ct=Gt();return S.jsxs(Ee,b({className:L(W.root,T),ownerState:$,ref:r,as:y},Ot,{children:[ct.scrollButtonStart,ct.scrollbarSizeListener,S.jsxs(Me,{className:W.scroller,ownerState:$,style:{overflow:Bt.overflow,[C?`margin${d?"Left":"Right"}`:"marginBottom"]:st?void 0:-Bt.scrollbarWidth},ref:z,children:[S.jsx(Re,{"aria-label":h,"aria-labelledby":p,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:$,onKeyDown:Qt,ref:F,role:"tablist",children:Jt}),vt&&Mt]}),ct.scrollButtonEnd]}))}),Fe=Pe;export{Fe as T,ke as a}; +import{d as ft,c as pt,s as O,B as Pt,k as Lt,e as b,r as c,u as ht,a as rt,h as L,j as S,i as St,m as Zt,q as Nt,p as ut}from"./index-4c5f8236.js";import{B as $t,y as kt,L as lt,w as te}from"./index-a4caf8d5.js";import{c as Ft}from"./createSvgIcon-2fe026f6.js";let U;function At(){if(U)return U;const t=document.createElement("div"),e=document.createElement("div");return e.style.width="10px",e.style.height="1px",t.appendChild(e),t.dir="rtl",t.style.fontSize="14px",t.style.width="4px",t.style.height="1px",t.style.position="absolute",t.style.top="-1000px",t.style.overflow="scroll",document.body.appendChild(t),U="reverse",t.scrollLeft>0?U="default":(t.scrollLeft=1,t.scrollLeft===0&&(U="negative")),document.body.removeChild(t),U}function ee(t,e){const r=t.scrollLeft;if(e!=="rtl")return r;switch(At()){case"negative":return t.scrollWidth-t.clientWidth+r;case"reverse":return t.scrollWidth-t.clientWidth-r;default:return r}}function oe(t){return pt("MuiTab",t)}const le=ft("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper"]),A=le,re=["className","disabled","disableFocusRipple","fullWidth","icon","iconPosition","indicator","label","onChange","onClick","onFocus","selected","selectionFollowsFocus","textColor","value","wrapped"],ne=t=>{const{classes:e,textColor:r,fullWidth:a,wrapped:n,icon:d,label:h,selected:p,disabled:u}=t,m={root:["root",d&&h&&"labelIcon",`textColor${Lt(r)}`,a&&"fullWidth",n&&"wrapped",p&&"selected",u&&"disabled"],iconWrapper:["iconWrapper"]};return St(m,oe,e)},se=O(Pt,{name:"MuiTab",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.label&&r.icon&&e.labelIcon,e[`textColor${Lt(r.textColor)}`],r.fullWidth&&e.fullWidth,r.wrapped&&e.wrapped]}})(({theme:t,ownerState:e})=>b({},t.typography.button,{maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center"},e.label&&{flexDirection:e.iconPosition==="top"||e.iconPosition==="bottom"?"column":"row"},{lineHeight:1.25},e.icon&&e.label&&{minHeight:72,paddingTop:9,paddingBottom:9,[`& > .${A.iconWrapper}`]:b({},e.iconPosition==="top"&&{marginBottom:6},e.iconPosition==="bottom"&&{marginTop:6},e.iconPosition==="start"&&{marginRight:t.spacing(1)},e.iconPosition==="end"&&{marginLeft:t.spacing(1)})},e.textColor==="inherit"&&{color:"inherit",opacity:.6,[`&.${A.selected}`]:{opacity:1},[`&.${A.disabled}`]:{opacity:(t.vars||t).palette.action.disabledOpacity}},e.textColor==="primary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.primary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.textColor==="secondary"&&{color:(t.vars||t).palette.text.secondary,[`&.${A.selected}`]:{color:(t.vars||t).palette.secondary.main},[`&.${A.disabled}`]:{color:(t.vars||t).palette.text.disabled}},e.fullWidth&&{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"},e.wrapped&&{fontSize:t.typography.pxToRem(12)})),ae=c.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTab"}),{className:n,disabled:d=!1,disableFocusRipple:h=!1,fullWidth:p,icon:u,iconPosition:m="top",indicator:w,label:T,onChange:y,onClick:x,onFocus:j,selected:I,selectionFollowsFocus:g,textColor:H="inherit",value:B,wrapped:nt=!1}=a,D=rt(a,re),Y=b({},a,{disabled:d,disableFocusRipple:h,selected:I,icon:!!u,iconPosition:m,label:!!T,fullWidth:p,textColor:H,wrapped:nt}),X=ne(Y),N=u&&T&&c.isValidElement(u)?c.cloneElement(u,{className:L(X.iconWrapper,u.props.className)}):u,J=R=>{!I&&y&&y(R,B),x&&x(R)},_=R=>{g&&!I&&y&&y(R,B),j&&j(R)};return S.jsxs(se,b({focusRipple:!h,className:L(X.root,n),ref:r,role:"tab","aria-selected":I,disabled:d,onClick:J,onFocus:_,ownerState:Y,tabIndex:I?0:-1},D,{children:[m==="top"||m==="start"?S.jsxs(c.Fragment,{children:[N,T]}):S.jsxs(c.Fragment,{children:[T,N]}),w]}))}),ke=ae,ie=Ft(S.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"}),"KeyboardArrowLeft"),ce=Ft(S.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}),"KeyboardArrowRight");function de(t){return(1+Math.sin(Math.PI*t-Math.PI/2))/2}function ue(t,e,r,a={},n=()=>{}){const{ease:d=de,duration:h=300}=a;let p=null;const u=e[t];let m=!1;const w=()=>{m=!0},T=y=>{if(m){n(new Error("Animation cancelled"));return}p===null&&(p=y);const x=Math.min(1,(y-p)/h);if(e[t]=d(x)*(r-u)+u,x>=1){requestAnimationFrame(()=>{n(null)});return}requestAnimationFrame(T)};return u===r?(n(new Error("Element already at target position")),w):(requestAnimationFrame(T),w)}const be=["onChange"],fe={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function pe(t){const{onChange:e}=t,r=rt(t,be),a=c.useRef(),n=c.useRef(null),d=()=>{a.current=n.current.offsetHeight-n.current.clientHeight};return Zt(()=>{const h=$t(()=>{const u=a.current;d(),u!==a.current&&e(a.current)}),p=kt(n.current);return p.addEventListener("resize",h),()=>{h.clear(),p.removeEventListener("resize",h)}},[e]),c.useEffect(()=>{d(),e(a.current)},[e]),S.jsx("div",b({style:fe,ref:n},r))}function he(t){return pt("MuiTabScrollButton",t)}const Se=ft("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),ve=Se,me=["className","slots","slotProps","direction","orientation","disabled"],xe=t=>{const{classes:e,orientation:r,disabled:a}=t;return St({root:["root",r,a&&"disabled"]},he,e)},ge=O(Pt,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.root,r.orientation&&e[r.orientation]]}})(({ownerState:t})=>b({width:40,flexShrink:0,opacity:.8,[`&.${ve.disabled}`]:{opacity:0}},t.orientation==="vertical"&&{width:"100%",height:40,"& svg":{transform:`rotate(${t.isRtl?-90:90}deg)`}})),ye=c.forwardRef(function(e,r){var a,n;const d=ht({props:e,name:"MuiTabScrollButton"}),{className:h,slots:p={},slotProps:u={},direction:m}=d,w=rt(d,me),y=Nt().direction==="rtl",x=b({isRtl:y},d),j=xe(x),I=(a=p.StartScrollButtonIcon)!=null?a:ie,g=(n=p.EndScrollButtonIcon)!=null?n:ce,H=lt({elementType:I,externalSlotProps:u.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:x}),B=lt({elementType:g,externalSlotProps:u.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:x});return S.jsx(ge,b({component:"div",className:L(j.root,h),ref:r,role:null,ownerState:x,tabIndex:null},w,{children:m==="left"?S.jsx(I,b({},H)):S.jsx(g,b({},B))}))}),Be=ye;function Ce(t){return pt("MuiTabs",t)}const we=ft("MuiTabs",["root","vertical","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),bt=we,Te=["aria-label","aria-labelledby","action","centered","children","className","component","allowScrollButtonsMobile","indicatorColor","onChange","orientation","ScrollButtonComponent","scrollButtons","selectionFollowsFocus","slots","slotProps","TabIndicatorProps","TabScrollButtonProps","textColor","value","variant","visibleScrollbar"],Rt=(t,e)=>t===e?t.firstChild:e&&e.nextElementSibling?e.nextElementSibling:t.firstChild,zt=(t,e)=>t===e?t.lastChild:e&&e.previousElementSibling?e.previousElementSibling:t.lastChild,ot=(t,e,r)=>{let a=!1,n=r(t,e);for(;n;){if(n===t.firstChild){if(a)return;a=!0}const d=n.disabled||n.getAttribute("aria-disabled")==="true";if(!n.hasAttribute("tabindex")||d)n=r(t,n);else{n.focus();return}}},Ie=t=>{const{vertical:e,fixed:r,hideScrollbar:a,scrollableX:n,scrollableY:d,centered:h,scrollButtonsHideMobile:p,classes:u}=t;return St({root:["root",e&&"vertical"],scroller:["scroller",r&&"fixed",a&&"hideScrollbar",n&&"scrollableX",d&&"scrollableY"],flexContainer:["flexContainer",e&&"flexContainerVertical",h&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",p&&"scrollButtonsHideMobile"],scrollableX:[n&&"scrollableX"],hideScrollbar:[a&&"hideScrollbar"]},Ce,u)},Ee=O("div",{name:"MuiTabs",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[{[`& .${bt.scrollButtons}`]:e.scrollButtons},{[`& .${bt.scrollButtons}`]:r.scrollButtonsHideMobile&&e.scrollButtonsHideMobile},e.root,r.vertical&&e.vertical]}})(({ownerState:t,theme:e})=>b({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex"},t.vertical&&{flexDirection:"column"},t.scrollButtonsHideMobile&&{[`& .${bt.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}})),Me=O("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.scroller,r.fixed&&e.fixed,r.hideScrollbar&&e.hideScrollbar,r.scrollableX&&e.scrollableX,r.scrollableY&&e.scrollableY]}})(({ownerState:t})=>b({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap"},t.fixed&&{overflowX:"hidden",width:"100%"},t.hideScrollbar&&{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}},t.scrollableX&&{overflowX:"auto",overflowY:"hidden"},t.scrollableY&&{overflowY:"auto",overflowX:"hidden"})),Re=O("div",{name:"MuiTabs",slot:"FlexContainer",overridesResolver:(t,e)=>{const{ownerState:r}=t;return[e.flexContainer,r.vertical&&e.flexContainerVertical,r.centered&&e.centered]}})(({ownerState:t})=>b({display:"flex"},t.vertical&&{flexDirection:"column"},t.centered&&{justifyContent:"center"})),ze=O("span",{name:"MuiTabs",slot:"Indicator",overridesResolver:(t,e)=>e.indicator})(({ownerState:t,theme:e})=>b({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create()},t.indicatorColor==="primary"&&{backgroundColor:(e.vars||e).palette.primary.main},t.indicatorColor==="secondary"&&{backgroundColor:(e.vars||e).palette.secondary.main},t.vertical&&{height:"100%",width:2,right:0})),We=O(pe)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),Wt={},Pe=c.forwardRef(function(e,r){const a=ht({props:e,name:"MuiTabs"}),n=Nt(),d=n.direction==="rtl",{"aria-label":h,"aria-labelledby":p,action:u,centered:m=!1,children:w,className:T,component:y="div",allowScrollButtonsMobile:x=!1,indicatorColor:j="primary",onChange:I,orientation:g="horizontal",ScrollButtonComponent:H=Be,scrollButtons:B="auto",selectionFollowsFocus:nt,slots:D={},slotProps:Y={},TabIndicatorProps:X={},TabScrollButtonProps:N={},textColor:J="primary",value:_,variant:R="standard",visibleScrollbar:st=!1}=a,Ot=rt(a,Te),E=R==="scrollable",C=g==="vertical",K=C?"scrollTop":"scrollLeft",Q=C?"top":"left",Z=C?"bottom":"right",at=C?"clientHeight":"clientWidth",V=C?"height":"width",$=b({},a,{component:y,allowScrollButtonsMobile:x,indicatorColor:j,orientation:g,vertical:C,scrollButtons:B,textColor:J,variant:R,visibleScrollbar:st,fixed:!E,hideScrollbar:E&&!st,scrollableX:E&&!C,scrollableY:E&&C,centered:m&&!E,scrollButtonsHideMobile:!x}),W=Ie($),jt=lt({elementType:D.StartScrollButtonIcon,externalSlotProps:Y.startScrollButtonIcon,ownerState:$}),Ht=lt({elementType:D.EndScrollButtonIcon,externalSlotProps:Y.endScrollButtonIcon,ownerState:$}),[vt,Dt]=c.useState(!1),[k,mt]=c.useState(Wt),[xt,Xt]=c.useState(!1),[gt,_t]=c.useState(!1),[yt,Ut]=c.useState(!1),[Bt,Yt]=c.useState({overflow:"hidden",scrollbarWidth:0}),Ct=new Map,z=c.useRef(null),F=c.useRef(null),wt=()=>{const o=z.current;let l;if(o){const s=o.getBoundingClientRect();l={clientWidth:o.clientWidth,scrollLeft:o.scrollLeft,scrollTop:o.scrollTop,scrollLeftNormalized:ee(o,n.direction),scrollWidth:o.scrollWidth,top:s.top,bottom:s.bottom,left:s.left,right:s.right}}let i;if(o&&_!==!1){const s=F.current.children;if(s.length>0){const f=s[Ct.get(_)];i=f?f.getBoundingClientRect():null}}return{tabsMeta:l,tabMeta:i}},q=ut(()=>{const{tabsMeta:o,tabMeta:l}=wt();let i=0,s;if(C)s="top",l&&o&&(i=l.top-o.top+o.scrollTop);else if(s=d?"right":"left",l&&o){const v=d?o.scrollLeftNormalized+o.clientWidth-o.scrollWidth:o.scrollLeft;i=(d?-1:1)*(l[s]-o[s]+v)}const f={[s]:i,[V]:l?l[V]:0};if(isNaN(k[s])||isNaN(k[V]))mt(f);else{const v=Math.abs(k[s]-f[s]),M=Math.abs(k[V]-f[V]);(v>=1||M>=1)&&mt(f)}}),it=(o,{animation:l=!0}={})=>{l?ue(K,z.current,o,{duration:n.transitions.duration.standard}):z.current[K]=o},Tt=o=>{let l=z.current[K];C?l+=o:(l+=o*(d?-1:1),l*=d&&At()==="reverse"?-1:1),it(l)},It=()=>{const o=z.current[at];let l=0;const i=Array.from(F.current.children);for(let s=0;so){s===0&&(l=o);break}l+=f[at]}return l},Kt=()=>{Tt(-1*It())},Vt=()=>{Tt(It())},qt=c.useCallback(o=>{Yt({overflow:null,scrollbarWidth:o})},[]),Gt=()=>{const o={};o.scrollbarSizeListener=E?S.jsx(We,{onChange:qt,className:L(W.scrollableX,W.hideScrollbar)}):null;const i=E&&(B==="auto"&&(xt||gt)||B===!0);return o.scrollButtonStart=i?S.jsx(H,b({slots:{StartScrollButtonIcon:D.StartScrollButtonIcon},slotProps:{startScrollButtonIcon:jt},orientation:g,direction:d?"right":"left",onClick:Kt,disabled:!xt},N,{className:L(W.scrollButtons,N.className)})):null,o.scrollButtonEnd=i?S.jsx(H,b({slots:{EndScrollButtonIcon:D.EndScrollButtonIcon},slotProps:{endScrollButtonIcon:Ht},orientation:g,direction:d?"left":"right",onClick:Vt,disabled:!gt},N,{className:L(W.scrollButtons,N.className)})):null,o},Et=ut(o=>{const{tabsMeta:l,tabMeta:i}=wt();if(!(!i||!l)){if(i[Q]l[Z]){const s=l[K]+(i[Z]-l[Z]);it(s,{animation:o})}}}),tt=ut(()=>{E&&B!==!1&&Ut(!yt)});c.useEffect(()=>{const o=$t(()=>{z.current&&q()});let l;const i=v=>{v.forEach(M=>{M.removedNodes.forEach(G=>{var P;(P=l)==null||P.unobserve(G)}),M.addedNodes.forEach(G=>{var P;(P=l)==null||P.observe(G)})}),o(),tt()},s=kt(z.current);s.addEventListener("resize",o);let f;return typeof ResizeObserver<"u"&&(l=new ResizeObserver(o),Array.from(F.current.children).forEach(v=>{l.observe(v)})),typeof MutationObserver<"u"&&(f=new MutationObserver(i),f.observe(F.current,{childList:!0})),()=>{var v,M;o.clear(),s.removeEventListener("resize",o),(v=f)==null||v.disconnect(),(M=l)==null||M.disconnect()}},[q,tt]),c.useEffect(()=>{const o=Array.from(F.current.children),l=o.length;if(typeof IntersectionObserver<"u"&&l>0&&E&&B!==!1){const i=o[0],s=o[l-1],f={root:z.current,threshold:.99},v=dt=>{Xt(!dt[0].isIntersecting)},M=new IntersectionObserver(v,f);M.observe(i);const G=dt=>{_t(!dt[0].isIntersecting)},P=new IntersectionObserver(G,f);return P.observe(s),()=>{M.disconnect(),P.disconnect()}}},[E,B,yt,w==null?void 0:w.length]),c.useEffect(()=>{Dt(!0)},[]),c.useEffect(()=>{q()}),c.useEffect(()=>{Et(Wt!==k)},[Et,k]),c.useImperativeHandle(u,()=>({updateIndicator:q,updateScrollButtons:tt}),[q,tt]);const Mt=S.jsx(ze,b({},X,{className:L(W.indicator,X.className),ownerState:$,style:b({},k,X.style)}));let et=0;const Jt=c.Children.map(w,o=>{if(!c.isValidElement(o))return null;const l=o.props.value===void 0?et:o.props.value;Ct.set(l,et);const i=l===_;return et+=1,c.cloneElement(o,b({fullWidth:R==="fullWidth",indicator:i&&!vt&&Mt,selected:i,selectionFollowsFocus:nt,onChange:I,textColor:J,value:l},et===1&&_===!1&&!o.props.tabIndex?{tabIndex:0}:{}))}),Qt=o=>{const l=F.current,i=te(l).activeElement;if(i.getAttribute("role")!=="tab")return;let f=g==="horizontal"?"ArrowLeft":"ArrowUp",v=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&d&&(f="ArrowRight",v="ArrowLeft"),o.key){case f:o.preventDefault(),ot(l,i,zt);break;case v:o.preventDefault(),ot(l,i,Rt);break;case"Home":o.preventDefault(),ot(l,null,Rt);break;case"End":o.preventDefault(),ot(l,null,zt);break}},ct=Gt();return S.jsxs(Ee,b({className:L(W.root,T),ownerState:$,ref:r,as:y},Ot,{children:[ct.scrollButtonStart,ct.scrollbarSizeListener,S.jsxs(Me,{className:W.scroller,ownerState:$,style:{overflow:Bt.overflow,[C?`margin${d?"Left":"Right"}`:"marginBottom"]:st?void 0:-Bt.scrollbarWidth},ref:z,children:[S.jsx(Re,{"aria-label":h,"aria-labelledby":p,"aria-orientation":g==="vertical"?"vertical":null,className:W.flexContainer,ownerState:$,onKeyDown:Qt,ref:F,role:"tablist",children:Jt}),vt&&Mt]}),ct.scrollButtonEnd]}))}),Fe=Pe;export{Fe as T,ke as a}; diff --git a/build/assets/TextareaAutosize-cc9b3a66.js b/build/assets/TextareaAutosize-cc9b3a66.js new file mode 100644 index 000000000..7f6501f91 --- /dev/null +++ b/build/assets/TextareaAutosize-cc9b3a66.js @@ -0,0 +1,2 @@ +import{r as o,a as _,l as I,m as T,j as v,e as b,o as D}from"./index-4c5f8236.js";import{y as F,B as P}from"./index-a4caf8d5.js";const U=["onChange","maxRows","minRows","style","value"];function w(r){return parseInt(r,10)||0}const V={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function M(r){return r==null||Object.keys(r).length===0||r.outerHeightStyle===0&&!r.overflow}const G=o.forwardRef(function(l,O){const{onChange:R,maxRows:y,minRows:h=1,style:S,value:x}=l,k=_(l,U),{current:A}=o.useRef(x!=null),p=o.useRef(null),B=I(O,p),H=o.useRef(null),c=o.useRef(0),[z,E]=o.useState({outerHeightStyle:0}),f=o.useCallback(()=>{const e=p.current,n=F(e).getComputedStyle(e);if(n.width==="0px")return{outerHeightStyle:0};const t=H.current;t.style.width=n.width,t.value=e.value||l.placeholder||"x",t.value.slice(-1)===` +`&&(t.value+=" ");const g=n.boxSizing,m=w(n.paddingBottom)+w(n.paddingTop),a=w(n.borderBottomWidth)+w(n.borderTopWidth),u=t.scrollHeight;t.value="x";const d=t.scrollHeight;let s=u;h&&(s=Math.max(Number(h)*d,s)),y&&(s=Math.min(Number(y)*d,s)),s=Math.max(s,d);const j=s+(g==="border-box"?m+a:0),L=Math.abs(s-u)<=1;return{outerHeightStyle:j,overflow:L}},[y,h,l.placeholder]),C=(e,i)=>{const{outerHeightStyle:n,overflow:t}=i;return c.current<20&&(n>0&&Math.abs((e.outerHeightStyle||0)-n)>1||e.overflow!==t)?(c.current+=1,{overflow:t,outerHeightStyle:n}):e},W=o.useCallback(()=>{const e=f();M(e)||E(i=>C(i,e))},[f]);T(()=>{const e=()=>{const u=f();M(u)||D.flushSync(()=>{E(d=>C(d,u))})},i=()=>{c.current=0,e()};let n;const t=P(i),g=p.current,m=F(g);m.addEventListener("resize",t);let a;return typeof ResizeObserver<"u"&&(a=new ResizeObserver(i),a.observe(g)),()=>{t.clear(),cancelAnimationFrame(n),m.removeEventListener("resize",t),a&&a.disconnect()}},[f]),T(()=>{W()}),o.useEffect(()=>{c.current=0},[x]);const N=e=>{c.current=0,A||W(),R&&R(e)};return v.jsxs(o.Fragment,{children:[v.jsx("textarea",b({value:x,onChange:N,ref:B,rows:h,style:b({height:z.outerHeightStyle,overflow:z.overflow?"hidden":void 0},S)},k)),v.jsx("textarea",{"aria-hidden":!0,className:l.className,readOnly:!0,ref:H,tabIndex:-1,style:b({},V.shadow,S,{paddingTop:0,paddingBottom:0})})]})});export{G as T}; diff --git a/build/assets/TextareaAutosize-e1814669.js b/build/assets/TextareaAutosize-e1814669.js deleted file mode 100644 index b92d65b89..000000000 --- a/build/assets/TextareaAutosize-e1814669.js +++ /dev/null @@ -1,2 +0,0 @@ -import{r as o,a as _,l as I,m as T,j as v,e as b,o as D}from"./index-16ff4e55.js";import{B as F,J}from"./index-04a82be1.js";const P=["onChange","maxRows","minRows","style","value"];function w(r){return parseInt(r,10)||0}const U={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function M(r){return r==null||Object.keys(r).length===0||r.outerHeightStyle===0&&!r.overflow}const q=o.forwardRef(function(l,O){const{onChange:R,maxRows:x,minRows:h=1,style:S,value:y}=l,k=_(l,P),{current:A}=o.useRef(y!=null),p=o.useRef(null),B=I(O,p),H=o.useRef(null),c=o.useRef(0),[z,E]=o.useState({outerHeightStyle:0}),f=o.useCallback(()=>{const e=p.current,n=F(e).getComputedStyle(e);if(n.width==="0px")return{outerHeightStyle:0};const t=H.current;t.style.width=n.width,t.value=e.value||l.placeholder||"x",t.value.slice(-1)===` -`&&(t.value+=" ");const g=n.boxSizing,m=w(n.paddingBottom)+w(n.paddingTop),a=w(n.borderBottomWidth)+w(n.borderTopWidth),u=t.scrollHeight;t.value="x";const d=t.scrollHeight;let s=u;h&&(s=Math.max(Number(h)*d,s)),x&&(s=Math.min(Number(x)*d,s)),s=Math.max(s,d);const j=s+(g==="border-box"?m+a:0),L=Math.abs(s-u)<=1;return{outerHeightStyle:j,overflow:L}},[x,h,l.placeholder]),C=(e,i)=>{const{outerHeightStyle:n,overflow:t}=i;return c.current<20&&(n>0&&Math.abs((e.outerHeightStyle||0)-n)>1||e.overflow!==t)?(c.current+=1,{overflow:t,outerHeightStyle:n}):e},W=o.useCallback(()=>{const e=f();M(e)||E(i=>C(i,e))},[f]);T(()=>{const e=()=>{const u=f();M(u)||D.flushSync(()=>{E(d=>C(d,u))})},i=()=>{c.current=0,e()};let n;const t=J(i),g=p.current,m=F(g);m.addEventListener("resize",t);let a;return typeof ResizeObserver<"u"&&(a=new ResizeObserver(i),a.observe(g)),()=>{t.clear(),cancelAnimationFrame(n),m.removeEventListener("resize",t),a&&a.disconnect()}},[f]),T(()=>{W()}),o.useEffect(()=>{c.current=0},[y]);const N=e=>{c.current=0,A||W(),R&&R(e)};return v.jsxs(o.Fragment,{children:[v.jsx("textarea",b({value:y,onChange:N,ref:B,rows:h,style:b({height:z.outerHeightStyle,overflow:z.overflow?"hidden":void 0},S)},k)),v.jsx("textarea",{"aria-hidden":!0,className:l.className,readOnly:!0,ref:H,tabIndex:-1,style:b({},U.shadow,S,{paddingTop:0,paddingBottom:0})})]})});export{q as T}; diff --git a/build/assets/Twitch-3a6bc6a0.js b/build/assets/Twitch-6b950ada.js similarity index 95% rename from build/assets/Twitch-3a6bc6a0.js rename to build/assets/Twitch-6b950ada.js index 415c57f0f..0743967d2 100644 --- a/build/assets/Twitch-3a6bc6a0.js +++ b/build/assets/Twitch-6b950ada.js @@ -1 +1 @@ -import{g as w,r as D}from"./index-16ff4e55.js";import{u as C,p as N}from"./index-e4c394ce.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:g,PLAYING:m,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=y.Player;this.player.addEventListener(g,this.props.onReady),this.player.addEventListener(m,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{g as w,r as D}from"./index-4c5f8236.js";import{u as C,p as N}from"./index-ad04f3f7.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:g,PLAYING:m,PAUSE:E,ENDED:O,ONLINE:L,OFFLINE:b,SEEK:T}=y.Player;this.player.addEventListener(g,this.props.onReady),this.player.addEventListener(m,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/Typography-76a3ec92.js b/build/assets/Typography-50924238.js similarity index 93% rename from build/assets/Typography-76a3ec92.js rename to build/assets/Typography-50924238.js index 4494d81a7..cf950b65a 100644 --- a/build/assets/Typography-76a3ec92.js +++ b/build/assets/Typography-50924238.js @@ -1 +1 @@ -import{c as b,d as B,s as W,k as u,e as s,r as C,u as M,a as R,j as P,h as j,i as U}from"./index-16ff4e55.js";import{e as N}from"./Stack-25a86e54.js";function _(a){return b("MuiTypography",a)}B("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const $=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],E=a=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:e,variant:o,classes:p}=a,i={root:["root",o,a.align!=="inherit"&&`align${u(t)}`,r&&"gutterBottom",n&&"noWrap",e&&"paragraph"]};return U(i,_,p)},L=W("span",{name:"MuiTypography",slot:"Root",overridesResolver:(a,t)=>{const{ownerState:r}=a;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${u(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:a,ownerState:t})=>s({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&a.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})),y={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},k={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},z=a=>k[a]||a,A=C.forwardRef(function(t,r){const n=M({props:t,name:"MuiTypography"}),e=z(n.color),o=N(s({},n,{color:e})),{align:p="inherit",className:i,component:g,gutterBottom:d=!1,noWrap:f=!1,paragraph:l=!1,variant:h="body1",variantMapping:c=y}=o,x=R(o,$),m=s({},o,{align:p,color:e,className:i,component:g,gutterBottom:d,noWrap:f,paragraph:l,variant:h,variantMapping:c}),v=g||(l?"p":c[h]||y[h])||"span",T=E(m);return P.jsx(L,s({as:v,ref:r,ownerState:m,className:j(T.root,i)},x))}),O=A;export{O as T}; +import{c as b,d as B,s as W,k as u,e as s,r as C,u as M,a as R,j as P,h as j,i as U}from"./index-4c5f8236.js";import{e as N}from"./Stack-7f131eb3.js";function _(a){return b("MuiTypography",a)}B("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const $=["align","className","component","gutterBottom","noWrap","paragraph","variant","variantMapping"],E=a=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:e,variant:o,classes:p}=a,i={root:["root",o,a.align!=="inherit"&&`align${u(t)}`,r&&"gutterBottom",n&&"noWrap",e&&"paragraph"]};return U(i,_,p)},L=W("span",{name:"MuiTypography",slot:"Root",overridesResolver:(a,t)=>{const{ownerState:r}=a;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${u(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(({theme:a,ownerState:t})=>s({margin:0},t.variant==="inherit"&&{font:"inherit"},t.variant!=="inherit"&&a.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})),y={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},k={primary:"primary.main",textPrimary:"text.primary",secondary:"secondary.main",textSecondary:"text.secondary",error:"error.main"},z=a=>k[a]||a,A=C.forwardRef(function(t,r){const n=M({props:t,name:"MuiTypography"}),e=z(n.color),o=N(s({},n,{color:e})),{align:p="inherit",className:i,component:g,gutterBottom:d=!1,noWrap:f=!1,paragraph:l=!1,variant:h="body1",variantMapping:c=y}=o,x=R(o,$),m=s({},o,{align:p,color:e,className:i,component:g,gutterBottom:d,noWrap:f,paragraph:l,variant:h,variantMapping:c}),v=g||(l?"p":c[h]||y[h])||"span",T=E(m);return P.jsx(L,s({as:v,ref:r,ownerState:m,className:j(T.root,i)},x))}),O=A;export{O as T}; diff --git a/build/assets/Vidyard-54f32f3a.js b/build/assets/Vidyard-e1e3a592.js similarity index 95% rename from build/assets/Vidyard-54f32f3a.js rename to build/assets/Vidyard-e1e3a592.js index 9604d85e7..3755ca7b2 100644 --- a/build/assets/Vidyard-54f32f3a.js +++ b/build/assets/Vidyard-e1e3a592.js @@ -1 +1 @@ -import{g,r as v}from"./index-16ff4e55.js";import{u as b,p as O}from"./index-e4c394ce.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,M=Object.prototype.hasOwnProperty,A=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E=(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))!M.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(o=j(e,a))||o.enumerable});return t},L=(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)=>(A(t,typeof e!="symbol"?e+"":e,r),r),_={};E(_,{default:()=>y});var f=R(_),c=L(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{g,r as v}from"./index-4c5f8236.js";import{u as b,p as O}from"./index-ad04f3f7.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,M=Object.prototype.hasOwnProperty,A=(t,e,r)=>e in t?i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,E=(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))!M.call(t,a)&&a!==r&&i(t,a,{get:()=>e[a],enumerable:!(o=j(e,a))||o.enumerable});return t},L=(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)=>(A(t,typeof e!="symbol"?e+"":e,r),r),_={};E(_,{default:()=>y});var f=R(_),c=L(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-3f7678c7.js b/build/assets/Vimeo-8c7df33b.js similarity index 96% rename from build/assets/Vimeo-3f7678c7.js rename to build/assets/Vimeo-8c7df33b.js index e4ae51733..11f285808 100644 --- a/build/assets/Vimeo-3f7678c7.js +++ b/build/assets/Vimeo-8c7df33b.js @@ -1 +1 @@ -import{g as d,r as f}from"./index-16ff4e55.js";import{u as m,p as _}from"./index-e4c394ce.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},M=(t,e,r)=>(r=t!=null?g(O(t)):{},h(e||!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),E=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=E(c),p=M(f),u=m,L=_;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",L.canPlay.vimeo);i(l,"forceLoad",!0);const T=d(y),R=P({__proto__:null,default:T},[y]);export{R as V}; +import{g as d,r as f}from"./index-4c5f8236.js";import{u as m,p as _}from"./index-ad04f3f7.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},M=(t,e,r)=>(r=t!=null?g(O(t)):{},h(e||!t||!t.__esModule?n(r,"default",{value:t,enumerable:!0}):r,t)),E=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=E(c),p=M(f),u=m,L=_;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",L.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-f3f448ac.js b/build/assets/Wistia-611ee7bc.js similarity index 96% rename from build/assets/Wistia-f3f448ac.js rename to build/assets/Wistia-611ee7bc.js index 49b82b077..d57e03735 100644 --- a/build/assets/Wistia-f3f448ac.js +++ b/build/assets/Wistia-611ee7bc.js @@ -1 +1 @@ -import{g as m,r as g}from"./index-16ff4e55.js";import{u as v,p as w}from"./index-e4c394ce.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 M="https://fast.wistia.com/assets/external/E-v1.js",x="Wistia",A="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${A}${(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)(M,x).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 L=m(_),$=O({__proto__:null,default:L},[_]);export{$ as W}; +import{g as m,r as g}from"./index-4c5f8236.js";import{u as v,p as w}from"./index-ad04f3f7.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 M="https://fast.wistia.com/assets/external/E-v1.js",x="Wistia",A="wistia-player-";class l extends y.Component{constructor(){super(...arguments),n(this,"callPlayer",c.callPlayer),n(this,"playerID",this.props.config.playerId||`${A}${(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)(M,x).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 L=m(_),$=O({__proto__:null,default:L},[_]);export{$ as W}; diff --git a/build/assets/YouTube-410d4df7.js b/build/assets/YouTube-b0617aa9.js similarity index 97% rename from build/assets/YouTube-410d4df7.js rename to build/assets/YouTube-b0617aa9.js index 561fee690..41c855851 100644 --- a/build/assets/YouTube-410d4df7.js +++ b/build/assets/YouTube-b0617aa9.js @@ -1 +1 @@ -import{g as U,r as I}from"./index-16ff4e55.js";import{u as L,p as Y}from"./index-e4c394ce.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(I),p=L,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 R=!!this.callPlayer("getPlaylist");y&&!R&&(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 $=U(S),W=k({__proto__:null,default:$},[S]);export{W as Y}; +import{g as U,r as I}from"./index-4c5f8236.js";import{u as L,p as Y}from"./index-ad04f3f7.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(I),p=L,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 R=!!this.callPlayer("getPlaylist");y&&!R&&(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 $=U(S),W=k({__proto__:null,default:$},[S]);export{W as Y}; diff --git a/build/assets/constants-d7d823df.js b/build/assets/constants-ccce11dd.js similarity index 55% rename from build/assets/constants-d7d823df.js rename to build/assets/constants-ccce11dd.js index 4dcbb518a..1f12a8c28 100644 --- a/build/assets/constants-d7d823df.js +++ b/build/assets/constants-ccce11dd.js @@ -1,8 +1,8 @@ -import{w as t,a_ as s,aY as a,aZ as o,a$ as n}from"./index-16ff4e55.js";import{an as c}from"./index-04a82be1.js";const i={[s]:"RSS link",[a]:"Twitter Handle",[o]:"Youtube channel",[n]:"Github Repository"},r="Sources Table",E="Queued Sources",I="Topics",S="View Content",u="date",p="edge_count",_="alphabetically",l="https://twitter.com",A="IS_ALIAS",d="https://www.twitter.com/anyuser/status/",L=t(c)` +import{w as t,a_ as s,aY as a,aZ as o,a$ as n}from"./index-4c5f8236.js";import{al as c}from"./index-a4caf8d5.js";const i={[s]:"RSS link",[a]:"Twitter Handle",[o]:"Youtube channel",[n]:"Github Repository"},r="Sources Table",E="Queued Sources",I="Topics",S="View Content",u="date",l="edge_count",p="alphabetically",_="https://twitter.com",A="IS_ALIAS",d="https://www.twitter.com/anyuser/status/",L=t(c)` && { vertical-align: middle; margin: 5px 0 0 4px; padding: 4px; transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1); } -`;export{_ as A,u as D,p as E,A as I,E as Q,L as S,d as T,S as V,l as a,I as b,r as c,i as s}; +`;export{p as A,u as D,l as E,A as I,E as Q,L as S,d as T,S as V,_ as a,I as b,r as c,i as s}; diff --git a/build/assets/createSvgIcon-e167cb2e.js b/build/assets/createSvgIcon-2fe026f6.js similarity index 97% rename from build/assets/createSvgIcon-e167cb2e.js rename to build/assets/createSvgIcon-2fe026f6.js index a6c5e9101..9de6b5fdf 100644 --- a/build/assets/createSvgIcon-e167cb2e.js +++ b/build/assets/createSvgIcon-2fe026f6.js @@ -1 +1 @@ -import{c as I,d as C,s as w,k as f,r as v,u as R,a as b,e as g,j as S,h as j,i as N}from"./index-16ff4e55.js";function A(o){return I("MuiSvgIcon",o)}C("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const B=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],M=o=>{const{color:e,fontSize:t,classes:i}=o,n={root:["root",e!=="inherit"&&`color${f(e)}`,`fontSize${f(t)}`]};return N(n,A,i)},T=w("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,t.color!=="inherit"&&e[`color${f(t.color)}`],e[`fontSize${f(t.fontSize)}`]]}})(({theme:o,ownerState:e})=>{var t,i,n,u,m,a,h,p,d,r,s,c,l;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(t=o.transitions)==null||(i=t.create)==null?void 0:i.call(t,"fill",{duration:(n=o.transitions)==null||(n=n.duration)==null?void 0:n.shorter}),fontSize:{inherit:"inherit",small:((u=o.typography)==null||(m=u.pxToRem)==null?void 0:m.call(u,20))||"1.25rem",medium:((a=o.typography)==null||(h=a.pxToRem)==null?void 0:h.call(a,24))||"1.5rem",large:((p=o.typography)==null||(d=p.pxToRem)==null?void 0:d.call(p,35))||"2.1875rem"}[e.fontSize],color:(r=(s=(o.vars||o).palette)==null||(s=s[e.color])==null?void 0:s.main)!=null?r:{action:(c=(o.vars||o).palette)==null||(c=c.action)==null?void 0:c.active,disabled:(l=(o.vars||o).palette)==null||(l=l.action)==null?void 0:l.disabled,inherit:void 0}[e.color]}}),_=v.forwardRef(function(e,t){const i=R({props:e,name:"MuiSvgIcon"}),{children:n,className:u,color:m="inherit",component:a="svg",fontSize:h="medium",htmlColor:p,inheritViewBox:d=!1,titleAccess:r,viewBox:s="0 0 24 24"}=i,c=b(i,B),l=v.isValidElement(n)&&n.type==="svg",y=g({},i,{color:m,component:a,fontSize:h,instanceFontSize:e.fontSize,inheritViewBox:d,viewBox:s,hasSvgAsChild:l}),x={};d||(x.viewBox=s);const z=M(y);return S.jsxs(T,g({as:a,className:j(z.root,u),focusable:"false",color:p,"aria-hidden":r?void 0:!0,role:r?"img":void 0,ref:t},x,c,l&&n.props,{ownerState:y,children:[l?n.props.children:n,r?S.jsx("title",{children:r}):null]}))});_.muiName="SvgIcon";const $=_;function U(o,e){function t(i,n){return S.jsx($,g({"data-testid":`${e}Icon`,ref:n},i,{children:o}))}return t.muiName=$.muiName,v.memo(v.forwardRef(t))}export{U as c}; +import{c as I,d as C,s as w,k as f,r as v,u as R,a as b,e as g,j as S,h as j,i as N}from"./index-4c5f8236.js";function A(o){return I("MuiSvgIcon",o)}C("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const B=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"],M=o=>{const{color:e,fontSize:t,classes:i}=o,n={root:["root",e!=="inherit"&&`color${f(e)}`,`fontSize${f(t)}`]};return N(n,A,i)},T=w("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(o,e)=>{const{ownerState:t}=o;return[e.root,t.color!=="inherit"&&e[`color${f(t.color)}`],e[`fontSize${f(t.fontSize)}`]]}})(({theme:o,ownerState:e})=>{var t,i,n,u,m,a,h,p,d,r,s,c,l;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",fill:e.hasSvgAsChild?void 0:"currentColor",flexShrink:0,transition:(t=o.transitions)==null||(i=t.create)==null?void 0:i.call(t,"fill",{duration:(n=o.transitions)==null||(n=n.duration)==null?void 0:n.shorter}),fontSize:{inherit:"inherit",small:((u=o.typography)==null||(m=u.pxToRem)==null?void 0:m.call(u,20))||"1.25rem",medium:((a=o.typography)==null||(h=a.pxToRem)==null?void 0:h.call(a,24))||"1.5rem",large:((p=o.typography)==null||(d=p.pxToRem)==null?void 0:d.call(p,35))||"2.1875rem"}[e.fontSize],color:(r=(s=(o.vars||o).palette)==null||(s=s[e.color])==null?void 0:s.main)!=null?r:{action:(c=(o.vars||o).palette)==null||(c=c.action)==null?void 0:c.active,disabled:(l=(o.vars||o).palette)==null||(l=l.action)==null?void 0:l.disabled,inherit:void 0}[e.color]}}),_=v.forwardRef(function(e,t){const i=R({props:e,name:"MuiSvgIcon"}),{children:n,className:u,color:m="inherit",component:a="svg",fontSize:h="medium",htmlColor:p,inheritViewBox:d=!1,titleAccess:r,viewBox:s="0 0 24 24"}=i,c=b(i,B),l=v.isValidElement(n)&&n.type==="svg",y=g({},i,{color:m,component:a,fontSize:h,instanceFontSize:e.fontSize,inheritViewBox:d,viewBox:s,hasSvgAsChild:l}),x={};d||(x.viewBox=s);const z=M(y);return S.jsxs(T,g({as:a,className:j(z.root,u),focusable:"false",color:p,"aria-hidden":r?void 0:!0,role:r?"img":void 0,ref:t},x,c,l&&n.props,{ownerState:y,children:[l?n.props.children:n,r?S.jsx("title",{children:r}):null]}))});_.muiName="SvgIcon";const $=_;function U(o,e){function t(i,n){return S.jsx($,g({"data-testid":`${e}Icon`,ref:n},i,{children:o}))}return t.muiName=$.muiName,v.memo(v.forwardRef(t))}export{U as c}; diff --git a/build/assets/index-6b3671e3.js b/build/assets/index-0d9e6a7d.js similarity index 99% rename from build/assets/index-6b3671e3.js rename to build/assets/index-0d9e6a7d.js index 3da4ea709..fa9c7dcfc 100644 --- a/build/assets/index-6b3671e3.js +++ b/build/assets/index-0d9e6a7d.js @@ -1,4 +1,4 @@ -import{ap as He,g as Tr,j as V,w as zn,x as Bn,r as Un,M as vt,D as zr,E as Lr,v as Or,y as Dr,F as fe,H as Ft,z as vr,t as Fr,aX as Rr}from"./index-16ff4e55.js";import{ag as Br,a_ as Mr,aA as Nr}from"./index-04a82be1.js";function _r(n,e){const t=e||{};return(n[n.length-1]===""?[...n,""]:n).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const jr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ur={};function Ue(n,e){return((e||Ur).jsx?Hr:jr).test(n)}const Vr=/[ \t\n\f\r]/g;function qr(n){return typeof n=="object"?n.type==="text"?Ve(n.value):!1:Ve(n)}function Ve(n){return n.replace(Vr,"")===""}class jn{constructor(e,t,r){this.property=e,this.normal=t,r&&(this.space=r)}}jn.prototype.property={};jn.prototype.normal={};jn.prototype.space=null;function Rt(n,e){const t={},r={};let i=-1;for(;++i4&&t.slice(0,4)==="data"&&Yr.test(e)){if(e.charAt(4)==="-"){const l=e.slice(5).replace($e,Zr);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=e.slice(4);if(!$e.test(l)){let o=l.replace(Kr,Jr);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=Se}return new i(r,e)}function Jr(n){return"-"+n.toLowerCase()}function Zr(n){return n.charAt(1).toUpperCase()}const ni={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"},ei=Rt([Nt,Mt,Ht,Ut,Qr],"html"),Ce=Rt([Nt,Mt,Ht,Ut,Xr],"svg");function ti(n){return n.join(" ").trim()}var Vt={},We=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ri=/\n/g,ii=/^\s*/,li=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,oi=/^:\s*/,ai=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ui=/^[;\s]*/,si=/^\s+|\s+$/g,ci=` +import{ap as He,g as Tr,j as V,w as zn,x as Bn,r as Un,M as vt,D as zr,E as Lr,v as Or,y as Dr,F as fe,H as Ft,z as vr,t as Fr,aX as Rr}from"./index-4c5f8236.js";import{ae as Br,a_ as Mr,ay as Nr}from"./index-a4caf8d5.js";function _r(n,e){const t=e||{};return(n[n.length-1]===""?[...n,""]:n).join((t.padRight?" ":"")+","+(t.padLeft===!1?"":" ")).trim()}const jr=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hr=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ur={};function Ue(n,e){return((e||Ur).jsx?Hr:jr).test(n)}const Vr=/[ \t\n\f\r]/g;function qr(n){return typeof n=="object"?n.type==="text"?Ve(n.value):!1:Ve(n)}function Ve(n){return n.replace(Vr,"")===""}class jn{constructor(e,t,r){this.property=e,this.normal=t,r&&(this.space=r)}}jn.prototype.property={};jn.prototype.normal={};jn.prototype.space=null;function Rt(n,e){const t={},r={};let i=-1;for(;++i4&&t.slice(0,4)==="data"&&Yr.test(e)){if(e.charAt(4)==="-"){const l=e.slice(5).replace($e,Zr);r="data"+l.charAt(0).toUpperCase()+l.slice(1)}else{const l=e.slice(4);if(!$e.test(l)){let o=l.replace(Kr,Jr);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}i=Se}return new i(r,e)}function Jr(n){return"-"+n.toLowerCase()}function Zr(n){return n.charAt(1).toUpperCase()}const ni={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"},ei=Rt([Nt,Mt,Ht,Ut,Qr],"html"),Ce=Rt([Nt,Mt,Ht,Ut,Xr],"svg");function ti(n){return n.join(" ").trim()}var Vt={},We=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ri=/\n/g,ii=/^\s*/,li=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,oi=/^:\s*/,ai=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,ui=/^[;\s]*/,si=/^\s+|\s+$/g,ci=` `,Qe="/",Xe="*",Sn="",pi="comment",fi="declaration",hi=function(n,e){if(typeof n!="string")throw new TypeError("First argument must be a string");if(!n)return[];e=e||{};var t=1,r=1;function i(y){var k=y.match(ri);k&&(t+=k.length);var I=y.lastIndexOf(ci);r=~I?y.length-I:r+y.length}function l(){var y={line:t,column:r};return function(k){return k.position=new o(y),s(),k}}function o(y){this.start=y,this.end={line:t,column:r},this.source=e.source}o.prototype.content=n;function a(y){var k=new Error(e.source+":"+t+":"+r+": "+y);if(k.reason=y,k.filename=e.source,k.line=t,k.column=r,k.source=n,!e.silent)throw k}function u(y){var k=y.exec(n);if(k){var I=k[0];return i(I),n=n.slice(I.length),k}}function s(){u(ii)}function c(y){var k;for(y=y||[];k=f();)k!==!1&&y.push(k);return y}function f(){var y=l();if(!(Qe!=n.charAt(0)||Xe!=n.charAt(1))){for(var k=2;Sn!=n.charAt(k)&&(Xe!=n.charAt(k)||Qe!=n.charAt(k+1));)++k;if(k+=2,Sn===n.charAt(k-1))return a("End of comment missing");var I=n.slice(2,k-2);return r+=2,i(I),n=n.slice(k),r+=2,y({type:pi,comment:I})}}function d(){var y=l(),k=u(li);if(k){if(f(),!u(oi))return a("property missing ':'");var I=u(ai),w=y({type:fi,property:Ye(k[0].replace(We,Sn)),value:I?Ye(I[0].replace(We,Sn)):Sn});return u(ui),w}}function p(){var y=[];c(y);for(var k;k=d();)k!==!1&&(y.push(k),c(y));return y}return s(),p()};function Ye(n){return n?n.replace(si,Sn):Sn}var mi=He&&He.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Vt,"__esModule",{value:!0});var di=mi(hi);function gi(n,e){var t=null;if(!n||typeof n!="string")return t;var r=(0,di.default)(n),i=typeof e=="function";return r.forEach(function(l){if(l.type==="declaration"){var o=l.property,a=l.value;i?e(o,a,l):a&&(t=t||{},t[o]=a)}}),t}var Ke=Vt.default=gi;const yi=Ke.default||Ke,qt=$t("end"),Ee=$t("start");function $t(n){return e;function e(t){const r=t&&t.position&&t.position[n]||{};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 xi(n){const e=Ee(n),t=qt(n);if(e&&t)return{start:e,end:t}}function Mn(n){return!n||typeof n!="object"?"":"position"in n||"type"in n?Ge(n.position):"start"in n||"end"in n?Ge(n):"line"in n||"column"in n?de(n):""}function de(n){return Je(n&&n.line)+":"+Je(n&&n.column)}function Ge(n){return de(n&&n.start)+"-"+de(n&&n.end)}function Je(n){return n&&typeof n=="number"?n:1}class K extends Error{constructor(e,t,r){super(),typeof t=="string"&&(r=t,t=void 0);let i="",l={},o=!1;if(t&&("line"in t&&"column"in t?l={place:t}:"start"in t&&"end"in t?l={place:t}:"type"in t?l={ancestors:[t],place:t.position}:l={...t}),typeof e=="string"?i=e:!l.cause&&e&&(o=!0,i=e.message,l.cause=e),!l.ruleId&&!l.source&&typeof r=="string"){const u=r.indexOf(":");u===-1?l.ruleId=r:(l.source=r.slice(0,u),l.ruleId=r.slice(u+1))}if(!l.place&&l.ancestors&&l.ancestors){const u=l.ancestors[l.ancestors.length-1];u&&(l.place=u.position)}const a=l.place&&"start"in l.place?l.place.start:l.place;this.ancestors=l.ancestors||void 0,this.cause=l.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file,this.message=i,this.line=a?a.line:void 0,this.name=Mn(l.place)||"1:1",this.place=l.place||void 0,this.reason=this.message,this.ruleId=l.ruleId||void 0,this.source=l.source||void 0,this.stack=o&&l.cause&&typeof l.cause.stack=="string"?l.cause.stack:"",this.actual,this.expected,this.note,this.url}}K.prototype.file="";K.prototype.name="";K.prototype.reason="";K.prototype.message="";K.prototype.stack="";K.prototype.column=void 0;K.prototype.line=void 0;K.prototype.ancestors=void 0;K.prototype.cause=void 0;K.prototype.fatal=void 0;K.prototype.place=void 0;K.prototype.ruleId=void 0;K.prototype.source=void 0;const Ie={}.hasOwnProperty,ki=new Map,bi=/[A-Z]/g,wi=/-([a-z])/g,Si=new Set(["table","tbody","thead","tfoot","tr"]),Ci=new Set(["td","th"]),Wt="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Ei(n,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const t=e.filePath||void 0;let r;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Di(t,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Oi(t,e.jsx,e.jsxs)}const i={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:r,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:t,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Ce:ei,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},l=Qt(i,n,void 0);return l&&typeof l!="string"?l:i.create(n,i.Fragment,{children:l||void 0},void 0)}function Qt(n,e,t){if(e.type==="element")return Ii(n,e,t);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return Ai(n,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Ti(n,e,t);if(e.type==="mdxjsEsm")return Pi(n,e);if(e.type==="root")return zi(n,e,t);if(e.type==="text")return Li(n,e)}function Ii(n,e,t){const r=n.schema;let i=r;e.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Ce,n.schema=i),n.ancestors.push(e);const l=Yt(n,e.tagName,!1),o=vi(n,e);let a=Pe(n,e);return Si.has(e.tagName)&&(a=a.filter(function(u){return typeof u=="string"?!qr(u):!0})),Xt(n,o,l,e),Ae(o,a),n.ancestors.pop(),n.schema=r,n.create(e,l,o,t)}function Ai(n,e){if(e.data&&e.data.estree&&n.evaluater){const r=e.data.estree.body[0];return r.type,n.evaluater.evaluateExpression(r.expression)}_n(n,e.position)}function Pi(n,e){if(e.data&&e.data.estree&&n.evaluater)return n.evaluater.evaluateProgram(e.data.estree);_n(n,e.position)}function Ti(n,e,t){const r=n.schema;let i=r;e.name==="svg"&&r.space==="html"&&(i=Ce,n.schema=i),n.ancestors.push(e);const l=e.name===null?n.Fragment:Yt(n,e.name,!0),o=Fi(n,e),a=Pe(n,e);return Xt(n,o,l,e),Ae(o,a),n.ancestors.pop(),n.schema=r,n.create(e,l,o,t)}function zi(n,e,t){const r={};return Ae(r,Pe(n,e)),n.create(e,n.Fragment,r,t)}function Li(n,e){return e.value}function Xt(n,e,t,r){typeof t!="string"&&t!==n.Fragment&&n.passNode&&(e.node=r)}function Ae(n,e){if(e.length>0){const t=e.length>1?e:e[0];t&&(n.children=t)}}function Oi(n,e,t){return r;function r(i,l,o,a){const s=Array.isArray(o.children)?t:e;return a?s(l,o,a):s(l,o)}}function Di(n,e){return t;function t(r,i,l,o){const a=Array.isArray(l.children),u=Ee(r);return e(i,l,o,a,{columnNumber:u?u.column-1:void 0,fileName:n,lineNumber:u?u.line:void 0},void 0)}}function vi(n,e){const t={};let r,i;for(i in e.properties)if(i!=="children"&&Ie.call(e.properties,i)){const l=Ri(n,i,e.properties[i]);if(l){const[o,a]=l;n.tableCellAlignToStyle&&o==="align"&&typeof a=="string"&&Ci.has(e.tagName)?r=a:t[o]=a}}if(r){const l=t.style||(t.style={});l[n.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return t}function Fi(n,e){const t={};for(const r of e.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&n.evaluater){const l=r.data.estree.body[0];l.type;const o=l.expression;o.type;const a=o.properties[0];a.type,Object.assign(t,n.evaluater.evaluateExpression(a.argument))}else _n(n,e.position);else{const i=r.name;let l;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&n.evaluater){const a=r.value.data.estree.body[0];a.type,l=n.evaluater.evaluateExpression(a.expression)}else _n(n,e.position);else l=r.value===null?!0:r.value;t[i]=l}return t}function Pe(n,e){const t=[];let r=-1;const i=n.passKeys?new Map:ki;for(;++ri?0:i+e:e=e>i?i:e,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(e,t),n.splice(...o);else for(t&&n.splice(e,t);l0?(pn(n,n.length,0,e),n):e}const et={}.hasOwnProperty;function qi(n){const e={};let t=-1;for(;++t13&&t<32||t>126&&t<160||t>55295&&t<57344||t>64975&&t<65008||(t&65535)===65535||(t&65535)===65534||t>1114111?"�":String.fromCodePoint(t)}function Tn(n){return n.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Qi=xn(/\p{P}/u),cn=xn(/[A-Za-z]/),en=xn(/[\dA-Za-z]/),Xi=xn(/[#-'*+\--9=?A-Z^-~]/);function ge(n){return n!==null&&(n<32||n===127)}const ye=xn(/\d/),Yi=xn(/[\dA-Fa-f]/),Jt=xn(/[!-/:-@[-`{-~]/);function T(n){return n!==null&&n<-2}function J(n){return n!==null&&(n<0||n===32)}function B(n){return n===-2||n===-1||n===32}function Ki(n){return Jt(n)||Qi(n)}const Gi=xn(/\s/);function xn(n){return e;function e(t){return t!==null&&t>-1&&n.test(String.fromCharCode(t))}}function On(n){const e=[];let t=-1,r=0,i=0;for(;++t55295&&l<57344){const a=n.charCodeAt(t+1);l<56320&&a>56319&&a<57344?(o=String.fromCharCode(l,a),i=1):o="�"}else o=String.fromCharCode(l);o&&(e.push(n.slice(r,t),encodeURIComponent(o)),r=t+i+1,o=""),i&&(t+=i,i=0)}return e.join("")+n.slice(r)}function j(n,e,t,r){const i=r?r-1:Number.POSITIVE_INFINITY;let l=0;return o;function o(u){return B(u)?(n.enter(t),a(u)):e(u)}function a(u){return B(u)&&l++o))return;const R=e.events.length;let q=R,N,H;for(;q--;)if(e.events[q][0]==="exit"&&e.events[q][1].type==="chunkFlow"){if(N){H=e.events[q][1].end;break}N=!0}for(w(r),x=R;xC;){const O=t[D];e.containerState=O[1],O[0].exit.call(e,n)}t.length=C}function E(){i.write([null]),l=void 0,i=void 0,e.containerState._closeFlow=void 0}}function tl(n,e,t){return j(n,n.attempt(this.parser.constructs.document,e,t),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function rt(n){if(n===null||J(n)||Gi(n))return 1;if(Ki(n))return 2}function ze(n,e,t){const r=[];let i=-1;for(;++i1&&n[t][1].end.offset-n[t][1].start.offset>1?2:1;const f=Object.assign({},n[r][1].end),d=Object.assign({},n[t][1].start);it(f,-u),it(d,u),o={type:u>1?"strongSequence":"emphasisSequence",start:f,end:Object.assign({},n[r][1].end)},a={type:u>1?"strongSequence":"emphasisSequence",start:Object.assign({},n[t][1].start),end:d},l={type:u>1?"strongText":"emphasisText",start:Object.assign({},n[r][1].end),end:Object.assign({},n[t][1].start)},i={type:u>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},a.end)},n[r][1].end=Object.assign({},o.start),n[t][1].start=Object.assign({},a.end),s=[],n[r][1].end.offset-n[r][1].start.offset&&(s=tn(s,[["enter",n[r][1],e],["exit",n[r][1],e]])),s=tn(s,[["enter",i,e],["enter",o,e],["exit",o,e],["enter",l,e]]),s=tn(s,ze(e.parser.constructs.insideSpan.null,n.slice(r+1,t),e)),s=tn(s,[["exit",l,e],["enter",a,e],["exit",a,e],["exit",i,e]]),n[t][1].end.offset-n[t][1].start.offset?(c=2,s=tn(s,[["enter",n[t][1],e],["exit",n[t][1],e]])):c=0,pn(n,r-1,t-r+3,s),t=r+s.length-c-2;break}}for(t=-1;++t0&&B(x)?j(n,E,"linePrefix",l+1)(x):E(x)}function E(x){return x===null||T(x)?n.check(lt,k,D)(x):(n.enter("codeFlowValue"),C(x))}function C(x){return x===null||T(x)?(n.exit("codeFlowValue"),E(x)):(n.consume(x),C)}function D(x){return n.exit("codeFenced"),e(x)}function O(x,R,q){let N=0;return H;function H(F){return x.enter("lineEnding"),x.consume(F),x.exit("lineEnding"),P}function P(F){return x.enter("codeFencedFence"),B(F)?j(x,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):A(F)}function A(F){return F===a?(x.enter("codeFencedFenceSequence"),U(F)):q(F)}function U(F){return F===a?(N++,x.consume(F),U):N>=o?(x.exit("codeFencedFenceSequence"),B(F)?j(x,$,"whitespace")(F):$(F)):q(F)}function $(F){return F===null||T(F)?(x.exit("codeFencedFence"),R(F)):q(F)}}}function ml(n,e,t){const r=this;return i;function i(o){return o===null?t(o):(n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),l)}function l(o){return r.parser.lazy[r.now().line]?t(o):e(o)}}const re={name:"codeIndented",tokenize:gl},dl={tokenize:yl,partial:!0};function gl(n,e,t){const r=this;return i;function i(s){return n.enter("codeIndented"),j(n,l,"linePrefix",4+1)(s)}function l(s){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?o(s):t(s)}function o(s){return s===null?u(s):T(s)?n.attempt(dl,o,u)(s):(n.enter("codeFlowValue"),a(s))}function a(s){return s===null||T(s)?(n.exit("codeFlowValue"),o(s)):(n.consume(s),a)}function u(s){return n.exit("codeIndented"),e(s)}}function yl(n,e,t){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?t(o):T(o)?(n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),i):j(n,l,"linePrefix",4+1)(o)}function l(o){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?e(o):T(o)?i(o):t(o)}}const xl={name:"codeText",tokenize:wl,resolve:kl,previous:bl};function kl(n){let e=n.length-4,t=3,r,i;if((n[t][1].type==="lineEnding"||n[t][1].type==="space")&&(n[e][1].type==="lineEnding"||n[e][1].type==="space")){for(r=t;++r=4?e(o):n.interrupt(r.parser.constructs.flow,t,e)(o)}}function rr(n,e,t,r,i,l,o,a,u){const s=u||Number.POSITIVE_INFINITY;let c=0;return f;function f(w){return w===60?(n.enter(r),n.enter(i),n.enter(l),n.consume(w),n.exit(l),d):w===null||w===32||w===41||ge(w)?t(w):(n.enter(r),n.enter(o),n.enter(a),n.enter("chunkString",{contentType:"string"}),k(w))}function d(w){return w===62?(n.enter(l),n.consume(w),n.exit(l),n.exit(i),n.exit(r),e):(n.enter(a),n.enter("chunkString",{contentType:"string"}),p(w))}function p(w){return w===62?(n.exit("chunkString"),n.exit(a),d(w)):w===null||w===60||T(w)?t(w):(n.consume(w),w===92?y:p)}function y(w){return w===60||w===62||w===92?(n.consume(w),p):p(w)}function k(w){return!c&&(w===null||w===41||J(w))?(n.exit("chunkString"),n.exit(a),n.exit(o),n.exit(r),e(w)):c999||p===null||p===91||p===93&&!u||p===94&&!a&&"_hiddenFootnoteSupport"in o.parser.constructs?t(p):p===93?(n.exit(l),n.enter(i),n.consume(p),n.exit(i),n.exit(r),e):T(p)?(n.enter("lineEnding"),n.consume(p),n.exit("lineEnding"),c):(n.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||T(p)||a++>999?(n.exit("chunkString"),c(p)):(n.consume(p),u||(u=!B(p)),p===92?d:f)}function d(p){return p===91||p===92||p===93?(n.consume(p),a++,f):f(p)}}function lr(n,e,t,r,i,l){let o;return a;function a(d){return d===34||d===39||d===40?(n.enter(r),n.enter(i),n.consume(d),n.exit(i),o=d===40?41:d,u):t(d)}function u(d){return d===o?(n.enter(i),n.consume(d),n.exit(i),n.exit(r),e):(n.enter(l),s(d))}function s(d){return d===o?(n.exit(l),u(o)):d===null?t(d):T(d)?(n.enter("lineEnding"),n.consume(d),n.exit("lineEnding"),j(n,s,"linePrefix")):(n.enter("chunkString",{contentType:"string"}),c(d))}function c(d){return d===o||d===null||T(d)?(n.exit("chunkString"),s(d)):(n.consume(d),d===92?f:c)}function f(d){return d===o||d===92?(n.consume(d),c):c(d)}}function Nn(n,e){let t;return r;function r(i){return T(i)?(n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),t=!0,r):B(i)?j(n,r,t?"linePrefix":"lineSuffix")(i):e(i)}}const Tl={name:"definition",tokenize:Ll},zl={tokenize:Ol,partial:!0};function Ll(n,e,t){const r=this;let i;return l;function l(p){return n.enter("definition"),o(p)}function o(p){return ir.call(r,n,a,t,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function a(p){return i=Tn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(n.enter("definitionMarker"),n.consume(p),n.exit("definitionMarker"),u):t(p)}function u(p){return J(p)?Nn(n,s)(p):s(p)}function s(p){return rr(n,c,t,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function c(p){return n.attempt(zl,f,f)(p)}function f(p){return B(p)?j(n,d,"whitespace")(p):d(p)}function d(p){return p===null||T(p)?(n.exit("definition"),r.parser.defined.push(i),e(p)):t(p)}}function Ol(n,e,t){return r;function r(a){return J(a)?Nn(n,i)(a):t(a)}function i(a){return lr(n,l,t,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function l(a){return B(a)?j(n,o,"whitespace")(a):o(a)}function o(a){return a===null||T(a)?e(a):t(a)}}const Dl={name:"hardBreakEscape",tokenize:vl};function vl(n,e,t){return r;function r(l){return n.enter("hardBreakEscape"),n.consume(l),i}function i(l){return T(l)?(n.exit("hardBreakEscape"),e(l)):t(l)}}const Fl={name:"headingAtx",tokenize:Bl,resolve:Rl};function Rl(n,e){let t=n.length-2,r=3,i,l;return n[r][1].type==="whitespace"&&(r+=2),t-2>r&&n[t][1].type==="whitespace"&&(t-=2),n[t][1].type==="atxHeadingSequence"&&(r===t-1||t-4>r&&n[t-2][1].type==="whitespace")&&(t-=r+1===t?2:4),t>r&&(i={type:"atxHeadingText",start:n[r][1].start,end:n[t][1].end},l={type:"chunkText",start:n[r][1].start,end:n[t][1].end,contentType:"text"},pn(n,r,t-r+1,[["enter",i,e],["enter",l,e],["exit",l,e],["exit",i,e]])),n}function Bl(n,e,t){let r=0;return i;function i(c){return n.enter("atxHeading"),l(c)}function l(c){return n.enter("atxHeadingSequence"),o(c)}function o(c){return c===35&&r++<6?(n.consume(c),o):c===null||J(c)?(n.exit("atxHeadingSequence"),a(c)):t(c)}function a(c){return c===35?(n.enter("atxHeadingSequence"),u(c)):c===null||T(c)?(n.exit("atxHeading"),e(c)):B(c)?j(n,a,"whitespace")(c):(n.enter("atxHeadingText"),s(c))}function u(c){return c===35?(n.consume(c),u):(n.exit("atxHeadingSequence"),a(c))}function s(c){return c===null||c===35||J(c)?(n.exit("atxHeadingText"),a(c)):(n.consume(c),s)}}const Ml=["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"],at=["pre","script","style","textarea"],Nl={name:"htmlFlow",tokenize:Ul,resolveTo:Hl,concrete:!0},_l={tokenize:ql,partial:!0},jl={tokenize:Vl,partial:!0};function Hl(n){let e=n.length;for(;e--&&!(n[e][0]==="enter"&&n[e][1].type==="htmlFlow"););return e>1&&n[e-2][1].type==="linePrefix"&&(n[e][1].start=n[e-2][1].start,n[e+1][1].start=n[e-2][1].start,n.splice(e-2,2)),n}function Ul(n,e,t){const r=this;let i,l,o,a,u;return s;function s(m){return c(m)}function c(m){return n.enter("htmlFlow"),n.enter("htmlFlowData"),n.consume(m),f}function f(m){return m===33?(n.consume(m),d):m===47?(n.consume(m),l=!0,k):m===63?(n.consume(m),i=3,r.interrupt?e:h):cn(m)?(n.consume(m),o=String.fromCharCode(m),I):t(m)}function d(m){return m===45?(n.consume(m),i=2,p):m===91?(n.consume(m),i=5,a=0,y):cn(m)?(n.consume(m),i=4,r.interrupt?e:h):t(m)}function p(m){return m===45?(n.consume(m),r.interrupt?e:h):t(m)}function y(m){const an="CDATA[";return m===an.charCodeAt(a++)?(n.consume(m),a===an.length?r.interrupt?e:A:y):t(m)}function k(m){return cn(m)?(n.consume(m),o=String.fromCharCode(m),I):t(m)}function I(m){if(m===null||m===47||m===62||J(m)){const an=m===47,kn=o.toLowerCase();return!an&&!l&&at.includes(kn)?(i=1,r.interrupt?e(m):A(m)):Ml.includes(o.toLowerCase())?(i=6,an?(n.consume(m),w):r.interrupt?e(m):A(m)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?t(m):l?E(m):C(m))}return m===45||en(m)?(n.consume(m),o+=String.fromCharCode(m),I):t(m)}function w(m){return m===62?(n.consume(m),r.interrupt?e:A):t(m)}function E(m){return B(m)?(n.consume(m),E):H(m)}function C(m){return m===47?(n.consume(m),H):m===58||m===95||cn(m)?(n.consume(m),D):B(m)?(n.consume(m),C):H(m)}function D(m){return m===45||m===46||m===58||m===95||en(m)?(n.consume(m),D):O(m)}function O(m){return m===61?(n.consume(m),x):B(m)?(n.consume(m),O):C(m)}function x(m){return m===null||m===60||m===61||m===62||m===96?t(m):m===34||m===39?(n.consume(m),u=m,R):B(m)?(n.consume(m),x):q(m)}function R(m){return m===u?(n.consume(m),u=null,N):m===null||T(m)?t(m):(n.consume(m),R)}function q(m){return m===null||m===34||m===39||m===47||m===60||m===61||m===62||m===96||J(m)?O(m):(n.consume(m),q)}function N(m){return m===47||m===62||B(m)?C(m):t(m)}function H(m){return m===62?(n.consume(m),P):t(m)}function P(m){return m===null||T(m)?A(m):B(m)?(n.consume(m),P):t(m)}function A(m){return m===45&&i===2?(n.consume(m),Y):m===60&&i===1?(n.consume(m),Q):m===62&&i===4?(n.consume(m),on):m===63&&i===3?(n.consume(m),h):m===93&&i===5?(n.consume(m),fn):T(m)&&(i===6||i===7)?(n.exit("htmlFlowData"),n.check(_l,hn,U)(m)):m===null||T(m)?(n.exit("htmlFlowData"),U(m)):(n.consume(m),A)}function U(m){return n.check(jl,$,hn)(m)}function $(m){return n.enter("lineEnding"),n.consume(m),n.exit("lineEnding"),F}function F(m){return m===null||T(m)?U(m):(n.enter("htmlFlowData"),A(m))}function Y(m){return m===45?(n.consume(m),h):A(m)}function Q(m){return m===47?(n.consume(m),o="",ln):A(m)}function ln(m){if(m===62){const an=o.toLowerCase();return at.includes(an)?(n.consume(m),on):A(m)}return cn(m)&&o.length<8?(n.consume(m),o+=String.fromCharCode(m),ln):A(m)}function fn(m){return m===93?(n.consume(m),h):A(m)}function h(m){return m===62?(n.consume(m),on):m===45&&i===2?(n.consume(m),h):A(m)}function on(m){return m===null||T(m)?(n.exit("htmlFlowData"),hn(m)):(n.consume(m),on)}function hn(m){return n.exit("htmlFlow"),e(m)}}function Vl(n,e,t){const r=this;return i;function i(o){return T(o)?(n.enter("lineEnding"),n.consume(o),n.exit("lineEnding"),l):t(o)}function l(o){return r.parser.lazy[r.now().line]?t(o):e(o)}}function ql(n,e,t){return r;function r(i){return n.enter("lineEnding"),n.consume(i),n.exit("lineEnding"),n.attempt(Gn,e,t)}}const $l={name:"htmlText",tokenize:Wl};function Wl(n,e,t){const r=this;let i,l,o;return a;function a(h){return n.enter("htmlText"),n.enter("htmlTextData"),n.consume(h),u}function u(h){return h===33?(n.consume(h),s):h===47?(n.consume(h),O):h===63?(n.consume(h),C):cn(h)?(n.consume(h),q):t(h)}function s(h){return h===45?(n.consume(h),c):h===91?(n.consume(h),l=0,y):cn(h)?(n.consume(h),E):t(h)}function c(h){return h===45?(n.consume(h),p):t(h)}function f(h){return h===null?t(h):h===45?(n.consume(h),d):T(h)?(o=f,Q(h)):(n.consume(h),f)}function d(h){return h===45?(n.consume(h),p):f(h)}function p(h){return h===62?Y(h):h===45?d(h):f(h)}function y(h){const on="CDATA[";return h===on.charCodeAt(l++)?(n.consume(h),l===on.length?k:y):t(h)}function k(h){return h===null?t(h):h===93?(n.consume(h),I):T(h)?(o=k,Q(h)):(n.consume(h),k)}function I(h){return h===93?(n.consume(h),w):k(h)}function w(h){return h===62?Y(h):h===93?(n.consume(h),w):k(h)}function E(h){return h===null||h===62?Y(h):T(h)?(o=E,Q(h)):(n.consume(h),E)}function C(h){return h===null?t(h):h===63?(n.consume(h),D):T(h)?(o=C,Q(h)):(n.consume(h),C)}function D(h){return h===62?Y(h):C(h)}function O(h){return cn(h)?(n.consume(h),x):t(h)}function x(h){return h===45||en(h)?(n.consume(h),x):R(h)}function R(h){return T(h)?(o=R,Q(h)):B(h)?(n.consume(h),R):Y(h)}function q(h){return h===45||en(h)?(n.consume(h),q):h===47||h===62||J(h)?N(h):t(h)}function N(h){return h===47?(n.consume(h),Y):h===58||h===95||cn(h)?(n.consume(h),H):T(h)?(o=N,Q(h)):B(h)?(n.consume(h),N):Y(h)}function H(h){return h===45||h===46||h===58||h===95||en(h)?(n.consume(h),H):P(h)}function P(h){return h===61?(n.consume(h),A):T(h)?(o=P,Q(h)):B(h)?(n.consume(h),P):N(h)}function A(h){return h===null||h===60||h===61||h===62||h===96?t(h):h===34||h===39?(n.consume(h),i=h,U):T(h)?(o=A,Q(h)):B(h)?(n.consume(h),A):(n.consume(h),$)}function U(h){return h===i?(n.consume(h),i=void 0,F):h===null?t(h):T(h)?(o=U,Q(h)):(n.consume(h),U)}function $(h){return h===null||h===34||h===39||h===60||h===61||h===96?t(h):h===47||h===62||J(h)?N(h):(n.consume(h),$)}function F(h){return h===47||h===62||J(h)?N(h):t(h)}function Y(h){return h===62?(n.consume(h),n.exit("htmlTextData"),n.exit("htmlText"),e):t(h)}function Q(h){return n.exit("htmlTextData"),n.enter("lineEnding"),n.consume(h),n.exit("lineEnding"),ln}function ln(h){return B(h)?j(n,fn,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):fn(h)}function fn(h){return n.enter("htmlTextData"),o(h)}}const Le={name:"labelEnd",tokenize:Jl,resolveTo:Gl,resolveAll:Kl},Ql={tokenize:Zl},Xl={tokenize:no},Yl={tokenize:eo};function Kl(n){let e=-1;for(;++e=3&&(s===null||T(s))?(n.exit("thematicBreak"),e(s)):t(s)}function u(s){return s===i?(n.consume(s),r++,u):(n.exit("thematicBreakSequence"),B(s)?j(n,a,"whitespace")(s):a(s))}}const G={name:"list",tokenize:co,continuation:{tokenize:po},exit:ho},uo={tokenize:mo,partial:!0},so={tokenize:fo,partial:!0};function co(n,e,t){const r=this,i=r.events[r.events.length-1];let l=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return a;function a(p){const y=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(y==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:ye(p)){if(r.containerState.type||(r.containerState.type=y,n.enter(y,{_container:!0})),y==="listUnordered")return n.enter("listItemPrefix"),p===42||p===45?n.check(Wn,t,s)(p):s(p);if(!r.interrupt||p===49)return n.enter("listItemPrefix"),n.enter("listItemValue"),u(p)}return t(p)}function u(p){return ye(p)&&++o<10?(n.consume(p),u):(!r.interrupt||o<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(n.exit("listItemValue"),s(p)):t(p)}function s(p){return n.enter("listItemMarker"),n.consume(p),n.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,n.check(Gn,r.interrupt?t:c,n.attempt(uo,d,f))}function c(p){return r.containerState.initialBlankLine=!0,l++,d(p)}function f(p){return B(p)?(n.enter("listItemPrefixWhitespace"),n.consume(p),n.exit("listItemPrefixWhitespace"),d):t(p)}function d(p){return r.containerState.size=l+r.sliceSerialize(n.exit("listItemPrefix"),!0).length,e(p)}}function po(n,e,t){const r=this;return r.containerState._closeFlow=void 0,n.check(Gn,i,l);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,j(n,e,"listItemIndent",r.containerState.size+1)(a)}function l(a){return r.containerState.furtherBlankLines||!B(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,n.attempt(so,e,o)(a))}function o(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,j(n,n.attempt(G,e,t),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function fo(n,e,t){const r=this;return j(n,i,"listItemIndent",r.containerState.size+1);function i(l){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?e(l):t(l)}}function ho(n){n.exit(this.containerState.type)}function mo(n,e,t){const r=this;return j(n,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4+1);function i(l){const o=r.events[r.events.length-1];return!B(l)&&o&&o[1].type==="listItemPrefixWhitespace"?e(l):t(l)}}const ut={name:"setextUnderline",tokenize:yo,resolveTo:go};function go(n,e){let t=n.length,r,i,l;for(;t--;)if(n[t][0]==="enter"){if(n[t][1].type==="content"){r=t;break}n[t][1].type==="paragraph"&&(i=t)}else n[t][1].type==="content"&&n.splice(t,1),!l&&n[t][1].type==="definition"&&(l=t);const o={type:"setextHeading",start:Object.assign({},n[i][1].start),end:Object.assign({},n[n.length-1][1].end)};return n[i][1].type="setextHeadingText",l?(n.splice(i,0,["enter",o,e]),n.splice(l+1,0,["exit",n[r][1],e]),n[r][1].end=Object.assign({},n[l][1].end)):n[r][1]=o,n.push(["exit",o,e]),n}function yo(n,e,t){const r=this;let i;return l;function l(s){let c=r.events.length,f;for(;c--;)if(r.events[c][1].type!=="lineEnding"&&r.events[c][1].type!=="linePrefix"&&r.events[c][1].type!=="content"){f=r.events[c][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(n.enter("setextHeadingLine"),i=s,o(s)):t(s)}function o(s){return n.enter("setextHeadingLineSequence"),a(s)}function a(s){return s===i?(n.consume(s),a):(n.exit("setextHeadingLineSequence"),B(s)?j(n,u,"lineSuffix")(s):u(s))}function u(s){return s===null||T(s)?(n.exit("setextHeadingLine"),e(s)):t(s)}}const xo={tokenize:ko};function ko(n){const e=this,t=n.attempt(Gn,r,n.attempt(this.parser.constructs.flowInitial,i,j(n,n.attempt(this.parser.constructs.flow,i,n.attempt(Cl,i)),"linePrefix")));return t;function r(l){if(l===null){n.consume(l);return}return n.enter("lineEndingBlank"),n.consume(l),n.exit("lineEndingBlank"),e.currentConstruct=void 0,t}function i(l){if(l===null){n.consume(l);return}return n.enter("lineEnding"),n.consume(l),n.exit("lineEnding"),e.currentConstruct=void 0,t}}const bo={resolveAll:ar()},wo=or("string"),So=or("text");function or(n){return{tokenize:e,resolveAll:ar(n==="text"?Co:void 0)};function e(t){const r=this,i=this.parser.constructs[n],l=t.attempt(i,o,a);return o;function o(c){return s(c)?l(c):a(c)}function a(c){if(c===null){t.consume(c);return}return t.enter("data"),t.consume(c),u}function u(c){return s(c)?(t.exit("data"),l(c)):(t.consume(c),u)}function s(c){if(c===null)return!0;const f=i[c];let d=-1;if(f)for(;++d-1){const a=o[0];typeof a=="string"?o[0]=a.slice(r):o.shift()}l>0&&o.push(n[i].slice(0,l))}return o}function Ao(n,e){let t=-1;const r=[];let i;for(;++t0){const un=z.tokenStack[z.tokenStack.length-1];(un[1]||ct).call(z,void 0,un[0])}for(S.position={start:yn(g.length>0?g[0][1].start:{line:1,column:1,offset:0}),end:yn(g.length>0?g[g.length-2][1].end:{line:1,column:1,offset:0})},M=-1;++Me.jsxs(s,{p:12,children:[e.jsx(s,{align:"center",direction:"row",justify:"space-between",mb:25,children:e.jsx(s,{align:"center",direction:"row",children:e.jsx(z,{children:"Feedback"})})}),e.jsx(s,{mb:30,children:e.jsx(g,{id:"feedback-message",isTextArea:!0,maxLength:500,name:"message",placeholder:"Leave your feedback here ...",rules:j})}),e.jsx(s,{children:e.jsx(w,{color:"secondary","data-testid":"submit-feedback-btn",disabled:!r,size:"large",type:"submit",variant:"contained",children:"Submit"})})]}),z=a(i)` +import{w as a,j as e,F as s,aU as g,aV as j,z as w,H as i,x as n,M as S,a1 as y,r as m,aS as k,aX as F,a3 as v,ac as B}from"./index-4c5f8236.js";import{aW as E}from"./index-a4caf8d5.js";const T=({allowNextStep:r})=>e.jsxs(s,{p:12,children:[e.jsx(s,{align:"center",direction:"row",justify:"space-between",mb:25,children:e.jsx(s,{align:"center",direction:"row",children:e.jsx(z,{children:"Feedback"})})}),e.jsx(s,{mb:30,children:e.jsx(g,{id:"feedback-message",isTextArea:!0,maxLength:500,name:"message",placeholder:"Leave your feedback here ...",rules:j})}),e.jsx(s,{children:e.jsx(w,{color:"secondary","data-testid":"submit-feedback-btn",disabled:!r,size:"large",type:"submit",variant:"contained",children:"Submit"})})]}),z=a(i)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; diff --git a/build/assets/index-2fb8ee5b.js b/build/assets/index-1cb91db3.js similarity index 55% rename from build/assets/index-2fb8ee5b.js rename to build/assets/index-1cb91db3.js index 7c37a7b96..95504839a 100644 --- a/build/assets/index-2fb8ee5b.js +++ b/build/assets/index-1cb91db3.js @@ -1,9 +1,9 @@ -import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E as tu,D as er,V as Fd,G as Fa,a6 as eu,y as su,a7 as Ld,K as Vd,b as Ud,M as gr,a8 as jd,a9 as zd,aa as Bd,Q as qd,ab as Wd,a2 as Hd}from"./index-16ff4e55.js";import{u as It,a as be,m as yo,b as vo,e as La,L as Gd,c as Yd,d as $d,f as Zd,g as nu,H as sr,t as iu,P as Xd,T as Qd,h as Kd,i as Jd,C as tf,j as ef,k as sf}from"./index-710d3c1e.js";import{P as ni,c as Fc,H as nf,E as rf,_ as qt,d as qe,u as We,e as oe,f as ru,g as Va,h as xo,T as Lc,i as of,j as af,k as cf,l as lf,m as uf,n as hf,D as df,I as ff,o as pf,p as Vc,q as mf,r as _f,R as gf,s as yf,t as vf,N as xf,v as kf,O as Tf,w as wf}from"./index-04a82be1.js";import{T as bf}from"./TextareaAutosize-e1814669.js";import{D as yr,F as Cf,V as rt,L as Sf,a as Ef,M as gn,b as _t,S as Of,B as Af,c as ou,P as Vo,d as Mf,e as Nr,f as qs,T as nr,g as ca,h as Df,i as Uc,j as ir,Q as Pf,G as If,C as Ua,k as Nf,l as au,W as Rf,m as Ff,n as Lf,E as Vf,o as Uf,p as jf,q as Xn,r as zf,s as jc,t as zc}from"./three.module-d9fcef06.js";import{u as Bf}from"./index-fe1fa9e4.js";import{C as qf}from"./ClipLoader-049391dc.js";function Wf(i){let t;const e=new Set,s=(l,u)=>{const h=typeof l=="function"?l(t):l;if(h!==t){const d=t;t=u?h:Object.assign({},t,h),e.forEach(p=>p(t,d))}},n=()=>t,r=(l,u=n,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(t);function p(){const _=u(t);if(!h(d,_)){const f=d;l(d=_,f)}}return e.add(p),()=>e.delete(p)},c={setState:s,getState:n,subscribe:(l,u,h)=>u||h?r(l,u,h):(e.add(l),()=>e.delete(l)),destroy:()=>e.clear()};return t=i(s,n,c),c}const Hf=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Bc=Hf?D.useEffect:D.useLayoutEffect;function Gf(i){const t=typeof i=="function"?Wf(i):i,e=(s=t.getState,n=Object.is)=>{const[,r]=D.useReducer(m=>m+1,0),o=t.getState(),a=D.useRef(o),c=D.useRef(s),l=D.useRef(n),u=D.useRef(!1),h=D.useRef();h.current===void 0&&(h.current=s(o));let d,p=!1;(a.current!==o||c.current!==s||l.current!==n||u.current)&&(d=s(o),p=!n(h.current,d)),Bc(()=>{p&&(h.current=d),a.current=o,c.current=s,l.current=n,u.current=!1});const _=D.useRef(o);Bc(()=>{const m=()=>{try{const b=t.getState(),w=c.current(b);l.current(h.current,w)||(a.current=b,h.current=w,r())}catch{u.current=!0,r()}},v=t.subscribe(m);return t.getState()!==_.current&&m(),v},[]);const f=p?d:h.current;return D.useDebugValue(f),f};return Object.assign(e,t),e[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const s=[e,t];return{next(){const n=s.length<=0;return{value:s.shift(),done:n}}}},e}let ii=0;const Yf=Gf(i=>(yr.onStart=(t,e,s)=>{i({active:!0,item:t,loaded:e,total:s,progress:(e-ii)/(s-ii)*100})},yr.onLoad=()=>{i({active:!1})},yr.onError=t=>i(e=>({errors:[...e.errors,t]})),yr.onProgress=(t,e,s)=>{e===s&&(ii=s),i({active:!0,item:t,loaded:e,total:s,progress:(e-ii)/(s-ii)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})),$f=i=>`Loading ${i.toFixed(2)}%`;function Zf({containerStyles:i,innerStyles:t,barStyles:e,dataStyles:s,dataInterpolation:n=$f,initialState:r=o=>o}){const{active:o,progress:a}=Yf(),c=D.useRef(0),l=D.useRef(0),u=D.useRef(null),[h,d]=D.useState(r(o));D.useEffect(()=>{let _;return o!==h&&(_=setTimeout(()=>d(o),300)),()=>clearTimeout(_)},[h,o]);const p=D.useCallback(()=>{u.current&&(c.current+=(a-c.current)/2,(c.current>.95*a||a===100)&&(c.current=a),u.current.innerText=n(c.current),c.current(p(),()=>cancelAnimationFrame(l.current)),[p]),h?D.createElement("div",{style:{...vr.container,opacity:o?1:0,...i}},D.createElement("div",null,D.createElement("div",{style:{...vr.inner,...t}},D.createElement("div",{style:{...vr.bar,transform:`scaleX(${a/100})`,...e}}),D.createElement("span",{ref:u,style:{...vr.data,...s}})))):null}const vr={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"}},Uo=new Cf,jo=new rt,yn=new rt,Re=new rt,rs=new rt,Ye=new rt,os=new rt,as=new rt,ri=new rt,oi=new rt,ai=new rt,xr=new rt,ci=new rt,li=new rt,ui=new rt;class Xf{constructor(t,e,s){this.camera=t,this.scene=e,this.startPoint=new rt,this.endPoint=new rt,this.collection=[],this.deep=s||Number.MAX_VALUE}select(t,e){return this.startPoint=t||this.startPoint,this.endPoint=e||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(Uo,this.scene),this.collection}updateFrustum(t,e){if(t=t||this.startPoint,e=e||this.endPoint,t.x===e.x&&(e.x+=Number.EPSILON),t.y===e.y&&(e.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){yn.copy(t),yn.x=Math.min(t.x,e.x),yn.y=Math.max(t.y,e.y),e.x=Math.max(t.x,e.x),e.y=Math.min(t.y,e.y),Re.setFromMatrixPosition(this.camera.matrixWorld),rs.copy(yn),Ye.set(e.x,yn.y,0),os.copy(e),as.set(yn.x,e.y,0),rs.unproject(this.camera),Ye.unproject(this.camera),os.unproject(this.camera),as.unproject(this.camera),ci.copy(rs).sub(Re),li.copy(Ye).sub(Re),ui.copy(os).sub(Re),ci.normalize(),li.normalize(),ui.normalize(),ci.multiplyScalar(this.deep),li.multiplyScalar(this.deep),ui.multiplyScalar(this.deep),ci.add(Re),li.add(Re),ui.add(Re);var s=Uo.planes;s[0].setFromCoplanarPoints(Re,rs,Ye),s[1].setFromCoplanarPoints(Re,Ye,os),s[2].setFromCoplanarPoints(os,as,Re),s[3].setFromCoplanarPoints(as,rs,Re),s[4].setFromCoplanarPoints(Ye,os,as),s[5].setFromCoplanarPoints(ui,li,ci),s[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const n=Math.min(t.x,e.x),r=Math.max(t.y,e.y),o=Math.max(t.x,e.x),a=Math.min(t.y,e.y);rs.set(n,r,-1),Ye.set(o,r,-1),os.set(o,a,-1),as.set(n,a,-1),ri.set(n,r,1),oi.set(o,r,1),ai.set(o,a,1),xr.set(n,a,1),rs.unproject(this.camera),Ye.unproject(this.camera),os.unproject(this.camera),as.unproject(this.camera),ri.unproject(this.camera),oi.unproject(this.camera),ai.unproject(this.camera),xr.unproject(this.camera);var s=Uo.planes;s[0].setFromCoplanarPoints(rs,ri,oi),s[1].setFromCoplanarPoints(Ye,oi,ai),s[2].setFromCoplanarPoints(ai,xr,as),s[3].setFromCoplanarPoints(xr,ri,rs),s[4].setFromCoplanarPoints(Ye,os,as),s[5].setFromCoplanarPoints(ai,oi,ri),s[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(t,e){if((e.isMesh||e.isLine||e.isPoints)&&e.material!==void 0&&(e.geometry.boundingSphere===null&&e.geometry.computeBoundingSphere(),jo.copy(e.geometry.boundingSphere.center),jo.applyMatrix4(e.matrixWorld),t.containsPoint(jo)&&this.collection.push(e)),e.children.length>0)for(let s=0;s0?Z.copy(M[M.length-1]):Z.identity())}function n(R){const F=new qs,S=new _t,I=new _t,H=new _t;let N=!0,U=!1;const st=R.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi);for(let nt=0,J=st.length;nt0&&(S.copy(H),F.currentPath.currentPoint.copy(S),N=!0);break;default:console.warn(pt)}U=!1}return F}function r(R){if(!(!R.sheet||!R.sheet.cssRules||!R.sheet.cssRules.length))for(let F=0;FH.trim());for(let H=0;H1){const Rc=Math.sqrt(X);F=Rc*F,S=Rc*S,K=F*F,q=S*S}const tt=K*E+q*A,lt=(K*q-tt)/tt;let vt=Math.sqrt(Math.max(0,lt));H===N&&(vt=-vt);const Gt=vt*F*pt/S,Ne=-vt*S*J/F,si=Math.cos(I)*Gt-Math.sin(I)*Ne+(U.x+it.x)/2,Lo=Math.sin(I)*Gt+Math.cos(I)*Ne+(U.y+it.y)/2,_r=a(1,0,(J-Gt)/F,(pt-Ne)/S),Rd=a((J-Gt)/F,(pt-Ne)/S,(-J-Gt)/F,(-pt-Ne)/S)%(Math.PI*2);R.currentPath.absellipse(si,Lo,F,S,_r,_r+Rd,N===0,I)}function a(R,F,S,I){const H=R*S+F*I,N=Math.sqrt(R*R+F*F)*Math.sqrt(S*S+I*I);let U=Math.acos(Math.max(-1,Math.min(1,H/N)));return R*I-F*S<0&&(U=-U),U}function c(R){const F=w(R.getAttribute("x")||0),S=w(R.getAttribute("y")||0),I=w(R.getAttribute("rx")||R.getAttribute("ry")||0),H=w(R.getAttribute("ry")||R.getAttribute("rx")||0),N=w(R.getAttribute("width")),U=w(R.getAttribute("height")),it=1-.551915024494,st=new qs;return st.moveTo(F+I,S),st.lineTo(F+N-I,S),(I!==0||H!==0)&&st.bezierCurveTo(F+N-I*it,S,F+N,S+H*it,F+N,S+H),st.lineTo(F+N,S+U-H),(I!==0||H!==0)&&st.bezierCurveTo(F+N,S+U-H*it,F+N-I*it,S+U,F+N-I,S+U),st.lineTo(F+I,S+U),(I!==0||H!==0)&&st.bezierCurveTo(F+I*it,S+U,F,S+U-H*it,F,S+U-H),st.lineTo(F,S+H),(I!==0||H!==0)&&st.bezierCurveTo(F,S+H*it,F+I*it,S,F+I,S),st}function l(R){function F(N,U,it){const st=w(U),nt=w(it);H===0?I.moveTo(st,nt):I.lineTo(st,nt),H++}const S=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,I=new qs;let H=0;return R.getAttribute("points").replace(S,F),I.currentPath.autoClose=!0,I}function u(R){function F(N,U,it){const st=w(U),nt=w(it);H===0?I.moveTo(st,nt):I.lineTo(st,nt),H++}const S=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,I=new qs;let H=0;return R.getAttribute("points").replace(S,F),I.currentPath.autoClose=!1,I}function h(R){const F=w(R.getAttribute("cx")||0),S=w(R.getAttribute("cy")||0),I=w(R.getAttribute("r")||0),H=new Vo;H.absarc(F,S,I,0,Math.PI*2);const N=new qs;return N.subPaths.push(H),N}function d(R){const F=w(R.getAttribute("cx")||0),S=w(R.getAttribute("cy")||0),I=w(R.getAttribute("rx")||0),H=w(R.getAttribute("ry")||0),N=new Vo;N.absellipse(F,S,I,H,0,Math.PI*2);const U=new qs;return U.subPaths.push(N),U}function p(R){const F=w(R.getAttribute("x1")||0),S=w(R.getAttribute("y1")||0),I=w(R.getAttribute("x2")||0),H=w(R.getAttribute("y2")||0),N=new qs;return N.moveTo(F,S),N.lineTo(I,H),N.currentPath.autoClose=!1,N}function _(R,F){F=Object.assign({},F);let S={};if(R.hasAttribute("class")){const U=R.getAttribute("class").split(/\s/).filter(Boolean).map(it=>it.trim());for(let it=0;it0&&F.premultiply(M[M.length-1]),Z.copy(F),M.push(F),F}function y(R){const F=new gn,S=V;if(R.nodeName==="use"&&(R.hasAttribute("x")||R.hasAttribute("y"))){const I=w(R.getAttribute("x")),H=w(R.getAttribute("y"));F.translate(I,H)}if(R.hasAttribute("transform")){const I=R.getAttribute("transform").split(")");for(let H=I.length-1;H>=0;H--){const N=I[H].trim();if(N==="")continue;const U=N.indexOf("("),it=N.length;if(U>0&&U=1){const J=nt[0];let pt=J;nt.length>=2&&(pt=nt[1]),S.translate(J,pt)}break;case"rotate":if(nt.length>=1){let J=0,pt=0,K=0;J=-nt[0]*Math.PI/180,nt.length>=3&&(pt=nt[1],K=nt[2]),B.identity().translate(-pt,-K),Y.identity().rotate(J),G.multiplyMatrices(Y,B),B.identity().translate(pt,K),S.multiplyMatrices(B,G)}break;case"scale":if(nt.length>=1){const J=nt[0];let pt=J;nt.length>=2&&(pt=nt[1]),S.scale(J,pt)}break;case"skewX":nt.length===1&&S.set(1,Math.tan(nt[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":nt.length===1&&S.set(1,0,0,Math.tan(nt[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":nt.length===6&&S.set(nt[0],nt[2],nt[4],nt[1],nt[3],nt[5],0,0,1);break}}F.premultiply(S)}}return F}function k(R,F){function S(N){j.set(N.x,N.y,1).applyMatrix3(F),N.set(j.x,j.y)}const I=T(F),H=R.subPaths;for(let N=0,U=H.length;N=1||G<0||G>1)return null;if(M===0&&B===0){for(let z=0;z<2;z++)if(o(z===0?b:w,m,v),n.loc==s.ORIGIN){const j=z===0?b:w;return{x:j.x,y:j.y,t:n.t}}else if(n.loc==s.BETWEEN){const j=+(g+n.t*(y-g)).toPrecision(10),Z=+(x+n.t*(C-x)).toPrecision(10);return{x:j,y:Z,t:n.t}}return null}else{for(let Z=0;Z<2;Z++)if(o(Z===0?b:w,m,v),n.loc==s.ORIGIN){const Q=Z===0?b:w;return{x:Q.x,y:Q.y,t:n.t}}const z=+(g+Y*(y-g)).toPrecision(10),j=+(x+Y*(C-x)).toPrecision(10);return{x:z,y:j,t:Y}}}function o(m,v,b){const w=b.x-v.x,g=b.y-v.y,y=m.x-v.x,k=m.y-v.y,T=w*k-y*g;if(m.x===v.x&&m.y===v.y){n.loc=s.ORIGIN,n.t=0;return}if(m.x===b.x&&m.y===b.y){n.loc=s.DESTINATION,n.t=1;return}if(T<-Number.EPSILON){n.loc=s.LEFT;return}if(T>Number.EPSILON){n.loc=s.RIGHT;return}if(w*y<0||g*k<0){n.loc=s.BEHIND;return}if(Math.sqrt(w*w+g*g)P.t<=O.t+Number.EPSILON&&P.t>=O.t-Number.EPSILON)===void 0&&(b.push(O),w.push(new _t(O.x,O.y)))}}return w}function c(m,v,b){const w=new _t;v.getCenter(w);const g=[];return b.forEach(y=>{y.boundingBox.containsPoint(w)&&a(m,y.points).forEach(T=>{g.push({identifier:y.identifier,isCW:y.isCW,point:T})})}),g.sort((y,k)=>y.point.x-k.point.x),g}function l(m,v,b,w,g){(g==null||g==="")&&(g="nonzero");const y=new _t;m.boundingBox.getCenter(y);const k=[new _t(b,y.y),new _t(w,y.y)],T=c(k,m.boundingBox,v);T.sort((V,B)=>V.point.x-B.point.x);const x=[],C=[];T.forEach(V=>{V.identifier===m.identifier?x.push(V):C.push(V)});const O=x[0].point.x,P=[];let M=0;for(;M0&&P[P.length-1]===C[M].identifier?P.pop():P.push(C[M].identifier),M++;if(P.push(m.identifier),g==="evenodd"){const V=P.length%2===0,B=P[P.length-2];return{identifier:m.identifier,isHole:V,for:B}}else if(g==="nonzero"){let V=!0,B=null,Y=null;for(let G=0;G{const v=m.getPoints();let b=-999999999,w=999999999,g=-999999999,y=999999999;for(let k=0;kb&&(b=T.y),T.yg&&(g=T.x),T.x=y&&(h=y-1),{curves:m.curves,points:v,isCW:Of.isClockWise(v),identifier:u++,boundingBox:new Af(new _t(y,w),new _t(g,b))}});p=p.filter(m=>m.points.length>1);const _=p.map(m=>l(m,p,h,d,t.userData.style.fillRule)),f=[];return p.forEach(m=>{if(!_[m.identifier].isHole){const b=new ou;b.curves=m.curves,_.filter(g=>g.isHole&&g.for===m.identifier).forEach(g=>{const y=p[g.identifier],k=new Vo;k.curves=y.curves,b.holes.push(k)}),f.push(b)}}),f}static getStrokeStyle(t,e,s,n,r){return t=t!==void 0?t:1,e=e!==void 0?e:"#000",s=s!==void 0?s:"miter",n=n!==void 0?n:"butt",r=r!==void 0?r:4,{strokeColor:e,strokeWidth:t,strokeLineJoin:s,strokeLineCap:n,strokeMiterLimit:r}}static pointsToStroke(t,e,s,n){const r=[],o=[],a=[];if(wi.pointsToStrokeWithBuffers(t,e,s,n,r,o,a)===0)return null;const c=new Mf;return c.setAttribute("position",new Nr(r,3)),c.setAttribute("normal",new Nr(o,3)),c.setAttribute("uv",new Nr(a,2)),c}static pointsToStrokeWithBuffers(t,e,s,n,r,o,a,c){const l=new _t,u=new _t,h=new _t,d=new _t,p=new _t,_=new _t,f=new _t,m=new _t,v=new _t,b=new _t,w=new _t,g=new _t,y=new _t,k=new _t,T=new _t,x=new _t,C=new _t;s=s!==void 0?s:12,n=n!==void 0?n:.001,c=c!==void 0?c:0,t=pt(t);const O=t.length;if(O<2)return 0;const P=t[0].equals(t[O-1]);let M,V=t[0],B;const Y=e.strokeWidth/2,G=1/(O-1);let z=0,j,Z,Q,et,R=!1,F=0,S=c*3,I=c*2;H(t[0],t[1],l).multiplyScalar(Y),m.copy(t[0]).sub(l),v.copy(t[0]).add(l),b.copy(m),w.copy(v);for(let K=1;K=n&&A.push(K[E]);return A.push(K[K.length-1]),A}}}function Qf(i,t){if(Object.is(i,t))return!0;if(typeof i!="object"||i===null||typeof t!="object"||t===null)return!1;const e=Object.keys(i);if(e.length!==Object.keys(t).length)return!1;for(let s=0;sc,...a}){const{setEvents:c,camera:l,raycaster:u,gl:h,controls:d,size:p,get:_}=It(),[f,m]=D.useState(!1),[v,b]=D.useReducer((k,{object:T,shift:x})=>T===void 0?[]:Array.isArray(T)?T:x?k.includes(T)?k.filter(C=>C!==T):[T,...k]:k[0]===T?[]:[T],[]);D.useEffect(()=>void(s==null?void 0:s(v)),[v]);const w=D.useCallback(k=>{k.stopPropagation(),b({object:o([k.object])[0],shift:t&&k.shiftKey})},[]),g=D.useCallback(k=>!f&&b({}),[f]),y=D.useRef(null);return D.useEffect(()=>{if(!i||!t)return;const k=new Xf(l,y.current),T=document.createElement("div");T.style.pointerEvents="none",T.style.border=n,T.style.backgroundColor=r,T.style.position="fixed";const x=new _t,C=new _t,O=new _t,P=_().events.enabled,M=d==null?void 0:d.enabled;let V=!1;function B(R,F){const{offsetX:S,offsetY:I}=R,{width:H,height:N}=p;F.set(S/H*2-1,-(I/N)*2+1)}function Y(R){var F;d&&(d.enabled=!1),c({enabled:!1}),V=!0,(F=h.domElement.parentElement)==null||F.appendChild(T),T.style.left=`${R.clientX}px`,T.style.top=`${R.clientY}px`,T.style.width="0px",T.style.height="0px",x.x=R.clientX,x.y=R.clientY}function G(R){O.x=Math.max(x.x,R.clientX),O.y=Math.max(x.y,R.clientY),C.x=Math.min(x.x,R.clientX),C.y=Math.min(x.y,R.clientY),T.style.left=`${C.x}px`,T.style.top=`${C.y}px`,T.style.width=`${O.x-C.x}px`,T.style.height=`${O.y-C.y}px`}function z(){if(V){var R;d&&(d.enabled=M),c({enabled:P}),V=!1,(R=T.parentElement)==null||R.removeChild(T)}}function j(R){R.shiftKey&&(Y(R),B(R,k.startPoint))}let Z=[];function Q(R){if(V){G(R),B(R,k.endPoint);const F=k.select().sort(S=>S.uuid).filter(S=>S.isMesh);Qf(F,Z)||(Z=F,b({object:o(F)}))}}function et(R){V&&z()}return document.addEventListener("pointerdown",j,{passive:!0}),document.addEventListener("pointermove",Q,{passive:!0,capture:!0}),document.addEventListener("pointerup",et,{passive:!0}),()=>{document.removeEventListener("pointerdown",j),document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",et)}},[p.width,p.height,u,l,d,h]),D.createElement("group",Oe({ref:y,onClick:w,onPointerOver:()=>m(!0),onPointerOut:()=>m(!1),onPointerMissed:g},a),D.createElement(Kf.Provider,{value:v},e))}const cu=D.forwardRef(function({follow:t=!0,lockX:e=!1,lockY:s=!1,lockZ:n=!1,...r},o){const a=D.useRef();return be(({camera:c})=>{if(!t||!a.current)return;const l=a.current.rotation.clone();c.getWorldQuaternion(a.current.quaternion),e&&(a.current.rotation.x=l.x),s&&(a.current.rotation.y=l.y),n&&(a.current.rotation.z=l.z)}),D.createElement("group",Oe({ref:yo([a,o])},r))}),qc=i=>i===Object(i)&&!Array.isArray(i)&&typeof i!="function";function Ks(i,t){const e=It(n=>n.gl),s=vo(nr,qc(i)?Object.values(i):i);if(D.useLayoutEffect(()=>{t==null||t(s)},[t]),D.useEffect(()=>{(Array.isArray(s)?s:[s]).forEach(e.initTexture)},[e,s]),qc(i)){const n=Object.keys(i),r={};return n.forEach(o=>Object.assign(r,{[o]:s[n.indexOf(o)]})),r}else return s}Ks.preload=i=>vo.preload(nr,i);Ks.clear=i=>vo.clear(nr,i);const t0=D.forwardRef(function({src:t,skipFill:e,skipStrokes:s,fillMaterial:n,strokeMaterial:r,fillMeshProps:o,strokeMeshProps:a,...c},l){const u=vo(wi,t.startsWith("s?[]:u.paths.map(d=>{var p;return((p=d.userData)==null?void 0:p.style.stroke)===void 0||d.userData.style.stroke==="none"?null:d.subPaths.map(_=>wi.pointsToStroke(_.getPoints(),d.userData.style))}),[u,s]);return D.useEffect(()=>()=>h.forEach(d=>d&&d.map(p=>p.dispose())),[h]),D.createElement("object3D",Oe({ref:l},c),D.createElement("object3D",{scale:[1,-1,1]},u.paths.map((d,p)=>{var _,f;return D.createElement(D.Fragment,{key:p},!e&&((_=d.userData)==null?void 0:_.style.fill)!==void 0&&d.userData.style.fill!=="none"&&wi.createShapes(d).map((m,v)=>D.createElement("mesh",Oe({key:v},o),D.createElement("shapeGeometry",{args:[m]}),D.createElement("meshBasicMaterial",Oe({color:d.userData.style.fill,opacity:d.userData.style.fillOpacity,transparent:!0,side:ca,depthWrite:!1},n)))),!s&&((f=d.userData)==null?void 0:f.style.stroke)!==void 0&&d.userData.style.stroke!=="none"&&d.subPaths.map((m,v)=>D.createElement("mesh",Oe({key:v,geometry:h[p][v]},a),D.createElement("meshBasicMaterial",Oe({color:d.userData.style.stroke,opacity:d.userData.style.strokeOpacity,transparent:!0,side:ca,depthWrite:!1},r)))))})))});/*! +import{r as D,e as Se,j as L,t as Hl,w as Ut,x as Tt,F as gs,z as Yl,v as Vs,E as Gl,D as Ji,V as Sd,G as Da,a6 as $l,y as Zl,a7 as Ed,K as Od,b as Ad,M as fr,a8 as Md,a9 as Dd,aa as Pd,Q as Id,ab as Nd,a2 as Rd}from"./index-4c5f8236.js";import{u as It,a as Pe,m as ho,b as fo,e as Pa,L as Fd,c as Ld,d as Vd,f as Ud,g as Xl,H as tr,t as Ql,P as zd,T as jd,h as Bd,i as qd,C as Wd,j as Hd,k as Yd}from"./index-8f6ab1fe.js";import{P as ei,c as Pc,H as Gd,E as $d,_ as qt,d as Be,u as ts,e as pe,f as Kl,g as Ia,h as po,T as Ic,i as Zd,D as Xd,I as Qd,j as Kd,k as Jd,l as tf,m as ef,n as Nc,o as sf,p as nf,R as rf,q as of,r as af,N as cf,s as lf,O as uf,t as hf}from"./index-a4caf8d5.js";import{T as df}from"./TextareaAutosize-cc9b3a66.js";import{D as pr,F as ff,V as rt,L as pf,a as mf,M as _n,b as _t,S as _f,B as gf,c as Jl,P as Io,d as yf,e as Ar,f as Bs,T as mo,g as na,h as vf,i as Rc,j as er,Q as xf,G as kf,C as Na,k as Tf,l as tu,W as wf,m as bf,n as Cf,E as Sf,o as Ef,p as Of,q as Ra,r as Af,s as Fc,t as Lc}from"./three.module-d9fcef06.js";import{u as Mf}from"./index-5019b400.js";import{C as Df}from"./ClipLoader-601f6378.js";function Pf(i){let t;const e=new Set,s=(l,u)=>{const h=typeof l=="function"?l(t):l;if(h!==t){const d=t;t=u?h:Object.assign({},t,h),e.forEach(p=>p(t,d))}},n=()=>t,r=(l,u=n,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let d=u(t);function p(){const _=u(t);if(!h(d,_)){const f=d;l(d=_,f)}}return e.add(p),()=>e.delete(p)},c={setState:s,getState:n,subscribe:(l,u,h)=>u||h?r(l,u,h):(e.add(l),()=>e.delete(l)),destroy:()=>e.clear()};return t=i(s,n,c),c}const If=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Vc=If?D.useEffect:D.useLayoutEffect;function Nf(i){const t=typeof i=="function"?Pf(i):i,e=(s=t.getState,n=Object.is)=>{const[,r]=D.useReducer(m=>m+1,0),o=t.getState(),a=D.useRef(o),c=D.useRef(s),l=D.useRef(n),u=D.useRef(!1),h=D.useRef();h.current===void 0&&(h.current=s(o));let d,p=!1;(a.current!==o||c.current!==s||l.current!==n||u.current)&&(d=s(o),p=!n(h.current,d)),Vc(()=>{p&&(h.current=d),a.current=o,c.current=s,l.current=n,u.current=!1});const _=D.useRef(o);Vc(()=>{const m=()=>{try{const b=t.getState(),w=c.current(b);l.current(h.current,w)||(a.current=b,h.current=w,r())}catch{u.current=!0,r()}},v=t.subscribe(m);return t.getState()!==_.current&&m(),v},[]);const f=p?d:h.current;return D.useDebugValue(f),f};return Object.assign(e,t),e[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const s=[e,t];return{next(){const n=s.length<=0;return{value:s.shift(),done:n}}}},e}let si=0;const Rf=Nf(i=>(pr.onStart=(t,e,s)=>{i({active:!0,item:t,loaded:e,total:s,progress:(e-si)/(s-si)*100})},pr.onLoad=()=>{i({active:!1})},pr.onError=t=>i(e=>({errors:[...e.errors,t]})),pr.onProgress=(t,e,s)=>{e===s&&(si=s),i({active:!0,item:t,loaded:e,total:s,progress:(e-si)/(s-si)*100||100})},{errors:[],active:!1,progress:0,item:"",loaded:0,total:0})),Ff=i=>`Loading ${i.toFixed(2)}%`;function Lf({containerStyles:i,innerStyles:t,barStyles:e,dataStyles:s,dataInterpolation:n=Ff,initialState:r=o=>o}){const{active:o,progress:a}=Rf(),c=D.useRef(0),l=D.useRef(0),u=D.useRef(null),[h,d]=D.useState(r(o));D.useEffect(()=>{let _;return o!==h&&(_=setTimeout(()=>d(o),300)),()=>clearTimeout(_)},[h,o]);const p=D.useCallback(()=>{u.current&&(c.current+=(a-c.current)/2,(c.current>.95*a||a===100)&&(c.current=a),u.current.innerText=n(c.current),c.current(p(),()=>cancelAnimationFrame(l.current)),[p]),h?D.createElement("div",{style:{...mr.container,opacity:o?1:0,...i}},D.createElement("div",null,D.createElement("div",{style:{...mr.inner,...t}},D.createElement("div",{style:{...mr.bar,transform:`scaleX(${a/100})`,...e}}),D.createElement("span",{ref:u,style:{...mr.data,...s}})))):null}const mr={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"}},No=new ff,Ro=new rt,gn=new rt,Ne=new rt,is=new rt,He=new rt,rs=new rt,os=new rt,ni=new rt,ii=new rt,ri=new rt,_r=new rt,oi=new rt,ai=new rt,ci=new rt;class Vf{constructor(t,e,s){this.camera=t,this.scene=e,this.startPoint=new rt,this.endPoint=new rt,this.collection=[],this.deep=s||Number.MAX_VALUE}select(t,e){return this.startPoint=t||this.startPoint,this.endPoint=e||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(No,this.scene),this.collection}updateFrustum(t,e){if(t=t||this.startPoint,e=e||this.endPoint,t.x===e.x&&(e.x+=Number.EPSILON),t.y===e.y&&(e.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){gn.copy(t),gn.x=Math.min(t.x,e.x),gn.y=Math.max(t.y,e.y),e.x=Math.max(t.x,e.x),e.y=Math.min(t.y,e.y),Ne.setFromMatrixPosition(this.camera.matrixWorld),is.copy(gn),He.set(e.x,gn.y,0),rs.copy(e),os.set(gn.x,e.y,0),is.unproject(this.camera),He.unproject(this.camera),rs.unproject(this.camera),os.unproject(this.camera),oi.copy(is).sub(Ne),ai.copy(He).sub(Ne),ci.copy(rs).sub(Ne),oi.normalize(),ai.normalize(),ci.normalize(),oi.multiplyScalar(this.deep),ai.multiplyScalar(this.deep),ci.multiplyScalar(this.deep),oi.add(Ne),ai.add(Ne),ci.add(Ne);var s=No.planes;s[0].setFromCoplanarPoints(Ne,is,He),s[1].setFromCoplanarPoints(Ne,He,rs),s[2].setFromCoplanarPoints(rs,os,Ne),s[3].setFromCoplanarPoints(os,is,Ne),s[4].setFromCoplanarPoints(He,rs,os),s[5].setFromCoplanarPoints(ci,ai,oi),s[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const n=Math.min(t.x,e.x),r=Math.max(t.y,e.y),o=Math.max(t.x,e.x),a=Math.min(t.y,e.y);is.set(n,r,-1),He.set(o,r,-1),rs.set(o,a,-1),os.set(n,a,-1),ni.set(n,r,1),ii.set(o,r,1),ri.set(o,a,1),_r.set(n,a,1),is.unproject(this.camera),He.unproject(this.camera),rs.unproject(this.camera),os.unproject(this.camera),ni.unproject(this.camera),ii.unproject(this.camera),ri.unproject(this.camera),_r.unproject(this.camera);var s=No.planes;s[0].setFromCoplanarPoints(is,ni,ii),s[1].setFromCoplanarPoints(He,ii,ri),s[2].setFromCoplanarPoints(ri,_r,os),s[3].setFromCoplanarPoints(_r,ni,is),s[4].setFromCoplanarPoints(He,rs,os),s[5].setFromCoplanarPoints(ri,ii,ni),s[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(t,e){if((e.isMesh||e.isLine||e.isPoints)&&e.material!==void 0&&(e.geometry.boundingSphere===null&&e.geometry.computeBoundingSphere(),Ro.copy(e.geometry.boundingSphere.center),Ro.applyMatrix4(e.matrixWorld),t.containsPoint(Ro)&&this.collection.push(e)),e.children.length>0)for(let s=0;s0?Z.copy(M[M.length-1]):Z.identity())}function n(R){const F=new Bs,S=new _t,P=new _t,H=new _t;let N=!0,U=!1;const st=R.getAttribute("d").match(/[a-df-z][^a-df-z]*/gi);for(let nt=0,J=st.length;nt0&&(S.copy(H),F.currentPath.currentPoint.copy(S),N=!0);break;default:console.warn(pt)}U=!1}return F}function r(R){if(!(!R.sheet||!R.sheet.cssRules||!R.sheet.cssRules.length))for(let F=0;FH.trim());for(let H=0;H1){const Dc=Math.sqrt(X);F=Dc*F,S=Dc*S,K=F*F,B=S*S}const tt=K*E+B*A,lt=(K*B-tt)/tt;let vt=Math.sqrt(Math.max(0,lt));H===N&&(vt=-vt);const Yt=vt*F*pt/S,Ie=-vt*S*J/F,ti=Math.cos(P)*Yt-Math.sin(P)*Ie+(U.x+it.x)/2,Po=Math.sin(P)*Yt+Math.cos(P)*Ie+(U.y+it.y)/2,dr=a(1,0,(J-Yt)/F,(pt-Ie)/S),Cd=a((J-Yt)/F,(pt-Ie)/S,(-J-Yt)/F,(-pt-Ie)/S)%(Math.PI*2);R.currentPath.absellipse(ti,Po,F,S,dr,dr+Cd,N===0,P)}function a(R,F,S,P){const H=R*S+F*P,N=Math.sqrt(R*R+F*F)*Math.sqrt(S*S+P*P);let U=Math.acos(Math.max(-1,Math.min(1,H/N)));return R*P-F*S<0&&(U=-U),U}function c(R){const F=w(R.getAttribute("x")||0),S=w(R.getAttribute("y")||0),P=w(R.getAttribute("rx")||R.getAttribute("ry")||0),H=w(R.getAttribute("ry")||R.getAttribute("rx")||0),N=w(R.getAttribute("width")),U=w(R.getAttribute("height")),it=1-.551915024494,st=new Bs;return st.moveTo(F+P,S),st.lineTo(F+N-P,S),(P!==0||H!==0)&&st.bezierCurveTo(F+N-P*it,S,F+N,S+H*it,F+N,S+H),st.lineTo(F+N,S+U-H),(P!==0||H!==0)&&st.bezierCurveTo(F+N,S+U-H*it,F+N-P*it,S+U,F+N-P,S+U),st.lineTo(F+P,S+U),(P!==0||H!==0)&&st.bezierCurveTo(F+P*it,S+U,F,S+U-H*it,F,S+U-H),st.lineTo(F,S+H),(P!==0||H!==0)&&st.bezierCurveTo(F,S+H*it,F+P*it,S,F+P,S),st}function l(R){function F(N,U,it){const st=w(U),nt=w(it);H===0?P.moveTo(st,nt):P.lineTo(st,nt),H++}const S=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,P=new Bs;let H=0;return R.getAttribute("points").replace(S,F),P.currentPath.autoClose=!0,P}function u(R){function F(N,U,it){const st=w(U),nt=w(it);H===0?P.moveTo(st,nt):P.lineTo(st,nt),H++}const S=/(-?[\d\.?]+)[,|\s](-?[\d\.?]+)/g,P=new Bs;let H=0;return R.getAttribute("points").replace(S,F),P.currentPath.autoClose=!1,P}function h(R){const F=w(R.getAttribute("cx")||0),S=w(R.getAttribute("cy")||0),P=w(R.getAttribute("r")||0),H=new Io;H.absarc(F,S,P,0,Math.PI*2);const N=new Bs;return N.subPaths.push(H),N}function d(R){const F=w(R.getAttribute("cx")||0),S=w(R.getAttribute("cy")||0),P=w(R.getAttribute("rx")||0),H=w(R.getAttribute("ry")||0),N=new Io;N.absellipse(F,S,P,H,0,Math.PI*2);const U=new Bs;return U.subPaths.push(N),U}function p(R){const F=w(R.getAttribute("x1")||0),S=w(R.getAttribute("y1")||0),P=w(R.getAttribute("x2")||0),H=w(R.getAttribute("y2")||0),N=new Bs;return N.moveTo(F,S),N.lineTo(P,H),N.currentPath.autoClose=!1,N}function _(R,F){F=Object.assign({},F);let S={};if(R.hasAttribute("class")){const U=R.getAttribute("class").split(/\s/).filter(Boolean).map(it=>it.trim());for(let it=0;it0&&F.premultiply(M[M.length-1]),Z.copy(F),M.push(F),F}function y(R){const F=new _n,S=V;if(R.nodeName==="use"&&(R.hasAttribute("x")||R.hasAttribute("y"))){const P=w(R.getAttribute("x")),H=w(R.getAttribute("y"));F.translate(P,H)}if(R.hasAttribute("transform")){const P=R.getAttribute("transform").split(")");for(let H=P.length-1;H>=0;H--){const N=P[H].trim();if(N==="")continue;const U=N.indexOf("("),it=N.length;if(U>0&&U=1){const J=nt[0];let pt=J;nt.length>=2&&(pt=nt[1]),S.translate(J,pt)}break;case"rotate":if(nt.length>=1){let J=0,pt=0,K=0;J=-nt[0]*Math.PI/180,nt.length>=3&&(pt=nt[1],K=nt[2]),W.identity().translate(-pt,-K),G.identity().rotate(J),Y.multiplyMatrices(G,W),W.identity().translate(pt,K),S.multiplyMatrices(W,Y)}break;case"scale":if(nt.length>=1){const J=nt[0];let pt=J;nt.length>=2&&(pt=nt[1]),S.scale(J,pt)}break;case"skewX":nt.length===1&&S.set(1,Math.tan(nt[0]*Math.PI/180),0,0,1,0,0,0,1);break;case"skewY":nt.length===1&&S.set(1,0,0,Math.tan(nt[0]*Math.PI/180),1,0,0,0,1);break;case"matrix":nt.length===6&&S.set(nt[0],nt[2],nt[4],nt[1],nt[3],nt[5],0,0,1);break}}F.premultiply(S)}}return F}function k(R,F){function S(N){z.set(N.x,N.y,1).applyMatrix3(F),N.set(z.x,z.y)}const P=T(F),H=R.subPaths;for(let N=0,U=H.length;N=1||Y<0||Y>1)return null;if(M===0&&W===0){for(let j=0;j<2;j++)if(o(j===0?b:w,m,v),n.loc==s.ORIGIN){const z=j===0?b:w;return{x:z.x,y:z.y,t:n.t}}else if(n.loc==s.BETWEEN){const z=+(g+n.t*(y-g)).toPrecision(10),Z=+(x+n.t*(C-x)).toPrecision(10);return{x:z,y:Z,t:n.t}}return null}else{for(let Z=0;Z<2;Z++)if(o(Z===0?b:w,m,v),n.loc==s.ORIGIN){const Q=Z===0?b:w;return{x:Q.x,y:Q.y,t:n.t}}const j=+(g+G*(y-g)).toPrecision(10),z=+(x+G*(C-x)).toPrecision(10);return{x:j,y:z,t:G}}}function o(m,v,b){const w=b.x-v.x,g=b.y-v.y,y=m.x-v.x,k=m.y-v.y,T=w*k-y*g;if(m.x===v.x&&m.y===v.y){n.loc=s.ORIGIN,n.t=0;return}if(m.x===b.x&&m.y===b.y){n.loc=s.DESTINATION,n.t=1;return}if(T<-Number.EPSILON){n.loc=s.LEFT;return}if(T>Number.EPSILON){n.loc=s.RIGHT;return}if(w*y<0||g*k<0){n.loc=s.BEHIND;return}if(Math.sqrt(w*w+g*g)I.t<=O.t+Number.EPSILON&&I.t>=O.t-Number.EPSILON)===void 0&&(b.push(O),w.push(new _t(O.x,O.y)))}}return w}function c(m,v,b){const w=new _t;v.getCenter(w);const g=[];return b.forEach(y=>{y.boundingBox.containsPoint(w)&&a(m,y.points).forEach(T=>{g.push({identifier:y.identifier,isCW:y.isCW,point:T})})}),g.sort((y,k)=>y.point.x-k.point.x),g}function l(m,v,b,w,g){(g==null||g==="")&&(g="nonzero");const y=new _t;m.boundingBox.getCenter(y);const k=[new _t(b,y.y),new _t(w,y.y)],T=c(k,m.boundingBox,v);T.sort((V,W)=>V.point.x-W.point.x);const x=[],C=[];T.forEach(V=>{V.identifier===m.identifier?x.push(V):C.push(V)});const O=x[0].point.x,I=[];let M=0;for(;M0&&I[I.length-1]===C[M].identifier?I.pop():I.push(C[M].identifier),M++;if(I.push(m.identifier),g==="evenodd"){const V=I.length%2===0,W=I[I.length-2];return{identifier:m.identifier,isHole:V,for:W}}else if(g==="nonzero"){let V=!0,W=null,G=null;for(let Y=0;Y{const v=m.getPoints();let b=-999999999,w=999999999,g=-999999999,y=999999999;for(let k=0;kb&&(b=T.y),T.yg&&(g=T.x),T.x=y&&(h=y-1),{curves:m.curves,points:v,isCW:_f.isClockWise(v),identifier:u++,boundingBox:new gf(new _t(y,w),new _t(g,b))}});p=p.filter(m=>m.points.length>1);const _=p.map(m=>l(m,p,h,d,t.userData.style.fillRule)),f=[];return p.forEach(m=>{if(!_[m.identifier].isHole){const b=new Jl;b.curves=m.curves,_.filter(g=>g.isHole&&g.for===m.identifier).forEach(g=>{const y=p[g.identifier],k=new Io;k.curves=y.curves,b.holes.push(k)}),f.push(b)}}),f}static getStrokeStyle(t,e,s,n,r){return t=t!==void 0?t:1,e=e!==void 0?e:"#000",s=s!==void 0?s:"miter",n=n!==void 0?n:"butt",r=r!==void 0?r:4,{strokeColor:e,strokeWidth:t,strokeLineJoin:s,strokeLineCap:n,strokeMiterLimit:r}}static pointsToStroke(t,e,s,n){const r=[],o=[],a=[];if(ki.pointsToStrokeWithBuffers(t,e,s,n,r,o,a)===0)return null;const c=new yf;return c.setAttribute("position",new Ar(r,3)),c.setAttribute("normal",new Ar(o,3)),c.setAttribute("uv",new Ar(a,2)),c}static pointsToStrokeWithBuffers(t,e,s,n,r,o,a,c){const l=new _t,u=new _t,h=new _t,d=new _t,p=new _t,_=new _t,f=new _t,m=new _t,v=new _t,b=new _t,w=new _t,g=new _t,y=new _t,k=new _t,T=new _t,x=new _t,C=new _t;s=s!==void 0?s:12,n=n!==void 0?n:.001,c=c!==void 0?c:0,t=pt(t);const O=t.length;if(O<2)return 0;const I=t[0].equals(t[O-1]);let M,V=t[0],W;const G=e.strokeWidth/2,Y=1/(O-1);let j=0,z,Z,Q,et,R=!1,F=0,S=c*3,P=c*2;H(t[0],t[1],l).multiplyScalar(G),m.copy(t[0]).sub(l),v.copy(t[0]).add(l),b.copy(m),w.copy(v);for(let K=1;K=n&&A.push(K[E]);return A.push(K[K.length-1]),A}}}function Uf(i,t){if(Object.is(i,t))return!0;if(typeof i!="object"||i===null||typeof t!="object"||t===null)return!1;const e=Object.keys(i);if(e.length!==Object.keys(t).length)return!1;for(let s=0;sc,...a}){const{setEvents:c,camera:l,raycaster:u,gl:h,controls:d,size:p,get:_}=It(),[f,m]=D.useState(!1),[v,b]=D.useReducer((k,{object:T,shift:x})=>T===void 0?[]:Array.isArray(T)?T:x?k.includes(T)?k.filter(C=>C!==T):[T,...k]:k[0]===T?[]:[T],[]);D.useEffect(()=>void(s==null?void 0:s(v)),[v]);const w=D.useCallback(k=>{k.stopPropagation(),b({object:o([k.object])[0],shift:t&&k.shiftKey})},[]),g=D.useCallback(k=>!f&&b({}),[f]),y=D.useRef(null);return D.useEffect(()=>{if(!i||!t)return;const k=new Vf(l,y.current),T=document.createElement("div");T.style.pointerEvents="none",T.style.border=n,T.style.backgroundColor=r,T.style.position="fixed";const x=new _t,C=new _t,O=new _t,I=_().events.enabled,M=d==null?void 0:d.enabled;let V=!1;function W(R,F){const{offsetX:S,offsetY:P}=R,{width:H,height:N}=p;F.set(S/H*2-1,-(P/N)*2+1)}function G(R){var F;d&&(d.enabled=!1),c({enabled:!1}),V=!0,(F=h.domElement.parentElement)==null||F.appendChild(T),T.style.left=`${R.clientX}px`,T.style.top=`${R.clientY}px`,T.style.width="0px",T.style.height="0px",x.x=R.clientX,x.y=R.clientY}function Y(R){O.x=Math.max(x.x,R.clientX),O.y=Math.max(x.y,R.clientY),C.x=Math.min(x.x,R.clientX),C.y=Math.min(x.y,R.clientY),T.style.left=`${C.x}px`,T.style.top=`${C.y}px`,T.style.width=`${O.x-C.x}px`,T.style.height=`${O.y-C.y}px`}function j(){if(V){var R;d&&(d.enabled=M),c({enabled:I}),V=!1,(R=T.parentElement)==null||R.removeChild(T)}}function z(R){R.shiftKey&&(G(R),W(R,k.startPoint))}let Z=[];function Q(R){if(V){Y(R),W(R,k.endPoint);const F=k.select().sort(S=>S.uuid).filter(S=>S.isMesh);Uf(F,Z)||(Z=F,b({object:o(F)}))}}function et(R){V&&j()}return document.addEventListener("pointerdown",z,{passive:!0}),document.addEventListener("pointermove",Q,{passive:!0,capture:!0}),document.addEventListener("pointerup",et,{passive:!0}),()=>{document.removeEventListener("pointerdown",z),document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",et)}},[p.width,p.height,u,l,d,h]),D.createElement("group",Se({ref:y,onClick:w,onPointerOver:()=>m(!0),onPointerOut:()=>m(!1),onPointerMissed:g},a),D.createElement(zf.Provider,{value:v},e))}const eu=D.forwardRef(function({follow:t=!0,lockX:e=!1,lockY:s=!1,lockZ:n=!1,...r},o){const a=D.useRef();return Pe(({camera:c})=>{if(!t||!a.current)return;const l=a.current.rotation.clone();c.getWorldQuaternion(a.current.quaternion),e&&(a.current.rotation.x=l.x),s&&(a.current.rotation.y=l.y),n&&(a.current.rotation.z=l.z)}),D.createElement("group",Se({ref:ho([a,o])},r))}),Uc=i=>i===Object(i)&&!Array.isArray(i)&&typeof i!="function";function Qs(i,t){const e=It(n=>n.gl),s=fo(mo,Uc(i)?Object.values(i):i);if(D.useLayoutEffect(()=>{t==null||t(s)},[t]),D.useEffect(()=>{(Array.isArray(s)?s:[s]).forEach(e.initTexture)},[e,s]),Uc(i)){const n=Object.keys(i),r={};return n.forEach(o=>Object.assign(r,{[o]:s[n.indexOf(o)]})),r}else return s}Qs.preload=i=>fo.preload(mo,i);Qs.clear=i=>fo.clear(mo,i);const Bf=D.forwardRef(function({src:t,skipFill:e,skipStrokes:s,fillMaterial:n,strokeMaterial:r,fillMeshProps:o,strokeMeshProps:a,...c},l){const u=fo(ki,t.startsWith("s?[]:u.paths.map(d=>{var p;return((p=d.userData)==null?void 0:p.style.stroke)===void 0||d.userData.style.stroke==="none"?null:d.subPaths.map(_=>ki.pointsToStroke(_.getPoints(),d.userData.style))}),[u,s]);return D.useEffect(()=>()=>h.forEach(d=>d&&d.map(p=>p.dispose())),[h]),D.createElement("object3D",Se({ref:l},c),D.createElement("object3D",{scale:[1,-1,1]},u.paths.map((d,p)=>{var _,f;return D.createElement(D.Fragment,{key:p},!e&&((_=d.userData)==null?void 0:_.style.fill)!==void 0&&d.userData.style.fill!=="none"&&ki.createShapes(d).map((m,v)=>D.createElement("mesh",Se({key:v},o),D.createElement("shapeGeometry",{args:[m]}),D.createElement("meshBasicMaterial",Se({color:d.userData.style.fill,opacity:d.userData.style.fillOpacity,transparent:!0,side:na,depthWrite:!1},n)))),!s&&((f=d.userData)==null?void 0:f.style.stroke)!==void 0&&d.userData.style.stroke!=="none"&&d.subPaths.map((m,v)=>D.createElement("mesh",Se({key:v,geometry:h[p][v]},a),D.createElement("meshBasicMaterial",Se({color:d.userData.style.stroke,opacity:d.userData.style.strokeOpacity,transparent:!0,side:na,depthWrite:!1},r)))))})))});/*! * camera-controls * https://github.com/yomotsu/camera-controls * (c) 2017 @yomotsu * Released under the MIT License. - */const ct={LEFT:1,RIGHT:2,MIDDLE:4},W=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}),vn={NONE:0,IN:1,OUT:-1};function Ws(i){return i.isPerspectiveCamera}function ws(i){return i.isOrthographicCamera}const xn=Math.PI*2,Wc=Math.PI/2,lu=1e-5,hi=Math.PI/180;function Fe(i,t,e){return Math.max(t,Math.min(e,i))}function Et(i,t=lu){return Math.abs(i)0==p>u&&(p=u,e.value=(p-u)/r),p}function Gc(i,t,e,s,n=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=t.x,h=t.y,d=t.z,p=i.x-u,_=i.y-h,f=i.z-d;const m=u,v=h,b=d,w=n*s,g=w*w,y=p*p+_*_+f*f;if(y>g){const Y=Math.sqrt(y);p=p/Y*w,_=_/Y*w,f=f/Y*w}u=i.x-p,h=i.y-_,d=i.z-f;const k=(e.x+a*p)*r,T=(e.y+a*_)*r,x=(e.z+a*f)*r;e.x=(e.x-a*k)*l,e.y=(e.y-a*T)*l,e.z=(e.z-a*x)*l,o.x=u+(p+k)*l,o.y=h+(_+T)*l,o.z=d+(f+x)*l;const C=m-i.x,O=v-i.y,P=b-i.z,M=o.x-m,V=o.y-v,B=o.z-b;return C*M+O*V+P*B>0&&(o.x=m,o.y=v,o.z=b,e.x=(o.x-m)/r,e.y=(o.y-v)/r,e.z=(o.z-b)/r),o}function zo(i,t){t.set(0,0),i.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=i.length,t.y/=i.length}function Bo(i,t){return ws(i)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}class e0{constructor(){this._listeners={}}addEventListener(t,e){const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const n=this._listeners[t];if(n!==void 0){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}removeAllEventListeners(t){if(!t){this._listeners={};return}Array.isArray(this._listeners[t])&&(this._listeners[t].length=0)}dispatchEvent(t){const s=this._listeners[t.type];if(s!==void 0){t.target=this;const n=s.slice(0);for(let r=0,o=n.length;r{},this._enabled=!0,this._state=W.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=vn.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new at.Vector3,this._focalOffsetVelocity=new at.Vector3,this._zoomVelocity={value:0},this._truckInternal=(g,y,k)=>{let T,x;if(Ws(this._camera)){const C=ht.copy(this._camera.position).sub(this._target),O=this._camera.getEffectiveFOV()*hi,P=C.length()*Math.tan(O*.5);T=this.truckSpeed*g*P/this._elementRect.height,x=this.truckSpeed*y*P/this._elementRect.height}else if(ws(this._camera)){const C=this._camera;T=g*(C.right-C.left)/C.zoom/this._elementRect.width,x=y*(C.top-C.bottom)/C.zoom/this._elementRect.height}else return;this.verticalDragToForward?(k?this.setFocalOffset(this._focalOffsetEnd.x+T,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(T,0,!0),this.forward(-x,!0)):k?this.setFocalOffset(this._focalOffsetEnd.x+T,this._focalOffsetEnd.y+x,this._focalOffsetEnd.z,!0):this.truck(T,x,!0)},this._rotateInternal=(g,y)=>{const k=xn*this.azimuthRotateSpeed*g/this._elementRect.height,T=xn*this.polarRotateSpeed*y/this._elementRect.height;this.rotate(k,T,!0)},this._dollyInternal=(g,y,k)=>{const T=Math.pow(.95,-g*this.dollySpeed),x=this._sphericalEnd.radius,C=this._sphericalEnd.radius*T,O=Fe(C,this.minDistance,this.maxDistance),P=O-C;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(C,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(P,!0),this._dollyToNoClamp(O,!0)):this._dollyToNoClamp(O,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?C:O)-x,this._dollyControlCoord.set(y,k)),this._lastDollyDirection=Math.sign(-g)},this._zoomInternal=(g,y,k)=>{const T=Math.pow(.95,g*this.dollySpeed),x=this._zoom,C=this._zoom*T;this.zoomTo(C,!0),this.dollyToCursor&&(this._changedZoom+=C-x,this._dollyControlCoord.set(y,k))},typeof at>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new at.Quaternion().setFromUnitVectors(this._camera.up,wr),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=W.NONE,this._target=new at.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new at.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new at.Spherical().setFromVector3(ht.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 at.Vector3,new at.Vector3,new at.Vector3,new at.Vector3],this._updateNearPlaneCorners(),this._boundary=new at.Box3(new at.Vector3(-1/0,-1/0,-1/0),new at.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 at.Vector2,this.mouseButtons={left:W.ROTATE,middle:W.DOLLY,right:W.TRUCK,wheel:Ws(this._camera)?W.DOLLY:ws(this._camera)?W.ZOOM:W.NONE},this.touches={one:W.TOUCH_ROTATE,two:Ws(this._camera)?W.TOUCH_DOLLY_TRUCK:ws(this._camera)?W.TOUCH_ZOOM_TRUCK:W.NONE,three:W.TOUCH_TRUCK};const s=new at.Vector2,n=new at.Vector2,r=new at.Vector2,o=g=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const T=this._domElement.getBoundingClientRect(),x=g.clientX/T.width,C=g.clientY/T.height;if(xthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const y=g.pointerType!=="mouse"?null:(g.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(g.buttons&ct.MIDDLE)===ct.MIDDLE?ct.MIDDLE:(g.buttons&ct.RIGHT)===ct.RIGHT?ct.RIGHT:null;if(y!==null){const T=this._findPointerByMouseButton(y);T&&this._disposePointer(T)}if((g.buttons&ct.LEFT)===ct.LEFT&&this._lockedPointer)return;const k={pointerId:g.pointerId,clientX:g.clientX,clientY:g.clientY,deltaX:0,deltaY:0,mouseButton:y};this._activePointers.push(k),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,f(g)},a=g=>{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 T=this._domElement.getBoundingClientRect(),x=g.clientX/T.width,C=g.clientY/T.height;if(xthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const y=(g.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(g.buttons&ct.MIDDLE)===ct.MIDDLE?ct.MIDDLE:(g.buttons&ct.RIGHT)===ct.RIGHT?ct.RIGHT:null;if(y!==null){const T=this._findPointerByMouseButton(y);T&&this._disposePointer(T)}const k={pointerId:1,clientX:g.clientX,clientY:g.clientY,deltaX:0,deltaY:0,mouseButton:(g.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(g.buttons&ct.MIDDLE)===ct.LEFT?ct.MIDDLE:(g.buttons&ct.RIGHT)===ct.LEFT?ct.RIGHT:null};this._activePointers.push(k),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,f(g)},c=g=>{g.cancelable&&g.preventDefault();const y=g.pointerId,k=this._lockedPointer||this._findPointerById(y);if(k){if(k.clientX=g.clientX,k.clientY=g.clientY,k.deltaX=g.movementX,k.deltaY=g.movementY,this._state=0,g.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&&(g.buttons&ct.LEFT)===ct.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(g.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(g.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=g=>{const y=this._lockedPointer||this._findPointerById(1);y&&(y.clientX=g.clientX,y.clientY=g.clientY,y.deltaX=g.movementX,y.deltaY=g.movementY,this._state=0,(this._lockedPointer||(g.buttons&ct.LEFT)===ct.LEFT)&&(this._state=this._state|this.mouseButtons.left),(g.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(g.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right),m())},u=g=>{const y=this._findPointerById(g.pointerId);if(!(y&&y===this._lockedPointer)){if(y&&this._disposePointer(y),g.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=W.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=W.NONE;v()}},h=()=>{const g=this._findPointerById(1);g&&g===this._lockedPointer||(g&&this._disposePointer(g),this._state=W.NONE,v())};let d=-1;const p=g=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===W.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const C=this._domElement.getBoundingClientRect(),O=g.clientX/C.width,P=g.clientY/C.height;if(Othis._interactiveArea.right||Pthis._interactiveArea.bottom)return}if(g.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===W.ROTATE||this.mouseButtons.wheel===W.TRUCK){const C=performance.now();d-C<1e3&&this._getClientRect(this._elementRect),d=C}const y=n0?-1:-3,k=g.deltaMode===1?g.deltaY/y:g.deltaY/(y*10),T=this.dollyToCursor?(g.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,x=this.dollyToCursor?(g.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case W.ROTATE:{this._rotateInternal(g.deltaX,g.deltaY),this._isUserControllingRotate=!0;break}case W.TRUCK:{this._truckInternal(g.deltaX,g.deltaY,!1),this._isUserControllingTruck=!0;break}case W.OFFSET:{this._truckInternal(g.deltaX,g.deltaY,!0),this._isUserControllingOffset=!0;break}case W.DOLLY:{this._dollyInternal(-k,T,x),this._isUserControllingDolly=!0;break}case W.ZOOM:{this._zoomInternal(-k,T,x),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},_=g=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===la.ACTION.NONE){const y=g instanceof PointerEvent?g.pointerId:(g instanceof MouseEvent,0),k=this._findPointerById(y);k&&this._disposePointer(k),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}g.preventDefault()}},f=g=>{if(!this._enabled)return;if(zo(this._activePointers,ce),this._getClientRect(this._elementRect),s.copy(ce),n.copy(ce),this._activePointers.length>=2){const k=ce.x-this._activePointers[1].clientX,T=ce.y-this._activePointers[1].clientY,x=Math.sqrt(k*k+T*T);r.set(0,x);const C=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,O=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;n.set(C,O)}if(this._state=0,!g)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in g&&g.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&&(g.buttons&ct.LEFT)===ct.LEFT&&(this._state=this._state|this.mouseButtons.left),(g.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(g.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&W.ROTATE)===W.ROTATE||(this._state&W.TOUCH_ROTATE)===W.TOUCH_ROTATE||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_ZOOM_ROTATE)===W.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&W.TRUCK)===W.TRUCK||(this._state&W.TOUCH_TRUCK)===W.TOUCH_TRUCK||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&W.DOLLY)===W.DOLLY||(this._state&W.TOUCH_DOLLY)===W.TOUCH_DOLLY||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&W.ZOOM)===W.ZOOM||(this._state&W.TOUCH_ZOOM)===W.TOUCH_ZOOM||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&W.OFFSET)===W.OFFSET||(this._state&W.TOUCH_OFFSET)===W.TOUCH_OFFSET||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,zo(this._activePointers,ce);const y=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,k=y?-y.deltaX:n.x-ce.x,T=y?-y.deltaY:n.y-ce.y;if(n.copy(ce),((this._state&W.ROTATE)===W.ROTATE||(this._state&W.TOUCH_ROTATE)===W.TOUCH_ROTATE||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(k,T),this._isUserControllingRotate=!0),(this._state&W.DOLLY)===W.DOLLY||(this._state&W.ZOOM)===W.ZOOM){const x=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,O=this.dollyDragInverted?-1:1;(this._state&W.DOLLY)===W.DOLLY?(this._dollyInternal(O*T*Tr,x,C),this._isUserControllingDolly=!0):(this._zoomInternal(O*T*Tr,x,C),this._isUserControllingZoom=!0)}if((this._state&W.TOUCH_DOLLY)===W.TOUCH_DOLLY||(this._state&W.TOUCH_ZOOM)===W.TOUCH_ZOOM||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_ZOOM_ROTATE)===W.TOUCH_ZOOM_ROTATE){const x=ce.x-this._activePointers[1].clientX,C=ce.y-this._activePointers[1].clientY,O=Math.sqrt(x*x+C*C),P=r.y-O;r.set(0,O);const M=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,V=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&W.TOUCH_DOLLY)===W.TOUCH_DOLLY||(this._state&W.TOUCH_DOLLY_ROTATE)===W.TOUCH_DOLLY_ROTATE||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET?(this._dollyInternal(P*Tr,M,V),this._isUserControllingDolly=!0):(this._zoomInternal(P*Tr,M,V),this._isUserControllingZoom=!0)}((this._state&W.TRUCK)===W.TRUCK||(this._state&W.TOUCH_TRUCK)===W.TOUCH_TRUCK||(this._state&W.TOUCH_DOLLY_TRUCK)===W.TOUCH_DOLLY_TRUCK||(this._state&W.TOUCH_ZOOM_TRUCK)===W.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(k,T,!1),this._isUserControllingTruck=!0),((this._state&W.OFFSET)===W.OFFSET||(this._state&W.TOUCH_OFFSET)===W.TOUCH_OFFSET||(this._state&W.TOUCH_DOLLY_OFFSET)===W.TOUCH_DOLLY_OFFSET||(this._state&W.TOUCH_ZOOM_OFFSET)===W.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(k,T,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},v=()=>{zo(this._activePointers,ce),n.copy(ce),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",b),this._domElement.ownerDocument.addEventListener("pointerlockerror",w),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",u),f())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",b),this._domElement.ownerDocument.removeEventListener("pointerlockerror",w))};const b=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},w=()=>{this.unlockPointer()};this._addAllEventListeners=g=>{this._domElement=g,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),i0&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",u),this._domElement.addEventListener("wheel",p,{passive:!1}),this._domElement.addEventListener("contextmenu",_)},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",p,{passive:!1}),this._domElement.removeEventListener("contextmenu",_),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",b),this._domElement.ownerDocument.removeEventListener("pointerlockerror",w))},this.cancel=()=>{this._state!==W.NONE&&(this._state=W.NONE,this._activePointers.length=0,v())},e&&this.connect(e),this.update(0)}get camera(){return this._camera}set camera(t){this._camera=t,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._domElement&&(t?(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(t){this._spherical.radius===t&&this._sphericalEnd.radius===t||(this._spherical.radius=t,this._sphericalEnd.radius=t,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(t){this._spherical.theta===t&&this._sphericalEnd.theta===t||(this._spherical.theta=t,this._sphericalEnd.theta=t,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(t){this._spherical.phi===t&&this._sphericalEnd.phi===t||(this._spherical.phi=t,this._sphericalEnd.phi=t,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(t){this._boundaryEnclosesCamera=t,this._needsUpdate=!0}set interactiveArea(t){this._interactiveArea.width=Fe(t.width,0,1),this._interactiveArea.height=Fe(t.height,0,1),this._interactiveArea.x=Fe(t.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Fe(t.y,0,1-this._interactiveArea.height)}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}rotate(t,e,s=!1){return this.rotateTo(this._sphericalEnd.theta+t,this._sphericalEnd.phi+e,s)}rotateAzimuthTo(t,e=!1){return this.rotateTo(t,this._sphericalEnd.phi,e)}rotatePolarTo(t,e=!1){return this.rotateTo(this._sphericalEnd.theta,t,e)}rotateTo(t,e,s=!1){this._isUserControllingRotate=!1;const n=Fe(t,this.minAzimuthAngle,this.maxAzimuthAngle),r=Fe(e,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=n,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||gt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(t,e=!1){return this.dollyTo(this._sphericalEnd.radius-t,e)}dollyTo(t,e=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=vn.NONE,this._changedDolly=0,this._dollyToNoClamp(Fe(t,this.minDistance,this.maxDistance),e)}_dollyToNoClamp(t,e=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=gt(o,this._spherical.radius);if(!(s>t)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(t,o)}else this._sphericalEnd.radius=t;this._needsUpdate=!0,e||(this._spherical.radius=this._sphericalEnd.radius);const r=!e||gt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(t,e=!1){this._targetEnd.add(this._getCameraDirection(pi).multiplyScalar(t)),e||this._target.copy(this._targetEnd);const s=!e||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(t,e=!1){return this.zoomTo(this._zoomEnd+t,e)}zoomTo(t,e=!1){this._isUserControllingZoom=!1,this._zoomEnd=Fe(t,this.minZoom,this.maxZoom),this._needsUpdate=!0,e||(this._zoom=this._zoomEnd);const s=!e||gt(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(t,e,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(t,e,s)}truck(t,e,s=!1){this._camera.updateMatrix(),$e.setFromMatrixColumn(this._camera.matrix,0),Ze.setFromMatrixColumn(this._camera.matrix,1),$e.multiplyScalar(t),Ze.multiplyScalar(-e);const n=ht.copy($e).add(Ze),r=mt.copy(this._targetEnd).add(n);return this.moveTo(r.x,r.y,r.z,s)}forward(t,e=!1){ht.setFromMatrixColumn(this._camera.matrix,0),ht.crossVectors(this._camera.up,ht),ht.multiplyScalar(t);const s=mt.copy(this._targetEnd).add(ht);return this.moveTo(s.x,s.y,s.z,e)}elevate(t,e=!1){return ht.copy(this._camera.up).multiplyScalar(t),this.moveTo(this._targetEnd.x+ht.x,this._targetEnd.y+ht.y,this._targetEnd.z+ht.z,e)}moveTo(t,e,s,n=!1){this._isUserControllingTruck=!1;const r=ht.set(t,e,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,n||this._target.copy(this._targetEnd);const o=!n||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(t,e,s,n=!1){const a=ht.set(t,e,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(a.x,a.y,a.z,n)}fitToBox(t,e,{cover:s=!1,paddingLeft:n=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const c=[],l=t.isBox3?Tn.copy(t):Tn.setFromObject(t);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=Hc(this._sphericalEnd.theta,Wc),h=Hc(this._sphericalEnd.phi,Wc);c.push(this.rotateTo(u,h,e));const d=ht.setFromSpherical(this._sphericalEnd).normalize(),p=Qc.setFromUnitVectors(d,qo),_=gt(Math.abs(d.y),1);_&&p.multiply(Ho.setFromAxisAngle(wr,u)),p.multiply(this._yAxisUpSpaceInverse);const f=Xc.makeEmpty();mt.copy(l.min).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.min).setX(l.max.x).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.min).setY(l.max.y).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).setZ(l.min.z).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.min).setZ(l.max.z).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).setY(l.min.y).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).setX(l.min.x).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).applyQuaternion(p),f.expandByPoint(mt),f.min.x-=n,f.min.y-=o,f.max.x+=r,f.max.y+=a,p.setFromUnitVectors(qo,d),_&&p.premultiply(Ho.invert()),p.premultiply(this._yAxisUpSpace);const m=f.getSize(ht),v=f.getCenter(mt).applyQuaternion(p);if(Ws(this._camera)){const b=this.getDistanceToFitBox(m.x,m.y,m.z,s);c.push(this.moveTo(v.x,v.y,v.z,e)),c.push(this.dollyTo(b,e)),c.push(this.setFocalOffset(0,0,0,e))}else if(ws(this._camera)){const b=this._camera,w=b.right-b.left,g=b.top-b.bottom,y=s?Math.max(w/m.x,g/m.y):Math.min(w/m.x,g/m.y);c.push(this.moveTo(v.x,v.y,v.z,e)),c.push(this.zoomTo(y,e)),c.push(this.setFocalOffset(0,0,0,e))}return Promise.all(c)}fitToSphere(t,e){const s=[],r=t instanceof at.Sphere?Wo.copy(t):la.createBoundingSphere(t,Wo);if(s.push(this.moveTo(r.center.x,r.center.y,r.center.z,e)),Ws(this._camera)){const o=this.getDistanceToFitSphere(r.radius);s.push(this.dollyTo(o,e))}else if(ws(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,e))}return s.push(this.setFocalOffset(0,0,0,e)),Promise.all(s)}setLookAt(t,e,s,n,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=vn.NONE,this._changedDolly=0;const c=mt.set(n,r,o),l=ht.set(t,e,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||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold)&>(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&>(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(t,e,s,n,r,o,a,c,l,u,h,d,p,_=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=vn.NONE,this._changedDolly=0;const f=ht.set(n,r,o),m=mt.set(t,e,s);Ce.setFromVector3(m.sub(f).applyQuaternion(this._yAxisUpSpace));const v=kn.set(u,h,d),b=mt.set(a,c,l);mi.setFromVector3(b.sub(v).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(f.lerp(v,p));const w=mi.theta-Ce.theta,g=mi.phi-Ce.phi,y=mi.radius-Ce.radius;this._sphericalEnd.set(Ce.radius+y*p,Ce.phi+g*p,Ce.theta+w*p),this.normalizeRotations(),this._needsUpdate=!0,_||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const k=!_||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold)&>(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&>(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(k)}setPosition(t,e,s,n=!1){return this.setLookAt(t,e,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,n)}setTarget(t,e,s,n=!1){const r=this.getPosition(ht),o=this.setLookAt(r.x,r.y,r.z,t,e,s,n);return this._sphericalEnd.phi=Fe(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(t,e,s,n=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(t,e,s),this._needsUpdate=!0,n||this._focalOffset.copy(this._focalOffsetEnd);const r=!n||gt(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&>(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&>(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(t,e,s){this._camera.updateMatrixWorld(),$e.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Ze.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Hs.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const n=ht.set(t,e,s),r=n.distanceTo(this._camera.position),o=n.sub(this._camera.position);$e.multiplyScalar(o.x),Ze.multiplyScalar(o.y),Hs.multiplyScalar(o.z),ht.copy($e).add(Ze).add(Hs),ht.z=ht.z+r,this.dollyTo(r,!1),this.setFocalOffset(-ht.x,ht.y,-ht.z,!1),this.moveTo(t,e,s,!1)}setBoundary(t){if(!t){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(t),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(t,e,s,n){if(t===null){this._viewport=null;return}this._viewport=this._viewport||new at.Vector4,typeof t=="number"?this._viewport.set(t,e,s,n):this._viewport.copy(t)}getDistanceToFitBox(t,e,s,n=!1){if(Bo(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=t/e,o=this._camera.getEffectiveFOV()*hi,a=this._camera.aspect;return((n?r>a:re.pointerId===t)}_findPointerByMouseButton(t){return this._activePointers.find(e=>e.mouseButton===t)}_disposePointer(t){this._activePointers.splice(this._activePointers.indexOf(t),1)}_encloseToBoundary(t,e,s){const n=e.lengthSq();if(n===0)return t;const r=mt.copy(e).add(t),a=this._boundary.clampPoint(r,kn).sub(r),c=a.lengthSq();if(c===0)return t.add(e);if(c===n)return t;if(s===0)return t.add(e).add(a);{const l=1+s*c/e.dot(a);return t.add(mt.copy(e).multiplyScalar(l)).add(a.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Ws(this._camera)){const t=this._camera,e=t.near,s=t.getEffectiveFOV()*hi,n=Math.tan(s*.5)*e,r=n*t.aspect;this._nearPlaneCorners[0].set(-r,-n,0),this._nearPlaneCorners[1].set(r,-n,0),this._nearPlaneCorners[2].set(r,n,0),this._nearPlaneCorners[3].set(-r,n,0)}else if(ws(this._camera)){const t=this._camera,e=1/t.zoom,s=t.left*e,n=t.right*e,r=t.top*e,o=t.bottom*e;this._nearPlaneCorners[0].set(s,r,0),this._nearPlaneCorners[1].set(n,r,0),this._nearPlaneCorners[2].set(n,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let t=1/0;if(!(this.colliderMeshes.length>=1)||Bo(this._camera,"_collisionTest"))return t;const s=this._getTargetDirection(pi);Go.lookAt(Yc,s,this._camera.up);for(let n=0;n<4;n++){const r=mt.copy(this._nearPlaneCorners[n]);r.applyMatrix4(Go);const o=kn.addVectors(this._target,r);br.set(o,s),br.far=this._spherical.radius+1;const a=br.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{const s=()=>{this.removeEventListener("rest",s),e()};this.addEventListener("rest",s)}))}_addAllEventListeners(t){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(t){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(t){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(t,e=new at.Sphere){const s=e,n=s.center;Tn.makeEmpty(),t.traverseVisible(o=>{o.isMesh&&Tn.expandByObject(o)}),Tn.getCenter(n);let r=0;return t.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{D.useMemo(()=>{Yo.install({THREE:Df}),La({CameraControlsImpl:Yo})},[]);const{camera:e,domElement:s,makeDefault:n,onStart:r,onEnd:o,onChange:a,regress:c,...l}=i,u=It(y=>y.camera),h=It(y=>y.gl),d=It(y=>y.invalidate),p=It(y=>y.events),_=It(y=>y.setEvents),f=It(y=>y.set),m=It(y=>y.get),v=It(y=>y.performance),b=e||u,w=s||p.connected||h.domElement,g=D.useMemo(()=>new Yo(b),[b]);return be((y,k)=>{g.enabled&&g.update(k)},-1),D.useEffect(()=>(g.connect(w),()=>void g.disconnect()),[w,g]),D.useEffect(()=>{const y=x=>{d(),c&&v.regress(),a&&a(x)},k=x=>{r&&r(x)},T=x=>{o&&o(x)};return g.addEventListener("update",y),g.addEventListener("controlstart",k),g.addEventListener("controlend",T),()=>{g.removeEventListener("update",y),g.removeEventListener("controlstart",k),g.removeEventListener("controlend",T)}},[g,r,o,d,_,c,a]),D.useEffect(()=>{if(n){const y=m().controls;return f({controls:g}),()=>f({controls:y})}},[n,g]),D.createElement("primitive",Oe({ref:t,object:g},l))});ni.func.isRequired,ni.arrayOf(ni.oneOfType([ni.element,ni.func])).isRequired;const Kc=new ir,Jc=new ir,Cr=[],_i=new au;class o0 extends If{constructor(){super(),this.color=new Ua("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var t;return(t=this.instance.current)==null?void 0:t.geometry}raycast(t,e){const s=this.instance.current;if(!s||!s.geometry||!s.material)return;_i.geometry=s.geometry;const n=s.matrixWorld,r=s.userData.instances.indexOf(this.instanceKey);if(!(r===-1||r>s.count)){s.getMatrixAt(r,Kc),Jc.multiplyMatrices(n,Kc),_i.matrixWorld=Jc,s.material instanceof Nf?_i.material.side=s.material.side:_i.material.side=s.material[0].side,_i.raycast(t,Cr);for(let o=0,a=Cr.length;o{D.useMemo(()=>La({PositionMesh:o0}),[]);const n=D.useRef(),{subscribe:r,getParent:o}=D.useContext(i||hu);return D.useLayoutEffect(()=>r(n),[]),D.createElement("positionMesh",Oe({instance:o(),instanceKey:n,ref:yo([s,n])},e),t)}),c0=D.forwardRef(({children:i,range:t,limit:e=1e3,frames:s=1/0,...n},r)=>{const[{context:o,instance:a}]=D.useState(()=>{const m=D.createContext(null);return{context:m,instance:D.forwardRef((v,b)=>D.createElement(du,Oe({context:m},v,{ref:b})))}}),c=D.useRef(null),[l,u]=D.useState([]),[[h,d]]=D.useState(()=>{const m=new Float32Array(e*16);for(let v=0;v1))]});D.useEffect(()=>{c.current.instanceMatrix.needsUpdate=!0});let p=0,_=0;be(()=>{if(s===1/0||p({getParent:()=>c,subscribe:m=>(u(v=>[...v,m]),()=>u(v=>v.filter(b=>b.current!==m.current)))}),[]);return D.createElement("instancedMesh",Oe({userData:{instances:l},matrixAutoUpdate:!1,ref:yo([r,c]),args:[null,null,0],raycast:()=>null},n),D.createElement("instancedBufferAttribute",{attach:"instanceMatrix",count:h.length/16,array:h,itemSize:16,usage:Uc}),D.createElement("instancedBufferAttribute",{attach:"instanceColor",count:d.length/3,array:d,itemSize:3,usage:Uc}),typeof i=="function"?D.createElement(o.Provider,{value:f},i(a)):D.createElement(hu.Provider,{value:f},i))}),fu=D.createContext(null),l0=D.forwardRef((i,t)=>{D.useMemo(()=>La({SegmentObject:u0}),[]);const{limit:e=1e3,lineWidth:s=1,children:n,...r}=i,[o,a]=D.useState([]),[c]=D.useState(()=>new Gd),[l]=D.useState(()=>new Yd),[u]=D.useState(()=>new $d),[h]=D.useState(()=>new _t(512,512)),[d]=D.useState(()=>Array(e*6).fill(0)),[p]=D.useState(()=>Array(e*6).fill(0)),_=D.useMemo(()=>({subscribe:f=>(a(m=>[...m,f]),()=>a(m=>m.filter(v=>v.current!==f.current)))}),[]);return be(()=>{for(let m=0;mi instanceof rt?i:new rt(...typeof i=="number"?[i,i,i]:i),h0=D.forwardRef(({color:i,start:t,end:e},s)=>{const n=D.useContext(fu);if(!n)throw"Segment must used inside Segments component.";const r=D.useRef(null);return D.useLayoutEffect(()=>n.subscribe(r),[]),D.createElement("segmentObject",{ref:yo([r,s]),color:i,start:rl(t),end:rl(e)})});function d0({all:i,scene:t,camera:e}){const s=It(({gl:o})=>o),n=It(({camera:o})=>o),r=It(({scene:o})=>o);return D.useLayoutEffect(()=>{const o=[];i&&(t||r).traverse(l=>{l.visible===!1&&(o.push(l),l.visible=!0)}),s.compile(t||r,e||n);const a=new Rf(128);new Ff(.01,1e5,a).update(s,t||r),a.dispose(),o.forEach(l=>l.visible=!1)},[]),null}function f0({pixelated:i}){const t=It(o=>o.gl),e=It(o=>o.internal.active),s=It(o=>o.performance.current),n=It(o=>o.viewport.initialDpr),r=It(o=>o.setDpr);return D.useEffect(()=>{const o=t.domElement;return()=>{e&&r(n),i&&o&&(o.style.imageRendering="auto")}},[]),D.useEffect(()=>{r(s*n),i&&t.domElement&&(t.domElement.style.imageRendering=s===1?"auto":"pixelated")},[s]),null}function p0(){const i=It(s=>s.get),t=It(s=>s.setEvents),e=It(s=>s.performance.current);return D.useEffect(()=>{const s=i().events.enabled;return()=>t({enabled:s})},[]),D.useEffect(()=>t({enabled:e===1}),[e]),null}const pu=D.createContext(null);function m0({children:i,enabled:t=!0}){const[e,s]=D.useState([]),n=D.useMemo(()=>({selected:e,select:s,enabled:t}),[e,s,t]);return L.jsx(pu.Provider,{value:n,children:i})}function _0({enabled:i=!1,children:t,...e}){const s=D.useRef(null),n=D.useContext(pu);return D.useEffect(()=>{if(n&&i){let r=!1;const o=[];if(s.current.traverse(a=>{a.type==="Mesh"&&o.push(a),n.selected.indexOf(a)===-1&&(r=!0)}),r)return n.select(a=>[...a,...o]),()=>{n.select(a=>a.filter(c=>!o.includes(c)))}}},[i,t,n]),L.jsx("group",{ref:s,...e,children:t})}const g0={isUserDragging:!1,isUserScrolling:!1,userMovedCamera:!1,isUserScrollingOnHtmlPanel:!1},Os=Kl(i=>({...g0,setIsUserDragging:t=>i({isUserDragging:t}),setIsUserScrolling:t=>i({isUserScrolling:t}),setUserMovedCamera:t=>i({userMovedCamera:t}),setIsUserScrollingOnHtmlPanel:t=>i({isUserScrollingOnHtmlPanel:t})})),y0=()=>{const[i,t]=D.useState(""),e=D.useRef(null),{fetchData:s,setAbortRequests:n,seedQuestions:r}=Us(g=>g),[o]=tu(g=>[g.setBudget]),{setUniverseQuestionIsOpen:a,setSidebarOpen:c,setShowCollapseButton:l}=er(g=>({setUniverseQuestionIsOpen:g.setUniverseQuestionIsOpen,setSidebarOpen:g.setSidebarOpen,setShowCollapseButton:g.setShowCollapseButton})),u=Fd(g=>g.resetAiSummaryAnswer),[h,d]=D.useState([]);D.useEffect(()=>{r&&d(b(r).slice(0,4))},[r]),D.useEffect(()=>{e.current&&e.current.focus()},[]);const p=async g=>{g&&(u(),a(),c(!0),l(!0)),await s(o,n,g)},_=!!i.trim().length,f=async g=>{g.keyCode===13&&g.shiftKey===!1&&_&&(g.preventDefault(),p(i))},m=async g=>{t(g),await p(g)},v=()=>{a(),c(!0),l(!0)},b=g=>{const y=[...g];let k=y.length-1;for(;k>0;){const T=Math.floor(Math.random()*(k+1));[y[k],y[T]]=[y[T],y[k]],k-=1}return y},w=!!i&&i.trim().length>0;return L.jsxs(k0,{children:["Ideas have shapes",L.jsxs(x0,{onKeyDown:f,py:12,tabIndex:-1,children:[L.jsx(v0,{ref:e,onChange:g=>t(g.target.value),placeholder:"What do you want to know?",value:i}),L.jsx(T0,{color:"secondary",disabled:!w,onClick:()=>p(i),variant:"contained",children:w?L.jsxs(L.Fragment,{children:["Search ",L.jsx(Fc,{})]}):L.jsx(Fc,{})})]}),h.length>0&&L.jsx(b0,{children:h.map(g=>L.jsxs(C0,{onClick:()=>m(g),children:[L.jsx(nf,{}),g]},g))}),L.jsx(w0,{"data-testid":"explore-graph-btn",onClick:v,startIcon:L.jsx(rf,{}),children:"Explore Graph"})]})},v0=Ut(bf).attrs({maxRows:3})` + */const ct={LEFT:1,RIGHT:2,MIDDLE:4},q=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}),yn={NONE:0,IN:1,OUT:-1};function qs(i){return i.isPerspectiveCamera}function Ts(i){return i.isOrthographicCamera}const vn=Math.PI*2,zc=Math.PI/2,su=1e-5,li=Math.PI/180;function Re(i,t,e){return Math.max(t,Math.min(e,i))}function Et(i,t=su){return Math.abs(i)0==p>u&&(p=u,e.value=(p-u)/r),p}function Bc(i,t,e,s,n=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=t.x,h=t.y,d=t.z,p=i.x-u,_=i.y-h,f=i.z-d;const m=u,v=h,b=d,w=n*s,g=w*w,y=p*p+_*_+f*f;if(y>g){const G=Math.sqrt(y);p=p/G*w,_=_/G*w,f=f/G*w}u=i.x-p,h=i.y-_,d=i.z-f;const k=(e.x+a*p)*r,T=(e.y+a*_)*r,x=(e.z+a*f)*r;e.x=(e.x-a*k)*l,e.y=(e.y-a*T)*l,e.z=(e.z-a*x)*l,o.x=u+(p+k)*l,o.y=h+(_+T)*l,o.z=d+(f+x)*l;const C=m-i.x,O=v-i.y,I=b-i.z,M=o.x-m,V=o.y-v,W=o.z-b;return C*M+O*V+I*W>0&&(o.x=m,o.y=v,o.z=b,e.x=(o.x-m)/r,e.y=(o.y-v)/r,e.z=(o.z-b)/r),o}function Fo(i,t){t.set(0,0),i.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=i.length,t.y/=i.length}function Lo(i,t){return Ts(i)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}class qf{constructor(){this._listeners={}}addEventListener(t,e){const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const n=this._listeners[t];if(n!==void 0){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}removeAllEventListeners(t){if(!t){this._listeners={};return}Array.isArray(this._listeners[t])&&(this._listeners[t].length=0)}dispatchEvent(t){const s=this._listeners[t.type];if(s!==void 0){t.target=this;const n=s.slice(0);for(let r=0,o=n.length;r{},this._enabled=!0,this._state=q.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=yn.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new at.Vector3,this._focalOffsetVelocity=new at.Vector3,this._zoomVelocity={value:0},this._truckInternal=(g,y,k)=>{let T,x;if(qs(this._camera)){const C=ht.copy(this._camera.position).sub(this._target),O=this._camera.getEffectiveFOV()*li,I=C.length()*Math.tan(O*.5);T=this.truckSpeed*g*I/this._elementRect.height,x=this.truckSpeed*y*I/this._elementRect.height}else if(Ts(this._camera)){const C=this._camera;T=g*(C.right-C.left)/C.zoom/this._elementRect.width,x=y*(C.top-C.bottom)/C.zoom/this._elementRect.height}else return;this.verticalDragToForward?(k?this.setFocalOffset(this._focalOffsetEnd.x+T,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(T,0,!0),this.forward(-x,!0)):k?this.setFocalOffset(this._focalOffsetEnd.x+T,this._focalOffsetEnd.y+x,this._focalOffsetEnd.z,!0):this.truck(T,x,!0)},this._rotateInternal=(g,y)=>{const k=vn*this.azimuthRotateSpeed*g/this._elementRect.height,T=vn*this.polarRotateSpeed*y/this._elementRect.height;this.rotate(k,T,!0)},this._dollyInternal=(g,y,k)=>{const T=Math.pow(.95,-g*this.dollySpeed),x=this._sphericalEnd.radius,C=this._sphericalEnd.radius*T,O=Re(C,this.minDistance,this.maxDistance),I=O-C;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(C,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(I,!0),this._dollyToNoClamp(O,!0)):this._dollyToNoClamp(O,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?C:O)-x,this._dollyControlCoord.set(y,k)),this._lastDollyDirection=Math.sign(-g)},this._zoomInternal=(g,y,k)=>{const T=Math.pow(.95,g*this.dollySpeed),x=this._zoom,C=this._zoom*T;this.zoomTo(C,!0),this.dollyToCursor&&(this._changedZoom+=C-x,this._dollyControlCoord.set(y,k))},typeof at>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new at.Quaternion().setFromUnitVectors(this._camera.up,vr),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=q.NONE,this._target=new at.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new at.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new at.Spherical().setFromVector3(ht.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 at.Vector3,new at.Vector3,new at.Vector3,new at.Vector3],this._updateNearPlaneCorners(),this._boundary=new at.Box3(new at.Vector3(-1/0,-1/0,-1/0),new at.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 at.Vector2,this.mouseButtons={left:q.ROTATE,middle:q.DOLLY,right:q.TRUCK,wheel:qs(this._camera)?q.DOLLY:Ts(this._camera)?q.ZOOM:q.NONE},this.touches={one:q.TOUCH_ROTATE,two:qs(this._camera)?q.TOUCH_DOLLY_TRUCK:Ts(this._camera)?q.TOUCH_ZOOM_TRUCK:q.NONE,three:q.TOUCH_TRUCK};const s=new at.Vector2,n=new at.Vector2,r=new at.Vector2,o=g=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const T=this._domElement.getBoundingClientRect(),x=g.clientX/T.width,C=g.clientY/T.height;if(xthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const y=g.pointerType!=="mouse"?null:(g.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(g.buttons&ct.MIDDLE)===ct.MIDDLE?ct.MIDDLE:(g.buttons&ct.RIGHT)===ct.RIGHT?ct.RIGHT:null;if(y!==null){const T=this._findPointerByMouseButton(y);T&&this._disposePointer(T)}if((g.buttons&ct.LEFT)===ct.LEFT&&this._lockedPointer)return;const k={pointerId:g.pointerId,clientX:g.clientX,clientY:g.clientY,deltaX:0,deltaY:0,mouseButton:y};this._activePointers.push(k),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,f(g)},a=g=>{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 T=this._domElement.getBoundingClientRect(),x=g.clientX/T.width,C=g.clientY/T.height;if(xthis._interactiveArea.right||Cthis._interactiveArea.bottom)return}const y=(g.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(g.buttons&ct.MIDDLE)===ct.MIDDLE?ct.MIDDLE:(g.buttons&ct.RIGHT)===ct.RIGHT?ct.RIGHT:null;if(y!==null){const T=this._findPointerByMouseButton(y);T&&this._disposePointer(T)}const k={pointerId:1,clientX:g.clientX,clientY:g.clientY,deltaX:0,deltaY:0,mouseButton:(g.buttons&ct.LEFT)===ct.LEFT?ct.LEFT:(g.buttons&ct.MIDDLE)===ct.LEFT?ct.MIDDLE:(g.buttons&ct.RIGHT)===ct.LEFT?ct.RIGHT:null};this._activePointers.push(k),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,f(g)},c=g=>{g.cancelable&&g.preventDefault();const y=g.pointerId,k=this._lockedPointer||this._findPointerById(y);if(k){if(k.clientX=g.clientX,k.clientY=g.clientY,k.deltaX=g.movementX,k.deltaY=g.movementY,this._state=0,g.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&&(g.buttons&ct.LEFT)===ct.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(g.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(g.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=g=>{const y=this._lockedPointer||this._findPointerById(1);y&&(y.clientX=g.clientX,y.clientY=g.clientY,y.deltaX=g.movementX,y.deltaY=g.movementY,this._state=0,(this._lockedPointer||(g.buttons&ct.LEFT)===ct.LEFT)&&(this._state=this._state|this.mouseButtons.left),(g.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(g.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right),m())},u=g=>{const y=this._findPointerById(g.pointerId);if(!(y&&y===this._lockedPointer)){if(y&&this._disposePointer(y),g.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=q.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=q.NONE;v()}},h=()=>{const g=this._findPointerById(1);g&&g===this._lockedPointer||(g&&this._disposePointer(g),this._state=q.NONE,v())};let d=-1;const p=g=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===q.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const C=this._domElement.getBoundingClientRect(),O=g.clientX/C.width,I=g.clientY/C.height;if(Othis._interactiveArea.right||Ithis._interactiveArea.bottom)return}if(g.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===q.ROTATE||this.mouseButtons.wheel===q.TRUCK){const C=performance.now();d-C<1e3&&this._getClientRect(this._elementRect),d=C}const y=Hf?-1:-3,k=g.deltaMode===1?g.deltaY/y:g.deltaY/(y*10),T=this.dollyToCursor?(g.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,x=this.dollyToCursor?(g.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case q.ROTATE:{this._rotateInternal(g.deltaX,g.deltaY),this._isUserControllingRotate=!0;break}case q.TRUCK:{this._truckInternal(g.deltaX,g.deltaY,!1),this._isUserControllingTruck=!0;break}case q.OFFSET:{this._truckInternal(g.deltaX,g.deltaY,!0),this._isUserControllingOffset=!0;break}case q.DOLLY:{this._dollyInternal(-k,T,x),this._isUserControllingDolly=!0;break}case q.ZOOM:{this._zoomInternal(-k,T,x),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},_=g=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===ia.ACTION.NONE){const y=g instanceof PointerEvent?g.pointerId:(g instanceof MouseEvent,0),k=this._findPointerById(y);k&&this._disposePointer(k),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}g.preventDefault()}},f=g=>{if(!this._enabled)return;if(Fo(this._activePointers,ae),this._getClientRect(this._elementRect),s.copy(ae),n.copy(ae),this._activePointers.length>=2){const k=ae.x-this._activePointers[1].clientX,T=ae.y-this._activePointers[1].clientY,x=Math.sqrt(k*k+T*T);r.set(0,x);const C=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,O=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;n.set(C,O)}if(this._state=0,!g)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in g&&g.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&&(g.buttons&ct.LEFT)===ct.LEFT&&(this._state=this._state|this.mouseButtons.left),(g.buttons&ct.MIDDLE)===ct.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(g.buttons&ct.RIGHT)===ct.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&q.ROTATE)===q.ROTATE||(this._state&q.TOUCH_ROTATE)===q.TOUCH_ROTATE||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_ZOOM_ROTATE)===q.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&q.TRUCK)===q.TRUCK||(this._state&q.TOUCH_TRUCK)===q.TOUCH_TRUCK||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&q.DOLLY)===q.DOLLY||(this._state&q.TOUCH_DOLLY)===q.TOUCH_DOLLY||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&q.ZOOM)===q.ZOOM||(this._state&q.TOUCH_ZOOM)===q.TOUCH_ZOOM||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&q.OFFSET)===q.OFFSET||(this._state&q.TOUCH_OFFSET)===q.TOUCH_OFFSET||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,Fo(this._activePointers,ae);const y=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,k=y?-y.deltaX:n.x-ae.x,T=y?-y.deltaY:n.y-ae.y;if(n.copy(ae),((this._state&q.ROTATE)===q.ROTATE||(this._state&q.TOUCH_ROTATE)===q.TOUCH_ROTATE||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(k,T),this._isUserControllingRotate=!0),(this._state&q.DOLLY)===q.DOLLY||(this._state&q.ZOOM)===q.ZOOM){const x=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,O=this.dollyDragInverted?-1:1;(this._state&q.DOLLY)===q.DOLLY?(this._dollyInternal(O*T*yr,x,C),this._isUserControllingDolly=!0):(this._zoomInternal(O*T*yr,x,C),this._isUserControllingZoom=!0)}if((this._state&q.TOUCH_DOLLY)===q.TOUCH_DOLLY||(this._state&q.TOUCH_ZOOM)===q.TOUCH_ZOOM||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_ZOOM_ROTATE)===q.TOUCH_ZOOM_ROTATE){const x=ae.x-this._activePointers[1].clientX,C=ae.y-this._activePointers[1].clientY,O=Math.sqrt(x*x+C*C),I=r.y-O;r.set(0,O);const M=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,V=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&q.TOUCH_DOLLY)===q.TOUCH_DOLLY||(this._state&q.TOUCH_DOLLY_ROTATE)===q.TOUCH_DOLLY_ROTATE||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET?(this._dollyInternal(I*yr,M,V),this._isUserControllingDolly=!0):(this._zoomInternal(I*yr,M,V),this._isUserControllingZoom=!0)}((this._state&q.TRUCK)===q.TRUCK||(this._state&q.TOUCH_TRUCK)===q.TOUCH_TRUCK||(this._state&q.TOUCH_DOLLY_TRUCK)===q.TOUCH_DOLLY_TRUCK||(this._state&q.TOUCH_ZOOM_TRUCK)===q.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(k,T,!1),this._isUserControllingTruck=!0),((this._state&q.OFFSET)===q.OFFSET||(this._state&q.TOUCH_OFFSET)===q.TOUCH_OFFSET||(this._state&q.TOUCH_DOLLY_OFFSET)===q.TOUCH_DOLLY_OFFSET||(this._state&q.TOUCH_ZOOM_OFFSET)===q.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(k,T,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},v=()=>{Fo(this._activePointers,ae),n.copy(ae),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",b),this._domElement.ownerDocument.addEventListener("pointerlockerror",w),this._domElement.ownerDocument.addEventListener("pointermove",c,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",u),f())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",b),this._domElement.ownerDocument.removeEventListener("pointerlockerror",w))};const b=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},w=()=>{this.unlockPointer()};this._addAllEventListeners=g=>{this._domElement=g,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),Yf&&this._domElement.addEventListener("mousedown",a),this._domElement.addEventListener("pointercancel",u),this._domElement.addEventListener("wheel",p,{passive:!1}),this._domElement.addEventListener("contextmenu",_)},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",p,{passive:!1}),this._domElement.removeEventListener("contextmenu",_),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",b),this._domElement.ownerDocument.removeEventListener("pointerlockerror",w))},this.cancel=()=>{this._state!==q.NONE&&(this._state=q.NONE,this._activePointers.length=0,v())},e&&this.connect(e),this.update(0)}get camera(){return this._camera}set camera(t){this._camera=t,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._domElement&&(t?(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(t){this._spherical.radius===t&&this._sphericalEnd.radius===t||(this._spherical.radius=t,this._sphericalEnd.radius=t,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(t){this._spherical.theta===t&&this._sphericalEnd.theta===t||(this._spherical.theta=t,this._sphericalEnd.theta=t,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(t){this._spherical.phi===t&&this._sphericalEnd.phi===t||(this._spherical.phi=t,this._sphericalEnd.phi=t,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(t){this._boundaryEnclosesCamera=t,this._needsUpdate=!0}set interactiveArea(t){this._interactiveArea.width=Re(t.width,0,1),this._interactiveArea.height=Re(t.height,0,1),this._interactiveArea.x=Re(t.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Re(t.y,0,1-this._interactiveArea.height)}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}rotate(t,e,s=!1){return this.rotateTo(this._sphericalEnd.theta+t,this._sphericalEnd.phi+e,s)}rotateAzimuthTo(t,e=!1){return this.rotateTo(t,this._sphericalEnd.phi,e)}rotatePolarTo(t,e=!1){return this.rotateTo(this._sphericalEnd.theta,t,e)}rotateTo(t,e,s=!1){this._isUserControllingRotate=!1;const n=Re(t,this.minAzimuthAngle,this.maxAzimuthAngle),r=Re(e,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=n,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||gt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(t,e=!1){return this.dollyTo(this._sphericalEnd.radius-t,e)}dollyTo(t,e=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=yn.NONE,this._changedDolly=0,this._dollyToNoClamp(Re(t,this.minDistance,this.maxDistance),e)}_dollyToNoClamp(t,e=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=gt(o,this._spherical.radius);if(!(s>t)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(t,o)}else this._sphericalEnd.radius=t;this._needsUpdate=!0,e||(this._spherical.radius=this._sphericalEnd.radius);const r=!e||gt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(r)}dollyInFixed(t,e=!1){this._targetEnd.add(this._getCameraDirection(di).multiplyScalar(t)),e||this._target.copy(this._targetEnd);const s=!e||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(t,e=!1){return this.zoomTo(this._zoomEnd+t,e)}zoomTo(t,e=!1){this._isUserControllingZoom=!1,this._zoomEnd=Re(t,this.minZoom,this.maxZoom),this._needsUpdate=!0,e||(this._zoom=this._zoomEnd);const s=!e||gt(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(t,e,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(t,e,s)}truck(t,e,s=!1){this._camera.updateMatrix(),Ye.setFromMatrixColumn(this._camera.matrix,0),Ge.setFromMatrixColumn(this._camera.matrix,1),Ye.multiplyScalar(t),Ge.multiplyScalar(-e);const n=ht.copy(Ye).add(Ge),r=mt.copy(this._targetEnd).add(n);return this.moveTo(r.x,r.y,r.z,s)}forward(t,e=!1){ht.setFromMatrixColumn(this._camera.matrix,0),ht.crossVectors(this._camera.up,ht),ht.multiplyScalar(t);const s=mt.copy(this._targetEnd).add(ht);return this.moveTo(s.x,s.y,s.z,e)}elevate(t,e=!1){return ht.copy(this._camera.up).multiplyScalar(t),this.moveTo(this._targetEnd.x+ht.x,this._targetEnd.y+ht.y,this._targetEnd.z+ht.z,e)}moveTo(t,e,s,n=!1){this._isUserControllingTruck=!1;const r=ht.set(t,e,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,r,this.boundaryFriction),this._needsUpdate=!0,n||this._target.copy(this._targetEnd);const o=!n||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(t,e,s,n=!1){const a=ht.set(t,e,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(a.x,a.y,a.z,n)}fitToBox(t,e,{cover:s=!1,paddingLeft:n=0,paddingRight:r=0,paddingBottom:o=0,paddingTop:a=0}={}){const c=[],l=t.isBox3?kn.copy(t):kn.setFromObject(t);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=jc(this._sphericalEnd.theta,zc),h=jc(this._sphericalEnd.phi,zc);c.push(this.rotateTo(u,h,e));const d=ht.setFromSpherical(this._sphericalEnd).normalize(),p=Gc.setFromUnitVectors(d,Vo),_=gt(Math.abs(d.y),1);_&&p.multiply(zo.setFromAxisAngle(vr,u)),p.multiply(this._yAxisUpSpaceInverse);const f=Yc.makeEmpty();mt.copy(l.min).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.min).setX(l.max.x).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.min).setY(l.max.y).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).setZ(l.min.z).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.min).setZ(l.max.z).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).setY(l.min.y).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).setX(l.min.x).applyQuaternion(p),f.expandByPoint(mt),mt.copy(l.max).applyQuaternion(p),f.expandByPoint(mt),f.min.x-=n,f.min.y-=o,f.max.x+=r,f.max.y+=a,p.setFromUnitVectors(Vo,d),_&&p.premultiply(zo.invert()),p.premultiply(this._yAxisUpSpace);const m=f.getSize(ht),v=f.getCenter(mt).applyQuaternion(p);if(qs(this._camera)){const b=this.getDistanceToFitBox(m.x,m.y,m.z,s);c.push(this.moveTo(v.x,v.y,v.z,e)),c.push(this.dollyTo(b,e)),c.push(this.setFocalOffset(0,0,0,e))}else if(Ts(this._camera)){const b=this._camera,w=b.right-b.left,g=b.top-b.bottom,y=s?Math.max(w/m.x,g/m.y):Math.min(w/m.x,g/m.y);c.push(this.moveTo(v.x,v.y,v.z,e)),c.push(this.zoomTo(y,e)),c.push(this.setFocalOffset(0,0,0,e))}return Promise.all(c)}fitToSphere(t,e){const s=[],r=t instanceof at.Sphere?Uo.copy(t):ia.createBoundingSphere(t,Uo);if(s.push(this.moveTo(r.center.x,r.center.y,r.center.z,e)),qs(this._camera)){const o=this.getDistanceToFitSphere(r.radius);s.push(this.dollyTo(o,e))}else if(Ts(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,e))}return s.push(this.setFocalOffset(0,0,0,e)),Promise.all(s)}setLookAt(t,e,s,n,r,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=yn.NONE,this._changedDolly=0;const c=mt.set(n,r,o),l=ht.set(t,e,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||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold)&>(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&>(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(t,e,s,n,r,o,a,c,l,u,h,d,p,_=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=yn.NONE,this._changedDolly=0;const f=ht.set(n,r,o),m=mt.set(t,e,s);we.setFromVector3(m.sub(f).applyQuaternion(this._yAxisUpSpace));const v=xn.set(u,h,d),b=mt.set(a,c,l);fi.setFromVector3(b.sub(v).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(f.lerp(v,p));const w=fi.theta-we.theta,g=fi.phi-we.phi,y=fi.radius-we.radius;this._sphericalEnd.set(we.radius+y*p,we.phi+g*p,we.theta+w*p),this.normalizeRotations(),this._needsUpdate=!0,_||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const k=!_||gt(this._target.x,this._targetEnd.x,this.restThreshold)&>(this._target.y,this._targetEnd.y,this.restThreshold)&>(this._target.z,this._targetEnd.z,this.restThreshold)&>(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&>(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&>(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(k)}setPosition(t,e,s,n=!1){return this.setLookAt(t,e,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,n)}setTarget(t,e,s,n=!1){const r=this.getPosition(ht),o=this.setLookAt(r.x,r.y,r.z,t,e,s,n);return this._sphericalEnd.phi=Re(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(t,e,s,n=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(t,e,s),this._needsUpdate=!0,n||this._focalOffset.copy(this._focalOffsetEnd);const r=!n||gt(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&>(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&>(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}setOrbitPoint(t,e,s){this._camera.updateMatrixWorld(),Ye.setFromMatrixColumn(this._camera.matrixWorldInverse,0),Ge.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Ws.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const n=ht.set(t,e,s),r=n.distanceTo(this._camera.position),o=n.sub(this._camera.position);Ye.multiplyScalar(o.x),Ge.multiplyScalar(o.y),Ws.multiplyScalar(o.z),ht.copy(Ye).add(Ge).add(Ws),ht.z=ht.z+r,this.dollyTo(r,!1),this.setFocalOffset(-ht.x,ht.y,-ht.z,!1),this.moveTo(t,e,s,!1)}setBoundary(t){if(!t){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(t),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(t,e,s,n){if(t===null){this._viewport=null;return}this._viewport=this._viewport||new at.Vector4,typeof t=="number"?this._viewport.set(t,e,s,n):this._viewport.copy(t)}getDistanceToFitBox(t,e,s,n=!1){if(Lo(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const r=t/e,o=this._camera.getEffectiveFOV()*li,a=this._camera.aspect;return((n?r>a:re.pointerId===t)}_findPointerByMouseButton(t){return this._activePointers.find(e=>e.mouseButton===t)}_disposePointer(t){this._activePointers.splice(this._activePointers.indexOf(t),1)}_encloseToBoundary(t,e,s){const n=e.lengthSq();if(n===0)return t;const r=mt.copy(e).add(t),a=this._boundary.clampPoint(r,xn).sub(r),c=a.lengthSq();if(c===0)return t.add(e);if(c===n)return t;if(s===0)return t.add(e).add(a);{const l=1+s*c/e.dot(a);return t.add(mt.copy(e).multiplyScalar(l)).add(a.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(qs(this._camera)){const t=this._camera,e=t.near,s=t.getEffectiveFOV()*li,n=Math.tan(s*.5)*e,r=n*t.aspect;this._nearPlaneCorners[0].set(-r,-n,0),this._nearPlaneCorners[1].set(r,-n,0),this._nearPlaneCorners[2].set(r,n,0),this._nearPlaneCorners[3].set(-r,n,0)}else if(Ts(this._camera)){const t=this._camera,e=1/t.zoom,s=t.left*e,n=t.right*e,r=t.top*e,o=t.bottom*e;this._nearPlaneCorners[0].set(s,r,0),this._nearPlaneCorners[1].set(n,r,0),this._nearPlaneCorners[2].set(n,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let t=1/0;if(!(this.colliderMeshes.length>=1)||Lo(this._camera,"_collisionTest"))return t;const s=this._getTargetDirection(di);jo.lookAt(qc,s,this._camera.up);for(let n=0;n<4;n++){const r=mt.copy(this._nearPlaneCorners[n]);r.applyMatrix4(jo);const o=xn.addVectors(this._target,r);xr.set(o,s),xr.far=this._spherical.radius+1;const a=xr.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{const s=()=>{this.removeEventListener("rest",s),e()};this.addEventListener("rest",s)}))}_addAllEventListeners(t){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(t){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(t){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(t,e=new at.Sphere){const s=e,n=s.center;kn.makeEmpty(),t.traverseVisible(o=>{o.isMesh&&kn.expandByObject(o)}),kn.getCenter(n);let r=0;return t.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{D.useMemo(()=>{Bo.install({THREE:vf}),Pa({CameraControlsImpl:Bo})},[]);const{camera:e,domElement:s,makeDefault:n,onStart:r,onEnd:o,onChange:a,regress:c,...l}=i,u=It(y=>y.camera),h=It(y=>y.gl),d=It(y=>y.invalidate),p=It(y=>y.events),_=It(y=>y.setEvents),f=It(y=>y.set),m=It(y=>y.get),v=It(y=>y.performance),b=e||u,w=s||p.connected||h.domElement,g=D.useMemo(()=>new Bo(b),[b]);return Pe((y,k)=>{g.enabled&&g.update(k)},-1),D.useEffect(()=>(g.connect(w),()=>void g.disconnect()),[w,g]),D.useEffect(()=>{const y=x=>{d(),c&&v.regress(),a&&a(x)},k=x=>{r&&r(x)},T=x=>{o&&o(x)};return g.addEventListener("update",y),g.addEventListener("controlstart",k),g.addEventListener("controlend",T),()=>{g.removeEventListener("update",y),g.removeEventListener("controlstart",k),g.removeEventListener("controlend",T)}},[g,r,o,d,_,c,a]),D.useEffect(()=>{if(n){const y=m().controls;return f({controls:g}),()=>f({controls:y})}},[n,g]),D.createElement("primitive",Se({ref:t,object:g},l))});ei.func.isRequired,ei.arrayOf(ei.oneOfType([ei.element,ei.func])).isRequired;const $c=new er,Zc=new er,kr=[],pi=new tu;class $f extends kf{constructor(){super(),this.color=new Na("white"),this.instance={current:void 0},this.instanceKey={current:void 0}}get geometry(){var t;return(t=this.instance.current)==null?void 0:t.geometry}raycast(t,e){const s=this.instance.current;if(!s||!s.geometry||!s.material)return;pi.geometry=s.geometry;const n=s.matrixWorld,r=s.userData.instances.indexOf(this.instanceKey);if(!(r===-1||r>s.count)){s.getMatrixAt(r,$c),Zc.multiplyMatrices(n,$c),pi.matrixWorld=Zc,s.material instanceof Tf?pi.material.side=s.material.side:pi.material.side=s.material[0].side,pi.raycast(t,kr);for(let o=0,a=kr.length;o{D.useMemo(()=>Pa({PositionMesh:$f}),[]);const n=D.useRef(),{subscribe:r,getParent:o}=D.useContext(i||iu);return D.useLayoutEffect(()=>r(n),[]),D.createElement("positionMesh",Se({instance:o(),instanceKey:n,ref:ho([s,n])},e),t)}),Xf=D.forwardRef(({children:i,range:t,limit:e=1e3,frames:s=1/0,...n},r)=>{const[{context:o,instance:a}]=D.useState(()=>{const m=D.createContext(null);return{context:m,instance:D.forwardRef((v,b)=>D.createElement(ru,Se({context:m},v,{ref:b})))}}),c=D.useRef(null),[l,u]=D.useState([]),[[h,d]]=D.useState(()=>{const m=new Float32Array(e*16);for(let v=0;v1))]});D.useEffect(()=>{c.current.instanceMatrix.needsUpdate=!0});let p=0,_=0;Pe(()=>{if(s===1/0||p({getParent:()=>c,subscribe:m=>(u(v=>[...v,m]),()=>u(v=>v.filter(b=>b.current!==m.current)))}),[]);return D.createElement("instancedMesh",Se({userData:{instances:l},matrixAutoUpdate:!1,ref:ho([r,c]),args:[null,null,0],raycast:()=>null},n),D.createElement("instancedBufferAttribute",{attach:"instanceMatrix",count:h.length/16,array:h,itemSize:16,usage:Rc}),D.createElement("instancedBufferAttribute",{attach:"instanceColor",count:d.length/3,array:d,itemSize:3,usage:Rc}),typeof i=="function"?D.createElement(o.Provider,{value:f},i(a)):D.createElement(iu.Provider,{value:f},i))}),ou=D.createContext(null),Qf=D.forwardRef((i,t)=>{D.useMemo(()=>Pa({SegmentObject:Kf}),[]);const{limit:e=1e3,lineWidth:s=1,children:n,...r}=i,[o,a]=D.useState([]),[c]=D.useState(()=>new Fd),[l]=D.useState(()=>new Ld),[u]=D.useState(()=>new Vd),[h]=D.useState(()=>new _t(512,512)),[d]=D.useState(()=>Array(e*6).fill(0)),[p]=D.useState(()=>Array(e*6).fill(0)),_=D.useMemo(()=>({subscribe:f=>(a(m=>[...m,f]),()=>a(m=>m.filter(v=>v.current!==f.current)))}),[]);return Pe(()=>{for(let m=0;mi instanceof rt?i:new rt(...typeof i=="number"?[i,i,i]:i),Jf=D.forwardRef(({color:i,start:t,end:e},s)=>{const n=D.useContext(ou);if(!n)throw"Segment must used inside Segments component.";const r=D.useRef(null);return D.useLayoutEffect(()=>n.subscribe(r),[]),D.createElement("segmentObject",{ref:ho([r,s]),color:i,start:el(t),end:el(e)})});function t0({all:i,scene:t,camera:e}){const s=It(({gl:o})=>o),n=It(({camera:o})=>o),r=It(({scene:o})=>o);return D.useLayoutEffect(()=>{const o=[];i&&(t||r).traverse(l=>{l.visible===!1&&(o.push(l),l.visible=!0)}),s.compile(t||r,e||n);const a=new wf(128);new bf(.01,1e5,a).update(s,t||r),a.dispose(),o.forEach(l=>l.visible=!1)},[]),null}function e0({pixelated:i}){const t=It(o=>o.gl),e=It(o=>o.internal.active),s=It(o=>o.performance.current),n=It(o=>o.viewport.initialDpr),r=It(o=>o.setDpr);return D.useEffect(()=>{const o=t.domElement;return()=>{e&&r(n),i&&o&&(o.style.imageRendering="auto")}},[]),D.useEffect(()=>{r(s*n),i&&t.domElement&&(t.domElement.style.imageRendering=s===1?"auto":"pixelated")},[s]),null}function s0(){const i=It(s=>s.get),t=It(s=>s.setEvents),e=It(s=>s.performance.current);return D.useEffect(()=>{const s=i().events.enabled;return()=>t({enabled:s})},[]),D.useEffect(()=>t({enabled:e===1}),[e]),null}const n0=D.createContext(null);function i0({children:i,enabled:t=!0}){const[e,s]=D.useState([]),n=D.useMemo(()=>({selected:e,select:s,enabled:t}),[e,s,t]);return L.jsx(n0.Provider,{value:n,children:i})}const r0={isUserDragging:!1,isUserScrolling:!1,userMovedCamera:!1,isUserScrollingOnHtmlPanel:!1},Es=Hl(i=>({...r0,setIsUserDragging:t=>i({isUserDragging:t}),setIsUserScrolling:t=>i({isUserScrolling:t}),setUserMovedCamera:t=>i({userMovedCamera:t}),setIsUserScrollingOnHtmlPanel:t=>i({isUserScrollingOnHtmlPanel:t})})),o0=()=>{const[i,t]=D.useState(""),e=D.useRef(null),{fetchData:s,setAbortRequests:n,seedQuestions:r}=Vs(g=>g),[o]=Gl(g=>[g.setBudget]),{setUniverseQuestionIsOpen:a,setSidebarOpen:c,setShowCollapseButton:l}=Ji(g=>({setUniverseQuestionIsOpen:g.setUniverseQuestionIsOpen,setSidebarOpen:g.setSidebarOpen,setShowCollapseButton:g.setShowCollapseButton})),u=Sd(g=>g.resetAiSummaryAnswer),[h,d]=D.useState([]);D.useEffect(()=>{r&&d(b(r).slice(0,4))},[r]),D.useEffect(()=>{e.current&&e.current.focus()},[]);const p=async g=>{g&&(u(),a(),c(!0),l(!0)),await s(o,n,g)},_=!!i.trim().length,f=async g=>{g.keyCode===13&&g.shiftKey===!1&&_&&(g.preventDefault(),p(i))},m=async g=>{t(g),await p(g)},v=()=>{a(),c(!0),l(!0)},b=g=>{const y=[...g];let k=y.length-1;for(;k>0;){const T=Math.floor(Math.random()*(k+1));[y[k],y[T]]=[y[T],y[k]],k-=1}return y},w=!!i&&i.trim().length>0;return L.jsxs(l0,{children:["Ideas have shapes",L.jsxs(c0,{onKeyDown:f,py:12,tabIndex:-1,children:[L.jsx(a0,{ref:e,onChange:g=>t(g.target.value),placeholder:"What do you want to know?",value:i}),L.jsx(u0,{color:"secondary",disabled:!w,onClick:()=>p(i),variant:"contained",children:w?L.jsxs(L.Fragment,{children:["Search ",L.jsx(Pc,{})]}):L.jsx(Pc,{})})]}),h.length>0&&L.jsx(d0,{children:h.map(g=>L.jsxs(f0,{onClick:()=>m(g),children:[L.jsx(Gd,{}),g]},g))}),L.jsx(h0,{"data-testid":"explore-graph-btn",onClick:v,startIcon:L.jsx($d,{}),children:"Explore Graph"})]})},a0=Ut(df).attrs({maxRows:3})` background: ${Tt.BG1}; max-width: 700px; width: 700px; @@ -38,7 +38,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a margin: 13px; overflow-y: hidden; } -`,x0=Ut(ys)` +`,c0=Ut(gs)` position: relative; margin-top: 30px; background: ${Tt.BG1}; @@ -51,7 +51,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a outline: none; border-radius: 12px; box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.5); -`,k0=Ut(ys)` +`,l0=Ut(gs)` background: #16161de3; position: absolute; left: 0; @@ -66,7 +66,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a font-weight: 700; line-height: 16px; font-family: 'Barlow'; -`,T0=Ut(Jl)` +`,u0=Ut(Yl)` && { position: absolute; bottom: 16px; @@ -85,21 +85,21 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a width: 11px; height: 11px; } -`,w0=Ut(Jl)` +`,h0=Ut(Yl)` && { position: absolute; bottom: 20px; right: 20px; border-radius: 16px; } -`,b0=Ut.div` +`,d0=Ut.div` display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; max-width: 702px; width: 100%; -`,C0=Ut.div` +`,f0=Ut.div` background: ${Tt.BG1}; color: ${Tt.white}; padding: 15px 12px; @@ -128,9 +128,9 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a path { fill: ${Tt.modalWhiteOverlayBg}; } -`,bi=new rt(0,0,0),ol=100,S0=600,E0=2e3,$o={x:172.7392402058252,y:-239.04675366094037,z:-2e3},mu="14.8.49",al=(i,t,e)=>({endTime:t,insertTime:e,type:"exponentialRampToValue",value:i}),cl=(i,t,e)=>({endTime:t,insertTime:e,type:"linearRampToValue",value:i}),ua=(i,t)=>({startTime:t,type:"setValue",value:i}),_u=(i,t,e)=>({duration:e,startTime:t,type:"setValueCurve",values:i}),gu=(i,t,{startTime:e,target:s,timeConstant:n})=>s+(t-s)*Math.exp((e-i)/n),On=i=>i.type==="exponentialRampToValue",jr=i=>i.type==="linearRampToValue",bs=i=>On(i)||jr(i),ja=i=>i.type==="setValue",ls=i=>i.type==="setValueCurve",zr=(i,t,e,s)=>{const n=i[t];return n===void 0?s:bs(n)||ja(n)?n.value:ls(n)?n.values[n.values.length-1]:gu(e,zr(i,t-1,n.startTime,s),n)},ll=(i,t,e,s,n)=>e===void 0?[s.insertTime,n]:bs(e)?[e.endTime,e.value]:ja(e)?[e.startTime,e.value]:ls(e)?[e.startTime+e.duration,e.values[e.values.length-1]]:[e.startTime,zr(i,t-1,e.startTime,n)],ha=i=>i.type==="cancelAndHold",da=i=>i.type==="cancelScheduledValues",Ts=i=>ha(i)||da(i)?i.cancelTime:On(i)||jr(i)?i.endTime:i.startTime,ul=(i,t,e,{endTime:s,value:n})=>e===n?n:0e+(i-t)/(s-t)*(n-e),O0=(i,t)=>{const e=Math.floor(t),s=Math.ceil(t);return e===s?i[e]:(1-(t-e))*i[e]+(1-(s-t))*i[s]},A0=(i,{duration:t,startTime:e,values:s})=>{const n=(i-e)/t*(s.length-1);return O0(s,n)},Sr=i=>i.type==="setTarget";class M0{constructor(t){this._automationEvents=[],this._currenTime=0,this._defaultValue=t}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(t){const e=Ts(t);if(ha(t)||da(t)){const s=this._automationEvents.findIndex(r=>da(t)&&ls(r)?r.startTime+r.duration>=e:Ts(r)>=e),n=this._automationEvents[s];if(s!==-1&&(this._automationEvents=this._automationEvents.slice(0,s)),ha(t)){const r=this._automationEvents[this._automationEvents.length-1];if(n!==void 0&&bs(n)){if(r!==void 0&&Sr(r))throw new Error("The internal list is malformed.");const o=r===void 0?n.insertTime:ls(r)?r.startTime+r.duration:Ts(r),a=r===void 0?this._defaultValue:ls(r)?r.values[r.values.length-1]:r.value,c=On(n)?ul(e,o,a,n):hl(e,o,a,n),l=On(n)?al(c,e,this._currenTime):cl(c,e,this._currenTime);this._automationEvents.push(l)}if(r!==void 0&&Sr(r)&&this._automationEvents.push(ua(this.getValue(e),e)),r!==void 0&&ls(r)&&r.startTime+r.duration>e){const o=e-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;hTs(o)>e),n=s===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[s-1];if(n!==void 0&&ls(n)&&Ts(n)+n.duration>e)return!1;const r=On(t)?al(t.value,t.endTime,this._currenTime):jr(t)?cl(t.value,e,this._currenTime):t;if(s===-1)this._automationEvents.push(r);else{if(ls(t)&&e+t.duration>Ts(this._automationEvents[s]))return!1;this._automationEvents.splice(s,0,r)}}return!0}flush(t){const e=this._automationEvents.findIndex(s=>Ts(s)>t);if(e>1){const s=this._automationEvents.slice(e-1),n=s[0];Sr(n)&&s.unshift(ua(zr(this._automationEvents,e-2,n.startTime,this._defaultValue),n.startTime)),this._automationEvents=s}}getValue(t){if(this._automationEvents.length===0)return this._defaultValue;const e=this._automationEvents.findIndex(o=>Ts(o)>t),s=this._automationEvents[e],n=(e===-1?this._automationEvents.length:e)-1,r=this._automationEvents[n];if(r!==void 0&&Sr(r)&&(s===void 0||!bs(s)||s.insertTime>t))return gu(t,zr(this._automationEvents,n-1,r.startTime,this._defaultValue),r);if(r!==void 0&&ja(r)&&(s===void 0||!bs(s)))return r.value;if(r!==void 0&&ls(r)&&(s===void 0||!bs(s)||r.startTime+r.duration>t))return t({cancelTime:i,type:"cancelAndHold"}),P0=i=>({cancelTime:i,type:"cancelScheduledValues"}),I0=(i,t)=>({endTime:t,type:"exponentialRampToValue",value:i}),N0=(i,t)=>({endTime:t,type:"linearRampToValue",value:i}),R0=(i,t,e)=>({startTime:t,target:i,timeConstant:e,type:"setTarget"}),F0=()=>new DOMException("","AbortError"),L0=i=>(t,e,[s,n,r],o)=>{i(t[n],[e,s,r],a=>a[0]===e&&a[1]===s,o)},V0=i=>(t,e,s)=>{const n=[];for(let r=0;r(t,e)=>{i.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:e})},Vn=new WeakSet,yu=new WeakMap,za=new WeakMap,vu=new WeakMap,Ba=new WeakMap,ko=new WeakMap,xu=new WeakMap,fa=new WeakMap,pa=new WeakMap,ma=new WeakMap,ku={construct(){return ku}},j0=i=>{try{const t=new Proxy(i,ku);new t}catch{return!1}return!0},dl=/^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]*);?/,fl=(i,t)=>{const e=[];let s=i.replace(/^[\s]+/,""),n=s.match(dl);for(;n!==null;){const r=n[1].slice(1,-1),o=n[0].replace(/([\s]+)?;?$/,"").replace(r,new URL(r,t).toString());e.push(o),s=s.slice(n[0].length).replace(/^[\s]+/,""),n=s.match(dl)}return[e.join(";"),s]},pl=i=>{if(i!==void 0&&!Array.isArray(i))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},ml=i=>{if(!j0(i))throw new TypeError("The given value for processorCtor should be a constructor.");if(i.prototype===null||typeof i.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},z0=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>{let p=0;return(_,f,m={credentials:"omit"})=>{const v=u.get(_);if(v!==void 0&&v.has(f))return Promise.resolve();const b=l.get(_);if(b!==void 0){const y=b.get(f);if(y!==void 0)return y}const w=r(_),g=w.audioWorklet===void 0?n(f).then(([y,k])=>{const[T,x]=fl(y,k),C=`${T};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${x} -})})(window,'_AWGS')`;return e(C)}).then(()=>{const y=d._AWGS.pop();if(y===void 0)throw new SyntaxError;s(w.currentTime,w.sampleRate,()=>y(class{},void 0,(k,T)=>{if(k.trim()==="")throw t();const x=pa.get(w);if(x!==void 0){if(x.has(k))throw t();ml(T),pl(T.parameterDescriptors),x.set(k,T)}else ml(T),pl(T.parameterDescriptors),pa.set(w,new Map([[k,T]]))},w.sampleRate,void 0,void 0))}):Promise.all([n(f),Promise.resolve(i(h,h))]).then(([[y,k],T])=>{const x=p+1;p=x;const[C,O]=fl(y,k),B=`${C};((AudioWorkletProcessor,registerProcessor)=>{${O} -})(${T?"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{${T?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${T?"":"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${x}',class extends AudioWorkletProcessor{process(){return !1}})`,Y=new Blob([B],{type:"application/javascript; charset=utf-8"}),G=URL.createObjectURL(Y);return w.audioWorklet.addModule(G,m).then(()=>{if(a(w))return w;const z=o(w);return z.audioWorklet.addModule(G,m).then(()=>z)}).then(z=>{if(c===null)throw new SyntaxError;try{new c(z,`__sac${x}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(G))});return b===void 0?l.set(_,new Map([[f,g]])):b.set(f,g),g.then(()=>{const y=u.get(_);y===void 0?u.set(_,new Set([f])):y.add(f)}).finally(()=>{const y=l.get(_);y!==void 0&&y.delete(f)}),g}},ze=(i,t)=>{const e=i.get(t);if(e===void 0)throw new Error("A value with the given key could not be found.");return e},To=(i,t)=>{const e=Array.from(i).filter(t);if(e.length>1)throw Error("More than one element was found.");if(e.length===0)throw Error("No element was found.");const[s]=e;return i.delete(s),s},Tu=(i,t,e,s)=>{const n=ze(i,t),r=To(n,o=>o[0]===e&&o[1]===s);return n.size===0&&i.delete(t),r},rr=i=>ze(xu,i),Un=i=>{if(Vn.has(i))throw new Error("The AudioNode is already stored.");Vn.add(i),rr(i).forEach(t=>t(!0))},wu=i=>"port"in i,or=i=>{if(!Vn.has(i))throw new Error("The AudioNode is not stored.");Vn.delete(i),rr(i).forEach(t=>t(!1))},_a=(i,t)=>{!wu(i)&&t.every(e=>e.size===0)&&or(i)},B0=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>{const p=new WeakMap;return(_,f,m,v,b)=>{const{activeInputs:w,passiveInputs:g}=r(f),{outputs:y}=r(_),k=a(_),T=x=>{const C=c(f),O=c(_);if(x){const P=Tu(g,_,m,v);i(w,_,P,!1),!b&&!h(_)&&e(O,C,m,v),d(f)&&Un(f)}else{const P=s(w,_,m,v);t(g,v,P,!1),!b&&!h(_)&&n(O,C,m,v);const M=o(f);if(M===0)u(f)&&_a(f,w);else{const V=p.get(f);V!==void 0&&clearTimeout(V),p.set(f,setTimeout(()=>{u(f)&&_a(f,w)},M*1e3))}}};return l(y,[f,m,v],x=>x[0]===f&&x[1]===m&&x[2]===v,!0)?(k.add(T),u(_)?i(w,_,[m,v,T],!0):t(g,v,[_,m,T],!0),!0):!1}},q0=i=>(t,e,[s,n,r],o)=>{const a=t.get(s);a===void 0?t.set(s,new Set([[n,e,r]])):i(a,[n,e,r],c=>c[0]===n&&c[1]===e,o)},W0=i=>(t,e)=>{const s=i(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});e.connect(s).connect(t.destination);const n=()=>{e.removeEventListener("ended",n),e.disconnect(s),s.disconnect()};e.addEventListener("ended",n)},H0=i=>(t,e)=>{i(t).add(e)},G0={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},Y0=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...G0,...c},h=s(l,u),d=r(l)?t():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,e()}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,e()}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)}},se=(i,t)=>i.context===t,$0=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(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=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Br=i=>{try{i.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},ss=()=>new DOMException("","IndexSizeError"),qa=i=>{i.getChannelData=(t=>e=>{try{return t.call(i,e)}catch(s){throw s.code===12?ss():s}})(i.getChannelData)},Z0={numberOfChannels:1},X0=(i,t,e,s,n,r,o,a)=>{let c=null;return class bu{constructor(u){if(n===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:h,numberOfChannels:d,sampleRate:p}={...Z0,...u};c===null&&(c=new n(1,1,44100));const _=s!==null&&t(r,r)?new s({length:h,numberOfChannels:d,sampleRate:p}):c.createBuffer(d,h,p);if(_.numberOfChannels===0)throw e();return typeof _.copyFromChannel!="function"?(o(_),qa(_)):t(Br,()=>Br(_))||a(_),i.add(_),_}static[Symbol.hasInstance](u){return u!==null&&typeof u=="object"&&Object.getPrototypeOf(u)===bu.prototype||i.has(u)}}},le=-34028234663852886e22,ne=-le,ds=i=>Vn.has(i),Q0={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},K0=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...Q0,...u},p=n(h,d),_=o(h),f=_?t():null;super(l,!1,p,f),this._audioBufferSourceNodeRenderer=f,this._isBufferNullified=!1,this._isBufferSet=d.buffer!==null,this._nativeAudioBufferSourceNode=p,this._onended=null,this._playbackRate=e(this,_,p.playbackRate,ne,le)}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"){Un(this);const d=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",d),ds(this)&&or(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",d)}}stop(l=0){this._nativeAudioBufferSourceNode.stop(l),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=l)}},J0=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=e(l);const d=se(h,u);if(!d){const p={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=t(u,p),o!==null&&h.start(...o),a!==null&&h.stop(a)}return r.set(u,h),d?await i(u,l.playbackRate,h.playbackRate):await s(u,l.playbackRate,h.playbackRate),await n(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)}}},tp=i=>"playbackRate"in i,ep=i=>"frequency"in i&&"gain"in i,sp=i=>"offset"in i,np=i=>!("frequency"in i)&&"gain"in i,ip=i=>"detune"in i&&"frequency"in i,rp=i=>"pan"in i,re=i=>ze(yu,i),ar=i=>ze(vu,i),ga=(i,t)=>{const{activeInputs:e}=re(i);e.forEach(n=>n.forEach(([r])=>{t.includes(i)||ga(r,[...t,i])}));const s=tp(i)?[i.playbackRate]:wu(i)?Array.from(i.parameters.values()):ep(i)?[i.Q,i.detune,i.frequency,i.gain]:sp(i)?[i.offset]:np(i)?[i.gain]:ip(i)?[i.detune,i.frequency]:rp(i)?[i.pan]:[];for(const n of s){const r=ar(n);r!==void 0&&r.activeInputs.forEach(([o])=>ga(o,t))}ds(i)&&or(i)},Cu=i=>{ga(i.destination,[])},op=i=>i===void 0||typeof i=="number"||typeof i=="string"&&(i==="balanced"||i==="interactive"||i==="playback"),ap=(i,t,e,s,n,r,o,a,c)=>class extends i{constructor(u={}){if(c===null)throw new Error("Missing the native AudioContext constructor.");let h;try{h=new c(u)}catch(_){throw _.code===12&&_.message==="sampleRate is not in range"?e():_}if(h===null)throw s();if(!op(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 e();super(h,2);const{latencyHint:d}=u,{sampleRate:p}=h;if(this._baseLatency=typeof h.baseLatency=="number"?h.baseLatency:d==="balanced"?512/p:d==="interactive"||d===void 0?256/p:d==="playback"?1024/p:Math.max(2,Math.min(128,Math.round(d*p/128)))*128/p,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 _=()=>{this._state==="suspended"&&(this._state=null),h.removeEventListener("statechange",_)};h.addEventListener("statechange",_)}}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 t()}):(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()),Cu(this)}))}createMediaElementSource(u){return new n(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?t():u})}suspend(){return this._nativeAudioContext.suspend().catch(u=>{throw u===void 0?t():u})}},cp=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d=o(h),p=n(h,u,d),_=d?t(a):null;super(l,!1,p,_),this._isNodeOfNativeOfflineAudioContext=d,this._nativeAudioDestinationNode=p}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(l){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(l>this._nativeAudioDestinationNode.maxChannelCount)throw e();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}},lp=i=>{const t=new WeakMap,e=async(s,n)=>{const r=n.destination;return t.set(n,r),await i(s,n,r),r};return{render(s,n){const r=t.get(n);return r!==void 0?Promise.resolve(r):e(s,n)}}},up=(i,t,e,s,n,r,o,a)=>(c,l)=>{const u=l.listener,h=()=>{const y=new Float32Array(1),k=t(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),T=o(l);let x=!1,C=[0,0,-1,0,1,0],O=[0,0,0];const P=()=>{if(x)return;x=!0;const Y=s(l,256,9,0);Y.onaudioprocess=({inputBuffer:G})=>{const z=[r(G,y,0),r(G,y,1),r(G,y,2),r(G,y,3),r(G,y,4),r(G,y,5)];z.some((Z,Q)=>Z!==C[Q])&&(u.setOrientation(...z),C=z);const j=[r(G,y,6),r(G,y,7),r(G,y,8)];j.some((Z,Q)=>Z!==O[Q])&&(u.setPosition(...j),O=j)},k.connect(Y)},M=Y=>G=>{G!==C[Y]&&(C[Y]=G,u.setOrientation(...C))},V=Y=>G=>{G!==O[Y]&&(O[Y]=G,u.setPosition(...O))},B=(Y,G,z)=>{const j=e(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:G});j.connect(k,0,Y),j.start(),Object.defineProperty(j.offset,"defaultValue",{get(){return G}});const Z=i({context:c},T,j.offset,ne,le);return a(Z,"value",Q=>()=>Q.call(Z),Q=>et=>{try{Q.call(Z,et)}catch(R){if(R.code!==9)throw R}P(),T&&z(et)}),Z.cancelAndHoldAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return P(),R})(Z.cancelAndHoldAtTime),Z.cancelScheduledValues=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return P(),R})(Z.cancelScheduledValues),Z.exponentialRampToValueAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return P(),R})(Z.exponentialRampToValueAtTime),Z.linearRampToValueAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return P(),R})(Z.linearRampToValueAtTime),Z.setTargetAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return P(),R})(Z.setTargetAtTime),Z.setValueAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return P(),R})(Z.setValueAtTime),Z.setValueCurveAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return P(),R})(Z.setValueCurveAtTime),Z};return{forwardX:B(0,0,M(0)),forwardY:B(1,0,M(1)),forwardZ:B(2,-1,M(2)),positionX:B(6,0,V(0)),positionY:B(7,0,V(1)),positionZ:B(8,0,V(2)),upX:B(3,0,M(3)),upY:B(4,1,M(4)),upZ:B(5,0,M(5))}},{forwardX:d,forwardY:p,forwardZ:_,positionX:f,positionY:m,positionZ:v,upX:b,upY:w,upZ:g}=u.forwardX===void 0?h():u;return{get forwardX(){return d},get forwardY(){return p},get forwardZ(){return _},get positionX(){return f},get positionY(){return m},get positionZ(){return v},get upX(){return b},get upY(){return w},get upZ(){return g}}},qr=i=>"context"in i,cr=i=>qr(i[0]),fn=(i,t,e,s)=>{for(const n of i)if(e(n)){if(s)return!1;throw Error("The set contains at least one similar element.")}return i.add(t),!0},_l=(i,t,[e,s],n)=>{fn(i,[t,e,s],r=>r[0]===t&&r[1]===e,n)},gl=(i,[t,e,s],n)=>{const r=i.get(t);r===void 0?i.set(t,new Set([[e,s]])):fn(r,[e,s],o=>o[0]===e,n)},Qn=i=>"inputs"in i,Wr=(i,t,e,s)=>{if(Qn(t)){const n=t.inputs[s];return i.connect(n,e,0),[n,e,0]}return i.connect(t,e,s),[t,e,s]},Su=(i,t,e)=>{for(const s of i)if(s[0]===t&&s[1]===e)return i.delete(s),s;return null},hp=(i,t,e)=>To(i,s=>s[0]===t&&s[1]===e),Eu=(i,t)=>{if(!rr(i).delete(t))throw new Error("Missing the expected event listener.")},Ou=(i,t,e)=>{const s=ze(i,t),n=To(s,r=>r[0]===e);return s.size===0&&i.delete(t),n},Hr=(i,t,e,s)=>{Qn(t)?i.disconnect(t.inputs[s],e,0):i.disconnect(t,e,s)},Dt=i=>ze(za,i),Ai=i=>ze(Ba,i),on=i=>fa.has(i),Rr=i=>!Vn.has(i),yl=(i,t)=>new Promise(e=>{if(t!==null)e(!0);else{const s=i.createScriptProcessor(256,1,1),n=i.createGain(),r=i.createBuffer(1,2,44100),o=r.getChannelData(0);o[0]=1,o[1]=1;const a=i.createBufferSource();a.buffer=r,a.loop=!0,a.connect(s).connect(i.destination),a.connect(n),a.disconnect(n),s.onaudioprocess=c=>{const l=c.inputBuffer.getChannelData(0);Array.prototype.some.call(l,u=>u===1)?e(!0):e(!1),a.stop(),s.onaudioprocess=null,a.disconnect(s),s.disconnect(i.destination)},a.start()}}),Zo=(i,t)=>{const e=new Map;for(const s of i)for(const n of s){const r=e.get(n);e.set(n,r===void 0?1:r+1)}e.forEach((s,n)=>t(n,s))},Gr=i=>"context"in i,dp=i=>{const t=new Map;i.connect=(e=>(s,n=0,r=0)=>{const o=Gr(s)?e(s,n,r):e(s,n),a=t.get(s);return a===void 0?t.set(s,[{input:r,output:n}]):a.every(c=>c.input!==r||c.output!==n)&&a.push({input:r,output:n}),o})(i.connect.bind(i)),i.disconnect=(e=>(s,n,r)=>{if(e.apply(i),s===void 0)t.clear();else if(typeof s=="number")for(const[o,a]of t){const c=a.filter(l=>l.output!==s);c.length===0?t.delete(o):t.set(o,c)}else if(t.has(s))if(n===void 0)t.delete(s);else{const o=t.get(s);if(o!==void 0){const a=o.filter(c=>c.output!==n&&(c.input!==r||r===void 0));a.length===0?t.delete(s):t.set(s,a)}}for(const[o,a]of t)a.forEach(c=>{Gr(o)?i.connect(o,c.output,c.input):i.connect(o,c.output)})})(i.disconnect)},fp=(i,t,e,s)=>{const{activeInputs:n,passiveInputs:r}=ar(t),{outputs:o}=re(i),a=rr(i),c=l=>{const u=Dt(i),h=Ai(t);if(l){const d=Ou(r,i,e);_l(n,i,d,!1),!s&&!on(i)&&u.connect(h,e)}else{const d=hp(n,i,e);gl(r,d,!1),!s&&!on(i)&&u.disconnect(h,e)}};return fn(o,[t,e],l=>l[0]===t&&l[1]===e,!0)?(a.add(c),ds(i)?_l(n,i,[e,c],!0):gl(r,[i,e,c],!0),!0):!1},pp=(i,t,e,s)=>{const{activeInputs:n,passiveInputs:r}=re(t),o=Su(n[s],i,e);return o===null?[Tu(r,i,e,s)[2],!1]:[o[2],!0]},mp=(i,t,e)=>{const{activeInputs:s,passiveInputs:n}=ar(t),r=Su(s,i,e);return r===null?[Ou(n,i,e)[1],!1]:[r[2],!0]},Wa=(i,t,e,s,n)=>{const[r,o]=pp(i,e,s,n);if(r!==null&&(Eu(i,r),o&&!t&&!on(i)&&Hr(Dt(i),Dt(e),s,n)),ds(e)){const{activeInputs:a}=re(e);_a(e,a)}},Ha=(i,t,e,s)=>{const[n,r]=mp(i,e,s);n!==null&&(Eu(i,n),r&&!t&&!on(i)&&Dt(i).disconnect(Ai(e),s))},_p=(i,t)=>{const e=re(i),s=[];for(const n of e.outputs)cr(n)?Wa(i,t,...n):Ha(i,t,...n),s.push(n[0]);return e.outputs.clear(),s},gp=(i,t,e)=>{const s=re(i),n=[];for(const r of s.outputs)r[1]===e&&(cr(r)?Wa(i,t,...r):Ha(i,t,...r),n.push(r[0]),s.outputs.delete(r));return n},yp=(i,t,e,s,n)=>{const r=re(i);return Array.from(r.outputs).filter(o=>o[0]===e&&(s===void 0||o[1]===s)&&(n===void 0||o[2]===n)).map(o=>(cr(o)?Wa(i,t,...o):Ha(i,t,...o),r.outputs.delete(o),o[0]))},vp=(i,t,e,s,n,r,o,a,c,l,u,h,d,p,_,f)=>class extends l{constructor(v,b,w,g){super(w),this._context=v,this._nativeAudioNode=w;const y=u(v);h(y)&&e(yl,()=>yl(y,f))!==!0&&dp(w),za.set(this,w),xu.set(this,new Set),v.state!=="closed"&&b&&Un(this),i(this,g,w)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(v){this._nativeAudioNode.channelCount=v}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(v){this._nativeAudioNode.channelCountMode=v}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(v){this._nativeAudioNode.channelInterpretation=v}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(v,b=0,w=0){if(b<0||b>=this._nativeAudioNode.numberOfOutputs)throw n();const g=u(this._context),y=_(g);if(d(v)||p(v))throw r();if(qr(v)){const x=Dt(v);try{const O=Wr(this._nativeAudioNode,x,b,w),P=Rr(this);(y||P)&&this._nativeAudioNode.disconnect(...O),this.context.state!=="closed"&&!P&&Rr(v)&&Un(v)}catch(O){throw O.code===12?r():O}if(t(this,v,b,w,y)){const O=c([this],v);Zo(O,s(y))}return v}const k=Ai(v);if(k.name==="playbackRate"&&k.maxValue===1024)throw o();try{this._nativeAudioNode.connect(k,b),(y||Rr(this))&&this._nativeAudioNode.disconnect(k,b)}catch(x){throw x.code===12?r():x}if(fp(this,v,b,y)){const x=c([this],v);Zo(x,s(y))}}disconnect(v,b,w){let g;const y=u(this._context),k=_(y);if(v===void 0)g=_p(this,k);else if(typeof v=="number"){if(v<0||v>=this.numberOfOutputs)throw n();g=gp(this,k,v)}else{if(b!==void 0&&(b<0||b>=this.numberOfOutputs)||qr(v)&&w!==void 0&&(w<0||w>=v.numberOfInputs))throw n();if(g=yp(this,k,v,b,w),g.length===0)throw r()}for(const T of g){const x=c([this],T);Zo(x,a)}}},xp=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>(p,_,f,m=null,v=null)=>{const b=f.value,w=new M0(b),g=_?s(w):null,y={get defaultValue(){return b},get maxValue(){return m===null?f.maxValue:m},get minValue(){return v===null?f.minValue:v},get value(){return f.value},set value(k){f.value=k,y.setValueAtTime(k,p.context.currentTime)},cancelAndHoldAtTime(k){if(typeof f.cancelAndHoldAtTime=="function")g===null&&w.flush(p.context.currentTime),w.add(n(k)),f.cancelAndHoldAtTime(k);else{const T=Array.from(w).pop();g===null&&w.flush(p.context.currentTime),w.add(n(k));const x=Array.from(w).pop();f.cancelScheduledValues(k),T!==x&&x!==void 0&&(x.type==="exponentialRampToValue"?f.exponentialRampToValueAtTime(x.value,x.endTime):x.type==="linearRampToValue"?f.linearRampToValueAtTime(x.value,x.endTime):x.type==="setValue"?f.setValueAtTime(x.value,x.startTime):x.type==="setValueCurve"&&f.setValueCurveAtTime(x.values,x.startTime,x.duration))}return y},cancelScheduledValues(k){return g===null&&w.flush(p.context.currentTime),w.add(r(k)),f.cancelScheduledValues(k),y},exponentialRampToValueAtTime(k,T){if(k===0)throw new RangeError;if(!Number.isFinite(T)||T<0)throw new RangeError;const x=p.context.currentTime;return g===null&&w.flush(x),Array.from(w).length===0&&(w.add(l(b,x)),f.setValueAtTime(b,x)),w.add(o(k,T)),f.exponentialRampToValueAtTime(k,T),y},linearRampToValueAtTime(k,T){const x=p.context.currentTime;return g===null&&w.flush(x),Array.from(w).length===0&&(w.add(l(b,x)),f.setValueAtTime(b,x)),w.add(a(k,T)),f.linearRampToValueAtTime(k,T),y},setTargetAtTime(k,T,x){return g===null&&w.flush(p.context.currentTime),w.add(c(k,T,x)),f.setTargetAtTime(k,T,x),y},setValueAtTime(k,T){return g===null&&w.flush(p.context.currentTime),w.add(l(k,T)),f.setValueAtTime(k,T),y},setValueCurveAtTime(k,T,x){const C=k instanceof Float32Array?k:new Float32Array(k);if(h!==null&&h.name==="webkitAudioContext"){const O=T+x,P=p.context.sampleRate,M=Math.ceil(T*P),V=Math.floor(O*P),B=V-M,Y=new Float32Array(B);for(let z=0;z({replay(t){for(const e of i)if(e.type==="exponentialRampToValue"){const{endTime:s,value:n}=e;t.exponentialRampToValueAtTime(n,s)}else if(e.type==="linearRampToValue"){const{endTime:s,value:n}=e;t.linearRampToValueAtTime(n,s)}else if(e.type==="setTarget"){const{startTime:s,target:n,timeConstant:r}=e;t.setTargetAtTime(n,s,r)}else if(e.type==="setValue"){const{startTime:s,value:n}=e;t.setValueAtTime(n,s)}else if(e.type==="setValueCurve"){const{duration:s,startTime:n,values:r}=e;t.setValueCurveAtTime(r,n,s)}else throw new Error("Can't apply an unknown automation.")}});class Au{constructor(t){this._map=new Map(t)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(t,e=null){return this._map.forEach((s,n)=>t.call(e,s,n,this))}get(t){return this._map.get(t)}has(t){return this._map.has(t)}keys(){return this._map.keys()}values(){return this._map.values()}}const Tp={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},wp=(i,t,e,s,n,r,o,a,c,l,u,h,d,p)=>class extends t{constructor(f,m,v){var b;const w=a(f),g=c(w),y=u({...Tp,...v});d(y);const k=pa.get(w),T=k==null?void 0:k.get(m),x=g||w.state!=="closed"?w:(b=o(w))!==null&&b!==void 0?b:w,C=n(x,g?null:f.baseLatency,l,m,T,y),O=g?s(m,y,T):null;super(f,!0,C,O);const P=[];C.parameters.forEach((V,B)=>{const Y=e(this,g,V);P.push([B,Y])}),this._nativeAudioWorkletNode=C,this._onprocessorerror=null,this._parameters=new Au(P),g&&i(w,this);const{activeInputs:M}=r(this);h(C,M)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(f){const m=typeof f=="function"?p(this,f):null;this._nativeAudioWorkletNode.onprocessorerror=m;const v=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=v!==null&&v===m?f:v}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function Yr(i,t,e,s,n){if(typeof i.copyFromChannel=="function")t[e].byteLength===0&&(t[e]=new Float32Array(128)),i.copyFromChannel(t[e],s,n);else{const r=i.getChannelData(s);if(t[e].byteLength===0)t[e]=r.slice(n,n+128);else{const o=new Float32Array(r.buffer,n*Float32Array.BYTES_PER_ELEMENT,128);t[e].set(o)}}}const Mu=(i,t,e,s,n)=>{typeof i.copyToChannel=="function"?t[e].byteLength!==0&&i.copyToChannel(t[e],s,n):t[e].byteLength!==0&&i.getChannelData(s).set(t[e],n)},$r=(i,t)=>{const e=[];for(let s=0;s{const e=ze(ma,i),s=Dt(t);return ze(e,s)},Cp=async(i,t,e,s,n,r,o)=>{const a=t===null?Math.ceil(i.context.length/128)*128:t.length,c=s.channelCount*s.numberOfInputs,l=n.reduce((m,v)=>m+v,0),u=l===0?null:e.createBuffer(l,a,e.sampleRate);if(r===void 0)throw new Error("Missing the processor constructor.");const h=re(i),d=await bp(e,i),p=$r(s.numberOfInputs,s.channelCount),_=$r(s.numberOfOutputs,n),f=Array.from(i.parameters.keys()).reduce((m,v)=>({...m,[v]:new Float32Array(128)}),{});for(let m=0;m0&&t!==null)for(let v=0;v{Yr(t,f,v,c+b,m)});for(let v=0;vh.activeInputs[g].size===0?[]:w),b=o(m/e.sampleRate,e.sampleRate,()=>d.process(v,_,f));if(u!==null)for(let w=0,g=0;w(m,v,b)=>{const w=new WeakMap;let g=null;const y=async(k,T)=>{let x=u(k),C=null;const O=se(x,T),P=Array.isArray(v.outputChannelCount)?v.outputChannelCount:Array.from(v.outputChannelCount);if(h===null){const M=P.reduce((G,z)=>G+z,0),V=n(T,{channelCount:Math.max(1,M),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,M)}),B=[];for(let G=0;G{const et=new d(Z,Math.ceil(k.context.length/128)*128,T.sampleRate),R=[],F=[];for(let H=0;H{const N=r(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:H.value});return await p(et,H,N.offset),N})),I=s(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,z+j)});for(let H=0;H_(k,et,H))),f(et)})(),T,v,P,b,l)}const M=await g,V=e(T,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[B,Y,G]=C;M!==null&&(V.buffer=M,V.start(0)),V.connect(B);for(let z=0,j=0;zclass extends _{constructor(y,k){super(y,k),this._nativeContext=y,this._audioWorklet=i===void 0?void 0:{addModule:(T,x)=>i(this,T,x)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new t(this)}createBiquadFilter(){return new n(this)}createBuffer(y,k,T){return new e({length:k,numberOfChannels:y,sampleRate:T})}createBufferSource(){return new s(this)}createChannelMerger(y=6){return new r(this,{numberOfInputs:y})}createChannelSplitter(y=6){return new o(this,{numberOfOutputs:y})}createConstantSource(){return new a(this)}createConvolver(){return new c(this)}createDelay(y=1){return new u(this,{maxDelayTime:y})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(y,k){return new p(this,{feedback:k,feedforward:y})}createOscillator(){return new f(this)}createPanner(){return new m(this)}createPeriodicWave(y,k,T={disableNormalization:!1}){return new v(this,{...T,imag:k,real:y})}createStereoPanner(){return new b(this)}createWaveShaper(){return new w(this)}decodeAudioData(y,k,T){return l(this._nativeContext,y).then(x=>(typeof k=="function"&&k(x),x),x=>{throw typeof T=="function"&&T(x),x})}},Op={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},Ap=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...Op,...u},p=n(h,d),_=o(h),f=_?e():null;super(l,!1,p,f),this._Q=t(this,_,p.Q,ne,le),this._detune=t(this,_,p.detune,1200*Math.log2(ne),-1200*Math.log2(ne)),this._frequency=t(this,_,p.frequency,l.sampleRate/2,0),this._gain=t(this,_,p.gain,40*Math.log10(ne),le),this._nativeBiquadFilterNode=p,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()}},Mp=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(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=t(c,h)}return r.set(c,l),u?(await i(c,a.Q,l.Q),await i(c,a.detune,l.detune),await i(c,a.frequency,l.frequency),await i(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 n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},Dp=(i,t)=>(e,s)=>{const n=t.get(e);if(n!==void 0)return n;const r=i.get(e);if(r!==void 0)return r;try{const o=s();return o instanceof Promise?(i.set(e,o),o.catch(()=>!1).then(a=>(i.delete(e),t.set(e,a),a))):(t.set(e,o),o)}catch{return t.set(e,!1),!1}},Pp={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},Ip=(i,t,e,s,n)=>class extends i{constructor(o,a){const c=s(o),l={...Pp,...a},u=e(c,l),h=n(c)?t():null;super(o,!1,u,h)}},Np=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Rp={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},Fp=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u=r({...Rp,...c}),h=e(l,u),d=n(l)?t():null;super(a,!1,h,d)}},Lp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Vp=i=>(t,e,s)=>i(e,t,s),Up=i=>(t,e,s=0,n=0)=>{const r=t[s];if(r===void 0)throw i();return Gr(e)?r.connect(e,0,n):r.connect(e,0)},jp=i=>(t,e)=>{const s=i(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),n=t.createBuffer(1,2,44100);return s.buffer=n,s.loop=!0,s.connect(e),s.start(),()=>{s.stop(),s.disconnect(e)}},zp={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},Bp=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...zp,...l},d=s(u,h),p=r(u),_=p?e():null;super(c,!1,d,_),this._constantSourceNodeRenderer=_,this._nativeConstantSourceNode=d,this._offset=t(this,p,d.offset,ne,le),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"){Un(this);const l=()=>{this._nativeConstantSourceNode.removeEventListener("ended",l),ds(this)&&or(this)};this._nativeConstantSourceNode.addEventListener("ended",l)}}stop(c=0){this._nativeConstantSourceNode.stop(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=c)}},qp=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=e(l);const d=se(h,u);if(!d){const p={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,offset:h.offset.value};h=t(u,p),o!==null&&h.start(o),a!==null&&h.stop(a)}return r.set(u,h),d?await i(u,l.offset,h.offset):await s(u,l.offset,h.offset),await n(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)}}},Wp=i=>t=>(i[0]=t,i[0]),Hp={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},Gp=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u={...Hp,...c},h=e(l,u),p=n(l)?t():null;super(a,!1,h,p),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}},Yp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=i(o,l)}return s.set(o,a),Qn(a)?await e(r,o,a.inputs[0]):await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},$p=(i,t)=>(e,s,n)=>{if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(e,s,n)}catch(r){throw r.name==="SyntaxError"?i():r}},Zp=()=>new DOMException("","DataCloneError"),vl=i=>{const{port1:t,port2:e}=new MessageChannel;return new Promise(s=>{const n=()=>{e.onmessage=null,t.close(),e.close(),s()};e.onmessage=()=>n();try{t.postMessage(i,[i])}catch{}finally{n()}})},Xp=(i,t,e,s,n,r,o,a,c,l,u)=>(h,d)=>{const p=o(h)?h:r(h);if(n.has(d)){const _=e();return Promise.reject(_)}try{n.add(d)}catch{}return t(c,()=>c(p))?p.decodeAudioData(d).then(_=>(vl(d).catch(()=>{}),t(a,()=>a(_))||u(_),i.add(_),_)):new Promise((_,f)=>{const m=async()=>{try{await vl(d)}catch{}},v=b=>{f(b),m()};try{p.decodeAudioData(d,b=>{typeof b.copyFromChannel!="function"&&(l(b),qa(b)),i.add(b),m().then(()=>_(b))},b=>{v(b===null?s():b)})}catch(b){v(b)}})},Qp=(i,t,e,s,n,r,o,a)=>(c,l)=>{const u=t.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(t.delete(c),!d&&o(c)){const p=s(c),{outputs:_}=e(c);for(const f of _)if(cr(f)){const m=s(f[0]);i(p,m,f[1],f[2])}else{const m=n(f[0]);p.connect(m,f[1])}}}else t.set(c,u-l)},Kp={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},Jp=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...Kp,...l},d=s(u,h),p=r(u),_=p?e(h.maxDelayTime):null;super(c,!1,d,_),this._delayTime=t(this,p,d.delayTime),o(this,h.maxDelayTime)}get delayTime(){return this._delayTime}},tm=(i,t,e,s,n)=>r=>{const o=new WeakMap,a=async(c,l)=>{let u=e(c);const h=se(u,l);if(!h){const d={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:r};u=t(l,d)}return o.set(l,u),h?await i(l,c.delayTime,u.delayTime):await s(l,c.delayTime,u.delayTime),await n(c,l,u),u};return{render(c,l){const u=o.get(l);return u!==void 0?Promise.resolve(u):a(c,l)}}},em=i=>(t,e,s,n)=>i(t[n],r=>r[0]===e&&r[1]===s),sm=i=>(t,e)=>{i(t).delete(e)},nm=i=>"delayTime"in i,im=(i,t,e)=>function s(n,r){const o=qr(r)?r:e(i,r);if(nm(o))return[];if(n[0]===o)return[n];if(n.includes(o))return[];const{outputs:a}=t(o);return Array.from(a).map(c=>s([...n,o],c[0])).reduce((c,l)=>c.concat(l),[])},Er=(i,t,e)=>{const s=t[e];if(s===void 0)throw i();return s},rm=i=>(t,e=void 0,s=void 0,n=0)=>e===void 0?t.forEach(r=>r.disconnect()):typeof e=="number"?Er(i,t,e).disconnect():Gr(e)?s===void 0?t.forEach(r=>r.disconnect(e)):n===void 0?Er(i,t,s).disconnect(e,0):Er(i,t,s).disconnect(e,0,n):s===void 0?t.forEach(r=>r.disconnect(e)):Er(i,t,s).disconnect(e,0),om={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},am=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...om,...u},p=s(h,d),_=o(h),f=_?e():null;super(l,!1,p,f),this._attack=t(this,_,p.attack),this._knee=t(this,_,p.knee),this._nativeDynamicsCompressorNode=p,this._ratio=t(this,_,p.ratio),this._release=t(this,_,p.release),this._threshold=t(this,_,p.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,n()}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,n()}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}},cm=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(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=t(c,h)}return r.set(c,l),u?(await i(c,a.attack,l.attack),await i(c,a.knee,l.knee),await i(c,a.ratio,l.ratio),await i(c,a.release,l.release),await i(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 n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},lm=()=>new DOMException("","EncodingError"),um=i=>t=>new Promise((e,s)=>{if(i===null){s(new SyntaxError);return}const n=i.document.head;if(n===null)s(new SyntaxError);else{const r=i.document.createElement("script"),o=new Blob([t],{type:"application/javascript"}),a=URL.createObjectURL(o),c=i.onerror,l=()=>{i.onerror=c,URL.revokeObjectURL(a)};i.onerror=(u,h,d,p,_)=>{if(h===a||h===i.location.href&&d===1&&p===1)return l(),s(_),!1;if(c!==null)return c(u,h,d,p,_)},r.onerror=()=>{l(),s(new SyntaxError)},r.onload=()=>{l(),e()},r.src=a,r.type="module",n.appendChild(r)}}),hm=i=>class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(e,s,n){if(s!==null){let r=this._listeners.get(s);r===void 0&&(r=i(this,s),typeof s=="function"&&this._listeners.set(s,r)),this._nativeEventTarget.addEventListener(e,r,n)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,s,n){const r=s===null?void 0:this._listeners.get(s);this._nativeEventTarget.removeEventListener(e,r===void 0?null:r,n)}},dm=i=>(t,e,s)=>{Object.defineProperties(i,{currentFrame:{configurable:!0,get(){return Math.round(t*e)}},currentTime:{configurable:!0,get(){return t}}});try{return s()}finally{i!==null&&(delete i.currentFrame,delete i.currentTime)}},fm=i=>async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw i()},pm={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},mm=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...pm,...c},h=s(l,u),d=r(l),p=d?e():null;super(a,!1,h,p),this._gain=t(this,d,h.gain,ne,le)}get gain(){return this._gain}},_m=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(c,h)}return r.set(c,l),u?await i(c,a.gain,l.gain):await s(c,a.gain,l.gain),await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},gm=(i,t)=>e=>t(i,e),ym=i=>t=>{const e=i(t);if(e.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return e.renderer},vm=i=>t=>{var e;return(e=i.get(t))!==null&&e!==void 0?e:0},xm=i=>t=>{const e=i(t);if(e.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return e.renderer},km=i=>t=>i.get(t),Zt=()=>new DOMException("","InvalidStateError"),Tm=i=>t=>{const e=i.get(t);if(e===void 0)throw Zt();return e},wm=(i,t)=>e=>{let s=i.get(e);if(s!==void 0)return s;if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new t(1,1,44100),i.set(e,s),s},bm=i=>t=>{const e=i.get(t);if(e===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return e},wo=()=>new DOMException("","InvalidAccessError"),Cm=i=>{i.getFrequencyResponse=(t=>(e,s,n)=>{if(e.length!==s.length||s.length!==n.length)throw wo();return t.call(i,e,s,n)})(i.getFrequencyResponse)},Sm={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},Em=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u=n(l),h={...Sm,...c},d=t(l,u?null:a.baseLatency,h),p=u?e(h.feedback,h.feedforward):null;super(a,!1,d,p),Cm(d),this._nativeIIRFilterNode=d,r(this,1)}getFrequencyResponse(a,c,l){return this._nativeIIRFilterNode.getFrequencyResponse(a,c,l)}},Du=(i,t,e,s,n,r,o,a,c,l,u)=>{const h=l.length;let d=a;for(let p=0;p{const n=e instanceof Float64Array?e:new Float64Array(e),r=s instanceof Float64Array?s:new Float64Array(s),o=n.length,a=r.length,c=Math.min(o,a);if(n[0]!==1){for(let _=0;_(r,o)=>{const a=new WeakMap;let c=null;const l=async(u,h)=>{let d=null,p=t(u);const _=se(p,h);if(h.createIIRFilter===void 0?d=i(h,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):_||(p=h.createIIRFilter(o,r)),a.set(h,d===null?p:d),d!==null){if(c===null){if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");const m=new e(u.context.destination.channelCount,u.context.length,h.sampleRate);c=(async()=>{await s(u,m,m.destination);const v=await n(m);return Om(v,h,r,o)})()}const f=await c;return d.buffer=f,d.start(0),d}return await s(u,h,p),p};return{render(u,h){const d=a.get(h);return d!==void 0?Promise.resolve(d):l(u,h)}}},Mm=(i,t,e,s,n,r)=>o=>(a,c)=>{const l=i.get(a);if(l===void 0){if(!o&&r(a)){const u=s(a),{outputs:h}=e(a);for(const d of h)if(cr(d)){const p=s(d[0]);t(u,p,d[1],d[2])}else{const p=n(d[0]);u.disconnect(p,d[1])}}i.set(a,c)}else i.set(a,l+c)},Dm=(i,t)=>e=>{const s=i.get(e);return t(s)||t(e)},Pm=(i,t)=>e=>i.has(e)||t(e),Im=(i,t)=>e=>i.has(e)||t(e),Nm=(i,t)=>e=>{const s=i.get(e);return t(s)||t(e)},Rm=i=>t=>i!==null&&t instanceof i,Fm=i=>t=>i!==null&&typeof i.AudioNode=="function"&&t instanceof i.AudioNode,Lm=i=>t=>i!==null&&typeof i.AudioParam=="function"&&t instanceof i.AudioParam,Vm=(i,t)=>e=>i(e)||t(e),Um=i=>t=>i!==null&&t instanceof i,jm=i=>i!==null&&i.isSecureContext,zm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r),c=t(a,o);if(s(a))throw TypeError();super(r,!0,c,null),this._nativeMediaElementAudioSourceNode=c}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},Bm={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},qm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r);if(s(a))throw new TypeError;const c={...Bm,...o},l=t(a,c);super(r,!1,l,null),this._nativeMediaStreamAudioDestinationNode=l}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},Wm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r),c=t(a,o);if(s(a))throw new TypeError;super(r,!0,c,null),this._nativeMediaStreamAudioSourceNode=c}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},Hm=(i,t,e)=>class extends i{constructor(n,r){const o=e(n),a=t(o,r);super(n,!0,a,null)}},Gm=(i,t,e,s,n,r)=>class extends e{constructor(a,c){super(a),this._nativeContext=a,ko.set(this,a),s(a)&&n.set(a,new Set),this._destination=new i(this,c),this._listener=t(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}},Mi=i=>{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const e=i.decodeAudioData(t.buffer,()=>{});return e===void 0?!1:(e.catch(()=>{}),!0)}catch{}return!1},Ym=(i,t)=>(e,s,n)=>{const r=new Set;return e.connect=(o=>(a,c=0,l=0)=>{const u=r.size===0;if(t(a))return o.call(e,a,c,l),i(r,[a,c,l],h=>h[0]===a&&h[1]===c&&h[2]===l,!0),u&&s(),a;o.call(e,a,c),i(r,[a,c],h=>h[0]===a&&h[1]===c,!0),u&&s()})(e.connect),e.disconnect=(o=>(a,c,l)=>{const u=r.size>0;if(a===void 0)o.apply(e),r.clear();else if(typeof a=="number"){o.call(e,a);for(const d of r)d[1]===a&&r.delete(d)}else{t(a)?o.call(e,a,c,l):o.call(e,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&&n()})(e.disconnect),e},Pt=(i,t,e)=>{const s=t[e];s!==void 0&&s!==i[e]&&(i[e]=s)},Yt=(i,t)=>{Pt(i,t,"channelCount"),Pt(i,t,"channelCountMode"),Pt(i,t,"channelInterpretation")},xl=i=>typeof i.getFloatTimeDomainData=="function",$m=i=>{i.getFloatTimeDomainData=t=>{const e=new Uint8Array(t.length);i.getByteTimeDomainData(e);const s=Math.max(e.length,i.fftSize);for(let n=0;n(e,s)=>{const n=e.createAnalyser();if(Yt(n,s),!(s.maxDecibels>s.minDecibels))throw t();return Pt(n,s,"fftSize"),Pt(n,s,"maxDecibels"),Pt(n,s,"minDecibels"),Pt(n,s,"smoothingTimeConstant"),i(xl,()=>xl(n))||$m(n),n},Xm=i=>i===null?null:i.hasOwnProperty("AudioBuffer")?i.AudioBuffer:null,Ft=(i,t,e)=>{const s=t[e];s!==void 0&&s!==i[e].value&&(i[e].value=s)},Qm=i=>{i.start=(t=>{let e=!1;return(s=0,n=0,r)=>{if(e)throw Zt();t.call(i,s,n,r),e=!0}})(i.start)},Ga=i=>{i.start=(t=>(e=0,s=0,n)=>{if(typeof n=="number"&&n<0||s<0||e<0)throw new RangeError("The parameters can't be negative.");t.call(i,e,s,n)})(i.start)},Ya=i=>{i.stop=(t=>(e=0)=>{if(e<0)throw new RangeError("The parameter can't be negative.");t.call(i,e)})(i.stop)},Km=(i,t,e,s,n,r,o,a,c,l,u)=>(h,d)=>{const p=h.createBufferSource();return Yt(p,d),Ft(p,d,"playbackRate"),Pt(p,d,"buffer"),Pt(p,d,"loop"),Pt(p,d,"loopEnd"),Pt(p,d,"loopStart"),t(e,()=>e(h))||Qm(p),t(s,()=>s(h))||c(p),t(n,()=>n(h))||l(p,h),t(r,()=>r(h))||Ga(p),t(o,()=>o(h))||u(p,h),t(a,()=>a(h))||Ya(p),i(h,p),p},Jm=i=>i===null?null:i.hasOwnProperty("AudioContext")?i.AudioContext:i.hasOwnProperty("webkitAudioContext")?i.webkitAudioContext:null,t_=(i,t)=>(e,s,n)=>{const r=e.destination;if(r.channelCount!==s)try{r.channelCount=s}catch{}n&&r.channelCountMode!=="explicit"&&(r.channelCountMode="explicit"),r.maxChannelCount===0&&Object.defineProperty(r,"maxChannelCount",{value:s});const o=i(e,{channelCount:s,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,gain:1});return t(o,"channelCount",a=>()=>a.call(o),a=>c=>{a.call(o,c);try{r.channelCount=c}catch(l){if(c>r.maxChannelCount)throw l}}),t(o,"channelCountMode",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelCountMode=c}),t(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},e_=i=>i===null?null:i.hasOwnProperty("AudioWorkletNode")?i.AudioWorkletNode:null,s_=i=>{const{port1:t}=new MessageChannel;try{t.postMessage(i)}finally{t.close()}},n_=(i,t,e,s,n)=>(r,o,a,c,l,u)=>{if(a!==null)try{const h=new a(r,c,u),d=new Map;let p=null;if(Object.defineProperties(h,{channelCount:{get:()=>u.channelCount,set:()=>{throw i()}},channelCountMode:{get:()=>"explicit",set:()=>{throw i()}},onprocessorerror:{get:()=>p,set:_=>{typeof p=="function"&&h.removeEventListener("processorerror",p),p=typeof _=="function"?_:null,typeof p=="function"&&h.addEventListener("processorerror",p)}}}),h.addEventListener=(_=>(...f)=>{if(f[0]==="processorerror"){const m=typeof f[1]=="function"?f[1]:typeof f[1]=="object"&&f[1]!==null&&typeof f[1].handleEvent=="function"?f[1].handleEvent:null;if(m!==null){const v=d.get(f[1]);v!==void 0?f[1]=v:(f[1]=b=>{b.type==="error"?(Object.defineProperties(b,{type:{value:"processorerror"}}),m(b)):m(new ErrorEvent(f[0],{...b}))},d.set(m,f[1]))}}return _.call(h,"error",f[1],f[2]),_.call(h,...f)})(h.addEventListener),h.removeEventListener=(_=>(...f)=>{if(f[0]==="processorerror"){const m=d.get(f[1]);m!==void 0&&(d.delete(f[1]),f[1]=m)}return _.call(h,"error",f[1],f[2]),_.call(h,f[0],f[1],f[2])})(h.removeEventListener),u.numberOfOutputs!==0){const _=e(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return h.connect(_).connect(r.destination),n(h,()=>_.disconnect(),()=>_.connect(r.destination))}return h}catch(h){throw h.code===11?s():h}if(l===void 0)throw s();return s_(u),t(r,o,l,u)},Pu=(i,t)=>i===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(i*t))))),i_=i=>new Promise((t,e)=>{const{port1:s,port2:n}=new MessageChannel;s.onmessage=({data:r})=>{s.close(),n.close(),t(r)},s.onmessageerror=({data:r})=>{s.close(),n.close(),e(r)},n.postMessage(i)}),r_=async(i,t)=>{const e=await i_(t);return new i(e)},o_=(i,t,e,s)=>{let n=ma.get(i);n===void 0&&(n=new WeakMap,ma.set(i,n));const r=r_(e,s);return n.set(t,r),r},a_=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>(p,_,f,m)=>{if(m.numberOfInputs===0&&m.numberOfOutputs===0)throw c();const v=Array.isArray(m.outputChannelCount)?m.outputChannelCount:Array.from(m.outputChannelCount);if(v.some(q=>q<1))throw c();if(v.length!==m.numberOfOutputs)throw t();if(m.channelCountMode!=="explicit")throw c();const b=m.channelCount*m.numberOfInputs,w=v.reduce((q,A)=>q+A,0),g=f.parameterDescriptors===void 0?0:f.parameterDescriptors.length;if(b+g>6||w>6)throw c();const y=new MessageChannel,k=[],T=[];for(let q=0;qq===void 0?0:q},maxValue:{get:()=>A===void 0?ne:A},minValue:{get:()=>E===void 0?le:E}}),x.push(tt)}const C=s(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+g)}),O=Pu(_,p.sampleRate),P=a(p,O,b+g,Math.max(1,w)),M=n(p,{channelCount:Math.max(1,w),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,w)}),V=[];for(let q=0;q{const E=x[A];return E.connect(C,0,b+A),E.start(0),[q,E.offset]}));C.connect(P);let Y=m.channelInterpretation,G=null;const z=m.numberOfOutputs===0?[P]:V,j={get bufferSize(){return O},get channelCount(){return m.channelCount},set channelCount(q){throw e()},get channelCountMode(){return m.channelCountMode},set channelCountMode(q){throw e()},get channelInterpretation(){return Y},set channelInterpretation(q){for(const A of k)A.channelInterpretation=q;Y=q},get context(){return P.context},get inputs(){return k},get numberOfInputs(){return m.numberOfInputs},get numberOfOutputs(){return m.numberOfOutputs},get onprocessorerror(){return G},set onprocessorerror(q){typeof G=="function"&&j.removeEventListener("processorerror",G),G=typeof q=="function"?q:null,typeof G=="function"&&j.addEventListener("processorerror",G)},get parameters(){return B},get port(){return y.port2},addEventListener(...q){return P.addEventListener(q[0],q[1],q[2])},connect:i.bind(null,z),disconnect:l.bind(null,z),dispatchEvent(...q){return P.dispatchEvent(q[0])},removeEventListener(...q){return P.removeEventListener(q[0],q[1],q[2])}},Z=new Map;y.port1.addEventListener=(q=>(...A)=>{if(A[0]==="message"){const E=typeof A[1]=="function"?A[1]:typeof A[1]=="object"&&A[1]!==null&&typeof A[1].handleEvent=="function"?A[1].handleEvent:null;if(E!==null){const X=Z.get(A[1]);X!==void 0?A[1]=X:(A[1]=tt=>{u(p.currentTime,p.sampleRate,()=>E(tt))},Z.set(E,A[1]))}}return q.call(y.port1,A[0],A[1],A[2])})(y.port1.addEventListener),y.port1.removeEventListener=(q=>(...A)=>{if(A[0]==="message"){const E=Z.get(A[1]);E!==void 0&&(Z.delete(A[1]),A[1]=E)}return q.call(y.port1,A[0],A[1],A[2])})(y.port1.removeEventListener);let Q=null;Object.defineProperty(y.port1,"onmessage",{get:()=>Q,set:q=>{typeof Q=="function"&&y.port1.removeEventListener("message",Q),Q=typeof q=="function"?q:null,typeof Q=="function"&&(y.port1.addEventListener("message",Q),y.port1.start())}}),f.prototype.port=y.port1;let et=null;o_(p,j,f,m).then(q=>et=q);const F=$r(m.numberOfInputs,m.channelCount),S=$r(m.numberOfOutputs,v),I=f.parameterDescriptors===void 0?[]:f.parameterDescriptors.reduce((q,{name:A})=>({...q,[A]:new Float32Array(128)}),{});let H=!0;const N=()=>{m.numberOfOutputs>0&&P.disconnect(M);for(let q=0,A=0;q{if(et!==null){const E=h(j);for(let X=0;X{Yr(q,I,tt,b+lt,X)});for(let tt=0;tt{if(E[Gt].size>0)return U.set(Gt,O/128),vt;const si=U.get(Gt);return si===void 0?[]:(vt.every(Lo=>Lo.every(_r=>_r===0))&&(si===1?U.delete(Gt):U.set(Gt,si-1)),vt)});H=u(p.currentTime+X/p.sampleRate,p.sampleRate,()=>et.process(tt,S,I));for(let vt=0,Gt=0;vtP.connect(st).connect(p.destination),J=()=>{P.disconnect(st),st.disconnect()},pt=()=>{if(H){J(),m.numberOfOutputs>0&&P.connect(M);for(let q=0,A=0;q{H&&(nt(),N()),it=!1};return nt(),d(j,pt,K)},Iu=(i,t)=>{const e=i.createBiquadFilter();return Yt(e,t),Ft(e,t,"Q"),Ft(e,t,"detune"),Ft(e,t,"frequency"),Ft(e,t,"gain"),Pt(e,t,"type"),e},c_=(i,t)=>(e,s)=>{const n=e.createChannelMerger(s.numberOfInputs);return i!==null&&i.name==="webkitAudioContext"&&t(e,n),Yt(n,s),n},l_=i=>{const t=i.numberOfOutputs;Object.defineProperty(i,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw Zt()}}),Object.defineProperty(i,"channelCountMode",{get:()=>"explicit",set:e=>{if(e!=="explicit")throw Zt()}}),Object.defineProperty(i,"channelInterpretation",{get:()=>"discrete",set:e=>{if(e!=="discrete")throw Zt()}})},lr=(i,t)=>{const e=i.createChannelSplitter(t.numberOfOutputs);return Yt(e,t),l_(e),e},u_=(i,t,e,s,n)=>(r,o)=>{if(r.createConstantSource===void 0)return e(r,o);const a=r.createConstantSource();return Yt(a,o),Ft(a,o,"offset"),t(s,()=>s(r))||Ga(a),t(n,()=>n(r))||Ya(a),i(r,a),a},Kn=(i,t)=>(i.connect=t.connect.bind(t),i.disconnect=t.disconnect.bind(t),i),h_=(i,t,e,s)=>(n,{offset:r,...o})=>{const a=n.createBuffer(1,2,44100),c=t(n,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),l=e(n,{...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(_){l.channelCount=_},get channelCountMode(){return l.channelCountMode},set channelCountMode(_){l.channelCountMode=_},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(_){l.channelInterpretation=_},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(_){c.onended=_},addEventListener(..._){return c.addEventListener(_[0],_[1],_[2])},dispatchEvent(..._){return c.dispatchEvent(_[0])},removeEventListener(..._){return c.removeEventListener(_[0],_[1],_[2])},start(_=0){c.start.call(c,_)},stop(_=0){c.stop.call(c,_)}},d=()=>c.connect(l),p=()=>c.disconnect(l);return i(n,c),s(Kn(h,l),d,p)},d_=(i,t)=>(e,s)=>{const n=e.createConvolver();if(Yt(n,s),s.disableNormalization===n.normalize&&(n.normalize=!s.disableNormalization),Pt(n,s,"buffer"),s.channelCount>2||(t(n,"channelCount",r=>()=>r.call(n),r=>o=>{if(o>2)throw i();return r.call(n,o)}),s.channelCountMode==="max"))throw i();return t(n,"channelCountMode",r=>()=>r.call(n),r=>o=>{if(o==="max")throw i();return r.call(n,o)}),n},Nu=(i,t)=>{const e=i.createDelay(t.maxDelayTime);return Yt(e,t),Ft(e,t,"delayTime"),e},f_=i=>(t,e)=>{const s=t.createDynamicsCompressor();if(Yt(s,e),e.channelCount>2||e.channelCountMode==="max")throw i();return Ft(s,e,"attack"),Ft(s,e,"knee"),Ft(s,e,"ratio"),Ft(s,e,"release"),Ft(s,e,"threshold"),s},me=(i,t)=>{const e=i.createGain();return Yt(e,t),Ft(e,t,"gain"),e},p_=i=>(t,e,s)=>{if(t.createIIRFilter===void 0)return i(t,e,s);const n=t.createIIRFilter(s.feedforward,s.feedback);return Yt(n,s),n};function m_(i,t){const e=t[0]*t[0]+t[1]*t[1];return[(i[0]*t[0]+i[1]*t[1])/e,(i[1]*t[0]-i[0]*t[1])/e]}function __(i,t){return[i[0]*t[0]-i[1]*t[1],i[0]*t[1]+i[1]*t[0]]}function kl(i,t){let e=[0,0];for(let s=i.length-1;s>=0;s-=1)e=__(e,t),e[0]+=i[s];return e}const g_=(i,t,e,s)=>(n,r,{channelCount:o,channelCountMode:a,channelInterpretation:c,feedback:l,feedforward:u})=>{const h=Pu(r,n.sampleRate),d=l instanceof Float64Array?l:new Float64Array(l),p=u instanceof Float64Array?u:new Float64Array(u),_=d.length,f=p.length,m=Math.min(_,f);if(_===0||_>20)throw s();if(d[0]===0)throw t();if(f===0||f>20)throw s();if(p[0]===0)throw t();if(d[0]!==1){for(let x=0;x{const C=x.inputBuffer,O=x.outputBuffer,P=C.numberOfChannels;for(let M=0;Mi.createMediaElementSource(t.mediaElement),v_=(i,t)=>{const e=i.createMediaStreamDestination();return Yt(e,t),e.numberOfOutputs===1&&Object.defineProperty(e,"numberOfOutputs",{get:()=>0}),e},x_=(i,{mediaStream:t})=>{const e=t.getAudioTracks();e.sort((r,o)=>r.ido.id?1:0);const s=e.slice(0,1),n=i.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(n,"mediaStream",{value:t}),n},k_=(i,t)=>(e,{mediaStreamTrack:s})=>{if(typeof e.createMediaStreamTrackSource=="function")return e.createMediaStreamTrackSource(s);const n=new MediaStream([s]),r=e.createMediaStreamSource(n);if(s.kind!=="audio")throw i();if(t(e))throw new TypeError;return r},T_=i=>i===null?null:i.hasOwnProperty("OfflineAudioContext")?i.OfflineAudioContext:i.hasOwnProperty("webkitOfflineAudioContext")?i.webkitOfflineAudioContext:null,w_=(i,t,e,s,n,r)=>(o,a)=>{const c=o.createOscillator();return Yt(c,a),Ft(c,a,"detune"),Ft(c,a,"frequency"),a.periodicWave!==void 0?c.setPeriodicWave(a.periodicWave):Pt(c,a,"type"),t(e,()=>e(o))||Ga(c),t(s,()=>s(o))||r(c,o),t(n,()=>n(o))||Ya(c),i(o,c),c},b_=i=>(t,e)=>{const s=t.createPanner();return s.orientationX===void 0?i(t,e):(Yt(s,e),Ft(s,e,"orientationX"),Ft(s,e,"orientationY"),Ft(s,e,"orientationZ"),Ft(s,e,"positionX"),Ft(s,e,"positionY"),Ft(s,e,"positionZ"),Pt(s,e,"coneInnerAngle"),Pt(s,e,"coneOuterAngle"),Pt(s,e,"coneOuterGain"),Pt(s,e,"distanceModel"),Pt(s,e,"maxDistance"),Pt(s,e,"panningModel"),Pt(s,e,"refDistance"),Pt(s,e,"rolloffFactor"),s)},C_=(i,t,e,s,n,r,o,a,c,l)=>(u,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:p,distanceModel:_,maxDistance:f,orientationX:m,orientationY:v,orientationZ:b,panningModel:w,positionX:g,positionY:y,positionZ:k,refDistance:T,rolloffFactor:x,...C})=>{const O=u.createPanner();if(C.channelCount>2||C.channelCountMode==="max")throw o();Yt(O,C);const P={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},M=e(u,{...P,channelInterpretation:"speakers",numberOfInputs:6}),V=s(u,{...C,gain:1}),B=s(u,{...P,gain:1}),Y=s(u,{...P,gain:0}),G=s(u,{...P,gain:0}),z=s(u,{...P,gain:0}),j=s(u,{...P,gain:0}),Z=s(u,{...P,gain:0}),Q=n(u,256,6,1),et=r(u,{...P,curve:new Float32Array([1,1]),oversample:"none"});let R=[m,v,b],F=[g,y,k];const S=new Float32Array(1);Q.onaudioprocess=({inputBuffer:U})=>{const it=[c(U,S,0),c(U,S,1),c(U,S,2)];it.some((nt,J)=>nt!==R[J])&&(O.setOrientation(...it),R=it);const st=[c(U,S,3),c(U,S,4),c(U,S,5)];st.some((nt,J)=>nt!==F[J])&&(O.setPosition(...st),F=st)},Object.defineProperty(Y.gain,"defaultValue",{get:()=>0}),Object.defineProperty(G.gain,"defaultValue",{get:()=>0}),Object.defineProperty(z.gain,"defaultValue",{get:()=>0}),Object.defineProperty(j.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Z.gain,"defaultValue",{get:()=>0});const I={get bufferSize(){},get channelCount(){return O.channelCount},set channelCount(U){if(U>2)throw o();V.channelCount=U,O.channelCount=U},get channelCountMode(){return O.channelCountMode},set channelCountMode(U){if(U==="max")throw o();V.channelCountMode=U,O.channelCountMode=U},get channelInterpretation(){return O.channelInterpretation},set channelInterpretation(U){V.channelInterpretation=U,O.channelInterpretation=U},get coneInnerAngle(){return O.coneInnerAngle},set coneInnerAngle(U){O.coneInnerAngle=U},get coneOuterAngle(){return O.coneOuterAngle},set coneOuterAngle(U){O.coneOuterAngle=U},get coneOuterGain(){return O.coneOuterGain},set coneOuterGain(U){if(U<0||U>1)throw t();O.coneOuterGain=U},get context(){return O.context},get distanceModel(){return O.distanceModel},set distanceModel(U){O.distanceModel=U},get inputs(){return[V]},get maxDistance(){return O.maxDistance},set maxDistance(U){if(U<0)throw new RangeError;O.maxDistance=U},get numberOfInputs(){return O.numberOfInputs},get numberOfOutputs(){return O.numberOfOutputs},get orientationX(){return B.gain},get orientationY(){return Y.gain},get orientationZ(){return G.gain},get panningModel(){return O.panningModel},set panningModel(U){O.panningModel=U},get positionX(){return z.gain},get positionY(){return j.gain},get positionZ(){return Z.gain},get refDistance(){return O.refDistance},set refDistance(U){if(U<0)throw new RangeError;O.refDistance=U},get rolloffFactor(){return O.rolloffFactor},set rolloffFactor(U){if(U<0)throw new RangeError;O.rolloffFactor=U},addEventListener(...U){return V.addEventListener(U[0],U[1],U[2])},dispatchEvent(...U){return V.dispatchEvent(U[0])},removeEventListener(...U){return V.removeEventListener(U[0],U[1],U[2])}};h!==I.coneInnerAngle&&(I.coneInnerAngle=h),d!==I.coneOuterAngle&&(I.coneOuterAngle=d),p!==I.coneOuterGain&&(I.coneOuterGain=p),_!==I.distanceModel&&(I.distanceModel=_),f!==I.maxDistance&&(I.maxDistance=f),m!==I.orientationX.value&&(I.orientationX.value=m),v!==I.orientationY.value&&(I.orientationY.value=v),b!==I.orientationZ.value&&(I.orientationZ.value=b),w!==I.panningModel&&(I.panningModel=w),g!==I.positionX.value&&(I.positionX.value=g),y!==I.positionY.value&&(I.positionY.value=y),k!==I.positionZ.value&&(I.positionZ.value=k),T!==I.refDistance&&(I.refDistance=T),x!==I.rolloffFactor&&(I.rolloffFactor=x),(R[0]!==1||R[1]!==0||R[2]!==0)&&O.setOrientation(...R),(F[0]!==0||F[1]!==0||F[2]!==0)&&O.setPosition(...F);const H=()=>{V.connect(O),i(V,et,0,0),et.connect(B).connect(M,0,0),et.connect(Y).connect(M,0,1),et.connect(G).connect(M,0,2),et.connect(z).connect(M,0,3),et.connect(j).connect(M,0,4),et.connect(Z).connect(M,0,5),M.connect(Q).connect(u.destination)},N=()=>{V.disconnect(O),a(V,et,0,0),et.disconnect(B),B.disconnect(M),et.disconnect(Y),Y.disconnect(M),et.disconnect(G),G.disconnect(M),et.disconnect(z),z.disconnect(M),et.disconnect(j),j.disconnect(M),et.disconnect(Z),Z.disconnect(M),M.disconnect(Q),Q.disconnect(u.destination)};return l(Kn(I,O),H,N)},S_=i=>(t,{disableNormalization:e,imag:s,real:n})=>{const r=s instanceof Float32Array?s:new Float32Array(s),o=n instanceof Float32Array?n:new Float32Array(n),a=t.createPeriodicWave(o,r,{disableNormalization:e});if(Array.from(s).length<2)throw i();return a},ur=(i,t,e,s)=>i.createScriptProcessor(t,e,s),E_=(i,t)=>(e,s)=>{const n=s.channelCountMode;if(n==="clamped-max")throw t();if(e.createStereoPanner===void 0)return i(e,s);const r=e.createStereoPanner();return Yt(r,s),Ft(r,s,"pan"),Object.defineProperty(r,"channelCountMode",{get:()=>n,set:o=>{if(o!==n)throw t()}}),r},O_=(i,t,e,s,n,r)=>{const a=new Float32Array([1,1]),c=Math.PI/2,l={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...l,oversample:"none"},h=(_,f,m,v)=>{const b=new Float32Array(16385),w=new Float32Array(16385);for(let C=0;C<16385;C+=1){const O=C/16384*c;b[C]=Math.cos(O),w[C]=Math.sin(O)}const g=e(_,{...l,gain:0}),y=s(_,{...u,curve:b}),k=s(_,{...u,curve:a}),T=e(_,{...l,gain:0}),x=s(_,{...u,curve:w});return{connectGraph(){f.connect(g),f.connect(k.inputs===void 0?k:k.inputs[0]),f.connect(T),k.connect(m),m.connect(y.inputs===void 0?y:y.inputs[0]),m.connect(x.inputs===void 0?x:x.inputs[0]),y.connect(g.gain),x.connect(T.gain),g.connect(v,0,0),T.connect(v,0,1)},disconnectGraph(){f.disconnect(g),f.disconnect(k.inputs===void 0?k:k.inputs[0]),f.disconnect(T),k.disconnect(m),m.disconnect(y.inputs===void 0?y:y.inputs[0]),m.disconnect(x.inputs===void 0?x:x.inputs[0]),y.disconnect(g.gain),x.disconnect(T.gain),g.disconnect(v,0,0),T.disconnect(v,0,1)}}},d=(_,f,m,v)=>{const b=new Float32Array(16385),w=new Float32Array(16385),g=new Float32Array(16385),y=new Float32Array(16385),k=Math.floor(16385/2);for(let z=0;z<16385;z+=1)if(z>k){const j=(z-k)/(16384-k)*c;b[z]=Math.cos(j),w[z]=Math.sin(j),g[z]=0,y[z]=1}else{const j=z/(16384-k)*c;b[z]=1,w[z]=0,g[z]=Math.cos(j),y[z]=Math.sin(j)}const T=t(_,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),x=e(_,{...l,gain:0}),C=s(_,{...u,curve:b}),O=e(_,{...l,gain:0}),P=s(_,{...u,curve:w}),M=s(_,{...u,curve:a}),V=e(_,{...l,gain:0}),B=s(_,{...u,curve:g}),Y=e(_,{...l,gain:0}),G=s(_,{...u,curve:y});return{connectGraph(){f.connect(T),f.connect(M.inputs===void 0?M:M.inputs[0]),T.connect(x,0),T.connect(O,0),T.connect(V,1),T.connect(Y,1),M.connect(m),m.connect(C.inputs===void 0?C:C.inputs[0]),m.connect(P.inputs===void 0?P:P.inputs[0]),m.connect(B.inputs===void 0?B:B.inputs[0]),m.connect(G.inputs===void 0?G:G.inputs[0]),C.connect(x.gain),P.connect(O.gain),B.connect(V.gain),G.connect(Y.gain),x.connect(v,0,0),V.connect(v,0,0),O.connect(v,0,1),Y.connect(v,0,1)},disconnectGraph(){f.disconnect(T),f.disconnect(M.inputs===void 0?M:M.inputs[0]),T.disconnect(x,0),T.disconnect(O,0),T.disconnect(V,1),T.disconnect(Y,1),M.disconnect(m),m.disconnect(C.inputs===void 0?C:C.inputs[0]),m.disconnect(P.inputs===void 0?P:P.inputs[0]),m.disconnect(B.inputs===void 0?B:B.inputs[0]),m.disconnect(G.inputs===void 0?G:G.inputs[0]),C.disconnect(x.gain),P.disconnect(O.gain),B.disconnect(V.gain),G.disconnect(Y.gain),x.disconnect(v,0,0),V.disconnect(v,0,0),O.disconnect(v,0,1),Y.disconnect(v,0,1)}}},p=(_,f,m,v,b)=>{if(f===1)return h(_,m,v,b);if(f===2)return d(_,m,v,b);throw n()};return(_,{channelCount:f,channelCountMode:m,pan:v,...b})=>{if(m==="max")throw n();const w=i(_,{...b,channelCount:1,channelCountMode:m,numberOfInputs:2}),g=e(_,{...b,channelCount:f,channelCountMode:m,gain:1}),y=e(_,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:v});let{connectGraph:k,disconnectGraph:T}=p(_,f,g,y,w);Object.defineProperty(y.gain,"defaultValue",{get:()=>0}),Object.defineProperty(y.gain,"maxValue",{get:()=>1}),Object.defineProperty(y.gain,"minValue",{get:()=>-1});const x={get bufferSize(){},get channelCount(){return g.channelCount},set channelCount(M){g.channelCount!==M&&(C&&T(),{connectGraph:k,disconnectGraph:T}=p(_,M,g,y,w),C&&k()),g.channelCount=M},get channelCountMode(){return g.channelCountMode},set channelCountMode(M){if(M==="clamped-max"||M==="max")throw n();g.channelCountMode=M},get channelInterpretation(){return g.channelInterpretation},set channelInterpretation(M){g.channelInterpretation=M},get context(){return g.context},get inputs(){return[g]},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get pan(){return y.gain},addEventListener(...M){return g.addEventListener(M[0],M[1],M[2])},dispatchEvent(...M){return g.dispatchEvent(M[0])},removeEventListener(...M){return g.removeEventListener(M[0],M[1],M[2])}};let C=!1;const O=()=>{k(),C=!0},P=()=>{T(),C=!1};return r(Kn(x,w),O,P)}},A_=(i,t,e,s,n,r,o)=>(a,c)=>{const l=a.createWaveShaper();if(r!==null&&r.name==="webkitAudioContext"&&a.createGain().gain.automationRate===void 0)return e(a,c);Yt(l,c);const u=c.curve===null||c.curve instanceof Float32Array?c.curve:new Float32Array(c.curve);if(u!==null&&u.length<2)throw t();Pt(l,{curve:u},"curve"),Pt(l,c,"oversample");let h=null,d=!1;return o(l,"curve",f=>()=>f.call(l),f=>m=>(f.call(l,m),d&&(s(m)&&h===null?h=i(a,l):!s(m)&&h!==null&&(h(),h=null)),m)),n(l,()=>{d=!0,s(l.curve)&&(h=i(a,l))},()=>{d=!1,h!==null&&(h(),h=null)})},M_=(i,t,e,s,n)=>(r,{curve:o,oversample:a,...c})=>{const l=r.createWaveShaper(),u=r.createWaveShaper();Yt(l,c),Yt(u,c);const h=e(r,{...c,gain:1}),d=e(r,{...c,gain:-1}),p=e(r,{...c,gain:1}),_=e(r,{...c,gain:-1});let f=null,m=!1,v=null;const b={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(y){h.channelCount=y,d.channelCount=y,l.channelCount=y,p.channelCount=y,u.channelCount=y,_.channelCount=y},get channelCountMode(){return l.channelCountMode},set channelCountMode(y){h.channelCountMode=y,d.channelCountMode=y,l.channelCountMode=y,p.channelCountMode=y,u.channelCountMode=y,_.channelCountMode=y},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(y){h.channelInterpretation=y,d.channelInterpretation=y,l.channelInterpretation=y,p.channelInterpretation=y,u.channelInterpretation=y,_.channelInterpretation=y},get context(){return l.context},get curve(){return v},set curve(y){if(y!==null&&y.length<2)throw t();if(y===null)l.curve=y,u.curve=y;else{const k=y.length,T=new Float32Array(k+2-k%2),x=new Float32Array(k+2-k%2);T[0]=y[0],x[0]=-y[k-1];const C=Math.ceil((k+1)/2),O=(k+1)/2-1;for(let P=1;P{h.connect(l).connect(p),h.connect(d).connect(u).connect(_).connect(p),m=!0,s(v)&&(f=i(r,h))},g=()=>{h.disconnect(l),l.disconnect(p),h.disconnect(d),d.disconnect(u),u.disconnect(_),_.disconnect(p),m=!1,f!==null&&(f(),f=null)};return n(Kn(b,p),w,g)},ae=()=>new DOMException("","NotSupportedError"),D_={numberOfChannels:1},P_=(i,t,e,s,n)=>class extends i{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}={...D_,...l},p=s(h,u,d);t(Mi,()=>Mi(p))||p.addEventListener("statechange",(()=>{let _=0;const f=m=>{this._state==="running"&&(_>0?(p.removeEventListener("statechange",f),m.stopImmediatePropagation(),this._waitForThePromiseToSettle(m)):_+=1)};return f})()),super(p,h),this._length=u,this._nativeOfflineAudioContext=p,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(e()):(this._state="running",n(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,Cu(this)}))}_waitForThePromiseToSettle(o){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(o):setTimeout(()=>this._waitForThePromiseToSettle(o))}},I_={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},N_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...I_,...l},d=e(u,h),p=r(u),_=p?s():null,f=c.sampleRate/2;super(c,!1,d,_),this._detune=t(this,p,d.detune,153600,-153600),this._frequency=t(this,p,d.frequency,f,-f),this._nativeOscillatorNode=d,this._onended=null,this._oscillatorNodeRenderer=_,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"){Un(this);const l=()=>{this._nativeOscillatorNode.removeEventListener("ended",l),ds(this)&&or(this)};this._nativeOscillatorNode.addEventListener("ended",l)}}stop(c=0){this._nativeOscillatorNode.stop(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=c)}},R_=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null,c=null;const l=async(u,h)=>{let d=e(u);const p=se(d,h);if(!p){const _={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=t(h,_),a!==null&&d.start(a),c!==null&&d.stop(c)}return r.set(h,d),p?(await i(h,u.detune,d.detune),await i(h,u.frequency,d.frequency)):(await s(h,u.detune,d.detune),await s(h,u.frequency,d.frequency)),await n(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)}}},F_={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},L_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...F_,...l},d=e(u,h),p=r(u),_=p?s():null;super(c,!1,d,_),this._nativePannerNode=d,this._orientationX=t(this,p,d.orientationX,ne,le),this._orientationY=t(this,p,d.orientationY,ne,le),this._orientationZ=t(this,p,d.orientationZ,ne,le),this._positionX=t(this,p,d.positionX,ne,le),this._positionY=t(this,p,d.positionY,ne,le),this._positionZ=t(this,p,d.positionZ,ne,le),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}},V_=(i,t,e,s,n,r,o,a,c,l)=>()=>{const u=new WeakMap;let h=null;const d=async(p,_)=>{let f=null,m=r(p);const v={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},b={...v,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},w=se(m,_);if("bufferSize"in m)f=s(_,{...v,gain:1});else if(!w){const g={...b,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=n(_,g)}if(u.set(_,f===null?m:f),f!==null){if(h===null){if(o===null)throw new Error("Missing the native OfflineAudioContext constructor.");const P=new o(6,p.context.length,_.sampleRate),M=t(P,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});M.connect(P.destination),h=(async()=>{const V=await Promise.all([p.orientationX,p.orientationY,p.orientationZ,p.positionX,p.positionY,p.positionZ].map(async(B,Y)=>{const G=e(P,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Y===0?1:0});return await a(P,B,G.offset),G}));for(let B=0;B<6;B+=1)V[B].connect(M,0,B),V[B].start(0);return l(P)})()}const g=await h,y=s(_,{...v,gain:1});await c(p,_,y);const k=[];for(let P=0;PB!==T[Y])||V.some((B,Y)=>B!==x[Y])){T=M,x=V;const B=P/_.sampleRate;C.gain.setValueAtTime(0,B),C=s(_,{...v,gain:0}),O=n(_,{...b,orientationX:T[0],orientationY:T[1],orientationZ:T[2],positionX:x[0],positionY:x[1],positionZ:x[2]}),C.gain.setValueAtTime(1,B),y.connect(C).connect(O.inputs[0]),O.connect(f)}}return f}return w?(await i(_,p.orientationX,m.orientationX),await i(_,p.orientationY,m.orientationY),await i(_,p.orientationZ,m.orientationZ),await i(_,p.positionX,m.positionX),await i(_,p.positionY,m.positionY),await i(_,p.positionZ,m.positionZ)):(await a(_,p.orientationX,m.orientationX),await a(_,p.orientationY,m.orientationY),await a(_,p.orientationZ,m.orientationZ),await a(_,p.positionX,m.positionX),await a(_,p.positionY,m.positionY),await a(_,p.positionZ,m.positionZ)),Qn(m)?await c(p,_,m.inputs[0]):await c(p,_,m),m};return{render(p,_){const f=u.get(_);return f!==void 0?Promise.resolve(f):d(p,_)}}},U_={disableNormalization:!1},j_=(i,t,e,s)=>class Ru{constructor(r,o){const a=t(r),c=s({...U_,...o}),l=i(a,c);return e.add(l),l}static[Symbol.hasInstance](r){return r!==null&&typeof r=="object"&&Object.getPrototypeOf(r)===Ru.prototype||e.has(r)}},z_=(i,t)=>(e,s,n)=>(i(s).replay(n),t(s,e,n)),B_=(i,t,e)=>async(s,n,r)=>{const o=i(s);await Promise.all(o.activeInputs.map((a,c)=>Array.from(a).map(async([l,u])=>{const d=await t(l).render(l,n),p=s.context.destination;!e(l)&&(s!==p||!e(s))&&d.connect(r,u,c)})).reduce((a,c)=>[...a,...c],[]))},q_=(i,t,e)=>async(s,n,r)=>{const o=t(s);await Promise.all(Array.from(o.activeInputs).map(async([a,c])=>{const u=await i(a).render(a,n);e(a)||u.connect(r,c)}))},W_=(i,t,e,s)=>n=>i(Mi,()=>Mi(n))?Promise.resolve(i(s,s)).then(r=>{if(!r){const o=e(n,512,0,1);n.oncomplete=()=>{o.onaudioprocess=null,o.disconnect()},o.onaudioprocess=()=>n.currentTime,o.connect(n.destination)}return n.startRendering()}):new Promise(r=>{const o=t(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.oncomplete=a=>{o.disconnect(),r(a.renderedBuffer)},o.connect(n.destination),n.startRendering()}),H_=i=>(t,e)=>{i.set(t,e)},G_=i=>(t,e)=>i.set(t,e),Y_=(i,t,e,s,n,r,o,a)=>(c,l)=>e(c).render(c,l).then(()=>Promise.all(Array.from(s(l)).map(u=>e(u).render(u,l)))).then(()=>n(l)).then(u=>(typeof u.copyFromChannel!="function"?(o(u),qa(u)):t(r,()=>r(u))||a(u),i.add(u),u)),$_={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},Z_=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...$_,...c},h=e(l,u),d=r(l),p=d?s():null;super(a,!1,h,p),this._pan=t(this,d,h.pan)}get pan(){return this._pan}},X_=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(c,h)}return r.set(c,l),u?await i(c,a.pan,l.pan):await s(c,a.pan,l.pan),Qn(l)?await n(a,c,l.inputs[0]):await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},Q_=i=>()=>{if(i===null)return!1;try{new i({length:1,sampleRate:44100})}catch{return!1}return!0},K_=(i,t)=>async()=>{if(i===null)return!0;if(t===null)return!1;const e=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 t(1,128,44100),n=URL.createObjectURL(e);let r=!1,o=!1;try{await s.audioWorklet.addModule(n);const a=new i(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(n)}return r&&!o},J_=(i,t)=>()=>{if(t===null)return Promise.resolve(!1);const e=new t(1,1,44100),s=i(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(n=>{e.oncomplete=()=>{s.disconnect(),n(e.currentTime!==0)},e.startRendering()})},tg=()=>new DOMException("","UnknownError"),eg={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},sg=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...eg,...l},d=e(u,h),_=r(u)?s():null;super(c,!0,d,_),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 t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=c}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(c){this._nativeWaveShaperNode.oversample=c}},ng=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=i(o,l)}return s.set(o,a),Qn(a)?await e(r,o,a.inputs[0]):await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},ig=()=>typeof window>"u"?null:window,rg=(i,t)=>e=>{e.copyFromChannel=(s,n,r=0)=>{const o=i(r),a=i(n);if(a>=e.numberOfChannels)throw t();const c=e.length,l=e.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+o{const o=i(r),a=i(n);if(a>=e.numberOfChannels)throw t();const c=e.length,l=e.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+ot=>{t.copyFromChannel=(e=>(s,n,r=0)=>{const o=i(r),a=i(n);if(o(s,n,r=0)=>{const o=i(r),a=i(n);if(o(t,e)=>{const s=e.createBuffer(1,1,44100);t.buffer===null&&(t.buffer=s),i(t,"buffer",n=>()=>{const r=n.call(t);return r===s?null:r},n=>r=>n.call(t,r===null?s:r))},cg=(i,t)=>(e,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw i()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw i()}});const n=e.createBufferSource();t(s,()=>{const a=s.numberOfInputs;for(let c=0;cn.disconnect(s))},Fu=(i,t,e)=>i.copyFromChannel===void 0?i.getChannelData(e)[0]:(i.copyFromChannel(t,e),t[0]),Lu=i=>{if(i===null)return!1;const t=i.length;return t%2!==0?i[Math.floor(t/2)]!==0:i[t/2-1]+i[t/2]!==0},hr=(i,t,e,s)=>{let n=i;for(;!n.hasOwnProperty(t);)n=Object.getPrototypeOf(n);const{get:r,set:o}=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(i,t,{get:e(r),set:s(o)})},lg=i=>({...i,outputChannelCount:i.outputChannelCount!==void 0?i.outputChannelCount:i.numberOfInputs===1&&i.numberOfOutputs===1?[i.channelCount]:Array.from({length:i.numberOfOutputs},()=>1)}),ug=i=>({...i,channelCount:i.numberOfOutputs}),hg=i=>{const{imag:t,real:e}=i;return t===void 0?e===void 0?{...i,imag:[0,0],real:[0,0]}:{...i,imag:Array.from(e,()=>0),real:e}:e===void 0?{...i,imag:t,real:Array.from(t,()=>0)}:{...i,imag:t,real:e}},Vu=(i,t,e)=>{try{i.setValueAtTime(t,e)}catch(s){if(s.code!==9)throw s;Vu(i,t,e+1e-7)}},dg=i=>{const t=i.createBufferSource();t.start();try{t.start()}catch{return!0}return!1},fg=i=>{const t=i.createBufferSource(),e=i.createBuffer(1,1,44100);t.buffer=e;try{t.start(0,1)}catch{return!1}return!0},pg=i=>{const t=i.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0},$a=i=>{const t=i.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Uu=i=>{const t=i.createBuffer(1,1,44100),e=i.createBufferSource();e.buffer=t,e.start(),e.stop();try{return e.stop(),!0}catch{return!1}},Za=i=>{const t=i.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},mg=i=>{const{port1:t,port2:e}=new MessageChannel;try{t.postMessage(i)}finally{t.close(),e.close()}},_g=i=>{i.start=(t=>(e=0,s=0,n)=>{const r=i.buffer,o=r===null?s:Math.min(r.duration,s);r!==null&&o>r.duration-.5/i.context.sampleRate?t.call(i,e,0,0):t.call(i,e,o,n)})(i.start)},ju=(i,t)=>{const e=t.createGain();i.connect(e);const s=(n=>()=>{n.call(i,e),i.removeEventListener("ended",s)})(i.disconnect);i.addEventListener("ended",s),Kn(i,e),i.stop=(n=>{let r=!1;return(o=0)=>{if(r)try{n.call(i,o)}catch{e.gain.setValueAtTime(0,o)}else n.call(i,o),r=!0}})(i.stop)},Jn=(i,t)=>e=>{const s={value:i};return Object.defineProperties(e,{currentTarget:s,target:s}),typeof t=="function"?t.call(i,e):t.handleEvent.call(i,e)},gg=L0(fn),yg=q0(fn),vg=em(To),zu=new WeakMap,xg=vm(zu),He=Dp(new Map,new WeakMap),ts=ig(),Bu=Zm(He,ss),Xa=ym(re),Qt=B_(re,Xa,on),kg=$0(Bu,Dt,Qt),At=Tm(ko),vs=T_(ts),wt=Um(vs),qu=new WeakMap,Wu=hm(Jn),dr=Jm(ts),Qa=Rm(dr),Ka=Fm(ts),Hu=Lm(ts),Di=e_(ts),Wt=vp(V0(yu),B0(gg,yg,Wr,vg,Hr,re,xg,rr,Dt,fn,ds,on,Rr),He,Mm(fa,Hr,re,Dt,Ai,ds),ss,wo,ae,Qp(Wr,fa,re,Dt,Ai,At,ds,wt),im(qu,re,ze),Wu,At,Qa,Ka,Hu,wt,Di),Tg=Y0(Wt,kg,ss,Bu,At,wt),Ja=new WeakSet,Tl=Xm(ts),Gu=Wp(new Uint32Array(1)),tc=rg(Gu,ss),ec=og(Gu),Yu=X0(Ja,He,ae,Tl,vs,Q_(Tl),tc,ec),bo=W0(me),$u=q_(Xa,ar,on),ns=Vp($u),ti=Km(bo,He,dg,fg,pg,$a,Uu,Za,_g,ag(hr),ju),is=z_(xm(ar),$u),wg=J0(ns,ti,Dt,is,Qt),Ge=xp(U0(vu),qu,Ba,kp,D0,P0,I0,N0,R0,ua,_u,dr,Vu),bg=K0(Wt,wg,Ge,Zt,ti,At,wt,Jn),Cg=cp(Wt,lp,ss,Zt,t_(me,hr),At,wt,Qt),Sg=Mp(ns,Iu,Dt,is,Qt),pn=G_(zu),Eg=Ap(Wt,Ge,Sg,wo,Iu,At,wt,pn),js=Ym(fn,Ka),Og=cg(Zt,js),zs=c_(dr,Og),Ag=Np(zs,Dt,Qt),Mg=Ip(Wt,Ag,zs,At,wt),Dg=Lp(lr,Dt,Qt),Pg=Fp(Wt,Dg,lr,At,wt,ug),Ig=h_(bo,ti,me,js),ei=u_(bo,He,Ig,$a,Za),Ng=qp(ns,ei,Dt,is,Qt),Rg=Bp(Wt,Ge,Ng,ei,At,wt,Jn),Zu=d_(ae,hr),Fg=Yp(Zu,Dt,Qt),Lg=Gp(Wt,Fg,Zu,At,wt,pn),Vg=tm(ns,Nu,Dt,is,Qt),Ug=Jp(Wt,Ge,Vg,Nu,At,wt,pn),Xu=f_(ae),jg=cm(ns,Xu,Dt,is,Qt),zg=am(Wt,Ge,jg,Xu,ae,At,wt,pn),Bg=_m(ns,me,Dt,is,Qt),qg=mm(Wt,Ge,Bg,me,At,wt),Wg=g_(wo,Zt,ur,ae),Co=W_(He,me,ur,J_(me,vs)),Hg=Am(ti,Dt,vs,Qt,Co),Gg=p_(Wg),Yg=Em(Wt,Gg,Hg,At,wt,pn),$g=up(Ge,zs,ei,ur,ae,Fu,wt,hr),Qu=new WeakMap,Zg=Gm(Cg,$g,Wu,wt,Qu,Jn),Ku=w_(bo,He,$a,Uu,Za,ju),Xg=R_(ns,Ku,Dt,is,Qt),Qg=N_(Wt,Ge,Ku,Xg,At,wt,Jn),Ju=jp(ti),Kg=M_(Ju,Zt,me,Lu,js),So=A_(Ju,Zt,Kg,Lu,js,dr,hr),Jg=C_(Wr,Zt,zs,me,ur,So,ae,Hr,Fu,js),th=b_(Jg),ty=V_(ns,zs,ei,me,th,Dt,vs,is,Qt,Co),ey=L_(Wt,Ge,th,ty,At,wt,pn),sy=S_(ss),ny=j_(sy,At,new WeakSet,hg),iy=O_(zs,lr,me,So,ae,js),eh=E_(iy,ae),ry=X_(ns,eh,Dt,is,Qt),oy=Z_(Wt,Ge,eh,ry,At,wt),ay=ng(So,Dt,Qt),cy=sg(Wt,Zt,So,ay,At,wt,pn),sh=jm(ts),sc=dm(ts),nh=new WeakMap,ly=wm(nh,vs),uy=sh?z0(He,ae,um(ts),sc,fm(F0),At,ly,wt,Di,new WeakMap,new WeakMap,K_(Di,vs),ts):void 0,hy=Vm(Qa,wt),dy=Xp(Ja,He,Zp,lm,new WeakSet,At,hy,Br,Mi,tc,ec),ih=Ep(uy,Tg,Yu,bg,Eg,Mg,Pg,Rg,Lg,dy,Ug,zg,qg,Yg,Zg,Qg,ey,ny,oy,cy),fy=zm(Wt,y_,At,wt),py=qm(Wt,v_,At,wt),my=Wm(Wt,x_,At,wt),_y=k_(Zt,wt),gy=Hm(Wt,_y,At),yy=ap(ih,Zt,ae,tg,fy,py,my,gy,dr),nc=bm(Qu),vy=H0(nc),rh=Up(ss),xy=sm(nc),oh=rm(ss),ah=new WeakMap,ky=gm(ah,ze),Ty=a_(rh,ss,Zt,zs,lr,ei,me,ur,ae,oh,sc,ky,js),wy=n_(Zt,Ty,me,ae,js),by=Sp(ns,rh,ti,zs,lr,ei,me,xy,oh,sc,Dt,Di,vs,is,Qt,Co),Cy=km(nh),Sy=H_(ah),wl=sh?wp(vy,Wt,Ge,by,wy,re,Cy,At,wt,Di,lg,Sy,mg,Jn):void 0,Ey=$p(ae,vs),Oy=Y_(Ja,He,Xa,nc,Co,Br,tc,ec),Ay=P_(ih,He,Zt,Ey,Oy),My=Dm(ko,Qa),Dy=Pm(za,Ka),Py=Im(Ba,Hu),Iy=Nm(ko,wt);function ke(i){return typeof i>"u"}function dt(i){return!ke(i)}function Ny(i){return typeof i=="function"}function Ps(i){return typeof i=="number"}function Js(i){return Object.prototype.toString.call(i)==="[object Object]"&&i.constructor===Object}function Ry(i){return typeof i=="boolean"}function je(i){return Array.isArray(i)}function fs(i){return typeof i=="string"}function Or(i){return fs(i)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(i)}function ut(i,t){if(!i)throw new Error(t)}function Be(i,t,e=1/0){if(!(t<=i&&i<=e))throw new RangeError(`Value must be within [${t}, ${e}], got: ${i}`)}function ch(i){!i.isOffline&&i.state!=="running"&&ic('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let lh=!1,bl=!1;function Cl(i){lh=i}function Fy(i){ke(i)&&lh&&!bl&&(bl=!0,ic("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let uh=console;function Ly(...i){uh.log(...i)}function ic(...i){uh.warn(...i)}function Vy(i){return new yy(i)}function Uy(i,t,e){return new Ay(i,t,e)}const tn=typeof self=="object"?self:null,jy=tn&&(tn.hasOwnProperty("AudioContext")||tn.hasOwnProperty("webkitAudioContext"));function zy(i,t,e){return ut(dt(wl),"This node only works in a secure context (https or localhost)"),new wl(i,t,e)}class By{constructor(t,e,s,n){this._callback=t,this._type=e,this._minimumUpdateInterval=Math.max(128/(n||44100),.001),this.updateInterval=s,this._createClock()}_createWorker(){const t=new Blob([` +`,Ti=new rt(0,0,0),sl=100,p0=600,m0=2e3,qo={x:172.7392402058252,y:-239.04675366094037,z:-2e3},au="14.8.49",nl=(i,t,e)=>({endTime:t,insertTime:e,type:"exponentialRampToValue",value:i}),il=(i,t,e)=>({endTime:t,insertTime:e,type:"linearRampToValue",value:i}),ra=(i,t)=>({startTime:t,type:"setValue",value:i}),cu=(i,t,e)=>({duration:e,startTime:t,type:"setValueCurve",values:i}),lu=(i,t,{startTime:e,target:s,timeConstant:n})=>s+(t-s)*Math.exp((e-i)/n),En=i=>i.type==="exponentialRampToValue",Rr=i=>i.type==="linearRampToValue",ws=i=>En(i)||Rr(i),Fa=i=>i.type==="setValue",cs=i=>i.type==="setValueCurve",Fr=(i,t,e,s)=>{const n=i[t];return n===void 0?s:ws(n)||Fa(n)?n.value:cs(n)?n.values[n.values.length-1]:lu(e,Fr(i,t-1,n.startTime,s),n)},rl=(i,t,e,s,n)=>e===void 0?[s.insertTime,n]:ws(e)?[e.endTime,e.value]:Fa(e)?[e.startTime,e.value]:cs(e)?[e.startTime+e.duration,e.values[e.values.length-1]]:[e.startTime,Fr(i,t-1,e.startTime,n)],oa=i=>i.type==="cancelAndHold",aa=i=>i.type==="cancelScheduledValues",ks=i=>oa(i)||aa(i)?i.cancelTime:En(i)||Rr(i)?i.endTime:i.startTime,ol=(i,t,e,{endTime:s,value:n})=>e===n?n:0e+(i-t)/(s-t)*(n-e),_0=(i,t)=>{const e=Math.floor(t),s=Math.ceil(t);return e===s?i[e]:(1-(t-e))*i[e]+(1-(s-t))*i[s]},g0=(i,{duration:t,startTime:e,values:s})=>{const n=(i-e)/t*(s.length-1);return _0(s,n)},Tr=i=>i.type==="setTarget";class y0{constructor(t){this._automationEvents=[],this._currenTime=0,this._defaultValue=t}[Symbol.iterator](){return this._automationEvents[Symbol.iterator]()}add(t){const e=ks(t);if(oa(t)||aa(t)){const s=this._automationEvents.findIndex(r=>aa(t)&&cs(r)?r.startTime+r.duration>=e:ks(r)>=e),n=this._automationEvents[s];if(s!==-1&&(this._automationEvents=this._automationEvents.slice(0,s)),oa(t)){const r=this._automationEvents[this._automationEvents.length-1];if(n!==void 0&&ws(n)){if(r!==void 0&&Tr(r))throw new Error("The internal list is malformed.");const o=r===void 0?n.insertTime:cs(r)?r.startTime+r.duration:ks(r),a=r===void 0?this._defaultValue:cs(r)?r.values[r.values.length-1]:r.value,c=En(n)?ol(e,o,a,n):al(e,o,a,n),l=En(n)?nl(c,e,this._currenTime):il(c,e,this._currenTime);this._automationEvents.push(l)}if(r!==void 0&&Tr(r)&&this._automationEvents.push(ra(this.getValue(e),e)),r!==void 0&&cs(r)&&r.startTime+r.duration>e){const o=e-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;hks(o)>e),n=s===-1?this._automationEvents[this._automationEvents.length-1]:this._automationEvents[s-1];if(n!==void 0&&cs(n)&&ks(n)+n.duration>e)return!1;const r=En(t)?nl(t.value,t.endTime,this._currenTime):Rr(t)?il(t.value,e,this._currenTime):t;if(s===-1)this._automationEvents.push(r);else{if(cs(t)&&e+t.duration>ks(this._automationEvents[s]))return!1;this._automationEvents.splice(s,0,r)}}return!0}flush(t){const e=this._automationEvents.findIndex(s=>ks(s)>t);if(e>1){const s=this._automationEvents.slice(e-1),n=s[0];Tr(n)&&s.unshift(ra(Fr(this._automationEvents,e-2,n.startTime,this._defaultValue),n.startTime)),this._automationEvents=s}}getValue(t){if(this._automationEvents.length===0)return this._defaultValue;const e=this._automationEvents.findIndex(o=>ks(o)>t),s=this._automationEvents[e],n=(e===-1?this._automationEvents.length:e)-1,r=this._automationEvents[n];if(r!==void 0&&Tr(r)&&(s===void 0||!ws(s)||s.insertTime>t))return lu(t,Fr(this._automationEvents,n-1,r.startTime,this._defaultValue),r);if(r!==void 0&&Fa(r)&&(s===void 0||!ws(s)))return r.value;if(r!==void 0&&cs(r)&&(s===void 0||!ws(s)||r.startTime+r.duration>t))return t({cancelTime:i,type:"cancelAndHold"}),x0=i=>({cancelTime:i,type:"cancelScheduledValues"}),k0=(i,t)=>({endTime:t,type:"exponentialRampToValue",value:i}),T0=(i,t)=>({endTime:t,type:"linearRampToValue",value:i}),w0=(i,t,e)=>({startTime:t,target:i,timeConstant:e,type:"setTarget"}),b0=()=>new DOMException("","AbortError"),C0=i=>(t,e,[s,n,r],o)=>{i(t[n],[e,s,r],a=>a[0]===e&&a[1]===s,o)},S0=i=>(t,e,s)=>{const n=[];for(let r=0;r(t,e)=>{i.set(t,{activeInputs:new Set,passiveInputs:new WeakMap,renderer:e})},Ln=new WeakSet,uu=new WeakMap,La=new WeakMap,hu=new WeakMap,Va=new WeakMap,_o=new WeakMap,du=new WeakMap,ca=new WeakMap,la=new WeakMap,ua=new WeakMap,fu={construct(){return fu}},O0=i=>{try{const t=new Proxy(i,fu);new t}catch{return!1}return!0},cl=/^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]*);?/,ll=(i,t)=>{const e=[];let s=i.replace(/^[\s]+/,""),n=s.match(cl);for(;n!==null;){const r=n[1].slice(1,-1),o=n[0].replace(/([\s]+)?;?$/,"").replace(r,new URL(r,t).toString());e.push(o),s=s.slice(n[0].length).replace(/^[\s]+/,""),n=s.match(cl)}return[e.join(";"),s]},ul=i=>{if(i!==void 0&&!Array.isArray(i))throw new TypeError("The parameterDescriptors property of given value for processorCtor is not an array.")},hl=i=>{if(!O0(i))throw new TypeError("The given value for processorCtor should be a constructor.");if(i.prototype===null||typeof i.prototype!="object")throw new TypeError("The given value for processorCtor should have a prototype.")},A0=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>{let p=0;return(_,f,m={credentials:"omit"})=>{const v=u.get(_);if(v!==void 0&&v.has(f))return Promise.resolve();const b=l.get(_);if(b!==void 0){const y=b.get(f);if(y!==void 0)return y}const w=r(_),g=w.audioWorklet===void 0?n(f).then(([y,k])=>{const[T,x]=ll(y,k),C=`${T};((a,b)=>{(a[b]=a[b]||[]).push((AudioWorkletProcessor,global,registerProcessor,sampleRate,self,window)=>{${x} +})})(window,'_AWGS')`;return e(C)}).then(()=>{const y=d._AWGS.pop();if(y===void 0)throw new SyntaxError;s(w.currentTime,w.sampleRate,()=>y(class{},void 0,(k,T)=>{if(k.trim()==="")throw t();const x=la.get(w);if(x!==void 0){if(x.has(k))throw t();hl(T),ul(T.parameterDescriptors),x.set(k,T)}else hl(T),ul(T.parameterDescriptors),la.set(w,new Map([[k,T]]))},w.sampleRate,void 0,void 0))}):Promise.all([n(f),Promise.resolve(i(h,h))]).then(([[y,k],T])=>{const x=p+1;p=x;const[C,O]=ll(y,k),W=`${C};((AudioWorkletProcessor,registerProcessor)=>{${O} +})(${T?"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{${T?"":"__c = (a) => a.forEach(e=>this.__b.add(e.buffer));"}process(i,o,p){${T?"":"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${x}',class extends AudioWorkletProcessor{process(){return !1}})`,G=new Blob([W],{type:"application/javascript; charset=utf-8"}),Y=URL.createObjectURL(G);return w.audioWorklet.addModule(Y,m).then(()=>{if(a(w))return w;const j=o(w);return j.audioWorklet.addModule(Y,m).then(()=>j)}).then(j=>{if(c===null)throw new SyntaxError;try{new c(j,`__sac${x}`)}catch{throw new SyntaxError}}).finally(()=>URL.revokeObjectURL(Y))});return b===void 0?l.set(_,new Map([[f,g]])):b.set(f,g),g.then(()=>{const y=u.get(_);y===void 0?u.set(_,new Set([f])):y.add(f)}).finally(()=>{const y=l.get(_);y!==void 0&&y.delete(f)}),g}},ze=(i,t)=>{const e=i.get(t);if(e===void 0)throw new Error("A value with the given key could not be found.");return e},go=(i,t)=>{const e=Array.from(i).filter(t);if(e.length>1)throw Error("More than one element was found.");if(e.length===0)throw Error("No element was found.");const[s]=e;return i.delete(s),s},pu=(i,t,e,s)=>{const n=ze(i,t),r=go(n,o=>o[0]===e&&o[1]===s);return n.size===0&&i.delete(t),r},sr=i=>ze(du,i),Vn=i=>{if(Ln.has(i))throw new Error("The AudioNode is already stored.");Ln.add(i),sr(i).forEach(t=>t(!0))},mu=i=>"port"in i,nr=i=>{if(!Ln.has(i))throw new Error("The AudioNode is not stored.");Ln.delete(i),sr(i).forEach(t=>t(!1))},ha=(i,t)=>{!mu(i)&&t.every(e=>e.size===0)&&nr(i)},M0=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>{const p=new WeakMap;return(_,f,m,v,b)=>{const{activeInputs:w,passiveInputs:g}=r(f),{outputs:y}=r(_),k=a(_),T=x=>{const C=c(f),O=c(_);if(x){const I=pu(g,_,m,v);i(w,_,I,!1),!b&&!h(_)&&e(O,C,m,v),d(f)&&Vn(f)}else{const I=s(w,_,m,v);t(g,v,I,!1),!b&&!h(_)&&n(O,C,m,v);const M=o(f);if(M===0)u(f)&&ha(f,w);else{const V=p.get(f);V!==void 0&&clearTimeout(V),p.set(f,setTimeout(()=>{u(f)&&ha(f,w)},M*1e3))}}};return l(y,[f,m,v],x=>x[0]===f&&x[1]===m&&x[2]===v,!0)?(k.add(T),u(_)?i(w,_,[m,v,T],!0):t(g,v,[_,m,T],!0),!0):!1}},D0=i=>(t,e,[s,n,r],o)=>{const a=t.get(s);a===void 0?t.set(s,new Set([[n,e,r]])):i(a,[n,e,r],c=>c[0]===n&&c[1]===e,o)},P0=i=>(t,e)=>{const s=i(t,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});e.connect(s).connect(t.destination);const n=()=>{e.removeEventListener("ended",n),e.disconnect(s),s.disconnect()};e.addEventListener("ended",n)},I0=i=>(t,e)=>{i(t).add(e)},N0={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",fftSize:2048,maxDecibels:-30,minDecibels:-100,smoothingTimeConstant:.8},R0=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...N0,...c},h=s(l,u),d=r(l)?t():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,e()}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,e()}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)}},se=(i,t)=>i.context===t,F0=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(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=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Lr=i=>{try{i.copyToChannel(new Float32Array(1),0,-1)}catch{return!1}return!0},es=()=>new DOMException("","IndexSizeError"),Ua=i=>{i.getChannelData=(t=>e=>{try{return t.call(i,e)}catch(s){throw s.code===12?es():s}})(i.getChannelData)},L0={numberOfChannels:1},V0=(i,t,e,s,n,r,o,a)=>{let c=null;return class _u{constructor(u){if(n===null)throw new Error("Missing the native OfflineAudioContext constructor.");const{length:h,numberOfChannels:d,sampleRate:p}={...L0,...u};c===null&&(c=new n(1,1,44100));const _=s!==null&&t(r,r)?new s({length:h,numberOfChannels:d,sampleRate:p}):c.createBuffer(d,h,p);if(_.numberOfChannels===0)throw e();return typeof _.copyFromChannel!="function"?(o(_),Ua(_)):t(Lr,()=>Lr(_))||a(_),i.add(_),_}static[Symbol.hasInstance](u){return u!==null&&typeof u=="object"&&Object.getPrototypeOf(u)===_u.prototype||i.has(u)}}},ce=-34028234663852886e22,ne=-ce,hs=i=>Ln.has(i),U0={buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1},z0=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...U0,...u},p=n(h,d),_=o(h),f=_?t():null;super(l,!1,p,f),this._audioBufferSourceNodeRenderer=f,this._isBufferNullified=!1,this._isBufferSet=d.buffer!==null,this._nativeAudioBufferSourceNode=p,this._onended=null,this._playbackRate=e(this,_,p.playbackRate,ne,ce)}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"){Vn(this);const d=()=>{this._nativeAudioBufferSourceNode.removeEventListener("ended",d),hs(this)&&nr(this)};this._nativeAudioBufferSourceNode.addEventListener("ended",d)}}stop(l=0){this._nativeAudioBufferSourceNode.stop(l),this._audioBufferSourceNodeRenderer!==null&&(this._audioBufferSourceNodeRenderer.stop=l)}},j0=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=e(l);const d=se(h,u);if(!d){const p={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=t(u,p),o!==null&&h.start(...o),a!==null&&h.stop(a)}return r.set(u,h),d?await i(u,l.playbackRate,h.playbackRate):await s(u,l.playbackRate,h.playbackRate),await n(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)}}},B0=i=>"playbackRate"in i,q0=i=>"frequency"in i&&"gain"in i,W0=i=>"offset"in i,H0=i=>!("frequency"in i)&&"gain"in i,Y0=i=>"detune"in i&&"frequency"in i,G0=i=>"pan"in i,re=i=>ze(uu,i),ir=i=>ze(hu,i),da=(i,t)=>{const{activeInputs:e}=re(i);e.forEach(n=>n.forEach(([r])=>{t.includes(i)||da(r,[...t,i])}));const s=B0(i)?[i.playbackRate]:mu(i)?Array.from(i.parameters.values()):q0(i)?[i.Q,i.detune,i.frequency,i.gain]:W0(i)?[i.offset]:H0(i)?[i.gain]:Y0(i)?[i.detune,i.frequency]:G0(i)?[i.pan]:[];for(const n of s){const r=ir(n);r!==void 0&&r.activeInputs.forEach(([o])=>da(o,t))}hs(i)&&nr(i)},gu=i=>{da(i.destination,[])},$0=i=>i===void 0||typeof i=="number"||typeof i=="string"&&(i==="balanced"||i==="interactive"||i==="playback"),Z0=(i,t,e,s,n,r,o,a,c)=>class extends i{constructor(u={}){if(c===null)throw new Error("Missing the native AudioContext constructor.");let h;try{h=new c(u)}catch(_){throw _.code===12&&_.message==="sampleRate is not in range"?e():_}if(h===null)throw s();if(!$0(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 e();super(h,2);const{latencyHint:d}=u,{sampleRate:p}=h;if(this._baseLatency=typeof h.baseLatency=="number"?h.baseLatency:d==="balanced"?512/p:d==="interactive"||d===void 0?256/p:d==="playback"?1024/p:Math.max(2,Math.min(128,Math.round(d*p/128)))*128/p,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 _=()=>{this._state==="suspended"&&(this._state=null),h.removeEventListener("statechange",_)};h.addEventListener("statechange",_)}}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 t()}):(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()),gu(this)}))}createMediaElementSource(u){return new n(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?t():u})}suspend(){return this._nativeAudioContext.suspend().catch(u=>{throw u===void 0?t():u})}},X0=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d=o(h),p=n(h,u,d),_=d?t(a):null;super(l,!1,p,_),this._isNodeOfNativeOfflineAudioContext=d,this._nativeAudioDestinationNode=p}get channelCount(){return this._nativeAudioDestinationNode.channelCount}set channelCount(l){if(this._isNodeOfNativeOfflineAudioContext)throw s();if(l>this._nativeAudioDestinationNode.maxChannelCount)throw e();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}},Q0=i=>{const t=new WeakMap,e=async(s,n)=>{const r=n.destination;return t.set(n,r),await i(s,n,r),r};return{render(s,n){const r=t.get(n);return r!==void 0?Promise.resolve(r):e(s,n)}}},K0=(i,t,e,s,n,r,o,a)=>(c,l)=>{const u=l.listener,h=()=>{const y=new Float32Array(1),k=t(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:9}),T=o(l);let x=!1,C=[0,0,-1,0,1,0],O=[0,0,0];const I=()=>{if(x)return;x=!0;const G=s(l,256,9,0);G.onaudioprocess=({inputBuffer:Y})=>{const j=[r(Y,y,0),r(Y,y,1),r(Y,y,2),r(Y,y,3),r(Y,y,4),r(Y,y,5)];j.some((Z,Q)=>Z!==C[Q])&&(u.setOrientation(...j),C=j);const z=[r(Y,y,6),r(Y,y,7),r(Y,y,8)];z.some((Z,Q)=>Z!==O[Q])&&(u.setPosition(...z),O=z)},k.connect(G)},M=G=>Y=>{Y!==C[G]&&(C[G]=Y,u.setOrientation(...C))},V=G=>Y=>{Y!==O[G]&&(O[G]=Y,u.setPosition(...O))},W=(G,Y,j)=>{const z=e(l,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:Y});z.connect(k,0,G),z.start(),Object.defineProperty(z.offset,"defaultValue",{get(){return Y}});const Z=i({context:c},T,z.offset,ne,ce);return a(Z,"value",Q=>()=>Q.call(Z),Q=>et=>{try{Q.call(Z,et)}catch(R){if(R.code!==9)throw R}I(),T&&j(et)}),Z.cancelAndHoldAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return I(),R})(Z.cancelAndHoldAtTime),Z.cancelScheduledValues=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return I(),R})(Z.cancelScheduledValues),Z.exponentialRampToValueAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return I(),R})(Z.exponentialRampToValueAtTime),Z.linearRampToValueAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return I(),R})(Z.linearRampToValueAtTime),Z.setTargetAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return I(),R})(Z.setTargetAtTime),Z.setValueAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return I(),R})(Z.setValueAtTime),Z.setValueCurveAtTime=(Q=>T?()=>{throw n()}:(...et)=>{const R=Q.apply(Z,et);return I(),R})(Z.setValueCurveAtTime),Z};return{forwardX:W(0,0,M(0)),forwardY:W(1,0,M(1)),forwardZ:W(2,-1,M(2)),positionX:W(6,0,V(0)),positionY:W(7,0,V(1)),positionZ:W(8,0,V(2)),upX:W(3,0,M(3)),upY:W(4,1,M(4)),upZ:W(5,0,M(5))}},{forwardX:d,forwardY:p,forwardZ:_,positionX:f,positionY:m,positionZ:v,upX:b,upY:w,upZ:g}=u.forwardX===void 0?h():u;return{get forwardX(){return d},get forwardY(){return p},get forwardZ(){return _},get positionX(){return f},get positionY(){return m},get positionZ(){return v},get upX(){return b},get upY(){return w},get upZ(){return g}}},Vr=i=>"context"in i,rr=i=>Vr(i[0]),dn=(i,t,e,s)=>{for(const n of i)if(e(n)){if(s)return!1;throw Error("The set contains at least one similar element.")}return i.add(t),!0},dl=(i,t,[e,s],n)=>{dn(i,[t,e,s],r=>r[0]===t&&r[1]===e,n)},fl=(i,[t,e,s],n)=>{const r=i.get(t);r===void 0?i.set(t,new Set([[e,s]])):dn(r,[e,s],o=>o[0]===e,n)},Zn=i=>"inputs"in i,Ur=(i,t,e,s)=>{if(Zn(t)){const n=t.inputs[s];return i.connect(n,e,0),[n,e,0]}return i.connect(t,e,s),[t,e,s]},yu=(i,t,e)=>{for(const s of i)if(s[0]===t&&s[1]===e)return i.delete(s),s;return null},J0=(i,t,e)=>go(i,s=>s[0]===t&&s[1]===e),vu=(i,t)=>{if(!sr(i).delete(t))throw new Error("Missing the expected event listener.")},xu=(i,t,e)=>{const s=ze(i,t),n=go(s,r=>r[0]===e);return s.size===0&&i.delete(t),n},zr=(i,t,e,s)=>{Zn(t)?i.disconnect(t.inputs[s],e,0):i.disconnect(t,e,s)},Dt=i=>ze(La,i),Ei=i=>ze(Va,i),rn=i=>ca.has(i),Mr=i=>!Ln.has(i),pl=(i,t)=>new Promise(e=>{if(t!==null)e(!0);else{const s=i.createScriptProcessor(256,1,1),n=i.createGain(),r=i.createBuffer(1,2,44100),o=r.getChannelData(0);o[0]=1,o[1]=1;const a=i.createBufferSource();a.buffer=r,a.loop=!0,a.connect(s).connect(i.destination),a.connect(n),a.disconnect(n),s.onaudioprocess=c=>{const l=c.inputBuffer.getChannelData(0);Array.prototype.some.call(l,u=>u===1)?e(!0):e(!1),a.stop(),s.onaudioprocess=null,a.disconnect(s),s.disconnect(i.destination)},a.start()}}),Wo=(i,t)=>{const e=new Map;for(const s of i)for(const n of s){const r=e.get(n);e.set(n,r===void 0?1:r+1)}e.forEach((s,n)=>t(n,s))},jr=i=>"context"in i,tp=i=>{const t=new Map;i.connect=(e=>(s,n=0,r=0)=>{const o=jr(s)?e(s,n,r):e(s,n),a=t.get(s);return a===void 0?t.set(s,[{input:r,output:n}]):a.every(c=>c.input!==r||c.output!==n)&&a.push({input:r,output:n}),o})(i.connect.bind(i)),i.disconnect=(e=>(s,n,r)=>{if(e.apply(i),s===void 0)t.clear();else if(typeof s=="number")for(const[o,a]of t){const c=a.filter(l=>l.output!==s);c.length===0?t.delete(o):t.set(o,c)}else if(t.has(s))if(n===void 0)t.delete(s);else{const o=t.get(s);if(o!==void 0){const a=o.filter(c=>c.output!==n&&(c.input!==r||r===void 0));a.length===0?t.delete(s):t.set(s,a)}}for(const[o,a]of t)a.forEach(c=>{jr(o)?i.connect(o,c.output,c.input):i.connect(o,c.output)})})(i.disconnect)},ep=(i,t,e,s)=>{const{activeInputs:n,passiveInputs:r}=ir(t),{outputs:o}=re(i),a=sr(i),c=l=>{const u=Dt(i),h=Ei(t);if(l){const d=xu(r,i,e);dl(n,i,d,!1),!s&&!rn(i)&&u.connect(h,e)}else{const d=J0(n,i,e);fl(r,d,!1),!s&&!rn(i)&&u.disconnect(h,e)}};return dn(o,[t,e],l=>l[0]===t&&l[1]===e,!0)?(a.add(c),hs(i)?dl(n,i,[e,c],!0):fl(r,[i,e,c],!0),!0):!1},sp=(i,t,e,s)=>{const{activeInputs:n,passiveInputs:r}=re(t),o=yu(n[s],i,e);return o===null?[pu(r,i,e,s)[2],!1]:[o[2],!0]},np=(i,t,e)=>{const{activeInputs:s,passiveInputs:n}=ir(t),r=yu(s,i,e);return r===null?[xu(n,i,e)[1],!1]:[r[2],!0]},za=(i,t,e,s,n)=>{const[r,o]=sp(i,e,s,n);if(r!==null&&(vu(i,r),o&&!t&&!rn(i)&&zr(Dt(i),Dt(e),s,n)),hs(e)){const{activeInputs:a}=re(e);ha(e,a)}},ja=(i,t,e,s)=>{const[n,r]=np(i,e,s);n!==null&&(vu(i,n),r&&!t&&!rn(i)&&Dt(i).disconnect(Ei(e),s))},ip=(i,t)=>{const e=re(i),s=[];for(const n of e.outputs)rr(n)?za(i,t,...n):ja(i,t,...n),s.push(n[0]);return e.outputs.clear(),s},rp=(i,t,e)=>{const s=re(i),n=[];for(const r of s.outputs)r[1]===e&&(rr(r)?za(i,t,...r):ja(i,t,...r),n.push(r[0]),s.outputs.delete(r));return n},op=(i,t,e,s,n)=>{const r=re(i);return Array.from(r.outputs).filter(o=>o[0]===e&&(s===void 0||o[1]===s)&&(n===void 0||o[2]===n)).map(o=>(rr(o)?za(i,t,...o):ja(i,t,...o),r.outputs.delete(o),o[0]))},ap=(i,t,e,s,n,r,o,a,c,l,u,h,d,p,_,f)=>class extends l{constructor(v,b,w,g){super(w),this._context=v,this._nativeAudioNode=w;const y=u(v);h(y)&&e(pl,()=>pl(y,f))!==!0&&tp(w),La.set(this,w),du.set(this,new Set),v.state!=="closed"&&b&&Vn(this),i(this,g,w)}get channelCount(){return this._nativeAudioNode.channelCount}set channelCount(v){this._nativeAudioNode.channelCount=v}get channelCountMode(){return this._nativeAudioNode.channelCountMode}set channelCountMode(v){this._nativeAudioNode.channelCountMode=v}get channelInterpretation(){return this._nativeAudioNode.channelInterpretation}set channelInterpretation(v){this._nativeAudioNode.channelInterpretation=v}get context(){return this._context}get numberOfInputs(){return this._nativeAudioNode.numberOfInputs}get numberOfOutputs(){return this._nativeAudioNode.numberOfOutputs}connect(v,b=0,w=0){if(b<0||b>=this._nativeAudioNode.numberOfOutputs)throw n();const g=u(this._context),y=_(g);if(d(v)||p(v))throw r();if(Vr(v)){const x=Dt(v);try{const O=Ur(this._nativeAudioNode,x,b,w),I=Mr(this);(y||I)&&this._nativeAudioNode.disconnect(...O),this.context.state!=="closed"&&!I&&Mr(v)&&Vn(v)}catch(O){throw O.code===12?r():O}if(t(this,v,b,w,y)){const O=c([this],v);Wo(O,s(y))}return v}const k=Ei(v);if(k.name==="playbackRate"&&k.maxValue===1024)throw o();try{this._nativeAudioNode.connect(k,b),(y||Mr(this))&&this._nativeAudioNode.disconnect(k,b)}catch(x){throw x.code===12?r():x}if(ep(this,v,b,y)){const x=c([this],v);Wo(x,s(y))}}disconnect(v,b,w){let g;const y=u(this._context),k=_(y);if(v===void 0)g=ip(this,k);else if(typeof v=="number"){if(v<0||v>=this.numberOfOutputs)throw n();g=rp(this,k,v)}else{if(b!==void 0&&(b<0||b>=this.numberOfOutputs)||Vr(v)&&w!==void 0&&(w<0||w>=v.numberOfInputs))throw n();if(g=op(this,k,v,b,w),g.length===0)throw r()}for(const T of g){const x=c([this],T);Wo(x,a)}}},cp=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>(p,_,f,m=null,v=null)=>{const b=f.value,w=new y0(b),g=_?s(w):null,y={get defaultValue(){return b},get maxValue(){return m===null?f.maxValue:m},get minValue(){return v===null?f.minValue:v},get value(){return f.value},set value(k){f.value=k,y.setValueAtTime(k,p.context.currentTime)},cancelAndHoldAtTime(k){if(typeof f.cancelAndHoldAtTime=="function")g===null&&w.flush(p.context.currentTime),w.add(n(k)),f.cancelAndHoldAtTime(k);else{const T=Array.from(w).pop();g===null&&w.flush(p.context.currentTime),w.add(n(k));const x=Array.from(w).pop();f.cancelScheduledValues(k),T!==x&&x!==void 0&&(x.type==="exponentialRampToValue"?f.exponentialRampToValueAtTime(x.value,x.endTime):x.type==="linearRampToValue"?f.linearRampToValueAtTime(x.value,x.endTime):x.type==="setValue"?f.setValueAtTime(x.value,x.startTime):x.type==="setValueCurve"&&f.setValueCurveAtTime(x.values,x.startTime,x.duration))}return y},cancelScheduledValues(k){return g===null&&w.flush(p.context.currentTime),w.add(r(k)),f.cancelScheduledValues(k),y},exponentialRampToValueAtTime(k,T){if(k===0)throw new RangeError;if(!Number.isFinite(T)||T<0)throw new RangeError;const x=p.context.currentTime;return g===null&&w.flush(x),Array.from(w).length===0&&(w.add(l(b,x)),f.setValueAtTime(b,x)),w.add(o(k,T)),f.exponentialRampToValueAtTime(k,T),y},linearRampToValueAtTime(k,T){const x=p.context.currentTime;return g===null&&w.flush(x),Array.from(w).length===0&&(w.add(l(b,x)),f.setValueAtTime(b,x)),w.add(a(k,T)),f.linearRampToValueAtTime(k,T),y},setTargetAtTime(k,T,x){return g===null&&w.flush(p.context.currentTime),w.add(c(k,T,x)),f.setTargetAtTime(k,T,x),y},setValueAtTime(k,T){return g===null&&w.flush(p.context.currentTime),w.add(l(k,T)),f.setValueAtTime(k,T),y},setValueCurveAtTime(k,T,x){const C=k instanceof Float32Array?k:new Float32Array(k);if(h!==null&&h.name==="webkitAudioContext"){const O=T+x,I=p.context.sampleRate,M=Math.ceil(T*I),V=Math.floor(O*I),W=V-M,G=new Float32Array(W);for(let j=0;j({replay(t){for(const e of i)if(e.type==="exponentialRampToValue"){const{endTime:s,value:n}=e;t.exponentialRampToValueAtTime(n,s)}else if(e.type==="linearRampToValue"){const{endTime:s,value:n}=e;t.linearRampToValueAtTime(n,s)}else if(e.type==="setTarget"){const{startTime:s,target:n,timeConstant:r}=e;t.setTargetAtTime(n,s,r)}else if(e.type==="setValue"){const{startTime:s,value:n}=e;t.setValueAtTime(n,s)}else if(e.type==="setValueCurve"){const{duration:s,startTime:n,values:r}=e;t.setValueCurveAtTime(r,n,s)}else throw new Error("Can't apply an unknown automation.")}});class ku{constructor(t){this._map=new Map(t)}get size(){return this._map.size}entries(){return this._map.entries()}forEach(t,e=null){return this._map.forEach((s,n)=>t.call(e,s,n,this))}get(t){return this._map.get(t)}has(t){return this._map.has(t)}keys(){return this._map.keys()}values(){return this._map.values()}}const up={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:1,numberOfOutputs:1,parameterData:{},processorOptions:{}},hp=(i,t,e,s,n,r,o,a,c,l,u,h,d,p)=>class extends t{constructor(f,m,v){var b;const w=a(f),g=c(w),y=u({...up,...v});d(y);const k=la.get(w),T=k==null?void 0:k.get(m),x=g||w.state!=="closed"?w:(b=o(w))!==null&&b!==void 0?b:w,C=n(x,g?null:f.baseLatency,l,m,T,y),O=g?s(m,y,T):null;super(f,!0,C,O);const I=[];C.parameters.forEach((V,W)=>{const G=e(this,g,V);I.push([W,G])}),this._nativeAudioWorkletNode=C,this._onprocessorerror=null,this._parameters=new ku(I),g&&i(w,this);const{activeInputs:M}=r(this);h(C,M)}get onprocessorerror(){return this._onprocessorerror}set onprocessorerror(f){const m=typeof f=="function"?p(this,f):null;this._nativeAudioWorkletNode.onprocessorerror=m;const v=this._nativeAudioWorkletNode.onprocessorerror;this._onprocessorerror=v!==null&&v===m?f:v}get parameters(){return this._parameters===null?this._nativeAudioWorkletNode.parameters:this._parameters}get port(){return this._nativeAudioWorkletNode.port}};function Br(i,t,e,s,n){if(typeof i.copyFromChannel=="function")t[e].byteLength===0&&(t[e]=new Float32Array(128)),i.copyFromChannel(t[e],s,n);else{const r=i.getChannelData(s);if(t[e].byteLength===0)t[e]=r.slice(n,n+128);else{const o=new Float32Array(r.buffer,n*Float32Array.BYTES_PER_ELEMENT,128);t[e].set(o)}}}const Tu=(i,t,e,s,n)=>{typeof i.copyToChannel=="function"?t[e].byteLength!==0&&i.copyToChannel(t[e],s,n):t[e].byteLength!==0&&i.getChannelData(s).set(t[e],n)},qr=(i,t)=>{const e=[];for(let s=0;s{const e=ze(ua,i),s=Dt(t);return ze(e,s)},fp=async(i,t,e,s,n,r,o)=>{const a=t===null?Math.ceil(i.context.length/128)*128:t.length,c=s.channelCount*s.numberOfInputs,l=n.reduce((m,v)=>m+v,0),u=l===0?null:e.createBuffer(l,a,e.sampleRate);if(r===void 0)throw new Error("Missing the processor constructor.");const h=re(i),d=await dp(e,i),p=qr(s.numberOfInputs,s.channelCount),_=qr(s.numberOfOutputs,n),f=Array.from(i.parameters.keys()).reduce((m,v)=>({...m,[v]:new Float32Array(128)}),{});for(let m=0;m0&&t!==null)for(let v=0;v{Br(t,f,v,c+b,m)});for(let v=0;vh.activeInputs[g].size===0?[]:w),b=o(m/e.sampleRate,e.sampleRate,()=>d.process(v,_,f));if(u!==null)for(let w=0,g=0;w(m,v,b)=>{const w=new WeakMap;let g=null;const y=async(k,T)=>{let x=u(k),C=null;const O=se(x,T),I=Array.isArray(v.outputChannelCount)?v.outputChannelCount:Array.from(v.outputChannelCount);if(h===null){const M=I.reduce((Y,j)=>Y+j,0),V=n(T,{channelCount:Math.max(1,M),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,M)}),W=[];for(let Y=0;Y{const et=new d(Z,Math.ceil(k.context.length/128)*128,T.sampleRate),R=[],F=[];for(let H=0;H{const N=r(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:H.value});return await p(et,H,N.offset),N})),P=s(et,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,j+z)});for(let H=0;H_(k,et,H))),f(et)})(),T,v,I,b,l)}const M=await g,V=e(T,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),[W,G,Y]=C;M!==null&&(V.buffer=M,V.start(0)),V.connect(W);for(let j=0,z=0;jclass extends _{constructor(y,k){super(y,k),this._nativeContext=y,this._audioWorklet=i===void 0?void 0:{addModule:(T,x)=>i(this,T,x)}}get audioWorklet(){return this._audioWorklet}createAnalyser(){return new t(this)}createBiquadFilter(){return new n(this)}createBuffer(y,k,T){return new e({length:k,numberOfChannels:y,sampleRate:T})}createBufferSource(){return new s(this)}createChannelMerger(y=6){return new r(this,{numberOfInputs:y})}createChannelSplitter(y=6){return new o(this,{numberOfOutputs:y})}createConstantSource(){return new a(this)}createConvolver(){return new c(this)}createDelay(y=1){return new u(this,{maxDelayTime:y})}createDynamicsCompressor(){return new h(this)}createGain(){return new d(this)}createIIRFilter(y,k){return new p(this,{feedback:k,feedforward:y})}createOscillator(){return new f(this)}createPanner(){return new m(this)}createPeriodicWave(y,k,T={disableNormalization:!1}){return new v(this,{...T,imag:k,real:y})}createStereoPanner(){return new b(this)}createWaveShaper(){return new w(this)}decodeAudioData(y,k,T){return l(this._nativeContext,y).then(x=>(typeof k=="function"&&k(x),x),x=>{throw typeof T=="function"&&T(x),x})}},_p={Q:1,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:350,gain:0,type:"lowpass"},gp=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={..._p,...u},p=n(h,d),_=o(h),f=_?e():null;super(l,!1,p,f),this._Q=t(this,_,p.Q,ne,ce),this._detune=t(this,_,p.detune,1200*Math.log2(ne),-1200*Math.log2(ne)),this._frequency=t(this,_,p.frequency,l.sampleRate/2,0),this._gain=t(this,_,p.gain,40*Math.log10(ne),ce),this._nativeBiquadFilterNode=p,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()}},yp=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(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=t(c,h)}return r.set(c,l),u?(await i(c,a.Q,l.Q),await i(c,a.detune,l.detune),await i(c,a.frequency,l.frequency),await i(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 n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},vp=(i,t)=>(e,s)=>{const n=t.get(e);if(n!==void 0)return n;const r=i.get(e);if(r!==void 0)return r;try{const o=s();return o instanceof Promise?(i.set(e,o),o.catch(()=>!1).then(a=>(i.delete(e),t.set(e,a),a))):(t.set(e,o),o)}catch{return t.set(e,!1),!1}},xp={channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6},kp=(i,t,e,s,n)=>class extends i{constructor(o,a){const c=s(o),l={...xp,...a},u=e(c,l),h=n(c)?t():null;super(o,!1,u,h)}},Tp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfInputs:a.numberOfInputs};a=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},wp={channelCount:6,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:6},bp=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u=r({...wp,...c}),h=e(l,u),d=n(l)?t():null;super(a,!1,h,d)}},Cp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,numberOfOutputs:a.numberOfOutputs};a=i(o,l)}return s.set(o,a),await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Sp=i=>(t,e,s)=>i(e,t,s),Ep=i=>(t,e,s=0,n=0)=>{const r=t[s];if(r===void 0)throw i();return jr(e)?r.connect(e,0,n):r.connect(e,0)},Op=i=>(t,e)=>{const s=i(t,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),n=t.createBuffer(1,2,44100);return s.buffer=n,s.loop=!0,s.connect(e),s.start(),()=>{s.stop(),s.disconnect(e)}},Ap={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",offset:1},Mp=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...Ap,...l},d=s(u,h),p=r(u),_=p?e():null;super(c,!1,d,_),this._constantSourceNodeRenderer=_,this._nativeConstantSourceNode=d,this._offset=t(this,p,d.offset,ne,ce),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"){Vn(this);const l=()=>{this._nativeConstantSourceNode.removeEventListener("ended",l),hs(this)&&nr(this)};this._nativeConstantSourceNode.addEventListener("ended",l)}}stop(c=0){this._nativeConstantSourceNode.stop(c),this._constantSourceNodeRenderer!==null&&(this._constantSourceNodeRenderer.stop=c)}},Dp=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null;const c=async(l,u)=>{let h=e(l);const d=se(h,u);if(!d){const p={channelCount:h.channelCount,channelCountMode:h.channelCountMode,channelInterpretation:h.channelInterpretation,offset:h.offset.value};h=t(u,p),o!==null&&h.start(o),a!==null&&h.stop(a)}return r.set(u,h),d?await i(u,l.offset,h.offset):await s(u,l.offset,h.offset),await n(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)}}},Pp=i=>t=>(i[0]=t,i[0]),Ip={buffer:null,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",disableNormalization:!1},Np=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u={...Ip,...c},h=e(l,u),p=n(l)?t():null;super(a,!1,h,p),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}},Rp=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={buffer:a.buffer,channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,disableNormalization:!a.normalize};a=i(o,l)}return s.set(o,a),Zn(a)?await e(r,o,a.inputs[0]):await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Fp=(i,t)=>(e,s,n)=>{if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");try{return new t(e,s,n)}catch(r){throw r.name==="SyntaxError"?i():r}},Lp=()=>new DOMException("","DataCloneError"),ml=i=>{const{port1:t,port2:e}=new MessageChannel;return new Promise(s=>{const n=()=>{e.onmessage=null,t.close(),e.close(),s()};e.onmessage=()=>n();try{t.postMessage(i,[i])}catch{}finally{n()}})},Vp=(i,t,e,s,n,r,o,a,c,l,u)=>(h,d)=>{const p=o(h)?h:r(h);if(n.has(d)){const _=e();return Promise.reject(_)}try{n.add(d)}catch{}return t(c,()=>c(p))?p.decodeAudioData(d).then(_=>(ml(d).catch(()=>{}),t(a,()=>a(_))||u(_),i.add(_),_)):new Promise((_,f)=>{const m=async()=>{try{await ml(d)}catch{}},v=b=>{f(b),m()};try{p.decodeAudioData(d,b=>{typeof b.copyFromChannel!="function"&&(l(b),Ua(b)),i.add(b),m().then(()=>_(b))},b=>{v(b===null?s():b)})}catch(b){v(b)}})},Up=(i,t,e,s,n,r,o,a)=>(c,l)=>{const u=t.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(t.delete(c),!d&&o(c)){const p=s(c),{outputs:_}=e(c);for(const f of _)if(rr(f)){const m=s(f[0]);i(p,m,f[1],f[2])}else{const m=n(f[0]);p.connect(m,f[1])}}}else t.set(c,u-l)},zp={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",delayTime:0,maxDelayTime:1},jp=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...zp,...l},d=s(u,h),p=r(u),_=p?e(h.maxDelayTime):null;super(c,!1,d,_),this._delayTime=t(this,p,d.delayTime),o(this,h.maxDelayTime)}get delayTime(){return this._delayTime}},Bp=(i,t,e,s,n)=>r=>{const o=new WeakMap,a=async(c,l)=>{let u=e(c);const h=se(u,l);if(!h){const d={channelCount:u.channelCount,channelCountMode:u.channelCountMode,channelInterpretation:u.channelInterpretation,delayTime:u.delayTime.value,maxDelayTime:r};u=t(l,d)}return o.set(l,u),h?await i(l,c.delayTime,u.delayTime):await s(l,c.delayTime,u.delayTime),await n(c,l,u),u};return{render(c,l){const u=o.get(l);return u!==void 0?Promise.resolve(u):a(c,l)}}},qp=i=>(t,e,s,n)=>i(t[n],r=>r[0]===e&&r[1]===s),Wp=i=>(t,e)=>{i(t).delete(e)},Hp=i=>"delayTime"in i,Yp=(i,t,e)=>function s(n,r){const o=Vr(r)?r:e(i,r);if(Hp(o))return[];if(n[0]===o)return[n];if(n.includes(o))return[];const{outputs:a}=t(o);return Array.from(a).map(c=>s([...n,o],c[0])).reduce((c,l)=>c.concat(l),[])},wr=(i,t,e)=>{const s=t[e];if(s===void 0)throw i();return s},Gp=i=>(t,e=void 0,s=void 0,n=0)=>e===void 0?t.forEach(r=>r.disconnect()):typeof e=="number"?wr(i,t,e).disconnect():jr(e)?s===void 0?t.forEach(r=>r.disconnect(e)):n===void 0?wr(i,t,s).disconnect(e,0):wr(i,t,s).disconnect(e,0,n):s===void 0?t.forEach(r=>r.disconnect(e)):wr(i,t,s).disconnect(e,0),$p={attack:.003,channelCount:2,channelCountMode:"clamped-max",channelInterpretation:"speakers",knee:30,ratio:12,release:.25,threshold:-24},Zp=(i,t,e,s,n,r,o,a)=>class extends i{constructor(l,u){const h=r(l),d={...$p,...u},p=s(h,d),_=o(h),f=_?e():null;super(l,!1,p,f),this._attack=t(this,_,p.attack),this._knee=t(this,_,p.knee),this._nativeDynamicsCompressorNode=p,this._ratio=t(this,_,p.ratio),this._release=t(this,_,p.release),this._threshold=t(this,_,p.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,n()}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,n()}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}},Xp=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(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=t(c,h)}return r.set(c,l),u?(await i(c,a.attack,l.attack),await i(c,a.knee,l.knee),await i(c,a.ratio,l.ratio),await i(c,a.release,l.release),await i(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 n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},Qp=()=>new DOMException("","EncodingError"),Kp=i=>t=>new Promise((e,s)=>{if(i===null){s(new SyntaxError);return}const n=i.document.head;if(n===null)s(new SyntaxError);else{const r=i.document.createElement("script"),o=new Blob([t],{type:"application/javascript"}),a=URL.createObjectURL(o),c=i.onerror,l=()=>{i.onerror=c,URL.revokeObjectURL(a)};i.onerror=(u,h,d,p,_)=>{if(h===a||h===i.location.href&&d===1&&p===1)return l(),s(_),!1;if(c!==null)return c(u,h,d,p,_)},r.onerror=()=>{l(),s(new SyntaxError)},r.onload=()=>{l(),e()},r.src=a,r.type="module",n.appendChild(r)}}),Jp=i=>class{constructor(e){this._nativeEventTarget=e,this._listeners=new WeakMap}addEventListener(e,s,n){if(s!==null){let r=this._listeners.get(s);r===void 0&&(r=i(this,s),typeof s=="function"&&this._listeners.set(s,r)),this._nativeEventTarget.addEventListener(e,r,n)}}dispatchEvent(e){return this._nativeEventTarget.dispatchEvent(e)}removeEventListener(e,s,n){const r=s===null?void 0:this._listeners.get(s);this._nativeEventTarget.removeEventListener(e,r===void 0?null:r,n)}},tm=i=>(t,e,s)=>{Object.defineProperties(i,{currentFrame:{configurable:!0,get(){return Math.round(t*e)}},currentTime:{configurable:!0,get(){return t}}});try{return s()}finally{i!==null&&(delete i.currentFrame,delete i.currentTime)}},em=i=>async t=>{try{const e=await fetch(t);if(e.ok)return[await e.text(),e.url]}catch{}throw i()},sm={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",gain:1},nm=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...sm,...c},h=s(l,u),d=r(l),p=d?e():null;super(a,!1,h,p),this._gain=t(this,d,h.gain,ne,ce)}get gain(){return this._gain}},im=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,gain:l.gain.value};l=t(c,h)}return r.set(c,l),u?await i(c,a.gain,l.gain):await s(c,a.gain,l.gain),await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},rm=(i,t)=>e=>t(i,e),om=i=>t=>{const e=i(t);if(e.renderer===null)throw new Error("Missing the renderer of the given AudioNode in the audio graph.");return e.renderer},am=i=>t=>{var e;return(e=i.get(t))!==null&&e!==void 0?e:0},cm=i=>t=>{const e=i(t);if(e.renderer===null)throw new Error("Missing the renderer of the given AudioParam in the audio graph.");return e.renderer},lm=i=>t=>i.get(t),Zt=()=>new DOMException("","InvalidStateError"),um=i=>t=>{const e=i.get(t);if(e===void 0)throw Zt();return e},hm=(i,t)=>e=>{let s=i.get(e);if(s!==void 0)return s;if(t===null)throw new Error("Missing the native OfflineAudioContext constructor.");return s=new t(1,1,44100),i.set(e,s),s},dm=i=>t=>{const e=i.get(t);if(e===void 0)throw new Error("The context has no set of AudioWorkletNodes.");return e},yo=()=>new DOMException("","InvalidAccessError"),fm=i=>{i.getFrequencyResponse=(t=>(e,s,n)=>{if(e.length!==s.length||s.length!==n.length)throw yo();return t.call(i,e,s,n)})(i.getFrequencyResponse)},pm={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers"},mm=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=s(a),u=n(l),h={...pm,...c},d=t(l,u?null:a.baseLatency,h),p=u?e(h.feedback,h.feedforward):null;super(a,!1,d,p),fm(d),this._nativeIIRFilterNode=d,r(this,1)}getFrequencyResponse(a,c,l){return this._nativeIIRFilterNode.getFrequencyResponse(a,c,l)}},wu=(i,t,e,s,n,r,o,a,c,l,u)=>{const h=l.length;let d=a;for(let p=0;p{const n=e instanceof Float64Array?e:new Float64Array(e),r=s instanceof Float64Array?s:new Float64Array(s),o=n.length,a=r.length,c=Math.min(o,a);if(n[0]!==1){for(let _=0;_(r,o)=>{const a=new WeakMap;let c=null;const l=async(u,h)=>{let d=null,p=t(u);const _=se(p,h);if(h.createIIRFilter===void 0?d=i(h,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}):_||(p=h.createIIRFilter(o,r)),a.set(h,d===null?p:d),d!==null){if(c===null){if(e===null)throw new Error("Missing the native OfflineAudioContext constructor.");const m=new e(u.context.destination.channelCount,u.context.length,h.sampleRate);c=(async()=>{await s(u,m,m.destination);const v=await n(m);return _m(v,h,r,o)})()}const f=await c;return d.buffer=f,d.start(0),d}return await s(u,h,p),p};return{render(u,h){const d=a.get(h);return d!==void 0?Promise.resolve(d):l(u,h)}}},ym=(i,t,e,s,n,r)=>o=>(a,c)=>{const l=i.get(a);if(l===void 0){if(!o&&r(a)){const u=s(a),{outputs:h}=e(a);for(const d of h)if(rr(d)){const p=s(d[0]);t(u,p,d[1],d[2])}else{const p=n(d[0]);u.disconnect(p,d[1])}}i.set(a,c)}else i.set(a,l+c)},vm=(i,t)=>e=>{const s=i.get(e);return t(s)||t(e)},xm=(i,t)=>e=>i.has(e)||t(e),km=(i,t)=>e=>i.has(e)||t(e),Tm=(i,t)=>e=>{const s=i.get(e);return t(s)||t(e)},wm=i=>t=>i!==null&&t instanceof i,bm=i=>t=>i!==null&&typeof i.AudioNode=="function"&&t instanceof i.AudioNode,Cm=i=>t=>i!==null&&typeof i.AudioParam=="function"&&t instanceof i.AudioParam,Sm=(i,t)=>e=>i(e)||t(e),Em=i=>t=>i!==null&&t instanceof i,Om=i=>i!==null&&i.isSecureContext,Am=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r),c=t(a,o);if(s(a))throw TypeError();super(r,!0,c,null),this._nativeMediaElementAudioSourceNode=c}get mediaElement(){return this._nativeMediaElementAudioSourceNode.mediaElement}},Mm={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers"},Dm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r);if(s(a))throw new TypeError;const c={...Mm,...o},l=t(a,c);super(r,!1,l,null),this._nativeMediaStreamAudioDestinationNode=l}get stream(){return this._nativeMediaStreamAudioDestinationNode.stream}},Pm=(i,t,e,s)=>class extends i{constructor(r,o){const a=e(r),c=t(a,o);if(s(a))throw new TypeError;super(r,!0,c,null),this._nativeMediaStreamAudioSourceNode=c}get mediaStream(){return this._nativeMediaStreamAudioSourceNode.mediaStream}},Im=(i,t,e)=>class extends i{constructor(n,r){const o=e(n),a=t(o,r);super(n,!0,a,null)}},Nm=(i,t,e,s,n,r)=>class extends e{constructor(a,c){super(a),this._nativeContext=a,_o.set(this,a),s(a)&&n.set(a,new Set),this._destination=new i(this,c),this._listener=t(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}},Oi=i=>{const t=new Uint32Array([1179011410,40,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,4,0]);try{const e=i.decodeAudioData(t.buffer,()=>{});return e===void 0?!1:(e.catch(()=>{}),!0)}catch{}return!1},Rm=(i,t)=>(e,s,n)=>{const r=new Set;return e.connect=(o=>(a,c=0,l=0)=>{const u=r.size===0;if(t(a))return o.call(e,a,c,l),i(r,[a,c,l],h=>h[0]===a&&h[1]===c&&h[2]===l,!0),u&&s(),a;o.call(e,a,c),i(r,[a,c],h=>h[0]===a&&h[1]===c,!0),u&&s()})(e.connect),e.disconnect=(o=>(a,c,l)=>{const u=r.size>0;if(a===void 0)o.apply(e),r.clear();else if(typeof a=="number"){o.call(e,a);for(const d of r)d[1]===a&&r.delete(d)}else{t(a)?o.call(e,a,c,l):o.call(e,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&&n()})(e.disconnect),e},Pt=(i,t,e)=>{const s=t[e];s!==void 0&&s!==i[e]&&(i[e]=s)},Gt=(i,t)=>{Pt(i,t,"channelCount"),Pt(i,t,"channelCountMode"),Pt(i,t,"channelInterpretation")},_l=i=>typeof i.getFloatTimeDomainData=="function",Fm=i=>{i.getFloatTimeDomainData=t=>{const e=new Uint8Array(t.length);i.getByteTimeDomainData(e);const s=Math.max(e.length,i.fftSize);for(let n=0;n(e,s)=>{const n=e.createAnalyser();if(Gt(n,s),!(s.maxDecibels>s.minDecibels))throw t();return Pt(n,s,"fftSize"),Pt(n,s,"maxDecibels"),Pt(n,s,"minDecibels"),Pt(n,s,"smoothingTimeConstant"),i(_l,()=>_l(n))||Fm(n),n},Vm=i=>i===null?null:i.hasOwnProperty("AudioBuffer")?i.AudioBuffer:null,Ft=(i,t,e)=>{const s=t[e];s!==void 0&&s!==i[e].value&&(i[e].value=s)},Um=i=>{i.start=(t=>{let e=!1;return(s=0,n=0,r)=>{if(e)throw Zt();t.call(i,s,n,r),e=!0}})(i.start)},Ba=i=>{i.start=(t=>(e=0,s=0,n)=>{if(typeof n=="number"&&n<0||s<0||e<0)throw new RangeError("The parameters can't be negative.");t.call(i,e,s,n)})(i.start)},qa=i=>{i.stop=(t=>(e=0)=>{if(e<0)throw new RangeError("The parameter can't be negative.");t.call(i,e)})(i.stop)},zm=(i,t,e,s,n,r,o,a,c,l,u)=>(h,d)=>{const p=h.createBufferSource();return Gt(p,d),Ft(p,d,"playbackRate"),Pt(p,d,"buffer"),Pt(p,d,"loop"),Pt(p,d,"loopEnd"),Pt(p,d,"loopStart"),t(e,()=>e(h))||Um(p),t(s,()=>s(h))||c(p),t(n,()=>n(h))||l(p,h),t(r,()=>r(h))||Ba(p),t(o,()=>o(h))||u(p,h),t(a,()=>a(h))||qa(p),i(h,p),p},jm=i=>i===null?null:i.hasOwnProperty("AudioContext")?i.AudioContext:i.hasOwnProperty("webkitAudioContext")?i.webkitAudioContext:null,Bm=(i,t)=>(e,s,n)=>{const r=e.destination;if(r.channelCount!==s)try{r.channelCount=s}catch{}n&&r.channelCountMode!=="explicit"&&(r.channelCountMode="explicit"),r.maxChannelCount===0&&Object.defineProperty(r,"maxChannelCount",{value:s});const o=i(e,{channelCount:s,channelCountMode:r.channelCountMode,channelInterpretation:r.channelInterpretation,gain:1});return t(o,"channelCount",a=>()=>a.call(o),a=>c=>{a.call(o,c);try{r.channelCount=c}catch(l){if(c>r.maxChannelCount)throw l}}),t(o,"channelCountMode",a=>()=>a.call(o),a=>c=>{a.call(o,c),r.channelCountMode=c}),t(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},qm=i=>i===null?null:i.hasOwnProperty("AudioWorkletNode")?i.AudioWorkletNode:null,Wm=i=>{const{port1:t}=new MessageChannel;try{t.postMessage(i)}finally{t.close()}},Hm=(i,t,e,s,n)=>(r,o,a,c,l,u)=>{if(a!==null)try{const h=new a(r,c,u),d=new Map;let p=null;if(Object.defineProperties(h,{channelCount:{get:()=>u.channelCount,set:()=>{throw i()}},channelCountMode:{get:()=>"explicit",set:()=>{throw i()}},onprocessorerror:{get:()=>p,set:_=>{typeof p=="function"&&h.removeEventListener("processorerror",p),p=typeof _=="function"?_:null,typeof p=="function"&&h.addEventListener("processorerror",p)}}}),h.addEventListener=(_=>(...f)=>{if(f[0]==="processorerror"){const m=typeof f[1]=="function"?f[1]:typeof f[1]=="object"&&f[1]!==null&&typeof f[1].handleEvent=="function"?f[1].handleEvent:null;if(m!==null){const v=d.get(f[1]);v!==void 0?f[1]=v:(f[1]=b=>{b.type==="error"?(Object.defineProperties(b,{type:{value:"processorerror"}}),m(b)):m(new ErrorEvent(f[0],{...b}))},d.set(m,f[1]))}}return _.call(h,"error",f[1],f[2]),_.call(h,...f)})(h.addEventListener),h.removeEventListener=(_=>(...f)=>{if(f[0]==="processorerror"){const m=d.get(f[1]);m!==void 0&&(d.delete(f[1]),f[1]=m)}return _.call(h,"error",f[1],f[2]),_.call(h,f[0],f[1],f[2])})(h.removeEventListener),u.numberOfOutputs!==0){const _=e(r,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return h.connect(_).connect(r.destination),n(h,()=>_.disconnect(),()=>_.connect(r.destination))}return h}catch(h){throw h.code===11?s():h}if(l===void 0)throw s();return Wm(u),t(r,o,l,u)},bu=(i,t)=>i===null?512:Math.max(512,Math.min(16384,Math.pow(2,Math.round(Math.log2(i*t))))),Ym=i=>new Promise((t,e)=>{const{port1:s,port2:n}=new MessageChannel;s.onmessage=({data:r})=>{s.close(),n.close(),t(r)},s.onmessageerror=({data:r})=>{s.close(),n.close(),e(r)},n.postMessage(i)}),Gm=async(i,t)=>{const e=await Ym(t);return new i(e)},$m=(i,t,e,s)=>{let n=ua.get(i);n===void 0&&(n=new WeakMap,ua.set(i,n));const r=Gm(e,s);return n.set(t,r),r},Zm=(i,t,e,s,n,r,o,a,c,l,u,h,d)=>(p,_,f,m)=>{if(m.numberOfInputs===0&&m.numberOfOutputs===0)throw c();const v=Array.isArray(m.outputChannelCount)?m.outputChannelCount:Array.from(m.outputChannelCount);if(v.some(B=>B<1))throw c();if(v.length!==m.numberOfOutputs)throw t();if(m.channelCountMode!=="explicit")throw c();const b=m.channelCount*m.numberOfInputs,w=v.reduce((B,A)=>B+A,0),g=f.parameterDescriptors===void 0?0:f.parameterDescriptors.length;if(b+g>6||w>6)throw c();const y=new MessageChannel,k=[],T=[];for(let B=0;BB===void 0?0:B},maxValue:{get:()=>A===void 0?ne:A},minValue:{get:()=>E===void 0?ce:E}}),x.push(tt)}const C=s(p,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:Math.max(1,b+g)}),O=bu(_,p.sampleRate),I=a(p,O,b+g,Math.max(1,w)),M=n(p,{channelCount:Math.max(1,w),channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:Math.max(1,w)}),V=[];for(let B=0;B{const E=x[A];return E.connect(C,0,b+A),E.start(0),[B,E.offset]}));C.connect(I);let G=m.channelInterpretation,Y=null;const j=m.numberOfOutputs===0?[I]:V,z={get bufferSize(){return O},get channelCount(){return m.channelCount},set channelCount(B){throw e()},get channelCountMode(){return m.channelCountMode},set channelCountMode(B){throw e()},get channelInterpretation(){return G},set channelInterpretation(B){for(const A of k)A.channelInterpretation=B;G=B},get context(){return I.context},get inputs(){return k},get numberOfInputs(){return m.numberOfInputs},get numberOfOutputs(){return m.numberOfOutputs},get onprocessorerror(){return Y},set onprocessorerror(B){typeof Y=="function"&&z.removeEventListener("processorerror",Y),Y=typeof B=="function"?B:null,typeof Y=="function"&&z.addEventListener("processorerror",Y)},get parameters(){return W},get port(){return y.port2},addEventListener(...B){return I.addEventListener(B[0],B[1],B[2])},connect:i.bind(null,j),disconnect:l.bind(null,j),dispatchEvent(...B){return I.dispatchEvent(B[0])},removeEventListener(...B){return I.removeEventListener(B[0],B[1],B[2])}},Z=new Map;y.port1.addEventListener=(B=>(...A)=>{if(A[0]==="message"){const E=typeof A[1]=="function"?A[1]:typeof A[1]=="object"&&A[1]!==null&&typeof A[1].handleEvent=="function"?A[1].handleEvent:null;if(E!==null){const X=Z.get(A[1]);X!==void 0?A[1]=X:(A[1]=tt=>{u(p.currentTime,p.sampleRate,()=>E(tt))},Z.set(E,A[1]))}}return B.call(y.port1,A[0],A[1],A[2])})(y.port1.addEventListener),y.port1.removeEventListener=(B=>(...A)=>{if(A[0]==="message"){const E=Z.get(A[1]);E!==void 0&&(Z.delete(A[1]),A[1]=E)}return B.call(y.port1,A[0],A[1],A[2])})(y.port1.removeEventListener);let Q=null;Object.defineProperty(y.port1,"onmessage",{get:()=>Q,set:B=>{typeof Q=="function"&&y.port1.removeEventListener("message",Q),Q=typeof B=="function"?B:null,typeof Q=="function"&&(y.port1.addEventListener("message",Q),y.port1.start())}}),f.prototype.port=y.port1;let et=null;$m(p,z,f,m).then(B=>et=B);const F=qr(m.numberOfInputs,m.channelCount),S=qr(m.numberOfOutputs,v),P=f.parameterDescriptors===void 0?[]:f.parameterDescriptors.reduce((B,{name:A})=>({...B,[A]:new Float32Array(128)}),{});let H=!0;const N=()=>{m.numberOfOutputs>0&&I.disconnect(M);for(let B=0,A=0;B{if(et!==null){const E=h(z);for(let X=0;X{Br(B,P,tt,b+lt,X)});for(let tt=0;tt{if(E[Yt].size>0)return U.set(Yt,O/128),vt;const ti=U.get(Yt);return ti===void 0?[]:(vt.every(Po=>Po.every(dr=>dr===0))&&(ti===1?U.delete(Yt):U.set(Yt,ti-1)),vt)});H=u(p.currentTime+X/p.sampleRate,p.sampleRate,()=>et.process(tt,S,P));for(let vt=0,Yt=0;vtI.connect(st).connect(p.destination),J=()=>{I.disconnect(st),st.disconnect()},pt=()=>{if(H){J(),m.numberOfOutputs>0&&I.connect(M);for(let B=0,A=0;B{H&&(nt(),N()),it=!1};return nt(),d(z,pt,K)},Cu=(i,t)=>{const e=i.createBiquadFilter();return Gt(e,t),Ft(e,t,"Q"),Ft(e,t,"detune"),Ft(e,t,"frequency"),Ft(e,t,"gain"),Pt(e,t,"type"),e},Xm=(i,t)=>(e,s)=>{const n=e.createChannelMerger(s.numberOfInputs);return i!==null&&i.name==="webkitAudioContext"&&t(e,n),Gt(n,s),n},Qm=i=>{const t=i.numberOfOutputs;Object.defineProperty(i,"channelCount",{get:()=>t,set:e=>{if(e!==t)throw Zt()}}),Object.defineProperty(i,"channelCountMode",{get:()=>"explicit",set:e=>{if(e!=="explicit")throw Zt()}}),Object.defineProperty(i,"channelInterpretation",{get:()=>"discrete",set:e=>{if(e!=="discrete")throw Zt()}})},or=(i,t)=>{const e=i.createChannelSplitter(t.numberOfOutputs);return Gt(e,t),Qm(e),e},Km=(i,t,e,s,n)=>(r,o)=>{if(r.createConstantSource===void 0)return e(r,o);const a=r.createConstantSource();return Gt(a,o),Ft(a,o,"offset"),t(s,()=>s(r))||Ba(a),t(n,()=>n(r))||qa(a),i(r,a),a},Xn=(i,t)=>(i.connect=t.connect.bind(t),i.disconnect=t.disconnect.bind(t),i),Jm=(i,t,e,s)=>(n,{offset:r,...o})=>{const a=n.createBuffer(1,2,44100),c=t(n,{buffer:null,channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",loop:!1,loopEnd:0,loopStart:0,playbackRate:1}),l=e(n,{...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(_){l.channelCount=_},get channelCountMode(){return l.channelCountMode},set channelCountMode(_){l.channelCountMode=_},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(_){l.channelInterpretation=_},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(_){c.onended=_},addEventListener(..._){return c.addEventListener(_[0],_[1],_[2])},dispatchEvent(..._){return c.dispatchEvent(_[0])},removeEventListener(..._){return c.removeEventListener(_[0],_[1],_[2])},start(_=0){c.start.call(c,_)},stop(_=0){c.stop.call(c,_)}},d=()=>c.connect(l),p=()=>c.disconnect(l);return i(n,c),s(Xn(h,l),d,p)},t_=(i,t)=>(e,s)=>{const n=e.createConvolver();if(Gt(n,s),s.disableNormalization===n.normalize&&(n.normalize=!s.disableNormalization),Pt(n,s,"buffer"),s.channelCount>2||(t(n,"channelCount",r=>()=>r.call(n),r=>o=>{if(o>2)throw i();return r.call(n,o)}),s.channelCountMode==="max"))throw i();return t(n,"channelCountMode",r=>()=>r.call(n),r=>o=>{if(o==="max")throw i();return r.call(n,o)}),n},Su=(i,t)=>{const e=i.createDelay(t.maxDelayTime);return Gt(e,t),Ft(e,t,"delayTime"),e},e_=i=>(t,e)=>{const s=t.createDynamicsCompressor();if(Gt(s,e),e.channelCount>2||e.channelCountMode==="max")throw i();return Ft(s,e,"attack"),Ft(s,e,"knee"),Ft(s,e,"ratio"),Ft(s,e,"release"),Ft(s,e,"threshold"),s},me=(i,t)=>{const e=i.createGain();return Gt(e,t),Ft(e,t,"gain"),e},s_=i=>(t,e,s)=>{if(t.createIIRFilter===void 0)return i(t,e,s);const n=t.createIIRFilter(s.feedforward,s.feedback);return Gt(n,s),n};function n_(i,t){const e=t[0]*t[0]+t[1]*t[1];return[(i[0]*t[0]+i[1]*t[1])/e,(i[1]*t[0]-i[0]*t[1])/e]}function i_(i,t){return[i[0]*t[0]-i[1]*t[1],i[0]*t[1]+i[1]*t[0]]}function gl(i,t){let e=[0,0];for(let s=i.length-1;s>=0;s-=1)e=i_(e,t),e[0]+=i[s];return e}const r_=(i,t,e,s)=>(n,r,{channelCount:o,channelCountMode:a,channelInterpretation:c,feedback:l,feedforward:u})=>{const h=bu(r,n.sampleRate),d=l instanceof Float64Array?l:new Float64Array(l),p=u instanceof Float64Array?u:new Float64Array(u),_=d.length,f=p.length,m=Math.min(_,f);if(_===0||_>20)throw s();if(d[0]===0)throw t();if(f===0||f>20)throw s();if(p[0]===0)throw t();if(d[0]!==1){for(let x=0;x{const C=x.inputBuffer,O=x.outputBuffer,I=C.numberOfChannels;for(let M=0;Mi.createMediaElementSource(t.mediaElement),a_=(i,t)=>{const e=i.createMediaStreamDestination();return Gt(e,t),e.numberOfOutputs===1&&Object.defineProperty(e,"numberOfOutputs",{get:()=>0}),e},c_=(i,{mediaStream:t})=>{const e=t.getAudioTracks();e.sort((r,o)=>r.ido.id?1:0);const s=e.slice(0,1),n=i.createMediaStreamSource(new MediaStream(s));return Object.defineProperty(n,"mediaStream",{value:t}),n},l_=(i,t)=>(e,{mediaStreamTrack:s})=>{if(typeof e.createMediaStreamTrackSource=="function")return e.createMediaStreamTrackSource(s);const n=new MediaStream([s]),r=e.createMediaStreamSource(n);if(s.kind!=="audio")throw i();if(t(e))throw new TypeError;return r},u_=i=>i===null?null:i.hasOwnProperty("OfflineAudioContext")?i.OfflineAudioContext:i.hasOwnProperty("webkitOfflineAudioContext")?i.webkitOfflineAudioContext:null,h_=(i,t,e,s,n,r)=>(o,a)=>{const c=o.createOscillator();return Gt(c,a),Ft(c,a,"detune"),Ft(c,a,"frequency"),a.periodicWave!==void 0?c.setPeriodicWave(a.periodicWave):Pt(c,a,"type"),t(e,()=>e(o))||Ba(c),t(s,()=>s(o))||r(c,o),t(n,()=>n(o))||qa(c),i(o,c),c},d_=i=>(t,e)=>{const s=t.createPanner();return s.orientationX===void 0?i(t,e):(Gt(s,e),Ft(s,e,"orientationX"),Ft(s,e,"orientationY"),Ft(s,e,"orientationZ"),Ft(s,e,"positionX"),Ft(s,e,"positionY"),Ft(s,e,"positionZ"),Pt(s,e,"coneInnerAngle"),Pt(s,e,"coneOuterAngle"),Pt(s,e,"coneOuterGain"),Pt(s,e,"distanceModel"),Pt(s,e,"maxDistance"),Pt(s,e,"panningModel"),Pt(s,e,"refDistance"),Pt(s,e,"rolloffFactor"),s)},f_=(i,t,e,s,n,r,o,a,c,l)=>(u,{coneInnerAngle:h,coneOuterAngle:d,coneOuterGain:p,distanceModel:_,maxDistance:f,orientationX:m,orientationY:v,orientationZ:b,panningModel:w,positionX:g,positionY:y,positionZ:k,refDistance:T,rolloffFactor:x,...C})=>{const O=u.createPanner();if(C.channelCount>2||C.channelCountMode==="max")throw o();Gt(O,C);const I={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},M=e(u,{...I,channelInterpretation:"speakers",numberOfInputs:6}),V=s(u,{...C,gain:1}),W=s(u,{...I,gain:1}),G=s(u,{...I,gain:0}),Y=s(u,{...I,gain:0}),j=s(u,{...I,gain:0}),z=s(u,{...I,gain:0}),Z=s(u,{...I,gain:0}),Q=n(u,256,6,1),et=r(u,{...I,curve:new Float32Array([1,1]),oversample:"none"});let R=[m,v,b],F=[g,y,k];const S=new Float32Array(1);Q.onaudioprocess=({inputBuffer:U})=>{const it=[c(U,S,0),c(U,S,1),c(U,S,2)];it.some((nt,J)=>nt!==R[J])&&(O.setOrientation(...it),R=it);const st=[c(U,S,3),c(U,S,4),c(U,S,5)];st.some((nt,J)=>nt!==F[J])&&(O.setPosition(...st),F=st)},Object.defineProperty(G.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Y.gain,"defaultValue",{get:()=>0}),Object.defineProperty(j.gain,"defaultValue",{get:()=>0}),Object.defineProperty(z.gain,"defaultValue",{get:()=>0}),Object.defineProperty(Z.gain,"defaultValue",{get:()=>0});const P={get bufferSize(){},get channelCount(){return O.channelCount},set channelCount(U){if(U>2)throw o();V.channelCount=U,O.channelCount=U},get channelCountMode(){return O.channelCountMode},set channelCountMode(U){if(U==="max")throw o();V.channelCountMode=U,O.channelCountMode=U},get channelInterpretation(){return O.channelInterpretation},set channelInterpretation(U){V.channelInterpretation=U,O.channelInterpretation=U},get coneInnerAngle(){return O.coneInnerAngle},set coneInnerAngle(U){O.coneInnerAngle=U},get coneOuterAngle(){return O.coneOuterAngle},set coneOuterAngle(U){O.coneOuterAngle=U},get coneOuterGain(){return O.coneOuterGain},set coneOuterGain(U){if(U<0||U>1)throw t();O.coneOuterGain=U},get context(){return O.context},get distanceModel(){return O.distanceModel},set distanceModel(U){O.distanceModel=U},get inputs(){return[V]},get maxDistance(){return O.maxDistance},set maxDistance(U){if(U<0)throw new RangeError;O.maxDistance=U},get numberOfInputs(){return O.numberOfInputs},get numberOfOutputs(){return O.numberOfOutputs},get orientationX(){return W.gain},get orientationY(){return G.gain},get orientationZ(){return Y.gain},get panningModel(){return O.panningModel},set panningModel(U){O.panningModel=U},get positionX(){return j.gain},get positionY(){return z.gain},get positionZ(){return Z.gain},get refDistance(){return O.refDistance},set refDistance(U){if(U<0)throw new RangeError;O.refDistance=U},get rolloffFactor(){return O.rolloffFactor},set rolloffFactor(U){if(U<0)throw new RangeError;O.rolloffFactor=U},addEventListener(...U){return V.addEventListener(U[0],U[1],U[2])},dispatchEvent(...U){return V.dispatchEvent(U[0])},removeEventListener(...U){return V.removeEventListener(U[0],U[1],U[2])}};h!==P.coneInnerAngle&&(P.coneInnerAngle=h),d!==P.coneOuterAngle&&(P.coneOuterAngle=d),p!==P.coneOuterGain&&(P.coneOuterGain=p),_!==P.distanceModel&&(P.distanceModel=_),f!==P.maxDistance&&(P.maxDistance=f),m!==P.orientationX.value&&(P.orientationX.value=m),v!==P.orientationY.value&&(P.orientationY.value=v),b!==P.orientationZ.value&&(P.orientationZ.value=b),w!==P.panningModel&&(P.panningModel=w),g!==P.positionX.value&&(P.positionX.value=g),y!==P.positionY.value&&(P.positionY.value=y),k!==P.positionZ.value&&(P.positionZ.value=k),T!==P.refDistance&&(P.refDistance=T),x!==P.rolloffFactor&&(P.rolloffFactor=x),(R[0]!==1||R[1]!==0||R[2]!==0)&&O.setOrientation(...R),(F[0]!==0||F[1]!==0||F[2]!==0)&&O.setPosition(...F);const H=()=>{V.connect(O),i(V,et,0,0),et.connect(W).connect(M,0,0),et.connect(G).connect(M,0,1),et.connect(Y).connect(M,0,2),et.connect(j).connect(M,0,3),et.connect(z).connect(M,0,4),et.connect(Z).connect(M,0,5),M.connect(Q).connect(u.destination)},N=()=>{V.disconnect(O),a(V,et,0,0),et.disconnect(W),W.disconnect(M),et.disconnect(G),G.disconnect(M),et.disconnect(Y),Y.disconnect(M),et.disconnect(j),j.disconnect(M),et.disconnect(z),z.disconnect(M),et.disconnect(Z),Z.disconnect(M),M.disconnect(Q),Q.disconnect(u.destination)};return l(Xn(P,O),H,N)},p_=i=>(t,{disableNormalization:e,imag:s,real:n})=>{const r=s instanceof Float32Array?s:new Float32Array(s),o=n instanceof Float32Array?n:new Float32Array(n),a=t.createPeriodicWave(o,r,{disableNormalization:e});if(Array.from(s).length<2)throw i();return a},ar=(i,t,e,s)=>i.createScriptProcessor(t,e,s),m_=(i,t)=>(e,s)=>{const n=s.channelCountMode;if(n==="clamped-max")throw t();if(e.createStereoPanner===void 0)return i(e,s);const r=e.createStereoPanner();return Gt(r,s),Ft(r,s,"pan"),Object.defineProperty(r,"channelCountMode",{get:()=>n,set:o=>{if(o!==n)throw t()}}),r},__=(i,t,e,s,n,r)=>{const a=new Float32Array([1,1]),c=Math.PI/2,l={channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete"},u={...l,oversample:"none"},h=(_,f,m,v)=>{const b=new Float32Array(16385),w=new Float32Array(16385);for(let C=0;C<16385;C+=1){const O=C/16384*c;b[C]=Math.cos(O),w[C]=Math.sin(O)}const g=e(_,{...l,gain:0}),y=s(_,{...u,curve:b}),k=s(_,{...u,curve:a}),T=e(_,{...l,gain:0}),x=s(_,{...u,curve:w});return{connectGraph(){f.connect(g),f.connect(k.inputs===void 0?k:k.inputs[0]),f.connect(T),k.connect(m),m.connect(y.inputs===void 0?y:y.inputs[0]),m.connect(x.inputs===void 0?x:x.inputs[0]),y.connect(g.gain),x.connect(T.gain),g.connect(v,0,0),T.connect(v,0,1)},disconnectGraph(){f.disconnect(g),f.disconnect(k.inputs===void 0?k:k.inputs[0]),f.disconnect(T),k.disconnect(m),m.disconnect(y.inputs===void 0?y:y.inputs[0]),m.disconnect(x.inputs===void 0?x:x.inputs[0]),y.disconnect(g.gain),x.disconnect(T.gain),g.disconnect(v,0,0),T.disconnect(v,0,1)}}},d=(_,f,m,v)=>{const b=new Float32Array(16385),w=new Float32Array(16385),g=new Float32Array(16385),y=new Float32Array(16385),k=Math.floor(16385/2);for(let j=0;j<16385;j+=1)if(j>k){const z=(j-k)/(16384-k)*c;b[j]=Math.cos(z),w[j]=Math.sin(z),g[j]=0,y[j]=1}else{const z=j/(16384-k)*c;b[j]=1,w[j]=0,g[j]=Math.cos(z),y[j]=Math.sin(z)}const T=t(_,{channelCount:2,channelCountMode:"explicit",channelInterpretation:"discrete",numberOfOutputs:2}),x=e(_,{...l,gain:0}),C=s(_,{...u,curve:b}),O=e(_,{...l,gain:0}),I=s(_,{...u,curve:w}),M=s(_,{...u,curve:a}),V=e(_,{...l,gain:0}),W=s(_,{...u,curve:g}),G=e(_,{...l,gain:0}),Y=s(_,{...u,curve:y});return{connectGraph(){f.connect(T),f.connect(M.inputs===void 0?M:M.inputs[0]),T.connect(x,0),T.connect(O,0),T.connect(V,1),T.connect(G,1),M.connect(m),m.connect(C.inputs===void 0?C:C.inputs[0]),m.connect(I.inputs===void 0?I:I.inputs[0]),m.connect(W.inputs===void 0?W:W.inputs[0]),m.connect(Y.inputs===void 0?Y:Y.inputs[0]),C.connect(x.gain),I.connect(O.gain),W.connect(V.gain),Y.connect(G.gain),x.connect(v,0,0),V.connect(v,0,0),O.connect(v,0,1),G.connect(v,0,1)},disconnectGraph(){f.disconnect(T),f.disconnect(M.inputs===void 0?M:M.inputs[0]),T.disconnect(x,0),T.disconnect(O,0),T.disconnect(V,1),T.disconnect(G,1),M.disconnect(m),m.disconnect(C.inputs===void 0?C:C.inputs[0]),m.disconnect(I.inputs===void 0?I:I.inputs[0]),m.disconnect(W.inputs===void 0?W:W.inputs[0]),m.disconnect(Y.inputs===void 0?Y:Y.inputs[0]),C.disconnect(x.gain),I.disconnect(O.gain),W.disconnect(V.gain),Y.disconnect(G.gain),x.disconnect(v,0,0),V.disconnect(v,0,0),O.disconnect(v,0,1),G.disconnect(v,0,1)}}},p=(_,f,m,v,b)=>{if(f===1)return h(_,m,v,b);if(f===2)return d(_,m,v,b);throw n()};return(_,{channelCount:f,channelCountMode:m,pan:v,...b})=>{if(m==="max")throw n();const w=i(_,{...b,channelCount:1,channelCountMode:m,numberOfInputs:2}),g=e(_,{...b,channelCount:f,channelCountMode:m,gain:1}),y=e(_,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:v});let{connectGraph:k,disconnectGraph:T}=p(_,f,g,y,w);Object.defineProperty(y.gain,"defaultValue",{get:()=>0}),Object.defineProperty(y.gain,"maxValue",{get:()=>1}),Object.defineProperty(y.gain,"minValue",{get:()=>-1});const x={get bufferSize(){},get channelCount(){return g.channelCount},set channelCount(M){g.channelCount!==M&&(C&&T(),{connectGraph:k,disconnectGraph:T}=p(_,M,g,y,w),C&&k()),g.channelCount=M},get channelCountMode(){return g.channelCountMode},set channelCountMode(M){if(M==="clamped-max"||M==="max")throw n();g.channelCountMode=M},get channelInterpretation(){return g.channelInterpretation},set channelInterpretation(M){g.channelInterpretation=M},get context(){return g.context},get inputs(){return[g]},get numberOfInputs(){return g.numberOfInputs},get numberOfOutputs(){return g.numberOfOutputs},get pan(){return y.gain},addEventListener(...M){return g.addEventListener(M[0],M[1],M[2])},dispatchEvent(...M){return g.dispatchEvent(M[0])},removeEventListener(...M){return g.removeEventListener(M[0],M[1],M[2])}};let C=!1;const O=()=>{k(),C=!0},I=()=>{T(),C=!1};return r(Xn(x,w),O,I)}},g_=(i,t,e,s,n,r,o)=>(a,c)=>{const l=a.createWaveShaper();if(r!==null&&r.name==="webkitAudioContext"&&a.createGain().gain.automationRate===void 0)return e(a,c);Gt(l,c);const u=c.curve===null||c.curve instanceof Float32Array?c.curve:new Float32Array(c.curve);if(u!==null&&u.length<2)throw t();Pt(l,{curve:u},"curve"),Pt(l,c,"oversample");let h=null,d=!1;return o(l,"curve",f=>()=>f.call(l),f=>m=>(f.call(l,m),d&&(s(m)&&h===null?h=i(a,l):!s(m)&&h!==null&&(h(),h=null)),m)),n(l,()=>{d=!0,s(l.curve)&&(h=i(a,l))},()=>{d=!1,h!==null&&(h(),h=null)})},y_=(i,t,e,s,n)=>(r,{curve:o,oversample:a,...c})=>{const l=r.createWaveShaper(),u=r.createWaveShaper();Gt(l,c),Gt(u,c);const h=e(r,{...c,gain:1}),d=e(r,{...c,gain:-1}),p=e(r,{...c,gain:1}),_=e(r,{...c,gain:-1});let f=null,m=!1,v=null;const b={get bufferSize(){},get channelCount(){return l.channelCount},set channelCount(y){h.channelCount=y,d.channelCount=y,l.channelCount=y,p.channelCount=y,u.channelCount=y,_.channelCount=y},get channelCountMode(){return l.channelCountMode},set channelCountMode(y){h.channelCountMode=y,d.channelCountMode=y,l.channelCountMode=y,p.channelCountMode=y,u.channelCountMode=y,_.channelCountMode=y},get channelInterpretation(){return l.channelInterpretation},set channelInterpretation(y){h.channelInterpretation=y,d.channelInterpretation=y,l.channelInterpretation=y,p.channelInterpretation=y,u.channelInterpretation=y,_.channelInterpretation=y},get context(){return l.context},get curve(){return v},set curve(y){if(y!==null&&y.length<2)throw t();if(y===null)l.curve=y,u.curve=y;else{const k=y.length,T=new Float32Array(k+2-k%2),x=new Float32Array(k+2-k%2);T[0]=y[0],x[0]=-y[k-1];const C=Math.ceil((k+1)/2),O=(k+1)/2-1;for(let I=1;I{h.connect(l).connect(p),h.connect(d).connect(u).connect(_).connect(p),m=!0,s(v)&&(f=i(r,h))},g=()=>{h.disconnect(l),l.disconnect(p),h.disconnect(d),d.disconnect(u),u.disconnect(_),_.disconnect(p),m=!1,f!==null&&(f(),f=null)};return n(Xn(b,p),w,g)},oe=()=>new DOMException("","NotSupportedError"),v_={numberOfChannels:1},x_=(i,t,e,s,n)=>class extends i{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}={...v_,...l},p=s(h,u,d);t(Oi,()=>Oi(p))||p.addEventListener("statechange",(()=>{let _=0;const f=m=>{this._state==="running"&&(_>0?(p.removeEventListener("statechange",f),m.stopImmediatePropagation(),this._waitForThePromiseToSettle(m)):_+=1)};return f})()),super(p,h),this._length=u,this._nativeOfflineAudioContext=p,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(e()):(this._state="running",n(this.destination,this._nativeOfflineAudioContext).finally(()=>{this._state=null,gu(this)}))}_waitForThePromiseToSettle(o){this._state===null?this._nativeOfflineAudioContext.dispatchEvent(o):setTimeout(()=>this._waitForThePromiseToSettle(o))}},k_={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",detune:0,frequency:440,periodicWave:void 0,type:"sine"},T_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...k_,...l},d=e(u,h),p=r(u),_=p?s():null,f=c.sampleRate/2;super(c,!1,d,_),this._detune=t(this,p,d.detune,153600,-153600),this._frequency=t(this,p,d.frequency,f,-f),this._nativeOscillatorNode=d,this._onended=null,this._oscillatorNodeRenderer=_,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"){Vn(this);const l=()=>{this._nativeOscillatorNode.removeEventListener("ended",l),hs(this)&&nr(this)};this._nativeOscillatorNode.addEventListener("ended",l)}}stop(c=0){this._nativeOscillatorNode.stop(c),this._oscillatorNodeRenderer!==null&&(this._oscillatorNodeRenderer.stop=c)}},w_=(i,t,e,s,n)=>()=>{const r=new WeakMap;let o=null,a=null,c=null;const l=async(u,h)=>{let d=e(u);const p=se(d,h);if(!p){const _={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=t(h,_),a!==null&&d.start(a),c!==null&&d.stop(c)}return r.set(h,d),p?(await i(h,u.detune,d.detune),await i(h,u.frequency,d.frequency)):(await s(h,u.detune,d.detune),await s(h,u.frequency,d.frequency)),await n(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)}}},b_={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},C_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...b_,...l},d=e(u,h),p=r(u),_=p?s():null;super(c,!1,d,_),this._nativePannerNode=d,this._orientationX=t(this,p,d.orientationX,ne,ce),this._orientationY=t(this,p,d.orientationY,ne,ce),this._orientationZ=t(this,p,d.orientationZ,ne,ce),this._positionX=t(this,p,d.positionX,ne,ce),this._positionY=t(this,p,d.positionY,ne,ce),this._positionZ=t(this,p,d.positionZ,ne,ce),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}},S_=(i,t,e,s,n,r,o,a,c,l)=>()=>{const u=new WeakMap;let h=null;const d=async(p,_)=>{let f=null,m=r(p);const v={channelCount:m.channelCount,channelCountMode:m.channelCountMode,channelInterpretation:m.channelInterpretation},b={...v,coneInnerAngle:m.coneInnerAngle,coneOuterAngle:m.coneOuterAngle,coneOuterGain:m.coneOuterGain,distanceModel:m.distanceModel,maxDistance:m.maxDistance,panningModel:m.panningModel,refDistance:m.refDistance,rolloffFactor:m.rolloffFactor},w=se(m,_);if("bufferSize"in m)f=s(_,{...v,gain:1});else if(!w){const g={...b,orientationX:m.orientationX.value,orientationY:m.orientationY.value,orientationZ:m.orientationZ.value,positionX:m.positionX.value,positionY:m.positionY.value,positionZ:m.positionZ.value};m=n(_,g)}if(u.set(_,f===null?m:f),f!==null){if(h===null){if(o===null)throw new Error("Missing the native OfflineAudioContext constructor.");const I=new o(6,p.context.length,_.sampleRate),M=t(I,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"speakers",numberOfInputs:6});M.connect(I.destination),h=(async()=>{const V=await Promise.all([p.orientationX,p.orientationY,p.orientationZ,p.positionX,p.positionY,p.positionZ].map(async(W,G)=>{const Y=e(I,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",offset:G===0?1:0});return await a(I,W,Y.offset),Y}));for(let W=0;W<6;W+=1)V[W].connect(M,0,W),V[W].start(0);return l(I)})()}const g=await h,y=s(_,{...v,gain:1});await c(p,_,y);const k=[];for(let I=0;IW!==T[G])||V.some((W,G)=>W!==x[G])){T=M,x=V;const W=I/_.sampleRate;C.gain.setValueAtTime(0,W),C=s(_,{...v,gain:0}),O=n(_,{...b,orientationX:T[0],orientationY:T[1],orientationZ:T[2],positionX:x[0],positionY:x[1],positionZ:x[2]}),C.gain.setValueAtTime(1,W),y.connect(C).connect(O.inputs[0]),O.connect(f)}}return f}return w?(await i(_,p.orientationX,m.orientationX),await i(_,p.orientationY,m.orientationY),await i(_,p.orientationZ,m.orientationZ),await i(_,p.positionX,m.positionX),await i(_,p.positionY,m.positionY),await i(_,p.positionZ,m.positionZ)):(await a(_,p.orientationX,m.orientationX),await a(_,p.orientationY,m.orientationY),await a(_,p.orientationZ,m.orientationZ),await a(_,p.positionX,m.positionX),await a(_,p.positionY,m.positionY),await a(_,p.positionZ,m.positionZ)),Zn(m)?await c(p,_,m.inputs[0]):await c(p,_,m),m};return{render(p,_){const f=u.get(_);return f!==void 0?Promise.resolve(f):d(p,_)}}},E_={disableNormalization:!1},O_=(i,t,e,s)=>class Eu{constructor(r,o){const a=t(r),c=s({...E_,...o}),l=i(a,c);return e.add(l),l}static[Symbol.hasInstance](r){return r!==null&&typeof r=="object"&&Object.getPrototypeOf(r)===Eu.prototype||e.has(r)}},A_=(i,t)=>(e,s,n)=>(i(s).replay(n),t(s,e,n)),M_=(i,t,e)=>async(s,n,r)=>{const o=i(s);await Promise.all(o.activeInputs.map((a,c)=>Array.from(a).map(async([l,u])=>{const d=await t(l).render(l,n),p=s.context.destination;!e(l)&&(s!==p||!e(s))&&d.connect(r,u,c)})).reduce((a,c)=>[...a,...c],[]))},D_=(i,t,e)=>async(s,n,r)=>{const o=t(s);await Promise.all(Array.from(o.activeInputs).map(async([a,c])=>{const u=await i(a).render(a,n);e(a)||u.connect(r,c)}))},P_=(i,t,e,s)=>n=>i(Oi,()=>Oi(n))?Promise.resolve(i(s,s)).then(r=>{if(!r){const o=e(n,512,0,1);n.oncomplete=()=>{o.onaudioprocess=null,o.disconnect()},o.onaudioprocess=()=>n.currentTime,o.connect(n.destination)}return n.startRendering()}):new Promise(r=>{const o=t(n,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});n.oncomplete=a=>{o.disconnect(),r(a.renderedBuffer)},o.connect(n.destination),n.startRendering()}),I_=i=>(t,e)=>{i.set(t,e)},N_=i=>(t,e)=>i.set(t,e),R_=(i,t,e,s,n,r,o,a)=>(c,l)=>e(c).render(c,l).then(()=>Promise.all(Array.from(s(l)).map(u=>e(u).render(u,l)))).then(()=>n(l)).then(u=>(typeof u.copyFromChannel!="function"?(o(u),Ua(u)):t(r,()=>r(u))||a(u),i.add(u),u)),F_={channelCount:2,channelCountMode:"explicit",channelInterpretation:"speakers",pan:0},L_=(i,t,e,s,n,r)=>class extends i{constructor(a,c){const l=n(a),u={...F_,...c},h=e(l,u),d=r(l),p=d?s():null;super(a,!1,h,p),this._pan=t(this,d,h.pan)}get pan(){return this._pan}},V_=(i,t,e,s,n)=>()=>{const r=new WeakMap,o=async(a,c)=>{let l=e(a);const u=se(l,c);if(!u){const h={channelCount:l.channelCount,channelCountMode:l.channelCountMode,channelInterpretation:l.channelInterpretation,pan:l.pan.value};l=t(c,h)}return r.set(c,l),u?await i(c,a.pan,l.pan):await s(c,a.pan,l.pan),Zn(l)?await n(a,c,l.inputs[0]):await n(a,c,l),l};return{render(a,c){const l=r.get(c);return l!==void 0?Promise.resolve(l):o(a,c)}}},U_=i=>()=>{if(i===null)return!1;try{new i({length:1,sampleRate:44100})}catch{return!1}return!0},z_=(i,t)=>async()=>{if(i===null)return!0;if(t===null)return!1;const e=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 t(1,128,44100),n=URL.createObjectURL(e);let r=!1,o=!1;try{await s.audioWorklet.addModule(n);const a=new i(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(n)}return r&&!o},j_=(i,t)=>()=>{if(t===null)return Promise.resolve(!1);const e=new t(1,1,44100),s=i(e,{channelCount:1,channelCountMode:"explicit",channelInterpretation:"discrete",gain:0});return new Promise(n=>{e.oncomplete=()=>{s.disconnect(),n(e.currentTime!==0)},e.startRendering()})},B_=()=>new DOMException("","UnknownError"),q_={channelCount:2,channelCountMode:"max",channelInterpretation:"speakers",curve:null,oversample:"none"},W_=(i,t,e,s,n,r,o)=>class extends i{constructor(c,l){const u=n(c),h={...q_,...l},d=e(u,h),_=r(u)?s():null;super(c,!0,d,_),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 t();this._isCurveNullified=!1,this._nativeWaveShaperNode.curve=c}}get oversample(){return this._nativeWaveShaperNode.oversample}set oversample(c){this._nativeWaveShaperNode.oversample=c}},H_=(i,t,e)=>()=>{const s=new WeakMap,n=async(r,o)=>{let a=t(r);if(!se(a,o)){const l={channelCount:a.channelCount,channelCountMode:a.channelCountMode,channelInterpretation:a.channelInterpretation,curve:a.curve,oversample:a.oversample};a=i(o,l)}return s.set(o,a),Zn(a)?await e(r,o,a.inputs[0]):await e(r,o,a),a};return{render(r,o){const a=s.get(o);return a!==void 0?Promise.resolve(a):n(r,o)}}},Y_=()=>typeof window>"u"?null:window,G_=(i,t)=>e=>{e.copyFromChannel=(s,n,r=0)=>{const o=i(r),a=i(n);if(a>=e.numberOfChannels)throw t();const c=e.length,l=e.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+o{const o=i(r),a=i(n);if(a>=e.numberOfChannels)throw t();const c=e.length,l=e.getChannelData(a),u=s.length;for(let h=o<0?-o:0;h+ot=>{t.copyFromChannel=(e=>(s,n,r=0)=>{const o=i(r),a=i(n);if(o(s,n,r=0)=>{const o=i(r),a=i(n);if(o(t,e)=>{const s=e.createBuffer(1,1,44100);t.buffer===null&&(t.buffer=s),i(t,"buffer",n=>()=>{const r=n.call(t);return r===s?null:r},n=>r=>n.call(t,r===null?s:r))},X_=(i,t)=>(e,s)=>{s.channelCount=1,s.channelCountMode="explicit",Object.defineProperty(s,"channelCount",{get:()=>1,set:()=>{throw i()}}),Object.defineProperty(s,"channelCountMode",{get:()=>"explicit",set:()=>{throw i()}});const n=e.createBufferSource();t(s,()=>{const a=s.numberOfInputs;for(let c=0;cn.disconnect(s))},Ou=(i,t,e)=>i.copyFromChannel===void 0?i.getChannelData(e)[0]:(i.copyFromChannel(t,e),t[0]),Au=i=>{if(i===null)return!1;const t=i.length;return t%2!==0?i[Math.floor(t/2)]!==0:i[t/2-1]+i[t/2]!==0},cr=(i,t,e,s)=>{let n=i;for(;!n.hasOwnProperty(t);)n=Object.getPrototypeOf(n);const{get:r,set:o}=Object.getOwnPropertyDescriptor(n,t);Object.defineProperty(i,t,{get:e(r),set:s(o)})},Q_=i=>({...i,outputChannelCount:i.outputChannelCount!==void 0?i.outputChannelCount:i.numberOfInputs===1&&i.numberOfOutputs===1?[i.channelCount]:Array.from({length:i.numberOfOutputs},()=>1)}),K_=i=>({...i,channelCount:i.numberOfOutputs}),J_=i=>{const{imag:t,real:e}=i;return t===void 0?e===void 0?{...i,imag:[0,0],real:[0,0]}:{...i,imag:Array.from(e,()=>0),real:e}:e===void 0?{...i,imag:t,real:Array.from(t,()=>0)}:{...i,imag:t,real:e}},Mu=(i,t,e)=>{try{i.setValueAtTime(t,e)}catch(s){if(s.code!==9)throw s;Mu(i,t,e+1e-7)}},tg=i=>{const t=i.createBufferSource();t.start();try{t.start()}catch{return!0}return!1},eg=i=>{const t=i.createBufferSource(),e=i.createBuffer(1,1,44100);t.buffer=e;try{t.start(0,1)}catch{return!1}return!0},sg=i=>{const t=i.createBufferSource();t.start();try{t.stop()}catch{return!1}return!0},Wa=i=>{const t=i.createOscillator();try{t.start(-1)}catch(e){return e instanceof RangeError}return!1},Du=i=>{const t=i.createBuffer(1,1,44100),e=i.createBufferSource();e.buffer=t,e.start(),e.stop();try{return e.stop(),!0}catch{return!1}},Ha=i=>{const t=i.createOscillator();try{t.stop(-1)}catch(e){return e instanceof RangeError}return!1},ng=i=>{const{port1:t,port2:e}=new MessageChannel;try{t.postMessage(i)}finally{t.close(),e.close()}},ig=i=>{i.start=(t=>(e=0,s=0,n)=>{const r=i.buffer,o=r===null?s:Math.min(r.duration,s);r!==null&&o>r.duration-.5/i.context.sampleRate?t.call(i,e,0,0):t.call(i,e,o,n)})(i.start)},Pu=(i,t)=>{const e=t.createGain();i.connect(e);const s=(n=>()=>{n.call(i,e),i.removeEventListener("ended",s)})(i.disconnect);i.addEventListener("ended",s),Xn(i,e),i.stop=(n=>{let r=!1;return(o=0)=>{if(r)try{n.call(i,o)}catch{e.gain.setValueAtTime(0,o)}else n.call(i,o),r=!0}})(i.stop)},Qn=(i,t)=>e=>{const s={value:i};return Object.defineProperties(e,{currentTarget:s,target:s}),typeof t=="function"?t.call(i,e):t.handleEvent.call(i,e)},rg=C0(dn),og=D0(dn),ag=qp(go),Iu=new WeakMap,cg=am(Iu),qe=vp(new Map,new WeakMap),Ke=Y_(),Nu=Lm(qe,es),Ya=om(re),Qt=M_(re,Ya,rn),lg=F0(Nu,Dt,Qt),At=um(_o),ys=u_(Ke),wt=Em(ys),Ru=new WeakMap,Fu=Jp(Qn),lr=jm(Ke),Ga=wm(lr),$a=bm(Ke),Lu=Cm(Ke),Ai=qm(Ke),Wt=ap(S0(uu),M0(rg,og,Ur,ag,zr,re,cg,sr,Dt,dn,hs,rn,Mr),qe,ym(ca,zr,re,Dt,Ei,hs),es,yo,oe,Up(Ur,ca,re,Dt,Ei,At,hs,wt),Yp(Ru,re,ze),Fu,At,Ga,$a,Lu,wt,Ai),ug=R0(Wt,lg,es,Nu,At,wt),Za=new WeakSet,yl=Vm(Ke),Vu=Pp(new Uint32Array(1)),Xa=G_(Vu,es),Qa=$_(Vu),Uu=V0(Za,qe,oe,yl,ys,U_(yl),Xa,Qa),vo=P0(me),zu=D_(Ya,ir,rn),ss=Sp(zu),Kn=zm(vo,qe,tg,eg,sg,Wa,Du,Ha,ig,Z_(cr),Pu),ns=A_(cm(ir),zu),hg=j0(ss,Kn,Dt,ns,Qt),We=cp(E0(hu),Ru,Va,lp,v0,x0,k0,T0,w0,ra,cu,lr,Mu),dg=z0(Wt,hg,We,Zt,Kn,At,wt,Qn),fg=X0(Wt,Q0,es,Zt,Bm(me,cr),At,wt,Qt),pg=yp(ss,Cu,Dt,ns,Qt),fn=N_(Iu),mg=gp(Wt,We,pg,yo,Cu,At,wt,fn),Us=Rm(dn,$a),_g=X_(Zt,Us),zs=Xm(lr,_g),gg=Tp(zs,Dt,Qt),yg=kp(Wt,gg,zs,At,wt),vg=Cp(or,Dt,Qt),xg=bp(Wt,vg,or,At,wt,K_),kg=Jm(vo,Kn,me,Us),Jn=Km(vo,qe,kg,Wa,Ha),Tg=Dp(ss,Jn,Dt,ns,Qt),wg=Mp(Wt,We,Tg,Jn,At,wt,Qn),ju=t_(oe,cr),bg=Rp(ju,Dt,Qt),Cg=Np(Wt,bg,ju,At,wt,fn),Sg=Bp(ss,Su,Dt,ns,Qt),Eg=jp(Wt,We,Sg,Su,At,wt,fn),Bu=e_(oe),Og=Xp(ss,Bu,Dt,ns,Qt),Ag=Zp(Wt,We,Og,Bu,oe,At,wt,fn),Mg=im(ss,me,Dt,ns,Qt),Dg=nm(Wt,We,Mg,me,At,wt),Pg=r_(yo,Zt,ar,oe),xo=P_(qe,me,ar,j_(me,ys)),Ig=gm(Kn,Dt,ys,Qt,xo),Ng=s_(Pg),Rg=mm(Wt,Ng,Ig,At,wt,fn),Fg=K0(We,zs,Jn,ar,oe,Ou,wt,cr),qu=new WeakMap,Lg=Nm(fg,Fg,Fu,wt,qu,Qn),Wu=h_(vo,qe,Wa,Du,Ha,Pu),Vg=w_(ss,Wu,Dt,ns,Qt),Ug=T_(Wt,We,Wu,Vg,At,wt,Qn),Hu=Op(Kn),zg=y_(Hu,Zt,me,Au,Us),ko=g_(Hu,Zt,zg,Au,Us,lr,cr),jg=f_(Ur,Zt,zs,me,ar,ko,oe,zr,Ou,Us),Yu=d_(jg),Bg=S_(ss,zs,Jn,me,Yu,Dt,ys,ns,Qt,xo),qg=C_(Wt,We,Yu,Bg,At,wt,fn),Wg=p_(es),Hg=O_(Wg,At,new WeakSet,J_),Yg=__(zs,or,me,ko,oe,Us),Gu=m_(Yg,oe),Gg=V_(ss,Gu,Dt,ns,Qt),$g=L_(Wt,We,Gu,Gg,At,wt),Zg=H_(ko,Dt,Qt),Xg=W_(Wt,Zt,ko,Zg,At,wt,fn),$u=Om(Ke),Ka=tm(Ke),Zu=new WeakMap,Qg=hm(Zu,ys),Kg=$u?A0(qe,oe,Kp(Ke),Ka,em(b0),At,Qg,wt,Ai,new WeakMap,new WeakMap,z_(Ai,ys),Ke):void 0,Jg=Sm(Ga,wt),ty=Vp(Za,qe,Lp,Qp,new WeakSet,At,Jg,Lr,Oi,Xa,Qa),Xu=mp(Kg,ug,Uu,dg,mg,yg,xg,wg,Cg,ty,Eg,Ag,Dg,Rg,Lg,Ug,qg,Hg,$g,Xg),ey=Am(Wt,o_,At,wt),sy=Dm(Wt,a_,At,wt),ny=Pm(Wt,c_,At,wt),iy=l_(Zt,wt),ry=Im(Wt,iy,At),oy=Z0(Xu,Zt,oe,B_,ey,sy,ny,ry,lr),Ja=dm(qu),ay=I0(Ja),Qu=Ep(es),cy=Wp(Ja),Ku=Gp(es),Ju=new WeakMap,ly=rm(Ju,ze),uy=Zm(Qu,es,Zt,zs,or,Jn,me,ar,oe,Ku,Ka,ly,Us),hy=Hm(Zt,uy,me,oe,Us),dy=pp(ss,Qu,Kn,zs,or,Jn,me,cy,Ku,Ka,Dt,Ai,ys,ns,Qt,xo),fy=lm(Zu),py=I_(Ju),vl=$u?hp(ay,Wt,We,dy,hy,re,fy,At,wt,Ai,Q_,py,ng,Qn):void 0,my=Fp(oe,ys),_y=R_(Za,qe,Ya,Ja,xo,Lr,Xa,Qa),gy=x_(Xu,qe,Zt,my,_y),yy=vm(_o,Ga),vy=xm(La,$a),xy=km(Va,Lu),ky=Tm(_o,wt);function xe(i){return typeof i>"u"}function dt(i){return!xe(i)}function Ty(i){return typeof i=="function"}function Ds(i){return typeof i=="number"}function Ks(i){return Object.prototype.toString.call(i)==="[object Object]"&&i.constructor===Object}function wy(i){return typeof i=="boolean"}function Ue(i){return Array.isArray(i)}function ds(i){return typeof i=="string"}function br(i){return ds(i)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(i)}function ut(i,t){if(!i)throw new Error(t)}function je(i,t,e=1/0){if(!(t<=i&&i<=e))throw new RangeError(`Value must be within [${t}, ${e}], got: ${i}`)}function th(i){!i.isOffline&&i.state!=="running"&&tc('The AudioContext is "suspended". Invoke Tone.start() from a user action to start the audio.')}let eh=!1,xl=!1;function kl(i){eh=i}function by(i){xe(i)&&eh&&!xl&&(xl=!0,tc("Events scheduled inside of scheduled callbacks should use the passed in scheduling time. See https://github.com/Tonejs/Tone.js/wiki/Accurate-Timing"))}let sh=console;function Cy(...i){sh.log(...i)}function tc(...i){sh.warn(...i)}function Sy(i){return new oy(i)}function Ey(i,t,e){return new gy(i,t,e)}const Js=typeof self=="object"?self:null,Oy=Js&&(Js.hasOwnProperty("AudioContext")||Js.hasOwnProperty("webkitAudioContext"));function Ay(i,t,e){return ut(dt(vl),"This node only works in a secure context (https or localhost)"),new vl(i,t,e)}class My{constructor(t,e,s,n){this._callback=t,this._type=e,this._minimumUpdateInterval=Math.max(128/(n||44100),.001),this.updateInterval=s,this._createClock()}_createWorker(){const t=new Blob([` // the initial timeout time let timeoutTime = ${(this._updateInterval*1e3).toFixed(1)}; // onmessage callback @@ -145,12 +145,12 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a } // call tick initially tick(); - `],{type:"text/javascript"}),e=URL.createObjectURL(t),s=new Worker(e);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(t){var e;this._updateInterval=Math.max(t,this._minimumUpdateInterval),this._type==="worker"&&((e=this._worker)===null||e===void 0||e.postMessage(this._updateInterval*1e3))}get type(){return this._type}set type(t){this._disposeClock(),this._type=t,this._createClock()}dispose(){this._disposeClock()}}function an(i){return Py(i)}function As(i){return Dy(i)}function Fr(i){return Iy(i)}function En(i){return My(i)}function qy(i){return i instanceof Yu}function Wy(i,t){return i==="value"||an(t)||As(t)||qy(t)}function In(i,...t){if(!t.length)return i;const e=t.shift();if(Js(i)&&Js(e))for(const s in e)Wy(s,e[s])?i[s]=e[s]:Js(e[s])?(i[s]||Object.assign(i,{[s]:{}}),In(i[s],e[s])):Object.assign(i,{[s]:e[s]});return In(i,...t)}function Hy(i,t){return i.length===t.length&&i.every((e,s)=>t[s]===e)}function $(i,t,e=[],s){const n={},r=Array.from(t);if(Js(r[0])&&s&&!Reflect.has(r[0],s)&&(Object.keys(r[0]).some(a=>Reflect.has(i,a))||(In(n,{[s]:r[0]}),e.splice(e.indexOf(s),1),r.shift())),r.length===1&&Js(r[0]))In(n,r[0]);else for(let o=0;o{Reflect.has(i,e)&&delete i[e]}),i}/** + `],{type:"text/javascript"}),e=URL.createObjectURL(t),s=new Worker(e);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(t){var e;this._updateInterval=Math.max(t,this._minimumUpdateInterval),this._type==="worker"&&((e=this._worker)===null||e===void 0||e.postMessage(this._updateInterval*1e3))}get type(){return this._type}set type(t){this._disposeClock(),this._type=t,this._createClock()}dispose(){this._disposeClock()}}function on(i){return xy(i)}function Os(i){return vy(i)}function Dr(i){return ky(i)}function Sn(i){return yy(i)}function Dy(i){return i instanceof Uu}function Py(i,t){return i==="value"||on(t)||Os(t)||Dy(t)}function Pn(i,...t){if(!t.length)return i;const e=t.shift();if(Ks(i)&&Ks(e))for(const s in e)Py(s,e[s])?i[s]=e[s]:Ks(e[s])?(i[s]||Object.assign(i,{[s]:{}}),Pn(i[s],e[s])):Object.assign(i,{[s]:e[s]});return Pn(i,...t)}function Iy(i,t){return i.length===t.length&&i.every((e,s)=>t[s]===e)}function $(i,t,e=[],s){const n={},r=Array.from(t);if(Ks(r[0])&&s&&!Reflect.has(r[0],s)&&(Object.keys(r[0]).some(a=>Reflect.has(i,a))||(Pn(n,{[s]:r[0]}),e.splice(e.indexOf(s),1),r.shift())),r.length===1&&Ks(r[0]))Pn(n,r[0]);else for(let o=0;o{Reflect.has(i,e)&&delete i[e]}),i}/** * Tone.js * @author Yotam Mann * @license http://opensource.org/licenses/MIT MIT License * @copyright 2014-2019 Yotam Mann - */class xs{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...t){(this.debug||tn&&this.toString()===tn.TONE_DEBUG_CLASS)&&Ly(this,...t)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}xs.version=mu;const rc=1e-6;function jn(i,t){return i>t+rc}function ya(i,t){return jn(i,t)||Le(i,t)}function Zr(i,t){return i+rcthis.memory){const e=this.length-this.memory;this._timeline.splice(0,e)}return this}remove(t){const e=this._timeline.indexOf(t);return e!==-1&&this._timeline.splice(e,1),this}get(t,e="time"){const s=this._search(t,e);return s!==-1?this._timeline[s]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(t,e="time"){const s=this._search(t,e);return s+10&&this._timeline[e-1].time=0?this._timeline[s-1]:null}cancel(t){if(this._timeline.length>1){let e=this._search(t);if(e>=0)if(Le(this._timeline[e].time,t)){for(let s=e;s>=0&&Le(this._timeline[s].time,t);s--)e=s;this._timeline=this._timeline.slice(0,e)}else this._timeline=this._timeline.slice(0,e+1);else this._timeline=[]}else this._timeline.length===1&&ya(this._timeline[0].time,t)&&(this._timeline=[]);return this}cancelBefore(t){const e=this._search(t);return e>=0&&(this._timeline=this._timeline.slice(e+1)),this}previousEvent(t){const e=this._timeline.indexOf(t);return e>0?this._timeline[e-1]:null}_search(t,e="time"){if(this._timeline.length===0)return-1;let s=0;const n=this._timeline.length;let r=n;if(n>0&&this._timeline[n-1][e]<=t)return n-1;for(;s=0&&this._timeline[s].time>=t;)s--;return this._iterate(e,s+1),this}forEachAtTime(t,e){const s=this._search(t);if(s!==-1&&Le(this._timeline[s].time,t)){let n=s;for(let r=s;r>=0&&Le(this._timeline[r].time,t);r--)n=r;this._iterate(r=>{e(r)},n,s)}return this}dispose(){return super.dispose(),this._timeline=[],this}};const dh=[];function Eo(i){dh.push(i)}function $y(i){dh.forEach(t=>t(i))}const fh=[];function Oo(i){fh.push(i)}function Zy(i){fh.forEach(t=>t(i))}class fr extends xs{constructor(){super(...arguments),this.name="Emitter"}on(t,e){return t.split(/\W+/).forEach(n=>{ke(this._events)&&(this._events={}),this._events.hasOwnProperty(n)||(this._events[n]=[]),this._events[n].push(e)}),this}once(t,e){const s=(...n)=>{e(...n),this.off(t,s)};return this.on(t,s),this}off(t,e){return t.split(/\W+/).forEach(n=>{if(ke(this._events)&&(this._events={}),this._events.hasOwnProperty(n))if(ke(e))this._events[n]=[];else{const r=this._events[n];for(let o=r.length-1;o>=0;o--)r[o]===e&&r.splice(o,1)}}),this}emit(t,...e){if(this._events&&this._events.hasOwnProperty(t)){const s=this._events[t].slice(0);for(let n=0,r=s.length;n{const s=Object.getOwnPropertyDescriptor(fr.prototype,e);Object.defineProperty(t.prototype,e,s)})}dispose(){return super.dispose(),this._events=void 0,this}}class ph extends fr{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}let oc=class mh extends ph{constructor(){var t,e;super(),this.name="Context",this._constants=new Map,this._timeouts=new Ke,this._timeoutIds=0,this._initialized=!1,this._closeStarted=!1,this.isOffline=!1,this._workletPromise=null;const s=$(mh.getDefaults(),arguments,["context"]);s.context?(this._context=s.context,this._latencyHint=((t=arguments[0])===null||t===void 0?void 0:t.latencyHint)||""):(this._context=Vy({latencyHint:s.latencyHint}),this._latencyHint=s.latencyHint),this._ticker=new By(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[!((e=arguments[0])===null||e===void 0)&&e.hasOwnProperty("updateInterval")?"_lookAhead":"lookAhead"]=s.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){return this._initialized||($y(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(t,e,s){return this._context.createBuffer(t,e,s)}createChannelMerger(t){return this._context.createChannelMerger(t)}createChannelSplitter(t){return this._context.createChannelSplitter(t)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(t){return this._context.createDelay(t)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(t,e){return this._context.createIIRFilter(t,e)}createPanner(){return this._context.createPanner()}createPeriodicWave(t,e,s){return this._context.createPeriodicWave(t,e,s)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(t){return ut(En(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamSource(t)}createMediaElementSource(t){return ut(En(this._context),"Not available if OfflineAudioContext"),this._context.createMediaElementSource(t)}createMediaStreamDestination(){return ut(En(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamDestination()}decodeAudioData(t){return this._context.decodeAudioData(t)}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(t){ut(!this._initialized,"The listener cannot be set after initialization."),this._listener=t}get transport(){return this.initialize(),this._transport}set transport(t){ut(!this._initialized,"The transport cannot be set after initialization."),this._transport=t}get draw(){return this.initialize(),this._draw}set draw(t){ut(!this._initialized,"Draw cannot be set after initialization."),this._draw=t}get destination(){return this.initialize(),this._destination}set destination(t){ut(!this._initialized,"The destination cannot be set after initialization."),this._destination=t}createAudioWorkletNode(t,e){return zy(this.rawContext,t,e)}addAudioWorkletModule(t){return qt(this,void 0,void 0,function*(){ut(dt(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletPromise||(this._workletPromise=this.rawContext.audioWorklet.addModule(t)),yield this._workletPromise})}workletsAreReady(){return qt(this,void 0,void 0,function*(){(yield this._workletPromise)?this._workletPromise:Promise.resolve()})}get updateInterval(){return this._ticker.updateInterval}set updateInterval(t){this._ticker.updateInterval=t}get clockSource(){return this._ticker.type}set clockSource(t){this._ticker.type=t}get lookAhead(){return this._lookAhead}set lookAhead(t){this._lookAhead=t,this.updateInterval=t?t/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 En(this._context)?this._context.resume():Promise.resolve()}close(){return qt(this,void 0,void 0,function*(){En(this._context)&&this.state!=="closed"&&!this._closeStarted&&(this._closeStarted=!0,yield this._context.close()),this._initialized&&Zy(this)})}getConstant(t){if(this._constants.has(t))return this._constants.get(t);{const e=this._context.createBuffer(1,128,this._context.sampleRate),s=e.getChannelData(0);for(let r=0;rthis._constants[t].disconnect()),this.close(),this}_timeoutLoop(){const t=this.now();let e=this._timeouts.peek();for(;this._timeouts.length&&e&&e.time<=t;)e.callback(),this._timeouts.shift(),e=this._timeouts.peek()}setTimeout(t,e){this._timeoutIds++;const s=this.now();return this._timeouts.add({callback:t,id:this._timeoutIds,time:s+e}),this._timeoutIds}clearTimeout(t){return this._timeouts.forEach(e=>{e.id===t&&this._timeouts.remove(e)}),this}clearInterval(t){return this.clearTimeout(t)}setInterval(t,e){const s=++this._timeoutIds,n=()=>{const r=this.now();this._timeouts.add({callback:()=>{t(),n()},id:s,time:r+e})};return n(),s}};class Xy extends ph{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(t,e,s){return{}}createChannelMerger(t){return{}}createChannelSplitter(t){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(t){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(t,e){return{}}createPanner(){return{}}createPeriodicWave(t,e,s){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(t){return{}}createMediaElementSource(t){return{}}createMediaStreamDestination(){return{}}decodeAudioData(t){return Promise.resolve({})}createAudioWorkletNode(t,e){return{}}get rawContext(){return{}}addAudioWorkletModule(t){return qt(this,void 0,void 0,function*(){return Promise.resolve()})}resume(){return Promise.resolve()}setTimeout(t,e){return 0}clearTimeout(t){return this}setInterval(t,e){return 0}clearInterval(t){return this}getConstant(t){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(t){}get destination(){return{}}set destination(t){}now(){return 0}immediate(){return 0}}function Mt(i,t){je(t)?t.forEach(e=>Mt(i,e)):Object.defineProperty(i,t,{enumerable:!0,writable:!1})}function ac(i,t){je(t)?t.forEach(e=>ac(i,e)):Object.defineProperty(i,t,{writable:!0})}const yt=()=>{};class xt extends xs{constructor(){super(),this.name="ToneAudioBuffer",this.onload=yt;const t=$(xt.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=t.reverse,this.onload=t.onload,fs(t.url)?this.load(t.url).catch(t.onerror):t.url&&this.set(t.url)}static getDefaults(){return{onerror:yt,onload:yt,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:Ve().sampleRate}set(t){return t instanceof xt?t.loaded?this._buffer=t.get():t.onload=()=>{this.set(t),this.onload(this)}:this._buffer=t,this._reversed&&this._reverse(),this}get(){return this._buffer}load(t){return qt(this,void 0,void 0,function*(){const e=xt.load(t).then(s=>{this.set(s),this.onload(this)});xt.downloads.push(e);try{yield e}finally{const s=xt.downloads.indexOf(e);xt.downloads.splice(s,1)}return this})}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(t){const e=je(t)&&t[0].length>0,s=e?t.length:1,n=e?t[0].length:t.length,r=Ve(),o=r.createBuffer(s,n,r.sampleRate),a=!e&&s===1?[t]:t;for(let c=0;cn/s),this.fromArray(e)}return this}toArray(t){if(Ps(t))return this.getChannelData(t);if(this.numberOfChannels===1)return this.toArray(0);{const e=[];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(t){this._reversed!==t&&(this._reversed=t,this._reverse())}static fromArray(t){return new xt().fromArray(t)}static fromUrl(t){return qt(this,void 0,void 0,function*(){return yield new xt().load(t)})}static load(t){return qt(this,void 0,void 0,function*(){const e=t.match(/\[([^\]\[]+\|.+)\]$/);if(e){const c=e[1].split("|");let l=c[0];for(const u of c)if(xt.supportsType(u)){l=u;break}t=t.replace(e[0],l)}const s=xt.baseUrl===""||xt.baseUrl.endsWith("/")?xt.baseUrl:xt.baseUrl+"/",n=document.createElement("a");n.href=s+t,n.pathname=(n.pathname+n.hash).split("/").map(encodeURIComponent).join("/");const r=yield fetch(n.href);if(!r.ok)throw new Error(`could not load url: ${t}`);const o=yield r.arrayBuffer();return yield Ve().decodeAudioData(o)})}static supportsType(t){const e=t.split("."),s=e[e.length-1];return document.createElement("audio").canPlayType("audio/"+s)!==""}static loaded(){return qt(this,void 0,void 0,function*(){for(yield Promise.resolve();xt.downloads.length;)yield xt.downloads[0]})}}xt.baseUrl="";xt.downloads=[];class Ao extends oc{constructor(){super({clockSource:"offline",context:Fr(arguments[0])?arguments[0]:Uy(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:Fr(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=Fr(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(t){return qt(this,void 0,void 0,function*(){let e=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,e++;const s=Math.floor(this.sampleRate/128);t&&e%s===0&&(yield new Promise(n=>setTimeout(n,1)))}})}render(t=!0){return qt(this,void 0,void 0,function*(){yield this.workletsAreReady(),yield this._renderClock(t);const e=yield this._context.startRendering();return new xt(e)})}close(){return Promise.resolve()}}const _h=new Xy;let Xs=_h;function Ve(){return Xs===_h&&jy&&Qy(new oc),Xs}function Qy(i,t=!1){t&&Xs.dispose(),En(i)?Xs=new oc(i):Fr(i)?Xs=new Ao(i):Xs=i}function Ky(){return Xs.resume()}if(tn&&!tn.TONE_SILENCE_LOGGING){const t=` * Tone.js v${mu} * `;console.log(`%c${t}`,"background: #000; color: #fff")}function Jy(i){return Math.pow(10,i/20)}function t1(i){return 20*(Math.log(i)/Math.LN10)}function gh(i){return Math.pow(2,i/12)}let Mo=440;function e1(){return Mo}function s1(i){Mo=i}function va(i){return Math.round(yh(i))}function yh(i){return 69+12*Math.log2(i/Mo)}function n1(i){return Mo*Math.pow(2,(i-69)/12)}class cc extends xs{constructor(t,e,s){super(),this.defaultUnits="s",this._val=e,this._units=s,this.context=t,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:t=>this._frequencyToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:t=>this._ticksToUnits(parseInt(t,10)),regexp:/^(\d+)i$/i},m:{method:t=>this._beatsToUnits(parseInt(t,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(t,e)=>{const s=parseInt(t,10),n=e==="."?1.5:1;return s===1?this._beatsToUnits(this._getTimeSignature())*n:this._beatsToUnits(4/s)*n},regexp:/^(\d+)n(\.?)$/i},number:{method:t=>this._expressions[this.defaultUnits].method.call(this,t),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:t=>this._secondsToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:t=>parseInt(t,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:t=>{const e=parseInt(t,10);return this._beatsToUnits(8/(Math.floor(e)*3))},regexp:/^(\d+)t$/i},tr:{method:(t,e,s)=>{let n=0;return t&&t!=="0"&&(n+=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&e!=="0"&&(n+=this._beatsToUnits(parseFloat(e))),s&&s!=="0"&&(n+=this._beatsToUnits(parseFloat(s)/4)),n},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof cc&&this.fromType(this._val),ke(this._val))return this._noArg();if(fs(this._val)&&ke(this._units)){for(const t in this._expressions)if(this._expressions[t].regexp.test(this._val.trim())){this._units=t;break}}else if(Js(this._val)){let t=0;for(const e in this._val)if(dt(this._val[e])){const s=this._val[e],n=new this.constructor(this.context,e).valueOf()*s;t+=n}return t}if(dt(this._units)){const t=this._expressions[this._units],e=this._val.toString().trim().match(t.regexp);return e?t.method.apply(this,e.slice(1)):t.method.call(this,this._val)}else return fs(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(t){return 1/t}_beatsToUnits(t){return 60/this._getBpm()*t}_secondsToUnits(t){return t}_ticksToUnits(t){return t*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(t){switch(this._units=void 0,this.defaultUnits){case"s":this._val=t.toSeconds();break;case"i":this._val=t.toTicks();break;case"hz":this._val=t.toFrequency();break;case"midi":this._val=t.toMidi();break}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return this.toSeconds()*1e3}}class Ue extends cc{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:t=>this._now()+new this.constructor(this.context,t).valueOf(),regexp:/^\+(.+)/},quantize:{method:t=>{const e=new Ue(this.context,t).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(e))},regexp:/^@(.+)/}})}quantize(t,e=1){const s=new this.constructor(this.context,t).valueOf(),n=this.valueOf(),a=Math.round(n/s)*s-n;return n+a*e}toNotation(){const t=this.toSeconds(),e=["1m"];for(let r=1;r<9;r++){const o=Math.pow(2,r);e.push(o+"n."),e.push(o+"n"),e.push(o+"t")}e.push("0");let s=e[0],n=new Ue(this.context,e[0]).toSeconds();return e.forEach(r=>{const o=new Ue(this.context,r).toSeconds();Math.abs(o-t)3&&(n=parseFloat(parseFloat(r).toFixed(3))),[s,e,n].join(":")}toTicks(){const t=this._beatsToUnits(1);return this.valueOf()/t*this._getPPQ()}toSeconds(){return this.valueOf()}toMidi(){return va(this.toFrequency())}_now(){return this.context.now()}}class Ae extends Ue{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return e1()}static set A4(t){s1(t)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(t){return this.defaultUnits==="midi"?t:Ae.mtof(t)}},note:{regexp:/^([a-g]{1}(?:b|#|##|x|bb|###|#x|x#|bbb)?)(-?[0-9]+)/i,method(t,e){const n=i1[t.toLowerCase()]+(parseInt(e,10)+1)*12;return this.defaultUnits==="midi"?n:Ae.mtof(n)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(t,e,s){let n=1;return t&&t!=="0"&&(n*=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&e!=="0"&&(n*=this._beatsToUnits(parseFloat(e))),s&&s!=="0"&&(n*=this._beatsToUnits(parseFloat(s)/4)),n}}})}transpose(t){return new Ae(this.context,this.valueOf()*gh(t))}harmonize(t){return t.map(e=>this.transpose(e))}toMidi(){return va(this.valueOf())}toNote(){const t=this.toFrequency(),e=Math.log2(t/Ae.A4);let s=Math.round(12*e)+57;const n=Math.floor(s/12);return n<0&&(s+=-12*n),r1[s%12]+n.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.floor(e*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(t){return t}_ticksToUnits(t){return 1/(t*60/(this._getBpm()*this._getPPQ()))}_beatsToUnits(t){return 1/super._beatsToUnits(t)}_secondsToUnits(t){return 1/t}static mtof(t){return n1(t)}static ftom(t){return va(t)}}const i1={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},r1=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];class Ci extends Ue{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}class ue extends xs{constructor(){super();const t=$(ue.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=t.context}static getDefaults(){return{context:Ve()}}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(t){return Fy(t),new Ue(this.context,t).toSeconds()}toFrequency(t){return new Ae(this.context,t).toFrequency()}toTicks(t){return new Ci(this.context,t).toTicks()}_getPartialProperties(t){const e=this.get();return Object.keys(e).forEach(s=>{ke(t[s])&&delete e[s]}),e}get(){const t=Gy(this);return Object.keys(t).forEach(e=>{if(Reflect.has(this,e)){const s=this[e];dt(s)&&dt(s.value)&&dt(s.setValueAtTime)?t[e]=s.value:s instanceof ue?t[e]=s._getPartialProperties(t[e]):je(s)||Ps(s)||fs(s)||Ry(s)?t[e]=s:delete t[e]}}),t}set(t){return Object.keys(t).forEach(e=>{Reflect.has(this,e)&&dt(this[e])&&(this[e]&&dt(this[e].value)&&dt(this[e].setValueAtTime)?this[e].value!==t[e]&&(this[e].value=t[e]):this[e]instanceof ue?this[e].set(t[e]):this[e]=t[e])}),this}}class lc extends Ke{constructor(t="stopped"){super(),this.name="StateTimeline",this._initial=t,this.setStateAtTime(this._initial,0)}getValueAtTime(t){const e=this.get(t);return e!==null?e.state:this._initial}setStateAtTime(t,e,s){return Be(e,0),this.add(Object.assign({},s,{state:t,time:e})),this}getLastState(t,e){const s=this._search(e);for(let n=s;n>=0;n--){const r=this._timeline[n];if(r.state===t)return r}}getNextState(t,e){const s=this._search(e);if(s!==-1)for(let n=s;n0,"timeConstant must be a number greater than 0");const r=this.toSeconds(e);return this._assertRange(n),ut(isFinite(n)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(t)}, ${JSON.stringify(e)}`),this._events.add({constant:s,time:r,type:"setTargetAtTime",value:n}),this.log(this.units,"setTargetAtTime",t,r,s),this._param.setTargetAtTime(n,r,s),this}setValueCurveAtTime(t,e,s,n=1){s=this.toSeconds(s),e=this.toSeconds(e);const r=this._fromType(t[0])*n;this.setValueAtTime(this._toType(r),e);const o=s/(t.length-1);for(let a=1;a{n.type==="cancelScheduledValues"?t.cancelScheduledValues(n.time):n.type==="setTargetAtTime"?t.setTargetAtTime(n.value,n.time,n.constant):t[n.type](n.value,n.time)}),this}setParam(t){ut(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const e=this.input;return e.disconnect(this._param),this.apply(t),this._param=t,e.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(t,e,s,n,r){return s+(e-s)*Math.exp(-(r-t)/n)}_linearInterpolate(t,e,s,n,r){return e+(n-e)*((r-t)/(s-t))}_exponentialInterpolate(t,e,s,n,r){return e*Math.pow(n/e,(r-t)/(s-t))}}class ot extends ue{constructor(){super(...arguments),this._internalChannels=[]}get numberOfInputs(){return dt(this.input)?an(this.input)||this.input instanceof kt?1:this.input.numberOfInputs:0}get numberOfOutputs(){return dt(this.output)?this.output.numberOfOutputs:0}_isAudioNode(t){return dt(t)&&(t instanceof ot||As(t))}_getInternalNodes(){const t=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&t.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&t.push(this.output),t}_setChannelProperties(t){this._getInternalNodes().forEach(s=>{s.channelCount=t.channelCount,s.channelCountMode=t.channelCountMode,s.channelInterpretation=t.channelInterpretation})}_getChannelProperties(){const t=this._getInternalNodes();ut(t.length>0,"ToneAudioNode does not have any internal nodes");const e=t[0];return{channelCount:e.channelCount,channelCountMode:e.channelCountMode,channelInterpretation:e.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCount:t}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCountMode:t}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelInterpretation:t}))}connect(t,e=0,s=0){return Is(this,t,e,s),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return ic("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(t,e=0,s=0){return o1(this,t,e,s),this}chain(...t){return Pi(this,...t),this}fan(...t){return t.forEach(e=>this.connect(e)),this}dispose(){return super.dispose(),dt(this.input)&&(this.input instanceof ot?this.input.dispose():As(this.input)&&this.input.disconnect()),dt(this.output)&&(this.output instanceof ot?this.output.dispose():As(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function Pi(...i){const t=i.shift();i.reduce((e,s)=>(e instanceof ot?e.connect(s):As(e)&&Is(e,s),s),t)}function Is(i,t,e=0,s=0){for(ut(dt(i),"Cannot connect from undefined node"),ut(dt(t),"Cannot connect to undefined node"),(t instanceof ot||As(t))&&ut(t.numberOfInputs>0,"Cannot connect to node with no inputs"),ut(i.numberOfOutputs>0,"Cannot connect from node with no outputs");t instanceof ot||t instanceof kt;)dt(t.input)&&(t=t.input);for(;i instanceof ot;)dt(i.output)&&(i=i.output);an(t)?i.connect(t,e):i.connect(t,e,s)}function o1(i,t,e=0,s=0){if(dt(t))for(;t instanceof ot;)t=t.input;for(;!As(i);)dt(i.output)&&(i=i.output);an(t)?i.disconnect(t,e):As(t)?i.disconnect(t,e,s):i.disconnect()}class St extends ot{constructor(){super($(St.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const t=$(St.getDefaults(),arguments,["gain","units"]);this.gain=new kt({context:this.context,convert:t.convert,param:this._gainNode.gain,units:t.units,value:t.gain,minValue:t.minValue,maxValue:t.maxValue}),Mt(this,"gain")}static getDefaults(){return Object.assign(ot.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class zn extends ot{constructor(t){super(t),this.onended=yt,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new St({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(e){const s=this.toSeconds(e);return this._startTime!==-1&&s>=this._startTime&&(this._stopTime===-1||s<=this._stopTime)?"started":"stopped"},this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut,this._curve=t.curve,this.onended=t.onended}static getDefaults(){return Object.assign(ot.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:yt})}_startGain(t,e=1){ut(this._startTime===-1,"Source cannot be started more than once");const s=this.toSeconds(this._fadeIn);return this._startTime=t+s,this._startTime=Math.max(this._startTime,this.context.currentTime),s>0?(this._gainNode.gain.setValueAtTime(0,t),this._curve==="linear"?this._gainNode.gain.linearRampToValueAtTime(e,t+s):this._gainNode.gain.exponentialApproachValueAtTime(e,t,s)):this._gainNode.gain.setValueAtTime(e,t),this}stop(t){return this.log("stop",t),this._stopGain(this.toSeconds(t)),this}_stopGain(t){ut(this._startTime!==-1,"'start' must be called before 'stop'"),this.cancelStop();const e=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(t)+e,this._stopTime=Math.max(this._stopTime,this.now()),e>0?this._curve==="linear"?this._gainNode.gain.linearRampTo(0,e,t):this._gainNode.gain.targetRampTo(0,e,t):(this._gainNode.gain.cancelAndHoldAtTime(t),this._gainNode.gain.setValueAtTime(0,t)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(()=>{const s=this._curve==="exponential"?e*2:0;this._stopSource(this.now()+s),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==yt&&(this.onended(this),this.onended=yt,!this.context.isOffline)){const t=()=>this.dispose();typeof window.requestIdleCallback<"u"?window.requestIdleCallback(t):setTimeout(t,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),ut(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=yt,this}}class Xr extends zn{constructor(){super($(Xr.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const t=$(Xr.getDefaults(),arguments,["offset"]);Is(this._source,this._gainNode),this.offset=new kt({context:this.context,convert:t.convert,param:this._source.offset,units:t.units,value:t.offset,minValue:t.minValue,maxValue:t.maxValue})}static getDefaults(){return Object.assign(zn.getDefaults(),{convert:!0,offset:1,units:"number"})}start(t){const e=this.toSeconds(t);return this.log("start",e),this._startGain(e),this._source.start(e),this}_stopSource(t){this._source.stop(t)}dispose(){return super.dispose(),this.state==="started"&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class Ot extends ot{constructor(){super($(Ot.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const t=$(Ot.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new Xr({context:this.context,convert:t.convert,offset:t.value,units:t.units,minValue:t.minValue,maxValue:t.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(ot.getDefaults(),{convert:!0,units:"number",value:0})}connect(t,e=0,s=0){return uc(this,t,e,s),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(t,e){return this._param.setValueAtTime(t,e),this}getValueAtTime(t){return this._param.getValueAtTime(t)}setRampPoint(t){return this._param.setRampPoint(t),this}linearRampToValueAtTime(t,e){return this._param.linearRampToValueAtTime(t,e),this}exponentialRampToValueAtTime(t,e){return this._param.exponentialRampToValueAtTime(t,e),this}exponentialRampTo(t,e,s){return this._param.exponentialRampTo(t,e,s),this}linearRampTo(t,e,s){return this._param.linearRampTo(t,e,s),this}targetRampTo(t,e,s){return this._param.targetRampTo(t,e,s),this}exponentialApproachValueAtTime(t,e,s){return this._param.exponentialApproachValueAtTime(t,e,s),this}setTargetAtTime(t,e,s){return this._param.setTargetAtTime(t,e,s),this}setValueCurveAtTime(t,e,s,n){return this._param.setValueCurveAtTime(t,e,s,n),this}cancelScheduledValues(t){return this._param.cancelScheduledValues(t),this}cancelAndHoldAtTime(t){return this._param.cancelAndHoldAtTime(t),this}rampTo(t,e,s){return this._param.rampTo(t,e,s),this}get value(){return this._param.value}set value(t){this._param.value=t}get convert(){return this._param.convert}set convert(t){this._param.convert=t}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(t){this._param.overridden=t}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(t){return this._param.apply(t),this}}function uc(i,t,e,s){(t instanceof kt||an(t)||t instanceof Ot&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof Ot&&(t.overridden=!0)),Is(i,t,e,s)}class Qr extends kt{constructor(){super($(Qr.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Ke(1/0),this._multiplier=1;const t=$(Qr.getDefaults(),arguments,["value"]);this._multiplier=t.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(t.value)}),this.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(kt.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(t,e,s){e=this.toSeconds(e),this.setRampPoint(e);const n=this._fromType(t),r=this._events.get(e),o=Math.round(Math.max(1/s,1));for(let a=0;a<=o;a++){const c=s*a+e,l=this._exponentialApproach(r.time,r.value,n,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}setValueAtTime(t,e){const s=this.toSeconds(e);super.setValueAtTime(t,e);const n=this._events.get(s),r=this._events.previousEvent(n),o=this._getTicksUntilEvent(r,s);return n.ticks=Math.max(o,0),this}linearRampToValueAtTime(t,e){const s=this.toSeconds(e);super.linearRampToValueAtTime(t,e);const n=this._events.get(s),r=this._events.previousEvent(n),o=this._getTicksUntilEvent(r,s);return n.ticks=Math.max(o,0),this}exponentialRampToValueAtTime(t,e){e=this.toSeconds(e);const s=this._fromType(t),n=this._events.get(e),r=Math.round(Math.max((e-n.time)*10,1)),o=(e-n.time)/r;for(let a=0;a<=r;a++){const c=o*a+n.time,l=this._exponentialInterpolate(n.time,n.value,e,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}_getTicksUntilEvent(t,e){if(t===null)t={ticks:0,time:0,type:"setValueAtTime",value:0};else if(ke(t.ticks)){const o=this._events.previousEvent(t);t.ticks=this._getTicksUntilEvent(o,t.time)}const s=this._fromType(this.getValueAtTime(t.time));let n=this._fromType(this.getValueAtTime(e));const r=this._events.get(e);return r&&r.time===e&&r.type==="setValueAtTime"&&(n=this._fromType(this.getValueAtTime(e-this.sampleTime))),.5*(e-t.time)*(s+n)+t.ticks}getTicksAtTime(t){const e=this.toSeconds(t),s=this._events.get(e);return Math.max(this._getTicksUntilEvent(s,e),0)}getDurationOfTicks(t,e){const s=this.toSeconds(e),n=this.getTicksAtTime(e);return this.getTimeOfTick(n+t)-s}getTimeOfTick(t){const e=this._events.get(t,"ticks"),s=this._events.getAfter(t,"ticks");if(e&&e.ticks===t)return e.time;if(e&&s&&s.type==="linearRampToValueAtTime"&&e.value!==s.value){const n=this._fromType(this.getValueAtTime(e.time)),o=(this._fromType(this.getValueAtTime(s.time))-n)/(s.time-e.time),a=Math.sqrt(Math.pow(n,2)-2*o*(e.ticks-t)),c=(-n+a)/o,l=(-n-a)/o;return(c>0?c:l)+e.time}else return e?e.value===0?1/0:e.time+(t-e.ticks)/e.value:t/this._initialValue}ticksToTime(t,e){return this.getDurationOfTicks(t,e)}timeToTicks(t,e){const s=this.toSeconds(e),n=this.toSeconds(t),r=this.getTicksAtTime(s);return this.getTicksAtTime(s+n)-r}_fromType(t){return this.units==="bpm"&&this.multiplier?1/(60/t/this.multiplier):super._fromType(t)}_toType(t){return this.units==="bpm"&&this.multiplier?t/this.multiplier*60:super._toType(t)}get multiplier(){return this._multiplier}set multiplier(t){const e=this.value;this._multiplier=t,this.cancelScheduledValues(0),this.setValueAtTime(e,0)}}class Kr extends Ot{constructor(){super($(Kr.getDefaults(),arguments,["value"])),this.name="TickSignal";const t=$(Kr.getDefaults(),arguments,["value"]);this.input=this._param=new Qr({context:this.context,convert:t.convert,multiplier:t.multiplier,param:this._constantSource.offset,units:t.units,value:t.value})}static getDefaults(){return Object.assign(Ot.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(t,e){return this._param.ticksToTime(t,e)}timeToTicks(t,e){return this._param.timeToTicks(t,e)}getTimeOfTick(t){return this._param.getTimeOfTick(t)}getDurationOfTicks(t,e){return this._param.getDurationOfTicks(t,e)}getTicksAtTime(t){return this._param.getTicksAtTime(t)}get multiplier(){return this._param.multiplier}set multiplier(t){this._param.multiplier=t}dispose(){return super.dispose(),this._param.dispose(),this}}class Jr extends ue{constructor(){super($(Jr.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new lc,this._tickOffset=new Ke,this._ticksAtTime=new Ke,this._secondsAtTime=new Ke;const t=$(Jr.getDefaults(),arguments,["frequency"]);this.frequency=new Kr({context:this.context,units:t.units,value:t.frequency}),Mt(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},ue.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(t,e){const s=this.toSeconds(t);return this._state.getValueAtTime(s)!=="started"&&(this._state.setStateAtTime("started",s),dt(e)&&this.setTicksAtTime(e,s),this._ticksAtTime.cancel(s),this._secondsAtTime.cancel(s)),this}stop(t){const e=this.toSeconds(t);if(this._state.getValueAtTime(e)==="stopped"){const s=this._state.get(e);s&&s.time>0&&(this._tickOffset.cancel(s.time),this._state.cancel(s.time))}return this._state.cancel(e),this._state.setStateAtTime("stopped",e),this.setTicksAtTime(0,e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}pause(t){const e=this.toSeconds(t);return this._state.getValueAtTime(e)==="started"&&(this._state.setStateAtTime("paused",e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e)),this}cancel(t){return t=this.toSeconds(t),this._state.cancel(t),this._tickOffset.cancel(t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}getTicksAtTime(t){const e=this.toSeconds(t),s=this._state.getLastState("stopped",e),n=this._ticksAtTime.get(e),r={state:"paused",time:e};this._state.add(r);let o=n||s,a=n?n.ticks:0,c=null;return this._state.forEachBetween(o.time,e+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(t){this.setTicksAtTime(t,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(t){const e=this.now(),s=this.frequency.timeToTicks(t,e);this.setTicksAtTime(s,e)}getSecondsAtTime(t){t=this.toSeconds(t);const e=this._state.getLastState("stopped",t),s={state:"paused",time:t};this._state.add(s);const n=this._secondsAtTime.get(t);let r=n||e,o=n?n.seconds:0,a=null;return this._state.forEachBetween(r.time,t+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(t,e){return e=this.toSeconds(e),this._tickOffset.cancel(e),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(t,e),ticks:t,time:e}),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}getStateAtTime(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)}getTimeOfTick(t,e=this.now()){const s=this._tickOffset.get(e),n=this._state.get(e),r=Math.max(s.time,n.time),o=this.frequency.getTicksAtTime(r)+t-s.ticks;return this.frequency.getTimeOfTick(o)}forEachTickBetween(t,e,s){let n=this._state.get(t);this._state.forEachBetween(t,e,o=>{n&&n.state==="started"&&o.state!=="started"&&this.forEachTickBetween(Math.max(n.time,t),o.time-this.sampleTime,s),n=o});let r=null;if(n&&n.state==="started"){const o=Math.max(n.time,t),a=this.frequency.getTicksAtTime(o),c=this.frequency.getTicksAtTime(n.time),l=a-c;let u=Math.ceil(l)-l;u=Le(u,1)?0:u;let h=this.frequency.getTimeOfTick(a+u);for(;h{switch(s.state){case"started":const n=this._tickSource.getTicksAtTime(s.time);this.emit("start",s.time,n);break;case"stopped":s.time!==0&&this.emit("stop",s.time);break;case"paused":this.emit("pause",s.time);break}}),this._tickSource.forEachTickBetween(t,e,(s,n)=>{this.callback(s,n)}))}getStateAtTime(t){const e=this.toSeconds(t);return this._state.getValueAtTime(e)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}fr.mixin(Ii);class hc extends xs{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const t=$(hc.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=t.baseUrl,Object.keys(t.urls).forEach(e=>{this._loadingCount++;const s=t.urls[e];this.add(e,s,this._bufferLoaded.bind(this,t.onload),t.onerror)})}static getDefaults(){return{baseUrl:"",onerror:yt,onload:yt,urls:{}}}has(t){return this._buffers.has(t.toString())}get(t){return ut(this.has(t),`ToneAudioBuffers has no buffer named: ${t}`),this._buffers.get(t.toString())}_bufferLoaded(t){this._loadingCount--,this._loadingCount===0&&t&&t()}get loaded(){return Array.from(this._buffers).every(([t,e])=>e.loaded)}add(t,e,s=yt,n=yt){return fs(e)?(this.baseUrl&&e.trim().substring(0,11).toLowerCase()==="data:audio/"&&(this.baseUrl=""),this._buffers.set(t.toString(),new xt(this.baseUrl+e,s,n))):this._buffers.set(t.toString(),new xt(e,s,n)),this}dispose(){return super.dispose(),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this}}class Mn extends Ci{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(t){return this._getPPQ()*t}_secondsToUnits(t){return Math.floor(t/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(t){return t}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}class a1 extends ue{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Ke,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(t,e){return this._events.add({callback:t,time:this.toSeconds(e)}),this._events.length===1&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(t){return this._events.cancel(this.toSeconds(t)),this}_drawLoop(){const t=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=t;){const e=this._events.shift();e&&t-e.time<=this.expiration&&e.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}Eo(i=>{i.draw=new a1({context:i})});Oo(i=>{i.draw.dispose()});class c1 extends xs{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(t){ut(dt(t.time),"Events must have a time property"),ut(dt(t.duration),"Events must have a duration parameter"),t.time=t.time.valueOf();let e=new l1(t.time,t.time+t.duration,t);for(this._root===null?this._root=e:this._root.insert(e),this._length++;e!==null;)e.updateHeight(),e.updateMax(),this._rebalance(e),e=e.parent;return this}remove(t){if(this._root!==null){const e=[];this._root.search(t.time,e);for(const s of e)if(s.event===t){this._removeNode(s),this._length--;break}}return this}get length(){return this._length}cancel(t){return this.forEachFrom(t,e=>this.remove(e)),this}_setRoot(t){this._root=t,this._root!==null&&(this._root.parent=null)}_replaceNodeInParent(t,e){t.parent!==null?(t.isLeftChild()?t.parent.left=e:t.parent.right=e,this._rebalance(t.parent)):this._setRoot(e)}_removeNode(t){if(t.left===null&&t.right===null)this._replaceNodeInParent(t,null);else if(t.right===null)this._replaceNodeInParent(t,t.left);else if(t.left===null)this._replaceNodeInParent(t,t.right);else{const e=t.getBalance();let s,n=null;if(e>0)if(t.left.right===null)s=t.left,s.right=t.right,n=s;else{for(s=t.left.right;s.right!==null;)s=s.right;s.parent&&(s.parent.right=s.left,n=s.parent,s.left=t.left,s.right=t.right)}else if(t.right.left===null)s=t.right,s.left=t.left,n=s;else{for(s=t.right.left;s.left!==null;)s=s.left;s.parent&&(s.parent.left=s.right,n=s.parent,s.left=t.left,s.right=t.right)}t.parent!==null?t.isLeftChild()?t.parent.left=s:t.parent.right=s:this._setRoot(s),n&&this._rebalance(n)}t.dispose()}_rotateLeft(t){const e=t.parent,s=t.isLeftChild(),n=t.right;n&&(t.right=n.left,n.left=t),e!==null?s?e.left=n:e.right=n:this._setRoot(n)}_rotateRight(t){const e=t.parent,s=t.isLeftChild(),n=t.left;n&&(t.left=n.right,n.right=t),e!==null?s?e.left=n:e.right=n:this._setRoot(n)}_rebalance(t){const e=t.getBalance();e>1&&t.left?t.left.getBalance()<0?this._rotateLeft(t.left):this._rotateRight(t):e<-1&&t.right&&(t.right.getBalance()>0?this._rotateRight(t.right):this._rotateLeft(t))}get(t){if(this._root!==null){const e=[];if(this._root.search(t,e),e.length>0){let s=e[0];for(let n=1;ns.low&&(s=e[n]);return s.event}}return null}forEach(t){if(this._root!==null){const e=[];this._root.traverse(s=>e.push(s)),e.forEach(s=>{s.event&&t(s.event)})}return this}forEachAtTime(t,e){if(this._root!==null){const s=[];this._root.search(t,s),s.forEach(n=>{n.event&&e(n.event)})}return this}forEachFrom(t,e){if(this._root!==null){const s=[];this._root.searchAfter(t,s),s.forEach(n=>{n.event&&e(n.event)})}return this}dispose(){return super.dispose(),this._root!==null&&this._root.traverse(t=>t.dispose()),this._root=null,this}}class l1{constructor(t,e,s){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=s,this.low=t,this.high=e,this.max=this.high}insert(t){t.low<=this.low?this.left===null?this.left=t:this.left.insert(t):this.right===null?this.right=t:this.right.insert(t)}search(t,e){t>this.max||(this.left!==null&&this.left.search(t,e),this.low<=t&&this.high>t&&e.push(this),!(this.low>t)&&this.right!==null&&this.right.search(t,e))}searchAfter(t,e){this.low>=t&&(e.push(this),this.left!==null&&this.left.searchAfter(t,e)),this.right!==null&&this.right.searchAfter(t,e)}traverse(t){t(this),this.left!==null&&this.left.traverse(t),this.right!==null&&this.right.traverse(t)}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 t=0;return this.left!==null&&this.right!==null?t=this.left.height-this.right.height:this.left!==null?t=this.left.height+1:this.right!==null&&(t=-(this.right.height+1)),t}isLeftChild(){return this.parent!==null&&this.parent.left===this}get left(){return this._left}set left(t){this._left=t,t!==null&&(t.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(t){this._right=t,t!==null&&(t.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class Ns extends ot{constructor(){super($(Ns.getDefaults(),arguments,["volume"])),this.name="Volume";const t=$(Ns.getDefaults(),arguments,["volume"]);this.input=this.output=new St({context:this.context,gain:t.volume,units:"decibels"}),this.volume=this.output.gain,Mt(this,"volume"),this._unmutedVolume=t.volume,this.mute=t.mute}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(t){!this.mute&&t?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!t&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}let u1=class xa extends ot{constructor(){super($(xa.getDefaults(),arguments)),this.name="Destination",this.input=new Ns({context:this.context}),this.output=new St({context:this.context}),this.volume=this.input.volume;const t=$(xa.getDefaults(),arguments);Pi(this.input,this.output,this.context.rawContext.destination),this.mute=t.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(t){this.input.mute=t}chain(...t){return this.input.disconnect(),t.unshift(this.input),t.push(this.output),Pi(...t),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}};Eo(i=>{i.destination=new u1({context:i})});Oo(i=>{i.destination.dispose()});class h1 extends xs{constructor(t){super(),this.name="TimelineValue",this._timeline=new Ke({memory:10}),this._initialValue=t}set(t,e){return this._timeline.add({value:t,time:e}),this}get(t){const e=this._timeline.get(t);return e?e.value:this._initialValue}}class ps extends ot{constructor(){super(Object.assign($(ps.getDefaults(),arguments,["context"])))}connect(t,e=0,s=0){return uc(this,t,e,s),this}}class cn extends ps{constructor(){super(Object.assign($(cn.getDefaults(),arguments,["mapping","length"]))),this.name="WaveShaper",this._shaper=this.context.createWaveShaper(),this.input=this._shaper,this.output=this._shaper;const t=$(cn.getDefaults(),arguments,["mapping","length"]);je(t.mapping)||t.mapping instanceof Float32Array?this.curve=Float32Array.from(t.mapping):Ny(t.mapping)&&this.setMap(t.mapping,t.length)}static getDefaults(){return Object.assign(Ot.getDefaults(),{length:1024})}setMap(t,e=1024){const s=new Float32Array(e);for(let n=0,r=e;ns.includes(t));ut(e,"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=t}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class Ni extends ps{constructor(){super(Object.assign($(Ni.getDefaults(),arguments,["value"]))),this.name="Pow";const t=$(Ni.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new cn({context:this.context,mapping:this._expFunc(t.value),length:8192}),this._exponent=t.value}static getDefaults(){return Object.assign(ps.getDefaults(),{value:1})}_expFunc(t){return e=>Math.pow(Math.abs(e),t)}get value(){return this._exponent}set value(t){this._exponent=t,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class Rs{constructor(t,e){this.id=Rs._eventId++,this._remainderTime=0;const s=Object.assign(Rs.getDefaults(),e);this.transport=t,this.callback=s.callback,this._once=s.once,this.time=Math.floor(s.time),this._remainderTime=s.time-this.time}static getDefaults(){return{callback:yt,once:!1,time:0}}get floatTime(){return this.time+this._remainderTime}invoke(t){if(this.callback){const e=this.transport.bpm.getDurationOfTicks(1,t);this.callback(t+this._remainderTime*e),this._once&&this.transport.clear(this.id)}}dispose(){return this.callback=void 0,this}}Rs._eventId=0;class dc extends Rs{constructor(t,e){super(t,e),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const s=Object.assign(dc.getDefaults(),e);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({},Rs.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(t){this._createEvents(t),super.invoke(t)}_createEvent(){return Zr(this._nextTick,this.floatTime+this.duration)?this.transport.scheduleOnce(this.invoke.bind(this),new Mn(this.context,this._nextTick).toSeconds()):-1}_createEvents(t){Zr(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 Mn(this.context,this._nextTick).toSeconds()))}_restart(t){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.floatTime;const e=this.transport.getTicksAtTime(t);jn(e,this.time)&&(this._nextTick=this.floatTime+Math.ceil((e-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 Ri extends ue{constructor(){super($(Ri.getDefaults(),arguments)),this.name="Transport",this._loop=new h1(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Ke,this._repeatedEvents=new c1,this._syncedSignals=[],this._swingAmount=0;const t=$(Ri.getDefaults(),arguments);this._ppq=t.ppq,this._clock=new Ii({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=t.ppq,this.bpm.setValueAtTime(t.bpm,0),Mt(this,"bpm"),this._timeSignature=t.timeSignature,this._swingTicks=t.ppq/2}static getDefaults(){return Object.assign(ue.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(t,e){if(this._loop.get(t)&&e>=this._loopEnd&&(this.emit("loopEnd",t),this._clock.setTicksAtTime(this._loopStart,t),e=this._loopStart,this.emit("loopStart",t,this._clock.getSecondsAtTime(t)),this.emit("loop",t)),this._swingAmount>0&&e%this._ppq!==0&&e%(this._swingTicks*2)!==0){const s=e%(this._swingTicks*2)/(this._swingTicks*2),n=Math.sin(s*Math.PI)*this._swingAmount;t+=new Mn(this.context,this._swingTicks*2/3).toSeconds()*n}Cl(!0),this._timeline.forEachAtTime(e,s=>s.invoke(t)),Cl(!1)}schedule(t,e){const s=new Rs(this,{callback:t,time:new Ci(this.context,e).toTicks()});return this._addEvent(s,this._timeline)}scheduleRepeat(t,e,s,n=1/0){const r=new dc(this,{callback:t,duration:new Ue(this.context,n).toTicks(),interval:new Ue(this.context,e).toTicks(),time:new Ci(this.context,s).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(t,e){const s=new Rs(this,{callback:t,once:!0,time:new Ci(this.context,e).toTicks()});return this._addEvent(s,this._timeline)}clear(t){if(this._scheduledEvents.hasOwnProperty(t)){const e=this._scheduledEvents[t.toString()];e.timeline.remove(e.event),e.event.dispose(),delete this._scheduledEvents[t.toString()]}return this}_addEvent(t,e){return this._scheduledEvents[t.id.toString()]={event:t,timeline:e},e.add(t),t.id}cancel(t=0){const e=this.toTicks(t);return this._timeline.forEachFrom(e,s=>this.clear(s.id)),this._repeatedEvents.forEachFrom(e,s=>this.clear(s.id)),this}_bindClockEvents(){this._clock.on("start",(t,e)=>{e=new Mn(this.context,e).toSeconds(),this.emit("start",t,e)}),this._clock.on("stop",t=>{this.emit("stop",t)}),this._clock.on("pause",t=>{this.emit("pause",t)})}get state(){return this._clock.getStateAtTime(this.now())}start(t,e){this.context.resume();let s;return dt(e)&&(s=this.toTicks(e)),this._clock.start(t,s),this}stop(t){return this._clock.stop(t),this}pause(t){return this._clock.pause(t),this}toggle(t){return t=this.toSeconds(t),this._clock.getStateAtTime(t)!=="started"?this.start(t):this.stop(t),this}get timeSignature(){return this._timeSignature}set timeSignature(t){je(t)&&(t=t[0]/t[1]*4),this._timeSignature=t}get loopStart(){return new Ue(this.context,this._loopStart,"i").toSeconds()}set loopStart(t){this._loopStart=this.toTicks(t)}get loopEnd(){return new Ue(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(t){this._loopEnd=this.toTicks(t)}get loop(){return this._loop.get(this.now())}set loop(t){this._loop.set(t,this.now())}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get swing(){return this._swingAmount}set swing(t){this._swingAmount=t}get swingSubdivision(){return new Mn(this.context,this._swingTicks).toNotation()}set swingSubdivision(t){this._swingTicks=this.toTicks(t)}get position(){const t=this.now(),e=this._clock.getTicksAtTime(t);return new Mn(this.context,e).toBarsBeatsSixteenths()}set position(t){const e=this.toTicks(t);this.ticks=e}get seconds(){return this._clock.seconds}set seconds(t){const e=this.now(),s=this._clock.frequency.timeToTicks(t,e);this.ticks=s}get progress(){if(this.loop){const t=this.now();return(this._clock.getTicksAtTime(t)-this._loopStart)/(this._loopEnd-this._loopStart)}else return 0}get ticks(){return this._clock.ticks}set ticks(t){if(this._clock.ticks!==t){const e=this.now();if(this.state==="started"){const s=this._clock.getTicksAtTime(e),n=this._clock.frequency.getDurationOfTicks(Math.ceil(s)-s,e),r=e+n;this.emit("stop",r),this._clock.setTicksAtTime(t,r),this.emit("start",r,this._clock.getSecondsAtTime(r))}else this.emit("ticks",e),this._clock.setTicksAtTime(t,e)}}getTicksAtTime(t){return this._clock.getTicksAtTime(t)}getSecondsAtTime(t){return this._clock.getSecondsAtTime(t)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(t){this._clock.frequency.multiplier=t}nextSubdivision(t){if(t=this.toTicks(t),this.state!=="started")return 0;{const e=this.now(),s=this.getTicksAtTime(e),n=t-s%t;return this._clock.nextTickTime(n,e)}}syncSignal(t,e){const s=this.now();let n=this.bpm,r=1/(60/n.getValueAtTime(s)/this.PPQ),o=[];if(t.units==="time"){const c=.015625/r,l=new St(c),u=new Ni(-1),h=new St(c);n.chain(l,u,h),n=h,r=1/r,o=[l,u,h]}e||(t.getValueAtTime(s)!==0?e=t.getValueAtTime(s)/r:e=0);const a=new St(e);return n.connect(a),a.connect(t._param),o.push(a),this._syncedSignals.push({initial:t.value,nodes:o,signal:t}),t.value=0,this}unsyncSignal(t){for(let e=this._syncedSignals.length-1;e>=0;e--){const s=this._syncedSignals[e];s.signal===t&&(s.nodes.forEach(n=>n.dispose()),s.signal.value=s.initial,this._syncedSignals.splice(e,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),ac(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}fr.mixin(Ri);Eo(i=>{i.transport=new Ri({context:i})});Oo(i=>{i.transport.dispose()});class ee extends ot{constructor(t){super(t),this.input=void 0,this._state=new lc("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=yt,this._syncedStop=yt,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new Ns({context:this.context,mute:t.mute,volume:t.volume}),this.volume=this._volume.volume,Mt(this,"volume"),this.onstop=t.onstop}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,onstop:yt,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(t){this._volume.mute=t}_clampToCurrentTime(t){return this._synced?t:Math.max(t,this.context.currentTime)}start(t,e,s){let n=ke(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(n=this._clampToCurrentTime(n),!this._synced&&this._state.getValueAtTime(n)==="started")ut(jn(n,this._state.get(n).time),"Start time must be strictly greater than previous start time"),this._state.cancel(n),this._state.setStateAtTime("started",n),this.log("restart",n),this.restart(n,e,s);else if(this.log("start",n),this._state.setStateAtTime("started",n),this._synced){const r=this._state.get(n);r&&(r.offset=this.toSeconds(Nn(e,0)),r.duration=s?this.toSeconds(s):void 0);const o=this.context.transport.schedule(a=>{this._start(a,e,s)},n);this._scheduled.push(o),this.context.transport.state==="started"&&this.context.transport.getSecondsAtTime(this.immediate())>n&&this._syncedStart(this.now(),this.context.transport.seconds)}else ch(this.context),this._start(n,e,s);return this}stop(t){let e=ke(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(e=this._clampToCurrentTime(e),this._state.getValueAtTime(e)==="started"||dt(this._state.getNextState("started",e))){if(this.log("stop",e),!this._synced)this._stop(e);else{const s=this.context.transport.schedule(this._stop.bind(this),e);this._scheduled.push(s)}this._state.cancel(e),this._state.setStateAtTime("stopped",e)}return this}restart(t,e,s){return t=this.toSeconds(t),this._state.getValueAtTime(t)==="started"&&(this._state.cancel(t),this._restart(t,e,s)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(t,e)=>{if(jn(e,0)){const s=this._state.get(e);if(s&&s.state==="started"&&s.time!==e){const n=e-this.toSeconds(s.time);let r;s.duration&&(r=this.toSeconds(s.duration)-n),this._start(t,this.toSeconds(s.offset)+n,r)}}},this._syncedStop=t=>{const e=this.context.transport.getSecondsAtTime(Math.max(t-this.sampleTime,0));this._state.getValueAtTime(e)==="started"&&this._stop(t)},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(t=>this.context.transport.clear(t)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=yt,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class Bn extends zn{constructor(){super($(Bn.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const t=$(Bn.getDefaults(),arguments,["url","onload"]);Is(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new kt({context:this.context,param:this._source.playbackRate,units:"positive",value:t.playbackRate}),this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this._buffer=new xt(t.url,t.onload,t.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(zn.getDefaults(),{url:new xt,loop:!1,loopEnd:0,loopStart:0,onload:yt,onerror:yt,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t}get curve(){return this._curve}set curve(t){this._curve=t}start(t,e,s,n=1){ut(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(t);this._startGain(r,n),this.loop?e=Nn(e,this.loopStart):e=Nn(e,0);let o=Math.max(this.toSeconds(e),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),Le(o,this.buffer.duration)&&(o=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Zr(o,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,o)),dt(s)){let a=this.toSeconds(s);a=Math.max(a,0),this.stop(r+a)}return this}_stopSource(t){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(t)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(t){this._source.loopStart=this.toSeconds(t)}get loopEnd(){return this._source.loopEnd}set loopEnd(t){this._source.loopEnd=this.toSeconds(t)}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._source.loop}set loop(t){this._source.loop=t,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class Fi extends ee{constructor(){super($(Fi.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const t=$(Fi.getDefaults(),arguments,["type"]);this._playbackRate=t.playbackRate,this.type=t.type,this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut}static getDefaults(){return Object.assign(ee.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(t){if(ut(t in Sl,"Noise: invalid type: "+t),this._type!==t&&(this._type=t,this.state==="started")){const e=this.now();this._stop(e),this._start(e)}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this._source&&(this._source.playbackRate.value=t)}_start(t){const e=Sl[this._type];this._source=new Bn({url:e,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(t),Math.random()*(e.duration-.001))}_stop(t){this._source&&(this._source.stop(this.toSeconds(t)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(t){this._stop(t),this._start(t)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const wn=44100*5,Xo=2,cs={brown:null,pink:null,white:null},Sl={get brown(){if(!cs.brown){const i=[];for(let t=0;tthis.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(e)}_stop(t){const e=this.toSeconds(t);this._oscillator&&this._oscillator.stop(e)}_restart(t){const e=this.toSeconds(t);return this.log("restart",e),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(e),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 Bt._periodicWaveCache.find(e=>e.phase===this._phase&&Hy(e.partials,this._partials));{const t=Bt._periodicWaveCache.find(e=>e.type===this._type&&e.phase===this._phase);return this._partialCount=t?t.partialCount:this._partialCount,t}}get type(){return this._type}set type(t){this._type=t;const e=["sine","square","sawtooth","triangle"].indexOf(t)!==-1;if(this._phase===0&&e)this._wave=void 0,this._partialCount=0,this._oscillator!==null&&(this._oscillator.type=t);else{const s=this._getCachedPeriodicWave();if(dt(s)){const{partials:n,wave:r}=s;this._wave=r,this._partials=n,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave)}else{const[n,r]=this._getRealImaginary(t,this._phase),o=this.context.createPeriodicWave(n,r);this._wave=o,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave),Bt._periodicWaveCache.push({imag:r,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:n,type:this._type,wave:this._wave}),Bt._periodicWaveCache.length>100&&Bt._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(t){this.partialCount&&this._type!=="custom"&&t!=="custom"?this.type=t+this.partialCount:this.type=t}get partialCount(){return this._partialCount}set partialCount(t){Be(t,0);let e=this._type;const s=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(s&&(e=s[1]),this._type!=="custom")t===0?this.type=e:this.type=e+t.toString();else{const n=new Float32Array(t);this._partials.forEach((r,o)=>n[o]=r),this._partials=Array.from(n),this.type=this._type}}_getRealImaginary(t,e){let n=2048;const r=new Float32Array(n),o=new Float32Array(n);let a=1;if(t==="custom"){if(a=this._partials.length+1,this._partialCount=this._partials.length,n=a,this._partials.length===0)return[r,o]}else{const c=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(t);c?(a=parseInt(c[2],10)+1,this._partialCount=parseInt(c[2],10),t=c[1],a=Math.max(a,2),n=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: "+t)}u!==0?(r[c]=-u*Math.sin(e*c),o[c]=u*Math.cos(e*c)):(r[c]=0,o[c]=0)}return[r,o]}_inverseFFT(t,e,s){let n=0;const r=t.length;for(let o=0;o(t+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Fs extends Ot{constructor(){super(Object.assign($(Fs.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const t=$(Fs.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new St({context:this.context,minValue:t.minValue,maxValue:t.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(Ot.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class Li extends ee{constructor(){super($(Li.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new d1({context:this.context}),this._modulationNode=new St({context:this.context});const t=$(Li.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Bt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new Bt({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new Fs({context:this.context,units:"positive",value:t.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Mt(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Bt.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){this._modulator.restart(t),this._carrier.restart(t)}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return qt(this,void 0,void 0,function*(){return mn(this,t)})}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 Vi extends ee{constructor(){super($(Vi.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new St({context:this.context,gain:0});const t=$(Vi.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Bt({context:this.context,detune:t.detune,frequency:0,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.detune=this._carrier.detune,this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this._modulator=new Bt({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new Fs({context:this.context,units:"positive",value:t.harmonicity}),this.modulationIndex=new Fs({context:this.context,units:"positive",value:t.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),Mt(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Bt.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){return this._modulator.restart(t),this._carrier.restart(t),this}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return qt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class qn extends ee{constructor(){super($(qn.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new St({context:this.context,gain:0}),this._thresh=new cn({context:this.context,mapping:e=>e<=0?-1:1});const t=$(qn.getDefaults(),arguments,["frequency","width"]);this.width=new Ot({context:this.context,units:"audioRange",value:t.width}),this._triangle=new Bt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.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),Mt(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(ee.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(t){t=this.toSeconds(t),this._triangle.start(t),this._widthGate.gain.setValueAtTime(1,t)}_stop(t){t=this.toSeconds(t),this._triangle.stop(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(0,t)}_restart(t){this._triangle.restart(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(1,t)}get phase(){return this._triangle.phase}set phase(t){this._triangle.phase=t}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(t){this._triangle.type=t}asArray(t=1024){return qt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class Ui extends ee{constructor(){super($(Ui.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const t=$(Ui.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this.detune=new Ot({context:this.context,units:"cents",value:t.detune}),this._spread=t.spread,this._type=t.type,this._phase=t.phase,this._partials=t.partials,this._partialCount=t.partialCount,this.count=t.count,Mt(this,["frequency","detune"])}static getDefaults(){return Object.assign(Bt.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(t){t=this.toSeconds(t),this._forEach(e=>e.start(t))}_stop(t){t=this.toSeconds(t),this._forEach(e=>e.stop(t))}_restart(t){this._forEach(e=>e.restart(t))}_forEach(t){for(let e=0;ee.type=t)}get spread(){return this._spread}set spread(t){if(this._spread=t,this._oscillators.length>1){const e=-t/2,s=t/(this._oscillators.length-1);this._forEach((n,r)=>n.detune.value=e+s*r)}}get count(){return this._oscillators.length}set count(t){if(Be(t,1),this._oscillators.length!==t){this._forEach(e=>e.dispose()),this._oscillators=[];for(let e=0;ethis.onstop(this):yt});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[e]=s}this.spread=this._spread,this.state==="started"&&this._forEach(e=>e.start())}}get phase(){return this._phase}set phase(t){this._phase=t,this._forEach((e,s)=>e.phase=this._phase+s/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(t){this._forEach(e=>e.baseType=t),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(t){this._partials=t,this._partialCount=this._partials.length,t.length&&(this._type="custom",this._forEach(e=>e.partials=t))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(t){this._partialCount=t,this._forEach(e=>e.partialCount=t),this._type=this._oscillators[0].type}asArray(t=1024){return qt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(t=>t.dispose()),this}}class ji extends ee{constructor(){super($(ji.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new Fs({context:this.context,value:2});const t=$(ji.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new qn({context:this.context,frequency:t.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new Bt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Mt(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(ee.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(t){t=this.toSeconds(t),this._modulator.start(t),this._pulse.start(t)}_stop(t){t=this.toSeconds(t),this._modulator.stop(t),this._pulse.stop(t)}_restart(t){this._modulator.restart(t),this._pulse.restart(t)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(t){this._modulator.phase=t}asArray(t=1024){return qt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const El={am:Li,fat:Ui,fm:Vi,oscillator:Bt,pulse:qn,pwm:ji};class ln extends ee{constructor(){super($(ln.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const t=$(ln.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this.detune=new Ot({context:this.context,units:"cents",value:t.detune}),Mt(this,["frequency","detune"]),this.set(t)}static getDefaults(){return Object.assign(Bt.getDefaults(),Vi.getDefaults(),Li.getDefaults(),Ui.getDefaults(),qn.getDefaults(),ji.getDefaults())}_start(t){this._oscillator.start(t)}_stop(t){this._oscillator.stop(t)}_restart(t){return this._oscillator.restart(t),this}get type(){let t="";return["am","fm","fat"].some(e=>this._sourceType===e)&&(t=this._sourceType),t+this._oscillator.type}set type(t){t.substr(0,2)==="fm"?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):t.substr(0,2)==="am"?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):t.substr(0,3)==="fat"?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(3)):t==="pwm"?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):t==="pulse"?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=t)}get partials(){return this._oscillator.partials}set partials(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partials=t)}get partialCount(){return this._oscillator.partialCount}set partialCount(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partialCount=t)}set(t){return Reflect.has(t,"type")&&t.type&&(this.type=t.type),super.set(t),this}_createNewOscillator(t){if(t!==this._sourceType){this._sourceType=t;const e=El[t],s=this.now();if(this._oscillator){const n=this._oscillator;n.stop(s),this.context.setTimeout(()=>n.dispose(),this.blockTime)}this._oscillator=new e({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(t){this._oscillator.phase=t}get sourceType(){return this._sourceType}set sourceType(t){let e="sine";this._oscillator.type!=="pwm"&&this._oscillator.type!=="pulse"&&(e=this._oscillator.type),t==="fm"?this.type="fm"+e:t==="am"?this.type="am"+e:t==="fat"?this.type="fat"+e:t==="oscillator"?this.type=e:t==="pulse"?this.type="pulse":t==="pwm"&&(this.type="pwm")}_getOscType(t,e){return t instanceof El[e]}get baseType(){return this._oscillator.baseType}set baseType(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&t!=="pulse"&&t!=="pwm"&&(this._oscillator.baseType=t)}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(t){this._getOscType(this._oscillator,"fat")&&Ps(t)&&(this._oscillator.count=t)}get spread(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.spread}set spread(t){this._getOscType(this._oscillator,"fat")&&Ps(t)&&(this._oscillator.spread=t)}get modulationType(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.modulationType}set modulationType(t){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&fs(t)&&(this._oscillator.modulationType=t)}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(t=1024){return qt(this,void 0,void 0,function*(){return mn(this,t)})}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class fc extends Ot{constructor(){super(Object.assign($(fc.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new St({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,Pi(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Ot.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class eo extends ps{constructor(){super(Object.assign($(eo.getDefaults(),arguments,["min","max"]))),this.name="Scale";const t=$(eo.getDefaults(),arguments,["min","max"]);this._mult=this.input=new Fs({context:this.context,value:t.max-t.min}),this._add=this.output=new fc({context:this.context,value:t.min}),this._min=t.min,this._max=t.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(ps.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(t){this._min=t,this._setRange()}get max(){return this._max}set max(t){this._max=t,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 vh(i,t=1/0){const e=new WeakMap;return function(s,n){Reflect.defineProperty(s,n,{configurable:!0,enumerable:!0,get:function(){return e.get(this)},set:function(r){Be(r,i,t),e.set(this,r)}})}}function ks(i,t=1/0){const e=new WeakMap;return function(s,n){Reflect.defineProperty(s,n,{configurable:!0,enumerable:!0,get:function(){return e.get(this)},set:function(r){Be(this.toSeconds(r),i,t),e.set(this,r)}})}}class zi extends ee{constructor(){super($(zi.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const t=$(zi.getDefaults(),arguments,["url","onload"]);this._buffer=new xt({onload:this._onload.bind(this,t.onload),onerror:t.onerror,reverse:t.reverse,url:t.url}),this.autostart=t.autostart,this._loop=t.loop,this._loopStart=t.loopStart,this._loopEnd=t.loopEnd,this._playbackRate=t.playbackRate,this.fadeIn=t.fadeIn,this.fadeOut=t.fadeOut}static getDefaults(){return Object.assign(ee.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:yt,onerror:yt,playbackRate:1,reverse:!1})}load(t){return qt(this,void 0,void 0,function*(){return yield this._buffer.load(t),this._onload(),this})}_onload(t=yt){t(),this.autostart&&this.start()}_onSourceEnd(t){this.onstop(this),this._activeSources.delete(t),this._activeSources.size===0&&!this._synced&&this._state.getValueAtTime(this.now())==="started"&&(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(t,e,s){return super.start(t,e,s),this}_start(t,e,s){this._loop?e=Nn(e,this._loopStart):e=Nn(e,0);const n=this.toSeconds(e),r=s;s=Nn(s,Math.max(this._buffer.duration-n,0));let o=this.toSeconds(s);o=o/this._playbackRate,t=this.toSeconds(t);const a=new Bn({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(t+o),this._state.setStateAtTime("stopped",t+o,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&ke(r)?a.start(t,n):a.start(t,n,o-this.toSeconds(this.fadeOut))}_stop(t){const e=this.toSeconds(t);this._activeSources.forEach(s=>s.stop(e))}restart(t,e,s){return super.restart(t,e,s),this}_restart(t,e,s){var n;(n=[...this._activeSources].pop())===null||n===void 0||n.stop(t),this._start(t,e,s)}seek(t,e){const s=this.toSeconds(e);if(this._state.getValueAtTime(s)==="started"){const n=this.toSeconds(t);this._stop(s),this._start(s,n)}return this}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get loopStart(){return this._loopStart}set loopStart(t){this._loopStart=t,this.buffer.loaded&&Be(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach(e=>{e.loopStart=t})}get loopEnd(){return this._loopEnd}set loopEnd(t){this._loopEnd=t,this.buffer.loaded&&Be(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach(e=>{e.loopEnd=t})}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._loop}set loop(t){if(this._loop!==t&&(this._loop=t,this._activeSources.forEach(e=>{e.loop=t}),t)){const e=this._state.getNextState("stopped",this.now());e&&this._state.cancel(e.time)}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t;const e=this.now(),s=this._state.getNextState("stopped",e);s&&s.implicitEnd&&(this._state.cancel(s.time),this._activeSources.forEach(n=>n.cancelStop())),this._activeSources.forEach(n=>{n.playbackRate.setValueAtTime(t,e)})}get reverse(){return this._buffer.reverse}set reverse(t){this._buffer.reverse=t}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(t=>t.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}}qe([ks(0)],zi.prototype,"fadeIn",void 0);qe([ks(0)],zi.prototype,"fadeOut",void 0);class f1 extends ps{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new cn({context:this.context,mapping:t=>Math.abs(t)*2-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Pe extends ot{constructor(){super($(Pe.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Ot({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const t=$(Pe.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=t.attack,this.decay=t.decay,this.sustain=t.sustain,this.release=t.release,this.attackCurve=t.attackCurve,this.releaseCurve=t.releaseCurve,this.decayCurve=t.decayCurve}static getDefaults(){return Object.assign(ot.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(t,e){if(fs(t))return t;{let s;for(s in Ar)if(Ar[s][e]===t)return s;return t}}_setCurve(t,e,s){if(fs(s)&&Reflect.has(Ar,s)){const n=Ar[s];Js(n)?t!=="_decayCurve"&&(this[t]=n[e]):this[t]=n}else if(je(s)&&t!=="_decayCurve")this[t]=s;else throw new Error("Envelope: invalid curve: "+s)}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(t){this._setCurve("_attackCurve","In",t)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(t){this._setCurve("_releaseCurve","Out",t)}get decayCurve(){return this._getCurve(this._decayCurve,"Out")}set decayCurve(t){this._setCurve("_decayCurve","Out",t)}triggerAttack(t,e=1){this.log("triggerAttack",t,e),t=this.toSeconds(t);let n=this.toSeconds(this.attack);const r=this.toSeconds(this.decay),o=this.getValueAtTime(t);if(o>0){const a=1/n;n=(1-o)/a}if(n0){const s=this.toSeconds(this.release);s{let t,e;const s=[];for(t=0;t<128;t++)s[t]=Math.sin(t/(128-1)*(Math.PI/2));const n=[],r=6.4;for(t=0;t<128-1;t++){e=t/(128-1);const d=Math.sin(e*(Math.PI*2)*r-Math.PI/2)+1;n[t]=d/10+e*.83}n[128-1]=1;const o=[],a=5;for(t=0;t<128;t++)o[t]=Math.ceil(t/(128-1)*a)/a;const c=[];for(t=0;t<128;t++)e=t/(128-1),c[t]=.5*(1-Math.cos(Math.PI*e));const l=[];for(t=0;t<128;t++){e=t/(128-1);const d=Math.pow(e,3)*4+.2,p=Math.cos(d*Math.PI*2*e);l[t]=Math.abs(p*(1-e))}function u(d){const p=new Array(d.length);for(let _=0;_this._original_triggerRelease(e);const t=$(un.getDefaults(),arguments);this._volume=this.output=new Ns({context:this.context,volume:t.volume}),this.volume=this._volume.volume,Mt(this,"volume")}static getDefaults(){return Object.assign(ot.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 t=!1;return this._synced||(this._synced=!0,t=!0),t}_syncMethod(t,e){const s=this["_original_"+t]=this[t];this[t]=(...n)=>{const r=n[e],o=this.context.transport.schedule(a=>{n[e]=a,s.apply(this,n)},r);this._scheduledEvents.push(o)}}unsync(){return this._scheduledEvents.forEach(t=>this.context.transport.clear(t)),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(t,e,s,n){const r=this.toSeconds(s),o=this.toSeconds(e);return this.triggerAttack(t,r,n),this.triggerRelease(r+o),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class ms extends un{constructor(){super($(ms.getDefaults(),arguments));const t=$(ms.getDefaults(),arguments);this.portamento=t.portamento,this.onsilence=t.onsilence}static getDefaults(){return Object.assign(un.getDefaults(),{detune:0,onsilence:yt,portamento:0})}triggerAttack(t,e,s=1){this.log("triggerAttack",t,e,s);const n=this.toSeconds(e);return this._triggerEnvelopeAttack(n,s),this.setNote(t,n),this}triggerRelease(t){this.log("triggerRelease",t);const e=this.toSeconds(t);return this._triggerEnvelopeRelease(e),this}setNote(t,e){const s=this.toSeconds(e),n=t instanceof Ae?t.toFrequency():t;if(this.portamento>0&&this.getLevelAtTime(s)>.05){const r=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(n,r,s)}else this.frequency.setValueAtTime(n,s);return this}}qe([ks(0)],ms.prototype,"portamento",void 0);class Do extends Pe{constructor(){super($(Do.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new St({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 Bi extends ms{constructor(){super($(Bi.getDefaults(),arguments)),this.name="Synth";const t=$(Bi.getDefaults(),arguments);this.oscillator=new ln(Object.assign({context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)},t.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new Do(Object.assign({context:this.context},t.envelope)),this.oscillator.chain(this.envelope,this.output),Mt(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(ms.getDefaults(),{envelope:Object.assign(An(Pe.getDefaults(),Object.keys(ot.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(An(ln.getDefaults(),[...Object.keys(ee.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(t,e){if(this.envelope.triggerAttack(t,e),this.oscillator.start(t),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+s+n)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class qi extends ot{constructor(){super($(qi.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const t=$(qi.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new kt({context:this.context,units:"number",value:t.Q,param:this._filter.Q}),this.frequency=new kt({context:this.context,units:"frequency",value:t.frequency,param:this._filter.frequency}),this.detune=new kt({context:this.context,units:"cents",value:t.detune,param:this._filter.detune}),this.gain=new kt({context:this.context,units:"decibels",convert:!1,value:t.gain,param:this._filter.gain}),this.type=t.type}static getDefaults(){return Object.assign(ot.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(t){ut(["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(t)!==-1,`Invalid filter type: ${t}`),this._filter.type=t}getFrequencyResponse(t=128){const e=new Float32Array(t);for(let o=0;os.type=t)}get rolloff(){return this._rolloff}set rolloff(t){const e=Ps(t)?t:parseInt(t,10),s=[-12,-24,-48,-96];let n=s.indexOf(e);ut(n!==-1,`rolloff can only be ${s.join(", ")}`),n+=1,this._rolloff=e,this.input.disconnect(),this._filters.forEach(r=>r.disconnect()),this._filters=new Array(n);for(let r=0;r1);return this._filters.forEach(()=>{e.getFrequencyResponse(t).forEach((r,o)=>s[o]*=r)}),e.dispose(),s}dispose(){return super.dispose(),this._filters.forEach(t=>{t.dispose()}),ac(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class Wi extends Pe{constructor(){super($(Wi.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const t=$(Wi.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=t.octaves,this._baseFrequency=this.toFrequency(t.baseFrequency),this._exponent=this.input=new Ni({context:this.context,value:t.exponent}),this._scale=this.output=new eo({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(Pe.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(t){const e=this.toFrequency(t);Be(e,0),this._baseFrequency=e,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(t){this._octaves=t,this._scale.max=this._baseFrequency*Math.pow(2,t)}get exponent(){return this._exponent.value}set exponent(t){this._exponent.value=t}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class Hi extends ms{constructor(){super($(Hi.getDefaults(),arguments)),this.name="MonoSynth";const t=$(Hi.getDefaults(),arguments);this.oscillator=new ln(Object.assign(t.oscillator,{context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new Wn(Object.assign(t.filter,{context:this.context})),this.filterEnvelope=new Wi(Object.assign(t.filterEnvelope,{context:this.context})),this.envelope=new Do(Object.assign(t.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),Mt(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(ms.getDefaults(),{envelope:Object.assign(An(Pe.getDefaults(),Object.keys(ot.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(An(Wn.getDefaults(),Object.keys(ot.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(An(Wi.getDefaults(),Object.keys(ot.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(An(ln.getDefaults(),Object.keys(ee.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(t,e=1){if(this.envelope.triggerAttack(t,e),this.filterEnvelope.triggerAttack(t),this.oscillator.start(t),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+s+n)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.filterEnvelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class Gi extends Bi{constructor(){super($(Gi.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const t=$(Gi.getDefaults(),arguments);this.pitchDecay=t.pitchDecay,this.octaves=t.octaves,Mt(this,["oscillator","envelope"])}static getDefaults(){return In(ms.getDefaults(),Bi.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(t,e){const s=this.toSeconds(e),n=this.toFrequency(t instanceof Ae?t.toFrequency():t),r=n*this.octaves;return this.oscillator.frequency.setValueAtTime(r,s),this.oscillator.frequency.exponentialRampToValueAtTime(n,s+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}qe([vh(0)],Gi.prototype,"octaves",void 0);qe([ks(0)],Gi.prototype,"pitchDecay",void 0);const xh=new Set;function pc(i){xh.add(i)}function kh(i,t){const e=`registerProcessor("${i}", ${t})`;xh.add(e)}const p1=` + */class vs{constructor(){this.debug=!1,this._wasDisposed=!1}static getDefaults(){return{}}log(...t){(this.debug||Js&&this.toString()===Js.TONE_DEBUG_CLASS)&&Cy(this,...t)}dispose(){return this._wasDisposed=!0,this}get disposed(){return this._wasDisposed}toString(){return this.name}}vs.version=au;const ec=1e-6;function Un(i,t){return i>t+ec}function fa(i,t){return Un(i,t)||Fe(i,t)}function Wr(i,t){return i+ecthis.memory){const e=this.length-this.memory;this._timeline.splice(0,e)}return this}remove(t){const e=this._timeline.indexOf(t);return e!==-1&&this._timeline.splice(e,1),this}get(t,e="time"){const s=this._search(t,e);return s!==-1?this._timeline[s]:null}peek(){return this._timeline[0]}shift(){return this._timeline.shift()}getAfter(t,e="time"){const s=this._search(t,e);return s+10&&this._timeline[e-1].time=0?this._timeline[s-1]:null}cancel(t){if(this._timeline.length>1){let e=this._search(t);if(e>=0)if(Fe(this._timeline[e].time,t)){for(let s=e;s>=0&&Fe(this._timeline[s].time,t);s--)e=s;this._timeline=this._timeline.slice(0,e)}else this._timeline=this._timeline.slice(0,e+1);else this._timeline=[]}else this._timeline.length===1&&fa(this._timeline[0].time,t)&&(this._timeline=[]);return this}cancelBefore(t){const e=this._search(t);return e>=0&&(this._timeline=this._timeline.slice(e+1)),this}previousEvent(t){const e=this._timeline.indexOf(t);return e>0?this._timeline[e-1]:null}_search(t,e="time"){if(this._timeline.length===0)return-1;let s=0;const n=this._timeline.length;let r=n;if(n>0&&this._timeline[n-1][e]<=t)return n-1;for(;s=0&&this._timeline[s].time>=t;)s--;return this._iterate(e,s+1),this}forEachAtTime(t,e){const s=this._search(t);if(s!==-1&&Fe(this._timeline[s].time,t)){let n=s;for(let r=s;r>=0&&Fe(this._timeline[r].time,t);r--)n=r;this._iterate(r=>{e(r)},n,s)}return this}dispose(){return super.dispose(),this._timeline=[],this}};const ih=[];function To(i){ih.push(i)}function Fy(i){ih.forEach(t=>t(i))}const rh=[];function wo(i){rh.push(i)}function Ly(i){rh.forEach(t=>t(i))}class ur extends vs{constructor(){super(...arguments),this.name="Emitter"}on(t,e){return t.split(/\W+/).forEach(n=>{xe(this._events)&&(this._events={}),this._events.hasOwnProperty(n)||(this._events[n]=[]),this._events[n].push(e)}),this}once(t,e){const s=(...n)=>{e(...n),this.off(t,s)};return this.on(t,s),this}off(t,e){return t.split(/\W+/).forEach(n=>{if(xe(this._events)&&(this._events={}),this._events.hasOwnProperty(n))if(xe(e))this._events[n]=[];else{const r=this._events[n];for(let o=r.length-1;o>=0;o--)r[o]===e&&r.splice(o,1)}}),this}emit(t,...e){if(this._events&&this._events.hasOwnProperty(t)){const s=this._events[t].slice(0);for(let n=0,r=s.length;n{const s=Object.getOwnPropertyDescriptor(ur.prototype,e);Object.defineProperty(t.prototype,e,s)})}dispose(){return super.dispose(),this._events=void 0,this}}class oh extends ur{constructor(){super(...arguments),this.isOffline=!1}toJSON(){return{}}}let sc=class ah extends oh{constructor(){var t,e;super(),this.name="Context",this._constants=new Map,this._timeouts=new Xe,this._timeoutIds=0,this._initialized=!1,this._closeStarted=!1,this.isOffline=!1,this._workletPromise=null;const s=$(ah.getDefaults(),arguments,["context"]);s.context?(this._context=s.context,this._latencyHint=((t=arguments[0])===null||t===void 0?void 0:t.latencyHint)||""):(this._context=Sy({latencyHint:s.latencyHint}),this._latencyHint=s.latencyHint),this._ticker=new My(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[!((e=arguments[0])===null||e===void 0)&&e.hasOwnProperty("updateInterval")?"_lookAhead":"lookAhead"]=s.lookAhead}static getDefaults(){return{clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.05}}initialize(){return this._initialized||(Fy(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(t,e,s){return this._context.createBuffer(t,e,s)}createChannelMerger(t){return this._context.createChannelMerger(t)}createChannelSplitter(t){return this._context.createChannelSplitter(t)}createConstantSource(){return this._context.createConstantSource()}createConvolver(){return this._context.createConvolver()}createDelay(t){return this._context.createDelay(t)}createDynamicsCompressor(){return this._context.createDynamicsCompressor()}createGain(){return this._context.createGain()}createIIRFilter(t,e){return this._context.createIIRFilter(t,e)}createPanner(){return this._context.createPanner()}createPeriodicWave(t,e,s){return this._context.createPeriodicWave(t,e,s)}createStereoPanner(){return this._context.createStereoPanner()}createWaveShaper(){return this._context.createWaveShaper()}createMediaStreamSource(t){return ut(Sn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamSource(t)}createMediaElementSource(t){return ut(Sn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaElementSource(t)}createMediaStreamDestination(){return ut(Sn(this._context),"Not available if OfflineAudioContext"),this._context.createMediaStreamDestination()}decodeAudioData(t){return this._context.decodeAudioData(t)}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(t){ut(!this._initialized,"The listener cannot be set after initialization."),this._listener=t}get transport(){return this.initialize(),this._transport}set transport(t){ut(!this._initialized,"The transport cannot be set after initialization."),this._transport=t}get draw(){return this.initialize(),this._draw}set draw(t){ut(!this._initialized,"Draw cannot be set after initialization."),this._draw=t}get destination(){return this.initialize(),this._destination}set destination(t){ut(!this._initialized,"The destination cannot be set after initialization."),this._destination=t}createAudioWorkletNode(t,e){return Ay(this.rawContext,t,e)}addAudioWorkletModule(t){return qt(this,void 0,void 0,function*(){ut(dt(this.rawContext.audioWorklet),"AudioWorkletNode is only available in a secure context (https or localhost)"),this._workletPromise||(this._workletPromise=this.rawContext.audioWorklet.addModule(t)),yield this._workletPromise})}workletsAreReady(){return qt(this,void 0,void 0,function*(){(yield this._workletPromise)?this._workletPromise:Promise.resolve()})}get updateInterval(){return this._ticker.updateInterval}set updateInterval(t){this._ticker.updateInterval=t}get clockSource(){return this._ticker.type}set clockSource(t){this._ticker.type=t}get lookAhead(){return this._lookAhead}set lookAhead(t){this._lookAhead=t,this.updateInterval=t?t/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 Sn(this._context)?this._context.resume():Promise.resolve()}close(){return qt(this,void 0,void 0,function*(){Sn(this._context)&&this.state!=="closed"&&!this._closeStarted&&(this._closeStarted=!0,yield this._context.close()),this._initialized&&Ly(this)})}getConstant(t){if(this._constants.has(t))return this._constants.get(t);{const e=this._context.createBuffer(1,128,this._context.sampleRate),s=e.getChannelData(0);for(let r=0;rthis._constants[t].disconnect()),this.close(),this}_timeoutLoop(){const t=this.now();let e=this._timeouts.peek();for(;this._timeouts.length&&e&&e.time<=t;)e.callback(),this._timeouts.shift(),e=this._timeouts.peek()}setTimeout(t,e){this._timeoutIds++;const s=this.now();return this._timeouts.add({callback:t,id:this._timeoutIds,time:s+e}),this._timeoutIds}clearTimeout(t){return this._timeouts.forEach(e=>{e.id===t&&this._timeouts.remove(e)}),this}clearInterval(t){return this.clearTimeout(t)}setInterval(t,e){const s=++this._timeoutIds,n=()=>{const r=this.now();this._timeouts.add({callback:()=>{t(),n()},id:s,time:r+e})};return n(),s}};class Vy extends oh{constructor(){super(...arguments),this.lookAhead=0,this.latencyHint=0,this.isOffline=!1}createAnalyser(){return{}}createOscillator(){return{}}createBufferSource(){return{}}createBiquadFilter(){return{}}createBuffer(t,e,s){return{}}createChannelMerger(t){return{}}createChannelSplitter(t){return{}}createConstantSource(){return{}}createConvolver(){return{}}createDelay(t){return{}}createDynamicsCompressor(){return{}}createGain(){return{}}createIIRFilter(t,e){return{}}createPanner(){return{}}createPeriodicWave(t,e,s){return{}}createStereoPanner(){return{}}createWaveShaper(){return{}}createMediaStreamSource(t){return{}}createMediaElementSource(t){return{}}createMediaStreamDestination(){return{}}decodeAudioData(t){return Promise.resolve({})}createAudioWorkletNode(t,e){return{}}get rawContext(){return{}}addAudioWorkletModule(t){return qt(this,void 0,void 0,function*(){return Promise.resolve()})}resume(){return Promise.resolve()}setTimeout(t,e){return 0}clearTimeout(t){return this}setInterval(t,e){return 0}clearInterval(t){return this}getConstant(t){return{}}get currentTime(){return 0}get state(){return{}}get sampleRate(){return 0}get listener(){return{}}get transport(){return{}}get draw(){return{}}set draw(t){}get destination(){return{}}set destination(t){}now(){return 0}immediate(){return 0}}function Mt(i,t){Ue(t)?t.forEach(e=>Mt(i,e)):Object.defineProperty(i,t,{enumerable:!0,writable:!1})}function nc(i,t){Ue(t)?t.forEach(e=>nc(i,e)):Object.defineProperty(i,t,{writable:!0})}const yt=()=>{};class xt extends vs{constructor(){super(),this.name="ToneAudioBuffer",this.onload=yt;const t=$(xt.getDefaults(),arguments,["url","onload","onerror"]);this.reverse=t.reverse,this.onload=t.onload,ds(t.url)?this.load(t.url).catch(t.onerror):t.url&&this.set(t.url)}static getDefaults(){return{onerror:yt,onload:yt,reverse:!1}}get sampleRate(){return this._buffer?this._buffer.sampleRate:Le().sampleRate}set(t){return t instanceof xt?t.loaded?this._buffer=t.get():t.onload=()=>{this.set(t),this.onload(this)}:this._buffer=t,this._reversed&&this._reverse(),this}get(){return this._buffer}load(t){return qt(this,void 0,void 0,function*(){const e=xt.load(t).then(s=>{this.set(s),this.onload(this)});xt.downloads.push(e);try{yield e}finally{const s=xt.downloads.indexOf(e);xt.downloads.splice(s,1)}return this})}dispose(){return super.dispose(),this._buffer=void 0,this}fromArray(t){const e=Ue(t)&&t[0].length>0,s=e?t.length:1,n=e?t[0].length:t.length,r=Le(),o=r.createBuffer(s,n,r.sampleRate),a=!e&&s===1?[t]:t;for(let c=0;cn/s),this.fromArray(e)}return this}toArray(t){if(Ds(t))return this.getChannelData(t);if(this.numberOfChannels===1)return this.toArray(0);{const e=[];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(t){this._reversed!==t&&(this._reversed=t,this._reverse())}static fromArray(t){return new xt().fromArray(t)}static fromUrl(t){return qt(this,void 0,void 0,function*(){return yield new xt().load(t)})}static load(t){return qt(this,void 0,void 0,function*(){const e=t.match(/\[([^\]\[]+\|.+)\]$/);if(e){const c=e[1].split("|");let l=c[0];for(const u of c)if(xt.supportsType(u)){l=u;break}t=t.replace(e[0],l)}const s=xt.baseUrl===""||xt.baseUrl.endsWith("/")?xt.baseUrl:xt.baseUrl+"/",n=document.createElement("a");n.href=s+t,n.pathname=(n.pathname+n.hash).split("/").map(encodeURIComponent).join("/");const r=yield fetch(n.href);if(!r.ok)throw new Error(`could not load url: ${t}`);const o=yield r.arrayBuffer();return yield Le().decodeAudioData(o)})}static supportsType(t){const e=t.split("."),s=e[e.length-1];return document.createElement("audio").canPlayType("audio/"+s)!==""}static loaded(){return qt(this,void 0,void 0,function*(){for(yield Promise.resolve();xt.downloads.length;)yield xt.downloads[0]})}}xt.baseUrl="";xt.downloads=[];class bo extends sc{constructor(){super({clockSource:"offline",context:Dr(arguments[0])?arguments[0]:Ey(arguments[0],arguments[1]*arguments[2],arguments[2]),lookAhead:0,updateInterval:Dr(arguments[0])?128/arguments[0].sampleRate:128/arguments[2]}),this.name="OfflineContext",this._currentTime=0,this.isOffline=!0,this._duration=Dr(arguments[0])?arguments[0].length/arguments[0].sampleRate:arguments[1]}now(){return this._currentTime}get currentTime(){return this._currentTime}_renderClock(t){return qt(this,void 0,void 0,function*(){let e=0;for(;this._duration-this._currentTime>=0;){this.emit("tick"),this._currentTime+=128/this.sampleRate,e++;const s=Math.floor(this.sampleRate/128);t&&e%s===0&&(yield new Promise(n=>setTimeout(n,1)))}})}render(t=!0){return qt(this,void 0,void 0,function*(){yield this.workletsAreReady(),yield this._renderClock(t);const e=yield this._context.startRendering();return new xt(e)})}close(){return Promise.resolve()}}const ch=new Vy;let Zs=ch;function Le(){return Zs===ch&&Oy&&Uy(new sc),Zs}function Uy(i,t=!1){t&&Zs.dispose(),Sn(i)?Zs=new sc(i):Dr(i)?Zs=new bo(i):Zs=i}function zy(){return Zs.resume()}if(Js&&!Js.TONE_SILENCE_LOGGING){const t=` * Tone.js v${au} * `;console.log(`%c${t}`,"background: #000; color: #fff")}function jy(i){return Math.pow(10,i/20)}function By(i){return 20*(Math.log(i)/Math.LN10)}function lh(i){return Math.pow(2,i/12)}let Co=440;function qy(){return Co}function Wy(i){Co=i}function pa(i){return Math.round(uh(i))}function uh(i){return 69+12*Math.log2(i/Co)}function Hy(i){return Co*Math.pow(2,(i-69)/12)}class ic extends vs{constructor(t,e,s){super(),this.defaultUnits="s",this._val=e,this._units=s,this.context=t,this._expressions=this._getExpressions()}_getExpressions(){return{hz:{method:t=>this._frequencyToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)hz$/i},i:{method:t=>this._ticksToUnits(parseInt(t,10)),regexp:/^(\d+)i$/i},m:{method:t=>this._beatsToUnits(parseInt(t,10)*this._getTimeSignature()),regexp:/^(\d+)m$/i},n:{method:(t,e)=>{const s=parseInt(t,10),n=e==="."?1.5:1;return s===1?this._beatsToUnits(this._getTimeSignature())*n:this._beatsToUnits(4/s)*n},regexp:/^(\d+)n(\.?)$/i},number:{method:t=>this._expressions[this.defaultUnits].method.call(this,t),regexp:/^(\d+(?:\.\d+)?)$/},s:{method:t=>this._secondsToUnits(parseFloat(t)),regexp:/^(\d+(?:\.\d+)?)s$/},samples:{method:t=>parseInt(t,10)/this.context.sampleRate,regexp:/^(\d+)samples$/},t:{method:t=>{const e=parseInt(t,10);return this._beatsToUnits(8/(Math.floor(e)*3))},regexp:/^(\d+)t$/i},tr:{method:(t,e,s)=>{let n=0;return t&&t!=="0"&&(n+=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&e!=="0"&&(n+=this._beatsToUnits(parseFloat(e))),s&&s!=="0"&&(n+=this._beatsToUnits(parseFloat(s)/4)),n},regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/}}}valueOf(){if(this._val instanceof ic&&this.fromType(this._val),xe(this._val))return this._noArg();if(ds(this._val)&&xe(this._units)){for(const t in this._expressions)if(this._expressions[t].regexp.test(this._val.trim())){this._units=t;break}}else if(Ks(this._val)){let t=0;for(const e in this._val)if(dt(this._val[e])){const s=this._val[e],n=new this.constructor(this.context,e).valueOf()*s;t+=n}return t}if(dt(this._units)){const t=this._expressions[this._units],e=this._val.toString().trim().match(t.regexp);return e?t.method.apply(this,e.slice(1)):t.method.call(this,this._val)}else return ds(this._val)?parseFloat(this._val):this._val}_frequencyToUnits(t){return 1/t}_beatsToUnits(t){return 60/this._getBpm()*t}_secondsToUnits(t){return t}_ticksToUnits(t){return t*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(t){switch(this._units=void 0,this.defaultUnits){case"s":this._val=t.toSeconds();break;case"i":this._val=t.toTicks();break;case"hz":this._val=t.toFrequency();break;case"midi":this._val=t.toMidi();break}return this}toFrequency(){return 1/this.toSeconds()}toSamples(){return this.toSeconds()*this.context.sampleRate}toMilliseconds(){return this.toSeconds()*1e3}}class Ve extends ic{constructor(){super(...arguments),this.name="TimeClass"}_getExpressions(){return Object.assign(super._getExpressions(),{now:{method:t=>this._now()+new this.constructor(this.context,t).valueOf(),regexp:/^\+(.+)/},quantize:{method:t=>{const e=new Ve(this.context,t).valueOf();return this._secondsToUnits(this.context.transport.nextSubdivision(e))},regexp:/^@(.+)/}})}quantize(t,e=1){const s=new this.constructor(this.context,t).valueOf(),n=this.valueOf(),a=Math.round(n/s)*s-n;return n+a*e}toNotation(){const t=this.toSeconds(),e=["1m"];for(let r=1;r<9;r++){const o=Math.pow(2,r);e.push(o+"n."),e.push(o+"n"),e.push(o+"t")}e.push("0");let s=e[0],n=new Ve(this.context,e[0]).toSeconds();return e.forEach(r=>{const o=new Ve(this.context,r).toSeconds();Math.abs(o-t)3&&(n=parseFloat(parseFloat(r).toFixed(3))),[s,e,n].join(":")}toTicks(){const t=this._beatsToUnits(1);return this.valueOf()/t*this._getPPQ()}toSeconds(){return this.valueOf()}toMidi(){return pa(this.toFrequency())}_now(){return this.context.now()}}class Ee extends Ve{constructor(){super(...arguments),this.name="Frequency",this.defaultUnits="hz"}static get A4(){return qy()}static set A4(t){Wy(t)}_getExpressions(){return Object.assign({},super._getExpressions(),{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method(t){return this.defaultUnits==="midi"?t:Ee.mtof(t)}},note:{regexp:/^([a-g]{1}(?:b|#|##|x|bb|###|#x|x#|bbb)?)(-?[0-9]+)/i,method(t,e){const n=Yy[t.toLowerCase()]+(parseInt(e,10)+1)*12;return this.defaultUnits==="midi"?n:Ee.mtof(n)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method(t,e,s){let n=1;return t&&t!=="0"&&(n*=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&e!=="0"&&(n*=this._beatsToUnits(parseFloat(e))),s&&s!=="0"&&(n*=this._beatsToUnits(parseFloat(s)/4)),n}}})}transpose(t){return new Ee(this.context,this.valueOf()*lh(t))}harmonize(t){return t.map(e=>this.transpose(e))}toMidi(){return pa(this.valueOf())}toNote(){const t=this.toFrequency(),e=Math.log2(t/Ee.A4);let s=Math.round(12*e)+57;const n=Math.floor(s/12);return n<0&&(s+=-12*n),Gy[s%12]+n.toString()}toSeconds(){return 1/super.toSeconds()}toTicks(){const t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.floor(e*this._getPPQ())}_noArg(){return 0}_frequencyToUnits(t){return t}_ticksToUnits(t){return 1/(t*60/(this._getBpm()*this._getPPQ()))}_beatsToUnits(t){return 1/super._beatsToUnits(t)}_secondsToUnits(t){return 1/t}static mtof(t){return Hy(t)}static ftom(t){return pa(t)}}const Yy={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},Gy=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];class wi extends Ve{constructor(){super(...arguments),this.name="TransportTime"}_now(){return this.context.transport.seconds}}class le extends vs{constructor(){super();const t=$(le.getDefaults(),arguments,["context"]);this.defaultContext?this.context=this.defaultContext:this.context=t.context}static getDefaults(){return{context:Le()}}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(t){return by(t),new Ve(this.context,t).toSeconds()}toFrequency(t){return new Ee(this.context,t).toFrequency()}toTicks(t){return new wi(this.context,t).toTicks()}_getPartialProperties(t){const e=this.get();return Object.keys(e).forEach(s=>{xe(t[s])&&delete e[s]}),e}get(){const t=Ny(this);return Object.keys(t).forEach(e=>{if(Reflect.has(this,e)){const s=this[e];dt(s)&&dt(s.value)&&dt(s.setValueAtTime)?t[e]=s.value:s instanceof le?t[e]=s._getPartialProperties(t[e]):Ue(s)||Ds(s)||ds(s)||wy(s)?t[e]=s:delete t[e]}}),t}set(t){return Object.keys(t).forEach(e=>{Reflect.has(this,e)&&dt(this[e])&&(this[e]&&dt(this[e].value)&&dt(this[e].setValueAtTime)?this[e].value!==t[e]&&(this[e].value=t[e]):this[e]instanceof le?this[e].set(t[e]):this[e]=t[e])}),this}}class rc extends Xe{constructor(t="stopped"){super(),this.name="StateTimeline",this._initial=t,this.setStateAtTime(this._initial,0)}getValueAtTime(t){const e=this.get(t);return e!==null?e.state:this._initial}setStateAtTime(t,e,s){return je(e,0),this.add(Object.assign({},s,{state:t,time:e})),this}getLastState(t,e){const s=this._search(e);for(let n=s;n>=0;n--){const r=this._timeline[n];if(r.state===t)return r}}getNextState(t,e){const s=this._search(e);if(s!==-1)for(let n=s;n0,"timeConstant must be a number greater than 0");const r=this.toSeconds(e);return this._assertRange(n),ut(isFinite(n)&&isFinite(r),`Invalid argument(s) to setTargetAtTime: ${JSON.stringify(t)}, ${JSON.stringify(e)}`),this._events.add({constant:s,time:r,type:"setTargetAtTime",value:n}),this.log(this.units,"setTargetAtTime",t,r,s),this._param.setTargetAtTime(n,r,s),this}setValueCurveAtTime(t,e,s,n=1){s=this.toSeconds(s),e=this.toSeconds(e);const r=this._fromType(t[0])*n;this.setValueAtTime(this._toType(r),e);const o=s/(t.length-1);for(let a=1;a{n.type==="cancelScheduledValues"?t.cancelScheduledValues(n.time):n.type==="setTargetAtTime"?t.setTargetAtTime(n.value,n.time,n.constant):t[n.type](n.value,n.time)}),this}setParam(t){ut(this._swappable,"The Param must be assigned as 'swappable' in the constructor");const e=this.input;return e.disconnect(this._param),this.apply(t),this._param=t,e.connect(this._param),this}dispose(){return super.dispose(),this._events.dispose(),this}get defaultValue(){return this._toType(this._param.defaultValue)}_exponentialApproach(t,e,s,n,r){return s+(e-s)*Math.exp(-(r-t)/n)}_linearInterpolate(t,e,s,n,r){return e+(n-e)*((r-t)/(s-t))}_exponentialInterpolate(t,e,s,n,r){return e*Math.pow(n/e,(r-t)/(s-t))}}class ot extends le{constructor(){super(...arguments),this._internalChannels=[]}get numberOfInputs(){return dt(this.input)?on(this.input)||this.input instanceof kt?1:this.input.numberOfInputs:0}get numberOfOutputs(){return dt(this.output)?this.output.numberOfOutputs:0}_isAudioNode(t){return dt(t)&&(t instanceof ot||Os(t))}_getInternalNodes(){const t=this._internalChannels.slice(0);return this._isAudioNode(this.input)&&t.push(this.input),this._isAudioNode(this.output)&&this.input!==this.output&&t.push(this.output),t}_setChannelProperties(t){this._getInternalNodes().forEach(s=>{s.channelCount=t.channelCount,s.channelCountMode=t.channelCountMode,s.channelInterpretation=t.channelInterpretation})}_getChannelProperties(){const t=this._getInternalNodes();ut(t.length>0,"ToneAudioNode does not have any internal nodes");const e=t[0];return{channelCount:e.channelCount,channelCountMode:e.channelCountMode,channelInterpretation:e.channelInterpretation}}get channelCount(){return this._getChannelProperties().channelCount}set channelCount(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCount:t}))}get channelCountMode(){return this._getChannelProperties().channelCountMode}set channelCountMode(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelCountMode:t}))}get channelInterpretation(){return this._getChannelProperties().channelInterpretation}set channelInterpretation(t){const e=this._getChannelProperties();this._setChannelProperties(Object.assign(e,{channelInterpretation:t}))}connect(t,e=0,s=0){return Ps(this,t,e,s),this}toDestination(){return this.connect(this.context.destination),this}toMaster(){return tc("toMaster() has been renamed toDestination()"),this.toDestination()}disconnect(t,e=0,s=0){return $y(this,t,e,s),this}chain(...t){return Mi(this,...t),this}fan(...t){return t.forEach(e=>this.connect(e)),this}dispose(){return super.dispose(),dt(this.input)&&(this.input instanceof ot?this.input.dispose():Os(this.input)&&this.input.disconnect()),dt(this.output)&&(this.output instanceof ot?this.output.dispose():Os(this.output)&&this.output.disconnect()),this._internalChannels=[],this}}function Mi(...i){const t=i.shift();i.reduce((e,s)=>(e instanceof ot?e.connect(s):Os(e)&&Ps(e,s),s),t)}function Ps(i,t,e=0,s=0){for(ut(dt(i),"Cannot connect from undefined node"),ut(dt(t),"Cannot connect to undefined node"),(t instanceof ot||Os(t))&&ut(t.numberOfInputs>0,"Cannot connect to node with no inputs"),ut(i.numberOfOutputs>0,"Cannot connect from node with no outputs");t instanceof ot||t instanceof kt;)dt(t.input)&&(t=t.input);for(;i instanceof ot;)dt(i.output)&&(i=i.output);on(t)?i.connect(t,e):i.connect(t,e,s)}function $y(i,t,e=0,s=0){if(dt(t))for(;t instanceof ot;)t=t.input;for(;!Os(i);)dt(i.output)&&(i=i.output);on(t)?i.disconnect(t,e):Os(t)?i.disconnect(t,e,s):i.disconnect()}class St extends ot{constructor(){super($(St.getDefaults(),arguments,["gain","units"])),this.name="Gain",this._gainNode=this.context.createGain(),this.input=this._gainNode,this.output=this._gainNode;const t=$(St.getDefaults(),arguments,["gain","units"]);this.gain=new kt({context:this.context,convert:t.convert,param:this._gainNode.gain,units:t.units,value:t.gain,minValue:t.minValue,maxValue:t.maxValue}),Mt(this,"gain")}static getDefaults(){return Object.assign(ot.getDefaults(),{convert:!0,gain:1,units:"gain"})}dispose(){return super.dispose(),this._gainNode.disconnect(),this.gain.dispose(),this}}class zn extends ot{constructor(t){super(t),this.onended=yt,this._startTime=-1,this._stopTime=-1,this._timeout=-1,this.output=new St({context:this.context,gain:0}),this._gainNode=this.output,this.getStateAtTime=function(e){const s=this.toSeconds(e);return this._startTime!==-1&&s>=this._startTime&&(this._stopTime===-1||s<=this._stopTime)?"started":"stopped"},this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut,this._curve=t.curve,this.onended=t.onended}static getDefaults(){return Object.assign(ot.getDefaults(),{curve:"linear",fadeIn:0,fadeOut:0,onended:yt})}_startGain(t,e=1){ut(this._startTime===-1,"Source cannot be started more than once");const s=this.toSeconds(this._fadeIn);return this._startTime=t+s,this._startTime=Math.max(this._startTime,this.context.currentTime),s>0?(this._gainNode.gain.setValueAtTime(0,t),this._curve==="linear"?this._gainNode.gain.linearRampToValueAtTime(e,t+s):this._gainNode.gain.exponentialApproachValueAtTime(e,t,s)):this._gainNode.gain.setValueAtTime(e,t),this}stop(t){return this.log("stop",t),this._stopGain(this.toSeconds(t)),this}_stopGain(t){ut(this._startTime!==-1,"'start' must be called before 'stop'"),this.cancelStop();const e=this.toSeconds(this._fadeOut);return this._stopTime=this.toSeconds(t)+e,this._stopTime=Math.max(this._stopTime,this.now()),e>0?this._curve==="linear"?this._gainNode.gain.linearRampTo(0,e,t):this._gainNode.gain.targetRampTo(0,e,t):(this._gainNode.gain.cancelAndHoldAtTime(t),this._gainNode.gain.setValueAtTime(0,t)),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(()=>{const s=this._curve==="exponential"?e*2:0;this._stopSource(this.now()+s),this._onended()},this._stopTime-this.context.currentTime),this}_onended(){if(this.onended!==yt&&(this.onended(this),this.onended=yt,!this.context.isOffline)){const t=()=>this.dispose();typeof window.requestIdleCallback<"u"?window.requestIdleCallback(t):setTimeout(t,1e3)}}get state(){return this.getStateAtTime(this.now())}cancelStop(){return this.log("cancelStop"),ut(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=yt,this}}class Hr extends zn{constructor(){super($(Hr.getDefaults(),arguments,["offset"])),this.name="ToneConstantSource",this._source=this.context.createConstantSource();const t=$(Hr.getDefaults(),arguments,["offset"]);Ps(this._source,this._gainNode),this.offset=new kt({context:this.context,convert:t.convert,param:this._source.offset,units:t.units,value:t.offset,minValue:t.minValue,maxValue:t.maxValue})}static getDefaults(){return Object.assign(zn.getDefaults(),{convert:!0,offset:1,units:"number"})}start(t){const e=this.toSeconds(t);return this.log("start",e),this._startGain(e),this._source.start(e),this}_stopSource(t){this._source.stop(t)}dispose(){return super.dispose(),this.state==="started"&&this.stop(),this._source.disconnect(),this.offset.dispose(),this}}class Ot extends ot{constructor(){super($(Ot.getDefaults(),arguments,["value","units"])),this.name="Signal",this.override=!0;const t=$(Ot.getDefaults(),arguments,["value","units"]);this.output=this._constantSource=new Hr({context:this.context,convert:t.convert,offset:t.value,units:t.units,minValue:t.minValue,maxValue:t.maxValue}),this._constantSource.start(0),this.input=this._param=this._constantSource.offset}static getDefaults(){return Object.assign(ot.getDefaults(),{convert:!0,units:"number",value:0})}connect(t,e=0,s=0){return oc(this,t,e,s),this}dispose(){return super.dispose(),this._param.dispose(),this._constantSource.dispose(),this}setValueAtTime(t,e){return this._param.setValueAtTime(t,e),this}getValueAtTime(t){return this._param.getValueAtTime(t)}setRampPoint(t){return this._param.setRampPoint(t),this}linearRampToValueAtTime(t,e){return this._param.linearRampToValueAtTime(t,e),this}exponentialRampToValueAtTime(t,e){return this._param.exponentialRampToValueAtTime(t,e),this}exponentialRampTo(t,e,s){return this._param.exponentialRampTo(t,e,s),this}linearRampTo(t,e,s){return this._param.linearRampTo(t,e,s),this}targetRampTo(t,e,s){return this._param.targetRampTo(t,e,s),this}exponentialApproachValueAtTime(t,e,s){return this._param.exponentialApproachValueAtTime(t,e,s),this}setTargetAtTime(t,e,s){return this._param.setTargetAtTime(t,e,s),this}setValueCurveAtTime(t,e,s,n){return this._param.setValueCurveAtTime(t,e,s,n),this}cancelScheduledValues(t){return this._param.cancelScheduledValues(t),this}cancelAndHoldAtTime(t){return this._param.cancelAndHoldAtTime(t),this}rampTo(t,e,s){return this._param.rampTo(t,e,s),this}get value(){return this._param.value}set value(t){this._param.value=t}get convert(){return this._param.convert}set convert(t){this._param.convert=t}get units(){return this._param.units}get overridden(){return this._param.overridden}set overridden(t){this._param.overridden=t}get maxValue(){return this._param.maxValue}get minValue(){return this._param.minValue}apply(t){return this._param.apply(t),this}}function oc(i,t,e,s){(t instanceof kt||on(t)||t instanceof Ot&&t.override)&&(t.cancelScheduledValues(0),t.setValueAtTime(0,0),t instanceof Ot&&(t.overridden=!0)),Ps(i,t,e,s)}class Yr extends kt{constructor(){super($(Yr.getDefaults(),arguments,["value"])),this.name="TickParam",this._events=new Xe(1/0),this._multiplier=1;const t=$(Yr.getDefaults(),arguments,["value"]);this._multiplier=t.multiplier,this._events.cancel(0),this._events.add({ticks:0,time:0,type:"setValueAtTime",value:this._fromType(t.value)}),this.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(kt.getDefaults(),{multiplier:1,units:"hertz",value:1})}setTargetAtTime(t,e,s){e=this.toSeconds(e),this.setRampPoint(e);const n=this._fromType(t),r=this._events.get(e),o=Math.round(Math.max(1/s,1));for(let a=0;a<=o;a++){const c=s*a+e,l=this._exponentialApproach(r.time,r.value,n,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}setValueAtTime(t,e){const s=this.toSeconds(e);super.setValueAtTime(t,e);const n=this._events.get(s),r=this._events.previousEvent(n),o=this._getTicksUntilEvent(r,s);return n.ticks=Math.max(o,0),this}linearRampToValueAtTime(t,e){const s=this.toSeconds(e);super.linearRampToValueAtTime(t,e);const n=this._events.get(s),r=this._events.previousEvent(n),o=this._getTicksUntilEvent(r,s);return n.ticks=Math.max(o,0),this}exponentialRampToValueAtTime(t,e){e=this.toSeconds(e);const s=this._fromType(t),n=this._events.get(e),r=Math.round(Math.max((e-n.time)*10,1)),o=(e-n.time)/r;for(let a=0;a<=r;a++){const c=o*a+n.time,l=this._exponentialInterpolate(n.time,n.value,e,s,c);this.linearRampToValueAtTime(this._toType(l),c)}return this}_getTicksUntilEvent(t,e){if(t===null)t={ticks:0,time:0,type:"setValueAtTime",value:0};else if(xe(t.ticks)){const o=this._events.previousEvent(t);t.ticks=this._getTicksUntilEvent(o,t.time)}const s=this._fromType(this.getValueAtTime(t.time));let n=this._fromType(this.getValueAtTime(e));const r=this._events.get(e);return r&&r.time===e&&r.type==="setValueAtTime"&&(n=this._fromType(this.getValueAtTime(e-this.sampleTime))),.5*(e-t.time)*(s+n)+t.ticks}getTicksAtTime(t){const e=this.toSeconds(t),s=this._events.get(e);return Math.max(this._getTicksUntilEvent(s,e),0)}getDurationOfTicks(t,e){const s=this.toSeconds(e),n=this.getTicksAtTime(e);return this.getTimeOfTick(n+t)-s}getTimeOfTick(t){const e=this._events.get(t,"ticks"),s=this._events.getAfter(t,"ticks");if(e&&e.ticks===t)return e.time;if(e&&s&&s.type==="linearRampToValueAtTime"&&e.value!==s.value){const n=this._fromType(this.getValueAtTime(e.time)),o=(this._fromType(this.getValueAtTime(s.time))-n)/(s.time-e.time),a=Math.sqrt(Math.pow(n,2)-2*o*(e.ticks-t)),c=(-n+a)/o,l=(-n-a)/o;return(c>0?c:l)+e.time}else return e?e.value===0?1/0:e.time+(t-e.ticks)/e.value:t/this._initialValue}ticksToTime(t,e){return this.getDurationOfTicks(t,e)}timeToTicks(t,e){const s=this.toSeconds(e),n=this.toSeconds(t),r=this.getTicksAtTime(s);return this.getTicksAtTime(s+n)-r}_fromType(t){return this.units==="bpm"&&this.multiplier?1/(60/t/this.multiplier):super._fromType(t)}_toType(t){return this.units==="bpm"&&this.multiplier?t/this.multiplier*60:super._toType(t)}get multiplier(){return this._multiplier}set multiplier(t){const e=this.value;this._multiplier=t,this.cancelScheduledValues(0),this.setValueAtTime(e,0)}}class Gr extends Ot{constructor(){super($(Gr.getDefaults(),arguments,["value"])),this.name="TickSignal";const t=$(Gr.getDefaults(),arguments,["value"]);this.input=this._param=new Yr({context:this.context,convert:t.convert,multiplier:t.multiplier,param:this._constantSource.offset,units:t.units,value:t.value})}static getDefaults(){return Object.assign(Ot.getDefaults(),{multiplier:1,units:"hertz",value:1})}ticksToTime(t,e){return this._param.ticksToTime(t,e)}timeToTicks(t,e){return this._param.timeToTicks(t,e)}getTimeOfTick(t){return this._param.getTimeOfTick(t)}getDurationOfTicks(t,e){return this._param.getDurationOfTicks(t,e)}getTicksAtTime(t){return this._param.getTicksAtTime(t)}get multiplier(){return this._param.multiplier}set multiplier(t){this._param.multiplier=t}dispose(){return super.dispose(),this._param.dispose(),this}}class $r extends le{constructor(){super($($r.getDefaults(),arguments,["frequency"])),this.name="TickSource",this._state=new rc,this._tickOffset=new Xe,this._ticksAtTime=new Xe,this._secondsAtTime=new Xe;const t=$($r.getDefaults(),arguments,["frequency"]);this.frequency=new Gr({context:this.context,units:t.units,value:t.frequency}),Mt(this,"frequency"),this._state.setStateAtTime("stopped",0),this.setTicksAtTime(0,0)}static getDefaults(){return Object.assign({frequency:1,units:"hertz"},le.getDefaults())}get state(){return this.getStateAtTime(this.now())}start(t,e){const s=this.toSeconds(t);return this._state.getValueAtTime(s)!=="started"&&(this._state.setStateAtTime("started",s),dt(e)&&this.setTicksAtTime(e,s),this._ticksAtTime.cancel(s),this._secondsAtTime.cancel(s)),this}stop(t){const e=this.toSeconds(t);if(this._state.getValueAtTime(e)==="stopped"){const s=this._state.get(e);s&&s.time>0&&(this._tickOffset.cancel(s.time),this._state.cancel(s.time))}return this._state.cancel(e),this._state.setStateAtTime("stopped",e),this.setTicksAtTime(0,e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}pause(t){const e=this.toSeconds(t);return this._state.getValueAtTime(e)==="started"&&(this._state.setStateAtTime("paused",e),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e)),this}cancel(t){return t=this.toSeconds(t),this._state.cancel(t),this._tickOffset.cancel(t),this._ticksAtTime.cancel(t),this._secondsAtTime.cancel(t),this}getTicksAtTime(t){const e=this.toSeconds(t),s=this._state.getLastState("stopped",e),n=this._ticksAtTime.get(e),r={state:"paused",time:e};this._state.add(r);let o=n||s,a=n?n.ticks:0,c=null;return this._state.forEachBetween(o.time,e+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(t){this.setTicksAtTime(t,this.now())}get seconds(){return this.getSecondsAtTime(this.now())}set seconds(t){const e=this.now(),s=this.frequency.timeToTicks(t,e);this.setTicksAtTime(s,e)}getSecondsAtTime(t){t=this.toSeconds(t);const e=this._state.getLastState("stopped",t),s={state:"paused",time:t};this._state.add(s);const n=this._secondsAtTime.get(t);let r=n||e,o=n?n.seconds:0,a=null;return this._state.forEachBetween(r.time,t+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(t,e){return e=this.toSeconds(e),this._tickOffset.cancel(e),this._tickOffset.add({seconds:this.frequency.getDurationOfTicks(t,e),ticks:t,time:e}),this._ticksAtTime.cancel(e),this._secondsAtTime.cancel(e),this}getStateAtTime(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)}getTimeOfTick(t,e=this.now()){const s=this._tickOffset.get(e),n=this._state.get(e),r=Math.max(s.time,n.time),o=this.frequency.getTicksAtTime(r)+t-s.ticks;return this.frequency.getTimeOfTick(o)}forEachTickBetween(t,e,s){let n=this._state.get(t);this._state.forEachBetween(t,e,o=>{n&&n.state==="started"&&o.state!=="started"&&this.forEachTickBetween(Math.max(n.time,t),o.time-this.sampleTime,s),n=o});let r=null;if(n&&n.state==="started"){const o=Math.max(n.time,t),a=this.frequency.getTicksAtTime(o),c=this.frequency.getTicksAtTime(n.time),l=a-c;let u=Math.ceil(l)-l;u=Fe(u,1)?0:u;let h=this.frequency.getTimeOfTick(a+u);for(;h{switch(s.state){case"started":const n=this._tickSource.getTicksAtTime(s.time);this.emit("start",s.time,n);break;case"stopped":s.time!==0&&this.emit("stop",s.time);break;case"paused":this.emit("pause",s.time);break}}),this._tickSource.forEachTickBetween(t,e,(s,n)=>{this.callback(s,n)}))}getStateAtTime(t){const e=this.toSeconds(t);return this._state.getValueAtTime(e)}dispose(){return super.dispose(),this.context.off("tick",this._boundLoop),this._tickSource.dispose(),this._state.dispose(),this}}ur.mixin(Di);class ac extends vs{constructor(){super(),this.name="ToneAudioBuffers",this._buffers=new Map,this._loadingCount=0;const t=$(ac.getDefaults(),arguments,["urls","onload","baseUrl"],"urls");this.baseUrl=t.baseUrl,Object.keys(t.urls).forEach(e=>{this._loadingCount++;const s=t.urls[e];this.add(e,s,this._bufferLoaded.bind(this,t.onload),t.onerror)})}static getDefaults(){return{baseUrl:"",onerror:yt,onload:yt,urls:{}}}has(t){return this._buffers.has(t.toString())}get(t){return ut(this.has(t),`ToneAudioBuffers has no buffer named: ${t}`),this._buffers.get(t.toString())}_bufferLoaded(t){this._loadingCount--,this._loadingCount===0&&t&&t()}get loaded(){return Array.from(this._buffers).every(([t,e])=>e.loaded)}add(t,e,s=yt,n=yt){return ds(e)?(this.baseUrl&&e.trim().substring(0,11).toLowerCase()==="data:audio/"&&(this.baseUrl=""),this._buffers.set(t.toString(),new xt(this.baseUrl+e,s,n))):this._buffers.set(t.toString(),new xt(e,s,n)),this}dispose(){return super.dispose(),this._buffers.forEach(t=>t.dispose()),this._buffers.clear(),this}}class An extends wi{constructor(){super(...arguments),this.name="Ticks",this.defaultUnits="i"}_now(){return this.context.transport.ticks}_beatsToUnits(t){return this._getPPQ()*t}_secondsToUnits(t){return Math.floor(t/(60/this._getBpm())*this._getPPQ())}_ticksToUnits(t){return t}toTicks(){return this.valueOf()}toSeconds(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())}}class Zy extends le{constructor(){super(...arguments),this.name="Draw",this.expiration=.25,this.anticipation=.008,this._events=new Xe,this._boundDrawLoop=this._drawLoop.bind(this),this._animationFrame=-1}schedule(t,e){return this._events.add({callback:t,time:this.toSeconds(e)}),this._events.length===1&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop)),this}cancel(t){return this._events.cancel(this.toSeconds(t)),this}_drawLoop(){const t=this.context.currentTime;for(;this._events.length&&this._events.peek().time-this.anticipation<=t;){const e=this._events.shift();e&&t-e.time<=this.expiration&&e.callback()}this._events.length>0&&(this._animationFrame=requestAnimationFrame(this._boundDrawLoop))}dispose(){return super.dispose(),this._events.dispose(),cancelAnimationFrame(this._animationFrame),this}}To(i=>{i.draw=new Zy({context:i})});wo(i=>{i.draw.dispose()});class Xy extends vs{constructor(){super(...arguments),this.name="IntervalTimeline",this._root=null,this._length=0}add(t){ut(dt(t.time),"Events must have a time property"),ut(dt(t.duration),"Events must have a duration parameter"),t.time=t.time.valueOf();let e=new Qy(t.time,t.time+t.duration,t);for(this._root===null?this._root=e:this._root.insert(e),this._length++;e!==null;)e.updateHeight(),e.updateMax(),this._rebalance(e),e=e.parent;return this}remove(t){if(this._root!==null){const e=[];this._root.search(t.time,e);for(const s of e)if(s.event===t){this._removeNode(s),this._length--;break}}return this}get length(){return this._length}cancel(t){return this.forEachFrom(t,e=>this.remove(e)),this}_setRoot(t){this._root=t,this._root!==null&&(this._root.parent=null)}_replaceNodeInParent(t,e){t.parent!==null?(t.isLeftChild()?t.parent.left=e:t.parent.right=e,this._rebalance(t.parent)):this._setRoot(e)}_removeNode(t){if(t.left===null&&t.right===null)this._replaceNodeInParent(t,null);else if(t.right===null)this._replaceNodeInParent(t,t.left);else if(t.left===null)this._replaceNodeInParent(t,t.right);else{const e=t.getBalance();let s,n=null;if(e>0)if(t.left.right===null)s=t.left,s.right=t.right,n=s;else{for(s=t.left.right;s.right!==null;)s=s.right;s.parent&&(s.parent.right=s.left,n=s.parent,s.left=t.left,s.right=t.right)}else if(t.right.left===null)s=t.right,s.left=t.left,n=s;else{for(s=t.right.left;s.left!==null;)s=s.left;s.parent&&(s.parent.left=s.right,n=s.parent,s.left=t.left,s.right=t.right)}t.parent!==null?t.isLeftChild()?t.parent.left=s:t.parent.right=s:this._setRoot(s),n&&this._rebalance(n)}t.dispose()}_rotateLeft(t){const e=t.parent,s=t.isLeftChild(),n=t.right;n&&(t.right=n.left,n.left=t),e!==null?s?e.left=n:e.right=n:this._setRoot(n)}_rotateRight(t){const e=t.parent,s=t.isLeftChild(),n=t.left;n&&(t.left=n.right,n.right=t),e!==null?s?e.left=n:e.right=n:this._setRoot(n)}_rebalance(t){const e=t.getBalance();e>1&&t.left?t.left.getBalance()<0?this._rotateLeft(t.left):this._rotateRight(t):e<-1&&t.right&&(t.right.getBalance()>0?this._rotateRight(t.right):this._rotateLeft(t))}get(t){if(this._root!==null){const e=[];if(this._root.search(t,e),e.length>0){let s=e[0];for(let n=1;ns.low&&(s=e[n]);return s.event}}return null}forEach(t){if(this._root!==null){const e=[];this._root.traverse(s=>e.push(s)),e.forEach(s=>{s.event&&t(s.event)})}return this}forEachAtTime(t,e){if(this._root!==null){const s=[];this._root.search(t,s),s.forEach(n=>{n.event&&e(n.event)})}return this}forEachFrom(t,e){if(this._root!==null){const s=[];this._root.searchAfter(t,s),s.forEach(n=>{n.event&&e(n.event)})}return this}dispose(){return super.dispose(),this._root!==null&&this._root.traverse(t=>t.dispose()),this._root=null,this}}class Qy{constructor(t,e,s){this._left=null,this._right=null,this.parent=null,this.height=0,this.event=s,this.low=t,this.high=e,this.max=this.high}insert(t){t.low<=this.low?this.left===null?this.left=t:this.left.insert(t):this.right===null?this.right=t:this.right.insert(t)}search(t,e){t>this.max||(this.left!==null&&this.left.search(t,e),this.low<=t&&this.high>t&&e.push(this),!(this.low>t)&&this.right!==null&&this.right.search(t,e))}searchAfter(t,e){this.low>=t&&(e.push(this),this.left!==null&&this.left.searchAfter(t,e)),this.right!==null&&this.right.searchAfter(t,e)}traverse(t){t(this),this.left!==null&&this.left.traverse(t),this.right!==null&&this.right.traverse(t)}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 t=0;return this.left!==null&&this.right!==null?t=this.left.height-this.right.height:this.left!==null?t=this.left.height+1:this.right!==null&&(t=-(this.right.height+1)),t}isLeftChild(){return this.parent!==null&&this.parent.left===this}get left(){return this._left}set left(t){this._left=t,t!==null&&(t.parent=this),this.updateHeight(),this.updateMax()}get right(){return this._right}set right(t){this._right=t,t!==null&&(t.parent=this),this.updateHeight(),this.updateMax()}dispose(){this.parent=null,this._left=null,this._right=null,this.event=null}}class Is extends ot{constructor(){super($(Is.getDefaults(),arguments,["volume"])),this.name="Volume";const t=$(Is.getDefaults(),arguments,["volume"]);this.input=this.output=new St({context:this.context,gain:t.volume,units:"decibels"}),this.volume=this.output.gain,Mt(this,"volume"),this._unmutedVolume=t.volume,this.mute=t.mute}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,volume:0})}get mute(){return this.volume.value===-1/0}set mute(t){!this.mute&&t?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!t&&(this.volume.value=this._unmutedVolume)}dispose(){return super.dispose(),this.input.dispose(),this.volume.dispose(),this}}let Ky=class ma extends ot{constructor(){super($(ma.getDefaults(),arguments)),this.name="Destination",this.input=new Is({context:this.context}),this.output=new St({context:this.context}),this.volume=this.input.volume;const t=$(ma.getDefaults(),arguments);Mi(this.input,this.output,this.context.rawContext.destination),this.mute=t.mute,this._internalChannels=[this.input,this.context.rawContext.destination,this.output]}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,volume:0})}get mute(){return this.input.mute}set mute(t){this.input.mute=t}chain(...t){return this.input.disconnect(),t.unshift(this.input),t.push(this.output),Mi(...t),this}get maxChannelCount(){return this.context.rawContext.destination.maxChannelCount}dispose(){return super.dispose(),this.volume.dispose(),this}};To(i=>{i.destination=new Ky({context:i})});wo(i=>{i.destination.dispose()});class Jy extends vs{constructor(t){super(),this.name="TimelineValue",this._timeline=new Xe({memory:10}),this._initialValue=t}set(t,e){return this._timeline.add({value:t,time:e}),this}get(t){const e=this._timeline.get(t);return e?e.value:this._initialValue}}class fs extends ot{constructor(){super(Object.assign($(fs.getDefaults(),arguments,["context"])))}connect(t,e=0,s=0){return oc(this,t,e,s),this}}class an extends fs{constructor(){super(Object.assign($(an.getDefaults(),arguments,["mapping","length"]))),this.name="WaveShaper",this._shaper=this.context.createWaveShaper(),this.input=this._shaper,this.output=this._shaper;const t=$(an.getDefaults(),arguments,["mapping","length"]);Ue(t.mapping)||t.mapping instanceof Float32Array?this.curve=Float32Array.from(t.mapping):Ty(t.mapping)&&this.setMap(t.mapping,t.length)}static getDefaults(){return Object.assign(Ot.getDefaults(),{length:1024})}setMap(t,e=1024){const s=new Float32Array(e);for(let n=0,r=e;ns.includes(t));ut(e,"oversampling must be either 'none', '2x', or '4x'"),this._shaper.oversample=t}dispose(){return super.dispose(),this._shaper.disconnect(),this}}class Pi extends fs{constructor(){super(Object.assign($(Pi.getDefaults(),arguments,["value"]))),this.name="Pow";const t=$(Pi.getDefaults(),arguments,["value"]);this._exponentScaler=this.input=this.output=new an({context:this.context,mapping:this._expFunc(t.value),length:8192}),this._exponent=t.value}static getDefaults(){return Object.assign(fs.getDefaults(),{value:1})}_expFunc(t){return e=>Math.pow(Math.abs(e),t)}get value(){return this._exponent}set value(t){this._exponent=t,this._exponentScaler.setMap(this._expFunc(this._exponent))}dispose(){return super.dispose(),this._exponentScaler.dispose(),this}}class Ns{constructor(t,e){this.id=Ns._eventId++,this._remainderTime=0;const s=Object.assign(Ns.getDefaults(),e);this.transport=t,this.callback=s.callback,this._once=s.once,this.time=Math.floor(s.time),this._remainderTime=s.time-this.time}static getDefaults(){return{callback:yt,once:!1,time:0}}get floatTime(){return this.time+this._remainderTime}invoke(t){if(this.callback){const e=this.transport.bpm.getDurationOfTicks(1,t);this.callback(t+this._remainderTime*e),this._once&&this.transport.clear(this.id)}}dispose(){return this.callback=void 0,this}}Ns._eventId=0;class cc extends Ns{constructor(t,e){super(t,e),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this);const s=Object.assign(cc.getDefaults(),e);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({},Ns.getDefaults(),{duration:1/0,interval:1,once:!1})}invoke(t){this._createEvents(t),super.invoke(t)}_createEvent(){return Wr(this._nextTick,this.floatTime+this.duration)?this.transport.scheduleOnce(this.invoke.bind(this),new An(this.context,this._nextTick).toSeconds()):-1}_createEvents(t){Wr(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 An(this.context,this._nextTick).toSeconds()))}_restart(t){this.transport.clear(this._currentId),this.transport.clear(this._nextId),this._nextTick=this.floatTime;const e=this.transport.getTicksAtTime(t);Un(e,this.time)&&(this._nextTick=this.floatTime+Math.ceil((e-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 Ii extends le{constructor(){super($(Ii.getDefaults(),arguments)),this.name="Transport",this._loop=new Jy(!1),this._loopStart=0,this._loopEnd=0,this._scheduledEvents={},this._timeline=new Xe,this._repeatedEvents=new Xy,this._syncedSignals=[],this._swingAmount=0;const t=$(Ii.getDefaults(),arguments);this._ppq=t.ppq,this._clock=new Di({callback:this._processTick.bind(this),context:this.context,frequency:0,units:"bpm"}),this._bindClockEvents(),this.bpm=this._clock.frequency,this._clock.frequency.multiplier=t.ppq,this.bpm.setValueAtTime(t.bpm,0),Mt(this,"bpm"),this._timeSignature=t.timeSignature,this._swingTicks=t.ppq/2}static getDefaults(){return Object.assign(le.getDefaults(),{bpm:120,loopEnd:"4m",loopStart:0,ppq:192,swing:0,swingSubdivision:"8n",timeSignature:4})}_processTick(t,e){if(this._loop.get(t)&&e>=this._loopEnd&&(this.emit("loopEnd",t),this._clock.setTicksAtTime(this._loopStart,t),e=this._loopStart,this.emit("loopStart",t,this._clock.getSecondsAtTime(t)),this.emit("loop",t)),this._swingAmount>0&&e%this._ppq!==0&&e%(this._swingTicks*2)!==0){const s=e%(this._swingTicks*2)/(this._swingTicks*2),n=Math.sin(s*Math.PI)*this._swingAmount;t+=new An(this.context,this._swingTicks*2/3).toSeconds()*n}kl(!0),this._timeline.forEachAtTime(e,s=>s.invoke(t)),kl(!1)}schedule(t,e){const s=new Ns(this,{callback:t,time:new wi(this.context,e).toTicks()});return this._addEvent(s,this._timeline)}scheduleRepeat(t,e,s,n=1/0){const r=new cc(this,{callback:t,duration:new Ve(this.context,n).toTicks(),interval:new Ve(this.context,e).toTicks(),time:new wi(this.context,s).toTicks()});return this._addEvent(r,this._repeatedEvents)}scheduleOnce(t,e){const s=new Ns(this,{callback:t,once:!0,time:new wi(this.context,e).toTicks()});return this._addEvent(s,this._timeline)}clear(t){if(this._scheduledEvents.hasOwnProperty(t)){const e=this._scheduledEvents[t.toString()];e.timeline.remove(e.event),e.event.dispose(),delete this._scheduledEvents[t.toString()]}return this}_addEvent(t,e){return this._scheduledEvents[t.id.toString()]={event:t,timeline:e},e.add(t),t.id}cancel(t=0){const e=this.toTicks(t);return this._timeline.forEachFrom(e,s=>this.clear(s.id)),this._repeatedEvents.forEachFrom(e,s=>this.clear(s.id)),this}_bindClockEvents(){this._clock.on("start",(t,e)=>{e=new An(this.context,e).toSeconds(),this.emit("start",t,e)}),this._clock.on("stop",t=>{this.emit("stop",t)}),this._clock.on("pause",t=>{this.emit("pause",t)})}get state(){return this._clock.getStateAtTime(this.now())}start(t,e){this.context.resume();let s;return dt(e)&&(s=this.toTicks(e)),this._clock.start(t,s),this}stop(t){return this._clock.stop(t),this}pause(t){return this._clock.pause(t),this}toggle(t){return t=this.toSeconds(t),this._clock.getStateAtTime(t)!=="started"?this.start(t):this.stop(t),this}get timeSignature(){return this._timeSignature}set timeSignature(t){Ue(t)&&(t=t[0]/t[1]*4),this._timeSignature=t}get loopStart(){return new Ve(this.context,this._loopStart,"i").toSeconds()}set loopStart(t){this._loopStart=this.toTicks(t)}get loopEnd(){return new Ve(this.context,this._loopEnd,"i").toSeconds()}set loopEnd(t){this._loopEnd=this.toTicks(t)}get loop(){return this._loop.get(this.now())}set loop(t){this._loop.set(t,this.now())}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get swing(){return this._swingAmount}set swing(t){this._swingAmount=t}get swingSubdivision(){return new An(this.context,this._swingTicks).toNotation()}set swingSubdivision(t){this._swingTicks=this.toTicks(t)}get position(){const t=this.now(),e=this._clock.getTicksAtTime(t);return new An(this.context,e).toBarsBeatsSixteenths()}set position(t){const e=this.toTicks(t);this.ticks=e}get seconds(){return this._clock.seconds}set seconds(t){const e=this.now(),s=this._clock.frequency.timeToTicks(t,e);this.ticks=s}get progress(){if(this.loop){const t=this.now();return(this._clock.getTicksAtTime(t)-this._loopStart)/(this._loopEnd-this._loopStart)}else return 0}get ticks(){return this._clock.ticks}set ticks(t){if(this._clock.ticks!==t){const e=this.now();if(this.state==="started"){const s=this._clock.getTicksAtTime(e),n=this._clock.frequency.getDurationOfTicks(Math.ceil(s)-s,e),r=e+n;this.emit("stop",r),this._clock.setTicksAtTime(t,r),this.emit("start",r,this._clock.getSecondsAtTime(r))}else this.emit("ticks",e),this._clock.setTicksAtTime(t,e)}}getTicksAtTime(t){return this._clock.getTicksAtTime(t)}getSecondsAtTime(t){return this._clock.getSecondsAtTime(t)}get PPQ(){return this._clock.frequency.multiplier}set PPQ(t){this._clock.frequency.multiplier=t}nextSubdivision(t){if(t=this.toTicks(t),this.state!=="started")return 0;{const e=this.now(),s=this.getTicksAtTime(e),n=t-s%t;return this._clock.nextTickTime(n,e)}}syncSignal(t,e){const s=this.now();let n=this.bpm,r=1/(60/n.getValueAtTime(s)/this.PPQ),o=[];if(t.units==="time"){const c=.015625/r,l=new St(c),u=new Pi(-1),h=new St(c);n.chain(l,u,h),n=h,r=1/r,o=[l,u,h]}e||(t.getValueAtTime(s)!==0?e=t.getValueAtTime(s)/r:e=0);const a=new St(e);return n.connect(a),a.connect(t._param),o.push(a),this._syncedSignals.push({initial:t.value,nodes:o,signal:t}),t.value=0,this}unsyncSignal(t){for(let e=this._syncedSignals.length-1;e>=0;e--){const s=this._syncedSignals[e];s.signal===t&&(s.nodes.forEach(n=>n.dispose()),s.signal.value=s.initial,this._syncedSignals.splice(e,1))}return this}dispose(){return super.dispose(),this._clock.dispose(),nc(this,"bpm"),this._timeline.dispose(),this._repeatedEvents.dispose(),this}}ur.mixin(Ii);To(i=>{i.transport=new Ii({context:i})});wo(i=>{i.transport.dispose()});class ee extends ot{constructor(t){super(t),this.input=void 0,this._state=new rc("stopped"),this._synced=!1,this._scheduled=[],this._syncedStart=yt,this._syncedStop=yt,this._state.memory=100,this._state.increasing=!0,this._volume=this.output=new Is({context:this.context,mute:t.mute,volume:t.volume}),this.volume=this._volume.volume,Mt(this,"volume"),this.onstop=t.onstop}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,onstop:yt,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(t){this._volume.mute=t}_clampToCurrentTime(t){return this._synced?t:Math.max(t,this.context.currentTime)}start(t,e,s){let n=xe(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(n=this._clampToCurrentTime(n),!this._synced&&this._state.getValueAtTime(n)==="started")ut(Un(n,this._state.get(n).time),"Start time must be strictly greater than previous start time"),this._state.cancel(n),this._state.setStateAtTime("started",n),this.log("restart",n),this.restart(n,e,s);else if(this.log("start",n),this._state.setStateAtTime("started",n),this._synced){const r=this._state.get(n);r&&(r.offset=this.toSeconds(In(e,0)),r.duration=s?this.toSeconds(s):void 0);const o=this.context.transport.schedule(a=>{this._start(a,e,s)},n);this._scheduled.push(o),this.context.transport.state==="started"&&this.context.transport.getSecondsAtTime(this.immediate())>n&&this._syncedStart(this.now(),this.context.transport.seconds)}else th(this.context),this._start(n,e,s);return this}stop(t){let e=xe(t)&&this._synced?this.context.transport.seconds:this.toSeconds(t);if(e=this._clampToCurrentTime(e),this._state.getValueAtTime(e)==="started"||dt(this._state.getNextState("started",e))){if(this.log("stop",e),!this._synced)this._stop(e);else{const s=this.context.transport.schedule(this._stop.bind(this),e);this._scheduled.push(s)}this._state.cancel(e),this._state.setStateAtTime("stopped",e)}return this}restart(t,e,s){return t=this.toSeconds(t),this._state.getValueAtTime(t)==="started"&&(this._state.cancel(t),this._restart(t,e,s)),this}sync(){return this._synced||(this._synced=!0,this._syncedStart=(t,e)=>{if(Un(e,0)){const s=this._state.get(e);if(s&&s.state==="started"&&s.time!==e){const n=e-this.toSeconds(s.time);let r;s.duration&&(r=this.toSeconds(s.duration)-n),this._start(t,this.toSeconds(s.offset)+n,r)}}},this._syncedStop=t=>{const e=this.context.transport.getSecondsAtTime(Math.max(t-this.sampleTime,0));this._state.getValueAtTime(e)==="started"&&this._stop(t)},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(t=>this.context.transport.clear(t)),this._scheduled=[],this._state.cancel(0),this._stop(0),this}dispose(){return super.dispose(),this.onstop=yt,this.unsync(),this._volume.dispose(),this._state.dispose(),this}}class jn extends zn{constructor(){super($(jn.getDefaults(),arguments,["url","onload"])),this.name="ToneBufferSource",this._source=this.context.createBufferSource(),this._internalChannels=[this._source],this._sourceStarted=!1,this._sourceStopped=!1;const t=$(jn.getDefaults(),arguments,["url","onload"]);Ps(this._source,this._gainNode),this._source.onended=()=>this._stopSource(),this.playbackRate=new kt({context:this.context,param:this._source.playbackRate,units:"positive",value:t.playbackRate}),this.loop=t.loop,this.loopStart=t.loopStart,this.loopEnd=t.loopEnd,this._buffer=new xt(t.url,t.onload,t.onerror),this._internalChannels.push(this._source)}static getDefaults(){return Object.assign(zn.getDefaults(),{url:new xt,loop:!1,loopEnd:0,loopStart:0,onload:yt,onerror:yt,playbackRate:1})}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t}get curve(){return this._curve}set curve(t){this._curve=t}start(t,e,s,n=1){ut(this.buffer.loaded,"buffer is either not set or not loaded");const r=this.toSeconds(t);this._startGain(r,n),this.loop?e=In(e,this.loopStart):e=In(e,0);let o=Math.max(this.toSeconds(e),0);if(this.loop){const a=this.toSeconds(this.loopEnd)||this.buffer.duration,c=this.toSeconds(this.loopStart),l=a-c;fa(o,a)&&(o=(o-c)%l+c),Fe(o,this.buffer.duration)&&(o=0)}if(this._source.buffer=this.buffer.get(),this._source.loopEnd=this.toSeconds(this.loopEnd)||this.buffer.duration,Wr(o,this.buffer.duration)&&(this._sourceStarted=!0,this._source.start(r,o)),dt(s)){let a=this.toSeconds(s);a=Math.max(a,0),this.stop(r+a)}return this}_stopSource(t){!this._sourceStopped&&this._sourceStarted&&(this._sourceStopped=!0,this._source.stop(this.toSeconds(t)),this._onended())}get loopStart(){return this._source.loopStart}set loopStart(t){this._source.loopStart=this.toSeconds(t)}get loopEnd(){return this._source.loopEnd}set loopEnd(t){this._source.loopEnd=this.toSeconds(t)}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._source.loop}set loop(t){this._source.loop=t,this._sourceStarted&&this.cancelStop()}dispose(){return super.dispose(),this._source.onended=null,this._source.disconnect(),this._buffer.dispose(),this.playbackRate.dispose(),this}}class Ni extends ee{constructor(){super($(Ni.getDefaults(),arguments,["type"])),this.name="Noise",this._source=null;const t=$(Ni.getDefaults(),arguments,["type"]);this._playbackRate=t.playbackRate,this.type=t.type,this._fadeIn=t.fadeIn,this._fadeOut=t.fadeOut}static getDefaults(){return Object.assign(ee.getDefaults(),{fadeIn:0,fadeOut:0,playbackRate:1,type:"white"})}get type(){return this._type}set type(t){if(ut(t in Tl,"Noise: invalid type: "+t),this._type!==t&&(this._type=t,this.state==="started")){const e=this.now();this._stop(e),this._start(e)}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t,this._source&&(this._source.playbackRate.value=t)}_start(t){const e=Tl[this._type];this._source=new jn({url:e,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(t),Math.random()*(e.duration-.001))}_stop(t){this._source&&(this._source.stop(this.toSeconds(t)),this._source=null)}get fadeIn(){return this._fadeIn}set fadeIn(t){this._fadeIn=t,this._source&&(this._source.fadeIn=this._fadeIn)}get fadeOut(){return this._fadeOut}set fadeOut(t){this._fadeOut=t,this._source&&(this._source.fadeOut=this._fadeOut)}_restart(t){this._stop(t),this._start(t)}dispose(){return super.dispose(),this._source&&this._source.disconnect(),this}}const Tn=44100*5,Ho=2,as={brown:null,pink:null,white:null},Tl={get brown(){if(!as.brown){const i=[];for(let t=0;tthis.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(e)}_stop(t){const e=this.toSeconds(t);this._oscillator&&this._oscillator.stop(e)}_restart(t){const e=this.toSeconds(t);return this.log("restart",e),this._oscillator&&this._oscillator.cancelStop(),this._state.cancel(e),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 Bt._periodicWaveCache.find(e=>e.phase===this._phase&&Iy(e.partials,this._partials));{const t=Bt._periodicWaveCache.find(e=>e.type===this._type&&e.phase===this._phase);return this._partialCount=t?t.partialCount:this._partialCount,t}}get type(){return this._type}set type(t){this._type=t;const e=["sine","square","sawtooth","triangle"].indexOf(t)!==-1;if(this._phase===0&&e)this._wave=void 0,this._partialCount=0,this._oscillator!==null&&(this._oscillator.type=t);else{const s=this._getCachedPeriodicWave();if(dt(s)){const{partials:n,wave:r}=s;this._wave=r,this._partials=n,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave)}else{const[n,r]=this._getRealImaginary(t,this._phase),o=this.context.createPeriodicWave(n,r);this._wave=o,this._oscillator!==null&&this._oscillator.setPeriodicWave(this._wave),Bt._periodicWaveCache.push({imag:r,partialCount:this._partialCount,partials:this._partials,phase:this._phase,real:n,type:this._type,wave:this._wave}),Bt._periodicWaveCache.length>100&&Bt._periodicWaveCache.shift()}}}get baseType(){return this._type.replace(this.partialCount.toString(),"")}set baseType(t){this.partialCount&&this._type!=="custom"&&t!=="custom"?this.type=t+this.partialCount:this.type=t}get partialCount(){return this._partialCount}set partialCount(t){je(t,0);let e=this._type;const s=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(this._type);if(s&&(e=s[1]),this._type!=="custom")t===0?this.type=e:this.type=e+t.toString();else{const n=new Float32Array(t);this._partials.forEach((r,o)=>n[o]=r),this._partials=Array.from(n),this.type=this._type}}_getRealImaginary(t,e){let n=2048;const r=new Float32Array(n),o=new Float32Array(n);let a=1;if(t==="custom"){if(a=this._partials.length+1,this._partialCount=this._partials.length,n=a,this._partials.length===0)return[r,o]}else{const c=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(t);c?(a=parseInt(c[2],10)+1,this._partialCount=parseInt(c[2],10),t=c[1],a=Math.max(a,2),n=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: "+t)}u!==0?(r[c]=-u*Math.sin(e*c),o[c]=u*Math.cos(e*c)):(r[c]=0,o[c]=0)}return[r,o]}_inverseFFT(t,e,s){let n=0;const r=t.length;for(let o=0;o(t+1)/2}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Rs extends Ot{constructor(){super(Object.assign($(Rs.getDefaults(),arguments,["value"]))),this.name="Multiply",this.override=!1;const t=$(Rs.getDefaults(),arguments,["value"]);this._mult=this.input=this.output=new St({context:this.context,minValue:t.minValue,maxValue:t.maxValue}),this.factor=this._param=this._mult.gain,this.factor.setValueAtTime(t.value,0)}static getDefaults(){return Object.assign(Ot.getDefaults(),{value:0})}dispose(){return super.dispose(),this._mult.dispose(),this}}class Ri extends ee{constructor(){super($(Ri.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="AMOscillator",this._modulationScale=new t1({context:this.context}),this._modulationNode=new St({context:this.context});const t=$(Ri.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Bt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this._modulator=new Bt({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new Rs({context:this.context,units:"positive",value:t.harmonicity}),this.frequency.chain(this.harmonicity,this._modulator.frequency),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),Mt(this,["frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Bt.getDefaults(),{harmonicity:1,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){this._modulator.restart(t),this._carrier.restart(t)}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return qt(this,void 0,void 0,function*(){return pn(this,t)})}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 Fi extends ee{constructor(){super($(Fi.getDefaults(),arguments,["frequency","type","modulationType"])),this.name="FMOscillator",this._modulationNode=new St({context:this.context,gain:0});const t=$(Fi.getDefaults(),arguments,["frequency","type","modulationType"]);this._carrier=new Bt({context:this.context,detune:t.detune,frequency:0,onstop:()=>this.onstop(this),phase:t.phase,type:t.type}),this.detune=this._carrier.detune,this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this._modulator=new Bt({context:this.context,phase:t.phase,type:t.modulationType}),this.harmonicity=new Rs({context:this.context,units:"positive",value:t.harmonicity}),this.modulationIndex=new Rs({context:this.context,units:"positive",value:t.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),Mt(this,["modulationIndex","frequency","detune","harmonicity"])}static getDefaults(){return Object.assign(Bt.getDefaults(),{harmonicity:1,modulationIndex:2,modulationType:"square"})}_start(t){this._modulator.start(t),this._carrier.start(t)}_stop(t){this._modulator.stop(t),this._carrier.stop(t)}_restart(t){return this._modulator.restart(t),this._carrier.restart(t),this}get type(){return this._carrier.type}set type(t){this._carrier.type=t}get baseType(){return this._carrier.baseType}set baseType(t){this._carrier.baseType=t}get partialCount(){return this._carrier.partialCount}set partialCount(t){this._carrier.partialCount=t}get modulationType(){return this._modulator.type}set modulationType(t){this._modulator.type=t}get phase(){return this._carrier.phase}set phase(t){this._carrier.phase=t,this._modulator.phase=t}get partials(){return this._carrier.partials}set partials(t){this._carrier.partials=t}asArray(t=1024){return qt(this,void 0,void 0,function*(){return pn(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.harmonicity.dispose(),this._carrier.dispose(),this._modulator.dispose(),this._modulationNode.dispose(),this.modulationIndex.dispose(),this}}class Bn extends ee{constructor(){super($(Bn.getDefaults(),arguments,["frequency","width"])),this.name="PulseOscillator",this._widthGate=new St({context:this.context,gain:0}),this._thresh=new an({context:this.context,mapping:e=>e<=0?-1:1});const t=$(Bn.getDefaults(),arguments,["frequency","width"]);this.width=new Ot({context:this.context,units:"audioRange",value:t.width}),this._triangle=new Bt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.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),Mt(this,["width","frequency","detune"])}static getDefaults(){return Object.assign(ee.getDefaults(),{detune:0,frequency:440,phase:0,type:"pulse",width:.2})}_start(t){t=this.toSeconds(t),this._triangle.start(t),this._widthGate.gain.setValueAtTime(1,t)}_stop(t){t=this.toSeconds(t),this._triangle.stop(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(0,t)}_restart(t){this._triangle.restart(t),this._widthGate.gain.cancelScheduledValues(t),this._widthGate.gain.setValueAtTime(1,t)}get phase(){return this._triangle.phase}set phase(t){this._triangle.phase=t}get type(){return"pulse"}get baseType(){return"pulse"}get partials(){return[]}get partialCount(){return 0}set carrierType(t){this._triangle.type=t}asArray(t=1024){return qt(this,void 0,void 0,function*(){return pn(this,t)})}dispose(){return super.dispose(),this._triangle.dispose(),this.width.dispose(),this._widthGate.dispose(),this._thresh.dispose(),this}}class Li extends ee{constructor(){super($(Li.getDefaults(),arguments,["frequency","type","spread"])),this.name="FatOscillator",this._oscillators=[];const t=$(Li.getDefaults(),arguments,["frequency","type","spread"]);this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this.detune=new Ot({context:this.context,units:"cents",value:t.detune}),this._spread=t.spread,this._type=t.type,this._phase=t.phase,this._partials=t.partials,this._partialCount=t.partialCount,this.count=t.count,Mt(this,["frequency","detune"])}static getDefaults(){return Object.assign(Bt.getDefaults(),{count:3,spread:20,type:"sawtooth"})}_start(t){t=this.toSeconds(t),this._forEach(e=>e.start(t))}_stop(t){t=this.toSeconds(t),this._forEach(e=>e.stop(t))}_restart(t){this._forEach(e=>e.restart(t))}_forEach(t){for(let e=0;ee.type=t)}get spread(){return this._spread}set spread(t){if(this._spread=t,this._oscillators.length>1){const e=-t/2,s=t/(this._oscillators.length-1);this._forEach((n,r)=>n.detune.value=e+s*r)}}get count(){return this._oscillators.length}set count(t){if(je(t,1),this._oscillators.length!==t){this._forEach(e=>e.dispose()),this._oscillators=[];for(let e=0;ethis.onstop(this):yt});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[e]=s}this.spread=this._spread,this.state==="started"&&this._forEach(e=>e.start())}}get phase(){return this._phase}set phase(t){this._phase=t,this._forEach((e,s)=>e.phase=this._phase+s/this.count*360)}get baseType(){return this._oscillators[0].baseType}set baseType(t){this._forEach(e=>e.baseType=t),this._type=this._oscillators[0].type}get partials(){return this._oscillators[0].partials}set partials(t){this._partials=t,this._partialCount=this._partials.length,t.length&&(this._type="custom",this._forEach(e=>e.partials=t))}get partialCount(){return this._oscillators[0].partialCount}set partialCount(t){this._partialCount=t,this._forEach(e=>e.partialCount=t),this._type=this._oscillators[0].type}asArray(t=1024){return qt(this,void 0,void 0,function*(){return pn(this,t)})}dispose(){return super.dispose(),this.frequency.dispose(),this.detune.dispose(),this._forEach(t=>t.dispose()),this}}class Vi extends ee{constructor(){super($(Vi.getDefaults(),arguments,["frequency","modulationFrequency"])),this.name="PWMOscillator",this.sourceType="pwm",this._scale=new Rs({context:this.context,value:2});const t=$(Vi.getDefaults(),arguments,["frequency","modulationFrequency"]);this._pulse=new Bn({context:this.context,frequency:t.modulationFrequency}),this._pulse.carrierType="sine",this.modulationFrequency=this._pulse.frequency,this._modulator=new Bt({context:this.context,detune:t.detune,frequency:t.frequency,onstop:()=>this.onstop(this),phase:t.phase}),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),Mt(this,["modulationFrequency","frequency","detune"])}static getDefaults(){return Object.assign(ee.getDefaults(),{detune:0,frequency:440,modulationFrequency:.4,phase:0,type:"pwm"})}_start(t){t=this.toSeconds(t),this._modulator.start(t),this._pulse.start(t)}_stop(t){t=this.toSeconds(t),this._modulator.stop(t),this._pulse.stop(t)}_restart(t){this._modulator.restart(t),this._pulse.restart(t)}get type(){return"pwm"}get baseType(){return"pwm"}get partials(){return[]}get partialCount(){return 0}get phase(){return this._modulator.phase}set phase(t){this._modulator.phase=t}asArray(t=1024){return qt(this,void 0,void 0,function*(){return pn(this,t)})}dispose(){return super.dispose(),this._pulse.dispose(),this._scale.dispose(),this._modulator.dispose(),this}}const wl={am:Ri,fat:Li,fm:Fi,oscillator:Bt,pulse:Bn,pwm:Vi};class cn extends ee{constructor(){super($(cn.getDefaults(),arguments,["frequency","type"])),this.name="OmniOscillator";const t=$(cn.getDefaults(),arguments,["frequency","type"]);this.frequency=new Ot({context:this.context,units:"frequency",value:t.frequency}),this.detune=new Ot({context:this.context,units:"cents",value:t.detune}),Mt(this,["frequency","detune"]),this.set(t)}static getDefaults(){return Object.assign(Bt.getDefaults(),Fi.getDefaults(),Ri.getDefaults(),Li.getDefaults(),Bn.getDefaults(),Vi.getDefaults())}_start(t){this._oscillator.start(t)}_stop(t){this._oscillator.stop(t)}_restart(t){return this._oscillator.restart(t),this}get type(){let t="";return["am","fm","fat"].some(e=>this._sourceType===e)&&(t=this._sourceType),t+this._oscillator.type}set type(t){t.substr(0,2)==="fm"?(this._createNewOscillator("fm"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):t.substr(0,2)==="am"?(this._createNewOscillator("am"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(2)):t.substr(0,3)==="fat"?(this._createNewOscillator("fat"),this._oscillator=this._oscillator,this._oscillator.type=t.substr(3)):t==="pwm"?(this._createNewOscillator("pwm"),this._oscillator=this._oscillator):t==="pulse"?this._createNewOscillator("pulse"):(this._createNewOscillator("oscillator"),this._oscillator=this._oscillator,this._oscillator.type=t)}get partials(){return this._oscillator.partials}set partials(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partials=t)}get partialCount(){return this._oscillator.partialCount}set partialCount(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&(this._oscillator.partialCount=t)}set(t){return Reflect.has(t,"type")&&t.type&&(this.type=t.type),super.set(t),this}_createNewOscillator(t){if(t!==this._sourceType){this._sourceType=t;const e=wl[t],s=this.now();if(this._oscillator){const n=this._oscillator;n.stop(s),this.context.setTimeout(()=>n.dispose(),this.blockTime)}this._oscillator=new e({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(t){this._oscillator.phase=t}get sourceType(){return this._sourceType}set sourceType(t){let e="sine";this._oscillator.type!=="pwm"&&this._oscillator.type!=="pulse"&&(e=this._oscillator.type),t==="fm"?this.type="fm"+e:t==="am"?this.type="am"+e:t==="fat"?this.type="fat"+e:t==="oscillator"?this.type=e:t==="pulse"?this.type="pulse":t==="pwm"&&(this.type="pwm")}_getOscType(t,e){return t instanceof wl[e]}get baseType(){return this._oscillator.baseType}set baseType(t){!this._getOscType(this._oscillator,"pulse")&&!this._getOscType(this._oscillator,"pwm")&&t!=="pulse"&&t!=="pwm"&&(this._oscillator.baseType=t)}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(t){this._getOscType(this._oscillator,"fat")&&Ds(t)&&(this._oscillator.count=t)}get spread(){if(this._getOscType(this._oscillator,"fat"))return this._oscillator.spread}set spread(t){this._getOscType(this._oscillator,"fat")&&Ds(t)&&(this._oscillator.spread=t)}get modulationType(){if(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))return this._oscillator.modulationType}set modulationType(t){(this._getOscType(this._oscillator,"fm")||this._getOscType(this._oscillator,"am"))&&ds(t)&&(this._oscillator.modulationType=t)}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(t=1024){return qt(this,void 0,void 0,function*(){return pn(this,t)})}dispose(){return super.dispose(),this.detune.dispose(),this.frequency.dispose(),this._oscillator.dispose(),this}}class lc extends Ot{constructor(){super(Object.assign($(lc.getDefaults(),arguments,["value"]))),this.override=!1,this.name="Add",this._sum=new St({context:this.context}),this.input=this._sum,this.output=this._sum,this.addend=this._param,Mi(this._constantSource,this._sum)}static getDefaults(){return Object.assign(Ot.getDefaults(),{value:0})}dispose(){return super.dispose(),this._sum.dispose(),this}}class Xr extends fs{constructor(){super(Object.assign($(Xr.getDefaults(),arguments,["min","max"]))),this.name="Scale";const t=$(Xr.getDefaults(),arguments,["min","max"]);this._mult=this.input=new Rs({context:this.context,value:t.max-t.min}),this._add=this.output=new lc({context:this.context,value:t.min}),this._min=t.min,this._max=t.max,this.input.connect(this.output)}static getDefaults(){return Object.assign(fs.getDefaults(),{max:1,min:0})}get min(){return this._min}set min(t){this._min=t,this._setRange()}get max(){return this._max}set max(t){this._max=t,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 hh(i,t=1/0){const e=new WeakMap;return function(s,n){Reflect.defineProperty(s,n,{configurable:!0,enumerable:!0,get:function(){return e.get(this)},set:function(r){je(r,i,t),e.set(this,r)}})}}function xs(i,t=1/0){const e=new WeakMap;return function(s,n){Reflect.defineProperty(s,n,{configurable:!0,enumerable:!0,get:function(){return e.get(this)},set:function(r){je(this.toSeconds(r),i,t),e.set(this,r)}})}}class Ui extends ee{constructor(){super($(Ui.getDefaults(),arguments,["url","onload"])),this.name="Player",this._activeSources=new Set;const t=$(Ui.getDefaults(),arguments,["url","onload"]);this._buffer=new xt({onload:this._onload.bind(this,t.onload),onerror:t.onerror,reverse:t.reverse,url:t.url}),this.autostart=t.autostart,this._loop=t.loop,this._loopStart=t.loopStart,this._loopEnd=t.loopEnd,this._playbackRate=t.playbackRate,this.fadeIn=t.fadeIn,this.fadeOut=t.fadeOut}static getDefaults(){return Object.assign(ee.getDefaults(),{autostart:!1,fadeIn:0,fadeOut:0,loop:!1,loopEnd:0,loopStart:0,onload:yt,onerror:yt,playbackRate:1,reverse:!1})}load(t){return qt(this,void 0,void 0,function*(){return yield this._buffer.load(t),this._onload(),this})}_onload(t=yt){t(),this.autostart&&this.start()}_onSourceEnd(t){this.onstop(this),this._activeSources.delete(t),this._activeSources.size===0&&!this._synced&&this._state.getValueAtTime(this.now())==="started"&&(this._state.cancel(this.now()),this._state.setStateAtTime("stopped",this.now()))}start(t,e,s){return super.start(t,e,s),this}_start(t,e,s){this._loop?e=In(e,this._loopStart):e=In(e,0);const n=this.toSeconds(e),r=s;s=In(s,Math.max(this._buffer.duration-n,0));let o=this.toSeconds(s);o=o/this._playbackRate,t=this.toSeconds(t);const a=new jn({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(t+o),this._state.setStateAtTime("stopped",t+o,{implicitEnd:!0})),this._activeSources.add(a),this._loop&&xe(r)?a.start(t,n):a.start(t,n,o-this.toSeconds(this.fadeOut))}_stop(t){const e=this.toSeconds(t);this._activeSources.forEach(s=>s.stop(e))}restart(t,e,s){return super.restart(t,e,s),this}_restart(t,e,s){var n;(n=[...this._activeSources].pop())===null||n===void 0||n.stop(t),this._start(t,e,s)}seek(t,e){const s=this.toSeconds(e);if(this._state.getValueAtTime(s)==="started"){const n=this.toSeconds(t);this._stop(s),this._start(s,n)}return this}setLoopPoints(t,e){return this.loopStart=t,this.loopEnd=e,this}get loopStart(){return this._loopStart}set loopStart(t){this._loopStart=t,this.buffer.loaded&&je(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach(e=>{e.loopStart=t})}get loopEnd(){return this._loopEnd}set loopEnd(t){this._loopEnd=t,this.buffer.loaded&&je(this.toSeconds(t),0,this.buffer.duration),this._activeSources.forEach(e=>{e.loopEnd=t})}get buffer(){return this._buffer}set buffer(t){this._buffer.set(t)}get loop(){return this._loop}set loop(t){if(this._loop!==t&&(this._loop=t,this._activeSources.forEach(e=>{e.loop=t}),t)){const e=this._state.getNextState("stopped",this.now());e&&this._state.cancel(e.time)}}get playbackRate(){return this._playbackRate}set playbackRate(t){this._playbackRate=t;const e=this.now(),s=this._state.getNextState("stopped",e);s&&s.implicitEnd&&(this._state.cancel(s.time),this._activeSources.forEach(n=>n.cancelStop())),this._activeSources.forEach(n=>{n.playbackRate.setValueAtTime(t,e)})}get reverse(){return this._buffer.reverse}set reverse(t){this._buffer.reverse=t}get loaded(){return this._buffer.loaded}dispose(){return super.dispose(),this._activeSources.forEach(t=>t.dispose()),this._activeSources.clear(),this._buffer.dispose(),this}}Be([xs(0)],Ui.prototype,"fadeIn",void 0);Be([xs(0)],Ui.prototype,"fadeOut",void 0);class e1 extends fs{constructor(){super(...arguments),this.name="GainToAudio",this._norm=new an({context:this.context,mapping:t=>Math.abs(t)*2-1}),this.input=this._norm,this.output=this._norm}dispose(){return super.dispose(),this._norm.dispose(),this}}class Me extends ot{constructor(){super($(Me.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="Envelope",this._sig=new Ot({context:this.context,value:0}),this.output=this._sig,this.input=void 0;const t=$(Me.getDefaults(),arguments,["attack","decay","sustain","release"]);this.attack=t.attack,this.decay=t.decay,this.sustain=t.sustain,this.release=t.release,this.attackCurve=t.attackCurve,this.releaseCurve=t.releaseCurve,this.decayCurve=t.decayCurve}static getDefaults(){return Object.assign(ot.getDefaults(),{attack:.01,attackCurve:"linear",decay:.1,decayCurve:"exponential",release:1,releaseCurve:"exponential",sustain:.5})}get value(){return this.getValueAtTime(this.now())}_getCurve(t,e){if(ds(t))return t;{let s;for(s in Cr)if(Cr[s][e]===t)return s;return t}}_setCurve(t,e,s){if(ds(s)&&Reflect.has(Cr,s)){const n=Cr[s];Ks(n)?t!=="_decayCurve"&&(this[t]=n[e]):this[t]=n}else if(Ue(s)&&t!=="_decayCurve")this[t]=s;else throw new Error("Envelope: invalid curve: "+s)}get attackCurve(){return this._getCurve(this._attackCurve,"In")}set attackCurve(t){this._setCurve("_attackCurve","In",t)}get releaseCurve(){return this._getCurve(this._releaseCurve,"Out")}set releaseCurve(t){this._setCurve("_releaseCurve","Out",t)}get decayCurve(){return this._getCurve(this._decayCurve,"Out")}set decayCurve(t){this._setCurve("_decayCurve","Out",t)}triggerAttack(t,e=1){this.log("triggerAttack",t,e),t=this.toSeconds(t);let n=this.toSeconds(this.attack);const r=this.toSeconds(this.decay),o=this.getValueAtTime(t);if(o>0){const a=1/n;n=(1-o)/a}if(n0){const s=this.toSeconds(this.release);s{let t,e;const s=[];for(t=0;t<128;t++)s[t]=Math.sin(t/(128-1)*(Math.PI/2));const n=[],r=6.4;for(t=0;t<128-1;t++){e=t/(128-1);const d=Math.sin(e*(Math.PI*2)*r-Math.PI/2)+1;n[t]=d/10+e*.83}n[128-1]=1;const o=[],a=5;for(t=0;t<128;t++)o[t]=Math.ceil(t/(128-1)*a)/a;const c=[];for(t=0;t<128;t++)e=t/(128-1),c[t]=.5*(1-Math.cos(Math.PI*e));const l=[];for(t=0;t<128;t++){e=t/(128-1);const d=Math.pow(e,3)*4+.2,p=Math.cos(d*Math.PI*2*e);l[t]=Math.abs(p*(1-e))}function u(d){const p=new Array(d.length);for(let _=0;_this._original_triggerRelease(e);const t=$(ln.getDefaults(),arguments);this._volume=this.output=new Is({context:this.context,volume:t.volume}),this.volume=this._volume.volume,Mt(this,"volume")}static getDefaults(){return Object.assign(ot.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 t=!1;return this._synced||(this._synced=!0,t=!0),t}_syncMethod(t,e){const s=this["_original_"+t]=this[t];this[t]=(...n)=>{const r=n[e],o=this.context.transport.schedule(a=>{n[e]=a,s.apply(this,n)},r);this._scheduledEvents.push(o)}}unsync(){return this._scheduledEvents.forEach(t=>this.context.transport.clear(t)),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(t,e,s,n){const r=this.toSeconds(s),o=this.toSeconds(e);return this.triggerAttack(t,r,n),this.triggerRelease(r+o),this}dispose(){return super.dispose(),this._volume.dispose(),this.unsync(),this._scheduledEvents=[],this}}class ps extends ln{constructor(){super($(ps.getDefaults(),arguments));const t=$(ps.getDefaults(),arguments);this.portamento=t.portamento,this.onsilence=t.onsilence}static getDefaults(){return Object.assign(ln.getDefaults(),{detune:0,onsilence:yt,portamento:0})}triggerAttack(t,e,s=1){this.log("triggerAttack",t,e,s);const n=this.toSeconds(e);return this._triggerEnvelopeAttack(n,s),this.setNote(t,n),this}triggerRelease(t){this.log("triggerRelease",t);const e=this.toSeconds(t);return this._triggerEnvelopeRelease(e),this}setNote(t,e){const s=this.toSeconds(e),n=t instanceof Ee?t.toFrequency():t;if(this.portamento>0&&this.getLevelAtTime(s)>.05){const r=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(n,r,s)}else this.frequency.setValueAtTime(n,s);return this}}Be([xs(0)],ps.prototype,"portamento",void 0);class So extends Me{constructor(){super($(So.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="AmplitudeEnvelope",this._gainNode=new St({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 zi extends ps{constructor(){super($(zi.getDefaults(),arguments)),this.name="Synth";const t=$(zi.getDefaults(),arguments);this.oscillator=new cn(Object.assign({context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)},t.oscillator)),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new So(Object.assign({context:this.context},t.envelope)),this.oscillator.chain(this.envelope,this.output),Mt(this,["oscillator","frequency","detune","envelope"])}static getDefaults(){return Object.assign(ps.getDefaults(),{envelope:Object.assign(On(Me.getDefaults(),Object.keys(ot.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.3}),oscillator:Object.assign(On(cn.getDefaults(),[...Object.keys(ee.getDefaults()),"frequency","detune"]),{type:"triangle"})})}_triggerEnvelopeAttack(t,e){if(this.envelope.triggerAttack(t,e),this.oscillator.start(t),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+s+n)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this}}class ji extends ot{constructor(){super($(ji.getDefaults(),arguments,["frequency","type"])),this.name="BiquadFilter";const t=$(ji.getDefaults(),arguments,["frequency","type"]);this._filter=this.context.createBiquadFilter(),this.input=this.output=this._filter,this.Q=new kt({context:this.context,units:"number",value:t.Q,param:this._filter.Q}),this.frequency=new kt({context:this.context,units:"frequency",value:t.frequency,param:this._filter.frequency}),this.detune=new kt({context:this.context,units:"cents",value:t.detune,param:this._filter.detune}),this.gain=new kt({context:this.context,units:"decibels",convert:!1,value:t.gain,param:this._filter.gain}),this.type=t.type}static getDefaults(){return Object.assign(ot.getDefaults(),{Q:1,type:"lowpass",frequency:350,detune:0,gain:0})}get type(){return this._filter.type}set type(t){ut(["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(t)!==-1,`Invalid filter type: ${t}`),this._filter.type=t}getFrequencyResponse(t=128){const e=new Float32Array(t);for(let o=0;os.type=t)}get rolloff(){return this._rolloff}set rolloff(t){const e=Ds(t)?t:parseInt(t,10),s=[-12,-24,-48,-96];let n=s.indexOf(e);ut(n!==-1,`rolloff can only be ${s.join(", ")}`),n+=1,this._rolloff=e,this.input.disconnect(),this._filters.forEach(r=>r.disconnect()),this._filters=new Array(n);for(let r=0;r1);return this._filters.forEach(()=>{e.getFrequencyResponse(t).forEach((r,o)=>s[o]*=r)}),e.dispose(),s}dispose(){return super.dispose(),this._filters.forEach(t=>{t.dispose()}),nc(this,["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.detune.dispose(),this.gain.dispose(),this}}class Bi extends Me{constructor(){super($(Bi.getDefaults(),arguments,["attack","decay","sustain","release"])),this.name="FrequencyEnvelope";const t=$(Bi.getDefaults(),arguments,["attack","decay","sustain","release"]);this._octaves=t.octaves,this._baseFrequency=this.toFrequency(t.baseFrequency),this._exponent=this.input=new Pi({context:this.context,value:t.exponent}),this._scale=this.output=new Xr({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(Me.getDefaults(),{baseFrequency:200,exponent:1,octaves:4})}get baseFrequency(){return this._baseFrequency}set baseFrequency(t){const e=this.toFrequency(t);je(e,0),this._baseFrequency=e,this._scale.min=this._baseFrequency,this.octaves=this._octaves}get octaves(){return this._octaves}set octaves(t){this._octaves=t,this._scale.max=this._baseFrequency*Math.pow(2,t)}get exponent(){return this._exponent.value}set exponent(t){this._exponent.value=t}dispose(){return super.dispose(),this._exponent.dispose(),this._scale.dispose(),this}}class qi extends ps{constructor(){super($(qi.getDefaults(),arguments)),this.name="MonoSynth";const t=$(qi.getDefaults(),arguments);this.oscillator=new cn(Object.assign(t.oscillator,{context:this.context,detune:t.detune,onstop:()=>this.onsilence(this)})),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new qn(Object.assign(t.filter,{context:this.context})),this.filterEnvelope=new Bi(Object.assign(t.filterEnvelope,{context:this.context})),this.envelope=new So(Object.assign(t.envelope,{context:this.context})),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),Mt(this,["oscillator","frequency","detune","filter","filterEnvelope","envelope"])}static getDefaults(){return Object.assign(ps.getDefaults(),{envelope:Object.assign(On(Me.getDefaults(),Object.keys(ot.getDefaults())),{attack:.005,decay:.1,release:1,sustain:.9}),filter:Object.assign(On(qn.getDefaults(),Object.keys(ot.getDefaults())),{Q:1,rolloff:-12,type:"lowpass"}),filterEnvelope:Object.assign(On(Bi.getDefaults(),Object.keys(ot.getDefaults())),{attack:.6,baseFrequency:200,decay:.2,exponent:2,octaves:3,release:2,sustain:.5}),oscillator:Object.assign(On(cn.getDefaults(),Object.keys(ee.getDefaults())),{type:"sawtooth"})})}_triggerEnvelopeAttack(t,e=1){if(this.envelope.triggerAttack(t,e),this.filterEnvelope.triggerAttack(t),this.oscillator.start(t),this.envelope.sustain===0){const s=this.toSeconds(this.envelope.attack),n=this.toSeconds(this.envelope.decay);this.oscillator.stop(t+s+n)}}_triggerEnvelopeRelease(t){this.envelope.triggerRelease(t),this.filterEnvelope.triggerRelease(t),this.oscillator.stop(t+this.toSeconds(this.envelope.release))}getLevelAtTime(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)}dispose(){return super.dispose(),this.oscillator.dispose(),this.envelope.dispose(),this.filterEnvelope.dispose(),this.filter.dispose(),this}}class Wi extends zi{constructor(){super($(Wi.getDefaults(),arguments)),this.name="MembraneSynth",this.portamento=0;const t=$(Wi.getDefaults(),arguments);this.pitchDecay=t.pitchDecay,this.octaves=t.octaves,Mt(this,["oscillator","envelope"])}static getDefaults(){return Pn(ps.getDefaults(),zi.getDefaults(),{envelope:{attack:.001,attackCurve:"exponential",decay:.4,release:1.4,sustain:.01},octaves:10,oscillator:{type:"sine"},pitchDecay:.05})}setNote(t,e){const s=this.toSeconds(e),n=this.toFrequency(t instanceof Ee?t.toFrequency():t),r=n*this.octaves;return this.oscillator.frequency.setValueAtTime(r,s),this.oscillator.frequency.exponentialRampToValueAtTime(n,s+this.toSeconds(this.pitchDecay)),this}dispose(){return super.dispose(),this}}Be([hh(0)],Wi.prototype,"octaves",void 0);Be([xs(0)],Wi.prototype,"pitchDecay",void 0);const dh=new Set;function uc(i){dh.add(i)}function fh(i,t){const e=`registerProcessor("${i}", ${t})`;dh.add(e)}const s1=` /** * The base AudioWorkletProcessor for use in Tone.js. Works with the [[ToneAudioWorklet]]. */ @@ -180,7 +180,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a }; } } -`;pc(p1);const m1=` +`;uc(s1);const n1=` /** * Abstract class for a single input/output processor. * has a 'generate' function which processes one sample at a time @@ -247,7 +247,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a return !this.disposed; } }; -`;pc(m1);const _1=` +`;uc(n1);const i1=` /** * A multichannel buffer for use within an AudioWorkletProcessor as a delay line */ @@ -291,7 +291,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a return this.buffer[channel][readHead]; } } -`;pc(_1);const g1="feedback-comb-filter",y1=` +`;uc(i1);const r1="feedback-comb-filter",o1=` class FeedbackCombFilterWorklet extends SingleIOProcessor { constructor(options) { @@ -321,7 +321,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a return delayedSample; } } -`;kh(g1,y1);class Yi extends un{constructor(){super($(Yi.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const t=$(Yi.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),e={};Object.keys(t.urls).forEach(s=>{const n=parseInt(s,10);if(ut(Or(s)||Ps(n)&&isFinite(n),`url key is neither a note or midi pitch: ${s}`),Or(s)){const r=new Ae(this.context,s).toMidi();e[r]=t.urls[s]}else Ps(n)&&isFinite(n)&&(e[n]=t.urls[n])}),this._buffers=new hc({urls:e,onload:t.onload,baseUrl:t.baseUrl,onerror:t.onerror}),this.attack=t.attack,this.release=t.release,this.curve=t.curve,this._buffers.loaded&&Promise.resolve().then(t.onload)}static getDefaults(){return Object.assign(un.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:yt,onerror:yt,release:.1,urls:{}})}_findClosest(t){let s=0;for(;s<96;){if(this._buffers.has(t+s))return-s;if(this._buffers.has(t-s))return s;s++}throw new Error(`No available buffers for note: ${t}`)}triggerAttack(t,e,s=1){return this.log("triggerAttack",t,e,s),Array.isArray(t)||(t=[t]),t.forEach(n=>{const r=yh(new Ae(this.context,n).toFrequency()),o=Math.round(r),a=r-o,c=this._findClosest(o),l=o-c,u=this._buffers.get(l),h=gh(c+a),d=new Bn({url:u,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:h}).connect(this.output);d.start(e,0,u.duration/h,s),je(this._activeSources.get(o))||this._activeSources.set(o,[]),this._activeSources.get(o).push(d),d.onended=()=>{if(this._activeSources&&this._activeSources.has(o)){const p=this._activeSources.get(o),_=p.indexOf(d);_!==-1&&p.splice(_,1)}}}),this}triggerRelease(t,e){return this.log("triggerRelease",t,e),Array.isArray(t)||(t=[t]),t.forEach(s=>{const n=new Ae(this.context,s).toMidi();if(this._activeSources.has(n)&&this._activeSources.get(n).length){const r=this._activeSources.get(n);e=this.toSeconds(e),r.forEach(o=>{o.stop(e)}),this._activeSources.set(n,[])}}),this}releaseAll(t){const e=this.toSeconds(t);return this._activeSources.forEach(s=>{for(;s.length;)s.shift().stop(e)}),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(t,e,s,n=1){const r=this.toSeconds(s);return this.triggerAttack(t,r,n),je(e)?(ut(je(t),"notes must be an array when duration is array"),t.forEach((o,a)=>{const c=e[Math.min(a,e.length-1)];this.triggerRelease(o,r+this.toSeconds(c))})):this.triggerRelease(t,r+this.toSeconds(e)),this}add(t,e,s){if(ut(Or(t)||isFinite(t),`note must be a pitch or midi: ${t}`),Or(t)){const n=new Ae(this.context,t).toMidi();this._buffers.add(n,e,s)}else this._buffers.add(t,e,s);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(t=>{t.forEach(e=>e.dispose())}),this._activeSources.clear(),this}}qe([ks(0)],Yi.prototype,"attack",void 0);qe([ks(0)],Yi.prototype,"release",void 0);class so extends ot{constructor(){super(Object.assign($(so.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new f1({context:this.context}),this.a=new St({context:this.context,gain:0}),this.b=new St({context:this.context,gain:0}),this.output=new St({context:this.context}),this._internalChannels=[this.a,this.b];const t=$(so.getDefaults(),arguments,["fade"]);this.fade=new Ot({context:this.context,units:"normalRange",value:t.fade}),Mt(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",Is(this._split,this.a.gain,0),Is(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(ot.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 Ol extends ot{constructor(t){super(t),this.name="Effect",this._dryWet=new so({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new St({context:this.context}),this.effectReturn=new St({context:this.context}),this.input=new St({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(t.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],Mt(this,"wet")}static getDefaults(){return Object.assign(ot.getDefaults(),{wet:1})}connectEffect(t){return this._internalChannels.push(t),this.effectSend.chain(t,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class no extends ot{constructor(){super(Object.assign($(no.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const t=$(no.getDefaults(),arguments,["pan"]);this.pan=new kt({context:this.context,param:this._panner.pan,value:t.pan,minValue:-1,maxValue:1}),this._panner.channelCount=t.channelCount,this._panner.channelCountMode="explicit",Mt(this,"pan")}static getDefaults(){return Object.assign(ot.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}const v1="bit-crusher",x1=` +`;fh(r1,o1);class Hi extends ln{constructor(){super($(Hi.getDefaults(),arguments,["urls","onload","baseUrl"],"urls")),this.name="Sampler",this._activeSources=new Map;const t=$(Hi.getDefaults(),arguments,["urls","onload","baseUrl"],"urls"),e={};Object.keys(t.urls).forEach(s=>{const n=parseInt(s,10);if(ut(br(s)||Ds(n)&&isFinite(n),`url key is neither a note or midi pitch: ${s}`),br(s)){const r=new Ee(this.context,s).toMidi();e[r]=t.urls[s]}else Ds(n)&&isFinite(n)&&(e[n]=t.urls[n])}),this._buffers=new ac({urls:e,onload:t.onload,baseUrl:t.baseUrl,onerror:t.onerror}),this.attack=t.attack,this.release=t.release,this.curve=t.curve,this._buffers.loaded&&Promise.resolve().then(t.onload)}static getDefaults(){return Object.assign(ln.getDefaults(),{attack:0,baseUrl:"",curve:"exponential",onload:yt,onerror:yt,release:.1,urls:{}})}_findClosest(t){let s=0;for(;s<96;){if(this._buffers.has(t+s))return-s;if(this._buffers.has(t-s))return s;s++}throw new Error(`No available buffers for note: ${t}`)}triggerAttack(t,e,s=1){return this.log("triggerAttack",t,e,s),Array.isArray(t)||(t=[t]),t.forEach(n=>{const r=uh(new Ee(this.context,n).toFrequency()),o=Math.round(r),a=r-o,c=this._findClosest(o),l=o-c,u=this._buffers.get(l),h=lh(c+a),d=new jn({url:u,context:this.context,curve:this.curve,fadeIn:this.attack,fadeOut:this.release,playbackRate:h}).connect(this.output);d.start(e,0,u.duration/h,s),Ue(this._activeSources.get(o))||this._activeSources.set(o,[]),this._activeSources.get(o).push(d),d.onended=()=>{if(this._activeSources&&this._activeSources.has(o)){const p=this._activeSources.get(o),_=p.indexOf(d);_!==-1&&p.splice(_,1)}}}),this}triggerRelease(t,e){return this.log("triggerRelease",t,e),Array.isArray(t)||(t=[t]),t.forEach(s=>{const n=new Ee(this.context,s).toMidi();if(this._activeSources.has(n)&&this._activeSources.get(n).length){const r=this._activeSources.get(n);e=this.toSeconds(e),r.forEach(o=>{o.stop(e)}),this._activeSources.set(n,[])}}),this}releaseAll(t){const e=this.toSeconds(t);return this._activeSources.forEach(s=>{for(;s.length;)s.shift().stop(e)}),this}sync(){return this._syncState()&&(this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1)),this}triggerAttackRelease(t,e,s,n=1){const r=this.toSeconds(s);return this.triggerAttack(t,r,n),Ue(e)?(ut(Ue(t),"notes must be an array when duration is array"),t.forEach((o,a)=>{const c=e[Math.min(a,e.length-1)];this.triggerRelease(o,r+this.toSeconds(c))})):this.triggerRelease(t,r+this.toSeconds(e)),this}add(t,e,s){if(ut(br(t)||isFinite(t),`note must be a pitch or midi: ${t}`),br(t)){const n=new Ee(this.context,t).toMidi();this._buffers.add(n,e,s)}else this._buffers.add(t,e,s);return this}get loaded(){return this._buffers.loaded}dispose(){return super.dispose(),this._buffers.dispose(),this._activeSources.forEach(t=>{t.forEach(e=>e.dispose())}),this._activeSources.clear(),this}}Be([xs(0)],Hi.prototype,"attack",void 0);Be([xs(0)],Hi.prototype,"release",void 0);class Qr extends ot{constructor(){super(Object.assign($(Qr.getDefaults(),arguments,["fade"]))),this.name="CrossFade",this._panner=this.context.createStereoPanner(),this._split=this.context.createChannelSplitter(2),this._g2a=new e1({context:this.context}),this.a=new St({context:this.context,gain:0}),this.b=new St({context:this.context,gain:0}),this.output=new St({context:this.context}),this._internalChannels=[this.a,this.b];const t=$(Qr.getDefaults(),arguments,["fade"]);this.fade=new Ot({context:this.context,units:"normalRange",value:t.fade}),Mt(this,"fade"),this.context.getConstant(1).connect(this._panner),this._panner.connect(this._split),this._panner.channelCount=1,this._panner.channelCountMode="explicit",Ps(this._split,this.a.gain,0),Ps(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(ot.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 bl extends ot{constructor(t){super(t),this.name="Effect",this._dryWet=new Qr({context:this.context}),this.wet=this._dryWet.fade,this.effectSend=new St({context:this.context}),this.effectReturn=new St({context:this.context}),this.input=new St({context:this.context}),this.output=this._dryWet,this.input.fan(this._dryWet.a,this.effectSend),this.effectReturn.connect(this._dryWet.b),this.wet.setValueAtTime(t.wet,0),this._internalChannels=[this.effectReturn,this.effectSend],Mt(this,"wet")}static getDefaults(){return Object.assign(ot.getDefaults(),{wet:1})}connectEffect(t){return this._internalChannels.push(t),this.effectSend.chain(t,this.effectReturn),this}dispose(){return super.dispose(),this._dryWet.dispose(),this.effectSend.dispose(),this.effectReturn.dispose(),this.wet.dispose(),this}}class Kr extends ot{constructor(){super(Object.assign($(Kr.getDefaults(),arguments,["pan"]))),this.name="Panner",this._panner=this.context.createStereoPanner(),this.input=this._panner,this.output=this._panner;const t=$(Kr.getDefaults(),arguments,["pan"]);this.pan=new kt({context:this.context,param:this._panner.pan,value:t.pan,minValue:-1,maxValue:1}),this._panner.channelCount=t.channelCount,this._panner.channelCountMode="explicit",Mt(this,"pan")}static getDefaults(){return Object.assign(ot.getDefaults(),{pan:0,channelCount:1})}dispose(){return super.dispose(),this._panner.disconnect(),this.pan.dispose(),this}}const a1="bit-crusher",c1=` class BitCrusherWorklet extends SingleIOProcessor { static get parameterDescriptors() { @@ -340,7 +340,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a return val; } } -`;kh(v1,x1);class io extends ot{constructor(){super($(io.getDefaults(),arguments,["channels"])),this.name="Merge";const t=$(io.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(t.channels)}static getDefaults(){return Object.assign(ot.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class ro extends Ol{constructor(){super($(ro.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const t=$(ro.getDefaults(),arguments,["decay"]);this._decay=t.decay,this._preDelay=t.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(Ol.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(t){t=this.toSeconds(t),Be(t,.001),this._decay=t,this.generate()}get preDelay(){return this._preDelay}set preDelay(t){t=this.toSeconds(t),Be(t,0),this._preDelay=t,this.generate()}generate(){return qt(this,void 0,void 0,function*(){const t=this.ready,e=new Ao(2,this._decay+this._preDelay,this.context.sampleRate),s=new Fi({context:e}),n=new Fi({context:e}),r=new io({context:e});s.connect(r,0,0),n.connect(r,0,1);const o=new St({context:e}).toDestination();r.connect(o),s.start(0),n.start(0),o.gain.setValueAtTime(0,0),o.gain.setValueAtTime(1,this._preDelay),o.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=e.render();return this.ready=a.then(yt),yield t,this._convolver.buffer=(yield a).get(),this})}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class jt extends ot{constructor(){super($(jt.getDefaults(),arguments,["solo"])),this.name="Solo";const t=$(jt.getDefaults(),arguments,["solo"]);this.input=this.output=new St({context:this.context}),jt._allSolos.has(this.context)||jt._allSolos.set(this.context,new Set),jt._allSolos.get(this.context).add(this),this.solo=t.solo}static getDefaults(){return Object.assign(ot.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(t){t?this._addSolo():this._removeSolo(),jt._allSolos.get(this.context).forEach(e=>e._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){jt._soloed.has(this.context)||jt._soloed.set(this.context,new Set),jt._soloed.get(this.context).add(this)}_removeSolo(){jt._soloed.has(this.context)&&jt._soloed.get(this.context).delete(this)}_isSoloed(){return jt._soloed.has(this.context)&&jt._soloed.get(this.context).has(this)}_noSolos(){return!jt._soloed.has(this.context)||jt._soloed.has(this.context)&&jt._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(),jt._allSolos.get(this.context).delete(this),this._removeSolo(),this}}jt._allSolos=new Map;jt._soloed=new Map;class oo extends ot{constructor(){super($(oo.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const t=$(oo.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new no({context:this.context,pan:t.pan,channelCount:t.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Ns({context:this.context,volume:t.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=t.mute,Mt(this,["pan","volume"])}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class Zs extends ot{constructor(){super($(Zs.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const t=$(Zs.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new jt({solo:t.solo,context:this.context}),this._panVol=this.output=new oo({context:this.context,pan:t.pan,volume:t.volume,mute:t.mute,channelCount:t.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Mt(this,["pan","volume"])}static getDefaults(){return Object.assign(ot.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(t){this._solo.solo=t}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(t){this._panVol.mute=t}_getBus(t){return Zs.buses.has(t)||Zs.buses.set(t,new St({context:this.context})),Zs.buses.get(t)}send(t,e=0){const s=this._getBus(t),n=new St({context:this.context,units:"decibels",gain:e});return this.connect(n),n.connect(s),n}receive(t){return this._getBus(t).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}Zs.buses=new Map;class k1 extends ot{constructor(){super(...arguments),this.name="Listener",this.positionX=new kt({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new kt({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new kt({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new kt({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new kt({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new kt({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new kt({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new kt({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new kt({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(ot.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}}Eo(i=>{i.listener=new k1({context:i})});Oo(i=>{i.listener.dispose()});Ve().transport;const mc=Ve().destination;Ve().destination;Ve().listener;Ve().draw;Ve();const _c=new Wn(900,"highpass"),Th=new Ns(-6);Th.chain(_c,mc);const T1=new ro(3).connect(Th),Po=new Hi({envelope:{attack:0,decay:.9,sustain:.2,release:.1}});Po.oscillator.type="triangle2";Po.volume.value=-6;Po.chain(_c,mc);const Io=new Hi({envelope:{attack:.4,decay:.9,sustain:.7,release:.6}}).connect(T1);Io.oscillator.type="triangle";Io.volume.value=-6;Io.chain(_c,mc);function w1(){return Math.floor((Math.random()-.5)*20)}let Al=!1;const b1=async(i=0)=>{Al||(await Ky(),Al=!0);try{if(i>2e3)Io.triggerAttackRelease(60,.3);else if(i>1e3){let t=310;t+=w1(),Po.triggerAttackRelease(t,.001)}}catch(t){console.warn(t)}},Mr=1800,C1=(i,t)=>i.clone().normalize().clone().negate().normalize().multiplyScalar(t).add(i),S1=(i,t,e,s,n)=>{const r=new ou,o=1e-5;r.absarc(o,o,o,-Math.PI/2,-Math.PI,!0),r.absarc(o,t-s*2,o,Math.PI,Math.PI/2,!0),r.absarc(i-s*2,t-s*2,o,Math.PI/2,0,!0),r.absarc(i-s*2,o,o,0,-Math.PI/2,!0);const a=new Vf(r,{depth:e-s*2,bevelEnabled:!0,bevelSegments:n,steps:2,bevelSize:s,bevelThickness:s,curveSegments:n});a.center();const c=[],l=a.getAttribute("normal"),u=a.getAttribute("position");for(let h=0;h.9?(_=p.x/i+.5,f=1-(p.z/e+.5)):Math.abs(d.x)>.9?(_=-p.z/e+.5,f=1-(-p.y/t+.5)):Math.abs(d.z)>.9&&(_=p.x/i+.5,f=1-(-p.y/t+.5)),c.push(_,f)}return a.setAttribute("uv",new Nr(c,2)),a};S1(10,10,10,2,10);const Ml=new Lf(10,10,10),E1=500,O1=800,A1=new rt(0,0,0),ao=.5,M1=16777215,D1=50,P1=(i,t)=>{var r,o;if(!(i!=null&&i.ref_id)||!(t!=null&&t.ref_id))return!1;let e=!1;const s=i.guests,n=t.guests;return((r=i.children)!=null&&r.includes(t.ref_id)||(o=t.children)!=null&&o.includes(i.ref_id))&&(e=!0),(s!=null&&s.find(a=>a.ref_id===t.ref_id)||n!=null&&n.find(a=>a.ref_id===i.ref_id))&&(e=!0),e};let gi=null;const I1=500,wh=(i,t)=>{if(gi)return null;gi=setTimeout(()=>{gi&&(clearTimeout(gi),gi=null)},I1);const e=[];return i.forEach(n=>{const r=t.position.distanceTo(A1.set(n.x,n.y,n.z));rn.distance-r.distance).slice(0,E1).map(n=>n.id)};let bn,yi;const N1=1e3,R1=2e3,F1=i=>{const t=We(),e=Os(x=>x.isUserDragging),s=Os(x=>x.isUserScrolling),n=Os(x=>x.setUserMovedCamera),{data:r,graphStyle:o,showSelectionGraph:a,setNearbyNodeIds:c,cameraFocusTrigger:l,graphRadius:u}=oe(x=>x),{camera:h}=It(),[d,p]=D.useState(!1),[_,f]=D.useState(!1),[m,v]=D.useState(ol),b=D.useMemo(()=>{if(a)return new rt(0,0,0);const x=r==null?void 0:r.nodes.find(P=>P.ref_id===(t==null?void 0:t.ref_id)),C=u+300;let O=new rt(0,0,C);if(x&&r){const P=r==null?void 0:r.nodes.filter(G=>{var z;return(z=x.children)==null?void 0:z.find(j=>j===G.id)}),M=new rt(x.x,x.y,x.z);let V=new rt(0,0,0);P.map(G=>(V=V.add(new rt(G.x,G.y,G.z).normalize()),G));const B=x.scale?1-1/(x.scale+10):1,Y=M.sub(V).multiplyScalar(.8*B);O=M.add(Y)}return O},[a,t,r,u]),w=D.useMemo(()=>{if(a)return new rt(0,0,0);const x=r==null?void 0:r.nodes.find(C=>C.ref_id===(t==null?void 0:t.ref_id));return new rt((x==null?void 0:x.x)||0,(x==null?void 0:x.y)||0,(x==null?void 0:x.z)||0)},[a,t,r]);D.useEffect(()=>{var x;a&&((x=i.current)==null||x.setLookAt($o.x,$o.y,$o.z,0,0,0,!1)),g()},[a]),D.useEffect(()=>{a?v(E0):(t==null?void 0:t.node_type)==="topic"?v(S0):v(ol)},[t,v,a]),D.useEffect(()=>{y()},[l]),D.useEffect(()=>{(e||s)&&(p(!0),f(!0))},[e,s,p,f]),D.useEffect(()=>{if(t)if(!a&&o==="earth"&&(i!=null&&i.current)){const x=i.current.camera.position.distanceTo(new rt),C=C1(w,-x/2);i.current.setLookAt(C.x,C.y,C.z,0,0,0,!0)}else bn&&clearTimeout(bn),bn=setTimeout(()=>{f(!0),clearTimeout(bn)},R1),g();return()=>{bn&&clearTimeout(bn),yi&&clearTimeout(yi)}},[t]),be(x=>{i.current&&(d||k(b,x.camera),_||T(w,x.camera))});const g=()=>{if(t){const x=h.position.distanceTo(b);b1(x)}y()},y=()=>{p(!1),f(!1),n(!1),yi&&clearTimeout(yi),yi=setTimeout(()=>{p(!0),f(!0)},N1)},k=(x,C)=>{if(C.position.distanceTo(x){var O;(O=i==null?void 0:i.current)==null||O.setLookAt(C.position.x,C.position.y,C.position.z,x.x,x.y,x.z,!0)};return null},L1=1;let Dr=null;const V1=(i,{enabled:t})=>{const e=We();F1(i);const s=Os(a=>a.isUserDragging),{graphStyle:n,graphRadius:r,disableCameraRotation:o}=oe(a=>a);return D.useEffect(()=>{t||(Dr==null||Dr.kill(),Dr=null)},[t]),D.useEffect(()=>{i.current&&r&&(n==="sphere"?(i.current.maxDistance=8e3,i.current.minDistance=200,i.current.setTarget(0,0,500,!0)):(i.current.maxDistance=i.current.getDistanceToFitSphere(r+200),i.current.minDistance=100))},[r,n,i]),D.useEffect(()=>{!e&&i.current&&i.current.setLookAt(bi.x,bi.y,r,0,0,0,!0)},[e,r]),be((a,c)=>{i.current&&(!o&&!s&&(i.current.azimuthAngle+=L1*c*Uf.DEG2RAD),i.current.update(c))}),null},U1=({disableAnimations:i})=>{const t=D.useRef(null),{data:e,setNearbyNodeIds:s,setDisableCameraRotation:n}=oe(h=>h),[r]=D.useState(.8),{camera:o}=It(),[a,c,l,u]=Os(h=>[h.isUserDragging,h.setIsUserDragging,h.isUserScrolling,h.isUserScrollingOnHtmlPanel]);return V1(t,{enabled:!i&&!l&&!a}),D.useEffect(()=>{if(!a){const h=wh((e==null?void 0:e.nodes)||[],o);h&&s(h)}},[o,o.position,o.position.x,o.position.y,o.position.z,e==null?void 0:e.nodes,s,a]),D.useEffect(()=>{a&&n(!0)},[a,n]),L.jsx(r0,{ref:t,boundaryEnclosesCamera:!0,enabled:!u,makeDefault:!0,maxDistance:12e3,minDistance:100,onEnd:()=>c(!1),onStart:()=>c(!0),smoothTime:r})};function us(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function bh(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,i.__proto__=t}/*! +`;fh(a1,c1);class Jr extends ot{constructor(){super($(Jr.getDefaults(),arguments,["channels"])),this.name="Merge";const t=$(Jr.getDefaults(),arguments,["channels"]);this._merger=this.output=this.input=this.context.createChannelMerger(t.channels)}static getDefaults(){return Object.assign(ot.getDefaults(),{channels:2})}dispose(){return super.dispose(),this._merger.disconnect(),this}}class to extends bl{constructor(){super($(to.getDefaults(),arguments,["decay"])),this.name="Reverb",this._convolver=this.context.createConvolver(),this.ready=Promise.resolve();const t=$(to.getDefaults(),arguments,["decay"]);this._decay=t.decay,this._preDelay=t.preDelay,this.generate(),this.connectEffect(this._convolver)}static getDefaults(){return Object.assign(bl.getDefaults(),{decay:1.5,preDelay:.01})}get decay(){return this._decay}set decay(t){t=this.toSeconds(t),je(t,.001),this._decay=t,this.generate()}get preDelay(){return this._preDelay}set preDelay(t){t=this.toSeconds(t),je(t,0),this._preDelay=t,this.generate()}generate(){return qt(this,void 0,void 0,function*(){const t=this.ready,e=new bo(2,this._decay+this._preDelay,this.context.sampleRate),s=new Ni({context:e}),n=new Ni({context:e}),r=new Jr({context:e});s.connect(r,0,0),n.connect(r,0,1);const o=new St({context:e}).toDestination();r.connect(o),s.start(0),n.start(0),o.gain.setValueAtTime(0,0),o.gain.setValueAtTime(1,this._preDelay),o.gain.exponentialApproachValueAtTime(0,this._preDelay,this.decay);const a=e.render();return this.ready=a.then(yt),yield t,this._convolver.buffer=(yield a).get(),this})}dispose(){return super.dispose(),this._convolver.disconnect(),this}}class zt extends ot{constructor(){super($(zt.getDefaults(),arguments,["solo"])),this.name="Solo";const t=$(zt.getDefaults(),arguments,["solo"]);this.input=this.output=new St({context:this.context}),zt._allSolos.has(this.context)||zt._allSolos.set(this.context,new Set),zt._allSolos.get(this.context).add(this),this.solo=t.solo}static getDefaults(){return Object.assign(ot.getDefaults(),{solo:!1})}get solo(){return this._isSoloed()}set solo(t){t?this._addSolo():this._removeSolo(),zt._allSolos.get(this.context).forEach(e=>e._updateSolo())}get muted(){return this.input.gain.value===0}_addSolo(){zt._soloed.has(this.context)||zt._soloed.set(this.context,new Set),zt._soloed.get(this.context).add(this)}_removeSolo(){zt._soloed.has(this.context)&&zt._soloed.get(this.context).delete(this)}_isSoloed(){return zt._soloed.has(this.context)&&zt._soloed.get(this.context).has(this)}_noSolos(){return!zt._soloed.has(this.context)||zt._soloed.has(this.context)&&zt._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(),zt._allSolos.get(this.context).delete(this),this._removeSolo(),this}}zt._allSolos=new Map;zt._soloed=new Map;class eo extends ot{constructor(){super($(eo.getDefaults(),arguments,["pan","volume"])),this.name="PanVol";const t=$(eo.getDefaults(),arguments,["pan","volume"]);this._panner=this.input=new Kr({context:this.context,pan:t.pan,channelCount:t.channelCount}),this.pan=this._panner.pan,this._volume=this.output=new Is({context:this.context,volume:t.volume}),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=t.mute,Mt(this,["pan","volume"])}static getDefaults(){return Object.assign(ot.getDefaults(),{mute:!1,pan:0,volume:0,channelCount:1})}get mute(){return this._volume.mute}set mute(t){this._volume.mute=t}dispose(){return super.dispose(),this._panner.dispose(),this.pan.dispose(),this._volume.dispose(),this.volume.dispose(),this}}class $s extends ot{constructor(){super($($s.getDefaults(),arguments,["volume","pan"])),this.name="Channel";const t=$($s.getDefaults(),arguments,["volume","pan"]);this._solo=this.input=new zt({solo:t.solo,context:this.context}),this._panVol=this.output=new eo({context:this.context,pan:t.pan,volume:t.volume,mute:t.mute,channelCount:t.channelCount}),this.pan=this._panVol.pan,this.volume=this._panVol.volume,this._solo.connect(this._panVol),Mt(this,["pan","volume"])}static getDefaults(){return Object.assign(ot.getDefaults(),{pan:0,volume:0,mute:!1,solo:!1,channelCount:1})}get solo(){return this._solo.solo}set solo(t){this._solo.solo=t}get muted(){return this._solo.muted||this.mute}get mute(){return this._panVol.mute}set mute(t){this._panVol.mute=t}_getBus(t){return $s.buses.has(t)||$s.buses.set(t,new St({context:this.context})),$s.buses.get(t)}send(t,e=0){const s=this._getBus(t),n=new St({context:this.context,units:"decibels",gain:e});return this.connect(n),n.connect(s),n}receive(t){return this._getBus(t).connect(this),this}dispose(){return super.dispose(),this._panVol.dispose(),this.pan.dispose(),this.volume.dispose(),this._solo.dispose(),this}}$s.buses=new Map;class l1 extends ot{constructor(){super(...arguments),this.name="Listener",this.positionX=new kt({context:this.context,param:this.context.rawContext.listener.positionX}),this.positionY=new kt({context:this.context,param:this.context.rawContext.listener.positionY}),this.positionZ=new kt({context:this.context,param:this.context.rawContext.listener.positionZ}),this.forwardX=new kt({context:this.context,param:this.context.rawContext.listener.forwardX}),this.forwardY=new kt({context:this.context,param:this.context.rawContext.listener.forwardY}),this.forwardZ=new kt({context:this.context,param:this.context.rawContext.listener.forwardZ}),this.upX=new kt({context:this.context,param:this.context.rawContext.listener.upX}),this.upY=new kt({context:this.context,param:this.context.rawContext.listener.upY}),this.upZ=new kt({context:this.context,param:this.context.rawContext.listener.upZ})}static getDefaults(){return Object.assign(ot.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}}To(i=>{i.listener=new l1({context:i})});wo(i=>{i.listener.dispose()});Le().transport;const hc=Le().destination;Le().destination;Le().listener;Le().draw;Le();const dc=new qn(900,"highpass"),ph=new Is(-6);ph.chain(dc,hc);const u1=new to(3).connect(ph),Eo=new qi({envelope:{attack:0,decay:.9,sustain:.2,release:.1}});Eo.oscillator.type="triangle2";Eo.volume.value=-6;Eo.chain(dc,hc);const Oo=new qi({envelope:{attack:.4,decay:.9,sustain:.7,release:.6}}).connect(u1);Oo.oscillator.type="triangle";Oo.volume.value=-6;Oo.chain(dc,hc);function h1(){return Math.floor((Math.random()-.5)*20)}let Cl=!1;const d1=async(i=0)=>{Cl||(await zy(),Cl=!0);try{if(i>2e3)Oo.triggerAttackRelease(60,.3);else if(i>1e3){let t=310;t+=h1(),Eo.triggerAttackRelease(t,.001)}}catch(t){console.warn(t)}},Sr=1800,f1=(i,t)=>i.clone().normalize().clone().negate().normalize().multiplyScalar(t).add(i),p1=(i,t,e,s,n)=>{const r=new Jl,o=1e-5;r.absarc(o,o,o,-Math.PI/2,-Math.PI,!0),r.absarc(o,t-s*2,o,Math.PI,Math.PI/2,!0),r.absarc(i-s*2,t-s*2,o,Math.PI/2,0,!0),r.absarc(i-s*2,o,o,0,-Math.PI/2,!0);const a=new Sf(r,{depth:e-s*2,bevelEnabled:!0,bevelSegments:n,steps:2,bevelSize:s,bevelThickness:s,curveSegments:n});a.center();const c=[],l=a.getAttribute("normal"),u=a.getAttribute("position");for(let h=0;h.9?(_=p.x/i+.5,f=1-(p.z/e+.5)):Math.abs(d.x)>.9?(_=-p.z/e+.5,f=1-(-p.y/t+.5)):Math.abs(d.z)>.9&&(_=p.x/i+.5,f=1-(-p.y/t+.5)),c.push(_,f)}return a.setAttribute("uv",new Ar(c,2)),a};p1(10,10,10,2,10);new Cf(10,10,10);const m1=500,_1=800,g1=new rt(0,0,0),so=.5,y1=16777215,v1=50,x1=(i,t)=>{var r,o;if(!(i!=null&&i.ref_id)||!(t!=null&&t.ref_id))return!1;let e=!1;const s=i.guests,n=t.guests;return((r=i.children)!=null&&r.includes(t.ref_id)||(o=t.children)!=null&&o.includes(i.ref_id))&&(e=!0),(s!=null&&s.find(a=>a.ref_id===t.ref_id)||n!=null&&n.find(a=>a.ref_id===i.ref_id))&&(e=!0),e};let mi=null;const k1=500,mh=(i,t)=>{if(mi)return null;mi=setTimeout(()=>{mi&&(clearTimeout(mi),mi=null)},k1);const e=[];return i.forEach(n=>{const r=t.position.distanceTo(g1.set(n.x,n.y,n.z));r<_1&&e.push({id:n.ref_id||"",distance:r})}),e.sort((n,r)=>n.distance-r.distance).slice(0,m1).map(n=>n.id)};let wn,_i;const T1=1e3,w1=2e3,b1=i=>{const t=ts(),e=Es(x=>x.isUserDragging),s=Es(x=>x.isUserScrolling),n=Es(x=>x.setUserMovedCamera),{data:r,graphStyle:o,showSelectionGraph:a,setNearbyNodeIds:c,cameraFocusTrigger:l,graphRadius:u}=pe(x=>x),{camera:h}=It(),[d,p]=D.useState(!1),[_,f]=D.useState(!1),[m,v]=D.useState(sl),b=D.useMemo(()=>{if(a)return new rt(0,0,0);const x=r==null?void 0:r.nodes.find(I=>I.ref_id===(t==null?void 0:t.ref_id)),C=u+300;let O=new rt(0,0,C);if(x&&r){const I=r==null?void 0:r.nodes.filter(Y=>{var j;return(j=x.children)==null?void 0:j.find(z=>z===Y.id)}),M=new rt(x.x,x.y,x.z);let V=new rt(0,0,0);I.map(Y=>(V=V.add(new rt(Y.x,Y.y,Y.z).normalize()),Y));const W=x.scale?1-1/(x.scale+10):1,G=M.sub(V).multiplyScalar(.8*W);O=M.add(G)}return O},[a,t,r,u]),w=D.useMemo(()=>{if(a)return new rt(0,0,0);const x=r==null?void 0:r.nodes.find(C=>C.ref_id===(t==null?void 0:t.ref_id));return new rt((x==null?void 0:x.x)||0,(x==null?void 0:x.y)||0,(x==null?void 0:x.z)||0)},[a,t,r]);D.useEffect(()=>{var x;a&&((x=i.current)==null||x.setLookAt(qo.x,qo.y,qo.z,0,0,0,!1)),g()},[a]),D.useEffect(()=>{a?v(m0):(t==null?void 0:t.node_type)==="topic"?v(p0):v(sl)},[t,v,a]),D.useEffect(()=>{y()},[l]),D.useEffect(()=>{(e||s)&&(p(!0),f(!0))},[e,s,p,f]),D.useEffect(()=>{if(t)if(!a&&o==="earth"&&(i!=null&&i.current)){const x=i.current.camera.position.distanceTo(new rt),C=f1(w,-x/2);i.current.setLookAt(C.x,C.y,C.z,0,0,0,!0)}else wn&&clearTimeout(wn),wn=setTimeout(()=>{f(!0),clearTimeout(wn)},w1),g();return()=>{wn&&clearTimeout(wn),_i&&clearTimeout(_i)}},[t]),Pe(x=>{i.current&&(d||k(b,x.camera),_||T(w,x.camera))});const g=()=>{if(t){const x=h.position.distanceTo(b);d1(x)}y()},y=()=>{p(!1),f(!1),n(!1),_i&&clearTimeout(_i),_i=setTimeout(()=>{p(!0),f(!0)},T1)},k=(x,C)=>{if(C.position.distanceTo(x){var O;(O=i==null?void 0:i.current)==null||O.setLookAt(C.position.x,C.position.y,C.position.z,x.x,x.y,x.z,!0)};return null},C1=1;let Er=null;const S1=(i,{enabled:t})=>{const e=ts();b1(i);const s=Es(a=>a.isUserDragging),{graphStyle:n,graphRadius:r,disableCameraRotation:o}=pe(a=>a);return D.useEffect(()=>{t||(Er==null||Er.kill(),Er=null)},[t]),D.useEffect(()=>{i.current&&r&&(n==="sphere"?(i.current.maxDistance=8e3,i.current.minDistance=200,i.current.setTarget(0,0,500,!0)):(i.current.maxDistance=i.current.getDistanceToFitSphere(r+200),i.current.minDistance=100))},[r,n,i]),D.useEffect(()=>{!e&&i.current&&i.current.setLookAt(Ti.x,Ti.y,r,0,0,0,!0)},[e,r]),Pe((a,c)=>{i.current&&(!o&&!s&&(i.current.azimuthAngle+=C1*c*Ef.DEG2RAD),i.current.update(c))}),null},E1=({disableAnimations:i})=>{const t=D.useRef(null),{data:e,setNearbyNodeIds:s,setDisableCameraRotation:n}=pe(h=>h),[r]=D.useState(.8),{camera:o}=It(),[a,c,l,u]=Es(h=>[h.isUserDragging,h.setIsUserDragging,h.isUserScrolling,h.isUserScrollingOnHtmlPanel]);return S1(t,{enabled:!i&&!l&&!a}),D.useEffect(()=>{if(!a){const h=mh((e==null?void 0:e.nodes)||[],o);h&&s(h)}},[o,o.position,o.position.x,o.position.y,o.position.z,e==null?void 0:e.nodes,s,a]),D.useEffect(()=>{a&&n(!0)},[a,n]),L.jsx(Gf,{ref:t,boundaryEnclosesCamera:!0,enabled:!u,makeDefault:!0,maxDistance:12e3,minDistance:100,onEnd:()=>c(!1),onStart:()=>c(!0),smoothTime:r})};function ls(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function _h(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,i.__proto__=t}/*! * GSAP 3.12.4 * https://gsap.com * @@ -348,7 +348,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a * 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 Te={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Hn={duration:.5,overwrite:!1,delay:0},gc,Jt,Lt,Me=1e8,Ct=1/Me,ka=Math.PI*2,j1=ka/4,z1=0,Ch=Math.sqrt,B1=Math.cos,q1=Math.sin,Xt=function(t){return typeof t=="string"},Vt=function(t){return typeof t=="function"},_s=function(t){return typeof t=="number"},yc=function(t){return typeof t>"u"},es=function(t){return typeof t=="object"},he=function(t){return t!==!1},vc=function(){return typeof window<"u"},Pr=function(t){return Vt(t)||Xt(t)},Sh=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},te=Array.isArray,Ta=/(?:-?\.?\d|\.)+/gi,Eh=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Dn=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Qo=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,Oh=/[+-]=-?[.\d]+/,Ah=/[^,'"\[\]\s]+/gi,W1=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Nt,Ee,wa,xc,we={},co={},Mh,Dh=function(t){return(co=hn(t,we))&&_e},kc=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},$i=function(t,e){return!e&&console.warn(t)},Ph=function(t,e){return t&&(we[t]=e)&&co&&(co[t]=e)||we},Zi=function(){return 0},H1={suppressEvents:!0,isStart:!0,kill:!1},Lr={suppressEvents:!0,kill:!1},G1={suppressEvents:!0},Tc={},Ms=[],ba={},Ih,ye={},Ko={},Dl=30,Vr=[],wc="",bc=function(t){var e=t[0],s,n;if(es(e)||Vt(e)||(t=[t]),!(s=(e._gsap||{}).harness)){for(n=Vr.length;n--&&!Vr[n].targetTest(e););s=Vr[n]}for(n=t.length;n--;)t[n]&&(t[n]._gsap||(t[n]._gsap=new nd(t[n],s)))||t.splice(n,1);return t},en=function(t){return t._gsap||bc(De(t))[0]._gsap},Nh=function(t,e,s){return(s=t[e])&&Vt(s)?t[e]():yc(s)&&t.getAttribute&&t.getAttribute(e)||s},de=function(t,e){return(t=t.split(",")).forEach(e)||t},zt=function(t){return Math.round(t*1e5)/1e5||0},$t=function(t){return Math.round(t*1e7)/1e7||0},Rn=function(t,e){var s=e.charAt(0),n=parseFloat(e.substr(2));return t=parseFloat(t),s==="+"?t+n:s==="-"?t-n:s==="*"?t*n:t/n},Y1=function(t,e){for(var s=e.length,n=0;t.indexOf(e[n])<0&&++na;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[s],t[s]=e),e._next?e._next._prev=e:t[n]=e,e._prev=o,e.parent=e._dp=t,e},No=function(t,e,s,n){s===void 0&&(s="_first"),n===void 0&&(n="_last");var r=e._prev,o=e._next;r?r._next=o:t[s]===e&&(t[s]=o),o?o._prev=r:t[n]===e&&(t[n]=r),e._next=e._prev=e.parent=null},Ls=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},sn=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var s=t;s;)s._dirty=1,s=s.parent;return t},X1=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},Ca=function(t,e,s,n){return t._startAt&&(Jt?t._startAt.revert(Lr):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,n))},Q1=function i(t){return!t||t._ts&&i(t.parent)},Il=function(t){return t._repeat?Gn(t._tTime,t=t.duration()+t._rDelay)*t:0},Gn=function(t,e){var s=Math.floor(t/=e);return t&&s===t?s-1:s},ho=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Ro=function(t){return t._end=$t(t._start+(t._tDur/Math.abs(t._ts||t._rts||Ct)||0))},Fo=function(t,e){var s=t._dp;return s&&s.smoothChildTiming&&t._ts&&(t._start=$t(s._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ro(t),s._dirty||sn(s,t)),t},Uh=function(t,e){var s;if((e._time||!e._dur&&e._initted||e._startCt)&&e.render(s,!0)),sn(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur=0&&s.totalTime(s._tTime),s=s._dp;t._zTime=-Ct}},Xe=function(t,e,s,n){return e.parent&&Ls(e),e._start=$t((_s(s)?s:s||t!==Nt?Se(t,s,e):t._time)+e._delay),e._end=$t(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Vh(t,e,"_first","_last",t._sort?"_start":0),Sa(e)||(t._recent=e),n||Uh(t,e),t._ts<0&&Fo(t,t._tTime),t},jh=function(t,e){return(we.ScrollTrigger||kc("scrollTrigger",e))&&we.ScrollTrigger.create(e,t)},zh=function(t,e,s,n,r){if(Sc(t,e,r),!t._initted)return 1;if(!s&&t._pt&&!Jt&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Ih!==ve.frame)return Ms.push(t),t._lazy=[r,n],1},K1=function i(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||i(e))},Sa=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},J1=function(t,e,s,n){var r=t.ratio,o=e<0||!e&&(!t._start&&K1(t)&&!(!t._initted&&Sa(t))||(t._ts<0||t._dp._ts<0)&&!Sa(t))?0:1,a=t._rDelay,c=0,l,u,h;if(a&&t._repeat&&(c=pr(0,t._tDur,e),u=Gn(c,a),t._yoyo&&u&1&&(o=1-o),u!==Gn(t._tTime,a)&&(r=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==r||Jt||n||t._zTime===Ct||!e&&t._zTime){if(!t._initted&&zh(t,e,n,s,c))return;for(h=t._zTime,t._zTime=e||(s?Ct:0),s||(s=e&&!h),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=c,l=t._pt;l;)l.r(o,l.d),l=l._next;e<0&&Ca(t,e,s,!0),t._onUpdate&&!s&&xe(t,"onUpdate"),c&&t._repeat&&!s&&t.parent&&xe(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&Ls(t,1),!s&&!Jt&&(xe(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},tv=function(t,e,s){var n;if(s>e)for(n=t._first;n&&n._start<=s;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=s;){if(n.data==="isPause"&&n._start0&&!n&&Fo(t,t._tTime=t._tDur*a),t.parent&&Ro(t),s||sn(t.parent,t),t},Nl=function(t){return t instanceof ie?sn(t):Yn(t,t._dur)},ev={_start:0,endTime:Zi,totalDuration:Zi},Se=function i(t,e,s){var n=t.labels,r=t._recent||ev,o=t.duration()>=Me?r.endTime(!1):t._dur,a,c,l;return Xt(e)&&(isNaN(e)||e in n)?(c=e.charAt(0),l=e.substr(-1)==="%",a=e.indexOf("="),c==="<"||c===">"?(a>=0&&(e=e.replace(/=/,"")),(c==="<"?r._start:r.endTime(r._repeat>=0))+(parseFloat(e.substr(1))||0)*(l?(a<0?r:s).totalDuration()/100:1)):a<0?(e in n||(n[e]=o),n[e]):(c=parseFloat(e.charAt(a-1)+e.substr(a+1)),l&&s&&(c=c/100*(te(s)?s[0]:s).totalDuration()),a>1?i(t,e.substr(0,a-1),s)+c:o+c)):e==null?o:+e},Ei=function(t,e,s){var n=_s(e[1]),r=(n?2:1)+(t<2?0:1),o=e[r],a,c;if(n&&(o.duration=e[1]),o.parent=s,t){for(a=o,c=s;c&&!("immediateRender"in a);)a=c.vars.defaults||{},c=he(c.vars.inherit)&&c.parent;o.immediateRender=he(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[r-1]}return new Ht(e[0],o,e[r+1])},Bs=function(t,e){return t||t===0?e(t):e},pr=function(t,e,s){return se?e:s},Kt=function(t,e){return!Xt(t)||!(e=W1.exec(t))?"":e[1]},sv=function(t,e,s){return Bs(s,function(n){return pr(t,e,n)})},Ea=[].slice,Bh=function(t,e){return t&&es(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&es(t[0]))&&!t.nodeType&&t!==Ee},nv=function(t,e,s){return s===void 0&&(s=[]),t.forEach(function(n){var r;return Xt(n)&&!e||Bh(n,1)?(r=s).push.apply(r,De(n)):s.push(n)})||s},De=function(t,e,s){return Lt&&!e&&Lt.selector?Lt.selector(t):Xt(t)&&!s&&(wa||!$n())?Ea.call((e||xc).querySelectorAll(t),0):te(t)?nv(t,s):Bh(t)?Ea.call(t,0):t?[t]:[]},Oa=function(t){return t=De(t)[0]||$i("Invalid scope")||{},function(e){var s=t.current||t.nativeElement||t;return De(e,s.querySelectorAll?s:s===t?$i("Invalid scope")||xc.createElement("div"):t)}},qh=function(t){return t.sort(function(){return .5-Math.random()})},Wh=function(t){if(Vt(t))return t;var e=es(t)?t:{each:t},s=nn(e.ease),n=e.from||0,r=parseFloat(e.base)||0,o={},a=n>0&&n<1,c=isNaN(n)||a,l=e.axis,u=n,h=n;return Xt(n)?u=h={center:.5,edges:.5,end:1}[n]||0:!a&&c&&(u=n[0],h=n[1]),function(d,p,_){var f=(_||e).length,m=o[f],v,b,w,g,y,k,T,x,C;if(!m){if(C=e.grid==="auto"?0:(e.grid||[1,Me])[1],!C){for(T=-Me;T<(T=_[C++].getBoundingClientRect().left)&&CT&&(T=y),yf?f-1:l?l==="y"?f/C:C:Math.max(C,f/C))||0)*(n==="edges"?-1:1),m.b=f<0?r-f:r,m.u=Kt(e.amount||e.each)||0,s=s&&f<0?td(s):s}return f=(m[d]-m.min)/m.max||0,$t(m.b+(s?s(f):f)*m.v)+m.u}},Aa=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(s){var n=$t(Math.round(parseFloat(s)/t)*t*e);return(n-n%1)/e+(_s(s)?0:Kt(s))}},Hh=function(t,e){var s=te(t),n,r;return!s&&es(t)&&(n=s=t.radius||Me,t.values?(t=De(t.values),(r=!_s(t[0]))&&(n*=n)):t=Aa(t.increment)),Bs(e,s?Vt(t)?function(o){return r=t(o),Math.abs(r-o)<=n?r:o}:function(o){for(var a=parseFloat(r?o.x:o),c=parseFloat(r?o.y:0),l=Me,u=0,h=t.length,d,p;h--;)r?(d=t[h].x-a,p=t[h].y-c,d=d*d+p*p):d=Math.abs(t[h]-a),dn?r-o:o)})},Xi=function(t){for(var e=0,s="",n,r,o,a;~(n=t.indexOf("random(",e));)o=t.indexOf(")",n),a=t.charAt(n+7)==="[",r=t.substr(n+7,o-n-7).match(a?Ah:Ta),s+=t.substr(e,n-e)+Gh(a?r:+r[0],a?0:+r[1],+r[2]||1e-5),e=o+1;return s+t.substr(e,t.length-e)},$h=function(t,e,s,n,r){var o=e-t,a=n-s;return Bs(r,function(c){return s+((c-t)/o*a||0)})},lv=function i(t,e,s,n){var r=isNaN(t+e)?0:function(p){return(1-p)*t+p*e};if(!r){var o=Xt(t),a={},c,l,u,h,d;if(s===!0&&(n=1)&&(s=null),o)t={p:t},e={p:e};else if(te(t)&&!te(e)){for(u=[],h=t.length,d=h-2,l=1;l(a=Math.abs(a))&&(c=o,r=a);return c},xe=function(t,e,s){var n=t.vars,r=n[e],o=Lt,a=t._ctx,c,l,u;if(r)return c=n[e+"Params"],l=n.callbackScope||t,s&&Ms.length&&lo(),a&&(Lt=a),u=c?r.apply(l,c):r.call(l),Lt=o,u},ki=function(t){return Ls(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Jt),t.progress()<1&&xe(t,"onInterrupt"),t},Pn,Zh=[],Xh=function(t){if(vc()&&t){t=!t.name&&t.default||t;var e=t.name,s=Vt(t),n=e&&!s&&t.init?function(){this._props=[]}:t,r={init:Zi,render:Ac,add:Cc,kill:Cv,modifier:bv,rawVars:0},o={targetTest:0,get:0,getSetter:Oc,aliases:{},register:0};if($n(),t!==n){if(ye[e])return;Ie(n,Ie(uo(t,r),o)),hn(n.prototype,hn(r,uo(t,o))),ye[n.prop=e]=n,t.targetTest&&(Vr.push(n),Tc[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}Ph(e,n),t.register&&t.register(_e,n,fe)}else t&&Zh.push(t)},bt=255,Ti={aqua:[0,bt,bt],lime:[0,bt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,bt],navy:[0,0,128],white:[bt,bt,bt],olive:[128,128,0],yellow:[bt,bt,0],orange:[bt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[bt,0,0],pink:[bt,192,203],cyan:[0,bt,bt],transparent:[bt,bt,bt,0]},Jo=function(t,e,s){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(s-e)*t*6:t<.5?s:t*3<2?e+(s-e)*(2/3-t)*6:e)*bt+.5|0},Qh=function(t,e,s){var n=t?_s(t)?[t>>16,t>>8&bt,t&bt]:0:Ti.black,r,o,a,c,l,u,h,d,p,_;if(!n){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),Ti[t])n=Ti[t];else if(t.charAt(0)==="#"){if(t.length<6&&(r=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+r+r+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return n=parseInt(t.substr(1,6),16),[n>>16,n>>8&bt,n&bt,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),n=[t>>16,t>>8&bt,t&bt]}else if(t.substr(0,3)==="hsl"){if(n=_=t.match(Ta),!e)c=+n[0]%360/360,l=+n[1]/100,u=+n[2]/100,o=u<=.5?u*(l+1):u+l-u*l,r=u*2-o,n.length>3&&(n[3]*=1),n[0]=Jo(c+1/3,r,o),n[1]=Jo(c,r,o),n[2]=Jo(c-1/3,r,o);else if(~t.indexOf("="))return n=t.match(Eh),s&&n.length<4&&(n[3]=1),n}else n=t.match(Ta)||Ti.transparent;n=n.map(Number)}return e&&!_&&(r=n[0]/bt,o=n[1]/bt,a=n[2]/bt,h=Math.max(r,o,a),d=Math.min(r,o,a),u=(h+d)/2,h===d?c=l=0:(p=h-d,l=u>.5?p/(2-h-d):p/(h+d),c=h===r?(o-a)/p+(ot&&(s+=v-e),n+=v,y=n-s,w=y-o,(w>0||b)&&(k=++h.frame,d=y-h.time*1e3,h.time=y=y/1e3,o+=w+(w>=r?4:r-w),g=1),b||(c=l(f)),g)for(p=0;p=v&&p--},_listeners:a},h}(),$n=function(){return!Qi&&ve.wake()},ft={},hv=/^[\d.\-M][\d.\-,\s]/,dv=/["']/g,fv=function(t){for(var e={},s=t.substr(1,t.length-3).split(":"),n=s[0],r=1,o=s.length,a,c,l;r1&&s.config?s.config.apply(null,~t.indexOf("{")?[fv(e[1])]:pv(t).split(",").map(Fh)):ft._CE&&hv.test(t)?ft._CE("",t):s},td=function(t){return function(e){return 1-t(1-e)}},ed=function i(t,e){for(var s=t._first,n;s;)s instanceof ie?i(s,e):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==e&&(s.timeline?i(s.timeline,e):(n=s._ease,s._ease=s._yEase,s._yEase=n,s._yoyo=e)),s=s._next},nn=function(t,e){return t&&(Vt(t)?t:ft[t]||mv(t))||e},_n=function(t,e,s,n){s===void 0&&(s=function(c){return 1-e(1-c)}),n===void 0&&(n=function(c){return c<.5?e(c*2)/2:1-e((1-c)*2)/2});var r={easeIn:e,easeOut:s,easeInOut:n},o;return de(t,function(a){ft[a]=we[a]=r,ft[o=a.toLowerCase()]=s;for(var c in r)ft[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ft[a+"."+c]=r[c]}),r},sd=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},ta=function i(t,e,s){var n=e>=1?e:1,r=(s||(t?.3:.45))/(e<1?e:1),o=r/ka*(Math.asin(1/n)||0),a=function(u){return u===1?1:n*Math.pow(2,-10*u)*q1((u-o)*r)+1},c=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:sd(a);return r=ka/r,c.config=function(l,u){return i(t,l,u)},c},ea=function i(t,e){e===void 0&&(e=1.70158);var s=function(o){return o?--o*o*((e+1)*o+e)+1:0},n=t==="out"?s:t==="in"?function(r){return 1-s(1-r)}:sd(s);return n.config=function(r){return i(t,r)},n};de("Linear,Quad,Cubic,Quart,Quint,Strong",function(i,t){var e=t<5?t+1:t;_n(i+",Power"+(e-1),t?function(s){return Math.pow(s,e)}:function(s){return s},function(s){return 1-Math.pow(1-s,e)},function(s){return s<.5?Math.pow(s*2,e)/2:1-Math.pow((1-s)*2,e)/2})});ft.Linear.easeNone=ft.none=ft.Linear.easeIn;_n("Elastic",ta("in"),ta("out"),ta());(function(i,t){var e=1/t,s=2*e,n=2.5*e,r=function(a){return a0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},t.totalDuration=function(s){return arguments.length?(this._dirty=0,Yn(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(s,n){if($n(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Fo(this,s),!r._dp||r.parent||Uh(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)&&Xe(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===Ct||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),Rh(this,s,n)),this},t.time=function(s,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+Il(this))%(this._dur+this._rDelay)||(s?this._dur:0),n):this._time},t.totalProgress=function(s,n){return arguments.length?this.totalTime(this.totalDuration()*s,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(s,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+Il(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(s,n){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*r,n):this._repeat?Gn(this._tTime,r)+1:1},t.timeScale=function(s,n){if(!arguments.length)return this._rts===-Ct?0:this._rts;if(this._rts===s)return this;var r=this.parent&&this._ts?ho(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-Ct?0:this._rts,this.totalTime(pr(-Math.abs(this._delay),this._tDur,r),n!==!1),Ro(this),X1(this)},t.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):($n(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ct&&(this._tTime-=Ct)))),this):this._ps},t.startTime=function(s){if(arguments.length){this._start=s;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&Xe(n,this,s-this._delay),this}return this._start},t.endTime=function(s){return this._start+(he(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(s){var n=this.parent||this._dp;return n?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?ho(n.rawTime(s),this):this._tTime:this._tTime},t.revert=function(s){s===void 0&&(s=G1);var n=Jt;return Jt=s,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),Jt=n,this},t.globalTime=function(s){for(var n=this,r=arguments.length?s:n.rawTime();n;)r=n._start+r/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(s):r},t.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,Nl(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(s){if(arguments.length){var n=this._time;return this._rDelay=s,Nl(this),n?this.time(n):this}return this._rDelay},t.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},t.seek=function(s,n){return this.totalTime(Se(this,s),he(n))},t.restart=function(s,n){return this.play().totalTime(s?-this._delay:0,he(n))},t.play=function(s,n){return s!=null&&this.seek(s,n),this.reversed(!1).paused(!1)},t.reverse=function(s,n){return s!=null&&this.seek(s||this.totalDuration(),n),this.reversed(!0).paused(!1)},t.pause=function(s,n){return s!=null&&this.seek(s,n),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-Ct:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ct,this},t.isActive=function(){var s=this.parent||this._dp,n=this._start,r;return!!(!s||this._ts&&this._initted&&s.isActive()&&(r=s.rawTime(!0))>=n&&r1?(n?(o[s]=n,r&&(o[s+"Params"]=r),s==="onUpdate"&&(this._onUpdate=n)):delete o[s],this):o[s]},t.then=function(s){var n=this;return new Promise(function(r){var o=Vt(s)?s:Lh,a=function(){var l=n.then;n.then=null,Vt(o)&&(o=o(n))&&(o.then||o===n)&&(n.then=l),r(o),n.then=l};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?a():n._prom=a})},t.kill=function(){ki(this)},i}();Ie(Ki.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:-Ct,_prom:0,_ps:!1,_rts:1});var ie=function(i){bh(t,i);function t(s,n){var r;return s===void 0&&(s={}),r=i.call(this,s)||this,r.labels={},r.smoothChildTiming=!!s.smoothChildTiming,r.autoRemoveChildren=!!s.autoRemoveChildren,r._sort=he(s.sortChildren),Nt&&Xe(s.parent||Nt,us(r),n),s.reversed&&r.reverse(),s.paused&&r.paused(!0),s.scrollTrigger&&jh(us(r),s.scrollTrigger),r}var e=t.prototype;return e.to=function(n,r,o){return Ei(0,arguments,this),this},e.from=function(n,r,o){return Ei(1,arguments,this),this},e.fromTo=function(n,r,o,a){return Ei(2,arguments,this),this},e.set=function(n,r,o){return r.duration=0,r.parent=this,Si(r).repeatDelay||(r.repeat=0),r.immediateRender=!!r.immediateRender,new Ht(n,r,Se(this,o),1),this},e.call=function(n,r,o){return Xe(this,Ht.delayedCall(0,n,r),o)},e.staggerTo=function(n,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 Ht(n,o,Se(this,c)),this},e.staggerFrom=function(n,r,o,a,c,l,u){return o.runBackwards=1,Si(o).immediateRender=he(o.immediateRender),this.staggerTo(n,r,o,a,c,l,u)},e.staggerFromTo=function(n,r,o,a,c,l,u,h){return a.startAt=o,Si(a).immediateRender=he(a.immediateRender),this.staggerTo(n,r,a,c,l,u,h)},e.render=function(n,r,o){var a=this._time,c=this._dirty?this.totalDuration():this._tDur,l=this._dur,u=n<=0?0:$t(n),h=this._zTime<0!=n<0&&(this._initted||!l),d,p,_,f,m,v,b,w,g,y,k,T;if(this!==Nt&&u>c&&n>=0&&(u=c),u!==this._tTime||o||h){if(a!==this._time&&l&&(u+=this._time-a,n+=this._time-a),d=u,g=this._start,w=this._ts,v=!w,h&&(l||(a=this._zTime),(n||!r)&&(this._zTime=n)),this._repeat){if(k=this._yoyo,m=l+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(m*100+n,r,o);if(d=$t(u%m),u===c?(f=this._repeat,d=l):(f=~~(u/m),f&&f===u/m&&(d=l,f--),d>l&&(d=l)),y=Gn(this._tTime,m),!a&&this._tTime&&y!==f&&this._tTime-y*m-this._dur<=0&&(y=f),k&&f&1&&(d=l-d,T=1),f!==y&&!this._lock){var x=k&&y&1,C=x===(k&&f&1);if(f=a&&n>=0)for(p=this._first;p;){if(_=p._next,(p._act||d>=p._start)&&p._ts&&b!==p){if(p.parent!==this)return this.render(n,r,o);if(p.render(p._ts>0?(d-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(d-p._start)*p._ts,r,o),d!==this._time||!this._ts&&!v){b=0,_&&(u+=this._zTime=-Ct);break}}p=_}else{p=this._last;for(var O=n<0?n:d;p;){if(_=p._prev,(p._act||O<=p._end)&&p._ts&&b!==p){if(p.parent!==this)return this.render(n,r,o);if(p.render(p._ts>0?(O-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(O-p._start)*p._ts,r,o||Jt&&(p._initted||p._startAt)),d!==this._time||!this._ts&&!v){b=0,_&&(u+=this._zTime=O?-Ct:Ct);break}}p=_}}if(b&&!r&&(this.pause(),b.render(d>=a?0:-Ct)._zTime=d>=a?1:-1,this._ts))return this._start=g,Ro(this),this.render(n,r,o);this._onUpdate&&!r&&xe(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&a)&&(g===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((n||!l)&&(u===c&&this._ts>0||!u&&this._ts<0)&&Ls(this,1),!r&&!(n<0&&!a)&&(u||a||!c)&&(xe(this,u===c&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u0)&&this._prom())))}return this},e.add=function(n,r){var o=this;if(_s(r)||(r=Se(this,r,n)),!(n instanceof Ki)){if(te(n))return n.forEach(function(a){return o.add(a,r)}),this;if(Xt(n))return this.addLabel(n,r);if(Vt(n))n=Ht.delayedCall(0,n);else return this}return this!==n?Xe(this,n,r):this},e.getChildren=function(n,r,o,a){n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),a===void 0&&(a=-Me);for(var c=[],l=this._first;l;)l._start>=a&&(l instanceof Ht?r&&c.push(l):(o&&c.push(l),n&&c.push.apply(c,l.getChildren(!0,r,o)))),l=l._next;return c},e.getById=function(n){for(var r=this.getChildren(1,1,1),o=r.length;o--;)if(r[o].vars.id===n)return r[o]},e.remove=function(n){return Xt(n)?this.removeLabel(n):Vt(n)?this.killTweensOf(n):(No(this,n),n===this._recent&&(this._recent=this._last),sn(this))},e.totalTime=function(n,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=$t(ve.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),i.prototype.totalTime.call(this,n,r),this._forcing=0,this):this._tTime},e.addLabel=function(n,r){return this.labels[n]=Se(this,r),this},e.removeLabel=function(n){return delete this.labels[n],this},e.addPause=function(n,r,o){var a=Ht.delayedCall(0,r||Zi,o);return a.data="isPause",this._hasPause=1,Xe(this,a,Se(this,n))},e.removePause=function(n){var r=this._first;for(n=Se(this,n);r;)r._start===n&&r.data==="isPause"&&Ls(r),r=r._next},e.killTweensOf=function(n,r,o){for(var a=this.getTweensOf(n,o),c=a.length;c--;)Cs!==a[c]&&a[c].kill(n,r);return this},e.getTweensOf=function(n,r){for(var o=[],a=De(n),c=this._first,l=_s(r),u;c;)c instanceof Ht?Y1(c._targets,a)&&(l?(!Cs||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},e.tweenTo=function(n,r){r=r||{};var o=this,a=Se(o,n),c=r,l=c.startAt,u=c.onStart,h=c.onStartParams,d=c.immediateRender,p,_=Ht.to(o,Ie({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())||Ct,onStart:function(){if(o.pause(),!p){var m=r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale());_._dur!==m&&Yn(_,m,0,1).render(_._time,!0,!0),p=1}u&&u.apply(_,h||[])}},r));return d?_.render(0):_},e.tweenFromTo=function(n,r,o){return this.tweenTo(r,Ie({startAt:{time:Se(this,n)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(n){return n===void 0&&(n=this._time),Rl(this,Se(this,n))},e.previousLabel=function(n){return n===void 0&&(n=this._time),Rl(this,Se(this,n),1)},e.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+Ct)},e.shiftChildren=function(n,r,o){o===void 0&&(o=0);for(var a=this._first,c=this.labels,l;a;)a._start>=o&&(a._start+=n,a._end+=n),a=a._next;if(r)for(l in c)c[l]>=o&&(c[l]+=n);return sn(this)},e.invalidate=function(n){var r=this._first;for(this._lock=0;r;)r.invalidate(n),r=r._next;return i.prototype.invalidate.call(this,n)},e.clear=function(n){n===void 0&&(n=!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),n&&(this.labels={}),sn(this)},e.totalDuration=function(n){var r=0,o=this,a=o._last,c=Me,l,u,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-n:n));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,Xe(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;Yn(o,o===Nt&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(n){if(Nt._ts&&(Rh(Nt,ho(n,Nt)),Ih=ve.frame),ve.frame>=Dl){Dl+=Te.autoSleep||120;var r=Nt._first;if((!r||!r._ts)&&Te.autoSleep&&ve._listeners.length<2){for(;r&&!r._ts;)r=r._next;r||ve.sleep()}}},t}(Ki);Ie(ie.prototype,{_lock:0,_hasPause:0,_forcing:0});var _v=function(t,e,s,n,r,o,a){var c=new fe(this._pt,t,e,0,1,ld,null,r),l=0,u=0,h,d,p,_,f,m,v,b;for(c.b=s,c.e=n,s+="",n+="",(v=~n.indexOf("random("))&&(n=Xi(n)),o&&(b=[s,n],o(b,t,e),s=b[0],n=b[1]),d=s.match(Qo)||[];h=Qo.exec(n);)_=h[0],f=n.substring(l,h.index),p?p=(p+1)%5:f.substr(-5)==="rgba("&&(p=1),_!==d[u++]&&(m=parseFloat(d[u-1])||0,c._pt={_next:c._pt,p:f||u===1?f:",",s:m,c:_.charAt(1)==="="?Rn(m,_)-m:parseFloat(_)-m,m:p&&p<4?Math.round:0},l=Qo.lastIndex);return c.c=l")}),g.duration();else{k={};for(x in _)x==="ease"||x==="easeEach"||xv(x,_[x],k,_.easeEach);for(x in k)for(V=k[x].sort(function(G,z){return G.t-z.t}),M=0,y=0;yc-Ct&&!u?c:nl&&(d=l)),v=this._yoyo&&_&1,v&&(g=this._yEase,d=l-d),m=Gn(this._tTime,f),d===a&&!o&&this._initted&&_===m)return this._tTime=h,this;_!==m&&(w&&this._yEase&&ed(w,v),this.vars.repeatRefresh&&!v&&!this._lock&&this._time!==l&&this._initted&&(this._lock=o=1,this.render($t(f*_),!0).invalidate()._lock=0))}if(!this._initted){if(zh(this,u?n:d,o,r,h))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&_!==m))return this;if(l!==this._dur)return this.render(n,r,o)}if(this._tTime=h,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=b=(g||this._ease)(d/l),this._from&&(this.ratio=b=1-b),d&&!a&&!r&&!_&&(xe(this,"onStart"),this._tTime!==h))return this;for(p=this._pt;p;)p.r(b,p.d),p=p._next;w&&w.render(n<0?n:!d&&v?-Ct:w._dur*w._ease(d/this._dur),r,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!r&&(u&&Ca(this,n,r,o),xe(this,"onUpdate")),this._repeat&&_!==m&&this.vars.onRepeat&&!r&&this.parent&&xe(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&Ca(this,n,!0,!0),(n||!l)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Ls(this,1),!r&&!(u&&!a)&&(h||a||v)&&(xe(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),i.prototype.invalidate.call(this,n)},e.resetTo=function(n,r,o,a,c){Qi||ve.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Sc(this,l),u=this._ease(l/this._dur),yv(this,n,r,o,a,u,l,c)?this.resetTo(n,r,o,a,1):(Fo(this,0),this.parent||Vh(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(n,r){if(r===void 0&&(r="all"),!n&&(!r||r==="all"))return this._lazy=this._pt=0,this.parent?ki(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,r,Cs&&Cs.vars.overwrite!==!0)._first||ki(this),this.parent&&o!==this.timeline.totalDuration()&&Yn(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,c=n?De(n):a,l=this._ptLookup,u=this._pt,h,d,p,_,f,m,v;if((!r||r==="all")&&Z1(a,c))return r==="all"&&(this._pt=0),ki(this);for(h=this._op=this._op||[],r!=="all"&&(Xt(r)&&(f={},de(r,function(b){return f[b]=1}),r=f),r=vv(a,r)),v=a.length;v--;)if(~c.indexOf(a[v])){d=l[v],r==="all"?(h[v]=r,_=d,p={}):(p=h[v]=h[v]||{},_=r);for(f in _)m=d&&d[f],m&&((!("kill"in m.d)||m.d.kill(f)===!0)&&No(this,m,"_pt"),delete d[f]),p!=="all"&&(p[f]=1)}return this._initted&&!this._pt&&u&&ki(this),this},t.to=function(n,r){return new t(n,r,arguments[2])},t.from=function(n,r){return Ei(1,arguments)},t.delayedCall=function(n,r,o,a){return new t(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:r,onReverseComplete:r,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(n,r,o){return Ei(2,arguments)},t.set=function(n,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new t(n,r)},t.killTweensOf=function(n,r,o){return Nt.killTweensOf(n,r,o)},t}(Ki);Ie(Ht.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});de("staggerTo,staggerFrom,staggerFromTo",function(i){Ht[i]=function(){var t=new ie,e=Ea.call(arguments,0);return e.splice(i==="staggerFromTo"?5:4,0,0),t[i].apply(t,e)}});var Ec=function(t,e,s){return t[e]=s},ad=function(t,e,s){return t[e](s)},kv=function(t,e,s,n){return t[e](n.fp,s)},Tv=function(t,e,s){return t.setAttribute(e,s)},Oc=function(t,e){return Vt(t[e])?ad:yc(t[e])&&t.setAttribute?Tv:Ec},cd=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},wv=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ld=function(t,e){var s=e._pt,n="";if(!t&&e.b)n=e.b;else if(t===1&&e.e)n=e.e;else{for(;s;)n=s.p+(s.m?s.m(s.s+s.c*t):Math.round((s.s+s.c*t)*1e4)/1e4)+n,s=s._next;n+=e.c}e.set(e.t,e.p,n,e)},Ac=function(t,e){for(var s=e._pt;s;)s.r(t,s.d),s=s._next},bv=function(t,e,s,n){for(var r=this._pt,o;r;)o=r._next,r.p===n&&r.modifier(t,e,s),r=o},Cv=function(t){for(var e=this._pt,s,n;e;)n=e._next,e.p===t&&!e.op||e.op===t?No(this,e,"_pt"):e.dep||(s=1),e=n;return!s},Sv=function(t,e,s,n){n.mSet(t,e,n.m.call(n.tween,s,n.mt),n)},ud=function(t){for(var e=t._pt,s,n,r,o;e;){for(s=e._next,n=r;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:o)?e._prev._next=e:r=e,(e._next=n)?n._prev=e:o=e,e=s}t._pt=r},fe=function(){function i(e,s,n,r,o,a,c,l,u){this.t=s,this.s=r,this.c=o,this.p=n,this.r=a||cd,this.d=c||this,this.set=l||Ec,this.pr=u||0,this._next=e,e&&(e._prev=this)}var t=i.prototype;return t.modifier=function(s,n,r){this.mSet=this.mSet||this.set,this.set=Sv,this.m=s,this.mt=r,this.tween=n},i}();de(wc+"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(i){return Tc[i]=1});we.TweenMax=we.TweenLite=Ht;we.TimelineLite=we.TimelineMax=ie;Nt=new ie({sortChildren:!1,defaults:Hn,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Te.stringFilter=Jh;var rn=[],Ur={},Ev=[],Ll=0,Ov=0,sa=function(t){return(Ur[t]||Ev).map(function(e){return e()})},Da=function(){var t=Date.now(),e=[];t-Ll>2&&(sa("matchMediaInit"),rn.forEach(function(s){var n=s.queries,r=s.conditions,o,a,c,l;for(a in n)o=Ee.matchMedia(n[a]).matches,o&&(c=1),o!==r[a]&&(r[a]=o,l=1);l&&(s.revert(),c&&e.push(s))}),sa("matchMediaRevert"),e.forEach(function(s){return s.onMatch(s,function(n){return s.add(null,n)})}),Ll=t,sa("matchMedia"))},hd=function(){function i(e,s){this.selector=s&&Oa(s),this.data=[],this._r=[],this.isReverted=!1,this.id=Ov++,e&&this.add(e)}var t=i.prototype;return t.add=function(s,n,r){Vt(s)&&(r=n,n=s,s=Vt);var o=this,a=function(){var l=Lt,u=o.selector,h;return l&&l!==o&&l.data.push(o),r&&(o.selector=Oa(r)),Lt=o,h=n.apply(o,arguments),Vt(h)&&o._r.push(h),Lt=l,o.selector=u,o.isReverted=!1,h};return o.last=a,s===Vt?a(o,function(c){return o.add(null,c)}):s?o[s]=a:a},t.ignore=function(s){var n=Lt;Lt=null,s(this),Lt=n},t.getTweens=function(){var s=[];return this.data.forEach(function(n){return n instanceof i?s.push.apply(s,n.getTweens()):n instanceof Ht&&!(n.parent&&n.parent.data==="nested")&&s.push(n)}),s},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(s,n){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 ie?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ht)&&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(),n)for(var o=rn.length;o--;)rn[o].id===this.id&&rn.splice(o,1)},t.revert=function(s){this.kill(s||{})},i}(),Av=function(){function i(e){this.contexts=[],this.scope=e}var t=i.prototype;return t.add=function(s,n,r){es(s)||(s={matches:s});var o=new hd(0,r||this.scope),a=o.conditions={},c,l,u;Lt&&!o.selector&&(o.selector=Lt.selector),this.contexts.push(o),n=o.add("onMatch",n),o.queries=s;for(l in s)l==="all"?u=1:(c=Ee.matchMedia(s[l]),c&&(rn.indexOf(o)<0&&rn.push(o),(a[l]=c.matches)&&(u=1),c.addListener?c.addListener(Da):c.addEventListener("change",Da)));return u&&n(o,function(h){return o.add(null,h)}),this},t.revert=function(s){this.kill(s||{})},t.kill=function(s){this.contexts.forEach(function(n){return n.kill(s,!0)})},i}(),fo={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),s=0;s1){var n=t.map(function(u){return _e.quickSetter(u,e,s)}),r=n.length;return function(u){for(var h=r;h--;)n[h](u)}}t=t[0]||{};var o=ye[e],a=en(t),c=a.harness&&(a.harness.aliases||{})[e]||e,l=o?function(u){var h=new o;Pn._pt=0,h.init(t,s?u+s:u,Pn,0,[t]),h.render(1,h),Pn._pt&&Ac(1,Pn)}:a.set(t,c);return o?l:function(u){return l(t,c,s?u+s:u,a,1)}},quickTo:function(t,e,s){var n,r=_e.to(t,hn((n={},n[e]="+=0.1",n.paused=!0,n),s||{})),o=function(c,l,u){return r.resetTo(e,c,l,u)};return o.tween=r,o},isTweening:function(t){return Nt.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=nn(t.ease,Hn.ease)),Pl(Hn,t||{})},config:function(t){return Pl(Te,t||{})},registerEffect:function(t){var e=t.name,s=t.effect,n=t.plugins,r=t.defaults,o=t.extendTimeline;(n||"").split(",").forEach(function(a){return a&&!ye[a]&&!we[a]&&$i(e+" effect requires "+a+" plugin.")}),Ko[e]=function(a,c,l){return s(De(a),Ie(c||{},r),l)},o&&(ie.prototype[e]=function(a,c,l){return this.add(Ko[e](a,es(c)?c:(l=c)&&{},this),l)})},registerEase:function(t,e){ft[t]=nn(e)},parseEase:function(t,e){return arguments.length?nn(t,e):ft},getById:function(t){return Nt.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var s=new ie(t),n,r;for(s.smoothChildTiming=he(t.smoothChildTiming),Nt.remove(s),s._dp=0,s._time=s._tTime=Nt._time,n=Nt._first;n;)r=n._next,(e||!(!n._dur&&n instanceof Ht&&n.vars.onComplete===n._targets[0]))&&Xe(s,n,n._start-n._delay),n=r;return Xe(Nt,s,0),s},context:function(t,e){return t?new hd(t,e):Lt},matchMedia:function(t){return new Av(t)},matchMediaRefresh:function(){return rn.forEach(function(t){var e=t.conditions,s,n;for(n in e)e[n]&&(e[n]=!1,s=1);s&&t.revert()})||Da()},addEventListener:function(t,e){var s=Ur[t]||(Ur[t]=[]);~s.indexOf(e)||s.push(e)},removeEventListener:function(t,e){var s=Ur[t],n=s&&s.indexOf(e);n>=0&&s.splice(n,1)},utils:{wrap:av,wrapYoyo:cv,distribute:Wh,random:Gh,snap:Hh,normalize:ov,getUnit:Kt,clamp:sv,splitColor:Qh,toArray:De,selector:Oa,mapRange:$h,pipe:iv,unitize:rv,interpolate:lv,shuffle:qh},install:Dh,effects:Ko,ticker:ve,updateRoot:ie.updateRoot,plugins:ye,globalTimeline:Nt,core:{PropTween:fe,globals:Ph,Tween:Ht,Timeline:ie,Animation:Ki,getCache:en,_removeLinkedListItem:No,reverting:function(){return Jt},context:function(t){return t&&Lt&&(Lt.data.push(t),t._ctx=Lt),Lt},suppressOverwrites:function(t){return gc=t}}};de("to,from,fromTo,delayedCall,set,killTweensOf",function(i){return fo[i]=Ht[i]});ve.add(ie.updateRoot);Pn=fo.to({},{duration:0});var Mv=function(t,e){for(var s=t._pt;s&&s.p!==e&&s.op!==e&&s.fp!==e;)s=s._next;return s},Dv=function(t,e){var s=t._targets,n,r,o;for(n in e)for(r=s.length;r--;)o=t._ptLookup[r][n],o&&(o=o.d)&&(o._pt&&(o=Mv(o,n)),o&&o.modifier&&o.modifier(e[n],t,s[r],n))},na=function(t,e){return{name:t,rawVars:1,init:function(n,r,o){o._onInit=function(a){var c,l;if(Xt(r)&&(c={},de(r,function(u){return c[u]=1}),r=c),e){c={};for(l in r)c[l]=e(r[l]);r=c}Dv(a,r)}}}},_e=fo.registerPlugin({name:"attr",init:function(t,e,s,n,r){var o,a,c;this.tween=s;for(o in e)c=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(c||0)+"",e[o],n,r,0,0,o),a.op=o,a.b=c,this._props.push(o)},render:function(t,e){for(var s=e._pt;s;)Jt?s.set(s.t,s.p,s.b,s):s.r(t,s.d),s=s._next}},{name:"endArray",init:function(t,e){for(var s=e.length;s--;)this.add(t,s,t[s]||0,e[s],0,0,0,0,0,1)}},na("roundProps",Aa),na("modifiers"),na("snap",Hh))||fo;Ht.version=ie.version=_e.version="3.12.4";Mh=1;vc()&&$n();ft.Power0;ft.Power1;ft.Power2;ft.Power3;ft.Power4;ft.Linear;ft.Quad;ft.Cubic;ft.Quart;ft.Quint;ft.Strong;ft.Elastic;ft.Back;ft.SteppedEase;ft.Bounce;ft.Sine;ft.Expo;ft.Circ;/*! +*/var ke={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},Wn={duration:.5,overwrite:!1,delay:0},fc,Jt,Lt,Oe=1e8,Ct=1/Oe,_a=Math.PI*2,O1=_a/4,A1=0,gh=Math.sqrt,M1=Math.cos,D1=Math.sin,Xt=function(t){return typeof t=="string"},Vt=function(t){return typeof t=="function"},ms=function(t){return typeof t=="number"},pc=function(t){return typeof t>"u"},Je=function(t){return typeof t=="object"},ue=function(t){return t!==!1},mc=function(){return typeof window<"u"},Or=function(t){return Vt(t)||Xt(t)},yh=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},te=Array.isArray,ga=/(?:-?\.?\d|\.)+/gi,vh=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,Mn=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Yo=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,xh=/[+-]=-?[.\d]+/,kh=/[^,'"\[\]\s]+/gi,P1=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Nt,Ce,ya,_c,Te={},no={},Th,wh=function(t){return(no=un(t,Te))&&_e},gc=function(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")},Yi=function(t,e){return!e&&console.warn(t)},bh=function(t,e){return t&&(Te[t]=e)&&no&&(no[t]=e)||Te},Gi=function(){return 0},I1={suppressEvents:!0,isStart:!0,kill:!1},Pr={suppressEvents:!0,kill:!1},N1={suppressEvents:!0},yc={},As=[],va={},Ch,ge={},Go={},Sl=30,Ir=[],vc="",xc=function(t){var e=t[0],s,n;if(Je(e)||Vt(e)||(t=[t]),!(s=(e._gsap||{}).harness)){for(n=Ir.length;n--&&!Ir[n].targetTest(e););s=Ir[n]}for(n=t.length;n--;)t[n]&&(t[n]._gsap||(t[n]._gsap=new Zh(t[n],s)))||t.splice(n,1);return t},tn=function(t){return t._gsap||xc(Ae(t))[0]._gsap},Sh=function(t,e,s){return(s=t[e])&&Vt(s)?t[e]():pc(s)&&t.getAttribute&&t.getAttribute(e)||s},he=function(t,e){return(t=t.split(",")).forEach(e)||t},jt=function(t){return Math.round(t*1e5)/1e5||0},$t=function(t){return Math.round(t*1e7)/1e7||0},Nn=function(t,e){var s=e.charAt(0),n=parseFloat(e.substr(2));return t=parseFloat(t),s==="+"?t+n:s==="-"?t-n:s==="*"?t*n:t/n},R1=function(t,e){for(var s=e.length,n=0;t.indexOf(e[n])<0&&++na;)o=o._prev;return o?(e._next=o._next,o._next=e):(e._next=t[s],t[s]=e),e._next?e._next._prev=e:t[n]=e,e._prev=o,e.parent=e._dp=t,e},Ao=function(t,e,s,n){s===void 0&&(s="_first"),n===void 0&&(n="_last");var r=e._prev,o=e._next;r?r._next=o:t[s]===e&&(t[s]=o),o?o._prev=r:t[n]===e&&(t[n]=r),e._next=e._prev=e.parent=null},Fs=function(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0},en=function(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var s=t;s;)s._dirty=1,s=s.parent;return t},V1=function(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t},xa=function(t,e,s,n){return t._startAt&&(Jt?t._startAt.revert(Pr):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,n))},U1=function i(t){return!t||t._ts&&i(t.parent)},Ol=function(t){return t._repeat?Hn(t._tTime,t=t.duration()+t._rDelay)*t:0},Hn=function(t,e){var s=Math.floor(t/=e);return t&&s===t?s-1:s},oo=function(t,e){return(t-e._start)*e._ts+(e._ts>=0?0:e._dirty?e.totalDuration():e._tDur)},Mo=function(t){return t._end=$t(t._start+(t._tDur/Math.abs(t._ts||t._rts||Ct)||0))},Do=function(t,e){var s=t._dp;return s&&s.smoothChildTiming&&t._ts&&(t._start=$t(s._time-(t._ts>0?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Mo(t),s._dirty||en(s,t)),t},Dh=function(t,e){var s;if((e._time||!e._dur&&e._initted||e._startCt)&&e.render(s,!0)),en(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur=0&&s.totalTime(s._tTime),s=s._dp;t._zTime=-Ct}},$e=function(t,e,s,n){return e.parent&&Fs(e),e._start=$t((ms(s)?s:s||t!==Nt?be(t,s,e):t._time)+e._delay),e._end=$t(e._start+(e.totalDuration()/Math.abs(e.timeScale())||0)),Mh(t,e,"_first","_last",t._sort?"_start":0),ka(e)||(t._recent=e),n||Dh(t,e),t._ts<0&&Do(t,t._tTime),t},Ph=function(t,e){return(Te.ScrollTrigger||gc("scrollTrigger",e))&&Te.ScrollTrigger.create(e,t)},Ih=function(t,e,s,n,r){if(Tc(t,e,r),!t._initted)return 1;if(!s&&t._pt&&!Jt&&(t._dur&&t.vars.lazy!==!1||!t._dur&&t.vars.lazy)&&Ch!==ye.frame)return As.push(t),t._lazy=[r,n],1},z1=function i(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||i(e))},ka=function(t){var e=t.data;return e==="isFromStart"||e==="isStart"},j1=function(t,e,s,n){var r=t.ratio,o=e<0||!e&&(!t._start&&z1(t)&&!(!t._initted&&ka(t))||(t._ts<0||t._dp._ts<0)&&!ka(t))?0:1,a=t._rDelay,c=0,l,u,h;if(a&&t._repeat&&(c=hr(0,t._tDur,e),u=Hn(c,a),t._yoyo&&u&1&&(o=1-o),u!==Hn(t._tTime,a)&&(r=1-o,t.vars.repeatRefresh&&t._initted&&t.invalidate())),o!==r||Jt||n||t._zTime===Ct||!e&&t._zTime){if(!t._initted&&Ih(t,e,n,s,c))return;for(h=t._zTime,t._zTime=e||(s?Ct:0),s||(s=e&&!h),t.ratio=o,t._from&&(o=1-o),t._time=0,t._tTime=c,l=t._pt;l;)l.r(o,l.d),l=l._next;e<0&&xa(t,e,s,!0),t._onUpdate&&!s&&ve(t,"onUpdate"),c&&t._repeat&&!s&&t.parent&&ve(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===o&&(o&&Fs(t,1),!s&&!Jt&&(ve(t,o?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)},B1=function(t,e,s){var n;if(s>e)for(n=t._first;n&&n._start<=s;){if(n.data==="isPause"&&n._start>e)return n;n=n._next}else for(n=t._last;n&&n._start>=s;){if(n.data==="isPause"&&n._start0&&!n&&Do(t,t._tTime=t._tDur*a),t.parent&&Mo(t),s||en(t.parent,t),t},Al=function(t){return t instanceof ie?en(t):Yn(t,t._dur)},q1={_start:0,endTime:Gi,totalDuration:Gi},be=function i(t,e,s){var n=t.labels,r=t._recent||q1,o=t.duration()>=Oe?r.endTime(!1):t._dur,a,c,l;return Xt(e)&&(isNaN(e)||e in n)?(c=e.charAt(0),l=e.substr(-1)==="%",a=e.indexOf("="),c==="<"||c===">"?(a>=0&&(e=e.replace(/=/,"")),(c==="<"?r._start:r.endTime(r._repeat>=0))+(parseFloat(e.substr(1))||0)*(l?(a<0?r:s).totalDuration()/100:1)):a<0?(e in n||(n[e]=o),n[e]):(c=parseFloat(e.charAt(a-1)+e.substr(a+1)),l&&s&&(c=c/100*(te(s)?s[0]:s).totalDuration()),a>1?i(t,e.substr(0,a-1),s)+c:o+c)):e==null?o:+e},Ci=function(t,e,s){var n=ms(e[1]),r=(n?2:1)+(t<2?0:1),o=e[r],a,c;if(n&&(o.duration=e[1]),o.parent=s,t){for(a=o,c=s;c&&!("immediateRender"in a);)a=c.vars.defaults||{},c=ue(c.vars.inherit)&&c.parent;o.immediateRender=ue(a.immediateRender),t<2?o.runBackwards=1:o.startAt=e[r-1]}return new Ht(e[0],o,e[r+1])},js=function(t,e){return t||t===0?e(t):e},hr=function(t,e,s){return se?e:s},Kt=function(t,e){return!Xt(t)||!(e=P1.exec(t))?"":e[1]},W1=function(t,e,s){return js(s,function(n){return hr(t,e,n)})},Ta=[].slice,Nh=function(t,e){return t&&Je(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&Je(t[0]))&&!t.nodeType&&t!==Ce},H1=function(t,e,s){return s===void 0&&(s=[]),t.forEach(function(n){var r;return Xt(n)&&!e||Nh(n,1)?(r=s).push.apply(r,Ae(n)):s.push(n)})||s},Ae=function(t,e,s){return Lt&&!e&&Lt.selector?Lt.selector(t):Xt(t)&&!s&&(ya||!Gn())?Ta.call((e||_c).querySelectorAll(t),0):te(t)?H1(t,s):Nh(t)?Ta.call(t,0):t?[t]:[]},wa=function(t){return t=Ae(t)[0]||Yi("Invalid scope")||{},function(e){var s=t.current||t.nativeElement||t;return Ae(e,s.querySelectorAll?s:s===t?Yi("Invalid scope")||_c.createElement("div"):t)}},Rh=function(t){return t.sort(function(){return .5-Math.random()})},Fh=function(t){if(Vt(t))return t;var e=Je(t)?t:{each:t},s=sn(e.ease),n=e.from||0,r=parseFloat(e.base)||0,o={},a=n>0&&n<1,c=isNaN(n)||a,l=e.axis,u=n,h=n;return Xt(n)?u=h={center:.5,edges:.5,end:1}[n]||0:!a&&c&&(u=n[0],h=n[1]),function(d,p,_){var f=(_||e).length,m=o[f],v,b,w,g,y,k,T,x,C;if(!m){if(C=e.grid==="auto"?0:(e.grid||[1,Oe])[1],!C){for(T=-Oe;T<(T=_[C++].getBoundingClientRect().left)&&CT&&(T=y),yf?f-1:l?l==="y"?f/C:C:Math.max(C,f/C))||0)*(n==="edges"?-1:1),m.b=f<0?r-f:r,m.u=Kt(e.amount||e.each)||0,s=s&&f<0?Yh(s):s}return f=(m[d]-m.min)/m.max||0,$t(m.b+(s?s(f):f)*m.v)+m.u}},ba=function(t){var e=Math.pow(10,((t+"").split(".")[1]||"").length);return function(s){var n=$t(Math.round(parseFloat(s)/t)*t*e);return(n-n%1)/e+(ms(s)?0:Kt(s))}},Lh=function(t,e){var s=te(t),n,r;return!s&&Je(t)&&(n=s=t.radius||Oe,t.values?(t=Ae(t.values),(r=!ms(t[0]))&&(n*=n)):t=ba(t.increment)),js(e,s?Vt(t)?function(o){return r=t(o),Math.abs(r-o)<=n?r:o}:function(o){for(var a=parseFloat(r?o.x:o),c=parseFloat(r?o.y:0),l=Oe,u=0,h=t.length,d,p;h--;)r?(d=t[h].x-a,p=t[h].y-c,d=d*d+p*p):d=Math.abs(t[h]-a),dn?r-o:o)})},$i=function(t){for(var e=0,s="",n,r,o,a;~(n=t.indexOf("random(",e));)o=t.indexOf(")",n),a=t.charAt(n+7)==="[",r=t.substr(n+7,o-n-7).match(a?kh:ga),s+=t.substr(e,n-e)+Vh(a?r:+r[0],a?0:+r[1],+r[2]||1e-5),e=o+1;return s+t.substr(e,t.length-e)},zh=function(t,e,s,n,r){var o=e-t,a=n-s;return js(r,function(c){return s+((c-t)/o*a||0)})},Q1=function i(t,e,s,n){var r=isNaN(t+e)?0:function(p){return(1-p)*t+p*e};if(!r){var o=Xt(t),a={},c,l,u,h,d;if(s===!0&&(n=1)&&(s=null),o)t={p:t},e={p:e};else if(te(t)&&!te(e)){for(u=[],h=t.length,d=h-2,l=1;l(a=Math.abs(a))&&(c=o,r=a);return c},ve=function(t,e,s){var n=t.vars,r=n[e],o=Lt,a=t._ctx,c,l,u;if(r)return c=n[e+"Params"],l=n.callbackScope||t,s&&As.length&&io(),a&&(Lt=a),u=c?r.apply(l,c):r.call(l),Lt=o,u},vi=function(t){return Fs(t),t.scrollTrigger&&t.scrollTrigger.kill(!!Jt),t.progress()<1&&ve(t,"onInterrupt"),t},Dn,jh=[],Bh=function(t){if(mc()&&t){t=!t.name&&t.default||t;var e=t.name,s=Vt(t),n=e&&!s&&t.init?function(){this._props=[]}:t,r={init:Gi,render:Cc,add:kc,kill:fv,modifier:dv,rawVars:0},o={targetTest:0,get:0,getSetter:bc,aliases:{},register:0};if(Gn(),t!==n){if(ge[e])return;De(n,De(ro(t,r),o)),un(n.prototype,un(r,ro(t,o))),ge[n.prop=e]=n,t.targetTest&&(Ir.push(n),yc[e]=1),e=(e==="css"?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}bh(e,n),t.register&&t.register(_e,n,de)}else t&&jh.push(t)},bt=255,xi={aqua:[0,bt,bt],lime:[0,bt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,bt],navy:[0,0,128],white:[bt,bt,bt],olive:[128,128,0],yellow:[bt,bt,0],orange:[bt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[bt,0,0],pink:[bt,192,203],cyan:[0,bt,bt],transparent:[bt,bt,bt,0]},$o=function(t,e,s){return t+=t<0?1:t>1?-1:0,(t*6<1?e+(s-e)*t*6:t<.5?s:t*3<2?e+(s-e)*(2/3-t)*6:e)*bt+.5|0},qh=function(t,e,s){var n=t?ms(t)?[t>>16,t>>8&bt,t&bt]:0:xi.black,r,o,a,c,l,u,h,d,p,_;if(!n){if(t.substr(-1)===","&&(t=t.substr(0,t.length-1)),xi[t])n=xi[t];else if(t.charAt(0)==="#"){if(t.length<6&&(r=t.charAt(1),o=t.charAt(2),a=t.charAt(3),t="#"+r+r+o+o+a+a+(t.length===5?t.charAt(4)+t.charAt(4):"")),t.length===9)return n=parseInt(t.substr(1,6),16),[n>>16,n>>8&bt,n&bt,parseInt(t.substr(7),16)/255];t=parseInt(t.substr(1),16),n=[t>>16,t>>8&bt,t&bt]}else if(t.substr(0,3)==="hsl"){if(n=_=t.match(ga),!e)c=+n[0]%360/360,l=+n[1]/100,u=+n[2]/100,o=u<=.5?u*(l+1):u+l-u*l,r=u*2-o,n.length>3&&(n[3]*=1),n[0]=$o(c+1/3,r,o),n[1]=$o(c,r,o),n[2]=$o(c-1/3,r,o);else if(~t.indexOf("="))return n=t.match(vh),s&&n.length<4&&(n[3]=1),n}else n=t.match(ga)||xi.transparent;n=n.map(Number)}return e&&!_&&(r=n[0]/bt,o=n[1]/bt,a=n[2]/bt,h=Math.max(r,o,a),d=Math.min(r,o,a),u=(h+d)/2,h===d?c=l=0:(p=h-d,l=u>.5?p/(2-h-d):p/(h+d),c=h===r?(o-a)/p+(ot&&(s+=v-e),n+=v,y=n-s,w=y-o,(w>0||b)&&(k=++h.frame,d=y-h.time*1e3,h.time=y=y/1e3,o+=w+(w>=r?4:r-w),g=1),b||(c=l(f)),g)for(p=0;p=v&&p--},_listeners:a},h}(),Gn=function(){return!Zi&&ye.wake()},ft={},J1=/^[\d.\-M][\d.\-,\s]/,tv=/["']/g,ev=function(t){for(var e={},s=t.substr(1,t.length-3).split(":"),n=s[0],r=1,o=s.length,a,c,l;r1&&s.config?s.config.apply(null,~t.indexOf("{")?[ev(e[1])]:sv(t).split(",").map(Oh)):ft._CE&&J1.test(t)?ft._CE("",t):s},Yh=function(t){return function(e){return 1-t(1-e)}},Gh=function i(t,e){for(var s=t._first,n;s;)s instanceof ie?i(s,e):s.vars.yoyoEase&&(!s._yoyo||!s._repeat)&&s._yoyo!==e&&(s.timeline?i(s.timeline,e):(n=s._ease,s._ease=s._yEase,s._yEase=n,s._yoyo=e)),s=s._next},sn=function(t,e){return t&&(Vt(t)?t:ft[t]||nv(t))||e},mn=function(t,e,s,n){s===void 0&&(s=function(c){return 1-e(1-c)}),n===void 0&&(n=function(c){return c<.5?e(c*2)/2:1-e((1-c)*2)/2});var r={easeIn:e,easeOut:s,easeInOut:n},o;return he(t,function(a){ft[a]=Te[a]=r,ft[o=a.toLowerCase()]=s;for(var c in r)ft[o+(c==="easeIn"?".in":c==="easeOut"?".out":".inOut")]=ft[a+"."+c]=r[c]}),r},$h=function(t){return function(e){return e<.5?(1-t(1-e*2))/2:.5+t((e-.5)*2)/2}},Zo=function i(t,e,s){var n=e>=1?e:1,r=(s||(t?.3:.45))/(e<1?e:1),o=r/_a*(Math.asin(1/n)||0),a=function(u){return u===1?1:n*Math.pow(2,-10*u)*D1((u-o)*r)+1},c=t==="out"?a:t==="in"?function(l){return 1-a(1-l)}:$h(a);return r=_a/r,c.config=function(l,u){return i(t,l,u)},c},Xo=function i(t,e){e===void 0&&(e=1.70158);var s=function(o){return o?--o*o*((e+1)*o+e)+1:0},n=t==="out"?s:t==="in"?function(r){return 1-s(1-r)}:$h(s);return n.config=function(r){return i(t,r)},n};he("Linear,Quad,Cubic,Quart,Quint,Strong",function(i,t){var e=t<5?t+1:t;mn(i+",Power"+(e-1),t?function(s){return Math.pow(s,e)}:function(s){return s},function(s){return 1-Math.pow(1-s,e)},function(s){return s<.5?Math.pow(s*2,e)/2:1-Math.pow((1-s)*2,e)/2})});ft.Linear.easeNone=ft.none=ft.Linear.easeIn;mn("Elastic",Zo("in"),Zo("out"),Zo());(function(i,t){var e=1/t,s=2*e,n=2.5*e,r=function(a){return a0?s+(s+this._rDelay)*this._repeat:s):this.totalDuration()&&this._dur},t.totalDuration=function(s){return arguments.length?(this._dirty=0,Yn(this,this._repeat<0?s:(s-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},t.totalTime=function(s,n){if(Gn(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(Do(this,s),!r._dp||r.parent||Dh(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)&&$e(this._dp,this,this._start-this._delay)}return(this._tTime!==s||!this._dur&&!n||this._initted&&Math.abs(this._zTime)===Ct||!s&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=s),Eh(this,s,n)),this},t.time=function(s,n){return arguments.length?this.totalTime(Math.min(this.totalDuration(),s+Ol(this))%(this._dur+this._rDelay)||(s?this._dur:0),n):this._time},t.totalProgress=function(s,n){return arguments.length?this.totalTime(this.totalDuration()*s,n):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>0?1:0},t.progress=function(s,n){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-s:s)+Ol(this),n):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},t.iteration=function(s,n){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(s-1)*r,n):this._repeat?Hn(this._tTime,r)+1:1},t.timeScale=function(s,n){if(!arguments.length)return this._rts===-Ct?0:this._rts;if(this._rts===s)return this;var r=this.parent&&this._ts?oo(this.parent._time,this):this._tTime;return this._rts=+s||0,this._ts=this._ps||s===-Ct?0:this._rts,this.totalTime(hr(-Math.abs(this._delay),this._tDur,r),n!==!1),Mo(this),V1(this)},t.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):(Gn(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Ct&&(this._tTime-=Ct)))),this):this._ps},t.startTime=function(s){if(arguments.length){this._start=s;var n=this.parent||this._dp;return n&&(n._sort||!this.parent)&&$e(n,this,s-this._delay),this}return this._start},t.endTime=function(s){return this._start+(ue(s)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},t.rawTime=function(s){var n=this.parent||this._dp;return n?s&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?oo(n.rawTime(s),this):this._tTime:this._tTime},t.revert=function(s){s===void 0&&(s=N1);var n=Jt;return Jt=s,(this._initted||this._startAt)&&(this.timeline&&this.timeline.revert(s),this.totalTime(-.01,s.suppressEvents)),this.data!=="nested"&&s.kill!==!1&&this.kill(),Jt=n,this},t.globalTime=function(s){for(var n=this,r=arguments.length?s:n.rawTime();n;)r=n._start+r/(Math.abs(n._ts)||1),n=n._dp;return!this.parent&&this._sat?this._sat.globalTime(s):r},t.repeat=function(s){return arguments.length?(this._repeat=s===1/0?-2:s,Al(this)):this._repeat===-2?1/0:this._repeat},t.repeatDelay=function(s){if(arguments.length){var n=this._time;return this._rDelay=s,Al(this),n?this.time(n):this}return this._rDelay},t.yoyo=function(s){return arguments.length?(this._yoyo=s,this):this._yoyo},t.seek=function(s,n){return this.totalTime(be(this,s),ue(n))},t.restart=function(s,n){return this.play().totalTime(s?-this._delay:0,ue(n))},t.play=function(s,n){return s!=null&&this.seek(s,n),this.reversed(!1).paused(!1)},t.reverse=function(s,n){return s!=null&&this.seek(s||this.totalDuration(),n),this.reversed(!0).paused(!1)},t.pause=function(s,n){return s!=null&&this.seek(s,n),this.paused(!0)},t.resume=function(){return this.paused(!1)},t.reversed=function(s){return arguments.length?(!!s!==this.reversed()&&this.timeScale(-this._rts||(s?-Ct:0)),this):this._rts<0},t.invalidate=function(){return this._initted=this._act=0,this._zTime=-Ct,this},t.isActive=function(){var s=this.parent||this._dp,n=this._start,r;return!!(!s||this._ts&&this._initted&&s.isActive()&&(r=s.rawTime(!0))>=n&&r1?(n?(o[s]=n,r&&(o[s+"Params"]=r),s==="onUpdate"&&(this._onUpdate=n)):delete o[s],this):o[s]},t.then=function(s){var n=this;return new Promise(function(r){var o=Vt(s)?s:Ah,a=function(){var l=n.then;n.then=null,Vt(o)&&(o=o(n))&&(o.then||o===n)&&(n.then=l),r(o),n.then=l};n._initted&&n.totalProgress()===1&&n._ts>=0||!n._tTime&&n._ts<0?a():n._prom=a})},t.kill=function(){vi(this)},i}();De(Xi.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:-Ct,_prom:0,_ps:!1,_rts:1});var ie=function(i){_h(t,i);function t(s,n){var r;return s===void 0&&(s={}),r=i.call(this,s)||this,r.labels={},r.smoothChildTiming=!!s.smoothChildTiming,r.autoRemoveChildren=!!s.autoRemoveChildren,r._sort=ue(s.sortChildren),Nt&&$e(s.parent||Nt,ls(r),n),s.reversed&&r.reverse(),s.paused&&r.paused(!0),s.scrollTrigger&&Ph(ls(r),s.scrollTrigger),r}var e=t.prototype;return e.to=function(n,r,o){return Ci(0,arguments,this),this},e.from=function(n,r,o){return Ci(1,arguments,this),this},e.fromTo=function(n,r,o,a){return Ci(2,arguments,this),this},e.set=function(n,r,o){return r.duration=0,r.parent=this,bi(r).repeatDelay||(r.repeat=0),r.immediateRender=!!r.immediateRender,new Ht(n,r,be(this,o),1),this},e.call=function(n,r,o){return $e(this,Ht.delayedCall(0,n,r),o)},e.staggerTo=function(n,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 Ht(n,o,be(this,c)),this},e.staggerFrom=function(n,r,o,a,c,l,u){return o.runBackwards=1,bi(o).immediateRender=ue(o.immediateRender),this.staggerTo(n,r,o,a,c,l,u)},e.staggerFromTo=function(n,r,o,a,c,l,u,h){return a.startAt=o,bi(a).immediateRender=ue(a.immediateRender),this.staggerTo(n,r,a,c,l,u,h)},e.render=function(n,r,o){var a=this._time,c=this._dirty?this.totalDuration():this._tDur,l=this._dur,u=n<=0?0:$t(n),h=this._zTime<0!=n<0&&(this._initted||!l),d,p,_,f,m,v,b,w,g,y,k,T;if(this!==Nt&&u>c&&n>=0&&(u=c),u!==this._tTime||o||h){if(a!==this._time&&l&&(u+=this._time-a,n+=this._time-a),d=u,g=this._start,w=this._ts,v=!w,h&&(l||(a=this._zTime),(n||!r)&&(this._zTime=n)),this._repeat){if(k=this._yoyo,m=l+this._rDelay,this._repeat<-1&&n<0)return this.totalTime(m*100+n,r,o);if(d=$t(u%m),u===c?(f=this._repeat,d=l):(f=~~(u/m),f&&f===u/m&&(d=l,f--),d>l&&(d=l)),y=Hn(this._tTime,m),!a&&this._tTime&&y!==f&&this._tTime-y*m-this._dur<=0&&(y=f),k&&f&1&&(d=l-d,T=1),f!==y&&!this._lock){var x=k&&y&1,C=x===(k&&f&1);if(f=a&&n>=0)for(p=this._first;p;){if(_=p._next,(p._act||d>=p._start)&&p._ts&&b!==p){if(p.parent!==this)return this.render(n,r,o);if(p.render(p._ts>0?(d-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(d-p._start)*p._ts,r,o),d!==this._time||!this._ts&&!v){b=0,_&&(u+=this._zTime=-Ct);break}}p=_}else{p=this._last;for(var O=n<0?n:d;p;){if(_=p._prev,(p._act||O<=p._end)&&p._ts&&b!==p){if(p.parent!==this)return this.render(n,r,o);if(p.render(p._ts>0?(O-p._start)*p._ts:(p._dirty?p.totalDuration():p._tDur)+(O-p._start)*p._ts,r,o||Jt&&(p._initted||p._startAt)),d!==this._time||!this._ts&&!v){b=0,_&&(u+=this._zTime=O?-Ct:Ct);break}}p=_}}if(b&&!r&&(this.pause(),b.render(d>=a?0:-Ct)._zTime=d>=a?1:-1,this._ts))return this._start=g,Mo(this),this.render(n,r,o);this._onUpdate&&!r&&ve(this,"onUpdate",!0),(u===c&&this._tTime>=this.totalDuration()||!u&&a)&&(g===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((n||!l)&&(u===c&&this._ts>0||!u&&this._ts<0)&&Fs(this,1),!r&&!(n<0&&!a)&&(u||a||!c)&&(ve(this,u===c&&n>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(u0)&&this._prom())))}return this},e.add=function(n,r){var o=this;if(ms(r)||(r=be(this,r,n)),!(n instanceof Xi)){if(te(n))return n.forEach(function(a){return o.add(a,r)}),this;if(Xt(n))return this.addLabel(n,r);if(Vt(n))n=Ht.delayedCall(0,n);else return this}return this!==n?$e(this,n,r):this},e.getChildren=function(n,r,o,a){n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),a===void 0&&(a=-Oe);for(var c=[],l=this._first;l;)l._start>=a&&(l instanceof Ht?r&&c.push(l):(o&&c.push(l),n&&c.push.apply(c,l.getChildren(!0,r,o)))),l=l._next;return c},e.getById=function(n){for(var r=this.getChildren(1,1,1),o=r.length;o--;)if(r[o].vars.id===n)return r[o]},e.remove=function(n){return Xt(n)?this.removeLabel(n):Vt(n)?this.killTweensOf(n):(Ao(this,n),n===this._recent&&(this._recent=this._last),en(this))},e.totalTime=function(n,r){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=$t(ye.time-(this._ts>0?n/this._ts:(this.totalDuration()-n)/-this._ts))),i.prototype.totalTime.call(this,n,r),this._forcing=0,this):this._tTime},e.addLabel=function(n,r){return this.labels[n]=be(this,r),this},e.removeLabel=function(n){return delete this.labels[n],this},e.addPause=function(n,r,o){var a=Ht.delayedCall(0,r||Gi,o);return a.data="isPause",this._hasPause=1,$e(this,a,be(this,n))},e.removePause=function(n){var r=this._first;for(n=be(this,n);r;)r._start===n&&r.data==="isPause"&&Fs(r),r=r._next},e.killTweensOf=function(n,r,o){for(var a=this.getTweensOf(n,o),c=a.length;c--;)bs!==a[c]&&a[c].kill(n,r);return this},e.getTweensOf=function(n,r){for(var o=[],a=Ae(n),c=this._first,l=ms(r),u;c;)c instanceof Ht?R1(c._targets,a)&&(l?(!bs||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},e.tweenTo=function(n,r){r=r||{};var o=this,a=be(o,n),c=r,l=c.startAt,u=c.onStart,h=c.onStartParams,d=c.immediateRender,p,_=Ht.to(o,De({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())||Ct,onStart:function(){if(o.pause(),!p){var m=r.duration||Math.abs((a-(l&&"time"in l?l.time:o._time))/o.timeScale());_._dur!==m&&Yn(_,m,0,1).render(_._time,!0,!0),p=1}u&&u.apply(_,h||[])}},r));return d?_.render(0):_},e.tweenFromTo=function(n,r,o){return this.tweenTo(r,De({startAt:{time:be(this,n)}},o))},e.recent=function(){return this._recent},e.nextLabel=function(n){return n===void 0&&(n=this._time),Ml(this,be(this,n))},e.previousLabel=function(n){return n===void 0&&(n=this._time),Ml(this,be(this,n),1)},e.currentLabel=function(n){return arguments.length?this.seek(n,!0):this.previousLabel(this._time+Ct)},e.shiftChildren=function(n,r,o){o===void 0&&(o=0);for(var a=this._first,c=this.labels,l;a;)a._start>=o&&(a._start+=n,a._end+=n),a=a._next;if(r)for(l in c)c[l]>=o&&(c[l]+=n);return en(this)},e.invalidate=function(n){var r=this._first;for(this._lock=0;r;)r.invalidate(n),r=r._next;return i.prototype.invalidate.call(this,n)},e.clear=function(n){n===void 0&&(n=!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),n&&(this.labels={}),en(this)},e.totalDuration=function(n){var r=0,o=this,a=o._last,c=Oe,l,u,h;if(arguments.length)return o.timeScale((o._repeat<0?o.duration():o.totalDuration())/(o.reversed()?-n:n));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,$e(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;Yn(o,o===Nt&&o._time>r?o._time:r,1,1),o._dirty=0}return o._tDur},t.updateRoot=function(n){if(Nt._ts&&(Eh(Nt,oo(n,Nt)),Ch=ye.frame),ye.frame>=Sl){Sl+=ke.autoSleep||120;var r=Nt._first;if((!r||!r._ts)&&ke.autoSleep&&ye._listeners.length<2){for(;r&&!r._ts;)r=r._next;r||ye.sleep()}}},t}(Xi);De(ie.prototype,{_lock:0,_hasPause:0,_forcing:0});var iv=function(t,e,s,n,r,o,a){var c=new de(this._pt,t,e,0,1,ed,null,r),l=0,u=0,h,d,p,_,f,m,v,b;for(c.b=s,c.e=n,s+="",n+="",(v=~n.indexOf("random("))&&(n=$i(n)),o&&(b=[s,n],o(b,t,e),s=b[0],n=b[1]),d=s.match(Yo)||[];h=Yo.exec(n);)_=h[0],f=n.substring(l,h.index),p?p=(p+1)%5:f.substr(-5)==="rgba("&&(p=1),_!==d[u++]&&(m=parseFloat(d[u-1])||0,c._pt={_next:c._pt,p:f||u===1?f:",",s:m,c:_.charAt(1)==="="?Nn(m,_)-m:parseFloat(_)-m,m:p&&p<4?Math.round:0},l=Yo.lastIndex);return c.c=l")}),g.duration();else{k={};for(x in _)x==="ease"||x==="easeEach"||cv(x,_[x],k,_.easeEach);for(x in k)for(V=k[x].sort(function(Y,j){return Y.t-j.t}),M=0,y=0;yc-Ct&&!u?c:nl&&(d=l)),v=this._yoyo&&_&1,v&&(g=this._yEase,d=l-d),m=Hn(this._tTime,f),d===a&&!o&&this._initted&&_===m)return this._tTime=h,this;_!==m&&(w&&this._yEase&&Gh(w,v),this.vars.repeatRefresh&&!v&&!this._lock&&this._time!==l&&this._initted&&(this._lock=o=1,this.render($t(f*_),!0).invalidate()._lock=0))}if(!this._initted){if(Ih(this,u?n:d,o,r,h))return this._tTime=0,this;if(a!==this._time&&!(o&&this.vars.repeatRefresh&&_!==m))return this;if(l!==this._dur)return this.render(n,r,o)}if(this._tTime=h,this._time=d,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=b=(g||this._ease)(d/l),this._from&&(this.ratio=b=1-b),d&&!a&&!r&&!_&&(ve(this,"onStart"),this._tTime!==h))return this;for(p=this._pt;p;)p.r(b,p.d),p=p._next;w&&w.render(n<0?n:!d&&v?-Ct:w._dur*w._ease(d/this._dur),r,o)||this._startAt&&(this._zTime=n),this._onUpdate&&!r&&(u&&xa(this,n,r,o),ve(this,"onUpdate")),this._repeat&&_!==m&&this.vars.onRepeat&&!r&&this.parent&&ve(this,"onRepeat"),(h===this._tDur||!h)&&this._tTime===h&&(u&&!this._onUpdate&&xa(this,n,!0,!0),(n||!l)&&(h===this._tDur&&this._ts>0||!h&&this._ts<0)&&Fs(this,1),!r&&!(u&&!a)&&(h||a||v)&&(ve(this,h===c?"onComplete":"onReverseComplete",!0),this._prom&&!(h0)&&this._prom()))}return this},e.targets=function(){return this._targets},e.invalidate=function(n){return(!n||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(n),i.prototype.invalidate.call(this,n)},e.resetTo=function(n,r,o,a,c){Zi||ye.wake(),this._ts||this.play();var l=Math.min(this._dur,(this._dp._time-this._start)*this._ts),u;return this._initted||Tc(this,l),u=this._ease(l/this._dur),ov(this,n,r,o,a,u,l,c)?this.resetTo(n,r,o,a,1):(Do(this,0),this.parent||Mh(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function(n,r){if(r===void 0&&(r="all"),!n&&(!r||r==="all"))return this._lazy=this._pt=0,this.parent?vi(this):this;if(this.timeline){var o=this.timeline.totalDuration();return this.timeline.killTweensOf(n,r,bs&&bs.vars.overwrite!==!0)._first||vi(this),this.parent&&o!==this.timeline.totalDuration()&&Yn(this,this._dur*this.timeline._tDur/o,0,1),this}var a=this._targets,c=n?Ae(n):a,l=this._ptLookup,u=this._pt,h,d,p,_,f,m,v;if((!r||r==="all")&&L1(a,c))return r==="all"&&(this._pt=0),vi(this);for(h=this._op=this._op||[],r!=="all"&&(Xt(r)&&(f={},he(r,function(b){return f[b]=1}),r=f),r=av(a,r)),v=a.length;v--;)if(~c.indexOf(a[v])){d=l[v],r==="all"?(h[v]=r,_=d,p={}):(p=h[v]=h[v]||{},_=r);for(f in _)m=d&&d[f],m&&((!("kill"in m.d)||m.d.kill(f)===!0)&&Ao(this,m,"_pt"),delete d[f]),p!=="all"&&(p[f]=1)}return this._initted&&!this._pt&&u&&vi(this),this},t.to=function(n,r){return new t(n,r,arguments[2])},t.from=function(n,r){return Ci(1,arguments)},t.delayedCall=function(n,r,o,a){return new t(r,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:n,onComplete:r,onReverseComplete:r,onCompleteParams:o,onReverseCompleteParams:o,callbackScope:a})},t.fromTo=function(n,r,o){return Ci(2,arguments)},t.set=function(n,r){return r.duration=0,r.repeatDelay||(r.repeat=0),new t(n,r)},t.killTweensOf=function(n,r,o){return Nt.killTweensOf(n,r,o)},t}(Xi);De(Ht.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});he("staggerTo,staggerFrom,staggerFromTo",function(i){Ht[i]=function(){var t=new ie,e=Ta.call(arguments,0);return e.splice(i==="staggerFromTo"?5:4,0,0),t[i].apply(t,e)}});var wc=function(t,e,s){return t[e]=s},Jh=function(t,e,s){return t[e](s)},lv=function(t,e,s,n){return t[e](n.fp,s)},uv=function(t,e,s){return t.setAttribute(e,s)},bc=function(t,e){return Vt(t[e])?Jh:pc(t[e])&&t.setAttribute?uv:wc},td=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e6)/1e6,e)},hv=function(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ed=function(t,e){var s=e._pt,n="";if(!t&&e.b)n=e.b;else if(t===1&&e.e)n=e.e;else{for(;s;)n=s.p+(s.m?s.m(s.s+s.c*t):Math.round((s.s+s.c*t)*1e4)/1e4)+n,s=s._next;n+=e.c}e.set(e.t,e.p,n,e)},Cc=function(t,e){for(var s=e._pt;s;)s.r(t,s.d),s=s._next},dv=function(t,e,s,n){for(var r=this._pt,o;r;)o=r._next,r.p===n&&r.modifier(t,e,s),r=o},fv=function(t){for(var e=this._pt,s,n;e;)n=e._next,e.p===t&&!e.op||e.op===t?Ao(this,e,"_pt"):e.dep||(s=1),e=n;return!s},pv=function(t,e,s,n){n.mSet(t,e,n.m.call(n.tween,s,n.mt),n)},sd=function(t){for(var e=t._pt,s,n,r,o;e;){for(s=e._next,n=r;n&&n.pr>e.pr;)n=n._next;(e._prev=n?n._prev:o)?e._prev._next=e:r=e,(e._next=n)?n._prev=e:o=e,e=s}t._pt=r},de=function(){function i(e,s,n,r,o,a,c,l,u){this.t=s,this.s=r,this.c=o,this.p=n,this.r=a||td,this.d=c||this,this.set=l||wc,this.pr=u||0,this._next=e,e&&(e._prev=this)}var t=i.prototype;return t.modifier=function(s,n,r){this.mSet=this.mSet||this.set,this.set=pv,this.m=s,this.mt=r,this.tween=n},i}();he(vc+"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(i){return yc[i]=1});Te.TweenMax=Te.TweenLite=Ht;Te.TimelineLite=Te.TimelineMax=ie;Nt=new ie({sortChildren:!1,defaults:Wn,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});ke.stringFilter=Hh;var nn=[],Nr={},mv=[],Pl=0,_v=0,Qo=function(t){return(Nr[t]||mv).map(function(e){return e()})},Sa=function(){var t=Date.now(),e=[];t-Pl>2&&(Qo("matchMediaInit"),nn.forEach(function(s){var n=s.queries,r=s.conditions,o,a,c,l;for(a in n)o=Ce.matchMedia(n[a]).matches,o&&(c=1),o!==r[a]&&(r[a]=o,l=1);l&&(s.revert(),c&&e.push(s))}),Qo("matchMediaRevert"),e.forEach(function(s){return s.onMatch(s,function(n){return s.add(null,n)})}),Pl=t,Qo("matchMedia"))},nd=function(){function i(e,s){this.selector=s&&wa(s),this.data=[],this._r=[],this.isReverted=!1,this.id=_v++,e&&this.add(e)}var t=i.prototype;return t.add=function(s,n,r){Vt(s)&&(r=n,n=s,s=Vt);var o=this,a=function(){var l=Lt,u=o.selector,h;return l&&l!==o&&l.data.push(o),r&&(o.selector=wa(r)),Lt=o,h=n.apply(o,arguments),Vt(h)&&o._r.push(h),Lt=l,o.selector=u,o.isReverted=!1,h};return o.last=a,s===Vt?a(o,function(c){return o.add(null,c)}):s?o[s]=a:a},t.ignore=function(s){var n=Lt;Lt=null,s(this),Lt=n},t.getTweens=function(){var s=[];return this.data.forEach(function(n){return n instanceof i?s.push.apply(s,n.getTweens()):n instanceof Ht&&!(n.parent&&n.parent.data==="nested")&&s.push(n)}),s},t.clear=function(){this._r.length=this.data.length=0},t.kill=function(s,n){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 ie?l.data!=="nested"&&(l.scrollTrigger&&l.scrollTrigger.revert(),l.kill()):!(l instanceof Ht)&&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(),n)for(var o=nn.length;o--;)nn[o].id===this.id&&nn.splice(o,1)},t.revert=function(s){this.kill(s||{})},i}(),gv=function(){function i(e){this.contexts=[],this.scope=e}var t=i.prototype;return t.add=function(s,n,r){Je(s)||(s={matches:s});var o=new nd(0,r||this.scope),a=o.conditions={},c,l,u;Lt&&!o.selector&&(o.selector=Lt.selector),this.contexts.push(o),n=o.add("onMatch",n),o.queries=s;for(l in s)l==="all"?u=1:(c=Ce.matchMedia(s[l]),c&&(nn.indexOf(o)<0&&nn.push(o),(a[l]=c.matches)&&(u=1),c.addListener?c.addListener(Sa):c.addEventListener("change",Sa)));return u&&n(o,function(h){return o.add(null,h)}),this},t.revert=function(s){this.kill(s||{})},t.kill=function(s){this.contexts.forEach(function(n){return n.kill(s,!0)})},i}(),ao={registerPlugin:function(){for(var t=arguments.length,e=new Array(t),s=0;s1){var n=t.map(function(u){return _e.quickSetter(u,e,s)}),r=n.length;return function(u){for(var h=r;h--;)n[h](u)}}t=t[0]||{};var o=ge[e],a=tn(t),c=a.harness&&(a.harness.aliases||{})[e]||e,l=o?function(u){var h=new o;Dn._pt=0,h.init(t,s?u+s:u,Dn,0,[t]),h.render(1,h),Dn._pt&&Cc(1,Dn)}:a.set(t,c);return o?l:function(u){return l(t,c,s?u+s:u,a,1)}},quickTo:function(t,e,s){var n,r=_e.to(t,un((n={},n[e]="+=0.1",n.paused=!0,n),s||{})),o=function(c,l,u){return r.resetTo(e,c,l,u)};return o.tween=r,o},isTweening:function(t){return Nt.getTweensOf(t,!0).length>0},defaults:function(t){return t&&t.ease&&(t.ease=sn(t.ease,Wn.ease)),El(Wn,t||{})},config:function(t){return El(ke,t||{})},registerEffect:function(t){var e=t.name,s=t.effect,n=t.plugins,r=t.defaults,o=t.extendTimeline;(n||"").split(",").forEach(function(a){return a&&!ge[a]&&!Te[a]&&Yi(e+" effect requires "+a+" plugin.")}),Go[e]=function(a,c,l){return s(Ae(a),De(c||{},r),l)},o&&(ie.prototype[e]=function(a,c,l){return this.add(Go[e](a,Je(c)?c:(l=c)&&{},this),l)})},registerEase:function(t,e){ft[t]=sn(e)},parseEase:function(t,e){return arguments.length?sn(t,e):ft},getById:function(t){return Nt.getById(t)},exportRoot:function(t,e){t===void 0&&(t={});var s=new ie(t),n,r;for(s.smoothChildTiming=ue(t.smoothChildTiming),Nt.remove(s),s._dp=0,s._time=s._tTime=Nt._time,n=Nt._first;n;)r=n._next,(e||!(!n._dur&&n instanceof Ht&&n.vars.onComplete===n._targets[0]))&&$e(s,n,n._start-n._delay),n=r;return $e(Nt,s,0),s},context:function(t,e){return t?new nd(t,e):Lt},matchMedia:function(t){return new gv(t)},matchMediaRefresh:function(){return nn.forEach(function(t){var e=t.conditions,s,n;for(n in e)e[n]&&(e[n]=!1,s=1);s&&t.revert()})||Sa()},addEventListener:function(t,e){var s=Nr[t]||(Nr[t]=[]);~s.indexOf(e)||s.push(e)},removeEventListener:function(t,e){var s=Nr[t],n=s&&s.indexOf(e);n>=0&&s.splice(n,1)},utils:{wrap:Z1,wrapYoyo:X1,distribute:Fh,random:Vh,snap:Lh,normalize:$1,getUnit:Kt,clamp:W1,splitColor:qh,toArray:Ae,selector:wa,mapRange:zh,pipe:Y1,unitize:G1,interpolate:Q1,shuffle:Rh},install:wh,effects:Go,ticker:ye,updateRoot:ie.updateRoot,plugins:ge,globalTimeline:Nt,core:{PropTween:de,globals:bh,Tween:Ht,Timeline:ie,Animation:Xi,getCache:tn,_removeLinkedListItem:Ao,reverting:function(){return Jt},context:function(t){return t&&Lt&&(Lt.data.push(t),t._ctx=Lt),Lt},suppressOverwrites:function(t){return fc=t}}};he("to,from,fromTo,delayedCall,set,killTweensOf",function(i){return ao[i]=Ht[i]});ye.add(ie.updateRoot);Dn=ao.to({},{duration:0});var yv=function(t,e){for(var s=t._pt;s&&s.p!==e&&s.op!==e&&s.fp!==e;)s=s._next;return s},vv=function(t,e){var s=t._targets,n,r,o;for(n in e)for(r=s.length;r--;)o=t._ptLookup[r][n],o&&(o=o.d)&&(o._pt&&(o=yv(o,n)),o&&o.modifier&&o.modifier(e[n],t,s[r],n))},Ko=function(t,e){return{name:t,rawVars:1,init:function(n,r,o){o._onInit=function(a){var c,l;if(Xt(r)&&(c={},he(r,function(u){return c[u]=1}),r=c),e){c={};for(l in r)c[l]=e(r[l]);r=c}vv(a,r)}}}},_e=ao.registerPlugin({name:"attr",init:function(t,e,s,n,r){var o,a,c;this.tween=s;for(o in e)c=t.getAttribute(o)||"",a=this.add(t,"setAttribute",(c||0)+"",e[o],n,r,0,0,o),a.op=o,a.b=c,this._props.push(o)},render:function(t,e){for(var s=e._pt;s;)Jt?s.set(s.t,s.p,s.b,s):s.r(t,s.d),s=s._next}},{name:"endArray",init:function(t,e){for(var s=e.length;s--;)this.add(t,s,t[s]||0,e[s],0,0,0,0,0,1)}},Ko("roundProps",ba),Ko("modifiers"),Ko("snap",Lh))||ao;Ht.version=ie.version=_e.version="3.12.4";Th=1;mc()&&Gn();ft.Power0;ft.Power1;ft.Power2;ft.Power3;ft.Power4;ft.Linear;ft.Quad;ft.Cubic;ft.Quart;ft.Quint;ft.Strong;ft.Elastic;ft.Back;ft.SteppedEase;ft.Bounce;ft.Sine;ft.Expo;ft.Circ;/*! * CSSPlugin 3.12.4 * https://gsap.com * @@ -356,7 +356,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a * 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 Vl,Ss,Fn,Mc,Qs,Ul,Dc,Pv=function(){return typeof window<"u"},gs={},$s=180/Math.PI,Ln=Math.PI/180,Cn=Math.atan2,jl=1e8,Pc=/([A-Z])/g,Iv=/(left|right|width|margin|padding|x)/i,Nv=/[\s,\(]\S/,Qe={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Pa=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},Rv=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},Fv=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},Lv=function(t,e){var s=e.s+e.c*t;e.set(e.t,e.p,~~(s+(s<0?-.5:.5))+e.u,e)},dd=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},fd=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},Vv=function(t,e,s){return t.style[e]=s},Uv=function(t,e,s){return t.style.setProperty(e,s)},jv=function(t,e,s){return t._gsap[e]=s},zv=function(t,e,s){return t._gsap.scaleX=t._gsap.scaleY=s},Bv=function(t,e,s,n,r){var o=t._gsap;o.scaleX=o.scaleY=s,o.renderTransform(r,o)},qv=function(t,e,s,n,r){var o=t._gsap;o[e]=s,o.renderTransform(r,o)},Rt="transform",pe=Rt+"Origin",Wv=function i(t,e){var s=this,n=this.target,r=n.style,o=n._gsap;if(t in gs&&r){if(this.tfm=this.tfm||{},t!=="transform")t=Qe[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return s.tfm[a]=hs(n,a)}):this.tfm[t]=o.x?o[t]:hs(n,t),t===pe&&(this.tfm.zOrigin=o.zOrigin);else return Qe.transform.split(",").forEach(function(a){return i.call(s,a,e)});if(this.props.indexOf(Rt)>=0)return;o.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(pe,e,"")),t=Rt}(r||e)&&this.props.push(t,e,r[t])},pd=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},Hv=function(){var t=this.props,e=this.target,s=e.style,n=e._gsap,r,o;for(r=0;r=0?zl[o]:"")+t},Na=function(){Pv()&&window.document&&(Vl=window,Ss=Vl.document,Fn=Ss.documentElement,Qs=Ia("div")||{style:{}},Ia("div"),Rt=Zn(Rt),pe=Rt+"Origin",Qs.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",_d=!!Zn("perspective"),Dc=_e.core.reverting,Mc=1)},ia=function i(t){var e=Ia("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=this.parentNode,n=this.nextSibling,r=this.style.cssText,o;if(Fn.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=i}catch{}else this._gsapBBox&&(o=this._gsapBBox());return s&&(n?s.insertBefore(this,n):s.appendChild(this)),Fn.removeChild(e),this.style.cssText=r,o},Bl=function(t,e){for(var s=e.length;s--;)if(t.hasAttribute(e[s]))return t.getAttribute(e[s])},gd=function(t){var e;try{e=t.getBBox()}catch{e=ia.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===ia||(e=ia.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+Bl(t,["x","cx","x1"])||0,y:+Bl(t,["y","cy","y1"])||0,width:0,height:0}:e},yd=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&gd(t))},dn=function(t,e){if(e){var s=t.style,n;e in gs&&e!==pe&&(e=Rt),s.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),s.removeProperty(n==="--"?e:e.replace(Pc,"-$1").toLowerCase())):s.removeAttribute(e)}},Es=function(t,e,s,n,r,o){var a=new fe(t._pt,e,s,0,1,o?fd:dd);return t._pt=a,a.b=n,a.e=r,t._props.push(s),a},ql={deg:1,rad:1,turn:1},Gv={grid:1,flex:1},Vs=function i(t,e,s,n){var r=parseFloat(s)||0,o=(s+"").trim().substr((r+"").length)||"px",a=Qs.style,c=Iv.test(e),l=t.tagName.toLowerCase()==="svg",u=(l?"client":"offset")+(c?"Width":"Height"),h=100,d=n==="px",p=n==="%",_,f,m,v;if(n===o||!r||ql[n]||ql[o])return r;if(o!=="px"&&!d&&(r=i(t,e,s,"px")),v=t.getCTM&&yd(t),(p||o==="%")&&(gs[e]||~e.indexOf("adius")))return _=v?t.getBBox()[c?"width":"height"]:t[u],zt(p?r/_*h:r/100*_);if(a[c?"width":"height"]=h+(d?o:n),f=~e.indexOf("adius")||n==="em"&&t.appendChild&&!l?t:t.parentNode,v&&(f=(t.ownerSVGElement||{}).parentNode),(!f||f===Ss||!f.appendChild)&&(f=Ss.body),m=f._gsap,m&&p&&m.width&&c&&m.time===ve.time&&!m.uncache)return zt(r/m.width*h);if(p&&(e==="height"||e==="width")){var b=t.style[e];t.style[e]=h+n,_=t[u],b?t.style[e]=b:dn(t,e)}else(p||o==="%")&&!Gv[Je(f,"display")]&&(a.position=Je(t,"position")),f===t&&(a.position="static"),f.appendChild(Qs),_=Qs[u],f.removeChild(Qs),a.position="absolute";return c&&p&&(m=en(f),m.time=ve.time,m.width=f[u]),zt(d?_*r/h:_&&r?h/_*r:0)},hs=function(t,e,s,n){var r;return Mc||Na(),e in Qe&&e!=="transform"&&(e=Qe[e],~e.indexOf(",")&&(e=e.split(",")[0])),gs[e]&&e!=="transform"?(r=tr(t,n),r=e!=="transformOrigin"?r[e]:r.svg?r.origin:mo(Je(t,pe))+" "+r.zOrigin+"px"):(r=t.style[e],(!r||r==="auto"||n||~(r+"").indexOf("calc("))&&(r=po[e]&&po[e](t,e,s)||Je(t,e)||Nh(t,e)||(e==="opacity"?1:0))),s&&!~(r+"").trim().indexOf(" ")?Vs(t,e,r,s)+s:r},Yv=function(t,e,s,n){if(!s||s==="none"){var r=Zn(e,t,1),o=r&&Je(t,r,1);o&&o!==s?(e=r,s=o):e==="borderColor"&&(s=Je(t,"borderTopColor"))}var a=new fe(this._pt,t.style,e,0,1,ld),c=0,l=0,u,h,d,p,_,f,m,v,b,w,g,y;if(a.b=s,a.e=n,s+="",n+="",n==="auto"&&(f=t.style[e],t.style[e]=n,n=Je(t,e)||n,f?t.style[e]=f:dn(t,e)),u=[s,n],Jh(u),s=u[0],n=u[1],d=s.match(Dn)||[],y=n.match(Dn)||[],y.length){for(;h=Dn.exec(n);)m=h[0],b=n.substring(c,h.index),_?_=(_+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(_=1),m!==(f=d[l++]||"")&&(p=parseFloat(f)||0,g=f.substr((p+"").length),m.charAt(1)==="="&&(m=Rn(p,m)+g),v=parseFloat(m),w=m.substr((v+"").length),c=Dn.lastIndex-w.length,w||(w=w||Te.units[e]||g,c===n.length&&(n+=w,a.e+=w)),g!==w&&(p=Vs(t,e,f,w)||0),a._pt={_next:a._pt,p:b||l===1?b:",",s:p,c:v-p,m:_&&_<4||e==="zIndex"?Math.round:0});a.c=c-1;)a=r[l],gs[a]&&(c=1,a=a==="transformOrigin"?pe:Rt),dn(s,a);c&&(dn(s,Rt),o&&(o.svg&&s.removeAttribute("transform"),tr(s,1),o.uncache=1,pd(n)))}},po={clearProps:function(t,e,s,n,r){if(r.data!=="isFromStart"){var o=t._pt=new fe(t._pt,e,s,0,0,Zv);return o.u=n,o.pr=-10,o.tween=r,t._props.push(s),1}}},Ji=[1,0,0,1,0,0],vd={},xd=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},Hl=function(t){var e=Je(t,Rt);return xd(e)?Ji:e.substr(7).match(Eh).map(zt)},Ic=function(t,e){var s=t._gsap||en(t),n=t.style,r=Hl(t),o,a,c,l;return s.svg&&t.getAttribute("transform")?(c=t.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"?Ji:r):(r===Ji&&!t.offsetParent&&t!==Fn&&!s.svg&&(c=n.display,n.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(l=1,a=t.nextElementSibling,Fn.appendChild(t)),r=Hl(t),c?n.display=c:dn(t,"display"),l&&(a?o.insertBefore(t,a):o?o.appendChild(t):Fn.removeChild(t))),e&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r)},Ra=function(t,e,s,n,r,o){var a=t._gsap,c=r||Ic(t,!0),l=a.xOrigin||0,u=a.yOrigin||0,h=a.xOffset||0,d=a.yOffset||0,p=c[0],_=c[1],f=c[2],m=c[3],v=c[4],b=c[5],w=e.split(" "),g=parseFloat(w[0])||0,y=parseFloat(w[1])||0,k,T,x,C;s?c!==Ji&&(T=p*m-_*f)&&(x=g*(m/T)+y*(-f/T)+(f*b-m*v)/T,C=g*(-_/T)+y*(p/T)-(p*b-_*v)/T,g=x,y=C):(k=gd(t),g=k.x+(~w[0].indexOf("%")?g/100*k.width:g),y=k.y+(~(w[1]||w[0]).indexOf("%")?y/100*k.height:y)),n||n!==!1&&a.smooth?(v=g-l,b=y-u,a.xOffset=h+(v*p+b*f)-v,a.yOffset=d+(v*_+b*m)-b):a.xOffset=a.yOffset=0,a.xOrigin=g,a.yOrigin=y,a.smooth=!!n,a.origin=e,a.originIsAbsolute=!!s,t.style[pe]="0px 0px",o&&(Es(o,a,"xOrigin",l,g),Es(o,a,"yOrigin",u,y),Es(o,a,"xOffset",h,a.xOffset),Es(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",g+" "+y)},tr=function(t,e){var s=t._gsap||new nd(t);if("x"in s&&!e&&!s.uncache)return s;var n=t.style,r=s.scaleX<0,o="px",a="deg",c=getComputedStyle(t),l=Je(t,pe)||"0",u,h,d,p,_,f,m,v,b,w,g,y,k,T,x,C,O,P,M,V,B,Y,G,z,j,Z,Q,et,R,F,S,I;return u=h=d=f=m=v=b=w=g=0,p=_=1,s.svg=!!(t.getCTM&&yd(t)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[Rt]=(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[Rt]!=="none"?c[Rt]:"")),n.scale=n.rotate=n.translate="none"),T=Ic(t,s.svg),s.svg&&(s.uncache?(j=t.getBBox(),l=s.xOrigin-j.x+"px "+(s.yOrigin-j.y)+"px",z=""):z=!e&&t.getAttribute("data-svg-origin"),Ra(t,z||l,!!z||s.originIsAbsolute,s.smooth!==!1,T)),y=s.xOrigin||0,k=s.yOrigin||0,T!==Ji&&(P=T[0],M=T[1],V=T[2],B=T[3],u=Y=T[4],h=G=T[5],T.length===6?(p=Math.sqrt(P*P+M*M),_=Math.sqrt(B*B+V*V),f=P||M?Cn(M,P)*$s:0,b=V||B?Cn(V,B)*$s+f:0,b&&(_*=Math.abs(Math.cos(b*Ln))),s.svg&&(u-=y-(y*P+k*V),h-=k-(y*M+k*B))):(I=T[6],F=T[7],Q=T[8],et=T[9],R=T[10],S=T[11],u=T[12],h=T[13],d=T[14],x=Cn(I,R),m=x*$s,x&&(C=Math.cos(-x),O=Math.sin(-x),z=Y*C+Q*O,j=G*C+et*O,Z=I*C+R*O,Q=Y*-O+Q*C,et=G*-O+et*C,R=I*-O+R*C,S=F*-O+S*C,Y=z,G=j,I=Z),x=Cn(-V,R),v=x*$s,x&&(C=Math.cos(-x),O=Math.sin(-x),z=P*C-Q*O,j=M*C-et*O,Z=V*C-R*O,S=B*O+S*C,P=z,M=j,V=Z),x=Cn(M,P),f=x*$s,x&&(C=Math.cos(x),O=Math.sin(x),z=P*C+M*O,j=Y*C+G*O,M=M*C-P*O,G=G*C-Y*O,P=z,Y=j),m&&Math.abs(m)+Math.abs(f)>359.9&&(m=f=0,v=180-v),p=zt(Math.sqrt(P*P+M*M+V*V)),_=zt(Math.sqrt(G*G+I*I)),x=Cn(Y,G),b=Math.abs(x)>2e-4?x*$s:0,g=S?1/(S<0?-S:S):0),s.svg&&(z=t.getAttribute("transform"),s.forceCSS=t.setAttribute("transform","")||!xd(Je(t,Rt)),z&&t.setAttribute("transform",z))),Math.abs(b)>90&&Math.abs(b)<270&&(r?(p*=-1,b+=f<=0?180:-180,f+=f<=0?180:-180):(_*=-1,b+=b<=0?180:-180)),e=e||s.uncache,s.x=u-((s.xPercent=u&&(!e&&s.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-u)?-50:0)))?t.offsetWidth*s.xPercent/100:0)+o,s.y=h-((s.yPercent=h&&(!e&&s.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-h)?-50:0)))?t.offsetHeight*s.yPercent/100:0)+o,s.z=d+o,s.scaleX=zt(p),s.scaleY=zt(_),s.rotation=zt(f)+a,s.rotationX=zt(m)+a,s.rotationY=zt(v)+a,s.skewX=b+a,s.skewY=w+a,s.transformPerspective=g+o,(s.zOrigin=parseFloat(l.split(" ")[2])||!e&&s.zOrigin||0)&&(n[pe]=mo(l)),s.xOffset=s.yOffset=0,s.force3D=Te.force3D,s.renderTransform=s.svg?Qv:_d?kd:Xv,s.uncache=0,s},mo=function(t){return(t=t.split(" "))[0]+" "+t[1]},ra=function(t,e,s){var n=Kt(e);return zt(parseFloat(e)+parseFloat(Vs(t,"x",s+"px",n)))+n},Xv=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,kd(t,e)},Gs="0deg",vi="0px",Ys=") ",kd=function(t,e){var s=e||this,n=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,p=s.skewY,_=s.scaleX,f=s.scaleY,m=s.transformPerspective,v=s.force3D,b=s.target,w=s.zOrigin,g="",y=v==="auto"&&t&&t!==1||v===!0;if(w&&(h!==Gs||u!==Gs)){var k=parseFloat(u)*Ln,T=Math.sin(k),x=Math.cos(k),C;k=parseFloat(h)*Ln,C=Math.cos(k),o=ra(b,o,T*C*-w),a=ra(b,a,-Math.sin(k)*-w),c=ra(b,c,x*C*-w+w)}m!==vi&&(g+="perspective("+m+Ys),(n||r)&&(g+="translate("+n+"%, "+r+"%) "),(y||o!==vi||a!==vi||c!==vi)&&(g+=c!==vi||y?"translate3d("+o+", "+a+", "+c+") ":"translate("+o+", "+a+Ys),l!==Gs&&(g+="rotate("+l+Ys),u!==Gs&&(g+="rotateY("+u+Ys),h!==Gs&&(g+="rotateX("+h+Ys),(d!==Gs||p!==Gs)&&(g+="skew("+d+", "+p+Ys),(_!==1||f!==1)&&(g+="scale("+_+", "+f+Ys),b.style[Rt]=g||"translate(0, 0)"},Qv=function(t,e){var s=e||this,n=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,p=s.target,_=s.xOrigin,f=s.yOrigin,m=s.xOffset,v=s.yOffset,b=s.forceCSS,w=parseFloat(o),g=parseFloat(a),y,k,T,x,C;c=parseFloat(c),l=parseFloat(l),u=parseFloat(u),u&&(u=parseFloat(u),l+=u,c+=u),c||l?(c*=Ln,l*=Ln,y=Math.cos(c)*h,k=Math.sin(c)*h,T=Math.sin(c-l)*-d,x=Math.cos(c-l)*d,l&&(u*=Ln,C=Math.tan(l-u),C=Math.sqrt(1+C*C),T*=C,x*=C,u&&(C=Math.tan(u),C=Math.sqrt(1+C*C),y*=C,k*=C)),y=zt(y),k=zt(k),T=zt(T),x=zt(x)):(y=h,x=d,k=T=0),(w&&!~(o+"").indexOf("px")||g&&!~(a+"").indexOf("px"))&&(w=Vs(p,"x",o,"px"),g=Vs(p,"y",a,"px")),(_||f||m||v)&&(w=zt(w+_-(_*y+f*T)+m),g=zt(g+f-(_*k+f*x)+v)),(n||r)&&(C=p.getBBox(),w=zt(w+n/100*C.width),g=zt(g+r/100*C.height)),C="matrix("+y+","+k+","+T+","+x+","+w+","+g+")",p.setAttribute("transform",C),b&&(p.style[Rt]=C)},Kv=function(t,e,s,n,r){var o=360,a=Xt(r),c=parseFloat(r)*(a&&~r.indexOf("rad")?$s:1),l=c-n,u=n+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*jl)%o-~~(l/o)*o:h==="ccw"&&l>0&&(l=(l-o*jl)%o-~~(l/o)*o)),t._pt=d=new fe(t._pt,e,s,n,l,Rv),d.e=u,d.u="deg",t._props.push(s),d},Gl=function(t,e){for(var s in e)t[s]=e[s];return t},Jv=function(t,e,s){var n=Gl({},s._gsap),r="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,c,l,u,h,d,p,_;n.svg?(l=s.getAttribute("transform"),s.setAttribute("transform",""),o[Rt]=e,a=tr(s,1),dn(s,Rt),s.setAttribute("transform",l)):(l=getComputedStyle(s)[Rt],o[Rt]=e,a=tr(s,1),o[Rt]=l);for(c in gs)l=n[c],u=a[c],l!==u&&r.indexOf(c)<0&&(p=Kt(l),_=Kt(u),h=p!==_?Vs(s,c,l,_):parseFloat(l),d=parseFloat(u),t._pt=new fe(t._pt,a,c,h,d-h,Pa),t._pt.u=_||0,t._props.push(c));Gl(a,n)};de("padding,margin,Width,Radius",function(i,t){var e="Top",s="Right",n="Bottom",r="Left",o=(t<3?[e,s,n,r]:[e+r,e+s,n+s,n+r]).map(function(a){return t<2?i+a:"border"+a+i});po[t>1?"border"+i:i]=function(a,c,l,u,h){var d,p;if(arguments.length<4)return d=o.map(function(_){return hs(a,_,l)}),p=d.join(" "),p.split(d[0]).length===5?d[0]:p;d=(u+"").split(" "),p={},o.forEach(function(_,f){return p[_]=d[f]=d[f]||d[(f-1)/2|0]}),a.init(c,p,h)}});var Td={name:"css",register:Na,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,s,n,r){var o=this._props,a=t.style,c=s.vars.startAt,l,u,h,d,p,_,f,m,v,b,w,g,y,k,T,x;Mc||Na(),this.styles=this.styles||md(t),x=this.styles.props,this.tween=s;for(f in e)if(f!=="autoRound"&&(u=e[f],!(ye[f]&&id(f,e,s,n,t,r)))){if(p=typeof u,_=po[f],p==="function"&&(u=u.call(s,n,t,r),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=Xi(u)),_)_(this,t,f,u,s)&&(T=1);else if(f.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(f)+"").trim(),u+="",Ds.lastIndex=0,Ds.test(l)||(m=Kt(l),v=Kt(u)),v?m!==v&&(l=Vs(t,f,l,v)+v):m&&(u+=m),this.add(a,"setProperty",l,u,n,r,0,0,f),o.push(f),x.push(f,0,a[f]);else if(p!=="undefined"){if(c&&f in c?(l=typeof c[f]=="function"?c[f].call(s,n,t,r):c[f],Xt(l)&&~l.indexOf("random(")&&(l=Xi(l)),Kt(l+"")||l==="auto"||(l+=Te.units[f]||Kt(hs(t,f))||""),(l+"").charAt(1)==="="&&(l=hs(t,f))):l=hs(t,f),d=parseFloat(l),b=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),b&&(u=u.substr(2)),h=parseFloat(u),f in Qe&&(f==="autoAlpha"&&(d===1&&hs(t,"visibility")==="hidden"&&h&&(d=0),x.push("visibility",0,a.visibility),Es(this,a,"visibility",d?"inherit":"hidden",h?"inherit":"hidden",!h)),f!=="scale"&&f!=="transform"&&(f=Qe[f],~f.indexOf(",")&&(f=f.split(",")[0]))),w=f in gs,w){if(this.styles.save(f),g||(y=t._gsap,y.renderTransform&&!e.parseTransform||tr(t,e.parseTransform),k=e.smoothOrigin!==!1&&y.smooth,g=this._pt=new fe(this._pt,a,Rt,0,1,y.renderTransform,y,0,-1),g.dep=1),f==="scale")this._pt=new fe(this._pt,y,"scaleY",y.scaleY,(b?Rn(y.scaleY,b+h):h)-y.scaleY||0,Pa),this._pt.u=0,o.push("scaleY",f),f+="X";else if(f==="transformOrigin"){x.push(pe,0,a[pe]),u=$v(u),y.svg?Ra(t,u,0,k,0,this):(v=parseFloat(u.split(" ")[2])||0,v!==y.zOrigin&&Es(this,y,"zOrigin",y.zOrigin,v),Es(this,a,f,mo(l),mo(u)));continue}else if(f==="svgOrigin"){Ra(t,u,1,k,0,this);continue}else if(f in vd){Kv(this,y,f,d,b?Rn(d,b+u):u);continue}else if(f==="smoothOrigin"){Es(this,y,"smooth",y.smooth,u);continue}else if(f==="force3D"){y[f]=u;continue}else if(f==="transform"){Jv(this,u,t);continue}}else f in a||(f=Zn(f)||f);if(w||(h||h===0)&&(d||d===0)&&!Nv.test(u)&&f in a)m=(l+"").substr((d+"").length),h||(h=0),v=Kt(u)||(f in Te.units?Te.units[f]:m),m!==v&&(d=Vs(t,f,l,v)),this._pt=new fe(this._pt,w?y:a,f,d,(b?Rn(d,b+h):h)-d,!w&&(v==="px"||f==="zIndex")&&e.autoRound!==!1?Lv:Pa),this._pt.u=v||0,m!==v&&v!=="%"&&(this._pt.b=l,this._pt.r=Fv);else if(f in a)Yv.call(this,t,f,l,b?b+u:u);else if(f in t)this.add(t,f,l||t[f],b?b+u:u,n,r);else if(f!=="parseTransform"){kc(f,u);continue}w||(f in a?x.push(f,0,a[f]):x.push(f,1,l||t[f])),o.push(f)}}T&&ud(this)},render:function(t,e){if(e.tween._time||!Dc())for(var s=e._pt;s;)s.r(t,s.d),s=s._next;else e.styles.revert()},get:hs,aliases:Qe,getSetter:function(t,e,s){var n=Qe[e];return n&&n.indexOf(",")<0&&(e=n),e in gs&&e!==pe&&(t._gsap.x||hs(t,"x"))?s&&Ul===s?e==="scale"?zv:jv:(Ul=s||{})&&(e==="scale"?Bv:qv):t.style&&!yc(t.style[e])?Vv:~e.indexOf("-")?Uv:Oc(t,e)},core:{_removeProperty:dn,_getMatrix:Ic}};_e.utils.checkPrefix=Zn;_e.core.getStyleSaver=md;(function(i,t,e,s){var n=de(i+","+t+","+e,function(r){gs[r]=1});de(t,function(r){Te.units[r]="deg",vd[r]=1}),Qe[n[13]]=i+","+t,de(s,function(r){var o=r.split(":");Qe[o[1]]=n[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");de("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(i){Te.units[i]="px"});_e.registerPlugin(Td);var _o=_e.registerPlugin(Td)||_e;_o.core.Tween;const wd=D.forwardRef(({isSelected:i,position:t},e)=>(D.useEffect(()=>{if(e&&e.current){const s=e.current;_o.fromTo(s.material,{linewidth:ao*5},{linewidth:ao,duration:1})}},[i,e]),L.jsx(Zd,{ref:e,isLine2:!0,opacity:.5,points:[new rt(t.sx,t.sy,t.sz),new rt(t.tx,t.ty,t.tz)]})));wd.displayName="LineComponent";const tx=D.memo(wd),Yl=.5,bd=D.memo(({linksPosition:i})=>{const t=Us(o=>o.dataInitial),{showSelectionGraph:e}=oe(o=>o),s=We(),n=ru(),r=D.useRef(new Map);return D.useEffect(()=>{const o=n||s;if(!o){r.current.forEach(a=>{a&&_o.to(a.material,{linewidth:ao,duration:Yl})});return}r.current.forEach((a,c)=>{if(a){const l=t==null?void 0:t.links.find(h=>h.ref_id===c),u=l&&(l.source===o.ref_id||l.target===o.ref_id);_o.to(a.material,{linewidth:u?ao*2:0,duration:Yl})}})},[t==null?void 0:t.links,n,s]),L.jsx("group",{name:"simulation-3d-group__connections",visible:!e||!0,children:t==null?void 0:t.links.map(o=>{const a=(s==null?void 0:s.ref_id)===o.source||(s==null?void 0:s.ref_id)===o.target,c=i.get(o.ref_id)||{sx:0,sy:0,sz:0,tx:0,ty:0,tz:0};return L.jsx(tx,{ref:l=>{l?r.current.set(o.ref_id,l):r.current.delete(o.ref_id)},isSelected:a,position:c},o.ref_id)})})});bd.displayName="Connections";const ex=({color:i,scale:t})=>L.jsx(cu,{follow:!0,lockX:!1,lockY:!1,lockZ:!1,children:L.jsx(du,{color:i,scale:t})}),sx=["#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"],nx=()=>{const i=We(),t=Us(r=>r.dataInitial),{normalizedSchemasByType:e}=Fa(r=>r),s=eu(),n=D.useMemo(()=>new jf(30,2,16,100),[]);return L.jsx(L.Fragment,{children:L.jsxs(c0,{geometry:n,limit:1e3,range:1e3,visible:!i,children:[L.jsx("meshBasicMaterial",{}),t==null?void 0:t.nodes.map(r=>{var c;const a=((c=e[r.node_type])==null?void 0:c.primary_color)??(sx[s.indexOf(r.node_type)]||Tt.white);return L.jsx(ex,{color:a,scale:r.scale||1},r.ref_id)})]})})},ix=D.memo(nx),rx=Ut(ys)` +*/var Il,Cs,Rn,Sc,Xs,Nl,Ec,xv=function(){return typeof window<"u"},_s={},Gs=180/Math.PI,Fn=Math.PI/180,bn=Math.atan2,Rl=1e8,Oc=/([A-Z])/g,kv=/(left|right|width|margin|padding|x)/i,Tv=/[\s,\(]\S/,Ze={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Ea=function(t,e){return e.set(e.t,e.p,Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},wv=function(t,e){return e.set(e.t,e.p,t===1?e.e:Math.round((e.s+e.c*t)*1e4)/1e4+e.u,e)},bv=function(t,e){return e.set(e.t,e.p,t?Math.round((e.s+e.c*t)*1e4)/1e4+e.u:e.b,e)},Cv=function(t,e){var s=e.s+e.c*t;e.set(e.t,e.p,~~(s+(s<0?-.5:.5))+e.u,e)},id=function(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)},rd=function(t,e){return e.set(e.t,e.p,t!==1?e.b:e.e,e)},Sv=function(t,e,s){return t.style[e]=s},Ev=function(t,e,s){return t.style.setProperty(e,s)},Ov=function(t,e,s){return t._gsap[e]=s},Av=function(t,e,s){return t._gsap.scaleX=t._gsap.scaleY=s},Mv=function(t,e,s,n,r){var o=t._gsap;o.scaleX=o.scaleY=s,o.renderTransform(r,o)},Dv=function(t,e,s,n,r){var o=t._gsap;o[e]=s,o.renderTransform(r,o)},Rt="transform",fe=Rt+"Origin",Pv=function i(t,e){var s=this,n=this.target,r=n.style,o=n._gsap;if(t in _s&&r){if(this.tfm=this.tfm||{},t!=="transform")t=Ze[t]||t,~t.indexOf(",")?t.split(",").forEach(function(a){return s.tfm[a]=us(n,a)}):this.tfm[t]=o.x?o[t]:us(n,t),t===fe&&(this.tfm.zOrigin=o.zOrigin);else return Ze.transform.split(",").forEach(function(a){return i.call(s,a,e)});if(this.props.indexOf(Rt)>=0)return;o.svg&&(this.svgo=n.getAttribute("data-svg-origin"),this.props.push(fe,e,"")),t=Rt}(r||e)&&this.props.push(t,e,r[t])},od=function(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))},Iv=function(){var t=this.props,e=this.target,s=e.style,n=e._gsap,r,o;for(r=0;r=0?Fl[o]:"")+t},Aa=function(){xv()&&window.document&&(Il=window,Cs=Il.document,Rn=Cs.documentElement,Xs=Oa("div")||{style:{}},Oa("div"),Rt=$n(Rt),fe=Rt+"Origin",Xs.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",cd=!!$n("perspective"),Ec=_e.core.reverting,Sc=1)},Jo=function i(t){var e=Oa("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=this.parentNode,n=this.nextSibling,r=this.style.cssText,o;if(Rn.appendChild(e),e.appendChild(this),this.style.display="block",t)try{o=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=i}catch{}else this._gsapBBox&&(o=this._gsapBBox());return s&&(n?s.insertBefore(this,n):s.appendChild(this)),Rn.removeChild(e),this.style.cssText=r,o},Ll=function(t,e){for(var s=e.length;s--;)if(t.hasAttribute(e[s]))return t.getAttribute(e[s])},ld=function(t){var e;try{e=t.getBBox()}catch{e=Jo.call(t,!0)}return e&&(e.width||e.height)||t.getBBox===Jo||(e=Jo.call(t,!0)),e&&!e.width&&!e.x&&!e.y?{x:+Ll(t,["x","cx","x1"])||0,y:+Ll(t,["y","cy","y1"])||0,width:0,height:0}:e},ud=function(t){return!!(t.getCTM&&(!t.parentNode||t.ownerSVGElement)&&ld(t))},hn=function(t,e){if(e){var s=t.style,n;e in _s&&e!==fe&&(e=Rt),s.removeProperty?(n=e.substr(0,2),(n==="ms"||e.substr(0,6)==="webkit")&&(e="-"+e),s.removeProperty(n==="--"?e:e.replace(Oc,"-$1").toLowerCase())):s.removeAttribute(e)}},Ss=function(t,e,s,n,r,o){var a=new de(t._pt,e,s,0,1,o?rd:id);return t._pt=a,a.b=n,a.e=r,t._props.push(s),a},Vl={deg:1,rad:1,turn:1},Nv={grid:1,flex:1},Ls=function i(t,e,s,n){var r=parseFloat(s)||0,o=(s+"").trim().substr((r+"").length)||"px",a=Xs.style,c=kv.test(e),l=t.tagName.toLowerCase()==="svg",u=(l?"client":"offset")+(c?"Width":"Height"),h=100,d=n==="px",p=n==="%",_,f,m,v;if(n===o||!r||Vl[n]||Vl[o])return r;if(o!=="px"&&!d&&(r=i(t,e,s,"px")),v=t.getCTM&&ud(t),(p||o==="%")&&(_s[e]||~e.indexOf("adius")))return _=v?t.getBBox()[c?"width":"height"]:t[u],jt(p?r/_*h:r/100*_);if(a[c?"width":"height"]=h+(d?o:n),f=~e.indexOf("adius")||n==="em"&&t.appendChild&&!l?t:t.parentNode,v&&(f=(t.ownerSVGElement||{}).parentNode),(!f||f===Cs||!f.appendChild)&&(f=Cs.body),m=f._gsap,m&&p&&m.width&&c&&m.time===ye.time&&!m.uncache)return jt(r/m.width*h);if(p&&(e==="height"||e==="width")){var b=t.style[e];t.style[e]=h+n,_=t[u],b?t.style[e]=b:hn(t,e)}else(p||o==="%")&&!Nv[Qe(f,"display")]&&(a.position=Qe(t,"position")),f===t&&(a.position="static"),f.appendChild(Xs),_=Xs[u],f.removeChild(Xs),a.position="absolute";return c&&p&&(m=tn(f),m.time=ye.time,m.width=f[u]),jt(d?_*r/h:_&&r?h/_*r:0)},us=function(t,e,s,n){var r;return Sc||Aa(),e in Ze&&e!=="transform"&&(e=Ze[e],~e.indexOf(",")&&(e=e.split(",")[0])),_s[e]&&e!=="transform"?(r=Ki(t,n),r=e!=="transformOrigin"?r[e]:r.svg?r.origin:lo(Qe(t,fe))+" "+r.zOrigin+"px"):(r=t.style[e],(!r||r==="auto"||n||~(r+"").indexOf("calc("))&&(r=co[e]&&co[e](t,e,s)||Qe(t,e)||Sh(t,e)||(e==="opacity"?1:0))),s&&!~(r+"").trim().indexOf(" ")?Ls(t,e,r,s)+s:r},Rv=function(t,e,s,n){if(!s||s==="none"){var r=$n(e,t,1),o=r&&Qe(t,r,1);o&&o!==s?(e=r,s=o):e==="borderColor"&&(s=Qe(t,"borderTopColor"))}var a=new de(this._pt,t.style,e,0,1,ed),c=0,l=0,u,h,d,p,_,f,m,v,b,w,g,y;if(a.b=s,a.e=n,s+="",n+="",n==="auto"&&(f=t.style[e],t.style[e]=n,n=Qe(t,e)||n,f?t.style[e]=f:hn(t,e)),u=[s,n],Hh(u),s=u[0],n=u[1],d=s.match(Mn)||[],y=n.match(Mn)||[],y.length){for(;h=Mn.exec(n);)m=h[0],b=n.substring(c,h.index),_?_=(_+1)%5:(b.substr(-5)==="rgba("||b.substr(-5)==="hsla(")&&(_=1),m!==(f=d[l++]||"")&&(p=parseFloat(f)||0,g=f.substr((p+"").length),m.charAt(1)==="="&&(m=Nn(p,m)+g),v=parseFloat(m),w=m.substr((v+"").length),c=Mn.lastIndex-w.length,w||(w=w||ke.units[e]||g,c===n.length&&(n+=w,a.e+=w)),g!==w&&(p=Ls(t,e,f,w)||0),a._pt={_next:a._pt,p:b||l===1?b:",",s:p,c:v-p,m:_&&_<4||e==="zIndex"?Math.round:0});a.c=c-1;)a=r[l],_s[a]&&(c=1,a=a==="transformOrigin"?fe:Rt),hn(s,a);c&&(hn(s,Rt),o&&(o.svg&&s.removeAttribute("transform"),Ki(s,1),o.uncache=1,od(n)))}},co={clearProps:function(t,e,s,n,r){if(r.data!=="isFromStart"){var o=t._pt=new de(t._pt,e,s,0,0,Lv);return o.u=n,o.pr=-10,o.tween=r,t._props.push(s),1}}},Qi=[1,0,0,1,0,0],hd={},dd=function(t){return t==="matrix(1, 0, 0, 1, 0, 0)"||t==="none"||!t},zl=function(t){var e=Qe(t,Rt);return dd(e)?Qi:e.substr(7).match(vh).map(jt)},Ac=function(t,e){var s=t._gsap||tn(t),n=t.style,r=zl(t),o,a,c,l;return s.svg&&t.getAttribute("transform")?(c=t.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"?Qi:r):(r===Qi&&!t.offsetParent&&t!==Rn&&!s.svg&&(c=n.display,n.display="block",o=t.parentNode,(!o||!t.offsetParent)&&(l=1,a=t.nextElementSibling,Rn.appendChild(t)),r=zl(t),c?n.display=c:hn(t,"display"),l&&(a?o.insertBefore(t,a):o?o.appendChild(t):Rn.removeChild(t))),e&&r.length>6?[r[0],r[1],r[4],r[5],r[12],r[13]]:r)},Ma=function(t,e,s,n,r,o){var a=t._gsap,c=r||Ac(t,!0),l=a.xOrigin||0,u=a.yOrigin||0,h=a.xOffset||0,d=a.yOffset||0,p=c[0],_=c[1],f=c[2],m=c[3],v=c[4],b=c[5],w=e.split(" "),g=parseFloat(w[0])||0,y=parseFloat(w[1])||0,k,T,x,C;s?c!==Qi&&(T=p*m-_*f)&&(x=g*(m/T)+y*(-f/T)+(f*b-m*v)/T,C=g*(-_/T)+y*(p/T)-(p*b-_*v)/T,g=x,y=C):(k=ld(t),g=k.x+(~w[0].indexOf("%")?g/100*k.width:g),y=k.y+(~(w[1]||w[0]).indexOf("%")?y/100*k.height:y)),n||n!==!1&&a.smooth?(v=g-l,b=y-u,a.xOffset=h+(v*p+b*f)-v,a.yOffset=d+(v*_+b*m)-b):a.xOffset=a.yOffset=0,a.xOrigin=g,a.yOrigin=y,a.smooth=!!n,a.origin=e,a.originIsAbsolute=!!s,t.style[fe]="0px 0px",o&&(Ss(o,a,"xOrigin",l,g),Ss(o,a,"yOrigin",u,y),Ss(o,a,"xOffset",h,a.xOffset),Ss(o,a,"yOffset",d,a.yOffset)),t.setAttribute("data-svg-origin",g+" "+y)},Ki=function(t,e){var s=t._gsap||new Zh(t);if("x"in s&&!e&&!s.uncache)return s;var n=t.style,r=s.scaleX<0,o="px",a="deg",c=getComputedStyle(t),l=Qe(t,fe)||"0",u,h,d,p,_,f,m,v,b,w,g,y,k,T,x,C,O,I,M,V,W,G,Y,j,z,Z,Q,et,R,F,S,P;return u=h=d=f=m=v=b=w=g=0,p=_=1,s.svg=!!(t.getCTM&&ud(t)),c.translate&&((c.translate!=="none"||c.scale!=="none"||c.rotate!=="none")&&(n[Rt]=(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[Rt]!=="none"?c[Rt]:"")),n.scale=n.rotate=n.translate="none"),T=Ac(t,s.svg),s.svg&&(s.uncache?(z=t.getBBox(),l=s.xOrigin-z.x+"px "+(s.yOrigin-z.y)+"px",j=""):j=!e&&t.getAttribute("data-svg-origin"),Ma(t,j||l,!!j||s.originIsAbsolute,s.smooth!==!1,T)),y=s.xOrigin||0,k=s.yOrigin||0,T!==Qi&&(I=T[0],M=T[1],V=T[2],W=T[3],u=G=T[4],h=Y=T[5],T.length===6?(p=Math.sqrt(I*I+M*M),_=Math.sqrt(W*W+V*V),f=I||M?bn(M,I)*Gs:0,b=V||W?bn(V,W)*Gs+f:0,b&&(_*=Math.abs(Math.cos(b*Fn))),s.svg&&(u-=y-(y*I+k*V),h-=k-(y*M+k*W))):(P=T[6],F=T[7],Q=T[8],et=T[9],R=T[10],S=T[11],u=T[12],h=T[13],d=T[14],x=bn(P,R),m=x*Gs,x&&(C=Math.cos(-x),O=Math.sin(-x),j=G*C+Q*O,z=Y*C+et*O,Z=P*C+R*O,Q=G*-O+Q*C,et=Y*-O+et*C,R=P*-O+R*C,S=F*-O+S*C,G=j,Y=z,P=Z),x=bn(-V,R),v=x*Gs,x&&(C=Math.cos(-x),O=Math.sin(-x),j=I*C-Q*O,z=M*C-et*O,Z=V*C-R*O,S=W*O+S*C,I=j,M=z,V=Z),x=bn(M,I),f=x*Gs,x&&(C=Math.cos(x),O=Math.sin(x),j=I*C+M*O,z=G*C+Y*O,M=M*C-I*O,Y=Y*C-G*O,I=j,G=z),m&&Math.abs(m)+Math.abs(f)>359.9&&(m=f=0,v=180-v),p=jt(Math.sqrt(I*I+M*M+V*V)),_=jt(Math.sqrt(Y*Y+P*P)),x=bn(G,Y),b=Math.abs(x)>2e-4?x*Gs:0,g=S?1/(S<0?-S:S):0),s.svg&&(j=t.getAttribute("transform"),s.forceCSS=t.setAttribute("transform","")||!dd(Qe(t,Rt)),j&&t.setAttribute("transform",j))),Math.abs(b)>90&&Math.abs(b)<270&&(r?(p*=-1,b+=f<=0?180:-180,f+=f<=0?180:-180):(_*=-1,b+=b<=0?180:-180)),e=e||s.uncache,s.x=u-((s.xPercent=u&&(!e&&s.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-u)?-50:0)))?t.offsetWidth*s.xPercent/100:0)+o,s.y=h-((s.yPercent=h&&(!e&&s.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-h)?-50:0)))?t.offsetHeight*s.yPercent/100:0)+o,s.z=d+o,s.scaleX=jt(p),s.scaleY=jt(_),s.rotation=jt(f)+a,s.rotationX=jt(m)+a,s.rotationY=jt(v)+a,s.skewX=b+a,s.skewY=w+a,s.transformPerspective=g+o,(s.zOrigin=parseFloat(l.split(" ")[2])||!e&&s.zOrigin||0)&&(n[fe]=lo(l)),s.xOffset=s.yOffset=0,s.force3D=ke.force3D,s.renderTransform=s.svg?Uv:cd?fd:Vv,s.uncache=0,s},lo=function(t){return(t=t.split(" "))[0]+" "+t[1]},ta=function(t,e,s){var n=Kt(e);return jt(parseFloat(e)+parseFloat(Ls(t,"x",s+"px",n)))+n},Vv=function(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,fd(t,e)},Hs="0deg",gi="0px",Ys=") ",fd=function(t,e){var s=e||this,n=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,p=s.skewY,_=s.scaleX,f=s.scaleY,m=s.transformPerspective,v=s.force3D,b=s.target,w=s.zOrigin,g="",y=v==="auto"&&t&&t!==1||v===!0;if(w&&(h!==Hs||u!==Hs)){var k=parseFloat(u)*Fn,T=Math.sin(k),x=Math.cos(k),C;k=parseFloat(h)*Fn,C=Math.cos(k),o=ta(b,o,T*C*-w),a=ta(b,a,-Math.sin(k)*-w),c=ta(b,c,x*C*-w+w)}m!==gi&&(g+="perspective("+m+Ys),(n||r)&&(g+="translate("+n+"%, "+r+"%) "),(y||o!==gi||a!==gi||c!==gi)&&(g+=c!==gi||y?"translate3d("+o+", "+a+", "+c+") ":"translate("+o+", "+a+Ys),l!==Hs&&(g+="rotate("+l+Ys),u!==Hs&&(g+="rotateY("+u+Ys),h!==Hs&&(g+="rotateX("+h+Ys),(d!==Hs||p!==Hs)&&(g+="skew("+d+", "+p+Ys),(_!==1||f!==1)&&(g+="scale("+_+", "+f+Ys),b.style[Rt]=g||"translate(0, 0)"},Uv=function(t,e){var s=e||this,n=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,p=s.target,_=s.xOrigin,f=s.yOrigin,m=s.xOffset,v=s.yOffset,b=s.forceCSS,w=parseFloat(o),g=parseFloat(a),y,k,T,x,C;c=parseFloat(c),l=parseFloat(l),u=parseFloat(u),u&&(u=parseFloat(u),l+=u,c+=u),c||l?(c*=Fn,l*=Fn,y=Math.cos(c)*h,k=Math.sin(c)*h,T=Math.sin(c-l)*-d,x=Math.cos(c-l)*d,l&&(u*=Fn,C=Math.tan(l-u),C=Math.sqrt(1+C*C),T*=C,x*=C,u&&(C=Math.tan(u),C=Math.sqrt(1+C*C),y*=C,k*=C)),y=jt(y),k=jt(k),T=jt(T),x=jt(x)):(y=h,x=d,k=T=0),(w&&!~(o+"").indexOf("px")||g&&!~(a+"").indexOf("px"))&&(w=Ls(p,"x",o,"px"),g=Ls(p,"y",a,"px")),(_||f||m||v)&&(w=jt(w+_-(_*y+f*T)+m),g=jt(g+f-(_*k+f*x)+v)),(n||r)&&(C=p.getBBox(),w=jt(w+n/100*C.width),g=jt(g+r/100*C.height)),C="matrix("+y+","+k+","+T+","+x+","+w+","+g+")",p.setAttribute("transform",C),b&&(p.style[Rt]=C)},zv=function(t,e,s,n,r){var o=360,a=Xt(r),c=parseFloat(r)*(a&&~r.indexOf("rad")?Gs:1),l=c-n,u=n+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*Rl)%o-~~(l/o)*o:h==="ccw"&&l>0&&(l=(l-o*Rl)%o-~~(l/o)*o)),t._pt=d=new de(t._pt,e,s,n,l,wv),d.e=u,d.u="deg",t._props.push(s),d},jl=function(t,e){for(var s in e)t[s]=e[s];return t},jv=function(t,e,s){var n=jl({},s._gsap),r="perspective,force3D,transformOrigin,svgOrigin",o=s.style,a,c,l,u,h,d,p,_;n.svg?(l=s.getAttribute("transform"),s.setAttribute("transform",""),o[Rt]=e,a=Ki(s,1),hn(s,Rt),s.setAttribute("transform",l)):(l=getComputedStyle(s)[Rt],o[Rt]=e,a=Ki(s,1),o[Rt]=l);for(c in _s)l=n[c],u=a[c],l!==u&&r.indexOf(c)<0&&(p=Kt(l),_=Kt(u),h=p!==_?Ls(s,c,l,_):parseFloat(l),d=parseFloat(u),t._pt=new de(t._pt,a,c,h,d-h,Ea),t._pt.u=_||0,t._props.push(c));jl(a,n)};he("padding,margin,Width,Radius",function(i,t){var e="Top",s="Right",n="Bottom",r="Left",o=(t<3?[e,s,n,r]:[e+r,e+s,n+s,n+r]).map(function(a){return t<2?i+a:"border"+a+i});co[t>1?"border"+i:i]=function(a,c,l,u,h){var d,p;if(arguments.length<4)return d=o.map(function(_){return us(a,_,l)}),p=d.join(" "),p.split(d[0]).length===5?d[0]:p;d=(u+"").split(" "),p={},o.forEach(function(_,f){return p[_]=d[f]=d[f]||d[(f-1)/2|0]}),a.init(c,p,h)}});var pd={name:"css",register:Aa,targetTest:function(t){return t.style&&t.nodeType},init:function(t,e,s,n,r){var o=this._props,a=t.style,c=s.vars.startAt,l,u,h,d,p,_,f,m,v,b,w,g,y,k,T,x;Sc||Aa(),this.styles=this.styles||ad(t),x=this.styles.props,this.tween=s;for(f in e)if(f!=="autoRound"&&(u=e[f],!(ge[f]&&Xh(f,e,s,n,t,r)))){if(p=typeof u,_=co[f],p==="function"&&(u=u.call(s,n,t,r),p=typeof u),p==="string"&&~u.indexOf("random(")&&(u=$i(u)),_)_(this,t,f,u,s)&&(T=1);else if(f.substr(0,2)==="--")l=(getComputedStyle(t).getPropertyValue(f)+"").trim(),u+="",Ms.lastIndex=0,Ms.test(l)||(m=Kt(l),v=Kt(u)),v?m!==v&&(l=Ls(t,f,l,v)+v):m&&(u+=m),this.add(a,"setProperty",l,u,n,r,0,0,f),o.push(f),x.push(f,0,a[f]);else if(p!=="undefined"){if(c&&f in c?(l=typeof c[f]=="function"?c[f].call(s,n,t,r):c[f],Xt(l)&&~l.indexOf("random(")&&(l=$i(l)),Kt(l+"")||l==="auto"||(l+=ke.units[f]||Kt(us(t,f))||""),(l+"").charAt(1)==="="&&(l=us(t,f))):l=us(t,f),d=parseFloat(l),b=p==="string"&&u.charAt(1)==="="&&u.substr(0,2),b&&(u=u.substr(2)),h=parseFloat(u),f in Ze&&(f==="autoAlpha"&&(d===1&&us(t,"visibility")==="hidden"&&h&&(d=0),x.push("visibility",0,a.visibility),Ss(this,a,"visibility",d?"inherit":"hidden",h?"inherit":"hidden",!h)),f!=="scale"&&f!=="transform"&&(f=Ze[f],~f.indexOf(",")&&(f=f.split(",")[0]))),w=f in _s,w){if(this.styles.save(f),g||(y=t._gsap,y.renderTransform&&!e.parseTransform||Ki(t,e.parseTransform),k=e.smoothOrigin!==!1&&y.smooth,g=this._pt=new de(this._pt,a,Rt,0,1,y.renderTransform,y,0,-1),g.dep=1),f==="scale")this._pt=new de(this._pt,y,"scaleY",y.scaleY,(b?Nn(y.scaleY,b+h):h)-y.scaleY||0,Ea),this._pt.u=0,o.push("scaleY",f),f+="X";else if(f==="transformOrigin"){x.push(fe,0,a[fe]),u=Fv(u),y.svg?Ma(t,u,0,k,0,this):(v=parseFloat(u.split(" ")[2])||0,v!==y.zOrigin&&Ss(this,y,"zOrigin",y.zOrigin,v),Ss(this,a,f,lo(l),lo(u)));continue}else if(f==="svgOrigin"){Ma(t,u,1,k,0,this);continue}else if(f in hd){zv(this,y,f,d,b?Nn(d,b+u):u);continue}else if(f==="smoothOrigin"){Ss(this,y,"smooth",y.smooth,u);continue}else if(f==="force3D"){y[f]=u;continue}else if(f==="transform"){jv(this,u,t);continue}}else f in a||(f=$n(f)||f);if(w||(h||h===0)&&(d||d===0)&&!Tv.test(u)&&f in a)m=(l+"").substr((d+"").length),h||(h=0),v=Kt(u)||(f in ke.units?ke.units[f]:m),m!==v&&(d=Ls(t,f,l,v)),this._pt=new de(this._pt,w?y:a,f,d,(b?Nn(d,b+h):h)-d,!w&&(v==="px"||f==="zIndex")&&e.autoRound!==!1?Cv:Ea),this._pt.u=v||0,m!==v&&v!=="%"&&(this._pt.b=l,this._pt.r=bv);else if(f in a)Rv.call(this,t,f,l,b?b+u:u);else if(f in t)this.add(t,f,l||t[f],b?b+u:u,n,r);else if(f!=="parseTransform"){gc(f,u);continue}w||(f in a?x.push(f,0,a[f]):x.push(f,1,l||t[f])),o.push(f)}}T&&sd(this)},render:function(t,e){if(e.tween._time||!Ec())for(var s=e._pt;s;)s.r(t,s.d),s=s._next;else e.styles.revert()},get:us,aliases:Ze,getSetter:function(t,e,s){var n=Ze[e];return n&&n.indexOf(",")<0&&(e=n),e in _s&&e!==fe&&(t._gsap.x||us(t,"x"))?s&&Nl===s?e==="scale"?Av:Ov:(Nl=s||{})&&(e==="scale"?Mv:Dv):t.style&&!pc(t.style[e])?Sv:~e.indexOf("-")?Ev:bc(t,e)},core:{_removeProperty:hn,_getMatrix:Ac}};_e.utils.checkPrefix=$n;_e.core.getStyleSaver=ad;(function(i,t,e,s){var n=he(i+","+t+","+e,function(r){_s[r]=1});he(t,function(r){ke.units[r]="deg",hd[r]=1}),Ze[n[13]]=i+","+t,he(s,function(r){var o=r.split(":");Ze[o[1]]=n[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");he("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(i){ke.units[i]="px"});_e.registerPlugin(pd);var uo=_e.registerPlugin(pd)||_e;uo.core.Tween;const md=D.forwardRef(({isSelected:i,position:t},e)=>(D.useEffect(()=>{if(e&&e.current){const s=e.current;uo.fromTo(s.material,{linewidth:so*5},{linewidth:so,duration:1})}},[i,e]),L.jsx(Ud,{ref:e,isLine2:!0,opacity:.5,points:[new rt(t.sx,t.sy,t.sz),new rt(t.tx,t.ty,t.tz)]})));md.displayName="LineComponent";const Bv=D.memo(md),Bl=.5,_d=D.memo(({linksPosition:i})=>{const t=Vs(o=>o.dataInitial),{showSelectionGraph:e}=pe(o=>o),s=ts(),n=Kl(),r=D.useRef(new Map);return D.useEffect(()=>{const o=n||s;if(!o){r.current.forEach(a=>{a&&uo.to(a.material,{linewidth:so,duration:Bl})});return}r.current.forEach((a,c)=>{if(a){const l=t==null?void 0:t.links.find(h=>h.ref_id===c),u=l&&(l.source===o.ref_id||l.target===o.ref_id);uo.to(a.material,{linewidth:u?so*2:0,duration:Bl})}})},[t==null?void 0:t.links,n,s]),L.jsx("group",{name:"simulation-3d-group__connections",visible:!e||!0,children:t==null?void 0:t.links.map(o=>{const a=(s==null?void 0:s.ref_id)===o.source||(s==null?void 0:s.ref_id)===o.target,c=i.get(o.ref_id)||{sx:0,sy:0,sz:0,tx:0,ty:0,tz:0};return L.jsx(Bv,{ref:l=>{l?r.current.set(o.ref_id,l):r.current.delete(o.ref_id)},isSelected:a,position:c},o.ref_id)})})});_d.displayName="Connections";const qv=({color:i,scale:t})=>L.jsx(eu,{follow:!0,lockX:!1,lockY:!1,lockZ:!1,children:L.jsx(ru,{color:i,scale:t})}),Wv=["#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"],Hv=()=>{const i=ts(),t=Vs(r=>r.dataInitial),{normalizedSchemasByType:e}=Da(r=>r),s=$l(),n=D.useMemo(()=>new Of(30,2,16,100),[]);return L.jsx(L.Fragment,{children:L.jsxs(Xf,{geometry:n,limit:1e3,range:1e3,visible:!i,children:[L.jsx("meshBasicMaterial",{}),t==null?void 0:t.nodes.map(r=>{var c;const a=((c=e[r.node_type])==null?void 0:c.primary_color)??(Wv[s.indexOf(r.node_type)]||Tt.white);return L.jsx(qv,{color:a,scale:r.scale||1},r.ref_id)})]})})},Yv=D.memo(Hv),Gv=Ut(gs)` text-align: center; width: ${i=>i.type==="topic"?"auto":`${i.size}px`}; height: ${i=>i.type==="topic"?"auto":`${i.size}px`}; @@ -410,7 +410,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a top: -7px; left: -14px; } -`,ox=Ut(ys)` +`,$v=Ut(gs)` text-align: center; outline: 1px solid ${Tt.white}; outline-offset: 0px; @@ -510,7 +510,7 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a font-weight: 500; border-radius: 6px; margin-right: 5px; -`;const ax=new rt,cx=({position:i,userData:t,color:e})=>{const s=D.useRef(null),{selectedNode:n,setSelectedNode:r,showSelectionGraph:o,hoveredNode:a,setHoveredNode:c}=oe(Va(p=>p)),l=((t==null?void 0:t.node_type)||"")==="Topic"||!!t.name,u=((t==null?void 0:t.node_type)||"")==="Guest"||((t==null?void 0:t.node_type)||"")==="Person";be(()=>{if(o&&s.current){const p=ax.set((t==null?void 0:t.x)||0,(t==null?void 0:t.y)||0,(t==null?void 0:t.z)||0);s.current.position.copy(p)}}),D.useEffect(()=>function(){s.current&&s.current.clear()},[s]);const h=D.useMemo(()=>(a==null?void 0:a.ref_id)===(t==null?void 0:t.ref_id),[a==null?void 0:a.ref_id,t==null?void 0:t.ref_id]),d=(n==null?void 0:n.ref_id)===(t==null?void 0:t.ref_id);return l||d&&o||!d?L.jsx("group",{ref:s,position:i,children:L.jsx(sr,{center:!0,sprite:!0,zIndexRange:[0,0],children:l?L.jsxs(ox,{direction:"column",onClick:p=>{p.stopPropagation(),t&&r(t)},onPointerOut:p=>{p.stopPropagation()},onPointerOver:p=>{p.stopPropagation()},children:[L.jsx("div",{className:"badge-wrapper",children:L.jsx(Lc,{type:(t==null?void 0:t.node_type)||""})}),iu(t==null?void 0:t.name,20)]}):L.jsxs(rx,{className:su(t==null?void 0:t.node_type,{selected:d}),color:e,fontColor:Tt.white,fontSize:l?64:20,onClick:p=>{p.stopPropagation(),t&&r(t)},onPointerOut:p=>{p.stopPropagation()},onPointerOver:p=>{p.stopPropagation()},scale:h?1.05:1,selected:!1,size:d?68:40,type:(t==null?void 0:t.node_type)||"",children:[!u&&!l?L.jsx("div",{className:"badge-wrapper",children:L.jsx(Lc,{type:(t==null?void 0:t.node_type)||""})}):null,t!=null&&t.name?t==null?void 0:t.name:L.jsx(of,{rounded:u,size:d?60:52,src:(t==null?void 0:t.image_url)||"audio_default.svg",type:t==null?void 0:t.node_type})]})})}):null},Cd=D.memo(()=>{const{simulation:i,showSelectionGraph:t,selectedNode:e,selectionGraphData:s}=oe(Va(o=>o)),n=xo(),r=D.useMemo(()=>{const o=(i==null?void 0:i.nodes())||[];return(t?s.nodes:o).filter(u=>n.includes((u==null?void 0:u.ref_id)||"")||(e==null?void 0:e.ref_id)===(u==null?void 0:u.ref_id)).slice(0,D1).map(u=>{const h=nu(u.node_type||"",!0),d=new rt((u==null?void 0:u.x)||0,(u==null?void 0:u.y)||0,(u==null?void 0:u.z)||0),p=o.filter(_=>_.ref_id&&P1(_,u)).map(_=>(_==null?void 0:_.ref_id)||"")||[];return L.jsx(cx,{color:h,position:d,relativeIds:p,userData:u},`node-badge-${u.ref_id}`)})},[i,t,s.nodes,n,e==null?void 0:e.ref_id]);return L.jsx(D.Fragment,{children:r.length?r:null},"node-badges")});Cd.displayName="RelevanceBadges";const $l=af().stop(),ge={numDimensions:3,velocityDecay:.9,forceChargeStrength:-20,forceChargeMinDistance:10,forceChargeMaxDistance:8e3,forceLinkStrength:.04,forceCenterStrength:.85,disableCollide:!1,disableCenter:!1,disableLink:!1,disableCharge:!1,forceCollideRadiusMethod:i=>(i.edge_count||1)*6+200,forceLinkDistanceMethod:i=>{const t=i.source.node_type;let e=50;switch(t){case"topic":e=30;break;case"guest":e=30;break;case"clip":e=10;break;case"episode":e=15;break}return e*2/50}},lx=(i,t,{numDimensions:e=ge.numDimensions,velocityDecay:s=ge.velocityDecay,forceChargeStrength:n=ge.forceChargeStrength,forceChargeMinDistance:r=ge.forceChargeMinDistance,forceChargeMaxDistance:o=ge.forceChargeMaxDistance,forceLinkStrength:a=ge.forceLinkStrength,forceCenterStrength:c=ge.forceCenterStrength,forceLinkDistanceMethod:l=ge.forceLinkDistanceMethod,forceCollideRadiusMethod:u=ge.forceCollideRadiusMethod,disableCollide:h=ge.disableCollide,disableCenter:d=ge.disableCenter,disableLink:p=ge.disableLink,disableCharge:_=ge.disableCharge})=>($l.alpha(1).stop().numDimensions(e).velocityDecay(s).force("collide",h?null:cf().radius(u).iterations(1)).force("center",d?null:lf().strength(c)).force("charge",_?null:uf().strength(n).distanceMin(r).distanceMax(o)).nodes(i).force("link",p?null:hf(t).id(f=>f.ref_id).distance(l).strength(a)).alpha(1).restart(),$l),ux=({link:i,animated:t})=>{const e=D.useRef(null),s=We(),[n,r]=D.useState(new rt(0,0,0)),[o,a]=D.useState(new rt(0,0,0)),[c,l]=D.useState(8947848),u=oe(h=>h.selectionGraphData);return D.useEffect(()=>{var p,_,f,m,v,b;const h=(s==null?void 0:s.ref_id)||"",d=s&&(h===i.target||h===i.source);!i.onlyVisibleOnSelect||d?(r(new rt(((p=i.sourcePosition)==null?void 0:p.x)||0,((_=i.sourcePosition)==null?void 0:_.y)||0,((f=i.sourcePosition)==null?void 0:f.z)||0)),a(new rt(((m=i.targetPosition)==null?void 0:m.x)||0,((v=i.targetPosition)==null?void 0:v.y)||0,((b=i.targetPosition)==null?void 0:b.z)||0))):(r(new rt(0,0,0)),a(new rt(0,0,0))),l(d?i.color||Ld.children.segmentColor:s?5592405:8947848)},[s,i]),be(()=>{if(t&&e.current){const h=u.nodes.find(p=>p.ref_id===i.source),d=u.nodes.find(p=>p.ref_id===i.target);e.current.start.set((h==null?void 0:h.x)||0,(h==null?void 0:h.y)||0,(h==null?void 0:h.z)||0),e.current.end.set((d==null?void 0:d.x)||0,(d==null?void 0:d.y)||0,(d==null?void 0:d.z)||0)}}),L.jsx(L.Fragment,{children:L.jsx(h0,{ref:e,color:"0xFFFFFF",end:o,start:n})})},hx=({links:i,simulation:t})=>{const e=D.useRef(null);return D.useEffect(()=>function(){e.current&&e.current.clear()},[e]),be(()=>{if(e.current){const s=t.nodes();e.current.children.forEach((r,o)=>{var u;const a=i[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)})}}),i.length?L.jsx("group",{ref:e,children:i.map(s=>L.jsx("mesh",{children:L.jsx(sr,{center:!0,sprite:!0,children:L.jsxs(dx,{direction:"row",justify:"center",onClick:n=>{n.stopPropagation()},onPointerOut:n=>{n.stopPropagation()},onPointerOver:n=>{n.stopPropagation()},children:[L.jsx("span",{children:s.edge_type}),L.jsx(ys,{className:"icon",children:L.jsx(df,{})})]})})},s.ref_id))}):null},dx=Ut(ys)` +`;const Zv=new rt,Xv=({position:i,userData:t,color:e})=>{const s=D.useRef(null),{selectedNode:n,setSelectedNode:r,showSelectionGraph:o,hoveredNode:a,setHoveredNode:c}=pe(Ia(p=>p)),l=((t==null?void 0:t.node_type)||"")==="Topic"||!!t.name,u=((t==null?void 0:t.node_type)||"")==="Guest"||((t==null?void 0:t.node_type)||"")==="Person";Pe(()=>{if(o&&s.current){const p=Zv.set((t==null?void 0:t.x)||0,(t==null?void 0:t.y)||0,(t==null?void 0:t.z)||0);s.current.position.copy(p)}}),D.useEffect(()=>function(){s.current&&s.current.clear()},[s]);const h=D.useMemo(()=>(a==null?void 0:a.ref_id)===(t==null?void 0:t.ref_id),[a==null?void 0:a.ref_id,t==null?void 0:t.ref_id]),d=(n==null?void 0:n.ref_id)===(t==null?void 0:t.ref_id);return l||d&&o||!d?L.jsx("group",{ref:s,position:i,children:L.jsx(tr,{center:!0,sprite:!0,zIndexRange:[0,0],children:l?L.jsxs($v,{direction:"column",onClick:p=>{p.stopPropagation(),t&&r(t)},onPointerOut:p=>{p.stopPropagation()},onPointerOver:p=>{p.stopPropagation()},children:[L.jsx("div",{className:"badge-wrapper",children:L.jsx(Ic,{type:(t==null?void 0:t.node_type)||""})}),Ql(t==null?void 0:t.name,20)]}):L.jsxs(Gv,{className:Zl(t==null?void 0:t.node_type,{selected:d}),color:e,fontColor:Tt.white,fontSize:l?64:20,onClick:p=>{p.stopPropagation(),t&&r(t)},onPointerOut:p=>{p.stopPropagation()},onPointerOver:p=>{p.stopPropagation()},scale:h?1.05:1,selected:!1,size:d?68:40,type:(t==null?void 0:t.node_type)||"",children:[!u&&!l?L.jsx("div",{className:"badge-wrapper",children:L.jsx(Ic,{type:(t==null?void 0:t.node_type)||""})}):null,t!=null&&t.name?t==null?void 0:t.name:L.jsx(Zd,{rounded:u,size:d?60:52,src:(t==null?void 0:t.image_url)||"audio_default.svg",type:t==null?void 0:t.node_type})]})})}):null},gd=D.memo(()=>{const{simulation:i,showSelectionGraph:t,selectedNode:e,selectionGraphData:s}=pe(Ia(o=>o)),n=po(),r=D.useMemo(()=>{const o=(i==null?void 0:i.nodes())||[];return(t?s.nodes:o).filter(u=>n.includes((u==null?void 0:u.ref_id)||"")||(e==null?void 0:e.ref_id)===(u==null?void 0:u.ref_id)).slice(0,v1).map(u=>{const h=Xl(u.node_type||"",!0),d=new rt((u==null?void 0:u.x)||0,(u==null?void 0:u.y)||0,(u==null?void 0:u.z)||0),p=o.filter(_=>_.ref_id&&x1(_,u)).map(_=>(_==null?void 0:_.ref_id)||"")||[];return L.jsx(Xv,{color:h,position:d,relativeIds:p,userData:u},`node-badge-${u.ref_id}`)})},[i,t,s.nodes,n,e==null?void 0:e.ref_id]);return L.jsx(D.Fragment,{children:r.length?r:null},"node-badges")});gd.displayName="RelevanceBadges";const Qv=({link:i,animated:t})=>{const e=D.useRef(null),s=ts(),[n,r]=D.useState(new rt(0,0,0)),[o,a]=D.useState(new rt(0,0,0)),[c,l]=D.useState(8947848),u=pe(h=>h.selectionGraphData);return D.useEffect(()=>{var p,_,f,m,v,b;const h=(s==null?void 0:s.ref_id)||"",d=s&&(h===i.target||h===i.source);!i.onlyVisibleOnSelect||d?(r(new rt(((p=i.sourcePosition)==null?void 0:p.x)||0,((_=i.sourcePosition)==null?void 0:_.y)||0,((f=i.sourcePosition)==null?void 0:f.z)||0)),a(new rt(((m=i.targetPosition)==null?void 0:m.x)||0,((v=i.targetPosition)==null?void 0:v.y)||0,((b=i.targetPosition)==null?void 0:b.z)||0))):(r(new rt(0,0,0)),a(new rt(0,0,0))),l(d?i.color||Ed.children.segmentColor:s?5592405:8947848)},[s,i]),Pe(()=>{if(t&&e.current){const h=u.nodes.find(p=>p.ref_id===i.source),d=u.nodes.find(p=>p.ref_id===i.target);e.current.start.set((h==null?void 0:h.x)||0,(h==null?void 0:h.y)||0,(h==null?void 0:h.z)||0),e.current.end.set((d==null?void 0:d.x)||0,(d==null?void 0:d.y)||0,(d==null?void 0:d.z)||0)}}),L.jsx(L.Fragment,{children:L.jsx(Jf,{ref:e,color:"0xFFFFFF",end:o,start:n})})},Kv=({links:i,simulation:t})=>{const e=D.useRef(null);return D.useEffect(()=>function(){e.current&&e.current.clear()},[e]),Pe(()=>{if(e.current){const s=t.nodes();e.current.children.forEach((r,o)=>{var u;const a=i[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)})}}),i.length?L.jsx("group",{ref:e,children:i.map(s=>L.jsx("mesh",{children:L.jsx(tr,{center:!0,sprite:!0,children:L.jsxs(Jv,{direction:"row",justify:"center",onClick:n=>{n.stopPropagation()},onPointerOut:n=>{n.stopPropagation()},onPointerOver:n=>{n.stopPropagation()},children:[L.jsx("span",{children:s.edge_type}),L.jsx(gs,{className:"icon",children:L.jsx(Xd,{})})]})})},s.ref_id))}):null},Jv=Ut(gs)` text-align: center; outline-offset: 0px; @@ -561,9 +561,9 @@ import{r as D,e as Oe,j as L,t as Kl,w as Ut,x as Tt,F as ys,z as Jl,v as Us,E a top: -7px; left: -14px; } -`,mr={metalness:.9,roughness:0},Sd=new nr,go=Sd.load("noimage.jpeg"),Zl=new Xn({...mr,map:go}),Ed=.4,fx=new Xn({...mr,map:go,transparent:!0,opacity:Ed}),Ir={},px=(i,t)=>{const[e,s]=D.useState(go),[n,r]=D.useState(Zl);return D.useEffect(()=>{const o=`${i}${t&&"-transparent"}`;if(Ir[o]){s(Ir[o].texture),r(Ir[o].material);return}Sd.load(i,a=>{const c=new Xn({map:a,transparent:t,opacity:t?Ed:1,...mr});Ir[o]={texture:a,material:c},s(a),r(c)},void 0,()=>{s(go),r(t?fx:Zl)})},[i,t]),D.useEffect(()=>function(){e.dispose(),n.dispose()},[e,n]),{material:n,texture:e}},Od=D.memo(({node:i,hide:t,animated:e})=>{const s=D.useRef(null),[n]=D.useState(Ml),r=We(),{showSelectionGraph:o}=oe(u=>u),a=!!r&&i.ref_id===r.ref_id,{material:c}=px(i.image_url||"noimage.jpeg",!1);be((u,h)=>{e&&s.current&&a&&(s.current.rotation.y+=h*1,s.current.rotation.x-=h*.6)}),D.useEffect(()=>function(){n.dispose()},[n]);const l=D.useMemo(()=>o&&a?20:a?(i.scale||1)*1.2:i.scale,[i,a,o]);return L.jsx(_0,{enabled:!!a,children:L.jsx("mesh",{ref:s,geometry:Ml,material:c,name:i.id,scale:l,userData:i,visible:!t})})});Od.displayName="Cube";const mx=i=>{const t=/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g;return i.replace(t,e=>/^[\d*#]$/.test(e)?e:"")},Ad=new nr,Md=Ad.load("noimage.jpeg");new Xn({...mr,map:Md});const _x=.4;new Xn({...mr,map:Md,transparent:!0,opacity:_x});const Xl={},gx=i=>{const[t,e]=D.useState(null);return D.useEffect(()=>{if(!i){e(null);return}const s=i;if(Xl[s]){e(Xl[s].texture);return}Ad.load(i,n=>{e(n)},void 0,()=>{e(null)})},[i]),D.useEffect(()=>function(){t&&t.dispose()},[t]),{texture:t}},yx=["#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"];function vx(i){const t=iu(i,30),e=t.split(" ");if(e.length<=5)return t;const s=Math.ceil(e.length/3),n=s*2,r=e.slice(0,s).join(" "),o=e.slice(s,n).join(" "),a=e.slice(n).join(" ");return`${r} +`,tx=i=>{const t=/(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\u0023-\u0039]\ufe0f?\u20e3|\u3299|\u3297|\u303d|\u3030|\u24c2|\ud83c[\udd70-\udd71]|\ud83c[\udd7e-\udd7f]|\ud83c\udd8e|\ud83c[\udd91-\udd9a]|\ud83c[\udde6-\uddff]|\ud83c[\ude01-\ude02]|\ud83c\ude1a|\ud83c\ude2f|\ud83c[\ude32-\ude3a]|\ud83c[\ude50-\ude51]|\u203c|\u2049|[\u25aa-\u25ab]|\u25b6|\u25c0|[\u25fb-\u25fe]|\u00a9|\u00ae|\u2122|\u2139|\ud83c\udc04|[\u2600-\u26FF]|\u2b05|\u2b06|\u2b07|\u2b1b|\u2b1c|\u2b50|\u2b55|\u231a|\u231b|\u2328|\u23cf|[\u23e9-\u23f3]|[\u23f8-\u23fa]|\ud83c\udccf|\u2934|\u2935|[\u2190-\u21ff])/g;return i.replace(t,e=>/^[\d*#]$/.test(e)?e:"")},yd={metalness:.9,roughness:0},vd=new mo,xd=vd.load("noimage.jpeg");new Ra({...yd,map:xd});const ex=.4;new Ra({...yd,map:xd,transparent:!0,opacity:ex});const ql={},sx=i=>{const[t,e]=D.useState(null);return D.useEffect(()=>{if(!i){e(null);return}const s=i;if(ql[s]){e(ql[s].texture);return}vd.load(i,n=>{e(n)},void 0,()=>{e(null)})},[i]),D.useEffect(()=>function(){t&&t.dispose()},[t]),{texture:t}},nx=["#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"];function ix(i){const t=Ql(i,30),e=t.split(" ");if(e.length<=5)return t;const s=Math.ceil(e.length/3),n=s*2,r=e.slice(0,s).join(" "),o=e.slice(s,n).join(" "),a=e.slice(n).join(" ");return`${r} ${o} -${a}`}const Nc=D.memo(({node:i,hide:t,isHovered:e})=>{var T,x,C,O;const s=D.useRef(null),n=D.useRef(null),r=D.useRef(null),o=We(),a=D.useRef(new rt),{texture:c}=gx(((T=i.properties)==null?void 0:T.image_url)||""),u=xo().includes((i==null?void 0:i.ref_id)||""),h=!!o&&(o==null?void 0:o.ref_id)===i.ref_id,d=oe(P=>P.showSelectionGraph),{normalizedSchemasByType:p}=Fa(P=>P);be(({camera:P,clock:M})=>{const V=()=>{const B=a.current.setFromMatrixPosition(n.current.matrixWorld);n.current&&(n.current.visible=B.distanceTo(P.position)<2500)};if(e){n.current&&(n.current.visible=!0);const B=1+.2*Math.sin(M.getElapsedTime()*2);r.current&&r.current.scale.set(B,B,B);return}V()});const _=eu(),f=D.useMemo(()=>{if(!i.name)return 0;let P=(i.edge_count||1)*20;d&&h?P=40:!h&&u&&(P=0);const M=P/Math.sqrt(i.name.length);return Math.min(Math.max(M,20),30)},[i.edge_count,i.name,h,u,d]);D.useMemo(()=>o&&!h||!e?.2:1,[h,o,e]);const m=(x=p[i.node_type])==null?void 0:x.primary_color,v=(C=p[i.node_type])==null?void 0:C.icon,b=m??(yx[_.indexOf(i.node_type)]||Tt.white),g=(v?ff[v]:null)?v:"NodesIcon",y=mx(String(i.name)),k={u_texture:{value:c},u_radius:{value:.5}};return L.jsx(cu,{follow:!0,lockX:!1,lockY:!1,lockZ:!1,name:"billboard",userData:i,children:L.jsxs("mesh",{ref:n,name:i.id,userData:i,visible:!t,children:[e?L.jsxs("mesh",{ref:r,position:[0,0,-2],children:[L.jsx("circleGeometry",{args:[30,32]}),L.jsx("meshBasicMaterial",{color:b,opacity:.5,transparent:!0})]}):null,(O=i.properties)!=null&&O.image_url&&i.node_type==="Person"&&c?L.jsx(Xd,{args:[10*2,10*2],scale:2,children:L.jsx("shaderMaterial",{fragmentShader:` +${a}`}const Mc=D.memo(({node:i,hide:t,isHovered:e,ignoreDistance:s})=>{var x,C,O,I;const n=D.useRef(null),r=D.useRef(null),o=D.useRef(null),a=ts(),c=D.useRef(new rt),{texture:l}=sx(((x=i.properties)==null?void 0:x.image_url)||""),h=po().includes((i==null?void 0:i.ref_id)||""),d=!!a&&(a==null?void 0:a.ref_id)===i.ref_id,p=pe(M=>M.showSelectionGraph),{normalizedSchemasByType:_}=Da(M=>M);Pe(({camera:M,clock:V})=>{const W=()=>{const G=c.current.setFromMatrixPosition(r.current.matrixWorld);r.current&&(r.current.visible=s?!0:G.distanceTo(M.position)<2500)};if(e){r.current&&(r.current.visible=!0);const G=1+.2*Math.sin(V.getElapsedTime()*2);o.current&&o.current.scale.set(G,G,G);return}W()});const f=$l(),m=D.useMemo(()=>{if(!i.name)return 0;let M=(i.edge_count||1)*20;p&&d?M=40:!d&&h&&(M=0);const V=M/Math.sqrt(i.name.length);return Math.min(Math.max(V,20),30)},[i.edge_count,i.name,d,h,p]);D.useMemo(()=>a&&!d||!e?.2:1,[d,a,e]);const v=(C=_[i.node_type])==null?void 0:C.primary_color,b=(O=_[i.node_type])==null?void 0:O.icon,w=v??(nx[f.indexOf(i.node_type)]||Tt.white),y=(b?Qd[b]:null)?b:"NodesIcon",k=tx(String(i.name)),T={u_texture:{value:l},u_radius:{value:.5}};return L.jsx(eu,{follow:!0,lockX:!1,lockY:!1,lockZ:!1,name:"billboard",userData:i,children:L.jsxs("mesh",{ref:r,name:i.id,userData:i,visible:!t,children:[e?L.jsxs("mesh",{ref:o,position:[0,0,-2],children:[L.jsx("circleGeometry",{args:[30,32]}),L.jsx("meshBasicMaterial",{color:w,opacity:.5,transparent:!0})]}):null,(I=i.properties)!=null&&I.image_url&&i.node_type==="Person"&&l?L.jsx(zd,{args:[10*2,10*2],scale:2,children:L.jsx("shaderMaterial",{fragmentShader:` uniform sampler2D u_texture; uniform float u_radius; varying vec2 vUv; @@ -577,13 +577,13 @@ ${a}`}const Nc=D.memo(({node:i,hide:t,isHovered:e})=>{var T,x,C,O;const s=D.useR discard; // Discard pixels outside the circle } } - `,uniforms:k,vertexShader:` + `,uniforms:T,vertexShader:` varying vec2 vUv; void main() { vUv = uv; gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); } - `})}):L.jsx(t0,{ref:s,name:"svg",onUpdate:P=>{P.traverse(M=>{M instanceof au&&(M.material=new zf({color:b}))})},position:[-15,15,0],scale:2,src:`svg-icons/${g}.svg`,strokeMaterial:{color:"yellow"},userData:i}),i.name&&L.jsx(Qd,{color:b,fillOpacity:1,name:"text",position:[0,-65,0],scale:f,userData:i,...Kd,children:vx(y)})]})})});Nc.displayName="TextNode";const Dd=D.memo(()=>{const[i,t]=D.useState(null),{dataInitial:e}=Us(l=>l),s=We(),n=D.useRef(null),r=xo(),o=Jd(e==null?void 0:e.nodes.length),{selectionGraphData:a,setSelectionData:c}=oe(Va(l=>l));return D.useEffect(()=>{const l=structuredClone((e==null?void 0:e.nodes)||[]),u=structuredClone((e==null?void 0:e.links)||[]);if(o===l.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 p=d.ref_id===(s==null?void 0:s.ref_id)?{fx:0,fy:0,fz:0}:{};return{...d,x:0,y:0,z:0,...p}});if(h){const d=u.filter(p=>h.some(_=>_.ref_id===p.target)&&h.some(_=>_.ref_id===p.source));c({nodes:h,links:d})}},[e,s,r,c,o]),D.useEffect(()=>{if(i||!a.nodes.length)return;const l=structuredClone(a.links),u=lx(a.nodes,l,{numDimensions:2,forceLinkStrength:.01,forceCenterStrength:.85,forceChargeStrength:-20,velocityDecay:.9});t(u)},[a,i]),D.useEffect(()=>()=>{c({nodes:[],links:[]})},[c]),D.useEffect(()=>{i&&i.on("tick",()=>{n.current&&n.current.children.forEach((u,h)=>{const d=i.nodes()[h];d&&u.position.set(d.x,d.y,d.z)})})},[i]),console.log(a.nodes),L.jsxs(L.Fragment,{children:[L.jsx("group",{ref:n,name:"simulation-2d-group",children:a==null?void 0:a.nodes.map(l=>L.jsx("mesh",{children:l.name?L.jsx(Nc,{hide:!0,isHovered:!1,node:l},l.ref_id||l.id):L.jsx(Od,{hide:!0,node:l},l.ref_id||l.id)},l.ref_id))}),L.jsx(l0,{fog:!0,lineWidth:.9,children:(a==null?void 0:a.links).map((l,u)=>L.jsx(ux,{animated:!0,link:l},u.toString()))},`selection-links-${a==null?void 0:a.links.length}`),i&&L.jsx(hx,{links:a.links,simulation:i})]})});Dd.displayName="SelectionDataNodes";const xx=200,Pd=D.memo(()=>{const i=We(),t=ru(),e=xo(),{selectionGraphData:s,showSelectionGraph:n,setHoveredNode:r,setIsHovering:o}=oe(f=>f),a=Us(f=>f.dataInitial),c=er(f=>f.setTranscriptOpen),l=D.useCallback(f=>!!(n&&!s.nodes.find(m=>m.ref_id===f.ref_id)),[n,s]),u=D.useCallback(f=>{const m=f==null?void 0:f[0];m&&(c(!1),m.userData&&(l(m.userData)||oe.getState().setSelectedNode((m==null?void 0:m.userData)||null)))},[c,l]),h=D.useRef(null),d=D.useCallback(f=>{f.stopPropagation(),h.current&&(clearTimeout(h.current),h.current=null),t&&(o(!1),r(null))},[o,r,t]),p=D.useCallback(f=>{var b;const v=f.intersections.map(w=>w.object)[0];if(h.current&&(clearTimeout(h.current),h.current=null),(b=v==null?void 0:v.userData)!=null&&b.ref_id){const w=v.userData;l(w)||(f.stopPropagation(),h.current=setTimeout(()=>{o(!0),r(w)},xx))}},[r,l,o]),_=n&&!!i;return L.jsxs(Jf,{filter:f=>f.filter(m=>{var v;return!!((v=m.userData)!=null&&v.ref_id)}),onChange:u,onPointerOut:d,onPointerOver:p,children:[L.jsx(Cd,{}),L.jsx("group",{name:"simulation-3d-group__nodes",visible:!_,children:a==null?void 0:a.nodes.map(f=>{const m=!!i&&(e.includes(f.ref_id)||i.ref_id===f.ref_id);return L.jsxs("mesh",{name:"wr2",scale:f.scale||1,userData:f,children:[L.jsx("boxGeometry",{args:[40,40,40]}),L.jsx("meshStandardMaterial",{opacity:0,transparent:!0}),L.jsx(Nc,{hide:_||m,isHovered:!!t&&t.ref_id===f.ref_id,node:f},f.ref_id||f.id)]},f.ref_id)})}),L.jsx("group",{name:"simulation-3d-group__node-points",children:L.jsx(ix,{})}),_&&L.jsx(Dd,{})]})});Pd.displayName="Cubes";const kx={earthRef:null},Tx=Kl(i=>({...kx,setEarthRef:t=>i({earthRef:t})})),wx=new rt(0,0,0),bx=()=>{const i=D.useRef(null),t=D.useRef(null),{graphStyle:e,showSelectionGraph:s}=oe(a=>a),n=Tx(a=>a.setEarthRef),r=Ks("textures/earth/galaxy.png"),o=Ks("textures/earth/clouds.png");return be(({camera:a})=>{t.current&&t.current.position.copy(a.getWorldPosition(wx))}),D.useLayoutEffect(()=>{i.current&&n(i)},[n]),e!=="earth"||s?null:L.jsxs(L.Fragment,{children:[L.jsxs("mesh",{ref:i,userData:{type:"earth"},children:[L.jsx("sphereGeometry",{args:[Mr,200,200]}),L.jsx(Cx,{})]}),L.jsxs("mesh",{children:[L.jsx("sphereGeometry",{args:[Mr+2,200,200]}),L.jsx("meshStandardMaterial",{alphaMap:o,map:o,transparent:!0})]}),L.jsxs("mesh",{children:[L.jsx("sphereGeometry",{args:[Mr*4,200,200]}),L.jsx("meshStandardMaterial",{map:r,opacity:.4,side:ca,transparent:!0})]}),L.jsx("directionalLight",{ref:t,intensity:.9,position:[0,0,Mr*3]})]})},Cx=()=>{const i=Ks("textures/earth/earth.jpeg"),t=Ks("textures/earth/bump.jpeg"),e=Ks("textures/earth/water.png"),s=D.useMemo(()=>new Xn({map:i,bumpMap:t,aoMap:t,roughnessMap:t,metalnessMap:e,toneMapped:!0,roughness:35,metalness:0}),[i,t,e]);return L.jsx("meshStandardMaterial",{...s})},Sx="C",Ex=256,Ox=256,Ax={g:"LottieFiles AE 0.1.20"},Mx=[{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}],Dx="5.5.7",Px=60,Ix=104,Nx=0,Rx=[{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}]}],Fx={nm:Sx,h:Ex,w:Ox,meta:Ax,layers:Mx,v:Dx,fr:Px,op:Ix,ip:Nx,assets:Rx},Lx=({meshId:i})=>{const t=D.useRef(null);return D.useEffect(()=>{const e=document.getElementById(`lottie-animation-${i}`);return e&&(t.current=Vd.loadAnimation({container:e,animationData:Fx,loop:!0,autoplay:!0})),()=>{t.current&&t.current.destroy()}},[i]),L.jsx("div",{id:`lottie-animation-${i}`,style:{width:"2em",height:"2em"}})},oa=()=>Math.floor(Math.random()*2001)-1e3,Vx=()=>L.jsx(L.Fragment,{children:["a","b","c"].map(i=>{const t=oa(),e=oa(),s=oa();return L.jsx("mesh",{position:[t,e,s],children:L.jsx(sr,{center:!0,sprite:!0,children:L.jsx(Ux,{children:L.jsx(Lx,{meshId:i})})})},i)})}),Ux=Ut.div` + `})}):L.jsx(Bf,{ref:n,name:"svg",onUpdate:M=>{M.traverse(V=>{V instanceof tu&&(V.material=new Af({color:w}))})},position:[-15,15,0],scale:2,src:`svg-icons/${y}.svg`,strokeMaterial:{color:"yellow"},userData:i}),i.name&&L.jsx(jd,{color:w,fillOpacity:1,name:"text",position:[0,-65,0],scale:m,userData:i,...Bd,children:ix(k)})]})})});Mc.displayName="TextNode";const kd=D.memo(()=>{const[i,t]=D.useState(null),{dataInitial:e}=Vs(l=>l),s=ts(),n=D.useRef(null),r=po(),o=qd(e==null?void 0:e.nodes.length),{selectionGraphData:a,setSelectionData:c}=pe(Ia(l=>l));return D.useEffect(()=>{const l=structuredClone((e==null?void 0:e.nodes)||[]),u=structuredClone((e==null?void 0:e.links)||[]);if(o===l.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 p=d.ref_id===(s==null?void 0:s.ref_id)?{fx:0,fy:0,fz:0}:{};return{...d,x:0,y:0,z:0,...p}});if(h){const d=u.filter(p=>h.some(_=>_.ref_id===p.target)&&h.some(_=>_.ref_id===p.source));c({nodes:h,links:d})}},[e,s,r,c,o]),D.useEffect(()=>{if(i||!a.nodes.length)return;const l=structuredClone(a.links),u=Kd([]).numDimensions(2).stop().nodes(a.nodes).force("link",Jd().links(l).id(h=>h.ref_id)).force("collide",tf().radius(()=>150).strength(1).iterations(1)).alpha(1).restart();t(u)},[a,i]),D.useEffect(()=>()=>{c({nodes:[],links:[]})},[c]),D.useEffect(()=>{i&&i.on("tick",()=>{n.current&&n.current.children.forEach((u,h)=>{const d=i.nodes()[h];d&&u.position.set(d.x,d.y,d.z)})})},[i]),L.jsxs(L.Fragment,{children:[L.jsx("group",{ref:n,name:"simulation-2d-group",children:a==null?void 0:a.nodes.map(l=>L.jsx("mesh",{children:L.jsx(Mc,{hide:!0,ignoreDistance:!0,isHovered:!1,node:l},l.ref_id||l.id)},l.ref_id))}),L.jsx(Qf,{fog:!0,lineWidth:.9,children:(a==null?void 0:a.links).map((l,u)=>L.jsx(Qv,{animated:!0,link:l},u.toString()))},`selection-links-${a==null?void 0:a.links.length}`),i&&L.jsx(Kv,{links:a.links,simulation:i})]})});kd.displayName="SelectionDataNodes";const rx=200,Td=D.memo(()=>{const i=ts(),t=Kl(),e=po(),{selectionGraphData:s,showSelectionGraph:n,setHoveredNode:r,setIsHovering:o}=pe(f=>f),a=Vs(f=>f.dataInitial),c=Ji(f=>f.setTranscriptOpen),l=D.useCallback(f=>!!(n&&!s.nodes.find(m=>m.ref_id===f.ref_id)),[n,s]),u=D.useCallback(f=>{const m=f==null?void 0:f[0];m&&(c(!1),m.userData&&(l(m.userData)||pe.getState().setSelectedNode((m==null?void 0:m.userData)||null)))},[c,l]),h=D.useRef(null),d=D.useCallback(f=>{f.stopPropagation(),h.current&&(clearTimeout(h.current),h.current=null),t&&(o(!1),r(null))},[o,r,t]),p=D.useCallback(f=>{var b;const v=f.intersections.map(w=>w.object)[0];if(h.current&&(clearTimeout(h.current),h.current=null),(b=v==null?void 0:v.userData)!=null&&b.ref_id){const w=v.userData;l(w)||(f.stopPropagation(),h.current=setTimeout(()=>{o(!0),r(w)},rx))}},[r,l,o]),_=n&&!!i;return L.jsxs(jf,{filter:f=>f.filter(m=>{var v;return!!((v=m.userData)!=null&&v.ref_id)}),onChange:u,onPointerOut:d,onPointerOver:p,children:[L.jsx(gd,{}),L.jsx("group",{name:"simulation-3d-group__nodes",visible:!_,children:a==null?void 0:a.nodes.map(f=>{const m=!!i&&(e.includes(f.ref_id)||i.ref_id===f.ref_id);return L.jsxs("mesh",{name:"wr2",scale:f.scale||1,userData:f,children:[L.jsx("boxGeometry",{args:[40,40,40]}),L.jsx("meshStandardMaterial",{opacity:0,transparent:!0}),L.jsx(Mc,{hide:_||m,ignoreDistance:!1,isHovered:!!t&&t.ref_id===f.ref_id,node:f},f.ref_id||f.id)]},f.ref_id)})}),L.jsx("group",{name:"simulation-3d-group__node-points",children:L.jsx(Yv,{})}),_&&L.jsx(kd,{})]})});Td.displayName="Cubes";const ox={earthRef:null},ax=Hl(i=>({...ox,setEarthRef:t=>i({earthRef:t})})),cx=new rt(0,0,0),lx=()=>{const i=D.useRef(null),t=D.useRef(null),{graphStyle:e,showSelectionGraph:s}=pe(a=>a),n=ax(a=>a.setEarthRef),r=Qs("textures/earth/galaxy.png"),o=Qs("textures/earth/clouds.png");return Pe(({camera:a})=>{t.current&&t.current.position.copy(a.getWorldPosition(cx))}),D.useLayoutEffect(()=>{i.current&&n(i)},[n]),e!=="earth"||s?null:L.jsxs(L.Fragment,{children:[L.jsxs("mesh",{ref:i,userData:{type:"earth"},children:[L.jsx("sphereGeometry",{args:[Sr,200,200]}),L.jsx(ux,{})]}),L.jsxs("mesh",{children:[L.jsx("sphereGeometry",{args:[Sr+2,200,200]}),L.jsx("meshStandardMaterial",{alphaMap:o,map:o,transparent:!0})]}),L.jsxs("mesh",{children:[L.jsx("sphereGeometry",{args:[Sr*4,200,200]}),L.jsx("meshStandardMaterial",{map:r,opacity:.4,side:na,transparent:!0})]}),L.jsx("directionalLight",{ref:t,intensity:.9,position:[0,0,Sr*3]})]})},ux=()=>{const i=Qs("textures/earth/earth.jpeg"),t=Qs("textures/earth/bump.jpeg"),e=Qs("textures/earth/water.png"),s=D.useMemo(()=>new Ra({map:i,bumpMap:t,aoMap:t,roughnessMap:t,metalnessMap:e,toneMapped:!0,roughness:35,metalness:0}),[i,t,e]);return L.jsx("meshStandardMaterial",{...s})},hx="C",dx=256,fx=256,px={g:"LottieFiles AE 0.1.20"},mx=[{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}],_x="5.5.7",gx=60,yx=104,vx=0,xx=[{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}]}],kx={nm:hx,h:dx,w:fx,meta:px,layers:mx,v:_x,fr:gx,op:yx,ip:vx,assets:xx},Tx=({meshId:i})=>{const t=D.useRef(null);return D.useEffect(()=>{const e=document.getElementById(`lottie-animation-${i}`);return e&&(t.current=Od.loadAnimation({container:e,animationData:kx,loop:!0,autoplay:!0})),()=>{t.current&&t.current.destroy()}},[i]),L.jsx("div",{id:`lottie-animation-${i}`,style:{width:"2em",height:"2em"}})},ea=()=>Math.floor(Math.random()*2001)-1e3,wx=()=>L.jsx(L.Fragment,{children:["a","b","c"].map(i=>{const t=ea(),e=ea(),s=ea();return L.jsx("mesh",{position:[t,e,s],children:L.jsx(tr,{center:!0,sprite:!0,children:L.jsx(bx,{children:L.jsx(Tx,{meshId:i})})})},i)})}),bx=Ut.div` border: 2px solid white; border-radius: 50%; display: flex; @@ -591,7 +591,7 @@ ${a}`}const Nc=D.memo(({node:i,hide:t,isHovered:e})=>{var T,x,C,O;const s=D.useR justify-content: center; color: white; font-size: 20px; -`,xi=i=>({close:{backgroundColor:"rgba(48, 51, 66, 1)",borderColor:"#fff",fontColor:"rgba(255, 255, 255, 1)"},focus:{backgroundColor:i?"rgba(255, 255, 255, 0.90);":"rgba(255, 255, 255, 0.90)",borderColor:i?"#FFDB58bb":"#fff",fontColor:"rgba(48, 51, 66, 1)"},menu:{backgroundColor:"#00000066",borderColor:i?"#ffffff66":"#5078f2",fontColor:i?"#ffffff66":"#fff"}}),jx=new rt,Id=D.memo(()=>{var x,C;const i=D.useRef(null),t=er(O=>O.setSidebarOpen),[e,s]=Ud.useState(null),{open:n}=gr("editNodeName"),{open:r}=gr("addEdgeToNode"),{open:o}=gr("mergeToNode"),{open:a}=gr("createBounty"),[c]=tu(O=>[O.isAdmin]),[l]=Us(O=>[O.addNewNode]),u=We(),{showSelectionGraph:h,selectionGraphData:d,setSelectedNode:p,setShowSelectionGraph:_}=oe(O=>O),f=Bf(),m=D.useCallback(async()=>{try{if(u!=null&&u.ref_id){const O=await jd(u==null?void 0:u.ref_id,d.nodes.length||0);O&&l(O)}}catch(O){console.log(O)}},[l,u==null?void 0:u.ref_id,d.nodes.length]);be(()=>{v()});const v=D.useCallback(()=>{const O=h?d:f;if(i.current){const P=O==null?void 0:O.nodes.find(M=>M.ref_id===(u==null?void 0:u.ref_id));if(P){const M=jx.set(P==null?void 0:P.x,P==null?void 0:P.y,P==null?void 0:P.z);i.current.position.copy(M)}}},[u,h,d,f]),b=D.useMemo(()=>{const O=c?[{key:"control-key-1",colors:xi(h).focus,icon:L.jsx(yf,{}),left:-80,className:"add",onClick:M=>{s(M.currentTarget)}},{key:"control-key-2",colors:xi(h).focus,icon:L.jsx(vf,{}),left:-40,className:"edit",onClick:()=>{n()}}]:[],P=[{key:"control-key-4",colors:xi(h).focus,icon:L.jsx(zd,{}),left:0,className:"expand",onClick:()=>{const M=!h;_(M),M&&t(!0)}},{key:"control-key-5",colors:xi(!0).close,icon:L.jsx(xf,{}),left:40,className:"exit",onClick:()=>{m()}},{key:"control-key-6",colors:xi(!0).close,icon:L.jsx(Bd,{}),left:40,className:"exit",onClick:()=>{_(!1),p(null)}}];return[...O,...P].map((M,V)=>({...M,left:-80+V*40}))},[c,h,n,_,t,m,p]);if(!u)return null;const w=()=>{s(null)},g=!!e,y=g?"simple-popover":void 0,k=((x=u==null?void 0:u.node_type)==null?void 0:x.toLowerCase())==="repository",T=!!(u&&((C=u==null?void 0:u.node_type)==null?void 0:C.toLowerCase())==="function");return L.jsx("group",{ref:i,children:L.jsxs(sr,{center:!0,className:"control-panel",onClick:O=>O.stopPropagation(),onKeyDown:O=>O.stopPropagation(),onPointerDown:O=>O.stopPropagation(),onPointerOut:O=>O.stopPropagation(),onPointerOver:O=>O.stopPropagation(),onPointerUp:O=>O.stopPropagation(),sprite:!0,zIndexRange:[16777271,16777272],children:[b.map(O=>L.jsx(zx,{backgroundColor:O.colors.backgroundColor,borderColor:O.colors.borderColor,className:O.className,fontColor:O.colors.fontColor,left:O.left,onClick:P=>{P.stopPropagation(),O.onClick(P)},children:O.icon},O.key)),T&&L.jsx(qx,{left:2,onClick:()=>{a()},children:"Create Test"}),L.jsx(Bx,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:y,onClose:w,open:g,transformOrigin:{vertical:"top",horizontal:"right"},children:k?L.jsxs(L.Fragment,{children:[L.jsxs(Sn,{"data-testid":"generate_tests",onClick:()=>{w()},children:[L.jsx(Ql,{children:L.jsx(Vc,{"data-testid":"AddCircleIcon"})}),"Generate Tests"]}),L.jsxs(Sn,{"data-testid":"add_comments",onClick:()=>{w()},children:[L.jsxs(Ql,{children:[L.jsx(mf,{"data-testid":"DocumentIcon"})," "]}),"Add Comments"]}),L.jsxs(Sn,{"data-testid":"review_bugs",onClick:()=>{w()},children:[L.jsx(_f,{"data-testid":"ConstructionIcon"})," Review Bugs"]}),L.jsxs(Sn,{"data-testid":"find_vulnerabilities",onClick:()=>{w()},children:[L.jsx(gf,{"data-testid":"RobotIcon"})," Find Vulnerabilities"]})]}):L.jsxs(L.Fragment,{children:[L.jsxs(Sn,{"data-testid":"merge",onClick:()=>{o(),w()},children:[L.jsx(pf,{"data-testid":"MergeIcon"})," Merge"]}),L.jsxs(Sn,{"data-testid":"add_edge",onClick:()=>{r(),w()},children:[L.jsx(Vc,{"data-testid":"AddCircleIcon"}),"Add edge"]})]})})]})})});Id.displayName="NodeControls";const zx=Ut.div` +`,yi=i=>({close:{backgroundColor:"rgba(48, 51, 66, 1)",borderColor:"#fff",fontColor:"rgba(255, 255, 255, 1)"},focus:{backgroundColor:i?"rgba(255, 255, 255, 0.90);":"rgba(255, 255, 255, 0.90)",borderColor:i?"#FFDB58bb":"#fff",fontColor:"rgba(48, 51, 66, 1)"},menu:{backgroundColor:"#00000066",borderColor:i?"#ffffff66":"#5078f2",fontColor:i?"#ffffff66":"#fff"}}),Cx=new rt,wd=D.memo(()=>{var x,C;const i=D.useRef(null),t=Ji(O=>O.setSidebarOpen),[e,s]=Ad.useState(null),{open:n}=fr("editNodeName"),{open:r}=fr("addEdgeToNode"),{open:o}=fr("mergeToNode"),{open:a}=fr("createBounty"),[c]=Gl(O=>[O.isAdmin]),[l]=Vs(O=>[O.addNewNode]),u=ts(),{showSelectionGraph:h,selectionGraphData:d,setSelectedNode:p,setShowSelectionGraph:_}=pe(O=>O),f=Mf(),m=D.useCallback(async()=>{try{if(u!=null&&u.ref_id){const O=await Md(u==null?void 0:u.ref_id,d.nodes.length||0);O&&l(O)}}catch(O){console.log(O)}},[l,u==null?void 0:u.ref_id,d.nodes.length]);Pe(()=>{v()});const v=D.useCallback(()=>{const O=h?d:f;if(i.current){const I=O==null?void 0:O.nodes.find(M=>M.ref_id===(u==null?void 0:u.ref_id));if(I){const M=Cx.set(I==null?void 0:I.x,I==null?void 0:I.y,I==null?void 0:I.z);i.current.position.copy(M)}}},[u,h,d,f]),b=D.useMemo(()=>{const O=c?[{key:"control-key-1",colors:yi(h).focus,icon:L.jsx(of,{}),left:-80,className:"add",onClick:M=>{s(M.currentTarget)}},{key:"control-key-2",colors:yi(h).focus,icon:L.jsx(af,{}),left:-40,className:"edit",onClick:()=>{n()}}]:[],I=[{key:"control-key-4",colors:yi(h).focus,icon:L.jsx(Dd,{}),left:0,className:"expand",onClick:()=>{const M=!h;_(M),M&&t(!0)}},{key:"control-key-5",colors:yi(!0).close,icon:L.jsx(cf,{}),left:40,className:"exit",onClick:()=>{m()}},{key:"control-key-6",colors:yi(!0).close,icon:L.jsx(Pd,{}),left:40,className:"exit",onClick:()=>{_(!1),p(null)}}];return[...O,...I].map((M,V)=>({...M,left:-80+V*40}))},[c,h,n,_,t,m,p]);if(!u)return null;const w=()=>{s(null)},g=!!e,y=g?"simple-popover":void 0,k=((x=u==null?void 0:u.node_type)==null?void 0:x.toLowerCase())==="repository",T=!!(u&&((C=u==null?void 0:u.node_type)==null?void 0:C.toLowerCase())==="function");return L.jsx("group",{ref:i,children:L.jsxs(tr,{center:!0,className:"control-panel",onClick:O=>O.stopPropagation(),onKeyDown:O=>O.stopPropagation(),onPointerDown:O=>O.stopPropagation(),onPointerOut:O=>O.stopPropagation(),onPointerOver:O=>O.stopPropagation(),onPointerUp:O=>O.stopPropagation(),sprite:!0,zIndexRange:[16777271,16777272],children:[b.map(O=>L.jsx(Sx,{backgroundColor:O.colors.backgroundColor,borderColor:O.colors.borderColor,className:O.className,fontColor:O.colors.fontColor,left:O.left,onClick:I=>{I.stopPropagation(),O.onClick(I)},children:O.icon},O.key)),T&&L.jsx(Ox,{left:2,onClick:()=>{a()},children:"Create Test"}),L.jsx(Ex,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:y,onClose:w,open:g,transformOrigin:{vertical:"top",horizontal:"right"},children:k?L.jsxs(L.Fragment,{children:[L.jsxs(Cn,{"data-testid":"generate_tests",onClick:()=>{w()},children:[L.jsx(Wl,{children:L.jsx(Nc,{"data-testid":"AddCircleIcon"})}),"Generate Tests"]}),L.jsxs(Cn,{"data-testid":"add_comments",onClick:()=>{w()},children:[L.jsxs(Wl,{children:[L.jsx(sf,{"data-testid":"DocumentIcon"})," "]}),"Add Comments"]}),L.jsxs(Cn,{"data-testid":"review_bugs",onClick:()=>{w()},children:[L.jsx(nf,{"data-testid":"ConstructionIcon"})," Review Bugs"]}),L.jsxs(Cn,{"data-testid":"find_vulnerabilities",onClick:()=>{w()},children:[L.jsx(rf,{"data-testid":"RobotIcon"})," Find Vulnerabilities"]})]}):L.jsxs(L.Fragment,{children:[L.jsxs(Cn,{"data-testid":"merge",onClick:()=>{o(),w()},children:[L.jsx(ef,{"data-testid":"MergeIcon"})," Merge"]}),L.jsxs(Cn,{"data-testid":"add_edge",onClick:()=>{r(),w()},children:[L.jsx(Nc,{"data-testid":"AddCircleIcon"}),"Add edge"]})]})})]})})});wd.displayName="NodeControls";const Sx=Ut.div` position: fixed; top: -60px; left: ${i=>-7+i.left}px; @@ -609,7 +609,7 @@ ${a}`}const Nc=D.memo(({node:i,hide:t,isHovered:e})=>{var T,x,C,O;const s=D.useR cursor: pointer; transition: opacity 0.4s; box-shadow: 0px 2px 12px rgba(0, 0, 0, 0.5); -`,Sn=Ut(ys).attrs({direction:"row",px:12,py:8})` +`,Cn=Ut(gs).attrs({direction:"row",px:12,py:8})` display: flex; align-items: center; justify-content: start; @@ -622,7 +622,7 @@ ${a}`}const Nc=D.memo(({node:i,hide:t,isHovered:e})=>{var T,x,C,O;const s=D.useR background: ${Tt.BUTTON1_HOVER}; color: ${Tt.GRAY3}; } -`,Bx=Ut(kf)` +`,Ex=Ut(lf)` && { z-index: 9999; } @@ -638,7 +638,7 @@ ${a}`}const Nc=D.memo(({node:i,hide:t,isHovered:e})=>{var T,x,C,O;const s=D.useR background-color: transparent !important; margin: 2px; } -`,Ql=Ut.div` +`,Wl=Ut.div` display: flex; align-items: center; justify-content: start; @@ -648,7 +648,7 @@ ${a}`}const Nc=D.memo(({node:i,hide:t,isHovered:e})=>{var T,x,C,O;const s=D.useR width: 12px; height: 12px; } -`,qx=Ut.div` +`,Ox=Ut.div` position: fixed; top: 40px; left: ${i=>-53+i.left}px; @@ -667,7 +667,7 @@ ${a}`}const Nc=D.memo(({node:i,hide:t,isHovered:e})=>{var T,x,C,O;const s=D.useR &:hover { transform: scale(1.05); } -`,Nd=D.memo(()=>L.jsx(L.Fragment,{children:L.jsx(Id,{})}));Nd.displayName="NodeDetailsPanel";const Wx=()=>{const{dataInitial:i,isLoadingNew:t,isFetching:e,dataNew:s,resetDataNew:n}=Us(f=>f),r=D.useRef(null),o=D.useRef(!1),{normalizedSchemasByType:a}=Fa(f=>f),c=D.useRef(new Map),{setData:l,simulation:u,simulationCreate:h,simulationHelpers:d,graphStyle:p,setGraphRadius:_}=oe(f=>f);return D.useEffect(()=>{if(!s)return;const f=s.nodes||[],m=s.links||[],v=structuredClone(f),b=structuredClone(m);if(u){const w=qd.isEqual(s,i);d.addNodesAndLinks(v,b,w)}u||h(v,b),n()},[l,s,u,h,n,d,i]),D.useEffect(()=>{u&&d.setForces()},[p,d,u]),D.useEffect(()=>{u&&(u.on("tick",()=>{if(!o.current&&u.alpha()<.1){const f=u.nodes().map(w=>new rt(w.x,w.y,w.z)),m=new jc().setFromPoints(f),v=new zc;m.getBoundingSphere(v);const b=Math.min(5e3,v.radius);_(b),o.current=!0}if(r.current){const f=r.current.getObjectByName("simulation-3d-group__nodes"),m=r.current.getObjectByName("simulation-3d-group__node-points"),v=r.current.getObjectByName("simulation-3d-group__connections");if(f&&f.children.forEach((b,w)=>{const g=u.nodes()[w];g&&b.position.set(g.x,g.y,g.z)}),m&&m.children[0].children.forEach((b,w)=>{const g=u.nodes()[w];g&&b.position.set(g.x,g.y,g.z)}),u.alpha()>1)return;v&&(c.current.clear(),v.children.forEach((b,w)=>{var k;const g=i==null?void 0:i.links[w],y=b;if(g){const T=u.nodes().find(z=>z.ref_id===g.source),x=u.nodes().find(z=>z.ref_id===g.target),{x:C,y:O,z:P}=T,{x:M,y:V,z:B}=x;c.current.set(g.ref_id,{sx:C,sy:O,sz:P,tx:M,ty:V,tz:B});const Y=((k=a[T.node_type])==null?void 0:k.primary_color)||"white";y.geometry.setPositions([C,O,P,M,V,B]);const{material:G}=y;G.color=new Ua(Y),G.transparent=!0,G.opacity=.3}}))}}),u.on("end",()=>{const f=u.nodes().map(w=>new rt(w.x,w.y,w.z)),m=new jc().setFromPoints(f),v=new zc;m.getBoundingSphere(v);const b=v.radius;_(b),o.current=!1}))},[i,u,_,a]),u?L.jsxs("group",{ref:r,children:[L.jsx(Pd,{}),p==="earth"&&L.jsx(bx,{}),(t||e)&&L.jsx(Vx,{}),p!=="earth"&&L.jsx(bd,{linksPosition:c.current}),L.jsx(Nd,{})]}):null},Hx=({fullSize:i=!0})=>{const t=er(e=>e.sidebarIsOpen);return L.jsx(Gx,{align:"center",className:su({"sidebar-is-open":t&&!i}),justify:"center",children:L.jsx(qf,{color:Tt.SECONDARY_BLUE,size:64})})},Gx=Ut(ys)` +`,bd=D.memo(()=>L.jsx(L.Fragment,{children:L.jsx(wd,{})}));bd.displayName="NodeDetailsPanel";const Ax=()=>{const{dataInitial:i,isLoadingNew:t,isFetching:e,dataNew:s,resetDataNew:n}=Vs(f=>f),r=D.useRef(null),o=D.useRef(!1),{normalizedSchemasByType:a}=Da(f=>f),c=D.useRef(new Map),{setData:l,simulation:u,simulationCreate:h,simulationHelpers:d,graphStyle:p,setGraphRadius:_}=pe(f=>f);return D.useEffect(()=>{if(!s)return;const f=s.nodes||[],m=s.links||[],v=structuredClone(f),b=structuredClone(m);if(u){const w=Id.isEqual(s,i);d.addNodesAndLinks(v,b,w)}u||h(v,b),n()},[l,s,u,h,n,d,i]),D.useEffect(()=>{u&&d.setForces()},[p,d,u]),D.useEffect(()=>{u&&(u.on("tick",()=>{if(!o.current&&u.alpha()<.1){const f=u.nodes().map(w=>new rt(w.x,w.y,w.z)),m=new Fc().setFromPoints(f),v=new Lc;m.getBoundingSphere(v);const b=Math.min(5e3,v.radius);_(b),o.current=!0}if(r.current){const f=r.current.getObjectByName("simulation-3d-group__nodes"),m=r.current.getObjectByName("simulation-3d-group__node-points"),v=r.current.getObjectByName("simulation-3d-group__connections");if(f&&f.children.forEach((b,w)=>{const g=u.nodes()[w];g&&b.position.set(g.x,g.y,g.z)}),m&&m.children[0].children.forEach((b,w)=>{const g=u.nodes()[w];g&&b.position.set(g.x,g.y,g.z)}),u.alpha()>1)return;v&&(c.current.clear(),v.children.forEach((b,w)=>{var k;const g=i==null?void 0:i.links[w],y=b;if(g){const T=u.nodes().find(j=>j.ref_id===g.source),x=u.nodes().find(j=>j.ref_id===g.target),{x:C,y:O,z:I}=T,{x:M,y:V,z:W}=x;c.current.set(g.ref_id,{sx:C,sy:O,sz:I,tx:M,ty:V,tz:W});const G=((k=a[T.node_type])==null?void 0:k.primary_color)||"white";y.geometry.setPositions([C,O,I,M,V,W]);const{material:Y}=y;Y.color=new Na(G),Y.transparent=!0,Y.opacity=.3}}))}}),u.on("end",()=>{const f=u.nodes().map(w=>new rt(w.x,w.y,w.z)),m=new Fc().setFromPoints(f),v=new Lc;m.getBoundingSphere(v);const b=v.radius;_(b),o.current=!1}))},[i,u,_,a]),u?L.jsxs("group",{ref:r,children:[L.jsx(Td,{}),p==="earth"&&L.jsx(lx,{}),(t||e)&&L.jsx(wx,{}),p!=="earth"&&L.jsx(_d,{linksPosition:c.current}),L.jsx(bd,{})]}):null},Mx=({fullSize:i=!0})=>{const t=Ji(e=>e.sidebarIsOpen);return L.jsx(Dx,{align:"center",className:Zl({"sidebar-is-open":t&&!i}),justify:"center",children:L.jsx(Df,{color:Tt.SECONDARY_BLUE,size:64})})},Dx=Ut(gs)` position: absolute; left: 0; right: 0; @@ -675,7 +675,7 @@ ${a}`}const Nc=D.memo(({node:i,hide:t,isHovered:e})=>{var T,x,C,O;const s=D.useR top: 0; background-color: ${Tt.black}; z-index: 1; -`,Yx=()=>L.jsx(sr,{children:L.jsx(Zf,{})}),$x=()=>{const{universeColor:i}=wf("universe",{universeColor:Tt.black}),t=We();return D.useMemo(()=>t!=null&&t.node_type?nu(t.node_type):M1,[t]),L.jsxs(L.Fragment,{children:[L.jsx("color",{args:[i],attach:"background"}),L.jsx(sf,{}),L.jsx(U1,{}),L.jsxs(m0,{children:[!1,L.jsx(Wx,{})]})]})};let aa=null;const Zx={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[bi.x,bi.y,bi.z]},Xx=()=>{const[i,t,e]=[Os(a=>a.setIsUserScrollingOnHtmlPanel),Os(a=>a.setIsUserScrolling),Os(a=>a.setUserMovedCamera)],s=Us(a=>a.isFetching),n=er(a=>a.universeQuestionIsOpen),r=D.useCallback(a=>{var u;const{target:c}=a,{offsetParent:l}=c;aa&&clearTimeout(aa),(u=l==null?void 0:l.classList)!=null&&u.contains("html-panel")&&l.clientHeight{t(!1),i(!1)},200)},[t,i,e]),o=D.useCallback(a=>Wd(a,"threeState"),[]);return L.jsxs(Qx,{children:[L.jsx(D.Suspense,{fallback:null,children:L.jsxs(tf,{camera:Zx,id:"universe-canvas",onCreated:o,onWheel:r,children:[Hd&&L.jsx(ef,{position:"top-right",style:{top:"80px"}}),L.jsxs(D.Suspense,{fallback:L.jsx(Yx,{}),children:[L.jsx(d0,{}),L.jsx(f0,{}),L.jsx(p0,{}),L.jsx($x,{})]})]})}),n&&L.jsx(y0,{}),s&&L.jsx(Hx,{fullSize:!1}),L.jsx(Tf,{})]})},Qx=Ut(ys)` +`,Px=()=>L.jsx(tr,{children:L.jsx(Lf,{})}),Ix=()=>{const{universeColor:i}=hf("universe",{universeColor:Tt.black}),t=ts();return D.useMemo(()=>t!=null&&t.node_type?Xl(t.node_type):y1,[t]),L.jsxs(L.Fragment,{children:[L.jsx("color",{args:[i],attach:"background"}),L.jsx(Yd,{}),L.jsx(E1,{}),L.jsxs(i0,{children:[!1,L.jsx(Ax,{})]})]})};let sa=null;const Nx={aspect:window.innerWidth/window.innerHeight,far:3e4,near:1,position:[Ti.x,Ti.y,Ti.z]},Rx=()=>{const[i,t,e]=[Es(a=>a.setIsUserScrollingOnHtmlPanel),Es(a=>a.setIsUserScrolling),Es(a=>a.setUserMovedCamera)],s=Vs(a=>a.isFetching),n=Ji(a=>a.universeQuestionIsOpen),r=D.useCallback(a=>{var u;const{target:c}=a,{offsetParent:l}=c;sa&&clearTimeout(sa),(u=l==null?void 0:l.classList)!=null&&u.contains("html-panel")&&l.clientHeight{t(!1),i(!1)},200)},[t,i,e]),o=D.useCallback(a=>Nd(a,"threeState"),[]);return L.jsxs(Fx,{children:[L.jsx(D.Suspense,{fallback:null,children:L.jsxs(Wd,{camera:Nx,id:"universe-canvas",onCreated:o,onWheel:r,children:[Rd&&L.jsx(Hd,{position:"top-right",style:{top:"80px"}}),L.jsxs(D.Suspense,{fallback:L.jsx(Px,{}),children:[L.jsx(t0,{}),L.jsx(e0,{}),L.jsx(s0,{}),L.jsx(Ix,{})]})]})}),n&&L.jsx(o0,{}),s&&L.jsx(Mx,{fullSize:!1}),L.jsx(uf,{})]})},Fx=Ut(gs)` flex: 1 1 100%; position: relative; -`,Ik=D.memo(Xx);export{Ik as Universe}; +`,yk=D.memo(Rx);export{yk as Universe}; diff --git a/build/assets/index-b67e6350.js b/build/assets/index-2680e012.js similarity index 96% rename from build/assets/index-b67e6350.js rename to build/assets/index-2680e012.js index 523ff1847..bd5df6c4e 100644 --- a/build/assets/index-b67e6350.js +++ b/build/assets/index-2680e012.js @@ -1,4 +1,4 @@ -import{M as a,X as $,V as B,v as T,D as z,a0 as G,E as D,a5 as E,j as e,H as t,w as c,x as n,F as l}from"./index-16ff4e55.js";import{M as L,A as N,a as O,S as R,C as U,b as W,F as X}from"./index-04a82be1.js";const J=()=>{const{open:r}=a("sourcesTable"),{open:p}=a("addItem"),{open:u}=a("addContent"),{open:x}=a("settings"),{open:h}=a("blueprintGraph"),{open:b}=a("feedback"),g=$(),{resetAiSummaryAnswer:j,setNewLoading:m}=B(),{abortFetchData:k,resetGraph:f}=T(o=>o),{setUniverseQuestionIsOpen:y,setSidebarOpen:w,setShowCollapseButton:S}=z(o=>o),{customSchemaFeatureFlag:C,userFeedbackFeatureFlag:F,chatInterfaceFeatureFlag:v}=G(o=>o),{isAdmin:d}=D(o=>o),I=E(),A=()=>{m(null),k(),j(),f(),g("/")},M=()=>{y(),w(!0),S(!0)};return e.jsxs(Y,{children:[e.jsx(H,{onClick:A,children:e.jsx("img",{alt:"Second brain",src:"logo.svg"})}),v?e.jsxs(i,{onClick:M,children:[e.jsx(s,{children:e.jsx(L,{})}),e.jsx(t,{children:"New Chat"})]}):null,d?e.jsxs(i,{"data-testid":"add-item-modal",onClick:p,children:[e.jsx(s,{children:e.jsx(N,{})}),e.jsx(t,{children:"Add Item"})]}):null,e.jsxs(i,{"data-testid":"add-content-modal",onClick:u,children:[e.jsx(s,{children:e.jsx(O,{})}),e.jsx(t,{children:"Add Content"})]}),e.jsxs(i,{id:"cy-open-soure-table",onClick:r,children:[e.jsx(s,{children:e.jsx(R,{})}),e.jsx(t,{children:"Source Table"})]}),C&&d?e.jsxs(i,{"data-testid":"add-blueprint-modal",id:"cy-open-soure-table",onClick:h,children:[e.jsx(s,{children:e.jsx(U,{})}),e.jsx(t,{children:"Blueprint"})]}):null,e.jsxs(i,{"data-testid":"settings-modal",onClick:x,children:[e.jsx(s,{children:e.jsx(W,{})}),e.jsx(t,{children:"Settings"})]}),F&&I?e.jsxs(Q,{"data-testid":"feedback-modal",onClick:b,children:[e.jsx(s,{children:e.jsx(X,{})}),e.jsx(t,{children:"Send Feedback"})]}):null]})},Y=c(l).attrs({align:"flex-start",direction:"column",justify:"flex-start"})` +import{M as a,X as $,V as B,v as T,D as z,a0 as G,E as D,a5 as E,j as e,H as t,w as c,x as n,F as l}from"./index-4c5f8236.js";import{M as L,A as N,a as O,S as R,C as U,b as W,F as X}from"./index-a4caf8d5.js";const J=()=>{const{open:r}=a("sourcesTable"),{open:p}=a("addItem"),{open:u}=a("addContent"),{open:x}=a("settings"),{open:h}=a("blueprintGraph"),{open:b}=a("feedback"),g=$(),{resetAiSummaryAnswer:j,setNewLoading:m}=B(),{abortFetchData:k,resetGraph:f}=T(o=>o),{setUniverseQuestionIsOpen:y,setSidebarOpen:w,setShowCollapseButton:S}=z(o=>o),{customSchemaFeatureFlag:C,userFeedbackFeatureFlag:F,chatInterfaceFeatureFlag:v}=G(o=>o),{isAdmin:d}=D(o=>o),I=E(),A=()=>{m(null),k(),j(),f(),g("/")},M=()=>{y(),w(!0),S(!0)};return e.jsxs(Y,{children:[e.jsx(H,{onClick:A,children:e.jsx("img",{alt:"Second brain",src:"logo.svg"})}),v?e.jsxs(i,{onClick:M,children:[e.jsx(s,{children:e.jsx(L,{})}),e.jsx(t,{children:"New Chat"})]}):null,d?e.jsxs(i,{"data-testid":"add-item-modal",onClick:p,children:[e.jsx(s,{children:e.jsx(N,{})}),e.jsx(t,{children:"Add Item"})]}):null,e.jsxs(i,{"data-testid":"add-content-modal",onClick:u,children:[e.jsx(s,{children:e.jsx(O,{})}),e.jsx(t,{children:"Add Content"})]}),e.jsxs(i,{id:"cy-open-soure-table",onClick:r,children:[e.jsx(s,{children:e.jsx(R,{})}),e.jsx(t,{children:"Source Table"})]}),C&&d?e.jsxs(i,{"data-testid":"add-blueprint-modal",id:"cy-open-soure-table",onClick:h,children:[e.jsx(s,{children:e.jsx(U,{})}),e.jsx(t,{children:"Blueprint"})]}):null,e.jsxs(i,{"data-testid":"settings-modal",onClick:x,children:[e.jsx(s,{children:e.jsx(W,{})}),e.jsx(t,{children:"Settings"})]}),F&&I?e.jsxs(Q,{"data-testid":"feedback-modal",onClick:b,children:[e.jsx(s,{children:e.jsx(X,{})}),e.jsx(t,{children:"Send Feedback"})]}):null]})},Y=c(l).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-783bc78c.js b/build/assets/index-3aed121f.js similarity index 83% rename from build/assets/index-783bc78c.js rename to build/assets/index-3aed121f.js index 55e3fba00..63fb122cb 100644 --- a/build/assets/index-783bc78c.js +++ b/build/assets/index-3aed121f.js @@ -1,4 +1,4 @@ -import{r as p,Q as I,j as e,F as x,C as T,bc as _,bo as L,w as n,H as C,M as A,a1 as E,aX as F,a3 as M,x as B,br as N,z as k}from"./index-16ff4e55.js";import{aG as z,aH as O,aI as D,u as H}from"./index-04a82be1.js";import{u as w}from"./index-1dfdd521.js";import{S as P,A as X,I as Y}from"./constants-d7d823df.js";import{A as R,T as W}from"./index-f0acd212.js";import{C as G}from"./ClipLoader-049391dc.js";import"./Stack-25a86e54.js";import"./createSvgIcon-e167cb2e.js";import"./TextareaAutosize-e1814669.js";const Q=({topicId:s,onSelect:a,selectedValue:d,dataId:c})=>{const[u,h]=p.useState([]),[m,f]=p.useState(!1),j=p.useMemo(()=>{const o=async i=>{const g={is_muted:"False",sort_by:X,search:i,skip:"0",limit:"1000"};f(!0);try{const v=(await L(g.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==s);h(v)}catch{h([])}finally{f(!1)}};return I.debounce(o,300)},[s]),r=o=>{const i=o.trim();if(!i){h([]);return}i.length>2&&j(o)},b=o=>{const i=o?u.find(g=>g.ref_id===o.value):null;a(i||null)},t=o=>({label:o.search_value,value:o.ref_id,type:o.node_type}),S=o=>o.map(t);return d?e.jsxs(x,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:d.search_value}),e.jsx(P,{onClick:()=>a(null),size:"medium",children:e.jsx(T,{})})]}):e.jsx(R,{dataId:c,handleInputChange:r,isLoading:m,onSelect:b,options:S(u)||_,selectedValue:d?t(d):null})},U=({from:s,onSelect:a,selectedToNode:d,isSwapped:c,setIsSwapped:u})=>e.jsxs(x,{mb:20,children:[e.jsx(x,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(x,{align:"center",direction:"row",children:e.jsx($,{children:"Merge topic"})})}),e.jsxs(K,{swap:c,children:[e.jsx(q,{children:e.jsx(V,{disabled:!0,label:c?"To":"From",swap:c,value:s==null?void 0:s.name})}),e.jsxs(x,{my:16,children:[e.jsx(ee,{children:"Type"}),e.jsx(C,{children:"IS ALIAS"})]}),e.jsx(x,{"data-testid":"to-section-container",children:e.jsxs(Z,{children:[e.jsx(te,{children:c?"From":"To"}),e.jsx(Q,{dataId:"to-node",onSelect:a,selectedValue:d,topicId:s==null?void 0:s.ref_id})]})}),e.jsxs(J,{children:[e.jsx(oe,{children:e.jsx(z,{})}),e.jsx(se,{"data-testid":"swap-icon",onClick:u,children:e.jsx(O,{})}),e.jsx(ne,{children:e.jsx(D,{})})]})]})]}),$=n(C)` +import{r as p,Q as T,j as e,F as x,C as I,bc as _,bo as L,w as n,H as C,M as A,a1 as E,aX as F,a3 as M,x as B,br as N,z as k}from"./index-4c5f8236.js";import{aE as z,aF as O,aG as D,u as P}from"./index-a4caf8d5.js";import{u as w}from"./index-6d84bf5a.js";import{S as X,A as Y,I as H}from"./constants-ccce11dd.js";import{A as R,T as W}from"./index-891a66a8.js";import{C as G}from"./ClipLoader-601f6378.js";import"./Stack-7f131eb3.js";import"./createSvgIcon-2fe026f6.js";import"./TextareaAutosize-cc9b3a66.js";const Q=({topicId:s,onSelect:a,selectedValue:d,dataId:c})=>{const[u,h]=p.useState([]),[m,f]=p.useState(!1),j=p.useMemo(()=>{const o=async i=>{const g={is_muted:"False",sort_by:Y,search:i,skip:"0",limit:"1000"};f(!0);try{const v=(await L(g.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==s);h(v)}catch{h([])}finally{f(!1)}};return T.debounce(o,300)},[s]),r=o=>{const i=o.trim();if(!i){h([]);return}i.length>2&&j(o)},b=o=>{const i=o?u.find(g=>g.ref_id===o.value):null;a(i||null)},t=o=>({label:o.search_value,value:o.ref_id,type:o.node_type}),S=o=>o.map(t);return d?e.jsxs(x,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:d.search_value}),e.jsx(X,{onClick:()=>a(null),size:"medium",children:e.jsx(I,{})})]}):e.jsx(R,{dataId:c,handleInputChange:r,isLoading:m,onSelect:b,options:S(u)||_,selectedValue:d?t(d):null})},U=({from:s,onSelect:a,selectedToNode:d,isSwapped:c,setIsSwapped:u})=>e.jsxs(x,{mb:20,children:[e.jsx(x,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(x,{align:"center",direction:"row",children:e.jsx($,{children:"Merge topic"})})}),e.jsxs(K,{swap:c,children:[e.jsx(q,{children:e.jsx(V,{disabled:!0,label:c?"To":"From",swap:c,value:s==null?void 0:s.name})}),e.jsxs(x,{my:16,children:[e.jsx(ee,{children:"Type"}),e.jsx(C,{children:"IS ALIAS"})]}),e.jsx(x,{"data-testid":"to-section-container",children:e.jsxs(Z,{children:[e.jsx(te,{children:c?"From":"To"}),e.jsx(Q,{dataId:"to-node",onSelect:a,selectedValue:d,topicId:s==null?void 0:s.ref_id})]})}),e.jsxs(J,{children:[e.jsx(oe,{children:e.jsx(z,{})}),e.jsx(se,{"data-testid":"swap-icon",onClick:u,children:e.jsx(O,{})}),e.jsx(ne,{children:e.jsx(D,{})})]})]})]}),$=n(C)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -87,7 +87,7 @@ import{r as p,Q as I,j as e,F as x,C as T,bc as _,bo as L,w as n,H as C,M as A,a transform: translateY(10px) translateX(3px); color: #6b7a8d; line-height: 1; -`,ge=()=>{const{close:s}=A("mergeToNode"),[a,d,c]=w(l=>[l.data,l.ids,l.total]),u=E({mode:"onChange"}),[h,m]=p.useState(!1),[f,j]=p.useState(!1),[r,b]=p.useState(null),[t,S]=p.useState(),o=H();p.useEffect(()=>{o&&S(o)},[o]);const i=()=>{b(null),s()},g=async()=>{if(!(!r||!a)){m(!0);try{await N({from:t==null?void 0:t.ref_id,to:r==null?void 0:r.ref_id}),t!=null&&t.ref_id&&(a[t==null?void 0:t.ref_id]={...a[t==null?void 0:t.ref_id],edgeList:[Y],edgeCount:a[t==null?void 0:t.ref_id].edgeCount-1},w.setState({ids:d.filter(l=>l!==r.ref_id),total:c-1})),i()}catch(l){console.warn(l)}finally{m(!1)}}};return e.jsx(F,{id:"mergeToNode",kind:"small",onClose:i,preventOutsideClose:!0,children:e.jsxs(M,{...u,children:[e.jsx(U,{from:t,isSwapped:f,onSelect:b,selectedToNode:r,setIsSwapped:()=>j(!f)}),e.jsxs(ae,{color:"secondary","data-testid":"merge-topics-button",disabled:h||!r,onClick:g,size:"large",variant:"contained",children:["Merge topics",h&&e.jsx(re,{children:e.jsx(G,{color:B.BLUE_PRESS_STATE,size:12})})]})]})})},ae=n(k)` +`,ge=()=>{const{close:s}=A("mergeToNode"),[a,d,c]=w(l=>[l.data,l.ids,l.total]),u=E({mode:"onChange"}),[h,m]=p.useState(!1),[f,j]=p.useState(!1),[r,b]=p.useState(null),[t,S]=p.useState(),o=P();p.useEffect(()=>{o&&S(o)},[o]);const i=()=>{b(null),s()},g=async()=>{if(!(!r||!a)){m(!0);try{await N({from:t==null?void 0:t.ref_id,to:r==null?void 0:r.ref_id}),t!=null&&t.ref_id&&(a[t==null?void 0:t.ref_id]={...a[t==null?void 0:t.ref_id],edgeList:[H],edgeCount:a[t==null?void 0:t.ref_id].edgeCount-1},w.setState({ids:d.filter(l=>l!==r.ref_id),total:c-1})),i()}catch(l){console.warn(l)}finally{m(!1)}}};return e.jsx(F,{id:"mergeToNode",kind:"small",onClose:i,preventOutsideClose:!0,children:e.jsxs(M,{...u,children:[e.jsx(U,{from:t,isSwapped:f,onSelect:b,selectedToNode:r,setIsSwapped:()=>j(!f)}),e.jsxs(ae,{color:"secondary","data-testid":"merge-topics-button",disabled:h||!r,onClick:g,size:"large",variant:"contained",children:["Merge topics",h&&e.jsx(re,{children:e.jsx(G,{color:B.BLUE_PRESS_STATE,size:12})})]})]})})},ae=n(k)` width: 293px !important; margin: 0 0 10px auto !important; `,re=n.span` diff --git a/build/assets/index-0b924162.js b/build/assets/index-494b0bf5.js similarity index 91% rename from build/assets/index-0b924162.js rename to build/assets/index-494b0bf5.js index 9c9641e26..9a603b14c 100644 --- a/build/assets/index-0b924162.js +++ b/build/assets/index-494b0bf5.js @@ -1,5 +1,5 @@ -import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k as D,ah as gt,f as ne,ai as ft,w as c,x,H as N,z as W,F as g,M as E,be as mt,ak as se,b as re,v as le,bf as bt,bg as jt,ad as yt,bh as wt,bi as Ve,y as ae,bj as Xe,Q as we,aY as _e,aZ as Ne,a_ as ze,bk as Ct,bl as vt,aa as Tt,bm as $t,E as qe,C as te,bn as St,bc as Qe,bo as Ke,a1 as Ce,aX as ce,a3 as ve,bp as kt,aU as _t,aV as Nt,bq as de,br as zt,D as Lt,a0 as It,a5 as Rt}from"./index-16ff4e55.js";import{aD as Bt,s as Et,v as Te,aE as je,an as X,aF as Mt,D as At,t as Ft,X as Ze,aG as Je,aH as et,aI as tt,ab as st,aJ as Ot,aK as Wt,aL as Ht,aM as Le,aN as Ie,o as Re,aO as ge,aP as Pt,p as Dt}from"./index-04a82be1.js";import{T as Be,s as U,a as ot,S as nt,A as $e,E as Ut,D as Gt,b as rt,Q as at,V as it,c as Yt}from"./constants-d7d823df.js";import{C as z}from"./ClipLoader-049391dc.js";import{I as Vt,A as Se,T as lt}from"./index-f0acd212.js";import{u as R}from"./index-1dfdd521.js";import{T as Ee}from"./Typography-76a3ec92.js";import{T as Xt,a as qt}from"./Tabs-0da0e37b.js";import"./Stack-25a86e54.js";import"./createSvgIcon-e167cb2e.js";import"./TextareaAutosize-e1814669.js";const Qt=h.createContext(),ct=Qt;function Kt(t){return q("MuiTable",t)}Q("MuiTable",["root","stickyHeader"]);const Zt=["className","component","padding","size","stickyHeader"],Jt=t=>{const{classes:s,stickyHeader:n}=t;return ee({root:["root",n&&"stickyHeader"]},Kt,s)},es=F("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.stickyHeader&&s.stickyHeader]}})(({theme:t,ownerState:s})=>I({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":I({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},s.stickyHeader&&{borderCollapse:"separate"})),Me="table",ts=h.forwardRef(function(s,n){const r=K({props:s,name:"MuiTable"}),{className:l,component:i=Me,padding:a="normal",size:o="medium",stickyHeader:d=!1}=r,u=Z(r,Zt),m=I({},r,{component:i,padding:a,size:o,stickyHeader:d}),p=Jt(m),b=h.useMemo(()=>({padding:a,size:o,stickyHeader:d}),[a,o,d]);return e.jsx(ct.Provider,{value:b,children:e.jsx(es,I({as:i,role:i===Me?null:"table",ref:n,className:J(p.root,l),ownerState:m},u))})}),pe=ts,ss=h.createContext(),xe=ss;function os(t){return q("MuiTableBody",t)}Q("MuiTableBody",["root"]);const ns=["className","component"],rs=t=>{const{classes:s}=t;return ee({root:["root"]},os,s)},as=F("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,s)=>s.root})({display:"table-row-group"}),is={variant:"body"},Ae="tbody",ls=h.forwardRef(function(s,n){const r=K({props:s,name:"MuiTableBody"}),{className:l,component:i=Ae}=r,a=Z(r,ns),o=I({},r,{component:i}),d=rs(o);return e.jsx(xe.Provider,{value:is,children:e.jsx(as,I({className:J(d.root,l),as:i,ref:n,role:i===Ae?null:"rowgroup",ownerState:o},a))})}),cs=ls;function ds(t){return q("MuiTableCell",t)}const ps=Q("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),xs=ps,hs=["align","className","component","padding","scope","size","sortDirection","variant"],us=t=>{const{classes:s,variant:n,align:r,padding:l,size:i,stickyHeader:a}=t,o={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${D(r)}`,l!=="normal"&&`padding${D(l)}`,`size${D(i)}`]};return ee(o,ds,s)},gs=F("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,s[n.variant],s[`size${D(n.size)}`],n.padding!=="normal"&&s[`padding${D(n.padding)}`],n.align!=="inherit"&&s[`align${D(n.align)}`],n.stickyHeader&&s.stickyHeader]}})(({theme:t,ownerState:s})=>I({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid - ${t.palette.mode==="light"?gt(ne(t.palette.divider,1),.88):ft(ne(t.palette.divider,1),.68)}`,textAlign:"left",padding:16},s.variant==="head"&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},s.variant==="body"&&{color:(t.vars||t).palette.text.primary},s.variant==="footer"&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},s.size==="small"&&{padding:"6px 16px",[`&.${xs.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},s.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},s.padding==="none"&&{padding:0},s.align==="left"&&{textAlign:"left"},s.align==="center"&&{textAlign:"center"},s.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},s.align==="justify"&&{textAlign:"justify"},s.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})),fs=h.forwardRef(function(s,n){const r=K({props:s,name:"MuiTableCell"}),{align:l="inherit",className:i,component:a,padding:o,scope:d,size:u,sortDirection:m,variant:p}=r,b=Z(r,hs),j=h.useContext(ct),y=h.useContext(xe),C=y&&y.variant==="head";let w;a?w=a:w=C?"th":"td";let $=d;w==="td"?$=void 0:!$&&C&&($="col");const S=p||y&&y.variant,A=I({},r,{align:l,component:w,padding:o||(j&&j.padding?j.padding:"normal"),size:u||(j&&j.size?j.size:"medium"),sortDirection:m,stickyHeader:S==="head"&&j&&j.stickyHeader,variant:S}),O=us(A);let L=null;return m&&(L=m==="asc"?"ascending":"descending"),e.jsx(gs,I({as:w,ref:n,className:J(O.root,i),"aria-sort":L,scope:$,ownerState:A},b))}),ms=fs;function bs(t){return q("MuiTableHead",t)}Q("MuiTableHead",["root"]);const js=["className","component"],ys=t=>{const{classes:s}=t;return ee({root:["root"]},bs,s)},ws=F("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,s)=>s.root})({display:"table-header-group"}),Cs={variant:"head"},Fe="thead",vs=h.forwardRef(function(s,n){const r=K({props:s,name:"MuiTableHead"}),{className:l,component:i=Fe}=r,a=Z(r,js),o=I({},r,{component:i}),d=ys(o);return e.jsx(xe.Provider,{value:Cs,children:e.jsx(ws,I({as:i,className:J(d.root,l),ref:n,role:i===Fe?null:"rowgroup",ownerState:o},a))})}),dt=vs;function Ts(t){return q("MuiTableRow",t)}const $s=Q("MuiTableRow",["root","selected","hover","head","footer"]),Oe=$s,Ss=["className","component","hover","selected"],ks=t=>{const{classes:s,selected:n,hover:r,head:l,footer:i}=t;return ee({root:["root",n&&"selected",r&&"hover",l&&"head",i&&"footer"]},Ts,s)},_s=F("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.head&&s.head,n.footer&&s.footer]}})(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Oe.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Oe.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:ne(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:ne(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),We="tr",Ns=h.forwardRef(function(s,n){const r=K({props:s,name:"MuiTableRow"}),{className:l,component:i=We,hover:a=!1,selected:o=!1}=r,d=Z(r,Ss),u=h.useContext(xe),m=I({},r,{component:i,hover:a,selected:o,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),p=ks(m);return e.jsx(_s,I({as:i,ref:n,className:J(p.root,l),role:i===We?null:"row",ownerState:m},d))}),G=Ns;function ye(t){const s=new Date(Number(t)*1e3),n=s.getFullYear(),r=(1+s.getMonth()).toString().padStart(2,"0");return`${s.getDate().toString().padStart(2,"0")}/${r}/${n}`}const f=c(ms)` +import{r as h,c as Q,d as X,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k as P,ah as gt,f as ne,ai as ft,w as c,x,H as N,z as W,F as g,M as E,be as mt,ak as se,b as re,v as le,bf as bt,bg as jt,ad as yt,bh as wt,bi as Ve,y as ae,bj as qe,Q as we,aY as _e,aZ as Ne,a_ as ze,bk as Ct,bl as vt,aa as Tt,bm as $t,E as Qe,C as te,bn as St,bc as Xe,bo as Ke,a1 as Ce,aX as ce,a3 as ve,bp as kt,aU as _t,aV as Nt,bq as de,br as zt,D as Lt,a0 as It,a5 as Rt}from"./index-4c5f8236.js";import{aB as Bt,q as Et,s as Te,aC as je,al as q,aD as Mt,D as At,r as Ft,V as Ze,aE as Je,aF as et,aG as tt,a9 as st,aH as Ot,aI as Wt,aJ as Ht,aK as Le,aL as Ie,m as Re,aM as ge,aN as Dt,n as Pt}from"./index-a4caf8d5.js";import{T as Be,s as U,a as ot,S as nt,A as $e,E as Ut,D as Gt,b as rt,Q as at,V as it,c as Yt}from"./constants-ccce11dd.js";import{C as z}from"./ClipLoader-601f6378.js";import{I as Vt,A as Se,T as lt}from"./index-891a66a8.js";import{u as R}from"./index-6d84bf5a.js";import{T as Ee}from"./Typography-50924238.js";import{T as qt,a as Qt}from"./Tabs-02e36f7f.js";import"./Stack-7f131eb3.js";import"./createSvgIcon-2fe026f6.js";import"./TextareaAutosize-cc9b3a66.js";const Xt=h.createContext(),ct=Xt;function Kt(t){return Q("MuiTable",t)}X("MuiTable",["root","stickyHeader"]);const Zt=["className","component","padding","size","stickyHeader"],Jt=t=>{const{classes:s,stickyHeader:n}=t;return ee({root:["root",n&&"stickyHeader"]},Kt,s)},es=F("table",{name:"MuiTable",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.stickyHeader&&s.stickyHeader]}})(({theme:t,ownerState:s})=>I({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":I({},t.typography.body2,{padding:t.spacing(2),color:(t.vars||t).palette.text.secondary,textAlign:"left",captionSide:"bottom"})},s.stickyHeader&&{borderCollapse:"separate"})),Me="table",ts=h.forwardRef(function(s,n){const r=K({props:s,name:"MuiTable"}),{className:l,component:i=Me,padding:a="normal",size:o="medium",stickyHeader:d=!1}=r,u=Z(r,Zt),m=I({},r,{component:i,padding:a,size:o,stickyHeader:d}),p=Jt(m),b=h.useMemo(()=>({padding:a,size:o,stickyHeader:d}),[a,o,d]);return e.jsx(ct.Provider,{value:b,children:e.jsx(es,I({as:i,role:i===Me?null:"table",ref:n,className:J(p.root,l),ownerState:m},u))})}),pe=ts,ss=h.createContext(),xe=ss;function os(t){return Q("MuiTableBody",t)}X("MuiTableBody",["root"]);const ns=["className","component"],rs=t=>{const{classes:s}=t;return ee({root:["root"]},os,s)},as=F("tbody",{name:"MuiTableBody",slot:"Root",overridesResolver:(t,s)=>s.root})({display:"table-row-group"}),is={variant:"body"},Ae="tbody",ls=h.forwardRef(function(s,n){const r=K({props:s,name:"MuiTableBody"}),{className:l,component:i=Ae}=r,a=Z(r,ns),o=I({},r,{component:i}),d=rs(o);return e.jsx(xe.Provider,{value:is,children:e.jsx(as,I({className:J(d.root,l),as:i,ref:n,role:i===Ae?null:"rowgroup",ownerState:o},a))})}),cs=ls;function ds(t){return Q("MuiTableCell",t)}const ps=X("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),xs=ps,hs=["align","className","component","padding","scope","size","sortDirection","variant"],us=t=>{const{classes:s,variant:n,align:r,padding:l,size:i,stickyHeader:a}=t,o={root:["root",n,a&&"stickyHeader",r!=="inherit"&&`align${P(r)}`,l!=="normal"&&`padding${P(l)}`,`size${P(i)}`]};return ee(o,ds,s)},gs=F("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,s[n.variant],s[`size${P(n.size)}`],n.padding!=="normal"&&s[`padding${P(n.padding)}`],n.align!=="inherit"&&s[`align${P(n.align)}`],n.stickyHeader&&s.stickyHeader]}})(({theme:t,ownerState:s})=>I({},t.typography.body2,{display:"table-cell",verticalAlign:"inherit",borderBottom:t.vars?`1px solid ${t.vars.palette.TableCell.border}`:`1px solid + ${t.palette.mode==="light"?gt(ne(t.palette.divider,1),.88):ft(ne(t.palette.divider,1),.68)}`,textAlign:"left",padding:16},s.variant==="head"&&{color:(t.vars||t).palette.text.primary,lineHeight:t.typography.pxToRem(24),fontWeight:t.typography.fontWeightMedium},s.variant==="body"&&{color:(t.vars||t).palette.text.primary},s.variant==="footer"&&{color:(t.vars||t).palette.text.secondary,lineHeight:t.typography.pxToRem(21),fontSize:t.typography.pxToRem(12)},s.size==="small"&&{padding:"6px 16px",[`&.${xs.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}},s.padding==="checkbox"&&{width:48,padding:"0 0 0 4px"},s.padding==="none"&&{padding:0},s.align==="left"&&{textAlign:"left"},s.align==="center"&&{textAlign:"center"},s.align==="right"&&{textAlign:"right",flexDirection:"row-reverse"},s.align==="justify"&&{textAlign:"justify"},s.stickyHeader&&{position:"sticky",top:0,zIndex:2,backgroundColor:(t.vars||t).palette.background.default})),fs=h.forwardRef(function(s,n){const r=K({props:s,name:"MuiTableCell"}),{align:l="inherit",className:i,component:a,padding:o,scope:d,size:u,sortDirection:m,variant:p}=r,b=Z(r,hs),j=h.useContext(ct),y=h.useContext(xe),C=y&&y.variant==="head";let w;a?w=a:w=C?"th":"td";let $=d;w==="td"?$=void 0:!$&&C&&($="col");const S=p||y&&y.variant,A=I({},r,{align:l,component:w,padding:o||(j&&j.padding?j.padding:"normal"),size:u||(j&&j.size?j.size:"medium"),sortDirection:m,stickyHeader:S==="head"&&j&&j.stickyHeader,variant:S}),O=us(A);let L=null;return m&&(L=m==="asc"?"ascending":"descending"),e.jsx(gs,I({as:w,ref:n,className:J(O.root,i),"aria-sort":L,scope:$,ownerState:A},b))}),ms=fs;function bs(t){return Q("MuiTableHead",t)}X("MuiTableHead",["root"]);const js=["className","component"],ys=t=>{const{classes:s}=t;return ee({root:["root"]},bs,s)},ws=F("thead",{name:"MuiTableHead",slot:"Root",overridesResolver:(t,s)=>s.root})({display:"table-header-group"}),Cs={variant:"head"},Fe="thead",vs=h.forwardRef(function(s,n){const r=K({props:s,name:"MuiTableHead"}),{className:l,component:i=Fe}=r,a=Z(r,js),o=I({},r,{component:i}),d=ys(o);return e.jsx(xe.Provider,{value:Cs,children:e.jsx(ws,I({as:i,className:J(d.root,l),ref:n,role:i===Fe?null:"rowgroup",ownerState:o},a))})}),dt=vs;function Ts(t){return Q("MuiTableRow",t)}const $s=X("MuiTableRow",["root","selected","hover","head","footer"]),Oe=$s,Ss=["className","component","hover","selected"],ks=t=>{const{classes:s,selected:n,hover:r,head:l,footer:i}=t;return ee({root:["root",n&&"selected",r&&"hover",l&&"head",i&&"footer"]},Ts,s)},_s=F("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(t,s)=>{const{ownerState:n}=t;return[s.root,n.head&&s.head,n.footer&&s.footer]}})(({theme:t})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Oe.hover}:hover`]:{backgroundColor:(t.vars||t).palette.action.hover},[`&.${Oe.selected}`]:{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / ${t.vars.palette.action.selectedOpacity})`:ne(t.palette.primary.main,t.palette.action.selectedOpacity),"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.primary.mainChannel} / calc(${t.vars.palette.action.selectedOpacity} + ${t.vars.palette.action.hoverOpacity}))`:ne(t.palette.primary.main,t.palette.action.selectedOpacity+t.palette.action.hoverOpacity)}}})),We="tr",Ns=h.forwardRef(function(s,n){const r=K({props:s,name:"MuiTableRow"}),{className:l,component:i=We,hover:a=!1,selected:o=!1}=r,d=Z(r,Ss),u=h.useContext(xe),m=I({},r,{component:i,hover:a,selected:o,head:u&&u.variant==="head",footer:u&&u.variant==="footer"}),p=ks(m);return e.jsx(_s,I({as:i,ref:n,className:J(p.root,l),role:i===We?null:"row",ownerState:m},d))}),G=Ns;function ye(t){const s=new Date(Number(t)*1e3),n=s.getFullYear(),r=(1+s.getMonth()).toString().padStart(2,"0");return`${s.getDate().toString().padStart(2,"0")}/${r}/${n}`}const f=c(ms)` && { color: ${x.white}; border: none; @@ -176,7 +176,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k color: ${x.GRAY3}; font-family: Barlow; font-size: 14px; -`,Ps=({kind:t,shape:s})=>{switch(t){case"small":return se` +`,Ds=({kind:t,shape:s})=>{switch(t){case"small":return se` padding: 4px 8px; border-radius: ${s==="rounded"?"16px":"8px"}; height: 32px; @@ -188,12 +188,12 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k padding: 8px 16px; border-radius: ${s==="rounded"?"32px":"8px"}; height: 64px; - `}},Ds=({kind:t})=>{switch(t){case"small":return"regularBold";case"big":return"mediumBold";default:return"regularBold"}},Us=c(g).attrs({align:"center",direction:"row",justify:"center"})` + `}},Ps=({kind:t})=>{switch(t){case"small":return"regularBold";case"big":return"mediumBold";default:return"regularBold"}},Us=c(g).attrs({align:"center",direction:"row",justify:"center"})` border: none; cursor: pointer; pointer-events: auto; - ${Ps} + ${Ds} &:hover { opacity: ${({disabled:t})=>t?.5:.9}; @@ -203,7 +203,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k opacity: 0.5; pointer-events: none; `} -`,Pe=({background:t="primaryButton",children:s,className:n="button",startIcon:r,endIcon:l,disabled:i,id:a,kind:o="regular",onClick:d,onPointerDown:u,shape:m="squared",textColor:p="white",type:b})=>e.jsxs(Us,{as:"button",background:t,className:n,disabled:i,id:a,kind:o,onClick:d,onPointerDown:u,shape:m,type:b,children:[r&&r,e.jsx(N,{color:p,kind:Ds({kind:o}),children:s}),l&&l]}),pt=({message:t="Are you sure you want to delete this item?",onConfirm:s,children:n,anchorOrigin:r={vertical:"bottom",horizontal:"left"},transformOrigin:l={vertical:"top",horizontal:"center"}})=>{const[i,a]=h.useState(null),o=b=>{a(b.currentTarget)},d=()=>{a(null)},u=()=>{s(),d()},m=()=>{d()},p=!!i;return e.jsxs(e.Fragment,{children:[e.jsx("div",{children:re.cloneElement(n,{onClick:o})}),e.jsx(Ys,{anchorEl:i,anchorOrigin:r,onClose:d,open:p,transformOrigin:l,children:e.jsxs(Gs,{children:[e.jsx(N,{className:"message",children:t}),e.jsxs(Vs,{children:[e.jsx(Pe,{background:"primaryBlue",kind:"small",onClick:u,children:"Yes"}),e.jsx(Pe,{background:"white",kind:"small",onClick:m,textColor:"black",children:"No"})]})]})})]})},Gs=c(g)` +`,De=({background:t="primaryButton",children:s,className:n="button",startIcon:r,endIcon:l,disabled:i,id:a,kind:o="regular",onClick:d,onPointerDown:u,shape:m="squared",textColor:p="white",type:b})=>e.jsxs(Us,{as:"button",background:t,className:n,disabled:i,id:a,kind:o,onClick:d,onPointerDown:u,shape:m,type:b,children:[r&&r,e.jsx(N,{color:p,kind:Ps({kind:o}),children:s}),l&&l]}),pt=({message:t="Are you sure you want to delete this item?",onConfirm:s,children:n,anchorOrigin:r={vertical:"bottom",horizontal:"left"},transformOrigin:l={vertical:"top",horizontal:"center"}})=>{const[i,a]=h.useState(null),o=b=>{a(b.currentTarget)},d=()=>{a(null)},u=()=>{s(),d()},m=()=>{d()},p=!!i;return e.jsxs(e.Fragment,{children:[e.jsx("div",{children:re.cloneElement(n,{onClick:o})}),e.jsx(Ys,{anchorEl:i,anchorOrigin:r,onClose:d,open:p,transformOrigin:l,children:e.jsxs(Gs,{children:[e.jsx(N,{className:"message",children:t}),e.jsxs(Vs,{children:[e.jsx(De,{background:"primaryBlue",kind:"small",onClick:u,children:"Yes"}),e.jsx(De,{background:"white",kind:"small",onClick:m,textColor:"black",children:"No"})]})]})})]})},Gs=c(g)` align-items: center; background: ${x.BUTTON1}; color: ${x.white}; @@ -228,7 +228,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k gap: 12px; align-items: center; margin-top: 16px; -`,Xs=({data:t})=>{const s=le(a=>a.setQueuedSources),[n,r]=h.useState(""),l=async a=>{if(t!=null&&t.length)try{const o=await yt.enable();await wt(a,o.pubkey),s(t.filter(d=>d.ref_id!==a))}catch(o){console.warn(o)}},i=async a=>{if(!(!a||!(t!=null&&t.length))){r(a);try{await Ve(a),s(t==null?void 0:t.filter(o=>o.ref_id!==a))}catch(o){console.warn(o)}finally{r("")}}};return t!=null&&t.length?e.jsxs(pe,{component:"table",children:[e.jsx(ue,{children:e.jsxs(G,{component:"tr",children:[e.jsx(f,{className:"empty"}),e.jsx(f,{children:"Type"}),e.jsx(f,{children:"Source"}),e.jsx(f,{}),e.jsx(f,{className:"empty"})]})}),(t==null?void 0:t.length)&&e.jsx("tbody",{children:t==null?void 0:t.map(a=>e.jsxs(he,{children:[e.jsx(f,{className:"empty"}),e.jsx(f,{children:U[a.source_type]}),e.jsx(f,{width:"268px",children:a.source_type==="twitter_handle"?e.jsxs(Ue,{href:`${ot}/${a.source}?open=system`,target:"_blank",children:["@",a.source]}):e.jsx(Ue,{href:`${a.source}?open=system`,target:"_blank",children:a.source})}),e.jsx(f,{className:"cell-center",children:e.jsxs(g,{direction:"row",justify:"flex-end",children:[e.jsx(qs,{className:"approve-wrapper",children:e.jsx(De,{className:"centered",onClick:()=>l(a.ref_id),children:e.jsx(bt,{color:x.primaryGreen,fontSize:24})})}),e.jsx("div",{className:"delete-wrapper",children:n===a.ref_id?e.jsx(z,{color:x.white,size:16}):e.jsx(pt,{message:"Are you sure ?",onConfirm:()=>i(a.ref_id),children:e.jsx(De,{className:"centered",children:e.jsx(jt,{color:x.primaryRed,fontSize:24})})})})]})}),e.jsx(f,{className:"empty"})]},a.source))})]}):e.jsxs(g,{children:[e.jsx(N,{children:"There is not any results for selected filters"}),e.jsx(je,{})]})},De=c(g)` +`,qs=({data:t})=>{const s=le(a=>a.setQueuedSources),[n,r]=h.useState(""),l=async a=>{if(t!=null&&t.length)try{const o=await yt.enable();await wt(a,o.pubkey),s(t.filter(d=>d.ref_id!==a))}catch(o){console.warn(o)}},i=async a=>{if(!(!a||!(t!=null&&t.length))){r(a);try{await Ve(a),s(t==null?void 0:t.filter(o=>o.ref_id!==a))}catch(o){console.warn(o)}finally{r("")}}};return t!=null&&t.length?e.jsxs(pe,{component:"table",children:[e.jsx(ue,{children:e.jsxs(G,{component:"tr",children:[e.jsx(f,{className:"empty"}),e.jsx(f,{children:"Type"}),e.jsx(f,{children:"Source"}),e.jsx(f,{}),e.jsx(f,{className:"empty"})]})}),(t==null?void 0:t.length)&&e.jsx("tbody",{children:t==null?void 0:t.map(a=>e.jsxs(he,{children:[e.jsx(f,{className:"empty"}),e.jsx(f,{children:U[a.source_type]}),e.jsx(f,{width:"268px",children:a.source_type==="twitter_handle"?e.jsxs(Ue,{href:`${ot}/${a.source}?open=system`,target:"_blank",children:["@",a.source]}):e.jsx(Ue,{href:`${a.source}?open=system`,target:"_blank",children:a.source})}),e.jsx(f,{className:"cell-center",children:e.jsxs(g,{direction:"row",justify:"flex-end",children:[e.jsx(Qs,{className:"approve-wrapper",children:e.jsx(Pe,{className:"centered",onClick:()=>l(a.ref_id),children:e.jsx(bt,{color:x.primaryGreen,fontSize:24})})}),e.jsx("div",{className:"delete-wrapper",children:n===a.ref_id?e.jsx(z,{color:x.white,size:16}):e.jsx(pt,{message:"Are you sure ?",onConfirm:()=>i(a.ref_id),children:e.jsx(Pe,{className:"centered",children:e.jsx(jt,{color:x.primaryRed,fontSize:24})})})})]})}),e.jsx(f,{className:"empty"})]},a.source))})]}):e.jsxs(g,{children:[e.jsx(N,{children:"There is not any results for selected filters"}),e.jsx(je,{})]})},Pe=c(g)` width: 20px; height: 20px; border-radius: 50%; @@ -251,9 +251,9 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k &:hover { cursor: pointer; } -`,qs=c.div` +`,Qs=c.div` margin-right: 40px; -`,Qs=()=>{const[t,s]=h.useState(!0),[n,r]=h.useState(""),[l,i]=le(d=>[d.queuedSources,d.setQueuedSources]);h.useEffect(()=>{(async()=>{s(!0);try{const u=await Xe({approved:"False"});i(u.data)}catch(u){console.warn(u)}finally{s(!1)}})()},[i]);const a=d=>{r(n===d||!d?"":d)},o=l==null?void 0:l.filter(d=>!n||d.source_type===n);return e.jsxs(Ks,{align:"stretch",direction:"column",justify:"flex-end",children:[e.jsxs(ke,{align:"flex-start",justify:"space-between",children:[e.jsx(N,{className:"title",children:"Queued Sources"}),e.jsx(N,{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."})]}),e.jsxs(g,{className:"filters",direction:"row",pb:16,px:36,children:[e.jsx(ie,{className:ae({selected:!n}),onClick:()=>a(""),size:"small",children:"All"}),Object.keys(U).map(d=>e.jsx(ie,{className:ae({selected:d===n}),onClick:()=>a(d),size:"small",children:U[d]},d))]}),e.jsx(Zs,{align:"center",justify:t?"center":"flex-start",children:t?e.jsx(z,{color:x.white}):e.jsx(Xs,{data:o})})]})},Ks=c(g)` +`,Xs=()=>{const[t,s]=h.useState(!0),[n,r]=h.useState(""),[l,i]=le(d=>[d.queuedSources,d.setQueuedSources]);h.useEffect(()=>{(async()=>{s(!0);try{const u=await qe({approved:"False"});i(u.data)}catch(u){console.warn(u)}finally{s(!1)}})()},[i]);const a=d=>{r(n===d||!d?"":d)},o=l==null?void 0:l.filter(d=>!n||d.source_type===n);return e.jsxs(Ks,{align:"stretch",direction:"column",justify:"flex-end",children:[e.jsxs(ke,{align:"flex-start",justify:"space-between",children:[e.jsx(N,{className:"title",children:"Queued Sources"}),e.jsx(N,{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."})]}),e.jsxs(g,{className:"filters",direction:"row",pb:16,px:36,children:[e.jsx(ie,{className:ae({selected:!n}),onClick:()=>a(""),size:"small",children:"All"}),Object.keys(U).map(d=>e.jsx(ie,{className:ae({selected:d===n}),onClick:()=>a(d),size:"small",children:U[d]},d))]}),e.jsx(Zs,{align:"center",justify:t?"center":"flex-start",children:t?e.jsx(z,{color:x.white}):e.jsx(qs,{data:o})})]})},Ks=c(g)` flex: 1; .title { @@ -290,7 +290,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k z-index: 3; position: absolute; transform: translate(-50%, 50%); -`,fe=c(X)` +`,fe=c(q)` font-size: 24px; `,Js=c(Mt)` && { @@ -440,7 +440,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k display: flex; justify-content: center; align-items: center; -`,lo=()=>{const[t,s]=h.useState(!0),[n,r]=h.useState(""),[l,i]=le(p=>[p.sources,p.setSources]),[a]=qe(p=>[p.isAdmin]),[o,d]=h.useState("");h.useEffect(()=>{(async()=>{s(!0);try{const b=await Xe();i(b.data)}catch(b){console.warn(b)}finally{s(!1)}})()},[i]);const u=p=>{r(n===p||!p?"":p)},m=h.useMemo(()=>l==null?void 0:l.filter(p=>(!n||p.source_type===n)&&(p.source.toLowerCase().startsWith(o.toLowerCase())||p.source.toLowerCase().includes(o.toLowerCase())||`@${p.source.toLowerCase()}`.startsWith(o.toLowerCase())||`@${p.source.toLowerCase()}`.includes(o.toLowerCase()))),[o,n,l]);return e.jsxs(co,{align:"stretch",direction:"column",justify:"flex-end",children:[e.jsx(ke,{align:"center",direction:"row",justify:"space-between",children:e.jsx(N,{className:"title",children:"Sources for this Graph"})}),e.jsx(xo,{children:e.jsx(xt,{activeIcon:e.jsx(te,{}),defaultIcon:e.jsx(Ze,{}),loading:t,loadingIcon:e.jsx(z,{color:x.lightGray,size:24}),onSearch:d,placeholder:"Find Source"})}),e.jsxs(g,{className:"filters",direction:"row",pb:16,px:36,children:[e.jsx(ie,{className:ae({selected:!n}),onClick:()=>u(""),size:"small",children:"All"}),Object.keys(U).map(p=>e.jsx(ie,{className:ae({selected:p===n}),onClick:()=>u(p),size:"small",children:U[p]},p))]}),e.jsx(po,{align:"center",justify:t?"center":"flex-start",children:t?e.jsx(z,{color:x.white}):e.jsx(so,{canEdit:a,data:m})})]})},co=c(g)` +`,lo=()=>{const[t,s]=h.useState(!0),[n,r]=h.useState(""),[l,i]=le(p=>[p.sources,p.setSources]),[a]=Qe(p=>[p.isAdmin]),[o,d]=h.useState("");h.useEffect(()=>{(async()=>{s(!0);try{const b=await qe();i(b.data)}catch(b){console.warn(b)}finally{s(!1)}})()},[i]);const u=p=>{r(n===p||!p?"":p)},m=h.useMemo(()=>l==null?void 0:l.filter(p=>(!n||p.source_type===n)&&(p.source.toLowerCase().startsWith(o.toLowerCase())||p.source.toLowerCase().includes(o.toLowerCase())||`@${p.source.toLowerCase()}`.startsWith(o.toLowerCase())||`@${p.source.toLowerCase()}`.includes(o.toLowerCase()))),[o,n,l]);return e.jsxs(co,{align:"stretch",direction:"column",justify:"flex-end",children:[e.jsx(ke,{align:"center",direction:"row",justify:"space-between",children:e.jsx(N,{className:"title",children:"Sources for this Graph"})}),e.jsx(xo,{children:e.jsx(xt,{activeIcon:e.jsx(te,{}),defaultIcon:e.jsx(Ze,{}),loading:t,loadingIcon:e.jsx(z,{color:x.lightGray,size:24}),onSearch:d,placeholder:"Find Source"})}),e.jsxs(g,{className:"filters",direction:"row",pb:16,px:36,children:[e.jsx(ie,{className:ae({selected:!n}),onClick:()=>u(""),size:"small",children:"All"}),Object.keys(U).map(p=>e.jsx(ie,{className:ae({selected:p===n}),onClick:()=>u(p),size:"small",children:U[p]},p))]}),e.jsx(po,{align:"center",justify:t?"center":"flex-start",children:t?e.jsx(z,{color:x.white}):e.jsx(so,{canEdit:a,data:m})})]})},co=c(g)` flex: 1; .title { font-size: 20px; @@ -462,7 +462,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k width: 100%; `,xo=c(g)` margin: 0 0 16px 36px; -`,ho=({selectedType:t,setSelectedType:s})=>{const[n,r]=h.useState([]);h.useEffect(()=>{(async()=>{try{const{data:o}=await St();r(o.edge_types)}catch(o){console.warn(o)}})()},[r]);const l=a=>({label:a,value:a}),i=a=>{s((a==null?void 0:a.value)||"")};return e.jsx(Se,{onSelect:i,options:n.map(l),selectedValue:t?l(t):null})},uo=({onSelect:t,selectedValue:s,topicId:n})=>{const[r,l]=h.useState([]),[i,a]=h.useState(!1),o=h.useMemo(()=>{const b=async j=>{const y={is_muted:"False",sort_by:$e,search:j,skip:"0",limit:"1000"};a(!0);try{const w=(await Ke(y.search)).data.filter($=>($==null?void 0:$.ref_id)!==n);l(w)}catch{l([])}finally{a(!1)}};return we.debounce(b,300)},[n]),d=b=>{const j=b.trim();if(!j){l([]);return}j.length>2&&o(b)},u=b=>{const j=b?r.find(y=>y.ref_id===b.value):null;t(j||null)},m=b=>({label:b.search_value,value:b.ref_id,type:b.node_type}),p=b=>b.map(m);return s?e.jsxs(g,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:s.search_value}),e.jsx(nt,{onClick:()=>t(null),size:"medium",children:e.jsx(te,{})})]}):e.jsx(Se,{handleInputChange:d,isLoading:i,onSelect:u,options:p(r)||Qe,selectedValue:s?m(s):null})},go=({from:t,onSelect:s,selectedType:n,setSelectedType:r,isSwapped:l,setIsSwapped:i,selectedToNode:a})=>e.jsxs(g,{mb:20,children:[e.jsx(g,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(g,{align:"center",direction:"row",children:e.jsx(fo,{children:"Add edge"})})}),e.jsxs(jo,{swap:l,children:[e.jsx(g,{children:e.jsx(yo,{disabled:!0,label:l?"To":"From",swap:l,value:t==null?void 0:t.name})}),e.jsxs(g,{my:16,children:[e.jsx(bo,{children:"Type"}),e.jsx(ho,{selectedType:n,setSelectedType:r})]}),e.jsx(g,{children:e.jsxs(wo,{children:[e.jsx(Co,{children:l?"From":"To"}),e.jsx(uo,{onSelect:s,selectedValue:a,topicId:t==null?void 0:t.ref_id})]})}),e.jsxs(mo,{children:[e.jsx(vo,{children:e.jsx(Je,{})}),e.jsx(To,{onClick:i,children:e.jsx(et,{})}),e.jsx($o,{children:e.jsx(tt,{})})]})]})]}),fo=c(N)` +`,ho=({selectedType:t,setSelectedType:s})=>{const[n,r]=h.useState([]);h.useEffect(()=>{(async()=>{try{const{data:o}=await St();r(o.edge_types)}catch(o){console.warn(o)}})()},[r]);const l=a=>({label:a,value:a}),i=a=>{s((a==null?void 0:a.value)||"")};return e.jsx(Se,{onSelect:i,options:n.map(l),selectedValue:t?l(t):null})},uo=({onSelect:t,selectedValue:s,topicId:n})=>{const[r,l]=h.useState([]),[i,a]=h.useState(!1),o=h.useMemo(()=>{const b=async j=>{const y={is_muted:"False",sort_by:$e,search:j,skip:"0",limit:"1000"};a(!0);try{const w=(await Ke(y.search)).data.filter($=>($==null?void 0:$.ref_id)!==n);l(w)}catch{l([])}finally{a(!1)}};return we.debounce(b,300)},[n]),d=b=>{const j=b.trim();if(!j){l([]);return}j.length>2&&o(b)},u=b=>{const j=b?r.find(y=>y.ref_id===b.value):null;t(j||null)},m=b=>({label:b.search_value,value:b.ref_id,type:b.node_type}),p=b=>b.map(m);return s?e.jsxs(g,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:s.search_value}),e.jsx(nt,{onClick:()=>t(null),size:"medium",children:e.jsx(te,{})})]}):e.jsx(Se,{handleInputChange:d,isLoading:i,onSelect:u,options:p(r)||Xe,selectedValue:s?m(s):null})},go=({from:t,onSelect:s,selectedType:n,setSelectedType:r,isSwapped:l,setIsSwapped:i,selectedToNode:a})=>e.jsxs(g,{mb:20,children:[e.jsx(g,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(g,{align:"center",direction:"row",children:e.jsx(fo,{children:"Add edge"})})}),e.jsxs(jo,{swap:l,children:[e.jsx(g,{children:e.jsx(yo,{disabled:!0,label:l?"To":"From",swap:l,value:t==null?void 0:t.name})}),e.jsxs(g,{my:16,children:[e.jsx(bo,{children:"Type"}),e.jsx(ho,{selectedType:n,setSelectedType:r})]}),e.jsx(g,{children:e.jsxs(wo,{children:[e.jsx(Co,{children:l?"From":"To"}),e.jsx(uo,{onSelect:s,selectedValue:a,topicId:t==null?void 0:t.ref_id})]})}),e.jsxs(mo,{children:[e.jsx(vo,{children:e.jsx(Je,{})}),e.jsx(To,{onClick:i,children:e.jsx(et,{})}),e.jsx($o,{children:e.jsx(tt,{})})]})]})]}),fo=c(N)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -560,7 +560,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k font-family: 'Barlow'; `,Lo=({topic:t,onClose:s})=>{const{close:n}=E("editTopic"),[r]=R(w=>[w.data]),l=Ce({mode:"onChange"}),{watch:i,setValue:a,reset:o,getValues:d}=l,[u,m]=h.useState(!1);h.useEffect(()=>(t&&a("name",t==null?void 0:t.name),()=>{o()}),[t,a,o]);const p=i("name"),b=p==null?void 0:p.trim(),j=()=>{s(),n()},y=async()=>{m(!0);try{if(await de((t==null?void 0:t.ref_id)||"",{node_data:{name:b}}),r){const w={...r};w[t==null?void 0:t.ref_id].name=b,R.setState({data:w})}j()}catch(w){console.warn(w)}finally{m(!1)}},C=d().name&&(t==null?void 0:t.name)!==d().name;return e.jsx(ce,{id:"editTopic",kind:"regular",onClose:j,preventOutsideClose:!0,children:e.jsxs(ve,{...l,children:[e.jsx(No,{}),e.jsxs(W,{color:"secondary",disabled:u||!b||!C,onClick:y,size:"large",variant:"contained",children:["Save Changes",u&&e.jsx(Io,{children:e.jsx(z,{color:x.lightGray,size:12})})]})]})})},Io=c.span` margin-top: 2px; -`,Ro=({topicId:t,onSelect:s,selectedValue:n,dataId:r})=>{const[l,i]=h.useState([]),[a,o]=h.useState(!1),d=h.useMemo(()=>{const j=async y=>{const C={is_muted:"False",sort_by:$e,search:y,skip:"0",limit:"1000"};o(!0);try{const $=(await Ke(C.search)).data.filter(S=>(S==null?void 0:S.ref_id)!==t);i($)}catch{i([])}finally{o(!1)}};return we.debounce(j,300)},[t]),u=j=>{const y=j.trim();if(!y){i([]);return}y.length>2&&d(j)},m=j=>{const y=j?l.find(C=>C.ref_id===j.value):null;s(y||null)},p=j=>({label:j.search_value,value:j.ref_id,type:j.node_type}),b=j=>j.map(p);return n?e.jsxs(g,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:n.search_value}),e.jsx(nt,{onClick:()=>s(null),size:"medium",children:e.jsx(te,{})})]}):e.jsx(Se,{dataId:r,handleInputChange:u,isLoading:a,onSelect:m,options:b(l)||Qe,selectedValue:n?p(n):null})},Bo=({from:t,onSelect:s,selectedToNode:n,isSwapped:r,setIsSwapped:l})=>{var o;const i=t==null?void 0:t.map(d=>d.name).join(", "),a=t&&t.length===1?t[0].name:`${i==null?void 0:i.substring(0,25)} ...`;return e.jsxs(g,{mb:20,children:[e.jsx(g,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(g,{align:"center",direction:"row",children:e.jsx(Eo,{children:"Merge topic"})})}),e.jsxs(Fo,{swap:r,children:[e.jsx(Mo,{children:e.jsx(Oo,{disabled:!0,label:r?"To":"From",swap:r,value:a})}),e.jsxs(g,{my:16,children:[e.jsx(Ho,{children:"Type"}),e.jsx(N,{children:"IS ALIAS"})]}),e.jsx(g,{children:e.jsxs(Wo,{children:[e.jsx(Po,{children:r?"From":"To"}),e.jsx(Ro,{dataId:"to-node",onSelect:s,selectedValue:n,topicId:(o=t[t.length-1])==null?void 0:o.ref_id})]})}),e.jsxs(Ao,{children:[e.jsx(Do,{children:e.jsx(Je,{})}),e.jsx(Uo,{"data-testid":"swap-icon",disabled:(t==null?void 0:t.length)!==1,onClick:(t==null?void 0:t.length)===1?l:void 0,children:e.jsx(et,{})}),e.jsx(Go,{children:e.jsx(tt,{})})]})]})]})},Eo=c(N)` +`,Ro=({topicId:t,onSelect:s,selectedValue:n,dataId:r})=>{const[l,i]=h.useState([]),[a,o]=h.useState(!1),d=h.useMemo(()=>{const j=async y=>{const C={is_muted:"False",sort_by:$e,search:y,skip:"0",limit:"1000"};o(!0);try{const $=(await Ke(C.search)).data.filter(S=>(S==null?void 0:S.ref_id)!==t);i($)}catch{i([])}finally{o(!1)}};return we.debounce(j,300)},[t]),u=j=>{const y=j.trim();if(!y){i([]);return}y.length>2&&d(j)},m=j=>{const y=j?l.find(C=>C.ref_id===j.value):null;s(y||null)},p=j=>({label:j.search_value,value:j.ref_id,type:j.node_type}),b=j=>j.map(p);return n?e.jsxs(g,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:n.search_value}),e.jsx(nt,{onClick:()=>s(null),size:"medium",children:e.jsx(te,{})})]}):e.jsx(Se,{dataId:r,handleInputChange:u,isLoading:a,onSelect:m,options:b(l)||Xe,selectedValue:n?p(n):null})},Bo=({from:t,onSelect:s,selectedToNode:n,isSwapped:r,setIsSwapped:l})=>{var o;const i=t==null?void 0:t.map(d=>d.name).join(", "),a=t&&t.length===1?t[0].name:`${i==null?void 0:i.substring(0,25)} ...`;return e.jsxs(g,{mb:20,children:[e.jsx(g,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(g,{align:"center",direction:"row",children:e.jsx(Eo,{children:"Merge topic"})})}),e.jsxs(Fo,{swap:r,children:[e.jsx(Mo,{children:e.jsx(Oo,{disabled:!0,label:r?"To":"From",swap:r,value:a})}),e.jsxs(g,{my:16,children:[e.jsx(Ho,{children:"Type"}),e.jsx(N,{children:"IS ALIAS"})]}),e.jsx(g,{children:e.jsxs(Wo,{children:[e.jsx(Do,{children:r?"From":"To"}),e.jsx(Ro,{dataId:"to-node",onSelect:s,selectedValue:n,topicId:(o=t[t.length-1])==null?void 0:o.ref_id})]})}),e.jsxs(Ao,{children:[e.jsx(Po,{children:e.jsx(Je,{})}),e.jsx(Uo,{"data-testid":"swap-icon",disabled:(t==null?void 0:t.length)!==1,onClick:(t==null?void 0:t.length)===1?l:void 0,children:e.jsx(et,{})}),e.jsx(Go,{children:e.jsx(tt,{})})]})]})]})},Eo=c(N)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -611,7 +611,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k letter-spacing: 0.01em; text-align: left; margin-bottom: 6px; -`,Po=c.label` +`,Do=c.label` color: #bac1c6; background-color: #23252f; font-size: 13px; @@ -622,7 +622,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k position: absolute; left: 15px; top: -10px; -`,Do=c.div` +`,Po=c.div` position: absolute; top: 0; right: 0; @@ -649,12 +649,12 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k transform: translateY(10px) translateX(3px); color: #6b7a8d; line-height: 1; -`,Yo=({onClose:t,multiTopics:s})=>{const{close:n}=E("mergeTopic"),r=Ce({mode:"onChange"}),{setValue:l,reset:i}=r,[a,o]=h.useState(!1),[d,u]=h.useState(!1),[m,p]=h.useState(null);h.useEffect(()=>{if(s&&s.length>0){const y=s.map(C=>C.name).join(", ");l("name",y)}return()=>{i()}},[s,l,i]);const b=()=>{t(),n()},j=async()=>{o(!0);const y=s==null?void 0:s.map(C=>C.ref_id).filter(C=>!!C);try{y.length&&m&&(await zt({from:y,to:m==null?void 0:m.ref_id}),R.setState(C=>({ids:C.ids.filter(w=>!y.includes(w)),total:C.total-y.length})),b())}catch(C){console.warn(C)}finally{o(!1)}};return e.jsx(ce,{id:"mergeTopic",kind:"small",onClose:b,preventOutsideClose:!0,children:e.jsxs(ve,{...r,children:[e.jsx(Bo,{from:s,isSwapped:d,onSelect:p,selectedToNode:m,setIsSwapped:()=>u(!d)}),e.jsxs(Vo,{color:"secondary","data-testid":"merge-topics-button",disabled:a||!m,onClick:j,size:"large",variant:"contained",children:["Merge topics",a&&e.jsx(Xo,{children:e.jsx(z,{color:x.lightGray,size:12})})]})]})})},Vo=c(W)` +`,Yo=({onClose:t,multiTopics:s})=>{const{close:n}=E("mergeTopic"),r=Ce({mode:"onChange"}),{setValue:l,reset:i}=r,[a,o]=h.useState(!1),[d,u]=h.useState(!1),[m,p]=h.useState(null);h.useEffect(()=>{if(s&&s.length>0){const y=s.map(C=>C.name).join(", ");l("name",y)}return()=>{i()}},[s,l,i]);const b=()=>{t(),n()},j=async()=>{o(!0);const y=s==null?void 0:s.map(C=>C.ref_id).filter(C=>!!C);try{y.length&&m&&(await zt({from:y,to:m==null?void 0:m.ref_id}),R.setState(C=>({ids:C.ids.filter(w=>!y.includes(w)),total:C.total-y.length})),b())}catch(C){console.warn(C)}finally{o(!1)}};return e.jsx(ce,{id:"mergeTopic",kind:"small",onClose:b,preventOutsideClose:!0,children:e.jsxs(ve,{...r,children:[e.jsx(Bo,{from:s,isSwapped:d,onSelect:p,selectedToNode:m,setIsSwapped:()=>u(!d)}),e.jsxs(Vo,{color:"secondary","data-testid":"merge-topics-button",disabled:a||!m,onClick:j,size:"large",variant:"contained",children:["Merge topics",a&&e.jsx(qo,{children:e.jsx(z,{color:x.lightGray,size:12})})]})]})})},Vo=c(W)` width: 293px !important; margin: 0 0 10px auto !important; -`,Xo=c.span` +`,qo=c.span` margin-top: 2px; -`,qo=({topic:t,onClick:s,onSearch:n,checkedStates:r,setCheckedStates:l,isMuteDisabled:i})=>{const[a,o]=R(k=>[k.ids,k.total]),[d,u]=h.useState(!1),[m,p]=h.useState(!1),b=ye(t.date_added_to_graph),j=async(k,v)=>{u(!0);try{await de(k,{node_data:{is_muted:v}}),R.setState({ids:a.filter(_=>_!==k),total:o-1})}catch(_){console.warn(_)}},y=k=>{l(v=>({...v,[k]:!v[k]}))},C=(k,v)=>{var _;(_=window.getSelection())!=null&&_.toString()?k.preventDefault():n(v.name)},w=t.edgeList.slice(0,1),$=t.edgeList.length-w.length,[S,A]=re.useState(null),O=k=>{A(k.currentTarget),p(!0)},L=()=>{p(!1)},H=!!S&&m,B=r[t.ref_id]?"visible":"";return e.jsxs(he,{className:r[t.ref_id]?"checked":"",children:[e.jsx(f,{children:e.jsx(Zo,{className:`checkbox-section ${B}`,"data-testid":"topic-check-box",onClick:()=>y(t.ref_id),children:e.jsx(Jo,{checked:r[t.ref_id],children:e.jsx(en,{children:r[t.ref_id]&&e.jsx(st,{})})})})}),e.jsx(f,{onClick:k=>C(k,t),children:e.jsx(Ko,{children:t.name})}),e.jsx(f,{children:t.node_type}),e.jsx(f,{children:e.jsx(tn,{children:t.edgeCount})}),e.jsxs(f,{children:[e.jsx(Te,{anchorEl:S,anchorOrigin:{vertical:"top",horizontal:"center"},disableRestoreFocus:!0,id:"mouse-over-popover",onClose:L,onMouseEnter:()=>p(!0),onMouseLeave:L,open:H,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:e.jsx(Ee,{sx:{p:1.5,fontSize:"13px",fontWeight:400,lineHeight:"1.8",wordWrap:"break-word"},children:t.edgeList.join(", ")})}),w.join(", "),$>0&&e.jsx(Ee,{"aria-haspopup":"true","aria-owns":H?"mouse-over-popover":void 0,component:"span",onMouseEnter:O,onMouseLeave:L,sx:{cursor:"pointer"},children:",..."})]}),e.jsx(f,{children:e.jsx("span",{children:b})}),e.jsx(f,{className:"cell-center",children:e.jsx(g,{direction:"row",justify:"space-between",children:e.jsx("div",{className:"approve-wrapper",children:d?e.jsx(Qo,{children:e.jsx(z,{color:x.white,size:16})}):e.jsxs(g,{direction:"row",children:[t.is_muted?e.jsx(X,{className:"centered",disabled:i,onClick:()=>j(t.ref_id,!1),children:e.jsx(Ot,{})}):e.jsx(X,{className:"centered",disabled:i,onClick:()=>j(t.ref_id,!0),children:e.jsx(Wt,{})}),e.jsx(X,{disabled:i,onClick:k=>s(k,t.ref_id),children:e.jsx(Ht,{"data-testid":"ThreeDotsIcons"})})]})})})})]},t.name)},Qo=c.span` +`,Qo=({topic:t,onClick:s,onSearch:n,checkedStates:r,setCheckedStates:l,isMuteDisabled:i})=>{const[a,o]=R(k=>[k.ids,k.total]),[d,u]=h.useState(!1),[m,p]=h.useState(!1),b=ye(t.date_added_to_graph),j=async(k,v)=>{u(!0);try{await de(k,{node_data:{is_muted:v}}),R.setState({ids:a.filter(_=>_!==k),total:o-1})}catch(_){console.warn(_)}},y=k=>{l(v=>({...v,[k]:!v[k]}))},C=(k,v)=>{var _;(_=window.getSelection())!=null&&_.toString()?k.preventDefault():n(v.name)},w=t.edgeList.slice(0,1),$=t.edgeList.length-w.length,[S,A]=re.useState(null),O=k=>{A(k.currentTarget),p(!0)},L=()=>{p(!1)},H=!!S&&m,B=r[t.ref_id]?"visible":"";return e.jsxs(he,{className:r[t.ref_id]?"checked":"",children:[e.jsx(f,{children:e.jsx(Zo,{className:`checkbox-section ${B}`,"data-testid":"topic-check-box",onClick:()=>y(t.ref_id),children:e.jsx(Jo,{checked:r[t.ref_id],children:e.jsx(en,{children:r[t.ref_id]&&e.jsx(st,{})})})})}),e.jsx(f,{onClick:k=>C(k,t),children:e.jsx(Ko,{children:t.name})}),e.jsx(f,{children:t.node_type}),e.jsx(f,{children:e.jsx(tn,{children:t.edgeCount})}),e.jsxs(f,{children:[e.jsx(Te,{anchorEl:S,anchorOrigin:{vertical:"top",horizontal:"center"},disableRestoreFocus:!0,id:"mouse-over-popover",onClose:L,onMouseEnter:()=>p(!0),onMouseLeave:L,open:H,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:e.jsx(Ee,{sx:{p:1.5,fontSize:"13px",fontWeight:400,lineHeight:"1.8",wordWrap:"break-word"},children:t.edgeList.join(", ")})}),w.join(", "),$>0&&e.jsx(Ee,{"aria-haspopup":"true","aria-owns":H?"mouse-over-popover":void 0,component:"span",onMouseEnter:O,onMouseLeave:L,sx:{cursor:"pointer"},children:",..."})]}),e.jsx(f,{children:e.jsx("span",{children:b})}),e.jsx(f,{className:"cell-center",children:e.jsx(g,{direction:"row",justify:"space-between",children:e.jsx("div",{className:"approve-wrapper",children:d?e.jsx(Xo,{children:e.jsx(z,{color:x.white,size:16})}):e.jsxs(g,{direction:"row",children:[t.is_muted?e.jsx(q,{className:"centered",disabled:i,onClick:()=>j(t.ref_id,!1),children:e.jsx(Ot,{})}):e.jsx(q,{className:"centered",disabled:i,onClick:()=>j(t.ref_id,!0),children:e.jsx(Wt,{})}),e.jsx(q,{disabled:i,onClick:k=>s(k,t.ref_id),children:e.jsx(Ht,{"data-testid":"ThreeDotsIcons"})})]})})})})]},t.name)},Xo=c.span` margin-left: 12px; `,Ko=c.span` cursor: pointer; @@ -690,7 +690,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k display: flex; align-items: center; justify-content: center; -`,sn=h.memo(qo),on=({setShowMuteUnmute:t,showMuted:s,loading:n,onTopicEdit:r,onChangeFilter:l,checkedStates:i,setCheckedStates:a})=>{const{close:o}=E("sourcesTable"),[d,u]=h.useState(!1),[m,p]=re.useState(null),[b,j]=re.useState(""),y=Object.values(i).filter(T=>T).length,[C,w]=Lt(T=>[T.setSearchFormValue,T.setCurrentSearch]),[$,S,A]=R(T=>[T.data,T.ids,T.total]),O=h.useCallback((T,P)=>{p(T.currentTarget),j(P)},[]),L=()=>{p(null)},H=T=>{C(T),w(T),o()},B=T=>{r(b,T),L()},k=T=>{l(T)},v=!!m,_=v?"simple-popover":void 0,M=async()=>{u(!0);try{const T=Object.keys(i).map(async Y=>{if(i[Y])try{return await de(Y,{node_data:{is_muted:!s}}),Y}catch(ut){return console.error("Error updating node data:",ut),null}return null}),P=await Promise.all(T);R.setState({ids:S.filter(Y=>!P.includes(Y)),total:A-P.length}),a({}),u(!1)}catch(T){console.error("Error:",T),u(!1)}};return!n&&!$?e.jsxs(g,{children:[e.jsx(N,{children:"There is not any results for selected filters"}),e.jsx(je,{})]}):e.jsx(e.Fragment,{children:$&&!Object.keys($).length?e.jsxs(g,{children:[e.jsx(N,{children:"There is not any results for selected filters"}),e.jsx(je,{})]}):e.jsxs(xn,{align:"center",justify:d?"center":"flex-start",children:[e.jsxs(pe,{component:"table",children:[y>0?e.jsx(zs,{children:e.jsxs(G,{component:"tr",children:[e.jsx(f,{children:e.jsx(X,{onClick:()=>a({}),children:e.jsx(te,{})})}),e.jsx(f,{colSpan:12,children:e.jsxs(pn,{children:[e.jsxs(dn,{children:[e.jsx(cn,{children:y}),"selected"]}),e.jsx(f,{className:"empty"}),e.jsx(Ye,{onClick:M,role:"button",children:s?e.jsxs(e.Fragment,{children:[e.jsx(Le,{})," Unmute ALL"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ie,{})," Mute ALL"]})}),e.jsx(f,{className:"empty"}),e.jsxs(Ye,{onClick:()=>B("mergeTopic"),children:[e.jsx(Re,{})," Merge"]})]})}),e.jsx(f,{className:"empty"})]})}):e.jsx(ue,{children:e.jsxs(G,{component:"tr",children:[e.jsx(f,{className:"empty"}),e.jsx(f,{children:e.jsxs(be,{onClick:()=>k($e),children:["Name ",e.jsx(ge,{})]})}),e.jsx(f,{children:"Type"}),e.jsx(f,{children:e.jsxs(be,{onClick:()=>k(Ut),children:["Count ",e.jsx(ge,{})]})}),e.jsx(f,{children:"Edge list"}),e.jsx(f,{children:e.jsxs(be,{onClick:()=>k(Gt),children:["Date ",e.jsx(ge,{})]})}),e.jsx(f,{children:e.jsx(g,{px:8,children:e.jsxs(nn,{onClick:t,children:[e.jsx(rn,{checked:s,children:e.jsx(an,{children:s&&e.jsx(st,{})})}),"Muted"]})})})]})}),(n||d)&&!$&&e.jsx(hn,{children:e.jsx(z,{color:x.white})}),$&&e.jsx("tbody",{children:S==null?void 0:S.map(T=>e.jsx(sn,{checkedStates:i,isMuteDisabled:Object.values(i).filter(P=>P).length>1,onClick:O,onSearch:H,setCheckedStates:a,topic:$[T]},T))})]}),b?e.jsxs(ln,{anchorEl:m,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:_,onClose:L,open:v,transformOrigin:{vertical:"top",horizontal:"right"},children:[s?e.jsxs(V,{"data-testid":"unmute",onClick:()=>B("unMute"),children:[" ",e.jsx(Le,{"data-testid":""})," Unmute"]}):e.jsxs(V,{"data-testid":"mute",onClick:()=>B("mute"),children:[" ",e.jsx(Ie,{"data-testid":"VisibilityOff"})," Mute"]}),e.jsxs(V,{"data-testid":"rename",onClick:()=>B("editTopic"),children:[e.jsx(Pt,{"data-testid":"EditTopicIcon"})," Rename"]}),e.jsxs(V,{"data-testid":"merge",onClick:()=>B("mergeTopic"),children:[e.jsx(Re,{"data-testid":"MergeIcon"})," Merge"]}),e.jsxs(V,{"data-testid":"add_edge",onClick:()=>B("addEdge"),children:[e.jsx(Dt,{"data-testid":"AddCircleIcon"})," Add edge"]})]}):null]})})},nn=c.td` +`,sn=h.memo(Qo),on=({setShowMuteUnmute:t,showMuted:s,loading:n,onTopicEdit:r,onChangeFilter:l,checkedStates:i,setCheckedStates:a})=>{const{close:o}=E("sourcesTable"),[d,u]=h.useState(!1),[m,p]=re.useState(null),[b,j]=re.useState(""),y=Object.values(i).filter(T=>T).length,[C,w]=Lt(T=>[T.setSearchFormValue,T.setCurrentSearch]),[$,S,A]=R(T=>[T.data,T.ids,T.total]),O=h.useCallback((T,D)=>{p(T.currentTarget),j(D)},[]),L=()=>{p(null)},H=T=>{C(T),w(T),o()},B=T=>{r(b,T),L()},k=T=>{l(T)},v=!!m,_=v?"simple-popover":void 0,M=async()=>{u(!0);try{const T=Object.keys(i).map(async Y=>{if(i[Y])try{return await de(Y,{node_data:{is_muted:!s}}),Y}catch(ut){return console.error("Error updating node data:",ut),null}return null}),D=await Promise.all(T);R.setState({ids:S.filter(Y=>!D.includes(Y)),total:A-D.length}),a({}),u(!1)}catch(T){console.error("Error:",T),u(!1)}};return!n&&!$?e.jsxs(g,{children:[e.jsx(N,{children:"There is not any results for selected filters"}),e.jsx(je,{})]}):e.jsx(e.Fragment,{children:$&&!Object.keys($).length?e.jsxs(g,{children:[e.jsx(N,{children:"There is not any results for selected filters"}),e.jsx(je,{})]}):e.jsxs(xn,{align:"center",justify:d?"center":"flex-start",children:[e.jsxs(pe,{component:"table",children:[y>0?e.jsx(zs,{children:e.jsxs(G,{component:"tr",children:[e.jsx(f,{children:e.jsx(q,{onClick:()=>a({}),children:e.jsx(te,{})})}),e.jsx(f,{colSpan:12,children:e.jsxs(pn,{children:[e.jsxs(dn,{children:[e.jsx(cn,{children:y}),"selected"]}),e.jsx(f,{className:"empty"}),e.jsx(Ye,{onClick:M,role:"button",children:s?e.jsxs(e.Fragment,{children:[e.jsx(Le,{})," Unmute ALL"]}):e.jsxs(e.Fragment,{children:[e.jsx(Ie,{})," Mute ALL"]})}),e.jsx(f,{className:"empty"}),e.jsxs(Ye,{onClick:()=>B("mergeTopic"),children:[e.jsx(Re,{})," Merge"]})]})}),e.jsx(f,{className:"empty"})]})}):e.jsx(ue,{children:e.jsxs(G,{component:"tr",children:[e.jsx(f,{className:"empty"}),e.jsx(f,{children:e.jsxs(be,{onClick:()=>k($e),children:["Name ",e.jsx(ge,{})]})}),e.jsx(f,{children:"Type"}),e.jsx(f,{children:e.jsxs(be,{onClick:()=>k(Ut),children:["Count ",e.jsx(ge,{})]})}),e.jsx(f,{children:"Edge list"}),e.jsx(f,{children:e.jsxs(be,{onClick:()=>k(Gt),children:["Date ",e.jsx(ge,{})]})}),e.jsx(f,{children:e.jsx(g,{px:8,children:e.jsxs(nn,{onClick:t,children:[e.jsx(rn,{checked:s,children:e.jsx(an,{children:s&&e.jsx(st,{})})}),"Muted"]})})})]})}),(n||d)&&!$&&e.jsx(hn,{children:e.jsx(z,{color:x.white})}),$&&e.jsx("tbody",{children:S==null?void 0:S.map(T=>e.jsx(sn,{checkedStates:i,isMuteDisabled:Object.values(i).filter(D=>D).length>1,onClick:O,onSearch:H,setCheckedStates:a,topic:$[T]},T))})]}),b?e.jsxs(ln,{anchorEl:m,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:_,onClose:L,open:v,transformOrigin:{vertical:"top",horizontal:"right"},children:[s?e.jsxs(V,{"data-testid":"unmute",onClick:()=>B("unMute"),children:[" ",e.jsx(Le,{"data-testid":""})," Unmute"]}):e.jsxs(V,{"data-testid":"mute",onClick:()=>B("mute"),children:[" ",e.jsx(Ie,{"data-testid":"VisibilityOff"})," Mute"]}),e.jsxs(V,{"data-testid":"rename",onClick:()=>B("editTopic"),children:[e.jsx(Dt,{"data-testid":"EditTopicIcon"})," Rename"]}),e.jsxs(V,{"data-testid":"merge",onClick:()=>B("mergeTopic"),children:[e.jsx(Re,{"data-testid":"MergeIcon"})," Merge"]}),e.jsxs(V,{"data-testid":"add_edge",onClick:()=>B("addEdge"),children:[e.jsx(Pt,{"data-testid":"AddCircleIcon"})," Add edge"]})]}):null]})})},nn=c.td` cursor: pointer; display: flex; align-items: center; @@ -821,7 +821,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k width: 100%; `,mn=c(g)` margin: 0 0 16px 36px; -`,bn=[{label:it,component:Fs},{label:Yt,component:lo},{label:at,component:Qs},{label:rt,component:un}],jn=t=>{const{children:s,value:n,index:r,...l}=t;return n===r?e.jsx(Tn,{"aria-labelledby":`simple-tab-${r}`,hidden:n!==r,id:`simple-tabpanel-${r}`,role:"tabpanel",...l,children:s}):null};function yn(t){return{id:`simple-tab-${t}`,"aria-controls":`simple-tabpanel-${t}`}}const wn=()=>{const[t,s]=h.useState(0),[n]=qe(o=>[o.isAdmin]),[r]=It(o=>[o.queuedSourcesFeatureFlag]),l=Rt(),i=(o,d)=>{s(d)},a=bn.filter(({label:o})=>o===rt?n:o===at?n&&r:o===it?l:!0);return e.jsxs($n,{"data-testid":"sources-table",direction:"column",children:[e.jsx(Cn,{"aria-label":"sources tabs",onChange:i,value:t,children:a.map((o,d)=>e.jsx(vn,{color:x.white,disableRipple:!0,label:o.label,...yn(d)},o.label))}),a.map((o,d)=>e.jsx(jn,{index:d,value:t,children:e.jsx(o.component,{})},o.label))]})},Cn=c(Xt)` +`,bn=[{label:it,component:Fs},{label:Yt,component:lo},{label:at,component:Xs},{label:rt,component:un}],jn=t=>{const{children:s,value:n,index:r,...l}=t;return n===r?e.jsx(Tn,{"aria-labelledby":`simple-tab-${r}`,hidden:n!==r,id:`simple-tabpanel-${r}`,role:"tabpanel",...l,children:s}):null};function yn(t){return{id:`simple-tab-${t}`,"aria-controls":`simple-tabpanel-${t}`}}const wn=()=>{const[t,s]=h.useState(0),[n]=Qe(o=>[o.isAdmin]),[r]=It(o=>[o.queuedSourcesFeatureFlag]),l=Rt(),i=(o,d)=>{s(d)},a=bn.filter(({label:o})=>o===rt?n:o===at?n&&r:o===it?l:!0);return e.jsxs($n,{"data-testid":"sources-table",direction:"column",children:[e.jsx(Cn,{"aria-label":"sources tabs",onChange:i,value:t,children:a.map((o,d)=>e.jsx(vn,{color:x.white,disableRipple:!0,label:o.label,...yn(d)},o.label))}),a.map((o,d)=>e.jsx(jn,{index:d,value:t,children:e.jsx(o.component,{})},o.label))]})},Cn=c(qt)` && { background: rgba(0, 0, 0, 0.2); border-radius: 9px 9px 0 0; @@ -829,7 +829,7 @@ import{r as h,c as q,d as Q,s as F,e as I,u as K,a as Z,j as e,h as J,i as ee,k background: ${x.primaryBlue}; } } -`,vn=c(qt)` +`,vn=c(Qt)` && { padding: 30px 0 24px; color: ${x.GRAY6}; diff --git a/build/assets/index-16ff4e55.js b/build/assets/index-4c5f8236.js similarity index 99% rename from build/assets/index-16ff4e55.js rename to build/assets/index-4c5f8236.js index 2484ba133..cb812661e 100644 --- a/build/assets/index-16ff4e55.js +++ b/build/assets/index-4c5f8236.js @@ -831,4 +831,4 @@ PROCEED WITH CAUTION! align-items: center; width: 100%; height: 100%; -`,LazyApp=reactExports.lazy(()=>__vitePreload(()=>import("./index-04a82be1.js").then(et=>et.a$),[]).then(({App:et})=>({default:et}))),AppContainer=()=>{const et=jsxRuntimeExports.jsx(LazyApp,{});return jsxRuntimeExports.jsxs(AppProviders,{children:[jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("div",{children:"Loading..."}),children:jsxRuntimeExports.jsx(AuthGuard,{children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{element:et,path:"/"}),jsxRuntimeExports.jsx(Route,{element:et,path:"/search"}),jsxRuntimeExports.jsx(Route,{element:et,path:"*"})]})})}),jsxRuntimeExports.jsx(E2ETests,{})]})},index="",root=client$1.createRoot(document.getElementById("root"));root.render(isE2E?jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(AppContainer,{})}):jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(AppContainer,{})})}));reportWebVitals();overrideConsole();export{$2AODx$react as $,devtools as A,ButtonBase$1 as B,ClearIcon as C,useAppStore as D,useUserStore as E,Flex as F,useSchemaStore as G,Text as H,__vitePreload as I,InfoIcon as J,lottie as K,LinearProgress$1 as L,useModal as M,getTotalProcessing as N,getStats as O,formatStatsResponse as P,lodashExports as Q,ReactDOM as R,SocketContext as S,TransitionGroupContext as T,media as U,useAiSummaryStore as V,We as W,useNavigate as X,Q as Y,useSearchParams as Z,_inheritsLoose as _,_objectWithoutPropertiesLoose as a,GITHUB_REPOSITORY as a$,useFeatureFlagStore as a0,useForm as a1,isDevelopment as a2,FormProvider as a3,updateBudget as a4,isSphinx as a5,useNodeTypes as a6,NODE_RELATIVE_HIGHLIGHT_COLORS as a7,fetchNodeEdges as a8,MdViewInAr as a9,isArray_1 as aA,_arrayPush as aB,_baseUnary as aC,_defineProperty as aD,eq_1 as aE,isArrayLike_1 as aF,_isIndex as aG,isObject_1 as aH,_root as aI,_baseAssignValue as aJ,keys_1 as aK,MdBolt as aL,getFullTranscript as aM,MdPlayArrow as aN,MdAccessTime as aO,getAugmentedNamespace as aP,useHasAiChats as aQ,postAboutData as aR,SuccessNotify as aS,NODE_ADD_ERROR as aT,TextInput as aU,requiredRule as aV,MdError as aW,BaseModal as aX,TWITTER_HANDLE as aY,YOUTUBE_CHANNEL as aZ,RSS as a_,MdClose as aa,addToGlobalForE2e as ab,api$1 as ac,distExports$1 as ad,executeIfProd as ae,useIsFocusVisible as af,rootShouldForwardProp as ag,lighten as ah,darken as ai,slotShouldForwardProp as aj,Ce as ak,useFormContext as al,useHasAiChatsResponseLoading as am,Ue as an,hooks as ao,commonjsGlobal as ap,commonjsRequire as aq,getSchemaAll as ar,useFilteredNodes as as,_baseGetTag as at,isObjectLike_1 as au,isObject$8 as av,isFunction$4 as aw,_Set as ax,_Symbol as ay,isArguments_1 as az,React as b,THEME_ID as b$,LINK as b0,TWITTER_SOURCE as b1,WEB_PAGE as b2,DOCUMENT as b3,getPriceData as b4,isE2E as b5,sphinxBridge as b6,getLSat as b7,payLsat as b8,noSpacePattern as b9,postBluePrintType as bA,deleteEdgeType as bB,cloneDeep_1 as bC,useFieldArray as bD,OptionTypes as bE,NoParent as bF,editNodeSchemaUpdate as bG,createRoot as bH,react as bI,GRAPH_GROUND_COLOR as bJ,GRAPH_LIGHT_INTENSITY as bK,GRAPH_FOG_COLOR as bL,_getPrototype as bM,_MapCache as bN,_Uint8Array as bO,_getAllKeys as bP,_Stack as bQ,_getTag as bR,isBufferExports as bS,isTypedArray_1 as bT,isLength_1 as bU,request as bV,buffer$2 as bW,sphinx$1 as bX,Global as bY,useTheme$2 as bZ,defaultTheme$1 as b_,getNodeType as ba,getNodeSchemaTypes as bb,OPTIONS as bc,initialValue as bd,getNodeContent as be,MdCheckCircle as bf,MdCancel as bg,approveRadarData as bh,deleteRadarData as bi,getRadarData as bj,BaseTextInput as bk,MdCheck as bl,putRadarData as bm,getEdgeTypes as bn,getEdges as bo,postEdgeType as bp,putNodeData as bq,postMergeTopics as br,getTopicsData as bs,deleteNode as bt,keyframes as bu,css as bv,changeNodeType as bw,resolveBreakpointValues as bx,handleBreakpoints as by,updateEdgeType as bz,generateUtilityClass as c,formatMuiErrorMessage as c0,deepmerge as c1,defaultSxConfig$1 as c2,isPlainObject$1 as c3,createStyled as c4,createTheme$1 as c5,useThemeProps$1 as c6,createUnarySpacing as c7,mergeBreakpointsInOrder as c8,getValue as c9,useTheme$3 as ca,index$1 as cb,generateUtilityClasses as d,_extends as e,alpha as f,getDefaultExportFromCjs as g,clsx$2 as h,composeClasses as i,jsxRuntimeExports as j,capitalize as k,useForkRef as l,useEnhancedEffect$1 as m,setRef as n,reactDomExports as o,useEventCallback as p,useTheme as q,reactExports as r,styled$1 as s,create as t,useThemeProps as u,useDataStore as v,styled$3 as w,colors as x,clsx as y,Button$1 as z}; +`,LazyApp=reactExports.lazy(()=>__vitePreload(()=>import("./index-a4caf8d5.js").then(et=>et.a$),[]).then(({App:et})=>({default:et}))),AppContainer=()=>{const et=jsxRuntimeExports.jsx(LazyApp,{});return jsxRuntimeExports.jsxs(AppProviders,{children:[jsxRuntimeExports.jsx(reactExports.Suspense,{fallback:jsxRuntimeExports.jsx("div",{children:"Loading..."}),children:jsxRuntimeExports.jsx(AuthGuard,{children:jsxRuntimeExports.jsxs(Routes,{children:[jsxRuntimeExports.jsx(Route,{element:et,path:"/"}),jsxRuntimeExports.jsx(Route,{element:et,path:"/search"}),jsxRuntimeExports.jsx(Route,{element:et,path:"*"})]})})}),jsxRuntimeExports.jsx(E2ETests,{})]})},index="",root=client$1.createRoot(document.getElementById("root"));root.render(isE2E?jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(AppContainer,{})}):jsxRuntimeExports.jsx(React.StrictMode,{children:jsxRuntimeExports.jsx(BrowserRouter,{children:jsxRuntimeExports.jsx(AppContainer,{})})}));reportWebVitals();overrideConsole();export{$2AODx$react as $,devtools as A,ButtonBase$1 as B,ClearIcon as C,useAppStore as D,useUserStore as E,Flex as F,useSchemaStore as G,Text as H,__vitePreload as I,InfoIcon as J,lottie as K,LinearProgress$1 as L,useModal as M,getTotalProcessing as N,getStats as O,formatStatsResponse as P,lodashExports as Q,ReactDOM as R,SocketContext as S,TransitionGroupContext as T,media as U,useAiSummaryStore as V,We as W,useNavigate as X,Q as Y,useSearchParams as Z,_inheritsLoose as _,_objectWithoutPropertiesLoose as a,GITHUB_REPOSITORY as a$,useFeatureFlagStore as a0,useForm as a1,isDevelopment as a2,FormProvider as a3,updateBudget as a4,isSphinx as a5,useNodeTypes as a6,NODE_RELATIVE_HIGHLIGHT_COLORS as a7,fetchNodeEdges as a8,MdViewInAr as a9,isArray_1 as aA,_arrayPush as aB,_baseUnary as aC,_defineProperty as aD,eq_1 as aE,isArrayLike_1 as aF,_isIndex as aG,isObject_1 as aH,_root as aI,_baseAssignValue as aJ,keys_1 as aK,MdBolt as aL,getFullTranscript as aM,MdPlayArrow as aN,MdAccessTime as aO,getAugmentedNamespace as aP,useHasAiChats as aQ,postAboutData as aR,SuccessNotify as aS,NODE_ADD_ERROR as aT,TextInput as aU,requiredRule as aV,MdError as aW,BaseModal as aX,TWITTER_HANDLE as aY,YOUTUBE_CHANNEL as aZ,RSS as a_,MdClose as aa,addToGlobalForE2e as ab,api$1 as ac,distExports$1 as ad,executeIfProd as ae,useIsFocusVisible as af,rootShouldForwardProp as ag,lighten as ah,darken as ai,slotShouldForwardProp as aj,Ce as ak,useFormContext as al,useHasAiChatsResponseLoading as am,Ue as an,hooks as ao,commonjsGlobal as ap,commonjsRequire as aq,getSchemaAll as ar,useFilteredNodes as as,_baseGetTag as at,isObjectLike_1 as au,isObject$8 as av,isFunction$4 as aw,_Set as ax,_Symbol as ay,isArguments_1 as az,React as b,THEME_ID as b$,LINK as b0,TWITTER_SOURCE as b1,WEB_PAGE as b2,DOCUMENT as b3,getPriceData as b4,isE2E as b5,sphinxBridge as b6,getLSat as b7,payLsat as b8,noSpacePattern as b9,postBluePrintType as bA,deleteEdgeType as bB,cloneDeep_1 as bC,useFieldArray as bD,OptionTypes as bE,NoParent as bF,editNodeSchemaUpdate as bG,createRoot as bH,react as bI,GRAPH_GROUND_COLOR as bJ,GRAPH_LIGHT_INTENSITY as bK,GRAPH_FOG_COLOR as bL,_getPrototype as bM,_MapCache as bN,_Uint8Array as bO,_getAllKeys as bP,_Stack as bQ,_getTag as bR,isBufferExports as bS,isTypedArray_1 as bT,isLength_1 as bU,request as bV,buffer$2 as bW,sphinx$1 as bX,Global as bY,useTheme$2 as bZ,defaultTheme$1 as b_,getNodeType as ba,getNodeSchemaTypes as bb,OPTIONS as bc,initialValue as bd,getNodeContent as be,MdCheckCircle as bf,MdCancel as bg,approveRadarData as bh,deleteRadarData as bi,getRadarData as bj,BaseTextInput as bk,MdCheck as bl,putRadarData as bm,getEdgeTypes as bn,getEdges as bo,postEdgeType as bp,putNodeData as bq,postMergeTopics as br,getTopicsData as bs,deleteNode as bt,keyframes as bu,css as bv,changeNodeType as bw,resolveBreakpointValues as bx,handleBreakpoints as by,updateEdgeType as bz,generateUtilityClass as c,formatMuiErrorMessage as c0,deepmerge as c1,defaultSxConfig$1 as c2,isPlainObject$1 as c3,createStyled as c4,createTheme$1 as c5,useThemeProps$1 as c6,createUnarySpacing as c7,mergeBreakpointsInOrder as c8,getValue as c9,useTheme$3 as ca,index$1 as cb,generateUtilityClasses as d,_extends as e,alpha as f,getDefaultExportFromCjs as g,clsx$2 as h,composeClasses as i,jsxRuntimeExports as j,capitalize as k,useForkRef as l,useEnhancedEffect$1 as m,setRef as n,reactDomExports as o,useEventCallback as p,useTheme as q,reactExports as r,styled$1 as s,create as t,useThemeProps as u,useDataStore as v,styled$3 as w,colors as x,clsx as y,Button$1 as z}; diff --git a/build/assets/index-fe1fa9e4.js b/build/assets/index-5019b400.js similarity index 69% rename from build/assets/index-fe1fa9e4.js rename to build/assets/index-5019b400.js index 11e88b9d2..0e26de17c 100644 --- a/build/assets/index-fe1fa9e4.js +++ b/build/assets/index-5019b400.js @@ -1 +1 @@ -import"./index-16ff4e55.js";import{e as o}from"./index-04a82be1.js";const a=()=>{const{simulation:e,simulationHelpers:s}=o(r=>r);return{nodes:(e==null?void 0:e.nodes())||[],links:s.getLinks()}};export{a as u}; +import"./index-4c5f8236.js";import{e as o}from"./index-a4caf8d5.js";const a=()=>{const{simulation:e,simulationHelpers:s}=o(r=>r);return{nodes:(e==null?void 0:e.nodes())||[],links:s.getLinks()}};export{a as u}; diff --git a/build/assets/index-3e9f068c.js b/build/assets/index-5226b9ef.js similarity index 96% rename from build/assets/index-3e9f068c.js rename to build/assets/index-5226b9ef.js index 18c424b91..da56ea0fb 100644 --- a/build/assets/index-3e9f068c.js +++ b/build/assets/index-5226b9ef.js @@ -1,4 +1,4 @@ -import{w as v,x as B,H as z,F as r,r as f,al as U,j as e,aU as J,aV as K,b9 as X,z as E,ba as $,a0 as Q,bb as Z,M as D,a1 as N,aT as O,aX as ee,a3 as te,bs as ne,bw as re}from"./index-16ff4e55.js";import{p as V}from"./index-d206d03e.js";import{C as G}from"./ClipLoader-049391dc.js";import{u as H}from"./index-04a82be1.js";import{A as W}from"./index-f0acd212.js";import{c as oe}from"./index-64f1c910.js";import"./three.module-d9fcef06.js";import"./Stack-25a86e54.js";import"./createSvgIcon-e167cb2e.js";import"./TextareaAutosize-e1814669.js";const q=a=>a.charAt(0).toUpperCase()+a.slice(1).replace(/_/g," "),k=a=>a?[...a].sort((l,x)=>Number(x.required)-Number(l.required)):[],Y=a=>a?a.filter(l=>l.key!=="node_key"):[],ae=({handleSelectType:a,skipToStep:l,nodeType:x,selectedValues:n})=>{const[h,w]=f.useState(!1),[m,C]=f.useState(),{watch:j,formState:{isValid:t}}=U();f.useEffect(()=>{(async()=>{w(!0);const o=await $(x),T=V(o),A=Y(T);C(A),w(!1)})()},[x,j]);const s=c=>c.charAt(0).toUpperCase()+c.slice(1).replace(/_/g," "),p=(m?[...m].sort((c,o)=>c.required&&!o.required?-1:!c.required&&o.required?1:0):[]).filter(c=>!!(c.required&&!Object.values(n).includes(c.key))),S=()=>{a(""),l("sourceType")},b=!t||h||p.some(c=>{var o;return c.required&&!((o=j(c.key))!=null&&o.trim())});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(se,{children:"Required Properties"})})}),e.jsx(ie,{children:h?e.jsx(r,{style:{margin:"auto"},children:e.jsx(G,{color:B.SECONDARY_BLUE})}):e.jsx(r,{className:"input__wrapper",children:p==null?void 0:p.map(({key:c,required:o})=>e.jsx(e.Fragment,{children:e.jsxs(ce,{children:[e.jsx(z,{children:s(c)}),e.jsx(J,{id:"item-name",maxLength:50,name:c,placeholder:o?"Required":"Optional",rules:{...o?{...K,pattern:{message:"No leading whitespace allowed",value:X}}:{}}})]})}))})}),e.jsxs(r,{direction:"row",children:[e.jsx(r,{grow:1,children:e.jsx(E,{color:"secondary",onClick:S,size:"large",variant:"contained",children:"Prev"})}),e.jsx(r,{grow:1,ml:20,children:e.jsx(E,{color:"secondary",disabled:b,onClick:()=>l("createConfirmation"),size:"large",variant:"contained",children:"Next"})})]})]})},se=v(z)` +import{w as v,x as B,H as z,F as r,r as f,al as U,j as e,aU as J,aV as K,b9 as X,z as E,ba as $,a0 as Q,bb as Z,M as D,a1 as N,aT as O,aX as ee,a3 as te,bs as ne,bw as re}from"./index-4c5f8236.js";import{p as V}from"./index-d206d03e.js";import{C as G}from"./ClipLoader-601f6378.js";import{u as H}from"./index-a4caf8d5.js";import{A as W}from"./index-891a66a8.js";import{c as oe}from"./index-64f1c910.js";import"./three.module-d9fcef06.js";import"./Stack-7f131eb3.js";import"./createSvgIcon-2fe026f6.js";import"./TextareaAutosize-cc9b3a66.js";const q=a=>a.charAt(0).toUpperCase()+a.slice(1).replace(/_/g," "),k=a=>a?[...a].sort((l,x)=>Number(x.required)-Number(l.required)):[],Y=a=>a?a.filter(l=>l.key!=="node_key"):[],ae=({handleSelectType:a,skipToStep:l,nodeType:x,selectedValues:n})=>{const[h,w]=f.useState(!1),[m,C]=f.useState(),{watch:j,formState:{isValid:t}}=U();f.useEffect(()=>{(async()=>{w(!0);const o=await $(x),T=V(o),A=Y(T);C(A),w(!1)})()},[x,j]);const s=c=>c.charAt(0).toUpperCase()+c.slice(1).replace(/_/g," "),p=(m?[...m].sort((c,o)=>c.required&&!o.required?-1:!c.required&&o.required?1:0):[]).filter(c=>!!(c.required&&!Object.values(n).includes(c.key))),S=()=>{a(""),l("sourceType")},b=!t||h||p.some(c=>{var o;return c.required&&!((o=j(c.key))!=null&&o.trim())});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(se,{children:"Required Properties"})})}),e.jsx(ie,{children:h?e.jsx(r,{style:{margin:"auto"},children:e.jsx(G,{color:B.SECONDARY_BLUE})}):e.jsx(r,{className:"input__wrapper",children:p==null?void 0:p.map(({key:c,required:o})=>e.jsx(e.Fragment,{children:e.jsxs(ce,{children:[e.jsx(z,{children:s(c)}),e.jsx(J,{id:"item-name",maxLength:50,name:c,placeholder:o?"Required":"Optional",rules:{...o?{...K,pattern:{message:"No leading whitespace allowed",value:X}}:{}}})]})}))})}),e.jsxs(r,{direction:"row",children:[e.jsx(r,{grow:1,children:e.jsx(E,{color:"secondary",onClick:S,size:"large",variant:"contained",children:"Prev"})}),e.jsx(r,{grow:1,ml:20,children:e.jsx(E,{color:"secondary",disabled:b,onClick:()=>l("createConfirmation"),size:"large",variant:"contained",children:"Next"})})]})]})},se=v(z)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; diff --git a/build/assets/index-1dfdd521.js b/build/assets/index-6d84bf5a.js similarity index 85% rename from build/assets/index-1dfdd521.js rename to build/assets/index-6d84bf5a.js index 71e7a79bd..84266fd1a 100644 --- a/build/assets/index-1dfdd521.js +++ b/build/assets/index-6d84bf5a.js @@ -1 +1 @@ -import{t as f,bs as m}from"./index-16ff4e55.js";import{D as y}from"./constants-d7d823df.js";const c={data:null,ids:[],loading:!1,total:0,filters:{is_muted:!1,sortBy:y,page:0,pageSize:50}};let r=null;const S=f((a,n)=>({...c,setTopics:async()=>{a({loading:!0}),r&&r.abort();const t=new AbortController,{signal:p}=t;r=t;const{data:d,ids:g,filters:o}=n(),u=T(o);o.page===0&&a({data:null,ids:[],total:0});try{const e=await m(u,p),l=o.page===0?{}:{...d||{}},i=o.page===0?[]:[...g];e.data.forEach(s=>{l[s.ref_id]=s,i.push(s.ref_id)}),a({data:l,ids:i,total:e.totalCount}),a({loading:!1})}catch(e){console.log(e)}},setFilters:t=>a({filters:{...n().filters,page:0,...t}}),terminate:()=>a(c)})),T=a=>({muted:a.is_muted?"True":"False",skip:String(a.page*a.pageSize),limit:String(a.pageSize),sort_by:a.sortBy,...a.search?{search:a.search}:{node_type:"Topic"}});export{S as u}; +import{t as f,bs as m}from"./index-4c5f8236.js";import{D as y}from"./constants-ccce11dd.js";const c={data:null,ids:[],loading:!1,total:0,filters:{is_muted:!1,sortBy:y,page:0,pageSize:50}};let r=null;const S=f((a,n)=>({...c,setTopics:async()=>{a({loading:!0}),r&&r.abort();const t=new AbortController,{signal:p}=t;r=t;const{data:d,ids:g,filters:o}=n(),u=T(o);o.page===0&&a({data:null,ids:[],total:0});try{const e=await m(u,p),l=o.page===0?{}:{...d||{}},i=o.page===0?[]:[...g];e.data.forEach(s=>{l[s.ref_id]=s,i.push(s.ref_id)}),a({data:l,ids:i,total:e.totalCount}),a({loading:!1})}catch(e){console.log(e)}},setFilters:t=>a({filters:{...n().filters,page:0,...t}}),terminate:()=>a(c)})),T=a=>({muted:a.is_muted?"True":"False",skip:String(a.page*a.pageSize),limit:String(a.pageSize),sort_by:a.sortBy,...a.search?{search:a.search}:{node_type:"Topic"}});export{S as u}; diff --git a/build/assets/index-a71e4c22.js b/build/assets/index-7fd57bd5.js similarity index 94% rename from build/assets/index-a71e4c22.js rename to build/assets/index-7fd57bd5.js index 7d338c609..2829fd6f7 100644 --- a/build/assets/index-a71e4c22.js +++ b/build/assets/index-7fd57bd5.js @@ -1,4 +1,4 @@ -import{r as y,c as _o,d as jo,s as Wt,e as oe,u as Oo,q as Ei,a as Po,j as p,h as To,bx as En,by as gr,i as $o,k as bt,f as Zr,ah as Ci,ai as Si,w as O,x as j,a1 as br,bc as _i,bb as xr,H as _e,F as $,aU as hn,aV as gn,b9 as ji,z as Cn,bz as Oi,bA as Hn,a3 as Ao,bB as Pi,C as mr,bC as Ti,b as c,D as vr,ak as Qr,bD as $i,al as Ai,bE as Jr,bF as Mo,ba as ko,M as Ro,bG as Mi,aT as gt,ac as ar,G as yr,a2 as ki,ar as ea,aX as Ri}from"./index-16ff4e55.js";import{A as Dt}from"./index-f0acd212.js";import{C as Ie}from"./ClipLoader-049391dc.js";import{P as E,I as or,an as Bi,D as Fi,s as Bo,aS as Ni,n as ta,m as na,l as ra,k as aa,j as Ii,aT as Di,aU as Hi}from"./index-04a82be1.js";import{S as zi,j as Li,p as Gi,q as Wi,r as Ui,m as Vi,F as Yi}from"./map-b1c613ac.js";import{T as Xi,a as Ki}from"./Tabs-0da0e37b.js";import{p as ir,c as qi,g as Zi}from"./index-d206d03e.js";import{e as Qi}from"./Stack-25a86e54.js";import{f as Ji,m as es,u as me,a as Sn,t as sr,T as Fo,h as No,l as ts,H as ns,i as oa,C as rs,j as as,k as os}from"./index-710d3c1e.js";import{R as is,u as ss,v as ls,V as G,w as qe,x as Ze,Q as ia,y as ln,O as cn,z as sa,b as de,A as cs,n as us,C as ps}from"./three.module-d9fcef06.js";import"./createSvgIcon-e167cb2e.js";import"./TextareaAutosize-e1814669.js";import"./Typography-76a3ec92.js";const ds=y.createContext(),la=ds;function fs(t){return _o("MuiGrid",t)}const hs=[0,1,2,3,4,5,6,7,8,9,10],gs=["column-reverse","column","row-reverse","row"],bs=["nowrap","wrap-reverse","wrap"],Mt=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],xs=jo("MuiGrid",["root","container","item","zeroMinWidth",...hs.map(t=>`spacing-xs-${t}`),...gs.map(t=>`direction-xs-${t}`),...bs.map(t=>`wrap-xs-${t}`),...Mt.map(t=>`grid-xs-${t}`),...Mt.map(t=>`grid-sm-${t}`),...Mt.map(t=>`grid-md-${t}`),...Mt.map(t=>`grid-lg-${t}`),...Mt.map(t=>`grid-xl-${t}`)]),zt=xs,ms=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function xt(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function vs({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,a)=>{let o={};if(e[a]&&(n=e[a]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=En({values:e.columns,breakpoints:t.breakpoints.values}),i=typeof s=="object"?s[a]:s;if(i==null)return r;const l=`${Math.round(n/i*1e8)/1e6}%`;let u={};if(e.container&&e.item&&e.columnSpacing!==0){const d=t.spacing(e.columnSpacing);if(d!=="0px"){const f=`calc(${l} + ${xt(d)})`;u={flexBasis:f,maxWidth:f}}}o=oe({flexBasis:l,flexGrow:0,maxWidth:l},u)}return t.breakpoints.values[a]===0?Object.assign(r,o):r[t.breakpoints.up(a)]=o,r},{})}function ys({theme:t,ownerState:e}){const n=En({values:e.direction,breakpoints:t.breakpoints.values});return gr({theme:t},n,r=>{const a={flexDirection:r};return r.indexOf("column")===0&&(a[`& > .${zt.item}`]={maxWidth:"none"}),a})}function Io({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(a=>{n===""&&e[a]!==0&&(n=a)});const r=Object.keys(t).sort((a,o)=>t[a]-t[o]);return r.slice(0,r.indexOf(n))}function ws({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let a={};if(n&&r!==0){const o=En({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=Io({breakpoints:t.breakpoints.values,values:o})),a=gr({theme:t},o,(i,l)=>{var u;const d=t.spacing(i);return d!=="0px"?{marginTop:`-${xt(d)}`,[`& > .${zt.item}`]:{paddingTop:xt(d)}}:(u=s)!=null&&u.includes(l)?{}:{marginTop:0,[`& > .${zt.item}`]:{paddingTop:0}}})}return a}function Es({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let a={};if(n&&r!==0){const o=En({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=Io({breakpoints:t.breakpoints.values,values:o})),a=gr({theme:t},o,(i,l)=>{var u;const d=t.spacing(i);return d!=="0px"?{width:`calc(100% + ${xt(d)})`,marginLeft:`-${xt(d)}`,[`& > .${zt.item}`]:{paddingLeft:xt(d)}}:(u=s)!=null&&u.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${zt.item}`]:{paddingLeft:0}}})}return a}function Cs(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(a=>{const o=t[a];Number(o)>0&&r.push(n[`spacing-${a}-${String(o)}`])}),r}const Ss=Wt("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:a,item:o,spacing:s,wrap:i,zeroMinWidth:l,breakpoints:u}=n;let d=[];r&&(d=Cs(s,u,e));const f=[];return u.forEach(h=>{const g=n[h];g&&f.push(e[`grid-${h}-${String(g)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...d,a!=="row"&&e[`direction-xs-${String(a)}`],i!=="wrap"&&e[`wrap-xs-${String(i)}`],...f]}})(({ownerState:t})=>oe({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}),ys,ws,Es,vs);function _s(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const a=t[r];if(Number(a)>0){const o=`spacing-${r}-${String(a)}`;n.push(o)}}),n}const js=t=>{const{classes:e,container:n,direction:r,item:a,spacing:o,wrap:s,zeroMinWidth:i,breakpoints:l}=t;let u=[];n&&(u=_s(o,l));const d=[];l.forEach(h=>{const g=t[h];g&&d.push(`grid-${h}-${String(g)}`)});const f={root:["root",n&&"container",a&&"item",i&&"zeroMinWidth",...u,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...d]};return $o(f,fs,e)},Os=y.forwardRef(function(e,n){const r=Oo({props:e,name:"MuiGrid"}),{breakpoints:a}=Ei(),o=Qi(r),{className:s,columns:i,columnSpacing:l,component:u="div",container:d=!1,direction:f="row",item:h=!1,rowSpacing:g,spacing:x=0,wrap:m="wrap",zeroMinWidth:v=!1}=o,w=Po(o,ms),_=g||x,B=l||x,P=y.useContext(la),T=d?i||12:P,M={},L=oe({},w);a.keys.forEach(S=>{w[S]!=null&&(M[S]=w[S],delete L[S])});const H=oe({},o,{columns:T,container:d,direction:f,item:h,rowSpacing:_,columnSpacing:B,wrap:m,zeroMinWidth:v,spacing:x},M,{breakpoints:a.keys}),V=js(H);return p.jsx(la.Provider,{value:T,children:p.jsx(Ss,oe({ownerState:H,className:To(V.root,s),as:u,ref:n},L))})}),je=Os;function Ps(t){return _o("MuiSwitch",t)}const Ts=jo("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),J=Ts,$s=["className","color","edge","size","sx"],As=t=>{const{classes:e,edge:n,size:r,color:a,checked:o,disabled:s}=t,i={root:["root",n&&`edge${bt(n)}`,`size${bt(r)}`],switchBase:["switchBase",`color${bt(a)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=$o(i,Ps,e);return oe({},e,l)},Ms=Wt("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${bt(n.edge)}`],e[`size${bt(n.size)}`]]}})(({ownerState:t})=>oe({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,[`& .${J.thumb}`]:{width:16,height:16},[`& .${J.switchBase}`]:{padding:4,[`&.${J.checked}`]:{transform:"translateX(16px)"}}})),ks=Wt(zi,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${J.input}`]:e.input},n.color!=="default"&&e[`color${bt(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}),[`&.${J.checked}`]:{transform:"translateX(20px)"},[`&.${J.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${J.checked} + .${J.track}`]:{opacity:.5},[`&.${J.disabled} + .${J.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${J.input}`]:{left:"-100%",width:"300%"}}),({theme:t,ownerState:e})=>oe({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Zr(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${J.checked}`]:{color:(t.vars||t).palette[e.color].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Zr(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${J.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e.color}DisabledColor`]:`${t.palette.mode==="light"?Ci(t.palette[e.color].main,.62):Si(t.palette[e.color].main,.55)}`}},[`&.${J.checked} + .${J.track}`]:{backgroundColor:(t.vars||t).palette[e.color].main}})),Rs=Wt("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.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}`})),Bs=Wt("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),Fs=y.forwardRef(function(e,n){const r=Oo({props:e,name:"MuiSwitch"}),{className:a,color:o="primary",edge:s=!1,size:i="medium",sx:l}=r,u=Po(r,$s),d=oe({},r,{color:o,edge:s,size:i}),f=As(d),h=p.jsx(Bs,{className:f.thumb,ownerState:d});return p.jsxs(Ms,{className:To(f.root,a),sx:l,ownerState:d,children:[p.jsx(ks,oe({type:"checkbox",icon:h,checkedIcon:h,ref:n,ownerState:d},u,{classes:oe({},f,{root:f.switchBase})})),p.jsx(Rs,{className:f.track,ownerState:d})]})}),Do=Fs,Ns={type:"",parent:""},ca=({onSelect:t,dataTestId:e,edgeLink:n,hideSelectAll:r,placeholder:a})=>{const o=br({mode:"onChange",defaultValues:Ns}),{watch:s,setValue:i}=o,[l,u]=y.useState([]),[d,f]=y.useState(!1),h=v=>{i("parent",(v==null?void 0:v.value)||""),t(v==null?void 0:v.value)},g=v=>v.charAt(0).toUpperCase()+v.slice(1);y.useEffect(()=>{(async()=>{f(!0);try{const _=(await xr()).schemas.filter(P=>!P.is_deleted&&P.type).map(P=>P.type==="thing"?{label:"No Parent",value:P.type}:{label:g(P.type),value:P.type}).filter((P,T,M)=>T===M.findIndex(L=>L.value===P.value));u(r?_:[{label:"Select all",value:"all"},..._]),n&&i("parent",n)}catch(w){console.warn(w)}finally{f(!1)}})()},[n,i,r]);const x=s("parent"),m=()=>{const v=l==null?void 0:l.find(w=>w.value===x);if(v)return v;if(n)return{label:n,value:n}};return p.jsx(Is,{dataTestId:e,disabled:!!n,isLoading:d,onSelect:h,options:l||_i,placeholder:a,selectedValue:m()})},Is=O(Dt)` +import{r as y,c as _o,d as jo,s as Wt,e as oe,u as Oo,q as Ei,a as Po,j as p,h as To,bx as En,by as gr,i as $o,k as bt,f as Zr,ah as Ci,ai as Si,w as O,x as j,a1 as br,bc as _i,bb as xr,H as _e,F as $,aU as hn,aV as gn,b9 as ji,z as Cn,bz as Oi,bA as Hn,a3 as Ao,bB as Pi,C as mr,bC as Ti,b as c,D as vr,ak as Qr,bD as $i,al as Ai,bE as Jr,bF as Mo,ba as ko,M as Ro,bG as Mi,aT as gt,ac as ar,G as yr,a2 as ki,ar as ea,aX as Ri}from"./index-4c5f8236.js";import{A as Dt}from"./index-891a66a8.js";import{C as Ie}from"./ClipLoader-601f6378.js";import{P as E,I as or,al as Bi,D as Fi,q as Bo,aQ as Ni,k as ta,aR as na,aS as ra,l as aa,j as Ii,aT as Di,aU as Hi}from"./index-a4caf8d5.js";import{S as zi,j as Li,p as Gi,q as Wi,r as Ui,m as Vi,F as Yi}from"./map-76fdca3a.js";import{T as Xi,a as Ki}from"./Tabs-02e36f7f.js";import{p as ir,c as qi,g as Zi}from"./index-d206d03e.js";import{e as Qi}from"./Stack-7f131eb3.js";import{f as Ji,m as es,u as me,a as Sn,t as sr,T as Fo,h as No,l as ts,H as ns,i as oa,C as rs,j as as,k as os}from"./index-8f6ab1fe.js";import{R as is,u as ss,v as ls,V as G,w as qe,x as Ze,Q as ia,y as ln,O as cn,z as sa,b as de,A as cs,n as us,C as ps}from"./three.module-d9fcef06.js";import"./createSvgIcon-2fe026f6.js";import"./TextareaAutosize-cc9b3a66.js";import"./Typography-50924238.js";const ds=y.createContext(),la=ds;function fs(t){return _o("MuiGrid",t)}const hs=[0,1,2,3,4,5,6,7,8,9,10],gs=["column-reverse","column","row-reverse","row"],bs=["nowrap","wrap-reverse","wrap"],Mt=["auto",!0,1,2,3,4,5,6,7,8,9,10,11,12],xs=jo("MuiGrid",["root","container","item","zeroMinWidth",...hs.map(t=>`spacing-xs-${t}`),...gs.map(t=>`direction-xs-${t}`),...bs.map(t=>`wrap-xs-${t}`),...Mt.map(t=>`grid-xs-${t}`),...Mt.map(t=>`grid-sm-${t}`),...Mt.map(t=>`grid-md-${t}`),...Mt.map(t=>`grid-lg-${t}`),...Mt.map(t=>`grid-xl-${t}`)]),zt=xs,ms=["className","columns","columnSpacing","component","container","direction","item","rowSpacing","spacing","wrap","zeroMinWidth"];function xt(t){const e=parseFloat(t);return`${e}${String(t).replace(String(e),"")||"px"}`}function vs({theme:t,ownerState:e}){let n;return t.breakpoints.keys.reduce((r,a)=>{let o={};if(e[a]&&(n=e[a]),!n)return r;if(n===!0)o={flexBasis:0,flexGrow:1,maxWidth:"100%"};else if(n==="auto")o={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"};else{const s=En({values:e.columns,breakpoints:t.breakpoints.values}),i=typeof s=="object"?s[a]:s;if(i==null)return r;const l=`${Math.round(n/i*1e8)/1e6}%`;let u={};if(e.container&&e.item&&e.columnSpacing!==0){const d=t.spacing(e.columnSpacing);if(d!=="0px"){const f=`calc(${l} + ${xt(d)})`;u={flexBasis:f,maxWidth:f}}}o=oe({flexBasis:l,flexGrow:0,maxWidth:l},u)}return t.breakpoints.values[a]===0?Object.assign(r,o):r[t.breakpoints.up(a)]=o,r},{})}function ys({theme:t,ownerState:e}){const n=En({values:e.direction,breakpoints:t.breakpoints.values});return gr({theme:t},n,r=>{const a={flexDirection:r};return r.indexOf("column")===0&&(a[`& > .${zt.item}`]={maxWidth:"none"}),a})}function Io({breakpoints:t,values:e}){let n="";Object.keys(e).forEach(a=>{n===""&&e[a]!==0&&(n=a)});const r=Object.keys(t).sort((a,o)=>t[a]-t[o]);return r.slice(0,r.indexOf(n))}function ws({theme:t,ownerState:e}){const{container:n,rowSpacing:r}=e;let a={};if(n&&r!==0){const o=En({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=Io({breakpoints:t.breakpoints.values,values:o})),a=gr({theme:t},o,(i,l)=>{var u;const d=t.spacing(i);return d!=="0px"?{marginTop:`-${xt(d)}`,[`& > .${zt.item}`]:{paddingTop:xt(d)}}:(u=s)!=null&&u.includes(l)?{}:{marginTop:0,[`& > .${zt.item}`]:{paddingTop:0}}})}return a}function Es({theme:t,ownerState:e}){const{container:n,columnSpacing:r}=e;let a={};if(n&&r!==0){const o=En({values:r,breakpoints:t.breakpoints.values});let s;typeof o=="object"&&(s=Io({breakpoints:t.breakpoints.values,values:o})),a=gr({theme:t},o,(i,l)=>{var u;const d=t.spacing(i);return d!=="0px"?{width:`calc(100% + ${xt(d)})`,marginLeft:`-${xt(d)}`,[`& > .${zt.item}`]:{paddingLeft:xt(d)}}:(u=s)!=null&&u.includes(l)?{}:{width:"100%",marginLeft:0,[`& > .${zt.item}`]:{paddingLeft:0}}})}return a}function Cs(t,e,n={}){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[n[`spacing-xs-${String(t)}`]];const r=[];return e.forEach(a=>{const o=t[a];Number(o)>0&&r.push(n[`spacing-${a}-${String(o)}`])}),r}const Ss=Wt("div",{name:"MuiGrid",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t,{container:r,direction:a,item:o,spacing:s,wrap:i,zeroMinWidth:l,breakpoints:u}=n;let d=[];r&&(d=Cs(s,u,e));const f=[];return u.forEach(h=>{const g=n[h];g&&f.push(e[`grid-${h}-${String(g)}`])}),[e.root,r&&e.container,o&&e.item,l&&e.zeroMinWidth,...d,a!=="row"&&e[`direction-xs-${String(a)}`],i!=="wrap"&&e[`wrap-xs-${String(i)}`],...f]}})(({ownerState:t})=>oe({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}),ys,ws,Es,vs);function _s(t,e){if(!t||t<=0)return[];if(typeof t=="string"&&!Number.isNaN(Number(t))||typeof t=="number")return[`spacing-xs-${String(t)}`];const n=[];return e.forEach(r=>{const a=t[r];if(Number(a)>0){const o=`spacing-${r}-${String(a)}`;n.push(o)}}),n}const js=t=>{const{classes:e,container:n,direction:r,item:a,spacing:o,wrap:s,zeroMinWidth:i,breakpoints:l}=t;let u=[];n&&(u=_s(o,l));const d=[];l.forEach(h=>{const g=t[h];g&&d.push(`grid-${h}-${String(g)}`)});const f={root:["root",n&&"container",a&&"item",i&&"zeroMinWidth",...u,r!=="row"&&`direction-xs-${String(r)}`,s!=="wrap"&&`wrap-xs-${String(s)}`,...d]};return $o(f,fs,e)},Os=y.forwardRef(function(e,n){const r=Oo({props:e,name:"MuiGrid"}),{breakpoints:a}=Ei(),o=Qi(r),{className:s,columns:i,columnSpacing:l,component:u="div",container:d=!1,direction:f="row",item:h=!1,rowSpacing:g,spacing:x=0,wrap:m="wrap",zeroMinWidth:v=!1}=o,w=Po(o,ms),_=g||x,B=l||x,P=y.useContext(la),T=d?i||12:P,M={},L=oe({},w);a.keys.forEach(S=>{w[S]!=null&&(M[S]=w[S],delete L[S])});const H=oe({},o,{columns:T,container:d,direction:f,item:h,rowSpacing:_,columnSpacing:B,wrap:m,zeroMinWidth:v,spacing:x},M,{breakpoints:a.keys}),V=js(H);return p.jsx(la.Provider,{value:T,children:p.jsx(Ss,oe({ownerState:H,className:To(V.root,s),as:u,ref:n},L))})}),je=Os;function Ps(t){return _o("MuiSwitch",t)}const Ts=jo("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),J=Ts,$s=["className","color","edge","size","sx"],As=t=>{const{classes:e,edge:n,size:r,color:a,checked:o,disabled:s}=t,i={root:["root",n&&`edge${bt(n)}`,`size${bt(r)}`],switchBase:["switchBase",`color${bt(a)}`,o&&"checked",s&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=$o(i,Ps,e);return oe({},e,l)},Ms=Wt("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.edge&&e[`edge${bt(n.edge)}`],e[`size${bt(n.size)}`]]}})(({ownerState:t})=>oe({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,[`& .${J.thumb}`]:{width:16,height:16},[`& .${J.switchBase}`]:{padding:4,[`&.${J.checked}`]:{transform:"translateX(16px)"}}})),ks=Wt(zi,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.switchBase,{[`& .${J.input}`]:e.input},n.color!=="default"&&e[`color${bt(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}),[`&.${J.checked}`]:{transform:"translateX(20px)"},[`&.${J.disabled}`]:{color:t.vars?t.vars.palette.Switch.defaultDisabledColor:`${t.palette.mode==="light"?t.palette.grey[100]:t.palette.grey[600]}`},[`&.${J.checked} + .${J.track}`]:{opacity:.5},[`&.${J.disabled} + .${J.track}`]:{opacity:t.vars?t.vars.opacity.switchTrackDisabled:`${t.palette.mode==="light"?.12:.2}`},[`& .${J.input}`]:{left:"-100%",width:"300%"}}),({theme:t,ownerState:e})=>oe({"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette.action.activeChannel} / ${t.vars.palette.action.hoverOpacity})`:Zr(t.palette.action.active,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},e.color!=="default"&&{[`&.${J.checked}`]:{color:(t.vars||t).palette[e.color].main,"&:hover":{backgroundColor:t.vars?`rgba(${t.vars.palette[e.color].mainChannel} / ${t.vars.palette.action.hoverOpacity})`:Zr(t.palette[e.color].main,t.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${J.disabled}`]:{color:t.vars?t.vars.palette.Switch[`${e.color}DisabledColor`]:`${t.palette.mode==="light"?Ci(t.palette[e.color].main,.62):Si(t.palette[e.color].main,.55)}`}},[`&.${J.checked} + .${J.track}`]:{backgroundColor:(t.vars||t).palette[e.color].main}})),Rs=Wt("span",{name:"MuiSwitch",slot:"Track",overridesResolver:(t,e)=>e.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}`})),Bs=Wt("span",{name:"MuiSwitch",slot:"Thumb",overridesResolver:(t,e)=>e.thumb})(({theme:t})=>({boxShadow:(t.vars||t).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"})),Fs=y.forwardRef(function(e,n){const r=Oo({props:e,name:"MuiSwitch"}),{className:a,color:o="primary",edge:s=!1,size:i="medium",sx:l}=r,u=Po(r,$s),d=oe({},r,{color:o,edge:s,size:i}),f=As(d),h=p.jsx(Bs,{className:f.thumb,ownerState:d});return p.jsxs(Ms,{className:To(f.root,a),sx:l,ownerState:d,children:[p.jsx(ks,oe({type:"checkbox",icon:h,checkedIcon:h,ref:n,ownerState:d},u,{classes:oe({},f,{root:f.switchBase})})),p.jsx(Rs,{className:f.track,ownerState:d})]})}),Do=Fs,Ns={type:"",parent:""},ca=({onSelect:t,dataTestId:e,edgeLink:n,hideSelectAll:r,placeholder:a})=>{const o=br({mode:"onChange",defaultValues:Ns}),{watch:s,setValue:i}=o,[l,u]=y.useState([]),[d,f]=y.useState(!1),h=v=>{i("parent",(v==null?void 0:v.value)||""),t(v==null?void 0:v.value)},g=v=>v.charAt(0).toUpperCase()+v.slice(1);y.useEffect(()=>{(async()=>{f(!0);try{const _=(await xr()).schemas.filter(P=>!P.is_deleted&&P.type).map(P=>P.type==="thing"?{label:"No Parent",value:P.type}:{label:g(P.type),value:P.type}).filter((P,T,M)=>T===M.findIndex(L=>L.value===P.value));u(r?_:[{label:"Select all",value:"all"},..._]),n&&i("parent",n)}catch(w){console.warn(w)}finally{f(!1)}})()},[n,i,r]);const x=s("parent"),m=()=>{const v=l==null?void 0:l.find(w=>w.value===x);if(v)return v;if(n)return{label:n,value:n}};return p.jsx(Is,{dataTestId:e,disabled:!!n,isLoading:d,onSelect:h,options:l||_i,placeholder:a,selectedValue:m()})},Is=O(Dt)` .MuiInputBase-input { font-family: Barlow; font-size: 14px; diff --git a/build/assets/index-e2c4ec69.js b/build/assets/index-81fe6815.js similarity index 83% rename from build/assets/index-e2c4ec69.js rename to build/assets/index-81fe6815.js index 5a758f003..4a2e25d22 100644 --- a/build/assets/index-e2c4ec69.js +++ b/build/assets/index-81fe6815.js @@ -1,4 +1,4 @@ -import{w as c,x as b,H as E,F as s,M as x,a0 as O,r as l,j as e,aU as V,aV as W,a1 as P,a3 as k,z as F,bs as q,bq as G,v as H,aX as Q}from"./index-16ff4e55.js";import{u as I,T as X,aQ as Y}from"./index-04a82be1.js";import{S as J}from"./Skeleton-96227392.js";import{C as K}from"./ClipLoader-049391dc.js";const Z=/^https:\/\/\S+\.(png|jpe?g|svg)$/;function ee(r){return!!Z.test(r)}function te(r){return r.split("_").map(d=>d.charAt(0).toUpperCase()+d.slice(1)).join(" ")}const ae=()=>{const{open:r}=x("changeNodeType"),{close:d}=x("editNodeName"),{changeNodeTypeFeatureFlag:f}=O(o=>({changeNodeTypeFeatureFlag:o.changeNodeTypeFeatureFlag})),a=I(),j=a==null?void 0:a.node_type,[m,u]=l.useState({});l.useEffect(()=>{a!=null&&a.properties&&u(a.properties)},[a]);const y=()=>{d(),r()},g=(o,n)=>{u(N=>({...N,[o]:n}))};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(oe,{children:"Edit Node"}),e.jsxs(se,{children:[e.jsx(X,{type:j}),f&&e.jsx(re,{onClick:y,children:e.jsx(Y,{})})]})]})}),e.jsx(ie,{children:Object.keys(m).map(o=>e.jsxs(s,{mb:18,children:[e.jsx(ne,{style:{marginBottom:8},children:te(o)}),e.jsx(V,{id:`cy-${o}`,maxLength:50,name:`properties.${o}`,onChange:n=>g(o,n),placeholder:`Please Enter the ${o}`,rules:o==="name"?{...W}:{}})]},o))})]})},oe=c(E)` +import{w as c,x as b,H as E,F as s,M as x,a0 as A,r as l,j as e,aU as V,aV as W,a1 as P,a3 as k,z as F,bs as q,bq as G,v as H,aX as X}from"./index-4c5f8236.js";import{u as I,T as Y,aO as J}from"./index-a4caf8d5.js";import{S as K}from"./Skeleton-7bdfc65c.js";import{C as Q}from"./ClipLoader-601f6378.js";const Z=/^https:\/\/\S+\.(png|jpe?g|svg)$/;function ee(r){return!!Z.test(r)}function te(r){return r.split("_").map(d=>d.charAt(0).toUpperCase()+d.slice(1)).join(" ")}const ae=()=>{const{open:r}=x("changeNodeType"),{close:d}=x("editNodeName"),{changeNodeTypeFeatureFlag:f}=A(o=>({changeNodeTypeFeatureFlag:o.changeNodeTypeFeatureFlag})),a=I(),j=a==null?void 0:a.node_type,[m,u]=l.useState({});l.useEffect(()=>{a!=null&&a.properties&&u(a.properties)},[a]);const y=()=>{d(),r()},g=(o,n)=>{u(N=>({...N,[o]:n}))};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(oe,{children:"Edit Node"}),e.jsxs(se,{children:[e.jsx(Y,{type:j}),f&&e.jsx(re,{onClick:y,children:e.jsx(J,{})})]})]})}),e.jsx(ie,{children:Object.keys(m).map(o=>e.jsxs(s,{mb:18,children:[e.jsx(ne,{style:{marginBottom:8},children:te(o)}),e.jsx(V,{id:`cy-${o}`,maxLength:50,name:`properties.${o}`,onChange:n=>g(o,n),placeholder:`Please Enter the ${o}`,rules:o==="name"?{...W}:{}})]},o))})]})},oe=c(E)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; @@ -23,7 +23,7 @@ import{w as c,x as b,H as E,F as s,M as x,a0 as O,r as l,j as e,aU as V,aV as W, overflow-y: auto; padding-right: 40px; width: calc(100% + 40px); -`,ce=()=>{var v,w,S;const{close:r}=x("editNodeName"),d=P({mode:"onChange"}),{watch:f,setValue:a,reset:j,getValues:m}=d,[u,y]=l.useState(!1),[g,o]=l.useState(!1),[n,N]=l.useState(),t=I(),{open:B}=x("removeNode");l.useEffect(()=>(n?Object.keys(n).forEach(i=>{a(i,n[i])}):t&&Object.keys(t).forEach(i=>{a(i,t[i])}),()=>{j()}),[n,a,j,t]),l.useEffect(()=>{(async()=>{if(!(!t||t.type!=="topic")){o(!0);try{const{data:p}=await q({search:t==null?void 0:t.name}),U=p.find(A=>A.name===t.name);N(U)}catch(p){console.log(p)}finally{o(!1)}}})()},[t]);const D=f("imageInputType"),C=f("image_url");l.useEffect(()=>{a("imageInputType",ee(C))},[C,a]);const L=()=>{r()},h=n||t,_=async()=>{y(!0);const i=m();try{await G((h==null?void 0:h.ref_id)||"",{node_data:i});const{updateNode:p}=H.getState();p({...h,...i}),L()}catch(p){console.warn(p)}finally{y(!1)}},R=async()=>{B()},T=(w=(v=m())==null?void 0:v.name)==null?void 0:w.trim(),$=T&&(n==null?void 0:n.name.trim())!==T,z=m().image_url&&(t==null?void 0:t.image_url)!==((S=m())==null?void 0:S.image_url),M=u||g||!!C&&!D||!$&&!z;return e.jsx(le,{children:e.jsxs(k,{...d,children:[g?e.jsx(s,{my:24,children:e.jsx(J,{})}):e.jsx(ae,{}),e.jsxs(s,{direction:"row",justify:"space-between",mt:20,children:[e.jsx(s,{direction:"column",children:e.jsx(de,{color:"secondary",disabled:g||!h,onClick:R,size:"large",variant:"contained",children:"Delete"})}),e.jsxs(me,{color:"secondary",disabled:M,onClick:_,size:"large",variant:"contained",children:["Save Changes",u&&e.jsx(pe,{children:e.jsx(K,{color:b.lightGray,size:12})})]})]})]})})},le=c(s)` +`,ce=()=>{var v,w,S;const{close:r}=x("editNodeName"),d=P({mode:"onChange"}),{watch:f,setValue:a,reset:j,getValues:m}=d,[u,y]=l.useState(!1),[g,o]=l.useState(!1),[n,N]=l.useState(),t=I(),{open:B}=x("removeNode");l.useEffect(()=>(n?Object.keys(n).forEach(i=>{a(i,n[i])}):t&&Object.keys(t).forEach(i=>{a(i,t[i])}),()=>{j()}),[n,a,j,t]),l.useEffect(()=>{(async()=>{if(!(!t||t.type!=="topic")){o(!0);try{const{data:p}=await q({search:t==null?void 0:t.name}),U=p.find(O=>O.name===t.name);N(U)}catch(p){console.log(p)}finally{o(!1)}}})()},[t]);const D=f("imageInputType"),C=f("image_url");l.useEffect(()=>{a("imageInputType",ee(C))},[C,a]);const L=()=>{r()},h=n||t,_=async()=>{y(!0);const i=m();try{await G((h==null?void 0:h.ref_id)||"",{node_data:i});const{updateNode:p}=H.getState();p({...h,...i}),L()}catch(p){console.warn(p)}finally{y(!1)}},R=async()=>{B()},T=(w=(v=m())==null?void 0:v.name)==null?void 0:w.trim(),$=T&&(n==null?void 0:n.name.trim())!==T,z=m().image_url&&(t==null?void 0:t.image_url)!==((S=m())==null?void 0:S.image_url),M=u||g||!!C&&!D||!$&&!z;return e.jsx(le,{children:e.jsxs(k,{...d,children:[g?e.jsx(s,{my:24,children:e.jsx(K,{})}):e.jsx(ae,{}),e.jsxs(s,{direction:"row",justify:"space-between",mt:20,children:[e.jsx(s,{direction:"column",children:e.jsx(de,{color:"secondary",disabled:g||!h,onClick:R,size:"large",variant:"contained",children:"Delete"})}),e.jsxs(me,{color:"secondary",disabled:M,onClick:_,size:"large",variant:"contained",children:["Save Changes",u&&e.jsx(pe,{children:e.jsx(Q,{color:b.lightGray,size:12})})]})]})]})})},le=c(s)` padding: 20px; `,de=c(F)` && { @@ -44,4 +44,4 @@ import{w as c,x as b,H as E,F as s,M as x,a0 as O,r as l,j as e,aU as V,aV as W, `,me=c(F)` width: 80% !important; margin: 0 auto !important; -`,fe=()=>{const{close:r}=x("editNodeName");return e.jsx(Q,{id:"editNodeName",kind:"regular",onClose:r,preventOutsideClose:!0,children:e.jsx(ce,{})})};export{fe as EditNodeNameModal}; +`,fe=()=>{const{close:r}=x("editNodeName");return e.jsx(X,{id:"editNodeName",kind:"regular",onClose:r,preventOutsideClose:!0,children:e.jsx(ce,{})})};export{fe as EditNodeNameModal}; diff --git a/build/assets/index-f0acd212.js b/build/assets/index-891a66a8.js similarity index 94% rename from build/assets/index-f0acd212.js rename to build/assets/index-891a66a8.js index 8635e5902..5873e53fc 100644 --- a/build/assets/index-f0acd212.js +++ b/build/assets/index-891a66a8.js @@ -1,4 +1,4 @@ -import{r as u,j as f,bY as kt,bZ as Rt,p as xo,n as Ot,e as a,c as ye,d as $e,s as L,k as w,u as Pe,a as ae,h as ne,i as Ie,f as Re,l as lo,B as Uo,b_ as wt,b$ as Lt,m as st,c0 as it,bu as ct,bv as dt,ag as Xe,c1 as To,q as Mt,aj as Ft,w as Tt,x as je,F as At}from"./index-16ff4e55.js";import{Q as Ho,an as ut,aF as pt,aX as Nt,y as Fo,v as zt,aY as Dt,U as Vo,T as Et}from"./index-04a82be1.js";import{a as Ao,u as fo,b as so,f as io,i as ft,c as Bt,P as No,F as jt,S as Wt}from"./Stack-25a86e54.js";import{c as zo}from"./createSvgIcon-e167cb2e.js";import{T as _t}from"./TextareaAutosize-e1814669.js";const Ut=e=>{const o=u.useRef({});return u.useEffect(()=>{o.current=e}),o.current},Ht=Ut;function Vt(e){return e==null||Object.keys(e).length===0}function Kt(e){const{styles:o,defaultTheme:t={}}=e,r=typeof o=="function"?s=>o(Vt(s)?t:s):o;return f.jsx(kt,{styles:r})}function qt({styles:e,themeId:o,defaultTheme:t={}}){const r=Rt(t),s=typeof e=="function"?e(o&&r[o]||r):e;return f.jsx(Kt,{styles:s})}const Gt=zo(f.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 Ko(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function Xt(e={}){const{ignoreAccents:o=!0,ignoreCase:t=!0,limit:r,matchFrom:s="any",stringify:c,trim:d=!1}=e;return(i,{inputValue:b,getOptionLabel:p})=>{let m=d?b.trim():b;t&&(m=m.toLowerCase()),o&&(m=Ko(m));const h=m?i.filter($=>{let v=(c||p)($);return t&&(v=v.toLowerCase()),o&&(v=Ko(v)),s==="start"?v.indexOf(m)===0:v.indexOf(m)>-1}):i;return typeof r=="number"?h.slice(0,r):h}}function Lo(e,o){for(let t=0;t{var o;return e.current!==null&&((o=e.current.parentElement)==null?void 0:o.contains(document.activeElement))};function Qt(e){const{unstable_isActiveElementInListbox:o=Zt,unstable_classNamePrefix:t="Mui",autoComplete:r=!1,autoHighlight:s=!1,autoSelect:c=!1,blurOnSelect:d=!1,clearOnBlur:i=!e.freeSolo,clearOnEscape:b=!1,componentName:p="useAutocomplete",defaultValue:m=e.multiple?[]:null,disableClearable:h=!1,disableCloseOnSelect:$=!1,disabled:v,disabledItemsFocusable:R=!1,disableListWrap:M=!1,filterOptions:P=Yt,filterSelectedOptions:O=!1,freeSolo:k=!1,getOptionDisabled:C,getOptionKey:I,getOptionLabel:E=l=>{var n;return(n=l.label)!=null?n:l},groupBy:N,handleHomeEndKeys:F=!e.freeSolo,id:q,includeInputInList:le=!1,inputValue:de,isOptionEqualToValue:oe=(l,n)=>l===n,multiple:T=!1,onChange:Q,onClose:G,onHighlightChange:se,onInputChange:J,onOpen:re,open:U,openOnFocus:A=!1,options:ie,readOnly:Se=!1,selectOnFocus:Le=!e.freeSolo,value:ue}=e,W=Ao(q);let ee=E;ee=l=>{const n=E(l);return typeof n!="string"?String(n):n};const fe=u.useRef(!1),We=u.useRef(!0),Z=u.useRef(null),be=u.useRef(null),[Me,Y]=u.useState(null),[H,ze]=u.useState(-1),_e=s?0:-1,te=u.useRef(_e),[S,to]=fo({controlled:ue,default:m,name:p}),[_,xe]=fo({controlled:de,default:"",name:p,state:"inputValue"}),[Fe,ce]=u.useState(!1),Te=u.useCallback((l,n)=>{if(!(T?S.length!(O&&(T?S:[S]).some(n=>n!==null&&oe(l,n)))),{inputValue:Ee&&Ye?"":_,getOptionLabel:ee}):[],he=Ht({filteredOptions:j,value:S,inputValue:_});u.useEffect(()=>{const l=S!==he.value;Fe&&!l||k&&!l||Te(null,S)},[S,Te,Fe,he.value,k]);const Ke=me&&j.length>0&&!Se,qe=xo(l=>{l===-1?Z.current.focus():Me.querySelector(`[data-tag-index="${l}"]`).focus()});u.useEffect(()=>{T&&H>S.length-1&&(ze(-1),qe(-1))},[S,T,H,qe]);function y(l,n){if(!be.current||l<0||l>=j.length)return-1;let g=l;for(;;){const x=be.current.querySelector(`[data-option-index="${g}"]`),K=R?!1:!x||x.disabled||x.getAttribute("aria-disabled")==="true";if(x&&x.hasAttribute("tabindex")&&!K)return g;if(n==="next"?g=(g+1)%j.length:g=(g-1+j.length)%j.length,g===l)return-1}}const B=xo(({event:l,index:n,reason:g="auto"})=>{if(te.current=n,n===-1?Z.current.removeAttribute("aria-activedescendant"):Z.current.setAttribute("aria-activedescendant",`${W}-option-${n}`),se&&se(l,n===-1?null:j[n],g),!be.current)return;const x=be.current.querySelector(`[role="option"].${t}-focused`);x&&(x.classList.remove(`${t}-focused`),x.classList.remove(`${t}-focusVisible`));let K=be.current;if(be.current.getAttribute("role")!=="listbox"&&(K=be.current.parentElement.querySelector('[role="listbox"]')),!K)return;if(n===-1){K.scrollTop=0;return}const pe=be.current.querySelector(`[data-option-index="${n}"]`);if(pe&&(pe.classList.add(`${t}-focused`),g==="keyboard"&&pe.classList.add(`${t}-focusVisible`),K.scrollHeight>K.clientHeight&&g!=="mouse"&&g!=="touch")){const ge=pe,He=K.clientHeight+K.scrollTop,_o=ge.offsetTop+ge.offsetHeight;_o>He?K.scrollTop=_o-K.clientHeight:ge.offsetTop-ge.offsetHeight*(N?1.3:0){if(!z)return;const pe=y((()=>{const ge=j.length-1;if(n==="reset")return _e;if(n==="start")return 0;if(n==="end")return ge;const He=te.current+n;return He<0?He===-1&&le?-1:M&&te.current!==-1||Math.abs(n)>1?0:ge:He>ge?He===ge+1&&le?-1:M||Math.abs(n)>1?ge:0:He})(),g);if(B({index:pe,reason:x,event:l}),r&&n!=="reset")if(pe===-1)Z.current.value=_;else{const ge=ee(j[pe]);Z.current.value=ge,ge.toLowerCase().indexOf(_.toLowerCase())===0&&_.length>0&&Z.current.setSelectionRange(_.length,ge.length)}}),ke=()=>{const l=(n,g)=>{const x=n?ee(n):"",K=g?ee(g):"";return x===K};if(te.current!==-1&&he.filteredOptions&&he.filteredOptions.length!==j.length&&he.inputValue===_&&(T?S.length===he.value.length&&he.value.every((n,g)=>ee(S[g])===ee(n)):l(he.value,S))){const n=he.filteredOptions[te.current];if(n&&j.some(x=>ee(x)===ee(n)))return!0}return!1},Ze=u.useCallback(()=>{if(!z||ke())return;const l=T?S[0]:S;if(j.length===0||l==null){X({diff:"reset"});return}if(be.current){if(l!=null){const n=j[te.current];if(T&&n&&Lo(S,x=>oe(n,x))!==-1)return;const g=Lo(j,x=>oe(x,l));g===-1?X({diff:"reset"}):B({index:g});return}if(te.current>=j.length-1){B({index:j.length-1});return}B({index:te.current})}},[j.length,T?!1:S,O,X,B,z,_,T]),Po=xo(l=>{Ot(be,l),l&&Ze()});u.useEffect(()=>{Ze()},[Ze]);const Ne=l=>{me||(Ae(!0),De(!0),re&&re(l))},Ge=(l,n)=>{me&&(Ae(!1),G&&G(l,n))},Ue=(l,n,g,x)=>{if(T){if(S.length===n.length&&S.every((K,pe)=>K===n[pe]))return}else if(S===n)return;Q&&Q(l,n,g,x),to(n)},no=u.useRef(!1),eo=(l,n,g="selectOption",x="options")=>{let K=g,pe=n;if(T){pe=Array.isArray(S)?S.slice():[];const ge=Lo(pe,He=>oe(n,He));ge===-1?pe.push(n):x!=="freeSolo"&&(pe.splice(ge,1),K="removeOption")}Te(l,pe),Ue(l,pe,K,{option:n}),!$&&(!l||!l.ctrlKey&&!l.metaKey)&&Ge(l,K),(d===!0||d==="touch"&&no.current||d==="mouse"&&!no.current)&&Z.current.blur()};function go(l,n){if(l===-1)return-1;let g=l;for(;;){if(n==="next"&&g===S.length||n==="previous"&&g===-1)return-1;const x=Me.querySelector(`[data-tag-index="${g}"]`);if(!x||!x.hasAttribute("tabindex")||x.disabled||x.getAttribute("aria-disabled")==="true")g+=n==="next"?1:-1;else return g}}const mo=(l,n)=>{if(!T)return;_===""&&Ge(l,"toggleInput");let g=H;H===-1?_===""&&n==="previous"&&(g=S.length-1):(g+=n==="next"?1:-1,g<0&&(g=0),g===S.length&&(g=-1)),g=go(g,n),ze(g),qe(g)},ho=l=>{fe.current=!0,xe(""),J&&J(l,"","clear"),Ue(l,T?[]:null,"clear")},ko=l=>n=>{if(l.onKeyDown&&l.onKeyDown(n),!n.defaultMuiPrevented&&(H!==-1&&["ArrowLeft","ArrowRight"].indexOf(n.key)===-1&&(ze(-1),qe(-1)),n.which!==229))switch(n.key){case"Home":z&&F&&(n.preventDefault(),X({diff:"start",direction:"next",reason:"keyboard",event:n}));break;case"End":z&&F&&(n.preventDefault(),X({diff:"end",direction:"previous",reason:"keyboard",event:n}));break;case"PageUp":n.preventDefault(),X({diff:-qo,direction:"previous",reason:"keyboard",event:n}),Ne(n);break;case"PageDown":n.preventDefault(),X({diff:qo,direction:"next",reason:"keyboard",event:n}),Ne(n);break;case"ArrowDown":n.preventDefault(),X({diff:1,direction:"next",reason:"keyboard",event:n}),Ne(n);break;case"ArrowUp":n.preventDefault(),X({diff:-1,direction:"previous",reason:"keyboard",event:n}),Ne(n);break;case"ArrowLeft":mo(n,"previous");break;case"ArrowRight":mo(n,"next");break;case"Enter":if(te.current!==-1&&z){const g=j[te.current],x=C?C(g):!1;if(n.preventDefault(),x)return;eo(n,g,"selectOption"),r&&Z.current.setSelectionRange(Z.current.value.length,Z.current.value.length)}else k&&_!==""&&Ee===!1&&(T&&n.preventDefault(),eo(n,_,"createOption","freeSolo"));break;case"Escape":z?(n.preventDefault(),n.stopPropagation(),Ge(n,"escape")):b&&(_!==""||T&&S.length>0)&&(n.preventDefault(),n.stopPropagation(),ho(n));break;case"Backspace":if(T&&!Se&&_===""&&S.length>0){const g=H===-1?S.length-1:H,x=S.slice();x.splice(g,1),Ue(n,x,"removeOption",{option:S[g]})}break;case"Delete":if(T&&!Se&&_===""&&S.length>0&&H!==-1){const g=H,x=S.slice();x.splice(g,1),Ue(n,x,"removeOption",{option:S[g]})}break}},jo=l=>{ce(!0),A&&!fe.current&&Ne(l)},ro=l=>{if(o(be)){Z.current.focus();return}ce(!1),We.current=!0,fe.current=!1,c&&te.current!==-1&&z?eo(l,j[te.current],"blur"):c&&k&&_!==""?eo(l,_,"blur","freeSolo"):i&&Te(l,S),Ge(l,"blur")},Ce=l=>{const n=l.target.value;_!==n&&(xe(n),De(!1),J&&J(l,n,"input")),n===""?!h&&!T&&Ue(l,null,"clear"):Ne(l)},ve=l=>{const n=Number(l.currentTarget.getAttribute("data-option-index"));te.current!==n&&B({event:l,index:n,reason:"mouse"})},Be=l=>{B({event:l,index:Number(l.currentTarget.getAttribute("data-option-index")),reason:"touch"}),no.current=!0},Wo=l=>{const n=Number(l.currentTarget.getAttribute("data-option-index"));eo(l,j[n],"selectOption"),no.current=!1},Ro=l=>n=>{const g=S.slice();g.splice(l,1),Ue(n,g,"removeOption",{option:S[l]})},Oo=l=>{me?Ge(l,"toggleInput"):Ne(l)},wo=l=>{l.currentTarget.contains(l.target)&&l.target.getAttribute("id")!==W&&l.preventDefault()},vo=l=>{l.currentTarget.contains(l.target)&&(Z.current.focus(),Le&&We.current&&Z.current.selectionEnd-Z.current.selectionStart===0&&Z.current.select(),We.current=!1)},co=l=>{!v&&(_===""||!me)&&Oo(l)};let oo=k&&_.length>0;oo=oo||(T?S.length>0:S!==null);let ao=j;return N&&(ao=j.reduce((l,n,g)=>{const x=N(n);return l.length>0&&l[l.length-1].group===x?l[l.length-1].options.push(n):l.push({key:g,index:g,group:x,options:[n]}),l},[])),v&&Fe&&ro(),{getRootProps:(l={})=>a({"aria-owns":Ke?`${W}-listbox`:null},l,{onKeyDown:ko(l),onMouseDown:wo,onClick:vo}),getInputLabelProps:()=>({id:`${W}-label`,htmlFor:W}),getInputProps:()=>({id:W,value:_,onBlur:ro,onFocus:jo,onChange:Ce,onMouseDown:co,"aria-activedescendant":z?"":null,"aria-autocomplete":r?"both":"list","aria-controls":Ke?`${W}-listbox`:void 0,"aria-expanded":Ke,autoComplete:"off",ref:Z,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:v}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:ho}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Oo}),getTagProps:({index:l})=>a({key:l,"data-tag-index":l,tabIndex:-1},!Se&&{onDelete:Ro(l)}),getListboxProps:()=>({role:"listbox",id:`${W}-listbox`,"aria-labelledby":`${W}-label`,ref:Po,onMouseDown:l=>{l.preventDefault()}}),getOptionProps:({index:l,option:n})=>{var g;const x=(T?S:[S]).some(pe=>pe!=null&&oe(n,pe)),K=C?C(n):!1;return{key:(g=I==null?void 0:I(n))!=null?g:ee(n),tabIndex:-1,role:"option",id:`${W}-option-${l}`,onMouseMove:ve,onClick:Wo,onTouchStart:Be,"data-option-index":l,"aria-disabled":K,"aria-selected":x}},id:W,inputValue:_,value:S,dirty:oo,expanded:z&&Me,popupOpen:z,focused:Fe||H!==-1,anchorEl:Me,setAnchorEl:Y,focusedTag:H,groupedOptions:ao}}function Jt(e){return ye("MuiListSubheader",e)}$e("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const en=["className","color","component","disableGutters","disableSticky","inset"],on=e=>{const{classes:o,color:t,disableGutters:r,inset:s,disableSticky:c}=e,d={root:["root",t!=="default"&&`color${w(t)}`,!r&&"gutters",s&&"inset",!c&&"sticky"]};return Ie(d,Jt,o)},tn=L("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.color!=="default"&&o[`color${w(t.color)}`],!t.disableGutters&&o.gutters,t.inset&&o.inset,!t.disableSticky&&o.sticky]}})(({theme:e,ownerState:o})=>a({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)},o.color==="primary"&&{color:(e.vars||e).palette.primary.main},o.color==="inherit"&&{color:"inherit"},!o.disableGutters&&{paddingLeft:16,paddingRight:16},o.inset&&{paddingLeft:72},!o.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper})),bt=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiListSubheader"}),{className:s,color:c="default",component:d="li",disableGutters:i=!1,disableSticky:b=!1,inset:p=!1}=r,m=ae(r,en),h=a({},r,{color:c,component:d,disableGutters:i,disableSticky:b,inset:p}),$=on(h);return f.jsx(tn,a({as:d,className:ne($.root,s),ref:t,ownerState:h},m))});bt.muiSkipListHighlight=!0;const nn=bt,rn=zo(f.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 an(e){return ye("MuiChip",e)}const ln=$e("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"]),V=ln,sn=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],cn=e=>{const{classes:o,disabled:t,size:r,color:s,iconColor:c,onDelete:d,clickable:i,variant:b}=e,p={root:["root",b,t&&"disabled",`size${w(r)}`,`color${w(s)}`,i&&"clickable",i&&`clickableColor${w(s)}`,d&&"deletable",d&&`deletableColor${w(s)}`,`${b}${w(s)}`],label:["label",`label${w(r)}`],avatar:["avatar",`avatar${w(r)}`,`avatarColor${w(s)}`],icon:["icon",`icon${w(r)}`,`iconColor${w(c)}`],deleteIcon:["deleteIcon",`deleteIcon${w(r)}`,`deleteIconColor${w(s)}`,`deleteIcon${w(b)}Color${w(s)}`]};return Ie(p,an,o)},dn=L("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e,{color:r,iconColor:s,clickable:c,onDelete:d,size:i,variant:b}=t;return[{[`& .${V.avatar}`]:o.avatar},{[`& .${V.avatar}`]:o[`avatar${w(i)}`]},{[`& .${V.avatar}`]:o[`avatarColor${w(r)}`]},{[`& .${V.icon}`]:o.icon},{[`& .${V.icon}`]:o[`icon${w(i)}`]},{[`& .${V.icon}`]:o[`iconColor${w(s)}`]},{[`& .${V.deleteIcon}`]:o.deleteIcon},{[`& .${V.deleteIcon}`]:o[`deleteIcon${w(i)}`]},{[`& .${V.deleteIcon}`]:o[`deleteIconColor${w(r)}`]},{[`& .${V.deleteIcon}`]:o[`deleteIcon${w(b)}Color${w(r)}`]},o.root,o[`size${w(i)}`],o[`color${w(r)}`],c&&o.clickable,c&&r!=="default"&&o[`clickableColor${w(r)})`],d&&o.deletable,d&&r!=="default"&&o[`deletableColor${w(r)}`],o[b],o[`${b}${w(r)}`]]}})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return a({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",[`&.${V.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${V.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${V.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${V.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${V.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${V.icon}`]:a({marginLeft:5,marginRight:-6},o.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},o.iconColor===o.color&&a({color:e.vars?e.vars.palette.Chip.defaultIconColor:t},o.color!=="default"&&{color:"inherit"})),[`& .${V.deleteIcon}`]:a({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:Re(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)`:Re(e.palette.text.primary,.4)}},o.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},o.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[o.color].contrastTextChannel} / 0.7)`:Re(e.palette[o.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[o.color].contrastText}})},o.size==="small"&&{height:24},o.color!=="default"&&{backgroundColor:(e.vars||e).palette[o.color].main,color:(e.vars||e).palette[o.color].contrastText},o.onDelete&&{[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},o.onDelete&&o.color!=="default"&&{[`&.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette[o.color].dark}})},({theme:e,ownerState:o})=>a({},o.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}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},o.clickable&&o.color!=="default"&&{[`&:hover, &.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette[o.color].dark}}),({theme:e,ownerState:o})=>a({},o.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]}`,[`&.${V.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${V.avatar}`]:{marginLeft:4},[`& .${V.avatarSmall}`]:{marginLeft:2},[`& .${V.icon}`]:{marginLeft:4},[`& .${V.iconSmall}`]:{marginLeft:2},[`& .${V.deleteIcon}`]:{marginRight:5},[`& .${V.deleteIconSmall}`]:{marginRight:3}},o.variant==="outlined"&&o.color!=="default"&&{color:(e.vars||e).palette[o.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / 0.7)`:Re(e.palette[o.color].main,.7)}`,[`&.${V.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(e.palette[o.color].main,e.palette.action.hoverOpacity)},[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:Re(e.palette[o.color].main,e.palette.action.focusOpacity)},[`& .${V.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / 0.7)`:Re(e.palette[o.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[o.color].main}}})),un=L("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,o)=>{const{ownerState:t}=e,{size:r}=t;return[o.label,o[`label${w(r)}`]]}})(({ownerState:e})=>a({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 Go(e){return e.key==="Backspace"||e.key==="Delete"}const pn=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiChip"}),{avatar:s,className:c,clickable:d,color:i="default",component:b,deleteIcon:p,disabled:m=!1,icon:h,label:$,onClick:v,onDelete:R,onKeyDown:M,onKeyUp:P,size:O="medium",variant:k="filled",tabIndex:C,skipFocusWhenDisabled:I=!1}=r,E=ae(r,sn),N=u.useRef(null),F=lo(N,t),q=A=>{A.stopPropagation(),R&&R(A)},le=A=>{A.currentTarget===A.target&&Go(A)&&A.preventDefault(),M&&M(A)},de=A=>{A.currentTarget===A.target&&(R&&Go(A)?R(A):A.key==="Escape"&&N.current&&N.current.blur()),P&&P(A)},oe=d!==!1&&v?!0:d,T=oe||R?Uo:b||"div",Q=a({},r,{component:T,disabled:m,size:O,color:i,iconColor:u.isValidElement(h)&&h.props.color||i,onDelete:!!R,clickable:oe,variant:k}),G=cn(Q),se=T===Uo?a({component:b||"div",focusVisibleClassName:G.focusVisible},R&&{disableRipple:!0}):{};let J=null;R&&(J=p&&u.isValidElement(p)?u.cloneElement(p,{className:ne(p.props.className,G.deleteIcon),onClick:q}):f.jsx(rn,{className:ne(G.deleteIcon),onClick:q}));let re=null;s&&u.isValidElement(s)&&(re=u.cloneElement(s,{className:ne(G.avatar,s.props.className)}));let U=null;return h&&u.isValidElement(h)&&(U=u.cloneElement(h,{className:ne(G.icon,h.props.className)})),f.jsxs(dn,a({as:T,className:ne(G.root,c),disabled:oe&&m?!0:void 0,onClick:v,onKeyDown:le,onKeyUp:de,ref:F,tabIndex:I&&m?-1:C,ownerState:Q},se,E,{children:[re||U,f.jsx(un,{className:ne(G.label),ownerState:Q,children:$}),J]}))}),fn=pn;function bn(e){return f.jsx(qt,a({},e,{defaultTheme:wt,themeId:Lt}))}function gn(e){return ye("MuiInputBase",e)}const mn=$e("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Oe=mn,hn=["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"],Co=(e,o)=>{const{ownerState:t}=e;return[o.root,t.formControl&&o.formControl,t.startAdornment&&o.adornedStart,t.endAdornment&&o.adornedEnd,t.error&&o.error,t.size==="small"&&o.sizeSmall,t.multiline&&o.multiline,t.color&&o[`color${w(t.color)}`],t.fullWidth&&o.fullWidth,t.hiddenLabel&&o.hiddenLabel]},yo=(e,o)=>{const{ownerState:t}=e;return[o.input,t.size==="small"&&o.inputSizeSmall,t.multiline&&o.inputMultiline,t.type==="search"&&o.inputTypeSearch,t.startAdornment&&o.inputAdornedStart,t.endAdornment&&o.inputAdornedEnd,t.hiddenLabel&&o.inputHiddenLabel]},vn=e=>{const{classes:o,color:t,disabled:r,error:s,endAdornment:c,focused:d,formControl:i,fullWidth:b,hiddenLabel:p,multiline:m,readOnly:h,size:$,startAdornment:v,type:R}=e,M={root:["root",`color${w(t)}`,r&&"disabled",s&&"error",b&&"fullWidth",d&&"focused",i&&"formControl",$&&$!=="medium"&&`size${w($)}`,m&&"multiline",v&&"adornedStart",c&&"adornedEnd",p&&"hiddenLabel",h&&"readOnly"],input:["input",r&&"disabled",R==="search"&&"inputTypeSearch",m&&"inputMultiline",$==="small"&&"inputSizeSmall",p&&"inputHiddenLabel",v&&"inputAdornedStart",c&&"inputAdornedEnd",h&&"readOnly"]};return Ie(M,gn,o)},$o=L("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Co})(({theme:e,ownerState:o})=>a({},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",[`&.${Oe.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},o.multiline&&a({padding:"4px 0 5px"},o.size==="small"&&{paddingTop:1}),o.fullWidth&&{width:"100%"})),Io=L("input",{name:"MuiInputBase",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light",r=a({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),s={opacity:"0 !important"},c=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return a({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] + .${Oe.formControl} &`]:{"&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus::-webkit-input-placeholder":c,"&:focus::-moz-placeholder":c,"&:focus:-ms-input-placeholder":c,"&:focus::-ms-input-placeholder":c},[`&.${Oe.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},o.size==="small"&&{paddingTop:1},o.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},o.type==="search"&&{MozAppearance:"textfield"})}),xn=f.jsx(bn,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),Cn=u.forwardRef(function(o,t){var r;const s=Pe({props:o,name:"MuiInputBase"}),{"aria-describedby":c,autoComplete:d,autoFocus:i,className:b,components:p={},componentsProps:m={},defaultValue:h,disabled:$,disableInjectingGlobalStyles:v,endAdornment:R,fullWidth:M=!1,id:P,inputComponent:O="input",inputProps:k={},inputRef:C,maxRows:I,minRows:E,multiline:N=!1,name:F,onBlur:q,onChange:le,onClick:de,onFocus:oe,onKeyDown:T,onKeyUp:Q,placeholder:G,readOnly:se,renderSuffix:J,rows:re,slotProps:U={},slots:A={},startAdornment:ie,type:Se="text",value:Le}=s,ue=ae(s,hn),W=k.value!=null?k.value:Le,{current:ee}=u.useRef(W!=null),fe=u.useRef(),We=u.useCallback(z=>{},[]),Z=lo(fe,C,k.ref,We),[be,Me]=u.useState(!1),Y=so(),H=io({props:s,muiFormControl:Y,states:["color","disabled","error","hiddenLabel","size","required","filled"]});H.focused=Y?Y.focused:be,u.useEffect(()=>{!Y&&$&&be&&(Me(!1),q&&q())},[Y,$,be,q]);const ze=Y&&Y.onFilled,_e=Y&&Y.onEmpty,te=u.useCallback(z=>{ft(z)?ze&&ze():_e&&_e()},[ze,_e]);st(()=>{ee&&te({value:W})},[W,te,ee]);const S=z=>{if(H.disabled){z.stopPropagation();return}oe&&oe(z),k.onFocus&&k.onFocus(z),Y&&Y.onFocus?Y.onFocus(z):Me(!0)},to=z=>{q&&q(z),k.onBlur&&k.onBlur(z),Y&&Y.onBlur?Y.onBlur(z):Me(!1)},_=(z,...j)=>{if(!ee){const he=z.target||fe.current;if(he==null)throw new Error(it(1));te({value:he.value})}k.onChange&&k.onChange(z,...j),le&&le(z,...j)};u.useEffect(()=>{te(fe.current)},[]);const xe=z=>{fe.current&&z.currentTarget===z.target&&fe.current.focus(),de&&de(z)};let Fe=O,ce=k;N&&Fe==="input"&&(re?ce=a({type:void 0,minRows:re,maxRows:re},ce):ce=a({type:void 0,maxRows:I,minRows:E},ce),Fe=_t);const Te=z=>{te(z.animationName==="mui-auto-fill-cancel"?fe.current:{value:"x"})};u.useEffect(()=>{Y&&Y.setAdornedStart(!!ie)},[Y,ie]);const me=a({},s,{color:H.color||"primary",disabled:H.disabled,endAdornment:R,error:H.error,focused:H.focused,formControl:Y,fullWidth:M,hiddenLabel:H.hiddenLabel,multiline:N,size:H.size,startAdornment:ie,type:Se}),Ae=vn(me),Ye=A.root||p.Root||$o,De=U.root||m.root||{},Ee=A.input||p.Input||Io;return ce=a({},ce,(r=U.input)!=null?r:m.input),f.jsxs(u.Fragment,{children:[!v&&xn,f.jsxs(Ye,a({},De,!Ho(Ye)&&{ownerState:a({},me,De.ownerState)},{ref:t,onClick:xe},ue,{className:ne(Ae.root,De.className,b,se&&"MuiInputBase-readOnly"),children:[ie,f.jsx(Bt.Provider,{value:null,children:f.jsx(Ee,a({ownerState:me,"aria-invalid":H.error,"aria-describedby":c,autoComplete:d,autoFocus:i,defaultValue:h,disabled:H.disabled,id:P,onAnimationStart:Te,name:F,placeholder:G,readOnly:se,required:H.required,rows:re,value:W,onKeyDown:T,onKeyUp:Q,type:Se},ce,!Ho(Ee)&&{as:Fe,ownerState:a({},me,ce.ownerState)},{ref:Z,className:ne(Ae.input,ce.className,se&&"MuiInputBase-readOnly"),onBlur:to,onChange:_,onFocus:S}))}),R,J?J(a({},H,{startAdornment:ie})):null]}))]})}),Do=Cn;function yn(e){return ye("MuiInput",e)}const $n=a({},Oe,$e("MuiInput",["root","underline","input"])),Je=$n;function In(e){return ye("MuiOutlinedInput",e)}const Sn=a({},Oe,$e("MuiOutlinedInput",["root","notchedOutline","input"])),Ve=Sn;function Pn(e){return ye("MuiFilledInput",e)}const kn=a({},Oe,$e("MuiFilledInput",["root","underline","input"])),we=kn,gt=zo(f.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function Rn(e){return ye("MuiAutocomplete",e)}const On=$e("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"]),D=On;var Xo,Yo;const wn=["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"],Ln=["ref"],Mn=["key"],Fn=e=>{const{classes:o,disablePortal:t,expanded:r,focused:s,fullWidth:c,hasClearIcon:d,hasPopupIcon:i,inputFocused:b,popupOpen:p,size:m}=e,h={root:["root",r&&"expanded",s&&"focused",c&&"fullWidth",d&&"hasClearIcon",i&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",b&&"inputFocused"],tag:["tag",`tagSize${w(m)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",p&&"popupIndicatorOpen"],popper:["popper",t&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Ie(h,Rn,o)},Tn=L("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e,{fullWidth:r,hasClearIcon:s,hasPopupIcon:c,inputFocused:d,size:i}=t;return[{[`& .${D.tag}`]:o.tag},{[`& .${D.tag}`]:o[`tagSize${w(i)}`]},{[`& .${D.inputRoot}`]:o.inputRoot},{[`& .${D.input}`]:o.input},{[`& .${D.input}`]:d&&o.inputFocused},o.root,r&&o.fullWidth,c&&o.hasPopupIcon,s&&o.hasClearIcon]}})(({ownerState:e})=>a({[`&.${D.focused} .${D.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${D.clearIndicator}`]:{visibility:"visible"}}},e.fullWidth&&{width:"100%"},{[`& .${D.tag}`]:a({margin:3,maxWidth:"calc(100% - 6px)"},e.size==="small"&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${D.inputRoot}`]:{flexWrap:"wrap",[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4},[`& .${D.input}`]:{width:0,minWidth:30}},[`& .${Je.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Je.root}.${Oe.sizeSmall}`]:{[`& .${Je.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Ve.root}`]:{padding:9,[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${D.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${D.endAdornment}`]:{right:9}},[`& .${Ve.root}.${Oe.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${D.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${we.root}`]:{paddingTop:19,paddingLeft:8,[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${we.input}`]:{padding:"7px 4px"},[`& .${D.endAdornment}`]:{right:9}},[`& .${we.root}.${Oe.sizeSmall}`]:{paddingBottom:1,[`& .${we.input}`]:{padding:"2.5px 4px"}},[`& .${Oe.hiddenLabel}`]:{paddingTop:8},[`& .${we.root}.${Oe.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${D.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${we.root}.${Oe.hiddenLabel}.${Oe.sizeSmall}`]:{[`& .${D.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${D.input}`]:a({flexGrow:1,textOverflow:"ellipsis",opacity:0},e.inputFocused&&{opacity:1})})),An=L("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,o)=>o.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),Nn=L(ut,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,o)=>o.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),zn=L(ut,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:e},o)=>a({},o.popupIndicator,e.popupOpen&&o.popupIndicatorOpen)})(({ownerState:e})=>a({padding:2,marginRight:-2},e.popupOpen&&{transform:"rotate(180deg)"})),Dn=L(No,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${D.option}`]:o.option},o.popper,t.disablePortal&&o.popperDisablePortal]}})(({theme:e,ownerState:o})=>a({zIndex:(e.vars||e).zIndex.modal},o.disablePortal&&{position:"absolute"})),En=L(pt,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,o)=>o.paper})(({theme:e})=>a({},e.typography.body1,{overflow:"auto"})),Bn=L("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,o)=>o.loading})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),jn=L("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,o)=>o.noOptions})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),Wn=L("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,o)=>o.listbox})(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${D.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"},[`&.${D.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"},[`&.${D.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})`:Re(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${D.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Re(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${D.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}})),_n=L(nn,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,o)=>o.groupLabel})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8})),Un=L("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,o)=>o.groupUl})({padding:0,[`& .${D.option}`]:{paddingLeft:24}}),Hn=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiAutocomplete"}),{autoComplete:b=!1,autoHighlight:p=!1,autoSelect:m=!1,blurOnSelect:h=!1,ChipProps:$,className:v,clearIcon:R=Xo||(Xo=f.jsx(Gt,{fontSize:"small"})),clearOnBlur:M=!i.freeSolo,clearOnEscape:P=!1,clearText:O="Clear",closeText:k="Close",componentsProps:C={},defaultValue:I=i.multiple?[]:null,disableClearable:E=!1,disableCloseOnSelect:N=!1,disabled:F=!1,disabledItemsFocusable:q=!1,disableListWrap:le=!1,disablePortal:de=!1,filterSelectedOptions:oe=!1,forcePopupIcon:T="auto",freeSolo:Q=!1,fullWidth:G=!1,getLimitTagsText:se=n=>`+${n}`,getOptionLabel:J,groupBy:re,handleHomeEndKeys:U=!i.freeSolo,includeInputInList:A=!1,limitTags:ie=-1,ListboxComponent:Se="ul",ListboxProps:Le,loading:ue=!1,loadingText:W="Loading…",multiple:ee=!1,noOptionsText:fe="No options",openOnFocus:We=!1,openText:Z="Open",PaperComponent:be=pt,PopperComponent:Me=No,popupIcon:Y=Yo||(Yo=f.jsx(gt,{})),readOnly:H=!1,renderGroup:ze,renderInput:_e,renderOption:te,renderTags:S,selectOnFocus:to=!i.freeSolo,size:_="medium",slotProps:xe={}}=i,Fe=ae(i,wn),{getRootProps:ce,getInputProps:Te,getInputLabelProps:me,getPopupIndicatorProps:Ae,getClearProps:Ye,getTagProps:De,getListboxProps:Ee,getOptionProps:z,value:j,dirty:he,expanded:Ke,id:qe,popupOpen:y,focused:B,focusedTag:X,anchorEl:ke,setAnchorEl:Ze,inputValue:Po,groupedOptions:Ne}=Qt(a({},i,{componentName:"Autocomplete"})),Ge=!E&&!F&&he&&!H,Ue=(!Q||T===!0)&&T!==!1,{onMouseDown:no}=Te(),{ref:eo}=Le??{},go=Ee(),{ref:mo}=go,ho=ae(go,Ln),ko=lo(mo,eo),ro=J||(n=>{var g;return(g=n.label)!=null?g:n}),Ce=a({},i,{disablePortal:de,expanded:Ke,focused:B,fullWidth:G,getOptionLabel:ro,hasClearIcon:Ge,hasPopupIcon:Ue,inputFocused:X===-1,popupOpen:y,size:_}),ve=Fn(Ce);let Be;if(ee&&j.length>0){const n=g=>a({className:ve.tag,disabled:F},De(g));S?Be=S(j,n,Ce):Be=j.map((g,x)=>f.jsx(fn,a({label:ro(g),size:_},n({index:x}),$)))}if(ie>-1&&Array.isArray(Be)){const n=Be.length-ie;!B&&n>0&&(Be=Be.splice(0,ie),Be.push(f.jsx("span",{className:ve.tag,children:se(n)},Be.length)))}const Ro=ze||(n=>f.jsxs("li",{children:[f.jsx(_n,{className:ve.groupLabel,ownerState:Ce,component:"div",children:n.group}),f.jsx(Un,{className:ve.groupUl,ownerState:Ce,children:n.children})]},n.key)),wo=te||((n,g)=>{const{key:x}=n,K=ae(n,Mn);return f.jsx("li",a({},K,{children:ro(g)}),x)}),vo=(n,g)=>{const x=z({option:n,index:g});return wo(a({},x,{className:ve.option}),n,{selected:x["aria-selected"],index:g,inputValue:Po},Ce)},co=(r=xe.clearIndicator)!=null?r:C.clearIndicator,oo=(s=xe.paper)!=null?s:C.paper,ao=(c=xe.popper)!=null?c:C.popper,l=(d=xe.popupIndicator)!=null?d:C.popupIndicator;return f.jsxs(u.Fragment,{children:[f.jsx(Tn,a({ref:t,className:ne(ve.root,v),ownerState:Ce},ce(Fe),{children:_e({id:qe,disabled:F,fullWidth:!0,size:_==="small"?"small":void 0,InputLabelProps:me(),InputProps:a({ref:Ze,className:ve.inputRoot,startAdornment:Be,onClick:n=>{n.target===n.currentTarget&&no(n)}},(Ge||Ue)&&{endAdornment:f.jsxs(An,{className:ve.endAdornment,ownerState:Ce,children:[Ge?f.jsx(Nn,a({},Ye(),{"aria-label":O,title:O,ownerState:Ce},co,{className:ne(ve.clearIndicator,co==null?void 0:co.className),children:R})):null,Ue?f.jsx(zn,a({},Ae(),{disabled:F,"aria-label":y?k:Z,title:y?k:Z,ownerState:Ce},l,{className:ne(ve.popupIndicator,l==null?void 0:l.className),children:Y})):null]})}),inputProps:a({className:ve.input,disabled:F,readOnly:H},Te())})})),ke?f.jsx(Dn,a({as:Me,disablePortal:de,style:{width:ke?ke.clientWidth:null},ownerState:Ce,role:"presentation",anchorEl:ke,open:y},ao,{className:ne(ve.popper,ao==null?void 0:ao.className),children:f.jsxs(En,a({ownerState:Ce,as:be},oo,{className:ne(ve.paper,oo==null?void 0:oo.className),children:[ue&&Ne.length===0?f.jsx(Bn,{className:ve.loading,ownerState:Ce,children:W}):null,Ne.length===0&&!Q&&!ue?f.jsx(jn,{className:ve.noOptions,ownerState:Ce,role:"presentation",onMouseDown:n=>{n.preventDefault()},children:fe}):null,Ne.length>0?f.jsx(Wn,a({as:Se,className:ve.listbox,ownerState:Ce},ho,Le,{ref:ko,children:Ne.map((n,g)=>re?Ro({key:n.key,group:n.group,children:n.options.map((x,K)=>vo(x,n.index+K))}):vo(n,g))})):null]}))})):null]})}),Vn=Hn;function Kn(e){return ye("MuiCircularProgress",e)}$e("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const qn=["className","color","disableShrink","size","style","thickness","value","variant"];let So=e=>e,Zo,Qo,Jo,et;const Qe=44,Gn=ct(Zo||(Zo=So` +import{r as u,j as f,bY as kt,bZ as Rt,p as xo,n as Ot,e as a,c as ye,d as $e,s as L,k as w,u as Pe,a as ae,h as ne,i as Ie,f as Re,l as lo,B as Uo,b_ as wt,b$ as Lt,m as st,c0 as it,bu as ct,bv as dt,ag as Xe,c1 as To,q as Mt,aj as Ft,w as Tt,x as je,F as At}from"./index-4c5f8236.js";import{K as Ho,al as ut,aD as pt,aX as Nt,w as Fo,s as zt,aY as Dt,L as Vo,T as Et}from"./index-a4caf8d5.js";import{a as Ao,u as fo,b as so,f as io,i as ft,c as Bt,P as No,F as jt,S as Wt}from"./Stack-7f131eb3.js";import{c as zo}from"./createSvgIcon-2fe026f6.js";import{T as _t}from"./TextareaAutosize-cc9b3a66.js";const Ut=e=>{const o=u.useRef({});return u.useEffect(()=>{o.current=e}),o.current},Ht=Ut;function Vt(e){return e==null||Object.keys(e).length===0}function Kt(e){const{styles:o,defaultTheme:t={}}=e,r=typeof o=="function"?s=>o(Vt(s)?t:s):o;return f.jsx(kt,{styles:r})}function qt({styles:e,themeId:o,defaultTheme:t={}}){const r=Rt(t),s=typeof e=="function"?e(o&&r[o]||r):e;return f.jsx(Kt,{styles:s})}const Gt=zo(f.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 Ko(e){return typeof e.normalize<"u"?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e}function Xt(e={}){const{ignoreAccents:o=!0,ignoreCase:t=!0,limit:r,matchFrom:s="any",stringify:c,trim:d=!1}=e;return(i,{inputValue:b,getOptionLabel:p})=>{let m=d?b.trim():b;t&&(m=m.toLowerCase()),o&&(m=Ko(m));const h=m?i.filter($=>{let v=(c||p)($);return t&&(v=v.toLowerCase()),o&&(v=Ko(v)),s==="start"?v.indexOf(m)===0:v.indexOf(m)>-1}):i;return typeof r=="number"?h.slice(0,r):h}}function Lo(e,o){for(let t=0;t{var o;return e.current!==null&&((o=e.current.parentElement)==null?void 0:o.contains(document.activeElement))};function Jt(e){const{unstable_isActiveElementInListbox:o=Zt,unstable_classNamePrefix:t="Mui",autoComplete:r=!1,autoHighlight:s=!1,autoSelect:c=!1,blurOnSelect:d=!1,clearOnBlur:i=!e.freeSolo,clearOnEscape:b=!1,componentName:p="useAutocomplete",defaultValue:m=e.multiple?[]:null,disableClearable:h=!1,disableCloseOnSelect:$=!1,disabled:v,disabledItemsFocusable:R=!1,disableListWrap:M=!1,filterOptions:P=Yt,filterSelectedOptions:O=!1,freeSolo:k=!1,getOptionDisabled:C,getOptionKey:I,getOptionLabel:E=l=>{var n;return(n=l.label)!=null?n:l},groupBy:N,handleHomeEndKeys:F=!e.freeSolo,id:q,includeInputInList:le=!1,inputValue:de,isOptionEqualToValue:oe=(l,n)=>l===n,multiple:T=!1,onChange:J,onClose:G,onHighlightChange:se,onInputChange:Q,onOpen:re,open:U,openOnFocus:A=!1,options:ie,readOnly:Se=!1,selectOnFocus:Le=!e.freeSolo,value:ue}=e,W=Ao(q);let ee=E;ee=l=>{const n=E(l);return typeof n!="string"?String(n):n};const fe=u.useRef(!1),We=u.useRef(!0),Z=u.useRef(null),be=u.useRef(null),[Me,Y]=u.useState(null),[H,ze]=u.useState(-1),_e=s?0:-1,te=u.useRef(_e),[S,to]=fo({controlled:ue,default:m,name:p}),[_,xe]=fo({controlled:de,default:"",name:p,state:"inputValue"}),[Fe,ce]=u.useState(!1),Te=u.useCallback((l,n)=>{if(!(T?S.length!(O&&(T?S:[S]).some(n=>n!==null&&oe(l,n)))),{inputValue:Ee&&Ye?"":_,getOptionLabel:ee}):[],he=Ht({filteredOptions:j,value:S,inputValue:_});u.useEffect(()=>{const l=S!==he.value;Fe&&!l||k&&!l||Te(null,S)},[S,Te,Fe,he.value,k]);const Ke=me&&j.length>0&&!Se,qe=xo(l=>{l===-1?Z.current.focus():Me.querySelector(`[data-tag-index="${l}"]`).focus()});u.useEffect(()=>{T&&H>S.length-1&&(ze(-1),qe(-1))},[S,T,H,qe]);function y(l,n){if(!be.current||l<0||l>=j.length)return-1;let g=l;for(;;){const x=be.current.querySelector(`[data-option-index="${g}"]`),K=R?!1:!x||x.disabled||x.getAttribute("aria-disabled")==="true";if(x&&x.hasAttribute("tabindex")&&!K)return g;if(n==="next"?g=(g+1)%j.length:g=(g-1+j.length)%j.length,g===l)return-1}}const B=xo(({event:l,index:n,reason:g="auto"})=>{if(te.current=n,n===-1?Z.current.removeAttribute("aria-activedescendant"):Z.current.setAttribute("aria-activedescendant",`${W}-option-${n}`),se&&se(l,n===-1?null:j[n],g),!be.current)return;const x=be.current.querySelector(`[role="option"].${t}-focused`);x&&(x.classList.remove(`${t}-focused`),x.classList.remove(`${t}-focusVisible`));let K=be.current;if(be.current.getAttribute("role")!=="listbox"&&(K=be.current.parentElement.querySelector('[role="listbox"]')),!K)return;if(n===-1){K.scrollTop=0;return}const pe=be.current.querySelector(`[data-option-index="${n}"]`);if(pe&&(pe.classList.add(`${t}-focused`),g==="keyboard"&&pe.classList.add(`${t}-focusVisible`),K.scrollHeight>K.clientHeight&&g!=="mouse"&&g!=="touch")){const ge=pe,He=K.clientHeight+K.scrollTop,_o=ge.offsetTop+ge.offsetHeight;_o>He?K.scrollTop=_o-K.clientHeight:ge.offsetTop-ge.offsetHeight*(N?1.3:0){if(!z)return;const pe=y((()=>{const ge=j.length-1;if(n==="reset")return _e;if(n==="start")return 0;if(n==="end")return ge;const He=te.current+n;return He<0?He===-1&&le?-1:M&&te.current!==-1||Math.abs(n)>1?0:ge:He>ge?He===ge+1&&le?-1:M||Math.abs(n)>1?ge:0:He})(),g);if(B({index:pe,reason:x,event:l}),r&&n!=="reset")if(pe===-1)Z.current.value=_;else{const ge=ee(j[pe]);Z.current.value=ge,ge.toLowerCase().indexOf(_.toLowerCase())===0&&_.length>0&&Z.current.setSelectionRange(_.length,ge.length)}}),ke=()=>{const l=(n,g)=>{const x=n?ee(n):"",K=g?ee(g):"";return x===K};if(te.current!==-1&&he.filteredOptions&&he.filteredOptions.length!==j.length&&he.inputValue===_&&(T?S.length===he.value.length&&he.value.every((n,g)=>ee(S[g])===ee(n)):l(he.value,S))){const n=he.filteredOptions[te.current];if(n&&j.some(x=>ee(x)===ee(n)))return!0}return!1},Ze=u.useCallback(()=>{if(!z||ke())return;const l=T?S[0]:S;if(j.length===0||l==null){X({diff:"reset"});return}if(be.current){if(l!=null){const n=j[te.current];if(T&&n&&Lo(S,x=>oe(n,x))!==-1)return;const g=Lo(j,x=>oe(x,l));g===-1?X({diff:"reset"}):B({index:g});return}if(te.current>=j.length-1){B({index:j.length-1});return}B({index:te.current})}},[j.length,T?!1:S,O,X,B,z,_,T]),Po=xo(l=>{Ot(be,l),l&&Ze()});u.useEffect(()=>{Ze()},[Ze]);const Ne=l=>{me||(Ae(!0),De(!0),re&&re(l))},Ge=(l,n)=>{me&&(Ae(!1),G&&G(l,n))},Ue=(l,n,g,x)=>{if(T){if(S.length===n.length&&S.every((K,pe)=>K===n[pe]))return}else if(S===n)return;J&&J(l,n,g,x),to(n)},no=u.useRef(!1),eo=(l,n,g="selectOption",x="options")=>{let K=g,pe=n;if(T){pe=Array.isArray(S)?S.slice():[];const ge=Lo(pe,He=>oe(n,He));ge===-1?pe.push(n):x!=="freeSolo"&&(pe.splice(ge,1),K="removeOption")}Te(l,pe),Ue(l,pe,K,{option:n}),!$&&(!l||!l.ctrlKey&&!l.metaKey)&&Ge(l,K),(d===!0||d==="touch"&&no.current||d==="mouse"&&!no.current)&&Z.current.blur()};function go(l,n){if(l===-1)return-1;let g=l;for(;;){if(n==="next"&&g===S.length||n==="previous"&&g===-1)return-1;const x=Me.querySelector(`[data-tag-index="${g}"]`);if(!x||!x.hasAttribute("tabindex")||x.disabled||x.getAttribute("aria-disabled")==="true")g+=n==="next"?1:-1;else return g}}const mo=(l,n)=>{if(!T)return;_===""&&Ge(l,"toggleInput");let g=H;H===-1?_===""&&n==="previous"&&(g=S.length-1):(g+=n==="next"?1:-1,g<0&&(g=0),g===S.length&&(g=-1)),g=go(g,n),ze(g),qe(g)},ho=l=>{fe.current=!0,xe(""),Q&&Q(l,"","clear"),Ue(l,T?[]:null,"clear")},ko=l=>n=>{if(l.onKeyDown&&l.onKeyDown(n),!n.defaultMuiPrevented&&(H!==-1&&["ArrowLeft","ArrowRight"].indexOf(n.key)===-1&&(ze(-1),qe(-1)),n.which!==229))switch(n.key){case"Home":z&&F&&(n.preventDefault(),X({diff:"start",direction:"next",reason:"keyboard",event:n}));break;case"End":z&&F&&(n.preventDefault(),X({diff:"end",direction:"previous",reason:"keyboard",event:n}));break;case"PageUp":n.preventDefault(),X({diff:-qo,direction:"previous",reason:"keyboard",event:n}),Ne(n);break;case"PageDown":n.preventDefault(),X({diff:qo,direction:"next",reason:"keyboard",event:n}),Ne(n);break;case"ArrowDown":n.preventDefault(),X({diff:1,direction:"next",reason:"keyboard",event:n}),Ne(n);break;case"ArrowUp":n.preventDefault(),X({diff:-1,direction:"previous",reason:"keyboard",event:n}),Ne(n);break;case"ArrowLeft":mo(n,"previous");break;case"ArrowRight":mo(n,"next");break;case"Enter":if(te.current!==-1&&z){const g=j[te.current],x=C?C(g):!1;if(n.preventDefault(),x)return;eo(n,g,"selectOption"),r&&Z.current.setSelectionRange(Z.current.value.length,Z.current.value.length)}else k&&_!==""&&Ee===!1&&(T&&n.preventDefault(),eo(n,_,"createOption","freeSolo"));break;case"Escape":z?(n.preventDefault(),n.stopPropagation(),Ge(n,"escape")):b&&(_!==""||T&&S.length>0)&&(n.preventDefault(),n.stopPropagation(),ho(n));break;case"Backspace":if(T&&!Se&&_===""&&S.length>0){const g=H===-1?S.length-1:H,x=S.slice();x.splice(g,1),Ue(n,x,"removeOption",{option:S[g]})}break;case"Delete":if(T&&!Se&&_===""&&S.length>0&&H!==-1){const g=H,x=S.slice();x.splice(g,1),Ue(n,x,"removeOption",{option:S[g]})}break}},jo=l=>{ce(!0),A&&!fe.current&&Ne(l)},ro=l=>{if(o(be)){Z.current.focus();return}ce(!1),We.current=!0,fe.current=!1,c&&te.current!==-1&&z?eo(l,j[te.current],"blur"):c&&k&&_!==""?eo(l,_,"blur","freeSolo"):i&&Te(l,S),Ge(l,"blur")},Ce=l=>{const n=l.target.value;_!==n&&(xe(n),De(!1),Q&&Q(l,n,"input")),n===""?!h&&!T&&Ue(l,null,"clear"):Ne(l)},ve=l=>{const n=Number(l.currentTarget.getAttribute("data-option-index"));te.current!==n&&B({event:l,index:n,reason:"mouse"})},Be=l=>{B({event:l,index:Number(l.currentTarget.getAttribute("data-option-index")),reason:"touch"}),no.current=!0},Wo=l=>{const n=Number(l.currentTarget.getAttribute("data-option-index"));eo(l,j[n],"selectOption"),no.current=!1},Ro=l=>n=>{const g=S.slice();g.splice(l,1),Ue(n,g,"removeOption",{option:S[l]})},Oo=l=>{me?Ge(l,"toggleInput"):Ne(l)},wo=l=>{l.currentTarget.contains(l.target)&&l.target.getAttribute("id")!==W&&l.preventDefault()},vo=l=>{l.currentTarget.contains(l.target)&&(Z.current.focus(),Le&&We.current&&Z.current.selectionEnd-Z.current.selectionStart===0&&Z.current.select(),We.current=!1)},co=l=>{!v&&(_===""||!me)&&Oo(l)};let oo=k&&_.length>0;oo=oo||(T?S.length>0:S!==null);let ao=j;return N&&(ao=j.reduce((l,n,g)=>{const x=N(n);return l.length>0&&l[l.length-1].group===x?l[l.length-1].options.push(n):l.push({key:g,index:g,group:x,options:[n]}),l},[])),v&&Fe&&ro(),{getRootProps:(l={})=>a({"aria-owns":Ke?`${W}-listbox`:null},l,{onKeyDown:ko(l),onMouseDown:wo,onClick:vo}),getInputLabelProps:()=>({id:`${W}-label`,htmlFor:W}),getInputProps:()=>({id:W,value:_,onBlur:ro,onFocus:jo,onChange:Ce,onMouseDown:co,"aria-activedescendant":z?"":null,"aria-autocomplete":r?"both":"list","aria-controls":Ke?`${W}-listbox`:void 0,"aria-expanded":Ke,autoComplete:"off",ref:Z,autoCapitalize:"none",spellCheck:"false",role:"combobox",disabled:v}),getClearProps:()=>({tabIndex:-1,type:"button",onClick:ho}),getPopupIndicatorProps:()=>({tabIndex:-1,type:"button",onClick:Oo}),getTagProps:({index:l})=>a({key:l,"data-tag-index":l,tabIndex:-1},!Se&&{onDelete:Ro(l)}),getListboxProps:()=>({role:"listbox",id:`${W}-listbox`,"aria-labelledby":`${W}-label`,ref:Po,onMouseDown:l=>{l.preventDefault()}}),getOptionProps:({index:l,option:n})=>{var g;const x=(T?S:[S]).some(pe=>pe!=null&&oe(n,pe)),K=C?C(n):!1;return{key:(g=I==null?void 0:I(n))!=null?g:ee(n),tabIndex:-1,role:"option",id:`${W}-option-${l}`,onMouseMove:ve,onClick:Wo,onTouchStart:Be,"data-option-index":l,"aria-disabled":K,"aria-selected":x}},id:W,inputValue:_,value:S,dirty:oo,expanded:z&&Me,popupOpen:z,focused:Fe||H!==-1,anchorEl:Me,setAnchorEl:Y,focusedTag:H,groupedOptions:ao}}function Qt(e){return ye("MuiListSubheader",e)}$e("MuiListSubheader",["root","colorPrimary","colorInherit","gutters","inset","sticky"]);const en=["className","color","component","disableGutters","disableSticky","inset"],on=e=>{const{classes:o,color:t,disableGutters:r,inset:s,disableSticky:c}=e,d={root:["root",t!=="default"&&`color${w(t)}`,!r&&"gutters",s&&"inset",!c&&"sticky"]};return Ie(d,Qt,o)},tn=L("li",{name:"MuiListSubheader",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.color!=="default"&&o[`color${w(t.color)}`],!t.disableGutters&&o.gutters,t.inset&&o.inset,!t.disableSticky&&o.sticky]}})(({theme:e,ownerState:o})=>a({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)},o.color==="primary"&&{color:(e.vars||e).palette.primary.main},o.color==="inherit"&&{color:"inherit"},!o.disableGutters&&{paddingLeft:16,paddingRight:16},o.inset&&{paddingLeft:72},!o.disableSticky&&{position:"sticky",top:0,zIndex:1,backgroundColor:(e.vars||e).palette.background.paper})),bt=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiListSubheader"}),{className:s,color:c="default",component:d="li",disableGutters:i=!1,disableSticky:b=!1,inset:p=!1}=r,m=ae(r,en),h=a({},r,{color:c,component:d,disableGutters:i,disableSticky:b,inset:p}),$=on(h);return f.jsx(tn,a({as:d,className:ne($.root,s),ref:t,ownerState:h},m))});bt.muiSkipListHighlight=!0;const nn=bt,rn=zo(f.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 an(e){return ye("MuiChip",e)}const ln=$e("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"]),V=ln,sn=["avatar","className","clickable","color","component","deleteIcon","disabled","icon","label","onClick","onDelete","onKeyDown","onKeyUp","size","variant","tabIndex","skipFocusWhenDisabled"],cn=e=>{const{classes:o,disabled:t,size:r,color:s,iconColor:c,onDelete:d,clickable:i,variant:b}=e,p={root:["root",b,t&&"disabled",`size${w(r)}`,`color${w(s)}`,i&&"clickable",i&&`clickableColor${w(s)}`,d&&"deletable",d&&`deletableColor${w(s)}`,`${b}${w(s)}`],label:["label",`label${w(r)}`],avatar:["avatar",`avatar${w(r)}`,`avatarColor${w(s)}`],icon:["icon",`icon${w(r)}`,`iconColor${w(c)}`],deleteIcon:["deleteIcon",`deleteIcon${w(r)}`,`deleteIconColor${w(s)}`,`deleteIcon${w(b)}Color${w(s)}`]};return Ie(p,an,o)},dn=L("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e,{color:r,iconColor:s,clickable:c,onDelete:d,size:i,variant:b}=t;return[{[`& .${V.avatar}`]:o.avatar},{[`& .${V.avatar}`]:o[`avatar${w(i)}`]},{[`& .${V.avatar}`]:o[`avatarColor${w(r)}`]},{[`& .${V.icon}`]:o.icon},{[`& .${V.icon}`]:o[`icon${w(i)}`]},{[`& .${V.icon}`]:o[`iconColor${w(s)}`]},{[`& .${V.deleteIcon}`]:o.deleteIcon},{[`& .${V.deleteIcon}`]:o[`deleteIcon${w(i)}`]},{[`& .${V.deleteIcon}`]:o[`deleteIconColor${w(r)}`]},{[`& .${V.deleteIcon}`]:o[`deleteIcon${w(b)}Color${w(r)}`]},o.root,o[`size${w(i)}`],o[`color${w(r)}`],c&&o.clickable,c&&r!=="default"&&o[`clickableColor${w(r)})`],d&&o.deletable,d&&r!=="default"&&o[`deletableColor${w(r)}`],o[b],o[`${b}${w(r)}`]]}})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return a({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",[`&.${V.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${V.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${V.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${V.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${V.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${V.icon}`]:a({marginLeft:5,marginRight:-6},o.size==="small"&&{fontSize:18,marginLeft:4,marginRight:-4},o.iconColor===o.color&&a({color:e.vars?e.vars.palette.Chip.defaultIconColor:t},o.color!=="default"&&{color:"inherit"})),[`& .${V.deleteIcon}`]:a({WebkitTapHighlightColor:"transparent",color:e.vars?`rgba(${e.vars.palette.text.primaryChannel} / 0.26)`:Re(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)`:Re(e.palette.text.primary,.4)}},o.size==="small"&&{fontSize:16,marginRight:4,marginLeft:-4},o.color!=="default"&&{color:e.vars?`rgba(${e.vars.palette[o.color].contrastTextChannel} / 0.7)`:Re(e.palette[o.color].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[o.color].contrastText}})},o.size==="small"&&{height:24},o.color!=="default"&&{backgroundColor:(e.vars||e).palette[o.color].main,color:(e.vars||e).palette[o.color].contrastText},o.onDelete&&{[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}},o.onDelete&&o.color!=="default"&&{[`&.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette[o.color].dark}})},({theme:e,ownerState:o})=>a({},o.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}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity)},[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.action.selectedChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.action.selected,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)},"&:active":{boxShadow:(e.vars||e).shadows[1]}},o.clickable&&o.color!=="default"&&{[`&:hover, &.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette[o.color].dark}}),({theme:e,ownerState:o})=>a({},o.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]}`,[`&.${V.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${V.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${V.avatar}`]:{marginLeft:4},[`& .${V.avatarSmall}`]:{marginLeft:2},[`& .${V.icon}`]:{marginLeft:4},[`& .${V.iconSmall}`]:{marginLeft:2},[`& .${V.deleteIcon}`]:{marginRight:5},[`& .${V.deleteIconSmall}`]:{marginRight:3}},o.variant==="outlined"&&o.color!=="default"&&{color:(e.vars||e).palette[o.color].main,border:`1px solid ${e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / 0.7)`:Re(e.palette[o.color].main,.7)}`,[`&.${V.clickable}:hover`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Re(e.palette[o.color].main,e.palette.action.hoverOpacity)},[`&.${V.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / ${e.vars.palette.action.focusOpacity})`:Re(e.palette[o.color].main,e.palette.action.focusOpacity)},[`& .${V.deleteIcon}`]:{color:e.vars?`rgba(${e.vars.palette[o.color].mainChannel} / 0.7)`:Re(e.palette[o.color].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[o.color].main}}})),un=L("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,o)=>{const{ownerState:t}=e,{size:r}=t;return[o.label,o[`label${w(r)}`]]}})(({ownerState:e})=>a({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 Go(e){return e.key==="Backspace"||e.key==="Delete"}const pn=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiChip"}),{avatar:s,className:c,clickable:d,color:i="default",component:b,deleteIcon:p,disabled:m=!1,icon:h,label:$,onClick:v,onDelete:R,onKeyDown:M,onKeyUp:P,size:O="medium",variant:k="filled",tabIndex:C,skipFocusWhenDisabled:I=!1}=r,E=ae(r,sn),N=u.useRef(null),F=lo(N,t),q=A=>{A.stopPropagation(),R&&R(A)},le=A=>{A.currentTarget===A.target&&Go(A)&&A.preventDefault(),M&&M(A)},de=A=>{A.currentTarget===A.target&&(R&&Go(A)?R(A):A.key==="Escape"&&N.current&&N.current.blur()),P&&P(A)},oe=d!==!1&&v?!0:d,T=oe||R?Uo:b||"div",J=a({},r,{component:T,disabled:m,size:O,color:i,iconColor:u.isValidElement(h)&&h.props.color||i,onDelete:!!R,clickable:oe,variant:k}),G=cn(J),se=T===Uo?a({component:b||"div",focusVisibleClassName:G.focusVisible},R&&{disableRipple:!0}):{};let Q=null;R&&(Q=p&&u.isValidElement(p)?u.cloneElement(p,{className:ne(p.props.className,G.deleteIcon),onClick:q}):f.jsx(rn,{className:ne(G.deleteIcon),onClick:q}));let re=null;s&&u.isValidElement(s)&&(re=u.cloneElement(s,{className:ne(G.avatar,s.props.className)}));let U=null;return h&&u.isValidElement(h)&&(U=u.cloneElement(h,{className:ne(G.icon,h.props.className)})),f.jsxs(dn,a({as:T,className:ne(G.root,c),disabled:oe&&m?!0:void 0,onClick:v,onKeyDown:le,onKeyUp:de,ref:F,tabIndex:I&&m?-1:C,ownerState:J},se,E,{children:[re||U,f.jsx(un,{className:ne(G.label),ownerState:J,children:$}),Q]}))}),fn=pn;function bn(e){return f.jsx(qt,a({},e,{defaultTheme:wt,themeId:Lt}))}function gn(e){return ye("MuiInputBase",e)}const mn=$e("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]),Oe=mn,hn=["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"],Co=(e,o)=>{const{ownerState:t}=e;return[o.root,t.formControl&&o.formControl,t.startAdornment&&o.adornedStart,t.endAdornment&&o.adornedEnd,t.error&&o.error,t.size==="small"&&o.sizeSmall,t.multiline&&o.multiline,t.color&&o[`color${w(t.color)}`],t.fullWidth&&o.fullWidth,t.hiddenLabel&&o.hiddenLabel]},yo=(e,o)=>{const{ownerState:t}=e;return[o.input,t.size==="small"&&o.inputSizeSmall,t.multiline&&o.inputMultiline,t.type==="search"&&o.inputTypeSearch,t.startAdornment&&o.inputAdornedStart,t.endAdornment&&o.inputAdornedEnd,t.hiddenLabel&&o.inputHiddenLabel]},vn=e=>{const{classes:o,color:t,disabled:r,error:s,endAdornment:c,focused:d,formControl:i,fullWidth:b,hiddenLabel:p,multiline:m,readOnly:h,size:$,startAdornment:v,type:R}=e,M={root:["root",`color${w(t)}`,r&&"disabled",s&&"error",b&&"fullWidth",d&&"focused",i&&"formControl",$&&$!=="medium"&&`size${w($)}`,m&&"multiline",v&&"adornedStart",c&&"adornedEnd",p&&"hiddenLabel",h&&"readOnly"],input:["input",r&&"disabled",R==="search"&&"inputTypeSearch",m&&"inputMultiline",$==="small"&&"inputSizeSmall",p&&"inputHiddenLabel",v&&"inputAdornedStart",c&&"inputAdornedEnd",h&&"readOnly"]};return Ie(M,gn,o)},$o=L("div",{name:"MuiInputBase",slot:"Root",overridesResolver:Co})(({theme:e,ownerState:o})=>a({},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",[`&.${Oe.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"}},o.multiline&&a({padding:"4px 0 5px"},o.size==="small"&&{paddingTop:1}),o.fullWidth&&{width:"100%"})),Io=L("input",{name:"MuiInputBase",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light",r=a({color:"currentColor"},e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},{transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})}),s={opacity:"0 !important"},c=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return a({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] + .${Oe.formControl} &`]:{"&::-webkit-input-placeholder":s,"&::-moz-placeholder":s,"&:-ms-input-placeholder":s,"&::-ms-input-placeholder":s,"&:focus::-webkit-input-placeholder":c,"&:focus::-moz-placeholder":c,"&:focus:-ms-input-placeholder":c,"&:focus::-ms-input-placeholder":c},[`&.${Oe.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},"&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}},o.size==="small"&&{paddingTop:1},o.multiline&&{height:"auto",resize:"none",padding:0,paddingTop:0},o.type==="search"&&{MozAppearance:"textfield"})}),xn=f.jsx(bn,{styles:{"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}}),Cn=u.forwardRef(function(o,t){var r;const s=Pe({props:o,name:"MuiInputBase"}),{"aria-describedby":c,autoComplete:d,autoFocus:i,className:b,components:p={},componentsProps:m={},defaultValue:h,disabled:$,disableInjectingGlobalStyles:v,endAdornment:R,fullWidth:M=!1,id:P,inputComponent:O="input",inputProps:k={},inputRef:C,maxRows:I,minRows:E,multiline:N=!1,name:F,onBlur:q,onChange:le,onClick:de,onFocus:oe,onKeyDown:T,onKeyUp:J,placeholder:G,readOnly:se,renderSuffix:Q,rows:re,slotProps:U={},slots:A={},startAdornment:ie,type:Se="text",value:Le}=s,ue=ae(s,hn),W=k.value!=null?k.value:Le,{current:ee}=u.useRef(W!=null),fe=u.useRef(),We=u.useCallback(z=>{},[]),Z=lo(fe,C,k.ref,We),[be,Me]=u.useState(!1),Y=so(),H=io({props:s,muiFormControl:Y,states:["color","disabled","error","hiddenLabel","size","required","filled"]});H.focused=Y?Y.focused:be,u.useEffect(()=>{!Y&&$&&be&&(Me(!1),q&&q())},[Y,$,be,q]);const ze=Y&&Y.onFilled,_e=Y&&Y.onEmpty,te=u.useCallback(z=>{ft(z)?ze&&ze():_e&&_e()},[ze,_e]);st(()=>{ee&&te({value:W})},[W,te,ee]);const S=z=>{if(H.disabled){z.stopPropagation();return}oe&&oe(z),k.onFocus&&k.onFocus(z),Y&&Y.onFocus?Y.onFocus(z):Me(!0)},to=z=>{q&&q(z),k.onBlur&&k.onBlur(z),Y&&Y.onBlur?Y.onBlur(z):Me(!1)},_=(z,...j)=>{if(!ee){const he=z.target||fe.current;if(he==null)throw new Error(it(1));te({value:he.value})}k.onChange&&k.onChange(z,...j),le&&le(z,...j)};u.useEffect(()=>{te(fe.current)},[]);const xe=z=>{fe.current&&z.currentTarget===z.target&&fe.current.focus(),de&&de(z)};let Fe=O,ce=k;N&&Fe==="input"&&(re?ce=a({type:void 0,minRows:re,maxRows:re},ce):ce=a({type:void 0,maxRows:I,minRows:E},ce),Fe=_t);const Te=z=>{te(z.animationName==="mui-auto-fill-cancel"?fe.current:{value:"x"})};u.useEffect(()=>{Y&&Y.setAdornedStart(!!ie)},[Y,ie]);const me=a({},s,{color:H.color||"primary",disabled:H.disabled,endAdornment:R,error:H.error,focused:H.focused,formControl:Y,fullWidth:M,hiddenLabel:H.hiddenLabel,multiline:N,size:H.size,startAdornment:ie,type:Se}),Ae=vn(me),Ye=A.root||p.Root||$o,De=U.root||m.root||{},Ee=A.input||p.Input||Io;return ce=a({},ce,(r=U.input)!=null?r:m.input),f.jsxs(u.Fragment,{children:[!v&&xn,f.jsxs(Ye,a({},De,!Ho(Ye)&&{ownerState:a({},me,De.ownerState)},{ref:t,onClick:xe},ue,{className:ne(Ae.root,De.className,b,se&&"MuiInputBase-readOnly"),children:[ie,f.jsx(Bt.Provider,{value:null,children:f.jsx(Ee,a({ownerState:me,"aria-invalid":H.error,"aria-describedby":c,autoComplete:d,autoFocus:i,defaultValue:h,disabled:H.disabled,id:P,onAnimationStart:Te,name:F,placeholder:G,readOnly:se,required:H.required,rows:re,value:W,onKeyDown:T,onKeyUp:J,type:Se},ce,!Ho(Ee)&&{as:Fe,ownerState:a({},me,ce.ownerState)},{ref:Z,className:ne(Ae.input,ce.className,se&&"MuiInputBase-readOnly"),onBlur:to,onChange:_,onFocus:S}))}),R,Q?Q(a({},H,{startAdornment:ie})):null]}))]})}),Do=Cn;function yn(e){return ye("MuiInput",e)}const $n=a({},Oe,$e("MuiInput",["root","underline","input"])),Qe=$n;function In(e){return ye("MuiOutlinedInput",e)}const Sn=a({},Oe,$e("MuiOutlinedInput",["root","notchedOutline","input"])),Ve=Sn;function Pn(e){return ye("MuiFilledInput",e)}const kn=a({},Oe,$e("MuiFilledInput",["root","underline","input"])),we=kn,gt=zo(f.jsx("path",{d:"M7 10l5 5 5-5z"}),"ArrowDropDown");function Rn(e){return ye("MuiAutocomplete",e)}const On=$e("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"]),D=On;var Xo,Yo;const wn=["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"],Ln=["ref"],Mn=["key"],Fn=e=>{const{classes:o,disablePortal:t,expanded:r,focused:s,fullWidth:c,hasClearIcon:d,hasPopupIcon:i,inputFocused:b,popupOpen:p,size:m}=e,h={root:["root",r&&"expanded",s&&"focused",c&&"fullWidth",d&&"hasClearIcon",i&&"hasPopupIcon"],inputRoot:["inputRoot"],input:["input",b&&"inputFocused"],tag:["tag",`tagSize${w(m)}`],endAdornment:["endAdornment"],clearIndicator:["clearIndicator"],popupIndicator:["popupIndicator",p&&"popupIndicatorOpen"],popper:["popper",t&&"popperDisablePortal"],paper:["paper"],listbox:["listbox"],loading:["loading"],noOptions:["noOptions"],option:["option"],groupLabel:["groupLabel"],groupUl:["groupUl"]};return Ie(h,Rn,o)},Tn=L("div",{name:"MuiAutocomplete",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e,{fullWidth:r,hasClearIcon:s,hasPopupIcon:c,inputFocused:d,size:i}=t;return[{[`& .${D.tag}`]:o.tag},{[`& .${D.tag}`]:o[`tagSize${w(i)}`]},{[`& .${D.inputRoot}`]:o.inputRoot},{[`& .${D.input}`]:o.input},{[`& .${D.input}`]:d&&o.inputFocused},o.root,r&&o.fullWidth,c&&o.hasPopupIcon,s&&o.hasClearIcon]}})(({ownerState:e})=>a({[`&.${D.focused} .${D.clearIndicator}`]:{visibility:"visible"},"@media (pointer: fine)":{[`&:hover .${D.clearIndicator}`]:{visibility:"visible"}}},e.fullWidth&&{width:"100%"},{[`& .${D.tag}`]:a({margin:3,maxWidth:"calc(100% - 6px)"},e.size==="small"&&{margin:2,maxWidth:"calc(100% - 4px)"}),[`& .${D.inputRoot}`]:{flexWrap:"wrap",[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4},[`& .${D.input}`]:{width:0,minWidth:30}},[`& .${Qe.root}`]:{paddingBottom:1,"& .MuiInput-input":{padding:"4px 4px 4px 0px"}},[`& .${Qe.root}.${Oe.sizeSmall}`]:{[`& .${Qe.input}`]:{padding:"2px 4px 3px 0"}},[`& .${Ve.root}`]:{padding:9,[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${D.input}`]:{padding:"7.5px 4px 7.5px 5px"},[`& .${D.endAdornment}`]:{right:9}},[`& .${Ve.root}.${Oe.sizeSmall}`]:{paddingTop:6,paddingBottom:6,paddingLeft:6,[`& .${D.input}`]:{padding:"2.5px 4px 2.5px 8px"}},[`& .${we.root}`]:{paddingTop:19,paddingLeft:8,[`.${D.hasPopupIcon}&, .${D.hasClearIcon}&`]:{paddingRight:26+4+9},[`.${D.hasPopupIcon}.${D.hasClearIcon}&`]:{paddingRight:52+4+9},[`& .${we.input}`]:{padding:"7px 4px"},[`& .${D.endAdornment}`]:{right:9}},[`& .${we.root}.${Oe.sizeSmall}`]:{paddingBottom:1,[`& .${we.input}`]:{padding:"2.5px 4px"}},[`& .${Oe.hiddenLabel}`]:{paddingTop:8},[`& .${we.root}.${Oe.hiddenLabel}`]:{paddingTop:0,paddingBottom:0,[`& .${D.input}`]:{paddingTop:16,paddingBottom:17}},[`& .${we.root}.${Oe.hiddenLabel}.${Oe.sizeSmall}`]:{[`& .${D.input}`]:{paddingTop:8,paddingBottom:9}},[`& .${D.input}`]:a({flexGrow:1,textOverflow:"ellipsis",opacity:0},e.inputFocused&&{opacity:1})})),An=L("div",{name:"MuiAutocomplete",slot:"EndAdornment",overridesResolver:(e,o)=>o.endAdornment})({position:"absolute",right:0,top:"calc(50% - 14px)"}),Nn=L(ut,{name:"MuiAutocomplete",slot:"ClearIndicator",overridesResolver:(e,o)=>o.clearIndicator})({marginRight:-2,padding:4,visibility:"hidden"}),zn=L(ut,{name:"MuiAutocomplete",slot:"PopupIndicator",overridesResolver:({ownerState:e},o)=>a({},o.popupIndicator,e.popupOpen&&o.popupIndicatorOpen)})(({ownerState:e})=>a({padding:2,marginRight:-2},e.popupOpen&&{transform:"rotate(180deg)"})),Dn=L(No,{name:"MuiAutocomplete",slot:"Popper",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${D.option}`]:o.option},o.popper,t.disablePortal&&o.popperDisablePortal]}})(({theme:e,ownerState:o})=>a({zIndex:(e.vars||e).zIndex.modal},o.disablePortal&&{position:"absolute"})),En=L(pt,{name:"MuiAutocomplete",slot:"Paper",overridesResolver:(e,o)=>o.paper})(({theme:e})=>a({},e.typography.body1,{overflow:"auto"})),Bn=L("div",{name:"MuiAutocomplete",slot:"Loading",overridesResolver:(e,o)=>o.loading})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),jn=L("div",{name:"MuiAutocomplete",slot:"NoOptions",overridesResolver:(e,o)=>o.noOptions})(({theme:e})=>({color:(e.vars||e).palette.text.secondary,padding:"14px 16px"})),Wn=L("div",{name:"MuiAutocomplete",slot:"Listbox",overridesResolver:(e,o)=>o.listbox})(({theme:e})=>({listStyle:"none",margin:0,padding:"8px 0",maxHeight:"40vh",overflow:"auto",position:"relative",[`& .${D.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"},[`&.${D.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"},[`&.${D.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})`:Re(e.palette.primary.main,e.palette.action.selectedOpacity),[`&.${D.focused}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))`:Re(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:(e.vars||e).palette.action.selected}},[`&.${D.focusVisible}`]:{backgroundColor:e.vars?`rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))`:Re(e.palette.primary.main,e.palette.action.selectedOpacity+e.palette.action.focusOpacity)}}}})),_n=L(nn,{name:"MuiAutocomplete",slot:"GroupLabel",overridesResolver:(e,o)=>o.groupLabel})(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,top:-8})),Un=L("ul",{name:"MuiAutocomplete",slot:"GroupUl",overridesResolver:(e,o)=>o.groupUl})({padding:0,[`& .${D.option}`]:{paddingLeft:24}}),Hn=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiAutocomplete"}),{autoComplete:b=!1,autoHighlight:p=!1,autoSelect:m=!1,blurOnSelect:h=!1,ChipProps:$,className:v,clearIcon:R=Xo||(Xo=f.jsx(Gt,{fontSize:"small"})),clearOnBlur:M=!i.freeSolo,clearOnEscape:P=!1,clearText:O="Clear",closeText:k="Close",componentsProps:C={},defaultValue:I=i.multiple?[]:null,disableClearable:E=!1,disableCloseOnSelect:N=!1,disabled:F=!1,disabledItemsFocusable:q=!1,disableListWrap:le=!1,disablePortal:de=!1,filterSelectedOptions:oe=!1,forcePopupIcon:T="auto",freeSolo:J=!1,fullWidth:G=!1,getLimitTagsText:se=n=>`+${n}`,getOptionLabel:Q,groupBy:re,handleHomeEndKeys:U=!i.freeSolo,includeInputInList:A=!1,limitTags:ie=-1,ListboxComponent:Se="ul",ListboxProps:Le,loading:ue=!1,loadingText:W="Loading…",multiple:ee=!1,noOptionsText:fe="No options",openOnFocus:We=!1,openText:Z="Open",PaperComponent:be=pt,PopperComponent:Me=No,popupIcon:Y=Yo||(Yo=f.jsx(gt,{})),readOnly:H=!1,renderGroup:ze,renderInput:_e,renderOption:te,renderTags:S,selectOnFocus:to=!i.freeSolo,size:_="medium",slotProps:xe={}}=i,Fe=ae(i,wn),{getRootProps:ce,getInputProps:Te,getInputLabelProps:me,getPopupIndicatorProps:Ae,getClearProps:Ye,getTagProps:De,getListboxProps:Ee,getOptionProps:z,value:j,dirty:he,expanded:Ke,id:qe,popupOpen:y,focused:B,focusedTag:X,anchorEl:ke,setAnchorEl:Ze,inputValue:Po,groupedOptions:Ne}=Jt(a({},i,{componentName:"Autocomplete"})),Ge=!E&&!F&&he&&!H,Ue=(!J||T===!0)&&T!==!1,{onMouseDown:no}=Te(),{ref:eo}=Le??{},go=Ee(),{ref:mo}=go,ho=ae(go,Ln),ko=lo(mo,eo),ro=Q||(n=>{var g;return(g=n.label)!=null?g:n}),Ce=a({},i,{disablePortal:de,expanded:Ke,focused:B,fullWidth:G,getOptionLabel:ro,hasClearIcon:Ge,hasPopupIcon:Ue,inputFocused:X===-1,popupOpen:y,size:_}),ve=Fn(Ce);let Be;if(ee&&j.length>0){const n=g=>a({className:ve.tag,disabled:F},De(g));S?Be=S(j,n,Ce):Be=j.map((g,x)=>f.jsx(fn,a({label:ro(g),size:_},n({index:x}),$)))}if(ie>-1&&Array.isArray(Be)){const n=Be.length-ie;!B&&n>0&&(Be=Be.splice(0,ie),Be.push(f.jsx("span",{className:ve.tag,children:se(n)},Be.length)))}const Ro=ze||(n=>f.jsxs("li",{children:[f.jsx(_n,{className:ve.groupLabel,ownerState:Ce,component:"div",children:n.group}),f.jsx(Un,{className:ve.groupUl,ownerState:Ce,children:n.children})]},n.key)),wo=te||((n,g)=>{const{key:x}=n,K=ae(n,Mn);return f.jsx("li",a({},K,{children:ro(g)}),x)}),vo=(n,g)=>{const x=z({option:n,index:g});return wo(a({},x,{className:ve.option}),n,{selected:x["aria-selected"],index:g,inputValue:Po},Ce)},co=(r=xe.clearIndicator)!=null?r:C.clearIndicator,oo=(s=xe.paper)!=null?s:C.paper,ao=(c=xe.popper)!=null?c:C.popper,l=(d=xe.popupIndicator)!=null?d:C.popupIndicator;return f.jsxs(u.Fragment,{children:[f.jsx(Tn,a({ref:t,className:ne(ve.root,v),ownerState:Ce},ce(Fe),{children:_e({id:qe,disabled:F,fullWidth:!0,size:_==="small"?"small":void 0,InputLabelProps:me(),InputProps:a({ref:Ze,className:ve.inputRoot,startAdornment:Be,onClick:n=>{n.target===n.currentTarget&&no(n)}},(Ge||Ue)&&{endAdornment:f.jsxs(An,{className:ve.endAdornment,ownerState:Ce,children:[Ge?f.jsx(Nn,a({},Ye(),{"aria-label":O,title:O,ownerState:Ce},co,{className:ne(ve.clearIndicator,co==null?void 0:co.className),children:R})):null,Ue?f.jsx(zn,a({},Ae(),{disabled:F,"aria-label":y?k:Z,title:y?k:Z,ownerState:Ce},l,{className:ne(ve.popupIndicator,l==null?void 0:l.className),children:Y})):null]})}),inputProps:a({className:ve.input,disabled:F,readOnly:H},Te())})})),ke?f.jsx(Dn,a({as:Me,disablePortal:de,style:{width:ke?ke.clientWidth:null},ownerState:Ce,role:"presentation",anchorEl:ke,open:y},ao,{className:ne(ve.popper,ao==null?void 0:ao.className),children:f.jsxs(En,a({ownerState:Ce,as:be},oo,{className:ne(ve.paper,oo==null?void 0:oo.className),children:[ue&&Ne.length===0?f.jsx(Bn,{className:ve.loading,ownerState:Ce,children:W}):null,Ne.length===0&&!J&&!ue?f.jsx(jn,{className:ve.noOptions,ownerState:Ce,role:"presentation",onMouseDown:n=>{n.preventDefault()},children:fe}):null,Ne.length>0?f.jsx(Wn,a({as:Se,className:ve.listbox,ownerState:Ce},ho,Le,{ref:ko,children:Ne.map((n,g)=>re?Ro({key:n.key,group:n.group,children:n.options.map((x,K)=>vo(x,n.index+K))}):vo(n,g))})):null]}))})):null]})}),Vn=Hn;function Kn(e){return ye("MuiCircularProgress",e)}$e("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const qn=["className","color","disableShrink","size","style","thickness","value","variant"];let So=e=>e,Zo,Jo,Qo,et;const Je=44,Gn=ct(Zo||(Zo=So` 0% { transform: rotate(0deg); } @@ -6,7 +6,7 @@ import{r as u,j as f,bY as kt,bZ as Rt,p as xo,n as Ot,e as a,c as ye,d as $e,s 100% { transform: rotate(360deg); } -`)),Xn=ct(Qo||(Qo=So` +`)),Xn=ct(Jo||(Jo=So` 0% { stroke-dasharray: 1px, 200px; stroke-dashoffset: 0; @@ -21,11 +21,11 @@ import{r as u,j as f,bY as kt,bZ as Rt,p as xo,n as Ot,e as a,c as ye,d as $e,s stroke-dasharray: 100px, 200px; stroke-dashoffset: -125px; } -`)),Yn=e=>{const{classes:o,variant:t,color:r,disableShrink:s}=e,c={root:["root",t,`color${w(r)}`],svg:["svg"],circle:["circle",`circle${w(t)}`,s&&"circleDisableShrink"]};return Ie(c,Kn,o)},Zn=L("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[t.variant],o[`color${w(t.color)}`]]}})(({ownerState:e,theme:o})=>a({display:"inline-block"},e.variant==="determinate"&&{transition:o.transitions.create("transform")},e.color!=="inherit"&&{color:(o.vars||o).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&dt(Jo||(Jo=So` +`)),Yn=e=>{const{classes:o,variant:t,color:r,disableShrink:s}=e,c={root:["root",t,`color${w(r)}`],svg:["svg"],circle:["circle",`circle${w(t)}`,s&&"circleDisableShrink"]};return Ie(c,Kn,o)},Zn=L("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,o[t.variant],o[`color${w(t.color)}`]]}})(({ownerState:e,theme:o})=>a({display:"inline-block"},e.variant==="determinate"&&{transition:o.transitions.create("transform")},e.color!=="inherit"&&{color:(o.vars||o).palette[e.color].main}),({ownerState:e})=>e.variant==="indeterminate"&&dt(Qo||(Qo=So` animation: ${0} 1.4s linear infinite; - `),Gn)),Qn=L("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,o)=>o.svg})({display:"block"}),Jn=L("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.circle,o[`circle${w(t.variant)}`],t.disableShrink&&o.circleDisableShrink]}})(({ownerState:e,theme:o})=>a({stroke:"currentColor"},e.variant==="determinate"&&{transition:o.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&dt(et||(et=So` + `),Gn)),Jn=L("svg",{name:"MuiCircularProgress",slot:"Svg",overridesResolver:(e,o)=>o.svg})({display:"block"}),Qn=L("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.circle,o[`circle${w(t.variant)}`],t.disableShrink&&o.circleDisableShrink]}})(({ownerState:e,theme:o})=>a({stroke:"currentColor"},e.variant==="determinate"&&{transition:o.transitions.create("stroke-dashoffset")},e.variant==="indeterminate"&&{strokeDasharray:"80px, 200px",strokeDashoffset:0}),({ownerState:e})=>e.variant==="indeterminate"&&!e.disableShrink&&dt(et||(et=So` animation: ${0} 1.4s ease-in-out infinite; - `),Xn)),er=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiCircularProgress"}),{className:s,color:c="primary",disableShrink:d=!1,size:i=40,style:b,thickness:p=3.6,value:m=0,variant:h="indeterminate"}=r,$=ae(r,qn),v=a({},r,{color:c,disableShrink:d,size:i,thickness:p,value:m,variant:h}),R=Yn(v),M={},P={},O={};if(h==="determinate"){const k=2*Math.PI*((Qe-p)/2);M.strokeDasharray=k.toFixed(3),O["aria-valuenow"]=Math.round(m),M.strokeDashoffset=`${((100-m)/100*k).toFixed(3)}px`,P.transform="rotate(-90deg)"}return f.jsx(Zn,a({className:ne(R.root,s),style:a({width:i,height:i},P,b),ownerState:v,ref:t,role:"progressbar"},O,$,{children:f.jsx(Qn,{className:R.svg,ownerState:v,viewBox:`${Qe/2} ${Qe/2} ${Qe} ${Qe}`,children:f.jsx(Jn,{className:R.circle,style:M,ownerState:v,cx:Qe,cy:Qe,r:(Qe-p)/2,fill:"none",strokeWidth:p})})}))}),or=er,tr=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],nr=e=>{const{classes:o,disableUnderline:t}=e,s=Ie({root:["root",!t&&"underline"],input:["input"]},Pn,o);return a({},o,s)},rr=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Co(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{var t;const r=e.palette.mode==="light",s=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",c=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",d=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return a({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c,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:d,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c}},[`&.${we.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c},[`&.${we.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i}},!o.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(t=(e.vars||e).palette[o.color||"primary"])==null?void 0:t.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"},[`&.${we.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${we.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})`:s}`,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(.${we.disabled}, .${we.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${we.disabled}:before`]:{borderBottomStyle:"dotted"}},o.startAdornment&&{paddingLeft:12},o.endAdornment&&{paddingRight:12},o.multiline&&a({padding:"25px 12px 8px"},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9}))}),ar=L(Io,{name:"MuiFilledInput",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>a({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"}}},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9},o.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),mt=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiFilledInput"}),{components:b={},componentsProps:p,fullWidth:m=!1,inputComponent:h="input",multiline:$=!1,slotProps:v,slots:R={},type:M="text"}=i,P=ae(i,tr),O=a({},i,{fullWidth:m,inputComponent:h,multiline:$,type:M}),k=nr(i),C={root:{ownerState:O},input:{ownerState:O}},I=v??p?To(C,v??p):C,E=(r=(s=R.root)!=null?s:b.Root)!=null?r:rr,N=(c=(d=R.input)!=null?d:b.Input)!=null?c:ar;return f.jsx(Do,a({slots:{root:E,input:N},componentsProps:I,fullWidth:m,inputComponent:h,multiline:$,ref:t,type:M},P,{classes:k}))});mt.muiName="Input";const ht=mt;function lr(e){return ye("MuiFormHelperText",e)}const sr=$e("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),ot=sr;var tt;const ir=["children","className","component","disabled","error","filled","focused","margin","required","variant"],cr=e=>{const{classes:o,contained:t,size:r,disabled:s,error:c,filled:d,focused:i,required:b}=e,p={root:["root",s&&"disabled",c&&"error",r&&`size${w(r)}`,t&&"contained",i&&"focused",d&&"filled",b&&"required"]};return Ie(p,lr,o)},dr=L("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.size&&o[`size${w(t.size)}`],t.contained&&o.contained,t.filled&&o.filled]}})(({theme:e,ownerState:o})=>a({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${ot.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ot.error}`]:{color:(e.vars||e).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),ur=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiFormHelperText"}),{children:s,className:c,component:d="p"}=r,i=ae(r,ir),b=so(),p=io({props:r,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),m=a({},r,{component:d,contained:p.variant==="filled"||p.variant==="outlined",variant:p.variant,size:p.size,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required}),h=cr(m);return f.jsx(dr,a({as:d,ownerState:m,className:ne(h.root,c),ref:t},i,{children:s===" "?tt||(tt=f.jsx("span",{className:"notranslate",children:"​"})):s}))}),pr=ur;function fr(e){return ye("MuiFormLabel",e)}const br=$e("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),bo=br,gr=["children","className","color","component","disabled","error","filled","focused","required"],mr=e=>{const{classes:o,color:t,focused:r,disabled:s,error:c,filled:d,required:i}=e,b={root:["root",`color${w(t)}`,s&&"disabled",c&&"error",d&&"filled",r&&"focused",i&&"required"],asterisk:["asterisk",c&&"error"]};return Ie(b,fr,o)},hr=L("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},o)=>a({},o.root,e.color==="secondary"&&o.colorSecondary,e.filled&&o.filled)})(({theme:e,ownerState:o})=>a({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${bo.focused}`]:{color:(e.vars||e).palette[o.color].main},[`&.${bo.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${bo.error}`]:{color:(e.vars||e).palette.error.main}})),vr=L("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${bo.error}`]:{color:(e.vars||e).palette.error.main}})),xr=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiFormLabel"}),{children:s,className:c,component:d="label"}=r,i=ae(r,gr),b=so(),p=io({props:r,muiFormControl:b,states:["color","required","focused","disabled","error","filled"]}),m=a({},r,{color:p.color||"primary",component:d,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required}),h=mr(m);return f.jsxs(hr,a({as:d,ownerState:m,className:ne(h.root,c),ref:t},i,{children:[s,p.required&&f.jsxs(vr,{ownerState:m,"aria-hidden":!0,className:h.asterisk,children:[" ","*"]})]}))}),Cr=xr,yr=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],$r=e=>{const{classes:o,disableUnderline:t}=e,s=Ie({root:["root",!t&&"underline"],input:["input"]},yn,o);return a({},o,s)},Ir=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Co(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{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})`),a({position:"relative"},o.formControl&&{"label + &":{marginTop:16}},!o.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(e.vars||e).palette[o.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"},[`&.${Je.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Je.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(.${Je.disabled}, .${Je.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Je.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Sr=L(Io,{name:"MuiInput",slot:"Input",overridesResolver:yo})({}),vt=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiInput"}),{disableUnderline:b,components:p={},componentsProps:m,fullWidth:h=!1,inputComponent:$="input",multiline:v=!1,slotProps:R,slots:M={},type:P="text"}=i,O=ae(i,yr),k=$r(i),I={root:{ownerState:{disableUnderline:b}}},E=R??m?To(R??m,I):I,N=(r=(s=M.root)!=null?s:p.Root)!=null?r:Ir,F=(c=(d=M.input)!=null?d:p.Input)!=null?c:Sr;return f.jsx(Do,a({slots:{root:N,input:F},slotProps:E,fullWidth:h,inputComponent:$,multiline:v,ref:t,type:P},O,{classes:k}))});vt.muiName="Input";const xt=vt;function Pr(e){return ye("MuiInputLabel",e)}$e("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const kr=["disableAnimation","margin","shrink","variant","className"],Rr=e=>{const{classes:o,formControl:t,size:r,shrink:s,disableAnimation:c,variant:d,required:i}=e,b={root:["root",t&&"formControl",!c&&"animated",s&&"shrink",r&&r!=="normal"&&`size${w(r)}`,d],asterisk:[i&&"asterisk"]},p=Ie(b,Pr,o);return a({},o,p)},Or=L(Cr,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${bo.asterisk}`]:o.asterisk},o.root,t.formControl&&o.formControl,t.size==="small"&&o.sizeSmall,t.shrink&&o.shrink,!t.disableAnimation&&o.animated,t.focused&&o.focused,o[t.variant]]}})(({theme:e,ownerState:o})=>a({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},o.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},o.size==="small"&&{transform:"translate(0, 17px) scale(1)"},o.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!o.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},o.variant==="filled"&&a({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},o.shrink&&a({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},o.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),o.variant==="outlined"&&a({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},o.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),wr=u.forwardRef(function(o,t){const r=Pe({name:"MuiInputLabel",props:o}),{disableAnimation:s=!1,shrink:c,className:d}=r,i=ae(r,kr),b=so();let p=c;typeof p>"u"&&b&&(p=b.filled||b.focused||b.adornedStart);const m=io({props:r,muiFormControl:b,states:["size","variant","required","focused"]}),h=a({},r,{disableAnimation:s,formControl:b,shrink:p,size:m.size,variant:m.variant,required:m.required,focused:m.focused}),$=Rr(h);return f.jsx(Or,a({"data-shrink":p,ownerState:h,ref:t,className:ne($.root,d)},i,{classes:$}))}),Lr=wr,Mr=u.createContext({}),Fr=Mr;function Tr(e){return ye("MuiList",e)}$e("MuiList",["root","padding","dense","subheader"]);const Ar=["children","className","component","dense","disablePadding","subheader"],Nr=e=>{const{classes:o,disablePadding:t,dense:r,subheader:s}=e;return Ie({root:["root",!t&&"padding",r&&"dense",s&&"subheader"]},Tr,o)},zr=L("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,!t.disablePadding&&o.padding,t.dense&&o.dense,t.subheader&&o.subheader]}})(({ownerState:e})=>a({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),Dr=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiList"}),{children:s,className:c,component:d="ul",dense:i=!1,disablePadding:b=!1,subheader:p}=r,m=ae(r,Ar),h=u.useMemo(()=>({dense:i}),[i]),$=a({},r,{component:d,dense:i,disablePadding:b}),v=Nr($);return f.jsx(Fr.Provider,{value:h,children:f.jsxs(zr,a({as:d,className:ne(v.root,c),ref:t,ownerState:$},m,{children:[p,s]}))})}),Er=Dr,Br=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function Mo(e,o,t){return e===o?e.firstChild:o&&o.nextElementSibling?o.nextElementSibling:t?null:e.firstChild}function nt(e,o,t){return e===o?t?e.firstChild:e.lastChild:o&&o.previousElementSibling?o.previousElementSibling:t?null:e.lastChild}function Ct(e,o){if(o===void 0)return!0;let t=e.innerText;return t===void 0&&(t=e.textContent),t=t.trim().toLowerCase(),t.length===0?!1:o.repeating?t[0]===o.keys[0]:t.indexOf(o.keys.join(""))===0}function uo(e,o,t,r,s,c){let d=!1,i=s(e,o,o?t:!1);for(;i;){if(i===e.firstChild){if(d)return!1;d=!0}const b=r?!1:i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||!Ct(i,c)||b)i=s(e,i,t);else return i.focus(),!0}return!1}const jr=u.forwardRef(function(o,t){const{actions:r,autoFocus:s=!1,autoFocusItem:c=!1,children:d,className:i,disabledItemsFocusable:b=!1,disableListWrap:p=!1,onKeyDown:m,variant:h="selectedMenu"}=o,$=ae(o,Br),v=u.useRef(null),R=u.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});st(()=>{s&&v.current.focus()},[s]),u.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(C,I)=>{const E=!v.current.style.width;if(C.clientHeight{const I=v.current,E=C.key,N=Fo(I).activeElement;if(E==="ArrowDown")C.preventDefault(),uo(I,N,p,b,Mo);else if(E==="ArrowUp")C.preventDefault(),uo(I,N,p,b,nt);else if(E==="Home")C.preventDefault(),uo(I,null,p,b,Mo);else if(E==="End")C.preventDefault(),uo(I,null,p,b,nt);else if(E.length===1){const F=R.current,q=E.toLowerCase(),le=performance.now();F.keys.length>0&&(le-F.lastTime>500?(F.keys=[],F.repeating=!0,F.previousKeyMatched=!0):F.repeating&&q!==F.keys[0]&&(F.repeating=!1)),F.lastTime=le,F.keys.push(q);const de=N&&!F.repeating&&Ct(N,F);F.previousKeyMatched&&(de||uo(I,N,!1,b,Mo,F))?C.preventDefault():F.previousKeyMatched=!1}m&&m(C)},P=lo(v,t);let O=-1;u.Children.forEach(d,(C,I)=>{if(!u.isValidElement(C)){O===I&&(O+=1,O>=d.length&&(O=-1));return}C.props.disabled||(h==="selectedMenu"&&C.props.selected||O===-1)&&(O=I),O===I&&(C.props.disabled||C.props.muiSkipListHighlight||C.type.muiSkipListHighlight)&&(O+=1,O>=d.length&&(O=-1))});const k=u.Children.map(d,(C,I)=>{if(I===O){const E={};return c&&(E.autoFocus=!0),C.props.tabIndex===void 0&&h==="selectedMenu"&&(E.tabIndex=0),u.cloneElement(C,E)}return C});return f.jsx(Er,a({role:"menu",ref:P,className:i,onKeyDown:M,tabIndex:s?0:-1},$,{children:k}))}),Wr=jr;function _r(e){return ye("MuiMenu",e)}$e("MuiMenu",["root","paper","list"]);const Ur=["onEntering"],Hr=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Vr={vertical:"top",horizontal:"right"},Kr={vertical:"top",horizontal:"left"},qr=e=>{const{classes:o}=e;return Ie({root:["root"],paper:["paper"],list:["list"]},_r,o)},Gr=L(zt,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Xr=L(Dt,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,o)=>o.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),Yr=L(Wr,{name:"MuiMenu",slot:"List",overridesResolver:(e,o)=>o.list})({outline:0}),Zr=u.forwardRef(function(o,t){var r,s;const c=Pe({props:o,name:"MuiMenu"}),{autoFocus:d=!0,children:i,className:b,disableAutoFocusItem:p=!1,MenuListProps:m={},onClose:h,open:$,PaperProps:v={},PopoverClasses:R,transitionDuration:M="auto",TransitionProps:{onEntering:P}={},variant:O="selectedMenu",slots:k={},slotProps:C={}}=c,I=ae(c.TransitionProps,Ur),E=ae(c,Hr),N=Mt(),F=N.direction==="rtl",q=a({},c,{autoFocus:d,disableAutoFocusItem:p,MenuListProps:m,onEntering:P,PaperProps:v,transitionDuration:M,TransitionProps:I,variant:O}),le=qr(q),de=d&&!p&&$,oe=u.useRef(null),T=(A,ie)=>{oe.current&&oe.current.adjustStyleForScrollbar(A,N),P&&P(A,ie)},Q=A=>{A.key==="Tab"&&(A.preventDefault(),h&&h(A,"tabKeyDown"))};let G=-1;u.Children.map(i,(A,ie)=>{u.isValidElement(A)&&(A.props.disabled||(O==="selectedMenu"&&A.props.selected||G===-1)&&(G=ie))});const se=(r=k.paper)!=null?r:Xr,J=(s=C.paper)!=null?s:v,re=Vo({elementType:k.root,externalSlotProps:C.root,ownerState:q,className:[le.root,b]}),U=Vo({elementType:se,externalSlotProps:J,ownerState:q,className:le.paper});return f.jsx(Gr,a({onClose:h,anchorOrigin:{vertical:"bottom",horizontal:F?"right":"left"},transformOrigin:F?Vr:Kr,slots:{paper:se,root:k.root},slotProps:{root:re,paper:U},open:$,ref:t,transitionDuration:M,TransitionProps:a({onEntering:T},I),ownerState:q},E,{classes:R,children:f.jsx(Yr,a({onKeyDown:Q,actions:oe,autoFocus:d&&(G===-1||p),autoFocusItem:de,variant:O},m,{className:ne(le.list,m.className),children:i}))}))}),Qr=Zr;function Jr(e){return ye("MuiNativeSelect",e)}const ea=$e("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Eo=ea,oa=["className","disabled","error","IconComponent","inputRef","variant"],ta=e=>{const{classes:o,variant:t,disabled:r,multiple:s,open:c,error:d}=e,i={select:["select",t,r&&"disabled",s&&"multiple",d&&"error"],icon:["icon",`icon${w(t)}`,c&&"iconOpen",r&&"disabled"]};return Ie(i,Jr,o)},yt=({ownerState:e,theme:o})=>a({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":a({},o.vars?{backgroundColor:`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:o.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Eo.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}),na=L("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Xe,overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.select,o[t.variant],t.error&&o.error,{[`&.${Eo.multiple}`]:o.multiple}]}})(yt),$t=({ownerState:e,theme:o})=>a({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${Eo.disabled}`]:{color:(o.vars||o).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),ra=L("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${w(t.variant)}`],t.open&&o.iconOpen]}})($t),aa=u.forwardRef(function(o,t){const{className:r,disabled:s,error:c,IconComponent:d,inputRef:i,variant:b="standard"}=o,p=ae(o,oa),m=a({},o,{disabled:s,variant:b,error:c}),h=ta(m);return f.jsxs(u.Fragment,{children:[f.jsx(na,a({ownerState:m,className:ne(h.select,r),disabled:s,ref:i||t},p)),o.multiple?null:f.jsx(ra,{as:d,ownerState:m,className:h.icon})]})}),la=aa;var rt;const sa=["children","classes","className","label","notched"],ia=L("fieldset",{shouldForwardProp:Xe})({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%"}),ca=L("legend",{shouldForwardProp:Xe})(({ownerState:e,theme:o})=>a({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})},e.withLabel&&a({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})})));function da(e){const{className:o,label:t,notched:r}=e,s=ae(e,sa),c=t!=null&&t!=="",d=a({},e,{notched:r,withLabel:c});return f.jsx(ia,a({"aria-hidden":!0,className:o,ownerState:d},s,{children:f.jsx(ca,{ownerState:d,children:c?f.jsx("span",{children:t}):rt||(rt=f.jsx("span",{className:"notranslate",children:"​"}))})}))}const ua=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],pa=e=>{const{classes:o}=e,r=Ie({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},In,o);return a({},o,r)},fa=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Co})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return a({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Ve.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Ve.focused} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette[o.color].main,borderWidth:2},[`&.${Ve.error} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Ve.disabled} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},o.startAdornment&&{paddingLeft:14},o.endAdornment&&{paddingRight:14},o.multiline&&a({padding:"16.5px 14px"},o.size==="small"&&{padding:"8.5px 14px"}))}),ba=L(da,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,o)=>o.notchedOutline})(({theme:e})=>{const o=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)`:o}}),ga=L(Io,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>a({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"}}},o.size==="small"&&{padding:"8.5px 14px"},o.multiline&&{padding:0},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0})),It=u.forwardRef(function(o,t){var r,s,c,d,i;const b=Pe({props:o,name:"MuiOutlinedInput"}),{components:p={},fullWidth:m=!1,inputComponent:h="input",label:$,multiline:v=!1,notched:R,slots:M={},type:P="text"}=b,O=ae(b,ua),k=pa(b),C=so(),I=io({props:b,muiFormControl:C,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),E=a({},b,{color:I.color||"primary",disabled:I.disabled,error:I.error,focused:I.focused,formControl:C,fullWidth:m,hiddenLabel:I.hiddenLabel,multiline:v,size:I.size,type:P}),N=(r=(s=M.root)!=null?s:p.Root)!=null?r:fa,F=(c=(d=M.input)!=null?d:p.Input)!=null?c:ga;return f.jsx(Do,a({slots:{root:N,input:F},renderSuffix:q=>f.jsx(ba,{ownerState:E,className:k.notchedOutline,label:$!=null&&$!==""&&I.required?i||(i=f.jsxs(u.Fragment,{children:[$," ","*"]})):$,notched:typeof R<"u"?R:!!(q.startAdornment||q.filled||q.focused)}),fullWidth:m,inputComponent:h,multiline:v,ref:t,type:P},O,{classes:a({},k,{notchedOutline:null})}))});It.muiName="Input";const St=It;function ma(e){return ye("MuiSelect",e)}const ha=$e("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),po=ha;var at;const va=["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"],xa=L("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`&.${po.select}`]:o.select},{[`&.${po.select}`]:o[t.variant]},{[`&.${po.error}`]:o.error},{[`&.${po.multiple}`]:o.multiple}]}})(yt,{[`&.${po.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Ca=L("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${w(t.variant)}`],t.open&&o.iconOpen]}})($t),ya=L("input",{shouldForwardProp:e=>Ft(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,o)=>o.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function lt(e,o){return typeof o=="object"&&o!==null?e===o:String(e)===String(o)}function $a(e){return e==null||typeof e=="string"&&!e.trim()}const Ia=e=>{const{classes:o,variant:t,disabled:r,multiple:s,open:c,error:d}=e,i={select:["select",t,r&&"disabled",s&&"multiple",d&&"error"],icon:["icon",`icon${w(t)}`,c&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ie(i,ma,o)},Sa=u.forwardRef(function(o,t){var r;const{"aria-describedby":s,"aria-label":c,autoFocus:d,autoWidth:i,children:b,className:p,defaultOpen:m,defaultValue:h,disabled:$,displayEmpty:v,error:R=!1,IconComponent:M,inputRef:P,labelId:O,MenuProps:k={},multiple:C,name:I,onBlur:E,onChange:N,onClose:F,onFocus:q,onOpen:le,open:de,readOnly:oe,renderValue:T,SelectDisplayProps:Q={},tabIndex:G,value:se,variant:J="standard"}=o,re=ae(o,va),[U,A]=fo({controlled:se,default:h,name:"Select"}),[ie,Se]=fo({controlled:de,default:m,name:"Select"}),Le=u.useRef(null),ue=u.useRef(null),[W,ee]=u.useState(null),{current:fe}=u.useRef(de!=null),[We,Z]=u.useState(),be=lo(t,P),Me=u.useCallback(y=>{ue.current=y,y&&ee(y)},[]),Y=W==null?void 0:W.parentNode;u.useImperativeHandle(be,()=>({focus:()=>{ue.current.focus()},node:Le.current,value:U}),[U]),u.useEffect(()=>{m&&ie&&W&&!fe&&(Z(i?null:Y.clientWidth),ue.current.focus())},[W,i]),u.useEffect(()=>{d&&ue.current.focus()},[d]),u.useEffect(()=>{if(!O)return;const y=Fo(ue.current).getElementById(O);if(y){const B=()=>{getSelection().isCollapsed&&ue.current.focus()};return y.addEventListener("click",B),()=>{y.removeEventListener("click",B)}}},[O]);const H=(y,B)=>{y?le&&le(B):F&&F(B),fe||(Z(i?null:Y.clientWidth),Se(y))},ze=y=>{y.button===0&&(y.preventDefault(),ue.current.focus(),H(!0,y))},_e=y=>{H(!1,y)},te=u.Children.toArray(b),S=y=>{const B=te.find(X=>X.props.value===y.target.value);B!==void 0&&(A(B.props.value),N&&N(y,B))},to=y=>B=>{let X;if(B.currentTarget.hasAttribute("tabindex")){if(C){X=Array.isArray(U)?U.slice():[];const ke=U.indexOf(y.props.value);ke===-1?X.push(y.props.value):X.splice(ke,1)}else X=y.props.value;if(y.props.onClick&&y.props.onClick(B),U!==X&&(A(X),N)){const ke=B.nativeEvent||B,Ze=new ke.constructor(ke.type,ke);Object.defineProperty(Ze,"target",{writable:!0,value:{value:X,name:I}}),N(Ze,y)}C||H(!1,B)}},_=y=>{oe||[" ","ArrowUp","ArrowDown","Enter"].indexOf(y.key)!==-1&&(y.preventDefault(),H(!0,y))},xe=W!==null&&ie,Fe=y=>{!xe&&E&&(Object.defineProperty(y,"target",{writable:!0,value:{value:U,name:I}}),E(y))};delete re["aria-invalid"];let ce,Te;const me=[];let Ae=!1;(ft({value:U})||v)&&(T?ce=T(U):Ae=!0);const Ye=te.map(y=>{if(!u.isValidElement(y))return null;let B;if(C){if(!Array.isArray(U))throw new Error(it(2));B=U.some(X=>lt(X,y.props.value)),B&&Ae&&me.push(y.props.children)}else B=lt(U,y.props.value),B&&Ae&&(Te=y.props.children);return u.cloneElement(y,{"aria-selected":B?"true":"false",onClick:to(y),onKeyUp:X=>{X.key===" "&&X.preventDefault(),y.props.onKeyUp&&y.props.onKeyUp(X)},role:"option",selected:B,value:void 0,"data-value":y.props.value})});Ae&&(C?me.length===0?ce=null:ce=me.reduce((y,B,X)=>(y.push(B),X{const{classes:o}=e;return o},Bo={name:"MuiSelect",overridesResolver:(e,o)=>o.root,shouldForwardProp:e=>Xe(e)&&e!=="variant",slot:"Root"},wa=L(xt,Bo)(""),La=L(St,Bo)(""),Ma=L(ht,Bo)(""),Pt=u.forwardRef(function(o,t){const r=Pe({name:"MuiSelect",props:o}),{autoWidth:s=!1,children:c,classes:d={},className:i,defaultOpen:b=!1,displayEmpty:p=!1,IconComponent:m=gt,id:h,input:$,inputProps:v,label:R,labelId:M,MenuProps:P,multiple:O=!1,native:k=!1,onClose:C,onOpen:I,open:E,renderValue:N,SelectDisplayProps:F,variant:q="outlined"}=r,le=ae(r,ka),de=k?la:Pa,oe=so(),T=io({props:r,muiFormControl:oe,states:["variant","error"]}),Q=T.variant||q,G=a({},r,{variant:Q,classes:d}),se=Oa(G),J=ae(se,Ra),re=$||{standard:f.jsx(wa,{ownerState:G}),outlined:f.jsx(La,{label:R,ownerState:G}),filled:f.jsx(Ma,{ownerState:G})}[Q],U=lo(t,re.ref);return f.jsx(u.Fragment,{children:u.cloneElement(re,a({inputComponent:de,inputProps:a({children:c,error:T.error,IconComponent:m,variant:Q,type:void 0,multiple:O},k?{id:h}:{autoWidth:s,defaultOpen:b,displayEmpty:p,labelId:M,MenuProps:P,onClose:C,onOpen:I,open:E,renderValue:N,SelectDisplayProps:a({id:h},F)},v,{classes:v?To(J,v.classes):J},$?$.props.inputProps:{})},O&&k&&Q==="outlined"?{notched:!0}:{},{ref:U,className:ne(re.props.className,i,se.root)},!$&&{variant:Q},le))})});Pt.muiName="Select";const Fa=Pt;function Ta(e){return ye("MuiTextField",e)}$e("MuiTextField",["root"]);const Aa=["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"],Na={standard:xt,filled:ht,outlined:St},za=e=>{const{classes:o}=e;return Ie({root:["root"]},Ta,o)},Da=L(jt,{name:"MuiTextField",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Ea=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiTextField"}),{autoComplete:s,autoFocus:c=!1,children:d,className:i,color:b="primary",defaultValue:p,disabled:m=!1,error:h=!1,FormHelperTextProps:$,fullWidth:v=!1,helperText:R,id:M,InputLabelProps:P,inputProps:O,InputProps:k,inputRef:C,label:I,maxRows:E,minRows:N,multiline:F=!1,name:q,onBlur:le,onChange:de,onFocus:oe,placeholder:T,required:Q=!1,rows:G,select:se=!1,SelectProps:J,type:re,value:U,variant:A="outlined"}=r,ie=ae(r,Aa),Se=a({},r,{autoFocus:c,color:b,disabled:m,error:h,fullWidth:v,multiline:F,required:Q,select:se,variant:A}),Le=za(Se),ue={};A==="outlined"&&(P&&typeof P.shrink<"u"&&(ue.notched=P.shrink),ue.label=I),se&&((!J||!J.native)&&(ue.id=void 0),ue["aria-describedby"]=void 0);const W=Ao(M),ee=R&&W?`${W}-helper-text`:void 0,fe=I&&W?`${W}-label`:void 0,We=Na[A],Z=f.jsx(We,a({"aria-describedby":ee,autoComplete:s,autoFocus:c,defaultValue:p,fullWidth:v,multiline:F,name:q,rows:G,maxRows:E,minRows:N,type:re,value:U,id:W,inputRef:C,onBlur:le,onChange:de,onFocus:oe,placeholder:T,inputProps:O},ue,k));return f.jsxs(Da,a({className:ne(Le.root,i),disabled:m,error:h,fullWidth:v,ref:t,required:Q,color:b,variant:A,ownerState:Se},ie,{children:[I!=null&&I!==""&&f.jsx(Lr,a({htmlFor:W,id:fe},P,{children:I})),se?f.jsx(Fa,a({"aria-describedby":ee,id:W,labelId:fe,value:U,input:Z},J,{children:d})):Z,R&&f.jsx(pr,a({id:ee},$,{children:R}))]}))}),Ba=Ea,ja={options:[],getOptionLabel:e=>e.label,handleInputChange:e=>e},qa=({options:e,onSelect:o,selectedValue:t=null,handleInputChange:r,isLoading:s=!1,autoFocus:c=!1,disabled:d=!1,dataTestId:i,dataId:b,placeholder:p,className:m})=>{const h=u.useRef(null),[$,v]=u.useState(!1);u.useEffect(()=>{c&&h.current&&(h.current.focus(),v(!0))},[c]);const R=(M,P)=>{o(P)};return f.jsx(Wt,{flexGrow:1,spacing:1,children:f.jsx(Vn,{...ja,autoFocus:!0,autoHighlight:!0,blurOnSelect:!0,className:m,"data-testid":b,disableClearable:!0,disabled:d,disablePortal:!0,id:"blur-on-select",ListboxProps:{sx:{backgroundColor:je.DROPDOWN_BG,"&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{backgroundClip:"padding-box",backgroundColor:je.SCROLL_BAR,borderRadius:"6px"}},ref:h},loading:s,onChange:R,onClose:()=>v(!1),onInputChange:(M,P)=>r==null?void 0:r(P),onOpen:()=>v(!0),open:$,options:e??[],PopperComponent:({children:M,...P})=>f.jsx(No,{...P,placement:"bottom-start",children:M}),renderInput:M=>f.jsx(Wa,{inputRef:h,...M,"data-testid":i,InputProps:{...M.InputProps,disableUnderline:!0,endAdornment:f.jsx(f.Fragment,{children:s?f.jsx(or,{color:"inherit",size:20}):M.InputProps.endAdornment})},placeholder:p,size:"medium",variant:"standard"}),renderOption:(M,P)=>f.jsx("li",{...M,children:f.jsxs(At,{align:"center","data-testid":P.label,direction:"row",grow:1,justify:"space-between",onClick:P==null?void 0:P.action,shrink:1,style:{fontSize:"14px",wordBreak:"break-word"},children:[f.jsx("div",{className:"option",children:P.label!==""?P.label:"Not Selected"}),(P==null?void 0:P.type)&&f.jsx(Et,{type:P.type})]})}),sx:{"&.MuiAutocomplete-option:hover":{backgroundColor:je.DROPDOWN_HOVER},"&.MuiAutocomplete-option[aria-selected='true']":{backgroundColor:je.DROPDOWN_SELECTED}},value:t||void 0})})},Wa=Tt(Ba)` + `),Xn)),er=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiCircularProgress"}),{className:s,color:c="primary",disableShrink:d=!1,size:i=40,style:b,thickness:p=3.6,value:m=0,variant:h="indeterminate"}=r,$=ae(r,qn),v=a({},r,{color:c,disableShrink:d,size:i,thickness:p,value:m,variant:h}),R=Yn(v),M={},P={},O={};if(h==="determinate"){const k=2*Math.PI*((Je-p)/2);M.strokeDasharray=k.toFixed(3),O["aria-valuenow"]=Math.round(m),M.strokeDashoffset=`${((100-m)/100*k).toFixed(3)}px`,P.transform="rotate(-90deg)"}return f.jsx(Zn,a({className:ne(R.root,s),style:a({width:i,height:i},P,b),ownerState:v,ref:t,role:"progressbar"},O,$,{children:f.jsx(Jn,{className:R.svg,ownerState:v,viewBox:`${Je/2} ${Je/2} ${Je} ${Je}`,children:f.jsx(Qn,{className:R.circle,style:M,ownerState:v,cx:Je,cy:Je,r:(Je-p)/2,fill:"none",strokeWidth:p})})}))}),or=er,tr=["disableUnderline","components","componentsProps","fullWidth","hiddenLabel","inputComponent","multiline","slotProps","slots","type"],nr=e=>{const{classes:o,disableUnderline:t}=e,s=Ie({root:["root",!t&&"underline"],input:["input"]},Pn,o);return a({},o,s)},rr=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Co(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{var t;const r=e.palette.mode==="light",s=r?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",c=r?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",d=r?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=r?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return a({position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c,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:d,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c}},[`&.${we.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:c},[`&.${we.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i}},!o.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(t=(e.vars||e).palette[o.color||"primary"])==null?void 0:t.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"},[`&.${we.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${we.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})`:s}`,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(.${we.disabled}, .${we.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${we.disabled}:before`]:{borderBottomStyle:"dotted"}},o.startAdornment&&{paddingLeft:12},o.endAdornment&&{paddingRight:12},o.multiline&&a({padding:"25px 12px 8px"},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9}))}),ar=L(Io,{name:"MuiFilledInput",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>a({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"}}},o.size==="small"&&{paddingTop:21,paddingBottom:4},o.hiddenLabel&&{paddingTop:16,paddingBottom:17},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0},o.hiddenLabel&&o.size==="small"&&{paddingTop:8,paddingBottom:9},o.multiline&&{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0})),mt=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiFilledInput"}),{components:b={},componentsProps:p,fullWidth:m=!1,inputComponent:h="input",multiline:$=!1,slotProps:v,slots:R={},type:M="text"}=i,P=ae(i,tr),O=a({},i,{fullWidth:m,inputComponent:h,multiline:$,type:M}),k=nr(i),C={root:{ownerState:O},input:{ownerState:O}},I=v??p?To(C,v??p):C,E=(r=(s=R.root)!=null?s:b.Root)!=null?r:rr,N=(c=(d=R.input)!=null?d:b.Input)!=null?c:ar;return f.jsx(Do,a({slots:{root:E,input:N},componentsProps:I,fullWidth:m,inputComponent:h,multiline:$,ref:t,type:M},P,{classes:k}))});mt.muiName="Input";const ht=mt;function lr(e){return ye("MuiFormHelperText",e)}const sr=$e("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]),ot=sr;var tt;const ir=["children","className","component","disabled","error","filled","focused","margin","required","variant"],cr=e=>{const{classes:o,contained:t,size:r,disabled:s,error:c,filled:d,focused:i,required:b}=e,p={root:["root",s&&"disabled",c&&"error",r&&`size${w(r)}`,t&&"contained",i&&"focused",d&&"filled",b&&"required"]};return Ie(p,lr,o)},dr=L("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,t.size&&o[`size${w(t.size)}`],t.contained&&o.contained,t.filled&&o.filled]}})(({theme:e,ownerState:o})=>a({color:(e.vars||e).palette.text.secondary},e.typography.caption,{textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${ot.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${ot.error}`]:{color:(e.vars||e).palette.error.main}},o.size==="small"&&{marginTop:4},o.contained&&{marginLeft:14,marginRight:14})),ur=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiFormHelperText"}),{children:s,className:c,component:d="p"}=r,i=ae(r,ir),b=so(),p=io({props:r,muiFormControl:b,states:["variant","size","disabled","error","filled","focused","required"]}),m=a({},r,{component:d,contained:p.variant==="filled"||p.variant==="outlined",variant:p.variant,size:p.size,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required}),h=cr(m);return f.jsx(dr,a({as:d,ownerState:m,className:ne(h.root,c),ref:t},i,{children:s===" "?tt||(tt=f.jsx("span",{className:"notranslate",children:"​"})):s}))}),pr=ur;function fr(e){return ye("MuiFormLabel",e)}const br=$e("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),bo=br,gr=["children","className","color","component","disabled","error","filled","focused","required"],mr=e=>{const{classes:o,color:t,focused:r,disabled:s,error:c,filled:d,required:i}=e,b={root:["root",`color${w(t)}`,s&&"disabled",c&&"error",d&&"filled",r&&"focused",i&&"required"],asterisk:["asterisk",c&&"error"]};return Ie(b,fr,o)},hr=L("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:({ownerState:e},o)=>a({},o.root,e.color==="secondary"&&o.colorSecondary,e.filled&&o.filled)})(({theme:e,ownerState:o})=>a({color:(e.vars||e).palette.text.secondary},e.typography.body1,{lineHeight:"1.4375em",padding:0,position:"relative",[`&.${bo.focused}`]:{color:(e.vars||e).palette[o.color].main},[`&.${bo.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${bo.error}`]:{color:(e.vars||e).palette.error.main}})),vr=L("span",{name:"MuiFormLabel",slot:"Asterisk",overridesResolver:(e,o)=>o.asterisk})(({theme:e})=>({[`&.${bo.error}`]:{color:(e.vars||e).palette.error.main}})),xr=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiFormLabel"}),{children:s,className:c,component:d="label"}=r,i=ae(r,gr),b=so(),p=io({props:r,muiFormControl:b,states:["color","required","focused","disabled","error","filled"]}),m=a({},r,{color:p.color||"primary",component:d,disabled:p.disabled,error:p.error,filled:p.filled,focused:p.focused,required:p.required}),h=mr(m);return f.jsxs(hr,a({as:d,ownerState:m,className:ne(h.root,c),ref:t},i,{children:[s,p.required&&f.jsxs(vr,{ownerState:m,"aria-hidden":!0,className:h.asterisk,children:[" ","*"]})]}))}),Cr=xr,yr=["disableUnderline","components","componentsProps","fullWidth","inputComponent","multiline","slotProps","slots","type"],$r=e=>{const{classes:o,disableUnderline:t}=e,s=Ie({root:["root",!t&&"underline"],input:["input"]},yn,o);return a({},o,s)},Ir=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[...Co(e,o),!t.disableUnderline&&o.underline]}})(({theme:e,ownerState:o})=>{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})`),a({position:"relative"},o.formControl&&{"label + &":{marginTop:16}},!o.disableUnderline&&{"&:after":{borderBottom:`2px solid ${(e.vars||e).palette[o.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"},[`&.${Qe.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Qe.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(.${Qe.disabled}, .${Qe.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Qe.disabled}:before`]:{borderBottomStyle:"dotted"}})}),Sr=L(Io,{name:"MuiInput",slot:"Input",overridesResolver:yo})({}),vt=u.forwardRef(function(o,t){var r,s,c,d;const i=Pe({props:o,name:"MuiInput"}),{disableUnderline:b,components:p={},componentsProps:m,fullWidth:h=!1,inputComponent:$="input",multiline:v=!1,slotProps:R,slots:M={},type:P="text"}=i,O=ae(i,yr),k=$r(i),I={root:{ownerState:{disableUnderline:b}}},E=R??m?To(R??m,I):I,N=(r=(s=M.root)!=null?s:p.Root)!=null?r:Ir,F=(c=(d=M.input)!=null?d:p.Input)!=null?c:Sr;return f.jsx(Do,a({slots:{root:N,input:F},slotProps:E,fullWidth:h,inputComponent:$,multiline:v,ref:t,type:P},O,{classes:k}))});vt.muiName="Input";const xt=vt;function Pr(e){return ye("MuiInputLabel",e)}$e("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const kr=["disableAnimation","margin","shrink","variant","className"],Rr=e=>{const{classes:o,formControl:t,size:r,shrink:s,disableAnimation:c,variant:d,required:i}=e,b={root:["root",t&&"formControl",!c&&"animated",s&&"shrink",r&&r!=="normal"&&`size${w(r)}`,d],asterisk:[i&&"asterisk"]},p=Ie(b,Pr,o);return a({},o,p)},Or=L(Cr,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`& .${bo.asterisk}`]:o.asterisk},o.root,t.formControl&&o.formControl,t.size==="small"&&o.sizeSmall,t.shrink&&o.shrink,!t.disableAnimation&&o.animated,t.focused&&o.focused,o[t.variant]]}})(({theme:e,ownerState:o})=>a({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%"},o.formControl&&{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"},o.size==="small"&&{transform:"translate(0, 17px) scale(1)"},o.shrink&&{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"},!o.disableAnimation&&{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})},o.variant==="filled"&&a({zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(12px, 13px) scale(1)"},o.shrink&&a({userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"},o.size==="small"&&{transform:"translate(12px, 4px) scale(0.75)"})),o.variant==="outlined"&&a({zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"},o.size==="small"&&{transform:"translate(14px, 9px) scale(1)"},o.shrink&&{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}))),wr=u.forwardRef(function(o,t){const r=Pe({name:"MuiInputLabel",props:o}),{disableAnimation:s=!1,shrink:c,className:d}=r,i=ae(r,kr),b=so();let p=c;typeof p>"u"&&b&&(p=b.filled||b.focused||b.adornedStart);const m=io({props:r,muiFormControl:b,states:["size","variant","required","focused"]}),h=a({},r,{disableAnimation:s,formControl:b,shrink:p,size:m.size,variant:m.variant,required:m.required,focused:m.focused}),$=Rr(h);return f.jsx(Or,a({"data-shrink":p,ownerState:h,ref:t,className:ne($.root,d)},i,{classes:$}))}),Lr=wr,Mr=u.createContext({}),Fr=Mr;function Tr(e){return ye("MuiList",e)}$e("MuiList",["root","padding","dense","subheader"]);const Ar=["children","className","component","dense","disablePadding","subheader"],Nr=e=>{const{classes:o,disablePadding:t,dense:r,subheader:s}=e;return Ie({root:["root",!t&&"padding",r&&"dense",s&&"subheader"]},Tr,o)},zr=L("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.root,!t.disablePadding&&o.padding,t.dense&&o.dense,t.subheader&&o.subheader]}})(({ownerState:e})=>a({listStyle:"none",margin:0,padding:0,position:"relative"},!e.disablePadding&&{paddingTop:8,paddingBottom:8},e.subheader&&{paddingTop:0})),Dr=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiList"}),{children:s,className:c,component:d="ul",dense:i=!1,disablePadding:b=!1,subheader:p}=r,m=ae(r,Ar),h=u.useMemo(()=>({dense:i}),[i]),$=a({},r,{component:d,dense:i,disablePadding:b}),v=Nr($);return f.jsx(Fr.Provider,{value:h,children:f.jsxs(zr,a({as:d,className:ne(v.root,c),ref:t,ownerState:$},m,{children:[p,s]}))})}),Er=Dr,Br=["actions","autoFocus","autoFocusItem","children","className","disabledItemsFocusable","disableListWrap","onKeyDown","variant"];function Mo(e,o,t){return e===o?e.firstChild:o&&o.nextElementSibling?o.nextElementSibling:t?null:e.firstChild}function nt(e,o,t){return e===o?t?e.firstChild:e.lastChild:o&&o.previousElementSibling?o.previousElementSibling:t?null:e.lastChild}function Ct(e,o){if(o===void 0)return!0;let t=e.innerText;return t===void 0&&(t=e.textContent),t=t.trim().toLowerCase(),t.length===0?!1:o.repeating?t[0]===o.keys[0]:t.indexOf(o.keys.join(""))===0}function uo(e,o,t,r,s,c){let d=!1,i=s(e,o,o?t:!1);for(;i;){if(i===e.firstChild){if(d)return!1;d=!0}const b=r?!1:i.disabled||i.getAttribute("aria-disabled")==="true";if(!i.hasAttribute("tabindex")||!Ct(i,c)||b)i=s(e,i,t);else return i.focus(),!0}return!1}const jr=u.forwardRef(function(o,t){const{actions:r,autoFocus:s=!1,autoFocusItem:c=!1,children:d,className:i,disabledItemsFocusable:b=!1,disableListWrap:p=!1,onKeyDown:m,variant:h="selectedMenu"}=o,$=ae(o,Br),v=u.useRef(null),R=u.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});st(()=>{s&&v.current.focus()},[s]),u.useImperativeHandle(r,()=>({adjustStyleForScrollbar:(C,I)=>{const E=!v.current.style.width;if(C.clientHeight{const I=v.current,E=C.key,N=Fo(I).activeElement;if(E==="ArrowDown")C.preventDefault(),uo(I,N,p,b,Mo);else if(E==="ArrowUp")C.preventDefault(),uo(I,N,p,b,nt);else if(E==="Home")C.preventDefault(),uo(I,null,p,b,Mo);else if(E==="End")C.preventDefault(),uo(I,null,p,b,nt);else if(E.length===1){const F=R.current,q=E.toLowerCase(),le=performance.now();F.keys.length>0&&(le-F.lastTime>500?(F.keys=[],F.repeating=!0,F.previousKeyMatched=!0):F.repeating&&q!==F.keys[0]&&(F.repeating=!1)),F.lastTime=le,F.keys.push(q);const de=N&&!F.repeating&&Ct(N,F);F.previousKeyMatched&&(de||uo(I,N,!1,b,Mo,F))?C.preventDefault():F.previousKeyMatched=!1}m&&m(C)},P=lo(v,t);let O=-1;u.Children.forEach(d,(C,I)=>{if(!u.isValidElement(C)){O===I&&(O+=1,O>=d.length&&(O=-1));return}C.props.disabled||(h==="selectedMenu"&&C.props.selected||O===-1)&&(O=I),O===I&&(C.props.disabled||C.props.muiSkipListHighlight||C.type.muiSkipListHighlight)&&(O+=1,O>=d.length&&(O=-1))});const k=u.Children.map(d,(C,I)=>{if(I===O){const E={};return c&&(E.autoFocus=!0),C.props.tabIndex===void 0&&h==="selectedMenu"&&(E.tabIndex=0),u.cloneElement(C,E)}return C});return f.jsx(Er,a({role:"menu",ref:P,className:i,onKeyDown:M,tabIndex:s?0:-1},$,{children:k}))}),Wr=jr;function _r(e){return ye("MuiMenu",e)}$e("MuiMenu",["root","paper","list"]);const Ur=["onEntering"],Hr=["autoFocus","children","className","disableAutoFocusItem","MenuListProps","onClose","open","PaperProps","PopoverClasses","transitionDuration","TransitionProps","variant","slots","slotProps"],Vr={vertical:"top",horizontal:"right"},Kr={vertical:"top",horizontal:"left"},qr=e=>{const{classes:o}=e;return Ie({root:["root"],paper:["paper"],list:["list"]},_r,o)},Gr=L(zt,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiMenu",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Xr=L(Dt,{name:"MuiMenu",slot:"Paper",overridesResolver:(e,o)=>o.paper})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),Yr=L(Wr,{name:"MuiMenu",slot:"List",overridesResolver:(e,o)=>o.list})({outline:0}),Zr=u.forwardRef(function(o,t){var r,s;const c=Pe({props:o,name:"MuiMenu"}),{autoFocus:d=!0,children:i,className:b,disableAutoFocusItem:p=!1,MenuListProps:m={},onClose:h,open:$,PaperProps:v={},PopoverClasses:R,transitionDuration:M="auto",TransitionProps:{onEntering:P}={},variant:O="selectedMenu",slots:k={},slotProps:C={}}=c,I=ae(c.TransitionProps,Ur),E=ae(c,Hr),N=Mt(),F=N.direction==="rtl",q=a({},c,{autoFocus:d,disableAutoFocusItem:p,MenuListProps:m,onEntering:P,PaperProps:v,transitionDuration:M,TransitionProps:I,variant:O}),le=qr(q),de=d&&!p&&$,oe=u.useRef(null),T=(A,ie)=>{oe.current&&oe.current.adjustStyleForScrollbar(A,N),P&&P(A,ie)},J=A=>{A.key==="Tab"&&(A.preventDefault(),h&&h(A,"tabKeyDown"))};let G=-1;u.Children.map(i,(A,ie)=>{u.isValidElement(A)&&(A.props.disabled||(O==="selectedMenu"&&A.props.selected||G===-1)&&(G=ie))});const se=(r=k.paper)!=null?r:Xr,Q=(s=C.paper)!=null?s:v,re=Vo({elementType:k.root,externalSlotProps:C.root,ownerState:q,className:[le.root,b]}),U=Vo({elementType:se,externalSlotProps:Q,ownerState:q,className:le.paper});return f.jsx(Gr,a({onClose:h,anchorOrigin:{vertical:"bottom",horizontal:F?"right":"left"},transformOrigin:F?Vr:Kr,slots:{paper:se,root:k.root},slotProps:{root:re,paper:U},open:$,ref:t,transitionDuration:M,TransitionProps:a({onEntering:T},I),ownerState:q},E,{classes:R,children:f.jsx(Yr,a({onKeyDown:J,actions:oe,autoFocus:d&&(G===-1||p),autoFocusItem:de,variant:O},m,{className:ne(le.list,m.className),children:i}))}))}),Jr=Zr;function Qr(e){return ye("MuiNativeSelect",e)}const ea=$e("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),Eo=ea,oa=["className","disabled","error","IconComponent","inputRef","variant"],ta=e=>{const{classes:o,variant:t,disabled:r,multiple:s,open:c,error:d}=e,i={select:["select",t,r&&"disabled",s&&"multiple",d&&"error"],icon:["icon",`icon${w(t)}`,c&&"iconOpen",r&&"disabled"]};return Ie(i,Qr,o)},yt=({ownerState:e,theme:o})=>a({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":a({},o.vars?{backgroundColor:`rgba(${o.vars.palette.common.onBackgroundChannel} / 0.05)`}:{backgroundColor:o.palette.mode==="light"?"rgba(0, 0, 0, 0.05)":"rgba(255, 255, 255, 0.05)"},{borderRadius:0}),"&::-ms-expand":{display:"none"},[`&.${Eo.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},"&&&":{paddingRight:24,minWidth:16}},e.variant==="filled"&&{"&&&":{paddingRight:32}},e.variant==="outlined"&&{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}),na=L("select",{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:Xe,overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.select,o[t.variant],t.error&&o.error,{[`&.${Eo.multiple}`]:o.multiple}]}})(yt),$t=({ownerState:e,theme:o})=>a({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${Eo.disabled}`]:{color:(o.vars||o).palette.action.disabled}},e.open&&{transform:"rotate(180deg)"},e.variant==="filled"&&{right:7},e.variant==="outlined"&&{right:7}),ra=L("svg",{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${w(t.variant)}`],t.open&&o.iconOpen]}})($t),aa=u.forwardRef(function(o,t){const{className:r,disabled:s,error:c,IconComponent:d,inputRef:i,variant:b="standard"}=o,p=ae(o,oa),m=a({},o,{disabled:s,variant:b,error:c}),h=ta(m);return f.jsxs(u.Fragment,{children:[f.jsx(na,a({ownerState:m,className:ne(h.select,r),disabled:s,ref:i||t},p)),o.multiple?null:f.jsx(ra,{as:d,ownerState:m,className:h.icon})]})}),la=aa;var rt;const sa=["children","classes","className","label","notched"],ia=L("fieldset",{shouldForwardProp:Xe})({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%"}),ca=L("legend",{shouldForwardProp:Xe})(({ownerState:e,theme:o})=>a({float:"unset",width:"auto",overflow:"hidden"},!e.withLabel&&{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})},e.withLabel&&a({display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}},e.notched&&{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})})));function da(e){const{className:o,label:t,notched:r}=e,s=ae(e,sa),c=t!=null&&t!=="",d=a({},e,{notched:r,withLabel:c});return f.jsx(ia,a({"aria-hidden":!0,className:o,ownerState:d},s,{children:f.jsx(ca,{ownerState:d,children:c?f.jsx("span",{children:t}):rt||(rt=f.jsx("span",{className:"notranslate",children:"​"}))})}))}const ua=["components","fullWidth","inputComponent","label","multiline","notched","slots","type"],pa=e=>{const{classes:o}=e,r=Ie({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},In,o);return a({},o,r)},fa=L($o,{shouldForwardProp:e=>Xe(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:Co})(({theme:e,ownerState:o})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return a({position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Ve.notchedOutline}`]:{borderColor:e.vars?`rgba(${e.vars.palette.common.onBackgroundChannel} / 0.23)`:t}},[`&.${Ve.focused} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette[o.color].main,borderWidth:2},[`&.${Ve.error} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Ve.disabled} .${Ve.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}},o.startAdornment&&{paddingLeft:14},o.endAdornment&&{paddingRight:14},o.multiline&&a({padding:"16.5px 14px"},o.size==="small"&&{padding:"8.5px 14px"}))}),ba=L(da,{name:"MuiOutlinedInput",slot:"NotchedOutline",overridesResolver:(e,o)=>o.notchedOutline})(({theme:e})=>{const o=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)`:o}}),ga=L(Io,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:yo})(({theme:e,ownerState:o})=>a({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"}}},o.size==="small"&&{padding:"8.5px 14px"},o.multiline&&{padding:0},o.startAdornment&&{paddingLeft:0},o.endAdornment&&{paddingRight:0})),It=u.forwardRef(function(o,t){var r,s,c,d,i;const b=Pe({props:o,name:"MuiOutlinedInput"}),{components:p={},fullWidth:m=!1,inputComponent:h="input",label:$,multiline:v=!1,notched:R,slots:M={},type:P="text"}=b,O=ae(b,ua),k=pa(b),C=so(),I=io({props:b,muiFormControl:C,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),E=a({},b,{color:I.color||"primary",disabled:I.disabled,error:I.error,focused:I.focused,formControl:C,fullWidth:m,hiddenLabel:I.hiddenLabel,multiline:v,size:I.size,type:P}),N=(r=(s=M.root)!=null?s:p.Root)!=null?r:fa,F=(c=(d=M.input)!=null?d:p.Input)!=null?c:ga;return f.jsx(Do,a({slots:{root:N,input:F},renderSuffix:q=>f.jsx(ba,{ownerState:E,className:k.notchedOutline,label:$!=null&&$!==""&&I.required?i||(i=f.jsxs(u.Fragment,{children:[$," ","*"]})):$,notched:typeof R<"u"?R:!!(q.startAdornment||q.filled||q.focused)}),fullWidth:m,inputComponent:h,multiline:v,ref:t,type:P},O,{classes:a({},k,{notchedOutline:null})}))});It.muiName="Input";const St=It;function ma(e){return ye("MuiSelect",e)}const ha=$e("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),po=ha;var at;const va=["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"],xa=L("div",{name:"MuiSelect",slot:"Select",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[{[`&.${po.select}`]:o.select},{[`&.${po.select}`]:o[t.variant]},{[`&.${po.error}`]:o.error},{[`&.${po.multiple}`]:o.multiple}]}})(yt,{[`&.${po.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Ca=L("svg",{name:"MuiSelect",slot:"Icon",overridesResolver:(e,o)=>{const{ownerState:t}=e;return[o.icon,t.variant&&o[`icon${w(t.variant)}`],t.open&&o.iconOpen]}})($t),ya=L("input",{shouldForwardProp:e=>Ft(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput",overridesResolver:(e,o)=>o.nativeInput})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function lt(e,o){return typeof o=="object"&&o!==null?e===o:String(e)===String(o)}function $a(e){return e==null||typeof e=="string"&&!e.trim()}const Ia=e=>{const{classes:o,variant:t,disabled:r,multiple:s,open:c,error:d}=e,i={select:["select",t,r&&"disabled",s&&"multiple",d&&"error"],icon:["icon",`icon${w(t)}`,c&&"iconOpen",r&&"disabled"],nativeInput:["nativeInput"]};return Ie(i,ma,o)},Sa=u.forwardRef(function(o,t){var r;const{"aria-describedby":s,"aria-label":c,autoFocus:d,autoWidth:i,children:b,className:p,defaultOpen:m,defaultValue:h,disabled:$,displayEmpty:v,error:R=!1,IconComponent:M,inputRef:P,labelId:O,MenuProps:k={},multiple:C,name:I,onBlur:E,onChange:N,onClose:F,onFocus:q,onOpen:le,open:de,readOnly:oe,renderValue:T,SelectDisplayProps:J={},tabIndex:G,value:se,variant:Q="standard"}=o,re=ae(o,va),[U,A]=fo({controlled:se,default:h,name:"Select"}),[ie,Se]=fo({controlled:de,default:m,name:"Select"}),Le=u.useRef(null),ue=u.useRef(null),[W,ee]=u.useState(null),{current:fe}=u.useRef(de!=null),[We,Z]=u.useState(),be=lo(t,P),Me=u.useCallback(y=>{ue.current=y,y&&ee(y)},[]),Y=W==null?void 0:W.parentNode;u.useImperativeHandle(be,()=>({focus:()=>{ue.current.focus()},node:Le.current,value:U}),[U]),u.useEffect(()=>{m&&ie&&W&&!fe&&(Z(i?null:Y.clientWidth),ue.current.focus())},[W,i]),u.useEffect(()=>{d&&ue.current.focus()},[d]),u.useEffect(()=>{if(!O)return;const y=Fo(ue.current).getElementById(O);if(y){const B=()=>{getSelection().isCollapsed&&ue.current.focus()};return y.addEventListener("click",B),()=>{y.removeEventListener("click",B)}}},[O]);const H=(y,B)=>{y?le&&le(B):F&&F(B),fe||(Z(i?null:Y.clientWidth),Se(y))},ze=y=>{y.button===0&&(y.preventDefault(),ue.current.focus(),H(!0,y))},_e=y=>{H(!1,y)},te=u.Children.toArray(b),S=y=>{const B=te.find(X=>X.props.value===y.target.value);B!==void 0&&(A(B.props.value),N&&N(y,B))},to=y=>B=>{let X;if(B.currentTarget.hasAttribute("tabindex")){if(C){X=Array.isArray(U)?U.slice():[];const ke=U.indexOf(y.props.value);ke===-1?X.push(y.props.value):X.splice(ke,1)}else X=y.props.value;if(y.props.onClick&&y.props.onClick(B),U!==X&&(A(X),N)){const ke=B.nativeEvent||B,Ze=new ke.constructor(ke.type,ke);Object.defineProperty(Ze,"target",{writable:!0,value:{value:X,name:I}}),N(Ze,y)}C||H(!1,B)}},_=y=>{oe||[" ","ArrowUp","ArrowDown","Enter"].indexOf(y.key)!==-1&&(y.preventDefault(),H(!0,y))},xe=W!==null&&ie,Fe=y=>{!xe&&E&&(Object.defineProperty(y,"target",{writable:!0,value:{value:U,name:I}}),E(y))};delete re["aria-invalid"];let ce,Te;const me=[];let Ae=!1;(ft({value:U})||v)&&(T?ce=T(U):Ae=!0);const Ye=te.map(y=>{if(!u.isValidElement(y))return null;let B;if(C){if(!Array.isArray(U))throw new Error(it(2));B=U.some(X=>lt(X,y.props.value)),B&&Ae&&me.push(y.props.children)}else B=lt(U,y.props.value),B&&Ae&&(Te=y.props.children);return u.cloneElement(y,{"aria-selected":B?"true":"false",onClick:to(y),onKeyUp:X=>{X.key===" "&&X.preventDefault(),y.props.onKeyUp&&y.props.onKeyUp(X)},role:"option",selected:B,value:void 0,"data-value":y.props.value})});Ae&&(C?me.length===0?ce=null:ce=me.reduce((y,B,X)=>(y.push(B),X{const{classes:o}=e;return o},Bo={name:"MuiSelect",overridesResolver:(e,o)=>o.root,shouldForwardProp:e=>Xe(e)&&e!=="variant",slot:"Root"},wa=L(xt,Bo)(""),La=L(St,Bo)(""),Ma=L(ht,Bo)(""),Pt=u.forwardRef(function(o,t){const r=Pe({name:"MuiSelect",props:o}),{autoWidth:s=!1,children:c,classes:d={},className:i,defaultOpen:b=!1,displayEmpty:p=!1,IconComponent:m=gt,id:h,input:$,inputProps:v,label:R,labelId:M,MenuProps:P,multiple:O=!1,native:k=!1,onClose:C,onOpen:I,open:E,renderValue:N,SelectDisplayProps:F,variant:q="outlined"}=r,le=ae(r,ka),de=k?la:Pa,oe=so(),T=io({props:r,muiFormControl:oe,states:["variant","error"]}),J=T.variant||q,G=a({},r,{variant:J,classes:d}),se=Oa(G),Q=ae(se,Ra),re=$||{standard:f.jsx(wa,{ownerState:G}),outlined:f.jsx(La,{label:R,ownerState:G}),filled:f.jsx(Ma,{ownerState:G})}[J],U=lo(t,re.ref);return f.jsx(u.Fragment,{children:u.cloneElement(re,a({inputComponent:de,inputProps:a({children:c,error:T.error,IconComponent:m,variant:J,type:void 0,multiple:O},k?{id:h}:{autoWidth:s,defaultOpen:b,displayEmpty:p,labelId:M,MenuProps:P,onClose:C,onOpen:I,open:E,renderValue:N,SelectDisplayProps:a({id:h},F)},v,{classes:v?To(Q,v.classes):Q},$?$.props.inputProps:{})},O&&k&&J==="outlined"?{notched:!0}:{},{ref:U,className:ne(re.props.className,i,se.root)},!$&&{variant:J},le))})});Pt.muiName="Select";const Fa=Pt;function Ta(e){return ye("MuiTextField",e)}$e("MuiTextField",["root"]);const Aa=["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"],Na={standard:xt,filled:ht,outlined:St},za=e=>{const{classes:o}=e;return Ie({root:["root"]},Ta,o)},Da=L(jt,{name:"MuiTextField",slot:"Root",overridesResolver:(e,o)=>o.root})({}),Ea=u.forwardRef(function(o,t){const r=Pe({props:o,name:"MuiTextField"}),{autoComplete:s,autoFocus:c=!1,children:d,className:i,color:b="primary",defaultValue:p,disabled:m=!1,error:h=!1,FormHelperTextProps:$,fullWidth:v=!1,helperText:R,id:M,InputLabelProps:P,inputProps:O,InputProps:k,inputRef:C,label:I,maxRows:E,minRows:N,multiline:F=!1,name:q,onBlur:le,onChange:de,onFocus:oe,placeholder:T,required:J=!1,rows:G,select:se=!1,SelectProps:Q,type:re,value:U,variant:A="outlined"}=r,ie=ae(r,Aa),Se=a({},r,{autoFocus:c,color:b,disabled:m,error:h,fullWidth:v,multiline:F,required:J,select:se,variant:A}),Le=za(Se),ue={};A==="outlined"&&(P&&typeof P.shrink<"u"&&(ue.notched=P.shrink),ue.label=I),se&&((!Q||!Q.native)&&(ue.id=void 0),ue["aria-describedby"]=void 0);const W=Ao(M),ee=R&&W?`${W}-helper-text`:void 0,fe=I&&W?`${W}-label`:void 0,We=Na[A],Z=f.jsx(We,a({"aria-describedby":ee,autoComplete:s,autoFocus:c,defaultValue:p,fullWidth:v,multiline:F,name:q,rows:G,maxRows:E,minRows:N,type:re,value:U,id:W,inputRef:C,onBlur:le,onChange:de,onFocus:oe,placeholder:T,inputProps:O},ue,k));return f.jsxs(Da,a({className:ne(Le.root,i),disabled:m,error:h,fullWidth:v,ref:t,required:J,color:b,variant:A,ownerState:Se},ie,{children:[I!=null&&I!==""&&f.jsx(Lr,a({htmlFor:W,id:fe},P,{children:I})),se?f.jsx(Fa,a({"aria-describedby":ee,id:W,labelId:fe,value:U,input:Z},Q,{children:d})):Z,R&&f.jsx(pr,a({id:ee},$,{children:R}))]}))}),Ba=Ea,ja={options:[],getOptionLabel:e=>e.label,handleInputChange:e=>e},qa=({options:e,onSelect:o,selectedValue:t=null,handleInputChange:r,isLoading:s=!1,autoFocus:c=!1,disabled:d=!1,dataTestId:i,dataId:b,placeholder:p,className:m})=>{const h=u.useRef(null),[$,v]=u.useState(!1);u.useEffect(()=>{c&&h.current&&(h.current.focus(),v(!0))},[c]);const R=(M,P)=>{o(P)};return f.jsx(Wt,{flexGrow:1,spacing:1,children:f.jsx(Vn,{...ja,autoFocus:!0,autoHighlight:!0,blurOnSelect:!0,className:m,"data-testid":b,disableClearable:!0,disabled:d,disablePortal:!0,id:"blur-on-select",ListboxProps:{sx:{backgroundColor:je.DROPDOWN_BG,"&::-webkit-scrollbar":{width:"3px"},"&::-webkit-scrollbar-thumb":{backgroundClip:"padding-box",backgroundColor:je.SCROLL_BAR,borderRadius:"6px"}},ref:h},loading:s,onChange:R,onClose:()=>v(!1),onInputChange:(M,P)=>r==null?void 0:r(P),onOpen:()=>v(!0),open:$,options:e??[],PopperComponent:({children:M,...P})=>f.jsx(No,{...P,placement:"bottom-start",children:M}),renderInput:M=>f.jsx(Wa,{inputRef:h,...M,"data-testid":i,InputProps:{...M.InputProps,disableUnderline:!0,endAdornment:f.jsx(f.Fragment,{children:s?f.jsx(or,{color:"inherit",size:20}):M.InputProps.endAdornment})},placeholder:p,size:"medium",variant:"standard"}),renderOption:(M,P)=>f.jsx("li",{...M,children:f.jsxs(At,{align:"center","data-testid":P.label,direction:"row",grow:1,justify:"space-between",onClick:P==null?void 0:P.action,shrink:1,style:{fontSize:"14px",wordBreak:"break-word"},children:[f.jsx("div",{className:"option",children:P.label!==""?P.label:"Not Selected"}),(P==null?void 0:P.type)&&f.jsx(Et,{type:P.type})]})}),sx:{"&.MuiAutocomplete-option:hover":{backgroundColor:je.DROPDOWN_HOVER},"&.MuiAutocomplete-option[aria-selected='true']":{backgroundColor:je.DROPDOWN_SELECTED}},value:t||void 0})})},Wa=Tt(Ba)` && { z-index: 2; width: 100%; diff --git a/build/assets/index-710d3c1e.js b/build/assets/index-8f6ab1fe.js similarity index 99% rename from build/assets/index-710d3c1e.js rename to build/assets/index-8f6ab1fe.js index fde7a9a3f..ac0ec2dff 100644 --- a/build/assets/index-710d3c1e.js +++ b/build/assets/index-8f6ab1fe.js @@ -1,4 +1,4 @@ -import{r as k,g as Cc,e as Nr,bH as _c,bI as td,j as L,b as nd,x as Ji,bJ as rd,bK as id,bL as od}from"./index-16ff4e55.js";import{H as fl,I as Vl,J as ad,U as ld,d as Ec,k as sd,C as ro,K as ud,O as Zl,y as Ql,N as da,X as dl,Y as cd,Z as fd,_ as dd,$ as hd,a0 as pd,a1 as vd,a2 as md,V as st,b as Gr,a3 as gd,h as yd,g as Xl,s as pa,a4 as Tc,e as Ul,a5 as Rl,a6 as vi,a7 as xd,t as Yl,a8 as wd,a9 as Fl,aa as Fu,ab as Sd,j as Mc,ac as Cd,l as io,ad as xi,o as kc,ae as _d,af as Ed,ag as Td,ah as Md,ai as kd,aj as Au,ak as Pd,al as Ld,M as Ud,r as Rd,am as Jl,an as Du,ao as Ir,ap as Fd,i as hl}from"./three.module-d9fcef06.js";import{aV as _t,w as Ad,e as Dd}from"./index-04a82be1.js";var Pc={exports:{}},Wr={};/** +import{r as k,g as Cc,e as Nr,bH as _c,bI as td,j as L,b as nd,x as Ji,bJ as rd,bK as id,bL as od}from"./index-4c5f8236.js";import{H as fl,I as Vl,J as ad,U as ld,d as Ec,k as sd,C as ro,K as ud,O as Zl,y as Ql,N as da,X as dl,Y as cd,Z as fd,_ as dd,$ as hd,a0 as pd,a1 as vd,a2 as md,V as st,b as Gr,a3 as gd,h as yd,g as Xl,s as pa,a4 as Tc,e as Ul,a5 as Rl,a6 as vi,a7 as xd,t as Yl,a8 as wd,a9 as Fl,aa as Fu,ab as Sd,j as Mc,ac as Cd,l as io,ad as xi,o as kc,ae as _d,af as Ed,ag as Td,ah as Md,ai as kd,aj as Au,ak as Pd,al as Ld,M as Ud,r as Rd,am as Jl,an as Du,ao as Ir,ap as Fd,i as hl}from"./three.module-d9fcef06.js";import{aV as _t,t as Ad,e as Dd}from"./index-a4caf8d5.js";var Pc={exports:{}},Wr={};/** * @license React * react-reconciler-constants.production.min.js * diff --git a/build/assets/index-2730636d.js b/build/assets/index-980e06d3.js similarity index 88% rename from build/assets/index-2730636d.js rename to build/assets/index-980e06d3.js index 849bf9407..1a5fa95c8 100644 --- a/build/assets/index-2730636d.js +++ b/build/assets/index-980e06d3.js @@ -1,4 +1,4 @@ -import{w as i,x as t,F as c,j as e,M as j,r as l,v as B,z as w,bs as C,bt as R,aX as z}from"./index-16ff4e55.js";import{aR as I,e as D,u as E}from"./index-04a82be1.js";import{S as L}from"./Skeleton-96227392.js";import{C as M}from"./ClipLoader-049391dc.js";const T=({nodeName:p})=>e.jsx(c,{children:e.jsxs(c,{align:"center",direction:"column",justify:"space-between",children:[e.jsx(A,{children:e.jsx(I,{})}),e.jsxs(G,{children:["Are you sure you want to delete ",p||"this item","?"]})]})}),G=i(c)` +import{w as i,x as t,F as c,j as e,M as j,r as l,v as B,z as w,bs as C,bt as R,aX as z}from"./index-4c5f8236.js";import{aP as I,e as D,u as E}from"./index-a4caf8d5.js";import{S as L}from"./Skeleton-7bdfc65c.js";import{C as M}from"./ClipLoader-601f6378.js";const T=({nodeName:p})=>e.jsx(c,{children:e.jsxs(c,{align:"center",direction:"column",justify:"space-between",children:[e.jsx(A,{children:e.jsx(I,{})}),e.jsxs(G,{children:["Are you sure you want to delete ",p||"this item","?"]})]})}),G=i(c)` color: ${t.white}; font-family: 'Barlow'; font-size: 20px; @@ -47,4 +47,4 @@ import{w as i,x as t,F as c,j as e,M as j,r as l,v as B,z as w,bs as C,bt as R,a } `,O=i.span` margin-top: 2px; -`,P=()=>e.jsx(z,{id:"removeNode",kind:"small",preventOutsideClose:!0,children:e.jsx(W,{})});export{P as RemoveNodeModal}; +`,K=()=>e.jsx(z,{id:"removeNode",kind:"small",preventOutsideClose:!0,children:e.jsx(W,{})});export{K as RemoveNodeModal}; diff --git a/build/assets/index-04a82be1.js b/build/assets/index-a4caf8d5.js similarity index 99% rename from build/assets/index-04a82be1.js rename to build/assets/index-a4caf8d5.js index 0584a546c..46cfb047b 100644 --- a/build/assets/index-04a82be1.js +++ b/build/assets/index-a4caf8d5.js @@ -1,4 +1,4 @@ -import{g as Qr,_ as As,R as F0,a as I1,b as v,T as Jr,c as Ee,d as Se,s as D0,e as F,f as Ke,r as h,u as Ae,j as c,h as S0,i as _e,B as _s,k as H0,l as B0,m as ri,n as oi,o as pt,p as ai,q as eo,$ as Vs,W as Ds,t as An,v as g0,w as q,x as N,F as K,y as Bs,z as _n,C as xt,A as js,L as $s,D as kt,E as Vn,G as to,H as C1,S as Gs,I as m1,J as no,K as Ps,M as Ms,N as Ls,O as Os,P as Ts,Q as Rs,U as Fs,V as io,X as Is,Y as Hs,Z as Ns,a0 as zs,a1 as Zs,a2 as Us,a3 as Ws,a4 as Ks}from"./index-16ff4e55.js";function qs(e){return e===null?"?":e.toLocaleString("en-US").split(",").join(" ")}function Ys(e){return e?String(e).replace(/[[]{2}/g,"").replace(/[\]]{2}/g,""):""}const Xs=e=>{const[t,n,i]=e.split(":"),r=parseInt(t,10),o=parseInt(n,10),a=parseInt(i,10);return r*3600+o*60+a};var ro={exports:{}},Qs="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Js=Qs,e2=Js;function oo(){}function ao(){}ao.resetWarningCache=oo;var t2=function(){function e(i,r,o,a,s,l){if(l!==e2){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ao,resetWarningCache:oo};return n.PropTypes=n,n};ro.exports=t2();var n2=ro.exports;const o1=Qr(n2);function si(...e){return e.reduce((t,n)=>n==null?t:function(...r){t.apply(this,r),n.apply(this,r)},()=>{})}function i2(e,t=166){let n;function i(...r){const o=()=>{e.apply(this,r)};clearTimeout(n),n=setTimeout(o,t)}return i.clear=()=>{clearTimeout(n)},i}function Y1(e){return e&&e.ownerDocument||document}function ke(e){return Y1(e).defaultView||window}function r2(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const o2=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},li=o2,ci={disabled:!1};var a2=function(t){return t.scrollTop},ce="unmounted",y0="exited",b0="entering",R0="entered",Xt="exiting",l0=function(e){As(t,e);function t(i,r){var o;o=e.call(this,i,r)||this;var a=r,s=a&&!a.isMounting?i.enter:i.appear,l;return o.appearStatus=null,i.in?s?(l=y0,o.appearStatus=b0):l=R0:i.unmountOnExit||i.mountOnEnter?l=ce:l=y0,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(r,o){var a=r.in;return a&&o.status===ce?{status:y0}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(r){var o=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==b0&&a!==R0&&(o=b0):(a===b0||a===R0)&&(o=Xt)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var r=this.props.timeout,o,a,s;return o=a=s=r,r!=null&&typeof r!="number"&&(o=r.exit,a=r.enter,s=r.appear!==void 0?r.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(r,o){if(r===void 0&&(r=!1),o!==null)if(this.cancelNextCallback(),o===b0){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:F0.findDOMNode(this);a&&a2(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===y0&&this.setState({status:ce})},n.performEnter=function(r){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:r,l=this.props.nodeRef?[s]:[F0.findDOMNode(this),s],u=l[0],d=l[1],f=this.getTimeouts(),m=s?f.appear:f.enter;if(!r&&!a||ci.disabled){this.safeSetState({status:R0},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:b0},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:R0},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var r=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:F0.findDOMNode(this);if(!o||ci.disabled){this.safeSetState({status:y0},function(){r.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:Xt},function(){r.props.onExiting(s),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:y0},function(){r.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(r,o){o=this.setNextCallback(o),this.setState(r,o)},n.setNextCallback=function(r){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,r(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(r,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:F0.findDOMNode(this),s=r==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],u=l[0],d=l[1];this.props.addEndListener(u,d)}r!=null&&setTimeout(this.nextCallback,r)},n.render=function(){var r=this.state.status;if(r===ce)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=I1(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return v.createElement(Jr.Provider,{value:null},typeof a=="function"?a(r,s):v.cloneElement(v.Children.only(a),s))},t}(v.Component);l0.contextType=Jr;l0.propTypes={};function M0(){}l0.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:M0,onEntering:M0,onEntered:M0,onExit:M0,onExiting:M0,onExited:M0};l0.UNMOUNTED=ce;l0.EXITED=y0;l0.ENTERING=b0;l0.ENTERED=R0;l0.EXITING=Xt;const so=l0,lo=e=>e.scrollTop;function qe(e,t){var n,i;const{timeout:r,easing:o,style:a={}}=e;return{duration:(n=a.transitionDuration)!=null?n:typeof r=="number"?r:r[t.mode]||0,easing:(i=a.transitionTimingFunction)!=null?i:typeof o=="object"?o[t.mode]:o,delay:a.transitionDelay}}function s2(e){return Ee("MuiPaper",e)}Se("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 l2=["className","component","elevation","square","variant"],c2=e=>{const{square:t,elevation:n,variant:i,classes:r}=e,o={root:["root",i,!t&&"rounded",i==="elevation"&&`elevation${n}`]};return _e(o,s2,r)},u2=D0("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 F({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"&&F({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Ke("#fff",li(t.elevation))}, ${Ke("#fff",li(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),d2=h.forwardRef(function(t,n){const i=Ae({props:t,name:"MuiPaper"}),{className:r,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation"}=i,u=I1(i,l2),d=F({},i,{component:o,elevation:a,square:s,variant:l}),f=c2(d);return c.jsx(u2,F({as:o,ownerState:d,className:S0(f.root,r),ref:n},u))}),f2=d2;function h2(e){return Ee("MuiIconButton",e)}const m2=Se("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),p2=m2,x2=["edge","children","className","color","disabled","disableFocusRipple","size"],k2=e=>{const{classes:t,disabled:n,color:i,edge:r,size:o}=e,a={root:["root",n&&"disabled",i!=="default"&&`color${H0(i)}`,r&&`edge${H0(r)}`,`size${H0(o)}`]};return _e(a,h2,t)},g2=D0(_s,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${H0(n.color)}`],n.edge&&t[`edge${H0(n.edge)}`],t[`size${H0(n.size)}`]]}})(({theme:e,ownerState:t})=>F({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})`:Ke(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 i=(n=(e.vars||e).palette)==null?void 0:n[t.color];return F({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&F({color:i==null?void 0:i.main},!t.disableRipple&&{"&:hover":F({},i&&{backgroundColor:e.vars?`rgba(${i.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ke(i.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)},{[`&.${p2.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),C2=h.forwardRef(function(t,n){const i=Ae({props:t,name:"MuiIconButton"}),{edge:r=!1,children:o,className:a,color:s="default",disabled:l=!1,disableFocusRipple:u=!1,size:d="medium"}=i,f=I1(i,x2),m=F({},i,{edge:r,color:s,disabled:l,disableFocusRipple:u,size:d}),k=k2(m);return c.jsx(g2,F({className:S0(k.root,a),centerRipple:!0,focusRipple:!u,disabled:l,ref:n,ownerState:m},f,{children:o}))}),co=C2;function uo(e){return typeof e=="string"}function y2(e,t,n){return e===void 0||uo(e)?t:F({},t,{ownerState:F({},t.ownerState,n)})}function fo(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(i=>i.match(/^on[A-Z]/)&&typeof e[i]=="function"&&!t.includes(i)).forEach(i=>{n[i]=e[i]}),n}function b2(e,t,n){return typeof e=="function"?e(t,n):e}function ho(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=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 v2(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:i,externalForwardedProps:r,className:o}=e;if(!t){const k=ui(n==null?void 0:n.className,o,r==null?void 0:r.className,i==null?void 0:i.className),p=F({},n==null?void 0:n.style,r==null?void 0:r.style,i==null?void 0:i.style),g=F({},n,r,i);return k.length>0&&(g.className=k),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:void 0}}const a=fo(F({},r,i)),s=di(i),l=di(r),u=t(a),d=ui(u==null?void 0:u.className,n==null?void 0:n.className,o,r==null?void 0:r.className,i==null?void 0:i.className),f=F({},u==null?void 0:u.style,n==null?void 0:n.style,r==null?void 0:r.style,i==null?void 0:i.style),m=F({},u,n,l,s);return d.length>0&&(m.className=d),Object.keys(f).length>0&&(m.style=f),{props:m,internalRef:u.ref}}const w2=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Ye(e){var t;const{elementType:n,externalSlotProps:i,ownerState:r,skipResolvingSlotProps:o=!1}=e,a=I1(e,w2),s=o?{}:b2(i,r),{props:l,internalRef:u}=v2(F({},a,{externalSlotProps:s})),d=B0(u,s==null?void 0:s.ref,(t=e.additionalProps)==null?void 0:t.ref);return y2(n,F({},l,{ref:d}),r)}const E2=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function S2(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 A2(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=i=>e.ownerDocument.querySelector(`input[type="radio"]${i}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function _2(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||A2(e))}function V2(e){const t=[],n=[];return Array.from(e.querySelectorAll(E2)).forEach((i,r)=>{const o=S2(i);o===-1||!_2(i)||(o===0?t.push(i):n.push({documentOrder:r,tabIndex:o,node:i}))}),n.sort((i,r)=>i.tabIndex===r.tabIndex?i.documentOrder-r.documentOrder:i.tabIndex-r.tabIndex).map(i=>i.node).concat(t)}function D2(){return!0}function B2(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:i=!1,disableRestoreFocus:r=!1,getTabbable:o=V2,isEnabled:a=D2,open:s}=e,l=h.useRef(!1),u=h.useRef(null),d=h.useRef(null),f=h.useRef(null),m=h.useRef(null),k=h.useRef(!1),p=h.useRef(null),g=B0(t.ref,p),C=h.useRef(null);h.useEffect(()=>{!s||!p.current||(k.current=!n)},[n,s]),h.useEffect(()=>{if(!s||!p.current)return;const b=Y1(p.current);return p.current.contains(b.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),k.current&&p.current.focus()),()=>{r||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[s]),h.useEffect(()=>{if(!s||!p.current)return;const b=Y1(p.current),w=A=>{C.current=A,!(i||!a()||A.key!=="Tab")&&b.activeElement===p.current&&A.shiftKey&&(l.current=!0,d.current&&d.current.focus())},E=()=>{const A=p.current;if(A===null)return;if(!b.hasFocus()||!a()||l.current){l.current=!1;return}if(A.contains(b.activeElement)||i&&b.activeElement!==u.current&&b.activeElement!==d.current)return;if(b.activeElement!==m.current)m.current=null;else if(m.current!==null)return;if(!k.current)return;let _=[];if((b.activeElement===u.current||b.activeElement===d.current)&&(_=o(p.current)),_.length>0){var G,B;const D=!!((G=C.current)!=null&&G.shiftKey&&((B=C.current)==null?void 0:B.key)==="Tab"),V=_[0],R=_[_.length-1];typeof V!="string"&&typeof R!="string"&&(D?R.focus():V.focus())}else A.focus()};b.addEventListener("focusin",E),b.addEventListener("keydown",w,!0);const S=setInterval(()=>{b.activeElement&&b.activeElement.tagName==="BODY"&&E()},50);return()=>{clearInterval(S),b.removeEventListener("focusin",E),b.removeEventListener("keydown",w,!0)}},[n,i,r,a,s,o]);const x=b=>{f.current===null&&(f.current=b.relatedTarget),k.current=!0,m.current=b.target;const w=t.props.onFocus;w&&w(b)},y=b=>{f.current===null&&(f.current=b.relatedTarget),k.current=!0};return c.jsxs(h.Fragment,{children:[c.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":"sentinelStart"}),h.cloneElement(t,{ref:g,onFocus:x}),c.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:d,"data-testid":"sentinelEnd"})]})}function j2(e){return typeof e=="function"?e():e}const $2=h.forwardRef(function(t,n){const{children:i,container:r,disablePortal:o=!1}=t,[a,s]=h.useState(null),l=B0(h.isValidElement(i)?i.ref:null,n);if(ri(()=>{o||s(j2(r)||document.body)},[r,o]),ri(()=>{if(a&&!o)return oi(n,a),()=>{oi(n,null)}},[n,a,o]),o){if(h.isValidElement(i)){const u={ref:l};return h.cloneElement(i,u)}return c.jsx(h.Fragment,{children:i})}return c.jsx(h.Fragment,{children:a&&pt.createPortal(i,a)})});function G2(e){const t=Y1(e);return t.body===e?ke(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function he(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function fi(e){return parseInt(ke(e).getComputedStyle(e).paddingRight,10)||0}function P2(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,i=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||i}function hi(e,t,n,i,r){const o=[t,n,...i];[].forEach.call(e.children,a=>{const s=o.indexOf(a)===-1,l=!P2(a);s&&l&&he(a,r)})}function Gt(e,t){let n=-1;return e.some((i,r)=>t(i)?(n=r,!0):!1),n}function M2(e,t){const n=[],i=e.container;if(!t.disableScrollLock){if(G2(i)){const a=r2(Y1(i));n.push({value:i.style.paddingRight,property:"padding-right",el:i}),i.style.paddingRight=`${fi(i)+a}px`;const s=Y1(i).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${fi(l)+a}px`})}let o;if(i.parentNode instanceof DocumentFragment)o=Y1(i).body;else{const a=i.parentElement,s=ke(i);o=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a:i}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:a,property:s})=>{o?a.style.setProperty(s,o):a.style.removeProperty(s)})}}function L2(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class O2{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let i=this.modals.indexOf(t);if(i!==-1)return i;i=this.modals.length,this.modals.push(t),t.modalRef&&he(t.modalRef,!1);const r=L2(n);hi(n,t.mount,t.modalRef,r,!0);const o=Gt(this.containers,a=>a.container===n);return o!==-1?(this.containers[o].modals.push(t),i):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:r}),i)}mount(t,n){const i=Gt(this.containers,o=>o.modals.indexOf(t)!==-1),r=this.containers[i];r.restore||(r.restore=M2(r,n))}remove(t,n=!0){const i=this.modals.indexOf(t);if(i===-1)return i;const r=Gt(this.containers,a=>a.modals.indexOf(t)!==-1),o=this.containers[r];if(o.modals.splice(o.modals.indexOf(t),1),this.modals.splice(i,1),o.modals.length===0)o.restore&&o.restore(),t.modalRef&&he(t.modalRef,n),hi(o.container,t.mount,t.modalRef,o.hiddenSiblings,!1),this.containers.splice(r,1);else{const a=o.modals[o.modals.length-1];a.modalRef&&he(a.modalRef,!1)}return i}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function T2(e){return typeof e=="function"?e():e}function R2(e){return e?e.props.hasOwnProperty("in"):!1}const F2=new O2;function I2(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:i=!1,manager:r=F2,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:u,open:d,rootRef:f}=e,m=h.useRef({}),k=h.useRef(null),p=h.useRef(null),g=B0(p,f),[C,x]=h.useState(!d),y=R2(l);let b=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(b=!1);const w=()=>Y1(k.current),E=()=>(m.current.modalRef=p.current,m.current.mount=k.current,m.current),S=()=>{r.mount(E(),{disableScrollLock:i}),p.current&&(p.current.scrollTop=0)},A=ai(()=>{const j=T2(t)||w().body;r.add(E(),j),p.current&&S()}),_=h.useCallback(()=>r.isTopModal(E()),[r]),G=ai(j=>{k.current=j,j&&(d&&_()?S():p.current&&he(p.current,b))}),B=h.useCallback(()=>{r.remove(E(),b)},[b,r]);h.useEffect(()=>()=>{B()},[B]),h.useEffect(()=>{d?A():(!y||!o)&&B()},[d,B,y,o,A]);const D=j=>L=>{var Z;(Z=j.onKeyDown)==null||Z.call(j,L),!(L.key!=="Escape"||L.which===229||!_())&&(n||(L.stopPropagation(),u&&u(L,"escapeKeyDown")))},V=j=>L=>{var Z;(Z=j.onClick)==null||Z.call(j,L),L.target===L.currentTarget&&u&&u(L,"backdropClick")};return{getRootProps:(j={})=>{const L=fo(e);delete L.onTransitionEnter,delete L.onTransitionExited;const Z=F({},L,j);return F({role:"presentation"},Z,{onKeyDown:D(Z),ref:g})},getBackdropProps:(j={})=>{const L=j;return F({"aria-hidden":!0},L,{onClick:V(L),open:d})},getTransitionProps:()=>{const j=()=>{x(!1),a&&a()},L=()=>{x(!0),s&&s(),o&&B()};return{onEnter:si(j,l==null?void 0:l.props.onEnter),onExited:si(L,l==null?void 0:l.props.onExited)}},rootRef:g,portalRef:G,isTopModal:_,exited:C,hasTransition:y}}const H2=["top","right","bottom","left"],m0=Math.min,$1=Math.max,Xe=Math.round,Te=Math.floor,p0=e=>({x:e,y:e}),N2={left:"right",right:"left",bottom:"top",top:"bottom"},z2={start:"end",end:"start"};function Qt(e,t,n){return $1(e,m0(t,n))}function r0(e,t){return typeof e=="function"?e(t):e}function o0(e){return e.split("-")[0]}function q0(e){return e.split("-")[1]}function Dn(e){return e==="x"?"y":"x"}function Bn(e){return e==="y"?"height":"width"}function Y0(e){return["top","bottom"].includes(o0(e))?"y":"x"}function jn(e){return Dn(Y0(e))}function Z2(e,t,n){n===void 0&&(n=!1);const i=q0(e),r=jn(e),o=Bn(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Qe(a)),[a,Qe(a)]}function U2(e){const t=Qe(e);return[Jt(e),t,Jt(t)]}function Jt(e){return e.replace(/start|end/g,t=>z2[t])}function W2(e,t,n){const i=["left","right"],r=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:i:t?i:r;case"left":case"right":return t?o:a;default:return[]}}function K2(e,t,n,i){const r=q0(e);let o=W2(o0(e),n==="start",i);return r&&(o=o.map(a=>a+"-"+r),t&&(o=o.concat(o.map(Jt)))),o}function Qe(e){return e.replace(/left|right|bottom|top/g,t=>N2[t])}function q2(e){return{top:0,right:0,bottom:0,left:0,...e}}function mo(e){return typeof e!="number"?q2(e):{top:e,right:e,bottom:e,left:e}}function Je(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function mi(e,t,n){let{reference:i,floating:r}=e;const o=Y0(t),a=jn(t),s=Bn(a),l=o0(t),u=o==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,m=i[s]/2-r[s]/2;let k;switch(l){case"top":k={x:d,y:i.y-r.height};break;case"bottom":k={x:d,y:i.y+i.height};break;case"right":k={x:i.x+i.width,y:f};break;case"left":k={x:i.x-r.width,y:f};break;default:k={x:i.x,y:i.y}}switch(q0(t)){case"start":k[a]-=m*(n&&u?-1:1);break;case"end":k[a]+=m*(n&&u?-1:1);break}return k}const Y2=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=mi(u,i,l),m=i,k={},p=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:d=0}=r0(e,t)||{};if(u==null)return{};const f=mo(d),m={x:n,y:i},k=jn(r),p=Bn(k),g=await a.getDimensions(u),C=k==="y",x=C?"top":"left",y=C?"bottom":"right",b=C?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[k]-m[k]-o.floating[p],E=m[k]-o.reference[k],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let A=S?S[b]:0;(!A||!await(a.isElement==null?void 0:a.isElement(S)))&&(A=s.floating[b]||o.floating[p]);const _=w/2-E/2,G=A/2-g[p]/2-1,B=m0(f[x],G),D=m0(f[y],G),V=B,R=A-g[p]-D,P=A/2-g[p]/2+_,$=Qt(V,P,R),j=!l.arrow&&q0(r)!=null&&P!=$&&o.reference[p]/2-(PV<=0)){var G,B;const V=(((G=o.flip)==null?void 0:G.index)||0)+1,R=E[V];if(R)return{data:{index:V,overflows:_},reset:{placement:R}};let P=(B=_.filter($=>$.overflows[0]<=0).sort(($,j)=>$.overflows[1]-j.overflows[1])[0])==null?void 0:B.placement;if(!P)switch(k){case"bestFit":{var D;const $=(D=_.map(j=>[j.placement,j.overflows.filter(L=>L>0).reduce((L,Z)=>L+Z,0)]).sort((j,L)=>j[1]-L[1])[0])==null?void 0:D[0];$&&(P=$);break}case"initialPlacement":P=s;break}if(r!==P)return{reset:{placement:P}}}return{}}}};function xi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ki(e){return H2.some(t=>e[t]>=0)}const Q2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:i="referenceHidden",...r}=r0(e,t);switch(i){case"referenceHidden":{const o=await ge(t,{...r,elementContext:"reference"}),a=xi(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ki(a)}}}case"escaped":{const o=await ge(t,{...r,altBoundary:!0}),a=xi(o,n.floating);return{data:{escapedOffsets:a,escaped:ki(a)}}}default:return{}}}}};async function J2(e,t){const{placement:n,platform:i,elements:r}=e,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=o0(n),s=q0(n),l=Y0(n)==="y",u=["left","top"].includes(a)?-1:1,d=o&&l?-1:1,f=r0(t,e);let{mainAxis:m,crossAxis:k,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof p=="number"&&(k=s==="end"?p*-1:p),l?{x:k*d,y:m*u}:{x:m*u,y:k*d}}const e3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:o,placement:a,middlewareData:s}=t,l=await J2(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:a}}}}},t3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:C=>{let{x,y}=C;return{x,y}}},...l}=r0(e,t),u={x:n,y:i},d=await ge(t,l),f=Y0(o0(r)),m=Dn(f);let k=u[m],p=u[f];if(o){const C=m==="y"?"top":"left",x=m==="y"?"bottom":"right",y=k+d[C],b=k-d[x];k=Qt(y,k,b)}if(a){const C=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=p+d[C],b=p-d[x];p=Qt(y,p,b)}const g=s.fn({...t,[m]:k,[f]:p});return{...g,data:{x:g.x-n,y:g.y-i}}}}},n3=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:i,placement:r,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=r0(e,t),d={x:n,y:i},f=Y0(r),m=Dn(f);let k=d[m],p=d[f];const g=r0(s,t),C=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const b=m==="y"?"height":"width",w=o.reference[m]-o.floating[b]+C.mainAxis,E=o.reference[m]+o.reference[b]-C.mainAxis;kE&&(k=E)}if(u){var x,y;const b=m==="y"?"width":"height",w=["top","left"].includes(o0(r)),E=o.reference[f]-o.floating[b]+(w&&((x=a.offset)==null?void 0:x[f])||0)+(w?0:C.crossAxis),S=o.reference[f]+o.reference[b]+(w?0:((y=a.offset)==null?void 0:y[f])||0)-(w?C.crossAxis:0);pS&&(p=S)}return{[m]:k,[f]:p}}}},i3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:o}=t,{apply:a=()=>{},...s}=r0(e,t),l=await ge(t,s),u=o0(n),d=q0(n),f=Y0(n)==="y",{width:m,height:k}=i.floating;let p,g;u==="top"||u==="bottom"?(p=u,g=d===(await(r.isRTL==null?void 0:r.isRTL(o.floating))?"start":"end")?"left":"right"):(g=u,p=d==="end"?"top":"bottom");const C=k-l[p],x=m-l[g],y=!t.middlewareData.shift;let b=C,w=x;if(f){const S=m-l.left-l.right;w=d||y?m0(x,S):S}else{const S=k-l.top-l.bottom;b=d||y?m0(C,S):S}if(y&&!d){const S=$1(l.left,0),A=$1(l.right,0),_=$1(l.top,0),G=$1(l.bottom,0);f?w=m-2*(S!==0||A!==0?S+A:$1(l.left,l.right)):b=k-2*(_!==0||G!==0?_+G:$1(l.top,l.bottom))}await a({...t,availableWidth:w,availableHeight:b});const E=await r.getDimensions(o.floating);return m!==E.width||k!==E.height?{reset:{rects:!0}}:{}}}};function x0(e){return po(e)?(e.nodeName||"").toLowerCase():"#document"}function G1(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function c0(e){var t;return(t=(po(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function po(e){return e instanceof Node||e instanceof G1(e).Node}function a0(e){return e instanceof Element||e instanceof G1(e).Element}function X1(e){return e instanceof HTMLElement||e instanceof G1(e).HTMLElement}function gi(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof G1(e).ShadowRoot}function Ve(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=O1(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(r)}function r3(e){return["table","td","th"].includes(x0(e))}function $n(e){const t=Gn(),n=O1(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(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function o3(e){let t=Z0(e);for(;X1(t)&&!gt(t);){if($n(t))return t;t=Z0(t)}return null}function Gn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gt(e){return["html","body","#document"].includes(x0(e))}function O1(e){return G1(e).getComputedStyle(e)}function Ct(e){return a0(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Z0(e){if(x0(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gi(e)&&e.host||c0(e);return gi(t)?t.host:t}function xo(e){const t=Z0(e);return gt(t)?e.ownerDocument?e.ownerDocument.body:e.body:X1(t)&&Ve(t)?t:xo(t)}function Ce(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=xo(e),o=r===((i=e.ownerDocument)==null?void 0:i.body),a=G1(r);return o?t.concat(a,a.visualViewport||[],Ve(r)?r:[],a.frameElement&&n?Ce(a.frameElement):[]):t.concat(r,Ce(r,[],n))}function ko(e){const t=O1(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=X1(e),o=r?e.offsetWidth:n,a=r?e.offsetHeight:i,s=Xe(n)!==o||Xe(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function Pn(e){return a0(e)?e:e.contextElement}function N0(e){const t=Pn(e);if(!X1(t))return p0(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:o}=ko(t);let a=(o?Xe(n.width):n.width)/i,s=(o?Xe(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const a3=p0(0);function go(e){const t=G1(e);return!Gn()||!t.visualViewport?a3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function s3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==G1(e)?!1:t}function A0(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=Pn(e);let a=p0(1);t&&(i?a0(i)&&(a=N0(i)):a=N0(e));const s=s3(o,n,i)?go(o):p0(0);let l=(r.left+s.x)/a.x,u=(r.top+s.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(o){const m=G1(o),k=i&&a0(i)?G1(i):i;let p=m.frameElement;for(;p&&i&&k!==m;){const g=N0(p),C=p.getBoundingClientRect(),x=O1(p),y=C.left+(p.clientLeft+parseFloat(x.paddingLeft))*g.x,b=C.top+(p.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,u*=g.y,d*=g.x,f*=g.y,l+=y,u+=b,p=G1(p).frameElement}}return Je({width:d,height:f,x:l,y:u})}function l3(e){let{rect:t,offsetParent:n,strategy:i}=e;const r=X1(n),o=c0(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s=p0(1);const l=p0(0);if((r||!r&&i!=="fixed")&&((x0(n)!=="body"||Ve(o))&&(a=Ct(n)),X1(n))){const u=A0(n);s=N0(n),l.x=u.x+n.clientLeft,l.y=u.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 c3(e){return Array.from(e.getClientRects())}function Co(e){return A0(c0(e)).left+Ct(e).scrollLeft}function u3(e){const t=c0(e),n=Ct(e),i=e.ownerDocument.body,r=$1(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=$1(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+Co(e);const s=-n.scrollTop;return O1(i).direction==="rtl"&&(a+=$1(t.clientWidth,i.clientWidth)-r),{width:r,height:o,x:a,y:s}}function d3(e,t){const n=G1(e),i=c0(e),r=n.visualViewport;let o=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){o=r.width,a=r.height;const u=Gn();(!u||u&&t==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}return{width:o,height:a,x:s,y:l}}function f3(e,t){const n=A0(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,o=X1(e)?N0(e):p0(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=r*o.x,u=i*o.y;return{width:a,height:s,x:l,y:u}}function Ci(e,t,n){let i;if(t==="viewport")i=d3(e,n);else if(t==="document")i=u3(c0(e));else if(a0(t))i=f3(t,n);else{const r=go(e);i={...t,x:t.x-r.x,y:t.y-r.y}}return Je(i)}function yo(e,t){const n=Z0(e);return n===t||!a0(n)||gt(n)?!1:O1(n).position==="fixed"||yo(n,t)}function h3(e,t){const n=t.get(e);if(n)return n;let i=Ce(e,[],!1).filter(s=>a0(s)&&x0(s)!=="body"),r=null;const o=O1(e).position==="fixed";let a=o?Z0(e):e;for(;a0(a)&&!gt(a);){const s=O1(a),l=$n(a);!l&&s.position==="fixed"&&(r=null),(o?!l&&!r:!l&&s.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Ve(a)&&!l&&yo(e,a))?i=i.filter(d=>d!==a):r=s,a=Z0(a)}return t.set(e,i),i}function m3(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const a=[...n==="clippingAncestors"?h3(t,this._c):[].concat(n),i],s=a[0],l=a.reduce((u,d)=>{const f=Ci(t,d,r);return u.top=$1(f.top,u.top),u.right=m0(f.right,u.right),u.bottom=m0(f.bottom,u.bottom),u.left=$1(f.left,u.left),u},Ci(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function p3(e){return ko(e)}function x3(e,t,n){const i=X1(t),r=c0(t),o=n==="fixed",a=A0(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=p0(0);if(i||!i&&!o)if((x0(t)!=="body"||Ve(r))&&(s=Ct(t)),i){const u=A0(t,!0,o,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else r&&(l.x=Co(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function yi(e,t){return!X1(e)||O1(e).position==="fixed"?null:t?t(e):e.offsetParent}function bo(e,t){const n=G1(e);if(!X1(e))return n;let i=yi(e,t);for(;i&&r3(i)&&O1(i).position==="static";)i=yi(i,t);return i&&(x0(i)==="html"||x0(i)==="body"&&O1(i).position==="static"&&!$n(i))?n:i||o3(e)||n}const k3=async function(e){let{reference:t,floating:n,strategy:i}=e;const r=this.getOffsetParent||bo,o=this.getDimensions;return{reference:x3(t,await r(n),i),floating:{x:0,y:0,...await o(n)}}};function g3(e){return O1(e).direction==="rtl"}const C3={convertOffsetParentRelativeRectToViewportRelativeRect:l3,getDocumentElement:c0,getClippingRect:m3,getOffsetParent:bo,getElementRects:k3,getClientRects:c3,getDimensions:p3,getScale:N0,isElement:a0,isRTL:g3};function y3(e,t){let n=null,i;const r=c0(e);function o(){clearTimeout(i),n&&n.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:u,top:d,width:f,height:m}=e.getBoundingClientRect();if(s||t(),!f||!m)return;const k=Te(d),p=Te(r.clientWidth-(u+f)),g=Te(r.clientHeight-(d+m)),C=Te(u),y={rootMargin:-k+"px "+-p+"px "+-g+"px "+-C+"px",threshold:$1(0,m0(1,l))||1};let b=!0;function w(E){const S=E[0].intersectionRatio;if(S!==l){if(!b)return a();S?a(!1,S):i=setTimeout(()=>{a(!1,1e-7)},100)}b=!1}try{n=new IntersectionObserver(w,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,y)}n.observe(e)}return a(!0),o}function b3(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=Pn(e),d=r||o?[...u?Ce(u):[],...Ce(t)]:[];d.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const f=u&&s?y3(u,n):null;let m=-1,k=null;a&&(k=new ResizeObserver(x=>{let[y]=x;y&&y.target===u&&k&&(k.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{k&&k.observe(t)})),n()}),u&&!l&&k.observe(u),k.observe(t));let p,g=l?A0(e):null;l&&C();function C(){const x=A0(e);g&&(x.x!==g.x||x.y!==g.y||x.width!==g.width||x.height!==g.height)&&n(),g=x,p=requestAnimationFrame(C)}return n(),()=>{d.forEach(x=>{r&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),f&&f(),k&&k.disconnect(),k=null,l&&cancelAnimationFrame(p)}}const v3=(e,t,n)=>{const i=new Map,r={platform:C3,...n},o={...r.platform,_c:i};return Y2(e,t,{...r,platform:o})},w3=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?pi({element:i.current,padding:r}).fn(n):{}:i?pi({element:i,padding:r}).fn(n):{}}}};var Ze=typeof document<"u"?h.useLayoutEffect:h.useEffect;function et(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,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!et(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const o=r[i];if(!(o==="_owner"&&e.$$typeof)&&!et(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function vo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bi(e,t){const n=vo(e);return Math.round(t*n)/n}function vi(e){const t=h.useRef(e);return Ze(()=>{t.current=e}),t}function E3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,k]=h.useState(i);et(m,i)||k(i);const[p,g]=h.useState(null),[C,x]=h.useState(null),y=h.useCallback(j=>{j!=S.current&&(S.current=j,g(j))},[g]),b=h.useCallback(j=>{j!==A.current&&(A.current=j,x(j))},[x]),w=o||p,E=a||C,S=h.useRef(null),A=h.useRef(null),_=h.useRef(d),G=vi(l),B=vi(r),D=h.useCallback(()=>{if(!S.current||!A.current)return;const j={placement:t,strategy:n,middleware:m};B.current&&(j.platform=B.current),v3(S.current,A.current,j).then(L=>{const Z={...L,isPositioned:!0};V.current&&!et(_.current,Z)&&(_.current=Z,pt.flushSync(()=>{f(Z)}))})},[m,t,n,B]);Ze(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(j=>({...j,isPositioned:!1})))},[u]);const V=h.useRef(!1);Ze(()=>(V.current=!0,()=>{V.current=!1}),[]),Ze(()=>{if(w&&(S.current=w),E&&(A.current=E),w&&E){if(G.current)return G.current(w,E,D);D()}},[w,E,D,G]);const R=h.useMemo(()=>({reference:S,floating:A,setReference:y,setFloating:b}),[y,b]),P=h.useMemo(()=>({reference:w,floating:E}),[w,E]),$=h.useMemo(()=>{const j={position:n,left:0,top:0};if(!P.floating)return j;const L=bi(P.floating,d.x),Z=bi(P.floating,d.y);return s?{...j,transform:"translate("+L+"px, "+Z+"px)",...vo(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:Z}},[n,s,P.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:D,refs:R,elements:P,floatingStyles:$}),[d,D,R,P,$])}const S3=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],A3={entering:{opacity:1},entered:{opacity:1}},_3=h.forwardRef(function(t,n){const i=eo(),r={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,easing:l,in:u,onEnter:d,onEntered:f,onEntering:m,onExit:k,onExited:p,onExiting:g,style:C,timeout:x=r,TransitionComponent:y=so}=t,b=I1(t,S3),w=h.useRef(null),E=B0(w,s.ref,n),S=P=>$=>{if(P){const j=w.current;$===void 0?P(j):P(j,$)}},A=S(m),_=S((P,$)=>{lo(P);const j=qe({style:C,timeout:x,easing:l},{mode:"enter"});P.style.webkitTransition=i.transitions.create("opacity",j),P.style.transition=i.transitions.create("opacity",j),d&&d(P,$)}),G=S(f),B=S(g),D=S(P=>{const $=qe({style:C,timeout:x,easing:l},{mode:"exit"});P.style.webkitTransition=i.transitions.create("opacity",$),P.style.transition=i.transitions.create("opacity",$),k&&k(P)}),V=S(p),R=P=>{o&&o(w.current,P)};return c.jsx(y,F({appear:a,in:u,nodeRef:w,onEnter:_,onEntered:G,onEntering:A,onExit:D,onExited:V,onExiting:B,addEndListener:R,timeout:x},b,{children:(P,$)=>h.cloneElement(s,F({style:F({opacity:0,visibility:P==="exited"&&!u?"hidden":void 0},A3[P],C,s.props.style),ref:E},$))}))}),V3=_3;function D3(e){return Ee("MuiBackdrop",e)}Se("MuiBackdrop",["root","invisible"]);const B3=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],j3=e=>{const{classes:t,invisible:n}=e;return _e({root:["root",n&&"invisible"]},D3,t)},$3=D0("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>F({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"})),G3=h.forwardRef(function(t,n){var i,r,o;const a=Ae({props:t,name:"MuiBackdrop"}),{children:s,className:l,component:u="div",components:d={},componentsProps:f={},invisible:m=!1,open:k,slotProps:p={},slots:g={},TransitionComponent:C=V3,transitionDuration:x}=a,y=I1(a,B3),b=F({},a,{component:u,invisible:m}),w=j3(b),E=(i=p.root)!=null?i:f.root;return c.jsx(C,F({in:k,timeout:x},y,{children:c.jsx($3,F({"aria-hidden":!0},E,{as:(r=(o=g.root)!=null?o:d.Root)!=null?r:u,className:S0(w.root,l,E==null?void 0:E.className),ownerState:F({},b,E==null?void 0:E.ownerState),classes:w,ref:n,children:s}))}))}),P3=G3;function M3(e){return Ee("MuiModal",e)}Se("MuiModal",["root","hidden","backdrop"]);const L3=["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"],O3=e=>{const{open:t,exited:n,classes:i}=e;return _e({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},M3,i)},T3=D0("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})=>F({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),R3=D0(P3,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),F3=h.forwardRef(function(t,n){var i,r,o,a,s,l;const u=Ae({name:"MuiModal",props:t}),{BackdropComponent:d=R3,BackdropProps:f,className:m,closeAfterTransition:k=!1,children:p,container:g,component:C,components:x={},componentsProps:y={},disableAutoFocus:b=!1,disableEnforceFocus:w=!1,disableEscapeKeyDown:E=!1,disablePortal:S=!1,disableRestoreFocus:A=!1,disableScrollLock:_=!1,hideBackdrop:G=!1,keepMounted:B=!1,onBackdropClick:D,open:V,slotProps:R,slots:P}=u,$=I1(u,L3),j=F({},u,{closeAfterTransition:k,disableAutoFocus:b,disableEnforceFocus:w,disableEscapeKeyDown:E,disablePortal:S,disableRestoreFocus:A,disableScrollLock:_,hideBackdrop:G,keepMounted:B}),{getRootProps:L,getBackdropProps:Z,getTransitionProps:U,portalRef:J,isTopModal:W,exited:M,hasTransition:Q}=I2(F({},j,{rootRef:n})),e1=F({},j,{exited:M}),X=O3(e1),d1={};if(p.props.tabIndex===void 0&&(d1.tabIndex="-1"),Q){const{onEnter:Y,onExited:r1}=U();d1.onEnter=Y,d1.onExited=r1}const S1=(i=(r=P==null?void 0:P.root)!=null?r:x.Root)!=null?i:T3,A1=(o=(a=P==null?void 0:P.backdrop)!=null?a:x.Backdrop)!=null?o:d,j1=(s=R==null?void 0:R.root)!=null?s:y.root,R1=(l=R==null?void 0:R.backdrop)!=null?l:y.backdrop,d0=Ye({elementType:S1,externalSlotProps:j1,externalForwardedProps:$,getSlotProps:L,additionalProps:{ref:n,as:C},ownerState:e1,className:S0(m,j1==null?void 0:j1.className,X==null?void 0:X.root,!e1.open&&e1.exited&&(X==null?void 0:X.hidden))}),f0=Ye({elementType:A1,externalSlotProps:R1,additionalProps:f,getSlotProps:Y=>Z(F({},Y,{onClick:r1=>{D&&D(r1),Y!=null&&Y.onClick&&Y.onClick(r1)}})),className:S0(R1==null?void 0:R1.className,f==null?void 0:f.className,X==null?void 0:X.backdrop),ownerState:e1});return!B&&!V&&(!Q||M)?null:c.jsx($2,{ref:J,container:g,disablePortal:S,children:c.jsxs(S1,F({},d0,{children:[!G&&d?c.jsx(A1,F({},f0)):null,c.jsx(B2,{disableEnforceFocus:w,disableAutoFocus:b,disableRestoreFocus:A,isEnabled:W,open:V,children:h.cloneElement(p,d1)})]}))})}),I3=F3,H3=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function en(e){return`scale(${e}, ${e**2})`}const N3={entering:{opacity:1,transform:en(1)},entered:{opacity:1,transform:"none"}},Pt=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),wo=h.forwardRef(function(t,n){const{addEndListener:i,appear:r=!0,children:o,easing:a,in:s,onEnter:l,onEntered:u,onEntering:d,onExit:f,onExited:m,onExiting:k,style:p,timeout:g="auto",TransitionComponent:C=so}=t,x=I1(t,H3),y=h.useRef(),b=h.useRef(),w=eo(),E=h.useRef(null),S=B0(E,o.ref,n),A=$=>j=>{if($){const L=E.current;j===void 0?$(L):$(L,j)}},_=A(d),G=A(($,j)=>{lo($);const{duration:L,delay:Z,easing:U}=qe({style:p,timeout:g,easing:a},{mode:"enter"});let J;g==="auto"?(J=w.transitions.getAutoHeightDuration($.clientHeight),b.current=J):J=L,$.style.transition=[w.transitions.create("opacity",{duration:J,delay:Z}),w.transitions.create("transform",{duration:Pt?J:J*.666,delay:Z,easing:U})].join(","),l&&l($,j)}),B=A(u),D=A(k),V=A($=>{const{duration:j,delay:L,easing:Z}=qe({style:p,timeout:g,easing:a},{mode:"exit"});let U;g==="auto"?(U=w.transitions.getAutoHeightDuration($.clientHeight),b.current=U):U=j,$.style.transition=[w.transitions.create("opacity",{duration:U,delay:L}),w.transitions.create("transform",{duration:Pt?U:U*.666,delay:Pt?L:L||U*.333,easing:Z})].join(","),$.style.opacity=0,$.style.transform=en(.75),f&&f($)}),R=A(m),P=$=>{g==="auto"&&(y.current=setTimeout($,b.current||0)),i&&i(E.current,$)};return h.useEffect(()=>()=>{clearTimeout(y.current)},[]),c.jsx(C,F({appear:r,in:s,nodeRef:E,onEnter:G,onEntered:B,onEntering:_,onExit:V,onExited:R,onExiting:D,addEndListener:P,timeout:g==="auto"?null:g},x,{children:($,j)=>h.cloneElement(o,F({style:F({opacity:0,transform:en(.75),visibility:$==="exited"&&!s?"hidden":void 0},N3[$],p,o.props.style),ref:S},j))}))});wo.muiSupportAuto=!0;const z3=wo;function Z3(e){return Ee("MuiPopover",e)}Se("MuiPopover",["root","paper"]);const U3=["onEntering"],W3=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],K3=["slotProps"];function wi(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function Ei(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function Si(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Mt(e){return typeof e=="function"?e():e}const q3=e=>{const{classes:t}=e;return _e({root:["root"],paper:["paper"]},Z3,t)},Y3=D0(I3,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),X3=D0(f2,{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}),Q3=h.forwardRef(function(t,n){var i,r,o;const a=Ae({props:t,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:u={vertical:"top",horizontal:"left"},anchorPosition:d,anchorReference:f="anchorEl",children:m,className:k,container:p,elevation:g=8,marginThreshold:C=16,open:x,PaperProps:y={},slots:b,slotProps:w,transformOrigin:E={vertical:"top",horizontal:"left"},TransitionComponent:S=z3,transitionDuration:A="auto",TransitionProps:{onEntering:_}={},disableScrollLock:G=!1}=a,B=I1(a.TransitionProps,U3),D=I1(a,W3),V=(i=w==null?void 0:w.paper)!=null?i:y,R=h.useRef(),P=B0(R,V.ref),$=F({},a,{anchorOrigin:u,anchorReference:f,elevation:g,marginThreshold:C,externalPaperSlotProps:V,transformOrigin:E,TransitionComponent:S,transitionDuration:A,TransitionProps:B}),j=q3($),L=h.useCallback(()=>{if(f==="anchorPosition")return d;const Y=Mt(l),a1=(Y&&Y.nodeType===1?Y:Y1(R.current).body).getBoundingClientRect();return{top:a1.top+wi(a1,u.vertical),left:a1.left+Ei(a1,u.horizontal)}},[l,u.horizontal,u.vertical,d,f]),Z=h.useCallback(Y=>({vertical:wi(Y,E.vertical),horizontal:Ei(Y,E.horizontal)}),[E.horizontal,E.vertical]),U=h.useCallback(Y=>{const r1={width:Y.offsetWidth,height:Y.offsetHeight},a1=Z(r1);if(f==="none")return{top:null,left:null,transformOrigin:Si(a1)};const Z1=L();let U1=Z1.top-a1.vertical,W1=Z1.left-a1.horizontal;const G0=U1+r1.height,C0=W1+r1.width,K1=ke(Mt(l)),Le=K1.innerHeight-C,O=K1.innerWidth-C;if(C!==null&&U1Le){const I=G0-Le;U1-=I,a1.vertical+=I}if(C!==null&&W1O){const I=C0-O;W1-=I,a1.horizontal+=I}return{top:`${Math.round(U1)}px`,left:`${Math.round(W1)}px`,transformOrigin:Si(a1)}},[l,f,L,Z,C]),[J,W]=h.useState(x),M=h.useCallback(()=>{const Y=R.current;if(!Y)return;const r1=U(Y);r1.top!==null&&(Y.style.top=r1.top),r1.left!==null&&(Y.style.left=r1.left),Y.style.transformOrigin=r1.transformOrigin,W(!0)},[U]);h.useEffect(()=>(G&&window.addEventListener("scroll",M),()=>window.removeEventListener("scroll",M)),[l,G,M]);const Q=(Y,r1)=>{_&&_(Y,r1),M()},e1=()=>{W(!1)};h.useEffect(()=>{x&&M()}),h.useImperativeHandle(s,()=>x?{updatePosition:()=>{M()}}:null,[x,M]),h.useEffect(()=>{if(!x)return;const Y=i2(()=>{M()}),r1=ke(l);return r1.addEventListener("resize",Y),()=>{Y.clear(),r1.removeEventListener("resize",Y)}},[l,x,M]);let X=A;A==="auto"&&!S.muiSupportAuto&&(X=void 0);const d1=p||(l?Y1(Mt(l)).body:void 0),S1=(r=b==null?void 0:b.root)!=null?r:Y3,A1=(o=b==null?void 0:b.paper)!=null?o:X3,j1=Ye({elementType:A1,externalSlotProps:F({},V,{style:J?V.style:F({},V.style,{opacity:0})}),additionalProps:{elevation:g,ref:P},ownerState:$,className:S0(j.paper,V==null?void 0:V.className)}),R1=Ye({elementType:S1,externalSlotProps:(w==null?void 0:w.root)||{},externalForwardedProps:D,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:d1,open:x},ownerState:$,className:S0(j.root,k)}),{slotProps:d0}=R1,f0=I1(R1,K3);return c.jsx(S1,F({},f0,!uo(S1)&&{slotProps:d0,disableScrollLock:G},{children:c.jsx(S,F({appear:!0,in:x,onEntering:Q,onExited:e1,timeout:X},B,{children:c.jsx(A1,F({},j1,{children:m}))}))}))}),J3=Q3;function e5(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Eo(...e){return t=>e.forEach(n=>e5(n,t))}function X0(...e){return h.useCallback(Eo(...e),e)}const So=h.forwardRef((e,t)=>{const{children:n,...i}=e,r=h.Children.toArray(n),o=r.find(t5);if(o){const a=o.props.children,s=r.map(l=>l===o?h.Children.count(a)>1?h.Children.only(null):h.isValidElement(a)?a.props.children:null:l);return h.createElement(tn,F({},i,{ref:t}),h.isValidElement(a)?h.cloneElement(a,void 0,s):null)}return h.createElement(tn,F({},i,{ref:t}),n)});So.displayName="Slot";const tn=h.forwardRef((e,t)=>{const{children:n,...i}=e;return h.isValidElement(n)?h.cloneElement(n,{...n5(i,n.props),ref:t?Eo(t,n.ref):n.ref}):h.Children.count(n)>1?h.Children.only(null):null});tn.displayName="SlotClone";const Ao=({children:e})=>h.createElement(h.Fragment,null,e);function t5(e){return h.isValidElement(e)&&e.type===Ao}function n5(e,t){const n={...t};for(const i in t){const r=e[i],o=t[i];/^on[A-Z]/.test(i)?r&&o?n[i]=(...s)=>{o(...s),r(...s)}:r&&(n[i]=r):i==="style"?n[i]={...r,...o}:i==="className"&&(n[i]=[r,o].filter(Boolean).join(" "))}return{...e,...n}}const i5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],j0=i5.reduce((e,t)=>{const n=h.forwardRef((i,r)=>{const{asChild:o,...a}=i,s=o?So:t;return h.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),h.createElement(s,F({},a,{ref:r}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function r5(e,t){e&&pt.flushSync(()=>e.dispatchEvent(t))}const o5=h.forwardRef((e,t)=>{var n;const{container:i=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...r}=e;return i?F0.createPortal(h.createElement(j0.div,F({},r,{ref:t})),i):null}),a5=o5;var Ai=Object.prototype.hasOwnProperty;function ye(e,t){var n,i;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((i=e.length)===t.length)for(;i--&&ye(e[i],t[i]););return i===-1}if(!n||typeof e=="object"){i=0;for(n in e)if(Ai.call(e,n)&&++i&&!Ai.call(t,n)||!(n in t)||!ye(e[n],t[n]))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}function De(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 i=0;i0;)a[s]=arguments[s+4];e.call(this,a),e.captureStackTrace&&e.captureStackTrace(this,t),this.rule=n,this.value=i,this.cause=r,this.target=o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Q1=function(t,n){t===void 0&&(t=[]),n===void 0&&(n=[]),this.chain=t,this.nextRuleModifiers=n};Q1.prototype._applyRule=function(t,n){var i=this;return function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return i.chain.push(new yt(n,t.apply(i,r),r,i.nextRuleModifiers)),i.nextRuleModifiers=[],i}};Q1.prototype._applyModifier=function(t,n){return this.nextRuleModifiers.push(new s5(n,t.simple,t.async)),this};Q1.prototype._clone=function(){return new Q1(this.chain.slice(),this.nextRuleModifiers.slice())};Q1.prototype.test=function(t){return this.chain.every(function(n){return n._test(t)})};Q1.prototype.testAll=function(t){var n=[];return this.chain.forEach(function(i){try{i._check(t)}catch(r){n.push(new Mn(i,t,r))}}),n};Q1.prototype.check=function(t){this.chain.forEach(function(n){try{n._check(t)}catch(i){throw new Mn(n,t,i)}})};Q1.prototype.testAsync=function(t){var n=this;return new Promise(function(i,r){Do(t,n.chain.slice(),i,r)})};function Do(e,t,n,i){if(t.length){var r=t.shift();r._testAsync(e).then(function(){Do(e,t,n,i)},function(o){i(new Mn(r,e,o))})}else n(e)}var _i=function(e,t){return t&&typeof e=="string"&&e.trim().length===0?!0:e==null};function l5(e,t){return t===void 0&&(t=!1),{simple:function(n){return _i(n,t)||e.check(n)===void 0},async:function(n){return _i(n,t)||e.testAsync(n)}}}function D1(){return typeof Proxy<"u"?Bo(new Q1):nn(new Q1)}var be={};D1.extend=function(e){Object.assign(be,e)};D1.clearCustomRules=function(){be={}};function Bo(e){return new Proxy(e,{get:function(n,i){if(i in n)return n[i];var r=Bo(e._clone());if(i in tt)return r._applyModifier(tt[i],i);if(i in be)return r._applyRule(be[i],i);if(i in rn)return r._applyRule(rn[i],i)}})}function nn(e){var t=function(r,o){return Object.keys(r).forEach(function(a){o[a]=function(){for(var s=[],l=arguments.length;l--;)s[l]=arguments[l];var u=nn(o._clone()),d=u._applyRule(r[a],a).apply(void 0,s);return d}}),o},n=t(rn,e),i=t(be,n);return Object.keys(tt).forEach(function(r){Object.defineProperty(i,r,{get:function(){var o=nn(i._clone());return o._applyModifier(tt[r],r)}})}),i}var tt={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 Re(t).some(function(n){try{return e(n)}catch{return!1}})}},async:function(e){return function(t){return Promise.all(Re(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&&Re(t).every(e)}},async:function(e){return function(t){return Promise.all(Re(t).map(e)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(e,t){return function(n){return Vi(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(i){return Vi(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&i:i}).catch(function(){return!1})}}}};function Vi(e){return e&&e.name==="schema"&&e.args.length>0&&typeof e.args[0]=="object"}function Re(e){return typeof e=="string"?e.split(""):e}var rn={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||c5;return t(e)}},numeric:function(){return function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},string:function(){return L0("string")},boolean:function(){return L0("boolean")},undefined:function(){return L0("undefined")},null:function(){return L0("null")},array:function(){return L0("array")},object:function(){return L0("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 u5(e)},passesAnyOf:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(n){return e.some(function(i){return i.test(n)})}},optional:l5};function L0(e){return function(t){return Array.isArray(t)&&e==="array"||t===null&&e==="null"||typeof t===e}}function c5(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function u5(e){return{simple:function(t){var n=[];if(Object.keys(e).forEach(function(i){var r=e[i];try{r.check((t||{})[i])}catch(o){o.target=i,n.push(o)}}),n.length>0)throw n;return!0},async:function(t){var n=[],i=Object.keys(e).map(function(r){var o=e[r];return o.testAsync((t||{})[r]).catch(function(a){a.target=r,n.push(a)})});return Promise.all(i).then(function(){if(n.length>0)throw n;return!0})}}}var t1="colors",g1="sizes",T="space",d5={gap:T,gridGap:T,columnGap:T,gridColumnGap:T,rowGap:T,gridRowGap:T,inset:T,insetBlock:T,insetBlockEnd:T,insetBlockStart:T,insetInline:T,insetInlineEnd:T,insetInlineStart:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,marginBlock:T,marginBlockEnd:T,marginBlockStart:T,marginInline:T,marginInlineEnd:T,marginInlineStart:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,paddingBlock:T,paddingBlockEnd:T,paddingBlockStart:T,paddingInline:T,paddingInlineEnd:T,paddingInlineStart:T,top:T,right:T,bottom:T,left:T,scrollMargin:T,scrollMarginTop:T,scrollMarginRight:T,scrollMarginBottom:T,scrollMarginLeft:T,scrollMarginX:T,scrollMarginY:T,scrollMarginBlock:T,scrollMarginBlockEnd:T,scrollMarginBlockStart:T,scrollMarginInline:T,scrollMarginInlineEnd:T,scrollMarginInlineStart:T,scrollPadding:T,scrollPaddingTop:T,scrollPaddingRight:T,scrollPaddingBottom:T,scrollPaddingLeft:T,scrollPaddingX:T,scrollPaddingY:T,scrollPaddingBlock:T,scrollPaddingBlockEnd:T,scrollPaddingBlockStart:T,scrollPaddingInline:T,scrollPaddingInlineEnd:T,scrollPaddingInlineStart:T,fontSize:"fontSizes",background:t1,backgroundColor:t1,backgroundImage:t1,borderImage:t1,border:t1,borderBlock:t1,borderBlockEnd:t1,borderBlockStart:t1,borderBottom:t1,borderBottomColor:t1,borderColor:t1,borderInline:t1,borderInlineEnd:t1,borderInlineStart:t1,borderLeft:t1,borderLeftColor:t1,borderRight:t1,borderRightColor:t1,borderTop:t1,borderTopColor:t1,caretColor:t1,color:t1,columnRuleColor:t1,fill:t1,outline:t1,outlineColor:t1,stroke:t1,textDecorationColor:t1,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:g1,minBlockSize:g1,maxBlockSize:g1,inlineSize:g1,minInlineSize:g1,maxInlineSize:g1,width:g1,minWidth:g1,maxWidth:g1,height:g1,minHeight:g1,maxHeight:g1,flexBasis:g1,gridTemplateColumns:g1,gridTemplateRows:g1,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"},f5=(e,t)=>typeof t=="function"?{"()":Function.prototype.toString.call(t)}:t,Q0=()=>{const e=Object.create(null);return(t,n,...i)=>{const r=(o=>JSON.stringify(o,f5))(t);return r in e?e[r]:e[r]=n(t,...i)}},w0=Symbol.for("sxs.internal"),Ln=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),Di=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:h5}=Object.prototype,on=e=>e.includes("-")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase()),m5=/\s+(?![^()]*\))/,O0=e=>t=>e(...typeof t=="string"?String(t).split(m5):[t]),Bi={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:O0((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e})),marginInline:O0((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e})),maxSize:O0((e,t)=>({maxBlockSize:e,maxInlineSize:t||e})),minSize:O0((e,t)=>({minBlockSize:e,minInlineSize:t||e})),paddingBlock:O0((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e})),paddingInline:O0((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e}))},Lt=/([\d.]+)([^]*)/,p5=(e,t)=>e.length?e.reduce((n,i)=>(n.push(...t.map(r=>r.includes("&")?r.replace(/&/g,/[ +>|~]/.test(i)&&/&.*&/.test(r)?`:is(${i})`:i):i+" "+r)),n),[]):t,x5=(e,t)=>e in k5&&typeof t=="string"?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,i,r,o)=>i+(r==="stretch"?`-moz-available${o};${on(e)}:${i}-webkit-fill-available`:`-moz-fit-content${o};${on(e)}:${i}fit-content`)+o):String(t),k5={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},s0=e=>e?e+"-":"",jo=(e,t,n)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(i,r,o,a,s)=>a=="$"==!!o?i:(r||a=="--"?"calc(":"")+"var(--"+(a==="$"?s0(t)+(s.includes("$")?"":s0(n))+s.replace(/\$/g,"-"):s)+")"+(r||a=="--"?"*"+(r||"")+(o||"1")+")":"")),g5=/\s*,\s*(?![^()]*\))/,C5=Object.prototype.toString,I0=(e,t,n,i,r)=>{let o,a,s;const l=(u,d,f)=>{let m,k;const p=g=>{for(m in g){const y=m.charCodeAt(0)===64,b=y&&Array.isArray(g[m])?g[m]:[g[m]];for(k of b){const w=/[A-Z]/.test(x=m)?x:x.replace(/-[^]/g,S=>S[1].toUpperCase()),E=typeof k=="object"&&k&&k.toString===C5&&(!i.utils[w]||!d.length);if(w in i.utils&&!E){const S=i.utils[w];if(S!==a){a=S,p(S(k)),a=null;continue}}else if(w in Bi){const S=Bi[w];if(S!==s){s=S,p(S(k)),s=null;continue}}if(y&&(C=m.slice(1)in i.media?"@media "+i.media[m.slice(1)]:m,m=C.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(S,A,_,G,B,D)=>{const V=Lt.test(A),R=.0625*(V?-1:1),[P,$]=V?[G,A]:[A,G];return"("+(_[0]==="="?"":_[0]===">"===V?"max-":"min-")+P+":"+(_[0]!=="="&&_.length===1?$.replace(Lt,(j,L,Z)=>Number(L)+R*(_===">"?1:-1)+Z):$)+(B?") and ("+(B[0]===">"?"min-":"max-")+P+":"+(B.length===1?D.replace(Lt,(j,L,Z)=>Number(L)+R*(B===">"?-1:1)+Z):D):"")+")"})),E){const S=y?f.concat(m):[...f],A=y?[...d]:p5(d,m.split(g5));o!==void 0&&r(ji(...o)),o=void 0,l(k,A,S)}else o===void 0&&(o=[[],d,f]),m=y||m.charCodeAt(0)!==36?m:`--${s0(i.prefix)}${m.slice(1).replace(/\$/g,"-")}`,k=E?k:typeof k=="number"?k&&w in y5?String(k)+"px":String(k):jo(x5(w,k??""),i.prefix,i.themeMap[w]),o[0].push(`${y?`${m} `:`${on(m)}:`}${k}`)}}var C,x};p(u),o!==void 0&&r(ji(...o)),o=void 0};l(e,t,n)},ji=(e,t,n)=>`${n.map(i=>`${i}{`).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,y5={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},$i=e=>String.fromCharCode(e+(e>25?39:97)),E0=e=>(t=>{let n,i="";for(n=Math.abs(t);n>52;n=n/52|0)i=$i(n%52)+i;return $i(n%52)+i})(((t,n)=>{let i=n.length;for(;i;)t=33*t^n.charCodeAt(--i);return t})(5381,JSON.stringify(e))>>>0),ue=["themed","global","styled","onevar","resonevar","allvar","inline"],b5=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch{return!1}},v5=e=>{let t;const n=()=>{const{cssRules:r}=t.sheet;return[].map.call(r,(o,a)=>{const{cssText:s}=o;let l="";if(s.startsWith("--sxs"))return"";if(r[a-1]&&(l=r[a-1].cssText).startsWith("--sxs")){if(!o.cssRules.length)return"";for(const u in t.rules)if(t.rules[u].group===o)return`--sxs{--sxs:${[...t.rules[u].cache].join(" ")}}${s}`;return o.cssRules.length?`${l}${s}`:""}return s}).join("")},i=()=>{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 u in s)delete s[u]}const r=Object(e).styleSheets||[];for(const s of r)if(b5(s)){for(let l=0,u=s.cssRules;u[l];++l){const d=Object(u[l]);if(d.type!==1)continue;const f=Object(u[l+1]);if(f.type!==4)continue;++l;const{cssText:m}=d;if(!m.startsWith("--sxs"))continue;const k=m.slice(14,-3).trim().split(/\s+/),p=ue[k[0]];p&&(t||(t={sheet:s,reset:i,rules:{},toString:n}),t.rules[p]={group:f,index:l,cache:new Set(k)})}if(t)break}if(!t){const s=(l,u)=>({type:u,cssRules:[],insertRule(d,f){this.cssRules.splice(f,0,s(d,{import:3,undefined:1}[(d.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return l==="@media{}"?`@media{${[].map.call(this.cssRules,d=>d.cssText).join("")}}`:l}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:s("","text/css"),rules:{},reset:i,toString:n}}const{sheet:o,rules:a}=t;for(let s=ue.length-1;s>=0;--s){const l=ue[s];if(!a[l]){const u=ue[s+1],d=a[u]?a[u].index:o.cssRules.length;o.insertRule("@media{}",d),o.insertRule(`--sxs{--sxs:${s}}`,d),a[l]={group:o.cssRules[d+1],index:d,cache:new Set([s])}}w5(a[l])}};return i(),t},w5=e=>{const t=e.group;let n=t.cssRules.length;e.apply=i=>{try{t.insertRule(i,n),++n}catch{}}},re=Symbol(),E5=Q0(),Gi=(e,t)=>E5(e,()=>(...n)=>{let i={type:null,composers:new Set};for(const r of n)if(r!=null)if(r[w0]){i.type==null&&(i.type=r[w0].type);for(const o of r[w0].composers)i.composers.add(o)}else r.constructor!==Object||r.$$typeof?i.type==null&&(i.type=r):i.composers.add(S5(r,e));return i.type==null&&(i.type="span"),i.composers.size||i.composers.add(["PJLV",{},[],[],{},[]]),A5(e,i,t)}),S5=({variants:e,compoundVariants:t,defaultVariants:n,...i},r)=>{const o=`${s0(r.prefix)}c-${E0(i)}`,a=[],s=[],l=Object.create(null),u=[];for(const m in n)l[m]=String(n[m]);if(typeof e=="object"&&e)for(const m in e){d=l,f=m,h5.call(d,f)||(l[m]="undefined");const k=e[m];for(const p in k){const g={[m]:String(p)};String(p)==="undefined"&&u.push(m);const C=k[p],x=[g,C,!Di(C)];a.push(x)}}var d,f;if(typeof t=="object"&&t)for(const m of t){let{css:k,...p}=m;k=typeof k=="object"&&k||{};for(const C in p)p[C]=String(p[C]);const g=[p,k,!Di(k)];s.push(g)}return[o,i,a,s,l,u]},A5=(e,t,n)=>{const[i,r,o,a]=_5(t.composers),s=typeof t.type=="function"||t.type.$$typeof?(f=>{function m(){for(let k=0;km.rules[k]={apply:p=>m[re].push([k,p])}),m})(n):null,l=(s||n).rules,u=`.${i}${r.length>1?`:where(.${r.slice(1).join(".")})`:""}`,d=f=>{f=typeof f=="object"&&f||V5;const{css:m,...k}=f,p={};for(const x in o)if(delete k[x],x in f){let y=f[x];typeof y=="object"&&y?p[x]={"@initial":o[x],...y}:(y=String(y),p[x]=y!=="undefined"||a.has(x)?y:o[x])}else p[x]=o[x];const g=new Set([...r]);for(const[x,y,b,w]of t.composers){n.rules.styled.cache.has(x)||(n.rules.styled.cache.add(x),I0(y,[`.${x}`],[],e,A=>{l.styled.apply(A)}));const E=Pi(b,p,e.media),S=Pi(w,p,e.media,!0);for(const A of E)if(A!==void 0)for(const[_,G,B]of A){const D=`${x}-${E0(G)}-${_}`;g.add(D);const V=(B?n.rules.resonevar:n.rules.onevar).cache,R=B?l.resonevar:l.onevar;V.has(D)||(V.add(D),I0(G,[`.${D}`],[],e,P=>{R.apply(P)}))}for(const A of S)if(A!==void 0)for(const[_,G]of A){const B=`${x}-${E0(G)}-${_}`;g.add(B),n.rules.allvar.cache.has(B)||(n.rules.allvar.cache.add(B),I0(G,[`.${B}`],[],e,D=>{l.allvar.apply(D)}))}}if(typeof m=="object"&&m){const x=`${i}-i${E0(m)}-css`;g.add(x),n.rules.inline.cache.has(x)||(n.rules.inline.cache.add(x),I0(m,[`.${x}`],[],e,y=>{l.inline.apply(y)}))}for(const x of String(f.className||"").trim().split(/\s+/))x&&g.add(x);const C=k.className=[...g].join(" ");return{type:t.type,className:C,selector:u,props:k,toString:()=>C,deferredInjector:s}};return Ln(d,{className:i,selector:u,[w0]:t,toString:()=>(n.rules.styled.cache.has(i)||d(),i)})},_5=e=>{let t="";const n=[],i={},r=[];for(const[o,,,,a,s]of e){t===""&&(t=o),n.push(o),r.push(...s);for(const l in a){const u=a[l];(i[l]===void 0||u!=="undefined"||s.includes(u))&&(i[l]=u)}}return[t,n,i,new Set(r)]},Pi=(e,t,n,i)=>{const r=[];e:for(let[o,a,s]of e){if(s)continue;let l,u=0,d=!1;for(l in o){const f=o[l];let m=t[l];if(m!==f){if(typeof m!="object"||!m)continue e;{let k,p,g=0;for(const C in m){if(f===String(m[C])){if(C!=="@initial"){const x=C.slice(1);(p=p||[]).push(x in n?n[x]:C.replace(/^@media ?/,"")),d=!0}u+=g,k=!0}++g}if(p&&p.length&&(a={["@media "+p.join(", ")]:a}),!k)continue e}}}(r[u]=r[u]||[]).push([i?"cv":`${l}-${o[l]}`,a,d])}return r},V5={},D5=Q0(),B5=(e,t)=>D5(e,()=>(...n)=>{const i=()=>{for(let r of n){r=typeof r=="object"&&r||{};let o=E0(r);if(!t.rules.global.cache.has(o)){if(t.rules.global.cache.add(o),"@import"in r){let a=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let s of[].concat(r["@import"]))s=s.includes('"')||s.includes("'")?s:`"${s}"`,t.sheet.insertRule(`@import ${s};`,a++);delete r["@import"]}I0(r,[],[],e,a=>{t.rules.global.apply(a)})}}return""};return Ln(i,{toString:i})}),j5=Q0(),$5=(e,t)=>j5(e,()=>n=>{const i=`${s0(e.prefix)}k-${E0(n)}`,r=()=>{if(!t.rules.global.cache.has(i)){t.rules.global.cache.add(i);const o=[];I0(n,[],[],e,s=>o.push(s));const a=`@keyframes ${i}{${o.join("")}}`;t.rules.global.apply(a)}return i};return Ln(r,{get name(){return r()},toString:r})}),G5=class{constructor(e,t,n,i){this.token=e==null?"":String(e),this.value=t==null?"":String(t),this.scale=n==null?"":String(n),this.prefix=i==null?"":String(i)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+s0(this.prefix)+s0(this.scale)+this.token}toString(){return this.computedValue}},P5=Q0(),M5=(e,t)=>P5(e,()=>(n,i)=>{i=typeof n=="object"&&n||Object(i);const r=`.${n=(n=typeof n=="string"?n:"")||`${s0(e.prefix)}t-${E0(i)}`}`,o={},a=[];for(const l in i){o[l]={};for(const u in i[l]){const d=`--${s0(e.prefix)}${l}-${u}`,f=jo(String(i[l][u]),e.prefix,l);o[l][u]=new G5(u,f,l,e.prefix),a.push(`${d}:${f}`)}}const s=()=>{if(a.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);const l=`${i===e.theme?":root,":""}.${n}{${a.join(";")}}`;t.rules.themed.apply(l)}return n};return{...o,get className(){return s()},selector:r,toString:s}}),L5=Q0(),Mi,O5=Q0(),$o=e=>{const t=(n=>{let i=!1;const r=L5(n,o=>{i=!0;const a="prefix"in(o=typeof o=="object"&&o||{})?String(o.prefix):"",s=typeof o.media=="object"&&o.media||{},l=typeof o.root=="object"?o.root||null:globalThis.document||null,u=typeof o.theme=="object"&&o.theme||{},d={prefix:a,media:s,theme:u,themeMap:typeof o.themeMap=="object"&&o.themeMap||{...d5},utils:typeof o.utils=="object"&&o.utils||{}},f=v5(l),m={css:Gi(d,f),globalCss:B5(d,f),keyframes:$5(d,f),createTheme:M5(d,f),reset(){f.reset(),m.theme.toString()},theme:{},sheet:f,config:d,prefix:a,getCssText:f.toString,toString:f.toString};return String(m.theme=m.createTheme(u)),m});return i||r.reset(),r})(e);return t.styled=(({config:n,sheet:i})=>O5(n,()=>{const r=Gi(n,i);return(...o)=>{const a=r(...o),s=a[w0].type,l=v.forwardRef((u,d)=>{const f=u&&u.as||s,{props:m,deferredInjector:k}=a(u);return delete m.as,m.ref=d,k?v.createElement(v.Fragment,null,v.createElement(f,m),v.createElement(k,null)):v.createElement(f,m)});return l.className=a.className,l.displayName=`Styled.${s.displayName||s.name||s}`,l.selector=a.selector,l.toString=()=>a.selector,l[w0]=a[w0],l}}))(t),t},T5=()=>Mi||(Mi=$o()),Xm=(...e)=>T5().styled(...e);function R5(e,t,n){return Math.max(t,Math.min(e,n))}const p1={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 Li(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function Oi(e,t,n,i=.15){return i===0?R5(e,t,n):en?+Li(e-n,n-t,i)+n:e}function F5(e,[t,n],[i,r]){const[[o,a],[s,l]]=e;return[Oi(t,o,a,i),Oi(n,s,l,r)]}function I5(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function H5(e){var t=I5(e,"string");return typeof t=="symbol"?t:String(t)}function V1(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 Ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function c1(e){for(var t=1;t{var n,i;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(i=n.contains)===null||i===void 0?void 0:i.call(n,t.target))})}function Y5(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function Mo(e){return bt(e)?Y5(e)[0]:e}function X5(e){return q5(e).map(t=>t.identifier)}function Ot(e){const t=Mo(e);return bt(e)?t.identifier:t.pointerId}function Fi(e){const t=Mo(e);return[t.clientX,t.clientY]}function Q5(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:i,metaKey:r,ctrlKey:o}=e;Object.assign(t,{shiftKey:n,altKey:i,metaKey:r,ctrlKey:o})}return t}function nt(e,...t){return typeof e=="function"?e(...t):e}function J5(){}function el(...e){return e.length===0?J5:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Ii(e,t){return Object.assign({},t,e||{})}const tl=32;class nl{constructor(t,n,i){this.ctrl=t,this.args=n,this.key=i,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:i,args:r}=this;n[i]=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=r,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,i=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=i.from?nt(i.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:i,shared:r}=this;n.args=this.args;let o=0;if(t&&(n.event=t,i.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,Q5(t)),r.down=r.pressed=r.buttons%2===1||r.touches>0,o=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const S=n._delta.map(Math.abs);p1.addTo(n._distance,S)}this.axisIntent&&this.axisIntent(t);const[a,s]=n._movement,[l,u]=i.threshold,{_step:d,values:f}=n;if(i.hasCustomTransform?(d[0]===!1&&(d[0]=Math.abs(a)>=l&&f[0]),d[1]===!1&&(d[1]=Math.abs(s)>=u&&f[1])):(d[0]===!1&&(d[0]=Math.abs(a)>=l&&Math.sign(a)*l),d[1]===!1&&(d[1]=Math.abs(s)>=u&&Math.sign(s)*u)),n.intentional=d[0]!==!1||d[1]!==!1,!n.intentional)return;const m=[0,0];if(i.hasCustomTransform){const[S,A]=f;m[0]=d[0]!==!1?S-d[0]:0,m[1]=d[1]!==!1?A-d[1]:0}else m[0]=d[0]!==!1?a-d[0]:0,m[1]=d[1]!==!1?s-d[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(m);const k=n.offset,p=n._active&&!n._blocked||n.active;p&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=r[this.ingKey]=n._active,t&&(n.first&&("bounds"in i&&(n._bounds=nt(i.bounds,n)),this.setup&&this.setup()),n.movement=m,this.computeOffset()));const[g,C]=n.offset,[[x,y],[b,w]]=n._bounds;n.overflow=[gy?1:0,Cw?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 E=n._active?i.rubberband||[0,0]:[0,0];if(n.offset=F5(n._bounds,n.offset,E),n.delta=p1.sub(n.offset,k),this.computeMovement(),p&&(!n.last||o>tl)){n.delta=p1.sub(n.offset,k);const S=n.delta.map(Math.abs);p1.addTo(n.distance,S),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&o>0&&(n.velocity=[S[0]/o,S[1]/o],n.timeDelta=o)}}emit(){const t=this.state,n=this.shared,i=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!i.triggerAllEvents)return;const r=this.handler(c1(c1(c1({},n),t),{},{[this.aliasKey]:t.values}));r!==void 0&&(t.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function il([e,t],n){const i=Math.abs(e),r=Math.abs(t);if(i>r&&i>n)return"x";if(r>i&&r>n)return"y"}class rl extends nl{constructor(...t){super(...t),V1(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=p1.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=p1.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,i=this.config;if(!n.axis&&t){const r=typeof i.axisThreshold=="object"?i.axisThreshold[Po(t)]:i.axisThreshold;n.axis=il(n._movement,r)}n._blocked=(i.lockDirection||!!i.axis)&&!n.axis||!!i.axis&&i.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 ol=e=>e,Hi=.15,Lo={enabled(e=!0){return e},eventOptions(e,t,n){return c1(c1({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[Hi,Hi];case!1:return[0,0];default:return p1.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return p1.toVector(e)},transform(e,t,n){const i=e||n.shared.transform;return this.hasCustomTransform=!!i,i||ol},threshold(e){return p1.toVector(e,0)}},al=0,Be=c1(c1({},Lo),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=al){return e},bounds(e={}){if(typeof e=="function")return o=>Be.bounds(e(o));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:i=-1/0,bottom:r=1/0}=e;return[[t,n],[i,r]]}}),Ni={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 sl extends rl{constructor(...t){super(...t),V1(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(),i=t.currentTarget.getBoundingClientRect(),r={left:n.left-i.left+t.offset[0],right:n.right-i.right+t.offset[0],top:n.top-i.top+t.offset[1],bottom:n.bottom-i.bottom+t.offset[1]};t._bounds=Be.bounds(r)}}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,i=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const r=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(r&&r.size>1&&i._pointerActive)&&(this.start(t),this.setupPointer(t),i._pointerId=Ot(t),i._pointerActive=!0,this.computeValues(Fi(t)),this.computeInitial(),n.preventScrollAxis&&Po(t)!=="mouse"?(i._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,i=this.config;if(!n._pointerActive)return;const r=Ot(t);if(n._pointerId!==void 0&&r!==n._pointerId)return;const o=Fi(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=p1.sub(o,n._values),this.computeValues(o)),p1.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(i.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===i.preventScrollAxis||i.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,i=this.config;if(!n._active||!n._pointerActive)return;const r=Ot(t);if(n._pointerId!==void 0&&r!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[o,a]=n._distance;if(n.tap=o<=i.tapsThreshold&&a<=i.tapsThreshold,n.tap&&i.filterTaps)n._force=!0;else{const[s,l]=n._delta,[u,d]=n._movement,[f,m]=i.swipe.velocity,[k,p]=i.swipe.distance,g=i.swipe.duration;if(n.elapsedTimef&&Math.abs(u)>k&&(n.swipe[0]=Math.sign(s)),x>m&&Math.abs(d)>p&&(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,i=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"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,ll(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=Ni[t.key];if(n){const i=this.state,r=t.shiftKey?10:t.altKey?.1:1;this.start(t),i._delta=n(this.config.keyboardDisplacement,r),i._keyboardActive=!0,p1.addTo(i._movement,i._delta),this.compute(t),this.emit()}}keyUp(t){t.key in Ni&&(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 ll(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const je=typeof window<"u"&&window.document&&window.document.createElement;function Oo(){return je&&"ontouchstart"in window}function cl(){return Oo()||je&&window.navigator.maxTouchPoints>1}function ul(){return je&&"onpointerdown"in window}function dl(){return je&&"exitPointerLock"in window.document}function fl(){try{return"constructor"in GestureEvent}catch{return!1}}const P1={isBrowser:je,gesture:fl(),touch:Oo(),touchscreen:cl(),pointer:ul(),pointerLock:dl()},hl=250,ml=180,pl=.5,xl=50,kl=250,gl=10,zi={mouse:0,touch:0,pen:8},Cl=c1(c1({},Be),{},{device(e,t,{pointer:{touch:n=!1,lock:i=!1,mouse:r=!1}={}}){return this.pointerLock=i&&P1.pointerLock,P1.touch&&n?"touch":this.pointerLock?"mouse":P1.pointer&&!r?"pointer":P1.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?hl:void 0,!(!P1.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:i=1,keys:r=!0}={}}){return this.pointerButtons=i,this.keys=r,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:i=3,axis:r=void 0}){const o=p1.toVector(e,n?i:r?1:0);return this.filterTaps=n,this.tapsThreshold=i,o},swipe({velocity:e=pl,distance:t=xl,duration:n=kl}={}){return{velocity:this.transform(p1.toVector(e)),distance:this.transform(p1.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return ml;case!1:return 0;default:return e}},axisThreshold(e){return e?c1(c1({},zi),e):zi},keyboardDisplacement(e=gl){return e}});c1(c1({},Lo),{},{device(e,t,{shared:n,pointer:{touch:i=!1}={}}){if(n.target&&!P1.touch&&P1.gesture)return"gesture";if(P1.touch&&i)return"touch";if(P1.touchscreen){if(P1.pointer)return"pointer";if(P1.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:i={}}){const r=a=>{const s=Ii(nt(n,a),{min:-1/0,max:1/0});return[s.min,s.max]},o=a=>{const s=Ii(nt(i,a),{min:-1/0,max:1/0});return[s.min,s.max]};return typeof n!="function"&&typeof i!="function"?[r(),o()]:a=>[r(a),o(a)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",p1.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});c1(c1({},Be),{},{mouseOnly:(e=!0)=>e});c1(c1({},Be),{},{mouseOnly:(e=!0)=>e});const To=new Map,an=new Map;function yl(e){To.set(e.key,e.engine),an.set(e.key,e.resolver)}const bl={key:"drag",engine:sl,resolver:Cl};function vl(e,t){if(e==null)return{};var n={},i=Object.keys(e),r,o;for(o=0;o=0)&&(n[r]=e[r]);return n}function wl(e,t){if(e==null)return{};var n=vl(e,t),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}const El={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=P1.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},Sl=["target","eventOptions","window","enabled","transform"];function Ue(e={},t){const n={};for(const[i,r]of Object.entries(t))switch(typeof r){case"function":n[i]=r.call(n,e[i],i,e);break;case"object":n[i]=Ue(e[i],r);break;case"boolean":r&&(n[i]=e[i]);break}return n}function Al(e,t,n={}){const i=e,{target:r,eventOptions:o,window:a,enabled:s,transform:l}=i,u=wl(i,Sl);if(n.shared=Ue({target:r,eventOptions:o,window:a,enabled:s,transform:l},El),t){const d=an.get(t);n[t]=Ue(c1({shared:n.shared},u),d)}else for(const d in u){const f=an.get(d);f&&(n[d]=Ue(c1({shared:n.shared},u[d]),f))}return n}class Ro{constructor(t,n){V1(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,i,r,o){const a=this._listeners,s=K5(n,i),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=c1(c1({},l),o);t.addEventListener(s,r,u);const d=()=>{t.removeEventListener(s,r,u),a.delete(d)};return a.add(d),d}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class _l{constructor(){V1(this,"_timeouts",new Map)}add(t,n,i=140,...r){this.remove(t),this._timeouts.set(t,window.setTimeout(n,i,...r))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class Vl{constructor(t){V1(this,"gestures",new Set),V1(this,"_targetEventStore",new Ro(this)),V1(this,"gestureEventStores",{}),V1(this,"gestureTimeoutStores",{}),V1(this,"handlers",{}),V1(this,"config",{}),V1(this,"pointerIds",new Set),V1(this,"touchIds",new Set),V1(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Dl(this,t)}setEventIds(t){if(bt(t))return this.touchIds=new Set(X5(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=Al(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,i={};let r;if(!(n.target&&(r=n.target(),!r))){if(n.enabled){for(const a of this.gestures){const s=this.config[a],l=Zi(i,s.eventOptions,!!r);if(s.enabled){const u=To.get(a);new u(this,t,a).bind(l)}}const o=Zi(i,n.eventOptions,!!r);for(const a in this.nativeHandlers)o(a,"",s=>this.nativeHandlers[a](c1(c1({},this.state.shared),{},{event:s,args:t})),void 0,!0)}for(const o in i)i[o]=el(...i[o]);if(!r)return i;for(const o in i){const{device:a,capture:s,passive:l}=W5(o);this._targetEventStore.add(r,a,"",i[o],{capture:s,passive:l})}}}}function T0(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Ro(e,t),e.gestureTimeoutStores[t]=new _l}function Dl(e,t){t.drag&&T0(e,"drag"),t.wheel&&T0(e,"wheel"),t.scroll&&T0(e,"scroll"),t.move&&T0(e,"move"),t.pinch&&T0(e,"pinch"),t.hover&&T0(e,"hover")}const Zi=(e,t,n)=>(i,r,o,a={},s=!1)=>{var l,u;const d=(l=a.capture)!==null&&l!==void 0?l:t.capture,f=(u=a.passive)!==null&&u!==void 0?u:t.passive;let m=s?i:Z5(i,r,d);n&&f&&(m+="Passive"),e[m]=e[m]||[],e[m].push(o)};function Bl(e,t={},n,i){const r=v.useMemo(()=>new Vl(e),[]);if(r.applyHandlers(e,i),r.applyConfig(t,n),v.useEffect(r.effect.bind(r)),v.useEffect(()=>r.clean.bind(r),[]),t.target===void 0)return r.bind.bind(r)}function jl(e,t){return yl(bl),Bl({drag:e},t||{},"drag")}function e0(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Fo(e,t=[]){let n=[];function i(o,a){const s=h.createContext(a),l=n.length;n=[...n,a];function u(f){const{scope:m,children:k,...p}=f,g=(m==null?void 0:m[e][l])||s,C=h.useMemo(()=>p,Object.values(p));return h.createElement(g.Provider,{value:C},k)}function d(f,m){const k=(m==null?void 0:m[e][l])||s,p=h.useContext(k);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const r=()=>{const o=n.map(a=>h.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return r.scopeName=e,[i,$l(r,...t)]}function $l(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(o){const a=i.reduce((s,{useScope:l,scopeName:u})=>{const f=l(o)[`__scope${u}`];return{...s,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function J0(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var i;return(i=t.current)===null||i===void 0?void 0:i.call(t,...n)},[])}function Gl(e,t=globalThis==null?void 0:globalThis.document){const n=J0(e);h.useEffect(()=>{const i=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",i),()=>t.removeEventListener("keydown",i)},[n,t])}const sn="dismissableLayer.update",Pl="dismissableLayer.pointerDownOutside",Ml="dismissableLayer.focusOutside";let Ui;const Ll=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ol=h.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=h.useContext(Ll),[f,m]=h.useState(null),k=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=h.useState({}),g=X0(t,_=>m(_)),C=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=C.indexOf(x),b=f?C.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,S=Tl(_=>{const G=_.target,B=[...d.branches].some(D=>D.contains(G));!E||B||(o==null||o(_),s==null||s(_),_.defaultPrevented||l==null||l())},k),A=Rl(_=>{const G=_.target;[...d.branches].some(D=>D.contains(G))||(a==null||a(_),s==null||s(_),_.defaultPrevented||l==null||l())},k);return Gl(_=>{b===d.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},k),h.useEffect(()=>{if(f)return i&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ui=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Wi(),()=>{i&&d.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=Ui)}},[f,k,i,d]),h.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Wi())},[f,d]),h.useEffect(()=>{const _=()=>p({});return document.addEventListener(sn,_),()=>document.removeEventListener(sn,_)},[]),h.createElement(j0.div,F({},u,{ref:g,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:e0(e.onFocusCapture,A.onFocusCapture),onBlurCapture:e0(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:e0(e.onPointerDownCapture,S.onPointerDownCapture)}))});function Tl(e,t=globalThis==null?void 0:globalThis.document){const n=J0(e),i=h.useRef(!1),r=h.useRef(()=>{});return h.useEffect(()=>{const o=s=>{if(s.target&&!i.current){let u=function(){Io(Pl,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=u,t.addEventListener("click",r.current,{once:!0})):u()}else t.removeEventListener("click",r.current);i.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>i.current=!0}}function Rl(e,t=globalThis==null?void 0:globalThis.document){const n=J0(e),i=h.useRef(!1);return h.useEffect(()=>{const r=o=>{o.target&&!i.current&&Io(Ml,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Wi(){const e=new CustomEvent(sn);document.dispatchEvent(e)}function Io(e,t,n,{discrete:i}){const r=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),i?r5(r,o):r.dispatchEvent(o)}const U0=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Fl=Vs["useId".toString()]||(()=>{});let Il=0;function Hl(e){const[t,n]=h.useState(Fl());return U0(()=>{e||n(i=>i??String(Il++))},[e]),e||(t?`radix-${t}`:"")}const Nl=h.forwardRef((e,t)=>{const{children:n,width:i=10,height:r=5,...o}=e;return h.createElement(j0.svg,F({},o,{ref:t,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:h.createElement("polygon",{points:"0,0 30,0 15,10"}))}),zl=Nl;function Zl(e){const[t,n]=h.useState(void 0);return U0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const o=r[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}const Ho="Popper",[No,zo]=Fo(Ho),[Ul,Zo]=No(Ho),Wl=e=>{const{__scopePopper:t,children:n}=e,[i,r]=h.useState(null);return h.createElement(Ul,{scope:t,anchor:i,onAnchorChange:r},n)},Kl="PopperAnchor",ql=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:i,...r}=e,o=Zo(Kl,n),a=h.useRef(null),s=X0(t,a);return h.useEffect(()=>{o.onAnchorChange((i==null?void 0:i.current)||a.current)}),i?null:h.createElement(j0.div,F({},r,{ref:s}))}),Uo="PopperContent",[Yl,Xl]=No(Uo),Ql=h.forwardRef((e,t)=>{var n,i,r,o,a,s,l,u;const{__scopePopper:d,side:f="bottom",sideOffset:m=0,align:k="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:C=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:w=!1,updatePositionStrategy:E="optimized",onPlaced:S,...A}=e,_=Zo(Uo,d),[G,B]=h.useState(null),D=X0(t,a1=>B(a1)),[V,R]=h.useState(null),P=Zl(V),$=(n=P==null?void 0:P.width)!==null&&n!==void 0?n:0,j=(i=P==null?void 0:P.height)!==null&&i!==void 0?i:0,L=f+(k!=="center"?"-"+k:""),Z=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},U=Array.isArray(x)?x:[x],J=U.length>0,W={padding:Z,boundary:U.filter(n4),altBoundary:J},{refs:M,floatingStyles:Q,placement:e1,isPositioned:X,middlewareData:d1}=E3({strategy:"fixed",placement:L,whileElementsMounted:(...a1)=>b3(...a1,{animationFrame:E==="always"}),elements:{reference:_.anchor},middleware:[e3({mainAxis:m+j,alignmentAxis:p}),C&&t3({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?n3():void 0,...W}),C&&X2({...W}),i3({...W,apply:({elements:a1,rects:Z1,availableWidth:U1,availableHeight:W1})=>{const{width:G0,height:C0}=Z1.reference,K1=a1.floating.style;K1.setProperty("--radix-popper-available-width",`${U1}px`),K1.setProperty("--radix-popper-available-height",`${W1}px`),K1.setProperty("--radix-popper-anchor-width",`${G0}px`),K1.setProperty("--radix-popper-anchor-height",`${C0}px`)}}),V&&w3({element:V,padding:g}),i4({arrowWidth:$,arrowHeight:j}),w&&Q2({strategy:"referenceHidden",...W})]}),[S1,A1]=Wo(e1),j1=J0(S);U0(()=>{X&&(j1==null||j1())},[X,j1]);const R1=(r=d1.arrow)===null||r===void 0?void 0:r.x,d0=(o=d1.arrow)===null||o===void 0?void 0:o.y,f0=((a=d1.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Y,r1]=h.useState();return U0(()=>{G&&r1(window.getComputedStyle(G).zIndex)},[G]),h.createElement("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:X?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(s=d1.transformOrigin)===null||s===void 0?void 0:s.x,(l=d1.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},h.createElement(Yl,{scope:d,placedSide:S1,onArrowChange:R,arrowX:R1,arrowY:d0,shouldHideArrow:f0},h.createElement(j0.div,F({"data-side":S1,"data-align":A1},A,{ref:D,style:{...A.style,animation:X?void 0:"none",opacity:(u=d1.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))}),Jl="PopperArrow",e4={top:"bottom",right:"left",bottom:"top",left:"right"},t4=h.forwardRef(function(t,n){const{__scopePopper:i,...r}=t,o=Xl(Jl,i),a=e4[o.placedSide];return h.createElement("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0}},h.createElement(zl,F({},r,{ref:n,style:{...r.style,display:"block"}})))});function n4(e){return e!==null}const i4=e=>({name:"transformOrigin",options:e,fn(t){var n,i,r,o,a;const{placement:s,rects:l,middlewareData:u}=t,f=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=f?0:e.arrowWidth,k=f?0:e.arrowHeight,[p,g]=Wo(s),C={start:"0%",center:"50%",end:"100%"}[g],x=((i=(r=u.arrow)===null||r===void 0?void 0:r.x)!==null&&i!==void 0?i:0)+m/2,y=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+k/2;let b="",w="";return p==="bottom"?(b=f?C:`${x}px`,w=`${-k}px`):p==="top"?(b=f?C:`${x}px`,w=`${l.floating.height+k}px`):p==="right"?(b=`${-k}px`,w=f?C:`${y}px`):p==="left"&&(b=`${l.floating.width+k}px`,w=f?C:`${y}px`),{data:{x:b,y:w}}}});function Wo(e){const[t,n="center"]=e.split("-");return[t,n]}const r4=Wl,o4=ql,a4=Ql,s4=t4;function l4(e,t){return h.useReducer((n,i)=>{const r=t[n][i];return r??n},e)}const Ko=e=>{const{present:t,children:n}=e,i=c4(t),r=typeof n=="function"?n({present:i.isPresent}):h.Children.only(n),o=X0(i.ref,r.ref);return typeof n=="function"||i.isPresent?h.cloneElement(r,{ref:o}):null};Ko.displayName="Presence";function c4(e){const[t,n]=h.useState(),i=h.useRef({}),r=h.useRef(e),o=h.useRef("none"),a=e?"mounted":"unmounted",[s,l]=l4(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Fe(i.current);o.current=s==="mounted"?u:"none"},[s]),U0(()=>{const u=i.current,d=r.current;if(d!==e){const m=o.current,k=Fe(u);e?l("MOUNT"):k==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==k?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),U0(()=>{if(t){const u=f=>{const k=Fe(i.current).includes(f.animationName);f.target===t&&k&&pt.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=Fe(i.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:h.useCallback(u=>{u&&(i.current=getComputedStyle(u)),n(u)},[])}}function Fe(e){return(e==null?void 0:e.animationName)||"none"}function u4({prop:e,defaultProp:t,onChange:n=()=>{}}){const[i,r]=d4({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:i,s=J0(n),l=h.useCallback(u=>{if(o){const f=typeof u=="function"?u(e):u;f!==e&&s(f)}else r(u)},[o,e,r,s]);return[a,l]}function d4({defaultProp:e,onChange:t}){const n=h.useState(e),[i]=n,r=h.useRef(i),o=J0(t);return h.useEffect(()=>{r.current!==i&&(o(i),r.current=i)},[i,r,o]),n}const f4=h.forwardRef((e,t)=>h.createElement(j0.span,F({},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}}))),h4=f4,[vt,Qm]=Fo("Tooltip",[zo]),wt=zo(),m4="TooltipProvider",ln="tooltip.open",[Jm,On]=vt(m4),Tn="Tooltip",[p4,Et]=vt(Tn),x4=e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r=!1,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,l=On(Tn,e.__scopeTooltip),u=wt(t),[d,f]=h.useState(null),m=Hl(),k=h.useRef(0),p=a??l.disableHoverableContent,g=s??l.delayDuration,C=h.useRef(!1),[x=!1,y]=u4({prop:i,defaultProp:r,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(ln))):l.onClose(),o==null||o(A)}}),b=h.useMemo(()=>x?C.current?"delayed-open":"instant-open":"closed",[x]),w=h.useCallback(()=>{window.clearTimeout(k.current),C.current=!1,y(!0)},[y]),E=h.useCallback(()=>{window.clearTimeout(k.current),y(!1)},[y]),S=h.useCallback(()=>{window.clearTimeout(k.current),k.current=window.setTimeout(()=>{C.current=!0,y(!0)},g)},[g,y]);return h.useEffect(()=>()=>window.clearTimeout(k.current),[]),h.createElement(r4,u,h.createElement(p4,{scope:t,contentId:m,open:x,stateAttribute:b,trigger:d,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{l.isOpenDelayed?S():w()},[l.isOpenDelayed,S,w]),onTriggerLeave:h.useCallback(()=>{p?E():window.clearTimeout(k.current)},[E,p]),onOpen:w,onClose:E,disableHoverableContent:p},n))},Ki="TooltipTrigger",k4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,r=Et(Ki,n),o=On(Ki,n),a=wt(n),s=h.useRef(null),l=X0(t,s,r.onTriggerChange),u=h.useRef(!1),d=h.useRef(!1),f=h.useCallback(()=>u.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),h.createElement(o4,F({asChild:!0},a),h.createElement(j0.button,F({"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute},i,{ref:l,onPointerMove:e0(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(r.onTriggerEnter(),d.current=!0)}),onPointerLeave:e0(e.onPointerLeave,()=>{r.onTriggerLeave(),d.current=!1}),onPointerDown:e0(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:e0(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:e0(e.onBlur,r.onClose),onClick:e0(e.onClick,r.onClose)})))}),g4="TooltipPortal",[ep,C4]=vt(g4,{forceMount:void 0}),ve="TooltipContent",y4=h.forwardRef((e,t)=>{const n=C4(ve,e.__scopeTooltip),{forceMount:i=n.forceMount,side:r="top",...o}=e,a=Et(ve,e.__scopeTooltip);return h.createElement(Ko,{present:i||a.open},a.disableHoverableContent?h.createElement(qo,F({side:r},o,{ref:t})):h.createElement(b4,F({side:r},o,{ref:t})))}),b4=h.forwardRef((e,t)=>{const n=Et(ve,e.__scopeTooltip),i=On(ve,e.__scopeTooltip),r=h.useRef(null),o=X0(t,r),[a,s]=h.useState(null),{trigger:l,onClose:u}=n,d=r.current,{onPointerInTransitChange:f}=i,m=h.useCallback(()=>{s(null),f(!1)},[f]),k=h.useCallback((p,g)=>{const C=p.currentTarget,x={x:p.clientX,y:p.clientY},y=A4(x,C.getBoundingClientRect()),b=_4(x,y),w=V4(g.getBoundingClientRect()),E=B4([...b,...w]);s(E),f(!0)},[f]);return h.useEffect(()=>()=>m(),[m]),h.useEffect(()=>{if(l&&d){const p=C=>k(C,d),g=C=>k(C,l);return l.addEventListener("pointerleave",p),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",p),d.removeEventListener("pointerleave",g)}}},[l,d,k,m]),h.useEffect(()=>{if(a){const p=g=>{const C=g.target,x={x:g.clientX,y:g.clientY},y=(l==null?void 0:l.contains(C))||(d==null?void 0:d.contains(C)),b=!D4(x,a);y?m():b&&(m(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,d,a,u,m]),h.createElement(qo,F({},e,{ref:o}))}),[v4,w4]=vt(Tn,{isInside:!1}),qo=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:i,"aria-label":r,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=Et(ve,n),u=wt(n),{onClose:d}=l;return h.useEffect(()=>(document.addEventListener(ln,d),()=>document.removeEventListener(ln,d)),[d]),h.useEffect(()=>{if(l.trigger){const f=m=>{const k=m.target;k!=null&&k.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),h.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d},h.createElement(a4,F({"data-state":l.stateAttribute},u,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)"}}),h.createElement(Ao,null,i),h.createElement(v4,{scope:n,isInside:!0},h.createElement(h4,{id:l.contentId,role:"tooltip"},r||i))))}),E4="TooltipArrow",S4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,r=wt(n);return w4(E4,n).isInside?null:h.createElement(s4,F({},r,i,{ref:t}))});function A4(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,i,r,o)){case o:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function _4(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function V4(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function D4(e,t){const{x:n,y:i}=e;let r=!1;for(let o=0,a=t.length-1;oi!=d>i&&n<(u-s)*(i-l)/(d-l)+s&&(r=!r)}return r}function B4(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),j4(t)}function j4(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(r.y-a.y)>=(o.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(r.y-a.y)>=(o.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}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 $4=x4,G4=k4,P4=y4,M4=S4;function L4(e,t){if(e==null)return{};var n={},i=Object.keys(e),r,o;for(o=0;o=0)&&(n[r]=e[r]);return n}function n1(e,t){if(e==null)return{};var n=L4(e,t),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}let l1;(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"})(l1||(l1={}));const O4={[l1.UNSUPPORTED_INPUT]:(e,t)=>[`An input with type \`${e}\` input was found at path \`${t}\` but it's not supported yet.`],[l1.NO_COMPONENT_FOR_TYPE]:(e,t)=>[`Type \`${e}\` found at path \`${t}\` can't be displayed in panel because no component supports it yet.`],[l1.UNKNOWN_INPUT]:(e,t)=>[`input at path \`${e}\` is not recognized.`,t],[l1.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.`],[l1.ALREADY_REGISTERED_TYPE]:e=>[`Type ${e} has already been registered. You can't register a component with the same type.`],[l1.CLIPBOARD_ERROR]:e=>["Error copying the value",e],[l1.THEME_ERROR]:(e,t)=>[`Error accessing the theme \`${e}.${t}\` value.`],[l1.PATH_DOESNT_EXIST]:e=>[`Error getting the value at path \`${e}\`. There is probably an error in your \`render\` function.`],[l1.PATH_DOESNT_EXIST]:e=>[`Error accessing the value at path \`${e}\``],[l1.INPUT_TYPE_OVERRIDE]:(e,t,n)=>[`Input at path \`${e}\` already exists with type: \`${t}\`. Its type cannot be overridden with type \`${n}\`.`],[l1.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function Yo(e,t,...n){const[i,...r]=O4[t](...n);console[e]("LEVA: "+i,...r)}const t0=Yo.bind(null,"warn"),T4=Yo.bind(null,"log"),R4=["value"],F4=["schema"],I4=["value"],Xo=[],_0={};function qi(e){let{value:t}=e,n=n1(e,R4);for(let i of Xo){const r=i(t,n);if(r)return r}}function u0(e,t){let{schema:n}=t,i=n1(t,F4);if(e in _0){t0(l1.ALREADY_REGISTERED_TYPE,e);return}Xo.push((r,o)=>n(r,o)&&e),_0[e]=i}function Tt(e,t,n,i){const{normalize:r}=_0[e];if(r)return r(t,n,i);if(typeof t!="object"||!("value"in t))return{value:t};const{value:o}=t,a=n1(t,I4);return{value:o,settings:a}}function H4(e,t,n,i,r,o){const{sanitize:a}=_0[e];return a?a(t,n,i,r,o):t}function Yi(e,t,n){const{format:i}=_0[e];return i?i(t,n):t}function N4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function z(e){for(var t=1;te>n?n:e{if(e===""||typeof e=="number")return e;try{const t=h0(e);if(!isNaN(t))return t}catch{}return parseFloat(e)},Z4=Math.log(10);function Qi(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)/Z4)+1,i=Math.floor(Math.log10(Math.abs(e))),r=Math.pow(10,i-n);return Math.max(r,.001)}const it=(e,t,n)=>n===t?0:(k0(e,t,n)-t)/(n-t),rt=(e,t,n)=>e*(n-t)+t,U4=()=>"_"+Math.random().toString(36).substr(2,9),Ji=/\(([0-9+\-*/^ .]+)\)/,er=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,tr=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,nr=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,ir=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,rr=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function h0(e){if(isNaN(Number(e)))if(Ji.test(e)){const t=e.replace(Ji,(n,i)=>String(h0(i)));return h0(t)}else if(er.test(e)){const t=e.replace(er,(n,i,r)=>String(Math.pow(Number(i),Number(r))));return h0(t)}else if(tr.test(e)){const t=e.replace(tr,(n,i,r)=>String(Number(i)*Number(r)));return h0(t)}else if(nr.test(e)){const t=e.replace(nr,(n,i,r)=>{if(r!=0)return String(Number(i)/Number(r));throw new Error("Division by zero")});return h0(t)}else if(ir.test(e)){const t=e.replace(ir,(n,i,r)=>String(Number(i)+Number(r)));return h0(t)}else if(rr.test(e)){const t=e.replace(rr,(n,i,r)=>String(Number(i)-Number(r)));return h0(t)}else return Number(e);return Number(e)}function W4(e,t){return t.reduce((n,i)=>(e&&e.hasOwnProperty(i)&&(n[i]=e[i]),n),{})}function K4(e,t){const n=z({},e);return t.forEach(i=>i in e&&delete n[i]),n}function q4(e,t){return e.reduce((n,i,r)=>Object.assign(n,{[t[r]]:i}),{})}function Qo(e){return Object.prototype.toString.call(e)==="[object Object]"}const Y4=e=>Qo(e)&&Object.keys(e).length===0;let H1;(function(e){e.BUTTON="BUTTON",e.BUTTON_GROUP="BUTTON_GROUP",e.MONITOR="MONITOR",e.FOLDER="FOLDER"})(H1||(H1={}));let N1;(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"})(N1||(N1={}));const X4=["type","__customInput"],Q4=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],J4=["type"];function Jo(e,t,n={},i){var r,o;if(typeof e!="object"||Array.isArray(e))return{type:i,input:e,options:z({key:t,label:t,optional:!1,disabled:!1,order:0},n)};if("__customInput"in e){const{type:E,__customInput:S}=e,A=n1(e,X4);return Jo(S,t,A,E)}const{render:a,label:s,optional:l,order:u=0,disabled:d,hint:f,onChange:m,onEditStart:k,onEditEnd:p,transient:g}=e,C=n1(e,Q4),x=z({render:a,key:t,label:s??t,hint:f,transient:g??!!m,onEditStart:k,onEditEnd:p,disabled:d,optional:l,order:u},n);let{type:y}=C,b=n1(C,J4);if(y=i??y,y in H1)return{type:y,input:b,options:x};let w;return i&&Qo(b)&&"value"in b?w=b.value:w=Y4(b)?void 0:b,{type:y,input:w,options:z(z({},x),{},{onChange:m,optional:(r=x.optional)!==null&&r!==void 0?r:!1,disabled:(o=x.disabled)!==null&&o!==void 0?o:!1})}}function e6(e,t,n,i){const r=Jo(e,t),{type:o,input:a,options:s}=r;if(o)return o in H1?r:{type:o,input:Tt(o,a,n,i),options:s};let l=qi(a);return l?{type:l,input:Tt(l,a,n,i),options:s}:(l=qi({value:a}),l?{type:l,input:Tt(l,{value:a},n,i),options:s}:!1)}function or(e,t,n,i,r){const{value:o,type:a,settings:s}=e;e.value=ea({type:a,value:o,settings:s},t,n,i),e.fromPanel=r}const t6=function(t,n,i){this.type="LEVA_ERROR",this.message="LEVA: "+t,this.previousValue=n,this.error=i};function ea({type:e,value:t,settings:n},i,r,o){const a=e!=="SELECT"&&typeof i=="function"?i(t):i;let s;try{s=H4(e,a,n,t,r,o)}catch(l){throw new t6(`The value \`${i}\` did not result in a correct value.`,t,l)}return ye(s,t)?t:s}const ta=(e,t,n=!1)=>{let i=0;return function(){const r=arguments,o=n&&!i,a=()=>e.apply(this,r);window.clearTimeout(i),i=window.setTimeout(a,t),o&&a()}},na=e=>e.shiftKey?5:e.altKey?1/5:1;function n6(e,t){const n=console.error;console.error=()=>{},F0.render(e,t),console.error=n}const i6=["value"],r6=["min","max"],o6=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},ia=(e,{min:t=-1/0,max:n=1/0,suffix:i})=>{const r=parseFloat(e);if(e===""||isNaN(r))throw Error("Invalid number");const o=k0(r,t,n);return i?o+i:o},a6=(e,{pad:t=0,suffix:n})=>{const i=parseFloat(e).toFixed(t);return n?i+n:i},ra=e=>{let{value:t}=e,n=n1(e,i6);const{min:i=-1/0,max:r=1/0}=n,o=n1(n,r6);let a=parseFloat(t);const s=typeof t=="string"?t.substring((""+a).length):void 0;a=k0(a,i,r);let l=n.step;l||(Number.isFinite(i)?Number.isFinite(r)?l=+(Math.abs(r-i)/100).toPrecision(1):l=+(Math.abs(a-i)/100).toPrecision(1):Number.isFinite(r)&&(l=+(Math.abs(r-a)/100).toPrecision(1)));const u=l?Qi(l)*10:Qi(a);l=l||u/10;const d=Math.round(k0(Math.log10(1/u),0,2));return{value:s?a+s:a,settings:z({initialValue:a,step:l,pad:d,min:i,max:r,suffix:s},o)}},oa=(e,{step:t,initialValue:n})=>{const i=Math.round((e-n)/t);return n+i*t};var aa=Object.freeze({__proto__:null,schema:o6,sanitize:ia,format:a6,normalize:ra,sanitizeStep:oa});function u1(){return u1=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 Ie(e,t){const[n,i]=e.split(" "),r={};return n!=="none"&&(r.boxShadow=`${t.inset?"inset ":""}0 0 0 $borderWidths${[t.key]} $colors${n!=="default"&&n||t.borderColor}`),i&&(r.backgroundColor=i),r}const oe={$inputStyle:()=>e=>Ie(e,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>e=>Ie(e,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>e=>Ie(e,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>e=>Ie(e,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:H,css:tp,createTheme:l6,globalCss:c6,keyframes:np}=$o({prefix:"leva",theme:ua(),utils:z(z({},oe),{},{$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":oe.$focusStyle()(e)}),$focusWithin:e=>({"&:focus-within":oe.$focusStyle()(e)}),$hover:e=>({"&:hover":oe.$hoverStyle()(e)}),$active:e=>({"&:active":oe.$activeStyle()(e)})})}),u6=c6({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function d6(e){const t=ua();if(!e)return{theme:t,className:""};Object.keys(e).forEach(i=>{Object.assign(t[i],e[i])});const n=l6(t);return{theme:t,className:n.className}}function n0(e,t){const{theme:n}=h.useContext(Rn);if(!(e in n)||!(t in n[e]))return t0(l1.THEME_ERROR,e,t),"";let i=t;for(;;){let r=n[e][i];if(typeof r=="string"&&r.charAt(0)==="$")i=r.substr(1);else return r}}const da=H("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),fa=H("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${da}`]:{paddingLeft:0}}),f6=H(fa,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),h6=H("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),m6=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],p6=["onUpdate"];function Fn(e){let{innerLabel:t,value:n,onUpdate:i,onChange:r,onKeyDown:o,type:a,id:s,inputType:l="text",rows:u=0}=e,d=n1(e,m6);const{id:f,emitOnEditStart:m,emitOnEditEnd:k,disabled:p}=x1(),g=s||f,C=h.useRef(null),x=u>0,y=x?"textarea":"input",b=h.useCallback(S=>A=>{const _=A.currentTarget.value;S(_)},[]);v.useEffect(()=>{const S=C.current,A=b(_=>{i(_),k()});return S==null||S.addEventListener("blur",A),()=>S==null?void 0:S.removeEventListener("blur",A)},[b,i,k]);const w=h.useCallback(S=>{S.key==="Enter"&&b(i)(S)},[b,i]),E=Object.assign({as:y},x?{rows:u}:{},d);return v.createElement(h6,{textArea:x},t&&typeof t=="string"?v.createElement(fa,null,t):t,v.createElement(da,u1({levaType:a,ref:C,id:g,type:l,autoComplete:"off",spellCheck:"false",value:n,onChange:b(r),onFocus:()=>m(),onKeyPress:w,onKeyDown:o,disabled:p},E)))}function x6(e){let{onUpdate:t}=e,n=n1(e,p6);const i=h.useCallback(o=>t(z4(o)),[t]),r=h.useCallback(o=>{const a=o.key==="ArrowUp"?1:o.key==="ArrowDown"?-1:0;if(a){o.preventDefault();const s=o.altKey?.1:o.shiftKey?10:1;t(l=>parseFloat(l)+a*s)}},[t]);return v.createElement(Fn,u1({},n,{onUpdate:i,onKeyDown:r,type:"number"}))}const ot=H("div",{}),cn=H("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"}}]}),k6=H("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 + ${cn}::after`]:{opacity:.6},[`${ot}:hover > & + ${cn}::after`]:{opacity:.6},[`${ot}:hover > & > svg`]:{opacity:1}}),ha=H("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"},[`> ${ot}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),ma=H("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${ha} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),pa=H(ma,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),g6=H("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"}}}}),C6=H("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"}}),un=H("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),y6=H("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${un}`]:{pointerEvents:"auto"}}}}}),xa=H("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),b6=H("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),v6=H(M4,{fill:"$toolTipBackground"});function In({children:e}){const{className:t}=h.useContext(Rn);return v.createElement(a5,{className:t},e)}const w6=["align"];function E6(){const{id:e,disable:t,disabled:n}=x1();return v.createElement(v.Fragment,null,v.createElement(C6,{id:e+"__disable",type:"checkbox",checked:!n,onChange:()=>t(!n)}),v.createElement("label",{htmlFor:e+"__disable"}))}function S6(e){const{id:t,optional:n,hint:i}=x1(),r=e.htmlFor||(t?{htmlFor:t}:null),o=!i&&typeof e.children=="string"?{title:e.children}:null;return v.createElement(v.Fragment,null,n&&v.createElement(E6,null),i!==void 0?v.createElement($4,null,v.createElement(G4,{asChild:!0},v.createElement(un,u1({},r,e))),v.createElement(P4,{side:"top",sideOffset:2},v.createElement(b6,null,i,v.createElement(v6,null)))):v.createElement(un,u1({},r,o,e)))}function z1(e){let{align:t}=e,n=n1(e,w6);const{value:i,label:r,key:o,disabled:a}=x1(),{hideCopyButton:s}=s6(),l=!s&&o!==void 0,[u,d]=h.useState(!1),f=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[o]:i??""})),d(!0)}catch{t0(l1.CLIPBOARD_ERROR,{[o]:i})}};return v.createElement(g6,{align:t,onPointerLeave:()=>d(!1)},v.createElement(S6,n),l&&!a&&v.createElement("div",{title:`Click to copy ${typeof r=="string"?r:o} value`},u?v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},v.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),v.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"})):v.createElement("svg",{onClick:f,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},v.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),v.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 A6=["toggled"],_6=H("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function Hn(e){let{toggled:t}=e,n=n1(e,A6);return v.createElement(_6,u1({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${t?0:-90}deg)`}},n),v.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 V6=["input"];function T1(e){let{input:t}=e,n=n1(e,V6);return t?v.createElement(pa,n):v.createElement(ma,n)}function ka({value:e,type:t,settings:n,setValue:i}){const[r,o]=h.useState(Yi(t,e,n)),a=h.useRef(e),s=h.useRef(n);s.current=n;const l=h.useCallback(d=>o(Yi(t,d,s.current)),[t]),u=h.useCallback(d=>{try{i(d)}catch(f){const{type:m,previousValue:k}=f;if(m!=="LEVA_ERROR")throw f;l(k)}},[l,i]);return h.useEffect(()=>{ye(e,a.current)||l(e),a.current=e},[e,l]),{displayValue:r,onChange:o,onUpdate:u}}function Ge(e,t){const{emitOnEditStart:n,emitOnEditEnd:i}=x1();return jl(r=>{r.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const o=e(r);return r.last&&(document.body.classList.remove("leva__panel__dragged"),i==null||i()),o},t)}function D6(e){const t=h.useRef(null),n=h.useRef(null),i=h.useRef(!1);return h.useEffect(()=>{const r=ta(()=>{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",r),i.current||(r(),i.current=!0),()=>window.removeEventListener("resize",r)},[e]),h.useEffect(()=>{n.current=t.current.getContext("2d")},[]),[t,n]}function ga(){const e=h.useRef(null),t=h.useRef({x:0,y:0}),n=h.useCallback(i=>{Object.assign(t.current,i),e.current&&(e.current.style.transform=`translate3d(${t.current.x}px, ${t.current.y}px, 0)`)},[]);return[e,n]}const B6=["__refCount"],Rt=(e,t)=>{if(!e[t])return null;const n=e[t];return n1(n,B6)};function j6(e){const t=$e(),[n,i]=h.useState(Rt(t.getData(),e)),r=h.useCallback(u=>t.setValueAtPath(e,u,!0),[e,t]),o=h.useCallback(u=>t.setSettingsAtPath(e,u),[e,t]),a=h.useCallback(u=>t.disableInputAtPath(e,u),[e,t]),s=h.useCallback(()=>t.emitOnEditStart(e),[e,t]),l=h.useCallback(()=>t.emitOnEditEnd(e),[e,t]);return h.useEffect(()=>{i(Rt(t.getData(),e));const u=t.useStore.subscribe(d=>Rt(d.data,e),i,{equalityFn:De});return()=>u()},[t,e]),[n,{set:r,setSettings:o,disable:a,storeId:t.storeId,emitOnEditStart:s,emitOnEditEnd:l}]}const $6=H("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),Ca=H("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),dn=H("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)))"}}}}),ya=H("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),ba=H("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function G6({value:e,min:t,max:n,onDrag:i,step:r,initialValue:o}){const a=h.useRef(null),s=h.useRef(null),l=h.useRef(0),u=n0("sizes","scrubberWidth"),d=Ge(({event:m,first:k,xy:[p],movement:[g],memo:C})=>{if(k){const{width:y,left:b}=a.current.getBoundingClientRect();l.current=y-parseFloat(u),C=(m==null?void 0:m.target)===s.current?e:rt((p-b)/y,t,n)}const x=C+rt(g/l.current,0,n-t);return i(oa(x,{step:r,initialValue:o})),C}),f=it(e,t,n);return v.createElement(ya,u1({ref:a},d()),v.createElement(Ca,null,v.createElement(ba,{style:{left:0,right:`${(1-f)*100}%`}})),v.createElement(dn,{ref:s,style:{left:`calc(${f} * (100% - ${u}))`}}))}const P6=v.memo(({label:e,onUpdate:t,step:n,innerLabelTrim:i})=>{const[r,o]=h.useState(!1),a=Ge(({active:s,delta:[l],event:u,memo:d=0})=>(o(s),d+=l/2,Math.abs(d)>=1&&(t(f=>parseFloat(f)+Math.floor(d)*n*na(u)),d=0),d));return v.createElement(f6,u1({dragging:r,title:e.length>1?e:""},a()),e.slice(0,i))});function va({label:e,id:t,displayValue:n,onUpdate:i,onChange:r,settings:o,innerLabelTrim:a=1}){const s=a>0&&v.createElement(P6,{label:e,step:o.step,onUpdate:i,innerLabelTrim:a});return v.createElement(x6,{id:t,value:String(n),onUpdate:i,onChange:r,innerLabel:s})}function M6(){const e=x1(),{label:t,value:n,onUpdate:i,settings:r,id:o}=e,{min:a,max:s}=r,l=s!==1/0&&a!==-1/0;return v.createElement(T1,{input:!0},v.createElement(z1,null,t),v.createElement($6,{hasRange:l},l&&v.createElement(G6,u1({value:parseFloat(n),onDrag:i},r)),v.createElement(va,u1({},e,{id:o,label:"value",innerLabelTrim:l?0:1}))))}const{sanitizeStep:L6}=aa,O6=n1(aa,["sanitizeStep"]);var T6=z({component:M6},O6);const R6=(e,t)=>D1().schema({options:D1().passesAnyOf(D1().object(),D1().array())}).test(t),F6=(e,{values:t})=>{if(t.indexOf(e)<0)throw Error("Selected value doesn't match Select options");return e},I6=(e,{values:t})=>t.indexOf(e),H6=e=>{let{value:t,options:n}=e,i,r;return Array.isArray(n)?(r=n,i=n.map(o=>String(o))):(r=Object.values(n),i=Object.keys(n)),"value"in e?r.includes(t)||(i.unshift(String(t)),r.unshift(t)):t=r[0],Object.values(n).includes(t)||(n[String(t)]=t),{value:t,settings:{keys:i,values:r}}};var N6=Object.freeze({__proto__:null,schema:R6,sanitize:F6,format:I6,normalize:H6});const z6=H("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),fn=H("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),Z6=H("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${fn}:focus + &`]:{$focusStyle:""},[`${fn}:hover + &`]:{$hoverStyle:""}});function U6({displayValue:e,value:t,onUpdate:n,id:i,settings:r,disabled:o}){const{keys:a,values:s}=r,l=h.useRef();return t===s[e]&&(l.current=a[e]),v.createElement(z6,null,v.createElement(fn,{id:i,value:e,onChange:u=>n(s[Number(u.currentTarget.value)]),disabled:o},a.map((u,d)=>v.createElement("option",{key:u,value:d},u))),v.createElement(Z6,null,l.current),v.createElement(Hn,{toggled:!0}))}function W6(){const{label:e,value:t,displayValue:n,onUpdate:i,id:r,disabled:o,settings:a}=x1();return v.createElement(T1,{input:!0},v.createElement(z1,null,e),v.createElement(U6,{id:r,value:t,displayValue:n,onUpdate:i,settings:a,disabled:o}))}var K6=z({component:W6},N6);const q6=e=>D1().string().test(e),Y6=e=>{if(typeof e!="string")throw Error("Invalid string");return e},X6=({value:e,editable:t=!0,rows:n=!1})=>({value:e,settings:{editable:t,rows:typeof n=="number"?n:n?5:0}});var Q6=Object.freeze({__proto__:null,schema:q6,sanitize:Y6,normalize:X6});const J6=["displayValue","onUpdate","onChange","editable"],e8=H("div",{whiteSpace:"pre-wrap"});function t8(e){let{displayValue:t,onUpdate:n,onChange:i,editable:r=!0}=e,o=n1(e,J6);return r?v.createElement(Fn,u1({value:t,onUpdate:n,onChange:i},o)):v.createElement(e8,null,t)}function n8(){const{label:e,settings:t,displayValue:n,onUpdate:i,onChange:r}=x1();return v.createElement(T1,{input:!0},v.createElement(z1,null,e),v.createElement(t8,u1({displayValue:n,onUpdate:i,onChange:r},t)))}var i8=z({component:n8},Q6);const r8=e=>D1().boolean().test(e),o8=e=>{if(typeof e!="boolean")throw Error("Invalid boolean");return e};var a8=Object.freeze({__proto__:null,schema:r8,sanitize:o8});const s8=H("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 l8({value:e,onUpdate:t,id:n,disabled:i}){return v.createElement(s8,null,v.createElement("input",{id:n,type:"checkbox",checked:e,onChange:r=>t(r.currentTarget.checked),disabled:i}),v.createElement("label",{htmlFor:n},v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},v.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function c8(){const{label:e,value:t,onUpdate:n,disabled:i,id:r}=x1();return v.createElement(T1,{input:!0},v.createElement(z1,null,e),v.createElement(l8,{value:t,onUpdate:n,id:r,disabled:i}))}var u8=z({component:c8},a8);const d8=["locked"];function f8({value:e,id:t,valueKey:n,settings:i,onUpdate:r,innerLabelTrim:o}){const a=h.useRef(e[n]);a.current=e[n];const s=h.useCallback(u=>r({[n]:ea({type:"NUMBER",value:a.current,settings:i},u)}),[r,i,n]),l=ka({type:"NUMBER",value:e[n],settings:i,setValue:s});return v.createElement(va,{id:t,label:n,value:e[n],displayValue:l.displayValue,onUpdate:l.onUpdate,onChange:l.onChange,settings:i,innerLabelTrim:o})}const h8=H("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function m8(e){let{locked:t}=e,n=n1(e,d8);return v.createElement("svg",u1({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),t?v.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"}):v.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 Nn({value:e,onUpdate:t,settings:n,innerLabelTrim:i}){const{id:r,setSettings:o}=x1(),{lock:a,locked:s}=n;return v.createElement(h8,{withLock:a},a&&v.createElement(m8,{locked:s,onClick:()=>o({locked:!s})}),Object.keys(e).map((l,u)=>v.createElement(f8,{id:u===0?r:`${r}.${l}`,key:l,valueKey:l,value:e,settings:n[l],onUpdate:t,innerLabelTrim:i})))}const wa=(e,t)=>{const n={};let i=0,r=1/0;Object.entries(e).forEach(([o,a])=>{n[o]=ra(z({value:a},t[o])).settings,i=Math.max(i,n[o].step),r=Math.min(r,n[o].pad)});for(let o in n){const{step:a,min:s,max:l}=t[o]||{};!isFinite(a)&&(!isFinite(s)||!isFinite(l))&&(n[o].step=i,n[o].pad=r)}return n},p8=["lock"],x8=["value"];function k8(e){const t=D1().array().length(e).every.number(),n=i=>{if(!i||typeof i!="object")return!1;const r=Object.values(i);return r.length===e&&r.every(o=>isFinite(o))};return i=>t.test(i)||n(i)}function g8(e){return Array.isArray(e)?"array":"object"}function me(e,t,n){return g8(e)===t?e:t==="array"?Object.values(e):q4(e,n)}const C8=(e,t,n)=>{const i=me(e,"object",t.keys);for(let a in i)i[a]=ia(i[a],t[a]);const r=Object.keys(i);let o={};if(r.length===t.keys.length)o=i;else{const a=me(n,"object",t.keys);if(r.length===1&&t.locked){const s=r[0],l=i[s],u=a[s],d=u!==0?l/u:1;for(let f in a)f===s?o[s]=l:o[f]=a[f]*d}else o=z(z({},a),i)}return me(o,t.format,t.keys)},y8=(e,t)=>me(e,"object",t.keys),b8=e=>!!e&&("step"in e||"min"in e||"max"in e);function v8(e,t,n=[]){const{lock:i=!1}=t,r=n1(t,p8),o=Array.isArray(e)?"array":"object",a=o==="object"?Object.keys(e):n,s=me(e,"object",a),l=b8(r)?a.reduce((d,f)=>Object.assign(d,{[f]:r}),{}):r,u=wa(s,l);return{value:o==="array"?e:s,settings:z(z({},u),{},{format:o,keys:a,lock:i,locked:!1})}}function Ea(e){return{schema:k8(e.length),normalize:t=>{let{value:n}=t,i=n1(t,x8);return v8(n,i,e)},format:(t,n)=>y8(t,n),sanitize:(t,n,i)=>C8(t,n,i)}}var w8={grad:.9,turn:360,rad:360/(2*Math.PI)},J1=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},f1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},L1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},Sa=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ar=function(e){return{r:L1(e.r,0,255),g:L1(e.g,0,255),b:L1(e.b,0,255),a:L1(e.a)}},Ft=function(e){return{r:f1(e.r),g:f1(e.g),b:f1(e.b),a:f1(e.a,3)}},E8=/^#([0-9a-f]{3,8})$/i,He=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Aa=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=Math.max(t,n,i),a=o-Math.min(t,n,i),s=a?o===t?(n-i)/a:o===n?2+(i-t)/a:4+(t-n)/a:0;return{h:60*(s<0?s+6:s),s:o?a/o*100:0,v:o/255*100,a:r}},_a=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var o=Math.floor(t),a=i*(1-n),s=i*(1-(t-o)*n),l=i*(1-(1-t+o)*n),u=o%6;return{r:255*[i,s,a,a,l,i][u],g:255*[l,i,i,s,a,a][u],b:255*[a,a,l,i,i,s][u],a:r}},sr=function(e){return{h:Sa(e.h),s:L1(e.s,0,100),l:L1(e.l,0,100),a:L1(e.a)}},lr=function(e){return{h:f1(e.h),s:f1(e.s),l:f1(e.l),a:f1(e.a,3)}},cr=function(e){return _a((n=(t=e).s,{h:t.h,s:(n*=((i=t.l)<50?i:100-i)/100)>0?2*n/(i+n)*100:0,v:i+n,a:t.a}));var t,n,i},pe=function(e){return{h:(t=Aa(e)).h,s:(r=(200-(n=t.s))*(i=t.v)/100)>0&&r<200?n*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,i,r},S8=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,A8=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_8=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,V8=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hn={string:[[function(e){var t=E8.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?f1(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?f1(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=_8.exec(e)||V8.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ar({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=S8.exec(e)||A8.exec(e);if(!t)return null;var n,i,r=sr({h:(n=t[1],i=t[2],i===void 0&&(i="deg"),Number(n)*(w8[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return cr(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=r===void 0?1:r;return J1(t)&&J1(n)&&J1(i)?ar({r:Number(t),g:Number(n),b:Number(i),a:Number(o)}):null},"rgb"],[function(e){var t=e.h,n=e.s,i=e.l,r=e.a,o=r===void 0?1:r;if(!J1(t)||!J1(n)||!J1(i))return null;var a=sr({h:Number(t),s:Number(n),l:Number(i),a:Number(o)});return cr(a)},"hsl"],[function(e){var t=e.h,n=e.s,i=e.v,r=e.a,o=r===void 0?1:r;if(!J1(t)||!J1(n)||!J1(i))return null;var a=function(s){return{h:Sa(s.h),s:L1(s.s,0,100),v:L1(s.v,0,100),a:L1(s.a)}}({h:Number(t),s:Number(n),v:Number(i),a:Number(o)});return _a(a)},"hsv"]]},ur=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=Ft(this.rgba),n=t.r,i=t.g,r=t.b,a=(o=t.a)<1?He(f1(255*o)):"","#"+He(n)+He(i)+He(r)+a;var t,n,i,r,o,a},e.prototype.toRgb=function(){return Ft(this.rgba)},e.prototype.toRgbString=function(){return t=Ft(this.rgba),n=t.r,i=t.g,r=t.b,(o=t.a)<1?"rgba("+n+", "+i+", "+r+", "+o+")":"rgb("+n+", "+i+", "+r+")";var t,n,i,r,o},e.prototype.toHsl=function(){return lr(pe(this.rgba))},e.prototype.toHslString=function(){return t=lr(pe(this.rgba)),n=t.h,i=t.s,r=t.l,(o=t.a)<1?"hsla("+n+", "+i+"%, "+r+"%, "+o+")":"hsl("+n+", "+i+"%, "+r+"%)";var t,n,i,r,o},e.prototype.toHsv=function(){return t=Aa(this.rgba),{h:f1(t.h),s:f1(t.s),v:f1(t.v),a:f1(t.a,3)};var t},e.prototype.invert=function(){return y1({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),y1(It(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),y1(It(this.rgba,-t))},e.prototype.grayscale=function(){return y1(It(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),y1(dr(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),y1(dr(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"?y1({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):f1(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=pe(this.rgba);return typeof t=="number"?y1({h:t,s:n.s,l:n.l,a:n.a}):f1(n.h)},e.prototype.isEqual=function(t){return this.toHex()===y1(t).toHex()},e}(),y1=function(e){return e instanceof mn?e:new mn(e)},fr=[],B8=function(e){e.forEach(function(t){fr.indexOf(t)<0&&(t(mn,hn),fr.push(t))})};function j8(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"},i={};for(var r in n)i[n[r]]=r;var o={};e.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,l,u=i[this.toHex()];if(u)return u;if(a!=null&&a.closest){var d=this.toRgb(),f=1/0,m="black";if(!o.length)for(var k in n)o[k]=new e(n[k]).toRgb();for(var p in n){var g=(s=d,l=o[p],Math.pow(s.r-l.r,2)+Math.pow(s.g-l.g,2)+Math.pow(s.b-l.b,2));g=0||(r[n]=e[n]);return r}function pn(e){var t=h.useRef(e),n=h.useRef(function(i){t.current&&t.current(i)});return t.current=e,n.current}var W0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:C.buttons>0)&&r.current?o(hr(r.current,C,s.current)):g(!1)},p=function(){return g(!1)};function g(C){var x=l.current,y=xn(r.current),b=C?y.addEventListener:y.removeEventListener;b(x?"touchmove":"mousemove",k),b(x?"touchend":"mouseup",p)}return[function(C){var x=C.nativeEvent,y=r.current;if(y&&(mr(x),!function(w,E){return E&&!xe(w)}(x,l.current)&&y)){if(xe(x)){l.current=!0;var b=x.changedTouches||[];b.length&&(s.current=b[0].identifier)}y.focus(),o(hr(y,x,s.current)),g(!0)}},function(C){var x=C.which||C.keyCode;x<37||x>40||(C.preventDefault(),a({left:x===39?.05:x===37?-.05:0,top:x===40?.05:x===38?-.05:0}))},g]},[a,o]),d=u[0],f=u[1],m=u[2];return h.useEffect(function(){return m},[m]),v.createElement("div",ee({},i,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:r,onKeyDown:f,tabIndex:0,role:"slider"}))}),Pe=function(e){return e.filter(Boolean).join(" ")},Un=function(e){var t=e.color,n=e.left,i=e.top,r=i===void 0?.5:i,o=Pe(["react-colorful__pointer",e.className]);return v.createElement("div",{className:o,style:{top:100*r+"%",left:100*n+"%"}},v.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},v1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},Da=function(e){var t=e.s,n=e.v,i=e.a,r=(200-t)*n/100;return{h:v1(e.h),s:v1(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:v1(r/2),a:v1(i,2)}},kn=function(e){var t=Da(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Nt=function(e){var t=Da(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},Ba=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var o=Math.floor(t),a=i*(1-n),s=i*(1-(t-o)*n),l=i*(1-(1-t+o)*n),u=o%6;return{r:v1(255*[i,s,a,a,l,i][u]),g:v1(255*[l,i,i,s,a,a][u]),b:v1(255*[a,a,l,i,i,s][u]),a:v1(r,2)}},ja=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=Math.max(t,n,i),a=o-Math.min(t,n,i),s=a?o===t?(n-i)/a:o===n?2+(i-t)/a:4+(t-n)/a:0;return{h:v1(60*(s<0?s+6:s)),s:v1(o?a/o*100:0),v:v1(o/255*100),a:r}},$a=v.memo(function(e){var t=e.hue,n=e.onChange,i=Pe(["react-colorful__hue",e.className]);return v.createElement("div",{className:i},v.createElement(Zn,{onMove:function(r){n({h:360*r.left})},onKey:function(r){n({h:W0(t+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":v1(t),"aria-valuemax":"360","aria-valuemin":"0"},v.createElement(Un,{className:"react-colorful__hue-pointer",left:t/360,color:kn({h:t,s:100,v:100,a:1})})))}),Ga=v.memo(function(e){var t=e.hsva,n=e.onChange,i={backgroundColor:kn({h:t.h,s:100,v:100,a:1})};return v.createElement("div",{className:"react-colorful__saturation",style:i},v.createElement(Zn,{onMove:function(r){n({s:100*r.left,v:100-100*r.top})},onKey:function(r){n({s:W0(t.s+100*r.left,0,100),v:W0(t.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+v1(t.s)+"%, Brightness "+v1(t.v)+"%"},v.createElement(Un,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:kn(t)})))}),Wn=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Pa(e,t,n){var i=pn(n),r=h.useState(function(){return e.toHsva(t)}),o=r[0],a=r[1],s=h.useRef({color:t,hsva:o});h.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),h.useEffect(function(){var u;Wn(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},i(u))},[o,e,i]);var l=h.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var $8=typeof window<"u"?h.useLayoutEffect:h.useEffect,G8=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},pr=new Map,Ma=function(e){$8(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!pr.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}`,pr.set(t,n);var i=G8();i&&n.setAttribute("nonce",i),t.head.appendChild(n)}},[])},P8=function(e){var t=e.className,n=e.colorModel,i=e.color,r=i===void 0?n.defaultColor:i,o=e.onChange,a=zn(e,["className","colorModel","color","onChange"]),s=h.useRef(null);Ma(s);var l=Pa(n,r,o),u=l[0],d=l[1],f=Pe(["react-colorful",t]);return v.createElement("div",ee({},a,{ref:s,className:f}),v.createElement(Ga,{hsva:u,onChange:d}),v.createElement($a,{hue:u.h,onChange:d,className:"react-colorful__last-control"}))},M8=function(e){var t=e.className,n=e.hsva,i=e.onChange,r={backgroundImage:"linear-gradient(90deg, "+Nt(Object.assign({},n,{a:0}))+", "+Nt(Object.assign({},n,{a:1}))+")"},o=Pe(["react-colorful__alpha",t]),a=v1(100*n.a);return v.createElement("div",{className:o},v.createElement("div",{className:"react-colorful__alpha-gradient",style:r}),v.createElement(Zn,{onMove:function(s){i({a:s.left})},onKey:function(s){i({a:W0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},v.createElement(Un,{className:"react-colorful__alpha-pointer",left:n.a,color:Nt(n)})))},L8=function(e){var t=e.className,n=e.colorModel,i=e.color,r=i===void 0?n.defaultColor:i,o=e.onChange,a=zn(e,["className","colorModel","color","onChange"]),s=h.useRef(null);Ma(s);var l=Pa(n,r,o),u=l[0],d=l[1],f=Pe(["react-colorful",t]);return v.createElement("div",ee({},a,{ref:s,className:f}),v.createElement(Ga,{hsva:u,onChange:d}),v.createElement($a,{hue:u.h,onChange:d}),v.createElement(M8,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},O8={defaultColor:{r:0,g:0,b:0,a:1},toHsva:ja,fromHsva:Ba,equal:Wn},T8=function(e){return v.createElement(L8,ee({},e,{colorModel:O8}))},R8={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return ja({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(t=Ba(e)).r,g:t.g,b:t.b};var t},equal:Wn},F8=function(e){return v.createElement(P8,ee({},e,{colorModel:R8}))};function ip(e,t,n,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,n,o):a(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function te(e,t,n,i){function r(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(d){try{u(i.next(d))}catch(f){a(f)}}function l(d){try{u(i.throw(d))}catch(f){a(f)}}function u(d){d.done?o(d.value):r(d.value).then(s,l)}u((i=i.apply(e,t||[])).next())})}function ne(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(d){return l([u,d])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(r=i.next()).done;)o.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}function H8(){for(var e=[],t=0;t0?i:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function z8(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var i=t.split(".").pop().toLowerCase(),r=N8.get(i);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}var Z8=[".DS_Store","Thumbs.db"];function U8(e){return te(this,void 0,void 0,function(){return ne(this,function(t){return at(e)&&W8(e)?[2,X8(e.dataTransfer,e.type)]:K8(e)?[2,q8(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,Y8(e)]:[2,[]]})})}function W8(e){return at(e.dataTransfer)}function K8(e){return at(e)&&at(e.target)}function at(e){return typeof e=="object"&&e!==null}function q8(e){return gn(e.target.files).map(function(t){return Me(t)})}function Y8(e){return te(this,void 0,void 0,function(){var t;return ne(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(i){return i.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(i){return Me(i)})]}})})}function X8(e,t){return te(this,void 0,void 0,function(){var n,i;return ne(this,function(r){switch(r.label){case 0:return e===null?[2,[]]:e.items?(n=gn(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(Q8))]):[3,2];case 1:return i=r.sent(),[2,xr(La(i))];case 2:return[2,xr(gn(e.files).map(function(o){return Me(o)}))]}})})}function xr(e){return e.filter(function(t){return Z8.indexOf(t.name)===-1})}function gn(e){if(e===null)return[];for(var t=[],n=0;n{const[t,n,i]=e.split(":"),r=parseInt(t,10),o=parseInt(n,10),a=parseInt(i,10);return r*3600+o*60+a};var ro={exports:{}},Qs="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Js=Qs,e2=Js;function oo(){}function ao(){}ao.resetWarningCache=oo;var t2=function(){function e(i,r,o,a,s,l){if(l!==e2){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:ao,resetWarningCache:oo};return n.PropTypes=n,n};ro.exports=t2();var n2=ro.exports;const o1=Qr(n2);function si(...e){return e.reduce((t,n)=>n==null?t:function(...r){t.apply(this,r),n.apply(this,r)},()=>{})}function i2(e,t=166){let n;function i(...r){const o=()=>{e.apply(this,r)};clearTimeout(n),n=setTimeout(o,t)}return i.clear=()=>{clearTimeout(n)},i}function Y1(e){return e&&e.ownerDocument||document}function ke(e){return Y1(e).defaultView||window}function r2(e){const t=e.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}const o2=e=>{let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,(t/100).toFixed(2)},li=o2,ci={disabled:!1};var a2=function(t){return t.scrollTop},ce="unmounted",y0="exited",b0="entering",R0="entered",Xt="exiting",l0=function(e){As(t,e);function t(i,r){var o;o=e.call(this,i,r)||this;var a=r,s=a&&!a.isMounting?i.enter:i.appear,l;return o.appearStatus=null,i.in?s?(l=y0,o.appearStatus=b0):l=R0:i.unmountOnExit||i.mountOnEnter?l=ce:l=y0,o.state={status:l},o.nextCallback=null,o}t.getDerivedStateFromProps=function(r,o){var a=r.in;return a&&o.status===ce?{status:y0}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(r){var o=null;if(r!==this.props){var a=this.state.status;this.props.in?a!==b0&&a!==R0&&(o=b0):(a===b0||a===R0)&&(o=Xt)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var r=this.props.timeout,o,a,s;return o=a=s=r,r!=null&&typeof r!="number"&&(o=r.exit,a=r.enter,s=r.appear!==void 0?r.appear:a),{exit:o,enter:a,appear:s}},n.updateStatus=function(r,o){if(r===void 0&&(r=!1),o!==null)if(this.cancelNextCallback(),o===b0){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:F0.findDOMNode(this);a&&a2(a)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===y0&&this.setState({status:ce})},n.performEnter=function(r){var o=this,a=this.props.enter,s=this.context?this.context.isMounting:r,l=this.props.nodeRef?[s]:[F0.findDOMNode(this),s],u=l[0],d=l[1],f=this.getTimeouts(),m=s?f.appear:f.enter;if(!r&&!a||ci.disabled){this.safeSetState({status:R0},function(){o.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:b0},function(){o.props.onEntering(u,d),o.onTransitionEnd(m,function(){o.safeSetState({status:R0},function(){o.props.onEntered(u,d)})})})},n.performExit=function(){var r=this,o=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:F0.findDOMNode(this);if(!o||ci.disabled){this.safeSetState({status:y0},function(){r.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:Xt},function(){r.props.onExiting(s),r.onTransitionEnd(a.exit,function(){r.safeSetState({status:y0},function(){r.props.onExited(s)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(r,o){o=this.setNextCallback(o),this.setState(r,o)},n.setNextCallback=function(r){var o=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,o.nextCallback=null,r(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(r,o){this.setNextCallback(o);var a=this.props.nodeRef?this.props.nodeRef.current:F0.findDOMNode(this),s=r==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],u=l[0],d=l[1];this.props.addEndListener(u,d)}r!=null&&setTimeout(this.nextCallback,r)},n.render=function(){var r=this.state.status;if(r===ce)return null;var o=this.props,a=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var s=I1(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return v.createElement(Jr.Provider,{value:null},typeof a=="function"?a(r,s):v.cloneElement(v.Children.only(a),s))},t}(v.Component);l0.contextType=Jr;l0.propTypes={};function M0(){}l0.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:M0,onEntering:M0,onEntered:M0,onExit:M0,onExiting:M0,onExited:M0};l0.UNMOUNTED=ce;l0.EXITED=y0;l0.ENTERING=b0;l0.ENTERED=R0;l0.EXITING=Xt;const so=l0,lo=e=>e.scrollTop;function qe(e,t){var n,i;const{timeout:r,easing:o,style:a={}}=e;return{duration:(n=a.transitionDuration)!=null?n:typeof r=="number"?r:r[t.mode]||0,easing:(i=a.transitionTimingFunction)!=null?i:typeof o=="object"?o[t.mode]:o,delay:a.transitionDelay}}function s2(e){return Ee("MuiPaper",e)}Se("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 l2=["className","component","elevation","square","variant"],c2=e=>{const{square:t,elevation:n,variant:i,classes:r}=e,o={root:["root",i,!t&&"rounded",i==="elevation"&&`elevation${n}`]};return _e(o,s2,r)},u2=D0("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 F({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"&&F({boxShadow:(e.vars||e).shadows[t.elevation]},!e.vars&&e.palette.mode==="dark"&&{backgroundImage:`linear-gradient(${Ke("#fff",li(t.elevation))}, ${Ke("#fff",li(t.elevation))})`},e.vars&&{backgroundImage:(n=e.vars.overlays)==null?void 0:n[t.elevation]}))}),d2=h.forwardRef(function(t,n){const i=Ae({props:t,name:"MuiPaper"}),{className:r,component:o="div",elevation:a=1,square:s=!1,variant:l="elevation"}=i,u=I1(i,l2),d=F({},i,{component:o,elevation:a,square:s,variant:l}),f=c2(d);return c.jsx(u2,F({as:o,ownerState:d,className:S0(f.root,r),ref:n},u))}),f2=d2;function h2(e){return Ee("MuiIconButton",e)}const m2=Se("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge"]),p2=m2,x2=["edge","children","className","color","disabled","disableFocusRipple","size"],k2=e=>{const{classes:t,disabled:n,color:i,edge:r,size:o}=e,a={root:["root",n&&"disabled",i!=="default"&&`color${H0(i)}`,r&&`edge${H0(r)}`,`size${H0(o)}`]};return _e(a,h2,t)},g2=D0(_s,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="default"&&t[`color${H0(n.color)}`],n.edge&&t[`edge${H0(n.edge)}`],t[`size${H0(n.size)}`]]}})(({theme:e,ownerState:t})=>F({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})`:Ke(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 i=(n=(e.vars||e).palette)==null?void 0:n[t.color];return F({},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&t.color!=="default"&&F({color:i==null?void 0:i.main},!t.disableRipple&&{"&:hover":F({},i&&{backgroundColor:e.vars?`rgba(${i.mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Ke(i.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)},{[`&.${p2.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled}})}),C2=h.forwardRef(function(t,n){const i=Ae({props:t,name:"MuiIconButton"}),{edge:r=!1,children:o,className:a,color:s="default",disabled:l=!1,disableFocusRipple:u=!1,size:d="medium"}=i,f=I1(i,x2),m=F({},i,{edge:r,color:s,disabled:l,disableFocusRipple:u,size:d}),k=k2(m);return c.jsx(g2,F({className:S0(k.root,a),centerRipple:!0,focusRipple:!u,disabled:l,ref:n,ownerState:m},f,{children:o}))}),co=C2;function uo(e){return typeof e=="string"}function y2(e,t,n){return e===void 0||uo(e)?t:F({},t,{ownerState:F({},t.ownerState,n)})}function fo(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(i=>i.match(/^on[A-Z]/)&&typeof e[i]=="function"&&!t.includes(i)).forEach(i=>{n[i]=e[i]}),n}function b2(e,t,n){return typeof e=="function"?e(t,n):e}function ho(e){var t,n,i="";if(typeof e=="string"||typeof e=="number")i+=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 v2(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:i,externalForwardedProps:r,className:o}=e;if(!t){const k=ui(n==null?void 0:n.className,o,r==null?void 0:r.className,i==null?void 0:i.className),p=F({},n==null?void 0:n.style,r==null?void 0:r.style,i==null?void 0:i.style),g=F({},n,r,i);return k.length>0&&(g.className=k),Object.keys(p).length>0&&(g.style=p),{props:g,internalRef:void 0}}const a=fo(F({},r,i)),s=di(i),l=di(r),u=t(a),d=ui(u==null?void 0:u.className,n==null?void 0:n.className,o,r==null?void 0:r.className,i==null?void 0:i.className),f=F({},u==null?void 0:u.style,n==null?void 0:n.style,r==null?void 0:r.style,i==null?void 0:i.style),m=F({},u,n,l,s);return d.length>0&&(m.className=d),Object.keys(f).length>0&&(m.style=f),{props:m,internalRef:u.ref}}const w2=["elementType","externalSlotProps","ownerState","skipResolvingSlotProps"];function Ye(e){var t;const{elementType:n,externalSlotProps:i,ownerState:r,skipResolvingSlotProps:o=!1}=e,a=I1(e,w2),s=o?{}:b2(i,r),{props:l,internalRef:u}=v2(F({},a,{externalSlotProps:s})),d=B0(u,s==null?void 0:s.ref,(t=e.additionalProps)==null?void 0:t.ref);return y2(n,F({},l,{ref:d}),r)}const E2=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function S2(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 A2(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=i=>e.ownerDocument.querySelector(`input[type="radio"]${i}`);let n=t(`[name="${e.name}"]:checked`);return n||(n=t(`[name="${e.name}"]`)),n!==e}function _2(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||A2(e))}function V2(e){const t=[],n=[];return Array.from(e.querySelectorAll(E2)).forEach((i,r)=>{const o=S2(i);o===-1||!_2(i)||(o===0?t.push(i):n.push({documentOrder:r,tabIndex:o,node:i}))}),n.sort((i,r)=>i.tabIndex===r.tabIndex?i.documentOrder-r.documentOrder:i.tabIndex-r.tabIndex).map(i=>i.node).concat(t)}function D2(){return!0}function B2(e){const{children:t,disableAutoFocus:n=!1,disableEnforceFocus:i=!1,disableRestoreFocus:r=!1,getTabbable:o=V2,isEnabled:a=D2,open:s}=e,l=h.useRef(!1),u=h.useRef(null),d=h.useRef(null),f=h.useRef(null),m=h.useRef(null),k=h.useRef(!1),p=h.useRef(null),g=B0(t.ref,p),C=h.useRef(null);h.useEffect(()=>{!s||!p.current||(k.current=!n)},[n,s]),h.useEffect(()=>{if(!s||!p.current)return;const b=Y1(p.current);return p.current.contains(b.activeElement)||(p.current.hasAttribute("tabIndex")||p.current.setAttribute("tabIndex","-1"),k.current&&p.current.focus()),()=>{r||(f.current&&f.current.focus&&(l.current=!0,f.current.focus()),f.current=null)}},[s]),h.useEffect(()=>{if(!s||!p.current)return;const b=Y1(p.current),w=A=>{C.current=A,!(i||!a()||A.key!=="Tab")&&b.activeElement===p.current&&A.shiftKey&&(l.current=!0,d.current&&d.current.focus())},E=()=>{const A=p.current;if(A===null)return;if(!b.hasFocus()||!a()||l.current){l.current=!1;return}if(A.contains(b.activeElement)||i&&b.activeElement!==u.current&&b.activeElement!==d.current)return;if(b.activeElement!==m.current)m.current=null;else if(m.current!==null)return;if(!k.current)return;let _=[];if((b.activeElement===u.current||b.activeElement===d.current)&&(_=o(p.current)),_.length>0){var G,B;const D=!!((G=C.current)!=null&&G.shiftKey&&((B=C.current)==null?void 0:B.key)==="Tab"),V=_[0],R=_[_.length-1];typeof V!="string"&&typeof R!="string"&&(D?R.focus():V.focus())}else A.focus()};b.addEventListener("focusin",E),b.addEventListener("keydown",w,!0);const S=setInterval(()=>{b.activeElement&&b.activeElement.tagName==="BODY"&&E()},50);return()=>{clearInterval(S),b.removeEventListener("focusin",E),b.removeEventListener("keydown",w,!0)}},[n,i,r,a,s,o]);const x=b=>{f.current===null&&(f.current=b.relatedTarget),k.current=!0,m.current=b.target;const w=t.props.onFocus;w&&w(b)},y=b=>{f.current===null&&(f.current=b.relatedTarget),k.current=!0};return c.jsxs(h.Fragment,{children:[c.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:u,"data-testid":"sentinelStart"}),h.cloneElement(t,{ref:g,onFocus:x}),c.jsx("div",{tabIndex:s?0:-1,onFocus:y,ref:d,"data-testid":"sentinelEnd"})]})}function j2(e){return typeof e=="function"?e():e}const $2=h.forwardRef(function(t,n){const{children:i,container:r,disablePortal:o=!1}=t,[a,s]=h.useState(null),l=B0(h.isValidElement(i)?i.ref:null,n);if(ri(()=>{o||s(j2(r)||document.body)},[r,o]),ri(()=>{if(a&&!o)return oi(n,a),()=>{oi(n,null)}},[n,a,o]),o){if(h.isValidElement(i)){const u={ref:l};return h.cloneElement(i,u)}return c.jsx(h.Fragment,{children:i})}return c.jsx(h.Fragment,{children:a&&pt.createPortal(i,a)})});function G2(e){const t=Y1(e);return t.body===e?ke(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function he(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function fi(e){return parseInt(ke(e).getComputedStyle(e).paddingRight,10)||0}function P2(e){const n=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].indexOf(e.tagName)!==-1,i=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return n||i}function hi(e,t,n,i,r){const o=[t,n,...i];[].forEach.call(e.children,a=>{const s=o.indexOf(a)===-1,l=!P2(a);s&&l&&he(a,r)})}function Gt(e,t){let n=-1;return e.some((i,r)=>t(i)?(n=r,!0):!1),n}function M2(e,t){const n=[],i=e.container;if(!t.disableScrollLock){if(G2(i)){const a=r2(Y1(i));n.push({value:i.style.paddingRight,property:"padding-right",el:i}),i.style.paddingRight=`${fi(i)+a}px`;const s=Y1(i).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{n.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${fi(l)+a}px`})}let o;if(i.parentNode instanceof DocumentFragment)o=Y1(i).body;else{const a=i.parentElement,s=ke(i);o=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a:i}n.push({value:o.style.overflow,property:"overflow",el:o},{value:o.style.overflowX,property:"overflow-x",el:o},{value:o.style.overflowY,property:"overflow-y",el:o}),o.style.overflow="hidden"}return()=>{n.forEach(({value:o,el:a,property:s})=>{o?a.style.setProperty(s,o):a.style.removeProperty(s)})}}function L2(e){const t=[];return[].forEach.call(e.children,n=>{n.getAttribute("aria-hidden")==="true"&&t.push(n)}),t}class O2{constructor(){this.containers=void 0,this.modals=void 0,this.modals=[],this.containers=[]}add(t,n){let i=this.modals.indexOf(t);if(i!==-1)return i;i=this.modals.length,this.modals.push(t),t.modalRef&&he(t.modalRef,!1);const r=L2(n);hi(n,t.mount,t.modalRef,r,!0);const o=Gt(this.containers,a=>a.container===n);return o!==-1?(this.containers[o].modals.push(t),i):(this.containers.push({modals:[t],container:n,restore:null,hiddenSiblings:r}),i)}mount(t,n){const i=Gt(this.containers,o=>o.modals.indexOf(t)!==-1),r=this.containers[i];r.restore||(r.restore=M2(r,n))}remove(t,n=!0){const i=this.modals.indexOf(t);if(i===-1)return i;const r=Gt(this.containers,a=>a.modals.indexOf(t)!==-1),o=this.containers[r];if(o.modals.splice(o.modals.indexOf(t),1),this.modals.splice(i,1),o.modals.length===0)o.restore&&o.restore(),t.modalRef&&he(t.modalRef,n),hi(o.container,t.mount,t.modalRef,o.hiddenSiblings,!1),this.containers.splice(r,1);else{const a=o.modals[o.modals.length-1];a.modalRef&&he(a.modalRef,!1)}return i}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function T2(e){return typeof e=="function"?e():e}function R2(e){return e?e.props.hasOwnProperty("in"):!1}const F2=new O2;function I2(e){const{container:t,disableEscapeKeyDown:n=!1,disableScrollLock:i=!1,manager:r=F2,closeAfterTransition:o=!1,onTransitionEnter:a,onTransitionExited:s,children:l,onClose:u,open:d,rootRef:f}=e,m=h.useRef({}),k=h.useRef(null),p=h.useRef(null),g=B0(p,f),[C,x]=h.useState(!d),y=R2(l);let b=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(b=!1);const w=()=>Y1(k.current),E=()=>(m.current.modalRef=p.current,m.current.mount=k.current,m.current),S=()=>{r.mount(E(),{disableScrollLock:i}),p.current&&(p.current.scrollTop=0)},A=ai(()=>{const j=T2(t)||w().body;r.add(E(),j),p.current&&S()}),_=h.useCallback(()=>r.isTopModal(E()),[r]),G=ai(j=>{k.current=j,j&&(d&&_()?S():p.current&&he(p.current,b))}),B=h.useCallback(()=>{r.remove(E(),b)},[b,r]);h.useEffect(()=>()=>{B()},[B]),h.useEffect(()=>{d?A():(!y||!o)&&B()},[d,B,y,o,A]);const D=j=>L=>{var Z;(Z=j.onKeyDown)==null||Z.call(j,L),!(L.key!=="Escape"||L.which===229||!_())&&(n||(L.stopPropagation(),u&&u(L,"escapeKeyDown")))},V=j=>L=>{var Z;(Z=j.onClick)==null||Z.call(j,L),L.target===L.currentTarget&&u&&u(L,"backdropClick")};return{getRootProps:(j={})=>{const L=fo(e);delete L.onTransitionEnter,delete L.onTransitionExited;const Z=F({},L,j);return F({role:"presentation"},Z,{onKeyDown:D(Z),ref:g})},getBackdropProps:(j={})=>{const L=j;return F({"aria-hidden":!0},L,{onClick:V(L),open:d})},getTransitionProps:()=>{const j=()=>{x(!1),a&&a()},L=()=>{x(!0),s&&s(),o&&B()};return{onEnter:si(j,l==null?void 0:l.props.onEnter),onExited:si(L,l==null?void 0:l.props.onExited)}},rootRef:g,portalRef:G,isTopModal:_,exited:C,hasTransition:y}}const H2=["top","right","bottom","left"],m0=Math.min,$1=Math.max,Xe=Math.round,Te=Math.floor,p0=e=>({x:e,y:e}),N2={left:"right",right:"left",bottom:"top",top:"bottom"},z2={start:"end",end:"start"};function Qt(e,t,n){return $1(e,m0(t,n))}function r0(e,t){return typeof e=="function"?e(t):e}function o0(e){return e.split("-")[0]}function q0(e){return e.split("-")[1]}function Dn(e){return e==="x"?"y":"x"}function Bn(e){return e==="y"?"height":"width"}function Y0(e){return["top","bottom"].includes(o0(e))?"y":"x"}function jn(e){return Dn(Y0(e))}function Z2(e,t,n){n===void 0&&(n=!1);const i=q0(e),r=jn(e),o=Bn(r);let a=r==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=Qe(a)),[a,Qe(a)]}function U2(e){const t=Qe(e);return[Jt(e),t,Jt(t)]}function Jt(e){return e.replace(/start|end/g,t=>z2[t])}function W2(e,t,n){const i=["left","right"],r=["right","left"],o=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:i:t?i:r;case"left":case"right":return t?o:a;default:return[]}}function K2(e,t,n,i){const r=q0(e);let o=W2(o0(e),n==="start",i);return r&&(o=o.map(a=>a+"-"+r),t&&(o=o.concat(o.map(Jt)))),o}function Qe(e){return e.replace(/left|right|bottom|top/g,t=>N2[t])}function q2(e){return{top:0,right:0,bottom:0,left:0,...e}}function mo(e){return typeof e!="number"?q2(e):{top:e,right:e,bottom:e,left:e}}function Je(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function mi(e,t,n){let{reference:i,floating:r}=e;const o=Y0(t),a=jn(t),s=Bn(a),l=o0(t),u=o==="y",d=i.x+i.width/2-r.width/2,f=i.y+i.height/2-r.height/2,m=i[s]/2-r[s]/2;let k;switch(l){case"top":k={x:d,y:i.y-r.height};break;case"bottom":k={x:d,y:i.y+i.height};break;case"right":k={x:i.x+i.width,y:f};break;case"left":k={x:i.x-r.width,y:f};break;default:k={x:i.x,y:i.y}}switch(q0(t)){case"start":k[a]-=m*(n&&u?-1:1);break;case"end":k[a]+=m*(n&&u?-1:1);break}return k}const Y2=async(e,t,n)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=n,s=o.filter(Boolean),l=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:d,y:f}=mi(u,i,l),m=i,k={},p=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:n,y:i,placement:r,rects:o,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:d=0}=r0(e,t)||{};if(u==null)return{};const f=mo(d),m={x:n,y:i},k=jn(r),p=Bn(k),g=await a.getDimensions(u),C=k==="y",x=C?"top":"left",y=C?"bottom":"right",b=C?"clientHeight":"clientWidth",w=o.reference[p]+o.reference[k]-m[k]-o.floating[p],E=m[k]-o.reference[k],S=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let A=S?S[b]:0;(!A||!await(a.isElement==null?void 0:a.isElement(S)))&&(A=s.floating[b]||o.floating[p]);const _=w/2-E/2,G=A/2-g[p]/2-1,B=m0(f[x],G),D=m0(f[y],G),V=B,R=A-g[p]-D,P=A/2-g[p]/2+_,$=Qt(V,P,R),j=!l.arrow&&q0(r)!=null&&P!=$&&o.reference[p]/2-(PV<=0)){var G,B;const V=(((G=o.flip)==null?void 0:G.index)||0)+1,R=E[V];if(R)return{data:{index:V,overflows:_},reset:{placement:R}};let P=(B=_.filter($=>$.overflows[0]<=0).sort(($,j)=>$.overflows[1]-j.overflows[1])[0])==null?void 0:B.placement;if(!P)switch(k){case"bestFit":{var D;const $=(D=_.map(j=>[j.placement,j.overflows.filter(L=>L>0).reduce((L,Z)=>L+Z,0)]).sort((j,L)=>j[1]-L[1])[0])==null?void 0:D[0];$&&(P=$);break}case"initialPlacement":P=s;break}if(r!==P)return{reset:{placement:P}}}return{}}}};function xi(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ki(e){return H2.some(t=>e[t]>=0)}const Q2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:i="referenceHidden",...r}=r0(e,t);switch(i){case"referenceHidden":{const o=await ge(t,{...r,elementContext:"reference"}),a=xi(o,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:ki(a)}}}case"escaped":{const o=await ge(t,{...r,altBoundary:!0}),a=xi(o,n.floating);return{data:{escapedOffsets:a,escaped:ki(a)}}}default:return{}}}}};async function J2(e,t){const{placement:n,platform:i,elements:r}=e,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=o0(n),s=q0(n),l=Y0(n)==="y",u=["left","top"].includes(a)?-1:1,d=o&&l?-1:1,f=r0(t,e);let{mainAxis:m,crossAxis:k,alignmentAxis:p}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return s&&typeof p=="number"&&(k=s==="end"?p*-1:p),l?{x:k*d,y:m*u}:{x:m*u,y:k*d}}const e3=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,i;const{x:r,y:o,placement:a,middlewareData:s}=t,l=await J2(t,e);return a===((n=s.offset)==null?void 0:n.placement)&&(i=s.arrow)!=null&&i.alignmentOffset?{}:{x:r+l.x,y:o+l.y,data:{...l,placement:a}}}}},t3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:i,placement:r}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:C=>{let{x,y}=C;return{x,y}}},...l}=r0(e,t),u={x:n,y:i},d=await ge(t,l),f=Y0(o0(r)),m=Dn(f);let k=u[m],p=u[f];if(o){const C=m==="y"?"top":"left",x=m==="y"?"bottom":"right",y=k+d[C],b=k-d[x];k=Qt(y,k,b)}if(a){const C=f==="y"?"top":"left",x=f==="y"?"bottom":"right",y=p+d[C],b=p-d[x];p=Qt(y,p,b)}const g=s.fn({...t,[m]:k,[f]:p});return{...g,data:{x:g.x-n,y:g.y-i}}}}},n3=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:i,placement:r,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=r0(e,t),d={x:n,y:i},f=Y0(r),m=Dn(f);let k=d[m],p=d[f];const g=r0(s,t),C=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const b=m==="y"?"height":"width",w=o.reference[m]-o.floating[b]+C.mainAxis,E=o.reference[m]+o.reference[b]-C.mainAxis;kE&&(k=E)}if(u){var x,y;const b=m==="y"?"width":"height",w=["top","left"].includes(o0(r)),E=o.reference[f]-o.floating[b]+(w&&((x=a.offset)==null?void 0:x[f])||0)+(w?0:C.crossAxis),S=o.reference[f]+o.reference[b]+(w?0:((y=a.offset)==null?void 0:y[f])||0)-(w?C.crossAxis:0);pS&&(p=S)}return{[m]:k,[f]:p}}}},i3=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:i,platform:r,elements:o}=t,{apply:a=()=>{},...s}=r0(e,t),l=await ge(t,s),u=o0(n),d=q0(n),f=Y0(n)==="y",{width:m,height:k}=i.floating;let p,g;u==="top"||u==="bottom"?(p=u,g=d===(await(r.isRTL==null?void 0:r.isRTL(o.floating))?"start":"end")?"left":"right"):(g=u,p=d==="end"?"top":"bottom");const C=k-l[p],x=m-l[g],y=!t.middlewareData.shift;let b=C,w=x;if(f){const S=m-l.left-l.right;w=d||y?m0(x,S):S}else{const S=k-l.top-l.bottom;b=d||y?m0(C,S):S}if(y&&!d){const S=$1(l.left,0),A=$1(l.right,0),_=$1(l.top,0),G=$1(l.bottom,0);f?w=m-2*(S!==0||A!==0?S+A:$1(l.left,l.right)):b=k-2*(_!==0||G!==0?_+G:$1(l.top,l.bottom))}await a({...t,availableWidth:w,availableHeight:b});const E=await r.getDimensions(o.floating);return m!==E.width||k!==E.height?{reset:{rects:!0}}:{}}}};function x0(e){return po(e)?(e.nodeName||"").toLowerCase():"#document"}function G1(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function c0(e){var t;return(t=(po(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function po(e){return e instanceof Node||e instanceof G1(e).Node}function a0(e){return e instanceof Element||e instanceof G1(e).Element}function X1(e){return e instanceof HTMLElement||e instanceof G1(e).HTMLElement}function gi(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof G1(e).ShadowRoot}function Ve(e){const{overflow:t,overflowX:n,overflowY:i,display:r}=O1(e);return/auto|scroll|overlay|hidden|clip/.test(t+i+n)&&!["inline","contents"].includes(r)}function r3(e){return["table","td","th"].includes(x0(e))}function $n(e){const t=Gn(),n=O1(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(i=>(n.willChange||"").includes(i))||["paint","layout","strict","content"].some(i=>(n.contain||"").includes(i))}function o3(e){let t=Z0(e);for(;X1(t)&&!gt(t);){if($n(t))return t;t=Z0(t)}return null}function Gn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function gt(e){return["html","body","#document"].includes(x0(e))}function O1(e){return G1(e).getComputedStyle(e)}function Ct(e){return a0(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Z0(e){if(x0(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gi(e)&&e.host||c0(e);return gi(t)?t.host:t}function xo(e){const t=Z0(e);return gt(t)?e.ownerDocument?e.ownerDocument.body:e.body:X1(t)&&Ve(t)?t:xo(t)}function Ce(e,t,n){var i;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=xo(e),o=r===((i=e.ownerDocument)==null?void 0:i.body),a=G1(r);return o?t.concat(a,a.visualViewport||[],Ve(r)?r:[],a.frameElement&&n?Ce(a.frameElement):[]):t.concat(r,Ce(r,[],n))}function ko(e){const t=O1(e);let n=parseFloat(t.width)||0,i=parseFloat(t.height)||0;const r=X1(e),o=r?e.offsetWidth:n,a=r?e.offsetHeight:i,s=Xe(n)!==o||Xe(i)!==a;return s&&(n=o,i=a),{width:n,height:i,$:s}}function Pn(e){return a0(e)?e:e.contextElement}function N0(e){const t=Pn(e);if(!X1(t))return p0(1);const n=t.getBoundingClientRect(),{width:i,height:r,$:o}=ko(t);let a=(o?Xe(n.width):n.width)/i,s=(o?Xe(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const a3=p0(0);function go(e){const t=G1(e);return!Gn()||!t.visualViewport?a3:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function s3(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==G1(e)?!1:t}function A0(e,t,n,i){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=Pn(e);let a=p0(1);t&&(i?a0(i)&&(a=N0(i)):a=N0(e));const s=s3(o,n,i)?go(o):p0(0);let l=(r.left+s.x)/a.x,u=(r.top+s.y)/a.y,d=r.width/a.x,f=r.height/a.y;if(o){const m=G1(o),k=i&&a0(i)?G1(i):i;let p=m.frameElement;for(;p&&i&&k!==m;){const g=N0(p),C=p.getBoundingClientRect(),x=O1(p),y=C.left+(p.clientLeft+parseFloat(x.paddingLeft))*g.x,b=C.top+(p.clientTop+parseFloat(x.paddingTop))*g.y;l*=g.x,u*=g.y,d*=g.x,f*=g.y,l+=y,u+=b,p=G1(p).frameElement}}return Je({width:d,height:f,x:l,y:u})}function l3(e){let{rect:t,offsetParent:n,strategy:i}=e;const r=X1(n),o=c0(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s=p0(1);const l=p0(0);if((r||!r&&i!=="fixed")&&((x0(n)!=="body"||Ve(o))&&(a=Ct(n)),X1(n))){const u=A0(n);s=N0(n),l.x=u.x+n.clientLeft,l.y=u.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 c3(e){return Array.from(e.getClientRects())}function Co(e){return A0(c0(e)).left+Ct(e).scrollLeft}function u3(e){const t=c0(e),n=Ct(e),i=e.ownerDocument.body,r=$1(t.scrollWidth,t.clientWidth,i.scrollWidth,i.clientWidth),o=$1(t.scrollHeight,t.clientHeight,i.scrollHeight,i.clientHeight);let a=-n.scrollLeft+Co(e);const s=-n.scrollTop;return O1(i).direction==="rtl"&&(a+=$1(t.clientWidth,i.clientWidth)-r),{width:r,height:o,x:a,y:s}}function d3(e,t){const n=G1(e),i=c0(e),r=n.visualViewport;let o=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){o=r.width,a=r.height;const u=Gn();(!u||u&&t==="fixed")&&(s=r.offsetLeft,l=r.offsetTop)}return{width:o,height:a,x:s,y:l}}function f3(e,t){const n=A0(e,!0,t==="fixed"),i=n.top+e.clientTop,r=n.left+e.clientLeft,o=X1(e)?N0(e):p0(1),a=e.clientWidth*o.x,s=e.clientHeight*o.y,l=r*o.x,u=i*o.y;return{width:a,height:s,x:l,y:u}}function Ci(e,t,n){let i;if(t==="viewport")i=d3(e,n);else if(t==="document")i=u3(c0(e));else if(a0(t))i=f3(t,n);else{const r=go(e);i={...t,x:t.x-r.x,y:t.y-r.y}}return Je(i)}function yo(e,t){const n=Z0(e);return n===t||!a0(n)||gt(n)?!1:O1(n).position==="fixed"||yo(n,t)}function h3(e,t){const n=t.get(e);if(n)return n;let i=Ce(e,[],!1).filter(s=>a0(s)&&x0(s)!=="body"),r=null;const o=O1(e).position==="fixed";let a=o?Z0(e):e;for(;a0(a)&&!gt(a);){const s=O1(a),l=$n(a);!l&&s.position==="fixed"&&(r=null),(o?!l&&!r:!l&&s.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||Ve(a)&&!l&&yo(e,a))?i=i.filter(d=>d!==a):r=s,a=Z0(a)}return t.set(e,i),i}function m3(e){let{element:t,boundary:n,rootBoundary:i,strategy:r}=e;const a=[...n==="clippingAncestors"?h3(t,this._c):[].concat(n),i],s=a[0],l=a.reduce((u,d)=>{const f=Ci(t,d,r);return u.top=$1(f.top,u.top),u.right=m0(f.right,u.right),u.bottom=m0(f.bottom,u.bottom),u.left=$1(f.left,u.left),u},Ci(t,s,r));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function p3(e){return ko(e)}function x3(e,t,n){const i=X1(t),r=c0(t),o=n==="fixed",a=A0(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=p0(0);if(i||!i&&!o)if((x0(t)!=="body"||Ve(r))&&(s=Ct(t)),i){const u=A0(t,!0,o,t);l.x=u.x+t.clientLeft,l.y=u.y+t.clientTop}else r&&(l.x=Co(r));return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function yi(e,t){return!X1(e)||O1(e).position==="fixed"?null:t?t(e):e.offsetParent}function bo(e,t){const n=G1(e);if(!X1(e))return n;let i=yi(e,t);for(;i&&r3(i)&&O1(i).position==="static";)i=yi(i,t);return i&&(x0(i)==="html"||x0(i)==="body"&&O1(i).position==="static"&&!$n(i))?n:i||o3(e)||n}const k3=async function(e){let{reference:t,floating:n,strategy:i}=e;const r=this.getOffsetParent||bo,o=this.getDimensions;return{reference:x3(t,await r(n),i),floating:{x:0,y:0,...await o(n)}}};function g3(e){return O1(e).direction==="rtl"}const C3={convertOffsetParentRelativeRectToViewportRelativeRect:l3,getDocumentElement:c0,getClippingRect:m3,getOffsetParent:bo,getElementRects:k3,getClientRects:c3,getDimensions:p3,getScale:N0,isElement:a0,isRTL:g3};function y3(e,t){let n=null,i;const r=c0(e);function o(){clearTimeout(i),n&&n.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:u,top:d,width:f,height:m}=e.getBoundingClientRect();if(s||t(),!f||!m)return;const k=Te(d),p=Te(r.clientWidth-(u+f)),g=Te(r.clientHeight-(d+m)),C=Te(u),y={rootMargin:-k+"px "+-p+"px "+-g+"px "+-C+"px",threshold:$1(0,m0(1,l))||1};let b=!0;function w(E){const S=E[0].intersectionRatio;if(S!==l){if(!b)return a();S?a(!1,S):i=setTimeout(()=>{a(!1,1e-7)},100)}b=!1}try{n=new IntersectionObserver(w,{...y,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,y)}n.observe(e)}return a(!0),o}function b3(e,t,n,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=i,u=Pn(e),d=r||o?[...u?Ce(u):[],...Ce(t)]:[];d.forEach(x=>{r&&x.addEventListener("scroll",n,{passive:!0}),o&&x.addEventListener("resize",n)});const f=u&&s?y3(u,n):null;let m=-1,k=null;a&&(k=new ResizeObserver(x=>{let[y]=x;y&&y.target===u&&k&&(k.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{k&&k.observe(t)})),n()}),u&&!l&&k.observe(u),k.observe(t));let p,g=l?A0(e):null;l&&C();function C(){const x=A0(e);g&&(x.x!==g.x||x.y!==g.y||x.width!==g.width||x.height!==g.height)&&n(),g=x,p=requestAnimationFrame(C)}return n(),()=>{d.forEach(x=>{r&&x.removeEventListener("scroll",n),o&&x.removeEventListener("resize",n)}),f&&f(),k&&k.disconnect(),k=null,l&&cancelAnimationFrame(p)}}const v3=(e,t,n)=>{const i=new Map,r={platform:C3,...n},o={...r.platform,_c:i};return Y2(e,t,{...r,platform:o})},w3=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:i,padding:r}=typeof e=="function"?e(n):e;return i&&t(i)?i.current!=null?pi({element:i.current,padding:r}).fn(n):{}:i?pi({element:i,padding:r}).fn(n):{}}}};var Ze=typeof document<"u"?h.useLayoutEffect:h.useEffect;function et(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,i,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(i=n;i--!==0;)if(!et(e[i],t[i]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(i=n;i--!==0;)if(!{}.hasOwnProperty.call(t,r[i]))return!1;for(i=n;i--!==0;){const o=r[i];if(!(o==="_owner"&&e.$$typeof)&&!et(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function vo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function bi(e,t){const n=vo(e);return Math.round(t*n)/n}function vi(e){const t=h.useRef(e);return Ze(()=>{t.current=e}),t}function E3(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:i=[],platform:r,elements:{reference:o,floating:a}={},transform:s=!0,whileElementsMounted:l,open:u}=e,[d,f]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,k]=h.useState(i);et(m,i)||k(i);const[p,g]=h.useState(null),[C,x]=h.useState(null),y=h.useCallback(j=>{j!=S.current&&(S.current=j,g(j))},[g]),b=h.useCallback(j=>{j!==A.current&&(A.current=j,x(j))},[x]),w=o||p,E=a||C,S=h.useRef(null),A=h.useRef(null),_=h.useRef(d),G=vi(l),B=vi(r),D=h.useCallback(()=>{if(!S.current||!A.current)return;const j={placement:t,strategy:n,middleware:m};B.current&&(j.platform=B.current),v3(S.current,A.current,j).then(L=>{const Z={...L,isPositioned:!0};V.current&&!et(_.current,Z)&&(_.current=Z,pt.flushSync(()=>{f(Z)}))})},[m,t,n,B]);Ze(()=>{u===!1&&_.current.isPositioned&&(_.current.isPositioned=!1,f(j=>({...j,isPositioned:!1})))},[u]);const V=h.useRef(!1);Ze(()=>(V.current=!0,()=>{V.current=!1}),[]),Ze(()=>{if(w&&(S.current=w),E&&(A.current=E),w&&E){if(G.current)return G.current(w,E,D);D()}},[w,E,D,G]);const R=h.useMemo(()=>({reference:S,floating:A,setReference:y,setFloating:b}),[y,b]),P=h.useMemo(()=>({reference:w,floating:E}),[w,E]),$=h.useMemo(()=>{const j={position:n,left:0,top:0};if(!P.floating)return j;const L=bi(P.floating,d.x),Z=bi(P.floating,d.y);return s?{...j,transform:"translate("+L+"px, "+Z+"px)",...vo(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:Z}},[n,s,P.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:D,refs:R,elements:P,floatingStyles:$}),[d,D,R,P,$])}const S3=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"],A3={entering:{opacity:1},entered:{opacity:1}},_3=h.forwardRef(function(t,n){const i=eo(),r={enter:i.transitions.duration.enteringScreen,exit:i.transitions.duration.leavingScreen},{addEndListener:o,appear:a=!0,children:s,easing:l,in:u,onEnter:d,onEntered:f,onEntering:m,onExit:k,onExited:p,onExiting:g,style:C,timeout:x=r,TransitionComponent:y=so}=t,b=I1(t,S3),w=h.useRef(null),E=B0(w,s.ref,n),S=P=>$=>{if(P){const j=w.current;$===void 0?P(j):P(j,$)}},A=S(m),_=S((P,$)=>{lo(P);const j=qe({style:C,timeout:x,easing:l},{mode:"enter"});P.style.webkitTransition=i.transitions.create("opacity",j),P.style.transition=i.transitions.create("opacity",j),d&&d(P,$)}),G=S(f),B=S(g),D=S(P=>{const $=qe({style:C,timeout:x,easing:l},{mode:"exit"});P.style.webkitTransition=i.transitions.create("opacity",$),P.style.transition=i.transitions.create("opacity",$),k&&k(P)}),V=S(p),R=P=>{o&&o(w.current,P)};return c.jsx(y,F({appear:a,in:u,nodeRef:w,onEnter:_,onEntered:G,onEntering:A,onExit:D,onExited:V,onExiting:B,addEndListener:R,timeout:x},b,{children:(P,$)=>h.cloneElement(s,F({style:F({opacity:0,visibility:P==="exited"&&!u?"hidden":void 0},A3[P],C,s.props.style),ref:E},$))}))}),V3=_3;function D3(e){return Ee("MuiBackdrop",e)}Se("MuiBackdrop",["root","invisible"]);const B3=["children","className","component","components","componentsProps","invisible","open","slotProps","slots","TransitionComponent","transitionDuration"],j3=e=>{const{classes:t,invisible:n}=e;return _e({root:["root",n&&"invisible"]},D3,t)},$3=D0("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.invisible&&t.invisible]}})(({ownerState:e})=>F({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"})),G3=h.forwardRef(function(t,n){var i,r,o;const a=Ae({props:t,name:"MuiBackdrop"}),{children:s,className:l,component:u="div",components:d={},componentsProps:f={},invisible:m=!1,open:k,slotProps:p={},slots:g={},TransitionComponent:C=V3,transitionDuration:x}=a,y=I1(a,B3),b=F({},a,{component:u,invisible:m}),w=j3(b),E=(i=p.root)!=null?i:f.root;return c.jsx(C,F({in:k,timeout:x},y,{children:c.jsx($3,F({"aria-hidden":!0},E,{as:(r=(o=g.root)!=null?o:d.Root)!=null?r:u,className:S0(w.root,l,E==null?void 0:E.className),ownerState:F({},b,E==null?void 0:E.ownerState),classes:w,ref:n,children:s}))}))}),P3=G3;function M3(e){return Ee("MuiModal",e)}Se("MuiModal",["root","hidden","backdrop"]);const L3=["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"],O3=e=>{const{open:t,exited:n,classes:i}=e;return _e({root:["root",!t&&n&&"hidden"],backdrop:["backdrop"]},M3,i)},T3=D0("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})=>F({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0},!t.open&&t.exited&&{visibility:"hidden"})),R3=D0(P3,{name:"MuiModal",slot:"Backdrop",overridesResolver:(e,t)=>t.backdrop})({zIndex:-1}),F3=h.forwardRef(function(t,n){var i,r,o,a,s,l;const u=Ae({name:"MuiModal",props:t}),{BackdropComponent:d=R3,BackdropProps:f,className:m,closeAfterTransition:k=!1,children:p,container:g,component:C,components:x={},componentsProps:y={},disableAutoFocus:b=!1,disableEnforceFocus:w=!1,disableEscapeKeyDown:E=!1,disablePortal:S=!1,disableRestoreFocus:A=!1,disableScrollLock:_=!1,hideBackdrop:G=!1,keepMounted:B=!1,onBackdropClick:D,open:V,slotProps:R,slots:P}=u,$=I1(u,L3),j=F({},u,{closeAfterTransition:k,disableAutoFocus:b,disableEnforceFocus:w,disableEscapeKeyDown:E,disablePortal:S,disableRestoreFocus:A,disableScrollLock:_,hideBackdrop:G,keepMounted:B}),{getRootProps:L,getBackdropProps:Z,getTransitionProps:U,portalRef:J,isTopModal:W,exited:M,hasTransition:Q}=I2(F({},j,{rootRef:n})),e1=F({},j,{exited:M}),X=O3(e1),d1={};if(p.props.tabIndex===void 0&&(d1.tabIndex="-1"),Q){const{onEnter:Y,onExited:r1}=U();d1.onEnter=Y,d1.onExited=r1}const S1=(i=(r=P==null?void 0:P.root)!=null?r:x.Root)!=null?i:T3,A1=(o=(a=P==null?void 0:P.backdrop)!=null?a:x.Backdrop)!=null?o:d,j1=(s=R==null?void 0:R.root)!=null?s:y.root,R1=(l=R==null?void 0:R.backdrop)!=null?l:y.backdrop,d0=Ye({elementType:S1,externalSlotProps:j1,externalForwardedProps:$,getSlotProps:L,additionalProps:{ref:n,as:C},ownerState:e1,className:S0(m,j1==null?void 0:j1.className,X==null?void 0:X.root,!e1.open&&e1.exited&&(X==null?void 0:X.hidden))}),f0=Ye({elementType:A1,externalSlotProps:R1,additionalProps:f,getSlotProps:Y=>Z(F({},Y,{onClick:r1=>{D&&D(r1),Y!=null&&Y.onClick&&Y.onClick(r1)}})),className:S0(R1==null?void 0:R1.className,f==null?void 0:f.className,X==null?void 0:X.backdrop),ownerState:e1});return!B&&!V&&(!Q||M)?null:c.jsx($2,{ref:J,container:g,disablePortal:S,children:c.jsxs(S1,F({},d0,{children:[!G&&d?c.jsx(A1,F({},f0)):null,c.jsx(B2,{disableEnforceFocus:w,disableAutoFocus:b,disableRestoreFocus:A,isEnabled:W,open:V,children:h.cloneElement(p,d1)})]}))})}),I3=F3,H3=["addEndListener","appear","children","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function en(e){return`scale(${e}, ${e**2})`}const N3={entering:{opacity:1,transform:en(1)},entered:{opacity:1,transform:"none"}},Pt=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),wo=h.forwardRef(function(t,n){const{addEndListener:i,appear:r=!0,children:o,easing:a,in:s,onEnter:l,onEntered:u,onEntering:d,onExit:f,onExited:m,onExiting:k,style:p,timeout:g="auto",TransitionComponent:C=so}=t,x=I1(t,H3),y=h.useRef(),b=h.useRef(),w=eo(),E=h.useRef(null),S=B0(E,o.ref,n),A=$=>j=>{if($){const L=E.current;j===void 0?$(L):$(L,j)}},_=A(d),G=A(($,j)=>{lo($);const{duration:L,delay:Z,easing:U}=qe({style:p,timeout:g,easing:a},{mode:"enter"});let J;g==="auto"?(J=w.transitions.getAutoHeightDuration($.clientHeight),b.current=J):J=L,$.style.transition=[w.transitions.create("opacity",{duration:J,delay:Z}),w.transitions.create("transform",{duration:Pt?J:J*.666,delay:Z,easing:U})].join(","),l&&l($,j)}),B=A(u),D=A(k),V=A($=>{const{duration:j,delay:L,easing:Z}=qe({style:p,timeout:g,easing:a},{mode:"exit"});let U;g==="auto"?(U=w.transitions.getAutoHeightDuration($.clientHeight),b.current=U):U=j,$.style.transition=[w.transitions.create("opacity",{duration:U,delay:L}),w.transitions.create("transform",{duration:Pt?U:U*.666,delay:Pt?L:L||U*.333,easing:Z})].join(","),$.style.opacity=0,$.style.transform=en(.75),f&&f($)}),R=A(m),P=$=>{g==="auto"&&(y.current=setTimeout($,b.current||0)),i&&i(E.current,$)};return h.useEffect(()=>()=>{clearTimeout(y.current)},[]),c.jsx(C,F({appear:r,in:s,nodeRef:E,onEnter:G,onEntered:B,onEntering:_,onExit:V,onExited:R,onExiting:D,addEndListener:P,timeout:g==="auto"?null:g},x,{children:($,j)=>h.cloneElement(o,F({style:F({opacity:0,transform:en(.75),visibility:$==="exited"&&!s?"hidden":void 0},N3[$],p,o.props.style),ref:S},j))}))});wo.muiSupportAuto=!0;const z3=wo;function Z3(e){return Ee("MuiPopover",e)}Se("MuiPopover",["root","paper"]);const U3=["onEntering"],W3=["action","anchorEl","anchorOrigin","anchorPosition","anchorReference","children","className","container","elevation","marginThreshold","open","PaperProps","slots","slotProps","transformOrigin","TransitionComponent","transitionDuration","TransitionProps","disableScrollLock"],K3=["slotProps"];function wi(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.height/2:t==="bottom"&&(n=e.height),n}function Ei(e,t){let n=0;return typeof t=="number"?n=t:t==="center"?n=e.width/2:t==="right"&&(n=e.width),n}function Si(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function Mt(e){return typeof e=="function"?e():e}const q3=e=>{const{classes:t}=e;return _e({root:["root"],paper:["paper"]},Z3,t)},Y3=D0(I3,{name:"MuiPopover",slot:"Root",overridesResolver:(e,t)=>t.root})({}),X3=D0(f2,{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}),Q3=h.forwardRef(function(t,n){var i,r,o;const a=Ae({props:t,name:"MuiPopover"}),{action:s,anchorEl:l,anchorOrigin:u={vertical:"top",horizontal:"left"},anchorPosition:d,anchorReference:f="anchorEl",children:m,className:k,container:p,elevation:g=8,marginThreshold:C=16,open:x,PaperProps:y={},slots:b,slotProps:w,transformOrigin:E={vertical:"top",horizontal:"left"},TransitionComponent:S=z3,transitionDuration:A="auto",TransitionProps:{onEntering:_}={},disableScrollLock:G=!1}=a,B=I1(a.TransitionProps,U3),D=I1(a,W3),V=(i=w==null?void 0:w.paper)!=null?i:y,R=h.useRef(),P=B0(R,V.ref),$=F({},a,{anchorOrigin:u,anchorReference:f,elevation:g,marginThreshold:C,externalPaperSlotProps:V,transformOrigin:E,TransitionComponent:S,transitionDuration:A,TransitionProps:B}),j=q3($),L=h.useCallback(()=>{if(f==="anchorPosition")return d;const Y=Mt(l),a1=(Y&&Y.nodeType===1?Y:Y1(R.current).body).getBoundingClientRect();return{top:a1.top+wi(a1,u.vertical),left:a1.left+Ei(a1,u.horizontal)}},[l,u.horizontal,u.vertical,d,f]),Z=h.useCallback(Y=>({vertical:wi(Y,E.vertical),horizontal:Ei(Y,E.horizontal)}),[E.horizontal,E.vertical]),U=h.useCallback(Y=>{const r1={width:Y.offsetWidth,height:Y.offsetHeight},a1=Z(r1);if(f==="none")return{top:null,left:null,transformOrigin:Si(a1)};const Z1=L();let U1=Z1.top-a1.vertical,W1=Z1.left-a1.horizontal;const G0=U1+r1.height,C0=W1+r1.width,K1=ke(Mt(l)),Le=K1.innerHeight-C,O=K1.innerWidth-C;if(C!==null&&U1Le){const I=G0-Le;U1-=I,a1.vertical+=I}if(C!==null&&W1O){const I=C0-O;W1-=I,a1.horizontal+=I}return{top:`${Math.round(U1)}px`,left:`${Math.round(W1)}px`,transformOrigin:Si(a1)}},[l,f,L,Z,C]),[J,W]=h.useState(x),M=h.useCallback(()=>{const Y=R.current;if(!Y)return;const r1=U(Y);r1.top!==null&&(Y.style.top=r1.top),r1.left!==null&&(Y.style.left=r1.left),Y.style.transformOrigin=r1.transformOrigin,W(!0)},[U]);h.useEffect(()=>(G&&window.addEventListener("scroll",M),()=>window.removeEventListener("scroll",M)),[l,G,M]);const Q=(Y,r1)=>{_&&_(Y,r1),M()},e1=()=>{W(!1)};h.useEffect(()=>{x&&M()}),h.useImperativeHandle(s,()=>x?{updatePosition:()=>{M()}}:null,[x,M]),h.useEffect(()=>{if(!x)return;const Y=i2(()=>{M()}),r1=ke(l);return r1.addEventListener("resize",Y),()=>{Y.clear(),r1.removeEventListener("resize",Y)}},[l,x,M]);let X=A;A==="auto"&&!S.muiSupportAuto&&(X=void 0);const d1=p||(l?Y1(Mt(l)).body:void 0),S1=(r=b==null?void 0:b.root)!=null?r:Y3,A1=(o=b==null?void 0:b.paper)!=null?o:X3,j1=Ye({elementType:A1,externalSlotProps:F({},V,{style:J?V.style:F({},V.style,{opacity:0})}),additionalProps:{elevation:g,ref:P},ownerState:$,className:S0(j.paper,V==null?void 0:V.className)}),R1=Ye({elementType:S1,externalSlotProps:(w==null?void 0:w.root)||{},externalForwardedProps:D,additionalProps:{ref:n,slotProps:{backdrop:{invisible:!0}},container:d1,open:x},ownerState:$,className:S0(j.root,k)}),{slotProps:d0}=R1,f0=I1(R1,K3);return c.jsx(S1,F({},f0,!uo(S1)&&{slotProps:d0,disableScrollLock:G},{children:c.jsx(S,F({appear:!0,in:x,onEntering:Q,onExited:e1,timeout:X},B,{children:c.jsx(A1,F({},j1,{children:m}))}))}))}),J3=Q3;function e5(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Eo(...e){return t=>e.forEach(n=>e5(n,t))}function X0(...e){return h.useCallback(Eo(...e),e)}const So=h.forwardRef((e,t)=>{const{children:n,...i}=e,r=h.Children.toArray(n),o=r.find(t5);if(o){const a=o.props.children,s=r.map(l=>l===o?h.Children.count(a)>1?h.Children.only(null):h.isValidElement(a)?a.props.children:null:l);return h.createElement(tn,F({},i,{ref:t}),h.isValidElement(a)?h.cloneElement(a,void 0,s):null)}return h.createElement(tn,F({},i,{ref:t}),n)});So.displayName="Slot";const tn=h.forwardRef((e,t)=>{const{children:n,...i}=e;return h.isValidElement(n)?h.cloneElement(n,{...n5(i,n.props),ref:t?Eo(t,n.ref):n.ref}):h.Children.count(n)>1?h.Children.only(null):null});tn.displayName="SlotClone";const Ao=({children:e})=>h.createElement(h.Fragment,null,e);function t5(e){return h.isValidElement(e)&&e.type===Ao}function n5(e,t){const n={...t};for(const i in t){const r=e[i],o=t[i];/^on[A-Z]/.test(i)?r&&o?n[i]=(...s)=>{o(...s),r(...s)}:r&&(n[i]=r):i==="style"?n[i]={...r,...o}:i==="className"&&(n[i]=[r,o].filter(Boolean).join(" "))}return{...e,...n}}const i5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],j0=i5.reduce((e,t)=>{const n=h.forwardRef((i,r)=>{const{asChild:o,...a}=i,s=o?So:t;return h.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),h.createElement(s,F({},a,{ref:r}))});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function r5(e,t){e&&pt.flushSync(()=>e.dispatchEvent(t))}const o5=h.forwardRef((e,t)=>{var n;const{container:i=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...r}=e;return i?F0.createPortal(h.createElement(j0.div,F({},r,{ref:t})),i):null}),a5=o5;var Ai=Object.prototype.hasOwnProperty;function ye(e,t){var n,i;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((i=e.length)===t.length)for(;i--&&ye(e[i],t[i]););return i===-1}if(!n||typeof e=="object"){i=0;for(n in e)if(Ai.call(e,n)&&++i&&!Ai.call(t,n)||!(n in t)||!ye(e[n],t[n]))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}function De(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 i=0;i0;)a[s]=arguments[s+4];e.call(this,a),e.captureStackTrace&&e.captureStackTrace(this,t),this.rule=n,this.value=i,this.cause=r,this.target=o}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error),Q1=function(t,n){t===void 0&&(t=[]),n===void 0&&(n=[]),this.chain=t,this.nextRuleModifiers=n};Q1.prototype._applyRule=function(t,n){var i=this;return function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return i.chain.push(new yt(n,t.apply(i,r),r,i.nextRuleModifiers)),i.nextRuleModifiers=[],i}};Q1.prototype._applyModifier=function(t,n){return this.nextRuleModifiers.push(new s5(n,t.simple,t.async)),this};Q1.prototype._clone=function(){return new Q1(this.chain.slice(),this.nextRuleModifiers.slice())};Q1.prototype.test=function(t){return this.chain.every(function(n){return n._test(t)})};Q1.prototype.testAll=function(t){var n=[];return this.chain.forEach(function(i){try{i._check(t)}catch(r){n.push(new Mn(i,t,r))}}),n};Q1.prototype.check=function(t){this.chain.forEach(function(n){try{n._check(t)}catch(i){throw new Mn(n,t,i)}})};Q1.prototype.testAsync=function(t){var n=this;return new Promise(function(i,r){Do(t,n.chain.slice(),i,r)})};function Do(e,t,n,i){if(t.length){var r=t.shift();r._testAsync(e).then(function(){Do(e,t,n,i)},function(o){i(new Mn(r,e,o))})}else n(e)}var _i=function(e,t){return t&&typeof e=="string"&&e.trim().length===0?!0:e==null};function l5(e,t){return t===void 0&&(t=!1),{simple:function(n){return _i(n,t)||e.check(n)===void 0},async:function(n){return _i(n,t)||e.testAsync(n)}}}function D1(){return typeof Proxy<"u"?Bo(new Q1):nn(new Q1)}var be={};D1.extend=function(e){Object.assign(be,e)};D1.clearCustomRules=function(){be={}};function Bo(e){return new Proxy(e,{get:function(n,i){if(i in n)return n[i];var r=Bo(e._clone());if(i in tt)return r._applyModifier(tt[i],i);if(i in be)return r._applyRule(be[i],i);if(i in rn)return r._applyRule(rn[i],i)}})}function nn(e){var t=function(r,o){return Object.keys(r).forEach(function(a){o[a]=function(){for(var s=[],l=arguments.length;l--;)s[l]=arguments[l];var u=nn(o._clone()),d=u._applyRule(r[a],a).apply(void 0,s);return d}}),o},n=t(rn,e),i=t(be,n);return Object.keys(tt).forEach(function(r){Object.defineProperty(i,r,{get:function(){var o=nn(i._clone());return o._applyModifier(tt[r],r)}})}),i}var tt={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 Re(t).some(function(n){try{return e(n)}catch{return!1}})}},async:function(e){return function(t){return Promise.all(Re(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&&Re(t).every(e)}},async:function(e){return function(t){return Promise.all(Re(t).map(e)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(e,t){return function(n){return Vi(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(i){return Vi(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&i:i}).catch(function(){return!1})}}}};function Vi(e){return e&&e.name==="schema"&&e.args.length>0&&typeof e.args[0]=="object"}function Re(e){return typeof e=="string"?e.split(""):e}var rn={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||c5;return t(e)}},numeric:function(){return function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},string:function(){return L0("string")},boolean:function(){return L0("boolean")},undefined:function(){return L0("undefined")},null:function(){return L0("null")},array:function(){return L0("array")},object:function(){return L0("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 u5(e)},passesAnyOf:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(n){return e.some(function(i){return i.test(n)})}},optional:l5};function L0(e){return function(t){return Array.isArray(t)&&e==="array"||t===null&&e==="null"||typeof t===e}}function c5(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function u5(e){return{simple:function(t){var n=[];if(Object.keys(e).forEach(function(i){var r=e[i];try{r.check((t||{})[i])}catch(o){o.target=i,n.push(o)}}),n.length>0)throw n;return!0},async:function(t){var n=[],i=Object.keys(e).map(function(r){var o=e[r];return o.testAsync((t||{})[r]).catch(function(a){a.target=r,n.push(a)})});return Promise.all(i).then(function(){if(n.length>0)throw n;return!0})}}}var t1="colors",g1="sizes",T="space",d5={gap:T,gridGap:T,columnGap:T,gridColumnGap:T,rowGap:T,gridRowGap:T,inset:T,insetBlock:T,insetBlockEnd:T,insetBlockStart:T,insetInline:T,insetInlineEnd:T,insetInlineStart:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,marginBlock:T,marginBlockEnd:T,marginBlockStart:T,marginInline:T,marginInlineEnd:T,marginInlineStart:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,paddingBlock:T,paddingBlockEnd:T,paddingBlockStart:T,paddingInline:T,paddingInlineEnd:T,paddingInlineStart:T,top:T,right:T,bottom:T,left:T,scrollMargin:T,scrollMarginTop:T,scrollMarginRight:T,scrollMarginBottom:T,scrollMarginLeft:T,scrollMarginX:T,scrollMarginY:T,scrollMarginBlock:T,scrollMarginBlockEnd:T,scrollMarginBlockStart:T,scrollMarginInline:T,scrollMarginInlineEnd:T,scrollMarginInlineStart:T,scrollPadding:T,scrollPaddingTop:T,scrollPaddingRight:T,scrollPaddingBottom:T,scrollPaddingLeft:T,scrollPaddingX:T,scrollPaddingY:T,scrollPaddingBlock:T,scrollPaddingBlockEnd:T,scrollPaddingBlockStart:T,scrollPaddingInline:T,scrollPaddingInlineEnd:T,scrollPaddingInlineStart:T,fontSize:"fontSizes",background:t1,backgroundColor:t1,backgroundImage:t1,borderImage:t1,border:t1,borderBlock:t1,borderBlockEnd:t1,borderBlockStart:t1,borderBottom:t1,borderBottomColor:t1,borderColor:t1,borderInline:t1,borderInlineEnd:t1,borderInlineStart:t1,borderLeft:t1,borderLeftColor:t1,borderRight:t1,borderRightColor:t1,borderTop:t1,borderTopColor:t1,caretColor:t1,color:t1,columnRuleColor:t1,fill:t1,outline:t1,outlineColor:t1,stroke:t1,textDecorationColor:t1,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:g1,minBlockSize:g1,maxBlockSize:g1,inlineSize:g1,minInlineSize:g1,maxInlineSize:g1,width:g1,minWidth:g1,maxWidth:g1,height:g1,minHeight:g1,maxHeight:g1,flexBasis:g1,gridTemplateColumns:g1,gridTemplateRows:g1,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"},f5=(e,t)=>typeof t=="function"?{"()":Function.prototype.toString.call(t)}:t,Q0=()=>{const e=Object.create(null);return(t,n,...i)=>{const r=(o=>JSON.stringify(o,f5))(t);return r in e?e[r]:e[r]=n(t,...i)}},w0=Symbol.for("sxs.internal"),Ln=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),Di=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:h5}=Object.prototype,on=e=>e.includes("-")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase()),m5=/\s+(?![^()]*\))/,O0=e=>t=>e(...typeof t=="string"?String(t).split(m5):[t]),Bi={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:O0((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e})),marginInline:O0((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e})),maxSize:O0((e,t)=>({maxBlockSize:e,maxInlineSize:t||e})),minSize:O0((e,t)=>({minBlockSize:e,minInlineSize:t||e})),paddingBlock:O0((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e})),paddingInline:O0((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e}))},Lt=/([\d.]+)([^]*)/,p5=(e,t)=>e.length?e.reduce((n,i)=>(n.push(...t.map(r=>r.includes("&")?r.replace(/&/g,/[ +>|~]/.test(i)&&/&.*&/.test(r)?`:is(${i})`:i):i+" "+r)),n),[]):t,x5=(e,t)=>e in k5&&typeof t=="string"?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(n,i,r,o)=>i+(r==="stretch"?`-moz-available${o};${on(e)}:${i}-webkit-fill-available`:`-moz-fit-content${o};${on(e)}:${i}fit-content`)+o):String(t),k5={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},s0=e=>e?e+"-":"",jo=(e,t,n)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(i,r,o,a,s)=>a=="$"==!!o?i:(r||a=="--"?"calc(":"")+"var(--"+(a==="$"?s0(t)+(s.includes("$")?"":s0(n))+s.replace(/\$/g,"-"):s)+")"+(r||a=="--"?"*"+(r||"")+(o||"1")+")":"")),g5=/\s*,\s*(?![^()]*\))/,C5=Object.prototype.toString,I0=(e,t,n,i,r)=>{let o,a,s;const l=(u,d,f)=>{let m,k;const p=g=>{for(m in g){const y=m.charCodeAt(0)===64,b=y&&Array.isArray(g[m])?g[m]:[g[m]];for(k of b){const w=/[A-Z]/.test(x=m)?x:x.replace(/-[^]/g,S=>S[1].toUpperCase()),E=typeof k=="object"&&k&&k.toString===C5&&(!i.utils[w]||!d.length);if(w in i.utils&&!E){const S=i.utils[w];if(S!==a){a=S,p(S(k)),a=null;continue}}else if(w in Bi){const S=Bi[w];if(S!==s){s=S,p(S(k)),s=null;continue}}if(y&&(C=m.slice(1)in i.media?"@media "+i.media[m.slice(1)]:m,m=C.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(S,A,_,G,B,D)=>{const V=Lt.test(A),R=.0625*(V?-1:1),[P,$]=V?[G,A]:[A,G];return"("+(_[0]==="="?"":_[0]===">"===V?"max-":"min-")+P+":"+(_[0]!=="="&&_.length===1?$.replace(Lt,(j,L,Z)=>Number(L)+R*(_===">"?1:-1)+Z):$)+(B?") and ("+(B[0]===">"?"min-":"max-")+P+":"+(B.length===1?D.replace(Lt,(j,L,Z)=>Number(L)+R*(B===">"?-1:1)+Z):D):"")+")"})),E){const S=y?f.concat(m):[...f],A=y?[...d]:p5(d,m.split(g5));o!==void 0&&r(ji(...o)),o=void 0,l(k,A,S)}else o===void 0&&(o=[[],d,f]),m=y||m.charCodeAt(0)!==36?m:`--${s0(i.prefix)}${m.slice(1).replace(/\$/g,"-")}`,k=E?k:typeof k=="number"?k&&w in y5?String(k)+"px":String(k):jo(x5(w,k??""),i.prefix,i.themeMap[w]),o[0].push(`${y?`${m} `:`${on(m)}:`}${k}`)}}var C,x};p(u),o!==void 0&&r(ji(...o)),o=void 0};l(e,t,n)},ji=(e,t,n)=>`${n.map(i=>`${i}{`).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,y5={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},$i=e=>String.fromCharCode(e+(e>25?39:97)),E0=e=>(t=>{let n,i="";for(n=Math.abs(t);n>52;n=n/52|0)i=$i(n%52)+i;return $i(n%52)+i})(((t,n)=>{let i=n.length;for(;i;)t=33*t^n.charCodeAt(--i);return t})(5381,JSON.stringify(e))>>>0),ue=["themed","global","styled","onevar","resonevar","allvar","inline"],b5=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch{return!1}},v5=e=>{let t;const n=()=>{const{cssRules:r}=t.sheet;return[].map.call(r,(o,a)=>{const{cssText:s}=o;let l="";if(s.startsWith("--sxs"))return"";if(r[a-1]&&(l=r[a-1].cssText).startsWith("--sxs")){if(!o.cssRules.length)return"";for(const u in t.rules)if(t.rules[u].group===o)return`--sxs{--sxs:${[...t.rules[u].cache].join(" ")}}${s}`;return o.cssRules.length?`${l}${s}`:""}return s}).join("")},i=()=>{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 u in s)delete s[u]}const r=Object(e).styleSheets||[];for(const s of r)if(b5(s)){for(let l=0,u=s.cssRules;u[l];++l){const d=Object(u[l]);if(d.type!==1)continue;const f=Object(u[l+1]);if(f.type!==4)continue;++l;const{cssText:m}=d;if(!m.startsWith("--sxs"))continue;const k=m.slice(14,-3).trim().split(/\s+/),p=ue[k[0]];p&&(t||(t={sheet:s,reset:i,rules:{},toString:n}),t.rules[p]={group:f,index:l,cache:new Set(k)})}if(t)break}if(!t){const s=(l,u)=>({type:u,cssRules:[],insertRule(d,f){this.cssRules.splice(f,0,s(d,{import:3,undefined:1}[(d.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return l==="@media{}"?`@media{${[].map.call(this.cssRules,d=>d.cssText).join("")}}`:l}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:s("","text/css"),rules:{},reset:i,toString:n}}const{sheet:o,rules:a}=t;for(let s=ue.length-1;s>=0;--s){const l=ue[s];if(!a[l]){const u=ue[s+1],d=a[u]?a[u].index:o.cssRules.length;o.insertRule("@media{}",d),o.insertRule(`--sxs{--sxs:${s}}`,d),a[l]={group:o.cssRules[d+1],index:d,cache:new Set([s])}}w5(a[l])}};return i(),t},w5=e=>{const t=e.group;let n=t.cssRules.length;e.apply=i=>{try{t.insertRule(i,n),++n}catch{}}},re=Symbol(),E5=Q0(),Gi=(e,t)=>E5(e,()=>(...n)=>{let i={type:null,composers:new Set};for(const r of n)if(r!=null)if(r[w0]){i.type==null&&(i.type=r[w0].type);for(const o of r[w0].composers)i.composers.add(o)}else r.constructor!==Object||r.$$typeof?i.type==null&&(i.type=r):i.composers.add(S5(r,e));return i.type==null&&(i.type="span"),i.composers.size||i.composers.add(["PJLV",{},[],[],{},[]]),A5(e,i,t)}),S5=({variants:e,compoundVariants:t,defaultVariants:n,...i},r)=>{const o=`${s0(r.prefix)}c-${E0(i)}`,a=[],s=[],l=Object.create(null),u=[];for(const m in n)l[m]=String(n[m]);if(typeof e=="object"&&e)for(const m in e){d=l,f=m,h5.call(d,f)||(l[m]="undefined");const k=e[m];for(const p in k){const g={[m]:String(p)};String(p)==="undefined"&&u.push(m);const C=k[p],x=[g,C,!Di(C)];a.push(x)}}var d,f;if(typeof t=="object"&&t)for(const m of t){let{css:k,...p}=m;k=typeof k=="object"&&k||{};for(const C in p)p[C]=String(p[C]);const g=[p,k,!Di(k)];s.push(g)}return[o,i,a,s,l,u]},A5=(e,t,n)=>{const[i,r,o,a]=_5(t.composers),s=typeof t.type=="function"||t.type.$$typeof?(f=>{function m(){for(let k=0;km.rules[k]={apply:p=>m[re].push([k,p])}),m})(n):null,l=(s||n).rules,u=`.${i}${r.length>1?`:where(.${r.slice(1).join(".")})`:""}`,d=f=>{f=typeof f=="object"&&f||V5;const{css:m,...k}=f,p={};for(const x in o)if(delete k[x],x in f){let y=f[x];typeof y=="object"&&y?p[x]={"@initial":o[x],...y}:(y=String(y),p[x]=y!=="undefined"||a.has(x)?y:o[x])}else p[x]=o[x];const g=new Set([...r]);for(const[x,y,b,w]of t.composers){n.rules.styled.cache.has(x)||(n.rules.styled.cache.add(x),I0(y,[`.${x}`],[],e,A=>{l.styled.apply(A)}));const E=Pi(b,p,e.media),S=Pi(w,p,e.media,!0);for(const A of E)if(A!==void 0)for(const[_,G,B]of A){const D=`${x}-${E0(G)}-${_}`;g.add(D);const V=(B?n.rules.resonevar:n.rules.onevar).cache,R=B?l.resonevar:l.onevar;V.has(D)||(V.add(D),I0(G,[`.${D}`],[],e,P=>{R.apply(P)}))}for(const A of S)if(A!==void 0)for(const[_,G]of A){const B=`${x}-${E0(G)}-${_}`;g.add(B),n.rules.allvar.cache.has(B)||(n.rules.allvar.cache.add(B),I0(G,[`.${B}`],[],e,D=>{l.allvar.apply(D)}))}}if(typeof m=="object"&&m){const x=`${i}-i${E0(m)}-css`;g.add(x),n.rules.inline.cache.has(x)||(n.rules.inline.cache.add(x),I0(m,[`.${x}`],[],e,y=>{l.inline.apply(y)}))}for(const x of String(f.className||"").trim().split(/\s+/))x&&g.add(x);const C=k.className=[...g].join(" ");return{type:t.type,className:C,selector:u,props:k,toString:()=>C,deferredInjector:s}};return Ln(d,{className:i,selector:u,[w0]:t,toString:()=>(n.rules.styled.cache.has(i)||d(),i)})},_5=e=>{let t="";const n=[],i={},r=[];for(const[o,,,,a,s]of e){t===""&&(t=o),n.push(o),r.push(...s);for(const l in a){const u=a[l];(i[l]===void 0||u!=="undefined"||s.includes(u))&&(i[l]=u)}}return[t,n,i,new Set(r)]},Pi=(e,t,n,i)=>{const r=[];e:for(let[o,a,s]of e){if(s)continue;let l,u=0,d=!1;for(l in o){const f=o[l];let m=t[l];if(m!==f){if(typeof m!="object"||!m)continue e;{let k,p,g=0;for(const C in m){if(f===String(m[C])){if(C!=="@initial"){const x=C.slice(1);(p=p||[]).push(x in n?n[x]:C.replace(/^@media ?/,"")),d=!0}u+=g,k=!0}++g}if(p&&p.length&&(a={["@media "+p.join(", ")]:a}),!k)continue e}}}(r[u]=r[u]||[]).push([i?"cv":`${l}-${o[l]}`,a,d])}return r},V5={},D5=Q0(),B5=(e,t)=>D5(e,()=>(...n)=>{const i=()=>{for(let r of n){r=typeof r=="object"&&r||{};let o=E0(r);if(!t.rules.global.cache.has(o)){if(t.rules.global.cache.add(o),"@import"in r){let a=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let s of[].concat(r["@import"]))s=s.includes('"')||s.includes("'")?s:`"${s}"`,t.sheet.insertRule(`@import ${s};`,a++);delete r["@import"]}I0(r,[],[],e,a=>{t.rules.global.apply(a)})}}return""};return Ln(i,{toString:i})}),j5=Q0(),$5=(e,t)=>j5(e,()=>n=>{const i=`${s0(e.prefix)}k-${E0(n)}`,r=()=>{if(!t.rules.global.cache.has(i)){t.rules.global.cache.add(i);const o=[];I0(n,[],[],e,s=>o.push(s));const a=`@keyframes ${i}{${o.join("")}}`;t.rules.global.apply(a)}return i};return Ln(r,{get name(){return r()},toString:r})}),G5=class{constructor(e,t,n,i){this.token=e==null?"":String(e),this.value=t==null?"":String(t),this.scale=n==null?"":String(n),this.prefix=i==null?"":String(i)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+s0(this.prefix)+s0(this.scale)+this.token}toString(){return this.computedValue}},P5=Q0(),M5=(e,t)=>P5(e,()=>(n,i)=>{i=typeof n=="object"&&n||Object(i);const r=`.${n=(n=typeof n=="string"?n:"")||`${s0(e.prefix)}t-${E0(i)}`}`,o={},a=[];for(const l in i){o[l]={};for(const u in i[l]){const d=`--${s0(e.prefix)}${l}-${u}`,f=jo(String(i[l][u]),e.prefix,l);o[l][u]=new G5(u,f,l,e.prefix),a.push(`${d}:${f}`)}}const s=()=>{if(a.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);const l=`${i===e.theme?":root,":""}.${n}{${a.join(";")}}`;t.rules.themed.apply(l)}return n};return{...o,get className(){return s()},selector:r,toString:s}}),L5=Q0(),Mi,O5=Q0(),$o=e=>{const t=(n=>{let i=!1;const r=L5(n,o=>{i=!0;const a="prefix"in(o=typeof o=="object"&&o||{})?String(o.prefix):"",s=typeof o.media=="object"&&o.media||{},l=typeof o.root=="object"?o.root||null:globalThis.document||null,u=typeof o.theme=="object"&&o.theme||{},d={prefix:a,media:s,theme:u,themeMap:typeof o.themeMap=="object"&&o.themeMap||{...d5},utils:typeof o.utils=="object"&&o.utils||{}},f=v5(l),m={css:Gi(d,f),globalCss:B5(d,f),keyframes:$5(d,f),createTheme:M5(d,f),reset(){f.reset(),m.theme.toString()},theme:{},sheet:f,config:d,prefix:a,getCssText:f.toString,toString:f.toString};return String(m.theme=m.createTheme(u)),m});return i||r.reset(),r})(e);return t.styled=(({config:n,sheet:i})=>O5(n,()=>{const r=Gi(n,i);return(...o)=>{const a=r(...o),s=a[w0].type,l=v.forwardRef((u,d)=>{const f=u&&u.as||s,{props:m,deferredInjector:k}=a(u);return delete m.as,m.ref=d,k?v.createElement(v.Fragment,null,v.createElement(f,m),v.createElement(k,null)):v.createElement(f,m)});return l.className=a.className,l.displayName=`Styled.${s.displayName||s.name||s}`,l.selector=a.selector,l.toString=()=>a.selector,l[w0]=a[w0],l}}))(t),t},T5=()=>Mi||(Mi=$o()),Xm=(...e)=>T5().styled(...e);function R5(e,t,n){return Math.max(t,Math.min(e,n))}const p1={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 Li(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function Oi(e,t,n,i=.15){return i===0?R5(e,t,n):en?+Li(e-n,n-t,i)+n:e}function F5(e,[t,n],[i,r]){const[[o,a],[s,l]]=e;return[Oi(t,o,a,i),Oi(n,s,l,r)]}function I5(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var i=n.call(e,t||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function H5(e){var t=I5(e,"string");return typeof t=="symbol"?t:String(t)}function V1(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 Ti(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function c1(e){for(var t=1;t{var n,i;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(i=n.contains)===null||i===void 0?void 0:i.call(n,t.target))})}function Y5(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function Mo(e){return bt(e)?Y5(e)[0]:e}function X5(e){return q5(e).map(t=>t.identifier)}function Ot(e){const t=Mo(e);return bt(e)?t.identifier:t.pointerId}function Fi(e){const t=Mo(e);return[t.clientX,t.clientY]}function Q5(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:i,metaKey:r,ctrlKey:o}=e;Object.assign(t,{shiftKey:n,altKey:i,metaKey:r,ctrlKey:o})}return t}function nt(e,...t){return typeof e=="function"?e(...t):e}function J5(){}function el(...e){return e.length===0?J5:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function Ii(e,t){return Object.assign({},t,e||{})}const tl=32;class nl{constructor(t,n,i){this.ctrl=t,this.args=n,this.key=i,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:i,args:r}=this;n[i]=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=r,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,i=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=i.from?nt(i.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:i,shared:r}=this;n.args=this.args;let o=0;if(t&&(n.event=t,i.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,r.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,r.locked=!!document.pointerLockElement,Object.assign(r,Q5(t)),r.down=r.pressed=r.buttons%2===1||r.touches>0,o=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const S=n._delta.map(Math.abs);p1.addTo(n._distance,S)}this.axisIntent&&this.axisIntent(t);const[a,s]=n._movement,[l,u]=i.threshold,{_step:d,values:f}=n;if(i.hasCustomTransform?(d[0]===!1&&(d[0]=Math.abs(a)>=l&&f[0]),d[1]===!1&&(d[1]=Math.abs(s)>=u&&f[1])):(d[0]===!1&&(d[0]=Math.abs(a)>=l&&Math.sign(a)*l),d[1]===!1&&(d[1]=Math.abs(s)>=u&&Math.sign(s)*u)),n.intentional=d[0]!==!1||d[1]!==!1,!n.intentional)return;const m=[0,0];if(i.hasCustomTransform){const[S,A]=f;m[0]=d[0]!==!1?S-d[0]:0,m[1]=d[1]!==!1?A-d[1]:0}else m[0]=d[0]!==!1?a-d[0]:0,m[1]=d[1]!==!1?s-d[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(m);const k=n.offset,p=n._active&&!n._blocked||n.active;p&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=r[this.ingKey]=n._active,t&&(n.first&&("bounds"in i&&(n._bounds=nt(i.bounds,n)),this.setup&&this.setup()),n.movement=m,this.computeOffset()));const[g,C]=n.offset,[[x,y],[b,w]]=n._bounds;n.overflow=[gy?1:0,Cw?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 E=n._active?i.rubberband||[0,0]:[0,0];if(n.offset=F5(n._bounds,n.offset,E),n.delta=p1.sub(n.offset,k),this.computeMovement(),p&&(!n.last||o>tl)){n.delta=p1.sub(n.offset,k);const S=n.delta.map(Math.abs);p1.addTo(n.distance,S),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&o>0&&(n.velocity=[S[0]/o,S[1]/o],n.timeDelta=o)}}emit(){const t=this.state,n=this.shared,i=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!i.triggerAllEvents)return;const r=this.handler(c1(c1(c1({},n),t),{},{[this.aliasKey]:t.values}));r!==void 0&&(t.memo=r)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function il([e,t],n){const i=Math.abs(e),r=Math.abs(t);if(i>r&&i>n)return"x";if(r>i&&r>n)return"y"}class rl extends nl{constructor(...t){super(...t),V1(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=p1.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=p1.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,i=this.config;if(!n.axis&&t){const r=typeof i.axisThreshold=="object"?i.axisThreshold[Po(t)]:i.axisThreshold;n.axis=il(n._movement,r)}n._blocked=(i.lockDirection||!!i.axis)&&!n.axis||!!i.axis&&i.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 ol=e=>e,Hi=.15,Lo={enabled(e=!0){return e},eventOptions(e,t,n){return c1(c1({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[Hi,Hi];case!1:return[0,0];default:return p1.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return p1.toVector(e)},transform(e,t,n){const i=e||n.shared.transform;return this.hasCustomTransform=!!i,i||ol},threshold(e){return p1.toVector(e,0)}},al=0,Be=c1(c1({},Lo),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=al){return e},bounds(e={}){if(typeof e=="function")return o=>Be.bounds(e(o));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:i=-1/0,bottom:r=1/0}=e;return[[t,n],[i,r]]}}),Ni={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 sl extends rl{constructor(...t){super(...t),V1(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(),i=t.currentTarget.getBoundingClientRect(),r={left:n.left-i.left+t.offset[0],right:n.right-i.right+t.offset[0],top:n.top-i.top+t.offset[1],bottom:n.bottom-i.bottom+t.offset[1]};t._bounds=Be.bounds(r)}}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,i=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const r=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(r&&r.size>1&&i._pointerActive)&&(this.start(t),this.setupPointer(t),i._pointerId=Ot(t),i._pointerActive=!0,this.computeValues(Fi(t)),this.computeInitial(),n.preventScrollAxis&&Po(t)!=="mouse"?(i._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,i=this.config;if(!n._pointerActive)return;const r=Ot(t);if(n._pointerId!==void 0&&r!==n._pointerId)return;const o=Fi(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=p1.sub(o,n._values),this.computeValues(o)),p1.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(i.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===i.preventScrollAxis||i.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,i=this.config;if(!n._active||!n._pointerActive)return;const r=Ot(t);if(n._pointerId!==void 0&&r!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[o,a]=n._distance;if(n.tap=o<=i.tapsThreshold&&a<=i.tapsThreshold,n.tap&&i.filterTaps)n._force=!0;else{const[s,l]=n._delta,[u,d]=n._movement,[f,m]=i.swipe.velocity,[k,p]=i.swipe.distance,g=i.swipe.duration;if(n.elapsedTimef&&Math.abs(u)>k&&(n.swipe[0]=Math.sign(s)),x>m&&Math.abs(d)>p&&(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,i=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"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,ll(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=Ni[t.key];if(n){const i=this.state,r=t.shiftKey?10:t.altKey?.1:1;this.start(t),i._delta=n(this.config.keyboardDisplacement,r),i._keyboardActive=!0,p1.addTo(i._movement,i._delta),this.compute(t),this.emit()}}keyUp(t){t.key in Ni&&(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 ll(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const je=typeof window<"u"&&window.document&&window.document.createElement;function Oo(){return je&&"ontouchstart"in window}function cl(){return Oo()||je&&window.navigator.maxTouchPoints>1}function ul(){return je&&"onpointerdown"in window}function dl(){return je&&"exitPointerLock"in window.document}function fl(){try{return"constructor"in GestureEvent}catch{return!1}}const P1={isBrowser:je,gesture:fl(),touch:Oo(),touchscreen:cl(),pointer:ul(),pointerLock:dl()},hl=250,ml=180,pl=.5,xl=50,kl=250,gl=10,zi={mouse:0,touch:0,pen:8},Cl=c1(c1({},Be),{},{device(e,t,{pointer:{touch:n=!1,lock:i=!1,mouse:r=!1}={}}){return this.pointerLock=i&&P1.pointerLock,P1.touch&&n?"touch":this.pointerLock?"mouse":P1.pointer&&!r?"pointer":P1.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?hl:void 0,!(!P1.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:i=1,keys:r=!0}={}}){return this.pointerButtons=i,this.keys=r,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:i=3,axis:r=void 0}){const o=p1.toVector(e,n?i:r?1:0);return this.filterTaps=n,this.tapsThreshold=i,o},swipe({velocity:e=pl,distance:t=xl,duration:n=kl}={}){return{velocity:this.transform(p1.toVector(e)),distance:this.transform(p1.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return ml;case!1:return 0;default:return e}},axisThreshold(e){return e?c1(c1({},zi),e):zi},keyboardDisplacement(e=gl){return e}});c1(c1({},Lo),{},{device(e,t,{shared:n,pointer:{touch:i=!1}={}}){if(n.target&&!P1.touch&&P1.gesture)return"gesture";if(P1.touch&&i)return"touch";if(P1.touchscreen){if(P1.pointer)return"pointer";if(P1.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:i={}}){const r=a=>{const s=Ii(nt(n,a),{min:-1/0,max:1/0});return[s.min,s.max]},o=a=>{const s=Ii(nt(i,a),{min:-1/0,max:1/0});return[s.min,s.max]};return typeof n!="function"&&typeof i!="function"?[r(),o()]:a=>[r(a),o(a)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",p1.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});c1(c1({},Be),{},{mouseOnly:(e=!0)=>e});c1(c1({},Be),{},{mouseOnly:(e=!0)=>e});const To=new Map,an=new Map;function yl(e){To.set(e.key,e.engine),an.set(e.key,e.resolver)}const bl={key:"drag",engine:sl,resolver:Cl};function vl(e,t){if(e==null)return{};var n={},i=Object.keys(e),r,o;for(o=0;o=0)&&(n[r]=e[r]);return n}function wl(e,t){if(e==null)return{};var n=vl(e,t),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}const El={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=P1.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},Sl=["target","eventOptions","window","enabled","transform"];function Ue(e={},t){const n={};for(const[i,r]of Object.entries(t))switch(typeof r){case"function":n[i]=r.call(n,e[i],i,e);break;case"object":n[i]=Ue(e[i],r);break;case"boolean":r&&(n[i]=e[i]);break}return n}function Al(e,t,n={}){const i=e,{target:r,eventOptions:o,window:a,enabled:s,transform:l}=i,u=wl(i,Sl);if(n.shared=Ue({target:r,eventOptions:o,window:a,enabled:s,transform:l},El),t){const d=an.get(t);n[t]=Ue(c1({shared:n.shared},u),d)}else for(const d in u){const f=an.get(d);f&&(n[d]=Ue(c1({shared:n.shared},u[d]),f))}return n}class Ro{constructor(t,n){V1(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,i,r,o){const a=this._listeners,s=K5(n,i),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},u=c1(c1({},l),o);t.addEventListener(s,r,u);const d=()=>{t.removeEventListener(s,r,u),a.delete(d)};return a.add(d),d}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class _l{constructor(){V1(this,"_timeouts",new Map)}add(t,n,i=140,...r){this.remove(t),this._timeouts.set(t,window.setTimeout(n,i,...r))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class Vl{constructor(t){V1(this,"gestures",new Set),V1(this,"_targetEventStore",new Ro(this)),V1(this,"gestureEventStores",{}),V1(this,"gestureTimeoutStores",{}),V1(this,"handlers",{}),V1(this,"config",{}),V1(this,"pointerIds",new Set),V1(this,"touchIds",new Set),V1(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),Dl(this,t)}setEventIds(t){if(bt(t))return this.touchIds=new Set(X5(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=Al(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,i={};let r;if(!(n.target&&(r=n.target(),!r))){if(n.enabled){for(const a of this.gestures){const s=this.config[a],l=Zi(i,s.eventOptions,!!r);if(s.enabled){const u=To.get(a);new u(this,t,a).bind(l)}}const o=Zi(i,n.eventOptions,!!r);for(const a in this.nativeHandlers)o(a,"",s=>this.nativeHandlers[a](c1(c1({},this.state.shared),{},{event:s,args:t})),void 0,!0)}for(const o in i)i[o]=el(...i[o]);if(!r)return i;for(const o in i){const{device:a,capture:s,passive:l}=W5(o);this._targetEventStore.add(r,a,"",i[o],{capture:s,passive:l})}}}}function T0(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Ro(e,t),e.gestureTimeoutStores[t]=new _l}function Dl(e,t){t.drag&&T0(e,"drag"),t.wheel&&T0(e,"wheel"),t.scroll&&T0(e,"scroll"),t.move&&T0(e,"move"),t.pinch&&T0(e,"pinch"),t.hover&&T0(e,"hover")}const Zi=(e,t,n)=>(i,r,o,a={},s=!1)=>{var l,u;const d=(l=a.capture)!==null&&l!==void 0?l:t.capture,f=(u=a.passive)!==null&&u!==void 0?u:t.passive;let m=s?i:Z5(i,r,d);n&&f&&(m+="Passive"),e[m]=e[m]||[],e[m].push(o)};function Bl(e,t={},n,i){const r=v.useMemo(()=>new Vl(e),[]);if(r.applyHandlers(e,i),r.applyConfig(t,n),v.useEffect(r.effect.bind(r)),v.useEffect(()=>r.clean.bind(r),[]),t.target===void 0)return r.bind.bind(r)}function jl(e,t){return yl(bl),Bl({drag:e},t||{},"drag")}function e0(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e==null||e(r),n===!1||!r.defaultPrevented)return t==null?void 0:t(r)}}function Fo(e,t=[]){let n=[];function i(o,a){const s=h.createContext(a),l=n.length;n=[...n,a];function u(f){const{scope:m,children:k,...p}=f,g=(m==null?void 0:m[e][l])||s,C=h.useMemo(()=>p,Object.values(p));return h.createElement(g.Provider,{value:C},k)}function d(f,m){const k=(m==null?void 0:m[e][l])||s,p=h.useContext(k);if(p)return p;if(a!==void 0)return a;throw new Error(`\`${f}\` must be used within \`${o}\``)}return u.displayName=o+"Provider",[u,d]}const r=()=>{const o=n.map(a=>h.createContext(a));return function(s){const l=(s==null?void 0:s[e])||o;return h.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return r.scopeName=e,[i,$l(r,...t)]}function $l(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const i=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(o){const a=i.reduce((s,{useScope:l,scopeName:u})=>{const f=l(o)[`__scope${u}`];return{...s,...f}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function J0(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var i;return(i=t.current)===null||i===void 0?void 0:i.call(t,...n)},[])}function Gl(e,t=globalThis==null?void 0:globalThis.document){const n=J0(e);h.useEffect(()=>{const i=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",i),()=>t.removeEventListener("keydown",i)},[n,t])}const sn="dismissableLayer.update",Pl="dismissableLayer.pointerDownOutside",Ml="dismissableLayer.focusOutside";let Ui;const Ll=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ol=h.forwardRef((e,t)=>{var n;const{disableOutsidePointerEvents:i=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...u}=e,d=h.useContext(Ll),[f,m]=h.useState(null),k=(n=f==null?void 0:f.ownerDocument)!==null&&n!==void 0?n:globalThis==null?void 0:globalThis.document,[,p]=h.useState({}),g=X0(t,_=>m(_)),C=Array.from(d.layers),[x]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),y=C.indexOf(x),b=f?C.indexOf(f):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=b>=y,S=Tl(_=>{const G=_.target,B=[...d.branches].some(D=>D.contains(G));!E||B||(o==null||o(_),s==null||s(_),_.defaultPrevented||l==null||l())},k),A=Rl(_=>{const G=_.target;[...d.branches].some(D=>D.contains(G))||(a==null||a(_),s==null||s(_),_.defaultPrevented||l==null||l())},k);return Gl(_=>{b===d.layers.size-1&&(r==null||r(_),!_.defaultPrevented&&l&&(_.preventDefault(),l()))},k),h.useEffect(()=>{if(f)return i&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ui=k.body.style.pointerEvents,k.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(f)),d.layers.add(f),Wi(),()=>{i&&d.layersWithOutsidePointerEventsDisabled.size===1&&(k.body.style.pointerEvents=Ui)}},[f,k,i,d]),h.useEffect(()=>()=>{f&&(d.layers.delete(f),d.layersWithOutsidePointerEventsDisabled.delete(f),Wi())},[f,d]),h.useEffect(()=>{const _=()=>p({});return document.addEventListener(sn,_),()=>document.removeEventListener(sn,_)},[]),h.createElement(j0.div,F({},u,{ref:g,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:e0(e.onFocusCapture,A.onFocusCapture),onBlurCapture:e0(e.onBlurCapture,A.onBlurCapture),onPointerDownCapture:e0(e.onPointerDownCapture,S.onPointerDownCapture)}))});function Tl(e,t=globalThis==null?void 0:globalThis.document){const n=J0(e),i=h.useRef(!1),r=h.useRef(()=>{});return h.useEffect(()=>{const o=s=>{if(s.target&&!i.current){let u=function(){Io(Pl,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=u,t.addEventListener("click",r.current,{once:!0})):u()}else t.removeEventListener("click",r.current);i.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",o),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>i.current=!0}}function Rl(e,t=globalThis==null?void 0:globalThis.document){const n=J0(e),i=h.useRef(!1);return h.useEffect(()=>{const r=o=>{o.target&&!i.current&&Io(Ml,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}function Wi(){const e=new CustomEvent(sn);document.dispatchEvent(e)}function Io(e,t,n,{discrete:i}){const r=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),i?r5(r,o):r.dispatchEvent(o)}const U0=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},Fl=Vs["useId".toString()]||(()=>{});let Il=0;function Hl(e){const[t,n]=h.useState(Fl());return U0(()=>{e||n(i=>i??String(Il++))},[e]),e||(t?`radix-${t}`:"")}const Nl=h.forwardRef((e,t)=>{const{children:n,width:i=10,height:r=5,...o}=e;return h.createElement(j0.svg,F({},o,{ref:t,width:i,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:h.createElement("polygon",{points:"0,0 30,0 15,10"}))}),zl=Nl;function Zl(e){const[t,n]=h.useState(void 0);return U0(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const i=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const o=r[0];let a,s;if("borderBoxSize"in o){const l=o.borderBoxSize,u=Array.isArray(l)?l[0]:l;a=u.inlineSize,s=u.blockSize}else a=e.offsetWidth,s=e.offsetHeight;n({width:a,height:s})});return i.observe(e,{box:"border-box"}),()=>i.unobserve(e)}else n(void 0)},[e]),t}const Ho="Popper",[No,zo]=Fo(Ho),[Ul,Zo]=No(Ho),Wl=e=>{const{__scopePopper:t,children:n}=e,[i,r]=h.useState(null);return h.createElement(Ul,{scope:t,anchor:i,onAnchorChange:r},n)},Kl="PopperAnchor",ql=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:i,...r}=e,o=Zo(Kl,n),a=h.useRef(null),s=X0(t,a);return h.useEffect(()=>{o.onAnchorChange((i==null?void 0:i.current)||a.current)}),i?null:h.createElement(j0.div,F({},r,{ref:s}))}),Uo="PopperContent",[Yl,Xl]=No(Uo),Ql=h.forwardRef((e,t)=>{var n,i,r,o,a,s,l,u;const{__scopePopper:d,side:f="bottom",sideOffset:m=0,align:k="center",alignOffset:p=0,arrowPadding:g=0,avoidCollisions:C=!0,collisionBoundary:x=[],collisionPadding:y=0,sticky:b="partial",hideWhenDetached:w=!1,updatePositionStrategy:E="optimized",onPlaced:S,...A}=e,_=Zo(Uo,d),[G,B]=h.useState(null),D=X0(t,a1=>B(a1)),[V,R]=h.useState(null),P=Zl(V),$=(n=P==null?void 0:P.width)!==null&&n!==void 0?n:0,j=(i=P==null?void 0:P.height)!==null&&i!==void 0?i:0,L=f+(k!=="center"?"-"+k:""),Z=typeof y=="number"?y:{top:0,right:0,bottom:0,left:0,...y},U=Array.isArray(x)?x:[x],J=U.length>0,W={padding:Z,boundary:U.filter(n4),altBoundary:J},{refs:M,floatingStyles:Q,placement:e1,isPositioned:X,middlewareData:d1}=E3({strategy:"fixed",placement:L,whileElementsMounted:(...a1)=>b3(...a1,{animationFrame:E==="always"}),elements:{reference:_.anchor},middleware:[e3({mainAxis:m+j,alignmentAxis:p}),C&&t3({mainAxis:!0,crossAxis:!1,limiter:b==="partial"?n3():void 0,...W}),C&&X2({...W}),i3({...W,apply:({elements:a1,rects:Z1,availableWidth:U1,availableHeight:W1})=>{const{width:G0,height:C0}=Z1.reference,K1=a1.floating.style;K1.setProperty("--radix-popper-available-width",`${U1}px`),K1.setProperty("--radix-popper-available-height",`${W1}px`),K1.setProperty("--radix-popper-anchor-width",`${G0}px`),K1.setProperty("--radix-popper-anchor-height",`${C0}px`)}}),V&&w3({element:V,padding:g}),i4({arrowWidth:$,arrowHeight:j}),w&&Q2({strategy:"referenceHidden",...W})]}),[S1,A1]=Wo(e1),j1=J0(S);U0(()=>{X&&(j1==null||j1())},[X,j1]);const R1=(r=d1.arrow)===null||r===void 0?void 0:r.x,d0=(o=d1.arrow)===null||o===void 0?void 0:o.y,f0=((a=d1.arrow)===null||a===void 0?void 0:a.centerOffset)!==0,[Y,r1]=h.useState();return U0(()=>{G&&r1(window.getComputedStyle(G).zIndex)},[G]),h.createElement("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...Q,transform:X?Q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[(s=d1.transformOrigin)===null||s===void 0?void 0:s.x,(l=d1.transformOrigin)===null||l===void 0?void 0:l.y].join(" ")},dir:e.dir},h.createElement(Yl,{scope:d,placedSide:S1,onArrowChange:R,arrowX:R1,arrowY:d0,shouldHideArrow:f0},h.createElement(j0.div,F({"data-side":S1,"data-align":A1},A,{ref:D,style:{...A.style,animation:X?void 0:"none",opacity:(u=d1.hide)!==null&&u!==void 0&&u.referenceHidden?0:void 0}}))))}),Jl="PopperArrow",e4={top:"bottom",right:"left",bottom:"top",left:"right"},t4=h.forwardRef(function(t,n){const{__scopePopper:i,...r}=t,o=Xl(Jl,i),a=e4[o.placedSide];return h.createElement("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0}},h.createElement(zl,F({},r,{ref:n,style:{...r.style,display:"block"}})))});function n4(e){return e!==null}const i4=e=>({name:"transformOrigin",options:e,fn(t){var n,i,r,o,a;const{placement:s,rects:l,middlewareData:u}=t,f=((n=u.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,m=f?0:e.arrowWidth,k=f?0:e.arrowHeight,[p,g]=Wo(s),C={start:"0%",center:"50%",end:"100%"}[g],x=((i=(r=u.arrow)===null||r===void 0?void 0:r.x)!==null&&i!==void 0?i:0)+m/2,y=((o=(a=u.arrow)===null||a===void 0?void 0:a.y)!==null&&o!==void 0?o:0)+k/2;let b="",w="";return p==="bottom"?(b=f?C:`${x}px`,w=`${-k}px`):p==="top"?(b=f?C:`${x}px`,w=`${l.floating.height+k}px`):p==="right"?(b=`${-k}px`,w=f?C:`${y}px`):p==="left"&&(b=`${l.floating.width+k}px`,w=f?C:`${y}px`),{data:{x:b,y:w}}}});function Wo(e){const[t,n="center"]=e.split("-");return[t,n]}const r4=Wl,o4=ql,a4=Ql,s4=t4;function l4(e,t){return h.useReducer((n,i)=>{const r=t[n][i];return r??n},e)}const Ko=e=>{const{present:t,children:n}=e,i=c4(t),r=typeof n=="function"?n({present:i.isPresent}):h.Children.only(n),o=X0(i.ref,r.ref);return typeof n=="function"||i.isPresent?h.cloneElement(r,{ref:o}):null};Ko.displayName="Presence";function c4(e){const[t,n]=h.useState(),i=h.useRef({}),r=h.useRef(e),o=h.useRef("none"),a=e?"mounted":"unmounted",[s,l]=l4(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Fe(i.current);o.current=s==="mounted"?u:"none"},[s]),U0(()=>{const u=i.current,d=r.current;if(d!==e){const m=o.current,k=Fe(u);e?l("MOUNT"):k==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&m!==k?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,l]),U0(()=>{if(t){const u=f=>{const k=Fe(i.current).includes(f.animationName);f.target===t&&k&&pt.flushSync(()=>l("ANIMATION_END"))},d=f=>{f.target===t&&(o.current=Fe(i.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:h.useCallback(u=>{u&&(i.current=getComputedStyle(u)),n(u)},[])}}function Fe(e){return(e==null?void 0:e.animationName)||"none"}function u4({prop:e,defaultProp:t,onChange:n=()=>{}}){const[i,r]=d4({defaultProp:t,onChange:n}),o=e!==void 0,a=o?e:i,s=J0(n),l=h.useCallback(u=>{if(o){const f=typeof u=="function"?u(e):u;f!==e&&s(f)}else r(u)},[o,e,r,s]);return[a,l]}function d4({defaultProp:e,onChange:t}){const n=h.useState(e),[i]=n,r=h.useRef(i),o=J0(t);return h.useEffect(()=>{r.current!==i&&(o(i),r.current=i)},[i,r,o]),n}const f4=h.forwardRef((e,t)=>h.createElement(j0.span,F({},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}}))),h4=f4,[vt,Qm]=Fo("Tooltip",[zo]),wt=zo(),m4="TooltipProvider",ln="tooltip.open",[Jm,On]=vt(m4),Tn="Tooltip",[p4,Et]=vt(Tn),x4=e=>{const{__scopeTooltip:t,children:n,open:i,defaultOpen:r=!1,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,l=On(Tn,e.__scopeTooltip),u=wt(t),[d,f]=h.useState(null),m=Hl(),k=h.useRef(0),p=a??l.disableHoverableContent,g=s??l.delayDuration,C=h.useRef(!1),[x=!1,y]=u4({prop:i,defaultProp:r,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(ln))):l.onClose(),o==null||o(A)}}),b=h.useMemo(()=>x?C.current?"delayed-open":"instant-open":"closed",[x]),w=h.useCallback(()=>{window.clearTimeout(k.current),C.current=!1,y(!0)},[y]),E=h.useCallback(()=>{window.clearTimeout(k.current),y(!1)},[y]),S=h.useCallback(()=>{window.clearTimeout(k.current),k.current=window.setTimeout(()=>{C.current=!0,y(!0)},g)},[g,y]);return h.useEffect(()=>()=>window.clearTimeout(k.current),[]),h.createElement(r4,u,h.createElement(p4,{scope:t,contentId:m,open:x,stateAttribute:b,trigger:d,onTriggerChange:f,onTriggerEnter:h.useCallback(()=>{l.isOpenDelayed?S():w()},[l.isOpenDelayed,S,w]),onTriggerLeave:h.useCallback(()=>{p?E():window.clearTimeout(k.current)},[E,p]),onOpen:w,onClose:E,disableHoverableContent:p},n))},Ki="TooltipTrigger",k4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,r=Et(Ki,n),o=On(Ki,n),a=wt(n),s=h.useRef(null),l=X0(t,s,r.onTriggerChange),u=h.useRef(!1),d=h.useRef(!1),f=h.useCallback(()=>u.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),h.createElement(o4,F({asChild:!0},a),h.createElement(j0.button,F({"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute},i,{ref:l,onPointerMove:e0(e.onPointerMove,m=>{m.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(r.onTriggerEnter(),d.current=!0)}),onPointerLeave:e0(e.onPointerLeave,()=>{r.onTriggerLeave(),d.current=!1}),onPointerDown:e0(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:e0(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:e0(e.onBlur,r.onClose),onClick:e0(e.onClick,r.onClose)})))}),g4="TooltipPortal",[ep,C4]=vt(g4,{forceMount:void 0}),ve="TooltipContent",y4=h.forwardRef((e,t)=>{const n=C4(ve,e.__scopeTooltip),{forceMount:i=n.forceMount,side:r="top",...o}=e,a=Et(ve,e.__scopeTooltip);return h.createElement(Ko,{present:i||a.open},a.disableHoverableContent?h.createElement(qo,F({side:r},o,{ref:t})):h.createElement(b4,F({side:r},o,{ref:t})))}),b4=h.forwardRef((e,t)=>{const n=Et(ve,e.__scopeTooltip),i=On(ve,e.__scopeTooltip),r=h.useRef(null),o=X0(t,r),[a,s]=h.useState(null),{trigger:l,onClose:u}=n,d=r.current,{onPointerInTransitChange:f}=i,m=h.useCallback(()=>{s(null),f(!1)},[f]),k=h.useCallback((p,g)=>{const C=p.currentTarget,x={x:p.clientX,y:p.clientY},y=A4(x,C.getBoundingClientRect()),b=_4(x,y),w=V4(g.getBoundingClientRect()),E=B4([...b,...w]);s(E),f(!0)},[f]);return h.useEffect(()=>()=>m(),[m]),h.useEffect(()=>{if(l&&d){const p=C=>k(C,d),g=C=>k(C,l);return l.addEventListener("pointerleave",p),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",p),d.removeEventListener("pointerleave",g)}}},[l,d,k,m]),h.useEffect(()=>{if(a){const p=g=>{const C=g.target,x={x:g.clientX,y:g.clientY},y=(l==null?void 0:l.contains(C))||(d==null?void 0:d.contains(C)),b=!D4(x,a);y?m():b&&(m(),u())};return document.addEventListener("pointermove",p),()=>document.removeEventListener("pointermove",p)}},[l,d,a,u,m]),h.createElement(qo,F({},e,{ref:o}))}),[v4,w4]=vt(Tn,{isInside:!1}),qo=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:i,"aria-label":r,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=Et(ve,n),u=wt(n),{onClose:d}=l;return h.useEffect(()=>(document.addEventListener(ln,d),()=>document.removeEventListener(ln,d)),[d]),h.useEffect(()=>{if(l.trigger){const f=m=>{const k=m.target;k!=null&&k.contains(l.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[l.trigger,d]),h.createElement(Ol,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d},h.createElement(a4,F({"data-state":l.stateAttribute},u,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)"}}),h.createElement(Ao,null,i),h.createElement(v4,{scope:n,isInside:!0},h.createElement(h4,{id:l.contentId,role:"tooltip"},r||i))))}),E4="TooltipArrow",S4=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...i}=e,r=wt(n);return w4(E4,n).isInside?null:h.createElement(s4,F({},r,i,{ref:t}))});function A4(e,t){const n=Math.abs(t.top-e.y),i=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,i,r,o)){case o:return"left";case r:return"right";case n:return"top";case i:return"bottom";default:throw new Error("unreachable")}}function _4(e,t,n=5){const i=[];switch(t){case"top":i.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":i.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":i.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":i.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return i}function V4(e){const{top:t,right:n,bottom:i,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:i},{x:r,y:i}]}function D4(e,t){const{x:n,y:i}=e;let r=!1;for(let o=0,a=t.length-1;oi!=d>i&&n<(u-s)*(i-l)/(d-l)+s&&(r=!r)}return r}function B4(e){const t=e.slice();return t.sort((n,i)=>n.xi.x?1:n.yi.y?1:0),j4(t)}function j4(e){if(e.length<=1)return e.slice();const t=[];for(let i=0;i=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(r.y-a.y)>=(o.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let i=e.length-1;i>=0;i--){const r=e[i];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(r.y-a.y)>=(o.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}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 $4=x4,G4=k4,P4=y4,M4=S4;function L4(e,t){if(e==null)return{};var n={},i=Object.keys(e),r,o;for(o=0;o=0)&&(n[r]=e[r]);return n}function n1(e,t){if(e==null)return{};var n=L4(e,t),i,r;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}let l1;(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"})(l1||(l1={}));const O4={[l1.UNSUPPORTED_INPUT]:(e,t)=>[`An input with type \`${e}\` input was found at path \`${t}\` but it's not supported yet.`],[l1.NO_COMPONENT_FOR_TYPE]:(e,t)=>[`Type \`${e}\` found at path \`${t}\` can't be displayed in panel because no component supports it yet.`],[l1.UNKNOWN_INPUT]:(e,t)=>[`input at path \`${e}\` is not recognized.`,t],[l1.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.`],[l1.ALREADY_REGISTERED_TYPE]:e=>[`Type ${e} has already been registered. You can't register a component with the same type.`],[l1.CLIPBOARD_ERROR]:e=>["Error copying the value",e],[l1.THEME_ERROR]:(e,t)=>[`Error accessing the theme \`${e}.${t}\` value.`],[l1.PATH_DOESNT_EXIST]:e=>[`Error getting the value at path \`${e}\`. There is probably an error in your \`render\` function.`],[l1.PATH_DOESNT_EXIST]:e=>[`Error accessing the value at path \`${e}\``],[l1.INPUT_TYPE_OVERRIDE]:(e,t,n)=>[`Input at path \`${e}\` already exists with type: \`${t}\`. Its type cannot be overridden with type \`${n}\`.`],[l1.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function Yo(e,t,...n){const[i,...r]=O4[t](...n);console[e]("LEVA: "+i,...r)}const t0=Yo.bind(null,"warn"),T4=Yo.bind(null,"log"),R4=["value"],F4=["schema"],I4=["value"],Xo=[],_0={};function qi(e){let{value:t}=e,n=n1(e,R4);for(let i of Xo){const r=i(t,n);if(r)return r}}function u0(e,t){let{schema:n}=t,i=n1(t,F4);if(e in _0){t0(l1.ALREADY_REGISTERED_TYPE,e);return}Xo.push((r,o)=>n(r,o)&&e),_0[e]=i}function Tt(e,t,n,i){const{normalize:r}=_0[e];if(r)return r(t,n,i);if(typeof t!="object"||!("value"in t))return{value:t};const{value:o}=t,a=n1(t,I4);return{value:o,settings:a}}function H4(e,t,n,i,r,o){const{sanitize:a}=_0[e];return a?a(t,n,i,r,o):t}function Yi(e,t,n){const{format:i}=_0[e];return i?i(t,n):t}function N4(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,i)}return n}function z(e){for(var t=1;te>n?n:e{if(e===""||typeof e=="number")return e;try{const t=h0(e);if(!isNaN(t))return t}catch{}return parseFloat(e)},Z4=Math.log(10);function Qi(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)/Z4)+1,i=Math.floor(Math.log10(Math.abs(e))),r=Math.pow(10,i-n);return Math.max(r,.001)}const it=(e,t,n)=>n===t?0:(k0(e,t,n)-t)/(n-t),rt=(e,t,n)=>e*(n-t)+t,U4=()=>"_"+Math.random().toString(36).substr(2,9),Ji=/\(([0-9+\-*/^ .]+)\)/,er=/(\d+(?:\.\d+)?) ?\^ ?(\d+(?:\.\d+)?)/,tr=/(\d+(?:\.\d+)?) ?\* ?(\d+(?:\.\d+)?)/,nr=/(\d+(?:\.\d+)?) ?\/ ?(\d+(?:\.\d+)?)/,ir=/(\d+(?:\.\d+)?) ?\+ ?(\d+(?:\.\d+)?)/,rr=/(\d+(?:\.\d+)?) ?- ?(\d+(?:\.\d+)?)/;function h0(e){if(isNaN(Number(e)))if(Ji.test(e)){const t=e.replace(Ji,(n,i)=>String(h0(i)));return h0(t)}else if(er.test(e)){const t=e.replace(er,(n,i,r)=>String(Math.pow(Number(i),Number(r))));return h0(t)}else if(tr.test(e)){const t=e.replace(tr,(n,i,r)=>String(Number(i)*Number(r)));return h0(t)}else if(nr.test(e)){const t=e.replace(nr,(n,i,r)=>{if(r!=0)return String(Number(i)/Number(r));throw new Error("Division by zero")});return h0(t)}else if(ir.test(e)){const t=e.replace(ir,(n,i,r)=>String(Number(i)+Number(r)));return h0(t)}else if(rr.test(e)){const t=e.replace(rr,(n,i,r)=>String(Number(i)-Number(r)));return h0(t)}else return Number(e);return Number(e)}function W4(e,t){return t.reduce((n,i)=>(e&&e.hasOwnProperty(i)&&(n[i]=e[i]),n),{})}function K4(e,t){const n=z({},e);return t.forEach(i=>i in e&&delete n[i]),n}function q4(e,t){return e.reduce((n,i,r)=>Object.assign(n,{[t[r]]:i}),{})}function Qo(e){return Object.prototype.toString.call(e)==="[object Object]"}const Y4=e=>Qo(e)&&Object.keys(e).length===0;let H1;(function(e){e.BUTTON="BUTTON",e.BUTTON_GROUP="BUTTON_GROUP",e.MONITOR="MONITOR",e.FOLDER="FOLDER"})(H1||(H1={}));let N1;(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"})(N1||(N1={}));const X4=["type","__customInput"],Q4=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],J4=["type"];function Jo(e,t,n={},i){var r,o;if(typeof e!="object"||Array.isArray(e))return{type:i,input:e,options:z({key:t,label:t,optional:!1,disabled:!1,order:0},n)};if("__customInput"in e){const{type:E,__customInput:S}=e,A=n1(e,X4);return Jo(S,t,A,E)}const{render:a,label:s,optional:l,order:u=0,disabled:d,hint:f,onChange:m,onEditStart:k,onEditEnd:p,transient:g}=e,C=n1(e,Q4),x=z({render:a,key:t,label:s??t,hint:f,transient:g??!!m,onEditStart:k,onEditEnd:p,disabled:d,optional:l,order:u},n);let{type:y}=C,b=n1(C,J4);if(y=i??y,y in H1)return{type:y,input:b,options:x};let w;return i&&Qo(b)&&"value"in b?w=b.value:w=Y4(b)?void 0:b,{type:y,input:w,options:z(z({},x),{},{onChange:m,optional:(r=x.optional)!==null&&r!==void 0?r:!1,disabled:(o=x.disabled)!==null&&o!==void 0?o:!1})}}function e6(e,t,n,i){const r=Jo(e,t),{type:o,input:a,options:s}=r;if(o)return o in H1?r:{type:o,input:Tt(o,a,n,i),options:s};let l=qi(a);return l?{type:l,input:Tt(l,a,n,i),options:s}:(l=qi({value:a}),l?{type:l,input:Tt(l,{value:a},n,i),options:s}:!1)}function or(e,t,n,i,r){const{value:o,type:a,settings:s}=e;e.value=ea({type:a,value:o,settings:s},t,n,i),e.fromPanel=r}const t6=function(t,n,i){this.type="LEVA_ERROR",this.message="LEVA: "+t,this.previousValue=n,this.error=i};function ea({type:e,value:t,settings:n},i,r,o){const a=e!=="SELECT"&&typeof i=="function"?i(t):i;let s;try{s=H4(e,a,n,t,r,o)}catch(l){throw new t6(`The value \`${i}\` did not result in a correct value.`,t,l)}return ye(s,t)?t:s}const ta=(e,t,n=!1)=>{let i=0;return function(){const r=arguments,o=n&&!i,a=()=>e.apply(this,r);window.clearTimeout(i),i=window.setTimeout(a,t),o&&a()}},na=e=>e.shiftKey?5:e.altKey?1/5:1;function n6(e,t){const n=console.error;console.error=()=>{},F0.render(e,t),console.error=n}const i6=["value"],r6=["min","max"],o6=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},ia=(e,{min:t=-1/0,max:n=1/0,suffix:i})=>{const r=parseFloat(e);if(e===""||isNaN(r))throw Error("Invalid number");const o=k0(r,t,n);return i?o+i:o},a6=(e,{pad:t=0,suffix:n})=>{const i=parseFloat(e).toFixed(t);return n?i+n:i},ra=e=>{let{value:t}=e,n=n1(e,i6);const{min:i=-1/0,max:r=1/0}=n,o=n1(n,r6);let a=parseFloat(t);const s=typeof t=="string"?t.substring((""+a).length):void 0;a=k0(a,i,r);let l=n.step;l||(Number.isFinite(i)?Number.isFinite(r)?l=+(Math.abs(r-i)/100).toPrecision(1):l=+(Math.abs(a-i)/100).toPrecision(1):Number.isFinite(r)&&(l=+(Math.abs(r-a)/100).toPrecision(1)));const u=l?Qi(l)*10:Qi(a);l=l||u/10;const d=Math.round(k0(Math.log10(1/u),0,2));return{value:s?a+s:a,settings:z({initialValue:a,step:l,pad:d,min:i,max:r,suffix:s},o)}},oa=(e,{step:t,initialValue:n})=>{const i=Math.round((e-n)/t);return n+i*t};var aa=Object.freeze({__proto__:null,schema:o6,sanitize:ia,format:a6,normalize:ra,sanitizeStep:oa});function u1(){return u1=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 Ie(e,t){const[n,i]=e.split(" "),r={};return n!=="none"&&(r.boxShadow=`${t.inset?"inset ":""}0 0 0 $borderWidths${[t.key]} $colors${n!=="default"&&n||t.borderColor}`),i&&(r.backgroundColor=i),r}const oe={$inputStyle:()=>e=>Ie(e,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>e=>Ie(e,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>e=>Ie(e,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>e=>Ie(e,{key:"$active",borderColor:"$accent1",inset:!0})},{styled:H,css:tp,createTheme:l6,globalCss:c6,keyframes:np}=$o({prefix:"leva",theme:ua(),utils:z(z({},oe),{},{$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":oe.$focusStyle()(e)}),$focusWithin:e=>({"&:focus-within":oe.$focusStyle()(e)}),$hover:e=>({"&:hover":oe.$hoverStyle()(e)}),$active:e=>({"&:active":oe.$activeStyle()(e)})})}),u6=c6({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function d6(e){const t=ua();if(!e)return{theme:t,className:""};Object.keys(e).forEach(i=>{Object.assign(t[i],e[i])});const n=l6(t);return{theme:t,className:n.className}}function n0(e,t){const{theme:n}=h.useContext(Rn);if(!(e in n)||!(t in n[e]))return t0(l1.THEME_ERROR,e,t),"";let i=t;for(;;){let r=n[e][i];if(typeof r=="string"&&r.charAt(0)==="$")i=r.substr(1);else return r}}const da=H("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),fa=H("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${da}`]:{paddingLeft:0}}),f6=H(fa,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),h6=H("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),m6=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],p6=["onUpdate"];function Fn(e){let{innerLabel:t,value:n,onUpdate:i,onChange:r,onKeyDown:o,type:a,id:s,inputType:l="text",rows:u=0}=e,d=n1(e,m6);const{id:f,emitOnEditStart:m,emitOnEditEnd:k,disabled:p}=x1(),g=s||f,C=h.useRef(null),x=u>0,y=x?"textarea":"input",b=h.useCallback(S=>A=>{const _=A.currentTarget.value;S(_)},[]);v.useEffect(()=>{const S=C.current,A=b(_=>{i(_),k()});return S==null||S.addEventListener("blur",A),()=>S==null?void 0:S.removeEventListener("blur",A)},[b,i,k]);const w=h.useCallback(S=>{S.key==="Enter"&&b(i)(S)},[b,i]),E=Object.assign({as:y},x?{rows:u}:{},d);return v.createElement(h6,{textArea:x},t&&typeof t=="string"?v.createElement(fa,null,t):t,v.createElement(da,u1({levaType:a,ref:C,id:g,type:l,autoComplete:"off",spellCheck:"false",value:n,onChange:b(r),onFocus:()=>m(),onKeyPress:w,onKeyDown:o,disabled:p},E)))}function x6(e){let{onUpdate:t}=e,n=n1(e,p6);const i=h.useCallback(o=>t(z4(o)),[t]),r=h.useCallback(o=>{const a=o.key==="ArrowUp"?1:o.key==="ArrowDown"?-1:0;if(a){o.preventDefault();const s=o.altKey?.1:o.shiftKey?10:1;t(l=>parseFloat(l)+a*s)}},[t]);return v.createElement(Fn,u1({},n,{onUpdate:i,onKeyDown:r,type:"number"}))}const ot=H("div",{}),cn=H("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"}}]}),k6=H("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 + ${cn}::after`]:{opacity:.6},[`${ot}:hover > & + ${cn}::after`]:{opacity:.6},[`${ot}:hover > & > svg`]:{opacity:1}}),ha=H("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"},[`> ${ot}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),ma=H("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${ha} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),pa=H(ma,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),g6=H("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"}}}}),C6=H("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"}}),un=H("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),y6=H("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${un}`]:{pointerEvents:"auto"}}}}}),xa=H("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),b6=H("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),v6=H(M4,{fill:"$toolTipBackground"});function In({children:e}){const{className:t}=h.useContext(Rn);return v.createElement(a5,{className:t},e)}const w6=["align"];function E6(){const{id:e,disable:t,disabled:n}=x1();return v.createElement(v.Fragment,null,v.createElement(C6,{id:e+"__disable",type:"checkbox",checked:!n,onChange:()=>t(!n)}),v.createElement("label",{htmlFor:e+"__disable"}))}function S6(e){const{id:t,optional:n,hint:i}=x1(),r=e.htmlFor||(t?{htmlFor:t}:null),o=!i&&typeof e.children=="string"?{title:e.children}:null;return v.createElement(v.Fragment,null,n&&v.createElement(E6,null),i!==void 0?v.createElement($4,null,v.createElement(G4,{asChild:!0},v.createElement(un,u1({},r,e))),v.createElement(P4,{side:"top",sideOffset:2},v.createElement(b6,null,i,v.createElement(v6,null)))):v.createElement(un,u1({},r,o,e)))}function z1(e){let{align:t}=e,n=n1(e,w6);const{value:i,label:r,key:o,disabled:a}=x1(),{hideCopyButton:s}=s6(),l=!s&&o!==void 0,[u,d]=h.useState(!1),f=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[o]:i??""})),d(!0)}catch{t0(l1.CLIPBOARD_ERROR,{[o]:i})}};return v.createElement(g6,{align:t,onPointerLeave:()=>d(!1)},v.createElement(S6,n),l&&!a&&v.createElement("div",{title:`Click to copy ${typeof r=="string"?r:o} value`},u?v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},v.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),v.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"})):v.createElement("svg",{onClick:f,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},v.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),v.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 A6=["toggled"],_6=H("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function Hn(e){let{toggled:t}=e,n=n1(e,A6);return v.createElement(_6,u1({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${t?0:-90}deg)`}},n),v.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 V6=["input"];function T1(e){let{input:t}=e,n=n1(e,V6);return t?v.createElement(pa,n):v.createElement(ma,n)}function ka({value:e,type:t,settings:n,setValue:i}){const[r,o]=h.useState(Yi(t,e,n)),a=h.useRef(e),s=h.useRef(n);s.current=n;const l=h.useCallback(d=>o(Yi(t,d,s.current)),[t]),u=h.useCallback(d=>{try{i(d)}catch(f){const{type:m,previousValue:k}=f;if(m!=="LEVA_ERROR")throw f;l(k)}},[l,i]);return h.useEffect(()=>{ye(e,a.current)||l(e),a.current=e},[e,l]),{displayValue:r,onChange:o,onUpdate:u}}function Ge(e,t){const{emitOnEditStart:n,emitOnEditEnd:i}=x1();return jl(r=>{r.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const o=e(r);return r.last&&(document.body.classList.remove("leva__panel__dragged"),i==null||i()),o},t)}function D6(e){const t=h.useRef(null),n=h.useRef(null),i=h.useRef(!1);return h.useEffect(()=>{const r=ta(()=>{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",r),i.current||(r(),i.current=!0),()=>window.removeEventListener("resize",r)},[e]),h.useEffect(()=>{n.current=t.current.getContext("2d")},[]),[t,n]}function ga(){const e=h.useRef(null),t=h.useRef({x:0,y:0}),n=h.useCallback(i=>{Object.assign(t.current,i),e.current&&(e.current.style.transform=`translate3d(${t.current.x}px, ${t.current.y}px, 0)`)},[]);return[e,n]}const B6=["__refCount"],Rt=(e,t)=>{if(!e[t])return null;const n=e[t];return n1(n,B6)};function j6(e){const t=$e(),[n,i]=h.useState(Rt(t.getData(),e)),r=h.useCallback(u=>t.setValueAtPath(e,u,!0),[e,t]),o=h.useCallback(u=>t.setSettingsAtPath(e,u),[e,t]),a=h.useCallback(u=>t.disableInputAtPath(e,u),[e,t]),s=h.useCallback(()=>t.emitOnEditStart(e),[e,t]),l=h.useCallback(()=>t.emitOnEditEnd(e),[e,t]);return h.useEffect(()=>{i(Rt(t.getData(),e));const u=t.useStore.subscribe(d=>Rt(d.data,e),i,{equalityFn:De});return()=>u()},[t,e]),[n,{set:r,setSettings:o,disable:a,storeId:t.storeId,emitOnEditStart:s,emitOnEditEnd:l}]}const $6=H("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),Ca=H("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),dn=H("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)))"}}}}),ya=H("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),ba=H("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function G6({value:e,min:t,max:n,onDrag:i,step:r,initialValue:o}){const a=h.useRef(null),s=h.useRef(null),l=h.useRef(0),u=n0("sizes","scrubberWidth"),d=Ge(({event:m,first:k,xy:[p],movement:[g],memo:C})=>{if(k){const{width:y,left:b}=a.current.getBoundingClientRect();l.current=y-parseFloat(u),C=(m==null?void 0:m.target)===s.current?e:rt((p-b)/y,t,n)}const x=C+rt(g/l.current,0,n-t);return i(oa(x,{step:r,initialValue:o})),C}),f=it(e,t,n);return v.createElement(ya,u1({ref:a},d()),v.createElement(Ca,null,v.createElement(ba,{style:{left:0,right:`${(1-f)*100}%`}})),v.createElement(dn,{ref:s,style:{left:`calc(${f} * (100% - ${u}))`}}))}const P6=v.memo(({label:e,onUpdate:t,step:n,innerLabelTrim:i})=>{const[r,o]=h.useState(!1),a=Ge(({active:s,delta:[l],event:u,memo:d=0})=>(o(s),d+=l/2,Math.abs(d)>=1&&(t(f=>parseFloat(f)+Math.floor(d)*n*na(u)),d=0),d));return v.createElement(f6,u1({dragging:r,title:e.length>1?e:""},a()),e.slice(0,i))});function va({label:e,id:t,displayValue:n,onUpdate:i,onChange:r,settings:o,innerLabelTrim:a=1}){const s=a>0&&v.createElement(P6,{label:e,step:o.step,onUpdate:i,innerLabelTrim:a});return v.createElement(x6,{id:t,value:String(n),onUpdate:i,onChange:r,innerLabel:s})}function M6(){const e=x1(),{label:t,value:n,onUpdate:i,settings:r,id:o}=e,{min:a,max:s}=r,l=s!==1/0&&a!==-1/0;return v.createElement(T1,{input:!0},v.createElement(z1,null,t),v.createElement($6,{hasRange:l},l&&v.createElement(G6,u1({value:parseFloat(n),onDrag:i},r)),v.createElement(va,u1({},e,{id:o,label:"value",innerLabelTrim:l?0:1}))))}const{sanitizeStep:L6}=aa,O6=n1(aa,["sanitizeStep"]);var T6=z({component:M6},O6);const R6=(e,t)=>D1().schema({options:D1().passesAnyOf(D1().object(),D1().array())}).test(t),F6=(e,{values:t})=>{if(t.indexOf(e)<0)throw Error("Selected value doesn't match Select options");return e},I6=(e,{values:t})=>t.indexOf(e),H6=e=>{let{value:t,options:n}=e,i,r;return Array.isArray(n)?(r=n,i=n.map(o=>String(o))):(r=Object.values(n),i=Object.keys(n)),"value"in e?r.includes(t)||(i.unshift(String(t)),r.unshift(t)):t=r[0],Object.values(n).includes(t)||(n[String(t)]=t),{value:t,settings:{keys:i,values:r}}};var N6=Object.freeze({__proto__:null,schema:R6,sanitize:F6,format:I6,normalize:H6});const z6=H("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),fn=H("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),Z6=H("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${fn}:focus + &`]:{$focusStyle:""},[`${fn}:hover + &`]:{$hoverStyle:""}});function U6({displayValue:e,value:t,onUpdate:n,id:i,settings:r,disabled:o}){const{keys:a,values:s}=r,l=h.useRef();return t===s[e]&&(l.current=a[e]),v.createElement(z6,null,v.createElement(fn,{id:i,value:e,onChange:u=>n(s[Number(u.currentTarget.value)]),disabled:o},a.map((u,d)=>v.createElement("option",{key:u,value:d},u))),v.createElement(Z6,null,l.current),v.createElement(Hn,{toggled:!0}))}function W6(){const{label:e,value:t,displayValue:n,onUpdate:i,id:r,disabled:o,settings:a}=x1();return v.createElement(T1,{input:!0},v.createElement(z1,null,e),v.createElement(U6,{id:r,value:t,displayValue:n,onUpdate:i,settings:a,disabled:o}))}var K6=z({component:W6},N6);const q6=e=>D1().string().test(e),Y6=e=>{if(typeof e!="string")throw Error("Invalid string");return e},X6=({value:e,editable:t=!0,rows:n=!1})=>({value:e,settings:{editable:t,rows:typeof n=="number"?n:n?5:0}});var Q6=Object.freeze({__proto__:null,schema:q6,sanitize:Y6,normalize:X6});const J6=["displayValue","onUpdate","onChange","editable"],e8=H("div",{whiteSpace:"pre-wrap"});function t8(e){let{displayValue:t,onUpdate:n,onChange:i,editable:r=!0}=e,o=n1(e,J6);return r?v.createElement(Fn,u1({value:t,onUpdate:n,onChange:i},o)):v.createElement(e8,null,t)}function n8(){const{label:e,settings:t,displayValue:n,onUpdate:i,onChange:r}=x1();return v.createElement(T1,{input:!0},v.createElement(z1,null,e),v.createElement(t8,u1({displayValue:n,onUpdate:i,onChange:r},t)))}var i8=z({component:n8},Q6);const r8=e=>D1().boolean().test(e),o8=e=>{if(typeof e!="boolean")throw Error("Invalid boolean");return e};var a8=Object.freeze({__proto__:null,schema:r8,sanitize:o8});const s8=H("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 l8({value:e,onUpdate:t,id:n,disabled:i}){return v.createElement(s8,null,v.createElement("input",{id:n,type:"checkbox",checked:e,onChange:r=>t(r.currentTarget.checked),disabled:i}),v.createElement("label",{htmlFor:n},v.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},v.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function c8(){const{label:e,value:t,onUpdate:n,disabled:i,id:r}=x1();return v.createElement(T1,{input:!0},v.createElement(z1,null,e),v.createElement(l8,{value:t,onUpdate:n,id:r,disabled:i}))}var u8=z({component:c8},a8);const d8=["locked"];function f8({value:e,id:t,valueKey:n,settings:i,onUpdate:r,innerLabelTrim:o}){const a=h.useRef(e[n]);a.current=e[n];const s=h.useCallback(u=>r({[n]:ea({type:"NUMBER",value:a.current,settings:i},u)}),[r,i,n]),l=ka({type:"NUMBER",value:e[n],settings:i,setValue:s});return v.createElement(va,{id:t,label:n,value:e[n],displayValue:l.displayValue,onUpdate:l.onUpdate,onChange:l.onChange,settings:i,innerLabelTrim:o})}const h8=H("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function m8(e){let{locked:t}=e,n=n1(e,d8);return v.createElement("svg",u1({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),t?v.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"}):v.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 Nn({value:e,onUpdate:t,settings:n,innerLabelTrim:i}){const{id:r,setSettings:o}=x1(),{lock:a,locked:s}=n;return v.createElement(h8,{withLock:a},a&&v.createElement(m8,{locked:s,onClick:()=>o({locked:!s})}),Object.keys(e).map((l,u)=>v.createElement(f8,{id:u===0?r:`${r}.${l}`,key:l,valueKey:l,value:e,settings:n[l],onUpdate:t,innerLabelTrim:i})))}const wa=(e,t)=>{const n={};let i=0,r=1/0;Object.entries(e).forEach(([o,a])=>{n[o]=ra(z({value:a},t[o])).settings,i=Math.max(i,n[o].step),r=Math.min(r,n[o].pad)});for(let o in n){const{step:a,min:s,max:l}=t[o]||{};!isFinite(a)&&(!isFinite(s)||!isFinite(l))&&(n[o].step=i,n[o].pad=r)}return n},p8=["lock"],x8=["value"];function k8(e){const t=D1().array().length(e).every.number(),n=i=>{if(!i||typeof i!="object")return!1;const r=Object.values(i);return r.length===e&&r.every(o=>isFinite(o))};return i=>t.test(i)||n(i)}function g8(e){return Array.isArray(e)?"array":"object"}function me(e,t,n){return g8(e)===t?e:t==="array"?Object.values(e):q4(e,n)}const C8=(e,t,n)=>{const i=me(e,"object",t.keys);for(let a in i)i[a]=ia(i[a],t[a]);const r=Object.keys(i);let o={};if(r.length===t.keys.length)o=i;else{const a=me(n,"object",t.keys);if(r.length===1&&t.locked){const s=r[0],l=i[s],u=a[s],d=u!==0?l/u:1;for(let f in a)f===s?o[s]=l:o[f]=a[f]*d}else o=z(z({},a),i)}return me(o,t.format,t.keys)},y8=(e,t)=>me(e,"object",t.keys),b8=e=>!!e&&("step"in e||"min"in e||"max"in e);function v8(e,t,n=[]){const{lock:i=!1}=t,r=n1(t,p8),o=Array.isArray(e)?"array":"object",a=o==="object"?Object.keys(e):n,s=me(e,"object",a),l=b8(r)?a.reduce((d,f)=>Object.assign(d,{[f]:r}),{}):r,u=wa(s,l);return{value:o==="array"?e:s,settings:z(z({},u),{},{format:o,keys:a,lock:i,locked:!1})}}function Ea(e){return{schema:k8(e.length),normalize:t=>{let{value:n}=t,i=n1(t,x8);return v8(n,i,e)},format:(t,n)=>y8(t,n),sanitize:(t,n,i)=>C8(t,n,i)}}var w8={grad:.9,turn:360,rad:360/(2*Math.PI)},J1=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},f1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},L1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},Sa=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},ar=function(e){return{r:L1(e.r,0,255),g:L1(e.g,0,255),b:L1(e.b,0,255),a:L1(e.a)}},Ft=function(e){return{r:f1(e.r),g:f1(e.g),b:f1(e.b),a:f1(e.a,3)}},E8=/^#([0-9a-f]{3,8})$/i,He=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Aa=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=Math.max(t,n,i),a=o-Math.min(t,n,i),s=a?o===t?(n-i)/a:o===n?2+(i-t)/a:4+(t-n)/a:0;return{h:60*(s<0?s+6:s),s:o?a/o*100:0,v:o/255*100,a:r}},_a=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var o=Math.floor(t),a=i*(1-n),s=i*(1-(t-o)*n),l=i*(1-(1-t+o)*n),u=o%6;return{r:255*[i,s,a,a,l,i][u],g:255*[l,i,i,s,a,a][u],b:255*[a,a,l,i,i,s][u],a:r}},sr=function(e){return{h:Sa(e.h),s:L1(e.s,0,100),l:L1(e.l,0,100),a:L1(e.a)}},lr=function(e){return{h:f1(e.h),s:f1(e.s),l:f1(e.l),a:f1(e.a,3)}},cr=function(e){return _a((n=(t=e).s,{h:t.h,s:(n*=((i=t.l)<50?i:100-i)/100)>0?2*n/(i+n)*100:0,v:i+n,a:t.a}));var t,n,i},pe=function(e){return{h:(t=Aa(e)).h,s:(r=(200-(n=t.s))*(i=t.v)/100)>0&&r<200?n*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,i,r},S8=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,A8=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_8=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,V8=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hn={string:[[function(e){var t=E8.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?f1(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?f1(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=_8.exec(e)||V8.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ar({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=S8.exec(e)||A8.exec(e);if(!t)return null;var n,i,r=sr({h:(n=t[1],i=t[2],i===void 0&&(i="deg"),Number(n)*(w8[i]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return cr(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=r===void 0?1:r;return J1(t)&&J1(n)&&J1(i)?ar({r:Number(t),g:Number(n),b:Number(i),a:Number(o)}):null},"rgb"],[function(e){var t=e.h,n=e.s,i=e.l,r=e.a,o=r===void 0?1:r;if(!J1(t)||!J1(n)||!J1(i))return null;var a=sr({h:Number(t),s:Number(n),l:Number(i),a:Number(o)});return cr(a)},"hsl"],[function(e){var t=e.h,n=e.s,i=e.v,r=e.a,o=r===void 0?1:r;if(!J1(t)||!J1(n)||!J1(i))return null;var a=function(s){return{h:Sa(s.h),s:L1(s.s,0,100),v:L1(s.v,0,100),a:L1(s.a)}}({h:Number(t),s:Number(n),v:Number(i),a:Number(o)});return _a(a)},"hsv"]]},ur=function(e,t){for(var n=0;n=.5},e.prototype.toHex=function(){return t=Ft(this.rgba),n=t.r,i=t.g,r=t.b,a=(o=t.a)<1?He(f1(255*o)):"","#"+He(n)+He(i)+He(r)+a;var t,n,i,r,o,a},e.prototype.toRgb=function(){return Ft(this.rgba)},e.prototype.toRgbString=function(){return t=Ft(this.rgba),n=t.r,i=t.g,r=t.b,(o=t.a)<1?"rgba("+n+", "+i+", "+r+", "+o+")":"rgb("+n+", "+i+", "+r+")";var t,n,i,r,o},e.prototype.toHsl=function(){return lr(pe(this.rgba))},e.prototype.toHslString=function(){return t=lr(pe(this.rgba)),n=t.h,i=t.s,r=t.l,(o=t.a)<1?"hsla("+n+", "+i+"%, "+r+"%, "+o+")":"hsl("+n+", "+i+"%, "+r+"%)";var t,n,i,r,o},e.prototype.toHsv=function(){return t=Aa(this.rgba),{h:f1(t.h),s:f1(t.s),v:f1(t.v),a:f1(t.a,3)};var t},e.prototype.invert=function(){return y1({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),y1(It(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),y1(It(this.rgba,-t))},e.prototype.grayscale=function(){return y1(It(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),y1(dr(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),y1(dr(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"?y1({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):f1(this.rgba.a,3);var n},e.prototype.hue=function(t){var n=pe(this.rgba);return typeof t=="number"?y1({h:t,s:n.s,l:n.l,a:n.a}):f1(n.h)},e.prototype.isEqual=function(t){return this.toHex()===y1(t).toHex()},e}(),y1=function(e){return e instanceof mn?e:new mn(e)},fr=[],B8=function(e){e.forEach(function(t){fr.indexOf(t)<0&&(t(mn,hn),fr.push(t))})};function j8(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"},i={};for(var r in n)i[n[r]]=r;var o={};e.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var s,l,u=i[this.toHex()];if(u)return u;if(a!=null&&a.closest){var d=this.toRgb(),f=1/0,m="black";if(!o.length)for(var k in n)o[k]=new e(n[k]).toRgb();for(var p in n){var g=(s=d,l=o[p],Math.pow(s.r-l.r,2)+Math.pow(s.g-l.g,2)+Math.pow(s.b-l.b,2));g=0||(r[n]=e[n]);return r}function pn(e){var t=h.useRef(e),n=h.useRef(function(i){t.current&&t.current(i)});return t.current=e,n.current}var W0=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e0:C.buttons>0)&&r.current?o(hr(r.current,C,s.current)):g(!1)},p=function(){return g(!1)};function g(C){var x=l.current,y=xn(r.current),b=C?y.addEventListener:y.removeEventListener;b(x?"touchmove":"mousemove",k),b(x?"touchend":"mouseup",p)}return[function(C){var x=C.nativeEvent,y=r.current;if(y&&(mr(x),!function(w,E){return E&&!xe(w)}(x,l.current)&&y)){if(xe(x)){l.current=!0;var b=x.changedTouches||[];b.length&&(s.current=b[0].identifier)}y.focus(),o(hr(y,x,s.current)),g(!0)}},function(C){var x=C.which||C.keyCode;x<37||x>40||(C.preventDefault(),a({left:x===39?.05:x===37?-.05:0,top:x===40?.05:x===38?-.05:0}))},g]},[a,o]),d=u[0],f=u[1],m=u[2];return h.useEffect(function(){return m},[m]),v.createElement("div",ee({},i,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:r,onKeyDown:f,tabIndex:0,role:"slider"}))}),Pe=function(e){return e.filter(Boolean).join(" ")},Un=function(e){var t=e.color,n=e.left,i=e.top,r=i===void 0?.5:i,o=Pe(["react-colorful__pointer",e.className]);return v.createElement("div",{className:o,style:{top:100*r+"%",left:100*n+"%"}},v.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},v1=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},Da=function(e){var t=e.s,n=e.v,i=e.a,r=(200-t)*n/100;return{h:v1(e.h),s:v1(r>0&&r<200?t*n/100/(r<=100?r:200-r)*100:0),l:v1(r/2),a:v1(i,2)}},kn=function(e){var t=Da(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},Nt=function(e){var t=Da(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},Ba=function(e){var t=e.h,n=e.s,i=e.v,r=e.a;t=t/360*6,n/=100,i/=100;var o=Math.floor(t),a=i*(1-n),s=i*(1-(t-o)*n),l=i*(1-(1-t+o)*n),u=o%6;return{r:v1(255*[i,s,a,a,l,i][u]),g:v1(255*[l,i,i,s,a,a][u]),b:v1(255*[a,a,l,i,i,s][u]),a:v1(r,2)}},ja=function(e){var t=e.r,n=e.g,i=e.b,r=e.a,o=Math.max(t,n,i),a=o-Math.min(t,n,i),s=a?o===t?(n-i)/a:o===n?2+(i-t)/a:4+(t-n)/a:0;return{h:v1(60*(s<0?s+6:s)),s:v1(o?a/o*100:0),v:v1(o/255*100),a:r}},$a=v.memo(function(e){var t=e.hue,n=e.onChange,i=Pe(["react-colorful__hue",e.className]);return v.createElement("div",{className:i},v.createElement(Zn,{onMove:function(r){n({h:360*r.left})},onKey:function(r){n({h:W0(t+360*r.left,0,360)})},"aria-label":"Hue","aria-valuenow":v1(t),"aria-valuemax":"360","aria-valuemin":"0"},v.createElement(Un,{className:"react-colorful__hue-pointer",left:t/360,color:kn({h:t,s:100,v:100,a:1})})))}),Ga=v.memo(function(e){var t=e.hsva,n=e.onChange,i={backgroundColor:kn({h:t.h,s:100,v:100,a:1})};return v.createElement("div",{className:"react-colorful__saturation",style:i},v.createElement(Zn,{onMove:function(r){n({s:100*r.left,v:100-100*r.top})},onKey:function(r){n({s:W0(t.s+100*r.left,0,100),v:W0(t.v-100*r.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+v1(t.s)+"%, Brightness "+v1(t.v)+"%"},v.createElement(Un,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:kn(t)})))}),Wn=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Pa(e,t,n){var i=pn(n),r=h.useState(function(){return e.toHsva(t)}),o=r[0],a=r[1],s=h.useRef({color:t,hsva:o});h.useEffect(function(){if(!e.equal(t,s.current.color)){var u=e.toHsva(t);s.current={hsva:u,color:t},a(u)}},[t,e]),h.useEffect(function(){var u;Wn(o,s.current.hsva)||e.equal(u=e.fromHsva(o),s.current.color)||(s.current={hsva:o,color:u},i(u))},[o,e,i]);var l=h.useCallback(function(u){a(function(d){return Object.assign({},d,u)})},[]);return[o,l]}var $8=typeof window<"u"?h.useLayoutEffect:h.useEffect,G8=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},pr=new Map,Ma=function(e){$8(function(){var t=e.current?e.current.ownerDocument:document;if(t!==void 0&&!pr.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}`,pr.set(t,n);var i=G8();i&&n.setAttribute("nonce",i),t.head.appendChild(n)}},[])},P8=function(e){var t=e.className,n=e.colorModel,i=e.color,r=i===void 0?n.defaultColor:i,o=e.onChange,a=zn(e,["className","colorModel","color","onChange"]),s=h.useRef(null);Ma(s);var l=Pa(n,r,o),u=l[0],d=l[1],f=Pe(["react-colorful",t]);return v.createElement("div",ee({},a,{ref:s,className:f}),v.createElement(Ga,{hsva:u,onChange:d}),v.createElement($a,{hue:u.h,onChange:d,className:"react-colorful__last-control"}))},M8=function(e){var t=e.className,n=e.hsva,i=e.onChange,r={backgroundImage:"linear-gradient(90deg, "+Nt(Object.assign({},n,{a:0}))+", "+Nt(Object.assign({},n,{a:1}))+")"},o=Pe(["react-colorful__alpha",t]),a=v1(100*n.a);return v.createElement("div",{className:o},v.createElement("div",{className:"react-colorful__alpha-gradient",style:r}),v.createElement(Zn,{onMove:function(s){i({a:s.left})},onKey:function(s){i({a:W0(n.a+s.left)})},"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},v.createElement(Un,{className:"react-colorful__alpha-pointer",left:n.a,color:Nt(n)})))},L8=function(e){var t=e.className,n=e.colorModel,i=e.color,r=i===void 0?n.defaultColor:i,o=e.onChange,a=zn(e,["className","colorModel","color","onChange"]),s=h.useRef(null);Ma(s);var l=Pa(n,r,o),u=l[0],d=l[1],f=Pe(["react-colorful",t]);return v.createElement("div",ee({},a,{ref:s,className:f}),v.createElement(Ga,{hsva:u,onChange:d}),v.createElement($a,{hue:u.h,onChange:d}),v.createElement(M8,{hsva:u,onChange:d,className:"react-colorful__last-control"}))},O8={defaultColor:{r:0,g:0,b:0,a:1},toHsva:ja,fromHsva:Ba,equal:Wn},T8=function(e){return v.createElement(L8,ee({},e,{colorModel:O8}))},R8={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return ja({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(t=Ba(e)).r,g:t.g,b:t.b};var t},equal:Wn},F8=function(e){return v.createElement(P8,ee({},e,{colorModel:R8}))};function ip(e,t,n,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(a=e[s])&&(o=(r<3?a(o):r>3?a(t,n,o):a(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function te(e,t,n,i){function r(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(d){try{u(i.next(d))}catch(f){a(f)}}function l(d){try{u(i.throw(d))}catch(f){a(f)}}function u(d){d.done?o(d.value):r(d.value).then(s,l)}u((i=i.apply(e,t||[])).next())})}function ne(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(d){return l([u,d])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(n=0)),n;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]0)&&!(r=i.next()).done;)o.push(r.value)}catch(s){a={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(a)throw a.error}}return o}function H8(){for(var e=[],t=0;t0?i:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function z8(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var i=t.split(".").pop().toLowerCase(),r=N8.get(i);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}var Z8=[".DS_Store","Thumbs.db"];function U8(e){return te(this,void 0,void 0,function(){return ne(this,function(t){return at(e)&&W8(e)?[2,X8(e.dataTransfer,e.type)]:K8(e)?[2,q8(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,Y8(e)]:[2,[]]})})}function W8(e){return at(e.dataTransfer)}function K8(e){return at(e)&&at(e.target)}function at(e){return typeof e=="object"&&e!==null}function q8(e){return gn(e.target.files).map(function(t){return Me(t)})}function Y8(e){return te(this,void 0,void 0,function(){var t;return ne(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(i){return i.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(i){return Me(i)})]}})})}function X8(e,t){return te(this,void 0,void 0,function(){var n,i;return ne(this,function(r){switch(r.label){case 0:return e===null?[2,[]]:e.items?(n=gn(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(Q8))]):[3,2];case 1:return i=r.sent(),[2,xr(La(i))];case 2:return[2,xr(gn(e.files).map(function(o){return Me(o)}))]}})})}function xr(e){return e.filter(function(t){return Z8.indexOf(t.name)===-1})}function gn(e){if(e===null)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);nn)return[!1,vr(n)];if(e.sizen)return[!1,vr(n)]}return[!0,null]}function ae(e){return e!=null}function fc(e){var t=e.files,n=e.accept,i=e.minSize,r=e.maxSize,o=e.multiple,a=e.maxFiles;return!o&&t.length>1||o&&a>=1&&t.length>a?!1:t.every(function(s){var l=Ra(s,n),u=yr(l,1),d=u[0],f=Fa(s,i,r),m=yr(f,1),k=m[0];return d&&k})}function st(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ne(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 Er(e){e.preventDefault()}function hc(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function mc(e){return e.indexOf("Edge/")!==-1}function pc(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return hc(e)||mc(e)}function q1(){for(var e=arguments.length,t=new Array(e),n=0;n1?r-1:0),a=1;ae.length)&&(t=e.length);for(var n=0,i=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(n[i]=e[i])}return n}function jc(e,t){if(e==null)return{};var n={},i=Object.keys(e),r,o;for(o=0;o=0)&&(n[r]=e[r]);return n}var Kn=h.forwardRef(function(e,t){var n=e.children,i=lt(e,yc),r=Na(i),o=r.open,a=lt(r,bc);return h.useImperativeHandle(t,function(){return{open:o}},[o]),v.createElement(h.Fragment,null,n(s1(s1({},a),{},{open:o})))});Kn.displayName="Dropzone";var Ha={disabled:!1,getFilesFromEvent:U8,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};Kn.defaultProps=Ha;Kn.propTypes={children:o1.func,accept:o1.oneOfType([o1.string,o1.arrayOf(o1.string)]),multiple:o1.bool,preventDropOnDocument:o1.bool,noClick:o1.bool,noKeyboard:o1.bool,noDrag:o1.bool,noDragEventsBubbling:o1.bool,minSize:o1.number,maxSize:o1.number,maxFiles:o1.number,disabled:o1.bool,getFilesFromEvent:o1.func,onFileDialogCancel:o1.func,onFileDialogOpen:o1.func,useFsAccessApi:o1.bool,onDragEnter:o1.func,onDragLeave:o1.func,onDragOver:o1.func,onDrop:o1.func,onDropAccepted:o1.func,onDropRejected:o1.func,validator:o1.func};var bn={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function Na(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=s1(s1({},Ha),e),n=t.accept,i=t.disabled,r=t.getFilesFromEvent,o=t.maxSize,a=t.minSize,s=t.multiple,l=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,f=t.onDragOver,m=t.onDrop,k=t.onDropAccepted,p=t.onDropRejected,g=t.onFileDialogCancel,C=t.onFileDialogOpen,x=t.useFsAccessApi,y=t.preventDropOnDocument,b=t.noClick,w=t.noKeyboard,E=t.noDrag,S=t.noDragEventsBubbling,A=t.validator,_=h.useMemo(function(){return typeof C=="function"?C:Ar},[C]),G=h.useMemo(function(){return typeof g=="function"?g:Ar},[g]),B=h.useRef(null),D=h.useRef(null),V=h.useReducer($c,bn),R=zt(V,2),P=R[0],$=R[1],j=P.isFocused,L=P.isFileDialogActive,Z=P.draggedFiles,U=h.useRef(typeof window<"u"&&window.isSecureContext&&x&&xc()),J=function(){!U.current&&L&&setTimeout(function(){if(D.current){var I=D.current.files;I.length||($({type:"closeDialog"}),G())}},300)};h.useEffect(function(){return window.addEventListener("focus",J,!1),function(){window.removeEventListener("focus",J,!1)}},[D,L,G,U]);var W=h.useRef([]),M=function(I){B.current&&B.current.contains(I.target)||(I.preventDefault(),W.current=[])};h.useEffect(function(){return y&&(document.addEventListener("dragover",Er,!1),document.addEventListener("drop",M,!1)),function(){y&&(document.removeEventListener("dragover",Er),document.removeEventListener("drop",M))}},[B,y]);var Q=h.useCallback(function(O){O.preventDefault(),O.persist(),Z1(O),W.current=[].concat(Ec(W.current),[O.target]),Ne(O)&&Promise.resolve(r(O)).then(function(I){st(O)&&!S||($({draggedFiles:I,isDragActive:!0,type:"setDraggedFiles"}),u&&u(O))})},[r,u,S]),e1=h.useCallback(function(O){O.preventDefault(),O.persist(),Z1(O);var I=Ne(O);if(I&&O.dataTransfer)try{O.dataTransfer.dropEffect="copy"}catch{}return I&&f&&f(O),!1},[f,S]),X=h.useCallback(function(O){O.preventDefault(),O.persist(),Z1(O);var I=W.current.filter(function(_1){return B.current&&B.current.contains(_1)}),h1=I.indexOf(O.target);h1!==-1&&I.splice(h1,1),W.current=I,!(I.length>0)&&($({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),Ne(O)&&d&&d(O))},[B,d,S]),d1=h.useCallback(function(O,I){var h1=[],_1=[];O.forEach(function(F1){var ie=Ra(F1,n),P0=zt(ie,2),At=P0[0],_t=P0[1],Vt=Fa(F1,a,o),Oe=zt(Vt,2),Dt=Oe[0],Bt=Oe[1],jt=A?A(F1):null;if(At&&Dt&&!jt)h1.push(F1);else{var $t=[_t,Bt];jt&&($t=$t.concat(jt)),_1.push({file:F1,errors:$t.filter(function(Ss){return Ss})})}}),(!s&&h1.length>1||s&&l>=1&&h1.length>l)&&(h1.forEach(function(F1){_1.push({file:F1,errors:[dc]})}),h1.splice(0)),$({acceptedFiles:h1,fileRejections:_1,type:"setFiles"}),m&&m(h1,_1,I),_1.length>0&&p&&p(_1,I),h1.length>0&&k&&k(h1,I)},[$,s,n,a,o,l,m,k,p,A]),S1=h.useCallback(function(O){O.preventDefault(),O.persist(),Z1(O),W.current=[],Ne(O)&&Promise.resolve(r(O)).then(function(I){st(O)&&!S||d1(I,O)}),$({type:"reset"})},[r,d1,S]),A1=h.useCallback(function(){if(U.current){$({type:"openDialog"}),_();var O={multiple:s,types:kc(n)};window.showOpenFilePicker(O).then(function(I){return r(I)}).then(function(I){d1(I,null),$({type:"closeDialog"})}).catch(function(I){gc(I)?(G(I),$({type:"closeDialog"})):Cc(I)&&(U.current=!1,D.current&&(D.current.value=null,D.current.click()))});return}D.current&&($({type:"openDialog"}),_(),D.current.value=null,D.current.click())},[$,_,G,x,d1,n,s]),j1=h.useCallback(function(O){!B.current||!B.current.isEqualNode(O.target)||(O.key===" "||O.key==="Enter"||O.keyCode===32||O.keyCode===13)&&(O.preventDefault(),A1())},[B,A1]),R1=h.useCallback(function(){$({type:"focus"})},[]),d0=h.useCallback(function(){$({type:"blur"})},[]),f0=h.useCallback(function(){b||(pc()?setTimeout(A1,0):A1())},[b,A1]),Y=function(I){return i?null:I},r1=function(I){return w?null:Y(I)},a1=function(I){return E?null:Y(I)},Z1=function(I){S&&I.stopPropagation()},U1=h.useMemo(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},I=O.refKey,h1=I===void 0?"ref":I,_1=O.role,F1=O.onKeyDown,ie=O.onFocus,P0=O.onBlur,At=O.onClick,_t=O.onDragEnter,Vt=O.onDragOver,Oe=O.onDragLeave,Dt=O.onDrop,Bt=lt(O,vc);return s1(s1(yn({onKeyDown:r1(q1(F1,j1)),onFocus:r1(q1(ie,R1)),onBlur:r1(q1(P0,d0)),onClick:Y(q1(At,f0)),onDragEnter:a1(q1(_t,Q)),onDragOver:a1(q1(Vt,e1)),onDragLeave:a1(q1(Oe,X)),onDrop:a1(q1(Dt,S1)),role:typeof _1=="string"&&_1!==""?_1:"button"},h1,B),!i&&!w?{tabIndex:0}:{}),Bt)}},[B,j1,R1,d0,f0,Q,e1,X,S1,w,E,i]),W1=h.useCallback(function(O){O.stopPropagation()},[]),G0=h.useMemo(function(){return function(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},I=O.refKey,h1=I===void 0?"ref":I,_1=O.onChange,F1=O.onClick,ie=lt(O,wc),P0=yn({accept:n,multiple:s,type:"file",style:{display:"none"},onChange:Y(q1(_1,S1)),onClick:Y(q1(F1,W1)),tabIndex:-1},h1,D);return s1(s1({},P0),ie)}},[D,n,s,S1,i]),C0=Z.length,K1=C0>0&&fc({files:Z,accept:n,minSize:a,maxSize:o,multiple:s,maxFiles:l}),Le=C0>0&&!K1;return s1(s1({},P),{},{isDragAccept:K1,isDragReject:Le,isFocused:j&&!i,getRootProps:U1,getInputProps:G0,rootRef:B,inputRef:D,open:Y(A1)})}function $c(e,t){switch(t.type){case"focus":return s1(s1({},e),{},{isFocused:!0});case"blur":return s1(s1({},e),{},{isFocused:!1});case"openDialog":return s1(s1({},bn),{},{isFileDialogActive:!0});case"closeDialog":return s1(s1({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,i=t.draggedFiles;return s1(s1({},e),{},{draggedFiles:i,isDragActive:n});case"setFiles":return s1(s1({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return s1({},bn);default:return e}}function Ar(){}function Gc(e){let t;const n=new Set,i=(u,d)=>{const f=typeof u=="function"?u(t):u;if(f!==t){const m=t;t=d?f:Object.assign({},t,f),n.forEach(k=>k(t,m))}},r=()=>t,o=(u,d=r,f=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let m=d(t);function k(){const p=d(t);if(!f(m,p)){const g=m;u(m=p,g)}}return n.add(k),()=>n.delete(k)},l={setState:i,getState:r,subscribe:(u,d,f)=>d||f?o(u,d,f):(n.add(u),()=>n.delete(u)),destroy:()=>n.clear()};return t=e(i,r,l),l}const Pc=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),_r=Pc?h.useEffect:h.useLayoutEffect;function Mc(e){const t=typeof e=="function"?Gc(e):e,n=(i=t.getState,r=Object.is)=>{const[,o]=h.useReducer(C=>C+1,0),a=t.getState(),s=h.useRef(a),l=h.useRef(i),u=h.useRef(r),d=h.useRef(!1),f=h.useRef();f.current===void 0&&(f.current=i(a));let m,k=!1;(s.current!==a||l.current!==i||u.current!==r||d.current)&&(m=i(a),k=!r(f.current,m)),_r(()=>{k&&(f.current=m),s.current=a,l.current=i,u.current=r,d.current=!1});const p=h.useRef(a);_r(()=>{const C=()=>{try{const y=t.getState(),b=l.current(y);u.current(f.current,b)||(s.current=y,f.current=b,o())}catch{d.current=!0,o()}},x=t.subscribe(C);return t.getState()!==p.current&&C(),x},[]);const g=k?m:f.current;return h.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 i=[n,t];return{next(){const r=i.length<=0;return{value:i.shift(),done:r}}}},n}const Lc=e=>(t,n,i)=>{const r=i.subscribe;return i.subscribe=(a,s,l)=>{let u=a;if(s){const d=(l==null?void 0:l.equalityFn)||Object.is;let f=a(i.getState());u=m=>{const k=a(m);if(!d(f,k)){const p=f;s(f=k,p)}},l!=null&&l.fireImmediately&&s(f,f)}return r(u)},e(t,n,i)};/*! @@ -313,7 +313,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho top: 65px; right: 55px; z-index: 100; -`,Kd=()=>{const e=h.useContext(Gs);return e==null?void 0:e.socket},qd={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,hasInstagraphInProgress:!1,teachMeAnswer:null,instgraphAnswser:null},Yd=An(e=>({...qd,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,i,r,o;(n=t==null?void 0:t.instagraph)!=null&&n.edges&&((i=t==null?void 0:t.instagraph)!=null&&i.nodes)&&e({hasInstagraphInProgress:!1,instgraphAnswser:{edges:(r=t==null?void 0:t.instagraph)==null?void 0:r.edges,nodes:(o=t==null?void 0:t.instagraph)==null?void 0:o.nodes}})}})),Xd="0.1.106",Qd=h.lazy(()=>m1(()=>import("./index-c5f67a31.js"),["assets/index-c5f67a31.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/ClipLoader-049391dc.js","assets/Tabs-0da0e37b.js","assets/createSvgIcon-e167cb2e.js"]).then(({SettingsModal:e})=>({default:e}))),Jd=h.lazy(()=>m1(()=>import("./index-ef0f2344.js"),["assets/index-ef0f2344.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/ClipLoader-049391dc.js"]).then(({AddContentModal:e})=>({default:e}))),ef=h.lazy(()=>m1(()=>import("./index-1b04a0aa.js"),["assets/index-1b04a0aa.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/ClipLoader-049391dc.js","assets/index-d206d03e.js","assets/three.module-d9fcef06.js","assets/index-f0acd212.js","assets/Stack-25a86e54.js","assets/createSvgIcon-e167cb2e.js","assets/TextareaAutosize-e1814669.js","assets/index-64f1c910.js"]).then(({AddItemModal:e})=>({default:e}))),tf=h.lazy(()=>m1(()=>import("./index-0b924162.js"),["assets/index-0b924162.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/constants-d7d823df.js","assets/ClipLoader-049391dc.js","assets/index-f0acd212.js","assets/Stack-25a86e54.js","assets/createSvgIcon-e167cb2e.js","assets/TextareaAutosize-e1814669.js","assets/index-1dfdd521.js","assets/Typography-76a3ec92.js","assets/Tabs-0da0e37b.js"]).then(({SourcesTableModal:e})=>({default:e}))),nf=h.lazy(()=>m1(()=>import("./index-e2c4ec69.js"),["assets/index-e2c4ec69.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/Skeleton-96227392.js","assets/ClipLoader-049391dc.js"]).then(({EditNodeNameModal:e})=>({default:e}))),rf=h.lazy(()=>m1(()=>import("./index-2730636d.js"),["assets/index-2730636d.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/Skeleton-96227392.js","assets/ClipLoader-049391dc.js"]).then(({RemoveNodeModal:e})=>({default:e}))),of=h.lazy(()=>m1(()=>import("./index-af738b28.js"),["assets/index-af738b28.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/index-f0acd212.js","assets/Stack-25a86e54.js","assets/createSvgIcon-e167cb2e.js","assets/TextareaAutosize-e1814669.js","assets/constants-d7d823df.js","assets/ClipLoader-049391dc.js"]).then(({AddNodeEdgeModal:e})=>({default:e}))),af=h.lazy(()=>m1(()=>import("./index-783bc78c.js"),["assets/index-783bc78c.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/index-1dfdd521.js","assets/constants-d7d823df.js","assets/index-f0acd212.js","assets/Stack-25a86e54.js","assets/createSvgIcon-e167cb2e.js","assets/TextareaAutosize-e1814669.js","assets/ClipLoader-049391dc.js"]).then(({MergeNodeModal:e})=>({default:e}))),sf=h.lazy(()=>m1(()=>import("./index-3e9f068c.js"),["assets/index-3e9f068c.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/index-d206d03e.js","assets/three.module-d9fcef06.js","assets/ClipLoader-049391dc.js","assets/index-f0acd212.js","assets/Stack-25a86e54.js","assets/createSvgIcon-e167cb2e.js","assets/TextareaAutosize-e1814669.js","assets/index-64f1c910.js"]).then(({ChangeNodeTypeModal:e})=>({default:e}))),lf=h.lazy(()=>m1(()=>import("./index-a71e4c22.js"),["assets/index-a71e4c22.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/index-f0acd212.js","assets/Stack-25a86e54.js","assets/createSvgIcon-e167cb2e.js","assets/TextareaAutosize-e1814669.js","assets/ClipLoader-049391dc.js","assets/map-b1c613ac.js","assets/Typography-76a3ec92.js","assets/Tabs-0da0e37b.js","assets/index-d206d03e.js","assets/three.module-d9fcef06.js","assets/index-710d3c1e.js"]).then(({BlueprintModal:e})=>({default:e}))),cf=h.lazy(()=>m1(()=>import("./index-5da32e84.js"),["assets/index-5da32e84.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]).then(({UserFeedBackModal:e})=>({default:e}))),uf=h.lazy(()=>m1(()=>import("./index-0f2fdc5b.js"),["assets/index-0f2fdc5b.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/index-f0acd212.js","assets/Stack-25a86e54.js","assets/createSvgIcon-e167cb2e.js","assets/TextareaAutosize-e1814669.js"]).then(({CreateBountyModal:e})=>({default:e}))),df=h.lazy(()=>m1(()=>import("./index-16ff4e55.js").then(e=>e.cb),["assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]).then(({OnboardingModal:e})=>({default:e}))),ff=h.lazy(()=>m1(()=>import("./index-6b3671e3.js"),["assets/index-6b3671e3.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]).then(({BriefDescription:e})=>({default:e}))),hf=()=>c.jsxs(c.Fragment,{children:[c.jsx(ef,{}),c.jsx(Jd,{}),c.jsx(Qd,{}),c.jsx(nf,{}),c.jsx(rf,{}),c.jsx(tf,{}),c.jsx(of,{}),c.jsx(sf,{}),c.jsx(lf,{}),c.jsx(af,{}),c.jsx(cf,{}),c.jsx(uf,{}),c.jsx(df,{}),c.jsx(ff,{})]}),mf=()=>{const[e,t]=h.useState(null),{runningProjectMessages:n}=g0(s=>s),i=s=>{t(s.currentTarget)},r=()=>{t(null)},o=!!e,a=o?"simple-popover":void 0;return n.length?c.jsxs(pf,{ml:8,children:[c.jsx(kf,{onClick:i,children:c.jsxs(mt,{content:"Messages",margin:"18px",children:[c.jsx("div",{className:"icon",children:c.jsx(no,{})}),c.jsx("div",{className:"text",children:c.jsx("p",{children:n.length})})]})}),c.jsxs(gf,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:a,onClose:r,open:o,children:[c.jsx(vs,{onClick:r,children:c.jsx(xt,{})}),c.jsx(xf,{p:16,children:n.map(s=>c.jsx("p",{className:"item",children:s},s))})]})]}):null},pf=q(K).attrs({align:"center",direction:"row",grow:0,justify:"flex-start"})``,xf=q(K)` +`,Kd=()=>{const e=h.useContext(Gs);return e==null?void 0:e.socket},qd={askedQuestions:null,askedQuestionsAnswers:null,hasQuestionInProgress:!1,hasTeachingInProgress:!1,hasInstagraphInProgress:!1,teachMeAnswer:null,instgraphAnswser:null},Yd=An(e=>({...qd,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,i,r,o;(n=t==null?void 0:t.instagraph)!=null&&n.edges&&((i=t==null?void 0:t.instagraph)!=null&&i.nodes)&&e({hasInstagraphInProgress:!1,instgraphAnswser:{edges:(r=t==null?void 0:t.instagraph)==null?void 0:r.edges,nodes:(o=t==null?void 0:t.instagraph)==null?void 0:o.nodes}})}})),Xd="0.1.106",Qd=h.lazy(()=>m1(()=>import("./index-d346b8ca.js"),["assets/index-d346b8ca.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/ClipLoader-601f6378.js","assets/Tabs-02e36f7f.js","assets/createSvgIcon-2fe026f6.js"]).then(({SettingsModal:e})=>({default:e}))),Jd=h.lazy(()=>m1(()=>import("./index-bd8ab9bc.js"),["assets/index-bd8ab9bc.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/ClipLoader-601f6378.js"]).then(({AddContentModal:e})=>({default:e}))),ef=h.lazy(()=>m1(()=>import("./index-ec9bfb02.js"),["assets/index-ec9bfb02.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/ClipLoader-601f6378.js","assets/index-d206d03e.js","assets/three.module-d9fcef06.js","assets/index-891a66a8.js","assets/Stack-7f131eb3.js","assets/createSvgIcon-2fe026f6.js","assets/TextareaAutosize-cc9b3a66.js","assets/index-64f1c910.js"]).then(({AddItemModal:e})=>({default:e}))),tf=h.lazy(()=>m1(()=>import("./index-494b0bf5.js"),["assets/index-494b0bf5.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/constants-ccce11dd.js","assets/ClipLoader-601f6378.js","assets/index-891a66a8.js","assets/Stack-7f131eb3.js","assets/createSvgIcon-2fe026f6.js","assets/TextareaAutosize-cc9b3a66.js","assets/index-6d84bf5a.js","assets/Typography-50924238.js","assets/Tabs-02e36f7f.js"]).then(({SourcesTableModal:e})=>({default:e}))),nf=h.lazy(()=>m1(()=>import("./index-81fe6815.js"),["assets/index-81fe6815.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/Skeleton-7bdfc65c.js","assets/ClipLoader-601f6378.js"]).then(({EditNodeNameModal:e})=>({default:e}))),rf=h.lazy(()=>m1(()=>import("./index-980e06d3.js"),["assets/index-980e06d3.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/Skeleton-7bdfc65c.js","assets/ClipLoader-601f6378.js"]).then(({RemoveNodeModal:e})=>({default:e}))),of=h.lazy(()=>m1(()=>import("./index-d8e2e62f.js"),["assets/index-d8e2e62f.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/index-891a66a8.js","assets/Stack-7f131eb3.js","assets/createSvgIcon-2fe026f6.js","assets/TextareaAutosize-cc9b3a66.js","assets/constants-ccce11dd.js","assets/ClipLoader-601f6378.js"]).then(({AddNodeEdgeModal:e})=>({default:e}))),af=h.lazy(()=>m1(()=>import("./index-3aed121f.js"),["assets/index-3aed121f.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/index-6d84bf5a.js","assets/constants-ccce11dd.js","assets/index-891a66a8.js","assets/Stack-7f131eb3.js","assets/createSvgIcon-2fe026f6.js","assets/TextareaAutosize-cc9b3a66.js","assets/ClipLoader-601f6378.js"]).then(({MergeNodeModal:e})=>({default:e}))),sf=h.lazy(()=>m1(()=>import("./index-5226b9ef.js"),["assets/index-5226b9ef.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/index-d206d03e.js","assets/three.module-d9fcef06.js","assets/ClipLoader-601f6378.js","assets/index-891a66a8.js","assets/Stack-7f131eb3.js","assets/createSvgIcon-2fe026f6.js","assets/TextareaAutosize-cc9b3a66.js","assets/index-64f1c910.js"]).then(({ChangeNodeTypeModal:e})=>({default:e}))),lf=h.lazy(()=>m1(()=>import("./index-7fd57bd5.js"),["assets/index-7fd57bd5.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/index-891a66a8.js","assets/Stack-7f131eb3.js","assets/createSvgIcon-2fe026f6.js","assets/TextareaAutosize-cc9b3a66.js","assets/ClipLoader-601f6378.js","assets/map-76fdca3a.js","assets/Typography-50924238.js","assets/Tabs-02e36f7f.js","assets/index-d206d03e.js","assets/three.module-d9fcef06.js","assets/index-8f6ab1fe.js"]).then(({BlueprintModal:e})=>({default:e}))),cf=h.lazy(()=>m1(()=>import("./index-0df2a58d.js"),["assets/index-0df2a58d.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]).then(({UserFeedBackModal:e})=>({default:e}))),uf=h.lazy(()=>m1(()=>import("./index-e9d8f381.js"),["assets/index-e9d8f381.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/index-891a66a8.js","assets/Stack-7f131eb3.js","assets/createSvgIcon-2fe026f6.js","assets/TextareaAutosize-cc9b3a66.js"]).then(({CreateBountyModal:e})=>({default:e}))),df=h.lazy(()=>m1(()=>import("./index-4c5f8236.js").then(e=>e.cb),["assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]).then(({OnboardingModal:e})=>({default:e}))),ff=h.lazy(()=>m1(()=>import("./index-0d9e6a7d.js"),["assets/index-0d9e6a7d.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]).then(({BriefDescription:e})=>({default:e}))),hf=()=>c.jsxs(c.Fragment,{children:[c.jsx(ef,{}),c.jsx(Jd,{}),c.jsx(Qd,{}),c.jsx(nf,{}),c.jsx(rf,{}),c.jsx(tf,{}),c.jsx(of,{}),c.jsx(sf,{}),c.jsx(lf,{}),c.jsx(af,{}),c.jsx(cf,{}),c.jsx(uf,{}),c.jsx(df,{}),c.jsx(ff,{})]}),mf=()=>{const[e,t]=h.useState(null),{runningProjectMessages:n}=g0(s=>s),i=s=>{t(s.currentTarget)},r=()=>{t(null)},o=!!e,a=o?"simple-popover":void 0;return n.length?c.jsxs(pf,{ml:8,children:[c.jsx(kf,{onClick:i,children:c.jsxs(mt,{content:"Messages",margin:"18px",children:[c.jsx("div",{className:"icon",children:c.jsx(no,{})}),c.jsx("div",{className:"text",children:c.jsx("p",{children:n.length})})]})}),c.jsxs(gf,{anchorEl:e,anchorOrigin:{vertical:"bottom",horizontal:"right"},id:a,onClose:r,open:o,children:[c.jsx(vs,{onClick:r,children:c.jsx(xt,{})}),c.jsx(xf,{p:16,children:n.map(s=>c.jsx("p",{className:"item",children:s},s))})]})]}):null},pf=q(K).attrs({align:"center",direction:"row",grow:0,justify:"flex-start"})``,xf=q(K)` max-height: 50vh; max-width: 30vw; background: transparent; @@ -623,4 +623,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho color: ${N.white}; font-size: 12px; opacity: 0.5; -`,Um=h.lazy(()=>m1(()=>import("./index-b67e6350.js"),["assets/index-b67e6350.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]).then(({MainToolbar:e})=>({default:e}))),Wm=h.lazy(()=>m1(()=>import("./index-2fb8ee5b.js"),["assets/index-2fb8ee5b.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/index-710d3c1e.js","assets/three.module-d9fcef06.js","assets/TextareaAutosize-e1814669.js","assets/index-fe1fa9e4.js","assets/ClipLoader-049391dc.js"]).then(({Universe:e})=>({default:e}))),Km=h.lazy(()=>m1(()=>import("./index-e4c394ce.js").then(e=>e.i),["assets/index-e4c394ce.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css","assets/ClipLoader-049391dc.js","assets/Skeleton-96227392.js","assets/Stack-25a86e54.js","assets/map-b1c613ac.js","assets/Typography-76a3ec92.js","assets/createSvgIcon-e167cb2e.js","assets/index-6b3671e3.js","assets/index-fe1fa9e4.js"]).then(({SideBar:e})=>({default:e}))),qm=()=>{const[e]=Ns(),t=e.get("q"),{setBudget:n,setNodeCount:i}=Vn(M=>M),r=h.useRef(null),o=h.useRef(null),{setSidebarOpen:a,currentSearch:s,setCurrentSearch:l,setRelevanceSelected:u,setTranscriptOpen:d,universeQuestionIsOpen:f,setUniverseQuestionIsOpen:m}=kt(M=>M),k=Yd(M=>M.setTeachMeAnswer),{fetchData:p,setCategoryFilter:g,setAbortRequests:C,addNewNode:x,splashDataLoading:y,runningProjectId:b,setRunningProjectMessages:w,isFetching:E}=g0(M=>M),{setAiSummaryAnswer:S,getKeyExist:A,aiRefId:_}=io(M=>M),G=ii(),[B,D]=zs(M=>[M.realtimeGraphFeatureFlag,M.chatInterfaceFeatureFlag]),V=Kd(),R=Zs({mode:"onChange"}),{setValue:P}=R;h.useEffect(()=>{P("search",t??""),d(!1),G(null),u(!1),l(t??""),k(""),g(null)},[t,g,l,u,G,k,d,P]),h.useEffect(()=>{(async()=>{await p(n,C),a(!0),s?await Ks(n):G(null)})()},[s,p,n,C,a,G]);const $=h.useCallback(()=>{i("INCREMENT")},[i]),j=h.useCallback(M=>{E||(r.current||(r.current={nodes:[],edges:[]}),M.edges&&r.current.edges.push(...M.edges),M.nodes&&r.current.nodes.push(...M.nodes),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{const Q={...r.current};r.current={nodes:[],edges:[]},x(Q)},3e3))},[x,E]),L=h.useCallback(M=>{M.ref_id&&S(M.ref_id,{answer:M.answer,answerLoading:!1})},[S]),Z=h.useCallback(M=>{M.ref_id&&S(M.ref_id,{audio_en:M.audio_EN})},[S]),U=h.useCallback(M=>{M.ref_id&&S(M.ref_id,{questions:M.relevant_questions.map(Q=>Q.question),questionsLoading:!1})},[S]),J=h.useCallback(M=>{M.ref_id&&S(M.ref_id,{sources:M.sources.map(Q=>Q.ref_id),sourcesLoading:!1})},[S]),W=h.useCallback(M=>{M.question&&A(_)&&S(_,{answerLoading:!1,entities:M.entities})},[S,A,_]);return h.useEffect(()=>(V&&(V.connect(),V.on("connect_error",M=>{console.error("Socket connection error:",M)}),V.on("newnode",$),D&&V.on("extractedentitieshook",W),D&&V.on("askquestionhook",L),D&&V.on("relevantquestionshook",U),D&&V.on("answersourceshook",J),B&&V.on("new_node_created",j),D&&V.on("answeraudiohook",Z)),()=>{V&&V.off()}),[V,$,j,B,L,D,U,J,W,Z]),h.useEffect(()=>{},[b,w]),h.useEffect(()=>{if(b)try{V==null||V.emit("update_project_id",{id:b})}catch(M){console.error(M)}},[b,V]),h.useEffect(()=>{y||D&&m()},[m,y,D]),c.jsxs(c.Fragment,{children:[c.jsx(Y7,{}),c.jsx(Im,{}),c.jsx(ns,{hidden:!Us||!0,isRoot:!0}),c.jsx(h.Suspense,{fallback:c.jsx("div",{children:"Loading..."}),children:y?null:c.jsxs(zm,{direction:"row",children:[c.jsxs(Ws,{...R,children:[c.jsx(Um,{}),!f&&c.jsx(Km,{}),c.jsx(Wm,{}),c.jsx(Zd,{}),c.jsx(Lm,{}),c.jsxs(Zm,{children:["v",Xd]}),c.jsx(bs,{})]}),c.jsx(hf,{}),c.jsx(Nm,{})]})})]})},sp=Object.freeze(Object.defineProperty({__proto__:null,App:qm},Symbol.toStringTag,{value:"Module"}));export{Fh as $,Mf as A,ke as B,rs as C,fh as D,wh as E,Sh as F,so as G,Oh as H,Vm as I,i2 as J,lo as K,qe as L,Ih as M,Es as N,Zd as O,o1 as P,uo as Q,im as R,km as S,Td as T,Ye as U,z3 as V,y2 as W,cm as X,gm as Y,Zf as Z,te as _,Gf as a,sp as a$,$h as a0,Lh as a1,ii as a2,xm as a3,th as a4,Qf as a5,Ys as a6,Tf as a7,Lf as a8,Of as a9,is as aA,as as aB,qs as aC,sh as aD,Ah as aE,f2 as aF,Zh as aG,Vh as aH,Hf as aI,em as aJ,Jh as aK,vm as aL,Am as aM,Sm as aN,mm as aO,Ch as aP,gh as aQ,hh as aR,jl as aS,Eh as aT,uh as aU,Xm as aV,ym as aW,r2 as aX,X3 as aY,$2 as aZ,pm as a_,Ff as aa,Yf as ab,Uf as ac,xh as ad,nm as ae,dm as af,gs as ag,Cs as ah,Mh as ai,sm as aj,lm as ak,Uh as al,lh as am,co as an,om as ao,Ad as ap,n2 as aq,zh as ar,_m as as,Bh as at,vh as au,ih as av,Jf as aw,eh as ax,pd as ay,os as az,fm as b,If as c,ip as d,$0 as e,op as f,J7 as g,ap as h,ys as i,dd as j,Wt as k,Fr as l,fd as m,Yu as n,Hh as o,$f as p,ph as q,ah as r,Qh as s,kh as t,ps as u,J3 as v,rp as w,Xs as x,Y1 as y,fo as z}; +`,Um=h.lazy(()=>m1(()=>import("./index-2680e012.js"),["assets/index-2680e012.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]).then(({MainToolbar:e})=>({default:e}))),Wm=h.lazy(()=>m1(()=>import("./index-1cb91db3.js"),["assets/index-1cb91db3.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/index-8f6ab1fe.js","assets/three.module-d9fcef06.js","assets/TextareaAutosize-cc9b3a66.js","assets/index-5019b400.js","assets/ClipLoader-601f6378.js"]).then(({Universe:e})=>({default:e}))),Km=h.lazy(()=>m1(()=>import("./index-ad04f3f7.js").then(e=>e.i),["assets/index-ad04f3f7.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css","assets/ClipLoader-601f6378.js","assets/Skeleton-7bdfc65c.js","assets/Stack-7f131eb3.js","assets/map-76fdca3a.js","assets/Typography-50924238.js","assets/createSvgIcon-2fe026f6.js","assets/index-0d9e6a7d.js","assets/index-5019b400.js"]).then(({SideBar:e})=>({default:e}))),qm=()=>{const[e]=Ns(),t=e.get("q"),{setBudget:n,setNodeCount:i}=Vn(M=>M),r=h.useRef(null),o=h.useRef(null),{setSidebarOpen:a,currentSearch:s,setCurrentSearch:l,setRelevanceSelected:u,setTranscriptOpen:d,universeQuestionIsOpen:f,setUniverseQuestionIsOpen:m}=kt(M=>M),k=Yd(M=>M.setTeachMeAnswer),{fetchData:p,setCategoryFilter:g,setAbortRequests:C,addNewNode:x,splashDataLoading:y,runningProjectId:b,setRunningProjectMessages:w,isFetching:E}=g0(M=>M),{setAiSummaryAnswer:S,getKeyExist:A,aiRefId:_}=io(M=>M),G=ii(),[B,D]=zs(M=>[M.realtimeGraphFeatureFlag,M.chatInterfaceFeatureFlag]),V=Kd(),R=Zs({mode:"onChange"}),{setValue:P}=R;h.useEffect(()=>{P("search",t??""),d(!1),G(null),u(!1),l(t??""),k(""),g(null)},[t,g,l,u,G,k,d,P]),h.useEffect(()=>{(async()=>{await p(n,C),a(!0),s?await Ks(n):G(null)})()},[s,p,n,C,a,G]);const $=h.useCallback(()=>{i("INCREMENT")},[i]),j=h.useCallback(M=>{E||(r.current||(r.current={nodes:[],edges:[]}),M.edges&&r.current.edges.push(...M.edges),M.nodes&&r.current.nodes.push(...M.nodes),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{const Q={...r.current};r.current={nodes:[],edges:[]},x(Q)},3e3))},[x,E]),L=h.useCallback(M=>{M.ref_id&&S(M.ref_id,{answer:M.answer,answerLoading:!1})},[S]),Z=h.useCallback(M=>{M.ref_id&&S(M.ref_id,{audio_en:M.audio_EN})},[S]),U=h.useCallback(M=>{M.ref_id&&S(M.ref_id,{questions:M.relevant_questions.map(Q=>Q.question),questionsLoading:!1})},[S]),J=h.useCallback(M=>{M.ref_id&&S(M.ref_id,{sources:M.sources.map(Q=>Q.ref_id),sourcesLoading:!1})},[S]),W=h.useCallback(M=>{M.question&&A(_)&&S(_,{answerLoading:!1,entities:M.entities})},[S,A,_]);return h.useEffect(()=>(V&&(V.connect(),V.on("connect_error",M=>{console.error("Socket connection error:",M)}),V.on("newnode",$),D&&V.on("extractedentitieshook",W),D&&V.on("askquestionhook",L),D&&V.on("relevantquestionshook",U),D&&V.on("answersourceshook",J),B&&V.on("new_node_created",j),D&&V.on("answeraudiohook",Z)),()=>{V&&V.off()}),[V,$,j,B,L,D,U,J,W,Z]),h.useEffect(()=>{},[b,w]),h.useEffect(()=>{if(b)try{V==null||V.emit("update_project_id",{id:b})}catch(M){console.error(M)}},[b,V]),h.useEffect(()=>{y||D&&m()},[m,y,D]),c.jsxs(c.Fragment,{children:[c.jsx(Y7,{}),c.jsx(Im,{}),c.jsx(ns,{hidden:!Us||!0,isRoot:!0}),c.jsx(h.Suspense,{fallback:c.jsx("div",{children:"Loading..."}),children:y?null:c.jsxs(zm,{direction:"row",children:[c.jsxs(Ws,{...R,children:[c.jsx(Um,{}),!f&&c.jsx(Km,{}),c.jsx(Wm,{}),c.jsx(Zd,{}),c.jsx(Lm,{}),c.jsxs(Zm,{children:["v",Xd]}),c.jsx(bs,{})]}),c.jsx(hf,{}),c.jsx(Nm,{})]})})]})},sp=Object.freeze(Object.defineProperty({__proto__:null,App:qm},Symbol.toStringTag,{value:"Module"}));export{Lh as $,Mf as A,i2 as B,rs as C,fh as D,wh as E,Sh as F,lo as G,Oh as H,Vm as I,qe as J,uo as K,Ye as L,Ih as M,Es as N,Zd as O,o1 as P,z3 as Q,im as R,km as S,Td as T,y2 as U,cm as V,gm as W,Zf as X,Fh as Y,$h as Z,te as _,Gf as a,sp as a$,ii as a0,xm as a1,th as a2,Qf as a3,Ys as a4,Tf as a5,Lf as a6,Of as a7,Ff as a8,Yf as a9,qs as aA,sh as aB,Ah as aC,f2 as aD,Zh as aE,Vh as aF,Hf as aG,em as aH,Jh as aI,vm as aJ,Am as aK,Sm as aL,mm as aM,Ch as aN,gh as aO,hh as aP,jl as aQ,fd as aR,Fr as aS,Eh as aT,uh as aU,Xm as aV,ym as aW,r2 as aX,X3 as aY,$2 as aZ,pm as a_,Uf as aa,xh as ab,nm as ac,dm as ad,gs as ae,Cs as af,Mh as ag,sm as ah,lm as ai,Uh as aj,lh as ak,co as al,om as am,Ad as an,n2 as ao,zh as ap,_m as aq,Bh as ar,vh as as,ih as at,Jf as au,eh as av,pd as aw,os as ax,is as ay,as as az,fm as b,If as c,ip as d,$0 as e,op as f,J7 as g,ap as h,ys as i,dd as j,Yu as k,Wt as l,Hh as m,$f as n,ph as o,ah as p,Qh as q,kh as r,J3 as s,rp as t,ps as u,Xs as v,Y1 as w,fo as x,ke as y,so as z}; diff --git a/build/assets/index-e4c394ce.js b/build/assets/index-ad04f3f7.js similarity index 96% rename from build/assets/index-e4c394ce.js rename to build/assets/index-ad04f3f7.js index 5bd1a668b..9bbdff0db 100644 --- a/build/assets/index-e4c394ce.js +++ b/build/assets/index-ad04f3f7.js @@ -1,4 +1,4 @@ -import{ac as qO,ad as xa,Q as Lv,ae as GL,r as P,af as HO,l as zs,m as zL,p as Ps,e as ce,j as h,d as pb,c as fb,s as Mr,ag as qL,k as Jt,f as Hi,u as gb,a as jl,h as Cr,i as hb,q as Fl,ah as HL,ai as WL,aj as WO,w as B,x as M,ak as VO,al as mb,X as Bl,F,a1 as VL,v as Pr,E as Ul,am as YO,a3 as YL,H as mt,an as KL,y as dn,D as Ct,G as KO,ao as ei,ap as Tt,aq as XL,g as pt,z as Mt,V as XO,a0 as ZO,C as JO,ar as ZL,as as QO,M as Mv,Z as JL,at as e1,au as t1,av as ti,aw as Ne,b as U,ax as QL,ay as eM,az as tM,aA as Gl,aB as rM,aC as nM,aD as aM,aE as iM,aF as r1,aG as oM,aH as zl,aI as sM,aJ as lM,aK as uM,aL as cM,aa as dM,aM as Pv,K as pM,aN as fM,aO as gM,J as hM,I as ir,aP as mM,aQ as bM}from"./index-16ff4e55.js";import{x as na,y as $s,z as ac,B as n1,G as yM,J as vM,K as SM,L as $v,Q as js,U as Tn,V as jv,W as fs,X as a1,Y as EM,s as bb,Z as i1,i as $r,T as ri,$ as vn,a0 as o1,e as s1,a1 as xM,a2 as Mo,a3 as wM,a4 as yb,a5 as ql,a6 as vb,a7 as _M,a8 as l1,a9 as u1,aa as TM,v as AM,ab as c1,ac as OM,ad as kM,ae as RM,af as IM,ag as Sb,ah as Eb,ai as NM,aj as CM,ak as DM,P as we,u as Pt,al as d1,am as LM,an as p1,ao as MM,ap as Po,aq as PM,ar as $M,as as jM,at as FM,au as BM,av as UM,aw as f1,ax as GM}from"./index-04a82be1.js";import{c as zM,a as ic,C as Hl}from"./ClipLoader-049391dc.js";import{S as g1}from"./Skeleton-96227392.js";import{u as h1,P as xb,a as qM,F as HM}from"./Stack-25a86e54.js";import{S as WM,F as Fv,i as $o,g as yr,t as VM,_ as m1,a as YM,b as KM,c as ia,d as wb,e as XM,f as ZM,h as JM,j as jo,m as QM,k as eP,l as tP,n as b1,o as rP,p as nP}from"./map-b1c613ac.js";import{c as _b}from"./createSvgIcon-e167cb2e.js";import{useBriefDescriptionStore as aP}from"./index-6b3671e3.js";import{u as y1}from"./index-fe1fa9e4.js";const Bv="023d8eb306f0027b902fbdc81d33b49b6558b3434d374626f8c324979c92d47c21",iP=async e=>{let t=await xa.enable(!0);if(t||console.warn("Sphinx enable failed, means no pubkey and no budget (including budget of 0)"),t=await xa.keysend(Bv,e),!(t!=null&&t.success)){if(t=await xa.topup(),t||(t=await xa.authorize()),!(t!=null&&t.budget)||(t==null?void 0:t.budget){const r=await iP(t),n={amount:t,refid:e};return await qO.post("/boost",JSON.stringify(n)),r},sP=e=>{const[t,r]=e.split("-")||["",""];return parseInt(r,10)!==0?`${t} - ${r}`:t},v1=(e,t)=>{if(!t)return null;const r=e.filter(i=>i.show_title&&i.link&&i.show_title===t.show_title&&i.episode_title===t.episode_title),n=Lv.groupBy(r,i=>i.timestamp),a=Lv.values(n).reduce((i,o)=>(o[0]&&i.push(o[0]),i),[]);return a.sort((i,o)=>{var p,g;const[s]=((p=i.timestamp)==null?void 0:p.split("-"))||[""],[l]=((g=o.timestamp)==null?void 0:g.split("-"))||[""],c=na(s),d=na(l);return c-d}),a},lP=async e=>{await GL(async()=>{try{await xa.saveGraphData({metaData:{date:Math.floor(new Date().getTime()/1e3),...e},type:"second_brain_consumed_content"})}catch(t){console.warn(t)}})},uP=e=>{const t=/((http|https):\/\/[^\s]+)/g,r=/@(\w+)/g;let n=e.replace(/\\/g,"");return n=n.replace(/'/g,"’"),n=n.replace(/\n/g,"
"),n=n.replace(t,'$1'),n=n.replace(r,'@$1'),n},cP={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},dP=cP;function pP(e,t,r=(n,a)=>n===a){return e.length===t.length&&e.every((n,a)=>r(n,t[a]))}const fP=2;function S1(e,t){return e-t}function hi(e,t,r){return e==null?t:Math.min(Math.max(t,e),r)}function Uv(e,t){var r;const{index:n}=(r=e.reduce((a,i,o)=>{const s=Math.abs(t-i);return a===null||s({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}%`})}},yP=e=>e;let bs;function oc(){return bs===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?bs=CSS.supports("touch-action","none"):bs=!0),bs}function vP(e){const{"aria-labelledby":t,defaultValue:r,disabled:n=!1,disableSwap:a=!1,isRtl:i=!1,marks:o=!1,max:s=100,min:l=0,name:c,onChange:d,onChangeCommitted:p,orientation:g="horizontal",rootRef:m,scale:b=yP,step:v=1,tabIndex:S,value:O}=e,_=P.useRef(),[w,A]=P.useState(-1),[x,E]=P.useState(-1),[k,N]=P.useState(!1),I=P.useRef(0),[D,L]=h1({controlled:O,default:r??l,name:"Slider"}),j=d&&((te,de,ye)=>{const ve=te.nativeEvent||te,ge=new ve.constructor(ve.type,ve);Object.defineProperty(ge,"target",{writable:!0,value:{value:de,name:c}}),d(ge,de,ye)}),z=Array.isArray(D);let q=z?D.slice().sort(S1):[D];q=q.map(te=>hi(te,l,s));const H=o===!0&&v!==null?[...Array(Math.floor((s-l)/v)+1)].map((te,de)=>({value:l+v*de})):o||[],V=H.map(te=>te.value),{isFocusVisibleRef:K,onBlur:G,onFocus:W,ref:J}=HO(),[ae,re]=P.useState(-1),ue=P.useRef(),Se=zs(J,ue),Q=zs(m,Se),Ie=te=>de=>{var ye;const ve=Number(de.currentTarget.getAttribute("data-index"));W(de),K.current===!0&&re(ve),E(ve),te==null||(ye=te.onFocus)==null||ye.call(te,de)},Ue=te=>de=>{var ye;G(de),K.current===!1&&re(-1),E(-1),te==null||(ye=te.onBlur)==null||ye.call(te,de)};zL(()=>{if(n&&ue.current.contains(document.activeElement)){var te;(te=document.activeElement)==null||te.blur()}},[n]),n&&w!==-1&&A(-1),n&&ae!==-1&&re(-1);const xe=te=>de=>{var ye;(ye=te.onChange)==null||ye.call(te,de);const ve=Number(de.currentTarget.getAttribute("data-index")),ge=q[ve],qe=V.indexOf(ge);let De=de.target.valueAsNumber;if(H&&v==null){const Ge=V[V.length-1];De>Ge?De=Ge:De{const{current:ye}=ue,{width:ve,height:ge,bottom:qe,left:De}=ye.getBoundingClientRect();let Ge;oe.indexOf("vertical")===0?Ge=(qe-te.y)/ge:Ge=(te.x-De)/ve,oe.indexOf("-reverse")!==-1&&(Ge=1-Ge);let Je;if(Je=gP(Ge,l,s),v)Je=mP(Je,v,l);else{const rr=Uv(V,Je);Je=V[rr]}Je=hi(Je,l,s);let jt=0;if(z){de?jt=ee.current:jt=Uv(q,Je),a&&(Je=hi(Je,q[jt-1]||-1/0,q[jt+1]||1/0));const rr=Je;Je=Gv({values:q,newValue:Je,index:jt}),a&&de||(jt=Je.indexOf(rr),ee.current=jt)}return{newValue:Je,activeIndex:jt}},X=Ps(te=>{const de=gs(te,_);if(!de)return;if(I.current+=1,te.type==="mousemove"&&te.buttons===0){Ee(te);return}const{newValue:ye,activeIndex:ve}=ie({finger:de,move:!0});hs({sliderRef:ue,activeIndex:ve,setActive:A}),L(ye),!k&&I.current>fP&&N(!0),j&&!ms(ye,D)&&j(te,ye,ve)}),Ee=Ps(te=>{const de=gs(te,_);if(N(!1),!de)return;const{newValue:ye}=ie({finger:de,move:!0});A(-1),te.type==="touchend"&&E(-1),p&&p(te,ye),_.current=void 0,he()}),fe=Ps(te=>{if(n)return;oc()||te.preventDefault();const de=te.changedTouches[0];de!=null&&(_.current=de.identifier);const ye=gs(te,_);if(ye!==!1){const{newValue:ge,activeIndex:qe}=ie({finger:ye});hs({sliderRef:ue,activeIndex:qe,setActive:A}),L(ge),j&&!ms(ge,D)&&j(te,ge,qe)}I.current=0;const ve=$s(ue.current);ve.addEventListener("touchmove",X),ve.addEventListener("touchend",Ee)}),he=P.useCallback(()=>{const te=$s(ue.current);te.removeEventListener("mousemove",X),te.removeEventListener("mouseup",Ee),te.removeEventListener("touchmove",X),te.removeEventListener("touchend",Ee)},[Ee,X]);P.useEffect(()=>{const{current:te}=ue;return te.addEventListener("touchstart",fe,{passive:oc()}),()=>{te.removeEventListener("touchstart",fe,{passive:oc()}),he()}},[he,fe]),P.useEffect(()=>{n&&he()},[n,he]);const je=te=>de=>{var ye;if((ye=te.onMouseDown)==null||ye.call(te,de),n||de.defaultPrevented||de.button!==0)return;de.preventDefault();const ve=gs(de,_);if(ve!==!1){const{newValue:qe,activeIndex:De}=ie({finger:ve});hs({sliderRef:ue,activeIndex:De,setActive:A}),L(qe),j&&!ms(qe,D)&&j(de,qe,De)}I.current=0;const ge=$s(ue.current);ge.addEventListener("mousemove",X),ge.addEventListener("mouseup",Ee)},nt=qs(z?q[0]:l,l,s),et=qs(q[q.length-1],l,s)-nt,tr=(te={})=>{const de=ac(te),ye={onMouseDown:je(de||{})},ve=ce({},de,ye);return ce({},te,{ref:Q},ve)},Pe=te=>de=>{var ye;(ye=te.onMouseOver)==null||ye.call(te,de);const ve=Number(de.currentTarget.getAttribute("data-index"));E(ve)},$e=te=>de=>{var ye;(ye=te.onMouseLeave)==null||ye.call(te,de),E(-1)};return{active:w,axis:oe,axisProps:bP,dragging:k,focusedThumbIndex:ae,getHiddenInputProps:(te={})=>{var de;const ye=ac(te),ve={onChange:xe(ye||{}),onFocus:Ie(ye||{}),onBlur:Ue(ye||{})},ge=ce({},ye,ve);return ce({tabIndex:S,"aria-labelledby":t,"aria-orientation":g,"aria-valuemax":b(s),"aria-valuemin":b(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":(de=e.step)!=null?de:void 0,disabled:n},te,ge,{style:ce({},dP,{direction:i?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:tr,getThumbProps:(te={})=>{const de=ac(te),ye={onMouseOver:Pe(de||{}),onMouseLeave:$e(de||{})};return ce({},te,de,ye)},marks:H,open:x,range:z,rootRef:Q,trackLeap:et,trackOffset:nt,values:q,getThumbStyle:te=>({pointerEvents:w!==-1&&w!==te?"none":void 0})}}const SP=_b(h.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),EP=_b(h.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),xP=_b(h.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function wP(e){return fb("MuiCheckbox",e)}const _P=pb("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),sc=_P,TP=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],AP=e=>{const{classes:t,indeterminate:r,color:n,size:a}=e,i={root:["root",r&&"indeterminate",`color${Jt(n)}`,`size${Jt(a)}`]},o=hb(i,wP,t);return ce({},t,o)},OP=Mr(WM,{shouldForwardProp:e=>qL(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.indeterminate&&t.indeterminate,t[`size${Jt(r.size)}`],r.color!=="default"&&t[`color${Jt(r.color)}`]]}})(({theme:e,ownerState:t})=>ce({color:(e.vars||e).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${t.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Hi(t.color==="default"?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${sc.checked}, &.${sc.indeterminate}`]:{color:(e.vars||e).palette[t.color].main},[`&.${sc.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),kP=h.jsx(EP,{}),RP=h.jsx(SP,{}),IP=h.jsx(xP,{}),NP=P.forwardRef(function(t,r){var n,a;const i=gb({props:t,name:"MuiCheckbox"}),{checkedIcon:o=kP,color:s="primary",icon:l=RP,indeterminate:c=!1,indeterminateIcon:d=IP,inputProps:p,size:g="medium",className:m}=i,b=jl(i,TP),v=c?d:l,S=c?d:o,O=ce({},i,{color:s,indeterminate:c,size:g}),_=AP(O);return h.jsx(OP,ce({type:"checkbox",inputProps:ce({"data-indeterminate":c},p),icon:P.cloneElement(v,{fontSize:(n=v.props.fontSize)!=null?n:g}),checkedIcon:P.cloneElement(S,{fontSize:(a=S.props.fontSize)!=null?a:g}),ownerState:O,ref:r,className:Cr(_.root,m)},b,{classes:_}))}),CP=NP,DP=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function LP(e,t,r){const n=t.getBoundingClientRect(),a=r&&r.getBoundingClientRect(),i=n1(t);let o;if(t.fakeTransform)o=t.fakeTransform;else{const c=i.getComputedStyle(t);o=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let s=0,l=0;if(o&&o!=="none"&&typeof o=="string"){const c=o.split("(")[1].split(")")[0].split(",");s=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?a?`translateX(${a.right+s-n.left}px)`:`translateX(${i.innerWidth+s-n.left}px)`:e==="right"?a?`translateX(-${n.right-a.left-s}px)`:`translateX(-${n.left+n.width-s}px)`:e==="up"?a?`translateY(${a.bottom+l-n.top}px)`:`translateY(${i.innerHeight+l-n.top}px)`:a?`translateY(-${n.top-a.top+n.height-l}px)`:`translateY(-${n.top+n.height-l}px)`}function MP(e){return typeof e=="function"?e():e}function ys(e,t,r){const n=MP(r),a=LP(e,t,n);a&&(t.style.webkitTransform=a,t.style.transform=a)}const PP=P.forwardRef(function(t,r){const n=Fl(),a={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:l,container:c,direction:d="down",easing:p=a,in:g,onEnter:m,onEntered:b,onEntering:v,onExit:S,onExited:O,onExiting:_,style:w,timeout:A=i,TransitionComponent:x=yM}=t,E=jl(t,DP),k=P.useRef(null),N=zs(l.ref,k,r),I=G=>W=>{G&&(W===void 0?G(k.current):G(k.current,W))},D=I((G,W)=>{ys(d,G,c),SM(G),m&&m(G,W)}),L=I((G,W)=>{const J=$v({timeout:A,style:w,easing:p},{mode:"enter"});G.style.webkitTransition=n.transitions.create("-webkit-transform",ce({},J)),G.style.transition=n.transitions.create("transform",ce({},J)),G.style.webkitTransform="none",G.style.transform="none",v&&v(G,W)}),j=I(b),z=I(_),q=I(G=>{const W=$v({timeout:A,style:w,easing:p},{mode:"exit"});G.style.webkitTransition=n.transitions.create("-webkit-transform",W),G.style.transition=n.transitions.create("transform",W),ys(d,G,c),S&&S(G)}),H=I(G=>{G.style.webkitTransition="",G.style.transition="",O&&O(G)}),V=G=>{o&&o(k.current,G)},K=P.useCallback(()=>{k.current&&ys(d,k.current,c)},[d,c]);return P.useEffect(()=>{if(g||d==="down"||d==="right")return;const G=vM(()=>{k.current&&ys(d,k.current,c)}),W=n1(k.current);return W.addEventListener("resize",G),()=>{G.clear(),W.removeEventListener("resize",G)}},[d,g,c]),P.useEffect(()=>{g||K()},[g,K]),h.jsx(x,ce({nodeRef:k,onEnter:D,onEntered:j,onEntering:L,onExit:q,onExited:H,onExiting:z,addEndListener:V,appear:s,in:g,timeout:A},E,{children:(G,W)=>P.cloneElement(l,ce({ref:N,style:ce({visibility:G==="exited"&&!g?"hidden":void 0},w,l.props.style)},W))}))}),Ca=PP,$P=e=>!e||!js(e),jP=$P;function FP(e){return fb("MuiSlider",e)}const BP=pb("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"]),Dr=BP,UP=e=>{const{open:t}=e;return{offset:Cr(t&&Dr.valueLabelOpen),circle:Dr.valueLabelCircle,label:Dr.valueLabelLabel}};function GP(e){const{children:t,className:r,value:n}=e,a=UP(e);return t?P.cloneElement(t,{className:Cr(t.props.className)},h.jsxs(P.Fragment,{children:[t.props.children,h.jsx("span",{className:Cr(a.offset,r),"aria-hidden":!0,children:h.jsx("span",{className:a.circle,children:h.jsx("span",{className:a.label,children:n})})})]})):null}const zP=["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 zv(e){return e}const qP=Mr("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${Jt(r.color)}`],r.size!=="medium"&&t[`size${Jt(r.size)}`],r.marked&&t.marked,r.orientation==="vertical"&&t.vertical,r.track==="inverted"&&t.trackInverted,r.track===!1&&t.trackFalse]}})(({theme:e,ownerState:t})=>ce({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"&&ce({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"&&ce({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"},[`&.${Dr.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Dr.dragging}`]:{[`& .${Dr.thumb}, & .${Dr.track}`]:{transition:"none"}}})),HP=Mr("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})(({ownerState:e})=>ce({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})),WP=Mr("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e,ownerState:t})=>{const r=e.palette.mode==="light"?HL(e.palette[t.color].main,.62):WL(e.palette[t.color].main,.5);return ce({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`]:r,borderColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:r})}),VP=Mr("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${Jt(r.color)}`],r.size!=="medium"&&t[`thumbSize${Jt(r.size)}`]]}})(({theme:e,ownerState:t})=>ce({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":ce({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, &.${Dr.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:Hi(e.palette[t.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Dr.active}`]:{boxShadow:`0px 0px 0px 14px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:Hi(e.palette[t.color].main,.16)}`},[`&.${Dr.disabled}`]:{"&:hover":{boxShadow:"none"}}})),YP=Mr(GP,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(({theme:e,ownerState:t})=>ce({[`&.${Dr.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"})),KP=Mr("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>WO(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(({theme:e,ownerState:t,markActive:r})=>ce({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)"},r&&{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8})),XP=Mr("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>WO(e)&&e!=="markLabelActive",overridesResolver:(e,t)=>t.markLabel})(({theme:e,ownerState:t,markLabelActive:r})=>ce({},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}},r&&{color:(e.vars||e).palette.text.primary})),ZP=e=>{const{disabled:t,dragging:r,marked:n,orientation:a,track:i,classes:o,color:s,size:l}=e,c={root:["root",t&&"disabled",r&&"dragging",n&&"marked",a==="vertical"&&"vertical",i==="inverted"&&"trackInverted",i===!1&&"trackFalse",s&&`color${Jt(s)}`,l&&`size${Jt(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Jt(l)}`,s&&`thumbColor${Jt(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return hb(c,FP,o)},JP=({children:e})=>e,QP=P.forwardRef(function(t,r){var n,a,i,o,s,l,c,d,p,g,m,b,v,S,O,_,w,A,x,E,k,N,I,D;const L=gb({props:t,name:"MuiSlider"}),z=Fl().direction==="rtl",{"aria-label":q,"aria-valuetext":H,"aria-labelledby":V,component:K="span",components:G={},componentsProps:W={},color:J="primary",classes:ae,className:re,disableSwap:ue=!1,disabled:Se=!1,getAriaLabel:Q,getAriaValueText:Ie,marks:Ue=!1,max:xe=100,min:ee=0,orientation:oe="horizontal",size:ie="medium",step:X=1,scale:Ee=zv,slotProps:fe,slots:he,track:je="normal",valueLabelDisplay:nt="off",valueLabelFormat:et=zv}=L,tr=jl(L,zP),Pe=ce({},L,{isRtl:z,max:xe,min:ee,classes:ae,disabled:Se,disableSwap:ue,orientation:oe,marks:Ue,color:J,size:ie,step:X,scale:Ee,track:je,valueLabelDisplay:nt,valueLabelFormat:et}),{axisProps:$e,getRootProps:Ye,getHiddenInputProps:$t,getThumbProps:Kt,open:te,active:de,axis:ye,focusedThumbIndex:ve,range:ge,dragging:qe,marks:De,values:Ge,trackOffset:Je,trackLeap:jt,getThumbStyle:rr}=vP(ce({},Pe,{rootRef:r}));Pe.marked=De.length>0&&De.some(_e=>_e.label),Pe.dragging=qe,Pe.focusedThumbIndex=ve;const ze=ZP(Pe),Kr=(n=(a=he==null?void 0:he.root)!=null?a:G.Root)!=null?n:qP,Xr=(i=(o=he==null?void 0:he.rail)!=null?o:G.Rail)!=null?i:HP,Zr=(s=(l=he==null?void 0:he.track)!=null?l:G.Track)!=null?s:WP,He=(c=(d=he==null?void 0:he.thumb)!=null?d:G.Thumb)!=null?c:VP,Bn=(p=(g=he==null?void 0:he.valueLabel)!=null?g:G.ValueLabel)!=null?p:YP,Jr=(m=(b=he==null?void 0:he.mark)!=null?b:G.Mark)!=null?m:KP,xr=(v=(S=he==null?void 0:he.markLabel)!=null?S:G.MarkLabel)!=null?v:XP,Qr=(O=(_=he==null?void 0:he.input)!=null?_:G.Input)!=null?O:"input",wr=(w=fe==null?void 0:fe.root)!=null?w:W.root,_r=(A=fe==null?void 0:fe.rail)!=null?A:W.rail,Tr=(x=fe==null?void 0:fe.track)!=null?x:W.track,Un=(E=fe==null?void 0:fe.thumb)!=null?E:W.thumb,Fr=(k=fe==null?void 0:fe.valueLabel)!=null?k:W.valueLabel,li=(N=fe==null?void 0:fe.mark)!=null?N:W.mark,Ar=(I=fe==null?void 0:fe.markLabel)!=null?I:W.markLabel,En=(D=fe==null?void 0:fe.input)!=null?D:W.input,le=Tn({elementType:Kr,getSlotProps:Ye,externalSlotProps:wr,externalForwardedProps:tr,additionalProps:ce({},jP(Kr)&&{as:K}),ownerState:ce({},Pe,wr==null?void 0:wr.ownerState),className:[ze.root,re]}),Gn=Tn({elementType:Xr,externalSlotProps:_r,ownerState:Pe,className:ze.rail}),Ft=Tn({elementType:Zr,externalSlotProps:Tr,additionalProps:{style:ce({},$e[ye].offset(Je),$e[ye].leap(jt))},ownerState:ce({},Pe,Tr==null?void 0:Tr.ownerState),className:ze.track}),ut=Tn({elementType:He,getSlotProps:Kt,externalSlotProps:Un,ownerState:ce({},Pe,Un==null?void 0:Un.ownerState),className:ze.thumb}),zn=Tn({elementType:Bn,externalSlotProps:Fr,ownerState:ce({},Pe,Fr==null?void 0:Fr.ownerState),className:ze.valueLabel}),Oe=Tn({elementType:Jr,externalSlotProps:li,ownerState:Pe,className:ze.mark}),nr=Tn({elementType:xr,externalSlotProps:Ar,ownerState:Pe,className:ze.markLabel}),da=Tn({elementType:Qr,getSlotProps:$t,externalSlotProps:En,ownerState:Pe});return h.jsxs(Kr,ce({},le,{children:[h.jsx(Xr,ce({},Gn)),h.jsx(Zr,ce({},Ft)),De.filter(_e=>_e.value>=ee&&_e.value<=xe).map((_e,We)=>{const kt=qs(_e.value,ee,xe),tt=$e[ye].offset(kt);let ct;return je===!1?ct=Ge.indexOf(_e.value)!==-1:ct=je==="normal"&&(ge?_e.value>=Ge[0]&&_e.value<=Ge[Ge.length-1]:_e.value<=Ge[0])||je==="inverted"&&(ge?_e.value<=Ge[0]||_e.value>=Ge[Ge.length-1]:_e.value>=Ge[0]),h.jsxs(P.Fragment,{children:[h.jsx(Jr,ce({"data-index":We},Oe,!js(Jr)&&{markActive:ct},{style:ce({},tt,Oe.style),className:Cr(Oe.className,ct&&ze.markActive)})),_e.label!=null?h.jsx(xr,ce({"aria-hidden":!0,"data-index":We},nr,!js(xr)&&{markLabelActive:ct},{style:ce({},tt,nr.style),className:Cr(ze.markLabel,nr.className,ct&&ze.markLabelActive),children:_e.label})):null]},We)}),Ge.map((_e,We)=>{const kt=qs(_e,ee,xe),tt=$e[ye].offset(kt),ct=nt==="off"?JP:Bn;return h.jsx(ct,ce({},!js(ct)&&{valueLabelFormat:et,valueLabelDisplay:nt,value:typeof et=="function"?et(Ee(_e),We):et,index:We,open:te===We||de===We||nt==="on",disabled:Se},zn,{children:h.jsx(He,ce({"data-index":We},ut,{className:Cr(ze.thumb,ut.className,de===We&&ze.active,ve===We&&ze.focusVisible),style:ce({},tt,rr(We),ut.style),children:h.jsx(Qr,ce({"data-index":We,"aria-label":Q?Q(We):q,"aria-valuenow":Ee(_e),"aria-labelledby":V,"aria-valuetext":Ie?Ie(Ee(_e),We):H,value:Ge[We]},da))}))}),We)})]}))}),Wl=QP;function e$(e){return fb("MuiTooltip",e)}const t$=pb("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Nn=t$,r$=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function n$(e){return Math.round(e*1e5)/1e5}const a$=e=>{const{classes:t,disableInteractive:r,arrow:n,touch:a,placement:i}=e,o={popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",a&&"touch",`tooltipPlacement${Jt(i.split("-")[0])}`],arrow:["arrow"]};return hb(o,e$,t)},i$=Mr(xb,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(({theme:e,ownerState:t,open:r})=>ce({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!r&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Nn.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Nn.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Nn.arrow}`]:ce({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Nn.arrow}`]:ce({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),o$=Mr("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Jt(r.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>ce({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Hi(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${n$(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Nn.popper}[data-popper-placement*="left"] &`]:ce({transformOrigin:"right center"},t.isRtl?ce({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):ce({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Nn.popper}[data-popper-placement*="right"] &`]:ce({transformOrigin:"left center"},t.isRtl?ce({marginRight:"14px"},t.touch&&{marginRight:"24px"}):ce({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Nn.popper}[data-popper-placement*="top"] &`]:ce({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Nn.popper}[data-popper-placement*="bottom"] &`]:ce({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),s$=Mr("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Hi(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let vs=!1,lc=null,mi={x:0,y:0};function Ss(e,t){return r=>{t&&t(r),e(r)}}const l$=P.forwardRef(function(t,r){var n,a,i,o,s,l,c,d,p,g,m,b,v,S,O,_,w,A,x;const E=gb({props:t,name:"MuiTooltip"}),{arrow:k=!1,children:N,components:I={},componentsProps:D={},describeChild:L=!1,disableFocusListener:j=!1,disableHoverListener:z=!1,disableInteractive:q=!1,disableTouchListener:H=!1,enterDelay:V=100,enterNextDelay:K=0,enterTouchDelay:G=700,followCursor:W=!1,id:J,leaveDelay:ae=0,leaveTouchDelay:re=1500,onClose:ue,onOpen:Se,open:Q,placement:Ie="bottom",PopperComponent:Ue,PopperProps:xe={},slotProps:ee={},slots:oe={},title:ie,TransitionComponent:X=jv,TransitionProps:Ee}=E,fe=jl(E,r$),he=P.isValidElement(N)?N:h.jsx("span",{children:N}),je=Fl(),nt=je.direction==="rtl",[et,tr]=P.useState(),[Pe,$e]=P.useState(null),Ye=P.useRef(!1),$t=q||W,Kt=P.useRef(),te=P.useRef(),de=P.useRef(),ye=P.useRef(),[ve,ge]=h1({controlled:Q,default:!1,name:"Tooltip",state:"open"});let qe=ve;const De=qM(J),Ge=P.useRef(),Je=P.useCallback(()=>{Ge.current!==void 0&&(document.body.style.WebkitUserSelect=Ge.current,Ge.current=void 0),clearTimeout(ye.current)},[]);P.useEffect(()=>()=>{clearTimeout(Kt.current),clearTimeout(te.current),clearTimeout(de.current),Je()},[Je]);const jt=ke=>{clearTimeout(lc),vs=!0,ge(!0),Se&&!qe&&Se(ke)},rr=Ps(ke=>{clearTimeout(lc),lc=setTimeout(()=>{vs=!1},800+ae),ge(!1),ue&&qe&&ue(ke),clearTimeout(Kt.current),Kt.current=setTimeout(()=>{Ye.current=!1},je.transitions.duration.shortest)}),ze=ke=>{Ye.current&&ke.type!=="touchstart"||(et&&et.removeAttribute("title"),clearTimeout(te.current),clearTimeout(de.current),V||vs&&K?te.current=setTimeout(()=>{jt(ke)},vs?K:V):jt(ke))},Kr=ke=>{clearTimeout(te.current),clearTimeout(de.current),de.current=setTimeout(()=>{rr(ke)},ae)},{isFocusVisibleRef:Xr,onBlur:Zr,onFocus:He,ref:Bn}=HO(),[,Jr]=P.useState(!1),xr=ke=>{Zr(ke),Xr.current===!1&&(Jr(!1),Kr(ke))},Qr=ke=>{et||tr(ke.currentTarget),He(ke),Xr.current===!0&&(Jr(!0),ze(ke))},wr=ke=>{Ye.current=!0;const Bt=he.props;Bt.onTouchStart&&Bt.onTouchStart(ke)},_r=ze,Tr=Kr,Un=ke=>{wr(ke),clearTimeout(de.current),clearTimeout(Kt.current),Je(),Ge.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ye.current=setTimeout(()=>{document.body.style.WebkitUserSelect=Ge.current,ze(ke)},G)},Fr=ke=>{he.props.onTouchEnd&&he.props.onTouchEnd(ke),Je(),clearTimeout(de.current),de.current=setTimeout(()=>{rr(ke)},re)};P.useEffect(()=>{if(!qe)return;function ke(Bt){(Bt.key==="Escape"||Bt.key==="Esc")&&rr(Bt)}return document.addEventListener("keydown",ke),()=>{document.removeEventListener("keydown",ke)}},[rr,qe]);const li=zs(he.ref,Bn,tr,r);!ie&&ie!==0&&(qe=!1);const Ar=P.useRef(),En=ke=>{const Bt=he.props;Bt.onMouseMove&&Bt.onMouseMove(ke),mi={x:ke.clientX,y:ke.clientY},Ar.current&&Ar.current.update()},le={},Gn=typeof ie=="string";L?(le.title=!qe&&Gn&&!z?ie:null,le["aria-describedby"]=qe?De:null):(le["aria-label"]=Gn?ie:null,le["aria-labelledby"]=qe&&!Gn?De:null);const Ft=ce({},le,fe,he.props,{className:Cr(fe.className,he.props.className),onTouchStart:wr,ref:li},W?{onMouseMove:En}:{}),ut={};H||(Ft.onTouchStart=Un,Ft.onTouchEnd=Fr),z||(Ft.onMouseOver=Ss(_r,Ft.onMouseOver),Ft.onMouseLeave=Ss(Tr,Ft.onMouseLeave),$t||(ut.onMouseOver=_r,ut.onMouseLeave=Tr)),j||(Ft.onFocus=Ss(Qr,Ft.onFocus),Ft.onBlur=Ss(xr,Ft.onBlur),$t||(ut.onFocus=Qr,ut.onBlur=xr));const zn=P.useMemo(()=>{var ke;let Bt=[{name:"arrow",enabled:!!Pe,options:{element:Pe,padding:4}}];return(ke=xe.popperOptions)!=null&&ke.modifiers&&(Bt=Bt.concat(xe.popperOptions.modifiers)),ce({},xe.popperOptions,{modifiers:Bt})},[Pe,xe]),Oe=ce({},E,{isRtl:nt,arrow:k,disableInteractive:$t,placement:Ie,PopperComponentProp:Ue,touch:Ye.current}),nr=a$(Oe),da=(n=(a=oe.popper)!=null?a:I.Popper)!=null?n:i$,_e=(i=(o=(s=oe.transition)!=null?s:I.Transition)!=null?o:X)!=null?i:jv,We=(l=(c=oe.tooltip)!=null?c:I.Tooltip)!=null?l:o$,kt=(d=(p=oe.arrow)!=null?p:I.Arrow)!=null?d:s$,tt=fs(da,ce({},xe,(g=ee.popper)!=null?g:D.popper,{className:Cr(nr.popper,xe==null?void 0:xe.className,(m=(b=ee.popper)!=null?b:D.popper)==null?void 0:m.className)}),Oe),ct=fs(_e,ce({},Ee,(v=ee.transition)!=null?v:D.transition),Oe),Or=fs(We,ce({},(S=ee.tooltip)!=null?S:D.tooltip,{className:Cr(nr.tooltip,(O=(_=ee.tooltip)!=null?_:D.tooltip)==null?void 0:O.className)}),Oe),en=fs(kt,ce({},(w=ee.arrow)!=null?w:D.arrow,{className:Cr(nr.arrow,(A=(x=ee.arrow)!=null?x:D.arrow)==null?void 0:A.className)}),Oe);return h.jsxs(P.Fragment,{children:[P.cloneElement(he,Ft),h.jsx(da,ce({as:Ue??xb,placement:Ie,anchorEl:W?{getBoundingClientRect:()=>({top:mi.y,left:mi.x,right:mi.x,bottom:mi.y,width:0,height:0})}:et,popperRef:Ar,open:et?qe:!1,id:De,transition:!0},ut,tt,{popperOptions:zn,children:({TransitionProps:ke})=>h.jsx(_e,ce({timeout:je.transitions.duration.shorter},ke,ct,{children:h.jsxs(We,ce({},Or,{children:[ie,k?h.jsx(kt,ce({},en,{ref:$e})):null]}))}))}))]})}),u$=l$,c$=(e,t="down")=>{const r=Fl(),[n,a]=P.useState(!1),i=r.breakpoints[t](e).split("@media")[1].trim();return P.useEffect(()=>{const o=()=>{const{matches:s}=window.matchMedia(i);a(s)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[i]),n},d$=e=>e.filter(t=>t.tldr).length>=2&&e.some(t=>t.audio_EN);function p$(e){return e.tldr_topic??e.name}var Hs=globalThis&&globalThis.__assign||function(){return Hs=Object.assign||function(e){for(var t,r=1,n=arguments.length;r({autoCorrect:"off",autoComplete:"off"}))` +import{ac as qO,ad as xa,Q as Lv,ae as GL,r as P,af as HO,l as zs,m as zL,p as Ps,e as ce,j as h,d as pb,c as fb,s as Mr,ag as qL,k as Jt,f as Hi,u as gb,a as jl,h as Cr,i as hb,q as Fl,ah as HL,ai as WL,aj as WO,w as B,x as M,ak as VO,al as mb,X as Bl,F,a1 as VL,v as Pr,E as Ul,am as YO,a3 as YL,H as mt,an as KL,y as dn,D as Ct,G as KO,ao as ei,ap as Tt,aq as XL,g as pt,z as Mt,V as XO,a0 as ZO,C as JO,ar as ZL,as as QO,M as Mv,Z as JL,at as e1,au as t1,av as ti,aw as Ne,b as U,ax as QL,ay as eM,az as tM,aA as Gl,aB as rM,aC as nM,aD as aM,aE as iM,aF as r1,aG as oM,aH as zl,aI as sM,aJ as lM,aK as uM,aL as cM,aa as dM,aM as Pv,K as pM,aN as fM,aO as gM,J as hM,I as ir,aP as mM,aQ as bM}from"./index-4c5f8236.js";import{v as na,w as $s,x as ac,y as n1,z as yM,B as vM,G as SM,J as $v,K as js,L as Tn,Q as jv,U as fs,V as a1,W as EM,q as bb,X as i1,i as $r,T as ri,Y as vn,Z as o1,e as s1,$ as xM,a0 as Mo,a1 as wM,a2 as yb,a3 as ql,a4 as vb,a5 as _M,a6 as l1,a7 as u1,a8 as TM,s as AM,a9 as c1,aa as OM,ab as kM,ac as RM,ad as IM,ae as Sb,af as Eb,ag as NM,ah as CM,ai as DM,P as we,u as Pt,aj as d1,ak as LM,al as p1,am as MM,an as Po,ao as PM,ap as $M,aq as jM,ar as FM,as as BM,at as UM,au as f1,av as GM}from"./index-a4caf8d5.js";import{c as zM,a as ic,C as Hl}from"./ClipLoader-601f6378.js";import{S as g1}from"./Skeleton-7bdfc65c.js";import{u as h1,P as xb,a as qM,F as HM}from"./Stack-7f131eb3.js";import{S as WM,F as Fv,i as $o,g as yr,t as VM,_ as m1,a as YM,b as KM,c as ia,d as wb,e as XM,f as ZM,h as JM,j as jo,m as QM,k as eP,l as tP,n as b1,o as rP,p as nP}from"./map-76fdca3a.js";import{c as _b}from"./createSvgIcon-2fe026f6.js";import{useBriefDescriptionStore as aP}from"./index-0d9e6a7d.js";import{u as y1}from"./index-5019b400.js";const Bv="023d8eb306f0027b902fbdc81d33b49b6558b3434d374626f8c324979c92d47c21",iP=async e=>{let t=await xa.enable(!0);if(t||console.warn("Sphinx enable failed, means no pubkey and no budget (including budget of 0)"),t=await xa.keysend(Bv,e),!(t!=null&&t.success)){if(t=await xa.topup(),t||(t=await xa.authorize()),!(t!=null&&t.budget)||(t==null?void 0:t.budget){const r=await iP(t),n={amount:t,refid:e};return await qO.post("/boost",JSON.stringify(n)),r},sP=e=>{const[t,r]=e.split("-")||["",""];return parseInt(r,10)!==0?`${t} - ${r}`:t},v1=(e,t)=>{if(!t)return null;const r=e.filter(i=>i.show_title&&i.link&&i.show_title===t.show_title&&i.episode_title===t.episode_title),n=Lv.groupBy(r,i=>i.timestamp),a=Lv.values(n).reduce((i,o)=>(o[0]&&i.push(o[0]),i),[]);return a.sort((i,o)=>{var p,g;const[s]=((p=i.timestamp)==null?void 0:p.split("-"))||[""],[l]=((g=o.timestamp)==null?void 0:g.split("-"))||[""],c=na(s),d=na(l);return c-d}),a},lP=async e=>{await GL(async()=>{try{await xa.saveGraphData({metaData:{date:Math.floor(new Date().getTime()/1e3),...e},type:"second_brain_consumed_content"})}catch(t){console.warn(t)}})},uP=e=>{const t=/((http|https):\/\/[^\s]+)/g,r=/@(\w+)/g;let n=e.replace(/\\/g,"");return n=n.replace(/'/g,"’"),n=n.replace(/\n/g,"
"),n=n.replace(t,'$1'),n=n.replace(r,'@$1'),n},cP={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:-1,overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},dP=cP;function pP(e,t,r=(n,a)=>n===a){return e.length===t.length&&e.every((n,a)=>r(n,t[a]))}const fP=2;function S1(e,t){return e-t}function hi(e,t,r){return e==null?t:Math.min(Math.max(t,e),r)}function Uv(e,t){var r;const{index:n}=(r=e.reduce((a,i,o)=>{const s=Math.abs(t-i);return a===null||s({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}%`})}},yP=e=>e;let bs;function oc(){return bs===void 0&&(typeof CSS<"u"&&typeof CSS.supports=="function"?bs=CSS.supports("touch-action","none"):bs=!0),bs}function vP(e){const{"aria-labelledby":t,defaultValue:r,disabled:n=!1,disableSwap:a=!1,isRtl:i=!1,marks:o=!1,max:s=100,min:l=0,name:c,onChange:d,onChangeCommitted:p,orientation:g="horizontal",rootRef:m,scale:b=yP,step:v=1,tabIndex:S,value:O}=e,_=P.useRef(),[w,A]=P.useState(-1),[x,E]=P.useState(-1),[k,N]=P.useState(!1),I=P.useRef(0),[D,L]=h1({controlled:O,default:r??l,name:"Slider"}),j=d&&((te,de,ye)=>{const ve=te.nativeEvent||te,ge=new ve.constructor(ve.type,ve);Object.defineProperty(ge,"target",{writable:!0,value:{value:de,name:c}}),d(ge,de,ye)}),z=Array.isArray(D);let q=z?D.slice().sort(S1):[D];q=q.map(te=>hi(te,l,s));const H=o===!0&&v!==null?[...Array(Math.floor((s-l)/v)+1)].map((te,de)=>({value:l+v*de})):o||[],V=H.map(te=>te.value),{isFocusVisibleRef:K,onBlur:G,onFocus:W,ref:J}=HO(),[ae,re]=P.useState(-1),ue=P.useRef(),Se=zs(J,ue),Q=zs(m,Se),Ie=te=>de=>{var ye;const ve=Number(de.currentTarget.getAttribute("data-index"));W(de),K.current===!0&&re(ve),E(ve),te==null||(ye=te.onFocus)==null||ye.call(te,de)},Ue=te=>de=>{var ye;G(de),K.current===!1&&re(-1),E(-1),te==null||(ye=te.onBlur)==null||ye.call(te,de)};zL(()=>{if(n&&ue.current.contains(document.activeElement)){var te;(te=document.activeElement)==null||te.blur()}},[n]),n&&w!==-1&&A(-1),n&&ae!==-1&&re(-1);const xe=te=>de=>{var ye;(ye=te.onChange)==null||ye.call(te,de);const ve=Number(de.currentTarget.getAttribute("data-index")),ge=q[ve],qe=V.indexOf(ge);let De=de.target.valueAsNumber;if(H&&v==null){const Ge=V[V.length-1];De>Ge?De=Ge:De{const{current:ye}=ue,{width:ve,height:ge,bottom:qe,left:De}=ye.getBoundingClientRect();let Ge;oe.indexOf("vertical")===0?Ge=(qe-te.y)/ge:Ge=(te.x-De)/ve,oe.indexOf("-reverse")!==-1&&(Ge=1-Ge);let Je;if(Je=gP(Ge,l,s),v)Je=mP(Je,v,l);else{const rr=Uv(V,Je);Je=V[rr]}Je=hi(Je,l,s);let jt=0;if(z){de?jt=ee.current:jt=Uv(q,Je),a&&(Je=hi(Je,q[jt-1]||-1/0,q[jt+1]||1/0));const rr=Je;Je=Gv({values:q,newValue:Je,index:jt}),a&&de||(jt=Je.indexOf(rr),ee.current=jt)}return{newValue:Je,activeIndex:jt}},X=Ps(te=>{const de=gs(te,_);if(!de)return;if(I.current+=1,te.type==="mousemove"&&te.buttons===0){Ee(te);return}const{newValue:ye,activeIndex:ve}=ie({finger:de,move:!0});hs({sliderRef:ue,activeIndex:ve,setActive:A}),L(ye),!k&&I.current>fP&&N(!0),j&&!ms(ye,D)&&j(te,ye,ve)}),Ee=Ps(te=>{const de=gs(te,_);if(N(!1),!de)return;const{newValue:ye}=ie({finger:de,move:!0});A(-1),te.type==="touchend"&&E(-1),p&&p(te,ye),_.current=void 0,he()}),fe=Ps(te=>{if(n)return;oc()||te.preventDefault();const de=te.changedTouches[0];de!=null&&(_.current=de.identifier);const ye=gs(te,_);if(ye!==!1){const{newValue:ge,activeIndex:qe}=ie({finger:ye});hs({sliderRef:ue,activeIndex:qe,setActive:A}),L(ge),j&&!ms(ge,D)&&j(te,ge,qe)}I.current=0;const ve=$s(ue.current);ve.addEventListener("touchmove",X),ve.addEventListener("touchend",Ee)}),he=P.useCallback(()=>{const te=$s(ue.current);te.removeEventListener("mousemove",X),te.removeEventListener("mouseup",Ee),te.removeEventListener("touchmove",X),te.removeEventListener("touchend",Ee)},[Ee,X]);P.useEffect(()=>{const{current:te}=ue;return te.addEventListener("touchstart",fe,{passive:oc()}),()=>{te.removeEventListener("touchstart",fe,{passive:oc()}),he()}},[he,fe]),P.useEffect(()=>{n&&he()},[n,he]);const je=te=>de=>{var ye;if((ye=te.onMouseDown)==null||ye.call(te,de),n||de.defaultPrevented||de.button!==0)return;de.preventDefault();const ve=gs(de,_);if(ve!==!1){const{newValue:qe,activeIndex:De}=ie({finger:ve});hs({sliderRef:ue,activeIndex:De,setActive:A}),L(qe),j&&!ms(qe,D)&&j(de,qe,De)}I.current=0;const ge=$s(ue.current);ge.addEventListener("mousemove",X),ge.addEventListener("mouseup",Ee)},nt=qs(z?q[0]:l,l,s),et=qs(q[q.length-1],l,s)-nt,tr=(te={})=>{const de=ac(te),ye={onMouseDown:je(de||{})},ve=ce({},de,ye);return ce({},te,{ref:Q},ve)},Pe=te=>de=>{var ye;(ye=te.onMouseOver)==null||ye.call(te,de);const ve=Number(de.currentTarget.getAttribute("data-index"));E(ve)},$e=te=>de=>{var ye;(ye=te.onMouseLeave)==null||ye.call(te,de),E(-1)};return{active:w,axis:oe,axisProps:bP,dragging:k,focusedThumbIndex:ae,getHiddenInputProps:(te={})=>{var de;const ye=ac(te),ve={onChange:xe(ye||{}),onFocus:Ie(ye||{}),onBlur:Ue(ye||{})},ge=ce({},ye,ve);return ce({tabIndex:S,"aria-labelledby":t,"aria-orientation":g,"aria-valuemax":b(s),"aria-valuemin":b(l),name:c,type:"range",min:e.min,max:e.max,step:e.step===null&&e.marks?"any":(de=e.step)!=null?de:void 0,disabled:n},te,ge,{style:ce({},dP,{direction:i?"rtl":"ltr",width:"100%",height:"100%"})})},getRootProps:tr,getThumbProps:(te={})=>{const de=ac(te),ye={onMouseOver:Pe(de||{}),onMouseLeave:$e(de||{})};return ce({},te,de,ye)},marks:H,open:x,range:z,rootRef:Q,trackLeap:et,trackOffset:nt,values:q,getThumbStyle:te=>({pointerEvents:w!==-1&&w!==te?"none":void 0})}}const SP=_b(h.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),EP=_b(h.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),xP=_b(h.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function wP(e){return fb("MuiCheckbox",e)}const _P=pb("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),sc=_P,TP=["checkedIcon","color","icon","indeterminate","indeterminateIcon","inputProps","size","className"],AP=e=>{const{classes:t,indeterminate:r,color:n,size:a}=e,i={root:["root",r&&"indeterminate",`color${Jt(n)}`,`size${Jt(a)}`]},o=hb(i,wP,t);return ce({},t,o)},OP=Mr(WM,{shouldForwardProp:e=>qL(e)||e==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.indeterminate&&t.indeterminate,t[`size${Jt(r.size)}`],r.color!=="default"&&t[`color${Jt(r.color)}`]]}})(({theme:e,ownerState:t})=>ce({color:(e.vars||e).palette.text.secondary},!t.disableRipple&&{"&:hover":{backgroundColor:e.vars?`rgba(${t.color==="default"?e.vars.palette.action.activeChannel:e.vars.palette[t.color].mainChannel} / ${e.vars.palette.action.hoverOpacity})`:Hi(t.color==="default"?e.palette.action.active:e.palette[t.color].main,e.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}}},t.color!=="default"&&{[`&.${sc.checked}, &.${sc.indeterminate}`]:{color:(e.vars||e).palette[t.color].main},[`&.${sc.disabled}`]:{color:(e.vars||e).palette.action.disabled}})),kP=h.jsx(EP,{}),RP=h.jsx(SP,{}),IP=h.jsx(xP,{}),NP=P.forwardRef(function(t,r){var n,a;const i=gb({props:t,name:"MuiCheckbox"}),{checkedIcon:o=kP,color:s="primary",icon:l=RP,indeterminate:c=!1,indeterminateIcon:d=IP,inputProps:p,size:g="medium",className:m}=i,b=jl(i,TP),v=c?d:l,S=c?d:o,O=ce({},i,{color:s,indeterminate:c,size:g}),_=AP(O);return h.jsx(OP,ce({type:"checkbox",inputProps:ce({"data-indeterminate":c},p),icon:P.cloneElement(v,{fontSize:(n=v.props.fontSize)!=null?n:g}),checkedIcon:P.cloneElement(S,{fontSize:(a=S.props.fontSize)!=null?a:g}),ownerState:O,ref:r,className:Cr(_.root,m)},b,{classes:_}))}),CP=NP,DP=["addEndListener","appear","children","container","direction","easing","in","onEnter","onEntered","onEntering","onExit","onExited","onExiting","style","timeout","TransitionComponent"];function LP(e,t,r){const n=t.getBoundingClientRect(),a=r&&r.getBoundingClientRect(),i=n1(t);let o;if(t.fakeTransform)o=t.fakeTransform;else{const c=i.getComputedStyle(t);o=c.getPropertyValue("-webkit-transform")||c.getPropertyValue("transform")}let s=0,l=0;if(o&&o!=="none"&&typeof o=="string"){const c=o.split("(")[1].split(")")[0].split(",");s=parseInt(c[4],10),l=parseInt(c[5],10)}return e==="left"?a?`translateX(${a.right+s-n.left}px)`:`translateX(${i.innerWidth+s-n.left}px)`:e==="right"?a?`translateX(-${n.right-a.left-s}px)`:`translateX(-${n.left+n.width-s}px)`:e==="up"?a?`translateY(${a.bottom+l-n.top}px)`:`translateY(${i.innerHeight+l-n.top}px)`:a?`translateY(-${n.top-a.top+n.height-l}px)`:`translateY(-${n.top+n.height-l}px)`}function MP(e){return typeof e=="function"?e():e}function ys(e,t,r){const n=MP(r),a=LP(e,t,n);a&&(t.style.webkitTransform=a,t.style.transform=a)}const PP=P.forwardRef(function(t,r){const n=Fl(),a={enter:n.transitions.easing.easeOut,exit:n.transitions.easing.sharp},i={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:o,appear:s=!0,children:l,container:c,direction:d="down",easing:p=a,in:g,onEnter:m,onEntered:b,onEntering:v,onExit:S,onExited:O,onExiting:_,style:w,timeout:A=i,TransitionComponent:x=yM}=t,E=jl(t,DP),k=P.useRef(null),N=zs(l.ref,k,r),I=G=>W=>{G&&(W===void 0?G(k.current):G(k.current,W))},D=I((G,W)=>{ys(d,G,c),SM(G),m&&m(G,W)}),L=I((G,W)=>{const J=$v({timeout:A,style:w,easing:p},{mode:"enter"});G.style.webkitTransition=n.transitions.create("-webkit-transform",ce({},J)),G.style.transition=n.transitions.create("transform",ce({},J)),G.style.webkitTransform="none",G.style.transform="none",v&&v(G,W)}),j=I(b),z=I(_),q=I(G=>{const W=$v({timeout:A,style:w,easing:p},{mode:"exit"});G.style.webkitTransition=n.transitions.create("-webkit-transform",W),G.style.transition=n.transitions.create("transform",W),ys(d,G,c),S&&S(G)}),H=I(G=>{G.style.webkitTransition="",G.style.transition="",O&&O(G)}),V=G=>{o&&o(k.current,G)},K=P.useCallback(()=>{k.current&&ys(d,k.current,c)},[d,c]);return P.useEffect(()=>{if(g||d==="down"||d==="right")return;const G=vM(()=>{k.current&&ys(d,k.current,c)}),W=n1(k.current);return W.addEventListener("resize",G),()=>{G.clear(),W.removeEventListener("resize",G)}},[d,g,c]),P.useEffect(()=>{g||K()},[g,K]),h.jsx(x,ce({nodeRef:k,onEnter:D,onEntered:j,onEntering:L,onExit:q,onExited:H,onExiting:z,addEndListener:V,appear:s,in:g,timeout:A},E,{children:(G,W)=>P.cloneElement(l,ce({ref:N,style:ce({visibility:G==="exited"&&!g?"hidden":void 0},w,l.props.style)},W))}))}),Ca=PP,$P=e=>!e||!js(e),jP=$P;function FP(e){return fb("MuiSlider",e)}const BP=pb("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"]),Dr=BP,UP=e=>{const{open:t}=e;return{offset:Cr(t&&Dr.valueLabelOpen),circle:Dr.valueLabelCircle,label:Dr.valueLabelLabel}};function GP(e){const{children:t,className:r,value:n}=e,a=UP(e);return t?P.cloneElement(t,{className:Cr(t.props.className)},h.jsxs(P.Fragment,{children:[t.props.children,h.jsx("span",{className:Cr(a.offset,r),"aria-hidden":!0,children:h.jsx("span",{className:a.circle,children:h.jsx("span",{className:a.label,children:n})})})]})):null}const zP=["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 zv(e){return e}const qP=Mr("span",{name:"MuiSlider",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${Jt(r.color)}`],r.size!=="medium"&&t[`size${Jt(r.size)}`],r.marked&&t.marked,r.orientation==="vertical"&&t.vertical,r.track==="inverted"&&t.trackInverted,r.track===!1&&t.trackFalse]}})(({theme:e,ownerState:t})=>ce({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"&&ce({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"&&ce({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"},[`&.${Dr.disabled}`]:{pointerEvents:"none",cursor:"default",color:(e.vars||e).palette.grey[400]},[`&.${Dr.dragging}`]:{[`& .${Dr.thumb}, & .${Dr.track}`]:{transition:"none"}}})),HP=Mr("span",{name:"MuiSlider",slot:"Rail",overridesResolver:(e,t)=>t.rail})(({ownerState:e})=>ce({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})),WP=Mr("span",{name:"MuiSlider",slot:"Track",overridesResolver:(e,t)=>t.track})(({theme:e,ownerState:t})=>{const r=e.palette.mode==="light"?HL(e.palette[t.color].main,.62):WL(e.palette[t.color].main,.5);return ce({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`]:r,borderColor:e.vars?e.vars.palette.Slider[`${t.color}Track`]:r})}),VP=Mr("span",{name:"MuiSlider",slot:"Thumb",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.thumb,t[`thumbColor${Jt(r.color)}`],r.size!=="medium"&&t[`thumbSize${Jt(r.size)}`]]}})(({theme:e,ownerState:t})=>ce({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":ce({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, &.${Dr.focusVisible}`]:{boxShadow:`0px 0px 0px 8px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:Hi(e.palette[t.color].main,.16)}`,"@media (hover: none)":{boxShadow:"none"}},[`&.${Dr.active}`]:{boxShadow:`0px 0px 0px 14px ${e.vars?`rgba(${e.vars.palette[t.color].mainChannel} / 0.16)`:Hi(e.palette[t.color].main,.16)}`},[`&.${Dr.disabled}`]:{"&:hover":{boxShadow:"none"}}})),YP=Mr(GP,{name:"MuiSlider",slot:"ValueLabel",overridesResolver:(e,t)=>t.valueLabel})(({theme:e,ownerState:t})=>ce({[`&.${Dr.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"})),KP=Mr("span",{name:"MuiSlider",slot:"Mark",shouldForwardProp:e=>WO(e)&&e!=="markActive",overridesResolver:(e,t)=>{const{markActive:r}=e;return[t.mark,r&&t.markActive]}})(({theme:e,ownerState:t,markActive:r})=>ce({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)"},r&&{backgroundColor:(e.vars||e).palette.background.paper,opacity:.8})),XP=Mr("span",{name:"MuiSlider",slot:"MarkLabel",shouldForwardProp:e=>WO(e)&&e!=="markLabelActive",overridesResolver:(e,t)=>t.markLabel})(({theme:e,ownerState:t,markLabelActive:r})=>ce({},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}},r&&{color:(e.vars||e).palette.text.primary})),ZP=e=>{const{disabled:t,dragging:r,marked:n,orientation:a,track:i,classes:o,color:s,size:l}=e,c={root:["root",t&&"disabled",r&&"dragging",n&&"marked",a==="vertical"&&"vertical",i==="inverted"&&"trackInverted",i===!1&&"trackFalse",s&&`color${Jt(s)}`,l&&`size${Jt(l)}`],rail:["rail"],track:["track"],mark:["mark"],markActive:["markActive"],markLabel:["markLabel"],markLabelActive:["markLabelActive"],valueLabel:["valueLabel"],thumb:["thumb",t&&"disabled",l&&`thumbSize${Jt(l)}`,s&&`thumbColor${Jt(s)}`],active:["active"],disabled:["disabled"],focusVisible:["focusVisible"]};return hb(c,FP,o)},JP=({children:e})=>e,QP=P.forwardRef(function(t,r){var n,a,i,o,s,l,c,d,p,g,m,b,v,S,O,_,w,A,x,E,k,N,I,D;const L=gb({props:t,name:"MuiSlider"}),z=Fl().direction==="rtl",{"aria-label":q,"aria-valuetext":H,"aria-labelledby":V,component:K="span",components:G={},componentsProps:W={},color:J="primary",classes:ae,className:re,disableSwap:ue=!1,disabled:Se=!1,getAriaLabel:Q,getAriaValueText:Ie,marks:Ue=!1,max:xe=100,min:ee=0,orientation:oe="horizontal",size:ie="medium",step:X=1,scale:Ee=zv,slotProps:fe,slots:he,track:je="normal",valueLabelDisplay:nt="off",valueLabelFormat:et=zv}=L,tr=jl(L,zP),Pe=ce({},L,{isRtl:z,max:xe,min:ee,classes:ae,disabled:Se,disableSwap:ue,orientation:oe,marks:Ue,color:J,size:ie,step:X,scale:Ee,track:je,valueLabelDisplay:nt,valueLabelFormat:et}),{axisProps:$e,getRootProps:Ye,getHiddenInputProps:$t,getThumbProps:Kt,open:te,active:de,axis:ye,focusedThumbIndex:ve,range:ge,dragging:qe,marks:De,values:Ge,trackOffset:Je,trackLeap:jt,getThumbStyle:rr}=vP(ce({},Pe,{rootRef:r}));Pe.marked=De.length>0&&De.some(_e=>_e.label),Pe.dragging=qe,Pe.focusedThumbIndex=ve;const ze=ZP(Pe),Kr=(n=(a=he==null?void 0:he.root)!=null?a:G.Root)!=null?n:qP,Xr=(i=(o=he==null?void 0:he.rail)!=null?o:G.Rail)!=null?i:HP,Zr=(s=(l=he==null?void 0:he.track)!=null?l:G.Track)!=null?s:WP,He=(c=(d=he==null?void 0:he.thumb)!=null?d:G.Thumb)!=null?c:VP,Bn=(p=(g=he==null?void 0:he.valueLabel)!=null?g:G.ValueLabel)!=null?p:YP,Jr=(m=(b=he==null?void 0:he.mark)!=null?b:G.Mark)!=null?m:KP,xr=(v=(S=he==null?void 0:he.markLabel)!=null?S:G.MarkLabel)!=null?v:XP,Qr=(O=(_=he==null?void 0:he.input)!=null?_:G.Input)!=null?O:"input",wr=(w=fe==null?void 0:fe.root)!=null?w:W.root,_r=(A=fe==null?void 0:fe.rail)!=null?A:W.rail,Tr=(x=fe==null?void 0:fe.track)!=null?x:W.track,Un=(E=fe==null?void 0:fe.thumb)!=null?E:W.thumb,Fr=(k=fe==null?void 0:fe.valueLabel)!=null?k:W.valueLabel,li=(N=fe==null?void 0:fe.mark)!=null?N:W.mark,Ar=(I=fe==null?void 0:fe.markLabel)!=null?I:W.markLabel,En=(D=fe==null?void 0:fe.input)!=null?D:W.input,le=Tn({elementType:Kr,getSlotProps:Ye,externalSlotProps:wr,externalForwardedProps:tr,additionalProps:ce({},jP(Kr)&&{as:K}),ownerState:ce({},Pe,wr==null?void 0:wr.ownerState),className:[ze.root,re]}),Gn=Tn({elementType:Xr,externalSlotProps:_r,ownerState:Pe,className:ze.rail}),Ft=Tn({elementType:Zr,externalSlotProps:Tr,additionalProps:{style:ce({},$e[ye].offset(Je),$e[ye].leap(jt))},ownerState:ce({},Pe,Tr==null?void 0:Tr.ownerState),className:ze.track}),ut=Tn({elementType:He,getSlotProps:Kt,externalSlotProps:Un,ownerState:ce({},Pe,Un==null?void 0:Un.ownerState),className:ze.thumb}),zn=Tn({elementType:Bn,externalSlotProps:Fr,ownerState:ce({},Pe,Fr==null?void 0:Fr.ownerState),className:ze.valueLabel}),Oe=Tn({elementType:Jr,externalSlotProps:li,ownerState:Pe,className:ze.mark}),nr=Tn({elementType:xr,externalSlotProps:Ar,ownerState:Pe,className:ze.markLabel}),da=Tn({elementType:Qr,getSlotProps:$t,externalSlotProps:En,ownerState:Pe});return h.jsxs(Kr,ce({},le,{children:[h.jsx(Xr,ce({},Gn)),h.jsx(Zr,ce({},Ft)),De.filter(_e=>_e.value>=ee&&_e.value<=xe).map((_e,We)=>{const kt=qs(_e.value,ee,xe),tt=$e[ye].offset(kt);let ct;return je===!1?ct=Ge.indexOf(_e.value)!==-1:ct=je==="normal"&&(ge?_e.value>=Ge[0]&&_e.value<=Ge[Ge.length-1]:_e.value<=Ge[0])||je==="inverted"&&(ge?_e.value<=Ge[0]||_e.value>=Ge[Ge.length-1]:_e.value>=Ge[0]),h.jsxs(P.Fragment,{children:[h.jsx(Jr,ce({"data-index":We},Oe,!js(Jr)&&{markActive:ct},{style:ce({},tt,Oe.style),className:Cr(Oe.className,ct&&ze.markActive)})),_e.label!=null?h.jsx(xr,ce({"aria-hidden":!0,"data-index":We},nr,!js(xr)&&{markLabelActive:ct},{style:ce({},tt,nr.style),className:Cr(ze.markLabel,nr.className,ct&&ze.markLabelActive),children:_e.label})):null]},We)}),Ge.map((_e,We)=>{const kt=qs(_e,ee,xe),tt=$e[ye].offset(kt),ct=nt==="off"?JP:Bn;return h.jsx(ct,ce({},!js(ct)&&{valueLabelFormat:et,valueLabelDisplay:nt,value:typeof et=="function"?et(Ee(_e),We):et,index:We,open:te===We||de===We||nt==="on",disabled:Se},zn,{children:h.jsx(He,ce({"data-index":We},ut,{className:Cr(ze.thumb,ut.className,de===We&&ze.active,ve===We&&ze.focusVisible),style:ce({},tt,rr(We),ut.style),children:h.jsx(Qr,ce({"data-index":We,"aria-label":Q?Q(We):q,"aria-valuenow":Ee(_e),"aria-labelledby":V,"aria-valuetext":Ie?Ie(Ee(_e),We):H,value:Ge[We]},da))}))}),We)})]}))}),Wl=QP;function e$(e){return fb("MuiTooltip",e)}const t$=pb("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]),Nn=t$,r$=["arrow","children","classes","components","componentsProps","describeChild","disableFocusListener","disableHoverListener","disableInteractive","disableTouchListener","enterDelay","enterNextDelay","enterTouchDelay","followCursor","id","leaveDelay","leaveTouchDelay","onClose","onOpen","open","placement","PopperComponent","PopperProps","slotProps","slots","title","TransitionComponent","TransitionProps"];function n$(e){return Math.round(e*1e5)/1e5}const a$=e=>{const{classes:t,disableInteractive:r,arrow:n,touch:a,placement:i}=e,o={popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",a&&"touch",`tooltipPlacement${Jt(i.split("-")[0])}`],arrow:["arrow"]};return hb(o,e$,t)},i$=Mr(xb,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(({theme:e,ownerState:t,open:r})=>ce({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none"},!t.disableInteractive&&{pointerEvents:"auto"},!r&&{pointerEvents:"none"},t.arrow&&{[`&[data-popper-placement*="bottom"] .${Nn.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Nn.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Nn.arrow}`]:ce({},t.isRtl?{right:0,marginRight:"-0.71em"}:{left:0,marginLeft:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}}),[`&[data-popper-placement*="left"] .${Nn.arrow}`]:ce({},t.isRtl?{left:0,marginLeft:"-0.71em"}:{right:0,marginRight:"-0.71em"},{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}})})),o$=Mr("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${Jt(r.placement.split("-")[0])}`]]}})(({theme:e,ownerState:t})=>ce({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:Hi(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium},t.arrow&&{position:"relative",margin:0},t.touch&&{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${n$(16/14)}em`,fontWeight:e.typography.fontWeightRegular},{[`.${Nn.popper}[data-popper-placement*="left"] &`]:ce({transformOrigin:"right center"},t.isRtl?ce({marginLeft:"14px"},t.touch&&{marginLeft:"24px"}):ce({marginRight:"14px"},t.touch&&{marginRight:"24px"})),[`.${Nn.popper}[data-popper-placement*="right"] &`]:ce({transformOrigin:"left center"},t.isRtl?ce({marginRight:"14px"},t.touch&&{marginRight:"24px"}):ce({marginLeft:"14px"},t.touch&&{marginLeft:"24px"})),[`.${Nn.popper}[data-popper-placement*="top"] &`]:ce({transformOrigin:"center bottom",marginBottom:"14px"},t.touch&&{marginBottom:"24px"}),[`.${Nn.popper}[data-popper-placement*="bottom"] &`]:ce({transformOrigin:"center top",marginTop:"14px"},t.touch&&{marginTop:"24px"})})),s$=Mr("span",{name:"MuiTooltip",slot:"Arrow",overridesResolver:(e,t)=>t.arrow})(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:Hi(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}}));let vs=!1,lc=null,mi={x:0,y:0};function Ss(e,t){return r=>{t&&t(r),e(r)}}const l$=P.forwardRef(function(t,r){var n,a,i,o,s,l,c,d,p,g,m,b,v,S,O,_,w,A,x;const E=gb({props:t,name:"MuiTooltip"}),{arrow:k=!1,children:N,components:I={},componentsProps:D={},describeChild:L=!1,disableFocusListener:j=!1,disableHoverListener:z=!1,disableInteractive:q=!1,disableTouchListener:H=!1,enterDelay:V=100,enterNextDelay:K=0,enterTouchDelay:G=700,followCursor:W=!1,id:J,leaveDelay:ae=0,leaveTouchDelay:re=1500,onClose:ue,onOpen:Se,open:Q,placement:Ie="bottom",PopperComponent:Ue,PopperProps:xe={},slotProps:ee={},slots:oe={},title:ie,TransitionComponent:X=jv,TransitionProps:Ee}=E,fe=jl(E,r$),he=P.isValidElement(N)?N:h.jsx("span",{children:N}),je=Fl(),nt=je.direction==="rtl",[et,tr]=P.useState(),[Pe,$e]=P.useState(null),Ye=P.useRef(!1),$t=q||W,Kt=P.useRef(),te=P.useRef(),de=P.useRef(),ye=P.useRef(),[ve,ge]=h1({controlled:Q,default:!1,name:"Tooltip",state:"open"});let qe=ve;const De=qM(J),Ge=P.useRef(),Je=P.useCallback(()=>{Ge.current!==void 0&&(document.body.style.WebkitUserSelect=Ge.current,Ge.current=void 0),clearTimeout(ye.current)},[]);P.useEffect(()=>()=>{clearTimeout(Kt.current),clearTimeout(te.current),clearTimeout(de.current),Je()},[Je]);const jt=ke=>{clearTimeout(lc),vs=!0,ge(!0),Se&&!qe&&Se(ke)},rr=Ps(ke=>{clearTimeout(lc),lc=setTimeout(()=>{vs=!1},800+ae),ge(!1),ue&&qe&&ue(ke),clearTimeout(Kt.current),Kt.current=setTimeout(()=>{Ye.current=!1},je.transitions.duration.shortest)}),ze=ke=>{Ye.current&&ke.type!=="touchstart"||(et&&et.removeAttribute("title"),clearTimeout(te.current),clearTimeout(de.current),V||vs&&K?te.current=setTimeout(()=>{jt(ke)},vs?K:V):jt(ke))},Kr=ke=>{clearTimeout(te.current),clearTimeout(de.current),de.current=setTimeout(()=>{rr(ke)},ae)},{isFocusVisibleRef:Xr,onBlur:Zr,onFocus:He,ref:Bn}=HO(),[,Jr]=P.useState(!1),xr=ke=>{Zr(ke),Xr.current===!1&&(Jr(!1),Kr(ke))},Qr=ke=>{et||tr(ke.currentTarget),He(ke),Xr.current===!0&&(Jr(!0),ze(ke))},wr=ke=>{Ye.current=!0;const Bt=he.props;Bt.onTouchStart&&Bt.onTouchStart(ke)},_r=ze,Tr=Kr,Un=ke=>{wr(ke),clearTimeout(de.current),clearTimeout(Kt.current),Je(),Ge.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",ye.current=setTimeout(()=>{document.body.style.WebkitUserSelect=Ge.current,ze(ke)},G)},Fr=ke=>{he.props.onTouchEnd&&he.props.onTouchEnd(ke),Je(),clearTimeout(de.current),de.current=setTimeout(()=>{rr(ke)},re)};P.useEffect(()=>{if(!qe)return;function ke(Bt){(Bt.key==="Escape"||Bt.key==="Esc")&&rr(Bt)}return document.addEventListener("keydown",ke),()=>{document.removeEventListener("keydown",ke)}},[rr,qe]);const li=zs(he.ref,Bn,tr,r);!ie&&ie!==0&&(qe=!1);const Ar=P.useRef(),En=ke=>{const Bt=he.props;Bt.onMouseMove&&Bt.onMouseMove(ke),mi={x:ke.clientX,y:ke.clientY},Ar.current&&Ar.current.update()},le={},Gn=typeof ie=="string";L?(le.title=!qe&&Gn&&!z?ie:null,le["aria-describedby"]=qe?De:null):(le["aria-label"]=Gn?ie:null,le["aria-labelledby"]=qe&&!Gn?De:null);const Ft=ce({},le,fe,he.props,{className:Cr(fe.className,he.props.className),onTouchStart:wr,ref:li},W?{onMouseMove:En}:{}),ut={};H||(Ft.onTouchStart=Un,Ft.onTouchEnd=Fr),z||(Ft.onMouseOver=Ss(_r,Ft.onMouseOver),Ft.onMouseLeave=Ss(Tr,Ft.onMouseLeave),$t||(ut.onMouseOver=_r,ut.onMouseLeave=Tr)),j||(Ft.onFocus=Ss(Qr,Ft.onFocus),Ft.onBlur=Ss(xr,Ft.onBlur),$t||(ut.onFocus=Qr,ut.onBlur=xr));const zn=P.useMemo(()=>{var ke;let Bt=[{name:"arrow",enabled:!!Pe,options:{element:Pe,padding:4}}];return(ke=xe.popperOptions)!=null&&ke.modifiers&&(Bt=Bt.concat(xe.popperOptions.modifiers)),ce({},xe.popperOptions,{modifiers:Bt})},[Pe,xe]),Oe=ce({},E,{isRtl:nt,arrow:k,disableInteractive:$t,placement:Ie,PopperComponentProp:Ue,touch:Ye.current}),nr=a$(Oe),da=(n=(a=oe.popper)!=null?a:I.Popper)!=null?n:i$,_e=(i=(o=(s=oe.transition)!=null?s:I.Transition)!=null?o:X)!=null?i:jv,We=(l=(c=oe.tooltip)!=null?c:I.Tooltip)!=null?l:o$,kt=(d=(p=oe.arrow)!=null?p:I.Arrow)!=null?d:s$,tt=fs(da,ce({},xe,(g=ee.popper)!=null?g:D.popper,{className:Cr(nr.popper,xe==null?void 0:xe.className,(m=(b=ee.popper)!=null?b:D.popper)==null?void 0:m.className)}),Oe),ct=fs(_e,ce({},Ee,(v=ee.transition)!=null?v:D.transition),Oe),Or=fs(We,ce({},(S=ee.tooltip)!=null?S:D.tooltip,{className:Cr(nr.tooltip,(O=(_=ee.tooltip)!=null?_:D.tooltip)==null?void 0:O.className)}),Oe),en=fs(kt,ce({},(w=ee.arrow)!=null?w:D.arrow,{className:Cr(nr.arrow,(A=(x=ee.arrow)!=null?x:D.arrow)==null?void 0:A.className)}),Oe);return h.jsxs(P.Fragment,{children:[P.cloneElement(he,Ft),h.jsx(da,ce({as:Ue??xb,placement:Ie,anchorEl:W?{getBoundingClientRect:()=>({top:mi.y,left:mi.x,right:mi.x,bottom:mi.y,width:0,height:0})}:et,popperRef:Ar,open:et?qe:!1,id:De,transition:!0},ut,tt,{popperOptions:zn,children:({TransitionProps:ke})=>h.jsx(_e,ce({timeout:je.transitions.duration.shorter},ke,ct,{children:h.jsxs(We,ce({},Or,{children:[ie,k?h.jsx(kt,ce({},en,{ref:$e})):null]}))}))}))]})}),u$=l$,c$=(e,t="down")=>{const r=Fl(),[n,a]=P.useState(!1),i=r.breakpoints[t](e).split("@media")[1].trim();return P.useEffect(()=>{const o=()=>{const{matches:s}=window.matchMedia(i);a(s)};return o(),window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[i]),n},d$=e=>e.filter(t=>t.tldr).length>=2&&e.some(t=>t.audio_EN);function p$(e){return e.tldr_topic??e.name}var Hs=globalThis&&globalThis.__assign||function(){return Hs=Object.assign||function(e){for(var t,r=1,n=arguments.length;r({autoCorrect:"off",autoComplete:"off"}))` pointer-events: auto; height: 48px; padding: 0 40px 0 18px; @@ -1900,7 +1900,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `,boe=B.audio` height: 0; width: 0; -`,yoe=()=>{const e=Pt(),{setPlayingNode:t}=Po(r=>r);switch(P.useEffect(()=>{var n,a;if(!e)return;(e.media_url||e.link||((n=e.properties)==null?void 0:n.link)||((a=e.properties)==null?void 0:a.media_url))&&t(e)},[t,e]),e==null?void 0:e.node_type){case"guest":case"person":return h.jsx(s7,{});case"data_series":return h.jsx(oX,{});case"tribe_message":return h.jsx(n7,{});case"Tweet":return h.jsx(b7,{});case"topic":return h.jsx(m7,{});case"show":return h.jsx(h7,{});case"video":case"podcast":case"clip":case"twitter_space":return h.jsx(XR,{});case"document":return h.jsx(poe,{});case"episode":return h.jsx(JX,{},e.ref_id);case"image":return h.jsx(r7,{});default:return h.jsx(eoe,{})}},voe=P.memo(yoe);var Soe=function(t,r,n){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof r=="function"&&(n=r,r={}),r=r||{},n=n||function(){},i.type=r.type||"text/javascript",i.charset=r.charset||"utf8",i.async="async"in r?!!r.async:!0,i.src=t,r.attrs&&Eoe(i,r.attrs),r.text&&(i.text=""+r.text);var o="onload"in i?PO:xoe;o(i,n),i.onload||PO(i,n),a.appendChild(i)};function Eoe(e,t){for(var r in t)e.setAttribute(r,t[r])}function PO(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 xoe(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var woe=function(t){return _oe(t)&&!Toe(t)};function _oe(e){return!!e&&typeof e=="object"}function Toe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||koe(e)}var Aoe=typeof Symbol=="function"&&Symbol.for,Ooe=Aoe?Symbol.for("react.element"):60103;function koe(e){return e.$$typeof===Ooe}function Roe(e){return Array.isArray(e)?[]:{}}function Lo(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Qa(Roe(e),e,t):e}function Ioe(e,t,r){return e.concat(t).map(function(n){return Lo(n,r)})}function Noe(e,t){if(!t.customMerge)return Qa;var r=t.customMerge(e);return typeof r=="function"?r:Qa}function Coe(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function $O(e){return Object.keys(e).concat(Coe(e))}function DI(e,t){try{return t in e}catch{return!1}}function Doe(e,t){return DI(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function Loe(e,t,r){var n={};return r.isMergeableObject(e)&&$O(e).forEach(function(a){n[a]=Lo(e[a],r)}),$O(t).forEach(function(a){Doe(e,a)||(DI(e,a)&&r.isMergeableObject(t[a])?n[a]=Noe(a,r)(e[a],t[a],r):n[a]=Lo(t[a],r))}),n}function Qa(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||Ioe,r.isMergeableObject=r.isMergeableObject||woe,r.cloneUnlessOtherwiseSpecified=Lo;var n=Array.isArray(t),a=Array.isArray(e),i=n===a;return i?n?r.arrayMerge(e,t,r):Loe(e,t,r):Lo(t,r)}Qa.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,a){return Qa(n,a,r)},{})};var Moe=Qa,LI=Moe,Poe=Object.create,Pu=Object.defineProperty,$oe=Object.getOwnPropertyDescriptor,joe=Object.getOwnPropertyNames,Foe=Object.getPrototypeOf,Boe=Object.prototype.hasOwnProperty,Uoe=(e,t)=>{for(var r in t)Pu(e,r,{get:t[r],enumerable:!0})},MI=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of joe(t))!Boe.call(e,a)&&a!==r&&Pu(e,a,{get:()=>t[a],enumerable:!(n=$oe(t,a))||n.enumerable});return e},Hy=(e,t,r)=>(r=e!=null?Poe(Foe(e)):{},MI(t||!e||!e.__esModule?Pu(r,"default",{value:e,enumerable:!0}):r,e)),Goe=e=>MI(Pu({},"__esModule",{value:!0}),e),PI={};Uoe(PI,{callPlayer:()=>ase,getConfig:()=>rse,getSDK:()=>tse,isBlobUrl:()=>ose,isMediaStream:()=>ise,lazy:()=>Woe,omit:()=>nse,parseEndTime:()=>Joe,parseStartTime:()=>Zoe,queryString:()=>ese,randomString:()=>Qoe,supportsWebKitPresentationMode:()=>sse});var $u=Goe(PI),zoe=Hy(P),qoe=Hy(Soe),Hoe=Hy(LI);const Woe=e=>zoe.default.lazy(async()=>{const t=await e();return typeof t.default=="function"?t:t.default}),Voe=/[?&#](?:start|t)=([0-9hms]+)/,Yoe=/[?&#]end=([0-9hms]+)/,lb=/(\d+)(h|m|s)/g,Koe=/^\d+$/;function $I(e,t){if(e instanceof Array)return;const r=e.match(t);if(r){const n=r[1];if(n.match(lb))return Xoe(n);if(Koe.test(n))return parseInt(n)}}function Xoe(e){let t=0,r=lb.exec(e);for(;r!==null;){const[,n,a]=r;a==="h"&&(t+=parseInt(n,10)*60*60),a==="m"&&(t+=parseInt(n,10)*60),a==="s"&&(t+=parseInt(n,10)),r=lb.exec(e)}return t}function Zoe(e){return $I(e,Voe)}function Joe(e){return $I(e,Yoe)}function Qoe(){return Math.random().toString(36).substr(2,5)}function ese(e){return Object.keys(e).map(t=>`${t}=${e[t]}`).join("&")}function qh(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 Sa={},tse=function(t,r,n=null,a=()=>!0,i=qoe.default){const o=qh(r);return o&&a(o)?Promise.resolve(o):new Promise((s,l)=>{if(Sa[t]){Sa[t].push({resolve:s,reject:l});return}Sa[t]=[{resolve:s,reject:l}];const c=d=>{Sa[t].forEach(p=>p.resolve(d))};if(n){const d=window[n];window[n]=function(){d&&d(),c(qh(r))}}i(t,d=>{d?(Sa[t].forEach(p=>p.reject(d)),Sa[t]=null):n||c(qh(r))})})};function rse(e,t){return(0,Hoe.default)(t.config,e.config)}function nse(e,...t){const r=[].concat(...t),n={},a=Object.keys(e);for(const i of a)r.indexOf(i)===-1&&(n[i]=e[i]);return n}function ase(e,...t){if(!this.player||!this.player[e]){let r=`ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `;return this.player?this.player[e]||(r+="The method was not available"):r+="The player was not available",console.warn(r,"font-weight: bold",""),null}return this.player[e](...t)}function ise(e){return typeof window<"u"&&typeof window.MediaStream<"u"&&e instanceof window.MediaStream}function ose(e){return/^blob:/.test(e)}function sse(e=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var Wy=Object.defineProperty,lse=Object.getOwnPropertyDescriptor,use=Object.getOwnPropertyNames,cse=Object.prototype.hasOwnProperty,dse=(e,t)=>{for(var r in t)Wy(e,r,{get:t[r],enumerable:!0})},pse=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of use(t))!cse.call(e,a)&&a!==r&&Wy(e,a,{get:()=>t[a],enumerable:!(n=lse(t,a))||n.enumerable});return e},fse=e=>pse(Wy({},"__esModule",{value:!0}),e),jI={};dse(jI,{AUDIO_EXTENSIONS:()=>Vy,DASH_EXTENSIONS:()=>ZI,FLV_EXTENSIONS:()=>JI,HLS_EXTENSIONS:()=>Ky,MATCH_URL_DAILYMOTION:()=>VI,MATCH_URL_FACEBOOK:()=>UI,MATCH_URL_FACEBOOK_WATCH:()=>GI,MATCH_URL_KALTURA:()=>XI,MATCH_URL_MIXCLOUD:()=>YI,MATCH_URL_SOUNDCLOUD:()=>FI,MATCH_URL_STREAMABLE:()=>zI,MATCH_URL_TWITCH_CHANNEL:()=>WI,MATCH_URL_TWITCH_VIDEO:()=>HI,MATCH_URL_VIDYARD:()=>KI,MATCH_URL_VIMEO:()=>BI,MATCH_URL_WISTIA:()=>qI,MATCH_URL_YOUTUBE:()=>ub,VIDEO_EXTENSIONS:()=>Yy,canPlay:()=>hse});var gse=fse(jI),jO=$u;const ub=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,FI=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,BI=/vimeo\.com\/(?!progressive_redirect).+/,UI=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,GI=/^https?:\/\/fb\.watch\/.+$/,zI=/streamable\.com\/([a-z0-9]+)$/,qI=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,HI=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,WI=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,VI=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,YI=/mixcloud\.com\/([^/]+\/[^/]+)/,KI=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,XI=/^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-_].*)$/,Vy=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,Yy=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,Ky=/\.(m3u8)($|\?)/i,ZI=/\.(mpd)($|\?)/i,JI=/\.(flv)($|\?)/i,cb=e=>{if(e instanceof Array){for(const t of e)if(typeof t=="string"&&cb(t)||cb(t.src))return!0;return!1}return(0,jO.isMediaStream)(e)||(0,jO.isBlobUrl)(e)?!0:Vy.test(e)||Yy.test(e)||Ky.test(e)||ZI.test(e)||JI.test(e)},hse={youtube:e=>e instanceof Array?e.every(t=>ub.test(t)):ub.test(e),soundcloud:e=>FI.test(e)&&!Vy.test(e),vimeo:e=>BI.test(e)&&!Yy.test(e)&&!Ky.test(e),facebook:e=>UI.test(e)||GI.test(e),streamable:e=>zI.test(e),wistia:e=>qI.test(e),twitch:e=>HI.test(e)||WI.test(e),dailymotion:e=>VI.test(e),mixcloud:e=>YI.test(e),vidyard:e=>KI.test(e),kaltura:e=>XI.test(e),file:cb};var Xy=Object.defineProperty,mse=Object.getOwnPropertyDescriptor,bse=Object.getOwnPropertyNames,yse=Object.prototype.hasOwnProperty,vse=(e,t)=>{for(var r in t)Xy(e,r,{get:t[r],enumerable:!0})},Sse=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of bse(t))!yse.call(e,a)&&a!==r&&Xy(e,a,{get:()=>t[a],enumerable:!(n=mse(t,a))||n.enumerable});return e},Ese=e=>Sse(Xy({},"__esModule",{value:!0}),e),QI={};vse(QI,{default:()=>wse});var xse=Ese(QI),ar=$u,Zt=gse,wse=[{key:"youtube",name:"YouTube",canPlay:Zt.canPlay.youtube,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./YouTube-410d4df7.js").then(e=>e.Y),["assets/YouTube-410d4df7.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"soundcloud",name:"SoundCloud",canPlay:Zt.canPlay.soundcloud,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./SoundCloud-b4a66154.js").then(e=>e.S),["assets/SoundCloud-b4a66154.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"vimeo",name:"Vimeo",canPlay:Zt.canPlay.vimeo,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Vimeo-3f7678c7.js").then(e=>e.V),["assets/Vimeo-3f7678c7.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"facebook",name:"Facebook",canPlay:Zt.canPlay.facebook,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Facebook-8697f027.js").then(e=>e.F),["assets/Facebook-8697f027.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"streamable",name:"Streamable",canPlay:Zt.canPlay.streamable,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Streamable-82eee799.js").then(e=>e.S),["assets/Streamable-82eee799.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"wistia",name:"Wistia",canPlay:Zt.canPlay.wistia,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Wistia-f3f448ac.js").then(e=>e.W),["assets/Wistia-f3f448ac.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"twitch",name:"Twitch",canPlay:Zt.canPlay.twitch,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Twitch-3a6bc6a0.js").then(e=>e.T),["assets/Twitch-3a6bc6a0.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"dailymotion",name:"DailyMotion",canPlay:Zt.canPlay.dailymotion,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./DailyMotion-6b6860ce.js").then(e=>e.D),["assets/DailyMotion-6b6860ce.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"mixcloud",name:"Mixcloud",canPlay:Zt.canPlay.mixcloud,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Mixcloud-dcdddb72.js").then(e=>e.M),["assets/Mixcloud-dcdddb72.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"vidyard",name:"Vidyard",canPlay:Zt.canPlay.vidyard,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Vidyard-54f32f3a.js").then(e=>e.V),["assets/Vidyard-54f32f3a.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"kaltura",name:"Kaltura",canPlay:Zt.canPlay.kaltura,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Kaltura-452db45d.js").then(e=>e.K),["assets/Kaltura-452db45d.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))},{key:"file",name:"FilePlayer",canPlay:Zt.canPlay.file,canEnablePIP:e=>Zt.canPlay.file(e)&&(document.pictureInPictureEnabled||(0,ar.supportsWebKitPresentationMode)())&&!Zt.AUDIO_EXTENSIONS.test(e),lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./FilePlayer-a119adbc.js").then(e=>e.F),["assets/FilePlayer-a119adbc.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"]))}],FO=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function _se(e,t){return!!(e===t||FO(e)&&FO(t))}function Tse(e,t){if(e.length!==t.length)return!1;for(var r=0;r{for(var r in t)ju(e,r,{get:t[r],enumerable:!0})},tN=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Mse(t))!$se.call(e,a)&&a!==r&&ju(e,a,{get:()=>t[a],enumerable:!(n=Lse(t,a))||n.enumerable});return e},Fse=(e,t,r)=>(r=e!=null?Dse(Pse(e)):{},tN(t||!e||!e.__esModule?ju(r,"default",{value:e,enumerable:!0}):r,e)),Bse=e=>tN(ju({},"__esModule",{value:!0}),e),rN={};jse(rN,{defaultProps:()=>zse,propTypes:()=>Gse});var nN=Bse(rN),Use=Fse(PM);const{string:qt,bool:Ht,number:Ea,array:Hh,oneOfType:Ii,shape:gr,object:Wt,func:vt,node:BO}=Use.default,Gse={url:Ii([qt,Hh,Wt]),playing:Ht,loop:Ht,controls:Ht,volume:Ea,muted:Ht,playbackRate:Ea,width:Ii([qt,Ea]),height:Ii([qt,Ea]),style:Wt,progressInterval:Ea,playsinline:Ht,pip:Ht,stopOnUnmount:Ht,light:Ii([Ht,qt,Wt]),playIcon:BO,previewTabIndex:Ea,fallback:BO,oEmbedUrl:qt,wrapper:Ii([qt,vt,gr({render:vt.isRequired})]),config:gr({soundcloud:gr({options:Wt}),youtube:gr({playerVars:Wt,embedOptions:Wt,onUnstarted:vt}),facebook:gr({appId:qt,version:qt,playerId:qt,attributes:Wt}),dailymotion:gr({params:Wt}),vimeo:gr({playerOptions:Wt,title:qt}),file:gr({attributes:Wt,tracks:Hh,forceVideo:Ht,forceAudio:Ht,forceHLS:Ht,forceSafariHLS:Ht,forceDisableHls:Ht,forceDASH:Ht,forceFLV:Ht,hlsOptions:Wt,hlsVersion:qt,dashVersion:qt,flvVersion:qt}),wistia:gr({options:Wt,playerId:qt,customControls:Hh}),mixcloud:gr({options:Wt}),twitch:gr({options:Wt,playerId:qt}),vidyard:gr({options:Wt})}),onReady:vt,onStart:vt,onPlay:vt,onPause:vt,onBuffer:vt,onBufferEnd:vt,onEnded:vt,onError:vt,onDuration:vt,onSeek:vt,onPlaybackRateChange:vt,onPlaybackQualityChange:vt,onProgress:vt,onClickPreview:vt,onEnablePIP:vt,onDisablePIP:vt},Rt=()=>{},zse={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:Rt},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:Rt,onStart:Rt,onPlay:Rt,onPause:Rt,onBuffer:Rt,onBufferEnd:Rt,onEnded:Rt,onError:Rt,onDuration:Rt,onSeek:Rt,onPlaybackRateChange:Rt,onPlaybackQualityChange:Rt,onProgress:Rt,onClickPreview:Rt,onEnablePIP:Rt,onDisablePIP:Rt};var qse=Object.create,Jo=Object.defineProperty,Hse=Object.getOwnPropertyDescriptor,Wse=Object.getOwnPropertyNames,Vse=Object.getPrototypeOf,Yse=Object.prototype.hasOwnProperty,Kse=(e,t,r)=>t in e?Jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xse=(e,t)=>{for(var r in t)Jo(e,r,{get:t[r],enumerable:!0})},aN=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Wse(t))!Yse.call(e,a)&&a!==r&&Jo(e,a,{get:()=>t[a],enumerable:!(n=Hse(t,a))||n.enumerable});return e},iN=(e,t,r)=>(r=e!=null?qse(Vse(e)):{},aN(t||!e||!e.__esModule?Jo(r,"default",{value:e,enumerable:!0}):r,e)),Zse=e=>aN(Jo({},"__esModule",{value:!0}),e),ht=(e,t,r)=>(Kse(e,typeof t!="symbol"?t+"":t,r),r),oN={};Xse(oN,{default:()=>Fu});var Jse=Zse(oN),UO=iN(P),Qse=iN(eN),sN=nN,ele=$u;const tle=5e3;class Fu extends UO.Component{constructor(){super(...arguments),ht(this,"mounted",!1),ht(this,"isReady",!1),ht(this,"isPlaying",!1),ht(this,"isLoading",!0),ht(this,"loadOnReady",null),ht(this,"startOnPlay",!0),ht(this,"seekOnPlay",null),ht(this,"onDurationCalled",!1),ht(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),ht(this,"getInternalPlayer",t=>this.player?this.player[t]:null),ht(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,r=this.getSecondsLoaded(),n=this.getDuration();if(n){const a={playedSeconds:t,played:t/n};r!==null&&(a.loadedSeconds=r,a.loaded=r/n),(a.playedSeconds!==this.prevPlayed||a.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(a),this.prevPlayed=a.playedSeconds,this.prevLoaded=a.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),ht(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:r,volume:n,muted:a}=this.props;t(),!a&&n!==null&&this.player.setVolume(n),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):r&&this.player.play(),this.handleDurationCheck()}),ht(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:r,playbackRate:n}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&n!==1&&this.player.setPlaybackRate(n),t(),this.startOnPlay=!1),r(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),ht(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),ht(this,"handleEnded",()=>{const{activePlayer:t,loop:r,onEnded:n}=this.props;t.loopOnEnded&&r&&this.seekTo(0),r||(this.isPlaying=!1,n())}),ht(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),ht(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)}),ht(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:r,playing:n,volume:a,muted:i,playbackRate:o,pip:s,loop:l,activePlayer:c,disableDeferredLoading:d}=this.props;if(!(0,Qse.default)(t.url,r)){if(this.isLoading&&!c.forceLoad&&!d&&!(0,ele.isMediaStream)(r)){console.warn(`ReactPlayer: the attempt to load ${r} is being deferred until the player has loaded`),this.loadOnReady=r;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(r,this.isReady)}!t.playing&&n&&!this.isPlaying&&this.player.play(),t.playing&&!n&&this.isPlaying&&this.player.pause(),!t.pip&&s&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!s&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==a&&a!==null&&this.player.setVolume(a),t.muted!==i&&(i?this.player.mute():(this.player.unmute(),a!==null&&setTimeout(()=>this.player.setVolume(a)))),t.playbackRate!==o&&this.player.setPlaybackRate&&this.player.setPlaybackRate(o),t.loop!==l&&this.player.setLoop&&this.player.setLoop(l)}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,r,n){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},tle));return}if(r?r==="fraction":t>0&&t<1){const i=this.player.getDuration();if(!i){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(i*t,n);return}this.player.seekTo(t,n)}render(){const t=this.props.activePlayer;return t?UO.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}}ht(Fu,"displayName","Player");ht(Fu,"propTypes",sN.propTypes);ht(Fu,"defaultProps",sN.defaultProps);var rle=Object.create,Qo=Object.defineProperty,nle=Object.getOwnPropertyDescriptor,ale=Object.getOwnPropertyNames,ile=Object.getPrototypeOf,ole=Object.prototype.hasOwnProperty,sle=(e,t,r)=>t in e?Qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lle=(e,t)=>{for(var r in t)Qo(e,r,{get:t[r],enumerable:!0})},lN=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ale(t))!ole.call(e,a)&&a!==r&&Qo(e,a,{get:()=>t[a],enumerable:!(n=nle(t,a))||n.enumerable});return e},es=(e,t,r)=>(r=e!=null?rle(ile(e)):{},lN(t||!e||!e.__esModule?Qo(r,"default",{value:e,enumerable:!0}):r,e)),ule=e=>lN(Qo({},"__esModule",{value:!0}),e),gt=(e,t,r)=>(sle(e,typeof t!="symbol"?t+"":t,r),r),uN={};lle(uN,{createReactPlayer:()=>yle});var cle=ule(uN),_a=es(P),dle=es(LI),Wh=es(kse),GO=es(eN),$i=nN,cN=$u,ple=es(Jse);const fle=(0,cN.lazy)(()=>ir(()=>import("./Preview-bd12f694.js").then(e=>e.P),["assets/Preview-bd12f694.js","assets/index-16ff4e55.js","assets/index-b4d03b7b.css"])),gle=typeof window<"u"&&window.document,hle=typeof Tt<"u"&&Tt.window&&Tt.window.document,mle=Object.keys($i.propTypes),ble=gle||hle?_a.Suspense:()=>null,Ni=[],yle=(e,t)=>{var r;return r=class extends _a.Component{constructor(){super(...arguments),gt(this,"state",{showPreview:!!this.props.light}),gt(this,"references",{wrapper:n=>{this.wrapper=n},player:n=>{this.player=n}}),gt(this,"handleClickPreview",n=>{this.setState({showPreview:!1}),this.props.onClickPreview(n)}),gt(this,"showPreview",()=>{this.setState({showPreview:!0})}),gt(this,"getDuration",()=>this.player?this.player.getDuration():null),gt(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),gt(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),gt(this,"getInternalPlayer",(n="player")=>this.player?this.player.getInternalPlayer(n):null),gt(this,"seekTo",(n,a,i)=>{if(!this.player)return null;this.player.seekTo(n,a,i)}),gt(this,"handleReady",()=>{this.props.onReady(this)}),gt(this,"getActivePlayer",(0,Wh.default)(n=>{for(const a of[...Ni,...e])if(a.canPlay(n))return a;return t||null})),gt(this,"getConfig",(0,Wh.default)((n,a)=>{const{config:i}=this.props;return dle.default.all([$i.defaultProps.config,$i.defaultProps.config[a]||{},i,i[a]||{}])})),gt(this,"getAttributes",(0,Wh.default)(n=>(0,cN.omit)(this.props,mle))),gt(this,"renderActivePlayer",n=>{if(!n)return null;const a=this.getActivePlayer(n);if(!a)return null;const i=this.getConfig(n,a.key);return _a.default.createElement(ple.default,{...this.props,key:a.key,ref:this.references.player,config:i,activePlayer:a.lazyPlayer||a,onReady:this.handleReady})})}shouldComponentUpdate(n,a){return!(0,GO.default)(this.props,n)||!(0,GO.default)(this.state,a)}componentDidUpdate(n){const{light:a}=this.props;!n.light&&a&&this.setState({showPreview:!0}),n.light&&!a&&this.setState({showPreview:!1})}renderPreview(n){if(!n)return null;const{light:a,playIcon:i,previewTabIndex:o,oEmbedUrl:s}=this.props;return _a.default.createElement(fle,{url:n,light:a,playIcon:i,previewTabIndex:o,oEmbedUrl:s,onClick:this.handleClickPreview})}render(){const{url:n,style:a,width:i,height:o,fallback:s,wrapper:l}=this.props,{showPreview:c}=this.state,d=this.getAttributes(n),p=typeof l=="string"?this.references.wrapper:void 0;return _a.default.createElement(l,{ref:p,style:{...a,width:i,height:o},...d},_a.default.createElement(ble,{fallback:s},c?this.renderPreview(n):this.renderActivePlayer(n)))}},gt(r,"displayName","ReactPlayer"),gt(r,"propTypes",$i.propTypes),gt(r,"defaultProps",$i.defaultProps),gt(r,"addCustomPlayer",n=>{Ni.push(n)}),gt(r,"removeCustomPlayers",()=>{Ni.length=0}),gt(r,"canPlay",n=>{for(const a of[...Ni,...e])if(a.canPlay(n))return!0;return!1}),gt(r,"canEnablePIP",n=>{for(const a of[...Ni,...e])if(a.canEnablePIP&&a.canEnablePIP(n))return!0;return!1}),r};var vle=Object.create,Bu=Object.defineProperty,Sle=Object.getOwnPropertyDescriptor,Ele=Object.getOwnPropertyNames,xle=Object.getPrototypeOf,wle=Object.prototype.hasOwnProperty,_le=(e,t)=>{for(var r in t)Bu(e,r,{get:t[r],enumerable:!0})},dN=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ele(t))!wle.call(e,a)&&a!==r&&Bu(e,a,{get:()=>t[a],enumerable:!(n=Sle(t,a))||n.enumerable});return e},Tle=(e,t,r)=>(r=e!=null?vle(xle(e)):{},dN(t||!e||!e.__esModule?Bu(r,"default",{value:e,enumerable:!0}):r,e)),Ale=e=>dN(Bu({},"__esModule",{value:!0}),e),pN={};_le(pN,{default:()=>Ile});var Ole=Ale(pN),db=Tle(xse),kle=cle;const Rle=db.default[db.default.length-1];var Ile=(0,kle.createReactPlayer)(db.default,Rle);const Nle=pt(Ole),zO=e=>{const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60),a=t>0?`${t}:`:"",i=t>0?r.toString().padStart(2,"0"):r.toString(),o=n.toString().padStart(2,"0");return`${a}${i}:${o}`},Cle=({isPlaying:e,isFullScreen:t,setIsPlaying:r,playingTime:n,duration:a,handleProgressChange:i,handleVolumeChange:o,onFullScreenClick:s,showToolbar:l})=>{const[c,d]=P.useState(.5),[p,g]=P.useState(!1),[m,b]=P.useState(.5),v=(O,_)=>{const w=Array.isArray(_)?_[0]:_;d(w),o(O,w),p&&g(!1)},S=()=>{p?(d(m),o(new Event("input"),m)):(b(c),d(0),o(new Event("input"),0)),g(!p)};return h.jsxs(F,{children:[(!l||t)&&h.jsx(Fle,{"aria-label":"Small","data-testid":"progress-bar",isFullScreen:t,max:a,onChange:i,size:"small",value:n}),h.jsxs(Dle,{align:"center",direction:"row",showToolbar:l||t,children:[h.jsx(Ple,{onClick:r,size:"small",children:e?h.jsx(Sb,{}):h.jsx(Eb,{})}),h.jsxs(Ble,{direction:"row",children:[h.jsx("span",{children:zO(n)}),h.jsx("span",{className:"separator",children:"/"}),h.jsx("span",{className:"duration",children:zO(a)})]}),h.jsxs($le,{direction:"row",px:9,children:[h.jsx(Wl,{className:"volume-slider",max:1,min:0,onChange:v,size:"small",step:.1,value:c}),h.jsx(Lle,{onClick:S,children:p?h.jsx(Mle,{children:h.jsx($M,{})}):h.jsx(jM,{})})]}),h.jsx(jle,{"data-testid":"fullscreen-button",onClick:s,children:t?h.jsx(BM,{}):h.jsx(FM,{})})]})]})},Dle=B(F)` +`,yoe=()=>{const e=Pt(),{setPlayingNode:t}=Po(r=>r);switch(P.useEffect(()=>{var n,a;if(!e)return;(e.media_url||e.link||((n=e.properties)==null?void 0:n.link)||((a=e.properties)==null?void 0:a.media_url))&&t(e)},[t,e]),e==null?void 0:e.node_type){case"guest":case"person":return h.jsx(s7,{});case"data_series":return h.jsx(oX,{});case"tribe_message":return h.jsx(n7,{});case"Tweet":return h.jsx(b7,{});case"topic":return h.jsx(m7,{});case"show":return h.jsx(h7,{});case"video":case"podcast":case"clip":case"twitter_space":return h.jsx(XR,{});case"document":return h.jsx(poe,{});case"episode":return h.jsx(JX,{},e.ref_id);case"image":return h.jsx(r7,{});default:return h.jsx(eoe,{})}},voe=P.memo(yoe);var Soe=function(t,r,n){var a=document.head||document.getElementsByTagName("head")[0],i=document.createElement("script");typeof r=="function"&&(n=r,r={}),r=r||{},n=n||function(){},i.type=r.type||"text/javascript",i.charset=r.charset||"utf8",i.async="async"in r?!!r.async:!0,i.src=t,r.attrs&&Eoe(i,r.attrs),r.text&&(i.text=""+r.text);var o="onload"in i?PO:xoe;o(i,n),i.onload||PO(i,n),a.appendChild(i)};function Eoe(e,t){for(var r in t)e.setAttribute(r,t[r])}function PO(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 xoe(e,t){e.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,t(null,e))}}var woe=function(t){return _oe(t)&&!Toe(t)};function _oe(e){return!!e&&typeof e=="object"}function Toe(e){var t=Object.prototype.toString.call(e);return t==="[object RegExp]"||t==="[object Date]"||koe(e)}var Aoe=typeof Symbol=="function"&&Symbol.for,Ooe=Aoe?Symbol.for("react.element"):60103;function koe(e){return e.$$typeof===Ooe}function Roe(e){return Array.isArray(e)?[]:{}}function Lo(e,t){return t.clone!==!1&&t.isMergeableObject(e)?Qa(Roe(e),e,t):e}function Ioe(e,t,r){return e.concat(t).map(function(n){return Lo(n,r)})}function Noe(e,t){if(!t.customMerge)return Qa;var r=t.customMerge(e);return typeof r=="function"?r:Qa}function Coe(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return Object.propertyIsEnumerable.call(e,t)}):[]}function $O(e){return Object.keys(e).concat(Coe(e))}function DI(e,t){try{return t in e}catch{return!1}}function Doe(e,t){return DI(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))}function Loe(e,t,r){var n={};return r.isMergeableObject(e)&&$O(e).forEach(function(a){n[a]=Lo(e[a],r)}),$O(t).forEach(function(a){Doe(e,a)||(DI(e,a)&&r.isMergeableObject(t[a])?n[a]=Noe(a,r)(e[a],t[a],r):n[a]=Lo(t[a],r))}),n}function Qa(e,t,r){r=r||{},r.arrayMerge=r.arrayMerge||Ioe,r.isMergeableObject=r.isMergeableObject||woe,r.cloneUnlessOtherwiseSpecified=Lo;var n=Array.isArray(t),a=Array.isArray(e),i=n===a;return i?n?r.arrayMerge(e,t,r):Loe(e,t,r):Lo(t,r)}Qa.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(n,a){return Qa(n,a,r)},{})};var Moe=Qa,LI=Moe,Poe=Object.create,Pu=Object.defineProperty,$oe=Object.getOwnPropertyDescriptor,joe=Object.getOwnPropertyNames,Foe=Object.getPrototypeOf,Boe=Object.prototype.hasOwnProperty,Uoe=(e,t)=>{for(var r in t)Pu(e,r,{get:t[r],enumerable:!0})},MI=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of joe(t))!Boe.call(e,a)&&a!==r&&Pu(e,a,{get:()=>t[a],enumerable:!(n=$oe(t,a))||n.enumerable});return e},Hy=(e,t,r)=>(r=e!=null?Poe(Foe(e)):{},MI(t||!e||!e.__esModule?Pu(r,"default",{value:e,enumerable:!0}):r,e)),Goe=e=>MI(Pu({},"__esModule",{value:!0}),e),PI={};Uoe(PI,{callPlayer:()=>ase,getConfig:()=>rse,getSDK:()=>tse,isBlobUrl:()=>ose,isMediaStream:()=>ise,lazy:()=>Woe,omit:()=>nse,parseEndTime:()=>Joe,parseStartTime:()=>Zoe,queryString:()=>ese,randomString:()=>Qoe,supportsWebKitPresentationMode:()=>sse});var $u=Goe(PI),zoe=Hy(P),qoe=Hy(Soe),Hoe=Hy(LI);const Woe=e=>zoe.default.lazy(async()=>{const t=await e();return typeof t.default=="function"?t:t.default}),Voe=/[?&#](?:start|t)=([0-9hms]+)/,Yoe=/[?&#]end=([0-9hms]+)/,lb=/(\d+)(h|m|s)/g,Koe=/^\d+$/;function $I(e,t){if(e instanceof Array)return;const r=e.match(t);if(r){const n=r[1];if(n.match(lb))return Xoe(n);if(Koe.test(n))return parseInt(n)}}function Xoe(e){let t=0,r=lb.exec(e);for(;r!==null;){const[,n,a]=r;a==="h"&&(t+=parseInt(n,10)*60*60),a==="m"&&(t+=parseInt(n,10)*60),a==="s"&&(t+=parseInt(n,10)),r=lb.exec(e)}return t}function Zoe(e){return $I(e,Voe)}function Joe(e){return $I(e,Yoe)}function Qoe(){return Math.random().toString(36).substr(2,5)}function ese(e){return Object.keys(e).map(t=>`${t}=${e[t]}`).join("&")}function qh(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 Sa={},tse=function(t,r,n=null,a=()=>!0,i=qoe.default){const o=qh(r);return o&&a(o)?Promise.resolve(o):new Promise((s,l)=>{if(Sa[t]){Sa[t].push({resolve:s,reject:l});return}Sa[t]=[{resolve:s,reject:l}];const c=d=>{Sa[t].forEach(p=>p.resolve(d))};if(n){const d=window[n];window[n]=function(){d&&d(),c(qh(r))}}i(t,d=>{d?(Sa[t].forEach(p=>p.reject(d)),Sa[t]=null):n||c(qh(r))})})};function rse(e,t){return(0,Hoe.default)(t.config,e.config)}function nse(e,...t){const r=[].concat(...t),n={},a=Object.keys(e);for(const i of a)r.indexOf(i)===-1&&(n[i]=e[i]);return n}function ase(e,...t){if(!this.player||!this.player[e]){let r=`ReactPlayer: ${this.constructor.displayName} player could not call %c${e}%c – `;return this.player?this.player[e]||(r+="The method was not available"):r+="The player was not available",console.warn(r,"font-weight: bold",""),null}return this.player[e](...t)}function ise(e){return typeof window<"u"&&typeof window.MediaStream<"u"&&e instanceof window.MediaStream}function ose(e){return/^blob:/.test(e)}function sse(e=document.createElement("video")){const t=/iPhone|iPod/.test(navigator.userAgent)===!1;return e.webkitSupportsPresentationMode&&typeof e.webkitSetPresentationMode=="function"&&t}var Wy=Object.defineProperty,lse=Object.getOwnPropertyDescriptor,use=Object.getOwnPropertyNames,cse=Object.prototype.hasOwnProperty,dse=(e,t)=>{for(var r in t)Wy(e,r,{get:t[r],enumerable:!0})},pse=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of use(t))!cse.call(e,a)&&a!==r&&Wy(e,a,{get:()=>t[a],enumerable:!(n=lse(t,a))||n.enumerable});return e},fse=e=>pse(Wy({},"__esModule",{value:!0}),e),jI={};dse(jI,{AUDIO_EXTENSIONS:()=>Vy,DASH_EXTENSIONS:()=>ZI,FLV_EXTENSIONS:()=>JI,HLS_EXTENSIONS:()=>Ky,MATCH_URL_DAILYMOTION:()=>VI,MATCH_URL_FACEBOOK:()=>UI,MATCH_URL_FACEBOOK_WATCH:()=>GI,MATCH_URL_KALTURA:()=>XI,MATCH_URL_MIXCLOUD:()=>YI,MATCH_URL_SOUNDCLOUD:()=>FI,MATCH_URL_STREAMABLE:()=>zI,MATCH_URL_TWITCH_CHANNEL:()=>WI,MATCH_URL_TWITCH_VIDEO:()=>HI,MATCH_URL_VIDYARD:()=>KI,MATCH_URL_VIMEO:()=>BI,MATCH_URL_WISTIA:()=>qI,MATCH_URL_YOUTUBE:()=>ub,VIDEO_EXTENSIONS:()=>Yy,canPlay:()=>hse});var gse=fse(jI),jO=$u;const ub=/(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//,FI=/(?:soundcloud\.com|snd\.sc)\/[^.]+$/,BI=/vimeo\.com\/(?!progressive_redirect).+/,UI=/^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/,GI=/^https?:\/\/fb\.watch\/.+$/,zI=/streamable\.com\/([a-z0-9]+)$/,qI=/(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/,HI=/(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/,WI=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,VI=/^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/,YI=/mixcloud\.com\/([^/]+\/[^/]+)/,KI=/vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/,XI=/^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-_].*)$/,Vy=/\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i,Yy=/\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i,Ky=/\.(m3u8)($|\?)/i,ZI=/\.(mpd)($|\?)/i,JI=/\.(flv)($|\?)/i,cb=e=>{if(e instanceof Array){for(const t of e)if(typeof t=="string"&&cb(t)||cb(t.src))return!0;return!1}return(0,jO.isMediaStream)(e)||(0,jO.isBlobUrl)(e)?!0:Vy.test(e)||Yy.test(e)||Ky.test(e)||ZI.test(e)||JI.test(e)},hse={youtube:e=>e instanceof Array?e.every(t=>ub.test(t)):ub.test(e),soundcloud:e=>FI.test(e)&&!Vy.test(e),vimeo:e=>BI.test(e)&&!Yy.test(e)&&!Ky.test(e),facebook:e=>UI.test(e)||GI.test(e),streamable:e=>zI.test(e),wistia:e=>qI.test(e),twitch:e=>HI.test(e)||WI.test(e),dailymotion:e=>VI.test(e),mixcloud:e=>YI.test(e),vidyard:e=>KI.test(e),kaltura:e=>XI.test(e),file:cb};var Xy=Object.defineProperty,mse=Object.getOwnPropertyDescriptor,bse=Object.getOwnPropertyNames,yse=Object.prototype.hasOwnProperty,vse=(e,t)=>{for(var r in t)Xy(e,r,{get:t[r],enumerable:!0})},Sse=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of bse(t))!yse.call(e,a)&&a!==r&&Xy(e,a,{get:()=>t[a],enumerable:!(n=mse(t,a))||n.enumerable});return e},Ese=e=>Sse(Xy({},"__esModule",{value:!0}),e),QI={};vse(QI,{default:()=>wse});var xse=Ese(QI),ar=$u,Zt=gse,wse=[{key:"youtube",name:"YouTube",canPlay:Zt.canPlay.youtube,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./YouTube-b0617aa9.js").then(e=>e.Y),["assets/YouTube-b0617aa9.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"soundcloud",name:"SoundCloud",canPlay:Zt.canPlay.soundcloud,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./SoundCloud-df6d74b5.js").then(e=>e.S),["assets/SoundCloud-df6d74b5.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"vimeo",name:"Vimeo",canPlay:Zt.canPlay.vimeo,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Vimeo-8c7df33b.js").then(e=>e.V),["assets/Vimeo-8c7df33b.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"facebook",name:"Facebook",canPlay:Zt.canPlay.facebook,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Facebook-7bdcad75.js").then(e=>e.F),["assets/Facebook-7bdcad75.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"streamable",name:"Streamable",canPlay:Zt.canPlay.streamable,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Streamable-eda3098a.js").then(e=>e.S),["assets/Streamable-eda3098a.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"wistia",name:"Wistia",canPlay:Zt.canPlay.wistia,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Wistia-611ee7bc.js").then(e=>e.W),["assets/Wistia-611ee7bc.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"twitch",name:"Twitch",canPlay:Zt.canPlay.twitch,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Twitch-6b950ada.js").then(e=>e.T),["assets/Twitch-6b950ada.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"dailymotion",name:"DailyMotion",canPlay:Zt.canPlay.dailymotion,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./DailyMotion-376cd37a.js").then(e=>e.D),["assets/DailyMotion-376cd37a.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"mixcloud",name:"Mixcloud",canPlay:Zt.canPlay.mixcloud,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Mixcloud-ab7f960a.js").then(e=>e.M),["assets/Mixcloud-ab7f960a.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"vidyard",name:"Vidyard",canPlay:Zt.canPlay.vidyard,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Vidyard-e1e3a592.js").then(e=>e.V),["assets/Vidyard-e1e3a592.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"kaltura",name:"Kaltura",canPlay:Zt.canPlay.kaltura,lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./Kaltura-b5386189.js").then(e=>e.K),["assets/Kaltura-b5386189.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))},{key:"file",name:"FilePlayer",canPlay:Zt.canPlay.file,canEnablePIP:e=>Zt.canPlay.file(e)&&(document.pictureInPictureEnabled||(0,ar.supportsWebKitPresentationMode)())&&!Zt.AUDIO_EXTENSIONS.test(e),lazyPlayer:(0,ar.lazy)(()=>ir(()=>import("./FilePlayer-ed376b11.js").then(e=>e.F),["assets/FilePlayer-ed376b11.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"]))}],FO=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function _se(e,t){return!!(e===t||FO(e)&&FO(t))}function Tse(e,t){if(e.length!==t.length)return!1;for(var r=0;r{for(var r in t)ju(e,r,{get:t[r],enumerable:!0})},tN=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Mse(t))!$se.call(e,a)&&a!==r&&ju(e,a,{get:()=>t[a],enumerable:!(n=Lse(t,a))||n.enumerable});return e},Fse=(e,t,r)=>(r=e!=null?Dse(Pse(e)):{},tN(t||!e||!e.__esModule?ju(r,"default",{value:e,enumerable:!0}):r,e)),Bse=e=>tN(ju({},"__esModule",{value:!0}),e),rN={};jse(rN,{defaultProps:()=>zse,propTypes:()=>Gse});var nN=Bse(rN),Use=Fse(PM);const{string:qt,bool:Ht,number:Ea,array:Hh,oneOfType:Ii,shape:gr,object:Wt,func:vt,node:BO}=Use.default,Gse={url:Ii([qt,Hh,Wt]),playing:Ht,loop:Ht,controls:Ht,volume:Ea,muted:Ht,playbackRate:Ea,width:Ii([qt,Ea]),height:Ii([qt,Ea]),style:Wt,progressInterval:Ea,playsinline:Ht,pip:Ht,stopOnUnmount:Ht,light:Ii([Ht,qt,Wt]),playIcon:BO,previewTabIndex:Ea,fallback:BO,oEmbedUrl:qt,wrapper:Ii([qt,vt,gr({render:vt.isRequired})]),config:gr({soundcloud:gr({options:Wt}),youtube:gr({playerVars:Wt,embedOptions:Wt,onUnstarted:vt}),facebook:gr({appId:qt,version:qt,playerId:qt,attributes:Wt}),dailymotion:gr({params:Wt}),vimeo:gr({playerOptions:Wt,title:qt}),file:gr({attributes:Wt,tracks:Hh,forceVideo:Ht,forceAudio:Ht,forceHLS:Ht,forceSafariHLS:Ht,forceDisableHls:Ht,forceDASH:Ht,forceFLV:Ht,hlsOptions:Wt,hlsVersion:qt,dashVersion:qt,flvVersion:qt}),wistia:gr({options:Wt,playerId:qt,customControls:Hh}),mixcloud:gr({options:Wt}),twitch:gr({options:Wt,playerId:qt}),vidyard:gr({options:Wt})}),onReady:vt,onStart:vt,onPlay:vt,onPause:vt,onBuffer:vt,onBufferEnd:vt,onEnded:vt,onError:vt,onDuration:vt,onSeek:vt,onPlaybackRateChange:vt,onPlaybackQualityChange:vt,onProgress:vt,onClickPreview:vt,onEnablePIP:vt,onDisablePIP:vt},Rt=()=>{},zse={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:Rt},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:Rt,onStart:Rt,onPlay:Rt,onPause:Rt,onBuffer:Rt,onBufferEnd:Rt,onEnded:Rt,onError:Rt,onDuration:Rt,onSeek:Rt,onPlaybackRateChange:Rt,onPlaybackQualityChange:Rt,onProgress:Rt,onClickPreview:Rt,onEnablePIP:Rt,onDisablePIP:Rt};var qse=Object.create,Jo=Object.defineProperty,Hse=Object.getOwnPropertyDescriptor,Wse=Object.getOwnPropertyNames,Vse=Object.getPrototypeOf,Yse=Object.prototype.hasOwnProperty,Kse=(e,t,r)=>t in e?Jo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xse=(e,t)=>{for(var r in t)Jo(e,r,{get:t[r],enumerable:!0})},aN=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Wse(t))!Yse.call(e,a)&&a!==r&&Jo(e,a,{get:()=>t[a],enumerable:!(n=Hse(t,a))||n.enumerable});return e},iN=(e,t,r)=>(r=e!=null?qse(Vse(e)):{},aN(t||!e||!e.__esModule?Jo(r,"default",{value:e,enumerable:!0}):r,e)),Zse=e=>aN(Jo({},"__esModule",{value:!0}),e),ht=(e,t,r)=>(Kse(e,typeof t!="symbol"?t+"":t,r),r),oN={};Xse(oN,{default:()=>Fu});var Jse=Zse(oN),UO=iN(P),Qse=iN(eN),sN=nN,ele=$u;const tle=5e3;class Fu extends UO.Component{constructor(){super(...arguments),ht(this,"mounted",!1),ht(this,"isReady",!1),ht(this,"isPlaying",!1),ht(this,"isLoading",!0),ht(this,"loadOnReady",null),ht(this,"startOnPlay",!0),ht(this,"seekOnPlay",null),ht(this,"onDurationCalled",!1),ht(this,"handlePlayerMount",t=>{if(this.player){this.progress();return}this.player=t,this.player.load(this.props.url),this.progress()}),ht(this,"getInternalPlayer",t=>this.player?this.player[t]:null),ht(this,"progress",()=>{if(this.props.url&&this.player&&this.isReady){const t=this.getCurrentTime()||0,r=this.getSecondsLoaded(),n=this.getDuration();if(n){const a={playedSeconds:t,played:t/n};r!==null&&(a.loadedSeconds=r,a.loaded=r/n),(a.playedSeconds!==this.prevPlayed||a.loadedSeconds!==this.prevLoaded)&&this.props.onProgress(a),this.prevPlayed=a.playedSeconds,this.prevLoaded=a.loadedSeconds}}this.progressTimeout=setTimeout(this.progress,this.props.progressFrequency||this.props.progressInterval)}),ht(this,"handleReady",()=>{if(!this.mounted)return;this.isReady=!0,this.isLoading=!1;const{onReady:t,playing:r,volume:n,muted:a}=this.props;t(),!a&&n!==null&&this.player.setVolume(n),this.loadOnReady?(this.player.load(this.loadOnReady,!0),this.loadOnReady=null):r&&this.player.play(),this.handleDurationCheck()}),ht(this,"handlePlay",()=>{this.isPlaying=!0,this.isLoading=!1;const{onStart:t,onPlay:r,playbackRate:n}=this.props;this.startOnPlay&&(this.player.setPlaybackRate&&n!==1&&this.player.setPlaybackRate(n),t(),this.startOnPlay=!1),r(),this.seekOnPlay&&(this.seekTo(this.seekOnPlay),this.seekOnPlay=null),this.handleDurationCheck()}),ht(this,"handlePause",t=>{this.isPlaying=!1,this.isLoading||this.props.onPause(t)}),ht(this,"handleEnded",()=>{const{activePlayer:t,loop:r,onEnded:n}=this.props;t.loopOnEnded&&r&&this.seekTo(0),r||(this.isPlaying=!1,n())}),ht(this,"handleError",(...t)=>{this.isLoading=!1,this.props.onError(...t)}),ht(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)}),ht(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:r,playing:n,volume:a,muted:i,playbackRate:o,pip:s,loop:l,activePlayer:c,disableDeferredLoading:d}=this.props;if(!(0,Qse.default)(t.url,r)){if(this.isLoading&&!c.forceLoad&&!d&&!(0,ele.isMediaStream)(r)){console.warn(`ReactPlayer: the attempt to load ${r} is being deferred until the player has loaded`),this.loadOnReady=r;return}this.isLoading=!0,this.startOnPlay=!0,this.onDurationCalled=!1,this.player.load(r,this.isReady)}!t.playing&&n&&!this.isPlaying&&this.player.play(),t.playing&&!n&&this.isPlaying&&this.player.pause(),!t.pip&&s&&this.player.enablePIP&&this.player.enablePIP(),t.pip&&!s&&this.player.disablePIP&&this.player.disablePIP(),t.volume!==a&&a!==null&&this.player.setVolume(a),t.muted!==i&&(i?this.player.mute():(this.player.unmute(),a!==null&&setTimeout(()=>this.player.setVolume(a)))),t.playbackRate!==o&&this.player.setPlaybackRate&&this.player.setPlaybackRate(o),t.loop!==l&&this.player.setLoop&&this.player.setLoop(l)}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,r,n){if(!this.isReady){t!==0&&(this.seekOnPlay=t,setTimeout(()=>{this.seekOnPlay=null},tle));return}if(r?r==="fraction":t>0&&t<1){const i=this.player.getDuration();if(!i){console.warn("ReactPlayer: could not seek using fraction – duration not yet available");return}this.player.seekTo(i*t,n);return}this.player.seekTo(t,n)}render(){const t=this.props.activePlayer;return t?UO.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}}ht(Fu,"displayName","Player");ht(Fu,"propTypes",sN.propTypes);ht(Fu,"defaultProps",sN.defaultProps);var rle=Object.create,Qo=Object.defineProperty,nle=Object.getOwnPropertyDescriptor,ale=Object.getOwnPropertyNames,ile=Object.getPrototypeOf,ole=Object.prototype.hasOwnProperty,sle=(e,t,r)=>t in e?Qo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lle=(e,t)=>{for(var r in t)Qo(e,r,{get:t[r],enumerable:!0})},lN=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of ale(t))!ole.call(e,a)&&a!==r&&Qo(e,a,{get:()=>t[a],enumerable:!(n=nle(t,a))||n.enumerable});return e},es=(e,t,r)=>(r=e!=null?rle(ile(e)):{},lN(t||!e||!e.__esModule?Qo(r,"default",{value:e,enumerable:!0}):r,e)),ule=e=>lN(Qo({},"__esModule",{value:!0}),e),gt=(e,t,r)=>(sle(e,typeof t!="symbol"?t+"":t,r),r),uN={};lle(uN,{createReactPlayer:()=>yle});var cle=ule(uN),_a=es(P),dle=es(LI),Wh=es(kse),GO=es(eN),$i=nN,cN=$u,ple=es(Jse);const fle=(0,cN.lazy)(()=>ir(()=>import("./Preview-8a240280.js").then(e=>e.P),["assets/Preview-8a240280.js","assets/index-4c5f8236.js","assets/index-b4d03b7b.css"])),gle=typeof window<"u"&&window.document,hle=typeof Tt<"u"&&Tt.window&&Tt.window.document,mle=Object.keys($i.propTypes),ble=gle||hle?_a.Suspense:()=>null,Ni=[],yle=(e,t)=>{var r;return r=class extends _a.Component{constructor(){super(...arguments),gt(this,"state",{showPreview:!!this.props.light}),gt(this,"references",{wrapper:n=>{this.wrapper=n},player:n=>{this.player=n}}),gt(this,"handleClickPreview",n=>{this.setState({showPreview:!1}),this.props.onClickPreview(n)}),gt(this,"showPreview",()=>{this.setState({showPreview:!0})}),gt(this,"getDuration",()=>this.player?this.player.getDuration():null),gt(this,"getCurrentTime",()=>this.player?this.player.getCurrentTime():null),gt(this,"getSecondsLoaded",()=>this.player?this.player.getSecondsLoaded():null),gt(this,"getInternalPlayer",(n="player")=>this.player?this.player.getInternalPlayer(n):null),gt(this,"seekTo",(n,a,i)=>{if(!this.player)return null;this.player.seekTo(n,a,i)}),gt(this,"handleReady",()=>{this.props.onReady(this)}),gt(this,"getActivePlayer",(0,Wh.default)(n=>{for(const a of[...Ni,...e])if(a.canPlay(n))return a;return t||null})),gt(this,"getConfig",(0,Wh.default)((n,a)=>{const{config:i}=this.props;return dle.default.all([$i.defaultProps.config,$i.defaultProps.config[a]||{},i,i[a]||{}])})),gt(this,"getAttributes",(0,Wh.default)(n=>(0,cN.omit)(this.props,mle))),gt(this,"renderActivePlayer",n=>{if(!n)return null;const a=this.getActivePlayer(n);if(!a)return null;const i=this.getConfig(n,a.key);return _a.default.createElement(ple.default,{...this.props,key:a.key,ref:this.references.player,config:i,activePlayer:a.lazyPlayer||a,onReady:this.handleReady})})}shouldComponentUpdate(n,a){return!(0,GO.default)(this.props,n)||!(0,GO.default)(this.state,a)}componentDidUpdate(n){const{light:a}=this.props;!n.light&&a&&this.setState({showPreview:!0}),n.light&&!a&&this.setState({showPreview:!1})}renderPreview(n){if(!n)return null;const{light:a,playIcon:i,previewTabIndex:o,oEmbedUrl:s}=this.props;return _a.default.createElement(fle,{url:n,light:a,playIcon:i,previewTabIndex:o,oEmbedUrl:s,onClick:this.handleClickPreview})}render(){const{url:n,style:a,width:i,height:o,fallback:s,wrapper:l}=this.props,{showPreview:c}=this.state,d=this.getAttributes(n),p=typeof l=="string"?this.references.wrapper:void 0;return _a.default.createElement(l,{ref:p,style:{...a,width:i,height:o},...d},_a.default.createElement(ble,{fallback:s},c?this.renderPreview(n):this.renderActivePlayer(n)))}},gt(r,"displayName","ReactPlayer"),gt(r,"propTypes",$i.propTypes),gt(r,"defaultProps",$i.defaultProps),gt(r,"addCustomPlayer",n=>{Ni.push(n)}),gt(r,"removeCustomPlayers",()=>{Ni.length=0}),gt(r,"canPlay",n=>{for(const a of[...Ni,...e])if(a.canPlay(n))return!0;return!1}),gt(r,"canEnablePIP",n=>{for(const a of[...Ni,...e])if(a.canEnablePIP&&a.canEnablePIP(n))return!0;return!1}),r};var vle=Object.create,Bu=Object.defineProperty,Sle=Object.getOwnPropertyDescriptor,Ele=Object.getOwnPropertyNames,xle=Object.getPrototypeOf,wle=Object.prototype.hasOwnProperty,_le=(e,t)=>{for(var r in t)Bu(e,r,{get:t[r],enumerable:!0})},dN=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of Ele(t))!wle.call(e,a)&&a!==r&&Bu(e,a,{get:()=>t[a],enumerable:!(n=Sle(t,a))||n.enumerable});return e},Tle=(e,t,r)=>(r=e!=null?vle(xle(e)):{},dN(t||!e||!e.__esModule?Bu(r,"default",{value:e,enumerable:!0}):r,e)),Ale=e=>dN(Bu({},"__esModule",{value:!0}),e),pN={};_le(pN,{default:()=>Ile});var Ole=Ale(pN),db=Tle(xse),kle=cle;const Rle=db.default[db.default.length-1];var Ile=(0,kle.createReactPlayer)(db.default,Rle);const Nle=pt(Ole),zO=e=>{const t=Math.floor(e/3600),r=Math.floor(e%3600/60),n=Math.floor(e%60),a=t>0?`${t}:`:"",i=t>0?r.toString().padStart(2,"0"):r.toString(),o=n.toString().padStart(2,"0");return`${a}${i}:${o}`},Cle=({isPlaying:e,isFullScreen:t,setIsPlaying:r,playingTime:n,duration:a,handleProgressChange:i,handleVolumeChange:o,onFullScreenClick:s,showToolbar:l})=>{const[c,d]=P.useState(.5),[p,g]=P.useState(!1),[m,b]=P.useState(.5),v=(O,_)=>{const w=Array.isArray(_)?_[0]:_;d(w),o(O,w),p&&g(!1)},S=()=>{p?(d(m),o(new Event("input"),m)):(b(c),d(0),o(new Event("input"),0)),g(!p)};return h.jsxs(F,{children:[(!l||t)&&h.jsx(Fle,{"aria-label":"Small","data-testid":"progress-bar",isFullScreen:t,max:a,onChange:i,size:"small",value:n}),h.jsxs(Dle,{align:"center",direction:"row",showToolbar:l||t,children:[h.jsx(Ple,{onClick:r,size:"small",children:e?h.jsx(Sb,{}):h.jsx(Eb,{})}),h.jsxs(Ble,{direction:"row",children:[h.jsx("span",{children:zO(n)}),h.jsx("span",{className:"separator",children:"/"}),h.jsx("span",{className:"duration",children:zO(a)})]}),h.jsxs($le,{direction:"row",px:9,children:[h.jsx(Wl,{className:"volume-slider",max:1,min:0,onChange:v,size:"small",step:.1,value:c}),h.jsx(Lle,{onClick:S,children:p?h.jsx(Mle,{children:h.jsx($M,{})}):h.jsx(jM,{})})]}),h.jsx(jle,{"data-testid":"fullscreen-button",onClick:s,children:t?h.jsx(BM,{}):h.jsx(FM,{})})]})]})},Dle=B(F)` height: 60px; padding: 12px 16px; ${e=>e.showToolbar&&` diff --git a/build/assets/index-ef0f2344.js b/build/assets/index-bd8ab9bc.js similarity index 90% rename from build/assets/index-ef0f2344.js rename to build/assets/index-bd8ab9bc.js index f17a42531..a1a7fd180 100644 --- a/build/assets/index-ef0f2344.js +++ b/build/assets/index-bd8ab9bc.js @@ -1,4 +1,4 @@ -import{aY as j,aZ as E,a_ as b,a$ as R,b0 as A,b1 as U,b2 as D,b3 as O,w as x,x as u,E as Z,r as f,j as e,F as r,z as C,aW as J,H as z,b4 as K,aU as X,aV as Q,M as ee,v as te,a1 as se,aS as ne,aT as m,aX as oe,a3 as re,b5 as ae,ad as ie,b6 as ce,b7 as le,ac as de,a4 as ue,b8 as xe}from"./index-16ff4e55.js";import{aC as pe,ab as he}from"./index-04a82be1.js";import{C as fe}from"./ClipLoader-049391dc.js";const B=/\b(?:twitter\.com|x\.com)\/(?:@)?([\w_]+)(?:$|\?[^/]*$)/,we=/(https?:\/\/)?(www\.)?youtube\.com\/watch\?v=([A-Za-z0-9_-]+)/,ge=/(https?:\/\/)?(www\.)?youtube\.com\/live\/([A-Za-z0-9_-]+)/,me=/(https?:\/\/)?(www\.)?youtu\.be\/([A-Za-z0-9_-]+)/,ye=/https:\/\/twitter\.com\/i\/spaces\/([A-Za-z0-9_-]+)/,be=/https:\/\/(twitter\.com|x\.com)\/[^/]+\/status\/(\d+)/,je=/(https?:\/\/)?([A-Za-z0-9_-]+)\.mp3/,Se=/(https?:\/\/)?(.*\.)?.+\/(feed|rss|rss.xml|.*.rss|.*\?(feed|format)=rss)$/,ve=/https?:\/\/(www\.)?youtube\.com\/(user\/)?(@)?([\w-]+)/,_e=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/,Ee=/https:\/\/twitter\.com\/i\/broadcasts\/([A-Za-z0-9_-]+)/,Re=/https:\/\/github\.com\/[\w-]+\/[\w-]+/;async function Ce(t){try{const n=(await fetch(t,{method:"HEAD"})).headers.get("Content-Type");return(n==null?void 0:n.includes("application/rss+xml"))??!1}catch{return!1}}async function ze(t){return[ge,Ee,we,me,ye,je].some(n=>n.test(t))?A:ve.test(t)?E:B.test(t)?j:be.test(t)?U:Se.test(t)?b:Re.test(t)?R:_e.test(t)?await Ce(t)?b:D:O}const $e=(t,s="")=>{const o=(s===j?B:/@(\w+)/).exec(t);return o?o[1]:null},_=t=>!!t&&[j,E,b,R].includes(t),Te=({onClick:t,loading:s,type:n,error:o})=>{const y=Z(i=>i.budget),[a,p]=f.useState(10),d=_(n)?"radar":"add_node";return f.useEffect(()=>{(async()=>{try{const c=await K(d);p(c.data.price)}catch(c){console.error("cannot fetch",c)}})()},[d]),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(ke,{children:"Approve Cost"})})}),e.jsxs(r,{align:"center",direction:"row",justify:"space-between",mb:20,children:[e.jsxs(Ae,{children:[e.jsx("div",{className:"title",children:"COST"}),e.jsxs("div",{className:"value","data-testid":"check-price",children:[a," sats"]})]}),e.jsxs(Be,{children:[e.jsx("div",{className:"title",children:"BUDGET"}),e.jsxs("div",{className:"value",children:[pe(y)," sats"]})]})]}),e.jsx(r,{children:e.jsx(C,{color:"secondary","data-testid":"check-icon",disabled:s||!!o,onClick:t,size:"large",startIcon:s?e.jsx(L,{children:e.jsx(fe,{color:u.lightGray,size:12})}):e.jsxs(L,{children:[" ",e.jsx(he,{})]}),type:"submit",variant:"contained",children:"Approve"})}),o?e.jsx(Pe,{children:e.jsxs(Ne,{children:[e.jsx(J,{className:"errorIcon"}),e.jsx("span",{children:o})]})}):null]})},Ae=x(r).attrs({direction:"column",align:"space-between",justify:"flex-start"})` +import{aY as j,aZ as E,a_ as b,a$ as R,b0 as T,b1 as U,b2 as D,b3 as O,w as x,x as u,E as Z,r as f,j as e,F as r,z as C,aW as J,H as z,b4 as K,aU as X,aV as Q,M as ee,v as te,a1 as se,aS as ne,aT as m,aX as oe,a3 as re,b5 as ae,ad as ie,b6 as ce,b7 as le,ac as de,a4 as ue,b8 as xe}from"./index-4c5f8236.js";import{aA as pe,a9 as he}from"./index-a4caf8d5.js";import{C as fe}from"./ClipLoader-601f6378.js";const B=/\b(?:twitter\.com|x\.com)\/(?:@)?([\w_]+)(?:$|\?[^/]*$)/,we=/(https?:\/\/)?(www\.)?youtube\.com\/watch\?v=([A-Za-z0-9_-]+)/,ge=/(https?:\/\/)?(www\.)?youtube\.com\/live\/([A-Za-z0-9_-]+)/,me=/(https?:\/\/)?(www\.)?youtu\.be\/([A-Za-z0-9_-]+)/,ye=/https:\/\/twitter\.com\/i\/spaces\/([A-Za-z0-9_-]+)/,be=/https:\/\/(twitter\.com|x\.com)\/[^/]+\/status\/(\d+)/,je=/(https?:\/\/)?([A-Za-z0-9_-]+)\.mp3/,Se=/(https?:\/\/)?(.*\.)?.+\/(feed|rss|rss.xml|.*.rss|.*\?(feed|format)=rss)$/,ve=/https?:\/\/(www\.)?youtube\.com\/(user\/)?(@)?([\w-]+)/,_e=/^(https?|ftp):\/\/[^\s/$.?#].[^\s]*$/,Ee=/https:\/\/twitter\.com\/i\/broadcasts\/([A-Za-z0-9_-]+)/,Re=/https:\/\/github\.com\/[\w-]+\/[\w-]+/;async function Ce(t){try{const n=(await fetch(t,{method:"HEAD"})).headers.get("Content-Type");return(n==null?void 0:n.includes("application/rss+xml"))??!1}catch{return!1}}async function ze(t){return[ge,Ee,we,me,ye,je].some(n=>n.test(t))?T:ve.test(t)?E:B.test(t)?j:be.test(t)?U:Se.test(t)?b:Re.test(t)?R:_e.test(t)?await Ce(t)?b:D:O}const $e=(t,s="")=>{const o=(s===j?B:/@(\w+)/).exec(t);return o?o[1]:null},_=t=>!!t&&[j,E,b,R].includes(t),Ae=({onClick:t,loading:s,type:n,error:o})=>{const y=Z(i=>i.budget),[a,p]=f.useState(10),d=_(n)?"radar":"add_node";return f.useEffect(()=>{(async()=>{try{const c=await K(d);p(c.data.price)}catch(c){console.error("cannot fetch",c)}})()},[d]),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(ke,{children:"Approve Cost"})})}),e.jsxs(r,{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:[a," sats"]})]}),e.jsxs(Be,{children:[e.jsx("div",{className:"title",children:"BUDGET"}),e.jsxs("div",{className:"value",children:[pe(y)," sats"]})]})]}),e.jsx(r,{children:e.jsx(C,{color:"secondary","data-testid":"check-icon",disabled:s||!!o,onClick:t,size:"large",startIcon:s?e.jsx(L,{children:e.jsx(fe,{color:u.lightGray,size:12})}):e.jsxs(L,{children:[" ",e.jsx(he,{})]}),type:"submit",variant:"contained",children:"Approve"})}),o?e.jsx(Pe,{children:e.jsxs(Ne,{children:[e.jsx(J,{className:"errorIcon"}),e.jsx("span",{children:o})]})}):null]})},Te=x(r).attrs({direction:"column",align:"space-between",justify:"flex-start"})` width: 141px; height: 61px; border: 1px solid ${u.GRAY7}; @@ -81,11 +81,11 @@ import{aY as j,aZ as E,a_ as b,a$ as R,b0 as A,b1 as U,b2 as D,b3 as O,w as x,x width: 16px; height: 16px; } -`,Ie=/^(https?:\/\/)/g,Le=/(www\.)?/g,Ue=/[\w-]+(\.[\w-]+)*/g,De=/(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,61})[a-zA-Z0-9](?:\.[a-zA-Z]{2,})/g,Oe=/(\/[^\s?]*)?/g,Ze=/(\?[^\s]*)?/g,G=new RegExp(`${Ie.source}${Le.source}${Ue.source}${De.source}?${Oe.source}${Ze.source}$`,"i"),M=t=>{if(t==null?void 0:t.match(G)){const o=new URL(t).hostname;return o!=null&&o.startsWith("www.")?((o==null?void 0:o.match(/\./g))||[]).length>=2:((o==null?void 0:o.match(/\./g))||[]).length>=1}return!1},Ge=({type:t,onNextStep:s,allowNextStep:n})=>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(Me,{children:"Add Content"})})}),e.jsx(r,{mb:12,children:e.jsx(X,{id:"cy-youtube-channel-id",maxLength:250,name:"source",placeholder:"Paste your url here...",rules:{...Q,...t!==A?{pattern:{message:"Please enter a valid URL",value:G},validate:{source:M}}:{}}})}),e.jsx(r,{children:e.jsx(C,{color:"secondary","data-testid":"add-content-btn",disabled:!n,onClick:s,size:"large",variant:"contained",children:"Next"})})]}),Me=x(z)` +`,Ie=/^(https?:\/\/)/g,Le=/(www\.)?/g,Ue=/[\w-]+(\.[\w-]+)*/g,De=/(?:\.[a-zA-Z0-9][a-zA-Z0-9-]{0,61})[a-zA-Z0-9](?:\.[a-zA-Z]{2,})/g,Oe=/(\/[^\s?]*)?/g,Ze=/(\?[^\s]*)?/g,G=new RegExp(`${Ie.source}${Le.source}${Ue.source}${De.source}?${Oe.source}${Ze.source}$`,"i"),M=t=>{if(t==null?void 0:t.match(G)){const o=new URL(t).hostname;return o!=null&&o.startsWith("www.")?((o==null?void 0:o.match(/\./g))||[]).length>=2:((o==null?void 0:o.match(/\./g))||[]).length>=1}return!1},Ge=({type:t,onNextStep:s,allowNextStep:n})=>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(Me,{children:"Add Content"})})}),e.jsx(r,{mb:12,children:e.jsx(X,{id:"cy-youtube-channel-id",maxLength:250,name:"source",placeholder:"Paste your url here...",rules:{...Q,...t!==T?{pattern:{message:"Please enter a valid URL",value:G},validate:{source:M}}:{}}})}),e.jsx(r,{children:e.jsx(C,{color:"secondary","data-testid":"add-content-btn",disabled:!n,onClick:s,size:"large",variant:"contained",children:"Next"})})]}),Me=x(z)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,T={[j]:{label:"Twitter handle",img:"twitter_default.svg"},[E]:{label:"Youtube channel",img:"youtube_default.svg"},[b]:{label:"RSS Feed",img:"rss_feed.svg"},[R]:{label:"GitHub Repository",img:"github_default.svg"}},He=({onNextStep:t,onPrevStep:s,type:n,value:o})=>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(We,{children:"Source Type"})})}),e.jsxs(r,{mb:20,children:[e.jsxs(Ve,{children:[e.jsx("img",{alt:T[n].label,className:"badge__img",src:T[n].img}),e.jsx(Ye,{children:T[n].label})]}),e.jsx(Fe,{children:$e(o,n)??o})]}),e.jsxs(r,{direction:"row",children:[e.jsx(r,{grow:1,children:e.jsx(qe,{color:"secondary",disabled:!1,onClick:()=>s(),size:"large",variant:"contained",children:"Cancel"})}),e.jsx(r,{grow:1,ml:20,children:e.jsx(C,{color:"secondary","data-testid":"source_next_btn",onClick:()=>t(),size:"large",variant:"contained",children:"Next"})})]})]}),Fe=x(r)` +`,A={[j]:{label:"Twitter handle",img:"twitter_default.svg"},[E]:{label:"Youtube channel",img:"youtube_default.svg"},[b]:{label:"RSS Feed",img:"rss_feed.svg"},[R]:{label:"GitHub Repository",img:"github_default.svg"}},He=({onNextStep:t,onPrevStep:s,type:n,value:o})=>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(We,{children:"Source Type"})})}),e.jsxs(r,{mb:20,children:[e.jsxs(Ve,{children:[e.jsx("img",{alt:A[n].label,className:"badge__img",src:A[n].img}),e.jsx(Ye,{children:A[n].label})]}),e.jsx(Fe,{children:$e(o,n)??o})]}),e.jsxs(r,{direction:"row",children:[e.jsx(r,{grow:1,children:e.jsx(qe,{color:"secondary",disabled:!1,onClick:()=>s(),size:"large",variant:"contained",children:"Cancel"})}),e.jsx(r,{grow:1,ml:20,children:e.jsx(C,{color:"secondary","data-testid":"source_next_btn",onClick:()=>t(),size:"large",variant:"contained",children:"Next"})})]})]}),Fe=x(r)` font-family: Barlow; font-size: 14px; font-weight: 400; @@ -130,4 +130,4 @@ import{aY as j,aZ as E,a_ as b,a$ as R,b0 as A,b1 as U,b2 as D,b3 as O,w as x,x color: ${u.BG2}; } } -`,H=async(t,s,n,o)=>{const y=_(s)?"radar":"add_node",a={};if(s===A)a.media_url=t.source,a.content_type="audio_video";else if(s===U){if(/(?:https?:\/\/)?(?:www\.)?(twitter|x)\.com\/\w+\/status\/(\d+)/s.test(t.source)){const c=/\/status\/(\d+)/,l=t.source.match(c);if(l!=null&&l[1]){const[,S]=l;a.tweet_id=S}}else a.tweet_id=t.source;a.content_type="tweet"}else if(s===D)a.content_type="webpage",a.web_page=t.source;else if(s===O)a.content_type="document",a.text=t.source;else if(s===j){const[,i]=(t.source||"").match(B)||[];if(i)a.source=i,a.source_type=s;else return}else(s===E||s===b||s===R)&&(a.source=t.source,a.source_type=s);t.latitude&&t.longitude&&(a.latitude=t.latitude,a.longitude=t.longitude);let p="",d;ae?d=await ce.enable():d=await ie.enable(),a.pubkey=d==null?void 0:d.pubkey,p=await le();try{const i=await de.post(`/${y}`,JSON.stringify(a),{Authorization:p});if(await ue(n),i.data.project_id&&o(i.data.project_id),i.error){const{message:c}=i.error;throw new Error(c)}}catch(i){if(i.status===402)await xe(n),await H(t,s,n,o);else{let c=m;if(i.status===400)try{const l=await i.json();c=l.message||l.status||(l==null?void 0:l.errorCode)||m}catch{c=m}else i instanceof Error&&(c=i.message||m);throw new Error(c)}}},Qe=()=>{const[t,s]=f.useState(0),{close:n,visible:o}=ee("addContent"),{setBudget:y}=Z(g=>g),{setRunningProjectId:a}=te(g=>g),p=se({mode:"onChange"}),{watch:d,setValue:i,reset:c}=p,[l,S]=f.useState(!1),[F,k]=f.useState("");f.useEffect(()=>()=>{k(""),s(0),c()},[o,c]);const w=d("inputType"),N=d("source"),P=d("source"),W=M(N);f.useEffect(()=>{(async()=>{const h=await ze(P);i("inputType",h)})()},[P,i]);const Y=()=>{n()},I=()=>{s(t===0?_(w)?1:2:t+1)},V=()=>{s(t-1)},q=p.handleSubmit(async g=>{S(!0);try{await H(g,w,y,a),ne("Content Added"),Y()}catch(h){let $=m;if((h==null?void 0:h.status)===400){const v=await h.json();$=v.errorCode||(v==null?void 0:v.status)||m}else h instanceof Error&&($=h.message);k(String($))}finally{S(!1)}});return e.jsx(oe,{id:"addContent",kind:"small",onClose:n,preventOutsideClose:!0,children:e.jsx(re,{...p,children:e.jsxs("form",{id:"add-node-form",onSubmit:q,children:[t===0&&e.jsx(Ge,{allowNextStep:W,onNextStep:I,type:w}),t===1&&_(w)&&e.jsx(He,{onNextStep:I,onPrevStep:V,type:w,value:N}),t===2&&e.jsx(Te,{error:F,loading:l,onClick:()=>null,type:w})]})})})};export{Qe as AddContentModal}; +`,H=async(t,s,n,o)=>{const y=_(s)?"radar":"add_node",a={};if(s===T)a.media_url=t.source,a.content_type="audio_video";else if(s===U){if(/(?:https?:\/\/)?(?:www\.)?(twitter|x)\.com\/\w+\/status\/(\d+)/s.test(t.source)){const c=/\/status\/(\d+)/,l=t.source.match(c);if(l!=null&&l[1]){const[,S]=l;a.tweet_id=S}}else a.tweet_id=t.source;a.content_type="tweet"}else if(s===D)a.content_type="webpage",a.web_page=t.source;else if(s===O)a.content_type="document",a.text=t.source;else if(s===j){const[,i]=(t.source||"").match(B)||[];if(i)a.source=i,a.source_type=s;else return}else(s===E||s===b||s===R)&&(a.source=t.source,a.source_type=s);t.latitude&&t.longitude&&(a.latitude=t.latitude,a.longitude=t.longitude);let p="",d;ae?d=await ce.enable():d=await ie.enable(),a.pubkey=d==null?void 0:d.pubkey,p=await le();try{const i=await de.post(`/${y}`,JSON.stringify(a),{Authorization:p});if(await ue(n),i.data.project_id&&o(i.data.project_id),i.error){const{message:c}=i.error;throw new Error(c)}}catch(i){if(i.status===402)await xe(n),await H(t,s,n,o);else{let c=m;if(i.status===400)try{const l=await i.json();c=l.message||l.status||(l==null?void 0:l.errorCode)||m}catch{c=m}else i instanceof Error&&(c=i.message||m);throw new Error(c)}}},Qe=()=>{const[t,s]=f.useState(0),{close:n,visible:o}=ee("addContent"),{setBudget:y}=Z(g=>g),{setRunningProjectId:a}=te(g=>g),p=se({mode:"onChange"}),{watch:d,setValue:i,reset:c}=p,[l,S]=f.useState(!1),[F,k]=f.useState("");f.useEffect(()=>()=>{k(""),s(0),c()},[o,c]);const w=d("inputType"),N=d("source"),P=d("source"),W=M(N);f.useEffect(()=>{(async()=>{const h=await ze(P);i("inputType",h)})()},[P,i]);const Y=()=>{n()},I=()=>{s(t===0?_(w)?1:2:t+1)},V=()=>{s(t-1)},q=p.handleSubmit(async g=>{S(!0);try{await H(g,w,y,a),ne("Content Added"),Y()}catch(h){let $=m;if((h==null?void 0:h.status)===400){const v=await h.json();$=v.errorCode||(v==null?void 0:v.status)||m}else h instanceof Error&&($=h.message);k(String($))}finally{S(!1)}});return e.jsx(oe,{id:"addContent",kind:"small",onClose:n,preventOutsideClose:!0,children:e.jsx(re,{...p,children:e.jsxs("form",{id:"add-node-form",onSubmit:q,children:[t===0&&e.jsx(Ge,{allowNextStep:W,onNextStep:I,type:w}),t===1&&_(w)&&e.jsx(He,{onNextStep:I,onPrevStep:V,type:w,value:N}),t===2&&e.jsx(Ae,{error:F,loading:l,onClick:()=>null,type:w})]})})})};export{Qe as AddContentModal}; diff --git a/build/assets/index-c5f67a31.js b/build/assets/index-d346b8ca.js similarity index 95% rename from build/assets/index-c5f67a31.js rename to build/assets/index-d346b8ca.js index 827dbb880..a7101aa3d 100644 --- a/build/assets/index-c5f67a31.js +++ b/build/assets/index-d346b8ca.js @@ -1,4 +1,4 @@ -import{w as a,x as r,F as i,j as e,y as I,H as S,r as b,z as v,a1 as z,D as $,E as C,aR as A,aS as B,aT as y,a3 as M,aU as w,aV as k,aW as D,M as j,aX as R}from"./index-16ff4e55.js";import{e as T,g as E,ay as L,az as W,C as P,aA as V,aB as F}from"./index-04a82be1.js";import{C as G}from"./ClipLoader-049391dc.js";import{T as U,a as N}from"./Tabs-0da0e37b.js";import"./createSvgIcon-e167cb2e.js";const Y={split:e.jsx(W,{}),force:e.jsx(P,{}),sphere:e.jsx(V,{}),earth:e.jsx(F,{})},H=()=>{const[n,c]=T(E(t=>[t.graphStyle,t.setGraphStyle])),l=t=>{c(t)};return e.jsx(O,{direction:"column",children:L.map(t=>e.jsx(i,{className:I("icon",{active:n===t}),onClick:()=>l(t),children:Y[t]},t))})},O=a(i).attrs({direction:"row",align:"center",justify:"space-between"})` +import{w as a,x as r,F as i,j as e,y as I,H as S,r as b,z as v,a1 as z,D as $,E as C,aR as A,aS as B,aT as y,a3 as M,aU as w,aV as k,aW as D,M as j,aX as R}from"./index-4c5f8236.js";import{e as T,g as E,aw as L,ax as W,C as P,ay as V,az as F}from"./index-a4caf8d5.js";import{C as G}from"./ClipLoader-601f6378.js";import{T as U,a as N}from"./Tabs-02e36f7f.js";import"./createSvgIcon-2fe026f6.js";const Y={split:e.jsx(W,{}),force:e.jsx(P,{}),sphere:e.jsx(V,{}),earth:e.jsx(F,{})},H=()=>{const[n,c]=T(E(t=>[t.graphStyle,t.setGraphStyle])),l=t=>{c(t)};return e.jsx(O,{direction:"column",children:L.map(t=>e.jsx(i,{className:I("icon",{active:n===t}),onClick:()=>l(t),children:Y[t]},t))})},O=a(i).attrs({direction:"row",align:"center",justify:"space-between"})` width: 447px; height: 48px; background: ${r.appearanceBg}; diff --git a/build/assets/index-af738b28.js b/build/assets/index-d8e2e62f.js similarity index 78% rename from build/assets/index-af738b28.js rename to build/assets/index-d8e2e62f.js index b3c894460..3e650a55b 100644 --- a/build/assets/index-af738b28.js +++ b/build/assets/index-d8e2e62f.js @@ -1,4 +1,4 @@ -import{r,j as e,bn as A,Q as B,F as h,C as F,bc as O,bo as I,w as l,H as z,M as E,a1 as N,a3 as D,x as _,z as M,bp as H,aX as X}from"./index-16ff4e55.js";import{aG as Y,aH as G,aI as P,u as R}from"./index-04a82be1.js";import{A as L,T as Q}from"./index-f0acd212.js";import{S as V,A as W}from"./constants-d7d823df.js";import{C as T}from"./ClipLoader-049391dc.js";import"./Stack-25a86e54.js";import"./createSvgIcon-e167cb2e.js";import"./TextareaAutosize-e1814669.js";const $=({selectedType:t,setSelectedType:c})=>{const[p,d]=r.useState([]);r.useEffect(()=>{(async()=>{try{const{data:x}=await A();d(x.edge_types)}catch(x){console.warn(x)}})()},[d]);const a=o=>({label:o,value:o}),f=o=>{c((o==null?void 0:o.value)||"")};return e.jsx(L,{onSelect:f,options:p.map(a),selectedValue:t?a(t):null})},q=({onSelect:t,selectedValue:c,topicId:p})=>{const[d,a]=r.useState([]),[f,o]=r.useState(!1),x=r.useMemo(()=>{const s=async u=>{const i={is_muted:"False",sort_by:W,search:u,skip:"0",limit:"1000"};o(!0);try{const S=(await I(i.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==p);a(S)}catch{a([])}finally{o(!1)}};return B.debounce(s,300)},[p]),b=s=>{const u=s.trim();if(!u){a([]);return}u.length>2&&x(s)},j=s=>{const u=s?d.find(i=>i.ref_id===s.value):null;t(u||null)},n=s=>({label:s.search_value,value:s.ref_id,type:s.node_type}),v=s=>s.map(n);return c?e.jsxs(h,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:c.search_value}),e.jsx(V,{onClick:()=>t(null),size:"medium",children:e.jsx(F,{})})]}):e.jsx(L,{handleInputChange:b,isLoading:f,onSelect:j,options:v(d)||O,selectedValue:c?n(c):null})},J=({from:t,onSelect:c,selectedType:p,setSelectedType:d,selectedToNode:a,setIsSwapped:f,isSwapped:o})=>{const x=()=>{f()},b=t&&("search_value"in t?t.search_value:t.name);return e.jsxs(h,{mb:20,children:[e.jsx(h,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(h,{align:"center",direction:"row",children:e.jsx(U,{children:"Add Edge"})})}),e.jsxs(Z,{swap:o,children:[e.jsx(h,{children:e.jsx(ee,{disabled:!0,label:o?"To":"From",swap:o,value:b})}),e.jsxs(h,{my:16,children:[e.jsx(oe,{children:"Type"}),e.jsx($,{selectedType:p,setSelectedType:d})]}),e.jsx(h,{children:e.jsxs(te,{children:[e.jsx(se,{children:o?"From":"To"}),e.jsx(q,{onSelect:c,selectedValue:a,topicId:t==null?void 0:t.ref_id})]})}),e.jsxs(K,{children:[e.jsx(ne,{children:e.jsx(Y,{})}),e.jsx(ae,{onClick:x,children:e.jsx(G,{})}),e.jsx(ie,{children:e.jsx(P,{})})]})]})]})},K=l.div` +import{r,j as e,bn as k,Q as A,F as h,C as B,bc as O,bo as E,w as l,H as z,M as I,a1 as N,a3 as D,x as _,z as M,bp as X,aX as Y}from"./index-4c5f8236.js";import{aE as G,aF as H,aG as P,u as R}from"./index-a4caf8d5.js";import{A as L,T as Q}from"./index-891a66a8.js";import{S as V,A as W}from"./constants-ccce11dd.js";import{C as T}from"./ClipLoader-601f6378.js";import"./Stack-7f131eb3.js";import"./createSvgIcon-2fe026f6.js";import"./TextareaAutosize-cc9b3a66.js";const $=({selectedType:t,setSelectedType:c})=>{const[p,d]=r.useState([]);r.useEffect(()=>{(async()=>{try{const{data:x}=await k();d(x.edge_types)}catch(x){console.warn(x)}})()},[d]);const a=o=>({label:o,value:o}),f=o=>{c((o==null?void 0:o.value)||"")};return e.jsx(L,{onSelect:f,options:p.map(a),selectedValue:t?a(t):null})},q=({onSelect:t,selectedValue:c,topicId:p})=>{const[d,a]=r.useState([]),[f,o]=r.useState(!1),x=r.useMemo(()=>{const s=async u=>{const i={is_muted:"False",sort_by:W,search:u,skip:"0",limit:"1000"};o(!0);try{const S=(await E(i.search)).data.filter(y=>(y==null?void 0:y.ref_id)!==p);a(S)}catch{a([])}finally{o(!1)}};return A.debounce(s,300)},[p]),b=s=>{const u=s.trim();if(!u){a([]);return}u.length>2&&x(s)},j=s=>{const u=s?d.find(i=>i.ref_id===s.value):null;t(u||null)},n=s=>({label:s.search_value,value:s.ref_id,type:s.node_type}),v=s=>s.map(n);return c?e.jsxs(h,{align:"center",basis:"100%",direction:"row",grow:1,shrink:1,children:[e.jsx("span",{children:c.search_value}),e.jsx(V,{onClick:()=>t(null),size:"medium",children:e.jsx(B,{})})]}):e.jsx(L,{handleInputChange:b,isLoading:f,onSelect:j,options:v(d)||O,selectedValue:c?n(c):null})},J=({from:t,onSelect:c,selectedType:p,setSelectedType:d,selectedToNode:a,setIsSwapped:f,isSwapped:o})=>{const x=()=>{f()},b=t&&("search_value"in t?t.search_value:t.name);return e.jsxs(h,{mb:20,children:[e.jsx(h,{align:"center",direction:"row",justify:"space-between",mb:18,children:e.jsx(h,{align:"center",direction:"row",children:e.jsx(U,{children:"Add Edge"})})}),e.jsxs(Z,{swap:o,children:[e.jsx(h,{children:e.jsx(ee,{disabled:!0,label:o?"To":"From",swap:o,value:b})}),e.jsxs(h,{my:16,children:[e.jsx(oe,{children:"Type"}),e.jsx($,{selectedType:p,setSelectedType:d})]}),e.jsx(h,{children:e.jsxs(te,{children:[e.jsx(se,{children:o?"From":"To"}),e.jsx(q,{onSelect:c,selectedValue:a,topicId:t==null?void 0:t.ref_id})]})}),e.jsxs(K,{children:[e.jsx(ne,{children:e.jsx(G,{})}),e.jsx(ae,{onClick:x,children:e.jsx(H,{})}),e.jsx(ie,{children:e.jsx(P,{})})]})]})]})},K=l.div` position: absolute; top: 26px; bottom: 26px; @@ -84,9 +84,9 @@ import{r,j as e,bn as A,Q as B,F as h,C as F,bc as O,bo as I,w as l,H as z,M as transform: translateY(10px) translateX(3px); color: #6b7a8d; line-height: 1; -`,re=()=>{const{close:t}=E("addEdgeToNode"),c=N({mode:"onChange"}),[p,d]=r.useState(!1),[a,f]=r.useState(""),[o,x]=r.useState(!1),[b,j]=r.useState(!1),[n,v]=r.useState(null),[s,u]=r.useState(),i=R();r.useEffect(()=>{(async()=>{if(i){j(!0);try{if(i.type==="topic"){const{data:m}=await I(i==null?void 0:i.name,{exact_match:"true",node_type:"topic"}),C=m.find(k=>k.node_type==="topic");u(C)}}catch(m){console.error(m)}finally{j(!1)}}})()},[i]);const w=()=>{t()},S=async()=>{const g=s||i;if(!(!n||!(g!=null&&g.ref_id))){d(!0);try{await H({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:m}=g,{ref_id:C}=n;console.log(m,C),w()}catch(m){console.warn(m)}finally{d(!1)}}},y=p||!n||!a;return e.jsxs(D,{...c,children:[b?e.jsx(h,{align:"center",my:24,children:e.jsx(T,{color:_.lightGray,size:24})}):e.jsx(J,{from:s??i,isSwapped:o,onSelect:v,selectedToNode:n,selectedType:a,setIsSwapped:()=>x(!o),setSelectedType:f}),e.jsxs(le,{color:"secondary",disabled:y,onClick:S,size:"large",variant:"contained",children:["Confirm",p&&e.jsx(ce,{children:e.jsx(T,{color:_.lightGray,size:12})})]})]})},le=l(M)` +`,re=()=>{const{close:t}=I("addEdgeToNode"),c=N({mode:"onChange"}),[p,d]=r.useState(!1),[a,f]=r.useState(""),[o,x]=r.useState(!1),[b,j]=r.useState(!1),[n,v]=r.useState(null),[s,u]=r.useState(),i=R();r.useEffect(()=>{(async()=>{if(i){j(!0);try{if(i.type==="topic"){const{data:m}=await E(i==null?void 0:i.name,{exact_match:"true",node_type:"topic"}),C=m.find(F=>F.node_type==="topic");u(C)}}catch(m){console.error(m)}finally{j(!1)}}})()},[i]);const w=()=>{t()},S=async()=>{const g=s||i;if(!(!n||!(g!=null&&g.ref_id))){d(!0);try{await X({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:m}=g,{ref_id:C}=n;console.log(m,C),w()}catch(m){console.warn(m)}finally{d(!1)}}},y=p||!n||!a;return e.jsxs(D,{...c,children:[b?e.jsx(h,{align:"center",my:24,children:e.jsx(T,{color:_.lightGray,size:24})}):e.jsx(J,{from:s??i,isSwapped:o,onSelect:v,selectedToNode:n,selectedType:a,setIsSwapped:()=>x(!o),setSelectedType:f}),e.jsxs(le,{color:"secondary",disabled:y,onClick:S,size:"large",variant:"contained",children:["Confirm",p&&e.jsx(ce,{children:e.jsx(T,{color:_.lightGray,size:12})})]})]})},le=l(M)` width: 293px !important; margin: 0 0 10px auto !important; `,ce=l.span` margin-top: 2px; -`,be=()=>{const{close:t}=E("addEdgeToNode");return e.jsx(X,{id:"addEdgeToNode",kind:"small",onClose:t,preventOutsideClose:!0,children:e.jsx(re,{})})};export{be as AddNodeEdgeModal}; +`,be=()=>{const{close:t}=I("addEdgeToNode");return e.jsx(Y,{id:"addEdgeToNode",kind:"small",onClose:t,preventOutsideClose:!0,children:e.jsx(re,{})})};export{be as AddNodeEdgeModal}; diff --git a/build/assets/index-0f2fdc5b.js b/build/assets/index-e9d8f381.js similarity index 93% rename from build/assets/index-0f2fdc5b.js rename to build/assets/index-e9d8f381.js index 1cd6827af..682efa405 100644 --- a/build/assets/index-0f2fdc5b.js +++ b/build/assets/index-e9d8f381.js @@ -1,4 +1,4 @@ -import{ac as V,bV as C,bW as m,bX as F,w,H as k,F as d,al as M,r as x,E as z,j as n,aU as $,aV as R,z as S,M as E,a1 as U,a3 as A,aS as G,aX as I}from"./index-16ff4e55.js";import{u as K}from"./index-04a82be1.js";import{A as N}from"./index-f0acd212.js";import"./Stack-25a86e54.js";import"./createSvgIcon-e167cb2e.js";import"./TextareaAutosize-e1814669.js";const _="https://community.sphinx.chat",O=async e=>await V.post("/bounty",JSON.stringify(e)),W=async e=>await C(`${_}/person/${e}`,{headers:{"Content-Type":"application/json"},method:"GET"}),P=async e=>await C(`${_}/workspaces/user/${e}`,{headers:{"Content-Type":"application/json"},method:"GET"});async function q(){try{const e=Math.floor(Date.now()/1e3),t=m.Buffer.from(e.toString(16),"hex"),r=m.Buffer.from(t).toString("base64"),s=await F.signMessage(r),a=H(s.signature),l=m.Buffer.concat([t,a],a.length+t.length);return L(l)}catch(e){return console.log("error from signing more message: ",e),""}}function H(e){const t=e.replace(/_/g,"/").replace(/-/g,"+"),r=t.padEnd(t.length+(4-t.length%4)%4,"=");return m.Buffer.from(r,"base64")}function L(e){let t="";const r=e.byteLength;for(let a=0;a{const t=e.trim();return!!(t&&D.test(t))},v=({errMessage:e,handleClose:t})=>{const{setValue:r,watch:s}=M(),[a,l]=x.useState([]),{pubKey:c}=z();x.useEffect(()=>{async function o(){try{const i=await W(c);if(!i.id){l([{label:"SecondBrain",value:"SecondBrain"}]);return}const p=await P(i.id);if(p.length>0){const B=[];for(let b=0;b{const i=(o==null?void 0:o.label)||"SecondBrain",p=(o==null?void 0:o.value)||"ck9drb84nncjnaefo090";r("nodeType",i,{shouldValidate:!0}),r("workspaceUuid",p)},y=X(u)&&!!g,h=o=>{o.key===" "&&o.preventDefault()};return n.jsxs(d,{children:[n.jsx(d,{align:"center",direction:"row",justify:"space-between",mb:18,children:n.jsx(J,{children:"Create Bounty"})}),n.jsxs(d,{mb:20,children:[n.jsx(T,{children:"Select Workspace"}),n.jsx(N,{autoFocus:!0,onSelect:f,options:a})]}),n.jsxs(d,{mb:20,children:[n.jsx(T,{children:"Set Budget"}),n.jsx($,{id:"budget",name:"budget",onKeyDown:h,placeholder:"Enter budget",rules:{...R,pattern:{value:D,message:"Please enter a valid number"}},value:u})]}),n.jsxs(d,{direction:"row",children:[n.jsx(d,{grow:1,children:n.jsx(S,{color:"secondary",onClick:()=>t(),size:"large",variant:"contained",children:"Cancel"})}),n.jsx(d,{grow:1,ml:20,children:n.jsx(S,{color:"secondary",disabled:!y,size:"large",type:"submit",variant:"contained",children:"Confirm"})})]}),e&&n.jsx(Q,{children:e})]})},T=w(k)` +import{ac as V,bV as C,bW as m,bX as F,w,H as k,F as d,al as M,r as x,E as z,j as n,aU as $,aV as R,z as S,M as E,a1 as U,a3 as A,aS as G,aX as I}from"./index-4c5f8236.js";import{u as K}from"./index-a4caf8d5.js";import{A as N}from"./index-891a66a8.js";import"./Stack-7f131eb3.js";import"./createSvgIcon-2fe026f6.js";import"./TextareaAutosize-cc9b3a66.js";const _="https://community.sphinx.chat",O=async e=>await V.post("/bounty",JSON.stringify(e)),W=async e=>await C(`${_}/person/${e}`,{headers:{"Content-Type":"application/json"},method:"GET"}),P=async e=>await C(`${_}/workspaces/user/${e}`,{headers:{"Content-Type":"application/json"},method:"GET"});async function q(){try{const e=Math.floor(Date.now()/1e3),t=m.Buffer.from(e.toString(16),"hex"),r=m.Buffer.from(t).toString("base64"),s=await F.signMessage(r),a=H(s.signature),l=m.Buffer.concat([t,a],a.length+t.length);return L(l)}catch(e){return console.log("error from signing more message: ",e),""}}function H(e){const t=e.replace(/_/g,"/").replace(/-/g,"+"),r=t.padEnd(t.length+(4-t.length%4)%4,"=");return m.Buffer.from(r,"base64")}function L(e){let t="";const r=e.byteLength;for(let a=0;a{const t=e.trim();return!!(t&&D.test(t))},v=({errMessage:e,handleClose:t})=>{const{setValue:r,watch:s}=M(),[a,l]=x.useState([]),{pubKey:c}=z();x.useEffect(()=>{async function o(){try{const i=await W(c);if(!i.id){l([{label:"SecondBrain",value:"SecondBrain"}]);return}const p=await P(i.id);if(p.length>0){const B=[];for(let b=0;b{const i=(o==null?void 0:o.label)||"SecondBrain",p=(o==null?void 0:o.value)||"ck9drb84nncjnaefo090";r("nodeType",i,{shouldValidate:!0}),r("workspaceUuid",p)},y=X(u)&&!!g,h=o=>{o.key===" "&&o.preventDefault()};return n.jsxs(d,{children:[n.jsx(d,{align:"center",direction:"row",justify:"space-between",mb:18,children:n.jsx(J,{children:"Create Bounty"})}),n.jsxs(d,{mb:20,children:[n.jsx(T,{children:"Select Workspace"}),n.jsx(N,{autoFocus:!0,onSelect:f,options:a})]}),n.jsxs(d,{mb:20,children:[n.jsx(T,{children:"Set Budget"}),n.jsx($,{id:"budget",name:"budget",onKeyDown:h,placeholder:"Enter budget",rules:{...R,pattern:{value:D,message:"Please enter a valid number"}},value:u})]}),n.jsxs(d,{direction:"row",children:[n.jsx(d,{grow:1,children:n.jsx(S,{color:"secondary",onClick:()=>t(),size:"large",variant:"contained",children:"Cancel"})}),n.jsx(d,{grow:1,ml:20,children:n.jsx(S,{color:"secondary",disabled:!y,size:"large",type:"submit",variant:"contained",children:"Confirm"})})]}),e&&n.jsx(Q,{children:e})]})},T=w(k)` font-size: 14px; font-weight: 600; font-family: 'Barlow'; diff --git a/build/assets/index-1b04a0aa.js b/build/assets/index-ec9bfb02.js similarity index 90% rename from build/assets/index-1b04a0aa.js rename to build/assets/index-ec9bfb02.js index 449c7273c..23e089699 100644 --- a/build/assets/index-1b04a0aa.js +++ b/build/assets/index-ec9bfb02.js @@ -1,4 +1,4 @@ -import{ac as Z,w as g,x as b,F as t,H as T,E as V,r as y,j as e,z as C,aW as ee,b4 as te,al as se,aU as L,aV as F,b9 as B,ba as ne,a0 as oe,bb as re,bc as ie,bd as ae,M as O,a1 as ce,v as le,aS as de,aT as I,aX as pe,a3 as xe,ae as ue,ad as me,b7 as he}from"./index-16ff4e55.js";import{aC as fe,ab as ye,e as ge}from"./index-04a82be1.js";import{C as U}from"./ClipLoader-049391dc.js";import{p as R}from"./index-d206d03e.js";import{A as je}from"./index-f0acd212.js";import{c as we}from"./index-64f1c910.js";import"./three.module-d9fcef06.js";import"./Stack-25a86e54.js";import"./createSvgIcon-e167cb2e.js";import"./TextareaAutosize-e1814669.js";const be=async(o,a,c="")=>await Z.post(`/${o}`,JSON.stringify(a),{Authorization:c}),Se=async(o,a,c,u,d,r)=>{const x=o==="Create custom type"?"schema":"node",l={node_data:{...a,...o==="Image"&&{source_link:c}},node_type:o,name:u,pubkey:r};return be(x,l,d)},Ne=({onClick:o,loading:a,error:c})=>{const u=V(l=>l.budget),[d,r]=y.useState(10),x="node";return y.useEffect(()=>{(async()=>{try{const h=await te(x);r(h.data.price)}catch(h){console.error("cannot fetch",h)}})()},[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:[fe(u)," sats"]})]})]}),e.jsx(t,{children:e.jsx(C,{color:"secondary","data-testid":"check-icon",disabled:a||!!c,onClick:o,size:"large",startIcon:a?e.jsx(q,{children:e.jsx(U,{color:b.lightGray,size:12})}):e.jsxs(q,{children:[" ",e.jsx(ye,{})]}),type:"submit",variant:"contained",children:"Approve"})}),c?e.jsx(ze,{children:e.jsxs(ve,{children:[e.jsx(ee,{className:"errorIcon"}),e.jsx("span",{children:c})]})}):null]})},Te=g(t).attrs({direction:"column",align:"space-between",justify:"flex-start"})` +import{ac as Z,w as g,x as b,F as t,H as T,E as V,r as y,j as e,z as C,aW as ee,b4 as te,al as se,aU as L,aV as F,b9 as B,ba as ne,a0 as oe,bb as re,bc as ie,bd as ae,M as O,a1 as ce,v as le,aS as de,aT as I,aX as pe,a3 as xe,ae as ue,ad as me,b7 as he}from"./index-4c5f8236.js";import{aA as fe,a9 as ye,e as ge}from"./index-a4caf8d5.js";import{C as U}from"./ClipLoader-601f6378.js";import{p as R}from"./index-d206d03e.js";import{A as je}from"./index-891a66a8.js";import{c as we}from"./index-64f1c910.js";import"./three.module-d9fcef06.js";import"./Stack-7f131eb3.js";import"./createSvgIcon-2fe026f6.js";import"./TextareaAutosize-cc9b3a66.js";const be=async(o,a,c="")=>await Z.post(`/${o}`,JSON.stringify(a),{Authorization:c}),Se=async(o,a,c,u,d,r)=>{const x=o==="Create custom type"?"schema":"node",l={node_data:{...a,...o==="Image"&&{source_link:c}},node_type:o,name:u,pubkey:r};return be(x,l,d)},Ne=({onClick:o,loading:a,error:c})=>{const u=V(l=>l.budget),[d,r]=y.useState(10),x="node";return y.useEffect(()=>{(async()=>{try{const h=await te(x);r(h.data.price)}catch(h){console.error("cannot fetch",h)}})()},[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:[fe(u)," sats"]})]})]}),e.jsx(t,{children:e.jsx(C,{color:"secondary","data-testid":"check-icon",disabled:a||!!c,onClick:o,size:"large",startIcon:a?e.jsx(q,{children:e.jsx(U,{color:b.lightGray,size:12})}):e.jsxs(q,{children:[" ",e.jsx(ye,{})]}),type:"submit",variant:"contained",children:"Approve"})}),c?e.jsx(ze,{children:e.jsxs(ve,{children:[e.jsx(ee,{className:"errorIcon"}),e.jsx("span",{children:c})]})}):null]})},Te=g(t).attrs({direction:"column",align:"space-between",justify:"flex-start"})` width: 141px; height: 61px; border: 1px solid ${b.GRAY7}; @@ -85,11 +85,11 @@ import{ac as Z,w as g,x as b,F as t,H as T,E as V,r as y,j as e,z as C,aW as ee, font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,Ie=({handleSelectType:o,skipToStep:a,nodeType:c})=>{const[u,d]=y.useState(!1),[r,x]=y.useState(),{watch:l,setValue:h,formState:{isValid:w}}=se();y.useEffect(()=>{(async()=>{d(!0);const m=await ne(c),E=(m.attributes&&typeof m.attributes=="object"?R(m.attributes):R(m)).filter(_=>_.key!=="node_key");x(E),d(!1)})()},[c,l]);const f=s=>s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," "),n=r?[...r].sort((s,m)=>s.required&&!m.required?-1:!s.required&&m.required?1:0):[],j=()=>{o(""),a("sourceType")},p=()=>{r==null||r.forEach(({key:s,required:m})=>{if(m){const S=l(s);typeof S=="string"&&h(s,S.trim(),{shouldValidate:!0})}}),w&&!u&&(r!=null&&r.every(s=>!s.required||l(s.key)))&&a("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(U,{color:b.lightGray})}):e.jsx(t,{className:"input__wrapper",children:n==null?void 0:n.map(({key:s,required:m})=>e.jsxs(Ae,{children:[e.jsx(T,{children:f(s)}),e.jsx(L,{id:"item-name",maxLength:50,name:s,placeholder:m?"Required":"Optional",rules:{...m?{...F,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:j,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=g(T)` +`,Ie=({handleSelectType:o,skipToStep:a,nodeType:c})=>{const[u,d]=y.useState(!1),[r,x]=y.useState(),{watch:l,setValue:h,formState:{isValid:w}}=se();y.useEffect(()=>{(async()=>{d(!0);const m=await ne(c),A=(m.attributes&&typeof m.attributes=="object"?R(m.attributes):R(m)).filter(E=>E.key!=="node_key");x(A),d(!1)})()},[c,l]);const f=s=>s.charAt(0).toUpperCase()+s.slice(1).replace(/_/g," "),n=r?[...r].sort((s,m)=>s.required&&!m.required?-1:!s.required&&m.required?1:0):[],j=()=>{o(""),a("sourceType")},p=()=>{r==null||r.forEach(({key:s,required:m})=>{if(m){const S=l(s);typeof S=="string"&&h(s,S.trim(),{shouldValidate:!0})}}),w&&!u&&(r!=null&&r.every(s=>!s.required||l(s.key)))&&a("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(Ae,{children:"Set Attributes"})})}),e.jsx(Ee,{children:u?e.jsx(t,{style:{margin:"auto"},children:e.jsx(U,{color:b.lightGray})}):e.jsx(t,{className:"input__wrapper",children:n==null?void 0:n.map(({key:s,required:m})=>e.jsxs(_e,{children:[e.jsx(T,{children:f(s)}),e.jsx(L,{id:"item-name",maxLength:50,name:s,placeholder:m?"Required":"Optional",rules:{...m?{...F,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:j,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"})})]})]})},Ae=g(T)` font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,_e=g(t)` +`,Ee=g(t)` width: 100%; display: flex; justify-content: center; @@ -104,7 +104,7 @@ import{ac as Z,w as g,x as b,F as t,H as T,E as V,r as y,j as e,z as C,aW as ee, padding-right: 20px; width: calc(100% + 20px); } -`,Ae=g(t)` +`,_e=g(t)` display: flex; gap: 10px; @@ -120,4 +120,4 @@ import{ac as Z,w as g,x as b,F as t,H as T,E as V,r as y,j as e,z as C,aW as ee, font-size: 22px; font-weight: 600; font-family: 'Barlow'; -`,$e=async(o,a,c)=>{var f;const u=Object.entries(o).reduce((n,[j,p])=>(p!=null&&p!==""&&(n[j]=p),n),{}),{nodeType:d,typeName:r,sourceLink:x,...l}=u;let h="",w="";d!=="Create custom type"&&await ue(async()=>{const n=await me.enable();w=n==null?void 0:n.pubkey,h=await he()});try{const n=await Se(d,l,x,r,h,w);c(o,(f=n==null?void 0:n.data)==null?void 0:f.ref_id)}catch(n){let j=I;if(n.status===400){const p=await n.json();j=p.message||p.errorCode||(p==null?void 0:p.status)||I}else n instanceof Error&&(j=n.message);throw new Error(j)}},Je=()=>{const[o,a]=y.useState("sourceType"),{close:c,visible:u}=O("addItem"),{open:d}=O("addType"),{setBudget:r}=V(i=>i),x=ce({mode:"onChange"}),{watch:l,setValue:h,reset:w}=x,[f,n]=y.useState(!1),[j,p]=y.useState(""),{addNewNode:s}=le(i=>i),[m]=ge(i=>[i.setSelectedNode]);y.useEffect(()=>()=>{a("sourceType"),w()},[u,w]);const S=l("nodeType"),E=l("typeName"),_=l("sourceLink"),W=l("type");l("title");const M=()=>{c()},A=i=>{p(""),a(i)},Y=(i,N)=>{const v=N||`new-id-${Math.random()}`,k=i.nodeType.toLocaleLowerCase(),X=Object.entries(i).reduce((D,[Q,z])=>(z!=null&&z!==""&&(D[Q]=z),D),{}),$={name:i.typeName??i.name,type:k,label:i.typeName??i.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,...i.source_link?{source_link:i.source_link}:{},properties:{...X}};s({nodes:[$],links:[]}),m($)},H=x.handleSubmit(async i=>{p(""),n(!0);try{await $e(i,r,Y),de("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)}}),P=i=>{i==="Create custom type"?d():h("nodeType",i)},J={sourceType:e.jsx(Me,{allowNextStep:!!S,onSelectType:P,selectedType:S,skipToStep:A}),source:e.jsx(Le,{name:E,skipToStep:A,sourceLink:_||"",type:S}),setBudget:e.jsx(Ne,{error:j,loading:f,onClick:()=>null}),createConfirmation:e.jsx(Be,{onclose:M,type:W}),setAttribues:e.jsx(Ie,{handleSelectType:P,nodeType:S,skipToStep:A})},K="small";return e.jsx(pe,{id:"addItem",kind:K,onClose:c,preventOutsideClose:!0,children:e.jsx(xe,{...x,children:e.jsx("form",{id:"add-node-form",onSubmit:H,children:J[o]})})})};export{Je as AddItemModal}; +`,$e=async(o,a,c)=>{var f;const u=Object.entries(o).reduce((n,[j,p])=>(p!=null&&p!==""&&(n[j]=p),n),{}),{nodeType:d,typeName:r,sourceLink:x,...l}=u;let h="",w="";d!=="Create custom type"&&await ue(async()=>{const n=await me.enable();w=n==null?void 0:n.pubkey,h=await he()});try{const n=await Se(d,l,x,r,h,w);c(o,(f=n==null?void 0:n.data)==null?void 0:f.ref_id)}catch(n){let j=I;if(n.status===400){const p=await n.json();j=p.message||p.errorCode||(p==null?void 0:p.status)||I}else n instanceof Error&&(j=n.message);throw new Error(j)}},Je=()=>{const[o,a]=y.useState("sourceType"),{close:c,visible:u}=O("addItem"),{open:d}=O("addType"),{setBudget:r}=V(i=>i),x=ce({mode:"onChange"}),{watch:l,setValue:h,reset:w}=x,[f,n]=y.useState(!1),[j,p]=y.useState(""),{addNewNode:s}=le(i=>i),[m]=ge(i=>[i.setSelectedNode]);y.useEffect(()=>()=>{a("sourceType"),w()},[u,w]);const S=l("nodeType"),A=l("typeName"),E=l("sourceLink"),W=l("type");l("title");const M=()=>{c()},_=i=>{p(""),a(i)},Y=(i,N)=>{const v=N||`new-id-${Math.random()}`,k=i.nodeType.toLocaleLowerCase(),X=Object.entries(i).reduce((D,[Q,z])=>(z!=null&&z!==""&&(D[Q]=z),D),{}),$={name:i.typeName??i.name,type:k,label:i.typeName??i.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,...i.source_link?{source_link:i.source_link}:{},properties:{...X}};s({nodes:[$],links:[]}),m($)},H=x.handleSubmit(async i=>{p(""),n(!0);try{await $e(i,r,Y),de("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)}}),P=i=>{i==="Create custom type"?d():h("nodeType",i)},J={sourceType:e.jsx(Me,{allowNextStep:!!S,onSelectType:P,selectedType:S,skipToStep:_}),source:e.jsx(Le,{name:A,skipToStep:_,sourceLink:E||"",type:S}),setBudget:e.jsx(Ne,{error:j,loading:f,onClick:()=>null}),createConfirmation:e.jsx(Be,{onclose:M,type:W}),setAttribues:e.jsx(Ie,{handleSelectType:P,nodeType:S,skipToStep:_})},K="small";return e.jsx(pe,{id:"addItem",kind:K,onClose:c,preventOutsideClose:!0,children:e.jsx(xe,{...x,children:e.jsx("form",{id:"add-node-form",onSubmit:H,children:J[o]})})})};export{Je as AddItemModal}; diff --git a/build/assets/map-b1c613ac.js b/build/assets/map-76fdca3a.js similarity index 98% rename from build/assets/map-b1c613ac.js rename to build/assets/map-76fdca3a.js index b2a6e6de9..e17bbef85 100644 --- a/build/assets/map-b1c613ac.js +++ b/build/assets/map-76fdca3a.js @@ -1 +1 @@ -import{c as de,d as pe,s as M,B as Ne,e as S,ag as Ge,r as U,a as ge,j as L,h as K,k as H,i as be,u as Ue,g as z,at as k,aA as T,au as B,aK as he,bM as Ke,bN as ve,ay as ye,bO as He,aE as ze,bP as ke,bQ as _e,bR as Xe,bS as Ye,bT as Ze,aH as Qe,az as Je,aG as We,bU as je,aF as me}from"./index-16ff4e55.js";import{u as Ve,b as $e,f as er,S as rr}from"./Stack-25a86e54.js";import{T as W}from"./Typography-76a3ec92.js";function ar(e){return de("PrivateSwitchBase",e)}pe("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const nr=["autoFocus","checked","checkedIcon","className","defaultChecked","disabled","disableFocusRipple","edge","icon","id","inputProps","inputRef","name","onBlur","onChange","onFocus","readOnly","required","tabIndex","type","value"],tr=e=>{const{classes:r,checked:a,disabled:n,edge:s}=e,t={root:["root",a&&"checked",n&&"disabled",s&&`edge${H(s)}`],input:["input"]};return be(t,ar,r)},sr=M(Ne)(({ownerState:e})=>S({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),ir=M("input",{shouldForwardProp:Ge})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),or=U.forwardRef(function(r,a){const{autoFocus:n,checked:s,checkedIcon:t,className:i,defaultChecked:o,disabled:l,disableFocusRipple:c=!1,edge:d=!1,icon:f,id:u,inputProps:h,inputRef:p,name:g,onBlur:b,onChange:y,onFocus:v,readOnly:O,required:$=!1,tabIndex:_,type:P,value:E}=r,A=ge(r,nr),[w,xe]=Ve({controlled:s,default:!!o,name:"SwitchBase",state:"checked"}),C=$e(),Me=m=>{v&&v(m),C&&C.onFocus&&C.onFocus(m)},Be=m=>{b&&b(m),C&&C.onBlur&&C.onBlur(m)},qe=m=>{if(m.nativeEvent.defaultPrevented)return;const J=m.target.checked;xe(J),y&&y(m,J)};let F=l;C&&typeof F>"u"&&(F=C.disabled);const De=P==="checkbox"||P==="radio",D=S({},r,{checked:w,disabled:F,disableFocusRipple:c,edge:d}),Q=tr(D);return L.jsxs(sr,S({component:"span",className:K(Q.root,i),centerRipple:!0,focusRipple:!c,disabled:F,tabIndex:null,role:void 0,onFocus:Me,onBlur:Be,ownerState:D,ref:a},A,{children:[L.jsx(ir,S({autoFocus:n,checked:s,defaultChecked:o,className:Q.input,disabled:F,id:De?u:void 0,name:g,onChange:qe,readOnly:O,ref:p,required:$,ownerState:D,tabIndex:_,type:P},P==="checkbox"&&E===void 0?{}:{value:E},h)),w?t:f]}))}),ss=or;function lr(e){return de("MuiFormControlLabel",e)}const ur=pe("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),I=ur,cr=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],fr=e=>{const{classes:r,disabled:a,labelPlacement:n,error:s,required:t}=e,i={root:["root",a&&"disabled",`labelPlacement${H(n)}`,s&&"error",t&&"required"],label:["label",a&&"disabled"],asterisk:["asterisk",s&&"error"]};return be(i,lr,r)},dr=M("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:a}=e;return[{[`& .${I.label}`]:r.label},r.root,r[`labelPlacement${H(a.labelPlacement)}`]]}})(({theme:e,ownerState:r})=>S({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${I.disabled}`]:{cursor:"default"}},r.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},r.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},r.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${I.label}`]:{[`&.${I.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),pr=M("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,r)=>r.asterisk})(({theme:e})=>({[`&.${I.error}`]:{color:(e.vars||e).palette.error.main}})),gr=U.forwardRef(function(r,a){var n,s;const t=Ue({props:r,name:"MuiFormControlLabel"}),{className:i,componentsProps:o={},control:l,disabled:c,disableTypography:d,label:f,labelPlacement:u="end",required:h,slotProps:p={}}=t,g=ge(t,cr),b=$e(),y=(n=c??l.props.disabled)!=null?n:b==null?void 0:b.disabled,v=h??l.props.required,O={disabled:y,required:v};["checked","name","onChange","value","inputRef"].forEach(w=>{typeof l.props[w]>"u"&&typeof t[w]<"u"&&(O[w]=t[w])});const $=er({props:t,muiFormControl:b,states:["error"]}),_=S({},t,{disabled:y,labelPlacement:u,required:v,error:$.error}),P=fr(_),E=(s=p.typography)!=null?s:o.typography;let A=f;return A!=null&&A.type!==W&&!d&&(A=L.jsx(W,S({component:"span"},E,{className:K(P.label,E==null?void 0:E.className),children:A}))),L.jsxs(dr,S({className:K(P.root,i),ownerState:_,ref:a},g,{children:[U.cloneElement(l,O),v?L.jsxs(rr,{display:"block",children:[A,L.jsxs(pr,{ownerState:_,"aria-hidden":!0,className:P.asterisk,children:[" ","*"]})]}):A]}))}),is=gr;var br=k,hr=T,vr=B,yr="[object String]";function _r(e){return typeof e=="string"||!hr(e)&&vr(e)&&br(e)==yr}var mr=_r;const os=z(mr);function $r(e){return function(r,a,n){for(var s=-1,t=Object(r),i=n(r),o=i.length;o--;){var l=i[e?o:++s];if(a(t[l],l,t)===!1)break}return r}}var Pr=$r,Ar=Pr,Cr=Ar(),Sr=Cr,Tr=Sr,Or=he;function wr(e,r){return e&&Tr(e,r,Or)}var Er=wr;function Lr(e){return e}var Fr=Lr,Ir=k,Rr=Ke,xr=B,Mr="[object Object]",Br=Function.prototype,qr=Object.prototype,Pe=Br.toString,Dr=qr.hasOwnProperty,Nr=Pe.call(Object);function Gr(e){if(!xr(e)||Ir(e)!=Mr)return!1;var r=Rr(e);if(r===null)return!0;var a=Dr.call(r,"constructor")&&r.constructor;return typeof a=="function"&&a instanceof a&&Pe.call(a)==Nr}var Ur=Gr;const ls=z(Ur);function Kr(e,r){for(var a=-1,n=e==null?0:e.length,s=Array(n);++ao))return!1;var c=t.get(e),d=t.get(r);if(c&&d)return c==r&&d==e;var f=-1,u=!0,h=a&ia?new aa:void 0;for(t.set(e,r),t.set(r,e);++f{const{classes:r,checked:a,disabled:n,edge:s}=e,t={root:["root",a&&"checked",n&&"disabled",s&&`edge${H(s)}`],input:["input"]};return be(t,ar,r)},sr=M(Ne)(({ownerState:e})=>S({padding:9,borderRadius:"50%"},e.edge==="start"&&{marginLeft:e.size==="small"?-3:-12},e.edge==="end"&&{marginRight:e.size==="small"?-3:-12})),ir=M("input",{shouldForwardProp:Ge})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),or=U.forwardRef(function(r,a){const{autoFocus:n,checked:s,checkedIcon:t,className:i,defaultChecked:o,disabled:l,disableFocusRipple:c=!1,edge:d=!1,icon:f,id:u,inputProps:h,inputRef:p,name:g,onBlur:b,onChange:y,onFocus:v,readOnly:O,required:$=!1,tabIndex:_,type:P,value:E}=r,A=ge(r,nr),[w,xe]=Ve({controlled:s,default:!!o,name:"SwitchBase",state:"checked"}),C=$e(),Me=m=>{v&&v(m),C&&C.onFocus&&C.onFocus(m)},Be=m=>{b&&b(m),C&&C.onBlur&&C.onBlur(m)},qe=m=>{if(m.nativeEvent.defaultPrevented)return;const J=m.target.checked;xe(J),y&&y(m,J)};let F=l;C&&typeof F>"u"&&(F=C.disabled);const De=P==="checkbox"||P==="radio",D=S({},r,{checked:w,disabled:F,disableFocusRipple:c,edge:d}),Q=tr(D);return L.jsxs(sr,S({component:"span",className:K(Q.root,i),centerRipple:!0,focusRipple:!c,disabled:F,tabIndex:null,role:void 0,onFocus:Me,onBlur:Be,ownerState:D,ref:a},A,{children:[L.jsx(ir,S({autoFocus:n,checked:s,defaultChecked:o,className:Q.input,disabled:F,id:De?u:void 0,name:g,onChange:qe,readOnly:O,ref:p,required:$,ownerState:D,tabIndex:_,type:P},P==="checkbox"&&E===void 0?{}:{value:E},h)),w?t:f]}))}),ss=or;function lr(e){return de("MuiFormControlLabel",e)}const ur=pe("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),I=ur,cr=["checked","className","componentsProps","control","disabled","disableTypography","inputRef","label","labelPlacement","name","onChange","required","slotProps","value"],fr=e=>{const{classes:r,disabled:a,labelPlacement:n,error:s,required:t}=e,i={root:["root",a&&"disabled",`labelPlacement${H(n)}`,s&&"error",t&&"required"],label:["label",a&&"disabled"],asterisk:["asterisk",s&&"error"]};return be(i,lr,r)},dr=M("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,r)=>{const{ownerState:a}=e;return[{[`& .${I.label}`]:r.label},r.root,r[`labelPlacement${H(a.labelPlacement)}`]]}})(({theme:e,ownerState:r})=>S({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${I.disabled}`]:{cursor:"default"}},r.labelPlacement==="start"&&{flexDirection:"row-reverse",marginLeft:16,marginRight:-11},r.labelPlacement==="top"&&{flexDirection:"column-reverse",marginLeft:16},r.labelPlacement==="bottom"&&{flexDirection:"column",marginLeft:16},{[`& .${I.label}`]:{[`&.${I.disabled}`]:{color:(e.vars||e).palette.text.disabled}}})),pr=M("span",{name:"MuiFormControlLabel",slot:"Asterisk",overridesResolver:(e,r)=>r.asterisk})(({theme:e})=>({[`&.${I.error}`]:{color:(e.vars||e).palette.error.main}})),gr=U.forwardRef(function(r,a){var n,s;const t=Ue({props:r,name:"MuiFormControlLabel"}),{className:i,componentsProps:o={},control:l,disabled:c,disableTypography:d,label:f,labelPlacement:u="end",required:h,slotProps:p={}}=t,g=ge(t,cr),b=$e(),y=(n=c??l.props.disabled)!=null?n:b==null?void 0:b.disabled,v=h??l.props.required,O={disabled:y,required:v};["checked","name","onChange","value","inputRef"].forEach(w=>{typeof l.props[w]>"u"&&typeof t[w]<"u"&&(O[w]=t[w])});const $=er({props:t,muiFormControl:b,states:["error"]}),_=S({},t,{disabled:y,labelPlacement:u,required:v,error:$.error}),P=fr(_),E=(s=p.typography)!=null?s:o.typography;let A=f;return A!=null&&A.type!==W&&!d&&(A=L.jsx(W,S({component:"span"},E,{className:K(P.label,E==null?void 0:E.className),children:A}))),L.jsxs(dr,S({className:K(P.root,i),ownerState:_,ref:a},g,{children:[U.cloneElement(l,O),v?L.jsxs(rr,{display:"block",children:[A,L.jsxs(pr,{ownerState:_,"aria-hidden":!0,className:P.asterisk,children:[" ","*"]})]}):A]}))}),is=gr;var br=k,hr=T,vr=B,yr="[object String]";function _r(e){return typeof e=="string"||!hr(e)&&vr(e)&&br(e)==yr}var mr=_r;const os=z(mr);function $r(e){return function(r,a,n){for(var s=-1,t=Object(r),i=n(r),o=i.length;o--;){var l=i[e?o:++s];if(a(t[l],l,t)===!1)break}return r}}var Pr=$r,Ar=Pr,Cr=Ar(),Sr=Cr,Tr=Sr,Or=he;function wr(e,r){return e&&Tr(e,r,Or)}var Er=wr;function Lr(e){return e}var Fr=Lr,Ir=k,Rr=Ke,xr=B,Mr="[object Object]",Br=Function.prototype,qr=Object.prototype,Pe=Br.toString,Dr=qr.hasOwnProperty,Nr=Pe.call(Object);function Gr(e){if(!xr(e)||Ir(e)!=Mr)return!1;var r=Rr(e);if(r===null)return!0;var a=Dr.call(r,"constructor")&&r.constructor;return typeof a=="function"&&a instanceof a&&Pe.call(a)==Nr}var Ur=Gr;const ls=z(Ur);function Kr(e,r){for(var a=-1,n=e==null?0:e.length,s=Array(n);++ao))return!1;var c=t.get(e),d=t.get(r);if(c&&d)return c==r&&d==e;var f=-1,u=!0,h=a&ia?new aa:void 0;for(t.set(e,r),t.set(r,e);++f Second Brain - +