Skip to content

Instantly share code, notes, and snippets.

@HoMeCracKeR
Last active December 2, 2025 13:16
Show Gist options
  • Select an option

  • Save HoMeCracKeR/230da683e2377c8e7a2e111af23ea8f3 to your computer and use it in GitHub Desktop.

Select an option

Save HoMeCracKeR/230da683e2377c8e7a2e111af23ea8f3 to your computer and use it in GitHub Desktop.
LAudio_script1_v2.0.21
var Kl=Object.defineProperty,Jl=Object.defineProperties;var Ql=Object.getOwnPropertyDescriptors;var Ur=Object.getOwnPropertySymbols;var sa=Object.prototype.hasOwnProperty,aa=Object.prototype.propertyIsEnumerable;var zo=(e,t,r)=>t in e?Kl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k=(e,t)=>{for(var r in t||(t={}))sa.call(t,r)&&zo(e,r,t[r]);if(Ur)for(var r of Ur(t))aa.call(t,r)&&zo(e,r,t[r]);return e},D=(e,t)=>Jl(e,Ql(t));var ia=(e,t)=>{var r={};for(var o in e)sa.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&Ur)for(var o of Ur(e))t.indexOf(o)<0&&aa.call(e,o)&&(r[o]=e[o]);return r};var Vn=(e,t,r)=>(zo(e,typeof t!="symbol"?t+"":t,r),r);var de=(e,t,r)=>new Promise((o,s)=>{var i=u=>{try{c(r.next(u))}catch(d){s(d)}},l=u=>{try{c(r.throw(u))}catch(d){s(d)}},c=u=>u.done?o(u.value):Promise.resolve(u.value).then(i,l);c((r=r.apply(e,t)).next())});import{c as At,d as kr,V as Oe,r as a,e as st,u as or,M as ec,l as se,a as Ge,b as yt,f as bt,T as St,R as ht,j as n,A as wt,s as at,C as Te,g as sr,h as tc,B as Ao,i as ar,k as nc,O as rc,I as it,m as vi,n as Jn,o as sn,p as oc,q as wn,S as is,t as Qn,P as Lo,D as sc,N as Hr,v as ac,w as ic,Q as lc,E as cc,x as uc,y as la,L as ca,H as Fn,z as Cs,F as to,G as dc,J as fc,K as xi,U as mc,W as pc,X as ua,Y as hc,Z as vc,_ as xc,$ as gc,a0 as wc,a1 as Pr,a2 as gi,a3 as yc,a4 as Ns,a5 as Ms,a6 as bc,a7 as Sc,a8 as Cc,a9 as Nc,aa as Mc}from"./vendor-7a4bd4c2.js";(function(){try{var e=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4c49ea2c-68f1-41fb-b311-cfd995f28546",e._sentryDebugIdIdentifier="sentry-dbid-4c49ea2c-68f1-41fb-b311-cfd995f28546")}catch(r){}})();(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))o(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function r(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function o(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();const wi="BEAM",yi="Lunacy Audio",bi="com.lunacy.audio.beam",Si="Luna",Ci="proC",Ni={width:1280,height:720,maxWidth:1920,maxHeight:1080,minWidth:1024,minHeight:576,resizable:!0,preserveAspectRatio:!0},Mi=1,ji=[{paramId:"timeAStretch",name:"TimeA Global Stretch",displayName:"Stretch",min:0,max:1,step:.01,skew:1,defaultValue:.5,toggleId:"timeAStretchSyncEnabled",toggleOff:"timeStretchPlaybackSpeed",toggleOn:"timeStretchSync",node:"timeA",tooltip:"Globally modify the speed of each section",version:6},{paramId:"timeBStretch",name:"TimeB Global Stretch",displayName:"Stretch",min:0,max:1,step:.01,skew:1,defaultValue:.5,toggleId:"timeBStretchSyncEnabled",toggleOff:"timeStretchPlaybackSpeed",toggleOn:"timeStretchSync",node:"timeB",tooltip:"Globally modify the speed of each section",version:6},{paramId:"timeCStretch",name:"timeC Global Stretch",displayName:"Stretch",min:0,max:1,step:.01,skew:1,defaultValue:.5,toggleId:"timeCStretchSyncEnabled",toggleOff:"timeStretchPlaybackSpeed",toggleOn:"timeStretchSync",node:"timeC",tooltip:"Globally modify the speed of each section",version:6},{paramId:"timeAFreeze",name:"TimeA Freeze",displayName:"Freeze",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"timeA",tooltip:"Block incoming signal from overwriting audio in the buffer",isModulatable:!1},{paramId:"timeBFreeze",name:"TimeB Freeze",displayName:"Freeze",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"timeB",tooltip:"Block incoming signal from overwriting audio in the buffer",isModulatable:!1},{paramId:"timeCFreeze",name:"TimeC Freeze",displayName:"Freeze",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"timeC",tooltip:"Block incoming signal from overwriting audio in the buffer",isModulatable:!1},{paramId:"timeAStretchSyncEnabled",name:"TimeA Global Stretch Sync",displayName:"Global Stretch Sync",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"timeA",tooltip:"Toggle tempo sync for global stretch",isModulatable:!1},{paramId:"timeBStretchSyncEnabled",name:"TimeB Global Stretch Sync",displayName:"Global Stretch Sync",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"timeB",tooltip:"Toggle tempo sync for global stretch",isModulatable:!1},{paramId:"timeCStretchSyncEnabled",name:"TimeC Global Stretch Sync",displayName:"Global Stretch Sync",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"timeC",tooltip:"Toggle tempo sync for global stretch",isModulatable:!1},{paramId:"timeALoopMode",name:"TimeA LoopMode",displayName:"LoopMode",min:0,max:3,step:1,skew:1,defaultValue:1,strRepr:["Stop","Repeat","Reverse","Free"],node:"timeA",tooltip:"Control how to read the buffer without enough input",isModulatable:!1},{paramId:"timeBLoopMode",name:"TimeB LoopMode",displayName:"LoopMode",min:0,max:3,step:1,skew:1,defaultValue:1,strRepr:["Stop","Repeat","Reverse","Free"],node:"timeB",tooltip:"Control how to read the buffer without enough input",isModulatable:!1},{paramId:"timeCLoopMode",name:"TimeC LoopMode",displayName:"LoopMode",min:0,max:3,step:1,skew:1,defaultValue:1,strRepr:["Stop","Repeat","Reverse","Free"],node:"timeC",tooltip:"Control how to read the buffer without enough input",isModulatable:!1},{paramId:"timeADuration",name:"TimeA Duration",displayName:"Duration",min:0,max:1,step:.01,skew:1,defaultValue:.25,toggleId:"timeADurationSyncEnabled",toggleOff:"timeDurationSeconds",toggleOn:"timeDurationSync",node:"timeA",tooltip:"Adjust the length of the time node audio buffer",version:6},{paramId:"timeBDuration",name:"TimeB Duration",displayName:"Duration",min:0,max:1,step:.01,skew:1,defaultValue:.25,toggleId:"timeBDurationSyncEnabled",toggleOff:"timeDurationSeconds",toggleOn:"timeDurationSync",node:"timeB",tooltip:"Adjust the length of the time node audio buffer",version:6},{paramId:"timeCDuration",name:"TimeC Duration",displayName:"Duration",min:0,max:1,step:.01,skew:1,defaultValue:.25,toggleId:"timeCDurationSyncEnabled",toggleOff:"timeDurationSeconds",toggleOn:"timeDurationSync",node:"timeC",tooltip:"Adjust the length of the time node audio buffer",version:6},{paramId:"timeADurationSyncEnabled",name:"TimeA Duration Sync",displayName:"Duration Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"timeA",tooltip:"Toggle tempo sync for duration",isModulatable:!1},{paramId:"timeBDurationSyncEnabled",name:"TimeB Duration Sync",displayName:"Duration Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"timeB",tooltip:"Toggle tempo sync for duration",isModulatable:!1},{paramId:"timeCDurationSyncEnabled",name:"TimeC Duration Sync",displayName:"Duration Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"timeC",tooltip:"Toggle tempo sync for duration",isModulatable:!1},{paramId:"timeAGrainSize",name:"TimeA Size",displayName:"Size",min:0,max:1,step:.01,skew:1,defaultValue:.53,toggleId:"timeAGrainSizeTempoSyncEnabled",toggleOff:"timeGrainSizeMs",toggleOn:"timeGrainSizeSync",node:"timeA",tooltip:"Control the grain size in texture mode",version:6},{paramId:"timeBGrainSize",name:"TimeB Size",displayName:"Size",min:0,max:1,step:.01,skew:1,defaultValue:.53,toggleId:"timeBGrainSizeTempoSyncEnabled",toggleOff:"timeGrainSizeMs",toggleOn:"timeGrainSizeSync",node:"timeB",tooltip:"Control the grain size in texture mode",version:6},{paramId:"timeCGrainSize",name:"TimeC Size",displayName:"Size",min:0,max:1,step:.01,skew:1,defaultValue:.53,toggleId:"timeCGrainSizeTempoSyncEnabled",toggleOff:"timeGrainSizeMs",toggleOn:"timeGrainSizeSync",node:"timeC",tooltip:"Control the grain size in texture mode",version:6},{paramId:"timeAGrainSizeTempoSyncEnabled",name:"TimeA Size Sync",displayName:"Size Sync",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"timeA",tooltip:"Toggle tempo sync for grain size",isModulatable:!1},{paramId:"timeBGrainSizeTempoSyncEnabled",name:"TimeB Size Sync",displayName:"Size Sync",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"timeB",tooltip:"Toggle tempo sync for grain size",isModulatable:!1},{paramId:"timeCGrainSizeTempoSyncEnabled",name:"TimeC Size Sync",displayName:"Size Sync",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"timeC",tooltip:"Toggle tempo sync for grain size",isModulatable:!1},{paramId:"timeAStretchMode",name:"TimeA StretchMode",displayName:"StretchMode",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["Resample","Texture"],node:"timeA",tooltip:"Choose texture mode to decouple speed and pitch",isModulatable:!1},{paramId:"timeBStretchMode",name:"TimeB StretchMode",displayName:"StretchMode",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["Resample","Texture"],node:"timeB",tooltip:"Choose texture mode to decouple speed and pitch",isModulatable:!1},{paramId:"timeCStretchMode",name:"TimeC StretchMode",displayName:"StretchMode",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["Resample","Texture"],node:"timeC",tooltip:"Choose texture mode to decouple speed and pitch",isModulatable:!1},{paramId:"timeASmoothing",name:"TimeA Smoothing",displayName:"Smooth",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"timeA",tooltip:"Minimizes clicks caused by discontinuities in the graph",isModulatable:!1},{paramId:"timeBSmoothing",name:"TimeB Smoothing",displayName:"Smooth",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"timeB",tooltip:"Minimizes clicks caused by discontinuities in the graph",isModulatable:!1},{paramId:"timeCSmoothing",name:"TimeC Smoothing",displayName:"Smooth",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"timeC",tooltip:"Minimizes clicks caused by discontinuities in the graph",isModulatable:!1},{paramId:"timeAMix",name:"TimeA Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"timeA",tooltip:"Set balance for dry and wet signal for this node",version:6},{paramId:"timeBMix",name:"TimeB Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"timeB",tooltip:"Set balance for dry and wet signal for this node",version:6},{paramId:"timeCMix",name:"timeC Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"timeC",tooltip:"Set balance for dry and wet signal for this node",version:6},{paramId:"voltAColor",name:"VoltA Color",displayName:"Color",min:0,max:100,step:.01,skew:1,defaultValue:50,bipolar:!1,suffix:"%",node:"voltA",tooltip:"Adjust brightness of distortion",version:7},{paramId:"voltBColor",name:"VoltB Color",displayName:"Color",min:0,max:100,step:.01,skew:1,defaultValue:50,bipolar:!1,suffix:"%",node:"voltB",tooltip:"Adjust brightness of distortion",version:7},{paramId:"voltCColor",name:"VoltC Color",displayName:"Color",min:0,max:100,step:.01,skew:1,defaultValue:50,bipolar:!1,suffix:"%",node:"voltC",tooltip:"Adjust brightness of distortion",version:7},{paramId:"voltAContour",name:"VoltA Contour",displayName:"Contour",min:0,max:100,step:.01,skew:1,defaultValue:50,bipolar:!1,suffix:"%",node:"voltA",tooltip:"Boost or reduce midrange focus",version:7},{paramId:"voltBContour",name:"VoltB Contour",displayName:"Contour",min:0,max:100,step:.01,skew:1,defaultValue:50,bipolar:!1,suffix:"%",node:"voltB",tooltip:"Boost or reduce midrange focus",version:7},{paramId:"voltCContour",name:"VoltC Contour",displayName:"Contour",min:0,max:100,step:.01,skew:1,defaultValue:50,bipolar:!1,suffix:"%",node:"voltC",tooltip:"Boost or reduce midrange focus",version:7},{paramId:"voltADepth",name:"VoltA Depth",displayName:"Depth",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"voltA",tooltip:"Control overall effect intensity",version:7},{paramId:"voltBDepth",name:"VoltB Depth",displayName:"Depth",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"voltB",tooltip:"Control overall effect intensity",version:7},{paramId:"voltCDepth",name:"VoltC Depth",displayName:"Depth",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"voltC",tooltip:"Control overall effect intensity",version:7},{paramId:"voltAHeat",name:"VoltA Heat",displayName:"Heat",min:0,max:1,step:.01,skew:1,defaultValue:.25,suffix:"",node:"voltA",tooltip:"Dial in tube-like saturation",version:7},{paramId:"voltBHeat",name:"VoltB Heat",displayName:"Heat",min:0,max:1,step:.01,skew:1,defaultValue:.25,suffix:"",node:"voltB",tooltip:"Dial in tube-like saturation",version:7},{paramId:"voltCHeat",name:"VoltC Heat",displayName:"Heat",min:0,max:1,step:.01,skew:1,defaultValue:.25,suffix:"",node:"voltC",tooltip:"Dial in tube-like saturation",version:7},{paramId:"voltACharge",name:"VoltA Charge",displayName:"Charge",min:0,max:1,step:.01,skew:1,defaultValue:.15,suffix:"",node:"voltA",tooltip:"Add multi-band compression shimmer",version:7},{paramId:"voltBCharge",name:"VoltB Charge",displayName:"Charge",min:0,max:1,step:.01,skew:1,defaultValue:.15,suffix:"",node:"voltB",tooltip:"Add multi-band compression shimmer",version:7},{paramId:"voltCCharge",name:"VoltC Charge",displayName:"Charge",min:0,max:1,step:.01,skew:1,defaultValue:.15,suffix:"",node:"voltC",tooltip:"Add multi-band compression shimmer",version:7},{paramId:"voltACrush",name:"VoltA Crush",displayName:"Crush",min:0,max:1,step:.01,skew:1,defaultValue:0,suffix:"",node:"voltA",tooltip:"Inject digital bit reduction",version:7},{paramId:"voltBCrush",name:"VoltB Crush",displayName:"Crush",min:0,max:1,step:.01,skew:1,defaultValue:0,suffix:"",node:"voltB",tooltip:"Inject digital bit reduction",version:7},{paramId:"voltCCrush",name:"VoltC Crush",displayName:"Crush",min:0,max:1,step:.01,skew:1,defaultValue:0,suffix:"",node:"voltC",tooltip:"Inject digital bit reduction",version:7},{paramId:"voltAFDNDiffusion",name:"VoltA FDNDiffusion",displayName:"Diffusion",min:0,max:1,step:.01,skew:1,defaultValue:0,suffix:"",node:"voltA",tooltip:"Soften or spread feedback tones",version:7},{paramId:"voltBFDNDiffusion",name:"VoltB FDNDiffusion",displayName:"Diffusion",min:0,max:1,step:.01,skew:1,defaultValue:0,suffix:"",node:"voltB",tooltip:"Soften or spread feedback tones",version:7},{paramId:"voltCFDNDiffusion",name:"VoltC FDNDiffusion",displayName:"Diffusion",min:0,max:1,step:.01,skew:1,defaultValue:0,suffix:"",node:"voltC",tooltip:"Soften or spread feedback tones",version:7},{paramId:"voltAFDNScatter",name:"VoltA FDNScatter",displayName:"Scatter",min:0,max:1,step:.01,skew:1,defaultValue:0,suffix:"",node:"voltA",tooltip:"Offset feedback for unpredictable tails",version:7},{paramId:"voltBFDNScatter",name:"VoltB FDNScatter",displayName:"Scatter",min:0,max:1,step:.01,skew:1,defaultValue:0,suffix:"",node:"voltB",tooltip:"Offset feedback for unpredictable tails",version:7},{paramId:"voltCFDNScatter",name:"VoltC FDNScatter",displayName:"Scatter",min:0,max:1,step:.01,skew:1,defaultValue:0,suffix:"",node:"voltC",tooltip:"Offset feedback for unpredictable tails",version:7},{paramId:"voltAFDNTune",name:"VoltA FDNFreq",displayName:"Freq",min:4,max:4e3,step:.01,skew:.25,defaultValue:32,suffix:"Hz",node:"voltA",tooltip:"Set feedback delay frequency",version:7},{paramId:"voltBFDNTune",name:"VoltB FDNFreq",displayName:"Freq",min:4,max:4e3,step:.01,skew:.25,defaultValue:32,suffix:"Hz",node:"voltB",tooltip:"Set feedback delay frequency",version:7},{paramId:"voltCFDNTune",name:"VoltC FDNFreq",displayName:"Freq",min:4,max:4e3,step:.01,skew:.25,defaultValue:32,suffix:"Hz",node:"voltC",tooltip:"Set feedback delay frequency",version:7},{paramId:"voltAFDNOpen",name:"VoltA FDNOpen",displayName:"Open",min:0,max:1,step:.01,skew:1,defaultValue:.5,suffix:"",node:"voltA",tooltip:"Increase feedback resonance time",version:7},{paramId:"voltBFDNOpen",name:"VoltB FDNOpen",displayName:"Open",min:0,max:1,step:.01,skew:1,defaultValue:.5,suffix:"",node:"voltB",tooltip:"Increase feedback resonance time",version:7},{paramId:"voltCFDNOpen",name:"VoltC FDNOpen",displayName:"Open",min:0,max:1,step:.01,skew:1,defaultValue:.5,suffix:"",node:"voltC",tooltip:"Increase feedback resonance time",version:7},{paramId:"chorusADensity",name:"HazeA Density",displayName:"Density",min:0,max:1,step:.005,skew:1,defaultValue:.5,suffix:"",node:"chorusA",tooltip:"Set density of chorus network",version:10},{paramId:"chorusBDensity",name:"HazeB Density",displayName:"Density",min:0,max:1,step:.005,skew:1,defaultValue:.5,suffix:"",node:"chorusB",tooltip:"Set density of chorus network",version:10},{paramId:"chorusCDensity",name:"HazeC Density",displayName:"Density",min:0,max:1,step:.005,skew:1,defaultValue:.5,suffix:"",node:"chorusC",tooltip:"Set density of chorus network",version:10},{paramId:"chorusAScale",name:"HazeA Time Scale",displayName:"Scale",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"chorusA",tooltip:"Set time scale",version:10},{paramId:"chorusBScale",name:"HazeB Time Scale",displayName:"Scale",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"chorusB",tooltip:"Set time scale",version:10},{paramId:"chorusCScale",name:"HazeC Time Scale",displayName:"Scale",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"chorusC",tooltip:"Set time scale",version:10},{paramId:"chorusASpread",name:"HazeA Spread",displayName:"Spread",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"chorusA",tooltip:"Set spread of delay lines in time and space",version:10},{paramId:"chorusBSpread",name:"HazeB Spread",displayName:"Spread",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"chorusB",tooltip:"Set spread of delay lines in time and space",version:10},{paramId:"chorusCSpread",name:"HazeC Spread",displayName:"Spread",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"chorusC",tooltip:"Set spread of delay lines in time and space",version:10},{paramId:"chorusADecay",name:"HazeA Decay",displayName:"Decay",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"chorusA",tooltip:"Set decay of diffusion",version:10},{paramId:"chorusBDecay",name:"HazeB Decay",displayName:"Decay",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"chorusB",tooltip:"Set decay of diffusion",version:10},{paramId:"chorusCDecay",name:"HazeC Decay",displayName:"Decay",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"chorusC",tooltip:"Set decay of diffusion",version:10},{paramId:"chorusAMix",name:"HazeA Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"chorusA",tooltip:"Set balance for dry and wet signal for this node",version:10},{paramId:"chorusBMix",name:"HazeB Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"chorusB",tooltip:"Set balance for dry and wet signal for this node",version:10},{paramId:"chorusCMix",name:"HazeC Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"chorusC",tooltip:"Set balance for dry and wet signal for this node",version:10},{paramId:"chorusAMotion",name:"HazeA Motion",displayName:"Motion",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"chorusA",tooltip:"",version:10},{paramId:"chorusBMotion",name:"HazeB Motion",displayName:"Motion",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"chorusB",tooltip:"",version:10},{paramId:"chorusCMotion",name:"HazeC Motion",displayName:"Motion",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"chorusC",tooltip:"",version:10},{paramId:"chorusAGlide",name:"HazeA Glide",displayName:"Glide",min:1,max:250,step:.1,skew:1,defaultValue:200,suffix:"ms",node:"chorusA",tooltip:"",version:10},{paramId:"chorusBGlide",name:"HazeB Glide",displayName:"Glide",min:1,max:250,step:.1,skew:1,defaultValue:200,suffix:"ms",node:"chorusB",tooltip:"",version:10},{paramId:"chorusCGlide",name:"HazeC Glide",displayName:"Glide",min:1,max:250,step:.1,skew:1,defaultValue:200,suffix:"ms",node:"chorusC",tooltip:"",version:10},{paramId:"chorusAMotionDepth",name:"HazeA Motion Depth",displayName:"Depth",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"chorusA",tooltip:"",version:10},{paramId:"chorusBMotionDepth",name:"HazeB Motion Depth",displayName:"Depth",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"chorusB",tooltip:"",version:10},{paramId:"chorusCMotionDepth",name:"HazeC Motion Depth",displayName:"Depth",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"chorusC",tooltip:"",version:10},{paramId:"chorusASmearFreq",name:"HazeA Smear Freq",displayName:"Freq",min:32.7,max:12544,step:.001,skew:.25,defaultValue:32.7,suffix:"Hz",node:"chorusA",tooltip:"Set center frequency of smear filter",version:10},{paramId:"chorusBSmearFreq",name:"HazeB Smear Freq",displayName:"Freq",min:32.7,max:12544,step:.001,skew:.25,defaultValue:32.7,suffix:"Hz",node:"chorusB",tooltip:"Set center frequency of smear filter",version:10},{paramId:"chorusCSmearFreq",name:"HazeC Smear Freq",displayName:"Freq",min:32.7,max:12544,step:.001,skew:.25,defaultValue:32.7,suffix:"Hz",node:"chorusC",tooltip:"Set center frequency of smear filter",version:10},{paramId:"chorusASmearQ",name:"HazeA Smear Q",displayName:"Q",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"chorusA",tooltip:"Set Q of smear filter",version:10},{paramId:"chorusBSmearQ",name:"HazeB Smear Q",displayName:"Q",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"chorusB",tooltip:"Set Q of smear filter",version:10},{paramId:"chorusCSmearQ",name:"HazeC Smear Q",displayName:"Q",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"chorusC",tooltip:"Set Q of smear filter",version:10},{paramId:"chorusASmearEnabled",name:"HazeA Smear Enabled",displayName:"Smear Enabled",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"chorusA",tooltip:"Bypass smear filter",version:10,isModulatable:!1},{paramId:"chorusBSmearEnabled",name:"HazeB Smear Enabled",displayName:"Smear Enabled",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"chorusB",tooltip:"Bypass smear filter",version:10,isModulatable:!1},{paramId:"chorusCSmearEnabled",name:"HazeC Smear Enabled",displayName:"Smear Enabled",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"chorusC",tooltip:"Bypass smear filter",version:10,isModulatable:!1},{paramId:"convAMix",name:"SpaceA Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"convA",tooltip:"Set balance for dry and wet signal for this node"},{paramId:"convALFOAmount",name:"SpaceA Motion Depth",displayName:"Depth",min:-100,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",bipolar:!0,node:"convA",tooltip:"Adjust amount of modulation on the node mix"},{paramId:"convALFORate",name:"SpaceA Motion Rate",displayName:"Rate",min:0,max:1,step:.01,skew:1,defaultValue:.16,toggleId:"convALFOTempoSyncEnabled",toggleOff:"lfoRateHz",toggleOn:"lfoRateSync",node:"convA",tooltip:"Set speed of LFO"},{paramId:"convALFOTempoSyncEnabled",name:"SpaceA Motion Sync",displayName:"Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convA",tooltip:"Toggle tempo sync for LFO rate",isModulatable:!1},{paramId:"convALFOPhase",name:"SpaceA Motion Phase",displayName:"Phase",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"convA",tooltip:"Set phase amount for LFO"},{paramId:"convALFORandom",name:"SpaceA Motion Random",displayName:"Random",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"convA",tooltip:"Set random offset for LFO"},{paramId:"convALFOSmoothing",name:"SpaceA Motion Smoothing",displayName:"Smooth",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",isModulatable:!1,node:"convA",tooltip:"Set smoothing applied to LFO"},{paramId:"convAPreDelay",name:"SpaceA Predelay",displayName:"Predelay",min:0,max:1,step:.01,skew:1,defaultValue:0,toggleId:"convAPreDelSyncEnabled",toggleOff:"convPreDelayMs",toggleOn:"convPreDelaySync",node:"convA",tooltip:"Set time between input sound and wet signal"},{paramId:"convAPreDelSyncEnabled",name:"SpaceA Predelay Sync",displayName:"Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convA",tooltip:"Toggle tempo sync for predelay",isModulatable:!1},{paramId:"convAPreDelSmoothEnabled",name:"SpaceA Predelay Smooth",displayName:"Smooth",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"convA",tooltip:"Toggle smoothing for predelay",version:5,isModulatable:!1},{paramId:"convBMix",name:"SpaceB Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"convB",tooltip:"Set balance for dry and wet signal for this node"},{paramId:"convBLFOAmount",name:"SpaceB Motion Depth",displayName:"Depth",min:-100,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",bipolar:!0,node:"convB",tooltip:"Adjust amount of modulation on the node mix"},{paramId:"convBLFORate",name:"SpaceB Motion Rate",displayName:"Rate",min:0,max:1,step:.01,skew:1,defaultValue:.16,toggleId:"convBLFOTempoSyncEnabled",toggleOff:"lfoRateHz",toggleOn:"lfoRateSync",node:"convB",tooltip:"Set speed of LFO"},{paramId:"convBLFOTempoSyncEnabled",name:"SpaceB Motion Sync",displayName:"Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convB",tooltip:"Toggle tempo sync for LFO rate",isModulatable:!1},{paramId:"convBLFOPhase",name:"SpaceB Motion Phase",displayName:"Phase",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"convB",tooltip:"Set phase amount for LFO"},{paramId:"convBLFORandom",name:"SpaceB Motion Random",displayName:"Random",min:0,max:100,step:.01,isModulatable:!1,skew:1,defaultValue:0,suffix:"%",node:"convB",tooltip:"Set random offset for LFO"},{paramId:"convBLFOSmoothing",name:"SpaceB Motion Smoothing",displayName:"Smooth",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",isModulatable:!1,node:"convB",tooltip:"Set smoothing applied to LFO"},{paramId:"convBPreDelay",name:"SpaceB Predelay",displayName:"Predelay",min:0,max:1,step:.01,skew:1,defaultValue:0,toggleId:"convBPreDelSyncEnabled",toggleOff:"convPreDelayMs",toggleOn:"convPreDelaySync",node:"convB",tooltip:"Set time between input sound and wet signal"},{paramId:"convBPreDelSyncEnabled",name:"SpaceB Predelay Sync",displayName:"Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convB",tooltip:"Toggle tempo sync for predelay",isModulatable:!1},{paramId:"convBPreDelSmoothEnabled",name:"SpaceB Predelay Smooth",displayName:"Smooth",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"convB",tooltip:"Toggle smoothing for predelay",version:5,isModulatable:!1},{paramId:"convCMix",name:"SpaceC Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:50,suffix:"%",node:"convC",tooltip:"Set balance for dry and wet signal for this node"},{paramId:"convCLFOAmount",name:"SpaceC Motion Depth",displayName:"Depth",min:-100,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",bipolar:!0,node:"convC",tooltip:"Adjust amount of modulation on the node mix"},{paramId:"convCLFORate",name:"SpaceC Motion Rate",displayName:"Rate",min:0,max:1,step:.01,skew:1,defaultValue:.16,toggleId:"convCLFOTempoSyncEnabled",toggleOff:"lfoRateHz",toggleOn:"lfoRateSync",node:"convC",tooltip:"Set speed of LFO"},{paramId:"convCLFOTempoSyncEnabled",name:"SpaceC Motion Sync",displayName:"Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convC",tooltip:"Toggle tempo sync for LFO rate",isModulatable:!1},{paramId:"convCLFOPhase",name:"SpaceC Motion Phase",displayName:"Phase",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"convC",tooltip:"Set phase amount for LFO"},{paramId:"convCLFORandom",name:"SpaceC Motion Random",displayName:"Random",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",isModulatable:!1,node:"convC",tooltip:"Set random offset for LFO"},{paramId:"convCLFOSmoothing",name:"SpaceC Motion Smoothing",displayName:"Smooth",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"convC",tooltip:"Set smoothing applied to LFO"},{paramId:"convCPreDelay",name:"SpaceC Predelay",displayName:"Predelay",min:0,max:1,step:.01,skew:1,defaultValue:0,toggleId:"convCPreDelSyncEnabled",toggleOff:"convPreDelayMs",toggleOn:"convPreDelaySync",node:"convC",tooltip:"Set time between input sound and wet signal"},{paramId:"convCPreDelSyncEnabled",name:"SpaceC Predelay Sync",displayName:"Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convC",tooltip:"Toggle tempo sync for predelay",isModulatable:!1},{paramId:"convCPreDelSmoothEnabled",name:"SpaceC Predelay Smooth",displayName:"Smooth",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"convC",tooltip:"Toggle smoothing for predelay",version:5,isModulatable:!1},{paramId:"filterACutoff",name:"FilterA Cutoff",displayName:"Cutoff",min:20,max:2e4,step:0,skew:.25,defaultValue:1e3,toggleId:"filterACutoffNoteSnapEnabled",toggleOff:"filterCutoffHz",toggleOn:"filterCutoffNote",suffix:"Hz",node:"filterA",tooltip:"Set cutoff frequency for filter"},{paramId:"filterACutoffNoteSnapEnabled",name:"FilterA Cutoff Snap",displayName:"Snap To Note",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"filterA",tooltip:"Toggle cutoff snap to note",isModulatable:!1,version:9},{paramId:"filterAQ",name:"FilterA Q",displayName:"Q",min:.1,max:14,step:0,skew:.3,defaultValue:.707,node:"filterA",tooltip:"Adjust resonance for filter"},{paramId:"filterAStereo",name:"FilterA Stereo",displayName:"Stereo",min:-100,max:100,step:0,skew:1,defaultValue:0,suffix:"%",node:"filterA",tooltip:"Stereo offset of the cutoff frequency",bipolar:!0,version:5},{paramId:"filterAGain",name:"FilterA Gain",displayName:"Gain",min:-24,max:24,step:0,skew:1,defaultValue:6,suffix:"db",node:"filterA",tooltip:"Gain for shelving and bell filters",bipolar:!0,version:8},{paramId:"filterBCutoff",name:"FilterB Cutoff",displayName:"Cutoff",min:20,max:2e4,step:0,skew:.25,defaultValue:1e3,toggleId:"filterBCutoffNoteSnapEnabled",toggleOff:"filterCutoffHz",toggleOn:"filterCutoffNote",suffix:"Hz",node:"filterB",tooltip:"Set cutoff frequency for filter"},{paramId:"filterBCutoffNoteSnapEnabled",name:"FilterB Cutoff Snap",displayName:"Snap To Note",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"filterB",tooltip:"Toggle cutoff snap to note",isModulatable:!1,version:9},{paramId:"filterBQ",name:"FilterB Q",displayName:"Q",min:.1,max:14,step:0,skew:.3,defaultValue:.707,node:"filterB",tooltip:"Adjust resonance for filter"},{paramId:"filterBStereo",name:"FilterB Stereo",displayName:"Stereo",min:-100,max:100,step:0,skew:1,defaultValue:0,suffix:"%",node:"filterB",tooltip:"Stereo offset of the cutoff frequency",bipolar:!0,version:5},{paramId:"filterBGain",name:"FilterB Gain",displayName:"Gain",min:-24,max:24,step:0,skew:1,defaultValue:6,suffix:"db",node:"filterB",tooltip:"Gain for shelving and bell filters",bipolar:!0,version:8},{paramId:"filterCCutoff",name:"FilterC Cutoff",displayName:"Cutoff",min:20,max:2e4,step:0,skew:.25,defaultValue:1e3,toggleId:"filterCCutoffNoteSnapEnabled",toggleOff:"filterCutoffHz",toggleOn:"filterCutoffNote",suffix:"Hz",node:"filterC",tooltip:"Set cutoff frequency for filter"},{paramId:"filterCCutoffNoteSnapEnabled",name:"FilterC Cutoff Snap",displayName:"Snap To Note",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"filterC",tooltip:"Toggle cutoff snap to note",isModulatable:!1,version:9},{paramId:"filterCQ",name:"FilterC Q",displayName:"Q",min:.1,max:14,step:0,skew:.3,defaultValue:.707,node:"filterC",tooltip:"Adjust resonance for filter"},{paramId:"filterCStereo",name:"FilterC Stereo",displayName:"Stereo",min:-100,max:100,step:0,skew:1,defaultValue:0,suffix:"%",node:"filterC",tooltip:"Stereo offset of the cutoff frequency",bipolar:!0,version:5},{paramId:"filterCGain",name:"FilterC Gain",displayName:"Gain",min:-24,max:24,step:0,skew:1,defaultValue:6,suffix:"db",node:"filterC",tooltip:"Gain for shelving and bell filters",bipolar:!0,version:8},{paramId:"filterDCutoff",name:"FilterD Cutoff",displayName:"Cutoff",min:20,max:2e4,step:0,skew:.25,defaultValue:1e3,toggleId:"filterDCutoffNoteSnapEnabled",toggleOff:"filterCutoffHz",toggleOn:"filterCutoffNote",suffix:"Hz",node:"filterD",tooltip:"Set cutoff frequency for filter"},{paramId:"filterDCutoffNoteSnapEnabled",name:"FilterD Cutoff Snap",displayName:"Snap To Note",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"filterD",tooltip:"Toggle cutoff snap to note",isModulatable:!1,version:9},{paramId:"filterDQ",name:"FilterD Q",displayName:"Q",min:.1,max:14,step:0,skew:.3,defaultValue:.707,node:"filterD",tooltip:"Adjust resonance for filter"},{paramId:"filterDStereo",name:"FilterD Stereo",displayName:"Stereo",min:-100,max:100,step:0,skew:1,defaultValue:0,suffix:"%",node:"filterD",tooltip:"Stereo offset of the cutoff frequency",bipolar:!0,version:5},{paramId:"filterDGain",name:"FilterD Gain",displayName:"Gain",min:-24,max:24,step:0,skew:1,defaultValue:6,suffix:"db",node:"filterD",tooltip:"Gain for shelving and bell filters",bipolar:!0,version:8},{paramId:"grainARateTempoSyncEnabled",name:"GrainA Rate Sync",displayName:"Sync",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"grainA",tooltip:"Toggle tempo sync for rate",isModulatable:!1},{paramId:"grainARate",name:"GrainA Rate",displayName:"Rate",min:0,max:1,step:.01,skew:1,defaultValue:.2474358297,toggleId:"grainARateTempoSyncEnabled",toggleOff:"grainRateHz",toggleOn:"grainRateSync",node:"grainA",tooltip:"Set speed in which grains are emitted"},{paramId:"grainARandomRate",name:"GrainA Random Rate",displayName:"Random Rate",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainA",tooltip:"Offset rate by random amount"},{paramId:"grainASize",name:"GrainA Size",displayName:"Size",min:0,max:1,step:.01,skew:1,defaultValue:.7,toggleId:"grainARateSizeLink",toggleOff:"grainSizeMs",toggleOn:"grainSizeSync",node:"grainA",tooltip:"Set duration of grain"},{paramId:"grainARateSizeLink",name:"GrainA Rate/Size Link",displayName:"Link Rate/Size",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["FREE","LINKED"],node:"grainA",tooltip:"Link rate and size",isModulatable:!1},{paramId:"grainASpray",name:"GrainA Spray",displayName:"Spray",min:0,max:1e3,step:.01,skew:1,defaultValue:0,suffix:"ms",node:"grainA",tooltip:"Offset grain postion by random amount"},{paramId:"grainAPitch",name:"GrainA Pitch",displayName:"Pitch",min:-24,max:24,step:1,skew:1,defaultValue:0,node:"grainA",tooltip:"Set grain pitch in semitones"},{paramId:"grainAWindowType",name:"GrainA Shape",displayName:"Shape",min:0,max:5,step:1,skew:1,defaultValue:1,strRepr:["Rectangle","Triangle","Round","Shelf","Slope Down","Slope Up"],node:"grainA",tooltip:"Set amplitude curve applied to grains"},{paramId:"grainARandomPan",name:"GrainA Width",displayName:"Width",min:0,max:200,step:.01,skew:1,defaultValue:100,suffix:"%",node:"grainA",tooltip:"Set random pan for each grain"},{paramId:"grainARandomSize",name:"GrainA Random Size",displayName:"Random Size",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainA",tooltip:"Offset size by random amount"},{paramId:"grainARevProb",name:"GrainA Reverse",displayName:"Reverse",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainA",tooltip:"Set random probability of reverse for each grain"},{paramId:"grainADetune",name:"GrainA Detune",displayName:"Detune",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainA",tooltip:"Set random detune for each grain"},{paramId:"grainAArp",name:"GrainA Arp",displayName:"Arp",min:0,max:9,step:1,skew:1,defaultValue:0,strRepr:["Off","Octaves","Power","Zigzag","Penta","Major","Minor","Whole","Cluster","Random"],node:"grainA",tooltip:"Arpeggiate grain pitch with preset patterns"},{paramId:"grainADelayTempoSyncEnabled",name:"GrainA Delay Sync",displayName:"Delay Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"grainA",tooltip:"Toggle tempo sync for delay time",isModulatable:!1},{paramId:"grainADelaySmoothEnabled",name:"GrainA Delay Smooth",displayName:"Delay Smooth",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"grainA",tooltip:"Toggle smoothing for delay time",version:5,isModulatable:!1},{paramId:"grainADelay",name:"GrainA Delay",displayName:"Delay",min:0,max:1,step:.01,skew:1,defaultValue:.71,toggleId:"grainADelayTempoSyncEnabled",toggleOff:"grainDelayMs",toggleOn:"grainDelaySync",node:"grainA",tooltip:"Adjust delay time"},{paramId:"grainADelayFeedback",name:"GrainA Feedback",displayName:"Feedback",min:0,max:99,step:.01,skew:1,defaultValue:50,suffix:"%",node:"grainA",tooltip:"Set amount of delayed signal that feeds back into delay"},{paramId:"grainADelayLowcut",name:"GrainA Delay Lowcut",displayName:"Lowcut",min:20,max:2e4,step:.01,skew:.25,defaultValue:20,suffix:"Hz",node:"grainA",tooltip:"Set low cut for delayed signal"},{paramId:"grainADelayHighcut",name:"GrainA Delay Highcut",displayName:"Highcut",min:20,max:2e4,step:.01,skew:.25,defaultValue:2e4,suffix:"Hz",node:"grainA",tooltip:"Set high cut for delayed signal"},{paramId:"grainAMix",name:"GrainA Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"grainA",tooltip:"Set balance for dry and wet signal for this node"},{paramId:"grainBRateTempoSyncEnabled",name:"GrainB Rate Sync",displayName:"Rate Sync",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"grainB",tooltip:"Toggle tempo sync for rate",isModulatable:!1},{paramId:"grainBRate",name:"GrainB Rate",displayName:"Rate",min:0,max:1,step:.01,skew:1,defaultValue:.2474358297,toggleId:"grainBRateTempoSyncEnabled",toggleOff:"grainRateHz",toggleOn:"grainRateSync",node:"grainB",tooltip:"Set speed in which grains are emitted"},{paramId:"grainBRandomRate",name:"GrainB Random Rate",displayName:"Random Rate",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainB",tooltip:"Offset rate by random amount"},{paramId:"grainBSize",name:"GrainB Size",displayName:"Size",min:0,max:1,step:.01,skew:1,defaultValue:.7,toggleId:"grainBRateSizeLink",toggleOff:"grainSizeMs",toggleOn:"grainSizeSync",node:"grainB",tooltip:"Set duration of grain"},{paramId:"grainBRateSizeLink",name:"GrainB Rate/Size Link",displayName:"Link Rate/Size",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["FREE","LINKED"],node:"grainB",tooltip:"Link rate and size",isModulatable:!1},{paramId:"grainBSpray",name:"GrainB Spray",displayName:"Spray",min:0,max:1e3,step:.01,skew:1,defaultValue:0,suffix:"ms",node:"grainB",tooltip:"Offset grain postion by random amount"},{paramId:"grainBPitch",name:"GrainB Pitch",displayName:"Pitch",min:-24,max:24,step:1,skew:1,defaultValue:0,node:"grainB",tooltip:"Set grain pitch in semitones"},{paramId:"grainBWindowType",name:"GrainB Shape",displayName:"Shape",min:0,max:5,step:1,skew:1,defaultValue:1,strRepr:["Rectangle","Triangle","Round","Shelf","Slope Down","Slope Up"],node:"grainB",tooltip:"Set amplitude curve applied to grains"},{paramId:"grainBRandomPan",name:"GrainB Width",displayName:"Width",min:0,max:200,step:.01,skew:1,defaultValue:100,suffix:"%",node:"grainB",tooltip:"Set random pan for each grain"},{paramId:"grainBRandomSize",name:"GrainB Random Size",displayName:"Random Size",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainB",tooltip:"Offset size by random amount"},{paramId:"grainBRevProb",name:"GrainB Reverse",displayName:"Reverse",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainB",tooltip:"Set random probability of reverse for each grain"},{paramId:"grainBDetune",name:"GrainB Detune",displayName:"Detune",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainB",tooltip:"Set random detune for each grain"},{paramId:"grainBArp",name:"GrainB Arp",displayName:"Arp",min:0,max:9,step:1,skew:1,defaultValue:0,strRepr:["Off","Octaves","Power","Zigzag","Penta","Major","Minor","Whole","Cluster","Random"],node:"grainB",tooltip:"Arpeggiate grain pitch with preset patterns"},{paramId:"grainBDelayTempoSyncEnabled",name:"GrainB Delay Sync",displayName:"Delay Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"grainB",tooltip:"Toggle tempo sync for delay time",isModulatable:!1},{paramId:"grainBDelaySmoothEnabled",name:"GrainB Delay Smooth",displayName:"Delay Smooth",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"grainB",tooltip:"Toggle smoothing for delay time",version:5,isModulatable:!1},{paramId:"grainBDelay",name:"GrainB Delay",displayName:"Delay",min:0,max:1,step:.01,skew:1,defaultValue:.71,toggleId:"grainBDelayTempoSyncEnabled",toggleOff:"grainDelayMs",toggleOn:"grainDelaySync",node:"grainB",tooltip:"Adjust delay time"},{paramId:"grainBDelayFeedback",name:"GrainB Feedback",displayName:"Feedback",min:0,max:99,step:.01,skew:1,defaultValue:50,suffix:"%",node:"grainB",tooltip:"Set amount of delayed signal that feeds back into delay"},{paramId:"grainBDelayLowcut",name:"GrainB Delay Lowcut",displayName:"Lowcut",min:20,max:2e4,step:.01,skew:.25,defaultValue:20,suffix:"Hz",node:"grainB",tooltip:"Set low cut for delayed signal"},{paramId:"grainBDelayHighcut",name:"GrainB Delay Highcut",displayName:"Highcut",min:20,max:2e4,step:.01,skew:.25,defaultValue:2e4,suffix:"Hz",node:"grainB",tooltip:"Set high cut for delayed signal"},{paramId:"grainBMix",name:"GrainB Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"grainB",tooltip:"Set balance for dry and wet signal for this node"},{paramId:"grainCRateTempoSyncEnabled",name:"GrainC Rate Sync",displayName:"Rate Sync",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"grainC",tooltip:"Toggle tempo sync for rate",isModulatable:!1},{paramId:"grainCRate",name:"GrainC Rate",displayName:"Rate",min:0,max:1,step:.01,skew:1,defaultValue:.2474358297,toggleId:"grainCRateTempoSyncEnabled",toggleOff:"grainRateHz",toggleOn:"grainRateSync",node:"grainC",tooltip:"Set speed in which grains are emitted"},{paramId:"grainCRandomRate",name:"GrainC Random Rate",displayName:"Random Rate",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainC",tooltip:"Offset rate by random amount"},{paramId:"grainCSize",name:"GrainC Size",displayName:"Size",min:0,max:1,step:.01,skew:1,defaultValue:.7,toggleId:"grainCRateSizeLink",toggleOff:"grainSizeMs",toggleOn:"grainSizeSync",node:"grainC",tooltip:"Set duration of grain"},{paramId:"grainCRateSizeLink",name:"GrainC Rate/Size Link",displayName:"Link Rate/Size",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["FREE","LINKED"],node:"grainC",tooltip:"Link rate and size",isModulatable:!1},{paramId:"grainCSpray",name:"GrainC Spray",displayName:"Spray",min:0,max:1e3,step:.01,skew:1,defaultValue:0,suffix:"ms",node:"grainC",tooltip:"Offset grain postion by random amount"},{paramId:"grainCPitch",name:"GrainC Pitch",displayName:"Pitch",min:-24,max:24,step:1,skew:1,defaultValue:0,node:"grainC",tooltip:"Set grain pitch in semitones"},{paramId:"grainCWindowType",name:"GrainC Shape",displayName:"Shape",min:0,max:5,step:1,skew:1,defaultValue:1,strRepr:["Rectangle","Triangle","Round","Shelf","Slope Down","Slope Up"],node:"grainC",tooltip:"Set amplitude curve applied to grains"},{paramId:"grainCRandomPan",name:"GrainC Width",displayName:"Width",min:0,max:200,step:.01,skew:1,defaultValue:100,suffix:"%",node:"grainC",tooltip:"Set random pan for each grain"},{paramId:"grainCRandomSize",name:"GrainC Random Size",displayName:"Random Size",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainC",tooltip:"Offset size by random amount"},{paramId:"grainCRevProb",name:"GrainC Reverse",displayName:"Reverse",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainC",tooltip:"Set random probability of reverse for each grain"},{paramId:"grainCDetune",name:"GrainC Detune",displayName:"Detune",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"grainC",tooltip:"Set random detune for each grain"},{paramId:"grainCArp",name:"GrainC Arp",displayName:"Arp",min:0,max:9,step:1,skew:1,defaultValue:0,strRepr:["Off","Octaves","Power","Zigzag","Penta","Major","Minor","Whole","Cluster","Random"],node:"grainC",tooltip:"Arpeggiate grain pitch with preset patterns"},{paramId:"grainCDelayTempoSyncEnabled",name:"GrainC Delay Sync",displayName:"Delay Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"grainC",tooltip:"Toggle tempo sync for delay time",isModulatable:!1},{paramId:"grainCDelaySmoothEnabled",name:"GrainC Delay Smooth",displayName:"Delay Smooth",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"grainC",tooltip:"Toggle smoothing for delay time",version:5,isModulatable:!1},{paramId:"grainCDelay",name:"GrainC Delay",displayName:"Delay",min:0,max:1,step:.01,skew:1,defaultValue:.71,toggleId:"grainCDelayTempoSyncEnabled",toggleOff:"grainDelayMs",toggleOn:"grainDelaySync",node:"grainC",tooltip:"Adjust delay time"},{paramId:"grainCDelayFeedback",name:"GrainC Feedback",displayName:"Feedback",min:0,max:99,step:.01,skew:1,defaultValue:50,suffix:"%",node:"grainC",tooltip:"Set amount of delayed signal that feeds back into delay"},{paramId:"grainCDelayLowcut",name:"GrainC Delay Lowcut",displayName:"Lowcut",min:20,max:2e4,step:.01,skew:.25,defaultValue:20,suffix:"Hz",node:"grainC",tooltip:"Set low cut for delayed signal"},{paramId:"grainCDelayHighcut",name:"GrainC Delay Highcut",displayName:"Highcut",min:20,max:2e4,step:.01,skew:.25,defaultValue:2e4,suffix:"Hz",node:"grainC",tooltip:"Set high cut for delayed signal"},{paramId:"grainCMix",name:"GrainC Mix",displayName:"Mix",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"grainC",tooltip:"Set balance for dry and wet signal for this node"},{paramId:"lfoOneAmount",name:"LFOOne Depth",displayName:"Depth",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"lfoOne",tooltip:"Adjust amount of modulation"},{paramId:"lfoOneRate",name:"LFOOne Rate",displayName:"Rate",min:0,max:1,step:.01,skew:1,defaultValue:.16,toggleId:"lfoOneTempoSyncEnabled",toggleOff:"lfoRateHz",toggleOn:"lfoRateSync",node:"lfoOne",tooltip:"Speed of LFO"},{paramId:"lfoOneTempoSyncEnabled",name:"LFOOne Sync",displayName:"Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"lfoOne",tooltip:"Toggle tempo sync for LFO rate",isModulatable:!1},{paramId:"lfoOnePhase",name:"LFOOne Phase",displayName:"Phase",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"lfoOne",tooltip:"Set phase amount for LFO"},{paramId:"lfoOneRandom",name:"LFOOne Random",displayName:"Random",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"lfoOne",tooltip:"Set random offset for LFO"},{paramId:"lfoOneSmoothing",name:"LFOOne Smoothing",displayName:"Smooth",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"lfoOne",tooltip:"Set smoothing applied to LFO"},{paramId:"lfoTwoAmount",name:"LFOTwo Depth",displayName:"Depth",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"lfoTwo",tooltip:"Adjust amount of modulation"},{paramId:"lfoTwoRate",name:"LFOTwo Rate",displayName:"Rate",min:0,max:1,step:.01,skew:1,defaultValue:.16,toggleId:"lfoTwoTempoSyncEnabled",toggleOff:"lfoRateHz",toggleOn:"lfoRateSync",node:"lfoTwo",tooltip:"Speed of LFO"},{paramId:"lfoTwoTempoSyncEnabled",name:"LFOTwo Sync",displayName:"Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"lfoTwo",tooltip:"Toggle tempo sync for LFO rate",isModulatable:!1},{paramId:"lfoTwoPhase",name:"LFOTwo Phase",displayName:"Phase",min:0,max:100,step:.01,isModulatable:!1,skew:1,defaultValue:0,suffix:"%",node:"lfoTwo",tooltip:"Set phase amount for LFO"},{paramId:"lfoTwoRandom",name:"LFOTwo Random",displayName:"Random",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"lfoTwo",tooltip:"Set random offset for LFO"},{paramId:"lfoTwoSmoothing",name:"LFOTwo Smoothing",displayName:"Smooth",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"lfoTwo",tooltip:"Set smoothing applied to LFO"},{paramId:"lfoThreeAmount",name:"LFOThree Depth",displayName:"Depth",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"lfoThree",tooltip:"Adjust amount of modulation",version:10},{paramId:"lfoThreeRate",name:"LFOThree Rate",displayName:"Rate",min:0,max:1,step:.01,skew:1,defaultValue:.16,toggleId:"lfoThreeTempoSyncEnabled",toggleOff:"lfoRateHz",toggleOn:"lfoRateSync",node:"lfoThree",tooltip:"Speed of LFO",version:10},{paramId:"lfoThreeTempoSyncEnabled",name:"LFOThree Sync",displayName:"Sync",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"lfoThree",tooltip:"Toggle tempo sync for LFO rate",version:10,isModulatable:!1},{paramId:"lfoThreePhase",name:"LFOThree Phase",displayName:"Phase",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"lfoThree",tooltip:"Set phase amount for LFO",version:10},{paramId:"lfoThreeRandom",name:"LFOThree Random",displayName:"Random",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"lfoThree",tooltip:"Set random offset for LFO",version:10},{paramId:"lfoThreeSmoothing",name:"LFOThree Smoothing",displayName:"Smooth",min:0,max:100,step:.01,skew:1,defaultValue:0,isModulatable:!1,suffix:"%",node:"lfoThree",tooltip:"Set smoothing applied to LFO",version:10},{paramId:"envFollowAttack",name:"EnvFollow Attack",displayName:"Attack",min:.02,max:100,step:.01,skew:.5,defaultValue:.02,suffix:"ms",node:"envFollow",tooltip:"Set attack time of the envelope follower",version:4},{paramId:"envFollowRelease",name:"EnvFollow Release",displayName:"Release",min:.02,max:1e3,step:.01,skew:.5,defaultValue:100,suffix:"ms",node:"envFollow",tooltip:"Set release time of the envelope follower",version:4},{paramId:"envFollowAmount",name:"EnvFollow Depth",displayName:"Depth",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"envFollow",tooltip:"Set the amount that the envelope follower modulates the target parameters",version:4},{paramId:"envFollowGain",name:"EnvFollow Gain",displayName:"Gain",min:-24,max:24,step:.01,skew:1,defaultValue:0,suffix:"db",node:"envFollow",tooltip:"Set input gain in decibels to envelope follower",version:4},{paramId:"envFollowLowcut",name:"EnvFollow Lowcut",displayName:"Lowcut",min:20,max:2e4,step:.01,skew:.25,defaultValue:20,suffix:"Hz",node:"envFollow",tooltip:"Set low cut for envelope follower signal",version:4},{paramId:"envFollowHighcut",name:"EnvFollow Highcut",displayName:"Highcut",min:20,max:2e4,step:.01,skew:.25,defaultValue:2e4,suffix:"Hz",node:"envFollow",tooltip:"Set high cut for envelope follower signal",version:4},{paramId:"globalGain",name:"Global Gain",displayName:"Gain",min:-60,max:24,step:.01,defaultValue:0,skew:2,suffix:"db",node:"global",version:2,tooltip:"Adjust path gain"},{paramId:"globalPan",name:"Global Pan",displayName:"Pan",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"global",bipolar:!0,version:2,tooltip:"Adjust balance of path output"},{paramId:"globalMidSide",name:"Global Mid/Side",displayName:"Mid/Side",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"global",bipolar:!0,tooltip:"Adjust mid/side balance of path output",version:10},{paramId:"streamAGain",name:"PathA Gain",displayName:"Gain",min:-60,max:6,step:.01,defaultValue:0,skew:4,suffix:"db",node:"streamA",tooltip:"Adjust path gain"},{paramId:"streamAPan",name:"PathA Pan",displayName:"Pan",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamA",bipolar:!0,tooltip:"Adjust balance of path output"},{paramId:"streamBGain",name:"PathB Gain",displayName:"Gain",min:-60,max:6,step:.01,defaultValue:0,skew:4,suffix:"db",node:"streamB",tooltip:"Adjust path gain"},{paramId:"streamBPan",name:"PathB Pan",displayName:"Pan",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamB",bipolar:!0,tooltip:"Adjust balance of path output"},{paramId:"streamCGain",name:"PathC Gain",displayName:"Gain",min:-60,max:6,step:.01,defaultValue:0,skew:4,suffix:"db",node:"streamC",tooltip:"Adjust path gain"},{paramId:"streamCPan",name:"PathC Pan",displayName:"Pan",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamC",bipolar:!0,tooltip:"Adjust balance of path output"},{paramId:"streamDGain",name:"PathD Gain",displayName:"Gain",min:-60,max:6,step:.01,defaultValue:0,skew:4,suffix:"db",node:"streamD",tooltip:"Adjust path gain"},{paramId:"streamDPan",name:"PathD Pan",displayName:"Pan",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamD",bipolar:!0,tooltip:"Adjust balance of path output"},{paramId:"streamEGain",name:"PathE Gain",displayName:"Gain",min:-60,max:6,step:.01,defaultValue:0,skew:4,suffix:"db",node:"streamE",tooltip:"Adjust path gain"},{paramId:"streamEPan",name:"PathE Pan",displayName:"Pan",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamE",bipolar:!0,tooltip:"Adjust balance of path output"},{paramId:"streamFGain",name:"PathF Gain",displayName:"Gain",min:-60,max:6,step:.01,defaultValue:0,skew:4,suffix:"db",node:"streamF",tooltip:"Adjust path gain"},{paramId:"streamFPan",name:"PathF Pan",displayName:"Pan",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamF",bipolar:!0,tooltip:"Adjust balance of path output"},{paramId:"streamGGain",name:"PathG Gain",displayName:"Gain",min:-60,max:6,step:.01,defaultValue:0,skew:4,suffix:"db",node:"streamG",tooltip:"Adjust path gain"},{paramId:"streamGPan",name:"PathG Pan",displayName:"Pan",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamG",bipolar:!0,tooltip:"Adjust balance of path output"},{paramId:"streamAMidSide",name:"PathA Mid/Side",displayName:"Mid/Side",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamA",bipolar:!0,tooltip:"Adjust mid/side balance of path output",version:10},{paramId:"streamBMidSide",name:"PathB Mid/Side",displayName:"Mid/Side",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamB",bipolar:!0,tooltip:"Adjust mid/side balance of path output",version:10},{paramId:"streamCMidSide",name:"PathC Mid/Side",displayName:"Mid/Side",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamC",bipolar:!0,tooltip:"Adjust mid/side balance of path output",version:10},{paramId:"streamDMidSide",name:"PathD Mid/Side",displayName:"Mid/Side",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamD",bipolar:!0,tooltip:"Adjust mid/side balance of path output",version:10},{paramId:"streamEMidSide",name:"PathE Mid/Side",displayName:"Mid/Side",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamE",bipolar:!0,tooltip:"Adjust mid/side balance of path output",version:10},{paramId:"streamFMidSide",name:"PathF Mid/Side",displayName:"Mid/Side",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamF",bipolar:!0,tooltip:"Adjust mid/side balance of path output",version:10},{paramId:"streamGMidSide",name:"PathG Mid/Side",displayName:"Mid/Side",min:-1,max:1,step:.01,defaultValue:0,skew:1,node:"streamG",bipolar:!0,tooltip:"Adjust mid/side balance of path output",version:10},{paramId:"macro",name:"Macro",displayName:"Macro",min:0,max:100,step:.01,defaultValue:0,skew:1,suffix:"%",node:"macro",tooltip:"Adjust all macro mapping intensities"},{paramId:"mix",name:"Mix",displayName:"Mix",min:0,max:100,step:.01,defaultValue:100,skew:1,suffix:"%",tooltip:"Set balance between the global dry and wet signal",isModulatable:!1},{paramId:"volume",name:"Volume",displayName:"Volume",min:-60,max:12,step:.01,defaultValue:0,skew:1,suffix:"db",tooltip:"Adjust the global output volume"}],Fi=[{paramId:"globalLimiterEnabled",name:"Global Limiter",displayName:"Limiter",min:0,max:1,step:1,defaultValue:1,skew:1,node:"global",version:3,strRepr:["ENABLED","DISABLED"],tooltip:"Enable Global Limiter"},{paramId:"mixLock",name:"Mix Lock",displayName:"Mix Lock",min:0,max:1,step:1,defaultValue:0,skew:1,tooltip:"Lock the global mix during preset changes",version:9,strRepr:["UNLOCKED","LOCKED"]},{paramId:"streamAMute",name:"PathA Mute",displayName:"Mute",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamA",tooltip:"Mute output of stream"},{paramId:"streamBMute",name:"PathB Mute",displayName:"Mute",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamB",tooltip:"Mute output of stream"},{paramId:"streamCMute",name:"PathC Mute",displayName:"Mute",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamC",tooltip:"Mute output of stream"},{paramId:"streamDMute",name:"PathD Mute",displayName:"Mute",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamD",tooltip:"Mute output of stream"},{paramId:"streamEMute",name:"PathE Mute",displayName:"Mute",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamE",tooltip:"Mute output of stream"},{paramId:"streamFMute",name:"PathF Mute",displayName:"Mute",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamF",tooltip:"Mute output of stream"},{paramId:"streamGMute",name:"PathG Mute",displayName:"Mute",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamG",tooltip:"Mute output of stream"},{paramId:"streamASolo",name:"PathA Solo",displayName:"Solo",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamA",tooltip:"Solo output of stream"},{paramId:"streamBSolo",name:"PathB Solo",displayName:"Solo",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamB",tooltip:"Solo output of stream"},{paramId:"streamCSolo",name:"PathC Solo",displayName:"Solo",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamC",tooltip:"Solo output of stream"},{paramId:"streamDSolo",name:"PathD Solo",displayName:"Solo",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamD",tooltip:"Solo output of stream"},{paramId:"streamESolo",name:"PathE Solo",displayName:"Solo",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamE",tooltip:"Solo output of stream"},{paramId:"streamFSolo",name:"PathF Solo",displayName:"Solo",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamF",tooltip:"Solo output of stream"},{paramId:"streamGSolo",name:"PathG Solo",displayName:"Solo",min:0,max:1,step:1,defaultValue:0,skew:1,strRepr:["OFF","ON"],node:"streamG",tooltip:"Solo output of stream"},{paramId:"chorusAEnabled",name:"HazeA Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,node:"chorusA",strRepr:["DISABLED","ENABLED"],tooltip:"Bypass node",version:10},{paramId:"chorusBEnabled",name:"HazeB Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,node:"chorusB",strRepr:["DISABLED","ENABLED"],tooltip:"Bypass node",version:10},{paramId:"chorusCEnabled",name:"HazeC Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,node:"chorusC",strRepr:["DISABLED","ENABLED"],tooltip:"Bypass node",version:10},{paramId:"voltAEnabled",name:"VoltA Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,node:"voltA",strRepr:["DISABLED","ENABLED"],tooltip:"Bypass volt node",version:7},{paramId:"voltBEnabled",name:"VoltB Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,node:"voltB",strRepr:["DISABLED","ENABLED"],tooltip:"Bypass volt node",version:7},{paramId:"voltCEnabled",name:"VoltC Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,node:"voltC",strRepr:["DISABLED","ENABLED"],tooltip:"Bypass volt node",version:7},{paramId:"timeAEnabled",name:"TimeA Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"timeA",tooltip:"Bypass node",version:6},{paramId:"timeBEnabled",name:"TimeB Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"timeB",tooltip:"Bypass node",version:6},{paramId:"timeCEnabled",name:"TimeC Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"timeC",tooltip:"Bypass node",version:6},{paramId:"grainAEnabled",name:"GrainA Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"grainA",tooltip:"Bypass node"},{paramId:"grainADelayEnabled",name:"GrainA Delay Enabled",displayName:"Delay Enabled",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"grainA",tooltip:"Bypass grain delay"},{paramId:"grainBEnabled",name:"GrainB Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"grainB",tooltip:"Bypass node"},{paramId:"grainBDelayEnabled",name:"GrainB Delay Enabled",displayName:"Delay Enabled",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"grainB",tooltip:"Bypass grain delay"},{paramId:"grainCEnabled",name:"GrainC Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"grainC",tooltip:"Bypass node"},{paramId:"grainCDelayEnabled",name:"GrainC Delay Enabled",displayName:"Delay Enabled",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"grainC",tooltip:"Bypass grain delay"},{paramId:"convAEnabled",name:"SpaceA Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convA",tooltip:"Bypass node"},{paramId:"convAIr",name:"SpaceA Impulse Response",displayName:"Impulse Response",min:0,max:1,step:1,skew:1,defaultValue:"Impulse Responses/Lunacy/02 Large Spaces/Elvish Plate.impulse",node:"convA",tooltip:"Active impulse response"},{paramId:"convAReverse",name:"SpaceA Reverse",displayName:"Reverse",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["FORWARDS","REVERSED"],node:"convA",tooltip:"Set reverse for the impulse response"},{paramId:"convAStretch",name:"SpaceA Stretch",displayName:"Stretch",min:10,max:400,step:.01,skew:.4727,defaultValue:100,suffix:"%",bipolar:!0,node:"convA",tooltip:"Resample impulse response with time and pitch"},{paramId:"convAStartPos",name:"SpaceA Start",displayName:"Start",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"convA",tooltip:"Adjust start position of impulse response"},{paramId:"convAEndPos",name:"SpaceA End",displayName:"End",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"convA",tooltip:"Adjust end position of impulse response"},{paramId:"convAFadeIn",name:"SpaceA Fade In",displayName:"Fade In",min:0,max:100,step:.001,skew:1,defaultValue:0,suffix:"%",node:"convA",tooltip:"Adjust fade in for impulse response"},{paramId:"convAFadeOut",name:"SpaceA Fade Out",displayName:"Fade Out",min:0,max:100,step:.001,skew:1,defaultValue:0,suffix:"%",node:"convA",tooltip:"Adjust fade out for impulse response"},{paramId:"convBEnabled",name:"SpaceB Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convB",tooltip:"Bypass node"},{paramId:"convBIr",name:"SpaceB Impulse Response",displayName:"Impulse Response",min:0,max:1,step:1,skew:1,defaultValue:"Impulse Responses/Lunacy/02 Large Spaces/Elvish Plate.impulse",node:"convB",tooltip:"Active impulse response"},{paramId:"convBReverse",name:"SpaceB Reverse",displayName:"Reverse",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["FORWARDS","REVERSED"],node:"convB",tooltip:"Set reverse for the impulse response"},{paramId:"convBStretch",name:"SpaceB Stretch",displayName:"Stretch",min:10,max:400,step:.01,skew:.4727,defaultValue:100,suffix:"%",bipolar:!0,node:"convB",tooltip:"Resample impulse response with time and pitch"},{paramId:"convBStartPos",name:"SpaceB Start",displayName:"Start",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"convB",tooltip:"Adjust start position of impulse response"},{paramId:"convBEndPos",name:"SpaceB End",displayName:"End",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"convB",tooltip:"Adjust end position of impulse response"},{paramId:"convBFadeIn",name:"SpaceB Fade In",displayName:"Fade In",min:0,max:100,step:.001,skew:1,defaultValue:0,suffix:"%",node:"convB",tooltip:"Adjust fade in for impulse response"},{paramId:"convBFadeOut",name:"SpaceB Fade Out",displayName:"Fade Out",min:0,max:100,step:.001,skew:1,defaultValue:0,suffix:"%",node:"convB",tooltip:"Adjust fade out for impulse response"},{paramId:"convCEnabled",name:"SpaceC Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convC",tooltip:"Bypass node"},{paramId:"convCReverse",name:"SpaceB Reverse",displayName:"Reverse",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["FORWARDS","REVERSED"],node:"convC",tooltip:"Set reverse for the impulse response"},{paramId:"convCStretch",name:"SpaceB Stretch",displayName:"Stretch",min:10,max:400,step:.01,skew:.4727,defaultValue:100,suffix:"%",bipolar:!0,node:"convC",tooltip:"Resample impulse response with time and pitch"},{paramId:"convCStartPos",name:"SpaceB Start",displayName:"Start",min:0,max:100,step:.01,skew:1,defaultValue:0,suffix:"%",node:"convC",tooltip:"Adjust start position of impulse response"},{paramId:"convCEndPos",name:"SpaceC End",displayName:"End",min:0,max:100,step:.01,skew:1,defaultValue:100,suffix:"%",node:"convC",tooltip:"Adjust end position of impulse response"},{paramId:"convCFadeIn",name:"SpaceC Fade In",displayName:"Fade In",min:0,max:100,step:.001,skew:1,defaultValue:0,suffix:"%",node:"convC",tooltip:"Adjust fade in for impulse response"},{paramId:"convCFadeOut",name:"SpaceC Fade Out",displayName:"Fade Out",min:0,max:100,step:.001,skew:1,defaultValue:0,suffix:"%",node:"convC",tooltip:"Adjust fade out for impulse response"},{paramId:"convCIr",name:"SpaceC Impulse Response",displayName:"Impulse Response",min:0,max:1,step:1,skew:1,defaultValue:"Impulse Responses/Lunacy/02 Large Spaces/Elvish Plate.impulse",node:"convC",tooltip:"Active impulse response"},{paramId:"lfoOneEnabled",name:"LFOOne Enabled",displayName:"LFO Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"lfoOne",tooltip:"Bypass LFO"},{paramId:"lfoTwoEnabled",name:"LFOTwo Enabled",displayName:"LFO Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"lfoTwo",tooltip:"Bypass LFO"},{paramId:"lfoThreeEnabled",name:"LFOThree Enabled",displayName:"LFO Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"lfoThree",tooltip:"Bypass LFO"},{paramId:"convALFOEnabled",name:"SpaceA Motion Enabled",displayName:"Motion Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convA",tooltip:"Bypass Motion LFO"},{paramId:"convBLFOEnabled",name:"SpaceB Motion Enabled",displayName:"Motion Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convB",tooltip:"Bypass Motion LFO"},{paramId:"convCLFOEnabled",name:"SpaceC Motion Enabled",displayName:"Motion Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"convC",tooltip:"Bypass Motion LFO"},{paramId:"envFollowEnabled",name:"EnvFollow Enabled",displayName:"EnvFollow Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"envFollow",tooltip:"Bypass Envelope Follower",version:4},{paramId:"envFollowUseSidechain",name:"EnvFollow Use Sidechain",displayName:"Use Sidechain",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"envFollow",tooltip:"Use sidechain for envelope follower",isModulatable:!1,version:9},{paramId:"filterAType",name:"FilterA Type",displayName:"Filter Type",min:0,max:10,step:1,skew:1,defaultValue:0,strRepr:["Lowpass","Highpass","Bandpass","Peak","Notch","Comb 1","Comb 2","Formant","Bell","Low Shelf","High Shelf"],node:"filterA",tooltip:"Set filter type"},{paramId:"filterASteepness",name:"FilterA Steepness",displayName:"Steepness",min:0,max:7,step:1,skew:1,defaultValue:0,node:"filterA",tooltip:"Set steepness of the filter",strRepr:["x1","x2","x3","x4","x5","x6","x7","x8"],version:8},{paramId:"filterBType",name:"FilterB Type",displayName:"Filter Type",min:0,max:10,step:1,skew:1,defaultValue:0,strRepr:["Lowpass","Highpass","Bandpass","Peak","Notch","Comb 1","Comb 2","Formant","Bell","Low Shelf","High Shelf"],node:"filterB",tooltip:"Set filter type"},{paramId:"filterBSteepness",name:"FilterB Steepness",displayName:"Steepness",min:0,max:7,step:1,skew:1,defaultValue:0,node:"filterB",tooltip:"Set steepness of the filter",strRepr:["x1","x2","x3","x4","x5","x6","x7","x8"],version:8},{paramId:"filterCType",name:"FilterC Type",displayName:"Filter Type",min:0,max:10,step:1,skew:1,defaultValue:0,strRepr:["Lowpass","Highpass","Bandpass","Peak","Notch","Comb 1","Comb 2","Formant","Bell","Low Shelf","High Shelf"],node:"filterC",tooltip:"Set filter type"},{paramId:"filterCSteepness",name:"FilterC Steepness",displayName:"Steepness",min:0,max:7,step:1,skew:1,defaultValue:0,node:"filterC",tooltip:"Set steepness of the filter",strRepr:["x1","x2","x3","x4","x5","x6","x7","x8"],version:8},{paramId:"filterDType",name:"FilterD Type",displayName:"Filter Type",min:0,max:10,step:1,skew:1,defaultValue:0,strRepr:["Lowpass","Highpass","Bandpass","Peak","Notch","Comb 1","Comb 2","Formant","Bell","Low Shelf","High Shelf"],node:"filterD",tooltip:"Set filter type"},{paramId:"filterDSteepness",name:"FilterD Steepness",displayName:"Steepness",min:0,max:7,step:1,skew:1,defaultValue:0,node:"filterD",tooltip:"Set steepness of the filter",strRepr:["x1","x2","x3","x4","x5","x6","x7","x8"],version:8},{paramId:"filterAEnabled",name:"FilterA Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"filterA",tooltip:"Bypass node"},{paramId:"filterBEnabled",name:"FilterB Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"filterB",tooltip:"Bypass node"},{paramId:"filterCEnabled",name:"FilterC Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"filterC",tooltip:"Bypass node"},{paramId:"filterDEnabled",name:"FilterD Enabled",displayName:"Enabled",min:0,max:1,step:1,skew:1,defaultValue:1,strRepr:["DISABLED","ENABLED"],node:"filterD",tooltip:"Bypass node"},{paramId:"voltAFDNEnabled",name:"VoltA Warp Enabled",displayName:"Warp Enabled",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"voltA",tooltip:"Bypass feedback delay network",version:7},{paramId:"voltBFDNEnabled",name:"VoltB Warp Enabled",displayName:"Warp Enabled",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"voltB",tooltip:"Bypass feedback delay network",version:7},{paramId:"voltCFDNEnabled",name:"VoltC Warp Enabled",displayName:"Warp Enabled",min:0,max:1,step:1,skew:1,defaultValue:0,strRepr:["DISABLED","ENABLED"],node:"voltC",tooltip:"Bypass feedback delay network",version:7}],Ai=[{paramId:"lfoOne",displayName:"lfoOne",min:0,max:0,step:0,node:"lfoOne"},{paramId:"lfoTwo",displayName:"lfoTwo",min:0,max:0,step:0,node:"lfoTwo"},{paramId:"lfoThree",displayName:"lfoThree",min:0,max:0,step:0,node:"lfoThree"},{paramId:"convALFO",displayName:"convALFO",min:0,max:0,step:0,node:"convA"},{paramId:"convBLFO",displayName:"convBLFO",min:0,max:0,step:0,node:"convB"},{paramId:"convCLFO",displayName:"convCLFO",min:0,max:0,step:0,node:"convC"},{paramId:"grainRateHz",displayName:"Rate",min:2,max:100,step:.01,skew:.5,suffix:"Hz"},{paramId:"grainRateSync",displayName:"Rate",min:0,max:18,step:1,skew:1,strRepr:["1/1","1/2D","1/2","1/2T","1/4D","1/4","1/4T","1/8D","1/8","1/8T","1/16D","1/16","1/16T","1/32D","1/32","1/32T","1/64D","1/64","1/64T"]},{paramId:"grainSizeMs",displayName:"Size",min:10,max:1e3,step:.01,skew:1,suffix:"ms"},{paramId:"grainSizeSync",displayName:"Size",min:0,max:6,step:1,skew:1,strRepr:["1:16","1:8","1:4","1:2","1:1","2:1","4:1"]},{paramId:"grainDelayMs",displayName:"Delay",min:1,max:128,step:.1,skew:1,suffix:"ms"},{paramId:"grainDelaySync",displayName:"Delay",min:0,max:18,step:1,skew:1,strRepr:["1/64T","1/64","1/64D","1/32T","1/32","1/32D","1/16T","1/16","1/16D","1/8T","1/8","1/8D","1/4T","1/4","1/4D","1/2T","1/2","1/2D","1/1"]},{paramId:"filterCutoffHz",displayName:"Cutoff",min:20,max:2e4,step:.01,skew:.25,suffix:"Hz"},{paramId:"filterCutoffNote",displayName:"Cutoff",min:16,max:135,step:1,skew:1,suffix:"Note"},{paramId:"timeGrainSizeMs",displayName:"Size",min:1,max:150,step:.01,skew:1,suffix:"ms"},{paramId:"timeGrainSizeSync",displayName:"Size",min:0,max:13,step:1,skew:1,strRepr:["1/64T","1/64","1/64D","1/32T","1/32","1/32D","1/16T","1/16","1/16D","1/8T","1/8","1/8D","1/4T","1/4"]},{paramId:"timeStretchPlaybackSpeed",displayName:"Stretch",min:0,max:200,step:.01,skew:1,suffix:"%"},{paramId:"timeStretchSync",displayName:"Stretch",min:0,max:6,step:1,skew:2,strRepr:["STOP","1/8","1/4","1/2","1/1","3/2","2/1"]},{paramId:"timeDurationSeconds",displayName:"Duration",min:.1,max:60,step:.01,skew:.25,suffix:"s"},{paramId:"timeDurationSync",displayName:"Duration",min:0,max:8,step:1,skew:1,strRepr:["1/4","1/2","1/1","2/1","4/1","8/1","16/1","32/1","64/1"]},{paramId:"convPreDelayMs",displayName:"Predelay",min:0,max:1e3,step:1,skew:.5,suffix:"ms"},{paramId:"convPreDelaySync",displayName:"Predelay",min:0,max:19,step:1,skew:1,strRepr:["OFF","1/64T","1/64","1/64D","1/32T","1/32","1/32D","1/16T","1/16","1/16D","1/8T","1/8","1/8D","1/4T","1/4","1/4D","1/2T","1/2","1/2D","1/1"]},{paramId:"lfoRateHz",displayName:"Rate",min:.1,max:10,step:.01,skew:.5,suffix:"Hz"},{paramId:"lfoRateSync",displayName:"Rate",min:0,max:22,step:1,skew:1,strRepr:["16/1","8/1","4/1","2/1","1/1","1/2D","1/2","1/2T","1/4D","1/4","1/4T","1/8D","1/8","1/8T","1/16D","1/16","1/16T","1/32D","1/32","1/32T","1/64D","1/64","1/64T"]}],js=[{connections:[2],id:1,type:"start"},{connections:[3,4],id:2,type:"branch"},{connections:[5],id:3,type:"grainA"},{connections:[5],id:4,type:"convA"},{connections:[6],id:5,streams:[{id:"streamA"},{id:"streamB"}],type:"join"},{connections:[],id:6,type:"end"}],Fs={lfoOne:{factory:!0,name:"Sine",points:[{x:.25,y:1,curved:!0},{x:.75,y:0,curved:!0}],grid:{x:8,y:2}},lfoTwo:{factory:!0,name:"Square",points:[{x:0,y:1,curved:!1},{x:.5,y:1,curved:!1},{x:.5,y:0,curved:!1},{x:1,y:0,curved:!1}],grid:{x:8,y:2}},lfoThree:{factory:!0,name:"Triangle",points:[{curved:!1,x:0,y:0},{curved:!1,x:.5,y:1}],grid:{x:8,y:1}},convALFO:{factory:!0,name:"Saw",path:"LFOs/Lunacy/Saw.lfo",points:[{x:0,y:0,curved:!1},{x:1,y:1,curved:!1}],grid:{x:8,y:2}},convBLFO:{factory:!0,name:"Triangle",points:[{x:0,y:0,curved:!1},{x:.5,y:1,curved:!1}],grid:{x:8,y:2}},convCLFO:{factory:!0,name:"Square",points:[{curved:!1,x:0,y:1},{curved:!1,x:.5,y:1},{curved:!1,x:.5,y:0},{curved:!1,x:1,y:0}],grid:{x:8,y:2}}},As=[],Ls=[],ks={timeAStretchSections:[{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:0,reverse:!1},{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:1,reverse:!1},{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:2,reverse:!1},{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:3,reverse:!1}],timeBStretchSections:[{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:0,reverse:!1},{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:1,reverse:!1},{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:2,reverse:!1},{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:3,reverse:!1}],timeCStretchSections:[{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:0,reverse:!1},{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:1,reverse:!1},{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:2,reverse:!1},{width:.25,stretch:[.5,.5],pitch:[.5,.5],target:3,reverse:!1}]},jc={name:wi,company:yi,bundleId:bi,manufacturerCode:Si,pluginCode:Ci,window:Ni,parameterVersion:Mi,parameters:ji,stateVariables:Fi,parameterInfos:Ai,nodes:js,lfos:Fs,modulations:As,macros:Ls,additionalState:ks},Li=Object.freeze(Object.defineProperty({__proto__:null,additionalState:ks,bundleId:bi,company:yi,default:jc,lfos:Fs,macros:Ls,manufacturerCode:Si,modulations:As,name:wi,nodes:js,parameterInfos:Ai,parameterVersion:Mi,parameters:ji,pluginCode:Ci,stateVariables:Fi,window:Ni},Symbol.toStringTag,{value:"Module"})),Pn=At(e=>({manifest:Li,setManifest:t=>{e({manifest:t})}})),jt=168293,yn=174757,bn=186985,lo=187028,co=187029,uo=187030,fo=192986,ls=174646,cs=182534,us=193560,Ut=181118;var no=(e=>(e[e.LowPass=0]="LowPass",e[e.HighPass=1]="HighPass",e[e.BandPass=2]="BandPass",e[e.Peak=3]="Peak",e[e.Notch=4]="Notch",e[e.CombForward=5]="CombForward",e[e.CombBack=6]="CombBack",e[e.Formant=7]="Formant",e[e.Bell=8]="Bell",e[e.LowShelf=9]="LowShelf",e[e.HighShelf=10]="HighShelf",e))(no||{});function ki(e){switch(e){case"BEAM":return jt;case"Time":return yn;case"Volt":return bn;case"Space":return lo;case"Grains":return co;case"Filter":return uo;case"Haze":return fo;default:throw new Error(`Unknown plugin name: ${e}`)}}function Pi(){const{manifest:e}=Pn.getState();return[...e.parameters,...e.stateVariables]}function Fc(){const{manifest:e}=Pn.getState();return e.parameters.filter(t=>t.isModulatable===void 0||t.isModulatable)}function Ac(){const{manifest:e}=Pn.getState();return e.additionalState}function Ii(e){const t=e.stateVariables,r={};return t.forEach(o=>{r[o.paramId]=o.defaultValue}),r}function Lc(e){const t=e.parameters,r={};return t.forEach(o=>{r[o.paramId]=o.defaultValue}),r}function Ei(e){const t=Lc(e),r=Ii(e);return k(k({},t),r)}function Ri(){const{manifest:e}=Pn.getState();return Ii(e)}function kc(){const{manifest:e}=Pn.getState(),t=Ei(e);return D(k(k(D(k({pluginName:"BEAM"},t),{nodes:e.nodes}),e.lfos),e.additionalState),{modulations:e.modulations,macros:e.macros})}let fr={},da=!1;function ze(){const{manifest:e}=Pn.getState();return da||(da=!0,e.parameters.forEach(s=>{fr[s.paramId]={defaultValue:s.defaultValue,displayName:s.displayName,name:s.name,min:s.min,max:s.max,skew:s.skew,step:s.step,strRepr:s.strRepr||[],toggleId:s.toggleId||"",toggleOff:s.toggleOff||"",toggleOn:s.toggleOn||"",suffix:s.suffix,isModulatable:s.isModulatable!==void 0?s.isModulatable:!0,node:s.node,tooltip:s.tooltip,bipolar:s.bipolar,isPluginParameter:!0}}),e.stateVariables.forEach(s=>{fr[s.paramId]={defaultValue:s.defaultValue,displayName:s.displayName,name:s.name,min:s.min,max:s.max,skew:s.skew||1,step:s.step,strRepr:s.strRepr||[],toggleId:s.toggleId||"",toggleOff:s.toggleOff||"",toggleOn:s.toggleOn||"",suffix:s.suffix,isModulatable:!1,node:s.node,tooltip:s.tooltip,bipolar:s.bipolar,isPluginParameter:!1}}),e.parameterInfos.forEach(s=>{fr[s.paramId]={displayName:s.displayName,min:s.min,max:s.max,skew:s.skew||1,step:s.step,strRepr:s.strRepr||[],suffix:s.suffix,isModulatable:!1,tooltip:s.tooltip,bipolar:s.bipolar,node:s.node,isPluginParameter:!1}})),fr}var A=(e=>(e.convA="convA",e.convB="convB",e.convC="convC",e.grainA="grainA",e.grainB="grainB",e.grainC="grainC",e.filterA="filterA",e.filterB="filterB",e.filterC="filterC",e.filterD="filterD",e.timeA="timeA",e.timeB="timeB",e.timeC="timeC",e.voltA="voltA",e.voltB="voltB",e.voltC="voltC",e.chorusA="chorusA",e.chorusB="chorusB",e.chorusC="chorusC",e.join="join",e.branch="branch",e.start="start",e.end="end",e))(A||{}),Qe=(e=>(e.all="global",e.a="streamA",e.b="streamB",e.c="streamC",e.d="streamD",e.e="streamE",e.f="streamF",e.g="streamG",e))(Qe||{}),oe=(e=>(e.BEAM="BEAM",e.Grains="Grains",e.Space="Space",e.Filter="Filter",e.Time="Time",e.Volt="Volt",e.Haze="Haze",e))(oe||{});const Pc=D(k(k({pluginName:"BEAM",nodes:Di(js)},Fs),ks),{modulations:As,macros:Ls});function Di(e){return e.map(t=>D(k({},t),{type:t.type}))}const Fe=At((e,t)=>D(k({},Pc),{setPluginName:r=>{e(o=>D(k({},o),{pluginName:r}))},setManifest:r=>{e(o=>{Pn.getState().setManifest(r);const s=Ei(r);return D(k(k(D(k(k({},o),s),{nodes:Di(r.nodes)}),r.lfos),r.additionalState),{modulations:r.modulations,macros:r.macros})})},setToBeamManifest:()=>{t().setManifest(Li)},isIndividualNode:()=>t().pluginName!=="BEAM",isVolt:()=>t().pluginName==="Volt",isBasicNode:()=>{const r=t().pluginName;return r==="Space"||r==="Filter"||r==="Grains"||r==="Haze"},isFreeNode:()=>{const r=t().pluginName;return r==="Haze"||r==="Filter"},resizeFactor:()=>t().pluginName==="BEAM"?1:1.3,productId:()=>ki(t().pluginName)})),T=Fe;function Wt(){T(t=>t.nodes.map(r=>`${r.id}:${r.connections.join(",")}`).join(";"));const e=Fe.getState().nodes;return qt(e)}function qt(e){return{nodes:e,getNode:t=>e.find(r=>r.id===t),getNodesWithType:t=>e.filter(r=>r.type===t),getStart:()=>e.find(t=>t.type==="start"),getEnd:()=>e.find(t=>t.type==="end"),getNextNodes:t=>e.find(r=>r.id===t).connections.map(r=>e.find(o=>o.id===r)),getPreviousNodes:t=>e.filter(r=>r.connections.includes(t)),generateId:()=>1+Math.max(...e.map(t=>t.id))}}function nt(e){if(!e)return"ERROR";const t=navigator.platform.startsWith("Win")?"\\":"/",r=e.split(t);return r[r.length-1]}function ir(e){const t=navigator.platform.startsWith("Win")?"\\":"/";return e.split(t)}function Nr(e){const t=navigator.platform.startsWith("Win")?"\\":"/";return e.join(t)}var An=(e=>(e.PRESET="PRESET",e.NODE="NODE",e.LFO="LFO",e.IR="IR",e))(An||{});const Ln=At((e,t)=>({numUpdates:0,favorites:[],loadFavorites:()=>de(void 0,null,function*(){const r=yield window.__postNativeMessage__("loadPresetFavorites","IR");e(o=>D(k({},o),{favorites:JSON.parse(r||"[]")}))}),saveFavorite:r=>de(void 0,null,function*(){const o=Ln.getState().favorites;let s=[];o&&o.includes(r)?s=o.filter(l=>l!==r):s=[...o,r],(yield window.__postNativeMessage__("savePresetFavorites",JSON.stringify(s),"IR"))&&(yield Ln.getState().loadFavorites())}),irStore:{},sortedFiles:[],updateStore:r=>{e(o=>{const s=t().getFilesInStore(r).sort((i,l)=>i.path.localeCompare(l.path,void 0,{numeric:!0,sensitivity:"base"}));return D(k({},o),{irStore:r,sortedFiles:s,numUpdates:o.numUpdates+1})})},getParentFoldersFromPath:r=>{const o=ir(r);return o.length==4?[o[1],o[2]]:o.length==3?[o[1]]:[]},getFullRelativePath:r=>["Impulse Responses",...r].join("/"),getFile:r=>t().sortedFiles.find(s=>s.path===r),getFoldersInFolder:r=>{let o=t().irStore;for(let s of r)if(s in o)o=o[s];else break;return Object.keys(o).filter(s=>!fa(o[s])).sort((s,i)=>s.localeCompare(i,void 0,{numeric:!0,sensitivity:"base"}))},getFilesInFolder:r=>{let o=t().irStore;for(let s of r)if(s in o)o=o[s];else break;return t().getFilesInStore(o).sort((s,i)=>nt(s.path).localeCompare(nt(i.path),void 0,{numeric:!0,sensitivity:"base"}))},getFilesInStore:r=>{let o=[];for(let s in r)fa(r[s])?o.push(r[s]):o=o.concat(t().getFilesInStore(r[s]));return o},hasFile:r=>t().sortedFiles.some(s=>s.path===r),hasFileWithName:r=>t().sortedFiles.some(s=>nt(s.path).includes(r))})),rn=Ln;function fa(e){return"path"in e&&typeof e.path=="string"}function ma(e){return"path"in e&&typeof e.path=="string"}var mo=(e=>(e.Simple="Simple",e.Rhythmic="Rhythmic",e.Expansive="Expansive",e.Textural="Textural",e.Bright="Bright",e.Experimental="Experimental",e.LunacyPicks="Lunacy Picks",e))(mo||{}),po=(e=>(e.All="All",e.Bass="Bass",e.Drums="Drums",e.Keys="Keys",e.Pads="Pads",e.Vocals="Vocals",e.Hits="Hits",e))(po||{});const Mr=At((e,t)=>({numUpdates:0,presets:[],favorites:[],activePresetPath:null,factorySubfolders:[],userSubfolders:[],presetStore:{},sortedFiles:[],updateStore:r=>{e(o=>{o.numUpdates++;const s=t().getFilesInStore(r).sort((i,l)=>i.path.localeCompare(l.path,void 0,{numeric:!0,sensitivity:"base"}));return D(k({},o),{presetStore:r,sortedFiles:s,numUpdates:o.numUpdates})})},getFilesInStore:r=>{let o=[];for(let s in r)ma(r[s])?o.push(r[s]):o=o.concat(t().getFilesInStore(r[s]));return o},getFilesInFolder:r=>{let o=t().presetStore;for(let s of r)if(s in o)o=o[s];else break;return t().getFilesInStore(o).sort((s,i)=>nt(s.path).localeCompare(nt(i.path),void 0,{numeric:!0,sensitivity:"base"}))},getParentFoldersFromPath:r=>{if(!r)return[];const o=ir(r);return o.length==4?[o[1],o[2]]:o.length==3?[o[1]]:[]},getFoldersInFolder:r=>{let o=t().presetStore;for(let s of r)if(s in o)o=o[s];else break;return Object.keys(o).filter(s=>!ma(o[s])).sort((s,i)=>s.localeCompare(i,void 0,{numeric:!0,sensitivity:"base"}))},getFile:r=>t().sortedFiles.find(s=>s.path===r),hasFile:r=>t().sortedFiles.some(s=>s.path===r),hasFileWithName:r=>t().sortedFiles.some(s=>nt(s.path).includes(r)),loadFavorites:()=>de(void 0,null,function*(){const r=typeof window!="undefined"&&(yield window.__postNativeMessage__("loadPresetFavorites",An.PRESET));e(o=>D(k({},o),{favorites:JSON.parse(r||"[]")}))}),saveFavorite:r=>de(void 0,null,function*(){const o=Mr.getState().favorites;let s=[];o&&o.includes(r)?s=o.filter(l=>l!==r):s=[...o,r],typeof window!="undefined"&&(yield window.__postNativeMessage__("savePresetFavorites",JSON.stringify(s),An.PRESET))&&(yield Mr.getState().loadFavorites())})})),pn=Mr,fe={lunaOrange:"#E58877",lunaBlue:"#00BFFF",lunaYellow:"#FFFF00",lunaPurple:"#6B64A1",lunaNavy:"#44629F",lunaDark:"#242424",lunaDarkGray:"#00000033",lunaGray:"#3C3C3C",lunaLightGray:"#555",lunaLight:"#D8D8D8",lunaExtraLight:"#D9D9D9",lunaWhite:"#FFFFFF99",lunaCoral:"#F48272",lunaTextSecondary:"#FFFFFF80",lunaCoralAccent:"#FF9F91",lunaError:"#EE2222",lunaVanilla:"#eddea4",lunaPink:"#CDA0D0"};var be=(e=>(e.LFO1="lfoOne",e.LFO2="lfoTwo",e.LFO3="lfoThree",e.LFO_CONV_A="convALFO",e.LFO_CONV_B="convBLFO",e.LFO_CONV_C="convCLFO",e.ENV="envFollow",e))(be||{});function Ic(e){return"path"in e&&typeof e.path=="string"}const er=At((e,t)=>({lfoStore:{},favorites:[],updateStore:r=>{e(o=>D(k({},o),{lfoStore:r}))},loadFavorites:()=>de(void 0,null,function*(){const r=typeof window!="undefined"&&(yield window.__postNativeMessage__("loadPresetFavorites",An.LFO));e(o=>D(k({},o),{favorites:JSON.parse(r||"[]")}))}),saveFavorite:r=>de(void 0,null,function*(){const o=er.getState().favorites;let s=[];o&&o.includes(r)?s=o.filter(l=>l!==r):s=[...o,r],typeof window!="undefined"&&(yield window.__postNativeMessage__("savePresetFavorites",JSON.stringify(s),An.LFO))&&(yield er.getState().loadFavorites())}),getFilesInStore:r=>{let o=[];for(let s in r)Ic(r[s])?(r[s].name=s.replace(".lfo",""),o.push(r[s])):o=o.concat(t().getFilesInStore(r[s]));return o}})),Ir=e=>e==="lfoOne"?fe.lunaPurple:e==="lfoTwo"?fe.lunaOrange:fe.lunaPink,Ps=er;var ee=(e=>(e.lfoBrowser="lfoBrowser",e.lfoEditor="lfoEditor",e.presetBrowser="presetBrowser",e.IRBrowserA="IRBrowserA",e.IRBrowserB="IRBrowserB",e.IRBrowserC="IRBrowserC",e.FilterPresetA="FilterPresetA",e.FilterPresetB="FilterPresetB",e.FilterPresetC="FilterPresetC",e.FilterPresetD="FilterPresetD",e.GrainPresetA="GrainPresetA",e.GrainPresetB="GrainPresetB",e.GrainPresetC="GrainPresetC",e.TimePresetA="TimePresetA",e.TimePresetB="TimePresetB",e.TimePresetC="TimePresetC",e.VoltPresetA="VoltPresetA",e.VoltPresetB="VoltPresetB",e.VoltPresetC="VoltPresetC",e.HazePresetA="HazePresetA",e.HazePresetB="HazePresetB",e.HazePresetC="HazePresetC",e.Mappings="Mappings",e.Settings="Settings",e.Account="Account",e.Credits="Credits",e))(ee||{}),wr=(e=>(e.node="node",e.param="param",e.stream="stream",e.lfo="lfo",e.timeStretcherSeparation="time-stretcher-separation",e))(wr||{});const kt=At(e=>({bpm:120,convADSPLoading:!1,convBDSPLoading:!1,convCDSPLoading:!1,lastSelectedComponent:null,selectedNodeId:void 0,selectedMainView:void 0,selectedParamId:void 0,selectedStreamId:void 0,selectedMixerStreamId:void 0,showTweaksPanel:!1,showNodeControlPanel:!1,showAddNodesPanel:!1,showPresetsPanel:!1,showMappingsPanel:!1,selectedPosition:{x:0,y:0},draggingNode:!1,draggingStream:!1,selectedLFO:void 0,selectedModulation:null,showSavePresetModal:!1,showSaveNodePresetModal:!1,currentGrainNode:void 0,showSaveIRModal:!1,showDebugStats:!1,filterASelectedPreset:void 0,filterBSelectedPreset:void 0,filterCSelectedPreset:void 0,filterDSelectedPreset:void 0,grainASelectedPreset:void 0,grainBSelectedPreset:void 0,grainCSelectedPreset:void 0,irParentFolders:["Lunacy"],presetParentFolders:["Lunacy"],presetSearchValue:void 0,selectedPresetTags:[],selectedPresetCategory:void 0,showPresetFavorites:!1,showErrorModal:!1,errorModalText:void 0,showWarnBeforeModal:!1,warnBeforeModalText:void 0,warnBeforeModalAction:void 0,convAParentFolders:["Lunacy"],convBParentFolders:["Lunacy"],convCParentFolders:["Lunacy"],convASearchValue:void 0,convBSearchValue:void 0,convCSearchValue:void 0,convAShowFavorites:!1,convBShowFavorites:!1,convCShowFavorites:!1,hoveredParamId:null,setSelectedPosition:t=>e(r=>D(k({},r),{selectedPosition:t})),setLastSelectedComponent:t=>e(r=>D(k({},r),{lastSelectedComponent:t})),toggleNodeControlPanel:()=>e(t=>D(k({},t),{showNodeControlPanel:!t.showNodeControlPanel})),setNodeControlsVisible:t=>e(r=>D(k({},r),{showNodeControlPanel:t})),toggleTweaksPanel:()=>e(t=>D(k({},t),{showTweaksPanel:!t.showTweaksPanel})),closeTweaksPanel:()=>e(t=>D(k({},t),{showTweaksPanel:!1})),togglePresets:()=>e(t=>D(k({},t),{showPresetsPanel:!t.showPresetsPanel})),toggleAddNodesPanel:()=>e(t=>D(k({},t),{showAddNodesPanel:!t.showAddNodesPanel})),closeAllPanels:()=>e(t=>D(k({},t),{showAddNodesPanel:!1,showNodeControlPanel:!1,showPresetsPanel:!1,showTweaksPanel:!1,showMappingsPanel:!1,showSavePresetModal:!1})),closeDropdowns:()=>e(t=>D(k({},t),{showSavePresetModal:!1})),selectMainView:t=>e(r=>D(k({},r),{selectedMainView:t})),selectParamId:t=>e(r=>D(k({},r),{selectedParamId:t,lastSelectedComponent:"param"})),selectNode:t=>e(r=>D(k({},r),{selectedNodeId:t,lastSelectedComponent:"node",selectedStreamId:void 0,showAddNodesPanel:!1})),selectTimeStretcherSeparation:t=>e(r=>D(k({},r),{selectedTimeStretcherSeparationIdx:t,lastSelectedComponent:"time-stretcher-separation"})),selectStream:t=>e(r=>D(k({},r),{selectedNodeId:void 0,lastSelectedComponent:"stream",selectedStreamId:t,showAddNodesPanel:!1,selectedTimeStretcherSeparationIdx:null})),selectMixer:t=>e(r=>D(k({},r),{selectedMixerStreamId:t})),clearSelection:()=>e(t=>{let r=t.selectedMainView;switch(r){case"IRBrowserA":case"IRBrowserB":case"IRBrowserC":case"FilterPresetA":case"FilterPresetB":case"FilterPresetC":case"FilterPresetD":case"GrainPresetA":case"GrainPresetB":case"GrainPresetC":case"TimePresetA":case"TimePresetB":case"TimePresetC":case"VoltPresetA":case"VoltPresetB":case"VoltPresetC":case"HazePresetA":case"HazePresetB":case"HazePresetC":r=void 0}return D(k({},t),{selectedMainView:r,selectedNodeId:void 0,selectedStreamId:void 0})}),setDraggingNode:t=>e(r=>D(k({},r),{draggingNode:t})),setDraggingStream:t=>e(r=>D(k({},r),{draggingStream:t})),setBPM(t){return e(r=>D(k({},r),{bpm:t}))},setConvDSPLoading(t,r){switch(t){case A.convA:return e(o=>D(k({},o),{convADSPLoading:r}));case A.convB:return e(o=>D(k({},o),{convBDSPLoading:r}));case A.convC:return e(o=>D(k({},o),{convCDSPLoading:r}))}},setHeight:t=>e(r=>D(k({},r),{height:t})),setWidth:t=>e(r=>D(k({},r),{width:t})),selectLFO:t=>e(r=>D(k({},r),{selectedLFO:t})),selectModulation:t=>e(r=>D(k({},r),{selectedModulation:t})),selectFilterAPreset:t=>e(r=>D(k({},r),{filterASelectedPreset:t})),selectFilterBPreset:t=>e(r=>D(k({},r),{filterBSelectedPreset:t})),selectFilterCPreset:t=>e(r=>D(k({},r),{filterCSelectedPreset:t})),selectFilterDPreset:t=>e(r=>D(k({},r),{filterDSelectedPreset:t})),selectGrainAPreset:t=>e(r=>D(k({},r),{grainASelectedPreset:t})),selectGrainBPreset:t=>e(r=>D(k({},r),{grainBSelectedPreset:t})),selectGrainCPreset:t=>e(r=>D(k({},r),{grainCSelectedPreset:t})),selectTimeAPreset:t=>e(r=>D(k({},r),{timeASelectedPreset:t})),selectTimeBPreset:t=>e(r=>D(k({},r),{timeBSelectedPreset:t})),selectTimeCPreset:t=>e(r=>D(k({},r),{timeCSelectedPreset:t})),selectVoltAPreset:t=>e(r=>D(k({},r),{voltASelectedPreset:t})),selectVoltBPreset:t=>e(r=>D(k({},r),{voltBSelectedPreset:t})),selectVoltCPreset:t=>e(r=>D(k({},r),{voltCSelectedPreset:t})),selectHazeAPreset:t=>e(r=>D(k({},r),{hazeASelectedPreset:t})),selectHazeBPreset:t=>e(r=>D(k({},r),{hazeBSelectedPreset:t})),selectHazeCPreset:t=>e(r=>D(k({},r),{hazeCSelectedPreset:t})),openSavePresetModal:()=>e(t=>D(k({},t),{showSavePresetModal:!0})),closeSavePresetModal:()=>e(t=>D(k({},t),{showSavePresetModal:!1})),openSaveNodePresetModal:()=>e(t=>D(k({},t),{showSaveNodePresetModal:!0})),closeSaveNodePresetModal:()=>e(t=>D(k({},t),{showSaveNodePresetModal:!1})),openSaveIRModal:()=>e(t=>D(k({},t),{showSaveIRModal:!0})),closeSaveIRModal:()=>e(t=>D(k({},t),{showSaveIRModal:!1})),toggleDebugStats:()=>e(t=>D(k({},t),{showDebugStats:!t.showDebugStats})),clearAllNodePresets:()=>e(t=>D(k({},t),{filterASelectedPreset:void 0,filterBSelectedPreset:void 0,filterCSelectedPreset:void 0,filterDSelectedPreset:void 0,grainASelectedPreset:void 0,grainBSelectedPreset:void 0,grainCSelectedPreset:void 0,timeASelectedPreset:void 0,timeBSelectedPreset:void 0,timeCSelectedPreset:void 0,voltASelectedPreset:void 0,voltBSelectedPreset:void 0,voltCSelectedPreset:void 0,hazeASelectedPreset:void 0,hazeBSelectedPreset:void 0,hazeCSelectedPreset:void 0})),clearSelectedPresetForNode:t=>e(r=>D(k({},r),{[`${t}SelectedPreset`]:void 0})),toggleMainViewType:t=>e(r=>{let o=r.selectedMainView;return o===t?o=null:o=t,D(k({},r),{selectedMainView:o})}),setIRParentFolders:(t,r)=>{switch(r){case A.convA:return e(o=>D(k({},o),{convAParentFolders:t}));case A.convB:return e(o=>D(k({},o),{convBParentFolders:t}));case A.convC:return e(o=>D(k({},o),{convCParentFolders:t}))}},setPresetParentFolders:t=>e(r=>D(k({},r),{presetParentFolders:t})),setPresetSearchValue:t=>e(r=>D(k({},r),{presetSearchValue:t})),setIRSearchValue:(t,r)=>{switch(r){case A.convA:return e(o=>D(k({},o),{convASearchValue:t}));case A.convB:return e(o=>D(k({},o),{convBSearchValue:t}));case A.convC:return e(o=>D(k({},o),{convCSearchValue:t}))}},setSelectedPresetTags:t=>e(r=>D(k({},r),{selectedPresetTags:t})),setSelectedPresetCategory:t=>e(r=>D(k({},r),{selectedPresetCategory:t})),setShowPresetFavorites:t=>e(r=>D(k({},r),{showPresetFavorites:t})),setShowIRFavorites:(t,r)=>{switch(r){case A.convA:return e(o=>D(k({},o),{convAShowFavorites:t}));case A.convB:return e(o=>D(k({},o),{convBShowFavorites:t}));case A.convC:return e(o=>D(k({},o),{convCShowFavorites:t}))}},setShowErrorModal:t=>e(r=>D(k({},r),{showErrorModal:t})),setErrorModalText:t=>e(r=>D(k({},r),{errorModalText:t})),updateWarnBeforeModal:t=>e(r=>D(k({},r),{showWarnBeforeModal:t.show,warnBeforeModalText:t.text,warnBeforeModalAction:t.action})),closeWarnBeforeModal:()=>e(t=>D(k({},t),{showWarnBeforeModal:!1,warnBeforeModalText:void 0,warnBeforeModalAction:void 0})),setHoveredParamId:t=>e(r=>D(k({},r),{hoveredParamId:t}))})),H=kt;var ct=(e=>(e.Low="Low",e.Medium="Medium",e.High="High",e))(ct||{}),Nn=(e=>(e.Enabled="Enabled",e.Shift="Shift",e.Disabled="Disabled",e))(Nn||{}),on=(e=>(e.Up="Up",e.Down="Down",e.Off="Off",e))(on||{});const jr=At((e,t)=>({graphicsQuality:"Medium",tooltipsOn:!1,checkUpdates:!0,nodeScrolling:"Enabled",knobScrollMode:"Up",defaultPresetPath:"",setGraphicsQuality:r=>{dn(D(k({},t()),{graphicsQuality:r}))},toggleTooltips:()=>{dn(D(k({},t()),{tooltipsOn:!t().tooltipsOn}))},setTooltips:r=>{dn(D(k({},t()),{tooltipsOn:r}))},setCheckUpdates:r=>{dn(D(k({},t()),{checkUpdates:r}))},toggleCheckUpdates:()=>{dn(D(k({},t()),{checkUpdates:!t().checkUpdates}))},setNodeScrolling:r=>{dn(D(k({},t()),{nodeScrolling:r}))},setKnobScrollMode:r=>{dn(D(k({},t()),{knobScrollMode:r}))},setDefaultPresetPath:r=>{dn(D(k({},t()),{defaultPresetPath:r}))}})),mt=jr;function Ec(e){return"path"in e&&typeof e.path=="string"}const tn=At((e,t)=>({nodePresetStore:{},filterFavorites:[],grainFavorites:[],timeFavorites:[],voltFavorites:[],hazeFavorites:[],activePresetPath:null,updateStore:r=>{e(o=>D(k({},o),{nodePresetStore:r}))},loadFavorites:r=>de(void 0,null,function*(){const o=typeof window!="undefined"&&(yield window.__postNativeMessage__("loadPresetFavorites",An.NODE,r));e(s=>{if(r==oe.Filter)return D(k({},s),{filterFavorites:JSON.parse(o||"[]")});if(r==oe.Grains)return D(k({},s),{grainFavorites:JSON.parse(o||"[]")});if(r==oe.Time)return D(k({},s),{timeFavorites:JSON.parse(o||"[]")});if(r==oe.Volt)return D(k({},s),{voltFavorites:JSON.parse(o||"[]")});if(r==oe.Haze)return D(k({},s),{hazeFavorites:JSON.parse(o||"[]")})})}),saveFavorite:(r,o)=>de(void 0,null,function*(){const s=tn.getState();let i;if(o==oe.Filter)i=s.filterFavorites;else if(o==oe.Grains)i=s.grainFavorites;else if(o==oe.Time)i=s.timeFavorites;else if(o==oe.Volt)i=s.voltFavorites;else if(o==oe.Haze)i=s.hazeFavorites;else{console.log("[NodePresets.ts::saveFavorite]: invalid node type");return}let l=[];i&&i.includes(r)?l=i.filter(u=>u!==r):l=[...i,r],typeof window!="undefined"&&(yield window.__postNativeMessage__("savePresetFavorites",JSON.stringify(l),An.NODE,o))&&(yield tn.getState().loadFavorites(o))}),getFilesInStore:r=>{let o=[];for(let s in r)Ec(r[s])?o.push(r[s]):o=o.concat(t().getFilesInStore(r[s]));return o},getFilesInFolder:r=>{let o=t().nodePresetStore;for(let s of r)if(s in o)o=o[s];else break;return t().getFilesInStore(o).sort((s,i)=>nt(s.path).localeCompare(nt(i.path),void 0,{numeric:!0,sensitivity:"base"}))}})),yr=tn,Rc="lunacy_beam_dependencies",Dc="preset-packs";function Bc(e){const t=e.meta_data.find(o=>o.key===Rc);return t&&t.value&&t.value.replace(/\s/g,"").split(",")||[]}function pa(e,t){e instanceof Array||(e=[]);const r=(e||[]).filter(o=>o.status!==4).find(o=>o.productId===t);return r||!1}function $o(e){return!!(e.timesActivated&&e.timesActivated>=e.timesActivatedMax)}function ha(e){const t=e;return e.length?(e.filter(r=>r.status!==4).filter((r,o,s)=>o===s.findIndex(i=>i.productId===r.productId)),t):[]}function Tc(e){return t=>t.categories&&t.categories.map(r=>r.slug).includes(e)}function Oc(e){return e.filter(Tc(Dc)).map(r=>{const o=Bc(r).map(s=>e.find(i=>i.id===Number(s)).name);return{name:r.name,dependencies:o}})}function _c(e,t){return de(this,null,function*(){const r=yield Rr(),o=yield Dr();return yield(yield fetch(`${lr}/activate`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`,"x-app-id":In,"x-system-id":r,"x-machine-id":o},body:JSON.stringify({license:t})})).json()})}const Vc=e=>de(void 0,null,function*(){const t=yield Rr(),r=yield Dr();return yield(yield fetch(`${lr}/deactivate-machine`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`,"x-app-id":In,"x-system-id":t,"x-machine-id":r}})).json()});function zc(e,t){return de(this,null,function*(){const r=yield Rr(),o=yield Dr();return yield(yield fetch(`${lr}/deactivate`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`,"x-app-id":In,"x-system-id":r,"x-machine-id":o},body:JSON.stringify({license:t})})).json()})}function $c(e){return de(this,null,function*(){const t=yield Rr(),r=yield Dr();return yield(yield fetch(`${lr}/user`,{method:"GET",headers:{Authorization:`Bearer ${e}`,"x-app-id":In,"x-system-id":t,"x-machine-id":r}})).json()})}const ds="2.0.24";function Uc(e,t){const r=e.split(".").map(s=>parseInt(s,10)),o=t.split(".").map(s=>parseInt(s,10));for(let s=0;s<r.length;s++){if(r[s]>o[s])return!1;if(r[s]<o[s])return!0}return!1}const Hc={products:[],downloadQueue:[],isLoading:!1,downloadList:[],downloading:null,installedSamples:{},error:null,showDownloadError:!1,showUpdateModal:!1,updateComplete:!1,downloadTimeoutID:null},fs=At(e=>D(k({},Hc),{fetchProducts(r){return de(this,null,function*(){e({isLoading:!0});try{const s=yield(yield fetch(`${lr}/products`,{method:"GET",headers:{Authorization:`Bearer ${r}`,"x-app-id":In}})).json();return e({products:s.products,isLoading:!1}),s.products}catch(o){e({isLoading:!1}),console.error("Fetch products error:",o)}})}})),lr="https://zftdtm2ki5.us-east-1.awsapprunner.com/api/v1",In=oe.BEAM,Bi=[{id:Number(yn),name:oe.Time,productId:yn,createdAt:"2024-08-22 00:00:00"},{id:Number(bn),name:oe.Volt,productId:bn,createdAt:"2025-30-01 00:00:00"},{id:Number(lo),name:oe.Space,productId:lo,createdAt:"2024-04-01 00:00:00"},{id:Number(co),name:oe.Grains,productId:co,createdAt:"2024-04-01 00:00:00"},{id:Number(uo),name:oe.Filter,productId:uo,createdAt:"2024-04-01 00:00:00"},{id:Number(fo),name:oe.Haze,productId:fo,createdAt:"2025-05-13 00:00:00"}],Ti=[{id:Number(ls),name:"Preset Expansion Pack 1",productId:ls},{id:Number(cs),name:"Preset Expansion Pack 2",productId:cs},{id:Number(yn),name:"Time",productId:yn},{id:Number(bn),name:"High Voltage",productId:bn},{id:Number(us),name:"Embers",productId:us}],Gc=[...Bi,...Ti],gt={BEAM_PRO:"BEAM-PRO",BEAM_NODE:"BEAM-NODE",BEATPORT_BEAM:"BEATPORT-BEAM",RTO:"RTO",INVALID:"INVALID"};function Oi(e){return["time","volt","space","grains","filter","haze"].includes(e.toLowerCase())}function _i(e){return["filter","grains","space","haze"].includes(e.toLowerCase())}function Wc(e){return pa(e,jt)||pa(e,Ut)}function zn(e,t,r=oe.BEAM){if(!Array.isArray(e))return null;if(r===oe.BEAM){const o=e.find(s=>(s.productId===jt||s.productId===Ut)&&s.status!==4);return t?$o(o)?null:o:o||null}if(!Oi(r))return console.error(`Invalid plugin name for license check: ${r}`),null;try{const o=ki(r),s=e.find(i=>i.productId===o&&i.status!==4);if(s)return t?$o(s)?null:s:(console.log("[getValidLicense] Found node license for ",r,s),s);if(_i(r)){const i=e.find(l=>(l.productId===jt||l.productId===Ut)&&l.status!==4);if(i)return t&&$o(i)?null:i}return null}catch(o){return console.error("Error checking license:",o),null}}const qc={email:"",message:"",password:"",username:null,user:null,isLoading:!0,credentialsLoading:!0,checkingBeatport:!1,error:null,upgradedFromLiteVersion:!1,loggingOut:!1,latestVersion:"",showUpdateModal:!1,calledFromPackManager:!1,showProductsScreen:!1,showWelcomeScreen:!1,checkingForUpgrade:!1,licenseWriteError:!1,deactivated:!1},Zc=new RegExp(/^\S+@\S+\.\S+$/);function Yc(e){return de(this,null,function*(){let t=fs.getState();yield t.fetchProducts(e),t=fs.getState();const r=t.products,o=Oc(r),s=r.find(c=>parseInt(c.id)===jt||parseInt(c.id)===Ut);if(!s)return{bonusPresets:[],latestVersion:""};const i=s==null?void 0:s.meta_data.find(c=>c.key==="lunacy_product_version"),l=i?i.value:"";return{bonusPresets:o,latestVersion:l}})}const lt=At((e,t)=>D(k({},qc),{setLatestVersion:o=>{console.log("[setLatestVersion] current version: ",ds,"latest version: ",o);const s=Uc(ds,o);e({showUpdateModal:s,latestVersion:o})},fetchUser(){return de(this,null,function*(){var u,d,h;e({isLoading:!0});const o=t().user,s=o==null?void 0:o.token,i=o==null?void 0:o.isBeatport,l=o==null?void 0:o.isBeatportAndLogin,{pluginName:c}=T.getState();if(i&&!l){e({isLoading:!1});return}try{const f=yield $c(s);if(f.error){e({error:f.error,isLoading:!1,credentialsLoading:!1,user:null});return}f.isBeatport=i,f.isBeatportAndLogin=l,!f.email&&f.name.includes("@")&&(f.email=f.name),f.email=(u=o.email)!=null?u:f.email;const p=f&&f.customerLicenses?f.customerLicenses:[],w=zn(p,!1,c),x=(d=f.isRTO)!=null?d:!1;let m;if(!w&&!x)if(m=yield Wi(),m&&m.error){e({isLoading:!1,credentialsLoading:!1,error:"No valid license."});return}else m&&m.id&&(f.isBeatport=!0,f.isBeatportAndLogin=!0);const v=ha(p);let b;w?w.productId===jt||w.productId===Ut?b=gt.BEAM_PRO:b=gt.BEAM_NODE:x?b=gt.RTO:f.isBeatport?b=gt.BEATPORT_BEAM:b=gt.INVALID;const S={licenseType:b,licenses:v,subscriptions:f.subscriptions,bonusPresets:[],createdAt:Date.now(),isRTO:x,isBeatport:i,isBeatportAndLogin:l,credentials:{token:s,username:(h=o.email)!=null?h:f.email}};if(!(yield ga(S))){e({error:"License file could not be written to folder"});return}yield wa(f),e({user:D(k({},f),{token:s}),isLoading:!1,credentialsLoading:!1}),console.timeEnd("fetchUser")}catch(f){e({isLoading:!1,credentialsLoading:!1}),console.error("fetchUser error",f),console.timeEnd("fetchUser")}})},handleCredentials(o){return de(this,null,function*(){var s,i;try{const l=JSON.parse(o);console.log("[handleCredentials] parsed authObj: ",l);const{pluginName:c}=T.getState();let u;if(l.isBeatport)u=gt.BEATPORT_BEAM;else if(l.licenses){const h=zn(l.licenses,!1,c);h?h.productId===jt||h.productId===Ut?u=gt.BEAM_PRO:u=gt.BEAM_NODE:l.isRTO?u=gt.RTO:u=gt.INVALID}if(c===oe.BEAM&&u!==gt.BEAM_PRO&&u!==gt.RTO&&u!==gt.BEATPORT_BEAM){e({isLoading:!1,credentialsLoading:!1});return}if(l&&l.id)e({user:D(k({},l),{licenseType:u})});else if((s=l==null?void 0:l.credentials)!=null&&s.token){const h={token:l.credentials.token,username:l.credentials.username,email:l.credentials.username,customerLicenses:l.licenses,subscriptions:l.isRTO?l.subscriptions:[],isBeatportAndLogin:!!(l&&l.isBeatportAndLogin),isBeatport:!!(l&&l.isBeatport),isRTO:!!(l&&l.isRTO),licenseType:u};e({user:h})}else(l.isRTO||l.isBeatport||l.isBeatPort)&&(console.log("[handleCredentials] HERE: ",l),e({user:D(k({},l),{licenseType:u})}));e({isLoading:!1,credentialsLoading:!1,error:(i=l.error)!=null?i:null});const d=t().user;if(console.log("[handleCredentials] currentUser: ",d),d){const h=Gc.filter(f=>new Date(f.createdAt)>new Date(l.createdAt));h.length>0&&(console.log("[handleCredentials]: New expansions found:",h),yield t().fetchUser())}}catch(l){console.log("[handleCredentials error]: ",l),window.navigator.onLine?e({error:"Error refreshing credentials.",isLoading:!1,credentialsLoading:!1}):console.warn("OFFLINE MODE")}})},login(o,s,i=!1){return de(this,null,function*(){var P;if(!o){e({error:"Please enter your email."});return}if(!s){e({error:"Please enter your password."});return}if(!Zc.test(o)){e({error:"Email address is not valid."});return}e({isLoading:!0,error:null,licenseWriteError:!1,deactivated:!1});let l=yield Rr(),c=yield Dr();console.log("[login] systemId: ",l);let u={};try{u=yield Ui(o,s,lr,l,c,In)}catch(L){console.error(L),e({error:"Login request failed. Please check your internet connection.",isLoading:!1});return}let d=null;if(typeof(u==null?void 0:u.json)=="function")try{if(u.status>=300&&u.status!==403&&u.status!==500){const L=u.clone();e({error:u.statusText,isLoading:!1});return}d=yield u.json(),d&&typeof d=="object"?d.isBeatport=i:e({error:"Invalid server response object.",isLoading:!1})}catch(L){e({error:"Invalid server response.",isLoading:!1});return}else{e({error:"Unexpected server response.",isLoading:!1});return}if(d.error==="2FA error"){e({error:"User has not set up 2FA on their account.",isLoading:!1});return}if(d.code==="jwt_auth_invalid_token"||d.error){e({error:"Email or password is incorrect.",isLoading:!1,user:i?d:null});return}d.isBeatportAndLogin=i;const h=d&&d.customerLicenses?d.customerLicenses:[],{pluginName:f}=T.getState();if(!f||f!==oe.BEAM&&!Oi(f)){e({error:`Invalid plugin: ${f}`,isLoading:!1});return}let p;f===oe.BEAM?p=Wc(h):p=zn(h,!1,f);const w=(P=d.isRTO)!=null?P:!1;if(!p&&!i&&!w){if(d.RTOStatusMessage){e({user:null,error:d.RTOStatusMessage,isLoading:!1});return}let L="";f===oe.BEAM?L="No valid BEAM license found. Please purchase a license to continue.":_i(f)?L=`No valid license found for ${f}. You can get access by purchasing BEAM or ${f} individually.`:L=`No valid license found for ${f}. Please purchase a ${f} license to continue.`,e({user:null,error:L,isLoading:!1});return}const x=yield ba();let m=!1,v=null;if(console.log(p),p&&!d.isBeatport){const L=yield _c(d.token,p.licenseKey);if(!L.success){e({user:null,isLoading:!1,error:L.message,credentialsLoading:!1});return}v=L.data,m=!1}else v=x;if(v){const L=h.findIndex(I=>I.id===(v==null?void 0:v.id));h[L]=v}const b=ha(h),{bonusPresets:S,latestVersion:y}=yield Yc(d.token);let g;p?p.productId===jt||p.productId===Ut?g=gt.BEAM_PRO:g=gt.BEAM_NODE:w?g=gt.RTO:d.isBeatport?g=gt.BEATPORT_BEAM:g=gt.INVALID;const j={licenseType:g,licenses:b,subscriptions:d.subscriptions,isRTO:w,isBeatport:d.isBeatport,isBeatportAndLogin:d.isBeatportAndLogin,bonusPresets:S,createdAt:Date.now(),credentials:{token:d.token,username:o}};if(d.email=o,!(yield ga(j))){e({error:"License file could not be written to folder"});return}v&&!m&&(d.customerLicenses.length>0||d.isRTO)&&(d.customerLicenses=d.customerLicenses.map(L=>L.licenseKey===v&&v.licenseKey?v:L)),yield wa(d),e({user:d,email:"",password:"",isLoading:!1,credentialsLoading:!1,latestVersion:y})})},reset(){e({user:null,isLoading:!1,credentialsLoading:!1})},logout:()=>de(void 0,null,function*(){const{user:o}=t();if(console.log("[logout] Starting deactivation process. User:",o),e({isLoading:!0,credentialsLoading:!0}),o!=null&&o.isBeatport){console.log("[logout] Handling Beatport logout"),yield ya(),yield Go(),e({deactivated:!0,user:null,isLoading:!1,credentialsLoading:!1});return}else if(o!=null&&o.isRTO){console.log("[logout] Handling RTO logout"),yield Vc(o==null?void 0:o.token),yield ya(),yield Go(),e({deactivated:!0,user:null,isLoading:!1,credentialsLoading:!1});return}const s=yield ba();if(console.log("[logout] Activated license:",s),!s){console.error("[logout] No activated license found");return}const i=o&&o.customerLicenses?o.customerLicenses:[],{pluginName:l}=T.getState();console.log("[logout] Plugin name:",l);const c=zn(i,!1,l);if(console.log("[logout] Valid license found:",c),!c){console.error("[logout] No valid license found for plugin:",l),e({error:`No valid license found for ${l}`,isLoading:!1,credentialsLoading:!1});return}const u=s.credentials.token;console.log("[logout] Attempting to deactivate with token:",(u==null?void 0:u.substring(0,10))+"...");try{const d=yield zc(u,c.licenseKey);if(console.log("[logout] Deactivation response:",d),d.success){const h=Bi.some(p=>p.name===l?!1:zn(i,!1,p.name)!==null),f=zn(i,!1,oe.BEAM)!==null;h&&l!==oe.BEAM&&f?(e({deactivated:!0,isLoading:!1,message:`${l} successfully deactivated. Your other products remain activated.`,credentialsLoading:!1}),yield t().fetchUser()):(yield Go(),e({deactivated:!0,user:null,isLoading:!1,message:"Plugin successfully deactivated.",username:null,credentialsLoading:!1}))}else e({error:d.message,isLoading:!1,credentialsLoading:!1})}catch(d){console.log("[logout] error: ",d),e({isLoading:!1,credentialsLoading:!1})}}),clearMessage(){e({message:""})},userProductIds:()=>{var i;const o=t().user;if(!o)return[];let s=(i=o.customerLicenses)!=null?i:[];return s.length?(s=s.filter(l=>l.status!==4),s.map(l=>l.productId)):[]},ownsVolt:()=>t().userProductIds().includes(bn),ownsTime:()=>t().userProductIds().includes(yn),ownsBEAM:()=>{const o=t().userProductIds();return o.includes(jt)||o.includes(Ut)},ownsPlugin:()=>{var d,h,f,p,w,x;const{productId:o,isBasicNode:s,isFreeNode:i}=T.getState(),l=o(),c=s();return i()||(d=t().user)!=null&&d.isBeatport&&(c||Number(l)===Number(jt))||(h=t().user)!=null&&h.isRTO&&((f=t().user)==null?void 0:f.subscriptions.some(v=>Number(v.product_id)===Number(Ut)&&(c||Number(l)===Number(jt))))?!0:(x=(w=(p=t().user)==null?void 0:p.customerLicenses)==null?void 0:w.some(m=>Number(m.productId)===Number(l)||c&&Number(m.productId)===Number(jt)))!=null?x:!1}})),Mt=lt,Ke=typeof window.__postNativeMessage__!="undefined",Xc=[[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,8],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"}],type:"join"}],[{connections:[2],id:1,type:"start"},{connections:[],id:2,type:"end"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,8,8],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"},{id:"streamC"}],type:"join"}]],Kc=[[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[9,8],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"}],type:"join"},{connections:[10,10],id:9,type:"branch"},{connections:[8],id:10,streams:[{id:"streamC"},{id:"streamD"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,8],id:7,type:"branch"},{connections:[9],id:8,streams:[{id:"streamA"},{id:"streamB"}],type:"join"},{connections:[10,10],id:9,type:"branch"},{connections:[6],id:10,streams:[{id:"streamC"},{id:"streamD"}],type:"join"}],[{connections:[9],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,8],id:7,type:"branch"},{connections:[10],id:8,streams:[{id:"streamA"},{id:"streamB"}],type:"join"},{connections:[7,10,10],id:9,type:"branch"},{connections:[6],id:10,streams:[{id:"streamC"},{id:"streamD"},{id:"streamE"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,9],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"}],type:"join"},{connections:[10,10],id:9,type:"branch"},{connections:[8],id:10,streams:[{id:"streamC"},{id:"streamD"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[11,8],id:7,type:"branch"},{connections:[9],id:8,streams:[{id:"streamA"},{id:"streamB"}],type:"join"},{connections:[10,10],id:9,type:"branch"},{connections:[6],id:10,streams:[{id:"streamC"},{id:"streamD"}],type:"join"},{connections:[12,12],id:11,type:"branch"},{connections:[8],id:12,streams:[{id:"streamE"},{id:"streamF"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,8],id:7,type:"branch"},{connections:[9],id:8,streams:[{id:"streamA"},{id:"streamB"}],type:"join"},{connections:[11,10],id:9,type:"branch"},{connections:[6],id:10,streams:[{id:"streamC"},{id:"streamD"}],type:"join"},{connections:[12,12],id:11,type:"branch"},{connections:[10],id:12,streams:[{id:"streamE"},{id:"streamF"}],type:"join"}],[{connections:[9],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[10,10],id:9,type:"branch"},{connections:[11],id:10,streams:[{id:"streamC"},{id:"streamD"}],type:"join"},{connections:[12,12],id:11,type:"branch"},{connections:[13],id:12,streams:[{id:"streamA"},{id:"streamB"}],type:"join"},{connections:[14,14],id:13,type:"branch"},{connections:[6],id:14,streams:[{id:"streamE"},{id:"streamF"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[9,11],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"}],type:"join"},{connections:[10,10],id:9,type:"branch"},{connections:[8],id:10,streams:[{id:"streamC"},{id:"streamD"}],type:"join"},{connections:[12,12],id:11,type:"branch"},{connections:[8],id:12,streams:[{id:"streamE"},{id:"streamF"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,8,8,8],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"},{id:"streamC"},{id:"streamD"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[9,8],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"}],type:"join"},{connections:[10,10],id:9,type:"branch"},{connections:[11],id:10,streams:[{id:"streamC"},{id:"streamD"}],type:"join"},{connections:[12,12],id:11,type:"branch"},{connections:[8],id:12,streams:[{id:"streamE"},{id:"streamF"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[9,8,8],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"},{id:"streamG"}],type:"join"},{connections:[10,10],id:9,type:"branch"},{connections:[11],id:10,streams:[{id:"streamC"},{id:"streamD"}],type:"join"},{connections:[12,12],id:11,type:"branch"},{connections:[8],id:12,streams:[{id:"streamE"},{id:"streamF"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,9,8],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"},{id:"streamC"}],type:"join"},{connections:[10,10],id:9,type:"branch"},{connections:[11],id:10,streams:[{id:"streamD"},{id:"streamE"}],type:"join"},{connections:[12,12],id:11,type:"branch"},{connections:[8],id:12,streams:[{id:"streamF"},{id:"streamG"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,8,9],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"},{id:"streamC"}],type:"join"},{connections:[10,10],id:9,type:"branch"},{connections:[11],id:10,streams:[{id:"streamD"},{id:"streamE"}],type:"join"},{connections:[12,12],id:11,type:"branch"},{connections:[8],id:12,streams:[{id:"streamF"},{id:"streamG"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,8,8,8,8],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"},{id:"streamC"},{id:"streamD"},{id:"streamE"}],type:"join"}],[{connections:[7],id:1,type:"start"},{connections:[],id:6,type:"end"},{connections:[8,8,8,8,8,8],id:7,type:"branch"},{connections:[6],id:8,streams:[{id:"streamA"},{id:"streamB"},{id:"streamC"},{id:"streamD"},{id:"streamE"},{id:"streamF"}],type:"join"}]];function Uo(){const e=Math.random()>.5?1:-1,t=Math.random(),r=Math.sin(Math.random()*Math.PI),o=.5+t*r*.5,s=Math.max(.5,Math.min(o,1));return e*s}const Jc=20;let Ho=null;const Mn=At((e,t)=>({undoStack:[],redoStack:[],registerState:(r,o=300)=>{Ho||(Ho=setTimeout(()=>{e(s=>({undoStack:[...s.undoStack,r].slice(-Jc),redoStack:[]})),Ho=null},o))},undo:()=>{e(r=>{const o=[...r.undoStack],s=[...r.redoStack];if(o.length>0){const i=o.pop();return s.push(Fe.getState()),Le(i,!0,!1),an(),{undoStack:o,redoStack:s}}return r})},redo:()=>{e(r=>{const o=[...r.redoStack];if(o.length>0){const s=o.pop(),i=[...r.undoStack,Fe.getState()];return Le(s,!0,!1),an(),{undoStack:i,redoStack:o}}return r})},clear:()=>{e(()=>({undoStack:[],redoStack:[]}))},getUndoLength:()=>t().undoStack.length,getRedoLength:()=>t().redoStack.length,canUndo:()=>t().undoStack.length>0,canRedo:()=>t().redoStack.length>0})),Fr=At(e=>({spectrums:{},setSpectrums:t=>e(r=>D(k({},r),{spectrums:t}))})),va=Fr,ho=At(e=>({scopes:{},setScopes:t=>e(r=>D(k({},r),{scopes:t}))})),Er=ho,Vt=!0;function _t(e,t,r,o){const s=new Set,i=[e],l=[0];for(;i.length;){const c=i.pop(),u=l.pop();if(s.has(c))continue;s.add(c);const d=o.getNode(c);r(d,u)&&(t?o.getNextNodes(c).forEach(f=>{i.push(f.id),d.type===A.branch?l.push(u+1):d.type===A.join?l.push(u-1):l.push(u)}):o.getPreviousNodes(c).forEach(f=>{i.push(f.id),d.type===A.branch?l.push(u-1):d.type===A.join?l.push(u+1):l.push(u)}))}}function Is(e,t,r){const[o,s]=Qc(e,t,r),i=eu(e,r);return{streamId:r.getNode(i).type===A.end?Qe.all:r.getNode(i).streams[s].id,startId:o,connectionIndex:s}}function Es(e){const t=[];return e.nodes.forEach(r=>{const o=e.getNode(r.id);o.streams&&o.streams.forEach(s=>{t.includes(s.id)||t.push(s.id)})}),t.sort()}function Vi(e,t){const r=[e.streamId];let o=e,s=t.nodes.find(i=>i.connections.includes(o.startId));for(;s;){const i=s.connections.indexOf(o.startId);if(o=Is(s.id,i,t),o.streamId===Qe.all)break;r.push(o.streamId),s=t.nodes.find(l=>l.connections.includes(o.startId))}return r}function Qc(e,t,r){let o=r.getNode(e);if(!o)return[void 0,void 0];let s=0;for(;s>0||o.type!==A.branch&&o.type!==A.start;){o.type===A.join?s++:s>0&&o.type===A.branch&&s--;const i=o.id;if(o=r.getPreviousNodes(o.id)[0],!o)return[void 0,void 0];t=o.connections.indexOf(i)}return[o.id,t]}function eu(e,t){const r=t.getNextNodes(e)[0];let o;return _t(r.id,!0,(s,i)=>i===0&&(s.type===A.join||s.type===A.end)?(o=s,!1):i>=0,t),o==null?void 0:o.id}const tu=At(e=>({})),tr=At(e=>({snapshots:{},setSnapshots:t=>e(r=>D(k({},r),{snapshots:t}))})),ln=tr,nu=At(e=>({meter:{min:0,max:0,source:null},setMeter:t=>e(r=>D(k({},r),{meter:t}))})),ru=(e,t)=>{const r=Math.abs(e),o=Math.pow(10,t),s=Math.pow(10,-t)/2;let i;return r>=o-s?i=e.toFixed(0):r<s?i=0 .toPrecision(t):i=e.toPrecision(t),e<0?i.slice(0,5):i.slice(0,4)},nr=(e,t,r,o)=>{if(r==="Note"){const i=Math.round(e),l=Math.floor(i/12)-2;return["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"][i%12]+l}if(r=r!==void 0?r:"",t.length!==0&&e>=0&&e<t.length)return t[Math.round(e)]+(o?"":" ")+r;const s=r&&e>1e3;return s&&(e/=1e3),ru(e,3)+(o?"":" ")+(s?"k":"")+r},ou=e=>e.replace(/([a-z])([A-Z])/g,"$1 $2"),Rs=e=>{const t=ou(e);let r=t[0].toUpperCase()+t.substring(1);return r=r.replace(/([A-Z]+)([A-Z][a-z])/,"$1 $2"),r=r.replace(/^Conv/,oe.Space),r=r.replace(/^Stream/,"Path"),r},su=!1;(typeof window.__receiveStateChange__!="function"||typeof window.__receiveStateChangeWithoutFadeIn__!="function")&&(console.log("SETUP __receiveStateChange__"),window.__receiveStateChange__=function(e){Fe.setState(JSON.parse(e))},window.__receiveStateChangeWithoutFadeIn__=window.__receiveStateChange__,Ke?window.__postNativeMessage__("ready").then(e=>{Mt.getState().user||zi(e)}):(window.__postNativeMessage__=function(...e){console.log("__postNativeMessage__ called from non-plugin env",e)},Fe.getState().setPluginName("BEAM"),Fe.getState().setToBeamManifest()));function zi(e){e?Mt.getState().handleCredentials(e):Mt.getState().reset()}typeof window.__receiveStateDelta__!="function"&&(window.__receiveStateDelta__=function(e){const t=JSON.parse(e);$i(t)});typeof window.__receiveParameterStateDelta__!="function"&&(window.__receiveParameterStateDelta__=function(e){const t=JSON.parse(e);Fe.setState(t)});typeof window.__receivePluginInfo__!="function"&&(window.__receivePluginInfo__=function(e){console.log("__receivePluginInfo__ called",e);const t=JSON.parse(e),r=t.pluginName;Fe.getState().setPluginName(r);const o=t.manifest;Fe.getState().setManifest(o)});typeof window.__receiveAuthData__!="function"&&(window.__receiveAuthData__=function(e){return de(this,null,function*(){zi(e)})});typeof window.__runWebviewTests__!="function"&&(window.__runWebviewTests__=e=>de(void 0,null,function*(){var r;const t=JSON.parse(e).credentials;window.__postNativeMessage__("log","__runWebviewTests__ called");try{const o=yield Ui("[email protected]","test-bad-password","https://zftdtm2ki5.us-east-1.awsapprunner.com/api/v1","ユーザー","1234567890",oe.BEAM);window.__postNativeMessage__("log","dummyCall success",JSON.stringify(o))}catch(o){console.log("error calling loginToServer",o),window.__postNativeMessage__("log","error calling loginToServer",o.message),yield new Promise(s=>setTimeout(s,3e4)),window.__postNativeMessage__("postWebviewTestResult",!1);return}for(let o of t)try{window.__postNativeMessage__("log","Testing CREDENTIALS",o.email),yield Mt.getState().logout(),window.__postNativeMessage__("log","logging in to BEAM test account "+o.email),yield Mt.getState().login(o.email,o.password,!1),window.__postNativeMessage__("log","logged in to BEAM test account "+o.email);const s=Mt.getState().ownsPlugin(),i=o.productIDs.includes(jt)||o.subscriptions.includes(Ut)||o.productIDs.includes(Ut);if(!(s===i)){Mt.getState().error&&window.__postNativeMessage__("log","login error",Mt.getState().error),window.__postNativeMessage__("log","user expected to own BEAM but doesnt, or owns BEAM but shouldnt"),window.__postNativeMessage__("log","authState",JSON.stringify(Mt.getState())),window.__postNativeMessage__("postWebviewTestResult",!1);return}if(s){if(Mt.getState().error){window.__postNativeMessage__("log","login error",Mt.getState().error),window.__postNativeMessage__("postWebviewTestResult",!1);return}const c=Mt.getState().userProductIds(),u=o.productIDs,d=u.every(w=>c.includes(w))&&u.length===c.length;let h=((r=Mt.getState().user)==null?void 0:r.subscriptions)||[];h=h.map(w=>Number(w.product_id));const f=o.subscriptions,p=f.every(w=>h.includes(w))&&f.length===h.length;if(!d||!p){window.__postNativeMessage__("log","user does not have the correct product licenses",JSON.stringify(c),JSON.stringify(u),JSON.stringify(h),JSON.stringify(f)),window.__postNativeMessage__("postWebviewTestResult",!1);return}}window.__postNativeMessage__("log","user has the correct product licenses")}catch(s){window.__postNativeMessage__("log","JS error running webview tests",JSON.stringify(s)),window.__postNativeMessage__("postWebviewTestResult",!1);return}window.__postNativeMessage__("postWebviewTestResult",!0)}));typeof window.__receiveLogs__!="function"&&(window.__receiveLogs__=e=>{});typeof window.__receiveVersionUpdate__!="function"&&(window.__receiveVersionUpdate__=e=>{const t=JSON.parse(e);Mt.getState().setLatestVersion(t.latestVersion)});typeof window.__receiveRefs__!="function"&&(window.__receiveRefs__=e=>{try{tu.setState(e)}catch(t){}});typeof window.__receiveEventBatch__!="function"&&(window.__receiveEventBatch__=function(e){const t=JSON.parse(e);for(let r=0;r<t.length;r++){const o=t[r];if(o[0]==="snapshot"){const s=tr.getState().setSnapshots,i=tr.getState().snapshots;i[o[1].source]=o[1].data,s(i)}else if(o[0]==="meter"){const s=nu.getState().setMeter;s(o[1])}else if(o[0]==="spectrum"){const s=Fr.getState().setSpectrums,i=Fr.getState().spectrums;i[o[1].source]=o[1].data,s(i)}else if(o[0]==="scope"){const s=ho.getState().setScopes,i=ho.getState().scopes;i[o[1].source]=o[1].data,s(i)}else if(o[0]==="bufferLoaded"){const s=Fe.getState(),i=o[1].type,l=.001,c=!(Number(o[1].reverse)===s[`${i}Reverse`]&&Math.abs(o[1].stretch-s[`${i}Stretch`])<l&&Math.abs(o[1].startPos-s[`${i}StartPos`])<l&&Math.abs(o[1].endPos-s[`${i}EndPos`])<l&&Math.abs(o[1].fadeIn-s[`${i}FadeIn`])<l&&Math.abs(o[1].fadeOut-s[`${i}FadeOut`])<l&&o[1].path.startsWith(s[`${i}Ir`]));kt.getState().setConvDSPLoading(i,c)}else if(o[0]==="fileNotFound"){const s=o[1].type;if(console.log("file not found",s),kt.getState().setConvDSPLoading(s,!1),kt.getState().setErrorModalText("Failed to load impulse response. This probably means that the file was moved or deleted."),kt.getState().setShowErrorModal(!0),Object.hasOwn(o[1],"path")){const i=o[1].path;Le({[`${s}Ir`]:i},!0,!1)}}}});typeof window.__receiveIRLibrary__!="function"&&(window.__receiveIRLibrary__=function(e){const t=JSON.parse(e);Ln.getState().updateStore(t)},Ln.getState().loadFavorites());typeof window.__receivePresetLibrary__!="function"&&(window.__receivePresetLibrary__=function(e){return de(this,null,function*(){const t=JSON.parse(e);Mr.getState().updateStore(t)})},Mr.getState().loadFavorites());typeof window.__receiveNodePresetLibrary__!="function"&&(window.__receiveNodePresetLibrary__=function(e){return de(this,null,function*(){const t=JSON.parse(e);tn.getState().updateStore(t)})},tn.getState().loadFavorites(oe.Grains),tn.getState().loadFavorites(oe.Time),tn.getState().loadFavorites(oe.Volt),tn.getState().loadFavorites(oe.Haze),tn.getState().loadFavorites(oe.Filter));typeof window.__receiveLFOLibrary__!="function"&&(window.__receiveLFOLibrary__=function(e){return de(this,null,function*(){const t=JSON.parse(e);console.log("__receiveLFOLibrary__ ",t),er.getState().updateStore(t)})},er.getState().loadFavorites());typeof window.__receiveBPM__!="function"&&(window.__receiveBPM__=function(e){return de(this,null,function*(){kt.getState().setBPM(e)})});typeof window.__receiveSettings__!="function"&&(window.__receiveSettings__=e=>{const t=JSON.parse(e);jr.setState(kr(jr.getState(),t,{arrayMerge:(r,o,s)=>o}))});function ut(e,t){return de(this,null,function*(){if(Ke){yield window.__postNativeMessage__("setParameterValue",{name:e,value:t});return}Fe.setState({[e]:t})})}function xa(e,t){Ke&&window.__postNativeMessage__("handleKeyPress",e.toString(),t)}function Ft(){Mn.getState().registerState(JSON.parse(JSON.stringify(Fe.getState())))}function Pt(e){return de(this,null,function*(){Ke&&(Ft(),yield window.__postNativeMessage__("beginChangeGesture",e))})}function It(e){return de(this,null,function*(){Ke&&(yield window.__postNativeMessage__("endChangeGesture",e))})}function an(){Ke&&(console.log("update plugin param from state"),window.__postNativeMessage__("updatePluginParametersFromState"))}function Cn(e,t){return de(this,null,function*(){yield Pt(e),yield ut(e,t),yield It(e)})}function Le(e,t=!0,r=!0){return de(this,null,function*(){if(Ke&&(r&&Ft(),t)){yield window.__postNativeMessage__("applyStateUpdate",JSON.stringify(e));return}$i(e)})}function $i(e){Fe.setState(kr(Fe.getState,e,{arrayMerge:(t,r,o)=>r}))}function dn(e){return de(this,null,function*(){if(Ke){yield window.__postNativeMessage__("applySettingsUpdate",JSON.stringify(e));return}jr.setState(kr(jr.getState(),e,{arrayMerge:(t,r,o)=>r}))})}function ro(e){return de(this,null,function*(){const t=Mt.getState().userProductIds();if(e.productId&&Number(e.productId)!==0&&!t.includes(Number(e.productId))){console.log("[loadPreset]: user does not have license for this preset");return}kt.getState().clearSelection(),Ft(),yield window.__postNativeMessage__("loadPreset",e.path)})}function nn(e){return de(this,null,function*(){Ke&&(yield window.__postNativeMessage__("removeFile",e))})}function ms(e,t){return de(this,null,function*(){const r=JSON.stringify(kn(t,!1));yield window.__postNativeMessage__("loadNodePreset",e,t,r)})}function au(e){return de(this,null,function*(){if(!Ke)return!1;const t=yield window.__postNativeMessage__("savePreset",JSON.stringify(e));return t||console.error("Error saving preset"),t})}function iu(e){return de(this,null,function*(){if(!Ke)return!1;const t=yield window.__postNativeMessage__("saveNodePreset",JSON.stringify(e));return t||console.error("Error saving node preset"),t})}function lu(e){return de(this,null,function*(){if(!Ke)return!1;const t=yield window.__postNativeMessage__("saveLFOPreset",JSON.stringify(e));return t||console.error("Error saving lfo preset"),t})}function Kt(e){Ke&&window.__postNativeMessage__("openExternalUrl",e)}function Ui(e,t,r,o,s,i){return de(this,null,function*(){return fetch(`${r}/auth`,{method:"POST",headers:{"Content-Type":"application/json","x-app-id":i,"x-system-id":o,"x-machine-id":s},body:JSON.stringify({username:e,password:t})})})}function Rr(){if(Ke)return window.__postNativeMessage__("getSystemName")}function Dr(){if(Ke)return window.__postNativeMessage__("getMachineId")}function ga(e){return de(this,null,function*(){return Ke?yield window.__postNativeMessage__("saveLicense",JSON.stringify(e)):void 0})}function wa(e){return de(this,null,function*(){return Ke?yield window.__postNativeMessage__("saveAuthData",JSON.stringify(e)):void 0})}function Go(){return de(this,null,function*(){return Ke?yield window.__postNativeMessage__("removeLicense"):void 0})}function ya(){return de(this,null,function*(){return Ke?yield window.__postNativeMessage__("removeAuthData"):void 0})}function ba(){return de(this,null,function*(){if(!Ke)return;const e=yield window.__postNativeMessage__("checkLicense");return e?JSON.parse(e):null})}function Xt(e){return de(this,null,function*(){return Ke?yield window.__postNativeMessage__("pickFolder",e):void 0})}function Sa(e){return de(this,null,function*(){return Ke?yield window.__postNativeMessage__("addIRFolder",e):void 0})}function Ca(e){return de(this,null,function*(){return Ke?yield window.__postNativeMessage__("addFactoryIRFolder",e):void 0})}function Na(e){return de(this,null,function*(){return Ke?yield window.__postNativeMessage__("addFactoryLFOFolder",e):void 0})}function Ma(e){return de(this,null,function*(){return Ke?yield window.__postNativeMessage__("addFactoryPresetFolder",e):void 0})}function ja(e,t){return de(this,null,function*(){return Ke?yield window.__postNativeMessage__("addFactoryNodePresetFolder",e,t):void 0})}function ko(e,t){const r=Fe.getState();let o=[];for(const i of r.modulations)i.paramId!==t&&o.push(i);const s={paramId:t,lfoType:e,strength:.3,bipolar:1,hovered:!1};o.push(s),Le({modulations:o})}function Po(e){let r=Fe.getState().macros||[];r=r.filter(s=>s.paramId!==e);const o={paramId:e,strength:.3,bipolar:0};r.push(o),Le({macros:r})}function br(e,t=!0){const r=Fe.getState();if(!e.lfoType){const s=r.macros.map(i=>i.paramId===e.paramId?k(k({},i),e):i);Le({macros:s},t)}else{const s=r.modulations.map(i=>i.paramId===e.paramId?k(k({},i),e):i);Le({modulations:s},t)}}function Fa(e){const t=Fe.getState(),r=!e.lfoType;if(console.log("removeModulation",r),r){const o=t.macros.filter(s=>s.paramId!==e.paramId);Le({macros:o})}else{const o=t.modulations.filter(s=>s.paramId!==e.paramId);Le({modulations:o})}}function Aa(e,t){const r=Fe.getState();let o=r.macros,s=r.modulations;!e.lfoType?o=o.filter(c=>c.paramId!==e.paramId):s=s.filter(c=>c.paramId!==e.paramId),!t.lfoType?o.push(t):s.push(t),Le({macros:o,modulations:s})}function La(e){const t=Fe.getState(),r=t.macros.filter(s=>s.paramId!==e),o=t.modulations.filter(s=>s.paramId!==e);Le({modulations:o,macros:r})}function cu(e){const r=Fe.getState().modulations.filter(o=>o.paramId!==e);Le({modulations:r})}function uu(e){const r=Fe.getState().macros.filter(o=>o.paramId!==e);Le({macros:r})}function du(){Le({macros:[],modulations:[]})}function kn(e,t=!1){const r=Fe.getState();let o=r.modulations||[],s=r.macros||[];const i=[],l=[],c=o.map(f=>f.paramId),u=s.map(f=>f.paramId);let d={},h=kc();for(const[f,p]of Object.entries(h))f.startsWith(e)&&(c.includes(f)&&i.push(f),u.includes(f)&&l.push(f),d=D(k({},d),{[f]:p}));return o=o.filter(f=>!i.includes(f.paramId)),s=s.filter(f=>!l.includes(f.paramId)),d=D(k({},d),{modulations:o,macros:s}),t&&(Le(d),an()),d}function Ds(e){const t=kt.getState(),r=Fe.getState();t.clearSelectedPresetForNode(e.type);const o=JSON.parse(JSON.stringify(r.nodes)),s=qt(o),i=fu(e.id,s);Le(D(k({},i),{nodes:o})),an()}function ka(e){const t=Fe.getState().nodes.find(r=>r.id===e);t&&Ds(t)}function fu(e,t){const r=t.nodes,o=t.getNode(e);if(!o){console.warn(`Could not find node to remove: ${e}`);return}const s=o.type;let i=kn(s,!1);console.log("stateUpdateDelta from reset node",i);const l=t.getPreviousNodes(e)[0],c=t.getNextNodes(e)[0],u=l.connections.indexOf(e);Hi(e,t);const d=r.findIndex(h=>h.id===e);if(d!==-1&&r.splice(d,1),l.type===A.branch&&c.type===A.join&&l.connections.filter(h=>h===c.id).length>1){const h=Ts(c.streams[u].id,t);i=kr(i,h,{arrayMerge:(f,p,w)=>p})}return i}function mu(e,t,r){const o=Fe.getState(),s=qt(JSON.parse(JSON.stringify(o.nodes))),i=s.getNode(e),l=s.getNode(t);if(i===void 0||l===void 0){console.error(`Could not find nodes for move ${e}, ${t}`);return}if(r<0||r>=l.connections.length){console.error(`Invalid connection index for move: ${r}`);return}const c=s.getPreviousNodes(e)[0],u=s.getNextNodes(e)[0],d=c.connections.indexOf(e);Hi(e,s),i.connections=[l.connections[r]],l.connections[r]=e;let h={};c.type===A.branch&&u.type===A.join&&t!==c.id&&c.connections.filter(f=>f===u.id).length>1&&(h=Ts(u.streams[d].id,s)),Le(D(k({},h),{nodes:s.nodes}),!0),an()}function Hi(e,t){const r=t.getNode(e);if(!r){console.error(`Could not find node to disconnect: ${e}`);return}t.getPreviousNodes(e).forEach(o=>{const s=o.connections.indexOf(e);o.connections=[...o.connections.slice(0,s),...r.connections,...o.connections.slice(s+1)]}),r.connections=[]}const Jt=[A.convA,A.convB,A.convC],Qt=[A.grainA,A.grainB,A.grainC],Bt=[A.timeA,A.timeB,A.timeC],Ht=[A.voltA,A.voltB,A.voltC],Gt=[A.chorusA,A.chorusB,A.chorusC],cn=[A.filterA,A.filterB,A.filterC,A.filterD];function pu(e,t){Br(e,t,Jt)}function hu(e,t){Br(e,t,Qt)}function vu(e,t){Br(e,t,Bt)}function xu(e,t){Br(e,t,Ht)}function gu(e,t){const r=Fe.getState(),o=qt(r.nodes),{nodes:s}=o,i=Gt.find(l=>!s.find(c=>c.type===l));if(!i){console.error("Maximum number of chorus nodes reached.");return}Bs({id:o.generateId(),type:i,connections:[],activePresetIndex:0},e,t)}function wu(e,t){Br(e,t,cn)}function Br(e,t,r){const o=Fe.getState(),s=qt(o.nodes),{nodes:i}=s,l=r.find(c=>!i.find(u=>u.type===c));if(!l){console.error(`Maximum number of nodes reached (${r}).`);return}Bs({id:s.generateId(),type:l,connections:[],activePresetIndex:0},e,t)}function yu(e){const t=Fe.getState(),r=qt(JSON.parse(JSON.stringify(t.nodes))),{nodes:o}=r;if(o.find(d=>d.type===e)){console.error(`Node type ${e} already added to graph.`);return}const s=r.getPreviousNodes(r.getEnd().id),i=0,l=s[i].id,u={id:r.generateId(),type:e,connections:[],activePresetIndex:0};Bs(u,l,i)}function bu(e,t,r){const o=Fe.getState(),s=qt(JSON.parse(JSON.stringify(o.nodes))),{nodes:i}=s,l=[Jt,Qt,Bt,Ht,Gt,cn].find(m=>m.includes(e));if(!l){console.error(`Cannot duplicate node type: ${e}`);return}const c=l.find(m=>!i.find(v=>v.type===m));if(!c){console.error(`Maximum number of nodes reached for type ${e}.`);return}let u=o.modulations||[],d=o.macros||[];const h=[],f=[];for(const m of u)m.paramId.startsWith(e)&&h.push({paramId:m.paramId.replace(e,c),lfoType:m.lfoType,strength:m.strength,bipolar:m.bipolar,hovered:m.hovered});for(const m of d)m.paramId.startsWith(e)&&f.push({paramId:m.paramId.replace(e,c),strength:m.strength,bipolar:m.bipolar,hovered:m.hovered});let p={modulations:o.modulations.concat(h),macros:o.macros.concat(f)};const w=ze();for(const m in w){if(w[m].node!==e)continue;const b=m.replace(e,c);p=D(k({},p),{[b]:o[m]})}const x=Ac();for(const m of Object.keys(x))if(m.startsWith(e)){const v=m.replace(e,c),b=JSON.parse(JSON.stringify(o[m]));p[v]=b}vo({id:s.generateId(),type:c,connections:[],activePresetIndex:0},t,r,s,!1),Le(D(k({},p),{nodes:s.nodes})),an()}function Su(){const e=Math.random()<.75?Xc:Kc,t=Math.floor(Math.random()*e.length),r=JSON.parse(JSON.stringify(e[t])),o=r.filter(w=>w.type!==A.end).map(w=>w.connections.length).reduce((w,x)=>w+x);let i=Math.min(3,Math.floor(7/(o+1))+1);const l=Jt.concat(Qt),c=l.concat(A.filterA,A.filterB),u=[...l,...Bt,...Ht,...Gt],d=[...c,...Bt,...Ht,...Gt];let h=1+Math.max(...r.map(w=>w.id));const f=new Set,p=[];for(const w of r){if(w.type===A.end)continue;let x=0;if(o===1?x=2:w.type===A.branch&&o<5&&(x=1),i=Math.min(i,u.length+(d.length>u.length?1:0)),i===0)break;for(let m=0;m<w.connections.length;m++){let v=x+Math.floor(Math.pow(Math.random(),1.6)*(i-x+1));if(v===0&&Math.random()<.25&&(v=1),v===0){x=1;continue}const b=w.connections[m];w.connections[m]=h;for(let S=0;S<v;S++){let y=S===v-1?d:u;w.type===A.start&&o>1&&(y=u),y=y.filter(L=>!f.has(L));const g=.25;if(Math.random()<g||(y=y.filter(L=>!Bt.includes(L)&&!Ht.includes(L))),y.length===0)return console.warn("Error creating random graph. Returning fallback graph"),[{id:1,type:A.start,connections:[2]},{id:2,type:A.convA,connections:[3]},{id:3,type:A.end,connections:[]}];const N=y[Math.floor(Math.random()*y.length)];f.add(N);const P={id:h++,type:N,connections:S===v-1?[b]:[h]};if(Bt.includes(N)){const L=Array(4).fill(null).map((I,C)=>({stretch:[.5,.5],pitch:[.5,.5],target:C,reverse:!1}));P[`${N}StretchSections`]=L}p.push(P)}}}return r.push(...p),r}function Bs(e,t,r,o=!0,s=!0){const i=Fe.getState(),l=qt(JSON.parse(JSON.stringify(i.nodes)));let c=vo(e,t,r,l,s);Le(D(k({},c),{nodes:l.nodes}),o),an()}function vo(e,t,r,o,s=!0){const i=o.getNode(t);if(!i){console.error(`Could not find node ${t}`);return}if(r<0||r>=i.connections.length){console.error(`Invalid connection index ${r}`);return}const l=i.connections[r];e.connections=[l],i.connections[r]=e.id,o.nodes.push(e);let c={};return s&&(c=kn(e.type,!1)),c}function Gi(e){const t=[Qe.a,Qe.b,Qe.c,Qe.d,Qe.e,Qe.f,Qe.g],r=e.nodes.flatMap(o=>o.streams||[]).map(o=>o.id);return t.filter(o=>!r.includes(o))}function Cu(e,t){const r=Fe.getState(),o=qt(JSON.parse(JSON.stringify(r.nodes))),{nodes:s}=o;if(e===t){console.error("Cannot add connection from a node to itself.");return}const i=o.getNode(e),l=o.getNode(t);if(i.type===A.branch&&l.type===A.join){const c=Gi(o);if(!c){console.error("Cannot add stream. All stream IDs are taken.");return}l.streams=l.streams||[],l.streams.push({id:c[0]})}i.connections.push(t),Le({nodes:s})}function Nu(e,t,r,o){const s=Fe.getState(),i=qt(JSON.parse(JSON.stringify(s.nodes))),{nodes:l}=i,c=Gi(i);if(c.length<2){console.error("Cannot add stream. Not enough stream IDs available.");return}const u={id:i.generateId(),type:A.branch,connections:[]};vo(u,e,t,i,!1);const d={id:i.generateId(),type:A.join,connections:[],streams:[{id:c[0]}]};e===r&&(r=u.id,o=0),vo(d,r,o,i,!1),u.connections.push(d.id),d.streams.push({id:c[1]}),Le({nodes:l})}function ps(e){const t=Fe.getState(),r=qt(JSON.parse(JSON.stringify(t.nodes)));let o=Ts(e,r);Le(D(k({},o),{nodes:r.nodes})),an()}function Ts(e,t){var f,p,w;const{nodes:r}=t;if(e===Qe.all){let x={};const m=t.getStart(),v=t.getEnd();for(let b=0;b<r.length;++b){const S=r[b].id;S===m.id||S===v.id||(x=k(k({},x),kn(r[b].type,!1)))}m.connections=[v.id],t.nodes=[m,v],x=D(k({},x),{modulations:[],macros:[]});for(const b of r)for(const S of(f=b.streams)!=null?f:[])x[`${S.id}Mute`]=0,x[`${S.id}Solo`]=0,x[`${S.id}Gain`]=0,x[`${S.id}Pan`]=0,x[`${S.id}MidSide`]=0;return x}const o=r.find(x=>{var m;return(m=x.streams)==null?void 0:m.find(v=>v.id===e)}),s=(p=o==null?void 0:o.streams)==null?void 0:p.map(x=>x.id).indexOf(e);if(o===void 0||s===void 0){console.error(`Could not find join node for stream ${e}`);return}let i;const l=t.getPreviousNodes(o.id)[0];if(_t(l.id,!1,(x,m)=>x.type===A.branch&&m===0?(i=x,!1):m>=0,t),i===void 0){console.error(`Could not find branch node in front of ${o.id}`);return}const c=[],u=t.getNextNodes(i.id)[s];_t(u.id,!0,(x,m)=>x.type===A.join&&m===0?!1:(c.push(x.id),m>=0),t);const d=[e];if(_t(u.id,!0,x=>{var m;if(x.id===o.id)return!1;for(const v of(m=x.streams)!=null?m:[])d.push(v.id);return!0},t),i.connections.splice(s,1),i.connections.length===1){c.push(i.id,o.id);for(const x of(w=o.streams)!=null?w:[])d.push(x.id);t.getPreviousNodes(i.id).forEach(x=>{const m=x.connections.findIndex(v=>v===i.id);x.connections[m]=i.connections[0]}),t.getPreviousNodes(o.id).forEach(x=>{const m=x.connections.findIndex(v=>v===o.id);x.connections[m]=o.connections[0]})}else o.streams&&o.streams.splice(s,1);let h={};c.forEach(x=>{const m=t.nodes.findIndex(v=>v.id===x);h=k(k({},h),kn(r[m].type,!1)),r.splice(m,1)});for(const x of d)h[`${x}Mute`]=0,h[`${x}Solo`]=0,h[`${x}Gain`]=0,h[`${x}Pan`]=0;return h}function Mu(e,t){let r;return _t(e,!0,(o,s)=>s===0&&(o.type===A.end||o.type===A.join)?(r=o.id,!1):s>=0,t),r}function ju(e){const t=[];for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const o=e[r];o&&o.path&&t.push(o.path)}if(t.length>0){const r=Math.floor(Math.random()*t.length);return t[r]}else return null}const Fu=()=>{const e=ze();return Object.keys(e).reduce((r,o)=>{const s=e[o];return s.node&&(s.node.includes("stream")||s.node==="global")&&(r[o]=s.defaultValue),r},{})},Au=()=>de(void 0,null,function*(){kt.getState().clearSelection();const e=Su(),t=Fu(),r=Ln.getState().irStore,o=ze(),s=[],i=[],l=e.map(L=>L.type);l.push(be.LFO1),l.push(be.LFO2),l.push(be.LFO3);const c=e.filter(L=>L.type===A.convA||L.type===A.convB||L.type===A.convC),u=er.getState(),d=u.getFilesInStore(u.lfoStore),h=[];if(c.length>0)for(const L of c){const I=r.Lunacy;if(I){const M=Math.floor(Math.random()*Object.values(I).length),R=Object.values(I)[M];if(R){const O=ju(R);h.push({[`${L.type}Ir`]:O})}}let C=Math.floor(Math.random()*d.length);h.push({[`${L.type}LFO`]:d[C]})}const f=Math.max(Math.floor(e.length*1.3),5);let p=Math.floor(Math.random()*d.length);const w=d[p];p=Math.floor(Math.random()*d.length);const x=d[p];p=Math.floor(Math.random()*d.length);const m=d[p],v=Object.keys(o).filter(L=>l.includes(o[L].node));for(let L=0;L<f&&v.length>0;L++){let I=Math.floor(Math.random()*v.length),C=v[I];o[C].isModulatable&&i.push({paramId:C,strength:Uo(),bipolar:1})}const b=["highcut","lowcut"];let S=0;for(let L=0;L<v.length;L++){let I=Math.floor(Math.random()*v.length),C=v[I],M=!0;const R=["mix"];for(const _ of R)C.toLowerCase().includes(_)&&(M=!1);if(M)continue;const O=o[C];if(!(O.node==="lfoOne"||O.node==="lfoTwo"||O.node==="lfoThree")&&(v.splice(I,1),O.isModulatable&&s.push({paramId:C,lfoType:be.ENV,strength:Uo(),bipolar:0}),S++,S>=e.length/2))break}for(const L of[be.LFO1,be.LFO2,be.LFO3])for(let I=0;I<f&&v.length>0;I++){let C=Math.floor(Math.random()*v.length),M=v[C],R=!1;for(const _ of b)M.toLowerCase().includes(_)&&(R=!0);if(R)continue;const O=o[M];O.node==="lfoOne"||O.node==="lfoTwo"||O.node==="lfoThree"||(v.splice(C,1),O.isModulatable&&s.push({paramId:M,lfoType:L,strength:Uo(),bipolar:1}))}let y={};for(let L of[...Jt,...Qt,...cn,...Bt,...Gt])l.includes(L)||(y=k(k({},y),kn(L,!1)));const g=Object.assign({},...h),j=Ri(),N=k(D(k(k({},y),t),{nodes:e,modulations:s,lfoOne:w,lfoTwo:x,lfoThree:m,macros:i}),g),P=kr(j,N,{arrayMerge:(L,I,C)=>I});Le(P),console.log("NEW STATE UPDATE: ",P),an(),yield Lu()}),Lu=()=>de(void 0,null,function*(){if(!Ke){console.warn("Seems like we're not running in the plugin webview, ignoring the randomize call");return}return yield window.__postNativeMessage__("randomize")}),ku=()=>de(void 0,null,function*(){if(!Ke){console.warn("Seems like we're not running in the plugin webview, ignoring the init call");return}yield window.__postNativeMessage__("init")}),Pu=(e,t,r)=>de(void 0,null,function*(){Ft(),yield window.__postNativeMessage__("handleIRFileDrop",e,t,r)}),Iu=(e,t,r,o,s)=>de(void 0,null,function*(){yield window.__postNativeMessage__("saveIRAs",t,e,r,o,s)});function xo(e,t,r,o,s,i=256,l=-60,c=6,u=!1,d=!1,h=20,f=2e4){return de(this,null,function*(){if(!Ke){console.warn("Seems like we're not running in the plugin webview, ignoring the filter curve call");return}return yield window.__postNativeMessage__("getFilterCurve",e,t,r,["Lowpass","Highpass","Bandpass","Peak","Notch","Comb 1","Comb 2","Formant","Bell","Lowshelf","Highshelf"][o],s+1,i,u,d,h,f,l,c)})}function Wi(){return de(this,null,function*(){const e=yield window.__postNativeMessage__("checkBeatport");return JSON.parse(e)})}const Wo=e=>{window.__postNativeMessage__("resizeWindow",e)},oo={nodeTransforms:new Map,minX:0,maxX:0,minY:0,maxY:0,get:e=>oo.nodeTransforms.get(e)};function En(e){return e.nodes.map(t=>`${t.id}:${t.connections.join(",")}`).join(";")}const qi=1.63,Eu=1.8,go=.4;function Ru(e){const t=oo.nodeTransforms;t.clear(),e.nodes.forEach(l=>t.set(l.id,{node:l,pos:new Oe}));const r=t.get(e.getStart().id);Zi(t,r),Xi(t,e,e.getStart()),Yi(t,r);const o=e.getNodesWithType(A.branch).map(l=>t.get(l.id)).sort((l,c)=>l.branchDepth-c.branchDepth);for(const l of o)Bu(t,e,l);let s=1,i=1;for(const l of t.values())s=Math.max(s,l.column||0),i=Math.max(i,l.row||0);for(const l of t.values())l.pos.x=Eu*(l.column-s*.5),l.pos.y=qi*-l.row,l.pos.z=0,l.node.type===A.branch?l.pos.x-=go:l.node.type===A.join&&(l.pos.x+=go);return Du(t,e),Tu(oo),oo}function Du(e,t){const r=t.getNodesWithType(A.branch);for(const o of r){const s=e.get(o.id);s.midpoints=o.connections.map(()=>{});for(let i=0;i<o.connections.length;i++){const l=e.get(o.connections[i]);if(l.node.type===A.join){const c=new Oe;c.x=(s.pos.x+l.pos.x)/2,c.y=-1*qi*s.midpointRows[i],s.midpoints[i]=c}}}}function Os(e,t,r,o){const s=o.get(e),i=o.get(t);if(s.midpoints&&s.midpoints[r])return s.midpoints[r];const l=new Oe;return l.copy(s.pos),l.add(i.pos),s.node.type===A.join&&i.node.type!==A.join&&(l.x-=go+.1),i.node.type===A.branch&&s.node.type!==A.branch&&(l.x+=go+.1),l.multiplyScalar(.5),l}function Zi(e,t,r=0){t.column=t.column===void 0?r:Math.max(t.column,r),t.node.connections.forEach(o=>{if(e.has(o)){const s=e.get(o);Zi(e,s,r+1)}})}function Yi(e,t,r=0){t.node.type===A.join&&r--,t.branchDepth=r,t.node.type===A.branch&&r++,t.node.connections.forEach(o=>{if(e.has(o)){const s=e.get(o);Yi(e,s,r)}})}function Bu(e,t,r){let o;_t(r.node.connections[0],!0,(l,c)=>c===0&&l.type===A.join?(o=l,!1):!0,t);const s=e.get(o.id),i=s.column-r.column;for(const l of t.getPreviousNodes(s.node.id)){const c=e.get(l.id).column,u=c-r.column+1;let d=0;_t(l.id,!1,(h,f)=>{if(f===0&&h.type===A.branch)return!1;const p=e.get(h.id);return h.type===A.branch?d=c-p.column+1:d++,f===0&&(p.column=s.column-d*i/u),!0},t)}}function Xi(e,t,r,o=0){if(r.type===A.join)return;const s=[];_t(r.id,!0,(i,l)=>l===0&&i.type===A.join?!1:((l===0||l===1&&i.type===A.join)&&(e.get(i.id).row=o),l===0&&i.type===A.branch&&s.push(i),!0),t);for(const i of s){const l=e.get(i.id);l.midpointRows=i.connections.map(()=>{});let c=0;for(const d of i.connections)c+=Pa(t.getNode(d),t);let u=0;for(let d=0;d<i.connections.length;d++){const h=t.getNode(i.connections[d]),f=Pa(h,t),p=o+u-.5*(c-1)+.5*(f-1);Xi(e,t,h,p),u+=f,h.type===A.join&&(l.midpointRows[d]=p)}}}function Tu(e){e.minX=0,e.maxX=0,e.minY=0,e.maxY=0;for(const t of e.nodeTransforms.values())e.minX=Math.min(e.minX,t.pos.x||0),e.maxX=Math.max(e.maxX,t.pos.x||0),e.minY=Math.min(e.minY,t.pos.y||0),e.maxY=Math.max(e.maxY,t.pos.y||0),t.midpoints&&t.midpoints.forEach(r=>{r&&(e.minY=Math.min(e.minY,r.y),e.maxY=Math.max(e.maxY,r.y))})}function Pa(e,t){if(e.type===A.join)return 1;let r=1;return _t(e.id,!0,(o,s)=>s===0&&o.type===A.join?!1:(o.type===A.branch&&(r+=o.connections.length-1),!0),t),r}function Ki(e,t){const r=[];if(t!==void 0){const o=e.get(t);r.push({node1:t,node2:t,pos:o.pos})}for(const o of e.nodeTransforms.values()){const s=o.node;s.id!==t&&s.connections.forEach((i,l)=>{i!==t&&r.push({node1:s.id,node2:i,connectionIndex:l,pos:Os(s.id,i,l,e)})})}return r}const Io=`
mat4 rotationMatrix(vec3 axis, float angle)
{
axis = normalize(axis);
float s = sin(angle);
float c = cos(angle);
float oc = 1.0 - c;
return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,
oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,
oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,
0.0, 0.0, 0.0, 1.0);
}`,Ou=`
vec2 rotate2d(vec2 p, float angle) {
float sinAngle = sin(angle);
float cosAngle = cos(angle);
return vec2(
p.x * cosAngle - p.y * sinAngle,
p.x * sinAngle + p.y * cosAngle
);
}`,_s=`
vec3 dither(vec3 color)
{
float value = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));
return color + vec3((value - 0.5) / 255.0);
}
float dither(float alpha) {
float value = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715))));
return alpha + (value - 0.5) / 255.0;
}
`,Re=(e,t,r)=>Math.min(Math.max(e,t),r);function Vs(e){return 100*(e/60+1)}function Ia(e){const t=Vs(e);return Re(t/100,0,1)}function Tt(e){const t=`${e}:0_snapshot`,r=`${e}:1_snapshot`,o=tr.getState().snapshots;let s=0,i=0,l=0;return t in o&&(s=Ia(o[t]),l++),r in o&&(i=Ia(o[r]),l++),l===0?0:(s+i)/l}const _u=e=>e&&e.constructor===Float32Array,Vu=e=>[e.r,e.g,e.b],Ji=e=>e instanceof sr||e instanceof Oe||e instanceof tc,Qi=e=>Array.isArray(e)?e:Ji(e)?e.toArray():[e,e,e];function Ea(e,t,r){return a.useMemo(()=>{if(t!==void 0){if(_u(t))return t;if(t instanceof Te){const o=Array.from({length:e*3},()=>Vu(t)).flat();return Float32Array.from(o)}else if(Ji(t)||Array.isArray(t)){const o=Array.from({length:e*3},()=>Qi(t)).flat();return Float32Array.from(o)}return Float32Array.from({length:e},()=>t)}return Float32Array.from({length:e},r)},[t])}const Ra=a.forwardRef((m,x)=>{var v=m,{count:e=100,speed:t=1,scale:r=1,noise:o,minSize:s,maxSize:i,fadeFrequency:l,noiseFade:c,noiseOffset:u,noiseFrequency:d,minOpacity:h,maxOpacity:f,volumeOpacityMultiplier:p}=v,w=ia(v,["count","speed","scale","noise","minSize","maxSize","fadeFrequency","noiseFade","noiseOffset","noiseFrequency","minOpacity","maxOpacity","volumeOpacityMultiplier"]);const b=T(U=>U.pluginName===oe.BEAM);a.useMemo(()=>st({SparklesImplMaterial:zu}),[]);const S=a.useRef(null),y=or(U=>U.viewport.dpr),g=Qi(r),j=a.useMemo(()=>Float32Array.from(Array.from({length:e},()=>g.map(ec.randFloatSpread)).flat()),[e,...g]),N=a.useMemo(()=>new Float32Array(e).map(()=>se(s,i,Math.pow(Math.random(),.8))),[]),P=a.useMemo(()=>new Float32Array(e).map(()=>t*se(.4,1,Math.random())*(Math.random()>.5?-1:1)),[]),L=a.useMemo(()=>new Float32Array(3*e).map((U,$)=>$%3===0?se(.1,.4,Math.random()):$%3===1?se(.1,.4,Math.random()):se(.8,1,Math.random())),[]),I=a.useMemo(()=>new Float32Array(e).map((U,$)=>{const V=(N[$]-s)/(i-s);return se(h,f,Math.pow(Math.random(),2))*se(1,.4,V*V*V*V)}),[N]),C=Ea(e*3,o),M=a.useMemo(()=>new Float32Array(e).map(()=>Math.random()),[]),R=Ea(e,M),_=Wt().getStart().id;Ge(U=>{if(S.current&&S.current.material){const $=S.current.material;$.time=U.clock.elapsedTime;let V=se(1,p,Tt(_));const E=50,q=80;V*=se(1,.7,yt((U.camera.position.z-E)/(q-E),0,1)),$.opacityMultiplier=V}}),a.useImperativeHandle(x,()=>S.current,[]);const z=bt(St,"./noiseSmooth.png");return z.wrapS=ht,z.wrapT=ht,n.jsxs("points",D(k({},w),{ref:S,children:[n.jsxs("bufferGeometry",{children:[n.jsx("bufferAttribute",{attach:"attributes-position",args:[j,3]}),n.jsx("bufferAttribute",{attach:"attributes-size",args:[N,1]}),n.jsx("bufferAttribute",{attach:"attributes-opacity",args:[I,1]}),n.jsx("bufferAttribute",{attach:"attributes-speed",args:[P,1]}),n.jsx("bufferAttribute",{attach:"attributes-color",args:[L,3]}),n.jsx("bufferAttribute",{attach:"attributes-noise",args:[C,3]}),n.jsx("bufferAttribute",{attach:"attributes-rand",args:[R,1]})]}),n.jsx("sparklesImplMaterial",{transparent:!0,pixelRatio:y,depthWrite:!1,blending:wt,noiseTexture:z,noiseOffset:u!=null?u:Math.random(),noiseFade:c!=null?c:.6,noiseFrequency:d!=null?d:1,fadeFrequency:l!=null?l:.5,vignetteStart:.5,vignetteEnd:b?1:.8,vignetteInnerMult:.1})]}),`particle-${e}-${JSON.stringify(r)}`)}),zu=at({noiseTexture:null,time:0,pixelRatio:1,noiseOffset:0,noiseFade:.6,fadeFrequency:.5,noiseFrequency:1,opacityMultiplier:1,vignetteStart:0,vignetteEnd:1,vignetteInnerMult:.5},` ${Io}
uniform sampler2D noiseTexture;
uniform float pixelRatio;
uniform float time;
uniform float noiseFrequency;
uniform float noiseOffset;
uniform float noiseFade;
uniform float fadeFrequency;
uniform float opacityMultiplier;
uniform float vignetteStart;
uniform float vignetteEnd;
uniform float vignetteInnerMult;
attribute float size;
attribute float speed;
attribute float opacity;
attribute vec3 noise;
attribute vec3 color;
attribute float rand;
varying vec3 vColor;
varying float vOpacity;
varying vec2 vNdc;
void main() {
vColor = color;
vOpacity = opacity;
vOpacity *= smoothstep(0.0, 1.0, sin(fadeFrequency * time + 2.0 * 3.14159 * rand));
vec4 modelPosition = modelMatrix * vec4(position, 1.0);
modelPosition.y += sin(time * speed + modelPosition.x * noise.x * 100.0) * 0.2;
modelPosition.z += cos(time * speed + modelPosition.x * noise.y * 100.0) * 0.2;
modelPosition.x += cos(time * speed + modelPosition.x * noise.z * 100.0) * 0.2;
modelPosition.x = mod(modelPosition.x + 0.1 * time, 30.0) - 15.0;
// Create a low-frequency noise pattern based on the screen position,
// to control which particles are visible.
vec4 projectionPosition = projectionMatrix * viewMatrix * modelPosition;
vec2 screenPos = projectionPosition.xy / projectionPosition.w;
vec2 noiseUv = noiseFrequency * modelPosition.xy;
noiseUv.y += noiseOffset;
noiseUv.x *= 0.04;
noiseUv.y *= 0.14;
noiseUv.x -= 0.002 * time;
noiseUv.y -= 0.001 * time;
float noise = texture2D(noiseTexture, noiseUv).r;
float noiseMin = mix(0.0, 0.3, noiseFade);
noise = clamp((noise - noiseMin) * 7.0, 0.1, 1.0);
vOpacity *= noise;
vOpacity *= opacityMultiplier;
modelPosition.y += 0.25 * sin(-0.05 * time + 0.4 * modelPosition.x);
modelPosition.z -= 50.0;
vec4 viewPosition = viewMatrix * modelPosition;
gl_Position = projectionMatrix * viewPosition;
gl_PointSize = size * 25. * pixelRatio;
gl_PointSize *= (1.0 / - viewPosition.z);
// Fade out in the center, to avoid distracting from node graph.
vNdc = gl_Position.xy / gl_Position.w;
float vignetteDist = length(vNdc);
float vignetteStrength =
max(0.0, vignetteDist - vignetteStart) / (vignetteEnd - vignetteStart);
vOpacity *= mix(vignetteInnerMult, 1.0, smoothstep(0.0, 1.0, vignetteStrength));
}`,` ${_s}
varying vec3 vColor;
varying float vOpacity;
varying vec2 vNdc;
void main() {
float distanceToCenter = distance(gl_PointCoord, vec2(0.5));
float strength = smoothstep(0.5, 0.3, distanceToCenter);
gl_FragColor = clamp(vec4(vColor, strength * vOpacity), 0.0, 1.0);
#include <tonemapping_fragment>
#include <colorspace_fragment>
gl_FragColor.a = dither(gl_FragColor.a);
}`),$u=at({uNoiseTexture:null,uColor:new Te(.2,.2,.25),uNoiseColor1:new Te(.8,.8,1),uNoiseColor2:new Te(.5,.8,1),uVignetteStart:0,uVignetteEnd:1.5,uVignetteStrength:.66,uAspect:1,uTime:0},`
precision mediump float;
varying vec2 vNdc;
varying vec2 vUv;
void main () {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
vNdc = gl_Position.xy/gl_Position.w;
}`,`
${_s}
precision mediump float;
varying vec2 vNdc;
varying vec2 vUv;
uniform sampler2D uNoiseTexture;
uniform vec3 uColor;
uniform vec3 uNoiseColor1;
uniform vec3 uNoiseColor2;
uniform float uVignetteStart;
uniform float uVignetteEnd;
uniform float uVignetteStrength;
uniform float uTime;
uniform float uAspect;
void main() {
vec3 color = uColor;
vec2 noiseUv = 20.0 * vUv;
noiseUv.x *= 2.0;
float warpStrength = 4.0;
float warpFreq = 0.007;
noiseUv.x += warpStrength * texture2D(uNoiseTexture, warpFreq*noiseUv + uTime * vec2(0.001)).r;
noiseUv.y += warpStrength * texture2D(uNoiseTexture, warpFreq*noiseUv - uTime * vec2(0.001)).r;
float noiseStrength = 0.35;
float noiseFreq = 0.08;
float noise1 = noiseStrength * (texture2D(uNoiseTexture, noiseFreq * (noiseUv + (uTime+1.23) * vec2(0.03, -0.01))).r - 0.22);
float noise2 = noiseStrength * (texture2D(uNoiseTexture, noiseFreq * (noiseUv + (uTime+2.34) * vec2(0.01, -0.02))).r - 0.22);
float fade = mix(1.0, 0.5, 0.5 * vNdc.y + 0.5);
noise1 *= fade;
noise2 *= fade;
color = mix(color, 0.6*uNoiseColor1, max(0., 4.0 * noise1));
color = mix(color, 0.4*uNoiseColor2, max(0., 4.0 * noise2));
float dist = length(vNdc);
float vignetteStrength = uVignetteStrength *
max(0.0, dist - uVignetteStart) / (uVignetteEnd - uVignetteStart);
vignetteStrength = smoothstep(0.0, 1.0, vignetteStrength);
color = max(vec3(0.0, 0.0, 0.0), (1.0 - vignetteStrength) * color);
float colorSpeed = 0.1;
float colorFreq = 0.04;
color.r += 0.2 * (texture2D(uNoiseTexture, colorFreq * (noiseUv + (uTime+3.45) * vec2(colorSpeed))).r - 0.2);
color.g += 0.1 * (texture2D(uNoiseTexture, colorFreq * (noiseUv - (uTime+4.56) * vec2(colorSpeed))).r - 0.2);
color.b += 0.2 * (texture2D(uNoiseTexture, colorFreq * (noiseUv + (uTime+5.67) * vec2(colorSpeed, -colorSpeed))).r - 0.2);
color = clamp(color, 0.0, 1.0);
gl_FragColor = vec4(dither(color), 1.0);
}`);st({SkyBoxMaterial:$u});function Uu(){const e=a.useRef(Date.now()%1e3),t=a.useRef(),r=a.useRef(null);Ge((l,c)=>{e.current+=c,t.current.uniforms.uAspect.value=l.viewport.aspect,t.current.uniforms.uTime.value=e.current});const o=mt(l=>l.graphicsQuality),s=a.useMemo(()=>Math.random(),[]),i=bt(St,"./noise.png");return i.wrapS=ht,i.wrapT=ht,n.jsxs("group",{children:[n.jsxs("mesh",{children:[n.jsx("sphereGeometry",{args:[100,12,12]}),n.jsx("skyBoxMaterial",{ref:t,side:Ao,uNoiseTexture:i,uColor:"#707a90",dithering:!0})]}),o!==ct.Low&&n.jsxs(n.Fragment,{children:[n.jsx(Ra,{ref:r,count:250,speed:.5,minOpacity:.07,maxOpacity:.1,volumeOpacityMultiplier:1.5,minSize:400,maxSize:1500,fadeFrequency:.5,noiseFade:.5,noiseOffset:s,scale:[50,15,15],noise:1,noiseFrequency:.25}),n.jsx(Ra,{count:7e3,speed:.75,minOpacity:.08,maxOpacity:.3,volumeOpacityMultiplier:2,minSize:4,maxSize:15,fadeFrequency:1.5,noiseFade:.5,noiseOffset:s+.15,scale:[50,15,15],noise:1,noiseFrequency:.25})]})]})}const el=10.7,tl=20;function Hu({displayGraph:e}){const{camera:t,viewport:r}=or(),o=a.useRef(0),s=a.useRef(0),i=a.useRef(0),l=T(S=>S.isIndividualNode()),c=T(S=>S.isVolt()),d=T(S=>S.pluginName)===oe.BEAM,h=H(S=>d?Fe.getState().nodes.find(y=>y.id===S.selectedNodeId):Fe.getState().nodes.find(y=>y.type!=="start"&&y.type!=="end")),f=h?Bt.includes(h==null?void 0:h.type):void 0,p=H(S=>S.selectedStreamId),w=H(S=>S.showAddNodesPanel),x=H(S=>S.selectedMainView),m=[ee.IRBrowserA,ee.IRBrowserB,ee.IRBrowserC,ee.FilterPresetA,ee.FilterPresetB,ee.FilterPresetC,ee.FilterPresetD,ee.GrainPresetA,ee.GrainPresetB,ee.GrainPresetC,ee.TimePresetA,ee.TimePresetB,ee.TimePresetC,ee.VoltPresetA,ee.VoltPresetB,ee.VoltPresetC,ee.HazePresetA,ee.HazePresetB,ee.HazePresetC],v=x&&m.includes(x),b=a.useCallback(()=>{const S=l?24:35,y=e.maxY-e.minY+1,g=e.maxX-e.minX;let j=0,N=0,P=0;if(v&&h){const L=e.get(h.id);j=L.pos.x,N=L.pos.y,P=S}else{P=S;let L=el*g/r.aspect,I=tl*y;f?I*=1.35:h?I*=1.25:w?I*=1.075:p===Qe.all?I*=1.43:p&&(I*=1.28),P=Math.max(P,L,I)}return f?N-=.0135*P:h?N-=.0105*P:w?N-=.007*P:p===Qe.all?N-=.0145*P:p?N-=.013*P:N-=.003*P,c?(N+=.075,P-=2):l&&(N-=.07,P+=1.5),v&&(j+=.04*P),[j,N,P]},[l,v,h,f,w,p,c,r.aspect,e.maxX,e.maxY,e.minX,e.minY]);return a.useEffect(()=>{const[S,y,g]=b();o.current=S,s.current=y,i.current=g},[b]),a.useEffect(()=>{const[S,y,g]=b();t.position.x+=.6*(S-t.position.x),t.position.y+=.6*(y-t.position.y),t.position.z+=.6*(g-t.position.z)},[]),Ge(()=>{t.position.x+=.1*(o.current-t.position.x),t.position.y+=.1*(s.current-t.position.y),t.position.z+=.05*(i.current-t.position.z)}),n.jsx(n.Fragment,{})}const zs=`
vec4 mod289(vec4 x) {
return x - floor(x * (1.0 / 289.0)) * 289.0; }
float mod289(float x) {
return x - floor(x * (1.0 / 289.0)) * 289.0; }
vec4 permute(vec4 x) {
return mod289(((x*34.0)+1.0)*x);
}
float permute(float x) {
return mod289(((x*34.0)+1.0)*x);
}
vec4 taylorInvSqrt(vec4 r)
{
return 1.79284291400159 - 0.85373472095314 * r;
}
float taylorInvSqrt(float r)
{
return 1.79284291400159 - 0.85373472095314 * r;
}
vec4 grad4(float j, vec4 ip)
{
const vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);
vec4 p,s;
p.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;
p.w = 1.5 - dot(abs(p.xyz), ones.xyz);
s = vec4(lessThan(p, vec4(0.0)));
p.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;
return p;
}
// (sqrt(5) - 1)/4 = F4, used once below
#define F4 0.309016994374947451
float snoise(vec4 v)
{
const vec4 C = vec4( 0.138196601125011, // (5 - sqrt(5))/20 G4
0.276393202250021, // 2 * G4
0.414589803375032, // 3 * G4
-0.447213595499958); // -1 + 4 * G4
// First corner
vec4 i = floor(v + dot(v, vec4(F4)) );
vec4 x0 = v - i + dot(i, C.xxxx);
// Other corners
// Rank sorting originally contributed by Bill Licea-Kane, AMD (formerly ATI)
vec4 i0;
vec3 isX = step( x0.yzw, x0.xxx );
vec3 isYZ = step( x0.zww, x0.yyz );
// i0.x = dot( isX, vec3( 1.0 ) );
i0.x = isX.x + isX.y + isX.z;
i0.yzw = 1.0 - isX;
// i0.y += dot( isYZ.xy, vec2( 1.0 ) );
i0.y += isYZ.x + isYZ.y;
i0.zw += 1.0 - isYZ.xy;
i0.z += isYZ.z;
i0.w += 1.0 - isYZ.z;
// i0 now contains the unique values 0,1,2,3 in each channel
vec4 i3 = clamp( i0, 0.0, 1.0 );
vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );
vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );
// x0 = x0 - 0.0 + 0.0 * C.xxxx
// x1 = x0 - i1 + 1.0 * C.xxxx
// x2 = x0 - i2 + 2.0 * C.xxxx
// x3 = x0 - i3 + 3.0 * C.xxxx
// x4 = x0 - 1.0 + 4.0 * C.xxxx
vec4 x1 = x0 - i1 + C.xxxx;
vec4 x2 = x0 - i2 + C.yyyy;
vec4 x3 = x0 - i3 + C.zzzz;
vec4 x4 = x0 + C.wwww;
// Permutations
i = mod289(i);
float j0 = permute( permute( permute( permute(i.w) + i.z) + i.y) + i.x);
vec4 j1 = permute( permute( permute( permute (
i.w + vec4(i1.w, i2.w, i3.w, 1.0 ))
+ i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))
+ i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))
+ i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));
// Gradients: 7x7x6 points over a cube, mapped onto a 4-cross polytope
// 7*7*6 = 294, which is close to the ring size 17*17 = 289.
vec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;
vec4 p0 = grad4(j0, ip);
vec4 p1 = grad4(j1.x, ip);
vec4 p2 = grad4(j1.y, ip);
vec4 p3 = grad4(j1.z, ip);
vec4 p4 = grad4(j1.w, ip);
// Normalise gradients
vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));
p0 *= norm.x;
p1 *= norm.y;
p2 *= norm.z;
p3 *= norm.w;
p4 *= taylorInvSqrt(dot(p4,p4));
// Mix contributions from the five corners
vec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);
vec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);
m0 = m0 * m0;
m1 = m1 * m1;
return 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))
+ dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;
}
`,Gu=at({uColor:new Te(.9,.85,1),uAlpha:.5,uInnerRadius:0},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = 2.0 * (uv - vec2(0.5, 0.5));
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
uniform vec3 uColor;
uniform float uAlpha;
uniform float uInnerRadius;
void main() {
vec3 color = uColor;
float dist = clamp((length(vUv) - uInnerRadius) / (1.0 - uInnerRadius), 0.0, 1.0);
float alpha = dist;
alpha = alpha * alpha * (3.0 - 2.0 * alpha);
alpha = 1.0 - alpha;
alpha = alpha * alpha * alpha * alpha;
alpha = mix(0.0, uAlpha, alpha);
gl_FragColor = vec4(uColor, alpha);
}`,e=>{e.transparent=!0,e.depthWrite=!1,e.depthTest=!1,e.blending=wt});st({GlowCircleMaterial:Gu});function vn({position:e,renderOrder:t,radius:r,innerRadius:o,alpha:s,color:i}){const l=a.useRef();return Ge(c=>{l.current.lookAt(c.camera.position)}),n.jsxs("mesh",{ref:l,position:e,frustumCulled:!1,"material-transparent":!0,renderOrder:t||200,children:[n.jsx("circleGeometry",{args:[r||1,12]}),n.jsx("glowCircleMaterial",{blending:wt,uInnerRadius:o||0,uAlpha:s===void 0?.5:s,uColor:i||new Te(.9,.85,1)})]})}var nl=Object.defineProperty,Wu=Object.defineProperties,qu=Object.getOwnPropertyDescriptors,wo=Object.getOwnPropertySymbols,rl=Object.prototype.hasOwnProperty,ol=Object.prototype.propertyIsEnumerable,Da=(e,t,r)=>t in e?nl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dt=(e,t)=>{for(var r in t||(t={}))rl.call(t,r)&&Da(e,r,t[r]);if(wo)for(var r of wo(t))ol.call(t,r)&&Da(e,r,t[r]);return e},sl=(e,t)=>Wu(e,qu(t)),Tr=(e,t)=>{var r={};for(var o in e)rl.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&wo)for(var o of wo(e))t.indexOf(o)<0&&ol.call(e,o)&&(r[o]=e[o]);return r},Zt=(e,t)=>{for(var r in t)nl(e,r,{get:t[r],enumerable:!0})},al={};Zt(al,{_1:()=>il,_2:()=>ll,_3:()=>ul,_4:()=>dl,_5:()=>fl,_6:()=>ml,_7:()=>pl,_8:()=>hl,__1:()=>$s,__2:()=>cl,__3:()=>Zu,__4:()=>Yu,__5:()=>Xu,__6:()=>Ku,__7:()=>Ju,__8:()=>Qu,app:()=>He});function Ba(e,t,r){for(var o=new Array(r),s=0,i=t;s<r;)o[s]=e[i],s=s+1|0,i=i+1|0;return o}function He(e,t){for(;;){var r=t,o=e,s=o.length,i=s===0?1:s,l=r.length,c=i-l|0;if(c===0)return o.apply(null,r);if(c>=0)return function(u,d){return function(h){return He(u,d.concat([h]))}}(o,r);t=Ba(r,i,-c|0),e=o.apply(null,Ba(r,0,i))}}function il(e,t){var r=e.length;if(r===1)return e(t);switch(r){case 1:return e(t);case 2:return function(o){return e(t,o)};case 3:return function(o,s){return e(t,o,s)};case 4:return function(o,s,i){return e(t,o,s,i)};case 5:return function(o,s,i,l){return e(t,o,s,i,l)};case 6:return function(o,s,i,l,c){return e(t,o,s,i,l,c)};case 7:return function(o,s,i,l,c,u){return e(t,o,s,i,l,c,u)};default:return He(e,[t])}}function $s(e){var t=e.length;return t===1?e:function(r){return il(e,r)}}function ll(e,t,r){var o=e.length;if(o===2)return e(t,r);switch(o){case 1:return He(e(t),[r]);case 2:return e(t,r);case 3:return function(s){return e(t,r,s)};case 4:return function(s,i){return e(t,r,s,i)};case 5:return function(s,i,l){return e(t,r,s,i,l)};case 6:return function(s,i,l,c){return e(t,r,s,i,l,c)};case 7:return function(s,i,l,c,u){return e(t,r,s,i,l,c,u)};default:return He(e,[t,r])}}function cl(e){var t=e.length;return t===2?e:function(r,o){return ll(e,r,o)}}function ul(e,t,r,o){var s=e.length;if(s===3)return e(t,r,o);switch(s){case 1:return He(e(t),[r,o]);case 2:return He(e(t,r),[o]);case 3:return e(t,r,o);case 4:return function(i){return e(t,r,o,i)};case 5:return function(i,l){return e(t,r,o,i,l)};case 6:return function(i,l,c){return e(t,r,o,i,l,c)};case 7:return function(i,l,c,u){return e(t,r,o,i,l,c,u)};default:return He(e,[t,r,o])}}function Zu(e){var t=e.length;return t===3?e:function(r,o,s){return ul(e,r,o,s)}}function dl(e,t,r,o,s){var i=e.length;if(i===4)return e(t,r,o,s);switch(i){case 1:return He(e(t),[r,o,s]);case 2:return He(e(t,r),[o,s]);case 3:return He(e(t,r,o),[s]);case 4:return e(t,r,o,s);case 5:return function(l){return e(t,r,o,s,l)};case 6:return function(l,c){return e(t,r,o,s,l,c)};case 7:return function(l,c,u){return e(t,r,o,s,l,c,u)};default:return He(e,[t,r,o,s])}}function Yu(e){var t=e.length;return t===4?e:function(r,o,s,i){return dl(e,r,o,s,i)}}function fl(e,t,r,o,s,i){var l=e.length;if(l===5)return e(t,r,o,s,i);switch(l){case 1:return He(e(t),[r,o,s,i]);case 2:return He(e(t,r),[o,s,i]);case 3:return He(e(t,r,o),[s,i]);case 4:return He(e(t,r,o,s),[i]);case 5:return e(t,r,o,s,i);case 6:return function(c){return e(t,r,o,s,i,c)};case 7:return function(c,u){return e(t,r,o,s,i,c,u)};default:return He(e,[t,r,o,s,i])}}function Xu(e){var t=e.length;return t===5?e:function(r,o,s,i,l){return fl(e,r,o,s,i,l)}}function ml(e,t,r,o,s,i,l){var c=e.length;if(c===6)return e(t,r,o,s,i,l);switch(c){case 1:return He(e(t),[r,o,s,i,l]);case 2:return He(e(t,r),[o,s,i,l]);case 3:return He(e(t,r,o),[s,i,l]);case 4:return He(e(t,r,o,s),[i,l]);case 5:return He(e(t,r,o,s,i),[l]);case 6:return e(t,r,o,s,i,l);case 7:return function(u){return e(t,r,o,s,i,l,u)};default:return He(e,[t,r,o,s,i,l])}}function Ku(e){var t=e.length;return t===6?e:function(r,o,s,i,l,c){return ml(e,r,o,s,i,l,c)}}function pl(e,t,r,o,s,i,l,c){var u=e.length;if(u===7)return e(t,r,o,s,i,l,c);switch(u){case 1:return He(e(t),[r,o,s,i,l,c]);case 2:return He(e(t,r),[o,s,i,l,c]);case 3:return He(e(t,r,o),[s,i,l,c]);case 4:return He(e(t,r,o,s),[i,l,c]);case 5:return He(e(t,r,o,s,i),[l,c]);case 6:return He(e(t,r,o,s,i,l),[c]);case 7:return e(t,r,o,s,i,l,c);default:return He(e,[t,r,o,s,i,l,c])}}function Ju(e){var t=e.length;return t===7?e:function(r,o,s,i,l,c,u){return pl(e,r,o,s,i,l,c,u)}}function hl(e,t,r,o,s,i,l,c,u){var d=e.length;if(d===8)return e(t,r,o,s,i,l,c,u);switch(d){case 1:return He(e(t),[r,o,s,i,l,c,u]);case 2:return He(e(t,r),[o,s,i,l,c,u]);case 3:return He(e(t,r,o),[s,i,l,c,u]);case 4:return He(e(t,r,o,s),[i,l,c,u]);case 5:return He(e(t,r,o,s,i),[l,c,u]);case 6:return He(e(t,r,o,s,i,l),[c,u]);case 7:return He(e(t,r,o,s,i,l,c),[u]);default:return He(e,[t,r,o,s,i,l,c,u])}}function Qu(e){var t=e.length;return t===8?e:function(r,o,s,i,l,c,u,d){return hl(e,r,o,s,i,l,c,u,d)}}var ed={};Zt(ed,{$$Map:()=>Cd,$$Set:()=>Nd,RenderDelegate:()=>Md,mount:()=>bl,renderWithDelegate:()=>jd,visit:()=>Sl});var vl={};Zt(vl,{create:()=>wl,isNode:()=>bd,shallowCopy:()=>yl,symbol:()=>Hs});function Ta(e){var t=typeof e;return t==="undefined"?3:e===null?2:t==="number"?{TAG:0,_0:e}:t==="bigint"?{TAG:5,_0:e}:t==="string"?{TAG:1,_0:e}:t==="boolean"?e===!0?1:0:t==="symbol"?{TAG:4,_0:e}:t==="function"?{TAG:2,_0:e}:{TAG:3,_0:e}}function td(e,t){switch(t){case 0:return typeof e=="undefined";case 1:return e===null;case 2:return typeof e=="boolean";case 3:return typeof e=="number";case 4:return typeof e=="string";case 5:return typeof e=="function";case 6:return typeof e=="object";case 7:return typeof e=="symbol";case 8:return typeof e=="bigint"}}function nd(e){return e===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function rd(e){if(!(e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0))return e;var t=e.BS_PRIVATE_NESTED_SOME_NONE;if(t!==0)return{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}function od(e,t){for(;;){var r=t,o=e;if(!o)return r;var s={hd:o.hd,tl:0};r.tl=s,t=s,e=o.tl}}function sd(e,t,r){for(;;){var o=t,s=e;if(!s)return;var i={hd:r(s.hd),tl:0};o.tl=i,t=i,e=s.tl}}function ad(e,t,r,o){for(;;){var s=o,i=r,l=t;if(!i)return;var c={hd:e(l,i.hd),tl:0};s.tl=c,o=c,r=i.tl,t=l+1|0}}function id(e,t){if(!e)return t;var r={hd:e.hd,tl:0};return od(e.tl,r).tl=t,r}function ld(e,t){if(!e)return 0;var r={hd:t(e.hd),tl:0};return sd(e.tl,r,t),r}function xl(e,t){return ld(e,$s(t))}function cd(e,t){if(!e)return 0;var r={hd:t(0,e.hd),tl:0};return ad(t,1,e.tl,r),r}function ud(e,t){return cd(e,cl(t))}function dd(e){for(var t=e,r=0;;){var o=r,s=t;if(!s)return o;r=o+1|0,t=s.tl}}function fd(e,t,r){for(;;){var o=r,s=t;if(!o)return;e[s]=o.hd,r=o.tl,t=s+1|0}}function gl(e){for(var t=e.length-1|0,r=0;;){var o=r,s=t;if(s<0)return o;r={hd:e[s],tl:o},t=s-1|0}}function md(e){var t=dd(e),r=new Array(t);return fd(r,0,e),r}function pd(e,t){for(;;){var r=e;if(!r)return;t(r.hd),e=r.tl}}function hd(e,t){pd(e,$s(t))}function vd(e,t,r){for(;;){var o=t,s=e;if(!s)return o;t=r(o,s.hd),e=s.tl}}function xd(e,t,r,o){for(let s in o)if(o.hasOwnProperty(s)){const i=o[s];(!r.hasOwnProperty(s)||!nc(r[s],i))&&((typeof i=="undefined"||i===null||typeof i=="number"&&isNaN(i)||typeof i=="number"&&!isFinite(i))&&console.warn(`Warning: applying a potentially erroneous property value. ${s}: ${i}`),e.setProperty(t,s,i),r[s]=i)}}function gd(e,t){if(t in e)return nd(e[t])}function wd(e){if(e!==void 0)return rd(e);throw new Error("getExn")}function Oa(e,t,r,o){xd(e,t,r,o)}function Us(e,t){return Math.imul(e^t,16777619)}function qo(e,t){for(var r=e,o=0,s=t.length;o<=s;++o)r=Us(r,t.charCodeAt(o)|0);return r}function yd(e,t,r){var o=qo(-2128831035,e),s=gd(t,"key"),i=s!==void 0&&td(s,4)?qo(o,s):qo(o,wd(JSON.stringify(t)));return vd(r,i,Us)&2147483647}var Hs="__ELEM_NODE__";function wl(e,t,r){var o=gl(r);return{symbol:Hs,hash:yd(e,t,xl(o,function(s){return Us(s.hash,s.outputChannel)})),kind:e,props:t,outputChannel:0,children:o}}function bd(e){var t=Ta(e);if(typeof t=="number"||t.TAG!==3)return!1;var r=Ta(e.symbol);return typeof r=="number"||r.TAG!==1?!1:r._0===Hs}function yl(e){return{symbol:e.symbol,hash:e.hash,kind:e.kind,props:Object.assign({},e.props),outputChannel:e.outputChannel,generation:{contents:0}}}function Sd(e){return Array.from(e.values())}var Cd={valuesArray:Sd},Nd={},Md={};function bl(e,t){var r=e.getNodeMap();if(r.has(t.hash)){var o=r.get(t.hash);return Oa(e,o.hash,o.props,t.props)}e.createNode(t.hash,t.kind),Oa(e,t.hash,{},t.props),hd(t.children,function(s){e.appendChild(t.hash,s.hash,s.outputChannel)}),r.set(t.hash,yl(t))}function Sl(e,t,r){for(;;){var o=r,s=function(c){t.add(c.hash)};if(!o)return;var i=o.tl,l=o.hd;if(t.has(l.hash)){r=i;continue}s(l),bl(e,l),r=id(l.children,i)}}function jd(e,t,r,o){var s=new Set,i=ud(gl(t),function(l,c){return wl("root",{channel:l,fadeInMs:r,fadeOutMs:o},[c])});Sl(e,s,i),e.activateRoots(md(xl(i,function(l){return l.hash}))),e.commitUpdates()}var Fd=al,Gs=vl,Cl=function(e,t,r){return Fd._3(Gs.create,e,t,r)},Ad=Gs.isNode;Gs.shallowCopy;function ne(e){return typeof e=="number"?Cl("const",{value:e},[]):(ar(Nl(e),`Whoops, expecting a Node type here! Got: ${typeof e}`),e)}function Nl(e){return Ad(e)}function ge(e,t,r){return Cl(e,t,r.map(ne))}function Or(e,t){return Array.from({length:t},(r,o)=>sl(dt({},e),{outputChannel:o}))}var Rn={};Zt(Rn,{accum:()=>Id,biquad:()=>o1,capture:()=>d1,constant:()=>Ml,convolve:()=>$d,counter:()=>Pd,delay:()=>Jd,env:()=>Xd,fft:()=>u1,latch:()=>Dd,maxhold:()=>Bd,meter:()=>i1,metro:()=>_d,mm1p:()=>t1,once:()=>Td,phasor:()=>Ed,pole:()=>Yd,prewarp:()=>e1,rand:()=>Od,sample:()=>Vd,sampleseq:()=>qd,sampleseq2:()=>Zd,scope:()=>c1,sdelay:()=>Qd,seq:()=>Ud,seq2:()=>Hd,snapshot:()=>l1,sparseq:()=>Gd,sparseq2:()=>Wd,sr:()=>Ld,svf:()=>n1,svfshelf:()=>r1,syncphasor:()=>Rd,table:()=>zd,tapIn:()=>s1,tapOut:()=>a1,time:()=>kd,z:()=>Kd});function Ml(e){return ge("const",e,[])}function Ld(){return ge("sr",{},[])}function kd(){return ge("time",{},[])}function Pd(e){return ge("counter",{},[ne(e)])}function Id(e,t){return ge("accum",{},[ne(e),ne(t)])}function Ed(e){return ge("phasor",{},[ne(e)])}function Rd(e,t){return ge("sphasor",{},[ne(e),ne(t)])}function Dd(e,t){return ge("latch",{},[ne(e),ne(t)])}function Bd(e,t,r){return ge("maxhold",e,[ne(t),ne(r)])}function Td(e,t){return ge("once",e,[ne(t)])}function Od(e){return ge("rand",e||{},[])}function _d(e){return ge("metro",e||{},[])}function Vd(e,t,r){return ge("sample",e,[ne(t),ne(r)])}function zd(e,t){return ge("table",e,[ne(t)])}function $d(e,t){return ge("convolve",e,[ne(t)])}function Ud(e,t,r){return ge("seq",e,[ne(t),ne(r)])}function Hd(e,t,r){return ge("seq2",e,[ne(t),ne(r)])}function Gd(e,t,r){return ge("sparseq",e,[ne(t),ne(r)])}function Wd(e,t){return ge("sparseq2",e,[ne(t)])}function qd(e,t){return ge("sampleseq",e,[ne(t)])}function Zd(e,t){return ge("sampleseq2",e,[ne(t)])}function Yd(e,t){return ge("pole",{},[ne(e),ne(t)])}function Xd(e,t,r){return ge("env",{},[ne(e),ne(t),ne(r)])}function Kd(e){return ge("z",{},[ne(e)])}function Jd(e,t,r,o){return ge("delay",e,[ne(t),ne(r),ne(o)])}function Qd(e,t){return ge("sdelay",e,[ne(t)])}function e1(e){return ge("prewarp",{},[ne(e)])}function t1(e,t,r){return ge("mm1p",e,[ne(t),ne(r)])}function n1(e,t,r,o){return ge("svf",e,[ne(t),ne(r),ne(o)])}function r1(e,t,r,o,s){return ge("svfshelf",e,[ne(t),ne(r),ne(o),ne(s)])}function o1(e,t,r,o,s,i){return ge("biquad",{},[ne(e),ne(t),ne(r),ne(o),ne(s),ne(i)])}function s1(e){return ge("tapIn",e,[])}function a1(e,t){return ge("tapOut",e,[ne(t)])}function i1(e,t){return ge("meter",e,[ne(t)])}function l1(e,t,r){return ge("snapshot",e,[ne(t),ne(r)])}function c1(e,...t){return ge("scope",e,t.map(ne))}function u1(e,t){return ge("fft",e,[ne(t)])}function d1(e,t,r){return ge("capture",e,[ne(t),ne(r)])}var jl={};Zt(jl,{compress:()=>W1,skcompress:()=>q1});var Dn={};Zt(Dn,{abs:()=>M1,add:()=>R1,and:()=>I1,asinh:()=>v1,ceil:()=>y1,cos:()=>m1,div:()=>T1,eq:()=>P1,exp:()=>N1,floor:()=>b1,ge:()=>A1,geq:()=>L1,identity:()=>Fl,le:()=>j1,leq:()=>F1,ln:()=>x1,log:()=>g1,log2:()=>w1,max:()=>V1,min:()=>_1,mod:()=>O1,mul:()=>B1,or:()=>E1,pow:()=>k1,round:()=>S1,sin:()=>f1,sqrt:()=>C1,sub:()=>D1,tan:()=>p1,tanh:()=>h1});function Fl(e,t){return Nl(t)?ge("in",e,[t]):ge("in",e,[])}function f1(e){return ge("sin",{},[ne(e)])}function m1(e){return ge("cos",{},[ne(e)])}function p1(e){return ge("tan",{},[ne(e)])}function h1(e){return ge("tanh",{},[ne(e)])}function v1(e){return ge("asinh",{},[ne(e)])}function x1(e){return ge("ln",{},[ne(e)])}function g1(e){return ge("log",{},[ne(e)])}function w1(e){return ge("log2",{},[ne(e)])}function y1(e){return ge("ceil",{},[ne(e)])}function b1(e){return ge("floor",{},[ne(e)])}function S1(e){return ge("round",{},[ne(e)])}function C1(e){return ge("sqrt",{},[ne(e)])}function N1(e){return ge("exp",{},[ne(e)])}function M1(e){return ge("abs",{},[ne(e)])}function j1(e,t){return ge("le",{},[ne(e),ne(t)])}function F1(e,t){return ge("leq",{},[ne(e),ne(t)])}function A1(e,t){return ge("ge",{},[ne(e),ne(t)])}function L1(e,t){return ge("geq",{},[ne(e),ne(t)])}function k1(e,t){return ge("pow",{},[ne(e),ne(t)])}function P1(e,t){return ge("eq",{},[ne(e),ne(t)])}function I1(e,t){return ge("and",{},[ne(e),ne(t)])}function E1(e,t){return ge("or",{},[ne(e),ne(t)])}function R1(...e){return ge("add",{},e.map(ne))}function D1(...e){return ge("sub",{},e.map(ne))}function B1(...e){return ge("mul",{},e.map(ne))}function T1(...e){return ge("div",{},e.map(ne))}function O1(...e){return ge("mod",{},e.map(ne))}function _1(...e){return ge("min",{},e.map(ne))}function V1(...e){return ge("max",{},e.map(ne))}var _r={};Zt(_r,{db2gain:()=>U1,gain2db:()=>H1,hann:()=>G1,ms2samps:()=>z1,select:()=>Al,tau2pole:()=>$1});var ft=dt(dt({},Rn),Dn);function z1(e){return ft.mul(ft.sr(),ft.div(e,1e3))}function $1(e){return ft.exp(ft.div(-1,ft.mul(e,ft.sr())))}function U1(e){return ft.pow(10,ft.mul(e,1/20))}function H1(e){return Al(ft.ge(e,0),ft.max(-120,ft.mul(20,ft.log(e))),-120)}function Al(e,t,r){return ft.add(ft.mul(e,t),ft.mul(ft.sub(1,e),r))}function G1(e){return ft.mul(.5,ft.sub(1,ft.cos(ft.mul(2*Math.PI,e))))}var Ue=dt(dt(dt({},Rn),Dn),_r);function W1(e,t,r,o,s,i){const l=Ue.env(Ue.tau2pole(Ue.mul(.001,e)),Ue.tau2pole(Ue.mul(.001,t)),s),c=Ue.gain2db(l),u=Ue.sub(1,Ue.div(1,o)),d=Ue.mul(u,Ue.sub(r,c)),h=Ue.min(0,d),f=Ue.db2gain(h);return Ue.mul(i,f)}function q1(e,t,r,o,s,i,l){const c=Ue.env(Ue.tau2pole(Ue.mul(.001,e)),Ue.tau2pole(Ue.mul(.001,t)),i),u=Ue.gain2db(c),d=Ue.sub(r,Ue.div(s,2)),h=Ue.add(r,Ue.div(s,2)),f=Ue.and(Ue.geq(u,d),Ue.leq(u,h)),p=Ue.sub(1,Ue.div(1,o)),w=Ue.select(f,Ue.mul(Ue.div(p,2),Ue.mul(Ue.div(Ue.sub(u,d),s),Ue.sub(d,u))),Ue.mul(p,Ue.sub(r,u))),x=Ue.min(0,w),m=Ue.db2gain(x);return Ue.mul(l,m)}var Ll={};Zt(Ll,{adsr:()=>a0});var Eo={};Zt(Eo,{allpass:()=>t0,bandpass:()=>Q1,dcblock:()=>Y1,df11:()=>X1,highpass:()=>J1,highshelf:()=>o0,lowpass:()=>K1,lowshelf:()=>r0,notch:()=>e0,peak:()=>n0,pink:()=>s0,sm:()=>Z1,smooth:()=>kl,zero:()=>Ws});var Je=dt(dt(dt({},Rn),Dn),_r);function kl(e,t){return Je.pole(e,Je.mul(Je.sub(1,e),t))}function Z1(e){return kl(Je.tau2pole(.02),e)}function Ws(e,t,r){return Je.sub(Je.mul(e,r),Je.mul(t,Je.z(r)))}function Y1(e){return Je.pole(.995,Ws(1,1,e))}function X1(e,t,r,o){return Je.pole(r,Ws(e,t,o))}function K1(e,t,r){return Je.svf({mode:"lowpass"},e,t,r)}function J1(e,t,r){return Je.svf({mode:"highpass"},e,t,r)}function Q1(e,t,r){return Je.svf({mode:"bandpass"},e,t,r)}function e0(e,t,r){return Je.svf({mode:"notch"},e,t,r)}function t0(e,t,r){return Je.svf({mode:"allpass"},e,t,r)}function n0(e,t,r,o){return Je.svfshelf({mode:"peak"},e,t,r,o)}function r0(e,t,r,o){return Je.svfshelf({mode:"lowshelf"},e,t,r,o)}function o0(e,t,r,o){return Je.svfshelf({mode:"highshelf"},e,t,r,o)}function s0(e){return((r,o,s)=>Je.min(o,Je.max(r,s)))(-1,1,Je.mul(Je.db2gain(-30),Je.add(Je.pole(.99765,Je.mul(e,.099046)),Je.pole(.963,Je.mul(e,.2965164)),Je.pole(.57,Je.mul(e,1.0526913)),Je.mul(.1848,e))))}var Ot=dt(dt(dt(dt({},Rn),Dn),Eo),_r);function a0(e,t,r,o,s){let[i,l,c,u,d]=[e,t,r,o,s],h=Ot.mul(i,Ot.sr()),f=Ot.le(Ot.counter(d),h),p=Ot.select(d,Ot.select(f,1,c),0),w=Ot.max(1e-4,Ot.select(d,Ot.select(f,i,l),u)),x=Ot.tau2pole(Ot.div(w,6.91));return Ot.smooth(x,p)}var Pl={};Zt(Pl,{capture:()=>d0,sample:()=>i0,sampleseq:()=>l0,sampleseq2:()=>c0,table:()=>u0});function i0(e,t){let r=e,{channels:o}=r,s=Tr(r,["channels"]);return ar(typeof o=="number"&&o>0,"Must provide a positive number channels prop"),Or(ge("mc.sample",s,[ne(t)]),o)}function l0(e,t){let r=e,{channels:o}=r,s=Tr(r,["channels"]);return ar(typeof o=="number"&&o>0,"Must provide a positive number channels prop"),Or(ge("mc.sampleseq",s,[ne(t)]),o)}function c0(e,t){let r=e,{channels:o}=r,s=Tr(r,["channels"]);return ar(typeof o=="number"&&o>0,"Must provide a positive number channels prop"),Or(ge("mc.sampleseq2",s,[ne(t)]),o)}function u0(e,t){let r=e,{channels:o}=r,s=Tr(r,["channels"]);return ar(typeof o=="number"&&o>0,"Must provide a positive number channels prop"),Or(ge("mc.table",s,[ne(t)]),o)}function d0(e,t,...r){let o=e,{channels:s}=o,i=Tr(o,["channels"]);return ar(typeof s=="number"&&s>0,"Must provide a positive number channels prop"),Or(ge("mc.capture",i,[ne(t),...r.map(ne)]),s)}var Il={};Zt(Il,{blepsaw:()=>h0,blepsquare:()=>v0,bleptriangle:()=>x0,cycle:()=>f0,noise:()=>Dl,pinknoise:()=>g0,saw:()=>Rl,square:()=>m0,train:()=>El,triangle:()=>p0});var Ct=dt(dt(dt({},Rn),Dn),Eo);function El(e){return Ct.le(Ct.phasor(e),.5)}function f0(e){return Ct.sin(Ct.mul(2*Math.PI,Ct.phasor(e)))}function Rl(e){return Ct.sub(Ct.mul(2,Ct.phasor(e)),1)}function m0(e){return Ct.sub(Ct.mul(2,El(e)),1)}function p0(e){return Ct.mul(2,Ct.sub(.5,Ct.abs(Rl(e))))}function h0(e){return ge("blepsaw",{},[ne(e)])}function v0(e){return ge("blepsquare",{},[ne(e)])}function x0(e){return ge("bleptriangle",{},[ne(e)])}function Dl(e){return Ct.sub(Ct.mul(2,Ct.rand(e)),1)}function g0(e){return Ct.pink(Dl(e))}sl(dt(dt(dt(dt(dt(dt(dt({},Rn),jl),Ll),Eo),Dn),Il),_r),{mc:Pl,const:Ml,in:Fl});const We=(e,t,r,o)=>{e=Re(e,t,r);const s=(e-t)/(r-t);return Math.pow(s,o)},xt=(e,t,r,o)=>{const s=Math.pow(e,1/o);return t+(r-t)*s};function _e(e){return Ar(e)[0]}function Ar(e){var x,m;const t=Fe.getState(),r=tr.getState();if(!(e in t))return[0,!1];const o=ze();if(!(e in o))return[0,!1];const{min:s,max:i,skew:l}=o[e];let c=t[e],u=!1,d=We(c,s,i,l);const h=t.macros.find(v=>v.paramId===e);h&&(d+=h.strength*(.01*t.macro-.5*h.bipolar),u=!0);const f=t.modulations.find(v=>v.paramId===e);if(f){const b=(x=r.snapshots[`${f.lfoType}_snapshot`])!=null?x:0;let S;Object.values(be).some(y=>e===`${y}Amount`)?S=t[`${f.lfoType}Amount`]/100:S=Ar(`${f.lfoType}Amount`)[0]/100,d+=f.strength*(b-.5*S*f.bipolar),u=!0}const p=w0(e);if(p&&t[`${p}Enabled`]&&.01*Ar(`${p}Amount`)[0]!==0){const S=(m=tr.getState().snapshots[`${p}_snapshot`])!=null?m:0;d+=S,u=!0}let w=Re(d,0,1);return c=xt(w,s,i,l),[c,u]}const Lr={};Lr[`${A.convA}Mix`]=be.LFO_CONV_A;Lr[`${A.convB}Mix`]=be.LFO_CONV_B;Lr[`${A.convC}Mix`]=be.LFO_CONV_C;function w0(e){return e in Lr?Lr[e]:void 0}const y0=at({uColor:new Te(1,1,1)},`
precision mediump float;
varying vec3 vNormal;
void main () {
vNormal = (modelViewMatrix * vec4(normal, 0.0)).xyz;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec3 vNormal;
uniform vec3 uColor;
void main() {
float brightness = mix(0.9, 1.0, dot(vNormal, vec3(0.0, 0.0, 1.0)));
gl_FragColor = vec4(uColor * brightness, 1.0);
}`,e=>{e.transparent=!0});st({NodeCoreMaterial:y0});function cr({renderOrder:e,snapshotId:t,mixParam:r,enabledParam:o,muted:s,color:i,disableFrustumCulling:l,vibrationAmount:c,lensFlare:u,lensFlareRadius:d,lensFlareAlpha:h,showContactHighlights:f}){const p=a.useRef(null),w=a.useRef(null),x=a.useRef(null),m=a.useRef(null),v=a.useRef(null),b=a.useRef(null);Ge(P=>{var R;x.current.lookAt(P.camera.position);const I=r?_e(r)*.01:1,C=!s&&(o?Fe.getState()[o]:1),M=.93*I*C;if(t){const O=I*Tt(t),_=1+(c!=null?c:1)*.07*Math.pow(O,.5)*Math.sin(.07*Date.now());p.current&&p.current.scale.set(_,_,_)}w.current&&w.current.scale.set(M,M,M),i&&m.current&&m.current.uniforms.uColor.value.copy(i),(R=v.current)!=null&&R.userData.uGrayscale&&(v.current.userData.uGrayscale.value=C?0:1),b.current&&(b.current.uniforms.uAlpha.value=(h||.125)*(I-.5)/(1-.5))});const S=.1,y=.103,g=mt(P=>P.graphicsQuality);let j=24;g===ct.Low&&(j=12);const N=bt(St,"./noise.png");return n.jsxs("group",{ref:p,scale:[.75,.75,.75],frustumCulled:!l,children:[n.jsxs("group",{ref:w,children:[n.jsxs("mesh",{renderOrder:(e||0)+2,frustumCulled:!l,children:[n.jsx("sphereGeometry",{args:[S,j,j]}),n.jsx("nodeCoreMaterial",{ref:m})]}),n.jsx(vn,{color:[.7,.7,1],alpha:.5,radius:.45,innerRadius:.1,renderOrder:(e||0)+100}),u&&g!==ct.Low&&n.jsxs("mesh",{renderOrder:1e3,children:[n.jsx("circleGeometry",{args:[d||1.25]}),n.jsx("lensFlareMaterial",{ref:b,uTexture:N,uScale:.28,uOffset:[.2,.2]})]})]}),f&&n.jsxs(n.Fragment,{children:[n.jsx(vn,{position:new Oe(-S,0,0),renderOrder:(e||0)+100,radius:.08,innerRadius:0,alpha:.25}),n.jsx(vn,{position:new Oe(S,0,0),renderOrder:(e||0)+100,radius:.08,innerRadius:0,alpha:.25})]}),n.jsxs("mesh",{renderOrder:e||0,frustumCulled:!l,children:[n.jsx("sphereGeometry",{args:[y,j,j]}),n.jsx("meshStandardMaterial",{ref:v,transparent:!0,opacity:.5,metalness:0,roughness:.2,color:"#333333",depthWrite:!1,onBeforeCompile:P=>{v.current.userData.uGrayscale={value:1},P.uniforms.uGrayscale=v.current.userData.uGrayscale,P.fragmentShader=`
uniform int uGrayscale;
`+P.fragmentShader.replace("}",`
gl_FragColor.a *= mix(0.1, 1.0, pow(1. - dot(normal, vec3(0., 0., 1.)), 2.0));
float highlight = 1.0 - dot(normal, vec3(0., 0., 1.));
float bottom = clamp(dot(normal, vec3(0., -1., 0.)), 0., 1.);
float top = pow(clamp(dot(normal, vec3(0., 1., 0.)), 0., 1.), 2.0);
highlight = pow(mix(1., 2., bottom)*highlight, mix(1., 5.0, bottom));
vec4 highlightColor = mix(
vec4(0.3, 0.3, 1.0, 0.4),
vec4(0.5, 0.3, 1.0, 0.4),
bottom);
highlightColor = mix(
highlightColor,
vec4(0.3),
top);
gl_FragColor += mix(vec4(0.2), highlightColor, highlight);
if (uGrayscale == 1) {
float grayscale = dot(gl_FragColor.rgb, vec3(0.299, 0.587, 0.114));
gl_FragColor.rgb = vec3(grayscale);
}
}`)}})]}),n.jsxs("mesh",{ref:x,renderOrder:e||0,frustumCulled:!l,children:[n.jsx("ringGeometry",{args:[.1,.103,j]}),n.jsx("meshBasicMaterial",{transparent:!0,opacity:.6,color:"white"})]})]})}const b0=at({uTexture:null,uAlpha:.3,uScale:1,uOffset:new sr(0,0)},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = 2.0 * (uv - vec2(0.5, 0.5));
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
${_s}
precision mediump float;
varying vec2 vUv;
uniform sampler2D uTexture;
uniform float uAlpha;
uniform float uScale;
uniform vec2 uOffset;
float fpow(float x, float k){
return x > k ? pow((x-k)/(1.0-k),2.0) : 0.0;
}
void main() {
float alpha = texture2D(uTexture, normalize(vUv) * uScale + uOffset).r;
alpha = clamp(2.0 * (alpha - 0.0), 0.0, 1.0);
alpha *= alpha;
alpha *= uAlpha;
float inverseDist = clamp(1.1 - length(vUv), 0.0, 1.0);
alpha *= inverseDist * inverseDist;
gl_FragColor = vec4(dither(vec3(alpha)), 1.0);
}`,e=>{e.transparent=!0,e.blending=wt,e.depthWrite=!1,e.depthTest=!1});st({LensFlareMaterial:b0});function hs({type:e,prevId:t,isDragging:r,isMuted:o,disableFrustumCulling:s}){const i=a.useRef(),l=a.useRef(),c=a.useRef(),u=a.useRef(),d=a.useMemo(()=>.001*Date.now(),[]),h=a.useRef(0),f=a.useRef(0),p=a.useRef(0),w=a.useRef(0),x=2e3,m=8,v=4,b=a.useMemo(()=>new rc,[]),S=a.useMemo(()=>{const te=[];for(let ue=0;ue<x;ue++){const he=_a();he.creationTime=-1*Math.random()*v,te.push(he)}return te},[]),y=`${e}Enabled`,g=`${e}Mix`,j=`${e}Pitch`,N=`${e}RandomSize`,P=`${e}Rate`,L=`${e}RateSizeLink`,I=`${e}Size`,C=`${e}Spray`,M=`${e}DelayFeedback`,R=`${e}Delay`,O=`${e}DelayTempoSyncEnabled`,_=`${e}DelayEnabled`,z=`${e}Arp`,U=a.useMemo(()=>ze(),[]),$=a.useRef(!1);$.current=T(te=>te[_]);const E=T(te=>te[O])?"grainDelaySync":"grainDelayMs",q=U[E],W=U[M],{min:F,max:Z,skew:Y}=q,{min:me,max:Se}=W,je=a.useRef(0),ye=a.useRef(0),le=mt(te=>te.graphicsQuality),Me=a.useMemo(()=>new it(new Float32Array(x),1),[]),ve=a.useMemo(()=>new it(new Float32Array(4*x),4),[]),K=a.useMemo(()=>new it(new Float32Array(x),1),[]),ce=a.useMemo(()=>[],[]);a.useLayoutEffect(()=>{const te=i.current;te.setColorAt(0,new Te),ce.push(te.instanceMatrix,te.instanceColor,Me,ve,K);for(let ue=0;ue<x;ue++)re(ue);te.geometry.setAttribute("creationTime",Me),te.geometry.setAttribute("orbit",ve),te.geometry.setAttribute("rand",K)},[]),a.useEffect(()=>{const te=i.current,ue=le===ct.Low?4:le===ct.Medium?8:16,he=[];for(let Q=0;Q<ue;Q++)he.push(l.current.clone());te.onAfterRender=(Q,Ne,xe,ae,we,Ae)=>{if(!$.current)return;const Ce=we;for(let qe=0;qe<he.length;qe++){const B=(.025+1*je.current)*(qe+1),G=1+.5*yt(Math.log10(ye.current),-3,-.1)*(qe+1);if(G<=0||B<=0)continue;const pe=he[qe];for(const[ke,Pe]of Object.entries(pe.uniforms))Pe.value=Ce.uniforms[ke].value;pe.uniforms.uDelayOffset.value=B,pe.uniforms.uDelayScale.value=.8*G,pe.uniforms.uDelayIteration.value=qe+1,Q.renderBufferDirect(xe,Ne,ae,pe,te,Ae)}}},[le]);function re(te){const ue=i.current,{creationTime:he,speed:Q,axis:Ne,pos:xe,rand:ae,color:we}=S[te];b.position.set(xe.x,xe.y,xe.z),b.updateMatrix(),ue.setMatrixAt(te,b.matrix),ue.setColorAt(te,we),Me.array[te]=he,ve.array[4*te+0]=Ne.x,ve.array[4*te+1]=Ne.y,ve.array[4*te+2]=Ne.z,ve.array[4*te+3]=Q,K.array[te]=ae;for(const Ae of ce){Ae.needsUpdate=!0;const Ce=te*Ae.itemSize;Ae.updateRange.offset<0?(Ae.updateRange.offset=Ce,Ae.updateRange.count=Ae.itemSize):Ae.updateRange.offset+Ae.updateRange.count<Ce?Ae.updateRange.count=Math.max(Ae.updateRange.count,Ce-Ae.updateRange.offset+Ae.itemSize):Ae.updateRange.offset>te&&(Ae.updateRange.count+=Ae.updateRange.offset-Ce,Ae.updateRange.offset=Ce)}}return Ge(te=>{const ue=c.current;ue.lookAt(te.camera.position);const he=Fe.getState(),Q=he[y],Ne=he[N]/100,xe=he[L],ae=he[z],we=_e(j),Ae=_e(P);let Ce=_e(I);const qe=_e(C),B=_e(g)/100;je.current=We(_e(R),F,Z,Y),ye.current=We(_e(M),me,Se,1);const G=2+98*Math.pow(Ae,2);xe?Ce=Math.pow(2,Ce*6-4)*1e3/G:Ce=10+990*Ce,Ce=1+8*Math.sqrt(Ce/1e3);const pe=.001*Date.now()-d,ke=se(.2,1,Math.pow(qe/1e3,.5));w.current+=.05*(ke-w.current);const Pe=pe-h.current;h.current=pe,p.current+=Bl*w.current*Pe,f.current+=se(1,.5,w.current)*Pe;const Ie=l.current.uniforms;Ie.uTime.value=pe,Ie.uOrbitTime.value=f.current,Ie.uNoiseTime.value=p.current,Ie.uNoiseStrength.value=w.current,Ie.uScale.value=Ce,Ie.uScaleRandomness.value=Ne,Ie.uLifetime.value=v,Ie.uEnabled.value=Q&&!o,Ie.uMix.value=Q&&!o?B:0;const $e=1+.4*(we/24);Ie.uColorScale.value=$e,Ie.uArpColorRange.value=ae>1?.2:0;let Xe=0;const De=Math.pow((G-2)/98,1.25),Ve=x*(le===ct.Low?.75:1);Xe=Math.round(se(m,Ve,De));const et=.75*De*(1+ye.current),rt=Math.pow(yt(se(1,.25,et),.3,1),1.5);Ce=Math.min(Ce,Math.max(2,Ce*rt)),Ie.uScale.value=Ce;const ot=Xe/Ve;u.current.uniforms.uAlpha.value=.3+.1*ot;const J=1.2+.1*ot;ue.scale.set(J,J,J);const Ee=i.current;Ee.count=Xe;for(const Ze of ce)Ze.needsUpdate=!1,Ze.updateRange.count=-1,Ze.updateRange.offset=-1;for(let Ze=0;Ze<Xe;Ze++){const pt=S[Ze].creationTime;if(pe>pt+v){const en=_a();en.creationTime=pe-(pe-pt)%v,S[Ze]=en,re(Ze)}}}),n.jsxs("group",{children:[n.jsxs("mesh",{ref:c,"material-transparent":!0,frustumCulled:!s,position:[0,0,0],children:[n.jsx("circleGeometry",{args:[1,12]}),n.jsx("grainCenterMaterial",{ref:u})]}),n.jsxs("instancedMesh",{ref:i,frustumCulled:!s,args:[void 0,void 0,x],children:[n.jsx("circleGeometry",{args:[.005,24]}),n.jsx("grainMaterial",{ref:l})]}),n.jsx(cr,{mixParam:`${e}Mix`,enabledParam:`${e}Enabled`,muted:o,snapshotId:t,renderOrder:100,showContactHighlights:!r,disableFrustumCulling:s,lensFlare:!0})]})}function _a(){const e=new Oe;e.randomDirection();const t=new Oe;t.randomDirection(),t.multiplyScalar(.3+.3*Math.random());const r=new Te;return r.setHSL(se(.58,.75,Math.random()),.5,se(.55,.65,Math.random())),{rand:Math.random(),creationTime:0,speed:1+1*Math.random(),axis:e,pos:t,color:r}}const Bl=.75,S0=at({uColor:new Te(.95,.9,1),uAlpha:.3},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = 2.0 * (uv - vec2(0.5, 0.5));
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
uniform vec3 uColor;
uniform float uAlpha;
void main() {
vec3 color = uColor;
float alpha = clamp((length(vUv) - 0.0) / 1.0, 0.0, 1.0);
alpha = alpha * alpha * (3.0 - 2.0 * alpha);
alpha = 1.0 - alpha;
alpha = alpha * alpha * alpha * alpha;
alpha = mix(0.0, uAlpha, alpha);
gl_FragColor = vec4(uColor, alpha);
}`,e=>{e.transparent=!0,e.depthWrite=!1});st({GrainCenterMaterial:S0});const C0=at({uColor:new Te(.5,1,.9),uTime:0,uOrbitTime:0,uNoiseTime:0,uNoiseStrength:0,uScale:1,uScaleRandomness:0,uColorScale:1,uArpColorRange:0,uLifetime:1,uEnabled:1,uMix:1,uDelayIteration:0,uDelayOffset:0,uDelayScale:1},`
${zs}
${Io}
precision mediump float;
attribute float creationTime;
attribute vec4 orbit; // axis and speed
attribute float rand;
varying vec2 vUv;
varying vec3 vColor;
varying vec3 vOrbitPos;
varying vec3 vViewPos;
uniform float uTime;
uniform float uOrbitTime;
uniform float uNoiseTime;
uniform float uNoiseStrength;
uniform float uScale;
uniform float uScaleRandomness;
uniform float uLifetime;
uniform float uColorScale;
uniform float uArpColorRange;
uniform float uDelayOffset;
uniform float uDelayScale;
uniform int uDelayIteration;
void main () {
vUv = uv;
// Scale particles.
float scale = uScale;
float randomScale = pow(2.0, 2.0 * rand - 1.0);
scale *= mix(1.0, randomScale, mix(0.25, 1.0, uScaleRandomness));
float fadeDuration = 0.25;
float life = uTime - creationTime;
scale *= sqrt(clamp(life / fadeDuration, 0.0, 1.0) *
clamp((uLifetime - life) / fadeDuration, 0.0, 1.0));
scale *= uDelayScale;
vec3 pos = scale * position;
// Spin particles around.
// float spinSpeed = 5.0 * orbit.w;
// mat4 spinMatrix = rotationMatrix(vec3(0.0, 0.0, 1.0), spinSpeed * uTime);
// pos = (spinMatrix * vec4(pos, 1.0)).xyz;
vec4 instanceCenter = instanceMatrix * vec4(0.0, 0.0, 0.0, 1.0);
// Orbit about the center of the grain engine.
float delayOffset = uScale * uDelayOffset * mix(1.0, 0.25, uNoiseStrength);
float orbitTime = uOrbitTime - delayOffset;
vec3 orbitAxis = orbit.xyz;
mat4 orbitMatrix = rotationMatrix(orbitAxis, orbit.w * orbitTime);
vec4 orbitPos = orbitMatrix * instanceCenter;
// Apply noise to position.
if (uNoiseStrength > 0.0) {
float noiseTime = uNoiseTime - ${Bl} * uNoiseStrength * delayOffset;
float noiseFreq = 2.0;
float noiseAmp = mix(0.0, 0.5, uNoiseStrength);
vec3 noisePos = noiseFreq * orbitPos.xyz;
orbitPos.xyz *= mix(1.0, 0.4, uNoiseStrength);
orbitPos.x += noiseAmp * snoise(vec4(noisePos, noiseTime));
orbitPos.y += noiseAmp * snoise(vec4(noisePos, noiseTime + 10.0));
orbitPos.z += noiseAmp * snoise(vec4(noisePos, noiseTime + 20.0));
}
vec4 viewPos = modelViewMatrix * (orbitPos + vec4(pos, 0.0));
// Scale color based on pitch shift.
float colorScale = uColorScale + uArpColorRange * fract(rand * 12.34);
// Make color shift compound for delayed grains, with a falloff so it
// doesn't go straight to white.
float colorMultIterations = pow(float(uDelayIteration + 1), 0.5);
float colorMult = pow(colorScale, colorMultIterations);
vColor = colorMult * instanceColor;
// Brighter towards the center.
float center = 1.0 - 2.0 * distance(vUv, vec2(0.5, 0.5));
center = clamp(center, 0.0, 1.0);
vColor *= mix(0.8, 1.1, sqrt(center));
vOrbitPos = orbitPos.xyz;
vViewPos = viewPos.xyz;
gl_Position = projectionMatrix * viewPos;
}`,`
precision mediump float;
varying vec2 vUv;
varying vec3 vColor;
varying vec3 vOrbitPos;
varying vec3 vViewPos;
uniform int uEnabled;
uniform float uMix;
void main() {
vec3 color = vColor;
// Grayscale disabled nodes.
if (uEnabled == 0) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
grayscale = mix(0.1, 1.0, grayscale);
color.rgb = vec3(grayscale);
}
float distToLight = length(vOrbitPos);
vec3 toLight = -1.0 * vOrbitPos / distToLight;
vec3 normal = vec3(2.0 * (vUv - vec2(0.5)), 0.0);
normal.z = sqrt(1.0 - normal.x * normal.x - normal.y * normal.y);
normal = (viewMatrix * vec4(normal, 0.0)).xyz;
toLight = (viewMatrix * vec4(toLight, 0.0)).xyz;
vec3 fromEye = normalize(vViewPos);
float lighting = mix(
1.0,
1.8,
clamp(dot(normal, toLight), 0.0, 1.0));
lighting +=
1.0 * pow(clamp(dot(reflect(fromEye, normal), toLight), 0.0, 1.0), 5.0);
lighting *= mix(1.25, 0.75, 2.0 * distToLight);
color *= mix(0.9, lighting, mix(0.1, 1.0, uMix));
gl_FragColor = vec4(color, 1.0);
}`,e=>{e.transparent=!0});st({GrainMaterial:C0});const Xn={spacing:.2,speed:1.25,spinSpeed:.6,reflectionStrength:1,reflectionLength:1,reflectionCount:3,reflectionOffset:0,blurriness:.025,col1:new Te(167,136,255).multiplyScalar(1/255).convertLinearToSRGB(),col2:new Te(14,10,21).multiplyScalar(1/255).convertLinearToSRGB(),alphaMultiplier:1,rampExponent:1,vignette:0,enableTexture:!1,enableNoise:!0,noiseAmp:.05,noiseFreq:2,noiseSpeed:.5,noiseFalloff:1,enableSquare:!1,enableStar:!1,starFreq:2,starAmp:.9,enableStarNoise:!1,starNoiseAmp:.1,starNoiseFreq:7,starNoiseSpeed:.5,enableFlowers:!1,flowerFreq:5,flowerAmp:.1,enableRadialRipples:!1,rippleFreq:10,rippleAmp:.5,rippleSpeed:1,enablePixelate:!1,pixellateFreq:20,enableReversePixelate:!1,reversePixelateFreq:20,enableSquareOffsets:!1,squareFreq:40,squareAmp:.4,squareCount:2,lightingDiffuse:.65,lightingSpec:.5,lightingShininess:40,lightingFade:.15},N0={shellNoiseAmp:0,shellNoiseFreq:2,shellNoiseSpeed:1},mr=10,M0=at(k({uTime:0,uWaveTime:0,uIntensityInSamples:new Array(mr).fill(0),uIntensityOut:0,uSpacingMultiplier:1,uEnabled:1,textureMap:null},Xn),`
precision mediump float;
varying vec2 vUv;
void main () {
vec4 pWorld = modelMatrix * vec4(position, 1.0);
vec4 centerWorld = modelMatrix * vec4(0.0, 0.0, 0.0, 1.0);
float scale = length(modelMatrix * vec4(1.0, 0.0, 0.0, 0.0));
// Figure out a [-1,1] "uv" coordinate by projecting the point onto a flat
// camera-facing disk.
vec3 centerViewSpace = (modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xyz;
vec3 fromCameraViewSpace = normalize(modelViewMatrix * vec4(position, 1.0)).xyz;
float distanceToDisk = dot(centerViewSpace, fromCameraViewSpace);
vec3 circlePosViewSpace = distanceToDisk * fromCameraViewSpace;
vUv = 2.0 / scale * (circlePosViewSpace - centerViewSpace).xy;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
${zs}
${Ou}
${Io}
precision mediump float;
${Object.entries(Xn).map(([e,t])=>`uniform ${e=="reflectionCount"?"int":typeof t=="boolean"?"bool":typeof t=="number"?"float":"vec3"} ${e};`).join(`
`)}
varying vec2 vUv;
uniform float uTime;
uniform float uWaveTime;
uniform float uIntensityOut;
uniform float uIntensityInSamples[${mr}];
uniform float uSpacingMultiplier;
uniform int uEnabled;
uniform sampler2D textureMap;
vec3 lightDir = normalize(vec3(-0.3, 1.0, 0.8));
float getLighting(vec2 uv, float tBand) {
float radius = length(uv) + (1.0 - tBand + 0.1) * spacing;
vec3 N = vec3(uv.x, uv.y, sqrt(radius*radius - uv.x*uv.x - uv.y*uv.y));
N = normalize(N);
float lighting = lightingDiffuse*clamp(dot(N, lightDir), 0., 1.0);
lighting += 0.5 * lightingSpec * pow(clamp(dot(reflect(-1.*lightDir, N), N), 0., 1.), lightingShininess);
return lighting;
}
vec4 getWave(vec2 uv, vec2 center, float t, float maxDist, float intensity, float offset) {
vec2 uv0 = uv;
uv -= center;
float alpha = clamp(mix(1.0, 0.1, length(uv) / maxDist), 0.0, 1.0);
// spin
float spinAngle = spinSpeed*uTime;
uv = rotate2d(uv, spinAngle);
// pixelate
if (enablePixelate) {
uv = floor(pixellateFreq*uv + 0.5)/pixellateFreq;
}
// reverse pixelate
if (enableReversePixelate) {
uv = (ceil(reversePixelateFreq*uv) - fract(reversePixelateFreq*uv))/reversePixelateFreq;
}
// radial square offsets
if (enableSquareOffsets) {
uv += spacing * uSpacingMultiplier * squareAmp * floor(mod(squareFreq*atan(uv.y,uv.x)/6.28318, squareCount)) * normalize(uv);
}
// circle
float dist = 0.8*length(uv);
float circ = dist;
// radial ripples
if (enableRadialRipples) {
uv = rotate2d(uv, rippleAmp * sin(rippleFreq * length(uv) - rippleSpeed * uTime));
}
float angle = atan(uv.x, uv.y);
// square
if (enableSquare) {
dist = max( abs(uv.x), abs(uv.y) );
}
// star patterns
if (enableStar) {
float len = length(uv);
float angle = atan(uv.y, uv.x);
//angle += 0.5*sin(10.0*length(uv));
angle *= starFreq;
float sinAngle = sin(angle);
float cosAngle = cos(angle);
uv = vec2(
uv.x * cosAngle - uv.y * sinAngle,
uv.x * sinAngle + uv.y * cosAngle
);
dist = max( abs(uv.x), abs(uv.y) );
dist = mix(len, dist, starAmp);
}
// star noise
if (enableStarNoise) {
uv += dist * starNoiseAmp * snoise(vec4(starNoiseFreq*normalize(uv), starNoiseSpeed*uTime, 0.)) * normalize(uv);
dist = 0.8 * length(uv);
}
// wavy flowers
if (enableFlowers) {
float angle = atan(uv.y, uv.x);
//angle += 0.1*sin(15.0*length(uv)); // undulation
uv += flowerAmp * sin(flowerFreq*angle) * normalize(uv);
dist = length(uv);
}
float iBand = floor(dist / (spacing * uSpacingMultiplier) - speed * uWaveTime + offset);
float tBand = fract(dist / (spacing * uSpacingMultiplier) - speed * uWaveTime + offset);
float t0 = tBand;
tBand = tBand * tBand * (3.0 - 2.0 * tBand);
if (tBand < blurriness) tBand = (1.0 - tBand / blurriness);
tBand = mix(0.8*length(uv), 1.0, tBand);
vec3 finalCol1 = col1 * mix(1.1, 1.0, dist) * intensity;
vec3 finalCol2 = mix(col1, col2, mix(0.25, 1.0, dist)) * intensity;
// texture
if (enableTexture) {
float texFreq = 0.3;
vec2 texUv = texFreq * vec2(angle-0.5*uTime, 0.4*tBand) / 6.28318;
texUv.y += 0.3*iBand;
vec3 texColor = 0.8 + 1.0 * texture2D(textureMap, texUv).rgb;
finalCol1 *= texColor;
finalCol2 *= texColor;
}
vec2 uvLighting = rotate2d(uv, -1. * spinAngle);
float lighting = getLighting(uvLighting, tBand);
lighting *= mix(1.0, 0.0, clamp(intensity - 1.0, 0.0, 1.0));
finalCol1 = mix(finalCol2, finalCol1, mix(1.0 - lightingDiffuse * lightingFade, 1.0, lighting));
// Mix in colors from rim lighting.
finalCol1 = mix(finalCol1, pow(vec3(0.4, 0.3, 1.0), vec3(1./2.2)), pow(abs(dot(uv0, vec2(1.0, 0.0))), 3.0));
finalCol1 = mix(finalCol1, pow(vec3(0.4, 0.3, 1.0), vec3(1./2.2)), pow(max(0., dot(uv0, vec2(0.0, -1.0))), 3.0));
finalCol1 *= mix(1.0, 1.5, lighting);
finalCol2 *= mix(1.0, 1.5, lighting);
// Make the second color more transparent.
float alpha1 = 1.0;
float alpha2 = 0.65;
alpha *= mix(alpha2, alpha1, tBand);
tBand = pow(tBand, rampExponent);
vec4 color = vec4(mix(finalCol1, finalCol2, 1.0-tBand), alpha);
return color;
}
float getIntensitySample(int index) {
// On some graphics cards we can't use a dynamic value to index into a
// uniform array, but a loop index is apparently ok.
for (int i = 0; i < ${mr}; i++) {
if (index == i) {
return uIntensityInSamples[i];
}
}
return 0.0;
}
void main()
{
float tMod = mod(uTime, 2.0)/2.0;
vec2 uv = vUv;
float dist = length(uv);
vec4 color = vec4(0.);
float z = sqrt(1. - uv.x*uv.x - uv.y*uv.y);
vec3 N = normalize(vec3(uv.x, uv.y, z));
uv = normalize(uv) * pow(length(uv), 1.5);
if (enableNoise) {
vec2 noiseUv = uv;
noiseUv *= noiseFreq;
float amp = noiseAmp * mix(0.0, 1.0, pow(length(uv), noiseFalloff));
uv.x += amp * mix(-1.0, 1.0, snoise(vec4(noiseUv, 0.0, noiseSpeed*uTime)) + 0.4);
uv.y += amp * mix(-1.0, 1.0, snoise(vec4(noiseUv, 1.0, noiseSpeed*uTime)) + 0.4);
}
float maxIntensityMultInner = 1.3;
float maxIntensityMultReflections = 1.3;
// The initial wave emanating from the center of the space.
// The brightness travels outward based on the input sound intensity.
int intensityIndex1 = int(floor(dist * ${mr-1}.0));
int intensityIndex2 = intensityIndex1 + 1;
float intensityIn = mix(
getIntensitySample(intensityIndex1),
getIntensitySample(intensityIndex2),
fract(dist * ${mr-1}.0));
intensityIn = max(intensityIn, 0.25 * uIntensityOut);
intensityIn = mix(1.0, maxIntensityMultInner, pow(intensityIn, 0.5));
vec4 wave1 = getWave(uv, vec2(0.0, 0.0), 0.0, 1.0, intensityIn, 0.0);
color.rgb = wave1.rgb;
color.a += wave1.a;
// The secondary waves emanating from exterior points.
float secondaryWaveIntensity = uIntensityOut * mix(1.2, 1.0, uIntensityInSamples[0]);
secondaryWaveIntensity = mix(1.0, maxIntensityMultReflections, pow(secondaryWaveIntensity, 0.5));
for (int i = 0; i < reflectionCount; i++) {
vec2 ripplePt = rotate2d(vec2(1.0, 0.0), float(i) * 2.0 * 3.14159 / float(reflectionCount));
ripplePt = rotate2d(ripplePt, -0.2*uWaveTime);
vec4 wave = getWave(uv, ripplePt, 1.0, reflectionLength, secondaryWaveIntensity, float(i) * reflectionOffset);
wave.a *= reflectionStrength;
color.rgb = (color.rgb * color.a + wave.rgb * wave.a) / (color.a + wave.a);
color.a += wave.a;
}
// Reduce the alpha influence of secondary waves.
color.a = wave1.a + 0.25 * (color.a - wave1.a);
color.a *= alphaMultiplier;
// Fade out in the center to see the node core more clearly.
float blockingCore = smoothstep(0.2, 0.29, dist);
color.rgb = mix(col1, color.rgb, mix(0.0, 1.0, blockingCore));
color.a = min(color.a, mix(0.6, color.a, blockingCore));
// Vignette circle
color.rgb *= mix(1.0, 0.6, clamp(pow(dist + vignette, 5.0), 0.0, 1.0));
// Grayscale disabled nodes.
if (uEnabled == 0) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
color.rgb = vec3(grayscale);
}
color.rgb = pow(color.rgb, vec3(2.2));
gl_FragColor = vec4(color);
}
`,e=>{e.transparent=!0,e.depthWrite=!1});st({SpaceNodeMaterial:M0});function j0({type:e,id:t,prevId:r,isMuted:o,irPath:s,visualSettings:i,materialRef:l}){const c=a.useMemo(()=>{if(!s)return 0;let p=0;for(let w=0;w<s.length;w++)p+=Math.PI*w*s.charCodeAt(w);return p%1},[s]);a.useEffect(()=>{const p=k(k({},Xn),i);typeof p.col1=="number"?p.col1=new Te().setHex(p.col1):p.col1 instanceof Te?p.col1=new Te().copy(p.col1):p.col1=new Te().copy(Xn.col1);const w=p.col1,x={h:0,s:0,l:0};w.getHSL(x),x.h+=.15*(12.34*c%1-.7),x.h-=.05,w.setHSL(x.h,x.s,x.l);const m=l.current.uniforms;for(const[v,b]of Object.entries(Xn)){let S=v in p?p[v]:b;b instanceof Te&&typeof S=="number"?m[v].value=new Te().setHex(S):typeof S==typeof b?m[v].value=S:(console.warn(`Visual setting for ${v} has unrecognized type: ${S}`),m[v].value=b)}},[i]);const u=a.useRef(0),d=a.useRef(0),h=a.useRef(0);Ge((p,w)=>{const x=l.current,m=Fe.getState(),v=.01*_e(`${e}Mix`),b=m[`${e}Enabled`],S=m[`${e}Stretch`],y=r===void 0?0:Tt(r)*v*b,g=t===void 0?0:Tt(t)*v*b;let j=(g+y)/2;j=se(j,se(.25,1,j),vi(0,.1,j)),u.current+=w*se(1,3,j),x.uniforms.uTime.value=u.current,x.uniforms.uEnabled.value=b&&!o?1:0,d.current+=w*se(1,3,j),x.uniforms.uWaveTime.value=d.current,x.uniforms.uIntensityInSamples.value.pop(),x.uniforms.uIntensityInSamples.value.unshift(y),h.current=se(h.current,Math.pow(g,.8)*v,.1),x.uniforms.uIntensityOut.value=h.current;const N=1/Math.pow(.01*S,.4);x.uniforms.uSpacingMultiplier.value=N});const f=bt(St,"./noise.png");return n.jsx("spaceNodeMaterial",{ref:l,textureMap:f})}function F0({type:e,isMuted:t,visualSettings:r,materialRef:o}){const s=a.useRef({});a.useEffect(()=>{s.current={};for(const[l,c]of Object.entries(Xn)){let u=l in r?r[l]:c;typeof u!=typeof c&&(console.warn(`Visual setting for ${l} has unrecognized type: ${u} (${typeof c})`),u=c),s.current[l]=u,o.current&&l in o.current.userData&&(o.current.userData[l].value=u)}},[r]);const i=a.useRef(0);return Ge((l,c)=>{var h,f;const d=Fe.getState()[`${e}Enabled`];i.current+=c,(h=o.current)!=null&&h.userData.uTime&&(o.current.userData.uTime.value=i.current),(f=o.current)!=null&&f.userData.uEnabled&&(o.current.userData.uEnabled.value=d&&!t?1:0)}),n.jsx("meshStandardMaterial",{ref:o,transparent:!0,opacity:.9,metalness:0,blending:wt,roughness:.13,color:"#000000",onBeforeCompile:l=>{const c=o.current;c.userData.uTime={value:0},c.userData.uEnabled={value:1},l.uniforms.uTime=c.userData.uTime,l.uniforms.uEnabled=c.userData.uEnabled;for(const[u,d]of Object.entries(N0))c.userData[u]={value:d},l.uniforms[u]=c.userData[u];for(const[u,d]of Object.entries(s))u in c.userData&&(c.userData[u].value=d);l.vertexShader=`
${zs}
uniform float uTime;
uniform float shellNoiseAmp;
uniform float shellNoiseFreq;
uniform float shellNoiseSpeed;
vec3 disp(vec3 pos) {
return pos + shellNoiseAmp * snoise(
vec4(shellNoiseFreq * position, shellNoiseSpeed * uTime)) * normal;
}
vec3 getNormal(vec3 pDisp) {
vec3 tangentBasis1 = cross(normal, normalize(vec3(1.0 - normal.x,
1.0 - normal.y,
1.0 - normal.z)));
vec3 tangentBasis2 = cross(normal, tangentBasis1);
vec3 pDisp1 = disp(position + 0.001 * tangentBasis1);
vec3 pDisp2 = disp(position + 0.001 * tangentBasis2);
vec3 nDisp = normalize(cross(pDisp1 - pDisp, pDisp2 - pDisp));
if (dot(normal, nDisp) < 0.0) {
//nDisp *= -1.0;
}
return nDisp;
}
${l.vertexShader}`,l.vertexShader=l.vertexShader.replace("#include <defaultnormal_vertex>",`#include <defaultnormal_vertex>
if (shellNoiseAmp > 0.0) {
transformedNormal = normalMatrix * getNormal(disp(position));
}
`).replace("#include <begin_vertex>",`#include <begin_vertex>
if (shellNoiseAmp > 0.0) {
transformed = disp(position);
}
`),l.fragmentShader=`
uniform int uEnabled;
`+l.fragmentShader.replace("}",`
gl_FragColor.a *= mix(0.1, 1.0, pow(1. - dot(normal, vec3(0., 0., 1.)), 2.0));
float highlight = 1.0 - dot(normal, vec3(0., 0., 1.));
float bottom = clamp(dot(normal, vec3(0., -1., 0.)), 0., 1.);
float top = clamp(dot(normal, vec3(0., 1., 0.)), 0., 1.);
highlight = pow(mix(1., 2., bottom)*highlight, mix(1., 5.0, bottom));
vec4 highlightColor = mix(
vec4(1.0, 0.5, 0.3, 0.4),
vec4(0.5, 0.3, 1.0, 0.4),
bottom);
highlightColor = mix(
highlightColor,
vec4(0.3),
top);
gl_FragColor += mix(vec4(0.0), highlightColor, highlight);
if (uEnabled == 0) {
float grayscale = dot(gl_FragColor.rgb, vec3(0.299, 0.587, 0.114));
gl_FragColor.rgb = vec3(grayscale);
}
}`)}})}var Tl=(e=>(e[e.Sphere=0]="Sphere",e[e.Cube=1]="Cube",e[e.Octahedron=2]="Octahedron",e[e.Icosahedron=3]="Icosahedron",e))(Tl||{});function vs({type:e,id:t,prevId:r,pos:o,prevNodePos:s,nextNodePos:i,isDragging:l,isMuted:c,disableFrustumCulling:u,addNodesMenu:d,showDevUi:h,setShowDevUi:f}){const p=a.useRef(),w=a.useRef(),x=a.useRef(),m=a.useRef(),v=a.useRef(),b=a.useRef(),S=a.useRef();let[y,g]=a.useState(0);d&&(y=0);const j=50,[N,P]=a.useState(!1),{scale:L}=Jn({scale:N?.95:1,config:N?{duration:j,easing:sn.easeOutCubic}:oc.wobbly}),[I,C]=a.useState(-1),M=`${e}Ir`,{defaultValue:R}=ze()[M];let O=T(Y=>Y[M]);(O===void 0||O.length===0)&&(O=R);const[_,z]=a.useState(O);a.useEffect(()=>{P(!0),I<0?C(0):C(I+Math.PI/2),setTimeout(()=>{P(!1),z(O)},j)},[O]);const U=a.useMemo(()=>{const Y=Ln.getState().getFile(_);return(Y==null?void 0:Y.visualSettings)||{}},[_]);a.useEffect(()=>{let Y="shape"in U?U.shape:1;g(yt(Y,0,Object.keys(Tl).length-1))},[_]),Ge((Y,me)=>{const Se=Fe.getState(),je=.01*_e(`${e}Mix`),ye=Se[`${e}Enabled`],le=Se[`${e}Stretch`],Me=r===void 0?0:Tt(r)*je*ye,ve=t===void 0?0:Tt(t)*je*ye,K=x.current;if(K){const te=1/Math.pow(.01*le,.1);K.scale.set(te,te,te)}const ce=p.current;ce.rotateX(.2*me),ce.rotateY(.3*me);const re=w.current;if(re.rotation.y+=.06*(I-re.rotation.y),o&&s&&b.current){const te=Va(s,o,L.get()),ue=b.current;ue.position.set(te[0],te[1],0);const he=se(1,3,Me);ue.scale.set(he,he,he)}if(o&&i&&S.current){const te=Va(i,o,L.get()),ue=S.current;ue.position.set(te[0],te[1],0);const he=se(1,3,ve);ue.scale.set(he,he,he)}});const $=mt(Y=>Y.graphicsQuality);let V=24,E=40;$===ct.Low&&(V*=.4,E*=.4);let q;y===1?q="cube":y===2?q="octahedron":y===3&&(q="icosahedron");const{nodes:W}=wn(`./${q||"cube"}.glb`),F=a.useMemo(()=>{var Y;return q&&((Y=W==null?void 0:W.geo1)==null?void 0:Y.geometry)||new is(.5,V,V)},[q,$]),Z=a.useMemo(()=>{var Y;return q&&((Y=W==null?void 0:W.geo1)==null?void 0:Y.geometry)||new is(.5,E,E)},[q,$]);return n.jsxs("group",{children:[n.jsx("group",{ref:w,children:n.jsxs(Qn.group,{ref:p,scale:L,children:[n.jsx("mesh",{renderOrder:100,geometry:F,frustumCulled:!u,children:n.jsx(j0,{materialRef:m,type:e,id:t,prevId:r,isMuted:c,irPath:_,visualSettings:U})}),n.jsx("mesh",{renderOrder:110,geometry:Z,scale:[1.04,1.04,1.04],frustumCulled:!u,children:n.jsx(F0,{materialRef:v,type:e,isMuted:c,visualSettings:U})}),n.jsx(vn,{renderOrder:99,radius:.8,innerRadius:y===0?.5:.4,alpha:.3})]})}),n.jsx("group",{ref:x,children:n.jsx(cr,{mixParam:`${e}Mix`,enabledParam:`${e}Enabled`,muted:c,snapshotId:r,renderOrder:102,color:new Te(1,1,1),showContactHighlights:!l,disableFrustumCulling:u,lensFlare:!0,lensFlareRadius:.6})}),!l&&o&&s&&y===0&&n.jsx("group",{ref:b,children:n.jsx(vn,{renderOrder:101,radius:.1,innerRadius:0,alpha:.6})}),!l&&o&&i&&y===0&&n.jsx("group",{ref:S,children:n.jsx(vn,{renderOrder:101,radius:.1,innerRadius:0,alpha:.6})}),!Vt]})}function Va(e,t,r){const o=.502*r,s=100;let i=[0,0],l=Number.MAX_VALUE;for(let c=s/2;c<s;c++){const u=c/s,d=se(e.x-t.x,0,u),h=se(e.y-t.y,0,u*u*(3-2*u)),f=Math.abs(d*d+h*h-o*o);if(f<l)l=f,i=[d/r,h/r];else break}return i}function A0({type:e,enabled:t,addNodesMenu:r,z:o,radius:s}){const i=a.useRef(null),l=a.useRef(null),c=a.useRef(0),u=`${e}:0`,d=T(m=>m[`${e}StretchSections`]),h=a.useRef(0),f=a.useRef(0),p=a.useRef(0),w=a.useRef(!1),x=a.useRef(Date.now());return Er(m=>{var b,S;if(r||!t||Date.now()-x.current<30)return;x.current=Date.now();const v=m.scopes;if((S=(b=v==null?void 0:v[u])==null?void 0:b.max)!=null&&S.length){const y=v[u],g=y.max.length,j=y.writePointer/g;let N=f.current;j-N>.5?N+=1:N-j>.5&&(N-=1),p.current=Math.abs(j-N),h.current=.5*(j+N)%1,w.current=!0,f.current=j}}),Ge((m,v)=>{var g;if(c.current+=v,r&&(p.current=v/2,h.current=(h.current+p.current)%1),(g=l.current)!=null&&g.userData.uPointerPosition){const j=l.current.userData;if(j.uPointerPosition.value=h.current,j.uBlurAmount.value=.5*p.current,j.uEnabled.value=t?1:0,d){j.uSectionCount.value=d.length;for(let N=0;N<d.length;N++)j.uSectionWidths.value[N]=d[N].width,j.uSectionSpeeds.value[N]=.5*(d[N].stretch[0]+d[N].stretch[1])}}const b=i.current,S=0,y=1.5;b.rotation.set(S*Math.sin(y*c.current),S*Math.cos(y*c.current),0)}),n.jsx("group",{ref:i,position:[0,0,o],children:n.jsxs("mesh",{children:[n.jsx("torusGeometry",{args:[s,.023,12,64]}),n.jsx("meshStandardMaterial",{ref:l,color:"#000000",roughness:.2,metalness:.5,onBeforeCompile:m=>{const v=l.current,b=16;v.userData={uColor:{value:new Te("#8899aa")},uPointerPosition:{value:0},uBlurAmount:{value:0},uSectionCount:{value:4},uSectionWidths:{value:new Array(b).fill(.25)},uSectionSpeeds:{value:new Array(b).fill(1)},uEnabled:{value:1}};for(const S of Object.keys(v.userData))m.uniforms[S]=v.userData[S];m.vertexShader=m.vertexShader.replace("#include <uv_pars_vertex>","varying vec3 vPosition; varying vec2 vUv;"),m.vertexShader=m.vertexShader.replace("#include <uv_vertex>","vPosition = position; vUv = uv;"),m.fragmentShader=m.fragmentShader.replace("varying vec3 vViewPosition;",`varying vec3 vViewPosition;
varying vec3 vPosition;
varying vec2 vUv;
#define kMaxSectionCount ${b}
uniform float uPointerPosition;
uniform float uBlurAmount;
uniform int uSectionCount;
uniform float uSectionWidths[kMaxSectionCount];
uniform float uSectionSpeeds[kMaxSectionCount];
uniform vec3 uColor;
uniform int uEnabled;
`),m.fragmentShader=m.fragmentShader.replace("#include <map_fragment>",`
vec3 color = vec3(0.0);
float t = 1.0 - mod(vUv.x + 0.75 , 1.0);
float width = 0.0;
float speed = 1.0;
int currentSection = 0;
bool assignedSectionColor = false;
bool assignedCurrentSection = false;
// Distance to the closest section border.
float distToBorder = min(t, 1.0 - t);
for (int i = 0; i < uSectionCount; i++) {
width += uSectionWidths[i];
if (uPointerPosition < width && !assignedCurrentSection) {
currentSection = i;
assignedCurrentSection = true;
}
if (t < width && !assignedSectionColor) {
speed = uSectionSpeeds[i];
color = uColor;
color = 0.8 * mix(vec3(0.5, 0.5, 1.0), vec3(0.5, 0.8, 1.0), 2.0 * abs(width - uSectionWidths[i] - 0.5));
if (assignedCurrentSection && currentSection == i && uSectionCount > 1) {
color *= 2.0;
color = clamp(color, 0.0, 1.0);
}
assignedSectionColor = true;
}
distToBorder = min(distToBorder, abs(width - t));
}
// Ticks between sections.
float borderWidth = 0.0;//0.004;
vec3 borderColor = vec3(1.0);
color = mix(borderColor, color, smoothstep(0.5 * borderWidth, 0.5 * borderWidth * 1.3, distToBorder));
// Pointer marker (motion blurred).
// float pointerWidth = 0.005;
// float distToPointer = abs(t - uPointerPosition);
// distToPointer = min(distToPointer, 1.0 - distToPointer);
// float pointerStrength = 1.0 - smoothstep(0.5 * pointerWidth, 0.5 * pointerWidth + uBlurAmount, distToPointer);
// pointerStrength *= 1.0 / (1.0 + 12.0 * uBlurAmount);
// color *= mix(1.0, 3.0, pointerStrength);
// Inner rim lighting.
color += 0.1 * vec3(max(0.0, dot(normalize(vNormal), normalize(-1.0 * vPosition))));
color = clamp(color, 0.0, 1.0);
if (uEnabled == 0) {
color = vec3(0.5 * color.r);
}
// diffuseColor = vec4(color, 1.0);
`),m.fragmentShader=m.fragmentShader.replace("#include <dithering_fragment>",`
gl_FragColor.rgb += color;
`)}})]})})}const L0=a.memo(A0);function k0({type:e,enabled:t,z:r,radius:o,dotSize:s,smallDotSize:i}){const l=`${e}:0`,c=a.useRef([]),u=a.useRef([]),d=T(w=>w[`${e}StretchSections`]),h=[],f=[];let p=0;for(let w=0;w<d.length;w++){const x=d[w],m=p;h.push(m),f.push(s);const v=m+x.width,b=Math.round(16*(v-m));for(let S=1;S<b;S++)h.push(se(m,v,S/b)),f.push(i);p+=x.width}return Ge(()=>{var m,v;let w;const x=ho.getState().scopes;if((v=(m=x==null?void 0:x[l])==null?void 0:m.max)!=null&&v.length){const b=x[l];w=b.writePointer/b.max.length}h.forEach((b,S)=>{let y=t?1:0;if(w!==void 0){const N=w>b?w:w+1;y=yt(1-(N-b),0,1);const P=.03;y>1-P&&(y=1-(y-1+P)/P)}const g=t?se(0,1,y):-1,j=se(1,1.3,y);u.current[S].uniforms.uBrightness.value=g,c.current[S].scale.set(j,j,j)})}),n.jsx(n.Fragment,{children:h.map((w,x)=>{const m=f[x],v=o;return n.jsx("group",{position:[0,0,r!=null?r:.05],rotation:[0,0,-2*Math.PI*w],children:n.jsxs("mesh",{ref:b=>c.current[x]=b,position:[0,v,0],children:[n.jsx("circleGeometry",{args:[4*m]}),n.jsx("clockTickMaterial",{ref:b=>u.current[x]=b,uBloomScale:4})]})},`tick${x}`)})})}const P0=a.memo(k0),I0=at({uColor:new Te("#ffffff"),uAlpha:1,uBrightness:1,uBloomScale:4,uActivation:1},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
uniform vec3 uColor;
uniform float uAlpha;
uniform float uBrightness;
uniform float uBloomScale;
void main() {
vec2 uv = 2.0 * vUv - vec2(1.0);
// Fake bloom around the outside of the circle using alpha.
float r = length(uv);
r *= uBloomScale;
float alpha = 1.0 / (r * r * r * r);
alpha = min(alpha, 1.0);
// Remove the fake boom at low brightness levels.
alpha = mix(smoothstep(0.5, 1.0, alpha), alpha, uBrightness * uBrightness);
alpha *= uAlpha;
vec3 color = uColor * mix(0.75, 1.0, uBrightness);
gl_FragColor = vec4(color, alpha);
}`,e=>{e.transparent=!0,e.depthWrite=!1});st({ClockTickMaterial:I0});const Ro=(e,t,r)=>{const o=parseInt(e.slice(1,3),16),s=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16),l=parseInt(t.slice(1,3),16),c=parseInt(t.slice(3,5),16),u=parseInt(t.slice(5,7),16),d=Math.round(o+(l-o)*r),h=Math.round(s+(c-s)*r),f=Math.round(i+(u-i)*r);return`#${d.toString(16).padStart(2,"0")}${h.toString(16).padStart(2,"0")}${f.toString(16).padStart(2,"0")}`};class E0{constructor(){Vn(this,"creationTime");Vn(this,"pos");Vn(this,"dir");Vn(this,"color");Vn(this,"scale");this.creationTime=0,this.pos=new Oe,this.dir=new Oe,this.color=new Te,this.scale=1}update(t,r,o,s,i){const l=r*Math.sqrt(Math.random());this.creationTime=o,this.pos.set(l*Math.cos(t),l*Math.sin(t),0),i>0&&(this.pos.x+=i*Math.sin(t)*(2*Math.random()-1),this.pos.y+=i*Math.cos(t)*(2*Math.random()-1)),this.dir.set(Math.random()-.5,Math.random()-.5,0).multiplyScalar(.5*s),this.scale=se(.5,1.5,Math.random());const c=2*Math.abs((t/(2*Math.PI)+.75)%1-.5);return this.color.r=se(.9,.7,2*l),this.color.g=se(.65,.85,c),this.color.b=1,this}}function R0({enabled:e,paused:t,addNodesMenu:r,z:o,radius:s,handPosition:i,handSpeed:l,sparkleCount:c,sparkleLifespan:u,sparkleWidth:d,sparkleSpeed:h,sparkleOpacity:f,sparkleCullAmount:p,sparkleRandomOffset:w}){const x=mt(O=>O.graphicsQuality),m=a.useRef(null);let v=c,b=u,S=d;x===ct.Low?v*=.25:x===ct.High&&(v*=1.5,b*=1.5),r&&(v=Math.min(v,.35*c),S*=1.75);const y=a.useMemo(()=>new Lo(1,1),[]),g=a.useMemo(()=>{const O=[];for(let _=0;_<v;_++){const z=Math.random()*2*Math.PI,U=(_/v-1)*b;O.push(new E0().update(z,s,U,h,w))}return O},[v,b]),j=a.useMemo(()=>new it(new Float32Array(v),1),[v]),N=a.useMemo(()=>new it(new Float32Array(v),1),[v]),P=a.useMemo(()=>new it(new Float32Array(3*v),3),[v]),L=a.useMemo(()=>new it(new Float32Array(3*v),3),[v]),I=a.useMemo(()=>new it(new Float32Array(3*v),3),[v]),C=a.useMemo(()=>new it(new Float32Array(v),1),[v]),M=[N,P,L,I,C];a.useEffect(()=>{y.setAttribute("index",j),y.setAttribute("creationTime",N),y.setAttribute("sparklePosition",P),y.setAttribute("sparkleDirection",L),y.setAttribute("sparkleColor",I),y.setAttribute("sparkleScale",C);for(let O=0;O<v;O++){const _=g[O];j.array[O]=O,N.array[O]=_.creationTime,P.array[3*O+0]=_.pos.x,P.array[3*O+1]=_.pos.y,P.array[3*O+2]=_.pos.z,L.array[3*O+0]=_.dir.x,L.array[3*O+1]=_.dir.y,L.array[3*O+2]=_.dir.z,I.array[3*O+0]=_.color.r,I.array[3*O+1]=_.color.g,I.array[3*O+2]=_.color.b,C.array[O]=_.scale}j.needsUpdate=!0;for(const O of M)O.needsUpdate=!0},[v,y]);const R=a.useRef(0);return Ge((O,_)=>{if(t||(R.current+=_,m.current.uniforms.uTime.value=R.current,i.current===null||l.current==null))return;let z=g.length,U=-1;for(let $=0;$<g.length;$++){const V=g[$];if(R.current>V.creationTime+b){const E=V.creationTime+b*Math.floor((R.current-V.creationTime)/b),q=(.25-(i.current+(Math.random()-.5)*l.current))*2*Math.PI;V.update(q,s,E,h,w),g[$]=V,N.array[$]=V.creationTime,P.array[3*$+0]=V.pos.x,P.array[3*$+1]=V.pos.y,P.array[3*$+2]=V.pos.z,L.array[3*$+0]=V.dir.x,L.array[3*$+1]=V.dir.y,L.array[3*$+2]=V.dir.z,I.array[3*$+0]=V.color.r,I.array[3*$+1]=V.color.g,I.array[3*$+2]=V.color.b,z=Math.min(z,$),U=Math.max(U,$)}}for(const $ of M){if(U<0){$.needsUpdate=!1;continue}$.needsUpdate=!0,$.updateRange.offset=z*$.itemSize,$.updateRange.count=(U-z+1)*$.itemSize,$.updateRange.offset+$.updateRange.count>=g.length*$.itemSize&&($.updateRange.count=-1)}}),n.jsx("instancedMesh",{position:[0,0,o],geometry:y,frustumCulled:!1,args:[void 0,void 0,v],children:n.jsx("sparkleMaterial",{ref:m,uEnabled:e,uSize:S,uLifespan:b,uOpacity:f,uCullAmount:p})})}const Zo=a.memo(R0),D0=at({uTime:0,uSize:.1,uLifespan:1,uOpacity:1,uBlurAmount:0,uPosition:0,uEnabled:1,uCullAmount:0},`
precision mediump float;
attribute float index;
attribute float creationTime;
attribute vec3 sparklePosition;
attribute vec3 sparkleDirection;
attribute vec3 sparkleColor;
attribute float sparkleScale;
uniform float uSize;
uniform float uTime;
uniform float uLifespan;
uniform float uCullAmount;
varying vec2 vUv;
varying vec4 vColor;
void main () {
vUv = uv;
float duration = uTime - creationTime;
float alpha = (1.0 - duration / uLifespan);
alpha *= alpha * alpha;
if (creationTime < 0.0) {
alpha = 0.0;
}
vColor = vec4(sparkleColor, alpha);
float scale = sparkleScale * uSize;
if (mod(17.0 * index, 10.0) < 10.0 * uCullAmount) {
scale = 0.0;
}
vec3 pos = scale * position + sparklePosition + duration * sparkleDirection;
gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
varying vec4 vColor;
uniform float uOpacity;
uniform int uEnabled;
void main() {
vec4 color = vColor;
if (uEnabled == 0) {
color.rgb = vec3(0.7 * color.b);
}
float distanceToCenter = distance(vUv, vec2(0.5));
color.a *= pow(clamp(0.05 / distanceToCenter - 0.1,0.,2.), 2.0);
color.a = clamp(color.a, 0.0, 1.0);
color.a *= uOpacity;
gl_FragColor = clamp(color, 0.0, 1.0);
}`,e=>{e.transparent=!0,e.depthWrite=!1});st({SparkleMaterial:D0});function B0({type:e,enabled:t,addNodesMenu:r,pointerName:o,z:s,radius:i,renderOrder:l}){const c=a.useRef(null),u=a.useRef(0),d=a.useRef(0),h=a.useRef(0),f=a.useRef(Date.now()),p=`${e}:0`,w=`${e}StretchMode`,x=T(b=>b[w]),m=`${e}GrainSize`,v=T(b=>b[m]);return Er(b=>{var y,g;if(r||!t||Date.now()-f.current<30)return;f.current=Date.now();const S=b.scopes;if((g=(y=S==null?void 0:S[p])==null?void 0:y.max)!=null&&g.length){const j=S[p],N=j.max.length;let P=j[o]/N;P<0&&(P+=1);let L=d.current;P-L>.5?L+=1:L-P>.5&&(L-=1),h.current=Math.abs(P-L),u.current=.5*(P+L)%1,d.current=P}}),Ge((b,S)=>{r&&(h.current=S/2,u.current=(u.current+h.current)%1);const y=c.current;y&&(y.uniforms.uPosition.value=u.current,y.uniforms.uBlurAmount.value=.5*h.current,y.uniforms.uEnabled.value=t?1:0,y.uniforms.uColor.value.set(Ro("#ee88ff","#88eeff",2*Math.abs(u.current-.5))))}),n.jsxs(n.Fragment,{children:[x===0&&n.jsxs(n.Fragment,{children:[n.jsxs("mesh",{position:[0,0,s],renderOrder:l,children:[n.jsx("circleGeometry",{args:[i,64]}),n.jsx("clockHandMaterial",{ref:c,uEnabled:t})]}),n.jsx(Zo,{enabled:t,paused:!(t||r),addNodesMenu:r,radius:.98*i,z:s,handPosition:u,handSpeed:h,sparkleCount:650,sparkleLifespan:1.2,sparkleWidth:.09,sparkleSpeed:.25,sparkleOpacity:.65,sparkleCullAmount:0,sparkleRandomOffset:0})]}),x===1&&n.jsxs(n.Fragment,{children:[n.jsx(Zo,{enabled:t,paused:!(t||r),addNodesMenu:r,radius:.98*i,z:s,handPosition:u,handSpeed:h,sparkleCount:80,sparkleLifespan:.2,sparkleWidth:se(.1,.4,v),sparkleSpeed:.05,sparkleOpacity:1,sparkleCullAmount:se(0,.8,v),sparkleRandomOffset:.02}),n.jsx(Zo,{enabled:t,paused:!(t||r),addNodesMenu:r,radius:.98*i,z:s,handPosition:u,handSpeed:h,sparkleCount:400,sparkleLifespan:2,sparkleWidth:se(.1,.5,v),sparkleSpeed:.15,sparkleOpacity:.1,sparkleCullAmount:se(0,.8,v),sparkleRandomOffset:.02})]})]})}const T0=a.memo(B0),O0=at({uColor:new Te("#eeeeff"),uBlurAmount:0,uPosition:0,uEnabled:1},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
uniform vec3 uColor;
uniform float uPosition;
uniform float uBlurAmount;
uniform int uEnabled;
// Converts a width value to an angle sweep for a given radius.
float getWidthAngle(float width, float radius, bool rounded) {
if (radius < 1.0 && rounded) {
width *= sqrt(1.0 - pow(max(0.0, radius - (1.0 - width)) / width, 2.0));
}
return abs(atan(width, radius) / (2.0 * 3.14159));
}
void main() {
vec2 uv = 2.0 * vUv - vec2(1.0);
float t = mod(atan(uv.x, uv.y) / (2.0 * 3.14159) + 1.0, 1.0);
float l = length(uv);
float dist = abs(t - uPosition);
dist = min(dist, 1.0 - dist);
float alpha = 0.0;
float handWidth = 0.025;
float widthAngle = getWidthAngle(handWidth, l, true);
alpha = mix(1.0, 0.0, smoothstep(widthAngle, widthAngle * 2., dist));
// Bloom.
if (uEnabled == 1) {
float bloomWidth = 0.18;
float bloomWidthAngle = getWidthAngle(bloomWidth, l, false);
alpha += 0.5 * pow(clamp(1.0 - dist / bloomWidthAngle, 0.0, 1.0), 4.0);
}
// Motion blur.
float blur = 1.0 - clamp((dist - widthAngle) / (uBlurAmount), 0.0, 1.0);
alpha += smoothstep(0.0, 1.0, blur);
alpha = clamp(alpha, 0.0, 1.0);
alpha *= 1.0 / (1.0 + 12.0 * uBlurAmount);
alpha = clamp(alpha, 0.0, 1.0);
vec3 color = uColor;
color.r = mix(0.9, 0.68, 2.0 * (l - 0.2));
color.g = mix(0.65, 0.85, 2.0 * abs(t - 0.5));
color.b = 1.0;
if (uEnabled == 0) {
color = vec3(0.7 * color.b);
}
gl_FragColor = vec4(color, alpha);
}`,e=>{e.transparent=!0});st({ClockHandMaterial:O0});function _0({type:e,addNodesMenu:t,prevId:r,isMuted:o,disableFrustumCulling:s}){const i=a.useRef(0),l=a.useRef(null),c=T(u=>u[`${e}Enabled`]>0)&&!o;return Ge((u,d)=>{i.current+=d;const h=l.current,f=.17,p=1.3;h.rotation.set(f*Math.sin(p*i.current),f*Math.cos(p*i.current),0)}),n.jsxs("group",{position:[0,0,.1],ref:l,children:[n.jsxs("mesh",{renderOrder:100,children:[n.jsx("circleGeometry",{args:[.5,64]}),n.jsx("meshStandardMaterial",{color:c?"#00203b":"#151515",emissive:c?"#2c2c54":"#2d2d2d"})]}),n.jsx(L0,{type:e,enabled:c,addNodesMenu:t!=null?t:!1,z:0,radius:.5}),n.jsx(P0,{type:e,enabled:c,radius:.41,dotSize:.024,smallDotSize:.009}),n.jsx(T0,{type:e,enabled:c,addNodesMenu:t!=null?t:!1,pointerName:"readPointer",z:.075,radius:.47,renderOrder:101}),n.jsx("group",{position:[0,0,.06],children:n.jsx(cr,{mixParam:`${e}Mix`,enabledParam:`${e}Enabled`,muted:o,snapshotId:r,renderOrder:100,showContactHighlights:!1,disableFrustumCulling:s})})]})}const xs=a.memo(_0);function qs({paramId:e,snapshotId:t,maxAlpha:r,color:o}){var l;const{nodes:s}=wn("./tubeWire.gltf"),i=a.useRef(null);return Ge(()=>{const c=t===void 0?0:Math.pow(Tt(t),.25),u=_e(e)*se(.25,1,c);i.current&&(i.current.uniforms.uAlpha.value=yt(2*u,0,r!=null?r:.5),i.current.uniforms.uExponent.value=se(50,5,u))}),n.jsxs(n.Fragment,{children:[n.jsx("mesh",{geometry:(l=s==null?void 0:s.geo2)==null?void 0:l.geometry,children:n.jsx("meshBasicMaterial",{color:"#ffffff",blending:wt})}),n.jsxs("mesh",{position:[0,.6,0],children:[n.jsx("capsuleGeometry",{args:[.1,.75]}),n.jsx("wireGlowMaterial",{ref:i,uAlpha:.5,uExponent:20,uColor:o!=null?o:"#ffffff"})]})]})}const V0=at({uColor:new Te("#ffffff"),uAlpha:1,uExponent:50},`
precision mediump float;
varying vec3 vEyeTangent;
varying vec3 vEyeNormal;
varying vec3 vEyePos;
void main () {
vEyeTangent = (modelViewMatrix * vec4(0.0, 1.0, 0.0, 0.0)).xyz;
vEyeNormal = (modelViewMatrix * vec4(normal, 0.0)).xyz;
vEyePos = (modelViewMatrix * vec4(position, 1.0)).xyz;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec3 vEyeTangent;
varying vec3 vEyeNormal;
varying vec3 vEyePos;
uniform vec3 uColor;
uniform float uAlpha;
uniform float uExponent;
void main() {
vec3 eyeNormal = normalize(vEyeNormal);
vec3 centerNormal = normalize(cross(cross(vEyeTangent, -1.0 * vEyePos), vEyeTangent));
float center = dot(centerNormal, eyeNormal);
// center += dot(eyeNormal, vec3(0.0, 0.0, 1.0));
center = clamp(center, 0.0, 1.0);
center = pow(center, uExponent);
vec3 color = uColor;
color *= uAlpha;
color *= vec3(center);
gl_FragColor = vec4(color, 1.0);
}`,e=>{e.transparent=!0,e.depthTest=!1,e.depthWrite=!1,e.blending=wt});st({WireGlowMaterial:V0});function z0({enabled:e,paramId:t,snapshotId:r}){var u;const{nodes:o}=wn("./tubeInterior.gltf"),s=bt(St,"./noise.png");s.wrapS=ht,s.wrapT=ht;const i=a.useRef(null),l=a.useRef(0);Ge((d,h)=>{l.current+=h;const f=_e(t);i.current&&(i.current.uniforms.uTime.value=l.current%1e5,i.current.uniforms.uAlpha.value=Math.pow(yt(2*f,0,1),.5))});const c=mt(d=>d.graphicsQuality);return n.jsxs(n.Fragment,{children:[n.jsx("mesh",{geometry:(u=o==null?void 0:o.geo2)==null?void 0:u.geometry,children:n.jsx("electricInteriorMaterial",{ref:i,uEnabled:e,uColor1:"#dd88ff",uColor2:"#00aaff",uAlpha:1,uNoiseFreq:.5,uNoiseTexture:s})}),n.jsx($n,{enabled:e,paramId:t,paramThreshold:1e-6,snapshotId:r}),n.jsx($n,{enabled:e,paramId:t,paramThreshold:2/6,snapshotId:r}),n.jsx($n,{enabled:e,paramId:t,paramThreshold:4/6,snapshotId:r}),c!==ct.Low&&n.jsxs(n.Fragment,{children:[n.jsx($n,{enabled:e,paramId:t,paramThreshold:1/6,snapshotId:r}),n.jsx($n,{enabled:e,paramId:t,paramThreshold:3/6,snapshotId:r}),n.jsx($n,{enabled:e,paramId:t,paramThreshold:5/6,snapshotId:r})]}),n.jsx(qs,{paramId:t,snapshotId:r})]})}function $n({enabled:e,paramId:t,snapshotId:r,paramThreshold:o}){const[s,i]=a.useMemo(()=>[Math.random(),Math.random()],[]),l=a.useRef(null),c=a.useRef(null),u=a.useRef(null),d=a.useRef(1e3*s),h=.75*se(.5,1.5,i),f=bt(St,"./electricity.png"),p=bt(St,"./electricityNoise.png");return p.wrapS=ht,p.wrapT=ht,Ge((w,x)=>{d.current+=x;const m=_e(t);if(m<o){c.current.visible=!1;return}c.current.visible=!0;let v=h*d.current%1;Math.random()<.2?v=Math.random():Math.random()<.5&&(v+=.05*(Math.random()-.5));const b=l.current;b.rotation.y=.2,Math.floor(h*d.current)%2===0&&(b.rotation.y+=Math.PI);const S=.35,y=1;b.position.y=se(S,y,v);const g=se(0,1,yt(5*v,0,1));b.scale.y=g,u.current!==null&&(u.current.uniforms.uTime.value=.3*d.current%1e4,u.current.uniforms.uAlpha.value=yt(1-(v-.9)/.1,0,1),u.current.uniforms.uAlpha.value*=yt(10*(m-o),0,1),u.current.uniforms.uAlpha.value*=r===void 0?1:se(.7,1,Tt(r)))}),n.jsx("group",{ref:l,rotation:[0,0,0],position:[0,1,0],children:n.jsxs("mesh",{ref:c,position:[.12,0,0],children:[n.jsx("planeGeometry",{args:[.25,.5]}),n.jsx("boltMaterial",{uEnabled:e,uNoiseAmp:.5,uNoiseFreqX:.05,ref:u,uColor:"#9988ff",uBoltTexture:f,uNoiseTexture:p})]})})}const $0=at({uBoltTexture:null,uNoiseTexture:null,uColor:new Te("#ff0000"),uNoiseAmp:.5,uNoiseFreqX:.1,uTime:0,uEnabled:1,uAlpha:1},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
uniform sampler2D uBoltTexture;
uniform sampler2D uNoiseTexture;
uniform vec3 uColor;
uniform int uEnabled;
uniform float uTime;
uniform float uNoiseFreqX;
uniform float uNoiseFreqY;
uniform float uNoiseAmp;
uniform float uAlpha;
void main() {
vec2 noiseUv = vec2(vUv.x * uNoiseFreqX, uTime);
float noise1 = texture2D(uNoiseTexture, noiseUv).r;
float noise2 = texture2D(uNoiseTexture, 4.0 * noiseUv).r;
vec2 uv = vUv;
uv *= 0.5;
if (fract(uTime * 10.0) > 0.6) {
uv.x += 0.5;
}
if (fract(uTime * 11.0) > 0.1) {
uv.y += 0.5;
}
float noiseAmp = uNoiseAmp * smoothstep(0.5, 0.0, abs(vUv.x - 0.6));
uv.y += noiseAmp * (noise1 - 0.2);
uv.y += 0.3 * uNoiseAmp * (noise2 - 0.2);
vec3 color = texture2D(uBoltTexture, uv).rgb;
color *= uColor;
color *= 10.0;
color *= uAlpha;
color = clamp(color, 0.0, 1.0);
if (uEnabled == 0) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
color.rgb = vec3(grayscale);
}
gl_FragColor = vec4(color, 1.0);
}`,e=>{e.transparent=!0,e.depthTest=!1,e.depthWrite=!1,e.side=sc,e.blending=wt});st({BoltMaterial:$0});const U0=at({uEnabled:1,uNoiseTexture:null,uColor1:new Te("#ff0000"),uColor2:new Te("#ff0000"),uNoiseAmp:.5,uNoiseFreq:.1,uTime:0,uAlpha:1},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = (modelViewMatrix * vec4(position, 1.0) - modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xy;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
uniform int uEnabled;
uniform sampler2D uNoiseTexture;
uniform vec3 uColor1;
uniform vec3 uColor2;
uniform float uTime;
uniform float uNoiseFreq;
uniform float uNoiseAmp;
uniform float uAlpha;
void main() {
vec2 noiseUv = uNoiseFreq * vUv;
noiseUv.x -= 0.3 * uTime;
vec3 noiseDistortion = texture2D(uNoiseTexture, 0.05 * vUv + 0.1 * vec2(-1.0 * uTime, uTime)).rgb;
noiseUv += 0.5 * noiseDistortion.xy;
float colorNoise = texture2D(uNoiseTexture, noiseUv).r / 0.5;
vec3 color = mix(uColor1, uColor2, colorNoise);
vec3 fadeDistortion = texture2D(uNoiseTexture, 0.05 * vUv - 0.03 * vec2(uTime, 0.0)).rgb;
vec2 fadeUv = vUv + fadeDistortion.xy;
vec3 fadeNoise = 3.0 * texture2D(uNoiseTexture, 0.8 * fadeUv + 0.25 * vec2(-1.0 * uTime, uTime)).rgb;
color *= fadeNoise;
color -= vec3(1.0 - uAlpha);
color = clamp(color, 0.0, 1.0);
if (uEnabled == 0) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
color.rgb = vec3(grayscale);
}
gl_FragColor = vec4(color, 1.0);
}`,e=>{e.transparent=!0,e.depthTest=!1,e.depthWrite=!1,e.blending=wt});st({ElectricInteriorMaterial:U0});function H0({enabled:e,paramId:t,snapshotId:r}){var u;const{nodes:o}=wn("./tubeInterior.gltf"),s=bt(St,"./noise.png");s.wrapS=ht,s.wrapT=ht;const i=a.useRef(null),l=a.useRef(0);Ge((d,h)=>{l.current+=h;const f=_e(t);i.current&&(i.current.uniforms.uTime.value=l.current%1e5,i.current.uniforms.uAlpha.value=Math.pow(yt(2*f,0,1),.33))});const c=mt(d=>d.graphicsQuality);return n.jsxs(n.Fragment,{children:[n.jsx("mesh",{geometry:(u=o==null?void 0:o.geo2)==null?void 0:u.geometry,children:n.jsx("heatInteriorMaterial",{ref:i,uColor1:"#8844aa",uColor2:"#995533",uAlpha:1,uNoiseFreq:.5,uNoiseTexture:s,uEnabled:e})}),n.jsx(q0,{paramId:t,enabled:e}),c!==ct.Low&&n.jsx(G0,{paramId:t,enabled:e}),n.jsx(qs,{paramId:t,snapshotId:r,color:"#ddddff",maxAlpha:.8})]})}function G0({enabled:e,paramId:t}){const r=a.useMemo(()=>new Lo(1,1),[]),o=a.useRef(null),s=a.useRef(null),i=35,l=.65,c=a.useMemo(()=>new it(new Float32Array(3*i),3),[i]),u=a.useMemo(()=>new it(new Float32Array(3*i),3),[i]),d=a.useMemo(()=>new it(new Float32Array(3*i),3),[i]),h=a.useMemo(()=>new it(new Float32Array(i),1),[i]),f=a.useMemo(()=>new it(new Float32Array(i),1),[i]),p=[c,u,d,h,f];a.useEffect(()=>{r.setAttribute("sparkPosition",c),r.setAttribute("sparkDirection",u),r.setAttribute("sparkColor",d),r.setAttribute("sparkCreationTime",h),r.setAttribute("sparkScale",f);for(let v=0;v<i;v++){c.array[3*v+0]=.2*(Math.random()-.5),c.array[3*v+1]=.2*(Math.random()-.5),c.array[3*v+2]=.2*(Math.random()-.5);const b=new Oe(Math.random()-.5,3+Math.random(),Math.random()-.5).normalize();u.array[3*v+0]=b.x,u.array[3*v+1]=b.y,u.array[3*v+2]=b.z,d.array[3*v+0]=se(.5,1,Math.random()),d.array[3*v+1]=se(.5,1,Math.random()),d.array[3*v+2]=1,h.array[v]=-1*l*Math.random(),f.array[v]=se(.2,1,Math.random())}for(const v of p)v.needsUpdate=!0},[i,r]);const w=a.useRef(0),x=a.useRef(0);return Ge((m,v)=>{const b=_e(t);w.current+=v,x.current=se(x.current,b,.08),s.current.uniforms.uTime.value=w.current,s.current.uniforms.uIntensity.value=(Math.pow(x.current,.3)-.1)/(1-.1),o.current.position.y=se(.2,.3,x.current)}),n.jsx("instancedMesh",{ref:o,geometry:r,frustumCulled:!1,args:[void 0,void 0,i],children:n.jsx("sparkMaterial",{ref:s,uEnabled:e,uLifetime:l,uSize:.03,uTravelDist:.9,uAlpha:1,uColor:"#ffccff",uSpiralAmp:.08,uSpiralFreq:2})})}const W0=at({uEnabled:1,uColor:new Te,uTime:0,uSize:1,uLifetime:1,uTravelDist:1,uIntensity:1,uAlpha:1,uSpiralAmp:1,uSpiralFreq:1},`
precision mediump float;
attribute vec3 sparkPosition;
attribute vec3 sparkDirection;
attribute vec3 sparkColor;
attribute float sparkCreationTime;
attribute float sparkScale;
uniform float uTime;
uniform float uSize;
uniform float uIntensity;
uniform float uLifetime;
uniform float uTravelDist;
uniform float uSpiralAmp;
uniform float uSpiralFreq;
varying vec2 vUv;
varying vec3 vColor;
varying float vSparkTime;
void main () {
vUv = uv;
vColor = clamp(2.0 * sparkColor, 0.0, 1.0);
vSparkTime = mod(uTime - sparkCreationTime, uLifetime) / uLifetime;
vec3 pos = sparkScale * uSize * position + mix(0.25, 1.0, uIntensity) * sparkPosition;
float spiralAmp = uIntensity * uSpiralAmp * smoothstep(0.0, 0.5, vSparkTime);
pos.x += spiralAmp * sin(uSpiralFreq * vSparkTime + 123.5 * sparkCreationTime);
pos.z += spiralAmp * cos(uSpiralFreq * vSparkTime + 123.5 * sparkCreationTime);
vec3 direction = sparkDirection;
pos += uTravelDist * vSparkTime * direction;
gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
varying vec3 vColor;
varying float vSparkTime;
uniform int uEnabled;
uniform float uAlpha;
uniform float uIntensity;
uniform vec3 uColor;
void main() {
float distanceToCenter = distance(vUv, vec2(0.5));
float alpha = uAlpha;
alpha *= smoothstep(0.0, 0.3 * uIntensity, vSparkTime);
alpha *= smoothstep(mix(0.001, 1.0, uIntensity), 0.2 * uIntensity, vSparkTime);
alpha *= smoothstep(0.5, 0.3, distanceToCenter);
vec3 color = vColor;
if (uEnabled == 0) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
color.rgb = vec3(grayscale);
}
gl_FragColor = vec4(color, alpha);
}`,e=>{e.transparent=!0,e.depthTest=!1,e.depthWrite=!1,e.blending=wt});st({SparkMaterial:W0});function q0({enabled:e,paramId:t}){const r=a.useRef(null),o=a.useRef(null),s=a.useRef(null),i=a.useRef(0),l=a.useRef(0);Ge((h,f)=>{i.current+=f,s.current.uniforms.uTime.value=i.current;const p=_e(t);o.current.lookAt(h.camera.position),l.current=se(l.current,Math.pow(p,.35),.1);const w=l.current;s.current.uniforms.uScale.value=se(0,1,w),s.current.uniforms.uAlpha.value=yt(10*w,0,1),s.current.uniforms.uHeatNoiseAmp.value=se(7,2,yt(2*w-.2,0,1)),s.current.uniforms.uNoiseAmp.value=se(3,.8,yt(p*1.75,0,1)),s.current.uniforms.uNoiseFreq.value=se(.25,.5,yt(p*1.5,0,1)),o.current.position.y=se(0,-.04,w),o.current.scale.y=se(1,1.2,w)});const c=bt(St,"./flame.png"),u=bt(St,"./smallFlame.png"),d=bt(St,"./noise.png");return d.wrapS=ht,d.wrapT=ht,n.jsx("group",{ref:r,position:[0,.57,0],children:n.jsxs("mesh",{ref:o,children:[n.jsx("planeGeometry",{args:[.45,.8]}),n.jsx("flameMaterial",{ref:s,uEnabled:e,uNoiseFreq:.5,uNoiseSpeed:.7,uNoiseAmp:.8,uHeatNoiseFreq:.5,uHeatNoiseSpeed:.5,uHeatNoiseAmp:2,uColor1:"#9988ff",uColor2:"#99ddff",uColor3:"#ffffdd",uFlameTexture:c,uSmallFlameTexture:u,uNoiseTexture:d})]})})}const Z0=at({uEnabled:1,uFlameTexture:null,uSmallFlameTexture:null,uNoiseTexture:null,uColor1:new Te("#ff0000"),uColor2:new Te("#ff0000"),uColor3:new Te("#ff0000"),uNoiseAmp:.5,uNoiseFreq:.1,uNoiseSpeed:.1,uHeatNoiseAmp:.5,uHeatNoiseFreq:.1,uHeatNoiseSpeed:.1,uScale:1,uTime:0,uAlpha:1},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
uniform int uEnabled;
uniform sampler2D uFlameTexture;
uniform sampler2D uSmallFlameTexture;
uniform sampler2D uNoiseTexture;
uniform vec3 uColor1;
uniform vec3 uColor2;
uniform vec3 uColor3;
uniform float uTime;
uniform float uNoiseFreq;
uniform float uNoiseAmp;
uniform float uNoiseSpeed;
uniform float uHeatNoiseFreq;
uniform float uHeatNoiseAmp;
uniform float uHeatNoiseSpeed;
uniform float uScale;
uniform float uAlpha;
void main() {
vec2 flameUv = vUv;
flameUv.x -= 0.5;
flameUv /= uScale;
flameUv.x += 0.5;
vec2 noiseUv = uNoiseFreq * vUv;
noiseUv.x += 0.5 * uTime;
vec3 noiseDistortion = -0.25 + texture2D(uNoiseTexture, uNoiseFreq * vUv - vec2(0.0, uNoiseSpeed * uTime)).rgb;
noiseDistortion *= uNoiseAmp * mix(0.0, 1.0, smoothstep(0.0, 0.5, vUv.y));
float flame = texture2D(uFlameTexture, flameUv + noiseDistortion.xy).r;
float smallFlame = texture2D(uSmallFlameTexture, flameUv + noiseDistortion.xy).r;
flame = mix(smallFlame, flame, clamp((uScale - 0.35) * 3.0, 0.2, 1.0));
float noiseHeat = texture2D(uNoiseTexture, uHeatNoiseFreq * vUv - vec2(0.0, uHeatNoiseSpeed * uTime)).r;
noiseHeat = uHeatNoiseAmp * (noiseHeat - 0.25);
noiseHeat *= clamp(1.0 - distance(flameUv, vec2(0.5)), 0.0, 1.0);
noiseHeat *= clamp(2.0 * flameUv.y, 0.0, 1.0);
noiseHeat *= clamp(10.0 * (1.0 - flameUv.y), 0.0, 1.0);
flame += noiseHeat;
float noiseErosion = texture2D(uNoiseTexture, 0.5 * uHeatNoiseFreq * vUv - vec2(0.0, 0.9 * uHeatNoiseSpeed * uTime)).r;
noiseErosion = clamp(10.0 * (noiseErosion - 0.1), 0.0, 1.0);
flame *= noiseErosion;
float colorNoise = texture2D(uNoiseTexture, 0.1 * vUv + vec2(0.0, -0.2 * uTime)).r;
vec3 color = mix(uColor1, uColor2, 5.0 * (colorNoise - 0.21));
color *= clamp(2.0 * flame, 0.0, 1.0);
color = mix(color, uColor3, clamp(2.0 * flame - 1.0, 0.0, 0.8));
color -= vec3(1.0 - uAlpha);
color = clamp(color, 0.0, 1.0);
if (uEnabled == 0) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
color.rgb = vec3(grayscale);
}
gl_FragColor = vec4(color, 1.0);
}`,e=>{e.transparent=!0,e.depthTest=!1,e.depthWrite=!1,e.blending=wt});st({FlameMaterial:Z0});const Y0=at({uEnabled:1,uNoiseTexture:null,uColor1:new Te("#ff0000"),uColor2:new Te("#ff0000"),uNoiseAmp:.5,uNoiseFreq:.1,uTime:0,uAlpha:1},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = (modelViewMatrix * vec4(position, 1.0) - modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0)).xy;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
uniform int uEnabled;
uniform sampler2D uNoiseTexture;
uniform vec3 uColor1;
uniform vec3 uColor2;
uniform float uTime;
uniform float uNoiseFreq;
uniform float uNoiseAmp;
uniform float uAlpha;
void main() {
vec2 noiseUv = uNoiseFreq * vUv;
noiseUv.x += 0.5 * uTime;
vec3 noiseDistortion = texture2D(uNoiseTexture, 0.05 * vUv - 0.1 * vec2(uTime)).rgb;
noiseUv += noiseDistortion.xy;
float colorNoise = texture2D(uNoiseTexture, noiseUv).r / 0.5;
vec3 color = mix(uColor1, uColor2, colorNoise);
vec3 fadeNoise = 3.0 * texture2D(uNoiseTexture, 0.4 * vUv - 0.3 * vec2(0.0, uTime)).rgb;
color *= fadeNoise;
color -= vec3(1.0 - uAlpha);
color = clamp(color, 0.0, 1.0);
if (uEnabled == 0) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
color.rgb = vec3(grayscale);
}
gl_FragColor = vec4(color, 1.0);
}`,e=>{e.transparent=!0,e.depthTest=!1,e.depthWrite=!1,e.blending=wt});st({HeatInteriorMaterial:Y0});function X0({enabled:e,paramId:t,snapshotId:r}){var x;const{nodes:o}=wn("./tubeInterior.gltf"),s=bt(St,"./noise.png");s.wrapS=ht,s.wrapT=ht;const i=bt(St,"./crush.png");i.wrapS=ht,i.wrapT=ht,i.magFilter=Hr,i.minFilter=Hr;const l=bt(St,"./wires.png");l.magFilter=Hr;const c=bt(St,"./wiresGlow.png");c.magFilter=Hr;const u=a.useRef(null),d=a.useRef(null),h=a.useRef(0),f=a.useRef(0),p=a.useRef(1),w=a.useRef(0);return Ge((m,v)=>{h.current+=v;const b=_e(t);d.current.uniforms.uTime.value=h.current%1e5;let S=se(.3,.1,b);if(h.current>f.current){f.current=h.current+se(.1,.8,Math.pow(Math.random(),3));let y=se(.5,3,Math.random()),g=se(0,.12,Math.pow(Math.random(),1)),j=.2,N=Math.random()>.8?1:se(10,100,Math.random());Math.random()<.3&&(y=100,g=1,j=5,f.current=h.current+se(.1,.5,Math.pow(Math.random(),3))),j*=se(.2,1,b),p.current=y,d.current.uniforms.uRectangleFreq.value=g,d.current.uniforms.uRectangleAmp.value=j,d.current.uniforms.uRectangleStretch.value=N,d.current.uniforms.uLineFreq.value=se(0,3,Math.random()),d.current.uniforms.uScanlineOffset.value=Math.random()>.8?1:0,d.current.uniforms.uAlpha.value=b>.001?Math.min(1,se(.05,1.3,b)):0;const P=r===void 0?0:Math.pow(Tt(r),.25);d.current.uniforms.uGlowAlpha.value=se(.3,1,P)}h.current>w.current+S/p.current&&(w.current=h.current,d.current.uniforms.uRectangleOffset.value.x=Math.random(),d.current.uniforms.uRectangleOffset.value.y=Math.random()),u.current.visible=b<.001}),n.jsxs(n.Fragment,{children:[n.jsx("group",{ref:u,children:n.jsx(qs,{paramId:t})}),n.jsx("mesh",{geometry:(x=o==null?void 0:o.geo2)==null?void 0:x.geometry,renderOrder:1,children:n.jsx("crushInteriorMaterial",{ref:d,uEnabled:e,uColor1:"#5599ff",uColor2:"#ffeeff",uColor3:"#77aaff",uColor4:"#cc66ff",uAlpha:1,uNoiseFreq:.2,uRectangleAmp:.3,uRectangleFreq:.06,uRectangleStretch:100,uNoiseTexture:s,uRectangleTexture:i,uWiresTexture:l,uWiresGlowTexture:c})})]})}const K0=at({uEnabled:1,uNoiseTexture:null,uRectangleTexture:null,uWiresTexture:null,uWiresGlowTexture:null,uRectangleFreq:1,uRectangleAmp:1,uRectangleStretch:1,uScanlineOffset:0,uLineFreq:1,uRectangleOffset:new sr(0,0),uColor1:new Te("#ff0000"),uColor2:new Te("#ff0000"),uColor3:new Te("#ff0000"),uColor4:new Te("#ff0000"),uNoiseFreq:.1,uTime:0,uAlpha:1,uGlowAlpha:1},`
precision mediump float;
varying vec2 vUv;
void main () {
vec3 viewPos = (modelViewMatrix * vec4(position, 0.0)).xyz;
vec3 viewDir = vec3(0.0, 0.0, -1.0);
vec3 viewTubeY = (modelViewMatrix * vec4(0.0, 1.0, 0.0, 0.0)).xyz;
viewTubeY.z = 0.0;
viewTubeY = normalize(viewTubeY);
vec3 viewTubeX = cross(viewDir, viewTubeY);
viewTubeX.z = 0.0;
viewTubeX = normalize(viewTubeX);
vUv = vec2(dot(viewPos, viewTubeX), dot(viewPos, viewTubeY));
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
uniform int uEnabled;
uniform sampler2D uNoiseTexture;
uniform sampler2D uRectangleTexture;
uniform sampler2D uWiresTexture;
uniform sampler2D uWiresGlowTexture;
uniform vec3 uColor1;
uniform vec3 uColor2;
uniform vec3 uColor3;
uniform vec3 uColor4;
uniform float uRectangleFreq;
uniform float uRectangleAmp;
uniform float uRectangleStretch;
uniform float uLineFreq;
uniform vec2 uRectangleOffset;
uniform float uScanlineOffset;
uniform float uTime;
uniform float uNoiseFreq;
uniform float uAlpha;
uniform float uGlowAlpha;
vec3 noisePattern(vec2 uv) {
float noise = 3.0 * texture2D(uNoiseTexture, uNoiseFreq * uv - vec2(0.0, 0.1 * uTime)).r;
return mix(uColor1, uColor2, noise);
}
void main() {
vec2 uv = vUv;
// Rectangle and static patterns.
vec2 rectanglesUv = uRectangleFreq * (uv + vec2(0.2, 0.0));
rectanglesUv.x *= uRectangleStretch;
rectanglesUv += uRectangleOffset;
vec3 rectPattern = uRectangleAmp * (texture2D(uRectangleTexture, rectanglesUv).rgb - vec3(0.218));
uv += rectPattern.xy;
// Shift UVs horizontally to create scanline effect.
float scanlineOffset = texture2D(uNoiseTexture, vec2(40.0 * uv.y, 0.123 * floor(1000.0 * uTime))).r - 0.2;
scanlineOffset = round(scanlineOffset * 20.0) * 0.05;
uv.x += uScanlineOffset * scanlineOffset * max(0.0, rectPattern.x + 0.2);
vec3 color = noisePattern(uv);
// Shift the colors in each rectangle.
vec3 colorMult = mix(uColor3, uColor4, mod(rectPattern.r * 124.456, 1.0));
colorMult += 0.25 * mod(rectPattern * vec3(123.456, 234.567, 345.678), 1.0);
color *= colorMult;
// Add vertical lines in the shifted rectangles.
if (rectPattern.x > 0.01) {
color += texture2D(uRectangleTexture, uLineFreq * uv.yx).rgb;
}
float alpha = uAlpha;
// Tube wires.
vec2 wiresUv = vec2(2.5 * uv.x + 0.5, 2.5 * uv.y - 0.1);
float wires = mix(1.5, 1.0, uGlowAlpha) * texture2D(uWiresTexture, wiresUv).r;
// Tube wire glow.
wires += uGlowAlpha * mix(0.1, 0.6, uAlpha) * texture2D(uWiresGlowTexture, wiresUv).r;
alpha = max(alpha, wires);
color += vec3(wires);
alpha *= step(0.001, uAlpha);
if (uEnabled == 0) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
color.rgb = vec3(grayscale);
}
gl_FragColor = vec4(color, alpha);
}`,e=>{e.transparent=!0,e.depthTest=!1,e.depthWrite=!1});st({CrushInteriorMaterial:K0});function Ol({type:e,paramId:t,core:r,count:o}){const s=a.useMemo(()=>new Lo(1,1),[]),i=a.useRef(null),l=a.useRef(null),c=o!=null?o:150,u=r?.7:1.5,d=r?.45:1.3,h=.08,f=r?.5:1,p=a.useMemo(()=>new it(new Float32Array(3*c),3),[c]),w=a.useMemo(()=>new it(new Float32Array(3*c),3),[c]),x=a.useMemo(()=>new it(new Float32Array(c),1),[c]),m=a.useMemo(()=>new it(new Float32Array(c),1),[c]),v=[p,w,x,m];a.useEffect(()=>{s.setAttribute("sparkPosition",p),s.setAttribute("sparkDirection",w),s.setAttribute("sparkCreationTime",x),s.setAttribute("sparkScale",m);for(let C=0;C<c;C++){const M=new Oe().randomDirection();r?M.multiplyScalar(.2):M.multiplyScalar(.1),p.array[3*C+0]=M.x,p.array[3*C+1]=M.y,p.array[3*C+2]=M.z;let R;r?R=M.normalize():R=new Oe(Math.random()-.5,10+Math.random(),Math.random()-.5).normalize(),w.array[3*C+0]=R.x,w.array[3*C+1]=R.y,w.array[3*C+2]=R.z,x.array[C]=-1*d*Math.random(),m.array[C]=se(.2,1,Math.random())}for(const C of v)C.needsUpdate=!0},[c,s]);const b=`${e}FDNEnabled`,S=`${e}FDNOpen`,y=`${e}FDNTune`,g=`${e}FDNScatter`,{min:j,max:N,skew:P}=ze()[y],L=a.useRef(0),I=a.useRef(0);return Ge((C,M)=>{const R=t?_e(t):1,O=_e(S),_=We(_e(y),j,N,P),z=_e(g),U=Fe.getState()[b];let $=R*O;U||($=0),I.current=se(I.current,$,.05),i.current.count=c*Math.pow(I.current,.5),L.current+=M*se(.75,1,O),l.current.uniforms.uTime.value=L.current,l.current.uniforms.uColor.value.setHSL(se(.78,.61,_),1,.8),l.current.uniforms.uSpiralAmp.value=se(.35,.5,z)*(r?.05:1)}),n.jsx("instancedMesh",{ref:i,geometry:s,frustumCulled:!1,args:[void 0,void 0,c],renderOrder:100,position:[0,.05,0],children:n.jsx("feedbackSparkMaterial",{ref:l,uLifetime:d,uSize:h,uTravelDist:u,uAlpha:f,uColor:"#ffccff",uSpiralAmp:.4,uSpiralFreq:7,uOrbitCenter:0})})}const J0=at({uColor:new Te,uTime:0,uSize:1,uLifetime:1,uTravelDist:1,uAlpha:1,uSpiralAmp:1,uSpiralFreq:1,uOrbitCenter:0},`
${Io}
precision mediump float;
attribute vec3 sparkPosition;
attribute vec3 sparkDirection;
attribute float sparkCreationTime;
attribute float sparkScale;
uniform float uTime;
uniform float uSize;
uniform float uLifetime;
uniform float uTravelDist;
uniform float uSpiralAmp;
uniform float uSpiralFreq;
uniform int uOrbitCenter;
varying vec2 vUv;
varying float vSparkTime;
void main () {
vUv = uv;
vSparkTime = mod(uTime - sparkCreationTime, uLifetime) / uLifetime;
vec3 sparkPos = sparkPosition;
float spiralAmp = uSpiralAmp * smoothstep(0.0, 0.2, vSparkTime);
sparkPos.x += spiralAmp * sin(uSpiralFreq * vSparkTime + 123.5 * sparkCreationTime);
sparkPos.z += spiralAmp * cos(uSpiralFreq * vSparkTime + 123.5 * sparkCreationTime);
if (uOrbitCenter > 0) {
sparkPos = (rotationMatrix(normalize(sparkPosition), -1.57) * vec4(sparkPos, 1.0)).xyz;
}
vec3 pos = sparkScale * uSize * position + sparkPos;
vec3 direction = sparkDirection;
pos += uTravelDist * vSparkTime * direction;
gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
varying float vSparkTime;
uniform float uAlpha;
uniform vec3 uColor;
void main() {
float distanceToCenter = distance(vUv, vec2(0.5));
float alpha = uAlpha;
alpha *= smoothstep(0.0, 0.3, vSparkTime);
alpha *= smoothstep(1.0, 0.2, vSparkTime);
// alpha *= smoothstep(0.5, 0.3, distanceToCenter);
alpha *= pow(clamp(1.0 - 2.0 * distanceToCenter, 0.0, 1.0), 4.0);
vec3 color = uColor;
color *= mix(10.0, 0.0, distanceToCenter);
gl_FragColor = vec4(color, alpha);
}`,e=>{e.transparent=!0,e.depthTest=!1,e.depthWrite=!1,e.blending=wt});st({FeedbackSparkMaterial:J0});function _l({enabled:e,type:t,paramId:r,alpha:o,particleCount:s,position:i,core:l}){const c=a.useMemo(()=>new Lo(1,1),[]),u=a.useRef(null),d=a.useRef(null),h=.2,f=.5,p=.45,x=p/.35,m=a.useMemo(()=>new it(new Float32Array(3*s),3),[s]),v=a.useMemo(()=>new it(new Float32Array(3*s),3),[s]),b=a.useMemo(()=>new it(new Float32Array(3*s),3),[s]),S=a.useMemo(()=>new it(new Float32Array(s),1),[s]),y=a.useMemo(()=>new it(new Float32Array(s),1),[s]),g=[m,v,b,S,y],j=`${t}FDNEnabled`,N=`${t}FDNOpen`,P=`${t}FDNTune`,{min:L,max:I,skew:C}=ze()[P],M=a.useRef(0);a.useEffect(()=>{c.setAttribute("particlePosition",m),c.setAttribute("particleDirection",v),c.setAttribute("particleColor",b),c.setAttribute("particleCreationTime",S),c.setAttribute("particleScale",y);for(let _=0;_<s;_++){m.array[3*_+0]=h*(Math.random()-.5),m.array[3*_+1]=h*(Math.random()-.5),m.array[3*_+2]=h*(Math.random()-.5);let z;l?z=new Oe(Math.random()-.5,Math.random()-.5,Math.random()-.5).normalize():z=new Oe(Math.random()-.5,2.8+Math.random(),Math.random()-.5).normalize(),v.array[3*_+0]=z.x,v.array[3*_+1]=z.y,v.array[3*_+2]=z.z,b.array[3*_+0]=.05*se(.5,1,Math.random()),b.array[3*_+1]=.04*se(.5,1,Math.random()),b.array[3*_+2]=.08*1,S.array[_]=-1*x*Math.random(),y.array[_]=se(.4,1,Math.random())}for(const _ of g)_.needsUpdate=!0},[s,c]);const R=a.useRef(0);Ge((_,z)=>{const U=r?_e(r):1,$=We(_e(P),L,I,C);R.current+=z,d.current.uniforms.uTime.value=R.current;const V=Fe.getState()[j];let E=.4*o*Math.pow(U,.25);E*=Math.pow(_e(N),.5),V||(E=0),M.current=se(M.current,E,.05),d.current.uniforms.uAlpha.value=M.current,d.current.uniforms.uColor.value.setHSL(se(.78,.61,$),.6,.08)});const O=bt(St,"./noise.png");return O.wrapS=ht,O.wrapT=ht,n.jsx("instancedMesh",{ref:u,position:i,geometry:c,frustumCulled:!1,args:[void 0,void 0,s],children:n.jsx("smokeMaterial",{ref:d,uEnabled:e,uLifetime:x,uNoiseTexture:O,uSize:f,uTravelDist:p,uAlpha:o,uColor:"#ffccff",uSpiralAmp:.08,uSpiralFreq:2})})}const Q0=at({uEnabled:1,uColor:new Te,uNoiseTexture:null,uTime:0,uSize:1,uLifetime:1,uTravelDist:1,uAlpha:1,uSpiralAmp:1,uSpiralFreq:1},`
precision mediump float;
attribute vec3 particlePosition;
attribute vec3 particleDirection;
attribute vec3 particleColor;
attribute float particleCreationTime;
attribute float particleScale;
uniform float uTime;
uniform float uSize;
uniform float uLifetime;
uniform float uTravelDist;
uniform float uSpiralAmp;
uniform float uSpiralFreq;
varying vec2 vUv;
varying vec3 vColor;
varying float vParticleTime;
void main () {
vUv = uv;
vColor = clamp(1.0 * particleColor, 0.0, 1.0);
float lifetime = uLifetime + 0.1 * particleCreationTime;
vParticleTime = mod(uTime - particleCreationTime, lifetime) / lifetime;
float scale = particleScale * uSize * mix(0.25, 1.75, vParticleTime);
vec3 pos = scale * position + particlePosition;
float spiralAmp = uSpiralAmp * smoothstep(0.0, 0.5, vParticleTime);
pos.x += spiralAmp * sin(uSpiralFreq * vParticleTime + 123.5 * particleCreationTime);
pos.z += spiralAmp * cos(uSpiralFreq * vParticleTime + 123.5 * particleCreationTime);
vec3 direction = particleDirection;
pos += uTravelDist * vParticleTime * direction;
gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
varying vec3 vColor;
varying float vParticleTime;
uniform int uEnabled;
uniform sampler2D uNoiseTexture;
uniform float uAlpha;
uniform vec3 uColor;
void main() {
float distanceToCenter = distance(vUv, vec2(0.5));
float alpha = uAlpha;
alpha *= smoothstep(0.0, 0.2, vParticleTime);
alpha *= smoothstep(1.0, 0.2, vParticleTime);
alpha *= smoothstep(0.5, 0.2, distanceToCenter);
alpha *= smoothstep(0.15, 0.25, texture2D(uNoiseTexture, 0.1 * vUv + 12.34 * vColor.rg).r);
vec3 color = uColor;
if (uEnabled == 0) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
color.rgb = vec3(grayscale);
}
gl_FragColor = vec4(color, alpha);
}`,e=>{e.transparent=!0,e.depthTest=!1,e.depthWrite=!1,e.blending=wt});st({SmokeMaterial:Q0});var so=(e=>(e[e.Heat=0]="Heat",e[e.Charge=1]="Charge",e[e.Crush=2]="Crush",e))(so||{});function Yo({type:e,tubeType:t,paramId:r,isMuted:o,snapshotId:s,rotation:i}){var p,w;const{nodes:l}=wn("./tubeGlass.gltf"),{nodes:c}=wn("./tubeBase.gltf"),u=mt(x=>x.graphicsQuality),d=T(x=>x[`${e}Enabled`]),h=.092,f=.38;return n.jsx("group",{rotation:i,scale:[f,f,f],children:n.jsxs("group",{position:[0,h/f,0],children:[n.jsx("mesh",{geometry:(p=l==null?void 0:l.geo2)==null?void 0:p.geometry,renderOrder:9,children:n.jsx(ef,{type:e,paramId:r,color:"#66aaff",isMuted:o})}),n.jsx("mesh",{geometry:(w=c==null?void 0:c.geo2)==null?void 0:w.geometry,children:n.jsx("meshStandardMaterial",{color:"#333344",roughness:.2,metalness:.5})}),t===1&&n.jsx(z0,{enabled:d&&!o,paramId:r,snapshotId:s}),t===0&&n.jsx(H0,{enabled:d&&!o,paramId:r,snapshotId:s}),t===2&&n.jsx(X0,{enabled:d&&!o,paramId:r,snapshotId:s}),u!==ct.Low&&n.jsxs(n.Fragment,{children:[n.jsx("group",{scale:[1/f,1/f,1/f],children:n.jsx(_l,{type:e,enabled:d&&!o,paramId:r,particleCount:100,alpha:.75,position:[0,.07,0]})}),n.jsx(Ol,{type:e,paramId:r})]})]})})}function ef({type:e,paramId:t,color:r,isMuted:o}){const s=a.useRef(null),i=a.useRef(0);return Ge((l,c)=>{var f;const d=Fe.getState()[`${e}Enabled`],h=_e(t);i.current+=c,(f=s.current)!=null&&f.userData.uEnabled&&(s.current.userData.uTime.value=i.current%1e4,s.current.userData.uEnabled.value=d&&!o?1:0,s.current.userData.uActivation.value=h)}),n.jsx("meshStandardMaterial",{ref:s,transparent:!0,opacity:.9,metalness:0,blending:wt,roughness:.13,color:"#000000",onBeforeCompile:l=>{const c=s.current;c.userData.uTime={value:0},c.userData.uEnabled={value:1},c.userData.uActivation={value:0},c.userData.uActiveColor={value:new Te(r)},l.uniforms.uTime=c.userData.uTime,l.uniforms.uEnabled=c.userData.uEnabled,l.uniforms.uActivation=c.userData.uActivation,l.uniforms.uActiveColor=c.userData.uActiveColor,l.fragmentShader=`
uniform int uEnabled;
uniform float uTime;
uniform float uActivation;
uniform vec3 uActiveColor;
`+l.fragmentShader.replace("}",`
gl_FragColor.a *= mix(0.1, 1.0, pow(1. - dot(normal, vec3(0., 0., 1.)), 2.0));
float a = gl_FragColor.a;
gl_FragColor.a *= mix(1.0, 3.0, uActivation);
float highlight = 1.0 - dot(normal, vec3(0., 0., 1.));
float bottom = clamp(dot(normal, vec3(0., -1., 0.)), 0., 1.);
float top = clamp(dot(normal, vec3(0., 1., 0.)), 0., 1.);
highlight = pow(mix(1., 2., bottom)*highlight, mix(1., 5.0, bottom));
vec4 highlightColor = mix(
vec4(1.0, 0.5, 0.3, 0.4),
vec4(0.5, 0.3, 1.0, 0.4),
bottom);
highlightColor = mix(
highlightColor,
vec4(0.3),
top);
gl_FragColor += mix(vec4(0.0), highlightColor, highlight);
gl_FragColor.rgb += uActivation * uActiveColor * 0.25;
gl_FragColor = clamp(gl_FragColor, 0.0, 1.0);
if (uEnabled == 0) {
float grayscale = dot(gl_FragColor.rgb, vec3(0.299, 0.587, 0.114));
gl_FragColor.rgb = vec3(grayscale);
}
}`)}})}function gs({type:e,prevId:t,isDragging:r,isMuted:o,disableFrustumCulling:s}){const i=a.useRef(null),l=a.useRef(0);Ge((p,w)=>{l.current+=w;const x=i.current,m=.2,v=1;x.rotation.set(m*Math.sin(v*l.current),m*Math.cos(v*l.current),0)});const c=`${e}Heat`,u=`${e}Charge`,d=`${e}Crush`,h=mt(p=>p.graphicsQuality),f=T(p=>p[`${e}Enabled`]);return n.jsxs("group",{ref:i,children:[n.jsx(Yo,{tubeType:so.Heat,type:e,paramId:c,rotation:[0,0,0],isMuted:o,snapshotId:t}),n.jsx(Yo,{tubeType:so.Crush,type:e,paramId:d,rotation:[0,0,2*Math.PI/3],isMuted:o,snapshotId:t}),n.jsx(Yo,{tubeType:so.Charge,type:e,paramId:u,rotation:[0,0,-2*Math.PI/3],isMuted:o,snapshotId:t}),n.jsx(cr,{enabledParam:`${e}Enabled`,mixParam:`${e}Depth`,muted:o,snapshotId:t,renderOrder:100,showContactHighlights:!r,vibrationAmount:.25,disableFrustumCulling:s}),h!==ct.Low&&n.jsxs(n.Fragment,{children:[n.jsx("group",{scale:[.75,.75,.75],children:n.jsx(_l,{enabled:f&&!o,type:e,particleCount:120,alpha:.8,position:[0,-.05,0],core:!0})}),n.jsx("group",{scale:[.4,.4,.4],children:n.jsx(Ol,{type:e,paramId:void 0,core:!0,count:60})})]})]})}const qn=16,Kn=4,za=.007,tf=Array.from({length:Kn},(e,t)=>{const r=t*2*Math.PI/Kn;return new sr(Math.sin(r),Math.cos(r))});function Gr(e){const t=new Float32Array(qn*Kn*e),r=new it(t,e);return r.setUsage(uc),r}function yo({type:e,prevId:t,isDragging:r,isMuted:o,disableFrustumCulling:s}){const i=mt(q=>q.graphicsQuality),l=a.useRef(0),c=a.useRef(null),u=a.useRef(null),d=a.useRef(null),h=a.useRef([]),f=a.useRef(),p=a.useRef(),w=a.useRef(),x=a.useRef(),m=i===ct.Low?32:i===ct.High?256:128,v=a.useMemo(()=>{const q=new ac(1,.001,4,m);return f.current=Gr(1),p.current=Gr(3),w.current=Gr(1),x.current=Gr(1),q.setAttribute("alpha",f.current),q.setAttribute("color",p.current),q.setAttribute("tRing",w.current),q.setAttribute("tCopy",x.current),h.current=[f.current,p.current,w.current,x.current],q},[m]),b=a.useMemo(()=>new ic,[]),S=a.useMemo(()=>new Oe(0,0,0),[]),y=a.useMemo(()=>new lc,[]),g=a.useMemo(()=>new cc(0,0,0),[]),j=a.useMemo(()=>new Oe,[]),N=a.useMemo(()=>new Te(4491519),[]),P=`${e}Mix`,L=`${e}Density`,I=`${e}Scale`,C=`${e}Spread`,M=`${e}Decay`,R=`${e}Enabled`,O=`${e}Motion`,_=`${e}MotionDepth`,z=a.useRef(0),U=a.useRef(0),$=a.useRef(0),V=a.useRef(0),E=a.useRef(!0);return E.current=!0,Ge((q,W)=>{if(l.current+=W,!c.current||!u.current||!d.current)return;const F=.01*_e(C),Z=.01*_e(I),Y=_e(L),me=.01*_e(M),Se=.01*_e(O),je=.01*_e(_),le=Fe.getState()[R],Me=c.current,ve=.22,K=1;Me.rotation.set(ve*Math.sin(K*l.current),ve*Math.cos(K*l.current),0),u.current.uniforms.uTime.value=l.current,u.current.uniforms.uBlur.value=se(0,1,me*me),u.current.uniforms.uAlpha.value=se(1,.75,me*me),u.current.uniforms.uEnabled.value=le&&!o?1:0;const ce=3,re=16,te=.02,ue=15;if(u.current.uniforms.uWaveFreq.value=se(ce,re,Math.pow(Se,2)),u.current.uniforms.uWaveAmp.value=te*Math.pow(je,.5)*Math.pow(Se,.2),u.current.uniforms.uWaveTime.value+=ue*Math.pow(Se,.2)*W,le&&t!==void 0?u.current.uniforms.uVolume.value=Tt(t)*.01*_e(P):u.current.uniforms.uVolume.value=0,!E.current&&z.current===F&&U.current===Z&&$.current===Y&&V.current===me)return;E.current=!1,z.current=F,U.current=Z,$.current=Y,V.current=me;const he=d.current,Q=se(3.25,qn,Y*Y),Ne=.12,xe=se(.3,.56,Z);u.current.uniforms.uThickness.value=za*xe*se(1.5,6,Math.pow(me,1.5));for(let ae=0;ae<Kn;ae++){const we=ae/(Kn-1),Ae=1,Ce=tf[ae];N.r=se(0,.5,(Ce.x+1)/2),N.b=se(1,.5,(Ce.y+1)/2);for(let qe=0;qe<qn;qe++){const B=qe/(Q-1),G=se(Ne,xe,B);let pe=se(1,0,B);pe=la.clamp(pe,0,1);const ke=Q/qn*se(1,.75,Z)*se(.5,1,me);pe*=se(1,.3,la.clamp((ke-.5)/.5,0,1));const Pe=1.75*se(.2,.1,Y)*xe,Ie=F*Pe*se(.2,1,B);S.x=Ie*Ce.x,S.y=Ie*Ce.y,y.setFromEuler(g),j.set(G,G,G),b.compose(S,y,j);const $e=qe+ae*qn;he.setMatrixAt($e,b),f.current.setX($e,pe*Ae),p.current.setXYZ($e,N.r,N.g,N.b),w.current.setX($e,B),x.current.setX($e,we)}}he.instanceMatrix.needsUpdate=!0;for(const ae of h.current)ae.needsUpdate=!0}),n.jsxs("group",{ref:c,rotation:[0,-.9,0],children:[n.jsx(cr,{enabledParam:`${e}Enabled`,mixParam:P,muted:o,snapshotId:t,renderOrder:100,showContactHighlights:!r,disableFrustumCulling:s}),n.jsx("instancedMesh",{ref:d,args:[v,void 0,qn*Kn],children:n.jsx("hazeShader",{ref:u,uPulseAmount:.1,uPulseSpeed:8,uPulseFreq:16,uThickness:za,uBlur:0,uWobbleAmp:.025,uWobbleFreq:1})})]})}a.memo(yo);const nf=at({uTime:0,uEnabled:0,uPulseAmount:0,uPulseSpeed:0,uPulseFreq:0,uWobbleAmp:0,uWobbleFreq:0,uWaveAmp:0,uWaveFreq:1,uWaveTime:0,uThickness:0,uBlur:0,uVolume:0,uAlpha:1},`
attribute float alpha;
attribute vec3 color;
attribute float tRing;
attribute float tCopy;
uniform float uTime;
uniform float uPulseAmount;
uniform float uPulseSpeed;
uniform float uPulseFreq;
uniform float uThickness;
uniform float uWobbleAmp;
uniform float uWobbleFreq;
uniform float uWaveAmp;
uniform float uWaveFreq;
uniform float uWaveTime;
varying float vAlpha;
varying vec3 vColor;
varying vec3 vViewNormal;
void main() {
vAlpha = alpha;
vColor = color;
vec3 positionInstance = position;
float angle = atan(positionInstance.x, positionInstance.y);
float waveAmp = uWaveAmp;
// Motion wave
// Offset the wave time for each copy of the ring.
float waveTime = (1.0 - 2.0 * mod(tCopy * 3.0, 2.0)) * uWaveTime;
// Interpolate between the two nearest integer frequencies. We want to
// use integer frequencies so there's not a seam at some point on the
// circle.
float wave1 = sin(angle * floor(uWaveFreq) + tRing * 6.0 + waveTime + tCopy * 6.0);
float wave2 = sin(angle * ceil(uWaveFreq) + tRing * 6.0 + waveTime + tCopy * 6.0);
positionInstance.xy *= 1.0 + waveAmp * mix(wave1, wave2, smoothstep(0.0, 1.0, smoothstep(0.0, 1.0, fract(uWaveFreq))));
vec4 positionObject = instanceMatrix * vec4(positionInstance, 1.0);
// Pulse brightness
float dist = length(positionObject.xyz);
vColor *= 1.0 + uPulseAmount * (sin(dist * uPulseFreq - uTime * uPulseSpeed));
positionObject.x += sin(uTime * uWobbleFreq + 2.0 * 3.14159 * tCopy) * uWobbleAmp * tRing;
positionObject.y += cos(uTime * uWobbleFreq + 2.0 * 3.14159 * tCopy) * uWobbleAmp * tRing;
vec4 normalObject = normalize(instanceMatrix * vec4(normal, 0.0));
positionObject.xyz += normalObject.xyz * uThickness;
vViewNormal = (viewMatrix * normalObject).xyz;
gl_Position = projectionMatrix * modelViewMatrix * positionObject;
}
`,`
uniform float uBlur;
uniform float uAlpha;
uniform float uEnabled;
uniform float uVolume;
varying float vAlpha;
varying vec3 vColor;
varying vec3 vViewNormal;
void main() {
vec3 normal = normalize(vViewNormal);
vec3 color = vColor;
float facingForward = dot(normal, vec3(0.0, 0.0, 1.0));
float highlight = facingForward * facingForward;
highlight *= highlight;
highlight *= highlight;
color *= mix(1.0, 1.5, highlight);
color *= mix(1.0, 1.8, uVolume);
color = clamp(color, 0.0, 1.0);
if (uEnabled == 0.0) {
color = vec3(dot(color, vec3(0.299, 0.587, 0.114)));
}
float blurAlpha = facingForward * mix(3.0, 1.0, uBlur);
blurAlpha = clamp(blurAlpha, 0.0, 1.0);
gl_FragColor = vec4(color, vAlpha * uAlpha * blurAlpha);
}
`,e=>{e.transparent=!0,e.depthTest=!1,e.depthWrite=!1,e.blending=wt});st({HazeShader:nf});function Sr(e,t){let r,o=Number.MAX_VALUE;for(const s of t){const i=e.distanceTo(s.pos);i<.5&&i<o&&(o=i,r=s)}return r}function Do({paramId:e,setParameter:t,value:r,style:o={},onMouseEnter:s=void 0,onMouseLeave:i=void 0}){const l=a.useCallback(u=>{u.stopPropagation(),t(e,1-Number(r))},[t,r,e]),c=a.useCallback(u=>{u.stopPropagation(),l(u)},[l,r]);return n.jsxs("button",{className:"relative","aria-label":e,style:o,children:[n.jsx("div",{className:"absolute left-[50%] top-[50%] w-[2.25vw] h-[2.25vw] translate-x-[-50%] translate-y-[-50%] rounded-full",onDoubleClick:c,onMouseEnter:s,onMouseLeave:i,onClick:l}),n.jsxs("svg",{width:12,height:12,children:[n.jsx("circle",{r:6,fill:"#00000073",cx:6,cy:6}),n.jsx("circle",{r:4,fill:r?fe.lunaCoral:fe.lunaLight,cx:6,cy:6})]})]})}var X=(e=>(e.AddNodes="add-nodes",e.ArrowDown="arrow-down",e.ArrowLeft="arrow-left",e.ArrowLeftLong="arrow-left-long",e.ArrowLeftRight="arrow-left-right",e.ArrowRight="arrow-right",e.ArrowRightLong="arrow-right-long",e.Check="check",e.Columns="columns",e.Close="close",e.Cursor="cursor",e.CurveAscending="curve-ascending",e.CurveDescending="curve-descending",e.Delete="delete",e.Dice="dice",e.DoubleArrow="double-arrow",e.Drum="drum",e.Edit="edit",e.Email="email",e.EnvFollower="env-follower",e.Eye="eye",e.FilterBand="filter-band",e.FilterHigh="filter-high",e.FilterLow="filter-low",e.Folder="folder",e.Freeze="freeze",e.Gear="gear",e.Heart="heart",e.HeartFilled="heart-filled",e.Joker="joker",e.Key="key",e.Lab="lab",e.LineAscending="line-ascending",e.LineDescending="line-descending",e.LineFlat="line-flat",e.Link="link",e.Lock="lock",e.LockOpen="lock-open",e.Magic="magic",e.Mix="mix",e.Microphone="microphone",e.Move="move",e.Particles="particles",e.Pattern="pattern",e.Paste="paste",e.Pitch="pitch",e.Plus="plus",e.Repeat="repeat",e.Reverse="reverse",e.Reverse2="reverse-2",e.Reset="reset",e.Rows="rows",e.Save="save",e.Search="search",e.Shuffle="Shuffle",e.SineWave="sine-wave",e.Settings="settings",e.Smooth="smooth",e.Speed="speed",e.Space="space",e.SquareWave="square-wave",e.Star="star",e.Stop="stop",e.Time="time",e.Thunder="thunder",e.Transient="transient",e.Trash="trash",e.Triangle="trangle",e.Update="update",e.Wand="wand",e.Undo="undo",e.Redo="redo",e.Waves="waves",e.Fractal="fractal",e.Embers="embers",e))(X||{});const Xo=18,ie=({size:e=Xo,type:t,onClick:r,active:o,color:s,hoverColor:i})=>{var w;const l=T(x=>x.resizeFactor()),[c,u]=a.useState(window.innerWidth*e/(1280*Xo)),d=()=>{u(window.innerWidth*(e/(1280*Xo))*l)};a.useEffect(()=>(d(),window.addEventListener("resize",d),()=>{window.removeEventListener("resize",d)}),[]);const f={className:`cursor-pointer fill-current ${o?"opacity-100":"opacity-50 hover:opacity-60"}`,onClick:r},p=o?(w=i||s)!=null?w:fe.lunaCoral:s!=null?s:"white";switch(t){case"add-nodes":return n.jsx("svg",{width:16*c,height:16*c,viewBox:"0 0 33 33",fill:"none",children:n.jsx("path",{fill:"white",d:"m 5.657824,21.428242 c -1.108658,0 -1.971297,0.924144 -1.971297,1.971296 0,1.108884 0.862639,1.971297 1.971297,1.971297 1.047378,0 1.971296,-0.862413 1.971296,-1.971297 0,-1.047152 -0.923918,-1.971296 -1.971296,-1.971296 z m 4.681998,0.492712 h 20.452146 c 0.800911,0 1.47836,0.677675 1.47836,1.478584 0,0.862414 -0.677449,1.478586 -1.47836,1.478586 H 10.339822 c -0.616171,2.032801 -2.525738,3.449656 -4.681998,3.449656 -2.771981,0 -4.928152,-2.156034 -4.928152,-4.928242 0,-2.710476 2.156171,-4.928242 4.928152,-4.928242 2.15626,0 4.065827,1.478361 4.681998,3.449658 z M 25.37079,9.6004611 c 0,1.1088829 0.862639,1.9712969 1.971296,1.9712969 1.047379,0 1.971297,-0.862414 1.971297,-1.9712969 0,-1.0471525 -0.923918,-1.9712962 -1.971297,-1.9712962 -1.108657,0 -1.971296,0.9241437 -1.971296,1.9712962 z M 22.598808,8.1218763 c 0.615946,-1.9712965 2.525739,-3.4496564 4.743278,-3.4496564 2.710703,0 4.928242,2.2177651 4.928242,4.9282412 0,2.7722069 -2.217539,4.9282419 -4.928242,4.9282419 -2.217539,0 -4.127332,-1.416855 -4.743278,-3.449656 H 2.208145 c -0.862437,0 -1.478473,-0.616172 -1.478473,-1.4785859 0,-0.8009093 0.616036,-1.4785848 1.478473,-1.4785848 z"})});case"arrow-down":return n.jsx("svg",D(k({width:c*16,height:c*16,viewBox:"0 0 16 16",fill:"none"},f),{children:n.jsx("path",{d:"M7.56055 10.3145L3.81055 6.56445C3.55664 6.33008 3.55664 5.91992 3.81055 5.68555C4.04492 5.43164 4.45508 5.43164 4.68945 5.68555L8.00977 8.98633L11.3105 5.68555C11.5449 5.43164 11.9551 5.43164 12.1895 5.68555C12.4434 5.91992 12.4434 6.33008 12.1895 6.56445L8.43945 10.3145C8.20508 10.5684 7.79492 10.5684 7.56055 10.3145Z",fill:p,fillOpacity:"0.6"})}));case"arrow-left":return n.jsx("svg",D(k({width:16*c,height:16*c,viewBox:"0 0 16 16",fill:"none"},f),{children:n.jsx("path",{fill:"white",d:"M5.14062 8.35938C4.95312 8.17188 4.95312 7.82812 5.14062 7.64062L10.1406 2.64062C10.3281 2.45312 10.6719 2.45312 10.8594 2.64062C11.0469 2.82812 11.0469 3.17188 10.8594 3.35938L6.20312 7.98438L10.8594 12.6406C11.0469 12.8281 11.0469 13.1719 10.8594 13.3594C10.6719 13.5469 10.3281 13.5469 10.1406 13.3594L5.14062 8.35938Z"})}));case"arrow-left-long":return n.jsx("svg",D(k({width:16*c,height:16*c,viewBox:"0 0 448 512"},f),{children:n.jsx("path",{fill:p,d:"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z"})}));case"arrow-left-right":return n.jsx("svg",D(k({width:16*c,height:16*c,viewBox:"0 0 512 512"},f),{children:n.jsx("path",{fill:p,d:"M406.6 374.6l96-96c12.5-12.5 12.5-32.8 0-45.3l-96-96c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224l-293.5 0 41.4-41.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-96 96c-12.5 12.5-12.5 32.8 0 45.3l96 96c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288l293.5 0-41.4 41.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0z"})}));case"arrow-right":return n.jsx("svg",D(k({width:16*c,height:16*c,viewBox:"0 0 16 16",fill:"none"},f),{children:n.jsx("path",{fill:"white",d:"M10.8594 8.35938C11.0469 8.17188 11.0469 7.82812 10.8594 7.64062L5.85938 2.64062C5.67188 2.45312 5.32812 2.45312 5.14062 2.64062C4.95312 2.82812 4.95312 3.17188 5.14062 3.35938L9.79688 7.98438L5.14062 12.6406C4.95312 12.8281 4.95312 13.1719 5.14062 13.3594C5.32812 13.5469 5.67188 13.5469 5.85938 13.3594L10.8594 8.35938Z"})}));case"arrow-right-long":return n.jsx("svg",D(k({width:16*c,height:16*c,viewBox:"0 0 448 512"},f),{children:n.jsx("path",{fill:p,d:"M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"})}));case"check":return n.jsx("svg",D(k({viewBox:"0 0 24 24",width:24*c,height:24*c},f),{fill:"none",children:n.jsx("path",{d:"M 19.980469 5.9902344 A 1.0001 1.0001 0 0 0 19.292969 6.2929688 L 9 16.585938 L 5.7070312 13.292969 A 1.0001 1.0001 0 1 0 4.2929688 14.707031 L 8.2929688 18.707031 A 1.0001 1.0001 0 0 0 9.7070312 18.707031 L 20.707031 7.7070312 A 1.0001 1.0001 0 0 0 19.980469 5.9902344 z",fill:"white"})}));case"columns":return n.jsxs("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 20 20",fill:"none"},f),{children:[n.jsx("line",{x1:"2",x2:"2",y1:"2",y2:"18",stroke:p,strokeWidth:3,strokeLinecap:"round"}),n.jsx("line",{x1:"10",x2:"10",y1:"2",y2:"18",stroke:p,strokeWidth:3,strokeLinecap:"round"}),n.jsx("line",{x1:"18",x2:"18",y1:"2",y2:"18",stroke:p,strokeWidth:3,strokeLinecap:"round"})]}));case"close":return n.jsx("svg",D(k({width:16*c,height:16*c,viewBox:"0 0 16 16",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M12.125 12.875L8 8.71875L3.84375 12.875C3.65625 13.0625 3.34375 13.0625 3.125 12.875C2.9375 12.6562 2.9375 12.3438 3.125 12.1562L7.28125 8L3.125 3.875C2.9375 3.6875 2.9375 3.375 3.125 3.15625C3.34375 2.96875 3.65625 2.96875 3.84375 3.15625L8 7.3125L12.125 3.15625C12.3125 2.96875 12.625 2.96875 12.8438 3.15625C13.0312 3.375 13.0312 3.6875 12.8438 3.875L8.6875 8L12.8438 12.1562C13.0312 12.3438 13.0312 12.6562 12.8438 12.875C12.625 13.0625 12.3125 13.0625 12.125 12.875Z"})}));case"cursor":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 50 50"},f),{children:n.jsx("path",{fill:p,d:"M 29.699219 47 C 29.578125 47 29.457031 46.976563 29.339844 46.933594 C 29.089844 46.835938 28.890625 46.644531 28.78125 46.398438 L 22.945313 32.90625 L 15.683594 39.730469 C 15.394531 40.003906 14.96875 40.074219 14.601563 39.917969 C 14.238281 39.761719 14 39.398438 14 39 L 14 6 C 14 5.601563 14.234375 5.242188 14.601563 5.082031 C 14.964844 4.925781 15.390625 4.996094 15.683594 5.269531 L 39.683594 27.667969 C 39.972656 27.9375 40.074219 28.355469 39.945313 28.726563 C 39.816406 29.101563 39.480469 29.363281 39.085938 29.398438 L 28.902344 30.273438 L 35.007813 43.585938 C 35.117188 43.824219 35.128906 44.101563 35.035156 44.351563 C 34.941406 44.601563 34.757813 44.800781 34.515625 44.910156 L 30.113281 46.910156 C 29.980469 46.96875 29.84375 47 29.699219 47 Z"})}));case"curve-ascending":return n.jsx("svg",D(k({viewBox:"0 0 36 36",height:20*c,width:20*c},f),{children:n.jsx("path",{fill:p,d:"M 0.773438 32.8125 C 0.773438 31.871094 1.535156 31.105469 2.480469 31.105469 C 18.566406 31.105469 31.652344 18.015625 31.652344 1.929688 C 31.652344 0.988281 32.417969 0.222656 33.363281 0.222656 C 34.304688 0.222656 35.070312 0.988281 35.070312 1.929688 C 35.070312 6.328125 34.207031 10.597656 32.507812 14.613281 C 30.867188 18.496094 28.515625 21.980469 25.523438 24.972656 C 22.535156 27.964844 19.046875 30.3125 15.167969 31.953125 C 11.148438 33.65625 6.878906 34.515625 2.480469 34.515625 C 1.535156 34.519531 0.773438 33.753906 0.773438 32.8125 Z M 0.773438 32.8125"})}));case"curve-descending":return n.jsx("svg",D(k({viewBox:"0 0 36 36",height:20*c,width:20*c},f),{children:n.jsx("path",{fill:p,transform:"rotate(90 18 18)",d:"M 0.773438 32.8125 C 0.773438 31.871094 1.535156 31.105469 2.480469 31.105469 C 18.566406 31.105469 31.652344 18.015625 31.652344 1.929688 C 31.652344 0.988281 32.417969 0.222656 33.363281 0.222656 C 34.304688 0.222656 35.070312 0.988281 35.070312 1.929688 C 35.070312 6.328125 34.207031 10.597656 32.507812 14.613281 C 30.867188 18.496094 28.515625 21.980469 25.523438 24.972656 C 22.535156 27.964844 19.046875 30.3125 15.167969 31.953125 C 11.148438 33.65625 6.878906 34.515625 2.480469 34.515625 C 1.535156 34.519531 0.773438 33.753906 0.773438 32.8125 Z M 0.773438 32.8125"})}));case"delete":return n.jsx("svg",D(k({width:16*c,height:16*c,viewBox:"0 0 16 16",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M15.1111 4.44445C15.1111 3.97223 14.6944 3.55556 14.2222 3.55556H5.69444C5.44444 3.55556 5.22222 3.66667 5.05556 3.83334L0.888889 8.00001L5.05556 12.1944C5.22222 12.3611 5.44444 12.4444 5.69444 12.4444H14.2222C14.6944 12.4444 15.1111 12.0556 15.1111 11.5556V4.44445ZM14.2222 2.66667C15.1944 2.66667 16 3.47223 16 4.44445V11.5556C16 12.5556 15.1944 13.3333 14.2222 13.3333H5.69444C5.22222 13.3333 4.77778 13.1667 4.44444 12.8333L0.25 8.63889C0.0833333 8.47223 0 8.25001 0 8.00001C0 7.77778 0.0833333 7.55556 0.25 7.38889L4.44444 3.19445C4.77778 2.86112 5.22222 2.66667 5.69444 2.66667H14.2222ZM11.8611 5.91667C12.0278 6.08334 12.0278 6.38889 11.8611 6.55556L10.3889 8.00001L11.8611 9.47223C12.0278 9.63889 12.0278 9.94445 11.8611 10.1111C11.6944 10.2778 11.3889 10.2778 11.2222 10.1111L9.77778 8.63889L8.30556 10.1111C8.13889 10.2778 7.83333 10.2778 7.66667 10.1111C7.5 9.94445 7.5 9.63889 7.66667 9.47223L9.13889 8.00001L7.66667 6.55556C7.5 6.38889 7.5 6.08334 7.66667 5.91667C7.83333 5.75001 8.13889 5.75001 8.30556 5.91667L9.77778 7.38889L11.2222 5.91667C11.3889 5.75001 11.6944 5.75001 11.8611 5.91667Z"})}));case"dice":return n.jsx("svg",D(k({width:14*c,height:14*c,viewBox:"0 0 14 14",fill:"none"},f),{children:n.jsx("path",{fill:"white",d:"M2 1C1.4375 1 1 1.46875 1 2V12C1 12.5625 1.4375 13 2 13H12C12.5312 13 13 12.5625 13 12V2C13 1.46875 12.5312 1 12 1H2ZM0 2C0 0.90625 0.875 0 2 0H12C13.0938 0 14 0.90625 14 2V12C14 13.125 13.0938 14 12 14H2C0.875 14 0 13.125 0 12V2ZM4 3.25C4.40625 3.25 4.75 3.59375 4.75 4C4.75 4.4375 4.40625 4.75 4 4.75C3.5625 4.75 3.25 4.4375 3.25 4C3.25 3.59375 3.5625 3.25 4 3.25ZM10.75 4C10.75 4.4375 10.4062 4.75 10 4.75C9.5625 4.75 9.25 4.4375 9.25 4C9.25 3.59375 9.5625 3.25 10 3.25C10.4062 3.25 10.75 3.59375 10.75 4ZM7 6.25C7.40625 6.25 7.75 6.59375 7.75 7C7.75 7.4375 7.40625 7.75 7 7.75C6.5625 7.75 6.25 7.4375 6.25 7C6.25 6.59375 6.5625 6.25 7 6.25ZM9.25 10C9.25 9.59375 9.5625 9.25 10 9.25C10.4062 9.25 10.75 9.59375 10.75 10C10.75 10.4375 10.4062 10.75 10 10.75C9.5625 10.75 9.25 10.4375 9.25 10ZM4 9.25C4.40625 9.25 4.75 9.59375 4.75 10C4.75 10.4375 4.40625 10.75 4 10.75C3.5625 10.75 3.25 10.4375 3.25 10C3.25 9.59375 3.5625 9.25 4 9.25Z"})}));case"double-arrow":return n.jsx("svg",D(k({width:24*c,height:24*c,viewBox:"0 0 24 24"},f),{children:n.jsx("path",{fill:p,d:"M 5.4980469 3.0371094 L 4.0957031 4.4628906 L 11.744141 11.998047 L 4.0507812 19.535156 L 5.4492188 20.964844 L 14.597656 12.001953 L 5.4980469 3.0371094 z M 11.333984 3.0449219 L 9.9160156 4.4550781 L 17.423828 12.005859 L 10.035156 19.550781 L 11.464844 20.949219 L 20.234375 11.994141 L 11.333984 3.0449219 z"})}));case"drum":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 50 50"},f),{children:n.jsx("path",{fill:p,d:"M 2.8125 3 C 2.359375 3.082031 2.023438 3.460938 1.992188 3.917969 C 1.960938 4.378906 2.25 4.796875 2.6875 4.9375 L 8 6.71875 L 8 14 L 10 14 L 10 7.375 L 14.6875 8.9375 C 15.039063 9.117188 15.460938 9.074219 15.769531 8.828125 C 16.078125 8.582031 16.210938 8.179688 16.113281 7.796875 C 16.015625 7.417969 15.703125 7.128906 15.3125 7.0625 L 10.96875 5.59375 C 10.78125 4.683594 9.960938 4 9 4 C 8.492188 4 8.042969 4.214844 7.6875 4.53125 L 3.3125 3.0625 C 3.152344 3 2.980469 2.976563 2.8125 3 Z M 42 4 C 40.898438 4 40 4.898438 40 6 L 44 6 C 44 4.898438 43.101563 4 42 4 Z M 35.71875 7 C 35.167969 7.078125 34.78125 7.589844 34.859375 8.140625 C 34.9375 8.691406 35.449219 9.078125 36 9 L 48 9 C 48.359375 9.003906 48.695313 8.816406 48.878906 8.503906 C 49.058594 8.191406 49.058594 7.808594 48.878906 7.496094 C 48.695313 7.183594 48.359375 6.996094 48 7 L 36 7 C 35.96875 7 35.9375 7 35.90625 7 C 35.875 7 35.84375 7 35.8125 7 C 35.78125 7 35.75 7 35.71875 7 Z M 35.71875 10 C 35.167969 10.078125 34.78125 10.589844 34.859375 11.140625 C 34.9375 11.691406 35.449219 12.078125 36 12 L 41 12 L 41 14 L 43 14 L 43 12 L 48 12 C 48.359375 12.003906 48.695313 11.816406 48.878906 11.503906 C 49.058594 11.191406 49.058594 10.808594 48.878906 10.496094 C 48.695313 10.183594 48.359375 9.996094 48 10 L 36 10 C 35.96875 10 35.9375 10 35.90625 10 C 35.875 10 35.84375 10 35.8125 10 C 35.78125 10 35.75 10 35.71875 10 Z M 2 15 C 1.398438 15 1 15.398438 1 16 L 1 26 C 1 26.601563 1.398438 27 2 27 L 8 27 L 8 46 C 8 46.601563 8.398438 47 9 47 C 9.601563 47 10 46.601563 10 46 L 10 27 L 11.3125 27 C 12.511719 24.199219 14.5 21.914063 17 20.3125 L 17 16 C 17 15.398438 16.601563 15 16 15 Z M 34 15 C 33.398438 15 33 15.398438 33 16 L 33 20.3125 C 35.5 21.914063 37.488281 24.199219 38.6875 27 L 40 27 L 40 46 C 39.996094 46.359375 40.183594 46.695313 40.496094 46.878906 C 40.808594 47.058594 41.191406 47.058594 41.503906 46.878906 C 41.816406 46.695313 42.003906 46.359375 42 46 L 42 27 L 48 27 C 48.601563 27 49 26.601563 49 26 L 49 16 C 49 15.398438 48.601563 15 48 15 Z M 5 17 L 7 17 L 7 23 L 5 23 Z M 11 17 L 13 17 L 13 23 L 11 23 Z M 37 17 L 39 17 L 39 23 L 37 23 Z M 43 17 L 45 17 L 45 23 L 43 23 Z M 25 20 C 17.800781 20 12 25.800781 12 33 C 12 40.199219 17.800781 46 25 46 C 32.199219 46 38 40.199219 38 33 C 38 25.800781 32.199219 20 25 20 Z M 30 35 C 31.101563 35 32 35.898438 32 37 C 32 38.101563 31.101563 39 30 39 C 28.898438 39 28 38.101563 28 37 C 28 35.898438 28.898438 35 30 35 Z M 14.6875 43.90625 L 13.3125 45.3125 C 12.914063 45.710938 12.914063 46.289063 13.3125 46.6875 C 13.511719 46.886719 13.800781 47 14 47 C 14.199219 47 14.488281 46.886719 14.6875 46.6875 L 16.1875 45.1875 C 15.6875 44.789063 15.1875 44.304688 14.6875 43.90625 Z M 35.3125 43.90625 C 34.8125 44.40625 34.3125 44.789063 33.8125 45.1875 L 35.3125 46.6875 C 35.511719 46.886719 35.800781 47 36 47 C 36.199219 47 36.488281 46.886719 36.6875 46.6875 C 37.085938 46.289063 37.085938 45.710938 36.6875 45.3125 Z"})}));case"edit":return n.jsx("svg",D(k({width:13*c,height:13*c,viewBox:"0 0 13 13",fill:"none"},f),{children:n.jsx("path",{fill:"white",d:"M10.6406 2.07812C10.3594 1.77344 9.86719 1.77344 9.58594 2.07812L8.95312 2.6875L10.3125 4.04688L10.9219 3.41406C11.2266 3.13281 11.2266 2.64062 10.9219 2.35938L10.6406 2.07812ZM4.42969 7.23438C4.3125 7.32812 4.24219 7.46875 4.21875 7.58594L3.86719 9.13281L5.41406 8.78125C5.53125 8.75781 5.67188 8.6875 5.76562 8.57031L9.77344 4.5625L8.4375 3.22656L4.42969 7.23438ZM9.04688 1.53906C9.63281 0.953125 10.5938 0.953125 11.1797 1.53906L11.4609 1.82031C12.0469 2.40625 12.0469 3.36719 11.4609 3.95312L6.30469 9.10938C6.09375 9.32031 5.83594 9.46094 5.57812 9.50781L3.44531 10C3.32812 10.0234 3.1875 10 3.09375 9.90625C3 9.8125 2.97656 9.67188 3 9.55469L3.49219 7.42188C3.5625 7.16406 3.67969 6.90625 3.89062 6.69531L9.04688 1.53906ZM1.875 2.5H4.875C5.0625 2.5 5.25 2.6875 5.25 2.875C5.25 3.08594 5.0625 3.25 4.875 3.25H1.875C1.24219 3.25 0.75 3.76562 0.75 4.375V11.125C0.75 11.7578 1.24219 12.25 1.875 12.25H8.625C9.23438 12.25 9.75 11.7578 9.75 11.125V8.125C9.75 7.9375 9.91406 7.75 10.125 7.75C10.3125 7.75 10.5 7.9375 10.5 8.125V11.125C10.5 12.1797 9.65625 13 8.625 13H1.875C0.820312 13 0 12.1797 0 11.125V4.375C0 3.34375 0.820312 2.5 1.875 2.5Z"})}));case"email":return n.jsx("svg",D(k({width:18*c,height:18*c,viewBox:"0 0 21 20",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M6 7.125C5.78906 7.125 5.625 7.3125 5.625 7.5V8.03906L9.65625 11.3438C10.1484 11.7422 10.8281 11.7422 11.3203 11.3438L15.375 8.03906V7.5C15.375 7.3125 15.1875 7.125 15 7.125H6ZM5.625 9.49219V13.5C5.625 13.7109 5.78906 13.875 6 13.875H15C15.1875 13.875 15.375 13.7109 15.375 13.5V9.49219L12.0469 12.2109C11.1328 12.9609 9.84375 12.9609 8.95312 12.2109L5.625 9.49219ZM4.5 7.5C4.5 6.67969 5.15625 6 6 6H15C15.8203 6 16.5 6.67969 16.5 7.5V13.5C16.5 14.3438 15.8203 15 15 15H6C5.15625 15 4.5 14.3438 4.5 13.5V7.5Z"})}));case"env-follower":return n.jsxs("svg",{width:27*c,height:20*c,viewBox:"0 0 27 20",fill:"none",children:[n.jsx("path",{d:"M4.33398 13H5.83398L7.33398 7L8.83398 18L10.334 8L11.834 17L13.334 10L14.834 16L16.334 11L17.834 15L19.334 12L20.834 14L22.334 13H23.834",stroke:"#6D64A6",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M1.33398 11H3.87057C3.87057 11 5.13886 2.37267 6.40716 3.03643C10.212 5.69146 21.6267 10.9999 24.1633 10.9999C25.4315 10.9997 25.834 10.9999 25.834 10.9999",stroke:"url(#paint0_linear_5396_81842)",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:"paint0_linear_5396_81842",x1:"-7.08789",y1:"-4.42858",x2:"45.7952",y2:"11.3797",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"#F48272"}),n.jsx("stop",{offset:"1",stopColor:"#B398FF"})]})})]});case"eye":return n.jsx("svg",D(k({width:18*c,height:18*c,viewBox:"0 0 21 20",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M10.5 6.375C8.95312 6.375 7.71094 7.07812 6.75 7.96875C5.83594 8.8125 5.22656 9.79688 4.89844 10.5C5.22656 11.2031 5.83594 12.2109 6.75 13.0547C7.71094 13.9453 8.95312 14.625 10.5 14.625C12.0234 14.625 13.2656 13.9453 14.2266 13.0547C15.1406 12.2109 15.7734 11.2031 16.0781 10.5C15.7734 9.79688 15.1406 8.8125 14.25 7.96875C13.2656 7.07812 12.0234 6.375 10.5 6.375ZM5.97656 7.14844C7.07812 6.11719 8.60156 5.25 10.5 5.25C12.375 5.25 13.8984 6.11719 15 7.14844C16.1016 8.17969 16.8281 9.375 17.1797 10.2188C17.25 10.4062 17.25 10.6172 17.1797 10.8047C16.8281 11.625 16.1016 12.8438 15 13.875C13.8984 14.9062 12.375 15.75 10.5 15.75C8.60156 15.75 7.07812 14.9062 5.97656 13.875C4.875 12.8438 4.14844 11.625 3.79688 10.8047C3.72656 10.6172 3.72656 10.4062 3.79688 10.2188C4.14844 9.375 4.875 8.15625 5.97656 7.14844ZM10.5 12.375C11.5312 12.375 12.375 11.5547 12.375 10.5C12.375 9.46875 11.5312 8.625 10.5 8.625C10.4766 8.625 10.4531 8.625 10.4531 8.625C10.4766 8.76562 10.5 8.88281 10.5 9C10.5 9.84375 9.82031 10.5 9 10.5C8.85938 10.5 8.74219 10.5 8.625 10.4531C8.625 10.4766 8.625 10.5 8.625 10.5C8.625 11.5547 9.44531 12.375 10.5 12.375ZM10.5 7.5C11.5547 7.5 12.5391 8.08594 13.0781 9C13.6172 9.9375 13.6172 11.0859 13.0781 12C12.5391 12.9375 11.5547 13.5 10.5 13.5C9.42188 13.5 8.4375 12.9375 7.89844 12C7.35938 11.0859 7.35938 9.9375 7.89844 9C8.4375 8.08594 9.42188 7.5 10.5 7.5Z"})}));case"filter-band":return n.jsx("svg",D(k({width:c*16,height:c*14,viewBox:"0 0 16 14",fill:"none"},f),{children:n.jsx("path",{stroke:p,d:"M0.75 13.2109L2.67202 11.6681C4.02091 10.5853 4.98252 9.09444 5.41271 7.41906L6.75 2.21094V2.21094C7.17577 1.04538 8.82423 1.04538 9.25 2.21094V2.21094L11.1024 7.98233C11.5268 9.30464 12.2881 10.4937 13.3115 11.4325L15.25 13.2109",strokeLinecap:"round"})}));case"filter-high":return n.jsx("svg",D(k({width:c*18,height:c*12,viewBox:"0 0 18 12",fill:"none"},f),{children:n.jsx("path",{d:"M1 11L5.37646 4.52169C6.86408 2.31963 9.34808 1 12.0055 1H17",stroke:p,strokeLinecap:"round"})}));case"filter-low":return n.jsx("svg",D(k({width:18*c,height:16*c,viewBox:"0 0 18 16",fill:"none"},f),{children:n.jsx("path",{d:"M17 13L12.6235 6.52169C11.1359 4.31963 8.65192 3 5.99446 3H1",stroke:p,strokeLinecap:"round"})}));case"folder":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 20 20",fill:"none"},f),{children:n.jsx("path",{fill:"white",d:"M4 4C3.4375 4 3 4.46875 3 5V15C3 15.5625 3.4375 16 4 16H16C16.5312 16 17 15.5625 17 15V7C17 6.46875 16.5312 6 16 6H11.0938C10.5625 6 10.0625 5.8125 9.6875 5.4375L8.5625 4.3125C8.375 4.125 8.125 4 7.875 4H4ZM2 5C2 3.90625 2.875 3 4 3H7.875C8.40625 3 8.90625 3.21875 9.28125 3.59375L10.4062 4.71875C10.5938 4.90625 10.8438 5 11.0938 5H16C17.0938 5 18 5.90625 18 7V15C18 16.125 17.0938 17 16 17H4C2.875 17 2 16.125 2 15V5Z"})}));case"freeze":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 50 50"},f),{children:n.jsx("path",{fill:p,d:"M 24.984375 1.9863281 A 1.0001 1.0001 0 0 0 24 3 L 24 9.8320312 L 19.916016 5.9433594 A 1.0001 1.0001 0 0 0 19.197266 5.6425781 A 1.0001 1.0001 0 0 0 18.537109 7.390625 L 24 12.595703 L 24 13.570312 L 20.273438 17.121094 L 15.138672 18.433594 L 14.183594 17.908203 L 12.183594 10.798828 A 1.0001 1.0001 0 0 0 11.228516 10.054688 A 1.0001 1.0001 0 0 0 10.257812 11.339844 L 11.724609 16.556641 L 5.4824219 13.123047 A 1.0001 1.0001 0 0 0 5.0058594 12.994141 A 1.0001 1.0001 0 0 0 4.5195312 14.876953 L 10.632812 18.240234 L 5.1992188 19.626953 A 1.0001 1.0001 0 1 0 5.6933594 21.564453 L 13.199219 19.650391 L 14.152344 20.175781 L 15.509766 25 L 14.152344 29.824219 L 13.197266 30.349609 L 5.6953125 28.433594 A 1.0001 1.0001 0 0 0 5.3964844 28.400391 A 1.0001 1.0001 0 0 0 5.1992188 30.371094 L 10.632812 31.759766 L 4.5195312 35.123047 A 1.000418 1.000418 0 0 0 5.4824219 36.876953 L 11.724609 33.443359 L 10.257812 38.660156 A 1.0001668 1.0001668 0 0 0 12.183594 39.201172 L 14.183594 32.091797 L 15.138672 31.566406 L 20.273438 32.878906 L 24 36.429688 L 24 37.404297 L 18.537109 42.609375 A 1.0001 1.0001 0 1 0 19.916016 44.056641 L 24 40.167969 L 24 47 A 1.0001 1.0001 0 1 0 26 47 L 26 40.167969 L 30.083984 44.056641 A 1.0001 1.0001 0 1 0 31.462891 42.609375 L 26 37.404297 L 26 36.429688 L 29.726562 32.878906 L 34.863281 31.566406 L 35.818359 32.09375 L 37.816406 39.201172 A 1.0001668 1.0001668 0 0 0 39.742188 38.660156 L 38.275391 33.443359 L 44.517578 36.876953 A 1.0008884 1.0008884 0 1 0 45.482422 35.123047 L 39.367188 31.759766 L 44.800781 30.371094 A 1.0001 1.0001 0 0 0 44.574219 28.400391 A 1.0001 1.0001 0 0 0 44.306641 28.433594 L 36.802734 30.349609 L 35.849609 29.824219 L 34.492188 25 L 35.849609 20.175781 L 36.804688 19.650391 L 44.306641 21.564453 A 1.0001 1.0001 0 1 0 44.800781 19.626953 L 39.367188 18.240234 L 45.482422 14.876953 A 1.0001 1.0001 0 0 0 44.964844 12.994141 A 1.0001 1.0001 0 0 0 44.517578 13.123047 L 38.275391 16.556641 L 39.742188 11.339844 A 1.0001 1.0001 0 0 0 38.742188 10.056641 A 1.0001 1.0001 0 0 0 37.816406 10.798828 L 35.818359 17.908203 L 34.863281 18.433594 L 29.726562 17.121094 L 26 13.570312 L 26 12.595703 L 31.462891 7.390625 A 1.0001 1.0001 0 0 0 30.777344 5.65625 A 1.0001 1.0001 0 0 0 30.083984 5.9433594 L 26 9.8320312 L 26 3 A 1.0001 1.0001 0 0 0 24.984375 1.9863281 z M 24 16.333984 L 24 23.306641 L 17.699219 19.841797 L 21.021484 18.994141 A 1.0001 1.0001 0 0 0 21.462891 18.75 L 24 16.333984 z M 26 16.333984 L 28.537109 18.75 A 1.0001 1.0001 0 0 0 28.980469 18.994141 L 32.300781 19.841797 L 26 23.306641 L 26 16.333984 z M 16.609375 21.527344 L 22.923828 25 L 16.609375 28.472656 L 17.509766 25.271484 A 1.0001 1.0001 0 0 0 17.509766 24.728516 L 16.609375 21.527344 z M 33.390625 21.527344 L 32.490234 24.728516 A 1.0001 1.0001 0 0 0 32.490234 25.271484 L 33.390625 28.472656 L 27.076172 25 L 33.390625 21.527344 z M 24 26.693359 L 24 33.666016 L 21.462891 31.25 A 1.0001 1.0001 0 0 0 21.021484 31.005859 L 17.699219 30.158203 L 24 26.693359 z M 26 26.693359 L 32.300781 30.158203 L 28.978516 31.005859 A 1.0001 1.0001 0 0 0 28.537109 31.25 L 26 33.666016 L 26 26.693359 z"})}));case"gear":return n.jsx("svg",D(k({width:16*c,height:16*c,viewBox:"0 0 16 16",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M15.4688 5.21875C15.5938 5.5 15.5 5.78125 15.2812 6L13.9375 7.21875C13.9688 7.46875 13.9688 7.75 13.9688 8C13.9688 8.28125 13.9688 8.5625 13.9375 8.8125L15.2812 10.0312C15.5 10.2188 15.5938 10.5312 15.4688 10.8125C15.3438 11.1875 15.1875 11.5312 15 11.875L14.8438 12.125C14.625 12.4688 14.4062 12.8125 14.1562 13.0938C13.9688 13.3438 13.6562 13.4062 13.375 13.3125L11.6562 12.7812C11.2188 13.0938 10.75 13.3438 10.2812 13.5625L9.875 15.3438C9.8125 15.625 9.59375 15.8438 9.3125 15.9062C8.875 15.9688 8.4375 16 7.96875 16C7.53125 16 7.09375 15.9688 6.65625 15.9062C6.375 15.8438 6.15625 15.625 6.09375 15.3438L5.6875 13.5625C5.1875 13.3438 4.75 13.0938 4.3125 12.7812L2.59375 13.3125C2.3125 13.4062 2 13.3438 1.8125 13.125C1.5625 12.8125 1.34375 12.4688 1.125 12.125L0.96875 11.875C0.78125 11.5312 0.625 11.1875 0.5 10.8125C0.375 10.5312 0.46875 10.25 0.6875 10.0312L2.03125 8.8125C2 8.5625 2 8.28125 2 8C2 7.75 2 7.46875 2.03125 7.21875L0.6875 6C0.46875 5.78125 0.375 5.5 0.5 5.21875C0.625 4.84375 0.78125 4.5 0.96875 4.15625L1.125 3.90625C1.34375 3.5625 1.5625 3.21875 1.8125 2.90625C2 2.6875 2.3125 2.625 2.59375 2.71875L4.3125 3.25C4.75 2.9375 5.21875 2.65625 5.6875 2.46875L6.09375 0.6875C6.15625 0.40625 6.375 0.1875 6.65625 0.125C7.09375 0.0625 7.53125 0 8 0C8.4375 0 8.875 0.0625 9.3125 0.125C9.59375 0.15625 9.8125 0.40625 9.875 0.6875L10.2812 2.46875C10.7812 2.65625 11.2188 2.9375 11.6562 3.25L13.375 2.71875C13.6562 2.625 13.9688 2.6875 14.1562 2.90625C14.4062 3.21875 14.625 3.5625 14.8438 3.90625L15 4.15625C15.1875 4.5 15.3438 4.84375 15.5 5.21875H15.4688ZM8 10.5C8.875 10.5 9.6875 10.0312 10.1562 9.25C10.5938 8.5 10.5938 7.53125 10.1562 6.75C9.6875 6 8.875 5.5 8 5.5C7.09375 5.5 6.28125 6 5.8125 6.75C5.375 7.53125 5.375 8.5 5.8125 9.25C6.28125 10.0312 7.09375 10.5 8 10.5Z"})}));case"heart":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 20 20",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M 9.625,5.9152347 9.25,5.5089847 9.09375,5.3527347 c -0.8125,-0.90625 -2.03125,-1.34375 -3.21875,-1.125 -1.6875,0.3125 -2.875,1.75 -2.875,3.4375 v 0.125 c 0,1 0.40625,1.96875 1.15625,2.6562503 l 5.75,5.3438 c 0,0.0312 0.03125,0.0312 0.09375,0.0312 0.0312,0 0.0625,0 0.0938,-0.0312 l 5.75,-5.3438 C 16.5625,9.7589847 17,8.7902347 17,7.7902347 v -0.125 c 0,-1.6875 -1.2188,-3.125 -2.875,-3.4375 -1.2188,-0.21875 -2.4375,0.21875 -3.25,1.125 l -0.125,0.15625 -0.375,0.40625 c -0.0938,0.09375 -0.25,0.15625 -0.375,0.15625 -0.15625,0 -0.28125,-0.0625 -0.375,-0.15625 z m 1.0625,-1.78125 c 1.0313,-0.78125 2.3125,-1.125 3.5937,-0.875 2.1563,0.375 3.7188,2.25 3.7188,4.40625 v 0.125 c 0,1.125 -0.4375,2.18745 -1.1562,3.0312503 -0.0938,0.125 -0.2188,0.25 -0.3438,0.3438 l -5.75,5.375 c -0.0312,0 -0.0312,0.0312 -0.0625,0.0624 -0.2187,0.1563 -0.4375,0.2188 -0.6875,0.2188 -0.3125,0 -0.5625,-0.0938 -0.78125,-0.2812 l -5.75,-5.375 c -0.125,-0.0938 -0.25,-0.2188 -0.34375,-0.3438 C 2.40625,9.9776847 2,8.9152347 2,7.7902347 v -0.125 c 0,-2.15625 1.53125,-4.03125 3.6875,-4.40625 1.28125,-0.25 2.5625,0.09375 3.59375,0.875 0.1875,0.15625 0.40625,0.34375 0.5625,0.5625 l 0.125,0.125 0.15625,-0.125 c 0.125,-0.15625 0.25,-0.3125 0.4062,-0.4375 0.0626,-0.03125 0.125,-0.09375 0.1563,-0.125 z"})}));case"heart-filled":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 20 20",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M3.46875 11.4062C2.53125 10.5312 2 9.28125 2 7.96875V7.8125C2 5.625 3.5625 3.75 5.71875 3.40625C7.15625 3.15625 8.59375 3.625 9.625 4.625L10 5L10.375 4.625C11.375 3.625 12.8438 3.15625 14.25 3.40625C16.4062 3.75 18 5.625 18 7.8125V7.96875C18 9.28125 17.4375 10.5312 16.5 11.4062L10.8438 16.6875C10.625 16.9062 10.3125 17 10 17C9.65625 17 9.34375 16.9062 9.125 16.6875L3.46875 11.4062Z"})}));case"joker":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 30 30"},f),{children:n.jsx("path",{fill:p,d:"M 2 2 A 2 2 0 0 0 0 4 A 2 2 0 0 0 2 6 A 2 2 0 0 0 3.5332031 5.2832031 C 5.6617278 6.095591 7 8.5464153 7 11 C 7 15 5 15 5 22 L 17 22 L 26 22 C 26 15 23 13.098 23 11 C 23 9.3025116 24.323217 7.752099 26.412109 7.2148438 A 2 2 0 0 0 28 8 A 2 2 0 0 0 30 6 A 2 2 0 0 0 28 4 A 2 2 0 0 0 26.228516 5.0742188 C 20.733442 5.513488 17.395513 8.013948 15.914062 11.423828 C 13.991883 7.3361887 9.6317557 3.7210847 3.7851562 3.0996094 A 2 2 0 0 0 2 2 z M 7.5097656 6.0878906 C 12.100766 8.0098906 15 12.166 15 16 L 15 20 L 7.0664062 20 C 7.2274062 17.777 7.658125 16.637344 8.078125 15.527344 C 8.531125 14.327344 9 13.087 9 11 C 9 9.293 8.4737656 7.5258906 7.5097656 6.0878906 z M 5 24 A 1.0001 1.0001 0 1 0 5 26 L 26 26 A 1.0001 1.0001 0 1 0 26 24 L 5 24 z"})}));case"key":return n.jsx("svg",D(k({width:18*c,height:18*c,viewBox:"0 0 21 20",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M9.375 8.625C9.375 8.88281 9.39844 9.11719 9.44531 9.35156C9.49219 9.53906 9.44531 9.72656 9.30469 9.86719L5.625 13.5469V15.375H7.125V14.4375C7.125 14.1328 7.35938 13.875 7.6875 13.875H8.625V12.9375C8.625 12.6328 8.85938 12.375 9.1875 12.375H10.4531L11.1328 11.6953C11.2734 11.5547 11.4609 11.5078 11.6484 11.5547C11.8828 11.6016 12.1172 11.625 12.375 11.625C14.0156 11.625 15.375 10.2891 15.375 8.625C15.375 6.98438 14.0156 5.625 12.375 5.625C10.7109 5.625 9.375 6.98438 9.375 8.625ZM12.375 4.5C14.6484 4.5 16.5 6.35156 16.5 8.625C16.5 10.9219 14.6484 12.75 12.375 12.75C12.1406 12.75 11.9297 12.75 11.7188 12.7031L11.0859 13.3359C10.9688 13.4531 10.8281 13.5 10.6875 13.5H9.75V14.4375C9.75 14.7656 9.49219 15 9.1875 15H8.25V15.9375C8.25 16.2656 7.99219 16.5 7.6875 16.5H5.0625C4.73438 16.5 4.5 16.2656 4.5 15.9375V13.3125C4.5 13.1719 4.54688 13.0312 4.66406 12.9141L8.29688 9.28125C8.25 9.07031 8.25 8.85938 8.25 8.625C8.25 6.35156 10.0781 4.5 12.375 4.5ZM13.125 8.625C12.7031 8.625 12.375 8.29688 12.375 7.875C12.375 7.47656 12.7031 7.125 13.125 7.125C13.5234 7.125 13.875 7.47656 13.875 7.875C13.875 8.29688 13.5234 8.625 13.125 8.625Z"})}));case"lab":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 24 24"},f),{children:n.jsx("path",{fill:p,d:"M 8 3 L 8 5 L 9 5 L 9 10 L 3.4316406 17.773438 C 3.1656406 18.112437 3 18.535 3 19 C 3 20.105 3.895 21 5 21 L 19 21 C 20.105 21 21 20.105 21 19 C 21 18.535 20.834359 18.112437 20.568359 17.773438 L 15 10 L 15 5 L 16 5 L 16 3 L 8 3 z M 11 5 L 13 5 L 13 9 L 11 9 L 11 5 z M 10.744141 11 L 13.255859 11 L 18.943359 18.9375 L 18.972656 18.966797 L 19 19 L 5.0058594 19.007812 L 5.03125 18.972656 L 5.0566406 18.9375 L 10.744141 11 z M 13 13 A 1 1 0 0 0 12 14 A 1 1 0 0 0 13 15 A 1 1 0 0 0 14 14 A 1 1 0 0 0 13 13 z M 10.5 15 A 1.5 1.5 0 0 0 9 16.5 A 1.5 1.5 0 0 0 10.5 18 A 1.5 1.5 0 0 0 12 16.5 A 1.5 1.5 0 0 0 10.5 15 z"})}));case"line-ascending":return n.jsx("svg",D(k({width:22*c,height:22*c,viewBox:"0 0 24 24"},f),{children:n.jsx("path",{fill:p,d:"M 20.980469 1.9902344 A 1.0001 1.0001 0 0 0 20.292969 2.2929688 L 2.2929688 20.292969 A 1.0001 1.0001 0 1 0 3.7070312 21.707031 L 21.707031 3.7070312 A 1.0001 1.0001 0 0 0 20.980469 1.9902344 z"})}));case"line-descending":return n.jsx("svg",D(k({viewBox:"0 0 24 24",width:22*c,height:22*c},f),{children:n.jsx("path",{fill:p,transform:"rotate(90 12 12)",d:"M 20.980469 1.9902344 A 1.0001 1.0001 0 0 0 20.292969 2.2929688 L 2.2929688 20.292969 A 1.0001 1.0001 0 1 0 3.7070312 21.707031 L 21.707031 3.7070312 A 1.0001 1.0001 0 0 0 20.980469 1.9902344 z"})}));case"line-flat":return n.jsx("svg",D(k({viewBox:"0 0 24 24",width:22*c,height:22*c},f),{children:n.jsx("path",{fill:p,transform:"rotate(45 12 12)",d:"M 20.980469 1.9902344 A 1.0001 1.0001 0 0 0 20.292969 2.2929688 L 2.2929688 20.292969 A 1.0001 1.0001 0 1 0 3.7070312 21.707031 L 21.707031 3.7070312 A 1.0001 1.0001 0 0 0 20.980469 1.9902344 z"})}));case"link":return n.jsxs("svg",{width:32*c,height:16*c,viewBox:"0 0 32 16",fill:"none",children:[n.jsx("path",{d:"M1 8L5 8",stroke:p,strokeLinecap:"round"}),n.jsx("path",{fill:p,d:"M8.6875 8C8.6875 5.76562 10.4902 3.9375 12.75 3.9375H14.7812C14.9844 3.9375 15.1875 4.14062 15.1875 4.34375C15.1875 4.57227 14.9844 4.75 14.7812 4.75H12.75C10.9473 4.75 9.5 6.22266 9.5 8C9.5 9.80273 10.9473 11.25 12.75 11.25H14.7812C14.9844 11.25 15.1875 11.4531 15.1875 11.6562C15.1875 11.8848 14.9844 12.0625 14.7812 12.0625H12.75C10.4902 12.0625 8.6875 10.2598 8.6875 8ZM23.3125 8C23.3125 10.2598 21.4844 12.0625 19.25 12.0625H17.2188C16.9902 12.0625 16.8125 11.8848 16.8125 11.6562C16.8125 11.4531 16.9902 11.25 17.2188 11.25H19.25C21.0273 11.25 22.5 9.80273 22.5 8C22.5 6.22266 21.0273 4.75 19.25 4.75H17.2188C16.9902 4.75 16.8125 4.57227 16.8125 4.34375C16.8125 4.14062 16.9902 3.9375 17.2188 3.9375H19.25C21.4844 3.9375 23.3125 5.76562 23.3125 8ZM12.5469 7.59375H19.4531C19.6562 7.59375 19.8594 7.79688 19.8594 8C19.8594 8.22852 19.6562 8.40625 19.4531 8.40625H12.5469C12.3184 8.40625 12.1406 8.22852 12.1406 8C12.1406 7.79688 12.3184 7.59375 12.5469 7.59375Z"}),n.jsx("path",{d:"M27 8H31",stroke:p,strokeLinecap:"round"})]});case"lock":return n.jsx("svg",D(k({width:44*c,height:51*c},f),{viewBox:"0 0 448 512",children:n.jsx("path",{fill:p,d:"M144 144v48H304V144c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192V144C80 64.5 144.5 0 224 0s144 64.5 144 144v48h16c35.3 0 64 28.7 64 64V448c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V256c0-35.3 28.7-64 64-64H80z"})}));case"lock-open":return n.jsx("svg",D(k({width:57*c,height:51*c},f),{viewBox:"0 0 576 512",children:n.jsx("path",{fill:p,d:"M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80v48c0 17.7 14.3 32 32 32s32-14.3 32-32V144C576 64.5 511.5 0 432 0S288 64.5 288 144v48H64c-35.3 0-64 28.7-64 64V448c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V256c0-35.3-28.7-64-64-64H352V144z"})}));case"mix":return n.jsxs("svg",{width:16*c,height:16*c,viewBox:"0 0 16 16",fill:"none",children:[n.jsx("circle",{cx:"8",cy:"8",r:"7.5",stroke:"#D9D9D9"}),n.jsx("path",{d:"M7 1H9V6C9 6.55228 8.55228 7 8 7C7.44772 7 7 6.55228 7 6V1Z",fill:fe.lunaExtraLight})]});case"microphone":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 50 50"},f),{children:n.jsx("path",{fill:p,d:"M 25 0 C 18.921875 0 14 4.785156 14 10.71875 L 14 11 L 21.5 11 C 22.050781 11 22.5 11.449219 22.5 12 C 22.5 12.550781 22.050781 13 21.5 13 L 14 13 L 14 15 L 21.5 15 C 22.050781 15 22.5 15.449219 22.5 16 C 22.5 16.550781 22.050781 17 21.5 17 L 14 17 L 14 19 L 21.5 19 C 22.050781 19 22.5 19.449219 22.5 20 C 22.5 20.550781 22.050781 21 21.5 21 L 14 21 L 14 23.28125 C 14 29.214844 18.921875 34 25 34 C 31.078125 34 36 29.214844 36 23.28125 L 36 21 L 28.5 21 C 27.945313 21 27.5 20.550781 27.5 20 C 27.5 19.449219 27.945313 19 28.5 19 L 36 19 L 36 17 L 28.5 17 C 27.945313 17 27.5 16.550781 27.5 16 C 27.5 15.449219 27.945313 15 28.5 15 L 36 15 L 36 13 L 28.5 13 C 27.945313 13 27.5 12.550781 27.5 12 C 27.5 11.449219 27.945313 11 28.5 11 L 36 11 L 36 10.71875 C 36 4.785156 31.078125 0 25 0 Z M 9.8125 17.125 C 9.402344 17.210938 9.113281 17.582031 9.125 18 L 9.125 23 C 9.125 30.714844 14.6875 37.183594 22 38.59375 L 22 44 L 28 44 L 28 38.59375 C 35.3125 37.183594 40.875 30.714844 40.875 23 L 40.875 18 C 40.875 17.515625 40.484375 17.125 40 17.125 C 39.515625 17.125 39.125 17.515625 39.125 18 L 39.125 23 C 39.125 30.800781 32.800781 37.125 25 37.125 C 17.199219 37.125 10.875 30.800781 10.875 23 L 10.875 18 C 10.878906 17.75 10.773438 17.511719 10.589844 17.34375 C 10.402344 17.175781 10.15625 17.09375 9.90625 17.125 C 9.875 17.125 9.84375 17.125 9.8125 17.125 Z M 15.5 46 C 13.585938 46 12.03125 47.5625 12.03125 49.46875 L 12 50 L 37.875 49.9375 L 37.90625 49.46875 C 37.90625 47.5625 36.351563 46 34.4375 46 Z"})}));case"magic":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 30 30"},f),{children:n.jsx("path",{fill:p,d:"M 15 3 C 8.3845336 3 3 8.3845336 3 15 C 3 18.631347 4.6276959 21.885314 7.1855469 24.087891 L 6.25 25.337891 A 1 1 0 0 0 6 26 A 1 1 0 0 0 7 27 L 15 27 L 23 27 A 1 1 0 0 0 24 26 A 1 1 0 0 0 23.759766 25.351562 L 22.814453 24.087891 C 25.372304 21.885314 27 18.631347 27 15 C 27 8.3845336 21.615466 3 15 3 z M 26 4 A 1 1 0 0 0 25 5 A 1 1 0 0 0 26 6 A 1 1 0 0 0 27 5 A 1 1 0 0 0 26 4 z M 15 5 C 20.534534 5 25 9.4654664 25 15 C 25 18.281627 23.422098 21.178101 20.990234 23 L 15 23 L 9.0097656 23 C 6.5779017 21.178101 5 18.281627 5 15 C 5 9.4654664 9.4654664 5 15 5 z M 15 7 C 12.427537 7 10.126114 8.221421 8.6640625 10.115234 A 1.000487 1.000487 0 0 0 10.248047 11.337891 C 11.345995 9.915704 13.058463 9 15 9 A 1.0001 1.0001 0 1 0 15 7 z M 20 9.0019531 C 19.81525 9.0019531 19.631047 9.1088125 19.560547 9.3203125 L 19 11 L 17.320312 11.560547 C 16.897313 11.701547 16.897313 12.298453 17.320312 12.439453 L 19 13 L 19.560547 14.679688 C 19.701547 15.102688 20.298453 15.102687 20.439453 14.679688 L 21 13 L 22.679688 12.439453 C 23.102687 12.298453 23.102688 11.701547 22.679688 11.560547 L 21 11 L 20.439453 9.3203125 C 20.368953 9.1088125 20.18475 9.0019531 20 9.0019531 z M 8 14 A 1 1 0 0 0 7 15 A 1 1 0 0 0 8 16 A 1 1 0 0 0 9 15 A 1 1 0 0 0 8 14 z M 16.5 16 C 16.346 16 16.191813 16.087672 16.132812 16.263672 L 15.666016 17.666016 L 14.263672 18.132812 C 13.910672 18.250812 13.910672 18.749187 14.263672 18.867188 L 15.666016 19.333984 L 16.132812 20.736328 C 16.250812 21.089328 16.749187 21.089328 16.867188 20.736328 L 17.333984 19.333984 L 18.736328 18.867188 C 19.089328 18.749188 19.089328 18.250813 18.736328 18.132812 L 17.333984 17.666016 L 16.867188 16.263672 C 16.808188 16.087672 16.654 16 16.5 16 z"})}));case"move":return n.jsx("svg",D(k({width:14*c,height:15*c,viewBox:"0 0 14 15",fill:"none"},f),{children:n.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.5 3.5L7 0.5L9.5 3.5H7.5V7H10.5V5L13.5 7.5L10.5 10V8H7.5V11.5H9.5L7 14.5L4.5 11.5H6.5V8H3.5V10L0.5 7.5L3.5 5V7H6.5V3.5H4.5Z",fill:"white"})}));case"particles":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 24 24"},f),{children:n.jsx("path",{fill:p,d:"M 3 2 L 2 10 L 7 3 L 3 2 z M 15 2 L 13 5 L 10 4 L 11 7 L 11 9 L 14 8 L 17 9 L 15 6 L 15 2 z M 22 2 L 18 4 L 21 8 L 22 2 z M 8 8 L 6 13 L 2 14 L 5.0507812 16.445312 L 3 21 L 7.4707031 19 L 10 22 L 11 18 L 15 18 L 12.3125 15 L 14 12 L 10 12 L 8 8 z M 19.582031 13 L 17.527344 13.527344 L 17 15.5 L 18.5 17 L 20.472656 16.472656 L 21 14.417969 L 19.582031 13 z M 21 19 L 18 21 L 22 22 L 21 19 z"})}));case"pattern":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 24 24"},f),{children:n.jsx("path",{fill:p,d:"M 4.6640625 3 L 3.1679688 5.5 L 4.6640625 8 L 7.7207031 8 L 9.2167969 5.5 L 7.7207031 3 L 4.6640625 3 z M 17.236328 3 L 15.738281 5.5 L 17.236328 8 L 20.292969 8 L 21.787109 5.5 L 20.292969 3 L 17.236328 3 z M 10.951172 7 L 9.6035156 9.2519531 L 11.248047 12 L 13.707031 12 L 15.353516 9.25 L 14.007812 7 L 10.951172 7 z M 4.6640625 10 L 3.1679688 12.5 L 4.6640625 15 L 7.7207031 15 L 9.0683594 12.748047 L 7.4238281 10 L 4.6640625 10 z M 17.535156 10 L 15.888672 12.75 L 17.236328 15 L 20.292969 15 L 21.787109 12.5 L 20.292969 10 L 17.535156 10 z M 10.951172 14 L 9.6035156 16.251953 L 11.248047 19 L 13.707031 19 L 15.353516 16.25 L 14.007812 14 L 10.951172 14 z M 4.6640625 17 L 3.1679688 19.5 L 4.6640625 22 L 7.7207031 22 L 9.0683594 19.748047 L 7.4238281 17 L 4.6640625 17 z M 17.535156 17 L 15.888672 19.75 L 17.236328 22 L 20.292969 22 L 21.787109 19.5 L 20.292969 17 L 17.535156 17 z"})}));case"paste":return n.jsxs("svg",D(k({width:14*c,height:14*c,viewBox:"0 0 20 20"},f),{children:[n.jsx("path",{d:`
M5 7
H5
A2 2 0 0 0 3 9
V15
A2 2 0 0 0 5 17
H11
A2 2 0 0 0 13 15
V15
`,stroke:p,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",fill:"none"}),n.jsx("rect",{x:"7",y:"3",width:"10",height:"10",rx:"2",stroke:p,strokeWidth:"1.5",fill:"none"}),n.jsx("line",{x1:"12",y1:"6",x2:"12",y2:"10",stroke:p,strokeWidth:"1.5",strokeLinecap:"round"}),n.jsx("line",{x1:"10",y1:"8",x2:"14",y2:"8",stroke:p,strokeWidth:"1.5",strokeLinecap:"round"})]}));case"pitch":return n.jsx("svg",D(k({width:16*c,height:16*c,viewBox:"0 0 16 16",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M1 1.5V12.5C1 13.3438 1.65625 14 2.5 14H15.5C15.75 14 16 14.25 16 14.5C16 14.7812 15.75 15 15.5 15H2.5C1.09375 15 0 13.9062 0 12.5V1.5C0 1.25 0.21875 1 0.5 1C0.75 1 1 1.25 1 1.5ZM10 4.5C10 4.25 10.2188 4 10.5 4H14.5C14.75 4 15 4.25 15 4.5V8.5C15 8.78125 14.75 9 14.5 9C14.2188 9 14 8.78125 14 8.5V5.71875L10.3438 9.375C10.1562 9.5625 9.8125 9.5625 9.625 9.375L7 6.71875L3.84375 9.875C3.65625 10.0625 3.3125 10.0625 3.125 9.875C2.9375 9.6875 2.9375 9.34375 3.125 9.15625L6.625 5.65625C6.8125 5.46875 7.15625 5.46875 7.34375 5.65625L10 8.3125L13.2812 5H10.5C10.2188 5 10 4.78125 10 4.5Z"})}));case"plus":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 20 20",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M10.5 4V9.5H16C16.25 9.5 16.5 9.75 16.5 10C16.5 10.2812 16.25 10.5 16 10.5H10.5V16C10.5 16.2812 10.25 16.5 10 16.5C9.71875 16.5 9.5 16.2812 9.5 16V10.5H4C3.71875 10.5 3.5 10.2812 3.5 10C3.5 9.75 3.71875 9.5 4 9.5H9.5V4C9.5 3.75 9.71875 3.5 10 3.5C10.25 3.5 10.5 3.75 10.5 4Z"})}));case"repeat":return n.jsx("svg",D(k({width:512*c/25,height:512*c/25,viewBox:"0 0 512 512"},f),{children:n.jsx("path",{fill:p,d:"M105.1 202.6c7.7-21.8 20.2-42.3 37.8-59.8c62.5-62.5 163.8-62.5 226.3 0L386.3 160 352 160c-17.7 0-32 14.3-32 32s14.3 32 32 32l111.5 0c0 0 0 0 0 0l.4 0c17.7 0 32-14.3 32-32l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 35.2L414.4 97.6c-87.5-87.5-229.3-87.5-316.8 0C73.2 122 55.6 150.7 44.8 181.4c-5.9 16.7 2.9 34.9 19.5 40.8s34.9-2.9 40.8-19.5zM39 289.3c-5 1.5-9.8 4.2-13.7 8.2c-4 4-6.7 8.8-8.1 14c-.3 1.2-.6 2.5-.8 3.8c-.3 1.7-.4 3.4-.4 5.1L16 432c0 17.7 14.3 32 32 32s32-14.3 32-32l0-35.1 17.6 17.5c0 0 0 0 0 0c87.5 87.4 229.3 87.4 316.7 0c24.4-24.4 42.1-53.1 52.9-83.8c5.9-16.7-2.9-34.9-19.5-40.8s-34.9 2.9-40.8 19.5c-7.7 21.8-20.2 42.3-37.8 59.8c-62.5 62.5-163.8 62.5-226.3 0l-.1-.1L125.6 352l34.4 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L48.4 288c-1.6 0-3.2 .1-4.8 .3s-3.1 .5-4.6 1z"})}));case"reverse":return n.jsx("svg",D(k({width:24*c,height:24*c,viewBox:"0 0 24 24",fill:p},f),{children:n.jsx("path",{fill:p,d:"M7.8 16.5C7.52386 16.5 7.3 16.7239 7.3 17C7.3 17.2761 7.52386 17.5 7.8 17.5V16.5ZM5 9L10 11.8868V6.11325L5 9ZM7.8 17.5H15V16.5H7.8V17.5ZM15 8.5H13.4V9.5H15V8.5ZM13.4 8.5H9.5V9.5H13.4V8.5ZM19.5 13C19.5 10.5147 17.4853 8.5 15 8.5V9.5C16.933 9.5 18.5 11.067 18.5 13H19.5ZM15 17.5C17.4853 17.5 19.5 15.4853 19.5 13H18.5C18.5 14.933 16.933 16.5 15 16.5V17.5Z"})}));case"reverse-2":return n.jsx("svg",D(k({width:512*c/25,height:512*c/25,viewBox:"0 0 512 512"},f),{children:n.jsx("path",{fill:p,d:"M48.5 224L40 224c-13.3 0-24-10.7-24-24L16 72c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2L98.6 96.6c87.6-86.5 228.7-86.2 315.8 1c87.5 87.5 87.5 229.3 0 316.8s-229.3 87.5-316.8 0c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0c62.5 62.5 163.8 62.5 226.3 0s62.5-163.8 0-226.3c-62.2-62.2-162.7-62.5-225.3-1L185 183c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8L48.5 224z"})}));case"reset":return n.jsx("svg",D(k({width:16*c,height:15*c,viewBox:"0 0 16 16",fill:"none"},f),{children:n.jsx("path",{d:"M1.5 6C1.21875 6 1 5.78125 1 5.5V1.5C1 1.25 1.21875 1 1.5 1C1.75 1 2 1.25 2 1.5V4.40625C3.21875 2.375 5.4375 1 8 1C11.8438 1 15 4.15625 15 8C15 11.875 11.8438 15 8 15C5.5 15 3.3125 13.7188 2.0625 11.75C1.84375 11.4062 2.09375 11 2.5 11C2.6875 11 2.84375 11.125 2.9375 11.2812C4 12.9062 5.875 14 8 14C11.3125 14 14 11.3125 14 8C14 4.6875 11.3125 2 8 2C5.75 2 3.8125 3.21875 2.78125 5H5.5C5.75 5 6 5.25 6 5.5C6 5.78125 5.75 6 5.5 6H1.5Z",fill:"white"})}));case"rows":return n.jsxs("svg",D(k({width:20*c,height:20*c},f),{viewBox:"0 0 20 20",fill:"none",children:[n.jsx("line",{x1:"2",x2:"18",y1:"2",y2:"2",stroke:p,strokeWidth:3,strokeLinecap:"round"}),n.jsx("line",{x1:"2",x2:"18",y1:"10",y2:"10",stroke:p,strokeWidth:3,strokeLinecap:"round"}),n.jsx("line",{x1:"2",x2:"18",y1:"18",y2:"18",stroke:p,strokeWidth:3,strokeLinecap:"round"})]}));case"save":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 20 20",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M 3.6331775,4.6943146 V 15.305686 c 0,0.59689 0.4642475,1.061137 1.0611371,1.061137 H 15.305686 c 0.563675,0 1.061137,-0.464247 1.061137,-1.061137 V 7.1813548 c 0,-0.2984449 -0.132643,-0.5637292 -0.331605,-0.7626924 L 13.581338,3.9647828 C 13.448695,3.8321408 13.316054,3.7658195 13.183412,3.6994985 v 3.1170904 c 0,0.5968896 -0.497461,1.0611371 -1.061137,1.0611371 H 5.7554517 c -0.5968897,0 -1.0611371,-0.4642476 -1.0611371,-1.0611372 V 3.6331775 c -0.5968896,0 -1.0611371,0.4974079 -1.0611371,1.0611371 z M 5.7554517,3.6331775 V 6.8165889 H 12.122275 V 3.6331775 Z M 2.5720403,4.6943146 c 0,-1.1606188 0.928495,-2.1222743 2.1222743,-2.1222743 h 8.1242784 c 0.563781,0 1.094351,0.2321237 1.492276,0.6300501 l 2.486988,2.4870403 c 0.397926,0.3979264 0.630103,0.9284949 0.630103,1.4922241 v 8.1243312 c 0,1.193779 -0.961602,2.122274 -2.122274,2.122274 H 4.6943146 c -1.1937793,0 -2.1222743,-0.928495 -2.1222743,-2.122274 z m 9.0196647,7.4279604 c 0,-0.56373 -0.331604,-1.061137 -0.795852,-1.359583 -0.497408,-0.298444 -1.1274583,-0.298444 -1.5917056,0 -0.497408,0.298446 -0.7958529,0.795853 -0.7958529,1.359583 0,0.596889 0.2984449,1.094244 0.7958529,1.392741 0.4642473,0.298499 1.0942976,0.298499 1.5917056,0 0.464248,-0.298497 0.795852,-0.795852 0.795852,-1.392741 z M 9.9999998,9.4694319 c 0.9284952,0 1.7906692,0.5305679 2.2880242,1.3264211 0.464353,0.829013 0.464353,1.85699 0,2.652842 -0.497355,0.828961 -1.359529,1.326423 -2.2880242,1.326423 -0.9616551,0 -1.823829,-0.497462 -2.321237,-1.326423 -0.4642475,-0.795852 -0.4642475,-1.823829 0,-2.652842 0.497408,-0.7958532 1.3595819,-1.3264211 2.321237,-1.3264211 z"})}));case"space":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 24 24"},f),{children:n.jsx("path",{fill:p,d:"M 17.447266 3.9941406 C 17.177641 4.0412656 16.926078 4.1982188 16.767578 4.4492188 C 16.498578 4.8752188 16.588422 5.436 16.982422 5.75 C 18.819422 7.216 20 9.468 20 12 C 20 14.532 18.819422 16.783047 16.982422 18.248047 C 16.588422 18.562047 16.498578 19.124781 16.767578 19.550781 C 17.084578 20.052781 17.772328 20.175687 18.236328 19.804688 C 20.528328 17.974688 22 15.161 22 12 C 22 8.839 20.528328 6.0263125 18.236328 4.1953125 C 18.004328 4.0098125 17.716891 3.9470156 17.447266 3.9941406 z M 6.5527344 3.9960938 C 6.2833594 3.9488437 5.9956719 4.0103125 5.7636719 4.1953125 C 3.4716719 6.0263125 2 8.839 2 12 C 2 15.161 3.4716719 17.973688 5.7636719 19.804688 C 6.2276719 20.175687 6.9154219 20.052781 7.2324219 19.550781 C 7.5014219 19.124781 7.4115781 18.564 7.0175781 18.25 C 5.1805781 16.784 4 14.532 4 12 C 4 9.468 5.1805781 7.2169531 7.0175781 5.7519531 C 7.4115781 5.4379531 7.5004688 4.8752188 7.2304688 4.4492188 C 7.0719687 4.1982187 6.8221094 4.0433438 6.5527344 3.9960938 z M 8.6816406 7.3984375 C 8.4035156 7.3545625 8.1111719 7.4291719 7.8886719 7.6386719 C 6.7276719 8.7316719 6 10.279 6 12 C 6 13.721 6.7276719 15.268328 7.8886719 16.361328 C 8.3336719 16.779328 9.0607188 16.654672 9.3867188 16.138672 L 9.390625 16.132812 C 9.651625 15.719812 9.5570312 15.194516 9.2070312 14.853516 C 8.4630313 14.129516 8 13.121 8 12 C 8 10.879 8.4630312 9.8704844 9.2070312 9.1464844 C 9.5570312 8.8054844 9.651625 8.2811875 9.390625 7.8671875 L 9.3867188 7.8613281 C 9.2237187 7.6033281 8.9597656 7.4423125 8.6816406 7.3984375 z M 15.318359 7.4003906 C 15.040234 7.4441406 14.776281 7.6033281 14.613281 7.8613281 L 14.609375 7.8671875 C 14.348375 8.2801875 14.442969 8.8054844 14.792969 9.1464844 C 15.536969 9.8704844 16 10.879 16 12 C 16 13.121 15.536016 14.129516 14.791016 14.853516 C 14.441016 15.194516 14.348375 15.718813 14.609375 16.132812 L 14.613281 16.138672 C 14.939281 16.654672 15.667328 16.780328 16.111328 16.361328 C 17.273328 15.268328 18 13.721 18 12 C 18 10.279 17.272328 8.7316719 16.111328 7.6386719 C 15.888828 7.4296719 15.596484 7.3566406 15.318359 7.4003906 z M 12 10 A 2 2 0 0 0 10 12 A 2 2 0 0 0 12 14 A 2 2 0 0 0 14 12 A 2 2 0 0 0 12 10 z"})}));case"search":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 20 20",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M12.625 9.375C12.625 8.03906 11.8984 6.82031 10.75 6.14062C9.57812 5.46094 8.14844 5.46094 7 6.14062C5.82812 6.82031 5.125 8.03906 5.125 9.375C5.125 10.7344 5.82812 11.9531 7 12.6328C8.14844 13.3125 9.57812 13.3125 10.75 12.6328C11.8984 11.9531 12.625 10.7344 12.625 9.375ZM11.8984 13.2188C11.0547 13.875 10 14.25 8.875 14.25C6.17969 14.25 4 12.0703 4 9.375C4 6.70312 6.17969 4.5 8.875 4.5C11.5469 4.5 13.75 6.70312 13.75 9.375C13.75 10.5234 13.3516 11.5781 12.6953 12.4219L15.8359 15.5391C16.0469 15.7734 16.0469 16.125 15.8359 16.3359C15.6016 16.5703 15.25 16.5703 15.0391 16.3359L11.8984 13.2188Z"})}));case"Shuffle":return n.jsx("svg",D(k({width:17*c,height:16*c,viewBox:"0 0 17 16",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M13.3438 1.15625L15.8438 3.65625C16.0312 3.84375 16.0312 4.1875 15.8438 4.375L13.3438 6.875C13.1562 7.0625 12.8125 7.0625 12.625 6.875C12.4375 6.6875 12.4375 6.34375 12.625 6.15625L14.2812 4.53125H12.5H10.75C10.4062 4.53125 10.125 4.65625 9.9375 4.90625L8.25 7.1875L7.625 6.34375L9.125 4.3125C9.5 3.8125 10.0938 3.5 10.75 3.5H12.5H14.2812L12.625 1.875C12.4375 1.6875 12.4375 1.34375 12.625 1.15625C12.8125 0.96875 13.1562 0.96875 13.3438 1.15625ZM3.875 11.3125L5.75 8.84375L6.375 9.6875L4.6875 11.9062C4.40625 12.2812 3.96875 12.5 3.5 12.5H0.5C0.21875 12.5 0 12.2812 0 12C0 11.75 0.21875 11.5 0.5 11.5H3.5C3.65625 11.5 3.78125 11.4375 3.875 11.3125ZM12.625 14.875C12.4375 14.6875 12.4375 14.3438 12.625 14.1562L14.2812 12.5H12.5H10.75C10.0938 12.5 9.5 12.2188 9.125 11.7188L3.875 4.71875C3.78125 4.59375 3.65625 4.5 3.5 4.5H0.5C0.21875 4.5 0 4.28125 0 4C0 3.75 0.21875 3.5 0.5 3.5H3.5C3.96875 3.5 4.40625 3.75 4.6875 4.125L9.9375 11.125C10.125 11.375 10.4062 11.5 10.75 11.5H12.5H14.2812L12.625 9.875C12.4375 9.6875 12.4375 9.34375 12.625 9.15625C12.8125 8.96875 13.1562 8.96875 13.3438 9.15625L15.8438 11.6562C16.0312 11.8438 16.0312 12.1875 15.8438 12.375L13.3438 14.875C13.1562 15.0625 12.8125 15.0625 12.625 14.875Z"})}));case"sine-wave":return n.jsx("svg",D(k({width:33*c,height:32*c,viewBox:"0 0 33 32",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M7.96875 16.1562C7.90625 16.4062 7.625 16.5625 7.34375 16.5C7.09375 16.4375 6.9375 16.1562 7 15.875L7.5 16C7 15.875 7 15.875 7 15.875C7 15.8438 7.03125 15.8438 7.03125 15.8125C7.03125 15.7812 7.0625 15.7188 7.09375 15.625C7.125 15.4688 7.21875 15.25 7.3125 14.9688C7.5 14.4375 7.8125 13.7188 8.25 13C9.0625 11.5938 10.4375 10 12.5 10C14.0938 10 15.125 10.9062 15.875 12.125C16.5625 13.3125 17.0312 14.875 17.4375 16.3438L17.4688 16.375C17.9062 17.9062 18.3438 19.3125 18.9688 20.375C19.5625 21.4062 20.3438 22 21.5 22C22.9375 22 24.0625 20.8438 24.875 19.5C25.25 18.8438 25.5312 18.1875 25.7188 17.6875C25.8125 17.4375 25.9062 17.25 25.9375 17.0938C25.9688 17.0312 25.9688 16.9688 26 16.9375V16.9062V16.875C26.0625 16.625 26.3438 16.4688 26.625 16.5312C26.875 16.5938 27.0312 16.875 26.9688 17.1562L26.5 17C26.9688 17.1562 26.9688 17.1562 26.9688 17.1562C26.9688 17.1875 26.9688 17.1875 26.9375 17.2188C26.9375 17.25 26.9062 17.3125 26.9062 17.4062C26.8438 17.5625 26.75 17.7812 26.6562 18.0625C26.4688 18.5938 26.1562 19.3125 25.7188 20.0312C24.9062 21.4062 23.5312 23 21.5 23C19.875 23 18.8438 22.125 18.0938 20.9062C17.4062 19.7188 16.9375 18.1562 16.5312 16.6875L16.5 16.6562C16.0625 15.125 15.6562 13.7188 15 12.6562C14.4062 11.625 13.625 11 12.5 11C11.0312 11 9.90625 12.1562 9.09375 13.5312C8.71875 14.1875 8.4375 14.8438 8.25 15.3438C8.15625 15.5938 8.09375 15.7812 8.03125 15.9375C8 16 8 16.0625 7.96875 16.0938V16.125V16.1562Z"})}));case"settings":return n.jsx("svg",D(k({width:17*c,height:16*c,viewBox:"0 0 17 16",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M0.5 13C0.5 12.75 0.71875 12.5 1 12.5H3.03125C3.28125 11.375 4.28125 10.5 5.5 10.5C6.6875 10.5 7.71875 11.375 7.9375 12.5H16C16.25 12.5 16.5 12.75 16.5 13C16.5 13.2812 16.25 13.5 16 13.5H7.9375C7.71875 14.6562 6.6875 15.5 5.5 15.5C4.28125 15.5 3.28125 14.6562 3.03125 13.5H1C0.71875 13.5 0.5 13.2812 0.5 13ZM4 13C4 13.5625 4.28125 14.0312 4.75 14.3125C5.1875 14.5938 5.78125 14.5938 6.25 14.3125C6.6875 14.0312 7 13.5625 7 13C7 12.4688 6.6875 12 6.25 11.7188C5.78125 11.4375 5.1875 11.4375 4.75 11.7188C4.28125 12 4 12.4688 4 13ZM10 8C10 8.5625 10.2812 9.03125 10.75 9.3125C11.1875 9.59375 11.7812 9.59375 12.25 9.3125C12.6875 9.03125 13 8.5625 13 8C13 7.46875 12.6875 7 12.25 6.71875C11.7812 6.4375 11.1875 6.4375 10.75 6.71875C10.2812 7 10 7.46875 10 8ZM11.5 5.5C12.6875 5.5 13.7188 6.375 13.9375 7.5H16C16.25 7.5 16.5 7.75 16.5 8C16.5 8.28125 16.25 8.5 16 8.5H13.9375C13.7188 9.65625 12.6875 10.5 11.5 10.5C10.2812 10.5 9.28125 9.65625 9.03125 8.5H1C0.71875 8.5 0.5 8.28125 0.5 8C0.5 7.75 0.71875 7.5 1 7.5H9.03125C9.28125 6.375 10.2812 5.5 11.5 5.5ZM6.5 4.5C7.03125 4.5 7.5 4.21875 7.78125 3.75C8.0625 3.3125 8.0625 2.71875 7.78125 2.25C7.5 1.8125 7.03125 1.5 6.5 1.5C5.9375 1.5 5.46875 1.8125 5.1875 2.25C4.90625 2.71875 4.90625 3.3125 5.1875 3.75C5.46875 4.21875 5.9375 4.5 6.5 4.5ZM8.9375 2.5H16C16.25 2.5 16.5 2.75 16.5 3C16.5 3.28125 16.25 3.5 16 3.5H8.9375C8.71875 4.65625 7.6875 5.5 6.5 5.5C5.28125 5.5 4.28125 4.65625 4.03125 3.5H1C0.71875 3.5 0.5 3.28125 0.5 3C0.5 2.75 0.71875 2.5 1 2.5H4.03125C4.28125 1.375 5.28125 0.5 6.5 0.5C7.6875 0.5 8.71875 1.375 8.9375 2.5Z"})}));case"smooth":return n.jsx("svg",D(k({width:12*c,height:12*c,viewBox:"0 0 12 12",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M6.34441 5.05756C6.44109 4.91707 6.41692 4.72976 6.29607 4.58927C6.15106 4.44878 5.8852 4.44878 5.74018 4.58927L1.17221 9.03805V7.72683C1.17221 6.15805 1.82477 4.61268 2.98489 3.48878L5.47432 1.07707C6.17523 0.398049 7.14199 0 8.13293 0C9.12387 0 10.0665 0.398049 10.7674 1.07707L10.8882 1.19415C11.5891 1.87317 12 2.78634 12 3.74634C12 4.33171 11.855 4.87024 11.5891 5.36195C11.5408 5.45561 11.4683 5.52585 11.3716 5.54927L8.66465 6.32195C8.56798 6.36878 8.49547 6.43902 8.49547 6.53268C8.49547 6.64976 8.59214 6.74341 8.73716 6.74341H9.51057C9.84894 6.74341 10.0181 7.16488 9.77643 7.39902L9.24471 7.91415C9.19637 7.96098 9.12387 7.98439 9.07553 8.0078L7.11782 8.56976C7.02115 8.61659 6.94864 8.68683 6.94864 8.78049C6.94864 8.89756 7.06949 8.99122 7.19033 8.99122C7.50453 8.99122 7.64955 9.36585 7.35952 9.52976C6.36858 10.162 5.20846 10.4898 4 10.4898H2.3565L0.978852 11.8244C0.761329 12.0585 0.398792 12.0585 0.181269 11.8244C-0.060423 11.6137 -0.060423 11.2624 0.181269 11.0283L6.34441 5.05756Z"})}));case"speed":return n.jsx("svg",D(k({width:20*c*.9,height:16*c*.9,viewBox:"0 0 20 16",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M0.5 2C0.75 2 1 2.25 1 2.5V13.5C1 13.7812 0.75 14 0.5 14C0.21875 14 0 13.7812 0 13.5V2.5C0 2.25 0.21875 2 0.5 2ZM6.84375 4.65625C7.03125 4.84375 7.03125 5.1875 6.84375 5.375L4.6875 7.5H15.2812L13.125 5.375C12.9375 5.1875 12.9375 4.84375 13.125 4.65625C13.3125 4.46875 13.6562 4.46875 13.8438 4.65625L16.8438 7.65625C17.0312 7.84375 17.0312 8.1875 16.8438 8.375L13.8438 11.375C13.6562 11.5625 13.3125 11.5625 13.125 11.375C12.9375 11.1875 12.9375 10.8438 13.125 10.6562L15.2812 8.5H4.6875L6.84375 10.6562C7.03125 10.8438 7.03125 11.1875 6.84375 11.375C6.65625 11.5625 6.34375 11.5625 6.125 11.375L3.125 8.375C2.9375 8.1875 2.9375 7.84375 3.125 7.65625L6.125 4.65625C6.34375 4.46875 6.65625 4.46875 6.84375 4.65625ZM20 2.5V13.5C20 13.7812 19.75 14 19.5 14C19.2188 14 19 13.7812 19 13.5V2.5C19 2.25 19.2188 2 19.5 2C19.75 2 20 2.25 20 2.5Z"})}));case"square-wave":return n.jsx("svg",D(k({width:32*c,height:32*c,viewBox:"0 0 32 32",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M12.5 10.5C12.2188 10.5 12 10.75 12 11V15.5C12 16.3438 11.3125 17 10.5 17H7C6.71875 17 6.5 16.7812 6.5 16.5C6.5 16.25 6.71875 16 7 16H10.5C10.75 16 11 15.7812 11 15.5V11C11 10.1875 11.6562 9.5 12.5 9.5H15.5C16.3125 9.5 17 10.1875 17 11V22C17 22.2812 17.2188 22.5 17.5 22.5H20.5C20.75 22.5 21 22.2812 21 22V17.5C21 16.6875 21.6562 16 22.5 16H26C26.25 16 26.5 16.25 26.5 16.5C26.5 16.7812 26.25 17 26 17H22.5C22.2188 17 22 17.25 22 17.5V22C22 22.8438 21.3125 23.5 20.5 23.5H17.5C16.6562 23.5 16 22.8438 16 22V11C16 10.75 15.75 10.5 15.5 10.5H12.5Z"})}));case"star":return n.jsx("svg",D(k({width:576*c,height:512*c,viewBox:"0 0 576 512"},f),{children:n.jsx("path",{fill:p,d:"M316.9 18C311.6 7 300.4 0 288.1 0s-23.4 7-28.8 18L195 150.3 51.4 171.5c-12 1.8-22 10.2-25.7 21.7s-.7 24.2 7.9 32.7L137.8 329 113.2 474.7c-2 12 3 24.2 12.9 31.3s23 8 33.8 2.3l128.3-68.5 128.3 68.5c10.8 5.7 23.9 4.9 33.8-2.3s14.9-19.3 12.9-31.3L438.5 329 542.7 225.9c8.6-8.5 11.7-21.2 7.9-32.7s-13.7-19.9-25.7-21.7L381.2 150.3 316.9 18z"})}));case"stop":return n.jsx("svg",D(k({width:512*c/20,height:512*c/20,viewBox:"0 0 512 512"},f),{children:n.jsx("path",{fill:p,d:"M464 256A208 208 0 1 0 48 256a208 208 0 1 0 416 0zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zm192-96l128 0c17.7 0 32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32l0-128c0-17.7 14.3-32 32-32z"})}));case"thunder":return n.jsx("svg",D(k({viewBox:"0 0 24 24",width:20*c,height:20*c},f),{children:n.jsx("path",{fill:p,d:"M 13 1 L 6 14 L 12 14 L 12 23 L 19 10 L 13 10 L 13 1 z"})}));case"transient":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 24 24"},f),{children:n.jsx("path",{fill:p,d:"M 8 2 L 8 22 L 10 22 L 10 2 Z M 20 2 L 20 22 L 22 22 L 22 2 Z M 5 6 L 5 18 L 7 18 L 7 6 Z M 11 6 L 11 18 L 13 18 L 13 6 Z M 17 6 L 17 18 L 19 18 L 19 6 Z M 2 9 L 2 15 L 4 15 L 4 9 Z M 14 9 L 14 15 L 16 15 L 16 9 Z"})}));case"trash":return n.jsx("svg",D(k({width:12*c,height:13*c,viewBox:"0 0 12 13",fill:"none"},f),{children:n.jsx("path",{fill:"white",d:"M4.89844 1.25C4.78125 1.25 4.66406 1.32031 4.59375 1.4375L4.21875 2H7.75781L7.38281 1.4375C7.3125 1.32031 7.19531 1.25 7.07812 1.25H4.89844ZM8.625 2H9.72656H10.5H10.875C11.0625 2 11.25 2.1875 11.25 2.375C11.25 2.58594 11.0625 2.75 10.875 2.75H10.4297L9.84375 11.1172C9.77344 11.9141 9.14062 12.5 8.34375 12.5H3.63281C2.85938 12.5 2.20312 11.9141 2.13281 11.1172L1.54688 2.75H1.125C0.914062 2.75 0.75 2.58594 0.75 2.375C0.75 2.1875 0.914062 2 1.125 2H1.5H2.25H3.35156L3.96094 1.03906C4.14844 0.710938 4.52344 0.5 4.89844 0.5H7.07812C7.45312 0.5 7.82812 0.710938 8.03906 1.03906L8.625 2ZM9.67969 2.75H2.29688L2.88281 11.0703C2.90625 11.4453 3.23438 11.75 3.63281 11.75H8.34375C8.74219 11.75 9.07031 11.4453 9.09375 11.0703L9.67969 2.75Z"})}));case"trangle":return n.jsx("svg",D(k({width:24*c,height:24*c,viewBox:"0 0 320 512"},f),{children:n.jsx("path",{fill:p,d:"M182.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128z"})}));case"update":return n.jsx("svg",D(k({width:12*c,height:13*c,viewBox:"0 0 24 24"},f),{children:n.jsx("path",{fill:p,d:"M 12 3 C 7.037 3 3 7.038 3 12 L 5 12 C 5 8.14 8.141 5 12 5 C 14.185097 5 16.125208 6.0167955 17.408203 7.5917969 L 15 10 L 21 10 L 21 4 L 18.833984 6.1660156 C 17.184843 4.2316704 14.736456 3 12 3 z M 19 12 C 19 15.859 15.859 19 12 19 C 9.8149031 19 7.8747922 17.983204 6.5917969 16.408203 L 9 14 L 3 14 L 3 20 L 5.1660156 17.833984 C 6.8151574 19.76833 9.263544 21 12 21 C 16.963 21 21 16.963 21 12 L 19 12 z"})}));case"wand":return n.jsx("svg",D(k({viewBox:"0 0 64 64",width:64*c,height:64*c},f),{children:n.jsx("path",{fill:p,d:"M 13.222656 6 L 12.853516 8.5742188 C 12.610516 10.274219 11.274219 11.610516 9.5742188 11.853516 L 7 12.222656 L 7 13.777344 L 9.5742188 14.146484 C 11.274219 14.389484 12.610516 15.725781 12.853516 17.425781 L 13.222656 20 L 14.777344 20 L 15.146484 17.425781 C 15.389484 15.725781 16.725781 14.389484 18.425781 14.146484 L 21 13.777344 L 21 12.222656 L 18.425781 11.853516 C 16.725781 11.610516 15.389484 10.274219 15.146484 8.5742188 L 14.777344 6 L 13.222656 6 z M 31 6 L 30.763672 7.6542969 C 30.607672 8.7472969 29.74925 9.6076719 28.65625 9.7636719 L 27 10 L 27 11 L 28.654297 11.236328 C 29.747297 11.392328 30.607672 12.25075 30.763672 13.34375 L 31 15 L 32 15 L 32.236328 13.345703 C 32.392328 12.252703 33.25075 11.392328 34.34375 11.236328 L 36 11 L 36 10 L 34.345703 9.7636719 C 33.252703 9.6076719 32.392328 8.74925 32.236328 7.65625 L 32 6 L 31 6 z M 48.677734 8.0039062 A 6.243 2.443 44.999 0 0 47.84375 8.3261719 A 6.243 2.443 44.999 0 0 47.839844 8.3300781 L 8.171875 47.998047 C 6.609875 49.560047 6.609875 52.09425 8.171875 53.65625 L 11.34375 56.828125 C 12.90575 58.391125 15.438 58.391125 17 56.828125 L 56.667969 17.160156 A 6.243 2.443 44.999 0 0 56.671875 17.15625 A 6.243 2.443 44.999 0 0 48.677734 8.0039062 z M 49.060547 12.767578 A 6.243 2.443 44.999 0 0 52.234375 15.9375 L 38.171875 30 L 34.998047 26.828125 L 49.060547 12.767578 z M 48 39 L 47.527344 42.310547 C 47.215344 44.496547 45.496547 46.215344 43.310547 46.527344 L 40 47 L 40 49 L 43.310547 49.472656 C 45.496547 49.784656 47.215344 51.503453 47.527344 53.689453 L 48 57 L 50 57 L 50.472656 53.689453 C 50.784656 51.503453 52.503453 49.784656 54.689453 49.472656 L 58 49 L 58 47 L 54.689453 46.527344 C 52.503453 46.215344 50.784656 44.496547 50.472656 42.310547 L 50 39 L 48 39 z"})}));case"undo":return n.jsx("svg",D(k({width:15*c,height:15*c,viewBox:"0 0 15 15",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M1 5C0.71875 5 0.5 4.78125 0.5 4.5V0.5C0.5 0.25 0.71875 0 1 0C1.25 0 1.5 0.25 1.5 0.5V3.40625C2.71875 1.375 4.9375 0 7.5 0C11.3438 0 14.5 3.15625 14.5 7C14.5 10.875 11.3438 14 7.5 14C5 14 2.8125 12.7188 1.5625 10.75C1.34375 10.4062 1.59375 10 2 10C2.1875 10 2.34375 10.125 2.4375 10.2812C3.5 11.9062 5.375 13 7.5 13C10.8125 13 13.5 10.3125 13.5 7C13.5 3.6875 10.8125 1 7.5 1C5.25 1 3.3125 2.21875 2.28125 4H5C5.25 4 5.5 4.25 5.5 4.5C5.5 4.78125 5.25 5 5 5H1Z"})}));case"redo":return n.jsx("svg",D(k({width:15*c,height:15*c,viewBox:"0 0 15 15",fill:"none"},f),{children:n.jsx("path",{fill:p,d:"M14 5H10C9.71875 5 9.5 4.78125 9.5 4.5C9.5 4.25 9.71875 4 10 4H12.6875C11.6562 2.21875 9.71875 1 7.5 1C4.1875 1 1.5 3.6875 1.5 7C1.5 10.3125 4.1875 13 7.5 13C9.59375 13 11.4688 11.9062 12.5312 10.2812C12.625 10.125 12.8125 10 13 10C13.375 10 13.625 10.4062 13.4062 10.75C12.1875 12.7188 9.96875 14 7.5 14C3.625 14 0.5 10.875 0.5 7C0.5 3.15625 3.625 0 7.5 0C10.0312 0 12.25 1.375 13.5 3.40625V0.5C13.5 0.25 13.7188 0 14 0C14.25 0 14.5 0.25 14.5 0.5V4.5C14.5 4.78125 14.25 5 14 5Z"})}));case"waves":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 64 64"},f),{children:n.jsx("path",{fill:p,d:"M 52.326172 15.839844 C 51.329797 15.844844 50.329437 15.921391 49.335938 16.087891 C 47.349938 16.409891 45.434797 17.108469 43.716797 17.980469 C 41.996797 18.833469 40.433203 19.897797 39.033203 20.591797 C 38.216203 20.996797 37.298875 21.502297 34.921875 21.029297 C 31.861875 20.480297 28.84575 18.371266 25.09375 17.197266 C 23.21975 16.615266 21.202891 16.357937 19.212891 16.460938 C 17.214891 16.601938 15.405484 17.00925 13.521484 17.65625 C 12.753484 17.92025 12.332078 18.75325 12.580078 19.53125 C 12.832078 20.31925 13.675844 20.755906 14.464844 20.503906 C 15.161844 20.280906 17.159047 19.669078 19.373047 19.580078 C 20.969047 19.542078 22.558516 19.774969 24.103516 20.292969 C 27.412516 21.380969 30.329703 23.601031 34.220703 24.457031 C 37.714703 25.232031 39.474938 24.374234 40.585938 23.865234 C 42.416937 22.994234 43.847234 22.048656 45.365234 21.347656 C 46.862234 20.632656 48.374453 20.131062 49.939453 19.914062 C 52.183453 19.594063 54.117688 19.906234 54.804688 19.990234 C 55.900687 20.125234 56.899203 19.344047 57.033203 18.248047 C 57.168203 17.152047 56.388016 16.155484 55.291016 16.021484 C 54.315016 15.901984 53.322547 15.834844 52.326172 15.839844 z M 19.785156 24.154297 C 18.744906 24.143422 17.945156 24.213375 17.660156 24.234375 C 15.815156 24.377375 13.995563 24.712844 12.226562 25.214844 C 9.8045625 25.879844 7.6832187 26.870969 6.9492188 27.292969 C 5.9912187 27.842969 5.6609375 29.065438 6.2109375 30.023438 C 6.7609375 30.981438 7.9834062 31.311719 8.9414062 30.761719 C 10.191406 30.044719 11.950359 29.342641 13.318359 28.931641 C 14.846359 28.457641 16.417047 28.130703 17.998047 27.970703 C 19.356047 27.835703 21.006406 27.754516 22.566406 28.103516 C 24.037406 28.404516 25.486719 28.99075 27.011719 29.71875 C 28.536719 30.43175 30.147266 31.252938 31.947266 31.835938 C 34.229266 32.533937 35.773641 32.602516 36.181641 32.603516 C 38.421641 32.709516 39.964328 32.371672 43.111328 30.513672 C 44.476328 29.698672 45.887719 28.864219 47.386719 28.449219 C 48.167719 28.233219 48.6375 27.431719 48.4375 26.636719 C 48.2375 25.833719 47.423141 25.343922 46.619141 25.544922 C 44.703141 26.022922 43.028641 26.971828 41.556641 27.798828 C 38.928641 29.284828 37.908469 29.442172 36.355469 29.326172 C 36.195469 29.323172 34.998578 29.285766 33.017578 28.634766 C 31.552578 28.123766 30.102156 27.352359 28.535156 26.568359 C 26.979156 25.780359 25.241609 25.000453 23.349609 24.564453 C 22.106609 24.257953 20.825406 24.165172 19.785156 24.154297 z M 54.326172 31.46875 C 53.180359 31.452766 51.275906 31.580219 49.066406 32.417969 C 47.178406 33.118969 45.537094 34.076922 43.996094 34.919922 C 42.459094 35.763922 40.992141 36.483141 39.494141 36.869141 C 37.997141 37.258141 36.477109 37.320875 34.912109 37.046875 C 31.744109 36.505875 28.661234 34.788703 25.115234 33.470703 C 24.233234 33.134703 23.277828 32.869297 22.298828 32.654297 C 21.316828 32.481297 20.187562 32.378031 19.226562 32.457031 C 17.243562 32.589031 15.435781 32.971125 13.550781 33.578125 C 12.778781 33.828125 12.339266 34.651547 12.572266 35.435547 C 12.809266 36.229547 13.6435 36.679359 14.4375 36.443359 C 15.1425 36.232359 17.145953 35.662078 19.376953 35.580078 C 20.208953 35.536078 20.873297 35.637344 21.654297 35.777344 C 22.419297 35.970344 23.191516 36.193625 23.978516 36.515625 C 27.120516 37.732625 30.346391 39.689281 34.275391 40.488281 C 36.231391 40.886281 38.376422 40.866625 40.357422 40.390625 C 42.349422 39.924625 44.138766 39.067516 45.759766 38.228516 C 47.377766 37.385516 48.878141 36.576406 50.369141 36.066406 C 52.580141 35.298406 54.101141 35.432094 54.869141 35.496094 C 55.970141 35.588094 56.937297 34.770922 57.029297 33.669922 C 57.121297 32.568922 56.302172 31.603719 55.201172 31.511719 C 55.004672 31.495219 54.708109 31.474078 54.326172 31.46875 z M 19.726562 40.146484 C 19.215813 40.146859 18.71125 40.169344 18.21875 40.214844 C 16.16475 40.386844 14.151 40.845594 12.25 41.558594 C 11.293 41.902594 10.371797 42.327109 9.4667969 42.787109 C 9.3217969 42.862109 7.7812813 43.652266 6.7382812 44.447266 C 5.8592812 45.116266 5.6884219 46.371 6.3574219 47.25 C 7.0264219 48.129 8.2801563 48.299859 9.1601562 47.630859 C 9.1801563 47.614859 9.9606406 46.997578 11.306641 46.267578 C 12.060641 45.863578 12.833813 45.483734 13.632812 45.177734 C 15.221812 44.538734 16.884687 44.128219 18.554688 43.949219 C 19.352687 43.862219 20.124813 43.836813 20.882812 43.882812 C 21.739812 43.934812 22.580687 44.078172 23.429688 44.326172 C 25.025688 44.763172 26.610078 45.544234 28.330078 46.365234 C 30.033078 47.184234 31.951578 47.996719 34.017578 48.386719 C 36.087578 48.801719 38.22575 48.7025 40.21875 48.3125 C 46.10975 47.1495 50.492937 43.530344 50.960938 43.152344 C 51.586938 42.646344 51.701844 41.729031 51.214844 41.082031 C 50.714844 40.422031 49.775234 40.292969 49.115234 40.792969 C 47.871234 41.734969 44.254859 44.308234 39.630859 45.115234 C 37.951859 45.401234 36.274781 45.438172 34.675781 45.076172 C 33.062781 44.731172 31.506328 44.055797 29.861328 43.216797 C 28.224328 42.395797 26.458172 41.456609 24.451172 40.849609 C 23.435172 40.520609 22.354531 40.313844 21.269531 40.214844 C 20.754031 40.167844 20.237312 40.146109 19.726562 40.146484 z"})}));case"time":return n.jsx("svg",D(k({width:20*c,height:20*c,viewBox:"0 0 30 30"},f),{children:n.jsx("path",{fill:p,d:"M 7.984375 2.9863281 A 1.0001 1.0001 0 0 0 7.8398438 3 L 6 3 A 1.0001 1.0001 0 1 0 6 5 L 7 5 L 7 7 C 7 11.611855 10.11218 14.053381 11.464844 15 C 10.11218 15.946619 7 18.388145 7 23 L 7 25 L 6 25 A 1.0001 1.0001 0 1 0 6 27 L 7.8320312 27 A 1.0001 1.0001 0 0 0 8.1582031 27 L 21.832031 27 A 1.0001 1.0001 0 0 0 22.158203 27 L 24 27 A 1.0001 1.0001 0 1 0 24 25 L 23 25 L 23 23 C 23 18.388145 19.88782 15.946619 18.535156 15 C 19.88782 14.053381 23 11.611855 23 7 L 23 5 L 24 5 A 1.0001 1.0001 0 1 0 24 3 L 22.154297 3 A 1.0001 1.0001 0 0 0 21.984375 2.9863281 A 1.0001 1.0001 0 0 0 21.839844 3 L 8.1542969 3 A 1.0001 1.0001 0 0 0 7.984375 2.9863281 z M 9.0898438 8 L 20.910156 8 C 20.30229 11.758553 16.486328 14.142578 16.486328 14.142578 A 1.0001 1.0001 0 0 0 16.486328 15.857422 C 16.486328 15.857422 20.30229 18.241447 20.910156 22 L 18.857422 22 C 18.411326 20.277785 16.861621 19 15 19 C 13.138379 19 11.588674 20.277785 11.142578 22 L 9.0898438 22 C 9.6977096 18.241447 13.513672 15.857422 13.513672 15.857422 A 1.0001 1.0001 0 0 0 13.513672 14.142578 C 13.513672 14.142578 9.6977096 11.758553 9.0898438 8 z M 12.5 10 C 12.5 11.381 13.619 12.5 15 12.5 C 16.381 12.5 17.5 11.381 17.5 10 L 12.5 10 z"})}));case"fractal":return n.jsxs("svg",D(k({width:20*c,height:20*c},f),{viewBox:"0 0 100 100",children:[n.jsx("path",{d:"M 25,50.066989 50,93.3681 H 0 Z",fill:p}),n.jsx("path",{d:"M 75,50.066989 100,93.3681 H 50 Z",fill:p}),n.jsx("path",{d:"M 50,50.066989 37.5,71.7181 h 25 z",fill:p}),n.jsx("path",{d:"M 50,6.7658778 75,50.066989 H 25 Z",fill:p})]}));case"embers":return n.jsx("svg",D(k({width:20*c,height:20*c},f),{viewBox:"0 0 30 30",children:n.jsx("path",{d:"M 13 2 A 1 1 0 0 0 12 3 C 12 8.057 5 12 5 19 C 5 24.317836 10.763496 27.75594 12.792969 27.978516 A 1 1 0 0 0 13 28 A 1 1 0 0 0 14 27 A 1 1 0 0 0 13.630859 26.224609 A 1 1 0 0 0 13.630859 26.222656 C 12.720859 25.484656 11 23.343672 11 21.388672 C 11 18.179672 14 17 14 17 C 12.289 21.84 17.895437 22.424797 19.023438 27.216797 L 19.025391 27.216797 A 1 1 0 0 0 20 28 A 1 1 0 0 0 20.585938 27.808594 A 1 1 0 0 0 20.638672 27.767578 C 20.801418 27.661885 25 24.885024 25 19 C 25 16.597384 23.798332 12.470502 22.933594 10.642578 C 22.93288 10.641068 22.932354 10.638225 22.931641 10.636719 A 1 1 0 0 0 22.929688 10.632812 A 1 1 0 0 0 22 10 A 1 1 0 0 0 21.017578 10.818359 A 1 1 0 0 0 21.017578 10.822266 C 21.015135 10.833195 20.555826 12.873023 19 14 C 19 9.2883665 15.598363 4.4216134 13.804688 2.4082031 A 1 1 0 0 0 13.716797 2.3046875 A 1 1 0 0 0 13 2 z"})}))}},bo=4.7,ws=-.5*Math.PI+.5*(2*Math.PI-bo);function rf({node:e,visible:t,labelOnly:r,showKnobValue:o,setMouseOverControls:s}){const i=a.useRef(),l=ao(e),c=T(m=>l===void 0?0:m[l]),u=`${e.type}Enabled`,d=T(m=>m[u]),h=a.useMemo(()=>Pi().find(v=>v.paramId===l),[l]);Ge(m=>{i.current.lookAt(m.camera.position)});const f=a.useCallback(()=>{Ds(e),kt.getState().clearSelection()},[e.id]),p=a.useCallback((m,v)=>{Le({[m]:v})},[]),w=a.useCallback(()=>s(!0),[s]),x=a.useCallback(()=>s(!1),[s]);return n.jsxs("group",{visible:t,ref:i,children:[!r&&l&&n.jsx(sf,{activationParam:l,enabledParam:u,min:h==null?void 0:h.min,max:h==null?void 0:h.max,skew:h==null?void 0:h.skew}),n.jsx("group",{position:[0,-.57,0],children:t&&!r&&n.jsxs(Fn,{position:[0,0,0],style:{pointerEvents:"none",display:t?"":"none",transform:"translate(-50%, 0)"},className:"flex flex-row",children:[n.jsxs("div",{className:"bg-[#FFFFFF0D] flex flex-row g-05 border-t border-l border-b border-[#FFFFFF0F] py-1 px-2 rounded-l-full",children:[n.jsx(Do,{paramId:u,setParameter:p,value:d,onMouseEnter:w,onMouseLeave:x,style:{pointerEvents:"auto"}}),n.jsx("span",{className:"text-gray-300 w-[9vw]",style:{whiteSpace:"nowrap"},children:o?nr(c,(h==null?void 0:h.strRepr)||[],(h==null?void 0:h.suffix)||""):Vl(e.type)})]}),n.jsx("div",{onMouseEnter:w,onMouseLeave:x,onClick:f,className:"bg-[#FFFFFF0D] ml-[0.75px] flex flex-row justify-center items-center g-05 border-t border-r border-b border-[#FFFFFF0F] py-1 px-2 rounded-r-full b-l-none",style:{pointerEvents:"auto"},children:n.jsx(ie,{type:X.Trash,size:22})})]})})]})}const of=at({uActivation:1,uEnabled:1,uThickness:.025,uColorActive1:new Te().setHex(7169190,ca),uColorActive2:new Te().setHex(16024178,ca),uColorInactive:new Te(.05,.05,.09),uLengthRadians:bo,uStartAngle:ws},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
#define PI 3.14159
varying vec2 vUv;
uniform float uActivation;
uniform int uEnabled;
uniform vec3 uColorActive1;
uniform vec3 uColorActive2;
uniform vec3 uColorInactive;
uniform float uLengthRadians;
uniform float uStartAngle;
uniform float uThickness;
void main() {
float angle = PI - atan(vUv.y - 0.5, vUv.x - 0.5) - uStartAngle;
float arcDistance = mod(angle, 2.0 * PI) / uLengthRadians;
vec3 colorActive = mix(uColorActive1, uColorActive2, arcDistance);
vec3 colorInactive = uColorInactive;
float dist = length(2.0 * vUv - vec2(1.0));
float tWidth = (dist - (1.0 - uThickness)) / uThickness;
float centerOfArc = 1.0 - 2.0 * abs(tWidth - 0.5);
colorActive *= mix(0.3, 1.4, pow(centerOfArc, 0.4));
colorInactive += 0.1 * pow(centerOfArc, 0.25);
vec3 color = mix(colorActive, colorInactive, step(uActivation, arcDistance));
if (uEnabled == 0) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
color.rgb = vec3(grayscale);
}
gl_FragColor = vec4(color, 1.0);
}`);st({SceneKnobArcMaterial:of});function sf({activationParam:e,enabledParam:t,min:r,max:o,skew:s}){const i=a.useRef(),l=a.useRef();Ge(()=>{let d=Fe.getState()[e];const h=Fe.getState()[t];let[f,p]=Ar(e);r!==void 0&&o!==void 0&&(d=We(d,r,o,s||1),f=We(f,r,o,s||1)),l.current.uniforms.uActivation.value=d,l.current.uniforms.uEnabled.value=h?1:0;const w=i.current;w.visible=p,w.rotation.set(0,0,-1*(ws+f*bo))});const c=.67,u=.03;return n.jsxs(n.Fragment,{children:[n.jsxs(Qn.mesh,{position:[0,0,.1],children:[n.jsx("ringGeometry",{args:[c-.5*u,c+.5*u,64,1,ws,bo]}),n.jsx("sceneKnobArcMaterial",{ref:l,uThickness:u/c})]}),n.jsxs("group",{ref:i,children:[n.jsxs("mesh",{position:[-c,0,0],children:[n.jsx("circleGeometry",{args:[.03,16]}),n.jsx("meshBasicMaterial",{depthTest:!1,depthWrite:!1})]}),n.jsx(vn,{position:[-c,0,0],radius:.15,alpha:.2})]})]})}function Vl(e){return Jt.includes(e)?`Space ${e.replace("conv","")}`:Qt.includes(e)?`Grains ${e.replace("grain","")}`:Bt.includes(e)?`Time ${e.replace("time","")}`:Ht.includes(e)?`Volt ${e.replace("volt","")}`:Gt.includes(e)?`Haze ${e.replace("chorus","")}`:cn.includes(e)?`Filter ${e.replace("filter","")}`:e}const Zn=18,Cr=128,$a=-36,Ua=24,Wr=20,qr=2e4;function af(e){return Math.pow(2,e*.08333333333+3.03135971352)}function ys({type:e,prevId:t,isMuted:r,disableFrustumCulling:o}){var E,q;const s=a.useRef(0),i=a.useRef(null),l=a.useRef(null),c=a.useRef(null),u=a.useRef(),d=a.useRef(),h=`${e}Type`,f=`${e}Steepness`,p=`${e}Cutoff`,w=`${e}Q`,x=`${e}Enabled`,m=`${e}Gain`,v=`${e}Stereo`,b=`${e}CutoffNoteSnapEnabled`,S=ze(),y=T(W=>W[b]),g=S[p],j=(E=T(W=>{const F=W[g.toggleId];return ze()[F?g.toggleOn:g.toggleOff]}))!=null?E:g,N=a.useCallback(W=>{const F=xt(W,j.min,j.max,j.skew);return y?af(F):F},[y,j]),P=a.useCallback(W=>{const F=We(W,g.min,g.max,g.skew);return N(F)},[g,N]);Ge((W,F)=>{var K,ce,re,te;s.current+=F;const Y=Fe.getState()[x],me=l.current.uniforms,Se=(K=Fr.getState().spectrums[`${e}:0_spectrum`])!=null?K:[],je=(ce=Fr.getState().spectrums[`${e}:1_spectrum`])!=null?ce:[];if(Se.length){const ue=Se.length/Zn;me.uEqSamplesLeft.value.fill(0);for(let he=0;he<Se.length;he++){const Q=Math.floor(he/ue);me.uEqSamplesLeft.value[Q]=Math.max(Se[he],me.uEqSamplesLeft.value[Q])}}if(je.length){const ue=je.length/Zn;me.uEqSamplesRight.value.fill(0);for(let he=0;he<je.length;he++){const Q=Math.floor(he/ue);me.uEqSamplesRight.value[Q]=Math.max(je[he],me.uEqSamplesRight.value[Q])}}me.uTime.value=s.current,me.uEnabled.value=Y>0&&!r,(re=u.current)!=null&&re.length&&(me.uCurveSamplesLeft.value=u.current),(te=d.current)!=null&&te.length&&(me.uCurveSamplesRight.value=d.current);const ye=c.current;Y&&!r?ye.color.set(.033,.033,.091):ye.color.set(.08,.08,.08);const le=i.current,Me=.06,ve=2;le.rotation.set(Me*Math.sin(ve*s.current),-.9+Me*Math.cos(ve*s.current),0)});const L=a.useRef(0),I=a.useRef(0),C=a.useRef(0),M=a.useRef(0),R=a.useRef(""),O=a.useRef(0),_=a.useRef(0);function z(){if(Date.now()-L.current<30)return;L.current=Date.now();const W=Fe.getState(),F=_e(p),Z=_e(w),Y=_e(m),me=W[h],Se=W[f],je=_e(v);if(I.current===F&&C.current===Z&&R.current===me&&O.current===Se&&M.current==Y&&_.current==je)return;I.current=F,C.current=Z,R.current=me,O.current=Se,M.current=Y,_.current=je,(()=>de(this,null,function*(){const le=P(F),Me=yt(le*Math.pow(2,-.01*je),Wr,qr),ve=yt(le*Math.pow(2,.01*je),Wr,qr);u.current=(yield xo(Me,Z,Y,me,Se,Cr,$a,Ua,!1,!1,Wr,qr))||[],d.current=(yield xo(ve,Z,Y,me,Se,Cr,$a,Ua,!1,!1,Wr,qr))||[]}))().catch(console.error)}ln(z),T(z);const U=mt(W=>W.graphicsQuality);let $=64;U===ct.Low&&($=32);const{nodes:V}=wn("./filterCircle.glb");return n.jsxs(n.Fragment,{children:[n.jsxs("group",{ref:i,rotation:[0,-.9,0],children:[n.jsxs("mesh",{frustumCulled:!o,children:[n.jsx("torusGeometry",{args:[.45,.025,12,$]}),n.jsx("meshStandardMaterial",{ref:c,color:"#333355",roughness:.2,metalness:.5})]}),n.jsx("mesh",{geometry:(q=V==null?void 0:V.geo1)==null?void 0:q.geometry,frustumCulled:!o,children:n.jsx("filterCircleMaterial",{ref:l,renderOrder:1e3})}),n.jsx(cr,{enabledParam:`${e}Enabled`,muted:r,snapshotId:t,renderOrder:100,showContactHighlights:!1,disableFrustumCulling:o,lensFlare:!0,lensFlareRadius:.6}),n.jsxs("mesh",{visible:!0,rotation:[Math.PI,0,0],children:[n.jsx("sphereGeometry",{args:[.12,16,12,0,Math.PI]}),n.jsx("meshBasicMaterial",{side:Ao,color:"#505055"})]})]}),n.jsx(vn,{position:new Oe(-.1,0,0),renderOrder:200,radius:.08,innerRadius:0,alpha:.3})]})}const lf=at({uOpenColor:new Te("#aaccff"),uClosedColor:new Te("#556077"),uOpenAlpha:.5,uClosedAlpha:1,uEnabled:!0,uTime:0,uEqSamplesLeft:new Array(Zn).fill(0),uEqSamplesRight:new Array(Zn).fill(0),uCurveSamplesLeft:new Array(Cr).fill(0),uCurveSamplesRight:new Array(Cr).fill(0)},`
precision mediump float;
varying vec2 vUv;
void main () {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}`,`
precision mediump float;
varying vec2 vUv;
#define kEqSampleCount ${Zn}
#define kCurveSampleCount ${Cr}
uniform vec3 uOpenColor;
uniform vec3 uClosedColor;
uniform float uOpenAlpha;
uniform float uClosedAlpha;
uniform bool uEnabled;
uniform float uTime;
uniform float uEqSamplesLeft[kEqSampleCount];
uniform float uEqSamplesRight[kEqSampleCount];
uniform float uCurveSamplesLeft[kCurveSampleCount];
uniform float uCurveSamplesRight[kCurveSampleCount];
float getSpectrumValue(float i) {
// Add some ambient noise even when nothing is playing.
float value = 0.3;
value *= 1.0 + 0.05 * sin(5.0*uTime + 2.0*i) - 0.05 * sin(5.0*uTime + 3.0*i);
// On some graphics cards we can't use a dynamic value to index into the
// uniform array (like uEqSamplesLeft[int(i)]) but a loop index is apparently ok.
float sampleLeft = 0.0;
float sampleRight = 0.0;
for (int index = 0; index < kEqSampleCount; index++) {
if (index == int(i)) {
sampleLeft = uEqSamplesLeft[index];
sampleRight = uEqSamplesRight[index];
}
}
return value + mix(sampleRight, sampleLeft, step(0.5, vUv.x));
}
float getFilterActivation(float t) {
float curveIndex = t * float(kCurveSampleCount - 1);
int curveIndex1 = int(floor(curveIndex));
int curveIndex2 = int(ceil(curveIndex));
vec2 curveSample1 = vec2(0.0);
vec2 curveSample2 = vec2(0.0);
// On some graphics cards we can't use a dynamic value to index into the
// uniform array (like uCurveSamplesLeft[curveIndex1]) but a loop index is
// apparently ok.
for (int index = 0; index < kCurveSampleCount; index++) {
if (index == curveIndex1) {
curveSample1 = vec2(uCurveSamplesLeft[index], uCurveSamplesRight[index]);
} else if (index == curveIndex2) {
curveSample2 = vec2(uCurveSamplesLeft[index], uCurveSamplesRight[index]);
}
}
vec2 curveValue = mix(curveSample1, curveSample2, fract(curveIndex));
return mix(curveValue.y, curveValue.x, smoothstep(0.45, 0.55, vUv.x));
}
void main() {
vec2 uv = vec2(-1.0 * (2.0 * vUv.y - 1.0), 2.0 * vUv.x - 1.0);
float uvLen = length(uv);
float angle = atan(uv.y, uv.x);
angle = abs(angle); // make symmetrical on the left side
float t = angle / 3.14159;
float filterActivation = getFilterActivation(t);
filterActivation = smoothstep(0.0, 1.0, filterActivation);
// Make color slightly warmer for high freqs.
vec3 openColor = uOpenColor;
openColor.g += 0.2 * vUv.y;
openColor.r += 0.2 * vUv.y;
vec4 color = vec4(
mix(uClosedColor, openColor, filterActivation),
mix(uClosedAlpha, uOpenAlpha, filterActivation)
);
const float barCount = ${Zn}.0;
float tBar = angle / 3.14159 * barCount;
float iBar = floor(tBar);
tBar = fract(tBar);
float barLength = 0.8 * getSpectrumValue(iBar);
barLength += 0.15 * sqrt(0.25 - pow(tBar - 0.5, 2.0));
float allowGaps = step(abs(dFdy(uv.x)), 0.03*uvLen);
if (uvLen < barLength) {
float isInsideBar = 0.0;
if (allowGaps > 0.0) {
float gapSize = 0.25;
isInsideBar = clamp(min(tBar, 1.0 - tBar) / gapSize, 0.0, 1.0);
} else {
isInsideBar = 0.75;
}
color = mix(color, vec4(1.5 * color.rgb, 1.0), isInsideBar);
}
// Grayscale disabled nodes.
if (!uEnabled) {
float grayscale = dot(color.rgb, vec3(0.299, 0.587, 0.114));
grayscale = mix(0.1, 0.9, grayscale);
color.rgb = vec3(grayscale);
}
gl_FragColor = color;
}`,e=>{e.extensions.derivatives=!0,e.transparent=!0});st({FilterCircleMaterial:lf});function Bo(e){const{camera:t}=or(),r=a.useMemo(()=>new Oe,[]);return Ge(()=>{if(!e.objRef.current)return;r.copy(e.objRef.current.position),r.applyMatrix4(t.matrixWorldInverse);const o=Math.abs(r.z),s=e.defaultScale*o/e.defaultDistance;e.objRef.current.scale.set(s,s,s)}),n.jsx(n.Fragment,{})}function cf({scale:e}){return n.jsx(Fn,{transform:!0,distanceFactor:2,scale:[e!=null?e:1,e!=null?e:1,e!=null?e:1],position:[0,0,0],pointerEvents:"none",center:!0,style:{pointerEvents:"none"},children:n.jsxs("div",{className:"items-center",children:[n.jsx("svg",{className:"fill-current",height:54,width:54,style:{zIndex:-1,pointerEvents:"none"},children:n.jsx("circle",{r:54/2-2,cx:54/2,cy:54/2,fill:fe.lunaLightGray,stroke:fe.lunaLight,strokeWidth:2,opacity:.8})}),n.jsx("svg",{viewBox:"0 0 24 24",width:35.1,height:35.1,style:{position:"absolute",top:(54-35.1)/2,left:(54-35.1)/2,pointerEvents:"none"},children:n.jsx("path",{fill:fe.lunaLight,d:"M 12 1 C 8.6761905 1 6 3.6761905 6 7 L 6 8 C 4.9 8 4 8.9 4 10 L 4 20 C 4 21.1 4.9 22 6 22 L 18 22 C 19.1 22 20 21.1 20 20 L 20 10 C 20 8.9 19.1 8 18 8 L 18 7 C 18 3.6761905 15.32381 1 12 1 z M 12 3 C 14.27619 3 16 4.7238095 16 7 L 16 8 L 8 8 L 8 7 C 8 4.7238095 9.7238095 3 12 3 z M 12 13 C 13.1 13 14 13.9 14 15 C 14 16.1 13.1 17 12 17 C 10.9 17 10 16.1 10 15 C 10 13.9 10.9 13 12 13 z"})})]})})}function uf(e){const{node:t,position:r,dropZones:o,prevNodeId:s,prevNodePos:i,nextNodePos:l,setDraggedNodeId:c,setFocusedDropZone:u}=e,d=H(J=>J.selectedNodeId),h=H(J=>J.draggingNode),f=H(J=>J.draggingStream),p=H(J=>J.clearSelection),w=H(J=>J.selectNode),x=H(J=>J.setSelectedPosition),m=H(J=>J.setNodeControlsVisible),v=H(J=>J.setDraggingNode),b=H(J=>J.selectMainView),S=mt(J=>J.knobScrollMode),y=T(J=>J.pluginName===oe.BEAM),g=T(J=>J[`${t.type}Enabled`]),j=Jt.includes(t.type),N=Qt.includes(t.type),P=Bt.includes(t.type),L=Ht.includes(t.type),I=Gt.includes(t.type),C=cn.includes(t.type),M=lt(J=>L?!J.ownsVolt():P?!J.ownsTime():!1),R=a.useRef(),O=a.useRef(),_=a.useRef(),z=a.useRef(),U=a.useMemo(()=>({isMouseDown:!1,isMoving:!1,isDuplicating:!1,isTurningKnob:!1}),[]),[$,V]=a.useState(!1),[E,q]=a.useState(!1),[W,F]=a.useState(!1),Z=a.useRef(!1),[Y,me]=a.useState(!1);a.useEffect(()=>{document.body.style.cursor=$?"grabbing":Y?"pointer":"auto"},[Y,$]);const[Se,je]=a.useState(!1),ye=a.useRef(0),le=a.useRef(),Me=mt(J=>J.nodeScrolling),ve=a.useMemo(()=>new Oe(r.x,r.y,r.z),[]),K=d===t.id,{scale:ce}=Jn({scale:$?.7:K||Y||E?1.1:1,config:$?{duration:200,easing:sn.easeOutCubic}:{easing:sn.easeOutElastic,tension:1e3}}),{scale:re}=Jn({scale:W?.7:1,config:{duration:300,easing:sn.easeOutCubic}}),[te,ue]=a.useState(Date.now()),he=a.useMemo(()=>new Cs,[]),Q=a.useMemo(()=>new Oe,[]),Ne=a.useMemo(()=>new sr,[]),xe=a.useMemo(()=>new Oe,[]),ae=a.useMemo(()=>new Oe,[]),we=Wt(),Ae=En(we),Ce=a.useMemo(()=>Is(t.id,0,we),[t.id,Ae]),qe=a.useMemo(()=>Vi(Ce,we),[t.id,Ae]);let B=T(J=>qe.map(Ee=>J[`${Ee}Mute`]).includes(1));const G=a.useMemo(()=>we.getNodesWithType(A.join).flatMap(J=>{var Ee;return(Ee=J.streams)!=null?Ee:[]}).map(J=>J.id).filter(J=>!qe.includes(J)),[t.id,Ae]),pe=T(to(J=>G.map(Ee=>J[`${Ee}Solo`])));B=B||pe.includes(1),Ge(J=>{if(!y)return;me(!f&&!(h&&!U.isMoving)&&(Z.current||J.raycaster.intersectObject(O.current).length>0));const Ee=3;if($?(ve.x+=.5*(xe.x-ve.x),ve.y+=.5*(xe.y-ve.y),ve.z+=.5*(Ee-ve.z)):(ve.x+=.5*(r.x-ve.x),ve.y+=.5*(r.y-ve.y),ve.z+=.5*(r.z-ve.z)),R.current.position.copy(ve),W){const pt=z.current;pt.position.copy(xe),pt.position.z=Ee}Se&&Date.now()-ye.current>750&&(je(!1),le.current=void 0),($||W)&&(ae.copy(xe),ae.z=0,u(Sr(ae,o)))});const ke=a.useCallback(()=>{ae.copy(R.current.position),ae.z=0;const J=Sr(ae,o);(J==null?void 0:J.connectionIndex)!==void 0&&mu(t.id,J.node1,J.connectionIndex),U.isMoving=!1,V(!1),c(void 0),v(!1)},[R,o,t.id]),Pe=a.useCallback(()=>{ae.copy(z.current.position),ae.z=0;const J=Sr(ae,o);(J==null?void 0:J.connectionIndex)!==void 0&&bu(t.type,J.node1,J.connectionIndex),U.isDuplicating=!1,F(!1),v(!1)},[R,o,t.id]),[Ie,$e]=a.useState(!1),Xe=a.useCallback(J=>{y&&((J.ctrlKey||J.metaKey)&&$e(!Ie),J.stopPropagation())},[Ie]),De=a.useCallback(J=>{if(!y||J.altKey||J.shiftKey||J.ctrlKey||J.metaKey)return;let Ee=null;switch(t.type){case A.convA:Ee=ee.IRBrowserA;break;case A.convB:Ee=ee.IRBrowserB;break;case A.convC:Ee=ee.IRBrowserC;break;case A.filterA:Ee=ee.FilterPresetA;break;case A.filterB:Ee=ee.FilterPresetB;break;case A.filterC:Ee=ee.FilterPresetC;break;case A.filterD:Ee=ee.FilterPresetD;break;case A.grainA:Ee=ee.GrainPresetA;break;case A.grainB:Ee=ee.GrainPresetB;break;case A.grainC:Ee=ee.GrainPresetC;break;case A.timeA:Ee=ee.TimePresetA;break;case A.timeB:Ee=ee.TimePresetB;break;case A.timeC:Ee=ee.TimePresetC;break;case A.voltA:Ee=ee.VoltPresetA;break;case A.voltB:Ee=ee.VoltPresetB;break;case A.voltC:Ee=ee.VoltPresetC;break;case A.chorusA:Ee=ee.HazePresetA;break;case A.chorusB:Ee=ee.HazePresetB;break;case A.chorusC:Ee=ee.HazePresetC;break}b(Ee)},[]),Ve=a.useMemo(()=>ao(t),[t.type]),[et,rt,ot]=a.useMemo(()=>{const J=Pi().find(Ee=>Ee.paramId===Ve);return J?[J.min,J.max,J.skew]:[0,1,1]},[Ve]);return n.jsxs(n.Fragment,{children:[n.jsxs(Qn.group,{ref:R,scale:ce,children:[j&&n.jsx(vs,{id:t.id,prevId:s,pos:r,prevNodePos:i,nextNodePos:l,isDragging:$,isMuted:B,type:t.type,showDevUi:Ie,setShowDevUi:$e}),N&&n.jsx(hs,{type:t.type,prevId:s,isDragging:$,isMuted:B}),P&&n.jsx(xs,{type:t.type,prevId:s,isMuted:B}),L&&n.jsx(gs,{type:t.type,prevId:s,isDragging:$,isMuted:B}),I&&n.jsx(yo,{type:t.type,prevId:s,isDragging:$,isMuted:B}),C&&n.jsx(ys,{type:t.type,prevId:s,isMuted:B}),n.jsx(rf,{node:t,visible:K||Y||U.isMoving||U.isTurningKnob,labelOnly:U.isMoving,showKnobValue:U.isTurningKnob||Se,setMouseOverControls:J=>{Z.current=J}}),M&&Y&&n.jsx(cf,{}),n.jsxs("group",{ref:O,visible:!1,onClick:Xe,onDoubleClick:De,onPointerEnter:J=>{J.buttons>0||J.stopPropagation()},onPointerDown:J=>{J.stopPropagation(),y&&(J.target.setPointerCapture(J.pointerId),ue(Date.now()),Ne.set(0,0),Q.copy(J.point),he.setFromNormalAndCoplanarPoint(new Oe(0,0,1),J.point),U.isMouseDown=!0,J.shiftKey?(U.isTurningKnob=!0,q(!0),Ve&&Pt(Ve)):J.altKey&&df(t.type,we)&&(U.isDuplicating=!0,xe.copy(R.current.position),F(!0),v(!0),d!==t.id&&p()))},onPointerUp:J=>{J.stopPropagation(),y&&(J.target.releasePointerCapture(J.pointerId),!(U.isTurningKnob||U.isMoving)&&!J.altKey&&!J.ctrlKey&&!J.metaKey&&Date.now()-te<250&&setTimeout(()=>{w(t.id),x({x:J.clientX,y:J.clientY}),m(!0)},Math.max(0,te+150-Date.now())),U.isMoving?ke():U.isDuplicating&&Pe(),U.isMouseDown=!1,U.isTurningKnob=!1,U.isMoving=!1,U.isDuplicating=!1,le.current=void 0,E&&Ve&&It(Ve),q(!1))},onPointerMove:J=>{if(J.stopPropagation(),!!y){if(U.isMouseDown=U.isMouseDown&&J.buttons>0,!U.isMouseDown&&(U.isMoving||U.isTurningKnob||U.isDuplicating)){U.isMoving&&ke(),U.isDuplicating&&Pe(),U.isTurningKnob=!1,U.isMoving=!1,U.isDuplicating=!1,le.current=void 0,q(!1);return}if(U.isTurningKnob){const Ee=ao(t);Ee&&g&&Ha(-.003*J.movementY,le,Ee,et,rt,ot)}else U.isMoving||U.isDuplicating?(xe.sub(Q),J.ray.intersectPlane(he,Q),xe.add(Q)):U.isMouseDown&&!J.altKey&&(Ne.x+=J.movementX,Ne.y+=J.movementY,Ne.length()>10&&(U.isMoving=!0,xe.copy(R.current.position),V(!0),c(t.id),v(!0),d!==t.id&&p()))}},onWheel:J=>{if(!g||Me===Nn.Disabled||Me===Nn.Shift&&!J.shiftKey||S===on.Off)return;let Ee=J.deltaY;"wheelDeltaY"in J&&(Ee=J.wheelDeltaY/6),Ee*=-2e-4,S===on.Down&&(Ee*=-1);const Ze=ao(t);y&&Ze&&(Ha(Ee,le,Ze,et,rt,ot),je(!0),ye.current=Date.now())},children:[n.jsx("mesh",{name:`${t.type}ColliderSphere`,children:n.jsx("sphereGeometry",{args:[Y||K?.8:.6,5,5]})}),n.jsxs("mesh",{name:`${t.type}ColliderCylinder`,ref:_,position:[0,-.7,0],rotation:[0,0,Math.PI/2],children:[n.jsx(Bo,{objRef:_,defaultDistance:100,defaultScale:Y||K?1:0}),n.jsx("cylinderGeometry",{args:[.2,.2,1.7,8,1]})]})]})]}),n.jsx(Qn.group,{ref:z,scale:re,children:W&&n.jsxs(n.Fragment,{children:[j&&n.jsx(vs,{type:t.type}),N&&n.jsx(hs,{type:t.type}),P&&n.jsx(xs,{type:t.type}),L&&n.jsx(gs,{type:t.type}),I&&n.jsx(yo,{type:t.type}),C&&n.jsx(ys,{type:t.type})]})})]})}function Ha(e,t,r,o,s,i){t.current===void 0&&(t.current=Fe.getState()[r]);const l=t.current;let c=Math.pow((l-o)/(s-o),i||1);c+=e,c=Re(c,0,1),c=Math.pow(c,1/(i||1));const u=o+c*(s-o);t.current=u,ut(r,u)}function ao(e){if(Jt.includes(e.type))return`${e.type}Mix`;if(Qt.includes(e.type))return`${e.type}Mix`;if(Bt.includes(e.type))return`${e.type}Mix`;if(Ht.includes(e.type))return`${e.type}Depth`;if(Gt.includes(e.type))return`${e.type}Mix`;if(cn.includes(e.type))return`${e.type}Cutoff`}function df(e,t){const r=new Set(t.nodes.map(s=>s.type)),o=[Jt,Qt,Bt,Ht,Gt,cn];for(const s of o)if(s.includes(e)&&s.find(l=>!r.has(l))!==void 0)return!0;return!1}function zl({position:e,radius:t,isFocused:r}){const o=a.useMemo(()=>{const i=[];for(let u=0;u<=50;u++){const d=u/50*(Math.PI*2),h=t*Math.sin(d),f=t*Math.cos(d);i.push(h,f,0)}const c=new dc;return c.setAttribute("position",new fc(i,3)),c},[]),{scale:s}=Jn({scale:r?1.1:1,config:{duration:100,easing:r?sn.easeOutCubic:sn.easeInCubic}});return n.jsx(Qn.line,{onUpdate:i=>i.computeLineDistances(),geometry:o,position:e,scale:s,children:n.jsx("lineDashedMaterial",{color:r?16777215:11974326,dashSize:.05,gapSize:.05})})}function ff({start:e,end:t,isFocused:r,isFocusedBefore:o,isFocusedAfter:s,isSelected:i,isSelectedBefore:l,isSelectedAfter:c,isSelectedByMixer:u,mute:d,muteBefore:h,muteAfter:f,startAlpha:p,endAlpha:w,nodeId:x,nodeIdNext:m}){const v=mt(L=>L.graphicsQuality),b=a.useRef();a.useLayoutEffect(()=>{const L=b.current,I=L.uniforms;I.uStartPos.value=e,I.uEndPos.value=t,I.uStartAlpha.value=p,I.uEndAlpha.value=w,I.uIsFocused.value=r,I.uIsFocusedBefore.value=o,I.uIsFocusedAfter.value=s,I.uMute.value=d,I.uMuteBefore.value=h,I.uMuteAfter.value=f,L.side=t.x>e.x?xi:Ao});const S=a.useRef(0),y=a.useRef(0),g=a.useRef(0),j=a.useRef(0);Ge(()=>{S.current=se(S.current,i?1:0,.2),y.current=se(y.current,l?1:0,.2),g.current=se(g.current,c?1:0,.2),j.current=se(j.current,u?1:0,.2),b.current.uniforms.uIsSelected.value=S.current,b.current.uniforms.uIsSelectedBefore.value=y.current,b.current.uniforms.uIsSelectedAfter.value=g.current,b.current.uniforms.uIsSelectedByMixer.value=j.current;let I=Tt(x),C=I;m&&(C=Tt(m)),b.current.uniforms.uSolo.value=!1,b.current.uniforms.uVolume.value=Math.pow(I,2.2),b.current.uniforms.uVolumeNext.value=Math.pow(C,2.2),b.current.uniforms.uTime.value=.00101*Date.now()%1e5});let N=Math.max(10,Math.ceil(15*Math.max(Math.abs(t.x-e.x),Math.abs(t.y-e.y))));v===ct.Low&&(N*=.5);const P=bt(St,"./streamNoise.png");return P.wrapS=ht,P.wrapT=ht,n.jsx("group",{children:n.jsxs("mesh",{frustumCulled:!1,children:[n.jsx("planeGeometry",{args:[1,1,N,1]}),n.jsx("streamMaterial",{ref:b,uNoiseTexture:P})]})})}function mf({start:e,end:t}){const r=a.useRef();Ge(()=>{const s=r.current,i=s.uniforms;i.uStartPos.value=e,i.uEndPos.value=t,s.side=t.x>e.x?xi:Ao});const o=40;return n.jsx("group",{children:n.jsxs("mesh",{children:[n.jsx("planeGeometry",{args:[1,1,o,1]}),n.jsx("draggedStreamMaterial",{ref:r})]})})}const pf=at({uTime:0,uNoiseTexture:null,uStartPos:new Oe(0,0,0),uEndPos:new Oe(0,0,0),uStartAlpha:1,uEndAlpha:1,uVolume:1,uVolumeNext:1,uIsFocused:!1,uIsFocusedBefore:!1,uIsFocusedAfter:!1,uIsSelected:0,uIsSelectedBefore:0,uIsSelectedAfter:0,uIsSelectedByMixer:0,uMute:!1,uMuteBefore:!1,uMuteAfter:!1,uSolo:!1},`
precision mediump float;
varying vec2 vUv;
varying vec3 vPos;
varying float vCurveLength;
uniform vec3 uStartPos;
uniform vec3 uEndPos;
uniform float uTime;
void main () {
vUv = uv;
float t = uv.x;
vec3 posWorldSpace = mix(uStartPos, uEndPos, t);
posWorldSpace.y = mix(uStartPos.y, uEndPos.y, smoothstep(0.0, 1.0, t));
float slope = -6.0 * (t - 1.0) * t; // derivative of smoothstep
float width = uEndPos.x - uStartPos.x;
float height = uEndPos.y - uStartPos.y;
slope = -1.0 * slope * height / width;
vec2 heightDirection = normalize(vec2(slope, 1.0));
vPos = posWorldSpace;
vCurveLength = distance(uStartPos, uEndPos);
posWorldSpace.xy += 0.35 * (vUv.y - 0.5) * heightDirection;
gl_Position = projectionMatrix * modelViewMatrix * vec4(posWorldSpace, 1.0);
}`,`
precision mediump float;
uniform float uStartAlpha;
uniform float uEndAlpha;
uniform float uTime;
uniform float uVolume;
uniform float uVolumeNext;
uniform bool uIsFocused;
uniform bool uIsFocusedBefore;
uniform bool uIsFocusedAfter;
uniform float uIsSelected;
uniform float uIsSelectedBefore;
uniform float uIsSelectedAfter;
uniform float uIsSelectedByMixer;
uniform bool uMute;
uniform bool uMuteBefore;
uniform bool uMuteAfter;
uniform bool uSolo;
uniform sampler2D uNoiseTexture;
varying vec3 vPos;
varying vec2 vUv;
varying float vCurveLength;
float getStream(float offset, float strength, float thickness, float extraGlow, bool lineOnly) {
vec2 uv = vUv;
float alpha = 0.0;
// Blend to uVolumeNext at the end of the curve.
float blendNext = clamp((uv.x - 0.8)/(1.0 - 0.8), 0., 1.);
float volume = mix(uVolume, uVolumeNext, blendNext * blendNext);
if (!lineOnly) {
// Have a little non-zero distortion at 0.
float zeroIntensity = 0.12;
// Step up from 0.1 to 0.25 when there is any amount of volume being played.
float minNonZeroIntensity = 0.35;
volume = mix(
mix(zeroIntensity, 1.0, volume),
mix(minNonZeroIntensity, 1.0, volume),
smoothstep(0.0, 0.05, volume));
// Distort y position by noise.
float noiseFreq = 0.10;
float noiseSpeed = 0.16;
float noiseTranslationSpeed = 0.22;
float noiseAmp = 0.8 * volume;
uv.y += noiseAmp * (-0.25 + texture2D(uNoiseTexture, vec2(noiseFreq * vPos.x - noiseTranslationSpeed * uTime, noiseSpeed * uTime + offset)).r);
// Bloom.
alpha = 1.0 - abs(2.0 * (uv.y - 0.5));
alpha *= alpha * alpha;
alpha *= 0.5 * strength * (mix(0.15, 0.75, volume * volume) + mix(0.2, 0.8, volume) * extraGlow);
}
// Solid line.
float adjustedThickness = thickness * strength * mix(0.5, 1.5, volume);
float fade = 1.0 * abs(dFdy(uv.y));
float lineAlpha = strength;
alpha = mix(alpha, lineAlpha, smoothstep(adjustedThickness + fade, adjustedThickness, abs(uv.y - 0.5)));
return alpha;
}
void main() {
float glowFreq = 0.04;
float glowSpeed = 0.14;
float glowIntensity = 2.2;
float glowCutoff = 0.22;
float glow = texture2D(uNoiseTexture, vec2(glowFreq * vPos.x - glowSpeed * uTime, 0.)).r;
glow = glowIntensity * max(0., glow - glowCutoff);
float thickness = 0.007;
// Make the stream thicker if the mouse is hovering over it.
if (uIsFocused) {
float focused = 1.0;
float edgeTransitionLength = min(0.5, 0.5 / vCurveLength);
if (!uIsFocusedBefore) {
focused *= smoothstep(0.0, edgeTransitionLength, vUv.x);
}
if (!uIsFocusedAfter) {
focused *= 1.0 - smoothstep(1.0 - edgeTransitionLength, 1.0, vUv.x);
}
thickness *= mix(1.0, 8.0, focused);
}
vec3 color = vec3(0.0);
color += getStream(0.0, 0.8, thickness, glow, false) * vec3(1.);
color += getStream(0.01, 0.3, thickness, glow, false) * vec3(1.0, 1.0, 0.9);
color += getStream(0.02, 0.2, thickness, glow, false) * vec3(1.0, 0.85, 0.85);
color += getStream(0.04, 0.4, thickness, glow, false) * vec3(1.0, 0.9, 0.7);
color += getStream(0.5, 0.7, thickness, glow, false) * vec3(0.6, 0.6, 1.);
color += getStream(0.52, 0.3, thickness, glow, false) * vec3(0.7, 0.6, 1.);
color += getStream(0.0, 0.3, thickness, 0.0, true) * vec3(1.);
// Highlight selected curves.
if (uIsSelected > 0.001) {
float selected = 1.0;
// Fade start/end of curve unless it is also selected before/after.
float edgeTransitionLength = min(0.2, 0.2 / vCurveLength);
selected *= mix(smoothstep(0.0, edgeTransitionLength, vUv.x), 1.0, uIsSelectedBefore);
selected *= mix(1.0 - smoothstep(1.0 - edgeTransitionLength, 1.0, vUv.x), 1.0, uIsSelectedAfter);
float selectionWidth = mix(0.25, 0.3, uIsSelectedByMixer);
selected = selected * smoothstep(selectionWidth, selectionWidth - 0.02, abs(vUv.y - 0.5));
vec3 selectionColor = mix(vec3(0.2), vec3(0.3), uIsSelectedByMixer);
color += uIsSelected * selected * selectionColor;
}
// Fade the start/end of the curve so overlapping streams blend correctly.
float edgeTransitionLength = min(0.5, 0.5 / vCurveLength);
color *= mix(uStartAlpha, 1.0, smoothstep(0.0, edgeTransitionLength, vUv.x));
color *= mix(1.0, uEndAlpha, smoothstep(1.0 - edgeTransitionLength, 1.0, vUv.x));
// Blend the start and end of the curve depending on whether neighboring
// streams are muted.
float muteAlpha = 0.2;
float startAlpha = mix(
uMuteBefore ? muteAlpha : 1.0,
uMute ? muteAlpha : 1.0,
smoothstep(0.0, edgeTransitionLength, vUv.x));
float endAlpha = mix(
uMute ? muteAlpha : 1.0,
uMuteAfter ? muteAlpha : 1.0,
smoothstep(1.0 - edgeTransitionLength, 1.0, vUv.x));
color *= uMute ? max(startAlpha, endAlpha) : min(startAlpha, endAlpha);
color = clamp(color, 0.0, 1.0);
gl_FragColor = vec4(color, 1.0);
}`,e=>{e.extensions.derivatives=!0,e.transparent=!0,e.blending=wt,e.depthWrite=!1});st({StreamMaterial:pf});const hf=at({uStartPos:new Oe(0,0,0),uEndPos:new Oe(0,0,0)},`
precision mediump float;
uniform vec3 uStartPos;
uniform vec3 uEndPos;
void main () {
float t = uv.x;
vec3 posWorldSpace = mix(uStartPos, uEndPos, t);
posWorldSpace.y = mix(uStartPos.y, uEndPos.y, smoothstep(0.0, 1.0, t));
float slope = -6.0 * (t - 1.0) * t; // derivative of smoothstep
// Fix overlapping polygons for near-verticle stream curves.
slope = mix(1.5, slope, clamp(abs(uStartPos.x - uEndPos.x) / abs(uStartPos.y - uEndPos.y), 0., 1.));
float width = uEndPos.x - uStartPos.x;
float height = uEndPos.y - uStartPos.y;
slope = -1.0 * slope * height / width;
vec2 heightDirection = normalize(vec2(slope, 1.0));
posWorldSpace.xy += 0.02 * (uv.y - 0.5) * heightDirection;
gl_Position = projectionMatrix * modelViewMatrix * vec4(posWorldSpace, 1.0);
}`,`
precision mediump float;
void main() {
vec3 color = vec3(0.5);
gl_FragColor = vec4(color, 1.0);
}`,e=>{e.transparent=!0,e.blending=wt,e.depthWrite=!1});st({DraggedStreamMaterial:hf});function vf({id1:e,x1:t,y1:r,id2:o,x2:s,y2:i,connectionIndex:l,displayGraph:c,focusedBranch:u,allowInteraction:d,setFocusedBranch:h}){var Se,je,ye;const f=Wt(),p=H(le=>le.selectStream),w=H(le=>le.setSelectedPosition),x=H(le=>le.setNodeControlsVisible),m=H(le=>le.selectedStreamId),v=H(le=>le.selectedMixerStreamId),b=T(le=>le.pluginName===oe.BEAM),S=f.getNode(e),y=f.getNode(o),g=En(f),j=a.useMemo(()=>Is(e,l,f),[e,o,g]),N=a.useMemo(()=>Vi(j,f),[e,o,g]),P=T(to(le=>N.map(Me=>le[`${Me}Mute`]))),L=T(to(le=>N.map(Me=>le[`${Me}Solo`])));let I=P.includes(1);const C=L.includes(1);let M=P.find((le,Me)=>le&&Me>0)!==void 0;const R=L.find((le,Me)=>le&&Me>0)!==void 0,O=a.useMemo(()=>f.getNodesWithType(A.join).flatMap(le=>{var Me;return(Me=le.streams)!=null?Me:[]}).map(le=>le.id).filter(le=>!N.includes(le)),[e,o,g]),_=T(to(le=>O.map(Me=>le[`${Me}Solo`])));I=I||_.includes(1),M=M||_.includes(1);let z=!1,U=!1,$=!1;u&&d&&(z=Ko(e,l,u,f),U=z&&e!==u.startId,$=z&&((Se=y==null?void 0:y.streams)==null?void 0:Se.find(le=>le.id===u.streamId))===void 0);let V=!1,E=!1,q=!1;if(m!==void 0){const le=bs(m,f);V=Ko(e,l,le,f),E=V&&e!==le.startId,q=V&&((je=y==null?void 0:y.streams)==null?void 0:je.find(Me=>Me.id===le.streamId))===void 0}if(v!==void 0){const le=bs(v,f);V=Ko(e,l,le,f),E=V&&e!==le.startId,q=V&&((ye=y==null?void 0:y.streams)==null?void 0:ye.find(Me=>Me.id===le.streamId))===void 0}const W=a.useMemo(()=>{if(S.type===A.branch&&y.type===A.join&&l!==void 0)return Os(e,o,l,c)},[g]),F=a.useMemo(()=>W?[{p1:new Oe,p2:W},{p1:W,p2:new Oe}]:[{p1:new Oe,p2:new Oe}],[g]);F[0].p1.x=t,F[0].p1.y=r,F[F.length-1].p2.x=s,F[F.length-1].p2.y=i;const Z=a.useMemo(()=>(S==null?void 0:S.type)===A.branch?1/S.connections.length:S===void 0?0:1,[e,g]),Y=a.useMemo(()=>(y==null?void 0:y.type)===A.join&&y.streams?1/y.streams.length:S===void 0?0:1,[e,g]),me=.4*(F[0].p2.x-F[0].p1.x);return n.jsx(n.Fragment,{children:n.jsxs("group",{children:[F.map((le,Me)=>{let ve=Me===0?Z:1,K=Me===F.length-1?Y:1;return n.jsx(ff,{start:le.p1,end:le.p2,isFocused:z,isFocusedBefore:U||Me>0,isFocusedAfter:$||Me<F.length-1,isSelected:V,isSelectedBefore:E||Me>0,isSelectedAfter:q||Me<F.length-1,isSelectedByMixer:v!==void 0,mute:I,muteBefore:M||I&&(Me>0||(S==null?void 0:S.type)!==A.branch)||C&&!R&&Me===0&&(S==null?void 0:S.type)===A.branch,muteAfter:M||I&&(Me<F.length-1||(y==null?void 0:y.type)!==A.join)||C&&!R&&Me===F.length-1&&(y==null?void 0:y.type)===A.join,startAlpha:ve,endAlpha:K,nodeId:e,nodeIdNext:o&&y.type===A.join&&Me===F.length-1?o:void 0},`line-${Me}`)}),j&&F.map((le,Me)=>n.jsx(mc,{name:"streamCollider",start:le.p1,end:le.p2,midA:[le.p1.x+me,le.p1.y,0],midB:[le.p2.x-me,le.p2.y,0],lineWidth:20,color:"blue",visible:!1,onClick:ve=>{b&&j&&ve.delta<10&&(p(j.streamId),w({x:ve.clientX,y:ve.clientY}),x(!0))},onPointerEnter:()=>{b&&d&&(document.body.style.cursor="pointer",h(j))},onPointerMove:ve=>{b&&d&&(document.body.style.cursor="pointer",h(j))},onPointerLeave:()=>{b&&(d&&(document.body.style.cursor="auto"),u&&u.startId===j.startId&&u.connectionIndex===j.connectionIndex&&h(void 0))}},`line-collider-${Me}`))]})})}function xf({x1:e,y1:t,x2Ref:r,y2Ref:o}){const s=a.useMemo(()=>new Oe,[]),i=a.useMemo(()=>[{p1:new Oe,p2:s},{p1:s,p2:new Oe}],[]);return Ge(()=>{const l=r.current,c=o.current;i[0].p1.x=e,i[0].p1.y=t,i[i.length-1].p2.x=l,i[i.length-1].p2.y=c,s.x=.5*(e+l),s.y=.5*(t+c);const u=.3,d=2;if(s.y=Math.min(t,c)-Math.min(d,u*Math.abs(l-e)),Math.abs(l-e)<Math.abs(c-t))s.x=l,s.y=c;else{const h=Math.abs(c-t)/Math.abs(l-e);s.x=se(s.x,c>t?e:l,Math.pow(h,2)),s.y=se(s.y,c>t?t:c,Math.pow(h,1))}}),n.jsx(n.Fragment,{children:i.map((l,c)=>n.jsx(mf,{start:l.p1,end:l.p2},`line-${c}`))})}function Ko(e,t,r,o){let s=o.getNode(e);if(!s)return!1;let i=0;for(;r.startId&&s.id!==r.startId&&s.type!==A.start;){s.type===A.join?i++:i>0&&s.type===A.branch&&i--;const l=s.id;if(s=o.getPreviousNodes(s.id)[0],!s)return!1;t=s.connections.indexOf(l)}return i===0&&s.id===r.startId&&t===r.connectionIndex}function gf({branchPt:e,streamDrag:t,setStreamDrag:r,selectedJoinPt:o,setSelectedJoinPt:s,showOnHoverOnly:i}){const l=H(g=>g.clearSelection),c=H(g=>g.setDraggingStream),u=H(g=>g.toggleAddNodesPanel),d=H(g=>g.showAddNodesPanel),h=T(g=>g.pluginName===oe.BEAM),f=a.useRef(null),p=a.useMemo(()=>{const g=new Cs;return g.setFromNormalAndCoplanarPoint(new Oe(0,0,1),new Oe(0,0,0)),g},[]),w=a.useMemo(()=>new Oe,[]),[x,m]=a.useState(!1),[v,b]=a.useState(!1),S=.35;let y=1;return t?y=t.startPt===e?1:0:v?y=1.15:i&&!x&&(y=0),n.jsxs("group",{position:e.pos,ref:f,children:[n.jsx(Bo,{objRef:f,defaultDistance:60,defaultScale:1}),n.jsx(Fn,{center:!0,style:{pointerEvents:"none",transition:"all 0.15s",opacity:y>0?1:0,transform:"translate(-50%, -50%)"},children:n.jsx("div",{style:{transition:"all 0.15s",transform:`scale(${y})`},children:n.jsxs("svg",{height:"36",width:"36",children:[n.jsx("circle",{r:"14",cx:"18",cy:"18",stroke:"#aaaaaa",strokeWidth:"1",fill:"#eeeeee"}),n.jsxs("g",{id:"svg_9",transform:"scale(0.39) translate(12,14)",children:[n.jsx("path",{stroke:"#636363",fill:"#636363",strokeWidth:"3",d:"m47.88977,36.89045l10.74364,6.13922l-10.74364,6.13921l0,-12.27843l0,-0.00001z",id:"svg_4"}),n.jsx("line",{stroke:"#636363",strokeWidth:"4",fill:"none",x1:"5.36659",y1:"21.81099",x2:"54.45184",y2:"21.81099",id:"svg_2"}),n.jsx("path",{stroke:"#636363",strokeWidth:"4",id:"svg_1",d:"m12.42587,21.83951c24.80989,0 10.75569,21.28745 35.39181,21.28745",fill:"none"}),n.jsx("path",{stroke:"#636363",fill:"#636363",strokeWidth:"3",d:"m47.88977,15.59157l10.74364,6.13922l-10.74364,6.13921l0,-12.27843l0,0z",id:"svg_8"})]})]})})}),n.jsxs("mesh",{visible:!1,position:[0,0,.01],onPointerEnter:()=>{t||!h||m(!0)},onPointerLeave:g=>{t||!h||(g.stopPropagation(),m(!1),b(!1),document.body.style.cursor="auto")},onPointerDown:g=>{!v||!h||(g.stopPropagation(),g.target.setPointerCapture(g.pointerId),r({startPt:e,endX:g.point.x,endY:g.point.y}),s(void 0),c(!0))},onPointerMove:g=>{if(h){if(t&&g.buttons>0&&(g.ray.intersectPlane(p,w),t.endX=w.x,t.endY=w.y),t&&g.buttons===0){r(void 0),s(void 0),c(!1),m(!1),b(!1);return}t||g.buttons>0||(f.current&&g.point.distanceTo(e.pos)<.15*f.current.scale.x?(g.stopPropagation(),b(!0),document.body.style.cursor="move"):v&&(b(!1),document.body.style.cursor="auto"))}},onPointerUp:()=>{h&&(t==null?void 0:t.startPt.node1)===e.node1&&(t==null?void 0:t.startPt.connectionIndex)===e.connectionIndex&&(r(void 0),o&&(l(),o.connectionIndex!==void 0?Nu(e.node1,e.connectionIndex,o.node1,o.connectionIndex):Cu(e.node1,o.node1),s(void 0)),c(!1),m(!1),b(!1))},onClick:()=>{h&&(r(void 0),s(void 0),c(!1),m(!1),b(!1),l(),d&&u())},children:[n.jsx("circleGeometry",{attach:"geometry",args:[S,24]}),n.jsx("meshBasicMaterial",{attach:"material"})]})]})}function wf({colliderRadius:e,joinPt:t,selectedJoinPt:r,setSelectedJoinPt:o}){const[s,i]=a.useState(!1);setTimeout(()=>{i(!0)},40);const l=a.useRef(null),c=s?yf(t,r)?1.3:1.2:0;return n.jsxs("group",{ref:l,position:new Oe(0,0,.05).add(t.pos),children:[n.jsx(Bo,{objRef:l,defaultDistance:60,defaultScale:1}),n.jsx(Fn,{center:!0,style:{pointerEvents:"none",transition:"all 0.15s ease-out",transform:"translate(-50%, -50%)"},children:n.jsx("div",{style:{transition:"all 0.15s",transform:`scale(${c})`},children:n.jsxs("svg",{height:"36",width:"36",children:[n.jsx("circle",{r:"14",cx:"18",cy:"18",stroke:"#aaaaaa",strokeWidth:"1",fill:"#ffffff"}),n.jsxs("g",{id:"svg_9",transform:"scale(0.35) translate(20,17)",children:[n.jsx("line",{stroke:"#636363",strokeWidth:"4.5",fill:"none",x1:"5.33764",y1:"24.39588",x2:"44.98633",y2:"24.39588",id:"svg_2"}),n.jsx("ellipse",{ry:"5.81961",rx:"5.81961",id:"svg_4",cy:"24.22892",cx:"51.42603",strokeWidth:"4.5",stroke:"#636363",fill:"none"}),n.jsx("path",{id:"svg_6",d:"m5.77076,50.04833c21.14858,0.16393 13.56486,-25.7568 37.38111,-25.64653",opacity:"NaN",strokeWidth:"4.5",stroke:"#636363",fill:"none"})]})]})})}),n.jsx("mesh",{visible:!1,onPointerOver:()=>o(t),onPointerOut:()=>o(void 0),children:n.jsx("circleGeometry",{attach:"geometry",args:[e,24]})})]})}function yf(e,t){return e.node1===(t==null?void 0:t.node1)&&e.connectionIndex===t.connectionIndex}function bf({streamId:e,pos:t}){const r=a.useRef(),[o,s]=a.useState(!1),i=.12,l=o?1.15:1;return n.jsxs("group",{position:t,ref:r,children:[n.jsx(Bo,{objRef:r,defaultDistance:60,defaultScale:1}),n.jsx(Fn,{center:!0,style:{pointerEvents:"none",transition:"all 0.15s",opacity:l>0?1:0,transform:"translate(-50%, -50%)"},children:n.jsx("div",{style:{transition:"all 0.15s",transform:`scale(${l})`},children:n.jsxs("svg",{height:"36",width:"36",children:[n.jsx("circle",{r:"14",cx:"18",cy:"18",stroke:"#aaaaaa",strokeWidth:"1",fill:"#eeeeee"}),n.jsx("g",{id:"svg_9",transform:"scale(1.5) translate(6, 5.5)",children:n.jsx("path",{fill:"#444444",d:"M4.89844 1.25C4.78125 1.25 4.66406 1.32031 4.59375 1.4375L4.21875 2H7.75781L7.38281 1.4375C7.3125 1.32031 7.19531 1.25 7.07812 1.25H4.89844ZM8.625 2H9.72656H10.5H10.875C11.0625 2 11.25 2.1875 11.25 2.375C11.25 2.58594 11.0625 2.75 10.875 2.75H10.4297L9.84375 11.1172C9.77344 11.9141 9.14062 12.5 8.34375 12.5H3.63281C2.85938 12.5 2.20312 11.9141 2.13281 11.1172L1.54688 2.75H1.125C0.914062 2.75 0.75 2.58594 0.75 2.375C0.75 2.1875 0.914062 2 1.125 2H1.5H2.25H3.35156L3.96094 1.03906C4.14844 0.710938 4.52344 0.5 4.89844 0.5H7.07812C7.45312 0.5 7.82812 0.710938 8.03906 1.03906L8.625 2ZM9.67969 2.75H2.29688L2.88281 11.0703C2.90625 11.4453 3.23438 11.75 3.63281 11.75H8.34375C8.74219 11.75 9.07031 11.4453 9.09375 11.0703L9.67969 2.75Z"})})]})})}),n.jsxs("mesh",{visible:!1,position:[0,0,.01],onPointerEnter:c=>{c.stopPropagation(),s(!0),document.body.style.cursor="pointer"},onPointerLeave:c=>{c.stopPropagation(),s(!1),document.body.style.cursor="auto"},onClick:c=>{c.stopPropagation(),ps(e),kt.getState().clearSelection()},children:[n.jsx("circleGeometry",{attach:"geometry",args:[i,24]}),n.jsx("meshBasicMaterial",{attach:"material"})]})]})}const Ga=7,Sf=4,Cf=3,Nf=({displayGraph:e,allowStreamInteraction:t})=>{const r=Wt(),o=H(g=>g.selectedStreamId),s=H(g=>g.selectedMixerStreamId),[i,l]=a.useState(),[c,u]=a.useState(),[d,h]=a.useState(),f=En(r),p=a.useMemo(()=>jf(e,r,i==null?void 0:i.startPt),[i==null?void 0:i.startPt.node1]),w=a.useMemo(()=>Wa(e,r,Qe.all),[f]),x=a.useMemo(()=>Wa(e,r,o),[o,f]),m=a.useMemo(()=>Mf(e,r,o),[o,f]),{camera:v}=or(),b=a.useMemo(()=>{const g=v,j=e.maxX-e.minX,N=e.maxY-e.minY+1,P=Math.max(el*j,tl*N),L=Math.tan(g.fov*Math.PI/180)*P;return g.aspect*L},[f]),S=a.useRef(0),y=a.useRef(0);return a.useEffect(()=>{S.current=(i==null?void 0:i.endX)||0,y.current=(i==null?void 0:i.endY)||0},[i===void 0]),Ge(()=>{if(!i)return;const g=c?c.pos.x:i.endX,j=c?c.pos.y:i.endY;S.current=se(S.current,g,.25),y.current=se(y.current,j,.25)}),n.jsxs("group",{children:[r&&r.nodes.map(g=>{const j=e.get(g.id);return j!==void 0&&!Number.isNaN(j.pos.x)&&n.jsx("group",{children:g.connections.map((N,P)=>{const L=e.get(N);let I=j.pos.x,C=L.pos.x;return g.type===A.start&&(I=Math.min(I,-.5*b)-4),L.node.type===A.end&&(C=Math.max(C,.5*b)+4),L!==void 0&&!Number.isNaN(L.pos.x)&&n.jsx(vf,{id1:g.id,id2:N,connectionIndex:P,x1:I,y1:j.pos.y,x2:C,y2:L.pos.y,displayGraph:e,focusedBranch:d,setFocusedBranch:h,allowInteraction:t&&i===void 0},`edge-${g.id}[${P}]-${N}`)})},`edges-${g.id}`)}),t&&s===void 0&&(o?x:w).filter(g=>i?i.startPt.node1===g.node1||i.startPt.connectionIndex===g.connectionIndex:!0).map(g=>{var j;return n.jsx(gf,{nodeId:g.node1,branchPt:g,streamDrag:i,setStreamDrag:l,selectedJoinPt:c,setSelectedJoinPt:u,showOnHoverOnly:o===void 0},`branchZone-${g.node1}[${(j=g.connectionIndex)!=null?j:""}]`)}),o&&s===void 0&&m&&!i&&n.jsx(bf,{pos:m,streamId:o}),t&&p.map((g,j)=>n.jsx(wf,{colliderRadius:(i==null?void 0:i.startPt.connectionIndex)!==void 0&&j===0?.2:.5,joinPt:g,selectedJoinPt:c,setSelectedJoinPt:u},`joinZone-${g.node1}[${j}]`)),t&&i&&n.jsx(xf,{x1:i.startPt.pos.x,y1:i.startPt.pos.y,x2Ref:S,y2Ref:y})]})};function bs(e,t){if(e===Qe.all)return{streamId:e,startId:t.getStart().id,connectionIndex:0};const r=t.nodes.find(l=>{var c;return(c=l.streams)==null?void 0:c.find(u=>u.id===e)});if(!r)return;const o=r.streams.map(l=>l.id).indexOf(e),s=t.getPreviousNodes(r.id)[0];let i;if(_t(s.id,!1,(l,c)=>l.type===A.branch&&c===0?(i=l,!1):c>=0,t),!!i)return{streamId:e,startId:i.id,connectionIndex:o}}function Mf(e,t,r){if(r===void 0)return;const o=t.nodes.find(i=>{var l;return(l=i.streams)==null?void 0:l.map(c=>c.id).includes(r)});if(!o)return;const s=new Oe;return s.copy(e.get(o.id).pos),s}function Wa(e,t,r){if(r===void 0)return[];const o=bs(r,t);if(!o)return[];const s=t.getNode(o.startId),i=s.connections[o.connectionIndex],l=Ff(o.startId,t),c=t.getNodesWithType(A.branch),u=c.map(f=>f.connections.length).reduce((f,p)=>f+p,0);if(u>=Ga)return[];const d=[];s.type===A.branch&&d.push(xr(e,o.startId));const h=Ga-u>=2&&c.length<Sf;return h&&d.push(xr(e,o.startId,i,o.connectionIndex)),_t(i,!0,(f,p)=>{if(f.type===A.join&&p===0||f.type===A.end)return!1;f.type===A.branch&&d.push(xr(e,f.id));let w=l+p;return f.type===A.branch?w++:f.type===A.join&&w--,w>Cf-1||h&&d.push(...f.connections.map((x,m)=>xr(e,f.id,x,m))),!0},t),d}function jf(e,t,r){if(!r)return[];if(r.connectionIndex===void 0){const h=t.getNextNodes(r.node1)[0],f=Mu(h.id,t);if(f===void 0)return[];const p=e.get(f);return[{node1:f,pos:p.pos}]}const o=[],i=t.getNode(r.node1).connections[r.connectionIndex],l=e.get(r.node1),c=e.get(i),u=Math.max(.25,.35/c.pos.distanceTo(r.pos)),d=new Oe(se(l.pos.x,c.pos.x,.5*u+.5),se(l.pos.y,c.pos.y,vi(.5*u+.5,0,1)),0);return r.pos.y<l.pos.y==r.pos.y<c.pos.y&&(d.x=se(r.pos.x,c.pos.x,.5),d.y=se(r.pos.y,c.pos.y,.5)),o.push({node1:r.node1,connectionIndex:r.connectionIndex,pos:d}),_t(i,!0,(h,f)=>h.type===A.join&&f===0?!1:((h.type===A.join?f===1:f===0)&&h.type!==A.branch&&o.push(...h.connections.map((x,m)=>xr(e,h.id,x,m))),!0),t),o}function xr(e,t,r,o){return r===void 0||o===void 0?{node1:t,connectionIndex:void 0,pos:e.get(t).pos}:{node1:t,connectionIndex:o,pos:Os(t,r,o,e)}}function Ff(e,t){let r=0,o=t.getPreviousNodes(e);for(;o.length;)o[0].type===A.branch&&r++,o[0].type===A.join&&r--,o=t.getPreviousNodes(o[0].id);return r}const Af=({displayGraph:e,focusedDropZone:t,setFocusedDropZone:r})=>{const o=Wt(),[s,i]=a.useState(),l=H(p=>p.draggingNode),c=En(o),u=a.useMemo(()=>Ki(e,s),[s,c]),d=a.useMemo(()=>{const p={};for(const w of o.nodes)for(const x of w.connections)p[x]=w.id;return p},[c]),h=a.useRef();Ge(()=>{});const f=a.useMemo(()=>[A.start,A.end,A.branch,A.join],[]);return n.jsxs("group",{ref:h,children:[o&&o.nodes.filter(p=>!f.includes(p.type)).map(p=>e.get(p.id)).map(p=>n.jsx(uf,{node:p.node,position:p.pos,dropZones:u,prevNodeId:d[p.node.id],prevNodePos:e.get(d[p.node.id]).pos,nextNodePos:e.get(p.node.connections[0]).pos,setDraggedNodeId:i,setFocusedDropZone:r},`node-${p.node.id}-${p.node.type}`)),l&&u.map((p,w)=>{const x=(t==null?void 0:t.node1)===p.node1&&(t==null?void 0:t.node2)===p.node2;return n.jsx(zl,{position:p.pos,radius:.35,isFocused:x},`dropZone-${p.node1}[${w}]-${p.node2}`)}),n.jsx(Nf,{displayGraph:e,allowStreamInteraction:!l})]})};function Lf(e){const{type:t,position:r,dropZones:o,setFocusedDropZone:s}=e,i=Jt.includes(t),l=Qt.includes(t),c=Bt.includes(t),u=Ht.includes(t),d=Gt.includes(t),h=cn.includes(t),f=a.useRef(),p=a.useMemo(()=>({isDragging:!1}),[]),[w,x]=a.useState(!1),m=a.useMemo(()=>new Oe(r.x,r.y,r.z),[]),{scale:v}=Jn({scale:w?1.1:1}),[b,S]=a.useState(Date.now()),y=a.useMemo(()=>new Cs,[]),g=a.useMemo(()=>new Oe,[]),j=a.useMemo(()=>new Oe,[]),N=a.useMemo(()=>new is(.55,5,5),[]),{scene:P}=or();Ge(()=>{const C=f.current;if(p.isDragging){const M=Math.min(1,(Date.now()-b)/100);m.z=3*M}else m.x+=.5*(r.x-m.x),m.y+=.5*(r.y-m.y),m.z+=.5*(r.z-m.z);C.position.copy(m),p.isDragging&&(f.current.getWorldPosition(j),j.z=0,s(Sr(j,o)))});function L(){f.current.getWorldPosition(j),j.z=0;const M=Sr(j,o);M&&(i?pu(M.node1,M.connectionIndex||0):l?hu(M.node1,M.connectionIndex||0):h?wu(M.node1,M.connectionIndex||0):c?vu(M.node1,M.connectionIndex||0):u?xu(M.node1,M.connectionIndex||0):d&&gu(M.node1,M.connectionIndex||0),m.copy(r),v.set(.5))}const I=a.useCallback(C=>{console.log("double click"),yu(t)},[t]);return n.jsxs(Qn.group,{ref:f,scale:v,children:[i&&n.jsx(vs,{type:t,disableFrustumCulling:!0,addNodesMenu:!0}),l&&n.jsx(hs,{type:t,disableFrustumCulling:!0}),h&&n.jsx(ys,{type:t,disableFrustumCulling:!0}),c&&n.jsx(xs,{type:t,disableFrustumCulling:!0,addNodesMenu:!0}),u&&n.jsx(gs,{type:t,disableFrustumCulling:!0}),d&&n.jsx(yo,{type:t,disableFrustumCulling:!0}),n.jsx("mesh",{geometry:N,visible:!1,onPointerEnter:C=>{x(!0),C.stopPropagation(),document.body.style.cursor="grab"},onPointerLeave:()=>{x(!1),document.body.style.cursor="auto"},onPointerDown:C=>{C.stopPropagation(),S(Date.now()),g.copy(C.point),y.setFromNormalAndCoplanarPoint(new Oe(0,0,1),C.point),p.isDragging=!0,kt.getState().setDraggingNode(!0),C.target.setPointerCapture(C.pointerId),document.body.style.cursor="grabbing"},onPointerUp:C=>{C.stopPropagation(),C.target.releasePointerCapture(C.pointerId),p.isDragging=!1,kt.getState().setDraggingNode(!1),L(),document.body.style.cursor="auto"},onPointerMove:C=>{if(C.stopPropagation(),p.isDragging){const M=f.current,R=M.parent;P.attach(M),M.position.sub(g),C.ray.intersectPlane(y,g),M.position.add(g),R==null||R.attach(M),m.copy(M.position)}},onDoubleClick:I})]})}const kf=[{label:oe.Space,types:Jt},{label:oe.Grains,types:Qt},{label:oe.Time,types:Bt,expansionId:yn},{label:oe.Volt,types:Ht,expansionId:bn},{label:oe.Filter,types:cn},{label:oe.Haze,types:Gt}],Pf=({visible:e,displayGraph:t,setFocusedDropZone:r})=>{const o=lt(v=>JSON.stringify(v.userProductIds())),s=H(v=>v.selectedNodeId),i=H(v=>v.draggingNode),l=H(v=>v.toggleAddNodesPanel),c=Wt(),u=a.useRef(),{yOffset:d}=Jn({yOffset:e?0:-2,config:s?{easing:sn.linear,duration:0}:e?{easing:sn.easeOutElastic,tension:1e3,friction:50}:{easing:sn.easeInCubic,duration:200}}),h=a.useCallback(v=>{v.stopPropagation()},[]),f=a.useMemo(()=>Ki(t,void 0),[En(c)]),p=a.useMemo(()=>new sr(0,-.7),[]),w=a.useMemo(()=>new pc,[]),x=a.useMemo(()=>{const v=Mt.getState().userProductIds();return kf.filter(b=>b.expansionId===void 0||v.includes(b.expansionId))},[o]);Ge(v=>{const b=u.current;if(!b)return;const S=v.camera.position.length();w.setFromCamera(p,v.camera),w.ray.at(S,b.position);const y=.008*S;b.scale.set(y,y,y),b.position.y+=d.get()*(S/50)});const m=x.length*2+.52;return n.jsxs("group",{ref:u,children:[x.map((v,b)=>{const S=v.types.find(j=>c.getNodesWithType(j).length===0),y=-(x.length-1)+b*2,g=new Oe(y,0,0);return n.jsxs("group",{children:[S!==void 0&&n.jsx(Lf,{type:S,position:g,dropZones:f,setFocusedDropZone:r}),(S===void 0||i)&&n.jsx(zl,{position:g,radius:.45,isFocused:!1}),n.jsx(Fn,{center:!0,position:[g.x,g.y-.9,g.z],pointerEvents:"none",style:{pointerEvents:"none"},children:n.jsx("div",{style:{display:"inline-flex",alignItems:"center"},children:n.jsx("p",{className:S?"text-gray-300":"text-gray-500",style:{pointerEvents:"none"},children:v.label})})})]},`node-option-${b}`)}),n.jsx(ua,{position:[0,-.25,-1],args:[m,2,.1],radius:.15,onClick:h,frustumCulled:!1,children:n.jsx("meshBasicMaterial",{attach:"material",color:"rgb(56, 57, 65)",transparent:!0,opacity:.75})}),n.jsx(ua,{position:[0,-.25,-1],args:[m,2.02,0],radius:.15,onClick:h,frustumCulled:!1,children:n.jsx("meshBasicMaterial",{attach:"material",color:"rgb(85, 85, 85)",transparent:!0,opacity:.75})}),n.jsx(Fn,{position:[x.length+.25,.8,0],children:n.jsx("button",{className:"rounded-full",style:{position:"absolute",right:"11px",top:"11px",zIndex:50,padding:"5px"},onClick:l,children:n.jsx(ie,{type:X.Close})})})]})};function If(){return or(e=>{e.gl.debug.checkShaderErrors=!1}),n.jsx(n.Fragment,{})}const Ef=({className:e})=>{const t=H(g=>g.showDebugStats),r=H(g=>g.showAddNodesPanel),o=H(g=>g.toggleAddNodesPanel),s=H(g=>g.clearSelection),i=T(g=>g.isIndividualNode()),l=mt(g=>g.graphicsQuality),c=Wt(),u=En(c),d=a.useMemo(()=>Ru(c),[u,c]),[h,f]=a.useState(),p=a.useCallback(()=>{s(),r&&o()},[r]);let w=.5,x=window.devicePixelRatio;l===ct.Low?(w=.5,x=1):l===ct.High&&(w=1,x=window.devicePixelRatio);const[m,v]=a.useState(x);a.useEffect(()=>{v(x)},[x]);const[b,S]=a.useState(!1),y=a.useCallback(()=>{S(!0)},[]);return n.jsx("div",{id:"scene",className:e,style:{background:"#1a1a1f"},children:n.jsxs(hc,{dpr:m,camera:{position:[0,0,80],fov:5},style:{background:"#1a1a1f",opacity:b?1:0,transition:"all 0.25s ease-out"},onCreated:y,onPointerMissed:p,children:[t&&n.jsx(vc,{}),n.jsx(If,{}),n.jsx(xc,{bounds:()=>[45,60],onIncline:()=>{v(Math.min(x,m+.25))},onDecline:()=>{v(Math.max(w,m-.5))}}),n.jsx(gc,{files:"./envMap.hdr"}),n.jsxs("group",{children:[n.jsx("ambientLight",{intensity:.1}),n.jsx("pointLight",{position:[8,10,1],intensity:2}),n.jsx(Uu,{}),n.jsx(Af,{displayGraph:d,focusedDropZone:h,setFocusedDropZone:f}),!i&&n.jsx(Pf,{visible:r,displayGraph:d,setFocusedDropZone:f}),n.jsx(Hu,{displayGraph:d})]})]})})},Rf=a.memo(Ef);var vt=(e=>(e.LFO="lfo",e.NODE="node",e.MACRO="macro",e))(vt||{});const Df=({x:e,y:t,radius:r,startAngle:o,endAngle:s,color:i,stroke:l=window.innerWidth/1e3,opacity:c})=>{const u=Lt(e,t,r,o,s);return n.jsx("path",{strokeWidth:l,d:u,fill:"none",stroke:i,opacity:c})};function qa(e,t,r,o){return{x:e+r*Math.cos(o),y:t+r*Math.sin(o)}}function Lt(e,t,r,o,s){const i=qa(e,t,r,s),l=qa(e,t,r,o),c=s-o<=Math.PI?"0":"1";return["M",i.x,i.y,"A",r,r,0,c,0,l.x,l.y].join(" ")}const Bn=({children:e})=>{const[t,r]=a.useState(0),o=a.useRef(null);return a.useEffect(()=>{const s=document.createElement("div");return s.classList.add("portal-root"),document.body.appendChild(s),o.current=s,r(t+1),()=>{o.current&&document.body.removeChild(o.current)}},[]),o.current?wc.createPortal(e,o.current):null},Jo=150,Za=100,Bf=e=>{const{className:t,style:r,paramId:o,setter:s,interfaceSetter:i,setShowValue:l,setAngle:c,children:u,modMacroType:d,info:h,setShowModKnobs:f,onMouseDown:p,onMouseUp:w}=e;let{min:x,max:m,step:v,defaultValue:b,skew:S,tooltip:y,isPluginParameter:g}=h;const j=mt(Q=>Q.tooltipsOn),N=mt(Q=>Q.knobScrollMode),P=H(Q=>Q.selectParamId),L=a.useRef(null),I=a.useRef(0),C=a.useRef(0),M=a.useRef(0),R=a.useRef(0),O=a.useRef(!1),_=a.useRef(!1),z=a.useRef(0),U=a.useRef(0),[$,V]=a.useState(),[E,q]=a.useState(!1),[W,F]=a.useState(!1),Z=a.useRef(0),Y=a.useRef(),me=a.useRef(),Se=a.useRef(),je=a.useRef(),ye=a.useCallback(Q=>{if(z.current=Q,!O.current&&!_.current)return;let Ne=U.current,xe=0,ae=1;d===void 0?Ne=We(Ne,x,m,S):xe=-1;const we=(ae-Ne)*Jo,Ae=(xe-Ne)*Jo;z.current=Re(Q,Ae,we);let Ce=Ne+z.current/Jo;Ce=Re(Ce,xe,ae),Ce.toFixed(3)!==Z.current.toFixed(3)&&(d===void 0&&(Ce=xt(Ce,x,m,S)),i?i(Ce):s(Ce))},[d,x,m,v,S,s,i]),le=a.useCallback(Q=>{if(!_||Q.deltaY===0||N===on.Off)return;Q.preventDefault(),Q.stopPropagation();let Ne=Q.deltaY;"wheelDeltaY"in Q&&(Ne=Q.wheelDeltaY/6),Ne*=-.03,N===on.Down&&(Ne*=-1),ye(z.current+Ne)},[ye,N]),Me=a.useCallback(()=>{s(Z.current),!_.current&&l&&l(!1),!_.current&&f&&f(!1),O.current=!1,z.current=0,window.removeEventListener("mousemove",Y.current),window.removeEventListener("mouseup",me.current),window.removeEventListener("keydown",Se.current),window.removeEventListener("keyup",je.current),Y.current=void 0,me.current=void 0,Se.current=void 0,je.current=void 0,g&&o&&It(o)},[s,l,f,w]),ve=a.useCallback(Q=>{Q.preventDefault(),Q.stopPropagation();const Ne=Q.clientX,xe=Q.clientY;M.current=Ne,R.current=xe;const ae=I.current-Ne,Ae=C.current-xe-ae;ye(Q.shiftKey?Ae*.1:Ae)},[ye]),K=Q=>{Q.key==="Shift"&&(s(Z.current),U.current=Z.current,I.current=M.current,C.current=R.current)},ce=a.useCallback(Q=>{if(g&&o?Pt(o):Ft(),Q.altKey){if(Z.current.toFixed(3)===b.toFixed(3))return;s(b)}else Q.preventDefault(),Q.stopPropagation(),o&&P(o),I.current=Q.clientX,C.current=Q.clientY,U.current=Z.current,O.current=!0,window.addEventListener("mousemove",ve),window.addEventListener("mouseup",Me),window.addEventListener("keydown",K),window.addEventListener("keyup",K),Y.current=ve,me.current=Me,Se.current=K,je.current=K},[o,P,ve,Me,b,s,Z.current,p]),re=a.useCallback(()=>{l&&l(!0),f&&f(!0),_.current=!0,!O.current&&(U.current=Z.current,z.current=0,q(!0))},[l,f]),te=a.useCallback(()=>{!O.current&&l&&l(!1),!O.current&&f&&f(!1),_.current=!1,q(!1)},[l,f]),ue=a.useCallback(()=>{Z.current.toFixed(3)!==b.toFixed(3)&&(o&&g?Pt(o):Ft(),s(b),o&&g&&It(o))},[s,b]),he=()=>{var xe,ae;if(!o)return;const Q=Fe.getState();let Ne=Q[o];d===Ye.LFO||d===Ye.ENV?Ne=((xe=Q.modulations.find(we=>we.paramId===o))==null?void 0:xe.strength)||0:d===Ye.MACRO&&(Ne=((ae=Q.macros.find(we=>we.paramId===o))==null?void 0:ae.strength)||0),Z.current=Ne};return T(he),a.useEffect(he),a.useEffect(()=>{if(!L.current)return;const Q=L.current.getBoundingClientRect(),Ne=Math.max(Q.left+Q.width/2-Za/2,1);F(Q.top<200);const xe=Q.top>200?Q.top:Q.top+Q.height;V({x:Ne,y:xe})},[L,L.current,y]),a.useEffect(()=>{const Q=L.current;if(Q)return Q.addEventListener("wheel",le,{passive:!1}),()=>{Q.removeEventListener("wheel",le)}},[le]),a.useLayoutEffect(()=>{const Q=We(Z.current,x,m,S),Ne=Math.PI*(2*(.1+.8*Q)+.5);c&&c(Ne),!O&&!_&&(z.current=0)},[x,m,_,O]),n.jsxs("div",{className:t,ref:L,onMouseDown:ce,onMouseEnter:re,onMouseLeave:te,onDoubleClick:ue,style:r,children:[y&&j&&n.jsx(Bn,{children:n.jsx("div",{className:"pointer-events-none rounded bg-lunaDark text-[1vw] leading-tight text-lunaLight text-center fixed z-[100] py-1 px-2 border border-[#FFFFFF1F]",style:{width:Za,left:`${$==null?void 0:$.x}px`,top:`${$==null?void 0:$.y}px`,opacity:E?100:0,transition:"opacity 0.5s ease",transitionDelay:E?"1s":"0.1s",transform:W?"translate(0, 40px)":"translate(0, calc(-100% - 20px))"},children:y})}),u]})},Tn=a.memo(Bf),Ya=15,Tf=({children:e,paramId:t,type:r})=>{const o=H(C=>C.selectMainView),s=T(C=>C.modulations),i=T(C=>C.macros),l=s.find(C=>C.paramId===t),c=i.find(C=>C.paramId===t),u=T(()=>r===Ye.MACRO?c==null?void 0:c.bipolar:l==null?void 0:l.bipolar),[d,h]=a.useState(!1),f=a.useRef(null),[p,w]=a.useState(window.innerWidth),[x,m]=a.useState(window.innerHeight),v=a.useMemo(()=>{if(!f.current)return{left:0,top:0};const M=f.current.getBoundingClientRect(),R=window.innerWidth*Ya/100,O=Re(M.left+M.width/2,R,p-R/2),_=M.top<x/2,z=M.top+(_?80:-80);return{left:O,top:z}},[f.current,p,x]),b=a.useMemo(()=>s.findIndex(C=>C.paramId===t),[s,t]),S=a.useMemo(()=>i.findIndex(C=>C.paramId===t),[i,t]),y=l||c,g=a.useCallback(()=>{switch(r){case Ye.ENV:case Ye.LFO:cu(t);break;case Ye.MACRO:uu(t);break}h(!1)},[t,r]),j=a.useCallback(()=>{o(ee.Mappings),h(!1)},[]),N=a.useCallback(C=>()=>{switch(r){case Ye.ENV:case Ye.LFO:s[b].bipolar=Number(C),Le({modulations:s});break;case Ye.MACRO:i[S].bipolar=Number(C),Le({macros:i});break}},[s,i,b,S,Le]),P=()=>{m(window.innerHeight),w(window.innerWidth)},L=a.useCallback(()=>{h(!1)},[]),I=a.useCallback(C=>{C.preventDefault(),h(!0)},[]);return a.useLayoutEffect(()=>(window.addEventListener("resize",P),()=>{window.removeEventListener("resize",P)}),[]),n.jsxs("div",{ref:f,className:"relative h-full w-full",onContextMenu:I,children:[e,d&&n.jsxs(Bn,{children:[n.jsx("div",{className:"w-full h-full absolute left-0 top-0 z-[80]",onMouseDown:L}),n.jsxs("div",{className:"absolute border z-[100] text-lunaWhite text-sm translate-x-[-50%] translate-y-[-50%] bg-[#373B45] p-2 border-[#FFFFFF1F] rounded-md flex flex-col g-1",style:{left:v.left,top:v.top,width:Ya*window.innerWidth/100},children:[y&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex flex-row border border-[#FFFFFF1F] rounded cursor-pointer",children:[n.jsx("div",{className:"p-1 w-[50%] flex items-center justify-center",style:{color:u?fe.lunaWhite:fe.lunaCoral,background:u?"#4A4E57":"#41454E"},onClick:N(!1),children:"Unipolar"}),n.jsx("div",{className:"p-1 w-[50%] flex items-center justify-center border-l border-[#FFFFFF1F]",style:{color:u?fe.lunaCoral:fe.lunaWhite,background:u?"#41454E":"#4A4E57"},onClick:N(!0),children:"Bipolar"})]}),n.jsxs("div",{className:"cursor-pointer",onClick:g,children:["Remove ",Of(r)]})]}),n.jsx("div",{className:"cursor-pointer",onClick:j,children:"Open Mapping Editor"})]})]})]})};function Of(e){return e.length===0?e:e.charAt(0).toUpperCase()+e.slice(1)}const Xa=e=>Math.PI*(1.6*(e*.5+.5)+.7);var Ye=(e=>(e.LFO="modulation",e.MACRO="macro",e.ENV="env",e))(Ye||{});const _f=({paramId:e,size:t=11,setShowValue:r,type:o,setShowModKnobs:s})=>{const i=T(w=>{var x;return(x=w.modulations.find(m=>m.paramId===e))==null?void 0:x.lfoType}),{modulations:l,macros:c}=T(w=>({modulations:w.modulations,macros:w.macros})),u=a.useRef(null);T(w=>{if(!u.current)return;let x;o==="modulation"||o==="env"?x=w.modulations.find(b=>b.paramId===e):x=w.macros.find(b=>b.paramId===e);const m=Xa(x.strength);let v;x.strength<0?v=Lt(t,t,t*.7,m,Math.PI*1.5):v=Lt(t,t,t*.7,Math.PI*1.5,m),u.current.setAttribute("d",v)}),a.useEffect(()=>{if(!u.current)return;let w;if(o==="modulation"||o==="env"?w=l.find(v=>v.paramId===e):w=c.find(v=>v.paramId===e),!w)return;const x=Xa(w.strength);let m;w.strength<0?m=Lt(t,t,t*.7,x,Math.PI*1.5):m=Lt(t,t,t*.7,Math.PI*1.5,x),u.current.setAttribute("d",m)},[]);const d=a.useCallback(w=>x=>{const m=Fe.getState(),v=m.modulations,b=m.macros;if(x=Re(x,-1,1),o==="modulation"||o==="env"){const S=v.findIndex(y=>y.paramId===e);S!==-1&&(v[S].strength=x,Le({modulations:v},w,!1))}else if(o==="macro"){const S=b.findIndex(y=>y.paramId===e);S!==-1&&(b[S].strength=x,Le({macros:b},w,!1))}},[e]),h=a.useCallback(d(!0),[e]),f=a.useCallback(d(!1),[e]),p=a.useCallback(w=>{const x=Fe.getState(),m=x.modulations,v=x.macros;if(w.shiftKey){if(o==="modulation"||o==="env"){const b=m.findIndex(S=>S.paramId===e);b!==-1&&(m[b].bipolar=+!m[b].bipolar,Le({modulations:m},!0,!1))}else if(o==="macro"){const b=v.findIndex(S=>S.paramId===e);b!==-1&&(v[b].bipolar=+!v[b].bipolar,Le({macros:v},!0,!1))}}},[e]);return n.jsx("div",{style:{width:`${t}px`,height:`${t}px`},onClick:p,className:"flex items-center justify-center",children:n.jsx(Tf,{paramId:e,type:o,children:n.jsxs(Tn,{className:"z-20 relative",style:{padding:"0px",cursor:"pointer",height:`${t}px`,width:`${t}px`},paramId:e,setter:h,interfaceSetter:f,setShowValue:r,setShowModKnobs:s,modMacroType:o,info:{min:-1,max:1,step:.001,skew:1,defaultValue:.3,isPluginParameter:!1},children:[n.jsx("div",{style:{border:"1px solid #D9D9D91A",background:"linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), linear-gradient(0deg, rgba(217, 217, 217, 0.1), rgba(217, 217, 217, 0.1))",fontSize:"8px"},className:"box-border flex items-center justify-center text-white text-center rounded-full w-full h-full",children:o==="macro"?"M":i===be.LFO1?"1":i===be.LFO2?"2":i===be.LFO3?"3":"E"}),n.jsx("svg",{className:"absolute left-0 top-0",width:t*2,height:t*2,style:{transform:`translateX(-${t/2}px) translateY(-${t/2}px)`},children:n.jsx("path",{ref:u,strokeWidth:1,fill:"none",stroke:fe.lunaExtraLight})})]})})})},So=a.memo(_f),Zr=(e,t,r)=>e+t*Math.cos(r),Yr=(e,t,r)=>e+t*Math.sin(r),$l=({paramId:e,param:t,showValue:r,length:o,textColor:s,compact:i,alignRight:l})=>{const{toggleId:c,toggleOff:u,toggleOn:d}=t,h=ze(),f=T(j=>j.resizeFactor()),p=a.useRef(null),w=a.useRef(),x=a.useRef(),m=a.useRef(),v=d?h[d]:void 0,b=u?h[u]:void 0;function S(){if(p.current===null||w.current===void 0)return;let j,N;if(c&&v&&b){const I=x.current?v:b,C=We(w.current,t.min,t.max,t.skew||1),M=xt(C,I.min,I.max,I.skew||1);j=nr(M,I.strRepr||[],I.suffix||"",i),N=I.displayName}else j=nr(w.current,t.strRepr||[],t.suffix||"",i),N=t.displayName;p.current.textContent=r?j:N;const P=N.length*7.5,L=(o!=null?o:j.length)*7.5*f*window.innerWidth/1200;p.current.style.width=`${Math.max(P,L)}px`}T(j=>{const N=j[e];let P;c&&(P=j[c]),!(N===w.current&&r===m.current&&(!c||x.current===P))&&(w.current=N,m.current=r,x.current=P,S())}),a.useLayoutEffect(()=>{p.current&&S()},[p.current]),a.useEffect(()=>(window.addEventListener("resize",S),()=>{window.removeEventListener("resize",S)}),[]);const y=`${.875*f}rem`,g=l?"justify-end":"justify-center";return n.jsx("div",{ref:p,className:`flex items-center whitespace-nowrap select-none z-30 text-center ${g}`,style:{color:s!=null?s:fe.lunaLight,pointerEvents:"none",fontSize:y}})},Vf=({paramId:e,param:t})=>{const[r,o]=a.useState(),s=a.useRef(-1),i=a.useRef(null),l=a.useRef(0),c=a.useRef(null),u=a.useCallback(f=>{if(!r)return;const p=(f-t.min)/(t.max-t.min);r.uniform1f(l.current,p),r.drawArrays(r.TRIANGLES,0,6)},[r]),d=a.useCallback(()=>{const f=T.getState()[e];u(f)},[u]);a.useEffect(()=>T.subscribe((p,w)=>{const x=p[e],m=w[e];x!==m&&requestAnimationFrame(()=>u(x))}),[u]);const h=a.useCallback(()=>{const f=c.current;if(!f||!r)return;f.style.width="100%",f.style.height="100%";const p=f.getBoundingClientRect();f.width=p.width,f.height=p.height,r.viewport(0,0,f.width,f.height),d()},[r]);return a.useLayoutEffect(()=>(window.addEventListener("resize",h),h(),()=>{window.removeEventListener("resize",h)}),[c.current,r,h]),a.useEffect(()=>{if(!c.current)return;const p=c.current.getContext("webgl",{premultipliedAlpha:!1,alpha:!0});var w=p.createShader(p.VERTEX_SHADER);if(!w)return;if(p.shaderSource(w,zf),p.compileShader(w),!p.getShaderParameter(w,p.COMPILE_STATUS)){console.error("ERROR compiling vertex shader!",p.getShaderInfoLog(w)),p.deleteShader(w);return}var x=p.createShader(p.FRAGMENT_SHADER);if(p.shaderSource(x,$f),p.compileShader(x),!p.getShaderParameter(x,p.COMPILE_STATUS)){console.error("ERROR compiling fragment shader!",p.getShaderInfoLog(x)),p.deleteShader(x);return}var m=p.createProgram();p.attachShader(m,w),p.attachShader(m,x),p.linkProgram(m),l.current=p.getUniformLocation(m,"u_value"),p.useProgram(m),s.current=p.getAttribLocation(m,"coordinates"),i.current=p.createBuffer();const v=[-1,1,-1,-1,1,-1,-1,1,1,-1,1,1];var b=new Float32Array(v);return p.bindBuffer(p.ARRAY_BUFFER,i.current),p.bufferData(p.ARRAY_BUFFER,b,p.STATIC_DRAW),p.bindBuffer(p.ARRAY_BUFFER,i.current),p.vertexAttribPointer(s.current,2,p.FLOAT,!1,0,0),p.enableVertexAttribArray(s.current),o(p),()=>{p.deleteShader(w),p.deleteShader(x),p.deleteProgram(m),p.deleteBuffer(i.current)}},[c]),n.jsx("canvas",{ref:c,className:"absolute top-0 left-0"})},zf=`
attribute vec2 coordinates;
varying vec2 st;
void main(void) {
st = coordinates;
gl_Position = vec4(coordinates, 0.0, 1.0);
}
`,$f=`
precision mediump float;
varying vec2 st;
uniform float u_value;
float PI = 3.14159265358979;
float rand(float n) {
return fract(sin(n) * 43758.5453123);
}
void main() {
float radius = sqrt(st.x*st.x + st.y*st.y);
float angle = atan(st.x, st.y); // Normalized [-1,1]
float smoothness = 0.05;
vec3 color = vec3(1.0, 1.0, 1.0) * 0.8;
// We'll draw a ring. Knowing the angle, we can know the coordinate
// where a point in the ring with that angle should be
float RING_RADIUS = 0.67;
float RING_AMPLITUDE = 0.1;
float minA = -PI * 0.75;
float maxA = PI * 0.75;
float a = min(maxA, max(minA, angle));
float rx = RING_RADIUS * sin(a);
float ry = RING_RADIUS * cos(a);
// Now we calculate how far we are to the ring
float drx = rx - st.x;
float dry = ry - st.y;
float dr = sqrt(drx*drx + dry*dry);
float minAngle = minA - RING_AMPLITUDE;
float maxAngle = maxA + RING_AMPLITUDE;
float nA = (a - minAngle) / (maxAngle - minAngle);
// Edge between active and non-active arc
float t = smoothstep(u_value - 0.005, u_value + 0.005, nA);
color = mix(color, vec3(0.1132, 0.1210, 0.1484), t);
float k = smoothstep(RING_AMPLITUDE - 0.01, RING_AMPLITUDE + 0.05, dr);
color = mix(color, vec3(0.), k);
float alpha = 1.0;
if (dr <= RING_AMPLITUDE) {
alpha = 1.0;
} else {
alpha = 1.0 - smoothstep(RING_AMPLITUDE, RING_AMPLITUDE + 0.05, dr);
}
gl_FragColor = vec4(color, alpha);
}
`,Uf=({paramId:e,param:t,minAngle:r,maxAngle:o})=>{const[s,i]=a.useState(),l=a.useRef(-1),c=a.useRef(null),u=a.useRef(0),d=a.useRef(0),h=a.useRef(0),f=a.useRef(0),p=a.useRef(null),w=()=>{const m=p.current;if(!m||!s)return;m.style.width="100%",m.style.height="100%";const v=m.getBoundingClientRect();m.width=v.width,m.height=v.height,s.viewport(0,0,m.width,m.height)};a.useLayoutEffect(()=>(window.addEventListener("resize",w),w(),()=>{window.removeEventListener("resize",w)}),[p.current,s]),a.useEffect(()=>{if(!p.current)return;const v=p.current.getContext("webgl",{premultipliedAlpha:!1,alpha:!0});var b=v.createShader(v.VERTEX_SHADER);if(!b)return;v.shaderSource(b,Gf),v.compileShader(b);var S=v.createShader(v.FRAGMENT_SHADER);v.shaderSource(S,Wf),v.compileShader(S);var y=v.createProgram();v.attachShader(y,b),v.attachShader(y,S),v.linkProgram(y),u.current=v.getUniformLocation(y,"u_value"),d.current=v.getUniformLocation(y,"u_minAngle"),h.current=v.getUniformLocation(y,"u_maxAngle"),v.useProgram(y),l.current=v.getAttribLocation(y,"coordinates"),c.current=v.createBuffer();const g=[-1,1,-1,-1,1,-1,-1,1,1,-1,1,1];var j=new Float32Array(g);return v.bindBuffer(v.ARRAY_BUFFER,c.current),v.bufferData(v.ARRAY_BUFFER,j,v.STATIC_DRAW),v.bindBuffer(v.ARRAY_BUFFER,c.current),v.vertexAttribPointer(l.current,2,v.FLOAT,!1,0,0),v.enableVertexAttribArray(l.current),i(v),()=>{v.deleteShader(b),v.deleteShader(S),v.deleteProgram(y),v.deleteBuffer(c.current)}},[p]);const x=()=>{var v;if(!s)return;let m=_e(e);m=We(m,t.min,t.max,(v=t.skew)!=null?v:1),s.uniform1f(u.current,m),s.uniform1f(d.current,r+Math.PI/2),s.uniform1f(h.current,o+Math.PI/2),s.drawArrays(s.TRIANGLES,0,6),f.current=requestAnimationFrame(x)};return a.useEffect(()=>{if(s)return f.current=requestAnimationFrame(x),()=>{cancelAnimationFrame(f.current)}},[s]),n.jsx("canvas",{ref:p,className:"absolute top-0 left-0 z-[20]"})},Hf=a.memo(Uf),Gf=`
attribute vec2 coordinates;
uniform float u_value;
uniform float u_minAngle;
uniform float u_maxAngle;
varying vec2 st;
varying vec2 circleSt;
void main(void) {
st = coordinates;
float circleAngle = u_value * (u_maxAngle - u_minAngle) + u_minAngle;
circleSt = vec2(sin(circleAngle), cos(circleAngle)) * 0.72;
gl_Position = vec4(coordinates, 0.0, 1.0);
}
`,Wf=`
precision mediump float;
varying vec2 st;
varying vec2 circleSt;
void main() {
float circleRadius = 0.06;
float distToCircle = distance(st, circleSt);
float alpha = mix(1.0, 0.0, smoothstep(circleRadius, circleRadius + 0.04, distToCircle));
gl_FragColor = vec4(alpha);
}
`,Ka=2,Yn=1.1,qf=.032*Yn,Co=.052*Yn,Zf=e=>{var Xe;const{paramId:t,setter:r,interfaceSetter:o,small:s=!1,externalArcId:i,icons:l,special:c=!1,beforeLabel:u,afterLabel:d,isMacro:h,spacingTop:f,compact:p,labelLength:w,mix:x}=e,m=ze()[t];if(!m)return;const{isModulatable:v,bipolar:b,toggleId:S,toggleOn:y,toggleOff:g}=m,j=(Xe=T(De=>{if(!S)return null;const Ve=De[S];return ze()[Ve?y:g]}))!=null?Xe:m,N=T(De=>{var et;return(et=De.modulations.find(rt=>rt.paramId===t))==null?void 0:et.lfoType}),P=T(De=>De.resizeFactor()),L=T(De=>De[`${N}Enabled`]),I=T(De=>De.macros.find(Ve=>Ve.paramId===t)!==void 0),C=H(De=>De.hoveredParamId),[M,R]=a.useState(0),[O,_]=a.useState(!1),[z,U]=a.useState(!1),[$,V]=a.useState(!1),E=a.useRef(null),q=a.useRef(null),W=a.useRef(null),F=a.useRef(null),Z=a.useRef(null),Y=a.useRef(null),me=a.useRef(),Se=a.useRef(),je=a.useRef(),ye=a.useRef(),le=a.useRef(!1),[{isOver:Me,hoveredItem:ve},K]=Pr(()=>{var De,Ve;return{accept:(De=m==null?void 0:m.node)!=null&&De.includes("lfo")||(Ve=m==null?void 0:m.node)!=null&&Ve.includes("env")?[vt.LFO,vt.MACRO]:(m==null?void 0:m.node)==="macro"?[]:[vt.LFO,vt.MACRO],drop:et=>de(void 0,null,function*(){et.type===vt.MACRO?v&&t!=="macro"&&Po(t):v&&et.lfoType!==m.node&&ko(et.lfoType,t)}),collect:et=>({hoveredItem:et.getItem(),isOver:et.isOver()})}},[t,v]),ce=a.useMemo(()=>Ir(N),[N]),re=a.useMemo(()=>C===t,[C]),te=a.useMemo(()=>t.includes(ve==null?void 0:ve.lfoType)?"":(ve==null?void 0:ve.lfoType)===be.LFO1?"hover-lfo-1":(ve==null?void 0:ve.lfoType)===be.LFO2?"hover-lfo-2":(ve==null?void 0:ve.lfoType)===be.LFO3?"hover-lfo-3":"hover-macro",[ve==null?void 0:ve.lfoType,ve==null?void 0:ve.type]),ue=M/2,he=M/2,Q=M*.3/Yn,Ne=M*.4/Yn,xe=M*(.42+(c?.05:0))/Yn,ae=M*.45/Yn,we=Math.PI*.7,Ae=2.3*Math.PI,Ce=(we+Ae)/2,qe=!x&&(N&&L||I),B=a.useCallback(()=>{R(window.innerWidth*(s?qf:Co)*P)},[P,window.innerWidth,s]);a.useLayoutEffect(()=>(B(),window.addEventListener("resize",B),()=>{window.removeEventListener("resize",B)}),[B]);const G=a.useMemo(()=>De=>{if(!S)return r(t,De);let Ve=We(De,m.min,m.max,m.skew);return Ve=xt(Ve,j.min,j.max,j.skew),Ve=Math.round(Ve/j.step)*j.step,Ve=We(Ve,j.min,j.max,j.skew),Ve=xt(Ve,m.min,m.max,m.skew),r(t,Ve)},[r,t,j.min,j.max,j.skew,S]),pe=a.useMemo(()=>o?De=>o(t,De):null,[o,t]);function ke(De,Ve){var ta,na,ra,oa;const et=De[t],rt=De.modulations.find(Rt=>Rt.paramId===t),ot=De.macros.find(Rt=>Rt.paramId===t),J=i?.01*De[i]:void 0;if(!Ve&&et===me.current&&(rt==null?void 0:rt.strength)===((ta=Se.current)==null?void 0:ta.strength)&&(rt==null?void 0:rt.bipolar)===((na=Se.current)==null?void 0:na.bipolar)&&(ot==null?void 0:ot.strength)===((ra=je.current)==null?void 0:ra.strength)&&(ot==null?void 0:ot.bipolar)===((oa=je.current)==null?void 0:oa.bipolar)&&J===ye.current&&le.current===re)return;me.current=et,Se.current=rt?JSON.parse(JSON.stringify(rt)):void 0,je.current=ot?JSON.parse(JSON.stringify(ot)):void 0,ye.current=J,le.current=re;const Ee=We(et,m.min,m.max,m.skew),Ze=Math.PI*(2*(.1+.8*Ee)+.5);let pt;b&&Ee<.5?pt={start:Ze,end:Ce}:b&&Ee>=.5?pt={start:Ce,end:Ze}:pt={start:we,end:Ze};let en=0,dr=0;rt&&(en=Qo(rt.strength,rt.bipolar),dr=es(rt.strength,rt.bipolar));let _n=0,zr=0;ot&&(_n=Qo(ot.strength,ot.bipolar),zr=es(ot.strength,ot.bipolar));let $r=0,ea=0;if(J){const Rt=Qo(J,0),un=es(J,0);$r=Re(Ze+Math.min(Rt,un),we,Ae),ea=Re(Ze+Math.max(Rt,un),we,Ae)}if(E.current){const Rt=Lt(ue,he,ae,$r,ea);E.current.setAttribute("d",Rt);const un=$||re||z?"hidden":"visible";E.current.setAttribute("visibility",un)}if(q.current){const Rt=Re(Ze+Math.min(en,dr),we,Ae),un=Re(Ze+Math.max(en,dr),we,Ae),Vo=Lt(ue,he,xe,Rt,un);q.current.setAttribute("d",Vo),q.current.setAttribute("visibility",z||re?"visible":"hidden")}if(W.current){const Rt=Re(Ze+Math.min(_n,zr),we,Ae),un=Re(Ze+Math.max(_n,zr),we,Ae),Vo=Lt(ue,he,ae,Rt,un);W.current.setAttribute("d",Vo),W.current.setAttribute("visibility",$||re?"visible":"hidden")}if(F.current){const Rt=Lt(ue,he,Ne,pt.start,pt.end);F.current.setAttribute("d",Rt)}Z.current&&(Z.current.setAttribute("x1",Zr(ue,Q/1.7,Ze).toString()),Z.current.setAttribute("y1",Yr(he,Q/1.7,Ze).toString()),Z.current.setAttribute("x2",Zr(ue,Q/1.45,Ze).toString()),Z.current.setAttribute("y2",Yr(he,Q/1.45,Ze).toString())),Y.current&&(Y.current.setAttribute("x1",Zr(ue,Q/1.45,Ze).toString()),Y.current.setAttribute("y1",Yr(he,Q/1.45,Ze).toString()),Y.current.setAttribute("x2",Zr(ue,Q/1.2,Ze).toString()),Y.current.setAttribute("y2",Yr(he,Q/1.2,Ze).toString()))}T(ke),a.useEffect(()=>{ke(Fe.getState(),!0)},[M,z,$]);const Pe=a.useMemo(()=>n.jsxs("div",{className:"flex justify-between absolute z-20 w-[90%] left-[5%] z-[100]",style:{top:f?34+M*.05:"-0.5vw"},children:[N?n.jsx(So,{paramId:t,size:M*(s?.25:.18),setShowValue:U,type:Ye.LFO}):n.jsx("div",{}),I&&n.jsx(So,{paramId:t,size:M*(s?.25:.18),setShowValue:V,type:Ye.MACRO})]}),[t,N,I,M]),Ie=a.useMemo(()=>s?`${4.5*P}vw`:`${5.5*P}vw`,[P,s]),$e=s||p?1.5:3*P;return n.jsxs("div",{ref:K,className:"flex flex-col items-center relative",style:{width:Ie},children:[Pe,n.jsxs("div",{className:"relative p-0",style:{width:M,height:M,marginTop:f?`${$e}vw`:0},children:[n.jsx("div",{className:"absolute left-0 top-0 w-full h-full flex justify-center items-center z-[0]",children:n.jsx("div",{className:`w-[60%] h-[60%] rounded-full ${te}`,style:{opacity:Me&&v?100:0}})}),n.jsx("div",{className:"absolute left-0 top-0 w-full h-full z-[20]",children:n.jsxs("svg",{width:"100%",viewBox:`0 0 ${M} ${M}`,children:[n.jsx("filter",{id:"shadow",colorInterpolationFilters:"sRGB",children:n.jsx("feDropShadow",{dx:"0",dy:"2",stdDeviation:"2",floodOpacity:"0.3",floodColor:"#111"})}),n.jsx("path",{ref:E,strokeWidth:2,fill:"none",stroke:ce}),n.jsx("path",{ref:q,strokeWidth:2,fill:"none",stroke:ce}),n.jsx("path",{ref:W,strokeWidth:2,fill:"none",stroke:fe.lunaNavy}),n.jsx("defs",{children:n.jsxs("linearGradient",{id:"indicator",children:[n.jsx("stop",{offset:"0%",stopColor:"#B398FF"}),n.jsx("stop",{offset:"100%",stopColor:fe.lunaCoral})]})}),!c&&!h&&n.jsxs(n.Fragment,{children:[n.jsx(Df,{x:ue,y:he,radius:Ne,startAngle:we,endAngle:Ae,color:fe.lunaDark}),n.jsx("path",{ref:F,strokeWidth:window.innerWidth/1e3,fill:"none",stroke:"url(#indicator)"})]}),!l&&n.jsxs(n.Fragment,{children:[n.jsxs("g",{filter:"url(#shadow)",children:[n.jsx("circle",{cx:ue,cy:he-1,r:Q,fill:"#807c7c",stroke:"none"}),n.jsx("circle",{cx:ue,cy:he,r:Q,fill:fe.lunaLightGray,stroke:"none"})]}),n.jsx("line",{ref:Z,stroke:"#bbbbbb",strokeWidth:Ka,strokeLinecap:"round"}),n.jsx("line",{ref:Y,stroke:"#bbbbbb",strokeWidth:Ka,strokeLinecap:"butt"})]})]})}),qe&&n.jsx(Hf,{paramId:t,param:m,minAngle:we,maxAngle:Ae}),c||null,h&&n.jsx(Vf,{paramId:t,param:m}),!l&&n.jsx("div",{className:"absolute left-0 top-0 w-full h-full flex justify-center items-center z-0",children:n.jsx("div",{className:"rounded-full w-[54.5%] h-[54.5%] opacity-70",style:{boxShadow:"0px 10px 14px 0px #0000003D, 0px -7px 14px 0px #FFFFFF24"}})}),n.jsx(Tn,{className:"absolute left-0 top-0 rounded-full z-[30] cursor-pointer w-full h-full",setter:G,interfaceSetter:pe,paramId:t,setShowValue:_,info:ze()[t]}),b&&n.jsx("div",{className:"absolute top-[-0.45vw] left-[50%] z-10",style:{background:s?"#D9D9D9":"#000000",height:s?"2px":"6px",width:s?"2px":"1px",borderRadius:s?"53px":"0px"}}),l&&n.jsx("div",{className:"absolute flex justify-center left-0 top-0 h-full w-full items-center",children:l})]}),n.jsx("div",{className:"flex flex-col items-center justify-end",style:{width:M,height:`${$e}vw`},children:n.jsxs("div",{className:"flex flex-row items-center g-025",children:[n.jsx("div",{className:"w-[25%] mr-[0.55vw]",children:u}),n.jsx($l,{paramId:t,param:m,showValue:O,length:w}),n.jsx("div",{className:"w-[25%] ml-[0.55vw]",children:d})]})})]})},Be=a.memo(Zf),Qo=(e,t=1)=>t?-.5*1.6*e*Math.PI:0,es=(e,t=1)=>t?.5*1.6*e*Math.PI:1.6*Math.PI*e,Yf=({value:e,setter:t,min:r,max:o,defaultValue:s,type:i,small:l})=>{const c=T(b=>b.resizeFactor()),u=a.useRef(0),d=a.useRef(0),h=a.useRef(e),f=b=>{const S=b.clientX,y=b.clientY,g=u.current-S,N=d.current-y-g,P=Re(Math.round(h.current+N/10),r,o);t(P)},p=()=>{window.removeEventListener("mousemove",f)},w=b=>{window.addEventListener("mousemove",f),window.addEventListener("mouseup",p),u.current=b.clientX,d.current=b.clientY,h.current=e},x=()=>{t(s)},m=(l?1.2:1.6)*c,v=(l?1.8:2.5)*c;return n.jsxs("div",{className:"text-lunaWhite flex items-center cursor-pointer relative",style:{flexDirection:l?"row":"column",gap:"0.6vw"},onMouseDown:w,onDoubleClick:x,children:[n.jsx(ie,{type:i,size:l?13:15}),n.jsx("div",{style:{fontSize:`${m}vw`,width:`${v}vw`,height:`${v}vw`},className:"rounded bg-[#00000040] flex flex-row justify-center items-center border border-[#00000026]",children:e})]})},Ss=a.memo(Yf),Ja=({x:e,y:t,setter:r,removePoint:o,color:s,size:i,toggleCurved:l,curved:c,isNew:u,onHover:d,syncStore:h,isMouseDown:f})=>{const[p,w]=a.useState(!1),x=a.useRef(!1),m=a.useRef(!1),v=a.useRef(!1),b=a.useCallback(()=>{d&&d(),w(!0)},[w]),S=a.useCallback(()=>{w(!1)},[w]),y=M=>{x.current&&(m.current=!0),r&&r(M.clientX,M.clientY)},g=M=>{!m.current&&!u&&l(M),j(),h(),x.current=!1,m.current=!1},j=a.useCallback(()=>{v.current=!1,window.removeEventListener("mouseup",g),window.removeEventListener("mousemove",y)},[g,y]),N=a.useCallback(()=>{v.current=!0,window.addEventListener("mouseup",g),window.addEventListener("mousemove",y)},[g,y]);a.useEffect(()=>{u&&f.current&&!v.current&&(N(),x.current=!0)},[u,N]);const P=a.useCallback(M=>{if(Ft(),M.button===0){if(M.stopPropagation(),!r)return;N(),x.current=!0}else M.button===2&&o(M)},[r,N,o]),L=M=>{M.preventDefault(),M.stopPropagation()},I=a.useMemo(()=>({onContextMenu:L,onMouseDown:P,onMouseEnter:b,onMouseLeave:S,className:"cursor-pointer"}),[L,P,b,S]),C={fill:"#00000000",stroke:p||x.current?s:"transparent",style:{transition:"stroke 0.3s ease"}};return c?n.jsxs(n.Fragment,{children:[n.jsx("circle",k({cx:e,cy:t,r:i*.5,fill:s},I)),n.jsx("circle",k(k({cx:e,cy:t,r:i*1.5},C),I))]}):n.jsxs(n.Fragment,{children:[n.jsx("rect",k({x:e-i/2,y:t-i/2,width:i,height:i,fill:s},I)),n.jsx("rect",k(k({x:e-i*1.5,y:t-i*1.5,width:i*3,height:i*3},C),I))]})};var tt=(e=>(e[e.Cursor=0]="Cursor",e[e.RampUp=1]="RampUp",e[e.RampDown=2]="RampDown",e[e.CurveUp=3]="CurveUp",e[e.CurveDown=4]="CurveDown",e[e.Flat=5]="Flat",e))(tt||{});const Un=({iconType:e,type:t,selectedTool:r,setter:o,className:s})=>{const i=t===r,l=a.useCallback(()=>{o(t)},[t,o]);return n.jsx("div",{onClick:l,style:{background:i?fe.lunaLightGray:fe.lunaGray},className:`w-[2vw] h-[2vw] flex flex-col justify-center items-center cursor-pointer border border-[#FFFFFF0F] ${s}`,children:n.jsx(ie,{type:e,active:i})})},Xf=({grid:e,w:t,h:r})=>{const o=a.useMemo(()=>Array.from({length:e.x-1},(i,l)=>l),[e.x]),s=a.useMemo(()=>Array.from({length:e.y-1},(i,l)=>l),[e.y]);return n.jsxs(n.Fragment,{children:[o.map(i=>n.jsx("line",{x1:t*(i+1)/e.x,x2:t*(i+1)/e.x,y1:r*Sn,y2:r*(1-Sn),stroke:"#ffffff33",strokeWidth:"1"},i)),s.map(i=>n.jsx("line",{x1:0,x2:t,y1:r*(i+1)/e.y,y2:r*(i+1)/e.y,stroke:"#ffffff33",strokeWidth:"1"},i))]})},Kf=e=>e>1?e-1:e;function Jf(e,t,r,o,s,i,l){const c=(e-t)/(o-t);return(2*Math.pow(c,3)-3*Math.pow(c,2)+1)*r+(Math.pow(c,3)-2*Math.pow(c,2)+c)*i+(-2*Math.pow(c,3)+3*Math.pow(c,2))*s+(Math.pow(c,3)-Math.pow(c,2))*l}const Qf=e=>{let t=[];for(let r=0;r<e.length;r++){let o=e[r==0?e.length-1:r-1],s=e[r==e.length-1?0:r+1],i=e[r];t.push(i.y>=s.y&&i.y>=o.y||i.y<=s.y&&i.y<=o.y)}return t},em=e=>{let t=Qf(e),r=[];for(let o=0;o<e.length;o++)if(t[o])r.push(0);else{let s=o>0?o-1:e.length-1,i=o<e.length-1?o+1:0,{x:l,y:c}=e[s],{y:u}=e[o],{x:d,y:h}=e[i];o===0&&(l-=1),o===e.length-1&&(d+=1);let f=(h-c)/(d-l);const p=Math.min(Math.abs(u-c),Math.abs(h-u))/(.5*Math.abs(h-c));f*=Math.min(1,1.6*p),r.push(f)}return r},tm=(e,t)=>{let r=em(e),o=[],s=e.length-1,i=0;for(let l=0;l<t;l++){const c=l/t;let{x:u,y:d,curved:h}=e[s],{x:f,y:p,curved:w}=e[i];if(i===0&&(u-=c<e[0].x?1:0,f+=c>=e[e.length-1].x?1:0),c>=f&&i!==s){s=i,i=(s+1)%e.length,o.push({x:Kf(f),y:p});continue}const x=h?r[s]*(f-u):p-d,m=w?r[i]*(f-u):p-d,v=Jf(c,u,d,f,p,x,m);o.push({x:c,y:v})}return o},nm=({id:e,animated:t,points:r,w:o,h:s,color:i,applyPhase:l=!1})=>{const[c,u]=a.useState(""),[d,h]=a.useState(""),f=a.useRef(null),p=a.useRef(null),w=a.useRef(null),x=a.useRef(null),m=a.useRef(null),v=a.useRef(null),b=a.useRef();function S(N){var V,E,q,W;const P=`${e}Phase`,L=l?Fe.getState()[P]:0;if(!N&&L===b.current)return;b.current=L;let I=[],C=0;const M=L/100;let R=0;for(let F of r)R++,F.x+M<1&&(C=R),I.push(D(k({},F),{x:F.x+M}));const O=I.slice(0,C);I=I.slice(C).map(F=>D(k({},F),{x:F.x-1})).concat(O);const z=tm(I,256),U=Qa(z,o,s),$=Qa([...z,{x:1,y:0},{x:0,y:0}],o,s);(V=f.current)==null||V.setAttribute("d",U),(E=p.current)==null||E.setAttribute("d",$),(q=w.current)==null||q.setAttribute("d",U),(W=x.current)==null||W.setAttribute("d",U)}a.useEffect(()=>{S(!0)},[e,o,s,JSON.stringify(r)]),T(()=>{S()});const y=a.useRef(0);ln(N=>{if(!t||Date.now()-y.current<30)return;y.current=Date.now();const L=N.snapshots[`${e}_phaseSnapshot`]||0;let C=L-.05,M=L,R=0,O=1,_=!1;C<0&&(R=C+1,C=0,_=!0),M>1&&(O=M-1,M=1,_=!0),x.current&&x.current.setAttribute("visibility",_?"visible":"hidden"),m.current&&(m.current.setAttribute("x",(o*C).toString()),m.current.setAttribute("width",((M-C)*o).toString())),v.current&&(v.current.setAttribute("x",(o*R).toString()),v.current.setAttribute("width",((O-R)*o).toString()))}),a.useEffect(()=>{u(`clip-${Math.random().toString(36).substring(2,9)}`),h(`clip-wrap-${Math.random().toString(36).substring(2,9)}`)},[]);const g={shapeRendering:"geometricPrecision"},j={stroke:"#ffffff99",strokeWidth:"2",fill:"none"};return n.jsxs(n.Fragment,{children:[n.jsx("defs",{children:n.jsxs("linearGradient",{id:`${e}-gradient`,x1:"0%",y1:"0%",x2:"0%",y2:"100%",children:[n.jsx("stop",{offset:"0%",stopColor:`${i.slice(0,7)}55`}),n.jsx("stop",{offset:"100%",stopColor:"transparent"})]})}),n.jsx("path",D(k({ref:f},g),{stroke:i,strokeWidth:"1",fill:"none",strokeLinejoin:"round"}))," ",n.jsx("path",{ref:p,className:"pointer-events-none",stroke:"none",fill:`url(#${e}-gradient)`})," ",n.jsx("path",D(k(k({ref:w,visibility:t?"visible":"hidden"},g),j),{clipPath:`url(#${c})`})),n.jsx("path",D(k(k({visibility:t?"visible":"hidden",ref:x},g),j),{clipPath:`url(#${d})`})),n.jsx("clipPath",{id:c,children:n.jsx("rect",{ref:m,height:"100%"})}),n.jsx("clipPath",{id:d,children:n.jsx("rect",{ref:v,height:"100%"})})]})},Qa=(e,t,r)=>{const o=r*Sn,s=r*(1-Sn*2);let i=`M ${e[0].x*t} ${o+(1-e[0].y)*s}`;for(let l=1;l<e.length;l++){const c=e[l];i+=` L ${c.x*t} ${o+(1-c.y)*s}`}return i};function rm(e,t){const r=[],o=Math.random()<.5,s=Math.random()<.5,i=Math.random()*5;for(let l=0;l<e;l+=o?.5:1){const c=Math.floor(l)/e,u=Math.floor(Math.random()*(t+1));let h=To(u/t);o&&l%1===0?i>4&&r.length>0?h=r[r.length-1].y:i>3?h=.5:i>2?h=1:i>1&&(h=0):l===e-.5&&(h=r[0].y);const f={curved:s,x:c,y:h};r.push(f)}return r}const Sn=.05,No=.015,om=({id:e,lfo:t,active:r,color:o,animated:s,applyPhase:i=!1,enabled:l=!0})=>{const{points:c,grid:u}=t;if(!c)return null;const[d,h]=a.useState(0),[f,p]=a.useState(0),[w,x]=a.useState(0),[m,v]=a.useState(0),[b,S]=a.useState(tt.Cursor),[y,g]=a.useState([]),[j,N]=a.useState(tt.Cursor),P=a.useRef(null),L=a.useRef(c),I=a.useRef(u),C=a.useRef(!1),M=f*Sn,R=f*(1-Sn*2),O=()=>{const K=L.current.map(ce=>D(k({},ce),{new:!1}));Le({[e]:{points:K,grid:u,path:"",factory:!1}},!0,!1)},_=a.useCallback(()=>{const K=P.current,ce=K==null?void 0:K.getBoundingClientRect();ce&&(h(ce.width),p(ce.height),x(ce.left),v(ce.top))},[P.current]),z=K=>{let ce=0,re,te=0;for(let ue=0;ue<K.length;ue++)(K[ue].x===0||K[ue].x===1)&&te++;for(let ue=0;ue<K.length;ue++){let he=K[ue];he.x===re?ce++:ce=0,re=he.x;const Q=(he.x===0||he.x===1)&&te>2?1:2;ce>=Q&&(he.x===0?K.splice(0,1):he.x===1?K.splice(K.length-1,1):K.splice(ue-1,1),ue--,ce=0)}return Le({[e]:{points:K,grid:u,path:"",factory:!1}},!1,!1),K.map((ue,he)=>ue.new?he:-1).filter(ue=>ue>=0)},U=K=>(I.current.y=K,Le({[e]:{points:c,grid:I.current}},!1,!0)),$=K=>(I.current.x=K,Le({[e]:{points:c,grid:I.current}},!1,!0)),V=a.useCallback((K,ce)=>{const re=c.map(xe=>D(k({},xe),{new:!1}));let{x:te,y:ue}=ts({x:K,y:ce},u,d/f);const he={x:te,y:ue,curved:!0,new:!0},Q=Xr(te,re);re.splice(Q,0,he);const Ne=z(re);g(Ne),ye()},[c,d,f,u]),E=a.useCallback((K,ce)=>{const re=c.map(Ne=>D(k({},Ne),{new:!1}));let te=Hn({x:K,y:ce},u,d/f),ue=Gn({x:K,y:ce},u,d/f);for(let Ne=0;Ne<re.length;Ne++){const xe=re[Ne];xe.x>te.x&&xe.x<ue.x&&(re.splice(Ne,1),Ne--)}const he=Xr(te.x,re);re.splice(he,0,D(k({},te),{curved:!1,new:!0})),re.splice(he+1,0,D(k({},ue),{curved:!1,new:!0}));const Q=z(re);g(Q),N(tt.Flat),ye()},[c,d,f,u]),q=a.useCallback((K,ce,re)=>{const te=c.map(xe=>D(k({},xe),{new:!1}));let ue=Hn({x:K,y:0},u,d/f),he=Gn({x:K,y:ce},u,d/f);for(let xe=0;xe<te.length;xe++){const ae=te[xe];ae.x>ue.x&&ae.x<he.x&&(te.splice(xe,1),xe--)}const Q=Xr(ue.x,te);te.splice(Q,0,D(k({},ue),{curved:re,new:!0})),te.splice(Q+1,0,D(k({},he),{curved:re,new:!0}));const Ne=z(te);g(Ne),N(re?tt.CurveUp:tt.RampUp),ye()},[c,d,f,u]),W=a.useCallback((K,ce,re)=>{const te=c.map(xe=>D(k({},xe),{new:!1}));let ue=Hn({x:K,y:1},u,d/f),he=Gn({x:K,y:ce},u,d/f);for(let xe=0;xe<te.length;xe++){const ae=te[xe];ae.x>ue.x&&ae.x<he.x&&(te.splice(xe,1),xe--)}const Q=Xr(ue.x,te);te.splice(Q,0,D(k({},ue),{curved:re,new:!0})),te.splice(Q+1,0,D(k({},he),{curved:re,new:!0}));const Ne=z(te);g(Ne),N(re?tt.CurveDown:tt.RampDown),ye()},[c,d,f,u]),F=a.useCallback(K=>()=>{const ce=L.current[K].x;if(ce===0||ce===1){const re=[...L.current];K===0&&ce===0?(re[K].x=1,re.push(re.shift())):K===L.current.length-1&&ce===1?(re[K].x=0,re.unshift(re.pop())):K===1&&ce===0?(re[K].x=1,re.push(re.shift()),re[K].x=1,re.push(re.shift())):K===L.current.length-2&&ce===1&&(re[K].x=0,re.unshift(re.pop()),re[K].x=0,re.unshift(re.pop())),z(re)}},[L,z]),Z=a.useCallback((K,ce,re)=>{var we,Ae;const te=[...c],ue=K+1===te.length?1:((we=te[K+1])==null?void 0:we.x)||0,he=K===0?0:((Ae=te[K-1])==null?void 0:Ae.x)||0;let{x:Q,y:Ne}=sm(ce,re,w,m,d,f),xe;const ae=y.indexOf(K)===0;switch(j){case tt.Flat:ae?xe=Hn({x:Q,y:Ne},u,d/f):xe=Gn({x:Q,y:Ne},u,d/f);break;case tt.RampUp:case tt.CurveUp:ae?xe=Hn({x:Q,y:1},u,d/f):xe=Gn({x:Q,y:Ne},u,d/f);break;case tt.RampDown:case tt.CurveDown:ae?xe=Hn({x:Q,y:0},u,d/f):xe=Gn({x:Q,y:Ne},u,d/f);break;default:xe=ts({x:Q,y:Ne},u,d/f)}xe===void 0&&(xe=ts({x:Q,y:Ne},u,d/f)),xe.x=Re(xe.x,he,ue),te[K].x=xe.x,te[K].y=1-xe.y,z(te)},[w,m,d,f,c,u,j]),Y=a.useCallback(K=>ce=>{if(ce.altKey||ce.ctrlKey||ce.shiftKey||ce.metaKey)return;const re=[...c];re.length!==1&&(re.splice(K,1),z(re))},[c]),me=a.useCallback(K=>ce=>{ce.preventDefault();const re=[...c];re[K].curved=!re[K].curved,z(re)},[c]),Se=()=>{const K=2+Math.floor(Math.random()*15),ce=2+Math.floor(Math.random()*7),re=rm(K,ce);Le({[e]:{points:re,grid:{x:K,y:ce}}},!0)};a.useEffect(()=>{L.current=c},[c]),a.useEffect(()=>(window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}),[_]),a.useEffect(()=>{_()},[P,P.current]);const je=a.useCallback(()=>{C.current=!1,g([]),N(tt.Cursor),window.removeEventListener("mouseup",je)},[g]),ye=a.useCallback(()=>{window.addEventListener("mouseup",je)},[je]),le=a.useCallback(K=>{C.current=!0,Ft();const ce=(K.clientX-w)/d,re=1-(K.clientY-m)/f;if(r&&K.target==K.currentTarget&&K.button===0)switch(b){case tt.Cursor:V(ce,re);break;case tt.Flat:E(ce,re);break;case tt.RampUp:q(ce,re,!1);break;case tt.RampDown:W(ce,re,!1);break;case tt.CurveUp:q(ce,re,!0);break;case tt.CurveDown:W(ce,re,!0);break}},[r,V,b,w,d,m,f,c]),Me=K=>{K.preventDefault()},ve={selectedTool:b,setter:S};return n.jsxs("div",{className:"w-full h-full flex",style:{pointerEvents:l?"auto":"none"},children:[n.jsx("div",{ref:P,className:"grow",children:n.jsxs("svg",{width:"100%",height:"100%",onMouseDown:le,onContextMenu:Me,children:[r&&n.jsx(Xf,{grid:u,h:f,w:d}),n.jsx(nm,{id:e,animated:s,points:c,w:d,h:f,color:o,applyPhase:i}),r&&c.map((K,ce)=>n.jsxs(a.Fragment,{children:[n.jsx(Ja,{x:K.x*d,y:M+(1-K.y)*R,color:o,setter:(re,te)=>Z(ce,re,te),removePoint:Y(ce),toggleCurved:me(ce),size:6,curved:K.curved,isNew:y.includes(ce),syncStore:O,isMouseDown:C}),(K.x===0||K.x===1)&&n.jsx(Ja,{x:(K.x===0?1:0)*d,y:M+(1-K.y)*R,color:o,setter:(re,te)=>Z(ce,re,te),removePoint:Y(ce),toggleCurved:me(ce),size:6,curved:K.curved,isNew:y.includes(ce),onHover:F(ce),syncStore:O,isMouseDown:C})]},ce))]})}),r&&n.jsxs("div",{className:"h-full w-[3vw] flex flex-col justify-end py-3 items-center",children:[n.jsxs("div",{className:"flex flex-col items-center",style:{gap:"2px"},children:[n.jsx(Un,D(k({iconType:X.Cursor,type:tt.Cursor},ve),{className:"rounded-t-lg"})),n.jsx(Un,k({iconType:X.LineAscending,type:tt.RampUp},ve)),n.jsx(Un,k({iconType:X.LineDescending,type:tt.RampDown},ve)),n.jsx(Un,k({iconType:X.LineFlat,type:tt.Flat},ve)),n.jsx(Un,k({iconType:X.CurveAscending,type:tt.CurveUp},ve)),n.jsx(Un,D(k({iconType:X.CurveDescending,type:tt.CurveDown},ve),{className:"rounded-b-lg"}))]}),n.jsxs("div",{className:"grow flex flex-col justify-evenly items-center",children:[n.jsx(Ss,{type:X.Columns,value:u.x,setter:$,min:1,max:16,defaultValue:8}),n.jsx(Ss,{type:X.Rows,value:u.y,setter:U,min:1,max:8,defaultValue:2}),n.jsx(ie,{type:X.Wand,size:5.8,onClick:Se})]})]})]})},Ul=a.memo(om),sm=(e,t,r,o,s,i)=>({x:Math.max((e-r)/s,0),y:Math.min((t-o)/i,1)}),ts=(e,t,r)=>{const o=Math.round(e.x*t.x)/t.x,s=Math.round(e.y*t.y)/t.y;let i={x:e.x,y:e.y};return Math.abs(o-e.x)<No&&(i.x=o),Math.abs(s-e.y)<No*r&&(i.y=s),i.y=To(i.y),i},Hn=(e,t,r)=>{const o=Math.floor(e.x*t.x)/t.x,s=Math.round(e.y*t.y)/t.y;let i={x:o,y:e.y};return Math.abs(s-e.y)<No*r&&(i.y=s),i.y=To(i.y),i},Gn=(e,t,r)=>{const o=Math.ceil(e.x*t.x)/t.x,s=Math.round(e.y*t.y)/t.y;let i={x:o,y:e.y};return Math.abs(s-e.y)<No*r&&(i.y=s),i.y=To(i.y),i},To=e=>Re((e-Sn)/(1-Sn*2),0,1),Xr=(e,t)=>{let r=t.findIndex(o=>o.x>e);return r===-1?t.length:r},am=({id:e,lfo:t,color:r,editMode:o,animated:s,preventRemove:i,applyPhase:l=!1,enabled:c=!0})=>{const u=H(v=>v.selectLFO),d=H(v=>v.toggleMainViewType),h=H(v=>v.closeTweaksPanel),f=a.useCallback(()=>{u(e),o||(d(ee.lfoBrowser),h())},[o,e,d]),p=a.useCallback(v=>{v.stopPropagation(),u(e),d(ee.lfoEditor)},[t,u,e,d]),w=a.useCallback(v=>{v.stopPropagation(),t&&!t.factory&&nn(t.path||"")},[nn,t]),x="opacity-0 translate-y-[0.45vw] group-hover:translate-y-0 group-hover:opacity-100 transition duration-300 ease-in-out",m=o?!t.factory&&!i?n.jsx(ie,{type:X.Trash,size:25,onClick:w}):n.jsx("div",{}):n.jsx("div",{});return n.jsxs("div",{className:"group relative flex flex-col w-full h-full text-white items-center justify-center relative",onClick:f,onDoubleClick:p,style:{pointerEvents:c?"auto":"none"},children:[n.jsx("div",{className:"w-full h-full opacity-100 group-hover:opacity-50 transition duration-300 ease-in-out",children:n.jsx(Ul,{id:e,lfo:t,color:r,animated:s,applyPhase:l,enabled:c})}),n.jsxs("div",{className:`absolute left-0 top-0 px-1 w-full flex flex-row justify-between g-05 ${x}`,children:[m,n.jsx(ie,{type:X.Edit,size:25,onClick:p})]})]})},Zs=a.memo(am),im=e=>{const{paramId:t,setter:r,horizontal:o,textColor:s,beforeLabel:i,afterLabel:l}=e,c=T(w=>w.isIndividualNode()),{displayName:u}=ze()[t],d=a.useRef(null),h=a.useMemo(()=>w=>r(t,w),[r,t]),f=c?"text-lg":"text-sm",p=o?"flex-row justify-between items-center gap-2":"flex-col justify-center items-center";return n.jsxs("div",{ref:d,className:`cursor-pointer relative flex space-between ${p} ${f}`,children:[n.jsx(Tn,{paramId:t,className:"absolute w-full h-full",setter:h,info:ze()[t]}),i&&n.jsx("div",{className:"flex flex-col justify-center h-full",children:i}),n.jsx("div",{className:"text-lunaLight flex items-center justify-center whitespace-nowrap select-none z-30 text-center h-[1.1vw]",children:u}),n.jsx($l,{paramId:t,param:ze()[t],showValue:!0,length:6,textColor:s!=null?s:fe.lunaCoral,compact:!0,alignRight:o}),l&&n.jsx("div",{className:"flex flex-col justify-center h-full",children:l})]})},jn=a.memo(im),ei=7e-4,xn=({setter:e,value:t,id:r})=>{const o=T(u=>u.resizeFactor()),[s,i]=a.useState(window.innerWidth*ei),l=()=>{i(window.innerWidth*ei*o)},c=a.useCallback(()=>{e(r,+!t)},[t,e,r]);return a.useEffect(()=>(l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}),[]),n.jsxs("div",{className:"cursor-pointer relative",style:{width:14*s,height:13*s},onClick:c,children:[n.jsx("svg",{width:14*s,height:13*s,viewBox:"0 0 14 13",fill:"none",className:"absolute left-0 top-0",children:n.jsx("path",{className:"transition-fill ease-in-out duration-300",d:"M7 0.5C9.13281 0.5 11.1016 1.64844 12.1797 3.5C13.2578 5.375 13.2578 7.64844 12.1797 9.5C11.1016 11.375 9.13281 12.5 7 12.5C4.84375 12.5 2.875 11.375 1.79688 9.5C0.71875 7.64844 0.71875 5.375 1.79688 3.5C2.875 1.64844 4.84375 0.5 7 0.5ZM6.4375 3.3125V6.5C6.4375 6.6875 6.53125 6.875 6.67188 6.96875L8.92188 8.46875C9.17969 8.65625 9.53125 8.58594 9.71875 8.32812C9.88281 8.07031 9.8125 7.71875 9.55469 7.53125L7.5625 6.21875V3.3125C7.5625 3.00781 7.30469 2.75 7 2.75C6.67188 2.75 6.4375 3.00781 6.4375 3.3125Z",fill:t?"#F48272":"transparent"})}),n.jsx("svg",{width:12*s,height:13*s,viewBox:"0 0 12 13",fill:"none",className:"absolute left-[1px] top-0",children:n.jsx("path",{className:"transition-fill ease-in-out duration-300",d:"M11.25 6.5C11.25 4.625 10.2422 2.91406 8.625 1.97656C6.98438 1.01562 4.99219 1.01562 3.375 1.97656C1.73438 2.91406 0.75 4.625 0.75 6.5C0.75 8.39844 1.73438 10.1094 3.375 11.0469C4.99219 12.0078 6.98438 12.0078 8.625 11.0469C10.2422 10.1094 11.25 8.39844 11.25 6.5ZM0 6.5C0 4.36719 1.125 2.39844 3 1.32031C4.85156 0.242188 7.125 0.242188 9 1.32031C10.8516 2.39844 12 4.36719 12 6.5C12 8.65625 10.8516 10.625 9 11.7031C7.125 12.7812 4.85156 12.7812 3 11.7031C1.125 10.625 0 8.65625 0 6.5ZM5.625 3.125C5.625 2.9375 5.78906 2.75 6 2.75C6.1875 2.75 6.375 2.9375 6.375 3.125V6.3125L8.4375 7.69531C8.625 7.8125 8.67188 8.04688 8.55469 8.21094C8.4375 8.39844 8.20312 8.44531 8.03906 8.32812L5.78906 6.82812C5.67188 6.75781 5.625 6.64062 5.625 6.5V3.125Z",fill:t?"transparent":"white",fillOpacity:"0.6"})})]})},lm=()=>{const e=a.useRef(null),[t,r]=a.useState(),o=a.useRef(-1),s=a.useRef(null);a.useEffect(()=>{if(!e.current)return;const h=e.current.getContext("webgl",{premultipliedAlpha:!1,alpha:!0});var f=h.createShader(h.VERTEX_SHADER);if(f){if(h.shaderSource(f,cm),h.compileShader(f),!h.getShaderParameter(f,h.COMPILE_STATUS)){console.error("ERROR compiling vertex shader!",h.getShaderInfoLog(f)),h.deleteShader(f);return}var p=h.createShader(h.FRAGMENT_SHADER);if(h.shaderSource(p,um),h.compileShader(p),!h.getShaderParameter(p,h.COMPILE_STATUS)){console.error("ERROR compiling fragment shader!",h.getShaderInfoLog(p)),h.deleteShader(p);return}var w=h.createProgram();h.attachShader(w,f),h.attachShader(w,p),h.linkProgram(w);var x=h.getUniformLocation(w,"u_color");return h.useProgram(w),o.current=h.getAttribLocation(w,"coordinates"),h.uniform3fv(x,[.7,.73,.9]),s.current=h.createBuffer(),h.bindBuffer(h.ARRAY_BUFFER,s.current),h.vertexAttribPointer(o.current,2,h.FLOAT,!1,0,0),h.enableVertexAttribArray(o.current),h.bindBuffer(h.ARRAY_BUFFER,null),r(h),()=>{h.deleteShader(f),h.deleteShader(p),h.deleteProgram(w),h.deleteBuffer(s.current)}}},[e.current]);const i=100,l=a.useRef(),c=a.useRef(0),u=()=>{t&&(t.bindBuffer(t.ARRAY_BUFFER,s.current),t.clearColor(.109,.109,.109,0),t.clear(t.COLOR_BUFFER_BIT),t.drawArrays(t.TRIANGLE_STRIP,0,i*2))};return a.useLayoutEffect(()=>{u()},[]),ln(d=>{if(!t)return;const h=d.snapshots.envFollow_snapshot;if(h===void 0)return;const f=Date.now();if(f-c.current<33)return;c.current=f;let p=[];if(l.current)for(let x=0;x<i;++x)p[x]=l.current[x];else for(let x=0;x<i;++x)p[x]=0;for(let x=0;x<i-1;++x)p[x]=p[x+1];p[i-1]=h,l.current=p;const w=new Float32Array(i*4);for(let x=0;x<p.length;x++){let m=x/p.length*2-1,v=2*p[x]-1;w[4*x]=m,w[4*x+1]=v,w[4*x+2]=m,x==0?w[4*x+3]=-1:w[4*x+3]=(2*p[x-1]-1)*.975}t.bindBuffer(t.ARRAY_BUFFER,s.current),t.bufferData(t.ARRAY_BUFFER,w,t.DYNAMIC_DRAW),t.bindBuffer(t.ARRAY_BUFFER,null),window.requestAnimationFrame(u)}),n.jsx("canvas",{ref:e,className:"h-full w-full"})},cm=`
attribute vec2 coordinates;
uniform vec3 u_color;
varying vec3 color;
void main(void) {
color = mix(vec3(0.109), u_color, clamp(1.5 + coordinates.y, 0.0, 1.0));
gl_Position = vec4(coordinates, 0.0, 1.0);
}
`,um=`
precision mediump float;
varying vec3 color;
void main(void) {
gl_FragColor = vec4(color, 1.0);
}
`,dm=({min:e,max:t,minValue:r,maxValue:o,minParamId:s,maxParamId:i,minIsPluginParameter:l,maxIsPluginParameter:c,minValueSetter:u,maxValueSetter:d,skew:h,strRepr:f,suffix:p,enabled:w})=>{const x=a.useRef(0),m=a.useRef(0),v=a.useRef(),b=a.useRef(null),[S,y]=a.useState(),[g,j]=a.useState(),N=a.useMemo(()=>100*We(r,e,t,h),[r,e,t,h]),P=a.useMemo(()=>100*We(o,e,t,h),[o,e,t,h]),L=a.useMemo(()=>nr(r,f,p),[r,f,p]),I=a.useMemo(()=>nr(o,f,p),[o,f,p]),C="absolute w-[0.9vw] h-[0.9vw] border rounded-full cursor-pointer translate-x-[-50%] border border-lunaCoral bg-[#40424B]",M=a.useCallback(V=>{var Z;const E=V.clientX-x.current,q=(Z=b.current)==null?void 0:Z.getBoundingClientRect();if(!q)return;const W=E/q.width,F=Re(m.current+W,0,1);if(v.current==="min"){const Y=We(o,e,t,h),me=Re(F,0,Y-.05);u(xt(me,e,t,h))}else{const Y=We(r,e,t,h),me=Re(F,Y+.05,1);d(xt(me,e,t,h))}},[x.current,v.current,b.current,m.current,e,t,r,o]),R=a.useCallback(()=>{window.removeEventListener("mousemove",M),y(!1),j(!1)},[M]),O=a.useCallback(V=>{x.current=V.clientX,window.addEventListener("mousemove",M)},[R,M,x]),_=a.useCallback(V=>{l&&Pt(s),O(V),window.addEventListener("mouseup",$),y(!0),v.current="min",m.current=We(r,e,t,h)},[v,O,r,m,e,t,h,l,s]),z=a.useCallback(V=>{c&&Pt(i),window.addEventListener("mouseup",U),O(V),j(!0),v.current="max",m.current=We(o,e,t,h)},[v,O,o,m,e,t,h,c,i]),U=a.useCallback(()=>{c&&It(i),window.removeEventListener("mouseup",U),R()},[c,i,R]),$=a.useCallback(()=>{l&&It(s),window.removeEventListener("mouseup",$),R()},[l,s,R]);return n.jsxs("div",{className:"relative h-[0.9vw]",style:{pointerEvents:w?"auto":"none"},ref:b,children:[n.jsx("div",{className:"w-full bg-[#FFFFFF33] absolute top-[50%] h-[2px] rounded-full translate-y-[-50%]"}),n.jsx("div",{className:"bg-lunaCoral absolute top-[50%] h-[2px] rounded-full translate-y-[-50%]",style:{left:`${N}%`,width:`${P-N}%`}}),n.jsx("div",{style:{left:`${N}%`},className:C,onMouseDown:_,children:S&&n.jsx("div",{className:"absolute left-[50%] top-0 translate-x-[-50%] translate-y-[0.9vw] whitespace-nowrap",children:L})}),n.jsx("div",{style:{left:`${P}%`},className:C,onMouseDown:z,children:g&&n.jsx("div",{className:"absolute left-[50%] top-0 translate-x-[-50%] translate-y-[0.9vw] whitespace-nowrap",children:I})})]})},Hl=a.memo(dm),hn=a.memo(({label:e,onClick:t,selected:r=!1,style:o={},disabled:s=!1})=>{const[i,l]=a.useState(!1),c=a.useCallback(u=>()=>{l(u)},[l]);return n.jsx("div",{className:"flex items-center justify-center px-[0.7vw] py-[2px] cursor-pointer nowrap truncate",style:k({background:i?"linear-gradient(0deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15))":"linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15))",color:r?fe.lunaCoral:s?fe.lunaLightGray:i?"white":"#FFFFFF80",borderRadius:"3px",fontSize:"0.75rem",pointerEvents:s?"none":"auto",border:"1px solid #00000026"},o),onClick:t,onMouseOver:c(!0),onMouseLeave:c(!1),children:e})}),fm=()=>{let e=H(M=>M.selectedLFO);const t=`${e}Enabled`,r=`${e}Rate`,o=`${e}Amount`,s=`${e}TempoSyncEnabled`,i=`${e}Random`,l=`${e}Phase`,c=`${e}Smoothing`,u="envFollowLowcut",d="envFollowHighcut",h="envFollowUseSidechain",f=T(M=>M[u]),p=T(M=>M[d]),w=T(M=>M[h]),x=ze()[u],m=T(M=>M[s]),v=T(M=>e?JSON.stringify(M[e]):void 0),b=T(a.useCallback(M=>M[t],[t])),S=a.useCallback((M,R)=>{Le({[M]:R})},[]),y=ut,g=Cn,j=a.useMemo(()=>e===be.LFO1||e===be.LFO2||e===be.LFO3||e===be.ENV,[e]),N=e===be.ENV,P=a.useMemo(()=>v?JSON.parse(v):void 0,[v]),L=Ir(e),I=()=>{S(h,!w)},C=j?"h-full border border-[#FFFFFF1F] bg-[#222222DD]":"h-max border border-transparent";return n.jsxs("div",{className:`flex flex-col items-center h-full w-full select-none pointer-events-auto rounded-lg mt-auto ${C}`,style:{boxSizing:"border-box"},children:[j&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex items-center mt-[0.55vw] mb-[0.55vw] w-full pl-[0.5vw]",children:[n.jsx(Do,{paramId:t,setParameter:S,value:b,style:{marginRight:"0.55vw"}}),n.jsx("div",{className:"font-bold text-xl items-center text-[#FFFFFFCC]",children:e===be.LFO1?"LFO 1":e===be.LFO2?"LFO 2":e===be.LFO3?"LFO 3":"ENV"})]}),N?n.jsxs("div",{className:"flex flex-col items-center justify-between h-full w-full select-none pb-[0.55vw]",style:{pointerEvents:b?"auto":"none",filter:b?"":"grayscale(100%)"},children:[n.jsx("div",{className:"flex flex-col w-[90%] h-[6.75vw] items-center justify-center py-1",children:n.jsx(lm,{})}),n.jsx(hn,{label:"Sidechain",selected:w,onClick:I,style:{fontSize:"11px"}}),n.jsxs("div",{className:"flex flex-row g-1 items-center text-lunaLight text-sm w-[90%] py-1",children:[n.jsx("div",{style:{pointerEvents:"none"},children:"LO"}),n.jsx("div",{className:"grow",children:n.jsx(Hl,{min:x.min,max:x.max,minValue:f,maxValue:p,minParamId:u,maxParamId:d,minIsPluginParameter:!0,maxIsPluginParameter:!0,minValueSetter:M=>y(u,M),maxValueSetter:M=>y(d,M),skew:x.skew,strRepr:x.strRepr,suffix:x.suffix,enabled:b})}),n.jsx("div",{style:{pointerEvents:"none"},children:"HI"})]}),n.jsxs("div",{className:"flex flex-row justify-evenly items-center relative w-full",children:[n.jsx(Be,{paramId:"envFollowAttack",setter:y,small:!0}),n.jsx(Be,{paramId:"envFollowRelease",setter:y,small:!0})]}),n.jsxs("div",{className:"flex flex-row justify-evenly items-center relative w-full",children:[n.jsx(Be,{paramId:"envFollowAmount",setter:y,small:!0}),n.jsx(Be,{paramId:"envFollowGain",setter:y,small:!0})]})]}):n.jsxs("div",{className:"flex flex-col items-center justify-between h-full w-full select-none pb-[0.55vw]",style:{pointerEvents:b?"auto":"none",filter:b?"":"grayscale(100%)"},children:[n.jsx("div",{className:"flex flex-col w-[90%] h-[6.75vw] mt-[0.55vw] mb-[0.55vw] items-center justify-center",children:P&&e&&n.jsx(Zs,{id:e,lfo:P,color:L,enabled:b,animated:!0,applyPhase:!0})}),n.jsxs("div",{className:"flex flex-row justify-evenly items-center relative h-[35%] w-full pt-[1.1vw]",children:[n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"flex flex-col items-center absolute top-[-1.1vw] w-full",children:n.jsx(xn,{id:s,setter:g,value:m})}),n.jsx(Be,{paramId:r,setter:y,small:!0})]}),n.jsx(Be,{paramId:o,setter:y,small:!0})]}),n.jsxs("div",{className:"flex flex-col justify-around w-[85%] h-[35%]",children:[n.jsx(jn,{paramId:l,setter:y,horizontal:!0}),n.jsx(jn,{paramId:i,setter:y,horizontal:!0}),n.jsx(jn,{paramId:c,setter:y,horizontal:!0})]})]})]}),n.jsxs("div",{className:"grid grid-cols-2 mt-auto w-full",children:[n.jsx(Kr,{lfoType:be.LFO1,selected:e===be.LFO1,withBorders:j}),n.jsx(Kr,{lfoType:be.LFO2,selected:e===be.LFO2,withBorders:j}),n.jsx(Kr,{lfoType:be.LFO3,selected:e===be.LFO3,withBorders:j}),n.jsx(Kr,{lfoType:be.ENV,selected:e===be.ENV,withBorders:j})]})]})},mm=a.memo(fm),Kr=({lfoType:e,selected:t,withBorders:r})=>{const o=H(x=>x.selectLFO),s=H(x=>x.selectMainView),i=H(x=>x.selectedMainView),l=T(x=>x[`${e}Enabled`]),[c,u]=a.useState(!1),[,d]=gi(()=>({type:vt.LFO,item:{type:vt.LFO,lfoType:e},collect:x=>({isDragging:!!x.isDragging()})})),h=a.useMemo(()=>{if(t&&c)return n.jsx(ie,{type:X.Move,size:22});switch(e){case be.LFO1:return n.jsx(ie,{type:X.SquareWave,color:fe.lunaPurple,active:!0});case be.LFO2:return n.jsx(ie,{type:X.SquareWave,color:fe.lunaCoral,active:!0});case be.LFO3:return n.jsx(ie,{type:X.SquareWave,color:fe.lunaPink,active:!0})}return n.jsx(ie,{type:X.EnvFollower,color:"#8E83D9",active:!0})},[t,c,e]),f=a.useCallback(()=>{e===be.ENV&&(i===ee.lfoBrowser||i===ee.lfoEditor)&&s(null),o(e)},[e,i]),p=a.useCallback(x=>()=>{u(x)},[]),w=r?"#00000066":"transparent";return n.jsxs("div",{className:"flex flex-col items-center cursor-pointer pb-[0.5vw]",ref:d,style:{borderTop:`1px solid ${w}`,borderRight:e===be.LFO3||e===be.LFO1?`0.5px solid ${w}`:"",borderLeft:e===be.ENV||e===be.LFO2?`0.5px solid ${w}`:"",background:t?fe.lunaDarkGray:"none",boxShadow:t?`inset 0px 0px 10px ${fe.lunaDarkGray}`:"none",borderRadius:e===be.LFO3?"0 0 0 0.5rem":e===be.ENV?"0 0 0.5rem 0":"",filter:l?"":"grayscale(100%)"},onClick:f,onMouseEnter:p(!0),onMouseLeave:p(!1),children:[n.jsx("div",{className:"w-[2.5vw] h-[2.5vw] flex items-center justify-center",children:h}),n.jsx("div",{className:"text-xs",style:{color:t&&c?fe.lunaTextSecondary:fe.lunaLight},children:e===be.LFO1?"LFO 1":e===be.LFO2?"LFO 2":e===be.LFO3?"LFO 3":"Env"})]})},pm=()=>{const e=T(F=>F.pluginName),t=e===oe.BEAM,r=e===oe.Space,o=H(F=>F.presetSearchValue),s=H(F=>F.presetParentFolders),i=H(F=>F.toggleMainViewType),l=H(F=>F.closeDropdowns),c=H(F=>F.openSavePresetModal),u=H(F=>F.openSaveIRModal),d=H(F=>F.openSaveNodePresetModal),h=H(F=>F.showPresetFavorites),f=H(F=>F.selectedPresetTags),p=T(F=>F.activePresetPath),w=yr(F=>F.getFilesInFolder),x=T(F=>F.resizeFactor()),m=H(F=>{if(t)return null;let Z=null;switch(e){case oe.Grains:Z=F.grainASelectedPreset;break;case oe.Time:Z=F.timeASelectedPreset;break;case oe.Volt:Z=F.voltASelectedPreset;break;case oe.Filter:Z=F.filterASelectedPreset;break;case oe.Haze:Z=F.hazeASelectedPreset;break;default:Z=null}return Z||p||"Default"}),v=H(F=>{switch(e){case oe.Space:return Z=>{F.setConvDSPLoading(A.convA,!0),Le({[`${A.convA}Ir`]:Z})};case oe.Grains:return F.selectGrainAPreset;case oe.Time:return F.selectTimeAPreset;case oe.Volt:return F.selectVoltAPreset;case oe.Filter:return F.selectFilterAPreset;case oe.Haze:return F.selectHazeAPreset}}),{getFilesInFolder:b,favorites:S}=pn(),{getFilesInFolder:y}=rn(),g=T(F=>F[`${A.convA}Ir`]),[j,N]=a.useState(!1),[P,L]=a.useState(!1),I=H(F=>F.convAParentFolders),C=a.useMemo(()=>{if(e===oe.Space)return y(I);let Z=t?b(s):w([e]);return o&&(Z=Z.filter(Y=>nt(Y.path).replace(".preset","").toLowerCase().includes(o)||Y.author.toLowerCase().includes(o))),h&&(Z=Z.filter(Y=>S.includes(Y.path))),Z=Z.filter(Y=>{var me;if(!Y.tags&&f.length>0)return!1;if(!Y.tags&&f.length===0)return!0;for(const Se of f)if(!((me=Y.tags)!=null&&me.includes(Se)))return!1;return!0}),Z},[s,I,o,h,S,f,t,e]),M=a.useMemo(()=>t?nt(p!=null?p:"").replace(".preset",""):r?nt(g).replace(".impulse",""):m?nt(m!=null?m:"").replace(".nodepreset",""):"",[p,t,m,r,g]),R=F=>{F.stopPropagation(),t?c():e===oe.Space?u():d()},O=F=>{F.stopPropagation(),L(!0),setTimeout(()=>L(!1),500),Au()},_=function(F){if(F.stopPropagation(),t)i(ee.presetBrowser),l();else switch(e){case oe.Filter:i(ee.FilterPresetA);return;case oe.Grains:i(ee.GrainPresetA);return;case oe.Volt:i(ee.VoltPresetA);return;case oe.Space:i(ee.IRBrowserA);return;case oe.Time:i(ee.TimePresetA);return;case oe.Haze:i(ee.HazePresetA);return}},z=F=>{let Z=null;switch(e){case oe.Grains:Z=A.grainA;break;case oe.Time:Z=A.timeA;break;case oe.Space:Z=A.convA;break;case oe.Volt:Z=A.voltA;break;case oe.Filter:Z=A.filterA;break;case oe.Haze:Z=A.chorusA;break;default:return}e!==oe.Space&&ms(F,Z),v(F)},U=r?g:t?p:m,$=F=>de(void 0,null,function*(){F.stopPropagation();const Z=C.length;if(Z<1||Z===1&&C[0].path===U)return;let Y=C[Math.floor(Math.random()*Z)];for(;Y===U&&Z>1;)Y=C[Math.floor(Math.random()*Z)];t?yield ro(Y):z(Y.path)}),V=F=>de(void 0,null,function*(){if(F.stopPropagation(),C.length<1||C.length===1&&C[0].path===U)return;let Z=C.findIndex(Y=>Y.path===U)+1;(Z>=C.length||Z<0)&&(Z=0),t?yield ro(C[Z]):z(C[Z].path)}),E=F=>de(void 0,null,function*(){if(F.stopPropagation(),C.length<1||C.length===1&&C[0].path===U)return;let Z=C.findIndex(Y=>Y.path===U)-1;Z<0&&(Z=C.length-1),t?yield ro(C[Z]):z(C[Z].path)}),q=a.useCallback(F=>()=>{N(F)},[]),W=`${.875*x}rem`;return n.jsxs("div",{className:"flex min-w-[29vw] h-[65%] cursor-pointer",onClick:_,onMouseEnter:q(!0),onMouseLeave:q(!1),children:[n.jsxs("div",{style:{padding:"0px 0.7vw 0px 1.4vw",borderWidth:"1px 0px 1px 1px",borderColor:"#FFFFFF0F"},className:`h-full w-[87%] mr-[1px] flex items-center justify-between bg-[#FFFFFF0F] ${t?"rounded-l-full":"rounded-full"}`,children:[n.jsx("div",{className:"text-[#FFFFFFE5] truncate text-left",style:{fontSize:W},children:M}),n.jsxs("div",{className:"flex items-center justify-around h-full",style:{opacity:j?"100%":"0%",transition:"all 0.2s",transform:j?"":"translateX(1em)",width:j?"35%":"0%"},children:[n.jsx(ie,{type:X.ArrowLeft,onClick:E}),n.jsx(ie,{type:X.ArrowRight,onClick:V}),n.jsx(ie,{type:X.Shuffle,onClick:$}),n.jsx("div",{className:"ml-1",children:n.jsx(ie,{type:X.Save,onClick:R})})]})]}),t&&n.jsx("div",{className:"h-full w-[13%] flex items-center justify-center group bg-[#FFFFFF0F] rounded-r-full",style:{padding:"6px 1.4vw",borderWidth:"1px 1px 1px 0px",borderColor:"#FFFFFF0F"},onClick:O,children:n.jsxs("div",{className:"relative",style:{animation:P?"shake 0.5s":"none"},children:[n.jsx(ie,{type:X.Wand,size:4.5}),n.jsxs("div",{className:"absolute left-[50%] text-sm top-[3.4vw] text-lunaWhite translate-x-[-50%] px-2 py-1 rounded-full w-[10vw] bg-[#3A3B42] opacity-0 group-hover:opacity-100 transition-opacity ease-in-out duration-300 pointer-events-none",children:[n.jsx("div",{className:"w-[0.9vw] h-[0.9vw] absolute left-0 top-[-0.45vw] left-[50%] translate-x-[-50%] -rotate-45 bg-[#3A3B42]"}),"Generate Preset"]})]})})]})},hm=({children:e,className:t,id:r,style:o})=>n.jsx("div",{id:r,style:o,className:`luna-background rounded-lg overflow-hidden pointer-events-auto backdrop-blur-md border border-[#FFFFFF1F] ${t}`,children:e}),Dt=a.memo(hm),vm=({tabs:e,selected:t})=>{const r=T(i=>i.resizeFactor()),o=`${1.25*r}rem`,s=`${2.9*r}vw`;return n.jsx("div",{className:"flex items-center",style:{height:s},children:e.map((i,l)=>i.disabled?null:n.jsx("div",{className:"flex flex-col mr-[0.36vw] last:mr-0 h-full cursor-pointer items-center justify-center",onClick:i.disabled?()=>{}:i.onClick,style:{color:t===l?"#F48272":"#FFFFFF33",fontWeight:500,lineHeight:"42.2px",borderBottom:t===l?"2px solid #F48272":"none",padding:"0px 8px",textAlign:"center",fontSize:o,paddingBottom:t===l?"0px":"2px"},children:i.text},l))})},Wn=({items:e,selected:t,style:r={}})=>{const o=T(l=>l.resizeFactor()),s=`${.875*o}rem`,i=`${2.5*o}vw`;return n.jsx("div",{className:"flex",style:k({height:i},r),children:e.map((l,c)=>{const u=t===c?"text-[#FF9F91]":"text-white";return n.jsx("div",{className:`flex w-full items-center justify-center last:rounded-r-full first:rounded-l-full px-[1.6vw] py-[0.7vw] ml-[1px] first:ml-[0px] cursor-pointer hover:${u}`,style:k({background:t===c?"linear-gradient(0deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.1)), linear-gradient(0deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06))":"linear-gradient(0deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06)),linear-gradient(0deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))",color:t===c?fe.lunaCoral:"#FFFFFF99",border:"1px solid #FFFFFF0F",fontSize:s},r),onClick:l.onClick,children:l.label},c)})})},rr=()=>n.jsx("div",{className:"spinner"}),Et=({label:e,onClick:t,disabled:r=!1,style:o={},spinner:s})=>n.jsxs("button",{className:`flex items-center justify-center rounded ${r?"pointer-events-none":"hover:bg-[#00000026] hover:text-white"}`,style:k({width:"150px",height:"30px",color:r?fe.lunaGray:fe.lunaTextSecondary,background:"linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15))",border:"1px solid #00000026"},o),onClick:t,disabled:r,children:[e,s&&n.jsx("div",{className:"ml-[0.45vw]",children:n.jsx(rr,{})})]}),xm="https://lunacy.audio/getting-started-with-beam/",gm="https://lunacy.audio/support",wm=()=>{const e=mt(),{tooltipsOn:t,graphicsQuality:r,nodeScrolling:o,knobScrollMode:s,checkUpdates:i}=e,{setGraphicsQuality:l,setNodeScrolling:c,setKnobScrollMode:u,setTooltips:d,setCheckUpdates:h}=e,f=T(g=>g.resizeFactor()),p=T(g=>g.pluginName===oe.BEAM),w=a.useCallback(g=>()=>{Kt(g)},[Kt]),x=`${.875*f}rem`,m={className:"flex items-center",style:{height:`${2.5*f}vw`,marginBottom:`${1.1*f}vw`}},v={width:`${28*f}vw`},b="flex items-center",S={marginBottom:`${1.1*f}vw`},y=`${1.1*f}vw`;return n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"flex h-full w-full",style:{paddingTop:y},children:[n.jsxs("div",{className:"flex flex-col text-left text-[#FFFFFF99] h-full",style:{letterSpacing:"2%",fontSize:x},children:[n.jsx("div",D(k({},m),{children:"Check for Updates"})),n.jsx("div",D(k({},m),{children:"Show Tooltips"})),n.jsx("div",D(k({},m),{children:"Graphics Quality"})),p&&n.jsx(n.Fragment,{children:n.jsx("div",D(k({},m),{children:"Scrolling On Effects"}))}),n.jsx("div",D(k({},m),{children:"Knob Scroll Direction"})),n.jsx("div",D(k({},m),{children:"Window Size"}))]}),n.jsxs("div",{className:"ml-auto flex flex-col h-full",children:[n.jsx("div",{className:b,style:S,children:n.jsx(Wn,{items:[{label:"On",onClick:()=>h(!0)},{label:"Off",onClick:()=>h(!1)}],selected:i?0:1,style:v})}),n.jsx("div",{className:b,style:S,children:n.jsx(Wn,{items:[{label:"On",onClick:()=>d(!0)},{label:"Off",onClick:()=>d(!1)}],selected:t?0:1,style:v})}),n.jsx("div",{className:b,style:S,children:n.jsx(Wn,{items:[{label:"Low",onClick:()=>l(ct.Low)},{label:"Medium",onClick:()=>l(ct.Medium)},{label:"High",onClick:()=>l(ct.High)}],selected:Object.values(ct).indexOf(r),style:v})}),p&&n.jsx(n.Fragment,{children:n.jsx("div",{className:b,style:S,children:n.jsx(Wn,{items:[{label:"On",onClick:()=>c(Nn.Enabled)},{label:"Shift",onClick:()=>c(Nn.Shift)},{label:"Off",onClick:()=>c(Nn.Disabled)}],selected:Object.values(Nn).indexOf(o),style:v})})}),n.jsx("div",{className:b,style:S,children:n.jsx(Wn,{items:[{label:"Up",onClick:()=>u(on.Up)},{label:"Down",onClick:()=>u(on.Down)},{label:"Off",onClick:()=>u(on.Off)}],selected:Object.values(on).indexOf(s),style:v})}),n.jsx("div",{className:b,style:S,children:n.jsx(Wn,{items:[{label:"80%",onClick:()=>Wo(.8)},{label:"100%",onClick:()=>Wo(1)},{label:"120%",onClick:()=>Wo(1.2)}],selected:void 0,style:v})})]})]}),n.jsxs("div",{className:"flex w-full justify-between mt-auto",children:[n.jsx(Et,{label:"Watch Tutorials",style:{fontSize:x,width:"48%",height:`${2.8*f}vw`},onClick:w(xm)}),n.jsx(Et,{label:"Contact Support",style:{fontSize:x,width:"48%",height:`${2.8*f}vw`},onClick:w(gm)})]})]})},Mo=({iconRight:e,iconLeft:t,enablePaste:r,value:o,placeholder:s,style:i={},type:l,required:c,onChange:u,width:d="177px",onRightIconClick:h,onLeftIconClick:f})=>{const p=a.useRef(null),w=a.useCallback(()=>de(void 0,null,function*(){if(p.current)try{const x=yield navigator.clipboard.readText();u==null||u({target:{value:x}})}catch(x){console.error("Failed to read clipboard contents:",x)}}),[u]);return n.jsx("div",{className:"flex items-center px-[0.7vw] text-sm",style:k({width:d,height:"24px",background:"linear-gradient(0deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.06)), linear-gradient(0deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))",border:"1px solid #FFFFFF26",borderRadius:"20px",color:"#FFFFFF99"},i),children:n.jsxs("div",{className:"flex flex-row w-full gap-1 items-center",children:[n.jsx("div",{style:{cursor:f?"pointer":"auto"},onClick:f,children:t}),n.jsx("div",{className:"grow flex flex-row",children:n.jsx("input",{ref:p,value:o,placeholder:s,type:l,required:c,onChange:u,style:{width:"95%",maxWidth:"100%",height:"18px",color:"#FFFFFF99",background:"none",outline:"none",lineHeight:"16.77px"},autoCorrect:"off"})}),n.jsx("div",{style:{cursor:h?"pointer":"auto"},onClick:h,children:e}),r&&n.jsx("div",{style:{cursor:"pointer"},onClick:w,children:n.jsx(ie,{type:X.Paste})})]})})},ym=()=>{const[e,t]=a.useState(!1),{email:r,password:o,isLoading:s,loggingOut:i,error:l,login:c}=lt();return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"w-full text-center text-[#FFFFFF99] text-m p-3 mt-2",style:{letterSpacing:"2%"},children:"Registered through Beatport Access"}),n.jsxs("div",{className:"flex flex-col grow w-full items-center justify-around",children:[n.jsxs("div",{className:"flex flex-col gap-2 items-center",children:[n.jsx("div",{className:"flex items-center text-left text-[#FFFFFF99] text-sm",style:{letterSpacing:"2%"},children:"Link with Lunacy Account"}),n.jsx(Mo,{required:!0,disabled:s,type:"text",value:r,onChange:u=>lt.setState({email:u.target.value}),placeholder:"Email",iconLeft:n.jsx(ie,{type:X.Email}),style:{height:"2.25vw"},width:"24vw"}),n.jsx(Mo,{required:!0,disabled:s,type:e?"text":"password",value:o,onChange:u=>lt.setState({password:u.target.value}),placeholder:"Password",iconLeft:n.jsx(ie,{type:X.Key}),iconRight:n.jsx(ie,{type:X.Eye}),onRightIconClick:()=>t(!e),style:{height:"2.25vw"},width:"24vw"}),n.jsx("button",{className:"flex items-center justify-center bg-[#0000004D] hover:text-white w-full h-[2.25vw] mt-1 rounded text-[#FFFFFF99] text-sm",disabled:s||i,type:"submit",onClick:u=>de(void 0,null,function*(){u.preventDefault(),yield c(r,o,!0)}),children:s?n.jsx(rr,{}):"Log In"})]}),n.jsx("div",{className:"h-[1.65vw] text-sm",style:{color:fe.lunaError},children:l})]})]})},bm=({user:e,isRTO:t})=>{var w;const{subscriptions:r,email:o,username:s}=e,i=T(x=>x.resizeFactor()),l=x=>new Date(x).toLocaleDateString(),c=()=>{Kt(f)},u=r?r[0]:null,d=u!=null&&u.next_payment_date?l(u.next_payment_date):"N/A",h=(u==null?void 0:u.subscription_length)-((w=u==null?void 0:u.meta_data.find(x=>x.key==="rates_payed"))==null?void 0:w.value[0])||"N/A",f="https://lunacy.audio/account/subscription",p=`${.875*i}rem`;return n.jsx("div",{children:t&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"mb-3",children:o!=null?o:s}),n.jsxs("div",{className:"bg-white/10 rounded-md",children:[n.jsx("div",{className:"text-base bg-white/10 py-2",children:(u==null?void 0:u.product_name)||"N/A"}),n.jsxs("div",{className:"py-3 px-5",children:[n.jsxs("div",{className:"flex flex-row gap-4 justify-between",style:{fontSize:p},children:[n.jsxs("div",{children:[h," ",h===1?"payment":"payments"," left"]}),n.jsxs("div",{children:["Next Payment: ",d]})]}),n.jsx("div",{className:"text-[#AB8CC8] cursor-pointer",onClick:c,children:"Manage Subscription"})]})]})]})})},Sm=""+new URL("time-0088e65c.png",import.meta.url).href,Cm=""+new URL("fractals-c797e28e.jpeg",import.meta.url).href,Nm=""+new URL("Embers-2c6923e9.jpg",import.meta.url).href,Mm=""+new URL("patterns-8b4f1001.png",import.meta.url).href,jm=""+new URL("beam-f3bb379d.png",import.meta.url).href,Fm=""+new URL("Volt-928e0d72.png",import.meta.url).href,Am=""+new URL("filter-cb423328.png",import.meta.url).href,Lm=""+new URL("grains-790e7149.png",import.meta.url).href,km=""+new URL("space-af30d998.png",import.meta.url).href,Pm=""+new URL("haze-6e1d0dac.png",import.meta.url).href,io=[{id:jt,name:"BEAM",url:"https://lunacy.audio/products/beam/",image:jm,description:"Core Engine"},{id:lo,name:"Space Node",url:"https://lunacy.audio/products/space/",image:km,description:"Effect & Presets",isBasicNode:!0,isFreeNode:!1},{id:co,name:"Grains Node",url:"https://lunacy.audio/products/grains/",image:Lm,description:"Effect & Presets",isBasicNode:!0,isFreeNode:!1},{id:bn,name:"Volt Node",url:"https://lunacy.audio/products/volt/",image:Fm,description:"Effect & Presets"},{id:yn,name:"Time Node",url:"https://lunacy.audio/products/time/",image:Sm,description:"Effect & Presets"},{id:uo,name:"Filter Node",url:"https://lunacy.audio/products/filter/",image:Am,description:"Effect & Presets",isBasicNode:!0,isFreeNode:!0},{id:fo,name:"Haze Node",url:"https://lunacy.audio/products/haze/",image:Pm,description:"Effect & Presets",isBasicNode:!0,isFreeNode:!0},{id:cs,name:"Fractals",url:"https://lunacy.audio/products/fractals/",image:Cm,description:"Presets"},{id:ls,name:"Patterns",url:"https://lunacy.audio/products/patterns/",image:Mm,description:"Presets"},{id:us,name:"Embers",url:"https://lunacy.audio/products/embers/",image:Nm,description:"Presets"}],Im=({user:e,disabled:t})=>{const r=lt(i=>i.ownsBEAM()),o=T(i=>i.isIndividualNode()),s=a.useMemo(()=>io.map(i=>{const c=e.customerLicenses.filter(u=>i.id===jt?r:r&&i.isBasicNode?!0:Number(u.productId)===Number(i.id)).filter(u=>u.status===3||u.status===2);return{product:i,active:c.length>0}}),[e.customerLicenses,r]);return n.jsx("div",{className:`grid gap-4 py-2 mb-4 ${o?"grid-cols-4":"grid-cols-3"}`,style:{opacity:t?.3:1},children:s.map((i,l)=>n.jsx(Em,{productLicense:i},l))})},Em=({productLicense:e})=>{const{product:t,active:r}=e,o=T(c=>c.resizeFactor()),s=a.useCallback(c=>()=>{Kt(c.url)},[]),i=`${1*o}rem`,l="12vw";return n.jsx("div",{className:"relative border border-[#45484d] mb-0 rounded-t-[1.5vw] rounded-b-[0.7vw] overflow-hidden",style:{width:l,height:l},children:n.jsxs("div",{className:"rounded flex flex-col cursor-pointer w-full relative h-full relative",onClick:s(t),style:{opacity:r?1:.35},children:[n.jsx("img",{src:t.image,className:"inset-0 w-full h-[calc(100%-0.8vw)] object-cover"}),n.jsxs("div",{className:"absolute left-0 bottom-0 z-[10] bg-[#45484d] w-full text-[#d9d9d9]",style:{fontSize:i},children:[n.jsx("div",{className:"absolute left-[0.6vw] top-[calc(50%-0.4vw)] w-[0.8vw] h-[0.8vw] border rounded-full border-1 border-[#020202]",style:{backgroundColor:r?fe.lunaCoral:fe.lunaLight}}),t.name]})]})})},Rm=()=>{const e=lt(),{user:t,logout:r,isLoading:o,fetchUser:s,deactivated:i}=e,{isBeatport:l,isBeatportAndLogin:c,isRTO:u}=t!=null?t:{},d=H(g=>g.selectMainView),h=T(g=>g.resizeFactor()),f=T(g=>g.isBasicNode()),p=lt(g=>g.ownsBEAM()),[w,x]=a.useState(!1),m=()=>de(void 0,null,function*(){x(!0),yield s(),x(!1)}),v=`${.875*h}rem`,b=a.useMemo(()=>{if(!t)return null;if(t.isBeatport)return{used:1,max:1};const g=t.customerLicenses.find(j=>j.productId===Number(jt));return g?{used:g.timesActivated,max:g.timesActivatedMax}:null},[t==null?void 0:t.customerLicenses]),S=a.useMemo(()=>{var g;if(u)return n.jsx("div",{className:"flex flex-col items-center justify-center w-full text-[#FFFFFF99] py-3 gap-2",children:t&&n.jsx(bm,{user:t,isRTO:u})});if(l&&!c){if(!(t!=null&&t.id))return n.jsx(ym,{})}else{const j=`Registered to ${(g=t==null?void 0:t.email)!=null?g:t==null?void 0:t.username} ${l?"(Beatport)":""}`;return n.jsxs("div",{className:"text-left py-2",style:{fontSize:v},children:[o||!t&&Ke?n.jsx(rr,{}):j,b&&n.jsxs("div",{className:"italic",children:[b.used,"/",b.max," Activations Used"]})]})}return null},[t,u,l,o]),y=()=>de(void 0,null,function*(){yield r(),i&&d(null)});return a.useEffect(()=>{let g;return w?g=setInterval(()=>{const j=document.getElementById("rotating-div");if(!j)return;const N=j.style.rotate.match(/\d+/),P=N?parseFloat(N[0]):0;j.style.rotate=`${P+180}deg`},1e3):clearInterval(g),()=>clearInterval(g)},[w]),n.jsxs("div",{className:"h-[50%] flex flex-col justify-between h-full w-full text-[#FFFFFF99] scroll-auto",children:[S,(t==null?void 0:t.customerLicenses)&&n.jsx("div",{className:`${u?"h-[15vw]":"h-[25vw]"} overflow-y-scroll pr-2`,children:n.jsx(Im,{user:t,disabled:o||w})}),n.jsxs("div",{className:"flex flex-row w-full justify-between mt-3",style:{pointerEvents:w?"none":"auto"},children:[(c||u||!l)&&n.jsx(Et,{label:n.jsxs("div",{className:"flex gap-2 items-center h-full",children:[n.jsx("div",{id:"rotating-div",className:"transition-all ease-in-out duration-500",children:n.jsx(ie,{type:X.Update,color:o?fe.lunaGray:fe.lunaTextSecondary,active:!0})}),c?"Sync Licenses":"Refresh Licenses"]}),style:{fontSize:v,width:"48%",height:`${2.8*h}vw`},onClick:m,disabled:o}),!(p&&f)&&n.jsx(Et,{label:"Deactivate Device",style:{fontSize:v,width:"48%",height:`${2.8*h}vw`,color:fe.lunaCoral},onClick:y,disabled:o})]})]})},Dm=({onClick:e})=>{const t=r=>{r.stopPropagation(),e()};return n.jsx(ie,{type:X.Gear,size:18,onClick:t})},Bm=()=>{const e=H(c=>c.selectMainView),t=H(c=>c.selectedMainView),r=T(c=>c.resizeFactor()),o=T(c=>c.isFreeNode()),s=t===ee.Settings?0:1,i=a.useCallback(c=>{e(null),c.stopPropagation()},[]),l=`${.875*r}rem`;return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed left-0 top-0 h-full w-full z-10 backdrop-blur-xs pointer-events-auto",onClick:i,onMouseDown:i}),n.jsxs(Dt,{className:"h-[80%] p-5 flex flex-col z-20 w-[55%]",children:[n.jsxs("div",{className:"w-full flex items-center",children:[n.jsx(vm,{selected:s,tabs:[{text:"SETTINGS",onClick:()=>e(ee.Settings)},{disabled:!(Ke&&!o),text:"ACCOUNT",onClick:()=>e(ee.Account)}]}),n.jsx("div",{className:"cursor-pointer ml-auto",onClick:i,children:n.jsx(ie,{type:X.Close})})]}),n.jsx("div",{className:"flex flex-col w-full grow",children:s===0?n.jsx(wm,{}):n.jsx(Rm,{})}),n.jsxs("div",{className:"flex items-center text-left text-[#FFFFFF99]",style:{letterSpacing:"2%",fontSize:l,marginTop:`${.55*r}vw`},children:["Version: ",ds]})]})]})};function ti(e,t,r,o=0,s=1,i=1){const l=(e-o)/(s-o);return Math.pow(l,i)*(r-t)+t}const Tm=(e,t,r)=>{const[o,s]=a.useState({top:0,left:0});return a.useEffect(()=>{const i=e.current;if(!i)return;const l=()=>{const d=i.getBoundingClientRect();r?r(d.left,d.top,d.width,d.height):s({top:d.top,left:d.left})},c=new ResizeObserver(()=>{l()}),u=i.parentElement;return u&&(c.observe(u),u.addEventListener("scroll",l)),l(),()=>{u&&(c.unobserve(u),u.removeEventListener("scroll",l))}},[e,r,...t]),o},Om=()=>{const e="mix",t=ze().mix,r=T(R=>{var _;return(_=R.modulations.find(z=>z.paramId===e))==null?void 0:_.lfoType}),o=T(R=>R[`${r}Enabled`]),s=T(R=>R.macros.find(O=>O.paramId===e)!==void 0),i=T(R=>R.mixLock),[l,c]=a.useState(!1),u=a.useRef(null),d=a.useRef(null),h=a.useRef(null),f=a.useRef(),[p,w]=a.useState(!1),[{isOver:x,hoveredItem:m},v]=Pr(()=>({accept:[vt.LFO,vt.MACRO],drop:R=>de(void 0,null,function*(){R.type===vt.MACRO?Po(e):ko(R.lfoType,e)}),collect:R=>({hoveredItem:R.getItem(),isOver:R.isOver()})}),[]),b=a.useCallback(R=>ut(e,R),[]),S=()=>{const R=_e(e);if(!h.current)return;const O=ti(R,0,270,0,100);h.current.style.transform=`rotate(${O}deg)`},y=a.useCallback(R=>{if(!u.current||!d.current)return;const O=ti(R,-135,135,0,100);u.current.textContent=l?`${R.toFixed(0)}%`:"Mix",d.current.style.transform=`rotate(${O}deg)`},[l]),g=r&&o||s,j=a.useCallback(()=>{Le({mixLock:i<=.5?1:0})},[i]),N=a.useCallback(R=>{R.preventDefault(),w(!0)},[]),P=a.useCallback(()=>{w(!1)},[]);a.useLayoutEffect(()=>{y(Fe.getState()[e])},[]);const L=T(R=>R[e]);a.useEffect(()=>{y(L),f.current=L},[L,l,y]),ln(S);const{top:I,left:C}=Tm(d,[]),M=a.useMemo(()=>(m==null?void 0:m.lfoType)===be.LFO1?"hover-lfo-1":(m==null?void 0:m.lfoType)===be.LFO2?"hover-lfo-2":(m==null?void 0:m.lfoType)===be.LFO3?"hover-lfo-3":"hover-macro",[m==null?void 0:m.lfoType,m==null?void 0:m.type]);return n.jsxs("div",{ref:v,className:"flex items-center text-sm text-[#FFFFFF99] relative gap-[1vw]",onContextMenu:N,children:[i>=.5&&l&&n.jsx(ie,{type:X.Lock,size:4}),n.jsx("p",{ref:u,style:{pointerEvents:"none"}}),n.jsxs("div",{className:"relative",children:[n.jsxs("div",{ref:d,className:"cursor-pointer flex",children:[n.jsx(Tn,{paramId:"mix",className:"absolute w-full h-full",setter:b,setShowValue:c,info:t}),n.jsx(ie,{type:X.Mix})]}),n.jsx("div",{ref:h,className:"w-full h-full absolute top-0 let-0 pointer-events-none",children:g&&n.jsx("div",{className:"w-[0.3vw] h-[0.3vw] bg-lunaLight absolute bottom-0 left-0 rounded-full overflow-hidden"})})]}),n.jsx("div",{className:`w-full h-[1px] absolute left-0 top-[50%] translate-y-[-50%] pointer-events-none transition-opacity duration-300 ease-in-out ${M}`,style:{opacity:x?100:0}}),n.jsx(Bn,{children:p&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"w-full h-full absolute left-0 top-0 z-[80]",onMouseDown:P}),n.jsxs("div",{className:"absolute border z-[100] text-lunaWhite text-sm translate-x-[-50%] translate-y-[100%] bg-[#373B45] p-2 border-[#FFFFFF1F] rounded-md cursor-pointer flex gap-2",style:{left:C,top:I},onClick:j,children:[i>=.5?"Unlock":"Lock",n.jsx(ie,{type:i>=.5?X.Lock:X.LockOpen,size:5})]})]})})]})},_m=({mute:e=!1,snapshotId:t})=>{const r=`h-full ${e?"audio-meter-outer-muted":"audio-meter-outer"}`,o=a.useRef(),s=a.useRef(0);return ln(i=>{var u;if(!o.current||Date.now()-s.current<30)return;s.current=Date.now();const l=(u=i.snapshots[t])!=null?u:-60,c=Vs(Number(l!=null?l:-60));o.current.style.height=`${100-c}%`}),a.useLayoutEffect(()=>{o.current.style.height="100%"},[]),n.jsx("div",{className:"rotate-180 flex items-center justify-between w-[3px] rounded-full overflow-hidden relative",children:n.jsx("div",{className:r,children:n.jsx("div",{ref:o,className:"audio-meter-inner w-full bg-[#151e24] absolute bottom-0"})})})},ni=({mute:e=!1,snapshotId:t})=>{const r=`w-full ${e?"horizontal-audio-meter-outer-muted":"horizontal-audio-meter-outer"}`,o=a.useRef(),s=a.useRef(0);return ln(i=>{var u;if(!o.current||Date.now()-s.current<30)return;s.current=Date.now();const l=(u=i.snapshots[t])!=null?u:-60,c=Vs(Number(l!=null?l:-60));o.current.style.width=`${100-c}%`}),a.useLayoutEffect(()=>{o.current.style.width="100%"},[]),n.jsx("div",{className:"rotate-180 flex items-center justify-between h-[3px] rounded-full overflow-hidden relative w-full",children:n.jsx("div",{className:r,children:n.jsx("div",{ref:o,className:"audio-meter-inner h-full bg-[#1B272E] absolute left-0 top-0"})})})},ri=a.memo(_m),Vm=()=>{const e="volume",t=ze()[e],r=a.useCallback(x=>ut(e,x),[]),o=a.useRef(null),s=a.useRef(null),i=a.useRef(null),[l,c]=a.useState(!1),u=x=>{x||(x=0),s.current&&i.current&&(s.current.style.left=`${We(x,t.min,t.max,t.skew)*100}%`,i.current.textContent=`${x.toFixed(2)}dB`)},d=a.useRef();T(x=>{const m=x[e];m!==d.current&&(u(m),d.current=m)}),a.useLayoutEffect(()=>{u(Fe.getState()[e])},[]);const h=a.useCallback(x=>{var b;x.preventDefault(),x.stopPropagation();const m=(b=o.current)==null?void 0:b.getBoundingClientRect();if(!m)return;const v=Re((x.clientX-m.left)/m.width,0,1);r(xt(v,t.min,t.max,t.skew))},[]),f=a.useCallback(()=>{Cn(e,t.defaultValue)},[t.defaultValue,r]),p=a.useCallback(()=>{window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",p),c(!1),It(e)},[h]),w=a.useCallback(x=>{x.preventDefault(),x.stopPropagation(),c(!0),Pt(e),window.addEventListener("mousemove",h),window.addEventListener("mouseup",p)},[p,h]);return n.jsxs("div",{ref:o,className:"flex flex-col justify-between w-[9vw] h-[0.9vw] relative cursor-pointer group",onMouseDown:w,onDoubleClick:f,children:[n.jsx(ni,{mute:!1,snapshotId:"left_snapshot"}),n.jsx(ni,{mute:!1,snapshotId:"right_snapshot"}),n.jsx("div",{ref:s,className:"w-[1.4vw] h-[1.45vw] absolute top-0 translate-x-[-50%] translate-y-[-3px] cursor-pointer flex justify-center",style:{},onMouseDown:w,children:n.jsx("div",{className:"w-[0.36vw] h-[1.45vw] rounded-full bg-lunaExtraLight"})}),n.jsx("div",{ref:i,className:"text-lunaExtraLight text-sm absolute top-[1.45vw] w-full text-center group-hover:opacity-100 transition-opacity ease-in-out duration-300",style:{opacity:l?100:0}})]})},zm=()=>{const e=H(o=>o.toggleMainViewType),t=H(o=>o.showTweaksPanel),r=a.useCallback(o=>{o.stopPropagation(),e(ee.Mappings)},[e]);return n.jsxs("div",{className:"group relative flex items-center cursor-pointer px-4 py-2 border border-[#FFFFFF0F] rounded-full hover:bg-lunaLightGray transition-colors select-none h-[65%]",style:{backgroundColor:t?"bg-lunaLightGray":"#FFFFFF0F"},onClick:r,children:[n.jsx(ie,{type:X.Settings}),n.jsxs("div",{className:"absolute left-[50%] text-sm top-[3.9vw] text-lunaWhite translate-x-[-50%] px-2 py-1 rounded-full w-[10vw] bg-[#3A3B42] opacity-0 group-hover:opacity-100 transition-opacity ease-in-out duration-300 pointer-events-none",children:[n.jsx("div",{className:"w-[0.9vw] h-[0.9vw] absolute top-[-0.45vw] left-[50%] translate-x-[-50%] -rotate-45 bg-[#3A3B42]"}),"Open Mappings"]})]})},$m=a.memo(zm),Um=()=>{const e=Mn(l=>l.undo),t=Mn(l=>l.redo),r=Mn(l=>l.canUndo()),o=Mn(l=>l.canRedo()),s=a.useCallback(l=>{l.stopPropagation(),e()},[]),i=a.useCallback(l=>{l.stopPropagation(),t()},[]);return n.jsxs("div",{className:"mx-6 flex flex-row items-center g-2",children:[n.jsx(ie,{type:X.Undo,size:20,onClick:s,color:r?"#FFFFFFCC":"#FFFFFF66"}),n.jsx(ie,{type:X.Redo,size:20,onClick:i,color:o?"#FFFFFFCC":"#FFFFFF66"})]})};function Hm(){console.log("render header");const e=T(d=>d.pluginName),t=T(d=>d.isIndividualNode()),r=T(d=>d.resizeFactor()),o=H(d=>d.selectMainView),s=H(d=>d.toggleMainViewType),i=d=>{d.stopPropagation(),o(ee.Credits)},l=a.useCallback(()=>{o(null)},[o]),c=()=>{s(ee.Settings)},u=`${1.85*r}vw`;return n.jsxs("div",{className:"h-[7%] flex flex-row g-1 px-2 justify-between w-full items-center pointer-events-auto",onClick:l,children:[n.jsx("div",{className:"flex w-[25%]",children:n.jsx("div",{className:"cursor-pointer ml-4 text-white font-bold leading-[0.8] tracking-widest",onClick:i,style:{fontFamily:"TTNormsProBold",fontSize:u},children:e})}),n.jsxs("div",{className:"w-[50%] flex flex-row justify-center items-center h-full",children:[n.jsx(Um,{}),n.jsx(pm,{}),!t&&n.jsx("div",{className:"ml-[2vw] h-full flex items-center",children:n.jsx($m,{})})]}),n.jsxs("div",{className:"w-[25%] flex flex-row justify-end items-center mr-6",style:{gap:"2.5vw"},children:[!t&&n.jsx(Om,{}),n.jsx(Vm,{}),n.jsx(Dm,{onClick:c})]})]})}const Gm=({children:e})=>{const r=`${1.25*T(o=>o.resizeFactor())}rem`;return n.jsx("div",{className:"font-bold text-left luna-title text-nowrap",style:{display:"inline-block",background:`linear-gradient(95.57deg, ${fe.lunaCoral} -39.58%, #B398FF 174.65%)`,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent",pointerEvents:"none",fontSize:r,backgroundRepeat:"no-repeat",backgroundSize:"100% calc(100% - 6px)",backgroundPosition:"0 4px"},children:e})},Vr=a.memo(Gm),Wm=()=>{const e=Ps(m=>m.getFilesInStore(m.lfoStore)),t=H(m=>m.selectedLFO),r=H(m=>m.selectMainView),o=T(m=>t?JSON.stringify(m[t]):void 0),s=a.useMemo(()=>o?JSON.parse(o):void 0,[o]),i=m=>m.path.split(/[/\\]/).includes("Lunacy"),l=["Sine.lfo","Triangle.lfo","Square.lfo","Saw.lfo"],c=m=>{const v=m.path.split(/[/\\]/).pop();return i(m)&&v&&l.includes(v)},u=m=>{const v=m.path.split(/[/\\]/).pop();return v&&l.includes(v)?l.indexOf(v):l.length},d=a.useMemo(()=>e.sort((m,v)=>{const b=c(m),S=c(v);return b&&S?u(m)-u(v):b&&!S?-1:S&&!b?1:i(m)&&!i(v)?-1:!i(m)&&i(v)?1:m.name.localeCompare(v.name)}),[e]),h=a.useMemo(()=>s&&Ys(e,s),[t,s,e]),f=a.useMemo(()=>d.map(m=>s===void 0?!1:JSON.stringify(s.points)===JSON.stringify(m.points)&&s.name===m.name),[s,t,d]),p=Ir(t),w=a.useMemo(()=>{switch(t){case"convALFO":return"Space A Motion Shape";case"convBLFO":return"Space B Motion Shape";case"convCLFO":return"Space C Motion Shape";case"lfoOne":return"LFO 1 Shape";case"lfoTwo":return"LFO 2 Shape";case"lfoThree":return"LFO 3 Shape"}return""},[t]);a.useCallback(()=>de(void 0,null,function*(){const m=yield Xt("LFO");yield Na(m)}),[Xt,Na]);const x=a.useCallback(()=>{r(null)},[r]);return n.jsxs(Dt,{className:"p-3 flex flex-col w-full h-full",children:[n.jsxs("div",{className:"text-white flex p-1 justify-between items-center",children:[n.jsx(Vr,{children:w}),n.jsx("div",{onClick:x,className:"cursor-pointer",children:n.jsx(ie,{type:X.Close})})]}),!Vt,n.jsx("div",{className:"overflow-y-scroll",children:n.jsxs("div",{className:"grid grid-cols-7",children:[d.map((m,v)=>{const b=f[v]?p:fe.lunaTextSecondary;return n.jsx(oi,{lfo:m,isSelected:f[v],color:b,selectedLFO:t},v)}),!h&&s&&n.jsx(oi,{lfo:s,isSelected:!0,color:p,selectedLFO:t},"edited-lfo")]})})]})},oi=a.memo(({lfo:e,isSelected:t,selectedLFO:r,color:o})=>{const s=Ps(c=>c.getFilesInStore(c.lfoStore)),i=a.useMemo(()=>Ys(s,e),[e,s]),l=a.useCallback(()=>{Le({[r]:e})},[r,e]);return n.jsx("div",{className:"p-1",children:n.jsxs("div",{className:"flex flex-col items-center p-3 rounded-md g-1 cursor-pointer border border-[#FFFFFF1A]",style:{backgroundColor:t?fe.lunaDarkGray:"#2c2d33CC"},onClick:l,children:[n.jsx("div",{className:"h-[7.2vw] w-full",children:n.jsx(Zs,{id:r,lfo:e,color:o,editMode:!0,preventRemove:!i})}),n.jsxs("div",{className:"text-sm whitespace-nowrap max-w-[100%] overflow-hidden overflow-ellipsis",style:{color:o},children:[e.name,!i&&"*"]})]})})}),Ys=(e,t)=>{for(let r of e)if(t.name===r.name&&JSON.stringify(t.points)===JSON.stringify(r.points))return!0;return!1},qm=a.memo(Wm),si=({value:e,setter:t,canvasRef:r,min:o,max:s,dir:i=1})=>{const l=a.useRef(e),c=(f,p)=>{const w=r.current;if(!w)return;const x=w.getBoundingClientRect(),m=100*(f.clientX-x.left),v=Re(m/x.width,o,s);(v!==l.current||p)&&(t(v,p),l.current=v)},u=f=>{c(f,!1)},d=f=>{c(f,!0),f.stopPropagation(),window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",d)},h=f=>{f.stopPropagation(),Ft(),window.addEventListener("mousemove",u),window.addEventListener("mouseup",d)};return n.jsx("div",{className:"absolute top-0 h-full w-[1.8vw] translate-x-[-50%] cursor-col-resize z-10 flex flex-col justify-center items-center",style:{left:`${e}%`},onMouseDown:h,children:n.jsx("svg",{height:"14",width:"14",style:{transform:`translateX(${-7*i}px)`},children:n.jsx("circle",{cx:7+i*7,cy:7,r:7,fill:"#DADADA80"})})})},ai=5,ii=({pos:e,fade:t,canvasRef:r,min:o,max:s,setter:i,dir:l=1})=>{const c=r.current,u=a.useRef(0),d=a.useRef(t),h=(x,m)=>{if(!c)return;const v=c.getBoundingClientRect(),b=x.clientX-v.left;let S=l*(100*b/v.width-e-l*ai);S=Re(S,o,s),(S!==d.current||m)&&(i(S,m),d.current=S)},f=x=>{h(x,!1)},p=x=>{h(x,!0),x.stopPropagation(),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",p)},w=x=>{x.stopPropagation(),Ft(),u.current=x.clientX,window.addEventListener("mousemove",f),window.addEventListener("mouseup",p)};return n.jsx("div",{className:"absolute top-[0.8vw] rounded-full w-[1vw] h-[1vw] border border-lunaCoral translate-x-[-50%] shadow-lg",style:{left:`${e+t*l+ai*l}%`},onMouseDown:w})},Zm=e=>e>=1e3?`${(e/1e3).toFixed(1)}s`:`${Math.round(e)}ms`,fn=13,li=function(e){return Math.abs(e)<.001?0:e<0?-.3333*Math.log10(-e/.001):.3333*Math.log10(e/.001)},Ym=e=>{var ae,we,Ae,Ce,qe;const{loading:t,width:r,height:o,reverse:s,type:i}=e,l=`${i}Ir`,c=`${i}StartPos`,u=`${i}EndPos`,d=`${i}FadeIn`,h=`${i}FadeOut`,f=`${i}Stretch`,p=T(B=>B.resizeFactor()),w=H(B=>B.setShowErrorModal),x=H(B=>B.setErrorModalText),m=rn(B=>B.getFile),v=rn(B=>B.numUpdates),b=T(a.useCallback(B=>B[l],[l])),S=T(a.useCallback(B=>B[c],[c])),y=T(a.useCallback(B=>B[u],[u])),g=T(a.useCallback(B=>B[d],[d])),j=T(a.useCallback(B=>B[h],[h])),N=T(a.useCallback(B=>B[f],[f])),P=a.useRef(null),[L,I]=a.useState(1),C=a.useRef(0),M=a.useRef(0),R=a.useRef(0),O=(B,G,pe,ke,Pe=!0)=>{Le({[c]:B,[u]:G,[d]:pe,[h]:ke},Pe,!1)},_=(B,G=!0)=>Le({[d]:Math.max(0,B)},G,!1),z=(B,G=!0)=>Le({[h]:Math.max(0,B)},G,!1),U=a.useMemo(()=>m(b),[m,b,v]),{peaksMin:$,peaksMax:V}={peaksMin:(we=(ae=U==null?void 0:U.peaks)==null?void 0:ae.min)!=null?we:[],peaksMax:(Ce=(Ae=U==null?void 0:U.peaks)==null?void 0:Ae.max)!=null?Ce:[]},E=s?100-y:S,q=s?100-S:y,W=s?j:g,F=s?g:j,Z=s?z:_,Y=s?_:z,me=(B,G,pe,ke,Pe)=>{s?O(100-G,100-B,ke,pe,Pe):O(B,G,pe,ke,Pe)},Se=a.useMemo(()=>$&&V,[$,V]),je=a.useMemo(()=>Math.max(q-E-W-fn,0),[q,E,W]),ye=a.useMemo(()=>Math.max(q-E-F-fn,0),[q,E,F]),le=a.useCallback(()=>{const B=P.current;if(!B||!Se||!$||!V)return;const G=B.getContext("2d"),pe=$.length,ke=r/pe,Pe=o/2;G.clearRect(0,0,r,B.height),I(1);for(let pt=0;pt<pe;++pt){const en=100*pt/pe;en>=E&&en<q?G.fillStyle="#F48272aa":G.fillStyle="#555";const dr=pt*ke,_n=Pe*(1+.8*li($[s?pe-pt-1:pt])),$r=1+Pe*(1+.8*li(V[s?pe-pt-1:pt]))-_n;G.fillRect(dr,_n,ke,$r)}const Ie=E*r/100,$e=q*r/100,Xe=W*r/100,De=F*r/100,Ve=Ie+Xe,et=Ie+.3*Xe,rt=Ie+.7*Xe,ot=$e-De,J=$e-.7*De,Ee=$e-.3*De;G.fillStyle="#0004",G.beginPath(),G.moveTo(0,o),G.lineTo(Ie,o),G.bezierCurveTo(et,o,rt,0,Ve,0),G.lineTo(0,0),G.fill(),G.moveTo(ot,0),G.bezierCurveTo(J,0,Ee,o,$e,o),G.lineTo(r,o),G.lineTo(r,0),G.fill(),G.lineWidth=4;const Ze=G.createLinearGradient(0,0,r,0);Ze.addColorStop(0,"#CF7C6E"),Ze.addColorStop(1,"#E47BA2"),G.strokeStyle=Ze},[P.current,Se,$,V,E,q,W,F,r,o,s]),Me=a.useCallback(B=>{B.stopPropagation()},[]),ve=(B,G)=>{const pe=100*(B.clientX-C.current);if(!P||!P.current)return;const ke=P.current.getBoundingClientRect().width,Pe=Re(pe/ke,-M.current,100-R.current);me(E+Pe,q+Pe,W,F,G)},K=B=>{ve(B,!1)},ce=B=>{window.removeEventListener("mousemove",K),window.removeEventListener("mouseup",ce),ve(B,!0),B.stopPropagation()},re=a.useCallback(B=>{B.stopPropagation(),Ft(),window.addEventListener("mousemove",K),window.addEventListener("mouseup",ce),C.current=B.clientX,M.current=E,R.current=q},[K,ce,E,q]);a.useEffect(()=>{le()},[Se,$,V,E,q,W,F,t,L,r,o,s]),a.useEffect(()=>{v>0&&b&&$.length===0&&V.length===0&&(console.log($,V,v,b),x("The following impulse could not be loaded in this preset: "+nt(b)),w(!0))},[b,$,V,v]);const te=N*.01*((qe=U==null?void 0:U.lengthMs)!=null?qe:0),ue=`${1*p}vw`,he=q-E<25,Q=100-q<20,Ne=he?Q?"left-0 translate-x-[-100%]":"right-0 translate-x-[100%]":"right-0",xe=he?"bg-[#1a1a1acc]":"bg-[#242424cc]";return n.jsxs("div",{style:{borderColor:"#111111",height:o},className:"bg-lunaDark rounded-lg border-[1px] relative shadow-and-glow relative w-full",children:[n.jsx("canvas",{ref:P,className:"rounded-md overflow-hidden w-full",width:r,height:o,style:{width:r,height:o}}),n.jsx("div",{onClick:Me,onMouseDown:re,className:"border absolute top-0 h-full rounded-md border-[#DADADA80] flex flex-col justify-end text-[#DADADA80]",style:{left:`${E}%`,width:`${q-E}%`,fontSize:ue},children:te&&n.jsx("div",{className:`absolute ${Ne} p-[1px]`,children:n.jsx("div",{className:`${xe} px-1 rounded`,children:Zm(te*((q-E)/100))})})}),n.jsx(si,{value:E,setter:(B,G)=>{me(B,q,Math.min(W,Math.max(0,q-B-F-fn)),Math.min(F,Math.max(0,q-B-fn)),G)},canvasRef:P,min:0,max:q-fn}),n.jsx(si,{value:q,setter:(B,G)=>{me(E,B,Math.min(W,Math.max(0,B-E-fn)),Math.min(F,Math.max(0,B-E-W-fn)),G)},canvasRef:P,min:E+fn,max:100,dir:-1}),n.jsx(ii,{pos:E,fade:W,canvasRef:P,setter:Z,min:0,max:ye}),n.jsx(ii,{pos:q,fade:F,canvasRef:P,setter:Y,min:0,max:je,dir:-1}),(!Se||t)&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-black/25 rounded-md",style:{border:"1px solid transparent"}}),n.jsx("div",{style:{color:fe.lunaCoral},className:"absolute text-sm top-0 left-0 w-full h-full flex flex-row items-center justify-center",children:t?"Loading":"Load file"})]})]})},Xm=a.memo(Ym),Km=({type:e,enabled:t})=>{const r=`${e}Ir`,o=`${e}Reverse`,s=rn(F=>F.hasFile),i=rn(F=>F.getFilesInFolder),l=rn(F=>F.numUpdates),c=rn(F=>F.favorites),u=H(F=>F.setConvDSPLoading),d=H(F=>{switch(e){case A.convA:return F.convADSPLoading;case A.convB:return F.convBDSPLoading;case A.convC:return F.convCDSPLoading}return!1}),h=H(F=>{switch(e){case A.convA:return F.convAParentFolders;case A.convB:return F.convBParentFolders;case A.convC:return F.convCParentFolders}return[""]}),f=H(F=>{switch(e){case A.convA:return F.convASearchValue;case A.convB:return F.convBSearchValue;case A.convC:return F.convCSearchValue}return""}),p=H(F=>{switch(e){case A.convA:return F.convAShowFavorites;case A.convB:return F.convBShowFavorites;case A.convC:return F.convCShowFavorites}return!1}),w=H(F=>F.toggleMainViewType),x=T(F=>F.isIndividualNode()),m=T(F=>F.resizeFactor()),v=T(a.useCallback(F=>F[r],[r])),b=T(a.useCallback(F=>F[o],[o])),S=a.useRef(null),[y,g]=a.useState(0),[j,N]=a.useState(0),[P,L]=a.useState(!1),[I,C]=a.useState(""),[,M]=Pr({accept:[yc],drop:(F,Z)=>{let Y=F.files[0].name;const me=Y.split(".");let Se=me[0];const je=me[1];let ye=1,le="";for(;s(Nr(["Impulse Responses","User","Imported",`${Se}${le}`]));)le=`_${ye}`,ye+=1;Y=`${Se}${le}.${je}`;const Me=Z.getItem().files[0];u(e,!0);const ve=new FileReader;ve.onloadend=K=>{const ce=K.target.result;if(ce){if(K.total>5e6){C("File too large: Max 5MB"),setTimeout(()=>{C("")},3e3);return}Pu(Y,r,ce.split(",")[1])}},ve.readAsDataURL(Me)}}),R=a.useMemo(()=>{let F=i(h);return f&&(F=F.filter(Z=>nt(Z.path).replace(".preset","").toLowerCase().includes(f.toLowerCase()))),p&&(F=F.filter(Z=>c.includes(Z.path))),F},[h,f,p,l]),O=a.useMemo(()=>{switch(e){case A.convA:return ee.IRBrowserA;case A.convB:return ee.IRBrowserB;case A.convC:return ee.IRBrowserC}},[e]),_=a.useMemo(()=>nt(v).replace(".impulse",""),[v]),z=()=>{u(e,!0),Le({[o]:+!b})},U=F=>{u(e,!0),Le({[r]:F})},$=()=>de(void 0,null,function*(){if(R.length<1||R.length===1&&R[0].path===v)return;let F=R.findIndex(Z=>Z.path===v)+1;(F>=R.length||F<0)&&(F=0),U(R[F].path)}),V=()=>de(void 0,null,function*(){if(R.length<1||R.length===1&&R[0].path===v)return;let F=R.findIndex(Z=>Z.path===v)-1;F<0&&(F=R.length-1),U(R[F].path)}),E=()=>de(void 0,null,function*(){const F=R.length;if(F<1||F===1&&R[0].path===v)return;let Z=R[Math.floor(Math.random()*F)].path;for(;Z===v&&F>1;)Z=R[Math.floor(Math.random()*F)].path;U(Z)}),q=a.useCallback(()=>{O&&w(O)},[O,w]);a.useEffect(()=>{L(d)},[d]),a.useLayoutEffect(()=>{N(window.innerWidth*Co*m);const F=new ResizeObserver(Z=>{for(let Y of Z)g(Y.contentRect.width*m),N(window.innerWidth*Co*m)});return S.current&&F.observe(S.current),()=>{S.current&&F.unobserve(S.current)}},[S,m]);const W=x?"text-lg":"text-sm";return n.jsxs("div",{ref:S,className:"w-full relative",style:{pointerEvents:t?"auto":"none"},children:[n.jsxs("div",{ref:M,className:"cursor-pointer",children:[I&&n.jsx("div",{className:"text-white text-sm",children:I}),n.jsx(Xm,{type:e,loading:d,width:y,height:j,reverse:b})]}),n.jsxs("div",{className:"absolute w-full left-0 translate-y-[100%] flex flex-row items-center justify-between g-2",style:{bottom:`${-1.4*m}vw`,height:`${2*m}vw`},children:[n.jsx("div",{className:`text-left text-white truncate overflow-hidden cursor-pointer ${W}`,style:{color:fe.lunaLight},onClick:q,children:P?n.jsx(rr,{}):_}),n.jsxs("div",{className:"flex flex-row items-center g-2",children:[n.jsx(ie,{type:X.ArrowLeft,onClick:V}),n.jsx(ie,{type:X.ArrowRight,onClick:$}),n.jsx(ie,{type:X.Shuffle,onClick:E}),n.jsx("div",{className:"border-l h-[1.4vw]",style:{borderColor:"#ffffff77"}}),n.jsx(ie,{type:X.Reverse,onClick:z,active:b})]})]})]})},ur=({type:e})=>{const t=`${e}Enabled`,r=T(l=>l.isIndividualNode()),o=a.useCallback((l,c)=>{Le({[l]:c},!0,!1)},[]),s=T(l=>l[t]),i=a.useMemo(()=>{const l=Vl(e);return r?l.split(" ")[0]:l},[e,r]);return n.jsxs(n.Fragment,{children:[n.jsx(Do,{paramId:t,setParameter:o,value:s,style:{marginRight:"0.55vw"}}),n.jsx(Vr,{children:i})]})},Oo=({children:e,submoduleId:t,title:r,width:o,nodeEnabled:s})=>{const i=T(a.useCallback(d=>d[t],[t])),l=T(d=>d.resizeFactor()),c=a.useCallback((d,h)=>{Le({[d]:h})},[]),u=`${l}rem`;return n.jsxs("div",{id:"motion-container",className:"h-full box-border px-[1.2vw] justify-between",style:{width:o,background:"#00000022",borderWidth:"0px 0.5px 0px 0.5px",borderStyle:"solid",borderColor:"#0000004D",filter:i?"":"grayscale(100%)"},children:[n.jsxs("div",{className:"flex flex-row g-1 items-center w-full h-[20%]",children:[n.jsx(Do,{paramId:t,setParameter:c,value:i,style:{marginRight:"0.3vw"}}),n.jsx("div",{className:"text-[#FFFFFFBF] font-medium pointer-events-none",style:{fontSize:u},children:r})]}),n.jsx("div",{className:"h-[70%] relative flex flex-row justify-between",style:{pointerEvents:s&&i?"auto":"none",opacity:i?1:.5},children:e})]})},Jm=({paramId:e})=>{const[t,r]=a.useState(),o=a.useRef(-1),s=a.useRef(null),i=a.useRef(null),l=a.useRef(0),c=a.useRef(0),u=a.useRef(0),d=a.useRef(0),h=a.useRef(null),f=ze()[e],p=()=>{const x=h.current;if(!x||!t)return;x.style.width="100%",x.style.height="100%";const m=x.getBoundingClientRect();x.width=m.width,x.height=m.height,t.viewport(0,0,x.width,x.height)};a.useLayoutEffect(()=>(window.addEventListener("resize",p),p(),()=>{window.removeEventListener("resize",p)}),[h.current,t]),a.useEffect(()=>{if(!h.current)return;const m=h.current.getContext("webgl",{premultipliedAlpha:!1,alpha:!0});var v=m.createShader(m.VERTEX_SHADER);if(!v)return;if(m.shaderSource(v,Qm),m.compileShader(v),!m.getShaderParameter(v,m.COMPILE_STATUS)){console.error("ERROR compiling vertex shader!",m.getShaderInfoLog(v)),m.deleteShader(v);return}var b=m.createShader(m.FRAGMENT_SHADER);if(m.shaderSource(b,ep),m.compileShader(b),!m.getShaderParameter(b,m.COMPILE_STATUS)){console.error("ERROR compiling fragment shader!",m.getShaderInfoLog(b)),m.deleteShader(b);return}var S=m.createProgram();m.attachShader(S,v),m.attachShader(S,b),m.linkProgram(S),i.current=m.getUniformLocation(S,"u_time"),l.current=m.getUniformLocation(S,"u_value"),c.current=m.getUniformLocation(S,"u_circleValue"),u.current=m.getUniformLocation(S,"u_displayCircle"),m.useProgram(S),o.current=m.getAttribLocation(S,"coordinates"),s.current=m.createBuffer();const y=[-1,1,-1,-1,1,-1,-1,1,1,-1,1,1];var g=new Float32Array(y);return m.bindBuffer(m.ARRAY_BUFFER,s.current),m.bufferData(m.ARRAY_BUFFER,g,m.STATIC_DRAW),m.bindBuffer(m.ARRAY_BUFFER,s.current),m.vertexAttribPointer(o.current,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(o.current),r(m),()=>{m.deleteShader(v),m.deleteShader(b),m.deleteProgram(S),m.deleteBuffer(s.current)}},[h]);const w=()=>{if(!t)return;const x=(Fe.getState()[e]-f.min)/(f.max-f.min);let[m,v]=Ar(e);m=(m-f.min)/(f.max-f.min);const b=performance.now()/100;t.uniform1f(i.current,b),t.uniform1f(l.current,x),t.uniform1f(c.current,m),t.uniform1i(u.current,v?1:0),t.drawArrays(t.TRIANGLES,0,6),d.current=requestAnimationFrame(w)};return a.useEffect(()=>{if(t)return d.current=requestAnimationFrame(w),()=>{cancelAnimationFrame(d.current)}},[t]),n.jsx("canvas",{ref:h,className:"absolute top-0 left-0 translate-y-[-1.5%] translate-x-[-0.5%]"})},Gl=a.memo(Jm),Qm=`
attribute vec2 coordinates;
varying vec2 st;
void main(void) {
st = coordinates;
gl_Position = vec4(coordinates, 0.0, 1.0);
}
`,ep=`
precision mediump float;
varying vec2 st;
uniform float u_time;
uniform float u_value;
uniform bool u_displayCircle;
uniform float u_circleValue;
float PI = 3.14159265358979;
float rand(float n) {
return fract(sin(n) * 43758.5453123);
}
void main() {
float radius = sqrt(st.x*st.x + st.y*st.y);
float angle = atan(st.x, st.y); // Normalized [-1,1]
float smoothness = 0.05;
// The 0.8 and 0.95 factor is because brightness is applied later,
// so it should be initially darker
vec3 colorA = vec3(0.9, 0.6196, 0.80) * 0.90;
vec3 colorB = vec3(0.9531, 0.5078, 0.4453) * 1.00; // lunaCoral
vec3 color = mix(colorA, colorB, clamp(angle / (PI * 0.7), -1.0, 1.0));
// We'll draw a ring. Knowing the angle, we can know the coordinate
// where a point in the ring with that angle should be
float RING_RADIUS = 0.67;
float RING_AMPLITUDE = 0.1;
float minA = -PI * 0.75;
float maxA = PI * 0.75;
float a = min(maxA, max(minA, angle));
float rx = RING_RADIUS * sin(a);
float ry = RING_RADIUS * cos(a);
// Now we calculate how far we are to the ring
float drx = rx - st.x;
float dry = ry - st.y;
float dr = sqrt(drx*drx + dry*dry);
float minAngle = minA - RING_AMPLITUDE;
float maxAngle = maxA + RING_AMPLITUDE;
float nA = (a - minAngle) / (maxAngle - minAngle);
// Light
float dL = abs(dr - 0.01); // Distance to the bright zone
vec3 light = vec3(1. - dL * 5.0);
// Iterate through the stars
for(int i=0; i<150; i++){
// We will randomly define the distance to the center
float starDistance = 0.02 + rand(float(i*5));
// float starDistance = 0.6;
// this will define the star size
float starSize = min(0.00005/starDistance, 0.001);
// Since we want a rotation effect, we will first calculate
// the polar coordinates, and then convert them to cartesian.
float angle = (0.0005 * u_time / starDistance) + rand(float(i)) * 2.0 * PI;
// float radius = 0.07 + rand(float(i)*13.)*0.9;
float radius = RING_RADIUS + (rand(float(i)*13.) - 0.5) * RING_AMPLITUDE * 2.0;
// Polar to cartesian
float x = radius*sin(angle);
float y = radius*cos(angle);
// Calculate distance to pixel
vec2 p = vec2(x, y);
float dx = st.x-p.x;
float dy = st.y-p.y;
float d = dx*dx+dy*dy;
// Draw star/pixel
light += vec3(smoothstep(starSize, 0., d)) * 0.4;
}
color *= light;
// Edge between active and non-active arc
float t = smoothstep(u_value - 0.005, u_value + 0.005, nA);
color = mix(color, vec3(0.1132, 0.1210, 0.1484), t);
float k = smoothstep(RING_AMPLITUDE - 0.01, RING_AMPLITUDE + 0.05, dr);
color = mix(color, vec3(0.), k);
// White circle
float distToCircle = 1.;
if (u_displayCircle) {
float circleAngle = u_circleValue * (maxAngle - minAngle) + minAngle;
vec2 circleSt = vec2(sin(circleAngle), cos(circleAngle)) * (1.0 - 2.8 * RING_AMPLITUDE);
distToCircle = distance(st, circleSt);
color = mix (vec3(1.0), color, smoothstep(RING_AMPLITUDE, RING_AMPLITUDE + 0.025, distToCircle));
}
// Final alpha calculation
float alpha = 1.0;
if (dr <= RING_AMPLITUDE) {
alpha = 1.0;
} else {
alpha = 1.0 - min(smoothstep(RING_AMPLITUDE, RING_AMPLITUDE + 0.05, dr), smoothstep(RING_AMPLITUDE, RING_AMPLITUDE + 0.025, distToCircle));
}
gl_FragColor = vec4(color, alpha);
}
`,_o=({id:e,enabled:t})=>{const r=a.useCallback((o,s)=>{ut(o,s)},[]);return n.jsx("div",{id:"mix-container",className:"flex justify-center items-center w-[10%] h-full",style:{pointerEvents:t?"auto":"none"},children:n.jsx(Be,{paramId:e,setter:r,special:n.jsx(Gl,{paramId:e}),spacingTop:!0})})},tp=({node:e})=>{const{type:t}=e,r=H(F=>F.setConvDSPLoading),o=T(F=>F.isIndividualNode()),s=H(F=>F.toggleMainViewType),i=Ps(F=>F.getFilesInStore(F.lfoStore)),l=a.useMemo(()=>{switch(t){case A.convA:return be.LFO_CONV_A;case A.convB:return be.LFO_CONV_B;case A.convC:return be.LFO_CONV_C}return be.LFO_CONV_C},[t]),c=`${t}Mix`,u=`${t}Stretch`,d=`${l}Amount`,h=`${l}Rate`,f=`${l}TempoSyncEnabled`,p=`${t}PreDelay`,w=`${t}PreDelSyncEnabled`,x=`${t}PreDelSmoothEnabled`,m=`${t}Enabled`,v=`${l}Enabled`,b=`${l}Random`,S=`${l}Smoothing`,y=`${l}Phase`,g=T(a.useCallback(F=>F[w],[w])),j=T(a.useCallback(F=>F[f],[f])),N=T(a.useCallback(F=>F[m],[m])),P=T(a.useCallback(F=>F[v],[v])),L=T(a.useCallback(F=>F[x],[x])),I=T(F=>JSON.stringify(F[l])),C=JSON.parse(I),[M,R]=a.useState(!1),O=a.useMemo(()=>Ys(i,C),[C,i]),_=ut,z=Cn,U=a.useCallback((F,Z)=>{Le({[F]:Z},!0,!1)},[]),$=a.useCallback((F,Z)=>{Le({[F]:Z},!1)},[]),V=a.useCallback((F,Z)=>{r(t,!0),U(F,Z)},[]),E=a.useCallback(()=>{const F=t===A.convA?ee.IRBrowserA:t===A.convB?ee.IRBrowserB:ee.IRBrowserC;s(F)},[t,s]),q=a.useCallback(()=>{if(i.length>1){const F=[...i].filter(Y=>Y.name!==C.name);let Z=F[Math.floor(Math.random()*F.length)];Le({[l]:Z})}},[C,i]),W=a.useCallback(()=>{z(x,L?0:1)},[x,L]);return a.useEffect(()=>{C.points||Le({[l]:i[0]})},[C]),a.useEffect(()=>{R(!0)},[]),n.jsxs("div",{className:"node-panel items-center justify-between ",style:{filter:N?"":"grayscale(100%)",opacity:M?100:0},children:[n.jsxs("div",{id:"convolution-container",className:"w-[58%] flex flex-row items-center h-full justify-between",children:[n.jsxs("div",{className:"flex flex-col w-[52%] relative h-full",children:[n.jsxs("div",{className:"absolute flex h-[15%] items-center translate-y-[50%]",children:[n.jsx(ur,{type:t}),!o&&n.jsx("div",{className:"flex items-center cursor-pointer pl-[0.5vw]",style:{pointerEvents:N?"auto":"none"},onClick:E,children:n.jsx(ie,{type:X.Search,size:20})})]}),n.jsx("div",{className:"h-full flex flex-col justify-center",children:n.jsx(Km,{type:t,enabled:N})})]}),n.jsxs("div",{className:"h-full grow",children:[n.jsx("div",{className:"h-[20%]"}),n.jsx("div",{id:"convolution-knobs",className:"flex flex-col justify-end w-full px-[1.5vw] h-[70%]",style:{pointerEvents:N?"auto":"none"},children:n.jsxs("div",{className:"flex flex-row justify-around",children:[n.jsx(Be,{paramId:u,setter:V,interfaceSetter:$}),n.jsx(Be,{paramId:p,setter:_,beforeLabel:n.jsx(xn,{setter:z,id:w,value:g}),afterLabel:n.jsx(ie,{type:X.Smooth,onClick:W,size:20,active:L})})]})})]})]}),n.jsxs(Oo,{submoduleId:v,title:"Mix Motion",width:"31%",nodeEnabled:N,children:[n.jsxs("div",{className:"h-full flex flex-col w-[45%]",children:[n.jsx("div",{className:"cursor-pointer overflow-hidden relative w-full grow",children:n.jsx(Zs,{id:l,lfo:C,color:"#ffffffaa",enabled:N&&P,animated:!0,applyPhase:!0})}),n.jsxs("div",{className:"flex flex-row items-center w-[90%] mt-[0.55vw]",children:[n.jsxs("div",{className:"grow text-lunaExtraLight max-w-[100%] text-ellipsis truncate",style:{textWrap:"nowrap",pointerEvents:"none"},children:[C.name,!O&&"*"]}),n.jsx("div",{onClick:q,children:n.jsx(ie,{type:X.Shuffle})})]})]}),n.jsxs("div",{className:"h-full w-[50%] flex justify-around",children:[n.jsxs("div",{className:"flex flex-col justify-between items-center h-full",children:[n.jsx(Be,{paramId:h,setter:_,labelLength:5,beforeLabel:n.jsx(xn,{id:f,setter:z,value:j}),small:!0}),n.jsx(Be,{paramId:d,small:!0,setter:_})]}),n.jsxs("div",{className:"flex flex-col justify-between items-center h-full",children:[n.jsx(jn,{paramId:y,setter:_}),n.jsx(jn,{paramId:b,setter:_}),n.jsx(jn,{paramId:S,setter:_})]})]})]}),n.jsx(_o,{id:c,enabled:N})]})},np=a.memo(tp),jo=a.memo(({paramId:e,labelName:t})=>{const r=ze()[e],o=T(x=>x.resizeFactor()),[s,i]=a.useState(!1),l=a.useRef(null),c=a.useRef(null),u=a.useCallback((x,m)=>{ut(x,m)},[]),d=()=>{if(l.current&&c.current){const x=Fe.getState()[e];l.current.textContent=nr(x,r.strRepr||[],r.suffix||"",!0),c.current.style.left=`${x}%`}};T(d),a.useLayoutEffect(d,[]);const h=a.useMemo(()=>`${.8*o}vw`,[o]),f=s?"opacity-100":"opacity-0",p=`${.75*o}rem`,w=`transition-opacity ease-in-out duration-150 text-lunaExtraLight absolute pointer-events-none ${f}`;return n.jsxs("div",{className:"relative",style:{margin:"0 auto",width:h,height:h,fontSize:p},children:[n.jsxs("div",{className:"w-full h-full rounded-full overflow-hidden shadow-and-glow bg-[#ffffff88] relative cursor-pointer",children:[n.jsx(Tn,{paramId:e,className:"absolute w-full h-full",setShowValue:i,setter:x=>u(e,x),info:r}),n.jsx("div",{ref:c,className:"absolute rounded-full bg-lunaDark top-0 w-full h-full pointer-events-none",style:{}})]}),n.jsx("div",{ref:l,className:`${w} right-[-0.4vw] translate-x-[100%] top-[50%] translate-y-[-50%]`}),n.jsx("div",{className:`${w} left-[-0.35vw] top-[50%] translate-x-[-100%] translate-y-[-50%]`,children:t===void 0?"Rand":t})]})}),gn=({horizontal:e=!1,length:t="100%",stroke:r=2,color:o="#000000"})=>n.jsx("div",{className:"opacity-80",style:{width:e?t:`${r}px`,height:e?`${r}px`:t,backgroundColor:o}}),rp=4,op=[1/96,1/64,3/128,1/48,1/32,3/64,1/24,1/16,3/32,1/12,1/8,3/16,1/6,1/4,3/8,1/3,1/2,3/4,1],sp=({type:e,grainDelayTempoSyncEnabled:t,grainEnabled:r,grainDelayEnabled:o})=>{const s=`${e}DelayFeedback`,i=`${e}Delay`,l="grainDelayMs",c="grainDelaySync",u=a.useMemo(()=>ze(),[]),{min:d,max:h}=u[l],{min:f,max:p}=u[c],{min:w,max:x,skew:m}=u[s],v=u[t?c:l];v||console.error("toggleParam not found");const{min:b,max:S,skew:y}=v,g=H(W=>W.bpm),j=T(W=>W[i]),N=T(W=>W[s]),P=a.useRef(0),L=a.useRef(0),I=a.useRef(0),C=a.useRef(!1),M=a.useRef(null),R=a.useRef(null),O=a.useRef(null),_=a.useRef(null),z=a.useCallback(W=>{var Se;const F=(Se=M.current)==null?void 0:Se.getBoundingClientRect();if(!F)return;const Z=Re((W.clientX-F.left)/F.width,0,1),Y=Re((F.height-(W.clientY-F.top))/F.height,0,1),me=xt(Y,w,x,m);ut(i,Z),ut(s,me)},[M.current,t,f,d,p,h]),U=()=>{const W=_e(s),F=_e(i),Z=We(W,w,x,1),Y=O.current,me=M.current,Se=_.current;if(!(P.current===Z&&L.current===F&&I.current===g&&C.current===t)&&(Y&&me&&Se&&(P.current=Z,L.current=F,I.current=g,C.current=t),Y&&(Y.style.left=`${100*F}%`,Y.style.bottom=`${100*Z}%`),me&&Se)){const{width:je}=me.getBoundingClientRect(),ye=xt(F,b,S,y),le=t?op[Math.round(ye)]:ye*g/(rp*60*1e3),Me=2,ve=Math.max(le,.02);let K=ve*je/Me,ce=ve/le*(100/3)*Math.max(Math.log10(Z),-3);Se.innerHTML="";let re=0,te=100;for(;re<=je&&te>0;){const ue=document.createElement("div");ue.className="absolute bottom-0 w-[1px]",ue.style.display="",ue.style.left=`${re}px`,ue.style.height=`${te}%`,ue.style.background=Ro("#FF8C73","#8747FE",re/je),Se.appendChild(ue),te+=ce,re+=K}}},$=W=>{const F=W[i],Z=W[s],Y=We(Z,w,x,1),me=R.current;me&&(me.style.left=`${100*F}%`,me.style.bottom=`${100*Y}%`)},V=a.useCallback(W=>(window.addEventListener("mouseup",E),window.addEventListener("mousemove",q),Pt(i),Pt(s),z(W),()=>{window.removeEventListener("mouseup",E),window.removeEventListener("mousemove",q)}),[t]),E=a.useCallback(()=>{window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",E),It(i),It(s)},[t]),q=a.useCallback(W=>{z(W)},[z]);return a.useEffect(U,[j,N,g,t]),ln(U),T($),n.jsxs("div",{ref:M,className:"h-full w-full relative cursor-pointer",style:{pointerEvents:o&&r?"auto":"none"},onMouseDown:V,children:[n.jsx("div",{className:"absolute w-full h-full flex justify-between",children:Array.from({length:9},(W,F)=>n.jsx("div",{className:"h-full w-[1px] bg-[#ffffff14]"},F))}),n.jsx("div",{ref:_,className:"absolute inset-0"}),n.jsx("div",{ref:R,className:"absolute w-[0.9vw] h-[0.9vw] border-[2px] border-lunaExtraLight rounded-full cursor-pointer translate-x-[-50%] translate-y-[50%]",onMouseDown:V}),n.jsx("div",{ref:O,className:"absolute w-[0.3vw] h-[0.3vw] bg-lunaExtraLight rounded-full cursor-pointer translate-x-[-50%] translate-y-[50%] pointer-events-none",onMouseDown:V})]})},ap=({paramId:e,setter:t})=>{const r=T(g=>g.modulations.find(j=>j.paramId===e)!==void 0),o=T(g=>g.macros.find(j=>j.paramId===e)!==void 0),s=T(g=>g.resizeFactor()),[{isOver:i,hoveredItem:l},c]=Pr(()=>({accept:[vt.LFO,vt.MACRO],drop:g=>de(void 0,null,function*(){g.type===vt.MACRO?Po(e):ko(g.lfoType,e)}),collect:g=>({hoveredItem:g.getItem(),isOver:g.isOver()})}),[e]),u=a.useRef(null),d=a.useRef(null),[h,f]=a.useState(0),p=a.useMemo(()=>(l==null?void 0:l.lfoType)===be.LFO1?"hover-lfo-1":(l==null?void 0:l.lfoType)===be.LFO2?"hover-lfo-2":(l==null?void 0:l.lfoType)===be.LFO3?"hover-lfo-3":"hover-macro",[l==null?void 0:l.lfoType,l==null?void 0:l.type]),w=a.useMemo(()=>ze()[e],[e]),{min:x,max:m}=w;T(g=>{if(!d.current)return;const j=g[e];d.current.textContent=(j>0?"+":"")+Math.round(j).toString()});const v=a.useCallback(()=>{f(window.innerWidth*Co*s)},[s,window.innerWidth]);a.useLayoutEffect(()=>(v(),window.addEventListener("resize",v),()=>{window.removeEventListener("resize",v)}),[v]);const b=`${.875*s}rem`,S=a.useMemo(()=>`${6*s}vw`,[s]),y=3*s;return n.jsxs("div",{ref:c,className:"flex flex-col justify-between relative",style:{width:S},children:[n.jsxs("div",{className:"flex justify-between absolute w-[90%] left-[5%] z-20 top-0 translate-y-[-50%]",children:[r?n.jsx(So,{paramId:e,size:h*.18,type:Ye.LFO}):n.jsx("div",{}),o?n.jsx(So,{paramId:e,size:h*.18,type:Ye.MACRO}):n.jsx("div",{})]}),n.jsxs("div",{ref:u,className:"text-[2.1vw] font-medium text-lunaCoral cursor-pointer flex flex-col items-center justify-center px-1",style:{width:h,height:h},children:[n.jsx("div",{className:`absolute rounded-full w-10 h-0 z-[-10] ${p}`,style:{opacity:i?100:0}}),n.jsxs("div",{className:"flex flex-row justify-center items-center",children:[n.jsx(ns,{paramId:e,modMacro:Ye.LFO,o:0,min:-1,max:1,color:fe.lunaLight,visible:r}),n.jsxs("div",{className:"relative text-center w-[4.5vw]",children:[n.jsx(Tn,{paramId:e,className:"absolute w-full h-full",setter:g=>t(e,g),info:w}),n.jsx("span",{ref:d})]}),n.jsx(ns,{paramId:e,o:0,min:x,max:m,color:fe.lunaCoral,visible:!0}),n.jsx(ns,{paramId:e,modMacro:Ye.MACRO,o:0,min:-1,max:1,color:fe.lunaNavy,visible:o})]})]}),n.jsx("div",{className:"text-lunaLight flex flex-col items-center justify-end",style:{pointerEvents:"none",fontSize:b,height:`${y}vw`},children:"Pitch"})]})},ip=a.memo(ap),ns=({paramId:e,modMacro:t,o:r,min:o,max:s,color:i,visible:l})=>{if(!l)return n.jsx("div",{className:"w-[3px] h-[1.8vw] m-[2px]"});const c=a.useRef(null);return T(u=>{var m,v;if(!c.current)return;let d=u[e];if(t===Ye.LFO||t===Ye.ENV?d=(m=u.modulations.find(b=>b.paramId===e))==null?void 0:m.strength:t===Ye.MACRO&&(d=(v=u.macros.find(b=>b.paramId===e))==null?void 0:v.strength),d===void 0)return;const h=d>=r,f=h?s-r:r-o,p=Math.abs(d)/f,w=h?`${50-50*p}%`:"50%",x=`${p*50}%`;c.current.style.top=w,c.current.style.height=x}),n.jsx("div",{className:"relative w-[3px] h-[2.25vw] rounded-full bg-lunaDarkGray overflow-hidden m-[2px]",children:n.jsx("div",{ref:c,className:"absolute w-full",style:{background:i}})})},lp=({value:e,onClick:t})=>{const o=.875*T(s=>s.resizeFactor());return n.jsx("div",{onClick:t,className:"cursor-pointer",style:{paddingBottom:o},children:e?n.jsx(ie,{type:X.Link,hoverColor:fe.lunaCoral,color:fe.lunaCoralAccent,onClick:t}):n.jsx(ie,{type:X.Link,onClick:t})})},cp=({value:e})=>{const t=["M60.6,1457.2V1000l0,0h1878.9v457.3","M60.6,1457.2L60.6,1457.2l940.2-913.7l938.6,913.7",`M60.6,1457.2L60.6,1457.2l29.5-2.2l29.5-6.6l31.1-11.7l31.1-16.5l34.4-23.5l36-30.2l41-40.8
l45.9-52.8l54.1-70.4l67.2-96.4l235.9-346.9l54.1-66l45.9-48.2l41-36l36-25.7l32.8-18.1l31.1-12.4l29.5-7.3l29.5-2.8l29.5,1.6
l29.5,6l29.5,10.4l31.1,15.6l32.8,21.4l36,29.1l39.3,37.9l44.2,49.5l52.4,66.6l63.9,90.1l99.9,151l103.2,153.2l62.2,83.5l50.8,60
l44.2,44.8l39.3,33.2l36,24.5l32.8,16.9l31.1,11.2l29.5,6.2l26.2,1.8`,`M60.6,1457.2L60.6,1457.2l18-2.2l18-6.5l19.7-12l21.3-18.4l24.6-27.9l29.5-41.7l34.4-58l44.2-84.5
l103.2-201l34.4-55.7l29.5-39.2l26.2-26.9l22.9-16.7l19.7-8.9l18-3.7l32.8-0.3l930.4,2.1l18,6.4l19.7,11.9l21.3,18.3l24.6,27.7
l29.5,41.6l34.4,57.9l44.2,84.5l103.2,201.1l34.4,55.8l29.5,39.3l26.2,27l22.9,16.8l19.7,9l18,3.8l6.6,0.3`,`M60.6,1457.2L60.6,1457.2l3.3-327.6l6.6-183.5l8.2-121.8l8.2-77.6l9.8-63.6l9.8-44.3l11.5-36
l11.5-24.5l13.1-18.2l13.1-10.6l13.1-5l13.1-0.8l14.7,3l18,7.9l22.9,15l29.5,24.7l42.6,42.3l73.7,81.1l140.9,154.8l81.9,82.3
l75.4,69.2l73.7,61.4l72.1,54.2l72.1,48.6l72.1,43.4l72.1,38.5l73.7,34.6l75.4,30.8l77,27.1l80.3,23.9l83.5,20.5l86.8,17.1
l90.1,13.6l95,10.2l99.9,6.6l106.5,2.9l27.8,0.1`,`M60.6,1457.2L60.6,1457.2l615.9-1.2l98.3-2.7l68.8-4.3l54.1-5.7l45.9-7.4l39.3-8.8l36-10.6l34.4-13
l32.8-15.5l32.8-19.1l32.8-23.4l32.8-28.2l31.1-31.9l29.5-35.2l29.5-40.5l31.1-48.7l32.8-58l34.4-68l39.3-85.5l59-137.5l52.4-119.3
l27.8-55.8l22.9-38.8l18-24.5l16.4-16.6l14.7-9.7l11.5-3.7l9.8-0.2l9.8,2.6l9.8,5.6l11.5,10.5l13.1,17.5l13.1,23.4l14.7,33.6
l16.4,46.2l18,61.3l21.3,85.1l26.2,119.8l78.6,372l16.4,58.4l13.1,36.6l11.5,23.2l9.8,12.5l8.2,4.8l3.3,0.4`];return n.jsx("svg",{x:"0px",y:"0px",viewBox:"0 0 2000 2000",width:"50%",children:n.jsx("path",{fill:"none",stroke:fe.lunaCoral,strokeWidth:100,d:t[e]})})},up=({node:e})=>{const{type:t}=e,r=H(ye=>ye.toggleMainViewType),o=`${t}Mix`,s=`${t}Rate`,i=`${t}RateTempoSyncEnabled`,l=`${t}RandomRate`,c=`${t}Size`,u=`${t}RateSizeLink`,d=`${t}RandomSize`,h=`${t}Spray`,f=`${t}Pitch`,p=`${t}Detune`,w=`${t}Arp`,x=`${t}RandomPan`,m=`${t}RevProb`,v=`${t}WindowType`,b=`${t}Delay`,S=`${t}DelayTempoSyncEnabled`,y=`${t}DelaySmoothEnabled`,g=`${t}DelayFeedback`,j=`${t}DelayLowcut`,N=`${t}DelayHighcut`,P=`${t}DelayEnabled`,L=`${t}Enabled`,I=T(ye=>ye[i]),C=T(ye=>ye[u]),M=T(ye=>ye[v]),R=T(ye=>ye[S]),O=T(ye=>ye[j]),_=T(ye=>ye[N]),z=T(ye=>ye[L]),U=T(ye=>ye[P]),$=T(ye=>ye[y]),V=T(ye=>ye.isIndividualNode()),E=a.useMemo(()=>ze(),[]),[q,W]=a.useState(!1),F=ut,Z=Cn,Y=E[j],me=a.useCallback(()=>{const ye=t==="grainA"?ee.GrainPresetA:t==="grainB"?ee.GrainPresetB:ee.GrainPresetC;r(ye)},[r,t,z]),Se=a.useCallback(()=>Z(u,1-Number(C)),[u,C]),je=a.useCallback(()=>Z(y,$?0:1),[y,$]);return a.useEffect(()=>{W(!0)},[]),n.jsxs("div",{className:"node-panel",style:{filter:z?"":"grayscale(100%)",opacity:q?100:0},children:[n.jsxs("div",{className:"w-[60%] h-full relative",children:[n.jsxs("div",{className:"flex h-[20%] items-center translate-y-[0.55vw]",children:[n.jsx(ur,{type:t}),!V&&n.jsx("div",{className:"flex items-center cursor-pointer pl-[0.5vw]",style:{pointerEvents:z?"auto":"none"},onClick:me,children:n.jsx(ie,{type:X.Search,size:20})})]}),n.jsxs("div",{className:"h-[70%] flex flex-row justify-between gap-2",children:[n.jsx("div",{className:"h-full w-full flex flex-col justify-end",children:n.jsxs("div",{className:"flex items-center w-full",id:"grain-container",style:{pointerEvents:z?"auto":"none"},children:[n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute top-[-1.25vw] left-0 w-full flex justify-center",children:n.jsx(jo,{paramId:l})}),n.jsx(Be,{paramId:s,setter:F,labelLength:6,beforeLabel:n.jsx(xn,{id:i,setter:Z,value:I})})]}),n.jsx("div",{className:"z-10 grow h-full flex flex-col items-center justify-end relative",children:n.jsx("div",{className:"absolute bottom-0",children:n.jsx(lp,{value:C,onClick:Se})})}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute top-[-1.25vw] left-0 w-full flex justify-center",children:n.jsx(jo,{paramId:d})}),n.jsx(Be,{paramId:c,setter:F})]}),n.jsx("div",{className:"grow"}),n.jsx(Be,{paramId:v,setter:F,icons:n.jsx(cp,{value:M})}),n.jsx("div",{className:"grow"}),n.jsx(ip,{paramId:f,setter:F}),n.jsx("div",{className:"grow"}),n.jsx(Be,{paramId:w,setter:F})]})}),n.jsx(gn,{length:"100%"}),n.jsxs("div",{className:"flex flex-col justify-between w-[35%] h-full",children:[n.jsxs("div",{className:"flex flex-row justify-around",children:[n.jsx(Be,{paramId:h,small:!0,setter:F}),n.jsx(Be,{paramId:x,small:!0,setter:F})]}),n.jsxs("div",{className:"flex flex-row justify-around",children:[n.jsx(Be,{paramId:m,small:!0,setter:F}),n.jsx(Be,{paramId:p,small:!0,setter:F})]})]})]})]}),n.jsxs(Oo,{width:"29%",title:"Delay",submoduleId:P,nodeEnabled:z,children:[n.jsxs("div",{className:"flex flex-col w-[57%] h-full",children:[n.jsx("div",{className:"h-full",children:n.jsx(sp,{type:t,grainDelayTempoSyncEnabled:R,grainEnabled:z,grainDelayEnabled:U})}),n.jsxs("div",{className:"flex flex-row g-1 items-center text-lunaLight text-sm h-[15%]",children:[n.jsx("div",{style:{pointerEvents:"none"},children:"LO"}),n.jsx("div",{className:"grow",children:n.jsx(Hl,{enabled:U,min:Y.min,max:Y.max,minValue:O,maxValue:_,minParamId:j,maxParamId:N,minIsPluginParameter:!0,maxIsPluginParameter:!0,minValueSetter:ye=>F(j,ye),maxValueSetter:ye=>F(N,ye),skew:Y.skew,strRepr:Y.strRepr,suffix:Y.suffix})}),n.jsx("div",{style:{pointerEvents:"none"},children:"HI"})]})]}),n.jsxs("div",{className:"flex flex-col items-center justify-between w-[35%] h-full",children:[n.jsx(Be,{paramId:b,setter:F,labelLength:6,beforeLabel:n.jsx(xn,{id:S,setter:Z,value:R}),afterLabel:n.jsx(ie,{type:X.Smooth,onClick:je,size:20,active:$}),small:!0}),n.jsx(Be,{paramId:g,small:!0,setter:F})]})]}),n.jsx(_o,{id:o,enabled:z})]})},dp=a.memo(up),fp=({ScopeId:e,mode:t})=>{const r=a.useRef(null),[o,s]=a.useState(),i=a.useRef(-1),l=a.useRef(null),c=a.useRef(null);a.useEffect(()=>{if(!r.current)return;const m=r.current.getContext("webgl",{premultipliedAlpha:!1,alpha:!0});var v=m.createShader(m.VERTEX_SHADER);if(v){if(m.shaderSource(v,mp),m.compileShader(v),!m.getShaderParameter(v,m.COMPILE_STATUS)){console.error("ERROR compiling vertex shader!",m.getShaderInfoLog(v)),m.deleteShader(v);return}var b=m.createShader(m.FRAGMENT_SHADER);if(m.shaderSource(b,pp),m.compileShader(b),!m.getShaderParameter(b,m.COMPILE_STATUS)){console.error("ERROR compiling fragment shader!",m.getShaderInfoLog(b)),m.deleteShader(b);return}var S=m.createProgram();m.attachShader(S,v),m.attachShader(S,b),m.linkProgram(S),c.current=m.getUniformLocation(S,"u_readWriteX");var y=m.getUniformLocation(S,"u_color");return m.useProgram(S),i.current=m.getAttribLocation(S,"coordinates"),m.uniform3fv(y,t===zt.Pitch?[.41,.39,.63]:[.93,.56,.48]),l.current=m.createBuffer(),m.bindBuffer(m.ARRAY_BUFFER,l.current),m.vertexAttribPointer(i.current,2,m.FLOAT,!1,0,0),m.enableVertexAttribArray(i.current),m.bindBuffer(m.ARRAY_BUFFER,null),s(m),()=>{m.deleteShader(v),m.deleteShader(b),m.deleteProgram(S),m.deleteBuffer(l.current)}}},[r.current,t]);const u=a.useRef(0),d=a.useRef(0),h=a.useRef(0),f=a.useRef(),p=a.useRef(0),w=()=>{!o||!u.current||(o.uniform2f(c.current,d.current,h.current),o.bindBuffer(o.ARRAY_BUFFER,l.current),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.LINES,0,u.current*2))};return a.useLayoutEffect(()=>{w()},[]),Er(x=>{if(!o||!x.scopes||!x.scopes[e]||Date.now()-p.current<30)return;p.current=Date.now();const m=x.scopes[e].max,v=x.scopes[e].min;if(!m||m.length===0||!v||v.length===0||m.length!==v.length)return;const b=m.length,S=x.scopes[e].readPointer/b,y=x.scopes[e].writePointer/b;h.current=y*2-1,d.current=S*2-1;const g=[];for(let j=0;j<b;j++){let N=j/b*2-1,P=m[j],L=v[j];g.push(N,P),g.push(N,L)}(!f.current||f.current.length!=g.length)&&(f.current=new Float32Array(g)),f.current.set(g),o.bindBuffer(o.ARRAY_BUFFER,l.current),o.bufferData(o.ARRAY_BUFFER,f.current,o.DYNAMIC_DRAW),o.bindBuffer(o.ARRAY_BUFFER,null),u.current=b,window.requestAnimationFrame(w)}),n.jsx("canvas",{ref:r,className:"h-full w-full"})},mp=`
attribute vec2 coordinates;
uniform vec2 u_readWriteX;
uniform vec3 u_color;
varying vec3 color;
void main(void) {
// color = mix(vec3(0.109), u_color, clamp(1.5 + coordinates.y, 0.0, 1.0));
color = u_color;
float d = coordinates.x - u_readWriteX.x;
float MAX_DISTANCE = 2.0;
// Let's normalized it:
d = abs(d / MAX_DISTANCE);
// Let's make the ramp stronger:
d = max(1.0 - d * 20., 0.);
// Now, the further from the present, the darker.
float brightness = 0.6 + 0.3 * d;
color = u_color * brightness;
gl_Position = vec4(coordinates, 0.0, 1.0);
}
`,pp=`
precision mediump float;
varying vec3 color;
void main(void) {
gl_FragColor = vec4(color, 1.0);
}
`,ci=.02,hp=16,vp=({type:e,section:t,setter:r,interfaceSetter:o,i:s,containerRef:i,mode:l,sections:c,divideSection:u,x:d,separations:h,enabled:f=!0})=>{const p=`${e}:0`;let{width:w,stretch:x,pitch:m,target:v,reverse:b}=t;const S=a.useRef(null),y=a.useRef(null),g=a.useRef(!1),j=a.useRef(0),N=a.useRef(0),[P,L]=a.useState(!1),[I,C]=a.useState(!1),M=a.useRef(Date.now()),R=a.useRef(0),O=a.useRef(null),_=a.useRef(null),z=l===zt.Speed,U=l===zt.Pitch,$=l===zt.Shuffle,[V,E]=a.useState(0),q=z||U,W=U?m:x,F=W[0]===W[1],Z=W[0]>W[1],Y=W[0]<=W[1],me=S.current===0,Se=S.current===1,je=w<=1/16,ye=()=>{const G=O.current,pe=_.current;if(!G||!pe)return;const ke=G.getBoundingClientRect(),{width:Pe,height:Ie}=ke;E(Pe);const $e=[0,(1-W[0])*Ie],Xe=[Pe,(1-W[1])*Ie],De=[Pe,U?Ie/2:Ie*2],Ve=[0,U?Ie/2:Ie*2];pe.setAttribute("d",`M${$e.join(" ")} L${Xe.join(" ")} L${De.join(" ")} L${Ve.join(" ")} Z`)};a.useEffect(()=>{if(ye(),!O.current)return;const G=new ResizeObserver(()=>{ye()});return G.observe(O.current),()=>{G.disconnect()}},[O,_,W[0],W[1],w,l]);const le=a.useCallback(G=>pe=>{Ft(),pe.stopPropagation();const ke={width:w,stretch:[...x],pitch:[...m],target:G,reverse:b};r(ke)},[t]),Me=G=>{Ft(),G.stopPropagation();const pe={width:w,stretch:[...x],pitch:[...m],target:v,reverse:!b};r(pe)},ve=(G,pe)=>{if(S.current===null||!i.current)return;const ke=i.current.getBoundingClientRect();let Pe=Re(1-(G.clientY-ke.top)/ke.height,0,1);const Ie=1/4,$e=Math.round(Pe/Ie)*Ie;U?Pe=Math.round(Pe*48)/48:Math.abs(Pe-$e)<=ci&&(Pe=$e);const Xe=l===zt.Pitch?"pitch":"stretch";t[Xe][S.current]=Pe,pe?r(t):o(t)},K=(G,pe)=>{if(!i.current)return;const ke=i.current.getBoundingClientRect();let Pe=Re(N.current+(j.current-G.clientY)/ke.height,0,1);const Ie=1/4,$e=Math.round(Pe/Ie)*Ie;U?Pe=Math.round(Pe*48)/48:Math.abs(Pe-$e)<=ci&&(Pe=$e);const Xe=l===zt.Pitch?"pitch":"stretch";t[Xe][0]=Pe,t[Xe][1]=Pe,pe?r(t):o(t)},ce=()=>{const G=l===zt.Pitch?"pitch":"stretch";t[G]=[.5,.5],r(t)},re=G=>z?(G*200).toFixed(0)+"%":(G*48-24).toFixed(0)+"st",te=G=>G<0?G+1:G%1,ue=G=>{window.removeEventListener("mousemove",he),window.removeEventListener("mouseup",ue),ve(G,!0),S.current=null},he=G=>{ve(G,!1)},Q=a.useCallback(G=>pe=>{Ft(),pe.stopPropagation(),S.current=G,window.addEventListener("mousemove",he),window.addEventListener("mouseup",ue)},[t.width,t.stretch,t.pitch,l]),Ne=()=>{je||u()},xe=G=>{K(G,!1)},ae=G=>{window.removeEventListener("mousemove",xe),window.removeEventListener("mouseup",ae),K(G,!0),g.current=!1},we=G=>{$||(Ft(),window.addEventListener("mousemove",xe),window.addEventListener("mouseup",ae),g.current=!0,j.current=G.clientY,N.current=(W[0]+W[1])/2,K(G,!1))},Ae=()=>{L(!0)},Ce=()=>{L(!1)},qe=()=>{je||C(!0)},B=()=>{C(!1)};return Er(G=>{var ke,Pe;if(Date.now()-M.current<30)return;M.current=Date.now();const pe=G.scopes;if((Pe=(ke=pe==null?void 0:pe[p])==null?void 0:ke.max)!=null&&Pe.length){const Ie=pe[p],$e=Ie.max.length,Xe=Ie.writePointer/$e;let De=R.current;Xe-De>.5?De+=1:De-Xe>.5&&(De-=1);const Ve=.5*(Xe+De)%1;R.current=Xe;const et=y.current;if(et){const ot=Re(te(Ve-d)/w,0,1);et.style.width=`${ot*100}%`,et.style[b?"right":"left"]="0",et.style[b?"left":"right"]="",et.style.opacity=`${100-te(Ve-d)*100}%`}const rt=O.current;if(rt){const ot=h.findIndex(J=>J>Ve);rt.style.opacity=ot===s?"0.4":"0.1"}}}),a.useEffect(()=>{je&&C(!1)},[je]),n.jsxs("div",{className:"flex-shrink-0 h-full flex flex-col justify-center items-center relative text-lunaLight",style:{width:`${w*100}%`,zIndex:20-s},onMouseEnter:Ae,onMouseLeave:Ce,children:[n.jsx("div",{style:{opacity:P?.2:0},onMouseDown:we,onDoubleClick:ce,className:"absolute left-0 top-0 w-full h-full bg-gradient-to-b from-[rgba(255,255,255,0.3)] to-[rgba(255,255,255,0)] transition-opacity duration-300 ease-in-out cursor-pointer"}),n.jsx("div",{ref:O,style:{opacity:.1},onMouseDown:we,onDoubleClick:ce,className:`absolute left-0 top-0 w-full h-full bg-gradient-to-t transition-opacity duration-300 ease-in-out cursor-pointer ${U?"from-[rgba(107,100,161,0.3)] to-[rgba(107,100,161,0)]":"from-[rgba(244,130,114,0.3)] to-[rgba(244,130,114,0)]"}`}),$&&n.jsx("div",{className:"z-[20] w-[calc(100%-10px)] h-full absolute left-[0.45vw] top-0",children:n.jsx("div",{className:"h-full w-full py-1 flex flex-col-reverse gap-1",children:Array.from({length:c.length}).map((G,pe)=>{const ke=v===pe;return n.jsx("div",{className:"rounded cursor-pointer flex flex-row items-center justify-center relative overflow-hidden",style:{background:ke?"#ffffff55":"#ffffff09",height:`${100/c.length}%`},onMouseDown:ke?Me:le(pe),children:ke&&n.jsxs(n.Fragment,{children:[n.jsx("div",{style:{position:"relative",width:"min(1.4vw, 90%)",height:"min(1.4vw, 90%)"},className:"z-[20]",children:n.jsx("svg",{viewBox:"0 0 448 512",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"},children:n.jsx("path",{fill:"#11111188",d:b?"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.2 288 416 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-306.7 0L214.6 118.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z":"M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z"})})}),n.jsx("div",{ref:y,className:"h-full bg-lunaCoral/60 absolute z-[1]"})]})},pe)})})}),c.length<hp&&!je&&n.jsx("div",{className:"absolute top-0 left-[10%] w-[80%] translate-y-[-100%] transition-opacity duration-300 cursor-pointer flex flex-row justify-center pb-1",style:{opacity:P?1:0},children:n.jsx("div",{onMouseEnter:qe,onMouseLeave:B,children:n.jsx(ie,{type:X.Plus,onClick:Ne})})}),n.jsx("div",{className:"absolute h-full top-0 left-[50%] border-dashed border-l border-l-[#ffffff55] pointer-events-none transition-opacity duration-300 ease-in-out",style:{opacity:I?1:0}}),F&&S.current===null&&g.current&&n.jsxs("div",{className:"absolute",style:{bottom:`${W[0]*100}%`},children:[n.jsx("div",{className:"absolute translate-x-[-50%] bottom-[0.3vw] transition-opacity duration-300 pointer-events-none",style:{opacity:W[0]>.7?0:1},children:re(W[0])}),n.jsx("div",{className:"absolute translate-x-[-50%] top-[0.3vw] transition-opacity duration-300 pointer-events-none",style:{opacity:W[0]>.7?1:0},children:re(W[0])})]}),S.current!==null&&n.jsxs("div",{className:`absolute ${me?"left-[1vw]":"right-[1vw]"}`,style:{bottom:`${(me?W[0]:W[1])*100}%`},children:[n.jsx("div",{className:`absolute transition-opacity duration-300 pointer-events-none ${Se?"bottom-[0.3vw] translate-x-[-100%]":"top-[0.3vw]"}`,style:{opacity:Y?1:0},children:re(W[S.current])}),n.jsx("div",{className:`absolute transition-opacity duration-300 pointer-events-none ${Se?"top-[0.3vw] translate-x-[-100%]":"bottom-[0.3vw]"}`,style:{opacity:Z?1:0},children:re(W[S.current])})]}),q&&n.jsxs(n.Fragment,{children:[n.jsxs("div",{className:"w-full h-full absolute left-0 top-0 overflow-hidden pointer-events-none",children:[n.jsx(ui,{value:W[0],onMouseDown:Q(0),i:0,sectionWidth:V,enabled:f}),n.jsx(ui,{value:W[1],onMouseDown:Q(1),i:1,sectionWidth:V,enabled:f})]}),n.jsxs("svg",{width:"100%",height:"100%",className:"z-[20] absolute left-0 top-0 pointer-events-none",children:[n.jsx("path",{ref:_,d:"",fill:U?"#6B64A130":"#f8aaa030",stroke:"none"}),n.jsx("line",{x1:0,x2:"100%",y1:`${(1-W[0])*100}%`,y2:`${(1-W[1])*100}%`,strokeWidth:1,className:"transition-stroke duration-300",stroke:`#ffffff${P||g.current?"ff":"aa"}`})]})]})]})},ui=({value:e,onMouseDown:t,i:r,sectionWidth:o,enabled:s=!0})=>n.jsx("div",{className:`w-[0.35vw] h-[0.7vw] bg-white absolute translate-y-[50%] cursor-pointer z-[30] opacity-0 hover:opacity-100 transition-opacity duration-300 ease-in-out ${r?"rounded-l-full translate-x-[-100%]":"rounded-r-full"}`,style:{left:r?"100%":0,bottom:`${e*100}%`,pointerEvents:s?"auto":"none"},onMouseDown:t,children:n.jsx("div",{className:"absolute top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] rounded-full",style:{width:`min(5vw, ${o/2}px)`,height:`min(5vw, ${o/2}px)`}})}),xp=e=>{const t=[{num:1,den:2},{num:1,den:3},{num:2,den:3},{num:1,den:4},{num:3,den:4},{num:1,den:5},{num:2,den:5},{num:3,den:5},{num:4,den:5},{num:1,den:6},{num:5,den:6},{num:1,den:7},{num:2,den:7},{num:3,den:7},{num:4,den:7},{num:5,den:7},{num:6,den:7},{num:1,den:8},{num:3,den:8},{num:5,den:8},{num:7,den:8},{num:1,den:9},{num:2,den:9},{num:4,den:9},{num:5,den:9},{num:7,den:9},{num:8,den:9},{num:1,den:10},{num:3,den:10},{num:7,den:10},{num:9,den:10},{num:1,den:11},{num:2,den:11},{num:3,den:11},{num:4,den:11},{num:5,den:11},{num:6,den:11},{num:7,den:11},{num:8,den:11},{num:9,den:11},{num:10,den:11},{num:1,den:12},{num:5,den:12},{num:7,den:12},{num:11,den:12},{num:1,den:13},{num:2,den:13},{num:3,den:13},{num:4,den:13},{num:5,den:13},{num:6,den:13},{num:7,den:13},{num:8,den:13},{num:9,den:13},{num:10,den:13},{num:11,den:13},{num:12,den:13},{num:1,den:14},{num:3,den:14},{num:5,den:14},{num:7,den:14},{num:11,den:14},{num:13,den:14},{num:1,den:15},{num:2,den:15},{num:4,den:15},{num:7,den:15},{num:8,den:15},{num:11,den:15},{num:13,den:15},{num:14,den:15},{num:1,den:16},{num:3,den:16},{num:5,den:16},{num:7,den:16},{num:11,den:16},{num:13,den:16},{num:15,den:16}];let r=t[0],o=Math.abs(e-t[0].num/t[0].den);for(let s=1;s<t.length;s++){let i=t[s],l=i.num/i.den,c=Math.abs(e-l);c<o&&(o=c,r=i)}return[r.num,r.den]},gp=Ns.memo(({i:e,x:t,containerRef:r,setter:o,interfaceSetter:s,removeSeparation:i,columns:l,nSeparations:c})=>{const u=H(I=>I.selectedTimeStretcherSeparationIdx),d=H(I=>I.lastSelectedComponent),h=H(I=>I.selectTimeStretcherSeparation),f=a.useRef(!1),[p,w]=a.useState(!1),x=u===e,m=a.useMemo(()=>{const I=b(t,l)?xp(t):null;return I?`${I[0]}/${I[1]}`:t.toFixed(2)},[f.current,t]),v=p||f.current;function b(I,C){let M=I*C;return Number.isInteger(M)}const S=I=>{if(window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",S),f.current=!1,!r.current)return;const C=r.current.getBoundingClientRect(),M=(I.clientX-C.left)/C.width;o(M)},y=I=>{if(!r.current)return;const C=r.current.getBoundingClientRect(),M=(I.clientX-C.left)/C.width;s(M)},g=I=>{I.button===0&&(Ft(),h(e),I.stopPropagation(),window.addEventListener("mousemove",y),window.addEventListener("mouseup",S),f.current=!0)},j=I=>{I.stopPropagation(),I.preventDefault(),i()},N=()=>{w(!0)},P=()=>{w(!1)},L=I=>{(I.key==="Backspace"||I.key==="Delete")&&d===wr.timeStretcherSeparation&&u===e&&(i(),h(null))};return a.useEffect(()=>(window.addEventListener("keydown",L),()=>{window.removeEventListener("keydown",L)}),[d,u,e,c]),n.jsxs("div",{className:"absolute h-full top-0 w-[0.9vw] z-[10] cursor-col-resize translate-x-[-50%]",style:{left:`${t*100}%`,opacity:x?1:.6},onMouseDown:g,onMouseEnter:N,onMouseLeave:P,children:[n.jsx("div",{className:"absolute top-0 translate-y-[-100%] left-[50%] translate-x-[calc(-50%)]",onContextMenu:j,style:{width:`${1-.02*c}vw`},children:n.jsx("svg",{viewBox:"0 0 320 512",className:"translate-y-[-25%]",children:n.jsx("path",{fill:"#ffffff",d:"M182.6 470.6c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-9.2-9.2-11.9-22.9-6.9-34.9s16.6-19.8 29.6-19.8H288c12.9 0 24.6 7.8 29.6 19.8s2.2 25.7-6.9 34.9l-128 128z"})})}),n.jsx("div",{className:`w-[1px] top-0 left-[0.4vw] absolute border-l border-l-[#ffffff] ${v?"h-[90%]":"h-[100%]"} transition-height duration-300`,children:n.jsx("div",{className:"absolute bottom-[-1.1vw] left-[50%] translate-x-[-50%] text-sm pt-[2px] transition-opacity duration-300",style:{opacity:v?1:0},children:m})})]})}),wp=({type:e,mode:t,columns:r,enabled:o=!0})=>{const s=`${e}:0`,i=T(C=>C[`${e}StretchSections`]),l=a.useRef(null),c=a.useRef(i),u=a.useRef(Date.now()),d=a.useRef(0),h=a.useRef(null),f=a.useMemo(()=>{const C=[];for(let M=0;M<i.length;M++){let R=0;for(let O=0;O<=M;O++)R+=i[O].width;C.push(R)}return C},[i]),p=a.useMemo(()=>t===zt.Speed,[t]),w=a.useMemo(()=>t===zt.Pitch,[t]),x=a.useMemo(()=>t===zt.Shuffle,[t]),m=a.useMemo(()=>p||w,[p,w]);a.useEffect(()=>{c.current=i},[i]);const v=a.useCallback(C=>{const M=h.current;if(M&&!x){const R=f.findIndex(W=>W>C),O=i[R],{stretch:_,pitch:z,width:U}=O,$=w?z:_,V=R===0?0:f[R-1],E=(C-V)/U,q=$[0]+E*($[1]-$[0]);M.style.left=`${C*100}%`,M.style.bottom=`${q*100}%`}},[x,w,f]);Er(C=>{var R,O;if(Date.now()-u.current<30)return;u.current=Date.now();const M=C.scopes;if((O=(R=M==null?void 0:M[s])==null?void 0:R.max)!=null&&O.length){const _=M[s],z=_.max.length,U=_.writePointer/z;let $=d.current;U-$>.5?$+=1:$-U>.5&&($-=1);const V=.5*(U+$)%1;d.current=U,v(V)}});const b=a.useCallback(()=>{const C=[];for(const M of c.current)C.push({width:M.width,stretch:[...M.stretch],pitch:[...M.pitch],target:M.target,reverse:M.reverse});return C},[]),S=(C,M,R=!1)=>{Le({[`${e}StretchSections`]:C},M,R)},y=a.useCallback((C,M)=>R=>{const O=b();O[C]=R,S(O,M)},[]),g=a.useCallback((C,M)=>R=>{const O=[...f],_=b(),z=C===0?0:f[C-1]+1/32,U=f[C+1]-1/32,$=r,V=.1/r,E=1/$,q=Math.round(R/E)*E;Math.abs(R-q)<=V&&(R=q),O[C]=Re(R,z,U),_[0].width=O[0];for(let W=1;W<O.length;W++)_[W].width=O[W]-O[W-1];S(_,M)},[r,f]),j=a.useCallback(C=>()=>{const M=c.current[C],R=c.current[C+1],O={width:M.width+R.width,stretch:[...M.stretch],pitch:[...M.pitch],target:R.target,reverse:!1},_=b();_.splice(C,2,O);for(let z=0;z<_.length;z++)_[z].target>=C&&(_[z].target=_[z].target<=0?0:_[z].target-1);S(_,!0,!0)},[c,S]),N=a.useCallback(C=>()=>{const M=c.current[C],R={stretch:[...M.stretch],pitch:[...M.pitch],width:M.width/2,target:M.target,reverse:M.reverse},O={stretch:[...M.stretch],pitch:[...M.pitch],width:M.width/2,target:C+1,reverse:M.reverse},_=b();for(let z=0;z<_.length;z++)_[z].target>=C+1&&(_[z].target=_[z].target+1>_.length?_.length:_[z].target+1);_.splice(C,1,R,O),S(_,!0,!0)},[]),P=4,L=["0%","50%","100%","150%","200%"],I=[-24,-12,0,12,24];return n.jsxs("div",{className:"w-full h-[85%] flex relative rounded-r text-white bg-[#00000022] border border-black/30 group",ref:l,style:{pointerEvents:o?"auto":"none"},children:[n.jsx("div",{ref:h,className:"w-[1vw] h-[1vw] absolute rounded-full translate-x-[-50%] translate-y-[50%]",style:{background:"radial-gradient(#ffffff 0%, #00000000 100%)",opacity:x?0:1}}),m&&n.jsxs(n.Fragment,{children:[Array.from({length:r-1}).map((C,M)=>{const R=`${100*((M+1)/r)}%`;return n.jsx("div",{className:"h-full border-l border-l-[#ffffff22] absolute top-0 z-[10]",style:{left:R}},M)}),Array.from({length:P+1}).map((C,M)=>{const R=`${100*(M/P)}%`,O=M===0,_=M===P,z=O||M===P?"":"border-t border-t-[#ffffff22]",U=O?"translate-y-[-100%]":_?"":"translate-y-[-50%]",$=!O&&!_&&"bg-[#28242c]";return n.jsx("div",{className:`w-full absolute left-0 z-[10] ${z}`,style:{bottom:R},children:n.jsx("div",{className:`text-xs text-[#ffffff44] absolute right-[0.5vw] top-0 opacity-0 group-hover:opacity-100 transition-opacity duration-300 ${$} ${U}`,children:p?L[M]:I[M]})},M)})]}),i.map((C,M)=>n.jsx(vp,{type:e,x:M===0?0:f[M-1],section:C,i:M,containerRef:l,setter:y(M,!0),interfaceSetter:y(M,!1),mode:t,sections:i,divideSection:N(M),separations:f,enabled:o},M)),f.map((C,M)=>M===i.length-1?null:n.jsx(gp,{i:M,x:C,containerRef:l,setter:g(M,!0),columns:r,interfaceSetter:g(M,!1),removeSeparation:j(M),nSeparations:f.length},M)),n.jsx("div",{className:"absolute left-0 top-0 w-full h-full",children:n.jsx(fp,{ScopeId:`${e}:0`,mode:t})})]})},yp=({value:e,icons:t,setter:r,vertical:o,enabled:s,labels:i})=>{const l=T(h=>h.isIndividualNode()),c=a.useCallback(h=>()=>{r(h)},[]),u=l?"text-[1.2rem]":"text-base",d=l?"w-[2.6vw]":"w-[2vw]";return n.jsx("div",{className:"flex flex-col items-center gap-2 h-full justify-around",children:n.jsx("div",{className:"flex items-center justify-around grow",style:{flexDirection:o?"column":"row"},children:t.map((h,f)=>{const p=s?s[f]:!0,w=e===f;return n.jsx("div",{className:`flex flex-col items-center text-lunaLight justify-between transition-opacity duration-300 ease-in-out w-full px-1 ${u}`,style:{opacity:p?1:.3,pointerEvents:p?"auto":"none"},children:n.jsxs("div",{className:`h-[1.65vw] flex flex-row items-center gap-1 w-full cursor-pointer hover:opacity-100 transition-opacity duration-300 ease-in-out ${w?"opacity-95":"opacity-85"}`,onClick:c(f),style:{color:w?fe.lunaCoral:fe.lunaLight},children:[n.jsx("div",{className:d,children:n.jsx(ie,{type:h,active:w})}),n.jsx("div",{className:"text-left",children:i[f]})]})},f)})})})},bp=({paramId:e})=>{const t=T(u=>u[e]),r=a.useMemo(()=>ze()[e],[e]),o=T(u=>u.isIndividualNode()),{strRepr:s}=r,i=a.useCallback(u=>()=>{ut(e,u)},[e]),l=o?"text-lg":"text-sm",c=o?"w-[15vw]":"w-[12vw]";return n.jsx("div",{className:`flex flex-col justify-center ${c}`,children:n.jsx("div",{className:"flex flex-row justify-around cursor-pointer",children:s.map((u,d)=>{const h=t===d,f=`${100/s.length}%`;return n.jsx("div",{onClick:i(d),className:`${d==0?"rounded-l-md border":"border-r border-t border-b"} ${d==s.length-1&&"rounded-r-md"} ${l} border-[#FFFFFF26] bg-[#00000026] py-1`,style:{color:h?fe.lunaCoral:fe.lunaLight,width:f},children:u},d)})})})},di=({paramId:e,icon:t,size:r})=>{const o=ze()[e],{displayName:s}=o,i=T(c=>c[e]),l=()=>{Cn(e,i?0:1)};return n.jsxs("div",{onClick:l,className:"relative h-[1.65vw] flex items-center justify-center group",children:[n.jsx("div",{className:"z-[100] text-lunaLight absolute top-[-0.55vw] left-[50%] translate-x-[-50%] translate-y-[-100%] rounded border-[0.5px] border-[#FFFFFF26] bg-[#00000080] px-2 py-1 opacity-0 group-hover:opacity-100 transition-opacity duration-300 ease-in-out pointer-events-none",children:s}),n.jsx(ie,{type:t,active:i,size:r!=null?r:20})]})},Wl=({paramId:e,setter:t=Cn})=>{const{strRepr:r}=ze()[e],o=T(l=>l[e]),s=l=>{t(e,l)},i=a.useMemo(()=>r.map(l=>({label:l,value:l})),[]);return n.jsx(ql,{options:i,setter:s,value:i[o].value})},ql=({value:e,setter:t,options:r})=>{const o=T(y=>y.isIndividualNode()),s=T(y=>y.resizeFactor()),i=a.useRef(null),l=a.useRef(null),[c,u]=a.useState(!1),[d,h]=a.useState({left:0,top:0,width:0}),f=a.useMemo(()=>`${5+r.map(g=>g.label).reduce((g,j)=>Math.max(g,j.length),0)*s*.5}vw`,[r,s]),p=()=>{u(!c)},w=a.useCallback(y=>()=>{t(y)},[t]),x=y=>{const g=l.current,j=i.current;if(!g||!j)return;const N=g.getBoundingClientRect(),P=j.getBoundingClientRect(),{clientX:L,clientY:I}=y,C=L>N.left&&L<N.right&&I>N.top&&I<N.bottom,M=L>P.left&&L<P.right&&I>P.top&&I<P.bottom;C||M||u(!1)},m=()=>{if(!i.current)return;const g=i.current.getBoundingClientRect();h({left:g.left,top:g.top,width:g.width})},v=a.useMemo(()=>{var y,g;return(g=(y=r.find(j=>j.value===e))==null?void 0:y.label)!=null?g:e},[e,r]);a.useEffect(m,[i.current,f]),a.useEffect(()=>(window.addEventListener("resize",m),()=>{window.removeEventListener("resize",m)}),[]),a.useEffect(()=>(c?window.addEventListener("mousedown",x):window.removeEventListener("mousedown",x),()=>{window.removeEventListener("mousedown",x)}),[c]);const b=o?"text-lg":"text-sm",S=c?"rounded-b-md":"rounded-md";return n.jsxs("div",{style:{width:f},ref:i,onClick:p,children:[n.jsxs("div",{className:`cursor-pointer w-full text-[#FFFFFFaa] px-2 flex flex-row items-center border border-[#FFFFFF26] bg-[#00000026] py-1 ${S}`,children:[n.jsx("div",{className:`text-left grow text-nowrap ${b}`,children:v}),n.jsx(ie,{type:X.ArrowDown})]}),n.jsx(Bn,{children:c&&n.jsx("div",{className:"absolute z-[100] text-white translate-y-[-100%] rounded-t-md border-t border-l border-r border-[#FFFFFF26] bg-[#292b32] py-1",ref:l,style:{left:d.left,top:d.top,width:d.width},children:r.map((y,g)=>{const{label:j,disabled:N}=y,P=N?"text-[#FFFFFF66]":"text-[#FFFFFFaa] hover:text-[#FFFFFFE5]";return n.jsx("div",{onClick:N?void 0:w(g),className:`px-2 py-[0.1vw] cursor-pointer text-nowrap ${P} ${b}`,children:j},g)})})})]})},Xs=({_setSyncing:e})=>{const t=lt(),{fetchUser:r}=t,[o,s]=a.useState(!1),i=()=>de(void 0,null,function*(){s(!0),yield r(),s(!1)});return a.useEffect(()=>{e&&e(o)},[o]),n.jsxs("div",{className:"text-white bg-[#606060] py-1 px-3 rounded-full text-s cursor-pointer flex items-center gap-2",onClick:i,children:[n.jsx("div",{id:"rotating-div",className:"transition-all ease-in-out duration-500",children:n.jsx(ie,{type:X.Update,color:"#ffffff",active:!0})}),n.jsx("div",{className:"grow text-center",children:o?"Syncing":"Sync licenses"})]})};var zt=(e=>(e[e.Speed=0]="Speed",e[e.Shuffle=1]="Shuffle",e[e.Pitch=2]="Pitch",e))(zt||{});const Sp=({node:e})=>{const{type:t}=e,r=`${t}Mix`,o=`${t}Stretch`,s=`${t}StretchSyncEnabled`,i=`${t}Duration`,l=`${t}DurationSyncEnabled`,c=`${t}GrainSize`,u=`${t}GrainSizeTempoSyncEnabled`,d=`${t}Enabled`,h=`${t}LoopMode`,f=`${t}StretchMode`,p=`${t}Smoothing`,w=`${t}Freeze`,x=H(E=>E.toggleMainViewType),m=T(E=>E[f]),v=T(E=>E[s]),b=T(E=>E[l]),S=T(E=>E[u]),y=T(E=>E[d]),g=lt(E=>E.ownsTime()),j=T(E=>E.pluginName===oe.BEAM),[N,P]=a.useState(!1),[L,I]=a.useState(0),[C,M]=a.useState(4),R=m===1,O=L===1,_=ut,z=Cn,U=a.useCallback(()=>{const E=t==="timeA"?ee.TimePresetA:t==="timeB"?ee.TimePresetB:ee.TimePresetC;x(E)},[y,t,x]),$=()=>{const E=T.getState()[`${t}StretchSections`];let q=E.map(W=>{const F=k({},W),Z=()=>{const Y=[.3,.5,.7],me=Y[Math.floor(Math.random()*Y.length)],Se=(Math.random()-.5)*.1;return Math.max(.2,Math.min(.8,me+Se))};if(L===0){const Y=Z();F.stretch=[Y,Y]}if(L===2){const Y=Z();F.pitch=[Y,Y]}else L===1&&(F.target=Math.floor(Math.random()*E.length),F.reverse=Math.random()<.1);return F});if(Math.random()<.1&&q.length>0){const W=q.length-1,Z=Math.max(0,0-.5);q[W].pitch=[.5,Z],q[W].stretch=[.5,0]}L===1&&Math.random()<.1&&(q=q.map(W=>D(k({},W),{target:0,reverse:!1}))),Le({[`${t}StretchSections`]:q},!0)},V=a.useCallback(()=>{Kt("https://lunacy.audio/products/time")},[]);return a.useEffect(()=>{P(!0)},[]),a.useEffect(()=>{m===0&&L===2&&I(0)},[m]),n.jsxs("div",{className:"node-panel relative",style:{filter:y?"":"grayscale(100%)",opacity:N?100:0},children:[!g&&n.jsxs("div",{className:"z-[150] flex flex-col items-center justify-center absolute left-0 top-0 w-full h-full bg-[#111111cc] gap-3 text-lunaLight",children:[n.jsxs("div",{className:"flex items-center justify-center gap-3",children:[n.jsx(ie,{type:X.Lock,size:6}),"Locked node"]}),n.jsx(Xs,{}),n.jsx("div",{className:"text-sm cursor-pointer underline",onClick:V,children:"Learn more"})]}),n.jsxs("div",{className:"flex flex-col h-full w-[20%] relative py-[0.9vw]",children:[n.jsxs("div",{className:"flex h-[20%] items-center",children:[n.jsx(ur,{type:t}),j&&n.jsx("div",{className:"flex items-center cursor-pointer pl-[0.5vw]",style:{pointerEvents:y?"auto":"none"},onClick:U,children:n.jsx(ie,{type:X.Search,size:20})})]}),n.jsxs("div",{id:"time-container",className:"flex grow justify-around items-center w-full",style:{pointerEvents:y?"auto":"none"},children:[n.jsx(Be,{paramId:o,setter:_,beforeLabel:n.jsx(xn,{id:s,setter:z,value:v})}),n.jsx(Be,{paramId:i,setter:_,beforeLabel:n.jsx(xn,{id:l,setter:z,value:b})})]})]}),n.jsxs("div",{className:"flex flex-col w-[69%] h-full",children:[n.jsxs("div",{className:"flex h-[80%] justify-center items-end relative",children:[n.jsx("div",{className:"px-2 bg-[#00000022] h-[85%] rounded-l border-t border-b border-l border-black/30",children:n.jsx(yp,{labels:["Speed","Shuffle","Pitch"],enabled:[y,y,y&&R],value:L,setter:I,icons:[X.Speed,X.Shuffle,X.Pitch],vertical:!0})}),n.jsx(wp,{type:t,mode:L,columns:C,enabled:y})]}),n.jsxs("div",{className:"flex flex-row justify-between h-[20%] items-center",children:[n.jsxs("div",{className:"flex flex-row gap-3",style:{pointerEvents:y?"auto":"none"},children:[n.jsx(bp,{paramId:f}),n.jsx("div",{className:"transition-opacity duration-300 ease-in-out flex items-center",style:{opacity:R?1:.5,pointerEvents:R&&y?"auto":"none"},children:n.jsx(jn,{paramId:c,setter:_,horizontal:!0,afterLabel:n.jsx(xn,{id:u,setter:z,value:S})})})]}),n.jsxs("div",{className:"flex flex-row gap-3",style:{pointerEvents:y?"auto":"none"},children:[n.jsxs("div",{className:"flex flex-row gap-3 items-center",children:[n.jsx(di,{paramId:p,icon:X.Smooth,size:25}),n.jsx(di,{paramId:w,icon:X.Freeze})]}),n.jsx(Wl,{paramId:h}),n.jsxs("div",{onClick:$,className:"group flex items-center relative",children:[n.jsx("div",{className:"z-[100] border text-lunaLight absolute top-[-0.55vw] left-[50%] translate-x-[-50%] translate-y-[-100%] rounded border-[0.5px] border-[#FFFFFF26] bg-[#00000080] px-2 py-1 opacity-0 group-hover:opacity-100 transition-opacity duration-300 ease-in-out pointer-events-none",children:"Generator"}),n.jsx(ie,{type:X.Wand,size:5.5})]}),n.jsx("div",{className:"flex flex-row gap-3 transition-opacity duration-300 ease-in-out",style:{opacity:O?.5:1,pointerEvents:y&&!O?"auto":"none"},children:n.jsx(Ss,{type:X.Columns,value:C,setter:M,min:1,max:16,defaultValue:2,small:!0})})]})]})]}),n.jsx(_o,{id:r,enabled:g&&y})]})},Cp=a.memo(Sp);function Np(e,t){t=Re(t,0,1);let r=parseInt(e.substring(1,3),16),o=parseInt(e.substring(3,5),16),s=parseInt(e.substring(5,7),16),i=1+t*.1;return r=Math.min(255,Math.round(r*i)),o=Math.min(255,Math.round(o*i)),s=Math.min(255,Math.round(s*i)),`#${r.toString(16).padStart(2,"0")}${o.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`}const Mp=({paramX:e,paramY:t,diffusionParam:r,openParam:o,isActive:s})=>{const i=a.useRef(null),l=a.useRef(null),{min:c,max:u,step:d,skew:h}=ze()[e],{min:f,max:p,step:w,skew:x}=ze()[t],m=T(C=>{const M=We(C[e],c,u,h);return l.current&&(l.current.style.left=`${100*M}%`),M}),v=T(C=>{const M=We(C[t],f,p,x);return l.current&&(l.current.style.bottom=`${100*M}%`),M}),b=v,S=T(C=>{const{min:M,max:R,skew:O}=ze()[r];return We(C[r],M,R,O)}),y=T(C=>{const{min:M,max:R,skew:O}=ze()[o];return We(C[o],M,R,O)}),g=a.useCallback(C=>{var U;const M=(U=i.current)==null?void 0:U.getBoundingClientRect();if(!M)return;const R=Re((C.clientX-M.left)/M.width,0,1),O=Re((M.height-(C.clientY-M.top))/M.height,0,1),_=xt(R,c,u,h),z=xt(O,f,p,x);ut(e,_),ut(t,z)},[i,c,u,d,h,f,p,w,x]),j=a.useCallback(C=>{if(C.preventDefault(),C.stopPropagation(),!!s)return window.addEventListener("mouseup",N),window.addEventListener("mousemove",P),Pt(e),Pt(t),g(C),()=>{window.removeEventListener("mouseup",N),window.removeEventListener("mousemove",P)}},[e,t,s]),N=a.useCallback(()=>{window.removeEventListener("mousemove",P),window.removeEventListener("mouseup",N),It(e),It(t)},[e,t]),P=a.useCallback(C=>{g(C)},[g]);function L(C){let M=Math.sin(C)*1e4;return M=M-Math.floor(M),M=M*2-1,M}const I=a.useMemo(()=>{const R=m,O=new Array(50).fill(0);return n.jsx("svg",{className:"absolute left-0 top-0 w-full h-full",viewBox:"0 0 300 300",children:O.map((_,z)=>{const U=Math.pow(z,2)*(1-b*.9)*10;if(U>300*.7)return null;const $=L(z)*R*20,V=L(50+z)*R*20,E=(1-y*.3)*Math.min(2*U/300,1);let q="#bbb";return s&&(q=Ro("#8747FE","#FF8C73",E),q=Np(q,S)),n.jsx("circle",{cx:$+300/2,cy:V+300/2,r:U,stroke:q,strokeWidth:2,fill:"none"},z)})},`${m}-${v}`)},[m,v,b,y,s,S]);return n.jsxs("div",{ref:i,className:"h-full w-full relative cursor-pointer bg-black/10 overflow-hidden",onMouseDown:j,children:[n.jsx("div",{ref:l,className:"absolute w-[0.9vw] h-[0.9vw] border-[2px] border-lunaExtraLight rounded-full cursor-pointer translate-x-[-50%] translate-y-[50%] z-20",onMouseDown:j}),I,n.jsx("div",{className:"absolute left-0 top-0 w-full h-[120%] z-10",style:{backdropFilter:`blur(${.05+S*.2}vw)`,WebkitBackdropFilter:`blur(${.05+S*.2}vw)`}})]})},jp=(e,t)=>{const[r,o]=a.useState(0),[s,i]=a.useState(0),l=a.useRef(new ResizeObserver(c=>{const{width:u,height:d}=c[0].contentRect;o(u),i(d),t==null||t()}));return a.useEffect(()=>{var c;return e.current&&((c=l.current)==null||c.observe(e.current)),()=>{e.current&&l.current.unobserve(e.current)}},[e,l]),{width:r,height:s}},Fp=({paramId:e,nodeId:t})=>{const r=a.useRef(0),o=a.useRef(null),s=a.useRef(null),i=a.useRef(null),l=a.useRef(null),c=a.useRef(null),u=a.useRef(null),d=a.useRef(),{min:h,max:f,skew:p,bipolar:w}=ze()[e],{width:x,height:m}=jp(o),v=Wt(),b=En(v),S=a.useMemo(()=>{const _={};for(const z of v.nodes)for(const U of z.connections)_[U]=z.id;return _},[b]),y=1.2,g=x/2,j=m/2,N=x*.337/y,P=x*.396/y,L=x*.462/y,I=Math.PI*.7,C=2.3*Math.PI,M=(I+C)/2;function R(_){const z=_[e];d.current=z;const U=We(z,h,f,p),$=Math.PI*(2*(.1+.8*U)+.5);let V;if(w&&U<.5?V={start:$,end:M}:w&&U>=.5?V={start:M,end:$}:V={start:I,end:$},s.current){const E=Lt(g,j,P,V.start,V.end);s.current.setAttribute("d",E)}if(c.current){const E=Lt(g,j,P,V.start,V.end);c.current.setAttribute("d",E)}if(u.current){const E=Lt(g,j,P,V.start,V.end);u.current.setAttribute("d",E)}if(i.current){const E=Lt(g,j,L,V.start,Re(V.end,I,C*.7+.2));i.current.setAttribute("d",E)}if(l.current){const E=Lt(g,j,N,C*.7,Re(V.end,C*.7,C));l.current.setAttribute("d",E)}}ln(_=>{r.current=Tt(S[t]),s.current&&s.current.setAttribute("opacity",`${.5+r.current*.4}`),l.current&&l.current.setAttribute("opacity",`${.1+r.current*.1}`),i.current&&i.current.setAttribute("opacity",`${.1+r.current*.1}`),c.current&&c.current.setAttribute("opacity",`${.1+r.current*.3}`),u.current&&u.current.setAttribute("opacity",`${.1+r.current*.3}`)}),T(_=>{R(_)});const O=Lt(x/2,m/2,x*.4/y,I,C);return n.jsxs("div",{ref:o,className:"absolute left-0 top-0 w-full h-full",children:[n.jsx("div",{className:"absolute left-0 top-0 w-full h-full flex items-center justify-center",children:n.jsx("img",{src:"valve_inner_small.png",className:"w-[85%] opacity-20"})}),n.jsx("div",{className:"absolute left-0 top-0 w-full h-full flex items-center justify-center",children:n.jsx("img",{src:"valve_stroke.png",className:"w-[85%] opacity-100"})}),n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",className:"absolute left-0 top-0 translate-y-[-0.5px]",width:x,height:m,children:[n.jsxs("defs",{children:[n.jsx("filter",{id:"blur",children:n.jsx("feGaussianBlur",{stdDeviation:"0.5"})}),n.jsx("filter",{id:"heavy_blur",children:n.jsx("feGaussianBlur",{stdDeviation:"1"})})]}),n.jsxs("linearGradient",{id:"colored-1",children:[n.jsx("stop",{offset:"0%",stopOpacity:"1",stopColor:"#FF8C73"}),n.jsx("stop",{offset:"100%",stopOpacity:"0.5",stopColor:"#8747FE"})]}),n.jsxs("linearGradient",{id:"colored-2",children:[n.jsx("stop",{offset:"0%",stopOpacity:"0",stopColor:"#FF8C73"}),n.jsx("stop",{offset:"100%",stopOpacity:"0.5",stopColor:"#8747FE"})]}),n.jsx("path",{ref:c,strokeWidth:8,d:"",fill:"none",stroke:"url(#colored-1)",opacity:"0.1",strokeLinecap:"round"}),n.jsx("path",{ref:u,strokeWidth:8,d:"",fill:"none",stroke:"url(#spinner-2)",opacity:"0.1",strokeLinecap:"round"}),n.jsx("path",{strokeWidth:.5,d:O,fill:"none",stroke:"white",opacity:"0.3",strokeLinecap:"round"}),n.jsx("path",{ref:s,strokeWidth:1,fill:"none",stroke:"white",opacity:"0.5",strokeLinecap:"round",filter:"url(#blur)"}),n.jsx("path",{ref:i,strokeWidth:1,fill:"none",stroke:"white",opacity:"0.1",strokeLinecap:"round",filter:"url(#blur)"}),n.jsx("path",{ref:l,strokeWidth:1,fill:"none",stroke:"white",opacity:"0.1",strokeLinecap:"round",filter:"url(#blur)"})]})]})},rs=a.memo(Fp),Ap=({node:e})=>{const{type:t,id:r}=e,o=`${t}Enabled`,s=lt(M=>M.ownsVolt()),i=`${t}Heat`,l=`${t}Charge`,c=`${t}Crush`,u=`${t}Color`,d=`${t}Contour`,h=`${t}FDNEnabled`,f=`${t}FDNScatter`,p=`${t}FDNDiffusion`,w=`${t}FDNTune`,x=`${t}FDNOpen`,m=`${t}Depth`,v=T(M=>M[h]),b=T(M=>M[o]),S=H(M=>M.toggleMainViewType),y=T(M=>M.isIndividualNode()),[g,j]=a.useState(!1),N=a.useCallback((M,R)=>{ut(M,R)},[]),P=a.useCallback(()=>{const M=t==="voltA"?ee.VoltPresetA:t==="voltB"?ee.VoltPresetB:ee.VoltPresetC;S(M)},[S,t,b]),L=a.useCallback(()=>{Kt("https://lunacy.audio/products/volt")},[]);a.useEffect(()=>{j(!0)},[]);const I=b?"":"grayscale(100%)",C=y?"text-lg":"text-base";return n.jsxs("div",{className:"node-panel relative items-center justify-between",style:{filter:b?"":"grayscale(100%)",opacity:g?1:0},children:[!s&&n.jsxs("div",{className:"z-[150] flex flex-col items-center justify-center absolute left-0 top-0 w-full h-full bg-[#111111cc] gap-3 text-lunaLight",children:[n.jsxs("div",{className:"flex items-center justify-center gap-3",children:[n.jsx(ie,{type:X.Lock,size:6}),"Locked node"]}),n.jsx(Xs,{}),n.jsx("div",{className:"text-sm cursor-pointer underline",onClick:L,children:"Learn more"})]}),n.jsxs("div",{className:"w-[60%] h-full relative",style:{filter:I},children:[n.jsxs("div",{className:"flex h-[20%] items-center translate-y-[0.55vw]",children:[n.jsx(ur,{type:t}),!y&&n.jsx("div",{className:"flex items-center cursor-pointer pl-[0.5vw]",style:{pointerEvents:b?"auto":"none"},onClick:P,children:n.jsx(ie,{type:X.Search,size:20})})]}),n.jsxs("div",{className:"h-[70%] flex flex-row justify-between gap-2",style:{pointerEvents:b?"auto":"none"},children:[n.jsx("div",{className:"h-full w-full flex flex-col justify-end",children:n.jsxs("div",{className:"flex items-center w-full justify-around",children:[n.jsx(Be,{paramId:i,setter:N,special:n.jsx(rs,{paramId:i,nodeId:r})}),n.jsx(Be,{paramId:c,setter:N,special:n.jsx(rs,{paramId:c,nodeId:r})}),n.jsx(Be,{paramId:l,setter:N,special:n.jsx(rs,{paramId:l,nodeId:r})})]})}),n.jsx(gn,{length:"100%"}),n.jsxs("div",{className:"flex flex-col justify-between items-center w-[25%] h-full relative",children:[n.jsx("div",{className:`absolute top-0 left-0 w-full translate-y-[-100%] font-medium text-[#FFFFFFBF] pointer-events-none pb-[0.55vw] ${C}`,children:"Filter"}),n.jsx(Be,{paramId:u,small:!0,setter:N}),n.jsx(Be,{paramId:d,small:!0,setter:N})]})]})]}),n.jsxs(Oo,{title:"Feedback",submoduleId:h,width:"30%",nodeEnabled:b,children:[n.jsx("div",{className:"h-full w-[48%]",children:n.jsx(Mp,{paramX:f,paramY:w,diffusionParam:p,isActive:v,openParam:x})}),n.jsxs("div",{className:"flex h-full w-[48%] justify-around",children:[n.jsxs("div",{className:"flex flex-col justify-between h-full",children:[n.jsx(Be,{paramId:w,small:!0,setter:N}),n.jsx(Be,{paramId:f,small:!0,setter:N})]}),n.jsxs("div",{className:"flex flex-col justify-between h-full",children:[n.jsx(Be,{paramId:p,small:!0,setter:N}),n.jsx(Be,{paramId:x,small:!0,setter:N})]})]})]}),n.jsx(_o,{id:m,enabled:s&&b})]})},Lp=a.memo(Ap),kp=({paramX:e,paramY:t,isActive:r})=>{const o=a.useRef(null),s=a.useRef(null),{min:i,max:l,step:c,skew:u}=ze()[e],{min:d,max:h,step:f,skew:p}=ze()[t],w=T(P=>{const L=We(P[e],i,l,u);return s.current&&(s.current.style.left=`${100*L}%`),L}),x=T(P=>{const L=We(P[t],d,h,p);return s.current&&(s.current.style.bottom=`${100*L}%`),L}),m=-1*(x-1),v=a.useCallback(P=>{var O;const L=(O=o.current)==null?void 0:O.getBoundingClientRect();if(!L)return;const I=Re((P.clientX-L.left)/L.width,0,1),C=Re((L.height-(P.clientY-L.top))/L.height,0,1),M=xt(I,i,l,u),R=xt(C,d,h,p);ut(e,M),ut(t,R)},[o,i,l,c,u,d,h,f,p]),b=a.useCallback(P=>{if(P.preventDefault(),P.stopPropagation(),!!r)return window.addEventListener("mouseup",S),window.addEventListener("mousemove",y),Pt(e),Pt(t),v(P),()=>{window.removeEventListener("mouseup",S),window.removeEventListener("mousemove",y)}},[e,t,r]),S=a.useCallback(()=>{window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",S),It(e),It(t)},[e,t]),y=a.useCallback(P=>{v(P)},[v]);function g(P){let L=Math.sin(P)*1e4;return L=L-Math.floor(L),L=L*2-1,L}const j=(P,L,I,C,M,R)=>{let _="";for(let z=0;z<=100;z++){const U=z/100,$=U*Math.PI*2,V=Math.sin($*M)*C*Math.sin(Math.PI*U),E=I+V,q=P+E*Math.cos(R+$),W=L+E*Math.sin(R+$);_+=z===0?`M ${q} ${W}`:` L ${q} ${W}`}return _+=" Z",_},N=a.useMemo(()=>{const I=new Array(30).fill(0),C=w*3;return n.jsx("svg",{className:"absolute left-0 top-0 w-full h-full",viewBox:"0 0 300 300",children:I.map((M,R)=>{const O=10+Math.pow(R,2)*(1-m*.4)*20/30;if(O>300*.8)return null;const _=g(R)*Math.PI,z=R*w*.8,U=g(R*R)*3*w,$=Ro(R%2===0?"#0040bf":"#8747FE","#ffffff",Re(1-2*O/300,0,1));return n.jsx("path",{d:j(300/2,300/2,O+U,C,z,_),stroke:$,opacity:.5,strokeWidth:5,fill:"none"},R)})},`${w}-${x}`)},[w,x,m]);return n.jsxs("div",{ref:o,className:"h-full w-full relative cursor-pointer bg-black/10 overflow-hidden",onMouseDown:b,children:[n.jsx("div",{ref:s,className:"absolute w-[0.9vw] h-[0.9vw] border-[2px] border-lunaExtraLight rounded-full cursor-pointer translate-x-[-50%] translate-y-[50%] z-20",onMouseDown:b}),N,n.jsx("div",{className:"absolute left-0 top-0 w-full h-[120%] z-10",style:{backdropFilter:`blur(${.05+0*.2}vw)`,WebkitBackdropFilter:`blur(${.05+0*.2}vw)`}})]})},Pp=({node:e})=>{const{type:t}=e,r=`${t}Enabled`,o=`${t}Density`,s=`${t}Spread`,i=`${t}Decay`,l=`${t}Scale`,c=`${t}Glide`,u=`${t}Motion`,d=`${t}MotionDepth`,h=`${t}SmearEnabled`,f=`${t}SmearFreq`,p=`${t}SmearQ`,w=`${t}Mix`,x=T(N=>N[r]),m=T(N=>N.isIndividualNode()),v=H(N=>N.selectMainView),b=H(N=>N.selectedMainView),[S,y]=a.useState(!1),g=a.useCallback((N,P)=>{ut(N,P)},[]),j=()=>{if(x)if(b===ee.HazePresetA||b===ee.HazePresetB||b===ee.HazePresetC)v(null);else switch(t){case A.chorusA:v(ee.HazePresetA);break;case A.chorusB:v(ee.HazePresetB);break;case A.chorusC:v(ee.HazePresetC);break}};return a.useEffect(()=>{y(!0)},[]),n.jsxs("div",{className:"select-none bg-transparent flex flex-row items-center pl-[2vw] h-full w-full transition-opacity ease-in-out duration-300 relative justify-between",style:{filter:x?"":"grayscale(100%)",opacity:S?100:0},children:[n.jsxs("div",{className:"w-[52.5%] h-full relative",children:[n.jsxs("div",{className:"flex h-[20%] items-center translate-y-[0.55vw]",children:[n.jsx(ur,{type:t}),!m&&n.jsx("div",{className:"flex items-center cursor-pointer pl-[0.5vw]",style:{pointerEvents:x?"auto":"none"},onClick:j,children:n.jsx(ie,{type:X.Search,size:20})})]}),n.jsx("div",{className:"h-[70%] flex flex-row justify-between gap-2",style:{pointerEvents:x?"auto":"none"},children:n.jsx("div",{className:"h-full w-full flex justify-end",children:n.jsxs("div",{className:"flex items-center w-full justify-around",children:[n.jsx(Be,{paramId:i,setter:g}),n.jsx(Be,{paramId:o,setter:g}),n.jsx(Be,{paramId:s,setter:g}),n.jsx(gn,{}),n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute top-[-1.25vw] left-0 w-full flex justify-center",children:n.jsx(jo,{paramId:c,labelName:"Glide"})}),n.jsx(Be,{paramId:l,setter:g})]})]})})})]}),n.jsx("div",{className:"w-[17.5%] h-[70%] relative flex flex-row justify-between",style:{pointerEvents:x?"auto":"none"},children:n.jsx("div",{className:"h-full w-full",children:n.jsx(kp,{paramX:u,paramY:l,isActive:!0})})}),n.jsx("div",{className:"w-[15%] h-[70%] relative flex flex-row justify-between",style:{pointerEvents:x?"auto":"none"},children:n.jsx("div",{className:"flex flex-col items-center h-full w-full justify-between translate-y-[20%]",children:n.jsxs("div",{className:"relative",children:[n.jsx("div",{className:"absolute top-[-1.25vw] left-0 w-full flex justify-center",children:n.jsx(jo,{paramId:d,labelName:"Depth"})}),n.jsx(Be,{paramId:u,setter:g})]})})}),n.jsx(Oo,{title:"Smear",submoduleId:h,width:"10%",nodeEnabled:x,children:n.jsxs("div",{className:"flex flex-col justify-between items-center w-full h-full relative",children:[n.jsx(Be,{paramId:f,small:!0,setter:g}),n.jsx(Be,{paramId:p,small:!0,setter:g})]})}),n.jsx("div",{id:"mix-container",className:"flex justify-center items-center w-[10%] h-full",style:{pointerEvents:x?"auto":"none"},children:n.jsx(Be,{paramId:w,setter:g,special:n.jsx(Gl,{paramId:w}),spacingTop:!0,mix:!0})})]})},Ip=a.memo(Pp),Ep=({spectrumIdLeft:e,spectrumIdRight:t})=>{const r=a.useRef(null),[o,s]=a.useState(),i=a.useRef(null),l=a.useRef(-1),c=a.useRef(null),u=-120,d=6,h=60,f=u+h,p=a.useRef(f);a.useEffect(()=>{if(!r.current)return;const S=r.current,y=S.getContext("webgl",{premultipliedAlpha:!1,alpha:!0});var g=y.createShader(y.VERTEX_SHADER);if(!g)return;if(y.shaderSource(g,Rp),y.compileShader(g),!y.getShaderParameter(g,y.COMPILE_STATUS)){console.error("ERROR compiling vertex shader!",y.getShaderInfoLog(g)),y.deleteShader(g);return}var j=y.createShader(y.FRAGMENT_SHADER);if(y.shaderSource(j,Dp),y.compileShader(j),!y.getShaderParameter(j,y.COMPILE_STATUS)){console.error("ERROR compiling fragment shader!",y.getShaderInfoLog(j)),y.deleteShader(j);return}var N=y.createProgram();y.attachShader(N,g),y.attachShader(N,j),y.linkProgram(N),y.useProgram(N),i.current=y.getUniformLocation(N,"u_color"),y.uniform3fv(i.current,[.7,.73,.9]);const P=y.getUniformLocation(N,"u_resolution");return y.uniform2fv(P,[S.width,S.height]),l.current=y.getAttribLocation(N,"coordinates"),c.current=y.createBuffer(),y.bindBuffer(y.ARRAY_BUFFER,c.current),y.vertexAttribPointer(l.current,2,y.FLOAT,!1,0,0),y.enableVertexAttribArray(l.current),y.bindBuffer(y.ARRAY_BUFFER,null),s(y),()=>{y.deleteShader(g),y.deleteShader(j),y.deleteProgram(N),y.deleteBuffer(c.current)}},[r.current]);const w=a.useRef(0),x=a.useRef(),m=()=>{!o||!w.current||(o.bindBuffer(o.ARRAY_BUFFER,c.current),o.vertexAttribPointer(l.current,2,o.FLOAT,!1,0,0),o.enableVertexAttribArray(l.current),o.clearColor(.109,.109,.109,1),o.clear(o.COLOR_BUFFER_BIT),o.drawArrays(o.TRIANGLE_STRIP,0,w.current*2))};a.useLayoutEffect(()=>{m()},[]);const v=va(S=>S.spectrums[e]),b=va(S=>S.spectrums[t]);return a.useEffect(()=>{if(!o||!v||!b||v.length===0||b.length===0||v.length!==b.length)return;const S=v.length,y=[];for(let g=0;g<S;g++){const j=g/S*2-1,N=v[g]*(d-u)+u,P=b[g]*(d-u)+u,L=Math.pow(10,N/20),I=Math.pow(10,P/20),C=Math.max(L,I),M=20*Math.log10(C);p.current=Math.max(p.current+5e-5*(f-p.current),f,M);const R=p.current+3,_=2*Re((M-(R-h))/h,0,1)-1;y.push(j,_,j,-1)}(!x.current||x.current.length!==y.length)&&(x.current=new Float32Array(y)),x.current.set(y),o.bindBuffer(o.ARRAY_BUFFER,c.current),o.bufferData(o.ARRAY_BUFFER,x.current,o.DYNAMIC_DRAW),w.current=S,window.requestAnimationFrame(m)},[o,v,b]),n.jsx("canvas",{ref:r,className:"h-full w-full"})},Rp=`
attribute vec2 coordinates;
void main(void) {
gl_Position = vec4(coordinates, 0.0, 1.0);
}
`,Dp=`
precision mediump float;
uniform vec2 u_resolution;
uniform vec3 u_color;
void main(void) {
// Normalize fragment Y and line top Y
float fragYNorm = gl_FragCoord.y / u_resolution.y;
// Compute local height ratio and threshold for top highlight
float t = clamp(fragYNorm + 0.6 , 0.0, 1.0);
vec3 col = mix(vec3(0.109), u_color, t);
gl_FragColor = vec4(col, 1.0);
}
`,mn=-60,pr=60,Jr=20,Qr=2e4,Fo=15.4868205764,Zl=135.0762319923,Bp=[20,30,40,50,60,70,80,90,100,200,300,400,500,600,700,800,900,1e3,2e3,3e3,4e3,5e3,6e3,7e3,8e3,9e3,1e4,2e4];function Yl(e){return Math.pow(2,e*.08333333333+3.03135971352)}function Xl(e){return 12*Math.log2(e)-36.37631656229598}function Tp(e){return Yl(e*(Zl-Fo)+Fo)}function fi(e){return(Xl(e)-Fo)/(Zl-Fo)}const Op=({cutoffId:e,qId:t,nodeType:r})=>{var xe;const o=`${r}Type`,s=`${r}Steepness`,i=`${r}CutoffNoteSnapEnabled`,l=`${r}Gain`,c=`${r}Stereo`,u=T(ae=>ae[o]),d=u===no.Bell||u===no.LowShelf||u===no.HighShelf?l:t,h=T(ae=>ae[s]),f=T(ae=>ae[e]),p=T(ae=>ae[i]),w=T(ae=>ae[d]),x=ze(),m=x[e],v=x[d],b=(xe=T(ae=>{const we=ae[m.toggleId];return ze()[we?m.toggleOn:m.toggleOff]}))!=null?xe:m,S=a.useCallback(ae=>{const we=xt(ae,b.min,b.max,b.skew);return p?Yl(we):we},[p,b]),y=a.useCallback(ae=>{const we=We(ae,m.min,m.max,m.skew);return S(we)},[m,S]),g=a.useCallback(ae=>{if(p){const we=Xl(ae),Ae=Re(We(we,b.min,b.max,b.skew),0,1);return xt(Ae,m.min,m.max,m.skew)}else return ae},[p,b,m]),[j,N]=a.useState(0),[P,L]=a.useState(0),I=a.useRef(null),C=a.useRef(null),M=a.useRef(null),R=a.useRef(""),O=a.useRef(""),_=a.useRef(!1),[z,U]=a.useState({x:0,y:0}),$=a.useRef(0),V=a.useRef(0),E=a.useRef(0),q=a.useRef(0),W=a.useRef(0),F=a.useRef(0),Z=a.useRef(0),Y=a.useRef(!1),me=a.useRef(0),Se=a.useRef(0),[je,ye]=a.useState(-24),[le,Me]=a.useState(24);function ve(){C.current&&C.current.setAttribute("d",R.current),M.current&&M.current.setAttribute("d",O.current)}function K(){if(!(C.current&&M.current)||j===0||P===0||Date.now()-$.current<30)return;$.current=Date.now();const ae=_e(e),we=_e(t),Ae=_e(c),Ce=_e(l);if(V.current===ae&&E.current===we&&q.current===j&&W.current===P&&F.current===u&&Z.current===h&&Y.current===p&&me.current===Ce&&Se.current===Ae)return;V.current=ae,E.current=we,q.current=j,W.current=P,F.current=u,Z.current=h,Y.current=p,me.current=Ce,Se.current=Ae,(()=>de(this,null,function*(){let B=q.current||256;const G=y(ae),pe=Re(G*Math.pow(2,-.01*Ae),Jr,Qr),ke=Re(G*Math.pow(2,.01*Ae),Jr,Qr),Pe=(yield xo(pe,we,Ce,u,h,B,mn,pr,!1,!1,Jr,Qr))||[],Ie=(yield xo(ke,we,Ce,u,h,B,mn,pr,!1,!1,Jr,Qr))||[],$e=Math.max(...Pe,...Ie)*(pr-mn)+mn,Xe=Math.max(18,$e)+6,De=-Xe;Me(Xe),ye(De),R.current=re(Pe,j,P,De,Xe),O.current=re(Ie,j,P,De,Xe),requestAnimationFrame(ve)}))().catch(console.error)}const ce=()=>{const ae=I.current;ae&&(N(ae.clientWidth),L(ae.clientHeight))},re=(ae,we,Ae,Ce,qe)=>{if(ae.length===0)return"";const B=we/(ae.length-1);let G=!0,pe="";const ke=(qe-mn)/(pr-mn),Pe=(Ce-mn)/(pr-mn);return ae.forEach((Ie,$e)=>{Ie=(Ie-Pe)/(ke-Pe);const Xe=$e*B,De=Ae-Ie*Ae;let Ve=" L";G&&(Ve="M",G=!1),pe+=`${Ve}${Xe},${De}`}),pe},te=a.useCallback(ae=>{var G;const we=(G=I.current)==null?void 0:G.getBoundingClientRect();if(!we)return;const Ae=Re((ae.clientX-we.left)/we.width,0,1),Ce=Re(1-(ae.clientY-we.top)/we.height,0,1),qe=g(Tp(Ae)),B=xt(Ce,v.min,v.max,v.skew);ut(d,B),ut(e,qe)},[u,v]),ue=a.useCallback(ae=>{_.current&&te(ae)},[_,te]),he=a.useCallback(ae=>{Pt(e),Pt(d),te(ae),_.current=!0,window.addEventListener("mouseup",Q),window.addEventListener("mousemove",ue)},[_,te,u,d]),Q=a.useCallback(()=>{It(e),It(d),_.current=!1,window.removeEventListener("mouseup",Q),window.removeEventListener("mousemove",ue)},[_,u,d]);a.useEffect(()=>{ce()},[]),a.useEffect(()=>{let ae;const we=()=>{K(),ae=requestAnimationFrame(we)};return ae=requestAnimationFrame(we),()=>cancelAnimationFrame(ae)},[u,w,j,P,h]),a.useLayoutEffect(()=>{U({x:100*fi(y(f)),y:100*We(w,v.min,v.max,v.skew)})},[f,w,v,u,y]),a.useEffect(()=>(window.addEventListener("resize",ce),()=>{window.removeEventListener("resize",ce),window.removeEventListener("mouseup",Q)}),[]);const Ne=a.useMemo(()=>{const ae=Bp.map(Ce=>{const qe=fi(Ce)*j,G=Ce===100||Ce===1e3||Ce===1e4?.1:.03;return n.jsx("line",{x1:qe,x2:qe,y1:0,y2:P,stroke:"white",opacity:G},`line-${Ce}`)}),we=[];for(let Ce=0;Ce<le;Ce+=10)we.push((Ce-je)/(le-je));for(let Ce=-10;Ce>je;Ce-=10)we.push((Ce-je)/(le-je));const Ae=we.map((Ce,qe)=>{const B=P*(1-Ce);return n.jsx("line",{x1:0,x2:j,y1:B,y2:B,stroke:"white",opacity:.1},qe)});return[...ae,...Ae]},[j,P,je,le]);return n.jsx("div",{className:"flex flex-row bg-lunaDarkGray rounded-md overflow-hidden h-full shadow-and-glow grow",children:n.jsxs("div",{ref:I,className:"flex relative flex-row w-[18.2vw] h-full border border-lunaDarkGray cursor-pointer grow h-full",onMouseDown:he,children:[n.jsx(Ep,{spectrumIdLeft:`${r}:0_spectrum`,spectrumIdRight:`${r}:1_spectrum`}),n.jsxs("svg",{className:"w-full absolute left-0 top-0 h-full",children:[Ne,n.jsx("path",{ref:C,stroke:fe.lunaPurple,fill:"transparent","stroke-linejoin":"round"}),n.jsx("path",{ref:M,stroke:fe.lunaCoral,fill:"transparent","stroke-linejoin":"round"})]}),n.jsx("div",{className:"absolute w-[1.2vw] h-[1.2vw] border-[2px] border-lunaExtraLight rounded-full cursor-pointer translate-x-[-50%] translate-y-[50%]",style:{left:`${z.x}%`,bottom:`${z.y}%`}})]})})},_p=({type:e})=>{const t=`${e}Type`,{strRepr:r,max:o}=ze()[t],s=T(j=>j[t]),i=T(j=>j.resizeFactor()),[l,c]=a.useState(!1),u=a.useRef(null),[d,h]=a.useState(window.innerWidth),{left:f,top:p,width:w}=a.useMemo(()=>{if(!u.current)return{left:0,top:0,width:0};const N=u.current.getBoundingClientRect();return{left:N.left,top:N.top,width:N.width}},[u.current,d]),x=a.useCallback((j,N)=>{Le({[j]:N})},[]),m=()=>{x(t,(s+1)%(o+1))},v=()=>{let j=s+-1;j<0&&(j=o),x(t,j)},b=()=>{c(!l)},S=a.useCallback(j=>()=>{x(t,j),c(!1)},[t]),y=()=>{h(window.innerWidth)};a.useLayoutEffect(()=>(window.addEventListener("resize",y),()=>{window.removeEventListener("resize",y)}),[]);const g=`${.875*i}rem`;return n.jsxs("div",{ref:u,className:"w-full text-lunaLight flex items-center justify-between border border-[#FFFFFF26] bg-[#00000026] py-1 px-3",style:{borderRadius:l?"0px 0px 0.55vw 0.55vw":"0.55vw"},children:[n.jsx("div",{onClick:b,className:"cursor-pointer grow text-left",style:{fontSize:g},children:r[s]}),n.jsxs("div",{className:"flex flex-row g-1",children:[n.jsx(ie,{type:X.ArrowLeft,onClick:v}),n.jsx(ie,{type:X.ArrowRight,onClick:m})]}),l&&n.jsxs(Bn,{children:[n.jsx("div",{className:"absolute top-0 left-0 w-full h-full z-[80]",onClick:b}),n.jsx("div",{className:"absolute px-2 z-[100] text-lunaLight h-[10.1vw] overflow-y-scroll border-t border-l border-r border-[#FFFFFF26] bg-[#292b32] rounded-t-[0.55vw] opacity-95 translate-y-[-100%]",style:{left:f,top:p,width:w,fontSize:g},children:r.map((j,N)=>n.jsx("div",{className:"text-left cursor-pointer p-1 hover:text-white",onClick:S(N),children:j}))})]})]})},mi=7e-4,Vp=({setter:e,value:t,id:r})=>{const o=T(d=>d.resizeFactor()),[s,i]=a.useState(window.innerWidth*mi),l=()=>{i(window.innerWidth*mi*o)},c=a.useCallback(()=>{e(r,+!t)},[t,e,r]);a.useEffect(()=>(l(),window.addEventListener("resize",l),()=>{window.removeEventListener("resize",l)}),[]);const u=t?"fill-[#F48272]":"fill-[#ffffff99] hover:fill-[#ffffffdd]";return n.jsx("div",{className:"cursor-pointer relative",onClick:c,children:n.jsx("svg",{viewBox:"0 0 24 24",width:16*s,height:16*s,className:u,children:n.jsx("path",{className:"transition-fill ease-in-out duration-300",d:"M 9 3 C 7.895 3 7 3.895 7 5 L 7 15.175781 A 3 3 0 0 0 6 15 A 3 3 0 0 0 3 18 A 3 3 0 0 0 6 21 A 3 3 0 0 0 9 18 L 9 10 C 9 9.448 9.448 9 10 9 L 17 9 C 17.552 9 18 9.448 18 10 L 18 15.175781 A 3 3 0 0 0 17 15 A 3 3 0 0 0 14 18 A 3 3 0 0 0 17 21 A 3 3 0 0 0 20 18 L 20 5 C 20 3.895 19.105 3 18 3 L 9 3 z"})})})},zp=({node:e})=>{const{type:t}=e,r=H(L=>L.toggleMainViewType),o=`${t}Cutoff`,s=`${t}Q`,i=`${t}Stereo`,l=`${t}Enabled`,c=`${t}Steepness`,u=`${t}CutoffNoteSnapEnabled`,d=`${t}Gain`,h=`${t}Type`,p=T(L=>L[h])>7,w=T(a.useCallback(L=>L[l],[l])),x=T(a.useCallback(L=>L[u],[u])),m=T(L=>L.isIndividualNode()),v=T(L=>L.resizeFactor()),[b,S]=a.useState(!1),y=a.useCallback((L,I)=>{ut(L,I)},[]),g=Cn,j=a.useCallback((L,I)=>{Le({[L]:I})},[]),N=a.useCallback(()=>{const L=t==="filterA"?ee.FilterPresetA:t==="filterB"?ee.FilterPresetB:t==="filterC"?ee.FilterPresetC:ee.FilterPresetD;r(L)},[r,t,w]);a.useEffect(()=>{S(!0)},[]);const P=p?"":"grayscale opacity-[0.5] pointer-events-none";return n.jsxs("div",{className:"node-panel",style:{filter:w?"":"grayscale(100%)",opacity:b?100:0},children:[n.jsxs("div",{className:"w-[61%] h-full relative",children:[n.jsxs("div",{className:"flex pr-3 h-[20%] items-center justify-between translate-y-[0.55vw]",children:[n.jsxs("div",{className:"flex items-center",children:[n.jsx(ur,{type:t}),!m&&n.jsx("div",{className:"flex items-center cursor-pointer pl-[0.5vw]",style:{pointerEvents:w?"auto":"none"},onClick:N,children:n.jsx(ie,{type:X.Search,size:20})})]}),n.jsx("div",{style:{pointerEvents:w?"auto":"none",width:`${20*v}vw`},children:n.jsxs("div",{className:"flex flex-row items-center space-x-[0.5vw]",children:[n.jsx(Wl,{paramId:c,setter:j}),n.jsx(_p,{type:t})]})})]}),n.jsxs("div",{className:"h-[70%] flex flex-row justify-around items-end",children:[n.jsx(Be,{paramId:o,setter:y,labelLength:6,beforeLabel:n.jsx(Vp,{id:u,setter:g,value:x})}),n.jsx(Be,{paramId:s,setter:y}),n.jsx(Be,{paramId:i,setter:y}),n.jsx("div",{className:P,children:n.jsx(Be,{paramId:d,setter:y})})]})]}),n.jsx("div",{style:{pointerEvents:w?"auto":"none"},className:"w-[39%]",children:n.jsx(Op,{cutoffId:o,qId:s,nodeType:t})})]})},$p=a.memo(zp);function Up({paramId:e,setParameter:t,value:r,text:o="",disabled:s=!1,style:i={}}){const l=Math.round(r)===1;return n.jsx("button",{className:"rounded-sm font-medium p-0.5 w-[4vw]","aria-label":e,style:k({backgroundColor:l?fe.lunaCoral:"#00000014",color:l?fe.lunaDark:"#FFFFFF99",width:"fit-content",alignItems:"center",lineHeight:"16.77px",borderWidth:"0.5px",borderColor:"#FFFFFF1D",textAlign:"center",fontSize:"0.72rem"},i),onClick:()=>{t(e,+!l)},disabled:s,children:o})}const hr=8,Hp=({paramId:e,setter:t})=>{const r=ze()[e];if(!r)return;const{min:o,max:s,defaultValue:i,skew:l}=r,c=T(V=>V.macros.find(E=>E.paramId===e)!==void 0),{hasModulation:u,modType:d}=T(V=>{const E=V.modulations.find(q=>q.paramId===e);return{hasModulation:E!==void 0,modType:E==null?void 0:E.lfoType}}),h=a.useRef(null),f=a.useRef(null),p=a.useRef(null),w=a.useRef(null),x=a.useRef(null),m=a.useRef(null),v=a.useRef(!1),b=a.useRef(!1),S=a.useRef(0),y=()=>{const V=p.current;if(!V)return;const E=We(S.current,o,s,l);V.style.bottom=`${100*E}%`},g=()=>{const V=f.current;V&&(V.textContent=`${Math.round(S.current)}dB`)},j=()=>{b.current=!1,window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",j);const V=f.current;V&&(v.current||(V.style.opacity="0"))},N=V=>{const E=h.current;if(!E)return;const q=E.getBoundingClientRect(),W=Re(1-(V.clientY-q.top)/q.height,0,1),F=xt(W,o,s,l);t(e,F)},P=()=>{t(e,i)},L=()=>{b.current=!0,window.addEventListener("mousemove",N),window.addEventListener("mouseup",j);const V=f.current;V&&(V.style.opacity="1")},I=()=>{v.current=!0,g();const V=f.current;V&&(V.style.opacity="1")},C=()=>{v.current=!1;const V=f.current;V&&(b.current||(V.style.opacity="0"))},M=()=>{if(!m.current)return;const V=_e(e),E=1-We(V,o,s,l);m.current.style.top=`${100*E}%`},R=(V,E,q)=>{const W=We(V,o,s,l),F=E.bipolar?W+E.strength/2:W+E.strength,Z=E.bipolar?W-E.strength/2:W,Y=Re(F,0,1),me=Re(Z,0,1),Se=Math.min(me,Y),je=Math.max(me,Y);q.style.height=`${100*(je-Se)}%`,q.style.bottom=`${100*Math.max(Se,0)}%`},O=V=>{const E=V[e];S.current!==E&&(S.current=E,y(),g());const q=V.macros.find(F=>F.paramId===e),W=V.modulations.find(F=>F.paramId===e);q&&w.current&&R(E,q,w.current),W&&x.current&&R(E,W,x.current)};T(O),ln(M),a.useEffect(()=>{O(Fe.getState())},[w.current,x.current]),a.useEffect(()=>{y()},[p.current]),a.useEffect(()=>()=>{window.removeEventListener("mousemove",N),window.removeEventListener("mouseup",j)},[]);const[{isOver:_,hoveredItem:z},U]=Pr(()=>({accept:[vt.LFO,vt.MACRO],drop:V=>de(void 0,null,function*(){V.type===vt.MACRO?Po(e):ko(V.lfoType,e)}),collect:V=>({hoveredItem:V.getItem(),isOver:V.isOver()})}),[e]),$=a.useMemo(()=>(z==null?void 0:z.lfoType)===be.LFO1?"hover-lfo-1":(z==null?void 0:z.lfoType)===be.LFO2?"hover-lfo-2":(z==null?void 0:z.lfoType)===be.LFO3?"hover-lfo-3":"hover-macro",[z==null?void 0:z.lfoType,z==null?void 0:z.type]);return n.jsxs("div",{className:"h-full relative",ref:U,onDoubleClick:P,children:[n.jsxs("div",{ref:h,className:"h-full flex justify-center relative z-10",style:{width:hr},onMouseDown:L,onMouseEnter:I,onMouseLeave:C,children:[n.jsxs("div",{ref:p,style:{width:hr*3,height:hr*3},className:"z-20 rounded-full absolute left-[50%] translate-x-[-50%] translate-y-[50%] cursor-pointer flex justify-center items-center",children:[n.jsx("div",{style:{width:hr,height:hr},className:"absolute bg-[#585c64] rounded-full relative overflow-hidden",children:n.jsx("div",{className:"absolute w-full h-full bg-[#424A53] top-[0.1vw] rounded-full"})}),n.jsx("div",{ref:f,className:"absolute text-lunaLight text-xs translate-x-[-100%] translate-y-[-1px] left-[1px] transition-opacity"})]}),n.jsxs("div",{className:"w-[2px] z-10 h-full bg-[#00000040] rounded-full cursor-pointer relative",children:[c&&n.jsx("div",{ref:w,className:"absolute right-[-1px] border-r border-r-lunaLight rounded"}),u&&n.jsx("div",{ref:x,className:"absolute left-[-1px] border-l rounded",style:{borderLeftColor:Ir(d)}}),n.jsx("div",{className:"h-full",children:(u||c||!0)&&n.jsx("div",{ref:m,className:"absolute left-[50%] translate-x-[-50%] w-[300%] border-t"})})]})]}),n.jsx("div",{className:"w-full h-full absolute flex justify-center left-0 top-0 pointer-events-none",children:n.jsx("div",{className:`h-full z-0 w-[0px] transition-opacity duration-300 ease-in-out ${$}`,style:{opacity:_?100:0}})})]})},Gp=({streamId:e})=>{const t=Wt(),r=e===Qe.all,o=r?Es(t):[];return n.jsxs(Dt,{className:"select-none py-3 px-5 flex flex-col g-05",children:[n.jsxs(Vr,{children:[" ",r?"Path Mixer":e.replace("stream","Path ")," "]}),n.jsxs("div",{className:"flex flex-row relative ",children:[o.map(s=>n.jsx(pi,{streamId:s,showingAll:r},s)),n.jsx(pi,{streamId:e,showingAll:r},e)]})]})},pi=({streamId:e,showingAll:t})=>{const r=e!==Qe.all,o=`${e}Mute`,s=`${e}Solo`,i=`${e}Gain`,l=`${e}Pan`,c=`${e}MidSide`,u=T(g=>r?g[o]:0),d=T(g=>r?g[s]:0),h=H(g=>g.selectMixer),f=T(g=>g.globalLimiterEnabled),p=ut,w=(g,j)=>{Le({[g]:j})},x=a.useMemo(()=>e===Qe.all?"Global Path":e==null?void 0:e.replace("stream","Path "),[e]),m=a.useCallback(()=>{const g=[Qe.a,Qe.b,Qe.c,Qe.d,Qe.e,Qe.f,Qe.g],j=d===1?0:1,N={[s]:j};j===1&&g.forEach(L=>{L!==e&&(N[`${L}Solo`]=0)}),Le(N)},[d,e]),v=()=>{Le({[o]:u===1?0:1})},b=()=>{h(e)},S=()=>{h(void 0)},y="border border-[#00000026] w-[1.5vw] h-[1.5vw] text-xs rounded cursor-pointer flex justify-center items-center";return n.jsxs("div",{className:"group relative py-[0.6vw] px-[0.4vw] border-[1px] border-transparent hover:border-[#11111155] hover:bg-[#21212233] rounded-xl",onMouseEnter:b,onMouseLeave:S,children:[t&&n.jsx("div",{className:"w-full text-lunaExtraLight group-hover:text-lunaCoral mb-[0.85vw] text-[0.9rem]",children:x}),n.jsxs("div",{className:"flex flex-row g-05 relative justify-between w-full grow",children:[n.jsxs("div",{className:"flex flex-col items-center g-1 pt-[0.3vw]",children:[n.jsxs("div",{className:"flex flex-row g-025 mb-[3px] h-[10vw]",children:[n.jsx(ri,{mute:u,snapshotId:e===Qe.all?"left_snapshot":`${e}:0_snapshot`}),n.jsx(ri,{mute:u,snapshotId:e===Qe.all?"right_snapshot":`${e}:1_snapshot`}),n.jsx("div",{className:"ml-[0.36vw]",children:n.jsx(Hp,{paramId:i,setter:p})})]}),r?n.jsxs("div",{className:"flex flex-row justify-end items-center g-05",children:[n.jsx("div",{className:`${y} ${!d&&"hover:text-lunaCoral"}`,onClick:m,style:{backgroundColor:d?fe.lunaCoral:"#00000033",color:d?"#000000":"#FFFFFF99"},children:"S"}),n.jsx("div",{className:`${y} ${!u&&"hover:text-lunaCoral"}`,onClick:v,style:{backgroundColor:u?fe.lunaCoral:"#00000033",color:u?"#000000":"#FFFFFF99"},children:"M"})]}):n.jsx(Up,{paramId:"globalLimiterEnabled",setParameter:w,value:f,text:"Limiter"})]}),n.jsxs("div",{className:"flex flex-col items-center g-1 pt-[0.3vw]",children:[n.jsx(Be,{small:!0,paramId:c,setter:p}),n.jsx(Be,{small:!0,paramId:l,setter:p})]})]})]})},Wp=()=>{const e=H(d=>d.selectedStreamId),t=H(d=>d.selectedNodeId),r=H(d=>d.showAddNodesPanel),o=T(d=>d.pluginName===oe.BEAM),s=T(d=>d.isIndividualNode()?d.nodes.find(h=>h.type!=="start"&&h.type!=="end"):d.nodes.find(h=>h.id===t)),i=H(d=>d.selectedMainView),l=H(d=>d.selectMainView),c=H(d=>d.toggleAddNodesPanel),u=a.useCallback(()=>{l(null),c()},[]);if(e!=null)return n.jsx(Gp,{streamId:e});if(console.log("[ControlModal.tsx]: render"),o&&!t&&!r)return n.jsx("div",{className:"h-full flex items-center justify-center text-[#CBCBCB] pointer-events-auto",children:n.jsxs("div",{className:"group select-none flex flex-col items-center g-1 cursor-pointer mt-auto text-sm mb-[1.2vw]",onClick:u,children:[n.jsx("div",{className:"w-[3vw] h-[3vw] flex justify-center items-center rounded-full bg-[#636363] group-hover:bg-[#777777] transition-colors",children:n.jsx(ie,{type:X.AddNodes})}),n.jsx("span",{children:" Add Effects "})]})});if(i===ee.Settings||i===ee.Account||!s)return null;switch(s.type){case A.convA:case A.convB:case A.convC:return n.jsx(Dt,{className:"w-full h-full",children:n.jsx(np,{node:s})},`node_${t}`);case A.grainA:case A.grainB:case A.grainC:return n.jsx(Dt,{className:"w-full h-full",children:n.jsx(dp,{node:s})},`node_${t}`);case A.timeA:case A.timeB:case A.timeC:return n.jsx(Dt,{className:"w-full h-full",children:n.jsx(Cp,{node:s})},`node_${t}`);case A.voltA:case A.voltB:case A.voltC:return n.jsx(Dt,{className:"w-full h-full",children:n.jsx(Lp,{node:s})},`node_${t}`);case A.chorusA:case A.chorusB:case A.chorusC:return n.jsx(Dt,{className:"w-full h-full",children:n.jsx(Ip,{node:s})},`node_${t}`);case A.filterA:case A.filterB:case A.filterC:case A.filterD:return n.jsx(Dt,{className:"w-full h-full",children:n.jsx($p,{node:s})},`node_${t}`);default:return null}},Yt=({icon:e,endIcon:t,text:r,selected:o=!1,onClick:s,onRemoveItem:i})=>{const[l,c]=a.useState(!1),[u,d]=a.useState({x:0,y:0}),h=a.useRef(null),f=v=>{v.preventDefault(),c(!0),d({x:v.clientX,y:v.clientY})},p=a.useCallback(v=>{h.current&&!h.current.contains(v.target)&&c(!1)},[h]),w=v=>{v.stopPropagation(),i&&i(),c(!1)};a.useEffect(()=>(document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}),[p]);const m=T(v=>v.isIndividualNode())?"text-md":"text-sm";return n.jsxs("li",{className:`flex items-center ${m} p-[0.7vw] rounded-sm hover:bg-[#00000033] cursor-pointer`,style:{color:"#FFFFFF99",background:o?"#0000004D":""},onClick:s,onContextMenu:f,children:[n.jsx("div",{className:"mr-[0.6vw]",children:e}),n.jsx("div",{className:"truncate grow text-left",children:r}),n.jsx("div",{children:t}),i&&n.jsx(Bn,{children:l&&n.jsx("div",{ref:h,className:"absolute flex flex-col p-2 z-[100] bg-[#373B45] border border-[#FFFFFF1F] rounded-md text-sm text-lunaWhite",style:{left:u.x,top:u.y},children:n.jsxs("div",{className:"rounded-md cursor-pointer px-2 py-1 hover:text-white hover:bg-[#292c33] transition-all duration-300 ease-in-out",onClick:w,children:["Remove ",n.jsx("strong",{children:r})]})})})]})},Ks=e=>{const{text:t,disabled:r,selected:o,onClick:s,onIconClick:i,favorite:l,isDefault:c,author:u,noBackground:d,reverse:h,setAsDefault:f,onRemovePreset:p}=e,[w,x]=a.useState(!1),[m,v]=a.useState(!1),[b,S]=a.useState({x:0,y:0}),y=a.useRef(null),g=a.useMemo(()=>l?n.jsx(ie,{type:X.HeartFilled,color:fe.lunaCoral}):n.jsx(ie,{type:X.Heart,color:w?fe.lunaCoral:"#FFFFFF33"}),[l,w]),j=a.useCallback(V=>{V.stopPropagation(),i()},[i]),N=()=>{x(!0)},P=()=>{x(!1)},L=V=>{V.preventDefault(),v(!0),S({x:V.clientX,y:V.clientY})},I=a.useCallback(V=>{y.current&&!y.current.contains(V.target)&&v(!1)},[y]),C=V=>{V.stopPropagation(),p&&p(),v(!1)},M=V=>{V.stopPropagation(),f&&f(),v(!1)};a.useEffect(()=>(document.addEventListener("mousedown",I),()=>{document.removeEventListener("mousedown",I)}),[I]);const R=r?"opacity-0":"",O=d?"":`${o?"bg-[#0000004D]":""} hover:bg-[#00000033]`,_=h?"flex-row-reverse":"",z=T(V=>V.isIndividualNode()),U=z?"text-md":"text-sm",$=z?"text-sm":"text-xs";return n.jsxs("li",{className:`flex items-center gap-[0.6vw] p-[0.65vw] rounded-sm cursor-pointer hover:text-[#F48272] ${_} ${R} ${O} ${U}`,style:{color:"#FFFFFF99",pointerEvents:r?"none":"auto"},onClick:r?void 0:s,onMouseEnter:N,onMouseLeave:P,onContextMenu:L,children:[n.jsx("div",{onClick:j,children:g}),n.jsx("div",{style:{color:r?"#FFFFFF77":""},className:"truncate text-left",children:t}),n.jsx("div",{className:"ml-auto",children:c&&n.jsx(ie,{type:X.Star,color:fe.lunaCoral,size:.5})}),n.jsx("div",{className:`auto text-right font-medium truncate ${$}`,style:{color:o?"#FFFFFF99":"#FFFFFF66"},children:u}),(f||p)&&n.jsx(Bn,{children:m&&n.jsxs("div",{ref:y,className:"absolute flex flex-col p-2 z-[100] bg-[#373B45] border border-[#FFFFFF1F] rounded-md text-sm text-lunaWhite",style:{left:b.x,top:b.y},children:[f&&n.jsxs("div",{className:"rounded-md cursor-pointer px-2 py-1 hover:text-white hover:bg-[#292c33] transition-all duration-300 ease-in-out",onClick:M,children:["Set ",n.jsx("strong",{children:t})," as default"]}),p&&n.jsxs("div",{className:"rounded-md cursor-pointer px-2 py-1 hover:text-white hover:bg-[#292c33] transition-all duration-300 ease-in-out",onClick:C,children:["Delete ",n.jsx("strong",{children:t})]})]})})]})},Js=a.memo(({onChange:e,value:t,width:r="117px",onXClick:o})=>n.jsxs("div",{className:"flex h-[2vw] items-center",style:{background:"linear-gradient(0deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.25)), linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15))",borderRadius:"20px",padding:"6px",width:r},children:[n.jsx(ie,{type:X.Search}),n.jsx("input",{style:{width:`calc(${r} - 60px)`,height:"18px",color:"#FFFFFF99",background:"none",outline:"none",fontSize:"0.875rem",fontWeight:"400",marginLeft:"8px",caretColor:"#FFFFFF99"},placeholder:"Search",className:"placeholder:text-[#FFFFFF33]",onChange:e,value:t,autoCorrect:"off"}),t&&n.jsx("div",{className:"flex ml-auto items-center justify-center cursor-pointer",onClick:o,children:n.jsx(ie,{type:X.Close})})]})),Qs=({value:e,onClick:t})=>e?n.jsx(ie,{type:X.HeartFilled,hoverColor:fe.lunaCoral,color:fe.lunaCoralAccent,onClick:t}):n.jsx(ie,{type:X.Heart,onClick:t}),qp=({items:e,selected:t=0,isOpen:r=!1,style:o={},onSelect:s,setIsOpen:i,width:l})=>{const[c,u]=a.useState(!1),d=a.useCallback(p=>()=>{s(p),i(!1)},[s,i]),h=a.useCallback(()=>i(!r),[r]),f=a.useCallback(p=>()=>u(p),[u]);return n.jsxs("div",{children:[r&&n.jsx("ul",{className:"absolute z-20 grow",style:{borderRadius:"3px",fontSize:"0.75rem",width:l,background:"#1b1d24",border:"1px solid #00000026"},children:e.map((p,w)=>n.jsxs("li",{onClick:d(w),className:"hover:text-white text-[#FFFFFF80] text-left px-[0.7vw] py-[2px] cursor-pointer flex items-center justify-between",children:[p,t===w&&n.jsx("div",{className:"ml-[3px]",children:n.jsx(ie,{type:X.Check,size:8})})]}))}),n.jsxs("div",{className:"flex items-center justify-center px-[0.7vw] py-[2px] cursor-pointer justify-between",style:k({background:c?"linear-gradient(0deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)), linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15))":"linear-gradient(0deg, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)), linear-gradient(0deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.15))",color:t>0?fe.lunaCoral:c?"white":"#FFFFFF80",borderRadius:"3px",fontSize:"0.75rem",border:"1px solid #00000026",width:l},o),onClick:h,onMouseOver:f(!0),onMouseLeave:f(!1),children:[n.jsx("div",{className:"mr-[3px]",children:e[t]}),n.jsx(ie,{type:X.ArrowDown,active:t>0})]})]})};function $t(e,t){return e.length===t.length&&e.every((r,o)=>r===t[o])}function Zp(e){const t=a.useRef(new Map);return a.useCallback(r=>(t.current.has(r)||t.current.set(r,()=>e(r)),t.current.get(r)),[e])}const os="https://lunacy.audio/products/beam/",Yp=[X.Particles,X.Waves,X.Space,X.Drum,X.Microphone,X.Joker,X.Lab,X.Magic,X.Transient],Xp=[X.Pattern,X.Time,X.Fractal,X.Thunder,X.Embers,X.Time,X.Time,X.Time],Kp=(e,t)=>t.productId===void 0||Number(t.productId)===0?!0:e.includes(Number(t.productId)),ss=e=>{for(let t of e)if(t.productId)return Number(t.productId);return null},Jp=()=>{const e=lt(),{user:t}=e,r=H(B=>B.showPresetFavorites),o=H(B=>B.setShowPresetFavorites),s=H(B=>B.selectedPresetTags),i=H(B=>B.setSelectedPresetTags),l=H(B=>B.selectedPresetCategory),c=H(B=>B.setSelectedPresetCategory),u=H(B=>B.selectMainView),d=H(B=>B.presetParentFolders),h=H(B=>B.setPresetParentFolders),f=H(B=>B.clearAllNodePresets),p=H(B=>B.presetSearchValue),w=H(B=>B.setPresetSearchValue),x=pn(B=>B.numUpdates),m=pn(B=>B.favorites),v=pn(B=>B.getFoldersInFolder),b=pn(B=>B.saveFavorite),S=pn(B=>B.getFilesInFolder),y=pn(B=>B.getFile),g=T(B=>B.activePresetPath),j=lt(B=>B.userProductIds()),N=mt(B=>B.setDefaultPresetPath),P=mt(B=>B.defaultPresetPath),L=a.useMemo(()=>v(["Lunacy"]),[]),I=a.useMemo(()=>v(["Expansions"]),[]),C=a.useMemo(()=>v(["User"]),[]),[M,R]=a.useState(!1),[O,_]=a.useState(!1),z=a.useRef(null),U=a.useRef(null),$=!!((t==null?void 0:t.id)==="Beatport"||t!=null&&t.isBeatport),[V,E]=a.useMemo(()=>[y(g),nt(g).replace(".preset","")],[g]),q=V==null?void 0:V.author,W=Object.values(mo),F=Object.values(po),Z=a.useMemo(()=>{if(!V)return;const B=V.tags;let G=[],pe=[];return B==null||B.forEach(ke=>{if(W.includes(ke)){G.push(ke);return}F.includes(ke)&&pe.push(ke)}),{tags:G,categories:pe}},[V==null?void 0:V.tags,W,F]),Y=a.useMemo(()=>{const B=S(L);return L.map(G=>{var Ie;const pe=B.filter($e=>$e.path.includes(G)),ke=ss(pe),Pe=io.find($e=>$e.id===ke);return{isUnlocked:ke===null||j.includes(ke),url:(Ie=Pe==null?void 0:Pe.url)!=null?Ie:os}})},[I,L,j]),me=a.useMemo(()=>{const B=S(I);return I.map(G=>{var Ie;const pe=B.filter($e=>$e.path.includes(G)),ke=ss(pe),Pe=io.find($e=>$e.id===ke);return{isUnlocked:j.includes(ke),url:(Ie=Pe==null?void 0:Pe.url)!=null?Ie:os}})},[I,j]),Se=a.useMemo(()=>{let B=S(d);if(d[d.length-1]==="Expansions"&&(B=B.filter(G=>j.includes(Number(G.productId)))),r&&(B=B.filter(G=>m.includes(G.path))),p){const G=p.toLowerCase();B=B.filter(pe=>nt(pe.path).replace(".preset","").toLowerCase().includes(G)||pe.author.toLowerCase().includes(G))}return B=B.filter(G=>{var pe;if(!G.tags&&s.length>0)return!1;if(!G.tags&&s.length===0)return!0;for(const ke of s)if(!((pe=G.tags)!=null&&pe.includes(ke)))return!1;return!0}),B},[d,r,p,s,j,x]),je=a.useMemo(()=>ss(Se),[Se]),ye=a.useMemo(()=>!Ti.map(G=>G.productId).includes(je)||j.includes(je),[j,je]),le=a.useMemo(()=>{var B,G;return(G=(B=io.find(pe=>pe.id===je))==null?void 0:B.url)!=null?G:os},[je]),Me=Zp(B=>{const G=H.getState().selectedPresetTags;G.includes(B)?i(G.filter(pe=>pe!==B)):i([...G,B])}),ve=a.useCallback(()=>{c(0),i([])},[]),K=B=>{const G=s.filter(pe=>!F.includes(pe));B>0&&G.push(F[B]),c(B),i(G)},ce=B=>{w(B.target.value)};a.useCallback(()=>de(void 0,null,function*(){const B=yield Xt("Preset");yield Ma(B)}),[Xt,Ma]);const re=B=>{var G;(G=z.current)!=null&&G.contains(B.target)||R(!1)},te=a.useCallback(()=>{o(!r)},[o,r]),ue=a.useCallback(()=>{u(null)},[u]),he=()=>{ku()},Q=()=>{u(ee.Account)},Ne=a.useCallback(B=>()=>{N(B.path)},[]),xe=a.useCallback(B=>()=>{nn(B.path)},[]),ae=a.useCallback(B=>()=>{Kt(B)},[]),we=a.useCallback(B=>()=>{h(B)},[h]),Ae=a.useCallback(()=>w(""),[]);a.useEffect(()=>{document.addEventListener("mousedown",re)},[]),a.useEffect(()=>{U.current&&(U.current.scrollTop=0)},[d.join(",")]),a.useEffect(()=>{let B;return O?B=setInterval(()=>{const G=document.getElementById("rotating-div");if(!G)return;const pe=G.style.rotate.match(/\d+/),ke=pe?parseFloat(pe[0]):0;G.style.rotate=`${ke+180}deg`},1e3):clearInterval(B),()=>clearInterval(B)},[O]);const Ce=a.useMemo(()=>({marginRight:"5px"}),[]),qe=a.useMemo(()=>({marginRight:"5px",marginBottom:"5px"}),[]);return n.jsx(Dt,{className:"absolute px-6 pt-6 pb-[0.4vw] flex flex-col w-full h-full z-10",children:n.jsxs("div",{className:"flex flex-col h-full w-full",children:[n.jsxs("div",{className:"flex mb-[1.8vw] items-center",children:[n.jsx("div",{className:"text-xl font-bold text-left text-[#F48272] mr-[1.4vw]",children:"Presets"}),n.jsx(Js,{value:p||"",onChange:ce,width:"12.5vw",onXClick:Ae}),n.jsx("div",{className:"ml-[0.7vw]",children:n.jsx(Qs,{value:r,onClick:te})}),n.jsxs("div",{className:"flex ml-[1.6vw]",children:[n.jsx("div",{ref:z,children:n.jsx(qp,{items:F,style:Ce,onSelect:K,selected:l,isOpen:M,setIsOpen:R,width:"5.5vw"})}),W.map(B=>{const G=s.includes(B);return n.jsx(hn,{label:B,style:Ce,selected:G,onClick:Me(B)},B)})]}),n.jsx("div",{onClick:ue,className:"cursor-pointer ml-auto",children:n.jsx(ie,{type:X.Close})})]}),n.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[n.jsxs("div",{className:"flex flex-col w-[25%] mr-[0.7vw]",children:[n.jsxs("ul",{className:"pr-[0.8vw] h-[87%] overflow-y-auto overflow-x-hidden",children:[n.jsx(Yt,{icon:n.jsx(ie,{type:X.Folder}),text:"Lunacy",onClick:we(["Lunacy"]),selected:$t(d,["Lunacy"])}),n.jsx("ul",{className:"w-[90%] ml-auto",children:L.map(B=>B.replace(/^\d+\s+/,"")).map((B,G)=>{const pe=Y[G].isUnlocked?null:n.jsx(ie,{type:X.Lock,size:4,onClick:ae(Y[G].url)});return n.jsx(Yt,{icon:n.jsx(ie,{type:Yp[G]}),endIcon:pe,text:B,onClick:we(["Lunacy",L[G]]),selected:$t(d,["Lunacy",L[G]])},G)})}),n.jsx(Yt,{icon:n.jsx(ie,{type:X.Folder}),text:"Expansions",onClick:we(["Expansions"]),selected:$t(d,["Expansions"])}),n.jsx("ul",{className:"w-[90%] ml-auto",children:I.map(B=>B.replace(/^\d+\s+/,"")).map((B,G)=>{const pe=me[G].isUnlocked?null:n.jsx(ie,{type:X.Lock,size:4,onClick:ae(me[G].url)});return n.jsx(Yt,{icon:n.jsx(ie,{type:Xp[G]}),endIcon:pe,text:B,onClick:we(["Expansions",I[G]]),selected:$t(d,["Expansions",I[G]])},G)})}),n.jsx(Yt,{icon:n.jsx(ie,{type:X.Folder}),text:"User",onClick:we(["User"]),selected:$t(d,["User"])}),n.jsx("ul",{className:"w-[90%] ml-auto",children:C.map((B,G)=>n.jsx(Yt,{icon:n.jsx(ie,{type:X.Folder}),text:B,onClick:we(["User",B]),selected:$t(d,["User",B])},G))}),!Vt]}),n.jsxs("div",{className:"flex flex-col h-[10%] pr-[1vw] mt-auto",children:[n.jsx(gn,{horizontal:!0,color:"#FFFFFF1A"}),n.jsxs("div",{className:"flex h-full w-full items-center text-[#FFFFFF99] text-sm rounded-sm hover:bg-[#00000033] active:bg-[#00000026] cursor-pointer",style:{padding:"0px 1.4vw 0px 0.7vw"},onClick:he,children:[n.jsx("div",{className:"mr-[0.5vw]",children:n.jsx(ie,{type:X.Reset})}),"Reset to Default"]})]})]}),n.jsx(gn,{color:"#FFFFFF1A"}),n.jsxs("div",{className:"w-[47%] relative h-full flex flex-col",children:[n.jsx("div",{className:"ml-[0.36vw] overflow-y-auto overflow-x-hidden relative",style:{height:s.length>0?"calc(100% - 3vw)":"100%"},ref:U,children:Se.length===0?n.jsx("div",{className:"flex h-full w-full items-center justify-center text-sm text-[#FFFFFF99]",children:"No Presets Found"}):n.jsx("ul",{className:"pb-[0.9vw] pr-[0.9vw]",children:Se.map((B,G)=>n.jsx(Ks,{disabled:!Kp(j,B),text:nt(B.path).replace(".preset",""),onIconClick:()=>de(void 0,null,function*(){yield b(B.path)}),onClick:()=>de(void 0,null,function*(){f(),yield ro(B)}),selected:g===B.path,favorite:m.includes(B.path),isDefault:P===B.path,author:B.author,setAsDefault:Ne(B),onRemovePreset:B.factory?void 0:xe(B)},G))})}),s.length>0&&n.jsx("div",{className:"h-[3vw] flex items-center justify-center",children:n.jsx(hn,{label:"Remove filters",onClick:ve})}),!ye&&n.jsxs("div",{className:"absolute left-0 top-0 w-full h-full bg-[#1B1B1B40] rounded flex flex-col justify-center items-center backdrop-blur-sm",children:[n.jsx("div",{className:"text-white text-[1.2vw] font-semibold mb-3",children:"This pack requires a license key"}),!$&&n.jsx(Xs,{_setSyncing:_}),$&&n.jsx("div",{className:"text-white bg-[#606060] py-1 px-3 rounded-full mt-3 text-[1vw] cursor-pointer w-[15vw] text-center",onClick:Q,children:"Link with Lunacy Account"}),n.jsx("div",{className:"mt-3 text-lunaLight underline cursor-pointer",onClick:ae(le),children:"Learn more"})]})]}),n.jsx(gn,{color:"#FFFFFF1A"}),n.jsxs("div",{className:"w-[28%] flex flex-col pl-[0.7vw] pr-[1.45vw] ml-[0.36vw]",children:[n.jsx("div",{className:"text-xl text-[#FFFFFF99] font-medium w-full mb-[1vw] text-left truncate",children:E}),q&&n.jsxs("div",{className:"text-sm mb-[1vw] text-[#FFFFFF80] w-full text-left truncate",children:["by ",q]}),n.jsx("div",{className:"text-sm mb-[1.3vw] text-[#FFFFFF80] max-h-[65%] w-full text-left overflow-y-auto overflow-x-hidden whitespace-pre-wrap",children:V==null?void 0:V.description}),n.jsxs("div",{className:"flex flex-col",children:[n.jsx("div",{className:"flex w-full flex-wrap",children:Z==null?void 0:Z.tags.map((B,G)=>n.jsx(hn,{label:B,disabled:!0,style:qe},G))}),n.jsx("div",{className:"flex w-full flex-wrap mt-[3px]",children:Z==null?void 0:Z.categories.map((B,G)=>n.jsx(hn,{label:B,disabled:!0,style:qe},G))})]})]})]})]})})},gr=["convA","convB","convC"],eo=gr.map(e=>`${e}Ir`),as=({type:e})=>{const t=H(E=>E.selectMainView),r=H(E=>E.setConvDSPLoading);H(E=>E.openSaveIRModal);const o=H(E=>{switch(e){case A.convA:return E.convAParentFolders;case A.convB:return E.convBParentFolders;case A.convC:return E.convCParentFolders}return[""]}),s=H(E=>{switch(e){case A.convA:return E.convASearchValue;case A.convB:return E.convBSearchValue;case A.convC:return E.convCSearchValue}return""}),i=H(E=>{switch(e){case A.convA:return E.convAShowFavorites;case A.convB:return E.convBShowFavorites;case A.convC:return E.convCShowFavorites}return!1}),l=H(E=>E.setIRParentFolders),c=H(E=>E.setIRSearchValue),u=H(E=>E.setShowIRFavorites),{favorites:d,getFoldersInFolder:h,saveFavorite:f,getFilesInFolder:p,numUpdates:w,getFullRelativePath:x}=rn(),[m,v]=a.useMemo(()=>[h(["Lunacy"]),h(["User"])],[w,h]),b=`${e}Ir`,S=T(a.useCallback(E=>E[b],[b])),y=H(E=>E.updateWarnBeforeModal),g=a.useMemo(()=>m.map(E=>E.substring(3)),[m]),j=a.useMemo(()=>{let E=p(o);if(i&&(E=E.filter(q=>d.includes(q.path))),s){const q=s.toLowerCase();E=E.filter(W=>nt(W.path).replace(".impulse","").toLowerCase().includes(q)||W.author.toLowerCase().includes(q))}return E},[o,i,d,s,w]),N=a.useCallback(()=>{u(!i,e)},[u,i]),P=a.useCallback(()=>{t(null)},[t]),L=a.useCallback(()=>de(void 0,null,function*(){const E=yield Xt("IR");yield Sa(E)}),[Xt,Sa]);a.useCallback(()=>de(void 0,null,function*(){const E=yield Xt("IR");yield Ca(E)}),[Xt,Ca]);const I=a.useCallback(E=>{c(E.target.value,e)},[c]),C=a.useCallback(()=>{c("",e)},[c]),M=a.useCallback(E=>()=>{l(E,e)},[]),R=a.useCallback(E=>()=>de(void 0,null,function*(){f(E)}),[]),O=a.useCallback((E,q)=>{Fe.getState()[`${q}Ir`]!==E&&(r(q,!0),Le({[`${q}Ir`]:E}))},[r,Le]),_=a.useCallback(E=>()=>{O(E,e)},[O,e]),z=Ri()[`${e}Ir`],U=a.useCallback(E=>{const q=x(["User",E]);nn(q)},[nn]),$=a.useCallback(E=>{if(E!=="Imported")return()=>{const q=[],W=eo.map(F=>Fe.getState()[F]);for(let F=0;F<W.length;F++){const Z=W[F],Y=gr[F],me=ir(Z).slice(-3,-1);$t(me,["User",E])&&q.push(Y)}if(q.length>0){y({text:`${E} contains IRs which are currently in use. Removing this folder will swap them to the default IR.`,action:()=>{for(const F of q)O(z,F);U(E)},show:!0});return}U(E)}},[U,y,eo,gr,O,z]),V=a.useCallback(E=>{if(!E.factory)return()=>{const q=[],W=eo.map(F=>Fe.getState()[F]);for(let F=0;F<W.length;F++){const Z=W[F],Y=gr[F];(Z===E.path||E.path.includes(Z))&&q.push(Y)}if(q.length>0){y({text:`The file ${E.path} is currently in use. Deleting this file will swap it to the default IR.`,action:()=>{for(const F of q)O(z,F);nn(E.path)},show:!0});return}nn(E.path)}},[nn,y,eo,gr,O,z]);return n.jsx(Dt,{className:"px-6 pt-6 pb-[0.4vw] flex flex-col w-[55%] h-full ml-auto",children:n.jsxs("div",{className:"flex flex-col h-full w-full",children:[n.jsxs("div",{className:"flex mb-[2vw] items-center justify-between w-full",children:[n.jsx("div",{className:"text-xl font-bold text-left text-[#F48272]",children:"Spaces"}),n.jsxs("div",{className:"flex",children:[n.jsx(Js,{value:s||"",onChange:I,width:"17vw",onXClick:C}),n.jsxs("div",{className:"ml-[1vw] flex items-center gap-2",children:[n.jsx(Qs,{value:i,onClick:N}),!Vt]})]}),n.jsx("div",{onClick:P,className:"cursor-pointer",children:n.jsx(ie,{type:X.Close})})]}),n.jsxs("div",{className:"flex h-full w-full overflow-hidden",children:[n.jsxs("div",{className:"flex flex-col w-[39%] mr-[0.7vw]",children:[n.jsxs("ul",{className:"pr-[1vw] h-[87%] overflow-y-auto overflow-x-hidden",children:[n.jsx(Yt,{icon:n.jsx(ie,{type:X.Folder}),text:"Lunacy",onClick:M(["Lunacy"]),selected:$t(o,["Lunacy"])}),n.jsx("ul",{className:"w-[90%] ml-auto",children:g.map((E,q)=>n.jsx(Yt,{icon:n.jsx(ie,{type:X.Folder}),text:E,onClick:M(["Lunacy",m[q]]),selected:$t(o,["Lunacy",m[q]])},q))}),n.jsx(Yt,{icon:n.jsx(ie,{type:X.Folder}),text:"User",onClick:M(["User"]),selected:$t(o,["User"])}),n.jsx("ul",{className:"w-[90%] ml-auto",children:v.map((E,q)=>n.jsx(Yt,{icon:n.jsx(ie,{type:X.Folder}),text:E,onClick:M(["User",E]),selected:$t(o,["User",E]),onRemoveItem:$(E)},q))})]}),n.jsxs("div",{className:"flex flex-col h-[13%] pr-[1vw]",children:[n.jsx(gn,{horizontal:!0,color:"#FFFFFF1A"}),n.jsxs("div",{className:"flex h-full w-full items-center text-[#FFFFFF99] text-sm rounded-sm hover:bg-[#00000033] cursor-pointer",style:{padding:"0px 1.4vw 0px 0.7vw"},onClick:L,children:[n.jsx("div",{className:"mr-[0.5vw]",children:n.jsx(ie,{type:X.Plus})}),"Add Folder"]}),!Vt]})]}),n.jsx(gn,{color:"#FFFFFF1A"}),n.jsx("div",{className:"w-[61%] ml-[0.3vw] overflow-y-auto overflow-x-hidden",children:j.length===0?n.jsx("div",{className:"flex h-full w-full text-sm text-[#FFFFFF99] items-center justify-center",children:"No Presets Found"}):n.jsx("ul",{className:"pb-[0.9vw] pr-[0.45vw]",children:j.map((E,q)=>n.jsx(Ks,{text:nt(E.path).replace(".impulse",""),onIconClick:R(E.path),onClick:_(E.path),selected:S===E.path||E.path.includes(S),favorite:d.includes(E.path),author:E.author,onRemovePreset:V(E)},q))})})]})]})})},Nt=({type:e})=>{const t=e.includes("grain"),r=e.includes("time"),o=e.includes("filter"),s=e.includes("chorus"),i=a.useMemo(()=>t?oe.Grains:r?oe.Time:o?oe.Filter:s?oe.Haze:oe.Volt,[e]),l=()=>{kn(e,!0)},c=H(C=>{switch(e){case A.filterA:return C.filterASelectedPreset;case A.filterB:return C.filterBSelectedPreset;case A.filterC:return C.filterCSelectedPreset;case A.filterD:return C.filterDSelectedPreset;case A.grainA:return C.grainASelectedPreset;case A.grainB:return C.grainBSelectedPreset;case A.grainC:return C.grainCSelectedPreset;case A.timeA:return C.timeASelectedPreset;case A.timeB:return C.timeBSelectedPreset;case A.timeC:return C.timeCSelectedPreset;case A.voltA:return C.voltASelectedPreset;case A.voltB:return C.voltBSelectedPreset;case A.voltC:return C.voltCSelectedPreset;case A.chorusA:return C.hazeASelectedPreset;case A.chorusB:return C.hazeBSelectedPreset;case A.chorusC:return C.hazeCSelectedPreset}}),u=H(C=>C.selectMainView),d=H(C=>C.openSaveNodePresetModal),h=H(C=>{switch(e){case A.filterA:return C.selectFilterAPreset;case A.filterB:return C.selectFilterBPreset;case A.filterC:return C.selectFilterCPreset;case A.filterD:return C.selectFilterDPreset;case A.grainA:return C.selectGrainAPreset;case A.grainB:return C.selectGrainBPreset;case A.grainC:return C.selectGrainCPreset;case A.timeA:return C.selectTimeAPreset;case A.timeB:return C.selectTimeBPreset;case A.timeC:return C.selectTimeCPreset;case A.voltA:return C.selectVoltAPreset;case A.voltB:return C.selectVoltBPreset;case A.voltC:return C.selectVoltCPreset;case A.chorusA:return C.selectHazeAPreset;case A.chorusB:return C.selectHazeBPreset;case A.chorusC:return C.selectHazeCPreset}}),f=yr(C=>C.getFilesInFolder([i])),p=yr(C=>t?C.grainFavorites:r?C.timeFavorites:o?C.filterFavorites:s?C.hazeFavorites:C.voltFavorites),w=yr(C=>C.saveFavorite),[x,m]=a.useState(""),[v,b]=a.useState(!1),S=a.useMemo(()=>{const C=f.filter(R=>p.includes(R.path));let M=v?C:f;if(x){const R=x.toLowerCase();M=M.filter(O=>{const{name:_,author:z}=O;return _.toLowerCase().includes(R)||z.toLowerCase().includes(R)})}return M=M.sort((R,O)=>nt(R.path).localeCompare(nt(O.path),void 0,{numeric:!0,sensitivity:"base"})),M},[f,p,v,x]),y=a.useCallback(C=>{m(C.target.value)},[m]),g=a.useCallback(()=>{b(!v)},[b,v]),j=a.useCallback(()=>{u(null)},[]),N=C=>{C.stopPropagation(),d()};a.useCallback(()=>de(void 0,null,function*(){const C=yield Xt("Node Preset");console.error("handle add factory node preset folder not implemented"),yield ja(C,oe.Grains)}),[Xt,ja]);const P=a.useCallback(C=>()=>{h(C),ms(C,e)},[h,ms,e]),L=a.useCallback(()=>m(""),[]),I=t?oe.Grains:r?oe.Time:o?oe.Filter:s?oe.Haze:oe.Volt;return n.jsx(Dt,{className:"px-6 pt-6 pb-[0.4vw] flex flex-col w-[55%] h-full ml-auto",children:n.jsxs("div",{className:"flex flex-col h-full w-full",children:[n.jsxs("div",{className:"flex mb-[1.8vw] items-center w-full justify-between",children:[n.jsx("div",{className:"text-xl font-bold text-left text-[#F48272]",children:I}),n.jsxs("div",{className:"flex items-center",children:[n.jsx("div",{className:"mr-[0.5vw]",onClick:l,children:n.jsx(ie,{type:X.Reset})}),n.jsx(Js,{value:x,onChange:y,width:"17vw",onXClick:L}),n.jsx("div",{onClick:N,className:"ml-[0.7vw] cursor-pointer",children:n.jsx(ie,{type:X.Save})}),n.jsx("div",{className:"ml-[0.36vw]",children:n.jsx(Qs,{value:v,onClick:g})})]}),n.jsx("div",{onClick:j,className:"cursor-pointer",children:n.jsx(ie,{type:X.Close})})]}),n.jsx("div",{className:"flex h-full w-full overflow-y-auto overflow-x-hidden",children:n.jsxs("ul",{className:"flex flex-col w-full pb-[0.9vw] pr-[0.9vw]",children:[S.map((C,M)=>n.jsx(Ks,{onIconClick:()=>de(void 0,null,function*(){yield w(C.path,i)}),onClick:P(C.path),text:nt(C.path).replace(".nodepreset",""),favorite:p.includes(C.path),selected:c===C.path,author:C.author,onRemovePreset:C.factory?void 0:()=>{nn(C.path)}},M)),!Vt]})})]})})},Qp=()=>{const e=H(p=>p.selectMainView),t=H(p=>p.selectedLFO),r=T(p=>t?JSON.stringify(p[t]):void 0),o=a.useMemo(()=>r?JSON.parse(r):void 0,[r]),[s,i]=a.useState((o==null?void 0:o.name)||""),l=Ir(t),c=a.useCallback(()=>{e(null)},[kt]),u=a.useCallback(()=>{e(ee.lfoBrowser)},[kt]),d=()=>{if(o===void 0)return[];let p=ir(o.path).slice(0,-1);return p.length<2?["LFOs","User"]:(p[1]="User",o.factory&&p.length===3&&p.pop(),p)},h=a.useCallback(()=>{const p=Nr(d().concat(s+".lfo")),w=D(k({},o),{name:s,factory:!1,path:p});Le({[`${t}`]:w}),lu(w),e(ee.lfoBrowser)},[s,o,t]),f=a.useCallback(p=>{i(p.target.value)},[i]);return n.jsxs(Dt,{className:"flex flex-col w-full h-full",children:[n.jsxs("div",{className:"h-[15%] flex justify-between items-center px-5",children:[n.jsxs("div",{className:"cursor-pointer text-[#FFFFFF99] w-[9vw] flex flex-row items-center g-2",onClick:u,children:[n.jsx(ie,{type:X.ArrowLeft,size:22}),n.jsx("div",{children:"Back"})]}),n.jsxs("div",{className:"border rounded-full px-4 py-1 bg-[#00000040] border-[#00000026] cursor-pointer border w-[19vw] flex justify-between items-center",children:[n.jsx("input",{type:"text",placeholder:"Enter LFO Name",className:"bg-transparent border-none outline-none text-lunaLight placeholder-lunaTextSecondary",value:s,onChange:f}),n.jsx(ie,{type:X.Save,onClick:h})]}),n.jsx("div",{onClick:c,className:"cursor-pointer w-[9vw] flex flex-row-reverse",children:n.jsx(ie,{type:X.Close})})]}),n.jsx("div",{className:"h-[85%] bg-[#00000052]",children:t&&o&&n.jsx(Ul,{id:t,lfo:o,active:!0,color:l})})]})},e2=a.memo(Qp),t2=({mod:e,textColor:t})=>{const{paramId:r,strength:o}=e,{lfoType:s}=e,i=s?Ye.LFO:Ye.MACRO,l=a.useRef(null),c=a.useRef(null),u=a.useCallback(d=>h=>{h=Re(h,-1,1),e.strength=h,br(e,d)},[br,e]);return n.jsxs("div",{ref:l,className:"text-sm cursor-pointer h-full relative py-1 flex flex-col justify-center",children:[n.jsx(Tn,{paramId:r,className:"absolute w-full h-full",setter:u(!0),interfaceSetter:u(!1),modMacroType:i,info:{min:-1,max:1,step:.001,skew:1,defaultValue:.3}}),n.jsx("div",{ref:c,style:{color:t!=null?t:fe.lunaCoral},children:o.toFixed(2)})]})},n2=a.memo(t2),r2=Ns.memo(({mod:e})=>{const{paramId:t,bipolar:r,strength:o}=e,{lfoType:s}=e,i=s?Ye.LFO:Ye.MACRO,l=a.useMemo(()=>ze()[t].name,[t]),c=T(P=>{const L=P.modulations.filter(I=>I.paramId===t).map(I=>I.lfoType);return P.macros.find(I=>I.paramId===t)&&L.push(Ye.MACRO),[{label:"LFO 1",value:be.LFO1,disabled:L.includes(be.LFO1)},{label:"LFO 2",value:be.LFO2,disabled:L.includes(be.LFO2)},{label:"LFO 3",value:be.LFO3,disabled:L.includes(be.LFO3)},{label:"ENV",value:be.ENV,disabled:L.includes(be.ENV)},{label:"Macro",value:Ye.MACRO,disabled:L.includes(Ye.MACRO)}]}),u=H(P=>P.selectModulation),d=H(P=>{var L,I;return((L=P.selectedModulation)==null?void 0:L.paramId)===t&&((I=P.selectedModulation)==null?void 0:I.lfoType)===s}),[h,f]=a.useState(!1),p=H(P=>P.hoveredParamId),w=H(P=>P.setHoveredParamId),x=a.useRef(!1),m=a.useCallback(()=>{br(D(k({},e),{bipolar:r?0:1}))},[e,r,br]),v=P=>{P.stopPropagation(),u(d?null:e)},b=P=>{const L=c[P].value,I=()=>{const{bipolar:R,hovered:O,paramId:_,strength:z}=e;Aa(e,{bipolar:R,hovered:O,paramId:_,strength:z})},C=R=>{const{bipolar:O,hovered:_,paramId:z,strength:U}=e;Aa(e,{bipolar:O,hovered:_,paramId:z,strength:U,lfoType:R})},M=R=>{const O=D(k({},e),{lfoType:R});br(O)};L===Ye.MACRO?I():i===Ye.MACRO?C(L):M(L)},S=h?"#F48272":"#FFFFFF99",y=a.useCallback(()=>{Fa(e)},[Fa]),g=()=>{x.current?w(t):(w(null),window.removeEventListener("mouseup",g))},j=P=>(x.current=!0,P.buttons===0&&(w(t),window.addEventListener("mouseup",g)),f(!0)),N=P=>(x.current=!1,p===t&&P.buttons===0&&w(null),f(!1));return n.jsxs("tr",{className:"group text-sm text-left",onMouseEnter:j,onMouseLeave:N,style:{color:S,background:h||d?"#00000029":"transparent"},children:[n.jsx("td",{className:"rounded-l p-[0.7vw] cursor-pointer",children:n.jsx(ql,{options:c,value:s!=null?s:i,setter:b})}),n.jsx("td",{className:"p-[0.7vw] cursor-pointer",onClick:v,children:Rs(l)}),n.jsx("td",{className:"p-[0.7vw] cursor-pointer",onClick:m,children:n.jsx("div",{className:"flex justify-center items-center",children:n.jsx(ie,{type:r?X.ArrowLeftRight:o<0?X.ArrowLeftLong:X.ArrowRightLong,size:18,color:S})})}),n.jsx("td",{className:"p-[0.7vw] flex justify-center",children:n.jsx(n2,{mod:e,textColor:S})}),n.jsx("td",{className:"cursor-pointer rounded-r",onClick:y,children:n.jsx("div",{className:"h-full w-full flex items-center justify-center opacity-0 group-hover:opacity-100",children:n.jsx(ie,{type:X.Delete})})})]})}),o2=()=>{const{selectedModulationName:e,isMacro:t,modType:r}=H(h=>{const f=h.selectedModulation.lfoType,p=f===be.LFO1?"LFO 1":f===be.LFO2?"LFO 2":f===be.LFO3?"LFO 3":f===be.ENV?"Env":"Macro";return{selectedModulationName:p,modType:f,isMacro:p==="Macro"}}),o=Fc().map(h=>h.paramId),s=T(h=>{const f=Wt(),p=f.nodes.map(b=>b.type).filter(b=>b!=="start"&&b!=="branch"&&b!=="join"&&b!=="end"),w=o,x=Es(f),m=(t?h.macros:h.modulations.filter(b=>b.lfoType===r)).map(b=>b.paramId);return[...w.filter(b=>{let S=!1;for(const y of p)b.includes(y)&&(S=!0);for(const y of x)b.includes(y)&&(S=!0);return S}).sort(),"mix"].filter(b=>!m.includes(b)).map(b=>{var y,g;const S=ze()[b];return{id:b,name:(y=S==null?void 0:S.name)!=null?y:b,isModulatable:(g=S==null?void 0:S.isModulatable)!=null?g:!0}}).filter(b=>b.isModulatable)}),i=H(h=>h.selectModulation),[l,c]=a.useState(""),u=a.useMemo(()=>s.filter(h=>h.id.includes(l)),[s,l]),d=()=>{i(null)};return n.jsxs("div",{className:"w-full h-full p-6 flex flex-col rounded-l justify-between h-full max-h-full",style:{gap:"4px"},children:[n.jsxs("div",{className:"w-full flex mb-[2px]",children:[n.jsxs(Vr,{children:[e," Target"]}),n.jsx("div",{className:"cursor-pointer ml-auto",onClick:d,children:n.jsx(ie,{type:X.Close})})]}),n.jsx(a2,{filter:l,setFilter:c}),n.jsx("div",{className:"grow overflow-y-scroll",children:n.jsx("div",{children:u.map((h,f)=>n.jsx(s2,{param:h},f))})})]})},s2=({param:e})=>{const{name:t}=e,r=H(c=>c.selectedModulation),o=H(c=>{var u;return(u=c.selectedModulation)!=null&&u.lfoType?Ye.LFO:Ye.MACRO}),s=H(c=>c.selectModulation),i=T(c=>{let u;return o===Ye.MACRO?u=c.macros.findIndex(d=>d.paramId===(r==null?void 0:r.paramId)):u=c.modulations.findIndex(d=>d.paramId===(r==null?void 0:r.paramId)),u}),l=()=>{if(i===-1)return;const c=Fe.getState(),u=JSON.parse(JSON.stringify(c.modulations)),d=JSON.parse(JSON.stringify(c.macros));o===Ye.LFO?(u[i].paramId=e.id,Le({modulations:u},!0)):o===Ye.MACRO&&(d[i].paramId=e.id,Le({macros:d},!0)),s(null)};return n.jsx("div",{className:"p-[0.7vw] text-[#FFFFFF99] text-sm hover:text-[#F48272] cursor-pointer text-left bg-transparent hover:bg-[#ffffff30] rounded",onClick:l,children:Rs(t)})},a2=({filter:e,setFilter:t})=>{const r=Wt(),o=a.useMemo(()=>{const s=Es(r);return[...r.nodes.map(l=>l.type).filter(l=>l!=="start"&&l!=="branch"&&l!=="join"&&l!=="end"),...s]},[r.nodes]);return n.jsx("div",{className:"flex flex-row flex-wrap justify-left pb-[0.55vw]",style:{gap:"4px"},children:o.map(s=>{const i=e===s,l=()=>{t(e===s?"":s)};return n.jsx("div",{className:"text-sm cursor-pointer rounded py-[3px] px-[0.5vw]",style:{background:i?fe.lunaCoral:"#00000029",color:i?fe.lunaDark:fe.lunaLight},onClick:l,children:Rs(s)})})})},i2=()=>{const e=T(d=>d.modulations),t=T(d=>d.macros),r=[...e,...t].sort((d,h)=>d.paramId.localeCompare(h.paramId)),o=H(d=>d.selectMainView),s=H(d=>d.selectedModulation!==null),i=H(d=>d.selectModulation),l=()=>{du()},c=()=>{o(null)},u=()=>{i(null)};return n.jsx("div",{className:"flex items-center h-full relative justify-center",children:n.jsxs(Dt,{className:`h-[80%] flex relative ${s?"w-[100%]":"w-[70%]"} transition-all duration-300 ease-in-out`,children:[n.jsxs("div",{className:"p-6 pr-0",style:{width:s?"70%":"100%"},onClick:u,children:[n.jsxs("div",{className:"w-full mb-[2.1vw] flex items-center justify-between pr-6",children:[n.jsx(Vr,{children:"Modulator"}),!s&&n.jsx(ie,{type:X.Close,onClick:c})]}),n.jsx("div",{className:"overflow-y-auto overflow-x-hidden h-[88%]",children:n.jsxs("table",{className:"w-full border-separate table-fixed",style:{borderSpacing:0},children:[n.jsxs("colgroup",{children:[n.jsx("col",{width:"20%"}),n.jsx("col",{width:"45%"}),n.jsx("col",{width:"15%"}),n.jsx("col",{width:"10%"}),n.jsx("col",{width:"10%"})]}),n.jsxs("tbody",{children:[n.jsxs("tr",{className:"items-center h-full text-[1vw] text-[#FFFFFF80] text-left p-[0.7vw]",style:{borderBottom:"1px solid #FFFFFF0D",padding:"8px 12px"},children:[n.jsx("th",{className:"p-[0.7vw]",children:"SOURCE"}),n.jsx("th",{className:"p-[0.7vw]",children:"TARGET"}),n.jsx("th",{className:"p-[0.7vw] text-center",children:"POLARITY"}),n.jsx("th",{className:"p-[0.7vw] text-center",children:"AMT"}),n.jsx("th",{className:"flex items-center justify-center h-full p-[0.7vw] pb-[0.5vw] cursor-pointer",onClick:l,children:n.jsx(ie,{type:X.Trash})})]}),r.map((d,h)=>n.jsx(r2,{mod:d},h))]})]})})]}),n.jsx("div",{className:"relative grow transition-all duration-300 ease-in-out bg-[#00000029] max-w-[30%]",children:n.jsx("div",{style:{opacity:s?1:0},className:"transition-opacity delay-150 duration-200 ease-in-out h-full",children:s&&n.jsx(o2,{})})})]})})},l2=()=>{switch(H(t=>t.selectedMainView)){case ee.lfoBrowser:return n.jsx(qm,{});case ee.lfoEditor:return n.jsx(e2,{});case ee.IRBrowserA:return n.jsx(as,{type:A.convA});case ee.IRBrowserB:return n.jsx(as,{type:A.convB});case ee.IRBrowserC:return n.jsx(as,{type:A.convC});case ee.FilterPresetA:return n.jsx(Nt,{type:A.filterA});case ee.FilterPresetB:return n.jsx(Nt,{type:A.filterB});case ee.FilterPresetC:return n.jsx(Nt,{type:A.filterC});case ee.FilterPresetD:return n.jsx(Nt,{type:A.filterD});case ee.GrainPresetA:return n.jsx(Nt,{type:A.grainA});case ee.GrainPresetB:return n.jsx(Nt,{type:A.grainB});case ee.GrainPresetC:return n.jsx(Nt,{type:A.grainC});case ee.TimePresetA:return n.jsx(Nt,{type:A.timeA});case ee.TimePresetB:return n.jsx(Nt,{type:A.timeB});case ee.TimePresetC:return n.jsx(Nt,{type:A.timeC});case ee.VoltPresetA:return n.jsx(Nt,{type:A.voltA});case ee.VoltPresetB:return n.jsx(Nt,{type:A.voltB});case ee.VoltPresetC:return n.jsx(Nt,{type:A.voltC});case ee.HazePresetA:return n.jsx(Nt,{type:A.chorusA});case ee.HazePresetB:return n.jsx(Nt,{type:A.chorusB});case ee.HazePresetC:return n.jsx(Nt,{type:A.chorusC});case ee.Mappings:return n.jsx(i2,{})}return null};function c2(){console.log("render main layout");const e=H(c=>c.selectedMainView),t=H(c=>c.selectedNodeId),r=T(c=>c.isIndividualNode()),o=T(c=>c.resizeFactor()),s=T(c=>{var u;return(u=c.nodes.find(d=>d.id===t))==null?void 0:u.type}),i=s===A.timeA||s===A.timeB||s===A.timeC,l=`${(i?19:16)*o}vw`;return n.jsxs("div",{className:"flex flex-col g-1 relative",style:{width:r?"100%":"80%"},children:[(e===ee.Settings||e===ee.Account)&&n.jsx("div",{className:"flex items-center justify-center h-full w-full absolute",children:n.jsx(Bm,{})}),e===ee.presetBrowser&&n.jsx("div",{className:"absolute left-0 top-0 w-full h-[85%]",children:n.jsx(Jp,{})}),n.jsx("div",{className:"overflow-hidden transition-height duration-300 ease-in-out relative",style:{height:i?"65%":"70%"},children:n.jsx(l2,{})}),e!==ee.presetBrowser&&n.jsx("div",{className:"flex justify-center items-end transition-height duration-300 ease-in-out",style:{height:l},children:n.jsx(Wp,{})})]})}const u2=()=>n.jsx("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 676.516 155.839",children:n.jsx("path",{fill:"#FFFFFF",d:`M43.513,116.669h61.184v15.856H21.153V16.661h17.075v94.52L43.513,116.669z M192.435,89.025V16.661
h17.074v74.6c0,26.628-20.53,44.11-46.142,44.11s-46.142-17.482-46.142-44.11v-74.6H134.3v72.364
c0,18.497,12.603,30.287,29.067,30.287S192.435,107.522,192.435,89.025z M300.792,132.524l-51.63-89.642h-5.285v89.642h-16.058
V16.661h23.579l47.769,83.747h5.285V16.661h16.058v115.863H300.792z M418.369,98.579h-51.02l-12.807,33.946h-18.294l45.939-115.863
h21.75l45.736,115.863h-18.498L418.369,98.579z M408.003,83.739l3.456-3.454l-15.856-41.671h-5.489L374.26,80.487l3.252,3.252
H408.003z M504.229,118.499c14.026,0,23.173-8.538,31.71-22.36l14.026,10.773c-10.978,18.701-24.8,28.458-45.532,28.458
c-30.491,0-53.461-25.207-53.461-60.779s22.969-60.777,53.461-60.777c20.732,0,34.555,9.758,45.532,28.458l-14.026,10.773
c-8.536-13.822-17.683-22.563-31.71-22.563c-23.376,0-35.368,19.716-35.368,44.108C468.861,98.781,480.853,118.499,504.229,118.499z
M617.092,132.524h-17.278V85.163l-47.565-68.502h20.53l32.523,46.346h6.505l32.32-46.346h20.53l-47.564,68.502V132.524z`})}),d2=()=>{const e=lt(),{isLoading:t,loggingOut:r,email:o,password:s,error:i,checkingBeatport:l,message:c,clearMessage:u,token:d}=e,h=T(y=>y.pluginName),f=T(y=>y.pluginName===oe.BEAM),[p,w]=a.useState(!1),x=y=>lt.setState({email:y.target.value.replace(/\s+/g,"")}),m=y=>de(void 0,null,function*(){y.preventDefault(),yield e.login(o,s)}),v=()=>de(void 0,null,function*(){lt.setState({checkingBeatport:!0});const y=yield Wi();y&&y.isBeatport?lt.setState({checkingBeatport:!1,error:"",user:y,isLoading:!1}):lt.setState({error:y.error,checkingBeatport:!1,isLoading:!1})}),b=y=>de(void 0,null,function*(){y.preventDefault(),Kt("https://lunacy.audio/account/lost-password/")}),S=a.useCallback(()=>w(!p),[p]);return a.useEffect(()=>{c!==""&&setTimeout(()=>{u()},2e3)},[c]),n.jsx("div",{className:"flex items-center justify-center pointer-events-auto absolute h-full w-full top-0 left-0 backdrop-blur-xs",style:{background:"#00000052"},children:c===""?n.jsx("div",{className:"flex flex-col items-center justify-center h-[80%] w-[70%] pt-[5%]",style:{background:"linear-gradient(90deg, rgba(21,23,27,1) 0%, rgba(22,24,28,1) 13%, rgba(27,29,36,1) 100%)",border:"1px solid #FFFFFF1F"},children:n.jsxs("div",{className:"flex relative gap-[3vw] justify-center flex-col",children:[n.jsxs("div",{className:"flex flex-col items-center justify-around",children:[n.jsx("div",{className:"w-[9.5vw] mb-[2.5vw]",children:n.jsx(u2,{})}),n.jsx("div",{className:"font-medium text-[#FFFFFF99] text-xl",children:"Welcome to"}),n.jsx("div",{className:"font-bold text-[#FFFFFFE5] text-6xl",style:{letterSpacing:"0.5vw"},children:h.toUpperCase()})]}),n.jsxs("div",{className:"flex gap-[1vw] items-center h-full justify-between flex-col",children:[n.jsxs("div",{className:"flex flex-col gap-[0.5vw]",children:[n.jsx(Mo,{required:!0,disabled:t,type:"text",value:o,onChange:x,placeholder:"Email",iconLeft:n.jsx(ie,{type:X.Email}),enablePaste:!0,style:{height:"2.9vw"},width:"24vw"}),n.jsx(Mo,{required:!0,disabled:t,type:p?"text":"password",value:s,onChange:y=>lt.setState({password:y.target.value}),placeholder:"Password",iconLeft:n.jsx(ie,{type:X.Key}),iconRight:n.jsx(ie,{type:X.Eye}),enablePaste:!0,onRightIconClick:S,style:{height:"2.9vw"},width:"24vw"}),n.jsx("button",{className:"flex items-center justify-center bg-[#0000004D] hover:text-white w-[24vw] h-[2.8vw] rounded text-[#FFFFFF99] text-sm",disabled:t||r,type:"submit",style:{border:"1px solid #FFFFFF26"},onClick:m,children:t?n.jsx(rr,{}):"Log In"})]}),n.jsxs("div",{className:"flex flex-col gap-[0.5vw] relative",children:[d&&i&&n.jsx("button",{className:"flex items-center justify-center bg-[#0000004D] hover:text-white w-[24vw] h-[2.8vw] rounded text-[#FFFFFF99] text-sm",disabled:t||r,type:"submit",onClick:y=>de(void 0,null,function*(){y.preventDefault(),yield e.fetchUser()}),children:t?n.jsx(rr,{}):"Recheck Credentials"}),f&&n.jsx("button",{className:"flex items-center justify-center bg-[#0000004D] hover:text-white w-[24vw] h-[2.8vw] rounded text-[#FFFFFF99] text-sm",style:{border:"1px solid #FFFFFF26"},disabled:l,onClick:v,children:n.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[n.jsx("img",{src:"beatport_logo.png",style:{height:20,position:"relative",left:-20}}),l?"Validating License...":"Check Beatport Access"]})}),n.jsx("button",{className:"bg-transparent hover:text-white w-[24vw] h-[2.8vw] rounded text-[#FFFFFF99] text-sm",disabled:t||r,onClick:b,style:{border:"1px solid #FFFFFF26",pointerEvents:t||r?"none":"auto"},children:"Forgot Password?"}),n.jsx("div",{className:"text-sm text-red h-[6vw] w-[24vw] flex flex-col justify-center",style:{color:fe.lunaError},children:i})]})]})]})}):n.jsx("div",{className:"text-white",children:c})})},f2=()=>{const[e,t]=a.useState(!1),[,r]=gi(()=>({type:vt.MACRO,item:{type:vt.MACRO},collect:l=>({isDragging:!!l.isDragging()})})),o=a.useCallback((l,c)=>ut(l,c),[]),s=a.useCallback(l=>()=>{t(l)},[]),i=n.jsx("div",{className:"cursor-pointer",ref:r,children:n.jsx(ie,{type:X.Move})});return n.jsx("div",{className:"pointer-events-auto",onMouseEnter:s(!0),onMouseLeave:s(!1),children:n.jsx(Be,{paramId:"macro",compact:!0,afterLabel:e?i:n.jsx(n.Fragment,{}),setter:o,isMacro:!0})})};function hi(){return navigator.platform.indexOf("Win")>-1}const m2=({onChange:e,value:t,disabled:r=!1,style:o={}})=>{const s=a.useRef(null);return a.useEffect(()=>{if(s){s.current.style.height="0px";const i=s.current.scrollHeight;s.current.style.height=i+"px"}},[s,t]),n.jsx("textarea",{className:"text-sm rounded-md luna-background-secondary outline-none w-full resize-none p-[0.5vw]",value:t,onChange:e,ref:s,rows:1,disabled:r,style:k({color:fe.lunaTextSecondary},o),autoCorrect:"off"})},p2=({children:e,open:t,height:r="300px",width:o="400px",position:s={},style:i={},onClose:l,iconClose:c=!0,title:u})=>{const d=t?"block":"hidden";return n.jsxs(n.Fragment,{children:[n.jsx("div",{className:`fixed left-0 top-0 h-full w-full z-10 backdrop-blur-xs bg-[#00000066] ${d}`}),n.jsx("div",{className:`pointer-events-auto absolute z-999 flex h-full w-full items-center justify-center top-0 left-0 z-20 ${d}`,onMouseDown:h=>{h.stopPropagation(),l()},children:n.jsxs("div",{className:"luna-background flex flex-col rounded-lg overflow-x-hidden pt-[0.5vw] overflow-y-auto",style:k(k({height:r,width:o,border:"1px solid #FFFFFF1F"},s),i),onMouseDown:h=>h.stopPropagation(),children:[n.jsxs("div",{className:"flex w-full h-[3vw] items-center",children:[u&&n.jsx("div",{className:"text-white font-medium text-lg text-left h-full mt-[1vw] pl-4",style:{width:o,height:r},children:u}),c&&n.jsx("button",{className:"ml-auto mr-[1vw] p-[2px]",onClick:l,children:n.jsx(ie,{type:X.Close})})]}),n.jsx("div",{className:"w-full h-full",children:e})]})})]})},On=a.memo(p2),h2=()=>{const{getFile:e,hasFile:t}=pn(),r=H($=>$.closeSavePresetModal),o=T($=>$.activePresetPath),s=e(o),i=(s==null?void 0:s.factory)||!s,l=s==null?void 0:s.author,c=s==null?void 0:s.description,u=nt(o).replace(".preset",""),d=s==null?void 0:s.tags,[h,f]=a.useState(u),[p,w]=a.useState(l||""),[x,m]=a.useState(c||""),[v,b]=a.useState(s!=null&&s.productId?s==null?void 0:s.productId:0),[S,y]=a.useState(d||[]),[g,j]=a.useState(!1),[N,P]=a.useState(""),L=()=>{let $=ir(o).slice(0,-1);return g?$[1]="Lunacy":$[1]="User",(i&&!g||!i&&g)&&$.length===3&&$.pop(),$},[I,C]=a.useState([]);a.useEffect(()=>{C(L())},[o,g,i]);const M=t(Nr(I.concat(h+".preset"))),R=()=>{r()},O=()=>de(void 0,null,function*(){const $=Ms(h);if($.length===0)return;let V=Nr(I.concat($+".preset"));console.log("Saving preset relativePath",V),(yield au({name:$,author:p,description:x,tags:S,factory:g,path:V,productId:v}))?r():P("error saving preset at path: "+V)}),_=Object.values(mo);_.splice(_.indexOf(mo.LunacyPicks));const z=Object.values(po);z.splice(z.indexOf(po.All),1);const U=a.useCallback($=>()=>{S.includes($)?y(S.filter(V=>V!==$)):y([...S,$])},[S]);return a.useCallback(()=>{j(!g)},[]),n.jsx(On,{open:!0,onClose:r,height:"75%",width:"32%",title:"Save Preset",children:n.jsxs("div",{className:"w-full h-full flex flex-col justify-center px-[1.4vw]",style:{color:fe.lunaWhite},children:[n.jsxs("div",{className:"relative",children:[n.jsx(vr,{title:"Preset Name",children:n.jsx("input",{className:"luna-background-secondary outline-none rounded-md text-sm p-[0.5vw] w-full",value:h,onChange:$=>f($.target.value),style:{color:fe.lunaTextSecondary},autoCorrect:"off"})}),n.jsx(vr,{title:"Author",children:n.jsx("input",{className:"luna-background-secondary outline-none rounded-md text-sm p-[0.5vw] w-full",value:p,onChange:$=>w($.target.value),style:{color:fe.lunaTextSecondary},autoCorrect:"off"})}),n.jsx(vr,{title:"Description",children:n.jsx(m2,{value:x,onChange:$=>m($.target.value),style:{minHeight:"95px",maxHeight:"95px"}})}),!Vt,!Vt,n.jsx(vr,{title:"Character",children:n.jsx("div",{className:"grid grid-cols-3 gap-y-2 gap-x-2 self-center mb-[0.9vw] w-full",children:_.map($=>n.jsx(hn,{label:$,selected:S.includes($),onClick:U($),style:{fontSize:"11px"}}))})}),n.jsx(vr,{title:"Category",children:n.jsx("div",{className:"grid grid-cols-3 gap-y-2 gap-x-2 self-center w-full",children:z.map($=>n.jsx(hn,{label:$,selected:S.includes($),onClick:U($),style:{fontSize:"11px"}}))})})]}),n.jsxs("div",{className:"mt-auto flex flex-col",children:[N&&n.jsx("div",{className:"my-[0.7vw]",style:{color:fe.lunaError},children:N}),n.jsxs("div",{className:"flex flex-row items-center justify-center w-full mt-auto mb-[0.9vw]",children:[n.jsx(Et,{label:"Cancel",style:{marginRight:"10px",width:"180px"},onClick:R}),n.jsx(Et,{label:M?"Overwrite":"Save",onClick:O,style:{width:"180px"}})]})]})]})})},vr=({title:e,children:t})=>n.jsxs("div",{className:"flex py-1",children:[n.jsxs("div",{className:"w-[30%] flex justify-end items-center pr-2",children:[e,":"]}),n.jsx("div",{className:"w-[70%]",children:t})]}),v2=()=>{const e=T(g=>g.isIndividualNode()?"text-lg":"text-sm"),t=H(g=>g.selectedNodeId),r=T(g=>{var N;if(g.isIndividualNode())switch(g.pluginName){case oe.Grains:return A.grainA;case oe.Space:return A.convA;case oe.Time:return A.timeA;case oe.Filter:return A.filterA;case oe.Volt:return A.voltA;case oe.Haze:return A.chorusA}return(N=g.nodes.find(P=>P.id===t))==null?void 0:N.type}),o=H(g=>{switch(r){case A.filterA:return g.filterASelectedPreset;case A.filterB:return g.filterBSelectedPreset;case A.filterC:return g.filterCSelectedPreset;case A.filterD:return g.filterDSelectedPreset;case A.grainA:return g.grainASelectedPreset;case A.grainB:return g.grainBSelectedPreset;case A.grainC:return g.grainCSelectedPreset;case A.timeA:return g.timeASelectedPreset;case A.timeB:return g.timeBSelectedPreset;case A.timeC:return g.timeCSelectedPreset;case A.voltA:return g.voltASelectedPreset;case A.voltB:return g.voltBSelectedPreset;case A.voltC:return g.voltCSelectedPreset;case A.chorusA:return g.hazeASelectedPreset;case A.chorusB:return g.hazeBSelectedPreset;case A.chorusC:return g.hazeCSelectedPreset}}),s=H(g=>g.closeSaveNodePresetModal),l=yr(g=>g.getFilesInStore(g.nodePresetStore)).find(g=>g.path===o),c=l==null?void 0:l.author,u=o?nt(o).replace(".nodepreset",""):"",[d,h]=a.useState(u),[f,p]=a.useState(c||""),[w,x]=a.useState(!1),[m,v]=a.useState(""),b=()=>{if(l===void 0)return[];let g=ir(l.path).slice(0,-1);return w?g[2]="Lunacy":g[2]="User",(l!=null&&l.factory&&!w||!(l!=null&&l.factory)&&w)&&g.length===4&&g.pop(),g},S=()=>{s()},y=()=>de(void 0,null,function*(){const g=Ms(d);if(g.length===0)return;iu({name:g,author:f,nodeType:r,factory:w})?s():v("error saving node preset at path: "+Nr(b().concat(g+".nodepreset")))});return a.useCallback(()=>{x(!w)},[w]),n.jsxs("div",{className:"w-full h-full flex flex-col justify-center px-[1vw]",style:{color:fe.lunaWhite},children:[n.jsxs("div",{className:"flex w-full h-[75%] mb-[1vw] mt-[1vw]",children:[n.jsxs("div",{className:`flex flex-col ${e} mr-[1vw]`,style:{width:"clamp(30%, 10vw, 100%)"},children:[n.jsx("div",{className:"flex items-center ml-auto mb-[1vw] py-[0.6vw] truncate",children:"Preset Name:"}),n.jsx("div",{className:"flex items-center ml-auto mb-[1vw] py-[0.6vw]",children:"Author:"}),!Vt]}),n.jsxs("div",{className:"flex flex-col w-[62%]",children:[n.jsx("input",{className:`luna-background-secondary outline-none rounded-md ${e} mb-[1vw] p-[0.6vw]`,value:d,onChange:g=>h(g.target.value),style:{color:fe.lunaTextSecondary},autoCorrect:"off"}),n.jsx("input",{className:`luna-background-secondary outline-none rounded-md ${e} mb-[1vw] p-[0.6vw]`,value:f,onChange:g=>p(g.target.value),style:{color:fe.lunaTextSecondary},autoCorrect:"off"}),!Vt]})]}),n.jsxs("div",{className:"mt-auto flex flex-col",children:[m&&n.jsx("div",{className:"my-[0.8vw]",style:{color:fe.lunaError},children:m}),n.jsxs("div",{className:"flex flex-row gap-3 items-center justify-center w-full mt-auto mb-[1vw]",children:[n.jsx(Et,{label:"Cancel",style:{width:"18vw"},onClick:S}),n.jsx(Et,{label:"Save",style:{width:"18vw"},onClick:y})]})]})]})},x2=()=>{const e=H(o=>o.selectedNodeId),t=T(o=>{var i;if(o.isIndividualNode)return o.pluginName;const s=(i=o.nodes.find(l=>l.id===e))==null?void 0:i.type;return s.startsWith("grain")?oe.Grains:s.startsWith("time")?oe.Time:s.startsWith("filter")?oe.Filter:s.startsWith("chorus")?oe.Haze:oe.Volt}),r=H(o=>o.closeSaveNodePresetModal);return n.jsx(On,{open:!0,onClose:r,style:{height:"fit-content"},title:"Save "+t+" Preset",width:"40%",children:n.jsx(v2,{})})},g2=()=>{const e=H(y=>y.selectedNodeId),t=H(y=>y.closeSaveIRModal),r=T(y=>{const g=y.isIndividualNode()?y.nodes.find(N=>N.type!=="start"&&N.type!=="end"):y.nodes.find(N=>N.id===e);return`${g==null?void 0:g.type}Ir`}),o=T(a.useCallback(y=>y[r],[r])),{getFile:s}=rn(),i=s(o),l=i==null?void 0:i.author,c=nt(o).replace(".impulse",""),[u,d]=a.useState(c),[h,f]=a.useState(l||""),[p,w]=a.useState(!1),m=T(y=>y.isIndividualNode())?"text-lg":"text-sm",v=()=>{t()},b=a.useCallback(()=>{w(!p)},[p]),S=()=>de(void 0,null,function*(){const y=Ms(u);y.length!==0&&(Iu(r,o,y,h,p),t())});return n.jsx(On,{open:!0,onClose:t,style:{height:"fit-content"},title:"Save Impulse Response",children:n.jsxs("div",{className:"w-full h-full flex flex-col justify-center px-[1.4vw]",style:{color:fe.lunaWhite},children:[n.jsxs("div",{className:"flex w-full h-[75%] mb-[0.9vw] mt-[0.9vw]",children:[n.jsxs("div",{className:`flex flex-col ${m} mr-[0.9vw] w-[30%]`,children:[n.jsx("div",{className:"flex items-center ml-auto mb-[0.9vw] py-[0.5vw]",children:"IR Name:"}),n.jsx("div",{className:"flex items-center ml-auto mb-[0.9vw] py-[0.5vw]",children:"Author:"}),!Vt]}),n.jsxs("div",{className:"flex flex-col w-[70%]",children:[n.jsx("input",{className:`luna-background-secondary outline-none rounded-md ${m} mb-[0.9vw] p-[0.5vw]`,value:u,onChange:y=>d(y.target.value),style:{color:fe.lunaTextSecondary},autoCorrect:"off"}),n.jsx("input",{className:`luna-background-secondary outline-none rounded-md ${m} mb-[0.9vw] p-[0.5vw]`,value:h,onChange:y=>f(y.target.value),style:{color:fe.lunaTextSecondary},autoCorrect:"off"}),n.jsx("div",{className:"flex w-full h-full items-center justify-center mb-[0.9vw]",children:n.jsx(hn,{label:"factory",selected:p,onClick:b,style:{fontSize:"11px",width:"100%"}})})]})]}),n.jsxs("div",{className:"flex flex-row items-center justify-center w-full mt-auto mb-[0.9vw]",children:[n.jsx(Et,{label:"Cancel",style:{marginRight:"10px",width:"180px"},onClick:v}),n.jsx(Et,{label:"Save",onClick:S,style:{width:"180px"}})]})]})})},w2="https://lunacy.audio/downloads",y2=`https://lunacy.audio/changelogs/${In}/Changelog.md`,b2="lunacy_download_link",S2=()=>{const e=fs(s=>{const i=s.products[0];return i&&i.meta_data.find(l=>l.key===b2).value}),t=()=>{lt.setState({showUpdateModal:!1})},r=()=>{Kt(e||w2)},o=()=>{Kt(y2)};return n.jsx(On,{open:!0,onClose:t,style:{height:"fit-content"},width:"420px",children:n.jsxs("div",{className:"flex flex-col mt-[-1.8vw] p-4",children:[n.jsx("div",{className:"text-white font-medium text-lg w-full text-center mb-[1vw]",children:"New Update Available!"}),n.jsx("button",{onClick:o,className:"mb-[1vw]",style:{textDecoration:"underline",color:fe.lunaPurple},children:"View Changelog"}),n.jsxs("div",{className:"flex flex-row items-center justify-center w-full mt-auto mb-[1vw]",children:[n.jsx(Et,{label:"Cancel",style:{marginRight:"10px",width:"180px"},onClick:t}),n.jsx(Et,{label:"Update",onClick:r,style:{width:"180px"}})]})]})})},C2=()=>{const e=H(o=>o.errorModalText),t=H(o=>o.setShowErrorModal),r=a.useCallback(()=>t(!1),[t]);return n.jsx(On,{open:!0,onClose:r,style:{height:"fit-content",width:"35%"},children:n.jsxs("div",{className:"flex flex-col mt-[-1.8vw] px-4",children:[n.jsx("div",{className:"text-lg font-bold mb-[2%]",style:{color:fe.lunaError},children:"Error"}),n.jsx("div",{className:"text-white font-medium text-sm w-full text-center mb-[5%]",children:e}),n.jsx("div",{className:"flex flex-row items-center justify-center w-full mt-auto mb-[5%]",children:n.jsx(Et,{label:"OK",style:{width:"50%"},onClick:r})})]})})},N2=()=>{const e=H(s=>s.warnBeforeModalText),t=H(s=>s.closeWarnBeforeModal),r=H(s=>s.warnBeforeModalAction),o=a.useCallback(()=>t(),[t]);return n.jsx(On,{open:!0,onClose:o,style:{height:"fit-content",width:"35%"},children:n.jsxs("div",{className:"flex flex-col mt-[-1.8vw] px-4",children:[n.jsx("div",{className:"text-lg font-bold mb-[2%]",style:{color:fe.lunaError},children:"Would you like to continue?"}),n.jsx("div",{className:"text-white font-medium text-sm w-full text-center mb-[5%]",children:e}),n.jsxs("div",{className:"flex flex-row items-center justify-center w-full mt-auto mb-[5%]",children:[n.jsx(Et,{label:"Cancel",style:{width:"50%"},onClick:o}),n.jsx(Et,{label:"Continue",style:{width:"50%"},onClick:()=>{r==null||r(),o()}})]})]})})},M2=()=>{const e=T(o=>o.pluginName===oe.BEAM||o.pluginName===oe.Space),t=H(o=>o.selectMainView),r=a.useCallback(()=>{t(null)},[t]);return n.jsx(On,{open:!0,onClose:r,width:"50%",height:"60%",children:n.jsxs("div",{className:"flex flex-col items-center px-5 text-center text-white pb-[3vw]",children:[n.jsx("div",{className:"text-lg font-bold mb-[2%]",children:"Credits"}),n.jsx("div",{className:"text-sm font-bold",children:"Plugin Concept by"}),n.jsxs("div",{className:"text-sm",children:["Casey Kolb",n.jsx("br",{}),"Max Davidoff-Grey",n.jsx("br",{})," Brandon Montell"]}),n.jsx("br",{}),n.jsx("div",{className:"text-sm font-bold",children:"Development by"}),n.jsxs("div",{className:"text-sm",children:["Brandon Montell",n.jsx("br",{}),"Can Ince",n.jsx("br",{}),"Nathan Blair",n.jsx("br",{}),"Jack Kilgore",n.jsx("br",{}),"Mena Sachdev",n.jsx("br",{}),"Pau Roselló",n.jsx("br",{}),"Nick Thompson",n.jsx("br",{}),"Marc Langer"]}),n.jsx("br",{}),n.jsx("div",{className:"text-sm font-bold",children:"Interface Design by"}),n.jsx("div",{className:"text-sm",children:"Resonant Design"}),n.jsx("br",{}),n.jsx("div",{className:"text-sm font-bold",children:"WebGL Concepts by"}),n.jsxs("div",{className:"text-sm",children:["Brandon Montell",n.jsx("br",{}),"Alejandro Robledo"]}),n.jsx("br",{}),e&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"text-sm font-bold",children:"Impulse Responses by"}),n.jsxs("div",{className:"text-sm",children:["Venus Theory",n.jsx("br",{}),"Benn Jordan",n.jsx("br",{}),"The Synth Factory"]}),n.jsx("br",{})]}),n.jsx("div",{className:"text-sm font-bold",children:"With Additional Support from"}),n.jsx("div",{className:"text-sm",children:"Bryan Winslow"}),n.jsx("br",{}),n.jsx("div",{className:"text-sm font-bold",children:"Built with Elementary Audio and JUCE"})]})})},j2=()=>{const e=H(d=>d.showSavePresetModal),t=H(d=>d.showSaveNodePresetModal),r=H(d=>d.showSaveIRModal),o=H(d=>d.showErrorModal),s=H(d=>d.showWarnBeforeModal),i=H(d=>d.selectedMainView),{checkUpdates:l}=mt.getState(),{showUpdateModal:c}=lt(),u=i===ee.Credits;return n.jsxs("div",{className:"absolute h-full w-full z-50",children:[e&&n.jsx(h2,{}),t&&n.jsx(x2,{}),r&&n.jsx(g2,{}),o&&n.jsx(C2,{}),s&&n.jsx(N2,{}),l&&c&&n.jsx(S2,{}),u&&n.jsx(M2,{})]})};function F2(){console.log("render app");const e=Mn(N=>N.undo),t=Mn(N=>N.redo),{user:r,credentialsLoading:o,error:s}=lt();s&&console.log("[App.tsx]: error",s);const i=H(N=>N.selectMainView),l=H(N=>N.selectStream),c=H(N=>N.closeDropdowns),u=H(N=>N.selectLFO),d=H(N=>N.clearSelection),h=H(N=>N.selectParamId),f=lt(N=>N.ownsPlugin()),p=T(N=>N.isFreeNode()),w=T(N=>N.isIndividualNode()),x=a.useCallback(N=>{N.preventDefault()},[Vt]),m=a.useCallback(()=>{const{selectedMainView:N,selectedLFO:P}=H.getState();N&&i(null),P&&u(null),c()},[i,u,c]),v=a.useCallback(()=>{const{selectedMainView:N}=H.getState();N||l(Qe.all)},[l]),b=N=>N.target.tagName==="INPUT"||N.target.tagName==="TEXTAREA"||!N.altKey&&((N.metaKey||N.ctrlKey)&&N.shiftKey&&N.key.toLowerCase()==="z"||!N.shiftKey&&(N.key==="Escape"||N.key==="Backspace"||N.key==="Delete"||(N.metaKey||N.ctrlKey)&&N.key.toLowerCase()==="z"||(N.metaKey||N.ctrlKey)&&N.key.toLowerCase()==="a")),S=a.useCallback(N=>{if(!(N.repeat||N.defaultPrevented)){if(!b(N)){hi()&&(N.preventDefault(),xa(N.keyCode,!0));return}if(N.target.tagName==="INPUT"||N.target.tagName==="TEXTAREA"){N.metaKey&&N.key==="x"?(N.preventDefault(),document.execCommand("cut")):N.metaKey&&N.key==="c"?(N.preventDefault(),document.execCommand("copy")):N.metaKey&&N.key==="v"?(N.preventDefault(),document.execCommand("paste")):N.metaKey&&N.key==="a"?(N.preventDefault(),document.execCommand("selectAll")):N.metaKey&&N.key==="z"?(N.preventDefault(),document.execCommand("undo")):N.metaKey&&N.shiftKey&&N.key.toLowerCase()==="z"&&(N.preventDefault(),document.execCommand("redo"));return}if(N.preventDefault(),N.key==="Escape")d(),i(null);else if(N.key==="Backspace"||N.key==="Delete"){const{selectedParamId:P,selectedNodeId:L,selectedStreamId:I,lastSelectedComponent:C}=H.getState();C===wr.param&&P!==void 0?(La(P),h(null)):C===wr.node&&L!==void 0?(ka(L),d()):C===wr.stream&&I&&(ps(I),d())}else(N.metaKey||N.ctrlKey)&&(N.key.toLowerCase()==="z"&&!N.shiftKey?e():N.shiftKey&&N.key.toLowerCase()==="z"?t():N.key.toLowerCase()==="a"&&v())}},[d,La,Ds,ka,h,ps,v]),y=N=>{b(N)||hi()&&xa(N.keyCode,!1)};a.useEffect(()=>(window.addEventListener("keydown",S),()=>{window.removeEventListener("keydown",S)}),[S]),a.useEffect(()=>(window.addEventListener("keyup",y),()=>{window.removeEventListener("keyup",y)}),[]),a.useEffect(()=>(window.addEventListener("contextmenu",x),()=>{window.removeEventListener("contextmenu",x)}),[x]);const j=!o&&(!(r&&f)||s)&&Ke&&!p;return n.jsx("div",{id:"app_root",className:"flex h-full w-full flex-col justify-center items-center text-center overflow-hidden select-none",style:{overflow:"hidden"},children:n.jsxs("div",{id:"ui-container",className:"w-full h-full",children:[n.jsxs("div",{className:`absolute top-0 bottom-0 left-0 right-0 z-50 pointer-events-none flex flex-col h-full px-2 pt-2 ${w?"pb-2":"pb-5"}`,children:[n.jsx("div",{className:"absolute h-full w-full z-50",children:j&&n.jsx(d2,{})}),n.jsx(j2,{}),n.jsx(Hm,{}),n.jsxs("div",{className:"flex flex-row w-full h-[93%] g-1 overflow-hidden",children:[!w&&n.jsx("div",{className:"flex flex-col-reverse w-[10%]",children:n.jsx("div",{className:"h-[70%] flex flex-col",children:n.jsx(mm,{})})}),n.jsx(c2,{}),!w&&n.jsx("div",{className:"flex flex-col items-center h-full w-[10%] z-0",children:n.jsx("div",{className:"mt-auto mb-[1vw]",children:n.jsx(f2,{})})})]})]}),n.jsx("div",{onClick:m,children:n.jsx(Rf,{className:"absolute w-full h-full inset-0 z-20"})})]})})}bc({dsn:"https://a5670d0c7e5f078bf85d69a28b89a5d5@o4505410068021248.ingest.sentry.io/4505663058739200",environment:"production",integrations:[Sc()],tracesSampleRate:.2,replaysSessionSampleRate:.05,replaysOnErrorSampleRate:.05});window.console.log=function(){};Cc.createRoot(document.getElementById("root")).render(n.jsx(Ns.StrictMode,{children:n.jsx(Nc,{backend:Mc,children:n.jsx(F2,{})})}));
//# sourceMappingURL=index-49cdebc0.js.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment