diff --git a/CNAME b/CNAME deleted file mode 100644 index a690715..0000000 --- a/CNAME +++ /dev/null @@ -1 +0,0 @@ -canvasbeats.com \ No newline at end of file diff --git a/assets/index-ngW5ZSdz.js b/assets/index-Ev6EW-Tf.js similarity index 98% rename from assets/index-ngW5ZSdz.js rename to assets/index-Ev6EW-Tf.js index 1a9acec..49d12a3 100644 --- a/assets/index-ngW5ZSdz.js +++ b/assets/index-Ev6EW-Tf.js @@ -37,4 +37,4 @@ `+l[i].replace(" at new "," at ");return e.displayName&&s.includes("")&&(s=s.replace("",e.displayName)),s}while(1<=i&&0<=u);break}}}finally{jl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?zn(e):""}function Qc(e){switch(e.tag){case 5:return zn(e.type);case 16:return zn("Lazy");case 13:return zn("Suspense");case 19:return zn("SuspenseList");case 0:case 2:case 15:return e=Rl(e.type,!1),e;case 11:return e=Rl(e.type.render,!1),e;case 1:return e=Rl(e.type,!0),e;default:return""}}function oo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qt:return"Fragment";case Ht:return"Portal";case no:return"Profiler";case ni:return"StrictMode";case ro:return"Suspense";case lo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case gs:return(e.displayName||"Context")+".Consumer";case ms:return(e._context.displayName||"Context")+".Provider";case ri:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case li:return t=e.displayName||null,t!==null?t:oo(e.type)||"Memo";case rt:t=e._payload,e=e._init;try{return oo(e(t))}catch{}}return null}function Kc(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return oo(t);case 8:return t===ni?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function vt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ys(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Yc(e){var t=ys(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(i){r=""+i,o.call(this,i)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(i){r=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function pr(e){e._valueTracker||(e._valueTracker=Yc(e))}function ws(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ys(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function io(e,t){var n=t.checked;return K({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Zi(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=vt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ks(e,t){t=t.checked,t!=null&&ti(e,"checked",t,!1)}function uo(e,t){ks(e,t);var n=vt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?so(e,t.type,n):t.hasOwnProperty("defaultValue")&&so(e,t.type,vt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ji(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function so(e,t,n){(t!=="number"||Vr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var jn=Array.isArray;function nn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=hr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function An(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ln={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Xc=["Webkit","ms","Moz","O"];Object.keys(Ln).forEach(function(e){Xc.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ln[t]=Ln[e]})});function Es(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ln.hasOwnProperty(e)&&Ln[e]?(""+t).trim():t+"px"}function _s(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=Es(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var Gc=K({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function fo(e,t){if(t){if(Gc[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(k(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(k(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(k(61))}if(t.style!=null&&typeof t.style!="object")throw Error(k(62))}}function po(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ho=null;function oi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mo=null,rn=null,ln=null;function eu(e){if(e=ur(e)){if(typeof mo!="function")throw Error(k(280));var t=e.stateNode;t&&(t=ml(t),mo(e.stateNode,e.type,t))}}function Ps(e){rn?ln?ln.push(e):ln=[e]:rn=e}function Ns(){if(rn){var e=rn,t=ln;if(ln=rn=null,eu(e),t)for(e=0;e>>=0,e===0?32:31-(uf(e)/sf|0)|0}var mr=64,gr=4194304;function Rn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,o=e.pingedLanes,i=n&268435455;if(i!==0){var u=i&~l;u!==0?r=Rn(u):(o&=i,o!==0&&(r=Rn(o)))}else i=n&~l,i!==0?r=Rn(i):o!==0&&(r=Rn(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,o=t&-t,l>=o||l===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function or(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Oe(t),e[t]=n}function df(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Fn),au=" ",cu=!1;function Ys(e,t){switch(e){case"keyup":return Vf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kt=!1;function Af(e,t){switch(e){case"compositionend":return Xs(t);case"keypress":return t.which!==32?null:(cu=!0,au);case"textInput":return e=t.data,e===au&&cu?null:e;default:return null}}function Wf(e,t){if(Kt)return e==="compositionend"||!pi&&Ys(e,t)?(e=Qs(),Tr=ci=ut=null,Kt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hu(n)}}function qs(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qs(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bs(){for(var e=window,t=Vr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vr(e.document)}return t}function hi(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function qf(e){var t=bs(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&qs(n.ownerDocument.documentElement,n)){if(r!==null&&hi(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,o=Math.min(r.start,l);r=r.end===void 0?o:Math.min(r.end,l),!e.extend&&o>r&&(l=r,r=o,o=l),l=mu(n,o);var i=mu(n,r);l&&i&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Yt=null,So=null,On=null,xo=!1;function gu(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xo||Yt==null||Yt!==Vr(r)||(r=Yt,"selectionStart"in r&&hi(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),On&&Xn(On,r)||(On=r,r=Yr(So,"onSelect"),0Zt||(e.current=zo[Zt],zo[Zt]=null,Zt--)}function D(e,t){Zt++,zo[Zt]=e.current,e.current=t}var yt={},se=kt(yt),ge=kt(!1),Ft=yt;function cn(e,t){var n=e.type.contextTypes;if(!n)return yt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},o;for(o in n)l[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function ve(e){return e=e.childContextTypes,e!=null}function Gr(){B(ge),B(se)}function Cu(e,t,n){if(se.current!==yt)throw Error(k(168));D(se,t),D(ge,n)}function sa(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(k(108,Kc(e)||"Unknown",l));return K({},n,r)}function Zr(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||yt,Ft=se.current,D(se,e),D(ge,ge.current),!0}function Eu(e,t,n){var r=e.stateNode;if(!r)throw Error(k(169));n?(e=sa(e,t,Ft),r.__reactInternalMemoizedMergedChildContext=e,B(ge),B(se),D(se,e)):B(ge),D(ge,n)}var Ye=null,gl=!1,Hl=!1;function aa(e){Ye===null?Ye=[e]:Ye.push(e)}function cd(e){gl=!0,aa(e)}function St(){if(!Hl&&Ye!==null){Hl=!0;var e=0,t=O;try{var n=Ye;for(O=1;e>=i,l-=i,Xe=1<<32-Oe(t)+l|n<N?(A=z,z=null):A=z.sibling;var L=p(f,z,d[N],y);if(L===null){z===null&&(z=A);break}e&&z&&L.alternate===null&&t(f,z),a=o(L,a,N),P===null?C=L:P.sibling=L,P=L,z=A}if(N===d.length)return n(f,z),$&&Nt(f,N),C;if(z===null){for(;NN?(A=z,z=null):A=z.sibling;var pe=p(f,z,L.value,y);if(pe===null){z===null&&(z=A);break}e&&z&&pe.alternate===null&&t(f,z),a=o(pe,a,N),P===null?C=pe:P.sibling=pe,P=pe,z=A}if(L.done)return n(f,z),$&&Nt(f,N),C;if(z===null){for(;!L.done;N++,L=d.next())L=m(f,L.value,y),L!==null&&(a=o(L,a,N),P===null?C=L:P.sibling=L,P=L);return $&&Nt(f,N),C}for(z=r(f,z);!L.done;N++,L=d.next())L=w(z,f,N,L.value,y),L!==null&&(e&&L.alternate!==null&&z.delete(L.key===null?N:L.key),a=o(L,a,N),P===null?C=L:P.sibling=L,P=L);return e&&z.forEach(function(xt){return t(f,xt)}),$&&Nt(f,N),C}function R(f,a,d,y){if(typeof d=="object"&&d!==null&&d.type===Qt&&d.key===null&&(d=d.props.children),typeof d=="object"&&d!==null){switch(d.$$typeof){case dr:e:{for(var C=d.key,P=a;P!==null;){if(P.key===C){if(C=d.type,C===Qt){if(P.tag===7){n(f,P.sibling),a=l(P,d.props.children),a.return=f,f=a;break e}}else if(P.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===rt&&Tu(C)===P.type){n(f,P.sibling),a=l(P,d.props),a.ref=_n(f,P,d),a.return=f,f=a;break e}n(f,P);break}else t(f,P);P=P.sibling}d.type===Qt?(a=It(d.props.children,f.mode,y,d.key),a.return=f,f=a):(y=Br(d.type,d.key,d.props,null,f.mode,y),y.ref=_n(f,a,d),y.return=f,f=y)}return i(f);case Ht:e:{for(P=d.key;a!==null;){if(a.key===P)if(a.tag===4&&a.stateNode.containerInfo===d.containerInfo&&a.stateNode.implementation===d.implementation){n(f,a.sibling),a=l(a,d.children||[]),a.return=f,f=a;break e}else{n(f,a);break}else t(f,a);a=a.sibling}a=ql(d,f.mode,y),a.return=f,f=a}return i(f);case rt:return P=d._init,R(f,a,P(d._payload),y)}if(jn(d))return S(f,a,d,y);if(kn(d))return x(f,a,d,y);Cr(f,d)}return typeof d=="string"&&d!==""||typeof d=="number"?(d=""+d,a!==null&&a.tag===6?(n(f,a.sibling),a=l(a,d),a.return=f,f=a):(n(f,a),a=Jl(d,f.mode,y),a.return=f,f=a),i(f)):n(f,a)}return R}var dn=va(!0),ya=va(!1),sr={},He=kt(sr),qn=kt(sr),bn=kt(sr);function Tt(e){if(e===sr)throw Error(k(174));return e}function Ci(e,t){switch(D(bn,t),D(qn,e),D(He,sr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:co(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=co(t,e)}B(He),D(He,t)}function pn(){B(He),B(qn),B(bn)}function wa(e){Tt(bn.current);var t=Tt(He.current),n=co(t,e.type);t!==n&&(D(qn,e),D(He,n))}function Ei(e){qn.current===e&&(B(He),B(qn))}var H=kt(0);function nl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ql=[];function _i(){for(var e=0;en?n:4,e(!0);var r=Kl.transition;Kl.transition={};try{e(!1),t()}finally{O=n,Kl.transition=r}}function Ma(){return Te().memoizedState}function hd(e,t,n){var r=mt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Oa(e))Da(t,n);else if(n=pa(e,t,n,r),n!==null){var l=ce();De(n,e,r,l),Ua(n,t,r)}}function md(e,t,n){var r=mt(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Oa(e))Da(t,l);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var i=t.lastRenderedState,u=o(i,n);if(l.hasEagerState=!0,l.eagerState=u,Ue(u,i)){var s=t.interleaved;s===null?(l.next=l,Si(t)):(l.next=s.next,s.next=l),t.interleaved=l;return}}catch{}finally{}n=pa(e,t,l,r),n!==null&&(l=ce(),De(n,e,r,l),Ua(n,t,r))}}function Oa(e){var t=e.alternate;return e===Q||t!==null&&t===Q}function Da(e,t){Dn=rl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ua(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ui(e,n)}}var ll={readContext:Re,useCallback:oe,useContext:oe,useEffect:oe,useImperativeHandle:oe,useInsertionEffect:oe,useLayoutEffect:oe,useMemo:oe,useReducer:oe,useRef:oe,useState:oe,useDebugValue:oe,useDeferredValue:oe,useTransition:oe,useMutableSource:oe,useSyncExternalStore:oe,useId:oe,unstable_isNewReconciler:!1},gd={readContext:Re,useCallback:function(e,t){return $e().memoizedState=[e,t===void 0?null:t],e},useContext:Re,useEffect:Iu,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Mr(4194308,4,Ra.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Mr(4194308,4,e,t)},useInsertionEffect:function(e,t){return Mr(4,2,e,t)},useMemo:function(e,t){var n=$e();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=$e();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=hd.bind(null,Q,e),[r.memoizedState,e]},useRef:function(e){var t=$e();return e={current:e},t.memoizedState=e},useState:Lu,useDebugValue:Ri,useDeferredValue:function(e){return $e().memoizedState=e},useTransition:function(){var e=Lu(!1),t=e[0];return e=pd.bind(null,e[1]),$e().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Q,l=$e();if($){if(n===void 0)throw Error(k(407));n=n()}else{if(n=t(),te===null)throw Error(k(349));Ot&30||xa(r,t,n)}l.memoizedState=n;var o={value:n,getSnapshot:t};return l.queue=o,Iu(Ea.bind(null,r,o,e),[e]),r.flags|=2048,nr(9,Ca.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=$e(),t=te.identifierPrefix;if($){var n=Ge,r=Xe;n=(r&~(1<<32-Oe(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=er++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Ae]=t,e[Jn]=r,Ya(e,t,!1,!1),t.stateNode=e;e:{switch(i=po(n,r),n){case"dialog":U("cancel",e),U("close",e),l=r;break;case"iframe":case"object":case"embed":U("load",e),l=r;break;case"video":case"audio":for(l=0;lmn&&(t.flags|=128,r=!0,Pn(o,!1),t.lanes=4194304)}else{if(!r)if(e=nl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Pn(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!$)return ie(t),null}else 2*G()-o.renderingStartTime>mn&&n!==1073741824&&(t.flags|=128,r=!0,Pn(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=G(),t.sibling=null,n=H.current,D(H,r?n&1|2:n&1),t):(ie(t),null);case 22:case 23:return Oi(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ke&1073741824&&(ie(t),t.subtreeFlags&6&&(t.flags|=8192)):ie(t),null;case 24:return null;case 25:return null}throw Error(k(156,t.tag))}function Ed(e,t){switch(gi(t),t.tag){case 1:return ve(t.type)&&Gr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pn(),B(ge),B(se),_i(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ei(t),null;case 13:if(B(H),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(k(340));fn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(H),null;case 4:return pn(),null;case 10:return ki(t.type._context),null;case 22:case 23:return Oi(),null;case 24:return null;default:return null}}var _r=!1,ue=!1,_d=typeof WeakSet=="function"?WeakSet:Set,_=null;function en(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Y(e,t,r)}else n.current=null}function Vo(e,t,n){try{n()}catch(r){Y(e,t,r)}}var Au=!1;function Pd(e,t){if(Co=Qr,e=bs(),hi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,u=-1,s=-1,c=0,g=0,m=e,p=null;t:for(;;){for(var w;m!==n||l!==0&&m.nodeType!==3||(u=i+l),m!==o||r!==0&&m.nodeType!==3||(s=i+r),m.nodeType===3&&(i+=m.nodeValue.length),(w=m.firstChild)!==null;)p=m,m=w;for(;;){if(m===e)break t;if(p===n&&++c===l&&(u=i),p===o&&++g===r&&(s=i),(w=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=w}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Eo={focusedElem:e,selectionRange:n},Qr=!1,_=t;_!==null;)if(t=_,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_=e;else for(;_!==null;){t=_;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var x=S.memoizedProps,R=S.memoizedState,f=t.stateNode,a=f.getSnapshotBeforeUpdate(t.elementType===t.type?x:Ie(t.type,x),R);f.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(k(163))}}catch(y){Y(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,_=e;break}_=t.return}return S=Au,Au=!1,S}function Un(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Vo(t,n,o)}l=l.next}while(l!==r)}}function wl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function $o(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Za(e){var t=e.alternate;t!==null&&(e.alternate=null,Za(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ae],delete t[Jn],delete t[No],delete t[sd],delete t[ad])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ja(e){return e.tag===5||e.tag===3||e.tag===4}function Wu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ja(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ao(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xr));else if(r!==4&&(e=e.child,e!==null))for(Ao(e,t,n),e=e.sibling;e!==null;)Ao(e,t,n),e=e.sibling}function Wo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Wo(e,t,n),e=e.sibling;e!==null;)Wo(e,t,n),e=e.sibling}var ne=null,Fe=!1;function nt(e,t,n){for(n=n.child;n!==null;)qa(e,t,n),n=n.sibling}function qa(e,t,n){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(fl,n)}catch{}switch(n.tag){case 5:ue||en(n,t);case 6:var r=ne,l=Fe;ne=null,nt(e,t,n),ne=r,Fe=l,ne!==null&&(Fe?(e=ne,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ne.removeChild(n.stateNode));break;case 18:ne!==null&&(Fe?(e=ne,n=n.stateNode,e.nodeType===8?Wl(e.parentNode,n):e.nodeType===1&&Wl(e,n),Kn(e)):Wl(ne,n.stateNode));break;case 4:r=ne,l=Fe,ne=n.stateNode.containerInfo,Fe=!0,nt(e,t,n),ne=r,Fe=l;break;case 0:case 11:case 14:case 15:if(!ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Vo(n,t,i),l=l.next}while(l!==r)}nt(e,t,n);break;case 1:if(!ue&&(en(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){Y(n,t,u)}nt(e,t,n);break;case 21:nt(e,t,n);break;case 22:n.mode&1?(ue=(r=ue)||n.memoizedState!==null,nt(e,t,n),ue=r):nt(e,t,n);break;default:nt(e,t,n)}}function Hu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _d),t.forEach(function(r){var l=Md.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Le(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=G()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zd(r/1960))-r,10e?16:e,st===null)var r=!1;else{if(e=st,st=null,ul=0,M&6)throw Error(k(331));var l=M;for(M|=4,_=e.current;_!==null;){var o=_,i=o.child;if(_.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sG()-Fi?Lt(e,0):Ii|=n),ye(e,t)}function ic(e,t){t===0&&(e.mode&1?(t=gr,gr<<=1,!(gr&130023424)&&(gr=4194304)):t=1);var n=ce();e=be(e,t),e!==null&&(or(e,t,n),ye(e,n))}function Fd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ic(e,n)}function Md(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(k(314))}r!==null&&r.delete(t),ic(e,n)}var uc;uc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ge.current)me=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return me=!1,xd(e,t,n);me=!!(e.flags&131072)}else me=!1,$&&t.flags&1048576&&ca(t,qr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Or(e,t),e=t.pendingProps;var l=cn(t,se.current);un(t,n),l=Ni(null,t,r,e,l,n);var o=zi();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ve(r)?(o=!0,Zr(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,xi(t),l.updater=vl,t.stateNode=l,l._reactInternals=t,Io(t,r,e,n),t=Oo(null,t,r,!0,o,n)):(t.tag=0,$&&o&&mi(t),ae(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Or(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Dd(r),e=Ie(r,e),l){case 0:t=Mo(null,t,r,e,n);break e;case 1:t=Bu(null,t,r,e,n);break e;case 11:t=Du(null,t,r,e,n);break e;case 14:t=Uu(null,t,r,Ie(r.type,e),n);break e}throw Error(k(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Mo(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Bu(e,t,r,l,n);case 3:e:{if(Ha(t),e===null)throw Error(k(387));r=t.pendingProps,o=t.memoizedState,l=o.element,ha(e,t),tl(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=hn(Error(k(423)),t),t=Vu(e,t,r,n,l);break e}else if(r!==l){l=hn(Error(k(424)),t),t=Vu(e,t,r,n,l);break e}else for(Se=dt(t.stateNode.containerInfo.firstChild),xe=t,$=!0,Me=null,n=ya(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fn(),r===l){t=et(e,t,n);break e}ae(e,t,r,n)}t=t.child}return t;case 5:return wa(t),e===null&&Ro(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,_o(r,l)?i=null:o!==null&&_o(r,o)&&(t.flags|=32),Wa(e,t),ae(e,t,i,n),t.child;case 6:return e===null&&Ro(t),null;case 13:return Qa(e,t,n);case 4:return Ci(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=dn(t,null,r,n):ae(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Du(e,t,r,l,n);case 7:return ae(e,t,t.pendingProps,n),t.child;case 8:return ae(e,t,t.pendingProps.children,n),t.child;case 12:return ae(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,D(br,r._currentValue),r._currentValue=i,o!==null)if(Ue(o.value,i)){if(o.children===l.children&&!ge.current){t=et(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=Ze(-1,n&-n),s.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var g=c.pending;g===null?s.next=s:(s.next=g.next,g.next=s),c.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),To(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(k(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),To(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}ae(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,un(t,n),l=Re(l),r=r(l),t.flags|=1,ae(e,t,r,n),t.child;case 14:return r=t.type,l=Ie(r,t.pendingProps),l=Ie(r.type,l),Uu(e,t,r,l,n);case 15:return $a(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Or(e,t),t.tag=1,ve(r)?(e=!0,Zr(t)):e=!1,un(t,n),ga(t,r,l),Io(t,r,l,n),Oo(null,t,r,!0,e,n);case 19:return Ka(e,t,n);case 22:return Aa(e,t,n)}throw Error(k(156,t.tag))};function sc(e,t){return Fs(e,t)}function Od(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ze(e,t,n,r){return new Od(e,t,n,r)}function Ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dd(e){if(typeof e=="function")return Ui(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ri)return 11;if(e===li)return 14}return 2}function gt(e,t){var n=e.alternate;return n===null?(n=ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Br(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")Ui(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Qt:return It(n.children,l,o,t);case ni:i=8,l|=8;break;case no:return e=ze(12,n,t,l|2),e.elementType=no,e.lanes=o,e;case ro:return e=ze(13,n,t,l),e.elementType=ro,e.lanes=o,e;case lo:return e=ze(19,n,t,l),e.elementType=lo,e.lanes=o,e;case vs:return Sl(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ms:i=10;break e;case gs:i=9;break e;case ri:i=11;break e;case li:i=14;break e;case rt:i=16,r=null;break e}throw Error(k(130,e==null?e:typeof e,""))}return t=ze(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function It(e,t,n,r){return e=ze(7,e,r,t),e.lanes=n,e}function Sl(e,t,n,r){return e=ze(22,e,r,t),e.elementType=vs,e.lanes=n,e.stateNode={isHidden:!1},e}function Jl(e,t,n){return e=ze(6,e,null,t),e.lanes=n,e}function ql(e,t,n){return t=ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ud(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ll(0),this.expirationTimes=Ll(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ll(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Bi(e,t,n,r,l,o,i,u,s){return e=new Ud(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ze(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xi(o),e}function Bd(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dc)}catch(e){console.error(e)}}dc(),cs.exports=Ee;var Hd=cs.exports,pc,qu=Hd;pc=qu.createRoot,qu.hydrateRoot;const Qd=(e,t,n)=>{const r=(n.fontSize+t*n.maxSizeMultiplier/255).toFixed(2);e.font=`${r}px ${n.selectedFont}`;const o=e.measureText(n.textInput).width,i=parseInt(r),u=n.x-o/2,s=n.y+i/2;e.strokeStyle=n.borderColor,e.lineWidth=n.borderThickness,e.strokeText(n.textInput,u,s),e.fillStyle=n.fontColor,e.fillText(n.textInput,u,s)},hc=(e,t,n,r,l=!1)=>({x:Math.random()*e.width,y:l?Math.random()*e.height:e.height+Math.random()*100,size:t,xDelta:(Math.random()-.5)*2,ySpeed:n,color:r}),Kd=(e,t)=>{const n=[];for(let r=0;r{const o=r.reduce((u,s)=>u+s)/r.length;let i=4;l.zigzagSmoothness>5?i+=o/512*l.beatSpeedUp:i+=o/255*l.beatSpeedUp,t.forEach(u=>{u.y-=i,u.x+=u.xDelta*l.zigzagSmoothness,e.beginPath(),e.arc(u.x,u.y,l.circleSize,0,Math.PI*2),e.fillStyle=l.circleColor,e.fill(),Math.random()<.1&&(u.xDelta=-u.xDelta),u.y+u.size<0&&Object.assign(u,hc(e.canvas,u.size,u.ySpeed,u.color,!1))})},Xo=new Image;let mc=!1;const Xd=e=>{Xo.src=e,Xo.onload=()=>{mc=!0}},Gd=(e,t,n,r,l,o)=>{if(!mc)return;r=1,l.getByteFrequencyData(o);const i=o.reduce((c,g)=>c+g)/o.length,u=1+i/512*r,s=Math.min(i/512*(r/10),Math.PI/4);e.save(),e.translate(t.width/2,t.height/2),e.rotate(s),e.scale(u,u),e.drawImage(Xo,-t.width/2,-t.height/2,t.width,t.height),e.restore()},Zd=(e,t,n,r,l)=>{const{shakeIntensity:o,backgroundImage:i}=l;n.getByteFrequencyData(r);const u=r.reduce((c,g)=>c+g)/r.length,s=o*(u/255);Gd(e,t,i,s,n,r)};async function Jd(e){const t=Object.assign({},e);if(console.log("type: ",t.background.backgroundImage,typeof t.background.backgroundImage,t.background.backgroundImage instanceof Blob),t.background.backgroundImage!==""){const r=await fetch(t.background.backgroundImage).then(o=>o.blob()),l=await bd(r);t.background.backgroundImage=l}const n=JSON.stringify(t);localStorage.setItem("save",n)}function qd(){const e=localStorage.getItem("save"),t=JSON.parse(e||"{}");if(typeof t.background.backgroundImage=="string"&&t.background.backgroundImage!==""){const n=ep(t.background.backgroundImage),r=URL.createObjectURL(n);t.background.backgroundImage=r}return t}function bd(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}function ep(e){const t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new Array(t.length);for(let o=0;o{var m;const[t,n]=I.useState(!1),[r,l]=I.useState(0),[o,i]=I.useState(1),u=()=>{e.current&&(t?e.current.pause():e.current.play(),n(!t))},s=p=>{const w=parseInt(p.target.value);e.current.currentTime=w,l(w)},c=p=>{const w=parseFloat(p.target.value);e.current.volume=w,i(w)};I.useEffect(()=>{const p=setInterval(()=>{e.current&&t&&l(e.current.currentTime)},1e3);return()=>clearInterval(p)},[t,e]);const g=p=>{const w=Math.floor(p/60),S=Math.floor(p%60);return`${w}:${S<10?"0":""}${S}`};return h.jsxs("div",{className:"audio-controls",children:[h.jsx("button",{onClick:u,children:t?"Pause":"Play"}),h.jsxs("div",{className:"time-slider",children:[h.jsx("span",{className:"current-time",children:g(r)}),h.jsx("input",{type:"range",style:{width:"100%"},min:"0",max:((m=e.current)==null?void 0:m.duration)||100,value:r,onChange:s})]}),h.jsx("img",{src:tp,alt:"Description of SVG",width:25,height:25})," ",h.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:o,onChange:c})]})},bl=""+new URL("music-1upaPx3E.mp3",import.meta.url).href;function bu(e){return e*(1024*1024)}function eo(e,t){const r=e*1024*1024*t/8,l=r/1024**3;return l>=1?`${l.toFixed(2)} GB`:`${(r/1048576).toFixed(2)} MB`}const rp=({audioRef:e,canvasRef:t,settings:n})=>{const[r,l]=I.useState(!1),[o,i]=I.useState(0),[u,s]=I.useState(0),c=I.useRef(null),g=I.useRef([]),m=I.useRef(null);I.useEffect(()=>{g.current=[],i(0),s(0)},[r]);const p=()=>{if(e.current&&t.current){const R=e.current.captureStream(60),f=t.current.captureStream(60),a=new MediaStream([...f.getTracks(),...R.getTracks()]),d=n.current.bitRateInMb||4;c.current=new MediaRecorder(a,{mimeType:"video/webm; codecs=vp9",videoBitsPerSecond:bu(d),bitsPerSecond:bu(d)}),g.current=[],i(0),c.current.ondataavailable=y=>{y.data.size>0&&(g.current.push(y.data),i(C=>C+y.data.size))},c.current.start(1e3),l(!0),m.current=setInterval(()=>{e.current&&e.current.duration&&s(e.current.currentTime/e.current.duration*100)},1e3),e.current.onended=()=>{c.current&&c.current.state==="recording"&&w()},e.current.play()}},w=()=>{c.current&&(c.current.stop(),clearInterval(m.current),l(!1),S())},S=()=>{const R=new Blob(g.current,{type:"video/webm"}),f=URL.createObjectURL(R),a=document.createElement("a");a.href=f,a.download="recording.webm",document.body.appendChild(a),a.click(),setTimeout(()=>{document.body.removeChild(a),window.URL.revokeObjectURL(f)},100)};I.useEffect(()=>{!r&&g.current.length>0&&S()},[r]);const x=R=>R>=1e6?`${(R/1e6).toFixed(2)} MB`:R>=1e3?`${(R/1e3).toFixed(2)} KB`:`${R} bytes`;return h.jsxs("div",{className:"recorder-controls",children:[h.jsx("button",{onClick:r?w:p,children:r?"Stop Recording":"Start Recording"}),r&&h.jsxs(h.Fragment,{children:[h.jsxs("p",{children:["Current File Size: ",x(o)]}),h.jsxs("p",{children:["Audio Progress: ",u.toFixed(2),"%"]})]})]})},lp=(e,t,n,r)=>{const l=r.circle.imageX,o=r.circle.imageY;let i=r.circle.baseRadius;for(let u=0;u{const l=r.numBars??n.length;r.useFullWidth&&(r.barWidth=(e.canvas.width-r.spacing*(l+1))/l);const o=r.xPos!==void 0?e.canvas.width*(r.xPos/100):r.spacing,i=r.yPos!==void 0?e.canvas.height*(r.yPos/100):e.canvas.height,u=l*r.barWidth+(l-1)*r.spacing,s=o-u/2;for(let c=0;c{var _t,Wi;const[e,t]=I.useState(null),[n,r]=I.useState(!1),l=I.useRef(null),o=I.useRef(new Audio),i=I.useRef(null),u=I.useRef(null),s=I.useRef(null),c=I.useRef(null),g={"420p":{width:640,height:420},HD:{width:1280,height:720},FullHD:{width:1920,height:1080},"2K":{width:2560,height:1440}},m=I.useRef({simpleBar:!0,circleBar:!1,backgroundCircles:!0,text:!0}),p=I.useRef({maxSizeMultiplier:55,smoothness:100,borderColor:"#000000",borderThickness:1,fontSize:20,fontColor:"#000000",textInput:"Sample Text",selectedFont:"Arial",x:g.FullHD.width/2,y:g.FullHD.height/4}),w=I.useRef({circleSize:10,circleSpeed:1,circleColor:"#d3d3d3",numberOfCircles:5,beatSpeedUp:12,zigzagSmoothness:1}),S=I.useRef({barStyle:"top",spacing:11,barLength:1,barWidth:22,beatMultiplier:2,barColor:"white",numBars:11,useFullWidth:!0,xPos:50,yPos:100}),x=I.useRef({backgroundColor:"#f59292",backgroundImage:"",shakeIntensity:0}),R=I.useRef({bitRateInMb:6}),f=I.useRef({circle:{baseRadius:22,growthFactor:222,color:"#006400",imageX:g.FullHD.width/2,imageY:g.FullHD.height/2},bars:{widthMultiplier:155,lengthMultiplier:2,color:v=>`rgb(${v*2}, ${200-v*2}, ${50+v*2})`}}),a=v=>{const{name:V,value:Z}=v.target,[we,Pt]=V.split(".");f.current[we][Pt]=isNaN(Z)?Z:Number(Z)},[d,y]=I.useState("color"),C=v=>{y(v.target.value)},[P,z]=I.useState({text:!1,font:!1,circle:!1,background:!1,render:!1,musicVisualization:!1,simpleBar:!1}),N=v=>{z(V=>({...V,[v]:!V[v]}))},A=v=>{const V=v.target.files;V&&V[0]&&new FontFace("CustomFont",`url(${URL.createObjectURL(V[0])})`).load().then(we=>{document.fonts.add(we),p.current.selectedFont="CustomFont"}).catch(we=>console.error("Error loading font:",we))},L=v=>{p.current.selectedFont=v.target.value},pe=async()=>{try{const V=await(await fetch(bl)).blob();return new File([V],"defaultMusic.mp3",{type:"audio/mpeg"})}catch(v){return console.error("Error fetching default audio file:",v),null}},xt=async v=>{const V=v.target.files;if(V){const Z=URL.createObjectURL(V[0]);o.current.src=Z,t(V[0])}else{console.log("set file");const Z=await pe();o.current.src=bl,t(null),t(Z)}setTimeout(()=>{console.log(R.current.bitRateInMb,o.current.duration),X(eo(R.current.bitRateInMb,o.current.duration))},222)},Ct=()=>{Jd({text:p.current,background:x.current,circle:w.current})},ar=()=>{const v=qd();w.current=v.circle,x.current=v.background,p.current=v.text},Pl=async()=>{if(!e){console.log("set file");const v=await pe();o.current.src=bl,t(null),t(v)}if(!i.current){i.current=new AudioContext;const v=i.current.createMediaElementSource(o.current);u.current=i.current.createAnalyser(),v.connect(u.current),u.current.connect(i.current.destination)}o.current.playbackRate=1,o.current.play().then(()=>{if(r(!0),u.current){u.current.fftSize=256;const v=u.current.frequencyBinCount;s.current=new Uint8Array(v),wn()}}).catch(v=>console.error("Error playing audio:",v))};let $t=[];l.current&&($t=Kd(l.current,w.current));const wn=()=>{if(!l.current||!l.current||!u.current||!s.current)return;const v=l.current.getContext("2d");if(!v)return;const V=()=>{x.current.backgroundImage!==null&&x.current.backgroundImage!==""?Zd(v,l.current,u.current,s.current,x.current):(v.clearRect(0,0,l.current.width,l.current.height),v.fillStyle=x.current.backgroundColor,v.fillRect(0,0,l.current.width,l.current.height)),m.current.backgroundCircles&&Yd(v,$t,u.current,s.current,w.current);const Z=u.current.frequencyBinCount,we=s.current;u.current.getByteFrequencyData(we);const Pt=we.reduce((cr,gc)=>cr+gc)/we.length;m.current.simpleBar&&op(v,Z,we,S.current),m.current.circleBar&&lp(v,Z,we,f.current),m.current.text&&Qd(v,Pt,p.current),c.current=requestAnimationFrame(V)};V()},E=v=>{if(!v.target.files){console.warn("no file selected");return}const V=v.target.files[0],Z=URL.createObjectURL(V);Xd(Z),x.current.backgroundImage=Z};I.useEffect(()=>()=>{c.current&&cancelAnimationFrame(c.current),i.current&&i.current.close()},[]);const[j,T]=I.useState("FullHD"),[W,X]=I.useState("");I.useEffect(()=>{const v=l.current;if(v&&g[j]){const{width:V,height:Z}=g[j];v.width=V,v.height=Z}},[j]);const At=v=>{if(!v.target.files){console.warn("no file selected");return}const V=v.target.files[0];if(V){const Z=new FileReader;Z.onload=we=>{var cr;const Pt=new Image;Pt.onload=()=>{f.current.circle.image=Pt},Pt.src=(cr=we.target)==null?void 0:cr.result},Z.readAsDataURL(V)}},Qe=v=>{T(v.target.value)},Et=((_t=l.current)==null?void 0:_t.width)||0,Be=((Wi=l.current)==null?void 0:Wi.height)||0;return h.jsxs("div",{className:"container",children:[h.jsxs("div",{style:{textAlign:"right",margin:"10px"},children:[h.jsx("button",{onClick:Ct,children:"Save"}),h.jsx("button",{onClick:ar,style:{margin:"5px"},children:"Load"})]}),h.jsxs("div",{className:"control-group",children:["Audio file: ",h.jsx("input",{type:"file",onChange:xt,accept:"audio/*"}),h.jsx("div",{className:"container",children:h.jsx(np,{audioRef:o})}),h.jsx("button",{onClick:Pl,children:"Start & visualize"})]}),h.jsx("div",{className:"group-header",onClick:()=>N("render"),children:"Render / Export"}),P.render&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Canvas Resolution:",h.jsx("select",{value:j,onChange:Qe,children:Object.keys(g).map(v=>h.jsx("option",{value:v,children:v},v))})]}),h.jsxs("label",{children:["Bitrate:",h.jsx("input",{type:"number",defaultValue:"6",onChange:v=>{R.current.bitRateInMb=parseFloat(v.target.value),console.log(eo(R.current.bitRateInMb,o.current.duration)),X(eo(R.current.bitRateInMb,o.current.duration))}}),"MB"]}),h.jsx("hr",{}),"Estimated video file size is: ",W,h.jsx("label",{children:e&&h.jsx(rp,{audioRef:o,settings:R,canvasRef:l},e.name)})]}),h.jsx("div",{className:"group-header",onClick:()=>N("text"),children:"Text Settings"}),P.text&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Text:",h.jsx("input",{type:"text",defaultValue:"Sample Text",onChange:v=>p.current.textInput=v.target.value})]}),h.jsxs("label",{children:["Text X Coordinate:",h.jsx("input",{type:"range",name:"text.x",min:"0",max:Et,defaultValue:"0",onChange:v=>p.current.x=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Text Y Coordinate:",h.jsx("input",{type:"range",name:"text.y",min:"0",max:Be,defaultValue:"0",onChange:v=>p.current.y=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Max Size Multiplier:",h.jsx("input",{type:"number",defaultValue:"55",onChange:v=>p.current.maxSizeMultiplier=parseFloat(v.target.value)})]}),h.jsxs("label",{children:["Border Color:",h.jsx("input",{type:"color",defaultValue:"#000000",onChange:v=>p.current.borderColor=v.target.value})]}),h.jsxs("label",{children:["Border Thickness:",h.jsx("input",{type:"number",defaultValue:"1",onChange:v=>p.current.borderThickness=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Font Size:",h.jsx("input",{type:"number",defaultValue:"20",onChange:v=>p.current.fontSize=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Font Color:",h.jsx("input",{type:"color",defaultValue:"#000000",onChange:v=>p.current.fontColor=v.target.value})]}),h.jsx("div",{className:"group-header",onClick:()=>N("font"),children:"Font Settings"}),P.font&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Font:",h.jsx("select",{onChange:L,children:["Arial","Verdana","Times New Roman","Georgia","Courier New"].map(v=>h.jsx("option",{value:v,children:v},v))})]}),h.jsxs("label",{children:["or upload a font file:",h.jsx("input",{type:"file",onChange:A,accept:".ttf, .otf"})]})]})]}),h.jsx("div",{className:"group-header",onClick:()=>N("musicVisualization"),children:"Circle with bars Settings"}),P.musicVisualization&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Circle Base Radius:",h.jsx("input",{type:"number",name:"circle.baseRadius",defaultValue:f.current.circle.baseRadius,onChange:a})]}),h.jsxs("label",{children:["Circle Growth Factor:",h.jsx("input",{type:"number",name:"circle.growthFactor",defaultValue:f.current.circle.growthFactor,onChange:a})]}),h.jsxs("label",{children:["Circle Color:",h.jsx("input",{type:"color",name:"circle.color",defaultValue:f.current.circle.color,onChange:a})]}),h.jsxs("label",{children:["Circle Image:",h.jsx("input",{type:"file",onChange:At,accept:"image/*"})]}),h.jsxs("label",{children:["X Coordinate:",h.jsx("input",{type:"range",name:"circle.imageX",min:"0",max:Et,defaultValue:Et/2,onChange:a})]}),h.jsxs("label",{children:["Y Coordinate:",h.jsx("input",{type:"range",name:"circle.imageY",min:"0",max:Be,defaultValue:f.current.circle.imageY,onChange:a})]}),h.jsxs("label",{children:["Bars Width Multiplier:",h.jsx("input",{type:"number",name:"bars.widthMultiplier",defaultValue:f.current.bars.widthMultiplier,onChange:a})]}),h.jsxs("label",{children:["Bars Length Multiplier:",h.jsx("input",{type:"number",name:"bars.lengthMultiplier",defaultValue:f.current.bars.lengthMultiplier,onChange:a})]})]}),h.jsx("div",{className:"group-header",onClick:()=>N("circle"),children:"Circle Settings"}),P.circle&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Number of Circles:",h.jsx("input",{type:"number",defaultValue:"11",onChange:v=>{w.current.numberOfCircles=parseInt(v.target.value)}})]}),h.jsxs("label",{children:["Circle Size:",h.jsx("input",{type:"number",defaultValue:"12",onChange:v=>w.current.circleSize=parseFloat(v.target.value)})]}),h.jsxs("label",{children:["beat speed up factor:",h.jsx("input",{type:"number",defaultValue:"12",onChange:v=>w.current.beatSpeedUp=parseFloat(v.target.value)})]}),h.jsxs("label",{children:["Circle Speed:",h.jsx("input",{type:"number",defaultValue:"11",onChange:v=>w.current.circleSpeed=parseFloat(v.target.value)})]}),h.jsxs("label",{children:["Circle Color:",h.jsx("input",{type:"color",defaultValue:"Red",onChange:v=>w.current.circleColor=v.target.value})]})]}),h.jsx("div",{className:"group-header",onClick:()=>N("simpleBar"),children:"Simple Bar Settings"}),P.simpleBar&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Bar Style:",h.jsxs("select",{defaultValue:"bottom",onChange:v=>S.current.barStyle=v.target.value,children:[h.jsx("option",{value:"top",children:"Top"}),h.jsx("option",{value:"bottom",children:"Bottom"}),h.jsx("option",{value:"both",children:"Both"})]})]}),h.jsxs("label",{children:["Spacing:",h.jsx("input",{type:"number",defaultValue:"11",onChange:v=>S.current.spacing=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Bar Width:",h.jsx("input",{type:"number",defaultValue:"22",onChange:v=>S.current.barWidth=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Beat Multiplier:",h.jsx("input",{type:"number",defaultValue:"2",onChange:v=>S.current.beatMultiplier=parseFloat(v.target.value)})]}),h.jsxs("label",{children:["Bar Color:",h.jsx("input",{type:"color",defaultValue:"#ffffff",onChange:v=>S.current.barColor=v.target.value})]}),h.jsxs("label",{children:["Number of Bars:",h.jsx("input",{type:"number",defaultValue:"11",onChange:v=>S.current.numBars=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Use Full Width:",h.jsx("input",{type:"checkbox",defaultChecked:!0,onChange:v=>S.current.useFullWidth=v.target.checked})]}),h.jsxs("label",{children:["X Position (%):",h.jsx("input",{type:"range",min:"0",max:"100",defaultValue:"50",onChange:v=>S.current.xPos=parseInt(v.target.value)}),S.current.xPos,"%"]}),h.jsxs("label",{children:["Y Position (%):",h.jsx("input",{type:"range",min:"0",max:"100",defaultValue:"50",onChange:v=>S.current.yPos=parseInt(v.target.value)}),S.current.yPos,"%"]})]}),h.jsx("div",{className:"group-header",onClick:()=>N("background"),children:"Background settings"}),P.background&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Type:",h.jsxs("select",{value:d,onChange:C,children:[h.jsx("option",{value:"color",children:"Color"}),h.jsx("option",{value:"image",children:"Image"})]})]}),d==="color"&&h.jsxs("label",{children:["Color:",h.jsx("input",{type:"color",value:x.current.backgroundColor,onChange:v=>x.current.backgroundColor=v.target.value})]}),d==="image"&&h.jsxs("label",{children:["Image:",h.jsx("input",{type:"file",onChange:E,accept:"image/*"})]})]}),h.jsxs("div",{className:"visuals-settings",children:[h.jsxs("label",{children:["Enable Simple Bar:",h.jsx("input",{type:"checkbox",defaultChecked:m.current.simpleBar,onChange:v=>m.current.simpleBar=v.target.checked})]}),h.jsxs("label",{children:["Enable Circle Bar:",h.jsx("input",{type:"checkbox",defaultChecked:m.current.circleBar,onChange:v=>m.current.circleBar=v.target.checked})]}),h.jsxs("label",{children:["Enable Background Circles:",h.jsx("input",{type:"checkbox",defaultChecked:m.current.backgroundCircles,onChange:v=>m.current.backgroundCircles=v.target.checked})]}),h.jsxs("label",{children:["Enable Text:",h.jsx("input",{type:"checkbox",defaultChecked:m.current.text,onChange:v=>m.current.text=v.target.checked})]})]}),h.jsx("canvas",{ref:l,style:{width:"80%",height:"auto"},width:"1920",height:"1080"}),h.jsx("audio",{ref:o,crossOrigin:"anonymous"})]})},up=document.getElementById("root"),sp=pc(up);sp.render(h.jsx(Ic.StrictMode,{children:h.jsx(ip,{})})); +`+o.stack}return{value:e,source:t,stack:l,digest:null}}function Gl(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Fo(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var wd=typeof WeakMap=="function"?WeakMap:Map;function Ba(e,t,n){n=Ze(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){il||(il=!0,Ho=r),Fo(e,t)},n}function Va(e,t,n){n=Ze(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var l=t.value;n.payload=function(){return r(l)},n.callback=function(){Fo(e,t)}}var o=e.stateNode;return o!==null&&typeof o.componentDidCatch=="function"&&(n.callback=function(){Fo(e,t),typeof r!="function"&&(ht===null?ht=new Set([this]):ht.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),n}function Fu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new wd;var l=new Set;r.set(t,l)}else l=r.get(t),l===void 0&&(l=new Set,r.set(t,l));l.has(n)||(l.add(n),e=Id.bind(null,e,t,n),t.then(e,e))}function Mu(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ou(e,t,n,r,l){return e.mode&1?(e.flags|=65536,e.lanes=l,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Ze(-1,1),t.tag=2,pt(n,t,1))),n.lanes|=1),e)}var kd=tt.ReactCurrentOwner,me=!1;function ae(e,t,n,r){t.child=e===null?ya(t,null,n,r):dn(t,e.child,n,r)}function Du(e,t,n,r,l){n=n.render;var o=t.ref;return un(t,l),r=Ni(e,t,n,r,o,l),n=zi(),e!==null&&!me?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,et(e,t,l)):($&&n&&mi(t),t.flags|=1,ae(e,t,r,l),t.child)}function Uu(e,t,n,r,l){if(e===null){var o=n.type;return typeof o=="function"&&!Ui(o)&&o.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=o,$a(e,t,o,r,l)):(e=Br(n.type,null,r,t,t.mode,l),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!(e.lanes&l)){var i=o.memoizedProps;if(n=n.compare,n=n!==null?n:Xn,n(i,r)&&e.ref===t.ref)return et(e,t,l)}return t.flags|=1,e=gt(o,r),e.ref=t.ref,e.return=t,t.child=e}function $a(e,t,n,r,l){if(e!==null){var o=e.memoizedProps;if(Xn(o,r)&&e.ref===t.ref)if(me=!1,t.pendingProps=r=o,(e.lanes&l)!==0)e.flags&131072&&(me=!0);else return t.lanes=e.lanes,et(e,t,l)}return Mo(e,t,n,r,l)}function Aa(e,t,n){var r=t.pendingProps,l=r.children,o=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},D(tn,ke),ke|=n;else{if(!(n&1073741824))return e=o!==null?o.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,D(tn,ke),ke|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=o!==null?o.baseLanes:n,D(tn,ke),ke|=r}else o!==null?(r=o.baseLanes|n,t.memoizedState=null):r=n,D(tn,ke),ke|=r;return ae(e,t,l,n),t.child}function Wa(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Mo(e,t,n,r,l){var o=ve(n)?Ft:se.current;return o=cn(t,o),un(t,l),n=Ni(e,t,n,r,o,l),r=zi(),e!==null&&!me?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l,et(e,t,l)):($&&r&&mi(t),t.flags|=1,ae(e,t,n,l),t.child)}function Bu(e,t,n,r,l){if(ve(n)){var o=!0;Zr(t)}else o=!1;if(un(t,l),t.stateNode===null)Or(e,t),ga(t,n,r),Io(t,n,r,l),r=!0;else if(e===null){var i=t.stateNode,u=t.memoizedProps;i.props=u;var s=i.context,c=n.contextType;typeof c=="object"&&c!==null?c=Re(c):(c=ve(n)?Ft:se.current,c=cn(t,c));var g=n.getDerivedStateFromProps,m=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function";m||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u!==r||s!==c)&&Ru(t,i,r,c),lt=!1;var p=t.memoizedState;i.state=p,tl(t,r,i,l),s=t.memoizedState,u!==r||p!==s||ge.current||lt?(typeof g=="function"&&(Lo(t,n,g,r),s=t.memoizedState),(u=lt||ju(t,n,u,r,p,s,c))?(m||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=s),i.props=r,i.state=s,i.context=c,r=u):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{i=t.stateNode,ha(e,t),u=t.memoizedProps,c=t.type===t.elementType?u:Ie(t.type,u),i.props=c,m=t.pendingProps,p=i.context,s=n.contextType,typeof s=="object"&&s!==null?s=Re(s):(s=ve(n)?Ft:se.current,s=cn(t,s));var w=n.getDerivedStateFromProps;(g=typeof w=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(u!==m||p!==s)&&Ru(t,i,r,s),lt=!1,p=t.memoizedState,i.state=p,tl(t,r,i,l);var S=t.memoizedState;u!==m||p!==S||ge.current||lt?(typeof w=="function"&&(Lo(t,n,w,r),S=t.memoizedState),(c=lt||ju(t,n,c,r,p,S,s)||!1)?(g||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(r,S,s),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(r,S,s)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=S),i.props=r,i.state=S,i.context=s,r=c):(typeof i.componentDidUpdate!="function"||u===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||u===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),r=!1)}return Oo(e,t,n,r,o,l)}function Oo(e,t,n,r,l,o){Wa(e,t);var i=(t.flags&128)!==0;if(!r&&!i)return l&&Eu(t,n,!1),et(e,t,o);r=t.stateNode,kd.current=t;var u=i&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&i?(t.child=dn(t,e.child,null,o),t.child=dn(t,null,u,o)):ae(e,t,u,o),t.memoizedState=r.state,l&&Eu(t,n,!0),t.child}function Ha(e){var t=e.stateNode;t.pendingContext?Cu(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Cu(e,t.context,!1),Ci(e,t.containerInfo)}function Vu(e,t,n,r,l){return fn(),vi(l),t.flags|=256,ae(e,t,n,r),t.child}var Do={dehydrated:null,treeContext:null,retryLane:0};function Uo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Qa(e,t,n){var r=t.pendingProps,l=H.current,o=!1,i=(t.flags&128)!==0,u;if((u=i)||(u=e!==null&&e.memoizedState===null?!1:(l&2)!==0),u?(o=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(l|=1),D(H,l&1),e===null)return Ro(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=r.children,e=r.fallback,o?(r=t.mode,o=t.child,i={mode:"hidden",children:i},!(r&1)&&o!==null?(o.childLanes=0,o.pendingProps=i):o=Sl(i,r,0,null),e=It(e,r,n,null),o.return=t,e.return=t,o.sibling=e,t.child=o,t.child.memoizedState=Uo(n),t.memoizedState=Do,e):Ti(t,i));if(l=e.memoizedState,l!==null&&(u=l.dehydrated,u!==null))return Sd(e,t,i,r,u,l,n);if(o){o=r.fallback,i=t.mode,l=e.child,u=l.sibling;var s={mode:"hidden",children:r.children};return!(i&1)&&t.child!==l?(r=t.child,r.childLanes=0,r.pendingProps=s,t.deletions=null):(r=gt(l,s),r.subtreeFlags=l.subtreeFlags&14680064),u!==null?o=gt(u,o):(o=It(o,i,n,null),o.flags|=2),o.return=t,r.return=t,r.sibling=o,t.child=r,r=o,o=t.child,i=e.child.memoizedState,i=i===null?Uo(n):{baseLanes:i.baseLanes|n,cachePool:null,transitions:i.transitions},o.memoizedState=i,o.childLanes=e.childLanes&~n,t.memoizedState=Do,r}return o=e.child,e=o.sibling,r=gt(o,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ti(e,t){return t=Sl({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Er(e,t,n,r){return r!==null&&vi(r),dn(t,e.child,null,n),e=Ti(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Sd(e,t,n,r,l,o,i){if(n)return t.flags&256?(t.flags&=-257,r=Gl(Error(k(422))),Er(e,t,i,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(o=r.fallback,l=t.mode,r=Sl({mode:"visible",children:r.children},l,0,null),o=It(o,l,i,null),o.flags|=2,r.return=t,o.return=t,r.sibling=o,t.child=r,t.mode&1&&dn(t,e.child,null,i),t.child.memoizedState=Uo(i),t.memoizedState=Do,o);if(!(t.mode&1))return Er(e,t,i,null);if(l.data==="$!"){if(r=l.nextSibling&&l.nextSibling.dataset,r)var u=r.dgst;return r=u,o=Error(k(419)),r=Gl(o,r,void 0),Er(e,t,i,r)}if(u=(i&e.childLanes)!==0,me||u){if(r=te,r!==null){switch(i&-i){case 4:l=2;break;case 16:l=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:l=32;break;case 536870912:l=268435456;break;default:l=0}l=l&(r.suspendedLanes|i)?0:l,l!==0&&l!==o.retryLane&&(o.retryLane=l,be(e,l),De(r,e,l,-1))}return Di(),r=Gl(Error(k(421))),Er(e,t,i,r)}return l.data==="$?"?(t.flags|=128,t.child=e.child,t=Fd.bind(null,e),l._reactRetry=t,null):(e=o.treeContext,Se=dt(l.nextSibling),xe=t,$=!0,Me=null,e!==null&&(Pe[Ne++]=Xe,Pe[Ne++]=Ge,Pe[Ne++]=Mt,Xe=e.id,Ge=e.overflow,Mt=t),t=Ti(t,r.children),t.flags|=4096,t)}function $u(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),To(e.return,t,n)}function Zl(e,t,n,r,l){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:l}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=l)}function Ka(e,t,n){var r=t.pendingProps,l=r.revealOrder,o=r.tail;if(ae(e,t,r.children,n),r=H.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$u(e,n,t);else if(e.tag===19)$u(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(D(H,r),!(t.mode&1))t.memoizedState=null;else switch(l){case"forwards":for(n=t.child,l=null;n!==null;)e=n.alternate,e!==null&&nl(e)===null&&(l=n),n=n.sibling;n=l,n===null?(l=t.child,t.child=null):(l=n.sibling,n.sibling=null),Zl(t,!1,l,n,o);break;case"backwards":for(n=null,l=t.child,t.child=null;l!==null;){if(e=l.alternate,e!==null&&nl(e)===null){t.child=l;break}e=l.sibling,l.sibling=n,n=l,l=e}Zl(t,!0,n,null,o);break;case"together":Zl(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Or(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function et(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Dt|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(k(153));if(t.child!==null){for(e=t.child,n=gt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=gt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function xd(e,t,n){switch(t.tag){case 3:Ha(t),fn();break;case 5:wa(t);break;case 1:ve(t.type)&&Zr(t);break;case 4:Ci(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,l=t.memoizedProps.value;D(br,r._currentValue),r._currentValue=l;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(D(H,H.current&1),t.flags|=128,null):n&t.child.childLanes?Qa(e,t,n):(D(H,H.current&1),e=et(e,t,n),e!==null?e.sibling:null);D(H,H.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Ka(e,t,n);t.flags|=128}if(l=t.memoizedState,l!==null&&(l.rendering=null,l.tail=null,l.lastEffect=null),D(H,H.current),r)break;return null;case 22:case 23:return t.lanes=0,Aa(e,t,n)}return et(e,t,n)}var Ya,Bo,Xa,Ga;Ya=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Bo=function(){};Xa=function(e,t,n,r){var l=e.memoizedProps;if(l!==r){e=t.stateNode,Tt(He.current);var o=null;switch(n){case"input":l=io(e,l),r=io(e,r),o=[];break;case"select":l=K({},l,{value:void 0}),r=K({},r,{value:void 0}),o=[];break;case"textarea":l=ao(e,l),r=ao(e,r),o=[];break;default:typeof l.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Xr)}fo(n,r);var i;n=null;for(c in l)if(!r.hasOwnProperty(c)&&l.hasOwnProperty(c)&&l[c]!=null)if(c==="style"){var u=l[c];for(i in u)u.hasOwnProperty(i)&&(n||(n={}),n[i]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&($n.hasOwnProperty(c)?o||(o=[]):(o=o||[]).push(c,null));for(c in r){var s=r[c];if(u=l!=null?l[c]:void 0,r.hasOwnProperty(c)&&s!==u&&(s!=null||u!=null))if(c==="style")if(u){for(i in u)!u.hasOwnProperty(i)||s&&s.hasOwnProperty(i)||(n||(n={}),n[i]="");for(i in s)s.hasOwnProperty(i)&&u[i]!==s[i]&&(n||(n={}),n[i]=s[i])}else n||(o||(o=[]),o.push(c,n)),n=s;else c==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,u=u?u.__html:void 0,s!=null&&u!==s&&(o=o||[]).push(c,s)):c==="children"?typeof s!="string"&&typeof s!="number"||(o=o||[]).push(c,""+s):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&($n.hasOwnProperty(c)?(s!=null&&c==="onScroll"&&U("scroll",e),o||u===s||(o=[])):(o=o||[]).push(c,s))}n&&(o=o||[]).push("style",n);var c=o;(t.updateQueue=c)&&(t.flags|=4)}};Ga=function(e,t,n,r){n!==r&&(t.flags|=4)};function Pn(e,t){if(!$)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ie(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags&14680064,r|=l.flags&14680064,l.return=e,l=l.sibling;else for(l=e.child;l!==null;)n|=l.lanes|l.childLanes,r|=l.subtreeFlags,r|=l.flags,l.return=e,l=l.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Cd(e,t,n){var r=t.pendingProps;switch(gi(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ie(t),null;case 1:return ve(t.type)&&Gr(),ie(t),null;case 3:return r=t.stateNode,pn(),B(ge),B(se),_i(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(xr(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Me!==null&&(Yo(Me),Me=null))),Bo(e,t),ie(t),null;case 5:Ei(t);var l=Tt(bn.current);if(n=t.type,e!==null&&t.stateNode!=null)Xa(e,t,n,r,l),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(k(166));return ie(t),null}if(e=Tt(He.current),xr(t)){r=t.stateNode,n=t.type;var o=t.memoizedProps;switch(r[Ae]=t,r[Jn]=o,e=(t.mode&1)!==0,n){case"dialog":U("cancel",r),U("close",r);break;case"iframe":case"object":case"embed":U("load",r);break;case"video":case"audio":for(l=0;l<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=i.createElement(n,{is:r.is}):(e=i.createElement(n),n==="select"&&(i=e,r.multiple?i.multiple=!0:r.size&&(i.size=r.size))):e=i.createElementNS(e,n),e[Ae]=t,e[Jn]=r,Ya(e,t,!1,!1),t.stateNode=e;e:{switch(i=po(n,r),n){case"dialog":U("cancel",e),U("close",e),l=r;break;case"iframe":case"object":case"embed":U("load",e),l=r;break;case"video":case"audio":for(l=0;lmn&&(t.flags|=128,r=!0,Pn(o,!1),t.lanes=4194304)}else{if(!r)if(e=nl(i),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Pn(o,!0),o.tail===null&&o.tailMode==="hidden"&&!i.alternate&&!$)return ie(t),null}else 2*G()-o.renderingStartTime>mn&&n!==1073741824&&(t.flags|=128,r=!0,Pn(o,!1),t.lanes=4194304);o.isBackwards?(i.sibling=t.child,t.child=i):(n=o.last,n!==null?n.sibling=i:t.child=i,o.last=i)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=G(),t.sibling=null,n=H.current,D(H,r?n&1|2:n&1),t):(ie(t),null);case 22:case 23:return Oi(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ke&1073741824&&(ie(t),t.subtreeFlags&6&&(t.flags|=8192)):ie(t),null;case 24:return null;case 25:return null}throw Error(k(156,t.tag))}function Ed(e,t){switch(gi(t),t.tag){case 1:return ve(t.type)&&Gr(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pn(),B(ge),B(se),_i(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ei(t),null;case 13:if(B(H),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(k(340));fn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(H),null;case 4:return pn(),null;case 10:return ki(t.type._context),null;case 22:case 23:return Oi(),null;case 24:return null;default:return null}}var _r=!1,ue=!1,_d=typeof WeakSet=="function"?WeakSet:Set,_=null;function en(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Y(e,t,r)}else n.current=null}function Vo(e,t,n){try{n()}catch(r){Y(e,t,r)}}var Au=!1;function Pd(e,t){if(Co=Qr,e=bs(),hi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var i=0,u=-1,s=-1,c=0,g=0,m=e,p=null;t:for(;;){for(var w;m!==n||l!==0&&m.nodeType!==3||(u=i+l),m!==o||r!==0&&m.nodeType!==3||(s=i+r),m.nodeType===3&&(i+=m.nodeValue.length),(w=m.firstChild)!==null;)p=m,m=w;for(;;){if(m===e)break t;if(p===n&&++c===l&&(u=i),p===o&&++g===r&&(s=i),(w=m.nextSibling)!==null)break;m=p,p=m.parentNode}m=w}n=u===-1||s===-1?null:{start:u,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Eo={focusedElem:e,selectionRange:n},Qr=!1,_=t;_!==null;)if(t=_,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,_=e;else for(;_!==null;){t=_;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var x=S.memoizedProps,R=S.memoizedState,f=t.stateNode,a=f.getSnapshotBeforeUpdate(t.elementType===t.type?x:Ie(t.type,x),R);f.__reactInternalSnapshotBeforeUpdate=a}break;case 3:var d=t.stateNode.containerInfo;d.nodeType===1?d.textContent="":d.nodeType===9&&d.documentElement&&d.removeChild(d.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(k(163))}}catch(y){Y(t,t.return,y)}if(e=t.sibling,e!==null){e.return=t.return,_=e;break}_=t.return}return S=Au,Au=!1,S}function Un(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var o=l.destroy;l.destroy=void 0,o!==void 0&&Vo(t,n,o)}l=l.next}while(l!==r)}}function wl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function $o(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Za(e){var t=e.alternate;t!==null&&(e.alternate=null,Za(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Ae],delete t[Jn],delete t[No],delete t[sd],delete t[ad])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ja(e){return e.tag===5||e.tag===3||e.tag===4}function Wu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ja(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ao(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xr));else if(r!==4&&(e=e.child,e!==null))for(Ao(e,t,n),e=e.sibling;e!==null;)Ao(e,t,n),e=e.sibling}function Wo(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Wo(e,t,n),e=e.sibling;e!==null;)Wo(e,t,n),e=e.sibling}var ne=null,Fe=!1;function nt(e,t,n){for(n=n.child;n!==null;)qa(e,t,n),n=n.sibling}function qa(e,t,n){if(We&&typeof We.onCommitFiberUnmount=="function")try{We.onCommitFiberUnmount(fl,n)}catch{}switch(n.tag){case 5:ue||en(n,t);case 6:var r=ne,l=Fe;ne=null,nt(e,t,n),ne=r,Fe=l,ne!==null&&(Fe?(e=ne,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ne.removeChild(n.stateNode));break;case 18:ne!==null&&(Fe?(e=ne,n=n.stateNode,e.nodeType===8?Wl(e.parentNode,n):e.nodeType===1&&Wl(e,n),Kn(e)):Wl(ne,n.stateNode));break;case 4:r=ne,l=Fe,ne=n.stateNode.containerInfo,Fe=!0,nt(e,t,n),ne=r,Fe=l;break;case 0:case 11:case 14:case 15:if(!ue&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var o=l,i=o.destroy;o=o.tag,i!==void 0&&(o&2||o&4)&&Vo(n,t,i),l=l.next}while(l!==r)}nt(e,t,n);break;case 1:if(!ue&&(en(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(u){Y(n,t,u)}nt(e,t,n);break;case 21:nt(e,t,n);break;case 22:n.mode&1?(ue=(r=ue)||n.memoizedState!==null,nt(e,t,n),ue=r):nt(e,t,n);break;default:nt(e,t,n)}}function Hu(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new _d),t.forEach(function(r){var l=Md.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function Le(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=i),r&=~o}if(r=l,r=G()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*zd(r/1960))-r,10e?16:e,st===null)var r=!1;else{if(e=st,st=null,ul=0,M&6)throw Error(k(331));var l=M;for(M|=4,_=e.current;_!==null;){var o=_,i=o.child;if(_.flags&16){var u=o.deletions;if(u!==null){for(var s=0;sG()-Fi?Lt(e,0):Ii|=n),ye(e,t)}function ic(e,t){t===0&&(e.mode&1?(t=gr,gr<<=1,!(gr&130023424)&&(gr=4194304)):t=1);var n=ce();e=be(e,t),e!==null&&(or(e,t,n),ye(e,n))}function Fd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),ic(e,n)}function Md(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(k(314))}r!==null&&r.delete(t),ic(e,n)}var uc;uc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||ge.current)me=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return me=!1,xd(e,t,n);me=!!(e.flags&131072)}else me=!1,$&&t.flags&1048576&&ca(t,qr,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Or(e,t),e=t.pendingProps;var l=cn(t,se.current);un(t,n),l=Ni(null,t,r,e,l,n);var o=zi();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ve(r)?(o=!0,Zr(t)):o=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,xi(t),l.updater=vl,t.stateNode=l,l._reactInternals=t,Io(t,r,e,n),t=Oo(null,t,r,!0,o,n)):(t.tag=0,$&&o&&mi(t),ae(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Or(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Dd(r),e=Ie(r,e),l){case 0:t=Mo(null,t,r,e,n);break e;case 1:t=Bu(null,t,r,e,n);break e;case 11:t=Du(null,t,r,e,n);break e;case 14:t=Uu(null,t,r,Ie(r.type,e),n);break e}throw Error(k(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Mo(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Bu(e,t,r,l,n);case 3:e:{if(Ha(t),e===null)throw Error(k(387));r=t.pendingProps,o=t.memoizedState,l=o.element,ha(e,t),tl(t,r,null,n);var i=t.memoizedState;if(r=i.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){l=hn(Error(k(423)),t),t=Vu(e,t,r,n,l);break e}else if(r!==l){l=hn(Error(k(424)),t),t=Vu(e,t,r,n,l);break e}else for(Se=dt(t.stateNode.containerInfo.firstChild),xe=t,$=!0,Me=null,n=ya(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fn(),r===l){t=et(e,t,n);break e}ae(e,t,r,n)}t=t.child}return t;case 5:return wa(t),e===null&&Ro(t),r=t.type,l=t.pendingProps,o=e!==null?e.memoizedProps:null,i=l.children,_o(r,l)?i=null:o!==null&&_o(r,o)&&(t.flags|=32),Wa(e,t),ae(e,t,i,n),t.child;case 6:return e===null&&Ro(t),null;case 13:return Qa(e,t,n);case 4:return Ci(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=dn(t,null,r,n):ae(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Du(e,t,r,l,n);case 7:return ae(e,t,t.pendingProps,n),t.child;case 8:return ae(e,t,t.pendingProps.children,n),t.child;case 12:return ae(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,i=l.value,D(br,r._currentValue),r._currentValue=i,o!==null)if(Ue(o.value,i)){if(o.children===l.children&&!ge.current){t=et(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var u=o.dependencies;if(u!==null){i=o.child;for(var s=u.firstContext;s!==null;){if(s.context===r){if(o.tag===1){s=Ze(-1,n&-n),s.tag=2;var c=o.updateQueue;if(c!==null){c=c.shared;var g=c.pending;g===null?s.next=s:(s.next=g.next,g.next=s),c.pending=s}}o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),To(o.return,n,t),u.lanes|=n;break}s=s.next}}else if(o.tag===10)i=o.type===t.type?null:o.child;else if(o.tag===18){if(i=o.return,i===null)throw Error(k(341));i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),To(i,n,t),i=o.sibling}else i=o.child;if(i!==null)i.return=o;else for(i=o;i!==null;){if(i===t){i=null;break}if(o=i.sibling,o!==null){o.return=i.return,i=o;break}i=i.return}o=i}ae(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,un(t,n),l=Re(l),r=r(l),t.flags|=1,ae(e,t,r,n),t.child;case 14:return r=t.type,l=Ie(r,t.pendingProps),l=Ie(r.type,l),Uu(e,t,r,l,n);case 15:return $a(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Ie(r,l),Or(e,t),t.tag=1,ve(r)?(e=!0,Zr(t)):e=!1,un(t,n),ga(t,r,l),Io(t,r,l,n),Oo(null,t,r,!0,e,n);case 19:return Ka(e,t,n);case 22:return Aa(e,t,n)}throw Error(k(156,t.tag))};function sc(e,t){return Fs(e,t)}function Od(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ze(e,t,n,r){return new Od(e,t,n,r)}function Ui(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Dd(e){if(typeof e=="function")return Ui(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ri)return 11;if(e===li)return 14}return 2}function gt(e,t){var n=e.alternate;return n===null?(n=ze(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Br(e,t,n,r,l,o){var i=2;if(r=e,typeof e=="function")Ui(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Qt:return It(n.children,l,o,t);case ni:i=8,l|=8;break;case no:return e=ze(12,n,t,l|2),e.elementType=no,e.lanes=o,e;case ro:return e=ze(13,n,t,l),e.elementType=ro,e.lanes=o,e;case lo:return e=ze(19,n,t,l),e.elementType=lo,e.lanes=o,e;case vs:return Sl(n,l,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ms:i=10;break e;case gs:i=9;break e;case ri:i=11;break e;case li:i=14;break e;case rt:i=16,r=null;break e}throw Error(k(130,e==null?e:typeof e,""))}return t=ze(i,n,t,l),t.elementType=e,t.type=r,t.lanes=o,t}function It(e,t,n,r){return e=ze(7,e,r,t),e.lanes=n,e}function Sl(e,t,n,r){return e=ze(22,e,r,t),e.elementType=vs,e.lanes=n,e.stateNode={isHidden:!1},e}function Jl(e,t,n){return e=ze(6,e,null,t),e.lanes=n,e}function ql(e,t,n){return t=ze(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Ud(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ll(0),this.expirationTimes=Ll(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ll(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Bi(e,t,n,r,l,o,i,u,s){return e=new Ud(e,t,n,u,s),t===1?(t=1,o===!0&&(t|=8)):t=0,o=ze(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},xi(o),e}function Bd(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(dc)}catch(e){console.error(e)}}dc(),cs.exports=Ee;var Hd=cs.exports,pc,qu=Hd;pc=qu.createRoot,qu.hydrateRoot;const Qd=(e,t,n)=>{const r=(n.fontSize+t*n.maxSizeMultiplier/255).toFixed(2);e.font=`${r}px ${n.selectedFont}`;const o=e.measureText(n.textInput).width,i=parseInt(r),u=n.x-o/2,s=n.y+i/2;e.strokeStyle=n.borderColor,e.lineWidth=n.borderThickness,e.strokeText(n.textInput,u,s),e.fillStyle=n.fontColor,e.fillText(n.textInput,u,s)},hc=(e,t,n,r,l=!1)=>({x:Math.random()*e.width,y:l?Math.random()*e.height:e.height+Math.random()*100,size:t,xDelta:(Math.random()-.5)*2,ySpeed:n,color:r}),Kd=(e,t)=>{const n=[];for(let r=0;r{const o=r.reduce((u,s)=>u+s)/r.length;let i=4;l.zigzagSmoothness>5?i+=o/512*l.beatSpeedUp:i+=o/255*l.beatSpeedUp,t.forEach(u=>{u.y-=i,u.x+=u.xDelta*l.zigzagSmoothness,e.beginPath(),e.arc(u.x,u.y,l.circleSize,0,Math.PI*2),e.fillStyle=l.circleColor,e.fill(),Math.random()<.1&&(u.xDelta=-u.xDelta),u.y+u.size<0&&Object.assign(u,hc(e.canvas,u.size,u.ySpeed,u.color,!1))})},Xo=new Image;let mc=!1;const Xd=e=>{Xo.src=e,Xo.onload=()=>{mc=!0}},Gd=(e,t,n,r,l,o)=>{if(!mc)return;r=1,l.getByteFrequencyData(o);const i=o.reduce((c,g)=>c+g)/o.length,u=1+i/512*r,s=Math.min(i/512*(r/10),Math.PI/4);e.save(),e.translate(t.width/2,t.height/2),e.rotate(s),e.scale(u,u),e.drawImage(Xo,-t.width/2,-t.height/2,t.width,t.height),e.restore()},Zd=(e,t,n,r,l)=>{const{shakeIntensity:o,backgroundImage:i}=l;n.getByteFrequencyData(r);const u=r.reduce((c,g)=>c+g)/r.length,s=o*(u/255);Gd(e,t,i,s,n,r)};async function Jd(e){const t=Object.assign({},e);if(console.log("type: ",t.background.backgroundImage,typeof t.background.backgroundImage,t.background.backgroundImage instanceof Blob),t.background.backgroundImage!==""){const r=await fetch(t.background.backgroundImage).then(o=>o.blob()),l=await bd(r);t.background.backgroundImage=l}const n=JSON.stringify(t);localStorage.setItem("save",n)}function qd(){const e=localStorage.getItem("save"),t=JSON.parse(e||"{}");if(typeof t.background.backgroundImage=="string"&&t.background.backgroundImage!==""){const n=ep(t.background.backgroundImage),r=URL.createObjectURL(n);t.background.backgroundImage=r}return t}function bd(e){return new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)})}function ep(e){const t=atob(e.split(",")[1]),n=e.split(",")[0].split(":")[1].split(";")[0],r=new Array(t.length);for(let o=0;o{var m;const[t,n]=I.useState(!1),[r,l]=I.useState(0),[o,i]=I.useState(1),u=()=>{e.current&&(t?e.current.pause():e.current.play(),n(!t))},s=p=>{const w=parseInt(p.target.value);e.current.currentTime=w,l(w)},c=p=>{const w=parseFloat(p.target.value);e.current.volume=w,i(w)};I.useEffect(()=>{const p=setInterval(()=>{e.current&&t&&l(e.current.currentTime)},1e3);return()=>clearInterval(p)},[t,e]);const g=p=>{const w=Math.floor(p/60),S=Math.floor(p%60);return`${w}:${S<10?"0":""}${S}`};return h.jsxs("div",{className:"audio-controls",children:[h.jsx("button",{onClick:u,children:t?"Pause":"Play"}),h.jsxs("div",{className:"time-slider",children:[h.jsx("span",{className:"current-time",children:g(r)}),h.jsx("input",{type:"range",style:{width:"100%"},min:"0",max:((m=e.current)==null?void 0:m.duration)||100,value:r,onChange:s})]}),h.jsx("img",{src:tp,alt:"Description of SVG",width:25,height:25})," ",h.jsx("input",{type:"range",min:"0",max:"1",step:"0.01",value:o,onChange:c})]})},bl=""+new URL("music-1upaPx3E.mp3",import.meta.url).href;function bu(e){return e*(1024*1024)}function eo(e,t){const r=e*1024*1024*t/8,l=r/1024**3;return l>=1?`${l.toFixed(2)} GB`:`${(r/1048576).toFixed(2)} MB`}const rp=({audioRef:e,canvasRef:t,settings:n})=>{const[r,l]=I.useState(!1),[o,i]=I.useState(0),[u,s]=I.useState(0),c=I.useRef(null),g=I.useRef([]),m=I.useRef(null);I.useEffect(()=>{g.current=[],i(0),s(0)},[r]);const p=()=>{if(e.current&&t.current){const R=e.current.captureStream(60),f=t.current.captureStream(60),a=new MediaStream([...f.getTracks(),...R.getTracks()]),d=n.current.bitRateInMb||4;c.current=new MediaRecorder(a,{mimeType:"video/webm; codecs=vp9",videoBitsPerSecond:bu(d),bitsPerSecond:bu(d)}),g.current=[],i(0),c.current.ondataavailable=y=>{y.data.size>0&&(g.current.push(y.data),i(C=>C+y.data.size))},c.current.start(1e3),l(!0),m.current=setInterval(()=>{e.current&&e.current.duration&&s(e.current.currentTime/e.current.duration*100)},1e3),e.current.onended=()=>{c.current&&c.current.state==="recording"&&w()},e.current.play()}},w=()=>{c.current&&(c.current.stop(),clearInterval(m.current),l(!1),S())},S=()=>{const R=new Blob(g.current,{type:"video/webm"}),f=URL.createObjectURL(R),a=document.createElement("a");a.href=f,a.download="recording.webm",document.body.appendChild(a),a.click(),setTimeout(()=>{document.body.removeChild(a),window.URL.revokeObjectURL(f)},100)};I.useEffect(()=>{!r&&g.current.length>0&&S()},[r]);const x=R=>R>=1e6?`${(R/1e6).toFixed(2)} MB`:R>=1e3?`${(R/1e3).toFixed(2)} KB`:`${R} bytes`;return h.jsxs("div",{className:"recorder-controls",children:[h.jsx("button",{onClick:r?w:p,children:r?"Stop Recording":"Start Recording"}),r&&h.jsxs(h.Fragment,{children:[h.jsxs("p",{children:["Current File Size: ",x(o)]}),h.jsxs("p",{children:["Audio Progress: ",u.toFixed(2),"%"]})]})]})},lp=(e,t,n,r)=>{const l=r.circle.imageX,o=r.circle.imageY;let i=r.circle.baseRadius;for(let u=0;u{const l=r.numBars??n.length;r.useFullWidth&&(r.barWidth=(e.canvas.width-r.spacing*(l+1))/l);const o=r.xPos!==void 0?e.canvas.width*(r.xPos/100):r.spacing,i=r.yPos!==void 0?e.canvas.height*(r.yPos/100):e.canvas.height,u=l*r.barWidth+(l-1)*r.spacing,s=o-u/2;for(let c=0;c{var _t,Wi;const[e,t]=I.useState(null),[n,r]=I.useState(!1),l=I.useRef(null),o=I.useRef(new Audio),i=I.useRef(null),u=I.useRef(null),s=I.useRef(null),c=I.useRef(null),g={"420p":{width:640,height:420},HD:{width:1280,height:720},FullHD:{width:1920,height:1080},"2K":{width:2560,height:1440}},m=I.useRef({simpleBar:!0,circleBar:!1,backgroundCircles:!0,text:!0}),p=I.useRef({maxSizeMultiplier:55,smoothness:100,borderColor:"#000000",borderThickness:1,fontSize:20,fontColor:"#000000",textInput:"Sample Text",selectedFont:"Arial",x:g.FullHD.width/2,y:g.FullHD.height/4}),w=I.useRef({circleSize:5,circleSpeed:1,circleColor:"#d3d3d3",numberOfCircles:11,beatSpeedUp:25,zigzagSmoothness:1}),S=I.useRef({barStyle:"top",spacing:11,barLength:1,barWidth:22,beatMultiplier:2,barColor:"white",numBars:11,useFullWidth:!0,xPos:50,yPos:100}),x=I.useRef({backgroundColor:"#f59292",backgroundImage:"",shakeIntensity:0}),R=I.useRef({bitRateInMb:6}),f=I.useRef({circle:{baseRadius:22,growthFactor:222,color:"#006400",imageX:g.FullHD.width/2,imageY:g.FullHD.height/2},bars:{widthMultiplier:155,lengthMultiplier:2,color:v=>`rgb(${v*2}, ${200-v*2}, ${50+v*2})`}}),a=v=>{const{name:V,value:Z}=v.target,[we,Pt]=V.split(".");f.current[we][Pt]=isNaN(Z)?Z:Number(Z)},[d,y]=I.useState("color"),C=v=>{y(v.target.value)},[P,z]=I.useState({text:!1,font:!1,circle:!1,background:!1,render:!1,musicVisualization:!1,simpleBar:!1}),N=v=>{z(V=>({...V,[v]:!V[v]}))},A=v=>{const V=v.target.files;V&&V[0]&&new FontFace("CustomFont",`url(${URL.createObjectURL(V[0])})`).load().then(we=>{document.fonts.add(we),p.current.selectedFont="CustomFont"}).catch(we=>console.error("Error loading font:",we))},L=v=>{p.current.selectedFont=v.target.value},pe=async()=>{try{const V=await(await fetch(bl)).blob();return new File([V],"defaultMusic.mp3",{type:"audio/mpeg"})}catch(v){return console.error("Error fetching default audio file:",v),null}},xt=async v=>{const V=v.target.files;if(V){const Z=URL.createObjectURL(V[0]);o.current.src=Z,t(V[0])}else{console.log("set file");const Z=await pe();o.current.src=bl,t(null),t(Z)}setTimeout(()=>{console.log(R.current.bitRateInMb,o.current.duration),X(eo(R.current.bitRateInMb,o.current.duration))},222)},Ct=()=>{Jd({text:p.current,background:x.current,circle:w.current})},ar=()=>{const v=qd();w.current=v.circle,x.current=v.background,p.current=v.text},Pl=async()=>{if(!e){console.log("set file");const v=await pe();o.current.src=bl,t(null),t(v)}if(!i.current){i.current=new AudioContext;const v=i.current.createMediaElementSource(o.current);u.current=i.current.createAnalyser(),v.connect(u.current),u.current.connect(i.current.destination)}o.current.playbackRate=1,o.current.play().then(()=>{if(r(!0),u.current){u.current.fftSize=256;const v=u.current.frequencyBinCount;s.current=new Uint8Array(v),wn()}}).catch(v=>console.error("Error playing audio:",v))};let $t=[];l.current&&($t=Kd(l.current,w.current));const wn=()=>{if(!l.current||!l.current||!u.current||!s.current)return;const v=l.current.getContext("2d");if(!v)return;const V=()=>{x.current.backgroundImage!==null&&x.current.backgroundImage!==""?Zd(v,l.current,u.current,s.current,x.current):(v.clearRect(0,0,l.current.width,l.current.height),v.fillStyle=x.current.backgroundColor,v.fillRect(0,0,l.current.width,l.current.height)),m.current.backgroundCircles&&Yd(v,$t,u.current,s.current,w.current);const Z=u.current.frequencyBinCount,we=s.current;u.current.getByteFrequencyData(we);const Pt=we.reduce((cr,gc)=>cr+gc)/we.length;m.current.simpleBar&&op(v,Z,we,S.current),m.current.circleBar&&lp(v,Z,we,f.current),m.current.text&&Qd(v,Pt,p.current),c.current=requestAnimationFrame(V)};V()},E=v=>{if(!v.target.files){console.warn("no file selected");return}const V=v.target.files[0],Z=URL.createObjectURL(V);Xd(Z),x.current.backgroundImage=Z};I.useEffect(()=>()=>{c.current&&cancelAnimationFrame(c.current),i.current&&i.current.close()},[]);const[j,T]=I.useState("FullHD"),[W,X]=I.useState("");I.useEffect(()=>{const v=l.current;if(v&&g[j]){const{width:V,height:Z}=g[j];v.width=V,v.height=Z}},[j]);const At=v=>{if(!v.target.files){console.warn("no file selected");return}const V=v.target.files[0];if(V){const Z=new FileReader;Z.onload=we=>{var cr;const Pt=new Image;Pt.onload=()=>{f.current.circle.image=Pt},Pt.src=(cr=we.target)==null?void 0:cr.result},Z.readAsDataURL(V)}},Qe=v=>{T(v.target.value)},Et=((_t=l.current)==null?void 0:_t.width)||0,Be=((Wi=l.current)==null?void 0:Wi.height)||0;return h.jsxs("div",{className:"container",children:[h.jsxs("div",{style:{textAlign:"right",margin:"10px"},children:[h.jsx("button",{onClick:Ct,children:"Save"}),h.jsx("button",{onClick:ar,style:{margin:"5px"},children:"Load"})]}),h.jsxs("div",{className:"control-group",children:["Audio file: ",h.jsx("input",{type:"file",onChange:xt,accept:"audio/*"}),h.jsx("div",{className:"container",children:h.jsx(np,{audioRef:o})}),h.jsx("button",{onClick:Pl,children:"Start & visualize"})]}),h.jsx("div",{className:"group-header",onClick:()=>N("render"),children:"Render / Export"}),P.render&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Canvas Resolution:",h.jsx("select",{value:j,onChange:Qe,children:Object.keys(g).map(v=>h.jsx("option",{value:v,children:v},v))})]}),h.jsxs("label",{children:["Bitrate:",h.jsx("input",{type:"number",defaultValue:"6",onChange:v=>{R.current.bitRateInMb=parseFloat(v.target.value),console.log(eo(R.current.bitRateInMb,o.current.duration)),X(eo(R.current.bitRateInMb,o.current.duration))}}),"MB"]}),h.jsx("hr",{}),"Estimated video file size is: ",W,h.jsx("label",{children:e&&h.jsx(rp,{audioRef:o,settings:R,canvasRef:l},e.name)})]}),h.jsx("div",{className:"group-header",onClick:()=>N("text"),children:"Text Settings"}),P.text&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Text:",h.jsx("input",{type:"text",defaultValue:"Sample Text",onChange:v=>p.current.textInput=v.target.value})]}),h.jsxs("label",{children:["Text X Coordinate:",h.jsx("input",{type:"range",name:"text.x",min:"0",max:Et,defaultValue:"0",onChange:v=>p.current.x=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Text Y Coordinate:",h.jsx("input",{type:"range",name:"text.y",min:"0",max:Be,defaultValue:"0",onChange:v=>p.current.y=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Max Size Multiplier:",h.jsx("input",{type:"number",defaultValue:"55",onChange:v=>p.current.maxSizeMultiplier=parseFloat(v.target.value)})]}),h.jsxs("label",{children:["Border Color:",h.jsx("input",{type:"color",defaultValue:"#000000",onChange:v=>p.current.borderColor=v.target.value})]}),h.jsxs("label",{children:["Border Thickness:",h.jsx("input",{type:"number",defaultValue:"1",onChange:v=>p.current.borderThickness=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Font Size:",h.jsx("input",{type:"number",defaultValue:"20",onChange:v=>p.current.fontSize=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Font Color:",h.jsx("input",{type:"color",defaultValue:"#000000",onChange:v=>p.current.fontColor=v.target.value})]}),h.jsx("div",{className:"group-header",onClick:()=>N("font"),children:"Font Settings"}),P.font&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Font:",h.jsx("select",{onChange:L,children:["Arial","Verdana","Times New Roman","Georgia","Courier New"].map(v=>h.jsx("option",{value:v,children:v},v))})]}),h.jsxs("label",{children:["or upload a font file:",h.jsx("input",{type:"file",onChange:A,accept:".ttf, .otf"})]})]})]}),h.jsx("div",{className:"group-header",onClick:()=>N("musicVisualization"),children:"Circle with bars Settings"}),P.musicVisualization&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Circle Base Radius:",h.jsx("input",{type:"number",name:"circle.baseRadius",defaultValue:f.current.circle.baseRadius,onChange:a})]}),h.jsxs("label",{children:["Circle Growth Factor:",h.jsx("input",{type:"number",name:"circle.growthFactor",defaultValue:f.current.circle.growthFactor,onChange:a})]}),h.jsxs("label",{children:["Circle Color:",h.jsx("input",{type:"color",name:"circle.color",defaultValue:f.current.circle.color,onChange:a})]}),h.jsxs("label",{children:["Circle Image:",h.jsx("input",{type:"file",onChange:At,accept:"image/*"})]}),h.jsxs("label",{children:["X Coordinate:",h.jsx("input",{type:"range",name:"circle.imageX",min:"0",max:Et,defaultValue:Et/2,onChange:a})]}),h.jsxs("label",{children:["Y Coordinate:",h.jsx("input",{type:"range",name:"circle.imageY",min:"0",max:Be,defaultValue:f.current.circle.imageY,onChange:a})]}),h.jsxs("label",{children:["Bars Width Multiplier:",h.jsx("input",{type:"number",name:"bars.widthMultiplier",defaultValue:f.current.bars.widthMultiplier,onChange:a})]}),h.jsxs("label",{children:["Bars Length Multiplier:",h.jsx("input",{type:"number",name:"bars.lengthMultiplier",defaultValue:f.current.bars.lengthMultiplier,onChange:a})]})]}),h.jsx("div",{className:"group-header",onClick:()=>N("circle"),children:"Circle Settings"}),P.circle&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Number of Circles:",h.jsx("input",{type:"number",defaultValue:"11",onChange:v=>{w.current.numberOfCircles=parseInt(v.target.value)}})]}),h.jsxs("label",{children:["Circle Size:",h.jsx("input",{type:"number",defaultValue:"12",onChange:v=>w.current.circleSize=parseFloat(v.target.value)})]}),h.jsxs("label",{children:["beat speed up factor:",h.jsx("input",{type:"number",defaultValue:"12",onChange:v=>w.current.beatSpeedUp=parseFloat(v.target.value)})]}),h.jsxs("label",{children:["Circle Speed:",h.jsx("input",{type:"number",defaultValue:"11",onChange:v=>w.current.circleSpeed=parseFloat(v.target.value)})]}),h.jsxs("label",{children:["Circle Color:",h.jsx("input",{type:"color",defaultValue:"Red",onChange:v=>w.current.circleColor=v.target.value})]})]}),h.jsx("div",{className:"group-header",onClick:()=>N("simpleBar"),children:"Simple Bar Settings"}),P.simpleBar&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Bar Style:",h.jsxs("select",{defaultValue:"bottom",onChange:v=>S.current.barStyle=v.target.value,children:[h.jsx("option",{value:"top",children:"Top"}),h.jsx("option",{value:"bottom",children:"Bottom"}),h.jsx("option",{value:"both",children:"Both"})]})]}),h.jsxs("label",{children:["Spacing:",h.jsx("input",{type:"number",defaultValue:"11",onChange:v=>S.current.spacing=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Bar Width:",h.jsx("input",{type:"number",defaultValue:"22",onChange:v=>S.current.barWidth=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Beat Multiplier:",h.jsx("input",{type:"number",defaultValue:"2",onChange:v=>S.current.beatMultiplier=parseFloat(v.target.value)})]}),h.jsxs("label",{children:["Bar Color:",h.jsx("input",{type:"color",defaultValue:"#ffffff",onChange:v=>S.current.barColor=v.target.value})]}),h.jsxs("label",{children:["Number of Bars:",h.jsx("input",{type:"number",defaultValue:"11",onChange:v=>S.current.numBars=parseInt(v.target.value)})]}),h.jsxs("label",{children:["Use Full Width:",h.jsx("input",{type:"checkbox",defaultChecked:S.current.useFullWidth,onChange:v=>S.current.useFullWidth=v.target.checked})]}),h.jsxs("label",{children:["X Position (%):",h.jsx("input",{type:"range",min:"0",max:"100",defaultValue:"50",onChange:v=>S.current.xPos=parseInt(v.target.value)}),S.current.xPos,"%"]}),h.jsxs("label",{children:["Y Position (%):",h.jsx("input",{type:"range",min:"0",max:"100",defaultValue:"50",onChange:v=>S.current.yPos=parseInt(v.target.value)}),S.current.yPos,"%"]})]}),h.jsx("div",{className:"group-header",onClick:()=>N("background"),children:"Background settings"}),P.background&&h.jsxs("div",{className:"settings-group",children:[h.jsxs("label",{children:["Type:",h.jsxs("select",{value:d,onChange:C,children:[h.jsx("option",{value:"color",children:"Color"}),h.jsx("option",{value:"image",children:"Image"})]})]}),d==="color"&&h.jsxs("label",{children:["Color:",h.jsx("input",{type:"color",value:x.current.backgroundColor,onChange:v=>x.current.backgroundColor=v.target.value})]}),d==="image"&&h.jsxs("label",{children:["Image:",h.jsx("input",{type:"file",onChange:E,accept:"image/*"})]})]}),h.jsxs("div",{className:"visuals-settings",children:[h.jsxs("label",{children:["Enable Simple Bar:",h.jsx("input",{type:"checkbox",defaultChecked:m.current.simpleBar,onChange:v=>m.current.simpleBar=v.target.checked})]}),h.jsxs("label",{children:["Enable Circle Bar:",h.jsx("input",{type:"checkbox",defaultChecked:m.current.circleBar,onChange:v=>m.current.circleBar=v.target.checked})]}),h.jsxs("label",{children:["Enable Background Circles:",h.jsx("input",{type:"checkbox",defaultChecked:m.current.backgroundCircles,onChange:v=>m.current.backgroundCircles=v.target.checked})]}),h.jsxs("label",{children:["Enable Text:",h.jsx("input",{type:"checkbox",defaultChecked:m.current.text,onChange:v=>m.current.text=v.target.checked})]})]}),h.jsx("canvas",{ref:l,style:{width:"80%",height:"auto"},width:"1920",height:"1080"}),h.jsx("audio",{ref:o,crossOrigin:"anonymous"})]})},up=document.getElementById("root"),sp=pc(up);sp.render(h.jsx(Ic.StrictMode,{children:h.jsx(ip,{})})); diff --git a/index.html b/index.html index 8f7d850..369abfe 100644 --- a/index.html +++ b/index.html @@ -5,14 +5,14 @@ - + Canvasbeats - +